@copilotkit/react-core 1.75.2 → 1.76.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.
- package/dist/{copilotkit-CGlSOKHM.d.mts → copilotkit-B90cY0Zg.d.mts} +18 -17
- package/dist/copilotkit-B90cY0Zg.d.mts.map +1 -0
- package/dist/{copilotkit-D9iy3p2l.mjs → copilotkit-LD7Gp2aV.mjs} +72 -35
- package/dist/copilotkit-LD7Gp2aV.mjs.map +1 -0
- package/dist/{copilotkit-Cjj9wDI8.d.cts → copilotkit-W-bV_OSs.d.cts} +5 -4
- package/dist/copilotkit-W-bV_OSs.d.cts.map +1 -0
- package/dist/{copilotkit-Beiw32bn.cjs → copilotkit-dHdNF7H5.cjs} +68 -32
- package/dist/copilotkit-dHdNF7H5.cjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +21 -29
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +17 -24
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts.map +1 -1
- package/dist/v2/headless.d.mts +2 -2
- package/dist/v2/headless.d.mts.map +1 -1
- package/dist/v2/headless.mjs +18 -25
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +302 -121
- package/dist/v2/index.d.cts +2 -2
- package/dist/v2/index.d.mts +2 -2
- package/dist/v2/index.mjs +2 -2
- package/dist/v2/index.umd.js +370 -155
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +10 -10
- package/dist/copilotkit-Beiw32bn.cjs.map +0 -1
- package/dist/copilotkit-CGlSOKHM.d.mts.map +0 -1
- package/dist/copilotkit-Cjj9wDI8.d.cts.map +0 -1
- package/dist/copilotkit-D9iy3p2l.mjs.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
(function(global, factory) {
|
|
4
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@copilotkit/core'), require('@ag-ui/client'), require('@copilotkit/shared'), require('react/jsx-runtime'), require('zod'), require('@copilotkit/mcp-apps-renderer/activity'), require('@copilotkit/a2ui-renderer'), require('zod-to-json-schema'), require('react-dom'), require('react-markdown'), require('@copilotkit/runtime-client-gql')) :
|
|
5
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', '@copilotkit/core', '@ag-ui/client', '@copilotkit/shared', 'react/jsx-runtime', 'zod', '@copilotkit/mcp-apps-renderer/activity', '@copilotkit/a2ui-renderer', 'zod-to-json-schema', 'react-dom', 'react-markdown', '@copilotkit/runtime-client-gql'], factory) :
|
|
6
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitReactCore = {}), global.React,global.CopilotKitCore,global.AgUIClient,global.CopilotKitShared,global.ReactJsxRuntime,global.Zod,global.CopilotKitMcpAppsRendererActivity,global.CopilotKitA2UIRenderer,global.zod_to_json_schema,global.ReactDOM,global.ReactMarkdown,global.CopilotKitRuntimeClientGQL));
|
|
7
|
-
})(this, function(exports, react, _copilotkit_core, _ag_ui_client, _copilotkit_shared, react_jsx_runtime, zod, _copilotkit_mcp_apps_renderer_activity, _copilotkit_a2ui_renderer, zod_to_json_schema, react_dom, react_markdown, _copilotkit_runtime_client_gql) {
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@copilotkit/core'), require('@ag-ui/client'), require('@copilotkit/shared'), require('react/jsx-runtime'), require('@ag-ui/core'), require('zod'), require('@copilotkit/mcp-apps-renderer/activity'), require('@copilotkit/a2ui-renderer'), require('zod-to-json-schema'), require('react-dom'), require('react-markdown'), require('@copilotkit/runtime-client-gql')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', '@copilotkit/core', '@ag-ui/client', '@copilotkit/shared', 'react/jsx-runtime', '@ag-ui/core', 'zod', '@copilotkit/mcp-apps-renderer/activity', '@copilotkit/a2ui-renderer', 'zod-to-json-schema', 'react-dom', 'react-markdown', '@copilotkit/runtime-client-gql'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitReactCore = {}), global.React,global.CopilotKitCore,global.AgUIClient,global.CopilotKitShared,global.ReactJsxRuntime,global._ag_ui_core,global.Zod,global.CopilotKitMcpAppsRendererActivity,global.CopilotKitA2UIRenderer,global.zod_to_json_schema,global.ReactDOM,global.ReactMarkdown,global.CopilotKitRuntimeClientGQL));
|
|
7
|
+
})(this, function(exports, react, _copilotkit_core, _ag_ui_client, _copilotkit_shared, react_jsx_runtime, _ag_ui_core, zod, _copilotkit_mcp_apps_renderer_activity, _copilotkit_a2ui_renderer, zod_to_json_schema, react_dom, react_markdown, _copilotkit_runtime_client_gql) {
|
|
8
8
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
9
9
|
//#region \0rolldown/runtime.js
|
|
10
10
|
var __create = Object.create;
|
|
@@ -487,7 +487,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
487
487
|
toolCallId: toolCall.id,
|
|
488
488
|
args,
|
|
489
489
|
status: _copilotkit_core.ToolCallStatus.Complete,
|
|
490
|
-
result: toolMessage.content
|
|
490
|
+
result: (0, _ag_ui_core.contentToText)(toolMessage.content)
|
|
491
491
|
});
|
|
492
492
|
else if (isExecuting) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RenderComponent, {
|
|
493
493
|
name: toolName,
|
|
@@ -583,7 +583,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
583
583
|
|
|
584
584
|
//#endregion
|
|
585
585
|
//#region package.json
|
|
586
|
-
var version = "1.
|
|
586
|
+
var version = "1.76.0";
|
|
587
587
|
|
|
588
588
|
//#endregion
|
|
589
589
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
@@ -3026,7 +3026,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
3026
3026
|
updateFlags
|
|
3027
3027
|
]);
|
|
3028
3028
|
(0, react.useEffect)(() => {
|
|
3029
|
-
if (
|
|
3029
|
+
if ((0, _copilotkit_core.ɵisHttpAgent)(agent)) copilotkit.applyHeadersToAgent(agent);
|
|
3030
3030
|
if (agent instanceof _copilotkit_core.ProxiedCopilotRuntimeAgent) agent.credentials = copilotkit.credentials;
|
|
3031
3031
|
}, [
|
|
3032
3032
|
agent,
|
|
@@ -3319,7 +3319,6 @@ react_markdown = __toESM(react_markdown);
|
|
|
3319
3319
|
pendingRef.current = pending;
|
|
3320
3320
|
const [handlerResult, setHandlerResult] = (0, react.useState)(null);
|
|
3321
3321
|
const interruptStateRef = (0, react.useRef)(new _copilotkit_core.ɵInterruptState());
|
|
3322
|
-
const legacyRunIdRef = (0, react.useRef)(void 0);
|
|
3323
3322
|
(0, react.useEffect)(() => {
|
|
3324
3323
|
const interruptState = interruptStateRef.current;
|
|
3325
3324
|
let localLegacy = null;
|
|
@@ -3337,16 +3336,14 @@ react_markdown = __toESM(react_markdown);
|
|
|
3337
3336
|
onRunStartedEvent: () => {
|
|
3338
3337
|
localLegacy = null;
|
|
3339
3338
|
localStandard = null;
|
|
3340
|
-
legacyRunIdRef.current = void 0;
|
|
3341
3339
|
interruptState.clear();
|
|
3342
3340
|
setPending(null);
|
|
3343
3341
|
},
|
|
3344
|
-
onRunFinalized: (
|
|
3342
|
+
onRunFinalized: () => {
|
|
3345
3343
|
if (localStandard && localStandard.length > 0) {
|
|
3346
3344
|
interruptState.setStandard(localStandard);
|
|
3347
3345
|
setPending(interruptState.pending);
|
|
3348
3346
|
} else if (localLegacy) {
|
|
3349
|
-
legacyRunIdRef.current = params.input.runId;
|
|
3350
3347
|
interruptState.setLegacy(localLegacy);
|
|
3351
3348
|
setPending(interruptState.pending);
|
|
3352
3349
|
}
|
|
@@ -3356,7 +3353,6 @@ react_markdown = __toESM(react_markdown);
|
|
|
3356
3353
|
onRunFailed: () => {
|
|
3357
3354
|
localLegacy = null;
|
|
3358
3355
|
localStandard = null;
|
|
3359
|
-
legacyRunIdRef.current = void 0;
|
|
3360
3356
|
interruptState.clear();
|
|
3361
3357
|
setPending(null);
|
|
3362
3358
|
}
|
|
@@ -3371,22 +3367,18 @@ react_markdown = __toESM(react_markdown);
|
|
|
3371
3367
|
if (!current) return;
|
|
3372
3368
|
if (current.kind === "standard" && current.interrupts.length > 1 && interruptId === void 0) console.warn(`[CopilotKit] useInterrupt: resolve()/cancel() called without an interruptId while ${current.interrupts.length} interrupts are open; defaulting to the first. Pass an interruptId to address a specific interrupt.`);
|
|
3373
3369
|
const decision = interruptStateRef.current.resolve(payload, interruptId);
|
|
3374
|
-
if (decision.kind === "legacy-resume") {
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|
|
3387
|
-
setPending(null);
|
|
3388
|
-
throw err;
|
|
3389
|
-
}
|
|
3370
|
+
if (decision.kind === "legacy-resume") try {
|
|
3371
|
+
return await copilotkit.runAgent({
|
|
3372
|
+
agent,
|
|
3373
|
+
forwardedProps: { command: {
|
|
3374
|
+
resume: decision.payload,
|
|
3375
|
+
interruptEvent: decision.interruptValue
|
|
3376
|
+
} }
|
|
3377
|
+
});
|
|
3378
|
+
} catch (err) {
|
|
3379
|
+
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|
|
3380
|
+
setPending(null);
|
|
3381
|
+
throw err;
|
|
3390
3382
|
}
|
|
3391
3383
|
if (decision.kind === "expired") {
|
|
3392
3384
|
console.error(`[CopilotKit] useInterrupt: interrupt ${decision.interrupt.id} expired at ${decision.interrupt.expiresAt}; not resuming.`);
|
|
@@ -5747,7 +5739,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
5747
5739
|
(0, react.useEffect)(() => {
|
|
5748
5740
|
let detached = false;
|
|
5749
5741
|
const connectAbortController = new AbortController();
|
|
5750
|
-
if (
|
|
5742
|
+
if ((0, _copilotkit_core.ɵisHttpAgent)(agent)) agent.abortController = connectAbortController;
|
|
5751
5743
|
const connect = async (agent) => {
|
|
5752
5744
|
setAgentAvailable(false);
|
|
5753
5745
|
try {
|