agent-economy 0.2.1 → 0.2.2
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/README.md +10 -0
- package/package.json +4 -1
- package/packs/registry.json +1 -2
- package/src/cli.js +31 -0
package/README.md
CHANGED
|
@@ -48,6 +48,16 @@ You can't police teammates' machines — you can police the repo:
|
|
|
48
48
|
- run: npx agent-economy verify --min-level strict
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
## Development
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm test # hermetic node:test suite
|
|
55
|
+
git config core.hooksPath .githooks # pre-commit verify (one-time per clone)
|
|
56
|
+
node src/cli.js packs --check # curated specs vs upstream HEAD (weekly in CI)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Releases: push a tag (`git tag vX.Y.Z && git push --tags`) — the `release` workflow runs the tests, then publishes to npm via **OIDC trusted publishing** (no token secret). One-time setup on npmjs.com: package → Settings → Trusted Publisher → `markymakes-dev/agent-economy` · workflow `release.yml`.
|
|
60
|
+
|
|
51
61
|
## Packs
|
|
52
62
|
|
|
53
63
|
Curated, attributed, pinned fetch-on-demand integrations - never vendored:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-economy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"files": [
|
|
5
5
|
"src",
|
|
6
6
|
"packs",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"ae": "src/cli.js",
|
|
16
16
|
"economy": "src/cli.js"
|
|
17
17
|
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "node --test"
|
|
20
|
+
},
|
|
18
21
|
"engines": {
|
|
19
22
|
"node": ">=18"
|
|
20
23
|
},
|
package/packs/registry.json
CHANGED
|
@@ -34,13 +34,12 @@
|
|
|
34
34
|
"kind": "harness",
|
|
35
35
|
"status": "curated",
|
|
36
36
|
"install": [
|
|
37
|
-
{ "from": ".agents/skills/strategic-compact", "to": "strategic-compact" },
|
|
38
37
|
{ "from": ".agents/skills/verification-loop", "to": "verification-loop" },
|
|
39
38
|
{ "from": ".agents/skills/change-impact", "to": "change-impact" },
|
|
40
39
|
{ "from": ".agents/skills/coding-standards", "to": "coding-standards" },
|
|
41
40
|
{ "from": ".agents/skills/security-review", "to": "security-review" }
|
|
42
41
|
],
|
|
43
|
-
"note": "Request-economy-relevant subset of ECC's harness skills
|
|
42
|
+
"note": "Request-economy-relevant subset of ECC's harness skills. strategic-compact excluded: it pushes manual /compact at token thresholds, which conflicts with proxy-based compaction (billion-context) that owns the compaction lane. ECC-specific skills like ecc-conventions deliberately excluded"
|
|
44
43
|
},
|
|
45
44
|
{
|
|
46
45
|
"id": "anthropic-skills",
|
package/src/cli.js
CHANGED
|
@@ -162,6 +162,34 @@ async function installPack(id, dir) {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
async function checkPack(id) {
|
|
166
|
+
const reg = JSON.parse(fs.readFileSync(path.join(ROOT, "packs", "registry.json"), "utf8"));
|
|
167
|
+
const list = id ? reg.packs.filter((p) => p.id === id) : reg.packs.filter((p) => Array.isArray(p.install) && p.install.length);
|
|
168
|
+
if (!list.length) { console.error(id ? ` ✘ unknown pack "${id}"` : " = no installable packs"); process.exit(id ? 2 : 0); }
|
|
169
|
+
const work = fs.mkdtempSync(path.join(os.tmpdir(), "ae-check-"));
|
|
170
|
+
let bad = 0;
|
|
171
|
+
try {
|
|
172
|
+
for (const p of list) {
|
|
173
|
+
const url = `https://codeload.github.com/${p.source}/tar.gz/refs/heads/${p.ref || "main"}`;
|
|
174
|
+
console.log(` … ${p.id} (${p.source}@${p.ref || "main"})`);
|
|
175
|
+
const res = await fetch(url);
|
|
176
|
+
if (!res.ok) { console.log(` ✘ download failed: HTTP ${res.status}`); bad++; continue; }
|
|
177
|
+
const tgz = path.join(work, `${p.id}.tgz`);
|
|
178
|
+
fs.writeFileSync(tgz, Buffer.from(await res.arrayBuffer()));
|
|
179
|
+
const r = spawnSync("tar", ["-tzf", tgz], { encoding: "utf8", maxBuffer: 128 * 1024 * 1024 });
|
|
180
|
+
if (r.status !== 0) { console.log(" ✘ tar listing failed"); bad++; continue; }
|
|
181
|
+
const files = new Set(r.stdout.split(/\r?\n/).map((f) => f.replace(/^[^/]+\//, "")));
|
|
182
|
+
const missing = p.install.filter((s) => !files.has(`${s.from}/SKILL.md`));
|
|
183
|
+
if (missing.length) { for (const s of missing) console.log(` ✘ drift: ${s.from}/SKILL.md gone from upstream`); bad++; }
|
|
184
|
+
else console.log(` ✔ ${p.install.length}/${p.install.length} specs present`);
|
|
185
|
+
}
|
|
186
|
+
} finally {
|
|
187
|
+
fs.rmSync(work, { recursive: true, force: true });
|
|
188
|
+
}
|
|
189
|
+
console.log(bad ? ` ✘ ${bad} pack(s) drifted — update packs/registry.json` : " = all curated install specs match upstream HEAD");
|
|
190
|
+
process.exit(bad ? 1 : 0);
|
|
191
|
+
}
|
|
192
|
+
|
|
165
193
|
function listDir(p, filter) {
|
|
166
194
|
try { return fs.readdirSync(p, { withFileTypes: true }).filter((d) => filter(d, p)).map((d) => d.name); }
|
|
167
195
|
catch { return []; }
|
|
@@ -255,6 +283,7 @@ const HELP = `
|
|
|
255
283
|
packs List curated third-party rule/skill packs
|
|
256
284
|
--install <id> [--dir <target>] fetch + install a curated pack
|
|
257
285
|
(default target: ~/.claude/skills)
|
|
286
|
+
--check [id] validate install specs against upstream HEAD
|
|
258
287
|
skill Install the agent-economy-setup skill (teaches any agent to run ae)
|
|
259
288
|
help This text
|
|
260
289
|
|
|
@@ -306,6 +335,8 @@ async function main() {
|
|
|
306
335
|
if (cmd === "skill") return skill(get("--dir"));
|
|
307
336
|
if (cmd === "inventory") return inventory();
|
|
308
337
|
if (cmd === "packs") {
|
|
338
|
+
const cid = get("--check");
|
|
339
|
+
if (hasFlag("--check")) return checkPack(cid && !cid.startsWith("--") ? cid : undefined);
|
|
309
340
|
if (get("--install")) return installPack(get("--install"), get("--dir"));
|
|
310
341
|
return packs();
|
|
311
342
|
}
|