@genesislcap/ai-assistant 15.98.2 → 15.98.4

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.
@@ -11033,6 +11033,9 @@ var BaseDriverDecorator = class _BaseDriverDecorator extends EventTarget {
11033
11033
  serializeWaitingCallers() {
11034
11034
  return this.inner.serializeWaitingCallers?.() ?? {};
11035
11035
  }
11036
+ getWaitingCallers() {
11037
+ return this.inner.getWaitingCallers?.() ?? [];
11038
+ }
11036
11039
  getHandOffData() {
11037
11040
  return this.inner.getHandOffData?.() ?? {};
11038
11041
  }
@@ -11164,6 +11167,7 @@ var OUTCOME_KINDS = [
11164
11167
  "released",
11165
11168
  "cleared",
11166
11169
  "agent-removed",
11170
+ "target-interrupted",
11167
11171
  "state-lost"
11168
11172
  ];
11169
11173
  function handOffNote(caller) {
@@ -11175,6 +11179,7 @@ function handBackNote(frame, outcome) {
11175
11179
  released: `${frame.target} has finished the request you handed it, without a summary. Its last reply is above.`,
11176
11180
  cleared: "The hand-off was cleared.",
11177
11181
  "agent-removed": `${frame.target} is no longer available, so the request you handed it was not finished.`,
11182
+ "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.`,
11178
11183
  "state-lost": `The hand-off to ${frame.target} could not be resumed.`
11179
11184
  };
11180
11185
  const summary = outcome.kind === "completed" && outcome.message ? " Its summary is the message above." : "";
@@ -11776,7 +11781,7 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
11776
11781
  const outcome = frame.outcome;
11777
11782
  if (!caller) {
11778
11783
  this.unwound(frame, "agent-removed");
11779
- } else if (interrupted || caller.serialize && savedStates?.[caller.name] === void 0) {
11784
+ } else if (caller.serialize && savedStates?.[caller.name] === void 0) {
11780
11785
  this.unwound(frame, "state-lost");
11781
11786
  } else {
11782
11787
  kept.push(frame);
@@ -11793,6 +11798,8 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
11793
11798
  const top = kept[kept.length - 1];
11794
11799
  if (top && !top.outcome && !this.agents.some((a) => a.name === top.target)) {
11795
11800
  top.outcome = { kind: "agent-removed" };
11801
+ } else if (top && !top.outcome && interrupted) {
11802
+ top.outcome = { kind: "target-interrupted" };
11796
11803
  }
11797
11804
  this.handOffStack = kept;
11798
11805
  this.chatDriver.suspendRestoredActivations(kept.map((f) => f.caller));
@@ -11838,6 +11845,16 @@ var OrchestratingDriver = class _OrchestratingDriver extends BaseDriverDecorator
11838
11845
  if (interrupted || !saved || typeof saved !== "object" || Array.isArray(saved)) return;
11839
11846
  for (const [name, data] of Object.entries(saved)) this.agentSession.setHandOffData(name, data);
11840
11847
  }
11848
+ /** {@inheritDoc AiDriver.getWaitingCallers} */
11849
+ getWaitingCallers() {
11850
+ const live2 = this.agentSession.getSuspended();
11851
+ const callers = [];
11852
+ for (const frame of this.handOffStack) {
11853
+ const agent = live2.find((a) => a.name === frame.caller) ?? this.agents.find((a) => a.name === frame.caller);
11854
+ if (agent) callers.push(agent);
11855
+ }
11856
+ return callers;
11857
+ }
11841
11858
  /** {@inheritDoc AiDriver.serializeWaitingCallers} */
11842
11859
  serializeWaitingCallers() {
11843
11860
  const states = {};