@adhdev/daemon-core 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.mjs CHANGED
@@ -394,10 +394,10 @@ function readInjected(value) {
394
394
  }
395
395
  function getDaemonBuildInfo() {
396
396
  if (cached) return cached;
397
- const commit = readInjected(true ? "056bddcd4112e4c90d82fdaab60557ccc7acf2a3" : void 0) ?? "unknown";
398
- const commitShort = readInjected(true ? "056bddcd" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
399
- const version = readInjected(true ? "0.9.82-rc.404" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
400
- const builtAt = readInjected(true ? "2026-06-27T19:00:01.532Z" : void 0);
397
+ const commit = readInjected(true ? "1a663e37a08bce5e83cc14be4663d33ad60e81c9" : void 0) ?? "unknown";
398
+ const commitShort = readInjected(true ? "1a663e37" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
399
+ const version = readInjected(true ? "0.9.82-rc.406" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
400
+ const builtAt = readInjected(true ? "2026-06-28T04:52:22.784Z" : void 0);
401
401
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
402
402
  return cached;
403
403
  }
@@ -19658,6 +19658,13 @@ var init_cli_state_engine = __esm({
19658
19658
  // queued in pendingOutbound and only flushed asynchronously after idle), so the
19659
19659
  // completion event carries the correct id instead of the racy session scalar.
19660
19660
  currentTurnTaskId = null;
19661
+ // GENERATING-BOUNDARY (R4d): wall-clock when the most recently STARTED turn began
19662
+ // (set by onTurnStarted, persists past completion until the next turn starts).
19663
+ // The startup-grace idle-stayed synthesis anchors its window on when the FIRST turn
19664
+ // STARTED — not on when it finished — so a turn dispatched a few seconds after the
19665
+ // grace collapse and then running for a non-trivial duration is still attributed to
19666
+ // the startup collapse even though its COMPLETION lands past a now-anchored window.
19667
+ currentTurnStartedAt = 0;
19661
19668
  activeModal = null;
19662
19669
  // ── Approval ─────────────────────────────────────
19663
19670
  lastApprovalResolvedAt = 0;
@@ -19768,6 +19775,7 @@ var init_cli_state_engine = __esm({
19768
19775
  this.clearIdleFinishCandidate("send_message");
19769
19776
  this.currentTurnScope = turnScope;
19770
19777
  this.currentTurnTaskId = typeof turnScope.taskId === "string" && turnScope.taskId.trim() ? turnScope.taskId : null;
19778
+ this.currentTurnStartedAt = Date.now();
19771
19779
  this.responseEpoch += 1;
19772
19780
  }
19773
19781
  /** Called when PTY exits */
@@ -22245,6 +22253,13 @@ ${lastSnapshot}`;
22245
22253
  get currentTurnTaskId() {
22246
22254
  return this.engine.currentTurnTaskId;
22247
22255
  }
22256
+ // R4d: wall-clock when the most recently started turn began (persists past settle).
22257
+ // The provider instance's startup-grace idle-stayed synthesis anchors its window on
22258
+ // this so a delayed-dispatch first turn whose duration overruns the now-anchored
22259
+ // window is still attributed to the startup collapse.
22260
+ get currentTurnStartedAt() {
22261
+ return this.engine.currentTurnStartedAt;
22262
+ }
22248
22263
  get responseEpoch() {
22249
22264
  return this.engine.responseEpoch;
22250
22265
  }
@@ -39583,6 +39598,16 @@ var CliProviderInstance = class _CliProviderInstance {
39583
39598
  // steadily while the session sits idle, so this guard makes the synthesis fire
39584
39599
  // AT MOST ONCE per collapsed turn.
39585
39600
  fastCollapseSynthesizedTaskId = null;
39601
+ // GENERATING-BOUNDARY (R4c): the wall-clock moment the FSM's starting→idle
39602
+ // startup-grace collapse was observed (set ONCE, on the first starting→idle
39603
+ // transition this boot). The idle-stayed collapse window is anchored on THIS,
39604
+ // not on instance/boot time (this.startedAt): the FSM spends the full 8s
39605
+ // startup-grace sitting in 'starting' before collapsing, and a turn can be
39606
+ // dispatched a few seconds AFTER the collapse — measuring the window from boot
39607
+ // would have it already closed by the time that turn lands+completes (the live
39608
+ // R4b miss: collapse at boot+8s, dispatch at boot+12.4s > the 12s boot window).
39609
+ // Anchoring on the collapse moment makes the window cover dispatch-delay+turn.
39610
+ startupGraceCollapseAt = null;
39586
39611
  settings = {};
39587
39612
  monitor;
39588
39613
  generatingDebounceTimer = null;
@@ -40934,6 +40959,7 @@ var CliProviderInstance = class _CliProviderInstance {
40934
40959
  }
40935
40960
  } else if (newStatus === "idle" && this.lastStatus === "starting") {
40936
40961
  this.emitAgentReadyOnce(chatTitle, now);
40962
+ if (this.startupGraceCollapseAt === null) this.startupGraceCollapseAt = now;
40937
40963
  this.maybeSynthesizeStartupGraceCollapse(chatTitle, now, "startup_grace_fast_collapse");
40938
40964
  } else if (newStatus === "error") {
40939
40965
  if (this.generatingDebounceTimer) {
@@ -40973,7 +40999,11 @@ var CliProviderInstance = class _CliProviderInstance {
40973
40999
  }
40974
41000
  this.lastStatus = newStatus;
40975
41001
  }
40976
- if (newStatus === "idle" && previousStatus === "idle" && now - this.startedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS) {
41002
+ const firstTurnStartedAt = typeof this.adapter?.currentTurnStartedAt === "number" ? this.adapter.currentTurnStartedAt : 0;
41003
+ const collapsedAt = this.startupGraceCollapseAt;
41004
+ const turnStartedWithinCollapseWindow = collapsedAt !== null && firstTurnStartedAt > 0 && firstTurnStartedAt >= collapsedAt && firstTurnStartedAt - collapsedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS;
41005
+ const nowWithinCollapseWindow = collapsedAt !== null && now - collapsedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS;
41006
+ if (newStatus === "idle" && previousStatus === "idle" && (turnStartedWithinCollapseWindow || nowWithinCollapseWindow)) {
40977
41007
  this.maybeSynthesizeStartupGraceCollapse(chatTitle, now, "startup_grace_idle_turn_collapse");
40978
41008
  }
40979
41009
  if (newStatus === "idle" && adapterStatus.fsmReadySeen === true && !this.agentReadyEmitted) {