shellpuppet 0.0.1 → 0.1.0

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.
Files changed (112) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +31 -0
  3. package/README.md +340 -8
  4. package/dist/cli/index.d.ts +13 -0
  5. package/dist/cli/index.js +693 -0
  6. package/dist/cli/index.js.map +1 -0
  7. package/dist/client/http.d.ts +82 -0
  8. package/dist/client/http.js +225 -0
  9. package/dist/client/http.js.map +1 -0
  10. package/dist/core/dialogs.d.ts +88 -0
  11. package/dist/core/dialogs.js +214 -0
  12. package/dist/core/dialogs.js.map +1 -0
  13. package/dist/core/echo.d.ts +71 -0
  14. package/dist/core/echo.js +249 -0
  15. package/dist/core/echo.js.map +1 -0
  16. package/dist/core/find.d.ts +34 -0
  17. package/dist/core/find.js +41 -0
  18. package/dist/core/find.js.map +1 -0
  19. package/dist/core/keys.d.ts +22 -0
  20. package/dist/core/keys.js +80 -0
  21. package/dist/core/keys.js.map +1 -0
  22. package/dist/core/manager.d.ts +66 -0
  23. package/dist/core/manager.js +158 -0
  24. package/dist/core/manager.js.map +1 -0
  25. package/dist/core/nativePty.d.ts +69 -0
  26. package/dist/core/nativePty.js +156 -0
  27. package/dist/core/nativePty.js.map +1 -0
  28. package/dist/core/policy.d.ts +61 -0
  29. package/dist/core/policy.js +143 -0
  30. package/dist/core/policy.js.map +1 -0
  31. package/dist/core/promptDetector.d.ts +75 -0
  32. package/dist/core/promptDetector.js +606 -0
  33. package/dist/core/promptDetector.js.map +1 -0
  34. package/dist/core/reasoning.d.ts +252 -0
  35. package/dist/core/reasoning.js +740 -0
  36. package/dist/core/reasoning.js.map +1 -0
  37. package/dist/core/regexBudget.d.ts +44 -0
  38. package/dist/core/regexBudget.js +79 -0
  39. package/dist/core/regexBudget.js.map +1 -0
  40. package/dist/core/renderer.d.ts +112 -0
  41. package/dist/core/renderer.js +225 -0
  42. package/dist/core/renderer.js.map +1 -0
  43. package/dist/core/session.d.ts +311 -0
  44. package/dist/core/session.js +966 -0
  45. package/dist/core/session.js.map +1 -0
  46. package/dist/core/types.d.ts +281 -0
  47. package/dist/core/types.js +47 -0
  48. package/dist/core/types.js.map +1 -0
  49. package/dist/core/waiter.d.ts +86 -0
  50. package/dist/core/waiter.js +317 -0
  51. package/dist/core/waiter.js.map +1 -0
  52. package/dist/core/windowsPtyStart.d.ts +90 -0
  53. package/dist/core/windowsPtyStart.js +129 -0
  54. package/dist/core/windowsPtyStart.js.map +1 -0
  55. package/dist/daemon/audit.d.ts +23 -0
  56. package/dist/daemon/audit.js +51 -0
  57. package/dist/daemon/audit.js.map +1 -0
  58. package/dist/daemon/auth.d.ts +127 -0
  59. package/dist/daemon/auth.js +241 -0
  60. package/dist/daemon/auth.js.map +1 -0
  61. package/dist/daemon/config.d.ts +76 -0
  62. package/dist/daemon/config.js +301 -0
  63. package/dist/daemon/config.js.map +1 -0
  64. package/dist/daemon/index.d.ts +7 -0
  65. package/dist/daemon/index.js +87 -0
  66. package/dist/daemon/index.js.map +1 -0
  67. package/dist/daemon/liveness.d.ts +36 -0
  68. package/dist/daemon/liveness.js +71 -0
  69. package/dist/daemon/liveness.js.map +1 -0
  70. package/dist/daemon/logger.d.ts +7 -0
  71. package/dist/daemon/logger.js +29 -0
  72. package/dist/daemon/logger.js.map +1 -0
  73. package/dist/daemon/meta.d.ts +9 -0
  74. package/dist/daemon/meta.js +24 -0
  75. package/dist/daemon/meta.js.map +1 -0
  76. package/dist/daemon/paths.d.ts +83 -0
  77. package/dist/daemon/paths.js +154 -0
  78. package/dist/daemon/paths.js.map +1 -0
  79. package/dist/daemon/screenshot.d.ts +87 -0
  80. package/dist/daemon/screenshot.js +256 -0
  81. package/dist/daemon/screenshot.js.map +1 -0
  82. package/dist/daemon/server.d.ts +244 -0
  83. package/dist/daemon/server.js +2187 -0
  84. package/dist/daemon/server.js.map +1 -0
  85. package/dist/daemon/terminalReports.d.ts +38 -0
  86. package/dist/daemon/terminalReports.js +84 -0
  87. package/dist/daemon/terminalReports.js.map +1 -0
  88. package/dist/daemon/viewerLauncher.d.ts +135 -0
  89. package/dist/daemon/viewerLauncher.js +280 -0
  90. package/dist/daemon/viewerLauncher.js.map +1 -0
  91. package/dist/daemon/viewerSync.d.ts +38 -0
  92. package/dist/daemon/viewerSync.js +83 -0
  93. package/dist/daemon/viewerSync.js.map +1 -0
  94. package/dist/mcp/config.d.ts +57 -0
  95. package/dist/mcp/config.js +106 -0
  96. package/dist/mcp/config.js.map +1 -0
  97. package/dist/mcp/index.d.ts +10 -0
  98. package/dist/mcp/index.js +69 -0
  99. package/dist/mcp/index.js.map +1 -0
  100. package/dist/mcp/tools.d.ts +59 -0
  101. package/dist/mcp/tools.js +537 -0
  102. package/dist/mcp/tools.js.map +1 -0
  103. package/dist/viewer/icon-16.png +0 -0
  104. package/dist/viewer/icon-180.png +0 -0
  105. package/dist/viewer/icon-32.png +0 -0
  106. package/dist/viewer/icon-512.png +0 -0
  107. package/dist/viewer/icon.svg +66 -0
  108. package/dist/viewer/index.html +56 -0
  109. package/dist/viewer/viewer.css +84 -0
  110. package/dist/viewer/viewer.js +661 -0
  111. package/package.json +66 -7
  112. package/index.js +0 -4
