/** * The MCP tools registry at rest (DES-MCP-TOOLS-001 §5): `/mcp/registry.json`. * * It holds upstreams and their tools with secret REFERENCES only; a value never lands here (D-2). * The `mcp` entry is registered in the state-home fence registry (tests/fixtures/ * state-home-subtrees.json, core's `src/state_home.rs`), so a worker can't read it. The directory * is created on the first save, never at boot. * * Writes are serialized on one promise chain and land atomically (write a sibling temp file, * then rename), so a crash never leaves a torn registry. A registry that does not parse is an * error the routes answer 503; it is never silently replaced by an empty one, because that * would drop every server the operator registered. */ import type { McpAuthConfig, McpHealth, McpRestMapping, McpToolAnnotations, McpToolClass, McpUpstreamKind } from '../core/types.js'; export declare const MCP_STATE_DIRNAME = "mcp"; export declare const MCP_REGISTRY_FILENAME = "registry.json"; /** `/mcp` — the one directory the MCP slices write under. */ export declare function mcpStateDir(): string; export interface McpToolRecord { name: string; description: string | null; inputSchema: Record | null; outputSchema: Record | null; annotations: McpToolAnnotations | null; classOverride: McpToolClass | null; enabled: boolean; /** The hash the operator saved (registered); `null` = never registered (a tool added after the preview). */ schemaHash: string | null; /** The hash the last probe saw; differs from `schemaHash` when the schema changed. */ observedSchemaHash: string; /** `false` = the last probe no longer lists the tool (`gone`, kept so old records resolve). */ present: boolean; /** A `rest` tool's request mapping (slice S5a); absent/`null` for an MCP server's tool. */ rest?: McpRestMapping | null; } export interface McpServerRecord { name: string; kind: McpUpstreamKind; command: string | null; args: string[]; url: string | null; auth: McpAuthConfig | null; /** `rest` only (slice S5a): the OpenAPI URL, or the pasted document; the operations picked. */ openapiUrl?: string | null; openapi?: Record | null; operations?: string[] | null; /** * `rest` only (G2): the origin the operator confirmed with `allowOrigin` (a base URL that * matches none of the spec's `servers`, or a private address). Kept while the server still goes * there, so a re-save over it does not ask again. */ allowedOrigin?: string; enabled: boolean; health: McpHealth; registeredAt: string; updatedAt: string; tools: McpToolRecord[]; } export interface McpRegistryFile { version: 1; servers: McpServerRecord[]; } export declare class McpRegistryCorruptError extends Error { } export declare class McpRegistryStore { private readonly dir; private tail; constructor(dir?: string); get path(): string; read(): Promise; /** Read, apply `fn`, write back, one mutation at a time. `fn`'s result is returned. */ mutate(fn: (file: McpRegistryFile) => T | Promise): Promise; private write; } //# sourceMappingURL=registry-store.d.ts.map