@genesislcap/ai-assistant 15.85.0 → 15.86.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.
@@ -96,7 +96,8 @@ export interface AutopilotHost {
96
96
  }
97
97
  /**
98
98
  * The autopilot's mode as saved with the session (GENC-1660 §4.8): which flow it was set for, and
99
- * whether it was running. Cleared when that flow ends, so a saved mode never outlives its flow.
99
+ * whether it was running. Cleared when that flow ends, so a saved mode never outlives its flow. A
100
+ * hand-off does not end it: the mode goes with the task to the target, and back (GENC-1751).
100
101
  *
101
102
  * @beta
102
103
  */
@@ -185,6 +186,16 @@ export declare class AutopilotDriver extends BaseDriverDecorator implements Auto
185
186
  private turnHandBack?;
186
187
  /** A mode restored with the session, waiting for its flow to become the owner again. */
187
188
  private restored?;
189
+ /**
190
+ * The mode of a hand-off's target that has released, kept for its caller, which has not taken the
191
+ * lock back yet (GENC-1751): the flow has no owner in between. See `carriedTo`.
192
+ */
193
+ private handingBack?;
194
+ /**
195
+ * The mode of the flow that just ended, should a one-way hand-off with nobody waiting turn out to
196
+ * have ended it: that switch announces itself only after the owner has changed (GENC-1751).
197
+ */
198
+ private switchedFrom?;
188
199
  /**
189
200
  * Bumped on every pause and resume, and when its sessions end. A written answer is sent only if
190
201
  * none came between asking for it and its landing: one started before a pause is stale after it,
@@ -225,7 +236,10 @@ export declare class AutopilotDriver extends BaseDriverDecorator implements Auto
225
236
  pause(): void;
226
237
  resume(): void;
227
238
  stop(): void;
228
- /** The mode to save with the session, while it is set for the current flow. */
239
+ /**
240
+ * The mode to save with the session, while it is set for the current flow — or kept for a
241
+ * hand-off's caller while its target releases, saved for that target, as the stack saves it.
242
+ */
229
243
  getPersistedMode(): PersistedAutopilotMode | undefined;
230
244
  /**
231
245
  * Bring back a saved mode. It applies once its flow is the owner again — at once if it already
@@ -377,6 +391,36 @@ export declare class AutopilotDriver extends BaseDriverDecorator implements Auto
377
391
  /** A claimed interaction settled, whoever settled it. */
378
392
  private onSettled;
379
393
  private onFlowOwnerChanged;
394
+ /**
395
+ * A one-way hand-off with nobody waiting is a plain switch, the caller deactivated, so nothing on
396
+ * the stack says the owner it changed to took over the same task: its event, raised once the
397
+ * target is active, does (GENC-1751).
398
+ */
399
+ private onHandOffStarted;
400
+ /** The mode set for the current flow, or kept for the caller of a hand-back under way. */
401
+ private current;
402
+ /**
403
+ * The mode that carries to `owner` because the owner changed for a hand-off or its hand-back, as
404
+ * the hand-off stack shows it at that moment (GENC-1751):
405
+ * - a hand-off: `owner` is the top frame's target, which has not finished. Its frame is on the
406
+ * stack before the target is activated, and so is a waiting caller's passed on by a one-way
407
+ * hand-off from a target;
408
+ * - a hand-back: the top frame's target, which the mode is set for, has finished, and `owner` is
409
+ * its caller, or no one while the target releases. Its frame leaves the stack only after the
410
+ * caller is active again.
411
+ *
412
+ * Clear and an agents change empty the stack before the flow ends, so the mode ends with it, as
413
+ * it ends with any flow. A turn routed away from the target ends the hand-offs the same way.
414
+ */
415
+ private carriedTo;
416
+ /** Whether `owner` is the caller the top hand-off hands back to from `target`. */
417
+ private handsBack;
418
+ /**
419
+ * Set `carried`'s mode for `owner`, which took the task over in a hand-off or its hand-back. A
420
+ * pause the person chose carries with it; the autopilot's own hand-back of an interaction does
421
+ * not, since that interaction settled before the hand-off could start.
422
+ */
423
+ private carry;
380
424
  private capabilityFor;
381
425
  private flowOwner;
382
426
  private bindingFor;
@@ -1 +1 @@
1
- {"version":3,"file":"autopilot-driver.d.ts","sourceRoot":"","sources":["../../../src/autopilot/autopilot-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CA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EAAuE;IACvE,OAAO,CAAC,MAAM;IAqBd,uEAAuE;IACvE,OAAO,CAAC,OAAO;IAWf;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,eAAe;IAavB,mFAAmF;IACnF,OAAO,CAAC,eAAe;IAOvB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IA+BnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,SAAS;IAKjB;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ;IAyBhB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAYnB,yDAAyD;IACzD,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,kBAAkB;IA0B1B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAUxB,0FAA0F;IAC1F,OAAO,CAAC,OAAO;IAUf;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,SAAS;IAajB,kFAAkF;IAClF,OAAO,CAAC,SAAS;IAMjB;;;;OAIG;IACH,OAAO,CAAC,KAAK;IAOb,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,MAAM;IAId;;;OAGG;IACH,OAAO,CAAC,SAAS;IASjB;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,MAAM;CAUf;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,OAAO,KAAG,eAAe,GAAG,SACR,CAAC"}
@@ -179,7 +179,8 @@ export declare class OrchestratingDriver extends BaseDriverDecorator<ChatDriver>
179
179
  *
180
180
  * A failed call ends the turn there, as a Stop does: what it asked for still happens, and the
181
181
  * next agent runs on the next message. Running it now would meet the same wall (a budget, a
182
- * refused account, a full context window), or build on a reply that never came.
182
+ * refused account, a full context window), or build on a reply that never came. The one thing a
183
+ * Stop takes back is a hand-off that has not started (see `afterAgentCall`).
183
184
  */
184
185
  private carryOn;
