artshelf 0.3.0 → 0.4.1

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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Renamed the published package and CLI binary from `shelf` to `artshelf`,
6
+ moved project URLs to `calvinnwq/artshelf`, and prepared public npm publishing.
5
7
  - Added a user-level ledger registry plus `--all` review commands so Artshelf can
6
8
  discover known project/user ledgers from one CLI entry point.
7
9
  - Added read-only `find` and `get` commands for ledger lookup and idempotent
@@ -50,6 +52,51 @@
50
52
  - Tightened the portable agent skill description so the completion-gate trigger
51
53
  is visible before final responses, status updates, handoffs, and done reports.
52
54
 
55
+ ## [0.4.1](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.4.0...artshelf-v0.4.1) (2026-06-05)
56
+
57
+
58
+ ### Bug Fixes
59
+
60
+ * read CLI version from package metadata ([dafffe9](https://github.com/calvinnwq/artshelf/commit/dafffe9c6d1f1d4aba0062ae64b15f8a919b5b62))
61
+ * read CLI version from package metadata ([72dcc9d](https://github.com/calvinnwq/artshelf/commit/72dcc9d03d34f3c688a05a1d767931d82587d88a))
62
+
63
+ ## [0.4.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.3.0...artshelf-v0.4.0) (2026-06-05)
64
+
65
+
66
+ ### Features
67
+
68
+ * **cli:** add approval-first trash list and purge workflow ([20405db](https://github.com/calvinnwq/artshelf/commit/20405db8a7856440afe6aaf487cc156e6c66245d))
69
+ * **cli:** add approval-first trash list and purge workflow ([5a389f3](https://github.com/calvinnwq/artshelf/commit/5a389f3e4f18c75973f29dc727969063e3b3f54b))
70
+ * **cli:** add ledger registry review ([0cbdcc6](https://github.com/calvinnwq/artshelf/commit/0cbdcc6c1c1706b78e84a738fd8dfef900459045))
71
+ * **cli:** add ledger registry review ([d070131](https://github.com/calvinnwq/artshelf/commit/d0701317514f36ee266ca06c30b4ee67a6e45e42))
72
+ * **cli:** add read-only `shelf doctor` health command ([0ce18ea](https://github.com/calvinnwq/artshelf/commit/0ce18ea560ae7f870ea68b7248d097f4c7033b91))
73
+ * **cli:** add read-only `shelf status` dashboard command ([699035c](https://github.com/calvinnwq/artshelf/commit/699035c97009cb29caa0c995025a2d74533e21f1))
74
+ * **cli:** add shelf doctor and status commands ([c0f9a10](https://github.com/calvinnwq/artshelf/commit/c0f9a109cee58de7d7e8cf27e3860fee62941686))
75
+ * **cli:** add shelf lookup commands ([9092ea7](https://github.com/calvinnwq/artshelf/commit/9092ea72695b6b383a8ff3b74ccaabc2974e67fb))
76
+ * **cli:** improve shelf review triage and ledger listing ([6dc3c65](https://github.com/calvinnwq/artshelf/commit/6dc3c65e6837e542510d53890f1f49d3a28e0878))
77
+ * **cli:** optimize cleanup plan lifecycle ([f78773c](https://github.com/calvinnwq/artshelf/commit/f78773ca737b9d7a8318725d63590c9ed8184ba5))
78
+ * **cli:** resolve shelf records ([f21318d](https://github.com/calvinnwq/artshelf/commit/f21318d6edd16a170fcb6539c40899ec8b83c1ba))
79
+ * **cli:** summarize all-ledger review triage ([3284bd8](https://github.com/calvinnwq/artshelf/commit/3284bd886998777bd06a681ab3bfe0b819938c84))
80
+ * **cli:** validate registered ledgers in ledgers list ([327e4f8](https://github.com/calvinnwq/artshelf/commit/327e4f815c814c6b540fcbae8b42dbd8873fb4ab))
81
+ * optimize cleanup plan lifecycle ([4d77b2b](https://github.com/calvinnwq/artshelf/commit/4d77b2bed4a7bc963d2e9900a4dbbf3fed672514))
82
+ * rename Shelf package and CLI to Artshelf ([127649d](https://github.com/calvinnwq/artshelf/commit/127649d3689493700a4ef68922b6a837a2d53fc2))
83
+ * rename shelf to artshelf ([e7d250c](https://github.com/calvinnwq/artshelf/commit/e7d250cee56c27494bae224fe294387497fa8713))
84
+ * resolve shelf records ([dcd5109](https://github.com/calvinnwq/artshelf/commit/dcd5109c5a73f5080d89db51f375b9a5e307c65b))
85
+ * update ledger state after cleanup ([#7](https://github.com/calvinnwq/artshelf/issues/7)) ([31add84](https://github.com/calvinnwq/artshelf/commit/31add8466f0e37e397cfaf3dc146bd8060f57717))
86
+
87
+
88
+ ### Bug Fixes
89
+
90
+ * build artshelf before packing ([470ea86](https://github.com/calvinnwq/artshelf/commit/470ea8637be29978e686f66b2bf1bb838a8a4fa8))
91
+ * clarify approval-only cleanup safety model ([20b8258](https://github.com/calvinnwq/artshelf/commit/20b82584e86a0a8f9b4067d2fbdc94d2c8064253))
92
+ * **cli:** align cleanup preview reuse ([b918a5d](https://github.com/calvinnwq/artshelf/commit/b918a5dc09536a9b87964fbf552b66ea16c0c62a))
93
+ * **cli:** harden registry diagnostics ([098f88e](https://github.com/calvinnwq/artshelf/commit/098f88e9ec8167333cb4d8f67876054b1076f922))
94
+ * **cli:** keep shelf review read-only ([8c417c2](https://github.com/calvinnwq/artshelf/commit/8c417c2e5737ee778c6f7a86b0c7e559d3cae7dc))
95
+ * **cli:** normalize review no-plan output ([57a6275](https://github.com/calvinnwq/artshelf/commit/57a6275b5960385102e8e4c54cfa498404df562d))
96
+ * **cli:** report stale ledgers in all-mode reads ([bc035ef](https://github.com/calvinnwq/artshelf/commit/bc035efbc15ba7877634cb7ec6c0702416d8510b))
97
+ * harden artshelf rename migration ([a84957c](https://github.com/calvinnwq/artshelf/commit/a84957c186f442d9067d07ec132fda4201cbc59e))
98
+ * **trash:** harden purge execution guardrails ([e569b1b](https://github.com/calvinnwq/artshelf/commit/e569b1be4a4f931f856fa9683afcb14023724ad9))
99
+
53
100
  ## [0.3.0](https://github.com/calvinnwq/artshelf/compare/artshelf-v0.2.0...artshelf-v0.3.0) (2026-06-05)
54
101
 
55
102
 
package/README.md CHANGED
@@ -16,13 +16,13 @@ stay out of the way until you need them.
16
16
 
17
17
  ## Status
18
18
 
19
- Artshelf is an early v1 MVP. The CLI is being prepared for npm distribution
20
- under the unscoped `artshelf` package name. The existing local/source install
21
- path remains supported as a fallback while npm publishing is wired up.
19
+ Artshelf is an early v1 MVP. The CLI is distributed under the unscoped
20
+ `artshelf` package name. The existing local/source install path remains supported
21
+ as a fallback.
22
22
 
23
23
  ## Install
24
24
 
25
- Use the npm package once it is published:
25
+ Install the npm package:
26
26
 
27
27
  ```bash
28
28
  npm install -g artshelf
@@ -127,8 +127,9 @@ artshelf list --ledger /tmp/artshelf-ledger.jsonl
127
127
 
128
128
  Artshelf also keeps a small global registry of known ledgers at
129
129
  `~/.shelf/ledgers.json`. Override it with `--registry <path>` or
130
- `ARTSHELF_REGISTRY`. `put` registers its ledger automatically, and you can register
131
- an existing ledger explicitly:
130
+ `ARTSHELF_REGISTRY`; renamed installs still honor legacy `SHELF_REGISTRY` when
131
+ `ARTSHELF_REGISTRY` is unset. `put` registers its ledger automatically, and you
132
+ can register an existing ledger explicitly:
132
133
 
133
134
  ```bash
134
135
  artshelf ledgers list
@@ -245,9 +246,9 @@ purge, and when `artshelf resolve <id> --status resolved --reason <text>` may ma
245
246
  confirmed handled, missing, or no-longer-needed records without moving or
246
247
  deleting files.
247
248
 
248
- From a source checkout, use `skills/artshelf/SKILL.md` directly. Agents should ask
249
- where the user wants Artshelf cloned before installing or linking it. Package-manager
250
- distribution for agent skills can come later.
249
+ The same skill ships in the npm package. From a source checkout, use
250
+ `skills/artshelf/SKILL.md` directly. Agents should ask where the user wants
251
+ Artshelf cloned before installing or linking it.
251
252
 
252
253
  ## Development
253
254
 
@@ -264,6 +265,13 @@ pnpm docs:serve
264
265
 
265
266
  Then open <http://127.0.0.1:8080/>.
266
267
 
268
+ Release Please owns version bumps, changelog updates, tags, and GitHub releases.
269
+ When a Release Please PR is merged and a release is created, the release workflow
270
+ validates the package with `pnpm check` and publishes `artshelf` to npm through
271
+ npm Trusted Publishing. The npm package must have this repository's release
272
+ workflow configured as a trusted publisher; no long-lived npm token is expected
273
+ in GitHub secrets.
274
+
267
275
  During tests or one-off runs, pass both `--ledger <path>` and `--registry <path>`
268
276
  to keep entries and registry updates out of default Artshelf storage.
269
277
 
@@ -274,7 +282,8 @@ covered by tests. See [CONTRIBUTING.md](CONTRIBUTING.md).
274
282
 
275
283
  ## Support And Security
276
284
 
277
- Use GitHub issues for bugs and feature ideas once the public remote exists. See
285
+ Use [GitHub issues](https://github.com/calvinnwq/artshelf/issues) for bugs and
286
+ feature ideas. See
278
287
  [SUPPORT.md](SUPPORT.md) and [SECURITY.md](SECURITY.md).
279
288
 
280
289
  ## License
package/SPEC.md CHANGED
@@ -440,7 +440,12 @@ Default behavior:
440
440
  V1 also supports a user-level registry of known ledgers:
441
441
 
442
442
  - registry: `~/.shelf/ledgers.json`
443
- - `ARTSHELF_REGISTRY` or `--registry <path>` can override the registry path.
443
+ - `--registry <path>` overrides the registry path. Without it,
444
+ `ARTSHELF_REGISTRY` is read first, then legacy `SHELF_REGISTRY`, then the
445
+ default registry path.
446
+ - Retention and due calculations use wall-clock time by default. `ARTSHELF_NOW`
447
+ overrides it for tests and controlled runs; legacy `SHELF_NOW` is read only
448
+ when `ARTSHELF_NOW` is unset.
444
449
  - `put` registers the ledger it writes to.
445
450
  - `ledgers add` registers an existing ledger explicitly.
446
451
  - `--all` reads registered ledgers as one review surface.
@@ -537,7 +542,7 @@ hold, and every future feature (`status`, `doctor`, `review`, scheduled jobs,
537
542
  ...) must preserve them rather than add a shortcut around them:
538
543
 
539
544
  - **No daemon.** Artshelf never runs in the background or watches the clock. It
540
- only does work while you are running a `artshelf` command.
545
+ only does work while you are running an `artshelf` command.
541
546
  - **No auto-execute.** No command cleans up as a side effect. The only commands
542
547
  that move, trash, or delete files are `artshelf cleanup --execute` and
543
548
  `artshelf trash purge --execute`, each run by a human against a separately
@@ -672,4 +677,3 @@ human review.
672
677
  - Retention classes like keep-daily/weekly/monthly.
673
678
  - Dependency roots and pinning.
674
679
  - Credential scanning.
675
- - Public package publishing.
package/dist/src/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync } from "node:fs";
2
+ import { existsSync, readFileSync } from "node:fs";
3
3
  import { appendPreparedRecord, createCleanupPlan, createTrashPurgePlan, dueEntries, executeCleanupPlan, executeTrashPurgePlan, filterRecordsByStatus, findRecords, getRecord, listTrashedRecords, normalizeLedgerPath, prepareRecord, previewCleanupPlan, readLedger, resolveRecord, validateLedger } from "./ledger.js";
4
4
  import { listRegisteredLedgers, normalizeRegistryPath, registerLedger } from "./registry.js";
5
- const VERSION = "0.3.0";
5
+ const VERSION = readPackageVersion();
6
6
  const BOOLEAN_FLAGS = new Set(["all", "json", "manual-review", "dry-run", "execute", "help", "version", "plain"]);
7
7
  const VALUE_FLAGS = new Set([
8
8
  "cleanup",
@@ -21,6 +21,14 @@ const VALUE_FLAGS = new Set([
21
21
  "status",
22
22
  "ttl"
23
23
  ]);
24
+ function readPackageVersion() {
25
+ const packageJsonPath = decodeURIComponent(new URL("../../package.json", import.meta.url).pathname);
26
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
27
+ if (typeof packageJson.version !== "string") {
28
+ throw new Error("package.json version must be a string");
29
+ }
30
+ return packageJson.version;
31
+ }
24
32
  function main(argv) {
25
33
  try {
26
34
  const parsed = parseArgs(argv);
@@ -592,10 +592,9 @@ function registerArtshelfArtifact(ledgerPath, path, input) {
592
592
  labels: input.labels
593
593
  });
594
594
  const records = readLedger(ledgerPath);
595
- const index = records.findIndex((record) => (record.owner === "artshelf" &&
595
+ const index = records.findIndex((record) => (isMatchingArtshelfArtifact(record, path, input.labels) &&
596
596
  record.status === "active" &&
597
- record.path === path &&
598
- sameLabels(record.labels, input.labels)));
597
+ record.path === path));
599
598
  if (index === -1) {
600
599
  appendPreparedRecord(ledgerPath, prepared);
601
600
  return;
@@ -611,10 +610,21 @@ function registerArtshelfArtifact(ledgerPath, path, input) {
611
610
  retention: prepared.retention,
612
611
  kind: prepared.kind,
613
612
  cleanup: prepared.cleanup,
613
+ owner: prepared.owner,
614
614
  labels: prepared.labels
615
615
  };
616
616
  writeLedger(ledgerPath, records);
617
617
  }
618
+ function isMatchingArtshelfArtifact(record, path, labels) {
619
+ if (record.path !== path)
620
+ return false;
621
+ if (record.owner === "artshelf")
622
+ return sameLabels(record.labels, labels);
623
+ if (record.owner !== "shelf")
624
+ return false;
625
+ const legacyLabels = labels.map((label, index) => index === 0 && label === "artshelf" ? "shelf" : label);
626
+ return sameLabels(record.labels, legacyLabels);
627
+ }
618
628
  function sameLabels(left, right) {
619
629
  if (left.length !== right.length)
620
630
  return false;
package/docs/index.html CHANGED
@@ -51,7 +51,7 @@
51
51
  then gives humans and agents a reviewable cleanup plan before anything moves.
52
52
  </p>
53
53
  <div class="actions">
54
- <a class="button primary" href="install.html">Install from source</a>
54
+ <a class="button primary" href="install.html">Install from npm</a>
55
55
  <a class="button" href="quickstart.html">Quickstart</a>
56
56
  <a class="button" href="agent-usage.html">Agent usage</a>
57
57
  <a class="button" href="https://github.com/calvinnwq/artshelf">GitHub</a>
@@ -119,8 +119,8 @@ $ artshelf cleanup --dry-run --json
119
119
  <h2>Pick Your Path</h2>
120
120
  <div class="grid">
121
121
  <a class="doc-card" href="install.html">
122
- <strong>Install from source</strong>
123
- <span>Clone locally, build, link with npm, and smoke-test the CLI.</span>
122
+ <strong>Install from npm</strong>
123
+ <span>Install the package globally, or use source install as the fallback path.</span>
124
124
  </a>
125
125
  <a class="doc-card" href="quickstart.html">
126
126
  <strong>Try the workflow</strong>
@@ -157,7 +157,7 @@ $ artshelf cleanup --dry-run --json
157
157
  <li>Cleanup refuses delete actions; physical trash purge needs its own reviewed plan.</li>
158
158
  </ul>
159
159
  <div class="note">
160
- Artshelf is an early v1 MVP. Source install and live dogfooding come before npm publishing.
160
+ Artshelf is an early v1 MVP. The npm package is the primary install path; source install remains available as a fallback.
161
161
  </div>
162
162
  </section>
163
163
  </article>
package/docs/install.html CHANGED
@@ -42,8 +42,8 @@
42
42
  <p class="eyebrow">Install</p>
43
43
  <h1>Install Artshelf.</h1>
44
44
  <p class="lede">
45
- Artshelf is being prepared for npm distribution under the unscoped
46
- `artshelf` package name. Source install remains the fallback path.
45
+ Artshelf is distributed under the unscoped `artshelf` package name.
46
+ Source install remains the fallback path.
47
47
  </p>
48
48
  </div>
49
49
  <div class="terminal">
@@ -62,8 +62,8 @@ $ artshelf doctor</code></pre>
62
62
  <h2>Requirements</h2>
63
63
  <div class="grid">
64
64
  <div class="card"><h3>Node.js 22+</h3><p>The package declares `node &gt;=22` and CI runs on Node 24.</p></div>
65
- <div class="card"><h3>Corepack</h3><p>Use Corepack to activate the pinned pnpm version from `packageManager`.</p></div>
66
- <div class="card"><h3>Git</h3><p>Clone the public repo and keep source installs easy to update with `git pull`.</p></div>
65
+ <div class="card"><h3>npm or pnpm</h3><p>Install the global package with your preferred Node package manager.</p></div>
66
+ <div class="card"><h3>Source tooling</h3><p>Corepack and Git are only needed when cloning, building, and linking from source.</p></div>
67
67
  </div>
68
68
  </section>
69
69
 
@@ -75,10 +75,6 @@ artshelf doctor</code></pre>
75
75
  <pre><code>pnpm add -g artshelf
76
76
  artshelf --version
77
77
  artshelf doctor</code></pre>
78
- <p>
79
- The npm package exposes `artshelf` as the primary command and keeps
80
- `shelf` as a temporary compatibility alias.
81
- </p>
82
78
  <pre><code>npm uninstall -g artshelf</code></pre>
83
79
  </section>
84
80
 
@@ -88,6 +88,9 @@ $ artshelf --version</code></pre>
88
88
  --registry &lt;path&gt; Use an explicit ledger registry
89
89
  --all Read all registered ledgers for supported commands
90
90
  ARTSHELF_REGISTRY Override the default ledger registry path
91
+ SHELF_REGISTRY Legacy fallback when ARTSHELF_REGISTRY is unset
92
+ ARTSHELF_NOW Override current time for retention and due calculations
93
+ SHELF_NOW Legacy fallback when ARTSHELF_NOW is unset
91
94
  --json Emit machine-readable JSON
92
95
  --help Show help
93
96
  --version Show version</code></pre>
@@ -141,9 +144,10 @@ artshelf get &lt;id&gt; --all --json</code></pre>
141
144
  </p>
142
145
  <p>
143
146
  Artshelf also keeps a user-level registry at `~/.shelf/ledgers.json`. Override it
144
- with <code>--registry &lt;path&gt;</code> or <code>ARTSHELF_REGISTRY</code>. The registry
145
- is a discovery index for supported `--all` review, status, cleanup dry-run, and trash-list commands; project records stay
146
- in their own repo-local ledgers.
147
+ with <code>--registry &lt;path&gt;</code> or <code>ARTSHELF_REGISTRY</code>; legacy
148
+ <code>SHELF_REGISTRY</code> is used only when <code>ARTSHELF_REGISTRY</code> is unset.
149
+ The registry is a discovery index for supported `--all` review, status, cleanup
150
+ dry-run, and trash-list commands; project records stay in their own repo-local ledgers.
147
151
  </p>
148
152
  <pre><code>artshelf ledgers add --ledger &lt;repo&gt;/.shelf/ledger.jsonl --name &lt;project&gt; --scope repo
149
153
  artshelf review --all --json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artshelf",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Tiny CLI for accountable temporary artifact retention.",
5
5
  "type": "module",
6
6
  "author": "Calvin",
@@ -20,8 +20,7 @@
20
20
  "tmp"
21
21
  ],
22
22
  "bin": {
23
- "artshelf": "dist/src/cli.js",
24
- "shelf": "dist/src/cli.js"
23
+ "artshelf": "dist/src/cli.js"
25
24
  },
26
25
  "publishConfig": {
27
26
  "access": "public"
@@ -43,6 +42,8 @@
43
42
  "test": "node --test dist/tests/*.test.js",
44
43
  "check": "pnpm run build && pnpm run test",
45
44
  "docs:serve": "python3 -m http.server 8080 --bind 127.0.0.1 --directory docs",
45
+ "prepack": "pnpm run build",
46
+ "prepublishOnly": "pnpm run build",
46
47
  "start": "node dist/src/cli.js"
47
48
  },
48
49
  "devDependencies": {