/**
 * The conductor — the only stateful, side-effecting layer of the runtime.
 *
 * Everything beneath it is pure or single-purpose: the {@link cadence} reducer
 * decides *what* should happen by returning {@link Effect}s; the conductor is
 * the sole place those effects are actually carried out. It threads a serial
 * stream of {@link Signal}s through the reducer, performs each emitted effect
 * (reach the model, run tools, persist, condense, publish), and folds the
 * resulting signals back in — turning over and over until the run reaches a
 * `settled` or `faulted` terminal phase.
 *
 * The public {@link createAgent} returns an {@link Agent} whose `submit` drives
 * one prompt to settlement, `subscribe` taps the live event stream, `abort`
 * tears the current run down, `snapshot` reads the latest state, and `resume`
 * rehydrates an earlier session from the store.
 *
 * The model entrypoint is injectable: by default it is the gateway bound to the
 * configured model id, but tests pass a scripted {@link ModelInvoker} to make a
 * run deterministic without touching the network.
 */
import type { Turn } from "../../llmgateway/contract";
import type { AgentConfig, ModelInvoker, RunSnapshot } from "../contract";
import type { RunEventHandler, Unsubscribe } from "../ledger";
/** The handler shape a caller registers with {@link Agent.subscribe}. */
export type AgentEventHandler = RunEventHandler;
/**
 * The optional collaborators a host may inject. All default to a production
 * wiring; tests override `invokeModel` to script the model deterministically.
 */
export interface AgentDeps {
    /**
     * The seam through which the conductor reaches a model. Defaults to the
     * gateway's `stream`, bound to {@link AgentConfig.model}.
     */
    readonly invokeModel?: ModelInvoker;
    /** Where settled history is durably written. Typed loose to stay swappable. */
    readonly store?: unknown;
    /** Where run events are published. Typed loose to stay swappable. */
    readonly ledger?: unknown;
}
/**
 * The driveable agent. One agent owns one logical session; each {@link submit}
 * opens a fresh run that streams to settlement.
 */
export interface Agent {
    /**
     * Drive a prompt to settlement and resolve the terminal snapshot.
     *
     * `input` is either a ready list of {@link Turn}s or a bare string (sugar for
     * a single user text turn). If a run is already in flight, the input is folded
     * into it as steering rather than starting a competing run.
     */
    submit(input: Turn[] | string): Promise<RunSnapshot>;
    /** Tap the live {@link RunEvent} stream; returns a disposer. */
    subscribe(handler: AgentEventHandler): Unsubscribe;
    /** Tear down the current run, faulting it with an `aborted` error. */
    abort(): void;
    /** Read the latest {@link RunSnapshot}. */
    snapshot(): RunSnapshot;
    /** Rehydrate this agent's messages from a persisted session. */
    resume(sessionId: string): Promise<void>;
}
/**
 * Build a runnable {@link Agent} over a static {@link AgentConfig}.
 *
 * Wires the pure reducer to its real-world effect handlers: the model invoker
 * (default = gateway), the tool scheduler (over `config.tools?.runner`), the
 * session store, the condensation engine, and the event ledger. The returned
 * agent is the host-facing handle.
 */
export declare function createAgent(config: AgentConfig, deps?: AgentDeps): Agent;
