@aragon-agent/cli 0.6.31 → 0.6.33

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 (95) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/README.md +2970 -2826
  3. package/dist/agent/controller.d.ts +46 -0
  4. package/dist/agent/controller.js +175 -7
  5. package/dist/agent/job-notices.d.ts +143 -0
  6. package/dist/agent/job-notices.js +182 -0
  7. package/dist/agent/reducer.d.ts +21 -1
  8. package/dist/agent/reducer.js +7 -0
  9. package/dist/agent/system-prompt.d.ts +12 -0
  10. package/dist/agent/system-prompt.js +2 -0
  11. package/dist/cli.js +236 -8
  12. package/dist/commands/builtins.js +23 -8
  13. package/dist/commands/perf.d.ts +77 -1
  14. package/dist/commands/perf.js +37 -5
  15. package/dist/config/cli-commands.d.ts +27 -0
  16. package/dist/config/cli-commands.js +54 -1
  17. package/dist/config/env.js +38 -0
  18. package/dist/config/load.js +50 -1
  19. package/dist/config/schema.d.ts +73 -0
  20. package/dist/config/schema.js +34 -0
  21. package/dist/config/store.js +14 -1
  22. package/dist/exec/events.d.ts +29 -3
  23. package/dist/exec/events.js +3 -12
  24. package/dist/exec/runner.d.ts +24 -0
  25. package/dist/exec/runner.js +79 -0
  26. package/dist/input/cursor-report.d.ts +61 -0
  27. package/dist/input/cursor-report.js +97 -0
  28. package/dist/input/stdin-filter.d.ts +22 -0
  29. package/dist/input/stdin-filter.js +48 -3
  30. package/dist/proc/limits.d.ts +76 -2
  31. package/dist/proc/limits.js +83 -2
  32. package/dist/proc/log-mirror.d.ts +59 -0
  33. package/dist/proc/log-mirror.js +203 -0
  34. package/dist/proc/log-ring.d.ts +22 -0
  35. package/dist/proc/log-ring.js +20 -1
  36. package/dist/proc/notices.d.ts +57 -0
  37. package/dist/proc/notices.js +101 -0
  38. package/dist/proc/progress.d.ts +40 -0
  39. package/dist/proc/progress.js +135 -0
  40. package/dist/proc/prompt.d.ts +24 -2
  41. package/dist/proc/prompt.js +51 -2
  42. package/dist/proc/supervisor.d.ts +35 -2
  43. package/dist/proc/supervisor.js +142 -43
  44. package/dist/proc/types.d.ts +89 -1
  45. package/dist/proc/wait.d.ts +57 -0
  46. package/dist/proc/wait.js +133 -0
  47. package/dist/session/persist.js +3 -1
  48. package/dist/session/validate-session.js +17 -0
  49. package/dist/tools/bash-tool.d.ts +12 -1
  50. package/dist/tools/bash-tool.js +100 -13
  51. package/dist/tools/index.d.ts +26 -2
  52. package/dist/tools/index.js +43 -2
  53. package/dist/tools/job-tools.d.ts +54 -0
  54. package/dist/tools/job-tools.js +329 -0
  55. package/dist/tools/proc-tools.d.ts +1 -1
  56. package/dist/tools/proc-tools.js +49 -17
  57. package/dist/ui/ActivityLine.js +7 -0
  58. package/dist/ui/App.js +98 -12
  59. package/dist/ui/ScrollbackShell.d.ts +62 -11
  60. package/dist/ui/ScrollbackShell.js +11 -3
  61. package/dist/ui/StatusBar.d.ts +5 -0
  62. package/dist/ui/StatusBar.js +1 -0
  63. package/dist/ui/Transcript.d.ts +14 -0
  64. package/dist/ui/Transcript.js +14 -2
  65. package/dist/ui/entries/ServiceCard.d.ts +17 -1
  66. package/dist/ui/entries/ServiceCard.js +39 -4
  67. package/dist/ui/layout/status-layout.d.ts +13 -1
  68. package/dist/ui/layout/status-layout.js +10 -0
  69. package/dist/ui/layout/virtual-window.js +14 -1
  70. package/dist/ui/run-status-row.d.ts +12 -0
  71. package/dist/ui/screen.d.ts +17 -4
  72. package/dist/ui/screen.js +14 -6
  73. package/dist/ui/scrollback/LiveTail.d.ts +79 -0
  74. package/dist/ui/scrollback/LiveTail.js +32 -0
  75. package/dist/ui/scrollback/band.d.ts +114 -0
  76. package/dist/ui/scrollback/band.js +130 -0
  77. package/dist/ui/scrollback/budget.d.ts +51 -10
  78. package/dist/ui/scrollback/budget.js +69 -20
  79. package/dist/ui/scrollback/canvas.d.ts +99 -0
  80. package/dist/ui/scrollback/canvas.js +113 -0
  81. package/dist/ui/scrollback/cursor-probe.d.ts +71 -0
  82. package/dist/ui/scrollback/cursor-probe.js +133 -0
  83. package/dist/ui/scrollback/limits.d.ts +61 -4
  84. package/dist/ui/scrollback/limits.js +61 -4
  85. package/dist/ui/scrollback/live-preview.d.ts +18 -10
  86. package/dist/ui/scrollback/live-preview.js +14 -11
  87. package/dist/ui/scrollback/scrollback-writer.d.ts +104 -16
  88. package/dist/ui/scrollback/scrollback-writer.js +368 -82
  89. package/dist/ui/scrollback/tail-window.d.ts +60 -0
  90. package/dist/ui/scrollback/tail-window.js +73 -0
  91. package/dist/ui/scrollback/use-scrollback-view.d.ts +34 -15
  92. package/dist/ui/scrollback/use-scrollback-view.js +110 -59
  93. package/dist/ui/scrollback/writer-shapes.d.ts +68 -2
  94. package/dist/ui/scrollback/writer-shapes.js +53 -8
  95. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -8,6 +8,30 @@ were written.
