shellpuppet 0.2.0 → 0.3.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 (238) hide show
  1. package/README.md +83 -18
  2. package/dist/agents/agy/index.d.ts +2 -0
  3. package/dist/agents/agy/index.js +11 -0
  4. package/dist/agents/agy/index.js.map +1 -0
  5. package/dist/agents/agy/nudge.d.ts +2 -0
  6. package/dist/agents/agy/nudge.js +29 -0
  7. package/dist/agents/agy/nudge.js.map +1 -0
  8. package/dist/agents/agy/reading.d.ts +2 -0
  9. package/dist/agents/agy/reading.js +28 -0
  10. package/dist/agents/agy/reading.js.map +1 -0
  11. package/dist/agents/barNudge.d.ts +9 -0
  12. package/dist/agents/barNudge.js +21 -0
  13. package/dist/agents/barNudge.js.map +1 -0
  14. package/dist/agents/claude/index.d.ts +2 -0
  15. package/dist/agents/claude/index.js +31 -0
  16. package/dist/agents/claude/index.js.map +1 -0
  17. package/dist/agents/claude/nudge.d.ts +2 -0
  18. package/dist/agents/claude/nudge.js +38 -0
  19. package/dist/agents/claude/nudge.js.map +1 -0
  20. package/dist/agents/claude/prompts.d.ts +9 -0
  21. package/dist/agents/claude/prompts.js +16 -0
  22. package/dist/agents/claude/prompts.js.map +1 -0
  23. package/dist/agents/claude/reading.d.ts +2 -0
  24. package/dist/agents/claude/reading.js +25 -0
  25. package/dist/agents/claude/reading.js.map +1 -0
  26. package/dist/agents/codex/index.d.ts +2 -0
  27. package/dist/agents/codex/index.js +28 -0
  28. package/dist/agents/codex/index.js.map +1 -0
  29. package/dist/agents/codex/nudge.d.ts +2 -0
  30. package/dist/agents/codex/nudge.js +35 -0
  31. package/dist/agents/codex/nudge.js.map +1 -0
  32. package/dist/agents/codex/prompts.d.ts +9 -0
  33. package/dist/agents/codex/prompts.js +14 -0
  34. package/dist/agents/codex/prompts.js.map +1 -0
  35. package/dist/agents/codex/reading.d.ts +2 -0
  36. package/dist/agents/codex/reading.js +22 -0
  37. package/dist/agents/codex/reading.js.map +1 -0
  38. package/dist/agents/generic/index.d.ts +3 -0
  39. package/dist/agents/generic/index.js +9 -0
  40. package/dist/agents/generic/index.js.map +1 -0
  41. package/dist/agents/generic/prompts.d.ts +2 -0
  42. package/dist/agents/generic/prompts.js +10 -0
  43. package/dist/agents/generic/prompts.js.map +1 -0
  44. package/dist/agents/grok/actionBox.d.ts +13 -0
  45. package/dist/agents/grok/actionBox.js +127 -0
  46. package/dist/agents/grok/actionBox.js.map +1 -0
  47. package/dist/agents/grok/index.d.ts +2 -0
  48. package/dist/agents/grok/index.js +20 -0
  49. package/dist/agents/grok/index.js.map +1 -0
  50. package/dist/agents/grok/nudge.d.ts +2 -0
  51. package/dist/agents/grok/nudge.js +76 -0
  52. package/dist/agents/grok/nudge.js.map +1 -0
  53. package/dist/agents/grok/prompts.d.ts +4 -0
  54. package/dist/agents/grok/prompts.js +89 -0
  55. package/dist/agents/grok/prompts.js.map +1 -0
  56. package/dist/agents/grok/reading.d.ts +2 -0
  57. package/dist/agents/grok/reading.js +49 -0
  58. package/dist/agents/grok/reading.js.map +1 -0
  59. package/dist/agents/grok/readingRules.d.ts +2 -0
  60. package/dist/agents/grok/readingRules.js +44 -0
  61. package/dist/agents/grok/readingRules.js.map +1 -0
  62. package/dist/agents/index.d.ts +28 -0
  63. package/dist/agents/index.js +46 -0
  64. package/dist/agents/index.js.map +1 -0
  65. package/dist/agents/input.d.ts +2 -0
  66. package/dist/agents/input.js +9 -0
  67. package/dist/agents/input.js.map +1 -0
  68. package/dist/agents/mimo/index.d.ts +2 -0
  69. package/dist/agents/mimo/index.js +13 -0
  70. package/dist/agents/mimo/index.js.map +1 -0
  71. package/dist/agents/mimo/nudge.d.ts +3 -0
  72. package/dist/agents/mimo/nudge.js +59 -0
  73. package/dist/agents/mimo/nudge.js.map +1 -0
  74. package/dist/agents/mimo/prompts.d.ts +2 -0
  75. package/dist/agents/mimo/prompts.js +40 -0
  76. package/dist/agents/mimo/prompts.js.map +1 -0
  77. package/dist/agents/mimo/reading.d.ts +2 -0
  78. package/dist/agents/mimo/reading.js +31 -0
  79. package/dist/agents/mimo/reading.js.map +1 -0
  80. package/dist/agents/mimo/readingRules.d.ts +2 -0
  81. package/dist/agents/mimo/readingRules.js +79 -0
  82. package/dist/agents/mimo/readingRules.js.map +1 -0
  83. package/dist/agents/mimo/stalls.d.ts +2 -0
  84. package/dist/agents/mimo/stalls.js +81 -0
  85. package/dist/agents/mimo/stalls.js.map +1 -0
  86. package/dist/agents/muse/index.d.ts +2 -0
  87. package/dist/agents/muse/index.js +20 -0
  88. package/dist/agents/muse/index.js.map +1 -0
  89. package/dist/agents/muse/input.d.ts +3 -0
  90. package/dist/agents/muse/input.js +7 -0
  91. package/dist/agents/muse/input.js.map +1 -0
  92. package/dist/agents/muse/nudge.d.ts +2 -0
  93. package/dist/agents/muse/nudge.js +33 -0
  94. package/dist/agents/muse/nudge.js.map +1 -0
  95. package/dist/agents/muse/prompts.d.ts +14 -0
  96. package/dist/agents/muse/prompts.js +132 -0
  97. package/dist/agents/muse/prompts.js.map +1 -0
  98. package/dist/agents/muse/reading.d.ts +2 -0
  99. package/dist/agents/muse/reading.js +33 -0
  100. package/dist/agents/muse/reading.js.map +1 -0
  101. package/dist/agents/muse/readingRules.d.ts +2 -0
  102. package/dist/agents/muse/readingRules.js +49 -0
  103. package/dist/agents/muse/readingRules.js.map +1 -0
  104. package/dist/agents/nudgeReading.d.ts +74 -0
  105. package/dist/agents/nudgeReading.js +262 -0
  106. package/dist/agents/nudgeReading.js.map +1 -0
  107. package/dist/agents/opencode/index.d.ts +2 -0
  108. package/dist/agents/opencode/index.js +21 -0
  109. package/dist/agents/opencode/index.js.map +1 -0
  110. package/dist/agents/opencode/nudge.d.ts +6 -0
  111. package/dist/agents/opencode/nudge.js +187 -0
  112. package/dist/agents/opencode/nudge.js.map +1 -0
  113. package/dist/agents/opencode/prompts.d.ts +6 -0
  114. package/dist/agents/opencode/prompts.js +198 -0
  115. package/dist/agents/opencode/prompts.js.map +1 -0
  116. package/dist/agents/opencode/reading.d.ts +2 -0
  117. package/dist/agents/opencode/reading.js +29 -0
  118. package/dist/agents/opencode/reading.js.map +1 -0
  119. package/dist/agents/opencode/stalls.d.ts +3 -0
  120. package/dist/agents/opencode/stalls.js +14 -0
  121. package/dist/agents/opencode/stalls.js.map +1 -0
  122. package/dist/agents/qoder/index.d.ts +2 -0
  123. package/dist/agents/qoder/index.js +12 -0
  124. package/dist/agents/qoder/index.js.map +1 -0
  125. package/dist/agents/qoder/nudge.d.ts +2 -0
  126. package/dist/agents/qoder/nudge.js +16 -0
  127. package/dist/agents/qoder/nudge.js.map +1 -0
  128. package/dist/agents/qoder/prompts.d.ts +2 -0
  129. package/dist/agents/qoder/prompts.js +6 -0
  130. package/dist/agents/qoder/prompts.js.map +1 -0
  131. package/dist/agents/qoder/reading.d.ts +2 -0
  132. package/dist/agents/qoder/reading.js +41 -0
  133. package/dist/agents/qoder/reading.js.map +1 -0
  134. package/dist/agents/types.d.ts +187 -0
  135. package/dist/agents/types.js +2 -0
  136. package/dist/agents/types.js.map +1 -0
  137. package/dist/cli/index.js +255 -33
  138. package/dist/cli/index.js.map +1 -1
  139. package/dist/client/http.d.ts +17 -3
  140. package/dist/client/http.js +232 -35
  141. package/dist/client/http.js.map +1 -1
  142. package/dist/core/dialogs.d.ts +2 -4
  143. package/dist/core/dialogs.js +6 -12
  144. package/dist/core/dialogs.js.map +1 -1
  145. package/dist/core/mailbox.d.ts +222 -0
  146. package/dist/core/mailbox.js +545 -0
  147. package/dist/core/mailbox.js.map +1 -0
  148. package/dist/core/manager.d.ts +3 -0
  149. package/dist/core/manager.js +37 -2
  150. package/dist/core/manager.js.map +1 -1
  151. package/dist/core/messageText.d.ts +2 -0
  152. package/dist/core/messageText.js +6 -0
  153. package/dist/core/messageText.js.map +1 -0
  154. package/dist/core/nudge.d.ts +37 -0
  155. package/dist/core/nudge.js +57 -0
  156. package/dist/core/nudge.js.map +1 -0
  157. package/dist/core/promptDetector.d.ts +14 -12
  158. package/dist/core/promptDetector.js +113 -363
  159. package/dist/core/promptDetector.js.map +1 -1
  160. package/dist/core/promptText.d.ts +1 -0
  161. package/dist/core/promptText.js +4 -0
  162. package/dist/core/promptText.js.map +1 -0
  163. package/dist/core/readiness.d.ts +14 -0
  164. package/dist/core/readiness.js +95 -0
  165. package/dist/core/readiness.js.map +1 -0
  166. package/dist/core/reasoning.d.ts +68 -7
  167. package/dist/core/reasoning.js +572 -325
  168. package/dist/core/reasoning.js.map +1 -1
  169. package/dist/core/renderer.d.ts +63 -3
  170. package/dist/core/renderer.js +368 -42
  171. package/dist/core/renderer.js.map +1 -1
  172. package/dist/core/selection.d.ts +1 -1
  173. package/dist/core/selection.js +3 -3
  174. package/dist/core/selection.js.map +1 -1
  175. package/dist/core/session.d.ts +166 -14
  176. package/dist/core/session.js +1000 -86
  177. package/dist/core/session.js.map +1 -1
  178. package/dist/core/types.d.ts +60 -4
  179. package/dist/core/types.js +41 -0
  180. package/dist/core/types.js.map +1 -1
  181. package/dist/core/waiter.d.ts +9 -2
  182. package/dist/core/waiter.js +35 -10
  183. package/dist/core/waiter.js.map +1 -1
  184. package/dist/daemon/audit.d.ts +1 -1
  185. package/dist/daemon/audit.js +2 -1
  186. package/dist/daemon/audit.js.map +1 -1
  187. package/dist/daemon/config.d.ts +42 -0
  188. package/dist/daemon/config.js +159 -4
  189. package/dist/daemon/config.js.map +1 -1
  190. package/dist/daemon/folderPicker.js +21 -2
  191. package/dist/daemon/folderPicker.js.map +1 -1
  192. package/dist/daemon/homeOwner.d.ts +15 -0
  193. package/dist/daemon/homeOwner.js +106 -0
  194. package/dist/daemon/homeOwner.js.map +1 -0
  195. package/dist/daemon/index.js +10 -6
  196. package/dist/daemon/index.js.map +1 -1
  197. package/dist/daemon/launchProfiles.d.ts +5 -0
  198. package/dist/daemon/launchProfiles.js +42 -40
  199. package/dist/daemon/launchProfiles.js.map +1 -1
  200. package/dist/daemon/liveness.d.ts +1 -1
  201. package/dist/daemon/liveness.js +2 -2
  202. package/dist/daemon/liveness.js.map +1 -1
  203. package/dist/daemon/nudgeScheduler.d.ts +21 -0
  204. package/dist/daemon/nudgeScheduler.js +61 -0
  205. package/dist/daemon/nudgeScheduler.js.map +1 -0
  206. package/dist/daemon/paths.d.ts +22 -16
  207. package/dist/daemon/paths.js +137 -49
  208. package/dist/daemon/paths.js.map +1 -1
  209. package/dist/daemon/restartHold.d.ts +16 -0
  210. package/dist/daemon/restartHold.js +126 -0
  211. package/dist/daemon/restartHold.js.map +1 -0
  212. package/dist/daemon/restartSource.d.ts +7 -0
  213. package/dist/daemon/restartSource.js +89 -0
  214. package/dist/daemon/restartSource.js.map +1 -0
  215. package/dist/daemon/screenshot.d.ts +4 -1
  216. package/dist/daemon/screenshot.js +45 -7
  217. package/dist/daemon/screenshot.js.map +1 -1
  218. package/dist/daemon/server.d.ts +71 -13
  219. package/dist/daemon/server.js +1601 -296
  220. package/dist/daemon/server.js.map +1 -1
  221. package/dist/daemon/sessionFeed.js +4 -1
  222. package/dist/daemon/sessionFeed.js.map +1 -1
  223. package/dist/mcp/config.js +2 -1
  224. package/dist/mcp/config.js.map +1 -1
  225. package/dist/mcp/index.js +12 -2
  226. package/dist/mcp/index.js.map +1 -1
  227. package/dist/mcp/tools.d.ts +21 -1
  228. package/dist/mcp/tools.js +213 -28
  229. package/dist/mcp/tools.js.map +1 -1
  230. package/dist/viewer/dashboard-folders.js +7 -1
  231. package/dist/viewer/dashboard-layout.js +6 -52
  232. package/dist/viewer/dashboard.css +20 -4
  233. package/dist/viewer/dashboard.html +12 -3
  234. package/dist/viewer/dashboard.js +550 -378
  235. package/dist/viewer/pane.js +744 -136
  236. package/dist/viewer/viewer.css +1 -1
  237. package/dist/viewer/viewer.js +3 -1
  238. package/package.json +1 -1
