@adhdev/daemon-standalone 0.9.77-rc.6 → 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/package.json
CHANGED
|
@@ -41865,6 +41865,8 @@ Follow these recovery rules:
|
|
|
41865
41865
|
statusHistory = [];
|
|
41866
41866
|
// ─── CLI Scripts (script-based parsing) ───
|
|
41867
41867
|
cliScripts;
|
|
41868
|
+
/** Per-session opaque state object created by cliScripts.createState(), reset on stop. */
|
|
41869
|
+
scriptState = null;
|
|
41868
41870
|
runtimeSettings = {};
|
|
41869
41871
|
/** Full accumulated rendered PTY transcript for parser/readback use */
|
|
41870
41872
|
accumulatedBuffer = "";
|
|
@@ -42046,6 +42048,7 @@ ${lastSnapshot}`;
|
|
|
42046
42048
|
this.cliScripts = scripts;
|
|
42047
42049
|
this.parsedStatusCache = null;
|
|
42048
42050
|
this.parseErrorMessage = null;
|
|
42051
|
+
this.scriptState = typeof scripts.createState === "function" ? scripts.createState() : null;
|
|
42049
42052
|
const scriptNames = listCliScriptNames(scripts);
|
|
42050
42053
|
LOG.info("CLI", `[${this.cliType}] CLI scripts injected: [${scriptNames.join(", ")}]`);
|
|
42051
42054
|
}
|
|
@@ -42163,6 +42166,7 @@ ${lastSnapshot}`;
|
|
|
42163
42166
|
this.ready = false;
|
|
42164
42167
|
this.startupParseGate = false;
|
|
42165
42168
|
this.spawnAt = 0;
|
|
42169
|
+
this.scriptState = null;
|
|
42166
42170
|
this.onStatusChange?.();
|
|
42167
42171
|
});
|
|
42168
42172
|
this.spawnAt = Date.now();
|
|
@@ -42936,7 +42940,7 @@ ${lastSnapshot}`;
|
|
|
42936
42940
|
scope: this.currentTurnScope,
|
|
42937
42941
|
runtimeSettings: this.runtimeSettings
|
|
42938
42942
|
});
|
|
42939
|
-
const session = this.cliScripts.parseSession({ ...input, tail, tailScreen: buildCliScreenSnapshot(tail) });
|
|
42943
|
+
const session = this.cliScripts.parseSession(this.scriptState, { ...input, tail, tailScreen: buildCliScreenSnapshot(tail) });
|
|
42940
42944
|
this.parseErrorMessage = null;
|
|
42941
42945
|
return session && typeof session === "object" ? session : null;
|
|
42942
42946
|
} catch (e) {
|
|
@@ -42950,7 +42954,7 @@ ${lastSnapshot}`;
|
|
|
42950
42954
|
if (!this.cliScripts?.detectStatus) return null;
|
|
42951
42955
|
try {
|
|
42952
42956
|
const screenText = this.terminalScreen.getText();
|
|
42953
|
-
const status = this.cliScripts.detectStatus({
|
|
42957
|
+
const status = this.cliScripts.detectStatus(this.scriptState, {
|
|
42954
42958
|
tail: text.slice(-500),
|
|
42955
42959
|
screenText,
|
|
42956
42960
|
rawBuffer: this.accumulatedRawBuffer,
|
|
@@ -42969,7 +42973,7 @@ ${lastSnapshot}`;
|
|
|
42969
42973
|
try {
|
|
42970
42974
|
const screenText = this.terminalScreen.getText();
|
|
42971
42975
|
const buffer = screenText || this.accumulatedBuffer;
|
|
42972
|
-
return this.cliScripts.parseApproval({
|
|
42976
|
+
return this.cliScripts.parseApproval(this.scriptState, {
|
|
42973
42977
|
buffer,
|
|
42974
42978
|
screenText,
|
|
42975
42979
|
rawBuffer: this.accumulatedRawBuffer,
|
|
@@ -43077,7 +43081,7 @@ ${lastSnapshot}`;
|
|
|
43077
43081
|
scope: this.currentTurnScope,
|
|
43078
43082
|
runtimeSettings: this.runtimeSettings
|
|
43079
43083
|
});
|
|
43080
|
-
return await Promise.resolve(fn({
|
|
43084
|
+
return await Promise.resolve(fn(this.scriptState, {
|
|
43081
43085
|
...input,
|
|
43082
43086
|
args: args && typeof args === "object" ? { ...args } : {}
|
|
43083
43087
|
}));
|