/** * Init subcommand — orchestrates the v0.6 onboarding pipeline per * v0.6 Step 4 (Stream A pipeline assembly). Per Q4.0.1-Q4.0.13 locks * at Step 4.0 design adjudications. * * Step 4.4 ships atlas creation (runIndexSubcommand reuse) + smoke * test (first-symbol-from-atlas in-process buildBundle) + MCP * registration (.mcp.json idempotent upsert) per Q4.0.6 + Q4.0.7 + * Q4.0.10 + Q4.4.1-Q4.4.7 locks. * * Success message UX lands at Step 4.5 (structured sectioned with * [OK] ASCII marker per Q4.0.8 lock); final exit code semantics flip * at Step 4.5 (fail-loudly exit code 2 preserved through Step 4.4 * for automated paths per Q4.2.6 lock). * * Per ADR-12 subcommand contract: exit code 0 success / 1 pipeline * failure / 2 setup error. * * Route-to-exit-code mapping per Q4.3.5 lock: * - automated → exit code 2 (fail-loudly per Q4.2.6 until Step 4.5) * - automated-with-warning → exit code 2 (advisory logged) * - missing-adrs → exit code 0 (interactive guidance per Q4.0.9) * - new-project → exit code 0 (interactive guidance per Q4.0.9) * - doctor first-run FAIL → exit code 1 (ADR-12 pipeline-failure) * - atlas extraction FAIL → exit code 1 (Q4.4.4 pass-through) * - smoke test FAIL → exit code 2 (Q4.0.7 spec) */ import type { DoctorResult } from "../doctor/types.js"; import { type IndexCliResult } from "../extraction/cli-runner.js"; import type { LanguageCode } from "../types.js"; export interface InitRunOptions { /** Repo root the init command operates on. */ readonly configRoot: string; /** Optional explicit config file path (per ADR-08 inheritance). */ readonly configFile?: string | null; /** * `--cc-only` boolean opt-in (B13-flags at v0.6; deprecated at * v0.7+ per Path-3 entry-point-determined architecture per ADR-02 * v0.7 Step 1.4b amendment). CLI cannot bridge to Skills * mechanism; flag has no functional effect at v0.7+; init emits * stderr redirect warning to `/index-atlas` Claude Code skill. * Flag removed at v0.8+ per honest deprecation cycle. */ readonly ccOnly?: boolean; /** * `--observe` boolean opt-in (v0.6 Step 6.2 / Q6.0.4 hybrid wiring + * ADR-20 cohort observability contract). True → scaffold writes * `observability: { enabled: true }`. The flag IS the consent * signal; default false (no observability section). */ readonly observe?: boolean; /** Emit JSON-formatted output to stdout instead of text. */ readonly json?: boolean; /** Test seam: override stdout writer (default `process.stdout.write`). */ readonly writeStdout?: (chunk: string) => void; /** Test seam: override stderr writer (default `process.stderr.write`). */ readonly writeStderr?: (chunk: string) => void; /** * Test seam: inject doctor check collector. Avoids spawning real LSP * adapters during unit tests per Q4.3 Point 4 lock. */ readonly collectChecksOverride?: (repoRoot: string, options?: { firstRun?: boolean; }) => Promise; /** * Test seam: inject filesystem language detector. Avoids walking * tmp dir state during unit tests per Q4.3 Point 4 lock. */ readonly detectLanguagesOverride?: (repoRoot: string) => readonly LanguageCode[]; /** * Test seam: inject runIndexSubcommand. Avoids real Anthropic API * calls during unit tests per Q4.4 Point 4 lock. */ readonly runIndexSubcommandOverride?: (opts: import("../extraction/cli-runner.js").IndexCliOptions) => Promise; /** * Test seam: override .mcp.json contextatlas binary path per Q4.4.6 * + Q4.4.7 locks. */ readonly resolveBinaryPathOverride?: string; /** * Test seam: override the prompt-artifact source directory (the * package's `dist/`). Lets unit tests point at a fixture directory * instead of resolving from import.meta.url. Per v0.7 Step 2.3.a.0. */ readonly promptArtifactDistRootOverride?: string; /** * Test seam: override the Claude Code skill source directory (the * package's root, parent of `.claude/skills/`). Lets unit tests * point at a fixture directory instead of resolving from * import.meta.url. Per v1.1.2 cohort-UX hotfix. */ readonly skillPackageRootOverride?: string; } export interface InitRunResult { /** 0 success / 1 pipeline failure / 2 setup error per ADR-12. */ readonly exitCode: number; } /** * Run the init subcommand. Step 4.4 ships: * - Atlas creation (runIndexSubcommand reuse) per Q4.0.6 + * Q4.4.3 + Q4.4.4 locks; idempotent skip-when-current via * detectAtlasOnlyAvailable pre-check * - Smoke test (first-symbol-from-atlas in-process buildBundle) * per Q4.0.7 + Q4.4.1 + Q4.4.2 locks; A4 lazy-spawn validation * - MCP registration (.mcp.json idempotent upsert) per Q4.0.10 + * Q4.4.5 + Q4.4.6 locks * * Success message + exit-code-flip at Step 4.5 per Q4.2.6 framing. */ export declare function runInitSubcommand(options: InitRunOptions): Promise; //# sourceMappingURL=runner.d.ts.map