@copilotkit/react-core 1.77.2 → 1.79.0

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/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_copilotkit = require('./copilotkit-D7_J5Hs_.cjs');
4
+ const require_copilotkit = require('./copilotkit-DjrKQjfL.cjs');
5
5
  let react = require("react");
6
6
  react = require_copilotkit.__toESM(react);
7
7
  let _copilotkit_core = require("@copilotkit/core");
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Af as Tree, Bf as FrontendActionAvailability, Cf as CrewsResponseStatus, Df as CopilotChatSuggestionConfiguration, Ef as CrewsToolStateItem, Ff as ActionRenderPropsWait, If as CatchAllActionRenderProps, Lf as CatchAllActionRenderPropsWait, Mf as ActionRenderProps, Nf as ActionRenderPropsNoArgs, Of as SystemMessageFunction, Pf as ActionRenderPropsNoArgsWait, Rf as CatchAllFrontendAction, Sf as CrewsResponse, Tf as CrewsTaskStateItem, Vf as RenderFunctionStatus, X as useAgent, _f as LangGraphInterruptRender, bf as QueuedInterruptEvent, cf as CoagentInChatRenderFunction, df as CopilotContextParams, ff as useCopilotContext, gf as LangGraphInterruptActionSetterArgs, hf as LangGraphInterruptActionSetter, jf as TreeNode, kf as DocumentPointer, lf as CopilotApiConfig, mf as LangGraphInterruptAction, n as defaultCopilotContextCategories, pf as CoAgentStateRender, r as CopilotKitProps, t as CopilotKit, uf as CopilotContext, vf as LangGraphInterruptRenderHandlerProps, wf as CrewsStateItem, xf as CrewsAgentState, xt as useRenderToolCall$1, yf as LangGraphInterruptRenderProps, zf as FrontendAction } from "./copilotkit-BQBy80gH.cjs";
1
+ import { Af as CopilotChatSuggestionConfiguration, Bf as CatchAllActionRenderPropsWait, Cf as QueuedInterruptEvent, Df as CrewsStateItem, Ef as CrewsResponseStatus, Ff as ActionRenderProps, Hf as FrontendAction, If as ActionRenderPropsNoArgs, Lf as ActionRenderPropsNoArgsWait, Mf as DocumentPointer, Nf as Tree, Of as CrewsTaskStateItem, Pf as TreeNode, Rf as ActionRenderPropsWait, Sf as LangGraphInterruptRenderProps, Tf as CrewsResponse, Uf as FrontendActionAvailability, Vf as CatchAllFrontendAction, Wf as RenderFunctionStatus, X as useAgent, _f as LangGraphInterruptAction, bf as LangGraphInterruptRender, df as CoagentInChatRenderFunction, ff as CopilotApiConfig, gf as CoAgentStateRender, hf as useCopilotContext, jf as SystemMessageFunction, kf as CrewsToolStateItem, mf as CopilotContextParams, n as defaultCopilotContextCategories, pf as CopilotContext, r as CopilotKitProps, t as CopilotKit, vf as LangGraphInterruptActionSetter, wf as CrewsAgentState, xf as LangGraphInterruptRenderHandlerProps, xt as useRenderToolCall$1, yf as LangGraphInterruptActionSetterArgs, zf as CatchAllActionRenderProps } from "./copilotkit-2Fbb5_CC.cjs";
2
2
  import "./v2/index.cjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { CopilotRuntimeClient, CopilotRuntimeClientOptions, ForwardedParametersInput, Message } from "@copilotkit/runtime-client-gql";
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Af as Tree, Bf as FrontendActionAvailability, Cf as CrewsResponseStatus, Df as CopilotChatSuggestionConfiguration, Ef as CrewsToolStateItem, Ff as ActionRenderPropsWait, If as CatchAllActionRenderProps, Lf as CatchAllActionRenderPropsWait, Mf as ActionRenderProps, Nf as ActionRenderPropsNoArgs, Of as SystemMessageFunction, Pf as ActionRenderPropsNoArgsWait, Rf as CatchAllFrontendAction, Sf as CrewsResponse, Tf as CrewsTaskStateItem, Vf as RenderFunctionStatus, X as useAgent, _f as LangGraphInterruptRender, bf as QueuedInterruptEvent, cf as CoagentInChatRenderFunction, df as CopilotContextParams, ff as useCopilotContext, gf as LangGraphInterruptActionSetterArgs, hf as LangGraphInterruptActionSetter, jf as TreeNode, kf as DocumentPointer, lf as CopilotApiConfig, mf as LangGraphInterruptAction, n as defaultCopilotContextCategories, pf as CoAgentStateRender, r as CopilotKitProps, t as CopilotKit, uf as CopilotContext, vf as LangGraphInterruptRenderHandlerProps, wf as CrewsStateItem, xf as CrewsAgentState, xt as useRenderToolCall$1, yf as LangGraphInterruptRenderProps, zf as FrontendAction } from "./copilotkit-DkLb1sf9.mjs";
1
+ import { Af as CopilotChatSuggestionConfiguration, Bf as CatchAllActionRenderPropsWait, Cf as QueuedInterruptEvent, Df as CrewsStateItem, Ef as CrewsResponseStatus, Ff as ActionRenderProps, Hf as FrontendAction, If as ActionRenderPropsNoArgs, Lf as ActionRenderPropsNoArgsWait, Mf as DocumentPointer, Nf as Tree, Of as CrewsTaskStateItem, Pf as TreeNode, Rf as ActionRenderPropsWait, Sf as LangGraphInterruptRenderProps, Tf as CrewsResponse, Uf as FrontendActionAvailability, Vf as CatchAllFrontendAction, Wf as RenderFunctionStatus, X as useAgent, _f as LangGraphInterruptAction, bf as LangGraphInterruptRender, df as CoagentInChatRenderFunction, ff as CopilotApiConfig, gf as CoAgentStateRender, hf as useCopilotContext, jf as SystemMessageFunction, kf as CrewsToolStateItem, mf as CopilotContextParams, n as defaultCopilotContextCategories, pf as CopilotContext, r as CopilotKitProps, t as CopilotKit, vf as LangGraphInterruptActionSetter, wf as CrewsAgentState, xf as LangGraphInterruptRenderHandlerProps, xt as useRenderToolCall$1, yf as LangGraphInterruptActionSetterArgs, zf as CatchAllActionRenderProps } from "./copilotkit-DFMMPW2I.mjs";
2
2
  import "./v2/index.mjs";
