@adhdev/daemon-standalone 0.9.82-rc.531 → 0.9.82-rc.533

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
@@ -30208,10 +30208,10 @@ var require_dist3 = __commonJS({
30208
30208
  }
30209
30209
  function getDaemonBuildInfo() {
30210
30210
  if (cached2) return cached2;
30211
- const commit = readInjected(true ? "e3fc80a7e951a782e3a4e192d432e9b5fc3ee1ab" : void 0) ?? "unknown";
30212
- const commitShort = readInjected(true ? "e3fc80a7" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30213
- const version2 = readInjected(true ? "0.9.82-rc.531" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30214
- const builtAt = readInjected(true ? "2026-07-15T05:51:59.547Z" : void 0);
30211
+ const commit = readInjected(true ? "4bcba3bd84cc9f4cd08a3d93965f10f43fcf5dad" : void 0) ?? "unknown";
30212
+ const commitShort = readInjected(true ? "4bcba3bd" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30213
+ const version2 = readInjected(true ? "0.9.82-rc.533" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30214
+ const builtAt = readInjected(true ? "2026-07-15T07:46:12.141Z" : void 0);
30215
30215
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30216
30216
  return cached2;
30217
30217
  }
@@ -56838,8 +56838,8 @@ ${lastSnapshot}`;
56838
56838
  const stableMs = this.lastScreenChangeAt ? now - this.lastScreenChangeAt : 0;
56839
56839
  if (stableMs < 2e3) return;
56840
56840
  const startupModal = this.runParseApproval(this.recentOutputBuffer);
56841
- const startupStatus = this.runDetectStatus(screenText || this.recentOutputBuffer);
56842
- if (!startupModal && startupStatus !== "idle") {
56841
+ const startupIdle = this.detectIdleHonoringOnNoMatch(screenText || this.recentOutputBuffer);
56842
+ if (!startupModal && !startupIdle) {
56843
56843
  this.scheduleStartupSettleCheck();
56844
56844
  return;
56845
56845
  }
@@ -56975,6 +56975,38 @@ ${lastSnapshot}`;
56975
56975
  tailScreen: buildCliScreenSnapshot(tail)
56976
56976
  });
56977
56977
  }
56978
+ /**
56979
+ * WRITE-READINESS ONNOMATCH (opencode): resolve whether the session is
56980
+ * genuinely idle *for the purpose of opening the PTY write gate*, honoring
56981
+ * the manifest's `dispatchOrder.onNoMatch` policy.
56982
+ *
56983
+ * The split-brain this closes: the engine's settled evaluation runs
56984
+ * detectStatus through parseSession, whose builder collapses a null verdict
56985
+ * to `'idle'` (buildParseSessionFromTui: `detectStatus(input) ?? 'idle'`),
56986
+ * so the dashboard status flips to idle via `script_detect`. But the
56987
+ * write-readiness gates (resolveStartupState / sendMessage recovery) call
56988
+ * `runDetectStatus` *directly* and require the literal `=== 'idle'` return —
56989
+ * they never apply the `onNoMatch` policy. opencode's only idle cue is the
56990
+ * `Ask anything` composer placeholder in the last-8-lines scope with
56991
+ * `onNoMatch: preserve-last`; when that placeholder is momentarily out of
56992
+ * frame the raw detector returns null, the gate stays shut, `this.ready`
56993
+ * never flips, and the first queued prompt sits in `not_ready_pending_prompt`
56994
+ * forever (no turn ever starts, so no turn-completion drain fires).
56995
+ *
56996
+ * The fix keeps the raw detector as the primary signal (unchanged behavior
56997
+ * for providers whose detector returns a literal idle) and only falls back
56998
+ * when BOTH (a) the manifest policy is idle-preserving (`preserve-last` or
56999
+ * `idle`) AND (b) the engine has *durably* settled to idle (no in-flight
57000
+ * turn, no modal, no parse error). That guard makes the fallback safe: it
57001
+ * cannot open the gate mid-turn or while a modal is up.
57002
+ */
57003
+ detectIdleHonoringOnNoMatch(text) {
57004
+ if (this.runDetectStatus(text) === "idle") return true;
57005
+ const dispatchOrder = this.provider.tui?.dispatchOrder;
57006
+ const onNoMatch = dispatchOrder?.onNoMatch;
57007
+ if (onNoMatch !== "preserve-last" && onNoMatch !== "idle") return false;
57008
+ return this.engine.currentStatus === "idle" && !this.engine.isWaitingForResponse && !this.engine.currentTurnScope && !this.engine.activeModal && !this.parseErrorMessage;
57009
+ }
56978
57010
  runParseApproval(tail) {
56979
57011
  const screenText = this.terminalScreen.getText();
56980
57012
  const buffer = screenText || this.accumulatedBuffer;
@@ -57507,7 +57539,7 @@ ${lastSnapshot}`;
57507
57539
  }
57508
57540
  if (!this.ready) {
57509
57541
  this.resolveStartupState("send_precheck");
57510
- if (this.runDetectStatus(this.recentOutputBuffer) === "idle") {
57542
+ if (!this.ready && this.detectIdleHonoringOnNoMatch(this.recentOutputBuffer)) {
57511
57543
  this.ready = true;
57512
57544
  this.startupParseGate = false;
57513
57545
  this.engine.setStatus("idle", "send_message_idle_prompt_recovery");