@adhdev/daemon-standalone 0.9.82-rc.359 → 0.9.82-rc.360

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
@@ -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 ? "56a1f2a986ab2c2bb7888189d9b027d6067f2317" : void 0) ?? "unknown";
30040
- const commitShort = readInjected(true ? "56a1f2a9" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30041
- const version2 = readInjected(true ? "0.9.82-rc.359" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30042
- const builtAt = readInjected(true ? "2026-06-23T05:03:37.127Z" : void 0);
30039
+ const commit = readInjected(true ? "ea4a65e3d2be71c4aba09dbb000df08d2111759e" : void 0) ?? "unknown";
30040
+ const commitShort = readInjected(true ? "ea4a65e3" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30041
+ const version2 = readInjected(true ? "0.9.82-rc.360" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30042
+ const builtAt = readInjected(true ? "2026-06-23T08:23:40.567Z" : void 0);
30043
30043
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30044
30044
  return cached2;
30045
30045
  }
@@ -62984,10 +62984,14 @@ ${formatManifestValidationIssues2(validation.issues)}`,
62984
62984
  var WIN32_SUBMIT_RESEND_GAP_MS = 350;
62985
62985
  var WIN32_SUBMIT_MAX_RESENDS = 14;
62986
62986
  var WIN32_SUBMIT_SETTLE_MS = 500;
62987
- var WIN32_SUBMIT_MAX_SETTLE_WAIT_MS = 1e4;
62988
62987
  var WIN32_SUBMIT_SETTLE_POLL_MS = 120;
62989
62988
  var WIN32_PTY_WRITE_CHUNK_CHARS = 1024;
62990
62989
  var WIN32_PTY_WRITE_CHUNK_GAP_MS = 8;
62990
+ var WIN32_ECHO_PROBE_CHARS = 16;
62991
+ var WIN32_ECHO_MAX_WAIT_MS = 2e4;
62992
+ function normalizeForEcho(s2) {
62993
+ return s2.replace(/\s+/g, "");
62994
+ }
62991
62995
  function resolveSubmitDelayMs(specBeforeSubmit, text) {
62992
62996
  const lines = countNewlines(text);
62993
62997
  const linesBonus = Math.min(800, lines * 80);
@@ -63617,7 +63621,7 @@ ${formatManifestValidationIssues2(validation.issues)}`,
63617
63621
  const beforeSubmit = resolveSubmitDelayMs(sm.delay_ms_before_submit, text);
63618
63622
  if (process.platform === "win32") {
63619
63623
  this.writeWin32Body(text);
63620
- this.scheduleWin32Submit(sm.submit_key, beforeSubmit);
63624
+ this.scheduleWin32Submit(sm.submit_key, beforeSubmit, text);
63621
63625
  return;
63622
63626
  }
63623
63627
  if (perChar === 0) {
@@ -63687,13 +63691,16 @@ ${formatManifestValidationIssues2(validation.issues)}`,
63687
63691
  /**
63688
63692
  * win32 submit. Two phases:
63689
63693
  *
63690
- * Phase 1 (settle-gate): hold the first CR until the PTY output has been quiet
63691
- * for WIN32_SUBMIT_SETTLE_MS after the last input write i.e. the full
63692
- * (possibly multi-KB / multiline) body has finished arriving in the composer
63693
- * and echoing. Honors an initial minimum delay and is bounded by
63694
- * WIN32_SUBMIT_MAX_SETTLE_WAIT_MS so a noisy screen can never hang the submit.
63695
- * This is what stops a long message from being submitted half-arrived (its
63696
- * leading lines lost). A short message settles almost immediately.
63694
+ * Phase 1 (echo-gate): hold the first CR until the body text is CONFIRMED in the
63695
+ * composer (its whitespace-collapsed tail appears in the rendered screen) AND the
63696
+ * PTY output is then quiet for WIN32_SUBMIT_SETTLE_MS (the full, possibly multi-KB
63697
+ * / multiline body has finished arriving). This replaces a bare output-quiet
63698
+ * settle: an early write that races claude's boot is buffered, not dropped, so the
63699
+ * screen can go quiet with the body NOT YET in the composer — a quiet-only gate
63700
+ * would then fire a CR into an empty composer (no submit). Waiting on the echo
63701
+ * closes that. Honors an initial minimum delay and a generous WIN32_ECHO_MAX_WAIT_MS
63702
+ * last-resort blind fire so a body that truly never confirms still submits (carried
63703
+ * by phase 2) rather than hanging. A settled session echoes immediately → no delay.
63697
63704
  *
63698
63705
  * Phase 2 (verified resend — unchanged): send the submit key, wait a gap, and
63699
63706
  * if the FSM is still 'idle' (the CR was absorbed as a multiline-paste
@@ -63702,12 +63709,17 @@ ${formatManifestValidationIssues2(validation.issues)}`,
63702
63709
  * idle and stop the instant the agent leaves idle (submitted → generating /
63703
63710
  * approval). This preserves the win32 lone-CR-swallow handling.
63704
63711
  */
63705
- scheduleWin32Submit(submitKey, initialDelayMs) {
63712
+ scheduleWin32Submit(submitKey, initialDelayMs, body) {
63706
63713
  if (this.win32SubmitTimer) {
63707
63714
  clearTimeout(this.win32SubmitTimer);
63708
63715
  this.win32SubmitTimer = null;
63709
63716
  }
63710
63717
  const startedAt = Date.now();
63718
+ const probe = normalizeForEcho(body).slice(-WIN32_ECHO_PROBE_CHARS);
63719
+ const bodyEchoed = () => {
63720
+ if (!probe) return true;
63721
+ return normalizeForEcho(this.adapter.snapshot()).includes(probe);
63722
+ };
63711
63723
  const fire = (attempt) => {
63712
63724
  this.win32SubmitTimer = null;
63713
63725
  this.adapter.send_keys(submitKey);
@@ -63720,20 +63732,24 @@ ${formatManifestValidationIssues2(validation.issues)}`,
63720
63732
  fire(attempt + 1);
63721
63733
  }, WIN32_SUBMIT_RESEND_GAP_MS);
63722
63734
  };
63723
- const waitForSettle = () => {
63735
+ const waitForEcho = () => {
63724
63736
  this.win32SubmitTimer = null;
63725
63737
  const now = Date.now();
63726
63738
  const quietFor = now - this.lastWin32InputActivityAt();
63727
63739
  const waited = now - startedAt;
63728
- if (quietFor >= WIN32_SUBMIT_SETTLE_MS || waited >= WIN32_SUBMIT_MAX_SETTLE_WAIT_MS) {
63740
+ const settled = quietFor >= WIN32_SUBMIT_SETTLE_MS;
63741
+ if (bodyEchoed() && settled) {
63742
+ fire(0);
63743
+ return;
63744
+ }
63745
+ if (waited >= WIN32_ECHO_MAX_WAIT_MS) {
63729
63746
  fire(0);
63730
63747
  return;
63731
63748
  }
63732
- const recheckIn = Math.min(WIN32_SUBMIT_SETTLE_MS - quietFor, WIN32_SUBMIT_SETTLE_POLL_MS);
63733
- this.win32SubmitTimer = setTimeout(waitForSettle, Math.max(recheckIn, 30));
63749
+ this.win32SubmitTimer = setTimeout(waitForEcho, WIN32_SUBMIT_SETTLE_POLL_MS);
63734
63750
  };
63735
- if (initialDelayMs > 0) this.win32SubmitTimer = setTimeout(waitForSettle, initialDelayMs);
63736
- else waitForSettle();
63751
+ if (initialDelayMs > 0) this.win32SubmitTimer = setTimeout(waitForEcho, initialDelayMs);
63752
+ else waitForEcho();
63737
63753
  }
63738
63754
  handleClickControl(controlId, payload) {
63739
63755
  const ctl = (this.spec.control_bar ?? []).find((c) => c.id === controlId);