@adhdev/daemon-standalone 1.0.58-rc.58 → 1.0.58-rc.59

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
@@ -36911,10 +36911,10 @@ var require_dist3 = __commonJS({
36911
36911
  }
36912
36912
  function getDaemonBuildInfo() {
36913
36913
  if (cached2) return cached2;
36914
- const commit = readInjected(true ? "53c86b267804d92042ea66029ca5182680eb7b9c" : void 0) ?? "unknown";
36915
- const commitShort = readInjected(true ? "53c86b26" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36916
- const version2 = readInjected(true ? "1.0.58-rc.58" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36917
- const builtAt = readInjected(true ? "2026-09-01T12:37:49.617Z" : void 0);
36914
+ const commit = readInjected(true ? "6393920b37c3af6cd2678d0e12a58d0eaa9a138f" : void 0) ?? "unknown";
36915
+ const commitShort = readInjected(true ? "6393920b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36916
+ const version2 = readInjected(true ? "1.0.58-rc.59" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36917
+ const builtAt = readInjected(true ? "2026-09-01T13:20:53.426Z" : void 0);
36918
36918
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
36919
36919
  return cached2;
36920
36920
  }
@@ -101926,8 +101926,58 @@ ${e?.stderr || ""}`;
101926
101926
  }
101927
101927
  var CLAUDE_TUI_OPTION_CHECKBOX = "(?:\\[[ xX]\\]|[\u2610\u2612\u25FB\u25FC])";
101928
101928
  var CLAUDE_TUI_OPTION_PATTERN = new RegExp(
101929
- `^\\s*(?:[\u276F\u203A>]\\s*)?(?:${CLAUDE_TUI_OPTION_CHECKBOX}\\s*)?(\\d+)\\.\\s+(?:${CLAUDE_TUI_OPTION_CHECKBOX}\\s*)?(.+?)\\s*$`
101929
+ `^\\s*(?:[\u276F\u203A>\u2750]\\s*)?(?:${CLAUDE_TUI_OPTION_CHECKBOX}\\s*)?(\\d+)\\.\\s+(?:${CLAUDE_TUI_OPTION_CHECKBOX}\\s*)?(.+?)\\s*$`
101930
101930
  );
101931
+ function readClaudeTuiScreenLines(screenText) {
101932
+ return screenText.split(/\r?\n/).map((raw) => {
101933
+ const panel = raw.match(/(\s+)[│┃].*$/);
101934
+ return {
101935
+ // Keep the rc.58 preview-panel removal, but retain whether the main-pane
101936
+ // text reached the panel edge. One padding cell before the divider is the
101937
+ // observable signal that the terminal continued that logical row on the
101938
+ // next physical row; generously accept two for wide-glyph edge padding.
101939
+ text: panel ? raw.slice(0, panel.index ?? raw.length) : raw,
101940
+ wrapsIntoNext: !!panel && panel[1].length <= 2
101941
+ };
101942
+ });
101943
+ }
101944
+ function joinClaudeTuiRows(lines, start, end) {
101945
+ return lines.slice(start, end).map((line) => line.text.trim()).filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
101946
+ }
101947
+ function readClaudeQuestionBeforeOption(lines, firstOptionIndex, lowerBound) {
101948
+ let end = firstOptionIndex;
101949
+ while (end > lowerBound) {
101950
+ const candidate = lines[end - 1].text.trim();
101951
+ if (candidate && !/^─+$/.test(candidate)) break;
101952
+ end -= 1;
101953
+ }
101954
+ let start = end;
101955
+ while (start > lowerBound) {
101956
+ const candidate = lines[start - 1].text.trim();
101957
+ if (!candidate || /^─+$/.test(candidate) || candidate.includes("\u2714 Submit") || CLAUDE_TUI_OPTION_PATTERN.test(lines[start - 1].text)) break;
101958
+ start -= 1;
101959
+ }
101960
+ const question = joinClaudeTuiRows(lines, start, end);
101961
+ return question.replace(/^[☐☒]\s+/, "").trim();
101962
+ }
101963
+ function readClaudeTuiOption(lines, optionLineIndex, optionBlockEnd) {
101964
+ const match = lines[optionLineIndex].text.match(CLAUDE_TUI_OPTION_PATTERN);
101965
+ if (!match) return null;
101966
+ let label = match[2].trim();
101967
+ let continuationEnd = optionLineIndex + 1;
101968
+ while (continuationEnd < optionBlockEnd) {
101969
+ const candidate = lines[continuationEnd].text.trim();
101970
+ if (!candidate || CLAUDE_TUI_OPTION_PATTERN.test(lines[continuationEnd].text) || /^─+$/.test(candidate) || /^Enter to select\b/i.test(candidate)) break;
101971
+ continuationEnd += 1;
101972
+ }
101973
+ let labelEnd = optionLineIndex + 1;
101974
+ while (labelEnd < continuationEnd && lines[labelEnd - 1].wrapsIntoNext) labelEnd += 1;
101975
+ if (labelEnd > optionLineIndex + 1) {
101976
+ label = `${label} ${joinClaudeTuiRows(lines, optionLineIndex + 1, labelEnd)}`.replace(/\s+/g, " ").trim();
101977
+ }
101978
+ const description = joinClaudeTuiRows(lines, labelEnd, continuationEnd) || void 0;
101979
+ return { label, ...description ? { description } : {} };
101980
+ }
101931
101981
  function claudeTuiQuestionHeaders(screenText) {
101932
101982
  const navLine = screenText.split(/\r?\n/).find((line) => line.includes("\u2714 Submit") && /[☐☒]/.test(line));
101933
101983
  if (!navLine) return [];
@@ -101965,20 +102015,12 @@ ${e?.stderr || ""}`;
101965
102015
  }
101966
102016
  return void 0;
101967
102017
  }
101968
- function readClaudeOptionDescription(lines, optionLineIndex) {
101969
- const nextLine = lines[optionLineIndex + 1];
101970
- const next = nextLine?.trim();
101971
- if (!next || CLAUDE_TUI_OPTION_PATTERN.test(nextLine) || /^─+$/.test(next) || /^Enter to select\b/i.test(next) || /^[☐☒]\s+/.test(next)) {
101972
- return void 0;
101973
- }
101974
- return next;
101975
- }
101976
102018
  function parseClaudeHeaderlessInteractiveTuiQuestion(page, index) {
101977
102019
  if (!isClaudeTuiSelectFooter(page.screenText)) return null;
101978
- const lines = page.screenText.split(/\r?\n/).map((line) => line.replace(/\s+[│┃].*$/, ""));
102020
+ const lines = readClaudeTuiScreenLines(page.screenText);
101979
102021
  let footerIndex = -1;
101980
102022
  for (let i = lines.length - 1; i >= 0; i -= 1) {
101981
- if (/Enter to select/i.test(lines[i])) {
102023
+ if (/Enter to select/i.test(lines[i].text)) {
101982
102024
  footerIndex = i;
101983
102025
  break;
101984
102026
  }
@@ -101986,14 +102028,14 @@ ${e?.stderr || ""}`;
101986
102028
  if (footerIndex < 0) return null;
101987
102029
  let optionBlockEnd = footerIndex - 1;
101988
102030
  for (let i = footerIndex - 1; i >= 0; i -= 1) {
101989
- if (/^─+$/.test(lines[i].trim())) {
102031
+ if (/^─+$/.test(lines[i].text.trim())) {
101990
102032
  optionBlockEnd = i - 1;
101991
102033
  break;
101992
102034
  }
101993
102035
  }
101994
102036
  const optionLineIndexes = [];
101995
102037
  for (let i = optionBlockEnd; i >= 0; i -= 1) {
101996
- const line = lines[i];
102038
+ const line = lines[i].text;
101997
102039
  if (CLAUDE_TUI_OPTION_PATTERN.test(line)) {
101998
102040
  optionLineIndexes.push(i);
101999
102041
  continue;
@@ -102003,33 +102045,20 @@ ${e?.stderr || ""}`;
102003
102045
  optionLineIndexes.reverse();
102004
102046
  if (optionLineIndexes.length === 0) return null;
102005
102047
  const firstOptionIndex = optionLineIndexes[0];
102006
- let question = "";
102007
- for (let i = firstOptionIndex - 1; i >= 0; i -= 1) {
102008
- const candidate = lines[i].trim();
102009
- if (!candidate || /^─+$/.test(candidate)) continue;
102010
- if (/^[☐☒]\s*$/.test(candidate)) continue;
102011
- const markerMatch = candidate.match(/^[☐☒]\s+(.+)$/);
102012
- if (markerMatch) {
102013
- question = markerMatch[1].trim();
102014
- break;
102015
- }
102016
- question = candidate;
102017
- break;
102018
- }
102048
+ const question = readClaudeQuestionBeforeOption(lines, firstOptionIndex, 0);
102019
102049
  if (!question) return null;
102020
102050
  const options = [];
102021
102051
  let allowFreeform = false;
102022
102052
  for (const optionLineIndex of optionLineIndexes) {
102023
- const match = lines[optionLineIndex].match(CLAUDE_TUI_OPTION_PATTERN);
102024
- if (!match) continue;
102025
- const label = match[2].trim();
102053
+ const option = readClaudeTuiOption(lines, optionLineIndex, optionBlockEnd + 1);
102054
+ if (!option) continue;
102055
+ const { label } = option;
102026
102056
  if (/^Chat about this$/i.test(label)) continue;
102027
102057
  if (/^Type something\.?$/i.test(label)) allowFreeform = true;
102028
- const description = readClaudeOptionDescription(lines, optionLineIndex);
102029
- options.push({ label, ...description ? { description } : {} });
102058
+ options.push(option);
102030
102059
  }
102031
102060
  if (options.length === 0) return null;
102032
- const header = readString(page.header) || readClaudeHeaderLine(lines, firstOptionIndex - 1);
102061
+ const header = readString(page.header) || readClaudeHeaderLine(lines.map((line) => line.text), firstOptionIndex - 1);
102033
102062
  return {
102034
102063
  questionId: `q${index + 1}`,
102035
102064
  question,
@@ -102056,10 +102085,10 @@ ${e?.stderr || ""}`;
102056
102085
  return lines.slice(previousFooterIndex + 1, lastFooterIndex + 1).join("\n");
102057
102086
  }
102058
102087
  function parseClaudeInteractiveTuiQuestion(page, index) {
102059
- const lines = page.screenText.split(/\r?\n/).map((line) => line.replace(/\s+[│┃].*$/, ""));
102088
+ const lines = readClaudeTuiScreenLines(page.screenText);
102060
102089
  let navIndex = -1;
102061
102090
  for (let i = lines.length - 1; i >= 0; i -= 1) {
102062
- if (lines[i].includes("\u2714 Submit") && /[☐☒]/.test(lines[i])) {
102091
+ if (lines[i].text.includes("\u2714 Submit") && /[☐☒]/.test(lines[i].text)) {
102063
102092
  navIndex = i;
102064
102093
  break;
102065
102094
  }
@@ -102067,38 +102096,35 @@ ${e?.stderr || ""}`;
102067
102096
  if (navIndex < 0) return parseClaudeHeaderlessInteractiveTuiQuestion(page, index);
102068
102097
  if (!page.screenText.includes("Enter to select")) return null;
102069
102098
  for (let i = navIndex + 1; i < lines.length; i += 1) {
102070
- const candidate = lines[i].trim();
102099
+ const candidate = lines[i].text.trim();
102071
102100
  if (!candidate || /^─+$/.test(candidate)) continue;
102072
102101
  if (candidate === "Review your answers" || candidate === "Ready to submit your answers?") return null;
102073
- if (CLAUDE_TUI_OPTION_PATTERN.test(lines[i])) break;
102102
+ if (CLAUDE_TUI_OPTION_PATTERN.test(lines[i].text)) break;
102074
102103
  }
102075
- let question = "";
102076
- let questionLineIndex = -1;
102104
+ let firstOptionIndex = -1;
102077
102105
  for (let i = navIndex + 1; i < lines.length; i += 1) {
102078
- const candidate = lines[i].trim();
102079
- if (!candidate || /^─+$/.test(candidate)) continue;
102080
- question = candidate;
102081
- questionLineIndex = i;
102082
- break;
102106
+ if (CLAUDE_TUI_OPTION_PATTERN.test(lines[i].text)) {
102107
+ firstOptionIndex = i;
102108
+ break;
102109
+ }
102083
102110
  }
102111
+ if (firstOptionIndex < 0) return null;
102112
+ const question = readClaudeQuestionBeforeOption(lines, firstOptionIndex, navIndex + 1);
102084
102113
  if (!question) return null;
102085
102114
  const options = [];
102086
102115
  let allowFreeform = false;
102087
- for (let i = questionLineIndex + 1; i < lines.length; i += 1) {
102088
- const match = lines[i].match(CLAUDE_TUI_OPTION_PATTERN);
102116
+ for (let i = firstOptionIndex; i < lines.length; i += 1) {
102117
+ const match = lines[i].text.match(CLAUDE_TUI_OPTION_PATTERN);
102089
102118
  if (!match) continue;
102090
- const label = match[2].trim();
102119
+ const option = readClaudeTuiOption(lines, i, lines.length);
102120
+ if (!option) continue;
102121
+ const { label } = option;
102091
102122
  if (/^Type something\.?$/i.test(label)) {
102092
102123
  allowFreeform = true;
102093
102124
  continue;
102094
102125
  }
102095
102126
  if (/^Chat about this$/i.test(label)) continue;
102096
- let description;
102097
- const nextLine = lines[i + 1]?.trim();
102098
- if (nextLine && !CLAUDE_TUI_OPTION_PATTERN.test(lines[i + 1]) && !/^─+$/.test(nextLine) && !/^Enter to select\b/.test(nextLine)) {
102099
- description = nextLine;
102100
- }
102101
- options.push({ label, ...description ? { description } : {} });
102127
+ options.push(option);
102102
102128
  }
102103
102129
  if (options.length === 0) return null;
102104
102130
  const header = readString(page.header);