import { RunOptions, RunResult } from "../schema/run.mjs"; import { RunnableCommand } from "../schema/command.mjs"; //#region src/core/testkit/index.d.ts /** * Run a command builder against the given argv with injected options. * * This is the testkit wrapper around the shared executor: * 1. Apply the CLI root-flag layer (detect/strip `--json` and `--quiet`/`-q`) so * copied real argv works * 2. Create or reuse capture output * 3. Build standalone schema/meta defaults when CLI dispatch did not * 4. Delegate parse -> resolve -> execute to the shared executor * 5. Return the structured result with captured buffers * * Errors are normalized by the shared executor into structured {@linkcode RunResult}s * with appropriate exit codes. The function never throws. * * @param cmd - The command builder (must have an action handler) * @param argv - Raw argv strings (NOT including the command name itself). * CLI-level `--json` and `--quiet`/`-q` before the `--` separator are honored * and stripped here, just like the real CLI root — so `['--json']` enables * JSON mode and `['--quiet']` sets quiet verbosity rather than failing as * unknown flags. Equivalent to `{ jsonMode: true }` / `{ verbosity: 'quiet' }`. * @param options - Injectable runtime state * @returns Structured run result with exit code and captured output */ declare function runCommand(cmd: RunnableCommand, argv: readonly string[], options?: RunOptions): Promise; //#endregion export { type RunOptions, type RunResult, runCommand };