@copilotkit/react-core 1.77.0 → 1.77.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-CP9qPAqV.mjs → copilotkit-BI7KSQQw.mjs} +251 -103
- package/dist/copilotkit-BI7KSQQw.mjs.map +1 -0
- package/dist/{copilotkit-DGc2YiW9.d.cts → copilotkit-BQBy80gH.d.cts} +80 -15
- package/dist/copilotkit-BQBy80gH.d.cts.map +1 -0
- package/dist/{copilotkit-CFPkj9B9.cjs → copilotkit-D7_J5Hs_.cjs} +262 -102
- package/dist/copilotkit-D7_J5Hs_.cjs.map +1 -0
- package/dist/{copilotkit-Cqa0TfEo.d.mts → copilotkit-DkLb1sf9.d.mts} +80 -15
- package/dist/copilotkit-DkLb1sf9.d.mts.map +1 -0
- package/dist/index.cjs +18 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +8 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +18 -8
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +40 -19
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/index.cjs +3 -1
- 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 +251 -101
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +22 -11
- package/dist/copilotkit-CFPkj9B9.cjs.map +0 -1
- package/dist/copilotkit-CP9qPAqV.mjs.map +0 -1
- package/dist/copilotkit-Cqa0TfEo.d.mts.map +0 -1
- package/dist/copilotkit-DGc2YiW9.d.cts.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -602,7 +602,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
602
602
|
|
|
603
603
|
//#endregion
|
|
604
604
|
//#region package.json
|
|
605
|
-
var version = "1.77.
|
|
605
|
+
var version = "1.77.2";
|
|
606
606
|
|
|
607
607
|
//#endregion
|
|
608
608
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
@@ -2231,7 +2231,12 @@ react_markdown = __toESM(react_markdown);
|
|
|
2231
2231
|
- Use CSS Grid or Flexbox for layout. Ensure the UI looks good at any width.
|
|
2232
2232
|
- Minimal transitions (150ms) for hover/focus states only. No decorative animations.
|
|
2233
2233
|
- Keep the UI focused and dense — avoid excessive padding. Use compact spacing (8–12px gaps, 10–14px padding in controls).`;
|
|
2234
|
-
const
|
|
2234
|
+
const DEFAULT_LEARNING = Object.freeze({});
|
|
2235
|
+
function toLearningConfig(learning) {
|
|
2236
|
+
if (learning === true) return DEFAULT_LEARNING;
|
|
2237
|
+
if (learning === false) return void 0;
|
|
2238
|
+
return learning;
|
|
2239
|
+
}
|
|
2235
2240
|
function useStableArrayProp(prop, warningMessage, isMeaningfulChange) {
|
|
2236
2241
|
const empty = (0, react.useMemo)(() => [], []);
|
|
2237
2242
|
const value = prop ?? empty;
|
|
@@ -2242,6 +2247,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
2242
2247
|
return value;
|
|
2243
2248
|
}
|
|
2244
2249
|
const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, messageFilter, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, agentId, showIntelligenceIndicator = true, useSingleEndpoint, onError, a2ui, defaultThrottleMs, debug, learning }) => {
|
|
2250
|
+
const learningConfig = toLearningConfig(learning);
|
|
2245
2251
|
const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
|
|
2246
2252
|
const [inspectorVisible, setInspectorVisible] = (0, react.useState)(false);
|
|
2247
2253
|
(0, react.useEffect)(() => {
|
|
@@ -2424,7 +2430,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
2424
2430
|
if (!openGenUIActive) return [];
|
|
2425
2431
|
return [{
|
|
2426
2432
|
name: "generateSandboxedUi",
|
|
2427
|
-
description: GENERATE_SANDBOXED_UI_DESCRIPTION,
|
|
2433
|
+
description: _copilotkit_shared.GENERATE_SANDBOXED_UI_DESCRIPTION,
|
|
2428
2434
|
parameters: GenerateSandboxedUiArgsSchema,
|
|
2429
2435
|
handler: async () => "UI generated",
|
|
2430
2436
|
followUp: true,
|
|
@@ -2477,7 +2483,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
2477
2483
|
renderActivityMessages: allActivityRenderers,
|
|
2478
2484
|
renderCustomMessages: renderCustomMessagesList,
|
|
2479
2485
|
debug,
|
|
2480
|
-
learning
|
|
2486
|
+
learning: learningConfig
|
|
2481
2487
|
});
|
|
2482
2488
|
if (defaultThrottleMs !== void 0) copilotkitRef.current.setDefaultThrottleMs(defaultThrottleMs);
|
|
2483
2489
|
}
|
|
@@ -2582,17 +2588,21 @@ react_markdown = __toESM(react_markdown);
|
|
|
2582
2588
|
useSingleEndpoint,
|
|
2583
2589
|
debug
|
|
2584
2590
|
]);
|
|
2585
|
-
const learningEnabled =
|
|
2586
|
-
const
|
|
2587
|
-
const
|
|
2591
|
+
const learningEnabled = learningConfig !== void 0;
|
|
2592
|
+
const generatesTrajectoryId = learning === true;
|
|
2593
|
+
const suppliedTrajectoryId = learningConfig?.trajectoryId;
|
|
2594
|
+
const learningContainerIdsRef = (0, react.useRef)(learningConfig?.learningContainerIds);
|
|
2595
|
+
const generatedTrajectoryIdRef = (0, react.useRef)(void 0);
|
|
2588
2596
|
(0, react.useEffect)(() => {
|
|
2589
|
-
copilotkit.setLearningConfig(
|
|
2590
|
-
learningContainerIdsRef.current =
|
|
2591
|
-
if (
|
|
2592
|
-
}, [copilotkit,
|
|
2597
|
+
copilotkit.setLearningConfig(learningConfig);
|
|
2598
|
+
learningContainerIdsRef.current = learningConfig?.learningContainerIds;
|
|
2599
|
+
if (learningConfig?.sink === void 0 && learningConfig?.trajectoryId === void 0 && learningConfig?.learningContainerIds !== void 0) console.warn("[CopilotKit] learningContainerIds is supported only with a custom sink. Authenticated Trajectory capture does not assign Learning Containers; remove learningContainerIds from the capture options.");
|
|
2600
|
+
}, [copilotkit, learningConfig]);
|
|
2593
2601
|
(0, react.useEffect)(() => {
|
|
2602
|
+
if (!generatesTrajectoryId) generatedTrajectoryIdRef.current = void 0;
|
|
2594
2603
|
if (!learningEnabled) return;
|
|
2595
2604
|
let disposed = false;
|
|
2605
|
+
const trajectoryId = generatesTrajectoryId ? generatedTrajectoryIdRef.current ?? (generatedTrajectoryIdRef.current = (0, _copilotkit_shared.randomUUID)()) : suppliedTrajectoryId;
|
|
2596
2606
|
if (trajectoryId !== void 0) copilotkit.startTrajectory({
|
|
2597
2607
|
trajectoryId,
|
|
2598
2608
|
learningContainerIds: learningContainerIdsRef.current
|
|
@@ -2606,7 +2616,8 @@ react_markdown = __toESM(react_markdown);
|
|
|
2606
2616
|
}, [
|
|
2607
2617
|
copilotkit,
|
|
2608
2618
|
learningEnabled,
|
|
2609
|
-
|
|
2619
|
+
generatesTrajectoryId,
|
|
2620
|
+
suppliedTrajectoryId
|
|
2610
2621
|
]);
|
|
2611
2622
|
const didMountRef = (0, react.useRef)(false);
|
|
2612
2623
|
(0, react.useEffect)(() => {
|
|
@@ -7110,7 +7121,7 @@ react_markdown = __toESM(react_markdown);
|
|
|
7110
7121
|
* running, // A boolean indicating if the agent is currently running.
|
|
7111
7122
|
* start, // A function to start the agent.
|
|
7112
7123
|
* stop, // A function to stop the agent.
|
|
7113
|
-
* run, // A function to (re-)run the agent
|
|
7124
|
+
* run, // A function to (re-)run the agent through the v2 core (`copilotkit.runAgent`).
|
|
7114
7125
|
* } = agent;
|
|
7115
7126
|
* ```
|
|
7116
7127
|
*
|
|
@@ -7221,6 +7232,17 @@ react_markdown = __toESM(react_markdown);
|
|
|
7221
7232
|
handleStateUpdate,
|
|
7222
7233
|
hasStateValues
|
|
7223
7234
|
]);
|
|
7235
|
+
const runAgent = (0, react.useCallback)(async (parameters) => {
|
|
7236
|
+
if (!agent) return void 0;
|
|
7237
|
+
return copilotkit.runAgent({
|
|
7238
|
+
agent,
|
|
7239
|
+
forwardedProps: parameters?.forwardedProps,
|
|
7240
|
+
runId: parameters?.runId
|
|
7241
|
+
});
|
|
7242
|
+
}, [agent, copilotkit]);
|
|
7243
|
+
const stopAgent = (0, react.useCallback)(() => {
|
|
7244
|
+
if (agent) copilotkit.stopAgent({ agent });
|
|
7245
|
+
}, [agent, copilotkit]);
|
|
7224
7246
|
return (0, react.useMemo)(() => {
|
|
7225
7247
|
if (!agent) {
|
|
7226
7248
|
const noop = () => {};
|
|
@@ -7245,15 +7267,14 @@ react_markdown = __toESM(react_markdown);
|
|
|
7245
7267
|
running: agent.isRunning,
|
|
7246
7268
|
state: agent.state,
|
|
7247
7269
|
setState: handleStateUpdate,
|
|
7248
|
-
start:
|
|
7249
|
-
stop:
|
|
7250
|
-
run:
|
|
7270
|
+
start: runAgent,
|
|
7271
|
+
stop: stopAgent,
|
|
7272
|
+
run: runAgent
|
|
7251
7273
|
};
|
|
7252
7274
|
}, [
|
|
7253
7275
|
agent?.state,
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
agent?.runAgent,
|
|
7276
|
+
runAgent,
|
|
7277
|
+
stopAgent,
|
|
7257
7278
|
agent?.threadId,
|
|
7258
7279
|
agent?.isRunning,
|
|
7259
7280
|
agent?.agentId,
|