@copilotkit/vue 1.72.0 → 1.73.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 (62) hide show
  1. package/LICENSE +21 -0
  2. package/PARITY.md +15 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.mjs +2 -2
  5. package/dist/use-render-activity-message-C45MYgwB.cjs +85 -0
  6. package/dist/use-render-activity-message-C45MYgwB.cjs.map +1 -0
  7. package/dist/use-render-activity-message-DI4kGqHF.js +9758 -0
  8. package/dist/use-render-activity-message-DI4kGqHF.js.map +1 -0
  9. package/dist/v2/components/LicenseWarningBanner.vue.d.ts +3 -5
  10. package/dist/v2/components/LicenseWarningBanner.vue.d.ts.map +1 -1
  11. package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
  12. package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +4 -0
  13. package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -1
  14. package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +7 -0
  15. package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
  16. package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts +2 -0
  17. package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts.map +1 -1
  18. package/dist/v2/components/chat/CopilotChatView.vue.d.ts +8 -2
  19. package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -1
  20. package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -1
  21. package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -1
  22. package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
  23. package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts +7 -4
  24. package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts.map +1 -1
  25. package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -1
  26. package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -1
  27. package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -1
  28. package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts +8 -5
  29. package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts.map +1 -1
  30. package/dist/v2/components/chat/index.d.ts +50 -26
  31. package/dist/v2/components/chat/index.d.ts.map +1 -1
  32. package/dist/v2/components/chat/types.d.ts +44 -17
  33. package/dist/v2/components/chat/types.d.ts.map +1 -1
  34. package/dist/v2/index.cjs +1 -1
  35. package/dist/v2/index.mjs +1 -1
  36. package/package.json +5 -5
  37. package/src/v2/components/LicenseWarningBanner.vue +5 -17
  38. package/src/v2/components/__tests__/LicenseWarningBanner.test.ts +23 -0
  39. package/src/v2/components/chat/CopilotChat.vue +21 -14
  40. package/src/v2/components/chat/CopilotChatAssistantMessage.vue +12 -21
  41. package/src/v2/components/chat/CopilotChatInput.vue +32 -26
  42. package/src/v2/components/chat/CopilotChatUserMessage.vue +19 -19
  43. package/src/v2/components/chat/CopilotChatView.vue +31 -39
  44. package/src/v2/components/chat/CopilotPopup.vue +8 -10
  45. package/src/v2/components/chat/CopilotPopupView.vue +8 -18
  46. package/src/v2/components/chat/CopilotPopupViewInternal.vue +5 -19
  47. package/src/v2/components/chat/CopilotPopupWelcomeScreen.vue +36 -6
  48. package/src/v2/components/chat/CopilotSidebar.vue +8 -10
  49. package/src/v2/components/chat/CopilotSidebarView.vue +8 -18
  50. package/src/v2/components/chat/CopilotSidebarViewInternal.vue +5 -19
  51. package/src/v2/components/chat/CopilotSidebarWelcomeScreen.vue +36 -6
  52. package/src/v2/components/chat/__tests__/CopilotChat.e2e.test.ts +156 -5
  53. package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +34 -0
  54. package/src/v2/components/chat/__tests__/CopilotChatUserMessage.test.ts +46 -0
  55. package/src/v2/components/chat/__tests__/CopilotChatView.test.ts +118 -0
  56. package/src/v2/components/chat/__tests__/CopilotPopupView.test.ts +79 -0
  57. package/src/v2/components/chat/__tests__/CopilotSidebarView.test.ts +93 -0
  58. package/src/v2/components/chat/types.ts +73 -18
  59. package/dist/use-render-activity-message-Ciee03Rx.js +0 -9702
  60. package/dist/use-render-activity-message-Ciee03Rx.js.map +0 -1
  61. package/dist/use-render-activity-message-DXJDZGkW.cjs +0 -85
  62. package/dist/use-render-activity-message-DXJDZGkW.cjs.map +0 -1
