@copilotkit/core 2.0.0-rc.41 → 2.0.0-rc.43

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.mjs CHANGED
@@ -2107,8 +2107,8 @@ var AgentRegistry = class {
2107
2107
  inspectorMetadataCredentialsGeneration = 0;
2108
2108
  inspectorMetadataAbortController;
2109
2109
  inspectorMetadataNotificationQueue = Promise.resolve();
2110
- _a2uiEnabled = false;
2111
- _a2uiAgents;
2110
+ _generativeUIEnabled = false;
2111
+ _generativeUIAgents;
2112
2112
  _openGenerativeUIEnabled = false;
2113
2113
  _licenseStatus;
2114
2114
  _runtimeEntitlements;
@@ -2180,15 +2180,16 @@ var AgentRegistry = class {
2180
2180
  get inspectorMetadata() {
2181
2181
  return this._inspectorMetadata;
2182
2182
  }
2183
- get a2uiEnabled() {
2184
- return this._a2uiEnabled;
2183
+ /** Whether the runtime turns generative UI (A2UI 1.0) on. */
2184
+ get generativeUIEnabled() {
2185
+ return this._generativeUIEnabled;
2185
2186
  }
2186
2187
  /**
2187
- * Agent ids the runtime applies A2UI to (#5369). `undefined` means A2UI
2188
- * applies to every agent — or is disabled entirely; check `a2uiEnabled`.
2188
+ * Agent ids the runtime limits generative UI to. `undefined` means every
2189
+ * agent, or off; check `generativeUIEnabled`.
2189
2190
  */
2190
- get a2uiAgents() {
2191
- return this._a2uiAgents;
2191
+ get generativeUIAgents() {
2192
+ return this._generativeUIAgents;
2192
2193
  }
2193
2194
  get openGenerativeUIEnabled() {
2194
2195
  return this._openGenerativeUIEnabled;
@@ -2950,8 +2951,8 @@ var AgentRegistry = class {
2950
2951
  this._singleRouteResourceOperations = false;
2951
2952
  this._suggestions = void 0;
2952
2953
  this._inspectorLearning = false;
2953
- this._a2uiEnabled = false;
2954
- this._a2uiAgents = void 0;
2954
+ this._generativeUIEnabled = false;
2955
+ this._generativeUIAgents = void 0;
2955
2956
  this._openGenerativeUIEnabled = false;
2956
2957
  this._licenseStatus = void 0;
2957
2958
  this._runtimeEntitlements = void 0;
@@ -3029,9 +3030,9 @@ var AgentRegistry = class {
3029
3030
  this._inspectorMetadataSupported = runtimeInfoResponse.inspectorMetadata === true;
3030
3031
  this.inspectorMetadataRefreshReady = false;
3031
3032
  if (!this._inspectorMetadataSupported) this.setInspectorMetadata(void 0);
3032
- const a2uiInfo = runtimeInfoResponse.a2ui;
3033
- this._a2uiEnabled = a2uiInfo?.enabled ?? runtimeInfoResponse.a2uiEnabled ?? false;
3034
- this._a2uiAgents = a2uiInfo?.enabled ? a2uiInfo.agents : void 0;
3033
+ const generativeUIInfo = runtimeInfoResponse.generativeUI;
3034
+ this._generativeUIEnabled = generativeUIInfo?.enabled ?? false;
3035
+ this._generativeUIAgents = generativeUIInfo?.enabled ? generativeUIInfo.agents : void 0;
3035
3036
  this._openGenerativeUIEnabled = runtimeInfoResponse.openGenerativeUIEnabled ?? false;
3036
3037
  this._licenseStatus = runtimeInfoResponse.licenseStatus;
3037
3038
  this._runtimeEntitlements = runtimeInfoResponse.runtimeEntitlements;
@@ -3062,8 +3063,8 @@ var AgentRegistry = class {
3062
3063
  this._singleRouteResourceOperations = false;
3063
3064
  this._suggestions = void 0;
3064
3065
  this._inspectorLearning = false;
3065
- this._a2uiEnabled = false;
3066
- this._a2uiAgents = void 0;
3066
+ this._generativeUIEnabled = false;
3067
+ this._generativeUIAgents = void 0;
3067
3068
  this._openGenerativeUIEnabled = false;
3068
3069
  if (!boundedEntitlementRetryFailed) {
3069
3070
  this._licenseStatus = void 0;
@@ -7853,9 +7854,9 @@ function ɵhitlRenderProps(props, tool, registry) {
7853
7854
  //#region src/core/runtime-info.ts
7854
7855
  const RUNTIME_INFO_KEYS = [
7855
7856
  "status",
7856
- "a2uiEnabled",
7857
- "a2uiAgents",
7858
7857
  "openGenerativeUIEnabled",
7858
+ "generativeUIEnabled",
7859
+ "generativeUIAgents",
7859
7860
  "licenseStatus",
7860
7861
  "runtimeEntitlements",
7861
7862
  "runtimeEntitlementRetryPending",
@@ -8045,8 +8046,8 @@ var CopilotKitCore = class {
8045
8046
  this.learningBridge = new LearningBridge(this, learning, () => this.notifyTrajectoryChanged());
8046
8047
  this.runtimeInfoStore = new ɵRuntimeInfoStore(() => ({
8047
8048
  status: this.runtimeConnectionStatus,
8048
- a2uiEnabled: this.a2uiEnabled,
8049
- a2uiAgents: this.a2uiAgents,
8049
+ generativeUIEnabled: this.generativeUIEnabled,
8050
+ generativeUIAgents: this.generativeUIAgents,
8050
8051
  openGenerativeUIEnabled: this.openGenerativeUIEnabled,
8051
8052
  licenseStatus: this.licenseStatus,
8052
8053
  runtimeEntitlements: this.runtimeEntitlements,
@@ -8326,15 +8327,16 @@ var CopilotKitCore = class {
8326
8327
  async refreshInspectorMetadata() {
8327
8328
  await this.agentRegistry.refreshInspectorMetadata();
8328
8329
  }
8329
- get a2uiEnabled() {
8330
- return this.agentRegistry.a2uiEnabled;
8330
+ /** Whether the runtime turns generative UI (A2UI 1.0) on. */
8331
+ get generativeUIEnabled() {
8332
+ return this.agentRegistry.generativeUIEnabled;
8331
8333
  }
8332
8334
  /**
8333
- * Agent ids the runtime applies A2UI to. `undefined` means A2UI applies to
8334
- * every agent (or is disabled — check `a2uiEnabled`).
8335
+ * Agent ids the runtime limits generative UI to. `undefined` means every
8336
+ * agent (or off; check `generativeUIEnabled`).
8335
8337
  */
8336
- get a2uiAgents() {
8337
- return this.agentRegistry.a2uiAgents;
8338
+ get generativeUIAgents() {
8339
+ return this.agentRegistry.generativeUIAgents;
8338
8340
  }
8339
8341
  get openGenerativeUIEnabled() {
8340
8342
  return this.agentRegistry.openGenerativeUIEnabled;
@@ -9622,7 +9624,7 @@ function toolCallKey(entry) {
9622
9624
  * Tool-call renderers come from three places. Prop renderers are the list the
9623
9625
  * provider was given (`setPropToolCalls`). Hook renderers are added one at a
9624
9626
  * time (`addHookToolCall`), for example by `useRenderTool`. Built-in
9625
- * renderers are added by CopilotKit features such as A2UI
9627
+ * renderers are added by CopilotKit features such as generative UI
9626
9628
  * (`addBuiltInToolCall`). Each renderer has a key made of its `agentId` and
9627
9629
  * `name`. A hook renderer replaces a prop renderer with the same key, and a
9628
9630
  * later hook renderer replaces an earlier one with the same key, so the
@@ -9752,7 +9754,7 @@ var ɵRendererRegistry = class {
9752
9754
  }
9753
9755
  /**
9754
9756
  * Add a built-in renderer, for a tool that a CopilotKit feature owns (for
9755
- * example the A2UI render tool). Prop and hook renderers with the same
9757
+ * example the generative UI render tool). Prop and hook renderers with the same
9756
9758
  * `agentId` and `name` win over it, and setting the prop renderers never
9757
9759
  * removes it.
9758
9760
  *
@@ -9763,7 +9765,7 @@ var ɵRendererRegistry = class {
9763
9765
  *
9764
9766
  * @example
9765
9767
  * ```ts
9766
- * const remove = registry.addBuiltInToolCall({ name: "render_a2ui", render: Nothing });
9768
+ * const remove = registry.addBuiltInToolCall({ name: "render_ui", render: Nothing });
9767
9769
  * // when the feature turns off
9768
9770
  * remove();
9769
9771
  * ```
@@ -10598,8 +10600,7 @@ function toRuntimeTransport(runtimeTransport, useSingleEndpoint) {
10598
10600
  * - The transport is `runtimeTransport`, else `useSingleEndpoint` mapped to
10599
10601
  * `"single"` (true), `"rest"` (false) or `"auto"` (unset).
10600
10602
  * - The agents are the dev agents with `selfManagedAgents` on top.
10601
- * - The properties get `a2uiCatalogAvailable: true` when a catalog is set.
10602
- * Without a catalog the input object is returned as is.
10603
+ * - The properties are the input object, or a shared empty object.
10603
10604
  * - The header defaults carry the public key header when a key is set.
10604
10605
  *
10605
10606
  * It does not log or throw. The provider reports `diagnostics` (see
@@ -10615,11 +10616,7 @@ function ɵresolveProviderConfig(input) {
10615
10616
  ...input.agents__unsafe_dev_only,
10616
10617
  ...input.selfManagedAgents
10617
10618
  };
10618
- const baseProperties = input.properties ?? EMPTY_PROPERTIES;
10619
- const properties = input.a2uiCatalog ? {
10620
- ...baseProperties,
10621
- a2uiCatalogAvailable: true
10622
- } : baseProperties;
10619
+ const properties = input.properties ?? EMPTY_PROPERTIES;
10623
10620
  const headerDefaults = ɵpublicKeyHeaderDefaults(publicKey);
10624
10621
  const diagnostics = [];
10625
10622
  const hasLocalAgents = Object.keys(agents).length > 0;
@@ -10816,45 +10813,46 @@ function ɵassembleProviderToolRenderers(input) {
10816
10813
  return renderToolCalls;
10817
10814
  }
10818
10815
  /**
10819
- * @internal Whether the provider turns on A2UI: its built-in renderers and
10820
- * its agent context.
10816
+ * @internal Whether the provider falls back to the standard UI for generative
10817
+ * UI. That is when the provider has no `generativeUI` UI of its own and the
10818
+ * runtime turns generative UI on. A UI of the app always wins, with its own
10819
+ * `agentIds`.
10821
10820
  *
10822
- * A2UI is active when the runtime enables it or the provider has a catalog.
10823
- * With `requireCatalog`, only a catalog turns it on. `missingCatalog` is
10824
- * true when the runtime enables A2UI but `requireCatalog` keeps it off;
10825
- * the provider should tell the developer to configure a catalog.
10821
+ * The fallback is scoped to the agents of the runtime: pass `agentIds` on as
10822
+ * the `agentIds` of the generative UI config, so only those agents get the
10823
+ * envelope.
10826
10824
  *
10827
10825
  * @example
10828
- * ɵresolveA2UIActivation({ runtimeEnabled: true, hasCatalog: false });
10829
- * // { active: true, missingCatalog: false }
10830
- * ɵresolveA2UIActivation({ runtimeEnabled: true, hasCatalog: false, requireCatalog: true });
10831
- * // { active: false, missingCatalog: true }
10832
- */
10833
- function ɵresolveA2UIActivation({ runtimeEnabled, hasCatalog, requireCatalog = false }) {
10834
- if (requireCatalog) return {
10835
- active: hasCatalog,
10836
- missingCatalog: runtimeEnabled && !hasCatalog
10837
- };
10826
+ * const fallback = ɵresolveGenerativeUIDefault({
10827
+ * runtimeEnabled: runtimeInfo.generativeUIEnabled,
10828
+ * runtimeAgents: runtimeInfo.generativeUIAgents,
10829
+ * hasUI: !!generativeUI?.ui,
10830
+ * });
10831
+ * const config =
10832
+ * generativeUI ??
10833
+ * (fallback.active
10834
+ * ? { ui: standardUI, agentIds: fallback.agentIds }
10835
+ * : undefined);
10836
+ */
10837
+ function ɵresolveGenerativeUIDefault({ runtimeEnabled, runtimeAgents, hasUI }) {
10838
+ if (hasUI || !runtimeEnabled) return { active: false };
10838
10839
  return {
10839
- active: runtimeEnabled || hasCatalog,
10840
- missingCatalog: false
10840
+ active: true,
10841
+ agentIds: runtimeAgents
10841
10842
  };
10842
10843
  }
10843
10844
  /**
10844
10845
  * @internal The provider's activity renderer list: the app's renderers, then
10845
- * the A2UI renderer, then the other built-in renderers. Missing entries are
10846
- * left out.
10846
+ * the built-in renderers. Missing entries are left out.
10847
10847
  *
10848
10848
  * @example
10849
10849
  * ɵassembleActivityRenderers({
10850
10850
  * app: props.renderActivityMessages,
10851
- * a2ui: a2uiActive ? a2uiRenderer : undefined,
10852
- * builtIns: [mcpAppsRenderer, openGenUIActive && openGenUIRenderer],
10851
+ * * builtIns: [mcpAppsRenderer, openGenUIActive && openGenUIRenderer],
10853
10852
  * });
10854
10853
  */
10855
- function ɵassembleActivityRenderers({ app = [], a2ui, builtIns = [] }) {
10854
+ function ɵassembleActivityRenderers({ app = [], builtIns = [] }) {
10856
10855
  const renderers = [...app];
10857
- if (a2ui) renderers.push(a2ui);
10858
10856
  for (const renderer of builtIns) if (renderer) renderers.push(renderer);
10859
10857
  return renderers;
10860
10858
  }
@@ -12074,691 +12072,6 @@ var ɵInspectorThreadOverride = class {
12074
12072
  }
12075
12073
  };
12076
12074
 
12077
- //#endregion
12078
- //#region src/a2ui/constants.ts
12079
- /**
12080
- * The content key that carries A2UI operations, on `a2ui-surface` activities
12081
- * and on render tool results. Must match `A2UI_OPERATIONS_KEY` in
12082
- * `@ag-ui/a2ui-middleware` and `copilotkit_runtime.a2ui` (Python).
12083
- */
12084
- const A2UI_OPERATIONS_KEY = "a2ui_operations";
12085
- /** The activity type the A2UI middleware streams surfaces and their lifecycle on. */
12086
- const A2UI_SURFACE_ACTIVITY_TYPE = "a2ui-surface";
12087
- /** The tool the A2UI middleware injects so the model can generate a surface. */
12088
- const RENDER_A2UI_TOOL_NAME = "render_a2ui";
12089
- /** The surface an operation that names no surface is filed under. */
12090
- const A2UI_DEFAULT_SURFACE_ID = "default";
12091
- /**
12092
- * The component id every renderer starts from when it walks a surface. A2UI
12093
- * v0.9 gives a payload no way to name its own entry point, so it is fixed.
12094
- * `@copilotkit/a2ui-renderer` exports the same value as `ROOT_COMPONENT_ID`.
12095
- */
12096
- const A2UI_ROOT_COMPONENT_ID = "root";
12097
-
12098
- //#endregion
12099
- //#region src/a2ui/operations.ts
12100
- function isRecord$1(value) {
12101
- return typeof value === "object" && value !== null && !Array.isArray(value);
12102
- }
12103
- /**
12104
- * Reads the A2UI operations from activity content or a tool result payload.
12105
- * The `a2ui_operations` key wins; a bare `operations` key is accepted too.
12106
- * Entries that are not objects are dropped.
12107
- *
12108
- * @param content - Activity content or a parsed tool result, of any shape.
12109
- * @returns The operations, or an empty list when there are none.
12110
- */
12111
- function getA2UIOperations(content) {
12112
- if (!isRecord$1(content)) return [];
12113
- const operations = content[A2UI_OPERATIONS_KEY] ?? content.operations;
12114
- if (!Array.isArray(operations)) return [];
12115
- return operations.filter(isRecord$1);
12116
- }
12117
- /**
12118
- * The operation keys that nest a `surfaceId`, v0.9 first, then the v0.8 keys
12119
- * older agents still send.
12120
- */
12121
- const NESTED_SURFACE_KEYS = [
12122
- "createSurface",
12123
- "updateComponents",
12124
- "updateDataModel",
12125
- "deleteSurface",
12126
- "beginRendering",
12127
- "surfaceUpdate",
12128
- "dataModelUpdate"
12129
- ];
12130
- /**
12131
- * Resolves the surface an operation addresses.
12132
- *
12133
- * The nested `surfaceId` wins, because that is the id `MessageProcessor`
12134
- * creates the surface under. Grouping by a top-level `surfaceId` instead files
12135
- * the operations against a surface that never exists, which paints nothing
12136
- * (OSS-1048). A top-level `surfaceId` is honoured only when no nested id is
12137
- * present.
12138
- *
12139
- * @param operation - One A2UI operation, of any shape.
12140
- * @returns The surface id, or null when the operation names none.
12141
- */
12142
- function getA2UIOperationSurfaceId(operation) {
12143
- if (!isRecord$1(operation)) return null;
12144
- for (const key of NESTED_SURFACE_KEYS) {
12145
- const inner = operation[key];
12146
- if (isRecord$1(inner) && typeof inner.surfaceId === "string") return inner.surfaceId;
12147
- }
12148
- return typeof operation.surfaceId === "string" ? operation.surfaceId : null;
12149
- }
12150
- /**
12151
- * Groups operations by the surface they address, in first-seen order. An
12152
- * operation that names no surface goes under `"default"`.
12153
- *
12154
- * @param operations - Operations in arrival order.
12155
- */
12156
- function groupA2UIOperationsBySurface(operations) {
12157
- const groups = /* @__PURE__ */ new Map();
12158
- for (const operation of operations) {
12159
- const surfaceId = getA2UIOperationSurfaceId(operation) ?? A2UI_DEFAULT_SURFACE_ID;
12160
- const group = groups.get(surfaceId);
12161
- if (group) group.push(operation);
12162
- else groups.set(surfaceId, [operation]);
12163
- }
12164
- return groups;
12165
- }
12166
- function hasValue(value) {
12167
- if (Array.isArray(value)) return value.length > 0;
12168
- return value !== null && value !== void 0 && value !== "";
12169
- }
12170
- /**
12171
- * Whether operations are enough to paint a visible card yet. A data-bound
12172
- * surface addresses its values by `path` and draws nothing until a data model
12173
- * update carries a non-empty value; a static surface paints from its
12174
- * components alone. Times the loader → surface hand-off to real content rather
12175
- * than a fixed delay (OSS-162).
12176
- *
12177
- * @param operations - The operations of one surface or of a whole activity.
12178
- */
12179
- function surfaceHasRenderableContent(operations) {
12180
- const componentOperations = operations.filter((operation) => isRecord$1(operation.updateComponents));
12181
- if (componentOperations.length === 0) return false;
12182
- if (!JSON.stringify(componentOperations).includes("\"path\"")) return true;
12183
- return operations.some((operation) => {
12184
- const update = operation.updateDataModel;
12185
- if (!isRecord$1(update)) return false;
12186
- const value = update.value;
12187
- if (typeof value !== "object" || value === null) return false;
12188
- return Object.values(value).some(hasValue);
12189
- });
12190
- }
12191
-
12192
- //#endregion
12193
- //#region src/a2ui/diagnostics.ts
12194
- /**
12195
- * How long a surface may take to report its first paint before the loader
12196
- * hand-off gives up and shows it anyway. Reaching it with no paint is also the
12197
- * moment the unpainted and unresolved-root diagnostics fire.
12198
- */
12199
- const A2UI_PAINT_FALLBACK_MS = 8e3;
12200
- /** The operation kinds a surface received, comma-separated, or "none". */
12201
- function describeOperationKinds(operations) {
12202
- const kinds = /* @__PURE__ */ new Set();
12203
- for (const operation of operations) for (const key of Object.keys(operation)) if (key !== "version") kinds.add(key);
12204
- return kinds.size === 0 ? "none" : Array.from(kinds).join(", ");
12205
- }
12206
- function componentLists(operations) {
12207
- const lists = [];
12208
- for (const operation of operations) {
12209
- const update = operation.updateComponents;
12210
- if (isRecord$1(update) && Array.isArray(update.components)) lists.push(update.components);
12211
- }
12212
- return lists;
12213
- }
12214
- /** The component ids a surface was sent, quoted and comma-separated, or "none". */
12215
- function describeComponentIds(operations) {
12216
- const ids = [];
12217
- const lists = componentLists(operations);
12218
- for (const components of lists) for (const component of components) {
12219
- const id = isRecord$1(component) ? component.id : void 0;
12220
- if (typeof id === "string" && !ids.includes(id)) ids.push(id);
12221
- }
12222
- return ids.length === 0 ? "none" : ids.map((id) => `"${id}"`).join(", ");
12223
- }
12224
- /**
12225
- * Explains why a surface that received operations never painted, or returns
12226
- * null when its operations are enough to paint.
12227
- *
12228
- * Reaching {@link A2UI_PAINT_FALLBACK_MS} with no paint means the operations
12229
- * were accepted and still put nothing on screen. Left alone that is
12230
- * invisible, so the message says which half is missing.
12231
- *
12232
- * @param surfaceId - The surface the operations address.
12233
- * @param operations - The operations grouped under that surface.
12234
- */
12235
- function diagnoseUnpaintedSurface(surfaceId, operations) {
12236
- if (surfaceHasRenderableContent(operations)) return null;
12237
- const cause = componentLists(operations).length === 0 ? "no updateComponents operation arrived, so the surface was never given anything to draw" : "its components address their values by \"path\" and no updateDataModel carried a non-empty value, so every bound component drew empty";
12238
- return `[CopilotKit] A2UI surface "${surfaceId}" received operations and never painted after ${String(A2UI_PAINT_FALLBACK_MS)}ms: ${cause}. Operations received: ${describeOperationKinds(operations)}. The payload was accepted, so check what the agent sent rather than the client wiring. This warning is development-only.`;
12239
- }
12240
- /**
12241
- * Explains a surface that never got created although operations addressed
12242
- * it. The usual cause is operations sent to one surface id while the surface
12243
- * was created under another, or operations that were all dropped as invalid.
12244
- *
12245
- * @param surfaceId - The surface the operations address.
12246
- * @param operations - The operations processed for that surface.
12247
- */
12248
- function diagnoseMissingSurface(surfaceId, operations) {
12249
- return `[CopilotKit] A2UI processed ${String(operations.length)} operation(s) addressed to surface "${surfaceId}" and no surface by that id exists, so this card rendered nothing. Operations received: ${describeOperationKinds(operations)}. A createSurface for "${surfaceId}" has to arrive before, or with, the operations that target it. This warning is development-only.`;
12250
- }
12251
- /**
12252
- * Explains a surface still waiting for its root component once operations
12253
- * have stopped arriving, or returns null when the root resolved (or when no
12254
- * components arrived at all, which {@link diagnoseUnpaintedSurface} explains
12255
- * better).
12256
- *
12257
- * Renderers begin walking a surface at the root id and treat an id they cannot
12258
- * find as not arrived yet, so a payload without it animates a placeholder
12259
- * forever while every other check calls it healthy. Reads the live components
12260
- * model, so it covers every way the root can fail to resolve.
12261
- *
12262
- * @param surfaceId - The surface the operations address.
12263
- * @param operations - The operations processed for that surface.
12264
- * @param surface - The live surface model.
12265
- */
12266
- function diagnoseUnresolvedRoot(surfaceId, operations, surface) {
12267
- if (surface.componentsModel.get(A2UI_ROOT_COMPONENT_ID)) return null;
12268
- const lists = componentLists(operations);
12269
- if (lists.length === 0) return null;
12270
- const cause = lists.some((components) => components.some((component) => isRecord$1(component) && component.id === A2UI_ROOT_COMPONENT_ID)) ? `a component with id "${A2UI_ROOT_COMPONENT_ID}" WAS sent, so the components did not reach the surface's model — check for an A2UI render error above, or a catalog that took none of them` : `the components it received are named ${describeComponentIds(operations)}, and none of them is "${A2UI_ROOT_COMPONENT_ID}" — rename the entry-point component to "${A2UI_ROOT_COMPONENT_ID}", and make every other component reachable from it through child/children`;
12271
- return `[CopilotKit] A2UI surface "${surfaceId}" has no "${A2UI_ROOT_COMPONENT_ID}" component ${String(A2UI_PAINT_FALLBACK_MS)}ms after its last operations were processed, so it is showing the placeholder for a component that has not arrived yet and will keep showing it: ${cause}. Operations received: ${describeOperationKinds(operations)}. This warning is development-only.`;
12272
- }
12273
-
12274
- //#endregion
12275
- //#region src/a2ui/actions.ts
12276
- /**
12277
- * Wraps a raw processor action in the client-event envelope the runtimes read,
12278
- * filling the fields a partial action leaves out.
12279
- *
12280
- * @param action - What the `MessageProcessor` action handler received.
12281
- */
12282
- function toA2UIClientEvent(action) {
12283
- return { userAction: {
12284
- name: action.name ?? "unknown",
12285
- surfaceId: action.surfaceId ?? A2UI_DEFAULT_SURFACE_ID,
12286
- sourceComponentId: action.sourceComponentId ?? "",
12287
- context: action.context,
12288
- timestamp: action.timestamp ?? (/* @__PURE__ */ new Date()).toISOString()
12289
- } };
12290
- }
12291
- /**
12292
- * Sends one A2UI user action to the agent: runs the optional `onAction`
12293
- * interceptor first, then sets the `a2uiAction` run property and runs the
12294
- * agent unless the interceptor suppressed it (returned `null`). The
12295
- * `a2uiAction` property is always removed afterwards so it does not leak into
12296
- * later runs.
12297
- *
12298
- * Does nothing when there is no agent (a surface rendered outside a chat).
12299
- *
12300
- * @example
12301
- * ```ts
12302
- * new MessageProcessor([catalog], (action) =>
12303
- * ɵrunA2UIAction({ message: ɵtoA2UIClientEvent(action), agent, core }),
12304
- * );
12305
- * ```
12306
- */
12307
- async function runA2UIAction({ message, agent, core, onAction }) {
12308
- if (!agent) return;
12309
- const forward = async (forwardAction) => {
12310
- const a2uiAction = forwardAction === void 0 ? message : {
12311
- ...message,
12312
- userAction: forwardAction
12313
- };
12314
- try {
12315
- core.setProperties({
12316
- ...core.properties,
12317
- a2uiAction
12318
- });
12319
- await core.runAgent({ agent });
12320
- } finally {
12321
- const { a2uiAction: _removed, ...rest } = core.properties;
12322
- core.setProperties(rest);
12323
- }
12324
- };
12325
- if (onAction) {
12326
- const result = await onAction(message.userAction, forward);
12327
- if (result === null) return;
12328
- if (result) {
12329
- await forward(result);
12330
- return;
12331
- }
12332
- }
12333
- await forward();
12334
- }
12335
-
12336
- //#endregion
12337
- //#region src/a2ui/lifecycle.ts
12338
- const A2UI_RECOVERY_DEFAULTS = {
12339
- showAfterMs: 2e3,
12340
- showAfterAttempts: 2,
12341
- debugExposure: "collapsed",
12342
- paintFallbackMs: A2UI_PAINT_FALLBACK_MS
12343
- };
12344
- /** User-visible text of the lifecycle states. */
12345
- const A2UI_LIFECYCLE_TEXT = {
12346
- building: "Building interface",
12347
- retrying: "Retrying generation…",
12348
- failureTitle: "Couldn't generate the UI",
12349
- failureDescription: "Something went wrong rendering this. You can keep chatting and try again.",
12350
- failureDetails: "developer details",
12351
- retryDetails: "validation issues"
12352
- };
12353
- function isDebugExposure(value) {
12354
- return value === "hidden" || value === "collapsed" || value === "verbose";
12355
- }
12356
- function numberOrUndefined(value) {
12357
- return typeof value === "number" ? value : void 0;
12358
- }
12359
- function arrayOrUndefined(value) {
12360
- return Array.isArray(value) ? value : void 0;
12361
- }
12362
- /**
12363
- * Reads the lifecycle fields from activity content. An unknown or missing
12364
- * `status` reads as "building"; fields of the wrong type are left out.
12365
- *
12366
- * @param content - `a2ui-surface` activity content, of any shape.
12367
- */
12368
- function readA2UILifecycle(content) {
12369
- if (!isRecord$1(content)) return { status: "building" };
12370
- return {
12371
- status: content.status === "retrying" || content.status === "failed" ? content.status : "building",
12372
- attempt: numberOrUndefined(content.attempt),
12373
- maxAttempts: numberOrUndefined(content.maxAttempts),
12374
- progressTokens: numberOrUndefined(content.progressTokens),
12375
- error: typeof content.error === "string" ? content.error : void 0,
12376
- errors: arrayOrUndefined(content.errors),
12377
- attempts: arrayOrUndefined(content.attempts),
12378
- debugExposure: isDebugExposure(content.debugExposure) ? content.debugExposure : void 0
12379
- };
12380
- }
12381
- /**
12382
- * Validates `a2ui-surface` activity content for activity renderer
12383
- * registration. Any object passes: {@link readA2UILifecycle} and
12384
- * `getA2UIOperations` read the fields and ignore mistyped ones, so a field
12385
- * a newer middleware adds can never hide the surface.
12386
- */
12387
- const A2UI_SURFACE_CONTENT_SCHEMA = { "~standard": {
12388
- version: 1,
12389
- vendor: "copilotkit",
12390
- validate: (value) => isRecord$1(value) ? { value } : { issues: [{ message: "a2ui-surface content must be an object" }] }
12391
- } };
12392
- /**
12393
- * The debug exposure to use: the server-stamped one wins, then the client
12394
- * option, then "collapsed".
12395
- */
12396
- function resolveA2UIDebugExposure(lifecycle, option) {
12397
- return lifecycle.debugExposure ?? option ?? A2UI_RECOVERY_DEFAULTS.debugExposure;
12398
- }
12399
- /**
12400
- * How much of the skeleton to reveal for an estimated token count. With no
12401
- * count yet the full skeleton shows rather than an empty box.
12402
- *
12403
- * @param tokens - The streamed token estimate, if the server sent one.
12404
- */
12405
- function getA2UIProgressPhase(tokens) {
12406
- let phase = 3;
12407
- if (tokens === void 0) return phase;
12408
- if (tokens < 50) phase = 0;
12409
- else if (tokens < 200) phase = 1;
12410
- else if (tokens < 400) phase = 2;
12411
- return phase;
12412
- }
12413
- /**
12414
- * The label under the skeleton: "Building interface" until a retry is
12415
- * revealed, then "Retrying generation…", with the attempt count when known.
12416
- */
12417
- function formatA2UIRetryLabel(lifecycle, retryRevealed) {
12418
- if (lifecycle.status !== "retrying" || !retryRevealed) return A2UI_LIFECYCLE_TEXT.building;
12419
- const { attempt, maxAttempts } = lifecycle;
12420
- if (attempt === void 0 || maxAttempts === void 0) return A2UI_LIFECYCLE_TEXT.retrying;
12421
- return `${A2UI_LIFECYCLE_TEXT.retrying} (${String(attempt)}/${String(maxAttempts)} attempts)`;
12422
- }
12423
- /**
12424
- * Serializes a debug payload for display. Never throws: circular references,
12425
- * functions, bigints and symbols get placeholder text.
12426
- */
12427
- function formatA2UIDebugPayload(value) {
12428
- if (typeof value === "string") return value;
12429
- const seen = /* @__PURE__ */ new WeakSet();
12430
- try {
12431
- return JSON.stringify(value, (_key, candidate) => {
12432
- if (typeof candidate === "bigint") return `${candidate.toString()}n`;
12433
- if (typeof candidate === "function") return "[Function]";
12434
- if (typeof candidate === "symbol") return candidate.toString();
12435
- if (typeof candidate === "object" && candidate !== null) {
12436
- if (seen.has(candidate)) return "[Circular]";
12437
- seen.add(candidate);
12438
- }
12439
- return candidate;
12440
- }, 2) ?? String(value);
12441
- } catch {
12442
- return "[Unserializable value]";
12443
- }
12444
- }
12445
- /** The skeleton rows; each row shows once the progress phase reaches `phase`. */
12446
- const A2UI_SKELETON_ROWS = [
12447
- {
12448
- phase: 0,
12449
- delay: 0,
12450
- parts: [{
12451
- w: 36,
12452
- bg: "rgba(147,197,253,0.7)",
12453
- anim: 0
12454
- }, {
12455
- w: 80,
12456
- bg: "rgba(219,234,254,0.8)",
12457
- anim: .2
12458
- }]
12459
- },
12460
- {
12461
- phase: 0,
12462
- delay: .1,
12463
- parts: [
12464
- "spacer",
12465
- "dot",
12466
- {
12467
- w: 100,
12468
- bg: "rgba(24,24,27,0.2)",
12469
- anim: .3
12470
- }
12471
- ]
12472
- },
12473
- {
12474
- phase: 1,
12475
- delay: .15,
12476
- parts: [
12477
- "spacer",
12478
- {
12479
- w: 48,
12480
- bg: "rgba(24,24,27,0.15)",
12481
- anim: .1
12482
- },
12483
- {
12484
- w: 40,
12485
- bg: "rgba(153,246,228,0.6)",
12486
- anim: .5
12487
- },
12488
- {
12489
- w: 56,
12490
- bg: "rgba(147,197,253,0.6)",
12491
- anim: .3
12492
- }
12493
- ]
12494
- },
12495
- {
12496
- phase: 1,
12497
- delay: .2,
12498
- parts: [
12499
- "spacer",
12500
- "dot",
12501
- {
12502
- w: 60,
12503
- bg: "rgba(24,24,27,0.15)",
12504
- anim: .4
12505
- }
12506
- ]
12507
- },
12508
- {
12509
- phase: 2,
12510
- delay: .25,
12511
- parts: [
12512
- {
12513
- w: 40,
12514
- bg: "rgba(153,246,228,0.5)",
12515
- anim: .2
12516
- },
12517
- "dot",
12518
- {
12519
- w: 48,
12520
- bg: "rgba(24,24,27,0.15)",
12521
- anim: .6
12522
- },
12523
- {
12524
- w: 64,
12525
- bg: "rgba(147,197,253,0.5)",
12526
- anim: .1
12527
- }
12528
- ]
12529
- },
12530
- {
12531
- phase: 2,
12532
- delay: .3,
12533
- parts: [{
12534
- w: 36,
12535
- bg: "rgba(147,197,253,0.6)",
12536
- anim: .5
12537
- }, {
12538
- w: 36,
12539
- bg: "rgba(24,24,27,0.12)",
12540
- anim: .7
12541
- }]
12542
- },
12543
- {
12544
- phase: 3,
12545
- delay: .35,
12546
- parts: [
12547
- "dot",
12548
- {
12549
- w: 44,
12550
- bg: "rgba(24,24,27,0.18)",
12551
- anim: .3
12552
- },
12553
- "dot",
12554
- {
12555
- w: 56,
12556
- bg: "rgba(153,246,228,0.5)",
12557
- anim: .8
12558
- },
12559
- {
12560
- w: 48,
12561
- bg: "rgba(147,197,253,0.5)",
12562
- anim: .4
12563
- }
12564
- ]
12565
- }
12566
- ];
12567
- const defaultSchedule = (callback, ms) => {
12568
- const handle = setTimeout(callback, ms);
12569
- return () => clearTimeout(handle);
12570
- };
12571
- function defaultRequestFrame(callback) {
12572
- if (typeof globalThis.requestAnimationFrame === "function") globalThis.requestAnimationFrame(() => callback());
12573
- else callback();
12574
- }
12575
- const BUILDING = { status: "building" };
12576
- /**
12577
- * Drives what an `a2ui-surface` activity shows: the lifecycle state before
12578
- * paint, the hand-off while the surface paints hidden, then the surface.
12579
- *
12580
- * Give it each content snapshot with `setContent()`, and call `markRendered()`
12581
- * every time the surface applied operations. A surface counts as painted once
12582
- * its operations are renderable (see `surfaceHasRenderableContent`) and a
12583
- * frame has passed; if that never happens the hand-off ends after 8 s anyway
12584
- * and `warn` reports why.
12585
- *
12586
- * @example
12587
- * ```ts
12588
- * const controller = new ɵA2UIActivityController({ recovery });
12589
- * controller.subscribe(() => render(controller.getSnapshot()));
12590
- * controller.setContent(content);
12591
- * // after the surface processed operations:
12592
- * controller.markRendered();
12593
- * // on unmount:
12594
- * controller.dispose();
12595
- * ```
12596
- */
12597
- var A2UIActivityController = class {
12598
- #listeners = /* @__PURE__ */ new Set();
12599
- #showAfterMs;
12600
- #showAfterAttempts;
12601
- #debugExposureOption;
12602
- #warn;
12603
- #schedule;
12604
- #requestFrame;
12605
- #content = void 0;
12606
- #operations = [];
12607
- #lifecycle = BUILDING;
12608
- #retryRevealed = false;
12609
- #cancelRetryTimer;
12610
- #surfaceReady = false;
12611
- #paintRequested = false;
12612
- #cancelFallback;
12613
- /** Bumped by `dispose()`, so callbacks scheduled before it do nothing. */
12614
- #generation = 0;
12615
- #snapshot;
12616
- constructor(options = {}) {
12617
- const recovery = options.recovery ?? {};
12618
- this.#showAfterMs = recovery.showAfterMs ?? A2UI_RECOVERY_DEFAULTS.showAfterMs;
12619
- this.#showAfterAttempts = recovery.showAfterAttempts ?? A2UI_RECOVERY_DEFAULTS.showAfterAttempts;
12620
- this.#debugExposureOption = recovery.debugExposure;
12621
- this.#warn = options.warn;
12622
- this.#schedule = options.schedule ?? defaultSchedule;
12623
- this.#requestFrame = options.requestFrame ?? defaultRequestFrame;
12624
- this.#snapshot = this.#buildSnapshot();
12625
- }
12626
- /** The current snapshot. The same object until something changes. */
12627
- getSnapshot = () => this.#snapshot;
12628
- /** Calls `listener` when the snapshot changes. Returns the unsubscribe function. */
12629
- subscribe = (listener) => {
12630
- this.#listeners.add(listener);
12631
- return () => {
12632
- this.#listeners.delete(listener);
12633
- };
12634
- };
12635
- /** Sets the latest activity content. */
12636
- setContent(content) {
12637
- if (content === this.#content) return;
12638
- this.#content = content;
12639
- const hadOperations = this.#operations.length > 0;
12640
- this.#operations = getA2UIOperations(content);
12641
- if (this.#operations.length === 0) {
12642
- this.#lifecycle = readA2UILifecycle(content);
12643
- this.#updateRetry();
12644
- if (hadOperations) this.#resetHandoff();
12645
- } else if (!hadOperations) this.#startHandoff();
12646
- this.#emit();
12647
- }
12648
- /**
12649
- * Reports that the surface applied operations. Ends the hand-off after the
12650
- * next frame once the operations can paint something.
12651
- */
12652
- markRendered() {
12653
- if (this.#paintRequested || this.#surfaceReady) return;
12654
- if (this.#operations.length === 0) return;
12655
- if (!surfaceHasRenderableContent(this.#operations)) return;
12656
- this.#paintRequested = true;
12657
- const generation = this.#generation;
12658
- this.#requestFrame(() => {
12659
- if (generation !== this.#generation || !this.#paintRequested) return;
12660
- this.#cancelFallback?.();
12661
- this.#cancelFallback = void 0;
12662
- this.#surfaceReady = true;
12663
- this.#emit();
12664
- });
12665
- }
12666
- /**
12667
- * Stops the timers and forgets the content. A later `setContent()` starts
12668
- * again, so a component that remounts can keep using the controller.
12669
- */
12670
- dispose() {
12671
- this.#generation += 1;
12672
- this.#cancelRetryTimer?.();
12673
- this.#cancelRetryTimer = void 0;
12674
- this.#resetHandoff();
12675
- this.#content = void 0;
12676
- this.#operations = [];
12677
- this.#lifecycle = BUILDING;
12678
- this.#retryRevealed = false;
12679
- this.#snapshot = this.#buildSnapshot();
12680
- }
12681
- #updateRetry() {
12682
- const { status, attempt } = this.#lifecycle;
12683
- if (status !== "retrying") {
12684
- this.#cancelRetryTimer?.();
12685
- this.#cancelRetryTimer = void 0;
12686
- this.#retryRevealed = false;
12687
- return;
12688
- }
12689
- if (attempt !== void 0 && attempt >= this.#showAfterAttempts) {
12690
- this.#cancelRetryTimer?.();
12691
- this.#cancelRetryTimer = void 0;
12692
- this.#retryRevealed = true;
12693
- return;
12694
- }
12695
- if (this.#retryRevealed || this.#cancelRetryTimer) return;
12696
- this.#cancelRetryTimer = this.#schedule(() => {
12697
- this.#cancelRetryTimer = void 0;
12698
- this.#retryRevealed = true;
12699
- this.#emit();
12700
- }, this.#showAfterMs);
12701
- }
12702
- #startHandoff() {
12703
- this.#surfaceReady = false;
12704
- this.#paintRequested = false;
12705
- this.#cancelFallback?.();
12706
- this.#cancelFallback = this.#schedule(() => {
12707
- this.#cancelFallback = void 0;
12708
- if (!this.#paintRequested) this.#reportUnpainted();
12709
- this.#surfaceReady = true;
12710
- this.#emit();
12711
- }, A2UI_RECOVERY_DEFAULTS.paintFallbackMs);
12712
- }
12713
- #resetHandoff() {
12714
- this.#cancelFallback?.();
12715
- this.#cancelFallback = void 0;
12716
- this.#surfaceReady = false;
12717
- this.#paintRequested = false;
12718
- }
12719
- #reportUnpainted() {
12720
- const warn = this.#warn;
12721
- if (!warn) return;
12722
- const groups = groupA2UIOperationsBySurface(this.#operations);
12723
- for (const [surfaceId, operations] of groups) {
12724
- const message = diagnoseUnpaintedSurface(surfaceId, operations);
12725
- if (message) warn(message);
12726
- }
12727
- }
12728
- #emit() {
12729
- this.#snapshot = this.#buildSnapshot();
12730
- for (const listener of this.#listeners) listener();
12731
- }
12732
- #buildSnapshot() {
12733
- const lifecycle = this.#lifecycle;
12734
- const debugExposure = resolveA2UIDebugExposure(lifecycle, this.#debugExposureOption);
12735
- const isFailed = lifecycle.status === "failed";
12736
- const hasRetryErrors = lifecycle.status === "retrying" && this.#retryRevealed && (lifecycle.errors?.length ?? 0) > 0;
12737
- let view = "surface";
12738
- if (this.#operations.length === 0) view = "lifecycle";
12739
- else if (!this.#surfaceReady) view = "handoff";
12740
- return {
12741
- view,
12742
- operations: this.#operations,
12743
- lifecycle,
12744
- debugExposure,
12745
- retryRevealed: this.#retryRevealed,
12746
- label: formatA2UIRetryLabel(lifecycle, this.#retryRevealed),
12747
- progressPhase: getA2UIProgressPhase(lifecycle.progressTokens),
12748
- showDebugDetails: debugExposure !== "hidden" && (isFailed || hasRetryErrors),
12749
- debugDetailsOpen: debugExposure === "verbose",
12750
- debugDetailsLabel: isFailed ? A2UI_LIFECYCLE_TEXT.failureDetails : A2UI_LIFECYCLE_TEXT.retryDetails,
12751
- debugPayload: formatA2UIDebugPayload(isFailed ? {
12752
- error: lifecycle.error,
12753
- attempts: lifecycle.attempts
12754
- } : {
12755
- attempt: lifecycle.attempt,
12756
- errors: lifecycle.errors
12757
- })
12758
- };
12759
- }
12760
- };
12761
-
12762
12075
  //#endregion
12763
12076
  //#region src/chat/labels.ts
12764
12077
  /**
@@ -19162,5 +18475,5 @@ function cn(...inputs) {
19162
18475
  }
19163
18476
 
19164
18477
  //#endregion
19165
- export { A2UI_FENCE_LANGUAGE, AgentRegistry, AgentThreadLockedError, ContextStore, CopilotChatDefaultLabels, CopilotKitCore, CopilotKitCoreErrorCode, CopilotKitCoreRuntimeConnectionStatus, CopilotKitHeaderResolutionError, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, GENERATE_SANDBOXED_UI_TOOL_NAME, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTERRUPT_EVENT_NAME, IntelligenceAgent, MEMORY_ERROR_REGISTRY, MemoryError, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, ProxiedCopilotRuntimeAgent, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, TranscriptionError, TranscriptionErrorCode, WebMCPRegistry, 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, A2UIActivityController as ɵA2UIActivityController, A2UI_DEFAULT_SURFACE_ID as ɵA2UI_DEFAULT_SURFACE_ID, A2UI_LIFECYCLE_TEXT as ɵA2UI_LIFECYCLE_TEXT, A2UI_OPERATIONS_KEY as ɵA2UI_OPERATIONS_KEY, A2UI_PAINT_FALLBACK_MS as ɵA2UI_PAINT_FALLBACK_MS, A2UI_RECOVERY_DEFAULTS as ɵA2UI_RECOVERY_DEFAULTS, A2UI_ROOT_COMPONENT_ID as ɵA2UI_ROOT_COMPONENT_ID, A2UI_SKELETON_ROWS as ɵA2UI_SKELETON_ROWS, A2UI_SURFACE_ACTIVITY_TYPE as ɵA2UI_SURFACE_ACTIVITY_TYPE, A2UI_SURFACE_CONTENT_SCHEMA as ɵA2UI_SURFACE_CONTENT_SCHEMA, ɵALL_AGENT_UPDATES, ɵAgentResolver, ɵAttachmentQueue, ɵAudioRecorder, ɵAudioRecorderError, ɵCOMPOSER_DEFAULT_MAX_ROWS, ɵCOPILOTKIT_FEATURES, ɵCOPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ɵCOPILOT_CLOUD_RUNTIME_URL, ɵCOPY_FEEDBACK_RESET_MS, ɵChatConfigurationStore, ɵChatConnection, ɵChatSubmitter, ɵComposerAutosize, ɵComposerController, ɵCopyFeedback, ɵDockedSidebar, ɵDockedSidebarRegistry, ɵExitPresence, ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS, ɵFeedbackCommentController, ɵFreshThreadId, GENERATE_SANDBOXED_UI_ARGS_SCHEMA as ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA, ɵHITL_ABORTED_MESSAGE, ɵHOVER_MENU_CLOSE_DELAY_MS, ɵHoverMenuController, ɵHumanInTheLoopRegistry, ɵINLINE_FEATURE_WARNING_STYLE, ɵInspectorThreadOverride, ɵInterruptController, ɵInterruptExpiredError, ɵInterruptState, ɵKEYBOARD_OPEN_THRESHOLD_PX, ɵLICENSE_BANNER_OFFSET, ɵLICENSE_BANNER_STYLE, ɵLearningAutoStarter, ɵMAX_SOCKET_RETRIES, ɵMESSAGE_FEEDBACK_EVENT_NAME, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH, ɵMOBILE_MAX_WIDTH_QUERY, ɵMessageViewModel, OPEN_GENERATIVE_UI_CONTENT_SCHEMA as ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA, OPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION as ɵOPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION, OPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION as ɵOPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION, OpenGenerativeUIController as ɵOpenGenerativeUIController, PLACEHOLDER_CYCLE_MS as ɵPLACEHOLDER_CYCLE_MS, ɵPOPUP_ANIMATION_MS, ɵPOPUP_DEFAULT_HEIGHT, ɵPOPUP_DEFAULT_WIDTH, PlaceholderCycler as ɵPlaceholderCycler, RENDER_A2UI_TOOL_NAME as ɵRENDER_A2UI_TOOL_NAME, ɵRESIZE_SETTLE_MS, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵReasoningDisclosure, ɵRendererRegistry, ɵRuntimeInfoStore, ɵSCROLL_BOTTOM_THRESHOLD_PX, ɵSIDEBAR_DEFAULT_WIDTH, ɵSIDEBAR_TRANSITION_MS, ɵSTABLE_ARRAY_WARNINGS, ɵStickToBottom, ɵTAB_STOP_SELECTOR, ɵTHREAD_REQUEST_TIMEOUT_MS, TOOL_CALL_STATUS_ICONS as ɵTOOL_CALL_STATUS_ICONS, TOOL_CALL_STATUS_LABEL_KEYS as ɵTOOL_CALL_STATUS_LABEL_KEYS, ɵTRANSCRIPTION_ERROR_TIMEOUT_MS, ɵThreadSelection, ɵThreadSwitchCoordinator, ɵThreadsController, ɵadaptDefaultToolCallRenderProps, addOpenGenerativeUIContexts as ɵaddOpenGenerativeUIContexts, ɵagentUpdateHandlers, ɵappendTranscript, ɵassembleActivityRenderers, ɵassembleHumanInTheLoop, ɵassembleProviderRegistry, ɵassembleProviderToolRenderers, ɵassembleProviderTools, ɵbindDialogFocus, ɵbindPopupDismiss, ɵbindSuggestionsConfig, ɵbuildHumanInTheLoopTool, ɵbuildLearnFromUserActionPayload, buildOpenGenerativeUIContexts as ɵbuildOpenGenerativeUIContexts, ɵbuildToolCallRenderProps, ɵbuildUserMessage, ɵbuildUserMessageContent, ɵcanPreviewDocument, ɵclampSlashIndex, ɵclearAgentInterruptState, ɵclearAgentThreadCursors, cn as ɵcn, ɵcomponentToolDescription, ɵcomposerButtonState, ɵcopilotIconSvgAttributes, ɵcopilotIcons, countFailedToolCalls as ɵcountFailedToolCalls, ɵcreateChatSubmitter, ɵcreateComposerAutosize, ɵcreateDockedSidebar, ɵcreateExitPresence, ɵcreateLastUserMessageTracker, createMemoryStore as ɵcreateMemoryStore, ɵcreateMessageViewModel, ɵcreateObjectUrlFromSource, createOpenGenerativeUITool as ɵcreateOpenGenerativeUITool, ɵcreateStickToBottom, ɵcreateThreadSelectors, createThreadStore as ɵcreateThreadStore, ɵcreateThreadsDrawerActions, ɵcreateWaveformRenderer, ɵdecodeTextSource, ɵdeduplicateMessages, ɵdescribeActivityRendererFailure, ɵdescribeUnrenderedToolCalls, diagnoseMissingSurface as ɵdiagnoseMissingSurface, diagnoseUnpaintedSurface as ɵdiagnoseUnpaintedSurface, diagnoseUnresolvedRoot as ɵdiagnoseUnresolvedRoot, ɵdimensionToCss, ɵdockedSidebarRegistryFor, ɵduplicateMessagesWarning, extractCompleteStyles as ɵextractCompleteStyles, ɵfilterCommands, ɵfindActivityRenderer, ɵfindChatInput, ɵfindToolMessage, ɵfitTextareaHeight, ɵflattenCommandItems, ɵflattenToolsMenuForDisplay, ɵflattenUserMessageContent, formatA2UIDebugPayload as ɵformatA2UIDebugPayload, formatA2UIRetryLabel as ɵformatA2UIRetryLabel, ɵformatCountLabel, ɵformatLabel, formatReasoningDuration as ɵformatReasoningDuration, ɵformatReasoningDurationLabel, formatToolNames as ɵformatToolNames, formatWorkDuration as ɵformatWorkDuration, getA2UIOperationSurfaceId as ɵgetA2UIOperationSurfaceId, getA2UIOperations as ɵgetA2UIOperations, getA2UIProgressPhase as ɵgetA2UIProgressPhase, ɵgetAgentCapabilities, ɵgetAgentInterruptState, ɵgetAgentResolver, getArgumentPreview as ɵgetArgumentPreview, ɵgetBranchNavState, ɵgetChatViewState, ɵgetCustomMessageRenderProps, ɵgetInlineFeatureWarningSpec, ɵgetLastUserMessageId, getLatestTurnKey as ɵgetLatestTurnKey, ɵgetLicenseBannerSpec, ɵgetMessageFeedback, ɵgetMessageFeedbackControls, ɵgetMessageRunStateSnapshot, ɵgetReasoningHeaderLabel, ɵgetThreadsDrawerElementProps, ɵgetToolCallBadge, getToolCallGroupState as ɵgetToolCallGroupState, getToolCallLayouts as ɵgetToolCallLayouts, getToolCallPreview as ɵgetToolCallPreview, getToolCallRendererNames as ɵgetToolCallRendererNames, getToolCallRowStatus as ɵgetToolCallRowStatus, ɵgetToolCallStatus, getToolResults as ɵgetToolResults, getTurnWork as ɵgetTurnWork, ɵgetUserMessageMediaFilename, ɵgetUserMessageMediaParts, getWorkOpenState as ɵgetWorkOpenState, ɵgetWorkSummaryText, groupA2UIOperationsBySurface as ɵgroupA2UIOperationsBySurface, ɵhasAssistantMessageText, ɵhitlRenderProps, ɵimplementsConnect, ɵinitialKeyboardState, ɵinspectorKiteFill, ɵinspectorKiteIcon, ɵinspectorShortcuts, isContentPart as ɵisContentPart, ɵisContentScrolledToBottom, ɵisCopilotKitFeature, ɵisFocusVisible, ɵisHttpAgent, ɵisLearningFeedbackEnabled, ɵisMobileViewport, isOpenGenerativeUIActive as ɵisOpenGenerativeUIActive, ɵisOwnFeedbackThumb, isRetryableStatus as ɵisRetryableMemoryStatus, ɵisScrolledToBottom, isTurnWorkOpen as ɵisTurnWorkOpen, isTurnWorking as ɵisTurnWorking, ɵjoinPhoenixChannel$, loadWebsandbox as ɵloadWebsandbox, ɵmapMemoryMetadataEvent, ɵmatchActivityRenderer, ɵmeasureTextarea, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵmessagesFingerprint, ɵmorphViewTransition, ɵnextSlashIndex, ɵnextTabStop, ɵnormalizeAutoScroll, ɵnormalizeToolCallStatus, ɵnormalizeToolsMenu, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵparseSlashQuery, ɵparseToolCallArguments, ɵphoenixChannel$, ɵphoenixSocket$, ɵpinMessageToTop, pluralize as ɵpluralize, processPartialHtml as ɵprocessPartialHtml, ɵprojectThread, ɵpublicKeyHeaderDefaults, readA2UILifecycle as ɵreadA2UILifecycle, ɵreadKeyboardState, ɵrecordAnnotation, recordWorkTime as ɵrecordWorkTime, ɵregisterFrontendTools, ɵreportProviderConfigDiagnostics, ɵreserveLicenseBannerOffset, ɵresetAgentThreadBaseline, ɵresetMessageFeedbackCache, ɵresolveA2UIActivation, resolveA2UIDebugExposure as ɵresolveA2UIDebugExposure, ɵresolveActivityRenderer, ɵresolveAgentId, ɵresolveAgentThreadId, ɵresolveChatNotice, ɵresolveComposerKey, ɵresolveCustomMessageRenderContext, ɵresolveCustomMessageRenderers, ɵresolveLicenseState, ɵresolveProviderConfig, ɵresolveSlashKey, ɵresolveThreadsLicense, ɵresolveToolCallAgentId, ɵresolveToolCallRenderer, ɵrmsAmplitude, runA2UIAction as ɵrunA2UIAction, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵserializeContextValue, ɵsetMessageFeedback, shallowEqualRecord as ɵshallowEqualRecord, ɵshouldShowAssistantToolbar, ɵshouldShowMessageCursor, ɵshowsComposerDisclaimer, ɵsnapshotAgentState, ɵstableArrayPropWarning, ɵstopAgentWithFallback, stringifyToolCallAttr as ɵstringifyToolCallAttr, stringifyToolCallPayload as ɵstringifyToolCallPayload, ɵsubscribeToAgentErrors, ɵsubscribeToAgentSuggestions, ɵsubscribeToAgentUpdates, ɵsubscribeToLearningFeedbackEnabled, ɵsubscribeToMessageFeedback, surfaceHasRenderableContent as ɵsurfaceHasRenderableContent, ɵsyncRecorderToMode, ɵthreadAdapterEvents, toA2UIClientEvent as ɵtoA2UIClientEvent, ɵtoDefaultToolCallStatus, ɵtoDrawerThread, ɵtoLearningConfig, toolCallAppearance as ɵtoolCallAppearance, ɵtoolRendererShapeChanged, ɵtranscribeAudio, ɵtranscriptionErrorMessageKey, ɵtranscriptionErrorNotice, ɵvalidateAgentBinding, ɵwaitForActiveRun, ɵwatchElementHeight, ɵwatchElementWidth, ɵwatchKeyboardState, ɵwatchMobileViewport, ɵwithHeaderDefaults };
18478
+ export { A2UI_FENCE_LANGUAGE, AgentRegistry, AgentThreadLockedError, ContextStore, CopilotChatDefaultLabels, CopilotKitCore, CopilotKitCoreErrorCode, CopilotKitCoreRuntimeConnectionStatus, CopilotKitHeaderResolutionError, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, GENERATE_SANDBOXED_UI_TOOL_NAME, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTERRUPT_EVENT_NAME, IntelligenceAgent, MEMORY_ERROR_REGISTRY, MemoryError, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, ProxiedCopilotRuntimeAgent, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, TranscriptionError, TranscriptionErrorCode, WebMCPRegistry, 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, ɵALL_AGENT_UPDATES, ɵAgentResolver, ɵAttachmentQueue, ɵAudioRecorder, ɵAudioRecorderError, ɵCOMPOSER_DEFAULT_MAX_ROWS, ɵCOPILOTKIT_FEATURES, ɵCOPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ɵCOPILOT_CLOUD_RUNTIME_URL, ɵCOPY_FEEDBACK_RESET_MS, ɵChatConfigurationStore, ɵChatConnection, ɵChatSubmitter, ɵComposerAutosize, ɵComposerController, ɵCopyFeedback, ɵDockedSidebar, ɵDockedSidebarRegistry, ɵExitPresence, ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS, ɵFeedbackCommentController, ɵFreshThreadId, GENERATE_SANDBOXED_UI_ARGS_SCHEMA as ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA, ɵHITL_ABORTED_MESSAGE, ɵHOVER_MENU_CLOSE_DELAY_MS, ɵHoverMenuController, ɵHumanInTheLoopRegistry, ɵINLINE_FEATURE_WARNING_STYLE, ɵInspectorThreadOverride, ɵInterruptController, ɵInterruptExpiredError, ɵInterruptState, ɵKEYBOARD_OPEN_THRESHOLD_PX, ɵLICENSE_BANNER_OFFSET, ɵLICENSE_BANNER_STYLE, ɵLearningAutoStarter, ɵMAX_SOCKET_RETRIES, ɵMESSAGE_FEEDBACK_EVENT_NAME, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH, ɵMOBILE_MAX_WIDTH_QUERY, ɵMessageViewModel, OPEN_GENERATIVE_UI_CONTENT_SCHEMA as ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA, OPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION as ɵOPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION, OPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION as ɵOPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION, OpenGenerativeUIController as ɵOpenGenerativeUIController, PLACEHOLDER_CYCLE_MS as ɵPLACEHOLDER_CYCLE_MS, ɵPOPUP_ANIMATION_MS, ɵPOPUP_DEFAULT_HEIGHT, ɵPOPUP_DEFAULT_WIDTH, PlaceholderCycler as ɵPlaceholderCycler, ɵRESIZE_SETTLE_MS, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵReasoningDisclosure, ɵRendererRegistry, ɵRuntimeInfoStore, ɵSCROLL_BOTTOM_THRESHOLD_PX, ɵSIDEBAR_DEFAULT_WIDTH, ɵSIDEBAR_TRANSITION_MS, ɵSTABLE_ARRAY_WARNINGS, ɵStickToBottom, ɵTAB_STOP_SELECTOR, ɵTHREAD_REQUEST_TIMEOUT_MS, TOOL_CALL_STATUS_ICONS as ɵTOOL_CALL_STATUS_ICONS, TOOL_CALL_STATUS_LABEL_KEYS as ɵTOOL_CALL_STATUS_LABEL_KEYS, ɵTRANSCRIPTION_ERROR_TIMEOUT_MS, ɵThreadSelection, ɵThreadSwitchCoordinator, ɵThreadsController, ɵadaptDefaultToolCallRenderProps, addOpenGenerativeUIContexts as ɵaddOpenGenerativeUIContexts, ɵagentUpdateHandlers, ɵappendTranscript, ɵassembleActivityRenderers, ɵassembleHumanInTheLoop, ɵassembleProviderRegistry, ɵassembleProviderToolRenderers, ɵassembleProviderTools, ɵbindDialogFocus, ɵbindPopupDismiss, ɵbindSuggestionsConfig, ɵbuildHumanInTheLoopTool, ɵbuildLearnFromUserActionPayload, buildOpenGenerativeUIContexts as ɵbuildOpenGenerativeUIContexts, ɵbuildToolCallRenderProps, ɵbuildUserMessage, ɵbuildUserMessageContent, ɵcanPreviewDocument, ɵclampSlashIndex, ɵclearAgentInterruptState, ɵclearAgentThreadCursors, cn as ɵcn, ɵcomponentToolDescription, ɵcomposerButtonState, ɵcopilotIconSvgAttributes, ɵcopilotIcons, countFailedToolCalls as ɵcountFailedToolCalls, ɵcreateChatSubmitter, ɵcreateComposerAutosize, ɵcreateDockedSidebar, ɵcreateExitPresence, ɵcreateLastUserMessageTracker, createMemoryStore as ɵcreateMemoryStore, ɵcreateMessageViewModel, ɵcreateObjectUrlFromSource, createOpenGenerativeUITool as ɵcreateOpenGenerativeUITool, ɵcreateStickToBottom, ɵcreateThreadSelectors, createThreadStore as ɵcreateThreadStore, ɵcreateThreadsDrawerActions, ɵcreateWaveformRenderer, ɵdecodeTextSource, ɵdeduplicateMessages, ɵdescribeActivityRendererFailure, ɵdescribeUnrenderedToolCalls, ɵdimensionToCss, ɵdockedSidebarRegistryFor, ɵduplicateMessagesWarning, extractCompleteStyles as ɵextractCompleteStyles, ɵfilterCommands, ɵfindActivityRenderer, ɵfindChatInput, ɵfindToolMessage, ɵfitTextareaHeight, ɵflattenCommandItems, ɵflattenToolsMenuForDisplay, ɵflattenUserMessageContent, ɵformatCountLabel, ɵformatLabel, formatReasoningDuration as ɵformatReasoningDuration, ɵformatReasoningDurationLabel, formatToolNames as ɵformatToolNames, formatWorkDuration as ɵformatWorkDuration, ɵgetAgentCapabilities, ɵgetAgentInterruptState, ɵgetAgentResolver, getArgumentPreview as ɵgetArgumentPreview, ɵgetBranchNavState, ɵgetChatViewState, ɵgetCustomMessageRenderProps, ɵgetInlineFeatureWarningSpec, ɵgetLastUserMessageId, getLatestTurnKey as ɵgetLatestTurnKey, ɵgetLicenseBannerSpec, ɵgetMessageFeedback, ɵgetMessageFeedbackControls, ɵgetMessageRunStateSnapshot, ɵgetReasoningHeaderLabel, ɵgetThreadsDrawerElementProps, ɵgetToolCallBadge, getToolCallGroupState as ɵgetToolCallGroupState, getToolCallLayouts as ɵgetToolCallLayouts, getToolCallPreview as ɵgetToolCallPreview, getToolCallRendererNames as ɵgetToolCallRendererNames, getToolCallRowStatus as ɵgetToolCallRowStatus, ɵgetToolCallStatus, getToolResults as ɵgetToolResults, getTurnWork as ɵgetTurnWork, ɵgetUserMessageMediaFilename, ɵgetUserMessageMediaParts, getWorkOpenState as ɵgetWorkOpenState, ɵgetWorkSummaryText, ɵhasAssistantMessageText, ɵhitlRenderProps, ɵimplementsConnect, ɵinitialKeyboardState, ɵinspectorKiteFill, ɵinspectorKiteIcon, ɵinspectorShortcuts, isContentPart as ɵisContentPart, ɵisContentScrolledToBottom, ɵisCopilotKitFeature, ɵisFocusVisible, ɵisHttpAgent, ɵisLearningFeedbackEnabled, ɵisMobileViewport, isOpenGenerativeUIActive as ɵisOpenGenerativeUIActive, ɵisOwnFeedbackThumb, isRetryableStatus as ɵisRetryableMemoryStatus, ɵisScrolledToBottom, isTurnWorkOpen as ɵisTurnWorkOpen, isTurnWorking as ɵisTurnWorking, ɵjoinPhoenixChannel$, loadWebsandbox as ɵloadWebsandbox, ɵmapMemoryMetadataEvent, ɵmatchActivityRenderer, ɵmeasureTextarea, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵmessagesFingerprint, ɵmorphViewTransition, ɵnextSlashIndex, ɵnextTabStop, ɵnormalizeAutoScroll, ɵnormalizeToolCallStatus, ɵnormalizeToolsMenu, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵparseSlashQuery, ɵparseToolCallArguments, ɵphoenixChannel$, ɵphoenixSocket$, ɵpinMessageToTop, pluralize as ɵpluralize, processPartialHtml as ɵprocessPartialHtml, ɵprojectThread, ɵpublicKeyHeaderDefaults, ɵreadKeyboardState, ɵrecordAnnotation, recordWorkTime as ɵrecordWorkTime, ɵregisterFrontendTools, ɵreportProviderConfigDiagnostics, ɵreserveLicenseBannerOffset, ɵresetAgentThreadBaseline, ɵresetMessageFeedbackCache, ɵresolveActivityRenderer, ɵresolveAgentId, ɵresolveAgentThreadId, ɵresolveChatNotice, ɵresolveComposerKey, ɵresolveCustomMessageRenderContext, ɵresolveCustomMessageRenderers, ɵresolveGenerativeUIDefault, ɵresolveLicenseState, ɵresolveProviderConfig, ɵresolveSlashKey, ɵresolveThreadsLicense, ɵresolveToolCallAgentId, ɵresolveToolCallRenderer, ɵrmsAmplitude, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵserializeContextValue, ɵsetMessageFeedback, shallowEqualRecord as ɵshallowEqualRecord, ɵshouldShowAssistantToolbar, ɵshouldShowMessageCursor, ɵshowsComposerDisclaimer, ɵsnapshotAgentState, ɵstableArrayPropWarning, ɵstopAgentWithFallback, stringifyToolCallAttr as ɵstringifyToolCallAttr, stringifyToolCallPayload as ɵstringifyToolCallPayload, ɵsubscribeToAgentErrors, ɵsubscribeToAgentSuggestions, ɵsubscribeToAgentUpdates, ɵsubscribeToLearningFeedbackEnabled, ɵsubscribeToMessageFeedback, ɵsyncRecorderToMode, ɵthreadAdapterEvents, ɵtoDefaultToolCallStatus, ɵtoDrawerThread, ɵtoLearningConfig, toolCallAppearance as ɵtoolCallAppearance, ɵtoolRendererShapeChanged, ɵtranscribeAudio, ɵtranscriptionErrorMessageKey, ɵtranscriptionErrorNotice, ɵvalidateAgentBinding, ɵwaitForActiveRun, ɵwatchElementHeight, ɵwatchElementWidth, ɵwatchKeyboardState, ɵwatchMobileViewport, ɵwithHeaderDefaults };
19166
18479
  //# sourceMappingURL=index.mjs.map