@threadbase-sh/streamer 1.70.3 → 1.70.5

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/cli.cjs CHANGED
@@ -107551,6 +107551,13 @@ var init_detectPermissionGate = __esm({
107551
107551
  });
107552
107552
 
107553
107553
  // src/services/questions/detectQuestionFromScreen.ts
107554
+ function stripStateMarker(label) {
107555
+ if (KNOWN_STATE_MARKER_RE.test(label)) {
107556
+ return { label: label.replace(KNOWN_STATE_MARKER_RE, ""), marked: true };
107557
+ }
107558
+ if (UNKNOWN_STATE_MARKER_RE.test(label)) return { label, marked: true };
107559
+ return { label, marked: false };
107560
+ }
107554
107561
  function stripBoxGutter(line) {
107555
107562
  return line.replace(/^\s*[│|]\s?/, "").replace(/\s*[│|]\s*$/, "");
107556
107563
  }
@@ -107565,6 +107572,7 @@ function detectQuestionFromScreen(lines) {
107565
107572
  if (footerIdx === -1) return null;
107566
107573
  const options = [];
107567
107574
  let firstOptionIdx = -1;
107575
+ let sawStateMarker = false;
107568
107576
  for (let i = footerIdx - 1; i >= 0; i--) {
107569
107577
  const line = lines[i];
107570
107578
  const inner = stripBoxGutter(line);
@@ -107578,8 +107586,10 @@ function detectQuestionFromScreen(lines) {
107578
107586
  if (options.length > 0 && QUESTION_RE.test(trimmed) && !OPTION_RE2.test(inner)) break;
107579
107587
  const m2 = OPTION_RE2.exec(inner);
107580
107588
  if (m2) {
107581
- const label = m2[2].trim();
107582
- if (PERMISSION_LABEL_RE.test(label)) return null;
107589
+ const rendered = m2[2].trim();
107590
+ if (PERMISSION_LABEL_RE.test(rendered)) return null;
107591
+ const { label, marked } = stripStateMarker(rendered);
107592
+ if (marked) sawStateMarker = true;
107583
107593
  options.unshift({ label, description: "" });
107584
107594
  firstOptionIdx = i;
107585
107595
  }
@@ -107598,7 +107608,7 @@ function detectQuestionFromScreen(lines) {
107598
107608
  }
107599
107609
  if (!question) return null;
107600
107610
  return {
107601
- questions: [{ question, header: "", multiSelect: false, options }]
107611
+ questions: [{ question, header: "", multiSelect: sawStateMarker, options }]
107602
107612
  };
107603
107613
  }
107604
107614
  function isQuestionMenuOnScreen(lines) {
@@ -107607,7 +107617,7 @@ function isQuestionMenuOnScreen(lines) {
107607
107617
  function questionContentKey(questions) {
107608
107618
  return questions.map((q2) => `${q2.question} ${q2.options.map((o) => o.label).join(",")}`).join("::");
107609
107619
  }
107610
- var ASK_FOOTER_RE, ESC_FOOTER_RE, OPTION_RE2, QUESTION_RE, BOX_ONLY_RE2, PERMISSION_LABEL_RE;
107620
+ var ASK_FOOTER_RE, ESC_FOOTER_RE, OPTION_RE2, QUESTION_RE, BOX_ONLY_RE2, PERMISSION_LABEL_RE, KNOWN_STATE_MARKER_RE, UNKNOWN_STATE_MARKER_RE;
107611
107621
  var init_detectQuestionFromScreen = __esm({
107612
107622
  "src/services/questions/detectQuestionFromScreen.ts"() {
107613
107623
  "use strict";
@@ -107617,6 +107627,8 @@ var init_detectQuestionFromScreen = __esm({
107617
107627
  QUESTION_RE = /\?\s*$/;
107618
107628
  BOX_ONLY_RE2 = /^[\s│─┌┐└┘├┤┬┴┼╭╮╰╯╱╲=_-]+$/;
107619
107629
  PERMISSION_LABEL_RE = /^(Yes|No)\b/i;
107630
+ KNOWN_STATE_MARKER_RE = /^(?:\[(?:[ xX*]|✓|✔)\]|[☐☑☒])\s*/;
107631
+ UNKNOWN_STATE_MARKER_RE = /^(?:\[[^\]]{0,3}\]|\([^)]{0,3}\))\s*/;
107620
107632
  }
107621
107633
  });
107622
107634
 
@@ -161006,6 +161018,12 @@ async function runInstall(opts) {
161006
161018
  return installed;
161007
161019
  }
161008
161020
 
161021
+ // cli/boot-log.ts
161022
+ function logApiKeyLine(log15, apiKey) {
161023
+ const apiKeyMasked = `${apiKey.slice(0, 6)}\u2026`;
161024
+ log15.info(`API key: ${apiKeyMasked}`, { apiKeyMasked });
161025
+ }
161026
+
161009
161027
  // cli/pair-banner.ts
161010
161028
  var import_qrcode_terminal = __toESM(require_main2(), 1);
161011
161029
  init_logger();
@@ -161644,7 +161662,7 @@ program2.command("serve").description("Start the streamer server").option("-p, -
161644
161662
  log14.info(`WebSocket at ws://localhost:${resolvedPort}/ws`, {
161645
161663
  wsUrl: `ws://localhost:${resolvedPort}/ws`
161646
161664
  });
161647
- log14.info(`API key: ${apiKey}`, { apiKeyMasked: `${apiKey.slice(0, 6)}\u2026` });
161665
+ logApiKeyLine(log14, apiKey);
161648
161666
  try {
161649
161667
  await printServerBanner({
161650
161668
  port: resolvedPort,