@adhdev/daemon-core 0.9.82-rc.405 → 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.
@@ -59,6 +59,7 @@ export declare class CliStateEngine {
59
59
  isWaitingForResponse: boolean;
60
60
  currentTurnScope: TurnParseScope | null;
61
61
  currentTurnTaskId: string | null;
62
+ currentTurnStartedAt: number;
62
63
  activeModal: {
63
64
  message: string;
64
65
  buttons: string[];
@@ -231,6 +231,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
231
231
  get currentTurnScope(): TurnParseScope | null;
232
232
  set currentTurnScope(v: TurnParseScope | null);
233
233
  get currentTurnTaskId(): string | null;
234
+ get currentTurnStartedAt(): number;
234
235
  get responseEpoch(): number;
235
236
  set responseEpoch(v: number);
236
237
  get submitRetryUsed(): boolean;
package/dist/index.js CHANGED
@@ -399,10 +399,10 @@ function readInjected(value) {
399
399
  }
400
400
  function getDaemonBuildInfo() {
401
401
  if (cached) return cached;
402
- const commit = readInjected(true ? "4e4b5f468d194f630073a66359898bce97fadf4b" : void 0) ?? "unknown";
403
- const commitShort = readInjected(true ? "4e4b5f46" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
404
- const version = readInjected(true ? "0.9.82-rc.405" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
405
- const builtAt = readInjected(true ? "2026-06-28T03:54:34.483Z" : void 0);
402
+ const commit = readInjected(true ? "1a663e37a08bce5e83cc14be4663d33ad60e81c9" : void 0) ?? "unknown";
403
+ const commitShort = readInjected(true ? "1a663e37" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
404
+ const version = readInjected(true ? "0.9.82-rc.406" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
405
+ const builtAt = readInjected(true ? "2026-06-28T04:52:22.784Z" : void 0);
406
406
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
407
407
  return cached;
408
408
  }
@@ -19664,6 +19664,13 @@ var init_cli_state_engine = __esm({
19664
19664
  // queued in pendingOutbound and only flushed asynchronously after idle), so the
19665
19665
  // completion event carries the correct id instead of the racy session scalar.
19666
19666
  currentTurnTaskId = null;
19667
+ // GENERATING-BOUNDARY (R4d): wall-clock when the most recently STARTED turn began
19668
+ // (set by onTurnStarted, persists past completion until the next turn starts).
19669
+ // The startup-grace idle-stayed synthesis anchors its window on when the FIRST turn
19670
+ // STARTED — not on when it finished — so a turn dispatched a few seconds after the
19671
+ // grace collapse and then running for a non-trivial duration is still attributed to
19672
+ // the startup collapse even though its COMPLETION lands past a now-anchored window.
19673
+ currentTurnStartedAt = 0;
19667
19674
  activeModal = null;
19668
19675
  // ── Approval ─────────────────────────────────────
19669
19676
  lastApprovalResolvedAt = 0;
@@ -19774,6 +19781,7 @@ var init_cli_state_engine = __esm({
19774
19781
  this.clearIdleFinishCandidate("send_message");
19775
19782
  this.currentTurnScope = turnScope;
19776
19783
  this.currentTurnTaskId = typeof turnScope.taskId === "string" && turnScope.taskId.trim() ? turnScope.taskId : null;
19784
+ this.currentTurnStartedAt = Date.now();
19777
19785
  this.responseEpoch += 1;
19778
19786
  }
19779
19787
  /** Called when PTY exits */
@@ -22252,6 +22260,13 @@ ${lastSnapshot}`;
22252
22260
  get currentTurnTaskId() {
22253
22261
  return this.engine.currentTurnTaskId;
22254
22262
  }
22263
+ // R4d: wall-clock when the most recently started turn began (persists past settle).
22264
+ // The provider instance's startup-grace idle-stayed synthesis anchors its window on
22265
+ // this so a delayed-dispatch first turn whose duration overruns the now-anchored
22266
+ // window is still attributed to the startup collapse.
22267
+ get currentTurnStartedAt() {
22268
+ return this.engine.currentTurnStartedAt;
22269
+ }
22255
22270
  get responseEpoch() {
22256
22271
  return this.engine.responseEpoch;
22257
22272
  }
@@ -41365,7 +41380,11 @@ var CliProviderInstance = class _CliProviderInstance {
41365
41380
  }
41366
41381
  this.lastStatus = newStatus;
41367
41382
  }
41368
- if (newStatus === "idle" && previousStatus === "idle" && this.startupGraceCollapseAt !== null && now - this.startupGraceCollapseAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS) {
41383
+ const firstTurnStartedAt = typeof this.adapter?.currentTurnStartedAt === "number" ? this.adapter.currentTurnStartedAt : 0;
41384
+ const collapsedAt = this.startupGraceCollapseAt;
41385
+ const turnStartedWithinCollapseWindow = collapsedAt !== null && firstTurnStartedAt > 0 && firstTurnStartedAt >= collapsedAt && firstTurnStartedAt - collapsedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS;
41386
+ const nowWithinCollapseWindow = collapsedAt !== null && now - collapsedAt < STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS;
41387
+ if (newStatus === "idle" && previousStatus === "idle" && (turnStartedWithinCollapseWindow || nowWithinCollapseWindow)) {
41369
41388
  this.maybeSynthesizeStartupGraceCollapse(chatTitle, now, "startup_grace_idle_turn_collapse");
41370
41389
  }
41371
41390
  if (newStatus === "idle" && adapterStatus.fsmReadySeen === true && !this.agentReadyEmitted) {