@copilotkit/vue 1.83.0 → 1.84.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.
Files changed (46) hide show
  1. package/PARITY.md +2 -2
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.mjs +2 -2
  4. package/dist/{use-render-activity-message-mQvByEYF.js → use-render-activity-message-CZKwtSEV.js} +5008 -5334
  5. package/dist/use-render-activity-message-CZKwtSEV.js.map +1 -0
  6. package/dist/use-render-activity-message-OOUHRzkd.cjs +66 -0
  7. package/dist/use-render-activity-message-OOUHRzkd.cjs.map +1 -0
  8. package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -1
  9. package/dist/v2/components/chat/CopilotChat.vue.d.ts +1 -1
  10. package/dist/v2/components/chat/CopilotChatView.vue.d.ts +1 -1
  11. package/dist/v2/components/chat/CopilotPopup.vue.d.ts +7 -2
  12. package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -1
  13. package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +4 -2
  14. package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -1
  15. package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +4 -2
  16. package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
  17. package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +7 -2
  18. package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -1
  19. package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +4 -2
  20. package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -1
  21. package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +4 -2
  22. package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -1
  23. package/dist/v2/components/chat/forwarded-slots.d.ts +12 -0
  24. package/dist/v2/components/chat/forwarded-slots.d.ts.map +1 -0
  25. package/dist/v2/components/chat/index.d.ts +16 -12
  26. package/dist/v2/components/chat/index.d.ts.map +1 -1
  27. package/dist/v2/components/chat/types.d.ts +7 -1
  28. package/dist/v2/components/chat/types.d.ts.map +1 -1
  29. package/dist/v2/index.cjs +1 -1
  30. package/dist/v2/index.mjs +1 -1
  31. package/dist/v2/providers/CopilotKitProvider.vue.d.ts +1 -1
  32. package/package.json +6 -6
  33. package/src/v2/components/a2ui/A2UICatalogContext.ts +14 -100
  34. package/src/v2/components/chat/CopilotPopup.vue +23 -25
  35. package/src/v2/components/chat/CopilotPopupView.vue +10 -39
  36. package/src/v2/components/chat/CopilotPopupViewInternal.vue +14 -34
  37. package/src/v2/components/chat/CopilotSidebar.vue +23 -25
  38. package/src/v2/components/chat/CopilotSidebarView.vue +10 -39
  39. package/src/v2/components/chat/CopilotSidebarViewInternal.vue +14 -34
  40. package/src/v2/components/chat/__tests__/CopilotPopup.test.ts +90 -1
  41. package/src/v2/components/chat/__tests__/CopilotSidebar.test.ts +90 -1
  42. package/src/v2/components/chat/forwarded-slots.ts +17 -0
  43. package/src/v2/components/chat/types.ts +8 -0
  44. package/dist/use-render-activity-message-B7sDGUl4.cjs +0 -70
  45. package/dist/use-render-activity-message-B7sDGUl4.cjs.map +0 -1
  46. package/dist/use-render-activity-message-mQvByEYF.js.map +0 -1
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"),a=require("@ag-ui/client"),e=require("../use-render-activity-message-B7sDGUl4.cjs"),n=require("@copilotkit/mcp-apps-renderer/activity"),c=require("@copilotkit/shared");Object.defineProperty(exports,"PROTOCOL_VERSION",{enumerable:!0,get:()=>a.PROTOCOL_VERSION});exports.A2UIActivityContentSchema=e.A2UIActivityContentSchema;exports.A2UISurfaceActivityRenderer=e._sfc_main;exports.A2UISurfaceActivityType=e.A2UISurfaceActivityType;exports.ActivityDeltaEventSchema=e.ActivityDeltaEventSchema;exports.ActivityMessageSchema=e.ActivityMessageSchema;exports.ActivitySnapshotEventSchema=e.ActivitySnapshotEventSchema;exports.AddOperationSchema=e.AddOperationSchema;exports.AgentCapabilitiesSchema=e.AgentCapabilitiesSchema;exports.AssistantMessageSchema=e.AssistantMessageSchema;exports.AttributableSchema=e.AttributableSchema;exports.AudioInputContentSchema=e.AudioPartSchema;exports.AudioInputPartSchema=e.AudioPartSchema;exports.AudioPartSchema=e.AudioPartSchema;exports.BaseEventSchema=e.BaseEventSchema;exports.BaseMessageSchema=e.BaseMessageSchema;exports.ContentPartSchema=e.ContentPartSchema;exports.ContextSchema=e.ContextSchema;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.CopyOperationSchema=e.CopyOperationSchema;exports.CustomEventSchema=e.CustomEventSchema;exports.DataSourceSchema=e.DataSourceSchema;exports.DeveloperMessageSchema=e.DeveloperMessageSchema;exports.DocumentInputContentSchema=e.DocumentPartSchema;exports.DocumentInputPartSchema=e.DocumentPartSchema;exports.DocumentPartSchema=e.DocumentPartSchema;exports.EventSchema=e.EventSchema;exports.EventSchemas=e.EventSchema;exports.EventTypeSchema=e.EventTypeSchema;exports.ExecutionCapabilitiesSchema=e.ExecutionCapabilitiesSchema;exports.FileSourceSchema=e.FileSourceSchema;exports.FunctionCallSchema=e.FunctionCallSchema;exports.GenerateSandboxedUiArgsSchema=e.GenerateSandboxedUiArgsSchema;exports.HumanInTheLoopCapabilitiesSchema=e.HumanInTheLoopCapabilitiesSchema;exports.IdentityCapabilitiesSchema=e.IdentityCapabilitiesSchema;exports.ImageInputContentSchema=e.ImagePartSchema;exports.ImageInputPartSchema=e.ImagePartSchema;exports.ImagePartSchema=e.ImagePartSchema;exports.InputContentDataSourceSchema=e.DataSourceSchema;exports.InputContentSchema=e.ContentPartSchema;exports.InputContentSourceSchema=e.PartSourceSchema;exports.InputContentUrlSourceSchema=e.UrlSourceSchema;exports.InterruptSchema=e.InterruptSchema;exports.JsonPatchOperationSchema=e.JsonPatchOperationSchema;exports.JsonPatchSchema=e.JsonPatchSchema;exports.JsonPointerSchema=e.JsonPointerSchema;exports.LicenseContextKey=e.LicenseContextKey;exports.MCPAppsActivityRenderer=e.MCPAppsActivityRenderer;exports.MessageSchema=e.MessageSchema;exports.MessagesSnapshotEventSchema=e.MessagesSnapshotEventSchema;exports.MetadataSchema=e.MetadataSchema;exports.MoveOperationSchema=e.MoveOperationSchema;exports.MultiAgentCapabilitiesSchema=e.MultiAgentCapabilitiesSchema;exports.MultimodalCapabilitiesSchema=e.MultimodalCapabilitiesSchema;exports.MultimodalInputCapabilitiesSchema=e.MultimodalInputCapabilitiesSchema;exports.MultimodalOutputCapabilitiesSchema=e.MultimodalOutputCapabilitiesSchema;exports.OpenGenerativeUIActivityRenderer=e.OpenGenerativeUIActivityRenderer;exports.OpenGenerativeUIActivityType=e.OpenGenerativeUIActivityType;exports.OpenGenerativeUIContentSchema=e.OpenGenerativeUIContentSchema;exports.OpenGenerativeUIRenderer=e.OpenGenerativeUIRenderer;exports.OpenGenerativeUIToolRenderer=e.OpenGenerativeUIToolRenderer;exports.OptionalMetadataSchema=e.OptionalMetadataSchema;exports.OutputCapabilitiesSchema=e.OutputCapabilitiesSchema;exports.PartSourceSchema=e.PartSourceSchema;exports.RawEventSchema=e.RawEventSchema;exports.ReasoningCapabilitiesSchema=e.ReasoningCapabilitiesSchema;exports.ReasoningEncryptedValueEventSchema=e.ReasoningEncryptedValueEventSchema;exports.ReasoningEncryptedValueSubtypeSchema=e.ReasoningEncryptedValueSubtypeSchema;exports.ReasoningEndEventSchema=e.ReasoningEndEventSchema;exports.ReasoningMessageChunkEventSchema=e.ReasoningMessageChunkEventSchema;exports.ReasoningMessageContentEventSchema=e.ReasoningMessageContentEventSchema;exports.ReasoningMessageEndEventSchema=e.ReasoningMessageEndEventSchema;exports.ReasoningMessageSchema=e.ReasoningMessageSchema;exports.ReasoningMessageStartEventSchema=e.ReasoningMessageStartEventSchema;exports.ReasoningStartEventSchema=e.ReasoningStartEventSchema;exports.RemoveOperationSchema=e.RemoveOperationSchema;exports.ReplaceOperationSchema=e.ReplaceOperationSchema;exports.ResumeEntrySchema=e.ResumeEntrySchema;exports.RoleSchema=e.RoleSchema;exports.RunAgentInputSchema=e.RunAgentInputSchema;exports.RunErrorEventSchema=e.RunErrorEventSchema;exports.RunFinishedCancelledOutcomeSchema=e.RunFinishedCancelledOutcomeSchema;exports.RunFinishedEventSchema=e.RunFinishedEventSchema;exports.RunFinishedInterruptOutcomeSchema=e.RunFinishedInterruptOutcomeSchema;exports.RunFinishedOutcomeSchema=e.RunFinishedOutcomeSchema;exports.RunFinishedSuccessOutcomeSchema=e.RunFinishedSuccessOutcomeSchema;exports.RunStartedEventSchema=e.RunStartedEventSchema;exports.StateCapabilitiesSchema=e.StateCapabilitiesSchema;exports.StateDeltaEventSchema=e.StateDeltaEventSchema;exports.StateSchema=e.StateSchema;exports.StateSnapshotEventSchema=e.StateSnapshotEventSchema;exports.StepFinishedEventSchema=e.StepFinishedEventSchema;exports.StepStartedEventSchema=e.StepStartedEventSchema;exports.SubagentErrorEventSchema=e.SubagentErrorEventSchema;exports.SubagentFinishedEventSchema=e.SubagentFinishedEventSchema;exports.SubagentFinishedOutcomeSchema=e.SubagentFinishedOutcomeSchema;exports.SubagentFinishedSuccessOutcomeSchema=e.SubagentFinishedSuccessOutcomeSchema;exports.SubagentFinishedSuspendedOutcomeSchema=e.SubagentFinishedSuspendedOutcomeSchema;exports.SubagentInfoSchema=e.SubagentInfoSchema;exports.SubagentRunIdSchema=e.SubagentRunIdSchema;exports.SubagentStartedEventSchema=e.SubagentStartedEventSchema;exports.SystemMessageSchema=e.SystemMessageSchema;exports.TestOperationSchema=e.TestOperationSchema;exports.TextInputContentSchema=e.TextPartSchema;exports.TextMessageChunkEventSchema=e.TextMessageChunkEventSchema;exports.TextMessageContentEventSchema=e.TextMessageContentEventSchema;exports.TextMessageEndEventSchema=e.TextMessageEndEventSchema;exports.TextMessageRoleSchema=e.TextMessageRoleSchema;exports.TextMessageStartEventSchema=e.TextMessageStartEventSchema;exports.TextPartSchema=e.TextPartSchema;exports.TokenUsageSchema=e.TokenUsageSchema;exports.ToolCallArgsEventSchema=e.ToolCallArgsEventSchema;exports.ToolCallChunkEventSchema=e.ToolCallChunkEventSchema;exports.ToolCallEndEventSchema=e.ToolCallEndEventSchema;exports.ToolCallResultEventSchema=e.ToolCallResultEventSchema;exports.ToolCallSchema=e.ToolCallSchema;exports.ToolCallStartEventSchema=e.ToolCallStartEventSchema;exports.ToolMessageSchema=e.ToolMessageSchema;exports.ToolSchema=e.ToolSchema;exports.ToolsCapabilitiesSchema=e.ToolsCapabilitiesSchema;exports.TransportCapabilitiesSchema=e.TransportCapabilitiesSchema;exports.UrlSourceSchema=e.UrlSourceSchema;exports.UseAgentUpdate=e.UseAgentUpdate;exports.UserMessageSchema=e.UserMessageSchema;exports.VideoInputContentSchema=e.VideoPartSchema;exports.VideoInputPartSchema=e.VideoPartSchema;exports.VideoPartSchema=e.VideoPartSchema;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,"MCPAppsActivityContentSchema",{enumerable:!0,get:()=>n.MCPAppsActivityContentSchema});Object.defineProperty(exports,"MCPAppsActivityType",{enumerable:!0,get:()=>n.MCPAppsActivityType});Object.defineProperty(exports,"ɵrunMcpFollowUp",{enumerable:!0,get:()=>n.ɵrunMcpFollowUp});Object.defineProperty(exports,"createLicenseContextValue",{enumerable:!0,get:()=>c.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(a).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>a[t]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@copilotkit/core"),a=require("@ag-ui/client"),e=require("../use-render-activity-message-OOUHRzkd.cjs"),n=require("@copilotkit/mcp-apps-renderer/activity"),c=require("@copilotkit/shared");Object.defineProperty(exports,"PROTOCOL_VERSION",{enumerable:!0,get:()=>a.PROTOCOL_VERSION});exports.A2UIActivityContentSchema=e.A2UIActivityContentSchema;exports.A2UISurfaceActivityRenderer=e._sfc_main;exports.A2UISurfaceActivityType=e.A2UISurfaceActivityType;exports.ActivityDeltaEventSchema=e.ActivityDeltaEventSchema;exports.ActivityMessageSchema=e.ActivityMessageSchema;exports.ActivitySnapshotEventSchema=e.ActivitySnapshotEventSchema;exports.AddOperationSchema=e.AddOperationSchema;exports.AgentCapabilitiesSchema=e.AgentCapabilitiesSchema;exports.AssistantMessageSchema=e.AssistantMessageSchema;exports.AttributableSchema=e.AttributableSchema;exports.AudioInputContentSchema=e.AudioPartSchema;exports.AudioInputPartSchema=e.AudioPartSchema;exports.AudioPartSchema=e.AudioPartSchema;exports.BaseEventSchema=e.BaseEventSchema;exports.BaseMessageSchema=e.BaseMessageSchema;exports.ContentPartSchema=e.ContentPartSchema;exports.ContextSchema=e.ContextSchema;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.CopyOperationSchema=e.CopyOperationSchema;exports.CustomEventSchema=e.CustomEventSchema;exports.DataSourceSchema=e.DataSourceSchema;exports.DeveloperMessageSchema=e.DeveloperMessageSchema;exports.DocumentInputContentSchema=e.DocumentPartSchema;exports.DocumentInputPartSchema=e.DocumentPartSchema;exports.DocumentPartSchema=e.DocumentPartSchema;exports.EventSchema=e.EventSchema;exports.EventSchemas=e.EventSchema;exports.EventTypeSchema=e.EventTypeSchema;exports.ExecutionCapabilitiesSchema=e.ExecutionCapabilitiesSchema;exports.FileSourceSchema=e.FileSourceSchema;exports.FunctionCallSchema=e.FunctionCallSchema;exports.GenerateSandboxedUiArgsSchema=e.GenerateSandboxedUiArgsSchema;exports.HumanInTheLoopCapabilitiesSchema=e.HumanInTheLoopCapabilitiesSchema;exports.IdentityCapabilitiesSchema=e.IdentityCapabilitiesSchema;exports.ImageInputContentSchema=e.ImagePartSchema;exports.ImageInputPartSchema=e.ImagePartSchema;exports.ImagePartSchema=e.ImagePartSchema;exports.InputContentDataSourceSchema=e.DataSourceSchema;exports.InputContentSchema=e.ContentPartSchema;exports.InputContentSourceSchema=e.PartSourceSchema;exports.InputContentUrlSourceSchema=e.UrlSourceSchema;exports.InterruptSchema=e.InterruptSchema;exports.JsonPatchOperationSchema=e.JsonPatchOperationSchema;exports.JsonPatchSchema=e.JsonPatchSchema;exports.JsonPointerSchema=e.JsonPointerSchema;exports.LicenseContextKey=e.LicenseContextKey;exports.MCPAppsActivityRenderer=e.MCPAppsActivityRenderer;exports.MessageSchema=e.MessageSchema;exports.MessagesSnapshotEventSchema=e.MessagesSnapshotEventSchema;exports.MetadataSchema=e.MetadataSchema;exports.MoveOperationSchema=e.MoveOperationSchema;exports.MultiAgentCapabilitiesSchema=e.MultiAgentCapabilitiesSchema;exports.MultimodalCapabilitiesSchema=e.MultimodalCapabilitiesSchema;exports.MultimodalInputCapabilitiesSchema=e.MultimodalInputCapabilitiesSchema;exports.MultimodalOutputCapabilitiesSchema=e.MultimodalOutputCapabilitiesSchema;exports.OpenGenerativeUIActivityRenderer=e.OpenGenerativeUIActivityRenderer;exports.OpenGenerativeUIActivityType=e.OpenGenerativeUIActivityType;exports.OpenGenerativeUIContentSchema=e.OpenGenerativeUIContentSchema;exports.OpenGenerativeUIRenderer=e.OpenGenerativeUIRenderer;exports.OpenGenerativeUIToolRenderer=e.OpenGenerativeUIToolRenderer;exports.OptionalMetadataSchema=e.OptionalMetadataSchema;exports.OutputCapabilitiesSchema=e.OutputCapabilitiesSchema;exports.PartSourceSchema=e.PartSourceSchema;exports.RawEventSchema=e.RawEventSchema;exports.ReasoningCapabilitiesSchema=e.ReasoningCapabilitiesSchema;exports.ReasoningEncryptedValueEventSchema=e.ReasoningEncryptedValueEventSchema;exports.ReasoningEncryptedValueSubtypeSchema=e.ReasoningEncryptedValueSubtypeSchema;exports.ReasoningEndEventSchema=e.ReasoningEndEventSchema;exports.ReasoningMessageChunkEventSchema=e.ReasoningMessageChunkEventSchema;exports.ReasoningMessageContentEventSchema=e.ReasoningMessageContentEventSchema;exports.ReasoningMessageEndEventSchema=e.ReasoningMessageEndEventSchema;exports.ReasoningMessageSchema=e.ReasoningMessageSchema;exports.ReasoningMessageStartEventSchema=e.ReasoningMessageStartEventSchema;exports.ReasoningStartEventSchema=e.ReasoningStartEventSchema;exports.RemoveOperationSchema=e.RemoveOperationSchema;exports.ReplaceOperationSchema=e.ReplaceOperationSchema;exports.ResumeEntrySchema=e.ResumeEntrySchema;exports.RoleSchema=e.RoleSchema;exports.RunAgentInputSchema=e.RunAgentInputSchema;exports.RunErrorEventSchema=e.RunErrorEventSchema;exports.RunFinishedCancelledOutcomeSchema=e.RunFinishedCancelledOutcomeSchema;exports.RunFinishedEventSchema=e.RunFinishedEventSchema;exports.RunFinishedInterruptOutcomeSchema=e.RunFinishedInterruptOutcomeSchema;exports.RunFinishedOutcomeSchema=e.RunFinishedOutcomeSchema;exports.RunFinishedSuccessOutcomeSchema=e.RunFinishedSuccessOutcomeSchema;exports.RunStartedEventSchema=e.RunStartedEventSchema;exports.StateCapabilitiesSchema=e.StateCapabilitiesSchema;exports.StateDeltaEventSchema=e.StateDeltaEventSchema;exports.StateSchema=e.StateSchema;exports.StateSnapshotEventSchema=e.StateSnapshotEventSchema;exports.StepFinishedEventSchema=e.StepFinishedEventSchema;exports.StepStartedEventSchema=e.StepStartedEventSchema;exports.SubagentErrorEventSchema=e.SubagentErrorEventSchema;exports.SubagentFinishedEventSchema=e.SubagentFinishedEventSchema;exports.SubagentFinishedOutcomeSchema=e.SubagentFinishedOutcomeSchema;exports.SubagentFinishedSuccessOutcomeSchema=e.SubagentFinishedSuccessOutcomeSchema;exports.SubagentFinishedSuspendedOutcomeSchema=e.SubagentFinishedSuspendedOutcomeSchema;exports.SubagentInfoSchema=e.SubagentInfoSchema;exports.SubagentRunIdSchema=e.SubagentRunIdSchema;exports.SubagentStartedEventSchema=e.SubagentStartedEventSchema;exports.SystemMessageSchema=e.SystemMessageSchema;exports.TestOperationSchema=e.TestOperationSchema;exports.TextInputContentSchema=e.TextPartSchema;exports.TextMessageChunkEventSchema=e.TextMessageChunkEventSchema;exports.TextMessageContentEventSchema=e.TextMessageContentEventSchema;exports.TextMessageEndEventSchema=e.TextMessageEndEventSchema;exports.TextMessageRoleSchema=e.TextMessageRoleSchema;exports.TextMessageStartEventSchema=e.TextMessageStartEventSchema;exports.TextPartSchema=e.TextPartSchema;exports.TokenUsageSchema=e.TokenUsageSchema;exports.ToolCallArgsEventSchema=e.ToolCallArgsEventSchema;exports.ToolCallChunkEventSchema=e.ToolCallChunkEventSchema;exports.ToolCallEndEventSchema=e.ToolCallEndEventSchema;exports.ToolCallResultEventSchema=e.ToolCallResultEventSchema;exports.ToolCallSchema=e.ToolCallSchema;exports.ToolCallStartEventSchema=e.ToolCallStartEventSchema;exports.ToolMessageSchema=e.ToolMessageSchema;exports.ToolSchema=e.ToolSchema;exports.ToolsCapabilitiesSchema=e.ToolsCapabilitiesSchema;exports.TransportCapabilitiesSchema=e.TransportCapabilitiesSchema;exports.UrlSourceSchema=e.UrlSourceSchema;exports.UseAgentUpdate=e.UseAgentUpdate;exports.UserMessageSchema=e.UserMessageSchema;exports.VideoInputContentSchema=e.VideoPartSchema;exports.VideoInputPartSchema=e.VideoPartSchema;exports.VideoPartSchema=e.VideoPartSchema;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,"MCPAppsActivityContentSchema",{enumerable:!0,get:()=>n.MCPAppsActivityContentSchema});Object.defineProperty(exports,"MCPAppsActivityType",{enumerable:!0,get:()=>n.MCPAppsActivityType});Object.defineProperty(exports,"ɵrunMcpFollowUp",{enumerable:!0,get:()=>n.ɵrunMcpFollowUp});Object.defineProperty(exports,"createLicenseContextValue",{enumerable:!0,get:()=>c.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(a).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>a[t]})});
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/v2/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "@copilotkit/core";
2
2
  export * from "@ag-ui/client";
