@adhdev/daemon-standalone 0.9.82-rc.536 → 0.9.82-rc.537
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 +72 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -30208,10 +30208,10 @@ var require_dist3 = __commonJS({
|
|
|
30208
30208
|
}
|
|
30209
30209
|
function getDaemonBuildInfo() {
|
|
30210
30210
|
if (cached2) return cached2;
|
|
30211
|
-
const commit = readInjected(true ? "
|
|
30212
|
-
const commitShort = readInjected(true ? "
|
|
30213
|
-
const version2 = readInjected(true ? "0.9.82-rc.
|
|
30214
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
30211
|
+
const commit = readInjected(true ? "b47ad45cf2b2ad404d911162a9cadd7db2e274a6" : void 0) ?? "unknown";
|
|
30212
|
+
const commitShort = readInjected(true ? "b47ad45c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
30213
|
+
const version2 = readInjected(true ? "0.9.82-rc.537" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
30214
|
+
const builtAt = readInjected(true ? "2026-07-15T13:13:29.115Z" : void 0);
|
|
30215
30215
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
30216
30216
|
return cached2;
|
|
30217
30217
|
}
|
|
@@ -54488,6 +54488,70 @@ ${cleanBody}`;
|
|
|
54488
54488
|
if (buttonBlockApprovalCue(spec, text)) return true;
|
|
54489
54489
|
return false;
|
|
54490
54490
|
}
|
|
54491
|
+
function lastModalCueLine(spec, screenText) {
|
|
54492
|
+
if (!screenText) return -1;
|
|
54493
|
+
const lines = screenText.split("\n");
|
|
54494
|
+
const question = compile2(spec.questionPattern, spec.questionFlags ?? "i");
|
|
54495
|
+
const variants = (spec.questionVariants ?? []).map((v) => compile2(v.regex, v.flags ?? "i"));
|
|
54496
|
+
const buttonFlags = spec.buttonFlags && spec.buttonFlags.includes("m") ? spec.buttonFlags : `${spec.buttonFlags ?? ""}m`;
|
|
54497
|
+
const buttonRe = compile2(spec.buttonPattern, buttonFlags);
|
|
54498
|
+
let last = -1;
|
|
54499
|
+
for (let i = 0; i < lines.length; i++) {
|
|
54500
|
+
const line = lines[i];
|
|
54501
|
+
question.lastIndex = 0;
|
|
54502
|
+
if (question.test(line)) {
|
|
54503
|
+
last = i;
|
|
54504
|
+
continue;
|
|
54505
|
+
}
|
|
54506
|
+
if (variants.some((re) => {
|
|
54507
|
+
re.lastIndex = 0;
|
|
54508
|
+
return re.test(line);
|
|
54509
|
+
})) {
|
|
54510
|
+
last = i;
|
|
54511
|
+
continue;
|
|
54512
|
+
}
|
|
54513
|
+
buttonRe.lastIndex = 0;
|
|
54514
|
+
if (buttonRe.test(line)) {
|
|
54515
|
+
last = i;
|
|
54516
|
+
continue;
|
|
54517
|
+
}
|
|
54518
|
+
}
|
|
54519
|
+
return last;
|
|
54520
|
+
}
|
|
54521
|
+
function modalSupersededBySettledPrompt(modalSpec, settledSpec, settled, input) {
|
|
54522
|
+
if (!settled || !settledSpec) return false;
|
|
54523
|
+
if (settledSpec.scope === "whole-screen") return false;
|
|
54524
|
+
const screenText = input.screenText ?? "";
|
|
54525
|
+
if (!screenText) return false;
|
|
54526
|
+
const modalLine = lastModalCueLine(modalSpec, screenText);
|
|
54527
|
+
if (modalLine < 0) return false;
|
|
54528
|
+
const lines = screenText.split("\n");
|
|
54529
|
+
const below = lines.slice(modalLine + 1);
|
|
54530
|
+
if (below.length === 0) return false;
|
|
54531
|
+
const belowText = below.join("\n");
|
|
54532
|
+
if (!settled.prompt.test(belowText)) return false;
|
|
54533
|
+
if (settled.footers.length > 0 && !settled.footers.every((f) => f.test(belowText))) return false;
|
|
54534
|
+
const question = compile2(modalSpec.questionPattern, modalSpec.questionFlags ?? "i");
|
|
54535
|
+
const variants = (modalSpec.questionVariants ?? []).map((v) => compile2(v.regex, v.flags ?? "i"));
|
|
54536
|
+
const buttonFlags = modalSpec.buttonFlags && modalSpec.buttonFlags.includes("m") ? modalSpec.buttonFlags : `${modalSpec.buttonFlags ?? ""}m`;
|
|
54537
|
+
const buttonRe = compile2(modalSpec.buttonPattern, buttonFlags);
|
|
54538
|
+
const isModalCueLine = (line) => {
|
|
54539
|
+
question.lastIndex = 0;
|
|
54540
|
+
if (question.test(line)) return true;
|
|
54541
|
+
if (variants.some((re) => {
|
|
54542
|
+
re.lastIndex = 0;
|
|
54543
|
+
return re.test(line);
|
|
54544
|
+
})) return true;
|
|
54545
|
+
buttonRe.lastIndex = 0;
|
|
54546
|
+
return buttonRe.test(line);
|
|
54547
|
+
};
|
|
54548
|
+
const settledPromptLineRe = compile2(settledSpec.regex, (settledSpec.flags ?? "m").includes("m") ? settledSpec.flags ?? "m" : `${settledSpec.flags ?? ""}m`);
|
|
54549
|
+
const isSettledLine = (line) => {
|
|
54550
|
+
settledPromptLineRe.lastIndex = 0;
|
|
54551
|
+
return settledPromptLineRe.test(line);
|
|
54552
|
+
};
|
|
54553
|
+
return below.some((line) => line.trim() !== "" && !isModalCueLine(line) && !isSettledLine(line));
|
|
54554
|
+
}
|
|
54491
54555
|
function evaluateGroup(group, spec, input, compiled) {
|
|
54492
54556
|
switch (group) {
|
|
54493
54557
|
case "spinner": {
|
|
@@ -54497,7 +54561,9 @@ ${cleanBody}`;
|
|
|
54497
54561
|
}
|
|
54498
54562
|
case "modal": {
|
|
54499
54563
|
if (!spec.modal) return null;
|
|
54500
|
-
|
|
54564
|
+
if (!modalMatches(spec.modal, input)) return null;
|
|
54565
|
+
if (modalSupersededBySettledPrompt(spec.modal, spec.settledPrompt, compiled.settled, input)) return null;
|
|
54566
|
+
return "waiting_approval";
|
|
54501
54567
|
}
|
|
54502
54568
|
case "settled-prompt": {
|
|
54503
54569
|
if (!spec.settledPrompt || !compiled.settled) return null;
|
|
@@ -56669,6 +56735,7 @@ ${cont}` : cont;
|
|
|
56669
56735
|
const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
|
|
56670
56736
|
const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText) && !activeScreenPattern.test(screenText);
|
|
56671
56737
|
if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
|
|
56738
|
+
if (this.runDetectStatus(screenText) === "idle") return screenText;
|
|
56672
56739
|
if (currentSnapshot.length >= lastSnapshot.length) return screenText;
|
|
56673
56740
|
return `${screenText}
|
|
56674
56741
|
${lastSnapshot}`;
|