@adhdev/daemon-core 0.9.82-rc.295 → 0.9.82-rc.297

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
@@ -270,10 +270,10 @@ function readInjected(value) {
270
270
  }
271
271
  function getDaemonBuildInfo() {
272
272
  if (cached) return cached;
273
- const commit = readInjected(true ? "dc26917ced80beb84689897738b6edb82208c146" : void 0) ?? "unknown";
274
- const commitShort = readInjected(true ? "dc26917c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
275
- const version = readInjected(true ? "0.9.82-rc.295" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
276
- const builtAt = readInjected(true ? "2026-06-16T13:44:28.663Z" : void 0);
273
+ const commit = readInjected(true ? "5f22e3d153ae396b06c67b4eb88a98c7461a28d8" : void 0) ?? "unknown";
274
+ const commitShort = readInjected(true ? "5f22e3d1" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
275
+ const version = readInjected(true ? "0.9.82-rc.297" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
276
+ const builtAt = readInjected(true ? "2026-06-16T16:23:46.913Z" : void 0);
277
277
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
278
278
  return cached;
279
279
  }
@@ -15481,7 +15481,8 @@ function buildClaudeInteractiveTuiAnswerSteps(prompt, response) {
15481
15481
  const answer = response.answers[question.questionId];
15482
15482
  if (!answer) throw new Error(`Missing answer for ${question.questionId}`);
15483
15483
  const freeformText = answer.freeformText?.trim() ?? "";
15484
- if (question.multiSelect) {
15484
+ const treatAsMultiSelect = question.multiSelect || answer.selectedLabels.length > 1;
15485
+ if (treatAsMultiSelect) {
15485
15486
  const labels = answer.selectedLabels;
15486
15487
  if (labels.length === 0) {
15487
15488
  throw new Error(`Expected at least one selected label for ${question.questionId}`);
@@ -15490,9 +15491,8 @@ function buildClaudeInteractiveTuiAnswerSteps(prompt, response) {
15490
15491
  const selectedIndex = question.options.findIndex((option) => option.label === label);
15491
15492
  if (selectedIndex < 0) throw new Error(`Unknown option for ${question.questionId}: ${label}`);
15492
15493
  steps.push(String(selectedIndex + 1));
15493
- steps.push(" ");
15494
15494
  }
15495
- steps.push("\r");
15495
+ steps.push(" ");
15496
15496
  } else if (freeformText) {
15497
15497
  const typeOptionIndex = question.options.findIndex((o) => /^Type something\.?$/i.test(o.label));
15498
15498
  const optionNumber = typeOptionIndex >= 0 ? typeOptionIndex + 1 : question.options.length;
@@ -31808,6 +31808,15 @@ var SpecCliAdapter = class _SpecCliAdapter {
31808
31808
  * spirit as the approval FSM's `approvalCooldown` modal-lost hysteresis.
31809
31809
  */
31810
31810
  static INTERACTIVE_PROMPT_LOST_GRACE_MS = 1500;
31811
+ /**
31812
+ * Multi-question TUI capture: after Tabbing to a page, re-snapshot at this
31813
+ * interval until its checkbox glyph column has settled, up to the timeout.
31814
+ * The interval matches the legacy single fixed wait (120ms); the timeout
31815
+ * bounds total capture time so a single-select page (which never shows
31816
+ * glyphs) doesn't stall the capture indefinitely.
31817
+ */
31818
+ static CLAUDE_TUI_PAGE_POLL_INTERVAL_MS = 120;
31819
+ static CLAUDE_TUI_PAGE_SETTLE_TIMEOUT_MS = 600;
31811
31820
  /**
31812
31821
  * Clear a held interactive prompt once the user has resolved it directly
31813
31822
  * in the terminal (the choice picker leaves the screen without going
@@ -31920,16 +31929,43 @@ var SpecCliAdapter = class _SpecCliAdapter {
31920
31929
  }
31921
31930
  return headers;
31922
31931
  }
31932
+ /**
31933
+ * Snapshot the currently-focused claude TUI page, polling until its
31934
+ * option-row checkbox glyph column has settled (or a bounded timeout).
31935
+ *
31936
+ * Why poll: right after a Tab keypress the newly-focused page's glyph
31937
+ * column has not redrawn yet, so an immediate snapshot shows the question +
31938
+ * option labels but NO per-option checkbox markers — freezing that page as
31939
+ * single-select. A fixed delay either races (too short) or is wasteful (too
31940
+ * long). Instead we re-snapshot at a fixed interval and stop as soon as the
31941
+ * frame shows multi-select glyphs, falling back to the last frame at the
31942
+ * timeout. Single-select pages never show glyphs, so they always poll to the
31943
+ * timeout — bounded small to keep capture snappy.
31944
+ */
31945
+ async snapshotSettledClaudeTuiPage() {
31946
+ let screenText = this.driver.snapshot();
31947
+ const deadline = Date.now() + _SpecCliAdapter.CLAUDE_TUI_PAGE_SETTLE_TIMEOUT_MS;
31948
+ while (!detectClaudeTuiMultiSelect(screenText) && Date.now() < deadline) {
31949
+ await new Promise((resolve24) => setTimeout(resolve24, _SpecCliAdapter.CLAUDE_TUI_PAGE_POLL_INTERVAL_MS));
31950
+ screenText = this.driver.snapshot();
31951
+ }
31952
+ return screenText;
31953
+ }
31923
31954
  async captureClaudeTuiPrompt(firstScreen, headers) {
31924
31955
  const pages = [{ screenText: firstScreen, header: headers[0] }];
31925
31956
  for (let index = 1; index < headers.length; index += 1) {
31926
31957
  this.driver.dispatch({ kind: "pty_write", data: " " });
31927
- await new Promise((resolve24) => setTimeout(resolve24, 120));
31928
- pages.push({ screenText: this.driver.snapshot(), header: headers[index] });
31958
+ await new Promise((resolve24) => setTimeout(resolve24, _SpecCliAdapter.CLAUDE_TUI_PAGE_POLL_INTERVAL_MS));
31959
+ pages.push({ screenText: await this.snapshotSettledClaudeTuiPage(), header: headers[index] });
31929
31960
  }
31930
31961
  for (let index = headers.length - 1; index > 0; index -= 1) {
31931
31962
  this.driver.dispatch({ kind: "pty_write", data: "\x1B[Z" });
31932
- await new Promise((resolve24) => setTimeout(resolve24, 80));
31963
+ await new Promise((resolve24) => setTimeout(resolve24, _SpecCliAdapter.CLAUDE_TUI_PAGE_POLL_INTERVAL_MS));
31964
+ const reread = await this.snapshotSettledClaudeTuiPage();
31965
+ const landed = pages[index - 1];
31966
+ if (landed && !detectClaudeTuiMultiSelect(landed.screenText) && detectClaudeTuiMultiSelect(reread)) {
31967
+ landed.screenText = reread;
31968
+ }
31933
31969
  }
31934
31970
  const prompt = detectClaudeAskUserQuestionPromptFromTuiPages(pages, {
31935
31971
  promptId: `ask-user-${this.providerSessionId || "claude"}-${Date.now()}`,