@@ -0,0 +1,606 @@
1
+ /**
2
+ * Permission-prompt detection over rendered screen text. An agent CLI
3
+ * stuck on a permission prompt should raise an alert instead of waiting for
4
+ * the next manual snapshot, because a prompt only serviced when a human or
5
+ * manager happens to look costs tens of idle minutes per prompt.
6
+ *
7
+ * This is a HEURISTIC over untrusted screen content. It decides only whether
8
+ * the screen LOOKS LIKE it is waiting on a human choice; it never decides the
9
+ * answer. False negatives cost what the status quo already costs (a wait for
10
+ * the next snapshot); false positives cost one spurious notification. Both
11
+ * are acceptable, so the patterns favour the shapes real agent CLIs draw.
12
+ *
13
+ * Calibrated against real screens from three CLIs (the fixtures are
14
+ * verbatim): Qoder (`❯` marker, tight option blocks), Codex (`›`/`>` markers,
15
+ * LONG WRAPPED option text between numbered rows and `Press enter to
16
+ * confirm or esc to cancel` footers) and Grok (radio rows `1 (○)` / `2 (•)`
17
+ * inside a `│` box border, NO dot after the number; its folder-trust question
18
+ * puts each option's key after it, `Yes, proceed y`). It also reads
19
+ * pointer-only choosers with unnumbered rows (inquirer.js, and Claude Code's
20
+ * own folder-trust prompt), letter-keyed menus, `(Y)es/(N)o` and bracketed
21
+ * letter lists, and the steps `@clack/prompts` draws for the scaffolding
22
+ * wizards of create-vite, `sv create` and others: a select, a multi-select or
23
+ * a confirm under a `◆` headline, or `▲` while the step shows a validation
24
+ * error. MiMo Code's folder-trust question is a clack select too. Two rules
25
+ * keep out FALSE positives: a numbered findings list an agent printed above
26
+ * its composer, under a line that happens to end in a question mark; and a
27
+ * message Claude Code echoes into its transcript or holds in its composer,
28
+ * whose `❯` and aligned lines look like a pointer chooser under a question
29
+ * from an earlier message.
30
+ *
31
+ * A dialog drawn with its choices as one row of buttons (OpenCode, MiMo Code)
32
+ * fits none of these shapes and is recognised by its signature instead
33
+ * (`dialogs.ts`), which config can extend.
34
+ */
35
+ import { dialogPrompt } from './dialogs.js';
36
+ /**
37
+ * A numbered option row, in either of the two shapes real CLIs draw. Dot
38
+ * form: `❯ 1. Allow once` / `› 1. Yes, proceed (y)` / `>1. Sign in
39
+ * with ChatGPT` (Codex draws the sign-in marker TIGHT against the digit) /
40
+ * `2. Don't trust and exit`. Radio form: `│ 1 (○) Yes, and don't ask
41
+ * again` / `│ 2 (•) Yes, proceed` (Grok: box border, no dot, the radio IS
42
+ * the selection state). The capture group is the option number, used to keep
43
+ * wrap-interleaved rows in one block.
44
+ */
45
+ const OPTION_ROW = /^\s*(?:│\s*)?(?:[❯›]\s*|>\s*)?(\d+)(?:\.\s+|\s+\([○•●]\)\s+)\S/;
46
+ /**
47
+ * A letter-keyed row: `[Y] Yes`, `(a) Apply the change`,
48
+ * optionally pointed. The capture is the key, used to keep a block to rows
49
+ * with DISTINCT keys, because a markdown checkbox list repeats `[x]`.
50
+ */
51
+ const LETTER_ROW = /^\s*(?:│\s*)?(?:[❯›]\s*|>\s*)?[[(]([a-z])[\])]\s+\S/i;
52
+ /**
53
+ * An option with its key after it, as Grok's folder-trust question draws
54
+ * them: `Yes, proceed y`. The label, two or more spaces, then a single
55
+ * letter ending the line. Captures indent, label and key.
56
+ */
57
+ const KEY_HINT_ROW = /^(\s*)(\S.*?)\s{2,}([a-z])$/i;
58
+ /**
59
+ * A pointer against plain text: `❯ npm`, `> minimal`. It is the
60
+ * inquirer.js shape, and Claude Code's own folder-trust prompt. Captures
61
+ * indent, pointer and text. `›` is deliberately absent: Codex draws it on
62
+ * its composer line, and every `›` chooser seen so far numbers its rows.
63
+ */
64
+ const POINTER_ROW = /^(\s*)([❯>])\s+(\S.*)$/;
65
+ /**
66
+ * Focus markers TUIs draw on the selected option: `❯`/`›` anywhere,
67
+ * line-leading `>` only before a numbered or letter-keyed row (tight or
68
+ * spaced) or a FILLED radio `(•)`/`(●)`, Grok's selected-row marker.
69
+ */
70
+ const MARKER_LINE = /[❯›]|^\s*(?:│\s*)?>\s*(?:\d+\.|[[(][a-z][\])])|\([•●]\)/i;
71
+ /**
72
+ * A step headline as `@clack/prompts` draws it: the step glyph, two spaces,
73
+ * the message. Only a step still waiting matches: `◆`, or `▲` while it shows
74
+ * a validation error. Clack redraws a step `◇` once it is answered and `■`
75
+ * once it is cancelled, and its log lines reuse the step glyphs
76
+ * (`◆ Project created`), so a headline counts only with choice rows under it.
77
+ * A step with no message of its own is the glyph alone: MiMo Code asks its
78
+ * folder-trust question in a message it logs above such a step.
79
+ */
80
+ const CLACK_HEADLINE = /^[◆▲](?: {2}(\S.*))?$/;
81
+ /** The first line of a message clack logs: `● Accessing workspace:`. */
82
+ const CLACK_LOG = /^[●◆◇▲■] {2}(\S.*)$/;
83
+ /**
84
+ * A choice row in the `│` gutter clack draws down the left of a step. A
85
+ * select draws radios (`●` for the selected option, `○` for the rest), a
86
+ * confirm draws both radios on one row (`● Yes / ○ No`) and a multi-select
87
+ * draws checkboxes (`◼` checked, `◻` not). The focused checkbox differs only
88
+ * in colour, which screen text does not carry.
89
+ */
90
+ const CLACK_ROW = /^│ {2}[●○◻◼] \S/;
91
+ /** A line in clack's gutter: a choice row, wrapped text, a footer or the bare bar. */
92
+ const CLACK_GUTTER = /^│(?: |$)/;
93
+ /** The line that closes a clack step, which may carry a validation message. */
94
+ const CLACK_BAR_END = /^└(?: |$)/;
95
+ /**
96
+ * The rest of a validation message, on the lines under the `└` that carries
97
+ * it: clack indents them three spaces, to line up with the message. An input
98
+ * box is not one, whatever its indent: neither its pointer (`❯ Ask
99
+ * anything`) nor its border.
100
+ */
101
+ const VALIDATION_REST = /^ {3}[^\s❯›>─-╿]/;
102
+ /**
103
+ * Classic single-line confirmations: `Continue? (y/n)`, `Proceed [y/N]:`
104
+ * and the spelled-out `(Y)es/(N)o` / `[Y]es / [N]o` forms.
105
+ */
106
+ const YES_NO_TAIL = /(\(y\/n\)|\[y\/n\]|\(yes\/no\)|\(y\)es\s*[/,|]?\s*\(n\)o|\[y\]es\s*[/,|]?\s*\[n\]o)\s*:?\s*$/i;
107
+ /**
108
+ * A bracketed letter list ending the line: `[y,n,q,a,d,e,?]?` as git's
109
+ * hunk staging draws it, `(y/N/a)`. Only a list that offers both y and n
110
+ * counts (see `isYesNo`): `(a/b)` in prose is a ratio, not a question.
111
+ */
112
+ const LETTER_LIST_TAIL = /[[(]\s*([a-z?](?:\s*[/,|]\s*[a-z?])+)\s*[\])]\s*[?:]?\s*$/i;
113
+ /**
114
+ * `Press enter to continue` / `…to confirm or esc to cancel`: the footer
115
+ * both Codex prompt classes draw, and a wait state in its own right on the
116
+ * onboarding screens that have no option list at all. `Enter to confirm ·
117
+ * Esc to cancel`, without "press", is Claude Code's.
118
+ */
119
+ const PRESS_ENTER = /(?:press\s+)?\benter to (confirm|continue|select)/i;
120
+ /**
121
+ * Lines that mean the program is WORKING, not waiting. Spinner verbs with
122
+ * their ellipsis only. A bare `esc to cancel` must NOT count as busy, since
123
+ * Codex's `Press enter to confirm or esc to cancel` footer sits BELOW the
124
+ * option block and would veto the very prompt it belongs to. `Waiting for
125
+ * response…` is Grok's response spinner: it appears BELOW a just-answered
126
+ * option block while the block is still in the tail, and without the veto
127
+ * the stale block would go on alerting until it scrolled away. The ellipsis
128
+ * is REQUIRED, matching the verbs: plain prose that happens to say
129
+ * "waiting for response" must not veto a live prompt (a false negative here
130
+ * is an unalerted stall, the costly direction). Claude Code's spinner is busy
131
+ * whatever verb it shows: a spinner glyph at the start of the line, the verb
132
+ * or the task in hand, the ellipsis and often the time so far
133
+ * (`✻ Calculating… (14s · thinking)`). The line it leaves when a turn ends
134
+ * has no ellipsis (`✻ Cooked for 19m 12s · done 20:31`).
135
+ */
136
+ const BUSY_LINE = /(generating|thinking|running|working|waiting for response)(\.{3}|…)|^\s*[·✢✳✶✻✽*] [^…]+…(?: \(.*\))?\s*$/i;
137
+ /** Horizontal rules and box-drawing rows (U+2500 to U+257F) carry no text content. */
138
+ const RULE_LINE = /^[\s─-╿-]*$/;
139
+ /**
140
+ * How far up from the bottom of the screen a live prompt can plausibly sit.
141
+ * Codex's wrapped option text plus footers span a dozen lines on their own,
142
+ * so this is generous. The busy veto below the block does the real work of
143
+ * rejecting scrollback.
144
+ */
145
+ const TAIL_WINDOW = 20;
146
+ /**
147
+ * How many non-rule lines above the option block the question search may
148
+ * inspect. Codex separates its `Would you like to run…?` headline from the
149
+ * options with the full command text, so one line is not enough; the search
150
+ * still only ACCEPTS question-shaped lines, so a bigger budget cannot
151
+ * misattribute ordinary transcript text.
152
+ */
153
+ const QUESTION_SEARCH_BUDGET = 8;
154
+ function contentLines(raw) {
155
+ return raw
156
+ .map((text, index) => ({ text: text.trimEnd(), index }))
157
+ .filter((line) => line.text.trim() !== '');
158
+ }
159
+ function normalise(text) {
160
+ return text.replace(/\s+/g, ' ').trim();
161
+ }
162
+ function stripMarkers(text) {
163
+ return normalise(text.replace(/^[\s│❯›>]+/, ''));
164
+ }
165
+ /** A single-line confirmation tail. See YES_NO_TAIL and LETTER_LIST_TAIL. */
166
+ function isYesNo(text) {
167
+ if (YES_NO_TAIL.test(text))
168
+ return true;
169
+ const list = LETTER_LIST_TAIL.exec(text);
170
+ if (list === null)
171
+ return false;
172
+ const letters = (list[1] ?? '').toLowerCase().split(/[\s/,|]+/);
173
+ return letters.includes('y') && letters.includes('n');
174
+ }
175
+ /**
176
+ * Decide whether the screen is showing a prompt that waits on a human.
177
+ * Returns null when the screen looks busy or shows no prompt shape.
178
+ */
179
+ export function detectPrompt(screen) {
180
+ const raw = screen.split('\n');
181
+ const lines = contentLines(raw);
182
+ if (lines.length === 0)
183
+ return null;
184
+ const tail = lines.slice(-TAIL_WINDOW);
185
+ // A dialog a program draws on its own screen, recognised by its signature
186
+ // (`dialogs.ts`): the most specific test there is, so it goes first.
187
+ const dialog = dialogPrompt(raw);
188
+ if (dialog !== null)
189
+ return dialog;
190
+ // A clack step draws its own frame, and the frame alone says whether the
191
+ // step is waiting.
192
+ const clack = clackPrompt(tail, raw);
193
+ if (clack !== null)
194
+ return clack;
195
+ // Four chooser shapes, most specific first. A block that is found but
196
+ // not LIVE (a numbered list in the transcript, say) does not end the
197
+ // search: the shapes below it, and the single-line tails after, may be.
198
+ const blocks = [
199
+ numberedBlock(tail),
200
+ letterBlock(tail),
201
+ keyHintBlock(tail),
202
+ pointerBlock(tail, raw),
203
+ ];
204
+ for (const block of blocks) {
205
+ if (block === null)
206
+ continue;
207
+ const prompt = livePrompt(block, tail);
208
+ if (prompt !== null)
209
+ return prompt;
210
+ }
211
+ // No live option block: a y/n tail on the LAST content line is still a prompt.
212
+ const last = lines[lines.length - 1];
213
+ if (isYesNo(last.text) && !BUSY_LINE.test(last.text)) {
214
+ const question = normalise(last.text);
215
+ return { question, options: [], signature: question };
216
+ }
217
+ // A bare press-enter wait (the Codex onboarding screens): the last content
218
+ // line asks for enter and nothing below it can contradict that.
219
+ if (PRESS_ENTER.test(last.text)) {
220
+ const question = normalise(last.text);
221
+ return { question, options: [], signature: question };
222
+ }
223
+ return null;
224
+ }
225
+ /**
226
+ * A clack step waiting on its answer: a `◆` or `▲` headline, choice rows in
227
+ * the gutter under it and the `└` that closes the step. The headline alone
228
+ * says whether the step waits, because clack redraws a step once it is
229
+ * answered or cancelled. A waiting step is also the last thing drawn: anything
230
+ * under its `└` means nothing is waiting on it, as when a wizard is killed with
231
+ * its question still on screen and the shell's output follows, or when an agent
232
+ * prints a step-shaped diagram above its own input box. Only the rest of a
233
+ * validation message may sit there, directly under the `└` that carries it and
234
+ * indented as clack indents it (VALIDATION_REST).
235
+ */
236
+ function clackPrompt(tail, raw) {
237
+ const text = (index) => (raw[index] ?? '').trimEnd();
238
+ let lastRow = null;
239
+ for (const line of tail) {
240
+ if (CLACK_ROW.test(line.text))
241
+ lastRow = line;
242
+ }
243
+ if (lastRow === null)
244
+ return null;
245
+ // Up the gutter to the headline: every line of a step is in the gutter,
246
+ // wrapped message and option text included.
247
+ let top = lastRow.index;
248
+ while (CLACK_GUTTER.test(text(top - 1)))
249
+ top--;
250
+ const headline = CLACK_HEADLINE.exec(text(top - 1));
251
+ if (headline === null)
252
+ return null;
253
+ // Down past the footer to the `└`. On a narrow screen the terminal wraps
254
+ // the end of the footer out of the gutter onto a line of its own.
255
+ let end = lastRow.index + 1;
256
+ while (text(end) !== '' && !CLACK_BAR_END.test(text(end)))
257
+ end++;
258
+ if (!CLACK_BAR_END.test(text(end)))
259
+ return null;
260
+ if (raw.slice(lastRow.index + 1).some((line) => BUSY_LINE.test(line)))
261
+ return null;
262
+ let after = end + 1;
263
+ if (/^└ {2}\S/.test(text(end)))
264
+ while (VALIDATION_REST.test(text(after)))
265
+ after++;
266
+ if (raw.slice(after).some((line) => line.trim() !== ''))
267
+ return null;
268
+ // The message runs from the headline down to the first row, less the
269
+ // `...` clack draws where it has scrolled rows out of view. A step with no
270
+ // message of its own is asked by the message logged just above it.
271
+ const message = headline[1] === undefined ? loggedAbove(raw, top - 1) : [headline[1]];
272
+ const options = [];
273
+ let radios = 0;
274
+ let selected = 0;
275
+ for (let index = top; index <= lastRow.index; index++) {
276
+ if (!CLACK_ROW.test(text(index))) {
277
+ const wrapped = text(index).slice(1).trim();
278
+ if (options.length === 0 && wrapped !== '...')
279
+ message.push(wrapped);
280
+ continue;
281
+ }
282
+ // A confirm draws both of its choices on one row.
283
+ for (const choice of text(index).slice(3).split(/ \/ (?=[●○] )/)) {
284
+ const glyph = choice.charAt(0);
285
+ if (glyph === '●' || glyph === '○')
286
+ radios++;
287
+ if (glyph === '●')
288
+ selected++;
289
+ options.push(normalise(choice.slice(2)));
290
+ }
291
+ }
292
+ // A select has exactly one option selected, and so has a confirm.
293
+ if (radios > 0 && selected !== 1)
294
+ return null;
295
+ // What moves with the selection stays out of the signature: the glyphs,
296
+ // and the hint clack draws in brackets beside the focused or checked row.
297
+ const withoutHint = (option) => option.replace(/ \(.*$/, '');
298
+ const question = normalise(message.join(' ')) || withoutHint(options[0] ?? '');
299
+ return {
300
+ question,
301
+ options,
302
+ signature: [question, ...options.map(withoutHint)].join(' | '),
303
+ };
304
+ }
305
+ /**
306
+ * The message clack logged directly above the line at `index`: its first
307
+ * line (`● Accessing workspace:`) and the lines in the gutter under it.
308
+ * Empty when what is above is not a logged message.
309
+ *
310
+ * A line longer than the terminal is wide goes on at the start of the next
311
+ * row, out of the gutter. Such a row is joined to the row above it as it
312
+ * stands, since the break can fall inside a word, but only when the row above
313
+ * fills the screen's width as far as the screen shows it (its longest line, or
314
+ * one short where the break trimmed a space). Any other line out of the gutter
315
+ * is not part of the message.
316
+ */
317
+ function loggedAbove(raw, index) {
318
+ const width = Math.max(...raw.map((line) => line.trimEnd().length));
319
+ const lines = [];
320
+ let wrapped = '';
321
+ for (let at = index - 1; at >= 0; at--) {
322
+ const line = (raw[at] ?? '').trimEnd();
323
+ const first = CLACK_LOG.exec(line);
324
+ if (first !== null)
325
+ return [`${first[1] ?? ''}${wrapped}`, ...lines];
326
+ if (CLACK_GUTTER.test(line)) {
327
+ lines.unshift(`${line.slice(1).trim()}${wrapped}`);
328
+ wrapped = '';
329
+ continue;
330
+ }
331
+ if (line.trim() === '')
332
+ return [];
333
+ if ((raw[at - 1] ?? '').trimEnd().length < width - 1)
334
+ return [];
335
+ wrapped = `${line}${wrapped}`;
336
+ }
337
+ return [];
338
+ }
339
+ /**
340
+ * Numbered option rows anywhere in the tail, wrap-tolerant: Codex wraps a
341
+ * long option's text across several lines, so consecutive-row detection
342
+ * would never see its blocks. Rows whose numbers never
343
+ * DECREASE belong to one chooser; a decrease means a new list started and
344
+ * only the newest can be live.
345
+ */
346
+ function numberedBlock(tail) {
347
+ let rows = [];
348
+ let previousNumber = 0;
349
+ for (const line of tail) {
350
+ const match = OPTION_ROW.exec(line.text);
351
+ if (match === null)
352
+ continue;
353
+ const number = Number(match[1]);
354
+ if (number < previousNumber)
355
+ rows = [];
356
+ previousNumber = number;
357
+ rows.push({ line, option: stripMarkers(line.text) });
358
+ }
359
+ return rows.length >= 2 ? { rows, kind: 'numbered' } : null;
360
+ }
361
+ /**
362
+ * Letter-keyed rows: `[Y] Yes` / `[N] No` / `[A] Always`. One block is rows
363
+ * with DISTINCT keys no more than a few lines apart; a repeated key (a
364
+ * checkbox list's `[x]`, `[x]`) or a gap starts over, keeping the newest.
365
+ */
366
+ function letterBlock(tail) {
367
+ let rows = [];
368
+ let keys = new Set();
369
+ let lastIndex = -1;
370
+ for (const line of tail) {
371
+ const match = LETTER_ROW.exec(line.text);
372
+ if (match === null)
373
+ continue;
374
+ const key = (match[1] ?? '').toLowerCase();
375
+ if ((lastIndex !== -1 && line.index - lastIndex > 3) || keys.has(key)) {
376
+ rows = [];
377
+ keys = new Set();
378
+ }
379
+ keys.add(key);
380
+ lastIndex = line.index;
381
+ rows.push({ line, option: stripMarkers(line.text) });
382
+ }
383
+ return rows.length >= 2 ? { rows, kind: 'letter' } : null;
384
+ }
385
+ /**
386
+ * Options with their keys after them, on adjacent rows that share an indent
387
+ * and a key column: Grok's folder-trust question. Plenty of ordinary lines
388
+ * end in a single letter, so the block must look like a yes/no chooser: each
389
+ * key is the first letter of its label, as a key hint is, and the keys offer
390
+ * both y and n. A table of y/n flags fails the first test and a list of
391
+ * keyboard shortcuts the second.
392
+ */
393
+ function keyHintBlock(tail) {
394
+ let rows = [];
395
+ let keys = [];
396
+ let layout = '';
397
+ let lastIndex = -1;
398
+ for (const line of tail) {
399
+ const match = KEY_HINT_ROW.exec(line.text);
400
+ if (match === null)
401
+ continue;
402
+ const label = match[2] ?? '';
403
+ const key = (match[3] ?? '').toLowerCase();
404
+ if (label.charAt(0).toLowerCase() !== key)
405
+ continue;
406
+ // Rows of one chooser line up on both the indent and the key's column.
407
+ const indent = (match[1] ?? '').length;
408
+ const keyColumn = line.text.length - 1;
409
+ const lineLayout = `${String(indent)}:${String(keyColumn)}`;
410
+ if (line.index !== lastIndex + 1 || lineLayout !== layout) {
411
+ rows = [];
412
+ keys = [];
413
+ }
414
+ layout = lineLayout;
415
+ lastIndex = line.index;
416
+ rows.push({ line, option: normalise(line.text) });
417
+ keys.push(key);
418
+ }
419
+ return keys.includes('y') && keys.includes('n') ? { rows, kind: 'key-hint' } : null;
420
+ }
421
+ /**
422
+ * A pointer against unnumbered rows: the LAST pointer row in the tail plus
423
+ * the rows ADJACENT to it whose text starts in the same column. That is the
424
+ * shape inquirer.js and Claude Code's folder-trust prompt draw. Adjacent
425
+ * means adjacent: a blank line or a rule ends the block, which is what keeps
426
+ * a composer line (`❯ Try "…"`) apart from the status lines drawn under its
427
+ * rule. Claude Code's idle screen would otherwise read as a three-option
428
+ * chooser.
429
+ */
430
+ function pointerBlock(tail, raw) {
431
+ let pointer = null;
432
+ for (const line of tail) {
433
+ const match = POINTER_ROW.exec(line.text);
434
+ if (match === null)
435
+ continue;
436
+ const text = match[3] ?? '';
437
+ if (!/[\p{L}\p{N}]/u.test(text))
438
+ continue; // `│ > │`: a box, not a choice
439
+ pointer = { line, textCol: line.text.length - text.length };
440
+ }
441
+ if (pointer === null)
442
+ return null;
443
+ const { textCol } = pointer;
444
+ const sibling = (index) => {
445
+ const text = (raw[index] ?? '').trimEnd();
446
+ if (text.length <= textCol)
447
+ return null;
448
+ if (text.slice(0, textCol).trim() !== '')
449
+ return null;
450
+ if (/\s/.test(text.charAt(textCol)))
451
+ return null;
452
+ if (POINTER_ROW.test(text))
453
+ return null;
454
+ return { text, index };
455
+ };
456
+ const above = [];
457
+ for (let i = pointer.line.index - 1; i >= 0; i--) {
458
+ const line = sibling(i);
459
+ if (line === null)
460
+ break;
461
+ above.unshift(line);
462
+ }
463
+ const below = [];
464
+ for (let i = pointer.line.index + 1; i < raw.length; i++) {
465
+ const line = sibling(i);
466
+ if (line === null)
467
+ break;
468
+ below.push(line);
469
+ }
470
+ const all = [...above, pointer.line, ...below];
471
+ if (all.length < 2)
472
+ return null;
473
+ return { rows: all.map((line) => ({ line, option: stripMarkers(line.text) })), kind: 'pointer' };
474
+ }
475
+ /**
476
+ * Whether a block is a prompt the program is WAITING on, and if so the
477
+ * prompt as the consumer should see it.
478
+ */
479
+ function livePrompt(block, tail) {
480
+ const { rows, kind } = block;
481
+ const blockStart = rows[0].line.index;
482
+ const blockEnd = rows[rows.length - 1].line.index;
483
+ // The program drawing BUSY output below the options means it moved on:
484
+ // the block is history. (The `Press enter…` footer below the block is
485
+ // the opposite: it confirms the prompt is live.)
486
+ const below = tail.filter((line) => line.index > blockEnd);
487
+ if (below.some((line) => BUSY_LINE.test(line.text)))
488
+ return null;
489
+ const hasMarker = tail.some((line) => line.index >= blockStart && line.index <= blockEnd && MARKER_LINE.test(line.text));
490
+ const hasPressEnter = below.some((line) => PRESS_ENTER.test(line.text));
491
+ const question = findQuestion(tail, blockStart);
492
+ const nothingBelow = below.every((line) => RULE_LINE.test(line.text));
493
+ let live;
494
+ if (kind === 'key-hint') {
495
+ // The key hints are the block's own markers; the question above must
496
+ // frame it.
497
+ live = question !== null;
498
+ }
499
+ else if (kind === 'pointer') {
500
+ // The pointer is the block's own marker, so it proves nothing by itself:
501
+ // Claude Code draws the same `❯` on each message in its transcript and on
502
+ // the draft in its composer. An enter-to-confirm footer below frames the
503
+ // block, or a question drawn with it, directly above with no blank line
504
+ // between, as inquirer draws it. A transcript sets each message apart
505
+ // with a blank line, so a question above an echoed message belongs to an
506
+ // earlier one. What follows the choices cannot decide: inquirer draws a
507
+ // description of the focused choice and a key-help line there.
508
+ live = hasPressEnter || (question !== null && drawnTogether(tail, question.index, blockStart));
509
+ }
510
+ else {
511
+ // A focused-option marker or a press-enter footer is the strongest
512
+ // signal a selector is live. Without either, a question-shaped headline
513
+ // counts only when the block ENDS the screen: a program blocked on a
514
+ // choice draws nothing after its options, while an agent that has
515
+ // finished a turn draws its composer under the numbered list it printed.
516
+ live = hasMarker || hasPressEnter || (question !== null && nothingBelow);
517
+ }
518
+ if (!live)
519
+ return null;
520
+ const options = rows.map((row) => row.option);
521
+ const headline = question?.text ?? options[0];
522
+ // The signature must survive the selection MOVING (arrow keys flip which
523
+ // radio is filled). The prompt is still the same prompt, and resetting
524
+ // the stall clock on every selection change would let a held prompt
525
+ // evade the threshold forever. Normalise filled radios to hollow in the
526
+ // signature only; `options` keeps the live state for the consumer.
527
+ const stable = (text) => text.replace(/\([•●]\)/g, '(○)');
528
+ return {
529
+ question: headline,
530
+ options,
531
+ signature: [headline, ...options].map(stable).join(' | '),
532
+ };
533
+ }
534
+ /**
535
+ * Whether the prompt on screen is the one the caller has ALREADY ANSWERED.
536
+ * A supervision loop is wait-for-prompt → answer → wait, and the second wait
537
+ * can look before the program has repainted; it must not return the
538
+ * question just answered as a new one.
539
+ *
540
+ * The guard remembers the prompt showing when input was last written and
541
+ * treats it as stale until an observation has seen the screen without it, or
542
+ * with a different prompt. An observation is a wait tick, a snapshot or the
543
+ * daemon's stall scan. So a prompt with the SAME text drawn later is
544
+ * new only once the earlier one was seen to go; a program that ignored the
545
+ * input keeps showing a stale prompt, and the wait says so rather than
546
+ * guessing.
547
+ */
548
+ export class StalePromptGuard {
549
+ signatureAtInput = null;
550
+ cleared = false;
551
+ /** Input is being written; `screen` is what the program showed at that moment. */
552
+ noteInput(screen) {
553
+ this.signatureAtInput = detectPrompt(screen)?.signature ?? null;
554
+ this.cleared = false;
555
+ }
556
+ /** A look at the screen found this prompt (or none, when null). */
557
+ observe(signature) {
558
+ if (this.signatureAtInput !== null && signature !== this.signatureAtInput) {
559
+ this.cleared = true;
560
+ }
561
+ }
562
+ /** True while `signature` is the answered prompt, not yet seen to go away. */
563
+ isStale(signature) {
564
+ return this.signatureAtInput !== null && signature === this.signatureAtInput && !this.cleared;
565
+ }
566
+ }
567
+ /**
568
+ * A question-shaped line above the option block: skips rules and box borders,
569
+ * accepts a line that asks something or names a request ("Permission
570
+ * Required", "Allow this command to run?", "Do you trust…", "Would you
571
+ * like…"). Codex puts the command text between the headline and the
572
+ * options, so the search inspects up to QUESTION_SEARCH_BUDGET non-rule
573
+ * lines. It only ever RETURNS a question-shaped line, so the budget cannot
574
+ * misattribute ordinary transcript text. A question mark anywhere counts,
575
+ * not only at the end: Claude Code's trust prompt asks "…one you trust?
576
+ * (Like your own code…" and inquirer's `? Select a template: (Use arrow keys)`
577
+ * leads with it. Returns the line, its text normalised.
578
+ */
579
+ function findQuestion(tail, blockStart) {
580
+ const above = tail.filter((line) => line.index < blockStart);
581
+ let inspected = 0;
582
+ for (let i = above.length - 1; i >= 0 && inspected < QUESTION_SEARCH_BUDGET; i--) {
583
+ const line = above[i];
584
+ if (RULE_LINE.test(line.text))
585
+ continue;
586
+ inspected++;
587
+ const cleaned = normalise(line.text);
588
+ if (/\?/.test(cleaned) ||
589
+ /permission required/i.test(cleaned) ||
590
+ /^allow\b/i.test(cleaned) ||
591
+ /do you trust/i.test(cleaned) ||
592
+ /^would you like\b/i.test(cleaned)) {
593
+ return { text: cleaned, index: line.index };
594
+ }
595
+ }
596
+ return null;
597
+ }
598
+ /**
599
+ * Whether two lines are drawn together: every line between them has content.
600
+ * Blank lines are the only lines between two lines of the tail that the tail
601
+ * leaves out.
602
+ */
603
+ function drawnTogether(tail, upper, lower) {
604
+ return tail.filter((line) => line.index > upper && line.index < lower).length === lower - upper - 1;
605
+ }
606
+ //# sourceMappingURL=promptDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptDetector.js","sourceRoot":"","sources":["../../src/core/promptDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAe5C;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,gEAAgE,CAAC;AACpF;;;;GAIG;AACH,MAAM,UAAU,GAAG,sDAAsD,CAAC;AAC1E;;;;GAIG;AACH,MAAM,YAAY,GAAG,8BAA8B,CAAC;AACpD;;;;;GAKG;AACH,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAC7C;;;;GAIG;AACH,MAAM,WAAW,GAAG,0DAA0D,CAAC;AAC/E;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAC/C,yEAAyE;AACzE,MAAM,SAAS,GAAG,qBAAqB,CAAC;AACxC;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,sFAAsF;AACtF,MAAM,YAAY,GAAG,WAAW,CAAC;AACjC,+EAA+E;AAC/E,MAAM,aAAa,GAAG,WAAW,CAAC;AAClC;;;;;GAKG;AACH,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C;;;GAGG;AACH,MAAM,WAAW,GACf,+FAA+F,CAAC;AAClG;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,4DAA4D,CAAC;AACtF;;;;;GAKG;AACH,MAAM,WAAW,GAAG,oDAAoD,CAAC;AACzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,SAAS,GACb,2GAA2G,CAAC;AAC9G,sFAAsF;AACtF,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC;;;;;GAKG;AACH,MAAM,WAAW,G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