@adhdev/daemon-standalone 1.0.28-rc.30 → 1.0.28-rc.31

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
@@ -33311,10 +33311,10 @@ var require_dist3 = __commonJS({
33311
33311
  }
33312
33312
  function getDaemonBuildInfo() {
33313
33313
  if (cached2) return cached2;
33314
- const commit = readInjected(true ? "197fe1b6c1b8ac8cd85f9d7a9395bdb440e2581c" : void 0) ?? "unknown";
33315
- const commitShort = readInjected(true ? "197fe1b6" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
33316
- const version2 = readInjected(true ? "1.0.28-rc.30" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
33317
- const builtAt = readInjected(true ? "2026-07-29T22:19:08.401Z" : void 0);
33314
+ const commit = readInjected(true ? "8fb49e625dd077ea14de9fff7e8843f62c88497e" : void 0) ?? "unknown";
33315
+ const commitShort = readInjected(true ? "8fb49e62" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
33316
+ const version2 = readInjected(true ? "1.0.28-rc.31" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
33317
+ const builtAt = readInjected(true ? "2026-07-29T22:51:31.357Z" : void 0);
33318
33318
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
33319
33319
  return cached2;
33320
33320
  }
@@ -89501,9 +89501,10 @@ ${body}
89501
89501
  const env2 = meta3 && typeof meta3 === "object" ? meta3.spawnedEnv : void 0;
89502
89502
  return env2 && typeof env2 === "object" ? env2 : void 0;
89503
89503
  }
89504
- readExternalCompletionMessages() {
89504
+ readExternalCompletionMessages(opts) {
89505
89505
  const adapterOwnsMessagesElsewhere = this.adapter?.chatMessagesOwnedExternally === true;
89506
- if (!adapterOwnsMessagesElsewhere) return null;
89506
+ const manifestNativeSource = opts?.allowManifestNativeSource === true && isNativeSourceCanonicalHistory(this.provider?.nativeHistory);
89507
+ if (!adapterOwnsMessagesElsewhere && !manifestNativeSource) return null;
89507
89508
  if (!isNativeSourceCanonicalHistory(this.provider.nativeHistory)) return null;
89508
89509
  let resolvedHandle = this.providerSessionId || "";
89509
89510
  if (!resolvedHandle) {
@@ -89712,12 +89713,15 @@ ${body}
89712
89713
  }
89713
89714
  completionFinalSummary(parsedMessages, turnStartedAt) {
89714
89715
  const adapterOwnsMessagesElsewhere = this.adapter?.chatMessagesOwnedExternally === true;
89716
+ const manifestNativeSource = !adapterOwnsMessagesElsewhere && isNativeSourceCanonicalHistory(this.provider?.nativeHistory);
89715
89717
  const parsedSummary = extractFinalSummaryFromMessagesAfter(
89716
89718
  this.completionHasFinalAssistantMessage(parsedMessages, turnStartedAt) ? Array.isArray(parsedMessages) ? parsedMessages : [] : [],
89717
89719
  turnStartedAt
89718
89720
  );
89719
- if (adapterOwnsMessagesElsewhere) {
89720
- const externalMessages = this.readExternalCompletionMessages();
89721
+ if (adapterOwnsMessagesElsewhere || manifestNativeSource) {
89722
+ const externalMessages = this.readExternalCompletionMessages(
89723
+ manifestNativeSource ? { allowManifestNativeSource: true } : void 0
89724
+ );
89721
89725
  const externalSummary = externalMessages ? extractFinalSummaryFromMessagesAfter(externalMessages, turnStartedAt) : "";
89722
89726
  if (externalSummary) {
89723
89727
  this.lastCompletionSummary = { content: externalSummary, receivedAt: Date.now(), sourceTimestampMs: typeof turnStartedAt === "number" ? turnStartedAt : void 0 };
@@ -90801,7 +90805,13 @@ ${body}
90801
90805
  // real answer (lastCompletionSummary). Fall back to the cache so the notification
90802
90806
  // carries the summary that mesh_read_chat.summary already shows — consistent with
90803
90807
  // completionDiagnostic.finalAssistantPresent being credited from the same cache.
90804
- finalSummary: this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages, pending.turnStartedAt) || this.cachedInTurnCompletionSummaryContent(pending.turnStartedAt) || (blockReason.startsWith("parsed_status:") ? "" : void 0),
90808
+ // KIMI-RC30-COMPLETION-SUMMARY-NATIVE-SNAPSHOT: when the gate's evidence
90809
+ // probe already proved the turn done from an external-native read, its
90810
+ // exact snapshot (pending.resolvedFinalMessages) is the authoritative
90811
+ // final-message snapshot — reuse it instead of paying a second live
90812
+ // read that can race a wire.jsonl rewrite (the EMPTY-FINAL-CONTENT
90813
+ // TOCTOU class, now closed for the forced path too).
90814
+ finalSummary: this.snapshotExternalNativeCompletionSummary(pending) || this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages, pending.turnStartedAt) || this.cachedInTurnCompletionSummaryContent(pending.turnStartedAt) || (blockReason.startsWith("parsed_status:") ? "" : void 0),
90805
90815
  completionDiagnostic
90806
90816
  });
90807
90817
  this.completedDebouncePending = null;
@@ -90906,6 +90916,27 @@ ${body}
90906
90916
  }
90907
90917
  return this.completionFinalSummary(this.adapter?.getScriptParsedStatus()?.messages, pending.turnStartedAt);
90908
90918
  }
90919
+ /**
90920
+ * KIMI-RC30-COMPLETION-SUMMARY-NATIVE-SNAPSHOT: finalSummary seed for the
90921
+ * FORCED finalization-timeout emit. When the gate's last evidence probe proved
90922
+ * the turn's final assistant from an external-NATIVE read
90923
+ * (pending.resolvedFinalEvidenceSource === 'external-native'), the exact
90924
+ * snapshot it cached on pending.resolvedFinalMessages is the authoritative
90925
+ * final-message snapshot — extract from it rather than paying a second,
90926
+ * independent live read that can race a wire.jsonl rewrite between the probe
90927
+ * and the emit (same TOCTOU class cleanCompletionFinalSummary closed for the
90928
+ * clean path). A 'parsed' snapshot is deliberately NOT reused here: for a
90929
+ * native-source provider the parsed PTY scrape can be a stale Todo/progress
90930
+ * bullet (rc.30), so the native-preferring completionFinalSummary below must
90931
+ * get its say first. Turn-scoped by extractFinalSummaryFromMessagesAfter, so
90932
+ * a pre-turn bubble can never leak out of the snapshot either (fail closed).
90933
+ */
90934
+ snapshotExternalNativeCompletionSummary(pending) {
90935
+ if (pending.resolvedFinalEvidenceSource !== "external-native") return void 0;
90936
+ if (!Array.isArray(pending.resolvedFinalMessages)) return void 0;
90937
+ const fromSnapshot = extractFinalSummaryFromMessagesAfter(pending.resolvedFinalMessages, pending.turnStartedAt);
90938
+ return fromSnapshot || void 0;
90939
+ }
90909
90940
  /**
90910
90941
  * A-3 (CLI 완료판정 통합): single authoritative emit for a CLI turn's
90911
90942
  * `agent:generating_completed` event. The completion JUDGMENT — WHETHER and