@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.umd.js CHANGED
@@ -2245,8 +2245,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2245
2245
  _defineProperty(this, "inspectorMetadataCredentialsGeneration", 0);
2246
2246
  _defineProperty(this, "inspectorMetadataAbortController", void 0);
2247
2247
  _defineProperty(this, "inspectorMetadataNotificationQueue", Promise.resolve());
2248
- _defineProperty(this, "_a2uiEnabled", false);
2249
- _defineProperty(this, "_a2uiAgents", void 0);
2248
+ _defineProperty(this, "_generativeUIEnabled", false);
2249
+ _defineProperty(this, "_generativeUIAgents", void 0);
2250
2250
  _defineProperty(this, "_openGenerativeUIEnabled", false);
2251
2251
  _defineProperty(this, "_licenseStatus", void 0);
2252
2252
  _defineProperty(this, "_runtimeEntitlements", void 0);
@@ -2301,15 +2301,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2301
2301
  get inspectorMetadata() {
2302
2302
  return this._inspectorMetadata;
2303
2303
  }
2304
- get a2uiEnabled() {
2305
- return this._a2uiEnabled;
2304
+ /** Whether the runtime turns generative UI (A2UI 1.0) on. */
2305
+ get generativeUIEnabled() {
2306
+ return this._generativeUIEnabled;
2306
2307
  }
2307
2308
  /**
2308
- * Agent ids the runtime applies A2UI to (#5369). `undefined` means A2UI
2309
- * applies to every agent — or is disabled entirely; check `a2uiEnabled`.
2309
+ * Agent ids the runtime limits generative UI to. `undefined` means every
2310
+ * agent, or off; check `generativeUIEnabled`.
2310
2311
  */
2311
- get a2uiAgents() {
2312
- return this._a2uiAgents;
2312
+ get generativeUIAgents() {
2313
+ return this._generativeUIAgents;
2313
2314
  }
2314
2315
  get openGenerativeUIEnabled() {
2315
2316
  return this._openGenerativeUIEnabled;
@@ -3084,8 +3085,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3084
3085
  this._singleRouteResourceOperations = false;
3085
3086
  this._suggestions = void 0;
3086
3087
  this._inspectorLearning = false;
3087
- this._a2uiEnabled = false;
3088
- this._a2uiAgents = void 0;
3088
+ this._generativeUIEnabled = false;
3089
+ this._generativeUIAgents = void 0;
3089
3090
  this._openGenerativeUIEnabled = false;
3090
3091
  this._licenseStatus = void 0;
3091
3092
  this._runtimeEntitlements = void 0;
@@ -3102,7 +3103,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3102
3103
  await this.notifyRuntimeStatusChanged(CopilotKitCoreRuntimeConnectionStatus.Connecting);
3103
3104
  if (!this.isCurrentRuntimeConnection(attempt)) return;
3104
3105
  try {
3105
- var _runtimeInfoResponse$2, _runtimeInfoResponse$3, _runtimeInfoResponse$4, _runtimeInfoResponse$5, _ref2, _a2uiInfo$enabled, _runtimeInfoResponse$6, _runtimeInfoResponse$7;
3106
+ var _runtimeInfoResponse$2, _runtimeInfoResponse$3, _runtimeInfoResponse$4, _runtimeInfoResponse$5, _generativeUIInfo$ena, _runtimeInfoResponse$6, _runtimeInfoResponse$7;
3106
3107
  if (inspectorMetadataConnectionGeneration !== this.inspectorMetadataConnectionGeneration) return;
3107
3108
  const { runtimeInfo: runtimeInfoResponse, resolvedTransport } = (options === null || options === void 0 ? void 0 : options.recovery) ? await this.fetchRuntimeInfoWithTimeout(new AbortController(), runtimeUrl, transport) : await this.fetchRuntimeInfo(runtimeUrl, transport);
3108
3109
  if (!this.isCurrentRuntimeConnection(attempt) || inspectorMetadataConnectionGeneration !== this.inspectorMetadataConnectionGeneration) return;
@@ -3165,9 +3166,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3165
3166
  this._inspectorMetadataSupported = runtimeInfoResponse.inspectorMetadata === true;
3166
3167
  this.inspectorMetadataRefreshReady = false;
3167
3168
  if (!this._inspectorMetadataSupported) this.setInspectorMetadata(void 0);
3168
- const a2uiInfo = runtimeInfoResponse.a2ui;
3169
- this._a2uiEnabled = (_ref2 = (_a2uiInfo$enabled = a2uiInfo === null || a2uiInfo === void 0 ? void 0 : a2uiInfo.enabled) !== null && _a2uiInfo$enabled !== void 0 ? _a2uiInfo$enabled : runtimeInfoResponse.a2uiEnabled) !== null && _ref2 !== void 0 ? _ref2 : false;
3170
- this._a2uiAgents = (a2uiInfo === null || a2uiInfo === void 0 ? void 0 : a2uiInfo.enabled) ? a2uiInfo.agents : void 0;
3169
+ const generativeUIInfo = runtimeInfoResponse.generativeUI;
3170
+ this._generativeUIEnabled = (_generativeUIInfo$ena = generativeUIInfo === null || generativeUIInfo === void 0 ? void 0 : generativeUIInfo.enabled) !== null && _generativeUIInfo$ena !== void 0 ? _generativeUIInfo$ena : false;
3171
+ this._generativeUIAgents = (generativeUIInfo === null || generativeUIInfo === void 0 ? void 0 : generativeUIInfo.enabled) ? generativeUIInfo.agents : void 0;
3171
3172
  this._openGenerativeUIEnabled = (_runtimeInfoResponse$6 = runtimeInfoResponse.openGenerativeUIEnabled) !== null && _runtimeInfoResponse$6 !== void 0 ? _runtimeInfoResponse$6 : false;
3172
3173
  this._licenseStatus = runtimeInfoResponse.licenseStatus;
3173
3174
  this._runtimeEntitlements = runtimeInfoResponse.runtimeEntitlements;
@@ -3198,8 +3199,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3198
3199
  this._singleRouteResourceOperations = false;
3199
3200
  this._suggestions = void 0;
3200
3201
  this._inspectorLearning = false;
3201
- this._a2uiEnabled = false;
3202
- this._a2uiAgents = void 0;
3202
+ this._generativeUIEnabled = false;
3203
+ this._generativeUIAgents = void 0;
3203
3204
  this._openGenerativeUIEnabled = false;
3204
3205
  if (!boundedEntitlementRetryFailed) {
3205
3206
  this._licenseStatus = void 0;
@@ -4062,8 +4063,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4062
4063
  }
4063
4064
  /** Reject ambiguous assistant definitions before executing or answering a call. */
4064
4065
  validateToolCalls(messages) {
4065
- var _classPrivateFieldGet2$13;
4066
- if (((_classPrivateFieldGet2$13 = _classPrivateFieldGet2(_pending, this)) === null || _classPrivateFieldGet2$13 === void 0 ? void 0 : _classPrivateFieldGet2$13.kind) !== "standard") return;
4066
+ var _classPrivateFieldGet2$12;
4067
+ if (((_classPrivateFieldGet2$12 = _classPrivateFieldGet2(_pending, this)) === null || _classPrivateFieldGet2$12 === void 0 ? void 0 : _classPrivateFieldGet2$12.kind) !== "standard") return;
4067
4068
  const pendingCalls = new Set(_classPrivateFieldGet2(_pending, this).interrupts.filter((interrupt) => interrupt.reason === "tool_call").map((interrupt) => interrupt.toolCallId));
4068
4069
  const seen = /* @__PURE__ */ new Set();
4069
4070
  for (const message of messages) {
@@ -8076,9 +8077,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
8076
8077
  //#region src/core/runtime-info.ts
8077
8078
  const RUNTIME_INFO_KEYS = [
8078
8079
  "status",
8079
- "a2uiEnabled",
8080
- "a2uiAgents",
8081
8080
  "openGenerativeUIEnabled",
8081
+ "generativeUIEnabled",
8082
+ "generativeUIAgents",
8082
8083
  "licenseStatus",
8083
8084
  "runtimeEntitlements",
8084
8085
  "runtimeEntitlementRetryPending",
@@ -8256,8 +8257,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
8256
8257
  this.learningBridge = new LearningBridge(this, learning, () => this.notifyTrajectoryChanged());
8257
8258
  this.runtimeInfoStore = new ɵRuntimeInfoStore(() => ({
8258
8259
  status: this.runtimeConnectionStatus,
8259
- a2uiEnabled: this.a2uiEnabled,
8260
- a2uiAgents: this.a2uiAgents,
8260
+ generativeUIEnabled: this.generativeUIEnabled,
8261
+ generativeUIAgents: this.generativeUIAgents,
8261
8262
  openGenerativeUIEnabled: this.openGenerativeUIEnabled,
8262
8263
  licenseStatus: this.licenseStatus,
8263
8264
  runtimeEntitlements: this.runtimeEntitlements,
@@ -8547,15 +8548,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
8547
8548
  async refreshInspectorMetadata() {
8548
8549
  await this.agentRegistry.refreshInspectorMetadata();
8549
8550
  }
8550
- get a2uiEnabled() {
8551
- return this.agentRegistry.a2uiEnabled;
8551
+ /** Whether the runtime turns generative UI (A2UI 1.0) on. */
8552
+ get generativeUIEnabled() {
8553
+ return this.agentRegistry.generativeUIEnabled;
8552
8554
  }
8553
8555
  /**
8554
- * Agent ids the runtime applies A2UI to. `undefined` means A2UI applies to
8555
- * every agent (or is disabled — check `a2uiEnabled`).
8556
+ * Agent ids the runtime limits generative UI to. `undefined` means every
8557
+ * agent (or off; check `generativeUIEnabled`).
8556
8558
  */
8557
- get a2uiAgents() {
8558
- return this.agentRegistry.a2uiAgents;
8559
+ get generativeUIAgents() {
8560
+ return this.agentRegistry.generativeUIAgents;
8559
8561
  }
8560
8562
  get openGenerativeUIEnabled() {
8561
8563
  return this.agentRegistry.openGenerativeUIEnabled;
@@ -9479,8 +9481,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9479
9481
  * mirrored update before the bridge consumes its suppression.
9480
9482
  */
9481
9483
  start() {
9482
- var _classPrivateFieldGet2$12;
9483
- (_classPrivateFieldGet2$12 = _classPrivateFieldGet2(_provisionalSubscription, this)) === null || _classPrivateFieldGet2$12 === void 0 || _classPrivateFieldGet2$12.unsubscribe();
9484
+ var _classPrivateFieldGet2$11;
9485
+ (_classPrivateFieldGet2$11 = _classPrivateFieldGet2(_provisionalSubscription, this)) === null || _classPrivateFieldGet2$11 === void 0 || _classPrivateFieldGet2$11.unsubscribe();
9484
9486
  _classPrivateFieldSet2(_provisionalSubscription, this, this.provisional.subscribe(_assertClassBrand(_AgentHandoffBridge_brand, this, _subscriber).call(this, this.provisional, () => _classPrivateFieldGet2(_registered, this), "provisional", "registered")));
9485
9487
  }
9486
9488
  /** Attach the agent published by runtime discovery and sync it. */
@@ -9559,7 +9561,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9559
9561
  var _provisional = /* @__PURE__ */ new WeakMap();
9560
9562
  var _bridges = /* @__PURE__ */ new WeakMap();
9561
9563
  var _proxies = /* @__PURE__ */ new WeakMap();
9562
- var _listeners$11 = /* @__PURE__ */ new WeakMap();
9564
+ var _listeners$10 = /* @__PURE__ */ new WeakMap();
9563
9565
  var _revision = /* @__PURE__ */ new WeakMap();
9564
9566
  var _ɵAgentResolver_brand = /* @__PURE__ */ new WeakSet();
9565
9567
  /**
@@ -9588,7 +9590,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9588
9590
  _classPrivateFieldInitSpec(this, _provisional, /* @__PURE__ */ new Map());
9589
9591
  _classPrivateFieldInitSpec(this, _bridges, /* @__PURE__ */ new Set());
9590
9592
  _classPrivateFieldInitSpec(this, _proxies, /* @__PURE__ */ new Map());
9591
- _classPrivateFieldInitSpec(this, _listeners$11, /* @__PURE__ */ new Set());
9593
+ _classPrivateFieldInitSpec(this, _listeners$10, /* @__PURE__ */ new Set());
9592
9594
  _classPrivateFieldInitSpec(this, _revision, 0);
9593
9595
  _defineProperty(
9594
9596
  this,
@@ -9601,9 +9603,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9601
9603
  /** Listen for proxy registration changes. Returns unsubscribe. */
9602
9604
  "subscribe",
9603
9605
  (listener) => {
9604
- _classPrivateFieldGet2(_listeners$11, this).add(listener);
9606
+ _classPrivateFieldGet2(_listeners$10, this).add(listener);
9605
9607
  return () => {
9606
- _classPrivateFieldGet2(_listeners$11, this).delete(listener);
9608
+ _classPrivateFieldGet2(_listeners$10, this).delete(listener);
9607
9609
  };
9608
9610
  }
9609
9611
  );
@@ -9683,7 +9685,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9683
9685
  _classPrivateFieldGet2(_bridges, this).clear();
9684
9686
  _classPrivateFieldGet2(_provisional, this).clear();
9685
9687
  _classPrivateFieldGet2(_proxies, this).clear();
9686
- _classPrivateFieldGet2(_listeners$11, this).clear();
9688
+ _classPrivateFieldGet2(_listeners$10, this).clear();
9687
9689
  }
9688
9690
  };
9689
9691
  function _provisionalAgent(agentId, runtimeAgentId) {
@@ -9722,7 +9724,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9722
9724
  function _notify() {
9723
9725
  var _this$revision;
9724
9726
  _classPrivateFieldSet2(_revision, this, (_this$revision = _classPrivateFieldGet2(_revision, this), _this$revision++, _this$revision));
9725
- const listeners = [..._classPrivateFieldGet2(_listeners$11, this)];
9727
+ const listeners = [..._classPrivateFieldGet2(_listeners$10, this)];
9726
9728
  for (const listener of listeners) listener();
9727
9729
  }
9728
9730
  const resolvers = /* @__PURE__ */ new WeakMap();
@@ -9894,7 +9896,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9894
9896
  * Tool-call renderers come from three places. Prop renderers are the list the
9895
9897
  * provider was given (`setPropToolCalls`). Hook renderers are added one at a
9896
9898
  * time (`addHookToolCall`), for example by `useRenderTool`. Built-in
9897
- * renderers are added by CopilotKit features such as A2UI
9899
+ * renderers are added by CopilotKit features such as generative UI
9898
9900
  * (`addBuiltInToolCall`). Each renderer has a key made of its `agentId` and
9899
9901
  * `name`. A hook renderer replaces a prop renderer with the same key, and a
9900
9902
  * later hook renderer replaces an earlier one with the same key, so the
@@ -10025,7 +10027,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10025
10027
  }
10026
10028
  /**
10027
10029
  * Add a built-in renderer, for a tool that a CopilotKit feature owns (for
10028
- * example the A2UI render tool). Prop and hook renderers with the same
10030
+ * example the generative UI render tool). Prop and hook renderers with the same
10029
10031
  * `agentId` and `name` win over it, and setting the prop renderers never
10030
10032
  * removes it.
10031
10033
  *
@@ -10036,7 +10038,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10036
10038
  *
10037
10039
  * @example
10038
10040
  * ```ts
10039
- * const remove = registry.addBuiltInToolCall({ name: "render_a2ui", render: Nothing });
10041
+ * const remove = registry.addBuiltInToolCall({ name: "render_ui", render: Nothing });
10040
10042
  * // when the feature turns off
10041
10043
  * remove();
10042
10044
  * ```
@@ -10128,13 +10130,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10128
10130
  var _runner = /* @__PURE__ */ new WeakMap();
10129
10131
  var _options$1 = /* @__PURE__ */ new WeakMap();
10130
10132
  var _name = /* @__PURE__ */ new WeakMap();
10131
- var _listeners$10 = /* @__PURE__ */ new WeakMap();
10132
- var _snapshot$5 = /* @__PURE__ */ new WeakMap();
10133
+ var _listeners$9 = /* @__PURE__ */ new WeakMap();
10134
+ var _snapshot$4 = /* @__PURE__ */ new WeakMap();
10133
10135
  var _state$5 = /* @__PURE__ */ new WeakMap();
10134
10136
  var _agent = /* @__PURE__ */ new WeakMap();
10135
10137
  var _unsubscribe = /* @__PURE__ */ new WeakMap();
10136
10138
  var _threadId = /* @__PURE__ */ new WeakMap();
10137
- var _generation$1 = /* @__PURE__ */ new WeakMap();
10139
+ var _generation = /* @__PURE__ */ new WeakMap();
10138
10140
  var _resumePromise = /* @__PURE__ */ new WeakMap();
10139
10141
  var _ɵInterruptController_brand = /* @__PURE__ */ new WeakSet();
10140
10142
  /**
@@ -10155,28 +10157,28 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10155
10157
  _classPrivateFieldInitSpec(this, _runner, void 0);
10156
10158
  _classPrivateFieldInitSpec(this, _options$1, void 0);
10157
10159
  _classPrivateFieldInitSpec(this, _name, void 0);
10158
- _classPrivateFieldInitSpec(this, _listeners$10, /* @__PURE__ */ new Set());
10159
- _classPrivateFieldInitSpec(this, _snapshot$5, EMPTY_SNAPSHOT);
10160
+ _classPrivateFieldInitSpec(this, _listeners$9, /* @__PURE__ */ new Set());
10161
+ _classPrivateFieldInitSpec(this, _snapshot$4, EMPTY_SNAPSHOT);
10160
10162
  _classPrivateFieldInitSpec(this, _state$5, new ɵInterruptState());
10161
10163
  _classPrivateFieldInitSpec(this, _agent, void 0);
10162
10164
  _classPrivateFieldInitSpec(this, _unsubscribe, void 0);
10163
10165
  _classPrivateFieldInitSpec(this, _threadId, void 0);
10164
- _classPrivateFieldInitSpec(this, _generation$1, 0);
10166
+ _classPrivateFieldInitSpec(this, _generation, 0);
10165
10167
  _classPrivateFieldInitSpec(this, _resumePromise, void 0);
10166
10168
  _defineProperty(
10167
10169
  this,
10168
10170
  /** Return the current state. Same object until something changes. */
10169
10171
  "getSnapshot",
10170
- () => _classPrivateFieldGet2(_snapshot$5, this)
10172
+ () => _classPrivateFieldGet2(_snapshot$4, this)
10171
10173
  );
10172
10174
  _defineProperty(
10173
10175
  this,
10174
10176
  /** Call `listener` after every snapshot change. Returns the unsubscribe function. */
10175
10177
  "subscribe",
10176
10178
  (listener) => {
10177
- _classPrivateFieldGet2(_listeners$10, this).add(listener);
10179
+ _classPrivateFieldGet2(_listeners$9, this).add(listener);
10178
10180
  return () => {
10179
- _classPrivateFieldGet2(_listeners$10, this).delete(listener);
10181
+ _classPrivateFieldGet2(_listeners$9, this).delete(listener);
10180
10182
  };
10181
10183
  }
10182
10184
  );
@@ -10221,9 +10223,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10221
10223
  * already holds (for example after a reload) becomes pending at once.
10222
10224
  */
10223
10225
  connect(agent) {
10224
- var _classPrivateFieldGet2$11, _agent$pendingInterru2;
10226
+ var _classPrivateFieldGet2$10, _agent$pendingInterru2;
10225
10227
  if (agent === _classPrivateFieldGet2(_agent, this)) return;
10226
- (_classPrivateFieldGet2$11 = _classPrivateFieldGet2(_unsubscribe, this)) === null || _classPrivateFieldGet2$11 === void 0 || _classPrivateFieldGet2$11.call(this);
10228
+ (_classPrivateFieldGet2$10 = _classPrivateFieldGet2(_unsubscribe, this)) === null || _classPrivateFieldGet2$10 === void 0 || _classPrivateFieldGet2$10.call(this);
10227
10229
  _classPrivateFieldSet2(_agent, this, agent);
10228
10230
  _classPrivateFieldSet2(_threadId, this, agent.threadId);
10229
10231
  _assertClassBrand(_ɵInterruptController_brand, this, _clear).call(this);
@@ -10298,12 +10300,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10298
10300
  /** Disconnect and drop all listeners. */
10299
10301
  dispose() {
10300
10302
  this.disconnect();
10301
- _classPrivateFieldGet2(_listeners$10, this).clear();
10303
+ _classPrivateFieldGet2(_listeners$9, this).clear();
10302
10304
  }
10303
10305
  };
10304
10306
  /** Return the accepted interrupt of the current thread, or `undefined`. */
10305
10307
  function _target() {
10306
- const { pending, accepted } = _classPrivateFieldGet2(_snapshot$5, this);
10308
+ const { pending, accepted } = _classPrivateFieldGet2(_snapshot$4, this);
10307
10309
  const agent = _classPrivateFieldGet2(_agent, this);
10308
10310
  if (!pending || !accepted || !agent) return void 0;
10309
10311
  if (_classPrivateFieldGet2(_threadId, this) !== agent.threadId) {
@@ -10354,7 +10356,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10354
10356
  }
10355
10357
  /** Start the resume run once and clear pending state if it fails. */
10356
10358
  function _startResume(agent, params) {
10357
- const pending = _classPrivateFieldGet2(_snapshot$5, this).pending;
10359
+ const pending = _classPrivateFieldGet2(_snapshot$4, this).pending;
10358
10360
  let run;
10359
10361
  try {
10360
10362
  run = Promise.resolve(_classPrivateFieldGet2(_runner, this).runAgent({
@@ -10366,18 +10368,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10366
10368
  return Promise.reject(error);
10367
10369
  }
10368
10370
  const tracked = run.catch((error) => {
10369
- const stillCurrent = _classPrivateFieldGet2(_snapshot$5, this).pending === pending;
10371
+ const stillCurrent = _classPrivateFieldGet2(_snapshot$4, this).pending === pending;
10370
10372
  console.error(stillCurrent ? `[CopilotKit] ${_classPrivateFieldGet2(_name, this)} resolve: runAgent rejected; clearing pending + rethrowing` : `[CopilotKit] ${_classPrivateFieldGet2(_name, this)}: a stale resume failed after the interrupt was replaced`, error);
10371
10373
  if (stillCurrent) _assertClassBrand(_ɵInterruptController_brand, this, _clear).call(this, error);
10372
10374
  throw error;
10373
10375
  });
10374
- if (_classPrivateFieldGet2(_snapshot$5, this).pending === pending) _classPrivateFieldSet2(_resumePromise, this, tracked);
10376
+ if (_classPrivateFieldGet2(_snapshot$4, this).pending === pending) _classPrivateFieldSet2(_resumePromise, this, tracked);
10375
10377
  return tracked;
10376
10378
  }
10377
10379
  /** Adopt the shared batch, then run `enabled` and `handler` for it. */
10378
10380
  function _setPending(next) {
10379
- _classPrivateFieldSet2(_generation$1, this, _classPrivateFieldGet2(_generation$1, this) + 1);
10380
- const generation = _classPrivateFieldGet2(_generation$1, this);
10381
+ _classPrivateFieldSet2(_generation, this, _classPrivateFieldGet2(_generation, this) + 1);
10382
+ const generation = _classPrivateFieldGet2(_generation, this);
10381
10383
  let pending;
10382
10384
  try {
10383
10385
  if (next.kind === "standard") _classPrivateFieldSet2(_state$5, this, ɵgetAgentInterruptState(_classPrivateFieldGet2(_agent, this), next.interrupts));
@@ -10417,7 +10419,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10417
10419
  }
10418
10420
  /** Show the interrupt and run the optional preparation handler. */
10419
10421
  function _accept(pending, event, generation) {
10420
- if (generation !== _classPrivateFieldGet2(_generation$1, this)) return;
10422
+ if (generation !== _classPrivateFieldGet2(_generation, this)) return;
10421
10423
  _assertClassBrand(_ɵInterruptController_brand, this, _update$2).call(this, { accepted: true });
10422
10424
  const handler = _classPrivateFieldGet2(_options$1, this).handler;
10423
10425
  if (!handler) return;
@@ -10440,11 +10442,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10440
10442
  return;
10441
10443
  }
10442
10444
  Promise.resolve(prepared).then((result) => {
10443
- if (generation === _classPrivateFieldGet2(_generation$1, this)) _assertClassBrand(_ɵInterruptController_brand, this, _update$2).call(this, { result });
10445
+ if (generation === _classPrivateFieldGet2(_generation, this)) _assertClassBrand(_ɵInterruptController_brand, this, _update$2).call(this, { result });
10444
10446
  }, (error) => _assertClassBrand(_ɵInterruptController_brand, this, _failPreparation).call(this, error, generation));
10445
10447
  }
10446
10448
  function _rejectInterrupt(error, generation) {
10447
- if (generation !== _classPrivateFieldGet2(_generation$1, this)) return;
10449
+ if (generation !== _classPrivateFieldGet2(_generation, this)) return;
10448
10450
  console.error(`[CopilotKit] ${_classPrivateFieldGet2(_name, this)} enabled predicate threw; treating interrupt as disabled:`, error);
10449
10451
  _assertClassBrand(_ɵInterruptController_brand, this, _update$2).call(this, {
10450
10452
  accepted: false,
@@ -10452,7 +10454,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10452
10454
  });
10453
10455
  }
10454
10456
  function _failPreparation(error, generation) {
10455
- if (generation !== _classPrivateFieldGet2(_generation$1, this)) return;
10457
+ if (generation !== _classPrivateFieldGet2(_generation, this)) return;
10456
10458
  console.error(`[CopilotKit] ${_classPrivateFieldGet2(_name, this)} handler failed; result will be null:`, error);
10457
10459
  _assertClassBrand(_ɵInterruptController_brand, this, _update$2).call(this, {
10458
10460
  result: null,
@@ -10461,7 +10463,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10461
10463
  }
10462
10464
  /** Drop pending state and invalidate async work. Shared decisions survive. */
10463
10465
  function _clear(error = null) {
10464
- _classPrivateFieldSet2(_generation$1, this, _classPrivateFieldGet2(_generation$1, this) + 1);
10466
+ _classPrivateFieldSet2(_generation, this, _classPrivateFieldGet2(_generation, this) + 1);
10465
10467
  _classPrivateFieldSet2(_resumePromise, this, void 0);
10466
10468
  _classPrivateFieldSet2(_state$5, this, new ɵInterruptState());
10467
10469
  _assertClassBrand(_ɵInterruptController_brand, this, _update$2).call(this, {
@@ -10474,14 +10476,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10474
10476
  /** Apply a change, rebuild `renderProps` and notify listeners. */
10475
10477
  function _update$2(patch) {
10476
10478
  var _pending$interrupts$2;
10477
- const current = _classPrivateFieldGet2(_snapshot$5, this);
10479
+ const current = _classPrivateFieldGet2(_snapshot$4, this);
10478
10480
  const next = {
10479
10481
  ...current,
10480
10482
  ...patch
10481
10483
  };
10482
10484
  if (next.pending === current.pending && next.accepted === current.accepted && next.result === current.result && next.error === current.error) return;
10483
10485
  const { pending, accepted, result } = next;
10484
- _classPrivateFieldSet2(_snapshot$5, this, {
10486
+ _classPrivateFieldSet2(_snapshot$4, this, {
10485
10487
  ...next,
10486
10488
  renderProps: pending && accepted ? {
10487
10489
  event: toLegacyEvent(pending),
@@ -10492,7 +10494,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10492
10494
  cancel: this.cancel
10493
10495
  } : null
10494
10496
  });
10495
- for (const listener of [..._classPrivateFieldGet2(_listeners$10, this)]) try {
10497
+ for (const listener of [..._classPrivateFieldGet2(_listeners$9, this)]) try {
10496
10498
  listener();
10497
10499
  } catch (error) {
10498
10500
  console.error("[CopilotKit] interrupt listener error:", error);
@@ -10598,12 +10600,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10598
10600
  if (!seen.has(_classPrivateFieldGet2(_chatAgentId, this))) _classPrivateFieldGet2(_core$1, this).reloadSuggestions(_classPrivateFieldGet2(_chatAgentId, this));
10599
10601
  }
10600
10602
  dispose() {
10601
- var _classPrivateFieldGet2$10;
10603
+ var _classPrivateFieldGet2$9;
10602
10604
  if (_classPrivateFieldGet2(_disposed, this)) return;
10603
10605
  _classPrivateFieldSet2(_disposed, this, true);
10604
10606
  _assertClassBrand(_SuggestionsBinding_brand, this, _unregister).call(this);
10605
10607
  _assertClassBrand(_SuggestionsBinding_brand, this, _cancelAllRetries).call(this);
10606
- (_classPrivateFieldGet2$10 = _classPrivateFieldGet2(_stopWaitingForAgent, this)) === null || _classPrivateFieldGet2$10 === void 0 || _classPrivateFieldGet2$10.call(this);
10608
+ (_classPrivateFieldGet2$9 = _classPrivateFieldGet2(_stopWaitingForAgent, this)) === null || _classPrivateFieldGet2$9 === void 0 || _classPrivateFieldGet2$9.call(this);
10607
10609
  _classPrivateFieldSet2(_stopWaitingForAgent, this, null);
10608
10610
  _classPrivateFieldGet2(_unsubscribeCore, this).call(this);
10609
10611
  _classPrivateFieldSet2(_config$1, this, null);
@@ -10816,7 +10818,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10816
10818
  }
10817
10819
  /** Applies the latest `learning` option. Repeating the same value is a no-op. */
10818
10820
  update(learning) {
10819
- var _classPrivateFieldGet2$9;
10821
+ var _classPrivateFieldGet2$8;
10820
10822
  const config = learning === _classPrivateFieldGet2(_prop, this) ? _classPrivateFieldGet2(_config, this) : ɵtoLearningConfig(learning);
10821
10823
  const enabled = config !== void 0;
10822
10824
  const autoStart = enabled && (typeof learning !== "object" || learning.autoStart !== false);
@@ -10842,7 +10844,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10842
10844
  if (!enabled) return;
10843
10845
  const start = { stopped: false };
10844
10846
  _classPrivateFieldSet2(_activeStart, this, start);
10845
- const trajectoryId = generatesTrajectoryId ? (_classPrivateFieldGet2$9 = _classPrivateFieldGet2(_generatedTrajectoryId, this)) !== null && _classPrivateFieldGet2$9 !== void 0 ? _classPrivateFieldGet2$9 : _classPrivateFieldSet2(_generatedTrajectoryId, this, (0, _copilotkit_shared.randomUUID)()) : suppliedTrajectoryId;
10847
+ const trajectoryId = generatesTrajectoryId ? (_classPrivateFieldGet2$8 = _classPrivateFieldGet2(_generatedTrajectoryId, this)) !== null && _classPrivateFieldGet2$8 !== void 0 ? _classPrivateFieldGet2$8 : _classPrivateFieldSet2(_generatedTrajectoryId, this, (0, _copilotkit_shared.randomUUID)()) : suppliedTrajectoryId;
10846
10848
  if (trajectoryId === void 0) return;
10847
10849
  _classPrivateFieldGet2(_core, this).startTrajectory({
10848
10850
  trajectoryId,
@@ -10919,8 +10921,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10919
10921
  * - The transport is `runtimeTransport`, else `useSingleEndpoint` mapped to
10920
10922
  * `"single"` (true), `"rest"` (false) or `"auto"` (unset).
10921
10923
  * - The agents are the dev agents with `selfManagedAgents` on top.
10922
- * - The properties get `a2uiCatalogAvailable: true` when a catalog is set.
10923
- * Without a catalog the input object is returned as is.
10924
+ * - The properties are the input object, or a shared empty object.
10924
10925
  * - The header defaults carry the public key header when a key is set.
10925
10926
  *
10926
10927
  * It does not log or throw. The provider reports `diagnostics` (see
@@ -10937,11 +10938,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
10937
10938
  ...input.agents__unsafe_dev_only,
10938
10939
  ...input.selfManagedAgents
10939
10940
  };
10940
- const baseProperties = (_input$properties = input.properties) !== null && _input$properties !== void 0 ? _input$properties : EMPTY_PROPERTIES;
10941
- const properties = input.a2uiCatalog ? {
10942
- ...baseProperties,
10943
- a2uiCatalogAvailable: true
10944
- } : baseProperties;
10941
+ const properties = (_input$properties = input.properties) !== null && _input$properties !== void 0 ? _input$properties : EMPTY_PROPERTIES;
10945
10942
  const headerDefaults = ɵpublicKeyHeaderDefaults(publicKey);
10946
10943
  const diagnostics = [];
10947
10944
  const hasLocalAgents = Object.keys(agents).length > 0;
@@ -11145,45 +11142,46 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
11145
11142
  return renderToolCalls;
11146
11143
  }
11147
11144
  /**
11148
- * @internal Whether the provider turns on A2UI: its built-in renderers and
11149
- * its agent context.
11145
+ * @internal Whether the provider falls back to the standard UI for generative
11146
+ * UI. That is when the provider has no `generativeUI` UI of its own and the
11147
+ * runtime turns generative UI on. A UI of the app always wins, with its own
11148
+ * `agentIds`.
11150
11149
  *
11151
- * A2UI is active when the runtime enables it or the provider has a catalog.
11152
- * With `requireCatalog`, only a catalog turns it on. `missingCatalog` is
11153
- * true when the runtime enables A2UI but `requireCatalog` keeps it off;
11154
- * the provider should tell the developer to configure a catalog.
11150
+ * The fallback is scoped to the agents of the runtime: pass `agentIds` on as
11151
+ * the `agentIds` of the generative UI config, so only those agents get the
11152
+ * envelope.
11155
11153
  *
11156
11154
  * @example
11157
- * ɵresolveA2UIActivation({ runtimeEnabled: true, hasCatalog: false });
11158
- * // { active: true, missingCatalog: false }
11159
- * ɵresolveA2UIActivation({ runtimeEnabled: true, hasCatalog: false, requireCatalog: true });
11160
- * // { active: false, missingCatalog: true }
11161
- */
11162
- function ɵresolveA2UIActivation({ runtimeEnabled, hasCatalog, requireCatalog = false }) {
11163
- if (requireCatalog) return {
11164
- active: hasCatalog,
11165
- missingCatalog: runtimeEnabled && !hasCatalog
11166
- };
11155
+ * const fallback = ɵresolveGenerativeUIDefault({
11156
+ * runtimeEnabled: runtimeInfo.generativeUIEnabled,
11157
+ * runtimeAgents: runtimeInfo.generativeUIAgents,
11158
+ * hasUI: !!generativeUI?.ui,
11159
+ * });
11160
+ * const config =
11161
+ * generativeUI ??
11162
+ * (fallback.active
11163
+ * ? { ui: standardUI, agentIds: fallback.agentIds }
11164
+ * : undefined);
11165
+ */
11166
+ function ɵresolveGenerativeUIDefault({ runtimeEnabled, runtimeAgents, hasUI }) {
11167
+ if (hasUI || !runtimeEnabled) return { active: false };
11167
11168
  return {
11168
- active: runtimeEnabled || hasCatalog,
11169
- missingCatalog: false
11169
+ active: true,
11170
+ agentIds: runtimeAgents
11170
11171
  };
11171
11172
  }
11172
11173
  /**
11173
11174
  * @internal The provider's activity renderer list: the app's renderers, then
11174
- * the A2UI renderer, then the other built-in renderers. Missing entries are
11175
- * left out.
11175
+ * the built-in renderers. Missing entries are left out.
11176
11176
  *
11177
11177
  * @example
11178
11178
  * ɵassembleActivityRenderers({
11179
11179
  * app: props.renderActivityMessages,
11180
- * a2ui: a2uiActive ? a2uiRenderer : undefined,
11181
- * builtIns: [mcpAppsRenderer, openGenUIActive && openGenUIRenderer],
11180
+ * * builtIns: [mcpAppsRenderer, openGenUIActive && openGenUIRenderer],
11182
11181
  * });
11183
11182
  */
11184
- function ɵassembleActivityRenderers({ app = [], a2ui, builtIns = [] }) {
11183
+ function ɵassembleActivityRenderers({ app = [], builtIns = [] }) {
11185
11184
  const renderers = [...app];
11186
- if (a2ui) renderers.push(a2ui);
11187
11185
  for (const renderer of builtIns) if (renderer) renderers.push(renderer);
11188
11186
  return renderers;
11189
11187
  }
@@ -12296,8 +12294,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12296
12294
  }
12297
12295
  var _input$1 = /* @__PURE__ */ new WeakMap();
12298
12296
  var _override$1 = /* @__PURE__ */ new WeakMap();
12299
- var _snapshot$4 = /* @__PURE__ */ new WeakMap();
12300
- var _listeners$9 = /* @__PURE__ */ new WeakMap();
12297
+ var _snapshot$3 = /* @__PURE__ */ new WeakMap();
12298
+ var _listeners$8 = /* @__PURE__ */ new WeakMap();
12301
12299
  var _disconnect$1 = /* @__PURE__ */ new WeakMap();
12302
12300
  var _ɵInspectorThreadOverride_brand = /* @__PURE__ */ new WeakSet();
12303
12301
  /**
@@ -12320,25 +12318,25 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12320
12318
  _classPrivateMethodInitSpec(this, _ɵInspectorThreadOverride_brand);
12321
12319
  _classPrivateFieldInitSpec(this, _input$1, void 0);
12322
12320
  _classPrivateFieldInitSpec(this, _override$1, null);
12323
- _classPrivateFieldInitSpec(this, _snapshot$4, null);
12324
- _classPrivateFieldInitSpec(this, _listeners$9, /* @__PURE__ */ new Set());
12321
+ _classPrivateFieldInitSpec(this, _snapshot$3, null);
12322
+ _classPrivateFieldInitSpec(this, _listeners$8, /* @__PURE__ */ new Set());
12325
12323
  _classPrivateFieldInitSpec(this, _disconnect$1, null);
12326
12324
  _defineProperty(
12327
12325
  this,
12328
12326
  /** The current override, or `null`. Same object until it changes. */
12329
12327
  "getSnapshot",
12330
- () => _classPrivateFieldGet2(_snapshot$4, this)
12328
+ () => _classPrivateFieldGet2(_snapshot$3, this)
12331
12329
  );
12332
12330
  _defineProperty(
12333
12331
  this,
12334
12332
  /** Listen for override changes. Returns unsubscribe. */
12335
12333
  "subscribe",
12336
12334
  (listener) => {
12337
- _classPrivateFieldGet2(_listeners$9, this).add(listener);
12338
- if (_classPrivateFieldGet2(_listeners$9, this).size === 1) _assertClassBrand(_ɵInspectorThreadOverride_brand, this, _connect$1).call(this);
12335
+ _classPrivateFieldGet2(_listeners$8, this).add(listener);
12336
+ if (_classPrivateFieldGet2(_listeners$8, this).size === 1) _assertClassBrand(_ɵInspectorThreadOverride_brand, this, _connect$1).call(this);
12339
12337
  return () => {
12340
- _classPrivateFieldGet2(_listeners$9, this).delete(listener);
12341
- if (_classPrivateFieldGet2(_listeners$9, this).size === 0) _assertClassBrand(_ɵInspectorThreadOverride_brand, this, _disconnectBridge).call(this);
12338
+ _classPrivateFieldGet2(_listeners$8, this).delete(listener);
12339
+ if (_classPrivateFieldGet2(_listeners$8, this).size === 0) _assertClassBrand(_ɵInspectorThreadOverride_brand, this, _disconnectBridge).call(this);
12342
12340
  };
12343
12341
  }
12344
12342
  );
@@ -12372,7 +12370,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12372
12370
  }
12373
12371
  dispose() {
12374
12372
  _assertClassBrand(_ɵInspectorThreadOverride_brand, this, _disconnectBridge).call(this);
12375
- _classPrivateFieldGet2(_listeners$9, this).clear();
12373
+ _classPrivateFieldGet2(_listeners$8, this).clear();
12376
12374
  }
12377
12375
  };
12378
12376
  function _connect$1() {
@@ -12409,8 +12407,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12409
12407
  });
12410
12408
  }
12411
12409
  function _disconnectBridge() {
12412
- var _classPrivateFieldGet2$8;
12413
- (_classPrivateFieldGet2$8 = _classPrivateFieldGet2(_disconnect$1, this)) === null || _classPrivateFieldGet2$8 === void 0 || _classPrivateFieldGet2$8.call(this);
12410
+ var _classPrivateFieldGet2$7;
12411
+ (_classPrivateFieldGet2$7 = _classPrivateFieldGet2(_disconnect$1, this)) === null || _classPrivateFieldGet2$7 === void 0 || _classPrivateFieldGet2$7.call(this);
12414
12412
  _classPrivateFieldSet2(_disconnect$1, this, null);
12415
12413
  }
12416
12414
  function _restoreIfStale() {
@@ -12435,11 +12433,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12435
12433
  }
12436
12434
  function _setOverride(next) {
12437
12435
  _classPrivateFieldSet2(_override$1, this, next);
12438
- _classPrivateFieldSet2(_snapshot$4, this, next ? {
12436
+ _classPrivateFieldSet2(_snapshot$3, this, next ? {
12439
12437
  threadId: next.threadId,
12440
12438
  requestId: next.requestId
12441
12439
  } : null);
12442
- const listeners = [..._classPrivateFieldGet2(_listeners$9, this)];
12440
+ const listeners = [..._classPrivateFieldGet2(_listeners$8, this)];
12443
12441
  for (const listener of listeners) listener();
12444
12442
  }
12445
12443
 
@@ -12573,7 +12571,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12573
12571
  /** The operation key of an agent-called function. It has no surface. */
12574
12572
  const FUNCTION_CALL_KEY = "callRendererFunction";
12575
12573
  const OP_KEYS = [...SURFACE_OP_KEYS, FUNCTION_CALL_KEY];
12576
- function isRecord$2(value) {
12574
+ function isRecord$1(value) {
12577
12575
  return typeof value === "object" && value !== null && !Array.isArray(value);
12578
12576
  }
12579
12577
  function isWhitespace(ch) {
@@ -12750,7 +12748,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12750
12748
  if (text === null) return void 0;
12751
12749
  try {
12752
12750
  const value = JSON.parse(text);
12753
- return isRecord$2(value) ? value : void 0;
12751
+ return isRecord$1(value) ? value : void 0;
12754
12752
  } catch (_unused4) {
12755
12753
  return;
12756
12754
  }
@@ -12847,7 +12845,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12847
12845
  function getOperationEntry(op) {
12848
12846
  for (const key of OP_KEYS) {
12849
12847
  const inner = op[key];
12850
- if (isRecord$2(inner)) return {
12848
+ if (isRecord$1(inner)) return {
12851
12849
  key,
12852
12850
  inner
12853
12851
  };
@@ -12877,7 +12875,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12877
12875
  if (((_getOperationEntry = getOperationEntry(op)) === null || _getOperationEntry === void 0 ? void 0 : _getOperationEntry.key) === FUNCTION_CALL_KEY) return void 0;
12878
12876
  for (const key of SURFACE_OP_KEYS) {
12879
12877
  const inner = op[key];
12880
- if (isRecord$2(inner) && typeof inner.surfaceId === "string") return inner.surfaceId;
12878
+ if (isRecord$1(inner) && typeof inner.surfaceId === "string") return inner.surfaceId;
12881
12879
  }
12882
12880
  return typeof op.surfaceId === "string" ? op.surfaceId : void 0;
12883
12881
  }
@@ -13134,15 +13132,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13134
13132
  ];
13135
13133
  /** Whether a value is shaped like one A2UI operation, with named components. */
13136
13134
  function isOperationShape(value) {
13137
- if (!isRecord$2(value) || value.version !== _copilotkit_shared.A2UI_VERSION) return false;
13135
+ if (!isRecord$1(value) || value.version !== _copilotkit_shared.A2UI_VERSION) return false;
13138
13136
  const names = OPERATION_NAMES.filter((name) => name in value);
13139
13137
  if (names.length !== 1 || Object.keys(value).length !== 2) return false;
13140
13138
  const body = value[names[0]];
13141
- if (!isRecord$2(body)) return false;
13139
+ if (!isRecord$1(body)) return false;
13142
13140
  if (names[0] === "callRendererFunction") return true;
13143
13141
  if (typeof body.surfaceId !== "string") return false;
13144
13142
  const components = body.components;
13145
- return components === void 0 || Array.isArray(components) && components.every((c) => isRecord$2(c) && typeof c.id === "string" && typeof c.component === "string");
13143
+ return components === void 0 || Array.isArray(components) && components.every((c) => isRecord$1(c) && typeof c.id === "string" && typeof c.component === "string");
13146
13144
  }
13147
13145
  /** Openers minus closers ({ and [ against } and ]) outside strings. */
13148
13146
  function closerImbalance(line) {
@@ -13169,10 +13167,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13169
13167
  * the end instead of where it was dropped. The scan below repairs those.
13170
13168
  */
13171
13169
  function nestsStructuralKey(value) {
13172
- const nests = (v) => isRecord$2(v) && Object.entries(v).some(([k, x]) => STRUCTURAL_KEYS.has(k) || nests(x));
13173
- const body = isRecord$2(value) ? Object.values(value).find(isRecord$2) : void 0;
13170
+ const nests = (v) => isRecord$1(v) && Object.entries(v).some(([k, x]) => STRUCTURAL_KEYS.has(k) || nests(x));
13171
+ const body = isRecord$1(value) ? Object.values(value).find(isRecord$1) : void 0;
13174
13172
  const components = body === null || body === void 0 ? void 0 : body.components;
13175
- return Array.isArray(components) && components.some((c) => isRecord$2(c) && Object.values(c).some((prop) => nests(prop)));
13173
+ return Array.isArray(components) && components.some((c) => isRecord$1(c) && Object.values(c).some((prop) => nests(prop)));
13176
13174
  }
13177
13175
  /**
13178
13176
  * Repairs the complete lines of a fence that are not valid JSON (a missing
@@ -13200,7 +13198,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13200
13198
  try {
13201
13199
  const fixed = (0, jsonrepair.jsonrepair)(line);
13202
13200
  const value = JSON.parse(fixed);
13203
- if (withoutClosers(fixed) === withoutClosers(line) && isOperationShape(value) && !nestsStructuralKey(value) && !(isRecord$2(value) && "callRendererFunction" in value)) {
13201
+ if (withoutClosers(fixed) === withoutClosers(line) && isOperationShape(value) && !nestsStructuralKey(value) && !(isRecord$1(value) && "callRendererFunction" in value)) {
13204
13202
  repaired.push(line.trim());
13205
13203
  lines[n] = JSON.stringify(value);
13206
13204
  }
@@ -13273,7 +13271,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13273
13271
  } catch (_unused12) {
13274
13272
  parsed = void 0;
13275
13273
  }
13276
- if (isRecord$2(parsed)) operations.push(parsed);
13274
+ if (isRecord$1(parsed)) operations.push(parsed);
13277
13275
  else salvage(raw);
13278
13276
  } else if (end < s.length) salvage(raw);
13279
13277
  else {
@@ -13412,14 +13410,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13412
13410
  /** A component id referenced by a `child`/`children` entry or a table cell. */
13413
13411
  function referencedId(value) {
13414
13412
  if (typeof value === "string") return value;
13415
- if (isRecord$2(value)) {
13413
+ if (isRecord$1(value)) {
13416
13414
  if (typeof value.componentId === "string") return value.componentId;
13417
13415
  if (typeof value.id === "string") return value.id;
13418
13416
  }
13419
13417
  }
13420
13418
  /** Ids of a table cell / column that renders a component (`{componentId}` or `{id}`). */
13421
13419
  function cellComponentId(value) {
13422
- return isRecord$2(value) ? referencedId(value) : void 0;
13420
+ return isRecord$1(value) ? referencedId(value) : void 0;
13423
13421
  }
13424
13422
  /**
13425
13423
  * Ids a component renders directly: `child`, `children` (string ids, an
@@ -13448,9 +13446,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13448
13446
  const byId = /* @__PURE__ */ new Map();
13449
13447
  for (const op of operations) {
13450
13448
  const update = op.updateComponents;
13451
- const list = isRecord$2(update) ? update.components : void 0;
13449
+ const list = isRecord$1(update) ? update.components : void 0;
13452
13450
  if (!Array.isArray(list)) continue;
13453
- for (const c of list) if (isRecord$2(c) && typeof c.id === "string") byId.set(c.id, c);
13451
+ for (const c of list) if (isRecord$1(c) && typeof c.id === "string") byId.set(c.id, c);
13454
13452
  }
13455
13453
  return byId;
13456
13454
  }
@@ -13484,7 +13482,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13484
13482
  */
13485
13483
  function classifySurfaceCards(components, options = {}) {
13486
13484
  const byId = /* @__PURE__ */ new Map();
13487
- for (const c of components) if (isRecord$2(c) && typeof c.id === "string") byId.set(c.id, c);
13485
+ for (const c of components) if (isRecord$1(c) && typeof c.id === "string") byId.set(c.id, c);
13488
13486
  const interactive = /* @__PURE__ */ new Set();
13489
13487
  for (const [id, c] of byId) {
13490
13488
  if (c.component !== "Card") continue;
@@ -13524,13 +13522,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13524
13522
  const flatten = (c) => c.component === "Card" && typeof c.id === "string" && !interactive.has(c.id) && !insideInteractive.has(c.id) && c.variant == null && c.border == null;
13525
13523
  return operations.map((op) => {
13526
13524
  const update = op.updateComponents;
13527
- if (!isRecord$2(update) || !Array.isArray(update.components)) return op;
13528
- if (!update.components.some((c) => isRecord$2(c) && flatten(c))) return op;
13525
+ if (!isRecord$1(update) || !Array.isArray(update.components)) return op;
13526
+ if (!update.components.some((c) => isRecord$1(c) && flatten(c))) return op;
13529
13527
  return {
13530
13528
  ...op,
13531
13529
  updateComponents: {
13532
13530
  ...update,
13533
- components: update.components.map((c) => isRecord$2(c) && flatten(c) ? {
13531
+ components: update.components.map((c) => isRecord$1(c) && flatten(c) ? {
13534
13532
  ...c,
13535
13533
  variant: "section"
13536
13534
  } : c)
@@ -13556,7 +13554,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13556
13554
  */
13557
13555
  function listEntryMarkdown(entry) {
13558
13556
  if (typeof entry === "string") return entry.trim() ? oneLine(entry) : null;
13559
- if (!isRecord$2(entry)) return null;
13557
+ if (!isRecord$1(entry)) return null;
13560
13558
  for (const key of Object.keys(entry)) if (key !== "label" && key !== "description") return null;
13561
13559
  if (typeof entry.label !== "string" || !entry.label.trim()) return null;
13562
13560
  const label = oneLine(entry.label);
@@ -13731,12 +13729,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13731
13729
  components
13732
13730
  }];
13733
13731
  const byId = /* @__PURE__ */ new Map();
13734
- for (const c of components) if (isRecord$2(c) && typeof c.id === "string") byId.set(c.id, c);
13732
+ for (const c of components) if (isRecord$1(c) && typeof c.id === "string") byId.set(c.id, c);
13735
13733
  const root = byId.get(_copilotkit_shared.GENERATIVE_UI_ROOT_ID);
13736
13734
  if (!root) return unchanged;
13737
13735
  if (components.some((c) => {
13738
13736
  var _options$childIds;
13739
- return isRecord$2(c) && ((_options$childIds = options.childIds) === null || _options$childIds === void 0 ? void 0 : _options$childIds.call(options, c)) === "unknown";
13737
+ return isRecord$1(c) && ((_options$childIds = options.childIds) === null || _options$childIds === void 0 ? void 0 : _options$childIds.call(options, c)) === "unknown";
13740
13738
  })) return unchanged;
13741
13739
  const rootItem = toProseItem(root);
13742
13740
  if ((rootItem === null || rootItem === void 0 ? void 0 : rootItem.kind) === "text") return [{
@@ -13793,7 +13791,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13793
13791
  });
13794
13792
  for (const c of components) {
13795
13793
  var _owners$get;
13796
- if (!isRecord$2(c) || typeof c.id !== "string" || byId.get(c.id) !== c) continue;
13794
+ if (!isRecord$1(c) || typeof c.id !== "string" || byId.get(c.id) !== c) continue;
13797
13795
  const ownerIndexes = (_owners$get = owners.get(c.id)) !== null && _owners$get !== void 0 ? _owners$get : [];
13798
13796
  for (const index of ownerIndexes) surfaceComponents[index].push(c);
13799
13797
  }
@@ -13810,730 +13808,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13810
13808
  });
13811
13809
  }
13812
13810
 
13813
- //#endregion
13814
- //#region src/a2ui/constants.ts
13815
- /**
13816
- * The content key that carries A2UI operations, on `a2ui-surface` activities
13817
- * and on render tool results. Must match `A2UI_OPERATIONS_KEY` in
13818
- * `@ag-ui/a2ui-middleware` and `copilotkit_runtime.a2ui` (Python).
13819
- */
13820
- const A2UI_OPERATIONS_KEY = "a2ui_operations";
13821
- /** The activity type the A2UI middleware streams surfaces and their lifecycle on. */
13822
- const A2UI_SURFACE_ACTIVITY_TYPE = "a2ui-surface";
13823
- /** The tool the A2UI middleware injects so the model can generate a surface. */
13824
- const RENDER_A2UI_TOOL_NAME = "render_a2ui";
13825
- /** The surface an operation that names no surface is filed under. */
13826
- const A2UI_DEFAULT_SURFACE_ID = "default";
13827
- /**
13828
- * The component id every renderer starts from when it walks a surface. A2UI
13829
- * v0.9 gives a payload no way to name its own entry point, so it is fixed.
13830
- * `@copilotkit/a2ui-renderer` exports the same value as `ROOT_COMPONENT_ID`.
13831
- */
13832
- const A2UI_ROOT_COMPONENT_ID = "root";
13833
-
13834
- //#endregion
13835
- //#region src/a2ui/operations.ts
13836
- function isRecord$1(value) {
13837
- return typeof value === "object" && value !== null && !Array.isArray(value);
13838
- }
13839
- /**
13840
- * Reads the A2UI operations from activity content or a tool result payload.
13841
- * The `a2ui_operations` key wins; a bare `operations` key is accepted too.
13842
- * Entries that are not objects are dropped.
13843
- *
13844
- * @param content - Activity content or a parsed tool result, of any shape.
13845
- * @returns The operations, or an empty list when there are none.
13846
- */
13847
- function getA2UIOperations(content) {
13848
- var _content$A2UI_OPERATI;
13849
- if (!isRecord$1(content)) return [];
13850
- const operations = (_content$A2UI_OPERATI = content[A2UI_OPERATIONS_KEY]) !== null && _content$A2UI_OPERATI !== void 0 ? _content$A2UI_OPERATI : content.operations;
13851
- if (!Array.isArray(operations)) return [];
13852
- return operations.filter(isRecord$1);
13853
- }
13854
- /**
13855
- * The operation keys that nest a `surfaceId`, v0.9 first, then the v0.8 keys
13856
- * older agents still send.
13857
- */
13858
- const NESTED_SURFACE_KEYS = [
13859
- "createSurface",
13860
- "updateComponents",
13861
- "updateDataModel",
13862
- "deleteSurface",
13863
- "beginRendering",
13864
- "surfaceUpdate",
13865
- "dataModelUpdate"
13866
- ];
13867
- /**
13868
- * Resolves the surface an operation addresses.
13869
- *
13870
- * The nested `surfaceId` wins, because that is the id `MessageProcessor`
13871
- * creates the surface under. Grouping by a top-level `surfaceId` instead files
13872
- * the operations against a surface that never exists, which paints nothing
13873
- * (OSS-1048). A top-level `surfaceId` is honoured only when no nested id is
13874
- * present.
13875
- *
13876
- * @param operation - One A2UI operation, of any shape.
13877
- * @returns The surface id, or null when the operation names none.
13878
- */
13879
- function getA2UIOperationSurfaceId(operation) {
13880
- if (!isRecord$1(operation)) return null;
13881
- for (const key of NESTED_SURFACE_KEYS) {
13882
- const inner = operation[key];
13883
- if (isRecord$1(inner) && typeof inner.surfaceId === "string") return inner.surfaceId;
13884
- }
13885
- return typeof operation.surfaceId === "string" ? operation.surfaceId : null;
13886
- }
13887
- /**
13888
- * Groups operations by the surface they address, in first-seen order. An
13889
- * operation that names no surface goes under `"default"`.
13890
- *
13891
- * @param operations - Operations in arrival order.
13892
- */
13893
- function groupA2UIOperationsBySurface(operations) {
13894
- const groups = /* @__PURE__ */ new Map();
13895
- for (const operation of operations) {
13896
- var _getA2UIOperationSurf;
13897
- const surfaceId = (_getA2UIOperationSurf = getA2UIOperationSurfaceId(operation)) !== null && _getA2UIOperationSurf !== void 0 ? _getA2UIOperationSurf : A2UI_DEFAULT_SURFACE_ID;
13898
- const group = groups.get(surfaceId);
13899
- if (group) group.push(operation);
13900
- else groups.set(surfaceId, [operation]);
13901
- }
13902
- return groups;
13903
- }
13904
- function hasValue(value) {
13905
- if (Array.isArray(value)) return value.length > 0;
13906
- return value !== null && value !== void 0 && value !== "";
13907
- }
13908
- /**
13909
- * Whether operations are enough to paint a visible card yet. A data-bound
13910
- * surface addresses its values by `path` and draws nothing until a data model
13911
- * update carries a non-empty value; a static surface paints from its
13912
- * components alone. Times the loader → surface hand-off to real content rather
13913
- * than a fixed delay (OSS-162).
13914
- *
13915
- * @param operations - The operations of one surface or of a whole activity.
13916
- */
13917
- function surfaceHasRenderableContent(operations) {
13918
- const componentOperations = operations.filter((operation) => isRecord$1(operation.updateComponents));
13919
- if (componentOperations.length === 0) return false;
13920
- if (!JSON.stringify(componentOperations).includes("\"path\"")) return true;
13921
- return operations.some((operation) => {
13922
- const update = operation.updateDataModel;
13923
- if (!isRecord$1(update)) return false;
13924
- const value = update.value;
13925
- if (typeof value !== "object" || value === null) return false;
13926
- return Object.values(value).some(hasValue);
13927
- });
13928
- }
13929
-
13930
- //#endregion
13931
- //#region src/a2ui/diagnostics.ts
13932
- /**
13933
- * How long a surface may take to report its first paint before the loader
13934
- * hand-off gives up and shows it anyway. Reaching it with no paint is also the
13935
- * moment the unpainted and unresolved-root diagnostics fire.
13936
- */
13937
- const A2UI_PAINT_FALLBACK_MS = 8e3;
13938
- /** The operation kinds a surface received, comma-separated, or "none". */
13939
- function describeOperationKinds(operations) {
13940
- const kinds = /* @__PURE__ */ new Set();
13941
- for (const operation of operations) for (const key of Object.keys(operation)) if (key !== "version") kinds.add(key);
13942
- return kinds.size === 0 ? "none" : Array.from(kinds).join(", ");
13943
- }
13944
- function componentLists(operations) {
13945
- const lists = [];
13946
- for (const operation of operations) {
13947
- const update = operation.updateComponents;
13948
- if (isRecord$1(update) && Array.isArray(update.components)) lists.push(update.components);
13949
- }
13950
- return lists;
13951
- }
13952
- /** The component ids a surface was sent, quoted and comma-separated, or "none". */
13953
- function describeComponentIds(operations) {
13954
- const ids = [];
13955
- const lists = componentLists(operations);
13956
- for (const components of lists) for (const component of components) {
13957
- const id = isRecord$1(component) ? component.id : void 0;
13958
- if (typeof id === "string" && !ids.includes(id)) ids.push(id);
13959
- }
13960
- return ids.length === 0 ? "none" : ids.map((id) => `"${id}"`).join(", ");
13961
- }
13962
- /**
13963
- * Explains why a surface that received operations never painted, or returns
13964
- * null when its operations are enough to paint.
13965
- *
13966
- * Reaching {@link A2UI_PAINT_FALLBACK_MS} with no paint means the operations
13967
- * were accepted and still put nothing on screen. Left alone that is
13968
- * invisible, so the message says which half is missing.
13969
- *
13970
- * @param surfaceId - The surface the operations address.
13971
- * @param operations - The operations grouped under that surface.
13972
- */
13973
- function diagnoseUnpaintedSurface(surfaceId, operations) {
13974
- if (surfaceHasRenderableContent(operations)) return null;
13975
- 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";
13976
- 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.`;
13977
- }
13978
- /**
13979
- * Explains a surface that never got created although operations addressed
13980
- * it. The usual cause is operations sent to one surface id while the surface
13981
- * was created under another, or operations that were all dropped as invalid.
13982
- *
13983
- * @param surfaceId - The surface the operations address.
13984
- * @param operations - The operations processed for that surface.
13985
- */
13986
- function diagnoseMissingSurface(surfaceId, operations) {
13987
- 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.`;
13988
- }
13989
- /**
13990
- * Explains a surface still waiting for its root component once operations
13991
- * have stopped arriving, or returns null when the root resolved (or when no
13992
- * components arrived at all, which {@link diagnoseUnpaintedSurface} explains
13993
- * better).
13994
- *
13995
- * Renderers begin walking a surface at the root id and treat an id they cannot
13996
- * find as not arrived yet, so a payload without it animates a placeholder
13997
- * forever while every other check calls it healthy. Reads the live components
13998
- * model, so it covers every way the root can fail to resolve.
13999
- *
14000
- * @param surfaceId - The surface the operations address.
14001
- * @param operations - The operations processed for that surface.
14002
- * @param surface - The live surface model.
14003
- */
14004
- function diagnoseUnresolvedRoot(surfaceId, operations, surface) {
14005
- if (surface.componentsModel.get(A2UI_ROOT_COMPONENT_ID)) return null;
14006
- const lists = componentLists(operations);
14007
- if (lists.length === 0) return null;
14008
- 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`;
14009
- 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.`;
14010
- }
14011
-
14012
- //#endregion
14013
- //#region src/a2ui/actions.ts
14014
- /**
14015
- * Wraps a raw processor action in the client-event envelope the runtimes read,
14016
- * filling the fields a partial action leaves out.
14017
- *
14018
- * @param action - What the `MessageProcessor` action handler received.
14019
- */
14020
- function toA2UIClientEvent(action) {
14021
- var _action$name, _action$surfaceId, _action$sourceCompone, _action$timestamp;
14022
- return { userAction: {
14023
- name: (_action$name = action.name) !== null && _action$name !== void 0 ? _action$name : "unknown",
14024
- surfaceId: (_action$surfaceId = action.surfaceId) !== null && _action$surfaceId !== void 0 ? _action$surfaceId : A2UI_DEFAULT_SURFACE_ID,
14025
- sourceComponentId: (_action$sourceCompone = action.sourceComponentId) !== null && _action$sourceCompone !== void 0 ? _action$sourceCompone : "",
14026
- context: action.context,
14027
- timestamp: (_action$timestamp = action.timestamp) !== null && _action$timestamp !== void 0 ? _action$timestamp : (/* @__PURE__ */ new Date()).toISOString()
14028
- } };
14029
- }
14030
- /**
14031
- * Sends one A2UI user action to the agent: runs the optional `onAction`
14032
- * interceptor first, then sets the `a2uiAction` run property and runs the
14033
- * agent unless the interceptor suppressed it (returned `null`). The
14034
- * `a2uiAction` property is always removed afterwards so it does not leak into
14035
- * later runs.
14036
- *
14037
- * Does nothing when there is no agent (a surface rendered outside a chat).
14038
- *
14039
- * @example
14040
- * ```ts
14041
- * new MessageProcessor([catalog], (action) =>
14042
- * ɵrunA2UIAction({ message: ɵtoA2UIClientEvent(action), agent, core }),
14043
- * );
14044
- * ```
14045
- */
14046
- async function runA2UIAction({ message, agent, core, onAction }) {
14047
- if (!agent) return;
14048
- const forward = async (forwardAction) => {
14049
- const a2uiAction = forwardAction === void 0 ? message : {
14050
- ...message,
14051
- userAction: forwardAction
14052
- };
14053
- try {
14054
- core.setProperties({
14055
- ...core.properties,
14056
- a2uiAction
14057
- });
14058
- await core.runAgent({ agent });
14059
- } finally {
14060
- const { a2uiAction: _removed, ...rest } = core.properties;
14061
- core.setProperties(rest);
14062
- }
14063
- };
14064
- if (onAction) {
14065
- const result = await onAction(message.userAction, forward);
14066
- if (result === null) return;
14067
- if (result) {
14068
- await forward(result);
14069
- return;
14070
- }
14071
- }
14072
- await forward();
14073
- }
14074
-
14075
- //#endregion
14076
- //#region src/a2ui/lifecycle.ts
14077
- const A2UI_RECOVERY_DEFAULTS = {
14078
- showAfterMs: 2e3,
14079
- showAfterAttempts: 2,
14080
- debugExposure: "collapsed",
14081
- paintFallbackMs: A2UI_PAINT_FALLBACK_MS
14082
- };
14083
- /** User-visible text of the lifecycle states. */
14084
- const A2UI_LIFECYCLE_TEXT = {
14085
- building: "Building interface",
14086
- retrying: "Retrying generation…",
14087
- failureTitle: "Couldn't generate the UI",
14088
- failureDescription: "Something went wrong rendering this. You can keep chatting and try again.",
14089
- failureDetails: "developer details",
14090
- retryDetails: "validation issues"
14091
- };
14092
- function isDebugExposure(value) {
14093
- return value === "hidden" || value === "collapsed" || value === "verbose";
14094
- }
14095
- function numberOrUndefined(value) {
14096
- return typeof value === "number" ? value : void 0;
14097
- }
14098
- function arrayOrUndefined(value) {
14099
- return Array.isArray(value) ? value : void 0;
14100
- }
14101
- /**
14102
- * Reads the lifecycle fields from activity content. An unknown or missing
14103
- * `status` reads as "building"; fields of the wrong type are left out.
14104
- *
14105
- * @param content - `a2ui-surface` activity content, of any shape.
14106
- */
14107
- function readA2UILifecycle(content) {
14108
- if (!isRecord$1(content)) return { status: "building" };
14109
- return {
14110
- status: content.status === "retrying" || content.status === "failed" ? content.status : "building",
14111
- attempt: numberOrUndefined(content.attempt),
14112
- maxAttempts: numberOrUndefined(content.maxAttempts),
14113
- progressTokens: numberOrUndefined(content.progressTokens),
14114
- error: typeof content.error === "string" ? content.error : void 0,
14115
- errors: arrayOrUndefined(content.errors),
14116
- attempts: arrayOrUndefined(content.attempts),
14117
- debugExposure: isDebugExposure(content.debugExposure) ? content.debugExposure : void 0
14118
- };
14119
- }
14120
- /**
14121
- * Validates `a2ui-surface` activity content for activity renderer
14122
- * registration. Any object passes: {@link readA2UILifecycle} and
14123
- * `getA2UIOperations` read the fields and ignore mistyped ones, so a field
14124
- * a newer middleware adds can never hide the surface.
14125
- */
14126
- const A2UI_SURFACE_CONTENT_SCHEMA = { "~standard": {
14127
- version: 1,
14128
- vendor: "copilotkit",
14129
- validate: (value) => isRecord$1(value) ? { value } : { issues: [{ message: "a2ui-surface content must be an object" }] }
14130
- } };
14131
- /**
14132
- * The debug exposure to use: the server-stamped one wins, then the client
14133
- * option, then "collapsed".
14134
- */
14135
- function resolveA2UIDebugExposure(lifecycle, option) {
14136
- var _ref, _lifecycle$debugExpos;
14137
- return (_ref = (_lifecycle$debugExpos = lifecycle.debugExposure) !== null && _lifecycle$debugExpos !== void 0 ? _lifecycle$debugExpos : option) !== null && _ref !== void 0 ? _ref : A2UI_RECOVERY_DEFAULTS.debugExposure;
14138
- }
14139
- /**
14140
- * How much of the skeleton to reveal for an estimated token count. With no
14141
- * count yet the full skeleton shows rather than an empty box.
14142
- *
14143
- * @param tokens - The streamed token estimate, if the server sent one.
14144
- */
14145
- function getA2UIProgressPhase(tokens) {
14146
- let phase = 3;
14147
- if (tokens === void 0) return phase;
14148
- if (tokens < 50) phase = 0;
14149
- else if (tokens < 200) phase = 1;
14150
- else if (tokens < 400) phase = 2;
14151
- return phase;
14152
- }
14153
- /**
14154
- * The label under the skeleton: "Building interface" until a retry is
14155
- * revealed, then "Retrying generation…", with the attempt count when known.
14156
- */
14157
- function formatA2UIRetryLabel(lifecycle, retryRevealed) {
14158
- if (lifecycle.status !== "retrying" || !retryRevealed) return A2UI_LIFECYCLE_TEXT.building;
14159
- const { attempt, maxAttempts } = lifecycle;
14160
- if (attempt === void 0 || maxAttempts === void 0) return A2UI_LIFECYCLE_TEXT.retrying;
14161
- return `${A2UI_LIFECYCLE_TEXT.retrying} (${String(attempt)}/${String(maxAttempts)} attempts)`;
14162
- }
14163
- /**
14164
- * Serializes a debug payload for display. Never throws: circular references,
14165
- * functions, bigints and symbols get placeholder text.
14166
- */
14167
- function formatA2UIDebugPayload(value) {
14168
- if (typeof value === "string") return value;
14169
- const seen = /* @__PURE__ */ new WeakSet();
14170
- try {
14171
- const serialized = JSON.stringify(value, (_key, candidate) => {
14172
- if (typeof candidate === "bigint") return `${candidate.toString()}n`;
14173
- if (typeof candidate === "function") return "[Function]";
14174
- if (typeof candidate === "symbol") return candidate.toString();
14175
- if (typeof candidate === "object" && candidate !== null) {
14176
- if (seen.has(candidate)) return "[Circular]";
14177
- seen.add(candidate);
14178
- }
14179
- return candidate;
14180
- }, 2);
14181
- return serialized !== null && serialized !== void 0 ? serialized : String(value);
14182
- } catch (_unused) {
14183
- return "[Unserializable value]";
14184
- }
14185
- }
14186
- /** The skeleton rows; each row shows once the progress phase reaches `phase`. */
14187
- const A2UI_SKELETON_ROWS = [
14188
- {
14189
- phase: 0,
14190
- delay: 0,
14191
- parts: [{
14192
- w: 36,
14193
- bg: "rgba(147,197,253,0.7)",
14194
- anim: 0
14195
- }, {
14196
- w: 80,
14197
- bg: "rgba(219,234,254,0.8)",
14198
- anim: .2
14199
- }]
14200
- },
14201
- {
14202
- phase: 0,
14203
- delay: .1,
14204
- parts: [
14205
- "spacer",
14206
- "dot",
14207
- {
14208
- w: 100,
14209
- bg: "rgba(24,24,27,0.2)",
14210
- anim: .3
14211
- }
14212
- ]
14213
- },
14214
- {
14215
- phase: 1,
14216
- delay: .15,
14217
- parts: [
14218
- "spacer",
14219
- {
14220
- w: 48,
14221
- bg: "rgba(24,24,27,0.15)",
14222
- anim: .1
14223
- },
14224
- {
14225
- w: 40,
14226
- bg: "rgba(153,246,228,0.6)",
14227
- anim: .5
14228
- },
14229
- {
14230
- w: 56,
14231
- bg: "rgba(147,197,253,0.6)",
14232
- anim: .3
14233
- }
14234
- ]
14235
- },
14236
- {
14237
- phase: 1,
14238
- delay: .2,
14239
- parts: [
14240
- "spacer",
14241
- "dot",
14242
- {
14243
- w: 60,
14244
- bg: "rgba(24,24,27,0.15)",
14245
- anim: .4
14246
- }
14247
- ]
14248
- },
14249
- {
14250
- phase: 2,
14251
- delay: .25,
14252
- parts: [
14253
- {
14254
- w: 40,
14255
- bg: "rgba(153,246,228,0.5)",
14256
- anim: .2
14257
- },
14258
- "dot",
14259
- {
14260
- w: 48,
14261
- bg: "rgba(24,24,27,0.15)",
14262
- anim: .6
14263
- },
14264
- {
14265
- w: 64,
14266
- bg: "rgba(147,197,253,0.5)",
14267
- anim: .1
14268
- }
14269
- ]
14270
- },
14271
- {
14272
- phase: 2,
14273
- delay: .3,
14274
- parts: [{
14275
- w: 36,
14276
- bg: "rgba(147,197,253,0.6)",
14277
- anim: .5
14278
- }, {
14279
- w: 36,
14280
- bg: "rgba(24,24,27,0.12)",
14281
- anim: .7
14282
- }]
14283
- },
14284
- {
14285
- phase: 3,
14286
- delay: .35,
14287
- parts: [
14288
- "dot",
14289
- {
14290
- w: 44,
14291
- bg: "rgba(24,24,27,0.18)",
14292
- anim: .3
14293
- },
14294
- "dot",
14295
- {
14296
- w: 56,
14297
- bg: "rgba(153,246,228,0.5)",
14298
- anim: .8
14299
- },
14300
- {
14301
- w: 48,
14302
- bg: "rgba(147,197,253,0.5)",
14303
- anim: .4
14304
- }
14305
- ]
14306
- }
14307
- ];
14308
- const defaultSchedule = (callback, ms) => {
14309
- const handle = setTimeout(callback, ms);
14310
- return () => clearTimeout(handle);
14311
- };
14312
- function defaultRequestFrame(callback) {
14313
- if (typeof globalThis.requestAnimationFrame === "function") globalThis.requestAnimationFrame(() => callback());
14314
- else callback();
14315
- }
14316
- const BUILDING = { status: "building" };
14317
- var _listeners$8 = /* @__PURE__ */ new WeakMap();
14318
- var _showAfterMs = /* @__PURE__ */ new WeakMap();
14319
- var _showAfterAttempts = /* @__PURE__ */ new WeakMap();
14320
- var _debugExposureOption = /* @__PURE__ */ new WeakMap();
14321
- var _warn = /* @__PURE__ */ new WeakMap();
14322
- var _schedule = /* @__PURE__ */ new WeakMap();
14323
- var _requestFrame = /* @__PURE__ */ new WeakMap();
14324
- var _content$1 = /* @__PURE__ */ new WeakMap();
14325
- var _operations = /* @__PURE__ */ new WeakMap();
14326
- var _lifecycle = /* @__PURE__ */ new WeakMap();
14327
- var _retryRevealed = /* @__PURE__ */ new WeakMap();
14328
- var _cancelRetryTimer = /* @__PURE__ */ new WeakMap();
14329
- var _surfaceReady = /* @__PURE__ */ new WeakMap();
14330
- var _paintRequested = /* @__PURE__ */ new WeakMap();
14331
- var _cancelFallback = /* @__PURE__ */ new WeakMap();
14332
- var _generation = /* @__PURE__ */ new WeakMap();
14333
- var _snapshot$3 = /* @__PURE__ */ new WeakMap();
14334
- var _A2UIActivityController_brand = /* @__PURE__ */ new WeakSet();
14335
- /**
14336
- * Drives what an `a2ui-surface` activity shows: the lifecycle state before
14337
- * paint, the hand-off while the surface paints hidden, then the surface.
14338
- *
14339
- * Give it each content snapshot with `setContent()`, and call `markRendered()`
14340
- * every time the surface applied operations. A surface counts as painted once
14341
- * its operations are renderable (see `surfaceHasRenderableContent`) and a
14342
- * frame has passed; if that never happens the hand-off ends after 8 s anyway
14343
- * and `warn` reports why.
14344
- *
14345
- * @example
14346
- * ```ts
14347
- * const controller = new ɵA2UIActivityController({ recovery });
14348
- * controller.subscribe(() => render(controller.getSnapshot()));
14349
- * controller.setContent(content);
14350
- * // after the surface processed operations:
14351
- * controller.markRendered();
14352
- * // on unmount:
14353
- * controller.dispose();
14354
- * ```
14355
- */
14356
- var A2UIActivityController = class {
14357
- constructor(options = {}) {
14358
- var _options$recovery, _recovery$showAfterMs, _recovery$showAfterAt, _options$schedule, _options$requestFrame;
14359
- _classPrivateMethodInitSpec(this, _A2UIActivityController_brand);
14360
- _classPrivateFieldInitSpec(this, _listeners$8, /* @__PURE__ */ new Set());
14361
- _classPrivateFieldInitSpec(this, _showAfterMs, void 0);
14362
- _classPrivateFieldInitSpec(this, _showAfterAttempts, void 0);
14363
- _classPrivateFieldInitSpec(this, _debugExposureOption, void 0);
14364
- _classPrivateFieldInitSpec(this, _warn, void 0);
14365
- _classPrivateFieldInitSpec(this, _schedule, void 0);
14366
- _classPrivateFieldInitSpec(this, _requestFrame, void 0);
14367
- _classPrivateFieldInitSpec(this, _content$1, void 0);
14368
- _classPrivateFieldInitSpec(this, _operations, []);
14369
- _classPrivateFieldInitSpec(this, _lifecycle, BUILDING);
14370
- _classPrivateFieldInitSpec(this, _retryRevealed, false);
14371
- _classPrivateFieldInitSpec(this, _cancelRetryTimer, void 0);
14372
- _classPrivateFieldInitSpec(this, _surfaceReady, false);
14373
- _classPrivateFieldInitSpec(this, _paintRequested, false);
14374
- _classPrivateFieldInitSpec(this, _cancelFallback, void 0);
14375
- _classPrivateFieldInitSpec(this, _generation, 0);
14376
- _classPrivateFieldInitSpec(this, _snapshot$3, void 0);
14377
- _defineProperty(
14378
- this,
14379
- /** The current snapshot. The same object until something changes. */
14380
- "getSnapshot",
14381
- () => _classPrivateFieldGet2(_snapshot$3, this)
14382
- );
14383
- _defineProperty(
14384
- this,
14385
- /** Calls `listener` when the snapshot changes. Returns the unsubscribe function. */
14386
- "subscribe",
14387
- (listener) => {
14388
- _classPrivateFieldGet2(_listeners$8, this).add(listener);
14389
- return () => {
14390
- _classPrivateFieldGet2(_listeners$8, this).delete(listener);
14391
- };
14392
- }
14393
- );
14394
- const recovery = (_options$recovery = options.recovery) !== null && _options$recovery !== void 0 ? _options$recovery : {};
14395
- _classPrivateFieldSet2(_showAfterMs, this, (_recovery$showAfterMs = recovery.showAfterMs) !== null && _recovery$showAfterMs !== void 0 ? _recovery$showAfterMs : A2UI_RECOVERY_DEFAULTS.showAfterMs);
14396
- _classPrivateFieldSet2(_showAfterAttempts, this, (_recovery$showAfterAt = recovery.showAfterAttempts) !== null && _recovery$showAfterAt !== void 0 ? _recovery$showAfterAt : A2UI_RECOVERY_DEFAULTS.showAfterAttempts);
14397
- _classPrivateFieldSet2(_debugExposureOption, this, recovery.debugExposure);
14398
- _classPrivateFieldSet2(_warn, this, options.warn);
14399
- _classPrivateFieldSet2(_schedule, this, (_options$schedule = options.schedule) !== null && _options$schedule !== void 0 ? _options$schedule : defaultSchedule);
14400
- _classPrivateFieldSet2(_requestFrame, this, (_options$requestFrame = options.requestFrame) !== null && _options$requestFrame !== void 0 ? _options$requestFrame : defaultRequestFrame);
14401
- _classPrivateFieldSet2(_snapshot$3, this, _assertClassBrand(_A2UIActivityController_brand, this, _buildSnapshot).call(this));
14402
- }
14403
- /** Sets the latest activity content. */
14404
- setContent(content) {
14405
- if (content === _classPrivateFieldGet2(_content$1, this)) return;
14406
- _classPrivateFieldSet2(_content$1, this, content);
14407
- const hadOperations = _classPrivateFieldGet2(_operations, this).length > 0;
14408
- _classPrivateFieldSet2(_operations, this, getA2UIOperations(content));
14409
- if (_classPrivateFieldGet2(_operations, this).length === 0) {
14410
- _classPrivateFieldSet2(_lifecycle, this, readA2UILifecycle(content));
14411
- _assertClassBrand(_A2UIActivityController_brand, this, _updateRetry).call(this);
14412
- if (hadOperations) _assertClassBrand(_A2UIActivityController_brand, this, _resetHandoff).call(this);
14413
- } else if (!hadOperations) _assertClassBrand(_A2UIActivityController_brand, this, _startHandoff).call(this);
14414
- _assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
14415
- }
14416
- /**
14417
- * Reports that the surface applied operations. Ends the hand-off after the
14418
- * next frame once the operations can paint something.
14419
- */
14420
- markRendered() {
14421
- if (_classPrivateFieldGet2(_paintRequested, this) || _classPrivateFieldGet2(_surfaceReady, this)) return;
14422
- if (_classPrivateFieldGet2(_operations, this).length === 0) return;
14423
- if (!surfaceHasRenderableContent(_classPrivateFieldGet2(_operations, this))) return;
14424
- _classPrivateFieldSet2(_paintRequested, this, true);
14425
- const generation = _classPrivateFieldGet2(_generation, this);
14426
- _classPrivateFieldGet2(_requestFrame, this).call(this, () => {
14427
- var _classPrivateFieldGet2$7;
14428
- if (generation !== _classPrivateFieldGet2(_generation, this) || !_classPrivateFieldGet2(_paintRequested, this)) return;
14429
- (_classPrivateFieldGet2$7 = _classPrivateFieldGet2(_cancelFallback, this)) === null || _classPrivateFieldGet2$7 === void 0 || _classPrivateFieldGet2$7.call(this);
14430
- _classPrivateFieldSet2(_cancelFallback, this, void 0);
14431
- _classPrivateFieldSet2(_surfaceReady, this, true);
14432
- _assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
14433
- });
14434
- }
14435
- /**
14436
- * Stops the timers and forgets the content. A later `setContent()` starts
14437
- * again, so a component that remounts can keep using the controller.
14438
- */
14439
- dispose() {
14440
- var _classPrivateFieldGet3;
14441
- _classPrivateFieldSet2(_generation, this, _classPrivateFieldGet2(_generation, this) + 1);
14442
- (_classPrivateFieldGet3 = _classPrivateFieldGet2(_cancelRetryTimer, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.call(this);
14443
- _classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
14444
- _assertClassBrand(_A2UIActivityController_brand, this, _resetHandoff).call(this);
14445
- _classPrivateFieldSet2(_content$1, this, void 0);
14446
- _classPrivateFieldSet2(_operations, this, []);
14447
- _classPrivateFieldSet2(_lifecycle, this, BUILDING);
14448
- _classPrivateFieldSet2(_retryRevealed, this, false);
14449
- _classPrivateFieldSet2(_snapshot$3, this, _assertClassBrand(_A2UIActivityController_brand, this, _buildSnapshot).call(this));
14450
- }
14451
- };
14452
- function _updateRetry() {
14453
- const { status, attempt } = _classPrivateFieldGet2(_lifecycle, this);
14454
- if (status !== "retrying") {
14455
- var _classPrivateFieldGet4;
14456
- (_classPrivateFieldGet4 = _classPrivateFieldGet2(_cancelRetryTimer, this)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.call(this);
14457
- _classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
14458
- _classPrivateFieldSet2(_retryRevealed, this, false);
14459
- return;
14460
- }
14461
- if (attempt !== void 0 && attempt >= _classPrivateFieldGet2(_showAfterAttempts, this)) {
14462
- var _classPrivateFieldGet5;
14463
- (_classPrivateFieldGet5 = _classPrivateFieldGet2(_cancelRetryTimer, this)) === null || _classPrivateFieldGet5 === void 0 || _classPrivateFieldGet5.call(this);
14464
- _classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
14465
- _classPrivateFieldSet2(_retryRevealed, this, true);
14466
- return;
14467
- }
14468
- if (_classPrivateFieldGet2(_retryRevealed, this) || _classPrivateFieldGet2(_cancelRetryTimer, this)) return;
14469
- _classPrivateFieldSet2(_cancelRetryTimer, this, _classPrivateFieldGet2(_schedule, this).call(this, () => {
14470
- _classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
14471
- _classPrivateFieldSet2(_retryRevealed, this, true);
14472
- _assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
14473
- }, _classPrivateFieldGet2(_showAfterMs, this)));
14474
- }
14475
- function _startHandoff() {
14476
- var _classPrivateFieldGet6;
14477
- _classPrivateFieldSet2(_surfaceReady, this, false);
14478
- _classPrivateFieldSet2(_paintRequested, this, false);
14479
- (_classPrivateFieldGet6 = _classPrivateFieldGet2(_cancelFallback, this)) === null || _classPrivateFieldGet6 === void 0 || _classPrivateFieldGet6.call(this);
14480
- _classPrivateFieldSet2(_cancelFallback, this, _classPrivateFieldGet2(_schedule, this).call(this, () => {
14481
- _classPrivateFieldSet2(_cancelFallback, this, void 0);
14482
- if (!_classPrivateFieldGet2(_paintRequested, this)) _assertClassBrand(_A2UIActivityController_brand, this, _reportUnpainted).call(this);
14483
- _classPrivateFieldSet2(_surfaceReady, this, true);
14484
- _assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
14485
- }, A2UI_RECOVERY_DEFAULTS.paintFallbackMs));
14486
- }
14487
- function _resetHandoff() {
14488
- var _classPrivateFieldGet7;
14489
- (_classPrivateFieldGet7 = _classPrivateFieldGet2(_cancelFallback, this)) === null || _classPrivateFieldGet7 === void 0 || _classPrivateFieldGet7.call(this);
14490
- _classPrivateFieldSet2(_cancelFallback, this, void 0);
14491
- _classPrivateFieldSet2(_surfaceReady, this, false);
14492
- _classPrivateFieldSet2(_paintRequested, this, false);
14493
- }
14494
- function _reportUnpainted() {
14495
- const warn = _classPrivateFieldGet2(_warn, this);
14496
- if (!warn) return;
14497
- const groups = groupA2UIOperationsBySurface(_classPrivateFieldGet2(_operations, this));
14498
- for (const [surfaceId, operations] of groups) {
14499
- const message = diagnoseUnpaintedSurface(surfaceId, operations);
14500
- if (message) warn(message);
14501
- }
14502
- }
14503
- function _emit$1() {
14504
- _classPrivateFieldSet2(_snapshot$3, this, _assertClassBrand(_A2UIActivityController_brand, this, _buildSnapshot).call(this));
14505
- for (const listener of _classPrivateFieldGet2(_listeners$8, this)) listener();
14506
- }
14507
- function _buildSnapshot() {
14508
- var _lifecycle$errors$len, _lifecycle$errors;
14509
- const lifecycle = _classPrivateFieldGet2(_lifecycle, this);
14510
- const debugExposure = resolveA2UIDebugExposure(lifecycle, _classPrivateFieldGet2(_debugExposureOption, this));
14511
- const isFailed = lifecycle.status === "failed";
14512
- const hasRetryErrors = lifecycle.status === "retrying" && _classPrivateFieldGet2(_retryRevealed, this) && ((_lifecycle$errors$len = (_lifecycle$errors = lifecycle.errors) === null || _lifecycle$errors === void 0 ? void 0 : _lifecycle$errors.length) !== null && _lifecycle$errors$len !== void 0 ? _lifecycle$errors$len : 0) > 0;
14513
- let view = "surface";
14514
- if (_classPrivateFieldGet2(_operations, this).length === 0) view = "lifecycle";
14515
- else if (!_classPrivateFieldGet2(_surfaceReady, this)) view = "handoff";
14516
- return {
14517
- view,
14518
- operations: _classPrivateFieldGet2(_operations, this),
14519
- lifecycle,
14520
- debugExposure,
14521
- retryRevealed: _classPrivateFieldGet2(_retryRevealed, this),
14522
- label: formatA2UIRetryLabel(lifecycle, _classPrivateFieldGet2(_retryRevealed, this)),
14523
- progressPhase: getA2UIProgressPhase(lifecycle.progressTokens),
14524
- showDebugDetails: debugExposure !== "hidden" && (isFailed || hasRetryErrors),
14525
- debugDetailsOpen: debugExposure === "verbose",
14526
- debugDetailsLabel: isFailed ? A2UI_LIFECYCLE_TEXT.failureDetails : A2UI_LIFECYCLE_TEXT.retryDetails,
14527
- debugPayload: formatA2UIDebugPayload(isFailed ? {
14528
- error: lifecycle.error,
14529
- attempts: lifecycle.attempts
14530
- } : {
14531
- attempt: lifecycle.attempt,
14532
- errors: lifecycle.errors
14533
- })
14534
- };
14535
- }
14536
-
14537
13811
  //#endregion
14538
13812
  //#region src/chat/labels.ts
14539
13813
  /**
@@ -23079,16 +22353,6 @@ exports.props = props;
23079
22353
  exports.segmentSurfaceProse = segmentSurfaceProse;
23080
22354
  exports.select = select;
23081
22355
  exports.splitA2UIMarkdown = splitA2UIMarkdown;
23082
- exports.ɵA2UIActivityController = A2UIActivityController;
23083
- exports.ɵA2UI_DEFAULT_SURFACE_ID = A2UI_DEFAULT_SURFACE_ID;
23084
- exports.ɵA2UI_LIFECYCLE_TEXT = A2UI_LIFECYCLE_TEXT;
23085
- exports.ɵA2UI_OPERATIONS_KEY = A2UI_OPERATIONS_KEY;
23086
- exports.ɵA2UI_PAINT_FALLBACK_MS = A2UI_PAINT_FALLBACK_MS;
23087
- exports.ɵA2UI_RECOVERY_DEFAULTS = A2UI_RECOVERY_DEFAULTS;
23088
- exports.ɵA2UI_ROOT_COMPONENT_ID = A2UI_ROOT_COMPONENT_ID;
23089
- exports.ɵA2UI_SKELETON_ROWS = A2UI_SKELETON_ROWS;
23090
- exports.ɵA2UI_SURFACE_ACTIVITY_TYPE = A2UI_SURFACE_ACTIVITY_TYPE;
23091
- exports.ɵA2UI_SURFACE_CONTENT_SCHEMA = A2UI_SURFACE_CONTENT_SCHEMA;
23092
22356
  exports.ɵALL_AGENT_UPDATES = ɵALL_AGENT_UPDATES;
23093
22357
  exports.ɵAgentResolver = ɵAgentResolver;
23094
22358
  exports.ɵAttachmentQueue = ɵAttachmentQueue;
@@ -23139,7 +22403,6 @@ exports.ɵPOPUP_ANIMATION_MS = ɵPOPUP_ANIMATION_MS;
23139
22403
  exports.ɵPOPUP_DEFAULT_HEIGHT = ɵPOPUP_DEFAULT_HEIGHT;
23140
22404
  exports.ɵPOPUP_DEFAULT_WIDTH = ɵPOPUP_DEFAULT_WIDTH;
23141
22405
  exports.ɵPlaceholderCycler = PlaceholderCycler;
23142
- exports.ɵRENDER_A2UI_TOOL_NAME = RENDER_A2UI_TOOL_NAME;
23143
22406
  exports.ɵRESIZE_SETTLE_MS = ɵRESIZE_SETTLE_MS;
23144
22407
  exports.ɵRUNTIME_PROBE_TIMEOUT_MS = ɵRUNTIME_PROBE_TIMEOUT_MS;
23145
22408
  exports.ɵReasoningDisclosure = ɵReasoningDisclosure;
@@ -23204,9 +22467,6 @@ exports.ɵdecodeTextSource = ɵdecodeTextSource;
23204
22467
  exports.ɵdeduplicateMessages = ɵdeduplicateMessages;
23205
22468
  exports.ɵdescribeActivityRendererFailure = ɵdescribeActivityRendererFailure;
23206
22469
  exports.ɵdescribeUnrenderedToolCalls = ɵdescribeUnrenderedToolCalls;
23207
- exports.ɵdiagnoseMissingSurface = diagnoseMissingSurface;
23208
- exports.ɵdiagnoseUnpaintedSurface = diagnoseUnpaintedSurface;
23209
- exports.ɵdiagnoseUnresolvedRoot = diagnoseUnresolvedRoot;
23210
22470
  exports.ɵdimensionToCss = ɵdimensionToCss;
23211
22471
  exports.ɵdockedSidebarRegistryFor = ɵdockedSidebarRegistryFor;
23212
22472
  exports.ɵduplicateMessagesWarning = ɵduplicateMessagesWarning;
@@ -23219,17 +22479,12 @@ exports.ɵfitTextareaHeight = ɵfitTextareaHeight;
23219
22479
  exports.ɵflattenCommandItems = ɵflattenCommandItems;
23220
22480
  exports.ɵflattenToolsMenuForDisplay = ɵflattenToolsMenuForDisplay;
23221
22481
  exports.ɵflattenUserMessageContent = ɵflattenUserMessageContent;
23222
- exports.ɵformatA2UIDebugPayload = formatA2UIDebugPayload;
23223
- exports.ɵformatA2UIRetryLabel = formatA2UIRetryLabel;
23224
22482
  exports.ɵformatCountLabel = ɵformatCountLabel;
23225
22483
  exports.ɵformatLabel = ɵformatLabel;
23226
22484
  exports.ɵformatReasoningDuration = formatReasoningDuration;
23227
22485
  exports.ɵformatReasoningDurationLabel = ɵformatReasoningDurationLabel;
23228
22486
  exports.ɵformatToolNames = formatToolNames;
23229
22487
  exports.ɵformatWorkDuration = formatWorkDuration;
23230
- exports.ɵgetA2UIOperationSurfaceId = getA2UIOperationSurfaceId;
23231
- exports.ɵgetA2UIOperations = getA2UIOperations;
23232
- exports.ɵgetA2UIProgressPhase = getA2UIProgressPhase;
23233
22488
  exports.ɵgetAgentCapabilities = ɵgetAgentCapabilities;
23234
22489
  exports.ɵgetAgentInterruptState = ɵgetAgentInterruptState;
23235
22490
  exports.ɵgetAgentResolver = ɵgetAgentResolver;
@@ -23259,7 +22514,6 @@ exports.ɵgetUserMessageMediaFilename = ɵgetUserMessageMediaFilename;
23259
22514
  exports.ɵgetUserMessageMediaParts = ɵgetUserMessageMediaParts;
23260
22515
  exports.ɵgetWorkOpenState = getWorkOpenState;
23261
22516
  exports.ɵgetWorkSummaryText = ɵgetWorkSummaryText;
23262
- exports.ɵgroupA2UIOperationsBySurface = groupA2UIOperationsBySurface;
23263
22517
  exports.ɵhasAssistantMessageText = ɵhasAssistantMessageText;
23264
22518
  exports.ɵhitlRenderProps = ɵhitlRenderProps;
23265
22519
  exports.ɵimplementsConnect = ɵimplementsConnect;
@@ -23309,7 +22563,6 @@ exports.ɵpluralize = pluralize;
23309
22563
  exports.ɵprocessPartialHtml = processPartialHtml;
23310
22564
  exports.ɵprojectThread = ɵprojectThread;
23311
22565
  exports.ɵpublicKeyHeaderDefaults = ɵpublicKeyHeaderDefaults;
23312
- exports.ɵreadA2UILifecycle = readA2UILifecycle;
23313
22566
  exports.ɵreadKeyboardState = ɵreadKeyboardState;
23314
22567
  exports.ɵrecordAnnotation = ɵrecordAnnotation;
23315
22568
  exports.ɵrecordWorkTime = recordWorkTime;
@@ -23318,8 +22571,6 @@ exports.ɵreportProviderConfigDiagnostics = ɵreportProviderConfigDiagnostics;
23318
22571
  exports.ɵreserveLicenseBannerOffset = ɵreserveLicenseBannerOffset;
23319
22572
  exports.ɵresetAgentThreadBaseline = ɵresetAgentThreadBaseline;
23320
22573
  exports.ɵresetMessageFeedbackCache = ɵresetMessageFeedbackCache;
23321
- exports.ɵresolveA2UIActivation = ɵresolveA2UIActivation;
23322
- exports.ɵresolveA2UIDebugExposure = resolveA2UIDebugExposure;
23323
22574
  exports.ɵresolveActivityRenderer = ɵresolveActivityRenderer;
23324
22575
  exports.ɵresolveAgentId = ɵresolveAgentId;
23325
22576
  exports.ɵresolveAgentThreadId = ɵresolveAgentThreadId;
@@ -23327,6 +22578,7 @@ exports.ɵresolveChatNotice = ɵresolveChatNotice;
23327
22578
  exports.ɵresolveComposerKey = ɵresolveComposerKey;
23328
22579
  exports.ɵresolveCustomMessageRenderContext = ɵresolveCustomMessageRenderContext;
23329
22580
  exports.ɵresolveCustomMessageRenderers = ɵresolveCustomMessageRenderers;
22581
+ exports.ɵresolveGenerativeUIDefault = ɵresolveGenerativeUIDefault;
23330
22582
  exports.ɵresolveLicenseState = ɵresolveLicenseState;
23331
22583
  exports.ɵresolveProviderConfig = ɵresolveProviderConfig;
23332
22584
  exports.ɵresolveSlashKey = ɵresolveSlashKey;
@@ -23334,7 +22586,6 @@ exports.ɵresolveThreadsLicense = ɵresolveThreadsLicense;
23334
22586
  exports.ɵresolveToolCallAgentId = ɵresolveToolCallAgentId;
23335
22587
  exports.ɵresolveToolCallRenderer = ɵresolveToolCallRenderer;
23336
22588
  exports.ɵrmsAmplitude = ɵrmsAmplitude;
23337
- exports.ɵrunA2UIAction = runA2UIAction;
23338
22589
  exports.ɵselectFetchMoreError = ɵselectFetchMoreError;
23339
22590
  exports.ɵselectHasNextPage = ɵselectHasNextPage;
23340
22591
  exports.ɵselectIsFetchingNextPage = ɵselectIsFetchingNextPage;
@@ -23364,10 +22615,8 @@ exports.ɵsubscribeToAgentSuggestions = ɵsubscribeToAgentSuggestions;
23364
22615
  exports.ɵsubscribeToAgentUpdates = ɵsubscribeToAgentUpdates;
23365
22616
  exports.ɵsubscribeToLearningFeedbackEnabled = ɵsubscribeToLearningFeedbackEnabled;
23366
22617
  exports.ɵsubscribeToMessageFeedback = ɵsubscribeToMessageFeedback;
23367
- exports.ɵsurfaceHasRenderableContent = surfaceHasRenderableContent;
23368
22618
  exports.ɵsyncRecorderToMode = ɵsyncRecorderToMode;
23369
22619
  exports.ɵthreadAdapterEvents = ɵthreadAdapterEvents;
23370
- exports.ɵtoA2UIClientEvent = toA2UIClientEvent;
23371
22620
  exports.ɵtoDefaultToolCallStatus = ɵtoDefaultToolCallStatus;
23372
22621
  exports.ɵtoDrawerThread = ɵtoDrawerThread;
23373
22622
  exports.ɵtoLearningConfig = ɵtoLearningConfig;