package/README.md CHANGED
@@ -29,9 +29,9 @@ ShellPuppet is the open-source terminal layer of **Intermeld**, the agent
29
29
  governance platform by [Red Eagle Tech](https://redeagle.tech). Everything in
30
30
  this repository runs on your machine and needs nothing we operate.
31
31
 
32
- > **Status: 0.2.0, with the dashboard.** The daemon, CLI, MCP server, viewer
33
- > and dashboard install from npm (below). Watch the repository's Releases for what comes
34
- > next, and bring questions, ideas and what you build with it to
32
+ > **Status: 0.3.0, with several dashboard windows and messages between
33
+ > sessions.** The daemon, CLI, MCP server, viewer and dashboard install from
34
+ > npm (below). Watch the repository's Releases for what comes next, and bring questions, ideas and what you build with it to
35
35
  > [Discussions](https://github.com/intermeld/shellpuppet/discussions). 🦅
36
36
 
37
37
  ## What you get
@@ -220,10 +220,13 @@ sandbox, because the browser is starting for the first time.
220
220
  Twelve tools appear once the server is wired in: `terminal_start`,
221
221
  `terminal_snapshot`, `terminal_type`, `terminal_key`, `terminal_wait`,
222
222
  `terminal_find`, `terminal_result`, `terminal_list`, `terminal_resize`,
223
- `terminal_screenshot`, `terminal_viewer_url` and `terminal_kill`.
223
+ `terminal_screenshot`, `terminal_viewer_url` and `terminal_kill`. When messages
224
+ between sessions are switched on, the `session_*` messaging tools join them
225
+ ([ADR-010](docs/decisions/ADR-010-messages-between-sessions.md)).
224
226
 
225
227
  | Tool | Prompt supervision |
226
228
  | --- | --- |
229
+ | `terminal_start` | Pass `waitReady: true` when starting an agent CLI to delegate work to. Returns ready, a question, exit or a timeout with the session still running. |
227
230
  | `terminal_wait` | `prompt: true` with no session or an array of ids waits for any prompt. `now: true` polls once. Both return compact details without a screen. |
228
231
  | `terminal_list` | `waitingOnly: true` returns only sessions waiting on a prompt. |
229
232
 
@@ -235,6 +238,15 @@ CLI forms are `shellpuppet wait --prompt [id ...] [--now]` and
235
238
  `shellpuppet list --waiting`. A wait with one string session id keeps its
236
239
  usual screen response.
237
240
 
241
+ `terminal_start` does not wait by default. With `waitReady: true` it uses the
242
+ resolved agent's known ready signals, or your `readyText`/`readyQuiet`
243
+ override. `readyTimeout` defaults to 30,000 ms and is capped at 300,000 ms.
244
+ A longer explicit wait needs a longer MCP client budget, including startup
245
+ overhead. A client that gives up may lose the answer; the session still exists
246
+ and `terminal_list` shows it. Shells and unknown programs
247
+ need an explicit condition. Dashboard launches and launch profiles never
248
+ wait. See the [MCP start reference](docs/reference/mcp.md) for the outcomes.
249
+
238
250
  The HTTP `GET /sessions/wait?prompt=true` response is compact, including on a
239
251
  timeout or an immediate `now=true` poll:
240
252
 
@@ -332,10 +344,34 @@ shellpuppet dashboard # the dashboard, in its own is
332
344
  shellpuppet desktop # start or reuse ShellPuppet's dashboard
333
345
  shellpuppet desktop --install # add or update your application shortcut
334
346
  shellpuppet desktop --uninstall # remove that shortcut
335
- shellpuppet daemon status|start|stop|restart # status and stop never start one
347
+ shellpuppet daemon status|start|stop|restart # manage the shared daemon
348
+ shellpuppet daemon stop --hold [seconds] # pause automatic starts (default 120 s)
336
349
  shellpuppet mcp
337
350
  ```
338
351
 
352
+ Use `shellpuppet start --wait-ready <agent-command>` when delegating work.
353
+ `--ready-timeout <ms>` changes the 60-second limit, up to 300 seconds.
354
+ `--ready-text` or `--ready-quiet` overrides the agent's signal and is required
355
+ for a program without one. The output names a question that needs answering,
356
+ reports an exit, or says whether the session is ready. A timeout leaves it
357
+ running. See the [CLI start reference](docs/reference/cli.md).
358
+
359
+ ### Restarting a shared daemon
360
+
361
+ Build first, then run `shellpuppet daemon restart` so other clients wait for
362
+ the replacement, including while the old daemon is stopping. A peer can wait
363
+ about 20 seconds for a direct restart or about 130 seconds when the restart
364
+ uses `startWith`. A failed wrapped start may add up to 15 seconds for cleanup,
365
+ so the caller's worst case is its fixed deadline plus 15 seconds, up to about
366
+ 145 seconds for a wrapped restart. The wait has a fixed deadline, and clients can resume starting
367
+ if the process performing the restart has gone. To stop before rebuilding, run `shellpuppet daemon stop
368
+ --hold`, rebuild, then run `shellpuppet daemon start`. The hold lasts 120
369
+ seconds by default (1 to 600 seconds with an explicit value), and `daemon
370
+ status` shows the time remaining. If `daemon restart` cannot read the daemon
371
+ record, wait about 15 seconds and run `daemon restart` again. If the record
372
+ is still missing, the daemon is usually stopped. Check that no ShellPuppet
373
+ daemon process is running before `daemon start`.
374
+
339
375
  On Windows, `start` uses `cmd.exe /d /s /c` by default. ShellPuppet joins the
340
376
  command and arguments with spaces; `cmd.exe` then parses that line. A value
341
377
  containing spaces needs quotes *inside the argument sent to ShellPuppet*. For
@@ -356,28 +392,56 @@ arguments to an `.exe` or `.com`, use `--no-shell`; the same choice is
356
392
  starts run directly by default; an explicit `shell: true` uses `/bin/sh -c`
357
393
  and its shell syntax.
358
394
 
359
- `shellpuppet dashboard` opens a window with a pane for every session in ShellPuppet's
360
- isolated browser profile and prints only whether a window opened. It never
395
+ `shellpuppet dashboard` opens a dashboard window in ShellPuppet's
396
+ isolated browser profile and prints only whether a window opened. The first
397
+ window receives existing sessions; later windows open empty. It never
361
398
  prints the link, and it never uses your default browser: if the isolated
362
399
  window cannot open, the command fails rather than hand the grant to a profile
363
400
  with extensions.
364
401
 
365
- To share sessions across screens, use **Open on screen** in the dashboard
366
- toolbar, or open another dashboard window and move it yourself. Each session
367
- appears in one window. Windows fill their readable grid capacity in order;
368
- when every window is full, extra sessions are shared according to each
369
- window's capacity. The toolbar shows the number of sessions in this window
370
- and the number of sharing windows. The screen buttons follow windows moved
371
- between screens. Closing a window returns its sessions to the others. Auto fit
372
- refits a session in the window that receives it.
402
+ Use **New window** to open an empty dashboard window and move it to another
403
+ screen if you wish. Drag a pane title into another window to move that session;
404
+ drop it on a pane to insert there, or elsewhere to append. **Pop out** opens
405
+ an ordinary new dashboard window with the pane. **New sessions here** marks
406
+ the one window that receives sessions started by agents or the CLI. A window's
407
+ own launcher starts its session there. When the designated window closes, the
408
+ most recently focused remaining window takes over. Closing any window moves
409
+ its panes to a remaining window. Auto fit refits a moved session there.
410
+
411
+ Auto fit sizes each terminal to its pane. If 80 by 24 cells cannot fit at your
412
+ chosen text size, the pane keeps exactly 80 by 24 cells and shows the whole
413
+ screen with smaller text. All visible panes below that floor in a window use
414
+ the same text size, chosen to fit the smallest space. The header keeps its
415
+ "Below 80×24 floor" note. Larger panes, such as the main pane in Focus, keep
416
+ their own fit. Text is measured afresh after each change, and returns to your
417
+ chosen size when there is room. Smaller, Larger and a remembered text size do
418
+ not prevent this temporary reduction.
419
+
420
+ Loading a font or changing display scale also refreshes the fit. With Auto fit
421
+ on, visible unheld panes, including the Focus main pane, refit their grids to
422
+ their own space unless they are following another client. This never pulls
423
+ the Focus main pane down to the shared floor. With Auto fit off, grids stay
424
+ unchanged. A grid below its column and row limits shows text no larger than
425
+ the remembered size, shrinking only as needed to show the whole screen, and
426
+ returns to that size when it fits again. A grid at its column or row limit can
427
+ still use larger text to fill its pane. The saved text choice stays unchanged.
428
+ Right-click menus stay under the pointer even at the smallest text sizes.
429
+
430
+ A held session keeps its grid. As soon as you take a session in another window
431
+ or viewer, the dashboard follows that grid until you press Fit, Enlarge or
432
+ drag that pane's track with Auto fit on. These panes show
433
+ their whole screen at the shared text size when it fits, or smaller text when
434
+ their grid needs it. They may therefore look smaller beside the 80 by 24 panes.
435
+ Wheel scrolling and the history scrollbar remain usable at the reduced size.
373
436
 
374
437
  In Focus, drag the boundary between the large pane and its strip. In Grid,
375
438
  drag a boundary between columns or rows. Focus a boundary and use the arrow
376
439
  keys for small steps, Shift with an arrow for larger steps, or Home to reset
377
440
  that direction. A drag stops at the readable pane size, or at the strip's
378
441
  minimum width. On release, a pane that grew fits its real terminal, respecting
379
- Auto fit's rules when it is on; one that shrank keeps its grid and scales or
380
- scrolls. With Auto fit off, release keeps the real terminal size until Fit is
442
+ Auto fit's rules when it is on. A pane that shrank below the floor also fits
443
+ to 80 by 24; one still above it keeps its grid and scales its text.
444
+ With Auto fit off, release keeps the real terminal size until Fit is
381
445
  pressed. The boundary announces its position in pixels. Sizes stay
382
446
  in this window for the session and survive a reload. Choose Auto or Grid
383
447
  again to reset them.
@@ -424,7 +488,8 @@ still opens a new isolated window on every call.
424
488
 
425
489
  One per-user **daemon** owns every PTY and serves the browser viewer, on
426
490
  loopback only, with a token on every request bar `/health`, the viewer page
427
- and its static assets. The MCP server and the CLI start the daemon if it isn't
491
+ and its static assets. `/health` reveals only ok, version, pid and the daemon
492
+ instance id. The MCP server and the CLI start the daemon if it isn't
428
493
  running. Every CLI verb is a one-shot HTTP client that returns promptly,
429
494
  except `mcp`, which stays up for the stdio transport, and `wait`, which blocks
430
495
  until its condition holds or its timeout runs out (300 s at most). Because
@@ -0,0 +1,2 @@
1
+ import type { AgentModule } from '../types.js';
2
+ export declare const agy: AgentModule;
@@ -0,0 +1,11 @@
1
+ import { reading } from './reading.js';
2
+ import { prompts } from '../qoder/prompts.js';
3
+ import { readiness } from './nudge.js';
4
+ import { submittingText } from '../input.js';
5
+ export const agy = {
6
+ name: reading.name, programs: reading.programs, reading, prompts,
7
+ input: { submit: { key: '\r', delayMs: 150, matches: submittingText } },
8
+ nudge: { readiness },
9
+ readiness: { readyText: ['? for shortcuts'] },
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/agy/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,GAAG,GAAgB;IAC9B,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO;IAChE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE;IACvE,KAAK,EAAE,EAAE,SAAS,EAAE;IACpB,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,iBAAiB,CAAC,EAAE;CAC9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { NudgeReadiness, NudgeView } from '../types.js';
2
+ export declare function readiness(view: NudgeView): NudgeReadiness;
@@ -0,0 +1,29 @@
1
+ import { bodyStyles, onlyBlankRowsAfter, readingReadiness } from '../nudgeReading.js';
2
+ import { reading } from './reading.js';
3
+ const PLACEHOLDER = 'Auto mode: edits & safe commands auto-approved (shift+tab to cycle)';
4
+ function placeholderInk(line) {
5
+ const body = bodyStyles(line);
6
+ return body.length > 0 && body.every((style) => style.fg === 'p8');
7
+ }
8
+ export function readiness(view) {
9
+ let composer = -1;
10
+ for (let i = view.rows.length - 1; i >= 0; i--) {
11
+ if (/^>/u.test(view.rows[i] ?? '')) {
12
+ composer = i;
13
+ break;
14
+ }
15
+ }
16
+ if (composer < 1 || !/^\s*[─━]{10,}/u.test(view.rows[composer - 1] ?? '') ||
17
+ !/^\s*[─━]{10,}/u.test(view.rows[composer + 1] ?? ''))
18
+ return 'unknown';
19
+ const footer = view.rows[composer + 2] ?? '';
20
+ if (!(/^(?:\? for shortcuts\b|\s+auto · \S)/u.test(footer)) ||
21
+ !onlyBlankRowsAfter(view.rows, composer + 2))
22
+ return 'unknown';
23
+ return readingReadiness(view, reading, {
24
+ placeholder: PLACEHOLDER,
25
+ continuations: true,
26
+ placeholderInk,
27
+ });
28
+ }
29
+ //# sourceMappingURL=nudge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nudge.js","sourceRoot":"","sources":["../../../src/agents/agy/nudge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,GAAG,qEAAqE,CAAC;AAE1F,SAAS,cAAc,CAAC,IAAgB;IACtC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAe;IACvC,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YAAC,QAAQ,GAAG,CAAC,CAAC;YAAC,MAAM;QAAC,CAAC;IAC9D,CAAC;IACD,IAAI,QAAQ,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACvE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,IAAI,CAAC,CAAC,uCAAuC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACjE,OAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;QACrC,WAAW,EAAE,WAAW;QACxB,aAAa,EAAE,IAAI;QACnB,cAAc;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AgentSignature } from '../../core/reasoning.js';
2
+ export declare const reading: AgentSignature;
@@ -0,0 +1,28 @@
1
+ const RULE_INDENTED = '^\\s*[─━]{10,}';
2
+ export const reading = {
3
+ // Antigravity CLI 1.4.10. A summary of
4
+ // the model's reasoning stays on screen as one line, "○ Thought for 4.2s
5
+ // (Create the file, then…)"; while it works, the spinner's label is the
6
+ // subject of what it is thinking about. "▸ Thought for 5s, 228 tokens"
7
+ // carries no text. Tool calls are a green "●"; the answer is plain text
8
+ // indented two spaces. While a turn runs, "esc to cancel" is under the
9
+ // composer.
10
+ name: 'agy',
11
+ programs: ['agy', 'antigravity'],
12
+ measured: 'Antigravity CLI 1.4.10',
13
+ composer: { text: '^>' },
14
+ chrome: [{ text: RULE_INDENTED }, { text: '^[⠀-⣿] {2}' }, { text: '^└ ' }],
15
+ frame: { text: RULE_INDENTED },
16
+ busy: [{ text: '^[⠀-⣿] {2}\\S' }, { text: '^esc to cancel' }],
17
+ turn: { text: '^> \\S' },
18
+ reasoning: [
19
+ { start: { text: '^○ Thought for ' } },
20
+ { start: { text: '^[⠀-⣿] {2}\\S' } },
21
+ ],
22
+ answer: {
23
+ start: { text: '^ {2}\\S', lead: { fg: ['default', '#ffffff', '#000000', 'p7', 'p15'] } },
24
+ continues: { text: '^ {2}\\S', lead: { fg: ['default', '#ffffff', '#000000', 'p7', 'p15'] } },
25
+ upward: true,
26
+ },
27
+ };
28
+ //# sourceMappingURL=reading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reading.js","sourceRoot":"","sources":["../../../src/agents/agy/reading.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,MAAM,CAAC,MAAM,OAAO,GAAmB;IACrC,uCAAuC;IACvC,yEAAyE;IACzE,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IACxE,uEAAuE;IACvE,YAAY;IACZ,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC;IAChC,QAAQ,EAAE,wBAAwB;IAClC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;IACxB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC1E,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;IAC9B,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;IAC7D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,SAAS,EAAE;QACT,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE;QACtC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE;KACrC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QACzF,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QAC7F,MAAM,EAAE,IAAI;KACb;CACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { AgentSignature } from '../core/reasoning.js';
2
+ import type { NudgeView } from './types.js';
3
+ /** The last bar foot and its aligned gutter in a single viewport. */
4
+ export declare function barFrame(view: NudgeView): {
5
+ foot: number;
6
+ gutter: string;
7
+ end: number;
8
+ } | null;
9
+ export declare function barIsBusy(view: NudgeView, reading: AgentSignature): boolean;
@@ -0,0 +1,21 @@
1
+ /** The last bar foot and its aligned gutter in a single viewport. */
2
+ export function barFrame(view) {
3
+ if (view.styled !== undefined && (view.styled.length !== view.rows.length ||
4
+ view.styled.some((line, index) => line.text !== view.rows[index])))
5
+ return null;
6
+ for (let i = view.rows.length - 1; i >= 0; i--) {
7
+ const match = /^( *)╹▀{8,}/u.exec(view.rows[i]);
8
+ if (match !== null)
9
+ return i < 4 ? null : { foot: i, gutter: match[1] + '┃', end: match[0].length };
10
+ }
11
+ return null;
12
+ }
13
+ export function barIsBusy(view, reading) {
14
+ return (reading.busy ?? []).some(test => {
15
+ if (test.text === undefined)
16
+ return false;
17
+ const marker = new RegExp(test.text, 'u');
18
+ return view.rows.some(row => marker.test(row));
19
+ });
20
+ }
21
+ //# sourceMappingURL=barNudge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barNudge.js","sourceRoot":"","sources":["../../src/agents/barNudge.ts"],"names":[],"mappings":"AAGA,qEAAqE;AACrE,MAAM,UAAU,QAAQ,CAAC,IAAe;IACtC,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM;QACvE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAClF,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CAAC;QACjD,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACtG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAe,EAAE,OAAuB;IAChE,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACtC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAC1C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AgentModule } from '../types.js';
2
+ export declare const claude: AgentModule;
@@ -0,0 +1,31 @@
1
+ import { readiness as nudgeReadiness } from './nudge.js';
2
+ import { prompts } from './prompts.js';
3
+ import { reading } from './reading.js';
4
+ import { submittingText } from '../input.js';
5
+ export const claude = {
6
+ name: reading.name, programs: reading.programs, reading, prompts,
7
+ input: { submit: { key: '\r', delayMs: 150, matches: submittingText } },
8
+ readiness: { readyText: ['? for shortcuts', 'shift+tab'] },
9
+ nudge: { readiness: nudgeReadiness },
10
+ resumeIdMarkers: ['CLAUDE_CODE_SESSION_ID'],
11
+ env: {
12
+ // Claude Code child-session variables: https://code.claude.com/docs/en/env-vars.
13
+ sessionMarkers: [
14
+ 'CLAUDECODE',
15
+ 'CLAUDE_CODE_ENTRYPOINT',
16
+ 'CLAUDE_CODE_SESSION_ID',
17
+ 'CLAUDE_CODE_CHILD_SESSION',
18
+ 'CLAUDE_CODE_MESSAGING_SOCKET',
19
+ 'CLAUDE_CODE_MESSAGING_TOKEN',
20
+ 'CLAUDE_CODE_SESSION_ATTENDED',
21
+ 'CLAUDE_CODE_SSE_PORT', // IDE session
22
+ 'CLAUDE_CODE_EXECPATH',
23
+ 'CLAUDE_CODE_BRIDGE_SESSION_ID',
24
+ 'CLAUDE_CODE_REMOTE_SESSION_ID',
25
+ 'CLAUDE_CODE_REMOTE',
26
+ 'CLAUDE_JOB_DIR', // Background session
27
+ 'CLAUDE_PID',
28
+ ],
29
+ },
30
+ };
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/claude/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,MAAM,GAAgB;IACjC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO;IAChE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE;IACvE,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,iBAAiB,EAAE,WAAW,CAAC,EAAE;IAC1D,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE;IACpC,eAAe,EAAE,CAAC,wBAAwB,CAAC;IAC3C,GAAG,EAAE;QACH,iFAAiF;QACjF,cAAc,EAAE;YACd,YAAY;YACZ,wBAAwB;YACxB,wBAAwB;YACxB,2BAA2B;YAC3B,8BAA8B;YAC9B,6BAA6B;YAC7B,8BAA8B;YAC9B,sBAAsB,EAAE,cAAc;YACtC,sBAAsB;YACtB,+BAA+B;YAC/B,+BAA+B;YAC/B,oBAAoB;YACpB,gBAAgB,EAAE,qBAAqB;YACvC,YAAY;SACb;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { NudgeReadiness, NudgeView } from '../types.js';
2
+ export declare function readiness(view: NudgeView): NudgeReadiness;
@@ -0,0 +1,38 @@
1
+ import { bodyStyles, readingReadiness } from '../nudgeReading.js';
2
+ import { reading } from './reading.js';
3
+ /** Claude Code draws the rules above and below its composer in this grey. */
4
+ const RULE_INK = '#888888';
5
+ /**
6
+ * Claude Code's status line: a Claude model family and version, its effort when
7
+ * shown, a ten-cell context bar and a percentage.
8
+ */
9
+ const CLAUDE_MODEL_LINE = /^ {2}(?:Opus|Sonnet|Haiku|Mythos|Fable) \d+(?:\.\d+)?(?: \(1M context\))?(?: (?:low|medium|high|xhigh|max))? [█░]{10} \d{1,3}%$/u;
10
+ /** Claude Code's mode line under its status line, in its own wording. */
11
+ const CLAUDE_MODE_LINE = /^ {2}(?:(?:⏵⏵ (?:auto mode on|accept edits on|bypass permissions on)|⏸ plan mode on)(?: \(shift\+tab to cycle\))?(?: · (?:\d+ shells?|esc to interrupt|↓ to manage))*|\? for shortcuts)$/u;
12
+ /** Dim placeholder recorded on an idle Claude Code composer. */
13
+ const PLACEHOLDER = 'Try "write a test for <filepath>"';
14
+ function placeholderInk(line) {
15
+ const body = bodyStyles(line);
16
+ return body.length > 0 && body.every((style) => style.dim);
17
+ }
18
+ export function readiness(view) {
19
+ return readingReadiness(view, reading, {
20
+ placeholder: PLACEHOLDER,
21
+ continuations: true,
22
+ placeholderInk,
23
+ // Claude Code also offers a suggested next prompt in the same dim ink; typed text is never dim.
24
+ anyHintInPlaceholderInk: true,
25
+ // Enter during a running turn queues the line; the turn reads it at its next step.
26
+ queueWhileBusy: true,
27
+ // Under the lower rule Claude Code paints exactly its model line, ending in its
28
+ // context bar and percentage, then at most one mode line in its own wording.
29
+ // Anything else there, a panel or a choice, blocks a queued nudge.
30
+ queueFooter: (rows) => rows.length >= 1 && rows.length <= 2 &&
31
+ CLAUDE_MODEL_LINE.test(rows[0].text.trimEnd()) &&
32
+ (rows.length === 1 || CLAUDE_MODE_LINE.test(rows[1].text.trimEnd())),
33
+ // The rule above the composer may carry the session's title in the same grey.
34
+ ruleRows: [/^─{10,}$/u, /^─{10,} \S(?:.*\S)? ─{1,}$/u],
35
+ ruleInk: (line) => line.spans.length > 0 && line.spans.every((span) => span.fg === RULE_INK && !span.dim),
36
+ });
37
+ }
38
+ //# sourceMappingURL=nudge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nudge.js","sourceRoot":"","sources":["../../../src/agents/claude/nudge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,SAAS,CAAC;AAE3B;;;GAGG;AACH,MAAM,iBAAiB,GAAG,kIAAkI,CAAC;AAE7J,yEAAyE;AACzE,MAAM,gBAAgB,GAAG,2LAA2L,CAAC;AAErN,gEAAgE;AAChE,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAExD,SAAS,cAAc,CAAC,IAAgB;IACtC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAe;IACvC,OAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;QACrC,WAAW,EAAE,WAAW;QACxB,aAAa,EAAE,IAAI;QACnB,cAAc;QACd,gGAAgG;QAChG,uBAAuB,EAAE,IAAI;QAC7B,mFAAmF;QACnF,cAAc,EAAE,IAAI;QACpB,gFAAgF;QAChF,6EAA6E;QAC7E,mEAAmE;QACnE,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;YACzD,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAC/C,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,8EAA8E;QAC9E,QAAQ,EAAE,CAAC,WAAW,EAAE,6BAA6B,CAAC;QACtD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;KAC1G,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { PromptShape } from '../types.js';
2
+ /**
3
+ * A pointer against plain text: `❯ npm`, `> minimal`. It is the
4
+ * inquirer.js shape, and Claude Code's own folder-trust prompt. Captures
5
+ * indent, pointer and text. `›` is deliberately absent: Codex draws it on
6
+ * its composer line, and every `›` chooser seen so far numbers its rows.
7
+ */
8
+ export declare const pointerRows: PromptShape;
9
+ export declare const prompts: PromptShape[];
@@ -0,0 +1,16 @@
1
+ import { enterFooter } from '../codex/prompts.js';
2
+ /**
3
+ * A pointer against plain text: `❯ npm`, `> minimal`. It is the
4
+ * inquirer.js shape, and Claude Code's own folder-trust prompt. Captures
5
+ * indent, pointer and text. `›` is deliberately absent: Codex draws it on
6
+ * its composer line, and every `›` chooser seen so far numbers its rows.
7
+ */
8
+ export const pointerRows = { kind: 'rows', pointer: /^(\s*)([❯>])\s+(\S.*)$/ };
9
+ export const prompts = [pointerRows, enterFooter, {
10
+ kind: 'rows',
11
+ numbered: /^\s*(?:│\s*)?❯\s*(\d+)\.\s+\S/,
12
+ marker: /❯/,
13
+ // Every spinner verb ends in an ellipsis; a completed turn does not.
14
+ busy: /^\s*[·✢✳✶✻✽*] [^…]+…(?: \(.*\))?\s*$/i,
15
+ }];
16
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/agents/claude/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAE5F,MAAM,CAAC,MAAM,OAAO,GAAkB,CAAC,WAAW,EAAE,WAAW,EAAE;QAC/D,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,+BAA+B;QACzC,MAAM,EAAE,GAAG;QACX,qEAAqE;QACrE,IAAI,EAAE,uCAAuC;KAC9C,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AgentSignature } from '../../core/reasoning.js';
2
+ export declare const reading: AgentSignature;
@@ -0,0 +1,25 @@
1
+ const RULE = '^[─━]{10,}$';
2
+ export const reading = {
3
+ // Claude Code 2.1.312, default view and the ctrl+o transcript: no
4
+ // reasoning text is drawn in either, only a spinner line while the model
5
+ // thinks ("✻ Pondering… (2s · thinking with xhigh effort)"). The answer
6
+ // is a `●` in the text colour; tool calls get a grey or coloured `●`.
7
+ name: 'claude',
8
+ programs: ['claude'],
9
+ measured: 'Claude Code 2.1.312',
10
+ // The composer's prompt glyph is followed by a non-breaking space once
11
+ // something is typed; the echo of a sent prompt by an ordinary one.
12
+ composer: { text: '^❯( |\\xa0|$)' },
13
+ typed: { text: '^❯[ \\xa0]\\S', word: { dim: false } },
14
+ chrome: [{ text: RULE }, { text: '/effort\\s*$' }],
15
+ frame: { text: RULE },
16
+ busy: [{ text: '^[✻✽✶✢✳·*] \\S+…' }],
17
+ turn: { text: '^❯ \\S' },
18
+ answer: {
19
+ start: { text: '^● ', lead: { fg: ['default', '#ffffff', '#000000'] } },
20
+ continues: { text: '^ {2}' },
21
+ },
22
+ trailer: { text: '^✻ \\S' },
23
+ requireTrailer: true,
24
+ };
25
+ //# sourceMappingURL=reading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reading.js","sourceRoot":"","sources":["../../../src/agents/claude/reading.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAG,aAAa,CAAC;AAE3B,MAAM,CAAC,MAAM,OAAO,GAAmB;IACrC,kEAAkE;IAClE,yEAAyE;IACzE,wEAAwE;IACxE,sEAAsE;IACtE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,QAAQ,EAAE,qBAAqB;IAC/B,uEAAuE;IACvE,oEAAoE;IACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;IACnC,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IACtD,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IAClD,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;IACrB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IACpC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,EAAE;QACvE,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;KAC7B;IACD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC3B,cAAc,EAAE,IAAI;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AgentModule } from '../types.js';
2
+ export declare const codex: AgentModule;
@@ -0,0 +1,28 @@
1
+ import { readiness as nudgeReadiness } from './nudge.js';
2
+ import { prompts } from './prompts.js';
3
+ import { reading } from './reading.js';
4
+ import { submittingText } from '../input.js';
5
+ export const codex = {
6
+ name: reading.name, programs: reading.programs, reading, prompts,
7
+ input: { submit: { key: '\r', delayMs: 150, perCharacterMs: 3,
8
+ quietMs: 350, settleMs: 800, maxWaitMs: 5_000,
9
+ pastePlaceholder: /^› (\[Pasted Content (?<chars>\d+(?:,\d{3})*) chars\])\s*$/u,
10
+ matches: submittingText } },
11
+ readiness: { readyText: ['Ask Codex'] },
12
+ nudge: { readiness: nudgeReadiness },
13
+ resumeIdMarkers: ['CODEX_THREAD_ID', 'CODEX_SESSION_ID'],
14
+ env: {
15
+ // Codex child-session variables: codex-rs/protocol/src/shell_environment.rs,
16
+ // codex-rs/core/src/exec_env.rs and codex-rs/core/src/spawn.rs.
17
+ sessionMarkers: [
18
+ 'CODEX_THREAD_ID',
19
+ 'CODEX_SESSION_ID',
20
+ 'CODEX_TOOL_CALL_ID',
21
+ 'CODEX_VERSION',
22
+ 'CODEX_PERMISSION_PROFILE',
23
+ 'CODEX_SANDBOX',
24
+ 'CODEX_SANDBOX_NETWORK_DISABLED',
25
+ ],
26
+ },
27
+ };
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/codex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,KAAK,GAAgB;IAChC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO;IAChE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC;YAC3D,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK;YAC7C,gBAAgB,EAAE,6DAA6D;YAC/E,OAAO,EAAE,cAAc,EAAE,EAAE;IAC7B,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE;IACvC,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE;IACpC,eAAe,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IACxD,GAAG,EAAE;QACH,6EAA6E;QAC7E,gEAAgE;QAChE,cAAc,EAAE;YACd,iBAAiB;YACjB,kBAAkB;YAClB,oBAAoB;YACpB,eAAe;YACf,0BAA0B;YAC1B,eAAe;YACf,gCAAgC;SACjC;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { NudgeReadiness, NudgeView } from '../types.js';
2
+ export declare function readiness(view: NudgeView): NudgeReadiness;
@@ -0,0 +1,35 @@
1
+ import { bodyStyles, readingReadiness } from '../nudgeReading.js';
2
+ import { reading } from './reading.js';
3
+ /** Dim placeholder on an idle Codex composer. The status row under it is not text. */
4
+ const PLACEHOLDER = 'Ask Codex to do anything';
5
+ /**
6
+ * Footer under the composer on every captured Codex screen: the model and
7
+ * context line, then `? for shortcuts`. No capture shows a frame around a
8
+ * second composer row, so any other text under the composer is unknown.
9
+ */
10
+ const MODEL_STATUS = /^ {2}GPT-\S+ high\s+·\s+Context \d+% left\s+·\s+weekly \d+% left\b/u;
11
+ const SHORTCUTS = /^\s*(?:← for agents\s+·\s+)?\? for shortcuts\s*$/u;
12
+ /**
13
+ * A status-shaped row is the footer only when nothing but blank rows and the
14
+ * shortcuts hint follows it. Draft text shaped like the status row has more
15
+ * text, or the real footer, below it, so it stays part of the composer.
16
+ */
17
+ function isFooter(line, below) {
18
+ if (!SHORTCUTS.test(line.text) && !MODEL_STATUS.test(line.text))
19
+ return false;
20
+ return below.every((row) => row.text.trim() === '' || SHORTCUTS.test(row.text));
21
+ }
22
+ function placeholderInk(line) {
23
+ const body = bodyStyles(line);
24
+ return body.length > 0 && body.every((style) => style.dim);
25
+ }
26
+ export function readiness(view) {
27
+ return readingReadiness(view, reading, {
28
+ placeholder: PLACEHOLDER,
29
+ continuations: true,
30
+ placeholderInk,
31
+ unprovenContinuations: true,
32
+ status: isFooter,
33
+ });
34
+ }
35
+ //# sourceMappingURL=nudge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nudge.js","sourceRoot":"","sources":["../../../src/agents/codex/nudge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,sFAAsF;AACtF,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C;;;;GAIG;AACH,MAAM,YAAY,GAAG,qEAAqE,CAAC;AAC3F,MAAM,SAAS,GAAG,mDAAmD,CAAC;AAEtE;;;;GAIG;AACH,SAAS,QAAQ,CAAC,IAAgB,EAAE,KAA4B;IAC9D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9E,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,SAAS,cAAc,CAAC,IAAgB;IACtC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAe;IACvC,OAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE;QACrC,WAAW,EAAE,WAAW;QACxB,aAAa,EAAE,IAAI;QACnB,cAAc;QACd,qBAAqB,EAAE,IAAI;QAC3B,MAAM,EAAE,QAAQ;KACjB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { PromptShape } from '../types.js';
2
+ /**
3
+ * `Press enter to continue` / `…to confirm or esc to cancel`: the footer
4
+ * both Codex prompt classes draw, and a wait state in its own right on the
5
+ * onboarding screens that have no option list at all. `Enter to confirm ·
6
+ * Esc to cancel`, without "press", is Claude Code's.
7
+ */
8
+ export declare const enterFooter: PromptShape;
9
+ export declare const prompts: PromptShape[];
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `Press enter to continue` / `…to confirm or esc to cancel`: the footer
3
+ * both Codex prompt classes draw, and a wait state in its own right on the
4
+ * onboarding screens that have no option list at all. `Enter to confirm ·
5
+ * Esc to cancel`, without "press", is Claude Code's.
6
+ */
7
+ export const enterFooter = { kind: 'rows', footer: /(?:press\s+)?\benter to (confirm|continue|select)/i };
8
+ export const prompts = [enterFooter, {
9
+ kind: 'rows',
10
+ // The sign-in marker can sit against the digit without a space.
11
+ numbered: /^\s*(?:│\s*)?›\s*(\d+)\.\s+\S/,
12
+ marker: /›/,
13
+ }];
14
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/agents/codex/prompts.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,oDAAoD,EAAE,CAAC;AAEvH,MAAM,CAAC,MAAM,OAAO,GAAkB,CAAC,WAAW,EAAE;QAClD,IAAI,EAAE,MAAM;QACZ,gEAAgE;QAChE,QAAQ,EAAE,+BAA+B;QACzC,MAAM,EAAE,GAAG;KACZ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AgentSignature } from '../../core/reasoning.js';
2
+ export declare const reading: AgentSignature;
@@ -0,0 +1,22 @@
1
+ export const reading = {
2
+ // Codex CLI 0.165.0, default view. The answer is
3
+ // a dim "•" with plain text after it; a tool group is a dim "•" with a
4
+ // bold heading ("Explored"), a command a bold green "•" ("Ran"). While a
5
+ // turn runs, "Working (Ns • esc to interrupt)" sits above the composer.
6
+ name: 'codex',
7
+ programs: ['codex'],
8
+ measured: 'Codex CLI 0.165.0',
9
+ composer: { text: '^› ' },
10
+ // The placeholder ("Ask Codex to do anything") is dim; typed text is not.
11
+ typed: { text: '^› \\S', word: { dim: false } },
12
+ chrome: [{ text: 'esc to interrupt' }],
13
+ busy: [{ text: 'esc to interrupt' }],
14
+ turn: { text: '^› \\S' },
15
+ answer: {
16
+ start: { text: '^• ', lead: { dim: true }, word: { bold: false, italic: false } },
17
+ continues: { text: '^ {2}(?!Worked for )[^\\s└]' },
18
+ },
19
+ trailer: { text: '^ {2}Worked for ' },
20
+ requireTrailer: true,
21
+ };
22
+ //# sourceMappingURL=reading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reading.js","sourceRoot":"","sources":["../../../src/agents/codex/reading.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAmB;IACrC,iDAAiD;IACjD,uEAAuE;IACvE,yEAAyE;IACzE,wEAAwE;IACxE,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,CAAC,OAAO,CAAC;IACnB,QAAQ,EAAE,mBAAmB;IAC7B,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACzB,0EAA0E;IAC1E,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IAC/C,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IACtC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IACpC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;QACjF,SAAS,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE;KACnD;IACD,OAAO,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACrC,cAAc,EAAE,IAAI;CACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { AgentModule } from '../types.js';
2
+ /** Shared prompt shapes and an inert reading for unmatched programs. */
3
+ export declare const generic: AgentModule;
@@ -0,0 +1,9 @@
1
+ import { prompts } from './prompts.js';
2
+ import { submittingText } from '../input.js';
3
+ /** Shared prompt shapes and an inert reading for unmatched programs. */
4
+ export const generic = {
5
+ name: 'generic', programs: [], prompts,
6
+ input: { submit: { key: '\r', delayMs: 150, matches: submittingText } },
7
+ reading: { name: 'generic', programs: [], composer: { text: '(?!)' }, answer: { start: { text: '(?!)' } } },
8
+ };
9
+ //# sourceMappingURL=index.js.map