@genesislcap/ai-assistant 14.461.3-alpha-5a8ece015.0 → 14.463.0
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/ai-assistant.api.json +55 -1
- package/dist/ai-assistant.d.ts +52 -0
- package/dist/dts/channel/ai-activity-channel.d.ts +20 -0
- package/dist/dts/channel/ai-activity-channel.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts +28 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +4 -0
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +87 -1
- package/dist/esm/components/chat-driver/chat-driver.test.js +216 -0
- package/dist/esm/main/main.js +23 -6
- package/dist/esm/state/debug-event-log.js +1 -1
- package/package.json +16 -16
- package/src/channel/ai-activity-channel.ts +20 -0
- package/src/components/chat-driver/chat-driver.test.ts +290 -0
- package/src/components/chat-driver/chat-driver.ts +102 -1
- package/src/main/main.ts +20 -1
- package/src/state/debug-event-log.ts +1 -1
|
@@ -793,6 +793,60 @@
|
|
|
793
793
|
"endIndex": 2
|
|
794
794
|
}
|
|
795
795
|
},
|
|
796
|
+
{
|
|
797
|
+
"kind": "PropertySignature",
|
|
798
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgenticActivityEvents#\"interaction-requested\":member",
|
|
799
|
+
"docComment": "/**\n * Fired when a tool handler hands a widget to the user mid-loop and parks awaiting it (`requestInteraction`) — the turn is suspended between provider calls, with no request in flight. Pairs with {@link AgenticActivityEvents.'interaction-resolved'}.\n *\n * This is the inverse boundary to {@link AgenticActivityEvents.'tool-loop-start'}: the loop is running (still inside `tool-loop-start`/`tool-loop-end`) but is momentarily idle, waiting on the user. Use it for hooks that are unsafe *while computing* but safe *while parked* — e.g. enabling a control that must not change mid-request but is fine to change during a long journey step. Tab-local (not forwarded cross-tab): the widget and its waiting state belong to the tab that opened it.\n */\n",
|
|
800
|
+
"excerptTokens": [
|
|
801
|
+
{
|
|
802
|
+
"kind": "Content",
|
|
803
|
+
"text": "'interaction-requested': "
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"kind": "Content",
|
|
807
|
+
"text": "undefined"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"kind": "Content",
|
|
811
|
+
"text": ";"
|
|
812
|
+
}
|
|
813
|
+
],
|
|
814
|
+
"isReadonly": false,
|
|
815
|
+
"isOptional": false,
|
|
816
|
+
"releaseTag": "Beta",
|
|
817
|
+
"name": "\"interaction-requested\"",
|
|
818
|
+
"propertyTypeTokenRange": {
|
|
819
|
+
"startIndex": 1,
|
|
820
|
+
"endIndex": 2
|
|
821
|
+
}
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"kind": "PropertySignature",
|
|
825
|
+
"canonicalReference": "@genesislcap/ai-assistant!AgenticActivityEvents#\"interaction-resolved\":member",
|
|
826
|
+
"docComment": "/**\n * Fired when a parked widget interaction ends — by user completion, timeout, or cancellation — just before the suspended tool handler resumes and the loop continues. Pairs with {@link AgenticActivityEvents.'interaction-requested'}. After this the turn is computing again (until `tool-loop-end`). Tab-local.\n */\n",
|
|
827
|
+
"excerptTokens": [
|
|
828
|
+
{
|
|
829
|
+
"kind": "Content",
|
|
830
|
+
"text": "'interaction-resolved': "
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"kind": "Content",
|
|
834
|
+
"text": "undefined"
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
"kind": "Content",
|
|
838
|
+
"text": ";"
|
|
839
|
+
}
|
|
840
|
+
],
|
|
841
|
+
"isReadonly": false,
|
|
842
|
+
"isOptional": false,
|
|
843
|
+
"releaseTag": "Beta",
|
|
844
|
+
"name": "\"interaction-resolved\"",
|
|
845
|
+
"propertyTypeTokenRange": {
|
|
846
|
+
"startIndex": 1,
|
|
847
|
+
"endIndex": 2
|
|
848
|
+
}
|
|
849
|
+
},
|
|
796
850
|
{
|
|
797
851
|
"kind": "PropertySignature",
|
|
798
852
|
"canonicalReference": "@genesislcap/ai-assistant!AgenticActivityEvents#\"tool-loop-end\":member",
|
|
@@ -5394,7 +5448,7 @@
|
|
|
5394
5448
|
},
|
|
5395
5449
|
{
|
|
5396
5450
|
"kind": "Content",
|
|
5397
|
-
"text": ";\n kind: \"message\";\n } | {\n index: number;\n timestamp: string;\n type: "
|
|
5451
|
+
"text": ";\n model?: string;\n providerName?: string;\n kind: \"message\";\n } | {\n index: number;\n timestamp: string;\n type: "
|
|
5398
5452
|
},
|
|
5399
5453
|
{
|
|
5400
5454
|
"kind": "Reference",
|
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -181,6 +181,26 @@ export declare interface AgenticActivityEvents {
|
|
|
181
181
|
* (telemetry flushes, post-turn workspace transitions, deferred state recomputation).
|
|
182
182
|
*/
|
|
183
183
|
'tool-loop-end': undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Fired when a tool handler hands a widget to the user mid-loop and parks awaiting it
|
|
186
|
+
* (`requestInteraction`) — the turn is suspended between provider calls, with no request
|
|
187
|
+
* in flight. Pairs with {@link AgenticActivityEvents.'interaction-resolved'}.
|
|
188
|
+
*
|
|
189
|
+
* This is the inverse boundary to {@link AgenticActivityEvents.'tool-loop-start'}: the
|
|
190
|
+
* loop is running (still inside `tool-loop-start`/`tool-loop-end`) but is momentarily idle,
|
|
191
|
+
* waiting on the user. Use it for hooks that are unsafe *while computing* but safe *while
|
|
192
|
+
* parked* — e.g. enabling a control that must not change mid-request but is fine to change
|
|
193
|
+
* during a long journey step. Tab-local (not forwarded cross-tab): the widget and its
|
|
194
|
+
* waiting state belong to the tab that opened it.
|
|
195
|
+
*/
|
|
196
|
+
'interaction-requested': undefined;
|
|
197
|
+
/**
|
|
198
|
+
* Fired when a parked widget interaction ends — by user completion, timeout, or
|
|
199
|
+
* cancellation — just before the suspended tool handler resumes and the loop continues.
|
|
200
|
+
* Pairs with {@link AgenticActivityEvents.'interaction-requested'}. After this the turn is
|
|
201
|
+
* computing again (until `tool-loop-end`). Tab-local.
|
|
202
|
+
*/
|
|
203
|
+
'interaction-resolved': undefined;
|
|
184
204
|
}
|
|
185
205
|
|
|
186
206
|
/**
|
|
@@ -803,6 +823,27 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
803
823
|
private lastResolvedProviderName?;
|
|
804
824
|
/** Last dispatched `provider-changed` name; avoids duplicate events on stable turns. */
|
|
805
825
|
private lastDispatchedProviderName?;
|
|
826
|
+
/**
|
|
827
|
+
* Concrete model id of the provider resolved for the current turn, read from
|
|
828
|
+
* its `getStatus()` and stamped onto the resulting assistant message so the
|
|
829
|
+
* debug log carries per-message model lineage. Re-resolved each turn in
|
|
830
|
+
* `resolveProviderForTurn`.
|
|
831
|
+
*/
|
|
832
|
+
private lastResolvedModel?;
|
|
833
|
+
/**
|
|
834
|
+
* Memoised `name → model id` lookups, so the per-turn model resolution doesn't
|
|
835
|
+
* re-await `getStatus()` every turn. Cleared (with `resolvedProviderCache`) on
|
|
836
|
+
* an observable-registry change, so a model swapped behind a stable name is
|
|
837
|
+
* picked up on the next turn.
|
|
838
|
+
*/
|
|
839
|
+
private resolvedModelCache;
|
|
840
|
+
/**
|
|
841
|
+
* Unsubscribe handle for the provider-registry change listener (only set when
|
|
842
|
+
* the injected registry is observable). Called in `dispose` so the long-lived
|
|
843
|
+
* registry doesn't retain this driver — see the constructor and the sub-agent
|
|
844
|
+
* teardown in `runSubAgent`.
|
|
845
|
+
*/
|
|
846
|
+
private unsubscribeRegistry?;
|
|
806
847
|
constructor(providerRegistry: AIProviderRegistry, toolHandlers?: ToolHandlersInput, toolDefinitions?: ToolDefinitionsInput, systemPrompt?: SystemPromptInput, primerHistory?: ChatMessage[], maxToolIterations?: number, maxFoldOperations?: number, maxTurnSnapshots?: number,
|
|
807
848
|
/** Session identity used to file meta events onto the shared debug-log timeline. */
|
|
808
849
|
sessionKey?: string);
|
|
@@ -866,6 +907,13 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
866
907
|
* differs from the last dispatched value.
|
|
867
908
|
*/
|
|
868
909
|
private resolveProviderForTurn;
|
|
910
|
+
/**
|
|
911
|
+
* Resolve the concrete model id for a provider via its optional `getStatus()`,
|
|
912
|
+
* memoised by registry name. Used to stamp `model` onto outgoing messages.
|
|
913
|
+
* Best-effort: a provider without `getStatus`, a null status, or a throw all
|
|
914
|
+
* yield `undefined` — model attribution is diagnostic, never load-bearing.
|
|
915
|
+
*/
|
|
916
|
+
private resolveModelForProvider;
|
|
869
917
|
/**
|
|
870
918
|
* Resolve a per-turn config input that is either a static value or a function
|
|
871
919
|
* of the turn context — the value-or-resolver shape shared by `provider`,
|
|
@@ -1402,6 +1450,8 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
1402
1450
|
private driverCleanup?;
|
|
1403
1451
|
private loadingTimer;
|
|
1404
1452
|
private unsubBus?;
|
|
1453
|
+
/** Unsubscribe handle for the provider-registry change listener (observable registries only). */
|
|
1454
|
+
private unsubProviderRegistry?;
|
|
1405
1455
|
private haloStartPublished;
|
|
1406
1456
|
/** Fingerprint of the agents array used to build the current driver. Used by agentsChanged to skip spurious rebuilds. */
|
|
1407
1457
|
private _driverAgentsKey?;
|
|
@@ -1629,6 +1679,8 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
1629
1679
|
cost?: number;
|
|
1630
1680
|
externalCostUsd?: number;
|
|
1631
1681
|
responseMeta?: ChatResponseMeta;
|
|
1682
|
+
model?: string;
|
|
1683
|
+
providerName?: string;
|
|
1632
1684
|
kind: "message";
|
|
1633
1685
|
} | {
|
|
1634
1686
|
index: number;
|
|
@@ -63,5 +63,25 @@ export interface AgenticActivityEvents {
|
|
|
63
63
|
* (telemetry flushes, post-turn workspace transitions, deferred state recomputation).
|
|
64
64
|
*/
|
|
65
65
|
'tool-loop-end': undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Fired when a tool handler hands a widget to the user mid-loop and parks awaiting it
|
|
68
|
+
* (`requestInteraction`) — the turn is suspended between provider calls, with no request
|
|
69
|
+
* in flight. Pairs with {@link AgenticActivityEvents.'interaction-resolved'}.
|
|
70
|
+
*
|
|
71
|
+
* This is the inverse boundary to {@link AgenticActivityEvents.'tool-loop-start'}: the
|
|
72
|
+
* loop is running (still inside `tool-loop-start`/`tool-loop-end`) but is momentarily idle,
|
|
73
|
+
* waiting on the user. Use it for hooks that are unsafe *while computing* but safe *while
|
|
74
|
+
* parked* — e.g. enabling a control that must not change mid-request but is fine to change
|
|
75
|
+
* during a long journey step. Tab-local (not forwarded cross-tab): the widget and its
|
|
76
|
+
* waiting state belong to the tab that opened it.
|
|
77
|
+
*/
|
|
78
|
+
'interaction-requested': undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Fired when a parked widget interaction ends — by user completion, timeout, or
|
|
81
|
+
* cancellation — just before the suspended tool handler resumes and the loop continues.
|
|
82
|
+
* Pairs with {@link AgenticActivityEvents.'interaction-requested'}. After this the turn is
|
|
83
|
+
* computing again (until `tool-loop-end`). Tab-local.
|
|
84
|
+
*/
|
|
85
|
+
'interaction-resolved': undefined;
|
|
66
86
|
}
|
|
67
87
|
//# sourceMappingURL=ai-activity-channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-activity-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,YAAY,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtC,iFAAiF;IACjF,WAAW,EAAE,SAAS,CAAC;IACvB,mJAAmJ;IACnJ,aAAa,EAAE,SAAS,CAAC;IACzB,wJAAwJ;IACxJ,YAAY,EAAE,SAAS,CAAC;IACxB;;;;;;;;;;;;;;;;;;OAkBG;IACH,iBAAiB,EAAE,SAAS,CAAC;IAC7B;;;;;;;;;;;;;;;;;;OAkBG;IACH,eAAe,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-activity-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,YAAY,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtC,iFAAiF;IACjF,WAAW,EAAE,SAAS,CAAC;IACvB,mJAAmJ;IACnJ,aAAa,EAAE,SAAS,CAAC;IACzB,wJAAwJ;IACxJ,YAAY,EAAE,SAAS,CAAC;IACxB;;;;;;;;;;;;;;;;;;OAkBG;IACH,iBAAiB,EAAE,SAAS,CAAC;IAC7B;;;;;;;;;;;;;;;;;;OAkBG;IACH,eAAe,EAAE,SAAS,CAAC;IAC3B;;;;;;;;;;;OAWG;IACH,uBAAuB,EAAE,SAAS,CAAC;IACnC;;;;;OAKG;IACH,sBAAsB,EAAE,SAAS,CAAC;CACnC"}
|
|
@@ -247,6 +247,27 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
247
247
|
private lastResolvedProviderName?;
|
|
248
248
|
/** Last dispatched `provider-changed` name; avoids duplicate events on stable turns. */
|
|
249
249
|
private lastDispatchedProviderName?;
|
|
250
|
+
/**
|
|
251
|
+
* Concrete model id of the provider resolved for the current turn, read from
|
|
252
|
+
* its `getStatus()` and stamped onto the resulting assistant message so the
|
|
253
|
+
* debug log carries per-message model lineage. Re-resolved each turn in
|
|
254
|
+
* `resolveProviderForTurn`.
|
|
255
|
+
*/
|
|
256
|
+
private lastResolvedModel?;
|
|
257
|
+
/**
|
|
258
|
+
* Memoised `name → model id` lookups, so the per-turn model resolution doesn't
|
|
259
|
+
* re-await `getStatus()` every turn. Cleared (with `resolvedProviderCache`) on
|
|
260
|
+
* an observable-registry change, so a model swapped behind a stable name is
|
|
261
|
+
* picked up on the next turn.
|
|
262
|
+
*/
|
|
263
|
+
private resolvedModelCache;
|
|
264
|
+
/**
|
|
265
|
+
* Unsubscribe handle for the provider-registry change listener (only set when
|
|
266
|
+
* the injected registry is observable). Called in `dispose` so the long-lived
|
|
267
|
+
* registry doesn't retain this driver — see the constructor and the sub-agent
|
|
268
|
+
* teardown in `runSubAgent`.
|
|
269
|
+
*/
|
|
270
|
+
private unsubscribeRegistry?;
|
|
250
271
|
constructor(providerRegistry: AIProviderRegistry, toolHandlers?: ToolHandlersInput, toolDefinitions?: ToolDefinitionsInput, systemPrompt?: SystemPromptInput, primerHistory?: ChatMessage[], maxToolIterations?: number, maxFoldOperations?: number, maxTurnSnapshots?: number,
|
|
251
272
|
/** Session identity used to file meta events onto the shared debug-log timeline. */
|
|
252
273
|
sessionKey?: string);
|
|
@@ -310,6 +331,13 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
310
331
|
* differs from the last dispatched value.
|
|
311
332
|
*/
|
|
312
333
|
private resolveProviderForTurn;
|
|
334
|
+
/**
|
|
335
|
+
* Resolve the concrete model id for a provider via its optional `getStatus()`,
|
|
336
|
+
* memoised by registry name. Used to stamp `model` onto outgoing messages.
|
|
337
|
+
* Best-effort: a provider without `getStatus`, a null status, or a throw all
|
|
338
|
+
* yield `undefined` — model attribution is diagnostic, never load-bearing.
|
|
339
|
+
*/
|
|
340
|
+
private resolveModelForProvider;
|
|
313
341
|
/**
|
|
314
342
|
* Resolve a per-turn config input that is either a static value or a function
|
|
315
343
|
* of the turn context — the value-or-resolver shape shared by `provider`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAGX,cAAc,EAGd,yBAAyB,EAEzB,qBAAqB,EAEtB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{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mF;IACnF,OAAO,CAAC,2BAA2B;YAkCrB,WAAW;IA4pBzB,OAAO,CAAC,eAAe;CAoBxB"}
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -210,6 +210,8 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
210
210
|
private driverCleanup?;
|
|
211
211
|
private loadingTimer;
|
|
212
212
|
private unsubBus?;
|
|
213
|
+
/** Unsubscribe handle for the provider-registry change listener (observable registries only). */
|
|
214
|
+
private unsubProviderRegistry?;
|
|
213
215
|
private haloStartPublished;
|
|
214
216
|
/** Fingerprint of the agents array used to build the current driver. Used by agentsChanged to skip spurious rebuilds. */
|
|
215
217
|
private _driverAgentsKey?;
|
|
@@ -437,6 +439,8 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
437
439
|
cost?: number;
|
|
438
440
|
externalCostUsd?: number;
|
|
439
441
|
responseMeta?: import("@genesislcap/foundation-ai").ChatResponseMeta;
|
|
442
|
+
model?: string;
|
|
443
|
+
providerName?: string;
|
|
440
444
|
kind: "message";
|
|
441
445
|
} | {
|
|
442
446
|
index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAkC,MAAM,4BAA4B,CAAC;AAEhG,OAAO,EAGL,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAe/B,OAAO,KAAK,EAA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qBAAqB,CAAC,UAAU,EAAE,MAAM;IAKxC;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,aAAa,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;YA0C7E,gBAAgB;YA6DhB,IAAI;IAgDlB,qBAAqB,CAAC,CAAC,EAAE,UAAU;IAYnC,0BAA0B,CAAC,CAAC,EAAE,KAAK;IASnC;iFAC6E;IAC7E,IAAI,mBAAmB,IAAI,OAAO,CAEjC;IAED;;;iCAG6B;IAC7B,IAAI,mBAAmB,IAAI,MAAM,CAIhC;IAED;iEAC6D;IAC7D,qBAAqB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IAoB5C;;;qDAGiD;IACjD,oBAAoB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IAS3C,yDAAyD;IACzD,mBAAmB,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;CAI3C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { MalformedFunctionCallError } from '@genesislcap/foundation-ai';
|
|
2
|
+
import { isObservableAIProviderRegistry, MalformedFunctionCallError, } from '@genesislcap/foundation-ai';
|
|
3
3
|
import { agenticActivityBus } from '../../channel/ai-activity-bus';
|
|
4
4
|
import { resolveChatProvider } from '../../config/validate-providers';
|
|
5
5
|
import { recordMetaEvent, recordTurnError, recordTurnRetry } from '../../state/debug-event-log';
|
|
@@ -138,6 +138,13 @@ export class ChatDriver extends EventTarget {
|
|
|
138
138
|
* validated fresh.
|
|
139
139
|
*/
|
|
140
140
|
this.resolvedProviderCache = new Map();
|
|
141
|
+
/**
|
|
142
|
+
* Memoised `name → model id` lookups, so the per-turn model resolution doesn't
|
|
143
|
+
* re-await `getStatus()` every turn. Cleared (with `resolvedProviderCache`) on
|
|
144
|
+
* an observable-registry change, so a model swapped behind a stable name is
|
|
145
|
+
* picked up on the next turn.
|
|
146
|
+
*/
|
|
147
|
+
this.resolvedModelCache = new Map();
|
|
141
148
|
if (typeof toolHandlers === 'function') {
|
|
142
149
|
this.toolHandlersFactory = toolHandlers;
|
|
143
150
|
this.toolHandlers = {};
|
|
@@ -158,6 +165,24 @@ export class ChatDriver extends EventTarget {
|
|
|
158
165
|
this.primerHistory = primerHistory;
|
|
159
166
|
this.maxFoldOperations = maxFoldOperations;
|
|
160
167
|
this.maxTurnSnapshots = maxTurnSnapshots;
|
|
168
|
+
// Runtime provider switching: when the host registered an observable
|
|
169
|
+
// registry, drop our memoised provider lookups whenever its mapping/default
|
|
170
|
+
// changes so the next turn re-resolves against the new providers. Resetting
|
|
171
|
+
// `lastDispatchedProviderName` forces the next `resolveProviderForTurn` to
|
|
172
|
+
// re-emit `provider-changed` even when the resolved *name* is unchanged
|
|
173
|
+
// (e.g. a tier name like 'high' kept, but the vendor underneath swapped) —
|
|
174
|
+
// that's what lets status UI refresh on a same-name switch. Feature-detect
|
|
175
|
+
// means immutable/empty registries are a no-op. Child sub-agent drivers get
|
|
176
|
+
// the same registry and so subscribe here too; each cleans up in `dispose`.
|
|
177
|
+
if (isObservableAIProviderRegistry(this.providerRegistry)) {
|
|
178
|
+
this.unsubscribeRegistry = this.providerRegistry.subscribe(() => {
|
|
179
|
+
this.resolvedProviderCache.clear();
|
|
180
|
+
this.resolvedModelCache.clear();
|
|
181
|
+
this.lastResolvedProviderName = undefined;
|
|
182
|
+
this.lastResolvedModel = undefined;
|
|
183
|
+
this.lastDispatchedProviderName = undefined;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
161
186
|
}
|
|
162
187
|
/**
|
|
163
188
|
* Tear down the driver: aborts the lifecycle signal so any in-flight provider
|
|
@@ -175,7 +200,13 @@ export class ChatDriver extends EventTarget {
|
|
|
175
200
|
* timeout), which also stamps history and reverts the chat-input override.
|
|
176
201
|
*/
|
|
177
202
|
dispose() {
|
|
203
|
+
var _a;
|
|
178
204
|
this.lifecycleController.abort(new DOMException('AI assistant driver disposed', 'AbortError'));
|
|
205
|
+
// Detach from the provider registry so the long-lived registry doesn't pin
|
|
206
|
+
// this driver (and its closure) after teardown. Guard-cleared so a second
|
|
207
|
+
// dispose is a no-op, matching this method's idempotent contract.
|
|
208
|
+
(_a = this.unsubscribeRegistry) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
209
|
+
this.unsubscribeRegistry = undefined;
|
|
179
210
|
}
|
|
180
211
|
/**
|
|
181
212
|
* Stop the current turn (user "stop" button). Aborts the in-flight provider
|
|
@@ -328,6 +359,7 @@ export class ChatDriver extends EventTarget {
|
|
|
328
359
|
resolvedName = name;
|
|
329
360
|
}
|
|
330
361
|
this.lastResolvedProviderName = resolvedName;
|
|
362
|
+
this.lastResolvedModel = yield this.resolveModelForProvider(resolvedName, provider);
|
|
331
363
|
if (resolvedName !== this.lastDispatchedProviderName) {
|
|
332
364
|
this.lastDispatchedProviderName = resolvedName;
|
|
333
365
|
recordMetaEvent(this.sessionKey, 'provider.selected', {
|
|
@@ -339,6 +371,28 @@ export class ChatDriver extends EventTarget {
|
|
|
339
371
|
return provider;
|
|
340
372
|
});
|
|
341
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* Resolve the concrete model id for a provider via its optional `getStatus()`,
|
|
376
|
+
* memoised by registry name. Used to stamp `model` onto outgoing messages.
|
|
377
|
+
* Best-effort: a provider without `getStatus`, a null status, or a throw all
|
|
378
|
+
* yield `undefined` — model attribution is diagnostic, never load-bearing.
|
|
379
|
+
*/
|
|
380
|
+
resolveModelForProvider(name, provider) {
|
|
381
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
382
|
+
var _a, _b;
|
|
383
|
+
if (this.resolvedModelCache.has(name))
|
|
384
|
+
return this.resolvedModelCache.get(name);
|
|
385
|
+
let model;
|
|
386
|
+
try {
|
|
387
|
+
model = (_b = (yield ((_a = provider.getStatus) === null || _a === void 0 ? void 0 : _a.call(provider)))) === null || _b === void 0 ? void 0 : _b.model;
|
|
388
|
+
}
|
|
389
|
+
catch (_c) {
|
|
390
|
+
model = undefined;
|
|
391
|
+
}
|
|
392
|
+
this.resolvedModelCache.set(name, model);
|
|
393
|
+
return model;
|
|
394
|
+
});
|
|
395
|
+
}
|
|
342
396
|
/**
|
|
343
397
|
* Resolve a per-turn config input that is either a static value or a function
|
|
344
398
|
* of the turn context — the value-or-resolver shape shared by `provider`,
|
|
@@ -669,6 +723,11 @@ export class ChatDriver extends EventTarget {
|
|
|
669
723
|
component: componentName,
|
|
670
724
|
agent: this.activeAgentName,
|
|
671
725
|
});
|
|
726
|
+
// Signal the park boundary on the activity bus so turn-aware UI can tell
|
|
727
|
+
// "actively computing" from "parked awaiting the user" — the latter is a
|
|
728
|
+
// safe window for actions disallowed mid-request (e.g. switching provider
|
|
729
|
+
// during a long journey step). Paired with `interaction-resolved`.
|
|
730
|
+
agenticActivityBus.publish('interaction-requested', undefined);
|
|
672
731
|
if (chatInputDuringExecution) {
|
|
673
732
|
this.dispatchEvent(new CustomEvent('interaction-start', {
|
|
674
733
|
detail: { interactionId, chatInputDuringExecution },
|
|
@@ -727,6 +786,10 @@ export class ChatDriver extends EventTarget {
|
|
|
727
786
|
this.dispatchEvent(new CustomEvent('interaction-stop', { detail: { interactionId } }));
|
|
728
787
|
}
|
|
729
788
|
recordMetaEvent(this.sessionKey, 'interaction.resolved', { interactionId });
|
|
789
|
+
// The park is ending and the loop is about to resume computing — paired
|
|
790
|
+
// with `interaction-requested`. Fires for every resolution path (user
|
|
791
|
+
// completion, timeout, cancellation), since all route through here.
|
|
792
|
+
agenticActivityBus.publish('interaction-resolved', undefined);
|
|
730
793
|
interaction.resolve(result);
|
|
731
794
|
this.pendingInteractions.delete(interactionId);
|
|
732
795
|
}
|
|
@@ -957,6 +1020,13 @@ export class ChatDriver extends EventTarget {
|
|
|
957
1020
|
this.lifecycleController.signal.removeEventListener('abort', disposeChild);
|
|
958
1021
|
child.removeEventListener('history-updated', forwardTrace);
|
|
959
1022
|
child.removeEventListener('provider-changed', forwardProviderChanged);
|
|
1023
|
+
// Tear the child down on every exit path, not just timeout/parent-abort.
|
|
1024
|
+
// A child that completes normally is otherwise never disposed, so its
|
|
1025
|
+
// provider-registry subscription (wired in the ChatDriver constructor)
|
|
1026
|
+
// would leak — the long-lived registry would retain every completed
|
|
1027
|
+
// sub-agent driver. dispose() is idempotent and only aborts the (already
|
|
1028
|
+
// settled) lifecycle, so the snapshot/completion reads below still work.
|
|
1029
|
+
child.dispose();
|
|
960
1030
|
this.dispatchEvent(new CustomEvent('sub-agent-stop', { detail: lifecycleDetail }));
|
|
961
1031
|
}
|
|
962
1032
|
const trace = child.getHistory();
|
|
@@ -1408,6 +1478,22 @@ export class ChatDriver extends EventTarget {
|
|
|
1408
1478
|
}
|
|
1409
1479
|
throw e;
|
|
1410
1480
|
}
|
|
1481
|
+
// Attribute the response to the concrete model + registry slot that
|
|
1482
|
+
// produced it (resolved for this turn in `resolveProviderForTurn`). Carried
|
|
1483
|
+
// on the assistant message so the debug-log timeline shows per-message
|
|
1484
|
+
// model lineage — and thus per-tool-call, since tool calls ride on the
|
|
1485
|
+
// assistant message that requests them. Harmless on a response later
|
|
1486
|
+
// discarded as empty/retried; only kept copies reach history.
|
|
1487
|
+
//
|
|
1488
|
+
// Attach each key only when resolved: a provider with no `getStatus` (etc.)
|
|
1489
|
+
// leaves the key off entirely rather than carrying it as `undefined`.
|
|
1490
|
+
// JSON.stringify already drops undefined from the exported log, so this is
|
|
1491
|
+
// chiefly about keeping the in-memory message shape honest.
|
|
1492
|
+
if (this.lastResolvedModel !== undefined)
|
|
1493
|
+
response.model = this.lastResolvedModel;
|
|
1494
|
+
if (this.lastResolvedProviderName !== undefined) {
|
|
1495
|
+
response.providerName = this.lastResolvedProviderName;
|
|
1496
|
+
}
|
|
1411
1497
|
const isThinkingStep = response.content && ((_c = response.toolCalls) === null || _c === void 0 ? void 0 : _c.length);
|
|
1412
1498
|
const isEmptyResponse = !((_d = response.content) === null || _d === void 0 ? void 0 : _d.trim()) && !((_e = response.toolCalls) === null || _e === void 0 ? void 0 : _e.length);
|
|
1413
1499
|
if (isEmptyResponse) {
|