@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.mjs CHANGED
@@ -786,10 +786,10 @@ function readInjected(value) {
786
786
  }
787
787
  function getDaemonBuildInfo() {
788
788
  if (cached) return cached;
789
- const commit = readInjected(true ? "cb5f0a4f64296587a261176e08731f2f3ed78766" : void 0) ?? "unknown";
790
- const commitShort = readInjected(true ? "cb5f0a4f" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
791
- const version = readInjected(true ? "1.0.28-rc.8" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
792
- const builtAt = readInjected(true ? "2026-07-25T12:20:55.839Z" : void 0);
789
+ const commit = readInjected(true ? "46fd4bbf8982e8d4d2d2d8c46d35631780c8b0f5" : void 0) ?? "unknown";
790
+ const commitShort = readInjected(true ? "46fd4bbf" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
791
+ const version = readInjected(true ? "1.0.28-rc.9" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
792
+ const builtAt = readInjected(true ? "2026-07-25T16:06:51.065Z" : void 0);
793
793
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
794
794
  return cached;
795
795
  }
@@ -25688,6 +25688,17 @@ async function runMeshReconcileTick(components) {
25688
25688
  LOG.warn("MeshReconcile", `Unresolved-delegate forward retry failed: ${e?.message || e}`);
25689
25689
  }
25690
25690
  }
25691
+ if (components.router) {
25692
+ for (const mesh of listMeshes()) {
25693
+ try {
25694
+ if (components.router.getCachedInlineMesh(mesh.id)) {
25695
+ components.router.getCachedInlineMesh(mesh.id, mesh);
25696
+ }
25697
+ } catch (e) {
25698
+ LOG.warn("MeshReconcile", `Inline-cache membership merge failed for mesh ${mesh.id}: ${e?.message || e}`);
25699
+ }
25700
+ }
25701
+ }
25691
25702
  if (dispatchMeshCommand) {
25692
25703
  for (const mesh of listMeshes()) {
25693
25704
  const selfIds = resolveCoordinatorSelfIds(mesh, drainDaemonIds);
@@ -27340,7 +27351,7 @@ function resolveSections(sectionsObj, lines) {
27340
27351
  if (candIdx !== -1 && (idx === -1 || candIdx < idx)) idx = candIdx;
27341
27352
  }
27342
27353
  if (idx !== -1) {
27343
- from = idx;
27354
+ from = typeof sec.above === "number" && sec.above > 0 ? Math.max(0, idx - Math.floor(sec.above)) : idx;
27344
27355
  to = total;
27345
27356
  if (sec.until_regex !== void 0) {
27346
27357
  try {
@@ -27352,6 +27363,9 @@ function resolveSections(sectionsObj, lines) {
27352
27363
  } else if (sec.lines !== void 0) {
27353
27364
  to = Math.min(total, from + sec.lines);
27354
27365
  }
27366
+ } else if (sec.anchor_miss === "empty") {
27367
+ from = 0;
27368
+ to = 0;
27355
27369
  }
27356
27370
  } catch {
27357
27371
  }
@@ -46562,9 +46576,13 @@ var FsmDriver = class {
46562
46576
  curLines = currentLines;
46563
46577
  prevLines = this.prevScreenLines;
46564
46578
  } else {
46565
- const start = Math.max(0, cursor.row - d.cursor_above);
46566
- curLines = currentLines.slice(start, cursor.row);
46567
- prevLines = this.prevScreenLines.slice(start, cursor.row);
46579
+ const window = stableCursorWindow(currentLines.length, cursor.row, d.cursor_above);
46580
+ if (!window) {
46581
+ this.regionLastChangedAt.set(d.key, now);
46582
+ continue;
46583
+ }
46584
+ curLines = currentLines.slice(window.start, window.end);
46585
+ prevLines = this.prevScreenLines.slice(window.start, window.end);
46568
46586
  }
46569
46587
  const cur = filterIgnoredLines(curLines, d.ignoreRe).join("\n");
46570
46588
  const prev = filterIgnoredLines(prevLines, d.ignoreRe).join("\n");
@@ -47157,6 +47175,12 @@ function filterIgnoredLines(lines, ignoreRe) {
47157
47175
  if (!ignoreRe) return lines;
47158
47176
  return lines.filter((l) => !ignoreRe.test(l));
47159
47177
  }
47178
+ function stableCursorWindow(lineCount, cursorRow, cursorAbove) {
47179
+ const end = Math.min(Math.max(0, cursorRow), Math.max(0, lineCount));
47180
+ const start = Math.max(0, end - cursorAbove);
47181
+ if (end <= start) return null;
47182
+ return { start, end };
47183
+ }
47160
47184
 
47161
47185
  // src/providers/spec/cli-adapter.ts
47162
47186
  init_evaluator();
@@ -49726,6 +49750,7 @@ var STATUS_HYDRATION_TAIL_LIMIT = 200;
49726
49750
  var COMPLETED_FINALIZATION_RETRY_MS = 1e3;
49727
49751
  var COMPLETED_FINALIZATION_MAX_WAIT_MS = 3e4;
49728
49752
  var CANON_C_MISSING_ASSISTANT_MIN_ELAPSED_MS = 2e4;
49753
+ var MISSING_ASSISTANT_TRANSCRIPT_GROWTH_QUIET_MS = 6e4;
49729
49754
  var NATIVE_HISTORY_MESH_IDLE_SETTLE_MS = 4e3;
49730
49755
  var PTY_PARSED_FINAL_ASSISTANT_QUIET_DWELL_MS = 1200;
49731
49756
  var ANTIGRAVITY_HOLD_QUIET_DWELL_MS = 3e3;
@@ -52040,6 +52065,34 @@ var CliProviderInstance = class _CliProviderInstance {
52040
52065
  const waitedMs = Date.now() - pending.firstObservedAt;
52041
52066
  const isTranscriptEvidenceGate = block2.allowTimeout === true;
52042
52067
  LOG.debug("CLI", `[${this.type}] finalization block: reason=${blockReason} terminal=${block2.terminal} allowTimeout=${isTranscriptEvidenceGate} waitedMs=${waitedMs} maxWait=${COMPLETED_FINALIZATION_MAX_WAIT_MS}`);
52068
+ if (blockReason === "missing_final_assistant" && block2.noExternalTranscriptSource === true) {
52069
+ let nativeSample = null;
52070
+ try {
52071
+ nativeSample = this.sampleNativeTranscriptProgress();
52072
+ } catch {
52073
+ nativeSample = null;
52074
+ }
52075
+ const sourceMtimeMs = nativeSample?.sourceMtimeMs ?? 0;
52076
+ if (nativeSample && sourceMtimeMs > 0 && Date.now() - sourceMtimeMs < MISSING_ASSISTANT_TRANSCRIPT_GROWTH_QUIET_MS) {
52077
+ if (pending.loggedBlockReason !== "native_transcript_advancing") {
52078
+ 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`);
52079
+ if (this.isMeshWorkerSession()) {
52080
+ traceMeshEventDrop("completion_gate_hold", this.meshTraceCtx(), `native_transcript_advancing msgCount=${nativeSample.msgCount} mtimeAge=${Date.now() - sourceMtimeMs}ms`);
52081
+ }
52082
+ if (this.completionTraceOn()) this.recordCompletionGateTrace("hold", {
52083
+ blockReason: "native_transcript_advancing",
52084
+ latestVisibleStatus,
52085
+ msgCount: nativeSample.msgCount,
52086
+ sourceMtimeAgeMs: Date.now() - sourceMtimeMs,
52087
+ growthQuietMs: MISSING_ASSISTANT_TRANSCRIPT_GROWTH_QUIET_MS,
52088
+ waitedMs
52089
+ });
52090
+ pending.loggedBlockReason = "native_transcript_advancing";
52091
+ }
52092
+ this.scheduleCompletedDebounceFlush(COMPLETED_FINALIZATION_RETRY_MS);
52093
+ return;
52094
+ }
52095
+ }
52043
52096
  if (!isTranscriptEvidenceGate && (block2.terminal || waitedMs < COMPLETED_FINALIZATION_MAX_WAIT_MS)) {
52044
52097
  if (pending.loggedBlockReason !== blockReason) {
52045
52098
  LOG.info("CLI", `[${this.type}] waiting to emit completed until transcript finalizes (${blockReason})`);
@@ -61249,6 +61302,10 @@ var meshCrudHandlers = {
61249
61302
  ...capabilities && capabilities.length ? { capabilities } : {}
61250
61303
  });
61251
61304
  if (!node) return { success: false, error: "Mesh not found" };
61305
+ const cachedMesh = ctx.getCachedInlineMesh(meshId);
61306
+ if (cachedMesh) {
61307
+ ctx.updateInlineMeshNode(meshId, cachedMesh, node);
61308
+ }
61252
61309
  ctx.invalidateAggregateMeshStatus(meshId);
61253
61310
  return { success: true, node };
61254
61311
  } catch (e) {
@@ -61469,6 +61526,10 @@ var meshCrudHandlers = {
61469
61526
  removed = removeNode2(meshId, nodeId);
61470
61527
  if (!removed && !node) removed = true;
61471
61528
  if (removed) ctx.invalidateAggregateMeshStatus(meshId);
61529
+ if (removed) {
61530
+ const cachedMesh = ctx.getCachedInlineMesh(meshId);
61531
+ if (cachedMesh) ctx.removeInlineMeshNode(meshId, cachedMesh, nodeId);
61532
+ }
61472
61533
  }
61473
61534
  if (removed) {
61474
61535
  try {