@copilotkit/vue 1.75.2 → 1.77.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.
Files changed (52) hide show
  1. package/PARITY.md +93 -35
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.mjs +275 -158
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/use-render-activity-message-JCCE1lgH.cjs +79 -0
  7. package/dist/use-render-activity-message-JCCE1lgH.cjs.map +1 -0
  8. package/dist/use-render-activity-message-bPlnHjQV.js +12499 -0
  9. package/dist/use-render-activity-message-bPlnHjQV.js.map +1 -0
  10. package/dist/v2/components/MCPAppsActivityRenderer.d.ts +10 -42
  11. package/dist/v2/components/MCPAppsActivityRenderer.d.ts.map +1 -1
  12. package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
  13. package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +8 -152
  14. package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -1
  15. package/dist/v2/components/chat/CopilotChatView.vue.d.ts +1 -1
  16. package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
  17. package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts.map +1 -1
  18. package/dist/v2/components/chat/index.d.ts +3 -3
  19. package/dist/v2/hooks/use-agent.d.ts.map +1 -1
  20. package/dist/v2/index.cjs +1 -1
  21. package/dist/v2/index.d.cts +2 -0
  22. package/dist/v2/index.d.mts +2 -0
  23. package/dist/v2/index.d.ts +2 -0
  24. package/dist/v2/index.d.ts.map +1 -1
  25. package/dist/v2/index.mjs +189 -72
  26. package/dist/v2/index.mjs.map +1 -1
  27. package/package.json +8 -7
  28. package/src/v2/__tests__/utils/test-helpers.ts +26 -6
  29. package/src/v2/components/MCPAppsActivityRenderer.ts +175 -658
  30. package/src/v2/components/__tests__/MCPAppsActivityRenderer.test.ts +39 -20
  31. package/src/v2/components/__tests__/MCPAppsActivityRendererContentError.test.ts +122 -0
  32. package/src/v2/components/__tests__/MCPAppsActivityRendererSeed.test.ts +109 -0
  33. package/src/v2/components/chat/CopilotChat.vue +100 -20
  34. package/src/v2/components/chat/CopilotPopupViewInternal.vue +1 -1
  35. package/src/v2/components/chat/__tests__/CopilotChat.clearOnFresh.test.ts +130 -2
  36. package/src/v2/components/chat/__tests__/CopilotChat.e2e.test.ts +6 -1
  37. package/src/v2/components/chat/__tests__/CopilotChatToolRendering.e2e.test.ts +22 -40
  38. package/src/v2/components/chat/__tests__/CopilotChatToolRerenders.e2e.test.ts +12 -24
  39. package/src/v2/components/chat/__tests__/CopilotPopupView.slots.e2e.test.ts +20 -0
  40. package/src/v2/components/chat/copilotChatToolCallItemRender.ts +3 -2
  41. package/src/v2/hooks/__tests__/use-agent-headers.test.ts +83 -0
  42. package/src/v2/hooks/__tests__/use-agent-stability.test.ts +2 -0
  43. package/src/v2/hooks/__tests__/use-agent.e2e.test.ts +5 -3
  44. package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.ts +2 -2
  45. package/src/v2/hooks/use-agent.ts +3 -3
  46. package/src/v2/index.ts +5 -0
  47. package/src/v2/providers/__tests__/CopilotKitProvider.renderCustomMessages.e2e.test.ts +6 -4
  48. package/vite.config.ts +7 -0
  49. package/dist/use-render-activity-message-CGdS03Xj.cjs +0 -85
  50. package/dist/use-render-activity-message-CGdS03Xj.cjs.map +0 -1
  51. package/dist/use-render-activity-message-XmuT9fKy.js +0 -9799
  52. package/dist/use-render-activity-message-XmuT9fKy.js.map +0 -1