3
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-mQvByEYF.js";
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-CZKwtSEV.js";
5
5
  import { MCPAppsActivityContentSchema as Mt, MCPAppsActivityType as yt, ɵrunMcpFollowUp as Ot } from "@copilotkit/mcp-apps-renderer/activity";
6
6
  import { createLicenseContextValue as Pt } from "@copilotkit/shared";
7
7
  export {
@@ -10,8 +10,8 @@ type __VLS_Slots = {} & {
10
10
  declare const __VLS_component: import("vue").DefineComponent<CopilotKitProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CopilotKitProviderProps> & Readonly<{}>, {
11
11
  renderActivityMessages: VueActivityMessageRenderer<unknown>[];
12
12
  renderCustomMessages: import("..").VueCustomMessageRenderer[];
13
- properties: Record<string, unknown>;
14
13
  headers: CopilotKitHeadersSource;
14
+ properties: Record<string, unknown>;
15
15
  useSingleEndpoint: boolean;
16
16
  agents__unsafe_dev_only: Record<string, AbstractAgent>;
17
17
  selfManagedAgents: Record<string, AbstractAgent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/vue",
3
- "version": "1.83.0",
3
+ "version": "1.84.1",
4
4
  "private": false,
5
5
  "description": "Vue 3 components and composables for CopilotKit",
6
6
  "keywords": [
@@ -70,11 +70,11 @@
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.83.0",
74
- "@copilotkit/shared": "1.83.0",
75
- "@copilotkit/mcp-apps-renderer": "1.83.0",
76
- "@copilotkit/web-components": "1.83.0",
77
- "@copilotkit/web-inspector": "1.83.0"
73
+ "@copilotkit/core": "1.84.1",
74
+ "@copilotkit/shared": "1.84.1",
75
+ "@copilotkit/web-components": "1.84.1",
76
+ "@copilotkit/mcp-apps-renderer": "1.84.1",
77
+ "@copilotkit/web-inspector": "1.84.1"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@eslint/js": "^9.39.2",
@@ -1,26 +1,19 @@
1
1
  import { computed, watch } from "vue";
2
2
  import type { ShallowRef } from "vue";
3
3
  import type { Catalog, ComponentApi } from "@a2ui/web_core/v0_9";
4
- import { zodToJsonSchema } from "zod-to-json-schema";
5
4
  import {
6
5
  A2UI_DEFAULT_GENERATION_GUIDELINES,
7
6
  A2UI_DEFAULT_DESIGN_GUIDELINES,
7
+ A2UI_SCHEMA_CONTEXT_DESCRIPTION,
8
+ buildA2UICatalogContextValue,
9
+ extractA2UICatalogSchemas,
8
10
  } from "@copilotkit/shared";
9
11
  import type { CopilotKitCoreVue } from "../../lib/vue-core";
10
12
  import { vueBasicCatalog } from "./catalog";
11
13
 
12
- /**
13
- * Context description used to identify the A2UI component schema in
14
- * RunAgentInput.context. Must match the constant in @ag-ui/a2ui-middleware
15
- * so the middleware can overwrite a frontend-provided schema with a
16
- * server-side one.
17
- *
18
- * Duplicated from @copilotkit/a2ui-renderer/catalog-utils to avoid pulling
19
- * in React dependencies.
20
- */
21
- const A2UI_SCHEMA_CONTEXT_DESCRIPTION =
22
- "A2UI Component Schema — available components for generating UI surfaces. " +
23
- "Use these component names and properties when creating A2UI operations.";
14
+ const basicComponentNames: ReadonlySet<string> = new Set(
15
+ vueBasicCatalog.components.keys(),
16
+ );
24
17
 
25
18
  /**
26
19
  * Build a context string describing the available A2UI catalog.
@@ -33,92 +26,11 @@ export function buildCatalogContextValue(
33
26
  catalog?: Catalog<ComponentApi>,
34
27
  options?: { includeSchema?: boolean },
35
28
  ): string {
36
- const resolved = catalog ?? vueBasicCatalog;
37
- const BASIC_CATALOG_ID =
38
- "https://a2ui.org/specification/v0_9/basic_catalog.json";
39
- const lines: string[] = [];
40
- lines.push("Available A2UI catalog:");
41
-
42
- if (resolved.id === BASIC_CATALOG_ID) {
43
- lines.push(`- ${resolved.id} (basic catalog)`);
44
- return lines.join("\n");
45
- }
46
-
47
- // Check if the resolved catalog extends the basic catalog
48
- let isSuperset = true;
49
- for (const name of vueBasicCatalog.components.keys()) {
50
- if (!resolved.components.has(name)) {
51
- isSuperset = false;
52
- break;
53
- }
54
- }
55
-
56
- // Identify custom components (not in basic catalog)
57
- const customNames: string[] = [];
58
- for (const name of resolved.components.keys()) {
59
- if (!vueBasicCatalog.components.has(name)) {
60
- customNames.push(name);
61
- }
62
- }
63
-
64
- lines.push(`- ${resolved.id}`);
65
- if (isSuperset) {
66
- lines.push(
67
- " Extends the basic catalog with all standard components plus:",
68
- );
69
- } else {
70
- lines.push(" Custom catalog (does NOT include all basic components).");
71
- lines.push(" Custom components:");
72
- }
73
-
74
- for (const name of customNames) {
75
- const comp = resolved.components.get(name);
76
- if (!comp) continue;
77
- if (options?.includeSchema === false) {
78
- lines.push(` - ${name}`);
79
- continue;
80
- }
81
- const jsonSchema = zodToJsonSchema(comp.schema);
82
- lines.push(` - ${name}:`);
83
- lines.push(
84
- ` ${JSON.stringify(jsonSchema, null, 2).split("\n").join("\n ")}`,
85
- );
86
- }
87
-
88
- return lines.join("\n");
89
- }
90
-
91
- /**
92
- * Extract component schemas from a catalog in A2UI v0.9 inline format.
93
- * Vue-native equivalent of extractCatalogComponentSchemas.
94
- */
95
- function extractCatalogComponentSchemas(catalog?: Catalog<ComponentApi>): {
96
- catalogId: string;
97
- components: Record<string, Record<string, unknown>>;
98
- } {
99
- const resolved = catalog ?? vueBasicCatalog;
100
- const components: Record<string, Record<string, unknown>> = {};
101
-
102
- for (const [name, comp] of resolved.components) {
103
- const zodSchema = zodToJsonSchema(comp.schema, {
104
- target: "jsonSchema2019-09",
105
- }) as { properties?: Record<string, unknown>; required?: string[] };
106
-
107
- components[name] = {
108
- allOf: [
109
- { $ref: "common_types.json#/$defs/ComponentCommon" },
110
- {
111
- properties: {
112
- component: { const: name },
113
- ...zodSchema.properties,
114
- },
115
- required: ["component", ...(zodSchema.required ?? [])],
116
- },
117
- ],
118
- };
119
- }
120
-
121
- return { catalogId: resolved.id, components };
29
+ return buildA2UICatalogContextValue(
30
+ catalog ?? vueBasicCatalog,
31
+ basicComponentNames,
32
+ options,
33
+ );
122
34
  }
123
35
 
124
36
  /**
@@ -165,7 +77,9 @@ export function registerA2UICatalogContext(
165
77
  // Register schema + generation/design guidelines
166
78
  const schemaValue = computed(() => {
167
79
  if (!options.includeSchema()) return null;
168
- return JSON.stringify(extractCatalogComponentSchemas(options.catalog()));
80
+ return JSON.stringify(
81
+ extractA2UICatalogSchemas(options.catalog() ?? vueBasicCatalog),
82
+ );
169
83
  });
170
84
 
171
85
  watch(
@@ -4,9 +4,14 @@ import CopilotChat from "./CopilotChat.vue";
4
4
  import CopilotPopupView from "./CopilotPopupView.vue";
5
5
  import CopilotPopupWelcomeScreen from "./CopilotPopupWelcomeScreen.vue";
6
6
  import InlineFeatureWarning from "../InlineFeatureWarning.vue";
7
+ import { forwardedSlotNames } from "./forwarded-slots";
7
8
  import { useLicenseContext } from "../../providers/useLicenseContext";
8
9
  import type {
10
+ CopilotChatFeatherSlotProps,
11
+ CopilotChatInterruptSlotProps,
9
12
  CopilotChatMessageViewSlotProps,
13
+ CopilotChatScrollToBottomButtonSlotProps,
14
+ CopilotChatScrollViewSlotProps,
10
15
  CopilotChatViewOverrideSlotProps,
11
16
  CopilotChatWelcomeScreenSlotProps,
12
17
  CopilotPopupProps,
@@ -52,14 +57,28 @@ defineSlots<{
52
57
  "toggle-button"?: (props: CopilotPopupViewToggleButtonSlotProps) => unknown;
53
58
  "chat-view"?: (props: CopilotChatViewOverrideSlotProps) => unknown;
54
59
  "message-view"?: (props: CopilotChatMessageViewSlotProps) => unknown;
60
+ "scroll-view"?: (props: CopilotChatScrollViewSlotProps) => unknown;
61
+ feather?: (props: CopilotChatFeatherSlotProps) => unknown;
62
+ "scroll-to-bottom-button"?: (
63
+ props: CopilotChatScrollToBottomButtonSlotProps,
64
+ ) => unknown;
65
+ interrupt?: (props: CopilotChatInterruptSlotProps) => unknown;
55
66
  input?: (props: CopilotSidebarWelcomeScreenInputSlotProps) => unknown;
56
67
  "suggestion-view"?: (
57
68
  props: CopilotSidebarWelcomeScreenSuggestionViewSlotProps,
58
69
  ) => unknown;
59
70
  "welcome-screen"?: (props: CopilotChatWelcomeScreenSlotProps) => unknown;
60
71
  "welcome-message"?: () => unknown;
72
+ // Any other slot goes to the chat view, as on CopilotChat.
73
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
+ [key: string]: ((props: any) => unknown) | undefined;
61
75
  }>();
62
76
 
77
+ // Slots this component renders itself and does not pass to the view. It passes
78
+ // every other slot to the view. It also renders `input` and `suggestion-view`
79
+ // in its welcome screen, so those two go to both places.
80
+ const OWN_SLOTS = ["chat-view", "welcome-screen", "welcome-message"] as const;
81
+
63
82
  defineEmits<{
64
83
  "submit-message": [value: string];
65
84
  stop: [];
@@ -122,15 +141,12 @@ watch(
122
141
  :on-finish-transcribe-with-audio="slotProps.onFinishTranscribeWithAudio"
123
142
  v-bind="popupViewEventBindings(slotProps)"
124
143
  >
125
- <template v-if="$slots.header" #header="headerProps">
126
- <slot name="header" v-bind="headerProps" />
127
- </template>
128
-
129
144
  <template
130
- v-if="$slots['toggle-button']"
131
- #toggle-button="toggleButtonProps"
145
+ v-for="slotName in forwardedSlotNames($slots, OWN_SLOTS)"
146
+ :key="slotName"
147
+ #[slotName]="forwardedProps"
132
148
  >
133
- <slot name="toggle-button" v-bind="toggleButtonProps" />
149
+ <slot :name="slotName" v-bind="forwardedProps" />
134
150
  </template>
135
151
 
136
152
  <template #welcome-screen="welcomeScreenProps">
@@ -156,24 +172,6 @@ watch(
156
172
  </template>
157
173
  </CopilotPopupWelcomeScreen>
158
174
  </template>
159
-
160
- <template
161
- v-if="$slots['message-view']"
162
- #message-view="messageViewProps"
163
- >
164
- <slot name="message-view" v-bind="messageViewProps" />
165
- </template>
166
-
167
- <template v-if="$slots.input" #input="inputProps">
168
- <slot name="input" v-bind="inputProps" />
169
- </template>
170
-
171
- <template
172
- v-if="$slots['suggestion-view']"
173
- #suggestion-view="suggestionViewProps"
174
- >
175
- <slot name="suggestion-view" v-bind="suggestionViewProps" />
176
- </template>
177
175
  </CopilotPopupView>
178
176
  </template>
179
177
  </CopilotChat>
@@ -1,9 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, useAttrs } from "vue";
3
3
  import CopilotChatConfigurationProvider from "../../providers/CopilotChatConfigurationProvider.vue";
4
+ import { forwardedSlotNames } from "./forwarded-slots";
4
5
  import CopilotPopupViewInternal from "./CopilotPopupViewInternal.vue";
5
6
  import type {
6
7
  CopilotChatFeatherSlotProps,
8
+ CopilotChatInterruptSlotProps,
7
9
  CopilotChatMessageViewSlotProps,
8
10
  CopilotChatScrollToBottomButtonSlotProps,
9
11
  CopilotChatScrollViewSlotProps,
@@ -43,12 +45,16 @@ defineSlots<{
43
45
  "scroll-to-bottom-button"?: (
44
46
  props: CopilotChatScrollToBottomButtonSlotProps,
45
47
  ) => unknown;
48
+ interrupt?: (props: CopilotChatInterruptSlotProps) => unknown;
46
49
  input?: (props: CopilotSidebarWelcomeScreenInputSlotProps) => unknown;
47
50
  "suggestion-view"?: (
48
51
  props: CopilotSidebarWelcomeScreenSuggestionViewSlotProps,
49
52
  ) => unknown;
50
53
  "welcome-screen"?: (props: CopilotChatWelcomeScreenSlotProps) => unknown;
51
54
  "welcome-message"?: () => unknown;
55
+ // Any other slot goes to the chat view, as on CopilotChat.
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ [key: string]: ((props: any) => unknown) | undefined;
52
58
  }>();
53
59
 
54
60
  const emit = defineEmits<{
@@ -111,47 +117,12 @@ const internalBindings = computed(() => ({
111
117
  <template>
112
118
  <CopilotChatConfigurationProvider :is-modal-default-open="defaultOpen">
113
119
  <CopilotPopupViewInternal v-bind="internalBindings">
114
- <template v-if="$slots.header" #header="slotProps">
115
- <slot name="header" v-bind="slotProps" />
116
- </template>
117
-
118
- <template v-if="$slots['toggle-button']" #toggle-button="slotProps">
119
- <slot name="toggle-button" v-bind="slotProps" />
120
- </template>
121
-
122
- <template v-if="$slots['message-view']" #message-view="slotProps">
123
- <slot name="message-view" v-bind="slotProps" />
124
- </template>
125
-
126
- <template v-if="$slots['scroll-view']" #scroll-view="slotProps">
127
- <slot name="scroll-view" v-bind="slotProps" />
128
- </template>
129
-
130
- <template v-if="$slots.feather" #feather="slotProps">
131
- <slot name="feather" v-bind="slotProps" />
132
- </template>
133
-
134
120
  <template
135
- v-if="$slots['scroll-to-bottom-button']"
136
- #scroll-to-bottom-button="slotProps"
121
+ v-for="slotName in forwardedSlotNames($slots)"
122
+ :key="slotName"
123
+ #[slotName]="slotProps"
137
124
  >
138
- <slot name="scroll-to-bottom-button" v-bind="slotProps" />
139
- </template>
140
-
141
- <template v-if="$slots.input" #input="slotProps">
142
- <slot name="input" v-bind="slotProps" />
143
- </template>
144
-
145
- <template v-if="$slots['suggestion-view']" #suggestion-view="slotProps">
146
- <slot name="suggestion-view" v-bind="slotProps" />
147
- </template>
148
-
149
- <template v-if="$slots['welcome-screen']" #welcome-screen="slotProps">
150
- <slot name="welcome-screen" v-bind="slotProps" />
151
- </template>
152
-
153
- <template v-if="$slots['welcome-message']" #welcome-message>
154
- <slot name="welcome-message" />
125
+ <slot :name="slotName" v-bind="slotProps" />
155
126
  </template>
156
127
  </CopilotPopupViewInternal>
157
128
  </CopilotChatConfigurationProvider>
@@ -13,8 +13,10 @@ import { useCopilotChatConfiguration } from "../../providers/useCopilotChatConfi
13
13
  import CopilotChatToggleButton from "./CopilotChatToggleButton.vue";
14
14
  import CopilotChatView from "./CopilotChatView.vue";
15
15
  import CopilotModalHeader from "./CopilotModalHeader.vue";
16
+ import { forwardedSlotNames } from "./forwarded-slots";
16
17
  import type {
17
18
  CopilotChatFeatherSlotProps,
19
+ CopilotChatInterruptSlotProps,
18
20
  CopilotChatMessageViewSlotProps,
19
21
  CopilotChatScrollToBottomButtonSlotProps,
20
22
  CopilotChatScrollViewSlotProps,
@@ -60,14 +62,22 @@ defineSlots<{
60
62
  "scroll-to-bottom-button"?: (
61
63
  props: CopilotChatScrollToBottomButtonSlotProps,
62
64
  ) => unknown;
65
+ interrupt?: (props: CopilotChatInterruptSlotProps) => unknown;
63
66
  input?: (props: CopilotSidebarWelcomeScreenInputSlotProps) => unknown;
64
67
  "suggestion-view"?: (
65
68
  props: CopilotSidebarWelcomeScreenSuggestionViewSlotProps,
66
69
  ) => unknown;
67
70
  "welcome-screen"?: (props: CopilotChatWelcomeScreenSlotProps) => unknown;
68
71
  "welcome-message"?: () => unknown;
72
+ // Any other slot goes to the chat view, as on CopilotChat.
73
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
+ [key: string]: ((props: any) => unknown) | undefined;
69
75
  }>();
70
76
 
77
+ // Slots this component renders itself. It passes every other slot to the
78
+ // chat view.
79
+ const OWN_SLOTS = ["header", "toggle-button"] as const;
80
+
71
81
  const emit = defineEmits<{
72
82
  "submit-message": [value: string];
73
83
  stop: [];
@@ -395,42 +405,12 @@ onBeforeUnmount(() => {
395
405
  :on-finish-transcribe-with-audio="onFinishTranscribeWithAudio"
396
406
  v-bind="chatViewBindings"
397
407
  >
398
- <template v-if="$slots['message-view']" #message-view="slotProps">
399
- <slot name="message-view" v-bind="slotProps" />
400
- </template>
401
-
402
- <template v-if="$slots['scroll-view']" #scroll-view="slotProps">
403
- <slot name="scroll-view" v-bind="slotProps" />
404
- </template>
405
-
406
- <template v-if="$slots.feather" #feather>
407
- <slot name="feather" />
408
- </template>
409
-
410
408
  <template
411
- v-if="$slots['scroll-to-bottom-button']"
412
- #scroll-to-bottom-button="slotProps"
409
+ v-for="slotName in forwardedSlotNames($slots, OWN_SLOTS)"
410
+ :key="slotName"
411
+ #[slotName]="slotProps"
413
412
  >
414
- <slot name="scroll-to-bottom-button" v-bind="slotProps" />
415
- </template>
416
-
417
- <template v-if="$slots.input" #input="slotProps">
418
- <slot name="input" v-bind="slotProps" />
419
- </template>
420
-
421
- <template
422
- v-if="$slots['suggestion-view']"
423
- #suggestion-view="slotProps"
424
- >
425
- <slot name="suggestion-view" v-bind="slotProps" />
426
- </template>
427
-
428
- <template v-if="$slots['welcome-screen']" #welcome-screen="slotProps">
429
- <slot name="welcome-screen" v-bind="slotProps" />
430
- </template>
431
-
432
- <template v-if="$slots['welcome-message']" #welcome-message>
433
- <slot name="welcome-message" />
413
+ <slot :name="slotName" v-bind="slotProps" />
434
414
  </template>
435
415
  </CopilotChatView>
436
416
  </div>
@@ -4,9 +4,14 @@ import CopilotChat from "./CopilotChat.vue";
4
4
  import CopilotSidebarView from "./CopilotSidebarView.vue";
5
5
  import CopilotSidebarWelcomeScreen from "./CopilotSidebarWelcomeScreen.vue";
6
6
  import InlineFeatureWarning from "../InlineFeatureWarning.vue";
7
+ import { forwardedSlotNames } from "./forwarded-slots";
7
8
  import { useLicenseContext } from "../../providers/useLicenseContext";
8
9
  import type {
10
+ CopilotChatFeatherSlotProps,
11
+ CopilotChatInterruptSlotProps,
9
12
  CopilotChatMessageViewSlotProps,
13
+ CopilotChatScrollToBottomButtonSlotProps,
14
+ CopilotChatScrollViewSlotProps,
10
15
  CopilotChatViewOverrideSlotProps,
11
16
  CopilotChatWelcomeScreenSlotProps,
12
17
  CopilotSidebarProps,
@@ -50,14 +55,28 @@ defineSlots<{
50
55
  "toggle-button"?: (props: CopilotSidebarViewToggleButtonSlotProps) => unknown;
51
56
  "chat-view"?: (props: CopilotChatViewOverrideSlotProps) => unknown;
52
57
  "message-view"?: (props: CopilotChatMessageViewSlotProps) => unknown;
58
+ "scroll-view"?: (props: CopilotChatScrollViewSlotProps) => unknown;
59
+ feather?: (props: CopilotChatFeatherSlotProps) => unknown;
60
+ "scroll-to-bottom-button"?: (
61
+ props: CopilotChatScrollToBottomButtonSlotProps,
62
+ ) => unknown;
63
+ interrupt?: (props: CopilotChatInterruptSlotProps) => unknown;
53
64
  input?: (props: CopilotSidebarWelcomeScreenInputSlotProps) => unknown;
54
65
  "suggestion-view"?: (
55
66
  props: CopilotSidebarWelcomeScreenSuggestionViewSlotProps,
56
67
  ) => unknown;
57
68
  "welcome-screen"?: (props: CopilotChatWelcomeScreenSlotProps) => unknown;
58
69
  "welcome-message"?: () => unknown;
70
+ // Any other slot goes to the chat view, as on CopilotChat.
71
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
+ [key: string]: ((props: any) => unknown) | undefined;
59
73
  }>();
60
74
 
75
+ // Slots this component renders itself and does not pass to the view. It passes
76
+ // every other slot to the view. It also renders `input` and `suggestion-view`
77
+ // in its welcome screen, so those two go to both places.
78
+ const OWN_SLOTS = ["chat-view", "welcome-screen", "welcome-message"] as const;
79
+
61
80
  defineEmits<{
62
81
  "submit-message": [value: string];
63
82
  stop: [];
@@ -118,15 +137,12 @@ watch(
118
137
  :on-finish-transcribe-with-audio="slotProps.onFinishTranscribeWithAudio"
119
138
  v-bind="sidebarViewEventBindings(slotProps)"
120
139
  >
121
- <template v-if="$slots.header" #header="headerProps">
122
- <slot name="header" v-bind="headerProps" />
123
- </template>
124
-
125
140
  <template
126
- v-if="$slots['toggle-button']"
127
- #toggle-button="toggleButtonProps"
141
+ v-for="slotName in forwardedSlotNames($slots, OWN_SLOTS)"
142
+ :key="slotName"
143
+ #[slotName]="forwardedProps"
128
144
  >
129
- <slot name="toggle-button" v-bind="toggleButtonProps" />
145
+ <slot :name="slotName" v-bind="forwardedProps" />
130
146
  </template>
131
147
 
132
148
  <template #welcome-screen="welcomeScreenProps">
@@ -152,24 +168,6 @@ watch(
152
168
  </template>
153
169
  </CopilotSidebarWelcomeScreen>
154
170
  </template>
155
-
156
- <template
157
- v-if="$slots['message-view']"
158
- #message-view="messageViewProps"
159
- >
160
- <slot name="message-view" v-bind="messageViewProps" />
161
- </template>
162
-
163
- <template v-if="$slots.input" #input="inputProps">
164
- <slot name="input" v-bind="inputProps" />
165
- </template>
166
-
167
- <template
168
- v-if="$slots['suggestion-view']"
169
- #suggestion-view="suggestionViewProps"
170
- >
171
- <slot name="suggestion-view" v-bind="suggestionViewProps" />
172
- </template>
173
171
  </CopilotSidebarView>
174
172
  </template>
175
173
  </CopilotChat>