@copilotkit/runtime 2.0.0-next.1 → 2.0.0-rc.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/LICENSE +21 -0
- package/README.md +135 -1
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/_virtual/_rolldown/runtime.mjs +20 -0
- package/dist/agent/converters/aisdk.cjs +355 -0
- package/dist/agent/converters/aisdk.cjs.map +1 -0
- package/dist/agent/converters/aisdk.d.cts +22 -0
- package/dist/agent/converters/aisdk.d.cts.map +1 -0
- package/dist/agent/converters/aisdk.d.mts +22 -0
- package/dist/agent/converters/aisdk.d.mts.map +1 -0
- package/dist/agent/converters/aisdk.mjs +351 -0
- package/dist/agent/converters/aisdk.mjs.map +1 -0
- package/dist/agent/converters/index.d.mts +2 -0
- package/dist/agent/converters/tanstack.cjs +374 -0
- package/dist/agent/converters/tanstack.cjs.map +1 -0
- package/dist/agent/converters/tanstack.d.cts +83 -0
- package/dist/agent/converters/tanstack.d.cts.map +1 -0
- package/dist/agent/converters/tanstack.d.mts +83 -0
- package/dist/agent/converters/tanstack.d.mts.map +1 -0
- package/dist/agent/converters/tanstack.mjs +372 -0
- package/dist/agent/converters/tanstack.mjs.map +1 -0
- package/dist/agent/converters/usage.cjs +68 -0
- package/dist/agent/converters/usage.cjs.map +1 -0
- package/dist/agent/converters/usage.d.cts +19 -0
- package/dist/agent/converters/usage.d.cts.map +1 -0
- package/dist/agent/converters/usage.d.mts +19 -0
- package/dist/agent/converters/usage.d.mts.map +1 -0
- package/dist/agent/converters/usage.mjs +62 -0
- package/dist/agent/converters/usage.mjs.map +1 -0
- package/dist/agent/index.cjs +1328 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +467 -0
- package/dist/agent/index.d.cts.map +1 -0
- package/dist/agent/index.d.mts +468 -0
- package/dist/agent/index.d.mts.map +1 -0
- package/dist/agent/index.mjs +1318 -0
- package/dist/agent/index.mjs.map +1 -0
- package/dist/agent/learned-skills.cjs +76 -0
- package/dist/agent/learned-skills.cjs.map +1 -0
- package/dist/agent/learned-skills.d.cts +15 -0
- package/dist/agent/learned-skills.d.cts.map +1 -0
- package/dist/agent/learned-skills.d.mts +15 -0
- package/dist/agent/learned-skills.d.mts.map +1 -0
- package/dist/agent/learned-skills.mjs +74 -0
- package/dist/agent/learned-skills.mjs.map +1 -0
- package/dist/agent/mcp-tool-names.cjs +82 -0
- package/dist/agent/mcp-tool-names.cjs.map +1 -0
- package/dist/agent/mcp-tool-names.mjs +80 -0
- package/dist/agent/mcp-tool-names.mjs.map +1 -0
- package/dist/agent/state-delta.cjs +321 -0
- package/dist/agent/state-delta.cjs.map +1 -0
- package/dist/agent/state-delta.mjs +320 -0
- package/dist/agent/state-delta.mjs.map +1 -0
- package/dist/agent/url-download.cjs +503 -0
- package/dist/agent/url-download.cjs.map +1 -0
- package/dist/agent/url-download.d.cts +79 -0
- package/dist/agent/url-download.d.cts.map +1 -0
- package/dist/agent/url-download.d.mts +79 -0
- package/dist/agent/url-download.d.mts.map +1 -0
- package/dist/agent/url-download.mjs +500 -0
- package/dist/agent/url-download.mjs.map +1 -0
- package/dist/express.cjs +7 -0
- package/dist/express.d.cts +4 -0
- package/dist/express.d.mts +4 -0
- package/dist/express.mjs +4 -0
- package/dist/hono.cjs +8 -0
- package/dist/hono.d.cts +4 -0
- package/dist/hono.d.mts +4 -0
- package/dist/hono.mjs +4 -0
- package/dist/index.cjs +86 -0
- package/dist/index.d.cts +28 -0
- package/dist/index.d.mts +28 -0
- package/dist/index.mjs +21 -5598
- package/dist/internal/learned-skills.cjs +21 -0
- package/dist/internal/learned-skills.d.cts +9 -0
- package/dist/internal/learned-skills.d.mts +9 -0
- package/dist/internal/learned-skills.mjs +9 -0
- package/dist/node.cjs +7 -0
- package/dist/node.d.cts +4 -0
- package/dist/node.d.mts +4 -0
- package/dist/node.mjs +4 -0
- package/dist/runtime/core/channel-activation-config.cjs +87 -0
- package/dist/runtime/core/channel-activation-config.cjs.map +1 -0
- package/dist/runtime/core/channel-activation-config.d.cts +39 -0
- package/dist/runtime/core/channel-activation-config.d.cts.map +1 -0
- package/dist/runtime/core/channel-activation-config.d.mts +39 -0
- package/dist/runtime/core/channel-activation-config.d.mts.map +1 -0
- package/dist/runtime/core/channel-activation-config.mjs +85 -0
- package/dist/runtime/core/channel-activation-config.mjs.map +1 -0
- package/dist/runtime/core/channel-manager.cjs +973 -0
- package/dist/runtime/core/channel-manager.cjs.map +1 -0
- package/dist/runtime/core/channel-manager.d.cts +166 -0
- package/dist/runtime/core/channel-manager.d.cts.map +1 -0
- package/dist/runtime/core/channel-manager.d.mts +167 -0
- package/dist/runtime/core/channel-manager.d.mts.map +1 -0
- package/dist/runtime/core/channel-manager.mjs +972 -0
- package/dist/runtime/core/channel-manager.mjs.map +1 -0
- package/dist/runtime/core/debug-event-bus.cjs +57 -0
- package/dist/runtime/core/debug-event-bus.cjs.map +1 -0
- package/dist/runtime/core/debug-event-bus.d.cts +18 -0
- package/dist/runtime/core/debug-event-bus.d.cts.map +1 -0
- package/dist/runtime/core/debug-event-bus.d.mts +18 -0
- package/dist/runtime/core/debug-event-bus.d.mts.map +1 -0
- package/dist/runtime/core/debug-event-bus.mjs +55 -0
- package/dist/runtime/core/debug-event-bus.mjs.map +1 -0
- package/dist/runtime/core/fetch-cors.cjs +71 -0
- package/dist/runtime/core/fetch-cors.cjs.map +1 -0
- package/dist/runtime/core/fetch-cors.d.cts +19 -0
- package/dist/runtime/core/fetch-cors.d.cts.map +1 -0
- package/dist/runtime/core/fetch-cors.d.mts +19 -0
- package/dist/runtime/core/fetch-cors.d.mts.map +1 -0
- package/dist/runtime/core/fetch-cors.mjs +69 -0
- package/dist/runtime/core/fetch-cors.mjs.map +1 -0
- package/dist/runtime/core/fetch-handler.cjs +539 -0
- package/dist/runtime/core/fetch-handler.cjs.map +1 -0
- package/dist/runtime/core/fetch-handler.d.cts +100 -0
- package/dist/runtime/core/fetch-handler.d.cts.map +1 -0
- package/dist/runtime/core/fetch-handler.d.mts +100 -0
- package/dist/runtime/core/fetch-handler.d.mts.map +1 -0
- package/dist/runtime/core/fetch-handler.mjs +538 -0
- package/dist/runtime/core/fetch-handler.mjs.map +1 -0
- package/dist/runtime/core/fetch-router.cjs +141 -0
- package/dist/runtime/core/fetch-router.cjs.map +1 -0
- package/dist/runtime/core/fetch-router.mjs +140 -0
- package/dist/runtime/core/fetch-router.mjs.map +1 -0
- package/dist/runtime/core/hooks.cjs +28 -0
- package/dist/runtime/core/hooks.cjs.map +1 -0
- package/dist/runtime/core/hooks.d.cts +121 -0
- package/dist/runtime/core/hooks.d.cts.map +1 -0
- package/dist/runtime/core/hooks.d.mts +121 -0
- package/dist/runtime/core/hooks.d.mts.map +1 -0
- package/dist/runtime/core/hooks.mjs +24 -0
- package/dist/runtime/core/hooks.mjs.map +1 -0
- package/dist/runtime/core/learning.cjs +61 -0
- package/dist/runtime/core/learning.cjs.map +1 -0
- package/dist/runtime/core/learning.d.cts +61 -0
- package/dist/runtime/core/learning.d.cts.map +1 -0
- package/dist/runtime/core/learning.d.mts +61 -0
- package/dist/runtime/core/learning.d.mts.map +1 -0
- package/dist/runtime/core/learning.mjs +56 -0
- package/dist/runtime/core/learning.mjs.map +1 -0
- package/dist/runtime/core/logger.cjs +21 -0
- package/dist/runtime/core/logger.cjs.map +1 -0
- package/dist/runtime/core/logger.d.cts +12 -0
- package/dist/runtime/core/logger.d.cts.map +1 -0
- package/dist/runtime/core/logger.d.mts +12 -0
- package/dist/runtime/core/logger.d.mts.map +1 -0
- package/dist/runtime/core/logger.mjs +18 -0
- package/dist/runtime/core/logger.mjs.map +1 -0
- package/dist/runtime/core/middleware-sse-parser.cjs +149 -0
- package/dist/runtime/core/middleware-sse-parser.cjs.map +1 -0
- package/dist/runtime/core/middleware-sse-parser.d.cts +21 -0
- package/dist/runtime/core/middleware-sse-parser.d.cts.map +1 -0
- package/dist/runtime/core/middleware-sse-parser.d.mts +21 -0
- package/dist/runtime/core/middleware-sse-parser.d.mts.map +1 -0
- package/dist/runtime/core/middleware-sse-parser.mjs +148 -0
- package/dist/runtime/core/middleware-sse-parser.mjs.map +1 -0
- package/dist/runtime/core/middleware.cjs +34 -0
- package/dist/runtime/core/middleware.cjs.map +1 -0
- package/dist/runtime/core/middleware.d.cts +31 -0
- package/dist/runtime/core/middleware.d.cts.map +1 -0
- package/dist/runtime/core/middleware.d.mts +31 -0
- package/dist/runtime/core/middleware.d.mts.map +1 -0
- package/dist/runtime/core/middleware.mjs +32 -0
- package/dist/runtime/core/middleware.mjs.map +1 -0
- package/dist/runtime/core/package-info.cjs +9 -0
- package/dist/runtime/core/package-info.cjs.map +1 -0
- package/dist/runtime/core/package-info.mjs +7 -0
- package/dist/runtime/core/package-info.mjs.map +1 -0
- package/dist/runtime/core/runtime-error-reporter.cjs +21 -0
- package/dist/runtime/core/runtime-error-reporter.cjs.map +1 -0
- package/dist/runtime/core/runtime-error-reporter.mjs +18 -0
- package/dist/runtime/core/runtime-error-reporter.mjs.map +1 -0
- package/dist/runtime/core/runtime.cjs +256 -0
- package/dist/runtime/core/runtime.cjs.map +1 -0
- package/dist/runtime/core/runtime.d.cts +481 -0
- package/dist/runtime/core/runtime.d.cts.map +1 -0
- package/dist/runtime/core/runtime.d.mts +481 -0
- package/dist/runtime/core/runtime.d.mts.map +1 -0
- package/dist/runtime/core/runtime.mjs +249 -0
- package/dist/runtime/core/runtime.mjs.map +1 -0
- package/dist/runtime/endpoints/auto-start-channels.cjs +46 -0
- package/dist/runtime/endpoints/auto-start-channels.cjs.map +1 -0
- package/dist/runtime/endpoints/auto-start-channels.mjs +45 -0
- package/dist/runtime/endpoints/auto-start-channels.mjs.map +1 -0
- package/dist/runtime/endpoints/express-single.cjs +43 -0
- package/dist/runtime/endpoints/express-single.cjs.map +1 -0
- package/dist/runtime/endpoints/express-single.d.cts +48 -0
- package/dist/runtime/endpoints/express-single.d.cts.map +1 -0
- package/dist/runtime/endpoints/express-single.d.mts +48 -0
- package/dist/runtime/endpoints/express-single.d.mts.map +1 -0
- package/dist/runtime/endpoints/express-single.mjs +43 -0
- package/dist/runtime/endpoints/express-single.mjs.map +1 -0
- package/dist/runtime/endpoints/express.cjs +68 -0
- package/dist/runtime/endpoints/express.cjs.map +1 -0
- package/dist/runtime/endpoints/express.d.cts +84 -0
- package/dist/runtime/endpoints/express.d.cts.map +1 -0
- package/dist/runtime/endpoints/express.d.mts +84 -0
- package/dist/runtime/endpoints/express.d.mts.map +1 -0
- package/dist/runtime/endpoints/express.mjs +66 -0
- package/dist/runtime/endpoints/express.mjs.map +1 -0
- package/dist/runtime/endpoints/hono-single.cjs +28 -0
- package/dist/runtime/endpoints/hono-single.cjs.map +1 -0
- package/dist/runtime/endpoints/hono-single.d.cts +43 -0
- package/dist/runtime/endpoints/hono-single.d.cts.map +1 -0
- package/dist/runtime/endpoints/hono-single.d.mts +43 -0
- package/dist/runtime/endpoints/hono-single.d.mts.map +1 -0
- package/dist/runtime/endpoints/hono-single.mjs +27 -0
- package/dist/runtime/endpoints/hono-single.mjs.map +1 -0
- package/dist/runtime/endpoints/hono.cjs +37 -0
- package/dist/runtime/endpoints/hono.cjs.map +1 -0
- package/dist/runtime/endpoints/hono.d.cts +96 -0
- package/dist/runtime/endpoints/hono.d.cts.map +1 -0
- package/dist/runtime/endpoints/hono.d.mts +96 -0
- package/dist/runtime/endpoints/hono.d.mts.map +1 -0
- package/dist/runtime/endpoints/hono.mjs +34 -0
- package/dist/runtime/endpoints/hono.mjs.map +1 -0
- package/dist/runtime/endpoints/index.d.cts +4 -0
- package/dist/runtime/endpoints/index.d.mts +4 -0
- package/dist/runtime/endpoints/load-express.cjs +35 -0
- package/dist/runtime/endpoints/load-express.cjs.map +1 -0
- package/dist/runtime/endpoints/load-express.mjs +34 -0
- package/dist/runtime/endpoints/load-express.mjs.map +1 -0
- package/dist/runtime/endpoints/node-fetch-handler.cjs +75 -0
- package/dist/runtime/endpoints/node-fetch-handler.cjs.map +1 -0
- package/dist/runtime/endpoints/node-fetch-handler.d.cts +11 -0
- package/dist/runtime/endpoints/node-fetch-handler.d.cts.map +1 -0
- package/dist/runtime/endpoints/node-fetch-handler.d.mts +11 -0
- package/dist/runtime/endpoints/node-fetch-handler.d.mts.map +1 -0
- package/dist/runtime/endpoints/node-fetch-handler.mjs +73 -0
- package/dist/runtime/endpoints/node-fetch-handler.mjs.map +1 -0
- package/dist/runtime/endpoints/node.cjs +16 -0
- package/dist/runtime/endpoints/node.cjs.map +1 -0
- package/dist/runtime/endpoints/node.d.cts +104 -0
- package/dist/runtime/endpoints/node.d.cts.map +1 -0
- package/dist/runtime/endpoints/node.d.mts +104 -0
- package/dist/runtime/endpoints/node.d.mts.map +1 -0
- package/dist/runtime/endpoints/node.mjs +16 -0
- package/dist/runtime/endpoints/node.mjs.map +1 -0
- package/dist/runtime/endpoints/single-route-helpers.cjs +130 -0
- package/dist/runtime/endpoints/single-route-helpers.cjs.map +1 -0
- package/dist/runtime/endpoints/single-route-helpers.mjs +125 -0
- package/dist/runtime/endpoints/single-route-helpers.mjs.map +1 -0
- package/dist/runtime/express.d.cts +2 -0
- package/dist/runtime/express.d.mts +2 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.cjs +393 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.cjs.map +1 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.d.cts +20 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.d.cts.map +1 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.d.mts +20 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.d.mts.map +1 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.mjs +392 -0
- package/dist/runtime/generative-ui/generative-ui-middleware.mjs.map +1 -0
- package/dist/runtime/generative-ui/index.d.cts +2 -0
- package/dist/runtime/generative-ui/index.d.mts +2 -0
- package/dist/runtime/generative-ui/surface-writer.cjs +85 -0
- package/dist/runtime/generative-ui/surface-writer.cjs.map +1 -0
- package/dist/runtime/generative-ui/surface-writer.d.cts +32 -0
- package/dist/runtime/generative-ui/surface-writer.d.cts.map +1 -0
- package/dist/runtime/generative-ui/surface-writer.d.mts +32 -0
- package/dist/runtime/generative-ui/surface-writer.d.mts.map +1 -0
- package/dist/runtime/generative-ui/surface-writer.mjs +84 -0
- package/dist/runtime/generative-ui/surface-writer.mjs.map +1 -0
- package/dist/runtime/handlers/get-runtime-info.cjs +140 -0
- package/dist/runtime/handlers/get-runtime-info.cjs.map +1 -0
- package/dist/runtime/handlers/get-runtime-info.mjs +140 -0
- package/dist/runtime/handlers/get-runtime-info.mjs.map +1 -0
- package/dist/runtime/handlers/handle-connect.cjs +62 -0
- package/dist/runtime/handlers/handle-connect.cjs.map +1 -0
- package/dist/runtime/handlers/handle-connect.mjs +62 -0
- package/dist/runtime/handlers/handle-connect.mjs.map +1 -0
- package/dist/runtime/handlers/handle-debug-events.cjs +33 -0
- package/dist/runtime/handlers/handle-debug-events.cjs.map +1 -0
- package/dist/runtime/handlers/handle-debug-events.mjs +33 -0
- package/dist/runtime/handlers/handle-debug-events.mjs.map +1 -0
- package/dist/runtime/handlers/handle-inspector-learning.cjs +56 -0
- package/dist/runtime/handlers/handle-inspector-learning.cjs.map +1 -0
- package/dist/runtime/handlers/handle-inspector-learning.mjs +55 -0
- package/dist/runtime/handlers/handle-inspector-learning.mjs.map +1 -0
- package/dist/runtime/handlers/handle-inspector-metadata.cjs +36 -0
- package/dist/runtime/handlers/handle-inspector-metadata.cjs.map +1 -0
- package/dist/runtime/handlers/handle-inspector-metadata.mjs +35 -0
- package/dist/runtime/handlers/handle-inspector-metadata.mjs.map +1 -0
- package/dist/runtime/handlers/handle-run.cjs +111 -0
- package/dist/runtime/handlers/handle-run.cjs.map +1 -0
- package/dist/runtime/handlers/handle-run.mjs +110 -0
- package/dist/runtime/handlers/handle-run.mjs.map +1 -0
- package/dist/runtime/handlers/handle-stop.cjs +102 -0
- package/dist/runtime/handlers/handle-stop.cjs.map +1 -0
- package/dist/runtime/handlers/handle-stop.mjs +101 -0
- package/dist/runtime/handlers/handle-stop.mjs.map +1 -0
- package/dist/runtime/handlers/handle-suggest.cjs +83 -0
- package/dist/runtime/handlers/handle-suggest.cjs.map +1 -0
- package/dist/runtime/handlers/handle-suggest.mjs +82 -0
- package/dist/runtime/handlers/handle-suggest.mjs.map +1 -0
- package/dist/runtime/handlers/handle-trajectory-connect.cjs +40 -0
- package/dist/runtime/handlers/handle-trajectory-connect.cjs.map +1 -0
- package/dist/runtime/handlers/handle-trajectory-connect.mjs +39 -0
- package/dist/runtime/handlers/handle-trajectory-connect.mjs.map +1 -0
- package/dist/runtime/handlers/handle-transcribe.cjs +112 -0
- package/dist/runtime/handlers/handle-transcribe.cjs.map +1 -0
- package/dist/runtime/handlers/handle-transcribe.mjs +111 -0
- package/dist/runtime/handlers/handle-transcribe.mjs.map +1 -0
- package/dist/runtime/handlers/header-utils.cjs +185 -0
- package/dist/runtime/handlers/header-utils.cjs.map +1 -0
- package/dist/runtime/handlers/header-utils.d.cts +53 -0
- package/dist/runtime/handlers/header-utils.d.cts.map +1 -0
- package/dist/runtime/handlers/header-utils.d.mts +53 -0
- package/dist/runtime/handlers/header-utils.d.mts.map +1 -0
- package/dist/runtime/handlers/header-utils.mjs +183 -0
- package/dist/runtime/handlers/header-utils.mjs.map +1 -0
- package/dist/runtime/handlers/intelligence/annotate.cjs +83 -0
- package/dist/runtime/handlers/intelligence/annotate.cjs.map +1 -0
- package/dist/runtime/handlers/intelligence/annotate.mjs +82 -0
- package/dist/runtime/handlers/intelligence/annotate.mjs.map +1 -0
- package/dist/runtime/handlers/intelligence/connect.cjs +68 -0
- package/dist/runtime/handlers/intelligence/connect.cjs.map +1 -0
- package/dist/runtime/handlers/intelligence/connect.mjs +68 -0
- package/dist/runtime/handlers/intelligence/connect.mjs.map +1 -0
- package/dist/runtime/handlers/intelligence/memories.cjs +260 -0
- package/dist/runtime/handlers/intelligence/memories.cjs.map +1 -0
- package/dist/runtime/handlers/intelligence/memories.mjs +254 -0
- package/dist/runtime/handlers/intelligence/memories.mjs.map +1 -0
- package/dist/runtime/handlers/intelligence/run.cjs +283 -0
- package/dist/runtime/handlers/intelligence/run.cjs.map +1 -0
- package/dist/runtime/handlers/intelligence/run.mjs +282 -0
- package/dist/runtime/handlers/intelligence/run.mjs.map +1 -0
- package/dist/runtime/handlers/intelligence/thread-names.cjs +172 -0
- package/dist/runtime/handlers/intelligence/thread-names.cjs.map +1 -0
- package/dist/runtime/handlers/intelligence/thread-names.mjs +171 -0
- package/dist/runtime/handlers/intelligence/thread-names.mjs.map +1 -0
- package/dist/runtime/handlers/intelligence/threads.cjs +399 -0
- package/dist/runtime/handlers/intelligence/threads.cjs.map +1 -0
- package/dist/runtime/handlers/intelligence/threads.mjs +390 -0
- package/dist/runtime/handlers/intelligence/threads.mjs.map +1 -0
- package/dist/runtime/handlers/shared/agent-utils.cjs +267 -0
- package/dist/runtime/handlers/shared/agent-utils.cjs.map +1 -0
- package/dist/runtime/handlers/shared/agent-utils.mjs +262 -0
- package/dist/runtime/handlers/shared/agent-utils.mjs.map +1 -0
- package/dist/runtime/handlers/shared/cloud-telemetry.cjs +30 -0
- package/dist/runtime/handlers/shared/cloud-telemetry.cjs.map +1 -0
- package/dist/runtime/handlers/shared/cloud-telemetry.mjs +29 -0
- package/dist/runtime/handlers/shared/cloud-telemetry.mjs.map +1 -0
- package/dist/runtime/handlers/shared/describe-endpoint.cjs +25 -0
- package/dist/runtime/handlers/shared/describe-endpoint.cjs.map +1 -0
- package/dist/runtime/handlers/shared/describe-endpoint.mjs +24 -0
- package/dist/runtime/handlers/shared/describe-endpoint.mjs.map +1 -0
- package/dist/runtime/handlers/shared/intelligence-utils.cjs +24 -0
- package/dist/runtime/handlers/shared/intelligence-utils.cjs.map +1 -0
- package/dist/runtime/handlers/shared/intelligence-utils.mjs +23 -0
- package/dist/runtime/handlers/shared/intelligence-utils.mjs.map +1 -0
- package/dist/runtime/handlers/shared/json-response.cjs +14 -0
- package/dist/runtime/handlers/shared/json-response.cjs.map +1 -0
- package/dist/runtime/handlers/shared/json-response.mjs +12 -0
- package/dist/runtime/handlers/shared/json-response.mjs.map +1 -0
- package/dist/runtime/handlers/shared/mcp-apps-servers.cjs +22 -0
- package/dist/runtime/handlers/shared/mcp-apps-servers.cjs.map +1 -0
- package/dist/runtime/handlers/shared/mcp-apps-servers.mjs +22 -0
- package/dist/runtime/handlers/shared/mcp-apps-servers.mjs.map +1 -0
- package/dist/runtime/handlers/shared/memory-policy.cjs +78 -0
- package/dist/runtime/handlers/shared/memory-policy.cjs.map +1 -0
- package/dist/runtime/handlers/shared/memory-policy.mjs +77 -0
- package/dist/runtime/handlers/shared/memory-policy.mjs.map +1 -0
- package/dist/runtime/handlers/shared/platform-error.cjs +39 -0
- package/dist/runtime/handlers/shared/platform-error.cjs.map +1 -0
- package/dist/runtime/handlers/shared/platform-error.mjs +39 -0
- package/dist/runtime/handlers/shared/platform-error.mjs.map +1 -0
- package/dist/runtime/handlers/shared/resolve-intelligence-user.cjs +50 -0
- package/dist/runtime/handlers/shared/resolve-intelligence-user.cjs.map +1 -0
- package/dist/runtime/handlers/shared/resolve-intelligence-user.mjs +49 -0
- package/dist/runtime/handlers/shared/resolve-intelligence-user.mjs.map +1 -0
- package/dist/runtime/handlers/shared/sse-keep-alive.cjs +68 -0
- package/dist/runtime/handlers/shared/sse-keep-alive.cjs.map +1 -0
- package/dist/runtime/handlers/shared/sse-keep-alive.mjs +66 -0
- package/dist/runtime/handlers/shared/sse-keep-alive.mjs.map +1 -0
- package/dist/runtime/handlers/shared/sse-response.cjs +237 -0
- package/dist/runtime/handlers/shared/sse-response.cjs.map +1 -0
- package/dist/runtime/handlers/shared/sse-response.mjs +236 -0
- package/dist/runtime/handlers/shared/sse-response.mjs.map +1 -0
- package/dist/runtime/handlers/shared/thread-access.cjs +137 -0
- package/dist/runtime/handlers/shared/thread-access.cjs.map +1 -0
- package/dist/runtime/handlers/shared/thread-access.d.cts +28 -0
- package/dist/runtime/handlers/shared/thread-access.d.cts.map +1 -0
- package/dist/runtime/handlers/shared/thread-access.d.mts +28 -0
- package/dist/runtime/handlers/shared/thread-access.d.mts.map +1 -0
- package/dist/runtime/handlers/shared/thread-access.mjs +132 -0
- package/dist/runtime/handlers/shared/thread-access.mjs.map +1 -0
- package/dist/runtime/handlers/sse/connect.cjs +23 -0
- package/dist/runtime/handlers/sse/connect.cjs.map +1 -0
- package/dist/runtime/handlers/sse/connect.mjs +23 -0
- package/dist/runtime/handlers/sse/connect.mjs.map +1 -0
- package/dist/runtime/handlers/sse/run.cjs +44 -0
- package/dist/runtime/handlers/sse/run.cjs.map +1 -0
- package/dist/runtime/handlers/sse/run.mjs +44 -0
- package/dist/runtime/handlers/sse/run.mjs.map +1 -0
- package/dist/runtime/hono.d.cts +2 -0
- package/dist/runtime/hono.d.mts +2 -0
- package/dist/runtime/index.d.cts +34 -0
- package/dist/runtime/index.d.cts.map +1 -0
- package/dist/runtime/index.d.mts +34 -0
- package/dist/runtime/index.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/client.cjs +1338 -0
- package/dist/runtime/intelligence-platform/client.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/client.d.cts +824 -0
- package/dist/runtime/intelligence-platform/client.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/client.d.mts +824 -0
- package/dist/runtime/intelligence-platform/client.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/client.mjs +1334 -0
- package/dist/runtime/intelligence-platform/client.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/experimental.d.cts +26 -0
- package/dist/runtime/intelligence-platform/experimental.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/experimental.d.mts +26 -0
- package/dist/runtime/intelligence-platform/experimental.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/index.d.cts +3 -0
- package/dist/runtime/intelligence-platform/index.d.mts +3 -0
- package/dist/runtime/intelligence-platform/learned-skills.cjs +95 -0
- package/dist/runtime/intelligence-platform/learned-skills.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/learned-skills.d.cts +43 -0
- package/dist/runtime/intelligence-platform/learned-skills.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/learned-skills.d.mts +43 -0
- package/dist/runtime/intelligence-platform/learned-skills.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/learned-skills.mjs +92 -0
- package/dist/runtime/intelligence-platform/learned-skills.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/learning-management.cjs +203 -0
- package/dist/runtime/intelligence-platform/learning-management.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/learning-management.d.cts +111 -0
- package/dist/runtime/intelligence-platform/learning-management.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/learning-management.d.mts +111 -0
- package/dist/runtime/intelligence-platform/learning-management.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/learning-management.mjs +193 -0
- package/dist/runtime/intelligence-platform/learning-management.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.cjs +131 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.d.cts +10 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.d.mts +10 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.mjs +127 -0
- package/dist/runtime/intelligence-platform/skill-registry/archive.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.cjs +65 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.d.cts +47 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.d.mts +47 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.mjs +65 -0
- package/dist/runtime/intelligence-platform/skill-registry/config.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.cjs +10 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.d.cts +7 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.d.mts +7 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.mjs +10 -0
- package/dist/runtime/intelligence-platform/skill-registry/errors.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/index.d.cts +7 -0
- package/dist/runtime/intelligence-platform/skill-registry/index.d.mts +7 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.cjs +247 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.d.cts +36 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.d.mts +36 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.mjs +246 -0
- package/dist/runtime/intelligence-platform/skill-registry/registry.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.cjs +41 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.cts +12 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.mts +12 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.mjs +38 -0
- package/dist/runtime/intelligence-platform/skill-registry/skill-content.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.cjs +92 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.cts +27 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.mts +27 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.mjs +91 -0
- package/dist/runtime/intelligence-platform/skill-registry/snapshot.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/thread-lock-heartbeat.cjs +142 -0
- package/dist/runtime/intelligence-platform/thread-lock-heartbeat.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/thread-lock-heartbeat.mjs +141 -0
- package/dist/runtime/intelligence-platform/thread-lock-heartbeat.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/trajectories.cjs +95 -0
- package/dist/runtime/intelligence-platform/trajectories.cjs.map +1 -0
- package/dist/runtime/intelligence-platform/trajectories.d.cts +11 -0
- package/dist/runtime/intelligence-platform/trajectories.d.cts.map +1 -0
- package/dist/runtime/intelligence-platform/trajectories.d.mts +11 -0
- package/dist/runtime/intelligence-platform/trajectories.d.mts.map +1 -0
- package/dist/runtime/intelligence-platform/trajectories.mjs +91 -0
- package/dist/runtime/intelligence-platform/trajectories.mjs.map +1 -0
- package/dist/runtime/node.d.cts +2 -0
- package/dist/runtime/node.d.mts +2 -0
- package/dist/runtime/runner/agent-runner.cjs +82 -0
- package/dist/runtime/runner/agent-runner.cjs.map +1 -0
- package/dist/runtime/runner/agent-runner.d.cts +151 -0
- package/dist/runtime/runner/agent-runner.d.cts.map +1 -0
- package/dist/runtime/runner/agent-runner.d.mts +151 -0
- package/dist/runtime/runner/agent-runner.d.mts.map +1 -0
- package/dist/runtime/runner/agent-runner.mjs +73 -0
- package/dist/runtime/runner/agent-runner.mjs.map +1 -0
- package/dist/runtime/runner/in-memory.cjs +741 -0
- package/dist/runtime/runner/in-memory.cjs.map +1 -0
- package/dist/runtime/runner/in-memory.d.cts +427 -0
- package/dist/runtime/runner/in-memory.d.cts.map +1 -0
- package/dist/runtime/runner/in-memory.d.mts +427 -0
- package/dist/runtime/runner/in-memory.d.mts.map +1 -0
- package/dist/runtime/runner/in-memory.mjs +734 -0
- package/dist/runtime/runner/in-memory.mjs.map +1 -0
- package/dist/runtime/runner/index.d.cts +5 -0
- package/dist/runtime/runner/index.d.mts +5 -0
- package/dist/runtime/runner/index.mjs +6 -0
- package/dist/runtime/runner/intelligence.cjs +617 -0
- package/dist/runtime/runner/intelligence.cjs.map +1 -0
- package/dist/runtime/runner/intelligence.d.cts +104 -0
- package/dist/runtime/runner/intelligence.d.cts.map +1 -0
- package/dist/runtime/runner/intelligence.d.mts +104 -0
- package/dist/runtime/runner/intelligence.d.mts.map +1 -0
- package/dist/runtime/runner/intelligence.mjs +616 -0
- package/dist/runtime/runner/intelligence.mjs.map +1 -0
- package/dist/runtime/telemetry/disclosure.cjs +25 -0
- package/dist/runtime/telemetry/disclosure.cjs.map +1 -0
- package/dist/runtime/telemetry/disclosure.mjs +24 -0
- package/dist/runtime/telemetry/disclosure.mjs.map +1 -0
- package/dist/runtime/telemetry/events.d.cts +66 -0
- package/dist/runtime/telemetry/events.d.cts.map +1 -0
- package/dist/runtime/telemetry/events.d.mts +66 -0
- package/dist/runtime/telemetry/events.d.mts.map +1 -0
- package/dist/runtime/telemetry/instance-created.cjs +34 -0
- package/dist/runtime/telemetry/instance-created.cjs.map +1 -0
- package/dist/runtime/telemetry/instance-created.mjs +34 -0
- package/dist/runtime/telemetry/instance-created.mjs.map +1 -0
- package/dist/runtime/telemetry/telemetry-client.cjs +108 -0
- package/dist/runtime/telemetry/telemetry-client.cjs.map +1 -0
- package/dist/runtime/telemetry/telemetry-client.d.cts +10 -0
- package/dist/runtime/telemetry/telemetry-client.d.cts.map +1 -0
- package/dist/runtime/telemetry/telemetry-client.d.mts +10 -0
- package/dist/runtime/telemetry/telemetry-client.d.mts.map +1 -0
- package/dist/runtime/telemetry/telemetry-client.mjs +107 -0
- package/dist/runtime/telemetry/telemetry-client.mjs.map +1 -0
- package/dist/runtime/telemetry/telemetry-identity.cjs +12 -0
- package/dist/runtime/telemetry/telemetry-identity.cjs.map +1 -0
- package/dist/runtime/telemetry/telemetry-identity.mjs +11 -0
- package/dist/runtime/telemetry/telemetry-identity.mjs.map +1 -0
- package/dist/runtime/transcription-service/transcription-service.cjs +7 -0
- package/dist/runtime/transcription-service/transcription-service.cjs.map +1 -0
- package/dist/runtime/transcription-service/transcription-service.d.cts +14 -0
- package/dist/runtime/transcription-service/transcription-service.d.cts.map +1 -0
- package/dist/runtime/transcription-service/transcription-service.d.mts +14 -0
- package/dist/runtime/transcription-service/transcription-service.d.mts.map +1 -0
- package/dist/runtime/transcription-service/transcription-service.mjs +6 -0
- package/dist/runtime/transcription-service/transcription-service.mjs.map +1 -0
- package/package.json +119 -104
- package/.eslintrc.js +0 -7
- package/CHANGELOG.md +0 -2920
- package/__snapshots__/schema/schema.graphql +0 -371
- package/dist/index.d.ts +0 -1494
- package/dist/index.js +0 -5641
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/langgraph.d.ts +0 -284
- package/dist/langgraph.js +0 -211
- package/dist/langgraph.js.map +0 -1
- package/dist/langgraph.mjs +0 -206
- package/dist/langgraph.mjs.map +0 -1
- package/dist/v2/index.d.ts +0 -2
- package/dist/v2/index.js +0 -22
- package/dist/v2/index.js.map +0 -1
- package/dist/v2/index.mjs +0 -5
- package/dist/v2/index.mjs.map +0 -1
- package/jest.config.js +0 -10
- package/scripts/generate-gql-schema.ts +0 -13
- package/src/agents/langgraph/event-source.ts +0 -329
- package/src/agents/langgraph/events.ts +0 -377
- package/src/graphql/inputs/action.input.ts +0 -16
- package/src/graphql/inputs/agent-session.input.ts +0 -13
- package/src/graphql/inputs/agent-state.input.ts +0 -13
- package/src/graphql/inputs/cloud-guardrails.input.ts +0 -16
- package/src/graphql/inputs/cloud.input.ts +0 -8
- package/src/graphql/inputs/context-property.input.ts +0 -10
- package/src/graphql/inputs/copilot-context.input.ts +0 -10
- package/src/graphql/inputs/custom-property.input.ts +0 -15
- package/src/graphql/inputs/extensions.input.ts +0 -21
- package/src/graphql/inputs/forwarded-parameters.input.ts +0 -22
- package/src/graphql/inputs/frontend.input.ts +0 -14
- package/src/graphql/inputs/generate-copilot-response.input.ts +0 -59
- package/src/graphql/inputs/load-agent-state.input.ts +0 -10
- package/src/graphql/inputs/message.input.ts +0 -110
- package/src/graphql/inputs/meta-event.input.ts +0 -18
- package/src/graphql/message-conversion/agui-to-gql.test.ts +0 -1263
- package/src/graphql/message-conversion/agui-to-gql.ts +0 -333
- package/src/graphql/message-conversion/gql-to-agui.test.ts +0 -1580
- package/src/graphql/message-conversion/gql-to-agui.ts +0 -278
- package/src/graphql/message-conversion/index.ts +0 -2
- package/src/graphql/message-conversion/roundtrip-conversion.test.ts +0 -526
- package/src/graphql/resolvers/copilot.resolver.ts +0 -708
- package/src/graphql/resolvers/state.resolver.ts +0 -27
- package/src/graphql/types/agents-response.type.ts +0 -19
- package/src/graphql/types/base/index.ts +0 -10
- package/src/graphql/types/converted/index.ts +0 -176
- package/src/graphql/types/copilot-response.type.ts +0 -138
- package/src/graphql/types/enums.ts +0 -38
- package/src/graphql/types/extensions-response.type.ts +0 -23
- package/src/graphql/types/guardrails-result.type.ts +0 -20
- package/src/graphql/types/load-agent-state-response.type.ts +0 -17
- package/src/graphql/types/message-status.type.ts +0 -42
- package/src/graphql/types/meta-events.type.ts +0 -71
- package/src/graphql/types/response-status.type.ts +0 -66
- package/src/index.ts +0 -4
- package/src/langgraph.ts +0 -1
- package/src/lib/cloud/index.ts +0 -4
- package/src/lib/error-messages.ts +0 -200
- package/src/lib/index.ts +0 -52
- package/src/lib/integrations/index.ts +0 -6
- package/src/lib/integrations/nest/index.ts +0 -14
- package/src/lib/integrations/nextjs/app-router.ts +0 -38
- package/src/lib/integrations/nextjs/pages-router.ts +0 -39
- package/src/lib/integrations/node-express/index.ts +0 -14
- package/src/lib/integrations/node-http/index.ts +0 -143
- package/src/lib/integrations/node-http/request-handler.ts +0 -111
- package/src/lib/integrations/shared.ts +0 -161
- package/src/lib/logger.ts +0 -28
- package/src/lib/observability.ts +0 -160
- package/src/lib/runtime/__tests__/copilot-runtime-error.test.ts +0 -169
- package/src/lib/runtime/__tests__/mcp-tools-utils.test.ts +0 -464
- package/src/lib/runtime/agent-integrations/langgraph/agent.ts +0 -209
- package/src/lib/runtime/agent-integrations/langgraph/consts.ts +0 -34
- package/src/lib/runtime/agent-integrations/langgraph/index.ts +0 -2
- package/src/lib/runtime/copilot-runtime.ts +0 -710
- package/src/lib/runtime/mcp-tools-utils.ts +0 -254
- package/src/lib/runtime/retry-utils.ts +0 -96
- package/src/lib/runtime/telemetry-agent-runner.ts +0 -139
- package/src/lib/runtime/types.ts +0 -49
- package/src/lib/runtime/utils.ts +0 -87
- package/src/lib/streaming.ts +0 -202
- package/src/lib/telemetry-client.ts +0 -64
- package/src/service-adapters/anthropic/anthropic-adapter.ts +0 -452
- package/src/service-adapters/anthropic/utils.ts +0 -152
- package/src/service-adapters/bedrock/bedrock-adapter.ts +0 -73
- package/src/service-adapters/conversion.ts +0 -67
- package/src/service-adapters/empty/empty-adapter.ts +0 -38
- package/src/service-adapters/events.ts +0 -294
- package/src/service-adapters/experimental/ollama/ollama-adapter.ts +0 -84
- package/src/service-adapters/google/google-genai-adapter.test.ts +0 -104
- package/src/service-adapters/google/google-genai-adapter.ts +0 -88
- package/src/service-adapters/groq/groq-adapter.ts +0 -203
- package/src/service-adapters/index.ts +0 -18
- package/src/service-adapters/langchain/langchain-adapter.ts +0 -111
- package/src/service-adapters/langchain/langserve.ts +0 -88
- package/src/service-adapters/langchain/types.ts +0 -14
- package/src/service-adapters/langchain/utils.ts +0 -313
- package/src/service-adapters/openai/openai-adapter.ts +0 -283
- package/src/service-adapters/openai/openai-assistant-adapter.ts +0 -344
- package/src/service-adapters/openai/utils.ts +0 -199
- package/src/service-adapters/service-adapter.ts +0 -41
- package/src/service-adapters/shared/error-utils.ts +0 -61
- package/src/service-adapters/shared/index.ts +0 -1
- package/src/service-adapters/unify/unify-adapter.ts +0 -151
- package/src/utils/failed-response-status-reasons.ts +0 -70
- package/src/utils/index.ts +0 -1
- package/src/v2/index.ts +0 -3
- package/tests/global.d.ts +0 -13
- package/tests/service-adapters/anthropic/allowlist-approach.test.ts +0 -226
- package/tests/service-adapters/anthropic/anthropic-adapter.test.ts +0 -389
- package/tests/service-adapters/openai/allowlist-approach.test.ts +0 -238
- package/tests/service-adapters/openai/openai-adapter.test.ts +0 -301
- package/tests/setup.jest.ts +0 -21
- package/tests/tsconfig.json +0 -10
- package/tsconfig.json +0 -13
- package/tsup.config.ts +0 -20
- package/typedoc.json +0 -4
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { AgentRunner } from "../runner/agent-runner.cjs";
|
|
2
|
+
import { ThreadAccessMode, ThreadsConfig } from "../handlers/shared/thread-access.cjs";
|
|
3
|
+
import { ForwardHeadersConfig, ResolvedForwardHeadersPolicy } from "../handlers/header-utils.cjs";
|
|
4
|
+
import { AfterRequestMiddleware, BeforeRequestMiddleware } from "./middleware.cjs";
|
|
5
|
+
import { CopilotRuntimeLogger } from "./logger.cjs";
|
|
6
|
+
import { TranscriptionService } from "../transcription-service/transcription-service.cjs";
|
|
7
|
+
import { DebugEventBus } from "./debug-event-bus.cjs";
|
|
8
|
+
import { CopilotRuntimeLearningConfig, CopilotRuntimeLearningContext, CopilotRuntimeUser, GetLearningContainerId, GetTrajectoryLearningContainerIds, LearningContainerSelectorInput, TrajectoryLearningContainerSelectorInput } from "./learning.cjs";
|
|
9
|
+
import { CopilotKitIntelligence } from "../intelligence-platform/client.cjs";
|
|
10
|
+
import "../intelligence-platform/index.cjs";
|
|
11
|
+
import { TelemetryCapture } from "../telemetry/telemetry-client.cjs";
|
|
12
|
+
import { DebugConfig, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ResolvedDebugConfig, RuntimeMode } from "@copilotkit/shared";
|
|
13
|
+
import { LicenseChecker } from "@copilotkit/license-verifier";
|
|
14
|
+
import { AbstractAgent } from "@ag-ui/client";
|
|
15
|
+
import { MCPClientConfig } from "@ag-ui/mcp-apps-middleware";
|
|
16
|
+
import { A2UIMiddlewareConfig } from "@ag-ui/a2ui-middleware";
|
|
17
|
+
import { Channel } from "@copilotkit/channels-core";
|
|
18
|
+
|
|
19
|
+
//#region src/runtime/core/runtime.d.ts
|
|
20
|
+
declare const VERSION: string;
|
|
21
|
+
interface BaseCopilotRuntimeMiddlewareOptions {
|
|
22
|
+
/** If set, middleware only applies to these named agents. Applies to all agents if omitted. */
|
|
23
|
+
agents?: string[];
|
|
24
|
+
}
|
|
25
|
+
/** Per-server tool policy belongs to the external middleware, and the release the runtime depends on does not support it. */
|
|
26
|
+
type McpAppsServerConfig = MCPClientConfig & {
|
|
27
|
+
/** Intelligence-only HTTP/SSE credentials from trusted server config, never iframe input. */headers?: Record<string, string>; /** Agent to bind this server to. If omitted, the server is available to all agents. */
|
|
28
|
+
agentId?: string;
|
|
29
|
+
};
|
|
30
|
+
interface McpAppsConfig {
|
|
31
|
+
/** List of MCP server configurations. */
|
|
32
|
+
servers: McpAppsServerConfig[];
|
|
33
|
+
}
|
|
34
|
+
interface OpenGenerativeUIOptions extends BaseCopilotRuntimeMiddlewareOptions {}
|
|
35
|
+
type OpenGenerativeUIConfig = boolean | OpenGenerativeUIOptions;
|
|
36
|
+
interface CopilotRuntimeMiddlewares {
|
|
37
|
+
/**
|
|
38
|
+
* Auto-apply A2UIMiddleware to agents at run time.
|
|
39
|
+
* Pass an object to enable and customise behaviour, or omit to disable.
|
|
40
|
+
*/
|
|
41
|
+
a2ui?: BaseCopilotRuntimeMiddlewareOptions & A2UIMiddlewareConfig & {
|
|
42
|
+
/**
|
|
43
|
+
* Explicit on/off switch. Omit (or set `true`) to enable; set `false`
|
|
44
|
+
* to disable A2UI for this runtime while keeping the rest of the config
|
|
45
|
+
* (e.g. a `schema`/`catalog`) in place. A bare `a2ui: {}` stays enabled
|
|
46
|
+
* for backwards compatibility.
|
|
47
|
+
*/
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Auto-apply MCPAppsMiddleware to agents at run time. */
|
|
51
|
+
mcpApps?: McpAppsConfig;
|
|
52
|
+
/** Auto-apply OpenGenerativeUIMiddleware to agents at run time. */
|
|
53
|
+
openGenerativeUI?: OpenGenerativeUIConfig;
|
|
54
|
+
/**
|
|
55
|
+
* Experimental: CopilotKit generative UI surfaces (`render_ui`).
|
|
56
|
+
*
|
|
57
|
+
* - Omitted: applied to a run when the React provider sends a
|
|
58
|
+
* tool-transport envelope (`forwardedProps.copilotkit.ui`).
|
|
59
|
+
* - `true`: applied to every run.
|
|
60
|
+
* - `{ agents }`: applied to every run of the named agents.
|
|
61
|
+
* - `false`: never applied.
|
|
62
|
+
*
|
|
63
|
+
* A run with a markdown-transport envelope never gets it: the model writes
|
|
64
|
+
* the UI in a2ui code fences, and the client renders them.
|
|
65
|
+
*/
|
|
66
|
+
generativeUI?: boolean | BaseCopilotRuntimeMiddlewareOptions;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Context passed to agent factory functions for per-request agent resolution.
|
|
70
|
+
*/
|
|
71
|
+
interface AgentFactoryContext {
|
|
72
|
+
/** The incoming HTTP request. */
|
|
73
|
+
request: Request;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A function that dynamically creates agents on a per-request basis.
|
|
77
|
+
* Useful for multi-tenant scenarios or request-scoped agent configuration.
|
|
78
|
+
*/
|
|
79
|
+
type AgentsFactory = (ctx: AgentFactoryContext) => MaybePromise<NonEmptyRecord<Record<string, AbstractAgent>>>;
|
|
80
|
+
/**
|
|
81
|
+
* Agents can be provided as:
|
|
82
|
+
* - A static record of agents
|
|
83
|
+
* - A Promise that resolves to a record of agents
|
|
84
|
+
* - A factory function that receives request context and returns agents (or a Promise of agents)
|
|
85
|
+
*/
|
|
86
|
+
type AgentsConfig = MaybePromise<NonEmptyRecord<Record<string, AbstractAgent>>> | AgentsFactory;
|
|
87
|
+
/**
|
|
88
|
+
* Resolve an AgentsConfig value to a concrete record of agents.
|
|
89
|
+
* If the config is a factory function, it is called with the given request context.
|
|
90
|
+
* Otherwise it is awaited directly (static record or Promise).
|
|
91
|
+
*/
|
|
92
|
+
declare function resolveAgents(agents: AgentsConfig, request?: Request): Promise<Record<string, AbstractAgent>>;
|
|
93
|
+
interface BaseCopilotRuntimeOptions extends CopilotRuntimeMiddlewares {
|
|
94
|
+
/**
|
|
95
|
+
* Map of available agents, or a factory function for per-request agent resolution.
|
|
96
|
+
*
|
|
97
|
+
* Static record:
|
|
98
|
+
* ```ts
|
|
99
|
+
* agents: { support: new SupportAgent(), technical: new TechnicalAgent() }
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* Factory function (called per-request):
|
|
103
|
+
* ```ts
|
|
104
|
+
* agents: ({ request }) => {
|
|
105
|
+
* const tenantId = request.headers.get("x-tenant-id");
|
|
106
|
+
* return { default: createAgentForTenant(tenantId) };
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
agents: AgentsConfig;
|
|
111
|
+
/** Optional transcription service for audio processing. */
|
|
112
|
+
transcriptionService?: TranscriptionService;
|
|
113
|
+
/** Optional *before* middleware – callback function or webhook URL. */
|
|
114
|
+
beforeRequestMiddleware?: BeforeRequestMiddleware;
|
|
115
|
+
/** Optional *after* middleware – callback function or webhook URL. */
|
|
116
|
+
afterRequestMiddleware?: AfterRequestMiddleware;
|
|
117
|
+
/** Signed license token for server-side feature verification. Falls back to COPILOTKIT_LICENSE_TOKEN env var. */
|
|
118
|
+
licenseToken?: string;
|
|
119
|
+
/** Standalone telemetry identity. Falls back to CPK_TELEMETRY_ID before legacy license identity. */
|
|
120
|
+
telemetryId?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Properties added to every telemetry event this runtime sends.
|
|
123
|
+
*
|
|
124
|
+
* For what is true of the whole process rather than of one event. A product
|
|
125
|
+
* built on this runtime can name itself here and then be told apart in the
|
|
126
|
+
* events that already go, rather than sending events of its own.
|
|
127
|
+
*
|
|
128
|
+
* No effect when telemetry is off: nothing is sent, so nothing carries this.
|
|
129
|
+
*/
|
|
130
|
+
telemetryProperties?: Record<string, unknown>;
|
|
131
|
+
/**
|
|
132
|
+
* A capture scope to emit this runtime's telemetry through, instead of one
|
|
133
|
+
* built from the identity options above.
|
|
134
|
+
*
|
|
135
|
+
* @internal Set by the deprecated v1 entrypoint, which delegates every
|
|
136
|
+
* request to this runtime. Handing its own scope down is what collapses
|
|
137
|
+
* the duplicate: the v1 entrypoint no longer emits the same events itself,
|
|
138
|
+
* and the events this runtime sends still reach Segment and still report
|
|
139
|
+
* the v1 surface. There is no reason for an application to pass this.
|
|
140
|
+
*/
|
|
141
|
+
ɵtelemetry?: TelemetryCapture;
|
|
142
|
+
/** Enable debug logging for the event pipeline. */
|
|
143
|
+
debug?: DebugConfig;
|
|
144
|
+
/**
|
|
145
|
+
* Policy controlling which inbound HTTP headers are forwarded onto the
|
|
146
|
+
* outgoing agent call. By default a built-in denylist strips known
|
|
147
|
+
* infrastructure/proxy/platform headers (`x-forwarded-*`, `x-real-ip`,
|
|
148
|
+
* `x-vercel-*`, `x-copilotcloud-*`, etc.) while `authorization` and custom
|
|
149
|
+
* `x-*` application headers continue to forward (#5712). Set
|
|
150
|
+
* `{ useDefaultDenylist: false }` to restore the previous wide-open behavior.
|
|
151
|
+
*/
|
|
152
|
+
forwardHeaders?: ForwardHeadersConfig;
|
|
153
|
+
/**
|
|
154
|
+
* Seconds of silence on an SSE response before the runtime writes a
|
|
155
|
+
* `: keep-alive` comment, so proxies and browsers with idle timeouts keep
|
|
156
|
+
* the connection open through long reasoning or tool phases. Comments are
|
|
157
|
+
* transport frames and never become AG-UI events. `0` disables it.
|
|
158
|
+
* @default 15
|
|
159
|
+
*/
|
|
160
|
+
sseKeepAliveIntervalSeconds?: number;
|
|
161
|
+
/**
|
|
162
|
+
* Opt-in flag exposing the client-facing memory proxy routes
|
|
163
|
+
* (`/memories`, `/memories/recall`, `/memories/subscribe`, `/memories/:id`).
|
|
164
|
+
*
|
|
165
|
+
* Defaults to `false` — a **secure default**. When off, every `/memories/*`
|
|
166
|
+
* request 404s as if the route did not exist, so an un-opted-in deployment
|
|
167
|
+
* reveals nothing about memory even when Intelligence is configured. This does
|
|
168
|
+
* NOT affect the agent's own server-side memory tooling (`recall_memory` runs
|
|
169
|
+
* via the Intelligence MCP path, separate from this client REST proxy).
|
|
170
|
+
*
|
|
171
|
+
* Flip to `true` to power a client memory inspector (e.g. the dev console's
|
|
172
|
+
* Memory tab). Existing Intelligence deployments relying on the previously
|
|
173
|
+
* always-on Learning tab must set this to restore it.
|
|
174
|
+
*
|
|
175
|
+
* @deprecated Configure `memory.access` on an Intelligence Runtime. That one
|
|
176
|
+
* policy enables and limits both agent and browser Memory.
|
|
177
|
+
*/
|
|
178
|
+
exposeMemoryRoutes?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* How local Threads are shared among callers that `identifyUser` does not
|
|
181
|
+
* identify, when no Intelligence is configured. Has no effect on an
|
|
182
|
+
* Intelligence runtime, where the platform scopes Threads per user.
|
|
183
|
+
*
|
|
184
|
+
* With `identifyUser`, every Thread operation (list, read, connect, run,
|
|
185
|
+
* stop, clear) reaches only the caller's own Threads, whatever this says.
|
|
186
|
+
* Without it, by default (`access: "owner"`), a Thread id works as a
|
|
187
|
+
* capability: whoever holds it may read, connect to, continue and stop that
|
|
188
|
+
* Thread, but listing and clearing Threads are refused with HTTP 403.
|
|
189
|
+
* `access: "open"` also lets every caller list and clear the Threads created
|
|
190
|
+
* without identity, as in earlier releases. That is insecure for any
|
|
191
|
+
* deployment that more than one person can reach. A Thread created by an
|
|
192
|
+
* identified user is never reachable without that identity.
|
|
193
|
+
*/
|
|
194
|
+
threads?: ThreadsConfig;
|
|
195
|
+
}
|
|
196
|
+
type IdentifyUserCallback = (request: Request) => MaybePromise<CopilotRuntimeUser>;
|
|
197
|
+
type MemoryAccess = "none" | "read" | "read-write";
|
|
198
|
+
interface MemoryGrant {
|
|
199
|
+
readonly user: MemoryAccess;
|
|
200
|
+
readonly project: MemoryAccess;
|
|
201
|
+
}
|
|
202
|
+
type MemoryConsumer = "agent" | "client";
|
|
203
|
+
interface CopilotRuntimeMemoryConfig {
|
|
204
|
+
/** Resolves immutable Memory access for one authenticated web request. */
|
|
205
|
+
access(input: {
|
|
206
|
+
readonly request: Request;
|
|
207
|
+
readonly user: CopilotRuntimeUser;
|
|
208
|
+
readonly consumer: MemoryConsumer;
|
|
209
|
+
}): MaybePromise<MemoryGrant | null>;
|
|
210
|
+
}
|
|
211
|
+
interface CopilotSseRuntimeOptions extends BaseCopilotRuntimeOptions {
|
|
212
|
+
/** The runner to use for running agents in SSE mode. */
|
|
213
|
+
runner?: AgentRunner;
|
|
214
|
+
/**
|
|
215
|
+
* Resolves the authenticated user for a request. When set, each Thread
|
|
216
|
+
* belongs to the user whose request created it, and only that user can list,
|
|
217
|
+
* read, replay, clear, continue or stop it. The runner must enforce owners
|
|
218
|
+
* (InMemoryAgentRunner and SqliteAgentRunner do); with a runner that does
|
|
219
|
+
* not, those requests are refused. See `threads`.
|
|
220
|
+
*
|
|
221
|
+
* Threads that SqliteAgentRunner stored before it recorded owners belong to
|
|
222
|
+
* nobody: as before the upgrade, whoever holds such a Thread's id can reach
|
|
223
|
+
* it, and continuing it does not claim it. The runner logs how many it holds
|
|
224
|
+
* when it opens the database. Every new Thread is owned. InMemoryAgentRunner
|
|
225
|
+
* keeps no Threads across a restart, so it holds no such Threads.
|
|
226
|
+
*/
|
|
227
|
+
identifyUser?: IdentifyUserCallback;
|
|
228
|
+
intelligence?: undefined;
|
|
229
|
+
generateThreadNames?: undefined;
|
|
230
|
+
/** Intelligence Channels require the Intelligence runtime; not available in SSE mode. */
|
|
231
|
+
channels?: undefined;
|
|
232
|
+
}
|
|
233
|
+
interface CopilotIntelligenceRuntimeBaseOptions extends BaseCopilotRuntimeOptions {
|
|
234
|
+
/** Configures Intelligence mode for durable threads and realtime events. */
|
|
235
|
+
intelligence: CopilotKitIntelligence;
|
|
236
|
+
/**
|
|
237
|
+
* Chooses one stable Learning Container ID for each web or Channel run.
|
|
238
|
+
* @deprecated Configure `getLearningContainerId` on `CopilotKitIntelligence`.
|
|
239
|
+
*/
|
|
240
|
+
ɵlearning?: CopilotRuntimeLearningConfig;
|
|
241
|
+
/** Auto-generate short names for newly created threads. */
|
|
242
|
+
generateThreadNames?: boolean;
|
|
243
|
+
/** Max delay (ms) for WebSocket reconnect backoff. @default 10_000 */
|
|
244
|
+
maxReconnectMs?: number;
|
|
245
|
+
/** Max delay (ms) for channel rejoin backoff. @default 30_000 */
|
|
246
|
+
maxRejoinMs?: number;
|
|
247
|
+
/**
|
|
248
|
+
* Interval (ms) between Phoenix heartbeats on the runner WebSocket. Keep it
|
|
249
|
+
* below the idle timeout of any proxy between the runtime and Intelligence.
|
|
250
|
+
* @default 15_000
|
|
251
|
+
*/
|
|
252
|
+
heartbeatIntervalMs?: number;
|
|
253
|
+
/** Lock TTL in seconds. Clamped to a maximum of 3600 (1 hour). @default 20 */
|
|
254
|
+
lockTtlSeconds?: number;
|
|
255
|
+
/** Custom Redis key prefix for the thread lock. */
|
|
256
|
+
lockKeyPrefix?: string;
|
|
257
|
+
/** Interval in seconds at which the runtime renews the thread lock. Clamped to a maximum of 3000 (50 minutes). @default 15 */
|
|
258
|
+
lockHeartbeatIntervalSeconds?: number;
|
|
259
|
+
}
|
|
260
|
+
type NonEmptyChannels = readonly [Channel, ...Channel[]];
|
|
261
|
+
/** Intelligence runtime options with web identity, Channels, or both. */
|
|
262
|
+
type CopilotIntelligenceRuntimeOptions = CopilotIntelligenceRuntimeBaseOptions & ({
|
|
263
|
+
/** Resolves the authenticated user for web requests. */identifyUser: IdentifyUserCallback; /** Enables agent and browser Memory under one request policy. */
|
|
264
|
+
memory?: CopilotRuntimeMemoryConfig;
|
|
265
|
+
channels?: readonly Channel[];
|
|
266
|
+
} | {
|
|
267
|
+
/** Channels-only runtimes expose no functional web surface. */identifyUser?: undefined;
|
|
268
|
+
memory?: undefined;
|
|
269
|
+
channels: NonEmptyChannels;
|
|
270
|
+
});
|
|
271
|
+
type CopilotRuntimeOptions = CopilotSseRuntimeOptions | CopilotIntelligenceRuntimeOptions;
|
|
272
|
+
interface CopilotRuntimeLike {
|
|
273
|
+
agents: CopilotRuntimeOptions["agents"];
|
|
274
|
+
transcriptionService: CopilotRuntimeOptions["transcriptionService"];
|
|
275
|
+
beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
|
|
276
|
+
afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
|
|
277
|
+
runner: AgentRunner;
|
|
278
|
+
a2ui: CopilotRuntimeOptions["a2ui"];
|
|
279
|
+
mcpApps: CopilotRuntimeOptions["mcpApps"];
|
|
280
|
+
openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
|
|
281
|
+
generativeUI?: CopilotRuntimeOptions["generativeUI"];
|
|
282
|
+
intelligence?: CopilotKitIntelligence;
|
|
283
|
+
identifyUser?: IdentifyUserCallback;
|
|
284
|
+
mode: RuntimeMode;
|
|
285
|
+
licenseChecker?: LicenseChecker;
|
|
286
|
+
debugEventBus?: DebugEventBus;
|
|
287
|
+
debug: ResolvedDebugConfig;
|
|
288
|
+
debugLogger?: CopilotRuntimeLogger;
|
|
289
|
+
/**
|
|
290
|
+
* Runtime-bound telemetry capture. Optional so external implementations of
|
|
291
|
+
* this published interface remain source-compatible.
|
|
292
|
+
*/
|
|
293
|
+
telemetry?: TelemetryCapture;
|
|
294
|
+
/**
|
|
295
|
+
* Resolved inbound-header forwarding policy read by the /run and /connect call
|
|
296
|
+
* sites. Optional on the published interface so an external `CopilotRuntimeLike`
|
|
297
|
+
* implementor predating this field stays source-compatible (non-breaking minor
|
|
298
|
+
* release). Concrete runtimes (`BaseCopilotRuntime`) always resolve and set it;
|
|
299
|
+
* the call sites coalesce a missing value to the default resolved policy
|
|
300
|
+
* (`resolveForwardHeadersPolicy(undefined)` — default-on denylist).
|
|
301
|
+
*/
|
|
302
|
+
forwardHeadersPolicy?: ResolvedForwardHeadersPolicy;
|
|
303
|
+
/**
|
|
304
|
+
* Resolved SSE keep-alive interval in seconds; `0` disables it. Optional on
|
|
305
|
+
* the published interface for the same source-compatibility reason as
|
|
306
|
+
* `forwardHeadersPolicy`; the SSE call sites fall back to the default.
|
|
307
|
+
*/
|
|
308
|
+
sseKeepAliveIntervalSeconds?: number;
|
|
309
|
+
/**
|
|
310
|
+
* Resolved opt-in flag for the client-facing memory proxy routes. Optional on
|
|
311
|
+
* the published interface so an external `CopilotRuntimeLike` implementor
|
|
312
|
+
* predating this field stays source-compatible; the dispatcher coalesces a
|
|
313
|
+
* missing value to `false` (secure default — routes hidden). Concrete runtimes
|
|
314
|
+
* (`BaseCopilotRuntime`) always resolve and set it.
|
|
315
|
+
*/
|
|
316
|
+
exposeMemoryRoutes?: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Resolved local Thread access mode. Optional on the published interface so
|
|
319
|
+
* an external implementor stays source-compatible; a missing value means
|
|
320
|
+
* the default (`DEFAULT_THREAD_ACCESS`).
|
|
321
|
+
*/
|
|
322
|
+
threadAccess?: ThreadAccessMode;
|
|
323
|
+
memory?: CopilotRuntimeMemoryConfig;
|
|
324
|
+
learning?: CopilotRuntimeLearningConfig;
|
|
325
|
+
}
|
|
326
|
+
interface CopilotSseRuntimeLike extends CopilotRuntimeLike {
|
|
327
|
+
intelligence?: undefined;
|
|
328
|
+
mode: typeof RUNTIME_MODE_SSE;
|
|
329
|
+
}
|
|
330
|
+
interface CopilotIntelligenceRuntimeLike extends CopilotRuntimeLike {
|
|
331
|
+
intelligence: CopilotKitIntelligence;
|
|
332
|
+
identifyUser?: IdentifyUserCallback;
|
|
333
|
+
generateThreadNames: boolean;
|
|
334
|
+
lockTtlSeconds: number;
|
|
335
|
+
lockKeyPrefix?: string;
|
|
336
|
+
lockHeartbeatIntervalSeconds: number;
|
|
337
|
+
channels: Channel[];
|
|
338
|
+
learning?: CopilotRuntimeLearningConfig;
|
|
339
|
+
mode: typeof RUNTIME_MODE_INTELLIGENCE;
|
|
340
|
+
}
|
|
341
|
+
declare abstract class BaseCopilotRuntime implements CopilotRuntimeLike {
|
|
342
|
+
agents: CopilotRuntimeOptions["agents"];
|
|
343
|
+
transcriptionService: CopilotRuntimeOptions["transcriptionService"];
|
|
344
|
+
beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
|
|
345
|
+
afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
|
|
346
|
+
runner: AgentRunner;
|
|
347
|
+
a2ui: CopilotRuntimeOptions["a2ui"];
|
|
348
|
+
mcpApps: CopilotRuntimeOptions["mcpApps"];
|
|
349
|
+
openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
|
|
350
|
+
generativeUI: CopilotRuntimeOptions["generativeUI"];
|
|
351
|
+
licenseChecker?: LicenseChecker;
|
|
352
|
+
readonly debugEventBus?: DebugEventBus;
|
|
353
|
+
debug: ResolvedDebugConfig;
|
|
354
|
+
debugLogger?: CopilotRuntimeLogger;
|
|
355
|
+
readonly telemetry: TelemetryCapture;
|
|
356
|
+
readonly forwardHeadersPolicy: ResolvedForwardHeadersPolicy;
|
|
357
|
+
readonly sseKeepAliveIntervalSeconds: number;
|
|
358
|
+
readonly exposeMemoryRoutes: boolean;
|
|
359
|
+
readonly threadAccess: ThreadAccessMode;
|
|
360
|
+
readonly memory?: CopilotRuntimeMemoryConfig;
|
|
361
|
+
/**
|
|
362
|
+
* License token resolved once with the env fallback, so telemetry
|
|
363
|
+
* attribution (below) and subclass feature gating
|
|
364
|
+
* (CopilotIntelligenceRuntime's licenseChecker) read the exact same value
|
|
365
|
+
* instead of each re-applying `?? COPILOTKIT_LICENSE_TOKEN`.
|
|
366
|
+
*/
|
|
367
|
+
protected readonly resolvedLicenseToken?: string;
|
|
368
|
+
abstract readonly intelligence?: CopilotKitIntelligence;
|
|
369
|
+
abstract readonly mode: RuntimeMode;
|
|
370
|
+
constructor(options: BaseCopilotRuntimeOptions, runner: AgentRunner);
|
|
371
|
+
}
|
|
372
|
+
declare class CopilotSseRuntime extends BaseCopilotRuntime implements CopilotSseRuntimeLike {
|
|
373
|
+
readonly intelligence: any;
|
|
374
|
+
readonly mode: "sse";
|
|
375
|
+
readonly identifyUser?: IdentifyUserCallback;
|
|
376
|
+
constructor(options: CopilotSseRuntimeOptions);
|
|
377
|
+
}
|
|
378
|
+
declare class CopilotIntelligenceRuntime extends BaseCopilotRuntime implements CopilotIntelligenceRuntimeLike {
|
|
379
|
+
readonly intelligence: CopilotKitIntelligence;
|
|
380
|
+
readonly identifyUser?: IdentifyUserCallback;
|
|
381
|
+
readonly generateThreadNames: boolean;
|
|
382
|
+
readonly lockTtlSeconds: number;
|
|
383
|
+
readonly lockKeyPrefix?: string;
|
|
384
|
+
readonly lockHeartbeatIntervalSeconds: number;
|
|
385
|
+
readonly channels: Channel[];
|
|
386
|
+
readonly learning?: CopilotRuntimeLearningConfig;
|
|
387
|
+
readonly mode: "intelligence";
|
|
388
|
+
/** Maximum allowed lock TTL in seconds (1 hour). */
|
|
389
|
+
static readonly MAX_LOCK_TTL_SECONDS = 3600;
|
|
390
|
+
/** Maximum allowed heartbeat interval in seconds (50 minutes). */
|
|
391
|
+
static readonly MAX_HEARTBEAT_INTERVAL_SECONDS = 3000;
|
|
392
|
+
constructor(options: CopilotIntelligenceRuntimeOptions);
|
|
393
|
+
}
|
|
394
|
+
declare function isIntelligenceRuntime(runtime: CopilotRuntimeLike): runtime is CopilotIntelligenceRuntimeLike;
|
|
395
|
+
/**
|
|
396
|
+
* Single source of truth for "is A2UI on for this runtime?". Both the run path
|
|
397
|
+
* (which applies `A2UIMiddleware`) and the `/info` response (which tells the
|
|
398
|
+
* client whether to mount the A2UI renderer + catalog context) MUST go through
|
|
399
|
+
* this, so they can never disagree — the divergence between them was the root
|
|
400
|
+
* of CopilotKit/CopilotKit#5369.
|
|
401
|
+
*
|
|
402
|
+
* Backwards compatible: any config object is enabled (matching the historical
|
|
403
|
+
* `!!runtime.a2ui`); only an explicit `enabled: false` turns it off.
|
|
404
|
+
*/
|
|
405
|
+
declare function isA2UIEnabled(a2ui: CopilotRuntimeOptions["a2ui"]): a2ui is NonNullable<CopilotRuntimeOptions["a2ui"]>;
|
|
406
|
+
/**
|
|
407
|
+
* Compile-time phantom brand marking a {@link CopilotRuntime} that was
|
|
408
|
+
* constructed with at least one declared Intelligence Channel. It has no runtime
|
|
409
|
+
* representation — the shim never sets this property; it exists purely so
|
|
410
|
+
* `createCopilotRuntimeHandler` can tell, at the type level, that the resulting
|
|
411
|
+
* handler will carry a non-optional `.channels` control surface.
|
|
412
|
+
*/
|
|
413
|
+
interface RuntimeWithDeclaredChannels {
|
|
414
|
+
/**
|
|
415
|
+
* @internal Phantom brand key. Never present at runtime; do not read or set.
|
|
416
|
+
*/
|
|
417
|
+
readonly __copilotkitChannelsDeclared: true;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Instance shape of the {@link CopilotRuntime} compatibility shim. Extends
|
|
421
|
+
* {@link CopilotRuntimeLike} with the Intelligence-only accessors the shim
|
|
422
|
+
* surfaces (all `undefined` in SSE mode). Declared explicitly so the exported
|
|
423
|
+
* `CopilotRuntime` name resolves as a type as well as a value.
|
|
424
|
+
*/
|
|
425
|
+
interface CopilotRuntime extends CopilotRuntimeLike {
|
|
426
|
+
/** Telemetry capture bound to this runtime's construction-time identity. */
|
|
427
|
+
telemetry: TelemetryCapture;
|
|
428
|
+
/** Auto-generate short thread names; `undefined` in SSE mode. */
|
|
429
|
+
generateThreadNames?: boolean;
|
|
430
|
+
/** Thread lock TTL in seconds; `undefined` in SSE mode. */
|
|
431
|
+
lockTtlSeconds?: number;
|
|
432
|
+
/** Custom Redis key prefix for the thread lock; `undefined` in SSE mode. */
|
|
433
|
+
lockKeyPrefix?: string;
|
|
434
|
+
/** Thread lock heartbeat interval in seconds; `undefined` in SSE mode. */
|
|
435
|
+
lockHeartbeatIntervalSeconds?: number;
|
|
436
|
+
/** Declared Intelligence Channels; `undefined` in SSE mode. */
|
|
437
|
+
channels?: Channel[];
|
|
438
|
+
/** Learning Container selector; `undefined` in SSE mode. */
|
|
439
|
+
learning?: CopilotRuntimeLearningConfig;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Constructor type for the {@link CopilotRuntime} compatibility shim.
|
|
443
|
+
*
|
|
444
|
+
* The first overload fires when the caller passes `intelligence` together with a
|
|
445
|
+
* non-empty `channels` tuple: it returns a {@link RuntimeWithDeclaredChannels}-
|
|
446
|
+
* branded runtime, which `createCopilotRuntimeHandler` maps to a handler whose
|
|
447
|
+
* `.channels` is non-optional. Every other configuration (SSE, or Intelligence
|
|
448
|
+
* without channels, or an empty `channels: []`) falls through to the second
|
|
449
|
+
* overload and stays unbranded, so its handler keeps `.channels` optional.
|
|
450
|
+
*
|
|
451
|
+
* A class constructor cannot vary its return type across overloads (it is pinned
|
|
452
|
+
* to the instance type), so the branding lives on this construct-signature
|
|
453
|
+
* interface instead of on the class itself.
|
|
454
|
+
*/
|
|
455
|
+
interface CopilotRuntimeConstructor {
|
|
456
|
+
new (options: CopilotIntelligenceRuntimeBaseOptions & ({
|
|
457
|
+
identifyUser: IdentifyUserCallback;
|
|
458
|
+
memory?: CopilotRuntimeMemoryConfig;
|
|
459
|
+
channels: NonEmptyChannels;
|
|
460
|
+
} | {
|
|
461
|
+
identifyUser?: undefined;
|
|
462
|
+
memory?: undefined;
|
|
463
|
+
channels: NonEmptyChannels;
|
|
464
|
+
})): CopilotRuntime & RuntimeWithDeclaredChannels;
|
|
465
|
+
new (options: CopilotRuntimeOptions): CopilotRuntime;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* The public `CopilotRuntime` constructor. Backed by {@link CopilotRuntimeShim}
|
|
469
|
+
* but typed as {@link CopilotRuntimeConstructor} so that constructing with a
|
|
470
|
+
* non-empty `channels` array yields a {@link RuntimeWithDeclaredChannels}-branded
|
|
471
|
+
* runtime type.
|
|
472
|
+
*
|
|
473
|
+
* The `as unknown as` cast is required (not dishonest widening): the brand is a
|
|
474
|
+
* phantom, compile-time-only marker with no runtime representation, so the shim
|
|
475
|
+
* instances legitimately do not carry the brand property. Behavior is identical
|
|
476
|
+
* to the former `class CopilotRuntime` — this only refines the static type.
|
|
477
|
+
*/
|
|
478
|
+
declare const CopilotRuntime: CopilotRuntimeConstructor;
|
|
479
|
+
//#endregion
|
|
480
|
+
export { AgentFactoryContext, AgentsConfig, AgentsFactory, CopilotIntelligenceRuntime, CopilotIntelligenceRuntimeLike, CopilotIntelligenceRuntimeOptions, CopilotRuntime, CopilotRuntimeConstructor, CopilotRuntimeLike, CopilotRuntimeMemoryConfig, CopilotRuntimeOptions, CopilotSseRuntime, CopilotSseRuntimeLike, CopilotSseRuntimeOptions, IdentifyUserCallback, McpAppsConfig, McpAppsServerConfig, MemoryAccess, MemoryConsumer, MemoryGrant, OpenGenerativeUIConfig, OpenGenerativeUIOptions, RuntimeWithDeclaredChannels, VERSION, isA2UIEnabled, isIntelligenceRuntime, resolveAgents };
|
|
481
|
+
//# sourceMappingURL=runtime.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.cts","names":[],"sources":["../../../src/runtime/core/runtime.ts"],"mappings":";;;;;;;;;;;;;;;;;;;cAiFa,OAAA;AAAA,UAEH,mCAAA;EAFoC;EAI5C,MAAA;AAAA;;KAIU,mBAAA,GAAsB,eAAA;EAJhC,6FAMA,OAAA,GAAU,MAAA,kBAFA;EAIV,O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