@cogitator-ai/mcp 19.8.3 → 19.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +130 -8
  2. package/dist/adapter/tool-adapter.d.ts +8 -8
  3. package/dist/adapter/tool-adapter.d.ts.map +1 -1
  4. package/dist/adapter/tool-adapter.js +21 -16
  5. package/dist/adapter/tool-adapter.js.map +1 -1
  6. package/dist/client/input.d.ts +47 -0
  7. package/dist/client/input.d.ts.map +1 -0
  8. package/dist/client/input.js +125 -0
  9. package/dist/client/input.js.map +1 -0
  10. package/dist/client/mcp-client.d.ts +84 -8
  11. package/dist/client/mcp-client.d.ts.map +1 -1
  12. package/dist/client/mcp-client.js +614 -112
  13. package/dist/client/mcp-client.js.map +1 -1
  14. package/dist/client/oauth.d.ts +42 -0
  15. package/dist/client/oauth.d.ts.map +1 -0
  16. package/dist/client/oauth.js +171 -0
  17. package/dist/client/oauth.js.map +1 -0
  18. package/dist/client/param-headers.d.ts +10 -0
  19. package/dist/client/param-headers.d.ts.map +1 -0
  20. package/dist/client/param-headers.js +65 -0
  21. package/dist/client/param-headers.js.map +1 -0
  22. package/dist/client/raw-dispatch.d.ts +40 -0
  23. package/dist/client/raw-dispatch.d.ts.map +1 -0
  24. package/dist/client/raw-dispatch.js +148 -0
  25. package/dist/client/raw-dispatch.js.map +1 -0
  26. package/dist/client/rounds.d.ts +14 -0
  27. package/dist/client/rounds.d.ts.map +1 -0
  28. package/dist/client/rounds.js +33 -0
  29. package/dist/client/rounds.js.map +1 -0
  30. package/dist/client/tasks.d.ts +70 -0
  31. package/dist/client/tasks.d.ts.map +1 -0
  32. package/dist/client/tasks.js +186 -0
  33. package/dist/client/tasks.js.map +1 -0
  34. package/dist/client/transports.d.ts +5 -3
  35. package/dist/client/transports.d.ts.map +1 -1
  36. package/dist/client/transports.js +9 -8
  37. package/dist/client/transports.js.map +1 -1
  38. package/dist/digest.d.ts +8 -0
  39. package/dist/digest.d.ts.map +1 -0
  40. package/dist/digest.js +25 -0
  41. package/dist/digest.js.map +1 -0
  42. package/dist/index.d.ts +7 -3
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +6 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/server/approval.d.ts +17 -5
  47. package/dist/server/approval.d.ts.map +1 -1
  48. package/dist/server/approval.js +26 -12
  49. package/dist/server/approval.js.map +1 -1
  50. package/dist/server/execution.d.ts +134 -0
  51. package/dist/server/execution.d.ts.map +1 -0
  52. package/dist/server/execution.js +185 -0
  53. package/dist/server/execution.js.map +1 -0
  54. package/dist/server/mcp-server.d.ts +45 -19
  55. package/dist/server/mcp-server.d.ts.map +1 -1
  56. package/dist/server/mcp-server.js +551 -120
  57. package/dist/server/mcp-server.js.map +1 -1
  58. package/dist/server/questions.d.ts +19 -2
  59. package/dist/server/questions.d.ts.map +1 -1
  60. package/dist/server/questions.js +38 -21
  61. package/dist/server/questions.js.map +1 -1
  62. package/dist/server/request-state.d.ts +55 -0
  63. package/dist/server/request-state.d.ts.map +1 -0
  64. package/dist/server/request-state.js +66 -0
  65. package/dist/server/request-state.js.map +1 -0
  66. package/dist/server/serve-agents.d.ts.map +1 -1
  67. package/dist/server/serve-agents.js +203 -18
  68. package/dist/server/serve-agents.js.map +1 -1
  69. package/dist/server/tasks.d.ts +75 -0
  70. package/dist/server/tasks.d.ts.map +1 -0
  71. package/dist/server/tasks.js +280 -0
  72. package/dist/server/tasks.js.map +1 -0
  73. package/dist/server/tool-args.d.ts +24 -0
  74. package/dist/server/tool-args.d.ts.map +1 -0
  75. package/dist/server/tool-args.js +58 -0
  76. package/dist/server/tool-args.js.map +1 -0
  77. package/dist/types.d.ts +341 -11
  78. package/dist/types.d.ts.map +1 -1
  79. package/package.json +8 -5
package/README.md CHANGED
@@ -18,10 +18,15 @@ pnpm add @cogitator-ai/core zod
18
18
 
19
19
  ## Features
20
20
 
21
+ - **Protocol 2026-07-28 and 2025-11-25** - The client asks a server with `server/discover` and speaks the new stateless revision to servers that do, `initialize` to older ones. The server serves both
21
22
  - **MCP Client** - Connect to any MCP server over stdio or Streamable HTTP
22
23
  - **MCP Server** - Expose Cogitator tools, resources and prompts over stdio or Streamable HTTP
23
24
  - **Serve Agents** - Turn Cogitator agents into MCP tools in one call, with tool approvals through MCP elicitation