8
8
  ## Unreleased
9
9
 
10
10
  ### Added
11
+ - **Background jobs, and a bounded wait for them.** A command that finishes on its
12
+ own but takes far longer than one tool call - `python train.py`,
13
+ `huggingface-cli download`, `cargo build --release` - can now be started with
14
+ `bash({ command, background: true })` and comes back as a **`task`** (`t1`,
15
+ `t2`) rather than a `service`: it is `running` from the spawn instead of
16
+ spending its first minute as `starting`, and its first-frame result says so.
17
+ `job_wait({ job, timeoutSeconds?, since? })` blocks at most 60 seconds (default
18
+ `jobs.waitSeconds`, 30) and returns one status line, one extracted progress
19
+ line, at most six new output rows and a cursor - so waiting thirty seconds costs
20
+ one call instead of six `bash_output` polls, six model turns and six 200-row
21
+ tails. `job_list()` prints one line per job. Progress (`47%`, `epoch 3/10`,
22
+ `812/1000`, `1.2/3.4 GiB`) is extracted from the tail and not repeated while it
23
+ is unchanged; `[stalled]` reports silence with three options and kills nothing.
24
+ A job that ends while the model is busy produces a `<job_notices>` block at the
25
+ end of the next tool result, delivered exactly once even when the fast tier
26
+ clears the steering queue mid-run. Full output past the 200-row ring is mirrored
27
+ to `~/.aragon-agent/jobs/<session>/<id>.log`, and `bash_output`'s truncation
28
+ note names the path. New `jobs.*` section (5 keys, `aragon config set` and
29
+ `ARAGON_JOBS_*`), new `job` event and `background-jobs` capability in
30
+ `aragon exec`, and `/bg` now lists kind, elapsed and progress.
31
+ **Two defects fixed in passing:** a task that crashed within the settle window
32
+ was reported as still running (the guard tested `!== 'starting'` instead of
33
+ terminality), and a stopped job's result said "not ready yet - still coming
34
+ up". See [Background jobs and bounded waiting](README.md#background-jobs-and-bounded-waiting).
11
35
  - **`Ctrl+L` branches this session into a new terminal - and `Ctrl+R` now
