@adhdev/daemon-standalone 0.9.82-rc.355 → 0.9.82-rc.356
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 +70 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30036,10 +30036,10 @@ var require_dist3 = __commonJS({
|
|
|
30036
30036
|
}
|
|
30037
30037
|
function getDaemonBuildInfo() {
|
|
30038
30038
|
if (cached2) return cached2;
|
|
30039
|
-
const commit = readInjected(true ? "
|
|
30040
|
-
const commitShort = readInjected(true ? "
|
|
30041
|
-
const version2 = readInjected(true ? "0.9.82-rc.
|
|
30042
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
30039
|
+
const commit = readInjected(true ? "91500e054cf2b6258f6041f90c18be03ad05a8ad" : void 0) ?? "unknown";
|
|
30040
|
+
const commitShort = readInjected(true ? "91500e05" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
30041
|
+
const version2 = readInjected(true ? "0.9.82-rc.356" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
30042
|
+
const builtAt = readInjected(true ? "2026-06-22T22:47:57.762Z" : void 0);
|
|
30043
30043
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
30044
30044
|
return cached2;
|
|
30045
30045
|
}
|
|
@@ -49545,6 +49545,7 @@ ${lastSnapshot}`;
|
|
|
49545
49545
|
const idx = Number(m[1]);
|
|
49546
49546
|
let label = String(m[2] ?? "").trim();
|
|
49547
49547
|
if (!Number.isFinite(idx) || idx <= 0 || !label) continue;
|
|
49548
|
+
const current = hasCursorMarker(lines[i]);
|
|
49548
49549
|
let j = i + 1;
|
|
49549
49550
|
while (j < lines.length) {
|
|
49550
49551
|
const next = lines[j];
|
|
@@ -49556,7 +49557,7 @@ ${lastSnapshot}`;
|
|
|
49556
49557
|
}
|
|
49557
49558
|
if (buttons.some((b) => b.index === idx)) continue;
|
|
49558
49559
|
const key = keyTemplate.replace(/\{index\}/g, String(idx));
|
|
49559
|
-
buttons.push({ index: idx, label, key });
|
|
49560
|
+
buttons.push({ index: idx, label, key, current });
|
|
49560
49561
|
i = j - 1;
|
|
49561
49562
|
}
|
|
49562
49563
|
} else {
|
|
@@ -49568,12 +49569,15 @@ ${lastSnapshot}`;
|
|
|
49568
49569
|
if (!Number.isFinite(idx) || idx <= 0 || !label) continue;
|
|
49569
49570
|
if (buttons.some((b) => b.index === idx)) continue;
|
|
49570
49571
|
const key = keyTemplate.replace(/\{index\}/g, String(idx));
|
|
49571
|
-
buttons.push({ index: idx, label, key });
|
|
49572
|
+
buttons.push({ index: idx, label, key, current: hasCursorMarker(m[0]) });
|
|
49572
49573
|
}
|
|
49573
49574
|
}
|
|
49574
49575
|
buttons.sort((a, b) => a.index - b.index);
|
|
49575
49576
|
return buttons;
|
|
49576
49577
|
}
|
|
49578
|
+
function hasCursorMarker(text) {
|
|
49579
|
+
return /^\s*[❯›>]/.test(text);
|
|
49580
|
+
}
|
|
49577
49581
|
var init_evaluator = __esm2({
|
|
49578
49582
|
"src/providers/spec/evaluator.ts"() {
|
|
49579
49583
|
"use strict";
|
|
@@ -63719,6 +63723,19 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
63719
63723
|
if (!m) return;
|
|
63720
63724
|
const btn = m.buttons.find((b) => b.index === index);
|
|
63721
63725
|
if (!btn) return;
|
|
63726
|
+
const rule = stateById(this.spec, this.currentStateId)?.extract?.buttons;
|
|
63727
|
+
if (rule?.select_mode === "arrow_keys") {
|
|
63728
|
+
const from = m.buttons.find((b) => b.current)?.index ?? 1;
|
|
63729
|
+
const up = rule.cursor_keys?.up ?? "\x1B[A";
|
|
63730
|
+
const down = rule.cursor_keys?.down ?? "\x1B[B";
|
|
63731
|
+
const delta = btn.index - from;
|
|
63732
|
+
const step = delta >= 0 ? down : up;
|
|
63733
|
+
const nav = step.repeat(Math.abs(delta));
|
|
63734
|
+
const confirm = (rule.key_for_index || "\r").replace(/\{index\}/g, "") || "\r";
|
|
63735
|
+
if (nav) this.adapter.send_keys(nav);
|
|
63736
|
+
this.adapter.send_keys(confirm);
|
|
63737
|
+
return;
|
|
63738
|
+
}
|
|
63722
63739
|
this.adapter.send_keys(btn.key);
|
|
63723
63740
|
}
|
|
63724
63741
|
handleAttachImage(blob, mime) {
|
|
@@ -64952,9 +64969,12 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
64952
64969
|
* — not this code — decides how a selection is keyed for each CLI.
|
|
64953
64970
|
*/
|
|
64954
64971
|
async selectPickerChoice(ctl, action, choiceIndex, choiceLabel) {
|
|
64955
|
-
|
|
64956
|
-
|
|
64957
|
-
|
|
64972
|
+
let options = this.extractPickerChoicesIfRendered(action);
|
|
64973
|
+
if (!options) {
|
|
64974
|
+
this.driver.dispatch({ kind: "click_control", control_id: ctl.id });
|
|
64975
|
+
await this.waitForPickerRendered(action);
|
|
64976
|
+
options = this.extractPickerChoices(action);
|
|
64977
|
+
}
|
|
64958
64978
|
let index = choiceIndex;
|
|
64959
64979
|
if ((index == null || !Number.isFinite(index)) && choiceLabel) {
|
|
64960
64980
|
const needle = choiceLabel.trim().toLowerCase();
|
|
@@ -64967,8 +64987,27 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
64967
64987
|
if (index == null || !Number.isFinite(index)) {
|
|
64968
64988
|
return { ok: false, error: "choiceIndex or choiceLabel required to select" };
|
|
64969
64989
|
}
|
|
64970
|
-
|
|
64971
|
-
|
|
64990
|
+
if (action.select_mode === "arrow_keys") {
|
|
64991
|
+
const current = options.find((o) => o.current);
|
|
64992
|
+
if (current == null) {
|
|
64993
|
+
return {
|
|
64994
|
+
ok: false,
|
|
64995
|
+
error: "arrow-nav picker: current cursor row not detected on screen",
|
|
64996
|
+
controlResult: { options: options.map((o) => ({ value: o.label, label: o.label, current: o.current })) }
|
|
64997
|
+
};
|
|
64998
|
+
}
|
|
64999
|
+
const up = action.cursor_keys?.up ?? "\x1B[A";
|
|
65000
|
+
const down = action.cursor_keys?.down ?? "\x1B[B";
|
|
65001
|
+
const delta = index - current.index;
|
|
65002
|
+
const step = delta >= 0 ? down : up;
|
|
65003
|
+
const nav = step.repeat(Math.abs(delta));
|
|
65004
|
+
const confirm = (action.submit_key || "\r").replace(/\{index\}/g, "") || "\r";
|
|
65005
|
+
if (nav) this.driver.dispatch({ kind: "pty_write", data: nav });
|
|
65006
|
+
this.driver.dispatch({ kind: "pty_write", data: confirm });
|
|
65007
|
+
} else {
|
|
65008
|
+
const keys = (action.submit_key || "{index}\r").replace(/\{index\}/g, String(index));
|
|
65009
|
+
this.driver.dispatch({ kind: "pty_write", data: keys });
|
|
65010
|
+
}
|
|
64972
65011
|
const selected = options.find((o) => o.index === index);
|
|
64973
65012
|
return {
|
|
64974
65013
|
ok: true,
|
|
@@ -64980,6 +65019,20 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
64980
65019
|
}
|
|
64981
65020
|
};
|
|
64982
65021
|
}
|
|
65022
|
+
/** Parse the picker choices only if the picker already appears rendered on
|
|
65023
|
+
* the live screen (its `wait_for` condition currently matches and at least
|
|
65024
|
+
* one choice parses). Returns the parsed choices when open, else null so
|
|
65025
|
+
* the caller knows it must send the trigger to open it. Used to de-dup the
|
|
65026
|
+
* picker open in {@link selectPickerChoice}. */
|
|
65027
|
+
extractPickerChoicesIfRendered(action) {
|
|
65028
|
+
const wf = action.wait_for;
|
|
65029
|
+
if (wf?.regex) {
|
|
65030
|
+
const re = new RegExp(wf.regex, wf.flags ?? "i");
|
|
65031
|
+
if (!re.test(this.readScreenSectionText(wf.section))) return null;
|
|
65032
|
+
}
|
|
65033
|
+
const options = this.extractPickerChoices(action);
|
|
65034
|
+
return options.length > 0 ? options : null;
|
|
65035
|
+
}
|
|
64983
65036
|
/** Poll the live screen until the picker's `wait_for` condition matches,
|
|
64984
65037
|
* up to a short budget. Returns true if it rendered, false on timeout. */
|
|
64985
65038
|
async waitForPickerRendered(action) {
|
|
@@ -66991,6 +67044,12 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
66991
67044
|
workspace: typeof event.workspace === "string" && event.workspace.trim() ? event.workspace : this.workingDir,
|
|
66992
67045
|
providerSessionId: typeof event.providerSessionId === "string" && event.providerSessionId.trim() ? event.providerSessionId : this.providerSessionId
|
|
66993
67046
|
};
|
|
67047
|
+
if (this.isMeshWorkerSession() && this.settings.meshActiveTaskId) {
|
|
67048
|
+
const existingTaskId = typeof enrichedEvent.taskId === "string" && enrichedEvent.taskId.trim() ? enrichedEvent.taskId : void 0;
|
|
67049
|
+
if (!existingTaskId) {
|
|
67050
|
+
enrichedEvent.taskId = this.settings.meshActiveTaskId;
|
|
67051
|
+
}
|
|
67052
|
+
}
|
|
66994
67053
|
if (this.context?.emitProviderEvent) {
|
|
66995
67054
|
this.context.emitProviderEvent(enrichedEvent);
|
|
66996
67055
|
} else {
|