@copilotkit/react-core 1.69.0 → 1.69.1

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 (41) hide show
  1. package/dist/{copilotkit-pkDPhwkR.d.mts → copilotkit-DYKpg4pD.d.mts} +28 -22
  2. package/dist/copilotkit-DYKpg4pD.d.mts.map +1 -0
  3. package/dist/{copilotkit-DOMr3DRO.cjs → copilotkit-Dr0speVK.cjs} +429 -46
  4. package/dist/copilotkit-Dr0speVK.cjs.map +1 -0
  5. package/dist/{copilotkit-ykQW_VJZ.mjs → copilotkit-Dr6g885f.mjs} +431 -48
  6. package/dist/copilotkit-Dr6g885f.mjs.map +1 -0
  7. package/dist/{copilotkit-DYM5ChMS.d.cts → copilotkit-Hl1t9Y1v.d.cts} +28 -22
  8. package/dist/copilotkit-Hl1t9Y1v.d.cts.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 +185 -100
  18. package/dist/index.umd.js.map +1 -1
  19. package/dist/v2/headless.cjs +3 -2
  20. package/dist/v2/headless.cjs.map +1 -1
  21. package/dist/v2/headless.d.cts +5 -4
  22. package/dist/v2/headless.d.cts.map +1 -1
  23. package/dist/v2/headless.d.mts +5 -4
  24. package/dist/v2/headless.d.mts.map +1 -1
  25. package/dist/v2/headless.mjs +3 -2
  26. package/dist/v2/headless.mjs.map +1 -1
  27. package/dist/v2/index.cjs +1 -1
  28. package/dist/v2/index.css +1 -1
  29. package/dist/v2/index.d.cts +1 -1
  30. package/dist/v2/index.d.mts +1 -1
  31. package/dist/v2/index.mjs +1 -1
  32. package/dist/v2/index.umd.js +426 -43
  33. package/dist/v2/index.umd.js.map +1 -1
  34. package/package.json +8 -8
  35. package/skills/react-core/SKILL.md +1 -1
  36. package/skills/react-core/references/provider-setup.md +1 -1
  37. package/skills/react-core/references/threads.md +2 -2
  38. package/dist/copilotkit-DOMr3DRO.cjs.map +0 -1
  39. package/dist/copilotkit-DYM5ChMS.d.cts.map +0 -1
  40. package/dist/copilotkit-pkDPhwkR.d.mts.map +0 -1
  41. package/dist/copilotkit-ykQW_VJZ.mjs.map +0 -1
package/dist/index.umd.js CHANGED
@@ -91,6 +91,7 @@ react_markdown = __toESM(react_markdown);
91
91
  assistantMessageToolbarCopyMessageLabel: "Copy",
92
92
  assistantMessageToolbarInspectorLabel: "View in Inspector",
93
93
  assistantMessageToolbarInspectorLocalOnlyLabel: "Local Only",
94
+ assistantMessageToolbarSaveSnippetLabel: "Save as snippet",
94
95
  assistantMessageToolbarThumbsUpLabel: "Good response",
95
96
  assistantMessageToolbarThumbsDownLabel: "Bad response",
96
97
  assistantMessageToolbarReadAloudLabel: "Read aloud",
@@ -514,7 +515,8 @@ react_markdown = __toESM(react_markdown);
514
515
  //#region src/v2/components/CopilotKitInspectorContext.tsx
515
516
  const CopilotKitInspectorContext = react.createContext({
516
517
  isLocalInspectorEnabled: false,
517
- openInspector: () => void 0
518
+ openInspector: () => void 0,
519
+ saveEventSnippet: async () => void 0
518
520
  });
519
521
  const CopilotKitInspectorContextProvider = CopilotKitInspectorContext.Provider;
520
522
 