24
- - **Auth & Sessions** - Per-request `auth` for HTTP servers, the caller's `userId` reaches tools; optional per-client sessions
25
+ - **Multi round-trip requests** - Approvals and questions end a round with the questions and a signed state, the client calls again with the answers. An agent run that asks pauses, and resumes with them
26
+ - **Tasks** - Long calls become MCP tasks the client polls, answers and cancels (extension `io.modelcontextprotocol/tasks`)
27
+ - **OAuth 2.1** - Client ID Metadata Documents, Dynamic Client Registration as a fallback, `iss` checked, Protected Resource Metadata on the server
28
+ - **Subscriptions** - Hear of tool, prompt and resource changes through `subscriptions/listen`
29
+ - **Auth & Sessions** - Per-request `auth` for HTTP servers, the caller's `userId` reaches tools; optional per-client sessions for 2025-11-25 clients
25
30
  - **Elicitation** - Tools served over MCP can ask the person at the client a question while the call waits
26
31
  - **Tool Adapters** - Bidirectional conversion between Cogitator and MCP formats
27
32
  - **Schema Converters** - Convert between Zod and JSON Schema
@@ -133,6 +138,14 @@ interface MCPClientConfig {
133
138
  clientName?: string;
134
139
  clientVersion?: string;
135
140
 
141
+ // Protocol 2026-07-28
142
+ protocol?: 'auto' | 'legacy' | { pin: string }; // Default: 'auto'
143
+ elicitation?: false | MCPElicitationHandler; // answers input requests no run can answer
144
+ tasks?: boolean | { store?: MCPClientTaskStore; maxPollIntervalMs?: number }; // Default: true
145
+ auth?: OAuthClientProvider | MCPOAuthConfig; // OAuth for a remote server
146
+ maxInputRounds?: number; // Default: 10
147
+ rounds?: { store?: MCPClientRoundStore; ttlMs?: number }; // rounds paused runs wait on
148
+
136
149
  // Retry configuration
137
150
  retry?: MCPRetryConfig;
138
151
  autoReconnect?: boolean; // Default: true
@@ -189,7 +202,7 @@ Requests that are safe to send twice (`listToolDefinitions`, `listResources`, `r
189
202
  - Request timeouts
190
203
  - Network failures
191
204
 
192
- A tool call is different: after a timeout or a lost connection the server may still be running it, or may have finished it, and a second call could deploy twice or send a second email. So `callTool` sends a call once and throws `MCPToolInterruptedError` (`reason: 'timeout' | 'connection-lost'`) instead of retrying, unless the call is marked `idempotent: true`. Tools from `getTools()` / `wrapMCPTools()` set `idempotent` from the server's tool annotations: a tool with `readOnlyHint` or `idempotentHint` is retried like a read, any other is not. A connection lost by an earlier call is restored before the next call is sent.
205
+ A tool call is different: after a timeout or a lost connection the server may still be running it, or may have finished it, and a second call could deploy twice or send a second email. So `callTool` sends a call once and throws `MCPToolInterruptedError` (`reason: 'timeout' | 'connection-lost'`) instead of retrying, unless the call is marked `idempotent: true`. A resumed call whose task the server no longer knows (it expired) throws it with `reason: 'task-lost'` instead of calling again. Tools from `getTools()` / `wrapMCPTools()` set `idempotent` from the server's tool annotations: a tool with `readOnlyHint` or `idempotentHint` is retried like a read, any other is not. A connection lost by an earlier call is restored before the next call is sent.
193
206
 
194
207
  Deterministic failures are **not** retried: JSON-RPC protocol errors from the server (invalid params, unknown tool, internal handler errors), tool results with `isError: true`, and calls whose `signal` was aborted fail immediately.
195
208
 
@@ -223,7 +236,73 @@ if (!client.isConnected()) {
223
236
 
224
237
  `sse` connects with Streamable HTTP, which streams responses over SSE itself, as the server's `sse` serves it. A server of the older HTTP+SSE protocol, which opens its event stream with a GET and takes messages in POSTs to the endpoint it names, needs `legacy-sse`: `experimental_mcpConnector()` uses it for `type: "sse"` of a `.mcp.json`, as Claude Code does.
225
238
 
226
- `createStdioTransport()`, `createHttpTransport()` and `createSseTransport()` build the same SDK transports the client uses, if you drive `@modelcontextprotocol/sdk`'s `Client` directly.
239
+ `createStdioTransport()`, `createHttpTransport()` and `createSseTransport()` build the same SDK transports the client uses, if you drive `@modelcontextprotocol/client`'s `Client` directly.
240
+
241
+ ### Protocol Versions
242
+
243
+ MCP 2026-07-28 has no `initialize` handshake: every request carries its protocol version and the client's capabilities in `_meta`, and a server describes itself through `server/discover`. With `protocol: 'auto'` (the default) the client sends `server/discover` first and speaks 2026-07-28 to a server that answers, and 2025-11-25 (`initialize`) to any other. On stdio the MCP SDK probes in a short-lived copy of the server process, so a stdio server starts twice on the first connect. A reconnect reuses what the first connect found and asks nothing.
244
+
245
+ ```typescript
246
+ const client = await MCPClient.connect({ transport: 'http', url });
247
+ client.era; // 'modern' or 'legacy'
248
+ client.protocolVersion; // '2026-07-28'
249
+ client.discover(); // { protocolVersion, era, supportedVersions, capabilities, instructions, serverInfo }
250
+ ```
251
+
252
+ `protocol: 'legacy'` keeps the behavior of earlier versions of this package: no probe, always 2025-11-25. `protocol: { pin: '2026-07-28' }` speaks only that revision and fails against older servers.
253
+
254
+ ### Input Requests (Elicitation)
255
+
256
+ A server of 2026-07-28 asks the person at the client by answering a call with input requests (`resultType: "input_required"`), and the client calls again with the answers and the server's `requestState`. A tool from `getTools()` asks through the run of the call: the run pauses with an interrupt (`reason: 'mcp_elicitation'`, its `responseSchema` the server's form), `cogitator.resume()` with the answer runs the tool again, and the call answers the round the server asked in instead of calling anew, so the server's work before the question is not done twice. The round is kept by tool call id until the call ends, for `rounds.ttlMs` (an hour) at most, in `rounds.store` (in memory by default, a store of your own keeps it across restarts). Ending the pause without an answer (`cog.cancelPause()`) declines. Outside a run, the `elicitation` handler answers, and without one the client does not declare elicitation, so the server knows nobody can answer.
257
+
258
+ ```typescript
259
+ const client = await MCPClient.connect({
260
+ transport: 'http',
261
+ url,
262
+ elicitation: async (request, { server, tool }) =>
263
+ request.mode === 'url'
264
+ ? { action: 'decline' }
265
+ : { action: 'accept', content: await askSomeone(request.message, request.schema) },
266
+ });
267
+ ```
268
+
269
+ The handler also answers the `elicitation/create` requests of 2025-11-25 servers. `elicitation: false` tells servers the client cannot answer at all.
270
+
271
+ ### Tasks
272
+
273
+ A server that supports MCP tasks may answer a long call with a task. The client polls it (`tasks/get`, at the interval the server suggests), answers its input requests (`tasks/update`), reports its status message through the tool's `update`, and cancels it (`tasks/cancel`) when the call's signal aborts. A task survives a lost connection: polling goes on after the reconnect. Tasks are kept by tool call id, so a call that runs again after its run paused on a question polls the task it started instead of starting another. `tasks: { store }` keeps them elsewhere, `tasks: false` turns tasks off.
274
+
275
+ ### OAuth
276
+
277
+ ```typescript
278
+ import { MCPClient, InMemoryMCPOAuthStore } from '@cogitator-ai/mcp';
279
+
280
+ const client = await MCPClient.connect({
281
+ transport: 'http',
282
+ url: 'https://mcp.example.com/mcp',
283
+ auth: {
284
+ redirectUrl: 'http://127.0.0.1:8976/callback',
285
+ clientMetadataUrl: 'https://my-app.example.com/oauth/client.json',
286
+ store: new InMemoryMCPOAuthStore(),
287
+ authorize: async (url) => openBrowserAndWaitForCallback(url),
288
+ },
289
+ });
290
+ ```
291
+
292
+ On a 401 the client finds the authorization server through the server's Protected Resource Metadata, registers, sends the person to `authorize` with PKCE and the `resource` of the server, checks the `iss` of the answer against the authorization server, and connects again with the token. It registers with `clientId` when you give one, else with its Client ID Metadata Document (`clientMetadataUrl`, an HTTPS URL of a JSON document you host, with `client_id`, `client_name` and `redirect_uris`) when the authorization server supports those, else by Dynamic Client Registration (`application_type: "native"` for a loopback redirect). Registrations and tokens are kept per authorization server, everything in `store` under the MCP server's URL, so one store serves several servers without one's token reaching another. When the authorization server rejects a token or a registration, the provider forgets those of every authorization server. `createMCPOAuthProvider(config, { resource })` builds the provider on its own, and `auth` also takes an `OAuthClientProvider` of the MCP SDK.
293
+
294
+ ### Subscriptions
295
+
296
+ ```typescript
297
+ const subscription = await client.subscribe(
298
+ { toolsListChanged: true, resourceSubscriptions: ['notes://today'] },
299
+ { onToolsChanged: () => refreshTools(), onResourceUpdated: (uri) => reload(uri) }
300
+ );
301
+ subscription.filter; // what the server agreed to report
302
+ await subscription.close();
303
+ ```
304
+
305
+ On 2026-07-28 this opens a `subscriptions/listen` stream, on earlier revisions resources are subscribed one by one and list changes come as the server sends them.
227
306
 
228
307
  ### Client Methods
229
308
 
@@ -264,7 +343,7 @@ await client.close();
264
343
 
265
344
  ### Tool Results and Errors
266
345
 
267
- `callTool` returns the server's `structuredContent` when present, otherwise text blocks are unwrapped: JSON-parsed when possible, a single block's value on its own, several as an array, and an empty result is `null`. Content with images, audio or binary resources comes back as a `toolContent()` result of `@cogitator-ai/core` (images as `image` parts, audio and blobs as `file` parts, text resources as `resource` parts that keep their URI), so an agent's model sees a screenshot as an image instead of base64 text, and audio stays out of the context. A link to a resource becomes a line of text.
346
+ `callTool` returns the server's `structuredContent` when present (any JSON value, such as an array, since 2026-07-28), otherwise text blocks are unwrapped: JSON-parsed when possible, a single block's value on its own, several as an array, and an empty result is `null`. Content with images, audio or binary resources comes back as a `toolContent()` result of `@cogitator-ai/core` (images as `image` parts, audio and blobs as `file` parts, text resources as `resource` parts that keep their URI), so an agent's model sees a screenshot as an image instead of base64 text, and audio stays out of the context. A link to a resource becomes a line of text.
268
347
 
269
348
  When the server reports a tool failure (`isError: true`), `callTool` throws an `MCPToolError` carrying the tool name and the original content blocks. Tools produced by `getTools()` / `wrapMCPTools()` therefore surface MCP tool failures as regular Cogitator tool errors, and they forward the run's abort signal to the server.
270
349
 
@@ -408,7 +487,9 @@ await server.stop(); // also closes open HTTP connections
408
487
 
409
488
  ### Tool Titles, Hints and Output Schemas
410
489
 
411
- A tool's `title`, `annotations` and `outputSchema` reach MCP clients with the tool. Clients show the title to people, read the hints (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) to decide how careful to be, and get the result of a tool with a `z.object()` output schema as `structuredContent`, with its JSON as text for clients that read only `content`. A result the output schema rejects comes back as a tool error that says why. Only a `z.object()` output schema (`z.strictObject` and `z.looseObject` too) is advertised, since MCP output schemas need an object root and the MCP SDK takes them only as zod object schemas: a record, a union or a pipe is left out, and `MCPServer` warns when it registers such a tool.
490
+ A tool's `title`, `annotations` and `outputSchema` reach MCP clients with the tool. Clients show the title to people, read the hints (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) to decide how careful to be, and get the result of a tool with an output schema as `structuredContent`, with its JSON as text for clients that read only `content`. A result the output schema rejects comes back as a tool error that says why. Since 2026-07-28 an output schema may have any root (an array, a record, a union, a number) and `structuredContent` may be any JSON value. Clients of 2025-11-25 need an object, so the MCP SDK sends them a result of another shape wrapped as `{ result }`, its schema wrapped the same way.
491
+
492
+ Imported tools (`getTools()`) keep the server's output schema, and their `toJSON()` carries it to the model: Gemini gets it as the function's `responseJsonSchema`. Other providers have no field for it, `llm.toolOutputSchemas: 'description'` of `Cogitator` adds it to the end of the tool's description for them.
412
493
 
413
494
  ```typescript
414
495
  const getRepo = tool({
@@ -612,11 +693,51 @@ await server.start();
612
693
 
613
694
  The MCP endpoint is `/mcp` (other paths answer 404); it takes `POST`, `GET` and `DELETE`, answers CORS preflights, and rejects bodies over `maxBodySize` with 413 and invalid JSON with a JSON-RPC parse error. `transport: 'sse'` serves the same Streamable HTTP endpoint.
614
695
 
615
- By default every request is served on its own (stateless). With `sessions: true` the server keeps a session per client, keyed by the `mcp-session-id` header: a request without one starts a session, an unknown session id gets 404, and a session can only be used by the caller (`userId`) that started it (403 otherwise). Sessions are what let the server send requests back to the client, such as elicitation.
696
+ The server speaks 2026-07-28 to clients that do and 2025-11-25 to older ones (`legacyClients: false` refuses those). Clients of 2026-07-28 have no sessions: every request stands on its own, and the server asks them through multi round-trip requests (see [Approvals and Questions](#approvals-and-questions-across-rounds)). For 2025-11-25 clients every request is served on its own by default. With `sessions: true` the server keeps a session per such client, keyed by the `mcp-session-id` header: a request without one starts a session, an unknown session id gets 404, and a session can only be used by the caller (`userId`) that started it (403 otherwise). Sessions are what let the server send requests back to a 2025-11-25 client, such as elicitation.
697
+
698
+ CORS preflights may send the MCP headers (`MCP-Protocol-Version`, `Mcp-Method`, `Mcp-Name` and the `Mcp-Param-*` headers of tool arguments). `allowedOrigins` refuses requests from other browser origins with 403. Without it, a server on a loopback host (`localhost`, `127.0.0.1`, `::1`) takes only loopback origins, so a web page cannot reach it through DNS rebinding, and a server on another host takes any origin while `corsOrigin` is `*`. Requests without an `Origin` header (not from a browser) always pass.
699
+
700
+ ### Approvals and Questions Across Rounds
701
+
702
+ On 2026-07-28 a call that needs the person at the client ends its round: a tool call that needs approval answers with an approval form and a signed `requestState`, and runs once the client calls again with the decision. The state is signed with HMAC under `requestStateKey`, bound to the caller and to the tool and its arguments, and valid for twice `elicitationTimeoutMs` (a question waiting in the server is dismissed after `elicitationTimeoutMs`, so its late answer gets an error that says so): a state that was changed, expired, or brought by another caller or for other arguments asks again. A round is known by the arguments the client sent, and the call keeps the arguments its schema parsed in the first round for all its rounds, so a generated default (`z.string().default(() => randomUUID())`) keeps its value. Give every process that serves the same clients the same `requestStateKey` (at least 32 bytes), by default each process makes its own.
703
+
704
+ `context.elicit()` keeps working as before: the call waits in the server process while the client answers, so every round of such a call has to reach the same process. A round that comes back for a question that expired or was answered already (a replay, a second answer at once, another process) gets an error result that says so, the tool does not run again. `context.input` asks without waiting: `input.ask(requests, state)` ends the round, and the tool runs again with `input.responses` and the `state` it kept, on any process with the key.
705
+
706
+ ```typescript
707
+ const pickColor = tool({
708
+ name: 'pick_color',
709
+ description: 'Paint in a color the user picks',
710
+ parameters: z.object({}),
711
+ execute: async (_params, context: MCPToolContext) => {
712
+ const input = context.input!;
713
+ const reply = input.responses.color;
714
+ if (reply?.action !== 'accept') {
715
+ return input.ask(
716
+ {
717
+ color: {
718
+ message: 'Which color?',
719
+ schema: { type: 'object', properties: { c: { type: 'string' } } },
720
+ },
721
+ },
722
+ { step: 'color' }
723
+ );
724
+ }
725
+ return `painted ${String(reply.content.c)}`;
726
+ },
727
+ });
728
+ ```
729
+
730
+ ### Tasks
731
+
732
+ A call still running after `tasks.promoteAfterMs` (default 2 s) becomes an MCP task for clients that take tasks: the client gets the task, polls it with `tasks/get`, answers its questions with `tasks/update` and stops it with `tasks/cancel`. Approvals and `context.elicit()` of a task are asked in its `input_required` status. A task belongs to the caller that started it, others get `Unknown task`. A question of a task nobody answers within `elicitationTimeoutMs` counts as dismissed. Tasks live in `tasks.store` (an `InMemoryMCPTaskStore` by default) for `tasks.ttlMs` (an hour): then a task still running is stopped and forgotten. `tasks: false` turns them off.
733
+
734
+ ### OAuth Protected Resource Metadata
735
+
736
+ With `protectedResource: { authorizationServers: ['https://auth.example.com'] }` the server serves its OAuth Protected Resource Metadata (RFC 9728) at `/.well-known/oauth-protected-resource/mcp` and names it in the `WWW-Authenticate` header of a 401, so OAuth clients find the authorization server. `auth` still checks the token.
616
737
 
617
738
  ### Authentication and Per-User Tools
618
739
 
619
- Over HTTP the server is open to anyone who can reach it. `auth` establishes the caller of every request; requests it returns `undefined` for (or throws on) get `401`. The caller's `userId` reaches tools as `context.userId`, and resource `read` / prompt `get` handlers get the caller as their second argument:
740
+ Over HTTP the server is open to anyone who can reach it. `auth` establishes the caller of every request; requests it returns `undefined` for (or throws on) get `401`. Tasks, waiting calls and round states belong to the caller's `userId`. A caller without one is told apart by the credential the request carries (its `Authorization` or `Cookie` header), and a request with neither gets `401`. The caller's `userId` reaches tools as `context.userId`, and resource `read` / prompt `get` handlers get the caller as their second argument:
620
741
 
621
742
  ```typescript
622
743
  import { MCPServer } from '@cogitator-ai/mcp';
@@ -648,7 +769,7 @@ An agent acts for one user by connecting with that user's token (`headers: { Aut
648
769
 
649
770
  ### Asking the User (Elicitation)
650
771
 
651
- A tool run by an `MCPServer` gets an `MCPToolContext`: the usual tool context plus `elicit`, which asks the person at the client a question (an MCP elicitation form) while the call waits. `elicit` is there on stdio and on HTTP with `sessions: true`; it resolves to `undefined` when the client cannot answer elicitation requests.
772
+ A tool run by an `MCPServer` gets an `MCPToolContext`: the usual tool context plus `elicit`, which asks the person at the client a question (an MCP elicitation form) while the call waits. For 2026-07-28 clients the question goes out with the round's answer and the call waits for the next round, for 2025-11-25 clients as a request, on stdio and on HTTP with `sessions: true`. It resolves to `undefined` when the client cannot answer elicitation requests.
652
773
 
653
774
  ```typescript
654
775
  import { tool } from '@cogitator-ai/core';
@@ -744,6 +865,7 @@ await serveAgents(cog, researcher, { transport: 'http', port: 3333, auth });
744
865
  - **Approvals**: when a call of the agent needs approval (its tool's `requiresApproval`, or a permission rule), it is asked from the person at the client through MCP elicitation (an Approve checkbox and an optional reason). A client that cannot answer gets `{ status: 'paused', threadId, pendingApprovals, next }`, and the agent gets a second tool, `<name>_resume` (registered for every agent, since permission rules can make any call ask), taking `{ threadId, approved, reason? }` to continue the run with the user's decision. `allowRemember: true` lets the client answer "always allow" (`remember`), off by default. Tools from `wrapMCPTools()` carry `tool.mcp = { server, tool }` (the `server` option, else the name the server reports) for `mcp__<server>__<tool>` permission rules.
745
866
  - **Questions** - a question an agent's tool asks with `context.interrupt()` is asked from the person at the client through MCP elicitation too, one form per question: a schema of one primitive (or none) becomes a single `answer` field, an object of primitives becomes that form, with the constraints the elicitation schema can carry (title, description, default, length, format, range, choices). The run resumes with the answers, as often as its tools ask, and checks them against the full schema. An answer it refuses (`INTERRUPT_ANSWER_INVALID`, say for a `pattern` the form cannot carry) is asked again, the form saying why, up to 3 times per question: then the call fails with an `isError` result naming the question. When nobody can answer (a client without elicitation, a declined or dismissed form, one nobody answers within `elicitationTimeoutMs`, or a schema that is no flat form) the call fails with an `isError` result naming the question, such as `paused to ask confirm_plan ("Go ahead?")`. Either way the run stays paused for `cogitator.resume()` with `responses`.
746
867
  - **Callers** — over HTTP with `auth`, the caller's `userId` is passed to the run, and the run's abort signal follows the MCP call's cancellation.
868
+ - **Protocol 2026-07-28** - for clients of the new revision a run that needs an approval or an answer pauses, the round ends with every approval and question it waits on and a signed state that names its thread, and the client's next round resumes it (`cogitator.resume()` with `decisions` and `responses`). Nothing waits in the server between rounds, so with persistent memory and a shared `requestStateKey` any server process can take the next round. A run still going after `tasks.promoteAfterMs` becomes an MCP task the client polls.
747
869
 
748
870
  `agentTools(host, agents, toolNames?)` returns the same tools without starting a server, to register them on an `MCPServer` of your own next to other tools. See [`examples/mcp/04-agent-as-mcp-server.ts`](https://github.com/cogitator-ai/Cogitator-AI/blob/main/examples/mcp/04-agent-as-mcp-server.ts).
749
871
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { z, type ZodTypeAny, type ZodObject } from 'zod';
8
8
  import type { Tool, ToolSchema } from '@cogitator-ai/types';
9
- import type { MCPToolDefinition, MCPToolContent, ToolAdapterOptions } from '../types.js';
9
+ import type { MCPJsonSchema, MCPToolDefinition, MCPToolContent, ToolAdapterOptions } from '../types.js';
10
10
  import type { MCPClient } from '../client/mcp-client.js';
11
11
  /**
12
12
  * Convert a Zod schema to JSON Schema
@@ -55,17 +55,17 @@ interface JsonSchemaProperty {
55
55
  }
56
56
  /**
57
57
  * Convert a Cogitator Tool to MCP tool definition format, with its `title`, `annotations` and
58
- * `outputSchema`. Only a `z.object()` output schema is kept, the one an MCP server can advertise
59
- * (see `mcpOutputSchema`).
58
+ * `outputSchema`, of any shape since protocol 2026-07-28 (see `mcpOutputSchema`).
60
59
  */
61
60
  export declare function cogitatorToMCP(tool: Tool): MCPToolDefinition;
62
61
  /**
63
- * The output schema of a tool that MCP can carry: a `z.object()` schema (`z.strictObject`,
64
- * `z.looseObject` included). MCP output schemas must have an object root, and the MCP SDK takes
65
- * them only as zod object schemas, so a record, a union or a pipe is left out, even one whose
66
- * values are objects.
62
+ * The output schema of a tool as MCP carries it: any zod schema. Since protocol 2026-07-28 an
63
+ * output schema may have any root (an array, a union, a string), and the MCP SDK sends one with
64
+ * a root other than an object to clients of earlier revisions wrapped as `{ result }`
67
65
  */
68
- export declare function mcpOutputSchema(tool: Tool): ZodObject | undefined;
66
+ export declare function mcpOutputSchema(tool: Tool): ZodTypeAny | undefined;
67
+ /** A zod schema for a JSON Schema of any shape, such as a tool's output schema */
68
+ export declare function jsonSchemaValueToZod(schema: MCPJsonSchema): ZodTypeAny;
69
69
  /**
70
70
  * Convert a Cogitator ToolSchema to MCP tool definition format. The input schema keeps every
71
71
  * keyword, `$defs` included, made self-contained by `toToolParameters`.
@@ -1 +1 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CAAC,IAAI,EAAE,IAAI,GAAG,iBAAiB,CAS5D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,GAAG,SAAS,CAGlE;AAQD,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,UAAU,CAKtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,iBAAiB,CAMrE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAWD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,kBAAkB,GAAG;IAC7B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACA,IAAI,CA8CN;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAErE;AASD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,IAAI,EAAE,CAAC,CAWjB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,EAAE,CAuBpE;AAgED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CAwBrE"}
@@ -213,12 +213,11 @@ function compilePattern(pattern) {
213
213
  }
214
214
  /**
215
215
  * Convert a Cogitator Tool to MCP tool definition format, with its `title`, `annotations` and
216
- * `outputSchema`. Only a `z.object()` output schema is kept, the one an MCP server can advertise
217
- * (see `mcpOutputSchema`).
216
+ * `outputSchema`, of any shape since protocol 2026-07-28 (see `mcpOutputSchema`).
218
217
  */
219
218
  export function cogitatorToMCP(tool) {
220
- const objectSchema = mcpOutputSchema(tool);
221
- const outputSchema = objectSchema && outputSchemaToMCP(objectSchema);
219
+ const zodSchema = mcpOutputSchema(tool);
220
+ const outputSchema = zodSchema && outputSchemaToMCP(zodSchema);
222
221
  return {
223
222
  ...toolSchemaToMCP(tool.toJSON()),
224
223
  ...(tool.title !== undefined && { title: tool.title }),
@@ -227,19 +226,25 @@ export function cogitatorToMCP(tool) {
227
226
  };
228
227
  }
229
228
  /**
230
- * The output schema of a tool that MCP can carry: a `z.object()` schema (`z.strictObject`,
231
- * `z.looseObject` included). MCP output schemas must have an object root, and the MCP SDK takes
232
- * them only as zod object schemas, so a record, a union or a pipe is left out, even one whose
233
- * values are objects.
229
+ * The output schema of a tool as MCP carries it: any zod schema. Since protocol 2026-07-28 an
230
+ * output schema may have any root (an array, a union, a string), and the MCP SDK sends one with
231
+ * a root other than an object to clients of earlier revisions wrapped as `{ result }`
234
232
  */
235
233
  export function mcpOutputSchema(tool) {
236
234
  const schema = tool.outputSchema;
237
- return schema instanceof z.ZodObject ? schema : undefined;
235
+ return schema instanceof z.ZodType ? schema : undefined;
238
236
  }
239
- /** The JSON Schema of an object output schema for MCP. */
237
+ /** The JSON Schema of an output schema for MCP. */
240
238
  function outputSchemaToMCP(schema) {
241
239
  const jsonSchema = zodToJsonSchema(schema);
242
- return jsonSchema.type === 'object' ? toToolParameters(jsonSchema) : undefined;
240
+ return jsonSchema.type === 'object' ? toToolParameters(jsonSchema) : jsonSchema;
241
+ }
242
+ /** A zod schema for a JSON Schema of any shape, such as a tool's output schema */
243
+ export function jsonSchemaValueToZod(schema) {
244
+ if (schema.type === 'object') {
245
+ return jsonSchemaToZod(schema);
246
+ }
247
+ return jsonSchemaPropertyToZod(schema, { root: schema, refs: new Map() });
243
248
  }
244
249
  /**
245
250
  * Convert a Cogitator ToolSchema to MCP tool definition format. The input schema keeps every
@@ -288,11 +293,7 @@ export function mcpToCogitator(mcpTool, client, options) {
288
293
  : mcpTool.description;
289
294
  const inputSchema = mcpTool.inputSchema;
290
295
  const parameters = jsonSchemaToZod({ ...inputSchema, type: 'object' });
291
- const outputSchema = mcpTool.outputSchema &&
292
- jsonSchemaToZod({
293
- ...mcpTool.outputSchema,
294
- type: 'object',
295
- });
296
+ const outputSchema = mcpTool.outputSchema && jsonSchemaValueToZod(mcpTool.outputSchema);
296
297
  const { title: annotationTitle, ...hints } = mcpTool.annotations ?? {};
297
298
  const title = mcpTool.title ?? annotationTitle;
298
299
  const annotations = Object.keys(hints).length > 0 ? hints : undefined;
@@ -312,12 +313,16 @@ export function mcpToCogitator(mcpTool, client, options) {
312
313
  return client.callTool(mcpTool.name, (params ?? {}), {
313
314
  signal: context?.signal,
314
315
  idempotent,
316
+ ...(context?.toolCallId !== undefined && { toolCallId: context.toolCallId }),
317
+ ...(context?.interrupt && { interrupt: context.interrupt }),
318
+ ...(context?.update && { update: context.update }),
315
319
  });
316
320
  },
317
321
  toJSON: () => ({
318
322
  name,
319
323
  description,
320
324
  parameters: toToolParameters(mcpTool.inputSchema),
325
+ ...(mcpTool.outputSchema && { outputSchema: { ...mcpTool.outputSchema } }),
321
326
  }),
322
327
  };
323
328
  return tool;
@@ -1 +1 @@
1
- {"version":3,"file":"tool-adapter.js","sourceRoot":"","sources":["../../src/adapter/tool-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAmC,MAAM,KAAK,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAU5B;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAkB;IAKhD,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE;QACxC,eAAe,EAAE,KAAK;QACtB,EAAE,EAAE,QAAQ;QACZ,MAAM,EAAE,aAAa;KACtB,CAAC,CAAC;IAEH,MAAM,M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ACvE,OAAO,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC;oBACnC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE;oBACxD,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YACzF,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,UAAU;gBAChB,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG;gBACtB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBAClF,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE;aAC/B,CAAC;IACN,CAAC;AACH,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Answering what an MCP server asks a client for during a call (`inputRequests` of protocol
3
+ * 2026-07-28, and `elicitation/create` of earlier revisions): elicitation forms and URLs, asked
4
+ * through the run of the call (`context.interrupt()`), else the client's elicitation handler
5
+ */
6
+ import type { ToolContext } from '@cogitator-ai/types';
7
+ import type { MCPAskedInput, MCPElicitRequest, MCPElicitResult, MCPElicitUrlRequest, MCPElicitationHandler, MCPElicitationSource } from '../types.js';
8
+ /** Who answers the input requests of one call */
9
+ export interface InputAnswerer {
10
+ source: MCPElicitationSource;
11
+ interrupt?: ToolContext['interrupt'];
12
+ handler?: MCPElicitationHandler;
13
+ /** What the call asked so far, in order: a run answers its questions in order */
14
+ ledger: MCPAskedInput[];
15
+ /** The keys of the ledger this run of the call asked already */
16
+ consumed: Set<string>;
17
+ }
18
+ /** The elicitation request of an `elicitation/create` params object */
19
+ export declare function toElicitRequest(params: unknown): MCPElicitRequest | MCPElicitUrlRequest;
20
+ /** An input request of a round, with the key the call's ledger keeps it under */
21
+ export interface PlannedInput {
22
+ /** The request's key in the round's `inputRequests` */
23
+ key: string;
24
+ /** Its key in the ledger of the call (`call:<n>`) */
25
+ asked: string;
26
+ request: MCPElicitRequest | MCPElicitUrlRequest;
27
+ }
28
+ /**
29
+ * The elicitations of a round's `inputRequests`, added to the call's ledger in order
30
+ *
31
+ * @throws ProtocolError for a request of another kind, which this client never declares
32
+ */
33
+ export declare function planInputRequests(inputRequests: Readonly<Record<string, unknown>>, answerer: InputAnswerer): PlannedInput[];
34
+ /**
35
+ * The answers to a planned round, by the round's keys. Every question of the ledger this run of
36
+ * the call has not asked yet is asked first, in order, so a run that resumed reads the answers of
37
+ * its earlier questions before those of the round
38
+ */
39
+ export declare function answerPlanned(planned: readonly Pick<PlannedInput, 'key' | 'asked'>[], answerer: InputAnswerer): Promise<Record<string, MCPElicitResult>>;
40
+ /** The answers to `inputRequests`, by their keys, as `inputResponses` carries them */
41
+ export declare function answerInputRequests(inputRequests: Readonly<Record<string, unknown>>, answerer: InputAnswerer): Promise<Record<string, MCPElicitResult>>;
42
+ /**
43
+ * The answer to one elicitation: asked through the call's run when it has one (the run pauses
44
+ * until the person answers, and declining ends the call), else from the handler, else declined
45
+ */
46
+ export declare function answerElicitation(request: MCPElicitRequest | MCPElicitUrlRequest, answerer: InputAnswerer): Promise<MCPElicitResult>;
47
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/client/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB,iDAAiD;AACjD,MAAM,WAAW,aA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1B"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Answering what an MCP server asks a client for during a call (`inputRequests` of protocol
3
+ * 2026-07-28, and `elicitation/create` of earlier revisions): elicitation forms and URLs, asked
4
+ * through the run of the call (`context.interrupt()`), else the client's elicitation handler
5
+ */
6
+ import { ProtocolError, ProtocolErrorCode } from '@modelcontextprotocol/client';
7
+ import { z } from 'zod';
8
+ const FormParamsSchema = z.looseObject({
9
+ mode: z.literal('form').optional(),
10
+ message: z.string(),
11
+ requestedSchema: z.looseObject({
12
+ type: z.literal('object'),
13
+ properties: z.record(z.string(), z.unknown()),
14
+ required: z.array(z.string()).optional(),
15
+ }),
16
+ });
17
+ const UrlParamsSchema = z.looseObject({
18
+ mode: z.literal('url'),
19
+ message: z.string(),
20
+ url: z.string(),
21
+ });
22
+ const InputRequestSchema = z.looseObject({
23
+ method: z.string(),
24
+ params: z.unknown().optional(),
25
+ });
26
+ const URL_DONE_SCHEMA = {
27
+ type: 'object',
28
+ properties: { done: { type: 'boolean', title: 'I opened the page and finished there' } },
29
+ required: ['done'],
30
+ };
31
+ /** The elicitation request of an `elicitation/create` params object */
32
+ export function toElicitRequest(params) {
33
+ const url = UrlParamsSchema.safeParse(params);
34
+ if (url.success)
35
+ return { mode: 'url', message: url.data.message, url: url.data.url };
36
+ const form = FormParamsSchema.safeParse(params);
37
+ if (!form.success) {
38
+ throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid elicitation request: ${z.prettifyError(form.error)}`);
39
+ }
40
+ return {
41
+ mode: 'form',
42
+ message: form.data.message,
43
+ schema: form.data.requestedSchema,
44
+ };
45
+ }
46
+ /**
47
+ * The elicitations of a round's `inputRequests`, added to the call's ledger in order
48
+ *
49
+ * @throws ProtocolError for a request of another kind, which this client never declares
50
+ */
51
+ export function planInputRequests(inputRequests, answerer) {
52
+ const planned = [];
53
+ for (const [key, entry] of Object.entries(inputRequests)) {
54
+ const parsed = InputRequestSchema.safeParse(entry);
55
+ if (!parsed.success || parsed.data.method !== 'elicitation/create') {
56
+ const method = parsed.success ? parsed.data.method : 'an unknown request';
57
+ throw new ProtocolError(ProtocolErrorCode.InvalidRequest, `The MCP server asks for ${method}, which this client does not support`);
58
+ }
59
+ const request = toElicitRequest(parsed.data.params);
60
+ const asked = `call:${answerer.ledger.length}`;
61
+ answerer.ledger.push({ key: asked, request });
62
+ planned.push({ key, asked, request });
63
+ }
64
+ return planned;
65
+ }
66
+ /**
67
+ * The answers to a planned round, by the round's keys. Every question of the ledger this run of
68
+ * the call has not asked yet is asked first, in order, so a run that resumed reads the answers of
69
+ * its earlier questions before those of the round
70
+ */
71
+ export async function answerPlanned(planned, answerer) {
72
+ const byAsked = new Map(planned.map((entry) => [entry.asked, entry.key]));
73
+ const responses = {};
74
+ for (const entry of [...answerer.ledger]) {
75
+ if (answerer.consumed.has(entry.key))
76
+ continue;
77
+ const roundKey = byAsked.get(entry.key);
78
+ if (!answerer.interrupt && roundKey === undefined)
79
+ continue;
80
+ const answer = await answerElicitation(entry.request, answerer);
81
+ answerer.consumed.add(entry.key);
82
+ if (roundKey !== undefined)
83
+ responses[roundKey] = answer;
84
+ }
85
+ return responses;
86
+ }
87
+ /** The answers to `inputRequests`, by their keys, as `inputResponses` carries them */
88
+ export async function answerInputRequests(inputRequests, answerer) {
89
+ return answerPlanned(planInputRequests(inputRequests, answerer), answerer);
90
+ }
91
+ /**
92
+ * The answer to one elicitation: asked through the call's run when it has one (the run pauses
93
+ * until the person answers, and declining ends the call), else from the handler, else declined
94
+ */
95
+ export async function answerElicitation(request, answerer) {
96
+ const { interrupt, handler, source } = answerer;
97
+ if (interrupt) {
98
+ const details = { server: source.server, ...(source.tool && { tool: source.tool }) };
99
+ if (request.mode === 'url') {
100
+ const answer = await interrupt({
101
+ reason: 'mcp_elicitation_url',
102
+ message: `${request.message}\n\n${request.url}`,
103
+ responseSchema: URL_DONE_SCHEMA,
104
+ details: { ...details, mode: 'url', url: request.url },
105
+ });
106
+ return isRecord(answer) && answer.done === true
107
+ ? { action: 'accept', content: {} }
108
+ : { action: 'decline' };
109
+ }
110
+ const answer = await interrupt({
111
+ reason: 'mcp_elicitation',
112
+ message: request.message,
113
+ responseSchema: request.schema,
114
+ details: { ...details, mode: 'form' },
115
+ });
116
+ return { action: 'accept', content: isRecord(answer) ? answer : {} };
117
+ }
118
+ if (handler)
119
+ return handler(request, source);
120
+ return { action: 'decline' };
121
+ }
122
+ function isRecord(value) {
123
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
124
+ }
125
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/client/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,eAAe,EAAE,CAAC,CAAC,WAAW,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;KACzC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CACh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