@copilotkit/vue 2.0.0-rc.11 → 2.0.0-rc.13

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/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("@copilotkit/core"),E=require("@ag-ui/client"),e=require("./use-render-activity-message-2np7y4Qt.cjs"),S=require("vue"),R=require("@copilotkit/mcp-apps-renderer/activity"),f=require("@copilotkit/shared"),T=require("zod");function O(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const l=O(T);function g(t,n,r,a){if(t.$ref&&r){const o=t.$ref.replace(/^#\/\$defs\/|^#\/definitions\//,""),i=a??new Set;if(i.has(o)){console.warn(`[CopilotKit] Circular $ref detected for "${o}" — falling back to z.any()`);let c=l.any();return t.description&&(c=c.describe(t.description)),n?c:c.optional()}const s=r[o];if(s){const c=new Set(i);return c.add(o),g(s,n,r,c)}}const h=r??t.$defs??t.definitions;if(Array.isArray(t.type)){const o=t.type,i=o.includes("null"),s=o.filter(m=>m!=="null"),c=s.length>0?s[0]:"string",C=g({...t,type:c},!0,h,a);let d=i?l.union([C,l.null()]):C;return t.description&&(d=d.describe(t.description)),n?d:d.optional()}const u=t.anyOf??t.oneOf;if(Array.isArray(u)&&u.length>0){if(u.length===1)return g(u[0],n,h,a);const o=u.map(s=>g(s,!0,h,a));let i=l.union(o);return t.description&&(i=i.describe(t.description)),n?i:i.optional()}if(t.type==="object"){const o={};if(!t.properties||!Object.keys(t.properties).length)return n?l.object(o):l.object(o).optional();for(const[s,c]of Object.entries(t.properties))o[s]=g(c,t.required?t.required.includes(s):!1,h,a);let i=l.object(o).describe(t.description);return n?i:i.optional()}else if(t.type==="string"){if(t.enum&&t.enum.length>0){let i=l.enum(t.enum).describe(t.description);return n?i:i.optional()}let o=l.string().describe(t.description);return n?o:o.optional()}else if(t.type==="number"||t.type==="integer"){let o=l.number().describe(t.description);return n?o:o.optional()}else if(t.type==="boolean"){let o=l.boolean().describe(t.description);return n?o:o.optional()}else if(t.type==="array"){let o=g(t.items,!0,h,a),i=l.array(o).describe(t.description);return n?i:i.optional()}else if(t.type==="null"){let o=l.null().describe(t.description);return n?o:o.optional()}console.warn(`[CopilotKit] Unsupported JSON schema type "${t.type??"unknown"}" — falling back to z.any()`);let p=l.any();return t.description&&(p=p.describe(t.description)),n?p:p.optional()}function A(t){if(!t)return l.object({});const n=f.actionParametersToJsonSchema(t);return g(n,!0)}function b(t){return typeof t!="function"?t:(n=>{const r=typeof n.result=="string"?{...n,result:f.parseJson(n.result,n.result)}:n;return t(r)})}function M(t,n){const r="parameters"in t?A(t.parameters):void 0;if(t.name==="*"){e.useRenderTool({name:"*",render:b(t.render),..."agentId"in t?{agentId:t.agentId}:{}},n);return}const a=t;if("renderAndWaitForResponse"in a||"renderAndWait"in a){const p=a.render??a.renderAndWaitForResponse??a.renderAndWait;if(!p){console.warn(`[CopilotKit] useCopilotAction: HITL action '${a.name}' has no render function. Skipping.`);return}e.useHumanInTheLoop({name:a.name,description:a.description,parameters:r,render:b(p),agentId:a.agentId},n);return}if(a.available==="frontend"||a.available==="disabled"){a.render&&r?e.useRenderTool({name:a.name,parameters:r,render:b(a.render),agentId:a.agentId},n):console.warn(`[CopilotKit] useCopilotAction: action '${a.name}' with available="${a.available}" requires both 'render' and 'parameters'. Skipping registration.`);return}const h=a.handler?p=>Promise.resolve(a.handler(p)):void 0;let u;a.available==="remote"?u=!1:a.available!==void 0&&(u=!0),e.useFrontendTool({name:a.name,description:a.description,parameters:r,handler:h,followUp:a.followUp,render:b(a.render),available:u,agentId:a.agentId,get webmcp(){return a.webmcp}},n)}function I(t,n){const{name:r,description:a,parameters:h,handler:u,followUp:p,available:o,render:i,agentId:s}=t,c=A(h),C=u?m=>Promise.resolve(u(m)):void 0,d=typeof i=="function"?m=>{const y=typeof m.result=="string"?{...m,result:f.parseJson(m.result,m.result)}:m;return i(y)}:i;e.useFrontendTool({name:r,description:a,parameters:c,handler:C,followUp:p,render:d,available:o===void 0?void 0:o!=="disabled",agentId:s,get webmcp(){return t.webmcp}},n)}function P(t,n){const{copilotkit:r}=e.useCopilotKit(),a=S.ref(void 0),h=n??[];return S.watch([()=>t.description,()=>t.value,()=>t.convert,()=>t.available,...h],(u,p,o)=>{const i=r.value;if(!i)return;const{description:s,value:c,convert:C,available:d}=t;let m;try{m=C?C(s,c):JSON.stringify(c)}catch(y){console.warn(`[CopilotKit] useCopilotReadable: failed to serialize value for "${s}":`,y),m=String(c)}d!=="disabled"&&(a.value=i.addContext({description:s,value:m}),o(()=>{a.value&&i.removeContext(a.value)}))},{immediate:!0}),a}const _=S.defineComponent({__name:"CopilotKit",props:{publicApiKey:{},publicLicenseKey:{},runtimeUrl:{},headers:{},credentials:{},nonce:{},injectStyles:{type:Boolean,default:!0},messageFilter:{},defaultThrottleMs:{},licenseToken:{},properties:{},useSingleEndpoint:{type:Boolean},agents__unsafe_dev_only:{},selfManagedAgents:{},renderToolCalls:{},renderActivityMessages:{},renderCustomMessages:{},frontendTools:{},humanInTheLoop:{},openGenerativeUI:{},enableInspector:{type:Boolean},onError:{},a2ui:{},mcpApps:{},markdownRenderer:{},debug:{type:[Boolean,Object]},learning:{type:[Boolean,Object]}},setup(t){const n=t;return(r,a)=>(S.openBlock(),S.createBlock(e._sfc_main$17,S.normalizeProps(S.guardReactiveProps(n)),{default:S.withCtx(()=>[S.renderSlot(r.$slots,"default")]),_:3},16))}});Object.defineProperty(exports,"CopilotChatDefaultLabels",{enumerable:!0,get:()=>v.CopilotChatDefaultLabels});Object.defineProperty(exports,"extractCompleteStyles",{enumerable:!0,get:()=>v.ɵextractCompleteStyles});Object.defineProperty(exports,"processPartialHtml",{enumerable:!0,get:()=>v.ɵprocessPartialHtml});Object.defineProperty(exports,"PROTOCOL_VERSION",{enumerable:!0,get:()=>E.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.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.CopilotChatToolCallGroup=e._sfc_main$11;exports.CopilotChatToolCallsView=e._sfc_main$12;exports.CopilotChatUserMessage=e._sfc_main$13;exports.CopilotChatView=e._sfc_main$14;exports.CopilotChatWorkSummary=e._sfc_main$15;exports.CopilotKitCoreVue=e.CopilotKitCoreVue;exports.CopilotKitInspector=e._sfc_main$16;exports.CopilotKitProvider=e._sfc_main$17;exports.CopilotKitStyles=e.CopilotKitStyles;exports.CopilotModalHeader=e.CopilotModalHeader;exports.CopilotPopup=e._sfc_main$18;exports.CopilotPopupView=e.CopilotPopupView;exports.CopilotSidebar=e._sfc_main$19;exports.CopilotSidebarView=e.CopilotSidebarView;exports.CopilotThreadsDrawer=e._sfc_main$20;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.MARKDOWN_RENDERER_KEY=e.MARKDOWN_RENDERER_KEY;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.StreamingMarkdownDefault=e._sfc_main$21;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.getOperationSurfaceId=e.getOperationSurfaceId;exports.isVueComponentRenderer=e.isVueComponentRenderer;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.useKeyboardHeight=e.useKeyboardHeight;exports.useLicenseContext=e.useLicenseContext;exports.useMarkdownRenderer=e.useMarkdownRenderer;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:()=>R.MCPAppsActivityContentSchema});Object.defineProperty(exports,"MCPAppsActivityType",{enumerable:!0,get:()=>R.MCPAppsActivityType});Object.defineProperty(exports,"ɵrunMcpFollowUp",{enumerable:!0,get:()=>R.ɵrunMcpFollowUp});Object.defineProperty(exports,"createLicenseContextValue",{enumerable:!0,get:()=>f.createLicenseContextValue});exports.CopilotKit=_;exports.useCopilotAction=M;exports.useCopilotReadable=P;exports.useFrontendTool=I;Object.keys(v).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>v[t]})});Object.keys(E).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>E[t]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("@copilotkit/core"),E=require("@ag-ui/client"),e=require("./use-render-activity-message-BSIl7tdx.cjs"),S=require("vue"),R=require("@copilotkit/mcp-apps-renderer/activity"),f=require("@copilotkit/shared"),T=require("zod");function O(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const l=O(T);function g(t,n,r,a){if(t.$ref&&r){const o=t.$ref.replace(/^#\/\$defs\/|^#\/definitions\//,""),i=a??new Set;if(i.has(o)){console.warn(`[CopilotKit] Circular $ref detected for "${o}" — falling back to z.any()`);let c=l.any();return t.description&&(c=c.describe(t.description)),n?c:c.optional()}const s=r[o];if(s){const c=new Set(i);return c.add(o),g(s,n,r,c)}}const h=r??t.$defs??t.definitions;if(Array.isArray(t.type)){const o=t.type,i=o.includes("null"),s=o.filter(m=>m!=="null"),c=s.length>0?s[0]:"string",C=g({...t,type:c},!0,h,a);let d=i?l.union([C,l.null()]):C;return t.description&&(d=d.describe(t.description)),n?d:d.optional()}const u=t.anyOf??t.oneOf;if(Array.isArray(u)&&u.length>0){if(u.length===1)return g(u[0],n,h,a);const o=u.map(s=>g(s,!0,h,a));let i=l.union(o);return t.description&&(i=i.describe(t.description)),n?i:i.optional()}if(t.type==="object"){const o={};if(!t.properties||!Object.keys(t.properties).length)return n?l.object(o):l.object(o).optional();for(const[s,c]of Object.entries(t.properties))o[s]=g(c,t.required?t.required.includes(s):!1,h,a);let i=l.object(o).describe(t.description);return n?i:i.optional()}else if(t.type==="string"){if(t.enum&&t.enum.length>0){let i=l.enum(t.enum).describe(t.description);return n?i:i.optional()}let o=l.string().describe(t.description);return n?o:o.optional()}else if(t.type==="number"||t.type==="integer"){let o=l.number().describe(t.description);return n?o:o.optional()}else if(t.type==="boolean"){let o=l.boolean().describe(t.description);return n?o:o.optional()}else if(t.type==="array"){let o=g(t.items,!0,h,a),i=l.array(o).describe(t.description);return n?i:i.optional()}else if(t.type==="null"){let o=l.null().describe(t.description);return n?o:o.optional()}console.warn(`[CopilotKit] Unsupported JSON schema type "${t.type??"unknown"}" — falling back to z.any()`);let p=l.any();return t.description&&(p=p.describe(t.description)),n?p:p.optional()}function A(t){if(!t)return l.object({});const n=f.actionParametersToJsonSchema(t);return g(n,!0)}function b(t){return typeof t!="function"?t:(n=>{const r=typeof n.result=="string"?{...n,result:f.parseJson(n.result,n.result)}:n;return t(r)})}function M(t,n){const r="parameters"in t?A(t.parameters):void 0;if(t.name==="*"){e.useRenderTool({name:"*",render:b(t.render),..."agentId"in t?{agentId:t.agentId}:{}},n);return}const a=t;if("renderAndWaitForResponse"in a||"renderAndWait"in a){const p=a.render??a.renderAndWaitForResponse??a.renderAndWait;if(!p){console.warn(`[CopilotKit] useCopilotAction: HITL action '${a.name}' has no render function. Skipping.`);return}e.useHumanInTheLoop({name:a.name,description:a.description,parameters:r,render:b(p),agentId:a.agentId},n);return}if(a.available==="frontend"||a.available==="disabled"){a.render&&r?e.useRenderTool({name:a.name,parameters:r,render:b(a.render),agentId:a.agentId},n):console.warn(`[CopilotKit] useCopilotAction: action '${a.name}' with available="${a.available}" requires both 'render' and 'parameters'. Skipping registration.`);return}const h=a.handler?p=>Promise.resolve(a.handler(p)):void 0;let u;a.available==="remote"?u=!1:a.available!==void 0&&(u=!0),e.useFrontendTool({name:a.name,description:a.description,parameters:r,handler:h,followUp:a.followUp,render:b(a.render),available:u,agentId:a.agentId,get webmcp(){return a.webmcp}},n)}function I(t,n){const{name:r,description:a,parameters:h,handler:u,followUp:p,available:o,render:i,agentId:s}=t,c=A(h),C=u?m=>Promise.resolve(u(m)):void 0,d=typeof i=="function"?m=>{const y=typeof m.result=="string"?{...m,result:f.parseJson(m.result,m.result)}:m;return i(y)}:i;e.useFrontendTool({name:r,description:a,parameters:c,handler:C,followUp:p,render:d,available:o===void 0?void 0:o!=="disabled",agentId:s,get webmcp(){return t.webmcp}},n)}function P(t,n){const{copilotkit:r}=e.useCopilotKit(),a=S.ref(void 0),h=n??[];return S.watch([()=>t.description,()=>t.value,()=>t.convert,()=>t.available,...h],(u,p,o)=>{const i=r.value;if(!i)return;const{description:s,value:c,convert:C,available:d}=t;let m;try{m=C?C(s,c):JSON.stringify(c)}catch(y){console.warn(`[CopilotKit] useCopilotReadable: failed to serialize value for "${s}":`,y),m=String(c)}d!=="disabled"&&(a.value=i.addContext({description:s,value:m}),o(()=>{a.value&&i.removeContext(a.value)}))},{immediate:!0}),a}const _=S.defineComponent({__name:"CopilotKit",props:{publicApiKey:{},publicLicenseKey:{},runtimeUrl:{},headers:{},credentials:{},nonce:{},injectStyles:{type:Boolean,default:!0},messageFilter:{},defaultThrottleMs:{},licenseToken:{},properties:{},useSingleEndpoint:{type:Boolean},agents__unsafe_dev_only:{},selfManagedAgents:{},renderToolCalls:{},renderActivityMessages:{},renderCustomMessages:{},frontendTools:{},humanInTheLoop:{},openGenerativeUI:{},enableInspector:{type:Boolean},onError:{},a2ui:{},mcpApps:{},markdownRenderer:{},debug:{type:[Boolean,Object]},learning:{type:[Boolean,Object]}},setup(t){const n=t;return(r,a)=>(S.openBlock(),S.createBlock(e._sfc_main$17,S.normalizeProps(S.guardReactiveProps(n)),{default:S.withCtx(()=>[S.renderSlot(r.$slots,"default")]),_:3},16))}});Object.defineProperty(exports,"CopilotChatDefaultLabels",{enumerable:!0,get:()=>v.CopilotChatDefaultLabels});Object.defineProperty(exports,"extractCompleteStyles",{enumerable:!0,get:()=>v.ɵextractCompleteStyles});Object.defineProperty(exports,"processPartialHtml",{enumerable:!0,get:()=>v.ɵprocessPartialHtml});Object.defineProperty(exports,"PROTOCOL_VERSION",{enumerable:!0,get:()=>E.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.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.CopilotChatToolCallGroup=e._sfc_main$11;exports.CopilotChatToolCallsView=e._sfc_main$12;exports.CopilotChatUserMessage=e._sfc_main$13;exports.CopilotChatView=e._sfc_main$14;exports.CopilotChatWorkSummary=e._sfc_main$15;exports.CopilotKitCoreVue=e.CopilotKitCoreVue;exports.CopilotKitInspector=e._sfc_main$16;exports.CopilotKitProvider=e._sfc_main$17;exports.CopilotKitStyles=e.CopilotKitStyles;exports.CopilotModalHeader=e.CopilotModalHeader;exports.CopilotPopup=e._sfc_main$18;exports.CopilotPopupView=e.CopilotPopupView;exports.CopilotSidebar=e._sfc_main$19;exports.CopilotSidebarView=e.CopilotSidebarView;exports.CopilotThreadsDrawer=e._sfc_main$20;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.MARKDOWN_RENDERER_KEY=e.MARKDOWN_RENDERER_KEY;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.StreamingMarkdownDefault=e._sfc_main$21;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.getOperationSurfaceId=e.getOperationSurfaceId;exports.isVueComponentRenderer=e.isVueComponentRenderer;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.useKeyboardHeight=e.useKeyboardHeight;exports.useLicenseContext=e.useLicenseContext;exports.useMarkdownRenderer=e.useMarkdownRenderer;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:()=>R.MCPAppsActivityContentSchema});Object.defineProperty(exports,"MCPAppsActivityType",{enumerable:!0,get:()=>R.MCPAppsActivityType});Object.defineProperty(exports,"ɵrunMcpFollowUp",{enumerable:!0,get:()=>R.ɵrunMcpFollowUp});Object.defineProperty(exports,"createLicenseContextValue",{enumerable:!0,get:()=>f.createLicenseContextValue});exports.CopilotKit=_;exports.useCopilotAction=M;exports.useCopilotReadable=P;exports.useFrontendTool=I;Object.keys(v).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>v[t]})});Object.keys(E).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>E[t]})});
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.mjs CHANGED
@@ -2,8 +2,8 @@ export * from "@copilotkit/core";
2
2
  import { CopilotChatDefaultLabels as G, ɵextractCompleteStyles as N, ɵprocessPartialHtml as W } from "@copilotkit/core";
3
3
  export * from "@ag-ui/client";
4
4
  import { PROTOCOL_VERSION as Y } from "@ag-ui/client";
5
- import { bK as g, bD as A, bC as f, bA as I, J as R } from "./use-render-activity-message-D59E9t0x.js";
6
- import { A as q, _ as j, a as ee, b as ae, c as te, d as ne, e as se, f as oe, g as re, h as ie, i as le, i as ce, i as pe, B as ue, j as me, C as de, k as he, l as Se, m as Ce, n as be, o as ge, p as fe, q as ve, r as ye, s as Ae, t as Ie, u as Re, v as Ee, w as Te, x as Me, y as Oe, z as Pe, D as xe, E as we, F as Ue, G as ke, H as Fe, I as Ve, K as Ke, L as De, M as _e, N as ze, O as Be, P as $e, Q as Le, R as He, S as Je, T as Ge, U as Ne, V as We, V as Ze, V as Qe, W as Ye, W as Xe, X as qe, Y as je, Z as ea, $ as aa, a0 as ta, a1 as na, a2 as sa, a3 as oa, a3 as ra, a3 as ia, T as la, C as ca, a4 as pa, a5 as ua, a6 as ma, a7 as da, a8 as ha, a9 as Sa, aa as Ca, ab as ba, ac as ga, ad as fa, ae as va, af as ya, ag as Aa, ah as Ia, ai as Ra, aj as Ea, ak as Ta, al as Ma, am as Oa, an as Pa, ao as xa, ap as wa, aq as Ua, ar as ka, a4 as Fa, as as Va, at as Ka, au as Da, av as _a, aw as za, ax as Ba, ay as $a, az as La, aA as Ha, aB as Ja, aC as Ga, aD as Na, aE as Wa, aF as Za, aG as Qa, aH as Ya, aI as Xa, aJ as qa, aK as ja, aL as et, aM as at, aN as tt, aO as nt, aP as st, aQ as ot, aR as rt, aS as it, aT as lt, aU as ct, aV as pt, aW as ut, aX as mt, aY as dt, aZ as ht, a_ as St, a$ as Ct, b0 as bt, b1 as gt, b2 as ft, b3 as vt, b4 as yt, b5 as At, b6 as It, b7 as Rt, b8 as Et, b9 as Tt, b4 as Mt, ba as Ot, bb as Pt, bc as xt, bd as wt, be as Ut, bf as kt, bg as Ft, bh as Vt, bi as Kt, bj as Dt, bk as _t, a5 as zt, bl as Bt, bm as $t, bn as Lt, bn as Ht, bn as Jt, bo as Gt, bp as Nt, bq as Wt, br as Zt, bs as Qt, bt as Yt, bu as Xt, bv as qt, bw as jt, bx as en, by as an, bz as tn, bB as nn, bE as sn, bF as on, bG as rn, bH as ln, bI as cn, bJ as pn, bL as un, bM as mn, bN as dn, bO as hn } from "./use-render-activity-message-D59E9t0x.js";
5
+ import { bK as g, bD as A, bC as f, bA as I, J as R } from "./use-render-activity-message-B9Tu0pgS.js";
6
+ import { A as q, _ as j, a as ee, b as ae, c as te, d as ne, e as se, f as oe, g as re, h as ie, i as le, i as ce, i as pe, B as ue, j as me, C as de, k as he, l as Se, m as Ce, n as be, o as ge, p as fe, q as ve, r as ye, s as Ae, t as Ie, u as Re, v as Ee, w as Te, x as Me, y as Oe, z as Pe, D as xe, E as we, F as Ue, G as ke, H as Fe, I as Ve, K as Ke, L as De, M as _e, N as ze, O as Be, P as $e, Q as Le, R as He, S as Je, T as Ge, U as Ne, V as We, V as Ze, V as Qe, W as Ye, W as Xe, X as qe, Y as je, Z as ea, $ as aa, a0 as ta, a1 as na, a2 as sa, a3 as oa, a3 as ra, a3 as ia, T as la, C as ca, a4 as pa, a5 as ua, a6 as ma, a7 as da, a8 as ha, a9 as Sa, aa as Ca, ab as ba, ac as ga, ad as fa, ae as va, af as ya, ag as Aa, ah as Ia, ai as Ra, aj as Ea, ak as Ta, al as Ma, am as Oa, an as Pa, ao as xa, ap as wa, aq as Ua, ar as ka, a4 as Fa, as as Va, at as Ka, au as Da, av as _a, aw as za, ax as Ba, ay as $a, az as La, aA as Ha, aB as Ja, aC as Ga, aD as Na, aE as Wa, aF as Za, aG as Qa, aH as Ya, aI as Xa, aJ as qa, aK as ja, aL as et, aM as at, aN as tt, aO as nt, aP as st, aQ as ot, aR as rt, aS as it, aT as lt, aU as ct, aV as pt, aW as ut, aX as mt, aY as dt, aZ as ht, a_ as St, a$ as Ct, b0 as bt, b1 as gt, b2 as ft, b3 as vt, b4 as yt, b5 as At, b6 as It, b7 as Rt, b8 as Et, b9 as Tt, b4 as Mt, ba as Ot, bb as Pt, bc as xt, bd as wt, be as Ut, bf as kt, bg as Ft, bh as Vt, bi as Kt, bj as Dt, bk as _t, a5 as zt, bl as Bt, bm as $t, bn as Lt, bn as Ht, bn as Jt, bo as Gt, bp as Nt, bq as Wt, br as Zt, bs as Qt, bt as Yt, bu as Xt, bv as qt, bw as jt, bx as en, by as an, bz as tn, bB as nn, bE as sn, bF as on, bG as rn, bH as ln, bI as cn, bJ as pn, bL as un, bM as mn, bN as dn, bO as hn } from "./use-render-activity-message-B9Tu0pgS.js";
7
7
  import { ref as E, watch as T, defineComponent as M, openBlock as O, createBlock as P, normalizeProps as x, guardReactiveProps as w, withCtx as U, renderSlot as k } from "vue";
8
8
  import { MCPAppsActivityContentSchema as Cn, MCPAppsActivityType as bn, ɵrunMcpFollowUp as gn } from "@copilotkit/mcp-apps-renderer/activity";
9
9
  import { actionParametersToJsonSchema as F, parseJson as v } from "@copilotkit/shared";
@@ -4760,7 +4760,7 @@ const Pg = Pn(xe), we = ao((e) => typeof e == "object" && e !== null && !Array.i
4760
4760
  name: F().optional(),
4761
4761
  encryptedValue: F().optional(),
4762
4762
  metadata: we.optional()
4763
- }), tC = we.optional(), dv = "2.0.0-rc.11", pv = /* @__PURE__ */ re({
4763
+ }), tC = we.optional(), dv = "2.0.0-rc.13", pv = /* @__PURE__ */ re({
4764
4764
  inheritAttrs: !1,
4765
4765
  __name: "CopilotKitInspector",
4766
4766
  props: {
@@ -18094,4 +18094,4 @@ export {
18094
18094
  dl as y,
18095
18095
  A0 as z
18096
18096
  };
18097
- //# sourceMappingURL=use-render-activity-message-D59E9t0x.js.map
18097
+ //# sourceMappingURL=use-render-activity-message-B9Tu0pgS.js.map