3
3
  import React, { ReactNode, RefObject, SetStateAction } from "react";
4
4
  import { StaticSuggestionsConfig, Suggestion } from "@copilotkit/core";
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { $ as useConfigureSuggestions, It as useCopilotChatConfiguration, Q as INTERRUPT_EVENT_NAME, Z as useInterrupt, _t as defineToolCallRenderer, a as ThreadsProvider, at as useHumanInTheLoop$1, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, et as useSuggestions, f as useToast, ft as useRenderCustomMessages, g as useCopilotContext, h as CopilotContext, i as ThreadsContext, it as useAgent, jt as useRenderToolCall$1, l as useCoAgentStateRenders, m as useCopilotMessagesContext, mt as useCopilotKit, n as defaultCopilotContextCategories, o as useThreads, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, ut as useFrontendTool$1 } from "./copilotkit-BI7KSQQw.mjs";
3
+ import { $ as useConfigureSuggestions, It as useCopilotChatConfiguration, Q as INTERRUPT_EVENT_NAME, Z as useInterrupt, _t as defineToolCallRenderer, a as ThreadsProvider, at as useHumanInTheLoop$1, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, et as useSuggestions, f as useToast, ft as useRenderCustomMessages, g as useCopilotContext, h as CopilotContext, i as ThreadsContext, it as useAgent, jt as useRenderToolCall$1, l as useCoAgentStateRenders, m as useCopilotMessagesContext, mt as useCopilotKit, n as defaultCopilotContextCategories, o as useThreads, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, ut as useFrontendTool$1 } from "./copilotkit-DQvE96lZ.mjs";
4
4
  import React, { Fragment, createElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
5
5
  import { CopilotKitCoreRuntimeConnectionStatus, ToolCallStatus, ɵisHttpAgent } from "@copilotkit/core";
6
6
  import { AGUIConnectNotImplementedError } from "@ag-ui/client";
package/dist/index.umd.js CHANGED
@@ -602,7 +602,7 @@ react_markdown = __toESM(react_markdown);
602
602
 
603
603
  //#endregion
604
604
  //#region package.json
605
- var version = "1.77.2";
605
+ var version = "1.79.0";
606
606
 
607
607
  //#endregion
608
608
  //#region src/v2/components/CopilotKitInspector.tsx
@@ -2234,8 +2234,9 @@ react_markdown = __toESM(react_markdown);
2234
2234
  const DEFAULT_LEARNING = Object.freeze({});
2235
2235
  function toLearningConfig(learning) {
2236
2236
  if (learning === true) return DEFAULT_LEARNING;
2237
- if (learning === false) return void 0;
2238
- return learning;
2237
+ if (learning === false || learning === void 0) return void 0;
2238
+ const { autoStart: _autoStart, ...config } = learning;
2239
+ return config;
2239
2240
  }
2240
2241
  function useStableArrayProp(prop, warningMessage, isMeaningfulChange) {
2241
2242
  const empty = (0, react.useMemo)(() => [], []);
@@ -2247,7 +2248,7 @@ react_markdown = __toESM(react_markdown);
2247
2248
  return value;
2248
2249
  }
2249
2250
  const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, messageFilter, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, agentId, showIntelligenceIndicator = true, useSingleEndpoint, onError, a2ui, defaultThrottleMs, debug, learning }) => {
2250
- const learningConfig = toLearningConfig(learning);
2251
+ const learningConfig = (0, react.useMemo)(() => toLearningConfig(learning), [learning]);
2251
2252
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
2252
2253
  const [inspectorVisible, setInspectorVisible] = (0, react.useState)(false);
2253
2254
  (0, react.useEffect)(() => {
@@ -2340,15 +2341,15 @@ react_markdown = __toESM(react_markdown);
2340
2341
  (0, react.useEffect)(() => {
2341
2342
  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.");
2342
2343
  }, [hasSelfManagedAgents, resolvedPublicKey]);
2343
- const headers = typeof headersProp === "function" ? headersProp() : headersProp;
2344
- const mergedHeaders = (0, react.useMemo)(() => {
2345
- if (!resolvedPublicKey) return headers;
2346
- if (headers[HEADER_NAME]) return headers;
2347
- return {
2348
- ...headers,
2349
- [HEADER_NAME]: resolvedPublicKey
2350
- };
2351
- }, [headers, resolvedPublicKey]);
2344
+ const headersRef = (0, react.useRef)(headersProp);
2345
+ headersRef.current = headersProp;
2346
+ const isHeadersBuilder = typeof headersProp === "function";
2347
+ const stableHeadersBuilder = (0, react.useCallback)(() => {
2348
+ const current = headersRef.current;
2349
+ return typeof current === "function" ? current() : current;
2350
+ }, []);
2351
+ const headersInput = isHeadersBuilder ? stableHeadersBuilder : headersProp;
2352
+ const headersSource = (0, react.useMemo)(() => (0, _copilotkit_core.ɵwithHeaderDefaults)(headersInput, resolvedPublicKey ? { [HEADER_NAME]: resolvedPublicKey } : {}), [headersInput, resolvedPublicKey]);
2352
2353
  if (!runtimeUrl && !resolvedPublicKey && !hasLocalAgents) {
2353
2354
  const message = "Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'";
2354
2355
  if (process.env.NODE_ENV === "production") throw new Error(message);
@@ -2473,7 +2474,7 @@ react_markdown = __toESM(react_markdown);
2473
2474
  runtimeUrl: chatApiEndpoint,
2474
2475
  deferInitialConnection: true,
2475
2476
  runtimeTransport: useSingleEndpoint === true ? "single" : useSingleEndpoint === false ? "rest" : "auto",
2476
- headers: mergedHeaders,
2477
+ headers: headersSource,
2477
2478
  credentials,
2478
2479
  messageFilter,
2479
2480
  properties,
@@ -2568,7 +2569,7 @@ react_markdown = __toESM(react_markdown);
2568
2569
  (0, react.useEffect)(() => {
2569
2570
  copilotkit.setRuntimeUrl(chatApiEndpoint);
2570
2571
  copilotkit.setRuntimeTransport(useSingleEndpoint === true ? "single" : useSingleEndpoint === false ? "rest" : "auto");
2571
- copilotkit.setHeaders(mergedHeaders);
2572
+ copilotkit.setHeaders(headersSource);
2572
2573
  copilotkit.setCredentials(credentials);
2573
2574
  copilotkit.setProperties(a2uiCatalogProvided ? {
2574
2575
  ...properties,
@@ -2580,7 +2581,7 @@ react_markdown = __toESM(react_markdown);
2580
2581
  }, [
2581
2582
  copilotkit,
2582
2583
  chatApiEndpoint,
2583
- mergedHeaders,
2584
+ headersSource,
2584
2585
  credentials,
2585
2586
  properties,
2586
2587
  a2uiCatalogProvided,
@@ -2589,15 +2590,25 @@ react_markdown = __toESM(react_markdown);
2589
2590
  debug
2590
2591
  ]);
2591
2592
  const learningEnabled = learningConfig !== void 0;
2592
- const generatesTrajectoryId = learning === true;
2593
- const suppliedTrajectoryId = learningConfig?.trajectoryId;
2593
+ const autoStart = learningEnabled && (typeof learning !== "object" || learning.autoStart !== false);
2594
+ const suppliedTrajectoryId = autoStart ? learningConfig?.trajectoryId : void 0;
2595
+ const generatesTrajectoryId = autoStart && suppliedTrajectoryId === void 0;
2594
2596
  const learningContainerIdsRef = (0, react.useRef)(learningConfig?.learningContainerIds);
2595
2597
  const generatedTrajectoryIdRef = (0, react.useRef)(void 0);
2596
2598
  (0, react.useEffect)(() => {
2597
2599
  copilotkit.setLearningConfig(learningConfig);
2598
2600
  learningContainerIdsRef.current = learningConfig?.learningContainerIds;
2599
- if (learningConfig?.sink === void 0 && learningConfig?.trajectoryId === void 0 && learningConfig?.learningContainerIds !== void 0) console.warn("[CopilotKit] learningContainerIds is supported only with a custom sink. Authenticated Trajectory capture does not assign Learning Containers; remove learningContainerIds from the capture options.");
2600
- }, [copilotkit, learningConfig]);
2601
+ if (learningConfig?.sink === void 0 && !autoStart && learningConfig?.learningContainerIds !== void 0) console.warn("[CopilotKit] learningContainerIds is supported only with a custom sink. Authenticated Trajectory capture does not assign Learning Containers; remove learningContainerIds from the capture options.");
2602
+ }, [
2603
+ copilotkit,
2604
+ learningConfig,
2605
+ autoStart
2606
+ ]);
2607
+ const ignoresTrajectoryId = !autoStart && learningConfig?.trajectoryId !== void 0;
2608
+ (0, react.useEffect)(() => {
2609
+ if (!ignoresTrajectoryId) return;
2610
+ console.warn("[CopilotKit] learning.trajectoryId is ignored when autoStart is false; pass the ID to startTrajectory() instead.");
2611
+ }, [ignoresTrajectoryId]);
2601
2612
  (0, react.useEffect)(() => {
2602
2613
  if (!generatesTrajectoryId) generatedTrajectoryIdRef.current = void 0;
2603
2614
  if (!learningEnabled) return;
@@ -2692,17 +2703,17 @@ react_markdown = __toESM(react_markdown);
2692
2703
  const hasNonReadyRuntimeEntitlement = runtimeEntitlements !== void 0 && runtimeEntitlements.status !== "ready";
2693
2704
  const hasLegacyRuntimeEntitlementFallback = runtimeLicenseStatus === "valid" || runtimeLicenseStatus === "expiring";
2694
2705
  const runtimeEntitlementRetryInProgress = retryableRuntimeEntitlementFailure && runtimeEntitlementRetryPending && !hasLegacyRuntimeEntitlementFallback;
2695
- const runtimeEntitlementFailureSettled = hasNonReadyRuntimeEntitlement && !runtimeEntitlementRetryInProgress && !hasLegacyRuntimeEntitlementFallback;
2706
+ const terminalRuntimeEntitlementFailure = hasNonReadyRuntimeEntitlement && !retryableRuntimeEntitlementFailure && !hasLegacyRuntimeEntitlementFallback;
2696
2707
  const licenseContextValue = (0, react.useMemo)(() => {
2697
2708
  const runtimeLicenseContext = (0, _copilotkit_shared.createLicenseContextValue)(runtimeEntitlementRetryInProgress ? void 0 : runtimeLicenseStatus, runtimeEntitlements);
2698
- if (!runtimeEntitlementFailureSettled) return runtimeLicenseContext;
2709
+ if (!terminalRuntimeEntitlementFailure) return runtimeLicenseContext;
2699
2710
  return {
2700
2711
  ...runtimeLicenseContext,
2701
2712
  checkFeature: () => false,
2702
2713
  getLimit: () => null
2703
2714
  };
2704
2715
  }, [
2705
- runtimeEntitlementFailureSettled,
2716
+ terminalRuntimeEntitlementFailure,
2706
2717
  runtimeEntitlementRetryInProgress,
2707
2718
  runtimeEntitlements,
2708
2719
  runtimeLicenseStatus
@@ -5270,6 +5281,16 @@ react_markdown = __toESM(react_markdown);
5270
5281
 
5271
5282
  //#endregion
5272
5283
  //#region src/v1-deprecated/components/copilot-provider/copilotkit.tsx
5284
+ /**
5285
+ * Drops `null`/`undefined` entries so a `CopilotKitHeadersSource` record (or
5286
+ * a builder's resolved record) matches `CopilotApiConfig.headers`'s
5287
+ * `Record<string, string>` shape. Mirrors core's own (internal-only)
5288
+ * `normalizeHeaders`.
5289
+ */
5290
+ function normalizeV1Headers(headers) {
5291
+ if (!headers) return {};
5292
+ return Object.fromEntries(Object.entries(headers).filter((entry) => entry[1] != null));
5293
+ }
5273
5294
  function CopilotKit({ children, ...props }) {
5274
5295
  const enabled = shouldShowDevConsole(props.showDevConsole);
5275
5296
  const publicApiKey = props.publicApiKey || props.publicLicenseKey;
@@ -5349,6 +5370,13 @@ react_markdown = __toESM(react_markdown);
5349
5370
  * This will throw an error if the props are invalid.
5350
5371
  */
5351
5372
  validateProps(cpkProps);
5373
+ const headersPropRef = (0, react.useRef)(props.headers);
5374
+ headersPropRef.current = props.headers;
5375
+ const headersBuilderStateRef = (0, react.useRef)({
5376
+ fn: void 0,
5377
+ isAsync: false
5378
+ });
5379
+ const warnedAsyncHeadersRef = (0, react.useRef)(false);
5352
5380
  const publicApiKey = props.publicLicenseKey || props.publicApiKey;
5353
5381
  const chatApiEndpoint = props.runtimeUrl || _copilotkit_shared.COPILOT_CLOUD_CHAT_URL;
5354
5382
  const [actions, setActions] = (0, react.useState)({});
@@ -5416,19 +5444,46 @@ react_markdown = __toESM(react_markdown);
5416
5444
  validTopics: props.guardrails_c?.validTopics || [],
5417
5445
  invalidTopics: props.guardrails_c?.invalidTopics || []
5418
5446
  } } } };
5419
- return {
5447
+ const config = {
5420
5448
  publicApiKey,
5421
5449
  ...cloud ? { cloud } : {},
5422
5450
  chatApiEndpoint,
5423
- headers: typeof props.headers === "function" ? props.headers() : props.headers || {},
5424
5451
  properties: props.properties || {},
5425
5452
  transcribeAudioUrl: props.transcribeAudioUrl,
5426
5453
  textToSpeechUrl: props.textToSpeechUrl,
5427
5454
  credentials: props.credentials
5428
5455
  };
5456
+ Object.defineProperty(config, "headers", {
5457
+ enumerable: true,
5458
+ configurable: true,
5459
+ get() {
5460
+ const source = headersPropRef.current;
5461
+ if (typeof source !== "function") return normalizeV1Headers(source);
5462
+ const state = headersBuilderStateRef.current;
5463
+ if (state.fn === source && state.isAsync) return {};
5464
+ const result = source();
5465
+ if (typeof result === "object" && result !== null && typeof result.then === "function") {
5466
+ headersBuilderStateRef.current = {
5467
+ fn: source,
5468
+ isAsync: true
5469
+ };
5470
+ result.then(void 0, () => {});
5471
+ if (process.env.NODE_ENV !== "production" && !warnedAsyncHeadersRef.current) {
5472
+ warnedAsyncHeadersRef.current = true;
5473
+ console.warn("[CopilotKit] An async `headers` builder is not supported by the v1 CopilotTask / GraphQL path; its headers are not sent there.");
5474
+ }
5475
+ return {};
5476
+ }
5477
+ headersBuilderStateRef.current = {
5478
+ fn: source,
5479
+ isAsync: false
5480
+ };
5481
+ return normalizeV1Headers(result);
5482
+ }
5483
+ });
5484
+ return config;
5429
5485
  }, [
5430
5486
  publicApiKey,
5431
- props.headers,
5432
5487
  props.properties,
5433
5488
  props.transcribeAudioUrl,
5434
5489
  props.textToSpeechUrl,
@@ -5436,27 +5491,6 @@ react_markdown = __toESM(react_markdown);
5436
5491
  props.cloudRestrictToTopic,
5437
5492
  props.guardrails_c
5438
5493
  ]);
5439
- (0, react.useMemo)(() => {
5440
- const authHeaders = Object.values(authStates || {}).reduce((acc, state) => {
5441
- if (state.status === "authenticated" && state.authHeaders) return {
5442
- ...acc,
5443
- ...Object.entries(state.authHeaders).reduce((headers, [key, value]) => ({
5444
- ...headers,
5445
- [key.startsWith("X-Custom-") ? key : `X-Custom-${key}`]: value
5446
- }), {})
5447
- };
5448
- return acc;
5449
- }, {});
5450
- return {
5451
- ...copilotApiConfig.headers,
5452
- ...copilotApiConfig.publicApiKey ? { [_copilotkit_shared.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {},
5453
- ...authHeaders
5454
- };
5455
- }, [
5456
- copilotApiConfig.headers,
5457
- copilotApiConfig.publicApiKey,
5458
- authStates
5459
- ]);
5460
5494
  const [internalErrorHandlers, _setInternalErrorHandler] = (0, react.useState)({});
5461
5495
  const setInternalErrorHandler = (0, react.useCallback)((handler) => {
5462
5496
  _setInternalErrorHandler((prev) => ({