@threadbase-sh/streamer 1.24.2 → 1.24.3

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
@@ -138849,14 +138849,41 @@ function scrapePermissionGate(lines) {
138849
138849
  }
138850
138850
  if (options.length === 0) return null;
138851
138851
  let prompt;
138852
+ let promptLine = -1;
138852
138853
  for (let i = firstOptionLine - 1; i >= 0; i--) {
138853
138854
  const t2 = stripGutter(lines[i]).trim();
138854
138855
  if (t2.length === 0) continue;
138855
138856
  if (BOX_ONLY_RE.test(lines[i].trim()) || FOOTER_RE.test(t2) || PROMPT_ARROW_RE.test(t2)) continue;
138856
138857
  prompt = t2 || void 0;
138858
+ promptLine = i;
138857
138859
  break;
138858
138860
  }
138859
- return { ...prompt ? { prompt } : {}, options, ...cursor !== void 0 ? { cursor } : {} };
138861
+ const detail = promptLine > 0 ? scrapeDetail(lines, promptLine) : void 0;
138862
+ return {
138863
+ ...prompt ? { prompt } : {},
138864
+ ...detail ? { detail } : {},
138865
+ options,
138866
+ ...cursor !== void 0 ? { cursor } : {}
138867
+ };
138868
+ }
138869
+ var MAX_DETAIL_LINES = 6;
138870
+ function scrapeDetail(lines, promptLine) {
138871
+ const collected = [];
138872
+ let blankRun = 0;
138873
+ for (let i = promptLine - 1; i >= 0; i--) {
138874
+ const t2 = stripGutter(lines[i]).trim();
138875
+ if (BOX_ONLY_RE.test(t2)) break;
138876
+ if (t2.length === 0) {
138877
+ blankRun++;
138878
+ if (blankRun >= 2) break;
138879
+ continue;
138880
+ }
138881
+ blankRun = 0;
138882
+ if (FOOTER_RE.test(t2) || PROMPT_ARROW_RE.test(t2)) continue;
138883
+ collected.push(t2);
138884
+ if (collected.length >= MAX_DETAIL_LINES) break;
138885
+ }
138886
+ return collected.length > 0 ? collected.reverse().join("\n") : void 0;
138860
138887
  }
138861
138888
 
138862
138889
  // src/services/questions/detectQuestionFromScreen.ts
@@ -144140,6 +144167,7 @@ var StreamerServer = class {
144140
144167
  type: "permission",
144141
144168
  sessionId,
144142
144169
  ...gate.prompt ? { prompt: gate.prompt } : {},
144170
+ ...gate.detail ? { detail: gate.detail } : {},
144143
144171
  options: gate.options,
144144
144172
  ...gate.cursor !== void 0 ? { cursor: gate.cursor } : {}
144145
144173
  });