12
36
  redraws (KEY BINDING CHANGE).** One keystroke opens a PowerShell (Windows) or
13
37
  bash (macOS/Linux) window in the session's current `/cwd`, running
@@ -97,6 +121,101 @@ were written.
97
121
 
98
122
  ### Fixed
99
123
 
124
+ - **The native-scroll screen is filled edge to edge, with no blank band anywhere.**
125
+ Three complaints, one cause: the live region was only as tall as the panel band
126
+ asked for, and every row it did not ask for became the canvas `gap` - blank rows
127
+ drawn *above* the content. So the app appeared to start halfway down the terminal,
128
+ a long blank band sat between a finished result and the card that was still running,
129
+ and the `TODO` rail stopped six rows or so above the input box. The region is now
130
+ the whole screen (`rows - 1`, the same height the full-screen layout uses): the
131
+ header is its first row, the input box and status line are its last two, the band
132
+ takes every row in between (`bandRows = pool`), so the rail spans the full height
133
+ above the composer and the tail column ends against it. The `gap` is 0 by
134
+ construction, not by tuning, and the scrollback writer is unchanged - `[gap][held]
135
+ [region]` collapses to `[region]` at that height. Two consequences worth knowing:
136
+ the region now shows the last ten entries of the conversation instead of only the
137
+ unfinished ones, and an entry is printed into your scrollback when it leaves that
138
+ window (so nothing is ever in both places at once); `/clear`, `--resume` and exit
139
+ flush the window first, which is why nothing visible is lost. The empty-session card
140
+ is drawn against the header rather than the input box, and `/perf` grew the three
141
+ numbers that make this self-checking: `top <n>` on the `mode native` line, plus
142
+ `pool=` and `window=<start>/<n>` on the `band:` line.
143
+ - **The TODO rail and the subagent roster are back in the default (native) scroll
144
+ mode.** Printing the conversation into the terminal's own scrollback took the two
145
+ panels with it: the rail lived in the full-screen layout's middle band and the
146
+ roster in the viewport footer, and neither of those exists once the live region
147
+ takes over - so a running plan showed nothing but a `Todo: 2/5` chip and a running
148
+ dispatch showed `Team: 2/4 running` in plain grey. The live region now owns a
149
+ PANEL BAND directly above the input box: the `TODO` rail (markers, index,
150
+ `activeForm`, overflow, gauge) is the band's right-hand column, the `team` roster
151
+ (header line, one row per subagent with activity and elapsed time, `+N more`, the
152
+ supervisor line) sits at its top left, and the unfinished tail below them is
153
+ rendered with the **real** entry components instead of the text projection - a
154
+ running `team` card and a running `tool` card now look exactly like the ones the
155
+ full-screen mode draws, gutter included. Row and column allocation has one owner
156
+ (`ui/scrollback/band.ts`), the printed conversation still uses the full width, and
157
+ the six ways a panel can be absent (`disabled`, `empty`, `narrow`, `short`,
158
+ `overlay`, a degraded frame) each name themselves in a new `/perf` `band:` line.
159
+ `aragon config set scrollMode app` renders byte-identically to before.
160
+ - **The test suite no longer mirrors modules into `%TEMP%`, and the release script
161
+ pins the runtime and installs from the lockfile.** A release failed with 252
162
+ "failed" test files whose every first error was
163
+ `ENOENT ... \Temp\<id>\ssr\.tmp-...`, while each of those files passed when run
164
+ alone: vitest 4's forks pool writes every transformed module into
165
+ `%TEMP%/<nanoid>/<environment>/`, creates that directory exactly once and never
166
+ re-checks it, and its only deleter does not synchronise with in-flight imports. A
167
+ directory that disappears mid-run therefore turns every not-yet-fetched module into
168
+ an import error that has nothing to do with the code under test. Both packages now
169
+ run `pool: 'threads'` (no module mirror is written at all), `vitest` and `vite` are
170
+ pinned to exact versions in both manifests and in a root `overrides` block,
171
+ `package-lock.json` is recomputed with them, and the release installs with `npm ci`
172
+ **before** any gate runs instead of re-resolving the tree after the version bump.
173
+ `npm run verify:test-gate` adds a version/environment pre-flight, and a failing test
174
+ run is attributed before anything is retried: only when every failing file's first
175
+ error is that mirror `ENOENT` does the release retry once, and a real failure is
176
+ never retried and never worded differently.
177
+ - **The reply no longer floats in the middle of the screen: it sits directly on top of
178
+ the input box.** The previous release pinned the *composer* to the last two rows by
179
+ emitting blank rows between the newest printed line and the live region, so a
180
+ conversation that had not filled the screen left the answer stranded above a band of
181
+ blank space - the shorter the session, the wider the band. The writer now treats the
182
+ `rows - 1` rows above the parked cursor as a CANVAS it owns, laid out top-down as
183
+ `[gap][content][region]`: the blank space lives *above every visible content row*, and
184
+ the newest content row always touches the top row of the live region. The gap is
185
+ SKIPPED with `CUD`, never written, so a blank row still cannot reach the scrollback;
186
+ the content rows still on the canvas are redrawn in place when the layout moves them,
187
+ and a row that has left the canvas (scrolled away or erased at exit) is never written
188
+ again. The reflow-estimate chain is gone: a narrower or shorter window now drops the
189
+ geometry and re-measures (a couple of hundred milliseconds of ordinary appending)
190
+ instead of guessing an erase distance that could cut a re-flowed line in half. Two
191
+ self-healing paths the canvas would otherwise lose are explicit: a re-measurement adds
192
+ the canvas's own height to the reported "rows below the cursor" (reading only the
193
+ latter collapses the canvas onto the parked row and pushes the visible content into
194
+ the scrollback a second time), and every batch reconciles its grid with the live
195
+ terminal height first (a `resize` event arrives a libuv turn late, and on a terminal
196
+ that never answers CPR the composer would stay mid-screen for the whole session).
197
+ `/perf`'s `scrollback` line now reports `canvas`/`content`/`gap` rows, `scrolled` rows
198
+ and `anchor resets` alongside `region` and `anchor bottom via probe|fill|none`.
199
+ `anchor: unknown` (no TTY, no filter, no answer, or geometry lost after a foreign
200
+ write) stays byte-identical to the previous release, except for the documented case
201
+ where a width or a height change arrives while nothing is measured.
202
+ - **In native scroll mode the composer stopped mid-screen after a reply, leaving a
203
+ screenful of blank rows below it.** The live region was positioned *relative to
204
+ the last printed line*, so on a conversation that had not filled the screen yet
205
+ the input box and status line sat wherever the history ended - the shorter the
206
+ session, the higher they floated - and closing an overlay, `/clear` or a shorter
207
+ draft moved them again. The writer now carries a measured `gap` ("rows left below
208
+ the parked cursor") and emits that many blank rows *above* the region, so
209
+ `pad + region + 1` equals the terminal height and the composer always occupies the
210
+ last two rows. The measurement is one `ESC[6n` before the first frame (raw mode
211
+ raised first, or the reply is line-buffered and echoed), with a one-off fill to the
212
+ bottom row as the fallback for terminals that never answer. The pad belongs to the
213
+ erasable block and never reaches the scrollback. `anchor: unknown` (no TTY, no
214
+ filter, no answer, or geometry lost after a foreign write) stays byte-identical to
215
+ the previous release. Re-probes are debounced 200 ms after a resize, coalesced, and
216
+ switched off the moment the screen is handed back - a query there would leak
217
+ `^[[12;1R` onto the shell prompt. `/perf`'s `scrollback` line now also reports
218
+ `block`/`pad` rows, `anchor bottom via probe|fill|none` and `anchor reprobes`.
100
219
  - **A long answer lost two characters at every hard wrap point - silently, in
101
220
  exactly the content a user copies out.** The transcript's content column had no
102
221
  width of its own, so Yoga laid each line out at the width it computed from the