/** * Factory entry-point for embedding the reclaim-agent's MCP tools into * a host MCP server via `registerToolList` (server.ts) on the high-level * `@modelcontextprotocol/sdk` `McpServer`. Folds the agent's tools * alongside the auto-generated API tools. * * Shared state — Chrome attach state + capture store — is built once per * server and threaded through every tool factory. Per-capture drafts (and the * secrets they hold) live inside each capture entry, so a capture IS the * session for the shared authoring tools. */ import type { ReclaimClient } from '@reclaimprotocol/client/api'; import { ConfigStore } from '../../../config/store.ts'; import { type RegisteredTool } from '../../server.ts'; import { type AttachState } from './attach.ts'; import { type CaptureStore } from './capture.ts'; import { type LiveShareRef } from './live-view.ts'; export interface AgentState { attach: { current?: AttachState; config: ConfigStore; }; captures: CaptureStore; /** The one public live view, when `share_browser_view` has opened it. */ liveShare: LiveShareRef; } /** Exported so a mode (for example, old-devtools) that supplies its own * publish tool can build the attach/capture state up front and share the SAME * instance with `buildAgentTools` — letting that publish tool see the live * attach state (for example, to remind the caller about a still-open browser * session). */ export declare function buildAgentState(): AgentState; /** Build the flat list of `RegisteredTool` entries, ready for * `registerToolList`. * Pass `client` to include the builder `create_provider_version_from_capture`; * omit it (for example, OLD-devtools mode) to register only the * backend-independent capture/proof tools — old mode supplies its own publish * tool. Pass `externalState` to share attach/capture state with tools * registered elsewhere (for example, old mode's publish tool) instead of * building a fresh one. */ export declare function buildAgentTools(client?: ReclaimClient, builderClient?: ReclaimClient | undefined, externalState?: AgentState): RegisteredTool[]; /** * Tear down an agent state on the way out. Safe to call more than once, and * safe when nothing was ever attached. */ export declare function disposeAgentState(state: AgentState): Promise;