Files
gstack/scripts/gen-doctor-components.ts
T
Garry Tanandcapy-ai[bot] 6681adf7a8 v1.91.71.0 feat(install): gstack-doctor --check one-line verdict, gstack-capy-install, lazy Chromium (multi-agent wave PR A) (#3116)
* v1.91.71.0 feat(install): gstack-doctor --check one-line verdict, gstack-capy-install, lazy Chromium

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(qa-callers): substitute <plan-path> in the plan-completion acceptance block so the ship caller fixture admits the documented command

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
2026-10-11 00:00:20 +00:00

29 lines
1.2 KiB
TypeScript

#!/usr/bin/env bun
/**
* Generate bin/gstack-doctor-components.sh — the Bash render of the doctor's
* component table (lib/doctor-components.ts) and result-code anchors
* (lib/result-codes.ts). The doctor must report with Bun absent, so the table
* ships as a committed sourced file, refreshed from scripts/gen-skill-docs.ts
* and checked for freshness by test/doctor-components.test.ts, the way the
* agents digest is.
*/
import * as fs from 'fs';
import * as path from 'path';
import { renderDoctorComponentsSh } from '../lib/doctor-components';
const ROOT = path.resolve(import.meta.dir, '..');
export const DOCTOR_COMPONENTS_RELPATH = 'bin/gstack-doctor-components.sh';
export function writeDoctorComponentsSh(opts?: { outRoot?: string }): { outPath: string; bytes: number } {
const content = renderDoctorComponentsSh();
const outPath = path.join(opts?.outRoot ?? ROOT, DOCTOR_COMPONENTS_RELPATH);
fs.mkdirSync(path.dirname(outPath), { recursive: true });
fs.writeFileSync(outPath, content);
return { outPath, bytes: Buffer.byteLength(content, 'utf-8') };
}
if (import.meta.main) {
const { outPath, bytes } = writeDoctorComponentsSh();
console.log(`[gen-doctor-components] ${path.relative(ROOT, outPath)}: ${bytes} bytes`);
}