@copilotkit/vue 2.0.0-rc.7 → 2.0.0-rc.9
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/hooks/use-copilot-action.d.ts.map +1 -1
- package/dist/hooks/use-frontend-tool.d.ts +1 -1
- package/dist/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/hooks/zod-parameters.d.ts +14 -0
- package/dist/hooks/zod-parameters.d.ts.map +1 -0
- package/dist/index.cjs +1 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +353 -16906
- package/dist/index.mjs.map +1 -1
- package/dist/use-render-activity-message-B59A4R48.js +18097 -0
- package/dist/use-render-activity-message-B59A4R48.js.map +1 -0
- package/dist/use-render-activity-message-u0OVXjd8.cjs +92 -0
- package/dist/use-render-activity-message-u0OVXjd8.cjs.map +1 -0
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts.map +1 -1
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts +13 -45
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts +1 -1
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts +13 -5
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts.map +1 -1
- package/dist/v2/components/a2ui.d.ts +3 -7
- package/dist/v2/components/a2ui.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +6 -270
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts +1 -1
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallItem.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts +0 -1
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts.map +1 -1
- package/dist/v2/components/chat/index.d.ts +0 -1
- package/dist/v2/components/chat/index.d.ts.map +1 -1
- package/dist/v2/components/chat/tool-call-display-context.d.ts +2 -19
- package/dist/v2/components/chat/tool-call-display-context.d.ts.map +1 -1
- package/dist/v2/components/chat/tool-call-group-parts.d.ts +7 -20
- package/dist/v2/components/chat/tool-call-group-parts.d.ts.map +1 -1
- package/dist/v2/components/chat/turn-work.d.ts +0 -2
- package/dist/v2/components/chat/turn-work.d.ts.map +1 -1
- package/dist/v2/components/chat/types.d.ts +1 -2
- package/dist/v2/components/chat/types.d.ts.map +1 -1
- package/dist/v2/components/chat/use-chat-labels.d.ts +8 -0
- package/dist/v2/components/chat/use-chat-labels.d.ts.map +1 -0
- package/dist/v2/components/icons/index.d.ts +968 -1
- package/dist/v2/components/icons/index.d.ts.map +1 -1
- package/dist/v2/hooks/use-frontend-tool.d.ts +5 -0
- package/dist/v2/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-activity-message.d.ts +13 -9
- package/dist/v2/hooks/use-render-activity-message.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-custom-messages.d.ts +5 -7
- package/dist/v2/hooks/use-render-custom-messages.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +197 -200
- package/dist/v2/index.mjs.map +1 -1
- package/dist/v2/lib/processPartialHtml.d.ts +1 -2
- package/dist/v2/lib/processPartialHtml.d.ts.map +1 -1
- package/dist/v2/lib/vue-core.d.ts +0 -1
- package/dist/v2/lib/vue-core.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/types.d.ts +3 -46
- package/dist/v2/providers/types.d.ts.map +1 -1
- package/dist/v2/types/human-in-the-loop.d.ts +8 -29
- package/dist/v2/types/human-in-the-loop.d.ts.map +1 -1
- package/dist/v2/types/interrupt.d.ts +1 -22
- package/dist/v2/types/interrupt.d.ts.map +1 -1
- package/dist/v2/types/vue-activity-message-renderer.d.ts +16 -15
- package/dist/v2/types/vue-activity-message-renderer.d.ts.map +1 -1
- package/dist/v2/types/vue-custom-message-renderer.d.ts +7 -16
- package/dist/v2/types/vue-custom-message-renderer.d.ts.map +1 -1
- package/dist/v2/types/vue-tool-call-renderer.d.ts +16 -35
- package/dist/v2/types/vue-tool-call-renderer.d.ts.map +1 -1
- package/package.json +10 -11
- package/src/__tests__/build-entries.test.ts +27 -0
- package/src/hooks/__tests__/zod-parameters.test.ts +520 -0
- package/src/hooks/use-copilot-action.ts +2 -1
- package/src/hooks/use-frontend-tool.ts +3 -6
- package/src/hooks/zod-parameters.ts +162 -0
- package/src/v2/components/A2UIMessageRenderer.ts +3 -3
- package/src/v2/components/LicenseWarningBanner.vue +31 -15
- package/src/v2/components/OpenGenerativeUIRenderer.ts +51 -373
- package/src/v2/components/__tests__/A2UICatalogContext.test.ts +1 -1
- package/src/v2/components/__tests__/LicenseWarningBanner.test.ts +20 -0
- package/src/v2/components/__tests__/OpenGenerativeUIRenderer.test.ts +55 -6
- package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +1 -1
- package/src/v2/components/a2ui/A2UICatalogContext.ts +10 -102
- package/src/v2/components/a2ui/A2UIRecoveryStates.ts +1 -1
- package/src/v2/components/a2ui.ts +1 -1
- package/src/v2/components/chat/CopilotChat.vue +19 -40
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +14 -10
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +14 -6
- package/src/v2/components/chat/CopilotChatInput.vue +40 -30
- package/src/v2/components/chat/CopilotChatMessageView.vue +72 -140
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +31 -13
- package/src/v2/components/chat/CopilotChatToolCallGroup.vue +60 -37
- package/src/v2/components/chat/CopilotChatToolCallItem.vue +3 -3
- package/src/v2/components/chat/CopilotChatToolCallsView.vue +15 -13
- package/src/v2/components/chat/CopilotChatView.vue +5 -5
- package/src/v2/components/chat/CopilotChatWorkSummary.vue +44 -18
- package/src/v2/components/chat/__tests__/CopilotChat.labels.test.ts +19 -4
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +26 -9
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +33 -1
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.test.ts +247 -403
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.toolCallDisplay.test.ts +1 -99
- package/src/v2/components/chat/copilotChatToolCallItemRender.ts +3 -19
- package/src/v2/components/chat/index.ts +0 -1
- package/src/v2/components/chat/tool-call-display-context.ts +2 -23
- package/src/v2/components/chat/tool-call-group-parts.ts +44 -85
- package/src/v2/components/chat/turn-work.ts +0 -9
- package/src/v2/components/chat/types.ts +4 -4
- package/src/v2/components/chat/use-chat-labels.ts +16 -0
- package/src/v2/components/icons/__tests__/icons.test.ts +72 -68
- package/src/v2/components/icons/index.ts +109 -27
- package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.ts +62 -1
- package/src/v2/hooks/__tests__/use-render-activity-message.test.ts +105 -0
- package/src/v2/hooks/__tests__/use-render-tool.test.ts +3 -6
- package/src/v2/hooks/__tests__/zod-regression.test.ts +5 -4
- package/src/v2/hooks/use-frontend-tool.ts +10 -10
- package/src/v2/hooks/use-render-activity-message.ts +27 -48
- package/src/v2/hooks/use-render-custom-messages.ts +14 -35
- package/src/v2/lib/processPartialHtml.ts +6 -21
- package/src/v2/lib/vue-core.ts +3 -5
- package/src/v2/providers/CopilotKitProvider.vue +53 -112
- package/src/v2/providers/__tests__/CopilotKitProvider.a2ui.test.ts +1 -1
- package/src/v2/providers/__tests__/CopilotKitProvider.headersAtSendTime.test.ts +3 -3
- package/src/v2/providers/__tests__/CopilotKitProvider.learning.test.ts +3 -1
- package/src/v2/providers/__tests__/CopilotKitProvider.test.ts +17 -0
- package/src/v2/providers/types.ts +3 -49
- package/src/v2/types/__tests__/defineToolCallRenderer.test.ts +28 -33
- package/src/v2/types/defineToolCallRenderer.ts +5 -4
- package/src/v2/types/human-in-the-loop.ts +8 -32
- package/src/v2/types/interrupt.ts +7 -31
- package/src/v2/types/vue-activity-message-renderer.ts +24 -15
- package/src/v2/types/vue-custom-message-renderer.ts +12 -16
- package/src/v2/types/vue-tool-call-renderer.ts +23 -38
- package/vite.config.ts +3 -4
- package/dist/v2/components/chat/BasicMarkdown.vue.d.ts +0 -9
- package/dist/v2/components/chat/BasicMarkdown.vue.d.ts.map +0 -1
- package/dist/v2/components/chat/tool-call-layout.d.ts +0 -115
- package/dist/v2/components/chat/tool-call-layout.d.ts.map +0 -1
- package/dist/v2/lib/transcription-client.d.ts +0 -19
- package/dist/v2/lib/transcription-client.d.ts.map +0 -1
- package/src/v2/components/chat/BasicMarkdown.vue +0 -160
- package/src/v2/components/chat/__tests__/BasicMarkdown.test.ts +0 -69
- package/src/v2/components/chat/tool-call-layout.ts +0 -304
- package/src/v2/lib/__tests__/processPartialHtml.test.ts +0 -84
- package/src/v2/lib/__tests__/transcription-client.test.ts +0 -67
- package/src/v2/lib/transcription-client.ts +0 -151
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
GENERATE_SANDBOXED_UI_DESCRIPTION,
|
|
4
4
|
randomUUID,
|
|
5
|
+
ɵanySchema,
|
|
5
6
|
} from "@copilotkit/shared";
|
|
6
7
|
import {
|
|
7
8
|
computed,
|
|
8
9
|
h,
|
|
9
10
|
onMounted,
|
|
11
|
+
onUnmounted,
|
|
10
12
|
provide,
|
|
11
13
|
ref,
|
|
12
14
|
shallowRef,
|
|
15
|
+
toRaw,
|
|
13
16
|
triggerRef,
|
|
14
17
|
watch,
|
|
15
18
|
} from "vue";
|
|
16
19
|
import type { Component, FunctionalComponent } from "vue";
|
|
17
|
-
import { z } from "zod";
|
|
18
20
|
import type { AbstractAgent } from "@ag-ui/client";
|
|
19
21
|
import { ToolCallStatus } from "@copilotkit/core";
|
|
20
22
|
import type {
|
|
@@ -23,13 +25,17 @@ import type {
|
|
|
23
25
|
CopilotKitHeadersSource,
|
|
24
26
|
FrontendTool,
|
|
25
27
|
} from "@copilotkit/core";
|
|
26
|
-
import {
|
|
28
|
+
import {
|
|
29
|
+
DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL,
|
|
30
|
+
GENERATE_SANDBOXED_UI_TOOL_NAME,
|
|
31
|
+
ɵresolveLicenseState,
|
|
32
|
+
ɵwithHeaderDefaults,
|
|
33
|
+
} from "@copilotkit/core";
|
|
27
34
|
import { schemaToJsonSchema, shouldEnableInspector } from "@copilotkit/shared";
|
|
28
35
|
import type {
|
|
29
36
|
RuntimeEntitlementResponse,
|
|
30
37
|
RuntimeLicenseStatus,
|
|
31
38
|
} from "@copilotkit/shared";
|
|
32
|
-
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
33
39
|
import { CopilotKitCoreVue } from "../lib/vue-core";
|
|
34
40
|
import { createA2UIMessageRenderer } from "../components/A2UIMessageRenderer";
|
|
35
41
|
import { registerA2UIBuiltInToolCallRenderer } from "../components/a2ui/A2UIBuiltInToolCallRenderer";
|
|
@@ -54,11 +60,7 @@ import {
|
|
|
54
60
|
} from "./keys";
|
|
55
61
|
import type { VueInspectorOpenRequest } from "./keys";
|
|
56
62
|
import { MARKDOWN_RENDERER_KEY } from "./markdown-renderer";
|
|
57
|
-
import {
|
|
58
|
-
LicenseContextKey,
|
|
59
|
-
createLicenseContextValue,
|
|
60
|
-
} from "./license-context";
|
|
61
|
-
import type { LicenseContextValue } from "./license-context";
|
|
63
|
+
import { LicenseContextKey } from "./license-context";
|
|
62
64
|
import CopilotKitInspector from "../components/CopilotKitInspector.vue";
|
|
63
65
|
import LicenseWarningBanner from "../components/LicenseWarningBanner.vue";
|
|
64
66
|
import type {
|
|
@@ -93,16 +95,6 @@ const SANDBOX_FUNCTIONS_STABLE_WARNING =
|
|
|
93
95
|
// interrupt reads the same across frameworks (see #5554).
|
|
94
96
|
const HUMAN_IN_THE_LOOP_ABORTED_MESSAGE =
|
|
95
97
|
"Human-in-the-loop interaction aborted";
|
|
96
|
-
const DEFAULT_DESIGN_SKILL = `When generating UI with generateSandboxedUi, follow these design principles inspired by shadcn/ui:
|
|
97
|
-
|
|
98
|
-
- Use a minimal, flat aesthetic. Avoid drop shadows and gradients — rely on subtle borders (1px solid, light gray like #e5e7eb) to define surfaces.
|
|
99
|
-
- Neutral base palette: white backgrounds, zinc/slate gray text (#09090b for headings, #71717a for secondary text). One accent color for interactive elements.
|
|
100
|
-
- Use system font stacks (system-ui, -apple-system, sans-serif) at readable sizes (14px body, 600 weight for headings). Tight line-heights.
|
|
101
|
-
- Small, consistent border-radius (6–8px). Cards and containers use border, not shadow, for separation.
|
|
102
|
-
- Buttons: solid fill for primary (dark bg, white text), outline for secondary (border + transparent bg). Subtle hover state (slight opacity or background shift).
|
|
103
|
-
- Use CSS Grid or Flexbox for layout. Ensure the UI looks good at any width.
|
|
104
|
-
- Minimal transitions (150ms) for hover/focus states only. No decorative animations.
|
|
105
|
-
- Keep the UI focused and dense — avoid excessive padding. Use compact spacing (8–12px gaps, 10–14px padding in controls).`;
|
|
106
98
|
|
|
107
99
|
/** The MCP Apps renderer with `mcpApps.allowSameOriginFallback` applied. */
|
|
108
100
|
const SameOriginMCPAppsActivityRenderer: FunctionalComponent = (_, { attrs }) =>
|
|
@@ -167,6 +159,12 @@ const initialRenderCustomMessages = props.renderCustomMessages;
|
|
|
167
159
|
const initialRenderActivityMessages = props.renderActivityMessages;
|
|
168
160
|
const initialSandboxFunctions = props.openGenerativeUI?.sandboxFunctions;
|
|
169
161
|
|
|
162
|
+
// Props that come from reactive state arrive as deep proxies. Zod 4 schemas
|
|
163
|
+
// break behind a Vue proxy (their `_zod` property is read-only and
|
|
164
|
+
// non-configurable), so read tools and renderers through their raw objects.
|
|
165
|
+
const rawEntries = <T>(entries: readonly T[] | undefined): T[] =>
|
|
166
|
+
[...toRaw(entries ?? [])].map((entry) => toRaw(entry));
|
|
167
|
+
|
|
170
168
|
watch(
|
|
171
169
|
() => props.frontendTools,
|
|
172
170
|
(next) => {
|
|
@@ -299,7 +297,7 @@ const processedHumanInTheLoop = computed(() => {
|
|
|
299
297
|
const tools: FrontendTool[] = [];
|
|
300
298
|
const renderToolCalls: VueToolCallRenderer<unknown>[] = [];
|
|
301
299
|
|
|
302
|
-
for (const tool of props.humanInTheLoop) {
|
|
300
|
+
for (const tool of rawEntries(props.humanInTheLoop)) {
|
|
303
301
|
tools.push({
|
|
304
302
|
type: "human-in-the-loop",
|
|
305
303
|
name: tool.name,
|
|
@@ -365,7 +363,7 @@ const processedHumanInTheLoop = computed(() => {
|
|
|
365
363
|
|
|
366
364
|
renderToolCalls.push({
|
|
367
365
|
name: tool.name,
|
|
368
|
-
args: tool.parameters ??
|
|
366
|
+
args: tool.parameters ?? ɵanySchema,
|
|
369
367
|
render,
|
|
370
368
|
...(tool.agentId && { agentId: tool.agentId }),
|
|
371
369
|
} as VueToolCallRenderer<unknown>);
|
|
@@ -376,7 +374,7 @@ const processedHumanInTheLoop = computed(() => {
|
|
|
376
374
|
|
|
377
375
|
const allTools = computed(() => {
|
|
378
376
|
const tools: FrontendTool[] = [];
|
|
379
|
-
for (const t of props.frontendTools) {
|
|
377
|
+
for (const t of rawEntries(props.frontendTools)) {
|
|
380
378
|
tools.push(t as FrontendTool);
|
|
381
379
|
}
|
|
382
380
|
for (const t of builtInFrontendTools.value) {
|
|
@@ -388,11 +386,15 @@ const allTools = computed(() => {
|
|
|
388
386
|
|
|
389
387
|
const allRenderToolCalls = computed(() => {
|
|
390
388
|
const combined: VueToolCallRenderer<unknown>[] = [
|
|
391
|
-
...(props.renderToolCalls
|
|
389
|
+
...rawEntries(props.renderToolCalls),
|
|
392
390
|
];
|
|
393
|
-
for (const tool of [
|
|
391
|
+
for (const tool of [
|
|
392
|
+
...rawEntries(props.frontendTools),
|
|
393
|
+
...builtInFrontendTools.value,
|
|
394
|
+
]) {
|
|
394
395
|
if (tool.render) {
|
|
395
|
-
const args =
|
|
396
|
+
const args =
|
|
397
|
+
tool.parameters ?? (tool.name === "*" ? ɵanySchema : undefined);
|
|
396
398
|
if (args) {
|
|
397
399
|
combined.push({
|
|
398
400
|
name: tool.name,
|
|
@@ -434,23 +436,14 @@ const resolvedProperties = computed(() =>
|
|
|
434
436
|
? { ...props.properties, a2uiCatalogAvailable: true }
|
|
435
437
|
: props.properties,
|
|
436
438
|
);
|
|
437
|
-
const sandboxFunctions = computed<readonly SandboxFunction[]>(
|
|
438
|
-
(
|
|
439
|
+
const sandboxFunctions = computed<readonly SandboxFunction[]>(() =>
|
|
440
|
+
rawEntries(props.openGenerativeUI?.sandboxFunctions),
|
|
439
441
|
);
|
|
440
|
-
const zodToJsonSchemaCompat = (
|
|
441
|
-
schema: unknown,
|
|
442
|
-
options?: { $refStrategy?: string },
|
|
443
|
-
): Record<string, unknown> =>
|
|
444
|
-
zodToJsonSchema(
|
|
445
|
-
schema as z.ZodTypeAny,
|
|
446
|
-
options as { $refStrategy?: "none" | "relative" | "root" | "seen" },
|
|
447
|
-
) as Record<string, unknown>;
|
|
448
|
-
|
|
449
442
|
const builtInFrontendTools = computed<VueFrontendTool[]>(() => {
|
|
450
443
|
if (!openGenerativeUIActive.value) return [];
|
|
451
444
|
return [
|
|
452
445
|
{
|
|
453
|
-
name:
|
|
446
|
+
name: GENERATE_SANDBOXED_UI_TOOL_NAME,
|
|
454
447
|
description: GENERATE_SANDBOXED_UI_DESCRIPTION,
|
|
455
448
|
parameters: GenerateSandboxedUiArgsSchema,
|
|
456
449
|
handler: async () => "UI generated",
|
|
@@ -469,7 +462,7 @@ const builtInActivityRenderers = computed<
|
|
|
469
462
|
const renderers: VueActivityMessageRenderer<unknown>[] = [
|
|
470
463
|
{
|
|
471
464
|
activityType: MCPAppsActivityType,
|
|
472
|
-
content: MCPAppsActivityContentSchema
|
|
465
|
+
content: MCPAppsActivityContentSchema,
|
|
473
466
|
render: (props.mcpApps?.allowSameOriginFallback
|
|
474
467
|
? SameOriginMCPAppsActivityRenderer
|
|
475
468
|
: MCPAppsActivityRenderer) as unknown as VueActivityMessageRenderer<unknown>["render"],
|
|
@@ -479,7 +472,7 @@ const builtInActivityRenderers = computed<
|
|
|
479
472
|
if (openGenerativeUIActive.value) {
|
|
480
473
|
renderers.push({
|
|
481
474
|
activityType: OpenGenerativeUIActivityType,
|
|
482
|
-
content: OpenGenerativeUIContentSchema
|
|
475
|
+
content: OpenGenerativeUIContentSchema,
|
|
483
476
|
render:
|
|
484
477
|
OpenGenerativeUIActivityRenderer as unknown as VueActivityMessageRenderer<unknown>["render"],
|
|
485
478
|
});
|
|
@@ -500,7 +493,7 @@ const builtInActivityRenderers = computed<
|
|
|
500
493
|
});
|
|
501
494
|
|
|
502
495
|
const allRenderActivityMessages = computed(() => [
|
|
503
|
-
...(props.renderActivityMessages
|
|
496
|
+
...rawEntries(props.renderActivityMessages),
|
|
504
497
|
...builtInActivityRenderers.value,
|
|
505
498
|
]);
|
|
506
499
|
|
|
@@ -850,7 +843,7 @@ watch(
|
|
|
850
843
|
copilotkit.value.addContext({
|
|
851
844
|
description:
|
|
852
845
|
"Design guidelines for the generateSandboxedUi tool. Follow these when building UI.",
|
|
853
|
-
value: designSkill ??
|
|
846
|
+
value: designSkill ?? DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL,
|
|
854
847
|
}),
|
|
855
848
|
);
|
|
856
849
|
|
|
@@ -859,9 +852,7 @@ watch(
|
|
|
859
852
|
functions.map((fn) => ({
|
|
860
853
|
name: fn.name,
|
|
861
854
|
description: fn.description,
|
|
862
|
-
parameters: schemaToJsonSchema(fn.parameters,
|
|
863
|
-
zodToJsonSchema: zodToJsonSchemaCompat,
|
|
864
|
-
}),
|
|
855
|
+
parameters: schemaToJsonSchema(fn.parameters),
|
|
865
856
|
})),
|
|
866
857
|
);
|
|
867
858
|
ids.push(
|
|
@@ -894,73 +885,26 @@ provide(CopilotKitKey, {
|
|
|
894
885
|
provide(SandboxFunctionsKey, sandboxFunctions);
|
|
895
886
|
provide(MARKDOWN_RENDERER_KEY, props.markdownRenderer);
|
|
896
887
|
|
|
897
|
-
// License context
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
);
|
|
908
|
-
const hasLegacyRuntimeEntitlementFallback = computed(
|
|
909
|
-
() =>
|
|
910
|
-
runtimeLicenseStatus.value === "valid" ||
|
|
911
|
-
runtimeLicenseStatus.value === "expiring",
|
|
912
|
-
);
|
|
913
|
-
const runtimeEntitlementRetryInProgress = computed(
|
|
914
|
-
() =>
|
|
915
|
-
retryableRuntimeEntitlementFailure.value &&
|
|
916
|
-
runtimeEntitlementRetryPending.value &&
|
|
917
|
-
!hasLegacyRuntimeEntitlementFallback.value,
|
|
918
|
-
);
|
|
919
|
-
// Only a terminal failure denies features. A retryable failure (a timeout,
|
|
920
|
-
// a network error, a 5xx) says nothing about what the project may use.
|
|
921
|
-
const terminalRuntimeEntitlementFailure = computed(
|
|
922
|
-
() =>
|
|
923
|
-
hasNonReadyRuntimeEntitlement.value &&
|
|
924
|
-
!retryableRuntimeEntitlementFailure.value &&
|
|
925
|
-
!hasLegacyRuntimeEntitlementFallback.value,
|
|
926
|
-
);
|
|
927
|
-
const licenseContextValue = computed<LicenseContextValue>(() => {
|
|
928
|
-
const runtimeLicenseContext = createLicenseContextValue(
|
|
929
|
-
runtimeEntitlementRetryInProgress.value
|
|
930
|
-
? undefined
|
|
931
|
-
: runtimeLicenseStatus.value,
|
|
932
|
-
runtimeEntitlements.value,
|
|
933
|
-
);
|
|
934
|
-
if (!terminalRuntimeEntitlementFailure.value) {
|
|
935
|
-
return runtimeLicenseContext;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
return {
|
|
939
|
-
...runtimeLicenseContext,
|
|
940
|
-
checkFeature: () => false,
|
|
941
|
-
getLimit: () => null,
|
|
942
|
-
};
|
|
943
|
-
});
|
|
888
|
+
// License context and banner, from the runtime license status and the
|
|
889
|
+
// structured entitlement response.
|
|
890
|
+
const licenseState = computed(() =>
|
|
891
|
+
ɵresolveLicenseState({
|
|
892
|
+
status: runtimeLicenseStatus.value,
|
|
893
|
+
entitlements: runtimeEntitlements.value,
|
|
894
|
+
retryPending: runtimeEntitlementRetryPending.value,
|
|
895
|
+
publicKey: resolvedPublicKey.value,
|
|
896
|
+
}),
|
|
897
|
+
);
|
|
898
|
+
const licenseContextValue = computed(() => licenseState.value.context);
|
|
944
899
|
provide(LicenseContextKey, licenseContextValue);
|
|
900
|
+
const licenseBannerType = computed(() => licenseState.value.bannerType);
|
|
945
901
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
);
|
|
951
|
-
|
|
952
|
-
() =>
|
|
953
|
-
runtimeLicenseWarningStatus.value === "none" && !resolvedPublicKey.value,
|
|
954
|
-
);
|
|
955
|
-
const showExpiredBanner = computed(
|
|
956
|
-
() => runtimeLicenseWarningStatus.value === "expired",
|
|
957
|
-
);
|
|
958
|
-
const showInvalidBanner = computed(
|
|
959
|
-
() => runtimeLicenseWarningStatus.value === "invalid",
|
|
960
|
-
);
|
|
961
|
-
const showExpiringBanner = computed(
|
|
962
|
-
() => runtimeLicenseWarningStatus.value === "expiring",
|
|
963
|
-
);
|
|
902
|
+
// The provider created this core, so it stops the core's runs, timers and
|
|
903
|
+
// subscriptions. `onUnmounted` runs after the children unmount, so their
|
|
904
|
+
// cleanup still reaches a live core.
|
|
905
|
+
onUnmounted(() => {
|
|
906
|
+
copilotkit.value.dispose();
|
|
907
|
+
});
|
|
964
908
|
</script>
|
|
965
909
|
|
|
966
910
|
<template>
|
|
@@ -971,8 +915,5 @@ const showExpiringBanner = computed(
|
|
|
971
915
|
:open-request="inspectorOpenRequest"
|
|
972
916
|
/>
|
|
973
917
|
<!-- License warnings — driven by server-reported status -->
|
|
974
|
-
<LicenseWarningBanner v-if="
|
|
975
|
-
<LicenseWarningBanner v-if="showExpiredBanner" type="expired" />
|
|
976
|
-
<LicenseWarningBanner v-if="showInvalidBanner" type="invalid" />
|
|
977
|
-
<LicenseWarningBanner v-if="showExpiringBanner" type="expiring" />
|
|
918
|
+
<LicenseWarningBanner v-if="licenseBannerType" :type="licenseBannerType" />
|
|
978
919
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { defineComponent, h, ref } from "vue";
|
|
3
3
|
import { mount } from "@vue/test-utils";
|
|
4
|
-
import { z } from "zod";
|
|
4
|
+
import { z } from "zod-v3";
|
|
5
5
|
import { Catalog } from "@a2ui/web_core/v0_9";
|
|
6
6
|
import type { ComponentApi } from "@a2ui/web_core/v0_9";
|
|
7
7
|
import CopilotKitProvider from "../CopilotKitProvider.vue";
|
|
@@ -7,12 +7,12 @@ import { mount } from "@vue/test-utils";
|
|
|
7
7
|
import { defineComponent, h, nextTick } from "vue";
|
|
8
8
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
9
9
|
import { HttpAgent } from "@ag-ui/client";
|
|
10
|
+
import { ɵtranscribeAudio } from "@copilotkit/core";
|
|
10
11
|
import type { CopilotKitHeadersSource } from "@copilotkit/core";
|
|
11
12
|
import CopilotKitProvider from "../CopilotKitProvider.vue";
|
|
12
13
|
import { useCopilotKit } from "../useCopilotKit";
|
|
13
14
|
import { useAgent } from "../../hooks/use-agent";
|
|
14
15
|
import { useThreads } from "../../hooks/use-threads";
|
|
15
|
-
import { transcribeAudio } from "../../lib/transcription-client";
|
|
16
16
|
import type { CopilotKitCoreVue } from "../../lib/vue-core";
|
|
17
17
|
|
|
18
18
|
type Call = { url: string; auth: string | null; publicApiKey: string | null };
|
|
@@ -418,14 +418,14 @@ describe("CopilotKitProvider — headers builder evaluated at send time (#1937)"
|
|
|
418
418
|
// Force an actual resolution while signed in, so the header source's
|
|
419
419
|
// last snapshot is non-empty — otherwise a stale-merge bug has nothing
|
|
420
420
|
// stale to leak, and the assertion below would pass vacuously.
|
|
421
|
-
await
|
|
421
|
+
await ɵtranscribeAudio(getCore(), new Blob(["a"], { type: "audio/webm" }));
|
|
422
422
|
const firstCall = calls.find((c) => c.url.endsWith("/transcribe"));
|
|
423
423
|
expect(firstCall?.auth).toBe("Bearer x");
|
|
424
424
|
|
|
425
425
|
calls.length = 0;
|
|
426
426
|
signedIn = false;
|
|
427
427
|
|
|
428
|
-
await
|
|
428
|
+
await ɵtranscribeAudio(getCore(), new Blob(["a"], { type: "audio/webm" }));
|
|
429
429
|
const secondCall = calls.find((c) => c.url.endsWith("/transcribe"));
|
|
430
430
|
expect(secondCall).toBeDefined();
|
|
431
431
|
expect(secondCall!.auth).toBeNull();
|
|
@@ -478,7 +478,9 @@ describe("CopilotKitProvider learning prop", () => {
|
|
|
478
478
|
const app = renderApp(true);
|
|
479
479
|
|
|
480
480
|
await app.unmount();
|
|
481
|
-
|
|
481
|
+
// The learning watcher stops capture, then disposing the core stops
|
|
482
|
+
// it again. Stopping twice is safe; capture must end either way.
|
|
483
|
+
expect(stop).toHaveBeenCalled();
|
|
482
484
|
expect(History.prototype.pushState).toBe(nativePushState);
|
|
483
485
|
});
|
|
484
486
|
|
|
@@ -810,6 +810,23 @@ describe("CopilotKitProvider", () => {
|
|
|
810
810
|
});
|
|
811
811
|
});
|
|
812
812
|
|
|
813
|
+
describe("Unmount", () => {
|
|
814
|
+
it("disposes the core it created, so subscribers stop hearing from it", () => {
|
|
815
|
+
const { getCore, wrapper } = mountWithProvider(() => h("div"));
|
|
816
|
+
const core = getCore();
|
|
817
|
+
const onPropertiesChanged = vi.fn();
|
|
818
|
+
core.subscribe({ onPropertiesChanged });
|
|
819
|
+
|
|
820
|
+
core.setProperties({ before: "unmount" });
|
|
821
|
+
expect(onPropertiesChanged).toHaveBeenCalledTimes(1);
|
|
822
|
+
|
|
823
|
+
wrapper.unmount();
|
|
824
|
+
core.setProperties({ after: "unmount" });
|
|
825
|
+
|
|
826
|
+
expect(onPropertiesChanged).toHaveBeenCalledTimes(1);
|
|
827
|
+
});
|
|
828
|
+
});
|
|
829
|
+
|
|
813
830
|
describe("inspector visibility", () => {
|
|
814
831
|
async function settleInspectorLoad(): Promise<void> {
|
|
815
832
|
await vi.dynamicImportSettled();
|
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
chatInputPlaceholder: "Type a message...",
|
|
3
|
-
chatInputToolbarStartTranscribeButtonLabel: "Transcribe",
|
|
4
|
-
chatInputToolbarCancelTranscribeButtonLabel: "Cancel",
|
|
5
|
-
chatInputToolbarFinishTranscribeButtonLabel: "Finish",
|
|
6
|
-
chatInputToolbarAddButtonLabel: "Add photos or files",
|
|
7
|
-
chatInputToolbarToolsButtonLabel: "Tools",
|
|
8
|
-
chatInputToolbarSendButtonLabel: "Send message",
|
|
9
|
-
chatInputToolbarStopButtonLabel: "Stop",
|
|
10
|
-
assistantMessageToolbarCopyCodeLabel: "Copy",
|
|
11
|
-
assistantMessageToolbarCopyCodeCopiedLabel: "Copied",
|
|
12
|
-
assistantMessageToolbarCopyMessageLabel: "Copy",
|
|
13
|
-
assistantMessageToolbarInspectorLabel: "View in Inspector",
|
|
14
|
-
assistantMessageToolbarInspectorDescription:
|
|
15
|
-
"Open this message in the Inspector",
|
|
16
|
-
assistantMessageToolbarInspectorLocalOnlyLabel: "Local only",
|
|
17
|
-
assistantMessageToolbarInspectorLocalOnlyDescription:
|
|
18
|
-
"Only visible on localhost or loopback hosts in development. Never shown in production.",
|
|
19
|
-
assistantMessageToolbarInspectorTitle: "CopilotKit Inspector",
|
|
20
|
-
assistantMessageToolbarInspectorHideLabel: "Hide this icon",
|
|
21
|
-
assistantMessageToolbarInspectorHideDescription: "Until you reload this page",
|
|
22
|
-
assistantMessageToolbarThumbsUpLabel: "Good response",
|
|
23
|
-
assistantMessageToolbarThumbsDownLabel: "Bad response",
|
|
24
|
-
assistantMessageFeedbackCommentPlaceholder: "Add a comment (optional)",
|
|
25
|
-
assistantMessageFeedbackCommentSubmitLabel: "Send comment",
|
|
26
|
-
assistantMessageToolbarReadAloudLabel: "Read aloud",
|
|
27
|
-
assistantMessageToolbarRegenerateLabel: "Regenerate",
|
|
28
|
-
userMessageToolbarCopyMessageLabel: "Copy",
|
|
29
|
-
userMessageToolbarEditMessageLabel: "Edit",
|
|
30
|
-
userMessageToolbarPreviousBranchLabel: "Previous branch",
|
|
31
|
-
userMessageToolbarNextBranchLabel: "Next branch",
|
|
32
|
-
chatDisclaimerText:
|
|
33
|
-
"AI can make mistakes. Please verify important information.",
|
|
34
|
-
chatToggleOpenLabel: "Open chat",
|
|
35
|
-
chatToggleCloseLabel: "Close chat",
|
|
36
|
-
chatScrollToBottomLabel: "Scroll to bottom",
|
|
37
|
-
modalHeaderTitle: "CopilotKit Chat",
|
|
38
|
-
welcomeMessageText: "How can I help you today?",
|
|
39
|
-
reasoningMessageThinkingLabel: "Thinking…",
|
|
40
|
-
chatInputSlashMenuLabel: "Slash commands",
|
|
41
|
-
chatInputSlashMenuEmptyText: "No commands found",
|
|
42
|
-
attachmentRemoveButtonLabel: "Remove attachment",
|
|
43
|
-
attachmentPlayVideoButtonLabel: "Play video",
|
|
44
|
-
attachmentPreviewCloseButtonLabel: "Close preview",
|
|
45
|
-
modalHeaderCloseButtonLabel: "Close",
|
|
46
|
-
modalHeaderThreadsButtonLabel: "Open threads",
|
|
47
|
-
sidebarLabel: "Copilot chat sidebar",
|
|
48
|
-
} as const;
|
|
1
|
+
import type { CopilotChatLabels } from "@copilotkit/core";
|
|
49
2
|
|
|
50
|
-
export
|
|
3
|
+
export { CopilotChatDefaultLabels } from "@copilotkit/core";
|
|
4
|
+
export type { CopilotChatLabels } from "@copilotkit/core";
|
|
51
5
|
|
|
52
6
|
export interface CopilotChatConfigurationValue {
|
|
53
7
|
labels: CopilotChatLabels;
|
|
@@ -2,11 +2,30 @@ import { describe, it, expect } from "vitest";
|
|
|
2
2
|
import { defineComponent, h } from "vue";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ToolCallStatus } from "@copilotkit/core";
|
|
5
|
+
import type { VNode } from "vue";
|
|
5
6
|
import { defineToolCallRenderer } from "../defineToolCallRenderer";
|
|
6
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
VueToolCallRenderer,
|
|
9
|
+
VueToolCallRendererRenderProps,
|
|
10
|
+
} from "../vue-tool-call-renderer";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Calls a renderer built from a render function. `render` is typed as a
|
|
14
|
+
* function or a component, and TypeScript cannot tell which one this test
|
|
15
|
+
* passed, so the narrowing cast lives here once.
|
|
16
|
+
*/
|
|
17
|
+
function callRender<T>(
|
|
18
|
+
renderer: VueToolCallRenderer<T>,
|
|
19
|
+
props: VueToolCallRendererRenderProps<T>,
|
|
20
|
+
) {
|
|
21
|
+
const render = renderer.render as (
|
|
22
|
+
props: VueToolCallRendererRenderProps<T>,
|
|
23
|
+
) => VNode;
|
|
24
|
+
return render(props);
|
|
25
|
+
}
|
|
7
26
|
|
|
8
27
|
describe("defineToolCallRenderer", () => {
|
|
9
|
-
it("defaults wildcard args to
|
|
28
|
+
it("defaults wildcard args to a schema that accepts any value and preserves runtime tool name", () => {
|
|
10
29
|
const wildcardRenderer = defineToolCallRenderer({
|
|
11
30
|
name: "*",
|
|
12
31
|
render: ({ name, args, status }) =>
|
|
@@ -18,19 +37,11 @@ describe("defineToolCallRenderer", () => {
|
|
|
18
37
|
});
|
|
19
38
|
|
|
20
39
|
expect(wildcardRenderer.name).toBe("*");
|
|
21
|
-
expect(
|
|
22
|
-
true,
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const rendered = (
|
|
26
|
-
wildcardRenderer.render as (props: {
|
|
27
|
-
name: string;
|
|
28
|
-
toolCallId: string;
|
|
29
|
-
args: Record<string, unknown>;
|
|
30
|
-
status: ToolCallStatus;
|
|
31
|
-
result: string | undefined;
|
|
32
|
-
}) => ReturnType<typeof h>
|
|
33
|
-
)({
|
|
40
|
+
expect(
|
|
41
|
+
wildcardRenderer.args["~standard"].validate({ anything: true }),
|
|
42
|
+
).toEqual({ value: { anything: true } });
|
|
43
|
+
|
|
44
|
+
const rendered = callRender(wildcardRenderer, {
|
|
34
45
|
name: "customTool",
|
|
35
46
|
toolCallId: "tc-wildcard-1",
|
|
36
47
|
args: { x: 1 },
|
|
@@ -53,15 +64,7 @@ describe("defineToolCallRenderer", () => {
|
|
|
53
64
|
),
|
|
54
65
|
});
|
|
55
66
|
|
|
56
|
-
const rendered = (
|
|
57
|
-
wildcardRenderer.render as (props: {
|
|
58
|
-
name: string;
|
|
59
|
-
toolCallId: string;
|
|
60
|
-
args: Record<string, unknown>;
|
|
61
|
-
status: ToolCallStatus;
|
|
62
|
-
result: string | undefined;
|
|
63
|
-
}) => ReturnType<typeof h>
|
|
64
|
-
)({
|
|
67
|
+
const rendered = callRender(wildcardRenderer, {
|
|
65
68
|
name: "customTool",
|
|
66
69
|
toolCallId: "tc-123",
|
|
67
70
|
args: {},
|
|
@@ -136,15 +139,7 @@ describe("defineToolCallRenderer", () => {
|
|
|
136
139
|
},
|
|
137
140
|
});
|
|
138
141
|
|
|
139
|
-
const rendered = (
|
|
140
|
-
typedRenderer.render as (props: {
|
|
141
|
-
name: string;
|
|
142
|
-
toolCallId: string;
|
|
143
|
-
args: { location: string; units?: "celsius" | "fahrenheit" };
|
|
144
|
-
status: ToolCallStatus;
|
|
145
|
-
result: string | undefined;
|
|
146
|
-
}) => ReturnType<typeof h>
|
|
147
|
-
)({
|
|
142
|
+
const rendered = callRender(typedRenderer, {
|
|
148
143
|
name: "get_weather",
|
|
149
144
|
toolCallId: "tc-weather-1",
|
|
150
145
|
args: { location: "Paris", units: "celsius" },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵanySchema } from "@copilotkit/shared";
|
|
2
2
|
import type { StandardSchemaV1, InferSchemaOutput } from "@copilotkit/shared";
|
|
3
3
|
import type { VueToolCallRenderer } from "./vue-tool-call-renderer";
|
|
4
4
|
import type { VueToolCallRendererRenderFn } from "./vue-tool-call-renderer";
|
|
@@ -25,11 +25,12 @@ export function defineToolCallRenderer<S extends StandardSchemaV1>(def: {
|
|
|
25
25
|
agentId?: string;
|
|
26
26
|
group?: boolean;
|
|
27
27
|
}): VueToolCallRenderer<unknown> {
|
|
28
|
-
|
|
28
|
+
// Only a "*" renderer may leave out `args`; it accepts any arguments.
|
|
29
|
+
const args = def.args ?? ɵanySchema;
|
|
29
30
|
return {
|
|
30
31
|
name: def.name,
|
|
31
|
-
args
|
|
32
|
-
render: def.render
|
|
32
|
+
args,
|
|
33
|
+
render: def.render,
|
|
33
34
|
...(def.agentId ? { agentId: def.agentId } : {}),
|
|
34
35
|
...(def.group ? { group: true } : {}),
|
|
35
36
|
};
|
|
@@ -1,37 +1,13 @@
|
|
|
1
|
-
import type { FrontendTool,
|
|
1
|
+
import type { FrontendTool, HumanInTheLoopRenderProps } from "@copilotkit/core";
|
|
2
2
|
import type { Component, VNodeChild } from "vue";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
status: ToolCallStatus.InProgress;
|
|
12
|
-
result: undefined;
|
|
13
|
-
respond: undefined;
|
|
14
|
-
}
|
|
15
|
-
| {
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
toolCallId: string;
|
|
19
|
-
agentId?: string;
|
|
20
|
-
args: T;
|
|
21
|
-
status: ToolCallStatus.Executing;
|
|
22
|
-
result: undefined;
|
|
23
|
-
respond: (result: unknown) => Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
| {
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
toolCallId: string;
|
|
29
|
-
agentId?: string;
|
|
30
|
-
args: T;
|
|
31
|
-
status: ToolCallStatus.Complete;
|
|
32
|
-
result: string;
|
|
33
|
-
respond: undefined;
|
|
34
|
-
};
|
|
4
|
+
/**
|
|
5
|
+
* Props a Vue human-in-the-loop renderer receives. Same as core's
|
|
6
|
+
* `HumanInTheLoopRenderProps`.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - The shape of the tool arguments.
|
|
9
|
+
*/
|
|
10
|
+
export type VueHumanInTheLoopRenderProps<T> = HumanInTheLoopRenderProps<T>;
|
|
35
11
|
|
|
36
12
|
export type VueHumanInTheLoopRenderFn<T> =
|
|
37
13
|
| ((props: VueHumanInTheLoopRenderProps<T>) => VNodeChild)
|
|
@@ -1,31 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type InterruptResolveFn = (
|
|
9
|
-
payload?: unknown,
|
|
10
|
-
interruptId?: string,
|
|
11
|
-
) => Promise<RunAgentResult | void>;
|
|
12
|
-
export type InterruptCancelFn = (
|
|
13
|
-
interruptId?: string,
|
|
14
|
-
) => Promise<RunAgentResult | void>;
|
|
15
|
-
|
|
16
|
-
export interface InterruptHandlerProps<TValue = unknown> {
|
|
17
|
-
event: InterruptEvent<TValue>;
|
|
18
|
-
interrupt: Interrupt | null;
|
|
19
|
-
interrupts: Interrupt[];
|
|
20
|
-
resolve: InterruptResolveFn;
|
|
21
|
-
cancel: InterruptCancelFn;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface InterruptRenderProps<TValue = unknown, TResult = unknown> {
|
|
25
|
-
event: InterruptEvent<TValue>;
|
|
26
|
-
interrupt: Interrupt | null;
|
|
27
|
-
interrupts: Interrupt[];
|
|
28
|
-
result: TResult;
|
|
29
|
-
resolve: InterruptResolveFn;
|
|
30
|
-
cancel: InterruptCancelFn;
|
|
31
|
-
}
|
|
1
|
+
export type {
|
|
2
|
+
InterruptEvent,
|
|
3
|
+
InterruptResolveFn,
|
|
4
|
+
InterruptCancelFn,
|
|
5
|
+
InterruptHandlerProps,
|
|
6
|
+
InterruptRenderProps,
|
|
7
|
+
} from "@copilotkit/core";
|