@copilotkit/react-core 1.78.0 → 1.79.1-canary.1792034358

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.
@@ -1,6 +1,6 @@
1
1
  import * as React$1 from "react";
2
2
  import React, { createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
3
- import { AgentRegistry, AgentThreadLockedError, ContextStore, CopilotKitCore, CopilotKitCore as CopilotKitCore$1, CopilotKitCoreErrorCode, CopilotKitCoreErrorCode as CopilotKitCoreErrorCode$1, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreRuntimeConnectionStatus as CopilotKitCoreRuntimeConnectionStatus$1, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, IntelligenceAgent, MEMORY_ERROR_REGISTRY, MemoryError, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgent as ProxiedCopilotRuntimeAgent$1, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, WebMCPRegistry, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread, emitInspectorActiveThread as emitInspectorActiveThread$1, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, emitInspectorViewThreadResult as emitInspectorViewThreadResult$1, empty, ensureObjectArgs, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isInspectorThreadBridgeEnabled as isInspectorThreadBridgeEnabled$1, isRunCompletionAware, isRunCompletionAware as isRunCompletionAware$1, ofType, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorStopViewing as onInspectorStopViewing$1, onInspectorViewThread, onInspectorViewThread as onInspectorViewThread$1, onInspectorViewThreadResult, parseToolArguments, props, select, ɵCOPILOTKIT_FEATURES, ɵInterruptState, ɵInterruptState as ɵInterruptState$1, ɵMAX_SOCKET_RETRIES, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵcreateMemoryStore, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadStore as ɵcreateThreadStore$1, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisHttpAgent as ɵisHttpAgent$1, ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵselectFetchMoreError, ɵselectFetchMoreError as ɵselectFetchMoreError$1, ɵselectHasNextPage, ɵselectHasNextPage as ɵselectHasNextPage$1, ɵselectIsFetchingNextPage, ɵselectIsFetchingNextPage as ɵselectIsFetchingNextPage$1, ɵselectIsMutating, ɵselectIsMutating as ɵselectIsMutating$1, ɵselectMemories, ɵselectMemories as ɵselectMemories$1, ɵselectMemoriesAvailable, ɵselectMemoriesAvailable as ɵselectMemoriesAvailable$1, ɵselectMemoriesError, ɵselectMemoriesError as ɵselectMemoriesError$1, ɵselectMemoriesIsLoading, ɵselectMemoriesIsLoading as ɵselectMemoriesIsLoading$1, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectMemoriesRealtimeStatus as ɵselectMemoriesRealtimeStatus$1, ɵselectThreads, ɵselectThreads as ɵselectThreads$1, ɵselectThreadsError, ɵselectThreadsError as ɵselectThreadsError$1, ɵselectThreadsIsLoading, ɵselectThreadsIsLoading as ɵselectThreadsIsLoading$1, ɵthreadAdapterEvents } from "@copilotkit/core";
3
+ import { AgentRegistry, AgentThreadLockedError, ContextStore, CopilotKitCore, CopilotKitCore as CopilotKitCore$1, CopilotKitCoreErrorCode, CopilotKitCoreErrorCode as CopilotKitCoreErrorCode$1, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreRuntimeConnectionStatus as CopilotKitCoreRuntimeConnectionStatus$1, CopilotKitHeaderResolutionError, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, IntelligenceAgent, IntelligenceReplayFailedError, MEMORY_ERROR_REGISTRY, MemoryError, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgent as ProxiedCopilotRuntimeAgent$1, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, WebMCPRegistry, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread, emitInspectorActiveThread as emitInspectorActiveThread$1, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, emitInspectorViewThreadResult as emitInspectorViewThreadResult$1, empty, ensureObjectArgs, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isInspectorThreadBridgeEnabled as isInspectorThreadBridgeEnabled$1, isRunCompletionAware, isRunCompletionAware as isRunCompletionAware$1, ofType, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorStopViewing as onInspectorStopViewing$1, onInspectorViewThread, onInspectorViewThread as onInspectorViewThread$1, onInspectorViewThreadResult, parseToolArguments, props, select, ɵCOPILOTKIT_FEATURES, ɵInterruptState, ɵInterruptState as ɵInterruptState$1, ɵMAX_SOCKET_RETRIES, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵcreateMemoryStore, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadStore as ɵcreateThreadStore$1, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisHttpAgent as ɵisHttpAgent$1, ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵselectFetchMoreError, ɵselectFetchMoreError as ɵselectFetchMoreError$1, ɵselectHasNextPage, ɵselectHasNextPage as ɵselectHasNextPage$1, ɵselectIsFetchingNextPage, ɵselectIsFetchingNextPage as ɵselectIsFetchingNextPage$1, ɵselectIsMutating, ɵselectIsMutating as ɵselectIsMutating$1, ɵselectMemories, ɵselectMemories as ɵselectMemories$1, ɵselectMemoriesAvailable, ɵselectMemoriesAvailable as ɵselectMemoriesAvailable$1, ɵselectMemoriesError, ɵselectMemoriesError as ɵselectMemoriesError$1, ɵselectMemoriesIsLoading, ɵselectMemoriesIsLoading as ɵselectMemoriesIsLoading$1, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectMemoriesRealtimeStatus as ɵselectMemoriesRealtimeStatus$1, ɵselectThreads, ɵselectThreads as ɵselectThreads$1, ɵselectThreadsError, ɵselectThreadsError as ɵselectThreadsError$1, ɵselectThreadsIsLoading, ɵselectThreadsIsLoading as ɵselectThreadsIsLoading$1, ɵthreadAdapterEvents, ɵwithHeaderDefaults, ɵwithHeaderDefaults as ɵwithHeaderDefaults$1 } from "@copilotkit/core";
4
4
  import { ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError as AGUIConnectNotImplementedError$1, AGUIError, AGUI_METADATA_KEY, AbstractAgent as AbstractAgent$1, BackwardCompatibility_0_0_39, BackwardCompatibility_0_0_45, BackwardCompatibility_0_0_57, CompatibilityBoundary, DebugLogger, EventType, FilterToolCallsMiddleware, FunctionMiddleware, HttpAgent, Middleware, PROTOCOL_VERSION, aggregateTokenUsage, authoritativeActivityTypes, buildResumeArray, compactEvents, contentHasMedia, contentToText as contentToText$1, convertToLegacyEvents, createDebugLogger, defaultApplyEvents, enforceEvents, enforceOutgoingInput, getRunOutcome, isInterruptExpired, isRecognizedEvent, mergeMetadata, omitOptionalNulls, parseProtoStream, parseSSEStream, randomUUID, randomUUID as randomUUID$2, resolveAgentDebugConfig, resolveDebugLogger, runHttpRequest, structuredClone_, tokenUsageFromAiSdkUsage, tokenUsageFromLangChainMetadata, transformChunks, transformHttpEventStream, verifyEvents, withAuthoritativeActivityTypes } from "@ag-ui/client";
5
5
  import { ActivityDeltaEventSchema, ActivityMessageSchema, ActivitySnapshotEventSchema, AddOperationSchema, AgentCapabilitiesSchema, AssistantMessageSchema, AttributableSchema, AudioInputContentSchema, AudioInputPartSchema, AudioPartSchema, BaseEventSchema, BaseMessageSchema, ContentPartSchema, ContextSchema, CopyOperationSchema, CustomEventSchema, DataSourceSchema, DeveloperMessageSchema, DocumentInputContentSchema, DocumentInputPartSchema, DocumentPartSchema, EventSchema, EventSchemas, EventTypeSchema, ExecutionCapabilitiesSchema, FileSourceSchema, FunctionCallSchema, HumanInTheLoopCapabilitiesSchema, IdentityCapabilitiesSchema, ImageInputContentSchema, ImageInputPartSchema, ImagePartSchema, InputContentDataSourceSchema, InputContentSchema, InputContentSourceSchema, InputContentUrlSourceSchema, InterruptSchema, JsonPatchOperationSchema, JsonPatchSchema, JsonPointerSchema, MessageSchema, MessagesSnapshotEventSchema, MetadataSchema, MoveOperationSchema, MultiAgentCapabilitiesSchema, MultimodalCapabilitiesSchema, MultimodalInputCapabilitiesSchema, MultimodalOutputCapabilitiesSchema, OptionalMetadataSchema, OutputCapabilitiesSchema, PartSourceSchema, RawEventSchema, ReasoningCapabilitiesSchema, ReasoningEncryptedValueEventSchema, ReasoningEncryptedValueSubtypeSchema, ReasoningEndEventSchema, ReasoningMessageChunkEventSchema, ReasoningMessageContentEventSchema, ReasoningMessageEndEventSchema, ReasoningMessageSchema, ReasoningMessageStartEventSchema, ReasoningStartEventSchema, RemoveOperationSchema, ReplaceOperationSchema, ResumeEntrySchema, RoleSchema, RunAgentInputSchema, RunErrorEventSchema, RunFinishedCancelledOutcomeSchema, RunFinishedEventSchema, RunFinishedInterruptOutcomeSchema, RunFinishedOutcomeSchema, RunFinishedSuccessOutcomeSchema, RunStartedEventSchema, StateCapabilitiesSchema, StateDeltaEventSchema, StateSchema, StateSnapshotEventSchema, StepFinishedEventSchema, StepStartedEventSchema, SubagentErrorEventSchema, SubagentFinishedEventSchema, SubagentFinishedOutcomeSchema, SubagentFinishedSuccessOutcomeSchema, SubagentFinishedSuspendedOutcomeSchema, SubagentInfoSchema, SubagentRunIdSchema, SubagentStartedEventSchema, SystemMessageSchema, TestOperationSchema, TextInputContentSchema, TextMessageChunkEventSchema, TextMessageContentEventSchema, TextMessageEndEventSchema, TextMessageRoleSchema, TextMessageStartEventSchema, TextPartSchema, TokenUsageSchema, ToolCallArgsEventSchema, ToolCallChunkEventSchema, ToolCallEndEventSchema, ToolCallResultEventSchema, ToolCallSchema, ToolCallStartEventSchema, ToolMessageSchema, ToolSchema, ToolsCapabilitiesSchema, TransportCapabilitiesSchema, UrlSourceSchema, UserMessageSchema, VideoInputContentSchema, VideoInputPartSchema, VideoPartSchema } from "@ag-ui/core/schemas";
6
6
  import { extendTailwindMerge, twMerge } from "tailwind-merge";
@@ -1626,7 +1626,7 @@ function useRenderToolCall() {
1626
1626
 
1627
1627
  //#endregion
1628
1628
  //#region package.json
1629
- var version = "1.78.0";
1629
+ var version = "1.79.1-canary.1792034358";
1630
1630
 
1631
1631
  //#endregion
1632
1632
  //#region src/v2/components/CopilotKitInspector.tsx
@@ -3493,15 +3493,15 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3493
3493
  useEffect(() => {
3494
3494
  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.");
3495
3495
  }, [hasSelfManagedAgents, resolvedPublicKey]);
3496
- const headers = typeof headersProp === "function" ? headersProp() : headersProp;
3497
- const mergedHeaders = useMemo(() => {
3498
- if (!resolvedPublicKey) return headers;
3499
- if (headers[HEADER_NAME]) return headers;
3500
- return {
3501
- ...headers,
3502
- [HEADER_NAME]: resolvedPublicKey
3503
- };
3504
- }, [headers, resolvedPublicKey]);
3496
+ const headersRef = useRef(headersProp);
3497
+ headersRef.current = headersProp;
3498
+ const isHeadersBuilder = typeof headersProp === "function";
3499
+ const stableHeadersBuilder = useCallback(() => {
3500
+ const current = headersRef.current;
3501
+ return typeof current === "function" ? current() : current;
3502
+ }, []);
3503
+ const headersInput = isHeadersBuilder ? stableHeadersBuilder : headersProp;
3504
+ const headersSource = useMemo(() => ɵwithHeaderDefaults(headersInput, resolvedPublicKey ? { [HEADER_NAME]: resolvedPublicKey } : {}), [headersInput, resolvedPublicKey]);
3505
3505
  if (!runtimeUrl && !resolvedPublicKey && !hasLocalAgents) {
3506
3506
  const message = "Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'";
3507
3507
  if (process.env.NODE_ENV === "production") throw new Error(message);
@@ -3626,7 +3626,7 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3626
3626
  runtimeUrl: chatApiEndpoint,
3627
3627
  deferInitialConnection: true,
3628
3628
  runtimeTransport: useSingleEndpoint === true ? "single" : useSingleEndpoint === false ? "rest" : "auto",
3629
- headers: mergedHeaders,
3629
+ headers: headersSource,
3630
3630
  credentials,
3631
3631
  messageFilter,
3632
3632
  properties,
@@ -3721,7 +3721,7 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3721
3721
  useEffect(() => {
3722
3722
  copilotkit.setRuntimeUrl(chatApiEndpoint);
3723
3723
  copilotkit.setRuntimeTransport(useSingleEndpoint === true ? "single" : useSingleEndpoint === false ? "rest" : "auto");
3724
- copilotkit.setHeaders(mergedHeaders);
3724
+ copilotkit.setHeaders(headersSource);
3725
3725
  copilotkit.setCredentials(credentials);
3726
3726
  copilotkit.setProperties(a2uiCatalogProvided ? {
3727
3727
  ...properties,
@@ -3733,7 +3733,7 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3733
3733
  }, [
3734
3734
  copilotkit,
3735
3735
  chatApiEndpoint,
3736
- mergedHeaders,
3736
+ headersSource,
3737
3737
  credentials,
3738
3738
  properties,
3739
3739
  a2uiCatalogProvided,
@@ -3750,7 +3750,7 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3750
3750
  useEffect(() => {
3751
3751
  copilotkit.setLearningConfig(learningConfig);
3752
3752
  learningContainerIdsRef.current = learningConfig?.learningContainerIds;
3753
- 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.");
3753
+ if (learningConfig?.sink === void 0 && !autoStart && learningConfig?.learningContainerIds !== void 0) console.warn("[CopilotKit] learningContainerIds is supported only with a custom sink. Authenticated Trajectory capture ignores it; assign Learning Spaces on the server with getTrajectoryLearningContainerIds on CopilotKitIntelligence, and remove learningContainerIds from the capture options.");
3754
3754
  }, [
3755
3755
  copilotkit,
3756
3756
  learningConfig,
@@ -5357,9 +5357,7 @@ function useThreads$1({ agentId, includeArchived, limit, enabled = true }) {
5357
5357
  const hasMoreThreads = useThreadStoreSelector(store, ɵselectHasNextPage);
5358
5358
  const isFetchingMoreThreads = useThreadStoreSelector(store, ɵselectIsFetchingNextPage);
5359
5359
  const isMutating = useThreadStoreSelector(store, ɵselectIsMutating);
5360
- const headersKey = useMemo(() => {
5361
- return JSON.stringify(Object.entries(copilotkit.headers ?? {}).sort(([left], [right]) => left.localeCompare(right)));
5362
- }, [copilotkit.headers]);
5360
+ const headersKey = copilotkit.ɵheadersGeneration;
5363
5361
  const runtimeStatus = copilotkit.runtimeConnectionStatus;
5364
5362
  const threadListEndpointSupported = copilotkit.threadEndpoints?.list !== false;
5365
5363
  const threadMutationsSupported = copilotkit.threadEndpoints?.mutations !== false;
@@ -5424,7 +5422,6 @@ function useThreads$1({ agentId, includeArchived, limit, enabled = true }) {
5424
5422
  }
5425
5423
  const context = {
5426
5424
  runtimeUrl: copilotkit.runtimeUrl,
5427
- headers: { ...copilotkit.headers },
5428
5425
  wsUrl: copilotkit.intelligence?.wsUrl,
5429
5426
  agentId,
5430
5427
  includeArchived,
@@ -5552,7 +5549,9 @@ function useMemories() {
5552
5549
  *
5553
5550
  * The function uses the same transport as `useLearnFromUserAction`:
5554
5551
  * - `runtimeUrl` from `copilotkit.runtimeUrl` (BFF proxies to the platform)
5555
- * - `headers` from `copilotkit.headers` (customer auth forwarded to BFF)
5552
+ * - `fetch: copilotkit.ɵruntimeFetch`, which adds the current core headers at
5553
+ * send time (#1937); `headers` here is only for extra request-specific
5554
+ * headers on top of that
5556
5555
  * - `clientEventId` auto-generated via `randomUUID()` when omitted
5557
5556
  * - `userId` is resolved server-side by the runtime; the client never sends it
5558
5557
  * - Errors propagate to the caller (fire-and-propagate, not fire-and-forget)
@@ -5644,7 +5643,7 @@ function useLearnFromUserAction() {
5644
5643
  return recordAnnotation({
5645
5644
  fetch: copilotkit.ɵruntimeFetch,
5646
5645
  runtimeUrl,
5647
- headers: copilotkit.headers ?? {},
5646
+ headers: {},
5648
5647
  type: "user_action",
5649
5648
  payload: Object.keys(payload).length > 0 ? payload : void 0,
5650
5649
  threadId: input.threadId,
@@ -5972,16 +5971,13 @@ function useLearningContainers({ threadId, learningContainers }) {
5972
5971
  /** Guards the missing-runtimeUrl warning so it fires at most once per hook instance. */
5973
5972
  const warnedMissingUrlRef = useRef(false);
5974
5973
  const runtimeUrlRef = useRef(copilotkit.runtimeUrl);
5975
- const headersRef = useRef(copilotkit.headers ?? {});
5976
5974
  const runtimeFetchRef = useRef(copilotkit.ɵruntimeFetch);
5977
5975
  runtimeUrlRef.current = copilotkit.runtimeUrl;
5978
- headersRef.current = copilotkit.headers ?? {};
5979
5976
  runtimeFetchRef.current = copilotkit.ɵruntimeFetch;
5980
5977
  const key = JSON.stringify(learningContainers);
5981
5978
  const defaultKey = JSON.stringify(DEFAULT_CONTAINERS);
5982
5979
  useEffect(() => {
5983
5980
  const runtimeUrl = copilotkit.runtimeUrl;
5984
- const headers = copilotkit.headers ?? {};
5985
5981
  /**
5986
5982
  * Fire-and-forget emit; errors must not surface in render.
5987
5983
  * Failures are logged as warnings so they are diagnosable without
@@ -5998,7 +5994,7 @@ function useLearningContainers({ threadId, learningContainers }) {
5998
5994
  recordAnnotation({
5999
5995
  fetch: copilotkit.ɵruntimeFetch,
6000
5996
  runtimeUrl,
6001
- headers,
5997
+ headers: {},
6002
5998
  type: "set_learning_containers",
6003
5999
  payload: { containers },
6004
6000
  threadId
@@ -6022,11 +6018,10 @@ function useLearningContainers({ threadId, learningContainers }) {
6022
6018
  const capturedThreadId = threadId;
6023
6019
  return () => {
6024
6020
  const capturedRuntimeUrl = runtimeUrlRef.current;
6025
- const capturedHeaders = headersRef.current;
6026
6021
  if (capturedRuntimeUrl) recordAnnotation({
6027
6022
  fetch: runtimeFetchRef.current,
6028
6023
  runtimeUrl: capturedRuntimeUrl,
6029
- headers: capturedHeaders,
6024
+ headers: {},
6030
6025
  type: "set_learning_containers",
6031
6026
  payload: { containers: DEFAULT_CONTAINERS },
6032
6027
  threadId: capturedThreadId
@@ -8832,7 +8827,7 @@ async function transcribeAudio(core, audioBlob, filename = "recording.webm") {
8832
8827
  message: "Runtime URL is not configured",
8833
8828
  retryable: false
8834
8829
  });
8835
- const headers = { ...core.headers };
8830
+ const headers = { ...await core.resolveHeaders() };
8836
8831
  let response;
8837
8832
  try {
8838
8833
  if (core.runtimeTransport === "single") {
@@ -9244,7 +9239,6 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
9244
9239
  threadStore.start();
9245
9240
  const context = copilotkit.runtimeUrl ? {
9246
9241
  runtimeUrl: copilotkit.runtimeUrl,
9247
- headers: { ...copilotkit.headers },
9248
9242
  wsUrl: copilotkit.intelligence?.wsUrl,
9249
9243
  agentId: resolvedAgentId
9250
9244
  } : null;
@@ -9340,7 +9334,7 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
9340
9334
  hasNativeIntelligenceRunActivity,
9341
9335
  copilotkit.runtimeConnectionStatus,
9342
9336
  copilotkit.runtimeUrl,
9343
- copilotkit.headers,
9337
+ copilotkit.ɵheadersGeneration,
9344
9338
  copilotkit.intelligence?.wsUrl,
9345
9339
  copilotkit.threadEndpoints?.realtimeMetadata,
9346
9340
  standaloneRunActivityStore,
@@ -12331,6 +12325,16 @@ function CopilotListeners() {
12331
12325
 
12332
12326
  //#endregion
12333
12327
  //#region src/v1-deprecated/components/copilot-provider/copilotkit.tsx
12328
+ /**
12329
+ * Drops `null`/`undefined` entries so a `CopilotKitHeadersSource` record (or
12330
+ * a builder's resolved record) matches `CopilotApiConfig.headers`'s
12331
+ * `Record<string, string>` shape. Mirrors core's own (internal-only)
12332
+ * `normalizeHeaders`.
12333
+ */
12334
+ function normalizeV1Headers(headers) {
12335
+ if (!headers) return {};
12336
+ return Object.fromEntries(Object.entries(headers).filter((entry) => entry[1] != null));
12337
+ }
12334
12338
  function CopilotKit({ children, ...props }) {
12335
12339
  const enabled = shouldShowDevConsole(props.showDevConsole);
12336
12340
  const publicApiKey = props.publicApiKey || props.publicLicenseKey;
@@ -12410,6 +12414,13 @@ function CopilotKitInternal(cpkProps) {
12410
12414
  * This will throw an error if the props are invalid.
12411
12415
  */
12412
12416
  validateProps(cpkProps);
12417
+ const headersPropRef = useRef(props.headers);
12418
+ headersPropRef.current = props.headers;
12419
+ const headersBuilderStateRef = useRef({
12420
+ fn: void 0,
12421
+ isAsync: false
12422
+ });
12423
+ const warnedAsyncHeadersRef = useRef(false);
12413
12424
  const publicApiKey = props.publicLicenseKey || props.publicApiKey;
12414
12425
  const chatApiEndpoint = props.runtimeUrl || COPILOT_CLOUD_CHAT_URL;
12415
12426
  const [actions, setActions] = useState({});
@@ -12477,19 +12488,46 @@ function CopilotKitInternal(cpkProps) {
12477
12488
  validTopics: props.guardrails_c?.validTopics || [],
12478
12489
  invalidTopics: props.guardrails_c?.invalidTopics || []
12479
12490
  } } } };
12480
- return {
12491
+ const config = {
12481
12492
  publicApiKey,
12482
12493
  ...cloud ? { cloud } : {},
12483
12494
  chatApiEndpoint,
12484
- headers: typeof props.headers === "function" ? props.headers() : props.headers || {},
12485
12495
  properties: props.properties || {},
12486
12496
  transcribeAudioUrl: props.transcribeAudioUrl,
12487
12497
  textToSpeechUrl: props.textToSpeechUrl,
12488
12498
  credentials: props.credentials
12489
12499
  };
12500
+ Object.defineProperty(config, "headers", {
12501
+ enumerable: true,
12502
+ configurable: true,
12503
+ get() {
12504
+ const source = headersPropRef.current;
12505
+ if (typeof source !== "function") return normalizeV1Headers(source);
12506
+ const state = headersBuilderStateRef.current;
12507
+ if (state.fn === source && state.isAsync) return {};
12508
+ const result = source();
12509
+ if (typeof result === "object" && result !== null && typeof result.then === "function") {
12510
+ headersBuilderStateRef.current = {
12511
+ fn: source,
12512
+ isAsync: true
12513
+ };
12514
+ result.then(void 0, () => {});
12515
+ if (process.env.NODE_ENV !== "production" && !warnedAsyncHeadersRef.current) {
12516
+ warnedAsyncHeadersRef.current = true;
12517
+ console.warn("[CopilotKit] An async `headers` builder is not supported by the v1 CopilotTask / GraphQL path; its headers are not sent there.");
12518
+ }
12519
+ return {};
12520
+ }
12521
+ headersBuilderStateRef.current = {
12522
+ fn: source,
12523
+ isAsync: false
12524
+ };
12525
+ return normalizeV1Headers(result);
12526
+ }
12527
+ });
12528
+ return config;
12490
12529
  }, [
12491
12530
  publicApiKey,
12492
- props.headers,
12493
12531
  props.properties,
12494
12532
  props.transcribeAudioUrl,
12495
12533
  props.textToSpeechUrl,
@@ -12497,27 +12535,6 @@ function CopilotKitInternal(cpkProps) {
12497
12535
  props.cloudRestrictToTopic,
12498
12536
  props.guardrails_c
12499
12537
  ]);
12500
- useMemo(() => {
12501
- const authHeaders = Object.values(authStates || {}).reduce((acc, state) => {
12502
- if (state.status === "authenticated" && state.authHeaders) return {
12503
- ...acc,
12504
- ...Object.entries(state.authHeaders).reduce((headers, [key, value]) => ({
12505
- ...headers,
12506
- [key.startsWith("X-Custom-") ? key : `X-Custom-${key}`]: value
12507
- }), {})
12508
- };
12509
- return acc;
12510
- }, {});
12511
- return {
12512
- ...copilotApiConfig.headers,
12513
- ...copilotApiConfig.publicApiKey ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {},
12514
- ...authHeaders
12515
- };
12516
- }, [
12517
- copilotApiConfig.headers,
12518
- copilotApiConfig.publicApiKey,
12519
- authStates
12520
- ]);
12521
12538
  const [internalErrorHandlers, _setInternalErrorHandler] = useState({});
12522
12539
  const setInternalErrorHandler = useCallback((handler) => {
12523
12540
  _setInternalErrorHandler((prev) => ({
@@ -12832,5 +12849,5 @@ function validateProps(props) {
12832
12849
  }
12833
12850
 
12834
12851
  //#endregion
12835
- export { useConfigureSuggestions as $, ɵselectMemoriesRealtimeStatus$1 as $a, omitOptionalNulls as $i, MultimodalCapabilitiesSchema as $n, TextMessageRoleSchema as $r, AudioPartSchema as $t, CopilotChatMessageView as A, ɵisHttpAgent$1 as Aa, createEffect as Ai, HumanInTheLoopCapabilitiesSchema as An, RunStartedEventSchema as Ar, CopilotKitInspector as At, CopilotChatUserMessage_default as B, ɵobservePhoenixSocketHealth$ as Ba, empty as Bi, IntelligenceAgent as Bn, SubagentFinishedOutcomeSchema as Br, AGUI_METADATA_KEY as Bt, CopilotModalHeader as C, ɵMAX_SOCKET_RETRIES as Ca, compactEvents as Ci, EventTypeSchema as Cn, RunErrorEventSchema as Cr, OpenGenerativeUIToolRenderer as Ct, CopilotChat as D, ɵcreateThreadSelectors as Da, convertToLegacyEvents as Di, FunctionCallSchema as Dn, RunFinishedOutcomeSchema as Dr, MCPAppsActivityRenderer as Dt, DefaultOpenIcon as E, ɵcreateMemoryStore as Ea, contentToText$1 as Ei, FilterToolCallsMiddleware as En, RunFinishedInterruptOutcomeSchema as Er, MCPAppsActivityContentSchema as Et, getIntelligenceTurnAnchors as F, ɵmemoryDomainEvents as Fa, defaultApplyEvents as Fi, ImagePartSchema as Fn, StateSnapshotEventSchema as Fr, CopilotChatConfigurationProvider as Ft, useLearningContainers as G, ɵselectHasNextPage$1 as Ga, getWebMCPModelContext as Gi, MEMORY_ERROR_REGISTRY as Gn, SubagentStartedEventSchema as Gr, AddOperationSchema as Gt, CopilotChatAssistantMessage_default as H, ɵphoenixChannel$ as Ha, enforceOutgoingInput as Hi, JsonPatchOperationSchema as Hn, SubagentFinishedSuspendedOutcomeSchema as Hr, ActivityDeltaEventSchema as Ht, IntelligenceIndicatorView as I, ɵmemoryReducer as Ia, emitInspectorActiveThread$1 as Ii, InputContentDataSourceSchema as In, StepFinishedEventSchema as Ir, useCopilotChatConfiguration as It, useLearnFromUserAction as J, ɵselectMemories$1 as Ja, isInterruptExpired as Ji, MessagesSnapshotEventSchema as Jn, TestOperationSchema as Jr, AgentThreadLockedError as Jt, useAttachments as K, ɵselectIsFetchingNextPage$1 as Ka, isAbortError as Ki, MemoryError as Kn, SuggestionEngine as Kr, AgentCapabilitiesSchema as Kt, CopilotChatSuggestionView as L, ɵmemoryRestEvents as La, emitInspectorStopViewing as Li, InputContentSchema as Ln, StepStartedEventSchema as Lr, ACTIVITY_HISTORY_METADATA as Lt, messageRow as M, ɵjoinPhoenixChannel$ as Ma, createReducer as Mi, IdentityCapabilitiesSchema as Mn, StateDeltaEventSchema as Mr, CopilotChatInput_default as Mt, INTELLIGENCE_TURN_HEAD as N, ɵmapMemoryMetadataEvent as Na, createSelector as Ni, ImageInputContentSchema as Nn, StateManager as Nr, AudioRecorderError as Nt, CopilotChatView_default as O, ɵcreateThreadStore$1 as Oa, createActionGroup as Oi, FunctionMiddleware as On, RunFinishedSuccessOutcomeSchema as Or, MCPAppsActivityType as Ot, IntelligenceIndicator as P, ɵmemoryAdapterEvents as Pa, createStore as Pi, ImageInputPartSchema as Pn, StateSchema as Pr, CopilotChatAudioRecorder as Pt, INTERRUPT_EVENT_NAME as Q, ɵselectMemoriesIsMutating as Qa, ofType as Qi, MultiAgentCapabilitiesSchema as Qn, TextMessageEndEventSchema as Qr, AudioInputPartSchema as Qt, CopilotChatSuggestionPill as R, ɵobservePhoenixEvent$ as Ra, emitInspectorViewThread as Ri, InputContentSourceSchema as Rn, SubagentErrorEventSchema as Rr, AGUIConnectNotImplementedError$1 as Rt, CopilotSidebarView as S, ɵInterruptState$1 as Sa, buildResumeArray as Si, EventType as Sn, RunAgentInputSchema as Sr, OpenGenerativeUIContentSchema as St, DefaultCloseIcon as T, ɵTHREAD_REQUEST_TIMEOUT_MS as Ta, contentHasMedia as Ti, FileSourceSchema as Tn, RunFinishedEventSchema as Tr, useSandboxFunctions as Tt, CopilotChatToolCallsView as U, ɵphoenixSocket$ as Ua, ensureObjectArgs as Ui, JsonPatchSchema as Un, SubagentInfoSchema as Ur, ActivityMessageSchema as Ut, CopilotChatAttachmentRenderer as V, ɵobservePhoenixSocketSignals$ as Va, enforceEvents as Vi, InterruptSchema as Vn, SubagentFinishedSuccessOutcomeSchema as Vr, AbstractAgent$1 as Vt, useLearningContainersInCurrentThread as W, ɵselectFetchMoreError$1 as Wa, getRunOutcome as Wi, JsonPointerSchema as Wn, SubagentRunIdSchema as Wr, ActivitySnapshotEventSchema as Wt, useThreads$1 as X, ɵselectMemoriesError$1 as Xa, isRunCompletionAware$1 as Xi, Middleware as Xn, TextMessageChunkEventSchema as Xr, AttributableSchema as Xt, useMemories as Y, ɵselectMemoriesAvailable$1 as Ya, isRecognizedEvent as Yi, MetadataSchema as Yn, TextInputContentSchema as Yr, AssistantMessageSchema as Yt, useInterrupt as Z, ɵselectMemoriesIsLoading$1 as Za, mergeMetadata as Zi, MoveOperationSchema as Zn, TextMessageContentEventSchema as Zr, AudioInputContentSchema as Zt, WildcardToolCallRender as _, transformChunks as _a, VideoInputPartSchema as _i, DocumentInputContentSchema as _n, ReasoningStartEventSchema as _r, defineToolCallRenderer as _t, ThreadsProvider as a, parseProtoStream as aa, ToolCallEndEventSchema as ai, CompatibilityBoundary as an, PartSourceSchema as ar, useHumanInTheLoop as at, CopilotSidebar as b, withAuthoritativeActivityTypes as ba, aggregateTokenUsage as bi, EventSchema as bn, ResumeEntrySchema as br, OpenGenerativeUIActivityRenderer as bt, CoAgentStateRendersProvider as c, props as ca, ToolCallStartEventSchema as ci, ContextStore as cn, ReasoningCapabilitiesSchema as cr, useComponent as ct, shouldShowDevConsole as d, resolveDebugLogger as da, ToolSchema as di, CopilotKitCoreRuntimeConnectionStatus$1 as dn, ReasoningEndEventSchema as dr, useRenderActivityMessage as dt, on as ea, TextMessageStartEventSchema as ei, BackwardCompatibility_0_0_39 as en, ɵselectThreads$1 as eo, MultimodalInputCapabilitiesSchema as er, useSuggestions as et, useToast as f, runHttpRequest as fa, ToolsCapabilitiesSchema as fi, CopyOperationSchema as fn, ReasoningMessageChunkEventSchema as fr, useRenderCustomMessages as ft, useCopilotContext as g, tokenUsageFromLangChainMetadata as ga, VideoInputContentSchema as gi, DeveloperMessageSchema as gn, ReasoningMessageStartEventSchema as gr, CopilotKitCoreReact as gt, CopilotContext as h, tokenUsageFromAiSdkUsage as ha, UserMessageSchema as hi, DebugLogger as hn, ReasoningMessageSchema as hr, useLicenseContext$1 as ht, ThreadsContext as i, onInspectorViewThreadResult as ia, ToolCallChunkEventSchema as ii, BaseMessageSchema as in, PROTOCOL_VERSION as ir, useAgent as it, messageGroup as j, ɵisRetryableMemoryStatus as ja, createInspectorThreadRequestId as ji, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID as jn, StateCapabilitiesSchema as jr, useRenderToolCall as jt, CopilotChatAttachmentQueue as k, ɵisCopilotKitFeature as ka, createDebugLogger as ki, HttpAgent as kn, RunHandler as kr, ɵrunMcpFollowUp as kt, useCoAgentStateRenders as l, randomUUID$2 as la, ToolCallStatus$1 as li, CopilotKitCore$1 as ln, ReasoningEncryptedValueEventSchema as lr, useFrontendTools as lt, useCopilotMessagesContext as m, structuredClone_ as ma, UrlSourceSchema as mi, DataSourceSchema as mn, ReasoningMessageEndEventSchema as mr, useCopilotKit$1 as mt, defaultCopilotContextCategories as n, onInspectorStopViewing$1 as na, TokenUsageSchema as ni, BackwardCompatibility_0_0_57 as nn, ɵselectThreadsIsLoading$1 as no, OptionalMetadataSchema as nr, useCapabilities as nt, useThreads as o, parseSSEStream as oa, ToolCallResultEventSchema as oi, ContentPartSchema as on, ProxiedCopilotRuntimeAgent$1 as or, useDefaultRenderTool as ot, CopilotMessagesContext as p, select as pa, TransportCapabilitiesSchema as pi, CustomEventSchema as pn, ReasoningMessageContentEventSchema as pr, CopilotKitProvider as pt, useLearnFromUserActionInCurrentThread as q, ɵselectIsMutating$1 as qa, isInspectorThreadBridgeEnabled$1 as qi, MessageSchema as qn, SystemMessageSchema as qr, AgentRegistry as qt, CoAgentStateRenderBridge as r, onInspectorViewThread$1 as ra, ToolCallArgsEventSchema as ri, BaseEventSchema as rn, ɵthreadAdapterEvents as ro, OutputCapabilitiesSchema as rr, UseAgentUpdate as rt, CoAgentStateRendersContext as s, parseToolArguments as sa, ToolCallSchema as si, ContextSchema as sn, RawEventSchema as sr, useRenderTool as st, CopilotKit as t, onInspectorActiveThread as ta, TextPartSchema as ti, BackwardCompatibility_0_0_45 as tn, ɵselectThreadsError$1 as to, MultimodalOutputCapabilitiesSchema as tr, useAgentContext as tt, useAsyncCallback as u, resolveAgentDebugConfig as ua, ToolMessageSchema as ui, CopilotKitCoreErrorCode$1 as un, ReasoningEncryptedValueSubtypeSchema as ur, useFrontendTool as ut, CopilotThreadsDrawer as v, transformHttpEventStream as va, VideoPartSchema as vi, DocumentInputPartSchema as vn, RemoveOperationSchema as vr, createA2UIMessageRenderer as vt, CopilotChatToggleButton as w, ɵRUNTIME_PROBE_TIMEOUT_MS as wa, completePartialMarkdown as wi, ExecutionCapabilitiesSchema as wn, RunFinishedCancelledOutcomeSchema as wr, SandboxFunctionsContext as wt, CopilotPopupView as x, ɵCOPILOTKIT_FEATURES as xa, authoritativeActivityTypes as xi, EventSchemas as xn, RoleSchema as xr, OpenGenerativeUIActivityType as xt, CopilotPopup as y, verifyEvents as ya, WebMCPRegistry as yi, DocumentPartSchema as yn, ReplaceOperationSchema as yr, GenerateSandboxedUiArgsSchema as yt, CopilotChatReasoningMessage_default as z, ɵobservePhoenixJoinOutcome$ as za, emitInspectorViewThreadResult$1 as zi, InputContentUrlSourceSchema as zn, SubagentFinishedEventSchema as zr, AGUIError as zt };
12836
- //# sourceMappingURL=copilotkit-DgJj6xa0.mjs.map
12852
+ export { useConfigureSuggestions as $, ɵselectMemoriesIsLoading$1 as $a, mergeMetadata as $i, MoveOperationSchema as $n, TextMessageContentEventSchema as $r, AudioPartSchema as $t, CopilotChatMessageView as A, ɵcreateThreadStore$1 as Aa, createActionGroup as Ai, HttpAgent as An, RunFinishedSuccessOutcomeSchema as Ar, CopilotKitInspector as At, CopilotChatUserMessage_default as B, ɵobservePhoenixEvent$ as Ba, emitInspectorViewThread as Bi, InputContentUrlSourceSchema as Bn, SubagentErrorEventSchema as Br, AGUI_METADATA_KEY as Bt, CopilotModalHeader as C, ɵCOPILOTKIT_FEATURES as Ca, authoritativeActivityTypes as Ci, EventType as Cn, RoleSchema as Cr, OpenGenerativeUIToolRenderer as Ct, CopilotChat as D, ɵTHREAD_REQUEST_TIMEOUT_MS as Da, contentHasMedia as Di, FilterToolCallsMiddleware as Dn, RunFinishedEventSchema as Dr, MCPAppsActivityRenderer as Dt, DefaultOpenIcon as E, ɵRUNTIME_PROBE_TIMEOUT_MS as Ea, completePartialMarkdown as Ei, FileSourceSchema as En, RunFinishedCancelledOutcomeSchema as Er, MCPAppsActivityContentSchema as Et, getIntelligenceTurnAnchors as F, ɵmapMemoryMetadataEvent as Fa, createSelector as Fi, ImageInputPartSchema as Fn, StateManager as Fr, CopilotChatConfigurationProvider as Ft, useLearningContainers as G, ɵphoenixSocket$ as Ga, ensureObjectArgs as Gi, JsonPatchSchema as Gn, SubagentInfoSchema as Gr, AddOperationSchema as Gt, CopilotChatAssistantMessage_default as H, ɵobservePhoenixSocketHealth$ as Ha, empty as Hi, IntelligenceReplayFailedError as Hn, SubagentFinishedOutcomeSchema as Hr, ActivityDeltaEventSchema as Ht, IntelligenceIndicatorView as I, ɵmemoryAdapterEvents as Ia, createStore as Ii, ImagePartSchema as In, StateSchema as Ir, useCopilotChatConfiguration as It, useLearnFromUserAction as J, ɵselectIsFetchingNextPage$1 as Ja, isAbortError as Ji, MemoryError as Jn, SuggestionEngine as Jr, AgentThreadLockedError as Jt, useAttachments as K, ɵselectFetchMoreError$1 as Ka, getRunOutcome as Ki, JsonPointerSchema as Kn, SubagentRunIdSchema as Kr, AgentCapabilitiesSchema as Kt, CopilotChatSuggestionView as L, ɵmemoryDomainEvents as La, defaultApplyEvents as Li, InputContentDataSourceSchema as Ln, StateSnapshotEventSchema as Lr, ACTIVITY_HISTORY_METADATA as Lt, messageRow as M, ɵisHttpAgent$1 as Ma, createEffect as Mi, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID as Mn, RunStartedEventSchema as Mr, CopilotChatInput_default as Mt, INTELLIGENCE_TURN_HEAD as N, ɵisRetryableMemoryStatus as Na, createInspectorThreadRequestId as Ni, IdentityCapabilitiesSchema as Nn, StateCapabilitiesSchema as Nr, AudioRecorderError as Nt, CopilotChatView_default as O, ɵcreateMemoryStore as Oa, contentToText$1 as Oi, FunctionCallSchema as On, RunFinishedInterruptOutcomeSchema as Or, MCPAppsActivityType as Ot, IntelligenceIndicator as P, ɵjoinPhoenixChannel$ as Pa, createReducer as Pi, ImageInputContentSchema as Pn, StateDeltaEventSchema as Pr, CopilotChatAudioRecorder as Pt, INTERRUPT_EVENT_NAME as Q, ɵselectMemoriesError$1 as Qa, isRunCompletionAware$1 as Qi, Middleware as Qn, TextMessageChunkEventSchema as Qr, AudioInputPartSchema as Qt, CopilotChatSuggestionPill as R, ɵmemoryReducer as Ra, emitInspectorActiveThread$1 as Ri, InputContentSchema as Rn, StepFinishedEventSchema as Rr, AGUIConnectNotImplementedError$1 as Rt, CopilotSidebarView as S, withAuthoritativeActivityTypes as Sa, aggregateTokenUsage as Si, EventSchemas as Sn, ResumeEntrySchema as Sr, OpenGenerativeUIContentSchema as St, DefaultCloseIcon as T, ɵMAX_SOCKET_RETRIES as Ta, compactEvents as Ti, ExecutionCapabilitiesSchema as Tn, RunErrorEventSchema as Tr, useSandboxFunctions as Tt, CopilotChatToolCallsView as U, ɵobservePhoenixSocketSignals$ as Ua, enforceEvents as Ui, InterruptSchema as Un, SubagentFinishedSuccessOutcomeSchema as Ur, ActivityMessageSchema as Ut, CopilotChatAttachmentRenderer as V, ɵobservePhoenixJoinOutcome$ as Va, emitInspectorViewThreadResult$1 as Vi, IntelligenceAgent as Vn, SubagentFinishedEventSchema as Vr, AbstractAgent$1 as Vt, useLearningContainersInCurrentThread as W, ɵphoenixChannel$ as Wa, enforceOutgoingInput as Wi, JsonPatchOperationSchema as Wn, SubagentFinishedSuspendedOutcomeSchema as Wr, ActivitySnapshotEventSchema as Wt, useThreads$1 as X, ɵselectMemories$1 as Xa, isInterruptExpired as Xi, MessagesSnapshotEventSchema as Xn, TestOperationSchema as Xr, AttributableSchema as Xt, useMemories as Y, ɵselectIsMutating$1 as Ya, isInspectorThreadBridgeEnabled$1 as Yi, MessageSchema as Yn, SystemMessageSchema as Yr, AssistantMessageSchema as Yt, useInterrupt as Z, ɵselectMemoriesAvailable$1 as Za, isRecognizedEvent as Zi, MetadataSchema as Zn, TextInputContentSchema as Zr, AudioInputContentSchema as Zt, WildcardToolCallRender as _, tokenUsageFromAiSdkUsage as _a, UserMessageSchema as _i, DeveloperMessageSchema as _n, ReasoningMessageSchema as _r, defineToolCallRenderer as _t, ThreadsProvider as a, onInspectorViewThread$1 as aa, ToolCallArgsEventSchema as ai, CompatibilityBoundary as an, ɵthreadAdapterEvents as ao, OutputCapabilitiesSchema as ar, useHumanInTheLoop as at, CopilotSidebar as b, transformHttpEventStream as ba, VideoPartSchema as bi, DocumentPartSchema as bn, RemoveOperationSchema as br, OpenGenerativeUIActivityRenderer as bt, CoAgentStateRendersProvider as c, parseSSEStream as ca, ToolCallResultEventSchema as ci, ContextStore as cn, ProxiedCopilotRuntimeAgent$1 as cr, useComponent as ct, shouldShowDevConsole as d, randomUUID$2 as da, ToolCallStatus$1 as di, CopilotKitCoreRuntimeConnectionStatus$1 as dn, ReasoningEncryptedValueEventSchema as dr, useRenderActivityMessage as dt, ofType as ea, TextMessageEndEventSchema as ei, BackwardCompatibility_0_0_39 as en, ɵselectMemoriesIsMutating as eo, MultiAgentCapabilitiesSchema as er, useSuggestions as et, useToast as f, resolveAgentDebugConfig as fa, ToolMessageSchema as fi, CopilotKitHeaderResolutionError as fn, ReasoningEncryptedValueSubtypeSchema as fr, useRenderCustomMessages as ft, useCopilotContext as g, structuredClone_ as ga, UrlSourceSchema as gi, DebugLogger as gn, ReasoningMessageEndEventSchema as gr, CopilotKitCoreReact as gt, CopilotContext as h, select as ha, TransportCapabilitiesSchema as hi, DataSourceSchema as hn, ReasoningMessageContentEventSchema as hr, useLicenseContext$1 as ht, ThreadsContext as i, onInspectorStopViewing$1 as ia, TokenUsageSchema as ii, BaseMessageSchema as in, ɵselectThreadsIsLoading$1 as io, OptionalMetadataSchema as ir, useAgent as it, messageGroup as j, ɵisCopilotKitFeature as ja, createDebugLogger as ji, HumanInTheLoopCapabilitiesSchema as jn, RunHandler as jr, useRenderToolCall as jt, CopilotChatAttachmentQueue as k, ɵcreateThreadSelectors as ka, convertToLegacyEvents as ki, FunctionMiddleware as kn, RunFinishedOutcomeSchema as kr, ɵrunMcpFollowUp as kt, useCoAgentStateRenders as l, parseToolArguments as la, ToolCallSchema as li, CopilotKitCore$1 as ln, RawEventSchema as lr, useFrontendTools as lt, useCopilotMessagesContext as m, runHttpRequest as ma, ToolsCapabilitiesSchema as mi, CustomEventSchema as mn, ReasoningMessageChunkEventSchema as mr, useCopilotKit$1 as mt, defaultCopilotContextCategories as n, on as na, TextMessageStartEventSchema as ni, BackwardCompatibility_0_0_57 as nn, ɵselectThreads$1 as no, MultimodalInputCapabilitiesSchema as nr, useCapabilities as nt, useThreads as o, onInspectorViewThreadResult as oa, ToolCallChunkEventSchema as oi, ContentPartSchema as on, ɵwithHeaderDefaults$1 as oo, PROTOCOL_VERSION as or, useDefaultRenderTool as ot, CopilotMessagesContext as p, resolveDebugLogger as pa, ToolSchema as pi, CopyOperationSchema as pn, ReasoningEndEventSchema as pr, CopilotKitProvider as pt, useLearnFromUserActionInCurrentThread as q, ɵselectHasNextPage$1 as qa, getWebMCPModelContext as qi, MEMORY_ERROR_REGISTRY as qn, SubagentStartedEventSchema as qr, AgentRegistry as qt, CoAgentStateRenderBridge as r, onInspectorActiveThread as ra, TextPartSchema as ri, BaseEventSchema as rn, ɵselectThreadsError$1 as ro, MultimodalOutputCapabilitiesSchema as rr, UseAgentUpdate as rt, CoAgentStateRendersContext as s, parseProtoStream as sa, ToolCallEndEventSchema as si, ContextSchema as sn, PartSourceSchema as sr, useRenderTool as st, CopilotKit as t, omitOptionalNulls as ta, TextMessageRoleSchema as ti, BackwardCompatibility_0_0_45 as tn, ɵselectMemoriesRealtimeStatus$1 as to, MultimodalCapabilitiesSchema as tr, useAgentContext as tt, useAsyncCallback as u, props as ua, ToolCallStartEventSchema as ui, CopilotKitCoreErrorCode$1 as un, ReasoningCapabilitiesSchema as ur, useFrontendTool as ut, CopilotThreadsDrawer as v, tokenUsageFromLangChainMetadata as va, VideoInputContentSchema as vi, DocumentInputContentSchema as vn, ReasoningMessageStartEventSchema as vr, createA2UIMessageRenderer as vt, CopilotChatToggleButton as w, ɵInterruptState$1 as wa, buildResumeArray as wi, EventTypeSchema as wn, RunAgentInputSchema as wr, SandboxFunctionsContext as wt, CopilotPopupView as x, verifyEvents as xa, WebMCPRegistry as xi, EventSchema as xn, ReplaceOperationSchema as xr, OpenGenerativeUIActivityType as xt, CopilotPopup as y, transformChunks as ya, VideoInputPartSchema as yi, DocumentInputPartSchema as yn, ReasoningStartEventSchema as yr, GenerateSandboxedUiArgsSchema as yt, CopilotChatReasoningMessage_default as z, ɵmemoryRestEvents as za, emitInspectorStopViewing as zi, InputContentSourceSchema as zn, StepStartedEventSchema as zr, AGUIError as zt };
12853
+ //# sourceMappingURL=copilotkit-DtOQtboh.mjs.map