@adhdev/daemon-standalone 0.9.77-rc.7 → 0.9.77-rc.8

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/index.js CHANGED
@@ -33914,6 +33914,8 @@ Do NOT retry on this node. Consider reassigning to a different node or asking th
33914
33914
  statusHistory = [];
33915
33915
  // ─── CLI Scripts (script-based parsing) ───
33916
33916
  cliScripts;
33917
+ /** Per-session opaque state object created by cliScripts.createState(), reset on stop. */
33918
+ scriptState = null;
33917
33919
  runtimeSettings = {};
33918
33920
  /** Full accumulated rendered PTY transcript for parser/readback use */
33919
33921
  accumulatedBuffer = "";
@@ -34095,6 +34097,7 @@ ${lastSnapshot}`;
34095
34097
  this.cliScripts = scripts;
34096
34098
  this.parsedStatusCache = null;
34097
34099
  this.parseErrorMessage = null;
34100
+ this.scriptState = typeof scripts.createState === "function" ? scripts.createState() : null;
34098
34101
  const scriptNames = listCliScriptNames(scripts);
34099
34102
  LOG2.info("CLI", `[${this.cliType}] CLI scripts injected: [${scriptNames.join(", ")}]`);
34100
34103
  }
@@ -34212,6 +34215,7 @@ ${lastSnapshot}`;
34212
34215
  this.ready = false;
34213
34216
  this.startupParseGate = false;
34214
34217
  this.spawnAt = 0;
34218
+ this.scriptState = null;
34215
34219
  this.onStatusChange?.();
34216
34220
  });
34217
34221
  this.spawnAt = Date.now();
@@ -34985,7 +34989,7 @@ ${lastSnapshot}`;
34985
34989
  scope: this.currentTurnScope,
34986
34990
  runtimeSettings: this.runtimeSettings
34987
34991
  });
34988
- const session = this.cliScripts.parseSession({ ...input, tail, tailScreen: buildCliScreenSnapshot(tail) });
34992
+ const session = this.cliScripts.parseSession(this.scriptState, { ...input, tail, tailScreen: buildCliScreenSnapshot(tail) });
34989
34993
  this.parseErrorMessage = null;
34990
34994
  return session && typeof session === "object" ? session : null;
34991
34995
  } catch (e) {
@@ -34999,7 +35003,7 @@ ${lastSnapshot}`;
34999
35003
  if (!this.cliScripts?.detectStatus) return null;
35000
35004
  try {
35001
35005
  const screenText = this.terminalScreen.getText();
35002
- const status = this.cliScripts.detectStatus({
35006
+ const status = this.cliScripts.detectStatus(this.scriptState, {
35003
35007
  tail: text.slice(-500),
35004
35008
  screenText,
35005
35009
  rawBuffer: this.accumulatedRawBuffer,
@@ -35018,7 +35022,7 @@ ${lastSnapshot}`;
35018
35022
  try {
35019
35023
  const screenText = this.terminalScreen.getText();
35020
35024
  const buffer = screenText || this.accumulatedBuffer;
35021
- return this.cliScripts.parseApproval({
35025
+ return this.cliScripts.parseApproval(this.scriptState, {
35022
35026
  buffer,
35023
35027
  screenText,
35024
35028
  rawBuffer: this.accumulatedRawBuffer,
@@ -35126,7 +35130,7 @@ ${lastSnapshot}`;
35126
35130
  scope: this.currentTurnScope,
35127
35131
  runtimeSettings: this.runtimeSettings
35128
35132
  });
35129
- return await Promise.resolve(fn2({
35133
+ return await Promise.resolve(fn2(this.scriptState, {
35130
35134
  ...input,
35131
35135
  args: args && typeof args === "object" ? { ...args } : {}
35132
35136
  }));