@adhdev/daemon-core 0.9.82-rc.363 → 0.9.82-rc.364
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 +66 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -6
- package/dist/index.mjs.map +1 -1
- package/dist/providers/spec/fsm-driver.d.ts +27 -0
- package/package.json +2 -2
- package/src/providers/spec/fsm-driver.ts +56 -2
package/dist/index.mjs
CHANGED
|
@@ -311,10 +311,10 @@ function readInjected(value) {
|
|
|
311
311
|
}
|
|
312
312
|
function getDaemonBuildInfo() {
|
|
313
313
|
if (cached) return cached;
|
|
314
|
-
const commit = readInjected(true ? "
|
|
315
|
-
const commitShort = readInjected(true ? "
|
|
316
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
317
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
314
|
+
const commit = readInjected(true ? "1428e9d027beefe860a77f34dea34d202db80f00" : void 0) ?? "unknown";
|
|
315
|
+
const commitShort = readInjected(true ? "1428e9d0" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
316
|
+
const version = readInjected(true ? "0.9.82-rc.364" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
317
|
+
const builtAt = readInjected(true ? "2026-06-24T00:05:49.524Z" : void 0);
|
|
318
318
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
319
319
|
return cached;
|
|
320
320
|
}
|
|
@@ -34723,6 +34723,11 @@ var FsmDriver = class {
|
|
|
34723
34723
|
lastWin32WriteAt = 0;
|
|
34724
34724
|
/** Pending paced chunk-write timer for a large win32 body (see writeWin32Body). */
|
|
34725
34725
|
win32WriteTimer = null;
|
|
34726
|
+
/** Timer driving the win32 verification-based modal-confirm CR resend loop (see
|
|
34727
|
+
* scheduleWin32ModalConfirm). A lone CR that confirms an approval/picker choice
|
|
34728
|
+
* is absorbed by ConPTY the same way a send_message submit CR is, so the confirm
|
|
34729
|
+
* must be resent until the modal actually resolves (status leaves 'approval'). */
|
|
34730
|
+
win32ModalConfirmTimer = null;
|
|
34726
34731
|
currentEval = null;
|
|
34727
34732
|
stateHistory = [];
|
|
34728
34733
|
prevStateAt = 0;
|
|
@@ -34847,6 +34852,10 @@ var FsmDriver = class {
|
|
|
34847
34852
|
clearTimeout(this.win32WriteTimer);
|
|
34848
34853
|
this.win32WriteTimer = null;
|
|
34849
34854
|
}
|
|
34855
|
+
if (this.win32ModalConfirmTimer) {
|
|
34856
|
+
clearTimeout(this.win32ModalConfirmTimer);
|
|
34857
|
+
this.win32ModalConfirmTimer = null;
|
|
34858
|
+
}
|
|
34850
34859
|
this.specWatcher?.close();
|
|
34851
34860
|
this.adapter.kill();
|
|
34852
34861
|
}
|
|
@@ -35442,10 +35451,61 @@ var FsmDriver = class {
|
|
|
35442
35451
|
const nav = step.repeat(Math.abs(delta));
|
|
35443
35452
|
const confirm = (rule.key_for_index || "\r").replace(/\{index\}/g, "") || "\r";
|
|
35444
35453
|
if (nav) this.adapter.send_keys(nav);
|
|
35445
|
-
this.
|
|
35454
|
+
this.submitModalConfirm(confirm);
|
|
35455
|
+
return;
|
|
35456
|
+
}
|
|
35457
|
+
this.submitModalConfirm(btn.key);
|
|
35458
|
+
}
|
|
35459
|
+
/**
|
|
35460
|
+
* Submit a modal-confirm key sequence (the choice key + its trailing CR).
|
|
35461
|
+
*
|
|
35462
|
+
* On win32 the trailing CR is the SAME lone-CR-swallow case as a send_message
|
|
35463
|
+
* submit: ConPTY can absorb a single CR as a literal newline instead of a
|
|
35464
|
+
* confirm, so the approval/picker modal never resolves and the FSM flaps
|
|
35465
|
+
* approval↔busy while auto-approve keeps firing into the void (APPROVESTUCK).
|
|
35466
|
+
* So we split any non-CR prefix (e.g. the "1" of "1\r") off, write it once, and
|
|
35467
|
+
* resend the CR on a fixed cadence until the modal actually resolves (status
|
|
35468
|
+
* leaves 'approval'). Non-win32 keeps the single direct write — its CR submits
|
|
35469
|
+
* on the first try.
|
|
35470
|
+
*/
|
|
35471
|
+
submitModalConfirm(keys) {
|
|
35472
|
+
if (process.platform !== "win32") {
|
|
35473
|
+
this.adapter.send_keys(keys);
|
|
35446
35474
|
return;
|
|
35447
35475
|
}
|
|
35448
|
-
|
|
35476
|
+
const m = /^([\s\S]*?)([\r\n]+)$/.exec(keys);
|
|
35477
|
+
const prefix = m ? m[1] : keys;
|
|
35478
|
+
const cr = m ? m[2] : "";
|
|
35479
|
+
if (prefix) this.adapter.send_keys(prefix);
|
|
35480
|
+
if (!cr) return;
|
|
35481
|
+
this.scheduleWin32ModalConfirm(cr);
|
|
35482
|
+
}
|
|
35483
|
+
/**
|
|
35484
|
+
* win32 modal-confirm CR resend loop. Mirrors scheduleWin32Submit's phase-2
|
|
35485
|
+
* verified resend, but gated on still being IN a modal (status 'approval')
|
|
35486
|
+
* rather than still idle: the first CR fires immediately, then resends every
|
|
35487
|
+
* WIN32_SUBMIT_RESEND_GAP_MS while the FSM is still showing the modal, up to
|
|
35488
|
+
* WIN32_SUBMIT_MAX_RESENDS. The instant the modal resolves (status flips to
|
|
35489
|
+
* generating/idle) we stop, so no stray CR leaks into the next turn's composer.
|
|
35490
|
+
*/
|
|
35491
|
+
scheduleWin32ModalConfirm(submitKey) {
|
|
35492
|
+
if (this.win32ModalConfirmTimer) {
|
|
35493
|
+
clearTimeout(this.win32ModalConfirmTimer);
|
|
35494
|
+
this.win32ModalConfirmTimer = null;
|
|
35495
|
+
}
|
|
35496
|
+
const fire = (attempt) => {
|
|
35497
|
+
this.win32ModalConfirmTimer = null;
|
|
35498
|
+
this.adapter.send_keys(submitKey);
|
|
35499
|
+
if (attempt + 1 >= WIN32_SUBMIT_MAX_RESENDS) return;
|
|
35500
|
+
this.win32ModalConfirmTimer = setTimeout(() => {
|
|
35501
|
+
if (this.currentStatus() !== "approval") {
|
|
35502
|
+
this.win32ModalConfirmTimer = null;
|
|
35503
|
+
return;
|
|
35504
|
+
}
|
|
35505
|
+
fire(attempt + 1);
|
|
35506
|
+
}, WIN32_SUBMIT_RESEND_GAP_MS);
|
|
35507
|
+
};
|
|
35508
|
+
fire(0);
|
|
35449
35509
|
}
|
|
35450
35510
|
handleAttachImage(blob, mime) {
|
|
35451
35511
|
const ctl = (this.spec.control_bar ?? []).find((c) => c.action.type === "attach_image");
|