@genesislcap/ai-assistant 15.96.3-GENC-1640.2 → 15.97.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.
@@ -5154,39 +5154,6 @@
5154
5154
  "parameters": [],
5155
5155
  "name": "getTurnSnapshots"
5156
5156
  },
5157
- {
5158
- "kind": "MethodSignature",
5159
- "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getWaitingCallers:member(1)",
5160
- "docComment": "/**\n * The agent behind each hand-off frame's caller, oldest first, so a save can ask each whether it `resumable` (GENC-1640): the live instance when it waits live, else the configured one.\n *\n * @beta\n */\n",
5161
- "excerptTokens": [
5162
- {
5163
- "kind": "Content",
5164
- "text": "getWaitingCallers?(): "
5165
- },
5166
- {
5167
- "kind": "Reference",
5168
- "text": "AgentConfig",
5169
- "canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
5170
- },
5171
- {
5172
- "kind": "Content",
5173
- "text": "[]"
5174
- },
5175
- {
5176
- "kind": "Content",
5177
- "text": ";"
5178
- }
5179
- ],
5180
- "isOptional": true,
5181
- "returnTypeTokenRange": {
5182
- "startIndex": 1,
5183
- "endIndex": 3
5184
- },
5185
- "releaseTag": "Beta",
5186
- "overloadIndex": 1,
5187
- "parameters": [],
5188
- "name": "getWaitingCallers"
5189
- },
5190
5157
  {
5191
5158
  "kind": "MethodSignature",
5192
5159
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#invokeAsUser:member(1)",
@@ -5743,7 +5710,7 @@
5743
5710
  {
5744
5711
  "kind": "MethodSignature",
5745
5712
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#restoreHandOffData:member(1)",
5746
- "docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. With `interrupted` true nothing comes back. A frozen session saves only its waiting callers' data, which resume, so a host restoring one passes `false`.\n *\n * @beta\n */\n",
5713
+ "docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. Nothing comes back from a frozen (`interrupted`) session, whose flow does not resume.\n *\n * @beta\n */\n",
5747
5714
  "excerptTokens": [
5748
5715
  {
5749
5716
  "kind": "Content",
@@ -5804,7 +5771,7 @@
5804
5771
  {
5805
5772
  "kind": "MethodSignature",
5806
5773
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#restoreHandOffStack:member(1)",
5807
- "docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state, is unwound with `handoff-unwound`. `interrupted` says the save was frozen: the running target's state was dropped, but the waiting callers' were kept, so when the top frame's target had not finished its outcome is `target-interrupted`. When the top frame's target had finished, or has gone, or was interrupted, its caller is due to resume: `resume` names it and the note its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks` names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.\n *\n * @beta\n */\n",
5774
+ "docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state (`interrupted` drops them all), is unwound with `handoff-unwound`. When the top frame's target had finished, or has gone, its caller is due to resume: `resume` names it and the note its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks` names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.\n *\n * @beta\n */\n",
5808
5775
  "excerptTokens": [
5809
5776
  {
5810
5777
  "kind": "Content",
@@ -12609,42 +12576,6 @@
12609
12576
  "isAbstract": false,
12610
12577
  "name": "getTurnSnapshots"
12611
12578
  },
12612
- {
12613
- "kind": "Method",
12614
- "canonicalReference": "@genesislcap/ai-assistant!BaseDriverDecorator#getWaitingCallers:member(1)",
12615
- "docComment": "",
12616
- "excerptTokens": [
12617
- {
12618
- "kind": "Content",
12619
- "text": "getWaitingCallers(): "
12620
- },
12621
- {
12622
- "kind": "Reference",
12623
- "text": "AgentConfig",
12624
- "canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
12625
- },
12626
- {
12627
- "kind": "Content",
12628
- "text": "[]"
12629
- },
12630
- {
12631
- "kind": "Content",
12632
- "text": ";"
12633
- }
12634
- ],
12635
- "isStatic": false,
12636
- "returnTypeTokenRange": {
12637
- "startIndex": 1,
12638
- "endIndex": 3
12639
- },
12640
- "releaseTag": "Beta",
12641
- "isProtected": false,
12642
- "overloadIndex": 1,
12643
- "parameters": [],
12644
- "isOptional": false,
12645
- "isAbstract": false,
12646
- "name": "getWaitingCallers"
12647
- },
12648
12579
  {
12649
12580
  "kind": "Property",
12650
12581
  "canonicalReference": "@genesislcap/ai-assistant!BaseDriverDecorator#inner:member",
@@ -30602,7 +30533,7 @@
30602
30533
  {
30603
30534
  "kind": "TypeAlias",
30604
30535
  "canonicalReference": "@genesislcap/ai-assistant!HandOffOutcomeKind:type",
30605
- "docComment": "/**\n * How a hand-off ended (GENC-1737): - `completed`: the target called `completeHandOff`; - `released`: the target called `releaseAgent`, or, a plain one, ended its turn; - `cleared`: the user cleared the chat; - `agent-removed`: the caller or the target is no longer in the agent list, found on restore; - `target-interrupted`: a reload cut the target's work short and it cannot resume (its `resumable` was `false`), so its unsaved work is lost; the caller's own state was saved, so the caller resumes and is told, and decides what to do next, such as handing off again; - `state-lost`: the caller's saved state is gone, so it cannot resume: a stateful caller whose state was not saved, or a change to the agents, which disposes them.\n *\n * @beta\n */\n",
30536
+ "docComment": "/**\n * How a hand-off ended (GENC-1737): - `completed`: the target called `completeHandOff`; - `released`: the target called `releaseAgent`, or, a plain one, ended its turn; - `cleared`: the user cleared the chat; - `agent-removed`: the caller or the target is no longer in the agent list, found on restore; - `state-lost`: the caller's saved state is gone, so it cannot resume: a session saved while its flow could not be resumed, or a change to the agents, which disposes them.\n *\n * @beta\n */\n",
30606
30537
  "excerptTokens": [
30607
30538
  {
30608
30539
  "kind": "Content",
@@ -30610,7 +30541,7 @@
30610
30541
  },
30611
30542
  {
30612
30543
  "kind": "Content",
30613
- "text": "'completed' | 'released' | 'cleared' | 'agent-removed' | 'target-interrupted' | 'state-lost'"
30544
+ "text": "'completed' | 'released' | 'cleared' | 'agent-removed' | 'state-lost'"
30614
30545
  },
30615
30546
  {
30616
30547
  "kind": "Content",
@@ -37411,46 +37342,10 @@
37411
37342
  "isAbstract": false,
37412
37343
  "name": "getSuggestions"
37413
37344
  },
37414
- {
37415
- "kind": "Method",
37416
- "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getWaitingCallers:member(1)",
37417
- "docComment": "/**\n * The agent behind each hand-off frame's caller, oldest first, so a save can ask each whether it `resumable` (GENC-1640): the live instance when it waits live, else the configured one.\n */\n",
37418
- "excerptTokens": [
37419
- {
37420
- "kind": "Content",
37421
- "text": "getWaitingCallers(): "
37422
- },
37423
- {
37424
- "kind": "Reference",
37425
- "text": "AgentConfig",
37426
- "canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
37427
- },
37428
- {
37429
- "kind": "Content",
37430
- "text": "[]"
37431
- },
37432
- {
37433
- "kind": "Content",
37434
- "text": ";"
37435
- }
37436
- ],
37437
- "isStatic": false,
37438
- "returnTypeTokenRange": {
37439
- "startIndex": 1,
37440
- "endIndex": 3
37441
- },
37442
- "releaseTag": "Beta",
37443
- "isProtected": false,
37444
- "overloadIndex": 1,
37445
- "parameters": [],
37446
- "isOptional": false,
37447
- "isAbstract": false,
37448
- "name": "getWaitingCallers"
37449
- },
37450
37345
  {
37451
37346
  "kind": "Method",
37452
37347
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#restoreHandOffData:member(1)",
37453
- "docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. With `interrupted` true nothing comes back. A frozen session saves only its waiting callers' data, which resume, so a host restoring one passes `false`.\n */\n",
37348
+ "docComment": "/**\n * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. Nothing comes back from a frozen (`interrupted`) session, whose flow does not resume.\n */\n",
37454
37349
  "excerptTokens": [
37455
37350
  {
37456
37351
  "kind": "Content",
@@ -37514,7 +37409,7 @@
37514
37409
  {
37515
37410
  "kind": "Method",
37516
37411
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#restoreHandOffStack:member(1)",
37517
- "docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state, is unwound with `handoff-unwound`. `interrupted` says the save was frozen: the running target's state was dropped, but the waiting callers' were kept, so when the top frame's target had not finished its outcome is `target-interrupted`. When the top frame's target had finished, or has gone, or was interrupted, its caller is due to resume: `resume` names it and the note its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks` names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.\n */\n",
37412
+ "docComment": "/**\n * Restore saved hand-offs, before the condense policies, against the agents configured now and the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved state (`interrupted` drops them all), is unwound with `handoff-unwound`. When the top frame's target had finished, or has gone, its caller is due to resume: `resume` names it and the note its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks` names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.\n */\n",
37518
37413
  "excerptTokens": [
37519
37414
  {
37520
37415
  "kind": "Content",
@@ -1102,10 +1102,8 @@ export declare interface AiDriver extends EventTarget {
1102
1102
  /**
1103
1103
  * Restore saved hand-offs, before the condense policies, against the agents configured now and
1104
1104
  * the saved agent states. A frame whose caller has gone, or whose stateful caller has no saved
1105
- * state, is unwound with `handoff-unwound`. `interrupted` says the save was frozen: the running
1106
- * target's state was dropped, but the waiting callers' were kept, so when the top frame's target
1107
- * had not finished its outcome is `target-interrupted`. When the top frame's target had
1108
- * finished, or has gone, or was interrupted, its caller is due to resume: `resume` names it and the note
1105
+ * state (`interrupted` drops them all), is unwound with `handoff-unwound`. When the top frame's
1106
+ * target had finished, or has gone, its caller is due to resume: `resume` names it and the note
1109
1107
  * its resumed turn needs, and {@link AiDriver.resumeRestoredFlow} hands back. `droppedLocks`
1110
1108
  * names plain targets of unwound hand-offs, whose saved lock was only that hand-off's.
1111
1109
  *
@@ -1132,13 +1130,6 @@ export declare interface AiDriver extends EventTarget {
1132
1130
  * @beta
1133
1131
  */
1134
1132
  serializeWaitingCallers?(): Record<string, unknown>;
1135
- /**
1136
- * The agent behind each hand-off frame's caller, oldest first, so a save can ask each whether it
1137
- * `resumable` (GENC-1640): the live instance when it waits live, else the configured one.
1138
- *
1139
- * @beta
1140
- */
1141
- getWaitingCallers?(): AgentConfig[];
1142
1133
  /**
1143
1134
  * The `data` each hand-off target was activated with, by name, for the agents a reload resumes:
1144
1135
  * the flow owner and the callers waiting in a hand-off. See the tool context's `handOffData`.
@@ -1147,9 +1138,8 @@ export declare interface AiDriver extends EventTarget {
1147
1138
  */
1148
1139
  getHandOffData?(): Record<string, unknown>;
1149
1140
  /**
1150
- * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. With
1151
- * `interrupted` true nothing comes back. A frozen session saves only its waiting callers' data,
1152
- * which resume, so a host restoring one passes `false`.
1141
+ * Restore what {@link AiDriver.getHandOffData} saved, before the hand-off stack. Nothing comes
1142
+ * back from a frozen (`interrupted`) session, whose flow does not resume.
1153
1143
  *
1154
1144
  * @beta
1155
1145
  */
@@ -2583,7 +2573,7 @@ declare interface BaseAgentConfig {
2583
2573
  onHandOffStart?: (frame: HandOffFrame) => void | Promise<void>;
2584
2574
  /**
2585
2575
  * Fires on the caller when a hand-off it made ends, before its next model call, so its own state
2586
- * can move on. `outcome.kind` says how it ended. Fired for `target-interrupted`, whose caller resumes. Not fired for `state-lost`, whose caller cannot
2576
+ * can move on. `outcome.kind` says how it ended. Not fired for `state-lost`, whose caller cannot
2587
2577
  * resume. GENC-1737.
2588
2578
  *
2589
2579
  * @beta
@@ -2768,7 +2758,6 @@ export declare abstract class BaseDriverDecorator<TInner extends AiDriver = AiDr
2768
2758
  };
2769
2759
  unwindHandOffs(kind: Extract<HandOffOutcomeKind, 'cleared' | 'state-lost'>): Promise<void>;
2770
2760
  serializeWaitingCallers(): Record<string, unknown>;
2771
- getWaitingCallers(): AgentConfig[];
2772
2761
  getHandOffData(): Record<string, unknown>;
2773
2762
  restoreHandOffData(saved: unknown, interrupted: boolean): void;
2774
2763
  getActiveAgent(): AgentConfig | undefined;
@@ -7584,15 +7573,12 @@ export declare interface HandOffOutcome {
7584
7573
  * - `released`: the target called `releaseAgent`, or, a plain one, ended its turn;
7585
7574
  * - `cleared`: the user cleared the chat;
7586
7575
  * - `agent-removed`: the caller or the target is no longer in the agent list, found on restore;
7587
- * - `target-interrupted`: a reload cut the target's work short and it cannot resume (its
7588
- * `resumable` was `false`), so its unsaved work is lost; the caller's own state was saved, so
7589
- * the caller resumes and is told, and decides what to do next, such as handing off again;
7590
- * - `state-lost`: the caller's saved state is gone, so it cannot resume: a stateful caller whose
7591
- * state was not saved, or a change to the agents, which disposes them.
7576
+ * - `state-lost`: the caller's saved state is gone, so it cannot resume: a session saved while its
7577
+ * flow could not be resumed, or a change to the agents, which disposes them.
7592
7578
  *
7593
7579
  * @beta
7594
7580
  */
7595
- export declare type HandOffOutcomeKind = 'completed' | 'released' | 'cleared' | 'agent-removed' | 'target-interrupted' | 'state-lost';
7581
+ export declare type HandOffOutcomeKind = 'completed' | 'released' | 'cleared' | 'agent-removed' | 'state-lost';
7596
7582
 
7597
7583
  /**
7598
7584
  * What `act` is given besides the action: the arguments a person would fill in.
@@ -9234,8 +9220,6 @@ export declare class OrchestratingDriver extends BaseDriverDecorator<ChatDriver>
9234
9220
  getHandOffData(): Record<string, unknown>;
9235
9221
  /** {@inheritDoc AiDriver.restoreHandOffData} */
9236
9222
  restoreHandOffData(saved: unknown, interrupted: boolean): void;
9237
- /** {@inheritDoc AiDriver.getWaitingCallers} */
9238
- getWaitingCallers(): AgentConfig[];
9239
9223
  /** {@inheritDoc AiDriver.serializeWaitingCallers} */
9240
9224
  serializeWaitingCallers(): Record<string, unknown>;
9241
9225
  /**
@@ -11130,9 +11130,6 @@ var BaseDriverDecorator = class _BaseDriverDecorator extends EventTarget {
11130
11130
  serializeWaitingCallers() {
11131
11131
  return this.inner.serializeWaitingCallers?.() ?? {};
11132
11132
  }
11133
- getWaitingCallers() {
11134
- return this.inner.getWaitingCallers?.() ?? [];
11135
- }
11136
11133
  getHandOffData() {
11137
11134
  return this.inner.getHandOffData?.() ?? {};
11138
11135
  }
@@ -11264,7 +11261,6 @@ var OUTCOME_KINDS = [
11264
11261
  "released",
11265
11262
  "cleared",
11266
11263
  "agent-removed",
11267
- "target-interrupted",
11268
11264
  "state-lost"
11269
11265
  ];
11270
11266
  function handOffNote(caller) {
@@ -11276,7 +11272,6 @@ function handBackNote(frame, outcome) {
11276
11272
  released: `${frame.target} has finished the request you handed it, without a summary. Its last reply is above.`,
11277
11273
  cleared: "The hand-off was cleared.",
11278
11274
  "agent-removed": `${frame.target} is no longer available, so the request you handed it was not finished.`,
11279
- "target-interrupted": `${frame.target} was cut short by a page reload and could not resume, so the request you handed it was not finished and its unsaved work is lost.`,
11280
11275
  "state-lost": `The hand-off to ${frame.target} could not be resumed.`
11281
11276
  };
11282
11277
  const summary = outcome.kind === "completed" && outcome.message ? " Its summary is the message above." : "";
@@ -11878,7 +11873,7 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
11878
11873
  const outcome = frame.outcome;
11879
11874
  if (!caller) {
11880
11875
  this.unwound(frame, "agent-removed");
11881
- } else if (caller.serialize && savedStates?.[caller.name] === void 0) {
11876
+ } else if (interrupted || caller.serialize && savedStates?.[caller.name] === void 0) {
11882
11877
  this.unwound(frame, "state-lost");
11883
11878
  } else {
11884
11879
  kept.push(frame);
@@ -11895,8 +11890,6 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
11895
11890
  const top = kept[kept.length - 1];
11896
11891
  if (top && !top.outcome && !this.agents.some((a) => a.name === top.target)) {
11897
11892
  top.outcome = { kind: "agent-removed" };
11898
- } else if (top && !top.outcome && interrupted) {
11899
- top.outcome = { kind: "target-interrupted" };
11900
11893
  }
11901
11894
  this.handOffStack = kept;
11902
11895
  this.chatDriver.suspendRestoredActivations(kept.map((f) => f.caller));
@@ -11942,16 +11935,6 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
11942
11935
  if (interrupted || !saved || typeof saved !== "object" || Array.isArray(saved)) return;
11943
11936
  for (const [name, data] of Object.entries(saved)) this.agentSession.setHandOffData(name, data);
11944
11937
  }
11945
- /** {@inheritDoc AiDriver.getWaitingCallers} */
11946
- getWaitingCallers() {
11947
- const live2 = this.agentSession.getSuspended();
11948
- const callers = [];
11949
- for (const frame of this.handOffStack) {
11950
- const agent = live2.find((a) => a.name === frame.caller) ?? this.agents.find((a) => a.name === frame.caller);
11951
- if (agent) callers.push(agent);
11952
- }
11953
- return callers;
11954
- }
11955
11938
  /** {@inheritDoc AiDriver.serializeWaitingCallers} */
11956
11939
  serializeWaitingCallers() {
11957
11940
  const states = {};