@copilotkit/vue 2.0.0-rc.2 → 2.0.0-rc.20
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/PARITY.md +3 -3
- 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 -16908
- package/dist/index.mjs.map +1 -1
- package/dist/use-render-activity-message-CsWYyd6r.cjs +91 -0
- package/dist/use-render-activity-message-CsWYyd6r.cjs.map +1 -0
- package/dist/use-render-activity-message-DntKKNdd.js +17418 -0
- package/dist/use-render-activity-message-DntKKNdd.js.map +1 -0
- package/dist/v2/components/InlineFeatureWarning.vue.d.ts.map +1 -1
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts +2 -2
- 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/catalog.d.ts.map +1 -1
- package/dist/v2/components/a2ui/utils.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 +2 -2
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.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/CopilotChatFeedbackCommentPopover.vue.d.ts +1 -1
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.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/CopilotChatInspectorButton.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/CopilotChatUserMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts +2 -2
- 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/CopilotModalHeader.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts +8 -3
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +5 -3
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +5 -3
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +8 -3
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +5 -3
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +5 -3
- package/dist/v2/components/chat/CopilotSidebarViewInternal.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/forwarded-slots.d.ts +12 -0
- package/dist/v2/components/chat/forwarded-slots.d.ts.map +1 -0
- package/dist/v2/components/chat/index.d.ts +28 -25
- package/dist/v2/components/chat/index.d.ts.map +1 -1
- package/dist/v2/components/chat/inspector-shortcuts.d.ts +2 -1
- package/dist/v2/components/chat/inspector-shortcuts.d.ts.map +1 -1
- package/dist/v2/components/chat/message-feedback.d.ts +18 -49
- package/dist/v2/components/chat/message-feedback.d.ts.map +1 -1
- package/dist/v2/components/chat/normalize-auto-scroll.d.ts +2 -2
- package/dist/v2/components/chat/normalize-auto-scroll.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 +8 -3
- 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/chat/use-copy-feedback.d.ts +11 -0
- package/dist/v2/components/chat/use-copy-feedback.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-attachments.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-keyboard-height.d.ts +1 -1
- package/dist/v2/hooks/use-keyboard-height.d.ts.map +1 -1
- package/dist/v2/hooks/use-pin-to-send.d.ts +4 -12
- package/dist/v2/hooks/use-pin-to-send.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/is-mobile-viewport.d.ts +1 -14
- package/dist/v2/lib/is-mobile-viewport.d.ts.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/shallow-stable.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.types.d.ts +0 -5
- package/dist/v2/providers/CopilotKitProvider.types.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/markdown-renderer.d.ts +2 -2
- package/dist/v2/providers/markdown-renderer.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/InlineFeatureWarning.vue +20 -21
- package/src/v2/components/LicenseWarningBanner.vue +27 -135
- 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 +60 -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/catalog.ts +1 -0
- package/src/v2/components/a2ui/utils.ts +2 -0
- package/src/v2/components/a2ui.ts +1 -1
- package/src/v2/components/chat/CopilotChat.vue +19 -40
- package/src/v2/components/chat/CopilotChatAssistantMessage.vue +19 -43
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +14 -10
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +14 -6
- package/src/v2/components/chat/CopilotChatFeedbackCommentPopover.vue +2 -2
- package/src/v2/components/chat/CopilotChatInput.vue +40 -30
- package/src/v2/components/chat/CopilotChatInspectorButton.vue +45 -108
- package/src/v2/components/chat/CopilotChatMessageView.vue +72 -140
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +7 -15
- 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/CopilotChatUserMessage.vue +24 -112
- package/src/v2/components/chat/CopilotChatView.vue +5 -5
- package/src/v2/components/chat/CopilotChatWorkSummary.vue +26 -36
- package/src/v2/components/chat/CopilotModalHeader.vue +11 -23
- package/src/v2/components/chat/CopilotPopup.vue +23 -25
- package/src/v2/components/chat/CopilotPopupView.vue +10 -39
- package/src/v2/components/chat/CopilotPopupViewInternal.vue +14 -34
- package/src/v2/components/chat/CopilotSidebar.vue +23 -25
- package/src/v2/components/chat/CopilotSidebarView.vue +10 -39
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +14 -34
- package/src/v2/components/chat/StreamingMarkdownDefault.vue +4 -4
- 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__/CopilotChatAssistantMessage.learningFeedback.test.ts +5 -5
- 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/__tests__/CopilotPopup.test.ts +90 -1
- package/src/v2/components/chat/__tests__/CopilotSidebar.test.ts +90 -1
- package/src/v2/components/chat/copilotChatToolCallItemRender.ts +3 -19
- package/src/v2/components/chat/forwarded-slots.ts +17 -0
- package/src/v2/components/chat/index.ts +0 -1
- package/src/v2/components/chat/inspector-shortcuts.ts +10 -16
- package/src/v2/components/chat/message-feedback.ts +62 -197
- package/src/v2/components/chat/normalize-auto-scroll.ts +3 -17
- 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 +12 -4
- package/src/v2/components/chat/use-chat-labels.ts +16 -0
- package/src/v2/components/chat/use-copy-feedback.ts +21 -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-attachments.ts +6 -2
- package/src/v2/hooks/use-frontend-tool.ts +10 -10
- package/src/v2/hooks/use-keyboard-height.ts +17 -40
- package/src/v2/hooks/use-pin-to-send.ts +15 -99
- 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/__tests__/shallow-stable.test.ts +54 -0
- package/src/v2/lib/is-mobile-viewport.ts +5 -23
- package/src/v2/lib/processPartialHtml.ts +6 -21
- package/src/v2/lib/shallow-stable.ts +2 -16
- package/src/v2/lib/vue-core.ts +9 -13
- package/src/v2/providers/CopilotKitProvider.types.ts +0 -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 -33
- package/src/v2/providers/markdown-renderer.ts +2 -2
- 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/tsconfig.json +0 -1
- 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/message-feedback.d.ts +0 -33
- package/dist/v2/lib/message-feedback.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/__tests__/normalize-auto-scroll.test.ts +0 -39
- package/src/v2/components/chat/tool-call-layout.ts +0 -304
- package/src/v2/lib/__tests__/is-mobile-viewport.test.ts +0 -48
- package/src/v2/lib/__tests__/message-feedback.test.ts +0 -152
- 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/message-feedback.ts +0 -120
- package/src/v2/lib/transcription-client.ts +0 -151
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
import type { FrontendTool,
|
|
1
|
+
import type { FrontendTool, HumanInTheLoopRenderProps } from "@copilotkit/core";
|
|
2
2
|
import type { Component, VNodeChild } from "vue";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
result: undefined;
|
|
11
|
-
respond: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
toolCallId: string;
|
|
16
|
-
agentId?: string;
|
|
17
|
-
args: T;
|
|
18
|
-
status: ToolCallStatus.Executing;
|
|
19
|
-
result: undefined;
|
|
20
|
-
respond: (result: unknown) => Promise<void>;
|
|
21
|
-
} | {
|
|
22
|
-
name: string;
|
|
23
|
-
description: string;
|
|
24
|
-
toolCallId: string;
|
|
25
|
-
agentId?: string;
|
|
26
|
-
args: T;
|
|
27
|
-
status: ToolCallStatus.Complete;
|
|
28
|
-
result: string;
|
|
29
|
-
respond: undefined;
|
|
30
|
-
};
|
|
3
|
+
/**
|
|
4
|
+
* Props a Vue human-in-the-loop renderer receives. Same as core's
|
|
5
|
+
* `HumanInTheLoopRenderProps`.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam T - The shape of the tool arguments.
|
|
8
|
+
*/
|
|
9
|
+
export type VueHumanInTheLoopRenderProps<T> = HumanInTheLoopRenderProps<T>;
|
|
31
10
|
export type VueHumanInTheLoopRenderFn<T> = ((props: VueHumanInTheLoopRenderProps<T>) => VNodeChild) | Component<VueHumanInTheLoopRenderProps<T>>;
|
|
32
11
|
export type VueHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>> = Omit<FrontendTool<T>, "handler"> & {
|
|
33
12
|
render: VueHumanInTheLoopRenderFn<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"human-in-the-loop.d.ts","sourceRoot":"","sources":["../../../src/v2/types/human-in-the-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"human-in-the-loop.d.ts","sourceRoot":"","sources":["../../../src/v2/types/human-in-the-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,CAAC,CAAC,IAAI,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAE3E,MAAM,MAAM,yBAAyB,CAAC,CAAC,IACnC,CAAC,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,GACxD,SAAS,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/C,MAAM,MAAM,iBAAiB,CAC3B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACzD,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG;IACrC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;CACtC,CAAC"}
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export interface InterruptEvent<TValue = unknown> {
|
|
3
|
-
name: string;
|
|
4
|
-
value: TValue;
|
|
5
|
-
}
|
|
6
|
-
export type InterruptResolveFn = (payload?: unknown, interruptId?: string) => Promise<RunAgentResult | void>;
|
|
7
|
-
export type InterruptCancelFn = (interruptId?: string) => Promise<RunAgentResult | void>;
|
|
8
|
-
export interface InterruptHandlerProps<TValue = unknown> {
|
|
9
|
-
event: InterruptEvent<TValue>;
|
|
10
|
-
interrupt: Interrupt | null;
|
|
11
|
-
interrupts: Interrupt[];
|
|
12
|
-
resolve: InterruptResolveFn;
|
|
13
|
-
cancel: InterruptCancelFn;
|
|
14
|
-
}
|
|
15
|
-
export interface InterruptRenderProps<TValue = unknown, TResult = unknown> {
|
|
16
|
-
event: InterruptEvent<TValue>;
|
|
17
|
-
interrupt: Interrupt | null;
|
|
18
|
-
interrupts: Interrupt[];
|
|
19
|
-
result: TResult;
|
|
20
|
-
resolve: InterruptResolveFn;
|
|
21
|
-
cancel: InterruptCancelFn;
|
|
22
|
-
}
|
|
1
|
+
export type { InterruptEvent, InterruptResolveFn, InterruptCancelFn, InterruptHandlerProps, InterruptRenderProps, } from "@copilotkit/core";
|
|
23
2
|
//# sourceMappingURL=interrupt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interrupt.d.ts","sourceRoot":"","sources":["../../../src/v2/types/interrupt.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"interrupt.d.ts","sourceRoot":"","sources":["../../../src/v2/types/interrupt.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { AbstractAgent } from "@ag-ui/client";
|
|
3
|
-
import type { z } from "zod";
|
|
1
|
+
import type { ActivityMessageRenderProps, ActivityMessageRendererDef } from "@copilotkit/core";
|
|
4
2
|
import type { Component, VNodeChild } from "vue";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Props a Vue activity message renderer receives. Same as core's
|
|
5
|
+
* `ActivityMessageRenderProps`.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam TActivityContent - The shape of the activity content.
|
|
8
|
+
*/
|
|
9
|
+
export type VueActivityMessageRendererProps<TActivityContent> = ActivityMessageRenderProps<TActivityContent>;
|
|
11
10
|
export type VueActivityMessageRendererRenderFn<TActivityContent> = ((props: VueActivityMessageRendererProps<TActivityContent>) => VNodeChild) | Component<VueActivityMessageRendererProps<TActivityContent>>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/**
|
|
12
|
+
* A Vue activity message renderer registration. `content` takes any
|
|
13
|
+
* Standard Schema (zod, valibot, arktype, and so on). The chat validates the
|
|
14
|
+
* activity content with it and passes the result to `render`.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam TActivityContent - The shape of the activity content.
|
|
17
|
+
*/
|
|
18
|
+
export type VueActivityMessageRenderer<TActivityContent> = ActivityMessageRendererDef<TActivityContent, VueActivityMessageRendererRenderFn<TActivityContent>>;
|
|
18
19
|
//# sourceMappingURL=vue-activity-message-renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-activity-message-renderer.d.ts","sourceRoot":"","sources":["../../../src/v2/types/vue-activity-message-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"vue-activity-message-renderer.d.ts","sourceRoot":"","sources":["../../../src/v2/types/vue-activity-message-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,CAAC,gBAAgB,IAC1D,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;AAE/C,MAAM,MAAM,kCAAkC,CAAC,gBAAgB,IAC3D,CAAC,CAAC,KAAK,EAAE,+BAA+B,CAAC,gBAAgB,CAAC,KAAK,UAAU,CAAC,GAC1E,SAAS,CAAC,+BAA+B,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,MAAM,0BAA0B,CAAC,gBAAgB,IACrD,0BAA0B,CACxB,gBAAgB,EAChB,kCAAkC,CAAC,gBAAgB,CAAC,CACrD,CAAC"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CustomMessageRendererDef, CustomMessageRendererPosition, CustomMessageRenderProps } from "@copilotkit/core";
|
|
2
2
|
import type { Component, VNodeChild } from "vue";
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
runId: string;
|
|
8
|
-
messageIndex: number;
|
|
9
|
-
messageIndexInRun: number;
|
|
10
|
-
numberOfMessagesInRun: number;
|
|
11
|
-
agentId: string;
|
|
12
|
-
stateSnapshot: unknown;
|
|
13
|
-
}
|
|
3
|
+
/** Where a custom message renderer draws. Same as core's type. */
|
|
4
|
+
export type VueCustomMessageRendererPosition = CustomMessageRendererPosition;
|
|
5
|
+
/** Props a Vue custom message renderer receives. Same as core's type. */
|
|
6
|
+
export type VueCustomMessageRendererProps = CustomMessageRenderProps;
|
|
14
7
|
export type VueCustomMessageRendererRenderFn = ((props: VueCustomMessageRendererProps) => VNodeChild) | Component<VueCustomMessageRendererProps>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
render: VueCustomMessageRendererRenderFn;
|
|
18
|
-
}
|
|
8
|
+
/** A Vue custom message renderer registration. */
|
|
9
|
+
export type VueCustomMessageRenderer = CustomMessageRendererDef<VueCustomMessageRendererRenderFn>;
|
|
19
10
|
//# sourceMappingURL=vue-custom-message-renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-custom-message-renderer.d.ts","sourceRoot":"","sources":["../../../src/v2/types/vue-custom-message-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"vue-custom-message-renderer.d.ts","sourceRoot":"","sources":["../../../src/v2/types/vue-custom-message-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjD,kEAAkE;AAClE,MAAM,MAAM,gCAAgC,GAAG,6BAA6B,CAAC;AAE7E,yEAAyE;AACzE,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,CAAC;AAErE,MAAM,MAAM,gCAAgC,GACxC,CAAC,CAAC,KAAK,EAAE,6BAA6B,KAAK,UAAU,CAAC,GACtD,SAAS,CAAC,6BAA6B,CAAC,CAAC;AAE7C,kDAAkD;AAClD,MAAM,MAAM,wBAAwB,GAClC,wBAAwB,CAAC,gCAAgC,CAAC,CAAC"}
|
|
@@ -1,44 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { StandardSchemaV1 } from "@copilotkit/shared";
|
|
1
|
+
import type { ToolCallRenderProps, ToolCallRendererDef } from "@copilotkit/core";
|
|
3
2
|
import type { Component, VNodeChild } from "vue";
|
|
4
3
|
/**
|
|
5
|
-
* Props passed to a Vue tool call render function.
|
|
4
|
+
* Props passed to a Vue tool call render function. Same as core's
|
|
5
|
+
* `ToolCallRenderProps`.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam T - The shape of the tool arguments.
|
|
6
8
|
*/
|
|
7
|
-
export type VueToolCallRendererRenderProps<T> =
|
|
8
|
-
name: string;
|
|
9
|
-
toolCallId: string;
|
|
10
|
-
args: Partial<T>;
|
|
11
|
-
status: ToolCallStatus.InProgress;
|
|
12
|
-
result: undefined;
|
|
13
|
-
} | {
|
|
14
|
-
name: string;
|
|
15
|
-
toolCallId: string;
|
|
16
|
-
args: T;
|
|
17
|
-
status: ToolCallStatus.Executing;
|
|
18
|
-
result: undefined;
|
|
19
|
-
} | {
|
|
20
|
-
name: string;
|
|
21
|
-
toolCallId: string;
|
|
22
|
-
args: T;
|
|
23
|
-
status: ToolCallStatus.Complete;
|
|
24
|
-
result: string;
|
|
25
|
-
};
|
|
9
|
+
export type VueToolCallRendererRenderProps<T> = ToolCallRenderProps<T>;
|
|
26
10
|
/**
|
|
27
11
|
* Vue component or render function for tool call rendering.
|
|
28
12
|
* Component is normalized to (props) => VNodeChild internally.
|
|
29
13
|
*/
|
|
30
14
|
export type VueToolCallRendererRenderFn<T> = ((props: VueToolCallRendererRenderProps<T>) => VNodeChild) | Component<VueToolCallRendererRenderProps<T>>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
group?: boolean;
|
|
42
|
-
render: VueToolCallRendererRenderFn<T>;
|
|
43
|
-
}
|
|
15
|
+
type VueToolCallRendererDef<T> = ToolCallRendererDef<T, VueToolCallRendererRenderFn<T>>;
|
|
16
|
+
/**
|
|
17
|
+
* A Vue tool call renderer registration: core's `ToolCallRendererDef` with a
|
|
18
|
+
* Vue render function. `args` is required here. Use `defineToolCallRenderer`
|
|
19
|
+
* to build one; it fills in `args` for a `"*"` renderer that has no schema.
|
|
20
|
+
*
|
|
21
|
+
* @typeParam T - The shape of the tool arguments.
|
|
22
|
+
*/
|
|
23
|
+
export type VueToolCallRenderer<T = unknown> = VueToolCallRendererDef<T> & Required<Pick<VueToolCallRendererDef<T>, "args">>;
|
|
24
|
+
export {};
|
|
44
25
|
//# sourceMappingURL=vue-tool-call-renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-tool-call-renderer.d.ts","sourceRoot":"","sources":["../../../src/v2/types/vue-tool-call-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"vue-tool-call-renderer.d.ts","sourceRoot":"","sources":["../../../src/v2/types/vue-tool-call-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,8BAA8B,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,2BAA2B,CAAC,CAAC,IACrC,CAAC,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,GAC1D,SAAS,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjD,KAAK,sBAAsB,CAAC,CAAC,IAAI,mBAAmB,CAClD,CAAC,EACD,2BAA2B,CAAC,CAAC,CAAC,CAC/B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,OAAO,IAAI,sBAAsB,CAAC,CAAC,CAAC,GACtE,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/vue",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Vue 3 components and composables for CopilotKit",
|
|
6
6
|
"keywords": [
|
|
@@ -61,16 +61,14 @@
|
|
|
61
61
|
"@a2ui/web_core": "0.10.4",
|
|
62
62
|
"@ag-ui/client": "1.0.2",
|
|
63
63
|
"@ag-ui/core": "1.0.2",
|
|
64
|
-
"@copilotkit/
|
|
65
|
-
"@copilotkit/
|
|
66
|
-
"@copilotkit/
|
|
67
|
-
"@copilotkit/
|
|
68
|
-
"@copilotkit/
|
|
69
|
-
"@copilotkit/web-
|
|
70
|
-
"@
|
|
71
|
-
"
|
|
72
|
-
"zod": "^3.25.75",
|
|
73
|
-
"zod-to-json-schema": "^3.24.5"
|
|
64
|
+
"@copilotkit/a2ui-renderer": "2.0.0-rc.20",
|
|
65
|
+
"@copilotkit/core": "2.0.0-rc.20",
|
|
66
|
+
"@copilotkit/markdown": "2.0.0-rc.20",
|
|
67
|
+
"@copilotkit/mcp-apps-renderer": "2.0.0-rc.20",
|
|
68
|
+
"@copilotkit/shared": "2.0.0-rc.20",
|
|
69
|
+
"@copilotkit/web-components": "2.0.0-rc.20",
|
|
70
|
+
"@copilotkit/web-inspector": "2.0.0-rc.20",
|
|
71
|
+
"zod": "^4.2.0"
|
|
74
72
|
},
|
|
75
73
|
"devDependencies": {
|
|
76
74
|
"@eslint/js": "^9.39.2",
|
|
@@ -94,6 +92,7 @@
|
|
|
94
92
|
"vue": "^3.5.28",
|
|
95
93
|
"vue-eslint-parser": "^10.4.0",
|
|
96
94
|
"vue-tsc": "^2.1.10",
|
|
95
|
+
"zod-v3": "npm:zod@^3.25.76",
|
|
97
96
|
"@copilotkit/typescript-config": "1.55.0-next.8"
|
|
98
97
|
},
|
|
99
98
|
"peerDependencies": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// @vitest-environment node
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import type { LibraryOptions } from "vite";
|
|
4
|
+
import config from "../../vite.config";
|
|
5
|
+
import { useFrontendTool as v1UseFrontendTool } from "../hooks/use-frontend-tool";
|
|
6
|
+
import { useFrontendTool as v2UseFrontendTool } from "../v2/hooks/use-frontend-tool";
|
|
7
|
+
|
|
8
|
+
// The package's "./v2" export points at the build's "v2/index" entry, and "."
|
|
9
|
+
// at "index". Each entry must build from the module that matches its export.
|
|
10
|
+
const entries = (config.build?.lib as LibraryOptions).entry as Record<
|
|
11
|
+
string,
|
|
12
|
+
string
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
describe("library build entries", () => {
|
|
16
|
+
it("builds @copilotkit/vue/v2 from the v2 module, with the v2 hooks", async () => {
|
|
17
|
+
const v2 = await import(/* @vite-ignore */ entries["v2/index"]!);
|
|
18
|
+
|
|
19
|
+
expect(v2.useFrontendTool).toBe(v2UseFrontendTool);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("builds @copilotkit/vue from the root module, with the v1-compatible hooks", async () => {
|
|
23
|
+
const root = await import(/* @vite-ignore */ entries.index!);
|
|
24
|
+
|
|
25
|
+
expect(root.useFrontendTool).toBe(v1UseFrontendTool);
|
|
26
|
+
});
|
|
27
|
+
});
|