@adhdev/daemon-standalone 0.9.82-rc.408 → 0.9.82-rc.409

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 ? "b6de7b335f9b6b6bfb202135c2ae017429182efa" : void 0) ?? "unknown";
30131
- const commitShort = readInjected(true ? "b6de7b33" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30132
- const version2 = readInjected(true ? "0.9.82-rc.408" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30133
- const builtAt = readInjected(true ? "2026-06-28T07:54:01.430Z" : void 0);
30130
+ const commit = readInjected(true ? "69cd9c459ec9efafe19a05f66899bb791d6e0561" : void 0) ?? "unknown";
30131
+ const commitShort = readInjected(true ? "69cd9c45" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30132
+ const version2 = readInjected(true ? "0.9.82-rc.409" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30133
+ const builtAt = readInjected(true ? "2026-06-28T09:03:58.064Z" : void 0);
30134
30134
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30135
30135
  return cached2;
30136
30136
  }
@@ -43658,21 +43658,42 @@ Next step: ${nextStep}`;
43658
43658
  }
43659
43659
  return "";
43660
43660
  }
43661
- function readChatMessageTimestampIso(message) {
43661
+ function readChatMessageTimestampMs(message) {
43662
43662
  if (!message) return void 0;
43663
43663
  const record2 = message;
43664
- for (const value of [record2.timestamp, record2.createdAt, record2.created_at, record2.updatedAt, record2.time]) {
43664
+ for (const value of [record2.timestamp, record2.createdAt, record2.created_at, record2.updatedAt, record2.time, record2.receivedAt]) {
43665
43665
  if (typeof value === "number" && Number.isFinite(value)) {
43666
- const ms = value > 1e10 ? value : value * 1e3;
43667
- return new Date(ms).toISOString();
43666
+ return value > 1e10 ? value : value * 1e3;
43668
43667
  }
43669
43668
  if (typeof value === "string" && value.trim()) {
43670
43669
  const ms = new Date(value.trim()).getTime();
43671
- if (Number.isFinite(ms)) return new Date(ms).toISOString();
43670
+ if (Number.isFinite(ms)) return ms;
43672
43671
  }
43673
43672
  }
43674
43673
  return void 0;
43675
43674
  }
43675
+ function readChatMessageTimestampIso(message) {
43676
+ const ms = readChatMessageTimestampMs(message);
43677
+ return typeof ms === "number" ? new Date(ms).toISOString() : void 0;
43678
+ }
43679
+ function extractFinalSummaryFromMessagesAfter(messages, minTimestampMs, maxChars = DEFAULT_FINAL_SUMMARY_MAX_CHARS) {
43680
+ if (!Array.isArray(messages) || messages.length === 0) return "";
43681
+ const hasBoundary = typeof minTimestampMs === "number" && Number.isFinite(minTimestampMs);
43682
+ for (let i = messages.length - 1; i >= 0; i--) {
43683
+ const msg = messages[i];
43684
+ if (!msg) continue;
43685
+ if (hasBoundary) {
43686
+ const ts2 = readChatMessageTimestampMs(msg);
43687
+ if (typeof ts2 === "number" && ts2 < minTimestampMs) continue;
43688
+ }
43689
+ const classification = classifyChatMessageVisibility(msg);
43690
+ if (classification.isUserFacing && (msg.role === "assistant" || msg.role === "model")) {
43691
+ const text = flattenContent(msg.content).trim();
43692
+ if (text) return text.slice(0, maxChars);
43693
+ }
43694
+ }
43695
+ return "";
43696
+ }
43676
43697
  function extractFinalAssistantSummaryEvidence(messages, maxChars = DEFAULT_FINAL_SUMMARY_MAX_CHARS) {
43677
43698
  if (!Array.isArray(messages) || messages.length === 0) return { finalSummary: "" };
43678
43699
  for (let i = messages.length - 1; i >= 0; i--) {
@@ -62531,6 +62552,10 @@ ${effect.notification.body || ""}`.trim();
62531
62552
  const effectiveStatus = status?.status === "waiting_approval" || targetState?.activeChat?.status === "waiting_approval" || parsedStatus?.status === "waiting_approval" ? "waiting_approval" : status?.status;
62532
62553
  LOG2.info("Command", `[resolveAction] CLI PTY gate target=${String(args?.targetSessionId || "")} rawStatus=${String(status?.status || "")} effectiveStatus=${String(effectiveStatus || "")} statusModal=${statusModal ? "yes" : "no"} surfacedModal=${surfacedModal ? "yes" : "no"} parsedModal=${parsedModal ? "yes" : "no"} instance=${targetInstance ? "yes" : "no"}`);
62533
62554
  if (!effectiveModal) {
62555
+ if (typeof adapter.isApprovalRecentlyResolved === "function" && adapter.isApprovalRecentlyResolved()) {
62556
+ LOG2.info("Command", `[resolveAction] CLI PTY \u2192 already_resolved (modal gone, resolved within cooldown)`);
62557
+ return { success: true, alreadyResolved: true, status: "already_resolved" };
62558
+ }
62534
62559
  return { success: false, error: "Not in approval state" };
62535
62560
  }
62536
62561
  const buttons = Array.isArray(effectiveModal.buttons) ? effectiveModal.buttons : [];
@@ -70466,14 +70491,14 @@ ${body}
70466
70491
  source: "unavailable"
70467
70492
  };
70468
70493
  }
70469
- completionFinalSummary(parsedMessages) {
70494
+ completionFinalSummary(parsedMessages, turnStartedAt) {
70470
70495
  const adapterOwnsMessagesElsewhere = this.adapter?.chatMessagesOwnedExternally === true;
70471
70496
  const parsedSummary = extractFinalSummaryFromMessages(
70472
70497
  this.completionHasFinalAssistantMessage(parsedMessages) ? Array.isArray(parsedMessages) ? parsedMessages : [] : []
70473
70498
  );
70474
70499
  if (adapterOwnsMessagesElsewhere) {
70475
70500
  const externalMessages = this.readExternalCompletionMessages();
70476
- const externalSummary = externalMessages ? extractFinalSummaryFromMessages(externalMessages) : "";
70501
+ const externalSummary = externalMessages ? extractFinalSummaryFromMessagesAfter(externalMessages, turnStartedAt) : "";
70477
70502
  if (externalSummary) return externalSummary;
70478
70503
  return parsedSummary || void 0;
70479
70504
  }
@@ -70760,7 +70785,7 @@ ${body}
70760
70785
  // delegated session's inbox preview blank — or, for a LOCAL worktree session,
70761
70786
  // stuck on the dispatched user task. If the parser DID surface assistant text,
70762
70787
  // prefer it; only fall back to '' when no assistant summary can be derived.
70763
- finalSummary: blockReason.startsWith("parsed_status:") ? this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages) ?? "" : this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages),
70788
+ finalSummary: blockReason.startsWith("parsed_status:") ? this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages, pending.turnStartedAt) ?? "" : this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages, pending.turnStartedAt),
70764
70789
  completionDiagnostic
