/**
 * `Forge` — the build session that assembles a new agent.
 *
 * The other Smithy layers are each one concern in isolation: the
 * {@link FlagReader} reads a launch into a {@link SmithyConfig}, {@link defineAgent}
 * merges a spec over a profile into a validated {@link AgentBlueprint},
 * {@link toAgentConfig} bridges that blueprint into a runtime `AgentConfig`, the
 * {@link ToolLedger} accounts for what the session did, and the
 * {@link TranscriptModel} sanitizes the dialogue for display. The Forge is the
 * conductor that wires them into a single, drivable build session.
 *
 * It runs in two modes:
 *
 *   - {@link Forge.buildInteractive} — a short scripted *interview*. It asks the
 *     user, through the {@link ForgeView} seam, for the agent's name, purpose,
 *     tool needs, and model preference; folds the answers into a blueprint via
 *     {@link defineAgent}; records each interview step on a {@link ToolLedger}; and
 *     keeps the dialogue as a transcript a {@link TranscriptModel} can project.
 *   - {@link Forge.buildFromConfig} — the non-interactive path. It takes a
 *     {@link SmithyConfig} (a profile plus pre-supplied `answers`) and produces the
 *     same kind of blueprint with no I/O at all.
 *
 * Finally {@link Forge.instantiate} turns a finished blueprint into a runnable
 * {@link Agent} by way of {@link toAgentConfig} and `createAgent`.
 *
 * The view (and its lone `ask`) is *injected*, never constructed here, so tests
 * can script the entire interview with canned answers and assert against the
 * recorded ledger and transcript without ever touching a terminal or the network.
 */
import type { Agent } from "../runtime";
import type { SmithyConfig } from "./config";
import type { AgentBlueprint } from "./persona";
import { ToolLedger } from "./runtime";
import type { ForgeView, RenderTranscript } from "./ui";
/**
 * The injectable collaborators a {@link Forge} runs against.
 *
 * Both are optional. `view` is the full {@link ForgeView} seam; `ask` is a
 * convenience override of just its prompt function — handy in tests that only
 * care about scripting answers and not about captured `show` output. When neither
 * is given, the Forge falls back to a {@link ConsoleForgeView} over stdio.
 */
export interface ForgeOptions {
    /** The text view the interview reads from and writes to. */
    readonly view?: ForgeView;
    /** A prompt function overriding {@link ForgeView.ask} (the interview seam). */
    readonly ask?: (question: string) => Promise<string>;
}
/** The answer keys the interview collects and {@link buildFromConfig} consumes. */
export type InterviewKey = "name" | "purpose" | "tools" | "model";
/** The collected interview answers, keyed by {@link InterviewKey}. */
export type InterviewAnswers = Partial<Record<InterviewKey, string>>;
/**
 * The build session.
 *
 * Construct one with {@link createForge} (or directly), then call
 * {@link buildInteractive} or {@link buildFromConfig} to obtain a validated
 * {@link AgentBlueprint}, and {@link instantiate} to turn that blueprint into a
 * runnable {@link Agent}. The {@link ledger} and {@link transcript} accessors
 * expose what the most recent interactive build recorded.
 */
export declare class Forge {
    /** The view the interview talks through; falls back to a console view. */
    private readonly view;
    /** The accountant for interview steps, one row per question asked. */
    private readonly toolLedger;
    /** The sanitizing projector for the recorded dialogue. */
    private readonly transcriptModel;
    /** The raw dialogue turns recorded during {@link buildInteractive}. */
    private dialogue;
    constructor(options?: ForgeOptions);
    /**
     * Run the scripted interview and return the resulting blueprint.
     *
     * Walks the {@link INTERVIEW} script: for each question it `show`s the prompt,
     * `ask`s through the view, records the answer as a dialogue turn pair, and files
     * one {@link ToolLedger} row noting the step. Once every answer is in, the
     * answers are mapped through {@link defineAgent} (seeded by the profile the
     * "tools" answer implies) into a validated {@link AgentBlueprint}.
     *
     * The session state — {@link ledger} and {@link transcript} — is reset at the
     * start of each call so a reused Forge does not carry a prior interview's rows.
     *
     * @param seedProfile Optional starter profile name to seed defaults from.
     */
    buildInteractive(seedProfile?: string): Promise<AgentBlueprint>;
    /**
     * Build a blueprint non-interactively from a resolved {@link SmithyConfig}.
     *
     * No view, no prompting: the answers are read straight from `cfg.answers`, the
     * starter profile from `cfg.profile`, and an explicit `cfg.model` (if present)
     * overrides whatever the answers or profile would choose. The same
     * {@link assemble} mapping is used as the interactive path, so both routes
     * produce blueprints of identical shape.
     *
     * @param cfg The launch configuration (typically from a {@link FlagReader}).
     */
    buildFromConfig(cfg: SmithyConfig): AgentBlueprint;
    /**
     * Turn a finished blueprint into a runnable {@link Agent}.
     *
     * Projects the blueprint onto a runtime `AgentConfig` via {@link toAgentConfig}
     * (resolving the named tool collection into a real toolbox) and hands it to
     * `createAgent`. `cwd` roots the agent's tools at a working directory.
     *
     * @param blueprint A blueprint already validated by {@link defineAgent}.
     * @param cwd       Optional working directory for the agent's tools.
     */
    instantiate(blueprint: AgentBlueprint, cwd?: string): Agent;
    /** The ledger of steps recorded by the most recent interactive build. */
    get ledger(): ToolLedger;
    /** A sanitized, render-ready projection of the recorded dialogue. */
    get transcript(): RenderTranscript;
    /**
     * Map a set of interview answers (plus an optional profile) into a validated
     * {@link AgentBlueprint}.
     *
     * The "tools" answer, when it names a known tool collection, sets the
     * blueprint's `toolCollection`; otherwise the profile/baseline default stands.
     * The "model" answer, when non-empty, overrides the profile's model. `name` and
     * `purpose` flow straight through to `name` and `description`. The single
     * validation gate lives inside {@link defineAgent}.
     */
    private assemble;
    /** Append one speaker turn of plain text to the recorded dialogue. */
    private recordTurn;
}
/**
 * Construct a {@link Forge} build session.
 *
 * The thin factory mirrors the rest of the codebase's `create*` convention and
 * keeps the injectable {@link ForgeOptions} (a scripted view or `ask`) at the call
 * site, which is what lets tests drive the interview with no real I/O.
 */
export declare function createForge(options?: ForgeOptions): Forge;
