@copilotkit/core 2.0.0-rc.42 → 2.0.0-rc.44
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/chat-configuration.d.cts +1 -1
- package/dist/chat-configuration.d.mts +1 -1
- package/dist/generative-ui/index.cjs +325 -13
- package/dist/generative-ui/index.cjs.map +1 -1
- package/dist/generative-ui/index.d.cts +106 -8
- package/dist/generative-ui/index.d.cts.map +1 -1
- package/dist/generative-ui/index.d.mts +106 -8
- package/dist/generative-ui/index.d.mts.map +1 -1
- package/dist/generative-ui/index.mjs +323 -11
- package/dist/generative-ui/index.mjs.map +1 -1
- package/dist/index.cjs +58 -792
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +58 -767
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +137 -911
- package/dist/index.umd.js.map +1 -1
- package/dist/{learning-bridge-DNdPfyx2.d.mts → learning-bridge-DbE4J5tK.d.mts} +64 -460
- package/dist/learning-bridge-DbE4J5tK.d.mts.map +1 -0
- package/dist/{learning-bridge-DkOdyUdA.d.cts → learning-bridge-jOC46U9n.d.cts} +64 -460
- package/dist/learning-bridge-jOC46U9n.d.cts.map +1 -0
- package/dist/styles.cjs +1 -1
- package/dist/styles.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.mjs +1 -1
- package/dist/styles.mjs.map +1 -1
- package/package.json +3 -4
- package/tsdown.config.ts +0 -4
- package/dist/learning-bridge-DNdPfyx2.d.mts.map +0 -1
- package/dist/learning-bridge-DkOdyUdA.d.cts.map +0 -1
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, "
|
|
2249
|
-
_defineProperty(this, "
|
|
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
|
-
|
|
2305
|
-
|
|
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
|
|
2309
|
-
*
|
|
2309
|
+
* Agent ids the runtime limits generative UI to. `undefined` means every
|
|
2310
|
+
* agent, or off; check `generativeUIEnabled`.
|
|
2310
2311
|
*/
|
|
2311
|
-
get
|
|
2312
|
-
return this.
|
|
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.
|
|
3088
|
-
this.
|
|
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,
|
|
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
|
|
3169
|
-
this.
|
|
3170
|
-
this.
|
|
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.
|
|
3202
|
-
this.
|
|
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$
|
|
4066
|
-
if (((_classPrivateFieldGet2$
|
|
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
|
-
|
|
8260
|
-
|
|
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
|
-
|
|
8551
|
-
|
|
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
|
|
8555
|
-
*
|
|
8556
|
+
* Agent ids the runtime limits generative UI to. `undefined` means every
|
|
8557
|
+
* agent (or off; check `generativeUIEnabled`).
|
|
8556
8558
|
*/
|
|
8557
|
-
get
|
|
8558
|
-
return this.agentRegistry.
|
|
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$
|
|
9483
|
-
(_classPrivateFieldGet2$
|
|
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$
|
|
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$
|
|
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$
|
|
9606
|
+
_classPrivateFieldGet2(_listeners$10, this).add(listener);
|
|
9605
9607
|
return () => {
|
|
9606
|
-
_classPrivateFieldGet2(_listeners$
|
|
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$
|
|
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$
|
|
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
|
|
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
|
|
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: "
|
|
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$
|
|
10132
|
-
var _snapshot$
|
|
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
|
|
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$
|
|
10159
|
-
_classPrivateFieldInitSpec(this, _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
|
|
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$
|
|
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$
|
|
10179
|
+
_classPrivateFieldGet2(_listeners$9, this).add(listener);
|
|
10178
10180
|
return () => {
|
|
10179
|
-
_classPrivateFieldGet2(_listeners$
|
|
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$
|
|
10226
|
+
var _classPrivateFieldGet2$10, _agent$pendingInterru2;
|
|
10225
10227
|
if (agent === _classPrivateFieldGet2(_agent, this)) return;
|
|
10226
|
-
(_classPrivateFieldGet2$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
10380
|
-
const generation = _classPrivateFieldGet2(_generation
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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
|
|
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
|
|
11149
|
-
* its
|
|
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
|
-
*
|
|
11152
|
-
*
|
|
11153
|
-
*
|
|
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
|
-
*
|
|
11158
|
-
*
|
|
11159
|
-
*
|
|
11160
|
-
*
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
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:
|
|
11169
|
-
|
|
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
|
|
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
|
-
*
|
|
11181
|
-
* builtIns: [mcpAppsRenderer, openGenUIActive && openGenUIRenderer],
|
|
11180
|
+
* * builtIns: [mcpAppsRenderer, openGenUIActive && openGenUIRenderer],
|
|
11182
11181
|
* });
|
|
11183
11182
|
*/
|
|
11184
|
-
function ɵassembleActivityRenderers({ app = [],
|
|
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$
|
|
12300
|
-
var _listeners$
|
|
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$
|
|
12324
|
-
_classPrivateFieldInitSpec(this, _listeners$
|
|
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$
|
|
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$
|
|
12338
|
-
if (_classPrivateFieldGet2(_listeners$
|
|
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$
|
|
12341
|
-
if (_classPrivateFieldGet2(_listeners$
|
|
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$
|
|
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$
|
|
12413
|
-
(_classPrivateFieldGet2$
|
|
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$
|
|
12436
|
+
_classPrivateFieldSet2(_snapshot$3, this, next ? {
|
|
12439
12437
|
threadId: next.threadId,
|
|
12440
12438
|
requestId: next.requestId
|
|
12441
12439
|
} : null);
|
|
12442
|
-
const listeners = [..._classPrivateFieldGet2(_listeners$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
13173
|
-
const body = isRecord$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
13528
|
-
if (!update.components.some((c) => isRecord$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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,753 +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
|
-
* The component definitions an operation carries: those of an
|
|
13910
|
-
* `updateComponents`, or those a native (A2UI 1.0) `createSurface` carries
|
|
13911
|
-
* inline.
|
|
13912
|
-
*
|
|
13913
|
-
* @param operation - One A2UI operation.
|
|
13914
|
-
*/
|
|
13915
|
-
function getA2UIOperationComponents(operation) {
|
|
13916
|
-
const update = operation.updateComponents;
|
|
13917
|
-
const create = operation.createSurface;
|
|
13918
|
-
const components = isRecord$1(update) ? update.components : operation.version === "1.0" && isRecord$1(create) ? create.components : void 0;
|
|
13919
|
-
return Array.isArray(components) ? components : [];
|
|
13920
|
-
}
|
|
13921
|
-
/**
|
|
13922
|
-
* Whether operations are enough to paint a visible card yet. A data-bound
|
|
13923
|
-
* surface addresses its values by `path` (`@path` in A2UI 1.0) and draws
|
|
13924
|
-
* nothing until a data model update, or a native create's inline data model,
|
|
13925
|
-
* carries a non-empty value; a static surface paints from its components
|
|
13926
|
-
* alone. Times the loader → surface hand-off to real content rather than a
|
|
13927
|
-
* fixed delay (OSS-162).
|
|
13928
|
-
*
|
|
13929
|
-
* @param operations - The operations of one surface or of a whole activity.
|
|
13930
|
-
*/
|
|
13931
|
-
function surfaceHasRenderableContent(operations) {
|
|
13932
|
-
const components = operations.flatMap(getA2UIOperationComponents);
|
|
13933
|
-
if (components.length === 0) return false;
|
|
13934
|
-
const serialized = JSON.stringify(components);
|
|
13935
|
-
if (!(serialized.includes("\"path\"") || serialized.includes("\"@path\""))) return true;
|
|
13936
|
-
return operations.some((operation) => {
|
|
13937
|
-
var _update$value;
|
|
13938
|
-
const update = isRecord$1(operation.updateDataModel) ? operation.updateDataModel : void 0;
|
|
13939
|
-
const create = operation.createSurface;
|
|
13940
|
-
const value = (_update$value = update === null || update === void 0 ? void 0 : update.value) !== null && _update$value !== void 0 ? _update$value : operation.version === "1.0" && isRecord$1(create) ? create.dataModel : void 0;
|
|
13941
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
13942
|
-
const path = typeof (update === null || update === void 0 ? void 0 : update.path) === "string" ? update.path : "/";
|
|
13943
|
-
const key = operation.version === "1.0" ? "@path" : "path";
|
|
13944
|
-
return value !== "" && serialized.includes(JSON.stringify({ [key]: path }));
|
|
13945
|
-
}
|
|
13946
|
-
if (typeof value !== "object" || value === null) return false;
|
|
13947
|
-
return Object.values(value).some(hasValue);
|
|
13948
|
-
});
|
|
13949
|
-
}
|
|
13950
|
-
|
|
13951
|
-
//#endregion
|
|
13952
|
-
//#region src/a2ui/diagnostics.ts
|
|
13953
|
-
/**
|
|
13954
|
-
* How long a surface may take to report its first paint before the loader
|
|
13955
|
-
* hand-off gives up and shows it anyway. Reaching it with no paint is also the
|
|
13956
|
-
* moment the unpainted and unresolved-root diagnostics fire.
|
|
13957
|
-
*/
|
|
13958
|
-
const A2UI_PAINT_FALLBACK_MS = 8e3;
|
|
13959
|
-
/** The operation kinds a surface received, comma-separated, or "none". */
|
|
13960
|
-
function describeOperationKinds(operations) {
|
|
13961
|
-
const kinds = /* @__PURE__ */ new Set();
|
|
13962
|
-
for (const operation of operations) for (const key of Object.keys(operation)) if (key !== "version") kinds.add(key);
|
|
13963
|
-
return kinds.size === 0 ? "none" : Array.from(kinds).join(", ");
|
|
13964
|
-
}
|
|
13965
|
-
function componentLists(operations) {
|
|
13966
|
-
const lists = [];
|
|
13967
|
-
for (const operation of operations) {
|
|
13968
|
-
const components = getA2UIOperationComponents(operation);
|
|
13969
|
-
if (components.length > 0) lists.push(components);
|
|
13970
|
-
}
|
|
13971
|
-
return lists;
|
|
13972
|
-
}
|
|
13973
|
-
/** The component ids a surface was sent, quoted and comma-separated, or "none". */
|
|
13974
|
-
function describeComponentIds(operations) {
|
|
13975
|
-
const ids = [];
|
|
13976
|
-
const lists = componentLists(operations);
|
|
13977
|
-
for (const components of lists) for (const component of components) {
|
|
13978
|
-
const id = isRecord$1(component) ? component.id : void 0;
|
|
13979
|
-
if (typeof id === "string" && !ids.includes(id)) ids.push(id);
|
|
13980
|
-
}
|
|
13981
|
-
return ids.length === 0 ? "none" : ids.map((id) => `"${id}"`).join(", ");
|
|
13982
|
-
}
|
|
13983
|
-
/**
|
|
13984
|
-
* Explains why a surface that received operations never painted, or returns
|
|
13985
|
-
* null when its operations are enough to paint.
|
|
13986
|
-
*
|
|
13987
|
-
* Reaching {@link A2UI_PAINT_FALLBACK_MS} with no paint means the operations
|
|
13988
|
-
* were accepted and still put nothing on screen. Left alone that is
|
|
13989
|
-
* invisible, so the message says which half is missing.
|
|
13990
|
-
*
|
|
13991
|
-
* @param surfaceId - The surface the operations address.
|
|
13992
|
-
* @param operations - The operations grouped under that surface.
|
|
13993
|
-
*/
|
|
13994
|
-
function diagnoseUnpaintedSurface(surfaceId, operations) {
|
|
13995
|
-
if (surfaceHasRenderableContent(operations)) return null;
|
|
13996
|
-
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";
|
|
13997
|
-
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.`;
|
|
13998
|
-
}
|
|
13999
|
-
/**
|
|
14000
|
-
* Explains a surface that never got created although operations addressed
|
|
14001
|
-
* it. The usual cause is operations sent to one surface id while the surface
|
|
14002
|
-
* was created under another, or operations that were all dropped as invalid.
|
|
14003
|
-
*
|
|
14004
|
-
* @param surfaceId - The surface the operations address.
|
|
14005
|
-
* @param operations - The operations processed for that surface.
|
|
14006
|
-
*/
|
|
14007
|
-
function diagnoseMissingSurface(surfaceId, operations) {
|
|
14008
|
-
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.`;
|
|
14009
|
-
}
|
|
14010
|
-
/**
|
|
14011
|
-
* Explains a surface still waiting for its root component once operations
|
|
14012
|
-
* have stopped arriving, or returns null when the root resolved (or when no
|
|
14013
|
-
* components arrived at all, which {@link diagnoseUnpaintedSurface} explains
|
|
14014
|
-
* better).
|
|
14015
|
-
*
|
|
14016
|
-
* Renderers begin walking a surface at the root id and treat an id they cannot
|
|
14017
|
-
* find as not arrived yet, so a payload without it animates a placeholder
|
|
14018
|
-
* forever while every other check calls it healthy. Reads the live components
|
|
14019
|
-
* model, so it covers every way the root can fail to resolve.
|
|
14020
|
-
*
|
|
14021
|
-
* @param surfaceId - The surface the operations address.
|
|
14022
|
-
* @param operations - The operations processed for that surface.
|
|
14023
|
-
* @param surface - The live surface model.
|
|
14024
|
-
*/
|
|
14025
|
-
function diagnoseUnresolvedRoot(surfaceId, operations, surface) {
|
|
14026
|
-
if (surface.componentsModel.get(A2UI_ROOT_COMPONENT_ID)) return null;
|
|
14027
|
-
const lists = componentLists(operations);
|
|
14028
|
-
if (lists.length === 0) return null;
|
|
14029
|
-
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`;
|
|
14030
|
-
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.`;
|
|
14031
|
-
}
|
|
14032
|
-
|
|
14033
|
-
//#endregion
|
|
14034
|
-
//#region src/a2ui/actions.ts
|
|
14035
|
-
/**
|
|
14036
|
-
* Wraps a raw processor action in the client-event envelope the runtimes read,
|
|
14037
|
-
* filling the fields a partial action leaves out. Other fields the action
|
|
14038
|
-
* carries, such as a native action's `userMessage`, are kept.
|
|
14039
|
-
*
|
|
14040
|
-
* @param action - What the `MessageProcessor` action handler received.
|
|
14041
|
-
*/
|
|
14042
|
-
function toA2UIClientEvent(action) {
|
|
14043
|
-
var _action$name, _action$surfaceId, _action$sourceCompone, _action$timestamp;
|
|
14044
|
-
return { userAction: {
|
|
14045
|
-
...action,
|
|
14046
|
-
name: (_action$name = action.name) !== null && _action$name !== void 0 ? _action$name : "unknown",
|
|
14047
|
-
surfaceId: (_action$surfaceId = action.surfaceId) !== null && _action$surfaceId !== void 0 ? _action$surfaceId : A2UI_DEFAULT_SURFACE_ID,
|
|
14048
|
-
sourceComponentId: (_action$sourceCompone = action.sourceComponentId) !== null && _action$sourceCompone !== void 0 ? _action$sourceCompone : "",
|
|
14049
|
-
context: action.context,
|
|
14050
|
-
timestamp: (_action$timestamp = action.timestamp) !== null && _action$timestamp !== void 0 ? _action$timestamp : (/* @__PURE__ */ new Date()).toISOString()
|
|
14051
|
-
} };
|
|
14052
|
-
}
|
|
14053
|
-
/**
|
|
14054
|
-
* Sends one A2UI user action to the agent: runs the optional `onAction`
|
|
14055
|
-
* interceptor first, then sets the `a2uiAction` run property and runs the
|
|
14056
|
-
* agent unless the interceptor suppressed it (returned `null`). The
|
|
14057
|
-
* `a2uiAction` property is always removed afterwards so it does not leak into
|
|
14058
|
-
* later runs.
|
|
14059
|
-
*
|
|
14060
|
-
* Does nothing when there is no agent (a surface rendered outside a chat).
|
|
14061
|
-
*
|
|
14062
|
-
* @example
|
|
14063
|
-
* ```ts
|
|
14064
|
-
* new MessageProcessor([catalog], (action) =>
|
|
14065
|
-
* ɵrunA2UIAction({ message: ɵtoA2UIClientEvent(action), agent, core }),
|
|
14066
|
-
* );
|
|
14067
|
-
* ```
|
|
14068
|
-
*/
|
|
14069
|
-
async function runA2UIAction({ message, agent, core, onAction }) {
|
|
14070
|
-
if (!agent) return;
|
|
14071
|
-
const forward = async (forwardAction) => {
|
|
14072
|
-
const a2uiAction = forwardAction === void 0 ? message : {
|
|
14073
|
-
...message,
|
|
14074
|
-
userAction: forwardAction
|
|
14075
|
-
};
|
|
14076
|
-
try {
|
|
14077
|
-
core.setProperties({
|
|
14078
|
-
...core.properties,
|
|
14079
|
-
a2uiAction
|
|
14080
|
-
});
|
|
14081
|
-
await core.runAgent({ agent });
|
|
14082
|
-
} finally {
|
|
14083
|
-
const { a2uiAction: _removed, ...rest } = core.properties;
|
|
14084
|
-
core.setProperties(rest);
|
|
14085
|
-
}
|
|
14086
|
-
};
|
|
14087
|
-
if (onAction) {
|
|
14088
|
-
const result = await onAction(message.userAction, forward);
|
|
14089
|
-
if (result === null) return;
|
|
14090
|
-
if (result) {
|
|
14091
|
-
await forward(result);
|
|
14092
|
-
return;
|
|
14093
|
-
}
|
|
14094
|
-
}
|
|
14095
|
-
await forward();
|
|
14096
|
-
}
|
|
14097
|
-
|
|
14098
|
-
//#endregion
|
|
14099
|
-
//#region src/a2ui/lifecycle.ts
|
|
14100
|
-
const A2UI_RECOVERY_DEFAULTS = {
|
|
14101
|
-
showAfterMs: 2e3,
|
|
14102
|
-
showAfterAttempts: 2,
|
|
14103
|
-
debugExposure: "collapsed",
|
|
14104
|
-
paintFallbackMs: A2UI_PAINT_FALLBACK_MS
|
|
14105
|
-
};
|
|
14106
|
-
/** User-visible text of the lifecycle states. */
|
|
14107
|
-
const A2UI_LIFECYCLE_TEXT = {
|
|
14108
|
-
building: "Building interface",
|
|
14109
|
-
retrying: "Retrying generation…",
|
|
14110
|
-
failureTitle: "Couldn't generate the UI",
|
|
14111
|
-
failureDescription: "Something went wrong rendering this. You can keep chatting and try again.",
|
|
14112
|
-
failureDetails: "developer details",
|
|
14113
|
-
retryDetails: "validation issues"
|
|
14114
|
-
};
|
|
14115
|
-
function isDebugExposure(value) {
|
|
14116
|
-
return value === "hidden" || value === "collapsed" || value === "verbose";
|
|
14117
|
-
}
|
|
14118
|
-
function numberOrUndefined(value) {
|
|
14119
|
-
return typeof value === "number" ? value : void 0;
|
|
14120
|
-
}
|
|
14121
|
-
function arrayOrUndefined(value) {
|
|
14122
|
-
return Array.isArray(value) ? value : void 0;
|
|
14123
|
-
}
|
|
14124
|
-
/**
|
|
14125
|
-
* Reads the lifecycle fields from activity content. An unknown or missing
|
|
14126
|
-
* `status` reads as "building"; fields of the wrong type are left out.
|
|
14127
|
-
*
|
|
14128
|
-
* @param content - `a2ui-surface` activity content, of any shape.
|
|
14129
|
-
*/
|
|
14130
|
-
function readA2UILifecycle(content) {
|
|
14131
|
-
if (!isRecord$1(content)) return { status: "building" };
|
|
14132
|
-
return {
|
|
14133
|
-
status: content.status === "retrying" || content.status === "failed" ? content.status : "building",
|
|
14134
|
-
attempt: numberOrUndefined(content.attempt),
|
|
14135
|
-
maxAttempts: numberOrUndefined(content.maxAttempts),
|
|
14136
|
-
progressTokens: numberOrUndefined(content.progressTokens),
|
|
14137
|
-
error: typeof content.error === "string" ? content.error : void 0,
|
|
14138
|
-
errors: arrayOrUndefined(content.errors),
|
|
14139
|
-
attempts: arrayOrUndefined(content.attempts),
|
|
14140
|
-
debugExposure: isDebugExposure(content.debugExposure) ? content.debugExposure : void 0
|
|
14141
|
-
};
|
|
14142
|
-
}
|
|
14143
|
-
/**
|
|
14144
|
-
* Validates `a2ui-surface` activity content for activity renderer
|
|
14145
|
-
* registration. Any object passes: {@link readA2UILifecycle} and
|
|
14146
|
-
* `getA2UIOperations` read the fields and ignore mistyped ones, so a field
|
|
14147
|
-
* a newer middleware adds can never hide the surface.
|
|
14148
|
-
*/
|
|
14149
|
-
const A2UI_SURFACE_CONTENT_SCHEMA = { "~standard": {
|
|
14150
|
-
version: 1,
|
|
14151
|
-
vendor: "copilotkit",
|
|
14152
|
-
validate: (value) => isRecord$1(value) ? { value } : { issues: [{ message: "a2ui-surface content must be an object" }] }
|
|
14153
|
-
} };
|
|
14154
|
-
/**
|
|
14155
|
-
* The debug exposure to use: the server-stamped one wins, then the client
|
|
14156
|
-
* option, then "collapsed".
|
|
14157
|
-
*/
|
|
14158
|
-
function resolveA2UIDebugExposure(lifecycle, option) {
|
|
14159
|
-
var _ref, _lifecycle$debugExpos;
|
|
14160
|
-
return (_ref = (_lifecycle$debugExpos = lifecycle.debugExposure) !== null && _lifecycle$debugExpos !== void 0 ? _lifecycle$debugExpos : option) !== null && _ref !== void 0 ? _ref : A2UI_RECOVERY_DEFAULTS.debugExposure;
|
|
14161
|
-
}
|
|
14162
|
-
/**
|
|
14163
|
-
* How much of the skeleton to reveal for an estimated token count. With no
|
|
14164
|
-
* count yet the full skeleton shows rather than an empty box.
|
|
14165
|
-
*
|
|
14166
|
-
* @param tokens - The streamed token estimate, if the server sent one.
|
|
14167
|
-
*/
|
|
14168
|
-
function getA2UIProgressPhase(tokens) {
|
|
14169
|
-
let phase = 3;
|
|
14170
|
-
if (tokens === void 0) return phase;
|
|
14171
|
-
if (tokens < 50) phase = 0;
|
|
14172
|
-
else if (tokens < 200) phase = 1;
|
|
14173
|
-
else if (tokens < 400) phase = 2;
|
|
14174
|
-
return phase;
|
|
14175
|
-
}
|
|
14176
|
-
/**
|
|
14177
|
-
* The label under the skeleton: "Building interface" until a retry is
|
|
14178
|
-
* revealed, then "Retrying generation…", with the attempt count when known.
|
|
14179
|
-
*/
|
|
14180
|
-
function formatA2UIRetryLabel(lifecycle, retryRevealed) {
|
|
14181
|
-
if (lifecycle.status !== "retrying" || !retryRevealed) return A2UI_LIFECYCLE_TEXT.building;
|
|
14182
|
-
const { attempt, maxAttempts } = lifecycle;
|
|
14183
|
-
if (attempt === void 0 || maxAttempts === void 0) return A2UI_LIFECYCLE_TEXT.retrying;
|
|
14184
|
-
return `${A2UI_LIFECYCLE_TEXT.retrying} (${String(attempt)}/${String(maxAttempts)} attempts)`;
|
|
14185
|
-
}
|
|
14186
|
-
/**
|
|
14187
|
-
* Serializes a debug payload for display. Never throws: circular references,
|
|
14188
|
-
* functions, bigints and symbols get placeholder text.
|
|
14189
|
-
*/
|
|
14190
|
-
function formatA2UIDebugPayload(value) {
|
|
14191
|
-
if (typeof value === "string") return value;
|
|
14192
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
14193
|
-
try {
|
|
14194
|
-
const serialized = JSON.stringify(value, (_key, candidate) => {
|
|
14195
|
-
if (typeof candidate === "bigint") return `${candidate.toString()}n`;
|
|
14196
|
-
if (typeof candidate === "function") return "[Function]";
|
|
14197
|
-
if (typeof candidate === "symbol") return candidate.toString();
|
|
14198
|
-
if (typeof candidate === "object" && candidate !== null) {
|
|
14199
|
-
if (seen.has(candidate)) return "[Circular]";
|
|
14200
|
-
seen.add(candidate);
|
|
14201
|
-
}
|
|
14202
|
-
return candidate;
|
|
14203
|
-
}, 2);
|
|
14204
|
-
return serialized !== null && serialized !== void 0 ? serialized : String(value);
|
|
14205
|
-
} catch (_unused) {
|
|
14206
|
-
return "[Unserializable value]";
|
|
14207
|
-
}
|
|
14208
|
-
}
|
|
14209
|
-
/** The skeleton rows; each row shows once the progress phase reaches `phase`. */
|
|
14210
|
-
const A2UI_SKELETON_ROWS = [
|
|
14211
|
-
{
|
|
14212
|
-
phase: 0,
|
|
14213
|
-
delay: 0,
|
|
14214
|
-
parts: [{
|
|
14215
|
-
w: 36,
|
|
14216
|
-
bg: "rgba(147,197,253,0.7)",
|
|
14217
|
-
anim: 0
|
|
14218
|
-
}, {
|
|
14219
|
-
w: 80,
|
|
14220
|
-
bg: "rgba(219,234,254,0.8)",
|
|
14221
|
-
anim: .2
|
|
14222
|
-
}]
|
|
14223
|
-
},
|
|
14224
|
-
{
|
|
14225
|
-
phase: 0,
|
|
14226
|
-
delay: .1,
|
|
14227
|
-
parts: [
|
|
14228
|
-
"spacer",
|
|
14229
|
-
"dot",
|
|
14230
|
-
{
|
|
14231
|
-
w: 100,
|
|
14232
|
-
bg: "rgba(24,24,27,0.2)",
|
|
14233
|
-
anim: .3
|
|
14234
|
-
}
|
|
14235
|
-
]
|
|
14236
|
-
},
|
|
14237
|
-
{
|
|
14238
|
-
phase: 1,
|
|
14239
|
-
delay: .15,
|
|
14240
|
-
parts: [
|
|
14241
|
-
"spacer",
|
|
14242
|
-
{
|
|
14243
|
-
w: 48,
|
|
14244
|
-
bg: "rgba(24,24,27,0.15)",
|
|
14245
|
-
anim: .1
|
|
14246
|
-
},
|
|
14247
|
-
{
|
|
14248
|
-
w: 40,
|
|
14249
|
-
bg: "rgba(153,246,228,0.6)",
|
|
14250
|
-
anim: .5
|
|
14251
|
-
},
|
|
14252
|
-
{
|
|
14253
|
-
w: 56,
|
|
14254
|
-
bg: "rgba(147,197,253,0.6)",
|
|
14255
|
-
anim: .3
|
|
14256
|
-
}
|
|
14257
|
-
]
|
|
14258
|
-
},
|
|
14259
|
-
{
|
|
14260
|
-
phase: 1,
|
|
14261
|
-
delay: .2,
|
|
14262
|
-
parts: [
|
|
14263
|
-
"spacer",
|
|
14264
|
-
"dot",
|
|
14265
|
-
{
|
|
14266
|
-
w: 60,
|
|
14267
|
-
bg: "rgba(24,24,27,0.15)",
|
|
14268
|
-
anim: .4
|
|
14269
|
-
}
|
|
14270
|
-
]
|
|
14271
|
-
},
|
|
14272
|
-
{
|
|
14273
|
-
phase: 2,
|
|
14274
|
-
delay: .25,
|
|
14275
|
-
parts: [
|
|
14276
|
-
{
|
|
14277
|
-
w: 40,
|
|
14278
|
-
bg: "rgba(153,246,228,0.5)",
|
|
14279
|
-
anim: .2
|
|
14280
|
-
},
|
|
14281
|
-
"dot",
|
|
14282
|
-
{
|
|
14283
|
-
w: 48,
|
|
14284
|
-
bg: "rgba(24,24,27,0.15)",
|
|
14285
|
-
anim: .6
|
|
14286
|
-
},
|
|
14287
|
-
{
|
|
14288
|
-
w: 64,
|
|
14289
|
-
bg: "rgba(147,197,253,0.5)",
|
|
14290
|
-
anim: .1
|
|
14291
|
-
}
|
|
14292
|
-
]
|
|
14293
|
-
},
|
|
14294
|
-
{
|
|
14295
|
-
phase: 2,
|
|
14296
|
-
delay: .3,
|
|
14297
|
-
parts: [{
|
|
14298
|
-
w: 36,
|
|
14299
|
-
bg: "rgba(147,197,253,0.6)",
|
|
14300
|
-
anim: .5
|
|
14301
|
-
}, {
|
|
14302
|
-
w: 36,
|
|
14303
|
-
bg: "rgba(24,24,27,0.12)",
|
|
14304
|
-
anim: .7
|
|
14305
|
-
}]
|
|
14306
|
-
},
|
|
14307
|
-
{
|
|
14308
|
-
phase: 3,
|
|
14309
|
-
delay: .35,
|
|
14310
|
-
parts: [
|
|
14311
|
-
"dot",
|
|
14312
|
-
{
|
|
14313
|
-
w: 44,
|
|
14314
|
-
bg: "rgba(24,24,27,0.18)",
|
|
14315
|
-
anim: .3
|
|
14316
|
-
},
|
|
14317
|
-
"dot",
|
|
14318
|
-
{
|
|
14319
|
-
w: 56,
|
|
14320
|
-
bg: "rgba(153,246,228,0.5)",
|
|
14321
|
-
anim: .8
|
|
14322
|
-
},
|
|
14323
|
-
{
|
|
14324
|
-
w: 48,
|
|
14325
|
-
bg: "rgba(147,197,253,0.5)",
|
|
14326
|
-
anim: .4
|
|
14327
|
-
}
|
|
14328
|
-
]
|
|
14329
|
-
}
|
|
14330
|
-
];
|
|
14331
|
-
const defaultSchedule = (callback, ms) => {
|
|
14332
|
-
const handle = setTimeout(callback, ms);
|
|
14333
|
-
return () => clearTimeout(handle);
|
|
14334
|
-
};
|
|
14335
|
-
function defaultRequestFrame(callback) {
|
|
14336
|
-
if (typeof globalThis.requestAnimationFrame === "function") globalThis.requestAnimationFrame(() => callback());
|
|
14337
|
-
else callback();
|
|
14338
|
-
}
|
|
14339
|
-
const BUILDING = { status: "building" };
|
|
14340
|
-
var _listeners$8 = /* @__PURE__ */ new WeakMap();
|
|
14341
|
-
var _showAfterMs = /* @__PURE__ */ new WeakMap();
|
|
14342
|
-
var _showAfterAttempts = /* @__PURE__ */ new WeakMap();
|
|
14343
|
-
var _debugExposureOption = /* @__PURE__ */ new WeakMap();
|
|
14344
|
-
var _warn = /* @__PURE__ */ new WeakMap();
|
|
14345
|
-
var _schedule = /* @__PURE__ */ new WeakMap();
|
|
14346
|
-
var _requestFrame = /* @__PURE__ */ new WeakMap();
|
|
14347
|
-
var _content$1 = /* @__PURE__ */ new WeakMap();
|
|
14348
|
-
var _operations = /* @__PURE__ */ new WeakMap();
|
|
14349
|
-
var _lifecycle = /* @__PURE__ */ new WeakMap();
|
|
14350
|
-
var _retryRevealed = /* @__PURE__ */ new WeakMap();
|
|
14351
|
-
var _cancelRetryTimer = /* @__PURE__ */ new WeakMap();
|
|
14352
|
-
var _surfaceReady = /* @__PURE__ */ new WeakMap();
|
|
14353
|
-
var _paintRequested = /* @__PURE__ */ new WeakMap();
|
|
14354
|
-
var _cancelFallback = /* @__PURE__ */ new WeakMap();
|
|
14355
|
-
var _generation = /* @__PURE__ */ new WeakMap();
|
|
14356
|
-
var _snapshot$3 = /* @__PURE__ */ new WeakMap();
|
|
14357
|
-
var _A2UIActivityController_brand = /* @__PURE__ */ new WeakSet();
|
|
14358
|
-
/**
|
|
14359
|
-
* Drives what an `a2ui-surface` activity shows: the lifecycle state before
|
|
14360
|
-
* paint, the hand-off while the surface paints hidden, then the surface.
|
|
14361
|
-
*
|
|
14362
|
-
* Give it each content snapshot with `setContent()`, and call `markRendered()`
|
|
14363
|
-
* every time the surface applied operations. A surface counts as painted once
|
|
14364
|
-
* its operations are renderable (see `surfaceHasRenderableContent`) and a
|
|
14365
|
-
* frame has passed; if that never happens the hand-off ends after 8 s anyway
|
|
14366
|
-
* and `warn` reports why.
|
|
14367
|
-
*
|
|
14368
|
-
* @example
|
|
14369
|
-
* ```ts
|
|
14370
|
-
* const controller = new ɵA2UIActivityController({ recovery });
|
|
14371
|
-
* controller.subscribe(() => render(controller.getSnapshot()));
|
|
14372
|
-
* controller.setContent(content);
|
|
14373
|
-
* // after the surface processed operations:
|
|
14374
|
-
* controller.markRendered();
|
|
14375
|
-
* // on unmount:
|
|
14376
|
-
* controller.dispose();
|
|
14377
|
-
* ```
|
|
14378
|
-
*/
|
|
14379
|
-
var A2UIActivityController = class {
|
|
14380
|
-
constructor(options = {}) {
|
|
14381
|
-
var _options$recovery, _recovery$showAfterMs, _recovery$showAfterAt, _options$schedule, _options$requestFrame;
|
|
14382
|
-
_classPrivateMethodInitSpec(this, _A2UIActivityController_brand);
|
|
14383
|
-
_classPrivateFieldInitSpec(this, _listeners$8, /* @__PURE__ */ new Set());
|
|
14384
|
-
_classPrivateFieldInitSpec(this, _showAfterMs, void 0);
|
|
14385
|
-
_classPrivateFieldInitSpec(this, _showAfterAttempts, void 0);
|
|
14386
|
-
_classPrivateFieldInitSpec(this, _debugExposureOption, void 0);
|
|
14387
|
-
_classPrivateFieldInitSpec(this, _warn, void 0);
|
|
14388
|
-
_classPrivateFieldInitSpec(this, _schedule, void 0);
|
|
14389
|
-
_classPrivateFieldInitSpec(this, _requestFrame, void 0);
|
|
14390
|
-
_classPrivateFieldInitSpec(this, _content$1, void 0);
|
|
14391
|
-
_classPrivateFieldInitSpec(this, _operations, []);
|
|
14392
|
-
_classPrivateFieldInitSpec(this, _lifecycle, BUILDING);
|
|
14393
|
-
_classPrivateFieldInitSpec(this, _retryRevealed, false);
|
|
14394
|
-
_classPrivateFieldInitSpec(this, _cancelRetryTimer, void 0);
|
|
14395
|
-
_classPrivateFieldInitSpec(this, _surfaceReady, false);
|
|
14396
|
-
_classPrivateFieldInitSpec(this, _paintRequested, false);
|
|
14397
|
-
_classPrivateFieldInitSpec(this, _cancelFallback, void 0);
|
|
14398
|
-
_classPrivateFieldInitSpec(this, _generation, 0);
|
|
14399
|
-
_classPrivateFieldInitSpec(this, _snapshot$3, void 0);
|
|
14400
|
-
_defineProperty(
|
|
14401
|
-
this,
|
|
14402
|
-
/** The current snapshot. The same object until something changes. */
|
|
14403
|
-
"getSnapshot",
|
|
14404
|
-
() => _classPrivateFieldGet2(_snapshot$3, this)
|
|
14405
|
-
);
|
|
14406
|
-
_defineProperty(
|
|
14407
|
-
this,
|
|
14408
|
-
/** Calls `listener` when the snapshot changes. Returns the unsubscribe function. */
|
|
14409
|
-
"subscribe",
|
|
14410
|
-
(listener) => {
|
|
14411
|
-
_classPrivateFieldGet2(_listeners$8, this).add(listener);
|
|
14412
|
-
return () => {
|
|
14413
|
-
_classPrivateFieldGet2(_listeners$8, this).delete(listener);
|
|
14414
|
-
};
|
|
14415
|
-
}
|
|
14416
|
-
);
|
|
14417
|
-
const recovery = (_options$recovery = options.recovery) !== null && _options$recovery !== void 0 ? _options$recovery : {};
|
|
14418
|
-
_classPrivateFieldSet2(_showAfterMs, this, (_recovery$showAfterMs = recovery.showAfterMs) !== null && _recovery$showAfterMs !== void 0 ? _recovery$showAfterMs : A2UI_RECOVERY_DEFAULTS.showAfterMs);
|
|
14419
|
-
_classPrivateFieldSet2(_showAfterAttempts, this, (_recovery$showAfterAt = recovery.showAfterAttempts) !== null && _recovery$showAfterAt !== void 0 ? _recovery$showAfterAt : A2UI_RECOVERY_DEFAULTS.showAfterAttempts);
|
|
14420
|
-
_classPrivateFieldSet2(_debugExposureOption, this, recovery.debugExposure);
|
|
14421
|
-
_classPrivateFieldSet2(_warn, this, options.warn);
|
|
14422
|
-
_classPrivateFieldSet2(_schedule, this, (_options$schedule = options.schedule) !== null && _options$schedule !== void 0 ? _options$schedule : defaultSchedule);
|
|
14423
|
-
_classPrivateFieldSet2(_requestFrame, this, (_options$requestFrame = options.requestFrame) !== null && _options$requestFrame !== void 0 ? _options$requestFrame : defaultRequestFrame);
|
|
14424
|
-
_classPrivateFieldSet2(_snapshot$3, this, _assertClassBrand(_A2UIActivityController_brand, this, _buildSnapshot).call(this));
|
|
14425
|
-
}
|
|
14426
|
-
/** Sets the latest activity content. */
|
|
14427
|
-
setContent(content) {
|
|
14428
|
-
if (content === _classPrivateFieldGet2(_content$1, this)) return;
|
|
14429
|
-
_classPrivateFieldSet2(_content$1, this, content);
|
|
14430
|
-
const hadOperations = _classPrivateFieldGet2(_operations, this).length > 0;
|
|
14431
|
-
_classPrivateFieldSet2(_operations, this, getA2UIOperations(content));
|
|
14432
|
-
if (_classPrivateFieldGet2(_operations, this).length === 0) {
|
|
14433
|
-
_classPrivateFieldSet2(_lifecycle, this, readA2UILifecycle(content));
|
|
14434
|
-
_assertClassBrand(_A2UIActivityController_brand, this, _updateRetry).call(this);
|
|
14435
|
-
if (hadOperations) _assertClassBrand(_A2UIActivityController_brand, this, _resetHandoff).call(this);
|
|
14436
|
-
} else if (!hadOperations) _assertClassBrand(_A2UIActivityController_brand, this, _startHandoff).call(this);
|
|
14437
|
-
_assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
|
|
14438
|
-
}
|
|
14439
|
-
/**
|
|
14440
|
-
* Reports that the surface applied operations. Ends the hand-off after the
|
|
14441
|
-
* next frame once the operations can paint something.
|
|
14442
|
-
*/
|
|
14443
|
-
markRendered() {
|
|
14444
|
-
if (_classPrivateFieldGet2(_paintRequested, this) || _classPrivateFieldGet2(_surfaceReady, this)) return;
|
|
14445
|
-
if (_classPrivateFieldGet2(_operations, this).length === 0) return;
|
|
14446
|
-
if (!surfaceHasRenderableContent(_classPrivateFieldGet2(_operations, this))) return;
|
|
14447
|
-
_classPrivateFieldSet2(_paintRequested, this, true);
|
|
14448
|
-
const generation = _classPrivateFieldGet2(_generation, this);
|
|
14449
|
-
_classPrivateFieldGet2(_requestFrame, this).call(this, () => {
|
|
14450
|
-
var _classPrivateFieldGet2$7;
|
|
14451
|
-
if (generation !== _classPrivateFieldGet2(_generation, this) || !_classPrivateFieldGet2(_paintRequested, this)) return;
|
|
14452
|
-
(_classPrivateFieldGet2$7 = _classPrivateFieldGet2(_cancelFallback, this)) === null || _classPrivateFieldGet2$7 === void 0 || _classPrivateFieldGet2$7.call(this);
|
|
14453
|
-
_classPrivateFieldSet2(_cancelFallback, this, void 0);
|
|
14454
|
-
_classPrivateFieldSet2(_surfaceReady, this, true);
|
|
14455
|
-
_assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
|
|
14456
|
-
});
|
|
14457
|
-
}
|
|
14458
|
-
/**
|
|
14459
|
-
* Stops the timers and forgets the content. A later `setContent()` starts
|
|
14460
|
-
* again, so a component that remounts can keep using the controller.
|
|
14461
|
-
*/
|
|
14462
|
-
dispose() {
|
|
14463
|
-
var _classPrivateFieldGet3;
|
|
14464
|
-
_classPrivateFieldSet2(_generation, this, _classPrivateFieldGet2(_generation, this) + 1);
|
|
14465
|
-
(_classPrivateFieldGet3 = _classPrivateFieldGet2(_cancelRetryTimer, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.call(this);
|
|
14466
|
-
_classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
|
|
14467
|
-
_assertClassBrand(_A2UIActivityController_brand, this, _resetHandoff).call(this);
|
|
14468
|
-
_classPrivateFieldSet2(_content$1, this, void 0);
|
|
14469
|
-
_classPrivateFieldSet2(_operations, this, []);
|
|
14470
|
-
_classPrivateFieldSet2(_lifecycle, this, BUILDING);
|
|
14471
|
-
_classPrivateFieldSet2(_retryRevealed, this, false);
|
|
14472
|
-
_classPrivateFieldSet2(_snapshot$3, this, _assertClassBrand(_A2UIActivityController_brand, this, _buildSnapshot).call(this));
|
|
14473
|
-
}
|
|
14474
|
-
};
|
|
14475
|
-
function _updateRetry() {
|
|
14476
|
-
const { status, attempt } = _classPrivateFieldGet2(_lifecycle, this);
|
|
14477
|
-
if (status !== "retrying") {
|
|
14478
|
-
var _classPrivateFieldGet4;
|
|
14479
|
-
(_classPrivateFieldGet4 = _classPrivateFieldGet2(_cancelRetryTimer, this)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.call(this);
|
|
14480
|
-
_classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
|
|
14481
|
-
_classPrivateFieldSet2(_retryRevealed, this, false);
|
|
14482
|
-
return;
|
|
14483
|
-
}
|
|
14484
|
-
if (attempt !== void 0 && attempt >= _classPrivateFieldGet2(_showAfterAttempts, this)) {
|
|
14485
|
-
var _classPrivateFieldGet5;
|
|
14486
|
-
(_classPrivateFieldGet5 = _classPrivateFieldGet2(_cancelRetryTimer, this)) === null || _classPrivateFieldGet5 === void 0 || _classPrivateFieldGet5.call(this);
|
|
14487
|
-
_classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
|
|
14488
|
-
_classPrivateFieldSet2(_retryRevealed, this, true);
|
|
14489
|
-
return;
|
|
14490
|
-
}
|
|
14491
|
-
if (_classPrivateFieldGet2(_retryRevealed, this) || _classPrivateFieldGet2(_cancelRetryTimer, this)) return;
|
|
14492
|
-
_classPrivateFieldSet2(_cancelRetryTimer, this, _classPrivateFieldGet2(_schedule, this).call(this, () => {
|
|
14493
|
-
_classPrivateFieldSet2(_cancelRetryTimer, this, void 0);
|
|
14494
|
-
_classPrivateFieldSet2(_retryRevealed, this, true);
|
|
14495
|
-
_assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
|
|
14496
|
-
}, _classPrivateFieldGet2(_showAfterMs, this)));
|
|
14497
|
-
}
|
|
14498
|
-
function _startHandoff() {
|
|
14499
|
-
var _classPrivateFieldGet6;
|
|
14500
|
-
_classPrivateFieldSet2(_surfaceReady, this, false);
|
|
14501
|
-
_classPrivateFieldSet2(_paintRequested, this, false);
|
|
14502
|
-
(_classPrivateFieldGet6 = _classPrivateFieldGet2(_cancelFallback, this)) === null || _classPrivateFieldGet6 === void 0 || _classPrivateFieldGet6.call(this);
|
|
14503
|
-
_classPrivateFieldSet2(_cancelFallback, this, _classPrivateFieldGet2(_schedule, this).call(this, () => {
|
|
14504
|
-
_classPrivateFieldSet2(_cancelFallback, this, void 0);
|
|
14505
|
-
if (!_classPrivateFieldGet2(_paintRequested, this)) _assertClassBrand(_A2UIActivityController_brand, this, _reportUnpainted).call(this);
|
|
14506
|
-
_classPrivateFieldSet2(_surfaceReady, this, true);
|
|
14507
|
-
_assertClassBrand(_A2UIActivityController_brand, this, _emit$1).call(this);
|
|
14508
|
-
}, A2UI_RECOVERY_DEFAULTS.paintFallbackMs));
|
|
14509
|
-
}
|
|
14510
|
-
function _resetHandoff() {
|
|
14511
|
-
var _classPrivateFieldGet7;
|
|
14512
|
-
(_classPrivateFieldGet7 = _classPrivateFieldGet2(_cancelFallback, this)) === null || _classPrivateFieldGet7 === void 0 || _classPrivateFieldGet7.call(this);
|
|
14513
|
-
_classPrivateFieldSet2(_cancelFallback, this, void 0);
|
|
14514
|
-
_classPrivateFieldSet2(_surfaceReady, this, false);
|
|
14515
|
-
_classPrivateFieldSet2(_paintRequested, this, false);
|
|
14516
|
-
}
|
|
14517
|
-
function _reportUnpainted() {
|
|
14518
|
-
const warn = _classPrivateFieldGet2(_warn, this);
|
|
14519
|
-
if (!warn) return;
|
|
14520
|
-
const groups = groupA2UIOperationsBySurface(_classPrivateFieldGet2(_operations, this));
|
|
14521
|
-
for (const [surfaceId, operations] of groups) {
|
|
14522
|
-
const message = diagnoseUnpaintedSurface(surfaceId, operations);
|
|
14523
|
-
if (message) warn(message);
|
|
14524
|
-
}
|
|
14525
|
-
}
|
|
14526
|
-
function _emit$1() {
|
|
14527
|
-
_classPrivateFieldSet2(_snapshot$3, this, _assertClassBrand(_A2UIActivityController_brand, this, _buildSnapshot).call(this));
|
|
14528
|
-
for (const listener of _classPrivateFieldGet2(_listeners$8, this)) listener();
|
|
14529
|
-
}
|
|
14530
|
-
function _buildSnapshot() {
|
|
14531
|
-
var _lifecycle$errors$len, _lifecycle$errors;
|
|
14532
|
-
const lifecycle = _classPrivateFieldGet2(_lifecycle, this);
|
|
14533
|
-
const debugExposure = resolveA2UIDebugExposure(lifecycle, _classPrivateFieldGet2(_debugExposureOption, this));
|
|
14534
|
-
const isFailed = lifecycle.status === "failed";
|
|
14535
|
-
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;
|
|
14536
|
-
let view = "surface";
|
|
14537
|
-
if (_classPrivateFieldGet2(_operations, this).length === 0) view = "lifecycle";
|
|
14538
|
-
else if (!_classPrivateFieldGet2(_surfaceReady, this)) view = "handoff";
|
|
14539
|
-
return {
|
|
14540
|
-
view,
|
|
14541
|
-
operations: _classPrivateFieldGet2(_operations, this),
|
|
14542
|
-
lifecycle,
|
|
14543
|
-
debugExposure,
|
|
14544
|
-
retryRevealed: _classPrivateFieldGet2(_retryRevealed, this),
|
|
14545
|
-
label: formatA2UIRetryLabel(lifecycle, _classPrivateFieldGet2(_retryRevealed, this)),
|
|
14546
|
-
progressPhase: getA2UIProgressPhase(lifecycle.progressTokens),
|
|
14547
|
-
showDebugDetails: debugExposure !== "hidden" && (isFailed || hasRetryErrors),
|
|
14548
|
-
debugDetailsOpen: debugExposure === "verbose",
|
|
14549
|
-
debugDetailsLabel: isFailed ? A2UI_LIFECYCLE_TEXT.failureDetails : A2UI_LIFECYCLE_TEXT.retryDetails,
|
|
14550
|
-
debugPayload: formatA2UIDebugPayload(isFailed ? {
|
|
14551
|
-
error: lifecycle.error,
|
|
14552
|
-
attempts: lifecycle.attempts
|
|
14553
|
-
} : {
|
|
14554
|
-
attempt: lifecycle.attempt,
|
|
14555
|
-
errors: lifecycle.errors
|
|
14556
|
-
})
|
|
14557
|
-
};
|
|
14558
|
-
}
|
|
14559
|
-
|
|
14560
13811
|
//#endregion
|
|
14561
13812
|
//#region src/chat/labels.ts
|
|
14562
13813
|
/**
|
|
@@ -23102,16 +22353,6 @@ exports.props = props;
|
|
|
23102
22353
|
exports.segmentSurfaceProse = segmentSurfaceProse;
|
|
23103
22354
|
exports.select = select;
|
|
23104
22355
|
exports.splitA2UIMarkdown = splitA2UIMarkdown;
|
|
23105
|
-
exports.ɵA2UIActivityController = A2UIActivityController;
|
|
23106
|
-
exports.ɵA2UI_DEFAULT_SURFACE_ID = A2UI_DEFAULT_SURFACE_ID;
|
|
23107
|
-
exports.ɵA2UI_LIFECYCLE_TEXT = A2UI_LIFECYCLE_TEXT;
|
|
23108
|
-
exports.ɵA2UI_OPERATIONS_KEY = A2UI_OPERATIONS_KEY;
|
|
23109
|
-
exports.ɵA2UI_PAINT_FALLBACK_MS = A2UI_PAINT_FALLBACK_MS;
|
|
23110
|
-
exports.ɵA2UI_RECOVERY_DEFAULTS = A2UI_RECOVERY_DEFAULTS;
|
|
23111
|
-
exports.ɵA2UI_ROOT_COMPONENT_ID = A2UI_ROOT_COMPONENT_ID;
|
|
23112
|
-
exports.ɵA2UI_SKELETON_ROWS = A2UI_SKELETON_ROWS;
|
|
23113
|
-
exports.ɵA2UI_SURFACE_ACTIVITY_TYPE = A2UI_SURFACE_ACTIVITY_TYPE;
|
|
23114
|
-
exports.ɵA2UI_SURFACE_CONTENT_SCHEMA = A2UI_SURFACE_CONTENT_SCHEMA;
|
|
23115
22356
|
exports.ɵALL_AGENT_UPDATES = ɵALL_AGENT_UPDATES;
|
|
23116
22357
|
exports.ɵAgentResolver = ɵAgentResolver;
|
|
23117
22358
|
exports.ɵAttachmentQueue = ɵAttachmentQueue;
|
|
@@ -23162,7 +22403,6 @@ exports.ɵPOPUP_ANIMATION_MS = ɵPOPUP_ANIMATION_MS;
|
|
|
23162
22403
|
exports.ɵPOPUP_DEFAULT_HEIGHT = ɵPOPUP_DEFAULT_HEIGHT;
|
|
23163
22404
|
exports.ɵPOPUP_DEFAULT_WIDTH = ɵPOPUP_DEFAULT_WIDTH;
|
|
23164
22405
|
exports.ɵPlaceholderCycler = PlaceholderCycler;
|
|
23165
|
-
exports.ɵRENDER_A2UI_TOOL_NAME = RENDER_A2UI_TOOL_NAME;
|
|
23166
22406
|
exports.ɵRESIZE_SETTLE_MS = ɵRESIZE_SETTLE_MS;
|
|
23167
22407
|
exports.ɵRUNTIME_PROBE_TIMEOUT_MS = ɵRUNTIME_PROBE_TIMEOUT_MS;
|
|
23168
22408
|
exports.ɵReasoningDisclosure = ɵReasoningDisclosure;
|
|
@@ -23227,9 +22467,6 @@ exports.ɵdecodeTextSource = ɵdecodeTextSource;
|
|
|
23227
22467
|
exports.ɵdeduplicateMessages = ɵdeduplicateMessages;
|
|
23228
22468
|
exports.ɵdescribeActivityRendererFailure = ɵdescribeActivityRendererFailure;
|
|
23229
22469
|
exports.ɵdescribeUnrenderedToolCalls = ɵdescribeUnrenderedToolCalls;
|
|
23230
|
-
exports.ɵdiagnoseMissingSurface = diagnoseMissingSurface;
|
|
23231
|
-
exports.ɵdiagnoseUnpaintedSurface = diagnoseUnpaintedSurface;
|
|
23232
|
-
exports.ɵdiagnoseUnresolvedRoot = diagnoseUnresolvedRoot;
|
|
23233
22470
|
exports.ɵdimensionToCss = ɵdimensionToCss;
|
|
23234
22471
|
exports.ɵdockedSidebarRegistryFor = ɵdockedSidebarRegistryFor;
|
|
23235
22472
|
exports.ɵduplicateMessagesWarning = ɵduplicateMessagesWarning;
|
|
@@ -23242,17 +22479,12 @@ exports.ɵfitTextareaHeight = ɵfitTextareaHeight;
|
|
|
23242
22479
|
exports.ɵflattenCommandItems = ɵflattenCommandItems;
|
|
23243
22480
|
exports.ɵflattenToolsMenuForDisplay = ɵflattenToolsMenuForDisplay;
|
|
23244
22481
|
exports.ɵflattenUserMessageContent = ɵflattenUserMessageContent;
|
|
23245
|
-
exports.ɵformatA2UIDebugPayload = formatA2UIDebugPayload;
|
|
23246
|
-
exports.ɵformatA2UIRetryLabel = formatA2UIRetryLabel;
|
|
23247
22482
|
exports.ɵformatCountLabel = ɵformatCountLabel;
|
|
23248
22483
|
exports.ɵformatLabel = ɵformatLabel;
|
|
23249
22484
|
exports.ɵformatReasoningDuration = formatReasoningDuration;
|
|
23250
22485
|
exports.ɵformatReasoningDurationLabel = ɵformatReasoningDurationLabel;
|
|
23251
22486
|
exports.ɵformatToolNames = formatToolNames;
|
|
23252
22487
|
exports.ɵformatWorkDuration = formatWorkDuration;
|
|
23253
|
-
exports.ɵgetA2UIOperationSurfaceId = getA2UIOperationSurfaceId;
|
|
23254
|
-
exports.ɵgetA2UIOperations = getA2UIOperations;
|
|
23255
|
-
exports.ɵgetA2UIProgressPhase = getA2UIProgressPhase;
|
|
23256
22488
|
exports.ɵgetAgentCapabilities = ɵgetAgentCapabilities;
|
|
23257
22489
|
exports.ɵgetAgentInterruptState = ɵgetAgentInterruptState;
|
|
23258
22490
|
exports.ɵgetAgentResolver = ɵgetAgentResolver;
|
|
@@ -23282,7 +22514,6 @@ exports.ɵgetUserMessageMediaFilename = ɵgetUserMessageMediaFilename;
|
|
|
23282
22514
|
exports.ɵgetUserMessageMediaParts = ɵgetUserMessageMediaParts;
|
|
23283
22515
|
exports.ɵgetWorkOpenState = getWorkOpenState;
|
|
23284
22516
|
exports.ɵgetWorkSummaryText = ɵgetWorkSummaryText;
|
|
23285
|
-
exports.ɵgroupA2UIOperationsBySurface = groupA2UIOperationsBySurface;
|
|
23286
22517
|
exports.ɵhasAssistantMessageText = ɵhasAssistantMessageText;
|
|
23287
22518
|
exports.ɵhitlRenderProps = ɵhitlRenderProps;
|
|
23288
22519
|
exports.ɵimplementsConnect = ɵimplementsConnect;
|
|
@@ -23332,7 +22563,6 @@ exports.ɵpluralize = pluralize;
|
|
|
23332
22563
|
exports.ɵprocessPartialHtml = processPartialHtml;
|
|
23333
22564
|
exports.ɵprojectThread = ɵprojectThread;
|
|
23334
22565
|
exports.ɵpublicKeyHeaderDefaults = ɵpublicKeyHeaderDefaults;
|
|
23335
|
-
exports.ɵreadA2UILifecycle = readA2UILifecycle;
|
|
23336
22566
|
exports.ɵreadKeyboardState = ɵreadKeyboardState;
|
|
23337
22567
|
exports.ɵrecordAnnotation = ɵrecordAnnotation;
|
|
23338
22568
|
exports.ɵrecordWorkTime = recordWorkTime;
|
|
@@ -23341,8 +22571,6 @@ exports.ɵreportProviderConfigDiagnostics = ɵreportProviderConfigDiagnostics;
|
|
|
23341
22571
|
exports.ɵreserveLicenseBannerOffset = ɵreserveLicenseBannerOffset;
|
|
23342
22572
|
exports.ɵresetAgentThreadBaseline = ɵresetAgentThreadBaseline;
|
|
23343
22573
|
exports.ɵresetMessageFeedbackCache = ɵresetMessageFeedbackCache;
|
|
23344
|
-
exports.ɵresolveA2UIActivation = ɵresolveA2UIActivation;
|
|
23345
|
-
exports.ɵresolveA2UIDebugExposure = resolveA2UIDebugExposure;
|
|
23346
22574
|
exports.ɵresolveActivityRenderer = ɵresolveActivityRenderer;
|
|
23347
22575
|
exports.ɵresolveAgentId = ɵresolveAgentId;
|
|
23348
22576
|
exports.ɵresolveAgentThreadId = ɵresolveAgentThreadId;
|
|
@@ -23350,6 +22578,7 @@ exports.ɵresolveChatNotice = ɵresolveChatNotice;
|
|
|
23350
22578
|
exports.ɵresolveComposerKey = ɵresolveComposerKey;
|
|
23351
22579
|
exports.ɵresolveCustomMessageRenderContext = ɵresolveCustomMessageRenderContext;
|
|
23352
22580
|
exports.ɵresolveCustomMessageRenderers = ɵresolveCustomMessageRenderers;
|
|
22581
|
+
exports.ɵresolveGenerativeUIDefault = ɵresolveGenerativeUIDefault;
|
|
23353
22582
|
exports.ɵresolveLicenseState = ɵresolveLicenseState;
|
|
23354
22583
|
exports.ɵresolveProviderConfig = ɵresolveProviderConfig;
|
|
23355
22584
|
exports.ɵresolveSlashKey = ɵresolveSlashKey;
|
|
@@ -23357,7 +22586,6 @@ exports.ɵresolveThreadsLicense = ɵresolveThreadsLicense;
|
|
|
23357
22586
|
exports.ɵresolveToolCallAgentId = ɵresolveToolCallAgentId;
|
|
23358
22587
|
exports.ɵresolveToolCallRenderer = ɵresolveToolCallRenderer;
|
|
23359
22588
|
exports.ɵrmsAmplitude = ɵrmsAmplitude;
|
|
23360
|
-
exports.ɵrunA2UIAction = runA2UIAction;
|
|
23361
22589
|
exports.ɵselectFetchMoreError = ɵselectFetchMoreError;
|
|
23362
22590
|
exports.ɵselectHasNextPage = ɵselectHasNextPage;
|
|
23363
22591
|
exports.ɵselectIsFetchingNextPage = ɵselectIsFetchingNextPage;
|
|
@@ -23387,10 +22615,8 @@ exports.ɵsubscribeToAgentSuggestions = ɵsubscribeToAgentSuggestions;
|
|
|
23387
22615
|
exports.ɵsubscribeToAgentUpdates = ɵsubscribeToAgentUpdates;
|
|
23388
22616
|
exports.ɵsubscribeToLearningFeedbackEnabled = ɵsubscribeToLearningFeedbackEnabled;
|
|
23389
22617
|
exports.ɵsubscribeToMessageFeedback = ɵsubscribeToMessageFeedback;
|
|
23390
|
-
exports.ɵsurfaceHasRenderableContent = surfaceHasRenderableContent;
|
|
23391
22618
|
exports.ɵsyncRecorderToMode = ɵsyncRecorderToMode;
|
|
23392
22619
|
exports.ɵthreadAdapterEvents = ɵthreadAdapterEvents;
|
|
23393
|
-
exports.ɵtoA2UIClientEvent = toA2UIClientEvent;
|
|
23394
22620
|
exports.ɵtoDefaultToolCallStatus = ɵtoDefaultToolCallStatus;
|
|
23395
22621
|
exports.ɵtoDrawerThread = ɵtoDrawerThread;
|
|
23396
22622
|
exports.ɵtoLearningConfig = ɵtoLearningConfig;
|