@adhdev/daemon-core 1.0.28-rc.8 → 1.0.28-rc.9

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
@@ -791,10 +791,10 @@ function readInjected(value) {
791
791
  }
792
792
  function getDaemonBuildInfo() {
793
793
  if (cached) return cached;
794
- const commit = readInjected(true ? "cb5f0a4f64296587a261176e08731f2f3ed78766" : void 0) ?? "unknown";
795
- const commitShort = readInjected(true ? "cb5f0a4f" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
796
- const version = readInjected(true ? "1.0.28-rc.8" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
797
- const builtAt = readInjected(true ? "2026-07-25T12:20:55.839Z" : void 0);
794
+ const commit = readInjected(true ? "46fd4bbf8982e8d4d2d2d8c46d35631780c8b0f5" : void 0) ?? "unknown";
795
+ const commitShort = readInjected(true ? "46fd4bbf" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
796
+ const version = readInjected(true ? "1.0.28-rc.9" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
797
+ const builtAt = readInjected(true ? "2026-07-25T16:06:51.065Z" : void 0);
798
798
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
799
799
  return cached;
800
800
  }
@@ -25680,6 +25680,17 @@ async function runMeshReconcileTick(components) {
25680
25680
  LOG.warn("MeshReconcile", `Unresolved-delegate forward retry failed: ${e?.message || e}`);
25681
25681
  }
25682
25682
  }
25683
+ if (components.router) {
25684
+ for (const mesh of listMeshes()) {
25685
+ try {
25686
+ if (components.router.getCachedInlineMesh(mesh.id)) {
25687
+ components.router.getCachedInlineMesh(mesh.id, mesh);
25688
+ }
25689
+ } catch (e) {
25690
+ LOG.warn("MeshReconcile", `Inline-cache membership merge failed for mesh ${mesh.id}: ${e?.message || e}`);
25691
+ }
25692
+ }
25693
+ }
25683
25694
  if (dispatchMeshCommand) {
25684
25695
  for (const mesh of listMeshes()) {
25685
25696
  const selfIds = resolveCoordinatorSelfIds(mesh, drainDaemonIds);
@@ -27333,7 +27344,7 @@ function resolveSections(sectionsObj, lines) {
27333
27344
  if (candIdx !== -1 && (idx === -1 || candIdx < idx)) idx = candIdx;
27334
27345
  }
27335
27346
  if (idx !== -1) {
27336
- from = idx;
27347
+ from = typeof sec.above === "number" && sec.above > 0 ? Math.max(0, idx - Math.floor(sec.above)) : idx;
27337
27348
  to = total;
27338
27349
  if (sec.until_regex !== void 0) {
27339
27350
  try {
@@ -27345,6 +27356,9 @@ function resolveSections(sectionsObj, lines) {
27345
27356
  } else if (sec.lines !== void 0) {
27346
27357
  to = Math.min(total, from + sec.lines);
27347
27358
  }
27359
+ } else if (sec.anchor_miss === "empty") {
27360
+ from = 0;
27361
+ to = 0;
27348
27362
  }
27349
27363
  } catch {
27350
27364
  }
@@ -47004,9 +47018,13 @@ var FsmDriver = class {
47004
47018
  curLines = currentLines;
47005
47019
  prevLines = this.prevScreenLines;
47006
47020
  } else {
47007
- const start = Math.max(0, cursor.row - d.cursor_above);
47008
- curLines = currentLines.slice(start, cursor.row);
47009
- prevLines = this.prevScreenLines.slice(start, cursor.row);
47021
+ const window = stableCursorWindow(currentLines.length, cursor.row, d.cursor_above);
47022
+ if (!window) {
47023
+ this.regionLastChangedAt.set(d.key, now);
47024
+ continue;
47025
+ }
47026
+ curLines = currentLines.slice(window.start, window.end);
47027
+ prevLines = this.prevScreenLines.slice(window.start, window.end);
47010
47028
  }
47011
47029
  const cur = filterIgnoredLines(curLines, d.ignoreRe).join("\n");
47012
47030
  const prev = filterIgnoredLines(prevLines, d.ignoreRe).join("\n");
@@ -47599,6 +47617,12 @@ function filterIgnoredLines(lines, ignoreRe) {
47599
47617
  if (!ignoreRe) return lines;
47600
47618
  return lines.filter((l) => !ignoreRe.test(l));
47601
47619
  }
47620
+ function stableCursorWindow(lineCount, cursorRow, cursorAbove) {
47621
+ const end = Math.min(Math.max(0, cursorRow), Math.max(0, lineCount));
47622
+ const start = Math.max(0, end - cursorAbove);
47623
+ if (end <= start) return null;
47624
+ return { start, end };
47625
+ }
47602
47626
 
47603
47627
  // src/providers/spec/cli-adapter.ts
47604
47628
  init_evaluator();
@@ -50168,6 +50192,7 @@ var STATUS_HYDRATION_TAIL_LIMIT = 200;
50168
50192
  var COMPLETED_FINALIZATION_RETRY_MS = 1e3;
50169
50193
  var COMPLETED_FINALIZATION_MAX_WAIT_MS = 3e4;
50170
50194
  var CANON_C_MISSING_ASSISTANT_MIN_ELAPSED_MS = 2e4;
50195
+ var MISSING_ASSISTANT_TRANSCRIPT_GROWTH_QUIET_MS = 6e4;
50171
50196
  var NATIVE_HISTORY_MESH_IDLE_SETTLE_MS = 4e3;
50172
50197
  var PTY_PARSED_FINAL_ASSISTANT_QUIET_DWELL_MS = 1200;
50173
50198
  var ANTIGRAVITY_HOLD_QUIET_DWELL_MS = 3e3;
@@ -52482,6 +52507,34 @@ var CliProviderInstance = class _CliProviderInstance {
52482
52507
  const waitedMs = Date.now() - pending.firstObservedAt;
52483
52508
  const isTranscriptEvidenceGate = block2.allowTimeout === true;
52484
52509
  LOG.debug("CLI", `[${this.type}] finalization block: reason=${blockReason} terminal=${block2.terminal} allowTimeout=${isTranscriptEvidenceGate} waitedMs=${waitedMs} maxWait=${COMPLETED_FINALIZATION_MAX_WAIT_MS}`);
52510
+ if (blockReason === "missing_final_assistant" && block2.noExternalTranscriptSource === true) {
52511
+ let nativeSample = null;
52512
+ try {
52513
+ nativeSample = this.sampleNativeTranscriptProgress();
52514
+ } catch {
52515
+ nativeSample = null;
52516
+ }
52517
+ const sourceMtimeMs = nativeSample?.sourceMtimeMs ?? 0;
52518
+ if (nativeSample && sourceMtimeMs > 0 && Date.now() - sourceMtimeMs < MISSING_ASSISTANT_TRANSCRIPT_GROWTH_QUIET_MS) {
52519
+ if (pending.loggedBlockReason !== "native_transcript_advancing") {
52520
+ LOG.info("CLI", `[${this.type}] holding pending completed (native_transcript_advancing: msgCount=${nativeSample.msgCount} mtimeAge=${Date.now() - sourceMtimeMs}ms < ${MISSING_ASSISTANT_TRANSCRIPT_GROWTH_QUIET_MS}ms) \u2014 transcript still growing, screen-idle verdict not trusted`);
52521
+ if (this.isMeshWorkerSession()) {
52522
+ traceMeshEventDrop("completion_gate_hold", this.meshTraceCtx(), `native_transcript_advancing msgCount=${nativeSample.msgCount} mtimeAge=${Date.now() - sourceMtimeMs}ms`);
52523
+ }
52524
+ if (this.completionTraceOn()) this.recordCompletionGateTrace("hold", {
52525
+ blockReason: "native_transcript_advancing",
52526
+ latestVisibleStatus,
52527
+ msgCount: nativeSample.msgCount,
52528
+ sourceMtimeAgeMs: Date.now() - sourceMtimeMs,
52529
+ growthQuietMs: MISSING_ASSISTANT_TRANSCRIPT_GROWTH_QUIET_MS,
52530
+ waitedMs
52531
+ });
52532
+ pending.loggedBlockReason = "native_transcript_advancing";
52533
+ }
52534
+ this.scheduleCompletedDebounceFlush(COMPLETED_FINALIZATION_RETRY_MS);
52535
+ return;
52536
+ }
52537
+ }
52485
52538
  if (!isTranscriptEvidenceGate && (block2.terminal || waitedMs < COMPLETED_FINALIZATION_MAX_WAIT_MS)) {
52486
52539
  if (pending.loggedBlockReason !== blockReason) {
52487
52540
  LOG.info("CLI", `[${this.type}] waiting to emit completed until transcript finalizes (${blockReason})`);
@@ -61686,6 +61739,10 @@ var meshCrudHandlers = {
61686
61739
  ...capabilities && capabilities.length ? { capabilities } : {}
61687
61740
  });
61688
61741
  if (!node) return { success: false, error: "Mesh not found" };
61742
+ const cachedMesh = ctx.getCachedInlineMesh(meshId);
61743
+ if (cachedMesh) {
61744
+ ctx.updateInlineMeshNode(meshId, cachedMesh, node);
61745
+ }
61689
61746
  ctx.invalidateAggregateMeshStatus(meshId);
61690
61747
  return { success: true, node };
61691
61748
  } catch (e) {
@@ -61906,6 +61963,10 @@ var meshCrudHandlers = {
61906
61963
  removed = removeNode2(meshId, nodeId);
61907
61964
  if (!removed && !node) removed = true;
61908
61965
  if (removed) ctx.invalidateAggregateMeshStatus(meshId);
61966
+ if (removed) {
61967
+ const cachedMesh = ctx.getCachedInlineMesh(meshId);
61968
+ if (cachedMesh) ctx.removeInlineMeshNode(meshId, cachedMesh, nodeId);
61969
+ }
61909
61970
  }
61910
61971
  if (removed) {
61911
61972
  try {