185
186
  /**
@@ -189,6 +190,11 @@ export declare class OrchestratingDriver extends BaseDriverDecorator<ChatDriver>
189
190
  *
190
191
  * A plain target hands back when its call ends, released or not, as a plain agent is done once
191
192
  * it has answered. A stateful one holds the hand-off until it releases, as it holds its flow.
193
+ *
194
+ * A Stop cancels a hand-off that has not started: the user stopped the turn the caller asked for
195
+ * it in, often during the caller's closing call, so the target is not activated, and the call
196
+ * ends as if it had never asked (a plain caller's turn ends as usual below). A hand-back is not
197
+ * taken back: the target finished the work it was given.
192
198
  */
193
199
  private afterAgentCall;
194
200
  /** How the target of `frame` finished: with `completeHandOff`, or a release and its last reply. */
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAIZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAGX,YAAY,EAIb,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAoBzF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe;AACzB,kDAAkD;AAChD,YAAY;AACd,6EAA6E;GAC3E,UAAU;AACZ,+DAA+D;GAC7D,kBAAkB;AACpB,kDAAkD;GAChD,gBAAgB;AACl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C,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI;IAKvE,qDAAqD;IAC5C,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAc3D;;;;OAIG;IACM,MAAM,IAAI,IAAI;IAKvB;;;;OAIG;IACY,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IA+BrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAoCd,QAAQ;IAuKtB;;;;;;;;;OASG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAe5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,SAAS,CAKjF"}
1
+ {"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAIZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAGX,YAAY,EAIb,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAoBzF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe;AACzB,kDAAkD;AAChD,YAAY;AACd,6EA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ACnC,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAWlD,gDAAgD;IACvC,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI;IAKvE,qDAAqD;IAC5C,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAc3D;;;;OAIG;IACM,MAAM,IAAI,IAAI;IAKvB;;;;OAIG;IACY,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IA+BrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAoCd,QAAQ;IAuKtB;;;;;;;;;OASG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAe5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,SAAS,CAKjF"}
@@ -28,7 +28,7 @@ import type { TurnFailureReason } from '@genesislcap/foundation-ai';
28
28
  * Catalogue of meta event names. This is the documented surface — extend it as
29
29
  * new events are wired in (Tier 2/3 lifecycle, interaction, provider events).
30
30
  */
