@copilotkit/core 2.0.0-rc.2 → 2.0.0-rc.20

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.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as _ag_ui_client0 from "@ag-ui/client";
2
- import { AbstractAgent, AgentCapabilities, AgentSubscriber, BaseEvent, Context, HttpAgent, HttpAgentConfig, Interrupt, Message, ResumeEntry, RunAgentInput, RunAgentParameters, RunAgentResult, State, Tool, ToolCall } from "@ag-ui/client";
2
+ import { AbstractAgent, ActivityMessage, AgentCapabilities, AgentSubscriber, BaseEvent, Context, HttpAgent, HttpAgentConfig, Interrupt, Message, ResumeEntry, RunAgentInput, RunAgentParameters, RunAgentResult, State, Tool, ToolCall } from "@ag-ui/client";
3
3
  import { CaptureOptions, CollectorOptions, JsonValue, JsonValue as JsonValue$1, StartResult, StartResult as StartResult$1, TrajectoryCaptureOptions } from "@copilotkit/learning";
4
- import { A2UIOperation, CopilotKitUIEnvelope, DebugConfig, GenerativeUIComponentManifest, GenerativeUIJSONSchema, GenerativeUIRejectedOperation, GenerativeUISurfaceStatus, GenerativeUITarget, InspectorMetadataV1, InspectorMetadataV1 as InspectorMetadataV1$1, IntelligenceRuntimeInfo, IntelligenceRuntimeInfo as IntelligenceRuntimeInfo$1, ResolvedDebugConfig, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeLicenseStatus as RuntimeLicenseStatus$1, RuntimeMode, RuntimeMode as RuntimeMode$1, StandardSchemaV1, ThreadEndpointRuntimeInfo, ThreadEndpointRuntimeInfo as ThreadEndpointRuntimeInfo$1 } from "@copilotkit/shared";
4
+ import { A2UIOperation, AudioInputPart, CopilotKitUIEnvelope, DebugConfig, DocumentInputPart, GenerativeUIComponentManifest, GenerativeUIJSONSchema, GenerativeUIRejectedOperation, GenerativeUISurfaceStatus, GenerativeUITarget, ImageInputPart, InspectorMetadataV1, InspectorMetadataV1 as InspectorMetadataV1$1, IntelligenceRuntimeInfo, IntelligenceRuntimeInfo as IntelligenceRuntimeInfo$1, LicenseContextValue, ResolvedDebugConfig, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeLicenseStatus as RuntimeLicenseStatus$1, RuntimeMode, RuntimeMode as RuntimeMode$1, StandardSchemaV1, ThreadEndpointRuntimeInfo, ThreadEndpointRuntimeInfo as ThreadEndpointRuntimeInfo$1, TranscriptionErrorCode, VideoInputPart } from "@copilotkit/shared";
5
5
  import { Observable, OperatorFunction, Subscription } from "rxjs";
6
- import { Token, Tokens, TokensList } from "marked";
6
+ import { AssistantMessage, Message as Message$1, ToolCall as ToolCall$1, ToolMessage, UserMessage } from "@ag-ui/core";
7
7
 
8
8
  //#region src/core/learning-bridge.d.ts
9
9
  /** Interaction capture settings for {@link CopilotKitCore}. See `@copilotkit/learning`. */
