@copilotkit/runtime 1.55.0-next.8 → 1.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/agent/index.cjs +101 -12
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts.map +1 -1
- package/dist/agent/index.d.mts.map +1 -1
- package/dist/agent/index.mjs +102 -13
- package/dist/agent/index.mjs.map +1 -1
- package/dist/lib/runtime/agent-integrations/langgraph/agent.cjs.map +1 -1
- package/dist/lib/runtime/agent-integrations/langgraph/agent.d.cts +4 -841
- package/dist/lib/runtime/agent-integrations/langgraph/agent.d.cts.map +1 -1
- package/dist/lib/runtime/agent-integrations/langgraph/agent.d.mts +4 -841
- package/dist/lib/runtime/agent-integrations/langgraph/agent.d.mts.map +1 -1
- package/dist/lib/runtime/agent-integrations/langgraph/agent.mjs.map +1 -1
- package/dist/lib/runtime/copilot-runtime.cjs +3 -2
- package/dist/lib/runtime/copilot-runtime.cjs.map +1 -1
- package/dist/lib/runtime/copilot-runtime.d.cts +1 -1
- package/dist/lib/runtime/copilot-runtime.d.cts.map +1 -1
- package/dist/lib/runtime/copilot-runtime.d.mts +3 -3
- package/dist/lib/runtime/copilot-runtime.d.mts.map +1 -1
- package/dist/lib/runtime/copilot-runtime.mjs +3 -2
- package/dist/lib/runtime/copilot-runtime.mjs.map +1 -1
- package/dist/package.cjs +70 -47
- package/dist/package.mjs +70 -47
- package/dist/v2/express.cjs +8 -0
- package/dist/v2/express.d.cts +5 -0
- package/dist/v2/express.d.mts +5 -0
- package/dist/v2/express.mjs +5 -0
- package/dist/v2/hono.cjs +9 -0
- package/dist/v2/hono.d.cts +5 -0
- package/dist/v2/hono.d.mts +5 -0
- package/dist/v2/hono.mjs +5 -0
- package/dist/v2/index.cjs +8 -3
- package/dist/v2/index.d.cts +8 -5
- package/dist/v2/index.d.mts +8 -5
- package/dist/v2/index.mjs +5 -4
- package/dist/v2/node.cjs +8 -0
- package/dist/v2/node.d.cts +5 -0
- package/dist/v2/node.d.mts +5 -0
- package/dist/v2/node.mjs +5 -0
- package/dist/v2/runtime/core/fetch-cors.cjs +72 -0
- package/dist/v2/runtime/core/fetch-cors.cjs.map +1 -0
- package/dist/v2/runtime/core/fetch-cors.d.cts +20 -0
- package/dist/v2/runtime/core/fetch-cors.d.cts.map +1 -0
- package/dist/v2/runtime/core/fetch-cors.d.mts +20 -0
- package/dist/v2/runtime/core/fetch-cors.d.mts.map +1 -0
- package/dist/v2/runtime/core/fetch-cors.mjs +70 -0
- package/dist/v2/runtime/core/fetch-cors.mjs.map +1 -0
- package/dist/v2/runtime/core/fetch-handler.cjs +232 -0
- package/dist/v2/runtime/core/fetch-handler.cjs.map +1 -0
- package/dist/v2/runtime/core/fetch-handler.d.cts +40 -0
- package/dist/v2/runtime/core/fetch-handler.d.cts.map +1 -0
- package/dist/v2/runtime/core/fetch-handler.d.mts +40 -0
- package/dist/v2/runtime/core/fetch-handler.d.mts.map +1 -0
- package/dist/v2/runtime/core/fetch-handler.mjs +231 -0
- package/dist/v2/runtime/core/fetch-handler.mjs.map +1 -0
- package/dist/v2/runtime/core/fetch-router.cjs +68 -0
- package/dist/v2/runtime/core/fetch-router.cjs.map +1 -0
- package/dist/v2/runtime/core/fetch-router.mjs +67 -0
- package/dist/v2/runtime/core/fetch-router.mjs.map +1 -0
- package/dist/v2/runtime/core/hooks.cjs +29 -0
- package/dist/v2/runtime/core/hooks.cjs.map +1 -0
- package/dist/v2/runtime/core/hooks.d.cts +78 -0
- package/dist/v2/runtime/core/hooks.d.cts.map +1 -0
- package/dist/v2/runtime/core/hooks.d.mts +78 -0
- package/dist/v2/runtime/core/hooks.d.mts.map +1 -0
- package/dist/v2/runtime/core/hooks.mjs +25 -0
- package/dist/v2/runtime/core/hooks.mjs.map +1 -0
- package/dist/v2/runtime/{middleware-sse-parser.cjs → core/middleware-sse-parser.cjs} +2 -2
- package/dist/v2/runtime/core/middleware-sse-parser.cjs.map +1 -0
- package/dist/v2/runtime/{middleware-sse-parser.d.cts → core/middleware-sse-parser.d.cts} +1 -1
- package/dist/v2/runtime/core/middleware-sse-parser.d.cts.map +1 -0
- package/dist/v2/runtime/{middleware-sse-parser.d.mts → core/middleware-sse-parser.d.mts} +1 -1
- package/dist/v2/runtime/core/middleware-sse-parser.d.mts.map +1 -0
- package/dist/v2/runtime/{middleware-sse-parser.mjs → core/middleware-sse-parser.mjs} +1 -1
- package/dist/v2/runtime/core/middleware-sse-parser.mjs.map +1 -0
- package/dist/v2/runtime/{middleware.cjs → core/middleware.cjs} +2 -2
- package/dist/v2/runtime/core/middleware.cjs.map +1 -0
- package/dist/v2/runtime/{middleware.d.cts → core/middleware.d.cts} +1 -1
- package/dist/v2/runtime/core/middleware.d.cts.map +1 -0
- package/dist/v2/runtime/{middleware.d.mts → core/middleware.d.mts} +1 -1
- package/dist/v2/runtime/core/middleware.d.mts.map +1 -0
- package/dist/v2/runtime/{middleware.mjs → core/middleware.mjs} +1 -1
- package/dist/v2/runtime/core/middleware.mjs.map +1 -0
- package/dist/v2/runtime/{runtime.cjs → core/runtime.cjs} +35 -10
- package/dist/v2/runtime/core/runtime.cjs.map +1 -0
- package/dist/v2/runtime/{runtime.d.cts → core/runtime.d.cts} +41 -7
- package/dist/v2/runtime/core/runtime.d.cts.map +1 -0
- package/dist/v2/runtime/{runtime.d.mts → core/runtime.d.mts} +42 -8
- package/dist/v2/runtime/core/runtime.d.mts.map +1 -0
- package/dist/v2/runtime/{runtime.mjs → core/runtime.mjs} +36 -11
- package/dist/v2/runtime/core/runtime.mjs.map +1 -0
- package/dist/v2/runtime/endpoints/express-fetch-bridge.cjs +83 -0
- package/dist/v2/runtime/endpoints/express-fetch-bridge.cjs.map +1 -0
- package/dist/v2/runtime/endpoints/express-fetch-bridge.mjs +82 -0
- package/dist/v2/runtime/endpoints/express-fetch-bridge.mjs.map +1 -0
- package/dist/v2/runtime/endpoints/express-single.cjs +35 -181
- package/dist/v2/runtime/endpoints/express-single.cjs.map +1 -1
- package/dist/v2/runtime/endpoints/express-single.d.cts +35 -2
- package/dist/v2/runtime/endpoints/express-single.d.cts.map +1 -1
- package/dist/v2/runtime/endpoints/express-single.d.mts +35 -2
- package/dist/v2/runtime/endpoints/express-single.d.mts.map +1 -1
- package/dist/v2/runtime/endpoints/express-single.mjs +35 -178
- package/dist/v2/runtime/endpoints/express-single.mjs.map +1 -1
- package/dist/v2/runtime/endpoints/express.cjs +41 -195
- package/dist/v2/runtime/endpoints/express.cjs.map +1 -1
- package/dist/v2/runtime/endpoints/express.d.cts +26 -4
- package/dist/v2/runtime/endpoints/express.d.cts.map +1 -1
- package/dist/v2/runtime/endpoints/express.d.mts +26 -4
- package/dist/v2/runtime/endpoints/express.d.mts.map +1 -1
- package/dist/v2/runtime/endpoints/express.mjs +41 -195
- package/dist/v2/runtime/endpoints/express.mjs.map +1 -1
- package/dist/v2/runtime/endpoints/hono-single.cjs +11 -123
- package/dist/v2/runtime/endpoints/hono-single.cjs.map +1 -1
- package/dist/v2/runtime/endpoints/hono-single.d.cts +14 -11
- package/dist/v2/runtime/endpoints/hono-single.d.cts.map +1 -1
- package/dist/v2/runtime/endpoints/hono-single.d.mts +14 -11
- package/dist/v2/runtime/endpoints/hono-single.d.mts.map +1 -1
- package/dist/v2/runtime/endpoints/hono-single.mjs +11 -123
- package/dist/v2/runtime/endpoints/hono-single.mjs.map +1 -1
- package/dist/v2/runtime/endpoints/hono.cjs +23 -237
- package/dist/v2/runtime/endpoints/hono.cjs.map +1 -1
- package/dist/v2/runtime/endpoints/hono.d.cts +29 -120
- package/dist/v2/runtime/endpoints/hono.d.cts.map +1 -1
- package/dist/v2/runtime/endpoints/hono.d.mts +29 -120
- package/dist/v2/runtime/endpoints/hono.d.mts.map +1 -1
- package/dist/v2/runtime/endpoints/hono.mjs +22 -238
- package/dist/v2/runtime/endpoints/hono.mjs.map +1 -1
- package/dist/v2/runtime/endpoints/index.d.cts +2 -2
- package/dist/v2/runtime/endpoints/index.d.mts +2 -2
- package/dist/v2/runtime/endpoints/node-fetch-handler.cjs +26 -0
- package/dist/v2/runtime/endpoints/node-fetch-handler.cjs.map +1 -0
- package/dist/v2/runtime/endpoints/node-fetch-handler.d.cts +12 -0
- package/dist/v2/runtime/endpoints/node-fetch-handler.d.cts.map +1 -0
- package/dist/v2/runtime/endpoints/node-fetch-handler.d.mts +12 -0
- package/dist/v2/runtime/endpoints/node-fetch-handler.d.mts.map +1 -0
- package/dist/v2/runtime/endpoints/node-fetch-handler.mjs +24 -0
- package/dist/v2/runtime/endpoints/node-fetch-handler.mjs.map +1 -0
- package/dist/v2/runtime/endpoints/node.cjs +30 -0
- package/dist/v2/runtime/endpoints/node.cjs.map +1 -0
- package/dist/v2/runtime/endpoints/node.d.cts +27 -0
- package/dist/v2/runtime/endpoints/node.d.cts.map +1 -0
- package/dist/v2/runtime/endpoints/node.d.mts +27 -0
- package/dist/v2/runtime/endpoints/node.d.mts.map +1 -0
- package/dist/v2/runtime/endpoints/node.mjs +30 -0
- package/dist/v2/runtime/endpoints/node.mjs.map +1 -0
- package/dist/v2/runtime/express.d.cts +3 -0
- package/dist/v2/runtime/express.d.mts +3 -0
- package/dist/v2/runtime/handlers/get-runtime-info.cjs +2 -1
- package/dist/v2/runtime/handlers/get-runtime-info.cjs.map +1 -1
- package/dist/v2/runtime/handlers/get-runtime-info.mjs +2 -1
- package/dist/v2/runtime/handlers/get-runtime-info.mjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-connect.cjs +6 -3
- package/dist/v2/runtime/handlers/handle-connect.cjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-connect.mjs +6 -3
- package/dist/v2/runtime/handlers/handle-connect.mjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-run.cjs +6 -3
- package/dist/v2/runtime/handlers/handle-run.cjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-run.mjs +6 -3
- package/dist/v2/runtime/handlers/handle-run.mjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-stop.cjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-stop.mjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-transcribe.cjs.map +1 -1
- package/dist/v2/runtime/handlers/handle-transcribe.mjs.map +1 -1
- package/dist/v2/runtime/handlers/intelligence/connect.cjs.map +1 -1
- package/dist/v2/runtime/handlers/intelligence/connect.mjs.map +1 -1
- package/dist/v2/runtime/handlers/intelligence/run.cjs +22 -1
- package/dist/v2/runtime/handlers/intelligence/run.cjs.map +1 -1
- package/dist/v2/runtime/handlers/intelligence/run.mjs +22 -1
- package/dist/v2/runtime/handlers/intelligence/run.mjs.map +1 -1
- package/dist/v2/runtime/handlers/intelligence/thread-names.cjs +1 -1
- package/dist/v2/runtime/handlers/intelligence/thread-names.cjs.map +1 -1
- package/dist/v2/runtime/handlers/intelligence/thread-names.mjs +1 -1
- package/dist/v2/runtime/handlers/intelligence/thread-names.mjs.map +1 -1
- package/dist/v2/runtime/handlers/shared/agent-utils.cjs +21 -6
- package/dist/v2/runtime/handlers/shared/agent-utils.cjs.map +1 -1
- package/dist/v2/runtime/handlers/shared/agent-utils.mjs +21 -6
- package/dist/v2/runtime/handlers/shared/agent-utils.mjs.map +1 -1
- package/dist/v2/runtime/handlers/shared/json-response.cjs +4 -1
- package/dist/v2/runtime/handlers/shared/json-response.cjs.map +1 -1
- package/dist/v2/runtime/handlers/shared/json-response.mjs +4 -1
- package/dist/v2/runtime/handlers/shared/json-response.mjs.map +1 -1
- package/dist/v2/runtime/handlers/shared/resolve-intelligence-user.cjs.map +1 -1
- package/dist/v2/runtime/handlers/shared/resolve-intelligence-user.mjs.map +1 -1
- package/dist/v2/runtime/handlers/sse/connect.cjs.map +1 -1
- package/dist/v2/runtime/handlers/sse/connect.mjs.map +1 -1
- package/dist/v2/runtime/handlers/sse/run.cjs.map +1 -1
- package/dist/v2/runtime/handlers/sse/run.mjs.map +1 -1
- package/dist/v2/runtime/hono.d.cts +3 -0
- package/dist/v2/runtime/hono.d.mts +3 -0
- package/dist/v2/runtime/index.d.cts +16 -4
- package/dist/v2/runtime/index.d.cts.map +1 -0
- package/dist/v2/runtime/index.d.mts +16 -4
- package/dist/v2/runtime/index.d.mts.map +1 -0
- package/dist/v2/runtime/intelligence-platform/client.cjs +10 -1
- package/dist/v2/runtime/intelligence-platform/client.cjs.map +1 -1
- package/dist/v2/runtime/intelligence-platform/client.d.cts +22 -0
- package/dist/v2/runtime/intelligence-platform/client.d.cts.map +1 -1
- package/dist/v2/runtime/intelligence-platform/client.d.mts +22 -0
- package/dist/v2/runtime/intelligence-platform/client.d.mts.map +1 -1
- package/dist/v2/runtime/intelligence-platform/client.mjs +10 -1
- package/dist/v2/runtime/intelligence-platform/client.mjs.map +1 -1
- package/dist/v2/runtime/node.d.cts +3 -0
- package/dist/v2/runtime/node.d.mts +3 -0
- package/dist/v2/runtime/open-generative-ui-middleware.cjs +282 -0
- package/dist/v2/runtime/open-generative-ui-middleware.cjs.map +1 -0
- package/dist/v2/runtime/open-generative-ui-middleware.mjs +280 -0
- package/dist/v2/runtime/open-generative-ui-middleware.mjs.map +1 -0
- package/dist/v2/runtime/runner/intelligence.cjs +4 -4
- package/dist/v2/runtime/runner/intelligence.cjs.map +1 -1
- package/dist/v2/runtime/runner/intelligence.d.cts +6 -2
- package/dist/v2/runtime/runner/intelligence.d.cts.map +1 -1
- package/dist/v2/runtime/runner/intelligence.d.mts +6 -2
- package/dist/v2/runtime/runner/intelligence.d.mts.map +1 -1
- package/dist/v2/runtime/runner/intelligence.mjs +4 -4
- package/dist/v2/runtime/runner/intelligence.mjs.map +1 -1
- package/dist/v2/runtime/telemetry/telemetry-client.cjs +37 -0
- package/dist/v2/runtime/telemetry/telemetry-client.cjs.map +1 -1
- package/dist/v2/runtime/telemetry/telemetry-client.mjs +36 -0
- package/dist/v2/runtime/telemetry/telemetry-client.mjs.map +1 -1
- package/dist/v2/runtime/telemetry/utils.cjs +15 -0
- package/dist/v2/runtime/telemetry/utils.cjs.map +1 -0
- package/dist/v2/runtime/telemetry/utils.mjs +14 -0
- package/dist/v2/runtime/telemetry/utils.mjs.map +1 -0
- package/package.json +81 -48
- package/src/agent/__tests__/multimodal.test.ts +176 -0
- package/src/agent/index.ts +130 -19
- package/src/lib/runtime/agent-integrations/langgraph/agent.ts +3 -3
- package/src/lib/runtime/copilot-runtime.ts +1 -0
- package/src/v2/express.ts +1 -0
- package/src/v2/hono.ts +1 -0
- package/src/v2/node.ts +1 -0
- package/src/v2/runtime/__tests__/backward-compat.test.ts +261 -0
- package/src/v2/runtime/__tests__/code-review-fixes.test.ts +500 -0
- package/src/v2/runtime/__tests__/cors-credentials.test.ts +2 -2
- package/src/v2/runtime/__tests__/express-adapter.test.ts +188 -0
- package/src/v2/runtime/__tests__/express-body-order.test.ts +1 -1
- package/src/v2/runtime/__tests__/express-fetch-bridge.test.ts +344 -0
- package/src/v2/runtime/__tests__/express-single-sse.test.ts +1 -1
- package/src/v2/runtime/__tests__/fetch-cors.test.ts +205 -0
- package/src/v2/runtime/__tests__/fetch-handler-validation.test.ts +372 -0
- package/src/v2/runtime/__tests__/fetch-handler.test.ts +456 -0
- package/src/v2/runtime/__tests__/fetch-router.test.ts +132 -0
- package/src/v2/runtime/__tests__/get-runtime-info.test.ts +4 -1
- package/src/v2/runtime/__tests__/handle-connect.test.ts +15 -13
- package/src/v2/runtime/__tests__/handle-run.test.ts +21 -17
- package/src/v2/runtime/__tests__/handle-threads.test.ts +1 -1
- package/src/v2/runtime/__tests__/handle-transcribe.test.ts +1 -1
- package/src/v2/runtime/__tests__/hono-adapter.test.ts +150 -0
- package/src/v2/runtime/__tests__/hooks-edge-cases.test.ts +457 -0
- package/src/v2/runtime/__tests__/hooks.test.ts +557 -0
- package/src/v2/runtime/__tests__/integration/bun/bun-servers.integration.test.ts +27 -0
- package/src/v2/runtime/__tests__/integration/bun/elysia-multi.ts +32 -0
- package/src/v2/runtime/__tests__/integration/bun/elysia-single.ts +33 -0
- package/src/v2/runtime/__tests__/integration/bun/hono-bun-multi.ts +25 -0
- package/src/v2/runtime/__tests__/integration/bun/hono-bun-single.ts +32 -0
- package/src/v2/runtime/__tests__/integration/helpers/create-test-runtime.ts +15 -0
- package/src/v2/runtime/__tests__/integration/helpers/sse-reader.ts +45 -0
- package/src/v2/runtime/__tests__/integration/helpers/test-agent.ts +58 -0
- package/src/v2/runtime/__tests__/integration/node-servers.integration.test.ts +39 -0
- package/src/v2/runtime/__tests__/integration/servers/express-multi.ts +35 -0
- package/src/v2/runtime/__tests__/integration/servers/express-single.ts +36 -0
- package/src/v2/runtime/__tests__/integration/servers/fetch-direct.ts +39 -0
- package/src/v2/runtime/__tests__/integration/servers/hono-multi.ts +30 -0
- package/src/v2/runtime/__tests__/integration/servers/hono-single.ts +37 -0
- package/src/v2/runtime/__tests__/integration/servers/node-multi.ts +45 -0
- package/src/v2/runtime/__tests__/integration/servers/node-single.ts +46 -0
- package/src/v2/runtime/__tests__/integration/servers/types.ts +18 -0
- package/src/v2/runtime/__tests__/integration/suites/multi-endpoint.suite.ts +358 -0
- package/src/v2/runtime/__tests__/integration/suites/single-endpoint.suite.ts +363 -0
- package/src/v2/runtime/__tests__/middleware-express.test.ts +25 -23
- package/src/v2/runtime/__tests__/middleware-single-express.test.ts +25 -23
- package/src/v2/runtime/__tests__/middleware-single.test.ts +1 -1
- package/src/v2/runtime/__tests__/middleware-sse-parser.test.ts +1 -1
- package/src/v2/runtime/__tests__/middleware.test.ts +1 -2
- package/src/v2/runtime/__tests__/node-fetch-handler.test.ts +157 -0
- package/src/v2/runtime/__tests__/open-generative-ui-middleware.e2e.test.ts +728 -0
- package/src/v2/runtime/__tests__/router-edge-cases.test.ts +217 -0
- package/src/v2/runtime/__tests__/routing-express.test.ts +1 -1
- package/src/v2/runtime/__tests__/routing-single-express.test.ts +1 -1
- package/src/v2/runtime/__tests__/routing-single.test.ts +1 -1
- package/src/v2/runtime/__tests__/routing.test.ts +1 -1
- package/src/v2/runtime/__tests__/runtime.test.ts +110 -1
- package/src/v2/runtime/__tests__/telemetry.test.ts +62 -1
- package/src/v2/runtime/core/fetch-cors.ts +136 -0
- package/src/v2/runtime/core/fetch-handler.ts +415 -0
- package/src/v2/runtime/core/fetch-router.ts +112 -0
- package/src/v2/runtime/core/hooks.ts +151 -0
- package/src/v2/runtime/{runtime.ts → core/runtime.ts} +79 -10
- package/src/v2/runtime/endpoints/express-fetch-bridge.ts +137 -0
- package/src/v2/runtime/endpoints/express-single.ts +42 -219
- package/src/v2/runtime/endpoints/express.ts +128 -230
- package/src/v2/runtime/endpoints/hono-single.ts +19 -171
- package/src/v2/runtime/endpoints/hono.ts +45 -270
- package/src/v2/runtime/endpoints/node-fetch-handler.ts +48 -0
- package/src/v2/runtime/endpoints/node.ts +28 -0
- package/src/v2/runtime/handlers/get-runtime-info.ts +3 -2
- package/src/v2/runtime/handlers/handle-connect.ts +7 -4
- package/src/v2/runtime/handlers/handle-run.ts +7 -4
- package/src/v2/runtime/handlers/handle-stop.ts +1 -1
- package/src/v2/runtime/handlers/handle-transcribe.ts +1 -1
- package/src/v2/runtime/handlers/intelligence/connect.ts +1 -1
- package/src/v2/runtime/handlers/intelligence/run.ts +31 -1
- package/src/v2/runtime/handlers/intelligence/thread-names.ts +2 -2
- package/src/v2/runtime/handlers/intelligence/threads.ts +1 -1
- package/src/v2/runtime/handlers/shared/agent-utils.ts +29 -10
- package/src/v2/runtime/handlers/shared/json-response.ts +4 -1
- package/src/v2/runtime/handlers/shared/resolve-intelligence-user.ts +1 -1
- package/src/v2/runtime/handlers/sse/connect.ts +1 -1
- package/src/v2/runtime/handlers/sse/run.ts +1 -1
- package/src/v2/runtime/hono.ts +2 -0
- package/src/v2/runtime/index.ts +27 -1
- package/src/v2/runtime/intelligence-platform/client.ts +50 -1
- package/src/v2/runtime/node.ts +6 -0
- package/src/v2/runtime/open-generative-ui-middleware.ts +373 -0
- package/src/v2/runtime/runner/intelligence.ts +14 -4
- package/src/v2/runtime/telemetry/telemetry-client.ts +56 -0
- package/src/v2/runtime/telemetry/utils.ts +15 -0
- package/tsdown.config.ts +8 -1
- package/vitest.config.mjs +2 -5
- package/.eslintrc.js +0 -7
- package/dist/v2/runtime/endpoints/express-utils.cjs +0 -119
- package/dist/v2/runtime/endpoints/express-utils.cjs.map +0 -1
- package/dist/v2/runtime/endpoints/express-utils.mjs +0 -117
- package/dist/v2/runtime/endpoints/express-utils.mjs.map +0 -1
- package/dist/v2/runtime/handlers/intelligence/threads.cjs +0 -159
- package/dist/v2/runtime/handlers/intelligence/threads.cjs.map +0 -1
- package/dist/v2/runtime/handlers/intelligence/threads.mjs +0 -154
- package/dist/v2/runtime/handlers/intelligence/threads.mjs.map +0 -1
- package/dist/v2/runtime/middleware-sse-parser.cjs.map +0 -1
- package/dist/v2/runtime/middleware-sse-parser.d.cts.map +0 -1
- package/dist/v2/runtime/middleware-sse-parser.d.mts.map +0 -1
- package/dist/v2/runtime/middleware-sse-parser.mjs.map +0 -1
- package/dist/v2/runtime/middleware.cjs.map +0 -1
- package/dist/v2/runtime/middleware.d.cts.map +0 -1
- package/dist/v2/runtime/middleware.d.mts.map +0 -1
- package/dist/v2/runtime/middleware.mjs.map +0 -1
- package/dist/v2/runtime/runtime.cjs.map +0 -1
- package/dist/v2/runtime/runtime.d.cts.map +0 -1
- package/dist/v2/runtime/runtime.d.mts.map +0 -1
- package/dist/v2/runtime/runtime.mjs.map +0 -1
- package/src/v2/runtime/__tests__/express-abort-signal.test.ts +0 -25
- package/src/v2/runtime/endpoints/express-utils.ts +0 -182
- package/src/v2/runtime/handler.ts +0 -3
- /package/src/v2/runtime/{middleware-sse-parser.ts → core/middleware-sse-parser.ts} +0 -0
- /package/src/v2/runtime/{middleware.ts → core/middleware.ts} +0 -0
|
@@ -2,10 +2,9 @@ import { Observable } from "rxjs";
|
|
|
2
2
|
import { describe, it, expect, vi } from "vitest";
|
|
3
3
|
import { BaseEvent } from "@ag-ui/client";
|
|
4
4
|
import { handleConnectAgent } from "../handlers/handle-connect";
|
|
5
|
-
import { CopilotRuntime } from "../runtime";
|
|
5
|
+
import { CopilotRuntime } from "../core/runtime";
|
|
6
6
|
import { AgentRunnerConnectRequest } from "../runner/agent-runner";
|
|
7
7
|
import { IntelligenceAgentRunner } from "../runner/intelligence";
|
|
8
|
-
import { CopilotKitIntelligence } from "../intelligence-platform/client";
|
|
9
8
|
|
|
10
9
|
describe("handleConnectAgent", () => {
|
|
11
10
|
const createMockRuntime = (
|
|
@@ -207,9 +206,12 @@ describe("handleConnectAgent", () => {
|
|
|
207
206
|
}),
|
|
208
207
|
});
|
|
209
208
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
/** Loose mock type for CopilotKitIntelligence — avoids `as any` while the class has private fields. */
|
|
210
|
+
interface MockIntelligencePlatform {
|
|
211
|
+
[key: string]: ((...args: any[]) => any) | undefined;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const createIntelligenceRuntime = (platform?: MockIntelligencePlatform) => {
|
|
213
215
|
const runner = Object.create(IntelligenceAgentRunner.prototype);
|
|
214
216
|
runner.connect = vi.fn(
|
|
215
217
|
() =>
|
|
@@ -240,7 +242,7 @@ describe("handleConnectAgent", () => {
|
|
|
240
242
|
events: [],
|
|
241
243
|
}),
|
|
242
244
|
};
|
|
243
|
-
const runtime = createIntelligenceRuntime(platform
|
|
245
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
244
246
|
|
|
245
247
|
const response = await handleConnectAgent({
|
|
246
248
|
runtime,
|
|
@@ -272,7 +274,7 @@ describe("handleConnectAgent", () => {
|
|
|
272
274
|
events: [{ type: "MESSAGES_SNAPSHOT", messages: [] }],
|
|
273
275
|
}),
|
|
274
276
|
};
|
|
275
|
-
const runtime = createIntelligenceRuntime(platform
|
|
277
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
276
278
|
|
|
277
279
|
const response = await handleConnectAgent({
|
|
278
280
|
runtime,
|
|
@@ -294,7 +296,7 @@ describe("handleConnectAgent", () => {
|
|
|
294
296
|
ɵconnectThread: vi.fn().mockResolvedValue(null),
|
|
295
297
|
createThread: vi.fn(),
|
|
296
298
|
};
|
|
297
|
-
const runtime = createIntelligenceRuntime(platform
|
|
299
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
298
300
|
|
|
299
301
|
const response = await handleConnectAgent({
|
|
300
302
|
runtime,
|
|
@@ -318,7 +320,7 @@ describe("handleConnectAgent", () => {
|
|
|
318
320
|
.fn()
|
|
319
321
|
.mockRejectedValue(new Error("No active connect plan")),
|
|
320
322
|
};
|
|
321
|
-
const runtime = createIntelligenceRuntime(platform
|
|
323
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
322
324
|
|
|
323
325
|
const response = await handleConnectAgent({
|
|
324
326
|
runtime,
|
|
@@ -335,7 +337,7 @@ describe("handleConnectAgent", () => {
|
|
|
335
337
|
const platform = {
|
|
336
338
|
ɵconnectThread: vi.fn().mockResolvedValue(null),
|
|
337
339
|
};
|
|
338
|
-
const runtime = createIntelligenceRuntime(platform
|
|
340
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
339
341
|
|
|
340
342
|
const response = await handleConnectAgent({
|
|
341
343
|
runtime,
|
|
@@ -356,7 +358,7 @@ describe("handleConnectAgent", () => {
|
|
|
356
358
|
ɵconnectThread: vi.fn().mockResolvedValue(null),
|
|
357
359
|
};
|
|
358
360
|
const identifyUser = vi.fn().mockResolvedValue({ id: "resolved-user" });
|
|
359
|
-
const runtime = createIntelligenceRuntime(platform
|
|
361
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
360
362
|
runtime.identifyUser = identifyUser;
|
|
361
363
|
const request = createConnectRequest(
|
|
362
364
|
{ "X-User-Id": "legacy-user" },
|
|
@@ -383,7 +385,7 @@ describe("handleConnectAgent", () => {
|
|
|
383
385
|
const platform = {
|
|
384
386
|
ɵconnectThread: vi.fn(),
|
|
385
387
|
};
|
|
386
|
-
const runtime = createIntelligenceRuntime(platform
|
|
388
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
387
389
|
runtime.identifyUser = vi.fn().mockResolvedValue({ id: "" });
|
|
388
390
|
|
|
389
391
|
const response = await handleConnectAgent({
|
|
@@ -400,7 +402,7 @@ describe("handleConnectAgent", () => {
|
|
|
400
402
|
const platform = {
|
|
401
403
|
ɵconnectThread: vi.fn(),
|
|
402
404
|
};
|
|
403
|
-
const runtime = createIntelligenceRuntime(platform
|
|
405
|
+
const runtime = createIntelligenceRuntime(platform);
|
|
404
406
|
runtime.identifyUser = vi
|
|
405
407
|
.fn()
|
|
406
408
|
.mockRejectedValue(new Error("auth failed"));
|
|
@@ -3,9 +3,8 @@ import { describe, it, expect, vi } from "vitest";
|
|
|
3
3
|
import { AbstractAgent, HttpAgent } from "@ag-ui/client";
|
|
4
4
|
import { A2UIMiddleware } from "@ag-ui/a2ui-middleware";
|
|
5
5
|
import { handleRunAgent } from "../handlers/handle-run";
|
|
6
|
-
import { CopilotRuntime } from "../runtime";
|
|
6
|
+
import { CopilotRuntime } from "../core/runtime";
|
|
7
7
|
import { IntelligenceAgentRunner } from "../runner/intelligence";
|
|
8
|
-
import { CopilotKitIntelligence } from "../intelligence-platform/client";
|
|
9
8
|
|
|
10
9
|
describe("handleRunAgent", () => {
|
|
11
10
|
const createMockRuntime = (
|
|
@@ -287,9 +286,14 @@ describe("handleRunAgent", () => {
|
|
|
287
286
|
});
|
|
288
287
|
|
|
289
288
|
describe("IntelligenceAgentRunner join code path", () => {
|
|
289
|
+
/** Loose mock type for CopilotKitIntelligence — avoids `as any` while the class has private fields. */
|
|
290
|
+
interface MockIntelligencePlatform {
|
|
291
|
+
[key: string]: ((...args: any[]) => any) | undefined;
|
|
292
|
+
}
|
|
293
|
+
|
|
290
294
|
const createIntelligenceRuntime = (
|
|
291
295
|
agent: AbstractAgent,
|
|
292
|
-
platform?:
|
|
296
|
+
platform?: MockIntelligencePlatform,
|
|
293
297
|
options?: {
|
|
294
298
|
generateThreadNames?: boolean;
|
|
295
299
|
identifyUser?: (
|
|
@@ -352,7 +356,7 @@ describe("handleRunAgent", () => {
|
|
|
352
356
|
.fn()
|
|
353
357
|
.mockResolvedValue({ joinToken: "jt-123", joinCode: "jc-123" }),
|
|
354
358
|
};
|
|
355
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
359
|
+
const runtime = createIntelligenceRuntime(agent, platform);
|
|
356
360
|
|
|
357
361
|
const response = await handleRunAgent({
|
|
358
362
|
runtime,
|
|
@@ -392,7 +396,7 @@ describe("handleRunAgent", () => {
|
|
|
392
396
|
.mockResolvedValue({ joinToken: "jt-123", joinCode: "jc-123" }),
|
|
393
397
|
};
|
|
394
398
|
const identifyUser = vi.fn().mockResolvedValue({ id: "resolved-user" });
|
|
395
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
399
|
+
const runtime = createIntelligenceRuntime(agent, platform, {
|
|
396
400
|
identifyUser,
|
|
397
401
|
});
|
|
398
402
|
const request = createRunRequest({ "X-User-Id": "legacy-user" });
|
|
@@ -430,7 +434,7 @@ describe("handleRunAgent", () => {
|
|
|
430
434
|
.fn()
|
|
431
435
|
.mockResolvedValue({ joinToken: "jt-456", joinCode: "jc-456" }),
|
|
432
436
|
};
|
|
433
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
437
|
+
const runtime = createIntelligenceRuntime(agent, platform);
|
|
434
438
|
|
|
435
439
|
await handleRunAgent({
|
|
436
440
|
runtime,
|
|
@@ -453,7 +457,7 @@ describe("handleRunAgent", () => {
|
|
|
453
457
|
getThreadMessages: vi.fn().mockResolvedValue({ messages: [] }),
|
|
454
458
|
ɵacquireThreadLock: vi.fn().mockResolvedValue({ joinCode: "jc-789" }),
|
|
455
459
|
};
|
|
456
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
460
|
+
const runtime = createIntelligenceRuntime(agent, platform);
|
|
457
461
|
|
|
458
462
|
const response = await handleRunAgent({
|
|
459
463
|
runtime,
|
|
@@ -479,7 +483,7 @@ describe("handleRunAgent", () => {
|
|
|
479
483
|
.fn()
|
|
480
484
|
.mockRejectedValue(new Error("Thread is locked by another runner")),
|
|
481
485
|
};
|
|
482
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
486
|
+
const runtime = createIntelligenceRuntime(agent, platform);
|
|
483
487
|
|
|
484
488
|
const response = await handleRunAgent({
|
|
485
489
|
runtime,
|
|
@@ -512,7 +516,7 @@ describe("handleRunAgent", () => {
|
|
|
512
516
|
.fn()
|
|
513
517
|
.mockResolvedValue({ joinToken: "jt-123", joinCode: "jc-123" }),
|
|
514
518
|
};
|
|
515
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
519
|
+
const runtime = createIntelligenceRuntime(agent, platform);
|
|
516
520
|
const response = await handleRunAgent({
|
|
517
521
|
runtime,
|
|
518
522
|
request: new Request("https://example.com/agent/my-agent/run", {
|
|
@@ -572,7 +576,7 @@ describe("handleRunAgent", () => {
|
|
|
572
576
|
.fn()
|
|
573
577
|
.mockResolvedValue({ joinToken: "jt-123", joinCode: "jc-123" }),
|
|
574
578
|
};
|
|
575
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
579
|
+
const runtime = createIntelligenceRuntime(agent, platform);
|
|
576
580
|
|
|
577
581
|
const response = await handleRunAgent({
|
|
578
582
|
runtime,
|
|
@@ -599,7 +603,7 @@ describe("handleRunAgent", () => {
|
|
|
599
603
|
joinCode: "jc-created",
|
|
600
604
|
}),
|
|
601
605
|
};
|
|
602
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
606
|
+
const runtime = createIntelligenceRuntime(agent, platform);
|
|
603
607
|
|
|
604
608
|
const response = await handleRunAgent({
|
|
605
609
|
runtime,
|
|
@@ -670,7 +674,7 @@ describe("handleRunAgent", () => {
|
|
|
670
674
|
joinCode: "jc-created",
|
|
671
675
|
}),
|
|
672
676
|
};
|
|
673
|
-
const runtime = createIntelligenceRuntime(baseAgent, platform
|
|
677
|
+
const runtime = createIntelligenceRuntime(baseAgent, platform, {
|
|
674
678
|
generateThreadNames: true,
|
|
675
679
|
});
|
|
676
680
|
const response = await handleRunAgent({
|
|
@@ -725,7 +729,7 @@ describe("handleRunAgent", () => {
|
|
|
725
729
|
joinCode: "jc-created",
|
|
726
730
|
}),
|
|
727
731
|
};
|
|
728
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
732
|
+
const runtime = createIntelligenceRuntime(agent, platform, {
|
|
729
733
|
generateThreadNames: false,
|
|
730
734
|
});
|
|
731
735
|
|
|
@@ -754,7 +758,7 @@ describe("handleRunAgent", () => {
|
|
|
754
758
|
joinCode: "jc-created",
|
|
755
759
|
}),
|
|
756
760
|
};
|
|
757
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
761
|
+
const runtime = createIntelligenceRuntime(agent, platform, {
|
|
758
762
|
generateThreadNames: true,
|
|
759
763
|
});
|
|
760
764
|
|
|
@@ -810,7 +814,7 @@ describe("handleRunAgent", () => {
|
|
|
810
814
|
joinCode: "jc-created",
|
|
811
815
|
}),
|
|
812
816
|
};
|
|
813
|
-
const runtime = createIntelligenceRuntime(baseAgent, platform
|
|
817
|
+
const runtime = createIntelligenceRuntime(baseAgent, platform, {
|
|
814
818
|
generateThreadNames: true,
|
|
815
819
|
});
|
|
816
820
|
const errorSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
|
@@ -865,7 +869,7 @@ describe("handleRunAgent", () => {
|
|
|
865
869
|
getThreadMessages: vi.fn(),
|
|
866
870
|
ɵacquireThreadLock: vi.fn(),
|
|
867
871
|
};
|
|
868
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
872
|
+
const runtime = createIntelligenceRuntime(agent, platform, {
|
|
869
873
|
identifyUser: vi.fn().mockResolvedValue({ id: "" }),
|
|
870
874
|
});
|
|
871
875
|
|
|
@@ -887,7 +891,7 @@ describe("handleRunAgent", () => {
|
|
|
887
891
|
getThreadMessages: vi.fn(),
|
|
888
892
|
ɵacquireThreadLock: vi.fn(),
|
|
889
893
|
};
|
|
890
|
-
const runtime = createIntelligenceRuntime(agent, platform
|
|
894
|
+
const runtime = createIntelligenceRuntime(agent, platform, {
|
|
891
895
|
identifyUser: vi.fn().mockRejectedValue(new Error("auth failed")),
|
|
892
896
|
});
|
|
893
897
|
const errorSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
handleSubscribeToThreads,
|
|
8
8
|
handleUpdateThread,
|
|
9
9
|
} from "../handlers/handle-threads";
|
|
10
|
-
import { CopilotRuntime } from "../runtime";
|
|
10
|
+
import { CopilotRuntime } from "../core/runtime";
|
|
11
11
|
|
|
12
12
|
describe("thread handlers", () => {
|
|
13
13
|
const createIdentifyUser = () => vi.fn().mockResolvedValue({ id: "user-1" });
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from "vitest";
|
|
2
|
+
import type { AbstractAgent } from "@ag-ui/client";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
createCopilotEndpoint,
|
|
6
|
+
createCopilotEndpointSingleRoute,
|
|
7
|
+
} from "../endpoints";
|
|
8
|
+
import { CopilotRuntime } from "../core/runtime";
|
|
9
|
+
|
|
10
|
+
describe("Hono adapter with hooks", () => {
|
|
11
|
+
const createMockAgent = () => {
|
|
12
|
+
const agent: unknown = {
|
|
13
|
+
execute: async () => ({ events: [] }),
|
|
14
|
+
};
|
|
15
|
+
(agent as { clone: () => unknown }).clone = () => createMockAgent();
|
|
16
|
+
return agent as AbstractAgent;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const createMockRuntime = (opts?: Partial<CopilotRuntime>) =>
|
|
20
|
+
new CopilotRuntime({
|
|
21
|
+
agents: {
|
|
22
|
+
default: createMockAgent(),
|
|
23
|
+
myAgent: createMockAgent(),
|
|
24
|
+
testAgent: createMockAgent(),
|
|
25
|
+
},
|
|
26
|
+
...opts,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("createCopilotEndpoint", () => {
|
|
30
|
+
const createEndpoint = (
|
|
31
|
+
hooks?: Parameters<typeof createCopilotEndpoint>[0]["hooks"],
|
|
32
|
+
runtimeOpts?: Partial<CopilotRuntime>,
|
|
33
|
+
) => {
|
|
34
|
+
const runtime = createMockRuntime(runtimeOpts);
|
|
35
|
+
const endpoint = createCopilotEndpoint({
|
|
36
|
+
runtime,
|
|
37
|
+
basePath: "/",
|
|
38
|
+
hooks,
|
|
39
|
+
});
|
|
40
|
+
return { endpoint, runtime };
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
it("routes GET /info correctly", async () => {
|
|
44
|
+
const { endpoint } = createEndpoint();
|
|
45
|
+
const response = await endpoint.fetch(
|
|
46
|
+
new Request("https://example.com/info"),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
expect(response.status).toBe(200);
|
|
50
|
+
const body = await response.json();
|
|
51
|
+
expect(body).toHaveProperty("version");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("routes POST /agent/:id/run correctly", async () => {
|
|
55
|
+
const { endpoint } = createEndpoint();
|
|
56
|
+
const response = await endpoint.fetch(
|
|
57
|
+
new Request("https://example.com/agent/myAgent/run", {
|
|
58
|
+
method: "POST",
|
|
59
|
+
headers: { "Content-Type": "application/json" },
|
|
60
|
+
body: JSON.stringify({
|
|
61
|
+
messages: [],
|
|
62
|
+
state: {},
|
|
63
|
+
threadId: "thread-1",
|
|
64
|
+
}),
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
expect(response.status).not.toBe(404);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("forwards hooks — onRequest hook is called", async () => {
|
|
72
|
+
const onRequest = vi.fn();
|
|
73
|
+
const { endpoint, runtime } = createEndpoint({ onRequest });
|
|
74
|
+
|
|
75
|
+
await endpoint.fetch(new Request("https://example.com/info"));
|
|
76
|
+
|
|
77
|
+
expect(onRequest).toHaveBeenCalledTimes(1);
|
|
78
|
+
expect(onRequest).toHaveBeenCalledWith(
|
|
79
|
+
expect.objectContaining({
|
|
80
|
+
request: expect.any(Request),
|
|
81
|
+
path: expect.stringContaining("/info"),
|
|
82
|
+
runtime,
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("hooks can modify response headers via onResponse", async () => {
|
|
88
|
+
const { endpoint } = createEndpoint({
|
|
89
|
+
onResponse: ({ response }) => {
|
|
90
|
+
const headers = new Headers(response.headers);
|
|
91
|
+
headers.set("x-custom-header", "hello-from-hook");
|
|
92
|
+
return new Response(response.body, {
|
|
93
|
+
status: response.status,
|
|
94
|
+
headers,
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const response = await endpoint.fetch(
|
|
100
|
+
new Request("https://example.com/info"),
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
expect(response.status).toBe(200);
|
|
104
|
+
expect(response.headers.get("x-custom-header")).toBe("hello-from-hook");
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("Hono CORS headers are present", async () => {
|
|
108
|
+
const { endpoint } = createEndpoint();
|
|
109
|
+
const response = await endpoint.fetch(
|
|
110
|
+
new Request("https://example.com/info", {
|
|
111
|
+
method: "OPTIONS",
|
|
112
|
+
headers: {
|
|
113
|
+
Origin: "https://somesite.com",
|
|
114
|
+
"Access-Control-Request-Method": "GET",
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
expect(response.headers.get("Access-Control-Allow-Origin")).toBe("*");
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
describe("createCopilotEndpointSingleRoute", () => {
|
|
124
|
+
it("dispatches single-route with method envelope", async () => {
|
|
125
|
+
const runtime = createMockRuntime();
|
|
126
|
+
const endpoint = createCopilotEndpointSingleRoute({
|
|
127
|
+
runtime,
|
|
128
|
+
basePath: "/rpc",
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const response = await endpoint.fetch(
|
|
132
|
+
new Request("https://example.com/rpc", {
|
|
133
|
+
method: "POST",
|
|
134
|
+
headers: { "Content-Type": "application/json" },
|
|
135
|
+
body: JSON.stringify({
|
|
136
|
+
method: "agent/run",
|
|
137
|
+
params: { agentId: "myAgent" },
|
|
138
|
+
body: {
|
|
139
|
+
messages: [],
|
|
140
|
+
state: {},
|
|
141
|
+
threadId: "thread-1",
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
expect(response.status).not.toBe(404);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
});
|