@copilotkit/runtime 2.0.0-rc.42 → 2.0.0-rc.44
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/dist/agent/converters/aisdk.cjs +1 -1
- package/dist/agent/converters/aisdk.mjs +1 -1
- package/dist/agent/converters/tanstack.cjs +1 -1
- package/dist/agent/converters/tanstack.mjs +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +3 -2
- package/dist/runtime/core/package-info.cjs +1 -1
- package/dist/runtime/core/package-info.mjs +1 -1
- package/dist/runtime/core/runtime.cjs +1 -19
- package/dist/runtime/core/runtime.cjs.map +1 -1
- package/dist/runtime/core/runtime.d.cts +77 -29
- package/dist/runtime/core/runtime.d.cts.map +1 -1
- package/dist/runtime/core/runtime.d.mts +77 -29
- package/dist/runtime/core/runtime.d.mts.map +1 -1
- package/dist/runtime/core/runtime.mjs +2 -19
- package/dist/runtime/core/runtime.mjs.map +1 -1
- package/dist/runtime/event-transforms/recorded-events.cjs +4 -0
- package/dist/runtime/event-transforms/recorded-events.cjs.map +1 -1
- package/dist/runtime/event-transforms/recorded-events.d.cts +5 -1
- package/dist/runtime/event-transforms/recorded-events.d.cts.map +1 -1
- package/dist/runtime/event-transforms/recorded-events.d.mts +5 -1
- package/dist/runtime/event-transforms/recorded-events.d.mts.map +1 -1
- package/dist/runtime/event-transforms/recorded-events.mjs +4 -0
- package/dist/runtime/event-transforms/recorded-events.mjs.map +1 -1
- package/dist/runtime/generative-ui/a2ui-v09-actions.cjs +106 -0
- package/dist/runtime/generative-ui/a2ui-v09-actions.cjs.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-actions.mjs +106 -0
- package/dist/runtime/generative-ui/a2ui-v09-actions.mjs.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-catalog.cjs +422 -0
- package/dist/runtime/generative-ui/a2ui-v09-catalog.cjs.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-catalog.mjs +422 -0
- package/dist/runtime/generative-ui/a2ui-v09-catalog.mjs.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.cjs +84 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.cjs.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.d.cts +41 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.d.cts.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.d.mts +41 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.d.mts.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.mjs +83 -0
- package/dist/runtime/generative-ui/a2ui-v09-middleware.mjs.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-operations.cjs +620 -0
- package/dist/runtime/generative-ui/a2ui-v09-operations.cjs.map +1 -0
- package/dist/runtime/generative-ui/a2ui-v09-operations.mjs +620 -0
- package/dist/runtime/generative-ui/a2ui-v09-operations.mjs.map +1 -0
- package/dist/runtime/generative-ui/index.d.cts +1 -0
- package/dist/runtime/generative-ui/index.d.mts +1 -0
- package/dist/runtime/handlers/get-runtime-info.cjs +19 -5
- package/dist/runtime/handlers/get-runtime-info.cjs.map +1 -1
- package/dist/runtime/handlers/get-runtime-info.mjs +20 -6
- package/dist/runtime/handlers/get-runtime-info.mjs.map +1 -1
- package/dist/runtime/handlers/handle-run.cjs +0 -2
- package/dist/runtime/handlers/handle-run.cjs.map +1 -1
- package/dist/runtime/handlers/handle-run.mjs +0 -2
- package/dist/runtime/handlers/handle-run.mjs.map +1 -1
- package/dist/runtime/handlers/shared/agent-utils.cjs +17 -14
- package/dist/runtime/handlers/shared/agent-utils.cjs.map +1 -1
- package/dist/runtime/handlers/shared/agent-utils.mjs +18 -15
- package/dist/runtime/handlers/shared/agent-utils.mjs.map +1 -1
- package/dist/runtime/index.d.cts +2 -1
- package/dist/runtime/index.d.mts +2 -1
- package/package.json +6 -6
|
@@ -33,37 +33,98 @@ interface McpAppsConfig {
|
|
|
33
33
|
}
|
|
34
34
|
interface OpenGenerativeUIOptions extends BaseCopilotRuntimeMiddlewareOptions {}
|
|
35
35
|
type OpenGenerativeUIConfig = boolean | OpenGenerativeUIOptions;
|
|
36
|
-
|
|
36
|
+
/** An A2UI protocol version that an agent speaks. */
|
|
37
|
+
type A2UIVersion = "0.9" | "1.0";
|
|
38
|
+
/**
|
|
39
|
+
* Options of {@link CopilotRuntimeMiddlewares.generativeUI}.
|
|
40
|
+
*
|
|
41
|
+
* The client renders A2UI 1.0 only. An agent that speaks A2UI v0.9 is set
|
|
42
|
+
* to `"0.9"` with `a2uiVersion`: the runtime then gives it the v0.9 tool and
|
|
43
|
+
* catalog, and converts its surfaces to 1.0 for the client and the clicks
|
|
44
|
+
* on them back to v0.9 for the agent.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* new CopilotRuntime({
|
|
49
|
+
* agents: { legacy: legacyAgent, current: currentAgent },
|
|
50
|
+
* generativeUI: { a2uiVersion: { legacy: "0.9" } },
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
interface GenerativeUIOptions extends BaseCopilotRuntimeMiddlewareOptions {
|
|
55
|
+
/**
|
|
56
|
+
* The A2UI version that the agents speak. Default: `"1.0"`.
|
|
57
|
+
*
|
|
58
|
+
* - `"1.0"`: the agent gets the `render_ui` tool and the generative UI
|
|
59
|
+
* guide.
|
|
60
|
+
* - `"0.9"`: the agent gets the `render_a2ui` tool of
|
|
61
|
+
* `@ag-ui/a2ui-middleware`, its guide, and the v0.9 component schema of
|
|
62
|
+
* the client's catalog. It does not get `render_ui`.
|
|
63
|
+
* - A record of agent id to version: one version for each agent. An agent
|
|
64
|
+
* that is not in the record speaks `"1.0"`.
|
|
65
|
+
*
|
|
66
|
+
* For both versions, the runtime converts the v0.9 surfaces that a run
|
|
67
|
+
* emits (for example, from a tool result) to 1.0, and turns a click on a
|
|
68
|
+
* converted surface back into a v0.9 action.
|
|
69
|
+
*/
|
|
70
|
+
a2uiVersion?: A2UIVersion | Record<string, A2UIVersion>;
|
|
71
|
+
/**
|
|
72
|
+
* v0.9 agents only. The component schema for `A2UIMiddleware` to add to
|
|
73
|
+
* the agent's context. It replaces the schema that the runtime makes from
|
|
74
|
+
* the client's catalog.
|
|
75
|
+
*/
|
|
76
|
+
schema?: A2UIMiddlewareConfig["schema"];
|
|
77
|
+
/**
|
|
78
|
+
* v0.9 agents only. The generation lifecycle options of `A2UIMiddleware`:
|
|
79
|
+
* `debugExposure`, `showProgressTokens` and `maxAttempts`.
|
|
80
|
+
*/
|
|
81
|
+
recovery?: A2UIMiddlewareConfig["recovery"];
|
|
82
|
+
/**
|
|
83
|
+
* v0.9 agents only. Adds the A2UI render tool to the agent's tools: `true`
|
|
84
|
+
* adds `render_a2ui`, a string adds it with that name, and `false` adds no
|
|
85
|
+
* tool. Default: `true` when the client sends a generative UI catalog
|
|
86
|
+
* with the "tool" transport.
|
|
87
|
+
*/
|
|
88
|
+
injectA2UITool?: A2UIMiddlewareConfig["injectA2UITool"];
|
|
89
|
+
/**
|
|
90
|
+
* v0.9 agents only. The tool names that `A2UIMiddleware` streams into
|
|
91
|
+
* surfaces. Default: `["render_a2ui"]`.
|
|
92
|
+
*/
|
|
93
|
+
a2uiToolNames?: A2UIMiddlewareConfig["a2uiToolNames"];
|
|
94
|
+
/**
|
|
95
|
+
* v0.9 agents only. The tool names that `A2UIMiddleware` treats as
|
|
96
|
+
* generation wrappers: a render call inside one of them belongs to it.
|
|
97
|
+
* Left out, every tool can wrap a render call. Use `[]` when there are no
|
|
98
|
+
* generation wrappers.
|
|
99
|
+
*/
|
|
100
|
+
a2uiGenerationToolNames?: A2UIMiddlewareConfig["a2uiGenerationToolNames"];
|
|
37
101
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
102
|
+
* v0.9 agents only. The catalog id of the surfaces that `A2UIMiddleware`
|
|
103
|
+
* creates from a streamed render tool call. Default: the catalog id of the
|
|
104
|
+
* component schema in the agent's context.
|
|
40
105
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
};
|
|
106
|
+
defaultCatalogId?: A2UIMiddlewareConfig["defaultCatalogId"];
|
|
107
|
+
}
|
|
108
|
+
interface CopilotRuntimeMiddlewares {
|
|
50
109
|
/** Auto-apply MCPAppsMiddleware to agents at run time. */
|
|
51
110
|
mcpApps?: McpAppsConfig;
|
|
52
111
|
/** Auto-apply OpenGenerativeUIMiddleware to agents at run time. */
|
|
53
112
|
openGenerativeUI?: OpenGenerativeUIConfig;
|
|
54
113
|
/**
|
|
55
|
-
*
|
|
114
|
+
* CopilotKit generative UI surfaces (A2UI 1.0).
|
|
56
115
|
*
|
|
57
116
|
* - Omitted: applied to a run when the React provider sends a
|
|
58
117
|
* tool-transport envelope (`forwardedProps.copilotkit.ui`).
|
|
59
118
|
* - `true`: applied to every run.
|
|
60
|
-
* -
|
|
119
|
+
* - An object: applied to every run of `agents` (all agents when
|
|
120
|
+
* omitted). See {@link GenerativeUIOptions}, which also sets the A2UI
|
|
121
|
+
* version of each agent with `a2uiVersion`.
|
|
61
122
|
* - `false`: never applied.
|
|
62
123
|
*
|
|
63
124
|
* A run with a markdown-transport envelope never gets it: the model writes
|
|
64
125
|
* the UI in a2ui code fences, and the client renders them.
|
|
65
126
|
*/
|
|
66
|
-
generativeUI?: boolean |
|
|
127
|
+
generativeUI?: boolean | GenerativeUIOptions;
|
|
67
128
|
}
|
|
68
129
|
/**
|
|
69
130
|
* Context passed to agent factory functions for per-request agent resolution.
|
|
@@ -286,7 +347,6 @@ interface CopilotRuntimeLike {
|
|
|
286
347
|
beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
|
|
287
348
|
afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
|
|
288
349
|
runner: AgentRunner;
|
|
289
|
-
a2ui: CopilotRuntimeOptions["a2ui"];
|
|
290
350
|
mcpApps: CopilotRuntimeOptions["mcpApps"];
|
|
291
351
|
openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
|
|
292
352
|
generativeUI?: CopilotRuntimeOptions["generativeUI"];
|
|
@@ -367,7 +427,6 @@ declare abstract class BaseCopilotRuntime implements CopilotRuntimeLike {
|
|
|
367
427
|
beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
|
|
368
428
|
afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
|
|
369
429
|
runner: AgentRunner;
|
|
370
|
-
a2ui: CopilotRuntimeOptions["a2ui"];
|
|
371
430
|
mcpApps: CopilotRuntimeOptions["mcpApps"];
|
|
372
431
|
openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
|
|
373
432
|
generativeUI: CopilotRuntimeOptions["generativeUI"];
|
|
@@ -426,17 +485,6 @@ declare class CopilotIntelligenceRuntime extends BaseCopilotRuntime implements C
|
|
|
426
485
|
getLicenseChecker(): Promise<LicenseChecker>;
|
|
427
486
|
}
|
|
428
487
|
declare function isIntelligenceRuntime(runtime: CopilotRuntimeLike): runtime is CopilotIntelligenceRuntimeLike;
|
|
429
|
-
/**
|
|
430
|
-
* Single source of truth for "is A2UI on for this runtime?". Both the run path
|
|
431
|
-
* (which applies `A2UIMiddleware`) and the `/info` response (which tells the
|
|
432
|
-
* client whether to mount the A2UI renderer + catalog context) MUST go through
|
|
433
|
-
* this, so they can never disagree — the divergence between them was the root
|
|
434
|
-
* of CopilotKit/CopilotKit#5369.
|
|
435
|
-
*
|
|
436
|
-
* Backwards compatible: any config object is enabled (matching the historical
|
|
437
|
-
* `!!runtime.a2ui`); only an explicit `enabled: false` turns it off.
|
|
438
|
-
*/
|
|
439
|
-
declare function isA2UIEnabled(a2ui: CopilotRuntimeOptions["a2ui"]): a2ui is NonNullable<CopilotRuntimeOptions["a2ui"]>;
|
|
440
488
|
/**
|
|
441
489
|
* Compile-time phantom brand marking a {@link CopilotRuntime} that was
|
|
442
490
|
* constructed with at least one declared Intelligence Channel. It has no runtime
|
|
@@ -511,5 +559,5 @@ interface CopilotRuntimeConstructor {
|
|
|
511
559
|
*/
|
|
512
560
|
declare const CopilotRuntime: CopilotRuntimeConstructor;
|
|
513
561
|
//#endregion
|
|
514
|
-
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,
|
|
562
|
+
export { A2UIVersion, AgentFactoryContext, AgentsConfig, AgentsFactory, CopilotIntelligenceRuntime, CopilotIntelligenceRuntimeLike, CopilotIntelligenceRuntimeOptions, CopilotRuntime, CopilotRuntimeConstructor, CopilotRuntimeLike, CopilotRuntimeMemoryConfig, CopilotRuntimeOptions, CopilotSseRuntime, CopilotSseRuntimeLike, CopilotSseRuntimeOptions, GenerativeUIOptions, IdentifyUserCallback, McpAppsConfig, McpAppsServerConfig, MemoryAccess, MemoryConsumer, MemoryGrant, OpenGenerativeUIConfig, OpenGenerativeUIOptions, RuntimeWithDeclaredChannels, VERSION, isIntelligenceRuntime, resolveAgents };
|
|
515
563
|
//# sourceMappingURL=runtime.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.cts","names":[],"sources":["../../../src/runtime/core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;AAAA;;;;;;;;;;;;cAiK3B,cAAA,EAAgB,yBAAA"}
|
|
@@ -33,37 +33,98 @@ interface McpAppsConfig {
|
|
|
33
33
|
}
|
|
34
34
|
interface OpenGenerativeUIOptions extends BaseCopilotRuntimeMiddlewareOptions {}
|
|
35
35
|
type OpenGenerativeUIConfig = boolean | OpenGenerativeUIOptions;
|
|
36
|
-
|
|
36
|
+
/** An A2UI protocol version that an agent speaks. */
|
|
37
|
+
type A2UIVersion = "0.9" | "1.0";
|
|
38
|
+
/**
|
|
39
|
+
* Options of {@link CopilotRuntimeMiddlewares.generativeUI}.
|
|
40
|
+
*
|
|
41
|
+
* The client renders A2UI 1.0 only. An agent that speaks A2UI v0.9 is set
|
|
42
|
+
* to `"0.9"` with `a2uiVersion`: the runtime then gives it the v0.9 tool and
|
|
43
|
+
* catalog, and converts its surfaces to 1.0 for the client and the clicks
|
|
44
|
+
* on them back to v0.9 for the agent.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* new CopilotRuntime({
|
|
49
|
+
* agents: { legacy: legacyAgent, current: currentAgent },
|
|
50
|
+
* generativeUI: { a2uiVersion: { legacy: "0.9" } },
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
interface GenerativeUIOptions extends BaseCopilotRuntimeMiddlewareOptions {
|
|
55
|
+
/**
|
|
56
|
+
* The A2UI version that the agents speak. Default: `"1.0"`.
|
|
57
|
+
*
|
|
58
|
+
* - `"1.0"`: the agent gets the `render_ui` tool and the generative UI
|
|
59
|
+
* guide.
|
|
60
|
+
* - `"0.9"`: the agent gets the `render_a2ui` tool of
|
|
61
|
+
* `@ag-ui/a2ui-middleware`, its guide, and the v0.9 component schema of
|
|
62
|
+
* the client's catalog. It does not get `render_ui`.
|
|
63
|
+
* - A record of agent id to version: one version for each agent. An agent
|
|
64
|
+
* that is not in the record speaks `"1.0"`.
|
|
65
|
+
*
|
|
66
|
+
* For both versions, the runtime converts the v0.9 surfaces that a run
|
|
67
|
+
* emits (for example, from a tool result) to 1.0, and turns a click on a
|
|
68
|
+
* converted surface back into a v0.9 action.
|
|
69
|
+
*/
|
|
70
|
+
a2uiVersion?: A2UIVersion | Record<string, A2UIVersion>;
|
|
71
|
+
/**
|
|
72
|
+
* v0.9 agents only. The component schema for `A2UIMiddleware` to add to
|
|
73
|
+
* the agent's context. It replaces the schema that the runtime makes from
|
|
74
|
+
* the client's catalog.
|
|
75
|
+
*/
|
|
76
|
+
schema?: A2UIMiddlewareConfig["schema"];
|
|
77
|
+
/**
|
|
78
|
+
* v0.9 agents only. The generation lifecycle options of `A2UIMiddleware`:
|
|
79
|
+
* `debugExposure`, `showProgressTokens` and `maxAttempts`.
|
|
80
|
+
*/
|
|
81
|
+
recovery?: A2UIMiddlewareConfig["recovery"];
|
|
82
|
+
/**
|
|
83
|
+
* v0.9 agents only. Adds the A2UI render tool to the agent's tools: `true`
|
|
84
|
+
* adds `render_a2ui`, a string adds it with that name, and `false` adds no
|
|
85
|
+
* tool. Default: `true` when the client sends a generative UI catalog
|
|
86
|
+
* with the "tool" transport.
|
|
87
|
+
*/
|
|
88
|
+
injectA2UITool?: A2UIMiddlewareConfig["injectA2UITool"];
|
|
89
|
+
/**
|
|
90
|
+
* v0.9 agents only. The tool names that `A2UIMiddleware` streams into
|
|
91
|
+
* surfaces. Default: `["render_a2ui"]`.
|
|
92
|
+
*/
|
|
93
|
+
a2uiToolNames?: A2UIMiddlewareConfig["a2uiToolNames"];
|
|
94
|
+
/**
|
|
95
|
+
* v0.9 agents only. The tool names that `A2UIMiddleware` treats as
|
|
96
|
+
* generation wrappers: a render call inside one of them belongs to it.
|
|
97
|
+
* Left out, every tool can wrap a render call. Use `[]` when there are no
|
|
98
|
+
* generation wrappers.
|
|
99
|
+
*/
|
|
100
|
+
a2uiGenerationToolNames?: A2UIMiddlewareConfig["a2uiGenerationToolNames"];
|
|
37
101
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
102
|
+
* v0.9 agents only. The catalog id of the surfaces that `A2UIMiddleware`
|
|
103
|
+
* creates from a streamed render tool call. Default: the catalog id of the
|
|
104
|
+
* component schema in the agent's context.
|
|
40
105
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
};
|
|
106
|
+
defaultCatalogId?: A2UIMiddlewareConfig["defaultCatalogId"];
|
|
107
|
+
}
|
|
108
|
+
interface CopilotRuntimeMiddlewares {
|
|
50
109
|
/** Auto-apply MCPAppsMiddleware to agents at run time. */
|
|
51
110
|
mcpApps?: McpAppsConfig;
|
|
52
111
|
/** Auto-apply OpenGenerativeUIMiddleware to agents at run time. */
|
|
53
112
|
openGenerativeUI?: OpenGenerativeUIConfig;
|
|
54
113
|
/**
|
|
55
|
-
*
|
|
114
|
+
* CopilotKit generative UI surfaces (A2UI 1.0).
|
|
56
115
|
*
|
|
57
116
|
* - Omitted: applied to a run when the React provider sends a
|
|
58
117
|
* tool-transport envelope (`forwardedProps.copilotkit.ui`).
|
|
59
118
|
* - `true`: applied to every run.
|
|
60
|
-
* -
|
|
119
|
+
* - An object: applied to every run of `agents` (all agents when
|
|
120
|
+
* omitted). See {@link GenerativeUIOptions}, which also sets the A2UI
|
|
121
|
+
* version of each agent with `a2uiVersion`.
|
|
61
122
|
* - `false`: never applied.
|
|
62
123
|
*
|
|
63
124
|
* A run with a markdown-transport envelope never gets it: the model writes
|
|
64
125
|
* the UI in a2ui code fences, and the client renders them.
|
|
65
126
|
*/
|
|
66
|
-
generativeUI?: boolean |
|
|
127
|
+
generativeUI?: boolean | GenerativeUIOptions;
|
|
67
128
|
}
|
|
68
129
|
/**
|
|
69
130
|
* Context passed to agent factory functions for per-request agent resolution.
|
|
@@ -286,7 +347,6 @@ interface CopilotRuntimeLike {
|
|
|
286
347
|
beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
|
|
287
348
|
afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
|
|
288
349
|
runner: AgentRunner;
|
|
289
|
-
a2ui: CopilotRuntimeOptions["a2ui"];
|
|
290
350
|
mcpApps: CopilotRuntimeOptions["mcpApps"];
|
|
291
351
|
openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
|
|
292
352
|
generativeUI?: CopilotRuntimeOptions["generativeUI"];
|
|
@@ -367,7 +427,6 @@ declare abstract class BaseCopilotRuntime implements CopilotRuntimeLike {
|
|
|
367
427
|
beforeRequestMiddleware: CopilotRuntimeOptions["beforeRequestMiddleware"];
|
|
368
428
|
afterRequestMiddleware: CopilotRuntimeOptions["afterRequestMiddleware"];
|
|
369
429
|
runner: AgentRunner;
|
|
370
|
-
a2ui: CopilotRuntimeOptions["a2ui"];
|
|
371
430
|
mcpApps: CopilotRuntimeOptions["mcpApps"];
|
|
372
431
|
openGenerativeUI: CopilotRuntimeOptions["openGenerativeUI"];
|
|
373
432
|
generativeUI: CopilotRuntimeOptions["generativeUI"];
|
|
@@ -426,17 +485,6 @@ declare class CopilotIntelligenceRuntime extends BaseCopilotRuntime implements C
|
|
|
426
485
|
getLicenseChecker(): Promise<LicenseChecker>;
|
|
427
486
|
}
|
|
428
487
|
declare function isIntelligenceRuntime(runtime: CopilotRuntimeLike): runtime is CopilotIntelligenceRuntimeLike;
|
|
429
|
-
/**
|
|
430
|
-
* Single source of truth for "is A2UI on for this runtime?". Both the run path
|
|
431
|
-
* (which applies `A2UIMiddleware`) and the `/info` response (which tells the
|
|
432
|
-
* client whether to mount the A2UI renderer + catalog context) MUST go through
|
|
433
|
-
* this, so they can never disagree — the divergence between them was the root
|
|
434
|
-
* of CopilotKit/CopilotKit#5369.
|
|
435
|
-
*
|
|
436
|
-
* Backwards compatible: any config object is enabled (matching the historical
|
|
437
|
-
* `!!runtime.a2ui`); only an explicit `enabled: false` turns it off.
|
|
438
|
-
*/
|
|
439
|
-
declare function isA2UIEnabled(a2ui: CopilotRuntimeOptions["a2ui"]): a2ui is NonNullable<CopilotRuntimeOptions["a2ui"]>;
|
|
440
488
|
/**
|
|
441
489
|
* Compile-time phantom brand marking a {@link CopilotRuntime} that was
|
|
442
490
|
* constructed with at least one declared Intelligence Channel. It has no runtime
|
|
@@ -511,5 +559,5 @@ interface CopilotRuntimeConstructor {
|
|
|
511
559
|
*/
|
|
512
560
|
declare const CopilotRuntime: CopilotRuntimeConstructor;
|
|
513
561
|
//#endregion
|
|
514
|
-
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,
|
|
562
|
+
export { A2UIVersion, AgentFactoryContext, AgentsConfig, AgentsFactory, CopilotIntelligenceRuntime, CopilotIntelligenceRuntimeLike, CopilotIntelligenceRuntimeOptions, CopilotRuntime, CopilotRuntimeConstructor, CopilotRuntimeLike, CopilotRuntimeMemoryConfig, CopilotRuntimeOptions, CopilotSseRuntime, CopilotSseRuntimeLike, CopilotSseRuntimeOptions, GenerativeUIOptions, IdentifyUserCallback, McpAppsConfig, McpAppsServerConfig, MemoryAccess, MemoryConsumer, MemoryGrant, OpenGenerativeUIConfig, OpenGenerativeUIOptions, RuntimeWithDeclaredChannels, VERSION, isIntelligenceRuntime, resolveAgents };
|
|
515
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,6FAMN,OAAA,GAAU,MAAA,kBAFmB;EAI7B,OAAA;AAAA;AAAA,UAGe,aAAA;EALf;EAOA,OAAA,EAAS,mBAAA;AAAA;AAAA,UAGM,uBAAA,SAAgC,mCAAA;AAAA,KAErC,sBAAA,aAAmC,uBAAA;
|
|
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,6FAMN,OAAA,GAAU,MAAA,kBAFmB;EAI7B,OAAA;AAAA;AAAA,UAGe,aAAA;EALf;EAOA,OAAA,EAAS,mBAAA;AAAA;AAAA,UAGM,uBAAA,SAAgC,mCAAA;AAAA,KAErC,sBAAA,aAAmC,uBAAA;;KAGnC,WAAA;;;AALZ;;;;;AAEA;;;;;AAGA;;;;UAkBiB,mBAAA,SAA4B,mCAAA;EAA5B;;;;;;;;;;;;;;;EAgBf,WAAA,GAAc,WAAA,GAAc,MAAA,SAAe,WAAA;EAA3C;;;;;EAMA,MAAA,GAAS,oBAAA;EAKT;;;;EAAA,QAAA,GAAW,oBAAA;EAYK;;;;;;EALhB,cAAA,GAAiB,oBAAA;EAqBT;;;;EAhBR,aAAA,GAAgB,oBAAA;EAmCS;;;;;;EA5BzB,uBAAA,GAA0B,oBAAA;EA4B1B;;;;AAMF;EA5BE,gBAAA,GAAmB,oBAAA;AAAA;AAAA,UAGX,yBAAA;EA2BQ;EAzBhB,OAAA,GAAU,aAAA;EAgCa;EA9BvB,gBAAA,GAAmB,sBAAA;EA+Bd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A,GAAiB,2BAAA;EAAA,KACf,OAAA,EAAS,qBAAA,GAAwB,cAAA;AAAA;;;;;;;;;;;;cAiK3B,cAAA,EAAgB,yBAAA"}
|
|
@@ -36,12 +36,11 @@ var BaseCopilotRuntime = class {
|
|
|
36
36
|
constructor(options, runner) {
|
|
37
37
|
this.logger = getRuntimeLogger(options);
|
|
38
38
|
logRuntimeTelemetryDisclosure(this.logger);
|
|
39
|
-
const { agents, transcriptionService, beforeRequestMiddleware, afterRequestMiddleware,
|
|
39
|
+
const { agents, transcriptionService, beforeRequestMiddleware, afterRequestMiddleware, mcpApps, openGenerativeUI, generativeUI } = options;
|
|
40
40
|
this.agents = agents;
|
|
41
41
|
this.transcriptionService = transcriptionService;
|
|
42
42
|
this.beforeRequestMiddleware = beforeRequestMiddleware;
|
|
43
43
|
this.afterRequestMiddleware = afterRequestMiddleware;
|
|
44
|
-
this.a2ui = a2ui || void 0;
|
|
45
44
|
this.mcpApps = mcpApps;
|
|
46
45
|
this.openGenerativeUI = openGenerativeUI;
|
|
47
46
|
this.generativeUI = generativeUI;
|
|
@@ -133,19 +132,6 @@ function isIntelligenceRuntime(runtime) {
|
|
|
133
132
|
return runtime.mode === RUNTIME_MODE_INTELLIGENCE && !!runtime.intelligence;
|
|
134
133
|
}
|
|
135
134
|
/**
|
|
136
|
-
* Single source of truth for "is A2UI on for this runtime?". Both the run path
|
|
137
|
-
* (which applies `A2UIMiddleware`) and the `/info` response (which tells the
|
|
138
|
-
* client whether to mount the A2UI renderer + catalog context) MUST go through
|
|
139
|
-
* this, so they can never disagree — the divergence between them was the root
|
|
140
|
-
* of CopilotKit/CopilotKit#5369.
|
|
141
|
-
*
|
|
142
|
-
* Backwards compatible: any config object is enabled (matching the historical
|
|
143
|
-
* `!!runtime.a2ui`); only an explicit `enabled: false` turns it off.
|
|
144
|
-
*/
|
|
145
|
-
function isA2UIEnabled(a2ui) {
|
|
146
|
-
return !!a2ui && a2ui.enabled !== false;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
135
|
* Compatibility shim that preserves the legacy `CopilotRuntime` entrypoint.
|
|
150
136
|
* New code should prefer `CopilotSseRuntime` or `CopilotIntelligenceRuntime`.
|
|
151
137
|
*
|
|
@@ -174,9 +160,6 @@ var CopilotRuntimeShim = class {
|
|
|
174
160
|
get runner() {
|
|
175
161
|
return this.delegate.runner;
|
|
176
162
|
}
|
|
177
|
-
get a2ui() {
|
|
178
|
-
return this.delegate.a2ui;
|
|
179
|
-
}
|
|
180
163
|
get mcpApps() {
|
|
181
164
|
return this.delegate.mcpApps;
|
|
182
165
|
}
|
|
@@ -261,5 +244,5 @@ var CopilotRuntimeShim = class {
|
|
|
261
244
|
const CopilotRuntime = CopilotRuntimeShim;
|
|
262
245
|
|
|
263
246
|
//#endregion
|
|
264
|
-
export { CopilotIntelligenceRuntime, CopilotRuntime, CopilotSseRuntime, VERSION,
|
|
247
|
+
export { CopilotIntelligenceRuntime, CopilotRuntime, CopilotSseRuntime, VERSION, isIntelligenceRuntime, resolveAgents };
|
|
265
248
|
//# sourceMappingURL=runtime.mjs.map
|