@@ -410,6 +410,13 @@ declare class AgentRegistry {
410
410
  private core;
411
411
  private _agents;
412
412
  private localAgents;
413
+ /**
414
+ * Whether `onAgentsChanged` has run since {@link initialize}. Constructor
415
+ * agents are not announced, so the first `setAgents__unsafe_dev_only` with
416
+ * the same agents must still announce them (core subscribes to agents on
417
+ * that notification).
418
+ */
419
+ private agentsPublished;
413
420
  private remoteAgents;
414
421
  private readonly mintedThreadIds;
415
422
  private _runtimeUrl?;
@@ -455,6 +462,12 @@ declare class AgentRegistry {
455
462
  private runtimeRecoveryRunning;
456
463
  private runtimeRecoveryPending;
457
464
  private runtimeHealthGeneration;
465
+ /**
466
+ * Aborted by {@link dispose}. Runtime probes, recovery fetches and request
467
+ * watchdogs listen to it so a disposed core leaves no timer or request
468
+ * behind.
469
+ */
470
+ private readonly disposeController;
458
471
  /**
459
472
  * The headers each HttpAgent was constructed with, captured on the first
460
473
  * `applyHeadersToAgent` call for that agent (which, for agents the registry
@@ -494,6 +507,15 @@ declare class AgentRegistry {
494
507
  get runtimeEntitlements(): RuntimeEntitlementResponse | undefined;
495
508
  get runtimeEntitlementRetryPending(): boolean;
496
509
  get telemetryDisabled(): boolean;
510
+ /**
511
+ * Stop runtime work this registry owns: the entitlement retry timer, the
512
+ * inspector metadata request, runtime probes and recovery fetches with
513
+ * their timeouts, and request watchdogs. In-flight `/info` connections are
514
+ * detached so their late results change nothing. Called by
515
+ * `CopilotKitCore.dispose`.
516
+ */
517
+ dispose(): void;
518
+ private get isDisposed();
497
519
  /**
498
520
  * Initialize agents from configuration
499
521
  */
@@ -522,7 +544,9 @@ declare class AgentRegistry {
522
544
  private carriesConversationState;
523
545
  private abandonRuntimeHealthProbe;
524
546
  /**
525
- * Set all agents at once (for development use)
547
+ * Set all agents at once (for development use). Same ids mapped to the
548
+ * same instances as the current local agents is a no-op once the agents
549
+ * have been announced.
526
550
  */
527
551
  setAgents__unsafe_dev_only(agents: Record<string, AbstractAgent>): void;
528
552
  /**
@@ -805,6 +829,8 @@ declare class StateManager {
805
829
  * Unsubscribe an agent's subscription.
806
830
  */
807
831
  unsubscribeFromAgent(agentId: string): void;
832
+ /** Unsubscribe from every agent. Called by `CopilotKitCore.dispose`. */
833
+ dispose(): void;
808
834
  /**
809
835
  * Get state for a specific run
810
836
  * Returns a deep copy to prevent external mutations
@@ -955,6 +981,12 @@ declare class RunHandler {
955
981
  * one array before, so the `/info` response flipping `openGenerativeUI` (or
956
982
  * any other provider-prop change) silently dropped every hook-registered
957
983
  * tool (#4952). Key = `capabilityKey(name, agentId)`.
984
+ *
985
+ * Each key holds a stack of registrations. The last one is the active tool;
986
+ * removing it (via the function `addTool` returns) brings back the one
987
+ * below, and an empty stack lets the provider tool of that key show again.
988
+ * A registration is its own object, so removing one never removes another
989
+ * registration of the same tool object.
958
990
  */
959
991
  private _hookTools;
960
992
  /**
@@ -1010,6 +1042,13 @@ declare class RunHandler {
1010
1042
  * that runaway follow-up chains trip `MAX_FOLLOW_UP_DEPTH`.
1011
1043
  */
1012
1044
  private _runDepths;
1045
+ /**
1046
+ * Agents with at least one run in flight (depth above 0), so
1047
+ * {@link dispose} can stop them. Removed when the last run ends.
1048
+ */
1049
+ private _runningAgents;
1050
+ /** Set by {@link dispose}. Stops WebMCP from registering tools again. */
1051
+ private _disposed;
1013
1052
  /**
1014
1053
  * Each agent's own `abortRun`, saved while RunHandler's intercept is
1015
1054
  * installed. Restored only once none of the agent's runs is in flight, so an
@@ -1064,6 +1103,12 @@ declare class RunHandler {
1064
1103
  * not start a follow-up run.
1065
1104
  */
1066
1105
  abortCurrentRun(agent: AbstractAgent): void;
1106
+ /**
1107
+ * Stop every run chain and tool interaction this handler tracks, and every
1108
+ * agent in `agents` that reports a run in flight, the same way `stopAgent`
1109
+ * does. Then unregister all WebMCP tools. Called by `CopilotKitCore.dispose`.
1110
+ */
1111
+ dispose(agents: Iterable<AbstractAgent>): void;
1067
1112
  private abortAgentRuns;
1068
1113
  /** Signal of the agent's most recently started in-flight run, if any. */
1069
1114
  private latestRunSignal;
@@ -1091,8 +1136,15 @@ declare class RunHandler {
1091
1136
  /**
1092
1137
  * Add a tool to the registry. Survives provider re-syncs ({@link setTools}),
1093
1138
  * and shadows a provider tool of the same name + agentId.
1139
+ *
1140
+ * Registrations of the same name + agentId stack: the most recent one is
1141
+ * active. Call the returned function to remove exactly this registration;
1142
+ * the previous registration (or the provider tool) becomes active again.
1143
+ * Calling it more than once does nothing.
1094
1144
  */
1095
- addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): void;
1145
+ addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): () => void;
1146
+ /** Remove one `addTool` registration. Unknown registrations are ignored. */
1147
+ private unregisterHookTool;
1096
1148
  /**
1097
1149
  * Report, once per tool and at development time only, a tool registered with
1098
1150
  * no `parameters` schema.
@@ -1114,7 +1166,10 @@ declare class RunHandler {
1114
1166
  */
1115
1167
  private warnOnMissingToolParameters;
1116
1168
  /**
1117
- * Remove a tool by name and optionally by agentId
1169
+ * Remove a tool by name and optionally by agentId: every `addTool`
1170
+ * registration of that key and the provider tool of that key. Without an
1171
+ * agentId only global tools are removed. To remove one `addTool`
1172
+ * registration and keep the others, call the function `addTool` returned.
1118
1173
  */
1119
1174
  removeTool(id: string, agentId?: string): void;
1120
1175
  /**
@@ -2234,6 +2289,14 @@ interface CopilotKitCoreConfig {
2234
2289
  * {@link CopilotKitCore.setLearningConfig}.
2235
2290
  */
2236
2291
  learning?: LearningConfig;
2292
+ /**
2293
+ * @internal For framework adapters. Awaited after frontend tools run and
2294
+ * before the follow-up run starts, so state updates that the tool handlers
2295
+ * scheduled in the framework (and the context those updates register) land
2296
+ * before the follow-up reads it. React passes a `setTimeout(0)` yield, Vue
2297
+ * passes `nextTick`.
2298
+ */
2299
+ ɵwaitForFrameworkUpdates?: () => Promise<void>;
2237
2300
  }
2238
2301
  interface CopilotKitCoreStopAgentParams {
2239
2302
  agent: AbstractAgent;
@@ -2515,6 +2578,8 @@ declare class CopilotKitCore {
2515
2578
  private _defaultThrottleMs?;
2516
2579
  private _debug?;
2517
2580
  private subscribers;
2581
+ private _disposed;
2582
+ private readonly waitForFrameworkUpdates?;
2518
2583
  private agentRegistry;
2519
2584
  private contextStore;
2520
2585
  private suggestionEngine;
@@ -2552,7 +2617,8 @@ declare class CopilotKitCore {
2552
2617
  tools,
2553
2618
  suggestionsConfig,
2554
2619
  debug,
2555
- learning
2620
+ learning,
2621
+ ɵwaitForFrameworkUpdates
2556
2622
  }: CopilotKitCoreConfig);
2557
2623
  /**
2558
2624
  * Internal method used by delegate classes and subclasses to notify subscribers
@@ -2690,13 +2756,18 @@ declare class CopilotKitCore {
2690
2756
  * also a no-op — safe to call on every render with a fresh object literal.
2691
2757
  */
2692
2758
  setHeaders(headers: CopilotKitHeadersSource): void;
2759
+ /**
2760
+ * Set the credentials mode for runtime requests (for example `"include"`
2761
+ * to send HTTP-only cookies). Passing the current value does nothing.
2762
+ */
2693
2763
  setCredentials(credentials: RequestCredentials | undefined): void;
2694
2764
  /**
2695
2765
  * Replace the message filter applied to every runtime agent.
2696
2766
  *
2697
2767
  * Applies to agents already discovered as well as ones discovered later, so
2698
2768
  * a filter set before `/info` lands is not lost. Pass `undefined` to go back
2699
- * to sending the full thread.
2769
+ * to sending the full thread. Passing the current filter function again
2770
+ * does nothing.
2700
2771
  */
2701
2772
  setMessageFilter(messageFilter: CopilotKitMessageFilter | undefined): void;
2702
2773
  /**
@@ -2730,9 +2801,18 @@ declare class CopilotKitCore {
2730
2801
  * `agentIds` does not match when `agentId` is omitted.
2731
2802
  */
2732
2803
  getPropertiesForAgent(agentId?: string): Record<string, unknown>;
2804
+ /**
2805
+ * Replace the properties sent as `forwardedProps` with every run, and
2806
+ * notify `onPropertiesChanged`. Passing an object with the same keys and
2807
+ * values as the current one does nothing, so a fresh object literal on
2808
+ * every render is safe.
2809
+ */
2733
2810
  setProperties(properties: Record<string, unknown>): void;
2734
2811
  /**
2735
- * Agent management (delegated to AgentRegistry)
2812
+ * Agent management (delegated to AgentRegistry).
2813
+ *
2814
+ * Replace the local (development) agents. Passing the same ids mapped to
2815
+ * the same agent instances does nothing.
2736
2816
  */
2737
2817
  setAgents__unsafe_dev_only(agents: Record<string, AbstractAgent>): void;
2738
2818
  addAgent__unsafe_dev_only(params: CopilotKitCoreAddAgentParams): void;
@@ -2905,9 +2985,32 @@ declare class CopilotKitCore {
2905
2985
  clearSuggestions(agentId: string): void;
2906
2986
  getSuggestions(agentId: string): CopilotKitCoreGetSuggestionsResult;
2907
2987
  /**
2908
- * Tool management (delegated to RunHandler)
2988
+ * Register a frontend tool. It shadows a provider tool (from the `tools`
2989
+ * config or `setTools`) with the same name and agentId.
2990
+ *
2991
+ * A second registration with the same name and agentId shadows the first.
2992
+ * Call the returned function to remove only this registration: the tool it
2993
+ * shadowed becomes active again. Calling it more than once does nothing.
2994
+ *
2995
+ * @param tool - The tool to register.
2996
+ * @returns A function that removes this registration.
2997
+ *
2998
+ * @example
2999
+ * const unregister = copilotkit.addTool({
3000
+ * name: "showWeather",
3001
+ * handler: async ({ city }) => `Sunny in ${city}`,
3002
+ * });
3003
+ * // later
3004
+ * unregister();
3005
+ */
3006
+ addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): () => void;
3007
+ /**
3008
+ * Remove a tool by name, and by agentId when given. This removes every
3009
+ * `addTool` registration with that name and agentId, and the provider tool
3010
+ * with that name and agentId. Without an agentId, only global tools are
3011
+ * removed. To remove one registration, call the function `addTool`
3012
+ * returned.
2909
3013
  */
2910
- addTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: FrontendTool<T>): void;
2911
3014
  removeTool(id: string, agentId?: string): void;
2912
3015
  getTool(params: CopilotKitCoreGetToolParams): FrontendTool<any> | undefined;
2913
3016
  setTools(tools: FrontendTool<any>[]): void;
@@ -2978,11 +3081,36 @@ declare class CopilotKitCore {
2978
3081
  * synchronously while the deferred updates are still pending, producing stale
2979
3082
  * context for the next agent turn.
2980
3083
  *
2981
- * Override in framework-specific subclasses to yield to the framework
2982
- * scheduler before the follow-up run. The base implementation is a no-op
2983
- * because non-React environments have no deferred state to flush.
3084
+ * Awaits the `ɵwaitForFrameworkUpdates` config option when one is given.
3085
+ * Without it there is nothing to wait for, because a plain JavaScript
3086
+ * environment has no deferred state to flush. Framework subclasses that
3087
+ * still override this method keep working.
2984
3088
  */
2985
3089
  waitForPendingFrameworkUpdates(): Promise<void>;
3090
+ /**
3091
+ * Stop everything this core started, so it can be dropped without leaks.
3092
+ *
3093
+ * Call it when you created a `CopilotKitCore` yourself and are done with it
3094
+ * (for example when a page or test tears down). Framework providers call it
3095
+ * for you.
3096
+ *
3097
+ * It does this, in order:
3098
+ *
3099
+ * - removes every subscriber, so no callback runs after this call;
3100
+ * - stops agent runs in flight and aborts running frontend tools;
3101
+ * - aborts suggestion generation;
3102
+ * - clears runtime timers and aborts runtime requests it can cancel;
3103
+ * - removes agent subscriptions, WebMCP tools, and the learning capture;
3104
+ * - stops the memory store and every registered thread store.
3105
+ *
3106
+ * Calling it again does nothing. Do not use the core after this call.
3107
+ *
3108
+ * @example
3109
+ * const copilotkit = new CopilotKitCore({ runtimeUrl: "/api/copilotkit" });
3110
+ * // ... use it ...
3111
+ * copilotkit.dispose();
3112
+ */
3113
+ dispose(): void;
2986
3114
  }
2987
3115
  //#endregion
2988
3116
  //#region src/core/suggestion-engine.d.ts
@@ -2995,6 +3123,13 @@ declare class SuggestionEngine {
2995
3123
  private _suggestionsConfig;
2996
3124
  private _suggestions;
2997
3125
  private _runningSuggestions;
3126
+ /**
3127
+ * The last `getSuggestions` result per agent, with the per-generation
3128
+ * arrays it was built from. Each generation's array is replaced (never
3129
+ * mutated) on change, so comparing those references tells whether the
3130
+ * cached result is still current.
3131
+ */
3132
+ private _snapshots;
2998
3133
  constructor(core: CopilotKitCore);
2999
3134
  /**
3000
3135
  * Initialize with suggestion configs
@@ -3019,9 +3154,12 @@ declare class SuggestionEngine {
3019
3154
  */
3020
3155
  clearSuggestions(agentId: string): void;
3021
3156
  /**
3022
- * Get current suggestions for an agent
3157
+ * Get current suggestions for an agent. Returns the same object until the
3158
+ * agent's suggestions or loading state change.
3023
3159
  */
3024
3160
  getSuggestions(agentId: string): CopilotKitCoreGetSuggestionsResult;
3161
+ /** Abort every running suggestion generation. Called by `CopilotKitCore.dispose`. */
3162
+ dispose(): void;
3025
3163
  /**
3026
3164
  * Generate suggestions by running a provider agent and extracting the
3027
3165
  * `copilotkitSuggest` tool call from its streamed messages.
@@ -3142,35 +3280,6 @@ declare class WebMCPRegistry {
3142
3280
  //#region src/utils/markdown/complete-partial-markdown.d.ts
3143
3281
  declare function completePartialMarkdown(input: string): string;
3144
3282
  //#endregion
3145
- //#region src/utils/markdown/types.d.ts
3146
- /**
3147
- * A single parsed markdown node. This is `marked`'s token union, re-exported as
3148
- * the stable public contract that framework renderers switch on. Consumers
3149
- * should treat `type` as the discriminant (e.g. "heading", "paragraph", "code",
3150
- * "list", "table", "strong", "em", "link", "image", ...).
3151
- */
3152
- type MarkdownToken = Token;
3153
- /** The ordered list of top-level tokens returned by parseMarkdown. */
3154
- type MarkdownTokenList = TokensList;
3155
- //#endregion
3156
- //#region src/utils/markdown/parse.d.ts
3157
- interface ParseMarkdownOptions {
3158
- /**
3159
- * When true (default), the input is run through `completePartialMarkdown`
3160
- * first so that incomplete streaming markdown (unterminated emphasis, code
3161
- * fences, links) renders cleanly. Set false to parse the raw string as-is.
3162
- */
3163
- complete?: boolean;
3164
- }
3165
- /**
3166
- * Parse a markdown string into a framework-agnostic token tree.
3167
- *
3168
- * Uses `marked`'s lexer (GFM enabled) so the result is DOM-free and can be
3169
- * walked into React, Vue, or React Native elements by each framework's
3170
- * built-in renderer.
3171
- */
3172
- declare function parseMarkdown(content: string, options?: ParseMarkdownOptions): MarkdownTokenList;
3173
- //#endregion
3174
3283
  //#region src/utils/http-agent.d.ts
3175
3284
  /**
3176
3285
  * Whether an agent is an `HttpAgent`, including one built from another copy of
@@ -3552,7 +3661,12 @@ type ɵInterruptDecision = {
3552
3661
  */
3553
3662
  declare class ɵInterruptState<TValue = unknown> {
3554
3663
  #private;
3555
- /** Return the active normalized interrupt without exposing mutable state. */
3664
+ /**
3665
+ * Return the active normalized interrupt. A standard interrupt set is a
3666
+ * frozen snapshot, and every read returns the same object until the
3667
+ * interrupt is replaced or cleared, so a framework can compare it by
3668
+ * reference.
3669
+ */
3556
3670
  get pending(): ɵPendingInterrupt<TValue> | null;
3557
3671
  /** Replace the current interrupt with a legacy custom-event interrupt. */
3558
3672
  setLegacy(event: ɵInterruptEvent<TValue>): void;
@@ -3767,7 +3881,8 @@ declare function extractFenceOperations(fenceText: string): {
3767
3881
  partialObject: string | null;
3768
3882
  partialLine: string | null;
3769
3883
  invalidLines: string[];
3770
- recovered: string[];
3884
+ recovered: string[]; /** Complete lines that were off by one closing brace and were repaired. */
3885
+ repairedLines: string[];
3771
3886
  };
3772
3887
  /**
3773
3888
  * Normalise a fence's operations for the renderer: drop unknown messages, fill
@@ -3904,5 +4019,2329 @@ type SurfaceSegment = {
3904
4019
  */
3905
4020
  declare function segmentSurfaceProse(components: Record<string, unknown>[], options?: ChildWalkOptions): SurfaceSegment[];
3906
4021
  //#endregion
3907
- export { A2UIMarkdownOperation, A2UI_FENCE_LANGUAGE, ActionConfig, ActionCreator, ActionFromCreator, ActionFromCreators, ActionGroupConfig, ActionGroupResult, AgentRegistry, AgentThreadLockedError, AnyAction, ChildIdsOf, ChildWalkOptions, ContextStore, CopilotKitCore, type CopilotKitCoreAddAgentParams, type CopilotKitCoreCatalogComponent, CopilotKitCoreConfig, type CopilotKitCoreConnectAgentParams, CopilotKitCoreContinuationHandoff, CopilotKitCoreErrorCode, CopilotKitCoreFriendsAccess, CopilotKitCoreGetSuggestionsResult, type CopilotKitCoreGetToolParams, type CopilotKitCoreRegisterProxiedAgentParams, type CopilotKitCoreRegisterProxiedAgentResult, type CopilotKitCoreRunAgentParams, type CopilotKitCoreRunToolParams, type CopilotKitCoreRunToolResult, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreStopAgentParams, CopilotKitCoreSubscriber, CopilotKitCoreSubscription, CopilotKitHeaderResolutionError, type CopilotKitHeadersSource, type CopilotKitMessageFilter, CopilotRuntimeTransport, DispatchingEffect, DispatchingEffectOptions, DynamicSuggestionsConfig, Effect, EmptyActionConfig, FrontendTool, FrontendToolHandlerContext, FrontendToolReconnectBehavior, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, InspectorActiveThreadPayload, type InspectorMetadataV1, InspectorStopViewingPayload, InspectorViewThreadPayload, InspectorViewThreadResultPayload, IntelligenceAgent, IntelligenceAgentConfig, type IntelligenceRuntimeInfo, type JsonValue, type LearningConfig, type LegacyLearningConfig, MEMORY_ERROR_REGISTRY, MarkdownSegment, MarkdownToken, MarkdownTokenList, Memory, MemoryChanges, MemoryError, type MemoryErrorCategory, type MemoryErrorCode, type MemoryErrorRegistryEntry, MemoryKind, MemoryRealtimeStatus, MemoryScope, NewMemory, NonDispatchingEffect, NonDispatchingEffectOptions, type OpenThreadRegistration, ParseMarkdownOptions, PropsActionConfig, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgentConfig, Reducer, RunCompletionAware, RunHandler, type RuntimeLicenseStatus, type RuntimeMode, ScopedContext, ScopedProperties, Selector, type StartResult, StateManager, StaticSuggestionsConfig, Store, StoreLifecycleAction, SubscribeToAgentOptions, SubscribeToAgentSubscriber, Suggestion, SuggestionAvailability, SuggestionEngine, SuggestionsConfig, SurfaceSegment, type ThreadEndpointRuntimeInfo, ThreadRunActivityNotification, type Tokens, ToolCallStatus, type TrajectoryStartOptions, WebMCPModelContext, WebMCPRegistry, WebMCPToolAnnotations, WebMCPToolConfig, classifySurfaceCards, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, empty, ensureObjectArgs, extractCompleteArrayItems, extractFenceOperations, extractStringField, flattenInformationalCards, getMarkdownOperationSurfaceId, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isRunCompletionAware, ofType, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorViewThread, onInspectorViewThreadResult, parseMarkdown, parseToolArguments, prepareSurfaceOperations, props, segmentSurfaceProse, select, splitA2UIMarkdown, ɵCOPILOTKIT_FEATURES, ɵCopilotKitFeature, ɵGenerativeUIDebugFunction, ɵGenerativeUIDebugPromptSection, ɵGenerativeUIDebugRun, ɵGenerativeUIDebugSnapshot, ɵGenerativeUIDebugSource, ɵGenerativeUIDebugSurface, ɵInterruptDecision, ɵInterruptEvent, ɵInterruptState, ɵInterruptToolResult, ɵMAX_SOCKET_RETRIES, ɵMemoryEnvironment, ɵMemoryMetadataEvent, ɵMemoryRuntimeContext, ɵMemoryState, ɵMemoryStore, ɵPendingInterrupt, ɵPhoenixChannelLike, ɵPhoenixChannelOptions, ɵPhoenixChannelSession, ɵPhoenixJoinOutcome, ɵPhoenixPushLike, ɵPhoenixSocketLike, ɵPhoenixSocketOptions, ɵPhoenixSocketSession, ɵPhoenixSocketSignal, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵThread, ɵThreadEnvironment, ɵThreadMetadataEvent, ɵThreadRuntimeContext, ɵThreadSelectors, ɵThreadStore, ɵclearAgentInterruptState, createMemoryStore as ɵcreateMemoryStore, ɵcreateThreadSelectors, createThreadStore as ɵcreateThreadStore, ɵgetAgentInterruptState, ɵisCopilotKitFeature, ɵisHttpAgent, isRetryableStatus as ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵthreadAdapterEvents, ɵwithHeaderDefaults };
4022
+ //#region src/chat/labels.d.ts
4023
+ /**
4024
+ * The default English text for every word the chat UI shows. React, Vue and
4025
+ * Angular all read their chat text from this one set.
4026
+ *
4027
+ * To change or translate the text, pass a partial set to your framework's chat
4028
+ * configuration. Keys you leave out keep their default:
4029
+ *
4030
+ * ```ts
4031
+ * const labels = { ...CopilotChatDefaultLabels, chatInputPlaceholder: "Ask me" };
4032
+ * ```
4033
+ *
4034
+ * Some values are templates with `{name}` placeholders, such as
4035
+ * `"Thought for {duration}"`. Keep the placeholders when you translate them.
4036
+ *
4037
+ * Counts use two keys: `...One` for a count of 1, and `...Other` for any other
4038
+ * count.
4039
+ */
4040
+ declare const CopilotChatDefaultLabels: Readonly<{
4041
+ chatInputPlaceholder: "Type a message...";
4042
+ chatInputToolbarStartTranscribeButtonLabel: "Transcribe";
4043
+ chatInputToolbarCancelTranscribeButtonLabel: "Cancel";
4044
+ chatInputToolbarFinishTranscribeButtonLabel: "Finish";
4045
+ chatInputToolbarAddButtonLabel: "Add attachments";
4046
+ chatInputToolbarToolsButtonLabel: "Tools";
4047
+ chatInputToolbarSendButtonLabel: "Send message";
4048
+ chatInputToolbarStopButtonLabel: "Stop";
4049
+ assistantMessageToolbarCopyCodeLabel: "Copy";
4050
+ assistantMessageToolbarCopyCodeCopiedLabel: "Copied";
4051
+ assistantMessageToolbarCopyMessageLabel: "Copy";
4052
+ assistantMessageToolbarInspectorLabel: "View in Inspector";
4053
+ assistantMessageToolbarInspectorDescription: "Open this message in the Inspector";
4054
+ assistantMessageToolbarInspectorLocalOnlyLabel: "Local only";
4055
+ assistantMessageToolbarInspectorLocalOnlyDescription: "Only visible on localhost or loopback hosts in development. Never shown in production.";
4056
+ assistantMessageToolbarInspectorTitle: "CopilotKit Inspector";
4057
+ assistantMessageToolbarInspectorHideLabel: "Hide this icon";
4058
+ assistantMessageToolbarInspectorHideDescription: "Until you reload this page";
4059
+ assistantMessageToolbarThumbsUpLabel: "Good response";
4060
+ assistantMessageToolbarThumbsDownLabel: "Bad response";
4061
+ assistantMessageFeedbackCommentPlaceholder: "Add a comment (optional)";
4062
+ assistantMessageFeedbackCommentSubmitLabel: "Send comment";
4063
+ assistantMessageToolbarReadAloudLabel: "Read aloud";
4064
+ assistantMessageToolbarRegenerateLabel: "Regenerate";
4065
+ userMessageToolbarCopyMessageLabel: "Copy";
4066
+ userMessageToolbarEditMessageLabel: "Edit";
4067
+ userMessageToolbarPreviousBranchLabel: "Previous branch";
4068
+ userMessageToolbarNextBranchLabel: "Next branch";
4069
+ chatDisclaimerText: "AI can make mistakes. Please verify important information.";
4070
+ chatToggleOpenLabel: "Open chat";
4071
+ chatToggleCloseLabel: "Close chat";
4072
+ chatScrollToBottomLabel: "Scroll to bottom";
4073
+ chatConnectingLabel: "Loading conversation";
4074
+ modalHeaderTitle: "CopilotKit Chat";
4075
+ welcomeMessageText: "How can I help you today?";
4076
+ reasoningMessageThinkingLabel: "Thinking…";
4077
+ chatInputSlashMenuLabel: "Slash commands";
4078
+ chatInputSlashMenuEmptyText: "No commands found";
4079
+ attachmentRemoveButtonLabel: "Remove attachment";
4080
+ attachmentPlayVideoButtonLabel: "Play video";
4081
+ attachmentPreviewCloseButtonLabel: "Close preview";
4082
+ modalHeaderCloseButtonLabel: "Close";
4083
+ modalHeaderThreadsButtonLabel: "Open threads";
4084
+ sidebarLabel: "Copilot chat sidebar"; /** Shown over the chat while the user drags files onto it. */
4085
+ chatDropFilesLabel: "Drop files here"; /** Shown when a saved thread fails to load. */
4086
+ threadLoadErrorText: "Could not load saved conversation. Reopen the thread and try again."; /** Reasoning header after the model stops thinking. `{duration}` is one of the `reasoningMessageDuration...` texts. */
4087
+ reasoningMessageThoughtForLabel: "Thought for {duration}"; /** Duration under 1 second. */
4088
+ reasoningMessageDurationFewSeconds: "a few seconds"; /** Duration under 1 minute. `{count}`: whole seconds. */
4089
+ reasoningMessageDurationSeconds: "{count} seconds"; /** Duration of exactly 1 minute. `{count}`: minutes. */
4090
+ reasoningMessageDurationMinutesOne: "{count} minute"; /** Duration of whole minutes, more than 1. `{count}`: minutes. */
4091
+ reasoningMessageDurationMinutesOther: "{count} minutes"; /** Duration of minutes plus seconds. `{minutes}`, `{seconds}`. */
4092
+ reasoningMessageDurationMinutesSeconds: "{minutes}m {seconds}s"; /** Status of a tool call that is still running. */
4093
+ toolCallStatusRunningLabel: "Running"; /** Status of a tool call that finished. */
4094
+ toolCallStatusDoneLabel: "Done"; /** Status of a tool call that returned an error. */
4095
+ toolCallStatusFailedLabel: "Failed"; /** Status of a tool call that stopped before it finished. */
4096
+ toolCallStatusStoppedLabel: "Stopped"; /** Summary while a tool runs. `{name}`: the tool name. */
4097
+ toolCallRunningLabel: "Running {name}"; /** Number of failed tool calls. `{count}`: the number. */
4098
+ toolCallFailedCountLabel: "{count} failed"; /** Number of finished tool calls. `{count}`: the number. */
4099
+ toolCallDoneCountLabel: "{count} done"; /** Heading above the arguments of a tool call. */
4100
+ toolCallArgumentsLabel: "Arguments"; /** Heading above the result of a tool call. */
4101
+ toolCallResultLabel: "Result"; /** Button that closes an open group of tool calls. */
4102
+ toolCallCollapseLabel: "Collapse"; /** Summary of a finished group with 1 tool call. `{count}`: the number. */
4103
+ toolCallUsedToolsOne: "Used {count} tool"; /** Summary of a finished group with any other number of tool calls. `{count}`: the number. */
4104
+ toolCallUsedToolsOther: "Used {count} tools"; /** Count of tools, for 1. `{count}`: the number. */
4105
+ toolCallToolCountOne: "{count} tool"; /** Count of tools, for any other number. `{count}`: the number. */
4106
+ toolCallToolCountOther: "{count} tools"; /** Count of tool calls, for 1. `{count}`: the number. */
4107
+ toolCallToolCallCountOne: "{count} tool call"; /** Count of tool calls, for any other number. `{count}`: the number. */
4108
+ toolCallToolCallCountOther: "{count} tool calls"; /** Short count of calls, for 1. `{count}`: the number. */
4109
+ toolCallCallCountOne: "{count} call"; /** Short count of calls, for any other number. `{count}`: the number. */
4110
+ toolCallCallCountOther: "{count} calls"; /** Work summary while the agent runs. */
4111
+ workSummaryWorkingLabel: "Working"; /** Work summary after the run. `{duration}`: the run time. */
4112
+ workSummaryWorkedForLabel: "Worked for {duration}"; /** Shown in place of an image attachment that fails to load. */
4113
+ attachmentImageLoadErrorText: "Failed to load image"; /** Alt text of an image attachment. */
4114
+ attachmentImageAltText: "Image attachment"; /** Shown when a file attachment has no name and no type. */
4115
+ attachmentUnknownTypeText: "Unknown type"; /** Name of a document attachment that has no file name. */
4116
+ attachmentDocumentLabel: "Document"; /** Label of a document attachment that has no file name and no type. */
4117
+ attachmentDocumentAltText: "Document attachment"; /** Shown in the preview of a file type the chat cannot preview. */
4118
+ attachmentNoPreviewText: "No preview available for this file type"; /** Shown when the user sends while attachments are still uploading. */
4119
+ chatAttachmentsUploadingText: "Cannot send while attachments are uploading."; /** Transcription error: too many requests. */
4120
+ transcriptionErrorRateLimitedText: "Too many requests. Please wait a moment."; /** Transcription error: the service rejected the credentials. */
4121
+ transcriptionErrorAuthFailedText: "Authentication error. Please check your configuration."; /** Transcription error: the recording is too long. */
4122
+ transcriptionErrorAudioTooLongText: "Recording is too long. Please try a shorter recording."; /** Transcription error: the recording is too short. */
4123
+ transcriptionErrorAudioTooShortText: "Recording is too short. Please try again."; /** Transcription error: the audio format is not supported. */
4124
+ transcriptionErrorInvalidAudioFormatText: "Audio format not supported."; /** Transcription error: no transcription service is set up. */
4125
+ transcriptionErrorServiceNotConfiguredText: "Transcription service is not available."; /** Transcription error: the network request failed. */
4126
+ transcriptionErrorNetworkText: "Network error. Please check your connection."; /** Transcription error that the user can retry, or an unknown error. */
4127
+ transcriptionErrorGenericText: "Transcription failed. Please try again."; /** License banner when no license is set. */
4128
+ licensePoweredByText: "Powered by CopilotKit"; /** License banner link to get a license. */
4129
+ licenseGetLicenseLabel: "Get a license"; /** License banner when a feature needs a license. `{feature}`: the feature name. */
4130
+ licenseFeatureUnlicensedText: "⚠ The \"{feature}\" feature requires a CopilotKit license."; /** License banner when the license expires soon and the day count is not known. */
4131
+ licenseExpiringText: "Your CopilotKit license expires soon. Please renew."; /** License banner when the license expires in 1 day. `{days}`: the number. */
4132
+ licenseExpiringInDaysOne: "Your CopilotKit license expires in {days} day. Please renew."; /** License banner when the license expires in any other number of days. `{days}`: the number. */
4133
+ licenseExpiringInDaysOther: "Your CopilotKit license expires in {days} days. Please renew."; /** License banner when the license expired and the date is not known. */
4134
+ licenseExpiredText: "Your CopilotKit license expired. Please renew at copilotkit.ai/pricing"; /** License banner when the license expired. `{date}`: the expiry date. */
4135
+ licenseExpiredOnDateText: "Your CopilotKit license expired on {date}. Please renew at copilotkit.ai/pricing"; /** License banner when the license token is not valid. */
4136
+ licenseInvalidText: "Invalid CopilotKit license token. Please check your configuration."; /** License banner link when the license expires soon. */
4137
+ licenseRenewLabel: "Renew"; /** License banner link when the license expired. */
4138
+ licenseRenewNowLabel: "Renew now";
4139
+ }>;
4140
+ /**
4141
+ * Every text of the chat UI, by key. Each value is a `string`, so a translated
4142
+ * set fits the same type. See {@link CopilotChatDefaultLabels} for the keys and
4143
+ * the default English text.
4144
+ */
4145
+ type CopilotChatLabels = { -readonly [K in keyof typeof CopilotChatDefaultLabels]: string };
4146
+ /**
4147
+ * Puts values into a label template. Each `{name}` in the template is replaced
4148
+ * by `values[name]`. A placeholder with no value stays in the text as is.
4149
+ *
4150
+ * @param template - A label value, such as `"Running {name}"`.
4151
+ * @param values - The value for each placeholder.
4152
+ *
4153
+ * ```ts
4154
+ * ɵformatLabel(labels.toolCallRunningLabel, { name: "read_file" });
4155
+ * // "Running read_file"
4156
+ * ```
4157
+ */
4158
+ declare function ɵformatLabel(template: string, values: Record<string, string | number>): string;
4159
+ /**
4160
+ * Fills a counted label pair: the `one` template for a count of 1, the
4161
+ * `other` template for any other count. Both templates take `{count}`.
4162
+ *
4163
+ * @param count - The number to show.
4164
+ * @param templates - The `...One` and `...Other` label templates.
4165
+ *
4166
+ * ```ts
4167
+ * ɵformatCountLabel(3, {
4168
+ * one: labels.toolCallToolCountOne,
4169
+ * other: labels.toolCallToolCountOther,
4170
+ * }); // "3 tools"
4171
+ * ```
4172
+ */
4173
+ declare function ɵformatCountLabel(count: number, templates: {
4174
+ one: string;
4175
+ other: string;
4176
+ }): string;
4177
+ //#endregion
4178
+ //#region src/chat/renderer-types.d.ts
4179
+ /**
4180
+ * Props a tool call renderer receives. The `status` field tells which stage
4181
+ * the call is in:
4182
+ *
4183
+ * - `InProgress`: the agent is still streaming arguments, so `args` is partial.
4184
+ * - `Executing`: `args` is complete and the tool is running.
4185
+ * - `Complete`: the tool finished and `result` holds its output.
4186
+ *
4187
+ * @typeParam T - The shape of the tool arguments.
4188
+ */
4189
+ type ToolCallRenderProps<T = unknown> = {
4190
+ name: string;
4191
+ toolCallId: string;
4192
+ args: Partial<T>;
4193
+ status: ToolCallStatus.InProgress;
4194
+ result: undefined;
4195
+ } | {
4196
+ name: string;
4197
+ toolCallId: string;
4198
+ args: T;
4199
+ status: ToolCallStatus.Executing;
4200
+ result: undefined;
4201
+ } | {
4202
+ name: string;
4203
+ toolCallId: string;
4204
+ args: T;
4205
+ status: ToolCallStatus.Complete;
4206
+ result: string;
4207
+ };
4208
+ /**
4209
+ * Props a human-in-the-loop renderer receives.
4210
+ *
4211
+ * Beyond the tool call's `args`/`status`/`result`, the render props carry
4212
+ * attribution:
4213
+ * - `toolCallId`: the AG-UI tool call id, unique per interrupt. It is the
4214
+ * stable key for correlating this interrupt with runtime (sub)agent
4215
+ * attribution, e.g. the `agentId` reported by `onToolExecutionStart`, or
4216
+ * per-run attribution stamped on the event stream, so the UI can label
4217
+ * the interrupt with the agent that actually raised it.
4218
+ * - `agentId`: the agent this tool was *registered* to (the tool's own
4219
+ * `agentId`), or `undefined` for an unscoped tool. This is the static
4220
+ * registration scope; it is NOT necessarily the runtime (sub)agent that
4221
+ * raised the interrupt. For runtime attribution, correlate `toolCallId`
4222
+ * with the event-stream/`onToolExecutionStart` agent id.
4223
+ *
4224
+ * `respond` is only defined while the status is `Executing`. Call it with the
4225
+ * user's answer to send the tool result back to the agent.
4226
+ *
4227
+ * @typeParam T - The shape of the tool arguments.
4228
+ */
4229
+ type HumanInTheLoopRenderProps<T = unknown> = {
4230
+ name: string;
4231
+ description: string;
4232
+ toolCallId: string;
4233
+ agentId?: string;
4234
+ args: Partial<T>;
4235
+ status: ToolCallStatus.InProgress;
4236
+ result: undefined;
4237
+ respond: undefined;
4238
+ } | {
4239
+ name: string;
4240
+ description: string;
4241
+ toolCallId: string;
4242
+ agentId?: string;
4243
+ args: T;
4244
+ status: ToolCallStatus.Executing;
4245
+ result: undefined;
4246
+ respond: (result: unknown) => Promise<void>;
4247
+ } | {
4248
+ name: string;
4249
+ description: string;
4250
+ toolCallId: string;
4251
+ agentId?: string;
4252
+ args: T;
4253
+ status: ToolCallStatus.Complete;
4254
+ result: string;
4255
+ respond: undefined;
4256
+ };
4257
+ /**
4258
+ * A tool call renderer registration. Core stores and looks up renderers by
4259
+ * `name` and `agentId`. It never calls `render`, so each framework picks its
4260
+ * own render type (a React component, a Vue render function, and so on).
4261
+ *
4262
+ * @typeParam T - The shape of the tool arguments.
4263
+ * @typeParam TRender - The framework's render type.
4264
+ */
4265
+ interface ToolCallRendererDef<T = unknown, TRender = unknown> {
4266
+ /** Tool name to match. Use `"*"` for a wildcard renderer. */
4267
+ name: string;
4268
+ /**
4269
+ * Schema describing the tool arguments. Optional: renderers registered for
4270
+ * tools without parameters (e.g. HITL confirm dialogs) have no schema.
4271
+ */
4272
+ args?: StandardSchemaV1<unknown, T>;
4273
+ /**
4274
+ * Optional agent ID to constrain this tool renderer to a specific agent.
4275
+ * If specified, this renderer will only be used for the specified agent.
4276
+ */
4277
+ agentId?: string;
4278
+ /**
4279
+ * Whether calls this renderer draws join the chat's tool-call groups (see
4280
+ * `toolCallDisplay` on `CopilotChatMessageView`). CopilotKit's built-in card
4281
+ * sets it; a renderer that leaves it unset always shows its calls on their
4282
+ * own, since the chat can't tell what it draws (it may even draw nothing).
4283
+ */
4284
+ group?: boolean;
4285
+ /** Draws the tool call. Receives {@link ToolCallRenderProps}. */
4286
+ render: TRender;
4287
+ }
4288
+ /**
4289
+ * Props an activity message renderer receives.
4290
+ *
4291
+ * @typeParam C - The shape of the activity content.
4292
+ */
4293
+ interface ActivityMessageRenderProps<C = unknown> {
4294
+ /** Activity type of the message being drawn. */
4295
+ activityType: string;
4296
+ /** Activity content, parsed with the renderer's `content` schema. */
4297
+ content: C;
4298
+ /** The activity message being drawn. */
4299
+ message: ActivityMessage;
4300
+ /** The agent that produced the message, if it is still registered. */
4301
+ agent: AbstractAgent | undefined;
4302
+ }
4303
+ /**
4304
+ * An activity message renderer registration. Core never calls `render`.
4305
+ *
4306
+ * @typeParam C - The shape of the activity content.
4307
+ * @typeParam TRender - The framework's render type.
4308
+ */
4309
+ interface ActivityMessageRendererDef<C = unknown, TRender = unknown> {
4310
+ /**
4311
+ * Activity type to match when rendering. Use "*" as a wildcard renderer.
4312
+ */
4313
+ activityType: string;
4314
+ /**
4315
+ * Optional agent ID to scope the renderer to a particular agent.
4316
+ */
4317
+ agentId?: string;
4318
+ /**
4319
+ * Schema describing the activity content payload.
4320
+ */
4321
+ content: StandardSchemaV1<unknown, C>;
4322
+ /** Draws the activity message. Receives {@link ActivityMessageRenderProps}. */
4323
+ render: TRender;
4324
+ }
4325
+ /** Where a custom message renderer draws, relative to its message. */
4326
+ type CustomMessageRendererPosition = "before" | "after";
4327
+ /** Props a custom message renderer receives. */
4328
+ interface CustomMessageRenderProps {
4329
+ /** The message this renderer draws next to. */
4330
+ message: Message;
4331
+ /** Whether the renderer draws before or after `message`. */
4332
+ position: CustomMessageRendererPosition;
4333
+ /** The run that produced `message`. */
4334
+ runId: string;
4335
+ /** Index of `message` in the whole conversation. */
4336
+ messageIndex: number;
4337
+ /** Index of `message` inside its run. */
4338
+ messageIndexInRun: number;
4339
+ /** How many messages the run produced. */
4340
+ numberOfMessagesInRun: number;
4341
+ /** The agent that owns the conversation. */
4342
+ agentId: string;
4343
+ /** Agent state captured for this run, or `undefined` when the run is unknown. */
4344
+ stateSnapshot: unknown;
4345
+ }
4346
+ /**
4347
+ * A custom message renderer registration. Core never calls `render`.
4348
+ *
4349
+ * @typeParam TRender - The framework's render type.
4350
+ */
4351
+ interface CustomMessageRendererDef<TRender = unknown> {
4352
+ /** Optional agent ID to scope the renderer to a particular agent. */
4353
+ agentId?: string;
4354
+ /** Draws next to a message. Receives {@link CustomMessageRenderProps}. */
4355
+ render: TRender;
4356
+ }
4357
+ //#endregion
4358
+ //#region src/chat/renderers.d.ts
4359
+ /**
4360
+ * Find the renderer that draws a tool call.
4361
+ *
4362
+ * The first rule that matches wins:
4363
+ *
4364
+ * 1. A renderer for `toolName` with `agentId` equal to the current agent.
4365
+ * 2. A renderer for `toolName` with no `agentId`.
4366
+ * 3. The first renderer for `toolName` from any other agent.
4367
+ * 4. The first `"*"` renderer, from any agent.
4368
+ *
4369
+ * Inside each rule, the earlier renderer in the list wins.
4370
+ *
4371
+ * @param renderers - Registered renderers in registration order. If you
4372
+ * build tiers (for example app renderers before built-in ones), flatten
4373
+ * them into one ordered list first.
4374
+ * @param toolName - Name of the tool the agent called.
4375
+ * @param agentId - The agent that owns the chat. The caller picks the
4376
+ * default: React and Vue pass `DEFAULT_AGENT_ID` when the chat has no
4377
+ * agent. With `undefined`, rule 1 matches the same renderers as rule 2.
4378
+ * @returns The renderer, or `null` when no renderer matches. Draw nothing
4379
+ * for `null`.
4380
+ *
4381
+ * @example
4382
+ * ```ts
4383
+ * const renderer = ɵresolveToolCallRenderer(
4384
+ * core.renderToolCalls,
4385
+ * toolCall.function.name,
4386
+ * chatAgentId ?? DEFAULT_AGENT_ID,
4387
+ * );
4388
+ * ```
4389
+ */
4390
+ declare function ɵresolveToolCallRenderer<R extends {
4391
+ name: string;
4392
+ agentId?: string;
4393
+ }>(renderers: readonly R[], toolName: string, agentId: string | undefined): R | null;
4394
+ /** What {@link ɵresolveActivityRenderer} needs to know about the message. */
4395
+ interface ɵActivityRendererQuery {
4396
+ /** Activity type of the message. */
4397
+ activityType: string;
4398
+ /** The agent that owns the chat. Omit it when the chat has no agent. */
4399
+ agentId?: string;
4400
+ /** The message content, before validation. */
4401
+ content: unknown;
4402
+ }
4403
+ /**
4404
+ * Find the renderer that draws an activity message, and validate the
4405
+ * message content with that renderer's `content` schema.
4406
+ *
4407
+ * The first rule that matches picks the renderer:
4408
+ *
4409
+ * 1. A renderer for `activityType` with `agentId` equal to the current agent.
4410
+ * 2. A renderer for `activityType` with no `agentId`.
4411
+ * 3. The first `"*"` renderer, from any agent.
4412
+ *
4413
+ * A renderer for `activityType` that belongs to a different agent never
4414
+ * matches. Inside each rule, the earlier renderer in the list wins.
4415
+ *
4416
+ * Only the picked renderer validates the content. When validation fails, or
4417
+ * the schema validates asynchronously, the result is `null`. The function
4418
+ * does not try the next renderer.
4419
+ *
4420
+ * @param renderers - Registered renderers in registration order.
4421
+ * @param query - The activity type, the current agent, and the raw content.
4422
+ * @returns `{ renderer, content }`, where `content` is the value the schema
4423
+ * returned. Pass that value to `render`, not the raw content. Returns
4424
+ * `null` when no renderer matches or validation does not pass.
4425
+ *
4426
+ * @example
4427
+ * ```ts
4428
+ * const match = ɵresolveActivityRenderer(core.renderActivityMessages, {
4429
+ * activityType: message.activityType,
4430
+ * agentId,
4431
+ * content: message.content,
4432
+ * });
4433
+ * if (match) draw(match.renderer.render, match.content);
4434
+ * ```
4435
+ */
4436
+ declare function ɵresolveActivityRenderer<R extends ActivityMessageRendererDef<unknown, unknown>>(renderers: readonly R[], query: ɵActivityRendererQuery): {
4437
+ renderer: R;
4438
+ content: unknown;
4439
+ } | null;
4440
+ /**
4441
+ * List the custom message renderers that apply to an agent, in the order to
4442
+ * try them.
4443
+ *
4444
+ * The list keeps renderers with no `agentId` and renderers for `agentId`.
4445
+ * Renderers for `agentId` come first. Inside each group, registration order
4446
+ * stays the same.
4447
+ *
4448
+ * The framework tries each renderer in this order and shows the first one
4449
+ * that draws something (a non-null result).
4450
+ *
4451
+ * @param renderers - Registered renderers in registration order.
4452
+ * @param agentId - The agent that owns the chat.
4453
+ * @returns A new array. Empty when no renderer applies.
4454
+ *
4455
+ * @example
4456
+ * ```ts
4457
+ * const candidates = ɵresolveCustomMessageRenderers(
4458
+ * core.renderCustomMessages,
4459
+ * agentId,
4460
+ * );
4461
+ * ```
4462
+ */
4463
+ declare function ɵresolveCustomMessageRenderers<R extends CustomMessageRendererDef<unknown>>(renderers: readonly R[], agentId: string): R[];
4464
+ //#endregion
4465
+ //#region src/chat/interrupt-types.d.ts
4466
+ /** Name of the legacy custom event agents emit to signal an interrupt. */
4467
+ declare const INTERRUPT_EVENT_NAME = "on_interrupt";
4468
+ /** Legacy custom-event interrupt payload (agent emits a custom `on_interrupt` event). */
4469
+ type InterruptEvent<TValue = unknown> = ɵInterruptEvent<TValue>;
4470
+ /**
4471
+ * Resolve the agent with user input for an interrupt.
4472
+ *
4473
+ * - Standard interrupts: records `{ status: "resolved", payload }` for the target
4474
+ * interrupt (defaults to the primary one). Resumes once every open interrupt is
4475
+ * addressed; returns the resume run result, or `void` while still awaiting others.
4476
+ * - Legacy interrupts: resumes immediately via `command.resume = payload`.
4477
+ */
4478
+ type InterruptResolveFn = (payload?: unknown, interruptId?: string) => Promise<RunAgentResult | void>;
4479
+ /**
4480
+ * Cancel an interrupt.
4481
+ *
4482
+ * - Standard interrupts: records `{ status: "cancelled" }` for the target interrupt
4483
+ * (defaults to the primary one), then resumes once all are addressed.
4484
+ * - Legacy interrupts: dismisses the pending interrupt without resuming.
4485
+ */
4486
+ type InterruptCancelFn = (interruptId?: string) => Promise<RunAgentResult | void>;
4487
+ /**
4488
+ * Props an interrupt handler receives.
4489
+ *
4490
+ * @typeParam TValue - The shape of the interrupt value.
4491
+ */
4492
+ interface InterruptHandlerProps<TValue = unknown> {
4493
+ /**
4494
+ * Legacy event shape (`{ name, value }`). Always present for back-compat: for
4495
+ * standard interrupts, `value` is the primary `Interrupt` and `name` is `"on_interrupt"`.
4496
+ * Prefer `interrupt` / `interrupts` for standard interrupts.
4497
+ */
4498
+ event: InterruptEvent<TValue>;
4499
+ /** Primary standard interrupt (`interrupts[0]`), or `null` for legacy interrupts. */
4500
+ interrupt: Interrupt | null;
4501
+ /** All open standard interrupts (empty array for legacy interrupts). */
4502
+ interrupts: Interrupt[];
4503
+ resolve: InterruptResolveFn;
4504
+ cancel: InterruptCancelFn;
4505
+ }
4506
+ /**
4507
+ * Props an interrupt renderer receives. Same as {@link InterruptHandlerProps},
4508
+ * plus the value the handler returned.
4509
+ *
4510
+ * @typeParam TValue - The shape of the interrupt value.
4511
+ * @typeParam TResult - The value the interrupt handler returned.
4512
+ */
4513
+ interface InterruptRenderProps<TValue = unknown, TResult = unknown> {
4514
+ event: InterruptEvent<TValue>;
4515
+ interrupt: Interrupt | null;
4516
+ interrupts: Interrupt[];
4517
+ /** The value the interrupt handler returned. */
4518
+ result: TResult;
4519
+ resolve: InterruptResolveFn;
4520
+ cancel: InterruptCancelFn;
4521
+ }
4522
+ //#endregion
4523
+ //#region src/chat/tool-call-layout.d.ts
4524
+ /**
4525
+ * How the chat shows tool calls.
4526
+ *
4527
+ * - `"grouped"` (default): calls made in a row share one card, collapsed to a
4528
+ * summary ("Used 3 tools") that opens to a row per call.
4529
+ * - `"line"`: the same grouping as a quiet line of text, like the reasoning
4530
+ * message's "Thought for 4 seconds".
4531
+ * - `"stacked"`: the latest call on top of a stack of the earlier ones; click
4532
+ * to fan the stack out into its cards.
4533
+ * - `"turn"`: the agent works in the open (narration, then a row per call),
4534
+ * and when the reply is done everything before it folds into "Worked for 9s".
4535
+ * - `"separate"`: every call gets its own card.
4536
+ *
4537
+ * Only calls drawn by a renderer that opts into grouping (`group: true`) are
4538
+ * grouped. CopilotKit's built-in tool card does. Any other call always shows
4539
+ * on its own and splits the group around it.
4540
+ */
4541
+ type CopilotChatToolCallDisplay = "grouped" | "line" | "stacked" | "turn" | "separate";
4542
+ /** One tool call and, once it has finished, the message carrying its result. */
4543
+ interface ToolCallEntry {
4544
+ toolCall: ToolCall$1;
4545
+ toolMessage?: ToolMessage;
4546
+ }
4547
+ type ToolCallSegment = /** Consecutive calls drawn by renderers that opted into grouping. */{
4548
+ kind: "group";
4549
+ id: string;
4550
+ calls: ToolCallEntry[]; /** Nothing renders after this group yet, so a running agent may add to it. */
4551
+ trailing: boolean;
4552
+ }
4553
+ /**
4554
+ * A call drawn by a renderer that didn't opt into grouping, or with no
4555
+ * renderer at all. The latter renders nothing (and warns in development)
4556
+ * without breaking a group.
4557
+ */
4558
+ | {
4559
+ kind: "call";
4560
+ id: string;
4561
+ call: ToolCallEntry;
4562
+ rendered: boolean;
4563
+ };
4564
+ /** What one assistant message's tool-call area renders. */
4565
+ interface ToolCallLayout {
4566
+ segments: ToolCallSegment[];
4567
+ /** Changes whenever anything this layout renders changes. Use it to memoize. */
4568
+ signature: string;
4569
+ }
4570
+ /** Which tool-call renderers are registered. */
4571
+ interface ToolCallRendererNames {
4572
+ /** Tool names with a renderer of their own. */
4573
+ named: ReadonlySet<string>;
4574
+ /** Of those, the ones whose renderer opted into grouping. */
4575
+ groupedNames: ReadonlySet<string>;
4576
+ /** A wildcard (`"*"`) renderer is registered. */
4577
+ wildcard: boolean;
4578
+ /** The wildcard renderer opted into grouping (the built-in card does). */
4579
+ wildcardGroups: boolean;
4580
+ }
4581
+ /**
4582
+ * The tool-call display state a message view hands down to each message's
4583
+ * tool-call area, so every layer follows the view's `toolCallDisplay`.
4584
+ */
4585
+ interface ToolCallDisplayContextValue {
4586
+ display: CopilotChatToolCallDisplay;
4587
+ isRunning: boolean;
4588
+ /** Each assistant message's tool calls, laid out across the whole list. */
4589
+ layouts: ReadonlyMap<string, ToolCallLayout>;
4590
+ /**
4591
+ * `"turn"` display: for each message in a reply's working phase, whether
4592
+ * that work is showing. Messages not in here are the reply itself.
4593
+ */
4594
+ workOpen: ReadonlyMap<string, boolean>;
4595
+ /**
4596
+ * Like `workOpen`, for the messages' text: text that ends the reply stays
4597
+ * out of it even when its message also calls a tool.
4598
+ */
4599
+ workTextOpen: ReadonlyMap<string, boolean>;
4600
+ }
4601
+ /**
4602
+ * Indexes tool results by the id of the call they answer.
4603
+ *
4604
+ * @param messages - The messages to search. Only `role: "tool"` messages count.
4605
+ */
4606
+ declare function getToolResults(messages: readonly Message$1[]): Map<string, ToolMessage>;
4607
+ /**
4608
+ * Lays out the tool calls of every assistant message in `rendered`.
4609
+ *
4610
+ * Calls drawn by a renderer that opted into grouping join the group that is
4611
+ * open. Anything else that shows between them closes it: assistant text, a
4612
+ * user, reasoning or activity message, or a call drawn by any other renderer.
4613
+ * A group belongs to the message where it starts, so later messages whose
4614
+ * calls joined it render no tool calls themselves.
4615
+ *
4616
+ * @param rendered - The messages as the chat renders them, in order.
4617
+ * @param all - Every message, for finding tool results (a transform may hide them).
4618
+ * @param renderers - The registered renderers, from `getToolCallRendererNames`.
4619
+ * @returns A map from assistant message id to its layout.
4620
+ *
4621
+ * @example
4622
+ * ```ts
4623
+ * const names = getToolCallRendererNames(core.renderToolCalls);
4624
+ * const layouts = getToolCallLayouts(renderedMessages, messages, names);
4625
+ * layouts.get(message.id)?.segments;
4626
+ * ```
4627
+ */
4628
+ declare function getToolCallLayouts(rendered: readonly Message$1[], all: readonly Message$1[], renderers: ToolCallRendererNames): Map<string, ToolCallLayout>;
4629
+ /** Options for `getToolCallRendererNames`. */
4630
+ interface ToolCallRendererNamesOptions {
4631
+ /**
4632
+ * The names of the tool-call slots a view was given (Vue). A slot wins over
4633
+ * a registered renderer and never groups, because the chat cannot tell what
4634
+ * it draws. `tool-call-<name>` takes that tool. `tool-call` takes every
4635
+ * tool and turns grouping off.
4636
+ */
4637
+ slotNames?: readonly string[];
4638
+ /**
4639
+ * More tool names that have a renderer of their own, which never group
4640
+ * (Angular: client tool renderers with a component, and human-in-the-loop
4641
+ * tools).
4642
+ */
4643
+ extraNamed?: readonly string[];
4644
+ /**
4645
+ * A built-in wildcard card that draws tools no other renderer takes
4646
+ * (Angular: `defaultToolRendering`). A registered `"*"` renderer wins over
4647
+ * it, including its `group` choice.
4648
+ */
4649
+ builtInWildcard?: {
4650
+ enabled: boolean;
4651
+ groups: boolean;
4652
+ };
4653
+ }
4654
+ /**
4655
+ * Works out which tool calls have a renderer and which of those group, for
4656
+ * `getToolCallLayouts`.
4657
+ *
4658
+ * @param renderers - The registered renderers. A renderer named `"*"` is the
4659
+ * wildcard. `group: true` opts the renderer into grouping.
4660
+ * @param options - Slots, extra named tools, and a built-in wildcard card.
4661
+ * See `ToolCallRendererNamesOptions`.
4662
+ *
4663
+ * @example
4664
+ * ```ts
4665
+ * // React: only registered renderers.
4666
+ * getToolCallRendererNames(core.renderToolCalls);
4667
+ * // Vue: the view's slots count too.
4668
+ * getToolCallRendererNames(core.renderToolCalls, { slotNames: Object.keys(slots) });
4669
+ * // Angular: client and human-in-the-loop renderers, and the built-in card.
4670
+ * getToolCallRendererNames(appRenderers, {
4671
+ * extraNamed: [...clientNames, ...hitlNames],
4672
+ * builtInWildcard: { enabled: defaultToolRenderingEnabled, groups: true },
4673
+ * });
4674
+ * ```
4675
+ */
4676
+ declare function getToolCallRendererNames(renderers: ReadonlyArray<{
4677
+ name: string;
4678
+ group?: boolean;
4679
+ }>, options?: ToolCallRendererNamesOptions): ToolCallRendererNames;
4680
+ /** A reply's working phase, for the `"turn"` display. */
4681
+ interface TurnWork {
4682
+ /** Stable across the turn's life: the id of the user message it answers. */
4683
+ key: string;
4684
+ /** The first assistant-side message, where the "Worked for" line goes. */
4685
+ firstMessageId: string;
4686
+ /** Everything up to and including the last message with a tool call. */
4687
+ workMessageIds: ReadonlySet<string>;
4688
+ /**
4689
+ * The reply's last assistant message, when it has text and is part of the
4690
+ * work (it also calls a tool). Its text is the answer, so it stays out.
4691
+ */
4692
+ replyTextMessageId?: string;
4693
+ calls: ToolCallEntry[];
4694
+ /** No user message follows, so the agent may still be working on it. */
4695
+ isLatest: boolean;
4696
+ }
4697
+ /**
4698
+ * Finds the working phase of every reply in `rendered`: its messages up to the
4699
+ * last one that calls a tool. Text in there was narration. What follows is the
4700
+ * reply itself. Replies that called no tools are left out, except the latest,
4701
+ * which may be about to.
4702
+ *
4703
+ * @param rendered - The messages as the chat renders them, in order.
4704
+ * @param layouts - The layouts from `getToolCallLayouts` for the same messages.
4705
+ * @returns A map from turn key (see `TurnWork.key`) to the turn's work.
4706
+ */
4707
+ declare function getTurnWork(rendered: readonly Message$1[], layouts: ReadonlyMap<string, ToolCallLayout>): Map<string, TurnWork>;
4708
+ /**
4709
+ * The key of the latest reply (see `TurnWork.key`): the id of the last user
4710
+ * message, or `"start"` when there is none.
4711
+ *
4712
+ * @param rendered - The messages as the chat renders them, in order.
4713
+ */
4714
+ declare function getLatestTurnKey(rendered: readonly Message$1[]): string;
4715
+ /** What decides whether a `"turn"` reply's work shows. */
4716
+ interface TurnOpenState {
4717
+ /** Turns the user opened (`true`) or closed (`false`) by hand. */
4718
+ toggledTurns: ReadonlyMap<string, boolean>;
4719
+ isRunning: boolean;
4720
+ /** From `getLatestTurnKey`. */
4721
+ latestTurnKey: string;
4722
+ }
4723
+ /**
4724
+ * Whether the agent is working on this reply now: it is the latest one and a
4725
+ * run is going.
4726
+ *
4727
+ * @param turnKey - The reply's `TurnWork.key`.
4728
+ * @param state - The run state and the latest turn key.
4729
+ */
4730
+ declare function isTurnWorking(turnKey: string, state: Pick<TurnOpenState, "isRunning" | "latestTurnKey">): boolean;
4731
+ /**
4732
+ * Whether a reply's work shows. It shows while the agent works on the reply
4733
+ * and folds once the reply is done, unless the user opened or closed it.
4734
+ *
4735
+ * @param turnKey - The reply's `TurnWork.key`.
4736
+ * @param state - The user's toggles, the run state, and the latest turn key.
4737
+ */
4738
+ declare function isTurnWorkOpen(turnKey: string, state: TurnOpenState): boolean;
4739
+ /**
4740
+ * For each message in a reply's working phase, whether its work and its text
4741
+ * show. Text that ends the reply stays out of `workTextOpen` even when its
4742
+ * message also calls a tool, because it is the answer.
4743
+ *
4744
+ * @param turns - The turns from `getTurnWork`.
4745
+ * @param state - The user's toggles, the run state, and the latest turn key.
4746
+ * @returns The `workOpen` and `workTextOpen` maps of `ToolCallDisplayContextValue`.
4747
+ */
4748
+ declare function getWorkOpenState(turns: Iterable<TurnWork>, state: TurnOpenState): {
4749
+ workOpen: Map<string, boolean>;
4750
+ workTextOpen: Map<string, boolean>;
4751
+ };
4752
+ /** How long the agent has worked on one reply, summed over its runs. */
4753
+ interface WorkTime {
4754
+ elapsedMs: number;
4755
+ /** When the current run started (epoch ms), while the agent works. */
4756
+ workingSince?: number;
4757
+ }
4758
+ /**
4759
+ * Records run starts and ends in `workTimes`, for "Worked for 9s". Time spent
4760
+ * between runs (say, waiting for an approval) does not count. A reply is only
4761
+ * timed when this client saw it start from the user's message, so a restored
4762
+ * thread gets no entry. Calling it again with the same state changes nothing.
4763
+ *
4764
+ * @param workTimes - The times by turn key. This function updates it in place.
4765
+ * @param state - The run state now.
4766
+ * @param state.lastMessageRole - The role of the last rendered message.
4767
+ * @param state.now - The current time, in epoch ms.
4768
+ */
4769
+ declare function recordWorkTime(workTimes: Map<string, WorkTime>, state: {
4770
+ isRunning: boolean;
4771
+ latestTurnKey: string;
4772
+ lastMessageRole: Message$1["role"] | undefined;
4773
+ now: number;
4774
+ }): void;
4775
+ /**
4776
+ * The status of one row in a tool-call group. A call that never got a result
4777
+ * after the run ended (Stop, an error) is `"stopped"`.
4778
+ */
4779
+ type ToolCallRowStatus = "running" | "done" | "failed" | "stopped";
4780
+ /**
4781
+ * The status of one call in a group. A call without a result is running only
4782
+ * while the group is active: once the run has moved on or ended, its result
4783
+ * is never coming.
4784
+ *
4785
+ * @param entry - The call and its result, if any.
4786
+ * @param active - The agent may still finish the group's calls.
4787
+ */
4788
+ declare function getToolCallRowStatus(entry: ToolCallEntry, active: boolean): ToolCallRowStatus;
4789
+ /**
4790
+ * The first non-empty string argument, with runs of whitespace collapsed to
4791
+ * one space. This is usually a command, path or query.
4792
+ *
4793
+ * @param parameters - The call's parsed arguments.
4794
+ * @returns The preview, or `undefined` when no argument is a non-empty string.
4795
+ */
4796
+ declare function getArgumentPreview(parameters: unknown): string | undefined;
4797
+ /**
4798
+ * `getArgumentPreview` for a call whose arguments may still be streaming in
4799
+ * as partial JSON.
4800
+ *
4801
+ * @param entry - The call.
4802
+ */
4803
+ declare function getToolCallPreview(entry: ToolCallEntry): string | undefined;
4804
+ /**
4805
+ * The names of the tools the calls used, in first-use order, with a count
4806
+ * for repeats: `"run_command ×2, read_file"`.
4807
+ *
4808
+ * @param calls - The calls to name.
4809
+ */
4810
+ declare function formatToolNames(calls: readonly ToolCallEntry[]): string;
4811
+ /**
4812
+ * How many of the calls finished with an error.
4813
+ *
4814
+ * @param calls - The calls to count.
4815
+ */
4816
+ declare function countFailedToolCalls(calls: readonly ToolCallEntry[]): number;
4817
+ /**
4818
+ * A count followed by the word that fits it: `"1 tool"`, `"3 tools"`.
4819
+ *
4820
+ * @param count - The number to show.
4821
+ * @param words - The word for exactly one (`one`) and for any other count (`other`).
4822
+ *
4823
+ * @example
4824
+ * ```ts
4825
+ * pluralize(3, { one: "tool", other: "tools" }); // "3 tools"
4826
+ * ```
4827
+ */
4828
+ declare function pluralize(count: number, words: {
4829
+ one: string;
4830
+ other: string;
4831
+ }): string;
4832
+ /**
4833
+ * A tool call's arguments or result as display text. Strings pass through.
4834
+ * Other values are pretty-printed JSON. A value JSON cannot encode (say, a
4835
+ * circular reference) falls back to `String(value)`, then to
4836
+ * `"[unserializable]"`, so it never throws during a render.
4837
+ *
4838
+ * @param value - The arguments or the result.
4839
+ */
4840
+ declare function stringifyToolCallPayload(value: unknown): string;
4841
+ /**
4842
+ * How long a `"turn"` reply worked, as short text: `"45s"`, `"1m 5s"`, `"2m"`.
4843
+ * Used for the live timer and the final duration. Partial seconds round down,
4844
+ * and a negative time reads `"0s"`.
4845
+ *
4846
+ * @param ms - The time in milliseconds.
4847
+ */
4848
+ declare function formatWorkDuration(ms: number): string;
4849
+ /**
4850
+ * How long a model reasoned, split into the parts a label needs. The default
4851
+ * English text for each unit:
4852
+ *
4853
+ * - `fewSeconds`: `"a few seconds"`.
4854
+ * - `seconds`: `"${seconds} seconds"`.
4855
+ * - `minutes`: `"1 minute"`, or `"${minutes} minutes"` when more than one.
4856
+ * - `minutesSeconds`: `"${minutes}m ${seconds}s"`.
4857
+ */
4858
+ type ReasoningDuration = {
4859
+ unit: "fewSeconds";
4860
+ } | {
4861
+ unit: "seconds";
4862
+ seconds: number;
4863
+ } | {
4864
+ unit: "minutes";
4865
+ minutes: number;
4866
+ } | {
4867
+ unit: "minutesSeconds";
4868
+ minutes: number;
4869
+ seconds: number;
4870
+ };
4871
+ /**
4872
+ * Splits a reasoning time into the unit and counts the "Thought for ..."
4873
+ * header shows. See `ReasoningDuration` for the text each unit maps to.
4874
+ *
4875
+ * - Under 1 second: `fewSeconds`.
4876
+ * - Under 60 seconds: `seconds`, rounded to the nearest second.
4877
+ * - Whole minutes after rounding the seconds: `minutes`.
4878
+ * - Otherwise: `minutesSeconds`.
4879
+ *
4880
+ * @param seconds - The elapsed time in seconds. It may have a fraction.
4881
+ */
4882
+ declare function formatReasoningDuration(seconds: number): {
4883
+ unit: "fewSeconds";
4884
+ seconds?: undefined;
4885
+ minutes?: undefined;
4886
+ } | {
4887
+ unit: "seconds";
4888
+ seconds: number;
4889
+ minutes?: undefined;
4890
+ } | {
4891
+ unit: "minutes";
4892
+ minutes: number;
4893
+ seconds?: undefined;
4894
+ } | {
4895
+ unit: "minutesSeconds";
4896
+ minutes: number;
4897
+ seconds: number;
4898
+ };
4899
+ //#endregion
4900
+ //#region src/chat/messages.d.ts
4901
+ /**
4902
+ * De-duplicates chat messages by id, for rendering.
4903
+ *
4904
+ * A message list from an agent can hold the same message id more than once
4905
+ * while it streams. This keeps one entry per id, at the position the id first
4906
+ * appears:
4907
+ *
4908
+ * - **Assistant messages** are merged. Later fields win, but empty `content`
4909
+ * falls back to earlier non-empty content, and `toolCalls: undefined` falls
4910
+ * back to earlier tool calls (an explicit `[]` is kept).
4911
+ * - **Tool calls** on an assistant message are de-duplicated by id, also
4912
+ * when the message itself is not repeated. The copy that has arguments
4913
+ * wins, and the first-seen order is kept.
4914
+ * - **Other roles** keep the last copy.
4915
+ *
4916
+ * @param messages - The agent's messages, in order.
4917
+ * @returns A new array. A message that needed no change is returned as the
4918
+ * same object.
4919
+ *
4920
+ * @example
4921
+ * ```ts
4922
+ * const visible = ɵdeduplicateMessages(agent.messages);
4923
+ * ```
4924
+ */
4925
+ declare function ɵdeduplicateMessages(messages: readonly Message$1[]): Message$1[];
4926
+ /**
4927
+ * Builds a string that changes whenever a render of the message list could
4928
+ * change. Use it as a cheap memo key in place of a deep comparison.
4929
+ *
4930
+ * The key covers, per message:
4931
+ * - the id and the role.
4932
+ * - the content: text length, part count, or the JSON of object content.
4933
+ * - the `toolCallId` of a tool message.
4934
+ * - each tool call's id and the length of its arguments, so streamed
4935
+ * arguments change the key.
4936
+ *
4937
+ * It never throws. Object content that cannot be serialized (for example a
4938
+ * circular tool result) gets a constant key.
4939
+ *
4940
+ * @param messages - The agent's messages, in order.
4941
+ * @returns The fingerprint string.
4942
+ *
4943
+ * @example
4944
+ * ```ts
4945
+ * const key = ɵmessagesFingerprint(agent.messages);
4946
+ * if (key !== previousKey) rerender();
4947
+ * ```
4948
+ */
4949
+ declare function ɵmessagesFingerprint(messages: readonly Message$1[]): string;
4950
+ //#endregion
4951
+ //#region src/chat/composer.d.ts
4952
+ /**
4953
+ * Send and stop rules for the chat input (the composer).
4954
+ *
4955
+ * These functions hold no state and touch no DOM. React, Vue, and Angular
4956
+ * call them so the three chat inputs make the same send or stop decision.
4957
+ */
4958
+ /** What the chat input shows: the text box, the recorder, or a spinner. */
4959
+ type ɵComposerMode = "input" | "transcribe" | "processing";
4960
+ /** What the chat input knows when it decides to send or stop. */
4961
+ interface ɵComposerInput {
4962
+ /** What the input shows. Default: `"input"`. */
4963
+ mode?: ɵComposerMode;
4964
+ /** `true` while the agent runs. */
4965
+ isRunning: boolean;
4966
+ /** The text in the input, before trimming. */
4967
+ value: string;
4968
+ /** `true` when the input has a handler that sends a message. */
4969
+ canSubmit: boolean;
4970
+ /** `true` when the input has a handler that stops the run. */
4971
+ canStop: boolean;
4972
+ /** `true` when the whole input is disabled. Send is off. Stop stays on. */
4973
+ disabled?: boolean;
4974
+ /** `true` while attached files upload. Send is off. Stop stays on. */
4975
+ attachmentsUploading?: boolean;
4976
+ }
4977
+ /**
4978
+ * Get the state of the send/stop button in the chat input.
4979
+ *
4980
+ * @param input - The current state of the chat input.
4981
+ * @returns
4982
+ * - `isProcessing`: the agent runs and the input does not record audio.
4983
+ * - `canSend`: the text is not empty and nothing blocks a send.
4984
+ * - `action`: `"stop"` when the button stops the run, else `"send"`.
4985
+ * Use it for the icon, the label, and the click.
4986
+ * - `disabled`: `true` when a click does nothing.
4987
+ *
4988
+ * @example
4989
+ * ```ts
4990
+ * const button = ɵcomposerButtonState({
4991
+ * mode: "input",
4992
+ * isRunning: agent.isRunning,
4993
+ * value: text,
4994
+ * canSubmit: true,
4995
+ * canStop: true,
4996
+ * });
4997
+ * // On click:
4998
+ * if (button.action === "stop") stopRun();
4999
+ * else if (button.canSend) sendMessage(text.trim());
5000
+ * ```
5001
+ */
5002
+ declare function ɵcomposerButtonState(input: ɵComposerInput): {
5003
+ isProcessing: boolean;
5004
+ canSend: boolean;
5005
+ action: "send" | "stop";
5006
+ disabled: boolean;
5007
+ };
5008
+ /** The keyboard fields that {@link ɵresolveComposerKey} reads. */
5009
+ interface ɵComposerKeyEvent {
5010
+ key: string;
5011
+ shiftKey: boolean;
5012
+ isComposing: boolean;
5013
+ /** `229` means the key is part of IME composition in some browsers. */
5014
+ keyCode?: number;
5015
+ }
5016
+ /**
5017
+ * Decide what a key press in the chat input does.
5018
+ *
5019
+ * This handles Enter only. Keys for the slash-command menu stay in each
5020
+ * framework, and the framework handles them before it calls this function.
5021
+ *
5022
+ * Results:
5023
+ * - `"send"`: send the trimmed text.
5024
+ * - `"stop"`: stop the run. This happens for Enter in an empty input while
5025
+ * the agent runs. Text in the input always means send, not stop.
5026
+ * - `"newline"`: Shift+Enter. Let the browser add the line break.
5027
+ * - `"none"`: do nothing. Returned during IME composition, while the input
5028
+ * is disabled, for keys other than Enter, and for an Enter that has
5029
+ * nothing to send or stop.
5030
+ *
5031
+ * Call `preventDefault()` for every Enter without Shift that is not part of
5032
+ * IME composition, including when the result is `"none"`. This stops Enter
5033
+ * from adding a line break that the user cannot send.
5034
+ *
5035
+ * @param event - The keyboard event, or an object with the same fields.
5036
+ * @param input - The current state of the chat input.
5037
+ *
5038
+ * @example
5039
+ * ```ts
5040
+ * function onKeyDown(event: KeyboardEvent) {
5041
+ * if (event.isComposing || event.keyCode === 229) return;
5042
+ * // ...slash-command menu keys...
5043
+ * const result = ɵresolveComposerKey(event, composerInput);
5044
+ * if (event.key === "Enter" && !event.shiftKey) event.preventDefault();
5045
+ * if (result === "send") sendMessage(composerInput.value.trim());
5046
+ * if (result === "stop") stopRun();
5047
+ * }
5048
+ * ```
5049
+ */
5050
+ declare function ɵresolveComposerKey(event: ɵComposerKeyEvent, input: ɵComposerInput): "send" | "stop" | "none" | "newline";
5051
+ //#endregion
5052
+ //#region src/chat/transcription.d.ts
5053
+ /** The text the runtime returned for one recording. */
5054
+ interface TranscriptionResult {
5055
+ text: string;
5056
+ size: number;
5057
+ type: string;
5058
+ }
5059
+ /** Why a transcription failed, and whether trying again can help. */
5060
+ interface TranscriptionErrorInfo {
5061
+ code: TranscriptionErrorCode;
5062
+ message: string;
5063
+ retryable: boolean;
5064
+ }
5065
+ /**
5066
+ * The error `ɵtranscribeAudio` throws. Read `error.info.code` to pick a
5067
+ * message for the user, or pass `error.info` to
5068
+ * `ɵtranscriptionErrorMessageKey`.
5069
+ */
5070
+ declare class TranscriptionError extends Error {
5071
+ readonly info: TranscriptionErrorInfo;
5072
+ constructor(info: TranscriptionErrorInfo);
5073
+ }
5074
+ /** The parts of `CopilotKitCore` that a transcription request reads. */
5075
+ type TranscriptionCore = Pick<CopilotKitCore, "runtimeUrl" | "runtimeTransport" | "resolveHeaders" | "credentials">;
5076
+ /**
5077
+ * Send a recording to the CopilotKit runtime and get its text back.
5078
+ *
5079
+ * The request follows the transport set on the core:
5080
+ * - `"single"`: one JSON POST to `runtimeUrl`, with the audio as base64.
5081
+ * - any other transport: a multipart POST to `${runtimeUrl}/transcribe`.
5082
+ *
5083
+ * Headers are resolved on each call. The core's `credentials` are sent when
5084
+ * they are set, the same as for agent requests.
5085
+ *
5086
+ * @param core - The `CopilotKitCore` (or a framework subclass) to send through.
5087
+ * @param audioBlob - The recorded audio.
5088
+ * @param filename - The file name the runtime sees. Defaults to `"recording.webm"`.
5089
+ * @returns The transcription result, with the text in `result.text`.
5090
+ * @throws {TranscriptionError} When the runtime URL is not set, the request
5091
+ * fails, or the runtime returns an error. `error.info` has the code.
5092
+ *
5093
+ * @example
5094
+ * ```ts
5095
+ * try {
5096
+ * const { text } = await ɵtranscribeAudio(core, blob);
5097
+ * } catch (error) {
5098
+ * if (error instanceof TranscriptionError) {
5099
+ * const key = ɵtranscriptionErrorMessageKey(error.info);
5100
+ * showError(key ? labels[key] : error.info.message);
5101
+ * }
5102
+ * }
5103
+ * ```
5104
+ */
5105
+ declare function ɵtranscribeAudio(core: TranscriptionCore, audioBlob: Blob, filename?: string): Promise<TranscriptionResult>;
5106
+ /**
5107
+ * Pick the chat label to show the user for a transcription error.
5108
+ *
5109
+ * @param error - The `info` of a `TranscriptionError`.
5110
+ * @returns A key of the chat labels, or `null`. `null` means no label fits:
5111
+ * show `error.message` instead.
5112
+ *
5113
+ * @example
5114
+ * ```ts
5115
+ * const key = ɵtranscriptionErrorMessageKey(error.info);
5116
+ * const text = key ? labels[key] : error.info.message;
5117
+ * ```
5118
+ */
5119
+ declare function ɵtranscriptionErrorMessageKey(error: TranscriptionErrorInfo): "transcriptionErrorRateLimitedText" | "transcriptionErrorAuthFailedText" | "transcriptionErrorAudioTooLongText" | "transcriptionErrorAudioTooShortText" | "transcriptionErrorInvalidAudioFormatText" | "transcriptionErrorServiceNotConfiguredText" | "transcriptionErrorNetworkText" | "transcriptionErrorGenericText" | null;
5120
+ /** The chat label keys that `ɵtranscriptionErrorMessageKey` can return. */
5121
+ type ɵTranscriptionErrorLabelKey = NonNullable<ReturnType<typeof ɵtranscriptionErrorMessageKey>>;
5122
+ //#endregion
5123
+ //#region src/chat/license.d.ts
5124
+ /** Input for {@link ɵresolveLicenseState}. */
5125
+ interface LicenseStateInput {
5126
+ /**
5127
+ * The legacy license status the runtime reported through `/info`
5128
+ * (`core.licenseStatus`). Leave it out until the first `/info` response.
5129
+ */
5130
+ status?: RuntimeLicenseStatus$1;
5131
+ /**
5132
+ * The structured entitlement response the runtime reported through `/info`
5133
+ * (`core.runtimeEntitlements`).
5134
+ */
5135
+ entitlements?: RuntimeEntitlementResponse;
5136
+ /**
5137
+ * Whether core is still retrying a retryable entitlement failure
5138
+ * (`core.runtimeEntitlementRetryPending`).
5139
+ */
5140
+ retryPending: boolean;
5141
+ /** The public API key or public license key given to the provider. */
5142
+ publicKey?: string;
5143
+ }
5144
+ /**
5145
+ * Resolves the license context and the license banner from the runtime
5146
+ * license authority. React, Vue, and Angular call it with the values core
5147
+ * reports, then show the banner and provide the context.
5148
+ *
5149
+ * Rules:
5150
+ *
5151
+ * - A retryable entitlement failure that core is still retrying hides the
5152
+ * status, so no banner shows until the retry ends. A `valid` or `expiring`
5153
+ * legacy status stays in use during the retry.
5154
+ * - A terminal entitlement failure (not retryable, no `valid` or `expiring`
5155
+ * legacy status) keeps the reported status, but `checkFeature` returns
5156
+ * `false` and `getLimit` returns `null` for every feature.
5157
+ * - The `no_license` banner shows only when the status is `none` and no
5158
+ * public key is set.
5159
+ *
5160
+ * The banner text has no day count. No data source gives the days left.
5161
+ *
5162
+ * @param input - The runtime license values and the public key. See
5163
+ * {@link LicenseStateInput}.
5164
+ * @returns `context` for the license context, `warningStatus` (the status the
5165
+ * banner is based on, `undefined` while a retry runs), and `bannerType`
5166
+ * (`null` when no banner shows).
5167
+ *
5168
+ * @example
5169
+ * ```ts
5170
+ * const { context, bannerType } = ɵresolveLicenseState({
5171
+ * status: core.licenseStatus,
5172
+ * entitlements: core.runtimeEntitlements,
5173
+ * retryPending: core.runtimeEntitlementRetryPending,
5174
+ * publicKey,
5175
+ * });
5176
+ * ```
5177
+ */
5178
+ declare function ɵresolveLicenseState({
5179
+ status,
5180
+ entitlements,
5181
+ retryPending,
5182
+ publicKey
5183
+ }: LicenseStateInput): {
5184
+ context: LicenseContextValue;
5185
+ warningStatus: RuntimeLicenseStatus$1 | undefined;
5186
+ bannerType: "expired" | "expiring" | "invalid" | "no_license" | null;
5187
+ };
5188
+ /**
5189
+ * Resolves whether the threads drawer can load its thread list.
5190
+ *
5191
+ * - `licensed` is `true` when the status is `unknown` (an entitlement lookup
5192
+ * that did not recover, so the threads endpoint decides), or when the
5193
+ * status is `valid` or `expiring` and `checkFeature("threads")` is `true`.
5194
+ * - `licensePending` is `true` while the status is `null` (the runtime has
5195
+ * not reported yet). Show the loading state then, not the locked view.
5196
+ *
5197
+ * @param context - The license context from {@link ɵresolveLicenseState}.
5198
+ *
5199
+ * @example
5200
+ * ```ts
5201
+ * const { licensed, licensePending } = ɵresolveThreadsLicense(context);
5202
+ * ```
5203
+ */
5204
+ declare function ɵresolveThreadsLicense(context: LicenseContextValue): {
5205
+ licensed: boolean;
5206
+ licensePending: boolean;
5207
+ };
5208
+ /** The license banners the framework packages can show. */
5209
+ type ɵLicenseBannerType = "no_license" | "expired" | "expiring" | "invalid" | "feature_unlicensed";
5210
+ /** How serious a license banner is; picks its colours. */
5211
+ type ɵLicenseBannerSeverity = "info" | "warning" | "critical";
5212
+ /** Details some banner types show. */
5213
+ interface ɵLicenseBannerDetails {
5214
+ /** The unlicensed feature, for `feature_unlicensed`. */
5215
+ featureName?: string;
5216
+ /** The expiry date as text, for `expired`. */
5217
+ expiryDate?: string;
5218
+ /** Days left, for `expiring`. Without it the text says "soon". */
5219
+ graceRemaining?: number;
5220
+ }
5221
+ /**
5222
+ * What one license banner shows: its severity, text, and link. React, Vue,
5223
+ * and Angular render it with {@link ɵLICENSE_BANNER_STYLE}.
5224
+ *
5225
+ * @param type - The banner type, for example from
5226
+ * {@link ɵresolveLicenseState}'s `bannerType`.
5227
+ * @param labels - The chat labels in effect, so apps can translate the text.
5228
+ * @param details - The feature name, expiry date, or days left.
5229
+ *
5230
+ * @example
5231
+ * ```ts
5232
+ * const spec = ɵgetLicenseBannerSpec("expiring", labels, { graceRemaining: 3 });
5233
+ * // { severity: "warning", message: "… expires in 3 days …", actionLabel: "Renew", … }
5234
+ * ```
5235
+ */
5236
+ declare function ɵgetLicenseBannerSpec(type: ɵLicenseBannerType, labels: CopilotChatLabels, {
5237
+ featureName,
5238
+ expiryDate,
5239
+ graceRemaining
5240
+ }?: ɵLicenseBannerDetails): ɵLicenseBannerSpec;
5241
+ /** What a license banner shows. See {@link ɵgetLicenseBannerSpec}. */
5242
+ interface ɵLicenseBannerSpec {
5243
+ severity: ɵLicenseBannerSeverity;
5244
+ message: string;
5245
+ actionLabel: string;
5246
+ actionUrl: string;
5247
+ }
5248
+ /**
5249
+ * Inline styles of the fixed license banner, in camelCase, for React `style`
5250
+ * and Vue `:style`. `base` is the layout; `severity` holds the colours.
5251
+ */
5252
+ declare const ɵLICENSE_BANNER_STYLE: {
5253
+ readonly base: {
5254
+ readonly position: "fixed";
5255
+ readonly bottom: "8px";
5256
+ readonly left: "50%";
5257
+ readonly transform: "translateX(-50%)";
5258
+ readonly zIndex: 99999;
5259
+ readonly display: "inline-flex";
5260
+ readonly alignItems: "center";
5261
+ readonly gap: "12px";
5262
+ readonly whiteSpace: "nowrap";
5263
+ readonly padding: "8px 16px";
5264
+ readonly fontSize: "13px";
5265
+ readonly fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif";
5266
+ readonly borderRadius: "6px";
5267
+ readonly boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)";
5268
+ };
5269
+ readonly severity: {
5270
+ readonly info: {
5271
+ readonly backgroundColor: "#eff6ff";
5272
+ readonly border: "1px solid #93c5fd";
5273
+ readonly color: "#1e40af";
5274
+ };
5275
+ readonly warning: {
5276
+ readonly backgroundColor: "#fffbeb";
5277
+ readonly border: "1px solid #fbbf24";
5278
+ readonly color: "#92400e";
5279
+ };
5280
+ readonly critical: {
5281
+ readonly backgroundColor: "#fef2f2";
5282
+ readonly border: "1px solid #fca5a5";
5283
+ readonly color: "#991b1b";
5284
+ };
5285
+ };
5286
+ readonly actions: {
5287
+ readonly display: "flex";
5288
+ readonly gap: "8px";
5289
+ readonly alignItems: "center";
5290
+ };
5291
+ readonly link: {
5292
+ readonly fontWeight: 600;
5293
+ readonly textDecoration: "underline";
5294
+ readonly color: "inherit";
5295
+ };
5296
+ readonly dismiss: {
5297
+ readonly background: "none";
5298
+ readonly border: "none";
5299
+ readonly cursor: "pointer";
5300
+ readonly color: "inherit";
5301
+ readonly fontSize: "16px";
5302
+ };
5303
+ };
5304
+ /**
5305
+ * The bottom space the fixed banner takes: banner height (~36px) + bottom
5306
+ * offset (8px) + gap above the chat input (~8px). The chat input reads it
5307
+ * through `padding-bottom: var(--copilotkit-license-banner-offset)`.
5308
+ */
5309
+ declare const ɵLICENSE_BANNER_OFFSET: {
5310
+ readonly cssVar: "--copilotkit-license-banner-offset";
5311
+ readonly px: 52;
5312
+ };
5313
+ /**
5314
+ * Publishes {@link ɵLICENSE_BANNER_OFFSET} on the root element while a
5315
+ * banner shows. Does nothing without a document (SSR).
5316
+ *
5317
+ * @returns A function that removes the offset again.
5318
+ */
5319
+ declare function ɵreserveLicenseBannerOffset(): () => void;
5320
+ /**
5321
+ * What the inline warning shows when a chat component needs a license it
5322
+ * does not have: the `licenseFeatureUnlicensedText` label and a pricing
5323
+ * link. Render it with {@link ɵINLINE_FEATURE_WARNING_STYLE}.
5324
+ */
5325
+ declare function ɵgetInlineFeatureWarningSpec(featureName: string, labels: CopilotChatLabels): {
5326
+ message: string;
5327
+ actionLabel: string;
5328
+ actionUrl: string;
5329
+ };
5330
+ /** Inline styles of the inline feature warning, in camelCase. */
5331
+ declare const ɵINLINE_FEATURE_WARNING_STYLE: {
5332
+ readonly container: {
5333
+ readonly padding: "8px 12px";
5334
+ readonly backgroundColor: "#fffbeb";
5335
+ readonly border: "1px solid #fbbf24";
5336
+ readonly borderRadius: "6px";
5337
+ readonly fontSize: "13px";
5338
+ readonly color: "#92400e";
5339
+ readonly fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif";
5340
+ };
5341
+ readonly link: {
5342
+ readonly color: "#b45309";
5343
+ readonly textDecoration: "underline";
5344
+ };
5345
+ };
5346
+ //#endregion
5347
+ //#region src/chat/icons.d.ts
5348
+ /**
5349
+ * One SVG child element of a chat icon, such as a `<path>` or a `<rect>`.
5350
+ *
5351
+ * Draw it as `<{tag} {...attributes} />` inside the icon's `<svg>`.
5352
+ */
5353
+ interface CopilotIconNode {
5354
+ readonly tag: "path" | "rect" | "circle" | "polygon";
5355
+ /** SVG attributes for the element, for example `{ d: "M5 12h14" }`. */
5356
+ readonly attributes: Readonly<Record<string, string>>;
5357
+ }
5358
+ /** The SVG child elements of one chat icon, in drawing order. */
5359
+ type CopilotIconData = readonly CopilotIconNode[];
5360
+ /** One chat icon: its Lucide name and its SVG child elements. */
5361
+ interface CopilotIconDefinition {
5362
+ /**
5363
+ * The Lucide icon name in kebab case, for example `"arrow-up"`.
5364
+ *
5365
+ * Put `lucide lucide-<name>` in the `<svg>` class so CSS that selects
5366
+ * Lucide classes (such as `.lucide-copy`) keeps working.
5367
+ */
5368
+ readonly name: string;
5369
+ readonly nodes: CopilotIconData;
5370
+ }
5371
+ declare const icons: {
5372
+ ArrowUp: {
5373
+ name: string;
5374
+ nodes: {
5375
+ tag: "path";
5376
+ attributes: {
5377
+ d: string;
5378
+ };
5379
+ }[];
5380
+ };
5381
+ Check: {
5382
+ name: string;
5383
+ nodes: {
5384
+ tag: "path";
5385
+ attributes: {
5386
+ d: string;
5387
+ };
5388
+ }[];
5389
+ };
5390
+ ChevronDown: {
5391
+ name: string;
5392
+ nodes: {
5393
+ tag: "path";
5394
+ attributes: {
5395
+ d: string;
5396
+ };
5397
+ }[];
5398
+ };
5399
+ ChevronLeft: {
5400
+ name: string;
5401
+ nodes: {
5402
+ tag: "path";
5403
+ attributes: {
5404
+ d: string;
5405
+ };
5406
+ }[];
5407
+ };
5408
+ ChevronRight: {
5409
+ name: string;
5410
+ nodes: {
5411
+ tag: "path";
5412
+ attributes: {
5413
+ d: string;
5414
+ };
5415
+ }[];
5416
+ };
5417
+ Circle: {
5418
+ name: string;
5419
+ nodes: {
5420
+ tag: "circle";
5421
+ attributes: {
5422
+ cx: string;
5423
+ cy: string;
5424
+ r: string;
5425
+ };
5426
+ }[];
5427
+ };
5428
+ Copy: {
5429
+ name: string;
5430
+ nodes: ({
5431
+ tag: "path";
5432
+ attributes: {
5433
+ d: string;
5434
+ };
5435
+ } | {
5436
+ tag: "rect";
5437
+ attributes: {
5438
+ width: string;
5439
+ height: string;
5440
+ x: string;
5441
+ y: string;
5442
+ rx: string;
5443
+ ry: string;
5444
+ };
5445
+ })[];
5446
+ };
5447
+ Edit: {
5448
+ name: string;
5449
+ nodes: {
5450
+ tag: "path";
5451
+ attributes: {
5452
+ d: string;
5453
+ };
5454
+ }[];
5455
+ };
5456
+ EyeOff: {
5457
+ name: string;
5458
+ nodes: {
5459
+ tag: "path";
5460
+ attributes: {
5461
+ d: string;
5462
+ };
5463
+ }[];
5464
+ };
5465
+ Loader2: {
5466
+ name: string;
5467
+ nodes: {
5468
+ tag: "path";
5469
+ attributes: {
5470
+ d: string;
5471
+ };
5472
+ }[];
5473
+ };
5474
+ MessageCircle: {
5475
+ name: string;
5476
+ nodes: {
5477
+ tag: "path";
5478
+ attributes: {
5479
+ d: string;
5480
+ };
5481
+ }[];
5482
+ };
5483
+ Mic: {
5484
+ name: string;
5485
+ nodes: ({
5486
+ tag: "path";
5487
+ attributes: {
5488
+ d: string;
5489
+ };
5490
+ } | {
5491
+ tag: "rect";
5492
+ attributes: {
5493
+ x: string;
5494
+ y: string;
5495
+ width: string;
5496
+ height: string;
5497
+ rx: string;
5498
+ };
5499
+ })[];
5500
+ };
5501
+ PanelLeftOpen: {
5502
+ name: string;
5503
+ nodes: ({
5504
+ tag: "path";
5505
+ attributes: {
5506
+ d: string;
5507
+ };
5508
+ } | {
5509
+ tag: "rect";
5510
+ attributes: {
5511
+ width: string;
5512
+ height: string;
5513
+ x: string;
5514
+ y: string;
5515
+ rx: string;
5516
+ };
5517
+ })[];
5518
+ };
5519
+ Play: {
5520
+ name: string;
5521
+ nodes: {
5522
+ tag: "polygon";
5523
+ attributes: {
5524
+ points: string;
5525
+ };
5526
+ }[];
5527
+ };
5528
+ Plus: {
5529
+ name: string;
5530
+ nodes: {
5531
+ tag: "path";
5532
+ attributes: {
5533
+ d: string;
5534
+ };
5535
+ }[];
5536
+ };
5537
+ RefreshCw: {
5538
+ name: string;
5539
+ nodes: {
5540
+ tag: "path";
5541
+ attributes: {
5542
+ d: string;
5543
+ };
5544
+ }[];
5545
+ };
5546
+ Square: {
5547
+ name: string;
5548
+ nodes: {
5549
+ tag: "rect";
5550
+ attributes: {
5551
+ width: string;
5552
+ height: string;
5553
+ x: string;
5554
+ y: string;
5555
+ rx: string;
5556
+ };
5557
+ }[];
5558
+ };
5559
+ ThumbsDown: {
5560
+ name: string;
5561
+ nodes: {
5562
+ tag: "path";
5563
+ attributes: {
5564
+ d: string;
5565
+ };
5566
+ }[];
5567
+ };
5568
+ ThumbsUp: {
5569
+ name: string;
5570
+ nodes: {
5571
+ tag: "path";
5572
+ attributes: {
5573
+ d: string;
5574
+ };
5575
+ }[];
5576
+ };
5577
+ Upload: {
5578
+ name: string;
5579
+ nodes: {
5580
+ tag: "path";
5581
+ attributes: {
5582
+ d: string;
5583
+ };
5584
+ }[];
5585
+ };
5586
+ Volume2: {
5587
+ name: string;
5588
+ nodes: {
5589
+ tag: "path";
5590
+ attributes: {
5591
+ d: string;
5592
+ };
5593
+ }[];
5594
+ };
5595
+ Wrench: {
5596
+ name: string;
5597
+ nodes: {
5598
+ tag: "path";
5599
+ attributes: {
5600
+ d: string;
5601
+ };
5602
+ }[];
5603
+ };
5604
+ X: {
5605
+ name: string;
5606
+ nodes: {
5607
+ tag: "path";
5608
+ attributes: {
5609
+ d: string;
5610
+ };
5611
+ }[];
5612
+ };
5613
+ };
5614
+ /** The name of a chat icon in `ɵcopilotIcons`, for example `"ArrowUp"`. */
5615
+ type CopilotIconName = keyof typeof icons;
5616
+ /**
5617
+ * Internal. The SVG data for every icon the chat components draw.
5618
+ *
5619
+ * Each framework's `CopilotIcon` component reads an entry and draws it:
5620
+ *
5621
+ * ```ts
5622
+ * const { name, nodes } = ɵcopilotIcons.ArrowUp;
5623
+ * // <svg {...ɵcopilotIconSvgAttributes} class="lucide lucide-arrow-up">
5624
+ * // one child element per node: <{node.tag} {...node.attributes} />
5625
+ * // </svg>
5626
+ * ```
5627
+ */
5628
+ declare const ɵcopilotIcons: Readonly<Record<CopilotIconName, CopilotIconDefinition>>;
5629
+ /**
5630
+ * Internal. The attributes to put on the `<svg>` of every chat icon.
5631
+ *
5632
+ * These are Lucide's default attributes, so a drawn icon matches the Lucide
5633
+ * icon. Set `width` and `height` to change the size.
5634
+ */
5635
+ declare const ɵcopilotIconSvgAttributes: Readonly<Record<string, string>>;
5636
+ //#endregion
5637
+ //#region src/chat/message-feedback.d.ts
5638
+ /** Trajectory event name for a rating of one assistant message. */
5639
+ declare const ɵMESSAGE_FEEDBACK_EVENT_NAME = "message.feedback";
5640
+ /** Longest comment kept, in characters; the rest is cut so the event stays small. */
5641
+ declare const ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH = 1000;
5642
+ /**
5643
+ * How long the pointer may be away from the rating and its comment before the
5644
+ * comment closes: enough to cross the gap between them, short enough that
5645
+ * passing over a rating does not leave it open.
5646
+ */
5647
+ declare const ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS = 150;
5648
+ type ɵMessageFeedbackRating = "up" | "down";
5649
+ /** The rating this page gave one assistant message. */
5650
+ interface ɵMessageFeedback {
5651
+ readonly rating: ɵMessageFeedbackRating;
5652
+ readonly comment?: string;
5653
+ }
5654
+ /** The chat whose assistant messages collect feedback for Learning. */
5655
+ interface ɵMessageFeedbackScope {
5656
+ readonly copilotkit: CopilotKitCore;
5657
+ readonly agentId: string;
5658
+ readonly threadId: string;
5659
+ }
5660
+ /** The rating this page gave one message, if any. */
5661
+ declare function ɵgetMessageFeedback(agentId: string, threadId: string, messageId: string): ɵMessageFeedback | undefined;
5662
+ /** Calls `listener` whenever a rating in this Thread changes. */
5663
+ declare function ɵsubscribeToMessageFeedback(agentId: string, threadId: string, listener: () => void): () => void;
5664
+ /**
5665
+ * Sets (or, with `null`, clears) this page's rating of one message and sends
5666
+ * it to the active Trajectory. Every change is a new event; the newest event
5667
+ * for a `feedbackId` is the current one. Like any Trajectory event, a change
5668
+ * made while no Trajectory captures, for example during a reconnect, is not
5669
+ * sent; the page still shows it.
5670
+ */
5671
+ declare function ɵsetMessageFeedback(params: ɵMessageFeedbackScope & {
5672
+ message: AssistantMessage;
5673
+ feedback: ɵMessageFeedback | null;
5674
+ }): void;
5675
+ /** @internal Forgets every rating, so each test starts empty. */
5676
+ declare function ɵresetMessageFeedbackCache(): void;
5677
+ /**
5678
+ * Whether the thumbs record feedback for Learning. True once a Trajectory of
5679
+ * this Core has started and as long as Learning stays configured, also while
5680
+ * capture reconnects or is stopped, so the buttons do not flicker. Ratings
5681
+ * given meanwhile still show but, like any Trajectory event, are not sent. A
5682
+ * capture that never starts (for example without a license) leaves it false.
5683
+ *
5684
+ * Re-read it when {@link ɵsubscribeToLearningFeedbackEnabled} notifies.
5685
+ */
5686
+ declare function ɵisLearningFeedbackEnabled(copilotkit: CopilotKitCore): boolean;
5687
+ /**
5688
+ * Calls `listener` when {@link ɵisLearningFeedbackEnabled} may have changed:
5689
+ * when Learning is configured or removed, and when the Trajectory changes.
5690
+ * Returns the unsubscribe function.
5691
+ */
5692
+ declare function ɵsubscribeToLearningFeedbackEnabled(copilotkit: CopilotKitCore, listener: () => void): () => void;
5693
+ /** Current feedback for one assistant message, and how to change it. */
5694
+ interface ɵMessageFeedbackControls {
5695
+ readonly feedback: ɵMessageFeedback | undefined;
5696
+ /** Gives `rating`; a different rating than before starts without a comment. */
5697
+ readonly rate: (rating: ɵMessageFeedbackRating) => void;
5698
+ /** Removes the rating and its comment. */
5699
+ readonly clear: () => void;
5700
+ /** Sets the current rating's comment; an empty one removes it. */
5701
+ readonly comment: (comment: string) => void;
5702
+ }
5703
+ /**
5704
+ * The feedback this page gave `message` in `scope`, and how to change it.
5705
+ * Read it again when {@link ɵsubscribeToMessageFeedback} notifies for the
5706
+ * scope's Thread.
5707
+ */
5708
+ declare function ɵgetMessageFeedbackControls(scope: ɵMessageFeedbackScope, message: AssistantMessage): ɵMessageFeedbackControls;
5709
+ /** What the comment popover of one rated message shows. */
5710
+ interface ɵFeedbackCommentState {
5711
+ readonly open: boolean;
5712
+ /** The comment being edited. */
5713
+ readonly draft: string;
5714
+ /** Grows each time the field should take focus: after a keyboard rating. */
5715
+ readonly focusRequest: number;
5716
+ }
5717
+ /** How a pointer or keyboard focus reached or left the rating. */
5718
+ type ɵFeedbackCommentVia = "pointer" | "focus";
5719
+ interface ɵFeedbackCommentControllerOptions {
5720
+ /** The newest feedback controls of the message, or `null` without any. */
5721
+ getControls: () => ɵMessageFeedbackControls | null;
5722
+ /** Defaults to {@link ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS}. */
5723
+ closeDelayMs?: number;
5724
+ }
5725
+ /**
5726
+ * Drives the comment popover of a rated message.
5727
+ *
5728
+ * It opens when a rating is given and whenever the pointer or keyboard focus
5729
+ * reaches the chosen thumb, with the saved comment in the field. It closes by
5730
+ * itself shortly after the pointer leaves the thumb and the popover, unless
5731
+ * focus is in the field: then it stays until focus moves away, Enter, or
5732
+ * Escape. Closing saves a changed comment; Escape, a click on a thumb, and
5733
+ * removing the rating discard it.
5734
+ *
5735
+ * Frameworks render from `getSnapshot()` and re-render when `subscribe()`
5736
+ * notifies. Call `dispose()` on unmount: it keeps an unsaved edit, for a
5737
+ * message that scrolls out of a virtual list. The controller stays usable
5738
+ * after `dispose()`, so a remount (React Strict Mode) can keep it.
5739
+ *
5740
+ * @example
5741
+ * ```ts
5742
+ * const comment = new ɵFeedbackCommentController({ getControls: () => controls });
5743
+ * comment.subscribe(() => render(comment.getSnapshot()));
5744
+ * comment.show({ comment: "", focus: false });
5745
+ * // On unmount:
5746
+ * comment.dispose();
5747
+ * ```
5748
+ */
5749
+ declare class ɵFeedbackCommentController {
5750
+ #private;
5751
+ constructor(options: ɵFeedbackCommentControllerOptions);
5752
+ /** The current state. The same object until something changes. */
5753
+ getSnapshot: () => ɵFeedbackCommentState;
5754
+ /** Calls `listener` when the state changes. Returns the unsubscribe function. */
5755
+ subscribe: (listener: () => void) => () => void;
5756
+ /** Sets the comment being edited. */
5757
+ setDraft: (draft: string) => void;
5758
+ /** Whether a focus request waits; reading it answers the request. */
5759
+ takeFocusRequest: () => boolean;
5760
+ /** Opens with `comment` in the field. */
5761
+ show: ({
5762
+ comment,
5763
+ focus
5764
+ }: {
5765
+ comment: string;
5766
+ focus: boolean;
5767
+ }) => void;
5768
+ /** The pointer or focus reached the rating or the popover. */
5769
+ enter: (via?: ɵFeedbackCommentVia) => void;
5770
+ /**
5771
+ * It left them: close soon, unless the user is editing the comment or, when
5772
+ * focus left, the pointer is still on the rating or the popover.
5773
+ */
5774
+ leave: (via?: ɵFeedbackCommentVia) => void;
5775
+ /** Tracks whether focus is in the comment form. */
5776
+ setEditing: (editing: boolean) => void;
5777
+ /** Closes, saving a changed comment unless `save` is false. */
5778
+ close: ({
5779
+ save
5780
+ }?: {
5781
+ save?: boolean;
5782
+ }) => void;
5783
+ /** Moves focus back to the thumb without opening the comment again. */
5784
+ returnFocus: (target: Pick<HTMLElement, "focus"> | null) => void;
5785
+ /** Stops the close timer and saves a changed comment that is still open. */
5786
+ dispose: () => void;
5787
+ }
5788
+ //#endregion
5789
+ //#region src/chat/viewport.d.ts
5790
+ /** How the chat scrolls as messages arrive. */
5791
+ type ɵAutoScrollMode = "pin-to-bottom" | "pin-to-send" | "none";
5792
+ /**
5793
+ * Turns the `autoScroll` prop into a mode. `true` and a missing value mean
5794
+ * `"pin-to-bottom"`, `false` means `"none"`, and an unknown string falls back
5795
+ * to `"pin-to-bottom"`.
5796
+ */
5797
+ declare function ɵnormalizeAutoScroll(value: ɵAutoScrollMode | boolean | undefined): ɵAutoScrollMode;
5798
+ /**
5799
+ * Media query for the mobile range, where the threads drawer and the chat
5800
+ * modal are mutually exclusive.
5801
+ */
5802
+ declare const ɵMOBILE_MAX_WIDTH_QUERY = "(max-width: 767px)";
5803
+ /**
5804
+ * Whether the viewport is in the mobile range (`<768px`). `false` during SSR
5805
+ * and where `window.matchMedia` is missing (some test runners and webviews).
5806
+ */
5807
+ declare function ɵisMobileViewport(): boolean;
5808
+ /**
5809
+ * Calls `listener` with {@link ɵisMobileViewport} now and each time the
5810
+ * viewport enters or leaves the mobile range. Does nothing without
5811
+ * `window.matchMedia`. Returns the unsubscribe function.
5812
+ */
5813
+ declare function ɵwatchMobileViewport(listener: (isMobile: boolean) => void): () => void;
5814
+ /**
5815
+ * The on-screen keyboard is treated as open once it covers more than this
5816
+ * many pixels of the layout viewport.
5817
+ */
5818
+ declare const ɵKEYBOARD_OPEN_THRESHOLD_PX = 150;
5819
+ /** The mobile on-screen keyboard and the height left for the page. */
5820
+ interface ɵKeyboardState {
5821
+ isKeyboardOpen: boolean;
5822
+ keyboardHeight: number;
5823
+ /** Height of the visual viewport, the part the keyboard does not cover. */
5824
+ availableHeight: number;
5825
+ /** Height of the layout viewport (`window.innerHeight`). */
5826
+ viewportHeight: number;
5827
+ }
5828
+ /**
5829
+ * Reads the keyboard state with the Visual Viewport API: the keyboard height
5830
+ * is `innerHeight - visualViewport.height`, clamped to 0. Without the API (or
5831
+ * during SSR) it reports a closed keyboard and the full window height.
5832
+ */
5833
+ declare function ɵreadKeyboardState(): ɵKeyboardState;
5834
+ /**
5835
+ * The state for the first render, before {@link ɵwatchKeyboardState} reads
5836
+ * the visual viewport: a closed keyboard over the full window height (0
5837
+ * during SSR).
5838
+ */
5839
+ declare function ɵinitialKeyboardState(): ɵKeyboardState;
5840
+ /**
5841
+ * Calls `listener` with {@link ɵreadKeyboardState} now and on each visual
5842
+ * viewport resize or scroll. Does nothing during SSR or without the Visual
5843
+ * Viewport API. Returns the unsubscribe function.
5844
+ */
5845
+ declare function ɵwatchKeyboardState(listener: (state: ɵKeyboardState) => void): () => void;
5846
+ /** Input for {@link ɵpinMessageToTop}. */
5847
+ interface ɵPinMessageToTopOptions {
5848
+ /** The scroll container of the message list. */
5849
+ scrollEl: HTMLElement;
5850
+ /** The element that holds the messages, inside `scrollEl`. */
5851
+ contentEl: HTMLElement;
5852
+ /** The spacer after the messages, sized so the message can reach the top. */
5853
+ spacerEl: HTMLElement;
5854
+ /** The `data-message-id` of the message to pin. */
5855
+ messageId: string;
5856
+ /** Space between the top of the viewport and the message bubble, in px. */
5857
+ topOffset?: number;
5858
+ }
5859
+ /**
5860
+ * Pins a sent message to the top of the chat: sizes the spacer so the
5861
+ * message bubble can scroll to `topOffset` from the viewport top, scrolls
5862
+ * there on the next frame, and then shrinks the spacer as the reply below
5863
+ * grows, so the bubble stays put.
5864
+ *
5865
+ * The message element's top padding is scrolled off-screen: the bubble, not
5866
+ * its padded box, is pinned. Does nothing when no element in `contentEl` has
5867
+ * `data-message-id` equal to `messageId`. Skips the scroll without
5868
+ * `requestAnimationFrame` and the spacer updates without `ResizeObserver`.
5869
+ *
5870
+ * @returns A function that cancels the scroll and stops the spacer updates.
5871
+ * It returns `false` when it cancelled a scroll that had not run yet, so the
5872
+ * caller can pin the same send again. React's StrictMode tears an effect
5873
+ * down before the next frame, so the first run never scrolls.
5874
+ *
5875
+ * @example
5876
+ * ```ts
5877
+ * const unpin = ɵpinMessageToTop({ scrollEl, contentEl, spacerEl, messageId });
5878
+ * // On the next send or on unmount:
5879
+ * unpin();
5880
+ * ```
5881
+ */
5882
+ declare function ɵpinMessageToTop({
5883
+ scrollEl,
5884
+ contentEl,
5885
+ spacerEl,
5886
+ messageId,
5887
+ topOffset
5888
+ }: ɵPinMessageToTopOptions): () => boolean;
5889
+ //#endregion
5890
+ //#region src/chat/message-display.d.ts
5891
+ /**
5892
+ * How long the model reasoned, as label text: "a few seconds", "4 seconds",
5893
+ * "2 minutes", or "1m 5s".
5894
+ *
5895
+ * @param seconds - The elapsed time in seconds. It may have a fraction.
5896
+ * @param labels - The chat labels that hold the duration texts.
5897
+ */
5898
+ declare function ɵformatReasoningDurationLabel(seconds: number, labels: CopilotChatLabels): string;
5899
+ /** Input for {@link ɵgetWorkSummaryText}. */
5900
+ interface ɵWorkSummaryInput {
5901
+ /** The agent is still working on this reply. */
5902
+ isWorking: boolean;
5903
+ /** The tool calls the reply made. */
5904
+ calls: readonly ToolCallEntry[];
5905
+ /** Time worked on the reply over its runs, in ms, when known. */
5906
+ elapsedMs?: number;
5907
+ /** When the current run started (epoch ms), while the agent works. */
5908
+ workingSince?: number;
5909
+ /** The current time (epoch ms); re-read it every second while working. */
5910
+ now: number;
5911
+ labels: CopilotChatLabels;
5912
+ }
5913
+ /**
5914
+ * The text of the work summary line at the top of a reply in the `"turn"`
5915
+ * tool-call display.
5916
+ *
5917
+ * - While working: `label` is "Working" and `detail` the live timer ("4s"),
5918
+ * or `null` when the elapsed time is not known.
5919
+ * - When done with a known time: `label` is "Worked for 9s" (at least 1s)
5920
+ * and `detail` the tool count ("7 tools").
5921
+ * - When done without a time: `label` is "Used 7 tools" and `detail` `null`.
5922
+ * - `failed` is "2 failed" when tool calls failed, otherwise `null`. It is
5923
+ * always `null` while working.
5924
+ */
5925
+ declare function ɵgetWorkSummaryText({
5926
+ isWorking,
5927
+ calls,
5928
+ elapsedMs,
5929
+ workingSince,
5930
+ now,
5931
+ labels
5932
+ }: ɵWorkSummaryInput): {
5933
+ label: string;
5934
+ detail: string | null;
5935
+ failed: null;
5936
+ } | {
5937
+ label: string;
5938
+ detail: null;
5939
+ failed: string | null;
5940
+ } | {
5941
+ label: string;
5942
+ detail: string;
5943
+ failed: string | null;
5944
+ };
5945
+ /** An attachment part of a user message. */
5946
+ type ɵUserMessageMediaPart = ImageInputPart | AudioInputPart | VideoInputPart | DocumentInputPart;
5947
+ /**
5948
+ * The text of a user message: the string content, or its text parts joined
5949
+ * by newlines. Parts that are not text, and malformed parts from untyped
5950
+ * data, add nothing.
5951
+ */
5952
+ declare function ɵflattenUserMessageContent(content?: UserMessage["content"]): string;
5953
+ /** The image, audio, video, and document parts of a user message. */
5954
+ declare function ɵgetUserMessageMediaParts(content?: UserMessage["content"]): ɵUserMessageMediaPart[];
5955
+ /** The file name stored in an attachment's `metadata.filename`, if any. */
5956
+ declare function ɵgetUserMessageMediaFilename(part: ɵUserMessageMediaPart): any;
5957
+ /** Input for {@link ɵgetBranchNavState}. */
5958
+ interface ɵBranchNavInput {
5959
+ /** The shown branch, from 0. */
5960
+ branchIndex: number;
5961
+ numberOfBranches: number;
5962
+ /** Whether something handles a switch to another branch. */
5963
+ canSwitch: boolean;
5964
+ }
5965
+ /**
5966
+ * Whether a user message shows its branch navigation and which arrows work.
5967
+ * It shows only with more than one branch and a switch handler: without the
5968
+ * handler the arrows would do nothing.
5969
+ */
5970
+ declare function ɵgetBranchNavState({
5971
+ branchIndex,
5972
+ numberOfBranches,
5973
+ canSwitch
5974
+ }: ɵBranchNavInput): {
5975
+ show: boolean;
5976
+ canGoPrev: boolean;
5977
+ canGoNext: boolean;
5978
+ };
5979
+ /** Whether an assistant message has text beyond whitespace. */
5980
+ declare function ɵhasAssistantMessageText(content: string | undefined): boolean;
5981
+ /** Input for {@link ɵshouldShowAssistantToolbar}. */
5982
+ interface ɵAssistantToolbarInput {
5983
+ /** The app or chat shows toolbars at all. */
5984
+ toolbarVisible: boolean;
5985
+ /** The message has text (see {@link ɵhasAssistantMessageText}). */
5986
+ hasContent: boolean;
5987
+ /** The Inspector shortcut shows, which gives a toolbar a use without text. */
5988
+ showInspectorShortcut: boolean;
5989
+ /** The agent is running. */
5990
+ isRunning: boolean;
5991
+ /** The message is the latest one in the chat. */
5992
+ isLatest: boolean;
5993
+ }
5994
+ /**
5995
+ * Whether an assistant message shows its toolbar: when toolbars are on, the
5996
+ * message has text or the Inspector shortcut shows, and the message is not
5997
+ * the one still streaming (the latest while the agent runs).
5998
+ */
5999
+ declare function ɵshouldShowAssistantToolbar({
6000
+ toolbarVisible,
6001
+ hasContent,
6002
+ showInspectorShortcut,
6003
+ isRunning,
6004
+ isLatest
6005
+ }: ɵAssistantToolbarInput): boolean;
6006
+ /** How long a copy button shows its "copied" check mark, in ms. */
6007
+ declare const ɵCOPY_FEEDBACK_RESET_MS = 2000;
6008
+ /**
6009
+ * The "copied" state of a copy button. After a copy it is `true` for
6010
+ * {@link ɵCOPY_FEEDBACK_RESET_MS}; another copy in that time restarts the
6011
+ * wait, so rapid clicks do not flicker.
6012
+ *
6013
+ * Frameworks render from `getSnapshot()` and re-render when `subscribe()`
6014
+ * notifies. Call `dispose()` on unmount. The controller stays usable after
6015
+ * `dispose()`, so a remount (React Strict Mode) can keep it.
6016
+ *
6017
+ * @example
6018
+ * ```ts
6019
+ * const feedback = new ɵCopyFeedback();
6020
+ * feedback.subscribe(() => render(feedback.getSnapshot()));
6021
+ * await feedback.copy(text);
6022
+ * ```
6023
+ */
6024
+ declare class ɵCopyFeedback {
6025
+ #private;
6026
+ constructor({
6027
+ resetMs
6028
+ }?: {
6029
+ resetMs?: number;
6030
+ });
6031
+ /** Whether the check mark shows. */
6032
+ getSnapshot: () => boolean;
6033
+ /** Calls `listener` when the state changes. Returns the unsubscribe function. */
6034
+ subscribe: (listener: () => void) => () => void;
6035
+ /** Shows the check mark, or keeps it for the full time again. */
6036
+ markCopied: () => void;
6037
+ /**
6038
+ * Copies `text` to the clipboard and shows the check mark on success.
6039
+ * Empty text copies nothing.
6040
+ *
6041
+ * @returns Whether the text was copied.
6042
+ */
6043
+ copy: (text: string) => Promise<boolean>;
6044
+ /** Stops the reset timer. */
6045
+ dispose: () => void;
6046
+ }
6047
+ //#endregion
6048
+ //#region src/chat/inspector-button.d.ts
6049
+ /**
6050
+ * Whether the user hid the Inspector shortcuts in the message toolbars
6051
+ * ("Hide this icon"). It lasts until the page reloads and applies to every
6052
+ * chat on the page.
6053
+ *
6054
+ * @example
6055
+ * ```ts
6056
+ * ɵinspectorShortcuts.subscribe(() => render(ɵinspectorShortcuts.hidden));
6057
+ * ɵinspectorShortcuts.hide();
6058
+ * ```
6059
+ */
6060
+ declare const ɵinspectorShortcuts: {
6061
+ /** Whether the shortcuts are hidden. */readonly hidden: boolean; /** Hides the shortcuts of every message until the page reloads. */
6062
+ hide(): void; /** Calls `listener` when `hidden` changes. Returns the unsubscribe function. */
6063
+ subscribe(listener: () => void): () => void; /** @internal Shows the shortcuts again, so each test starts fresh. */
6064
+ reset(): void;
6065
+ };
6066
+ /** One path of the Inspector kite artwork. */
6067
+ interface ɵInspectorKitePath {
6068
+ readonly d: string;
6069
+ /** The id suffix of the gradient that fills it. */
6070
+ readonly fillGradient?: string;
6071
+ readonly stroke?: string;
6072
+ readonly strokeWidth?: string;
6073
+ readonly strokeLinecap?: "round";
6074
+ }
6075
+ /** One gradient stop. Without `offset` the stop sits at 0. */
6076
+ interface ɵInspectorKiteStop {
6077
+ readonly offset?: string;
6078
+ readonly color: string;
6079
+ }
6080
+ /** One linear gradient, in user space. */
6081
+ interface ɵInspectorKiteGradient {
6082
+ /** Appended to a per-instance prefix, so two icons on a page do not clash. */
6083
+ readonly id: string;
6084
+ readonly x1: string;
6085
+ readonly y1: string;
6086
+ readonly x2: string;
6087
+ readonly y2: string;
6088
+ readonly stops: readonly ɵInspectorKiteStop[];
6089
+ }
6090
+ /** Artwork drawn from paths and gradients. See {@link ɵinspectorKiteIcon}. */
6091
+ interface ɵInspectorKiteArtwork {
6092
+ readonly viewBox: string;
6093
+ readonly paths: readonly ɵInspectorKitePath[];
6094
+ readonly gradients: readonly ɵInspectorKiteGradient[];
6095
+ }
6096
+ /**
6097
+ * The Inspector kite artwork as data, as in
6098
+ * `web-inspector/src/assets/inspector-logo-kite.svg`. Render an `<svg>` with
6099
+ * `viewBox` and `fill="none"`, one `<path>` per entry of `paths`, and a
6100
+ * `<linearGradient gradientUnits="userSpaceOnUse">` per entry of `gradients`
6101
+ * in `<defs>`. Give each gradient the id `${prefix}-${gradient.id}` with a
6102
+ * prefix unique to the icon, and fill paths with
6103
+ * {@link ɵinspectorKiteFill}.
6104
+ */
6105
+ declare const ɵinspectorKiteIcon: ɵInspectorKiteArtwork;
6106
+ /**
6107
+ * The `fill` of a kite path: its gradient under the icon's id `prefix`, or
6108
+ * `undefined` for a stroke-only path.
6109
+ */
6110
+ declare function ɵinspectorKiteFill(prefix: string, path: ɵInspectorKitePath): string | undefined;
6111
+ /** How long a hover-opened menu stays after the pointer leaves, in ms. */
6112
+ declare const ɵHOVER_MENU_CLOSE_DELAY_MS = 180;
6113
+ /** What a hover menu shows. */
6114
+ interface ɵHoverMenuState {
6115
+ readonly open: boolean;
6116
+ /** The trigger sat inside a `.dark` element when the menu opened. */
6117
+ readonly dark: boolean;
6118
+ }
6119
+ /**
6120
+ * The open state of a menu that opens when the pointer reaches its trigger,
6121
+ * like the Inspector shortcut's menu.
6122
+ *
6123
+ * - A mouse or pen over the trigger opens it; touch does not.
6124
+ * - Leaving the trigger or the menu closes it after `closeDelayMs`, unless
6125
+ * the pointer comes back first or the keyboard has used the menu since.
6126
+ * - Opening reads whether the trigger is inside a `.dark` element, so a menu
6127
+ * in a portal can match the theme.
6128
+ *
6129
+ * Frameworks render from `getSnapshot()` and re-render when `subscribe()`
6130
+ * notifies. Call `dispose()` on unmount; the controller stays usable.
6131
+ */
6132
+ declare class ɵHoverMenuController {
6133
+ #private;
6134
+ constructor({
6135
+ closeDelayMs
6136
+ }?: {
6137
+ closeDelayMs?: number;
6138
+ });
6139
+ /** The current state. The same object until something changes. */
6140
+ getSnapshot: () => ɵHoverMenuState;
6141
+ /** Calls `listener` when the state changes. Returns the unsubscribe function. */
6142
+ subscribe: (listener: () => void) => () => void;
6143
+ /** Whether the pointer opened the menu and the keyboard has not used it. */
6144
+ get openedByHover(): boolean;
6145
+ /**
6146
+ * Opens or closes the menu and stops a pending close. `trigger` is read on
6147
+ * open for the dark theme.
6148
+ */
6149
+ setOpen: (open: boolean, trigger?: Element | null) => void;
6150
+ /** The pointer reached the trigger: opens, except for touch or disabled. */
6151
+ pointerEnter: ({
6152
+ pointerType,
6153
+ disabled,
6154
+ trigger
6155
+ }: {
6156
+ pointerType: string;
6157
+ disabled?: boolean;
6158
+ trigger: Element | null;
6159
+ }) => void;
6160
+ /** The keyboard used the trigger or the menu: keep it open on leave. */
6161
+ keyboardUsed: () => void;
6162
+ /** The pointer left the trigger or the menu: close soon if hover opened it. */
6163
+ scheduleClose: () => void;
6164
+ /** The pointer came back: keep the menu open. */
6165
+ cancelClose: () => void;
6166
+ /** Stops a pending close. */
6167
+ dispose: () => void;
6168
+ }
6169
+ //#endregion
6170
+ //#region src/open-generative-ui/content.d.ts
6171
+ /**
6172
+ * Open Generative UI content: the activity the agent streams while it
6173
+ * generates a sandboxed UI, and the rules for when a new snapshot must reach
6174
+ * the sandbox at once.
6175
+ */
6176
+ /** The activity type of Open Generative UI messages. */
6177
+ declare const OPEN_GENERATIVE_UI_ACTIVITY_TYPE = "open-generative-ui";
6178
+ /** The name of the frontend tool the agent calls to generate a sandboxed UI. */
6179
+ declare const GENERATE_SANDBOXED_UI_TOOL_NAME = "generateSandboxedUi";
6180
+ /** The design guidance sent to the agent when no `designSkill` is set. */
6181
+ declare const DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL = "When generating UI with generateSandboxedUi, follow these design principles inspired by shadcn/ui:\n\n- Use a minimal, flat aesthetic. Avoid drop shadows and gradients \u2014 rely on subtle borders (1px solid, light gray like #e5e7eb) to define surfaces.\n- Neutral base palette: white backgrounds, zinc/slate gray text (#09090b for headings, #71717a for secondary text). One accent color for interactive elements.\n- Use system font stacks (system-ui, -apple-system, sans-serif) at readable sizes (14px body, 600 weight for headings). Tight line-heights.\n- Small, consistent border-radius (6\u20138px). Cards and containers use border, not shadow, for separation.\n- Buttons: solid fill for primary (dark bg, white text), outline for secondary (border + transparent bg). Subtle hover state (slight opacity or background shift).\n- Use CSS Grid or Flexbox for layout. Ensure the UI looks good at any width.\n- Minimal transitions (150ms) for hover/focus states only. No decorative animations.\n- Keep the UI focused and dense \u2014 avoid excessive padding. Use compact spacing (8\u201312px gaps, 10\u201314px padding in controls).";
6182
+ /** The content of an Open Generative UI activity message. */
6183
+ type OpenGenerativeUIContent = {
6184
+ /** Height in pixels before the generated UI is measured. */initialHeight?: number; /** `false` once the agent has finished generating. */
6185
+ generating?: boolean;
6186
+ css?: string;
6187
+ cssComplete?: boolean; /** HTML chunks in stream order. */
6188
+ html?: string[];
6189
+ htmlComplete?: boolean; /** Helper functions that run once in the final sandbox. */
6190
+ jsFunctions?: string;
6191
+ jsFunctionsComplete?: boolean; /** Expressions that run one by one in the final sandbox. */
6192
+ jsExpressions?: string[];
6193
+ jsExpressionsComplete?: boolean;
6194
+ };
6195
+ /** The arguments of the `generateSandboxedUi` tool call. */
6196
+ type GenerateSandboxedUiArgs = {
6197
+ initialHeight?: number; /** Messages the tool call shows while the UI is generated. */
6198
+ placeholderMessages?: string[];
6199
+ css?: string;
6200
+ html?: string;
6201
+ jsFunctions?: string;
6202
+ jsExpressions?: string[];
6203
+ };
6204
+ //#endregion
6205
+ //#region src/open-generative-ui/html.d.ts
6206
+ /**
6207
+ * Pure string helpers that turn streamed HTML into sandbox content.
6208
+ * No DOM access.
6209
+ */
6210
+ /**
6211
+ * Extracts all complete `<style>` blocks from the raw HTML.
6212
+ * Returns the concatenated style tags, suitable for injection into `<head>`.
6213
+ */
6214
+ declare function extractCompleteStyles(html: string): string;
6215
+ /**
6216
+ * Processes raw accumulated HTML for safe preview via innerHTML injection.
6217
+ *
6218
+ * Pipeline (order matters):
6219
+ * 1. Strip incomplete tag at end
6220
+ * 2. Strip complete <style>, <script>, and <head> blocks
6221
+ * 3. Strip incomplete <style>/<script>/<head> blocks
6222
+ * 4. Strip incomplete HTML entities
6223
+ * 5. Extract body content (or use full string if no <body>)
6224
+ */
6225
+ declare function processPartialHtml(html: string): string;
6226
+ //#endregion
6227
+ //#region src/open-generative-ui/websandbox.d.ts
6228
+ /**
6229
+ * The part of `@jetbrains/websandbox` the controller uses, and the loader that
6230
+ * imports it.
6231
+ */
6232
+ /** Host functions that sandboxed code calls through `Websandbox.connection.remote`. */
6233
+ type SandboxLocalApi = {
6234
+ [name: string]: Function | SandboxLocalApi;
6235
+ };
6236
+ /** A function the host exposes to sandboxed code. */
6237
+ interface SandboxFunctionHandle {
6238
+ name: string;
6239
+ handler: (...args: any[]) => unknown;
6240
+ }
6241
+ /** A running websandbox iframe. */
6242
+ interface WebsandboxInstance {
6243
+ iframe: HTMLIFrameElement;
6244
+ /** Resolves when the sandboxed document is ready to run code. */
6245
+ promise: Promise<unknown>;
6246
+ run(code: string): Promise<unknown>;
6247
+ destroy(): void;
6248
+ }
6249
+ /** The websandbox class, reduced to its factory. */
6250
+ interface WebsandboxConstructor {
6251
+ create(localApi: SandboxLocalApi, options: {
6252
+ frameContainer: HTMLElement;
6253
+ frameContent: string;
6254
+ allowAdditionalAttributes: string;
6255
+ }): WebsandboxInstance;
6256
+ }
6257
+ /** Loads the websandbox class. Replace it in tests. */
6258
+ type WebsandboxLoader = () => Promise<WebsandboxConstructor>;
6259
+ /**
6260
+ * Imports `@jetbrains/websandbox` on demand. The import is dynamic because
6261
+ * the package touches `self` when it loads, which breaks server rendering.
6262
+ */
6263
+ declare const loadWebsandbox: WebsandboxLoader;
6264
+ //#endregion
6265
+ //#region src/open-generative-ui/controller.d.ts
6266
+ /**
6267
+ * What the host element shows: a placeholder while nothing can render, a
6268
+ * preview while HTML streams, or the final sandbox.
6269
+ */
6270
+ type OpenGenerativeUIPhase = "placeholder" | "preview" | "final";
6271
+ /** The state a framework renders around the host element. */
6272
+ interface OpenGenerativeUIState {
6273
+ phase: OpenGenerativeUIPhase;
6274
+ /** `true` until the agent reports `generating: false`. */
6275
+ generating: boolean;
6276
+ /** The measured height of the final UI, else `initialHeight`, else 200. */
6277
+ height: number;
6278
+ }
6279
+ interface OpenGenerativeUIControllerOptions {
6280
+ /** Loads the websandbox class. Default: a dynamic `import()`. */
6281
+ loadWebsandbox?: WebsandboxLoader;
6282
+ }
6283
+ /**
6284
+ * Runs Open Generative UI content in websandbox iframes inside a host element.
6285
+ *
6286
+ * Give it content snapshots with `setContent()` and a host element with
6287
+ * `setHost()`. It throttles the snapshots, streams a preview while HTML
6288
+ * arrives, swaps in the final sandbox once HTML is complete, runs
6289
+ * `jsFunctions` and `jsExpressions` in it once each, and measures the final
6290
+ * height. Frameworks render the container from `getState()` and re-render
6291
+ * when `subscribe()` notifies.
6292
+ *
6293
+ * @example
6294
+ * ```ts
6295
+ * const controller = new ɵOpenGenerativeUIController();
6296
+ * controller.subscribe(() => render(controller.getState()));
6297
+ * controller.setContent(content);
6298
+ * controller.setHost(containerElement);
6299
+ * // On unmount:
6300
+ * controller.destroy();
6301
+ * ```
6302
+ */
6303
+ declare class OpenGenerativeUIController {
6304
+ #private;
6305
+ constructor(options?: OpenGenerativeUIControllerOptions);
6306
+ /** The current state. The same object until something changes. */
6307
+ getState: () => OpenGenerativeUIState;
6308
+ /** Calls `listener` when the state changes. Returns the unsubscribe function. */
6309
+ subscribe: (listener: () => void) => (() => void);
6310
+ /**
6311
+ * Sets the latest content snapshot. The first snapshot and snapshots that
6312
+ * finish a stage apply at once; others apply at most once per second.
6313
+ */
6314
+ setContent(content: OpenGenerativeUIContent): void;
6315
+ /** Sets the element the sandbox iframes go into. `null` removes them. */
6316
+ setHost(host: HTMLElement | null): void;
6317
+ /**
6318
+ * Sets the host functions sandboxed code can call. A change recreates the
6319
+ * final sandbox.
6320
+ */
6321
+ setSandboxFunctions(functions: readonly SandboxFunctionHandle[]): void;
6322
+ /**
6323
+ * Removes the sandboxes and stops pending work. A later `setHost()`
6324
+ * starts again from the current content.
6325
+ */
6326
+ destroy(): void;
6327
+ }
6328
+ //#endregion
6329
+ //#region src/utils/shallow-equal.d.ts
6330
+ /**
6331
+ * True when both records have the same own keys and each key holds the same
6332
+ * value (compared with `Object.is`). Key order does not matter. Nested
6333
+ * objects are compared by reference, not by content.
6334
+ */
6335
+ declare function shallowEqualRecord<T>(a: Readonly<Record<string, T>>, b: Readonly<Record<string, T>>): boolean;
6336
+ //#endregion
6337
+ //#region src/utils/class-names.d.ts
6338
+ type ClassValue = string | number | bigint | boolean | null | undefined | ClassValue[] | Record<string, unknown>;
6339
+ /**
6340
+ * Joins class names, skipping falsy values. Takes the same inputs as `clsx`.
6341
+ * Classes are not merged: every rule CopilotKit ships sits in `:where()`, so a
6342
+ * class the app adds wins without removing ours.
6343
+ */
6344
+ declare function cn(...inputs: ClassValue[]): string;
6345
+ //#endregion
6346
+ export { A2UIMarkdownOperation, A2UI_FENCE_LANGUAGE, ActionConfig, ActionCreator, ActionFromCreator, ActionFromCreators, ActionGroupConfig, ActionGroupResult, type ActivityMessageRenderProps, type ActivityMessageRendererDef, AgentRegistry, AgentThreadLockedError, AnyAction, ChildIdsOf, ChildWalkOptions, ContextStore, CopilotChatDefaultLabels, type CopilotChatLabels, type CopilotChatToolCallDisplay, type CopilotIconData, type CopilotIconDefinition, type CopilotIconName, type CopilotIconNode, CopilotKitCore, type CopilotKitCoreAddAgentParams, type CopilotKitCoreCatalogComponent, CopilotKitCoreConfig, type CopilotKitCoreConnectAgentParams, CopilotKitCoreContinuationHandoff, CopilotKitCoreErrorCode, CopilotKitCoreFriendsAccess, CopilotKitCoreGetSuggestionsResult, type CopilotKitCoreGetToolParams, type CopilotKitCoreRegisterProxiedAgentParams, type CopilotKitCoreRegisterProxiedAgentResult, type CopilotKitCoreRunAgentParams, type CopilotKitCoreRunToolParams, type CopilotKitCoreRunToolResult, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreStopAgentParams, CopilotKitCoreSubscriber, CopilotKitCoreSubscription, CopilotKitHeaderResolutionError, type CopilotKitHeadersSource, type CopilotKitMessageFilter, CopilotRuntimeTransport, type CustomMessageRenderProps, type CustomMessageRendererDef, type CustomMessageRendererPosition, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, DispatchingEffect, DispatchingEffectOptions, DynamicSuggestionsConfig, Effect, EmptyActionConfig, FrontendTool, FrontendToolHandlerContext, FrontendToolReconnectBehavior, GENERATE_SANDBOXED_UI_TOOL_NAME, GenerateSandboxedUiArgs, type HumanInTheLoopRenderProps, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTERRUPT_EVENT_NAME, InspectorActiveThreadPayload, type InspectorMetadataV1, InspectorStopViewingPayload, InspectorViewThreadPayload, InspectorViewThreadResultPayload, IntelligenceAgent, IntelligenceAgentConfig, type IntelligenceRuntimeInfo, type InterruptCancelFn, type InterruptEvent, type InterruptHandlerProps, type InterruptRenderProps, type InterruptResolveFn, type JsonValue, type LearningConfig, type LegacyLearningConfig, MEMORY_ERROR_REGISTRY, MarkdownSegment, Memory, MemoryChanges, MemoryError, type MemoryErrorCategory, type MemoryErrorCode, type MemoryErrorRegistryEntry, MemoryKind, MemoryRealtimeStatus, MemoryScope, NewMemory, NonDispatchingEffect, NonDispatchingEffectOptions, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, OpenGenerativeUIContent, type OpenThreadRegistration, PropsActionConfig, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgentConfig, Reducer, RunCompletionAware, RunHandler, type RuntimeLicenseStatus, type RuntimeMode, ScopedContext, ScopedProperties, Selector, type StartResult, StateManager, StaticSuggestionsConfig, Store, StoreLifecycleAction, SubscribeToAgentOptions, SubscribeToAgentSubscriber, Suggestion, SuggestionAvailability, SuggestionEngine, SuggestionsConfig, SurfaceSegment, type ThreadEndpointRuntimeInfo, ThreadRunActivityNotification, type ToolCallEntry, type ToolCallRenderProps, type ToolCallRendererDef, ToolCallStatus, type TrajectoryStartOptions, TranscriptionError, TranscriptionErrorCode, type TranscriptionErrorInfo, type TranscriptionResult, WebMCPModelContext, WebMCPRegistry, WebMCPToolAnnotations, WebMCPToolConfig, classifySurfaceCards, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, empty, ensureObjectArgs, extractCompleteArrayItems, extractFenceOperations, extractStringField, flattenInformationalCards, getMarkdownOperationSurfaceId, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isRunCompletionAware, ofType, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorViewThread, onInspectorViewThreadResult, parseToolArguments, prepareSurfaceOperations, props, segmentSurfaceProse, select, splitA2UIMarkdown, type ɵActivityRendererQuery, type ɵAssistantToolbarInput, type ɵAutoScrollMode, type ɵBranchNavInput, ɵCOPILOTKIT_FEATURES, ɵCOPY_FEEDBACK_RESET_MS, type ClassValue as ɵClassValue, type ɵComposerInput, type ɵComposerKeyEvent, type ɵComposerMode, ɵCopilotKitFeature, ɵCopyFeedback, ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS, ɵFeedbackCommentController, type ɵFeedbackCommentControllerOptions, type ɵFeedbackCommentState, type ɵFeedbackCommentVia, ɵGenerativeUIDebugFunction, ɵGenerativeUIDebugPromptSection, ɵGenerativeUIDebugRun, ɵGenerativeUIDebugSnapshot, ɵGenerativeUIDebugSource, ɵGenerativeUIDebugSurface, ɵHOVER_MENU_CLOSE_DELAY_MS, ɵHoverMenuController, type ɵHoverMenuState, ɵINLINE_FEATURE_WARNING_STYLE, type ɵInspectorKiteArtwork, type ɵInspectorKiteGradient, type ɵInspectorKitePath, type ɵInspectorKiteStop, ɵInterruptDecision, ɵInterruptEvent, ɵInterruptState, ɵInterruptToolResult, ɵKEYBOARD_OPEN_THRESHOLD_PX, type ɵKeyboardState, ɵLICENSE_BANNER_OFFSET, ɵLICENSE_BANNER_STYLE, type ɵLicenseBannerDetails, type ɵLicenseBannerSeverity, type ɵLicenseBannerSpec, type ɵLicenseBannerType, type LicenseStateInput as ɵLicenseStateInput, ɵMAX_SOCKET_RETRIES, ɵMESSAGE_FEEDBACK_EVENT_NAME, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH, ɵMOBILE_MAX_WIDTH_QUERY, ɵMemoryEnvironment, ɵMemoryMetadataEvent, ɵMemoryRuntimeContext, ɵMemoryState, ɵMemoryStore, type ɵMessageFeedback, type ɵMessageFeedbackControls, type ɵMessageFeedbackRating, type ɵMessageFeedbackScope, OpenGenerativeUIController as ɵOpenGenerativeUIController, OpenGenerativeUIControllerOptions as ɵOpenGenerativeUIControllerOptions, OpenGenerativeUIPhase as ɵOpenGenerativeUIPhase, OpenGenerativeUIState as ɵOpenGenerativeUIState, ɵPendingInterrupt, ɵPhoenixChannelLike, ɵPhoenixChannelOptions, ɵPhoenixChannelSession, ɵPhoenixJoinOutcome, ɵPhoenixPushLike, ɵPhoenixSocketLike, ɵPhoenixSocketOptions, ɵPhoenixSocketSession, ɵPhoenixSocketSignal, type ɵPinMessageToTopOptions, ɵRUNTIME_PROBE_TIMEOUT_MS, type ReasoningDuration as ɵReasoningDuration, SandboxFunctionHandle as ɵSandboxFunctionHandle, SandboxLocalApi as ɵSandboxLocalApi, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵThread, ɵThreadEnvironment, ɵThreadMetadataEvent, ɵThreadRuntimeContext, ɵThreadSelectors, ɵThreadStore, type ToolCallDisplayContextValue as ɵToolCallDisplayContextValue, type ToolCallLayout as ɵToolCallLayout, type ToolCallRendererNames as ɵToolCallRendererNames, type ToolCallRendererNamesOptions as ɵToolCallRendererNamesOptions, type ToolCallRowStatus as ɵToolCallRowStatus, type ToolCallSegment as ɵToolCallSegment, type TranscriptionCore as ɵTranscriptionCore, type ɵTranscriptionErrorLabelKey, type TurnOpenState as ɵTurnOpenState, type TurnWork as ɵTurnWork, type ɵUserMessageMediaPart, WebsandboxConstructor as ɵWebsandboxConstructor, WebsandboxInstance as ɵWebsandboxInstance, WebsandboxLoader as ɵWebsandboxLoader, type ɵWorkSummaryInput, type WorkTime as ɵWorkTime, ɵclearAgentInterruptState, cn as ɵcn, ɵcomposerButtonState, ɵcopilotIconSvgAttributes, ɵcopilotIcons, countFailedToolCalls as ɵcountFailedToolCalls, createMemoryStore as ɵcreateMemoryStore, ɵcreateThreadSelectors, createThreadStore as ɵcreateThreadStore, ɵdeduplicateMessages, extractCompleteStyles as ɵextractCompleteStyles, ɵflattenUserMessageContent, ɵformatCountLabel, ɵformatLabel, formatReasoningDuration as ɵformatReasoningDuration, ɵformatReasoningDurationLabel, formatToolNames as ɵformatToolNames, formatWorkDuration as ɵformatWorkDuration, ɵgetAgentInterruptState, getArgumentPreview as ɵgetArgumentPreview, ɵgetBranchNavState, ɵgetInlineFeatureWarningSpec, getLatestTurnKey as ɵgetLatestTurnKey, ɵgetLicenseBannerSpec, ɵgetMessageFeedback, ɵgetMessageFeedbackControls, getToolCallLayouts as ɵgetToolCallLayouts, getToolCallPreview as ɵgetToolCallPreview, getToolCallRendererNames as ɵgetToolCallRendererNames, getToolCallRowStatus as ɵgetToolCallRowStatus, getToolResults as ɵgetToolResults, getTurnWork as ɵgetTurnWork, ɵgetUserMessageMediaFilename, ɵgetUserMessageMediaParts, getWorkOpenState as ɵgetWorkOpenState, ɵgetWorkSummaryText, ɵhasAssistantMessageText, ɵinitialKeyboardState, ɵinspectorKiteFill, ɵinspectorKiteIcon, ɵinspectorShortcuts, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisLearningFeedbackEnabled, ɵisMobileViewport, isRetryableStatus as ɵisRetryableMemoryStatus, isTurnWorkOpen as ɵisTurnWorkOpen, isTurnWorking as ɵisTurnWorking, ɵjoinPhoenixChannel$, loadWebsandbox as ɵloadWebsandbox, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵmessagesFingerprint, ɵnormalizeAutoScroll, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵpinMessageToTop, pluralize as ɵpluralize, processPartialHtml as ɵprocessPartialHtml, ɵreadKeyboardState, recordWorkTime as ɵrecordWorkTime, ɵreserveLicenseBannerOffset, ɵresetMessageFeedbackCache, ɵresolveActivityRenderer, ɵresolveComposerKey, ɵresolveCustomMessageRenderers, ɵresolveLicenseState, ɵresolveThreadsLicense, ɵresolveToolCallRenderer, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵsetMessageFeedback, shallowEqualRecord as ɵshallowEqualRecord, ɵshouldShowAssistantToolbar, stringifyToolCallPayload as ɵstringifyToolCallPayload, ɵsubscribeToLearningFeedbackEnabled, ɵsubscribeToMessageFeedback, ɵthreadAdapterEvents, ɵtranscribeAudio, ɵtranscriptionErrorMessageKey, ɵwatchKeyboardState, ɵwatchMobileViewport, ɵwithHeaderDefaults };
3908
6347
  //# sourceMappingURL=index.d.cts.map