/** * `peaks runtime *` — vendor-runtime detection + compact CLI surface. * * * detect — print which vendor is the active AI runtime * (claude-code / codex / copilot / unknown). * list — list the built-in vendor adapters registered by * RuntimeService (Claude Code / Codex / Copilot). * compact — invoke a vendor's compact verb via the adapter. The * adapter (NOT this file) chooses the vendor verb; * see src/services/runtime/vendors/.ts. * * Vendor verb strings (`claude --compact`, `codex --compact`, * `copilot compact`) MUST live ONLY in `src/services/runtime/vendors/` * — verified by AC-1: `rg -n "claude --compact|codex --compact|copilot * compact" src/services/code/` returns 0 matches. * * `peaks runtime compact --via ` first consults the user * adapter registry (`.peaks/runtime/adapters.json`) for the id, then * falls back to the built-in adapter list. Missing vendor CLI * surfaces as exitCode=127 + warning, NOT as a fatal error — vendor * neutrality demands peaks-loop stay alive. */ import type { Command } from 'commander'; import { join } from 'node:path'; import { type ProgramIO } from '../cli-helpers.js'; export interface RuntimeDetectOptions { json?: boolean; } export interface RuntimeListOptions { json?: boolean; } export interface RuntimeCompactOptions { json?: boolean; /** Vendor adapter id (built-in or registered). */ via?: string; force?: boolean; /** Override the project root (defaults to .peaks runtime lookup). */ project?: string; } export declare function registerRuntimeCommands(program: Command, io: ProgramIO): void; /** Internal helper exposed for tests + future programmatic callers: * resolve the registry file location, ensuring the parent dir * exists. Idempotent. */ export declare function ensureRegistryDir(registryFile: string): void; /** Internal helper for tests: locate the registry file under the * given project root. Thin wrapper so tests can stub the resolution. */ export declare function registryFileFor(projectRoot: string): string; /** Re-export the path join helper for completeness; not strictly * needed by callers but keeps the module self-contained. */ export { join };