@adhdev/daemon-core 0.9.82-rc.357 → 0.9.82-rc.358

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
@@ -316,10 +316,10 @@ function readInjected(value) {
316
316
  }
317
317
  function getDaemonBuildInfo() {
318
318
  if (cached) return cached;
319
- const commit = readInjected(true ? "37b9d1d9e10336707dbc0861a96d5bcc55cc015e" : void 0) ?? "unknown";
320
- const commitShort = readInjected(true ? "37b9d1d9" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
- const version = readInjected(true ? "0.9.82-rc.357" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
- const builtAt = readInjected(true ? "2026-06-23T00:25:21.599Z" : void 0);
319
+ const commit = readInjected(true ? "7210e80591d8d9ab378ee786ffb233027437461a" : void 0) ?? "unknown";
320
+ const commitShort = readInjected(true ? "7210e805" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
+ const version = readInjected(true ? "0.9.82-rc.358" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
+ const builtAt = readInjected(true ? "2026-06-23T01:40:53.249Z" : void 0);
323
323
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
324
324
  return cached;
325
325
  }
@@ -13751,7 +13751,7 @@ function injectMeshSystemMessage(components, args) {
13751
13751
  occurredAt: occurredAtMs != null ? new Date(occurredAtMs).toISOString() : void 0,
13752
13752
  taskId: eventTaskId
13753
13753
  });
13754
- const leaveDirectDispatchActive = !task && opts?.tentativeIfDirect === true;
13754
+ const leaveDirectDispatchActive = !task && opts?.tentativeIfDirect === true || !eventTaskId && !sessionHasActiveAssignment(args.meshId, sessionId);
13755
13755
  if (!leaveDirectDispatchActive) {
13756
13756
  updateDirectDispatchStatus(args.meshId, sessionId, outcome, eventTaskId);
13757
13757
  }
@@ -13850,7 +13850,9 @@ function injectMeshSystemMessage(components, args) {
13850
13850
  }
13851
13851
  if (sessionId) {
13852
13852
  const startedTaskId = readNonEmptyString2(args.metadataEvent.taskId) || void 0;
13853
- updateDirectDispatchStatus(args.meshId, sessionId, "acked", startedTaskId);
13853
+ if (startedTaskId || sessionHasActiveAssignment(args.meshId, sessionId)) {
13854
+ updateDirectDispatchStatus(args.meshId, sessionId, "acked", startedTaskId);
13855
+ }
13854
13856
  const activeDeliveries = (() => {
13855
13857
  try {
13856
13858
  return MeshRuntimeStore.getInstance().getActiveSessionDeliveries(args.meshId, sessionId);
@@ -19540,6 +19542,7 @@ __export(evaluator_exports, {
19540
19542
  evaluateCondition: () => evaluateCondition,
19541
19543
  extractButtonsFromRule: () => extractButtonsFromRule,
19542
19544
  extractTitle: () => extractTitle,
19545
+ lastContiguousNumberedBlock: () => lastContiguousNumberedBlock,
19543
19546
  resolveSections: () => resolveSections,
19544
19547
  sectionText: () => sectionText
19545
19548
  });
@@ -19780,7 +19783,6 @@ function extractButtonsFromRule(rule, hay) {
19780
19783
  label += " " + next.trim();
19781
19784
  j += 1;
19782
19785
  }
19783
- if (buttons.some((b) => b.index === idx)) continue;
19784
19786
  const key = keyTemplate.replace(/\{index\}/g, String(idx));
19785
19787
  buttons.push({ index: idx, label, key, current });
19786
19788
  i = j - 1;
@@ -19792,13 +19794,22 @@ function extractButtonsFromRule(rule, hay) {
19792
19794
  const idx = Number(m[1]);
19793
19795
  const label = String(m[2] ?? "").trim();
19794
19796
  if (!Number.isFinite(idx) || idx <= 0 || !label) continue;
19795
- if (buttons.some((b) => b.index === idx)) continue;
19796
19797
  const key = keyTemplate.replace(/\{index\}/g, String(idx));
19797
19798
  buttons.push({ index: idx, label, key, current: hasCursorMarker(m[0]) });
19798
19799
  }
19799
19800
  }
19800
- buttons.sort((a, b) => a.index - b.index);
19801
- return buttons;
19801
+ const block2 = lastContiguousNumberedBlock(buttons);
19802
+ block2.sort((a, b) => a.index - b.index);
19803
+ return block2;
19804
+ }
19805
+ function lastContiguousNumberedBlock(entries) {
19806
+ if (entries.length <= 1) return entries.slice();
19807
+ let start = entries.length - 1;
19808
+ for (let i = entries.length - 1; i > 0; i -= 1) {
19809
+ if (entries[i - 1].index === entries[i].index - 1) start = i - 1;
19810
+ else break;
19811
+ }
19812
+ return entries.slice(start);
19802
19813
  }
19803
19814
  function hasCursorMarker(text) {
19804
19815
  return /^\s*[❯›>]/.test(text);
@@ -34216,6 +34227,9 @@ function collectStableSizes(when, sizes) {
34216
34227
  }
34217
34228
  }
34218
34229
 
34230
+ // src/providers/spec/cli-adapter.ts
34231
+ init_evaluator();
34232
+
34219
34233
  // src/providers/spec/native-history-executor.ts
34220
34234
  var fs13 = __toESM(require("fs"));
34221
34235
  var os18 = __toESM(require("os"));
@@ -35430,21 +35444,19 @@ var SpecCliAdapter = class _SpecCliAdapter {
35430
35444
  const ec = action.extract_choices;
35431
35445
  if (!ec?.pattern) return [];
35432
35446
  const text = this.readScreenSectionText(ec.section);
35433
- const out = [];
35434
- const seen = /* @__PURE__ */ new Set();
35447
+ const all = [];
35435
35448
  for (const rawLine of text.split("\n")) {
35436
35449
  const line = rawLine.replace(/\r$/, "");
35437
35450
  const m = new RegExp(ec.pattern, ec.flags ?? "").exec(line);
35438
35451
  if (!m) continue;
35439
35452
  const idx = Number(m[1]);
35440
- if (!Number.isFinite(idx) || seen.has(idx)) continue;
35453
+ if (!Number.isFinite(idx) || idx <= 0) continue;
35441
35454
  const label = (m[2] ?? "").replace(/\s+/g, " ").trim();
35442
35455
  if (!label) continue;
35443
35456
  const current = /^\s*[❯›>]/.test(line) || /[✔✓●]\s*$/.test(label);
35444
- seen.add(idx);
35445
- out.push({ index: idx, label, current });
35457
+ all.push({ index: idx, label, current });
35446
35458
  }
35447
- return out;
35459
+ return lastContiguousNumberedBlock(all);
35448
35460
  }
35449
35461
  /** Live text of a named screen section (or the whole screen when no
35450
35462
  * section is named), resolved from the driver's current sections. */