@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.
Files changed (39) hide show
  1. package/dist/{copilotkit-DOMr3DRO.cjs → copilotkit-Ba7qwYt3.cjs} +174 -45
  2. package/dist/copilotkit-Ba7qwYt3.cjs.map +1 -0
  3. package/dist/{copilotkit-ykQW_VJZ.mjs → copilotkit-BmW2sFH6.mjs} +175 -46
  4. package/dist/copilotkit-BmW2sFH6.mjs.map +1 -0
  5. package/dist/{copilotkit-DYM5ChMS.d.cts → copilotkit-CF1Pm2VG.d.cts} +23 -22
  6. package/dist/copilotkit-CF1Pm2VG.d.cts.map +1 -0
  7. package/dist/{copilotkit-pkDPhwkR.d.mts → copilotkit-TdM-5onZ.d.mts} +23 -22
  8. package/dist/copilotkit-TdM-5onZ.d.mts.map +1 -0
  9. package/dist/index.cjs +119 -75
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +904 -28
  12. package/dist/index.d.cts.map +1 -1
  13. package/dist/index.d.mts +904 -28
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +119 -75
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/index.umd.js +139 -95
  18. package/dist/index.umd.js.map +1 -1
  19. package/dist/v2/headless.cjs +2 -2
  20. package/dist/v2/headless.cjs.map +1 -1
  21. package/dist/v2/headless.d.cts +4 -4
  22. package/dist/v2/headless.d.mts +4 -4
  23. package/dist/v2/headless.mjs +2 -2
  24. package/dist/v2/headless.mjs.map +1 -1
  25. package/dist/v2/index.cjs +1 -1
  26. package/dist/v2/index.css +1 -1
  27. package/dist/v2/index.d.cts +1 -1
  28. package/dist/v2/index.d.mts +1 -1
  29. package/dist/v2/index.mjs +1 -1
  30. package/dist/v2/index.umd.js +171 -42
  31. package/dist/v2/index.umd.js.map +1 -1
  32. package/package.json +8 -8
  33. package/skills/react-core/SKILL.md +1 -1
  34. package/skills/react-core/references/provider-setup.md +1 -1
  35. package/skills/react-core/references/threads.md +2 -2
  36. package/dist/copilotkit-DOMr3DRO.cjs.map +0 -1
  37. package/dist/copilotkit-DYM5ChMS.d.cts.map +0 -1
  38. package/dist/copilotkit-pkDPhwkR.d.mts.map +0 -1
  39. package/dist/copilotkit-ykQW_VJZ.mjs.map +0 -1
@@ -3600,7 +3600,7 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3600
3600
  const hasLocalAgents = mergedAgents && Object.keys(mergedAgents).length > 0;
3601
3601
  const hasSelfManagedAgents = Object.keys(selfManagedAgents).length > 0;
3602
3602
  (0, react.useEffect)(() => {
3603
- if (hasSelfManagedAgents && !resolvedPublicKey) console.warn("[CopilotKit] `selfManagedAgents` is part of CopilotKit's Enterprise Intelligence offering. Provide a `publicLicenseKey` for production use — contact the CopilotKit team about licensing.");
3603
+ 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.");
3604
3604
  }, [hasSelfManagedAgents, resolvedPublicKey]);
3605
3605
  const headers = typeof headersProp === "function" ? headersProp() : headersProp;
3606
3606
  const mergedHeaders = (0, react.useMemo)(() => {
@@ -5197,10 +5197,10 @@ function useThreadStoreSelector(store, selector) {
5197
5197
  }, [store, selector]), () => selector(store.getState()), () => selector(store.getServerState()));
5198
5198
  }
