@adhdev/daemon-core 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.mjs
CHANGED
|
@@ -414,10 +414,10 @@ function readInjected(value) {
|
|
|
414
414
|
}
|
|
415
415
|
function getDaemonBuildInfo() {
|
|
416
416
|
if (cached) return cached;
|
|
417
|
-
const commit = readInjected(true ? "
|
|
418
|
-
const commitShort = readInjected(true ? "
|
|
419
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
420
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
417
|
+
const commit = readInjected(true ? "b47ad45cf2b2ad404d911162a9cadd7db2e274a6" : void 0) ?? "unknown";
|
|
418
|
+
const commitShort = readInjected(true ? "b47ad45c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
419
|
+
const version = readInjected(true ? "0.9.82-rc.537" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
420
|
+
const builtAt = readInjected(true ? "2026-07-15T13:12:55.213Z" : void 0);
|
|
421
421
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
422
422
|
return cached;
|
|
423
423
|
}
|
|
@@ -24552,6 +24552,70 @@ function modalMatches(spec, input) {
|
|
|
24552
24552
|
if (buttonBlockApprovalCue(spec, text)) return true;
|
|
24553
24553
|
return false;
|
|
24554
24554
|
}
|
|
24555
|
+
function lastModalCueLine(spec, screenText) {
|
|
24556
|
+
if (!screenText) return -1;
|
|
24557
|
+
const lines = screenText.split("\n");
|
|
24558
|
+
const question = compile2(spec.questionPattern, spec.questionFlags ?? "i");
|
|
24559
|
+
const variants = (spec.questionVariants ?? []).map((v) => compile2(v.regex, v.flags ?? "i"));
|
|
24560
|
+
const buttonFlags = spec.buttonFlags && spec.buttonFlags.includes("m") ? spec.buttonFlags : `${spec.buttonFlags ?? ""}m`;
|
|
24561
|
+
const buttonRe = compile2(spec.buttonPattern, buttonFlags);
|
|
24562
|
+
let last = -1;
|
|
24563
|
+
for (let i = 0; i < lines.length; i++) {
|
|
24564
|
+
const line = lines[i];
|
|
24565
|
+
question.lastIndex = 0;
|
|
24566
|
+
if (question.test(line)) {
|
|
24567
|
+
last = i;
|
|
24568
|
+
continue;
|
|
24569
|
+
}
|
|
24570
|
+
if (variants.some((re) => {
|
|
24571
|
+
re.lastIndex = 0;
|
|
24572
|
+
return re.test(line);
|
|
24573
|
+
})) {
|
|
24574
|
+
last = i;
|
|
24575
|
+
continue;
|
|
24576
|
+
}
|
|
24577
|
+
buttonRe.lastIndex = 0;
|
|
24578
|
+
if (buttonRe.test(line)) {
|
|
24579
|
+
last = i;
|
|
24580
|
+
continue;
|
|
24581
|
+
}
|
|
24582
|
+
}
|
|
24583
|
+
return last;
|
|
24584
|
+
}
|
|
24585
|
+
function modalSupersededBySettledPrompt(modalSpec, settledSpec, settled, input) {
|
|
24586
|
+
if (!settled || !settledSpec) return false;
|
|
24587
|
+
if (settledSpec.scope === "whole-screen") return false;
|
|
24588
|
+
const screenText = input.screenText ?? "";
|
|
24589
|
+
if (!screenText) return false;
|
|
24590
|
+
const modalLine = lastModalCueLine(modalSpec, screenText);
|
|
24591
|
+
if (modalLine < 0) return false;
|
|
24592
|
+
const lines = screenText.split("\n");
|
|
24593
|
+
const below = lines.slice(modalLine + 1);
|
|
24594
|
+
if (below.length === 0) return false;
|
|
24595
|
+
const belowText = below.join("\n");
|
|
24596
|
+
if (!settled.prompt.test(belowText)) return false;
|
|
24597
|
+
if (settled.footers.length > 0 && !settled.footers.every((f) => f.test(belowText))) return false;
|
|
24598
|
+
const question = compile2(modalSpec.questionPattern, modalSpec.questionFlags ?? "i");
|
|
24599
|
+
const variants = (modalSpec.questionVariants ?? []).map((v) => compile2(v.regex, v.flags ?? "i"));
|
|
24600
|
+
const buttonFlags = modalSpec.buttonFlags && modalSpec.buttonFlags.includes("m") ? modalSpec.buttonFlags : `${modalSpec.buttonFlags ?? ""}m`;
|
|
24601
|
+
const buttonRe = compile2(modalSpec.buttonPattern, buttonFlags);
|
|
24602
|
+
const isModalCueLine = (line) => {
|
|
24603
|
+
question.lastIndex = 0;
|
|
24604
|
+
if (question.test(line)) return true;
|
|
24605
|
+
if (variants.some((re) => {
|
|
24606
|
+
re.lastIndex = 0;
|
|
24607
|
+
return re.test(line);
|
|
24608
|
+
})) return true;
|
|
24609
|
+
buttonRe.lastIndex = 0;
|
|
24610
|
+
return buttonRe.test(line);
|
|
24611
|
+
};
|
|
24612
|
+
const settledPromptLineRe = compile2(settledSpec.regex, (settledSpec.flags ?? "m").includes("m") ? settledSpec.flags ?? "m" : `${settledSpec.flags ?? ""}m`);
|
|
24613
|
+
const isSettledLine = (line) => {
|
|
24614
|
+
settledPromptLineRe.lastIndex = 0;
|
|
24615
|
+
return settledPromptLineRe.test(line);
|
|
24616
|
+
};
|
|
24617
|
+
return below.some((line) => line.trim() !== "" && !isModalCueLine(line) && !isSettledLine(line));
|
|
24618
|
+
}
|
|
24555
24619
|
function evaluateGroup(group, spec, input, compiled) {
|
|
24556
24620
|
switch (group) {
|
|
24557
24621
|
case "spinner": {
|
|
@@ -24561,7 +24625,9 @@ function evaluateGroup(group, spec, input, compiled) {
|
|
|
24561
24625
|
}
|
|
24562
24626
|
case "modal": {
|
|
24563
24627
|
if (!spec.modal) return null;
|
|
24564
|
-
|
|
24628
|
+
if (!modalMatches(spec.modal, input)) return null;
|
|
24629
|
+
if (modalSupersededBySettledPrompt(spec.modal, spec.settledPrompt, compiled.settled, input)) return null;
|
|
24630
|
+
return "waiting_approval";
|
|
24565
24631
|
}
|
|
24566
24632
|
case "settled-prompt": {
|
|
24567
24633
|
if (!spec.settledPrompt || !compiled.settled) return null;
|
|
@@ -26731,6 +26797,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
26731
26797
|
const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
|
|
26732
26798
|
const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText) && !activeScreenPattern.test(screenText);
|
|
26733
26799
|
if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
|
|
26800
|
+
if (this.runDetectStatus(screenText) === "idle") return screenText;
|
|
26734
26801
|
if (currentSnapshot.length >= lastSnapshot.length) return screenText;
|
|
26735
26802
|
return `${screenText}
|
|
26736
26803
|
${lastSnapshot}`;
|