@copilotkit/react-core 1.69.0 → 1.69.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-DOMr3DRO.cjs → copilotkit-Ba7qwYt3.cjs} +174 -45
- package/dist/copilotkit-Ba7qwYt3.cjs.map +1 -0
- package/dist/{copilotkit-ykQW_VJZ.mjs → copilotkit-BmW2sFH6.mjs} +175 -46
- package/dist/copilotkit-BmW2sFH6.mjs.map +1 -0
- package/dist/{copilotkit-DYM5ChMS.d.cts → copilotkit-CF1Pm2VG.d.cts} +23 -22
- package/dist/copilotkit-CF1Pm2VG.d.cts.map +1 -0
- package/dist/{copilotkit-pkDPhwkR.d.mts → copilotkit-TdM-5onZ.d.mts} +23 -22
- package/dist/copilotkit-TdM-5onZ.d.mts.map +1 -0
- package/dist/index.cjs +119 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +904 -28
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +904 -28
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +119 -75
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +139 -95
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +2 -2
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts +4 -4
- package/dist/v2/headless.d.mts +4 -4
- package/dist/v2/headless.mjs +2 -2
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.css +1 -1
- package/dist/v2/index.d.cts +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +171 -42
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/skills/react-core/SKILL.md +1 -1
- package/skills/react-core/references/provider-setup.md +1 -1
- package/skills/react-core/references/threads.md +2 -2
- package/dist/copilotkit-DOMr3DRO.cjs.map +0 -1
- package/dist/copilotkit-DYM5ChMS.d.cts.map +0 -1
- package/dist/copilotkit-pkDPhwkR.d.mts.map +0 -1
- package/dist/copilotkit-ykQW_VJZ.mjs.map +0 -1
package/dist/v2/index.umd.js
CHANGED
|
@@ -3614,7 +3614,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3614
3614
|
const hasLocalAgents = mergedAgents && Object.keys(mergedAgents).length > 0;
|
|
3615
3615
|
const hasSelfManagedAgents = Object.keys(selfManagedAgents).length > 0;
|
|
3616
3616
|
(0, react.useEffect)(() => {
|
|
3617
|
-
if (hasSelfManagedAgents && !resolvedPublicKey) console.warn("[CopilotKit] `selfManagedAgents` is part of CopilotKit's Enterprise Intelligence
|
|
3617
|
+
if (hasSelfManagedAgents && !resolvedPublicKey) console.warn("[CopilotKit] `selfManagedAgents` is part of CopilotKit's Enterprise Intelligence tier. Provide a `publicLicenseKey` for production use — contact the CopilotKit team about licensing.");
|
|
3618
3618
|
}, [hasSelfManagedAgents, resolvedPublicKey]);
|
|
3619
3619
|
const headers = typeof headersProp === "function" ? headersProp() : headersProp;
|
|
3620
3620
|
const mergedHeaders = (0, react.useMemo)(() => {
|
|
@@ -5211,10 +5211,10 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5211
5211
|
}, [store, selector]), () => selector(store.getState()), () => selector(store.getServerState()));
|
|
5212
5212
|
}
|
|
5213
5213
|
/**
|
|
5214
|
-
* React hook for listing and managing Intelligence
|
|
5214
|
+
* React hook for listing and managing CopilotKit Intelligence threads.
|
|
5215
5215
|
*
|
|
5216
5216
|
* On mount the hook fetches the thread list for the runtime-authenticated user
|
|
5217
|
-
* and the given `agentId`. When
|
|
5217
|
+
* and the given `agentId`. When CopilotKit Intelligence exposes a WebSocket
|
|
5218
5218
|
* URL, it also opens a realtime subscription so the `threads` array stays
|
|
5219
5219
|
* current without polling — thread creates, renames, archives, and deletes
|
|
5220
5220
|
* from any client are reflected immediately.
|
|
@@ -5510,7 +5510,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5510
5510
|
//#endregion
|
|
5511
5511
|
//#region src/v2/hooks/use-learn-from-user-action.tsx
|
|
5512
5512
|
/**
|
|
5513
|
-
* Record a user UI interaction in
|
|
5513
|
+
* Record a user UI interaction in CopilotKit Intelligence's user-actions
|
|
5514
5514
|
* stream. The platform's auto-curated knowledge base agent reads these
|
|
5515
5515
|
* (alongside finished agent runs) and writes free-form Obsidian-flavored
|
|
5516
5516
|
* markdown to `/project`, where any agent in the same project can later
|
|
@@ -5988,7 +5988,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5988
5988
|
});
|
|
5989
5989
|
const hasContent = !!(message.content && message.content.trim().length > 0);
|
|
5990
5990
|
const isLatestAssistantMessage = message.role === "assistant" && messages?.[messages.length - 1]?.id === message.id;
|
|
5991
|
-
const shouldShowToolbar = toolbarVisible && hasContent && !(isRunning && isLatestAssistantMessage);
|
|
5991
|
+
const shouldShowToolbar = toolbarVisible && (hasContent || isLocalInspectorEnabled) && !(isRunning && isLatestAssistantMessage);
|
|
5992
5992
|
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5993
5993
|
"data-copilotkit": true,
|
|
5994
5994
|
style: { display: "contents" },
|
|
@@ -6144,7 +6144,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
6144
6144
|
className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:-ml-[5px] cpk:-mt-[0px]", className),
|
|
6145
6145
|
...props
|
|
6146
6146
|
});
|
|
6147
|
-
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, children, ...props }) => {
|
|
6147
|
+
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, tooltipClassName, children, ...props }) => {
|
|
6148
6148
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipTrigger, {
|
|
6149
6149
|
asChild: true,
|
|
6150
6150
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
@@ -6156,6 +6156,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
6156
6156
|
})
|
|
6157
6157
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
|
|
6158
6158
|
side: "bottom",
|
|
6159
|
+
className: tooltipClassName,
|
|
6159
6160
|
children: tooltip ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: title })
|
|
6160
6161
|
})] });
|
|
6161
6162
|
};
|
|
@@ -6189,23 +6190,28 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
6189
6190
|
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk:size-[18px]" })
|
|
6190
6191
|
});
|
|
6191
6192
|
};
|
|
6192
|
-
_CopilotChatAssistantMessage.InspectorButton = ({ title, ...props }) => {
|
|
6193
|
+
_CopilotChatAssistantMessage.InspectorButton = ({ title, className, ...props }) => {
|
|
6193
6194
|
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
|
|
6194
6195
|
const primaryLabel = title || labels.assistantMessageToolbarInspectorLabel;
|
|
6195
|
-
const
|
|
6196
|
-
|
|
6197
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
6196
|
+
const accessibleLabel = `${primaryLabel} (local only)`;
|
|
6197
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarButton, {
|
|
6198
6198
|
"data-testid": "copilot-inspector-button",
|
|
6199
6199
|
title: accessibleLabel,
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
className: "cpk:text-[10px] cpk:opacity-65",
|
|
6204
|
-
children: localOnlyLabel
|
|
6205
|
-
})]
|
|
6206
|
-
}),
|
|
6200
|
+
className: (0, tailwind_merge.twMerge)("cpk:w-auto cpk:gap-1.5 cpk:px-2", className),
|
|
6201
|
+
tooltipClassName: "cpk:max-w-64 cpk:text-left cpk:leading-4",
|
|
6202
|
+
tooltip: "View this message in the Inspector to get more information. This button and the inspector only display during local development (localhost, dev env).",
|
|
6207
6203
|
...props,
|
|
6208
|
-
children:
|
|
6204
|
+
children: [
|
|
6205
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitColoredIcon, {}),
|
|
6206
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6207
|
+
className: "cpk:font-medium",
|
|
6208
|
+
children: primaryLabel
|
|
6209
|
+
}),
|
|
6210
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6211
|
+
className: "cpk:text-xs cpk:text-muted-foreground",
|
|
6212
|
+
children: "(local only)"
|
|
6213
|
+
})
|
|
6214
|
+
]
|
|
6209
6215
|
});
|
|
6210
6216
|
};
|
|
6211
6217
|
_CopilotChatAssistantMessage.ThumbsUpButton = ({ title, ...props }) => {
|
|
@@ -8366,14 +8372,109 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8366
8372
|
return await response.json();
|
|
8367
8373
|
}
|
|
8368
8374
|
|
|
8375
|
+
//#endregion
|
|
8376
|
+
//#region src/v2/providers/use-inspector-thread-override.ts
|
|
8377
|
+
function useInspectorThreadOverride(args) {
|
|
8378
|
+
const [override, setOverride] = (0, react.useState)(null);
|
|
8379
|
+
const latestRef = (0, react.useRef)({
|
|
8380
|
+
...args,
|
|
8381
|
+
override
|
|
8382
|
+
});
|
|
8383
|
+
latestRef.current = {
|
|
8384
|
+
...args,
|
|
8385
|
+
override
|
|
8386
|
+
};
|
|
8387
|
+
const restoreOverride = (0, react.useCallback)((current, nextThreadId) => {
|
|
8388
|
+
setOverride(null);
|
|
8389
|
+
(0, _copilotkit_core.emitInspectorActiveThread)({
|
|
8390
|
+
requestId: current.requestId,
|
|
8391
|
+
threadId: nextThreadId,
|
|
8392
|
+
agentId: current.agentId,
|
|
8393
|
+
source: "app"
|
|
8394
|
+
});
|
|
8395
|
+
}, []);
|
|
8396
|
+
const failInspectorOverride = (0, react.useCallback)((requestId) => {
|
|
8397
|
+
const current = latestRef.current.override;
|
|
8398
|
+
if (!current || current.requestId !== requestId) return;
|
|
8399
|
+
(0, _copilotkit_core.emitInspectorViewThreadResult)({
|
|
8400
|
+
requestId,
|
|
8401
|
+
threadId: current.threadId,
|
|
8402
|
+
agentId: current.agentId,
|
|
8403
|
+
ok: false,
|
|
8404
|
+
reason: "connect-failed"
|
|
8405
|
+
});
|
|
8406
|
+
restoreOverride(current, current.previousThreadId);
|
|
8407
|
+
}, [restoreOverride]);
|
|
8408
|
+
(0, react.useEffect)(() => {
|
|
8409
|
+
if (!(0, _copilotkit_core.isInspectorThreadBridgeEnabled)()) return;
|
|
8410
|
+
const offView = (0, _copilotkit_core.onInspectorViewThread)((payload) => {
|
|
8411
|
+
const current = latestRef.current;
|
|
8412
|
+
if (payload.agentId !== current.agentId) return false;
|
|
8413
|
+
setOverride(current.override ? {
|
|
8414
|
+
...current.override,
|
|
8415
|
+
...payload
|
|
8416
|
+
} : {
|
|
8417
|
+
...payload,
|
|
8418
|
+
previousThreadId: current.baseThreadId
|
|
8419
|
+
});
|
|
8420
|
+
(0, _copilotkit_core.emitInspectorViewThreadResult)({
|
|
8421
|
+
...payload,
|
|
8422
|
+
ok: true
|
|
8423
|
+
});
|
|
8424
|
+
(0, _copilotkit_core.emitInspectorActiveThread)({
|
|
8425
|
+
...payload,
|
|
8426
|
+
source: "override"
|
|
8427
|
+
});
|
|
8428
|
+
return true;
|
|
8429
|
+
});
|
|
8430
|
+
const offStop = (0, _copilotkit_core.onInspectorStopViewing)((payload) => {
|
|
8431
|
+
const current = latestRef.current.override;
|
|
8432
|
+
if (!current) return;
|
|
8433
|
+
if (payload.requestId !== current.requestId) return;
|
|
8434
|
+
if (payload.agentId !== current.agentId) return;
|
|
8435
|
+
restoreOverride(current, current.previousThreadId);
|
|
8436
|
+
});
|
|
8437
|
+
return () => {
|
|
8438
|
+
offView();
|
|
8439
|
+
offStop();
|
|
8440
|
+
};
|
|
8441
|
+
}, [restoreOverride]);
|
|
8442
|
+
(0, react.useEffect)(() => {
|
|
8443
|
+
if (!override) return;
|
|
8444
|
+
if (args.agentId !== override.agentId) {
|
|
8445
|
+
restoreOverride(override, override.previousThreadId);
|
|
8446
|
+
return;
|
|
8447
|
+
}
|
|
8448
|
+
if (args.baseThreadId === override.previousThreadId) return;
|
|
8449
|
+
if (args.baseThreadId === override.threadId) return;
|
|
8450
|
+
restoreOverride(override, args.baseThreadId);
|
|
8451
|
+
}, [
|
|
8452
|
+
args.agentId,
|
|
8453
|
+
args.baseThreadId,
|
|
8454
|
+
override,
|
|
8455
|
+
restoreOverride
|
|
8456
|
+
]);
|
|
8457
|
+
return {
|
|
8458
|
+
inspectorThreadId: override?.threadId ?? null,
|
|
8459
|
+
inspectorRequestId: override?.requestId ?? null,
|
|
8460
|
+
failInspectorOverride
|
|
8461
|
+
};
|
|
8462
|
+
}
|
|
8463
|
+
|
|
8369
8464
|
//#endregion
|
|
8370
8465
|
//#region src/v2/components/chat/CopilotChat.tsx
|
|
8371
8466
|
function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen, attachments: attachmentsConfig, onError, throttleMs, ...props }) {
|
|
8372
8467
|
const existingConfig = useCopilotChatConfiguration();
|
|
8373
8468
|
const resolvedAgentId = agentId ?? existingConfig?.agentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
|
|
8374
8469
|
const providedThreadId = threadId ?? existingConfig?.threadId;
|
|
8375
|
-
const
|
|
8376
|
-
const
|
|
8470
|
+
const baseThreadId = (0, react.useMemo)(() => providedThreadId ?? (0, _copilotkit_shared.randomUUID)(), [providedThreadId]);
|
|
8471
|
+
const baseHasExplicitThreadId = !!threadId || !!existingConfig?.hasExplicitThreadId;
|
|
8472
|
+
const { inspectorThreadId, inspectorRequestId, failInspectorOverride } = useInspectorThreadOverride({
|
|
8473
|
+
agentId: resolvedAgentId,
|
|
8474
|
+
baseThreadId
|
|
8475
|
+
});
|
|
8476
|
+
const resolvedThreadId = inspectorThreadId ?? baseThreadId;
|
|
8477
|
+
const hasExplicitThreadId = inspectorThreadId !== null || baseHasExplicitThreadId;
|
|
8377
8478
|
const { agent, isReady } = useAgent({
|
|
8378
8479
|
agentId: resolvedAgentId,
|
|
8379
8480
|
throttleMs
|
|
@@ -8402,6 +8503,24 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8402
8503
|
subscription.unsubscribe();
|
|
8403
8504
|
};
|
|
8404
8505
|
}, [copilotkit, resolvedAgentId]);
|
|
8506
|
+
(0, react.useEffect)(() => {
|
|
8507
|
+
if (!inspectorRequestId) return;
|
|
8508
|
+
const requestId = inspectorRequestId;
|
|
8509
|
+
const expectedThreadId = resolvedThreadId;
|
|
8510
|
+
const subscription = copilotkit.subscribe({ onError: (event) => {
|
|
8511
|
+
if (event.code !== _copilotkit_core.CopilotKitCoreErrorCode.AGENT_CONNECT_FAILED) return;
|
|
8512
|
+
if (event.context?.agentId !== resolvedAgentId) return;
|
|
8513
|
+
if (event.context?.threadId !== expectedThreadId) return;
|
|
8514
|
+
failInspectorOverride(requestId);
|
|
8515
|
+
} });
|
|
8516
|
+
return () => subscription.unsubscribe();
|
|
8517
|
+
}, [
|
|
8518
|
+
copilotkit,
|
|
8519
|
+
failInspectorOverride,
|
|
8520
|
+
inspectorRequestId,
|
|
8521
|
+
resolvedAgentId,
|
|
8522
|
+
resolvedThreadId
|
|
8523
|
+
]);
|
|
8405
8524
|
const [transcribeMode, setTranscribeMode] = (0, react.useState)("input");
|
|
8406
8525
|
const [inputValue, setInputValue] = (0, react.useState)("");
|
|
8407
8526
|
const [transcriptionError, setTranscriptionError] = (0, react.useState)(null);
|
|
@@ -8428,7 +8547,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8428
8547
|
const runtimeStatus = copilotkit.runtimeConnectionStatus === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connected ? "Connected" : copilotkit.runtimeConnectionStatus;
|
|
8429
8548
|
const hasNativeIntelligenceRunActivity = hasExplicitThreadId && runtimeStatus === "Connected" && !!copilotkit.intelligence?.wsUrl && copilotkit.threadEndpoints?.realtimeMetadata === true;
|
|
8430
8549
|
const [standaloneRunActivityStore] = (0, react.useState)(() => (0, _copilotkit_core.ɵcreateThreadStore)({ fetch: globalThis.fetch }));
|
|
8431
|
-
const
|
|
8550
|
+
const previousThreadRef = (0, react.useRef)(null);
|
|
8432
8551
|
const hasExplicitThreadIdRef = (0, react.useRef)(hasExplicitThreadId);
|
|
8433
8552
|
hasExplicitThreadIdRef.current = hasExplicitThreadId;
|
|
8434
8553
|
const rememberRecentlyLocalRunId = (0, react.useCallback)((runId) => {
|
|
@@ -8468,8 +8587,15 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8468
8587
|
};
|
|
8469
8588
|
}, []);
|
|
8470
8589
|
(0, react.useEffect)(() => {
|
|
8471
|
-
const
|
|
8472
|
-
|
|
8590
|
+
const previousThread = previousThreadRef.current;
|
|
8591
|
+
const threadChanged = previousThread?.threadId !== resolvedThreadId;
|
|
8592
|
+
const inspectorTransition = threadChanged && previousThread !== null && previousThread.inspectorRequestId !== inspectorRequestId && (previousThread.inspectorRequestId !== null || inspectorRequestId !== null);
|
|
8593
|
+
previousThreadRef.current = {
|
|
8594
|
+
threadId: resolvedThreadId,
|
|
8595
|
+
inspectorRequestId
|
|
8596
|
+
};
|
|
8597
|
+
if (inspectorTransition) if (typeof copilotkit.stopAgent === "function") copilotkit.stopAgent({ agent });
|
|
8598
|
+
else agent.abortRun?.();
|
|
8473
8599
|
agent.threadId = resolvedThreadId;
|
|
8474
8600
|
if (!hasExplicitThreadId) {
|
|
8475
8601
|
if (threadChanged && agent.messages.length > 0) agent.setMessages([]);
|
|
@@ -8485,6 +8611,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8485
8611
|
} catch (error) {
|
|
8486
8612
|
if (detached) return;
|
|
8487
8613
|
console.error("CopilotChat: connectAgent failed", error);
|
|
8614
|
+
if (inspectorRequestId) failInspectorOverride(inspectorRequestId);
|
|
8488
8615
|
} finally {
|
|
8489
8616
|
if (!detached) (typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 16))(() => {
|
|
8490
8617
|
if (!detached) setLastConnectedThreadId(resolvedThreadId);
|
|
@@ -8510,7 +8637,9 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8510
8637
|
resolvedThreadId,
|
|
8511
8638
|
agent,
|
|
8512
8639
|
resolvedAgentId,
|
|
8513
|
-
hasExplicitThreadId
|
|
8640
|
+
hasExplicitThreadId,
|
|
8641
|
+
inspectorRequestId,
|
|
8642
|
+
failInspectorOverride
|
|
8514
8643
|
]);
|
|
8515
8644
|
(0, react.useEffect)(() => {
|
|
8516
8645
|
if (!hasNativeIntelligenceRunActivity) return;
|
|
@@ -9867,7 +9996,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9867
9996
|
});
|
|
9868
9997
|
|
|
9869
9998
|
//#endregion
|
|
9870
|
-
//#region src/context/copilot-context.tsx
|
|
9999
|
+
//#region src/v1-deprecated/context/copilot-context.tsx
|
|
9871
10000
|
const emptyCopilotContext$1 = {
|
|
9872
10001
|
actions: {},
|
|
9873
10002
|
setAction: () => {},
|
|
@@ -9947,7 +10076,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9947
10076
|
}
|
|
9948
10077
|
|
|
9949
10078
|
//#endregion
|
|
9950
|
-
//#region src/hooks/use-tree.ts
|
|
10079
|
+
//#region src/v1-deprecated/hooks/use-tree.ts
|
|
9951
10080
|
const removeNode = (nodes, id) => {
|
|
9952
10081
|
return nodes.reduce((result, node) => {
|
|
9953
10082
|
if (node.id !== id) {
|
|
@@ -10060,7 +10189,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10060
10189
|
}
|
|
10061
10190
|
|
|
10062
10191
|
//#endregion
|
|
10063
|
-
//#region src/hooks/use-flat-category-store.ts
|
|
10192
|
+
//#region src/v1-deprecated/hooks/use-flat-category-store.ts
|
|
10064
10193
|
const useFlatCategoryStore = () => {
|
|
10065
10194
|
const [elements, dispatch] = (0, react.useReducer)(flatCategoryStoreReducer, /* @__PURE__ */ new Map());
|
|
10066
10195
|
return {
|
|
@@ -10118,7 +10247,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10118
10247
|
}
|
|
10119
10248
|
|
|
10120
10249
|
//#endregion
|
|
10121
|
-
//#region src/context/copilot-messages-context.tsx
|
|
10250
|
+
//#region src/v1-deprecated/context/copilot-messages-context.tsx
|
|
10122
10251
|
const emptyCopilotContext = {
|
|
10123
10252
|
messages: [],
|
|
10124
10253
|
setMessages: () => [],
|
|
@@ -10128,7 +10257,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10128
10257
|
const CopilotMessagesContext = react.default.createContext(emptyCopilotContext);
|
|
10129
10258
|
|
|
10130
10259
|
//#endregion
|
|
10131
|
-
//#region src/components/toast/toast-provider.tsx
|
|
10260
|
+
//#region src/v1-deprecated/components/toast/toast-provider.tsx
|
|
10132
10261
|
const ToastContext = (0, react.createContext)(void 0);
|
|
10133
10262
|
function getErrorSeverity(error) {
|
|
10134
10263
|
if (error.severity) switch (error.severity) {
|
|
@@ -10435,7 +10564,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10435
10564
|
}
|
|
10436
10565
|
|
|
10437
10566
|
//#endregion
|
|
10438
|
-
//#region src/utils/dev-console.ts
|
|
10567
|
+
//#region src/v1-deprecated/utils/dev-console.ts
|
|
10439
10568
|
function isLocalhost() {
|
|
10440
10569
|
if (typeof window === "undefined") return false;
|
|
10441
10570
|
return window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "0.0.0.0";
|
|
@@ -10446,7 +10575,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10446
10575
|
}
|
|
10447
10576
|
|
|
10448
10577
|
//#endregion
|
|
10449
|
-
//#region src/components/copilot-provider/copilot-messages.tsx
|
|
10578
|
+
//#region src/v1-deprecated/components/copilot-provider/copilot-messages.tsx
|
|
10450
10579
|
/**
|
|
10451
10580
|
* An internal context to separate the messages state (which is constantly changing) from the rest of CopilotKit context
|
|
10452
10581
|
*/
|
|
@@ -10596,7 +10725,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10596
10725
|
}
|
|
10597
10726
|
|
|
10598
10727
|
//#endregion
|
|
10599
|
-
//#region src/components/usage-banner.tsx
|
|
10728
|
+
//#region src/v1-deprecated/components/usage-banner.tsx
|
|
10600
10729
|
function UsageBanner({ severity = _copilotkit_shared.Severity.CRITICAL, message = "", onClose, actions }) {
|
|
10601
10730
|
if (!message || !severity) return null;
|
|
10602
10731
|
const theme = {
|
|
@@ -10793,7 +10922,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10793
10922
|
};
|
|
10794
10923
|
|
|
10795
10924
|
//#endregion
|
|
10796
|
-
//#region src/lib/status-checker.ts
|
|
10925
|
+
//#region src/v1-deprecated/lib/status-checker.ts
|
|
10797
10926
|
const STATUS_CHECK_INTERVAL = 1e3 * 60 * 5;
|
|
10798
10927
|
var StatusChecker = class {
|
|
10799
10928
|
constructor() {
|
|
@@ -10815,7 +10944,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10815
10944
|
this.lastResponse = response;
|
|
10816
10945
|
onUpdate?.(response);
|
|
10817
10946
|
return response;
|
|
10818
|
-
} catch
|
|
10947
|
+
} catch {
|
|
10819
10948
|
return null;
|
|
10820
10949
|
}
|
|
10821
10950
|
};
|
|
@@ -10841,7 +10970,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10841
10970
|
};
|
|
10842
10971
|
|
|
10843
10972
|
//#endregion
|
|
10844
|
-
//#region src/components/error-boundary/error-boundary.tsx
|
|
10973
|
+
//#region src/v1-deprecated/components/error-boundary/error-boundary.tsx
|
|
10845
10974
|
const statusChecker = new StatusChecker();
|
|
10846
10975
|
var CopilotErrorBoundary = class extends react.default.Component {
|
|
10847
10976
|
constructor(props) {
|
|
@@ -10882,7 +11011,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10882
11011
|
};
|
|
10883
11012
|
|
|
10884
11013
|
//#endregion
|
|
10885
|
-
//#region src/context/coagent-state-renders-context.tsx
|
|
11014
|
+
//#region src/v1-deprecated/context/coagent-state-renders-context.tsx
|
|
10886
11015
|
const CoAgentStateRendersContext = (0, react.createContext)(void 0);
|
|
10887
11016
|
function CoAgentStateRendersProvider({ children }) {
|
|
10888
11017
|
const [coAgentStateRenders, setCoAgentStateRenders] = (0, react.useState)({});
|
|
@@ -10917,7 +11046,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10917
11046
|
}
|
|
10918
11047
|
|
|
10919
11048
|
//#endregion
|
|
10920
|
-
//#region src/context/threads-context.tsx
|
|
11049
|
+
//#region src/v1-deprecated/context/threads-context.tsx
|
|
10921
11050
|
const ThreadsContext = (0, react.createContext)(void 0);
|
|
10922
11051
|
function ThreadsProvider({ children, threadId: explicitThreadId }) {
|
|
10923
11052
|
const [internalThreadId, setInternalThreadId] = (0, react.useState)(() => (0, _copilotkit_shared.randomUUID)());
|
|
@@ -10944,7 +11073,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10944
11073
|
}
|
|
10945
11074
|
|
|
10946
11075
|
//#endregion
|
|
10947
|
-
//#region src/hooks/use-coagent-state-render-bridge.helpers.ts
|
|
11076
|
+
//#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.helpers.ts
|
|
10948
11077
|
let RenderStatus = /* @__PURE__ */ function(RenderStatus) {
|
|
10949
11078
|
RenderStatus["InProgress"] = "inProgress";
|
|
10950
11079
|
RenderStatus["Complete"] = "complete";
|
|
@@ -11109,7 +11238,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
11109
11238
|
}
|
|
11110
11239
|
|
|
11111
11240
|
//#endregion
|
|
11112
|
-
//#region src/hooks/use-coagent-state-render-registry.ts
|
|
11241
|
+
//#region src/v1-deprecated/hooks/use-coagent-state-render-registry.ts
|
|
11113
11242
|
const LAST_SNAPSHOTS_BY_RENDER_AND_RUN = "__lastSnapshotsByStateRenderIdAndRun";
|
|
11114
11243
|
const LAST_SNAPSHOTS_BY_MESSAGE = "__lastSnapshotsByMessageId";
|
|
11115
11244
|
function getClaimsStore(claimsRef) {
|
|
@@ -11231,7 +11360,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
11231
11360
|
}
|
|
11232
11361
|
|
|
11233
11362
|
//#endregion
|
|
11234
|
-
//#region src/hooks/use-coagent-state-render-bridge.tsx
|
|
11363
|
+
//#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.tsx
|
|
11235
11364
|
function useCoagentStateRenderBridge(agentId, props) {
|
|
11236
11365
|
const { stateSnapshot, message } = props;
|
|
11237
11366
|
const { coAgentStateRenders, claimsRef } = useCoAgentStateRenders();
|
|
@@ -11315,7 +11444,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
11315
11444
|
}
|
|
11316
11445
|
|
|
11317
11446
|
//#endregion
|
|
11318
|
-
//#region src/components/CopilotListeners.tsx
|
|
11447
|
+
//#region src/v1-deprecated/components/CopilotListeners.tsx
|
|
11319
11448
|
const usePredictStateSubscription = (agent) => {
|
|
11320
11449
|
const predictStateToolsRef = (0, react.useRef)([]);
|
|
11321
11450
|
const getSubscriber = (0, react.useCallback)((agent) => ({
|
|
@@ -11385,7 +11514,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
11385
11514
|
}
|
|
11386
11515
|
|
|
11387
11516
|
//#endregion
|
|
11388
|
-
//#region src/components/copilot-provider/copilotkit.tsx
|
|
11517
|
+
//#region src/v1-deprecated/components/copilot-provider/copilotkit.tsx
|
|
11389
11518
|
function CopilotKit({ children, ...props }) {
|
|
11390
11519
|
const enabled = shouldShowDevConsole(props.showDevConsole);
|
|
11391
11520
|
const showInspector = shouldShowDevConsole(props.enableInspector);
|