@adhdev/daemon-core 0.9.82-rc.539 → 0.9.82-rc.540

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
@@ -414,10 +414,10 @@ function readInjected(value) {
414
414
  }
415
415
  function getDaemonBuildInfo() {
416
416
  if (cached) return cached;
417
- const commit = readInjected(true ? "35ac849eca76162066561b27633e11827fa19a73" : void 0) ?? "unknown";
418
- const commitShort = readInjected(true ? "35ac849e" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
419
- const version = readInjected(true ? "0.9.82-rc.539" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
420
- const builtAt = readInjected(true ? "2026-07-15T15:55:08.195Z" : void 0);
417
+ const commit = readInjected(true ? "0674080aa30d25acbfb5c295598d15f686d4cba3" : void 0) ?? "unknown";
418
+ const commitShort = readInjected(true ? "0674080a" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
419
+ const version = readInjected(true ? "0.9.82-rc.540" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
420
+ const builtAt = readInjected(true ? "2026-07-16T01:53:13.412Z" : void 0);
421
421
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
422
422
  return cached;
423
423
  }
@@ -23009,15 +23009,21 @@ function pickApprovalButton(buttons, provider) {
23009
23009
  }
23010
23010
  const normalizedButtons = labels.map((label) => normalizeApprovalLabel(label));
23011
23011
  const hints = getApprovalPositiveHints(provider);
23012
- for (const hint of hints) {
23013
- const exactIndex = normalizedButtons.findIndex((label, index) => label === hint && !isNegativeApprovalLabel(labels[index]));
23014
- if (exactIndex >= 0) return { index: exactIndex, label: labels[exactIndex] };
23015
- const prefixIndex = normalizedButtons.findIndex((label, index) => label.startsWith(hint) && !isNegativeApprovalLabel(labels[index]));
23016
- if (prefixIndex >= 0) return { index: prefixIndex, label: labels[prefixIndex] };
23017
- const includeIndex = normalizedButtons.findIndex((label, index) => label.includes(hint) && !isNegativeApprovalLabel(labels[index]));
23018
- if (includeIndex >= 0) return { index: includeIndex, label: labels[includeIndex] };
23019
- }
23020
- return { index: -1, label: "" };
23012
+ const includesWord = (label, hint) => {
23013
+ if (!label.includes(hint)) return false;
23014
+ const re = new RegExp(`(?:^|\\s)${hint.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?:\\s|$)`);
23015
+ return re.test(label);
23016
+ };
23017
+ const findMatch = (predicate) => {
23018
+ for (const hint of hints) {
23019
+ const idx = normalizedButtons.findIndex(
23020
+ (label, index) => predicate(label, hint) && !isNegativeApprovalLabel(labels[index])
23021
+ );
23022
+ if (idx >= 0) return { index: idx, label: labels[idx] };
23023
+ }
23024
+ return null;
23025
+ };
23026
+ return findMatch((label, hint) => label === hint) ?? findMatch((label, hint) => label.startsWith(hint)) ?? findMatch((label, hint) => includesWord(label, hint)) ?? { index: -1, label: "" };
23021
23027
  }
23022
23028
  function pickAutoApprovalButton(buttons) {
23023
23029
  const labels = (buttons || []).map((button) => String(button || "").trim());
@@ -27019,6 +27025,45 @@ ${lastSnapshot}`;
27019
27025
  shouldUseFullProviderTranscriptContext() {
27020
27026
  return this.providerOwnsTranscript() && this.provider.transcriptContext === "full";
27021
27027
  }
27028
+ /**
27029
+ * MULTI-TURN TRANSCRIPT FLICKER (kimi): whether this provider reconstructs
27030
+ * its ENTIRE transcript from the rendered PTY buffer on every read and so
27031
+ * must be fed the full accumulated buffer rather than the current-turn slice.
27032
+ *
27033
+ * The turn-scope slice (buildCliParseInput → sliceFromOffset(accumulatedBuffer,
27034
+ * scope.bufferStart)) exists so a mid-turn parse only sees the fresh output of
27035
+ * the CURRENT turn — correct for status/streaming detection and for providers
27036
+ * that reassemble prior history elsewhere (native-history on disk, or a
27037
+ * provider-owned full-context parser). But a pure-PTY provider with NO native
27038
+ * history and NO provider transcript authority, whose tui parser walks the
27039
+ * whole buffer for its per-turn bubble markers (kimi's `●`/`✨` bullets),
27040
+ * loses every prior turn's bubbles the instant a new turn starts: bufferStart
27041
+ * jumps to the new turn's offset, the slice drops turns 1..n-1, and until the
27042
+ * new turn emits its first bullet parseSession returns zero messages — so
27043
+ * read_chat momentarily goes EMPTY and the dashboard clears every bubble,
27044
+ * then restores them once output arrives (the observed flicker).
27045
+ *
27046
+ * accumulatedBuffer is the terminal-EMULATED rendered scrollback (overwritten
27047
+ * cells collapsed), not raw PTY append, so parsing it in full yields the clean
27048
+ * cumulative transcript with no repaint duplication. Scope to exactly this
27049
+ * class (tui transcriptPty scope 'buffer' + no native history + not
27050
+ * provider-owned) so no other provider's turn-scoped parse changes.
27051
+ */
27052
+ parsesFullPtyTranscriptFromBuffer() {
27053
+ if (this.providerOwnsTranscript()) return false;
27054
+ if (this.provider.nativeHistory) return false;
27055
+ const transcriptPty = this.provider.tui?.transcriptPty;
27056
+ return transcriptPty?.scope === "buffer";
27057
+ }
27058
+ /**
27059
+ * The turn scope to feed the transcript parser. Normally the live turn scope
27060
+ * (so a mid-turn parse is current-turn-only), but null (= full accumulated
27061
+ * buffer) for pure-PTY full-transcript providers so prior turns never drop.
27062
+ * See {@link parsesFullPtyTranscriptFromBuffer}.
27063
+ */
27064
+ transcriptParseScope() {
27065
+ return this.parsesFullPtyTranscriptFromBuffer() ? null : this.engine.currentTurnScope;
27066
+ }
27022
27067
  getIdleFinishConfirmMs() {
27023
27068
  return this.timeouts.idleFinishConfirm;
27024
27069
  }
@@ -27372,7 +27417,10 @@ ${lastSnapshot}`;
27372
27417
  baseMessages: [],
27373
27418
  partialResponse: this.responseBuffer,
27374
27419
  isWaitingForResponse: this.engine.isWaitingForResponse,
27375
- scope: this.engine.currentTurnScope,
27420
+ // Full accumulated buffer (scope null) for pure-PTY full-transcript
27421
+ // providers so prior turns' bubbles never drop when a new turn starts;
27422
+ // the current-turn slice otherwise. See parsesFullPtyTranscriptFromBuffer.
27423
+ scope: this.transcriptParseScope(),
27376
27424
  runtimeSettings: this.runtimeSettings,
27377
27425
  spawnAt: this.spawnAt
27378
27426
  });
@@ -38637,7 +38685,7 @@ async function handleResolveAction(h, args) {
38637
38685
  buttonIndex = buttons.findIndex((b) => b.toLowerCase().includes(btnLower));
38638
38686
  }
38639
38687
  if (buttonIndex < 0 && (action === "reject" || action === "deny")) {
38640
- buttonIndex = buttons.findIndex((b) => /deny|reject|no/i.test(b));
38688
+ buttonIndex = buttons.findIndex((b) => isNegativeApprovalLabel(b));
38641
38689
  }
38642
38690
  if (buttonIndex < 0 && (action === "always" || /always/i.test(button))) {
38643
38691
  buttonIndex = buttons.findIndex((b) => /always/i.test(b));