package/dist/v2/index.mjs CHANGED
@@ -1,77 +1,194 @@
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-XmuT9fKy.js";
4
- import { createLicenseContextValue as ye } from "@copilotkit/shared";
3
+ import { PROTOCOL_VERSION as n } from "@ag-ui/client";
4
+ import { A as i, _ as c, a as S, b as h, c as m, d as u, e as r, f as p, g as l, h as C, i as b, i as g, i as d, B as v, j as E, C as R, k as I, l as A, m as T, n as M, o as y, p as O, q as x, r as P, s as f, t as U, u as F, v as V, w as D, x as w, y as L, z as K, D as B, E as G, F as H, G as k, H as J, I as j, J as q, K as z, L as N, M as Q, N as _, O as W, P as X, Q as Y, R as Z, S as $, T as aa, T as ea, T as ta, U as sa, U as na, V as oa, W as ia, X as ca, Y as Sa, Z as ha, $ as ma, a0 as ua, a1 as ra, a1 as pa, a1 as la, R as Ca, C as ba, a2 as ga, a3 as da, a4 as va, a5 as Ea, a6 as Ra, a7 as Ia, a8 as Aa, a9 as Ta, aa as Ma, ab as ya, ac as Oa, ad as xa, ae as Pa, af as fa, ag as Ua, ah as Fa, ai as Va, aj as Da, ak as wa, al as La, am as Ka, an as Ba, ao as Ga, a2 as Ha, ap as ka, aq as Ja, ar as ja, as as qa, at as za, au as Na, av as Qa, aw as _a, ax as Wa, ay as Xa, az as Ya, aA as Za, aB as $a, aC as ae, aD as ee, aE as te, aF as se, aG as ne, aH as oe, aI as ie, aJ as ce, aK as Se, aL as he, aM as me, aN as ue, aO as re, aP as pe, aQ as le, aR as Ce, aS as be, aT as ge, aU as de, aV as ve, aW as Ee, aX as Re, aY as Ie, aZ as Ae, a_ as Te, a$ as Me, b0 as ye, b1 as Oe, b2 as xe, b3 as Pe, b4 as fe, b5 as Ue, b0 as Fe, b6 as Ve, b7 as De, b8 as we, b9 as Le, ba as Ke, bb as Be, bc as Ge, bd as He, be as ke, bf as Je, bg as je, a3 as qe, bh as ze, bi as Ne, bj as Qe, bj as _e, bj as We, bk as Xe, bl as Ye, bm as Ze, bn as $e, bo as at, bp as et, bq as tt, br as st, bs as nt, bt as ot, bu as it, bv as ct, bw as St, bx as ht, by as mt, bz as ut, bA as rt, bB as pt, bC as lt, bD as Ct, bE as bt, bF as gt, bG as dt, bH as vt, bI as Et, bJ as Rt, bK as It, bL as At } from "../use-render-activity-message-bPlnHjQV.js";
5
+ import { MCPAppsActivityContentSchema as Mt, MCPAppsActivityType as yt, ɵrunMcpFollowUp as Ot } from "@copilotkit/mcp-apps-renderer/activity";
6
+ import { createLicenseContextValue as Pt } from "@copilotkit/shared";
5
7
  export {
6
- o as A2UIActivityContentSchema,
7
- i as A2UISurfaceActivityRenderer,
8
- n as A2UISurfaceActivityType,
9
- C as CopilotChat,
10
- r as CopilotChatAssistantMessage,
11
- p as CopilotChatAttachmentQueue,
12
- l as CopilotChatAttachmentRenderer,
13
- u as CopilotChatAudioRecorder,
14
- c as CopilotChatConfigurationProvider,
15
- g as CopilotChatDefaultLabels,
16
- d as CopilotChatInput,
17
- h as CopilotChatMessageView,
18
- A as CopilotChatReasoningMessage,
19
- v as CopilotChatSuggestionPill,
20
- S as CopilotChatSuggestionView,
21
- m as CopilotChatToggleButton,
22
- y as CopilotChatToggleButtonCloseIcon,
23
- I as CopilotChatToggleButtonOpenIcon,
24
- f as CopilotChatToolCallsView,
25
- R as CopilotChatUserMessage,
26
- T as CopilotChatView,
27
- U as CopilotKitCoreVue,
28
- x as CopilotKitInspector,
29
- M as CopilotKitProvider,
30
- P as CopilotModalHeader,
31
- b as CopilotPopup,
32
- V as CopilotPopupView,
33
- w as CopilotSidebar,
34
- K as CopilotSidebarView,
35
- O as CopilotThreadsDrawer,
36
- G as GenerateSandboxedUiArgsSchema,
37
- L as LicenseContextKey,
38
- B as MCPAppsActivityContentSchema,
39
- D as MCPAppsActivityRenderer,
40
- H as MCPAppsActivityType,
41
- F as OpenGenerativeUIActivityRenderer,
42
- Q as OpenGenerativeUIActivityType,
43
- j as OpenGenerativeUIContentSchema,
44
- k as OpenGenerativeUIRenderer,
45
- q as OpenGenerativeUIToolRenderer,
46
- z as UseAgentUpdate,
47
- E as createA2UIMessageRenderer,
48
- J as createDefaultLicenseRef,
49
- ye as createLicenseContextValue,
50
- N as defineToolCallRenderer,
51
- W as extractCompleteStyles,
52
- X as getOperationSurfaceId,
53
- Y as processPartialHtml,
54
- Z as useAgent,
55
- _ as useAgentContext,
56
- $ as useAttachments,
57
- ee as useCapabilities,
58
- ae as useComponent,
59
- te as useConfigureSuggestions,
60
- se as useCopilotChatConfiguration,
61
- oe as useCopilotKit,
62
- ie as useDefaultRenderTool,
63
- ne as useFrontendTool,
64
- Ce as useHumanInTheLoop,
65
- re as useInterrupt,
66
- pe as useKatexStyles,
67
- le as useKeyboardHeight,
68
- ue as useLicenseContext,
69
- ce as useRenderActivityMessage,
70
- ge as useRenderCustomMessages,
71
- de as useRenderTool,
72
- he as useSandboxFunctions,
73
- Ae as useSuggestions,
74
- ve as useThreads,
75
- Se as vueBasicCatalog
8
+ i as A2UIActivityContentSchema,
9
+ c as A2UISurfaceActivityRenderer,
10
+ S as A2UISurfaceActivityType,
11
+ h as ActivityDeltaEventSchema,
12
+ m as ActivityMessageSchema,
13
+ u as ActivitySnapshotEventSchema,
14
+ r as AddOperationSchema,
15
+ p as AgentCapabilitiesSchema,
16
+ l as AssistantMessageSchema,
17
+ C as AttributableSchema,
18
+ b as AudioInputContentSchema,
19
+ g as AudioInputPartSchema,
20
+ d as AudioPartSchema,
21
+ v as BaseEventSchema,
22
+ E as BaseMessageSchema,
23
+ R as ContentPartSchema,
24
+ I as ContextSchema,
25
+ A as CopilotChat,
26
+ T as CopilotChatAssistantMessage,
27
+ M as CopilotChatAttachmentQueue,
28
+ y as CopilotChatAttachmentRenderer,
29
+ O as CopilotChatAudioRecorder,
30
+ x as CopilotChatConfigurationProvider,
31
+ P as CopilotChatDefaultLabels,
32
+ f as CopilotChatInput,
33
+ U as CopilotChatMessageView,
34
+ F as CopilotChatReasoningMessage,
35
+ V as CopilotChatSuggestionPill,
36
+ D as CopilotChatSuggestionView,
37
+ w as CopilotChatToggleButton,
38
+ L as CopilotChatToggleButtonCloseIcon,
39
+ K as CopilotChatToggleButtonOpenIcon,
40
+ B as CopilotChatToolCallsView,
41
+ G as CopilotChatUserMessage,
42
+ H as CopilotChatView,
43
+ k as CopilotKitCoreVue,
44
+ J as CopilotKitInspector,
45
+ j as CopilotKitProvider,
46
+ q as CopilotModalHeader,
47
+ z as CopilotPopup,
48
+ N as CopilotPopupView,
49
+ Q as CopilotSidebar,
50
+ _ as CopilotSidebarView,
51
+ W as CopilotThreadsDrawer,
52
+ X as CopyOperationSchema,
53
+ Y as CustomEventSchema,
54
+ Z as DataSourceSchema,
55
+ $ as DeveloperMessageSchema,
56
+ aa as DocumentInputContentSchema,
57
+ ea as DocumentInputPartSchema,
58
+ ta as DocumentPartSchema,
59
+ sa as EventSchema,
60
+ na as EventSchemas,
61
+ oa as EventTypeSchema,
62
+ ia as ExecutionCapabilitiesSchema,
63
+ ca as FileSourceSchema,
64
+ Sa as FunctionCallSchema,
65
+ ha as GenerateSandboxedUiArgsSchema,
66
+ ma as HumanInTheLoopCapabilitiesSchema,
67
+ ua as IdentityCapabilitiesSchema,
68
+ ra as ImageInputContentSchema,
69
+ pa as ImageInputPartSchema,
70
+ la as ImagePartSchema,
71
+ Ca as InputContentDataSourceSchema,
72
+ ba as InputContentSchema,
73
+ ga as InputContentSourceSchema,
74
+ da as InputContentUrlSourceSchema,
75
+ va as InterruptSchema,
76
+ Ea as JsonPatchOperationSchema,
77
+ Ra as JsonPatchSchema,
78
+ Ia as JsonPointerSchema,
79
+ Aa as LicenseContextKey,
80
+ Mt as MCPAppsActivityContentSchema,
81
+ Ta as MCPAppsActivityRenderer,
82
+ yt as MCPAppsActivityType,
83
+ Ma as MessageSchema,
84
+ ya as MessagesSnapshotEventSchema,
85
+ Oa as MetadataSchema,
86
+ xa as MoveOperationSchema,
87
+ Pa as MultiAgentCapabilitiesSchema,
88
+ fa as MultimodalCapabilitiesSchema,
89
+ Ua as MultimodalInputCapabilitiesSchema,
90
+ Fa as MultimodalOutputCapabilitiesSchema,
91
+ Va as OpenGenerativeUIActivityRenderer,
92
+ Da as OpenGenerativeUIActivityType,
93
+ wa as OpenGenerativeUIContentSchema,
94
+ La as OpenGenerativeUIRenderer,
95
+ Ka as OpenGenerativeUIToolRenderer,
96
+ Ba as OptionalMetadataSchema,
97
+ Ga as OutputCapabilitiesSchema,
98
+ n as PROTOCOL_VERSION,
99
+ Ha as PartSourceSchema,
100
+ ka as RawEventSchema,
101
+ Ja as ReasoningCapabilitiesSchema,
102
+ ja as ReasoningEncryptedValueEventSchema,
103
+ qa as ReasoningEncryptedValueSubtypeSchema,
104
+ za as ReasoningEndEventSchema,
105
+ Na as ReasoningMessageChunkEventSchema,
106
+ Qa as ReasoningMessageContentEventSchema,
107
+ _a as ReasoningMessageEndEventSchema,
108
+ Wa as ReasoningMessageSchema,
109
+ Xa as ReasoningMessageStartEventSchema,
110
+ Ya as ReasoningStartEventSchema,
111
+ Za as RemoveOperationSchema,
112
+ $a as ReplaceOperationSchema,
113
+ ae as ResumeEntrySchema,
114
+ ee as RoleSchema,
115
+ te as RunAgentInputSchema,
116
+ se as RunErrorEventSchema,
117
+ ne as RunFinishedCancelledOutcomeSchema,
118
+ oe as RunFinishedEventSchema,
119
+ ie as RunFinishedInterruptOutcomeSchema,
120
+ ce as RunFinishedOutcomeSchema,
121
+ Se as RunFinishedSuccessOutcomeSchema,
122
+ he as RunStartedEventSchema,
123
+ me as StateCapabilitiesSchema,
124
+ ue as StateDeltaEventSchema,
125
+ re as StateSchema,
126
+ pe as StateSnapshotEventSchema,
127
+ le as StepFinishedEventSchema,
128
+ Ce as StepStartedEventSchema,
129
+ be as SubagentErrorEventSchema,
130
+ ge as SubagentFinishedEventSchema,
131
+ de as SubagentFinishedOutcomeSchema,
132
+ ve as SubagentFinishedSuccessOutcomeSchema,
133
+ Ee as SubagentFinishedSuspendedOutcomeSchema,
134
+ Re as SubagentInfoSchema,
135
+ Ie as SubagentRunIdSchema,
136
+ Ae as SubagentStartedEventSchema,
137
+ Te as SystemMessageSchema,
138
+ Me as TestOperationSchema,
139
+ ye as TextInputContentSchema,
140
+ Oe as TextMessageChunkEventSchema,
141
+ xe as TextMessageContentEventSchema,
142
+ Pe as TextMessageEndEventSchema,
143
+ fe as TextMessageRoleSchema,
144
+ Ue as TextMessageStartEventSchema,
145
+ Fe as TextPartSchema,
146
+ Ve as TokenUsageSchema,
147
+ De as ToolCallArgsEventSchema,
148
+ we as ToolCallChunkEventSchema,
149
+ Le as ToolCallEndEventSchema,
150
+ Ke as ToolCallResultEventSchema,
151
+ Be as ToolCallSchema,
152
+ Ge as ToolCallStartEventSchema,
153
+ He as ToolMessageSchema,
154
+ ke as ToolSchema,
155
+ Je as ToolsCapabilitiesSchema,
156
+ je as TransportCapabilitiesSchema,
157
+ qe as UrlSourceSchema,
158
+ ze as UseAgentUpdate,
159
+ Ne as UserMessageSchema,
160
+ Qe as VideoInputContentSchema,
161
+ _e as VideoInputPartSchema,
162
+ We as VideoPartSchema,
163
+ Xe as createA2UIMessageRenderer,
164
+ Ye as createDefaultLicenseRef,
165
+ Pt as createLicenseContextValue,
166
+ Ze as defineToolCallRenderer,
167
+ $e as extractCompleteStyles,
168
+ at as getOperationSurfaceId,
169
+ et as processPartialHtml,
170
+ tt as useAgent,
171
+ st as useAgentContext,
172
+ nt as useAttachments,
173
+ ot as useCapabilities,
174
+ it as useComponent,
175
+ ct as useConfigureSuggestions,
176
+ St as useCopilotChatConfiguration,
177
+ ht as useCopilotKit,
178
+ mt as useDefaultRenderTool,
179
+ ut as useFrontendTool,
180
+ rt as useHumanInTheLoop,
181
+ pt as useInterrupt,
182
+ lt as useKatexStyles,
183
+ Ct as useKeyboardHeight,
184
+ bt as useLicenseContext,
185
+ gt as useRenderActivityMessage,
186
+ dt as useRenderCustomMessages,
187
+ vt as useRenderTool,
188
+ Et as useSandboxFunctions,
189
+ Rt as useSuggestions,
190
+ It as useThreads,
191
+ At as vueBasicCatalog,
192
+ Ot as ɵrunMcpFollowUp
76
193
  };
