@adhdev/daemon-standalone 0.9.82-rc.404 → 0.9.82-rc.406

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
@@ -30127,10 +30127,10 @@ var require_dist3 = __commonJS({
30127
30127
  }
30128
30128
  function getDaemonBuildInfo() {
30129
30129
  if (cached2) return cached2;
30130
- const commit = readInjected(true ? "056bddcd4112e4c90d82fdaab60557ccc7acf2a3" : void 0) ?? "unknown";
30131
- const commitShort = readInjected(true ? "056bddcd" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30132
- const version2 = readInjected(true ? "0.9.82-rc.404" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30133
- const builtAt = readInjected(true ? "2026-06-27T19:00:32.749Z" : void 0);
30130
+ const commit = readInjected(true ? "1a663e37a08bce5e83cc14be4663d33ad60e81c9" : void 0) ?? "unknown";
30131
+ const commitShort = readInjected(true ? "1a663e37" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30132
+ const version2 = readInjected(true ? "0.9.82-rc.406" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30133
+ const builtAt = readInjected(true ? "2026-06-28T04:52:54.674Z" : void 0);
30134
30134
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30135
30135
  return cached2;
30136
30136
  }
@@ -49493,6 +49493,13 @@ ${cont}` : cont;
49493
49493
  // queued in pendingOutbound and only flushed asynchronously after idle), so the
49494
49494
  // completion event carries the correct id instead of the racy session scalar.
49495
49495
  currentTurnTaskId = null;
49496
+ // GENERATING-BOUNDARY (R4d): wall-clock when the most recently STARTED turn began
49497
+ // (set by onTurnStarted, persists past completion until the next turn starts).
49498
+ // The startup-grace idle-stayed synthesis anchors its window on when the FIRST turn
49499
+ // STARTED — not on when it finished — so a turn dispatched a few seconds after the
49500
+ // grace collapse and then running for a non-trivial duration is still attributed to
49501
+ // the startup collapse even though its COMPLETION lands past a now-anchored window.
49502
+ currentTurnStartedAt = 0;
49496
49503
  activeModal = null;
49497
49504
  // ── Approval ─────────────────────────────────────
49498
49505
  lastApprovalResolvedAt = 0;
@@ -49603,6 +49610,7 @@ ${cont}` : cont;
49603
49610
  this.clearIdleFinishCandidate("send_message");
49604
49611
  this.currentTurnScope = turnScope;
49605
49612
  this.currentTurnTaskId = typeof turnScope.taskId === "string" && turnScope.taskId.trim() ? turnScope.taskId : null;
49613
+ this.currentTurnStartedAt = Date.now();
49606
49614
  this.responseEpoch += 1;
49607
49615
  }
49608
49616
  /** Called when PTY exits */
@@ -52080,6 +52088,13 @@ ${lastSnapshot}`;
52080
52088
  get currentTurnTaskId() {
52081
52089
  return this.engine.currentTurnTaskId;
52082
52090
  }
52091
+ // R4d: wall-clock when the most recently started turn began (persists past settle).
52092
+ // The provider instance's startup-grace idle-stayed synthesis anchors its window on
52093
+ // this so a delayed-dispatch first turn whose duration overruns the now-anchored
52094
+ // window is still attributed to the startup collapse.
52095
+ get currentTurnStartedAt() {
52096
+ return this.engine.currentTurnStartedAt;
52097
+ }
52083
52098
  get responseEpoch() {
52084
52099
  return this.engine.responseEpoch;
52085
52100
  }
@@ -69609,6 +69624,16 @@ ${body}
69609
69624
  // steadily while the session sits idle, so this guard makes the synthesis fire
69610
69625
  // AT MOST ONCE per collapsed turn.
69611
69626
  fastCollapseSynthesizedTaskId = null;
69627
+ // GENERATING-BOUNDARY (R4c): the wall-clock moment the FSM's starting→idle
69628
+ // startup-grace collapse was observed (set ONCE, on the first starting→idle
69629
+ // transition this boot). The idle-stayed collapse window is anchored on THIS,
69630
+ // not on instance/boot time (this.startedAt): the FSM spends the full 8s
69631
+ // startup-grace sitting in 'starting' before collapsing, and a turn can be
69632
+ // dispatched a few seconds AFTER the collapse — measuring the window from boot
69633
+ // would have it already closed by the time that turn lands+completes (the live
69634
+ // R4b miss: collapse at boot+8s, dispatch at boot+12.4s > the 12s boot window).
69635
+ // Anchoring on the collapse moment makes the window cover dispatch-delay+turn.
69636
+ startupGraceCollapseAt = null;
69612
69637
  settings = {};
69613
69638
  monitor;
69614
69639
  generatingDebounceTimer = null;
@@ -70960,6 +70985,7 @@ ${body}
70960
70985
  }
70961
70986
  } else if (newStatus === "idle" && this.lastStatus === "starting") {
70962
70987
  this.emitAgentReadyOnce(chatTitle, now);
70988
+ if (this.startupGraceCollapseAt === null) this.startupGraceCollapseAt = now;
70963
70989
  this.maybeSynthesizeStartupGraceCollapse(chatTitle, now, "startup_grace_fast_collapse");
70964
70990
  } else if (newStatus === "error") {
70965
70991
  if (this.generatingDebounceTimer) {
@@ -70999,7 +71025,11 @@ ${body}
70999
71025
  }
71000
71026
  this.lastStatus = newStatus;
71001
71027
  }
71002
- if (newStatus === "idle" && previousStatus === "idle" && now - this.startedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS) {
71028
+ const firstTurnStartedAt = typeof this.adapter?.currentTurnStartedAt === "number" ? this.adapter.currentTurnStartedAt : 0;
71029
+ const collapsedAt = this.startupGraceCollapseAt;
71030
+ const turnStartedWithinCollapseWindow = collapsedAt !== null && firstTurnStartedAt > 0 && firstTurnStartedAt >= collapsedAt && firstTurnStartedAt - collapsedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS;
71031
+ const nowWithinCollapseWindow = collapsedAt !== null && now - collapsedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS;
71032
+ if (newStatus === "idle" && previousStatus === "idle" && (turnStartedWithinCollapseWindow || nowWithinCollapseWindow)) {
71003
71033
  this.maybeSynthesizeStartupGraceCollapse(chatTitle, now, "startup_grace_idle_turn_collapse");
71004
71034
  }
71005
71035
  if (newStatus === "idle" && adapterStatus.fsmReadySeen === true && !this.agentReadyEmitted) {