diff --git a/README.md b/README.md index c728afb..acc9ebe 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For raw HTTP responses, non-text content, or simple API calls, the LLM is steere ## Config -Drop a JSON file at `~/.pi/pi-search/config.json`: +Drop a JSON file at `~/.pi/pi-web/config.json`: ```json { @@ -34,11 +34,11 @@ Drop a JSON file at `~/.pi/pi-search/config.json`: ### Env Var Overrides -| Variable | Overrides | -| ----------------------- | ----------------- | -| `PI_SEARCH_PROVIDER` | `provider` | -| `KAGI_TOKEN` | `kagi.token` | -| `PI_SEARCH_SEARXNG_URL` | `searxng.baseUrl` | +| Variable | Overrides | +| --------------------- | ----------------- | +| `PI_WEB_PROVIDER` | `provider` | +| `KAGI_TOKEN` | `kagi.token` | +| `PI_WEB_SEARXNG_URL` | `searxng.baseUrl` | ### Getting A Kagi Session Token diff --git a/flake.nix b/flake.nix index 3e23efa..675d0c4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "pi-search extension development environment"; + description = "pi-web extension development environment"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; diff --git a/index.ts b/index.ts index a71f8b0..2287870 100644 --- a/index.ts +++ b/index.ts @@ -1,6 +1,6 @@ // Pi-Web Extension - Registers `web_search` and `web_fetch` tools backed by // a shared headless Firefox session. Provider config lives in -// ~/.pi/pi-search/config.json (env overrides supported). +// ~/.pi/pi-web/config.json (env overrides supported). import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; import { Type } from "typebox"; import { ConfigError, loadConfig, resolveSettings } from "./src/config.ts"; diff --git a/src/config.ts b/src/config.ts index 012f20f..0cffe75 100644 --- a/src/config.ts +++ b/src/config.ts @@ -26,7 +26,7 @@ export class ConfigError extends Error { export function defaultConfigPath( env: NodeJS.ProcessEnv = process.env, ): string { - return join(env.HOME ?? homedir(), ".pi", "pi-search", "config.json"); + return join(env.HOME ?? homedir(), ".pi", "pi-web", "config.json"); } function isObject(value: unknown): value is Record { @@ -85,15 +85,15 @@ export function resolveSettings( config: PiSearchConfig, env: NodeJS.ProcessEnv = process.env, ): ResolvedSettings { - const provider = (env.PI_SEARCH_PROVIDER as Provider) ?? config.provider; + const provider = (env.PI_WEB_PROVIDER as Provider) ?? config.provider; if (!provider) { throw new ConfigError( - "no provider configured. Set provider in ~/.pi/pi-search/config.json or PI_SEARCH_PROVIDER env.", + "no provider configured. Set provider in ~/.pi/pi-web/config.json or PI_WEB_PROVIDER env.", ); } return { provider, kagiToken: env.KAGI_TOKEN ?? config.kagi?.token, - searxngBaseUrl: env.PI_SEARCH_SEARXNG_URL ?? config.searxng?.baseUrl, + searxngBaseUrl: env.PI_WEB_SEARXNG_URL ?? config.searxng?.baseUrl, }; } diff --git a/src/providers/searxng.ts b/src/providers/searxng.ts index 1cae5ee..f8c1aad 100644 --- a/src/providers/searxng.ts +++ b/src/providers/searxng.ts @@ -22,7 +22,7 @@ export async function searchSearxng({ if (!baseUrl) { throw new SearchError( "SEARXNG_URL_REQUIRED", - "SearXNG search requires a base URL. Set searxng.baseUrl in config or PI_SEARCH_SEARXNG_URL env.", + "SearXNG search requires a base URL. Set searxng.baseUrl in config or PI_WEB_SEARXNG_URL env.", ); }