5199
5199
  /**
5200
- * React hook for listing and managing Intelligence platform threads.
5200
+ * React hook for listing and managing CopilotKit Intelligence threads.
5201
5201
  *
5202
5202
  * On mount the hook fetches the thread list for the runtime-authenticated user
5203
- * and the given `agentId`. When the Intelligence platform exposes a WebSocket
5203
+ * and the given `agentId`. When CopilotKit Intelligence exposes a WebSocket
5204
5204
  * URL, it also opens a realtime subscription so the `threads` array stays
5205
5205
  * current without polling — thread creates, renames, archives, and deletes
5206
5206
  * from any client are reflected immediately.
@@ -5496,7 +5496,7 @@ async function recordAnnotation(args) {
5496
5496
  //#endregion
5497
5497
  //#region src/v2/hooks/use-learn-from-user-action.tsx
5498
5498
  /**
5499
- * Record a user UI interaction in the Intelligence platform's user-actions
5499
+ * Record a user UI interaction in CopilotKit Intelligence's user-actions
5500
5500
  * stream. The platform's auto-curated knowledge base agent reads these
5501
5501
  * (alongside finished agent runs) and writes free-form Obsidian-flavored
5502
5502
  * markdown to `/project`, where any agent in the same project can later
@@ -5974,7 +5974,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
5974
5974
  });
5975
5975
  const hasContent = !!(message.content && message.content.trim().length > 0);
5976
5976
  const isLatestAssistantMessage = message.role === "assistant" && messages?.[messages.length - 1]?.id === message.id;
5977
- const shouldShowToolbar = toolbarVisible && hasContent && !(isRunning && isLatestAssistantMessage);
5977
+ const shouldShowToolbar = toolbarVisible && (hasContent || isLocalInspectorEnabled) && !(isRunning && isLatestAssistantMessage);
5978
5978
  if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5979
5979
  "data-copilotkit": true,
5980
5980
  style: { display: "contents" },
@@ -6130,7 +6130,7 @@ function CopilotKitColoredIcon() {
6130
6130
  className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:-ml-[5px] cpk:-mt-[0px]", className),
6131
6131
  ...props
6132
6132
  });
6133
- const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, children, ...props }) => {
6133
+ const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, tooltipClassName, children, ...props }) => {
6134
6134
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipTrigger, {
6135
6135
  asChild: true,
6136
6136
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
@@ -6142,6 +6142,7 @@ function CopilotKitColoredIcon() {
6142
6142
  })
6143
6143
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
6144
6144
  side: "bottom",
6145
+ className: tooltipClassName,
6145
6146
  children: tooltip ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: title })
6146
6147
  })] });
6147
6148
  };
@@ -6175,23 +6176,28 @@ function CopilotKitColoredIcon() {
6175
6176
  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]" })
6176
6177
  });
6177
6178
  };
6178
- _CopilotChatAssistantMessage.InspectorButton = ({ title, ...props }) => {
6179
+ _CopilotChatAssistantMessage.InspectorButton = ({ title, className, ...props }) => {
6179
6180
  const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
6180
6181
  const primaryLabel = title || labels.assistantMessageToolbarInspectorLabel;
6181
- const localOnlyLabel = labels.assistantMessageToolbarInspectorLocalOnlyLabel;
6182
- const accessibleLabel = `${primaryLabel} (${localOnlyLabel})`;
6183
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
6182
+ const accessibleLabel = `${primaryLabel} (local only)`;
6183
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolbarButton, {
6184
6184
  "data-testid": "copilot-inspector-button",
6185
6185
  title: accessibleLabel,
6186
- tooltip: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6187
- className: "cpk:flex cpk:flex-col cpk:gap-0.5",
6188
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: primaryLabel }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6189
- className: "cpk:text-[10px] cpk:opacity-65",
6190
- children: localOnlyLabel
6191
- })]
6192
- }),
6186
+ className: (0, tailwind_merge.twMerge)("cpk:w-auto cpk:gap-1.5 cpk:px-2", className),
6187
+ tooltipClassName: "cpk:max-w-64 cpk:text-left cpk:leading-4",
6188
+ tooltip: "View this message in the Inspector to get more information. This button and the inspector only display during local development (localhost, dev env).",
6193
6189
  ...props,
6194
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitColoredIcon, {})
6190
+ children: [
6191
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitColoredIcon, {}),
6192
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6193
+ className: "cpk:font-medium",
6194
+ children: primaryLabel
6195
+ }),
6196
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6197
+ className: "cpk:text-xs cpk:text-muted-foreground",
6198
+ children: "(local only)"
6199
+ })
6200
+ ]
6195
6201
  });
6196
6202
  };
6197
6203
  _CopilotChatAssistantMessage.ThumbsUpButton = ({ title, ...props }) => {
@@ -8352,14 +8358,109 @@ async function transcribeAudio(core, audioBlob, filename = "recording.webm") {
8352
8358
  return await response.json();
8353
8359
  }
8354
8360
 
8361
+ //#endregion
8362
+ //#region src/v2/providers/use-inspector-thread-override.ts
8363
+ function useInspectorThreadOverride(args) {
8364
+ const [override, setOverride] = (0, react.useState)(null);
8365
+ const latestRef = (0, react.useRef)({
8366
+ ...args,
8367
+ override
8368
+ });
8369
+ latestRef.current = {
8370
+ ...args,
8371
+ override
8372
+ };
8373
+ const restoreOverride = (0, react.useCallback)((current, nextThreadId) => {
8374
+ setOverride(null);
8375
+ (0, _copilotkit_core.emitInspectorActiveThread)({
8376
+ requestId: current.requestId,
8377
+ threadId: nextThreadId,
8378
+ agentId: current.agentId,
8379
+ source: "app"
8380
+ });
8381
+ }, []);
8382
+ const failInspectorOverride = (0, react.useCallback)((requestId) => {
8383
+ const current = latestRef.current.override;
8384
+ if (!current || current.requestId !== requestId) return;
8385
+ (0, _copilotkit_core.emitInspectorViewThreadResult)({
8386
+ requestId,
8387
+ threadId: current.threadId,
8388
+ agentId: current.agentId,
8389
+ ok: false,
8390
+ reason: "connect-failed"
8391
+ });
8392
+ restoreOverride(current, current.previousThreadId);
8393
+ }, [restoreOverride]);
8394
+ (0, react.useEffect)(() => {
8395
+ if (!(0, _copilotkit_core.isInspectorThreadBridgeEnabled)()) return;
8396
+ const offView = (0, _copilotkit_core.onInspectorViewThread)((payload) => {
8397
+ const current = latestRef.current;
8398
+ if (payload.agentId !== current.agentId) return false;
8399
+ setOverride(current.override ? {
8400
+ ...current.override,
8401
+ ...payload
8402
+ } : {
8403
+ ...payload,
8404
+ previousThreadId: current.baseThreadId
8405
+ });
8406
+ (0, _copilotkit_core.emitInspectorViewThreadResult)({
8407
+ ...payload,
8408
+ ok: true
8409
+ });
8410
+ (0, _copilotkit_core.emitInspectorActiveThread)({
8411
+ ...payload,
8412
+ source: "override"
8413
+ });
8414
+ return true;
8415
+ });
8416
+ const offStop = (0, _copilotkit_core.onInspectorStopViewing)((payload) => {
8417
+ const current = latestRef.current.override;
8418
+ if (!current) return;
8419
+ if (payload.requestId !== current.requestId) return;
8420
+ if (payload.agentId !== current.agentId) return;
8421
+ restoreOverride(current, current.previousThreadId);
8422
+ });
8423
+ return () => {
8424
+ offView();
8425
+ offStop();
8426
+ };
8427
+ }, [restoreOverride]);
8428
+ (0, react.useEffect)(() => {
8429
+ if (!override) return;
8430
+ if (args.agentId !== override.agentId) {
8431
+ restoreOverride(override, override.previousThreadId);
8432
+ return;
8433
+ }
8434
+ if (args.baseThreadId === override.previousThreadId) return;
8435
+ if (args.baseThreadId === override.threadId) return;
8436
+ restoreOverride(override, args.baseThreadId);
8437
+ }, [
8438
+ args.agentId,
8439
+ args.baseThreadId,
8440
+ override,
8441
+ restoreOverride
8442
+ ]);
8443
+ return {
8444
+ inspectorThreadId: override?.threadId ?? null,
8445
+ inspectorRequestId: override?.requestId ?? null,
8446
+ failInspectorOverride
8447
+ };
8448
+ }
8449
+
8355
8450
  //#endregion
8356
8451
  //#region src/v2/components/chat/CopilotChat.tsx
8357
8452
  function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen, attachments: attachmentsConfig, onError, throttleMs, ...props }) {
8358
8453
  const existingConfig = useCopilotChatConfiguration();
8359
8454
  const resolvedAgentId = agentId ?? existingConfig?.agentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
8360
8455
  const providedThreadId = threadId ?? existingConfig?.threadId;
8361
- const resolvedThreadId = (0, react.useMemo)(() => providedThreadId ?? (0, _copilotkit_shared.randomUUID)(), [providedThreadId]);
8362
- const hasExplicitThreadId = !!threadId || !!existingConfig?.hasExplicitThreadId;
8456
+ const baseThreadId = (0, react.useMemo)(() => providedThreadId ?? (0, _copilotkit_shared.randomUUID)(), [providedThreadId]);
8457
+ const baseHasExplicitThreadId = !!threadId || !!existingConfig?.hasExplicitThreadId;
8458
+ const { inspectorThreadId, inspectorRequestId, failInspectorOverride } = useInspectorThreadOverride({
8459
+ agentId: resolvedAgentId,
8460
+ baseThreadId
8461
+ });
8462
+ const resolvedThreadId = inspectorThreadId ?? baseThreadId;
8463
+ const hasExplicitThreadId = inspectorThreadId !== null || baseHasExplicitThreadId;
8363
8464
  const { agent, isReady } = useAgent({
8364
8465
  agentId: resolvedAgentId,
8365
8466
  throttleMs
@@ -8388,6 +8489,24 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
8388
8489
  subscription.unsubscribe();
8389
8490
  };
8390
8491
  }, [copilotkit, resolvedAgentId]);
8492
+ (0, react.useEffect)(() => {
8493
+ if (!inspectorRequestId) return;
8494
+ const requestId = inspectorRequestId;
8495
+ const expectedThreadId = resolvedThreadId;
8496
+ const subscription = copilotkit.subscribe({ onError: (event) => {
8497
+ if (event.code !== _copilotkit_core.CopilotKitCoreErrorCode.AGENT_CONNECT_FAILED) return;
8498
+ if (event.context?.agentId !== resolvedAgentId) return;
8499
+ if (event.context?.threadId !== expectedThreadId) return;
8500
+ failInspectorOverride(requestId);
8501
+ } });
8502
+ return () => subscription.unsubscribe();
8503
+ }, [
8504
+ copilotkit,
8505
+ failInspectorOverride,
8506
+ inspectorRequestId,
8507
+ resolvedAgentId,
8508
+ resolvedThreadId
8509
+ ]);
8391
8510
  const [transcribeMode, setTranscribeMode] = (0, react.useState)("input");
8392
8511
  const [inputValue, setInputValue] = (0, react.useState)("");
8393
8512
  const [transcriptionError, setTranscriptionError] = (0, react.useState)(null);
@@ -8414,7 +8533,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
8414
8533
  const runtimeStatus = copilotkit.runtimeConnectionStatus === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connected ? "Connected" : copilotkit.runtimeConnectionStatus;
8415
8534
  const hasNativeIntelligenceRunActivity = hasExplicitThreadId && runtimeStatus === "Connected" && !!copilotkit.intelligence?.wsUrl && copilotkit.threadEndpoints?.realtimeMetadata === true;
8416
8535
  const [standaloneRunActivityStore] = (0, react.useState)(() => (0, _copilotkit_core.ɵcreateThreadStore)({ fetch: globalThis.fetch }));
8417
- const previousThreadIdRef = (0, react.useRef)(null);
8536
+ const previousThreadRef = (0, react.useRef)(null);
8418
8537
  const hasExplicitThreadIdRef = (0, react.useRef)(hasExplicitThreadId);
8419
8538
  hasExplicitThreadIdRef.current = hasExplicitThreadId;
8420
8539
  const rememberRecentlyLocalRunId = (0, react.useCallback)((runId) => {
@@ -8454,8 +8573,15 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
8454
8573
  };
8455
8574
  }, []);
8456
8575
  (0, react.useEffect)(() => {
8457
- const threadChanged = previousThreadIdRef.current !== resolvedThreadId;
8458
- previousThreadIdRef.current = resolvedThreadId;
8576
+ const previousThread = previousThreadRef.current;
8577
+ const threadChanged = previousThread?.threadId !== resolvedThreadId;
8578
+ const inspectorTransition = threadChanged && previousThread !== null && previousThread.inspectorRequestId !== inspectorRequestId && (previousThread.inspectorRequestId !== null || inspectorRequestId !== null);
8579
+ previousThreadRef.current = {
8580
+ threadId: resolvedThreadId,
8581
+ inspectorRequestId
8582
+ };
8583
+ if (inspectorTransition) if (typeof copilotkit.stopAgent === "function") copilotkit.stopAgent({ agent });
8584
+ else agent.abortRun?.();
8459
8585
  agent.threadId = resolvedThreadId;
8460
8586
  if (!hasExplicitThreadId) {
8461
8587
  if (threadChanged && agent.messages.length > 0) agent.setMessages([]);
@@ -8471,6 +8597,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
8471
8597
  } catch (error) {
8472
8598
  if (detached) return;
8473
8599
  console.error("CopilotChat: connectAgent failed", error);
8600
+ if (inspectorRequestId) failInspectorOverride(inspectorRequestId);
8474
8601
  } finally {
8475
8602
  if (!detached) (typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 16))(() => {
8476
8603
  if (!detached) setLastConnectedThreadId(resolvedThreadId);
@@ -8496,7 +8623,9 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
8496
8623
  resolvedThreadId,
8497
8624
  agent,
8498
8625
  resolvedAgentId,
8499
- hasExplicitThreadId
8626
+ hasExplicitThreadId,
8627
+ inspectorRequestId,
8628
+ failInspectorOverride
8500
8629
  ]);
8501
8630
  (0, react.useEffect)(() => {
8502
8631
  if (!hasNativeIntelligenceRunActivity) return;
@@ -9853,7 +9982,7 @@ const WildcardToolCallRender = defineToolCallRenderer({
9853
9982
  });
9854
9983
 
9855
9984
  //#endregion
9856
- //#region src/context/copilot-context.tsx
9985
+ //#region src/v1-deprecated/context/copilot-context.tsx
9857
9986
  const emptyCopilotContext$1 = {
9858
9987
  actions: {},
9859
9988
  setAction: () => {},
@@ -9933,7 +10062,7 @@ function returnAndThrowInDebug(_value) {
9933
10062
  }
9934
10063
 
9935
10064
  //#endregion
9936
- //#region src/hooks/use-tree.ts
10065
+ //#region src/v1-deprecated/hooks/use-tree.ts
9937
10066
  const removeNode = (nodes, id) => {
9938
10067
  return nodes.reduce((result, node) => {
9939
10068
  if (node.id !== id) {
@@ -10046,7 +10175,7 @@ function setsHaveIntersection$1(setA, setB) {
10046
10175
  }
10047
10176
 
10048
10177
  //#endregion
10049
- //#region src/hooks/use-flat-category-store.ts
10178
+ //#region src/v1-deprecated/hooks/use-flat-category-store.ts
10050
10179
  const useFlatCategoryStore = () => {
10051
10180
  const [elements, dispatch] = (0, react.useReducer)(flatCategoryStoreReducer, /* @__PURE__ */ new Map());