@@ -1296,6 +1298,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
1296
1298
  const OpenGenerativeUIActivityRendererInner = react.default.memo(function OpenGenerativeUIActivityRendererInner({ content }) {
1297
1299
  const initialHeight = content.initialHeight ?? 200;
1298
1300
  const [autoHeight, setAutoHeight] = (0, react.useState)(null);
1301
+ const [sandboxReady, setSandboxReady] = (0, react.useState)(false);
1299
1302
  const sandboxFunctions = useSandboxFunctions();
1300
1303
  const localApi = (0, react.useMemo)(() => {
1301
1304
  const api = {};
@@ -1397,6 +1400,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
1397
1400
  sandbox.promise.then(() => {
1398
1401
  if (cancelled) return;
1399
1402
  sandboxReadyRef.current = true;
1403
+ setSandboxReady(true);
1400
1404
  sandbox.run(`
1401
1405
  var s = document.createElement('style');
1402
1406
  s.textContent = 'html, body { overflow: hidden !important; }';
@@ -1421,6 +1425,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
1421
1425
  sandboxRef.current = null;
1422
1426
  }
1423
1427
  sandboxReadyRef.current = false;
1428
+ setSandboxReady(false);
1424
1429
  setAutoHeight(null);
1425
1430
  };
1426
1431
  }, [
@@ -1451,7 +1456,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
1451
1456
  const generationDone = content.generating === false;
1452
1457
  (0, react.useEffect)(() => {
1453
1458
  const sandbox = sandboxRef.current;
1454
- if (!generationDone || !sandbox) return;
1459
+ if (!generationDone || !sandboxReady || !sandbox) return;
1455
1460
  let handled = false;
1456
1461
  const onMessage = (e) => {
1457
1462
  if (handled) return;
@@ -1480,7 +1485,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
1480
1485
  return () => {
1481
1486
  window.removeEventListener("message", onMessage);
1482
1487
  };
1483
- }, [generationDone]);
1488
+ }, [generationDone, sandboxReady]);
1484
1489
  const height = autoHeight ?? initialHeight;
1485
1490
  const isGenerating = content.generating !== false;
1486
1491
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -2368,10 +2373,46 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2368
2373
  const requestInspectorOpen = (0, react.useCallback)((request) => {
2369
2374
  setInspectorOpenRequest({ ...request });
2370
2375
  }, []);
2376
+ const saveEventSnippet = (0, react.useCallback)(async (request) => {
2377
+ try {
2378
+ const mod = await import("@copilotkit/web-inspector");
2379
+ const threadId = request.threadId ?? "inspector-snippet";
2380
+ const runId = `inspector-snippet-${Date.now()}`;
2381
+ const compiled = mod.compileChatSnippet({
2382
+ ...request,
2383
+ threadId,
2384
+ runId
2385
+ });
2386
+ const now = (/* @__PURE__ */ new Date()).toISOString();
2387
+ const snippet = {
2388
+ id: crypto.randomUUID(),
2389
+ name: compiled.name,
2390
+ recipe: compiled.recipe,
2391
+ events: compiled.events,
2392
+ createdAt: now,
2393
+ updatedAt: now
2394
+ };
2395
+ mod.upsertEventSnippet(snippet);
2396
+ requestInspectorOpen({
2397
+ messageId: request.messageId,
2398
+ threadId: request.threadId,
2399
+ agentId: request.agentId,
2400
+ menu: "event-snippets",
2401
+ snippetId: snippet.id
2402
+ });
2403
+ } catch (error) {
2404
+ console.error("[CopilotKit] Could not save the event snippet.", error);
2405
+ }
2406
+ }, [requestInspectorOpen]);
2371
2407
  const inspectorContextValue = (0, react.useMemo)(() => ({
2372
2408
  isLocalInspectorEnabled,
2373
- openInspector: requestInspectorOpen
2374
- }), [isLocalInspectorEnabled, requestInspectorOpen]);
2409
+ openInspector: requestInspectorOpen,
2410
+ saveEventSnippet
2411
+ }), [
2412
+ isLocalInspectorEnabled,
2413
+ requestInspectorOpen,
2414
+ saveEventSnippet
2415
+ ]);
2375
2416
  const renderToolCallsList = useStableArrayProp(renderToolCalls, "renderToolCalls must be a stable array. If you want to dynamically add or remove tools, use `useFrontendTool` instead.", (initial, next) => {
2376
2417
  const key = (rc) => `${rc?.agentId ?? ""}:${rc?.name ?? ""}`;
2377
2418
  const setFrom = (arr) => new Set(arr.map(key));
@@ -2426,7 +2467,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2426
2467
  const hasLocalAgents = mergedAgents && Object.keys(mergedAgents).length > 0;
2427
2468
  const hasSelfManagedAgents = Object.keys(selfManagedAgents).length > 0;
2428
2469
  (0, react.useEffect)(() => {
2429
- 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.");
2470
+ 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.");
2430
2471
  }, [hasSelfManagedAgents, resolvedPublicKey]);
2431
2472
  const headers = typeof headersProp === "function" ? headersProp() : headersProp;
2432
2473
  const mergedHeaders = (0, react.useMemo)(() => {
@@ -3590,7 +3631,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3590
3631
  }
3591
3632
 
3592
3633
  //#endregion
3593
- //#region src/context/copilot-context.tsx
3634
+ //#region src/v1-deprecated/context/copilot-context.tsx
3594
3635
  const emptyCopilotContext$1 = {
3595
3636
  actions: {},
3596
3637
  setAction: () => {},
@@ -3670,7 +3711,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3670
3711
  }
3671
3712
 
3672
3713
  //#endregion
3673
- //#region src/hooks/use-tree.ts
3714
+ //#region src/v1-deprecated/hooks/use-tree.ts
3674
3715
  const removeNode = (nodes, id) => {
3675
3716
  return nodes.reduce((result, node) => {
3676
3717
  if (node.id !== id) {
@@ -3783,7 +3824,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3783
3824
  }
3784
3825
 
3785
3826
  //#endregion
3786
- //#region src/hooks/use-flat-category-store.ts
3827
+ //#region src/v1-deprecated/hooks/use-flat-category-store.ts
3787
3828
  const useFlatCategoryStore = () => {
3788
3829
  const [elements, dispatch] = (0, react.useReducer)(flatCategoryStoreReducer, /* @__PURE__ */ new Map());
3789
3830
  return {
@@ -3841,7 +3882,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3841
3882
  }
3842
3883
 
3843
3884
  //#endregion
3844
- //#region src/context/copilot-messages-context.tsx
3885
+ //#region src/v1-deprecated/context/copilot-messages-context.tsx
3845
3886
  const emptyCopilotContext = {
3846
3887
  messages: [],
3847
3888
  setMessages: () => [],
@@ -3856,7 +3897,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3856
3897
  }
3857
3898
 
3858
3899
  //#endregion
3859
- //#region src/components/toast/toast-provider.tsx
3900
+ //#region src/v1-deprecated/components/toast/toast-provider.tsx
3860
3901
  const ToastContext = (0, react.createContext)(void 0);
3861
3902
  function getErrorSeverity(error) {
3862
3903
  if (error.severity) switch (error.severity) {
@@ -4163,7 +4204,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4163
4204
  }
4164
4205
 
4165
4206
  //#endregion
4166
- //#region src/utils/dev-console.ts
4207
+ //#region src/v1-deprecated/utils/dev-console.ts
4167
4208
  function isLocalhost() {
4168
4209
  if (typeof window === "undefined") return false;
4169
4210
  return window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "0.0.0.0";
@@ -4174,7 +4215,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4174
4215
  }
4175
4216
 
4176
4217
  //#endregion
4177
- //#region src/components/copilot-provider/copilot-messages.tsx
4218
+ //#region src/v1-deprecated/components/copilot-provider/copilot-messages.tsx
4178
4219
  /**
4179
4220
  * An internal context to separate the messages state (which is constantly changing) from the rest of CopilotKit context
4180
4221
  */
@@ -4324,7 +4365,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4324
4365
  }
4325
4366
 
4326
4367
  //#endregion
4327
- //#region src/components/usage-banner.tsx
4368
+ //#region src/v1-deprecated/components/usage-banner.tsx
4328
4369
  function UsageBanner({ severity = _copilotkit_shared.Severity.CRITICAL, message = "", onClose, actions }) {
4329
4370
  if (!message || !severity) return null;
4330
4371
  const theme = {
@@ -4521,7 +4562,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4521
4562
  };
4522
4563
 
4523
4564
  //#endregion
4524
- //#region src/utils/suggestions-constants.ts
4565
+ //#region src/v1-deprecated/utils/suggestions-constants.ts
4525
4566
  /**
4526
4567
  * Constants for suggestions retry logic
4527
4568
  */
@@ -4531,7 +4572,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4531
4572
  };
4532
4573
 
4533
4574
  //#endregion
4534
- //#region src/lib/status-checker.ts
4575
+ //#region src/v1-deprecated/lib/status-checker.ts
4535
4576
  const STATUS_CHECK_INTERVAL = 1e3 * 60 * 5;
4536
4577
  var StatusChecker = class {
4537
4578
  constructor() {
@@ -4553,7 +4594,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4553
4594
  this.lastResponse = response;
4554
4595
  onUpdate?.(response);
4555
4596
  return response;
4556
- } catch (error) {
4597
+ } catch {
4557
4598
  return null;
4558
4599
  }
4559
4600
  };
@@ -4579,7 +4620,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4579
4620
  };
4580
4621
 
4581
4622
  //#endregion
4582
- //#region src/components/toast/exclamation-mark-icon.tsx
4623
+ //#region src/v1-deprecated/components/toast/exclamation-mark-icon.tsx
4583
4624
  const ExclamationMarkIcon = ({ className, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4584
4625
  xmlns: "http://www.w3.org/2000/svg",
4585
4626
  width: "24",
@@ -4614,7 +4655,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4614
4655
  });
4615
4656
 
4616
4657
  //#endregion
4617
- //#region src/components/error-boundary/error-utils.tsx
4658
+ //#region src/v1-deprecated/components/error-boundary/error-utils.tsx
4618
4659
  function ErrorToast({ errors }) {
4619
4660
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4620
4661
  style: {
@@ -4688,7 +4729,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4688
4729
  }
4689
4730
 
4690
4731
  //#endregion
4691
- //#region src/components/error-boundary/error-boundary.tsx
4732
+ //#region src/v1-deprecated/components/error-boundary/error-boundary.tsx
4692
4733
  const statusChecker = new StatusChecker();
4693
4734
  var CopilotErrorBoundary = class extends react.default.Component {
4694
4735
  constructor(props) {
@@ -4729,7 +4770,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4729
4770
  };
4730
4771
 
4731
4772
  //#endregion
4732
- //#region src/context/coagent-state-renders-context.tsx
4773
+ //#region src/v1-deprecated/context/coagent-state-renders-context.tsx
4733
4774
  const CoAgentStateRendersContext = (0, react.createContext)(void 0);
4734
4775
  function CoAgentStateRendersProvider({ children }) {
4735
4776
  const [coAgentStateRenders, setCoAgentStateRenders] = (0, react.useState)({});
@@ -4764,7 +4805,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4764
4805
  }
4765
4806
 
4766
4807
  //#endregion
4767
- //#region src/context/threads-context.tsx
4808
+ //#region src/v1-deprecated/context/threads-context.tsx
4768
4809
  const ThreadsContext = (0, react.createContext)(void 0);
4769
4810
  function ThreadsProvider({ children, threadId: explicitThreadId }) {
4770
4811
  const [internalThreadId, setInternalThreadId] = (0, react.useState)(() => (0, _copilotkit_shared.randomUUID)());
@@ -4791,7 +4832,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4791
4832
  }
4792
4833
 
4793
4834
  //#endregion
4794
- //#region src/hooks/use-coagent-state-render-bridge.helpers.ts
4835
+ //#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.helpers.ts
4795
4836
  let RenderStatus = /* @__PURE__ */ function(RenderStatus) {
4796
4837
  RenderStatus["InProgress"] = "inProgress";
4797
4838
  RenderStatus["Complete"] = "complete";
@@ -4956,7 +4997,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4956
4997
  }
4957
4998
 
4958
4999
  //#endregion
4959
- //#region src/hooks/use-coagent-state-render-registry.ts
5000
+ //#region src/v1-deprecated/hooks/use-coagent-state-render-registry.ts
4960
5001
  const LAST_SNAPSHOTS_BY_RENDER_AND_RUN = "__lastSnapshotsByStateRenderIdAndRun";
4961
5002
  const LAST_SNAPSHOTS_BY_MESSAGE = "__lastSnapshotsByMessageId";
4962
5003
  function getClaimsStore(claimsRef) {
@@ -5078,7 +5119,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5078
5119
  }
5079
5120
 
5080
5121
  //#endregion
5081
- //#region src/hooks/use-coagent-state-render-bridge.tsx
5122
+ //#region src/v1-deprecated/hooks/use-coagent-state-render-bridge.tsx
5082
5123
  function useCoagentStateRenderBridge(agentId, props) {
5083
5124
  const { stateSnapshot, message } = props;
5084
5125
  const { coAgentStateRenders, claimsRef } = useCoAgentStateRenders();
@@ -5162,7 +5203,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5162
5203
  }
5163
5204
 
5164
5205
  //#endregion
5165
- //#region src/components/CopilotListeners.tsx
5206
+ //#region src/v1-deprecated/components/CopilotListeners.tsx
5166
5207
  const usePredictStateSubscription = (agent) => {
5167
5208
  const predictStateToolsRef = (0, react.useRef)([]);
5168
5209
  const getSubscriber = (0, react.useCallback)((agent) => ({
@@ -5232,7 +5273,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5232
5273
  }
5233
5274
 
5234
5275
  //#endregion
5235
- //#region src/components/copilot-provider/copilotkit.tsx
5276
+ //#region src/v1-deprecated/components/copilot-provider/copilotkit.tsx
5236
5277
  function CopilotKit({ children, ...props }) {
5237
5278
  const enabled = shouldShowDevConsole(props.showDevConsole);
5238
5279
  const showInspector = shouldShowDevConsole(props.enableInspector);
@@ -5730,7 +5771,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5730
5771
  }
5731
5772
 
5732
5773
  //#endregion
5733
- //#region src/hooks/use-lazy-tool-renderer.tsx
5774
+ //#region src/v1-deprecated/hooks/use-lazy-tool-renderer.tsx
5734
5775
  function useLazyToolRenderer() {
5735
5776
  const renderToolCall = useRenderToolCall$1();
5736
5777
  return (0, react.useCallback)((message, messages) => {
@@ -5746,7 +5787,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5746
5787
  }
5747
5788
 
5748
5789
  //#endregion
5749
- //#region src/hooks/use-copilot-chat_internal.ts
5790
+ //#region src/v1-deprecated/hooks/use-copilot-chat_internal.ts
5750
5791
  function useCopilotChatInternal({ suggestions, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages } = {}) {
5751
5792
  const { copilotkit } = useCopilotKit();
5752
5793
  const { threadId, agentSession } = useCopilotContext();
@@ -6047,7 +6088,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6047
6088
  }
6048
6089
 
6049
6090
  //#endregion
6050
- //#region src/hooks/use-copilot-chat.ts
6091
+ //#region src/v1-deprecated/hooks/use-copilot-chat.ts
6051
6092
  /**
6052
6093
  * A lightweight React hook for headless chat interactions.
6053
6094
  * Perfect for programmatic messaging, background operations, and custom UI implementations.
@@ -6071,12 +6112,12 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6071
6112
  }
6072
6113
 
6073
6114
  //#endregion
6074
- //#region src/hooks/use-copilot-chat-headless_c.ts
6115
+ //#region src/v1-deprecated/hooks/use-copilot-chat-headless_c.ts
6075
6116
  /**
6076
6117
  * `useCopilotChatHeadless_c` is for building fully custom UI (headless UI) implementations.
6077
6118
  *
6078
- * <Callout title="This is an Enterprise Intelligence Platform feature">
6079
- * Read more about <a href="/premium/overview">the Enterprise Intelligence Platform</a>.
6119
+ * <Callout title="This is a CopilotKit Intelligence feature">
6120
+ * Read more about <a href="/premium/overview">CopilotKit Intelligence</a>.
6080
6121
  *
6081
6122
  * Usage is generous and **free** to get started.
6082
6123
  * </Callout>
@@ -6255,11 +6296,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6255
6296
  interrupt: null
6256
6297
  });
6257
6298
  /**
6258
- * Enterprise Intelligence Platform React hook that provides complete chat functionality for fully custom UI implementations.
6299
+ * CopilotKit Intelligence React hook that provides complete chat functionality for fully custom UI implementations.
6259
6300
  * Includes all advanced features like direct message access, suggestions array, interrupt handling, and MCP support.
6260
6301
  *
6261
6302
  * @param options - Configuration options for the chat
6262
- * @returns Complete chat interface with all Enterprise Intelligence Platform features
6303
+ * @returns Complete chat interface with all CopilotKit Intelligence features
6263
6304
  *
6264
6305
  * @example
6265
6306
  * ```tsx
@@ -6273,7 +6314,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6273
6314
  (0, react.useEffect)(() => {
6274
6315
  if (!hasPublicApiKey) {
6275
6316
  setBannerError(new _copilotkit_shared.CopilotKitError({
6276
- message: "You're using useCopilotChatHeadless_c, an Enterprise Intelligence Platform feature that offers extensive headless chat capabilities. To continue, you'll need to provide a free public license key.",
6317
+ message: "You're using useCopilotChatHeadless_c, a CopilotKit Intelligence feature that offers extensive headless chat capabilities. To continue, you'll need to provide a free public license key.",
6277
6318
  code: _copilotkit_shared.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,
6278
6319
  severity: _copilotkit_shared.Severity.WARNING,
6279
6320
  visibility: _copilotkit_shared.ErrorVisibility.BANNER
@@ -6286,7 +6327,26 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6286
6327
  }
6287
6328
 
6288
6329
  //#endregion
6289
- //#region src/hooks/use-frontend-tool.ts
6330
+ //#region src/v1-deprecated/hooks/use-frontend-tool.ts
6331
+ /**
6332
+ * @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useFrontendTool` from `@copilotkit/react-core/v2` instead.
6333
+ *
6334
+ * ```tsx
6335
+ * import { useFrontendTool } from "@copilotkit/react-core/v2";
6336
+ * import { z } from "zod";
6337
+ *
6338
+ * function MyComponent() {
6339
+ * useFrontendTool({
6340
+ * name: "myTool",
6341
+ * description: "Run my tool",
6342
+ * parameters: z.object({}),
6343
+ * handler: async () => "done",
6344
+ * });
6345
+ * return null;
6346
+ * }
6347
+ * ```
6348
+ * See https://docs.copilotkit.ai/reference/v2/hooks/useFrontendTool
6349
+ */
6290
6350
  function useFrontendTool(tool, dependencies) {
6291
6351
  const { name, description, parameters, render, followUp, available } = tool;
6292
6352
  const zodParameters = (0, _copilotkit_shared.getZodParameters)(parameters);
@@ -6324,7 +6384,27 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6324
6384
  }
6325
6385
 
6326
6386
  //#endregion
6327
- //#region src/hooks/use-render-tool-call.ts
6387
+ //#region src/v1-deprecated/hooks/use-render-tool-call.ts
6388
+ /**
6389
+ * @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useRenderTool` from `@copilotkit/react-core/v2` instead.
6390
+ *
6391
+ * ```tsx
6392
+ * import { useRenderTool } from "@copilotkit/react-core/v2";
6393
+ * import { z } from "zod";
6394
+ *
6395
+ * function StatusTool() {
6396
+ * useRenderTool({
6397
+ * name: "showStatus",
6398
+ * parameters: z.object({}),
6399
+ * render: ({ status, result }) => (
6400
+ * <div>{status === "complete" ? result : "Running..."}</div>
6401
+ * ),
6402
+ * });
6403
+ * return null;
6404
+ * }
6405
+ * ```
6406
+ * See https://docs.copilotkit.ai/reference/v2/hooks/useRenderTool
6407
+ */
6328
6408
  function useRenderToolCall(tool, dependencies) {
6329
6409
  const { copilotkit } = useCopilotKit();
6330
6410
  const hasAddedRef = (0, react.useRef)(false);
@@ -6364,7 +6444,28 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6364
6444
  }
6365
6445
 
6366
6446
  //#endregion
6367
- //#region src/hooks/use-human-in-the-loop.ts
6447
+ //#region src/v1-deprecated/hooks/use-human-in-the-loop.ts
6448
+ /**
6449
+ * @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useHumanInTheLoop` from `@copilotkit/react-core/v2` instead.
6450
+ *
6451
+ * ```tsx
6452
+ * import { useHumanInTheLoop } from "@copilotkit/react-core/v2";
6453
+ * import { z } from "zod";
6454
+ *
6455
+ * function Confirmation() {
6456
+ * useHumanInTheLoop({
6457
+ * name: "confirmAction",
6458
+ * description: "Ask the user to confirm",
6459
+ * parameters: z.object({}),
6460
+ * render: ({ respond }) => (
6461
+ * <button onClick={() => respond?.(true)}>Confirm</button>
6462
+ * ),
6463
+ * });
6464
+ * return null;
6465
+ * }
6466
+ * ```
6467
+ * See https://docs.copilotkit.ai/reference/v2/hooks/useHumanInTheLoop
6468
+ */
6368
6469
  function useHumanInTheLoop(tool, dependencies) {
6369
6470
  const { render, ...toolRest } = tool;
6370
6471
  const { name, description, parameters, followUp } = toolRest;
@@ -6416,7 +6517,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6416
6517
  }
6417
6518
 
6418
6519
  //#endregion
6419
- //#region src/hooks/use-copilot-action.ts
6520
+ //#region src/v1-deprecated/hooks/use-copilot-action.ts
6420
6521
  /**
6421
6522
  * Example usage of useCopilotAction with complex parameters:
6422
6523
  *
@@ -6615,7 +6716,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6615
6716
  }
6616
6717
 
6617
6718
  //#endregion
6618
- //#region src/hooks/use-coagent-state-render.ts
6719
+ //#region src/v1-deprecated/hooks/use-coagent-state-render.ts
6619
6720
  /**
6620
6721
  * The useCoAgentStateRender hook allows you to render UI or text based components on a Agentic Copilot's state in the chat.
6621
6722
  * This is particularly useful for showing intermediate state or progress during Agentic Copilot operations.
@@ -6723,7 +6824,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6723
6824
  }
6724
6825
 
6725
6826
  //#endregion
6726
- //#region src/hooks/use-make-copilot-document-readable.ts
6827
+ //#region src/v1-deprecated/hooks/use-make-copilot-document-readable.ts
6727
6828
  /**
6728
6829
  * Makes a document readable by Copilot.
6729
6830
  * @param document The document to make readable.
@@ -6749,7 +6850,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6749
6850
  }
6750
6851
 
6751
6852
  //#endregion
6752
- //#region src/hooks/use-copilot-readable.ts
6853
+ //#region src/v1-deprecated/hooks/use-copilot-readable.ts
6753
6854
  /**
6754
6855
  * `useCopilotReadable` is a React hook that provides app-state and other information
6755
6856
  * to the Copilot.
@@ -6820,6 +6921,20 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6820
6921
  */
6821
6922
  /**
6822
6923
  * Adds the given information to the Copilot context to make it readable by Copilot.
6924
+ * @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useAgentContext` from `@copilotkit/react-core/v2` instead.
6925
+ *
6926
+ * ```tsx
6927
+ * import { useAgentContext } from "@copilotkit/react-core/v2";
6928
+ *
6929
+ * function UserContext() {
6930
+ * useAgentContext({
6931
+ * description: "The current user",
6932
+ * value: { name: "Ada" },
6933
+ * });
6934
+ * return null;
6935
+ * }
6936
+ * ```
6937
+ * See https://docs.copilotkit.ai/reference/v2/hooks/useAgentContext
6823
6938
  */
6824
6939
  function useCopilotReadable({ description, value, convert, available = "enabled" }, dependencies) {
6825
6940
  const { copilotkit } = useCopilotKit();
@@ -6848,7 +6963,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6848
6963
  }
6849
6964
 
6850
6965
  //#endregion
6851
- //#region src/hooks/use-agent-nodename.ts
6966
+ //#region src/v1-deprecated/hooks/use-agent-nodename.ts
6852
6967
  /**
6853
6968
  * Tracks the node the agent is currently executing.
6854
6969
  *
@@ -6883,7 +6998,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
6883
6998
  }
6884
6999
 
6885
7000
  //#endregion
6886
- //#region src/hooks/use-coagent.ts
7001
+ //#region src/v1-deprecated/hooks/use-coagent.ts
6887
7002
  /**
6888
7003
  * <Callout type="info">
6889
7004
  * Usage of this hook assumes some additional setup in your application, for more information
@@ -7091,7 +7206,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7091
7206
  };
7092
7207
 
7093
7208
  //#endregion
7094
- //#region src/hooks/use-copilot-runtime-client.ts
7209
+ //#region src/v1-deprecated/hooks/use-copilot-runtime-client.ts
7095
7210
  const useCopilotRuntimeClient = (options) => {
7096
7211
  const { setBannerError } = useToast();
7097
7212
  const { showDevConsole, onError, ...runtimeOptions } = options;
@@ -7194,7 +7309,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7194
7309
  }
7195
7310
 
7196
7311
  //#endregion
7197
- //#region src/hooks/use-copilot-authenticated-action.ts
7312
+ //#region src/v1-deprecated/hooks/use-copilot-authenticated-action.ts
7198
7313
  /**
7199
7314
  * Hook to create an authenticated action that requires user sign-in before execution.
7200
7315
  *
@@ -7237,7 +7352,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7237
7352
  }
7238
7353
 
7239
7354
  //#endregion
7240
- //#region src/hooks/use-langgraph-interrupt.ts
7355
+ //#region src/v1-deprecated/hooks/use-langgraph-interrupt.ts
7241
7356
  /**
7242
7357
  * Transforms a v2 InterruptEvent into the v1 LangGraphInterruptEvent shape
7243
7358
  * expected by existing useLangGraphInterrupt callbacks.
@@ -7250,6 +7365,23 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7250
7365
  value
7251
7366
  };
7252
7367
  }
7368
+ /**
7369
+ * @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useInterrupt` from `@copilotkit/react-core/v2` instead.
7370
+ *
7371
+ * ```tsx
7372
+ * import { useInterrupt } from "@copilotkit/react-core/v2";
7373
+ *
7374
+ * function ApprovalInterrupt() {
7375
+ * useInterrupt({
7376
+ * render: ({ resolve }) => (
7377
+ * <button onClick={() => resolve({ approved: true })}>Approve</button>
7378
+ * ),
7379
+ * });
7380
+ * return null;
7381
+ * }
7382
+ * ```
7383
+ * See https://docs.copilotkit.ai/reference/v2/hooks/useInterrupt
7384
+ */
7253
7385
  function useLangGraphInterrupt(action, _dependencies) {
7254
7386
  const actionRef = (0, react.useRef)(action);
7255
7387
  actionRef.current = action;
@@ -7297,7 +7429,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7297
7429
  }
7298
7430
 
7299
7431
  //#endregion
7300
- //#region src/hooks/use-copilot-additional-instructions.ts
7432
+ //#region src/v1-deprecated/hooks/use-copilot-additional-instructions.ts
7301
7433
  /**
7302
7434
  * `useCopilotAdditionalInstructions` is a React hook that provides additional instructions
7303
7435
  * to the Copilot.
@@ -7356,7 +7488,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7356
7488
  }
7357
7489
 
7358
7490
  //#endregion
7359
- //#region src/hooks/use-default-tool.ts
7491
+ //#region src/v1-deprecated/hooks/use-default-tool.ts
7360
7492
  function useDefaultTool(tool, dependencies) {
7361
7493
  useCopilotAction({
7362
7494
  ...tool,
@@ -7365,7 +7497,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7365
7497
  }
7366
7498
 
7367
7499
  //#endregion
7368
- //#region src/hooks/use-copilot-chat-suggestions.tsx
7500
+ //#region src/v1-deprecated/hooks/use-copilot-chat-suggestions.tsx
7369
7501
  /**
7370
7502
  * <Callout type="warning">
7371
7503
  * useCopilotChatSuggestions is experimental. The interface is not final and
@@ -7437,7 +7569,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7437
7569
  }
7438
7570
 
7439
7571
  //#endregion
7440
- //#region src/types/frontend-action.ts
7572
+ //#region src/v1-deprecated/types/frontend-action.ts
7441
7573
  function processActionsForRuntimeRequest(actions) {
7442
7574
  return actions.filter((action) => action.available !== _copilotkit_runtime_client_gql.ActionInputAvailability.Disabled && action.disabled !== true && action.name !== "*" && action.available != "frontend" && !action.pairedAction).map((action) => {
7443
7575
  let available = _copilotkit_runtime_client_gql.ActionInputAvailability.Enabled;
@@ -7454,54 +7586,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7454
7586
  }
7455
7587
 
7456
7588
  //#endregion
7457
- //#region src/lib/copilot-task.ts
7458
- /**
7459
- * This class is used to execute one-off tasks, for example on button press. It can use the context available via [useCopilotReadable](/reference/v1/hooks/useCopilotReadable) and the actions provided by [useCopilotAction](/reference/v1/hooks/useCopilotAction), or you can provide your own context and actions.
7460
- *
7461
- * ## Example
7462
- * In the simplest case, use CopilotTask in the context of your app by giving it instructions on what to do.
7463
- *
7464
- * ```tsx
7465
- * import { CopilotTask, useCopilotContext } from "@copilotkit/react-core";
7466
- *
7467
- * export function MyComponent() {
7468
- * const context = useCopilotContext();
7469
- *
7470
- * const task = new CopilotTask({
7471
- * instructions: "Set a random message",
7472
- * actions: [
7473
- * {
7474
- * name: "setMessage",
7475
- * description: "Set the message.",
7476
- * argumentAnnotations: [
7477
- * {
7478
- * name: "message",
7479
- * type: "string",
7480
- * description:
7481
- * "A message to display.",
7482
- * required: true,
7483
- * },
7484
- * ],
7485
- * }
7486
- * ]
7487
- * });
7488
- *
7489
- * const executeTask = async () => {
7490
- * await task.run(context, action);
7491
- * }
7492
- *
7493
- * return (
7494
- * <>
7495
- * <button onClick={executeTask}>
7496
- * Execute task
7497
- * </button>
7498
- * </>
7499
- * )
7500
- * }
7501
- * ```
7502
- *
7503
- * Have a look at the [Presentation Example App](https://github.com/CopilotKit/CopilotKit/blob/main/examples/v1/next-openai/src/app/presentation/page.tsx) for a more complete example.
7504
- */
7589
+ //#region src/v1-deprecated/lib/copilot-task.ts
7505
7590
  var CopilotTask = class {
7506
7591
  constructor(config) {
7507
7592
  this.instructions = config.instructions;