artshelf 0.8.0 → 0.10.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/CHANGELOG.md +47 -0
- package/README.md +13 -7
- package/SPEC.md +58 -5
- package/dist/src/cli.js +563 -82
- package/docs/agent-monitor.html +11 -3
- package/docs/agent-review.html +8 -2
- package/docs/agent-usage.html +14 -0
- package/docs/agent-usage.md +17 -0
- package/docs/index.html +1 -1
- package/docs/reference.html +69 -12
- package/package.json +1 -1
- package/skills/artshelf/SKILL.md +18 -20
package/docs/agent-monitor.html
CHANGED
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
plan id when attention exists.
|
|
68
68
|
</p>
|
|
69
69
|
<pre><code><span class="c"># register a project ledger so --all review can see it</span>
|
|
70
|
-
artshelf ledgers add --ledger <repo>/.artshelf/ledger.jsonl --name <project> --scope repo
|
|
70
|
+
artshelf ledgers add --ledger <repo>/.artshelf/ledger.jsonl --name <project> --scope repo --json
|
|
71
71
|
|
|
72
72
|
<span class="c"># list registered ledgers and their health</span>
|
|
73
73
|
artshelf ledgers list --json
|
|
74
74
|
|
|
75
75
|
<span class="c"># review and due-check every registered ledger at once</span>
|
|
76
|
-
artshelf review --all --
|
|
76
|
+
artshelf review --all --agent
|
|
77
77
|
artshelf due --all --json
|
|
78
78
|
|
|
79
79
|
<span class="c"># find records this agent owns, across ledgers</span>
|
|
@@ -102,12 +102,20 @@ artshelf due --all --json
|
|
|
102
102
|
|
|
103
103
|
<span class="c"># the full read-only pass: validate + due + plan preview</span>
|
|
104
104
|
artshelf review --all --json
|
|
105
|
+
artshelf review --all --agent
|
|
105
106
|
|
|
106
107
|
<span class="c"># CLI version, paths, registry health, safety posture</span>
|
|
107
108
|
artshelf doctor --json
|
|
109
|
+
artshelf doctor --agent
|
|
108
110
|
|
|
109
111
|
<span class="c"># lightweight counts, cron-friendly</span>
|
|
110
|
-
artshelf status --all --json
|
|
112
|
+
artshelf status --all --json
|
|
113
|
+
artshelf status --all --agent</code></pre>
|
|
114
|
+
<p>
|
|
115
|
+
Use <code>--agent</code> for concise monitor decisions and exact next
|
|
116
|
+
actions. Use <code>--json</code> instead when the job needs full
|
|
117
|
+
audit/API detail for storage, debugging, or a custom report.
|
|
118
|
+
</p>
|
|
111
119
|
</section>
|
|
112
120
|
|
|
113
121
|
<section>
|
package/docs/agent-review.html
CHANGED
|
@@ -44,16 +44,22 @@
|
|
|
44
44
|
<section>
|
|
45
45
|
<h2>Daily review workflow</h2>
|
|
46
46
|
<ol>
|
|
47
|
-
<li>Read <code>ledgers list</code>, <code>review --all</code>, and <code>trash list --all</code>.</li>
|
|
47
|
+
<li>Read <code>ledgers list --json</code>, <code>review --all --agent</code>, and <code>trash list --all --json</code>.</li>
|
|
48
48
|
<li>Run explicit-ledger purge dry-runs only when old trash needs review.</li>
|
|
49
49
|
<li>Classify each candidate: <code>trash-safe</code>, <code>needs-human-review</code>, <code>resolve-candidate</code>, or <code>registry-problem</code>.</li>
|
|
50
50
|
<li>Ask only with exact ledger path, reviewed plan id, or ids.</li>
|
|
51
51
|
</ol>
|
|
52
|
+
<p>
|
|
53
|
+
Prefer the built-in <code>--agent</code> packet when an acting agent
|
|
54
|
+
needs the compact decision surface. Use full <code>--json</code>
|
|
55
|
+
output when you need every ledger field for audit, debugging, or a
|
|
56
|
+
custom renderer.
|
|
57
|
+
</p>
|
|
52
58
|
</section>
|
|
53
59
|
|
|
54
60
|
<section>
|
|
55
61
|
<h2>Review plan report schema</h2>
|
|
56
|
-
<p>
|
|
62
|
+
<p>For richer host cards, attachments, or audit packets, construct an <code>ArtshelfReviewReport</code> JSON packet first, then render a compact decision card.</p>
|
|
57
63
|
<p>
|
|
58
64
|
Use <a href="schemas/artshelf-review-report.schema.json">schemas/artshelf-review-report.schema.json</a>
|
|
59
65
|
and <a href="examples/artshelf-review-report.json">examples/artshelf-review-report.json</a>.
|
package/docs/agent-usage.html
CHANGED
|
@@ -87,6 +87,20 @@
|
|
|
87
87
|
</dl>
|
|
88
88
|
</section>
|
|
89
89
|
|
|
90
|
+
<section>
|
|
91
|
+
<h2>Render modes</h2>
|
|
92
|
+
<p>
|
|
93
|
+
<code>review</code>, <code>status</code>, and <code>doctor</code> share three render modes
|
|
94
|
+
so the same data fits both people and agents. Reach for <code>--agent</code> when an agent
|
|
95
|
+
decides and acts; reach for <code>--json</code> for full record, plan, or health detail.
|
|
96
|
+
</p>
|
|
97
|
+
<dl class="def-rows">
|
|
98
|
+
<div><dt>default</dt><dd>human render: scannable grouped counts, attention states, and a short next action for a person at the terminal</dd></div>
|
|
99
|
+
<div><dt>--agent</dt><dd>a deterministic, token-efficient decision packet (single-line compact JSON) with health, counts, classifications, exact approval targets, blockers, and a verification command</dd></div>
|
|
100
|
+
<div><dt>--json</dt><dd>the full audit and API contract: complete machine-readable JSON for debugging and existing integrations, unchanged and backward compatible</dd></div>
|
|
101
|
+
</dl>
|
|
102
|
+
</section>
|
|
103
|
+
|
|
90
104
|
<section>
|
|
91
105
|
<h2>The mental model</h2>
|
|
92
106
|
<ul class="boundary-list">
|
package/docs/agent-usage.md
CHANGED
|
@@ -50,6 +50,23 @@ The browsable docs split the workflow into focused child pages:
|
|
|
50
50
|
- Approval names the exact ledger, plan id, or record ids.
|
|
51
51
|
- Every approved action ends with a read-only verification.
|
|
52
52
|
|
|
53
|
+
## Render modes
|
|
54
|
+
|
|
55
|
+
`review`, `status`, and `doctor` share three render modes so the same data fits
|
|
56
|
+
both people and agents:
|
|
57
|
+
|
|
58
|
+
- **default**: a human render — scannable grouped counts, attention states, and a
|
|
59
|
+
short next action for a person at the terminal.
|
|
60
|
+
- **`--agent`**: a deterministic, token-efficient decision packet (single-line
|
|
61
|
+
compact JSON) with health, counts, classifications, exact approval targets,
|
|
62
|
+
blockers, and a verification command. Use it when an agent acts on the result.
|
|
63
|
+
- **`--json`**: the full audit and API contract — complete machine-readable JSON
|
|
64
|
+
for debugging and existing integrations, unchanged and backward compatible.
|
|
65
|
+
|
|
66
|
+
Reach for `--agent` when an agent needs to decide and act cheaply; reach for
|
|
67
|
+
`--json` when you want the full record, plan, or health detail for audit or
|
|
68
|
+
debugging. `--agent` takes precedence if both flags are passed.
|
|
69
|
+
|
|
53
70
|
## Portable Skill
|
|
54
71
|
|
|
55
72
|
The repo ships a portable skill at
|
package/docs/index.html
CHANGED
|
@@ -158,7 +158,7 @@ artshelf review --json</code></pre>
|
|
|
158
158
|
~/.artshelf/ledgers.json
|
|
159
159
|
|
|
160
160
|
<span class="c"># put registers its ledger automatically; add existing ones explicitly</span>
|
|
161
|
-
artshelf ledgers add --ledger <repo>/.artshelf/ledger.jsonl --name <project> --scope repo
|
|
161
|
+
artshelf ledgers add --ledger <repo>/.artshelf/ledger.jsonl --name <project> --scope repo --json
|
|
162
162
|
|
|
163
163
|
<span class="c"># --all commands read across every registered ledger</span>
|
|
164
164
|
artshelf review --all --json</code></pre>
|
package/docs/reference.html
CHANGED
|
@@ -42,6 +42,13 @@
|
|
|
42
42
|
cleanup execution and trash purge. Every command below is tagged read-only,
|
|
43
43
|
writes ledger, writes registry, npm install, or approval-gated.
|
|
44
44
|
</p>
|
|
45
|
+
<p>
|
|
46
|
+
Run <code>artshelf help</code> for the grouped command list. Use
|
|
47
|
+
<code>artshelf <command> --help</code> or
|
|
48
|
+
<code>artshelf help <command></code> for focused help; nested commands
|
|
49
|
+
such as <code>artshelf trash purge --help</code> and
|
|
50
|
+
<code>artshelf ledgers add --help</code> show only that subcommand.
|
|
51
|
+
</p>
|
|
45
52
|
|
|
46
53
|
<section class="cmd">
|
|
47
54
|
<div class="cmd-head"><h2>artshelf put</h2><span class="cmd-flag plan">writes ledger</span></div>
|
|
@@ -70,7 +77,7 @@ artshelf ledgers list [--plain] [--json]</code></pre>
|
|
|
70
77
|
<section class="cmd">
|
|
71
78
|
<div class="cmd-head"><h2>artshelf ledgers add</h2><span class="cmd-flag plan">writes registry</span></div>
|
|
72
79
|
<pre><code><span class="c"># register an existing ledger for --all review</span>
|
|
73
|
-
artshelf ledgers add --ledger <path> [--name <project>] [--scope repo|user|other]</code></pre>
|
|
80
|
+
artshelf ledgers add --ledger <path> [--name <project>] [--scope repo|user|other] [--json]</code></pre>
|
|
74
81
|
<p>
|
|
75
82
|
<code>add</code> registers an existing ledger so Artshelf can review it through one
|
|
76
83
|
entry point; scope is inferred from the path when omitted.
|
|
@@ -113,19 +120,20 @@ artshelf validate [--all] [--json]</code></pre>
|
|
|
113
120
|
<section class="cmd">
|
|
114
121
|
<div class="cmd-head"><h2>artshelf review / status / doctor</h2><span class="cmd-flag readonly">read-only</span></div>
|
|
115
122
|
<pre><code><span class="c"># validate + due + plan preview in one pass</span>
|
|
116
|
-
artshelf review [--all] [--json]
|
|
123
|
+
artshelf review [--all] [--agent] [--json]
|
|
117
124
|
|
|
118
125
|
<span class="c"># lightweight dashboard of counts</span>
|
|
119
|
-
artshelf status [--all] [--json]
|
|
126
|
+
artshelf status [--all] [--agent] [--json]
|
|
120
127
|
|
|
121
128
|
<span class="c"># CLI version, resolved paths, registry health</span>
|
|
122
|
-
artshelf doctor [--json]</code></pre>
|
|
129
|
+
artshelf doctor [--agent] [--json]</code></pre>
|
|
123
130
|
<p>
|
|
124
131
|
<code>review</code> runs validate, due, and a cleanup plan preview in one pass; no-op
|
|
125
132
|
previews report <code>not-created</code>, and <code>--all</code> adds an aggregate triage
|
|
126
133
|
summary plus the next safe action. <code>status</code> is the lightweight dashboard of
|
|
127
134
|
counts; <code>--all --json</code> is cron-friendly. <code>doctor</code> reports CLI version,
|
|
128
|
-
resolved paths, registry health, and the cleanup safety posture.
|
|
135
|
+
resolved paths, registry health, and the cleanup safety posture. All three also accept
|
|
136
|
+
<code>--agent</code> for a deterministic, token-efficient decision packet (see Output mode).
|
|
129
137
|
</p>
|
|
130
138
|
</section>
|
|
131
139
|
|
|
@@ -153,7 +161,7 @@ artshelf update [--json]</code></pre>
|
|
|
153
161
|
artshelf cleanup --dry-run [--all] [--json]
|
|
154
162
|
|
|
155
163
|
<span class="c"># execute exactly one reviewed plan (approval only)</span>
|
|
156
|
-
artshelf cleanup --execute --plan-id <id> [--ledger <path>]</code></pre>
|
|
164
|
+
artshelf cleanup --execute --plan-id <id> [--ledger <path>] [--json]</code></pre>
|
|
157
165
|
<p>
|
|
158
166
|
<code>--dry-run</code> creates and registers a cleanup plan without moving files;
|
|
159
167
|
no-op dry-runs report <code>not-created</code>, and matching dry-runs reuse the
|
|
@@ -188,18 +196,67 @@ artshelf trash purge --execute --plan-id <id> [--ledger <path>] [--j
|
|
|
188
196
|
|
|
189
197
|
<section class="cmd">
|
|
190
198
|
<div class="cmd-head"><h2>artshelf resolve</h2><span class="cmd-flag plan">writes ledger</span></div>
|
|
191
|
-
<pre><code>artshelf resolve <id> --status resolved --reason <text>
|
|
199
|
+
<pre><code>artshelf resolve <id> --status resolved --reason <text> [--json]</code></pre>
|
|
192
200
|
<p>Mark a handled, missing, or no-longer-needed record as manually resolved. Updates the ledger only; never moves or deletes files.</p>
|
|
193
201
|
</section>
|
|
194
202
|
|
|
195
203
|
<section>
|
|
196
|
-
<h2>Global
|
|
204
|
+
<h2>Global flags</h2>
|
|
205
|
+
<p>Only these apply to every command.</p>
|
|
206
|
+
<table class="opts">
|
|
207
|
+
<tr><th>option</th><th>meaning</th></tr>
|
|
208
|
+
<tr><td>-h, --help</td><td>show help for artshelf or a specific command</td></tr>
|
|
209
|
+
<tr><td>-v, --version</td><td>show the Artshelf version</td></tr>
|
|
210
|
+
</table>
|
|
211
|
+
</section>
|
|
212
|
+
|
|
213
|
+
<section>
|
|
214
|
+
<h2>Output mode</h2>
|
|
215
|
+
<p>
|
|
216
|
+
Every command has a default human render: compact, scannable terminal output with
|
|
217
|
+
grouped counts, a leading <code>✓</code>/<code>⚠</code> attention glyph on each ledger
|
|
218
|
+
and the summary line, and a short next action — meant for a person reading the screen,
|
|
219
|
+
not a wall of raw JSON. The glyphs are plain Unicode (no ANSI color), so redirected
|
|
220
|
+
output stays clean.
|
|
221
|
+
</p>
|
|
222
|
+
<p>
|
|
223
|
+
<code>review</code>, <code>status</code>, and <code>doctor</code> add <code>--agent</code>:
|
|
224
|
+
a deterministic, token-efficient decision packet emitted as a single line of compact JSON.
|
|
225
|
+
It names health, counts, classifications, exact approval targets, blockers, and the command
|
|
226
|
+
to re-run for verification, so an agent can act without parsing decorative output.
|
|
227
|
+
</p>
|
|
228
|
+
<p>
|
|
229
|
+
<code>--json</code> stays the audit and API contract: the full, pretty-printed report for
|
|
230
|
+
debugging, audit trails, and existing integrations. It is unchanged and backward compatible,
|
|
231
|
+
and <code>--agent</code> takes precedence when both are passed. Update notices and other
|
|
232
|
+
diagnostics stay on stderr and never corrupt JSON or packet output.
|
|
233
|
+
</p>
|
|
234
|
+
<table class="opts">
|
|
235
|
+
<tr><th>option</th><th>meaning</th></tr>
|
|
236
|
+
<tr><td>(default)</td><td>human render: grouped counts, ✓/⚠ attention glyphs, and a short next action</td></tr>
|
|
237
|
+
<tr><td>--agent</td><td>token-efficient decision packet for agents on <code>review</code>, <code>status</code>, <code>doctor</code></td></tr>
|
|
238
|
+
<tr><td>--json</td><td>full machine-readable audit JSON on commands that return data</td></tr>
|
|
239
|
+
</table>
|
|
240
|
+
</section>
|
|
241
|
+
|
|
242
|
+
<section>
|
|
243
|
+
<h2>Scope flags (command-specific)</h2>
|
|
244
|
+
<p>
|
|
245
|
+
These select which ledger or registry a command reads or writes. They are not
|
|
246
|
+
universal global flags; each only applies to the commands that support it.
|
|
247
|
+
</p>
|
|
197
248
|
<table class="opts">
|
|
198
249
|
<tr><th>option</th><th>meaning</th></tr>
|
|
199
|
-
<tr><td>--ledger <path></td><td>
|
|
200
|
-
<tr><td>--registry <path></td><td>
|
|
201
|
-
<tr><td>--all</td><td>read
|
|
202
|
-
|
|
250
|
+
<tr><td>--ledger <path></td><td>target an explicit JSONL ledger</td></tr>
|
|
251
|
+
<tr><td>--registry <path></td><td>target an explicit ledger registry</td></tr>
|
|
252
|
+
<tr><td>--all</td><td>read every registered ledger on commands that support discovery (<code>list</code>, <code>find</code>, <code>get</code>, <code>due</code>, <code>validate</code>, <code>review</code>, <code>status</code>, <code>cleanup --dry-run</code>, <code>trash list</code>)</td></tr>
|
|
253
|
+
</table>
|
|
254
|
+
</section>
|
|
255
|
+
|
|
256
|
+
<section>
|
|
257
|
+
<h2>Environment</h2>
|
|
258
|
+
<table class="opts">
|
|
259
|
+
<tr><th>variable</th><th>meaning</th></tr>
|
|
203
260
|
<tr><td>ARTSHELF_REGISTRY</td><td>override the default ledger registry path</td></tr>
|
|
204
261
|
<tr><td>ARTSHELF_NOW</td><td>override current time for retention and due calculations</td></tr>
|
|
205
262
|
<tr><td>ARTSHELF_NO_UPDATE_CHECK=1</td><td>disable automatic npm update checks</td></tr>
|
package/package.json
CHANGED
package/skills/artshelf/SKILL.md
CHANGED
|
@@ -59,8 +59,7 @@ npm link
|
|
|
59
59
|
artshelf doctor
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Install, copy, or reference this portable skill only after the user chooses the
|
|
63
|
-
integration path. Offer to schedule read-only review job delivery in the host runtime.
|
|
62
|
+
Install, copy, or reference this portable skill only after the user chooses the integration path. Offer to schedule read-only review job delivery in the host runtime.
|
|
64
63
|
|
|
65
64
|
## Create
|
|
66
65
|
|
|
@@ -72,15 +71,11 @@ artshelf put <path> --reason "<why this exists>" --ttl 3d --kind run-artifact --
|
|
|
72
71
|
artshelf get <id> --json
|
|
73
72
|
```
|
|
74
73
|
|
|
75
|
-
Register backups, quarantine folders, debug output, generated reports, long-run
|
|
76
|
-
|
|
77
|
-
build output, dependency caches, secrets, credential dumps, and artifacts already
|
|
78
|
-
owned by another durable ledger.
|
|
74
|
+
Register backups, quarantine folders, debug output, generated reports, long-run evidence, and copied files kept for review. Skip source files, cheap regenerated
|
|
75
|
+
build output, dependency caches, secrets, credential dumps, and artifacts already owned by another durable ledger.
|
|
79
76
|
|
|
80
|
-
Defaults: `kind=scratch` for temp dirs, `backup` for rollback copies,
|
|
81
|
-
`
|
|
82
|
-
files. Use `cleanup=review` when judgment is needed and `cleanup=trash` only when
|
|
83
|
-
later disposal is clearly safe.
|
|
77
|
+
Defaults: `kind=scratch` for temp dirs, `backup` for rollback copies, `run-artifact` for logs/reports/evidence, `quarantine` for isolated questionable
|
|
78
|
+
files. Use `cleanup=review` when judgment is needed and `cleanup=trash` only when later disposal is clearly safe.
|
|
84
79
|
|
|
85
80
|
When JSON registration succeeds, include this deterministic Artshelf footnote:
|
|
86
81
|
|
|
@@ -94,13 +89,15 @@ Use the ledger registry for whole-machine review:
|
|
|
94
89
|
|
|
95
90
|
```bash
|
|
96
91
|
artshelf ledgers list --json
|
|
97
|
-
artshelf status --all --
|
|
98
|
-
artshelf review --all --
|
|
92
|
+
artshelf status --all --agent
|
|
93
|
+
artshelf review --all --agent
|
|
99
94
|
artshelf trash list --all --json
|
|
100
95
|
```
|
|
101
96
|
|
|
102
97
|
`artshelf ledgers list --json` reports per-ledger validation status. `--plain`
|
|
103
98
|
skips validation. `--all` is for discovery and review, not mutation permission.
|
|
99
|
+
Use `--agent` on `review`, `status`, and `doctor` for compact decisions; use
|
|
100
|
+
`--json` for full audit/API payloads, custom rendering, or debugging.
|
|
104
101
|
|
|
105
102
|
Register existing project ledgers explicitly:
|
|
106
103
|
|
|
@@ -144,22 +141,23 @@ Daily Review Workflow: turn raw Artshelf output into a decision packet, not a
|
|
|
144
141
|
count dump.
|
|
145
142
|
|
|
146
143
|
1. Run read-only review first: `artshelf ledgers list --json`,
|
|
147
|
-
`artshelf review --all --
|
|
144
|
+
`artshelf review --all --agent`, and `artshelf trash list --all --json`.
|
|
148
145
|
2. If cleanup attention exists, run `artshelf cleanup --dry-run --all --json`.
|
|
149
146
|
3. Classify candidates as `trash-safe`, `needs-human-review`,
|
|
150
147
|
`resolve-candidate`, or `registry-problem`.
|
|
151
|
-
4. Use `
|
|
152
|
-
|
|
153
|
-
`
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
148
|
+
4. Use the built-in `--agent` packet when the CLI output is enough to decide,
|
|
149
|
+
because it is deterministic and token-efficient. Use
|
|
150
|
+
`ArtshelfReviewReport` from `schemas/artshelf-review-report.schema.json` and
|
|
151
|
+
`examples/artshelf-review-report.json` when you need a host-specific card,
|
|
152
|
+
attachment, or richer audit record.
|
|
153
|
+
5. Render full packets with `scripts/render-review-report.mjs`; keep
|
|
154
|
+
`decisionSummary` in audit, while `decisionGroups` drive counts. Emojis are encouraged only in host-specific wrappers, not the renderer.
|
|
157
155
|
6. Always include the exact approval target in the message body as a fallback.
|
|
158
156
|
Do not paste the whole packet into chat unless the user asks for it.
|
|
159
157
|
|
|
160
158
|
### Review Plan Report Schema
|
|
161
159
|
|
|
162
|
-
Deterministic renderer:
|
|
160
|
+
Deterministic compact decision card renderer:
|
|
163
161
|
|
|
164
162
|
```bash
|
|
165
163
|
cd /path/to/skills/artshelf
|