import { type AgentDef, type MemaxBin } from "./setup-types.js"; export declare function getApiUrl(): string; /** * Sets up MCP with OAuth discovery (no API key in config). * * The MCP client discovers auth endpoints via .well-known/oauth-protected-resource * and .well-known/oauth-authorization-server, then completes the OAuth flow in * the user's browser when it first connects. Agent identity is auto-detected * from the OAuth client_name. * * Each agent gets its own config shape via agent.remoteEntry() — some use * { type: "url" }, some use { type: "http" }, some use { httpUrl }, etc. */ export declare function setupMcpOAuth(agent: AgentDef): void; /** * Renders the [mcp_servers.memax] TOML section for Codex. * * Codex only reads HTTP headers from a nested `http_headers` table — a plain * `headers` table is silently ignored, which leaves the server configured but * rejected with 401 on every connection. Verify with `codex mcp list --json`: * the key must show up under transport.http_headers. */ export declare function codexMcpTomlSection(mcpUrl: string, apiKey?: string): string; /** * Replaces the memax section (and any of its sub-tables) in a TOML config, * preserving everything else in the file. */ export declare function upsertMemaxTomlSection(agent: AgentDef, section: string): void; export type CodexAuthStatus = "ok" | "needs_login" | "unknown"; /** Parses `codex mcp list --json` output into a memax auth status. */ export declare function parseCodexAuthStatus(json: string): CodexAuthStatus; export declare function codexAuthStatus(): CodexAuthStatus; /** * Called after OAuth-mode setup configured Codex. Checks login state and, in * interactive sessions, offers to run `codex mcp login memax` on the spot. * Never fails setup — worst case it prints the command to run manually. */ export declare function finalizeCodexOAuthLogin(): Promise; export declare function ensureApiKey(hubId?: string, agentName?: string, opts?: { readOnly?: boolean; allowDelete?: boolean; allowOrganize?: boolean; agentSync?: boolean; }): Promise; export declare function ensureLocalAgentKey(agentName: string): Promise; export declare function setupMcpRemote(agent: AgentDef, apiKey: string): void; /** * Upsert the memax entry under a root-level `mcp_servers:` block in a YAML * config, editing line-wise instead of pulling in a YAML dependency for one * agent (Hermes). Preserves everything else in the file — other servers, * comments, unrelated top-level keys — and adapts to the file's existing * child indentation (2 spaces, 4 spaces, tabs). * * Returns null when the file cannot be edited safely (flow-style * `mcp_servers: {...}`) — callers must fall back to manual instructions * rather than corrupt the config. */ export declare function upsertYamlMcpServersBlock(content: string, entry: { command: string; args: string[]; }): string | null; export declare function setupMcp(agent: AgentDef, bin: MemaxBin): void; export declare function setupMcpClaudeCode(bin: MemaxBin): void; export declare function setupMcpToml(agent: AgentDef, bin: MemaxBin): void; export declare function printMcpConfigs(opts: { local: boolean; apiKey: boolean; hub?: string; readOnly?: boolean; allowDelete?: boolean; allowOrganize?: boolean; agentSync?: boolean; }): Promise; export declare function removeMcpJson(agent: AgentDef): boolean; export declare function removeMcpToml(agent: AgentDef): boolean; export declare function getNestedKey(obj: Record, key: string): Record | undefined; export declare function setNestedKey(obj: Record, key: string, value: unknown): void; export declare function deleteNestedKey(obj: Record, key: string): void; //# sourceMappingURL=setup-mcp.d.ts.map