@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.js CHANGED
@@ -275,10 +275,10 @@ function readInjected(value) {
275
275
  }
276
276
  function getDaemonBuildInfo() {
277
277
  if (cached) return cached;
278
- const commit = readInjected(true ? "dc26917ced80beb84689897738b6edb82208c146" : void 0) ?? "unknown";
279
- const commitShort = readInjected(true ? "dc26917c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
280
- const version = readInjected(true ? "0.9.82-rc.295" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
281
- const builtAt = readInjected(true ? "2026-06-16T13:44:28.663Z" : void 0);
278
+ const commit = readInjected(true ? "5f22e3d153ae396b06c67b4eb88a98c7461a28d8" : void 0) ?? "unknown";
279
+ const commitShort = readInjected(true ? "5f22e3d1" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
280
+ const version = readInjected(true ? "0.9.82-rc.297" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
281
+ const builtAt = readInjected(true ? "2026-06-16T16:23:46.913Z" : void 0);
282
282
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
283
283
  return cached;
284
284
  }
@@ -15822,7 +15822,8 @@ function buildClaudeInteractiveTuiAnswerSteps(prompt, response) {
15822
15822
  const answer = response.answers[question.questionId];
15823
15823
  if (!answer) throw new Error(`Missing answer for ${question.questionId}`);
15824
15824
  const freeformText = answer.freeformText?.trim() ?? "";
15825
- if (question.multiSelect) {
15825
+ const treatAsMultiSelect = question.multiSelect || answer.selectedLabels.length > 1;
15826
+ if (treatAsMultiSelect) {
15826
15827
  const labels = answer.selectedLabels;
15827
15828
  if (labels.length === 0) {
15828
15829
  throw new Error(`Expected at least one selected label for ${question.questionId}`);
@@ -15831,9 +15832,8 @@ function buildClaudeInteractiveTuiAnswerSteps(prompt, response) {
15831
15832
  const selectedIndex = question.options.findIndex((option) => option.label === label);
15832
15833
  if (selectedIndex < 0) throw new Error(`Unknown option for ${question.questionId}: ${label}`);
15833
15834
  steps.push(String(selectedIndex + 1));
15834
- steps.push(" ");
15835
15835
  }
15836
- steps.push("\r");
15836
+ steps.push(" ");
15837
15837
  } else if (freeformText) {
15838
15838
  const typeOptionIndex = question.options.findIndex((o) => /^Type something\.?$/i.test(o.label));
15839
15839
  const optionNumber = typeOptionIndex >= 0 ? typeOptionIndex + 1 : question.options.length;
@@ -32149,6 +32149,15 @@ var SpecCliAdapter = class _SpecCliAdapter {
32149
32149
  * spirit as the approval FSM's `approvalCooldown` modal-lost hysteresis.
32150
32150
  */
32151
32151
  static INTERACTIVE_PROMPT_LOST_GRACE_MS = 1500;
32152
+ /**
32153
+ * Multi-question TUI capture: after Tabbing to a page, re-snapshot at this
32154
+ * interval until its checkbox glyph column has settled, up to the timeout.
32155
+ * The interval matches the legacy single fixed wait (120ms); the timeout
32156
+ * bounds total capture time so a single-select page (which never shows
32157
+ * glyphs) doesn't stall the capture indefinitely.
32158
+ */
32159
+ static CLAUDE_TUI_PAGE_POLL_INTERVAL_MS = 120;
32160
+ static CLAUDE_TUI_PAGE_SETTLE_TIMEOUT_MS = 600;
32152
32161
  /**
32153
32162
  * Clear a held interactive prompt once the user has resolved it directly
32154
32163
  * in the terminal (the choice picker leaves the screen without going
@@ -32261,16 +32270,43 @@ var SpecCliAdapter = class _SpecCliAdapter {
32261
32270
  }
32262
32271
  return headers;
32263
32272
  }
32273
+ /**
32274
+ * Snapshot the currently-focused claude TUI page, polling until its
32275
+ * option-row checkbox glyph column has settled (or a bounded timeout).
32276
+ *
32277
+ * Why poll: right after a Tab keypress the newly-focused page's glyph
32278
+ * column has not redrawn yet, so an immediate snapshot shows the question +
32279
+ * option labels but NO per-option checkbox markers — freezing that page as
32280
+ * single-select. A fixed delay either races (too short) or is wasteful (too
32281
+ * long). Instead we re-snapshot at a fixed interval and stop as soon as the
32282
+ * frame shows multi-select glyphs, falling back to the last frame at the
32283
+ * timeout. Single-select pages never show glyphs, so they always poll to the
32284
+ * timeout — bounded small to keep capture snappy.
32285
+ */
32286
+ async snapshotSettledClaudeTuiPage() {
32287
+ let screenText = this.driver.snapshot();
32288
+ const deadline = Date.now() + _SpecCliAdapter.CLAUDE_TUI_PAGE_SETTLE_TIMEOUT_MS;
32289
+ while (!detectClaudeTuiMultiSelect(screenText) && Date.now() < deadline) {
32290
+ await new Promise((resolve24) => setTimeout(resolve24, _SpecCliAdapter.CLAUDE_TUI_PAGE_POLL_INTERVAL_MS));
32291
+ screenText = this.driver.snapshot();
32292
+ }
32293
+ return screenText;
32294
+ }
32264
32295
  async captureClaudeTuiPrompt(firstScreen, headers) {
32265
32296
  const pages = [{ screenText: firstScreen, header: headers[0] }];
32266
32297
  for (let index = 1; index < headers.length; index += 1) {
32267
32298
  this.driver.dispatch({ kind: "pty_write", data: " " });
32268
- await new Promise((resolve24) => setTimeout(resolve24, 120));
32269
- pages.push({ screenText: this.driver.snapshot(), header: headers[index] });
32299
+ await new Promise((resolve24) => setTimeout(resolve24, _SpecCliAdapter.CLAUDE_TUI_PAGE_POLL_INTERVAL_MS));
32300
+ pages.push({ screenText: await this.snapshotSettledClaudeTuiPage(), header: headers[index] });
32270
32301
  }
32271
32302
  for (let index = headers.length - 1; index > 0; index -= 1) {
32272
32303
  this.driver.dispatch({ kind: "pty_write", data: "\x1B[Z" });
32273
- await new Promise((resolve24) => setTimeout(resolve24, 80));
32304
+ await new Promise((resolve24) => setTimeout(resolve24, _SpecCliAdapter.CLAUDE_TUI_PAGE_POLL_INTERVAL_MS));
32305
+ const reread = await this.snapshotSettledClaudeTuiPage();
32306
+ const landed = pages[index - 1];
32307
+ if (landed && !detectClaudeTuiMultiSelect(landed.screenText) && detectClaudeTuiMultiSelect(reread)) {
32308
+ landed.screenText = reread;
32309
+ }
32274
32310
  }
32275
32311
  const prompt = detectClaudeAskUserQuestionPromptFromTuiPages(pages, {
32276
32312
  promptId: `ask-user-${this.providerSessionId || "claude"}-${Date.now()}`,