77
194
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/vue",
3
- "version": "1.75.2",
3
+ "version": "1.77.0",
4
4
  "private": false,
5
5
  "description": "Vue 3 components and composables for CopilotKit",
6
6
  "keywords": [
@@ -62,18 +62,19 @@
62
62
  },
63
63
  "dependencies": {
64
64
  "@a2ui/web_core": "0.10.4",
65
- "@ag-ui/client": "0.0.59",
66
- "@ag-ui/core": "0.0.59",
65
+ "@ag-ui/client": "1.0.1",
66
+ "@ag-ui/core": "1.0.1",
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.75.2",
74
- "@copilotkit/shared": "1.75.2",
75
- "@copilotkit/web-components": "1.75.2",
76
- "@copilotkit/web-inspector": "1.75.2"
73
+ "@copilotkit/core": "1.77.0",
74
+ "@copilotkit/mcp-apps-renderer": "1.77.0",
75
+ "@copilotkit/shared": "1.77.0",
76
+ "@copilotkit/web-inspector": "1.77.0",
77
+ "@copilotkit/web-components": "1.77.0"
77
78
  },
78
79
  "devDependencies": {
79
80
  "@eslint/js": "^9.39.2",
@@ -7,6 +7,8 @@ import type {
7
7
  RunAgentInput,
8
8
  RunAgentParameters,
9
9
  RunAgentResult,
10
+ RunStartedEvent,
11
+ RunFinishedEvent,
10
12
  } from "@ag-ui/client";
11
13
  import { Observable, Subject, from, delay } from "rxjs";
12
14
  import { defineComponent, nextTick } from "vue";
@@ -485,12 +487,30 @@ export function renderWithCopilotKit({
485
487
  return render(Host);
486
488
  }
487
489
 
488
- export function runStartedEvent(): BaseEvent {
489
- return { type: EventType.RUN_STARTED } as BaseEvent;
490
+ export function runStartedEvent(
491
+ input: Pick<RunAgentInput, "threadId" | "runId"> = {
492
+ threadId: "test-thread",
493
+ runId: "test-run",
494
+ },
495
+ ): RunStartedEvent {
496
+ return {
497
+ type: EventType.RUN_STARTED,
498
+ threadId: input.threadId,
499
+ runId: input.runId,
500
+ };
490
501
  }
491
502
 
492
- export function runFinishedEvent(): BaseEvent {
493
- return { type: EventType.RUN_FINISHED } as BaseEvent;
503
+ export function runFinishedEvent(
504
+ input: Pick<RunAgentInput, "threadId" | "runId"> = {
505
+ threadId: "test-thread",
506
+ runId: "test-run",
507
+ },
508
+ ): RunFinishedEvent {
509
+ return {
510
+ type: EventType.RUN_FINISHED,
511
+ threadId: input.threadId,
512
+ runId: input.runId,
513
+ };
494
514
  }
495
515
 
496
516
  export function stateSnapshotEvent(snapshot: unknown): BaseEvent {
@@ -684,7 +704,7 @@ export class SuggestionsProviderAgent extends MockStepwiseAgent {
684
704
  setTimeout(() => {
685
705
  void (async () => {
686
706
  const messageId = testId("suggest-msg");
687
- await this.emit({ type: EventType.RUN_STARTED } as BaseEvent);
707
+ await this.emit(runStartedEvent(_input));
688
708
 
689
709
  await emitSuggestionToolCall(this, {
690
710
  toolCallId: testId("tc"),
@@ -692,7 +712,7 @@ export class SuggestionsProviderAgent extends MockStepwiseAgent {
692
712
  suggestions: this._suggestions,
693
713
  });
694
714
 
695
- await this.emit({ type: EventType.RUN_FINISHED } as BaseEvent);
715
+ await this.emit(runFinishedEvent(_input));
696
716
  await this.complete();
697
717
  })();
698
718
  }, 0);