31
- export type MetaEventType = 'assistant.connected' | 'assistant.disconnected' | 'assistant.popout' | 'assistant.popin' | 'driver.created' | 'driver.wired' | 'driver.unwired' | 'state.changed' | 'turn.start' | 'turn.end' | 'turn.retry' | 'turn.error' | 'tool.failed' | 'tool.unresolved' | 'subagent.started' | 'subagent.completed' | 'subagent.failed' | 'routing.decided' | 'agent.handoff' | 'agent.pinned' | 'agent.unpinned' | 'provider.selected' | 'interaction.requested' | 'interaction.resolved' | 'interaction.external-cost' | 'interaction.external-cost-dropped' | 'interaction.outcome' | 'interaction.outcome-dropped' | 'interaction.step' | 'interaction.checkpoint' | 'interaction.held' | 'interaction.claim-refused' | 'interaction.invoked' | 'autopilot.claimed' | 'autopilot.declined' | 'autopilot.decision-sent' | 'autopilot.acted' | 'autopilot.handed-back' | 'autopilot.paused' | 'autopilot.resumed' | 'autopilot.error' | 'autopilot.refinement' | 'autopilot.handback-presented' | 'autopilot.catch-up' | 'autopilot.cost-dropped' | 'external-diagnostics.folded' | 'context.updated' | 'context.threshold-crossed' | 'context.compacted' | 'context.condensed' | 'panel.toggled' | 'attachment.added' | 'file.read-failed' | 'suggestions.failed' | 'session.cleared' | 'session.switched' | 'session.switch-deferred' | 'persistence.toggled' | 'persistence.saved' | 'persistence.save-failed' | 'persistence.suppressed' | 'persistence.not-resumable' | 'persistence.restored' | 'persistence.resume-planned' | 'persistence.resume-withdrawn' | 'persistence.restore-orphan';
31
+ export type MetaEventType = 'assistant.connected' | 'assistant.disconnected' | 'assistant.popout' | 'assistant.popin' | 'driver.created' | 'driver.wired' | 'driver.unwired' | 'state.changed' | 'turn.start' | 'turn.end' | 'turn.retry' | 'turn.error' | 'tool.failed' | 'tool.unresolved' | 'subagent.started' | 'subagent.completed' | 'subagent.failed' | 'routing.decided' | 'agent.handoff' | 'agent.pinned' | 'agent.unpinned' | 'provider.selected' | 'interaction.requested' | 'interaction.resolved' | 'interaction.external-cost' | 'interaction.external-cost-dropped' | 'interaction.outcome' | 'interaction.outcome-dropped' | 'interaction.step' | 'interaction.checkpoint' | 'interaction.held' | 'interaction.claim-refused' | 'interaction.invoked' | 'autopilot.claimed' | 'autopilot.declined' | 'autopilot.decision-sent' | 'autopilot.acted' | 'autopilot.handed-back' | 'autopilot.paused' | 'autopilot.resumed' | 'autopilot.carried' | 'autopilot.error' | 'autopilot.refinement' | 'autopilot.handback-presented' | 'autopilot.catch-up' | 'autopilot.cost-dropped' | 'external-diagnostics.folded' | 'context.updated' | 'context.threshold-crossed' | 'context.compacted' | 'context.condensed' | 'panel.toggled' | 'attachment.added' | 'file.read-failed' | 'suggestions.failed' | 'session.cleared' | 'session.switched' | 'session.switch-deferred' | 'persistence.toggled' | 'persistence.saved' | 'persistence.save-failed' | 'persistence.suppressed' | 'persistence.not-resumable' | 'persistence.restored' | 'persistence.resume-planned' | 'persistence.resume-withdrawn' | 'persistence.restore-orphan';
32
32
  /**
33
33
  * How much a reader should care about an event — lets a consumer (or an AI
34
34
  * agent) filter the timeline: skip `low` UI/bookkeeping noise, skim `normal`
@@ -1 +1 @@
1
- {"version":3,"file":"debug-event-log.d.ts","sourceRoot":"","sources":["../../../src/state/debug-event-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAErB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,GAClB,iBAAiB,GAEjB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAEhB,eAAe,GACf,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,iBAAiB,GAEjB,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GAEnB,uBAAuB,GACvB,sBAAsB,GACtB,2BAA2B,GAC3B,mCAAmC,GACnC,qBAAqB,GACrB,6BAA6B,GAE7B,kBAAkB,GAClB,wBAAwB,GAExB,kBAAkB,GAClB,2BAA2B,GAC3B,qBAAqB,GAErB,mBAAmB,GACnB,oBAAoB,GACpB,yBAAyB,GACzB,iBAAiB,GACjB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,8BAA8B,GAC9B,oBAAoB,GACpB,wBAAwB,GAExB,6BAA6B,GAE7B,iBAAiB,GACjB,2BAA2B,GAC3B,mBAAmB,GACnB,mBAAmB,GAEnB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GAEpB,iBAAiB,GACjB,kBAAkB,GAClB,yBAAyB,GACzB,qBAAqB,GACrB,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aAAa,CAAC,SAAS,CAAC,CAEnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CA0BrF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAuB7C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
1
+ {"version":3,"file":"debug-event-log.d.ts","sourceRoot":"","sources":["../../../src/state/debug-event-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAErB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,GAClB,iBAAiB,GAEjB,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAEhB,eAAe,GACf,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,iBAAiB,GAEjB,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GAEnB,uBAAuB,GACvB,sBAAsB,GACtB,2BAA2B,GAC3B,mCAAmC,GACnC,qBAAqB,GACrB,6BAA6B,GAE7B,kBAAkB,GAClB,wBAAwB,GAExB,kBAAkB,GAClB,2BAA2B,GAC3B,qBAAqB,GAErB,mBAAmB,GACnB,oBAAoB,GACpB,yBAAyB,GACzB,iBAAiB,GACjB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,8BAA8B,GAC9B,oBAAoB,GACpB,wBAAwB,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,CAC7B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAEN;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAEnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CA0BrF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAuB7C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
@@ -188,8 +188,16 @@ export class AutopilotDriver extends BaseDriverDecorator {
188
188
  // Availability can change with the agent's state (a brief being approved), which nothing
189
189
  // announces; the transcript moving is the cheapest reliable nudge to re-read it.
190
190
  const onHistoryUpdated = () => this.notify();
191
+ const onHandOffStarted = (e) => this.onHandOffStarted(e.detail);
192
+ // A hand-back that ended without its caller taking the lock back leaves nothing to carry to.
193
+ const onHandOffEnded = () => {
194
+ this.handingBack = undefined;
195
+ };
191
196
  inner.addEventListener('flow-owner-changed', onFlowOwnerChanged);
192
197
  inner.addEventListener('history-updated', onHistoryUpdated);
198
+ inner.addEventListener('handoff-started', onHandOffStarted);
199
+ inner.addEventListener('handoff-returned', onHandOffEnded);
200
+ inner.addEventListener('handoff-unwound', onHandOffEnded);
193
201
  this.onDetach(() => {
194
202
  this.disarmWatchdog();
195
203
  clearTimeout(this.stopCheck);
@@ -197,6 +205,9 @@ export class AutopilotDriver extends BaseDriverDecorator {
197
205
  stop();
198
206
  inner.removeEventListener('flow-owner-changed', onFlowOwnerChanged);
199
207
  inner.removeEventListener('history-updated', onHistoryUpdated);
208
+ inner.removeEventListener('handoff-started', onHandOffStarted);
209
+ inner.removeEventListener('handoff-returned', onHandOffEnded);
210
+ inner.removeEventListener('handoff-unwound', onHandOffEnded);
200
211
  this.releaseHeld();
201
212
  this.open = undefined;
202
213
  this.declinedWhilePaused = undefined;
@@ -328,9 +339,15 @@ export class AutopilotDriver extends BaseDriverDecorator {
328
339
  // -----------------------------------------------------------------------------------------------
329
340
  // Persistence (§4.8): the mode is saved with the session and restored with it
330
341
  // -----------------------------------------------------------------------------------------------
331
- /** The mode to save with the session, while it is set for the current flow. */
342
+ /**
343
+ * The mode to save with the session, while it is set for the current flow — or kept for a
344
+ * hand-off's caller while its target releases, saved for that target, as the stack saves it.
345
+ */
332
346
  getPersistedMode() {
333
347
  const owner = this.flowOwner();
348
+ if (!owner && this.handingBack) {
349
+ return { onFor: this.handingBack.flow, mode: this.handingBack.mode };
350
+ }
334
351
  if (!owner || this.onFor !== owner)
335
352
  return undefined;
336
353
  return { onFor: owner, mode: this.mode };
@@ -351,8 +368,9 @@ export class AutopilotDriver extends BaseDriverDecorator {
351
368
  if (!saved)
352
369
  return;
353
370
  this.restored = undefined;
354
- // Another flow took over first, so the saved mode has nothing left to apply to.
355
- if (saved.onFor !== owner)
371
+ // Another flow took over first, so the saved mode has nothing left to apply to — unless it is
372
+ // the caller a saved hand-off hands back to, whose target the mode was saved for (GENC-1751).
373
+ if (saved.onFor !== owner && !this.handsBack(saved.onFor, owner))
356
374
  return;
357
375
  this.onFor = owner;
358
376
  this.mode = saved.mode;
@@ -1076,16 +1094,104 @@ export class AutopilotDriver extends BaseDriverDecorator {
1076
1094
  onFlowOwnerChanged(owner) {
1077
1095
  if (owner === this.onFor)
1078
1096
  return;
1097
+ const carried = this.carriedTo(owner);
1098
+ const current = this.current();
1079
1099
  this.refinements = undefined;
1080
- // "On" is scoped to the flow it was set for: a new flow, or none, starts paused.
1100
+ // "On" is scoped to the flow it was set for: a new flow, or none, starts paused. A hand-off and
1101
+ // its hand-back are not a new flow: the person handed over the whole task (GENC-1751).
1081
1102
  this.onFor = null;
1082
1103
  this.mode = 'paused';
1083
1104
  this.pauseState = undefined;
1105
+ this.handingBack = undefined;
1106
+ this.switchedFrom = undefined;
1107
+ // Each agent's autopilot answers from its own session, so they end with any change of owner.
1084
1108
  this.endSessions();
1085
- if (owner)
1086
- this.adoptRestored(owner);
1109
+ if (carried && owner) {
1110
+ this.carry(carried, owner);
1111
+ }
1112
+ else if (carried) {
1113
+ // The target released; its caller takes the lock back next.
1114
+ this.handingBack = carried;
1115
+ }
1116
+ else {
1117
+ this.switchedFrom = current;
1118
+ if (owner)
1119
+ this.adoptRestored(owner);
1120
+ }
1087
1121
  this.notify();
1088
1122
  }
1123
+ /**
1124
+ * A one-way hand-off with nobody waiting is a plain switch, the caller deactivated, so nothing on
1125
+ * the stack says the owner it changed to took over the same task: its event, raised once the
1126
+ * target is active, does (GENC-1751).
1127
+ */
1128
+ onHandOffStarted(frame) {
1129
+ const from = this.switchedFrom;
1130
+ this.switchedFrom = undefined;
1131
+ if (frame.returnTo || (from === null || from === void 0 ? void 0 : from.flow) !== frame.caller)
1132
+ return;
1133
+ const owner = this.flowOwner();
1134
+ if (owner !== frame.target || this.onFor === owner)
1135
+ return;
1136
+ this.carry(from, owner);
1137
+ this.notify();
1138
+ }
1139
+ /** The mode set for the current flow, or kept for the caller of a hand-back under way. */
1140
+ current() {
1141
+ if (this.handingBack)
1142
+ return this.handingBack;
1143
+ if (!this.onFor)
1144
+ return undefined;
1145
+ return Object.assign({ flow: this.onFor, mode: this.mode }, (this.pauseState && { pause: this.pauseState }));
1146
+ }
1147
+ /**
1148
+ * The mode that carries to `owner` because the owner changed for a hand-off or its hand-back, as
1149
+ * the hand-off stack shows it at that moment (GENC-1751):
1150
+ * - a hand-off: `owner` is the top frame's target, which has not finished. Its frame is on the
1151
+ * stack before the target is activated, and so is a waiting caller's passed on by a one-way
1152
+ * hand-off from a target;
1153
+ * - a hand-back: the top frame's target, which the mode is set for, has finished, and `owner` is
1154
+ * its caller, or no one while the target releases. Its frame leaves the stack only after the
1155
+ * caller is active again.
1156
+ *
1157
+ * Clear and an agents change empty the stack before the flow ends, so the mode ends with it, as
1158
+ * it ends with any flow. A turn routed away from the target ends the hand-offs the same way.
1159
+ */
1160
+ carriedTo(owner) {
1161
+ var _a, _b, _c;
1162
+ const current = this.current();
1163
+ if (!current)
1164
+ return undefined;
1165
+ const stack = (_c = (_b = (_a = this.inner).getHandOffStack) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];
1166
+ const top = stack[stack.length - 1];
1167
+ if (!top)
1168
+ return undefined;
1169
+ if (owner !== null && top.target === owner && !top.outcome)
1170
+ return current;
1171
+ if (top.outcome && top.target === current.flow && (owner === null || owner === top.caller)) {
1172
+ return current;
1173
+ }
1174
+ return undefined;
1175
+ }
1176
+ /** Whether `owner` is the caller the top hand-off hands back to from `target`. */
1177
+ handsBack(target, owner) {
1178
+ var _a, _b, _c;
1179
+ const stack = (_c = (_b = (_a = this.inner).getHandOffStack) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];
1180
+ const top = stack[stack.length - 1];
1181
+ return !!(top === null || top === void 0 ? void 0 : top.outcome) && top.target === target && top.caller === owner;
1182
+ }
1183
+ /**
1184
+ * Set `carried`'s mode for `owner`, which took the task over in a hand-off or its hand-back. A
1185
+ * pause the person chose carries with it; the autopilot's own hand-back of an interaction does
1186
+ * not, since that interaction settled before the hand-off could start.
1187
+ */
1188
+ carry(carried, owner) {
1189
+ var _a;
1190
+ this.onFor = owner;
1191
+ this.mode = carried.mode;
1192
+ this.pauseState = ((_a = carried.pause) === null || _a === void 0 ? void 0 : _a.scope) === 'until-resumed' ? carried.pause : undefined;
1193
+ this.record('autopilot.carried', { from: carried.flow, to: owner, mode: carried.mode });
1194
+ }
1089
1195
  capabilityFor(scope) {
1090
1196
  const owner = scope.flowOwner;
1091
1197
  if (!owner || !this.bindingFor(owner))
@@ -370,7 +370,8 @@ export class OrchestratingDriver extends BaseDriverDecorator {
370
370
  *
371
371
  * A failed call ends the turn there, as a Stop does: what it asked for still happens, and the
372
372
  * next agent runs on the next message. Running it now would meet the same wall (a budget, a
373
- * refused account, a full context window), or build on a reply that never came.
373
+ * refused account, a full context window), or build on a reply that never came. The one thing a
374
+ * Stop takes back is a hand-off that has not started (see `afterAgentCall`).
374
375
  */
375
376
  carryOn(result) {
376
377
  return __awaiter(this, void 0, void 0, function* () {
@@ -392,12 +393,20 @@ export class OrchestratingDriver extends BaseDriverDecorator {
392
393
  *
393
394
  * A plain target hands back when its call ends, released or not, as a plain agent is done once
394
395
  * it has answered. A stateful one holds the hand-off until it releases, as it holds its flow.
396
+ *
397
+ * A Stop cancels a hand-off that has not started: the user stopped the turn the caller asked for
398
+ * it in, often during the caller's closing call, so the target is not activated, and the call
399
+ * ends as if it had never asked (a plain caller's turn ends as usual below). A hand-back is not
400
+ * taken back: the target finished the work it was given.
395
401
  */
396
402
  afterAgentCall() {
397
403
  return __awaiter(this, void 0, void 0, function* () {
398
404
  const request = this.chatDriver.getHandOffRequest();
399
- if (request)
405
+ if (request && !this.cancelled)
400
406
  return this.startHandOff(request);
407
+ if (request) {
408
+ logger.debug(`OrchestratingDriver: stopped before the hand-off to "${request.to}" started`);
409
+ }
401
410
  const active = this.agentSession.getActive();
402
411
  if (!active)
403
412
  return undefined;
@@ -95,6 +95,8 @@ export const META_EVENT_IMPORTANCE = {
95
95
  'autopilot.handed-back': 'normal',
96
96
  'autopilot.paused': 'normal',
97
97
  'autopilot.resumed': 'normal',
98
+ // The mode went with the task across a hand-off or its hand-back, rather than ending with the flow.
99
+ 'autopilot.carried': 'normal',
98
100
  // The wrapper itself failed: the journey stops being automatic without anyone choosing that.
99
101
  'autopilot.error': 'high',
100
102
  // A written answer counted against the step's limit; reaching it withdraws `reply`.
@@ -262,7 +264,7 @@ export const DEBUG_LOG_README = [
262
264
  "kind:'turn'.`agentSnapshot` — the active agent's own view of its internal state, captured at that turn. An agent opts into this by exposing a `getDebugSnapshot()` that returns JSON-serializable per-state info; stateful/flow agents wire it automatically, so you can watch a flow advance turn-by-turn (e.g. current step, cursor, collected fields, pending changes). Absent for agents that don't expose one.",
263
265
  "kind:'event' — a meta/lifecycle event. `type` names it (see below); `detail` carries structured data. `detail.placement` is the emitting UI instance: 'bubble' (collapsed), 'panel' (popped-out), or 'standalone'.",
264
266
  "Each 'event' also has an `importance`: 'high' (failures/limits — turn.error, tool.failed, subagent.failed, file.read-failed, suggestions.failed, context.threshold-crossed), 'normal' (session flow — connects, turns, retries, handoffs, agent/provider changes, interactions, sub-agent start/complete), or 'low' (skippable UI/bookkeeping noise — panel.toggled, attachment.added, driver.wired/unwired, context.updated, context.condensed). To skim, ignore importance:'low'; to triage a failure, filter to importance:'high' then read the nearby messages and turns. A 'high' turn.error is often preceded by one or more 'normal' turn.retry events for the same reason — read them together to see how many attempts were made before bailing. 'message' and 'turn' entries carry no importance — they are the substance, always read them.",
265
- 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted/ai-service-error, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, for ai-service-error the code (one of AI_SERVICE_ERROR_CODES, e.g. NO_API_KEY) and the status the AI service answered with — its own text goes to the browser console only, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted/ai_service_error; budget_exhausted and provider_refused are terminal for the PARENT turn too, and so is ai_service_error when the refusal is about the service rather than the request and came from the vendor the parent calls — the parent stops rather than calling the model again into the same wall; after context_exhausted the parent goes on, but its own next call is likely to stop on the same guard), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver; detail.ownerPath names the agents that actually asked, outermost first, the last being the one whose tool requested it, and detail.heldBy says who held it when it opened: user, or the id of the interceptor that claimed it, such as autopilot; on interaction.resolved, detail.answeredBy is who answered — the claimant id when it settled through its own hold, user for any other answer (a click counts as the person even on a widget a claimant held) — absent when it closed unanswered (a timeout or a stop), and absent too when it settled by itself other than through the hold of a claimant — a widget registered resolvesItself (one that does its work and settles on its own, asking the person nothing, such as a generation run), or one outcome its controller said settled itself (ctx.resolve with resolvedItself, such as a generation phase that failed outright before its review gate ever asked anything) — which then carries detail.resolvedItself: true instead, as the interaction message does — nobody answered it, and the platform cannot tell it finishing from the person interrupting it (a Skip), so only the result of the widget itself can say which; the same value is stamped on the interaction message as answeredBy and on the result the asking tool handler receives (absent there in the same cases), and when it is not user the tool result that interaction returned carries a decidedOnUsersBehalf record, so the model was told the choice was not made by the person; detail.edits, present only when non-zero, counts the editing actions a claimant ran on the widget before it was settled, whoever settled it, and those edits are stamped on the interaction message as edits, each with by, action, choice and args when it had some, in the order they ran, while a decidedOnUsersBehalf record carries their choice texts as edits, and when the person settled it after such edits the tool result carries an editedOnUsersBehalf record instead — the framing and those choice texts — so the model knows the widget was changed on the user behalf before the user answered, and that the user then confirmed it by finishing it), interaction.held (a claimant moved a pending interaction to the person or back to itself — detail.heldBy is the new holder, detail.claimant the interceptor; detail.late: true is an interceptor that declined it when it opened claiming it afterwards, such as the autopilot resumed while it was open; a widget held by anything but user was not answered by the person), interaction.claim-refused (a claim on a userOnly interaction, which stays with the person — detail.claimant + reason), autopilot.* (the autopilot, a decorator that answers interactions on behalf of the user — autopilot.claimed / autopilot.declined say whether it took each interaction and, for a decline, detail.reason: paused, other-flow, no-autopilot, unavailable, userOnly, policy or no-controller; one declined as paused that is still open when the person resumes the autopilot is looked at again, and the autopilot.claimed or autopilot.declined recorded for it then carries detail.onResume: true (a decline then can also be claimed-elsewhere, another interceptor having claimed it first); a restored mode looks at nothing; autopilot.decision-sent is what it was sent (detail.chars; detail.nothingEnabled: true when every action on the widget was unavailable — a gate whose controller said it was asking, such as a failed build the autopilot may not cancel — so it could only hand it back, which it may then do even after the person asked it to decide it itself; a widget whose controller says it is working (ctx.setWorking) is never sent a decision until it says it is asking, even when an action is enabled or the person resumes the autopilot); autopilot.acted is what it did (detail.action, detail.note, detail.finished); autopilot.handed-back is a decision it gave to the person (detail.reason and detail.trigger: model, no-decision or error); autopilot.paused / autopilot.resumed are mode changes (detail.scope, detail.trigger, detail.decideYourself when the person resumed during a hand-back; detail.trigger is restored when the mode came back with the session after a reload, applied once its flow re-activated, which starts nothing by itself); autopilot.error is the wrapper itself failing; autopilot.refinement counts a refining action against its step — a written answer (reply) or a widget action declared refines, such as a regenerate with instructions, counted together (detail.action, detail.stepKey, detail.count, detail.limitReached, after which every refining action is withdrawn for that step: not listed, and refused; the decision and every relisting of its actions say how many are left at the step, as a line Refinements left at this step: N, wherever the widget has a refining action); autopilot.handback-presented is the turn-level hand-back, shown when a working turn ended needing the person with no widget to hand over (detail.why: max-iterations, context-exhausted, failure or question; detail.options; detail.choice once answered); autopilot.catch-up is the autopilot being given the whole visible transcript at once (detail.why: first, for its first decision in a flow or after a reload; size, when its own history passed its budget and was rebuilt short — detail.ownChars; or compacted, when a compaction removed the last message it had seen, so it reads the summary and everything since, short; in each, what it had sent on the user behalf is included and labelled as its own, since its own history does not hold it); autopilot.cost-dropped is autopilot spend that no message carries, so it is NOT in the session total (detail.costUsd and detail.why: handed-back, aborted or stale for a written question it answered that no reply was sent for — stale when a pause, a resume, a new turn or the end of its flow came before the answer landed, which then went nowhere — or no-recorder when the driver had no way to book a decision to its interaction); a hand-back trigger can also be budget (the decision passed its spend cap), watchdog (its work went quiet: no ready surface and no heartbeat, or its own decision stalled with no model call landing, which stops that decision) or detached (the autopilot was removed while it held the interaction, which went to the person with no reason shown). To debug one autopilot decision, follow its interactionId: interaction.requested (heldBy), autopilot.claimed, autopilot.decision-sent, autopilot.acted or autopilot.handed-back, interaction.invoked, interaction.resolved (answeredBy), then the next turn of the working agent), interaction.invoked (a claimant ran one of the actions the widget itself exposes, through its hold, the same code the button runs — detail.claimant, detail.action (an option id, select or reply) and detail.finished, whether that settled the interaction, and when it did not, the run is recorded as an edit; the choice and narration it recorded reach the result of the tool that asked as decidedOnUsersBehalf), interaction.step (a long action run as named steps through runSteps, which survive a reload — detail.step and detail.outcome: started, done, skipped when the step was already done before a reload, or resumed when it started before a reload and runs again with what it saved part-way, such as a job id it re-attaches to), interaction.checkpoint (the checkpoints a conversation keeps for its long actions: the one in flight, and each one a reload cut, held apart until a request of its own widget type takes it over, so a resumed flow that opens other long widgets first, which save their own, loses nothing — detail.action: resumed when a reload cut the work and a request of the same widget type that the registration sameWork agrees is the same work took it over, refused when sameWork said a new request is different work (detail.saved is the identity it kept; detail.kept: true, since it stays for a later request of that type, and is offered to every one until one agrees) or when runSteps found the handed-over checkpoint malformed and started fresh (detail.reason, detail.saved), or cleared when its flow ended, once per checkpoint, with detail.cut: true for one a reload cut that nothing took over), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',
267
+ 'Event types: assistant.connected/disconnected (mount + placement + whether the session was created or restored), assistant.popout/popin (window placement), driver.created/wired/unwired (which driver is live and why it stops/starts responding across a popout), state.changed (idle↔loading), turn.start/turn.end (turn boundary; turn.end carries durationMs), turn.retry (a recoverable in-turn retry — detail.reason plus attempt/maxAttempts; for malformed calls also finishMessage; for empty responses also the provider finishReason + thoughtsTokens + parts breakdown), turn.error (a turn failed or hit a guardrail — detail.reason is one of exception/malformed-function-call/empty-response/unknown-tool-limit/max-iterations/response-truncated/refusal/budget-exhausted/provider-refused/context-exhausted/ai-service-error, plus reason-specific diagnostics: attempts (for empty-response also finishReason + thoughtsTokens + a parts breakdown, distinguishing a thinking-only STOP from a truly empty turn), finishMessage, for response-truncated the model + maxTokens + outputTokens + tools, unknownTools (split into staleTools — real earlier this activation but retired by the current state or hidden behind an open exclusive fold — and hallucinatedTools — never advertised) + availableTools, iterations + limit, for budget-exhausted the budgetUsd + spentUsd figures reported by the proxy plus the resolved vendor, for provider-refused the kind (spend|auth) plus the upstream status and error type — the vendor refusing the ACCOUNT rather than us refusing to spend, so the remedy is a top-up or a key rotation rather than a raised cap, and the kind is the only place that distinction survives because the user-facing copy is deliberately cause-free, for context-exhausted the estimated contextTokens against the guard that stopped the turn plus the iterations reached — the driver ending a runaway tool loop at the edge of the context window rather than issuing a request the provider would reject, so the transcript survives intact and can still be compacted, for ai-service-error the code (one of AI_SERVICE_ERROR_CODES, e.g. NO_API_KEY) and the status the AI service answered with — its own text goes to the browser console only, or name + message for exceptions), tool.failed (a tool threw), tool.unresolved (the model called a tool that could not be dispatched — detail.kind is folded/fold-hidden/stale/unknown, plus tool + agent and, for the counted kinds, the consecutive streak; the recurring lead-up to an unknown-tool-limit turn.error), subagent.started/completed/failed (the lifecycle of a `requestSubAgent` delegation — detail.agent names the sub-agent; these bracket the sub-agent turns that appear as kind:turn entries with an N-M `turnIndex`; subagent.failed also carries detail.reason, one of max_iterations/malformed_tool_call/empty_response/unknown_tool_limit/timeout/response_truncated/refusal/budget_exhausted/provider_refused/context_exhausted/ai_service_error; budget_exhausted and provider_refused are terminal for the PARENT turn too, and so is ai_service_error when the refusal is about the service rather than the request and came from the vendor the parent calls — the parent stops rather than calling the model again into the same wall; after context_exhausted the parent goes on, but its own next call is likely to stop on the same guard), agent.handoff (routing; from=null is the initial activation), agent.pinned/unpinned (forced routing), routing.decided (ONE PER ROUTING DECISION — see its own paragraph below), provider.selected (the resolved provider for the upcoming turns — detail.provider is the registry SLOT/tier name, detail.model the concrete model behind it and detail.vendor its vendor; emitted only when the slot CHANGES, so read the per-turn `model` for the model of any given call rather than assuming the nearest event still applies), interaction.requested/resolved (blocking user widgets — explain quiet gaps; note that when a sub-agent opens a widget, detail.agent — and the agentName on the interaction message — is the HOST agent that owns the widget, NOT the sub-agent that asked, because widgets render and resolve on the host driver; detail.ownerPath names the agents that actually asked, outermost first, the last being the one whose tool requested it, and detail.heldBy says who held it when it opened: user, or the id of the interceptor that claimed it, such as autopilot; on interaction.resolved, detail.answeredBy is who answered — the claimant id when it settled through its own hold, user for any other answer (a click counts as the person even on a widget a claimant held) — absent when it closed unanswered (a timeout or a stop), and absent too when it settled by itself other than through the hold of a claimant — a widget registered resolvesItself (one that does its work and settles on its own, asking the person nothing, such as a generation run), or one outcome its controller said settled itself (ctx.resolve with resolvedItself, such as a generation phase that failed outright before its review gate ever asked anything) — which then carries detail.resolvedItself: true instead, as the interaction message does — nobody answered it, and the platform cannot tell it finishing from the person interrupting it (a Skip), so only the result of the widget itself can say which; the same value is stamped on the interaction message as answeredBy and on the result the asking tool handler receives (absent there in the same cases), and when it is not user the tool result that interaction returned carries a decidedOnUsersBehalf record, so the model was told the choice was not made by the person; detail.edits, present only when non-zero, counts the editing actions a claimant ran on the widget before it was settled, whoever settled it, and those edits are stamped on the interaction message as edits, each with by, action, choice and args when it had some, in the order they ran, while a decidedOnUsersBehalf record carries their choice texts as edits, and when the person settled it after such edits the tool result carries an editedOnUsersBehalf record instead — the framing and those choice texts — so the model knows the widget was changed on the user behalf before the user answered, and that the user then confirmed it by finishing it), interaction.held (a claimant moved a pending interaction to the person or back to itself — detail.heldBy is the new holder, detail.claimant the interceptor; detail.late: true is an interceptor that declined it when it opened claiming it afterwards, such as the autopilot resumed while it was open; a widget held by anything but user was not answered by the person), interaction.claim-refused (a claim on a userOnly interaction, which stays with the person — detail.claimant + reason), autopilot.* (the autopilot, a decorator that answers interactions on behalf of the user — autopilot.claimed / autopilot.declined say whether it took each interaction and, for a decline, detail.reason: paused, other-flow, no-autopilot, unavailable, userOnly, policy or no-controller; one declined as paused that is still open when the person resumes the autopilot is looked at again, and the autopilot.claimed or autopilot.declined recorded for it then carries detail.onResume: true (a decline then can also be claimed-elsewhere, another interceptor having claimed it first); a restored mode looks at nothing; autopilot.decision-sent is what it was sent (detail.chars; detail.nothingEnabled: true when every action on the widget was unavailable — a gate whose controller said it was asking, such as a failed build the autopilot may not cancel — so it could only hand it back, which it may then do even after the person asked it to decide it itself; a widget whose controller says it is working (ctx.setWorking) is never sent a decision until it says it is asking, even when an action is enabled or the person resumes the autopilot); autopilot.acted is what it did (detail.action, detail.note, detail.finished); autopilot.handed-back is a decision it gave to the person (detail.reason and detail.trigger: model, no-decision or error); autopilot.paused / autopilot.resumed are mode changes (detail.scope, detail.trigger, detail.decideYourself when the person resumed during a hand-back; detail.trigger is restored when the mode came back with the session after a reload, applied once its flow re-activated, which starts nothing by itself); autopilot.carried is the mode, running or paused, going with the task to the agent that took it over, rather than ending with the flow as on any other change of flow owner: to the target of a hand-off, or back to its caller on the hand-back (detail.from, detail.to, detail.mode); a pause the person chose goes with it, and Stop and Clear still end it; a mode restored for the target of a hand-off applies to its caller when the reload hands back; autopilot.error is the wrapper itself failing; autopilot.refinement counts a refining action against its step — a written answer (reply) or a widget action declared refines, such as a regenerate with instructions, counted together (detail.action, detail.stepKey, detail.count, detail.limitReached, after which every refining action is withdrawn for that step: not listed, and refused; the decision and every relisting of its actions say how many are left at the step, as a line Refinements left at this step: N, wherever the widget has a refining action); autopilot.handback-presented is the turn-level hand-back, shown when a working turn ended needing the person with no widget to hand over (detail.why: max-iterations, context-exhausted, failure or question; detail.options; detail.choice once answered); autopilot.catch-up is the autopilot being given the whole visible transcript at once (detail.why: first, for its first decision in a flow or after a reload; size, when its own history passed its budget and was rebuilt short — detail.ownChars; or compacted, when a compaction removed the last message it had seen, so it reads the summary and everything since, short; in each, what it had sent on the user behalf is included and labelled as its own, since its own history does not hold it); autopilot.cost-dropped is autopilot spend that no message carries, so it is NOT in the session total (detail.costUsd and detail.why: handed-back, aborted or stale for a written question it answered that no reply was sent for — stale when a pause, a resume, a new turn or the end of its flow came before the answer landed, which then went nowhere — or no-recorder when the driver had no way to book a decision to its interaction); a hand-back trigger can also be budget (the decision passed its spend cap), watchdog (its work went quiet: no ready surface and no heartbeat, or its own decision stalled with no model call landing, which stops that decision) or detached (the autopilot was removed while it held the interaction, which went to the person with no reason shown). To debug one autopilot decision, follow its interactionId: interaction.requested (heldBy), autopilot.claimed, autopilot.decision-sent, autopilot.acted or autopilot.handed-back, interaction.invoked, interaction.resolved (answeredBy), then the next turn of the working agent), interaction.invoked (a claimant ran one of the actions the widget itself exposes, through its hold, the same code the button runs — detail.claimant, detail.action (an option id, select or reply) and detail.finished, whether that settled the interaction, and when it did not, the run is recorded as an edit; the choice and narration it recorded reach the result of the tool that asked as decidedOnUsersBehalf), interaction.step (a long action run as named steps through runSteps, which survive a reload — detail.step and detail.outcome: started, done, skipped when the step was already done before a reload, or resumed when it started before a reload and runs again with what it saved part-way, such as a job id it re-attaches to), interaction.checkpoint (the checkpoints a conversation keeps for its long actions: the one in flight, and each one a reload cut, held apart until a request of its own widget type takes it over, so a resumed flow that opens other long widgets first, which save their own, loses nothing — detail.action: resumed when a reload cut the work and a request of the same widget type that the registration sameWork agrees is the same work took it over, refused when sameWork said a new request is different work (detail.saved is the identity it kept; detail.kept: true, since it stays for a later request of that type, and is offered to every one until one agrees) or when runSteps found the handed-over checkpoint malformed and started fresh (detail.reason, detail.saved), or cleared when its flow ended, once per checkpoint, with detail.cut: true for one a reload cut that nothing took over), context.updated/threshold-crossed (token + cost), context.condensed (a stale tool payload was collapsed out of the model-bound history by a `condenseWhen` declaration on the tool — detail.tool + toolCallId, target args|response, trigger (superseded:<key> or age:<n>), stubLen, and an estimated tokensSaved; stored history and this log keep the FULL payload, so the model-visible slice at any point is the full history minus the condensations recorded up to then), panel.toggled, attachment.added, file.read-failed, suggestions.failed.',
266
268
  'Sub-agent meta events: a sub-agent\'s own turn.retry/turn.error/tool.failed/tool.unresolved events are merged into this same timeline, tagged with `detail.subAgent` — a `"<parent> › <sub-agent>"` breadcrumb that composes when nested (e.g. `"UI Builder › Planner › Grounding"`) — and interleaved by their original timestamps within the subagent.started→completed/failed bracket. These are the per-attempt/per-failure signals that do NOT appear among the sub-agent\'s (hoisted) messages: a malformed/empty attempt that gets retried produces no message, and the stale-vs-hallucinated split and streak counts live only on the event. A sub-agent\'s high-volume, message-derivable events (turn.start/turn.end, provider.selected, context.updated) are intentionally NOT merged — read its hoisted messages for model/tokens/cost and turn-by-turn activity, and the bracketing subagent.* events for the run\'s span.',
267
269
  "`meta` holds context captured at export time: agentSummary (full agent configs), context (active model, contextTokens/contextLimit/contextUsagePercent for the last call, and the session totals — sessionCostUsd, sessionTokensConsumed, and the four-bucket sessionUsage lifted to the top of this log), activeDebugSnapshot (the active agent's `getDebugSnapshot()` taken fresh at export — reflects state NOW, which may have advanced beyond the last turn's agentSnapshot), debug (optional host-supplied debug state), host, and the export timestamp.",
268
270
  'Note the two different scopes in `meta.context`: `contextTokens` is the prompt size of the LAST call (against `contextLimit`, the model context window), while `sessionUsage`/`sessionTokensConsumed` are cumulative BILLED throughput. Every turn resends the conversation, so the cumulative figure counts each turn’s prompt again in the next turn’s and is expected to dwarf the context size — that is not double-counting.',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/ai-assistant",
3
3
  "description": "Genesis AI Assistant micro-frontend",
4
- "version": "15.85.0",
4
+ "version": "15.86.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/dts/index.d.ts",
@@ -92,31 +92,31 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@genesislcap/foundation-comms": "15.85.0",
96
- "@genesislcap/foundation-testing": "15.85.0",
97
- "@genesislcap/genx": "15.85.0",
98
- "@genesislcap/ts-builder": "15.85.0",
99
- "@genesislcap/uvu-playwright-builder": "15.85.0",
100
- "@genesislcap/vite-builder": "15.85.0",
101
- "@genesislcap/webpack-builder": "15.85.0",
95
+ "@genesislcap/foundation-comms": "15.86.0",
96
+ "@genesislcap/foundation-testing": "15.86.0",
97
+ "@genesislcap/genx": "15.86.0",
98
+ "@genesislcap/ts-builder": "15.86.0",
99
+ "@genesislcap/uvu-playwright-builder": "15.86.0",
100
+ "@genesislcap/vite-builder": "15.86.0",
101
+ "@genesislcap/webpack-builder": "15.86.0",
102
102
  "@types/dompurify": "^3.0.5",
103
103
  "@types/marked": "^5.0.2",
104
104
  "esbuild": "0.25.12"
105
105
  },
106
106
  "dependencies": {
107
- "@genesislcap/foundation-ai": "15.85.0",
108
- "@genesislcap/foundation-logger": "15.85.0",
109
- "@genesislcap/foundation-notifications": "15.85.0",
110
- "@genesislcap/foundation-redux": "15.85.0",
111
- "@genesislcap/foundation-ui": "15.85.0",
112
- "@genesislcap/foundation-utils": "15.85.0",
113
- "@genesislcap/rapid-design-system": "15.85.0",
114
- "@genesislcap/web-core": "15.85.0",
107
+ "@genesislcap/foundation-ai": "15.86.0",
108
+ "@genesislcap/foundation-logger": "15.86.0",
109
+ "@genesislcap/foundation-notifications": "15.86.0",
110
+ "@genesislcap/foundation-redux": "15.86.0",
111
+ "@genesislcap/foundation-ui": "15.86.0",
112
+ "@genesislcap/foundation-utils": "15.86.0",
113
+ "@genesislcap/rapid-design-system": "15.86.0",
114
+ "@genesislcap/web-core": "15.86.0",
115
115
  "dompurify": "^3.3.1",
116
116
  "marked": "^17.0.3"
117
117
  },
118
118
  "peerDependencies": {
119
- "@genesislcap/foundation-comms": "^15.85.0"
119
+ "@genesislcap/foundation-comms": "^15.86.0"
120
120
  },
121
121
  "peerDependenciesMeta": {
122
122
  "@genesislcap/foundation-comms": {