prismalens 0.5.1 → 0.5.2
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.
- package/THIRD_PARTY_NOTICES.txt +82 -57
- package/node_modules/@prisma/adapter-better-sqlite3/package.json +2 -2
- package/node_modules/@prismalens/agent-adapters/LICENSE +201 -0
- package/node_modules/@prismalens/agent-adapters/README.md +3 -0
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@agentclientprotocol/claude-agent-acp/LICENSE +191 -0
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@agentclientprotocol/codex-acp/LICENSE +190 -0
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@anthropic-ai/claude-agent-sdk/LICENSE.md +1 -0
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@anthropic-ai/claude-agent-sdk/README.md +65 -0
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@openai/codex/LICENSE +204 -0
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@openai/codex/NOTICE +6 -0
- package/node_modules/@prismalens/agent-adapters/dist/index.d.ts +9 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.d.ts +1369 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-subagents.d.ts +82 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/air-extension.d.ts +25 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/async-tasks.d.ts +117 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/auth-status.d.ts +140 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/clear-context-coordinator.d.ts +60 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/context-compaction-meta.d.ts +18 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/context-compaction.d.ts +132 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/diff.d.ts +13 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/elicitation.d.ts +138 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/exit-plan.d.ts +42 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/file-change-audit.d.ts +47 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/fork-session.d.ts +15 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/goal-extension.d.ts +36 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/hide-claude-auth.d.ts +152 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/index.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/lib.d.ts +7 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/managed-policy.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/native-subagents.d.ts +71 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/effects.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/modes.d.ts +10 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/normalization.d.ts +6 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/filesystem.d.ts +9 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/shared.d.ts +44 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/shell.d.ts +5 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options/tools.d.ts +11 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/options.d.ts +5 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/presentation.d.ts +16 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/permissions/response.d.ts +11 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/resumed-session.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-config-ids.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-effort.d.ts +14 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-failure-extension.d.ts +97 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-mode.d.ts +74 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-model.d.ts +41 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-notices.d.ts +41 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-timing.d.ts +15 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/session-titles.d.ts +77 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/settings.d.ts +68 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/tool-result-meta.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/tools.d.ts +98 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/usage-markdown.d.ts +7 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/claude-agent-acp/dist/utils.d.ts +16 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1803 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5036 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +89 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +507 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +33 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +603 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +917 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +22 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +499 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +37 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +535 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +82 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +183 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +51 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +6219 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +15215 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +30 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +536 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +53 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +992 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +81 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1116 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +35 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +195 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +957 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +1287 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +946 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +42 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +6208 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +33267 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +836 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +13 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/agentSdkTypes.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/bridge.d.ts +378 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.d.ts +184 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts +4153 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts +9551 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/default-browser/index.d.ts +29 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/define-lazy-prop/index.d.ts +31 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/convert/dmp.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/convert/xml.d.ts +6 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/array.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/base.d.ts +20 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/character.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/css.d.ts +18 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/json.d.ts +24 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/line.d.ts +24 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/sentence.d.ts +21 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/diff/word.d.ts +35 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/index.d.ts +20 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/patch/apply.d.ts +62 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/patch/create.d.ts +131 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/patch/line-endings.d.ts +17 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/patch/parse.d.ts +16 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/patch/reverse.d.ts +22 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/types.d.ts +260 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/util/array.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/util/distance-iterator.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/util/params.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libcjs/util/string.d.ts +30 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/convert/dmp.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/convert/xml.d.ts +6 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/array.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/base.d.ts +20 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/character.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/css.d.ts +18 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/json.d.ts +24 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/line.d.ts +24 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/sentence.d.ts +21 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/diff/word.d.ts +35 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/index.d.ts +20 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/patch/apply.d.ts +62 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/patch/create.d.ts +131 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/patch/line-endings.d.ts +17 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/patch/parse.d.ts +16 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/patch/reverse.d.ts +22 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/types.d.ts +260 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/util/array.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/util/distance-iterator.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/util/params.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/diff/libesm/util/string.d.ts +30 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/is-docker/index.d.ts +13 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/is-in-ssh/index.d.ts +15 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/is-inside-container/index.d.ts +13 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/is-wsl/index.d.ts +15 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/open/index.d.ts +158 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/powershell-utils/index.d.ts +175 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/run-applescript/index.d.ts +66 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/api.d.ts +14 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/events.d.ts +39 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/is.d.ts +7 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/node/main.d.ts +59 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/vscode-jsonrpc/typings/thenable.d.ts +5 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/wsl-utils/index.d.ts +180 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/index.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/classic/schemas.d.ts +816 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/api.d.ts +335 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/checks.d.ts +294 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/core.d.ts +82 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/index.d.ts +19 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/regexes.d.ts +90 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/schemas.d.ts +1273 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/util.d.ts +278 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/index.d.ts +63 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4/mini/schemas.d.ts +480 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/@prismalens/agent-adapters/package.json +21 -6
- package/node_modules/@prismalens/api/dist/src/core/harness/repo-source.service.js +1 -0
- package/node_modules/@prismalens/api/public/THIRD_PARTY_NOTICES.txt +82 -57
- package/node_modules/@prismalens/api/public/assets/{Field-dI7mth89.js → Field-Blwn4QDs.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/Hint-I6G52Q_M.js +41 -0
- package/node_modules/@prismalens/api/public/assets/MergeDialog-DI7nb-pG.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{ResolveDialog-D-swl2ib.js → ResolveDialog-CKyuzNtU.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/RunsMenu-B46B_gZU.js +3 -0
- package/node_modules/@prismalens/api/public/assets/{ServiceFormDialog-CtxQGmaD.js → ServiceFormDialog-CQm0Unxf.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/_authenticated-BPsBFlMh.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_authenticated-BzbPxOeY.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{_id-Due91CTg.js → _id-D_G5RMgK.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/_id-Da-m0w25.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-NQNr5-yE.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-mJSRa5Ke.js +1 -0
- package/node_modules/@prismalens/api/public/assets/alerts-D_IcsMcM.js +1 -0
- package/node_modules/@prismalens/api/public/assets/bundle-mjs-B_LDP-6b.js +1 -0
- package/node_modules/@prismalens/api/public/assets/button-Chns-8Ua.js +1 -0
- package/node_modules/@prismalens/api/public/assets/conversation-BGvYjBh3.js +158 -0
- package/node_modules/@prismalens/api/public/assets/desktop-DCOrT9cX.js +63 -0
- package/node_modules/@prismalens/api/public/assets/dist-Cnb_-T3N.js +1 -0
- package/node_modules/@prismalens/api/public/assets/fixes-DpzBzASh.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{highlighted-body-KQOG7T2V-C0hkD05-.js → highlighted-body-KQOG7T2V-CDakMIg-.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{incident-attention-Edky2Ay0.js → incident-attention-hT3OUOPc.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/incidents-C6Rq41eK.js +1 -0
- package/node_modules/@prismalens/api/public/assets/index-BnrHkPFh.js +23 -0
- package/node_modules/@prismalens/api/public/assets/jsx-runtime-CXCudH8Z.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{loader-circle-CfKw5wFE.js → loader-circle-C8a_Hnk6.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/matchContext-IH8ddzQs.js +2 -0
- package/node_modules/@prismalens/api/public/assets/mermaid-MCJ5UELQ-CLXWgSuk.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{pair-DuWT-CtT.js → pair-DQ8Y1YX_.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/plus-Tlbf1bdm.js +1 -0
- package/node_modules/@prismalens/api/public/assets/react-dom-Dvr6R6wf.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{route-Cc4UeO_y.js → route-CBoZ7fHn.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/route-CPchh9kB.js +1 -0
- package/node_modules/@prismalens/api/public/assets/route-Cp0gs_ct.js +1 -0
- package/node_modules/@prismalens/api/public/assets/route-DwYYk8Dy.js +1 -0
- package/node_modules/@prismalens/api/public/assets/select-DjrA0HDy.js +1 -0
- package/node_modules/@prismalens/api/public/assets/services-CrKDtwBW.js +1 -0
- package/node_modules/@prismalens/api/public/assets/settings-0OoZAYmm.js +1 -0
- package/node_modules/@prismalens/api/public/assets/skeleton-CnspEYa-.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{state-tone-Ba9ig-4k.js → state-tone-BFcai3hr.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/textarea-DuN-b6di.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{use-escape-back-CgXRn8uv.js → use-escape-back-7fyalpsD.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/use-first-open-JY-c8X8V.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useInvestigationRun-_lSx2TPz.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useNavigate-CPXPooFu.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useRouter-BU35VTbH.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useSearch-CRD31eWF.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useSelector-DoFJYpky.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{utils-BZQvbTCD.js → utils-DD0Xz0Py.js} +1 -1
- package/node_modules/@prismalens/api/public/index.html +2 -2
- package/node_modules/@prismalens/config/dist/providers/model-catalogue.json +2 -2
- package/node_modules/@prismalens/database/dist/prisma/generated/internal/class.js +2 -2
- package/node_modules/@prismalens/database/dist/prisma/generated/internal/prismaNamespace.js +2 -2
- package/node_modules/@prismalens/engine/dist/adapter/acp-adapter.js +38 -1
- package/node_modules/@prismalens/engine/dist/run/harness-doctor.js +9 -1
- package/node_modules/@prismalens/engine/dist/run/investigate.js +1 -1
- package/node_modules/@prismalens/engine/dist/run/prompt.js +3 -0
- package/node_modules/@prismalens/engine/dist/runner/acp-client.js +5 -1
- package/package.json +27 -27
- package/node_modules/@prismalens/api/public/assets/Hint-D3aC42I-.js +0 -41
- package/node_modules/@prismalens/api/public/assets/MergeDialog-DDE8tX3n.js +0 -1
- package/node_modules/@prismalens/api/public/assets/Mono-9RkwFQz6.js +0 -1
- package/node_modules/@prismalens/api/public/assets/NewIncident-Zw5Jcao6.js +0 -1
- package/node_modules/@prismalens/api/public/assets/RunsMenu-CEu6e24R.js +0 -3
- package/node_modules/@prismalens/api/public/assets/_authenticated-BH_Nr03P.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_authenticated-EivYBtHs.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_id-B6W3_quZ.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_id-B8h5SPwz.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_id-C9BUtx3G.js +0 -1
- package/node_modules/@prismalens/api/public/assets/alert-dialog-D5xZvMIR.js +0 -3
- package/node_modules/@prismalens/api/public/assets/alerts-D8oKAWDJ.js +0 -1
- package/node_modules/@prismalens/api/public/assets/bundle-mjs-cJTHqqzI.js +0 -1
- package/node_modules/@prismalens/api/public/assets/button-Cr8PrWdC.js +0 -1
- package/node_modules/@prismalens/api/public/assets/chevron-right-tMCvSyxl.js +0 -1
- package/node_modules/@prismalens/api/public/assets/conversation-DHY3T60s.js +0 -158
- package/node_modules/@prismalens/api/public/assets/desktop-B9RvObhX.js +0 -58
- package/node_modules/@prismalens/api/public/assets/dist-zoA3XqRA.js +0 -1
- package/node_modules/@prismalens/api/public/assets/fixes-D-FUCZJt.js +0 -1
- package/node_modules/@prismalens/api/public/assets/format-time-CGRUxfR2.js +0 -1
- package/node_modules/@prismalens/api/public/assets/get-error-message-XWlcOfOx.js +0 -1
- package/node_modules/@prismalens/api/public/assets/incidents-BdT8KicR.js +0 -1
- package/node_modules/@prismalens/api/public/assets/index-CAX__NsJ.js +0 -21
- package/node_modules/@prismalens/api/public/assets/jsx-runtime-B-hcVAMW.js +0 -1
- package/node_modules/@prismalens/api/public/assets/lazyRouteComponent-C-LOuZQf.js +0 -1
- package/node_modules/@prismalens/api/public/assets/live-refresh-BjrOGhpR.js +0 -1
- package/node_modules/@prismalens/api/public/assets/matchContext-DyXrH4xk.js +0 -1
- package/node_modules/@prismalens/api/public/assets/mermaid-MCJ5UELQ-DHfZwKb6.js +0 -1
- package/node_modules/@prismalens/api/public/assets/model-selector-DDUMPzEw.js +0 -2
- package/node_modules/@prismalens/api/public/assets/plus-BV1g6VPp.js +0 -1
- package/node_modules/@prismalens/api/public/assets/preload-helper-BZ1Pz5am.js +0 -1
- package/node_modules/@prismalens/api/public/assets/react-dom-Cix4fOWO.js +0 -1
- package/node_modules/@prismalens/api/public/assets/root-DLTE-HSj.js +0 -1
- package/node_modules/@prismalens/api/public/assets/route-1TSuy85Z.js +0 -1
- package/node_modules/@prismalens/api/public/assets/route-BCBYAoCj.js +0 -1
- package/node_modules/@prismalens/api/public/assets/route-CurA5hZv.js +0 -1
- package/node_modules/@prismalens/api/public/assets/select-ywBitXld.js +0 -1
- package/node_modules/@prismalens/api/public/assets/services-CXVezw7r.js +0 -1
- package/node_modules/@prismalens/api/public/assets/settings-BPFYV0nc.js +0 -1
- package/node_modules/@prismalens/api/public/assets/skeleton-BmmBz9ps.js +0 -1
- package/node_modules/@prismalens/api/public/assets/textarea-Cqcau6oZ.js +0 -1
- package/node_modules/@prismalens/api/public/assets/use-back-BO8UKjVe.js +0 -1
- package/node_modules/@prismalens/api/public/assets/use-first-open-Bi42wite.js +0 -1
- package/node_modules/@prismalens/api/public/assets/use-sliding-mark-E_-I6D6E.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useInvestigationRun-C352wvI5.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useLocation-abth45bR.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useNavigate-zph-3gLZ.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useRouter-BGpAXxmD.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useSearch-BT67bTwQ.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useSelector-CMoDyMzz.js +0 -1
- package/node_modules/@prismalens/api/public/assets/utils-DjD33h0z.js +0 -1
|
@@ -0,0 +1,1287 @@
|
|
|
1
|
+
import { describe, expect, expectTypeOf, it } from "vitest";
|
|
2
|
+
import { PROTOCOL_VERSION, agent, batchNotification, batchRequest, client, methods, } from "./acp.js";
|
|
3
|
+
import * as sdk from "./acp.js";
|
|
4
|
+
import * as guards from "./schema/guards.gen.js";
|
|
5
|
+
import { zAnnotations, zDiffPatch, zSessionInfo, zSessionInfoUpdate, } from "./schema/zod.gen.js";
|
|
6
|
+
const clientInfo = { name: "test-client", version: "1.0.0" };
|
|
7
|
+
const agentInfo = { name: "test-agent", version: "1.0.0" };
|
|
8
|
+
function testAgent() {
|
|
9
|
+
return agent().onRequest(methods.agent.initialize, () => ({
|
|
10
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
11
|
+
info: agentInfo,
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
function assertV2MethodTypes(agentContext, clientContext) {
|
|
15
|
+
// @ts-expect-error Built-in methods must not fall through the extension overload.
|
|
16
|
+
agentContext.request(methods.agent.session.new, { sessionId: "wrong" });
|
|
17
|
+
// @ts-expect-error Built-in notifications must not fall through the extension overload.
|
|
18
|
+
agentContext.notify(methods.agent.session.cancel, {});
|
|
19
|
+
agent().onRequest(
|
|
20
|
+
// @ts-expect-error Built-in handlers cannot replace their generated params parser.
|
|
21
|
+
methods.agent.session.new, (params) => params, () => ({ sessionId: "wrong-parser" }));
|
|
22
|
+
// @ts-expect-error Request methods cannot be sent as notifications.
|
|
23
|
+
agentContext.notify(methods.agent.session.new, {});
|
|
24
|
+
// @ts-expect-error Notification methods cannot be sent as requests.
|
|
25
|
+
agentContext.request(methods.agent.session.cancel, {});
|
|
26
|
+
// @ts-expect-error Client-directed methods cannot be sent to an agent.
|
|
27
|
+
agentContext.request(methods.client.mcp.disconnect, {
|
|
28
|
+
connectionId: "connection-1",
|
|
29
|
+
});
|
|
30
|
+
const parseValue = (params) => params;
|
|
31
|
+
void agentContext.request("session/load", { sessionId: "session-1" });
|
|
32
|
+
void agentContext.request("session/load", { sessionId: "session-1" });
|
|
33
|
+
void agentContext.request("_vendor/acme/echo", { value: "request" });
|
|
34
|
+
void agentContext.notify("session/set_model", { modelId: "model-1" });
|
|
35
|
+
agent().onRequest("session/load", parseValue, ({ params }) => params);
|
|
36
|
+
agent().onNotification("session/set_model", parseValue, () => { });
|
|
37
|
+
const dynamicMethod = "method/from-another-draft";
|
|
38
|
+
void agentContext.request(dynamicMethod, {});
|
|
39
|
+
void agentContext.notify(dynamicMethod, {});
|
|
40
|
+
agent().onRequest(dynamicMethod, parseValue, ({ params }) => params);
|
|
41
|
+
agent().onNotification(dynamicMethod, parseValue, () => { });
|
|
42
|
+
const outputs = agentContext.batch([
|
|
43
|
+
batchRequest(methods.agent.session.new, {
|
|
44
|
+
cwd: "/workspace",
|
|
45
|
+
mcpServers: [],
|
|
46
|
+
}),
|
|
47
|
+
batchNotification(methods.agent.session.cancel, {
|
|
48
|
+
sessionId: "session-1",
|
|
49
|
+
}),
|
|
50
|
+
]);
|
|
51
|
+
expectTypeOf(outputs).toEqualTypeOf();
|
|
52
|
+
void agentContext.notify(methods.protocol.cancelRequest, { requestId: 1 });
|
|
53
|
+
const clientRequest = batchRequest(methods.client.mcp.disconnect, {
|
|
54
|
+
connectionId: "connection-1",
|
|
55
|
+
});
|
|
56
|
+
// @ts-expect-error Notification methods cannot be used as batch requests.
|
|
57
|
+
batchRequest(methods.agent.session.cancel, { sessionId: "session-1" });
|
|
58
|
+
// @ts-expect-error Request methods cannot be used as batch notifications.
|
|
59
|
+
batchNotification(methods.agent.session.new, {
|
|
60
|
+
cwd: "/workspace",
|
|
61
|
+
mcpServers: [],
|
|
62
|
+
});
|
|
63
|
+
// @ts-expect-error Client-directed methods cannot be sent in an agent-directed batch.
|
|
64
|
+
agentContext.batch([clientRequest]);
|
|
65
|
+
agentContext.batch([
|
|
66
|
+
// @ts-expect-error Raw built-in batch entries must use method-specific params.
|
|
67
|
+
{
|
|
68
|
+
kind: "request",
|
|
69
|
+
method: methods.agent.session.new,
|
|
70
|
+
params: { sessionId: "wrong" },
|
|
71
|
+
},
|
|
72
|
+
]);
|
|
73
|
+
agentContext.batch([
|
|
74
|
+
batchRequest("session/load", { sessionId: "session-1" }),
|
|
75
|
+
batchNotification("session/set_model", { modelId: "model-1" }),
|
|
76
|
+
]);
|
|
77
|
+
const legacyAgentEntry = batchRequest("session/load", {
|
|
78
|
+
sessionId: "session-1",
|
|
79
|
+
});
|
|
80
|
+
const legacyClientEntry = batchNotification("authentication/status", {});
|
|
81
|
+
void legacyAgentEntry;
|
|
82
|
+
void legacyClientEntry;
|
|
83
|
+
agentContext.batch([
|
|
84
|
+
{ kind: "request", method: dynamicMethod, params: {} },
|
|
85
|
+
{ kind: "notification", method: dynamicMethod, params: {} },
|
|
86
|
+
]);
|
|
87
|
+
clientContext.batch([clientRequest]);
|
|
88
|
+
}
|
|
89
|
+
void assertV2MethodTypes;
|
|
90
|
+
function memoryWireStreamPair() {
|
|
91
|
+
const leftToRight = new TransformStream();
|
|
92
|
+
const rightToLeft = new TransformStream();
|
|
93
|
+
return [
|
|
94
|
+
{
|
|
95
|
+
readable: rightToLeft.readable,
|
|
96
|
+
writable: leftToRight.writable,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
readable: leftToRight.readable,
|
|
100
|
+
writable: rightToLeft.writable,
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
async function respondToNextRequest(stream, result) {
|
|
105
|
+
const reader = stream.readable.getReader();
|
|
106
|
+
const request = await reader.read();
|
|
107
|
+
reader.releaseLock();
|
|
108
|
+
if (request.done ||
|
|
109
|
+
Array.isArray(request.value) ||
|
|
110
|
+
!("id" in request.value)) {
|
|
111
|
+
throw new Error("Expected one JSON-RPC request");
|
|
112
|
+
}
|
|
113
|
+
const writer = stream.writable.getWriter();
|
|
114
|
+
try {
|
|
115
|
+
await writer.write({
|
|
116
|
+
jsonrpc: "2.0",
|
|
117
|
+
id: request.value.id,
|
|
118
|
+
result,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
finally {
|
|
122
|
+
writer.releaseLock();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
describe("experimental v2 date-time schemas", () => {
|
|
126
|
+
it("preserves RFC 3339 timestamps with timezone offsets as strings", () => {
|
|
127
|
+
const timestamp = "2026-07-20T01:00:00+01:00";
|
|
128
|
+
const annotations = zAnnotations.parse({
|
|
129
|
+
lastModified: timestamp,
|
|
130
|
+
});
|
|
131
|
+
const sessionInfo = zSessionInfo.parse({
|
|
132
|
+
sessionId: "session-1",
|
|
133
|
+
cwd: "/workspace",
|
|
134
|
+
updatedAt: timestamp,
|
|
135
|
+
});
|
|
136
|
+
const sessionInfoUpdate = zSessionInfoUpdate.parse({
|
|
137
|
+
updatedAt: timestamp,
|
|
138
|
+
});
|
|
139
|
+
expect(annotations.lastModified).toBe(timestamp);
|
|
140
|
+
expect(sessionInfo.updatedAt).toBe(timestamp);
|
|
141
|
+
expect(sessionInfoUpdate.updatedAt).toBe(timestamp);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
describe("experimental v2 diff schemas", () => {
|
|
145
|
+
it("uses text for git patch payloads", () => {
|
|
146
|
+
const patch = zDiffPatch.parse({
|
|
147
|
+
format: "git_patch",
|
|
148
|
+
text: "diff --git /workspace/a /workspace/a\n",
|
|
149
|
+
});
|
|
150
|
+
expect(patch.text).toBe("diff --git /workspace/a /workspace/a\n");
|
|
151
|
+
expect(zDiffPatch.safeParse({
|
|
152
|
+
format: "git_patch",
|
|
153
|
+
diff: "diff --git /workspace/a /workspace/a\n",
|
|
154
|
+
}).success).toBe(false);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
describe("experimental v2 streams", () => {
|
|
158
|
+
it("defaults NDJSON streams to batch-capable wire messages", async () => {
|
|
159
|
+
const chunks = [];
|
|
160
|
+
const stream = sdk.ndJsonStream(new WritableStream({
|
|
161
|
+
write(chunk) {
|
|
162
|
+
chunks.push(chunk);
|
|
163
|
+
},
|
|
164
|
+
}), new ReadableStream({
|
|
165
|
+
start(controller) {
|
|
166
|
+
controller.close();
|
|
167
|
+
},
|
|
168
|
+
}));
|
|
169
|
+
const batch = [
|
|
170
|
+
{ jsonrpc: "2.0", id: 1, method: "example/request" },
|
|
171
|
+
{ jsonrpc: "2.0", method: "example/notification" },
|
|
172
|
+
];
|
|
173
|
+
const typedStream = stream;
|
|
174
|
+
const writer = typedStream.writable.getWriter();
|
|
175
|
+
await writer.write(batch);
|
|
176
|
+
writer.releaseLock();
|
|
177
|
+
expect(new TextDecoder().decode(chunks[0])).toBe(`${JSON.stringify(batch)}\n`);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
describe("experimental v2 app API", () => {
|
|
181
|
+
it("defensively copies nested session request values", async () => {
|
|
182
|
+
const requestMeta = { nested: { value: "request" } };
|
|
183
|
+
const httpMeta = { nested: { value: "http" } };
|
|
184
|
+
const headerMeta = { nested: { value: "header" } };
|
|
185
|
+
const headers = [
|
|
186
|
+
{
|
|
187
|
+
name: "Authorization",
|
|
188
|
+
value: "original-header",
|
|
189
|
+
_meta: headerMeta,
|
|
190
|
+
},
|
|
191
|
+
];
|
|
192
|
+
const httpServer = {
|
|
193
|
+
type: "http",
|
|
194
|
+
name: "http-server",
|
|
195
|
+
url: "https://example.com/mcp",
|
|
196
|
+
headers,
|
|
197
|
+
_meta: httpMeta,
|
|
198
|
+
};
|
|
199
|
+
const stdioMeta = { nested: { value: "stdio" } };
|
|
200
|
+
const envMeta = { nested: { value: "env" } };
|
|
201
|
+
const args = ["--mode", "test"];
|
|
202
|
+
const env = [{ name: "TOKEN", value: "original-env", _meta: envMeta }];
|
|
203
|
+
const stdioServer = {
|
|
204
|
+
type: "stdio",
|
|
205
|
+
name: "stdio-server",
|
|
206
|
+
command: "/usr/bin/example-mcp",
|
|
207
|
+
args,
|
|
208
|
+
env,
|
|
209
|
+
_meta: stdioMeta,
|
|
210
|
+
};
|
|
211
|
+
const acpMeta = { nested: { value: "acp" } };
|
|
212
|
+
const acpServer = {
|
|
213
|
+
type: "acp",
|
|
214
|
+
name: "acp-server",
|
|
215
|
+
serverId: "server-1",
|
|
216
|
+
_meta: acpMeta,
|
|
217
|
+
};
|
|
218
|
+
const customSettings = { nested: { value: "custom" } };
|
|
219
|
+
const customServer = {
|
|
220
|
+
type: "_vendor/custom",
|
|
221
|
+
name: "custom-server",
|
|
222
|
+
settings: customSettings,
|
|
223
|
+
};
|
|
224
|
+
const additionalDirectories = ["/workspace/other"];
|
|
225
|
+
const request = {
|
|
226
|
+
cwd: "/workspace",
|
|
227
|
+
additionalDirectories,
|
|
228
|
+
mcpServers: [httpServer, stdioServer, acpServer, customServer],
|
|
229
|
+
_meta: requestMeta,
|
|
230
|
+
};
|
|
231
|
+
const expected = structuredClone(request);
|
|
232
|
+
await client().connectWith(testAgent(), (agentClient) => {
|
|
233
|
+
const builder = agentClient.buildSession(request);
|
|
234
|
+
additionalDirectories[0] = "/mutated-input";
|
|
235
|
+
requestMeta.nested.value = "mutated-input";
|
|
236
|
+
httpServer.name = "mutated-input";
|
|
237
|
+
headers[0].value = "mutated-input";
|
|
238
|
+
headerMeta.nested.value = "mutated-input";
|
|
239
|
+
httpMeta.nested.value = "mutated-input";
|
|
240
|
+
args[0] = "mutated-input";
|
|
241
|
+
env[0].value = "mutated-input";
|
|
242
|
+
envMeta.nested.value = "mutated-input";
|
|
243
|
+
stdioMeta.nested.value = "mutated-input";
|
|
244
|
+
acpMeta.nested.value = "mutated-input";
|
|
245
|
+
customSettings.nested.value = "mutated-input";
|
|
246
|
+
request.mcpServers.pop();
|
|
247
|
+
expect(builder.toRequest()).toEqual(expected);
|
|
248
|
+
const returned = builder.toRequest();
|
|
249
|
+
returned.additionalDirectories[0] = "/mutated-output";
|
|
250
|
+
returned._meta.nested.value = "mutated-output";
|
|
251
|
+
const returnedHttp = returned.mcpServers[0];
|
|
252
|
+
returnedHttp.name = "mutated-output";
|
|
253
|
+
returnedHttp.headers[0].value = "mutated-output";
|
|
254
|
+
returnedHttp.headers[0]._meta.nested.value =
|
|
255
|
+
"mutated-output";
|
|
256
|
+
returnedHttp._meta.nested.value = "mutated-output";
|
|
257
|
+
const returnedStdio = returned.mcpServers[1];
|
|
258
|
+
returnedStdio.args[0] = "mutated-output";
|
|
259
|
+
returnedStdio.env[0].value = "mutated-output";
|
|
260
|
+
returnedStdio.env[0]._meta.nested.value =
|
|
261
|
+
"mutated-output";
|
|
262
|
+
returnedStdio._meta.nested.value = "mutated-output";
|
|
263
|
+
const returnedAcp = returned.mcpServers[2];
|
|
264
|
+
returnedAcp._meta.nested.value = "mutated-output";
|
|
265
|
+
const returnedCustom = returned.mcpServers[3];
|
|
266
|
+
returnedCustom.settings.nested.value = "mutated-output";
|
|
267
|
+
returned.mcpServers.pop();
|
|
268
|
+
expect(builder.toRequest()).toEqual(expected);
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
it("copies MCP servers when adding them to a session builder", async () => {
|
|
272
|
+
const serverMeta = { nested: { value: "server" } };
|
|
273
|
+
const envMeta = { nested: { value: "env" } };
|
|
274
|
+
const args = ["--original"];
|
|
275
|
+
const env = [{ name: "TOKEN", value: "original", _meta: envMeta }];
|
|
276
|
+
const mcpServer = {
|
|
277
|
+
type: "stdio",
|
|
278
|
+
name: "stdio-server",
|
|
279
|
+
command: "/usr/bin/example-mcp",
|
|
280
|
+
args,
|
|
281
|
+
env,
|
|
282
|
+
_meta: serverMeta,
|
|
283
|
+
};
|
|
284
|
+
const expected = structuredClone(mcpServer);
|
|
285
|
+
await client().connectWith(testAgent(), (agentClient) => {
|
|
286
|
+
const builder = agentClient
|
|
287
|
+
.buildSession("/workspace")
|
|
288
|
+
.withMcpServer(mcpServer);
|
|
289
|
+
args[0] = "mutated-input";
|
|
290
|
+
env[0].value = "mutated-input";
|
|
291
|
+
envMeta.nested.value = "mutated-input";
|
|
292
|
+
serverMeta.nested.value = "mutated-input";
|
|
293
|
+
expect(builder.toRequest().mcpServers).toEqual([expected]);
|
|
294
|
+
const returned = builder.toRequest().mcpServers[0];
|
|
295
|
+
returned.args[0] = "mutated-output";
|
|
296
|
+
returned.env[0].value = "mutated-output";
|
|
297
|
+
returned.env[0]._meta.nested.value = "mutated-output";
|
|
298
|
+
returned._meta.nested.value = "mutated-output";
|
|
299
|
+
expect(builder.toRequest().mcpServers).toEqual([expected]);
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
it("re-exports every generated extensible-union guard", () => {
|
|
303
|
+
const guardNames = Object.keys(guards);
|
|
304
|
+
expect(guardNames.length).toBeGreaterThan(0);
|
|
305
|
+
for (const name of guardNames) {
|
|
306
|
+
expect(sdk[name]).toBe(guards[name]);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
it("initializes exactly once, queues later calls, and exposes the exchange", async () => {
|
|
310
|
+
const initializeGate = Promise.withResolvers();
|
|
311
|
+
const agentReady = Promise.withResolvers();
|
|
312
|
+
const clientReady = Promise.withResolvers();
|
|
313
|
+
const events = [];
|
|
314
|
+
let newSessionCalls = 0;
|
|
315
|
+
let receivedInitialize;
|
|
316
|
+
const requestMeta = { nested: { source: "client" } };
|
|
317
|
+
const initializeRequest = {
|
|
318
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
319
|
+
info: clientInfo,
|
|
320
|
+
capabilities: {
|
|
321
|
+
_meta: requestMeta,
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
const initializeResponse = {
|
|
325
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
326
|
+
info: agentInfo,
|
|
327
|
+
capabilities: {
|
|
328
|
+
session: {},
|
|
329
|
+
_meta: { source: "agent" },
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
const expectedInitializeRequest = structuredClone(initializeRequest);
|
|
333
|
+
const agentApp = agent()
|
|
334
|
+
.onConnect(async (connection) => {
|
|
335
|
+
events.push("agent-connect");
|
|
336
|
+
const initialization = await connection.initialized;
|
|
337
|
+
events.push("agent-initialized");
|
|
338
|
+
expect(initialization).toMatchObject({
|
|
339
|
+
request: expectedInitializeRequest,
|
|
340
|
+
response: initializeResponse,
|
|
341
|
+
});
|
|
342
|
+
agentReady.resolve();
|
|
343
|
+
})
|
|
344
|
+
.onRequest(methods.agent.initialize, async ({ params }) => {
|
|
345
|
+
receivedInitialize = params;
|
|
346
|
+
await initializeGate.promise;
|
|
347
|
+
return initializeResponse;
|
|
348
|
+
})
|
|
349
|
+
.onRequest(methods.agent.session.new, () => {
|
|
350
|
+
newSessionCalls += 1;
|
|
351
|
+
return { sessionId: "session-1" };
|
|
352
|
+
});
|
|
353
|
+
const clientApp = client().onConnect(async (connection) => {
|
|
354
|
+
events.push("client-connect");
|
|
355
|
+
const initialization = await connection.initialized;
|
|
356
|
+
events.push("client-initialized");
|
|
357
|
+
expect(initialization).toMatchObject({
|
|
358
|
+
request: expectedInitializeRequest,
|
|
359
|
+
response: initializeResponse,
|
|
360
|
+
});
|
|
361
|
+
clientReady.resolve();
|
|
362
|
+
});
|
|
363
|
+
await clientApp.connectWith(agentApp, async (agentContext) => {
|
|
364
|
+
await expect(agentContext.request(methods.agent.session.new, {
|
|
365
|
+
cwd: "/workspace",
|
|
366
|
+
mcpServers: [],
|
|
367
|
+
})).rejects.toMatchObject({ code: -32600 });
|
|
368
|
+
await expect(agentContext.notify(methods.agent.session.cancel, {
|
|
369
|
+
sessionId: "session-1",
|
|
370
|
+
})).rejects.toMatchObject({ code: -32600 });
|
|
371
|
+
await expect(agentContext.request("_vendor/pre-initialize", {})).rejects.toMatchObject({ code: -32600 });
|
|
372
|
+
expect(() => agentContext.request(methods.agent.initialize, {
|
|
373
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
374
|
+
info: clientInfo,
|
|
375
|
+
_meta: { notCloneable: () => undefined },
|
|
376
|
+
})).toThrow();
|
|
377
|
+
const initialized = agentContext.request(methods.agent.initialize, initializeRequest);
|
|
378
|
+
requestMeta.nested.source = "mutated";
|
|
379
|
+
const queuedSession = agentContext.request(methods.agent.session.new, {
|
|
380
|
+
cwd: "/workspace",
|
|
381
|
+
mcpServers: [],
|
|
382
|
+
});
|
|
383
|
+
await Promise.resolve();
|
|
384
|
+
expect(newSessionCalls).toBe(0);
|
|
385
|
+
expect(() => agentContext.request(methods.agent.initialize, initializeRequest)).toThrow("Invalid request");
|
|
386
|
+
initializeGate.resolve();
|
|
387
|
+
await expect(initialized).resolves.toMatchObject(initializeResponse);
|
|
388
|
+
await expect(queuedSession).resolves.toEqual({ sessionId: "session-1" });
|
|
389
|
+
await expect(agentContext.initialized).resolves.toMatchObject({
|
|
390
|
+
request: expectedInitializeRequest,
|
|
391
|
+
response: initializeResponse,
|
|
392
|
+
});
|
|
393
|
+
expect(receivedInitialize).toMatchObject(expectedInitializeRequest);
|
|
394
|
+
expect(events.slice(0, 2)).toEqual(["agent-connect", "client-connect"]);
|
|
395
|
+
expect(events).toContain("client-initialized");
|
|
396
|
+
expect(() => agentContext.request(methods.agent.initialize, initializeRequest)).toThrow("Invalid request");
|
|
397
|
+
});
|
|
398
|
+
await Promise.all([agentReady.promise, clientReady.promise]);
|
|
399
|
+
expect(events).toContain("agent-initialized");
|
|
400
|
+
});
|
|
401
|
+
it("supports standalone initialize batches and does not retry failures", async () => {
|
|
402
|
+
let initializedConnections = 0;
|
|
403
|
+
let receivedInitialize;
|
|
404
|
+
const agentInitialized = Promise.withResolvers();
|
|
405
|
+
const validAgent = agent()
|
|
406
|
+
.onConnect(async (connection) => {
|
|
407
|
+
await connection.initialized;
|
|
408
|
+
initializedConnections += 1;
|
|
409
|
+
agentInitialized.resolve();
|
|
410
|
+
})
|
|
411
|
+
.onRequest(methods.agent.initialize, ({ params }) => {
|
|
412
|
+
receivedInitialize = params;
|
|
413
|
+
return {
|
|
414
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
415
|
+
info: agentInfo,
|
|
416
|
+
};
|
|
417
|
+
});
|
|
418
|
+
const validConnection = client().connect(validAgent);
|
|
419
|
+
const agentContext = validConnection.agent;
|
|
420
|
+
try {
|
|
421
|
+
await expect(agentContext.batch([
|
|
422
|
+
batchRequest(methods.agent.initialize, {
|
|
423
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
424
|
+
info: clientInfo,
|
|
425
|
+
}),
|
|
426
|
+
batchNotification(methods.agent.session.cancel, {
|
|
427
|
+
sessionId: "session-1",
|
|
428
|
+
}),
|
|
429
|
+
])).rejects.toMatchObject({ code: -32600 });
|
|
430
|
+
await expect(agentContext.batch([
|
|
431
|
+
batchRequest(methods.agent.initialize, {
|
|
432
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
433
|
+
info: clientInfo,
|
|
434
|
+
}),
|
|
435
|
+
batchRequest(methods.agent.initialize, {
|
|
436
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
437
|
+
info: clientInfo,
|
|
438
|
+
}),
|
|
439
|
+
])).rejects.toMatchObject({ code: -32600 });
|
|
440
|
+
let metaReads = 0;
|
|
441
|
+
const initializeRequest = {
|
|
442
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
443
|
+
info: clientInfo,
|
|
444
|
+
get _meta() {
|
|
445
|
+
metaReads += 1;
|
|
446
|
+
return { seen: metaReads };
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
const mapperError = new Error("initialize mapper failed");
|
|
450
|
+
await expect(agentContext.batch([
|
|
451
|
+
batchRequest(methods.agent.initialize, initializeRequest, () => {
|
|
452
|
+
throw mapperError;
|
|
453
|
+
}),
|
|
454
|
+
])).rejects.toBe(mapperError);
|
|
455
|
+
expect(validConnection.signal.aborted).toBe(false);
|
|
456
|
+
validConnection.close();
|
|
457
|
+
await validConnection.closed;
|
|
458
|
+
await agentInitialized.promise;
|
|
459
|
+
expect(initializedConnections).toBe(1);
|
|
460
|
+
expect(metaReads).toBe(1);
|
|
461
|
+
expect(receivedInitialize?._meta).toEqual({ seen: 1 });
|
|
462
|
+
await expect(agentContext.initialized).resolves.toMatchObject({
|
|
463
|
+
request: { _meta: { seen: 1 } },
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
finally {
|
|
467
|
+
validConnection.close();
|
|
468
|
+
await validConnection.closed;
|
|
469
|
+
}
|
|
470
|
+
const invalidAgent = agent().onRequest(methods.agent.initialize, () => ({
|
|
471
|
+
protocolVersion: 1,
|
|
472
|
+
info: agentInfo,
|
|
473
|
+
}));
|
|
474
|
+
const invalidConnection = client().connect(invalidAgent);
|
|
475
|
+
try {
|
|
476
|
+
const initialized = invalidConnection.agent.request(methods.agent.initialize, {
|
|
477
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
478
|
+
info: clientInfo,
|
|
479
|
+
});
|
|
480
|
+
const queued = invalidConnection.agent.request(methods.agent.session.new, {
|
|
481
|
+
cwd: "/workspace",
|
|
482
|
+
mcpServers: [],
|
|
483
|
+
});
|
|
484
|
+
const initializeError = await initialized.catch((error) => error);
|
|
485
|
+
expect(initializeError).toMatchObject({ code: -32600 });
|
|
486
|
+
await expect(invalidConnection.initialized).rejects.toBe(initializeError);
|
|
487
|
+
await expect(queued).rejects.toBe(initializeError);
|
|
488
|
+
await expect(invalidConnection.agent.initialized).rejects.toBe(initializeError);
|
|
489
|
+
await invalidConnection.closed;
|
|
490
|
+
expect(invalidConnection.signal.reason).toBe(initializeError);
|
|
491
|
+
expect(() => invalidConnection.agent.request(methods.agent.initialize, {
|
|
492
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
493
|
+
info: clientInfo,
|
|
494
|
+
})).toThrow("Invalid request");
|
|
495
|
+
}
|
|
496
|
+
finally {
|
|
497
|
+
invalidConnection.close();
|
|
498
|
+
await invalidConnection.closed;
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
it("rejects initialize after a pre-initialize request fails the connection", async () => {
|
|
502
|
+
let initializeCalls = 0;
|
|
503
|
+
let newSessionCalls = 0;
|
|
504
|
+
const agentApp = agent()
|
|
505
|
+
.onRequest(methods.agent.initialize, () => {
|
|
506
|
+
initializeCalls += 1;
|
|
507
|
+
return {
|
|
508
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
509
|
+
info: agentInfo,
|
|
510
|
+
};
|
|
511
|
+
})
|
|
512
|
+
.onRequest(methods.agent.session.new, () => {
|
|
513
|
+
newSessionCalls += 1;
|
|
514
|
+
return { sessionId: "session-1" };
|
|
515
|
+
});
|
|
516
|
+
const [agentStream, peerStream] = memoryWireStreamPair();
|
|
517
|
+
const connection = agentApp.connect(agentStream);
|
|
518
|
+
const writer = peerStream.writable.getWriter();
|
|
519
|
+
const reader = peerStream.readable.getReader();
|
|
520
|
+
try {
|
|
521
|
+
const preInitializeWrite = writer.write({
|
|
522
|
+
jsonrpc: "2.0",
|
|
523
|
+
id: 1,
|
|
524
|
+
method: methods.agent.session.new,
|
|
525
|
+
params: { cwd: "/workspace", mcpServers: [] },
|
|
526
|
+
});
|
|
527
|
+
await expect(reader.read()).resolves.toMatchObject({
|
|
528
|
+
done: false,
|
|
529
|
+
value: {
|
|
530
|
+
id: 1,
|
|
531
|
+
error: { code: -32600 },
|
|
532
|
+
},
|
|
533
|
+
});
|
|
534
|
+
await preInitializeWrite;
|
|
535
|
+
const initializeWrite = writer.write({
|
|
536
|
+
jsonrpc: "2.0",
|
|
537
|
+
id: 2,
|
|
538
|
+
method: methods.agent.initialize,
|
|
539
|
+
params: {
|
|
540
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
541
|
+
info: clientInfo,
|
|
542
|
+
},
|
|
543
|
+
});
|
|
544
|
+
await expect(reader.read()).resolves.toMatchObject({
|
|
545
|
+
done: false,
|
|
546
|
+
value: {
|
|
547
|
+
id: 2,
|
|
548
|
+
error: { code: -32600 },
|
|
549
|
+
},
|
|
550
|
+
});
|
|
551
|
+
await initializeWrite;
|
|
552
|
+
expect(initializeCalls).toBe(0);
|
|
553
|
+
expect(newSessionCalls).toBe(0);
|
|
554
|
+
await expect(connection.initialized).rejects.toMatchObject({
|
|
555
|
+
code: -32600,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
finally {
|
|
559
|
+
writer.releaseLock();
|
|
560
|
+
reader.releaseLock();
|
|
561
|
+
connection.close();
|
|
562
|
+
await connection.closed;
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
it("rejects mixed raw initialize batches before dispatching handlers", async () => {
|
|
566
|
+
let initializeCalls = 0;
|
|
567
|
+
let newSessionCalls = 0;
|
|
568
|
+
const agentApp = agent()
|
|
569
|
+
.onRequest(methods.agent.initialize, () => {
|
|
570
|
+
initializeCalls += 1;
|
|
571
|
+
return {
|
|
572
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
573
|
+
info: agentInfo,
|
|
574
|
+
};
|
|
575
|
+
})
|
|
576
|
+
.onRequest(methods.agent.session.new, () => {
|
|
577
|
+
newSessionCalls += 1;
|
|
578
|
+
return { sessionId: "session-1" };
|
|
579
|
+
});
|
|
580
|
+
const [agentStream, peerStream] = memoryWireStreamPair();
|
|
581
|
+
const connection = agentApp.connect(agentStream);
|
|
582
|
+
const writer = peerStream.writable.getWriter();
|
|
583
|
+
const reader = peerStream.readable.getReader();
|
|
584
|
+
try {
|
|
585
|
+
const batchWrite = writer.write([
|
|
586
|
+
{
|
|
587
|
+
jsonrpc: "2.0",
|
|
588
|
+
id: 1,
|
|
589
|
+
method: methods.agent.initialize,
|
|
590
|
+
params: {
|
|
591
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
592
|
+
info: clientInfo,
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
jsonrpc: "2.0",
|
|
597
|
+
id: 2,
|
|
598
|
+
method: methods.agent.session.new,
|
|
599
|
+
params: { cwd: "/workspace", mcpServers: [] },
|
|
600
|
+
},
|
|
601
|
+
]);
|
|
602
|
+
await expect(reader.read()).resolves.toMatchObject({
|
|
603
|
+
done: false,
|
|
604
|
+
value: expect.arrayContaining([
|
|
605
|
+
expect.objectContaining({
|
|
606
|
+
id: 1,
|
|
607
|
+
error: expect.objectContaining({ code: -32600 }),
|
|
608
|
+
}),
|
|
609
|
+
expect.objectContaining({
|
|
610
|
+
id: 2,
|
|
611
|
+
error: expect.objectContaining({ code: -32600 }),
|
|
612
|
+
}),
|
|
613
|
+
]),
|
|
614
|
+
});
|
|
615
|
+
await batchWrite;
|
|
616
|
+
expect(initializeCalls).toBe(0);
|
|
617
|
+
expect(newSessionCalls).toBe(0);
|
|
618
|
+
await expect(connection.initialized).rejects.toMatchObject({
|
|
619
|
+
code: -32600,
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
finally {
|
|
623
|
+
writer.releaseLock();
|
|
624
|
+
reader.releaseLock();
|
|
625
|
+
connection.close();
|
|
626
|
+
await connection.closed;
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
it("requires an initialize handler before opening a connection", async () => {
|
|
630
|
+
const agentApp = agent();
|
|
631
|
+
const [firstStream] = memoryWireStreamPair();
|
|
632
|
+
expect(() => agentApp.connect(firstStream)).toThrow("requires an initialize request handler");
|
|
633
|
+
agentApp.onRequest(methods.agent.initialize, () => ({
|
|
634
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
635
|
+
info: agentInfo,
|
|
636
|
+
}));
|
|
637
|
+
const [secondStream] = memoryWireStreamPair();
|
|
638
|
+
const connection = agentApp.connect(secondStream);
|
|
639
|
+
connection.close();
|
|
640
|
+
await connection.closed;
|
|
641
|
+
await expect(connection.initialized).rejects.toThrow("ACP connection closed");
|
|
642
|
+
});
|
|
643
|
+
it("treats a cancellation notification before initialize as the first message", async () => {
|
|
644
|
+
let initializeCalls = 0;
|
|
645
|
+
const agentApp = agent().onRequest(methods.agent.initialize, () => {
|
|
646
|
+
initializeCalls += 1;
|
|
647
|
+
return {
|
|
648
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
649
|
+
info: agentInfo,
|
|
650
|
+
};
|
|
651
|
+
});
|
|
652
|
+
const [agentStream, peerStream] = memoryWireStreamPair();
|
|
653
|
+
const connection = agentApp.connect(agentStream);
|
|
654
|
+
const writer = peerStream.writable.getWriter();
|
|
655
|
+
const reader = peerStream.readable.getReader();
|
|
656
|
+
try {
|
|
657
|
+
await writer.write({
|
|
658
|
+
jsonrpc: "2.0",
|
|
659
|
+
method: methods.protocol.cancelRequest,
|
|
660
|
+
params: { requestId: 999 },
|
|
661
|
+
});
|
|
662
|
+
const initializeWrite = writer.write({
|
|
663
|
+
jsonrpc: "2.0",
|
|
664
|
+
id: 1,
|
|
665
|
+
method: methods.agent.initialize,
|
|
666
|
+
params: {
|
|
667
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
668
|
+
info: clientInfo,
|
|
669
|
+
},
|
|
670
|
+
});
|
|
671
|
+
await expect(reader.read()).resolves.toMatchObject({
|
|
672
|
+
done: false,
|
|
673
|
+
value: { id: 1, error: { code: -32600 } },
|
|
674
|
+
});
|
|
675
|
+
await initializeWrite;
|
|
676
|
+
expect(initializeCalls).toBe(0);
|
|
677
|
+
}
|
|
678
|
+
finally {
|
|
679
|
+
writer.releaseLock();
|
|
680
|
+
reader.releaseLock();
|
|
681
|
+
connection.close();
|
|
682
|
+
await connection.closed;
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
it("queues raw peer requests behind an in-flight initialize", async () => {
|
|
686
|
+
const initializeGate = Promise.withResolvers();
|
|
687
|
+
const initializeStarted = Promise.withResolvers();
|
|
688
|
+
let newSessionCalls = 0;
|
|
689
|
+
const agentApp = agent()
|
|
690
|
+
.onRequest(methods.agent.initialize, async () => {
|
|
691
|
+
initializeStarted.resolve();
|
|
692
|
+
await initializeGate.promise;
|
|
693
|
+
return {
|
|
694
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
695
|
+
info: agentInfo,
|
|
696
|
+
};
|
|
697
|
+
})
|
|
698
|
+
.onRequest(methods.agent.session.new, () => {
|
|
699
|
+
newSessionCalls += 1;
|
|
700
|
+
return { sessionId: "session-1" };
|
|
701
|
+
});
|
|
702
|
+
const [agentStream, peerStream] = memoryWireStreamPair();
|
|
703
|
+
const connection = agentApp.connect(agentStream);
|
|
704
|
+
const writer = peerStream.writable.getWriter();
|
|
705
|
+
const reader = peerStream.readable.getReader();
|
|
706
|
+
try {
|
|
707
|
+
const initializeWrite = writer.write({
|
|
708
|
+
jsonrpc: "2.0",
|
|
709
|
+
id: 1,
|
|
710
|
+
method: methods.agent.initialize,
|
|
711
|
+
params: {
|
|
712
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
713
|
+
info: clientInfo,
|
|
714
|
+
},
|
|
715
|
+
});
|
|
716
|
+
await initializeStarted.promise;
|
|
717
|
+
const malformedDuplicateWrite = writer.write({
|
|
718
|
+
jsonrpc: "2.0",
|
|
719
|
+
id: 3,
|
|
720
|
+
method: methods.agent.initialize,
|
|
721
|
+
params: { protocolVersion: "invalid" },
|
|
722
|
+
});
|
|
723
|
+
await expect(reader.read()).resolves.toMatchObject({
|
|
724
|
+
done: false,
|
|
725
|
+
value: {
|
|
726
|
+
id: 3,
|
|
727
|
+
error: { code: -32600 },
|
|
728
|
+
},
|
|
729
|
+
});
|
|
730
|
+
await malformedDuplicateWrite;
|
|
731
|
+
await writer.write({
|
|
732
|
+
jsonrpc: "2.0",
|
|
733
|
+
method: methods.protocol.cancelRequest,
|
|
734
|
+
params: { requestId: 999 },
|
|
735
|
+
});
|
|
736
|
+
const queuedWrite = writer.write({
|
|
737
|
+
jsonrpc: "2.0",
|
|
738
|
+
id: 2,
|
|
739
|
+
method: methods.agent.session.new,
|
|
740
|
+
params: { cwd: "/workspace", mcpServers: [] },
|
|
741
|
+
});
|
|
742
|
+
await Promise.resolve();
|
|
743
|
+
expect(newSessionCalls).toBe(0);
|
|
744
|
+
const initializeResponse = reader.read();
|
|
745
|
+
initializeGate.resolve();
|
|
746
|
+
await expect(initializeResponse).resolves.toMatchObject({
|
|
747
|
+
done: false,
|
|
748
|
+
value: {
|
|
749
|
+
id: 1,
|
|
750
|
+
result: { protocolVersion: PROTOCOL_VERSION },
|
|
751
|
+
},
|
|
752
|
+
});
|
|
753
|
+
await initializeWrite;
|
|
754
|
+
await expect(reader.read()).resolves.toMatchObject({
|
|
755
|
+
done: false,
|
|
756
|
+
value: {
|
|
757
|
+
id: 2,
|
|
758
|
+
result: { sessionId: "session-1" },
|
|
759
|
+
},
|
|
760
|
+
});
|
|
761
|
+
await queuedWrite;
|
|
762
|
+
expect(newSessionCalls).toBe(1);
|
|
763
|
+
const malformedCancelWrite = writer.write({
|
|
764
|
+
jsonrpc: "2.0",
|
|
765
|
+
id: 4,
|
|
766
|
+
method: methods.protocol.cancelRequest,
|
|
767
|
+
params: { requestId: 999 },
|
|
768
|
+
});
|
|
769
|
+
await expect(reader.read()).resolves.toMatchObject({
|
|
770
|
+
done: false,
|
|
771
|
+
value: { id: 4, error: { code: -32601 } },
|
|
772
|
+
});
|
|
773
|
+
await malformedCancelWrite;
|
|
774
|
+
}
|
|
775
|
+
finally {
|
|
776
|
+
initializeGate.resolve();
|
|
777
|
+
writer.releaseLock();
|
|
778
|
+
reader.releaseLock();
|
|
779
|
+
connection.close();
|
|
780
|
+
await connection.closed;
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
it("rejects queued peer calls when an in-flight initialize connection closes", async () => {
|
|
784
|
+
const initializeGate = Promise.withResolvers();
|
|
785
|
+
const initializeStarted = Promise.withResolvers();
|
|
786
|
+
const agentApp = agent().onRequest(methods.agent.initialize, async () => {
|
|
787
|
+
initializeStarted.resolve();
|
|
788
|
+
await initializeGate.promise;
|
|
789
|
+
return {
|
|
790
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
791
|
+
info: agentInfo,
|
|
792
|
+
};
|
|
793
|
+
});
|
|
794
|
+
const [agentStream, peerStream] = memoryWireStreamPair();
|
|
795
|
+
const connection = agentApp.connect(agentStream);
|
|
796
|
+
const writer = peerStream.writable.getWriter();
|
|
797
|
+
try {
|
|
798
|
+
const initializeWrite = writer.write({
|
|
799
|
+
jsonrpc: "2.0",
|
|
800
|
+
id: 1,
|
|
801
|
+
method: methods.agent.initialize,
|
|
802
|
+
params: {
|
|
803
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
804
|
+
info: clientInfo,
|
|
805
|
+
},
|
|
806
|
+
});
|
|
807
|
+
await initializeStarted.promise;
|
|
808
|
+
await initializeWrite;
|
|
809
|
+
const queuedCall = connection.client.request("_vendor/queued", {});
|
|
810
|
+
connection.close();
|
|
811
|
+
await expect(queuedCall).rejects.toThrow("ACP connection closed");
|
|
812
|
+
}
|
|
813
|
+
finally {
|
|
814
|
+
initializeGate.resolve();
|
|
815
|
+
writer.releaseLock();
|
|
816
|
+
connection.close();
|
|
817
|
+
await connection.closed;
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
it("does not complete a prompt from an idle update received before it", async () => {
|
|
821
|
+
let updateClient;
|
|
822
|
+
const agentApp = agent()
|
|
823
|
+
.onRequest(methods.agent.initialize, ({ params, client: agentClient }) => {
|
|
824
|
+
updateClient = agentClient;
|
|
825
|
+
return {
|
|
826
|
+
protocolVersion: params.protocolVersion,
|
|
827
|
+
info: agentInfo,
|
|
828
|
+
capabilities: { session: {} },
|
|
829
|
+
};
|
|
830
|
+
})
|
|
831
|
+
.onRequest(methods.agent.session.new, () => ({ sessionId: "session-1" }))
|
|
832
|
+
.onRequest(methods.agent.session.prompt, ({ client: agentClient }) => {
|
|
833
|
+
updateClient = agentClient;
|
|
834
|
+
return { messageId: "user-message-1" };
|
|
835
|
+
});
|
|
836
|
+
await client().connectWith(agentApp, async (agentClient) => {
|
|
837
|
+
await expect(agentClient.request(methods.agent.initialize, {
|
|
838
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
839
|
+
info: clientInfo,
|
|
840
|
+
capabilities: {},
|
|
841
|
+
})).resolves.toMatchObject({ protocolVersion: PROTOCOL_VERSION });
|
|
842
|
+
const session = await agentClient.buildSession("/workspace").start();
|
|
843
|
+
try {
|
|
844
|
+
await updateClient.notify(methods.client.session.update, {
|
|
845
|
+
sessionId: session.sessionId,
|
|
846
|
+
update: { sessionUpdate: "state_update", state: "idle" },
|
|
847
|
+
});
|
|
848
|
+
await expect(session.prompt("Hello")).resolves.toEqual({
|
|
849
|
+
messageId: "user-message-1",
|
|
850
|
+
});
|
|
851
|
+
expect(updateClient).toBeDefined();
|
|
852
|
+
const updates = [
|
|
853
|
+
{
|
|
854
|
+
sessionUpdate: "agent_message_chunk",
|
|
855
|
+
messageId: "message-1",
|
|
856
|
+
content: { type: "text", text: "Hello" },
|
|
857
|
+
},
|
|
858
|
+
{ sessionUpdate: "state_update", state: "running" },
|
|
859
|
+
{ sessionUpdate: "state_update", state: "idle" },
|
|
860
|
+
];
|
|
861
|
+
for (const update of updates) {
|
|
862
|
+
await updateClient.notify(methods.client.session.update, {
|
|
863
|
+
sessionId: session.sessionId,
|
|
864
|
+
update,
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
await expect(session.nextUpdate()).resolves.toMatchObject({
|
|
868
|
+
kind: "session_update",
|
|
869
|
+
update: { sessionUpdate: "state_update", state: "idle" },
|
|
870
|
+
});
|
|
871
|
+
await expect(session.nextUpdate()).resolves.toMatchObject({
|
|
872
|
+
kind: "session_update",
|
|
873
|
+
update: { sessionUpdate: "agent_message_chunk" },
|
|
874
|
+
});
|
|
875
|
+
await expect(session.nextUpdate()).resolves.toMatchObject({
|
|
876
|
+
kind: "session_update",
|
|
877
|
+
update: { sessionUpdate: "state_update", state: "running" },
|
|
878
|
+
});
|
|
879
|
+
await expect(session.nextUpdate()).resolves.toMatchObject({
|
|
880
|
+
kind: "stop",
|
|
881
|
+
update: { sessionUpdate: "state_update", state: "idle" },
|
|
882
|
+
stopReason: undefined,
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
finally {
|
|
886
|
+
session.dispose();
|
|
887
|
+
}
|
|
888
|
+
});
|
|
889
|
+
});
|
|
890
|
+
it("keeps overlapping prompt activity isolated when one request fails", async () => {
|
|
891
|
+
let updateClient;
|
|
892
|
+
const firstPrompt = Promise.withResolvers();
|
|
893
|
+
const secondPrompt = Promise.withResolvers();
|
|
894
|
+
const bothPromptsReceived = Promise.withResolvers();
|
|
895
|
+
let promptCount = 0;
|
|
896
|
+
const agentApp = agent()
|
|
897
|
+
.onRequest(methods.agent.initialize, ({ client: agentClient }) => {
|
|
898
|
+
updateClient = agentClient;
|
|
899
|
+
return {
|
|
900
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
901
|
+
info: agentInfo,
|
|
902
|
+
capabilities: { session: {} },
|
|
903
|
+
};
|
|
904
|
+
})
|
|
905
|
+
.onRequest(methods.agent.session.new, () => ({ sessionId: "session-1" }))
|
|
906
|
+
.onRequest(methods.agent.session.prompt, () => {
|
|
907
|
+
promptCount += 1;
|
|
908
|
+
if (promptCount === 2) {
|
|
909
|
+
bothPromptsReceived.resolve();
|
|
910
|
+
}
|
|
911
|
+
return promptCount === 1 ? firstPrompt.promise : secondPrompt.promise;
|
|
912
|
+
});
|
|
913
|
+
await client().connectWith(agentApp, async (agentClient) => {
|
|
914
|
+
await agentClient.request(methods.agent.initialize, {
|
|
915
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
916
|
+
info: clientInfo,
|
|
917
|
+
});
|
|
918
|
+
const session = await agentClient.buildSession("/workspace").start();
|
|
919
|
+
try {
|
|
920
|
+
const first = session.prompt("First");
|
|
921
|
+
const firstText = session.readText();
|
|
922
|
+
const second = session.prompt("Second");
|
|
923
|
+
await bothPromptsReceived.promise;
|
|
924
|
+
await expect(firstText).rejects.toThrow("cannot attribute updates across overlapping prompts");
|
|
925
|
+
await expect(session.readText()).rejects.toThrow("cannot attribute updates across overlapping prompts");
|
|
926
|
+
firstPrompt.reject(new Error("first prompt rejected"));
|
|
927
|
+
await expect(first).rejects.toThrow("Internal error");
|
|
928
|
+
secondPrompt.resolve({ messageId: "user-message-2" });
|
|
929
|
+
await expect(second).resolves.toEqual({
|
|
930
|
+
messageId: "user-message-2",
|
|
931
|
+
});
|
|
932
|
+
await updateClient.notify(methods.client.session.update, {
|
|
933
|
+
sessionId: session.sessionId,
|
|
934
|
+
update: {
|
|
935
|
+
sessionUpdate: "state_update",
|
|
936
|
+
state: "idle",
|
|
937
|
+
stopReason: "end_turn",
|
|
938
|
+
},
|
|
939
|
+
});
|
|
940
|
+
await expect(session.nextUpdate()).rejects.toThrow("Internal error");
|
|
941
|
+
await expect(session.nextUpdate()).resolves.toMatchObject({
|
|
942
|
+
kind: "stop",
|
|
943
|
+
stopReason: "end_turn",
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
finally {
|
|
947
|
+
session.dispose();
|
|
948
|
+
}
|
|
949
|
+
});
|
|
950
|
+
});
|
|
951
|
+
it("reads full agent messages and applies replacement semantics", async () => {
|
|
952
|
+
let updateClient;
|
|
953
|
+
const agentApp = agent()
|
|
954
|
+
.onRequest(methods.agent.initialize, ({ client: agentClient }) => {
|
|
955
|
+
updateClient = agentClient;
|
|
956
|
+
return {
|
|
957
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
958
|
+
info: agentInfo,
|
|
959
|
+
capabilities: { session: {} },
|
|
960
|
+
};
|
|
961
|
+
})
|
|
962
|
+
.onRequest(methods.agent.session.new, () => ({ sessionId: "session-1" }))
|
|
963
|
+
.onRequest(methods.agent.session.prompt, () => ({
|
|
964
|
+
messageId: "user-message-1",
|
|
965
|
+
}));
|
|
966
|
+
await client().connectWith(agentApp, async (agentClient) => {
|
|
967
|
+
await agentClient.request(methods.agent.initialize, {
|
|
968
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
969
|
+
info: clientInfo,
|
|
970
|
+
});
|
|
971
|
+
const session = await agentClient.buildSession("/workspace").start();
|
|
972
|
+
try {
|
|
973
|
+
await session.prompt("Hello");
|
|
974
|
+
const text = session.readText();
|
|
975
|
+
const updates = [
|
|
976
|
+
{
|
|
977
|
+
sessionUpdate: "agent_message",
|
|
978
|
+
messageId: "message-1",
|
|
979
|
+
content: [{ type: "text", text: "old" }],
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
sessionUpdate: "agent_message_chunk",
|
|
983
|
+
messageId: "message-1",
|
|
984
|
+
content: { type: "text", text: " chunk" },
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
sessionUpdate: "agent_message",
|
|
988
|
+
messageId: "message-1",
|
|
989
|
+
content: [{ type: "text", text: "replacement" }],
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
sessionUpdate: "agent_message",
|
|
993
|
+
messageId: "message-2",
|
|
994
|
+
content: [{ type: "text", text: " second" }],
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
sessionUpdate: "agent_message_chunk",
|
|
998
|
+
messageId: "message-2",
|
|
999
|
+
content: { type: "text", text: "!" },
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
sessionUpdate: "state_update",
|
|
1003
|
+
state: "idle",
|
|
1004
|
+
stopReason: "end_turn",
|
|
1005
|
+
},
|
|
1006
|
+
];
|
|
1007
|
+
for (const update of updates) {
|
|
1008
|
+
await updateClient.notify(methods.client.session.update, {
|
|
1009
|
+
sessionId: session.sessionId,
|
|
1010
|
+
update,
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
await expect(text).resolves.toBe("replacement second!");
|
|
1014
|
+
}
|
|
1015
|
+
finally {
|
|
1016
|
+
session.dispose();
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
});
|
|
1020
|
+
it("starts text reads at the latest prompt boundary", async () => {
|
|
1021
|
+
let updateClient;
|
|
1022
|
+
let promptCount = 0;
|
|
1023
|
+
const agentApp = agent()
|
|
1024
|
+
.onRequest(methods.agent.initialize, ({ client: agentClient }) => {
|
|
1025
|
+
updateClient = agentClient;
|
|
1026
|
+
return {
|
|
1027
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1028
|
+
info: agentInfo,
|
|
1029
|
+
capabilities: { session: {} },
|
|
1030
|
+
};
|
|
1031
|
+
})
|
|
1032
|
+
.onRequest(methods.agent.session.new, () => ({ sessionId: "session-1" }))
|
|
1033
|
+
.onRequest(methods.agent.session.prompt, () => ({
|
|
1034
|
+
messageId: `user-message-${++promptCount}`,
|
|
1035
|
+
}));
|
|
1036
|
+
await client().connectWith(agentApp, async (agentClient) => {
|
|
1037
|
+
await agentClient.request(methods.agent.initialize, {
|
|
1038
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1039
|
+
info: clientInfo,
|
|
1040
|
+
});
|
|
1041
|
+
const session = await agentClient.buildSession("/workspace").start();
|
|
1042
|
+
try {
|
|
1043
|
+
await session.prompt("First");
|
|
1044
|
+
for (const update of [
|
|
1045
|
+
{
|
|
1046
|
+
sessionUpdate: "agent_message",
|
|
1047
|
+
messageId: "message-1",
|
|
1048
|
+
content: [{ type: "text", text: "first" }],
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
sessionUpdate: "state_update",
|
|
1052
|
+
state: "idle",
|
|
1053
|
+
stopReason: "end_turn",
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
sessionUpdate: "agent_message",
|
|
1057
|
+
messageId: "background-message",
|
|
1058
|
+
content: [{ type: "text", text: "background" }],
|
|
1059
|
+
},
|
|
1060
|
+
]) {
|
|
1061
|
+
await updateClient.notify(methods.client.session.update, {
|
|
1062
|
+
sessionId: session.sessionId,
|
|
1063
|
+
update,
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
await session.prompt("Second");
|
|
1067
|
+
const text = session.readText();
|
|
1068
|
+
for (const update of [
|
|
1069
|
+
{
|
|
1070
|
+
sessionUpdate: "agent_message",
|
|
1071
|
+
messageId: "message-2",
|
|
1072
|
+
content: [{ type: "text", text: "second" }],
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
sessionUpdate: "state_update",
|
|
1076
|
+
state: "idle",
|
|
1077
|
+
stopReason: "end_turn",
|
|
1078
|
+
},
|
|
1079
|
+
]) {
|
|
1080
|
+
await updateClient.notify(methods.client.session.update, {
|
|
1081
|
+
sessionId: session.sessionId,
|
|
1082
|
+
update,
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
await expect(text).resolves.toBe("second");
|
|
1086
|
+
}
|
|
1087
|
+
finally {
|
|
1088
|
+
session.dispose();
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
});
|
|
1092
|
+
it("fixes initialization to the v2 protocol boundary", async () => {
|
|
1093
|
+
let receivedVersion;
|
|
1094
|
+
const agentApp = agent().onRequest(methods.agent.initialize, ({ params }) => {
|
|
1095
|
+
receivedVersion = params.protocolVersion;
|
|
1096
|
+
return {
|
|
1097
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1098
|
+
info: agentInfo,
|
|
1099
|
+
};
|
|
1100
|
+
});
|
|
1101
|
+
await expect(client().connectWith(agentApp, async (agentClient) => {
|
|
1102
|
+
const [response] = await agentClient.batch([
|
|
1103
|
+
batchRequest(methods.agent.initialize, { protocolVersion: 1, info: clientInfo }, (value) => value),
|
|
1104
|
+
]);
|
|
1105
|
+
return response;
|
|
1106
|
+
})).resolves.toMatchObject({ protocolVersion: PROTOCOL_VERSION });
|
|
1107
|
+
expect(receivedVersion).toBe(PROTOCOL_VERSION);
|
|
1108
|
+
const wrongVersionAgent = agent().onRequest(methods.agent.initialize, () => ({ protocolVersion: 1, info: agentInfo }));
|
|
1109
|
+
await expect(client().connectWith(wrongVersionAgent, (agentClient) => agentClient.request(methods.agent.initialize, {
|
|
1110
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1111
|
+
info: clientInfo,
|
|
1112
|
+
}))).rejects.toMatchObject({ code: -32600 });
|
|
1113
|
+
});
|
|
1114
|
+
it("validates every built-in direct response before returning it", async () => {
|
|
1115
|
+
const [clientStream, peerStream] = memoryWireStreamPair();
|
|
1116
|
+
const response = client().connectWith(clientStream, async (agentContext) => {
|
|
1117
|
+
await agentContext.request(methods.agent.initialize, {
|
|
1118
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1119
|
+
info: clientInfo,
|
|
1120
|
+
});
|
|
1121
|
+
return agentContext.request(methods.agent.session.new, {
|
|
1122
|
+
cwd: "/workspace",
|
|
1123
|
+
mcpServers: [],
|
|
1124
|
+
});
|
|
1125
|
+
});
|
|
1126
|
+
await respondToNextRequest(peerStream, {
|
|
1127
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1128
|
+
info: agentInfo,
|
|
1129
|
+
});
|
|
1130
|
+
await respondToNextRequest(peerStream, { sessionId: 42 });
|
|
1131
|
+
await expect(response).rejects.toThrow();
|
|
1132
|
+
});
|
|
1133
|
+
it("validates built-in batch responses before applying caller mappings", async () => {
|
|
1134
|
+
const [clientStream, peerStream] = memoryWireStreamPair();
|
|
1135
|
+
let mapped = false;
|
|
1136
|
+
const response = client().connectWith(clientStream, async (agentContext) => {
|
|
1137
|
+
await agentContext.request(methods.agent.initialize, {
|
|
1138
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1139
|
+
info: clientInfo,
|
|
1140
|
+
});
|
|
1141
|
+
return agentContext.batch([
|
|
1142
|
+
batchRequest(methods.agent.session.new, { cwd: "/workspace", mcpServers: [] }, (session) => {
|
|
1143
|
+
mapped = true;
|
|
1144
|
+
return session.sessionId;
|
|
1145
|
+
}),
|
|
1146
|
+
]);
|
|
1147
|
+
});
|
|
1148
|
+
await respondToNextRequest(peerStream, {
|
|
1149
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1150
|
+
info: agentInfo,
|
|
1151
|
+
});
|
|
1152
|
+
const reader = peerStream.readable.getReader();
|
|
1153
|
+
const request = await reader.read();
|
|
1154
|
+
reader.releaseLock();
|
|
1155
|
+
if (request.done ||
|
|
1156
|
+
!Array.isArray(request.value) ||
|
|
1157
|
+
request.value.length !== 1 ||
|
|
1158
|
+
!("id" in request.value[0])) {
|
|
1159
|
+
throw new Error("Expected one JSON-RPC batch request");
|
|
1160
|
+
}
|
|
1161
|
+
const writer = peerStream.writable.getWriter();
|
|
1162
|
+
try {
|
|
1163
|
+
await writer.write([
|
|
1164
|
+
{
|
|
1165
|
+
jsonrpc: "2.0",
|
|
1166
|
+
id: request.value[0].id,
|
|
1167
|
+
result: { sessionId: 42 },
|
|
1168
|
+
},
|
|
1169
|
+
]);
|
|
1170
|
+
}
|
|
1171
|
+
finally {
|
|
1172
|
+
writer.releaseLock();
|
|
1173
|
+
}
|
|
1174
|
+
await expect(response).rejects.toThrow();
|
|
1175
|
+
expect(mapped).toBe(false);
|
|
1176
|
+
});
|
|
1177
|
+
it("rejects peer null for empty responses but preserves local void handlers", async () => {
|
|
1178
|
+
const [clientStream, peerStream] = memoryWireStreamPair();
|
|
1179
|
+
const invalidResponse = client().connectWith(clientStream, async (agentContext) => {
|
|
1180
|
+
await agentContext.request(methods.agent.initialize, {
|
|
1181
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1182
|
+
info: clientInfo,
|
|
1183
|
+
});
|
|
1184
|
+
return agentContext.request(methods.agent.session.delete, {
|
|
1185
|
+
sessionId: "session-1",
|
|
1186
|
+
});
|
|
1187
|
+
});
|
|
1188
|
+
await respondToNextRequest(peerStream, {
|
|
1189
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1190
|
+
info: agentInfo,
|
|
1191
|
+
});
|
|
1192
|
+
await respondToNextRequest(peerStream, null);
|
|
1193
|
+
await expect(invalidResponse).rejects.toThrow();
|
|
1194
|
+
await expect(client().connectWith(agent()
|
|
1195
|
+
.onRequest(methods.agent.initialize, () => ({
|
|
1196
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1197
|
+
info: agentInfo,
|
|
1198
|
+
}))
|
|
1199
|
+
.onRequest(methods.agent.session.delete, () => { }), async (agentContext) => {
|
|
1200
|
+
await agentContext.request(methods.agent.initialize, {
|
|
1201
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1202
|
+
info: clientInfo,
|
|
1203
|
+
});
|
|
1204
|
+
return agentContext.request(methods.agent.session.delete, {
|
|
1205
|
+
sessionId: "session-1",
|
|
1206
|
+
});
|
|
1207
|
+
})).resolves.toEqual({});
|
|
1208
|
+
});
|
|
1209
|
+
it("supports unrecognized protocol methods and underscore extensions", async () => {
|
|
1210
|
+
const parseValue = (params) => params;
|
|
1211
|
+
const returnValue = ({ params }) => params;
|
|
1212
|
+
let agentNotificationValue;
|
|
1213
|
+
let clientNotificationValue;
|
|
1214
|
+
let initializedNotificationValue;
|
|
1215
|
+
const notificationSent = Promise.withResolvers();
|
|
1216
|
+
const clientApp = client()
|
|
1217
|
+
.onRequest("authentication/logout", parseValue, returnValue)
|
|
1218
|
+
.onNotification("authentication/status", parseValue, ({ params }) => {
|
|
1219
|
+
clientNotificationValue = params.value;
|
|
1220
|
+
})
|
|
1221
|
+
.onNotification("_vendor/acme/event", parseValue, ({ params }) => {
|
|
1222
|
+
initializedNotificationValue = params.value;
|
|
1223
|
+
});
|
|
1224
|
+
const agentApp = agent()
|
|
1225
|
+
.onRequest("session/load", parseValue, async ({ params, client }) => {
|
|
1226
|
+
const response = await client.request("authentication/logout", params);
|
|
1227
|
+
await client.notify("authentication/status", params);
|
|
1228
|
+
return response;
|
|
1229
|
+
})
|
|
1230
|
+
.onRequest("_vendor/acme/echo", parseValue, returnValue)
|
|
1231
|
+
.onNotification("session/set_model", parseValue, ({ params }) => {
|
|
1232
|
+
agentNotificationValue = params.value;
|
|
1233
|
+
})
|
|
1234
|
+
.onConnect(async (connection) => {
|
|
1235
|
+
await connection.initialized;
|
|
1236
|
+
try {
|
|
1237
|
+
await connection.client.notify("_vendor/acme/event", {
|
|
1238
|
+
value: "initialized notification",
|
|
1239
|
+
});
|
|
1240
|
+
notificationSent.resolve();
|
|
1241
|
+
}
|
|
1242
|
+
catch (error) {
|
|
1243
|
+
notificationSent.reject(error);
|
|
1244
|
+
throw error;
|
|
1245
|
+
}
|
|
1246
|
+
})
|
|
1247
|
+
.onRequest(methods.agent.initialize, () => ({
|
|
1248
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1249
|
+
info: agentInfo,
|
|
1250
|
+
}));
|
|
1251
|
+
await clientApp.connectWith(agentApp, async (agentContext) => {
|
|
1252
|
+
const wrongDirection = methods.client.mcp.disconnect;
|
|
1253
|
+
expect(() => agentContext.request(wrongDirection, { connectionId: "connection-1" })).toThrow("not valid in this direction");
|
|
1254
|
+
expect(() => agentContext.batch([
|
|
1255
|
+
{
|
|
1256
|
+
kind: "request",
|
|
1257
|
+
method: wrongDirection,
|
|
1258
|
+
params: { connectionId: "connection-1" },
|
|
1259
|
+
},
|
|
1260
|
+
])).toThrow("not valid in this direction");
|
|
1261
|
+
await agentContext.request(methods.agent.initialize, {
|
|
1262
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1263
|
+
info: clientInfo,
|
|
1264
|
+
});
|
|
1265
|
+
await notificationSent.promise;
|
|
1266
|
+
expect(initializedNotificationValue).toBe("initialized notification");
|
|
1267
|
+
await expect(agentContext.request("session/load", { value: "legacy response" })).resolves.toEqual({ value: "legacy response" });
|
|
1268
|
+
expect(clientNotificationValue).toBe("legacy response");
|
|
1269
|
+
await agentContext.notify("session/set_model", {
|
|
1270
|
+
value: "direct notification",
|
|
1271
|
+
});
|
|
1272
|
+
expect(agentNotificationValue).toBe("direct notification");
|
|
1273
|
+
const [batchResponse] = await agentContext.batch([
|
|
1274
|
+
batchRequest("session/load", { value: "batch response" }),
|
|
1275
|
+
batchNotification("session/set_model", {
|
|
1276
|
+
value: "batch notification",
|
|
1277
|
+
}),
|
|
1278
|
+
]);
|
|
1279
|
+
expect(batchResponse).toEqual({ value: "batch response" });
|
|
1280
|
+
expect(agentNotificationValue).toBe("batch notification");
|
|
1281
|
+
await expect(agentContext.request("_vendor/acme/echo", { value: "response" })).resolves.toEqual({ value: "response" });
|
|
1282
|
+
});
|
|
1283
|
+
const dynamicBuiltIn = methods.agent.session.new;
|
|
1284
|
+
expect(() => agent().onRequest(dynamicBuiltIn, parseValue, returnValue)).toThrow("Cannot replace the built-in");
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
//# sourceMappingURL=acp.test.js.map
|