@copilotkit/vue 1.69.2 → 1.70.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/PARITY.md +1 -1
- package/README.md +7 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +14 -14
- package/dist/use-render-activity-message-h2NHCkBt.cjs +85 -0
- package/dist/use-render-activity-message-h2NHCkBt.cjs.map +1 -0
- package/dist/{use-render-activity-message-Db2rOZkW.js → use-render-activity-message-ytoSQi6V.js} +3120 -3082
- package/dist/use-render-activity-message-ytoSQi6V.js.map +1 -0
- package/dist/v2/components/CopilotKitInspector.vue.d.ts +2 -0
- package/dist/v2/components/CopilotKitInspector.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +40 -16
- package/dist/v2/components/chat/CopilotChatAssistantMessage.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 +10 -9
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +3 -3
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/keys.d.ts +10 -0
- package/dist/v2/providers/keys.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/v2/__tests__/mocks/web-inspector.ts +32 -1
- package/src/v2/components/CopilotKitInspector.vue +41 -3
- package/src/v2/components/__tests__/CopilotKitInspector.test.ts +31 -6
- package/src/v2/hooks/__tests__/use-threads.test.ts +24 -1
- package/src/v2/hooks/use-threads.ts +1 -1
- package/src/v2/providers/CopilotKitProvider.types.ts +10 -9
- package/src/v2/providers/CopilotKitProvider.vue +94 -37
- package/src/v2/providers/__tests__/CopilotKitProvider.managedEntitlement.test.ts +290 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.test.ts +148 -37
- package/src/v2/providers/keys.ts +15 -0
- package/dist/use-render-activity-message-CIlNtfvE.cjs +0 -85
- package/dist/use-render-activity-message-CIlNtfvE.cjs.map +0 -1
- package/dist/use-render-activity-message-Db2rOZkW.js.map +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CopilotKitCoreVue } from "../lib/vue-core";
|
|
2
|
+
import type { VueInspectorOpenRequest } from "../providers/keys";
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
core?: CopilotKitCoreVue | null;
|
|
5
|
+
openRequest?: VueInspectorOpenRequest | null;
|
|
4
6
|
};
|
|
5
7
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotKitInspector.vue.d.ts","sourceRoot":"","sources":["../../../src/v2/components/CopilotKitInspector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopilotKitInspector.vue.d.ts","sourceRoot":"","sources":["../../../src/v2/components/CopilotKitInspector.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAC9C,CAAC;;AAqGF,wBAMG"}
|
|
@@ -21,11 +21,13 @@ type __VLS_Slots = {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
23
|
"thumbs-up": (message: {
|
|
24
|
-
role: "assistant";
|
|
25
24
|
id: string;
|
|
25
|
+
role: "assistant";
|
|
26
26
|
name?: string | undefined;
|
|
27
|
-
content?: string | undefined;
|
|
28
27
|
encryptedValue?: string | undefined;
|
|
28
|
+
metadata?: Record<string, any> | undefined;
|
|
29
|
+
content?: string | undefined;
|
|
30
|
+
subagentRunId?: string | undefined;
|
|
29
31
|
toolCalls?: {
|
|
30
32
|
function: {
|
|
31
33
|
name: string;
|
|
@@ -34,14 +36,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
34
36
|
type: "function";
|
|
35
37
|
id: string;
|
|
36
38
|
encryptedValue?: string | undefined;
|
|
39
|
+
metadata?: Record<string, any> | undefined;
|
|
37
40
|
}[] | undefined;
|
|
38
41
|
}) => any;
|
|
39
42
|
"thumbs-down": (message: {
|
|
40
|
-
role: "assistant";
|
|
41
43
|
id: string;
|
|
44
|
+
role: "assistant";
|
|
42
45
|
name?: string | undefined;
|
|
43
|
-
content?: string | undefined;
|
|
44
46
|
encryptedValue?: string | undefined;
|
|
47
|
+
metadata?: Record<string, any> | undefined;
|
|
48
|
+
content?: string | undefined;
|
|
49
|
+
subagentRunId?: string | undefined;
|
|
45
50
|
toolCalls?: {
|
|
46
51
|
function: {
|
|
47
52
|
name: string;
|
|
@@ -50,14 +55,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
50
55
|
type: "function";
|
|
51
56
|
id: string;
|
|
52
57
|
encryptedValue?: string | undefined;
|
|
58
|
+
metadata?: Record<string, any> | undefined;
|
|
53
59
|
}[] | undefined;
|
|
54
60
|
}) => any;
|
|
55
61
|
"read-aloud": (message: {
|
|
56
|
-
role: "assistant";
|
|
57
62
|
id: string;
|
|
63
|
+
role: "assistant";
|
|
58
64
|
name?: string | undefined;
|
|
59
|
-
content?: string | undefined;
|
|
60
65
|
encryptedValue?: string | undefined;
|
|
66
|
+
metadata?: Record<string, any> | undefined;
|
|
67
|
+
content?: string | undefined;
|
|
68
|
+
subagentRunId?: string | undefined;
|
|
61
69
|
toolCalls?: {
|
|
62
70
|
function: {
|
|
63
71
|
name: string;
|
|
@@ -66,14 +74,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
66
74
|
type: "function";
|
|
67
75
|
id: string;
|
|
68
76
|
encryptedValue?: string | undefined;
|
|
77
|
+
metadata?: Record<string, any> | undefined;
|
|
69
78
|
}[] | undefined;
|
|
70
79
|
}) => any;
|
|
71
80
|
regenerate: (message: {
|
|
72
|
-
role: "assistant";
|
|
73
81
|
id: string;
|
|
82
|
+
role: "assistant";
|
|
74
83
|
name?: string | undefined;
|
|
75
|
-
content?: string | undefined;
|
|
76
84
|
encryptedValue?: string | undefined;
|
|
85
|
+
metadata?: Record<string, any> | undefined;
|
|
86
|
+
content?: string | undefined;
|
|
87
|
+
subagentRunId?: string | undefined;
|
|
77
88
|
toolCalls?: {
|
|
78
89
|
function: {
|
|
79
90
|
name: string;
|
|
@@ -82,15 +93,18 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
82
93
|
type: "function";
|
|
83
94
|
id: string;
|
|
84
95
|
encryptedValue?: string | undefined;
|
|
96
|
+
metadata?: Record<string, any> | undefined;
|
|
85
97
|
}[] | undefined;
|
|
86
98
|
}) => any;
|
|
87
99
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
88
100
|
"onThumbs-up"?: ((message: {
|
|
89
|
-
role: "assistant";
|
|
90
101
|
id: string;
|
|
102
|
+
role: "assistant";
|
|
91
103
|
name?: string | undefined;
|
|
92
|
-
content?: string | undefined;
|
|
93
104
|
encryptedValue?: string | undefined;
|
|
105
|
+
metadata?: Record<string, any> | undefined;
|
|
106
|
+
content?: string | undefined;
|
|
107
|
+
subagentRunId?: string | undefined;
|
|
94
108
|
toolCalls?: {
|
|
95
109
|
function: {
|
|
96
110
|
name: string;
|
|
@@ -99,14 +113,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
99
113
|
type: "function";
|
|
100
114
|
id: string;
|
|
101
115
|
encryptedValue?: string | undefined;
|
|
116
|
+
metadata?: Record<string, any> | undefined;
|
|
102
117
|
}[] | undefined;
|
|
103
118
|
}) => any) | undefined;
|
|
104
119
|
"onThumbs-down"?: ((message: {
|
|
105
|
-
role: "assistant";
|
|
106
120
|
id: string;
|
|
121
|
+
role: "assistant";
|
|
107
122
|
name?: string | undefined;
|
|
108
|
-
content?: string | undefined;
|
|
109
123
|
encryptedValue?: string | undefined;
|
|
124
|
+
metadata?: Record<string, any> | undefined;
|
|
125
|
+
content?: string | undefined;
|
|
126
|
+
subagentRunId?: string | undefined;
|
|
110
127
|
toolCalls?: {
|
|
111
128
|
function: {
|
|
112
129
|
name: string;
|
|
@@ -115,14 +132,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
115
132
|
type: "function";
|
|
116
133
|
id: string;
|
|
117
134
|
encryptedValue?: string | undefined;
|
|
135
|
+
metadata?: Record<string, any> | undefined;
|
|
118
136
|
}[] | undefined;
|
|
119
137
|
}) => any) | undefined;
|
|
120
138
|
"onRead-aloud"?: ((message: {
|
|
121
|
-
role: "assistant";
|
|
122
139
|
id: string;
|
|
140
|
+
role: "assistant";
|
|
123
141
|
name?: string | undefined;
|
|
124
|
-
content?: string | undefined;
|
|
125
142
|
encryptedValue?: string | undefined;
|
|
143
|
+
metadata?: Record<string, any> | undefined;
|
|
144
|
+
content?: string | undefined;
|
|
145
|
+
subagentRunId?: string | undefined;
|
|
126
146
|
toolCalls?: {
|
|
127
147
|
function: {
|
|
128
148
|
name: string;
|
|
@@ -131,14 +151,17 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
131
151
|
type: "function";
|
|
132
152
|
id: string;
|
|
133
153
|
encryptedValue?: string | undefined;
|
|
154
|
+
metadata?: Record<string, any> | undefined;
|
|
134
155
|
}[] | undefined;
|
|
135
156
|
}) => any) | undefined;
|
|
136
157
|
onRegenerate?: ((message: {
|
|
137
|
-
role: "assistant";
|
|
138
158
|
id: string;
|
|
159
|
+
role: "assistant";
|
|
139
160
|
name?: string | undefined;
|
|
140
|
-
content?: string | undefined;
|
|
141
161
|
encryptedValue?: string | undefined;
|
|
162
|
+
metadata?: Record<string, any> | undefined;
|
|
163
|
+
content?: string | undefined;
|
|
164
|
+
subagentRunId?: string | undefined;
|
|
142
165
|
toolCalls?: {
|
|
143
166
|
function: {
|
|
144
167
|
name: string;
|
|
@@ -147,6 +170,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
147
170
|
type: "function";
|
|
148
171
|
id: string;
|
|
149
172
|
encryptedValue?: string | undefined;
|
|
173
|
+
metadata?: Record<string, any> | undefined;
|
|
150
174
|
}[] | undefined;
|
|
151
175
|
}) => any) | undefined;
|
|
152
176
|
}>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotChatAssistantMessage.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/CopilotChatAssistantMessage.vue"],"names":[],"mappings":"AAs4BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAc7D,OAAO,KAAK,EACV,8CAA8C,EAC9C,0CAA0C,EAC1C,mDAAmD,EACnD,mDAAmD,EACnD,oDAAoD,EACpD,oDAAoD,EACpD,kDAAkD,EAClD,iDAAiD,EACjD,2CAA2C,EAC5C,MAAM,SAAS,CAAC;AAKjB,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAUJ,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,0CAA0C,KAAK,OAAO,CAAC;IACxE,kBAAkB,CAAC,EAAE,CACnB,KAAK,EAAE,mDAAmD,KACvD,OAAO,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,2CAA2C,KAAK,OAAO,CAAC;IAC1E,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,8CAA8C,KAClD,OAAO,CAAC;IACb,kBAAkB,CAAC,EAAE,CACnB,KAAK,EAAE,kDAAkD,KACtD,OAAO,CAAC;IACb,oBAAoB,CAAC,EAAE,CACrB,KAAK,EAAE,oDAAoD,KACxD,OAAO,CAAC;IACb,mBAAmB,CAAC,EAAE,CACpB,KAAK,EAAE,mDAAmD,KACvD,OAAO,CAAC;IACb,mBAAmB,CAAC,EAAE,CACpB,KAAK,EAAE,oDAAoD,KACxD,OAAO,CAAC;IACb,iBAAiB,CAAC,EAAE,CAClB,KAAK,EAAE,iDAAiD,KACrD,OAAO,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;CACtD,CAAC;AA07BF,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"CopilotChatAssistantMessage.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/CopilotChatAssistantMessage.vue"],"names":[],"mappings":"AAs4BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAc7D,OAAO,KAAK,EACV,8CAA8C,EAC9C,0CAA0C,EAC1C,mDAAmD,EACnD,mDAAmD,EACnD,oDAAoD,EACpD,oDAAoD,EACpD,kDAAkD,EAClD,iDAAiD,EACjD,2CAA2C,EAC5C,MAAM,SAAS,CAAC;AAKjB,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,gBAAgB,CAAC;IAC1B,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FL,CApFa;oBAoFb,CAnFK;;;;;;;;;;;;;;;;;;0BAmFL,CApFa;oBAoFb,CAnFK;;;;;;;;;;;;;;;;;;0BAmFL,CApFa;oBAoFb,CAnFK;;;;cA2HU,OAAO,EAAE;eACR,OAAO;oBACF,OAAO;6EAu+B1B,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/dist/v2/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@copilotkit/core"),i=require("@ag-ui/client"),e=require("../use-render-activity-message-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@copilotkit/core"),i=require("@ag-ui/client"),e=require("../use-render-activity-message-h2NHCkBt.cjs"),n=require("@copilotkit/shared");exports.A2UIActivityContentSchema=e.A2UIActivityContentSchema;exports.A2UISurfaceActivityRenderer=e._sfc_main;exports.A2UISurfaceActivityType=e.A2UISurfaceActivityType;exports.CopilotChat=e.CopilotChat;exports.CopilotChatAssistantMessage=e._sfc_main$1;exports.CopilotChatAttachmentQueue=e._sfc_main$2;exports.CopilotChatAttachmentRenderer=e._sfc_main$3;exports.CopilotChatAudioRecorder=e._sfc_main$4;exports.CopilotChatConfigurationProvider=e._sfc_main$5;exports.CopilotChatDefaultLabels=e.CopilotChatDefaultLabels;exports.CopilotChatInput=e._sfc_main$6;exports.CopilotChatMessageView=e._sfc_main$7;exports.CopilotChatReasoningMessage=e._sfc_main$8;exports.CopilotChatSuggestionPill=e._sfc_main$9;exports.CopilotChatSuggestionView=e._sfc_main$10;exports.CopilotChatToggleButton=e.CopilotChatToggleButton;exports.CopilotChatToggleButtonCloseIcon=e.CopilotChatToggleButtonCloseIcon;exports.CopilotChatToggleButtonOpenIcon=e.CopilotChatToggleButtonOpenIcon;exports.CopilotChatToolCallsView=e._sfc_main$11;exports.CopilotChatUserMessage=e._sfc_main$12;exports.CopilotChatView=e._sfc_main$13;exports.CopilotKitCoreVue=e.CopilotKitCoreVue;exports.CopilotKitInspector=e._sfc_main$14;exports.CopilotKitProvider=e._sfc_main$15;exports.CopilotModalHeader=e.CopilotModalHeader;exports.CopilotPopup=e._sfc_main$16;exports.CopilotPopupView=e.CopilotPopupView;exports.CopilotSidebar=e._sfc_main$17;exports.CopilotSidebarView=e.CopilotSidebarView;exports.CopilotThreadsDrawer=e._sfc_main$18;exports.GenerateSandboxedUiArgsSchema=e.GenerateSandboxedUiArgsSchema;exports.LicenseContextKey=e.LicenseContextKey;exports.MCPAppsActivityContentSchema=e.MCPAppsActivityContentSchema;exports.MCPAppsActivityRenderer=e.MCPAppsActivityRenderer;exports.MCPAppsActivityType=e.MCPAppsActivityType;exports.OpenGenerativeUIActivityRenderer=e.OpenGenerativeUIActivityRenderer;exports.OpenGenerativeUIActivityType=e.OpenGenerativeUIActivityType;exports.OpenGenerativeUIContentSchema=e.OpenGenerativeUIContentSchema;exports.OpenGenerativeUIRenderer=e.OpenGenerativeUIRenderer;exports.OpenGenerativeUIToolRenderer=e.OpenGenerativeUIToolRenderer;exports.UseAgentUpdate=e.UseAgentUpdate;exports.createA2UIMessageRenderer=e.createA2UIMessageRenderer;exports.createDefaultLicenseRef=e.createDefaultLicenseRef;exports.defineToolCallRenderer=e.defineToolCallRenderer;exports.extractCompleteStyles=e.extractCompleteStyles;exports.getOperationSurfaceId=e.getOperationSurfaceId;exports.processPartialHtml=e.processPartialHtml;exports.useAgent=e.useAgent;exports.useAgentContext=e.useAgentContext;exports.useAttachments=e.useAttachments;exports.useCapabilities=e.useCapabilities;exports.useComponent=e.useComponent;exports.useConfigureSuggestions=e.useConfigureSuggestions;exports.useCopilotChatConfiguration=e.useCopilotChatConfiguration;exports.useCopilotKit=e.useCopilotKit;exports.useDefaultRenderTool=e.useDefaultRenderTool;exports.useFrontendTool=e.useFrontendTool;exports.useHumanInTheLoop=e.useHumanInTheLoop;exports.useInterrupt=e.useInterrupt;exports.useKatexStyles=e.useKatexStyles;exports.useKeyboardHeight=e.useKeyboardHeight;exports.useLicenseContext=e.useLicenseContext;exports.useRenderActivityMessage=e.useRenderActivityMessage;exports.useRenderCustomMessages=e.useRenderCustomMessages;exports.useRenderTool=e.useRenderTool;exports.useSandboxFunctions=e.useSandboxFunctions;exports.useSuggestions=e.useSuggestions;exports.useThreads=e.useThreads;exports.vueBasicCatalog=e.vueBasicCatalog;Object.defineProperty(exports,"createLicenseContextValue",{enumerable:!0,get:()=>n.createLicenseContextValue});Object.keys(o).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>o[t]})});Object.keys(i).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>i[t]})});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/v2/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "@copilotkit/core";
|
|
2
2
|
export * from "@ag-ui/client";
|
|
3
|
-
import { A as o, _ as i, a as n, C, b as r, c as p, d as l, e as u, f as c, g, h as d, i as h, j as A, k as v, l as S, m, n as y, o as I, p as f, q as R, r as T, s as U, t as x, u as M, v as P, w as b, x as V, y as w, z as K, B as O, G, L, M as B, D, E as H, O as F, F as Q, H as j, I as k, J as q, U as z, K as E, N as J, P as N, Q as W, R as X, S as Y, T as Z, V as _, W as $, X as ee, Y as ae, Z as te, $ as se, a0 as oe, a1 as ie, a2 as ne, a3 as Ce, a4 as re, a5 as pe, a6 as le, a7 as ue, a8 as ce, a9 as ge, aa as de, ab as he, ac as Ae, ad as ve, ae as Se } from "../use-render-activity-message-
|
|
3
|
+
import { A as o, _ as i, a as n, C, b as r, c as p, d as l, e as u, f as c, g, h as d, i as h, j as A, k as v, l as S, m, n as y, o as I, p as f, q as R, r as T, s as U, t as x, u as M, v as P, w as b, x as V, y as w, z as K, B as O, G, L, M as B, D, E as H, O as F, F as Q, H as j, I as k, J as q, U as z, K as E, N as J, P as N, Q as W, R as X, S as Y, T as Z, V as _, W as $, X as ee, Y as ae, Z as te, $ as se, a0 as oe, a1 as ie, a2 as ne, a3 as Ce, a4 as re, a5 as pe, a6 as le, a7 as ue, a8 as ce, a9 as ge, aa as de, ab as he, ac as Ae, ad as ve, ae as Se } from "../use-render-activity-message-ytoSQi6V.js";
|
|
4
4
|
import { createLicenseContextValue as ye } from "@copilotkit/shared";
|
|
5
5
|
export {
|
|
6
6
|
o as A2UIActivityContentSchema,
|
|
@@ -28,7 +28,17 @@ export interface CopilotKitProviderProps {
|
|
|
28
28
|
sandboxFunctions?: SandboxFunction[];
|
|
29
29
|
designSkill?: string;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated This prop no longer controls the Inspector. Use
|
|
33
|
+
* `enableInspector` instead.
|
|
34
|
+
*/
|
|
31
35
|
showDevConsole?: boolean | "auto";
|
|
36
|
+
/**
|
|
37
|
+
* Disable the CopilotKit Inspector in development.
|
|
38
|
+
* The Inspector is enabled by default in development browser builds and is
|
|
39
|
+
* always disabled in production and during server rendering.
|
|
40
|
+
*/
|
|
41
|
+
enableInspector?: boolean;
|
|
32
42
|
onError?: (event: {
|
|
33
43
|
error: Error;
|
|
34
44
|
code: CopilotKitCoreErrorCode;
|
|
@@ -40,15 +50,6 @@ export interface CopilotKitProviderProps {
|
|
|
40
50
|
loadingComponent?: Component;
|
|
41
51
|
includeSchema?: boolean;
|
|
42
52
|
};
|
|
43
|
-
/**
|
|
44
|
-
* Default anchor corner for the inspector button and window.
|
|
45
|
-
* Only used on first load before the user drags to a custom position.
|
|
46
|
-
* Defaults to `{ horizontal: "right", vertical: "top" }`.
|
|
47
|
-
*/
|
|
48
|
-
inspectorDefaultAnchor?: {
|
|
49
|
-
horizontal: "left" | "right";
|
|
50
|
-
vertical: "top" | "bottom";
|
|
51
|
-
};
|
|
52
53
|
/**
|
|
53
54
|
* Enable debug logging for the client-side event pipeline.
|
|
54
55
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotKitProvider.types.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/CopilotKitProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClE,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAClD,eAAe,CAAC,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;IAC7C,sBAAsB,CAAC,EAAE,0BAA0B,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/D,oBAAoB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAClD,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;IAClC,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE;QACjB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;QACrC,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAChB,KAAK,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,uBAAuB,CAAC;QAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC9B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF
|
|
1
|
+
{"version":3,"file":"CopilotKitProvider.types.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/CopilotKitProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,0BAA0B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,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAChB,KAAK,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,uBAAuB,CAAC;QAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC9B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AbstractAgent } from "@ag-ui/client";
|
|
2
2
|
import type { CopilotKitProviderProps } from "./CopilotKitProvider.types";
|
|
3
|
-
import type { SandboxFunction, VueActivityMessageRenderer, VueFrontendTool
|
|
3
|
+
import type { SandboxFunction, VueActivityMessageRenderer, VueFrontendTool } from "../types";
|
|
4
4
|
declare var __VLS_1: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
6
|
default?: (props: typeof __VLS_1) => any;
|
|
@@ -14,12 +14,12 @@ declare const __VLS_component: import("vue").DefineComponent<CopilotKitProviderP
|
|
|
14
14
|
agents__unsafe_dev_only: Record<string, AbstractAgent>;
|
|
15
15
|
selfManagedAgents: Record<string, AbstractAgent>;
|
|
16
16
|
frontendTools: VueFrontendTool[];
|
|
17
|
-
humanInTheLoop: VueHumanInTheLoop[];
|
|
17
|
+
humanInTheLoop: import("..").VueHumanInTheLoop[];
|
|
18
18
|
openGenerativeUI: {
|
|
19
19
|
sandboxFunctions?: SandboxFunction[];
|
|
20
20
|
designSkill?: string;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
enableInspector: boolean;
|
|
23
23
|
a2ui: {
|
|
24
24
|
theme?: import("..").A2UITheme;
|
|
25
25
|
catalog?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotKitProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/CopilotKitProvider.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CopilotKitProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/CopilotKitProvider.vue"],"names":[],"mappings":"AA+tBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAqCnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,eAAe,EAEhB,MAAM,UAAU,CAAC;AA6tBlB,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA4B/C,QAAA,MAAM,eAAe;;;;;;;;;;;wBAhzBrB,CA7qBK;mBA6qBL,CA7qB0C;;;;aA6qB1C,CA7pBgD;eA6pBhD,CA5pBoB;wBA4pBpB,CA5pBgD;qBA4pBhD,CA5pB+E;;6EAm9C7E,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -14,4 +14,14 @@ export interface CopilotKitContextValue {
|
|
|
14
14
|
export declare const CopilotKitKey: InjectionKey<CopilotKitContextValue>;
|
|
15
15
|
export declare const CopilotChatConfigurationKey: InjectionKey<ComputedRef<CopilotChatConfigurationValue>>;
|
|
16
16
|
export declare const SandboxFunctionsKey: InjectionKey<Ref<readonly SandboxFunction[]>>;
|
|
17
|
+
export type VueInspectorOpenRequest = {
|
|
18
|
+
messageId: string;
|
|
19
|
+
threadId?: string;
|
|
20
|
+
agentId?: string;
|
|
21
|
+
};
|
|
22
|
+
export type VueInspectorContextValue = {
|
|
23
|
+
isInspectorEnabled: ComputedRef<boolean>;
|
|
24
|
+
openInspector: (request: VueInspectorOpenRequest) => void;
|
|
25
|
+
};
|
|
26
|
+
export declare const InspectorKey: InjectionKey<VueInspectorContextValue>;
|
|
17
27
|
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/v2/providers/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC1C,oBAAoB,EAAE,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,SAAS,EAAE,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAC9C,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,oBAAoB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3C,iBAAiB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,sBAAsB,CACzC,CAAC;AAEvB,eAAO,MAAM,2BAA2B,EAAE,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C,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,kBAAkB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,aAAa,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,wBAAwB,CAE/D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.70.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Vue 3 components and composables for CopilotKit",
|
|
6
6
|
"keywords": [
|
|
@@ -62,18 +62,18 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@a2ui/web_core": "0.10.4",
|
|
65
|
-
"@ag-ui/client": "0.0.
|
|
66
|
-
"@ag-ui/core": "0.0.
|
|
65
|
+
"@ag-ui/client": "0.0.59",
|
|
66
|
+
"@ag-ui/core": "0.0.59",
|
|
67
67
|
"@jetbrains/websandbox": "^1.1.3",
|
|
68
68
|
"katex": "^0.16.27",
|
|
69
69
|
"lucide-vue-next": "^0.525.0",
|
|
70
70
|
"streamdown-vue": "^1.0.29",
|
|
71
71
|
"zod": "^3.25.75",
|
|
72
72
|
"zod-to-json-schema": "^3.24.5",
|
|
73
|
-
"@copilotkit/core": "1.
|
|
74
|
-
"@copilotkit/web-components": "1.
|
|
75
|
-
"@copilotkit/
|
|
76
|
-
"@copilotkit/
|
|
73
|
+
"@copilotkit/core": "1.70.0",
|
|
74
|
+
"@copilotkit/web-components": "1.70.0",
|
|
75
|
+
"@copilotkit/web-inspector": "1.70.0",
|
|
76
|
+
"@copilotkit/shared": "1.70.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@eslint/js": "^9.39.2",
|
|
@@ -2,4 +2,35 @@ import { vi } from "vitest";
|
|
|
2
2
|
|
|
3
3
|
export const WEB_INSPECTOR_TAG = "cpk-web-inspector";
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export class WebInspectorElement extends HTMLElement {
|
|
6
|
+
autoAttachCore = true;
|
|
7
|
+
core: unknown = null;
|
|
8
|
+
autoAttachCoreAtConnection = true;
|
|
9
|
+
coreAtConnection: unknown = null;
|
|
10
|
+
openInspector = vi.fn();
|
|
11
|
+
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
this.autoAttachCoreAtConnection = this.autoAttachCore;
|
|
14
|
+
this.coreAtConnection = this.core;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const defineWebInspector = vi.fn(() => {
|
|
19
|
+
if (!customElements.get(WEB_INSPECTOR_TAG)) {
|
|
20
|
+
customElements.define(WEB_INSPECTOR_TAG, WebInspectorElement);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const configureWebInspectorElement = vi.fn(
|
|
25
|
+
(
|
|
26
|
+
inspector: HTMLElement & {
|
|
27
|
+
autoAttachCore?: boolean;
|
|
28
|
+
core?: unknown;
|
|
29
|
+
},
|
|
30
|
+
core: unknown,
|
|
31
|
+
) => {
|
|
32
|
+
inspector.autoAttachCore = false;
|
|
33
|
+
inspector.core = core;
|
|
34
|
+
return inspector;
|
|
35
|
+
},
|
|
36
|
+
);
|
|
@@ -3,23 +3,46 @@ defineOptions({
|
|
|
3
3
|
inheritAttrs: false,
|
|
4
4
|
});
|
|
5
5
|
|
|
6
|
-
import { onMounted, onUnmounted, shallowRef, useAttrs } from "vue";
|
|
6
|
+
import { onMounted, onUnmounted, shallowRef, useAttrs, watch } from "vue";
|
|
7
|
+
import type { ObjectDirective } from "vue";
|
|
8
|
+
import type { WebInspectorElement } from "@copilotkit/web-inspector";
|
|
7
9
|
import type { CopilotKitCoreVue } from "../lib/vue-core";
|
|
10
|
+
import type { VueInspectorOpenRequest } from "../providers/keys";
|
|
8
11
|
|
|
9
12
|
const props = defineProps<{
|
|
10
13
|
core?: CopilotKitCoreVue | null;
|
|
14
|
+
openRequest?: VueInspectorOpenRequest | null;
|
|
11
15
|
}>();
|
|
12
16
|
|
|
13
17
|
const attrs = useAttrs();
|
|
14
18
|
const inspectorTag = shallowRef<string | null>(null);
|
|
19
|
+
const inspector = shallowRef<WebInspectorElement | null>(null);
|
|
15
20
|
|
|
16
21
|
let isMounted = true;
|
|
22
|
+
let configureInspector:
|
|
23
|
+
| ((
|
|
24
|
+
element: WebInspectorElement,
|
|
25
|
+
core: CopilotKitCoreVue | null,
|
|
26
|
+
) => WebInspectorElement)
|
|
27
|
+
| null = null;
|
|
28
|
+
|
|
29
|
+
const vConfigureInspector: ObjectDirective<WebInspectorElement, undefined> = {
|
|
30
|
+
created(element) {
|
|
31
|
+
configureInspector?.(element, props.core ?? null);
|
|
32
|
+
inspector.value = element;
|
|
33
|
+
if (props.openRequest) {
|
|
34
|
+
element.openInspector?.("message_toolbar", props.openRequest);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
17
38
|
|
|
18
39
|
onMounted(() => {
|
|
19
40
|
void import("@copilotkit/web-inspector")
|
|
20
41
|
.then((mod) => {
|
|
21
|
-
mod.defineWebInspector?.();
|
|
22
42
|
if (!isMounted) return;
|
|
43
|
+
|
|
44
|
+
mod.defineWebInspector?.();
|
|
45
|
+
configureInspector = mod.configureWebInspectorElement;
|
|
23
46
|
inspectorTag.value = mod.WEB_INSPECTOR_TAG;
|
|
24
47
|
})
|
|
25
48
|
.catch((error: unknown) => {
|
|
@@ -29,7 +52,22 @@ onMounted(() => {
|
|
|
29
52
|
|
|
30
53
|
onUnmounted(() => {
|
|
31
54
|
isMounted = false;
|
|
55
|
+
inspector.value = null;
|
|
32
56
|
});
|
|
57
|
+
|
|
58
|
+
watch(
|
|
59
|
+
() => props.core,
|
|
60
|
+
(core) => {
|
|
61
|
+
if (inspector.value) inspector.value.core = core ?? null;
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
watch(
|
|
66
|
+
() => props.openRequest,
|
|
67
|
+
(request) => {
|
|
68
|
+
if (request) inspector.value?.openInspector?.("message_toolbar", request);
|
|
69
|
+
},
|
|
70
|
+
);
|
|
33
71
|
</script>
|
|
34
72
|
|
|
35
73
|
<template>
|
|
@@ -37,6 +75,6 @@ onUnmounted(() => {
|
|
|
37
75
|
:is="inspectorTag"
|
|
38
76
|
v-if="inspectorTag"
|
|
39
77
|
v-bind="attrs"
|
|
40
|
-
|
|
78
|
+
v-configure-inspector
|
|
41
79
|
/>
|
|
42
80
|
</template>
|
|
@@ -19,7 +19,7 @@ describe("CopilotKitInspector", () => {
|
|
|
19
19
|
it("renders nothing until the web inspector module resolves", async () => {
|
|
20
20
|
const wrapper = mount(CopilotKitInspector);
|
|
21
21
|
|
|
22
|
-
expect(wrapper.
|
|
22
|
+
expect(wrapper.find("cpk-web-inspector").exists()).toBe(false);
|
|
23
23
|
|
|
24
24
|
await settleInspectorLoad();
|
|
25
25
|
|
|
@@ -45,13 +45,38 @@ describe("CopilotKitInspector", () => {
|
|
|
45
45
|
await settleInspectorLoad();
|
|
46
46
|
|
|
47
47
|
const inspector = wrapper.get("cpk-web-inspector");
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const inspectorElement = inspector.element as HTMLElement & {
|
|
49
|
+
autoAttachCore?: boolean;
|
|
50
|
+
core?: CopilotKitCoreVue;
|
|
51
|
+
};
|
|
51
52
|
|
|
52
53
|
expect(inspector.attributes("data-testid")).toBe("inspector");
|
|
53
54
|
expect(inspector.attributes("data-surface")).toBe("storybook");
|
|
54
|
-
expect(
|
|
55
|
-
expect(
|
|
55
|
+
expect(inspectorElement.autoAttachCore).toBe(false);
|
|
56
|
+
expect(inspectorElement.core).toBeInstanceOf(CopilotKitCoreVue);
|
|
57
|
+
expect(inspectorElement.core?.runtimeUrl).toBe("/api/copilotkit");
|
|
58
|
+
|
|
59
|
+
await wrapper.setProps({ "data-surface": "updated" });
|
|
60
|
+
expect(wrapper.get("cpk-web-inspector").attributes("data-surface")).toBe(
|
|
61
|
+
"updated",
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("forwards Inspector open requests to the mounted element", async () => {
|
|
66
|
+
const openRequest = { messageId: "message-1" };
|
|
67
|
+
const wrapper = mount(CopilotKitInspector, {
|
|
68
|
+
props: { openRequest },
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
await settleInspectorLoad();
|
|
72
|
+
|
|
73
|
+
const inspector = wrapper.get("cpk-web-inspector")
|
|
74
|
+
.element as HTMLElement & {
|
|
75
|
+
openInspector: ReturnType<typeof vi.fn>;
|
|
76
|
+
};
|
|
77
|
+
expect(inspector.openInspector).toHaveBeenCalledWith(
|
|
78
|
+
"message_toolbar",
|
|
79
|
+
openRequest,
|
|
80
|
+
);
|
|
56
81
|
});
|
|
57
82
|
});
|
|
@@ -44,6 +44,8 @@ const mockUseCopilotKit = useCopilotKit as ReturnType<typeof vi.fn>;
|
|
|
44
44
|
const threadMocks = vi.hoisted(() => ({
|
|
45
45
|
sockets: [] as any[],
|
|
46
46
|
dispatchedContexts: [] as Array<ThreadState["context"]>,
|
|
47
|
+
/** Every environment `ɵcreateThreadStore` was constructed with. */
|
|
48
|
+
storeEnvironments: [] as Array<{ fetch?: unknown }>,
|
|
47
49
|
}));
|
|
48
50
|
|
|
49
51
|
function compareThreadsByActivity(left: ThreadRecord, right: ThreadRecord) {
|
|
@@ -344,7 +346,10 @@ vi.mock("@copilotkit/core", () => {
|
|
|
344
346
|
Connected: "connected",
|
|
345
347
|
Error: "error",
|
|
346
348
|
},
|
|
347
|
-
ɵcreateThreadStore: () =>
|
|
349
|
+
ɵcreateThreadStore: (environment: { fetch?: unknown }) => {
|
|
350
|
+
threadMocks.storeEnvironments.push(environment);
|
|
351
|
+
return new MockThreadStore();
|
|
352
|
+
},
|
|
348
353
|
ɵselectThreads: select((state) => state.threads),
|
|
349
354
|
ɵselectThreadsIsLoading: select((state) => state.isLoading),
|
|
350
355
|
ɵselectThreadsError: select((state) => state.error),
|
|
@@ -358,6 +363,10 @@ vi.mock("@copilotkit/core", () => {
|
|
|
358
363
|
const fetchMock = vi.fn();
|
|
359
364
|
globalThis.fetch = fetchMock;
|
|
360
365
|
|
|
366
|
+
const runtimeFetchMock = vi.fn((...args: unknown[]) =>
|
|
367
|
+
(fetchMock as (...a: unknown[]) => unknown)(...args),
|
|
368
|
+
);
|
|
369
|
+
|
|
361
370
|
const { CopilotKitCoreRuntimeConnectionStatus } =
|
|
362
371
|
await import("@copilotkit/core");
|
|
363
372
|
|
|
@@ -391,6 +400,7 @@ type MockCopilotKit = {
|
|
|
391
400
|
threadEndpoints: ThreadEndpointRuntimeInfo | undefined;
|
|
392
401
|
registerThreadStore: ReturnType<typeof vi.fn>;
|
|
393
402
|
unregisterThreadStore: ReturnType<typeof vi.fn>;
|
|
403
|
+
ɵruntimeFetch: typeof fetch;
|
|
394
404
|
};
|
|
395
405
|
|
|
396
406
|
function setupCopilotKit(
|
|
@@ -410,6 +420,7 @@ function setupCopilotKit(
|
|
|
410
420
|
threadEndpoints: supportedThreadEndpoints,
|
|
411
421
|
registerThreadStore: vi.fn(),
|
|
412
422
|
unregisterThreadStore: vi.fn(),
|
|
423
|
+
ɵruntimeFetch: runtimeFetchMock as unknown as typeof fetch,
|
|
413
424
|
...overrides,
|
|
414
425
|
});
|
|
415
426
|
mockUseCopilotKit.mockReturnValue({ copilotkit });
|
|
@@ -487,10 +498,22 @@ describe("useThreads", () => {
|
|
|
487
498
|
beforeEach(() => {
|
|
488
499
|
threadMocks.sockets.splice(0);
|
|
489
500
|
threadMocks.dispatchedContexts.splice(0);
|
|
501
|
+
threadMocks.storeEnvironments.splice(0);
|
|
490
502
|
fetchMock.mockReset();
|
|
491
503
|
setupCopilotKit();
|
|
492
504
|
});
|
|
493
505
|
|
|
506
|
+
it("builds the thread store with the core's instrumented fetch", () => {
|
|
507
|
+
const copilotkit = setupCopilotKit();
|
|
508
|
+
mountHook();
|
|
509
|
+
|
|
510
|
+
expect(threadMocks.storeEnvironments).toHaveLength(1);
|
|
511
|
+
expect(threadMocks.storeEnvironments[0]!.fetch).toBe(
|
|
512
|
+
copilotkit.value.ɵruntimeFetch,
|
|
513
|
+
);
|
|
514
|
+
expect(threadMocks.storeEnvironments[0]!.fetch).not.toBe(globalThis.fetch);
|
|
515
|
+
});
|
|
516
|
+
|
|
494
517
|
it("fetches threads and subscribes to the user metadata channel", async () => {
|
|
495
518
|
fetchMock
|
|
496
519
|
.mockReturnValueOnce(
|
|
@@ -90,7 +90,7 @@ function bindThreadStoreSelector<T>(
|
|
|
90
90
|
export function useThreads(input: UseThreadsInput): UseThreadsResult {
|
|
91
91
|
const { copilotkit } = useCopilotKit();
|
|
92
92
|
const store = ɵcreateThreadStore({
|
|
93
|
-
fetch:
|
|
93
|
+
fetch: copilotkit.value.ɵruntimeFetch,
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
const resolvedAgentId = computed(() => toValue(input.agentId));
|
|
@@ -37,7 +37,17 @@ export interface CopilotKitProviderProps {
|
|
|
37
37
|
sandboxFunctions?: SandboxFunction[];
|
|
38
38
|
designSkill?: string;
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated This prop no longer controls the Inspector. Use
|
|
42
|
+
* `enableInspector` instead.
|
|
43
|
+
*/
|
|
40
44
|
showDevConsole?: boolean | "auto";
|
|
45
|
+
/**
|
|
46
|
+
* Disable the CopilotKit Inspector in development.
|
|
47
|
+
* The Inspector is enabled by default in development browser builds and is
|
|
48
|
+
* always disabled in production and during server rendering.
|
|
49
|
+
*/
|
|
50
|
+
enableInspector?: boolean;
|
|
41
51
|
onError?: (event: {
|
|
42
52
|
error: Error;
|
|
43
53
|
code: CopilotKitCoreErrorCode;
|
|
@@ -49,15 +59,6 @@ export interface CopilotKitProviderProps {
|
|
|
49
59
|
loadingComponent?: Component;
|
|
50
60
|
includeSchema?: boolean;
|
|
51
61
|
};
|
|
52
|
-
/**
|
|
53
|
-
* Default anchor corner for the inspector button and window.
|
|
54
|
-
* Only used on first load before the user drags to a custom position.
|
|
55
|
-
* Defaults to `{ horizontal: "right", vertical: "top" }`.
|
|
56
|
-
*/
|
|
57
|
-
inspectorDefaultAnchor?: {
|
|
58
|
-
horizontal: "left" | "right";
|
|
59
|
-
vertical: "top" | "bottom";
|
|
60
|
-
};
|
|
61
62
|
/**
|
|
62
63
|
* Enable debug logging for the client-side event pipeline.
|
|
63
64
|
*
|