plumbbob 0.5.4 → 0.6.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.
Files changed (80) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +9 -0
  3. package/dist/cli-core.js +4 -0
  4. package/dist/lib/agents.js +498 -0
  5. package/dist/lib/intent.js +98 -8
  6. package/dist/lib/settings.js +17 -0
  7. package/dist/lib/sidecar.js +36 -0
  8. package/dist/verbs/agent.js +312 -0
  9. package/dist/verbs/checkpoint.js +2 -1
  10. package/dist/verbs/doctor.js +96 -3
  11. package/dist/verbs/status.js +64 -2
  12. package/node_modules/checkride/CHANGELOG.md +139 -0
  13. package/node_modules/checkride/LICENSE +21 -0
  14. package/node_modules/checkride/README.md +179 -0
  15. package/node_modules/checkride/dist/adapters.d.ts +56 -0
  16. package/node_modules/checkride/dist/adapters.d.ts.map +1 -0
  17. package/node_modules/checkride/dist/adapters.js +219 -0
  18. package/node_modules/checkride/dist/adapters.js.map +1 -0
  19. package/node_modules/checkride/dist/cli.d.ts +29 -0
  20. package/node_modules/checkride/dist/cli.d.ts.map +1 -0
  21. package/node_modules/checkride/dist/cli.js +227 -0
  22. package/node_modules/checkride/dist/cli.js.map +1 -0
  23. package/node_modules/checkride/dist/config.d.ts +74 -0
  24. package/node_modules/checkride/dist/config.d.ts.map +1 -0
  25. package/node_modules/checkride/dist/config.js +126 -0
  26. package/node_modules/checkride/dist/config.js.map +1 -0
  27. package/node_modules/checkride/dist/doctor.d.ts +76 -0
  28. package/node_modules/checkride/dist/doctor.d.ts.map +1 -0
  29. package/node_modules/checkride/dist/doctor.js +299 -0
  30. package/node_modules/checkride/dist/doctor.js.map +1 -0
  31. package/node_modules/checkride/dist/index.d.ts +18 -0
  32. package/node_modules/checkride/dist/index.d.ts.map +1 -0
  33. package/node_modules/checkride/dist/index.js +13 -0
  34. package/node_modules/checkride/dist/index.js.map +1 -0
  35. package/node_modules/checkride/dist/init.d.ts +64 -0
  36. package/node_modules/checkride/dist/init.d.ts.map +1 -0
  37. package/node_modules/checkride/dist/init.js +489 -0
  38. package/node_modules/checkride/dist/init.js.map +1 -0
  39. package/node_modules/checkride/dist/links.d.ts +23 -0
  40. package/node_modules/checkride/dist/links.d.ts.map +1 -0
  41. package/node_modules/checkride/dist/links.js +125 -0
  42. package/node_modules/checkride/dist/links.js.map +1 -0
  43. package/node_modules/checkride/dist/orchestrator.d.ts +96 -0
  44. package/node_modules/checkride/dist/orchestrator.d.ts.map +1 -0
  45. package/node_modules/checkride/dist/orchestrator.js +234 -0
  46. package/node_modules/checkride/dist/orchestrator.js.map +1 -0
  47. package/node_modules/checkride/package.json +76 -0
  48. package/node_modules/checkride/templates/flat/fallow.toml +26 -0
  49. package/node_modules/checkride/templates/flat/pnpm-workspace.yaml +6 -0
  50. package/node_modules/checkride/templates/flat/tsconfig.json +9 -0
  51. package/node_modules/checkride/templates/hybrid/fallow.toml +42 -0
  52. package/node_modules/checkride/templates/hybrid/pnpm-workspace.yaml +6 -0
  53. package/node_modules/checkride/templates/hybrid/tsconfig.json +12 -0
  54. package/node_modules/checkride/templates/monorepo/fallow.toml +44 -0
  55. package/node_modules/checkride/templates/monorepo/pnpm-workspace.yaml +7 -0
  56. package/node_modules/checkride/templates/monorepo/tsconfig.json +7 -0
  57. package/node_modules/checkride/templates/shared/cspell.json +35 -0
  58. package/node_modules/checkride/templates/shared/gitignore +10 -0
  59. package/node_modules/checkride/templates/shared/markdownlint-cli2.jsonc +11 -0
  60. package/node_modules/checkride/templates/shared/npmrc +1 -0
  61. package/node_modules/checkride/templates/shared/oxlintrc.json +33 -0
  62. package/node_modules/checkride/templates/shared/rules/no-class.yml +8 -0
  63. package/node_modules/checkride/templates/shared/rules/no-deep-sibling-import.yml +15 -0
  64. package/node_modules/checkride/templates/shared/rules/no-default-export.yml +9 -0
  65. package/node_modules/checkride/templates/shared/rules/require-js-extension.yml +21 -0
  66. package/node_modules/checkride/templates/shared/sgconfig.yml +2 -0
  67. package/node_modules/checkride/templates/shared/tsconfig.base.json +28 -0
  68. package/node_modules/checkride/templates/shared/vitest.config.ts.template +27 -0
  69. package/package.json +4 -1
  70. package/skills/pb-build/SKILL.md +42 -7
  71. package/skills/pb-finish/SKILL.md +1 -1
  72. package/skills/pb-harvest/SKILL.md +1 -1
  73. package/skills/pb-park/SKILL.md +1 -1
  74. package/skills/pb-plan/SKILL.md +25 -4
  75. package/skills/pb-refine/SKILL.md +1 -1
  76. package/skills/pb-revert/SKILL.md +1 -1
  77. package/skills/pb-spike/SKILL.md +1 -1
  78. package/skills/pb-status/SKILL.md +1 -1
  79. package/skills/pb-step/SKILL.md +10 -2
  80. package/skills/pb-verify/SKILL.md +21 -6
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Configuration: load `checkride.config.json`, detect installed tools, and
3
+ * resolve each slot to an adapter (or a skip reason).
4
+ *
5
+ * Resolution rule per slot (see plan §4):
6
+ * 1. config entry wins — string picks an adapter; `false` disables the slot;
7
+ * `{ use, ...overrides }` picks an adapter with overrides; `{ command, args }`
8
+ * is a custom check needing no adapter.
9
+ * 2. otherwise detection — the first registry adapter for the slot whose
10
+ * `detect` files exist (or whose `detect` is empty, i.e. always available).
11
+ * 3. otherwise the slot is skipped (skipped ≠ failed).
12
+ */
13
+ import { existsSync, readFileSync } from 'node:fs';
14
+ import { join } from 'node:path';
15
+ const CONFIG_FILE = 'checkride.config.json';
16
+ /** Read and parse `checkride.config.json` from `cwd`, or `null` when absent. */
17
+ export function loadConfig(cwd) {
18
+ const path = join(cwd, CONFIG_FILE);
19
+ if (!existsSync(path))
20
+ return null;
21
+ const text = readFileSync(path, 'utf8');
22
+ try {
23
+ const config = JSON.parse(text);
24
+ return config;
25
+ }
26
+ catch (err) {
27
+ const reason = err instanceof Error ? err.message : String(err);
28
+ throw new Error(`invalid ${CONFIG_FILE}: ${reason}`, { cause: err });
29
+ }
30
+ }
31
+ function byName(name, adapters) {
32
+ return adapters.find((a) => a.name === name) ?? null;
33
+ }
34
+ /** First adapter for `slot` whose detect files are present (empty detect = always). */
35
+ function detectAdapter(slot, adapters, fileExists) {
36
+ for (const a of adapters) {
37
+ if (a.slot !== slot)
38
+ continue;
39
+ if (a.detect.length === 0 || a.detect.some((f) => fileExists(f)))
40
+ return a;
41
+ }
42
+ return null;
43
+ }
44
+ function applyOverrides(base, o) {
45
+ return {
46
+ ...base,
47
+ ...(o.command !== undefined ? { command: o.command } : {}),
48
+ ...(o.args !== undefined ? { args: o.args } : {}),
49
+ ...(o.outputFile !== undefined ? { outputFile: o.outputFile } : {}),
50
+ ...(o.changedArgs !== undefined ? { changedArgs: o.changedArgs } : {}),
51
+ ...(o.fixArgs !== undefined ? { fixArgs: o.fixArgs } : {}),
52
+ ...(o.timeout !== undefined ? { timeout: o.timeout } : {}),
53
+ ...(o.description !== undefined ? { description: o.description } : {}),
54
+ };
55
+ }
56
+ function customAdapter(slot, c) {
57
+ return {
58
+ name: c.name ?? `custom:${slot}`,
59
+ slot,
60
+ description: c.description ?? `Custom ${slot} check`,
61
+ detect: [],
62
+ command: c.command,
63
+ args: c.args ?? [],
64
+ outputFile: c.outputFile ?? null,
65
+ ...(c.changedArgs !== undefined ? { changedArgs: c.changedArgs } : {}),
66
+ ...(c.fixArgs !== undefined ? { fixArgs: c.fixArgs } : {}),
67
+ ...(c.timeout !== undefined ? { timeout: c.timeout } : {}),
68
+ devDeps: {},
69
+ };
70
+ }
71
+ function active(slot, adapter) {
72
+ return { slot: slot.name, optIn: slot.optIn ?? false, adapter, skip: null };
73
+ }
74
+ function skipped(slot, reason) {
75
+ return { slot: slot.name, optIn: slot.optIn ?? false, adapter: null, skip: reason };
76
+ }
77
+ function resolveOne(slot, entry, adapters, fileExists) {
78
+ if (entry === false) {
79
+ return skipped(slot, 'disabled in checkride.config.json');
80
+ }
81
+ if (typeof entry === 'string') {
82
+ const adapter = byName(entry, adapters);
83
+ return adapter
84
+ ? active(slot, adapter)
85
+ : skipped(slot, `configured adapter '${entry}' is not in the registry`);
86
+ }
87
+ if (entry && typeof entry === 'object') {
88
+ if ('use' in entry) {
89
+ const base = byName(entry.use, adapters);
90
+ return base
91
+ ? active(slot, applyOverrides(base, entry))
92
+ : skipped(slot, `configured adapter '${entry.use}' is not in the registry`);
93
+ }
94
+ if ('command' in entry) {
95
+ return active(slot, customAdapter(slot.name, entry));
96
+ }
97
+ }
98
+ const detected = detectAdapter(slot.name, adapters, fileExists);
99
+ return detected ? active(slot, detected) : skipped(slot, 'no tool detected for slot');
100
+ }
101
+ /**
102
+ * Resolve every catalogue slot (in order) to an adapter or a skip reason, and
103
+ * fold in any config-only custom checks (an object with a `command`, keyed by a
104
+ * name not in the catalogue — e.g. a project's `"licenses"` check). Each custom
105
+ * check runs ahead of the catalogue (`order: 'first'`) or after it (`'last'`,
106
+ * the default); within a group, config key order is preserved.
107
+ */
108
+ export function resolveChecks(input) {
109
+ const cwd = input.cwd ?? process.cwd();
110
+ const fileExists = input.fileExists ?? ((file) => existsSync(join(cwd, file)));
111
+ const checks = input.config?.checks ?? {};
112
+ const catalogue = input.slots.map((slot) => resolveOne(slot, checks[slot.name], input.adapters, fileExists));
113
+ const catalogueNames = new Set(input.slots.map((s) => s.name));
114
+ const firsts = [];
115
+ const lasts = [];
116
+ for (const [name, entry] of Object.entries(checks)) {
117
+ if (catalogueNames.has(name))
118
+ continue;
119
+ if (entry && typeof entry === 'object' && !('use' in entry) && 'command' in entry) {
120
+ const resolved = active({ name }, customAdapter(name, entry));
121
+ (entry.order === 'first' ? firsts : lasts).push(resolved);
122
+ }
123
+ }
124
+ return [...firsts, ...catalogue, ...lasts];
125
+ }
126
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM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ED,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * `checkride doctor` — read-only environment + tooling verification.
3
+ *
4
+ * Ported from the reference `scaffold-check.mjs`. Verifies node/pnpm/git are
5
+ * present at the required versions, the project has been installed, and `.check/`
6
+ * is writable. It then enumerates *every* catalogue slot — not just the ones the
7
+ * default run executes — and reports each slot's enablement (default / opt-in /
8
+ * disabled / unavailable) alongside its tool presence, so off and opt-in slots
9
+ * are visible instead of silently dropped. Renders a human table (or `--json`)
10
+ * and exits 0 when everything required is present, 1 otherwise. Only slots that
11
+ * run by default are required; opt-in/disabled/unavailable slots never fail it.
12
+ *
13
+ * Every environment touch (PATH, fs, package.json) goes through an injectable
14
+ * {@link DoctorEnv}, so the logic is unit-testable without a real toolchain.
15
+ */
16
+ import type { Adapter, Slot } from './adapters.js';
17
+ import type { CheckrideConfig } from './config.js';
18
+ import type { Out } from './orchestrator.js';
19
+ export type DoctorStatus = 'ok' | 'outdated' | 'missing' | 'unknown' | 'n/a';
20
+ /** Why a slot is, or is not, part of the default `checkride` run. */
21
+ export type SlotEnablement = 'default' | 'opt-in' | 'disabled' | 'unavailable';
22
+ export type DoctorCheck = {
23
+ name: string;
24
+ category: 'env' | 'install' | 'tool' | 'workspace';
25
+ required: boolean;
26
+ status: DoctorStatus;
27
+ found: string | null;
28
+ expected: string | null;
29
+ hint: string | null;
30
+ /** Slot name (category `'tool'` rows only). */
31
+ slot?: string;
32
+ /** Adapter filling the slot, or `null` when nothing does. */
33
+ adapter?: string | null;
34
+ /** Slot enablement (category `'tool'` rows only). */
35
+ enablement?: SlotEnablement;
36
+ };
37
+ export type DoctorReport = {
38
+ ok: boolean;
39
+ platform: {
40
+ os: string;
41
+ arch: string;
42
+ };
43
+ checks: DoctorCheck[];
44
+ };
45
+ export type DoctorResult = {
46
+ ok: boolean;
47
+ report: DoctorReport;
48
+ exitCode: number;
49
+ };
50
+ /** Every environment touch, injectable for tests. */
51
+ export type DoctorEnv = {
52
+ which: (cmd: string) => Promise<string | null>;
53
+ version: (cmd: string, args: string[]) => Promise<string | null>;
54
+ exists: (path: string) => boolean;
55
+ canWrite: (dir: string) => Promise<boolean>;
56
+ readEngines: (cwd: string) => {
57
+ node?: string;
58
+ pnpm?: string;
59
+ };
60
+ platform: () => {
61
+ os: string;
62
+ arch: string;
63
+ };
64
+ };
65
+ export type DoctorOptions = {
66
+ cwd?: string;
67
+ json?: boolean;
68
+ stdout?: Out;
69
+ slots?: readonly Slot[];
70
+ adapters?: readonly Adapter[];
71
+ config?: CheckrideConfig | null;
72
+ env?: DoctorEnv;
73
+ };
74
+ /** Run the doctor against `cwd`; render and return the report. */
75
+ export declare function runDoctor(options: DoctorOptions): Promise<DoctorResult>;
76
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,aAAa,CAAC;AAElE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAG7C,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;AAE7E,qEAAqE;AACrE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC;AAE/E,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,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MAAM,CAAA;KAAE,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AA+PF,kEAAkE;AAClE,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAwC7E"}
@@ -0,0 +1,299 @@
1
+ /**
2
+ * `checkride doctor` — read-only environment + tooling verification.
3
+ *
4
+ * Ported from the reference `scaffold-check.mjs`. Verifies node/pnpm/git are
5
+ * present at the required versions, the project has been installed, and `.check/`
6
+ * is writable. It then enumerates *every* catalogue slot — not just the ones the
7
+ * default run executes — and reports each slot's enablement (default / opt-in /
8
+ * disabled / unavailable) alongside its tool presence, so off and opt-in slots
9
+ * are visible instead of silently dropped. Renders a human table (or `--json`)
10
+ * and exits 0 when everything required is present, 1 otherwise. Only slots that
11
+ * run by default are required; opt-in/disabled/unavailable slots never fail it.
12
+ *
13
+ * Every environment touch (PATH, fs, package.json) goes through an injectable
14
+ * {@link DoctorEnv}, so the logic is unit-testable without a real toolchain.
15
+ */
16
+ import { execFile } from 'node:child_process';
17
+ import { existsSync, readFileSync } from 'node:fs';
18
+ import { mkdir, rm, writeFile } from 'node:fs/promises';
19
+ import { arch as osArch, platform as osPlatform } from 'node:os';
20
+ import { join } from 'node:path';
21
+ import { promisify } from 'node:util';
22
+ import { ADAPTERS, SLOTS } from './adapters.js';
23
+ import { loadConfig, resolveChecks } from './config.js';
24
+ import { selectChecks } from './orchestrator.js';
25
+ const execFileP = promisify(execFile);
26
+ const INSTALL_HINTS = {
27
+ node: 'Install Node >=22.18: https://nodejs.org/ or `nvm install 22 && nvm use 22`',
28
+ pnpm: 'Install pnpm >=9: `corepack enable && corepack prepare pnpm@latest --activate`',
29
+ git: 'Install git: https://git-scm.com/downloads',
30
+ install: 'Run `pnpm install` from the repo root.',
31
+ };
32
+ async function whichReal(cmd) {
33
+ try {
34
+ const { stdout } = await execFileP(process.platform === 'win32' ? 'where' : 'which', [cmd]);
35
+ const first = stdout.split('\n').find((l) => l.trim());
36
+ return first ? first.trim() : null;
37
+ }
38
+ catch {
39
+ return null;
40
+ }
41
+ }
42
+ async function versionReal(cmd, args) {
43
+ try {
44
+ const { stdout } = await execFileP(cmd, args, { timeout: 5000 });
45
+ return stdout.trim();
46
+ }
47
+ catch {
48
+ return null;
49
+ }
50
+ }
51
+ async function canWriteReal(dir) {
52
+ try {
53
+ await mkdir(dir, { recursive: true });
54
+ const probe = join(dir, `.write-probe-${process.pid}`);
55
+ await writeFile(probe, '');
56
+ await rm(probe, { force: true });
57
+ return true;
58
+ }
59
+ catch {
60
+ return false;
61
+ }
62
+ }
63
+ function readEnginesReal(cwd) {
64
+ try {
65
+ const raw = readFileSync(join(cwd, 'package.json'), 'utf8');
66
+ const pkg = JSON.parse(raw);
67
+ return pkg.engines ?? {};
68
+ }
69
+ catch {
70
+ return {};
71
+ }
72
+ }
73
+ const realEnv = {
74
+ which: whichReal,
75
+ version: versionReal,
76
+ exists: existsSync,
77
+ canWrite: canWriteReal,
78
+ readEngines: readEnginesReal,
79
+ platform: () => ({ os: osPlatform(), arch: osArch() }),
80
+ };
81
+ function parseSemver(text) {
82
+ if (!text)
83
+ return null;
84
+ const m = /(\d+)\.(\d+)\.(\d+)/.exec(text);
85
+ if (!m)
86
+ return null;
87
+ return { major: Number(m[1]), minor: Number(m[2]), patch: Number(m[3]), raw: m[0] };
88
+ }
89
+ function compareSemver(a, b) {
90
+ if (a.major !== b.major)
91
+ return a.major - b.major;
92
+ if (a.minor !== b.minor)
93
+ return a.minor - b.minor;
94
+ return a.patch - b.patch;
95
+ }
96
+ function formatExpected(min) {
97
+ return `>=${min.major}.${min.minor}.${min.patch}`;
98
+ }
99
+ async function checkVersioned(name, cmd, min, env) {
100
+ const expected = formatExpected(min);
101
+ const path = await env.which(cmd);
102
+ if (!path) {
103
+ return { name, category: 'env', required: true, status: 'missing', found: null, expected, hint: INSTALL_HINTS[name] ?? `Install \`${cmd}\`.` };
104
+ }
105
+ const found = parseSemver(await env.version(cmd, ['--version']));
106
+ if (!found) {
107
+ return { name, category: 'env', required: true, status: 'unknown', found: null, expected, hint: `Could not parse \`${cmd} --version\` output.` };
108
+ }
109
+ if (compareSemver(found, min) < 0) {
110
+ return { name, category: 'env', required: true, status: 'outdated', found: found.raw, expected, hint: INSTALL_HINTS[name] ?? `Upgrade \`${cmd}\` to ${expected}.` };
111
+ }
112
+ return { name, category: 'env', required: true, status: 'ok', found: found.raw, expected, hint: null };
113
+ }
114
+ async function checkPresent(name, cmd, env) {
115
+ const path = await env.which(cmd);
116
+ if (!path) {
117
+ return { name, category: 'env', required: true, status: 'missing', found: null, expected: 'present on PATH', hint: INSTALL_HINTS[name] ?? `Install \`${cmd}\`.` };
118
+ }
119
+ const raw = await env.version(cmd, ['--version']);
120
+ return { name, category: 'env', required: true, status: 'ok', found: raw ?? path, expected: 'present on PATH', hint: null };
121
+ }
122
+ function checkInstall(cwd, env) {
123
+ if (!env.exists(join(cwd, 'pnpm-lock.yaml'))) {
124
+ return { name: 'install', category: 'install', required: true, status: 'missing', found: null, expected: 'pnpm-lock.yaml present', hint: INSTALL_HINTS['install'] ?? null };
125
+ }
126
+ if (!env.exists(join(cwd, 'node_modules'))) {
127
+ return { name: 'install', category: 'install', required: true, status: 'missing', found: 'lockfile only', expected: 'node_modules/ populated', hint: INSTALL_HINTS['install'] ?? null };
128
+ }
129
+ return { name: 'install', category: 'install', required: true, status: 'ok', found: 'node_modules + lockfile', expected: null, hint: null };
130
+ }
131
+ /** Presence-only probe: does the adapter's tool binary resolve? */
132
+ async function probeTool(adapter, cwd, env) {
133
+ if (adapter.builtin) {
134
+ return { status: 'ok', found: 'built-in', expected: null, hint: null };
135
+ }
136
+ if (adapter.command === 'pnpm' && adapter.args[0] === 'exec') {
137
+ const tool = adapter.args[1];
138
+ if (!tool)
139
+ return { status: 'unknown', found: null, expected: null, hint: null };
140
+ const bin = join(cwd, 'node_modules', '.bin', tool);
141
+ return env.exists(bin)
142
+ ? { status: 'ok', found: bin, expected: `node_modules/.bin/${tool}`, hint: null }
143
+ : { status: 'missing', found: null, expected: `node_modules/.bin/${tool}`, hint: `Run \`pnpm install\` (or add ${tool}).` };
144
+ }
145
+ const path = await env.which(adapter.command);
146
+ return path
147
+ ? { status: 'ok', found: path, expected: `${adapter.command} on PATH`, hint: null }
148
+ : { status: 'missing', found: null, expected: `${adapter.command} on PATH`, hint: `Install \`${adapter.command}\`.` };
149
+ }
150
+ /** What an unavailable slot could be turned on with: candidate adapters + their detect files. */
151
+ function possibilitiesHint(slot, adapters) {
152
+ const candidates = adapters.filter((a) => a.slot === slot);
153
+ if (candidates.length === 0)
154
+ return null;
155
+ const parts = candidates.map((a) => {
156
+ const files = a.detect.length > 0 ? a.detect.slice(0, 2).join(' or ') : 'always available';
157
+ return `${a.name} (${files})`;
158
+ });
159
+ return `Enable by adding one of: ${parts.join(', ')}.`;
160
+ }
161
+ /**
162
+ * Build a doctor row for one resolved catalogue slot, classified by enablement.
163
+ * Only `default` slots are required; `opt-in`/`disabled`/`unavailable` slots are
164
+ * surfaced for visibility but never fail the report.
165
+ */
166
+ async function classifySlot(r, defaultActive, adapters, config, cwd, env) {
167
+ const base = { category: 'tool', slot: r.slot, adapter: r.adapter?.name ?? null };
168
+ // Explicitly disabled in config: off by the user's choice.
169
+ if (config?.checks?.[r.slot] === false) {
170
+ return { ...base, name: r.slot, required: false, status: 'n/a', enablement: 'disabled', found: r.skip ?? 'disabled in checkride.config.json', expected: null, hint: null };
171
+ }
172
+ // No adapter fills the slot: nothing to run. Point at what would enable it.
173
+ if (!r.adapter) {
174
+ return { ...base, name: r.slot, required: false, status: 'n/a', enablement: 'unavailable', found: r.skip ?? 'no tool detected', expected: null, hint: possibilitiesHint(r.slot, adapters) };
175
+ }
176
+ // Adapter resolved: probe the tool, classify by default-run membership.
177
+ const probe = await probeTool(r.adapter, cwd, env);
178
+ const isDefault = defaultActive.has(r.slot);
179
+ const enablement = isDefault ? 'default' : 'opt-in';
180
+ const hint = isDefault
181
+ ? probe.hint
182
+ : `Opt-in — run with \`--include ${r.slot}\` or \`--all\`.${probe.status === 'missing' ? ' Tool not installed.' : ''}`;
183
+ return { ...base, name: `${r.adapter.name} (${r.slot})`, required: isDefault, status: probe.status, enablement, found: probe.found, expected: probe.expected, hint };
184
+ }
185
+ async function checkWritable(cwd, env) {
186
+ const dir = join(cwd, '.check');
187
+ const ok = await env.canWrite(dir);
188
+ return ok
189
+ ? { name: '.check', category: 'workspace', required: true, status: 'ok', found: 'writable', expected: 'writable', hint: null }
190
+ : { name: '.check', category: 'workspace', required: true, status: 'missing', found: 'not writable', expected: 'writable', hint: `Ensure ${dir} is writable.` };
191
+ }
192
+ function statusMark(status) {
193
+ if (status === 'ok')
194
+ return '✔';
195
+ if (status === 'outdated')
196
+ return '⚠';
197
+ if (status === 'n/a')
198
+ return '·';
199
+ return '✘';
200
+ }
201
+ /** Glyph for a slot row — driven by enablement, since "off" is not "broken". */
202
+ function slotMark(c) {
203
+ if (c.enablement === 'default')
204
+ return c.status === 'ok' ? '✔' : '✘';
205
+ if (c.enablement === 'opt-in')
206
+ return '○';
207
+ return '·'; // disabled / unavailable: off, not a failure
208
+ }
209
+ /** Short presence note for a slot row (full paths stay in the JSON report). */
210
+ function slotNote(c) {
211
+ if (c.enablement === 'disabled')
212
+ return 'disabled in config';
213
+ if (c.enablement === 'unavailable')
214
+ return 'no tool detected';
215
+ if (c.status === 'ok')
216
+ return c.found === 'built-in' ? 'built-in' : 'installed';
217
+ if (c.status === 'missing')
218
+ return 'not installed';
219
+ return c.status;
220
+ }
221
+ const GROUPS = [
222
+ { key: 'env', label: 'ENVIRONMENT' },
223
+ { key: 'install', label: 'INSTALL' },
224
+ { key: 'tool', label: 'CHECKS' },
225
+ { key: 'workspace', label: 'WORKSPACE' },
226
+ ];
227
+ function renderToolRow(c, out) {
228
+ const slot = (c.slot ?? c.name).padEnd(10);
229
+ const adapter = (c.adapter ?? '—').padEnd(18);
230
+ const enablement = (c.enablement ?? '').padEnd(12);
231
+ out.write(` ${slotMark(c)} ${slot} ${adapter} ${enablement} ${slotNote(c)}\n`);
232
+ if (c.hint)
233
+ out.write(` -> ${c.hint}\n`);
234
+ }
235
+ function renderSlotSummary(tools, out) {
236
+ const count = (e) => tools.filter((c) => c.enablement === e).length;
237
+ out.write(` ${tools.length} slots — ${count('default')} default, ${count('opt-in')} opt-in, ` +
238
+ `${count('disabled')} disabled, ${count('unavailable')} unavailable\n`);
239
+ }
240
+ function renderTable(report, out) {
241
+ out.write('\ncheckride doctor\n\n');
242
+ for (const group of GROUPS) {
243
+ const items = report.checks.filter((c) => c.category === group.key);
244
+ if (items.length === 0)
245
+ continue;
246
+ out.write(` ${group.label}\n`);
247
+ if (group.key === 'tool') {
248
+ for (const c of items)
249
+ renderToolRow(c, out);
250
+ renderSlotSummary(items, out);
251
+ continue;
252
+ }
253
+ for (const c of items) {
254
+ const found = c.found ?? '—';
255
+ const expected = c.expected ? ` (${c.expected})` : '';
256
+ out.write(` ${statusMark(c.status)} ${c.name.padEnd(22)} ${found}${expected}\n`);
257
+ if (c.status !== 'ok' && c.hint)
258
+ out.write(` -> ${c.hint}\n`);
259
+ }
260
+ }
261
+ out.write(report.ok ? '\n✔ environment ok\n\n' : '\n✘ environment has problems (see above)\n\n');
262
+ }
263
+ /** Run the doctor against `cwd`; render and return the report. */
264
+ export async function runDoctor(options) {
265
+ const cwd = options.cwd ?? process.cwd();
266
+ const slots = options.slots ?? SLOTS;
267
+ const adapters = options.adapters ?? ADAPTERS;
268
+ const config = options.config !== undefined ? options.config : loadConfig(cwd);
269
+ const stdout = options.stdout ?? process.stdout;
270
+ const env = options.env ?? realEnv;
271
+ const json = options.json ?? false;
272
+ const engines = env.readEngines(cwd);
273
+ const nodeMin = parseSemver(engines.node) ?? { major: 22, minor: 18, patch: 0, raw: '22.18.0' };
274
+ const pnpmMin = parseSemver(engines.pnpm) ?? { major: 9, minor: 0, patch: 0, raw: '9.0.0' };
275
+ const checks = [
276
+ await checkVersioned('node', 'node', nodeMin, env),
277
+ await checkVersioned('pnpm', 'pnpm', pnpmMin, env),
278
+ await checkPresent('git', 'git', env),
279
+ checkInstall(cwd, env),
280
+ ];
281
+ // Enumerate every catalogue slot so off/opt-in/disabled slots stay visible
282
+ // instead of silently dropped. The orchestrator decides what runs by default.
283
+ const resolved = resolveChecks({ slots, adapters, config, cwd });
284
+ const defaultActive = new Set(selectChecks(resolved, {}).map((r) => r.slot));
285
+ for (const r of resolved) {
286
+ checks.push(await classifySlot(r, defaultActive, adapters, config, cwd, env));
287
+ }
288
+ checks.push(await checkWritable(cwd, env));
289
+ const ok = checks.every((c) => !c.required || c.status === 'ok');
290
+ const report = { ok, platform: env.platform(), checks };
291
+ if (json) {
292
+ stdout.write(`${JSON.stringify(report, null, 2)}\n`);
293
+ }
294
+ else {
295
+ renderTable(report, stdout);
296
+ }
297
+ return { ok, report, exitCode: ok ? 0 : 1 };
298
+ }
299
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,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AQ,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,MAAM,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAE3C,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC;IACjE,MAAM,MAAM,GAAiB,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC;IAEtE,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Checkride — an agent harness for TypeScript repositories.
3
+ *
4
+ * The primary interface is the `checkride` CLI (see `src/cli.ts`). This module is
5
+ * the package's programmatic surface: the command entry points, the adapter
6
+ * registry, and the public types (including the `.check/summary.json` schema).
7
+ */
8
+ export { ADAPTERS, SCHEMA_VERSION, SLOTS } from './adapters.js';
9
+ export type { Adapter, Slot } from './adapters.js';
10
+ export { loadConfig, resolveChecks } from './config.js';
11
+ export type { CheckrideConfig, CustomCheck, ResolvedCheck, SlotConfig, UseConfig } from './config.js';
12
+ export { runChecks, runFix, selectChecks } from './orchestrator.js';
13
+ export type { RunFlags, RunOptions, RunResult, Summary, SummaryCheck, } from './orchestrator.js';
14
+ export { runDoctor } from './doctor.js';
15
+ export type { DoctorCheck, DoctorReport, DoctorResult } from './doctor.js';
16
+ export { runInit } from './init.js';
17
+ export type { InitOptions, InitResult, Shape } from './init.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,EACV,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACP,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Checkride — an agent harness for TypeScript repositories.
3
+ *
4
+ * The primary interface is the `checkride` CLI (see `src/cli.ts`). This module is
5
+ * the package's programmatic surface: the command entry points, the adapter
6
+ * registry, and the public types (including the `.check/summary.json` schema).
7
+ */
8
+ export { ADAPTERS, SCHEMA_VERSION, SLOTS } from './adapters.js';
9
+ export { loadConfig, resolveChecks } from './config.js';
10
+ export { runChecks, runFix, selectChecks } from './orchestrator.js';
11
+ export { runDoctor } from './doctor.js';
12
+ export { runInit } from './init.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASpE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * `checkride init` — set up a project (new or existing, auto-detected).
3
+ *
4
+ * New-project mode generates a complete, green-out-of-the-box repo for one of
5
+ * three shapes (flat / monorepo / hybrid); the shapes differ only in
6
+ * tsconfig.json, fallow.toml, and pnpm-workspace.yaml. Existing-project mode is
7
+ * additive: it inventories detectable tools, writes only what is missing
8
+ * (checkride.config.json, the AGENTS stanza, the `check` alias) and never
9
+ * touches an existing tool config.
10
+ *
11
+ * Generation, not transformation: every file is written once; the project owns
12
+ * it afterward.
13
+ */
14
+ import type { Adapter, Slot } from './adapters.js';
15
+ import type { Out } from './orchestrator.js';
16
+ export type Shape = 'flat' | 'monorepo' | 'hybrid';
17
+ export type InitOptions = {
18
+ cwd?: string;
19
+ shape?: Shape;
20
+ name?: string;
21
+ scope?: string | null;
22
+ license?: string;
23
+ author?: string | null;
24
+ dryRun?: boolean;
25
+ add?: string[] | null;
26
+ checkrideSpec?: string;
27
+ stdout?: Out;
28
+ slots?: readonly Slot[];
29
+ adapters?: readonly Adapter[];
30
+ /** Existing mode: returns the adopted slots whose check currently fails. */
31
+ probeFailures?: (slots: string[], cwd: string) => Promise<string[]>;
32
+ };
33
+ export type InitResult = {
34
+ mode: 'new' | 'existing';
35
+ shape: Shape | null;
36
+ written: string[];
37
+ skipped: string[];
38
+ disabled: string[];
39
+ exitCode: number;
40
+ };
41
+ export type InventoryEntry = {
42
+ slot: string;
43
+ status: 'adopted' | 'empty';
44
+ adapter: string | null;
45
+ };
46
+ /** The agent-facing contract block, parameterized by the active checks. */
47
+ export declare function buildStanza(activeSlots: readonly string[]): string;
48
+ /**
49
+ * Insert or refresh the checkride stanza in an AGENTS.md body. Idempotent:
50
+ * applying twice yields identical output.
51
+ */
52
+ export declare function applyStanza(content: string, body: string): string;
53
+ /** For each default (non-opt-in) slot, report whether a tool config is present. */
54
+ export declare function inventory(input: {
55
+ cwd?: string;
56
+ slots?: readonly Slot[];
57
+ adapters?: readonly Adapter[];
58
+ fileExists?: (file: string) => boolean;
59
+ }): InventoryEntry[];
60
+ /** Detect new vs existing by the presence of a package.json. */
61
+ export declare function detectMode(cwd: string): 'new' | 'existing';
62
+ /** Run `checkride init` against `cwd`. */
63
+ export declare function runInit(options: InitOptions): Promise<InitResult>;
64
+ //# sourceMappingURL=init.d.ts.map