@copilotkit/vue 1.62.0 → 1.62.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/PARITY.md +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{use-render-activity-message-Bzh3Bckz.js → use-render-activity-message-8_HyVZWc.js} +7 -5
- package/dist/use-render-activity-message-8_HyVZWc.js.map +1 -0
- package/dist/{use-render-activity-message-CW3vipBB.cjs → use-render-activity-message-BqgmNPCz.cjs} +2 -2
- package/dist/use-render-activity-message-BqgmNPCz.cjs.map +1 -0
- package/dist/v2/hooks/use-agent.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/package.json +6 -6
- package/src/v2/hooks/__tests__/use-agent.test.ts +60 -1
- package/src/v2/hooks/use-agent.ts +4 -1
- package/dist/use-render-activity-message-Bzh3Bckz.js.map +0 -1
- package/dist/use-render-activity-message-CW3vipBB.cjs.map +0 -1
package/PARITY.md
CHANGED
|
@@ -324,13 +324,13 @@ Current snapshot: mapped React->Vue counterpart rows are either `matched` or `in
|
|
|
324
324
|
|
|
325
325
|
### APIs and render model
|
|
326
326
|
|
|
327
|
-
| React surface | Vue counterpart | Status | Notes
|
|
328
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- | ---------------------- |
|
|
329
|
-
| `useAgent`, `useAgentContext`, `useSuggestions`, `useConfigureSuggestions`, `useFrontendTool`, `useHumanInTheLoop`, `useInterrupt`, `useThreads` | Same-named Vue composables in `src/hooks` | matched | Headless/data-oriented parity model. `useAgent` delegates subscription, throttle, and subscriber error-guarding to `CopilotKitCore.subscribeToAgentWithOptions` (shared core API) — matching React: `onMessagesChanged` and `onStateChanged` share a single leading+trailing throttle window, and `onRunInitialized` / `onRunFinalized` / `onRunFailed` / `onRunErrorEvent` always fire immediately. |
|
|
330
|
-
| `renderToolCalls` / `useRenderToolCall` | `#tool-call-<toolName>` and `#tool-call` slots | intentional-divergence | Slot translation, behavior parity required.
|
|
331
|
-
| `renderActivityMessages` / `useRenderActivityMessage` | `#activity-<type>` and `#activity-message` slots | intentional-divergence | Slot translation, behavior parity required.
|
|
332
|
-
| `renderCustomMessages` / `useRenderCustomMessages` | `#message-before` and `#message-after` slots, plus provider `renderCustomMessages` | intentional-divergence | Slots remain primary; provider registration is the approved secondary parity surface for ordered/agent-scoped custom message renderers.
|
|
333
|
-
| `useRenderTool`, `useDefaultRenderTool`, `useComponent` | Same-named Vue composables in `src/hooks` | matched | Secondary programmatic APIs now exist with dedicated parity tests, including SFC/component renderer support and React-matching `toolCallId` threading through render-tool prop unions and `CopilotChatToolCallsView` core render props; slots remain the primary customization surface.
|
|
327
|
+
| React surface | Vue counterpart | Status | Notes |
|
|
328
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
329
|
+
| `useAgent`, `useAgentContext`, `useSuggestions`, `useConfigureSuggestions`, `useFrontendTool`, `useHumanInTheLoop`, `useInterrupt`, `useThreads` | Same-named Vue composables in `src/hooks` | matched | Headless/data-oriented parity model. `useAgent` resolves agent IDs with prop -> chat configuration -> default precedence and delegates subscription, throttle, and subscriber error-guarding to `CopilotKitCore.subscribeToAgentWithOptions` (shared core API) — matching React: `onMessagesChanged` and `onStateChanged` share a single leading+trailing throttle window, and `onRunInitialized` / `onRunFinalized` / `onRunFailed` / `onRunErrorEvent` always fire immediately. |
|
|
330
|
+
| `renderToolCalls` / `useRenderToolCall` | `#tool-call-<toolName>` and `#tool-call` slots | intentional-divergence | Slot translation, behavior parity required. |
|
|
331
|
+
| `renderActivityMessages` / `useRenderActivityMessage` | `#activity-<type>` and `#activity-message` slots | intentional-divergence | Slot translation, behavior parity required. |
|
|
332
|
+
| `renderCustomMessages` / `useRenderCustomMessages` | `#message-before` and `#message-after` slots, plus provider `renderCustomMessages` | intentional-divergence | Slots remain primary; provider registration is the approved secondary parity surface for ordered/agent-scoped custom message renderers. |
|
|
333
|
+
| `useRenderTool`, `useDefaultRenderTool`, `useComponent` | Same-named Vue composables in `src/hooks` | matched | Secondary programmatic APIs now exist with dedicated parity tests, including SFC/component renderer support and React-matching `toolCallId` threading through render-tool prop unions and `CopilotChatToolCallsView` core render props; slots remain the primary customization surface. |
|
|
334
334
|
|
|
335
335
|
### Providers
|
|
336
336
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@copilotkit/core"),A=require("@ag-ui/client"),e=require("./use-render-activity-message-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@copilotkit/core"),A=require("@ag-ui/client"),e=require("./use-render-activity-message-BqgmNPCz.cjs"),r=require("vue"),C=require("@copilotkit/shared");function m(o){return typeof o!="function"?o:(n=>{const a=typeof n.result=="string"?{...n,result:C.parseJson(n.result,n.result)}:n;return o(a)})}function _(o,n){const a="parameters"in o?C.getZodParameters(o.parameters):void 0;if(o.name==="*"){e.useRenderTool({name:"*",render:m(o.render),..."agentId"in o?{agentId:o.agentId}:{}},n);return}const t=o;if("renderAndWaitForResponse"in t||"renderAndWait"in t){const l=t.render??t.renderAndWaitForResponse??t.renderAndWait;if(!l){console.warn(`[CopilotKit] useCopilotAction: HITL action '${t.name}' has no render function. Skipping.`);return}e.useHumanInTheLoop({name:t.name,description:t.description,parameters:a,render:m(l),agentId:t.agentId},n);return}if(t.available==="frontend"||t.available==="disabled"){t.render&&a?e.useRenderTool({name:t.name,parameters:a,render:m(t.render),agentId:t.agentId},n):console.warn(`[CopilotKit] useCopilotAction: action '${t.name}' with available="${t.available}" requires both 'render' and 'parameters'. Skipping registration.`);return}const c=t.handler?l=>Promise.resolve(t.handler(l)):void 0;let s;t.available==="remote"?s=!1:t.available!==void 0&&(s=!0),e.useFrontendTool({name:t.name,description:t.description,parameters:a,handler:c,followUp:t.followUp,render:m(t.render),available:s,agentId:t.agentId},n)}function b(o,n){const{name:a,description:t,parameters:c,handler:s,followUp:l,available:f,render:u,agentId:d}=o,p=C.getZodParameters(c),g=s?i=>Promise.resolve(s(i)):void 0,v=typeof u=="function"?i=>{const h=typeof i.result=="string"?{...i,result:C.parseJson(i.result,i.result)}:i;return u(h)}:u;e.useFrontendTool({name:a,description:t,parameters:p,handler:g,followUp:l,render:v,available:f===void 0?void 0:f!=="disabled",agentId:d},n)}function I(o,n){const{copilotkit:a}=e.useCopilotKit(),t=r.ref(void 0),c=n??[];return r.watch([()=>o.description,()=>o.value,()=>o.convert,()=>o.available,...c],(s,l,f)=>{const u=a.value;if(!u)return;const{description:d,value:p,convert:g,available:v}=o;let i;try{i=g?g(d,p):JSON.stringify(p)}catch(h){console.warn(`[CopilotKit] useCopilotReadable: failed to serialize value for "${d}":`,h),i=String(p)}v!=="disabled"&&(t.value=u.addContext({description:d,value:i}),f(()=>{t.value&&u.removeContext(t.value)}))},{immediate:!0}),t}const R=r.defineComponent({__name:"CopilotKit",props:{publicApiKey:{},publicLicenseKey:{},runtimeUrl:{},headers:{type:[Object,Function]},credentials:{},defaultThrottleMs:{},licenseToken:{},properties:{},useSingleEndpoint:{type:Boolean},agents__unsafe_dev_only:{},selfManagedAgents:{},renderToolCalls:{},renderActivityMessages:{},renderCustomMessages:{},frontendTools:{},humanInTheLoop:{},openGenerativeUI:{},showDevConsole:{type:[Boolean,String]},onError:{type:Function},a2ui:{},inspectorDefaultAnchor:{},debug:{type:[Boolean,Object]}},setup(o){const n=o;return(a,t)=>(r.openBlock(),r.createBlock(e._sfc_main$15,r.normalizeProps(r.guardReactiveProps(n)),{default:r.withCtx(()=>[r.renderSlot(a.$slots,"default")]),_:3},16))}});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.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.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:()=>C.createLicenseContextValue});exports.CopilotKit=R;exports.useCopilotAction=_;exports.useCopilotReadable=I;exports.useFrontendTool=b;Object.keys(y).forEach(o=>{o!=="default"&&!Object.prototype.hasOwnProperty.call(exports,o)&&Object.defineProperty(exports,o,{enumerable:!0,get:()=>y[o]})});Object.keys(A).forEach(o=>{o!=="default"&&!Object.prototype.hasOwnProperty.call(exports,o)&&Object.defineProperty(exports,o,{enumerable:!0,get:()=>A[o]})});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "@copilotkit/core";
|
|
2
2
|
export * from "@ag-ui/client";
|
|
3
|
-
import { a9 as g, a2 as y, a1 as v, $ as b, u as I } from "./use-render-activity-message-
|
|
4
|
-
import { A as k, _ as W, a as J, C as j, b as E, c as q, d as N, e as Q, f as Z, g as X, h as Y, i as ee, j as te, k as ae, l as oe, m as ne, n as re, o as se, p as ie, q as le, r as de, s as ue, t as pe, v as ce, w as Ce, x as me, y as fe, z as ge, G as ve, L as he, M as Ae, B as ye, D as be, O as Ie, E as Re, F as Se, H as Te, I as xe, U as we, J as Ue, K as Pe, N as Me, P as Ke, Q as _e, R as ze, S as Oe, T as Ve, V as Be, W as Le, X as He, Y as De, Z as Fe, a0 as Ge, a3 as $e, a4 as ke, a5 as We, a6 as Je, a7 as je, a8 as Ee, aa as qe, ab as Ne, ac as Qe, ad as Ze } from "./use-render-activity-message-
|
|
3
|
+
import { a9 as g, a2 as y, a1 as v, $ as b, u as I } from "./use-render-activity-message-8_HyVZWc.js";
|
|
4
|
+
import { A as k, _ as W, a as J, C as j, b as E, c as q, d as N, e as Q, f as Z, g as X, h as Y, i as ee, j as te, k as ae, l as oe, m as ne, n as re, o as se, p as ie, q as le, r as de, s as ue, t as pe, v as ce, w as Ce, x as me, y as fe, z as ge, G as ve, L as he, M as Ae, B as ye, D as be, O as Ie, E as Re, F as Se, H as Te, I as xe, U as we, J as Ue, K as Pe, N as Me, P as Ke, Q as _e, R as ze, S as Oe, T as Ve, V as Be, W as Le, X as He, Y as De, Z as Fe, a0 as Ge, a3 as $e, a4 as ke, a5 as We, a6 as Je, a7 as je, a8 as Ee, aa as qe, ab as Ne, ac as Qe, ad as Ze } from "./use-render-activity-message-8_HyVZWc.js";
|
|
5
5
|
import { ref as R, watch as S, defineComponent as T, openBlock as x, createBlock as w, normalizeProps as U, guardReactiveProps as P, withCtx as M, renderSlot as K } from "vue";
|
|
6
6
|
import { getZodParameters as h, parseJson as A } from "@copilotkit/shared";
|
|
7
7
|
import { createLicenseContextValue as Ye } from "@copilotkit/shared";
|
package/dist/{use-render-activity-message-Bzh3Bckz.js → use-render-activity-message-8_HyVZWc.js}
RENAMED
|
@@ -3715,8 +3715,10 @@ function Qs(e, n, t) {
|
|
|
3715
3715
|
return a.set(n, o), o;
|
|
3716
3716
|
}
|
|
3717
3717
|
function xn(e = {}) {
|
|
3718
|
-
const n =
|
|
3719
|
-
() => He(e.
|
|
3718
|
+
const n = Le(), t = r(
|
|
3719
|
+
() => He(e.agentId) ?? n.value?.agentId ?? ct
|
|
3720
|
+
), a = r(
|
|
3721
|
+
() => He(e.threadId) ?? n.value?.threadId
|
|
3720
3722
|
), { copilotkit: s } = Be(), o = r(() => e.updates ?? Gs), i = r(() => s.value.defaultThrottleMs), l = r(() => He(e.throttleMs)), c = it(null), g = it(null), C = /* @__PURE__ */ new Map(), p = (u, m, y, v) => {
|
|
3721
3723
|
const k = new Ta({
|
|
3722
3724
|
runtimeUrl: m,
|
|
@@ -3728,7 +3730,7 @@ function xn(e = {}) {
|
|
|
3728
3730
|
};
|
|
3729
3731
|
return L(
|
|
3730
3732
|
[
|
|
3731
|
-
|
|
3733
|
+
t,
|
|
3732
3734
|
() => s.value.agents,
|
|
3733
3735
|
() => s.value.runtimeConnectionStatus,
|
|
3734
3736
|
() => s.value.runtimeUrl,
|
|
@@ -3741,7 +3743,7 @@ function xn(e = {}) {
|
|
|
3741
3743
|
a
|
|
3742
3744
|
],
|
|
3743
3745
|
() => {
|
|
3744
|
-
const u =
|
|
3746
|
+
const u = t.value, m = a.value, y = m ? `${u}:${m}` : u, v = s.value, k = v.getAgent(u);
|
|
3745
3747
|
if (k) {
|
|
3746
3748
|
C.delete(y), C.delete(u);
|
|
3747
3749
|
const S = m ? Qs(k, m, v.headers) : k, O = c.value === S;
|
|
@@ -9170,4 +9172,4 @@ export {
|
|
|
9170
9172
|
Hl as y,
|
|
9171
9173
|
Gl as z
|
|
9172
9174
|
};
|
|
9173
|
-
//# sourceMappingURL=use-render-activity-message-
|
|
9175
|
+
//# sourceMappingURL=use-render-activity-message-8_HyVZWc.js.map
|