ctrlai 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/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PartKit authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ "PartKit Attested" is a reserved mark. The code is MIT; the attestation mark
26
+ is not — see docs/01-prd.md §10.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # ctrlai
2
+
3
+ Verified, attested standard parts for AI coding agents — **the agent writes only the seams.**
4
+
5
+ Ctrl AI packages each product capability (transactional email, webhook ingestion, auth, billing, …) as a **part**: vendored code with a machine-readable contract, a conformance test suite every adapter must pass, and a continuously re-issued signed attestation. Parts are copied into your repo shadcn-style — you own every line, you can read every line, and a boundary guard makes sure nobody (human or agent) edits part interiors and silently voids the attestation.
6
+
7
+ ## Status: pre-v0
8
+
9
+ The hosted registry (`registry.partkit.dev`) is **live** and serves the catalogue, so `ctrlai add` works out of the box. Attestations are dev-tier (unsigned; real signing is on the roadmap). Watch [partkit.dev](https://partkit.dev) for the public launch.
10
+
11
+ ## Commands
12
+
13
+ | Command | What it does |
14
+ |---|---|
15
+ | `ctrlai init` | Install the boundary guard (pre-commit + CI), `parts.lock`, and `AGENTS.md` rules |
16
+ | `ctrlai add <targets...>` | Vendor parts, a pack, or `part[@version][:adapter]` specs — resolves order, pulls `requires`, skips installed. e.g. `ctrlai add saas` or `ctrlai add email.transactional:postmark storage.upload` |
17
+ | `ctrlai plan <capabilities...>` | Resolve capabilities into a deterministic install plan (no changes made) |
18
+ | `ctrlai audit` | Did the repo respect its contracts? Boundary + attestations + routes/env/sprawl in one pass |
19
+ | `ctrlai upgrade <part>` | Upgrade a part's version and/or flip its adapter — you get only the seam changes |
20
+ | `ctrlai verify` | Verify attestation integrity (hard fail) and freshness (warn; `--strict` to fail) |
21
+ | `ctrlai guard` | Fail if `parts/**` no longer matches `parts.lock` |
22
+ | `ctrlai migrate` | Apply pending part-owned database migrations |
23
+
24
+ A **pack** is a curated capability kit for a product shape — `ctrlai add saas` installs the whole Team-SaaS skeleton (auth, billing, email, webhooks, jobs, storage, rate limiting, audit, admin) in one command, resolving order and picking sensible default adapters.
25
+
26
+ ## The idea in one paragraph
27
+
28
+ Agents regenerate the same infrastructure on every project, slightly differently every time, unverified and unmaintained. Ctrl AI gives agents a catalog of standard parts they can trust and never regenerate: contracts erase the differences between vendors, conformance suites make adapter claims true, attestations expire so "verified" always means *recently*. The agent's job shrinks to the seams — the part of your product that should be different.
29
+
30
+ MIT licensed. © PartKit authors.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,653 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from "node:child_process";
3
+ import process from "node:process";
4
+ import { Command } from "commander";
5
+ import { DEFAULT_REGISTRY, GUARD_MESSAGE, MIGRATIONS_TABLE, addParts, auditRepo, doctorRepo, ejectPart, guardRepo, initRepo, inspectRepo, openRegistry, planMigrations, provisionRepo, readLockfile, resolvePlan, runMigrations, upgradePart, verifyRepo, wireRepo, } from "@ctrlai/core";
6
+ function fail(e) {
7
+ console.error(`✖ ${e instanceof Error ? e.message : String(e)}`);
8
+ process.exit(1);
9
+ }
10
+ function pad(s, n) {
11
+ return s.length >= n ? s : s + " ".repeat(n - s.length);
12
+ }
13
+ /**
14
+ * Render a DashboardStatus as an ASCII inventory: one status lane per part
15
+ * (version → latest, bound vendor + swap alternatives, attestation health),
16
+ * the capability wiring, and the vendor-swap surface. The data is inspectRepo's
17
+ * — this only prints it.
18
+ */
19
+ function renderDashboard(d) {
20
+ const net = d.registryReachable ? "online" : "offline — latest unknown";
21
+ console.log(`CTRL AI DASHBOARD · ${d.counts.parts} part(s) · ${d.registrySource} (${net})\n`);
22
+ if (d.parts.length === 0) {
23
+ console.log("No parts installed yet.");
24
+ console.log(" → ctrlai add saas install the whole SaaS kit in one command");
25
+ console.log(" → ctrlai plan <caps...> resolve capabilities into an install plan");
26
+ return;
27
+ }
28
+ const icon = (s) => (s === "fail" ? "✖" : s === "warn" ? "⚠" : "✔");
29
+ const verCol = (p) => p.upgradeAvailable && p.latest !== null
30
+ ? `${p.version} → ${p.latest} (${p.upgradeKind})`
31
+ : p.version;
32
+ const adapterCol = (p) => {
33
+ if (p.adapter === null)
34
+ return "self-host";
35
+ const others = p.vendorAlternatives.filter((a) => !a.current).map((a) => a.adapter);
36
+ return others.length > 0 ? `${p.adapter} (+${others.join(",")})` : p.adapter;
37
+ };
38
+ const attestCol = (p) => p.missing
39
+ ? "MISSING"
40
+ : p.drift
41
+ ? "DRIFT"
42
+ : p.attestation.stale
43
+ ? `EXPIRED ${Math.abs(p.attestation.daysToExpiry)}d ago`
44
+ : `fresh ${p.attestation.daysToExpiry}d`;
45
+ const rows = d.parts.map((p) => ({
46
+ icon: icon(p.state),
47
+ name: p.name,
48
+ ver: verCol(p),
49
+ adapter: adapterCol(p),
50
+ attest: attestCol(p),
51
+ }));
52
+ const wName = Math.max(4, ...rows.map((r) => r.name.length));
53
+ const wVer = Math.max(7, ...rows.map((r) => r.ver.length));
54
+ const wAdapter = Math.max(7, ...rows.map((r) => r.adapter.length));
55
+ for (const r of rows) {
56
+ console.log(` ${r.icon} ${pad(r.name, wName)} ${pad(r.ver, wVer)} ${pad(r.adapter, wAdapter)} ${r.attest}`);
57
+ }
58
+ const c = d.counts;
59
+ console.log(`\n${c.parts} part(s) · ${c.upgradable} upgradable · ${c.drifted} drifted · ${c.stale} attestation(s) expired`);
60
+ const depEdges = d.graph.edges.filter((e) => e.kind !== "deployed-via-vendor");
61
+ if (depEdges.length > 0) {
62
+ const wFrom = Math.max(...depEdges.map((e) => e.from.length));
63
+ console.log("\nARCHITECTURE (capability wiring)");
64
+ for (const e of depEdges)
65
+ console.log(` ${pad(e.from, wFrom)} → ${pad(e.to, wFrom)} ${e.kind}`);
66
+ }
67
+ const vended = d.parts.filter((p) => p.adapter !== null);
68
+ if (vended.length > 0) {
69
+ console.log("\nVENDORS (bound adapter · one-command swap)");
70
+ for (const p of vended) {
71
+ const others = p.vendorAlternatives.filter((a) => !a.current).map((a) => a.adapter);
72
+ const alt = others.length > 0
73
+ ? ` ⇄ ${others.join(", ")} (ctrlai upgrade ${p.name} --adapter=…)`
74
+ : "";
75
+ console.log(` ${p.name} → ${p.adapter}${alt}`);
76
+ }
77
+ }
78
+ if (c.devTier > 0) {
79
+ console.log(`\nnote: ${c.devTier} attestation(s) are dev-tier (unsigned) — fine locally, not production-signed.`);
80
+ }
81
+ }
82
+ /**
83
+ * Render a DoctorResult as per-part status lanes: each installed part's runtime
84
+ * health (routes mounted, migrations applied, env set + valid, DB seam wired,
85
+ * adapter consistent), worst-first. Mechanical failures get ✖; heuristics ⚠.
86
+ */
87
+ function renderDoctor(d) {
88
+ const dbCol = d.dbReachable === null ? "no DB parts" : d.dbReachable ? "reachable" : "unreachable";
89
+ console.log(`CTRL AI DOCTOR · ${d.parts.length} part(s) · db: ${dbCol}${d.strict ? " · strict" : ""}\n`);
90
+ const icon = (s) => (s === "fail" ? "✖" : s === "warn" ? "⚠" : "✔");
91
+ const mark = (l) => l === "fail" ? "✖" : l === "warn" ? "⚠" : "·";
92
+ if (d.parts.length === 0)
93
+ console.log("No parts installed yet — `ctrlai add <part>`.");
94
+ for (const p of d.parts) {
95
+ console.log(` ${icon(p.state)} ${p.name}`);
96
+ for (const c of p.checks) {
97
+ console.log(` ${icon(c.level)} ${c.key.padEnd(11)}${c.summary}`);
98
+ for (const f of c.findings) {
99
+ if (f.level === "info")
100
+ continue;
101
+ console.log(` ${mark(f.level)} ${f.message}`);
102
+ if (f.fix !== undefined)
103
+ console.log(` → ${f.fix}`);
104
+ }
105
+ }
106
+ }
107
+ if (d.notes.length > 0) {
108
+ console.log("\nrepo:");
109
+ for (const n of d.notes) {
110
+ console.log(` ${mark(n.level)} ${n.message}`);
111
+ if (n.fix !== undefined)
112
+ console.log(` → ${n.fix}`);
113
+ }
114
+ }
115
+ const { pass, warn, fail } = d.counts;
116
+ console.log(`\n${pass} clean · ${warn} warning(s) · ${fail} failure(s)`);
117
+ }
118
+ /**
119
+ * Render a ProvisionResult as an ordered, checkable setup flow: per part, each
120
+ * human vendor step with `{ENV_VAR}` placeholders already substituted to concrete
121
+ * values (the exact redirect URI, the webhook URL), its state, and the env it verifies.
122
+ */
123
+ function renderProvision(p) {
124
+ const total = p.parts.reduce((n, pt) => n + pt.steps.length, 0);
125
+ console.log(`CTRL AI PROVISION · ${total} step(s) · ${p.parts.length} part(s)\n`);
126
+ if (total === 0) {
127
+ console.log("No installed part declares vendor provisioning steps yet.");
128
+ return;
129
+ }
130
+ const stateIcon = (s) => s === "done" ? "✔" : s === "partial" ? "◐" : s === "todo" ? "○" : "·";
131
+ for (const part of p.parts) {
132
+ console.log(part.name);
133
+ part.steps.forEach((s, i) => {
134
+ const vendor = s.vendor !== null ? `[${s.vendor}] ` : "";
135
+ console.log(` ${i + 1}. ${stateIcon(s.state)} ${vendor}${s.state}`);
136
+ console.log(` ${s.instruction}`);
137
+ if (s.verifyEnv.length > 0) {
138
+ const env = s.verifyEnv
139
+ .map((e) => (e.valid ? `✔ ${e.key}` : e.set ? `⚠ ${e.key} (${e.problem})` : `✖ ${e.key}`))
140
+ .join(" ");
141
+ console.log(` env: ${env}`);
142
+ }
143
+ if (s.unresolved.length > 0) {
144
+ console.log(` ⚠ set ${s.unresolved.join(", ")} to resolve the exact value(s) above.`);
145
+ }
146
+ });
147
+ console.log("");
148
+ }
149
+ const c = p.counts;
150
+ console.log(`${c.done} done · ${c.partial} partial · ${c.todo} todo · ${c.manual} manual`);
151
+ }
152
+ const program = new Command();
153
+ program
154
+ .name("ctrlai")
155
+ .description("Verified, attested standard parts for AI coding agents")
156
+ .version("0.4.1");
157
+ program
158
+ .command("init")
159
+ .description("Install the boundary guard (pre-commit + CI), parts.lock, and AGENTS.md")
160
+ .option("--registry <source>", "registry source (local path until the hosted registry is live)", DEFAULT_REGISTRY)
161
+ .action(async (o) => {
162
+ try {
163
+ const res = await initRepo(process.cwd(), { registrySource: o.registry });
164
+ for (const c of res.created)
165
+ console.log(` + ${c}`);
166
+ for (const s of res.skipped)
167
+ console.log(` = ${s} (already present)`);
168
+ for (const w of res.warnings)
169
+ console.log(` ! ${w}`);
170
+ console.log("\nDone. Agents that open this repo will read AGENTS.md and learn the rules.");
171
+ }
172
+ catch (e) {
173
+ fail(e);
174
+ }
175
+ });
176
+ program
177
+ .command("plan")
178
+ .description("Resolve capabilities into a deterministic install plan (the resolver, docs/03 §4)")
179
+ .argument("<capabilities...>", "capability names, e.g. email.transactional webhooks.ingest")
180
+ .option("--registry <source>", "registry source (default: parts.lock's, else the hosted registry)")
181
+ .option("--allow-community", "accept community-tier adapters")
182
+ .option("--json", "print the raw plan JSON")
183
+ .action(async (capabilities, o) => {
184
+ try {
185
+ const lf = await readLockfile(process.cwd());
186
+ const registry = await openRegistry(o.registry ?? lf?.registry.source ?? DEFAULT_REGISTRY);
187
+ const plan = await resolvePlan(registry, {
188
+ capabilities,
189
+ lockfile: lf,
190
+ ...(o.allowCommunity === true && { policy: { trust: "allow-community" } }),
191
+ });
192
+ if (o.json === true) {
193
+ console.log(JSON.stringify(plan, null, 2));
194
+ return;
195
+ }
196
+ for (const s of plan.already_satisfied) {
197
+ console.log(`= ${s.capability} already provided by ${s.part}@${s.version}`);
198
+ }
199
+ for (const e of plan.install_order) {
200
+ const adapter = e.adapter !== null
201
+ ? ` --adapter=${e.adapter}`
202
+ : e.adapter_choices !== undefined
203
+ ? ` --adapter=${e.adapter_choices.join("|")}`
204
+ : "";
205
+ console.log(`→ ctrlai add ${e.part}${adapter} (${e.reason})`);
206
+ }
207
+ if (plan.env_required.length > 0)
208
+ console.log(`env: ${plan.env_required.join(", ")}`);
209
+ console.log(`migrations: ${plan.migrations}`);
210
+ for (const s of plan.seams_to_write)
211
+ console.log(`seam: ${s}`);
212
+ for (const n of plan.notes)
213
+ console.log(`note: ${n}`);
214
+ for (const r of plan.rules)
215
+ console.log(`rule: ${r}`);
216
+ }
217
+ catch (e) {
218
+ fail(e);
219
+ }
220
+ });
221
+ program
222
+ .command("add")
223
+ .description("Vendor parts, packs, or part:adapter specs — resolves order, pulls requires, skips installed")
224
+ .argument("<targets...>", "parts, packs, or part[@version][:adapter] — e.g. saas, email.transactional:postmark")
225
+ .option("--adapter <name>", "adapter for a single part (or use part:adapter)")
226
+ .option("--part-version <semver>", "version for a single part (or use part@version)")
227
+ .option("--registry <source>", "override the registry recorded in parts.lock")
228
+ .option("--allow-community", "accept community-tier adapters (conformance not run in our CI)")
229
+ .action(async (targets, o) => {
230
+ try {
231
+ // Back-compat: --adapter / --part-version apply to a single target.
232
+ let raw = targets;
233
+ if (o.adapter !== undefined || o.partVersion !== undefined) {
234
+ if (targets.length !== 1) {
235
+ throw new Error("--adapter / --part-version apply to one part; for several, use part@version:adapter syntax.");
236
+ }
237
+ let t = targets[0];
238
+ if (o.partVersion !== undefined)
239
+ t = `${t}@${o.partVersion}`;
240
+ if (o.adapter !== undefined)
241
+ t = `${t}:${o.adapter}`;
242
+ raw = [t];
243
+ }
244
+ const res = await addParts(process.cwd(), {
245
+ targets: raw,
246
+ ...(o.registry !== undefined && { registrySource: o.registry }),
247
+ ...(o.allowCommunity !== undefined && { allowCommunity: o.allowCommunity }),
248
+ });
249
+ for (const pk of res.packs) {
250
+ console.log(`▪ pack ${pk.pack} — ${pk.capabilities.length} capabilities`);
251
+ }
252
+ for (const s of res.alreadySatisfied) {
253
+ console.log(`= ${s.capability} already provided by ${s.part}@${s.version}`);
254
+ }
255
+ for (const r of res.installed) {
256
+ const adapterNote = r.adapter !== null ? ` (adapter: ${r.adapter})` : "";
257
+ console.log(`✔ ${r.name}@${r.version}${adapterNote} vendored into parts/`);
258
+ const addedDeps = Object.entries(r.npmDependencies.added);
259
+ if (addedDeps.length > 0) {
260
+ console.log(` npm: + ${addedDeps.map(([n, v]) => `${n}@${v}`).join(", ")}`);
261
+ }
262
+ for (const w of r.warnings)
263
+ console.log(` ! ${w}`);
264
+ }
265
+ if (res.installed.length > 0) {
266
+ if (res.envRequired.length > 0) {
267
+ console.log(`\nenv: fill in ${res.envRequired.join(", ")} (.env.example scaffolded)`);
268
+ }
269
+ console.log(`migrations: ${res.migrations}`);
270
+ console.log("\nNow write the seams (the only code you touch):");
271
+ for (const s of res.seams)
272
+ console.log(` - ${s}`);
273
+ }
274
+ for (const n of res.notes)
275
+ console.log(`note: ${n}`);
276
+ if (res.failed !== null) {
277
+ console.error(`\n✖ ${res.failed.part}: ${res.failed.error}`);
278
+ if (res.notLanded.length > 0) {
279
+ console.error(` not attempted: ${res.notLanded.join(", ")} — fix the above and re-run to resume.`);
280
+ }
281
+ process.exit(1);
282
+ }
283
+ if (res.installed.length === 0 && res.packs.length === 0) {
284
+ console.log("Nothing to install — everything requested is already in parts.lock.");
285
+ }
286
+ }
287
+ catch (e) {
288
+ fail(e);
289
+ }
290
+ });
291
+ program
292
+ .command("wire")
293
+ .description("Scaffold the real wiring so the app boots: route files, the DB executor seam, the tsconfig alias — idempotent, never clobbers your edits")
294
+ .option("--dry-run", "show what would be written without touching the filesystem")
295
+ .option("--force", "overwrite even files you have edited since they were generated")
296
+ .action(async (o) => {
297
+ try {
298
+ const res = await wireRepo(process.cwd(), {
299
+ dryRun: o.dryRun === true,
300
+ force: o.force === true,
301
+ });
302
+ const icon = (s) => s === "created" ? "+" : s === "updated" ? "~" : s === "skipped" ? "⚠" : "=";
303
+ console.log(`CTRL AI WIRE · ${res.framework}${o.dryRun === true ? " · dry-run" : ""}\n`);
304
+ if (res.framework === "none") {
305
+ for (const n of res.notes)
306
+ console.log(` ! ${n}`);
307
+ return;
308
+ }
309
+ for (const f of res.files) {
310
+ const note = f.reason !== undefined ? ` (${f.reason})` : "";
311
+ console.log(` ${icon(f.status)} ${pad(f.status, 9)} ${f.kind.padEnd(9)} ${f.path}${note}`);
312
+ }
313
+ for (const n of res.notes)
314
+ console.log(`\n ! ${n}`);
315
+ const n = (s) => res.files.filter((f) => f.status === s).length;
316
+ console.log(`\n${n("created")} created · ${n("updated")} updated · ${n("unchanged")} unchanged · ${n("skipped")} left as-is`);
317
+ if (o.dryRun !== true && n("created") + n("updated") > 0) {
318
+ console.log("Run `ctrlai doctor` to verify, then fill the env and `ctrlai migrate`.");
319
+ }
320
+ }
321
+ catch (e) {
322
+ fail(e);
323
+ }
324
+ });
325
+ program
326
+ .command("verify")
327
+ .description("Verify attestation integrity (hard fail) and freshness (warn; --strict to fail)")
328
+ .option("--strict", "treat staleness and unsigned dev attestations as failures")
329
+ .action(async (o) => {
330
+ try {
331
+ const res = await verifyRepo(process.cwd(), { strict: o.strict === true });
332
+ for (const f of res.findings) {
333
+ const icon = f.level === "fail" ? "✖" : "⚠";
334
+ console.log(`${icon} [${f.code}] ${f.part}: ${f.message}`);
335
+ }
336
+ if (!res.ok) {
337
+ console.error("\nctrlai verify failed.");
338
+ process.exit(1);
339
+ }
340
+ const warnNote = res.findings.length > 0 ? " (with warnings)" : "";
341
+ console.log(`✔ ${res.checked} part(s) verified${warnNote}`);
342
+ }
343
+ catch (e) {
344
+ fail(e);
345
+ }
346
+ });
347
+ program
348
+ .command("audit")
349
+ .description("Did this repo respect its contracts? Boundary + attestations + routes/env/sprawl in one pass")
350
+ .option("--strict", "treat staleness and unsigned dev attestations as failures")
351
+ .option("--json", "print the raw audit result as JSON")
352
+ .action(async (o) => {
353
+ try {
354
+ const res = await auditRepo(process.cwd(), { strict: o.strict === true });
355
+ if (o.json === true) {
356
+ console.log(JSON.stringify(res, null, 2));
357
+ if (!res.ok)
358
+ process.exit(1);
359
+ return;
360
+ }
361
+ const icon = (l) => l === "fail" ? "✖" : l === "warn" ? "⚠" : "✔";
362
+ console.log(`CTRL AI AUDIT · ${res.parts} part(s) · ${res.checks.length} checks\n`);
363
+ for (const c of res.checks) {
364
+ console.log(` ${icon(c.level)} ${c.key.padEnd(13)} ${c.summary}`);
365
+ for (const f of c.findings) {
366
+ const mark = f.level === "fail" ? "✖" : f.level === "warn" ? "⚠" : "·";
367
+ console.log(` ${mark} ${f.message}`);
368
+ if (f.fix !== undefined)
369
+ console.log(` → ${f.fix}`);
370
+ }
371
+ }
372
+ const { pass, warn, fail } = res.counts;
373
+ console.log(`\n${pass} clean · ${warn} warning(s) · ${fail} failure(s)`);
374
+ if (!res.ok) {
375
+ console.error("\nctrlai audit failed — a contract was not respected.");
376
+ process.exit(1);
377
+ }
378
+ console.log("Boundary intact, attestations verified. Warnings are guidance, not gates" +
379
+ (warn > 0 ? " — each lists the seam-side fix." : "."));
380
+ }
381
+ catch (e) {
382
+ fail(e);
383
+ }
384
+ });
385
+ program
386
+ .command("doctor")
387
+ .description("Does the WIRED app work? Routes mounted, migrations applied, env set + valid, DB seam wired — per part")
388
+ .option("--strict", "treat warnings (unset env, unconfirmed seams) as failures at the gate")
389
+ .option("--json", "print the raw DoctorResult as JSON")
390
+ .option("--database-url <url>", "Postgres connection string for the migrations lane (default: $DATABASE_URL)")
391
+ .action(async (o) => {
392
+ try {
393
+ // The migrations lane needs a live connection (as `ctrlai migrate` does);
394
+ // core stays driver-free, so build the pg executor here. An unset or
395
+ // unreachable DB is non-fatal — that lane degrades to a warning.
396
+ const url = o.databaseUrl ?? process.env.DATABASE_URL;
397
+ let executor = null;
398
+ let cleanup = null;
399
+ if (url !== undefined && url !== "") {
400
+ try {
401
+ const { default: pg } = await import("pg");
402
+ const client = new pg.Client({ connectionString: url });
403
+ await client.connect();
404
+ cleanup = () => client.end();
405
+ executor = {
406
+ query: async (sql, params) => {
407
+ const res = await client.query(sql, params === undefined ? undefined : [...params]);
408
+ return { rows: res.rows };
409
+ },
410
+ };
411
+ }
412
+ catch {
413
+ executor = null; // unreachable → the migrations lane warns, doctor continues
414
+ cleanup = null;
415
+ }
416
+ }
417
+ let exitCode = 0;
418
+ try {
419
+ const d = await doctorRepo(process.cwd(), { strict: o.strict === true, executor });
420
+ if (o.json === true) {
421
+ console.log(JSON.stringify(d, null, 2));
422
+ }
423
+ else {
424
+ renderDoctor(d);
425
+ if (!d.ok) {
426
+ console.error(d.strict
427
+ ? "\nctrlai doctor failed (strict) — clear the failures and warnings above."
428
+ : "\nctrlai doctor failed — the wired app has a blocking problem above.");
429
+ }
430
+ else if (d.counts.warn > 0) {
431
+ console.log("\nNo blocking failures. Warnings are guidance — each lists the fix.");
432
+ }
433
+ else {
434
+ console.log("\n✔ the wired app checks out.");
435
+ }
436
+ }
437
+ if (!d.ok)
438
+ exitCode = 1;
439
+ }
440
+ finally {
441
+ if (cleanup !== null)
442
+ await cleanup();
443
+ }
444
+ if (exitCode !== 0)
445
+ process.exit(exitCode);
446
+ }
447
+ catch (e) {
448
+ fail(e);
449
+ }
450
+ });
451
+ program
452
+ .command("provision")
453
+ .description("Guided, checkable vendor setup: each human step with concrete values substituted (exact redirect URI, webhook URL) + env verification")
454
+ .argument("[part]", "limit to a single installed part")
455
+ .option("--json", "print the raw ProvisionResult as JSON")
456
+ .action(async (part, o) => {
457
+ try {
458
+ const res = await provisionRepo(process.cwd(), part !== undefined ? { part } : {});
459
+ if (o.json === true) {
460
+ console.log(JSON.stringify(res, null, 2));
461
+ return;
462
+ }
463
+ renderProvision(res);
464
+ }
465
+ catch (e) {
466
+ fail(e);
467
+ }
468
+ });
469
+ program
470
+ .command("dashboard")
471
+ .description("Your stack at a glance: installed parts, versions, vendors, upgrades, drift, attestation health")
472
+ .option("--json", "print the raw DashboardStatus as JSON")
473
+ .option("--push [url]", "push this snapshot to your Ctrl AI account (default: https://app.partkit.dev/api/snapshots)")
474
+ .option("--token <token>", "API key for --push (or set PARTKIT_TOKEN)")
475
+ .option("--app <name>", "app name to record the snapshot under (default: current directory name)")
476
+ .action(async (o) => {
477
+ try {
478
+ const d = await inspectRepo(process.cwd());
479
+ if (o.push !== undefined && o.push !== false) {
480
+ const url = typeof o.push === "string" ? o.push : "https://app.partkit.dev/api/snapshots";
481
+ const token = o.token ?? process.env.PARTKIT_TOKEN;
482
+ if (token === undefined || token === "") {
483
+ fail(new Error("--push needs an API key — pass --token <key> or set PARTKIT_TOKEN."));
484
+ }
485
+ const app = o.app ?? (process.cwd().split(/[/\\]/).filter(Boolean).pop() ?? "app");
486
+ let res;
487
+ try {
488
+ res = await fetch(url, {
489
+ method: "POST",
490
+ headers: { "content-type": "application/json", authorization: `Bearer ${token}` },
491
+ body: JSON.stringify({ app, status: d }),
492
+ });
493
+ }
494
+ catch (e) {
495
+ throw new Error(`push failed: ${e instanceof Error ? e.message : String(e)}`);
496
+ }
497
+ if (!res.ok) {
498
+ throw new Error(`push failed: ${res.status} ${res.statusText} — ${await res.text()}`);
499
+ }
500
+ console.log(`✔ pushed "${app}" to ${url} (${d.counts.parts} parts, ${d.counts.upgradable} upgradable)`);
501
+ return;
502
+ }
503
+ if (o.json === true) {
504
+ console.log(JSON.stringify(d, null, 2));
505
+ return;
506
+ }
507
+ renderDashboard(d);
508
+ }
509
+ catch (e) {
510
+ fail(e);
511
+ }
512
+ });
513
+ program
514
+ .command("upgrade")
515
+ .description("Upgrade a part's version and/or flip its adapter — interiors change mechanically, you get only the seam changes")
516
+ .argument("<part>", "installed part name")
517
+ .option("--adapter <name>", "switch to this adapter (the one-commit vendor flip)")
518
+ .option("--part-version <semver>", "target version (default: registry latest)")
519
+ .option("--registry <source>", "override the registry recorded in parts.lock")
520
+ .option("--allow-community", "accept community-tier adapters")
521
+ .action(async (part, o) => {
522
+ try {
523
+ const res = await upgradePart(process.cwd(), {
524
+ name: part,
525
+ ...(o.adapter !== undefined && { adapter: o.adapter }),
526
+ ...(o.partVersion !== undefined && { version: o.partVersion }),
527
+ ...(o.registry !== undefined && { registrySource: o.registry }),
528
+ ...(o.allowCommunity !== undefined && { allowCommunity: o.allowCommunity }),
529
+ });
530
+ if (!res.changed) {
531
+ console.log(`= ${res.name} unchanged (${res.to.version}, adapter: ${res.to.adapter ?? "none"})`);
532
+ }
533
+ else {
534
+ const flip = res.from.adapter !== res.to.adapter ? ` · adapter ${res.from.adapter ?? "none"} → ${res.to.adapter ?? "none"}` : "";
535
+ console.log(`✔ ${res.name} ${res.from.version} → ${res.to.version}${flip}`);
536
+ const added = Object.entries(res.npmDependencies.added);
537
+ if (added.length > 0) {
538
+ console.log(` npm: added ${added.map(([n, r]) => `${n}@${r}`).join(", ")} to package.json — run your package manager's install`);
539
+ }
540
+ if (res.seamChanges !== null) {
541
+ console.log(`\nSeam changes you must make:\n${res.seamChanges}`);
542
+ }
543
+ }
544
+ for (const w of res.warnings)
545
+ console.log(` ! ${w}`);
546
+ }
547
+ catch (e) {
548
+ fail(e);
549
+ }
550
+ });
551
+ program
552
+ .command("eject")
553
+ .description("Sanctioned exit: move a part out of the boundary, void its attestation — you own the code from here")
554
+ .argument("<part>", "installed part name")
555
+ .option("--to <dir>", "destination directory relative to the repo root (default: ejected/<part>)")
556
+ .action(async (part, o) => {
557
+ try {
558
+ const res = await ejectPart(process.cwd(), {
559
+ name: part,
560
+ ...(o.to !== undefined && { to: o.to }),
561
+ });
562
+ console.log(`✔ ${res.name} ejected: ${res.from} → ${res.to}`);
563
+ for (const w of res.warnings)
564
+ console.log(` ! ${w}`);
565
+ }
566
+ catch (e) {
567
+ fail(e);
568
+ }
569
+ });
570
+ program
571
+ .command("migrate")
572
+ .description(`Apply pending part-owned database migrations (recorded in ${MIGRATIONS_TABLE})`)
573
+ .option("--dry-run", "print the plan without applying anything")
574
+ .option("--database-url <url>", "Postgres connection string (default: $DATABASE_URL)")
575
+ .action(async (o) => {
576
+ try {
577
+ const url = o.databaseUrl ?? process.env.DATABASE_URL;
578
+ if (url === undefined || url === "") {
579
+ throw new Error("DATABASE_URL is not set — export it or pass --database-url.");
580
+ }
581
+ const { default: pg } = await import("pg");
582
+ const client = new pg.Client({ connectionString: url });
583
+ await client.connect();
584
+ const executor = {
585
+ query: async (sql, params) => {
586
+ const res = await client.query(sql, params === undefined ? undefined : [...params]);
587
+ return { rows: res.rows };
588
+ },
589
+ };
590
+ try {
591
+ if (o.dryRun === true) {
592
+ const plan = await planMigrations(process.cwd(), executor);
593
+ for (const m of plan.pending) {
594
+ console.log(` → ${m.part}: ${m.name}${m.transactional ? "" : " (no-transaction)"}`);
595
+ }
596
+ for (const r of plan.orphaned) {
597
+ console.log(` ! ledger row for uninstalled part ${r.part} (${r.name}) — left untouched`);
598
+ }
599
+ console.log(plan.pending.length === 0
600
+ ? `✔ database is up to date (${plan.applied.length} migration(s) applied)`
601
+ : `${plan.pending.length} pending, ${plan.applied.length} applied — run without --dry-run to apply`);
602
+ }
603
+ else {
604
+ const res = await runMigrations(process.cwd(), executor);
605
+ for (const m of res.applied)
606
+ console.log(` ✔ ${m.part}: ${m.name}`);
607
+ for (const r of res.orphaned) {
608
+ console.log(` ! ledger row for uninstalled part ${r.part} (${r.name}) — left untouched`);
609
+ }
610
+ console.log(res.applied.length === 0
611
+ ? `✔ database is up to date (${res.alreadyApplied} migration(s) applied)`
612
+ : `✔ applied ${res.applied.length} migration(s); ledger: ${MIGRATIONS_TABLE}`);
613
+ }
614
+ }
615
+ finally {
616
+ await client.end();
617
+ }
618
+ }
619
+ catch (e) {
620
+ fail(e);
621
+ }
622
+ });
623
+ program
624
+ .command("guard")
625
+ .description("Boundary guard: fail if parts/** no longer matches parts.lock")
626
+ .option("--staged", "pre-commit mode: skip quickly when nothing under parts/ is staged")
627
+ .action(async (o) => {
628
+ try {
629
+ if (o.staged === true) {
630
+ const out = execFileSync("git", ["diff", "--cached", "--name-only"], {
631
+ encoding: "utf8",
632
+ });
633
+ const touched = out
634
+ .split("\n")
635
+ .filter((l) => l.startsWith("parts/") || l === "parts.lock");
636
+ if (touched.length === 0)
637
+ return;
638
+ }
639
+ const res = await guardRepo(process.cwd());
640
+ if (!res.ok) {
641
+ for (const p of res.problems)
642
+ console.error(`✖ ${p}`);
643
+ console.error(`\n${GUARD_MESSAGE}`);
644
+ process.exit(1);
645
+ }
646
+ console.log("✔ part boundary intact");
647
+ }
648
+ catch (e) {
649
+ fail(e);
650
+ }
651
+ });
652
+ program.parseAsync(process.argv).catch(fail);
653
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,cAAc,EACd,aAAa,E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KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,KAAK,aAAa,EAAE,CAAC,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "ctrlai",
3
+ "version": "0.4.1",
4
+ "description": "Verified, attested standard parts for AI coding agents — the CLI",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "homepage": "https://partkit.dev",
8
+ "keywords": [
9
+ "ai-agents",
10
+ "claude-code",
11
+ "scaffolding",
12
+ "registry",
13
+ "attestation",
14
+ "standard-parts",
15
+ "codegen"
16
+ ],
17
+ "bin": {
18
+ "ctrlai": "./dist/cli.js"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsc -p tsconfig.json",
25
+ "prepublishOnly": "tsc -b"
26
+ },
27
+ "dependencies": {
28
+ "@ctrlai/core": "^0.4.0",
29
+ "commander": "^12.1.0",
30
+ "pg": "^8.21.0"
31
+ },
32
+ "engines": {
33
+ "node": ">=22"
34
+ },
35
+ "devDependencies": {
36
+ "@types/pg": "^8.20.0"
37
+ }
38
+ }