@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import React, { createContext, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
3
|
-
import { CopilotKitCore, CopilotKitCoreRuntimeConnectionStatus, ProxiedCopilotRuntimeAgent, ToolCallStatus, isRunCompletionAware, ɵInterruptState, ɵcreateThreadStore, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading } from "@copilotkit/core";
|
|
3
|
+
import { CopilotKitCore, CopilotKitCoreErrorCode, CopilotKitCoreRuntimeConnectionStatus, ProxiedCopilotRuntimeAgent, ToolCallStatus, emitInspectorActiveThread, emitInspectorViewThreadResult, isInspectorThreadBridgeEnabled, isRunCompletionAware, onInspectorStopViewing, onInspectorViewThread, ɵInterruptState, ɵcreateThreadStore, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading } from "@copilotkit/core";
|
|
4
4
|
import { HttpAgent, randomUUID } from "@ag-ui/client";
|
|
5
5
|
import { extendTailwindMerge, twMerge } from "tailwind-merge";
|
|
6
6
|
import { ArrowUp, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronRightIcon, Copy, Edit, Loader2, MessageCircle, Mic, PanelLeftOpen, Play, Plus, RefreshCw, Square, ThumbsDown, ThumbsUp, Upload, Volume2, X } from "lucide-react";
|
|
@@ -3570,7 +3570,7 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3570
3570
|
const hasLocalAgents = mergedAgents && Object.keys(mergedAgents).length > 0;
|
|
3571
3571
|
const hasSelfManagedAgents = Object.keys(selfManagedAgents).length > 0;
|
|
3572
3572
|
useEffect(() => {
|
|
3573
|
-
if (hasSelfManagedAgents && !resolvedPublicKey) console.warn("[CopilotKit] `selfManagedAgents` is part of CopilotKit's Enterprise Intelligence
|
|
3573
|
+
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.");
|
|
3574
3574
|
}, [hasSelfManagedAgents, resolvedPublicKey]);
|
|
3575
3575
|
const headers = typeof headersProp === "function" ? headersProp() : headersProp;
|
|
3576
3576
|
const mergedHeaders = useMemo(() => {
|
|
@@ -5167,10 +5167,10 @@ function useThreadStoreSelector(store, selector) {
|
|
|
5167
5167
|
}, [store, selector]), () => selector(store.getState()), () => selector(store.getServerState()));
|
|
5168
5168
|
}
|
|
5169
5169
|
/**
|
|
5170
|
-
* React hook for listing and managing Intelligence
|
|
5170
|
+
* React hook for listing and managing CopilotKit Intelligence threads.
|
|
5171
5171
|
*
|
|
5172
5172
|
* On mount the hook fetches the thread list for the runtime-authenticated user
|
|
5173
|
-
* and the given `agentId`. When
|
|
5173
|
+
* and the given `agentId`. When CopilotKit Intelligence exposes a WebSocket
|
|
5174
5174
|
* URL, it also opens a realtime subscription so the `threads` array stays
|
|
5175
5175
|
* current without polling — thread creates, renames, archives, and deletes
|
|
5176
5176
|
* from any client are reflected immediately.
|
|
@@ -5466,7 +5466,7 @@ async function recordAnnotation(args) {
|
|
|
5466
5466
|
//#endregion
|
|
5467
5467
|
//#region src/v2/hooks/use-learn-from-user-action.tsx
|
|
5468
5468
|
/**
|
|
5469
|
-
* Record a user UI interaction in
|
|
5469
|
+
* Record a user UI interaction in CopilotKit Intelligence's user-actions
|
|
5470
5470
|
* stream. The platform's auto-curated knowledge base agent reads these
|
|
5471
5471
|
* (alongside finished agent runs) and writes free-form Obsidian-flavored
|
|
5472
5472
|
* markdown to `/project`, where any agent in the same project can later
|
|
@@ -5944,7 +5944,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
5944
5944
|
});
|
|
5945
5945
|
const hasContent = !!(message.content && message.content.trim().length > 0);
|
|
5946
5946
|
const isLatestAssistantMessage = message.role === "assistant" && messages?.[messages.length - 1]?.id === message.id;
|
|
5947
|
-
const shouldShowToolbar = toolbarVisible && hasContent && !(isRunning && isLatestAssistantMessage);
|
|
5947
|
+
const shouldShowToolbar = toolbarVisible && (hasContent || isLocalInspectorEnabled) && !(isRunning && isLatestAssistantMessage);
|
|
5948
5948
|
if (children) return /* @__PURE__ */ jsx("div", {
|
|
5949
5949
|
"data-copilotkit": true,
|
|
5950
5950
|
style: { display: "contents" },
|
|
@@ -6100,7 +6100,7 @@ function CopilotKitColoredIcon() {
|
|
|
6100
6100
|
className: twMerge("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:-ml-[5px] cpk:-mt-[0px]", className),
|
|
6101
6101
|
...props
|
|
6102
6102
|
});
|
|
6103
|
-
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, children, ...props }) => {
|
|
6103
|
+
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, tooltipClassName, children, ...props }) => {
|
|
6104
6104
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
6105
6105
|
asChild: true,
|
|
6106
6106
|
children: /* @__PURE__ */ jsx(Button, {
|
|
@@ -6112,6 +6112,7 @@ function CopilotKitColoredIcon() {
|
|
|
6112
6112
|
})
|
|
6113
6113
|
}), /* @__PURE__ */ jsx(TooltipContent, {
|
|
6114
6114
|
side: "bottom",
|
|
6115
|
+
className: tooltipClassName,
|
|
6115
6116
|
children: tooltip ?? /* @__PURE__ */ jsx("p", { children: title })
|
|
6116
6117
|
})] });
|
|
6117
6118
|
};
|
|
@@ -6145,23 +6146,28 @@ function CopilotKitColoredIcon() {
|
|
|
6145
6146
|
children: copied ? /* @__PURE__ */ jsx(Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ jsx(Copy, { className: "cpk:size-[18px]" })
|
|
6146
6147
|
});
|
|
6147
6148
|
};
|
|
6148
|
-
_CopilotChatAssistantMessage.InspectorButton = ({ title, ...props }) => {
|
|
6149
|
+
_CopilotChatAssistantMessage.InspectorButton = ({ title, className, ...props }) => {
|
|
6149
6150
|
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
|
|
6150
6151
|
const primaryLabel = title || labels.assistantMessageToolbarInspectorLabel;
|
|
6151
|
-
const
|
|
6152
|
-
|
|
6153
|
-
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
6152
|
+
const accessibleLabel = `${primaryLabel} (local only)`;
|
|
6153
|
+
return /* @__PURE__ */ jsxs(ToolbarButton, {
|
|
6154
6154
|
"data-testid": "copilot-inspector-button",
|
|
6155
6155
|
title: accessibleLabel,
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
className: "cpk:text-[10px] cpk:opacity-65",
|
|
6160
|
-
children: localOnlyLabel
|
|
6161
|
-
})]
|
|
6162
|
-
}),
|
|
6156
|
+
className: twMerge("cpk:w-auto cpk:gap-1.5 cpk:px-2", className),
|
|
6157
|
+
tooltipClassName: "cpk:max-w-64 cpk:text-left cpk:leading-4",
|
|
6158
|
+
tooltip: "View this message in the Inspector to get more information. This button and the inspector only display during local development (localhost, dev env).",
|
|
6163
6159
|
...props,
|
|
6164
|
-
children:
|
|
6160
|
+
children: [
|
|
6161
|
+
/* @__PURE__ */ jsx(CopilotKitColoredIcon, {}),
|
|
6162
|
+
/* @__PURE__ */ jsx("span", {
|
|
6163
|
+
className: "cpk:font-medium",
|
|
6164
|
+
children: primaryLabel
|
|
6165
|
+
}),
|
|
6166
|
+
/* @__PURE__ */ jsx("span", {
|
|
6167
|
+
className: "cpk:text-xs cpk:text-muted-foreground",
|
|
6168
|
+
children: "(local only)"
|
|
6169
|
+
})
|
|
6170
|
+
]
|
|
6165
6171
|
});
|
|
6166
6172
|
};
|
|
6167
6173
|
_CopilotChatAssistantMessage.ThumbsUpButton = ({ title, ...props }) => {
|
|
@@ -8322,14 +8328,109 @@ async function transcribeAudio(core, audioBlob, filename = "recording.webm") {
|
|
|
8322
8328
|
return await response.json();
|
|
8323
8329
|
}
|
|
8324
8330
|
|
|
8331
|
+
//#endregion
|
|
8332
|
+
//#region src/v2/providers/use-inspector-thread-override.ts
|
|
8333
|
+
function useInspectorThreadOverride(args) {
|
|
8334
|
+
const [override, setOverride] = useState(null);
|
|
8335
|
+
const latestRef = useRef({
|
|
8336
|
+
...args,
|
|
8337
|
+
override
|
|
8338
|
+
});
|
|
8339
|
+
latestRef.current = {
|
|
8340
|
+
...args,
|
|
8341
|
+
override
|
|
8342
|
+
};
|
|
8343
|
+
const restoreOverride = useCallback((current, nextThreadId) => {
|
|
8344
|
+
setOverride(null);
|
|
8345
|
+
emitInspectorActiveThread({
|
|
8346
|
+
requestId: current.requestId,
|
|
8347
|
+
threadId: nextThreadId,
|
|
8348
|
+
agentId: current.agentId,
|
|
8349
|
+
source: "app"
|
|
8350
|
+
});
|
|
8351
|
+
}, []);
|
|
8352
|
+
const failInspectorOverride = useCallback((requestId) => {
|
|
8353
|
+
const current = latestRef.current.override;
|
|
8354
|
+
if (!current || current.requestId !== requestId) return;
|
|
8355
|
+
emitInspectorViewThreadResult({
|
|
8356
|
+
requestId,
|
|
8357
|
+
threadId: current.threadId,
|
|
8358
|
+
agentId: current.agentId,
|
|
8359
|
+
ok: false,
|
|
8360
|
+
reason: "connect-failed"
|
|
8361
|
+
});
|
|
8362
|
+
restoreOverride(current, current.previousThreadId);
|
|
8363
|
+
}, [restoreOverride]);
|
|
8364
|
+
useEffect(() => {
|
|
8365
|
+
if (!isInspectorThreadBridgeEnabled()) return;
|
|
8366
|
+
const offView = onInspectorViewThread((payload) => {
|
|
8367
|
+
const current = latestRef.current;
|
|
8368
|
+
if (payload.agentId !== current.agentId) return false;
|
|
8369
|
+
setOverride(current.override ? {
|
|
8370
|
+
...current.override,
|
|
8371
|
+
...payload
|
|
8372
|
+
} : {
|
|
8373
|
+
...payload,
|
|
8374
|
+
previousThreadId: current.baseThreadId
|
|
8375
|
+
});
|
|
8376
|
+
emitInspectorViewThreadResult({
|
|
8377
|
+
...payload,
|
|
8378
|
+
ok: true
|
|
8379
|
+
});
|
|
8380
|
+
emitInspectorActiveThread({
|
|
8381
|
+
...payload,
|
|
8382
|
+
source: "override"
|
|
8383
|
+
});
|
|
8384
|
+
return true;
|
|
8385
|
+
});
|
|
8386
|
+
const offStop = onInspectorStopViewing((payload) => {
|
|
8387
|
+
const current = latestRef.current.override;
|
|
8388
|
+
if (!current) return;
|
|
8389
|
+
if (payload.requestId !== current.requestId) return;
|
|
8390
|
+
if (payload.agentId !== current.agentId) return;
|
|
8391
|
+
restoreOverride(current, current.previousThreadId);
|
|
8392
|
+
});
|
|
8393
|
+
return () => {
|
|
8394
|
+
offView();
|
|
8395
|
+
offStop();
|
|
8396
|
+
};
|
|
8397
|
+
}, [restoreOverride]);
|
|
8398
|
+
useEffect(() => {
|
|
8399
|
+
if (!override) return;
|
|
8400
|
+
if (args.agentId !== override.agentId) {
|
|
8401
|
+
restoreOverride(override, override.previousThreadId);
|
|
8402
|
+
return;
|
|
8403
|
+
}
|
|
8404
|
+
if (args.baseThreadId === override.previousThreadId) return;
|
|
8405
|
+
if (args.baseThreadId === override.threadId) return;
|
|
8406
|
+
restoreOverride(override, args.baseThreadId);
|
|
8407
|
+
}, [
|
|
8408
|
+
args.agentId,
|
|
8409
|
+
args.baseThreadId,
|
|
8410
|
+
override,
|
|
8411
|
+
restoreOverride
|
|
8412
|
+
]);
|
|
8413
|
+
return {
|
|
8414
|
+
inspectorThreadId: override?.threadId ?? null,
|
|
8415
|
+
inspectorRequestId: override?.requestId ?? null,
|
|
8416
|
+
failInspectorOverride
|
|
8417
|
+
};
|
|
8418
|
+
}
|
|
8419
|
+
|
|
8325
8420
|
//#endregion
|
|
8326
8421
|
//#region src/v2/components/chat/CopilotChat.tsx
|
|
8327
8422
|
function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen, attachments: attachmentsConfig, onError, throttleMs, ...props }) {
|
|
8328
8423
|
const existingConfig = useCopilotChatConfiguration();
|
|
8329
8424
|
const resolvedAgentId = agentId ?? existingConfig?.agentId ?? DEFAULT_AGENT_ID;
|
|
8330
8425
|
const providedThreadId = threadId ?? existingConfig?.threadId;
|
|
8331
|
-
const
|
|
8332
|
-
const
|
|
8426
|
+
const baseThreadId = useMemo(() => providedThreadId ?? randomUUID$1(), [providedThreadId]);
|
|
8427
|
+
const baseHasExplicitThreadId = !!threadId || !!existingConfig?.hasExplicitThreadId;
|
|
8428
|
+
const { inspectorThreadId, inspectorRequestId, failInspectorOverride } = useInspectorThreadOverride({
|
|
8429
|
+
agentId: resolvedAgentId,
|
|
8430
|
+
baseThreadId
|
|
8431
|
+
});
|
|
8432
|
+
const resolvedThreadId = inspectorThreadId ?? baseThreadId;
|
|
8433
|
+
const hasExplicitThreadId = inspectorThreadId !== null || baseHasExplicitThreadId;
|
|
8333
8434
|
const { agent, isReady } = useAgent({
|
|
8334
8435
|
agentId: resolvedAgentId,
|
|
8335
8436
|
throttleMs
|
|
@@ -8358,6 +8459,24 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8358
8459
|
subscription.unsubscribe();
|
|
8359
8460
|
};
|
|
8360
8461
|
}, [copilotkit, resolvedAgentId]);
|
|
8462
|
+
useEffect(() => {
|
|
8463
|
+
if (!inspectorRequestId) return;
|
|
8464
|
+
const requestId = inspectorRequestId;
|
|
8465
|
+
const expectedThreadId = resolvedThreadId;
|
|
8466
|
+
const subscription = copilotkit.subscribe({ onError: (event) => {
|
|
8467
|
+
if (event.code !== CopilotKitCoreErrorCode.AGENT_CONNECT_FAILED) return;
|
|
8468
|
+
if (event.context?.agentId !== resolvedAgentId) return;
|
|
8469
|
+
if (event.context?.threadId !== expectedThreadId) return;
|
|
8470
|
+
failInspectorOverride(requestId);
|
|
8471
|
+
} });
|
|
8472
|
+
return () => subscription.unsubscribe();
|
|
8473
|
+
}, [
|
|
8474
|
+
copilotkit,
|
|
8475
|
+
failInspectorOverride,
|
|
8476
|
+
inspectorRequestId,
|
|
8477
|
+
resolvedAgentId,
|
|
8478
|
+
resolvedThreadId
|
|
8479
|
+
]);
|
|
8361
8480
|
const [transcribeMode, setTranscribeMode] = useState("input");
|
|
8362
8481
|
const [inputValue, setInputValue] = useState("");
|
|
8363
8482
|
const [transcriptionError, setTranscriptionError] = useState(null);
|
|
@@ -8384,7 +8503,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8384
8503
|
const runtimeStatus = copilotkit.runtimeConnectionStatus === CopilotKitCoreRuntimeConnectionStatus.Connected ? "Connected" : copilotkit.runtimeConnectionStatus;
|
|
8385
8504
|
const hasNativeIntelligenceRunActivity = hasExplicitThreadId && runtimeStatus === "Connected" && !!copilotkit.intelligence?.wsUrl && copilotkit.threadEndpoints?.realtimeMetadata === true;
|
|
8386
8505
|
const [standaloneRunActivityStore] = useState(() => ɵcreateThreadStore({ fetch: globalThis.fetch }));
|
|
8387
|
-
const
|
|
8506
|
+
const previousThreadRef = useRef(null);
|
|
8388
8507
|
const hasExplicitThreadIdRef = useRef(hasExplicitThreadId);
|
|
8389
8508
|
hasExplicitThreadIdRef.current = hasExplicitThreadId;
|
|
8390
8509
|
const rememberRecentlyLocalRunId = useCallback((runId) => {
|
|
@@ -8424,8 +8543,15 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8424
8543
|
};
|
|
8425
8544
|
}, []);
|
|
8426
8545
|
useEffect(() => {
|
|
8427
|
-
const
|
|
8428
|
-
|
|
8546
|
+
const previousThread = previousThreadRef.current;
|
|
8547
|
+
const threadChanged = previousThread?.threadId !== resolvedThreadId;
|
|
8548
|
+
const inspectorTransition = threadChanged && previousThread !== null && previousThread.inspectorRequestId !== inspectorRequestId && (previousThread.inspectorRequestId !== null || inspectorRequestId !== null);
|
|
8549
|
+
previousThreadRef.current = {
|
|
8550
|
+
threadId: resolvedThreadId,
|
|
8551
|
+
inspectorRequestId
|
|
8552
|
+
};
|
|
8553
|
+
if (inspectorTransition) if (typeof copilotkit.stopAgent === "function") copilotkit.stopAgent({ agent });
|
|
8554
|
+
else agent.abortRun?.();
|
|
8429
8555
|
agent.threadId = resolvedThreadId;
|
|
8430
8556
|
if (!hasExplicitThreadId) {
|
|
8431
8557
|
if (threadChanged && agent.messages.length > 0) agent.setMessages([]);
|
|
@@ -8441,6 +8567,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8441
8567
|
} catch (error) {
|
|
8442
8568
|
if (detached) return;
|
|
8443
8569
|
console.error("CopilotChat: connectAgent failed", error);
|
|
8570
|
+
if (inspectorRequestId) failInspectorOverride(inspectorRequestId);
|
|
8444
8571
|
} finally {
|
|
8445
8572
|
if (!detached) (typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 16))(() => {
|
|
8446
8573
|
if (!detached) setLastConnectedThreadId(resolvedThreadId);
|
|
@@ -8466,7 +8593,9 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8466
8593
|
resolvedThreadId,
|
|
8467
8594
|
agent,
|
|
8468
8595
|
resolvedAgentId,
|
|
8469
|
-
hasExplicitThreadId
|
|
8596
|
+
hasExplicitThreadId,
|
|
8597
|
+
inspectorRequestId,
|
|
8598
|
+
failInspectorOverride
|
|
8470
8599
|
]);
|
|
8471
8600
|
useEffect(() => {
|
|
8472
8601
|
if (!hasNativeIntelligenceRunActivity) return;
|
|
@@ -9823,7 +9952,7 @@ const WildcardToolCallRender = defineToolCallRenderer({
|
|
|
9823
9952
|
});
|
|
9824
9953
|
|
|
9825
9954
|
//#endregion
|
|
9826
|
-
//#region src/context/copilot-context.tsx
|
|
9955
|
+
//#region src/v1-deprecated/context/copilot-context.tsx
|
|
9827
9956
|
const emptyCopilotContext$1 = {
|
|
9828
9957
|
actions: {},
|
|
9829
9958
|
setAction: () => {},
|
|
@@ -9903,7 +10032,7 @@ function returnAndThrowInDebug(_value) {
|
|
|
9903
10032
|
}
|
|
9904
10033
|
|
|
9905
10034
|
//#endregion
|
|
9906
|
-
//#region src/hooks/use-tree.ts
|
|
10035
|
+
//#region src/v1-deprecated/hooks/use-tree.ts
|
|
9907
10036
|
const removeNode = (nodes, id) => {
|
|
9908
10037
|
return nodes.reduce((result, node) => {
|
|
9909
10038
|
if (node.id !== id) {
|
|
@@ -10016,7 +10145,7 @@ function setsHaveIntersection$1(setA, setB) {
|
|
|
10016
10145
|
}
|
|
10017
10146
|
|
|
10018
10147
|
//#endregion
|
|
10019
|
-
//#region src/hooks/use-flat-category-store.ts
|
|
10148
|
+
//#region src/v1-deprecated/hooks/use-flat-category-store.ts
|
|
10020
10149
|
const useFlatCategoryStore = () => {
|
|
10021
10150
|
const [elements, dispatch] = useReducer(flatCategoryStoreReducer, /* @__PURE__ */ new Map());
|
|
10022
10151
|
return {
|
|
@@ -10074,7 +10203,7 @@ function setsHaveIntersection(setA, setB) {
|
|
|
10074
10203
|
}
|
|
10075
10204
|
|
|
10076
10205
|
//#endregion
|
|
10077
|
-
//#region src/context/copilot-messages-context.tsx
|
|
10206
|
+
//#region src/v1-deprecated/context/copilot-messages-context.tsx
|
|
10078
10207
|
const emptyCopilotContext = {
|
|
10079
10208
|
messages: [],
|
|
10080
10209
|
setMessages: () => [],
|
|
@@ -10089,7 +10218,7 @@ function useCopilotMessagesContext() {
|
|
|
10089
10218
|
}
|
|
10090
10219
|
|
|
10091
10220
|
//#endregion
|
|
10092
|
-
//#region src/components/toast/toast-provider.tsx
|
|
10221
|
+
//#region src/v1-deprecated/components/toast/toast-provider.tsx
|
|
10093
10222
|
const ToastContext = createContext(void 0);
|
|
10094
10223
|
function getErrorSeverity(error) {
|
|
10095
10224
|
if (error.severity) switch (error.severity) {
|
|
@@ -10396,7 +10525,7 @@ function ToastProvider({ enabled, children }) {
|
|
|
10396
10525
|
}
|
|
10397
10526
|
|
|
10398
10527
|
//#endregion
|
|
10399
|
-
//#region src/utils/dev-console.ts
|
|
10528
|
+
//#region src/v1-deprecated/utils/dev-console.ts
|
|
10400
10529
|
function isLocalhost() {
|
|
10401
10530
|
if (typeof window === "undefined") return false;
|
|
10402
10531
|
return window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "0.0.0.0";
|
|
@@ -10407,7 +10536,7 @@ function shouldShowDevConsole(showDevConsole) {
|
|
|
10407
10536
|
}
|
|
10408
10537
|
|
|
10409
10538
|
//#endregion
|
|
10410
|
-
//#region src/components/copilot-provider/copilot-messages.tsx
|
|
10539
|
+
//#region src/v1-deprecated/components/copilot-provider/copilot-messages.tsx
|
|
10411
10540
|
/**
|
|
10412
10541
|
* An internal context to separate the messages state (which is constantly changing) from the rest of CopilotKit context
|
|
10413
10542
|
*/
|
|
@@ -10557,7 +10686,7 @@ function CopilotMessages({ children }) {
|
|
|
10557
10686
|
}
|
|
10558
10687
|
|
|
10559
10688
|
//#endregion
|
|
10560
|
-
//#region src/components/usage-banner.tsx
|
|
10689
|
+
//#region src/v1-deprecated/components/usage-banner.tsx
|
|
10561
10690
|
function UsageBanner({ severity = Severity.CRITICAL, message = "", onClose, actions }) {
|
|
10562
10691
|
if (!message || !severity) return null;
|
|
10563
10692
|
const theme = {
|
|
@@ -10754,7 +10883,7 @@ const getErrorActions = (error) => {
|
|
|
10754
10883
|
};
|
|
10755
10884
|
|
|
10756
10885
|
//#endregion
|
|
10757
|
-
//#region src/lib/status-checker.ts
|
|
10886
|
+
//#region src/v1-deprecated/lib/status-checker.ts
|
|
10758
10887
|
const STATUS_CHECK_INTERVAL = 1e3 * 60 * 5;
|
|
10759
10888
|
var StatusChecker = class {
|
|
10760
10889
|
constructor() {
|
|
@@ -10776,7 +10905,7 @@ var StatusChecker = class {
|
|
|
10776
10905
|
this.lastResponse = response;
|
|
10777
10906
|
onUpdate?.(response);
|
|
10778
10907
|
return response;
|
|
10779
|
-
} catch
|
|
10908
|
+
} catch {
|
|
10780
10909
|
return null;
|
|
10781
10910
|
}
|
|
10782
10911
|
};
|
|
@@ -10802,7 +10931,7 @@ var StatusChecker = class {
|
|
|
10802
10931
|
};
|
|
10803
10932
|
|
|
10804
10933
|
//#endregion
|
|
10805
|
-
//#region src/components/toast/exclamation-mark-icon.tsx
|
|
10934
|
+
//#region src/v1-deprecated/components/toast/exclamation-mark-icon.tsx
|
|
10806
10935
|
const ExclamationMarkIcon = ({ className, style }) => /* @__PURE__ */ jsxs("svg", {
|
|
10807
10936
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10808
10937
|
width: "24",
|
|
@@ -10837,7 +10966,7 @@ const ExclamationMarkIcon = ({ className, style }) => /* @__PURE__ */ jsxs("svg"
|
|
|
10837
10966
|
});
|
|
10838
10967
|
|
|
10839
10968
|
//#endregion
|
|
10840
|
-
//#region src/components/error-boundary/error-utils.tsx
|
|
10969
|
+
//#region src/v1-deprecated/components/error-boundary/error-utils.tsx
|
|
10841
10970
|
function ErrorToast({ errors }) {
|
|
10842
10971
|
return /* @__PURE__ */ jsxs("div", {
|
|
10843
10972
|
style: {
|
|
@@ -10911,7 +11040,7 @@ function useAsyncCallback(callback, deps) {
|
|
|
10911
11040
|
}
|
|
10912
11041
|
|
|
10913
11042
|
//#endregion
|
|
10914
|
-
//#region src/components/error-boundary/error-boundary.tsx
|
|
11043
|
+
//#region src/v1-deprecated/components/error-boundary/error-boundary.tsx
|
|
10915
11044
|
const statusChecker = new StatusChecker();
|
|
10916
11045
|
var CopilotErrorBoundary = class extends React.Component {
|
|
10917
11046
|
constructor(props) {
|
|
@@ -10952,7 +11081,7 @@ var CopilotErrorBoundary = class extends React.Component {
|
|
|
10952
11081
|
};
|
|
10953
11082
|
|
|
10954
11083
|
//#endregion
|
|
10955
|
-
//#region src/context/coagent-state-renders-context.tsx
|
|
11084
|
+
//#region src/v1-deprecated/context/coagent-state-renders-context.tsx
|
|
10956
11085
|
const CoAgentStateRendersContext = createContext(void 0);
|
|
10957
11086
|
function CoAgentStateRendersProvider({ children }) {
|
|
10958
11087
|
const [coAgentStateRenders, setCoAgentStateRenders] = useState({});
|
|
@@ -10987,7 +11116,7 @@ function useCoAgentStateRenders() {
|
|
|
10987
11116
|
}
|
|
10988
11117
|
|
|
10989
11118
|
//#endregion
|
|
10990
|
-
//#region src/context/threads-context.tsx
|
|
11119
|
+
//#region src/v1-deprecated/context/threads-context.tsx
|
|
10991
11120
|
const ThreadsContext = createContext(void 0);
|
|
10992
11121
|
function ThreadsProvider({ children, threadId: explicitThreadId }) {
|
|
10993
11122
|
const [internalThreadId, setInternalThreadId] = useState(() => randomUUID$1());
|
|
@@ -11014,7 +11143,7 @@ function useThreads() {
|
|
|
11014
11143
|
}
|
|
11015
11144
|
|
|
11016
11145
|
//#endregion
|
|
11017
|
-
//#region src/hooks/use-coagent-state-render-bridge.helpers.ts
|
|
11146
|
+
//#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.helpers.ts
|
|
11018
11147
|
let RenderStatus = /* @__PURE__ */ function(RenderStatus) {
|
|
11019
11148
|
RenderStatus["InProgress"] = "inProgress";
|
|
11020
11149
|
RenderStatus["Complete"] = "complete";
|
|
@@ -11179,7 +11308,7 @@ function selectSnapshot({ messageId, messageName, allowLiveState, skipLatestCach
|
|
|
11179
11308
|
}
|
|
11180
11309
|
|
|
11181
11310
|
//#endregion
|
|
11182
|
-
//#region src/hooks/use-coagent-state-render-registry.ts
|
|
11311
|
+
//#region src/v1-deprecated/hooks/use-coagent-state-render-registry.ts
|
|
11183
11312
|
const LAST_SNAPSHOTS_BY_RENDER_AND_RUN = "__lastSnapshotsByStateRenderIdAndRun";
|
|
11184
11313
|
const LAST_SNAPSHOTS_BY_MESSAGE = "__lastSnapshotsByMessageId";
|
|
11185
11314
|
function getClaimsStore(claimsRef) {
|
|
@@ -11301,7 +11430,7 @@ function useStateRenderRegistry({ agentId, stateRenderId, message, messageIndex,
|
|
|
11301
11430
|
}
|
|
11302
11431
|
|
|
11303
11432
|
//#endregion
|
|
11304
|
-
//#region src/hooks/use-coagent-state-render-bridge.tsx
|
|
11433
|
+
//#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.tsx
|
|
11305
11434
|
function useCoagentStateRenderBridge(agentId, props) {
|
|
11306
11435
|
const { stateSnapshot, message } = props;
|
|
11307
11436
|
const { coAgentStateRenders, claimsRef } = useCoAgentStateRenders();
|
|
@@ -11385,7 +11514,7 @@ function CoAgentStateRenderBridge(props) {
|
|
|
11385
11514
|
}
|
|
11386
11515
|
|
|
11387
11516
|
//#endregion
|
|
11388
|
-
//#region src/components/CopilotListeners.tsx
|
|
11517
|
+
//#region src/v1-deprecated/components/CopilotListeners.tsx
|
|
11389
11518
|
const usePredictStateSubscription = (agent) => {
|
|
11390
11519
|
const predictStateToolsRef = useRef([]);
|
|
11391
11520
|
const getSubscriber = useCallback((agent) => ({
|
|
@@ -11455,7 +11584,7 @@ function CopilotListeners() {
|
|
|
11455
11584
|
}
|
|
11456
11585
|
|
|
11457
11586
|
//#endregion
|
|
11458
|
-
//#region src/components/copilot-provider/copilotkit.tsx
|
|
11587
|
+
//#region src/v1-deprecated/components/copilot-provider/copilotkit.tsx
|
|
11459
11588
|
function CopilotKit({ children, ...props }) {
|
|
11460
11589
|
const enabled = shouldShowDevConsole(props.showDevConsole);
|
|
11461
11590
|
const showInspector = shouldShowDevConsole(props.enableInspector);
|
|
@@ -11954,4 +12083,4 @@ function validateProps(props) {
|
|
|
11954
12083
|
|
|
11955
12084
|
//#endregion
|
|
11956
12085
|
export { useCapabilities as $, CopilotChatMessageView as A, CopilotChatAudioRecorder as At, CopilotChatAssistantMessage_default as B, CopilotModalHeader as C, MCPAppsActivityRenderer as Ct, CopilotChat as D, useRenderToolCall as Dt, DefaultOpenIcon as E, CopilotKitInspector as Et, CopilotChatSuggestionView as F, useLearnFromUserActionInCurrentThread as G, useLearningContainersInCurrentThread as H, CopilotChatSuggestionPill as I, useThreads$1 as J, useLearnFromUserAction as K, CopilotChatReasoningMessage_default as L, IntelligenceIndicator as M, useCopilotChatConfiguration as Mt, getIntelligenceTurnAnchors as N, CopilotChatView_default as O, CopilotChatInput_default as Ot, IntelligenceIndicatorView as P, useAgentContext as Q, CopilotChatUserMessage_default as R, CopilotSidebarView as S, MCPAppsActivityContentSchema as St, DefaultCloseIcon as T, ɵrunMcpFollowUp as Tt, useLearningContainers as U, CopilotChatToolCallsView as V, useAttachments as W, useConfigureSuggestions as X, useInterrupt as Y, useSuggestions as Z, WildcardToolCallRender as _, OpenGenerativeUIActivityType as _t, ThreadsProvider as a, useComponent as at, CopilotSidebar as b, SandboxFunctionsContext as bt, CoAgentStateRendersProvider as c, useRenderCustomMessages as ct, shouldShowDevConsole as d, useLicenseContext$1 as dt, UseAgentUpdate as et, useToast as f, CopilotKitCoreReact as ft, useCopilotContext as g, OpenGenerativeUIActivityRenderer as gt, CopilotContext as h, GenerateSandboxedUiArgsSchema as ht, ThreadsContext as i, useRenderTool as it, INTELLIGENCE_TURN_HEAD as j, CopilotChatConfigurationProvider as jt, CopilotChatAttachmentQueue as k, AudioRecorderError as kt, useCoAgentStateRenders as l, CopilotKitProvider as lt, useCopilotMessagesContext as m, createA2UIMessageRenderer as mt, defaultCopilotContextCategories as n, useHumanInTheLoop as nt, useThreads as o, useFrontendTool as ot, CopilotMessagesContext as p, defineToolCallRenderer as pt, useMemories as q, CoAgentStateRenderBridge as r, useDefaultRenderTool as rt, CoAgentStateRendersContext as s, useRenderActivityMessage as st, CopilotKit as t, useAgent as tt, useAsyncCallback as u, useCopilotKit$1 as ut, CopilotThreadsDrawer as v, OpenGenerativeUIContentSchema as vt, CopilotChatToggleButton as w, MCPAppsActivityType as wt, CopilotPopupView as x, useSandboxFunctions as xt, CopilotPopup as y, OpenGenerativeUIToolRenderer as yt, CopilotChatAttachmentRenderer as z };
|
|
11957
|
-
//# sourceMappingURL=copilotkit-
|
|
12086
|
+
//# sourceMappingURL=copilotkit-BmW2sFH6.mjs.map
|