70765
70790
  });
70766
70791
  this.completedDebouncePending = null;
@@ -70780,7 +70805,7 @@ ${body}
70780
70805
  timestamp: pending.timestamp,
70781
70806
  // ARCH-REFACTOR R1: attribute to the turn captured at idle-transition.
70782
70807
  ...pending.taskId ? { taskId: pending.taskId } : {},
70783
- finalSummary: this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages)
70808
+ finalSummary: this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages, pending.turnStartedAt)
70784
70809
  });
70785
70810
  this.completedDebouncePending = null;
70786
70811
  this.completedDebounceTimer = null;
@@ -70896,7 +70921,7 @@ ${body}
70896
70921
  */
70897
70922
  recheckAutoApproveSettled() {
70898
70923
  try {
70899
- const adapterStatus = this.adapter.getStatus({ allowParse: false });
70924
+ const adapterStatus = this.adapter.getStatus({ allowParse: true });
70900
70925
  this.maybeAutoApproveStatus(adapterStatus, Date.now());
70901
70926
  } catch {
70902
70927
  }
@@ -71127,7 +71152,16 @@ ${body}
71127
71152
  // ARCH-REFACTOR R1: snapshot the completing turn's taskId NOW (sync),
71128
71153
  // before any follow-up task's flush can start a new turn and move
71129
71154
  // engine.currentTurnTaskId.
71130
- ...this.completingTurnTaskId() ? { taskId: this.completingTurnTaskId() } : {}
71155
+ ...this.completingTurnTaskId() ? { taskId: this.completingTurnTaskId() } : {},
71156
+ // NOTIF Defect-B: snapshot the producing turn's START instant NOW, for the
71157
+ // same reason as taskId — a follow-up turn moves engine.currentTurnStartedAt.
71158
+ // Prefer the engine's per-turn start (set at onTurnStarted, earliest reliable
71159
+ // anchor) and fall back to generatingStartedAt (when generating was observed).
71160
+ ...(() => {
71161
+ const engineTurnStart = typeof this.adapter?.currentTurnStartedAt === "number" && Number.isFinite(this.adapter.currentTurnStartedAt) ? this.adapter.currentTurnStartedAt : 0;
71162
+ const turnStartedAt = engineTurnStart || this.generatingStartedAt || 0;
71163
+ return turnStartedAt ? { turnStartedAt } : {};
71164
+ })()
71131
71165
  };
71132
71166
  const ownsExternalHistory = !!this.adapter?.chatMessagesOwnedExternally;
71133
71167
  const meshWorkerSession = this.isMeshWorkerSession();