@adhdev/daemon-core 1.0.1 → 1.0.3-rc.1

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.mjs CHANGED
@@ -423,10 +423,10 @@ function readInjected(value) {
423
423
  }
424
424
  function getDaemonBuildInfo() {
425
425
  if (cached) return cached;
426
- const commit = readInjected(true ? "78b108fb45ca3cc0168a6664f4adbbb97a70664c" : void 0) ?? "unknown";
427
- const commitShort = readInjected(true ? "78b108fb" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
428
- const version = readInjected(true ? "1.0.0" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
429
- const builtAt = readInjected(true ? "2026-07-19T04:24:30.893Z" : void 0);
426
+ const commit = readInjected(true ? "6f5b9cdd8abf9605aa9f817151a1ca6d1e949a93" : void 0) ?? "unknown";
427
+ const commitShort = readInjected(true ? "6f5b9cdd" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
428
+ const version = readInjected(true ? "1.0.3-rc.1" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
429
+ const builtAt = readInjected(true ? "2026-07-19T09:54:12.383Z" : void 0);
430
430
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
431
431
  return cached;
432
432
  }
@@ -18132,6 +18132,7 @@ var init_ghostty_vt_backend = __esm({
18132
18132
  }
18133
18133
  getCursorPosition() {
18134
18134
  if (this.disposed) return { col: 0, row: 0 };
18135
+ if (typeof this.terminal.getCursorPosition !== "function") return { col: 0, row: 0 };
18135
18136
  return this.terminal.getCursorPosition();
18136
18137
  }
18137
18138
  dispose() {
@@ -18186,6 +18187,7 @@ var init_terminal_screen = __esm({
18186
18187
  return this.terminal.getTextWithScrollback();
18187
18188
  }
18188
18189
  getCursorPosition() {
18190
+ if (typeof this.terminal.getCursorPosition !== "function") return { col: 0, row: 0 };
18189
18191
  return this.terminal.getCursorPosition();
18190
18192
  }
18191
18193
  /** Current viewport dimensions (cols × rows). */
@@ -45798,6 +45800,14 @@ var SpecCliAdapter = class _SpecCliAdapter {
45798
45800
  * MCP config), so this routing keeps the dashboard honest until
45799
45801
  * hermes ships a runtime MCP override. */
45800
45802
  spawnedEnv = {};
45803
+ /** Wall clock at the moment an approval modal was last resolved (auto-approve,
45804
+ * dashboard, or mesh_approve) via a successful button press. Powers
45805
+ * isApprovalRecentlyResolved() — the second suppression signal the mesh event
45806
+ * forwarder uses to drop a duplicate agent:waiting_approval re-emitted across
45807
+ * the approval↔busy TUI flap window (AUTOAPPROVE-FLAP). Mirrors the
45808
+ * cli-state-engine's lastApprovalResolvedAt for the spec-driven adapter path
45809
+ * (claude-cli specs/4.0.json), which previously stubbed the method to false. */
45810
+ lastApprovalResolvedAt = 0;
45801
45811
  constructor(specPath, workingDir, cliArgs, extraEnv, transportFactory) {
45802
45812
  const raw = JSON.parse(fs20.readFileSync(specPath, "utf8"));
45803
45813
  this.spec = {
@@ -45935,6 +45945,11 @@ var SpecCliAdapter = class _SpecCliAdapter {
45935
45945
  // the char count still looks safe.
45936
45946
  static TERMINAL_SNAPSHOT_DEFAULT_MAX_BYTES = 32 * 1024;
45937
45947
  static TERMINAL_SNAPSHOT_ABSOLUTE_MAX_BYTES = 64 * 1024;
45948
+ /** Window during which isApprovalRecentlyResolved() reports a just-resolved
45949
+ * approval. Matches CliProviderInstance.APPROVAL_LOCAL_RESOLUTION_COOLDOWN_MS
45950
+ * (8000) — the same auto-approve suppression window signal1 uses — so a modal
45951
+ * re-emitted within the approval↔busy flap is suppressed by signal2 too. */
45952
+ static APPROVAL_RESOLVED_COOLDOWN_MS = 8e3;
45938
45953
  /**
45939
45954
  * MESH-READ-TERMINAL (feature 2: RAW terminal read). Least-privilege read
45940
45955
  * of the CURRENT rendered viewport for mesh_read_terminal on the spec path
@@ -46038,7 +46053,11 @@ var SpecCliAdapter = class _SpecCliAdapter {
46038
46053
  resolveModalMatched(buttonIndex) {
46039
46054
  const buttons = this.latestModal?.buttons ?? [];
46040
46055
  const target = buttonIndex >= 0 && buttonIndex < buttons.length ? buttons[buttonIndex].index : buttonIndex + 1;
46041
- return this.driver.clickModalButton(target);
46056
+ const pressed = this.driver.clickModalButton(target);
46057
+ if (pressed && this.latestState?.status === "approval") {
46058
+ this.lastApprovalResolvedAt = Date.now();
46059
+ }
46060
+ return pressed;
46042
46061
  }
46043
46062
  async resolveAction(data) {
46044
46063
  const args = data && typeof data === "object" ? data : {};
@@ -46079,7 +46098,7 @@ var SpecCliAdapter = class _SpecCliAdapter {
46079
46098
  this.statusCallback?.();
46080
46099
  }
46081
46100
  isApprovalRecentlyResolved() {
46082
- return false;
46101
+ return !!(this.lastApprovalResolvedAt && Date.now() - this.lastApprovalResolvedAt < _SpecCliAdapter.APPROVAL_RESOLVED_COOLDOWN_MS);
46083
46102
  }
46084
46103
  clearHistory() {
46085
46104
  }