-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.mjs
More file actions
95 lines (89 loc) · 5.67 KB
/
Copy pathinstall.mjs
File metadata and controls
95 lines (89 loc) · 5.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env node
// TheColliery — series installer. Pick your "DLC": install the whole suite, or
// just the tools you want. Each tool installs through its OWN native mechanism;
// this script only orchestrates the selection. Node built-ins only, cross-platform.
//
// node install.mjs show the menu
// node install.mjs all install every live tool
// node install.mjs 1 2 3 by number (CoalMine + CoalTipple + CoalBoard)
// node install.mjs coaltipple by name
//
// The authoritative, always-current install steps for each tool live in that
// tool's own README; this runs the same commands. Needs node + git on PATH, and
// (for the CoalMine and CoalTipple plugins) the `claude` CLI.
import { spawnSync } from 'node:child_process';
const sh = process.platform === 'win32';
function run(cmd, args) {
process.stdout.write(`\n$ ${cmd} ${args.join(' ')}\n`);
return spawnSync(cmd, args, { stdio: 'inherit', shell: sh }).status === 0;
}
// install runs ONLY if the marketplace add succeeded — `&&` short-circuits, so a
// failed add never reaches install, and the function still returns false (→ exit 1).
function installCoalMine() {
// CoalMine ships as a Claude Code plugin (marketplace git URL) — see its README.
return run('claude', ['plugin', 'marketplace', 'add', 'HetCreep/CoalMine'])
&& run('claude', ['plugin', 'install', 'coalmine@coalmine']);
}
function installCoalTipple() {
// CoalTipple ships as a Claude Code plugin (marketplace) — see its README; install.mjs
// remains in the repo for non-Claude agents.
return run('claude', ['plugin', 'marketplace', 'add', 'TheColliery/CoalTipple'])
&& run('claude', ['plugin', 'install', 'coaltipple@coaltipple']);
}
function installCoalBoard() {
// CoalBoard ships as a Claude Code plugin (marketplace) — see its README.
return run('claude', ['plugin', 'marketplace', 'add', 'TheColliery/CoalBoard'])
&& run('claude', ['plugin', 'install', 'coalboard@coalboard']);
}
function installCoalHearth() {
// CoalHearth ships as a Claude Code plugin (hook-only; also runs on Antigravity 2.0 via a manual wire — see its README).
return run('claude', ['plugin', 'marketplace', 'add', 'TheColliery/CoalHearth'])
&& run('claude', ['plugin', 'install', 'coalhearth@coalhearth']);
}
function installCoalFace() {
// CoalFace ships as a Claude Code plugin — see its README; other agents
// install by copying skills/coalface into the agent's skills root.
return run('claude', ['plugin', 'marketplace', 'add', 'TheColliery/CoalFace'])
&& run('claude', ['plugin', 'install', 'coalface@coalface']);
}
function installCoalWash() {
// CoalWash ships as a Claude Code plugin (beta) — see its README; other agents
// install by copying skills/coalwash (+ scripts/lib engine) into the agent's skills root.
return run('claude', ['plugin', 'marketplace', 'add', 'TheColliery/CoalWash'])
&& run('claude', ['plugin', 'install', 'coalwash@coalwash']);
}
function installCoalLedger() {
// CoalLedger ships as a Claude Code plugin (beta) — see its README; other agents
// install by copying skills/* (+ scripts/lib engine) into the agent's skills root.
return run('claude', ['plugin', 'marketplace', 'add', 'TheColliery/CoalLedger'])
&& run('claude', ['plugin', 'install', 'coalledger@coalledger']);
}
const DLC = [
{ n: 1, key: 'coalmine', name: 'CoalMine', blurb: '9 quality-canary skills (code-health, grounding, supply-chain, resilience, more)', live: true, install: installCoalMine },
{ n: 2, key: 'coaltipple', name: 'CoalTipple', blurb: 'model/effort router (delegate-down to save tokens, escalate-up for quality)', live: true, install: installCoalTipple },
{ n: 3, key: 'coalboard', name: 'CoalBoard', blurb: 'consensus & debate board (multi-lens review, bounded cost, zero-breakage)', live: true, install: installCoalBoard },
{ n: 4, key: 'coalhearth', name: 'CoalHearth', blurb: 'session warm-resume (journals state; resumes from a recovery block after an interruption)', live: true, install: installCoalHearth },
{ n: 5, key: 'coalface', name: 'CoalFace', blurb: 'fan-out discipline (scout -> waves -> QC -> one writer, solo-cost bound)', live: true, install: installCoalFace },
{ n: 6, key: 'coalwash', name: 'CoalWash', blurb: 'memory washer/defrag (rc; zero-fact-loss gate, human-gated deletes)', live: true, install: installCoalWash },
{ n: 7, key: 'coalledger', name: 'CoalLedger', blurb: 'docs-health canaries (beta; 6+1 over a CommonMark+GFM AST engine)', live: true, install: installCoalLedger },
];
function menu() {
console.log('\nTheColliery — pick your DLC:\n');
for (const d of DLC) console.log(` [${d.n}] ${d.name.padEnd(11)} ${d.blurb}${d.live ? '' : ' (not yet public)'}`);
console.log('\nInstall: node install.mjs all | node install.mjs 1 2 3 | node install.mjs coalboard\n');
}
const args = process.argv.slice(2).map((a) => a.toLowerCase());
if (!args.length) { menu(); process.exit(0); }
const pick = args.includes('all')
? DLC.filter((d) => d.live)
: DLC.filter((d) => args.includes(String(d.n)) || args.includes(d.key));
if (!pick.length) { console.error('Nothing matched.\n'); menu(); process.exit(2); }
let failed = 0, done = 0;
for (const d of pick) {
if (!d.live) { console.log(`\n${d.name}: not yet public — skipped.`); continue; }
console.log(`\n=== Installing ${d.name} ===`);
if (d.install()) { console.log(`\n${d.name}: installed.`); done++; }
else { console.error(`\n${d.name}: install FAILED (see output; its README has the manual steps).`); failed++; }
}
console.log(`\nDone. ${done} tool(s) installed${failed ? `, ${failed} failed` : ''}.`);
process.exit(failed ? 1 : 0);