#!/usr/bin/env node import { Command } from 'commander'; /** * Whether an operator has explicitly turned automatic GC off (Story 4.6 AC #5). * * Only these exact spellings disable it. Anything else — including a typo, an * empty string, or the historical `apply` that used to switch it ON — leaves it * enabled, because failing open on a misconfigured bound reproduces exactly the * state the ruling ended: a bound nobody noticed was off. */ export declare function isAutoGcDisabled(raw: string | undefined): boolean; import { type DoctorReport } from '../query/doctor.js'; import { type InstallResult } from '../query/install.js'; /** Byte sizes for a footprint report. Whole units; a store is never sub-KB. */ export declare function formatBytes(bytes: number): string; /** * Render the install result. Details and fixes interpolate paths and JSON * parser messages from user-controlled files, so each is collapsed onto one * line — the discipline `renderDoctorReport` already applies. */ /** * True when the only failing checks are the two `install` deliberately does * not address: a project that has never run Cortex has no engagement state and * no store. AC #1 enumerates four actions and neither is among them, so a * successful install on a fresh project legitimately fails the diagnostic — * and a bare red report there reads as a broken install. */ /** * The exit status `cortex install` should end on, given the diagnostic it just * ran. * * Extracted so it can be tested at all: under vitest the sandboxed install * bakes `/cli.js` paths that do not exist beside the `.ts` sources, * so `node-resolution` fails for reasons unrelated to the rule, and no * end-to-end fixture can produce the clean never-run state this decides on. * * The rule: the install's status is the diagnostic's, because every action can * succeed and still leave a broken installation (no jq, a Node that moved). * The one exception is the state `install` cannot avoid creating — it * deliberately does not engage Cortex or create the store, so on a project that * has never run, `engagement` and `database` fail by construction. Measured on * a clean Linux container: the two commands the README opens with ended in a * red report and a non-zero status with nothing wrong, which aborts a scripted * or Dockerfile install at its first step. */ /** * The version `cortex --version` reports, read from `package.json` at runtime. * * It was a hardcoded `'0.1.0'` literal, which is a duplicated constant with no * pin, and it drifted the first time it could: 0.1.1 was published, installed * from the registry, and reported itself as 0.1.0. A tool whose whole claim is * that it will not assert something untrue does not get to be wrong about its * own version. * * `../../package.json` resolves to the package root from `dist/transports/` * when installed and from `src/transports/` under vitest, so one path serves * both. npm always includes `package.json` in a tarball regardless of `files`, * so it is present in an installed copy. * * Returns `unknown` rather than a plausible-looking number if it cannot be * read: an honest absence beats an invented version. */ export declare function packageVersion(): string; export declare function installExitCode(report: DoctorReport): 0 | 1; export declare function onlyUnusedProject(report: DoctorReport): boolean; export declare function renderInstallResult(result: InstallResult): string; /** * Render the diagnostic report. * * Details and fixes are collapsed onto one line: they interpolate settings-file * paths, script names and JSON parser messages, all of which come from * user-controlled files on disk. An embedded newline would otherwise forge a * check row, and a lone CR would let one check's detail overwrite the row above * it — the same discipline `list-memory` applies to stored strings. `--json` * stays byte-faithful. */ export declare function renderDoctorReport(report: DoctorReport): string; export declare function createProgram(): Command; //# sourceMappingURL=cli.d.ts.map