/**
 * The concrete boot stages, in the order they run.
 *
 * This module instantiates the generic {@link Stage} pipeline for the shell
 * application's {@link BootContext}. The five stages, in order:
 *
 *   1. {@link resolveLocator}    — bind the path/branding locator.
 *   2. {@link loadConfiguration} — read & merge settings, then apply idempotent
 *      startup upgrades.
 *   3. {@link resolveModel}      — pick the model id (invocation ▸ settings ▸
 *      fallback) and validate it against the catalog.
 *   4. {@link assembleTools}     — build the built-in tool box for the chosen
 *      collection and, when MCP servers are configured, mount the protocol
 *      bridge and merge the remote box with the built-in box into one composite
 *      {@link ToolBox} (registering the fleet's teardown as a closable).
 *   5. {@link buildAgentFactory} — close over the composite box, the model, and
 *      the system preamble to expose a ready {@link BootContext.makeAgent}.
 *
 * Every integration with the rest of the codebase happens through the four
 * published seams: {@link createAgent} (runtime), {@link toolBox} (capabilities),
 * {@link mountProtocolBridge} (interop), and {@link getCard} (llmgateway). No
 * stage mutates the context it receives; each returns a new one.
 */
import type { ToolBox } from "../../runtime";
import type { Invocation } from "../invocation/parse";
import type { Stage } from "./pipeline";
import type { BootContext, BootIo } from "./context";
/**
 * The internal, in-progress shape the pipeline reduces over.
 *
 * It is the public {@link BootContext} plus the one intermediate value the
 * stages must hand off but the runners never see: the assembled composite
 * {@link ToolBox}. Keeping it private to this module lets {@link buildBootContext}
 * return the narrower {@link BootContext} to callers while the stages share the
 * wider draft.
 */
interface BootDraft extends BootContext {
    /** The composite tool box, set by {@link assembleTools}, read by the factory. */
    toolBox?: ToolBox;
}
/**
 * Merge several {@link ToolBox}es into one composite box.
 *
 * The composite advertises every constituent box's descriptors, concatenated in
 * the order the boxes were given (so the built-in tools precede any remote ones).
 * Its runner routes each {@link ToolCall} to the box that owns the named tool: a
 * lookup table is built once from each box's descriptors, mapping a tool name to
 * the runner that fulfils it. A call for an unknown tool resolves to an error
 * outcome rather than throwing, so one stray name never sinks a whole batch.
 *
 * When two boxes advertise the same tool name, the *first* box to claim it wins
 * the route — built-in tools therefore shadow a remote tool of the same name,
 * which is the safe default. (The protocol bridge already qualifies remote names
 * as `"<server>__<tool>"`, so genuine collisions are rare by construction.)
 *
 * @param boxes the boxes to compose, in precedence order (earliest wins a tie).
 * @returns a single {@link ToolBox} over the union.
 */
export declare function composeToolBoxes(...boxes: readonly ToolBox[]): ToolBox;
/** The boot stages, in the order they run. */
export declare const BOOT_STAGES: readonly Stage<BootDraft>[];
/**
 * Build a fully-assembled {@link BootContext} from a parsed invocation and the
 * I/O seams.
 *
 * Seeds an initial draft from the invocation (its `--cwd` flag overrides the
 * process working directory) and the supplied I/O, then runs every
 * {@link BOOT_STAGES} stage in order. The resolved draft is returned narrowed to
 * the public {@link BootContext}; its internal `toolBox` field stays an
 * implementation detail the runners never touch.
 *
 * @param invocation the parsed CLI invocation the stages read from.
 * @param io the output sink and input source the runners will use.
 * @returns the assembled boot context.
 */
export declare function buildBootContext(invocation: Invocation, io: BootIo): Promise<BootContext>;
export {};
