@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 CHANGED
@@ -316,10 +316,10 @@ function readInjected(value) {
316
316
  }
317
317
  function getDaemonBuildInfo() {
318
318
  if (cached) return cached;
319
- const commit = readInjected(true ? "4c5b30b1b0527ec5234c037893ba4fc24b88a8a0" : void 0) ?? "unknown";
320
- const commitShort = readInjected(true ? "4c5b30b1" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
- const version = readInjected(true ? "0.9.82-rc.363" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
- const builtAt = readInjected(true ? "2026-06-23T16:13:33.075Z" : void 0);
319
+ const commit = readInjected(true ? "1428e9d027beefe860a77f34dea34d202db80f00" : void 0) ?? "unknown";
320
+ const commitShort = readInjected(true ? "1428e9d0" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
+ const version = readInjected(true ? "0.9.82-rc.364" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
+ const builtAt = readInjected(true ? "2026-06-24T00:05:49.524Z" : void 0);
323
323
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
324
324
  return cached;
325
325
  }
@@ -35091,6 +35091,11 @@ var FsmDriver = class {
35091
35091
  lastWin32WriteAt = 0;
35092
35092
  /** Pending paced chunk-write timer for a large win32 body (see writeWin32Body). */
35093
35093
  win32WriteTimer = null;
35094
+ /** Timer driving the win32 verification-based modal-confirm CR resend loop (see
35095
+ * scheduleWin32ModalConfirm). A lone CR that confirms an approval/picker choice
35096
+ * is absorbed by ConPTY the same way a send_message submit CR is, so the confirm
35097
+ * must be resent until the modal actually resolves (status leaves 'approval'). */
35098
+ win32ModalConfirmTimer = null;
35094
35099
  currentEval = null;
35095
35100
  stateHistory = [];
35096
35101
  prevStateAt = 0;
@@ -35215,6 +35220,10 @@ var FsmDriver = class {
35215
35220
  clearTimeout(this.win32WriteTimer);
35216
35221
  this.win32WriteTimer = null;
35217
35222
  }
35223
+ if (this.win32ModalConfirmTimer) {
35224
+ clearTimeout(this.win32ModalConfirmTimer);
35225
+ this.win32ModalConfirmTimer = null;
35226
+ }
35218
35227
  this.specWatcher?.close();
35219
35228
  this.adapter.kill();
35220
35229
  }
@@ -35810,10 +35819,61 @@ var FsmDriver = class {
35810
35819
  const nav = step.repeat(Math.abs(delta));
35811
35820
  const confirm = (rule.key_for_index || "\r").replace(/\{index\}/g, "") || "\r";
35812
35821
  if (nav) this.adapter.send_keys(nav);
35813
- this.adapter.send_keys(confirm);
35822
+ this.submitModalConfirm(confirm);
35823
+ return;
35824
+ }
35825
+ this.submitModalConfirm(btn.key);
35826
+ }
35827
+ /**
35828
+ * Submit a modal-confirm key sequence (the choice key + its trailing CR).
35829
+ *
35830
+ * On win32 the trailing CR is the SAME lone-CR-swallow case as a send_message
35831
+ * submit: ConPTY can absorb a single CR as a literal newline instead of a
35832
+ * confirm, so the approval/picker modal never resolves and the FSM flaps
35833
+ * approval↔busy while auto-approve keeps firing into the void (APPROVESTUCK).
35834
+ * So we split any non-CR prefix (e.g. the "1" of "1\r") off, write it once, and
35835
+ * resend the CR on a fixed cadence until the modal actually resolves (status
35836
+ * leaves 'approval'). Non-win32 keeps the single direct write — its CR submits
35837
+ * on the first try.
35838
+ */
35839
+ submitModalConfirm(keys) {
35840
+ if (process.platform !== "win32") {
35841
+ this.adapter.send_keys(keys);
35814
35842
  return;
35815
35843
  }
35816
- this.adapter.send_keys(btn.key);
35844
+ const m = /^([\s\S]*?)([\r\n]+)$/.exec(keys);
35845
+ const prefix = m ? m[1] : keys;
35846
+ const cr = m ? m[2] : "";
35847
+ if (prefix) this.adapter.send_keys(prefix);
35848
+ if (!cr) return;
35849
+ this.scheduleWin32ModalConfirm(cr);
35850
+ }
35851
+ /**
35852
+ * win32 modal-confirm CR resend loop. Mirrors scheduleWin32Submit's phase-2
35853
+ * verified resend, but gated on still being IN a modal (status 'approval')
35854
+ * rather than still idle: the first CR fires immediately, then resends every
35855
+ * WIN32_SUBMIT_RESEND_GAP_MS while the FSM is still showing the modal, up to
35856
+ * WIN32_SUBMIT_MAX_RESENDS. The instant the modal resolves (status flips to
35857
+ * generating/idle) we stop, so no stray CR leaks into the next turn's composer.
35858
+ */
35859
+ scheduleWin32ModalConfirm(submitKey) {
35860
+ if (this.win32ModalConfirmTimer) {
35861
+ clearTimeout(this.win32ModalConfirmTimer);
35862
+ this.win32ModalConfirmTimer = null;
35863
+ }
35864
+ const fire = (attempt) => {
35865
+ this.win32ModalConfirmTimer = null;
35866
+ this.adapter.send_keys(submitKey);
35867
+ if (attempt + 1 >= WIN32_SUBMIT_MAX_RESENDS) return;
35868
+ this.win32ModalConfirmTimer = setTimeout(() => {
35869
+ if (this.currentStatus() !== "approval") {
35870
+ this.win32ModalConfirmTimer = null;
35871
+ return;
35872
+ }
35873
+ fire(attempt + 1);
35874
+ }, WIN32_SUBMIT_RESEND_GAP_MS);
35875
+ };
35876
+ fire(0);
35817
35877
  }
35818
35878
  handleAttachImage(blob, mime) {
35819
35879
  const ctl = (this.spec.control_bar ?? []).find((c) => c.action.type === "attach_image");