@copilotkit/runtime 2.0.0-rc.49 → 2.0.0-rc.50
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/README.md +1 -1
- package/dist/index.cjs +8 -3
- package/dist/index.d.cts +9 -9
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +4 -3
- package/dist/node.cjs +2 -0
- package/dist/node.d.cts +3 -3
- package/dist/node.d.mts +3 -3
- package/dist/node.mjs +3 -3
- package/dist/runtime/core/channel-manager.cjs.map +1 -1
- package/dist/runtime/core/channel-manager.mjs.map +1 -1
- package/dist/runtime/core/debug-event-bus.cjs.map +1 -1
- package/dist/runtime/core/debug-event-bus.d.cts +2 -2
- package/dist/runtime/core/debug-event-bus.d.cts.map +1 -1
- package/dist/runtime/core/debug-event-bus.d.mts +2 -2
- package/dist/runtime/core/debug-event-bus.d.mts.map +1 -1
- package/dist/runtime/core/debug-event-bus.mjs.map +1 -1
- package/dist/runtime/core/fetch-cors.cjs.map +1 -1
- package/dist/runtime/core/fetch-cors.d.cts +2 -2
- package/dist/runtime/core/fetch-cors.d.cts.map +1 -1
- package/dist/runtime/core/fetch-cors.d.mts +2 -2
- package/dist/runtime/core/fetch-cors.d.mts.map +1 -1
- package/dist/runtime/core/fetch-cors.mjs.map +1 -1
- package/dist/runtime/core/fetch-handler.cjs +9 -1
- package/dist/runtime/core/fetch-handler.cjs.map +1 -1
- package/dist/runtime/core/fetch-handler.d.cts +27 -14
- package/dist/runtime/core/fetch-handler.d.cts.map +1 -1
- package/dist/runtime/core/fetch-handler.d.mts +27 -14
- package/dist/runtime/core/fetch-handler.d.mts.map +1 -1
- package/dist/runtime/core/fetch-handler.mjs +9 -2
- package/dist/runtime/core/fetch-handler.mjs.map +1 -1
- package/dist/runtime/core/hooks.cjs.map +1 -1
- package/dist/runtime/core/hooks.d.cts +5 -5
- package/dist/runtime/core/hooks.d.cts.map +1 -1
- package/dist/runtime/core/hooks.d.mts +5 -5
- package/dist/runtime/core/hooks.d.mts.map +1 -1
- package/dist/runtime/core/hooks.mjs.map +1 -1
- package/dist/runtime/core/learning.cjs.map +1 -1
- package/dist/runtime/core/learning.d.cts +8 -8
- package/dist/runtime/core/learning.d.cts.map +1 -1
- package/dist/runtime/core/learning.d.mts +8 -8
- package/dist/runtime/core/learning.d.mts.map +1 -1
- package/dist/runtime/core/learning.mjs.map +1 -1
- package/dist/runtime/core/logger.cjs.map +1 -1
- package/dist/runtime/core/logger.d.cts +3 -3
- package/dist/runtime/core/logger.d.cts.map +1 -1
- package/dist/runtime/core/logger.d.mts +3 -3
- package/dist/runtime/core/logger.d.mts.map +1 -1
- package/dist/runtime/core/logger.mjs.map +1 -1
- package/dist/runtime/core/middleware-sse-parser.cjs.map +1 -1
- package/dist/runtime/core/middleware-sse-parser.mjs.map +1 -1
- package/dist/runtime/core/middleware.cjs.map +1 -1
- package/dist/runtime/core/middleware.d.cts +3 -3
- package/dist/runtime/core/middleware.d.cts.map +1 -1
- package/dist/runtime/core/middleware.d.mts +3 -3
- package/dist/runtime/core/middleware.d.mts.map +1 -1
- package/dist/runtime/core/middleware.mjs.map +1 -1
- package/dist/runtime/core/package-info.cjs +1 -1
- package/dist/runtime/core/package-info.mjs +1 -1
- package/dist/runtime/core/runtime-error-reporter.cjs.map +1 -1
- package/dist/runtime/core/runtime-error-reporter.mjs.map +1 -1
- package/dist/runtime/core/runtime.cjs +17 -17
- package/dist/runtime/core/runtime.cjs.map +1 -1
- package/dist/runtime/core/runtime.d.cts +65 -65
- package/dist/runtime/core/runtime.d.cts.map +1 -1
- package/dist/runtime/core/runtime.d.mts +65 -65
- package/dist/runtime/core/runtime.d.mts.map +1 -1
- package/dist/runtime/core/runtime.mjs +15 -15
- package/dist/runtime/core/runtime.mjs.map +1 -1
- package/dist/runtime/endpoints/auto-start-channels.cjs.map +1 -1
- package/dist/runtime/endpoints/auto-start-channels.mjs.map +1 -1
- package/dist/runtime/endpoints/node-fetch-handler.cjs +9 -1
- package/dist/runtime/endpoints/node-fetch-handler.cjs.map +1 -1
- package/dist/runtime/endpoints/node-fetch-handler.d.cts +9 -4
- package/dist/runtime/endpoints/node-fetch-handler.d.cts.map +1 -1
- package/dist/runtime/endpoints/node-fetch-handler.d.mts +9 -4
- package/dist/runtime/endpoints/node-fetch-handler.d.mts.map +1 -1
- package/dist/runtime/endpoints/node-fetch-handler.mjs +9 -2
- package/dist/runtime/endpoints/node-fetch-handler.mjs.map +1 -1
- package/dist/runtime/endpoints/node.cjs +11 -3
- package/dist/runtime/endpoints/node.cjs.map +1 -1
- package/dist/runtime/endpoints/node.d.cts +39 -16
- package/dist/runtime/endpoints/node.d.cts.map +1 -1
- package/dist/runtime/endpoints/node.d.mts +39 -16
- package/dist/runtime/endpoints/node.d.mts.map +1 -1
- package/dist/runtime/endpoints/node.mjs +13 -6
- package/dist/runtime/endpoints/node.mjs.map +1 -1
- package/dist/runtime/generative-ui/a2ui-v09-middleware.cjs.map +1 -1
- package/dist/runtime/generative-ui/a2ui-v09-middleware.mjs.map +1 -1
- package/dist/runtime/handlers/get-runtime-info.cjs.map +1 -1
- package/dist/runtime/handlers/get-runtime-info.mjs.map +1 -1
- package/dist/runtime/handlers/handle-debug-events.cjs.map +1 -1
- package/dist/runtime/handlers/handle-debug-events.mjs.map +1 -1
- package/dist/runtime/handlers/handle-inspector-learning.cjs.map +1 -1
- package/dist/runtime/handlers/handle-inspector-learning.mjs.map +1 -1
- package/dist/runtime/handlers/handle-inspector-metadata.cjs.map +1 -1
- package/dist/runtime/handlers/handle-inspector-metadata.mjs.map +1 -1
- package/dist/runtime/handlers/handle-stop.cjs.map +1 -1
- package/dist/runtime/handlers/handle-stop.mjs.map +1 -1
- package/dist/runtime/handlers/handle-suggest.cjs.map +1 -1
- package/dist/runtime/handlers/handle-suggest.mjs.map +1 -1
- package/dist/runtime/handlers/handle-trajectory-connect.cjs.map +1 -1
- package/dist/runtime/handlers/handle-trajectory-connect.mjs.map +1 -1
- package/dist/runtime/handlers/handle-transcribe.cjs.map +1 -1
- package/dist/runtime/handlers/handle-transcribe.mjs.map +1 -1
- package/dist/runtime/handlers/intelligence/annotate.cjs +1 -1
- package/dist/runtime/handlers/intelligence/annotate.cjs.map +1 -1
- package/dist/runtime/handlers/intelligence/annotate.mjs +1 -1
- package/dist/runtime/handlers/intelligence/annotate.mjs.map +1 -1
- package/dist/runtime/handlers/intelligence/connect.cjs.map +1 -1
- package/dist/runtime/handlers/intelligence/connect.mjs.map +1 -1
- package/dist/runtime/handlers/intelligence/memories.cjs +1 -1
- package/dist/runtime/handlers/intelligence/memories.cjs.map +1 -1
- package/dist/runtime/handlers/intelligence/memories.mjs +1 -1
- package/dist/runtime/handlers/intelligence/memories.mjs.map +1 -1
- package/dist/runtime/handlers/intelligence/run.cjs.map +1 -1
- package/dist/runtime/handlers/intelligence/run.mjs.map +1 -1
- package/dist/runtime/handlers/intelligence/thread-names.cjs.map +1 -1
- package/dist/runtime/handlers/intelligence/thread-names.mjs.map +1 -1
- package/dist/runtime/handlers/intelligence/threads.cjs +5 -5
- package/dist/runtime/handlers/intelligence/threads.cjs.map +1 -1
- package/dist/runtime/handlers/intelligence/threads.mjs +5 -5
- package/dist/runtime/handlers/intelligence/threads.mjs.map +1 -1
- package/dist/runtime/handlers/shared/agent-utils.cjs.map +1 -1
- package/dist/runtime/handlers/shared/agent-utils.mjs.map +1 -1
- package/dist/runtime/handlers/shared/memory-policy.cjs.map +1 -1
- package/dist/runtime/handlers/shared/memory-policy.mjs.map +1 -1
- package/dist/runtime/handlers/shared/resolve-intelligence-user.cjs.map +1 -1
- package/dist/runtime/handlers/shared/resolve-intelligence-user.mjs.map +1 -1
- package/dist/runtime/handlers/shared/sse-response.cjs.map +1 -1
- package/dist/runtime/handlers/shared/sse-response.mjs.map +1 -1
- package/dist/runtime/handlers/shared/thread-access.cjs +1 -1
- package/dist/runtime/handlers/shared/thread-access.cjs.map +1 -1
- package/dist/runtime/handlers/shared/thread-access.mjs +1 -1
- package/dist/runtime/handlers/shared/thread-access.mjs.map +1 -1
- package/dist/runtime/handlers/sse/connect.cjs.map +1 -1
- package/dist/runtime/handlers/sse/connect.mjs.map +1 -1
- package/dist/runtime/handlers/sse/run.cjs.map +1 -1
- package/dist/runtime/handlers/sse/run.mjs.map +1 -1
- package/dist/runtime/index.cjs +29 -0
- package/dist/runtime/index.cjs.map +1 -0
- package/dist/runtime/index.d.cts +58 -7
- package/dist/runtime/index.d.cts.map +1 -0
- package/dist/runtime/index.d.mts +58 -7
- package/dist/runtime/index.d.mts.map +1 -0
- package/dist/runtime/index.mjs +27 -0
- package/dist/runtime/index.mjs.map +1 -0
- package/dist/runtime/intelligence-platform/analytics-context.cjs.map +1 -1
- package/dist/runtime/intelligence-platform/analytics-context.mjs.map +1 -1
- package/dist/runtime/intelligence-platform/client.cjs +3 -3
- package/dist/runtime/intelligence-platform/client.cjs.map +1 -1
- package/dist/runtime/intelligence-platform/client.d.cts +1 -1
- package/dist/runtime/intelligence-platform/client.d.mts +1 -1
- package/dist/runtime/intelligence-platform/client.mjs +3 -3
- package/dist/runtime/intelligence-platform/client.mjs.map +1 -1
- package/dist/runtime/intelligence-platform/thread-lock-heartbeat.cjs.map +1 -1
- package/dist/runtime/intelligence-platform/thread-lock-heartbeat.mjs.map +1 -1
- package/dist/runtime/node.d.cts +2 -2
- package/dist/runtime/node.d.mts +2 -2
- package/dist/runtime/runner/intelligence.cjs.map +1 -1
- package/dist/runtime/runner/intelligence.d.cts +2 -2
- package/dist/runtime/runner/intelligence.d.cts.map +1 -1
- package/dist/runtime/runner/intelligence.d.mts +2 -2
- package/dist/runtime/runner/intelligence.d.mts.map +1 -1
- package/dist/runtime/runner/intelligence.mjs.map +1 -1
- package/dist/runtime/telemetry/disclosure.cjs.map +1 -1
- package/dist/runtime/telemetry/disclosure.mjs.map +1 -1
- package/dist/runtime/telemetry/instance-created.cjs.map +1 -1
- package/dist/runtime/telemetry/instance-created.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AgentRunner } from "../runner/agent-runner.mjs";
|
|
2
2
|
import { ThreadAccessMode, ThreadsConfig } from "../handlers/shared/thread-access.mjs";
|
|
3
3
|
import { ForwardHeadersConfig, ResolvedForwardHeadersPolicy } from "../handlers/header-utils.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { CopilotKitRuntimeLogger } from "./logger.mjs";
|
|
5
5
|
import { AfterRequestMiddleware, BeforeRequestMiddleware } from "./middleware.mjs";
|
|
6
6
|
import { TranscriptionService } from "../transcription-service/transcription-service.mjs";
|
|
7
7
|
import { DebugEventBus } from "./debug-event-bus.mjs";
|
|
8
8
|
import "../intelligence-platform/index.mjs";
|
|
9
9
|
import { TelemetryCapture } from "../telemetry/telemetry-client.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { CopilotKitRuntimeLearningConfig, CopilotKitRuntimeLearningContext, CopilotKitRuntimeUser, GetLearningContainerId, GetTrajectoryLearningContainerIds, LearningContainerSelectorInput, TrajectoryLearningContainerSelectorInput } from "./learning.mjs";
|
|
11
11
|
import { CopilotKitIntelligence } from "../intelligence-platform/client.mjs";
|
|
12
12
|
import { DebugConfig, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ResolvedDebugConfig, RuntimeMode } from "@copilotkit/shared";
|
|
13
13
|
import { LicenseChecker } from "@copilotkit/license-verifier";
|
|
@@ -45,7 +45,7 @@ type A2UIVersion = "0.9" | "1.0";
|
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
47
|
* ```ts
|
|
48
|
-
* new
|
|
48
|
+
* new CopilotKitRuntime({
|
|
49
49
|
* agents: { legacy: legacyAgent, current: currentAgent },
|
|
50
50
|
* generativeUI: { a2uiVersion: { legacy: "0.9" } },
|
|
51
51
|
* });
|
|
@@ -212,7 +212,7 @@ interface BaseCopilotRuntimeOptions extends CopilotRuntimeMiddlewares {
|
|
|
212
212
|
* Without it, the runtime writes to the console, and debug output is JSON
|
|
213
213
|
* lines on stdout.
|
|
214
214
|
*/
|
|
215
|
-
logger?:
|
|
215
|
+
logger?: CopilotKitRuntimeLogger;
|
|
216
216
|
/**
|
|
217
217
|
* Policy controlling which inbound HTTP headers are forwarded onto the
|
|
218
218
|
* outgoing agent call. By default a built-in denylist strips known
|
|
@@ -265,22 +265,22 @@ interface BaseCopilotRuntimeOptions extends CopilotRuntimeMiddlewares {
|
|
|
265
265
|
*/
|
|
266
266
|
threads?: ThreadsConfig;
|
|
267
267
|
}
|
|
268
|
-
type IdentifyUserCallback = (request: Request) => MaybePromise<
|
|
268
|
+
type IdentifyUserCallback = (request: Request) => MaybePromise<CopilotKitRuntimeUser>;
|
|
269
269
|
type MemoryAccess = "none" | "read" | "read-write";
|
|
270
270
|
interface MemoryGrant {
|
|
271
271
|
readonly user: MemoryAccess;
|
|
272
272
|
readonly project: MemoryAccess;
|
|
273
273
|
}
|
|
274
274
|
type MemoryConsumer = "agent" | "client";
|
|
275
|
-
interface
|
|
275
|
+
interface CopilotKitRuntimeMemoryConfig {
|
|
276
276
|
/** Resolves immutable Memory access for one authenticated web request. */
|
|
277
277
|
access(input: {
|
|
278
278
|
readonly request: Request;
|
|
279
|
-
readonly user:
|
|
279
|
+
readonly user: CopilotKitRuntimeUser;
|
|
280
280
|
readonly consumer: MemoryConsumer;
|
|
281
281
|
}): MaybePromise<MemoryGrant | null>;
|
|
282
282
|
}
|
|
283
|
-
interface
|
|
283
|
+
interface CopilotKitSseRuntimeOptions extends BaseCopilotRuntimeOptions {
|
|
284
284
|
/** The runner to use for running agents in SSE mode. */
|
|
285
285
|
runner?: AgentRunner;
|
|
286
286
|
/**
|
|
@@ -309,7 +309,7 @@ interface CopilotIntelligenceRuntimeBaseOptions extends BaseCopilotRuntimeOption
|
|
|
309
309
|
* Chooses one stable Learning Container ID for each web or Channel run.
|
|
310
310
|
* @deprecated Configure `getLearningContainerId` on `CopilotKitIntelligence`.
|
|
311
311
|
*/
|
|
312
|
-
ɵlearning?:
|
|
312
|
+
ɵlearning?: CopilotKitRuntimeLearningConfig;
|
|
313
313
|
/** Auto-generate short names for newly created threads. */
|
|
314
314
|
generateThreadNames?: boolean;
|
|
315
315
|
/** Max delay (ms) for WebSocket reconnect backoff. @default 10_000 */
|
|
@@ -331,25 +331,25 @@ interface CopilotIntelligenceRuntimeBaseOptions extends BaseCopilotRuntimeOption
|
|
|
331
331
|
}
|
|
332
332
|
type NonEmptyChannels = readonly [Channel, ...Channel[]];
|
|
333
333
|
/** Intelligence runtime options with web identity, Channels, or both. */
|
|
334
|
-
type
|
|
334
|
+
type CopilotKitIntelligenceRuntimeOptions = CopilotIntelligenceRuntimeBaseOptions & ({
|
|
335
335
|
/** Resolves the authenticated user for web requests. */identifyUser: IdentifyUserCallback; /** Enables agent and browser Memory under one request policy. */
|
|
336
|
-
memory?:
|
|
336
|
+
memory?: CopilotKitRuntimeMemoryConfig;
|
|
337
337
|
channels?: readonly Channel[];
|
|
338
338
|
} | {
|
|
339
339
|
/** Channels-only runtimes expose no functional web surface. */identifyUser?: undefined;
|
|
340
340
|
memory?: undefined;
|
|
341
341
|
channels: NonEmptyChannels;
|
|
342
342
|
});
|
|
343
|
-
type
|
|
344
|
-
interface
|
|
345
|
-
agents:
|
|
346
|
-
transcriptionService:
|
|
347
|
-
beforeRequestMiddleware:
|
|
348
|
-
afterRequestMiddleware:
|
|
343
|
+
type CopilotKitRuntimeOptions = CopilotKitSseRuntimeOptions | CopilotKitIntelligenceRuntimeOptions;
|
|
344
|
+
interface CopilotKitRuntimeLike {
|
|
345
|
+
agents: CopilotKitRuntimeOptions["agents"];
|
|
346
|
+
transcriptionService: CopilotKitRuntimeOptions["transcriptionService"];
|
|
347
|
+
beforeRequestMiddleware: CopilotKitRuntimeOptions["beforeRequestMiddleware"];
|
|
348
|
+
afterRequestMiddleware: CopilotKitRuntimeOptions["afterRequestMiddleware"];
|
|
349
349
|
runner: AgentRunner;
|
|
350
|
-
mcpApps:
|
|
351
|
-
openGenerativeUI:
|
|
352
|
-
generativeUI?:
|
|
350
|
+
mcpApps: CopilotKitRuntimeOptions["mcpApps"];
|
|
351
|
+
openGenerativeUI: CopilotKitRuntimeOptions["openGenerativeUI"];
|
|
352
|
+
generativeUI?: CopilotKitRuntimeOptions["generativeUI"];
|
|
353
353
|
intelligence?: CopilotKitIntelligence;
|
|
354
354
|
identifyUser?: IdentifyUserCallback;
|
|
355
355
|
mode: RuntimeMode;
|
|
@@ -362,13 +362,13 @@ interface CopilotRuntimeLike {
|
|
|
362
362
|
getLicenseChecker?(): Promise<LicenseChecker | undefined>;
|
|
363
363
|
debugEventBus?: DebugEventBus;
|
|
364
364
|
debug: ResolvedDebugConfig;
|
|
365
|
-
debugLogger?:
|
|
365
|
+
debugLogger?: CopilotKitRuntimeLogger;
|
|
366
366
|
/**
|
|
367
367
|
* The logger the runtime writes to. Optional so external implementations of
|
|
368
368
|
* this published interface remain source-compatible; a missing value means
|
|
369
369
|
* the console.
|
|
370
370
|
*/
|
|
371
|
-
logger?:
|
|
371
|
+
logger?: CopilotKitRuntimeLogger;
|
|
372
372
|
/**
|
|
373
373
|
* Runtime-bound telemetry capture. Optional so external implementations of
|
|
374
374
|
* this published interface remain source-compatible.
|
|
@@ -376,7 +376,7 @@ interface CopilotRuntimeLike {
|
|
|
376
376
|
telemetry?: TelemetryCapture;
|
|
377
377
|
/**
|
|
378
378
|
* Resolved inbound-header forwarding policy read by the /run and /connect call
|
|
379
|
-
* sites. Optional on the published interface so an external `
|
|
379
|
+
* sites. Optional on the published interface so an external `CopilotKitRuntimeLike`
|
|
380
380
|
* implementor predating this field stays source-compatible (non-breaking minor
|
|
381
381
|
* release). Concrete runtimes (`BaseCopilotRuntime`) always resolve and set it;
|
|
382
382
|
* the call sites coalesce a missing value to the default resolved policy
|
|
@@ -391,7 +391,7 @@ interface CopilotRuntimeLike {
|
|
|
391
391
|
sseKeepAliveIntervalSeconds?: number;
|
|
392
392
|
/**
|
|
393
393
|
* Resolved opt-in flag for the client-facing memory proxy routes. Optional on
|
|
394
|
-
* the published interface so an external `
|
|
394
|
+
* the published interface so an external `CopilotKitRuntimeLike` implementor
|
|
395
395
|
* predating this field stays source-compatible; the dispatcher coalesces a
|
|
396
396
|
* missing value to `false` (secure default — routes hidden). Concrete runtimes
|
|
397
397
|
* (`BaseCopilotRuntime`) always resolve and set it.
|
|
@@ -403,14 +403,14 @@ interface CopilotRuntimeLike {
|
|
|
403
403
|
* the default (`DEFAULT_THREAD_ACCESS`).
|
|
404
404
|
*/
|
|
405
405
|
threadAccess?: ThreadAccessMode;
|
|
406
|
-
memory?:
|
|
407
|
-
learning?:
|
|
406
|
+
memory?: CopilotKitRuntimeMemoryConfig;
|
|
407
|
+
learning?: CopilotKitRuntimeLearningConfig;
|
|
408
408
|
}
|
|
409
|
-
interface
|
|
409
|
+
interface CopilotKitSseRuntimeLike extends CopilotKitRuntimeLike {
|
|
410
410
|
intelligence?: undefined;
|
|
411
411
|
mode: typeof RUNTIME_MODE_SSE;
|
|
412
412
|
}
|
|
413
|
-
interface
|
|
413
|
+
interface CopilotKitIntelligenceRuntimeLike extends CopilotKitRuntimeLike {
|
|
414
414
|
intelligence: CopilotKitIntelligence;
|
|
415
415
|
identifyUser?: IdentifyUserCallback;
|
|
416
416
|
generateThreadNames: boolean;
|
|
@@ -418,32 +418,32 @@ interface CopilotIntelligenceRuntimeLike extends CopilotRuntimeLike {
|
|
|
418
418
|
lockKeyPrefix?: string;
|
|
419
419
|
lockHeartbeatIntervalSeconds: number;
|
|
420
420
|
channels: Channel[];
|
|
421
|
-
learning?:
|
|
421
|
+
learning?: CopilotKitRuntimeLearningConfig;
|
|
422
422
|
mode: typeof RUNTIME_MODE_INTELLIGENCE;
|
|
423
423
|
}
|
|
424
|
-
declare abstract class BaseCopilotRuntime implements
|
|
425
|
-
agents:
|
|
426
|
-
transcriptionService:
|
|
427
|
-
beforeRequestMiddleware:
|
|
428
|
-
afterRequestMiddleware:
|
|
424
|
+
declare abstract class BaseCopilotRuntime implements CopilotKitRuntimeLike {
|
|
425
|
+
agents: CopilotKitRuntimeOptions["agents"];
|
|
426
|
+
transcriptionService: CopilotKitRuntimeOptions["transcriptionService"];
|
|
427
|
+
beforeRequestMiddleware: CopilotKitRuntimeOptions["beforeRequestMiddleware"];
|
|
428
|
+
afterRequestMiddleware: CopilotKitRuntimeOptions["afterRequestMiddleware"];
|
|
429
429
|
runner: AgentRunner;
|
|
430
|
-
mcpApps:
|
|
431
|
-
openGenerativeUI:
|
|
432
|
-
generativeUI:
|
|
430
|
+
mcpApps: CopilotKitRuntimeOptions["mcpApps"];
|
|
431
|
+
openGenerativeUI: CopilotKitRuntimeOptions["openGenerativeUI"];
|
|
432
|
+
generativeUI: CopilotKitRuntimeOptions["generativeUI"];
|
|
433
433
|
readonly debugEventBus?: DebugEventBus;
|
|
434
434
|
debug: ResolvedDebugConfig;
|
|
435
|
-
debugLogger?:
|
|
436
|
-
readonly logger:
|
|
435
|
+
debugLogger?: CopilotKitRuntimeLogger;
|
|
436
|
+
readonly logger: CopilotKitRuntimeLogger;
|
|
437
437
|
readonly telemetry: TelemetryCapture;
|
|
438
438
|
readonly forwardHeadersPolicy: ResolvedForwardHeadersPolicy;
|
|
439
439
|
readonly sseKeepAliveIntervalSeconds: number;
|
|
440
440
|
readonly exposeMemoryRoutes: boolean;
|
|
441
441
|
readonly threadAccess: ThreadAccessMode;
|
|
442
|
-
readonly memory?:
|
|
442
|
+
readonly memory?: CopilotKitRuntimeMemoryConfig;
|
|
443
443
|
/**
|
|
444
444
|
* License token resolved once with the env fallback, so telemetry
|
|
445
445
|
* attribution (below) and subclass feature gating
|
|
446
|
-
* (
|
|
446
|
+
* (CopilotKitIntelligenceRuntime's getLicenseChecker) read the exact same value
|
|
447
447
|
* instead of each re-applying `?? COPILOTKIT_LICENSE_TOKEN`.
|
|
448
448
|
*/
|
|
449
449
|
protected readonly resolvedLicenseToken?: string;
|
|
@@ -453,13 +453,13 @@ declare abstract class BaseCopilotRuntime implements CopilotRuntimeLike {
|
|
|
453
453
|
getLicenseChecker(): Promise<LicenseChecker | undefined>;
|
|
454
454
|
constructor(options: BaseCopilotRuntimeOptions, runner: AgentRunner);
|
|
455
455
|
}
|
|
456
|
-
declare class
|
|
456
|
+
declare class CopilotKitSseRuntime extends BaseCopilotRuntime implements CopilotKitSseRuntimeLike {
|
|
457
457
|
readonly intelligence: any;
|
|
458
458
|
readonly mode: "sse";
|
|
459
459
|
readonly identifyUser?: IdentifyUserCallback;
|
|
460
|
-
constructor(options:
|
|
460
|
+
constructor(options: CopilotKitSseRuntimeOptions);
|
|
461
461
|
}
|
|
462
|
-
declare class
|
|
462
|
+
declare class CopilotKitIntelligenceRuntime extends BaseCopilotRuntime implements CopilotKitIntelligenceRuntimeLike {
|
|
463
463
|
readonly intelligence: CopilotKitIntelligence;
|
|
464
464
|
readonly identifyUser?: IdentifyUserCallback;
|
|
465
465
|
readonly generateThreadNames: boolean;
|
|
@@ -467,14 +467,14 @@ declare class CopilotIntelligenceRuntime extends BaseCopilotRuntime implements C
|
|
|
467
467
|
readonly lockKeyPrefix?: string;
|
|
468
468
|
readonly lockHeartbeatIntervalSeconds: number;
|
|
469
469
|
readonly channels: Channel[];
|
|
470
|
-
readonly learning?:
|
|
470
|
+
readonly learning?: CopilotKitRuntimeLearningConfig;
|
|
471
471
|
readonly mode: "intelligence";
|
|
472
472
|
private licenseCheckerPromise?;
|
|
473
473
|
/** Maximum allowed lock TTL in seconds (1 hour). */
|
|
474
474
|
static readonly MAX_LOCK_TTL_SECONDS = 3600;
|
|
475
475
|
/** Maximum allowed heartbeat interval in seconds (50 minutes). */
|
|
476
476
|
static readonly MAX_HEARTBEAT_INTERVAL_SECONDS = 3000;
|
|
477
|
-
constructor(options:
|
|
477
|
+
constructor(options: CopilotKitIntelligenceRuntimeOptions);
|
|
478
478
|
/**
|
|
479
479
|
* Verify the license token on first use, then reuse the result. Not done in
|
|
480
480
|
* the constructor: edge-safe (Web Crypto) verification is async, and
|
|
@@ -484,12 +484,12 @@ declare class CopilotIntelligenceRuntime extends BaseCopilotRuntime implements C
|
|
|
484
484
|
*/
|
|
485
485
|
getLicenseChecker(): Promise<LicenseChecker>;
|
|
486
486
|
}
|
|
487
|
-
declare function isIntelligenceRuntime(runtime:
|
|
487
|
+
declare function isIntelligenceRuntime(runtime: CopilotKitRuntimeLike): runtime is CopilotKitIntelligenceRuntimeLike;
|
|
488
488
|
/**
|
|
489
|
-
* Compile-time phantom brand marking a {@link
|
|
489
|
+
* Compile-time phantom brand marking a {@link CopilotKitRuntime} that was
|
|
490
490
|
* constructed with at least one declared Intelligence Channel. It has no runtime
|
|
491
491
|
* representation — the shim never sets this property; it exists purely so
|
|
492
|
-
* `
|
|
492
|
+
* `createCopilotKitRuntimeHandler` can tell, at the type level, that the resulting
|
|
493
493
|
* handler will carry a non-optional `.channels` control surface.
|
|
494
494
|
*/
|
|
495
495
|
interface RuntimeWithDeclaredChannels {
|
|
@@ -499,12 +499,12 @@ interface RuntimeWithDeclaredChannels {
|
|
|
499
499
|
readonly __copilotkitChannelsDeclared: true;
|
|
500
500
|
}
|
|
501
501
|
/**
|
|
502
|
-
* Instance shape of the {@link
|
|
503
|
-
* {@link
|
|
502
|
+
* Instance shape of the {@link CopilotKitRuntime} compatibility shim. Extends
|
|
503
|
+
* {@link CopilotKitRuntimeLike} with the Intelligence-only accessors the shim
|
|
504
504
|
* surfaces (all `undefined` in SSE mode). Declared explicitly so the exported
|
|
505
|
-
* `
|
|
505
|
+
* `CopilotKitRuntime` name resolves as a type as well as a value.
|
|
506
506
|
*/
|
|
507
|
-
interface
|
|
507
|
+
interface CopilotKitRuntime extends CopilotKitRuntimeLike {
|
|
508
508
|
/** Telemetry capture bound to this runtime's construction-time identity. */
|
|
509
509
|
telemetry: TelemetryCapture;
|
|
510
510
|
/** Auto-generate short thread names; `undefined` in SSE mode. */
|
|
@@ -518,14 +518,14 @@ interface CopilotRuntime extends CopilotRuntimeLike {
|
|
|
518
518
|
/** Declared Intelligence Channels; `undefined` in SSE mode. */
|
|
519
519
|
channels?: Channel[];
|
|
520
520
|
/** Learning Container selector; `undefined` in SSE mode. */
|
|
521
|
-
learning?:
|
|
521
|
+
learning?: CopilotKitRuntimeLearningConfig;
|
|
522
522
|
}
|
|
523
523
|
/**
|
|
524
|
-
* Constructor type for the {@link
|
|
524
|
+
* Constructor type for the {@link CopilotKitRuntime} compatibility shim.
|
|
525
525
|
*
|
|
526
526
|
* The first overload fires when the caller passes `intelligence` together with a
|
|
527
527
|
* non-empty `channels` tuple: it returns a {@link RuntimeWithDeclaredChannels}-
|
|
528
|
-
* branded runtime, which `
|
|
528
|
+
* branded runtime, which `createCopilotKitRuntimeHandler` maps to a handler whose
|
|
529
529
|
* `.channels` is non-optional. Every other configuration (SSE, or Intelligence
|
|
530
530
|
* without channels, or an empty `channels: []`) falls through to the second
|
|
531
531
|
* overload and stays unbranded, so its handler keeps `.channels` optional.
|
|
@@ -534,30 +534,30 @@ interface CopilotRuntime extends CopilotRuntimeLike {
|
|
|
534
534
|
* to the instance type), so the branding lives on this construct-signature
|
|
535
535
|
* interface instead of on the class itself.
|
|
536
536
|
*/
|
|
537
|
-
interface
|
|
537
|
+
interface CopilotKitRuntimeConstructor {
|
|
538
538
|
new (options: CopilotIntelligenceRuntimeBaseOptions & ({
|
|
539
539
|
identifyUser: IdentifyUserCallback;
|
|
540
|
-
memory?:
|
|
540
|
+
memory?: CopilotKitRuntimeMemoryConfig;
|
|
541
541
|
channels: NonEmptyChannels;
|
|
542
542
|
} | {
|
|
543
543
|
identifyUser?: undefined;
|
|
544
544
|
memory?: undefined;
|
|
545
545
|
channels: NonEmptyChannels;
|
|
546
|
-
})):
|
|
547
|
-
new (options:
|
|
546
|
+
})): CopilotKitRuntime & RuntimeWithDeclaredChannels;
|
|
547
|
+
new (options: CopilotKitRuntimeOptions): CopilotKitRuntime;
|
|
548
548
|
}
|
|
549
549
|
/**
|
|
550
|
-
* The public `
|
|
551
|
-
* but typed as {@link
|
|
550
|
+
* The public `CopilotKitRuntime` constructor. Backed by {@link CopilotRuntimeShim}
|
|
551
|
+
* but typed as {@link CopilotKitRuntimeConstructor} so that constructing with a
|
|
552
552
|
* non-empty `channels` array yields a {@link RuntimeWithDeclaredChannels}-branded
|
|
553
553
|
* runtime type.
|
|
554
554
|
*
|
|
555
555
|
* The `as unknown as` cast is required (not dishonest widening): the brand is a
|
|
556
556
|
* phantom, compile-time-only marker with no runtime representation, so the shim
|
|
557
557
|
* instances legitimately do not carry the brand property. Behavior is identical
|
|
558
|
-
* to the former `class
|
|
558
|
+
* to the former `class CopilotKitRuntime` — this only refines the static type.
|
|
559
559
|
*/
|
|
560
|
-
declare const
|
|
560
|
+
declare const CopilotKitRuntime: CopilotKitRuntimeConstructor;
|
|
561
561
|
//#endregion
|
|
562
|
-
export { A2UIVersion, AgentFactoryContext, AgentsConfig, AgentsFactory,
|
|
562
|
+
export { A2UIVersion, AgentFactoryContext, AgentsConfig, AgentsFactory, CopilotKitIntelligenceRuntime, CopilotKitIntelligenceRuntimeLike, CopilotKitIntelligenceRuntimeOptions, CopilotKitRuntime, CopilotKitRuntimeConstructor, CopilotKitRuntimeLike, CopilotKitRuntimeMemoryConfig, CopilotKitRuntimeOptions, CopilotKitSseRuntime, CopilotKitSseRuntimeLike, CopilotKitSseRuntimeOptions, GenerativeUIOptions, IdentifyUserCallback, McpAppsConfig, McpAppsServerConfig, MemoryAccess, MemoryConsumer, MemoryGrant, OpenGenerativeUIConfig, OpenGenerativeUIOptions, RuntimeWithDeclaredChannels, VERSION, isIntelligenceRuntime, resolveAgents };
|
|
563
563
|
//# sourceMappingURL=runtime.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../../src/runtime/core/runtime.ts"],"mappings":";;;;;;;;;;;;;;;;;;;cAmFa,OAAA;AAAA,UAEH,mCAAA;EAFoC;EAI5C,MAAA;AAAA;;KAIU,mBAAA,GAAsB,eAAA;EAJ1B,6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 @@ var BaseCopilotRuntime = class {
|
|
|
59
59
|
this.threadAccess = resolveThreadAccessMode(options.threads);
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
var
|
|
62
|
+
var CopilotKitSseRuntime = class extends BaseCopilotRuntime {
|
|
63
63
|
constructor(options) {
|
|
64
64
|
const channels = options.channels;
|
|
65
65
|
if (Array.isArray(channels) && channels.length > 0) throw new Error("`channels` requires the Intelligence runtime (pass `intelligence`); Intelligence Channels are not available in SSE mode.");
|
|
@@ -73,7 +73,7 @@ var CopilotSseRuntime = class extends BaseCopilotRuntime {
|
|
|
73
73
|
warnIfThreadListRefused(this);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
var
|
|
76
|
+
var CopilotKitIntelligenceRuntime = class CopilotKitIntelligenceRuntime extends BaseCopilotRuntime {
|
|
77
77
|
static {
|
|
78
78
|
this.MAX_LOCK_TTL_SECONDS = 3600;
|
|
79
79
|
}
|
|
@@ -92,7 +92,7 @@ var CopilotIntelligenceRuntime = class CopilotIntelligenceRuntime extends BaseCo
|
|
|
92
92
|
if (rawOptions.memory !== void 0 && (typeof rawOptions.memory !== "object" || rawOptions.memory === null || typeof rawOptions.memory.access !== "function")) throw new Error("Intelligence Runtime `memory.access` must be a callback");
|
|
93
93
|
if (rawOptions.memory !== void 0 && !hasWebIdentity) throw new Error("Intelligence Runtime web `memory` requires `identifyUser`");
|
|
94
94
|
if (rawOptions.ɵlearning !== void 0 && (typeof rawOptions.ɵlearning !== "object" || rawOptions.ɵlearning === null || !(typeof rawOptions.ɵlearning.containerId === "string" || typeof rawOptions.ɵlearning.containerId === "function"))) throw new Error("Intelligence Runtime `ɵlearning.containerId` must be a stable ID or callback");
|
|
95
|
-
if (rawOptions.ɵlearning !== void 0 && options.intelligence.ɵgetLearningContainerId?.() !== void 0) throw new Error("Configure Learning Containers with `getLearningContainerId` on `CopilotKitIntelligence`; do not also pass deprecated `ɵlearning` to `
|
|
95
|
+
if (rawOptions.ɵlearning !== void 0 && options.intelligence.ɵgetLearningContainerId?.() !== void 0) throw new Error("Configure Learning Containers with `getLearningContainerId` on `CopilotKitIntelligence`; do not also pass deprecated `ɵlearning` to `CopilotKitRuntime`");
|
|
96
96
|
if (typeof rawOptions.ɵlearning?.containerId === "string") assertStableLearningContainerId(rawOptions.ɵlearning.containerId);
|
|
97
97
|
super(options, new IntelligenceAgentRunner({
|
|
98
98
|
url: options.intelligence.ɵgetRunnerWsUrl(),
|
|
@@ -107,9 +107,9 @@ var CopilotIntelligenceRuntime = class CopilotIntelligenceRuntime extends BaseCo
|
|
|
107
107
|
this.learning = options.ɵlearning;
|
|
108
108
|
this.identifyUser = hasWebIdentity ? rawOptions.identifyUser : void 0;
|
|
109
109
|
this.generateThreadNames = options.generateThreadNames ?? true;
|
|
110
|
-
this.lockTtlSeconds = Math.min(options.lockTtlSeconds ?? 20,
|
|
110
|
+
this.lockTtlSeconds = Math.min(options.lockTtlSeconds ?? 20, CopilotKitIntelligenceRuntime.MAX_LOCK_TTL_SECONDS);
|
|
111
111
|
this.lockKeyPrefix = options.lockKeyPrefix;
|
|
112
|
-
this.lockHeartbeatIntervalSeconds = Math.min(options.lockHeartbeatIntervalSeconds ?? 15,
|
|
112
|
+
this.lockHeartbeatIntervalSeconds = Math.min(options.lockHeartbeatIntervalSeconds ?? 15, CopilotKitIntelligenceRuntime.MAX_HEARTBEAT_INTERVAL_SECONDS);
|
|
113
113
|
this.channels = [...rawOptions.channels ?? []];
|
|
114
114
|
for (const c of this.channels) if (!c || typeof c !== "object" || !c.name) throw new Error("Intelligence Channel is missing a `name` — pass createChannel({ name }) for each Channel in `channels`");
|
|
115
115
|
}
|
|
@@ -132,16 +132,16 @@ function isIntelligenceRuntime(runtime) {
|
|
|
132
132
|
return runtime.mode === RUNTIME_MODE_INTELLIGENCE && !!runtime.intelligence;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Compatibility shim that preserves the legacy `
|
|
136
|
-
* New code should prefer `
|
|
135
|
+
* Compatibility shim that preserves the legacy `CopilotKitRuntime` entrypoint.
|
|
136
|
+
* New code should prefer `CopilotKitSseRuntime` or `CopilotKitIntelligenceRuntime`.
|
|
137
137
|
*
|
|
138
|
-
* Exported to consumers as the {@link
|
|
139
|
-
* {@link
|
|
138
|
+
* Exported to consumers as the {@link CopilotKitRuntime} value (typed as
|
|
139
|
+
* {@link CopilotKitRuntimeConstructor}) rather than as a class, so that the
|
|
140
140
|
* channel-presence brand can flow from construction into the handler type.
|
|
141
141
|
*/
|
|
142
142
|
var CopilotRuntimeShim = class {
|
|
143
143
|
constructor(options) {
|
|
144
|
-
this.delegate = hasIntelligenceOptions(options) ? new
|
|
144
|
+
this.delegate = hasIntelligenceOptions(options) ? new CopilotKitIntelligenceRuntime(options) : new CopilotKitSseRuntime(options);
|
|
145
145
|
const reporter = getRuntimeErrorReporterFromOptions(options);
|
|
146
146
|
if (reporter) attachRuntimeErrorReporter(this, reporter);
|
|
147
147
|
}
|
|
@@ -231,18 +231,18 @@ var CopilotRuntimeShim = class {
|
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
233
|
/**
|
|
234
|
-
* The public `
|
|
235
|
-
* but typed as {@link
|
|
234
|
+
* The public `CopilotKitRuntime` constructor. Backed by {@link CopilotRuntimeShim}
|
|
235
|
+
* but typed as {@link CopilotKitRuntimeConstructor} so that constructing with a
|
|
236
236
|
* non-empty `channels` array yields a {@link RuntimeWithDeclaredChannels}-branded
|
|
237
237
|
* runtime type.
|
|
238
238
|
*
|
|
239
239
|
* The `as unknown as` cast is required (not dishonest widening): the brand is a
|
|
240
240
|
* phantom, compile-time-only marker with no runtime representation, so the shim
|
|
241
241
|
* instances legitimately do not carry the brand property. Behavior is identical
|
|
242
|
-
* to the former `class
|
|
242
|
+
* to the former `class CopilotKitRuntime` — this only refines the static type.
|
|
243
243
|
*/
|
|
244
|
-
const
|
|
244
|
+
const CopilotKitRuntime = CopilotRuntimeShim;
|
|
245
245
|
|
|
246
246
|
//#endregion
|
|
247
|
-
export {
|
|
247
|
+
export { CopilotKitIntelligenceRuntime, CopilotKitRuntime, CopilotKitSseRuntime, VERSION, isIntelligenceRuntime, resolveAgents };
|
|
248
248
|
//# sourceMappingURL=runtime.mjs.map
|