/**
 * `FlagReader` — a token-consuming state machine for Smithy's own CLI flags.
 *
 * Smithy (the agent-builder meta-tool) is launched with its own small slice of
 * command-line options: which starter profile to seed from, where the generated
 * agent should be written, an explicit model override, a non-interactive switch,
 * and any number of pre-supplied interview answers. This module turns the raw
 * `argv` slice into a {@link SmithyConfig}.
 *
 * Unlike the shell-app's stateless cursor-walk parser, this reader is an
 * *explicit finite-state machine*. It walks the argv one token at a time and
 * lives in exactly one of three states:
 *
 *   - `expectFlag`  — the resting state. The next token must name a flag (or be a
 *                     glued `--flag=value`, or a bare `--` terminator). A boolean
 *                     flag is settled here and we stay in `expectFlag`; a
 *                     value-taking flag with no glued value advances to
 *                     `expectValue`.
 *   - `expectValue` — we have seen a value-taking flag and are owed its argument.
 *                     The next token is consumed verbatim as that value and we
 *                     fall back to `expectFlag`.
 *   - `done`        — a bare `--` terminator was reached; every remaining token is
 *                     ignored (Smithy takes no positionals).
 *
 * The set of recognised flags lives in one {@link FLAG_TABLE}, so adding a flag
 * is a single table entry, never a new branch in the walk. The reader is pure: it
 * reads only the array handed to it and never touches `process`, the
 * environment, or the filesystem.
 */
/** The flags Smithy understands and how each one is shaped. */
export type SmithyFlagName = "profile" | "out" | "model" | "non-interactive" | "answer";
/** Whether a flag carries a value, and (if so) how its value is filed. */
type FlagKind = 
/** A bare switch: present ⇒ true. */
"switch"
/** A single value that overwrites (last spelling wins). */
 | "single"
/** A repeatable `key=value` pair folded into the answers map. */
 | "pair";
/** One row of the recognised-flag table. */
interface FlagSpec {
    /** The canonical flag name (without leading dashes). */
    readonly name: SmithyFlagName;
    /** Every spelling that selects this flag, e.g. `--out`, `-o`. */
    readonly spellings: readonly string[];
    /** Whether the flag takes a value and how it is recorded. */
    readonly kind: FlagKind;
}
/**
 * The single source of recognised flags. The walk below contains no per-flag
 * branches — it only consults this table.
 */
declare const FLAG_TABLE: readonly FlagSpec[];
/**
 * The resolved Smithy launch configuration.
 *
 * Every field is optional except by intent: a launch with no flags yields an
 * empty record, and each consumer applies its own default. `answers` collects any
 * `--answer key=value` pairs the user pre-supplied so a non-interactive run can
 * skip the interview.
 */
export interface SmithyConfig {
    /** The starter profile to seed the blueprint from (e.g. `coder`). */
    profile?: string;
    /** Destination path for the generated agent file. */
    out?: string;
    /** An explicit model id, overriding whatever the profile would pick. */
    model?: string;
    /** When true, run without prompting — rely on `answers` and defaults. */
    nonInteractive?: boolean;
    /** Pre-supplied interview answers, keyed by question name. */
    answers?: Record<string, string>;
}
/** Thrown when an argv slice cannot be read into a valid {@link SmithyConfig}. */
export declare class FlagError extends Error {
    constructor(message: string);
}
/**
 * A token-consuming state machine that reads Smithy CLI flags.
 *
 * Construct one and call {@link read} with the argv slice (already stripped of
 * the runtime and script names). The machine is single-use per `read` call —
 * each call resets its internal state — and reports a malformed invocation by
 * throwing {@link FlagError}.
 */
export declare class FlagReader {
    /** Current position in the state machine. */
    private state;
    /** The flag awaiting its value while in `expectValue`. */
    private pending;
    /** The accumulating result, written as tokens are consumed. */
    private config;
    /**
     * Read an argv slice into a {@link SmithyConfig}.
     *
     * Performs a single left-to-right pass, feeding each token to the active state.
     * A trailing value-taking flag left without its argument is an error.
     */
    read(argv: readonly string[]): SmithyConfig;
    /** Clear all state so the reader can be reused. */
    private reset;
    /**
     * Handle a token while resting in `expectFlag`.
     *
     * Recognises the bare `--` terminator, a glued `--flag=value`, a value-taking
     * flag (which arms `expectValue`), and a switch (settled immediately).
     */
    private onFlag;
    /** Handle the token owed to the {@link pending} value-taking flag. */
    private onValue;
    /** Record a switch flag turning its slot on. */
    private fileSwitch;
    /** File a resolved value under the slot its spec names. */
    private fileValue;
    /**
     * Fold one `key=value` interview answer into the answers map. A pair missing
     * its `=` separator, or with an empty key, is rejected.
     */
    private fileAnswer;
}
/**
 * Convenience entry point: read an argv slice into a {@link SmithyConfig} with a
 * fresh {@link FlagReader}. Pass `process.argv.slice(2)` from a launcher.
 */
export declare function readFlags(argv: readonly string[]): SmithyConfig;
/** Re-export the recognised-flag table for help rendering and tests. */
export { FLAG_TABLE };
export type { FlagSpec };
