import { type InitiativeOperation } from '@zhixuan92/multi-model-agent-core'; /** * The two frozen capability literals this server can ever declare, plus the pure * selector between them (below). * * Both the SDK `Server` constructor and the `server/discover` handler read the SAME * resolved binding (carried on `McpAdapterDeps.capabilities`, resolved once at daemon * start in `http/server.ts`). Two hand-maintained copies would drift, and a discover * response that disagrees with `initialize` is worse than having no discover at all. * * This one declares `resources` and the `io.modelcontextprotocol/ui` extension — a * promise to the host that this server can serve UI resources — selected ONLY once a * real execution-app bundle backs it (see `execution-artifact.ts`). */ export declare const MCP_CAPABILITIES_WITH_APP: { readonly tools: {}; readonly resources: {}; readonly extensions: { readonly 'io.modelcontextprotocol/ui': {}; }; }; /** * Byte-identical to the pre-Flow-2 value: `extensions` is present and deliberately * EMPTY, and there is no `resources` capability, so `resources/list` / `resources/read` * correctly answer method-not-found when no real `ui://` resource is available to serve. */ export declare const MCP_CAPABILITIES_TOOLS_ONLY: { readonly tools: {}; readonly extensions: {}; }; export type McpCapabilities = typeof MCP_CAPABILITIES_TOOLS_ONLY | typeof MCP_CAPABILITIES_WITH_APP; /** * PURE selector between the two frozen capability literals. No I/O — the caller * (`http/server.ts`) resolves `executionAppResourceAvailable` from * `getExecutionArtifact().available` exactly once at daemon start and passes the * result down as `McpAdapterDeps.capabilities`; `buildMcpServer` never recomputes it. */ export declare function resolveMcpCapabilities(executionAppResourceAvailable: boolean): McpCapabilities; /** The protocol version this server reports. See SDK-PROTOCOL-RECHECK above. */ export declare const MCP_PROTOCOL_VERSION = "2025-11-25"; /** How the caller wants the result delivered. A preference, not a force — * work likely to exceed the transport's patience is promoted to a handle. */ export declare const DELIVERY_MODES: readonly ["auto", "inline", "handle"]; export type DeliveryMode = (typeof DELIVERY_MODES)[number]; /** Task types short enough to complete within an inline tool call. Everything * else returns a handle under 'auto'. */ export declare const INLINE_AUTO_TYPES: Set; /** Upper bound one tool call will block waiting for an inline result before * downgrading to a handle. Below typical MCP client tool timeouts. */ export declare const INLINE_WAIT_CAP_MS = 55000; /** * Default + ceiling for mma_execution_wait — the SAME bound as `INLINE_WAIT_CAP_MS`, and for the * same reason. * * The ceiling was 240s, four times the typical MCP client tool timeout. A long-poll cannot * outlive the deadline the CLIENT enforces on the request carrying it: the host kills the * JSON-RPC call and the caller sees `-32001 Request timed out` with no snapshot, no executionId * context, and no indication the work is still running fine. Observed on Claude Desktop — * the model read `capped at 240000` from this schema, asked for it, and got exactly that. * * Advertising a wait the transport cannot deliver invites the failure. Anything longer is * expressed by CALLING AGAIN, which costs one cheap turn and always works. */ export declare const WAIT_DEFAULT_MS = 55000; export declare const WAIT_CAP_MS = 55000; interface McpToolDefinition { name: string; description: string; inputSchema: Record; /** Host-facing metadata. Only `mma_run` carries `ui.resourceUri` — it is the sole * tool whose result is meant to be rendered by an MCP-App-capable host. */ _meta?: Record; } /** Every operation whose envelope carries `MutationControl` (`expected_revision`, * optional `idempotency_key`, `provenance`) — the Phase A0 nine plus the Phase A1 * nine, derived from `initiativeMutationRequestSchema` (the exact discriminated * union `schemas.ts`'s private `mutating()` builder produces) rather than a * hand-maintained duplicate list that could silently drift when a future phase * adds another mutation. Read here so the MCP adapter knows which calls need * adapter-owned provenance stamped (`interface: 'mcp'`, server timestamp) before * dispatch. */ export declare const INITIATIVE_MUTATING_OPERATIONS: Set<"product_create" | "product_get" | "product_list" | "workspace_create" | "workspace_get" | "workspace_list" | "resource_register" | "resource_list" | "initiative_create" | "initiative_get" | "initiative_list" | "initiative_status" | "initiative_resume" | "initiative_link_workspace" | "initiative_relate" | "initiative_relations" | "initiative_task_create" | "initiative_task_get" | "initiative_task_list" | "initiative_task_claim" | "initiative_task_release" | "initiative_task_complete" | "initiative_task_execution" | "artifact_register" | "artifact_get" | "requirement_add" | "requirement_get" | "requirement_list" | "acceptance_criterion_add" | "acceptance_criterion_get" | "acceptance_criterion_list" | "decision_record" | "decision_supersede" | "decision_get" | "decision_list" | "evidence_add" | "evidence_get" | "evidence_list" | "evidence_link" | "evidence_links_list" | "risk_add" | "risk_status" | "risk_get" | "risk_list" | "verification_record" | "verification_get" | "verification_list" | "initiative_phase_enter" | "initiative_phase_satisfy" | "initiative_phase_reopen" | "initiative_phase_skip" | "initiative_focus_set" | "initiative_set_lifecycle_contract" | "initiative_gate_status" | "method_get" | "method_list" | "initiative_task_set_method" | "initiative_bootstrap" | "delivery_contract_get" | "delivery_contract_list" | "deliverable_define" | "deliverable_get" | "deliverable_list" | "deliverable_attach_artifact" | "deliverable_validate" | "deliverable_deliver" | "deliverable_approve" | "verification_run" | "deliverable_package" | "initiative_export" | "initiative_import">; /** `mma_` (or the SPEC-005 `mma_initiative_` override) -> ``, * for every operation EXCEPT the three dedicated reads with their own tool/handler — * `initiative_resume`, `initiative_gate_status` (Task I-5), and `initiative_export` (MMA Next * gap-closure, same "server-side assembly of joined reads, not a single store call" reason). * Built from the frozen `INITIATIVE_OPERATIONS` list so a tool name can never name an operation * `execute()` does not also recognise. */ export declare const INITIATIVE_EXECUTE_OPERATION_BY_TOOL_NAME: ReadonlyMap; export declare const MCP_TOOLS: McpToolDefinition[]; /** Argument names the caller sent that `toolName` does not declare. Empty for an unknown tool * (the dispatcher answers that with `unknown_tool`) and for one that permits extras. */ export declare function unknownToolArguments(toolName: string, args: Record): string[]; export {}; //# sourceMappingURL=tool-surface.d.ts.map