@@ -57,6 +57,22 @@ export interface CopilotChatViewProps {
57
57
  inputValue?: string;
58
58
  inputMode?: CopilotChatInputMode;
59
59
  inputToolsMenu?: (ToolsMenuItem | "-")[];
60
+ /** Optional event callbacks used to drive the default input controls. */
61
+ onSubmitMessage?: (value: string) => void | Promise<void>;
62
+ /**
63
+ * Presence drives reactive gating of the default stop control.
64
+ * Prefer `@stop` / `emit("stop")` for invocation; do not call this prop
65
+ * directly or the handler can fire twice.
66
+ */
67
+ onStop?: () => void;
68
+ onInputChange?: (value: string) => void;
69
+ onSelectSuggestion?: (
70
+ suggestion: Suggestion,
71
+ index: number,
72
+ ) => void | Promise<void>;
73
+ onStartTranscribe?: () => void;
74
+ onCancelTranscribe?: () => void;
75
+ onFinishTranscribe?: () => void;
60
76
  /**
61
77
  * When `true`, suppresses the welcome screen while a thread's initial
62
78
  * connect is in flight. Prevents the "How can I help you today?" flash
@@ -93,6 +109,13 @@ export interface CopilotChatProps extends Omit<
93
109
  | "onDragOver"
94
110
  | "onDragLeave"
95
111
  | "onDrop"
112
+ | "onSubmitMessage"
113
+ | "onStop"
114
+ | "onInputChange"
115
+ | "onSelectSuggestion"
116
+ | "onStartTranscribe"
117
+ | "onCancelTranscribe"
118
+ | "onFinishTranscribe"
96
119
  > {
97
120
  agentId?: string;
98
121
  threadId?: string;
@@ -107,18 +130,21 @@ export interface CopilotChatProps extends Omit<
107
130
  }
108
131
 
109
132
  export interface CopilotChatViewOverrideSlotProps extends CopilotChatViewProps {
133
+ canStop: boolean;
134
+ canAddFile: boolean;
135
+ canTranscribe: boolean;
110
136
  onSubmitMessage: (value: string) => void | Promise<void>;
111
- onStop?: () => void;
137
+ onStop: () => void;
112
138
  onInputChange: (value: string) => void;
113
139
  onSelectSuggestion: (
114
140
  suggestion: Suggestion,
115
141
  index: number,
116
142
  ) => void | Promise<void>;
117
- onAddFile?: () => void;
118
- onStartTranscribe?: () => void;
119
- onCancelTranscribe?: () => void;
120
- onFinishTranscribe?: () => void;
121
- onFinishTranscribeWithAudio?: (audioBlob: Blob) => void | Promise<void>;
143
+ onAddFile: () => void;
144
+ onStartTranscribe: () => void;
145
+ onCancelTranscribe: () => void;
146
+ onFinishTranscribe: () => void;
147
+ onFinishTranscribeWithAudio: (audioBlob: Blob) => void | Promise<void>;
122
148
  }
123
149
 
124
150
  export interface CopilotChatMessageViewSlotProps {
@@ -154,9 +180,12 @@ export interface CopilotChatInputSlotProps {
154
180
  isRunning: boolean;
155
181
  inputMode: CopilotChatInputMode;
156
182
  inputToolsMenu: (ToolsMenuItem | "-")[];
183
+ canStop: boolean;
184
+ canAddFile: boolean;
185
+ canTranscribe: boolean;
157
186
  onUpdateModelValue: (value: string) => void;
158
187
  onSubmitMessage: (value: string) => void;
159
- onStop?: () => void;
188
+ onStop: () => void;
160
189
  onAddFile: () => void;
161
190
  onStartTranscribe: () => void;
162
191
  onCancelTranscribe: () => void;
@@ -189,9 +218,12 @@ export interface CopilotChatWelcomeScreenSlotProps extends CopilotChatSuggestion
189
218
  isRunning: boolean;
190
219
  inputMode: CopilotChatInputMode;
191
220
  inputToolsMenu: (ToolsMenuItem | "-")[];
221
+ canStop: boolean;
222
+ canAddFile: boolean;
223
+ canTranscribe: boolean;
192
224
  onUpdateModelValue: (value: string) => void;
193
225
  onSubmitMessage: (value: string) => void;
194
- onStop?: () => void;
226
+ onStop: () => void;
195
227
  onAddFile: () => void;
196
228
  onStartTranscribe: () => void;
197
229
  onCancelTranscribe: () => void;
@@ -402,14 +434,17 @@ export interface CopilotSidebarWelcomeScreenInputSlotProps {
402
434
  isRunning: boolean;
403
435
  inputMode: CopilotChatInputMode;
404
436
  inputToolsMenu: (ToolsMenuItem | "-")[];
437
+ canStop: boolean;
438
+ canAddFile: boolean;
439
+ canTranscribe: boolean;
405
440
  onUpdateModelValue: (value: string) => void;
406
441
  onSubmitMessage: (value: string) => void;
407
- onStop?: () => void;
408
- onAddFile?: () => void;
409
- onStartTranscribe?: () => void;
410
- onCancelTranscribe?: () => void;
411
- onFinishTranscribe?: () => void;
412
- onFinishTranscribeWithAudio?: (audioBlob: Blob) => void | Promise<void>;
442
+ onStop: () => void;
443
+ onAddFile: () => void;
444
+ onStartTranscribe: () => void;
445
+ onCancelTranscribe: () => void;
446
+ onFinishTranscribe: () => void;
447
+ onFinishTranscribeWithAudio: (audioBlob: Blob) => void | Promise<void>;
413
448
  }
414
449
 
415
450
  export interface CopilotSidebarWelcomeScreenSuggestionViewSlotProps {
@@ -423,8 +458,29 @@ export interface CopilotSidebarWelcomeScreenLayoutSlotProps
423
458
  CopilotSidebarWelcomeScreenInputSlotProps,
424
459
  CopilotSidebarWelcomeScreenSuggestionViewSlotProps {}
425
460
 
426
- export type CopilotSidebarWelcomeScreenProps =
427
- CopilotSidebarWelcomeScreenLayoutSlotProps;
461
+ type WelcomeScreenCommandProps =
462
+ | "onStop"
463
+ | "onAddFile"
464
+ | "onStartTranscribe"
465
+ | "onCancelTranscribe"
466
+ | "onFinishTranscribe"
467
+ | "onFinishTranscribeWithAudio";
468
+
469
+ type WelcomeScreenDerivedCapabilityProps =
470
+ | "canStop"
471
+ | "canAddFile"
472
+ | "canTranscribe";
473
+
474
+ export type CopilotSidebarWelcomeScreenProps = Omit<
475
+ CopilotSidebarWelcomeScreenLayoutSlotProps,
476
+ WelcomeScreenCommandProps | WelcomeScreenDerivedCapabilityProps
477
+ > &
478
+ Partial<
479
+ Pick<
480
+ CopilotSidebarWelcomeScreenLayoutSlotProps,
481
+ WelcomeScreenCommandProps | WelcomeScreenDerivedCapabilityProps
482
+ >
483
+ >;
428
484
 
429
485
  export interface CopilotSidebarViewHeaderSlotProps {
430
486
  title: string;
@@ -458,8 +514,7 @@ export type CopilotPopupWelcomeScreenSuggestionViewSlotProps =
458
514
  export type CopilotPopupWelcomeScreenLayoutSlotProps =
459
515
  CopilotSidebarWelcomeScreenLayoutSlotProps;
460
516
 
461
- export type CopilotPopupWelcomeScreenProps =
462
- CopilotPopupWelcomeScreenLayoutSlotProps;
517
+ export type CopilotPopupWelcomeScreenProps = CopilotSidebarWelcomeScreenProps;
463
518
 
464
519
  export interface CopilotPopupViewProps extends CopilotChatViewProps {
465
520
  width?: number | string;