@copilotkit/vue 1.69.3 → 1.70.1
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 +7 -0
- package/dist/hooks/use-copilot-action.d.ts.map +1 -1
- package/dist/hooks/use-frontend-tool.d.ts +7 -0
- package/dist/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +35 -23
- package/dist/index.mjs.map +1 -1
- package/dist/use-render-activity-message-CyThomMH.cjs +85 -0
- package/dist/use-render-activity-message-CyThomMH.cjs.map +1 -0
- package/dist/{use-render-activity-message-W2lbqLZH.js → use-render-activity-message-WeN5iF5H.js} +2229 -2204
- package/dist/use-render-activity-message-WeN5iF5H.js.map +1 -0
- 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/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +2 -2
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/hooks/__tests__/use-frontend-tool-webmcp.test.ts +113 -0
- package/src/hooks/use-copilot-action.ts +13 -0
- package/src/hooks/use-frontend-tool.ts +13 -0
- package/src/v2/hooks/__tests__/use-frontend-tool-webmcp.test.ts +282 -0
- package/src/v2/hooks/__tests__/use-threads.test.ts +24 -1
- package/src/v2/hooks/use-frontend-tool.ts +3 -0
- package/src/v2/hooks/use-threads.ts +1 -1
- package/src/v2/providers/CopilotKitProvider.vue +69 -14
- package/src/v2/providers/__tests__/CopilotKitProvider.managedEntitlement.test.ts +290 -0
- package/dist/use-render-activity-message-DMY6Krn-.cjs +0 -85
- package/dist/use-render-activity-message-DMY6Krn-.cjs.map +0 -1
- package/dist/use-render-activity-message-W2lbqLZH.js.map +0 -1
|
@@ -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,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;;;;;;;;;;;;;;;;0BAzgCrB,CApFa;oBAoFb,CAnFK;;;;;;;;;;;;;;;;;;0BAmFL,CApFa;oBAoFb,CAnFK;;;;;;;;;;;;;;;;;;0BAmFL,CApFa;oBAoFb,CAnFK;;;;;;;;;;;;;;;;;;0BAmFL,CApFa;oBAoFb,CAnFK;;;;;;;;;;;;;;;;;;;0BAmFL,CApFa;oBAoFb,CAnFK;;;;;;;;;;;;;;;;;;0BAmFL,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-frontend-tool.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-frontend-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EACxB,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"use-frontend-tool.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-frontend-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EACxB,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,QA6C9B"}
|
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-CyThomMH.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-WeN5iF5H.js";
|
|
4
4
|
import { createLicenseContextValue as ye } from "@copilotkit/shared";
|
|
5
5
|
export {
|
|
6
6
|
o as A2UIActivityContentSchema,
|
|
@@ -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,7 +14,7 @@ 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;
|
|
@@ -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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.70.1",
|
|
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/
|
|
75
|
-
"@copilotkit/
|
|
76
|
-
"@copilotkit/web-
|
|
73
|
+
"@copilotkit/core": "1.70.1",
|
|
74
|
+
"@copilotkit/shared": "1.70.1",
|
|
75
|
+
"@copilotkit/web-components": "1.70.1",
|
|
76
|
+
"@copilotkit/web-inspector": "1.70.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@eslint/js": "^9.39.2",
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { defineComponent, ref, watch } from "vue";
|
|
2
|
+
import { screen, fireEvent, waitFor } from "@testing-library/vue";
|
|
3
|
+
import { describe, it, expect } from "vitest";
|
|
4
|
+
import { useFrontendTool } from "../use-frontend-tool";
|
|
5
|
+
import { useCopilotKit } from "../../v2/providers/useCopilotKit";
|
|
6
|
+
import type { CopilotKitCoreVue } from "../../v2/lib/vue-core";
|
|
7
|
+
import { renderWithCopilotKit } from "../../v2/__tests__/utils/test-helpers";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Component that captures the copilotkit core ref for test assertions.
|
|
11
|
+
*/
|
|
12
|
+
const CoreCapture = defineComponent({
|
|
13
|
+
props: {
|
|
14
|
+
onCore: {
|
|
15
|
+
type: Function as () => (core: CopilotKitCoreVue) => void,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
setup(props) {
|
|
20
|
+
const { copilotkit } = useCopilotKit();
|
|
21
|
+
watch(
|
|
22
|
+
copilotkit,
|
|
23
|
+
(core) => {
|
|
24
|
+
if (core) {
|
|
25
|
+
props.onCore(core);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{ immediate: true },
|
|
29
|
+
);
|
|
30
|
+
return {};
|
|
31
|
+
},
|
|
32
|
+
template: `<div />`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe("useFrontendTool v1 webmcp pass-through", () => {
|
|
36
|
+
it("re-registers tool when a reactive webmcp getter changes", async () => {
|
|
37
|
+
let coreRef: CopilotKitCoreVue | null = null;
|
|
38
|
+
|
|
39
|
+
const ToolComponent = defineComponent({
|
|
40
|
+
setup() {
|
|
41
|
+
const readOnly = ref(false);
|
|
42
|
+
|
|
43
|
+
useFrontendTool(
|
|
44
|
+
{
|
|
45
|
+
name: "v1WebmcpTool",
|
|
46
|
+
description: "A v1 WebMCP-exposed tool",
|
|
47
|
+
handler: async () => ({ ok: true }),
|
|
48
|
+
// Expose webmcp as a getter over reactive state: the registration
|
|
49
|
+
// must re-read it when it changes, not capture the initial value.
|
|
50
|
+
get webmcp() {
|
|
51
|
+
return { annotations: { readOnlyHint: readOnly.value } };
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
[readOnly],
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
readOnly,
|
|
59
|
+
toggle: () => {
|
|
60
|
+
readOnly.value = !readOnly.value;
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
template: `
|
|
65
|
+
<button data-testid="toggle-btn" @click="toggle">
|
|
66
|
+
{{ readOnly ? "Read-write" : "Read-only" }}
|
|
67
|
+
</button>
|
|
68
|
+
`,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const Host = defineComponent({
|
|
72
|
+
components: { ToolComponent, CoreCapture },
|
|
73
|
+
setup() {
|
|
74
|
+
return {
|
|
75
|
+
setCore: (core: CopilotKitCoreVue) => {
|
|
76
|
+
coreRef = core;
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
template: `
|
|
81
|
+
<div>
|
|
82
|
+
<ToolComponent />
|
|
83
|
+
<CoreCapture :on-core="setCore" />
|
|
84
|
+
</div>
|
|
85
|
+
`,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const ui = renderWithCopilotKit({
|
|
89
|
+
children: Host,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
await waitFor(() => {
|
|
93
|
+
expect(coreRef).not.toBeNull();
|
|
94
|
+
const tool = coreRef!.tools.find(
|
|
95
|
+
(entry) => entry.name === "v1WebmcpTool",
|
|
96
|
+
);
|
|
97
|
+
expect(tool).toBeDefined();
|
|
98
|
+
expect(tool!.webmcp).toEqual({ annotations: { readOnlyHint: false } });
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
await fireEvent.click(screen.getByTestId("toggle-btn"));
|
|
102
|
+
|
|
103
|
+
await waitFor(() => {
|
|
104
|
+
const tool = coreRef!.tools.find(
|
|
105
|
+
(entry) => entry.name === "v1WebmcpTool",
|
|
106
|
+
);
|
|
107
|
+
expect(tool).toBeDefined();
|
|
108
|
+
expect(tool!.webmcp).toEqual({ annotations: { readOnlyHint: true } });
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
ui.unmount();
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* v2 composable (useFrontendTool, useHumanInTheLoop, or useRenderTool).
|
|
6
6
|
*/
|
|
7
7
|
import type { WatchSource } from "vue";
|
|
8
|
+
import type { WebMCPToolConfig } from "@copilotkit/core";
|
|
8
9
|
import type { Parameter, MappedParameterTypes } from "@copilotkit/shared";
|
|
9
10
|
import { getZodParameters, parseJson } from "@copilotkit/shared";
|
|
10
11
|
import { useFrontendTool as useFrontendToolV2 } from "../v2/hooks/use-frontend-tool";
|
|
@@ -38,6 +39,12 @@ export interface FrontendAction<T extends Parameter[] | [] = []> {
|
|
|
38
39
|
renderAndWaitForResponse?: VueFrontendTool<MappedParameterTypes<T>>["render"];
|
|
39
40
|
renderAndWait?: VueFrontendTool<MappedParameterTypes<T>>["render"];
|
|
40
41
|
agentId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Also expose this action to browser agents through the WebMCP API
|
|
44
|
+
* (`document.modelContext`). `true` uses default annotations;
|
|
45
|
+
* `{ annotations }` provides WebMCP annotations.
|
|
46
|
+
*/
|
|
47
|
+
webmcp?: boolean | WebMCPToolConfig;
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
export interface CatchAllFrontendAction {
|
|
@@ -162,6 +169,12 @@ export function useCopilotAction<const T extends Parameter[] | [] = []>(
|
|
|
162
169
|
render: wrapRenderWithJsonResult(typedAction.render),
|
|
163
170
|
available: normalizedAvailable,
|
|
164
171
|
agentId: typedAction.agentId,
|
|
172
|
+
// Read webmcp at watch time: the action object may expose it as a getter
|
|
173
|
+
// over reactive state, and capturing the initial value here would
|
|
174
|
+
// re-register a stale configuration.
|
|
175
|
+
get webmcp() {
|
|
176
|
+
return typedAction.webmcp;
|
|
177
|
+
},
|
|
165
178
|
},
|
|
166
179
|
deps,
|
|
167
180
|
);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* then delegates to the v2 composable.
|
|
6
6
|
*/
|
|
7
7
|
import type { WatchSource } from "vue";
|
|
8
|
+
import type { WebMCPToolConfig } from "@copilotkit/core";
|
|
8
9
|
import {
|
|
9
10
|
type Parameter,
|
|
10
11
|
type MappedParameterTypes,
|
|
@@ -23,6 +24,12 @@ export interface UseFrontendToolArgs<T extends Parameter[] | [] = []> {
|
|
|
23
24
|
available?: "disabled" | "enabled";
|
|
24
25
|
render?: VueFrontendTool<MappedParameterTypes<T>>["render"];
|
|
25
26
|
agentId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Also expose this tool to browser agents through the WebMCP API
|
|
29
|
+
* (`document.modelContext`). `true` uses default annotations;
|
|
30
|
+
* `{ annotations }` provides WebMCP annotations.
|
|
31
|
+
*/
|
|
32
|
+
webmcp?: boolean | WebMCPToolConfig;
|
|
26
33
|
}
|
|
27
34
|
|
|
28
35
|
export function useFrontendTool<const T extends Parameter[] = []>(
|
|
@@ -70,6 +77,12 @@ export function useFrontendTool<const T extends Parameter[] = []>(
|
|
|
70
77
|
render: normalizedRender,
|
|
71
78
|
available: available === undefined ? undefined : available !== "disabled",
|
|
72
79
|
agentId,
|
|
80
|
+
// Read webmcp at watch time: the v1 args may expose it as a getter over
|
|
81
|
+
// reactive state, and capturing the initial value here would re-register
|
|
82
|
+
// a stale configuration.
|
|
83
|
+
get webmcp() {
|
|
84
|
+
return tool.webmcp;
|
|
85
|
+
},
|
|
73
86
|
},
|
|
74
87
|
deps,
|
|
75
88
|
);
|