@rob-c/pi-managed-tools 0.0.0-stage → 0.23.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.
- package/BUSYBOX-CONTRACT.md +440 -0
- package/CHANGELOG.md +775 -0
- package/LICENSE +338 -0
- package/README.md +849 -2
- package/package.json +79 -5
- package/skills/busybox-applets/SKILL.md +266 -0
- package/skills/managed-tools/SKILL.md +328 -0
- package/skills/managed-tools-reference/SKILL.md +738 -0
- package/src/agentops.ts +813 -0
- package/src/agenttools.ts +391 -0
- package/src/bashtool.ts +103 -0
- package/src/build.ts +142 -0
- package/src/context.ts +157 -0
- package/src/display.ts +79 -0
- package/src/extension.ts +1229 -0
- package/src/guard.ts +437 -0
- package/src/jobs.ts +1052 -0
- package/src/timing.ts +364 -0
- package/src/tools.ts +2223 -0
- package/src/userstdin.ts +524 -0
- package/src/wrap.ts +683 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.23.0]
|
|
4
|
+
|
|
5
|
+
**A hardening pass: what the model is told is checked against the binary, commands that
|
|
6
|
+
escaped the wrapper no longer do, and a result says what it cannot show.** Each item was
|
|
7
|
+
found by examining a real session or measuring the installed build.
|
|
8
|
+
|
|
9
|
+
*False things the model was told*
|
|
10
|
+
|
|
11
|
+
- **The truncation pointer pointed at lines the model already had.** `run` keeps the head
|
|
12
|
+
*and* the tail of a long timeline; the hint still said "head only … read the end". It
|
|
13
|
+
now names the omitted range, the command that reads from it, and how many of the omitted
|
|
14
|
+
lines are on stderr (from `log --summary`).
|
|
15
|
+
- **The prompt quoted a stamp the binary no longer prints.** The example line is now cut
|
|
16
|
+
from a line the installed build really printed, at session start; every shape a build
|
|
17
|
+
has printed parses (one to nine fraction digits, padded or not).
|
|
18
|
+
- **`verbose` was 200 KB and pi keeps 50.** pi's bash tool keeps the last 2000 lines or
|
|
19
|
+
50 KB, so the model got the tail end of the view with its header cut off. `verbose` is
|
|
20
|
+
49 KB, and whenever pi's cut removes the `run=` header it is restored from the full
|
|
21
|
+
output pi kept, and the cut is said.
|
|
22
|
+
- **A capture could be deleted by another session.** One artifact root, one `--prune 20`,
|
|
23
|
+
every session on the machine. The wrapper no longer prunes; the sweep removes a run only
|
|
24
|
+
when it is beyond the newest 200 and more than two hours old.
|
|
25
|
+
|
|
26
|
+
*Commands that escaped the wrapper*
|
|
27
|
+
|
|
28
|
+
- **`busybox sh -c` is wrapped.** Any `busybox …` call counted as already wrapped, and the
|
|
29
|
+
guidelines recommend `busybox sh -c` for multi-step logic: those ran with no timeline,
|
|
30
|
+
no deadline and no silence watchdog. Only capture and record applets are left alone.
|
|
31
|
+
- **Flags are taken from the build's own feature list, and the build is run once at
|
|
32
|
+
session start.** `--stamp-ns` and `-W` were unconditional. A refused pseudo-terminal
|
|
33
|
+
now means plain pipes; a binary that fails its self-test turns the wrapper off with a
|
|
34
|
+
warning instead of failing every call.
|
|
35
|
+
- **`GRADLE_OPTS`, `MAVEN_ARGS`, `RUBYOPT` are appended to, not replaced.**
|
|
36
|
+
- **Buffering is switched off for more than Python and Ruby**: `STDBUF1=L` (every C-stdio
|
|
37
|
+
program on macOS), a Perl prelude, `LUA_INIT`, and an opt-in `stdbuf` preload for Linux.
|
|
38
|
+
|
|
39
|
+
*Deeper in pi*
|
|
40
|
+
|
|
41
|
+
- **Wrapping happens in the bash tool's `execute`**, not by rewriting the call in
|
|
42
|
+
`tool_call`: later extensions' hooks see what the model wrote.
|
|
43
|
+
- **The header travels as data** (`details.piTime`, and beside pi's own
|
|
44
|
+
`structuredContent`, which a content-only patch used to drop).
|
|
45
|
+
- **pi's own renderer draws the result** — collapsed preview, expand key, truncation
|
|
46
|
+
warning — on the command's own lines.
|
|
47
|
+
- **Old results lose their offsets at compaction**, when the prompt is rebuilt anyway.
|
|
48
|
+
- **A `!` command reaches the model as a timeline.**
|
|
49
|
+
- **`busybox_job`**: start a command that outlives the call, read its new output, wait for
|
|
50
|
+
a line, stop it.
|
|
51
|
+
- **Settings in pi's settings file** (`managedTools`), and `/managed-tools` switches kept
|
|
52
|
+
across a resume.
|
|
53
|
+
|
|
54
|
+
*Results that are harder to misread*
|
|
55
|
+
|
|
56
|
+
- **The outcome comes first** when it was not the command's own exit.
|
|
57
|
+
- **Facts instead of "unknown"**: each pipeline stage's status and the final directory,
|
|
58
|
+
left by the guest shell in its run folder; no note when there is nothing to say.
|
|
59
|
+
- **A repeated caveat is a few words**, not the same two lines every call.
|
|
60
|
+
- **An offset is printed once per burst** (`[= out]`); stamps were a quarter of all
|
|
61
|
+
bash-result bytes.
|
|
62
|
+
- **A command that cannot end is refused before it runs**, with the rewrite: a pager, an
|
|
63
|
+
editor, `tail -f`, `watch`, a foreground server.
|
|
64
|
+
|
|
65
|
+
*Tests*
|
|
66
|
+
|
|
67
|
+
- The testbench's `hardening` scenario checks each claim in the prompt against a real
|
|
68
|
+
run. `scripts/benchmark-pi.mjs` gained five negative-knowledge probes — questions whose
|
|
69
|
+
true answer is "the result does not say" — graded honest / fabricated / unclear
|
|
70
|
+
(`--only probes`; a bare run is unchanged). `tests/extension.test.ts` no longer waits
|
|
71
|
+
on a release check it cannot reach: 13 seconds instead of nearly five minutes.
|
|
72
|
+
|
|
73
|
+
**Standard input: a `!` command can be answered, and the model is told the truth about
|
|
74
|
+
its own.** Measured first, hop by hop: `busybox run` forwards its stdin to the guest in
|
|
75
|
+
every mode (pty or not) and ends it with end-of-file — but pi starts every command with
|
|
76
|
+
stdin closed and its backend has no stdin argument, so there was never anything to
|
|
77
|
+
forward. A `Proceed? [y/N]` prompt read end-of-file, took its default and exited 0.
|
|
78
|
+
|
|
79
|
+
- **`!` commands show their output as it arrives.** `busybox run -q` prints its capture
|
|
80
|
+
when the command *exits*, so a wrapped `!` command showed nothing until then — not even
|
|
81
|
+
the question it was asking. The run now gets a private artifact root (`--dir`) and its
|
|
82
|
+
capture files, which `run` writes as bytes arrive, are followed while it runs. (`--jsonl`
|
|
83
|
+
does not serve: it emits per *line*, so an unterminated prompt stays invisible.)
|
|
84
|
+
- **`!` commands can be answered.** The wrapper is given `--stdin <named pipe>`; when the
|
|
85
|
+
command looks like it is waiting (output stopped on an unfinished line for 0.4 s, or
|
|
86
|
+
3 s of silence) pi's input dialog opens and each submitted line is written to the pipe.
|
|
87
|
+
Esc in the dialog ends the input — the guest reads end-of-file — and returns the editor;
|
|
88
|
+
the command keeps running. pi's own backend still does the spawning, so process-group
|
|
89
|
+
killing, Esc and the environment are unchanged. What is typed is never added to the
|
|
90
|
+
output (the session records it and the model reads it).
|
|
91
|
+
- **A question waits five minutes for its answer, then the command is stopped.** Longer
|
|
92
|
+
than the 120s a model's command gets, on purpose: this bounds a person, not a program.
|
|
93
|
+
The clock runs only while the input dialog is open (pi draws the countdown in its
|
|
94
|
+
title), so a `!` command that is working still has no deadline. On expiry the command is
|
|
95
|
+
stopped — exit status 124 and a `[stopped: the command waited 5m for input …]` line in
|
|
96
|
+
its output, where the session records it — rather than given end-of-file, which a
|
|
97
|
+
`[Y/n]` prompt would take for yes. `PI_MANAGED_TOOLS_STDIN_TIMEOUT=<seconds>` changes
|
|
98
|
+
it; `0` removes it.
|
|
99
|
+
- **`busybox_run` takes `stdin`**: text fed to the command, then end-of-file.
|
|
100
|
+
- **The "stdin gets no EOF" claim is gone**, from the per-turn guidelines, the `IDLE`
|
|
101
|
+
notice (bash and `busybox_run`), the skill and the README. It was false: a model's
|
|
102
|
+
command reads end-of-file at once. The guideline now says so, and how to answer a prompt
|
|
103
|
+
from inside the command; the `IDLE` notice rules stdin out instead of blaming it.
|
|
104
|
+
- `PI_MANAGED_TOOLS_USER_STDIN=off` restores the previous `!` path (stdin empty, output at
|
|
105
|
+
exit, capture kept in the shared root). With no UI the new path still shows output live
|
|
106
|
+
and leaves stdin empty.
|
|
107
|
+
- The `pruned=N keep=20` line `run -q --prune` printed into a `!` command's output no
|
|
108
|
+
longer appears on the live path.
|
|
109
|
+
|
|
110
|
+
Costs: one `mkfifo` and one temporary folder per `!` command, removed when it ends, and no
|
|
111
|
+
`busybox log` re-read for those runs. A full-screen program is still out of reach.
|
|
112
|
+
|
|
113
|
+
## [0.22.0]
|
|
114
|
+
|
|
115
|
+
**Pi-Time: a default deadline for every wrapped command, and a timeout that says it is one.**
|
|
116
|
+
The timestamps ("Pi-Time" — the wrapper's name for conveying time itself to the model:
|
|
117
|
+
stream, offset, deadline) already carried which stream and when; this release adds the
|
|
118
|
+
third fact, how long is too long.
|
|
119
|
+
Without a deadline, a command that hangs — a loop, a server that never exits, a prompt
|
|
120
|
+
waiting on stdin — held the model until pi's harness gave up, and the result read like a
|
|
121
|
+
command failure: `exit_code=-1 timed_out=true` followed by pi's "Command exited with code 3",
|
|
122
|
+
which invites a debugging detour instead of a retry.
|
|
123
|
+
|
|
124
|
+
- **Every wrapped bash command now gets a 120s deadline by default.** A caller's own
|
|
125
|
+
`timeout` still wins (taken over one second earlier, as before); the default applies only
|
|
126
|
+
when nobody asked for one. `PI_MANAGED_TOOLS_TIMEOUT=<seconds>` changes it for a session,
|
|
127
|
+
and `PI_MANAGED_TOOLS_TIMEOUT=0` (or `off`) removes the deadline entirely.
|
|
128
|
+
- **A timeout result now opens with `TIMEOUT — not a failure of the command`.** The notice
|
|
129
|
+
explains that `exit_code=-1` and "Command exited with code 3" are the kill status, points
|
|
130
|
+
at `busybox log <run>` for the partial capture, and names the recovery moves: raise
|
|
131
|
+
`timeout` on the call, narrow the command, or background it and poll with `waitfor`.
|
|
132
|
+
A cancellation gets its own `CANCELLED` notice, distinct from a deadline.
|
|
133
|
+
- The `busybox_run` tool's own text got the same notices, and its default `timeout_s`
|
|
134
|
+
now shares the same constant (120) instead of a literal.
|
|
135
|
+
- **`scripts/benchmark-pi.mjs`** — the model in the loop, not the testbench: six tasks
|
|
136
|
+
(two data fits, four site builds, one requiring a served-and-stopped HTTP check), each
|
|
137
|
+
with a seeded fixture and machine-graded outcome, every bash *and* `busybox_run` command
|
|
138
|
+
scanned for stream merges (`2>&1`, `|&`, `&>`), the `command` escape counted per call,
|
|
139
|
+
and pi's own crashes reported separately. Its first 12-session run found: a model
|
|
140
|
+
escaping **every** call via the `command` prefix (fixed by rewording the env-section
|
|
141
|
+
escape sentence from "when byte-exact output matters more than timing" to "rarely worth
|
|
142
|
+
it: no timeline, no stream tags, no timing" — escapes then dropped to near zero); three
|
|
143
|
+
`2>&1` idioms with no taught replacement (silencing noise, filtering stderr, server
|
|
144
|
+
logs — each replacement now in the skills, and violations fell 8 → 3 → 1 across
|
|
145
|
+
successive serve-task runs); and a TIMEOUT notice that named the session default even
|
|
146
|
+
when a caller-supplied deadline fired (now it cites a budget only when the run's own
|
|
147
|
+
duration says that budget killed it).
|
|
148
|
+
- **busybox build 2026-11-24 09:42: `json` writes, and `run -x` reports side effects.**
|
|
149
|
+
`busybox json --set`/`--delete` landed — guarded JSON editing (`--value` strings,
|
|
150
|
+
`--json-value` typed, `--dry-run` preview, parses first, missing parent refused exit 1,
|
|
151
|
+
temp+rename) — the hand-rolled python-one-liner class for editing documents is now one
|
|
152
|
+
applet call, and the always-on skill's instead-of table says so. `json` moved from
|
|
153
|
+
read-only to write-on-`--set` in the busybox-applets classification (fourth caveat in
|
|
154
|
+
the R list). `run -x/--effects` reports files created/changed/removed under the run's
|
|
155
|
+
cwd; the JSON payload carries `effects: [{op, path, size}]` and the busybox_run tool
|
|
156
|
+
surfaces it as a compact `effects: +new.txt, -old.txt, ~mod.ts` line (capped at 8, the
|
|
157
|
+
scan's truncation named). Verified against the build: effects print in `--format json`
|
|
158
|
+
only — text mode has no effects section, an upstream gap recorded in the contract, so
|
|
159
|
+
the bash timeline path cannot see them yet. Also verified fixed upstream: `unzip -d`
|
|
160
|
+
extracts correctly now (the plugin's system-unzip-first extraction stays, on purpose).
|
|
161
|
+
Re-verified still open: the JSON payload lacks `idle`.
|
|
162
|
+
- **The 120s silence watchdog** (`run -W`, adopted by default): a command that produces
|
|
163
|
+
no output at all is killed and reported `idle=true` — a *hang*, not slow work — even
|
|
164
|
+
when the deadline was raised. The result carries a third notice, `IDLE — not a
|
|
165
|
+
failure of the command and not a timeout`, naming the most common cause (a command
|
|
166
|
+
reading stdin gets no EOF under the pty) and pointing at the capture. Same budget
|
|
167
|
+
honesty as the deadline notice: the number it cites must match the run's duration.
|
|
168
|
+
`busybox_run` applies the same watchdog, and detects its signature in this build
|
|
169
|
+
(stopped, no exit code, no timeout — the JSON payload does not report `idle`; the text
|
|
170
|
+
header does — an upstream gap). `PI_MANAGED_TOOLS_IDLE=<seconds>` overrides; `0`/`off`
|
|
171
|
+
disables. No watchdog where there is no deadline: `!` commands and fully escaped calls
|
|
172
|
+
stay in their owner's hands.
|
|
173
|
+
- **The view-correctness guard** (`src/guard.ts`): a stream merge at the command's
|
|
174
|
+
*tail* — the last two lines, the last ~24 characters of each, the reflex zone the
|
|
175
|
+
benchmark measured — is now refused *before the command runs*. The blocked call returns
|
|
176
|
+
the rewrite (`>/dev/null` for one stream, `[err]` lines or `busybox log --stream
|
|
177
|
+
stderr --match`, `>srv.log 2>srv.err &` for servers) and the override marker:
|
|
178
|
+
append `# pitime-safe` and say why, and the result then states that its `[out]`/`[err]`
|
|
179
|
+
tags are not evidence. A merge buried deep inside a script the model authored is out of
|
|
180
|
+
scope by design — a rule that nags on first-order scripting gets disabled by its users.
|
|
181
|
+
`busybox_run`'s `shell` argument gets the same guard. `PI_MANAGED_TOOLS_GUARD=off`
|
|
182
|
+
disables it.
|
|
183
|
+
- **Results now state their own holes.** A command that discards stdout or stderr
|
|
184
|
+
(`>/dev/null`, `2>/dev/null`), leaves a process in the background, or runs fully
|
|
185
|
+
unwrapped via the `command` prefix earns a note on its result naming exactly what the
|
|
186
|
+
model cannot know from it — the timeline shows what arrived; it cannot show what was
|
|
187
|
+
thrown away, and saying so is what makes the remaining picture correct.
|
|
188
|
+
- **busybox 0.6.0 (279 applets, up from 276): nanosecond stamps and command metadata.**
|
|
189
|
+
The wrapper now passes `--stamp-ns` — every timeline line is `[00000.005868042 out]`,
|
|
190
|
+
zero-padded, two same-microsecond events distinguishable — while the parser accepts both
|
|
191
|
+
ns (9-digit) and old µs (6-digit, leading-space) shapes, so captures re-read through
|
|
192
|
+
`busybox log` still parse. `run --format json` now reports what the command *did*:
|
|
193
|
+
`cpu_user_ms`/`cpu_sys_ms`, `max_rss_kb`, `binary`, `dropped_bytes`, `final_newline`,
|
|
194
|
+
`cwd_start`, `argv`, `replay` — and `busybox_run` surfaces the interpretation-changing
|
|
195
|
+
ones (cwd, cpu, rss, idle, binary, dropped bytes, missing trailing newline) on a `meta`
|
|
196
|
+
line of its result. Three new agent applets, documented and classified: `mark NAME`
|
|
197
|
+
(named landmarks in a run's timeline, `busybox log <R> --marks`; its only write is the
|
|
198
|
+
run's own marks artifact), `outline FILE` (definitions with line, byte offset and
|
|
199
|
+
version — the index `peek`/`busybox_replace` work from), and `patchapply` (apply a
|
|
200
|
+
unified diff with every hunk verified first, `-c PATH=HASH` refuses on drift, `-n`
|
|
201
|
+
dry-run — the mutating partner of `patchcheck`). New `run` flags documented: `-W`
|
|
202
|
+
idle timeout, `-C` capture limit, `-d` child cwd. Installing a local build on macOS now
|
|
203
|
+
requires `codesign -f -s -` after the copy — an unsigned or stale-signature binary
|
|
204
|
+
gets SIGKILL at exec (this bit the session that installed it: re-signing fixed it).
|
|
205
|
+
- **The human's `!` commands now run through the wrapper** (pi's `user_bash` hook,
|
|
206
|
+
option 2 from its documented contract: hand back `createLocalBashOperations()` with the
|
|
207
|
+
command wrapped inside). `-q --pty-split` passthrough: live streamed output, the
|
|
208
|
+
unbuffered environment, artifacts for `busybox log` — but no timeline, no run header,
|
|
209
|
+
no view budget and no deadline, because the reader is a person who owns the command.
|
|
210
|
+
The `command ` escape falls through to pi's plain path;
|
|
211
|
+
`PI_MANAGED_TOOLS_USER_WRAP=off` restores the plain path entirely.
|
|
212
|
+
- **Common-sense nudges, each verified against the harness before being taught.** Two
|
|
213
|
+
environment facts now stated every turn: each bash call starts fresh in the session's
|
|
214
|
+
cwd (`cd` does not persist — checked), and a command that reads stdin gets no EOF here
|
|
215
|
+
because its stdin is an open pty (`head -1` sat until the deadline, zero bytes —
|
|
216
|
+
measured), so it must be fed (`cmd < file`, `printf … | cmd`, a heredoc).
|
|
217
|
+
- **Three more ways an exit code lies, named on the result.** A pipeline's exit is the
|
|
218
|
+
*last stage's*: ending in `head`/`tail` means the command was SIGPIPE'd and its status
|
|
219
|
+
is unknowable; ending in `grep` means 1 is "no match", not failure; and a `|| true`
|
|
220
|
+
masks whichever segment it follows. Each earns a one-line note stating whose exit code
|
|
221
|
+
the header shows.
|
|
222
|
+
- The one-second pre-emption of pi's deadline lives in the extension only now, emitted
|
|
223
|
+
verbatim by `wrap.ts`; it was being applied twice (`--timeout N-2`), found by the
|
|
224
|
+
testbench's new `timeout-default` scenario (18 scenarios, 104 checks).
|
|
225
|
+
|
|
226
|
+
## [0.21.0]
|
|
227
|
+
|
|
228
|
+
**A testbench, and the five bugs it found.** `npm run testbench` drives the installed
|
|
229
|
+
extension through pi's real bash engine and the real busybox — no model in the loop — over
|
|
230
|
+
17 scenarios (92 checks): quoting, pty buffering, truncation, parallel runs, cancellation,
|
|
231
|
+
timeouts, verbosity, file reads/edits, extraction, retention and the PATH/applet wiring.
|
|
232
|
+
Every scenario runs in its own process and its own scratch agent directory (with a space in
|
|
233
|
+
the path, on purpose), so a failure is a bug and not a prompt misunderstanding.
|
|
234
|
+
|
|
235
|
+
- **An empty busybox silenced every command.** `busyboxAvailable()` only checked that the
|
|
236
|
+
file existed, so a zero-length binary (a truncated download, a half-finished install) was
|
|
237
|
+
wrapped around every bash call: the wrapper could not execute, and every command returned
|
|
238
|
+
nothing at all. It now requires a non-empty file with the executable bit. This was the
|
|
239
|
+
worst failure mode in the package — silent, and total.
|
|
240
|
+
- **Zip-based installs were broken by the applet directory.** `<agent dir>/busybox-applets`
|
|
241
|
+
links `unzip`, so the plugin's own `spawnSync("unzip", …)` resolved to the packaged
|
|
242
|
+
busybox — whose `unzip -d DIR` exits 0 having extracted nothing. Installing ast-grep,
|
|
243
|
+
ninja or gh therefore failed with "Binary not found in archive". Extraction now looks for
|
|
244
|
+
a system binary by absolute path (`/usr/bin/unzip`, then bsdtar, then the packaged busybox
|
|
245
|
+
by absolute path), never through the PATH this package rewrites.
|
|
246
|
+
- **A truncated wrapper view gave no way back.** The wrapper's budget (48 KB) is below pi's
|
|
247
|
+
own (50 KB), so pi never truncates and never offers its temp file: the model saw
|
|
248
|
+
`truncated=true` and nothing else. The `tool_result` digest now names the exact command —
|
|
249
|
+
`busybox log R123 --lines 4960:5000` — because the view keeps the head and the verdict is
|
|
250
|
+
usually at the end.
|
|
251
|
+
- **`busybox_run` lost two things.** Its runs recorded no timeline, so `--stream timeline`
|
|
252
|
+
answered NOT_FOUND; and a literal `match` searched stdout only, missing the diagnostic in
|
|
253
|
+
stderr. It now always records `--timestamps`, and a `match` with no stream named falls
|
|
254
|
+
back to stderr before reporting NOT_FOUND.
|
|
255
|
+
- **Run artifacts grew without bound.** `run --prune N` is silently ignored when
|
|
256
|
+
`--timestamps` is set (measured: 30 runs with `-q --prune 5` leave 5 directories, the same
|
|
257
|
+
30 with `-t --prune 5` leave 30), and the wrapper always asks for the timeline. A session
|
|
258
|
+
left hundreds of directories behind. The extension now sweeps the artifact root itself at
|
|
259
|
+
session start and every 25 wrapped commands, keeping the newest 20 and never touching a
|
|
260
|
+
symlink or a directory that is not `R<number>`.
|
|
261
|
+
|
|
262
|
+
Upstream reports for the busybox repository are in `BUSYBOX-CONTRACT.md`: `unzip -d DIR`
|
|
263
|
+
extracting nothing, `--prune` being inert under `--timestamps`, and the timeline text view
|
|
264
|
+
keeping only the head (the JSON view keeps head and tail).
|
|
265
|
+
|
|
266
|
+
## [0.20.0]
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
- **busybox-static 0.5.0**, which closes both defects the last release reported and adds
|
|
270
|
+
the missing half of "honest timing":
|
|
271
|
+
- `run`'s cancellation was dead code (`bb_signals()` takes `1 << signo`, and `run`
|
|
272
|
+
passed `1 << (signo - 1)`, so the handler sat on SIGHUP/SIGALRM). A SIGTERM now
|
|
273
|
+
records the cancellation and returns the documented exit 3 — verified: `exit 3`,
|
|
274
|
+
`cancelled=true`, no survivor.
|
|
275
|
+
- a watchdog in its own process group kills the command's group when the wrapper dies
|
|
276
|
+
for **any** reason, SIGKILL included. A `kill -9` of busybox no longer orphans the
|
|
277
|
+
work it started, which removes the one hole the plugin could not close.
|
|
278
|
+
- two concurrent runs in one artifact root no longer collide on a run id — relevant
|
|
279
|
+
because pi runs bash calls in parallel.
|
|
280
|
+
- **Wrapped commands get a pseudo-terminal by default** (`--pty-split`: stdout on the
|
|
281
|
+
pty, stderr on a pipe). Buffering was the remaining lie in the timeline: Python, Node,
|
|
282
|
+
Ruby and Java block-buffer stdout on a pipe and flush at exit, so every line shared one
|
|
283
|
+
timestamp. On a terminal they line-buffer, and the offsets become real — a C program that
|
|
284
|
+
`printf`s three lines 1.2 s apart reported all three at `3.740564` on a pipe and at
|
|
285
|
+
`0.004561 / 1.209525 / 2.414571` on the pty. That is the case the env vars cannot
|
|
286
|
+
reach: Python and Ruby have switches (set anyway), C stdio, Java and Go's `bufio`
|
|
287
|
+
only have the terminal. stderr is unbuffered
|
|
288
|
+
either way, so it keeps its pipe and its `err` tag. `PI_MANAGED_TOOLS_PTY` selects
|
|
289
|
+
`split` (default), `merged`, `raw` or `off`, and `/managed-tools pty` (or the
|
|
290
|
+
`managed_tools` tool's `pty` action) changes it for a session. `isatty()` being true is
|
|
291
|
+
the one behavioural change, and `off` restores plain pipes.
|
|
292
|
+
- **A `timing:` digest line** is appended to any bash result that ran longer than a second,
|
|
293
|
+
for the model: total, line count, where output began, the longest silence, and how many
|
|
294
|
+
pauses there were. It answers "where did the time go" without asking the model to diff
|
|
295
|
+
300 timestamps, and the bash renderer strips it for the human.
|
|
296
|
+
- **`rtk` is removed.** It is no longer downloaded, updated, installed or advertised:
|
|
297
|
+
summarising output is a preference rather than a pinned binary, and a proxy that
|
|
298
|
+
rewrites what a command printed is the wrong default for a model that has to read diffs
|
|
299
|
+
and edit files. The always-on skill now leads with the packaged binaries and points at
|
|
300
|
+
`brief` for reduction; both skills lost every rtk reference (a test enforces that), and
|
|
301
|
+
an existing `<agent dir>/bin/rtk` is left untouched. The registry is 24 tools.
|
|
302
|
+
- The wrapper keeps its deadline grace (`--timeout N-1`) even though 0.5.0 handles a
|
|
303
|
+
signal correctly: it costs nothing and makes the applet the owner of the deadline.
|
|
304
|
+
|
|
305
|
+
## [0.19.0]
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
- **The packaged busybox moves to busybox-static 0.4.0** (276 applets, was 269), which
|
|
309
|
+
brings the high-precision timeline, `brief`, deadline control and the fixes this
|
|
310
|
+
plugin had worked around. `busybox-static` now tags releases with its own version
|
|
311
|
+
(v0.4.0) while the assets keep the upstream build version
|
|
312
|
+
(`busybox-static-1.39.0-aac079e-darwin-universal`), so the busybox entry resolves its
|
|
313
|
+
asset from the release's own asset list (`assetPattern`) instead of constructing a
|
|
314
|
+
name from the tag. A version recorded under the old scheme (`1.39.0-aac079e`, which
|
|
315
|
+
sorts *above* 0.4.0) is treated as older by `legacyVersionPattern`, otherwise every
|
|
316
|
+
installed copy would look newer than the new release forever.
|
|
317
|
+
- **Every bash command now runs through `busybox run --timestamps`.** The model reads
|
|
318
|
+
one interleaved line per record with a microsecond offset and its stream
|
|
319
|
+
(`[ 0.066632 err]`), which is the ordering evidence a merged stdout/stderr block
|
|
320
|
+
destroys. pi's own bash runner is reused through `createBashToolDefinition` (the
|
|
321
|
+
documented override path), so exit status, cwd, shell, truncation and process-tree
|
|
322
|
+
killing are unchanged.
|
|
323
|
+
- **The timeline is for the model only.** The re-registered `bash` tool supplies
|
|
324
|
+
`renderResult`, which strips the wrapper's header, markers and per-line prefixes for
|
|
325
|
+
the TUI and HTML export, keeping everything the command printed. The tool result —
|
|
326
|
+
what the model reads and the session stores — keeps the timeline.
|
|
327
|
+
- The wrapped command carries the unbuffered environment it needs rather than exporting
|
|
328
|
+
it into pi's process: `PYTHONUNBUFFERED`, `NO_COLOR`, `TERM=dumb`, `PAGER`/`GIT_PAGER`,
|
|
329
|
+
`MAVEN_ARGS`, `GRADLE_OPTS`, and a generated Ruby prelude wired through `RUBYOPT` (the
|
|
330
|
+
only way to set `$stdout.sync` from outside). Go and Java have no such switch; the
|
|
331
|
+
timeline shows their flush boundaries instead. `PI_MANAGED_TOOLS_EXTRA_ENV` adds more.
|
|
332
|
+
- **Session verbosity**: `managed_tools` gains a `verbosity` action and `/managed-tools`
|
|
333
|
+
a `verbosity` verb — `quiet` (6 KB view), `normal` (48 KB, default), `verbose`
|
|
334
|
+
(200 KB) or `brief` (repeats collapsed through `brief`, no timeline — this build
|
|
335
|
+
ignores `--brief` when `--timestamps` is set). `PI_MANAGED_TOOLS_WRAP=off` disables
|
|
336
|
+
the wrapper entirely.
|
|
337
|
+
- Escape hatch for byte-exact output: a command (or any `&&`/`;` segment) prefixed with
|
|
338
|
+
`command` runs unwrapped — a leading-only check was not enough, because a model writes
|
|
339
|
+
`cd /repo && jq ...`.
|
|
340
|
+
- `peek`, `waitfor`, `doctor`, `brief`, `why` and `patchcheck` are linked into
|
|
341
|
+
`<agent dir>/busybox-applets` (62 names). `replace`, `run`, `log`, `bench`, `check`,
|
|
342
|
+
`json` and `snapshot` stay out: they execute, write, or own a generic name.
|
|
343
|
+
- Two of the defects recorded in `BUSYBOX-CONTRACT.md` are fixed upstream and the
|
|
344
|
+
document now says so: `run --format json` is valid when the view truncates (the
|
|
345
|
+
omission marker is inside the string), a zero-match `replace` answers `NOT_FOUND` with
|
|
346
|
+
a message, and `--sha256` accepts the 12-character prefix `peek` prints. One remains
|
|
347
|
+
and is documented with the fix: an external SIGTERM/SIGKILL to `run` leaves the child's
|
|
348
|
+
process group behind.
|
|
349
|
+
|
|
350
|
+
## [0.18.1]
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
- Add **`BUSYBOX-CONTRACT.md`**: every argv, JSON field, exit code and payload shape
|
|
354
|
+
this plugin depends on, captured from the real build and written for the
|
|
355
|
+
`busybox-static` repository to keep compatible. `scripts/capture-busybox-contract.sh`
|
|
356
|
+
re-captures all of it from any build (read-only, `BUSYBOX=/path` overrides the
|
|
357
|
+
binary), and a test fails if the document stops naming a flag the wrapper uses.
|
|
358
|
+
- Three wrappers were wrong about the build, and the contract work is what found them:
|
|
359
|
+
- `peek`'s `next` is `{"from_byte":N}`, not a number, so the continuation hint for a
|
|
360
|
+
truncated read never rendered and the caller had to re-read from the start.
|
|
361
|
+
- A zero-match `replace` answers `INVALID_ARGUMENT` with an **empty** message, not
|
|
362
|
+
`NOT_FOUND`, so the text now says "(the build sent no message)" instead of
|
|
363
|
+
inventing "no change".
|
|
364
|
+
- A `--request` batch continues past `INVALID_ARGUMENT` and only stops on
|
|
365
|
+
`STALE_INPUT`/`NOT_FOUND`, so the batch summary says "check each result" rather
|
|
366
|
+
than promising that later edits were skipped.
|
|
367
|
+
- Two defects reported upstream in the same document, both with reproductions:
|
|
368
|
+
`run --format json` is invalid JSON when the view is truncated (the head and tail
|
|
369
|
+
are printed as two adjacent strings), and a spawn failure comes back as
|
|
370
|
+
`exit_code:127` with no distinct wrapper status.
|
|
371
|
+
|
|
372
|
+
## [0.18.0]
|
|
373
|
+
|
|
374
|
+
- **The packaged BusyBox is now the agent-ops build: 269 applets on Darwin** (416 on
|
|
375
|
+
Linux), up from 236. It carries six applets that exist for a coding agent rather
|
|
376
|
+
than a shell, all sharing one contract (text by default, `--format json` with
|
|
377
|
+
`"schema":1`, explicit byte budgets, `shown_bytes`/`truncated`, exit 0/1/2/3 and
|
|
378
|
+
never 124 or 128+N): `peek` (numbered lines plus the file `sha256`, with a
|
|
379
|
+
`--from-byte` continuation), `replace` (literal, validated-before-write, atomic,
|
|
380
|
+
`--sha256` precondition, `--dry-run` diff), `run`/`log` (argv or `--shell`, separate
|
|
381
|
+
stdout/stderr artifacts, bounded view, own deadline and process-group cleanup,
|
|
382
|
+
retrieval by line range or literal match), `waitfor` (bounded file/TCP/unix/HTTP
|
|
383
|
+
readiness) and `doctor`. `busybox --caps --format json` reports the build's real
|
|
384
|
+
version, applet count and features. The other new applets (`chpst`, `column`,
|
|
385
|
+
`fallocate`, `fdisk`, `free`, `fuser`, `ifconfig`, `ip`, `lsblk`, `mount`, `pgrep`,
|
|
386
|
+
`pidof`, `ping`, `pkill`, `ps`, `pstree`, `readahead`, `reset`, `route`,
|
|
387
|
+
`setuidgid`, `softlimit`, `top`, `umount`, `uptime`, `watch`, ...) are classified in
|
|
388
|
+
the `busybox-applets` skill.
|
|
389
|
+
- **Three model tools over those applets**, each chosen because the built-in it
|
|
390
|
+
resembles lacks exactly one property: `busybox_peek` (a read that returns the file
|
|
391
|
+
version), `busybox_replace` (`edit` with a `sha256` precondition, so a stale hash is
|
|
392
|
+
`STALE_INPUT` and nothing is written; `dry_run` returns a bounded diff),
|
|
393
|
+
`busybox_run` (`bash` with retrievable evidence: the capture is complete when the
|
|
394
|
+
view is trimmed, and a nonzero `exit_code` is the command's status, not a tool
|
|
395
|
+
failure). They spawn the packaged binary and format its JSON; no guarantee (byte
|
|
396
|
+
budget, `flock`, process-group cleanup, 0600 artifacts) is re-implemented in
|
|
397
|
+
TypeScript. Cancelling a call sends TERM then KILL, and the applet reaps its own
|
|
398
|
+
group. `read`, `edit` and `bash` remain the defaults.
|
|
399
|
+
- `peek`, `waitfor` and `doctor` are linked into `<agent dir>/busybox-applets` (59
|
|
400
|
+
names now), so they are bare commands too. `replace`, `run` and `log` are left out:
|
|
401
|
+
two of those names are generic enough for a project script to own, and all three
|
|
402
|
+
mutate or execute.
|
|
403
|
+
- **Worked around an upstream JSON bug**: this build prints `run --format json` with
|
|
404
|
+
the head and tail of a truncated view as two adjacent quoted strings, which no
|
|
405
|
+
parser accepts. The metadata is intact and the capture is complete, so the wrapper
|
|
406
|
+
recovers the fields from the text and points at `run_id` for the view — it never
|
|
407
|
+
re-runs the command, because that would repeat its side effects. Reported upstream
|
|
408
|
+
in the build repo; `peek` and `log` JSON are unaffected.
|
|
409
|
+
- Tests: 130 (was 100). New `tests/agentops.test.ts` covers argv building, the text
|
|
410
|
+
the model reads, salvage of the broken payload, and cancellation against a stand-in
|
|
411
|
+
multicall binary; the extension tests drive the three tools through the same
|
|
412
|
+
stand-in. The skills test now checks the 269-applet roster.
|
|
413
|
+
|
|
414
|
+
## [0.17.0]
|
|
415
|
+
|
|
416
|
+
- **BusyBox applet names are now on `PATH`**, in a second directory after the bin
|
|
417
|
+
directory: `<agent dir>/busybox-applets` holds one symlink per applet, each
|
|
418
|
+
pointing at `<agent dir>/bin/busybox`, so `xxd`, `hexdump`, `sha256sum`, `unzip`,
|
|
419
|
+
`timeout` and 51 more run without the `busybox` prefix. BusyBox dispatches on
|
|
420
|
+
`argv[0]`, so a symlink is the only way to do this without renaming the binary.
|
|
421
|
+
The default list is curated (56 applets, `CORE_APPLETS` in `src/tools.ts`): names
|
|
422
|
+
where the host may lack the tool, or where the busybox flags are adequate.
|
|
423
|
+
`sed`, `grep`, `find`, `awk`, `tar`, `diff`, `ls`, `cp`, `rm`, `stat`, `date`,
|
|
424
|
+
`patch`, `tree` and the shells are deliberately **not** linked, so no working
|
|
425
|
+
command changes meaning; they stay reachable as `busybox <applet>`.
|
|
426
|
+
`PI_MANAGED_TOOLS_APPLETS=all` widens this to every applet except a never-list
|
|
427
|
+
(system administration, servers, package managers, shells); `off` disables it.
|
|
428
|
+
- **The extension now sets `PATH` itself**, as
|
|
429
|
+
`<agent dir>/bin : <agent dir>/busybox-applets : rest`, dropping any earlier
|
|
430
|
+
occurrence of its own entries before prepending. pi's `getShellEnv()` prepends
|
|
431
|
+
the bin directory only when it is *absent* and offers no hook for a second
|
|
432
|
+
directory, so rewriting `process.env.PATH` at session start is the only way to
|
|
433
|
+
reach every `bash` spawn. This also fixes the documented case where a shell rc
|
|
434
|
+
appended `$HOME/.pi/agent/bin` and host binaries won for `bash`.
|
|
435
|
+
- The system-prompt environment section now names both `PATH` entries and states
|
|
436
|
+
which names are not shadowed; `/managed-tools status` reports the applet links.
|
|
437
|
+
- Absolute host paths to a linked applet (`/usr/bin/xxd`) are rewritten to the bare
|
|
438
|
+
name, as managed binary paths already were.
|
|
439
|
+
- A relative symlink target was tried first and rejected: the kernel resolves a
|
|
440
|
+
relative link from the *real* directory, so under macOS `/tmp` (a symlink to
|
|
441
|
+
`/private/tmp`) `..` walks through the target side and the link dangles. Links
|
|
442
|
+
are absolute, and a moved agent directory is repaired by the next sync.
|
|
443
|
+
|
|
444
|
+
## [0.16.0]
|
|
445
|
+
|
|
446
|
+
- Renamed the npm package to the scoped name **`@rob-c/pi-managed-tools`**; install
|
|
447
|
+
with `pi install npm:@rob-c/pi-managed-tools`. The unscoped `pi-managed-tools`
|
|
448
|
+
name had one published version (0.15.1) of identical code and is deprecated in
|
|
449
|
+
favour of the scope. pi's source spec drops the `@` after `npm:` — the form is
|
|
450
|
+
`npm:@rob-c/pi-managed-tools`.
|
|
451
|
+
- Internal identifiers deliberately left alone so installed state keeps working:
|
|
452
|
+
the state file stays `<agent dir>/bin/.pi-managed-tools.json`, the status key
|
|
453
|
+
stays `pi-managed-tools`, and the `managed_tools` tool / `/managed-tools`
|
|
454
|
+
command keep their names. Renaming the state file would orphan every installed
|
|
455
|
+
version record and trigger a needless full re-download on first run.
|
|
456
|
+
- `USER_AGENT` now sends `@rob-c/pi-managed-tools/0.16.0`; it was also stale at
|
|
457
|
+
0.15.1 while the manifest said 0.15.1, so it is now bumped in the same edit.
|
|
458
|
+
|
|
459
|
+
## [0.15.1]
|
|
460
|
+
|
|
461
|
+
- Detect a zero-length managed binary as damaged. On Linux, executing a file with no
|
|
462
|
+
valid executable header falls back to `/bin/sh`, so an empty binary "runs" and
|
|
463
|
+
exits 0 — the probe reported it healthy and no repair would ever be offered. macOS
|
|
464
|
+
returns `ENOEXEC` instead, which is why this only surfaced on the first Linux CI
|
|
465
|
+
run. `localState()` now checks the file size before trusting the probe.
|
|
466
|
+
- Found by the new CI matrix: the macOS job passed while the Ubuntu job failed on the
|
|
467
|
+
one test that uses an empty file. First evidence this repository builds and passes
|
|
468
|
+
anywhere other than the author's machine.
|
|
469
|
+
|
|
470
|
+
## [0.15.0]
|
|
471
|
+
|
|
472
|
+
- Relicensed from MIT to **GPL-2.0-only**, before the first commit so no published
|
|
473
|
+
version was ever MIT. Every package this project imports is MIT, which is why the
|
|
474
|
+
relicence is permissible; Apache-2.0 in a direct dependency would have blocked it.
|
|
475
|
+
- Add `LICENSE` (GPLv2), SPDX headers in `src/tools.ts` and `src/extension.ts`, and
|
|
476
|
+
`author`/`repository`/`homepage`/`bugs` in `package.json`.
|
|
477
|
+
- Stop publishing `tests/` and `scripts/` in the npm tarball; they stay in the repo.
|
|
478
|
+
- Add `.github/workflows/test.yml` (node 22 on ubuntu and macos) and a `.gitignore`
|
|
479
|
+
covering `node_modules/`, `.pi/` and `.probe/`.
|
|
480
|
+
|
|
481
|
+
## [0.14.0]
|
|
482
|
+
|
|
483
|
+
- State the CLI environment in the system prompt instead of leaving the model to
|
|
484
|
+
discover it. `before_agent_start` now adds a `managed_tools_environment` section:
|
|
485
|
+
that `<agent dir>/bin` is first on `PATH`, which packaged versions that means
|
|
486
|
+
(read from the state file, so no extra subprocesses), that bare names are correct,
|
|
487
|
+
and that multi-step logic goes in `busybox sh -c '…'` — ending with "do not spend
|
|
488
|
+
a turn probing it". The string is built once per process and is stable across
|
|
489
|
+
turns; pi diffs sections, so a changing one would patch the prompt every turn.
|
|
490
|
+
- Measured with a treadmill of six graded prompts on two models: adoption was
|
|
491
|
+
12/12 and fully consistent on both, but the model established the environment
|
|
492
|
+
first on only **2 of 12** runs — it probed when asked to and dived straight in
|
|
493
|
+
otherwise. Stating the facts up front removes the need for that turn.
|
|
494
|
+
- The treadmill also caught a scoring mistake worth recording: a run that used pi's
|
|
495
|
+
built-in `grep` tool looked like a miss for `rg`, but that tool is backed by the
|
|
496
|
+
managed `rg` through `getToolPath()`, so it is adoption.
|
|
497
|
+
|
|
498
|
+
## [0.13.0]
|
|
499
|
+
|
|
500
|
+
- Integrate with pi's extension API instead of relying on prompt text alone.
|
|
501
|
+
**`before_agent_start`** now injects the two environment rules into
|
|
502
|
+
`systemPromptOptions.promptGuidelines`, so they are in the system prompt of every
|
|
503
|
+
turn rather than only when a skill happens to load — verified present in the JSON
|
|
504
|
+
event stream. The injection is idempotent; duplicates would be paid for every turn.
|
|
505
|
+
- **`tool_call`** rewrites an absolute host path for a managed binary to its bare
|
|
506
|
+
name before execution: `/usr/bin/jq -r .a` runs as `jq -r .a`. Only a token in
|
|
507
|
+
command position is touched (so `echo "/usr/bin/jq"` is data) and only names this
|
|
508
|
+
package manages (so `/usr/bin/tar` is untouched). `PI_MANAGED_TOOLS_REWRITE=off`
|
|
509
|
+
disables it; `/managed-tools status` reports how many rewrites happened.
|
|
510
|
+
- Proven end to end: asked to run `/usr/bin/jq --version` verbatim, the session
|
|
511
|
+
printed `jq-1.8.2` — the packaged build — not the host's `1.7.1-apple`.
|
|
512
|
+
- A treadmill of six graded prompts re-run twice each now reports 6/6 tasks
|
|
513
|
+
consistent and zero absolute-path violations, up from 4/6 before the injection.
|
|
514
|
+
|
|
515
|
+
## [0.12.0]
|
|
516
|
+
|
|
517
|
+
- The always-on skill now pins two environment rules that were previously only
|
|
518
|
+
implicit: use the packaged binaries by **bare name** (never `/usr/bin/jq` or
|
|
519
|
+
`/opt/homebrew/bin/gh`, which bypasses both of pi's resolution mechanisms), and
|
|
520
|
+
run multi-step shell logic as **`busybox sh -c '...'`** so the shell is the same
|
|
521
|
+
static ash everywhere instead of whichever bash/zsh the host resolved.
|
|
522
|
+
- Document exactly where `busybox sh` stops: it supports `[[ ]]`, `<(…)`, `<<<`,
|
|
523
|
+
`$'…'`, `local`, `pipefail`, `${v//a/b}` and `${v:1:2}`, but not arrays,
|
|
524
|
+
`${v^^}`/`${v,,}`, `read -a`, `mapfile`, `coproc` or `extglob` — for those, drop
|
|
525
|
+
the prefix and let pi's own shell run the command.
|
|
526
|
+
- Both rules were verified by measurement, not assumed. The shell clause appended at
|
|
527
|
+
the end of the description did **not** fire (the model ran a bare `for` loop);
|
|
528
|
+
moved into the middle of the description it did (`busybox sh -c '…'`), and a
|
|
529
|
+
follow-up asking for a bash array correctly dropped the prefix instead of writing
|
|
530
|
+
a shell that cannot run it.
|
|
531
|
+
|
|
532
|
+
## [0.11.1]
|
|
533
|
+
|
|
534
|
+
- Sharpen the always-on skill after measuring real model behaviour. Four adoption
|
|
535
|
+
probes in an isolated pi profile showed the model used `scc`, `ast-grep`, `fd`
|
|
536
|
+
and `bat` correctly once it had loaded the reference skill, but fell back to
|
|
537
|
+
`python3 -c` and `awk` for small one-liners. The always-on text now names the
|
|
538
|
+
tool for those shapes explicitly — `jq` to read or query JSON, `bat -n -r A:B`
|
|
539
|
+
for a line range, `gron` to explore a document — and says the preference applies
|
|
540
|
+
to one-liners, not just large tasks. Both failing probes now pass.
|
|
541
|
+
|
|
542
|
+
## [0.11.0]
|
|
543
|
+
|
|
544
|
+
- Add `busybox` from [rob-c/busybox-static](https://github.com/rob-c/busybox-static):
|
|
545
|
+
upstream BusyBox built static, with one universal2 macOS asset covering both
|
|
546
|
+
architectures and separate Linux amd64/arm64 builds. No Windows build exists.
|
|
547
|
+
- BusyBox dispatches on `argv[0]`, so it is installed strictly as `busybox` and used
|
|
548
|
+
as `busybox <applet>`. Renaming it breaks every applet, and
|
|
549
|
+
`busybox --install -s` is called out as forbidden: inside pi's bin directory it
|
|
550
|
+
would put 236 applets ahead of the real coreutils.
|
|
551
|
+
- `busybox` reports `v1.39.0.git` while its tags carry the build commit
|
|
552
|
+
(`v1.39.0-aac079e`), so it uses the `trustTagVersion` path added for `sd` — the
|
|
553
|
+
recorded version stays at the tag and a rebuild still registers as an update.
|
|
554
|
+
- Add a third skill, `busybox-applets`: every one of the 236 applets classified
|
|
555
|
+
**R** read-only, **M** writes, **M★** destructive/system-level, or **E** runs a
|
|
556
|
+
program you name, with the flags that cause the write. Its roster is asserted in
|
|
557
|
+
`tests/skills.test.ts`, which fails if an applet is dropped from the doc.
|
|
558
|
+
|
|
559
|
+
## [0.10.1]
|
|
560
|
+
|
|
561
|
+
- Add a read-only vs mutating map to `managed-tools-reference`: one row per tool
|
|
562
|
+
listing what cannot change state, what mutates it, and which operations are
|
|
563
|
+
destructive. Every entry was taken from the installed binary's own help output,
|
|
564
|
+
and the dangerous ones were exercised: `sd` rewrites files with no flag,
|
|
565
|
+
`ruff format` rewrites by default while `format --check` does not, `mlr tee`
|
|
566
|
+
overwrites its target, `yq -i` touches only the first file, `scc --report=PATH`
|
|
567
|
+
overwrites silently, `ast-grep` writes only with `-U`/`-i` (`scan` has no
|
|
568
|
+
`--fix`), `duckdb FILE` creates a database, and `agent-browser screenshot` writes
|
|
569
|
+
a file even with no path.
|
|
570
|
+
- The always-on skill now points at that map before any writing command, and lists
|
|
571
|
+
the dry-run form for the tools that mutate with no flag at all.
|
|
572
|
+
- `tests/skills.test.ts` fails if a tool is added without a mutation-map row, or if
|
|
573
|
+
a row loses its read-only or mutating statement.
|
|
574
|
+
|
|
575
|
+
## [0.10.0]
|
|
576
|
+
|
|
577
|
+
- Add `scc` (lines of code), `duckdb` (SQL over CSV/Parquet/JSON), `miller`
|
|
578
|
+
(CSV/TSV/JSON transforms, installed as `mlr`), `sd` (find and replace) and
|
|
579
|
+
`difftastic` (structural diffs, installed as `difft`). All five publish assets
|
|
580
|
+
for darwin/linux arm64 and x64, and every emitted asset name was verified
|
|
581
|
+
against the live releases before merging.
|
|
582
|
+
- Add `trustTagVersion` for a release whose binary reports a version that lags its
|
|
583
|
+
tag: `sd` ships `sd 1.0.0` under tag `v1.1.0`. Without it the version
|
|
584
|
+
comparison would read the stale build string, decide the tool was outdated, and
|
|
585
|
+
re-download it on every check. The digest already proves the asset is the
|
|
586
|
+
intended one, so the tag is trusted for comparison instead.
|
|
587
|
+
- `difftastic` resolves to the gnu Linux build because it publishes no
|
|
588
|
+
linux-arm64 musl asset; `sd` has no Windows arm64 build.
|
|
589
|
+
- Document two behaviours worth knowing before use: `sd` edits files in place
|
|
590
|
+
unless given `-p` for a preview, and `duckdb` prints an agent-mode banner on
|
|
591
|
+
every result inside pi unless given `-no-agent`.
|
|
592
|
+
|
|
593
|
+
## [0.9.1]
|
|
594
|
+
|
|
595
|
+
Fixes from a full adversarial pass over v0.9.0.
|
|
596
|
+
|
|
597
|
+
- **Per-tool failure memory.** A tool that cannot install on this host kept its
|
|
598
|
+
binary missing, and a missing binary forced a full update cycle on *every*
|
|
599
|
+
start. Failures are now recorded in the state file and skipped until the
|
|
600
|
+
interval elapses; a success clears them. A run where everything failed still
|
|
601
|
+
records those failures without advancing `checkedAt`.
|
|
602
|
+
- **`gron` was permanently uninstallable.** Its release predates GitHub's
|
|
603
|
+
per-asset digest field, so fail-closed verification refused it forever. Tools
|
|
604
|
+
can now declare `digestOptional`, which installs and reports the result as
|
|
605
|
+
**unverified** — and `gron` is the only tool with that exception.
|
|
606
|
+
- **`agent-browser` picked the glibc build on Linux.** `file` shows the plain
|
|
607
|
+
asset needs `/lib64/ld-linux` while `linux-musl-*` is statically linked, so the
|
|
608
|
+
static one is now selected and runs on glibc and musl both.
|
|
609
|
+
- **The all-failed guard was dead code.** The extension wrote state after
|
|
610
|
+
`updateTools` had already persisted, undoing the guard and deferring the next
|
|
611
|
+
attempt by a full interval. The redundant writes are gone, and a `status` call
|
|
612
|
+
no longer stamps `checkedAt` just because someone looked.
|
|
613
|
+
- **Unverified installs are visible.** Digest and verification outcome are
|
|
614
|
+
persisted, and the startup notice appends `(UNVERIFIED)` — previously the
|
|
615
|
+
README claimed this and the code did not do it.
|
|
616
|
+
- A staging file is now registered before `chmod`, so a failing `chmod` cannot
|
|
617
|
+
leave an executable behind in the PATH directory.
|
|
618
|
+
- Skill corrections, each verified against the installed binary: `jq -C`/`-M`
|
|
619
|
+
were inverted; `bat` needs `--decorations=always` when piped or the style is
|
|
620
|
+
dropped; `rg --json` emits `begin`/`end` records so the jq example produced
|
|
621
|
+
nulls; `yq` v4 has no `--arg` (use `env()`); `rg` skips hidden and
|
|
622
|
+
gitignored files by default, which is now stated.
|
|
623
|
+
|
|
624
|
+
## [0.9.0]
|
|
625
|
+
|
|
626
|
+
- Add `agent-browser` ([vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser)),
|
|
627
|
+
`ruff` and `mise`.
|
|
628
|
+
- `agent-browser` ships bare executables named `agent-browser-<os>-<arch>` with
|
|
629
|
+
`x64` rather than `amd64`, and publishes no win32-arm64 build.
|
|
630
|
+
- `mise` nests its binary at `mise/bin/mise` inside a dated-tag archive
|
|
631
|
+
(`mise-v2026.11.11-macos-arm64.tar.gz`).
|
|
632
|
+
- Record three behaviours worth knowing before this is left unattended:
|
|
633
|
+
`agent-browser` needs a local Chrome/Chromium and leaves a daemon running, and
|
|
634
|
+
its own `skills get core` fails on this build; `mise` is a version manager whose
|
|
635
|
+
`activate` hook never runs in pi's `bash`, so only `mise exec --` sees project
|
|
636
|
+
pins; `ruff` is normally pinned by the project, so `uv run ruff` should win.
|
|
637
|
+
|
|
638
|
+
## [0.8.0]
|
|
639
|
+
|
|
640
|
+
- Add `bd` ([gastownhall/beads](https://github.com/gastownhall/beads)), a
|
|
641
|
+
Dolt-backed issue tracker for agents. Assets are named after the project
|
|
642
|
+
(`beads_1.3.4_darwin_arm64.tar.gz`) while the binary is `bd`; Dolt is embedded,
|
|
643
|
+
so the single binary is self-contained.
|
|
644
|
+
- Document two behaviours of `bd` that matter when it is installed automatically:
|
|
645
|
+
`bd init` creates `.beads/`, **rewrites `AGENTS.md` by default** and installs
|
|
646
|
+
editor/agent integrations unless told otherwise; and `bd` sends **anonymous
|
|
647
|
+
usage metrics by default** (command names, version, OS — not issues or paths),
|
|
648
|
+
which `DO_NOT_TRACK=1` disables. The package does not set that variable for the
|
|
649
|
+
user.
|
|
650
|
+
|
|
651
|
+
## [0.7.0]
|
|
652
|
+
|
|
653
|
+
- Add `jq`, `yq`, `fzf`, `uv` and `gh`. All five ship ready-made binaries for
|
|
654
|
+
linux/macos on x86_64 and arm64, plus Windows builds.
|
|
655
|
+
- Support releases whose asset **is** the executable, with no archive around it.
|
|
656
|
+
`jq` publishes `jq-macos-arm64` and `yq` publishes `yq_linux_amd64`, so a raw
|
|
657
|
+
download is staged directly and chmodded instead of being extracted.
|
|
658
|
+
- Strip each tool's own tag prefix when resolving versions. `jq` tags are
|
|
659
|
+
`jq-1.8.2`, which the previous `^v`-only strip could not turn into `1.8.2`.
|
|
660
|
+
- `uv` installs both `uv` and `uvx`, which are two binaries in one archive.
|
|
661
|
+
- Note the sharp edges in the README and both skills: `gh` holds an OAuth token,
|
|
662
|
+
`fzf` needs a TTY that pi's bash does not provide, `uv` manages Python
|
|
663
|
+
toolchains outside the bin directory, `yq` here is mikefarah v4 and not
|
|
664
|
+
kislyuk's Python tool, and `jq` now shadows the system copy.
|
|
665
|
+
|
|
666
|
+
## [0.6.0]
|
|
667
|
+
|
|
668
|
+
- Detect and repair bundled shims, not just the primary binary. `ast-grep` ships
|
|
669
|
+
a deprecated `sg` shim that is a 398 KB binary which **execs its sibling** — it
|
|
670
|
+
exits 1 the moment `ast-grep` is missing or will not run. `status` now probes
|
|
671
|
+
every name an archive provides and reports the specific one that is broken
|
|
672
|
+
(`sg does not execute`) or gone (`sg missing`).
|
|
673
|
+
- `reinstall sg` works: a provided binary name resolves to the tool that owns its
|
|
674
|
+
archive, so the whole bundle is reinstalled rather than reporting an unknown
|
|
675
|
+
tool.
|
|
676
|
+
- Installs are atomic per archive. Every target is backed up, swapped, then
|
|
677
|
+
probed, and any failure restores all of them. Previously each binary was
|
|
678
|
+
swapped and probed in turn, so a broken shim could leave a new `ast-grep`
|
|
679
|
+
beside a dead `sg` while the install reported success.
|
|
680
|
+
- Probes run with the bin directory on `PATH`, which is what lets a delegating
|
|
681
|
+
shim resolve its sibling.
|
|
682
|
+
- A missing secondary is only treated as damage when the primary is installed;
|
|
683
|
+
a fresh install is not a repair.
|
|
684
|
+
- The always-advertised skill now states a preference order: `rtk` first to shrink
|
|
685
|
+
command output, then these binaries over the system copies, plain commands
|
|
686
|
+
last. It also draws the line `rtk` makes easy to miss — it returns a *verdict*
|
|
687
|
+
(`rtk test`, `rtk err`, `rtk deps`) and is wrong for *content* you must read,
|
|
688
|
+
since `rtk git diff` reduces a diff to `a.txt | 1 +` and `rtk err` discards
|
|
689
|
+
stdout. `tests/skills.test.ts` fails if the description stops leading with
|
|
690
|
+
`rtk`, or if either skill drops the verdict/content split.
|
|
691
|
+
|
|
692
|
+
## [0.5.0]
|
|
693
|
+
|
|
694
|
+
- Add a repair path: `managed_tools` takes `action: "reinstall"` and an optional
|
|
695
|
+
`tool`, and `/managed-tools reinstall [tool]` does the same from the command
|
|
696
|
+
line. With no tool it replaces every managed binary that is present but cannot
|
|
697
|
+
execute; with a tool name it forces a fresh verified download even when the
|
|
698
|
+
installed version already matches upstream.
|
|
699
|
+
- Detect damaged binaries. `status` now reports a tool whose file exists but
|
|
700
|
+
fails to run. Version comparison alone never caught this: a truncated or
|
|
701
|
+
wrong-architecture file can sit at the expected path with a plausible version
|
|
702
|
+
recorded beside it.
|
|
703
|
+
- A forced reinstall falls back to the version recorded on disk when the release
|
|
704
|
+
lookup fails, so a repair still works on a broken network.
|
|
705
|
+
- `updateTools` now writes the check state itself. A tool that cannot report its
|
|
706
|
+
own version (`gron`) is compared against that record, so any caller that forgot
|
|
707
|
+
to persist it reinstalled `gron` on every run.
|
|
708
|
+
|
|
709
|
+
## [0.4.0]
|
|
710
|
+
|
|
711
|
+
- Add `ninja`. Its macOS asset (`ninja-mac.zip`) is a universal2 binary that runs
|
|
712
|
+
natively on x86_64 and arm64, so one download serves both mac architectures;
|
|
713
|
+
Linux and Windows each have a separate `aarch64`/`arm64` asset. Asset names
|
|
714
|
+
carry no version.
|
|
715
|
+
- Ship two skills. `managed-tools` is the always-advertised one: its description
|
|
716
|
+
is what pi puts in every system prompt, so it names all ten tools and the
|
|
717
|
+
rules for reaching for them. `managed-tools-reference` carries the exact flag
|
|
718
|
+
set and worked examples for each tool at the version this package installs.
|
|
719
|
+
- Add `tests/skills.test.ts`, which fails if a tool is added to the registry
|
|
720
|
+
without a matching section in both skills, if a description exceeds the Agent
|
|
721
|
+
Skills 1024-character limit, or if the two skills disagree about versions.
|
|
722
|
+
|
|
723
|
+
## [0.3.0]
|
|
724
|
+
|
|
725
|
+
- Add `just`, `gron`, `shellcheck` and `ast-grep`. Each project names its
|
|
726
|
+
release assets differently, so the registry now carries a per-tool platform
|
|
727
|
+
resolver alongside the per-tool asset-name closure.
|
|
728
|
+
- `ast-grep` ships two commands (`ast-grep` and the deprecated `sg`); both are
|
|
729
|
+
installed from the one verified archive. Only the primary command is probed
|
|
730
|
+
after install, because `sg` does not answer `--version`.
|
|
731
|
+
- Support `.tgz` archives (`gron`) and zips on macOS/Linux (`ast-grep`).
|
|
732
|
+
- Handle a tool whose release build reports no version: `gron --version` prints
|
|
733
|
+
`gron version dev`. Such a tool is no longer treated as a failed install, and
|
|
734
|
+
its installed version is read back from the recorded state so it is not
|
|
735
|
+
reinstalled on every check.
|
|
736
|
+
- Record installed versions in the state file alongside the latest known ones.
|
|
737
|
+
- `tree` is **not** managed: upstream (`Old-Man-Programmer/tree`) publishes tags
|
|
738
|
+
but no release assets, so there is no binary to download.
|
|
739
|
+
|
|
740
|
+
## [0.2.0]
|
|
741
|
+
|
|
742
|
+
- Verify every download against the sha256 digest GitHub records for the
|
|
743
|
+
release asset, before extracting it. Verification is fail-closed: a release
|
|
744
|
+
API that cannot be reached, or an asset published without a digest, is
|
|
745
|
+
reported as a failure rather than installed. `PI_MANAGED_TOOLS_ALLOW_UNVERIFIED=1`
|
|
746
|
+
is the only opt-out.
|
|
747
|
+
- Add `bat`, `prek` and `rtk` alongside `fd` and `rg`. `fd` and `rg` back pi's
|
|
748
|
+
built-in `find` and `grep` tools; the other three are reachable from `bash`
|
|
749
|
+
only, and `managed_tools` reports which is which.
|
|
750
|
+
- Give each tool its own platform gate. `rtk` publishes no
|
|
751
|
+
`aarch64-pc-windows-msvc` archive, so it is now reported as unsupported there
|
|
752
|
+
instead of failing with a 404.
|
|
753
|
+
- Stop letting a tool with no release for the platform force a network check on
|
|
754
|
+
every start, which previously made the check interval inert.
|
|
755
|
+
- Report per-tool support instead of one global platform verdict, so one
|
|
756
|
+
unsupported tool no longer hides the others.
|
|
757
|
+
- Prove an install runs before reporting success: the binary is executed, and a
|
|
758
|
+
binary that cannot run is rolled back to the previous copy. The old code
|
|
759
|
+
reported the version it asked for, which claimed success for a dead file.
|
|
760
|
+
- Fix a staged executable left behind in pi's bin directory when an install
|
|
761
|
+
failed, and a Windows replacement path that removed the installed binary
|
|
762
|
+
before the new one was in place.
|
|
763
|
+
- Handle asset names that carry no version (`prek`, `rtk`), which a version bump
|
|
764
|
+
must not change.
|
|
765
|
+
|
|
766
|
+
## [0.1.0]
|
|
767
|
+
|
|
768
|
+
- Keep pi's managed `fd` and `rg` binaries at the latest upstream release:
|
|
769
|
+
resolve `sharkdp/fd` and `BurntSushi/ripgrep` latest releases, compare with the
|
|
770
|
+
copies in pi's bin directory, and replace outdated or missing ones in place.
|
|
771
|
+
- Startup check on `session_start`, at most once every 12 hours (configurable),
|
|
772
|
+
skipped in offline mode, reported in the TUI only when something changed.
|
|
773
|
+
- `/managed-tools` command and `managed_tools` tool for on-demand status and
|
|
774
|
+
update; `status` reports which path pi resolves for each binary.
|
|
775
|
+
- darwin/linux/win32 on arm64 and x64, using the same archives pi fetches.
|