import type { CliFlags } from "../config/config.js"; import type { InvocationOptions } from "../runtime/invocationOptions.js"; /** The run flags `agency debug` shares with `agency run`. The compile * settings (`CliFlags`) are folded onto the config before compiling, as * `run` does; the rest become the invocation the debugged run and every * resume it makes are called with. */ export type DebugRunFlags = CliFlags & { policy?: string; approve?: string; reject?: string; maxCost?: string; maxTime?: string; local?: string; draft?: string; agencyOnly?: boolean; }; /** How `agency debug` gets the program it runs. `--agency-only` is * decided first: a safety flag must not be dropped because `agency.json` * points at precompiled output. Naming `--dist-dir` as well contradicts * it, so that pair is refused. */ export declare function compileChoice(flags: { agencyOnly?: boolean; distDir?: string; configDistDir?: string; }): { mode: "agency-only"; } | { mode: "dist-dir"; distDir: string; } | { mode: "compile"; } | { refused: string; }; /** What `--attach` asks for. Commander gives `true` for a bare * `--attach`, the text for `--attach 123`, and nothing when the flag is * absent. A file and `--attach` together contradict each other: the * attached program is already running. */ export declare function attachTarget(flags: { attach?: string | boolean; file?: string; /** The other flags the person typed, as `--policy`: none of them * applies to a program that is already running, and a flag that is * parsed and dropped would look as if it worked. */ others?: string[]; }): { mode: "debug"; } | { mode: "attach"; pid?: number; } | { refused: string; }; /** The invocation for a debugged run: the root policy the flags describe * and the budget, in the config's own shape (dollars, and a duration * string checked here so a bad one is refused before anything runs). * `run` carries the same values to its child as environment variables; * the debugger runs the program in its own process, so they travel as * `InvocationOptions`, which a node call, a resume, and a rewind all * take. Throws on a policy or duration that cannot be read. */ export declare function invocationFromRunFlags(flags: DebugRunFlags, cwd: string): InvocationOptions;