@copilotkit/vue 1.81.0 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -7
- package/CONTRIBUTOR_GUIDE.md +120 -0
- package/PARITY.md +19 -10
- package/README.md +24 -373
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/{use-render-activity-message-5H6AfuJB.js → use-render-activity-message-CrBnMluO.js} +3189 -3147
- package/dist/use-render-activity-message-CrBnMluO.js.map +1 -0
- package/dist/use-render-activity-message-DuOFLc23.cjs +70 -0
- package/dist/use-render-activity-message-DuOFLc23.cjs.map +1 -0
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts +10 -0
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -1
- package/dist/v2/components/a2ui/catalog.d.ts.map +1 -1
- package/dist/v2/components/a2ui/utils.d.ts +1 -1
- package/dist/v2/components/a2ui/utils.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +54 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts +3 -0
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts +4 -0
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/providers/CopilotKitProvider.types.d.ts +15 -0
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/types.d.ts +9 -0
- package/dist/v2/providers/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/styles/globals.css +7 -0
- package/src/v2/components/__tests__/A2UIBasicCatalogColors.test.ts +188 -0
- package/src/v2/components/__tests__/A2UICatalogContext.test.ts +63 -0
- package/src/v2/components/a2ui/A2UICatalogContext.ts +14 -2
- package/src/v2/components/a2ui/catalog.ts +44 -15
- package/src/v2/components/a2ui/utils.ts +1 -1
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +8 -3
- package/src/v2/components/chat/CopilotChatInput.vue +2 -2
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +11 -1
- package/src/v2/components/chat/CopilotModalHeader.vue +4 -1
- package/src/v2/components/chat/CopilotModalHeaderCloseButton.ts +11 -1
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +3 -1
- package/src/v2/components/chat/__tests__/CopilotChat.labels.test.ts +198 -0
- package/src/v2/providers/CopilotKitProvider.types.ts +15 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.a2ui.test.ts +50 -0
- package/src/v2/providers/types.ts +9 -0
- package/dist/use-render-activity-message-5H6AfuJB.js.map +0 -1
- package/dist/use-render-activity-message-DxOdM2Qt.cjs +0 -70
- package/dist/use-render-activity-message-DxOdM2Qt.cjs.map +0 -1
|
@@ -1,6 +1,9 @@
|
|
|
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";
|
|
5
|
+
import { Catalog } from "@a2ui/web_core/v0_9";
|
|
6
|
+
import type { ComponentApi } from "@a2ui/web_core/v0_9";
|
|
4
7
|
import CopilotKitProvider from "../CopilotKitProvider.vue";
|
|
5
8
|
import { useCopilotKit } from "../useCopilotKit";
|
|
6
9
|
|
|
@@ -76,3 +79,50 @@ describe("CopilotKitProvider a2ui catalog auto-enable", () => {
|
|
|
76
79
|
expect(a2uiRenderer).toBeUndefined();
|
|
77
80
|
});
|
|
78
81
|
});
|
|
82
|
+
|
|
83
|
+
const CAPABILITIES_DESCRIPTION =
|
|
84
|
+
"A2UI catalog capabilities: available catalog IDs and custom component definitions the client can render.";
|
|
85
|
+
|
|
86
|
+
function makeCustomCatalog(): Catalog<ComponentApi> {
|
|
87
|
+
return new Catalog<ComponentApi>(
|
|
88
|
+
"copilotkit://custom-catalog",
|
|
89
|
+
[{ name: "FlightCard", schema: z.object({ airline: z.string() }) }],
|
|
90
|
+
[],
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function capabilitiesValue(
|
|
95
|
+
core: ReturnType<typeof mountProvider>["observedCore"]["value"],
|
|
96
|
+
): string | undefined {
|
|
97
|
+
return Object.values(core?.context ?? {}).find(
|
|
98
|
+
(entry) => entry.description === CAPABILITIES_DESCRIPTION,
|
|
99
|
+
)?.value;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
describe("CopilotKitProvider a2ui catalog context", () => {
|
|
103
|
+
it("lists custom components by name only when includeSchema is false", () => {
|
|
104
|
+
const { observedCore } = mountProvider({
|
|
105
|
+
a2ui: { catalog: makeCustomCatalog(), includeSchema: false },
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
expect(capabilitiesValue(observedCore.value)).toBe(
|
|
109
|
+
[
|
|
110
|
+
"Available A2UI catalog:",
|
|
111
|
+
"- copilotkit://custom-catalog",
|
|
112
|
+
" Custom catalog (does NOT include all basic components).",
|
|
113
|
+
" Custom components:",
|
|
114
|
+
" - FlightCard",
|
|
115
|
+
].join("\n"),
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("includes custom component schemas by default", () => {
|
|
120
|
+
const { observedCore } = mountProvider({
|
|
121
|
+
a2ui: { catalog: makeCustomCatalog() },
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const value = capabilitiesValue(observedCore.value);
|
|
125
|
+
expect(value).toContain(" - FlightCard:\n {");
|
|
126
|
+
expect(value).toContain('"airline"');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
@@ -25,6 +25,15 @@ export const CopilotChatDefaultLabels = {
|
|
|
25
25
|
chatScrollToBottomLabel: "Scroll to bottom",
|
|
26
26
|
modalHeaderTitle: "CopilotKit Chat",
|
|
27
27
|
welcomeMessageText: "How can I help you today?",
|
|
28
|
+
reasoningMessageThinkingLabel: "Thinking…",
|
|
29
|
+
chatInputSlashMenuLabel: "Slash commands",
|
|
30
|
+
chatInputSlashMenuEmptyText: "No commands found",
|
|
31
|
+
attachmentRemoveButtonLabel: "Remove attachment",
|
|
32
|
+
attachmentPlayVideoButtonLabel: "Play video",
|
|
33
|
+
attachmentPreviewCloseButtonLabel: "Close preview",
|
|
34
|
+
modalHeaderCloseButtonLabel: "Close",
|
|
35
|
+
modalHeaderThreadsButtonLabel: "Open threads",
|
|
36
|
+
sidebarLabel: "Copilot chat sidebar",
|
|
28
37
|
} as const;
|
|
29
38
|
|
|
30
39
|
export type CopilotChatLabels = typeof CopilotChatDefaultLabels;
|