@copilotkit/vue 1.67.1 → 1.68.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 +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{use-render-activity-message-CaArNmtw.js → use-render-activity-message-DljRBrXN.js} +3401 -3370
- package/dist/use-render-activity-message-DljRBrXN.js.map +1 -0
- package/dist/use-render-activity-message-bkrPa-92.cjs +85 -0
- package/dist/use-render-activity-message-bkrPa-92.cjs.map +1 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -1
- package/dist/v2/hooks/use-agent.d.ts +66 -5
- 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 +5 -5
- package/src/v2/components/chat/CopilotChat.vue +14 -1
- package/src/v2/components/chat/CopilotChatMessageView.vue +5 -7
- package/src/v2/components/chat/__tests__/CopilotChat.clearOnFresh.test.ts +14 -25
- package/src/v2/components/chat/__tests__/CopilotChat.slots.e2e.test.ts +1 -2
- package/src/v2/components/chat/__tests__/CopilotChat.test.ts +2 -3
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +6 -6
- package/src/v2/components/chat/__tests__/MCPAppsUiMessage.e2e.test.ts +14 -0
- package/src/v2/hooks/__tests__/use-agent-thread-pinning.test.ts +179 -0
- package/src/v2/hooks/use-agent.ts +205 -78
- package/dist/use-render-activity-message-CNbp9Fob.cjs +0 -85
- package/dist/use-render-activity-message-CNbp9Fob.cjs.map +0 -1
- package/dist/use-render-activity-message-CaArNmtw.js.map +0 -1
- package/src/v2/hooks/__tests__/use-agent-thread-isolation.test.ts +0 -433
package/PARITY.md
CHANGED
|
@@ -355,7 +355,7 @@ Current snapshot: mapped React->Vue counterpart rows are either `matched` or `in
|
|
|
355
355
|
| `CopilotChat.attachments.test.tsx` | `CopilotChat.attachments.test.ts` | matched | Dedicated strict counterpart mirrors React `onUploadFailed` coverage (`invalid-type`, `file-too-large`, `upload-failed`, multi-reject, and valid-file no-failure), validates Vue attachment drop flow through `CopilotChat`, and now asserts stable attachment action identities across input-only rerenders. Attachment public-surface closure is complete via exported `CopilotChatAttachmentQueue` / `CopilotChatAttachmentRenderer` plus `Attachment` / `AttachmentsConfig` / `AttachmentModality` type exports. |
|
|
356
356
|
| `CopilotChat.onError.test.tsx` | `CopilotChat.onError.test.ts` | matched | Dedicated strict counterpart exists with React-matching suite and case wording. |
|
|
357
357
|
| `CopilotChat.slots.e2e.test.tsx` | `CopilotChat.slots.e2e.test.ts` | matched | Dedicated slot forwarding and override suite. |
|
|
358
|
-
| `CopilotChatActivityRendering.e2e.test.tsx` | `CopilotChatActivityRendering.e2e.test.ts` | matched | Suite/case titles and approach now match React, including
|
|
358
|
+
| `CopilotChatActivityRendering.e2e.test.tsx` | `CopilotChatActivityRendering.e2e.test.ts` | matched | Suite/case titles and approach now match React, including the agent handed to activity renderers (now the registry agent with the thread pinned onto it, since thread cloning was removed), both `MockReconnectableAgent` durable-compaction restoration cases (`a2ui-surface` and `open-generative-ui`), and the `IntelligenceAgent /connect` gateway-replay restoration case (`restores a completed A2UI surface from IntelligenceAgent /connect gateway replay`) ported on `N3` with colocated Phoenix mock infrastructure (`MockPhoenixPush` / `MockPhoenixChannel` / `MockPhoenixSocket` / `mockPhoenixSockets` / `triggerJoin` / `serverPush`). |
|
|
359
359
|
| `CopilotChatAssistantMessage.slots.e2e.test.tsx` | `CopilotChatAssistantMessage.slots.e2e.test.ts` | matched | Dedicated strict slot counterpart now mirrors React section/case structure (`26` cases) using Vue slot translation boundaries. |
|
|
360
360
|
| `CopilotChatAssistantMessage.test.tsx` | `CopilotChatAssistantMessage.test.ts` | matched | Dedicated strict counterpart now mirrors the React unit suite structure/case wording (`32` mirrored cases) using Vue slot translation, including a `#layout` counterpart for children-render-prop coverage; Vue-only checks are isolated in a trailing block. |
|
|
361
361
|
| `CopilotChatAssistantMessage.thumbs.test.tsx` | `CopilotChatAssistantMessage.thumbs.test.ts` | matched | Dedicated strict counterpart for the React `#3457` thumbs callback payload fix. Asserts `@thumbs-up` / `@thumbs-down` emit the full `AssistantMessage` payload (id/role/content) and not an event-shaped object (no `nativeEvent`, `target`, or `currentTarget`). |
|
|
@@ -392,7 +392,7 @@ Current snapshot: mapped React->Vue counterpart rows are either `matched` or `in
|
|
|
392
392
|
| `use-agent-context-timing.e2e.test.tsx` | `use-agent-context-timing.e2e.test.ts` | matched | Dedicated strict counterpart exists and now passes with React-matching follow-up context behavior (`{"spicy":false}` on the second run). |
|
|
393
393
|
| `use-agent-error-state.test.tsx` | `use-agent-error-state.test.ts` | matched | Dedicated strict counterpart now matches React error-state behavior by returning a provisional runtime agent instead of throwing when runtime sync fails. |
|
|
394
394
|
| `use-agent-stability.test.tsx` | `use-agent-stability.test.ts` | matched | Dedicated strict counterpart now matches React provisional-agent caching semantics across Disconnected->Connecting->Connected transitions. |
|
|
395
|
-
| `
|
|
395
|
+
| `threadid-propagation.contract.test.tsx` | `use-agent-thread-pinning.test.ts` | matched | Thread cloning was removed from both frameworks. The Vue counterpart covers the replacement contract: one shared instance per agentId (never a copy), chat-configuration thread pinning gated on `hasExplicitThreadId`, and the all-or-nothing `agentId`/`runtimeAgentId`/`threadId` guards. |
|
|
396
396
|
| `use-attachments.test.tsx` | `use-attachments.test.ts` | matched | Dedicated strict counterpart validates stable attachment action identities across rerenders/config identity changes, latest-config reads without stale closures, and empty-queue `consumeAttachments()` no-op semantics. Vue-specific trailing coverage verifies uploaded attachment sources remain non-reactive and `structuredClone`-safe before and after `consumeAttachments()`. |
|
|
397
397
|
| `use-configure-suggestions.e2e.test.tsx` | `use-configure-suggestions.e2e.test.ts` (+ `use-configure-suggestions.test.ts`) | matched | Dedicated strict e2e counterpart exists and now passes the full React-mirrored suite, including deferred reload behavior during in-progress runs. |
|
|
398
398
|
| `use-frontend-tool-available.test.tsx` | `use-frontend-tool-available.test.ts` | matched | Dedicated strict counterpart exists with React-matching suite and case wording. |
|
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-bkrPa-92.cjs"),i=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?r=>Promise.resolve(s(r)):void 0,v=typeof u=="function"?r=>{const h=typeof r.result=="string"?{...r,result:C.parseJson(r.result,r.result)}:r;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=i.ref(void 0),c=n??[];return i.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 r;try{r=g?g(d,p):JSON.stringify(p)}catch(h){console.warn(`[CopilotKit] useCopilotReadable: failed to serialize value for "${d}":`,h),r=String(p)}v!=="disabled"&&(t.value=u.addContext({description:d,value:r}),f(()=>{t.value&&u.removeContext(t.value)}))},{immediate:!0}),t}const T=i.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)=>(i.openBlock(),i.createBlock(e._sfc_main$15,i.normalizeProps(i.guardReactiveProps(n)),{default:i.withCtx(()=>[i.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.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.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=T;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 { aa as g, a3 as y, a2 as v, a0 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 ae, k as te, 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, B as ve, G as he, L as Ae, M as ye, D as be, E as Ie, O as Re, F as Se, H as Te, I as xe, J as we, U 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 De, Y as He, Z as Fe, $ as Ge, a1 as $e, a4 as ke, a5 as We, a6 as Je, a7 as je, a8 as Ee, a9 as qe, ab as Ne, ac as Qe, ad as Ze, ae as Xe } from "./use-render-activity-message-
|
|
3
|
+
import { aa as g, a3 as y, a2 as v, a0 as b, u as I } from "./use-render-activity-message-DljRBrXN.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 ae, k as te, 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, B as ve, G as he, L as Ae, M as ye, D as be, E as Ie, O as Re, F as Se, H as Te, I as xe, J as we, U 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 De, Y as He, Z as Fe, $ as Ge, a1 as $e, a4 as ke, a5 as We, a6 as Je, a7 as je, a8 as Ee, a9 as qe, ab as Ne, ac as Qe, ad as Ze, ae as Xe } from "./use-render-activity-message-DljRBrXN.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 ea } from "@copilotkit/shared";
|