@copilotkit/react-core 1.75.1 → 1.75.2
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-DIudpHkM.cjs → copilotkit-Beiw32bn.cjs} +5 -16
- package/dist/copilotkit-Beiw32bn.cjs.map +1 -0
- package/dist/{copilotkit-DfsHZUuo.mjs → copilotkit-D9iy3p2l.mjs} +5 -16
- package/dist/copilotkit-D9iy3p2l.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +4 -15
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +3 -14
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.mjs +3 -14
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +4 -15
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/dist/copilotkit-DIudpHkM.cjs.map +0 -1
- package/dist/copilotkit-DfsHZUuo.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_copilotkit = require('./copilotkit-
|
|
4
|
+
const require_copilotkit = require('./copilotkit-Beiw32bn.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_copilotkit.__toESM(react);
|
|
7
7
|
let _copilotkit_core = require("@copilotkit/core");
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { Pt as useCopilotChatConfiguration, Q as useSuggestions, X as INTERRUPT_EVENT_NAME, Y as useInterrupt, Z as useConfigureSuggestions, a as ThreadsProvider, c as CoAgentStateRendersProvider, ct as useFrontendTool$1, d as shouldShowDevConsole, f as useToast, ft as useCopilotKit, g as useCopilotContext, h as CopilotContext, ht as defineToolCallRenderer, i as ThreadsContext, kt as useRenderToolCall$1, l as useCoAgentStateRenders, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, nt as useAgent, o as useThreads, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, rt as useHumanInTheLoop$1, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, ut as useRenderCustomMessages } from "./copilotkit-
|
|
3
|
+
import { Pt as useCopilotChatConfiguration, Q as useSuggestions, X as INTERRUPT_EVENT_NAME, Y as useInterrupt, Z as useConfigureSuggestions, a as ThreadsProvider, c as CoAgentStateRendersProvider, ct as useFrontendTool$1, d as shouldShowDevConsole, f as useToast, ft as useCopilotKit, g as useCopilotContext, h as CopilotContext, ht as defineToolCallRenderer, i as ThreadsContext, kt as useRenderToolCall$1, l as useCoAgentStateRenders, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, nt as useAgent, o as useThreads, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, rt as useHumanInTheLoop$1, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, ut as useRenderCustomMessages } from "./copilotkit-D9iy3p2l.mjs";
|
|
4
4
|
import React, { Fragment, createElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { CopilotKitCoreRuntimeConnectionStatus, ToolCallStatus } from "@copilotkit/core";
|
|
6
6
|
import { AGUIConnectNotImplementedError, HttpAgent } from "@ag-ui/client";
|
package/dist/index.umd.js
CHANGED
|
@@ -583,7 +583,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
583
583
|
|
|
584
584
|
//#endregion
|
|
585
585
|
//#region package.json
|
|
586
|
-
var version = "1.75.
|
|
586
|
+
var version = "1.75.2";
|
|
587
587
|
|
|
588
588
|
//#endregion
|
|
589
589
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
@@ -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 interruptRunIdsRef = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
3323
3322
|
const legacyRunIdRef = (0, react.useRef)(void 0);
|
|
3324
3323
|
(0, react.useEffect)(() => {
|
|
3325
3324
|
const interruptState = interruptStateRef.current;
|
|
@@ -3333,16 +3332,11 @@ react_markdown = __toESM(react_markdown);
|
|
|
3333
3332
|
};
|
|
3334
3333
|
},
|
|
3335
3334
|
onRunFinishedEvent: (params) => {
|
|
3336
|
-
if (params.outcome === "interrupt")
|
|
3337
|
-
const runId = params.input.runId;
|
|
3338
|
-
for (const interrupt of params.interrupts) interruptRunIdsRef.current.set(interrupt.id, runId);
|
|
3339
|
-
localStandard = params.interrupts;
|
|
3340
|
-
}
|
|
3335
|
+
if (params.outcome === "interrupt") localStandard = params.interrupts;
|
|
3341
3336
|
},
|
|
3342
3337
|
onRunStartedEvent: () => {
|
|
3343
3338
|
localLegacy = null;
|
|
3344
3339
|
localStandard = null;
|
|
3345
|
-
interruptRunIdsRef.current.clear();
|
|
3346
3340
|
legacyRunIdRef.current = void 0;
|
|
3347
3341
|
interruptState.clear();
|
|
3348
3342
|
setPending(null);
|
|
@@ -3362,7 +3356,6 @@ react_markdown = __toESM(react_markdown);
|
|
|
3362
3356
|
onRunFailed: () => {
|
|
3363
3357
|
localLegacy = null;
|
|
3364
3358
|
localStandard = null;
|
|
3365
|
-
interruptRunIdsRef.current.clear();
|
|
3366
3359
|
legacyRunIdRef.current = void 0;
|
|
3367
3360
|
interruptState.clear();
|
|
3368
3361
|
setPending(null);
|
|
@@ -3402,7 +3395,6 @@ react_markdown = __toESM(react_markdown);
|
|
|
3402
3395
|
return;
|
|
3403
3396
|
}
|
|
3404
3397
|
if (decision.kind !== "resume") return;
|
|
3405
|
-
const runId = decision.resume.map((entry) => interruptRunIdsRef.current.get(entry.interruptId)).find((candidate) => candidate !== void 0);
|
|
3406
3398
|
for (const toolResult of decision.toolResults) agent.addMessage({
|
|
3407
3399
|
id: (0, _ag_ui_client.randomUUID)(),
|
|
3408
3400
|
role: "tool",
|
|
@@ -3412,8 +3404,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
3412
3404
|
try {
|
|
3413
3405
|
return await copilotkit.runAgent({
|
|
3414
3406
|
agent,
|
|
3415
|
-
resume: decision.resume
|
|
3416
|
-
...runId !== void 0 ? { runId } : {}
|
|
3407
|
+
resume: decision.resume
|
|
3417
3408
|
});
|
|
3418
3409
|
} catch (err) {
|
|
3419
3410
|
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|
|
@@ -3440,7 +3431,6 @@ react_markdown = __toESM(react_markdown);
|
|
|
3440
3431
|
return;
|
|
3441
3432
|
}
|
|
3442
3433
|
if (decision.kind !== "resume") return;
|
|
3443
|
-
const runId = decision.resume.map((entry) => interruptRunIdsRef.current.get(entry.interruptId)).find((candidate) => candidate !== void 0);
|
|
3444
3434
|
for (const toolResult of decision.toolResults) agent.addMessage({
|
|
3445
3435
|
id: (0, _ag_ui_client.randomUUID)(),
|
|
3446
3436
|
role: "tool",
|
|
@@ -3450,8 +3440,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
3450
3440
|
try {
|
|
3451
3441
|
return await copilotkit.runAgent({
|
|
3452
3442
|
agent,
|
|
3453
|
-
resume: decision.resume
|
|
3454
|
-
...runId !== void 0 ? { runId } : {}
|
|
3443
|
+
resume: decision.resume
|
|
3455
3444
|
});
|
|
3456
3445
|
} catch (err) {
|
|
3457
3446
|
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|