import { z } from "zod"; import type { MCPServerConfig } from "./types.js"; /** * Where a server config lives. We collapse Claude Code's three scopes * (local/project/user) into two: * - "global" → ~/.gg/mcp.json (all GG Coder sessions) * - "project" → ./.gg/mcp.json (the current project root) */ export type MCPScope = "global" | "project"; /** * On-disk entry shape. Accepts both Claude's `.mcp.json` fields * (`type`, `url`, `headers`, `command`, `args`, `env`, `timeout`) and our * extra (`enabled`) so configs are portable in both directions. */ declare const StoredServerEntrySchema: z.ZodObject<{ type: z.ZodOptional>; url: z.ZodOptional; headers: z.ZodOptional>; command: z.ZodOptional; args: z.ZodOptional>; env: z.ZodOptional>; timeout: z.ZodOptional; enabled: z.ZodOptional; }, z.core.$loose>; export type StoredServerEntry = z.infer; declare const McpFileSchema: z.ZodObject<{ mcpServers: z.ZodDefault>; url: z.ZodOptional; headers: z.ZodOptional>; command: z.ZodOptional; args: z.ZodOptional>; env: z.ZodOptional>; timeout: z.ZodOptional; enabled: z.ZodOptional; }, z.core.$loose>>>; }, z.core.$strip>; export type McpFile = z.infer; /** A loaded server config paired with the scope it came from. */ export interface ScopedServer { config: MCPServerConfig; scope: MCPScope; } export declare function globalMcpPath(): string; export declare function projectMcpPath(cwd: string): string; /** Map an on-disk entry to a runtime MCPServerConfig. */ export declare function fromStoredEntry(name: string, entry: StoredServerEntry): MCPServerConfig; /** Map a runtime MCPServerConfig to the on-disk (Claude-compatible) entry. */ export declare function toStoredEntry(config: MCPServerConfig): StoredServerEntry; /** * Load servers from both scopes. Project wins on name collision (global entries * whose name also exists in project are dropped). Each result carries its scope. */ export declare function loadServers(cwd: string): Promise; /** * Add (or overwrite) a server in the target scope's file. Rejects a duplicate * name within the same scope unless `overwrite` is true. */ export declare function addServer(entry: MCPServerConfig, scope: MCPScope, cwd: string, overwrite?: boolean): Promise<{ ok: true; } | { ok: false; error: string; }>; /** Remove a server from a scope. Returns true if it existed. */ export declare function removeServer(name: string, scope: MCPScope, cwd: string): Promise; /** Look up a single server across both scopes (project wins). */ export declare function getServer(name: string, cwd: string): Promise; export {}; //# sourceMappingURL=store.d.ts.map