/** * A host-supplied way to launch the local `sapiom-dev` stdio server instead of * the default `npx @sapiom/mcp@latest`. * * Why this exists (Windows, desktop host): the npx chain's top process is * cmd.exe — a console-subsystem image — and Claude Code's Windows spawns leave * a PERSISTENT visible console window for it. Users close that window, which * kills the MCP server's process tree, and every later tool call hangs against * the dead server. A GUI-subsystem executable (the Electron binary running as * Node via ELECTRON_RUN_AS_NODE in `env`) allocates no console under ANY spawn * flags while stdio pipes still work — so the desktop host passes itself plus * the installed @sapiom/mcp entry script here. Bonus on every platform: no * per-session registry fetch (npx re-resolves `@latest` each launch). */ export interface McpDevServerCommand { command: string; args: string[]; env?: Record; } export interface McpConfigOptions { /** Override for the local sapiom-dev server launch — see {@link McpDevServerCommand}. */ devServer?: McpDevServerCommand; /** SAPIOM_ENVIRONMENT to pass through to the sapiom-dev child process. */ environment?: string; /** * Cached Sapiom API key (from CLI auth), if signed in. Sent as * `x-api-key` on the remote `sapiom` MCP — empirically verified against * api.sapiom.ai/v1/mcp (both `x-api-key` and `Authorization: Bearer` are * accepted for `sk_`-prefixed keys; `x-api-key` matches its CORS * allow-list order and needs no prefix formatting). Omitted entirely when * absent (`--no-auth`, or not yet signed in) — every remote tool call * then 401s, same as today. */ apiKey?: string | null; /** Root directory generated configs live under. Defaults to * HARNESS_PATHS.generated. Override in tests to avoid the real home dir. */ generatedRoot?: string; /** * This harness's own version, advertised to the sapiom-dev child as * `SAPIOM_HARNESS_VERSION`. The MCP is `npx`'d from the registry and so has * no way to know which Studio launched it; `sapiom_send_feedback` stamps this * into every feedback record, which is what makes "which build is this user * on" answerable during triage. Omitted when absent — the tool leaves the * field out rather than inventing an "unknown". */ harnessVersion?: string; } /** * Writes the MCP config file for a harness session: the remote HTTP * capability MCP (`sapiom`) and the local stdio authoring MCP (`sapiom-dev`). * Written under `HARNESS_PATHS.generated//` so concurrent * sessions never share (or race on) a config file. Returns the file's * absolute path. Claude passes it as `--mcp-config `; Codex translates * it to per-process config overrides and environment variables. */ export declare function generateMcpConfig(harnessSessionId: string, options?: McpConfigOptions): Promise; //# sourceMappingURL=mcp-config.d.ts.map