@aragon-agent/cli 0.6.31 → 0.6.32

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 (91) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +2957 -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 +232 -8
  12. package/dist/commands/builtins.js +23 -8
  13. package/dist/commands/perf.d.ts +54 -1
  14. package/dist/commands/perf.js +28 -4
  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 +64 -6
  59. package/dist/ui/ScrollbackShell.d.ts +30 -4
  60. package/dist/ui/ScrollbackShell.js +8 -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 +64 -0
  74. package/dist/ui/scrollback/LiveTail.js +27 -0
  75. package/dist/ui/scrollback/band.d.ts +105 -0
  76. package/dist/ui/scrollback/band.js +109 -0
  77. package/dist/ui/scrollback/budget.d.ts +32 -3
  78. package/dist/ui/scrollback/budget.js +43 -6
  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 +49 -0
  84. package/dist/ui/scrollback/limits.js +49 -0
  85. package/dist/ui/scrollback/scrollback-writer.d.ts +104 -16
  86. package/dist/ui/scrollback/scrollback-writer.js +368 -82
  87. package/dist/ui/scrollback/use-scrollback-view.d.ts +11 -0
  88. package/dist/ui/scrollback/use-scrollback-view.js +37 -6
  89. package/dist/ui/scrollback/writer-shapes.d.ts +68 -2
  90. package/dist/ui/scrollback/writer-shapes.js +53 -8
  91. 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,82 @@ were written.
97
121
 
98
122
  ### Fixed
99
123
 
124
+ - **The TODO rail and the subagent roster are back in the default (native) scroll
125
+ mode.** Printing the conversation into the terminal's own scrollback took the two
126
+ panels with it: the rail lived in the full-screen layout's middle band and the
127
+ roster in the viewport footer, and neither of those exists once the live region
128
+ takes over - so a running plan showed nothing but a `Todo: 2/5` chip and a running
129
+ dispatch showed `Team: 2/4 running` in plain grey. The live region now owns a
130
+ PANEL BAND directly above the input box: the `TODO` rail (markers, index,
131
+ `activeForm`, overflow, gauge) is the band's right-hand column, the `team` roster
132
+ (header line, one row per subagent with activity and elapsed time, `+N more`, the
133
+ supervisor line) sits at its top left, and the unfinished tail below them is
134
+ rendered with the **real** entry components instead of the text projection - a
135
+ running `team` card and a running `tool` card now look exactly like the ones the
136
+ full-screen mode draws, gutter included. Row and column allocation has one owner
137
+ (`ui/scrollback/band.ts`), the printed conversation still uses the full width, and
138
+ the six ways a panel can be absent (`disabled`, `empty`, `narrow`, `short`,
139
+ `overlay`, a degraded frame) each name themselves in a new `/perf` `band:` line.
140
+ `aragon config set scrollMode app` renders byte-identically to before.
141
+ - **The test suite no longer mirrors modules into `%TEMP%`, and the release script
142
+ pins the runtime and installs from the lockfile.** A release failed with 252
143
+ "failed" test files whose every first error was
144
+ `ENOENT ... \Temp\<id>\ssr\.tmp-...`, while each of those files passed when run
145
+ alone: vitest 4's forks pool writes every transformed module into
146
+ `%TEMP%/<nanoid>/<environment>/`, creates that directory exactly once and never
147
+ re-checks it, and its only deleter does not synchronise with in-flight imports. A
148
+ directory that disappears mid-run therefore turns every not-yet-fetched module into
149
+ an import error that has nothing to do with the code under test. Both packages now
150
+ run `pool: 'threads'` (no module mirror is written at all), `vitest` and `vite` are
151
+ pinned to exact versions in both manifests and in a root `overrides` block,
152
+ `package-lock.json` is recomputed with them, and the release installs with `npm ci`
153
+ **before** any gate runs instead of re-resolving the tree after the version bump.
154
+ `npm run verify:test-gate` adds a version/environment pre-flight, and a failing test
155
+ run is attributed before anything is retried: only when every failing file's first
156
+ error is that mirror `ENOENT` does the release retry once, and a real failure is
157
+ never retried and never worded differently.
158
+ - **The reply no longer floats in the middle of the screen: it sits directly on top of
159
+ the input box.** The previous release pinned the *composer* to the last two rows by
160
+ emitting blank rows between the newest printed line and the live region, so a
161
+ conversation that had not filled the screen left the answer stranded above a band of
162
+ blank space - the shorter the session, the wider the band. The writer now treats the
163
+ `rows - 1` rows above the parked cursor as a CANVAS it owns, laid out top-down as
164
+ `[gap][content][region]`: the blank space lives *above every visible content row*, and
165
+ the newest content row always touches the top row of the live region. The gap is
166
+ SKIPPED with `CUD`, never written, so a blank row still cannot reach the scrollback;
167
+ the content rows still on the canvas are redrawn in place when the layout moves them,
168
+ and a row that has left the canvas (scrolled away or erased at exit) is never written
169
+ again. The reflow-estimate chain is gone: a narrower or shorter window now drops the
170
+ geometry and re-measures (a couple of hundred milliseconds of ordinary appending)
171
+ instead of guessing an erase distance that could cut a re-flowed line in half. Two
172
+ self-healing paths the canvas would otherwise lose are explicit: a re-measurement adds
173
+ the canvas's own height to the reported "rows below the cursor" (reading only the
174
+ latter collapses the canvas onto the parked row and pushes the visible content into
175
+ the scrollback a second time), and every batch reconciles its grid with the live
176
+ terminal height first (a `resize` event arrives a libuv turn late, and on a terminal
177
+ that never answers CPR the composer would stay mid-screen for the whole session).
178
+ `/perf`'s `scrollback` line now reports `canvas`/`content`/`gap` rows, `scrolled` rows
179
+ and `anchor resets` alongside `region` and `anchor bottom via probe|fill|none`.
180
+ `anchor: unknown` (no TTY, no filter, no answer, or geometry lost after a foreign
181
+ write) stays byte-identical to the previous release, except for the documented case
182
+ where a width or a height change arrives while nothing is measured.
183
+ - **In native scroll mode the composer stopped mid-screen after a reply, leaving a
184
+ screenful of blank rows below it.** The live region was positioned *relative to
185
+ the last printed line*, so on a conversation that had not filled the screen yet
186
+ the input box and status line sat wherever the history ended - the shorter the
187
+ session, the higher they floated - and closing an overlay, `/clear` or a shorter
188
+ draft moved them again. The writer now carries a measured `gap` ("rows left below
189
+ the parked cursor") and emits that many blank rows *above* the region, so
190
+ `pad + region + 1` equals the terminal height and the composer always occupies the
191
+ last two rows. The measurement is one `ESC[6n` before the first frame (raw mode
192
+ raised first, or the reply is line-buffered and echoed), with a one-off fill to the
193
+ bottom row as the fallback for terminals that never answer. The pad belongs to the
194
+ erasable block and never reaches the scrollback. `anchor: unknown` (no TTY, no
195
+ filter, no answer, or geometry lost after a foreign write) stays byte-identical to
196
+ the previous release. Re-probes are debounced 200 ms after a resize, coalesced, and
197
+ switched off the moment the screen is handed back - a query there would leak
198
+ `^[[12;1R` onto the shell prompt. `/perf`'s `scrollback` line now also reports
199
+ `block`/`pad` rows, `anchor bottom via probe|fill|none` and `anchor reprobes`.
100
200
  - **A long answer lost two characters at every hard wrap point - silently, in
101
201
  exactly the content a user copies out.** The transcript's content column had no
102
202
  width of its own, so Yoga laid each line out at the width it computed from the