10052
10181
  return {
@@ -10104,7 +10233,7 @@ function setsHaveIntersection(setA, setB) {
10104
10233
  }
10105
10234
 
10106
10235
  //#endregion
10107
- //#region src/context/copilot-messages-context.tsx
10236
+ //#region src/v1-deprecated/context/copilot-messages-context.tsx
10108
10237
  const emptyCopilotContext = {
10109
10238
  messages: [],
10110
10239
  setMessages: () => [],
@@ -10119,7 +10248,7 @@ function useCopilotMessagesContext() {
10119
10248
  }
10120
10249
 
10121
10250
  //#endregion
10122
- //#region src/components/toast/toast-provider.tsx
10251
+ //#region src/v1-deprecated/components/toast/toast-provider.tsx
10123
10252
  const ToastContext = (0, react.createContext)(void 0);
10124
10253
  function getErrorSeverity(error) {
10125
10254
  if (error.severity) switch (error.severity) {
@@ -10426,7 +10555,7 @@ function ToastProvider({ enabled, children }) {
10426
10555
  }
10427
10556
 
10428
10557
  //#endregion
10429
- //#region src/utils/dev-console.ts
10558
+ //#region src/v1-deprecated/utils/dev-console.ts
10430
10559
  function isLocalhost() {
10431
10560
  if (typeof window === "undefined") return false;
10432
10561
  return window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "0.0.0.0";
@@ -10437,7 +10566,7 @@ function shouldShowDevConsole(showDevConsole) {
10437
10566
  }
10438
10567
 
10439
10568
  //#endregion
10440
- //#region src/components/copilot-provider/copilot-messages.tsx
10569
+ //#region src/v1-deprecated/components/copilot-provider/copilot-messages.tsx
10441
10570
  /**
10442
10571
  * An internal context to separate the messages state (which is constantly changing) from the rest of CopilotKit context
10443
10572
  */
@@ -10587,7 +10716,7 @@ function CopilotMessages({ children }) {
10587
10716
  }
10588
10717
 
10589
10718
  //#endregion
10590
- //#region src/components/usage-banner.tsx
10719
+ //#region src/v1-deprecated/components/usage-banner.tsx
10591
10720
  function UsageBanner({ severity = _copilotkit_shared.Severity.CRITICAL, message = "", onClose, actions }) {
10592
10721
  if (!message || !severity) return null;
10593
10722
  const theme = {
@@ -10784,7 +10913,7 @@ const getErrorActions = (error) => {
10784
10913
  };
10785
10914
 
10786
10915
  //#endregion
10787
- //#region src/lib/status-checker.ts
10916
+ //#region src/v1-deprecated/lib/status-checker.ts
10788
10917
  const STATUS_CHECK_INTERVAL = 1e3 * 60 * 5;
10789
10918
  var StatusChecker = class {
10790
10919
  constructor() {
@@ -10806,7 +10935,7 @@ var StatusChecker = class {
10806
10935
  this.lastResponse = response;
10807
10936
  onUpdate?.(response);
10808
10937
  return response;
10809
- } catch (error) {
10938
+ } catch {
10810
10939
  return null;
10811
10940
  }
10812
10941
  };
@@ -10832,7 +10961,7 @@ var StatusChecker = class {
10832
10961
  };
10833
10962
 
10834
10963
  //#endregion
10835
- //#region src/components/toast/exclamation-mark-icon.tsx
10964
+ //#region src/v1-deprecated/components/toast/exclamation-mark-icon.tsx
10836
10965
  const ExclamationMarkIcon = ({ className, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
10837
10966
  xmlns: "http://www.w3.org/2000/svg",
10838
10967
  width: "24",
@@ -10867,7 +10996,7 @@ const ExclamationMarkIcon = ({ className, style }) => /* @__PURE__ */ (0, react_
10867
10996
  });
10868
10997
 
10869
10998
  //#endregion
10870
- //#region src/components/error-boundary/error-utils.tsx
10999
+ //#region src/v1-deprecated/components/error-boundary/error-utils.tsx
10871
11000
  function ErrorToast({ errors }) {
10872
11001
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10873
11002
  style: {
@@ -10941,7 +11070,7 @@ function useAsyncCallback(callback, deps) {
10941
11070
  }
10942
11071
 
10943
11072
  //#endregion
10944
- //#region src/components/error-boundary/error-boundary.tsx
11073
+ //#region src/v1-deprecated/components/error-boundary/error-boundary.tsx
10945
11074
  const statusChecker = new StatusChecker();
10946
11075
  var CopilotErrorBoundary = class extends react.default.Component {
10947
11076
  constructor(props) {
@@ -10982,7 +11111,7 @@ var CopilotErrorBoundary = class extends react.default.Component {
10982
11111
  };
10983
11112
 
10984
11113
  //#endregion
10985
- //#region src/context/coagent-state-renders-context.tsx
11114
+ //#region src/v1-deprecated/context/coagent-state-renders-context.tsx
10986
11115
  const CoAgentStateRendersContext = (0, react.createContext)(void 0);
10987
11116
  function CoAgentStateRendersProvider({ children }) {
10988
11117
  const [coAgentStateRenders, setCoAgentStateRenders] = (0, react.useState)({});
@@ -11017,7 +11146,7 @@ function useCoAgentStateRenders() {
11017
11146
  }
11018
11147
 
11019
11148
  //#endregion
11020
- //#region src/context/threads-context.tsx
11149
+ //#region src/v1-deprecated/context/threads-context.tsx
11021
11150
  const ThreadsContext = (0, react.createContext)(void 0);
11022
11151
  function ThreadsProvider({ children, threadId: explicitThreadId }) {
11023
11152
  const [internalThreadId, setInternalThreadId] = (0, react.useState)(() => (0, _copilotkit_shared.randomUUID)());
@@ -11044,7 +11173,7 @@ function useThreads() {
11044
11173
  }
11045
11174
 
11046
11175
  //#endregion
11047
- //#region src/hooks/use-coagent-state-render-bridge.helpers.ts
11176
+ //#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.helpers.ts
11048
11177
  let RenderStatus = /* @__PURE__ */ function(RenderStatus) {
11049
11178
  RenderStatus["InProgress"] = "inProgress";
11050
11179
  RenderStatus["Complete"] = "complete";
@@ -11209,7 +11338,7 @@ function selectSnapshot({ messageId, messageName, allowLiveState, skipLatestCach
11209
11338
  }
11210
11339
 
11211
11340
  //#endregion
11212
- //#region src/hooks/use-coagent-state-render-registry.ts
11341
+ //#region src/v1-deprecated/hooks/use-coagent-state-render-registry.ts
11213
11342
  const LAST_SNAPSHOTS_BY_RENDER_AND_RUN = "__lastSnapshotsByStateRenderIdAndRun";
11214
11343
  const LAST_SNAPSHOTS_BY_MESSAGE = "__lastSnapshotsByMessageId";
11215
11344
  function getClaimsStore(claimsRef) {
@@ -11331,7 +11460,7 @@ function useStateRenderRegistry({ agentId, stateRenderId, message, messageIndex,
11331
11460
  }
11332
11461
 
11333
11462
  //#endregion
11334
- //#region src/hooks/use-coagent-state-render-bridge.tsx
11463
+ //#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.tsx
11335
11464
  function useCoagentStateRenderBridge(agentId, props) {
11336
11465
  const { stateSnapshot, message } = props;
11337
11466
  const { coAgentStateRenders, claimsRef } = useCoAgentStateRenders();
@@ -11415,7 +11544,7 @@ function CoAgentStateRenderBridge(props) {
11415
11544
  }
11416
11545
 
11417
11546
  //#endregion
11418
- //#region src/components/CopilotListeners.tsx
11547
+ //#region src/v1-deprecated/components/CopilotListeners.tsx
11419
11548
  const usePredictStateSubscription = (agent) => {
11420
11549
  const predictStateToolsRef = (0, react.useRef)([]);
11421
11550
  const getSubscriber = (0, react.useCallback)((agent) => ({
@@ -11485,7 +11614,7 @@ function CopilotListeners() {
11485
11614
  }
11486
11615
 
11487
11616
  //#endregion
11488
- //#region src/components/copilot-provider/copilotkit.tsx
11617
+ //#region src/v1-deprecated/components/copilot-provider/copilotkit.tsx
11489
11618
  function CopilotKit({ children, ...props }) {
11490
11619
  const enabled = shouldShowDevConsole(props.showDevConsole);
11491
11620
  const showInspector = shouldShowDevConsole(props.enableInspector);
@@ -12493,4 +12622,4 @@ Object.defineProperty(exports, 'ɵrunMcpFollowUp', {
12493
12622
  return ɵrunMcpFollowUp;
12494
12623
  }
12495
12624
  });
12496
- //# sourceMappingURL=copilotkit-DOMr3DRO.cjs.map
12625
+ //# sourceMappingURL=copilotkit-Ba7qwYt3.cjs.map