import type { TreeState } from "../materialize.js"; import { type SessionMachine, type SessionMessage } from "./machine.js"; /** One live session per thread, for the life of the process — the local mirror of * "one box per conversation". */ interface LocalSession { /** The live `ClaudeSession`, once the first message has opened it. */ session?: { send(prompt: string): Promise; steer(prompt: string): boolean; interrupt(): Promise; end(): Promise; }; /** The brief the live session was OPENED with. The SDK fixes `systemPrompt` * at open, so this is the only record of what the session is thinking with — * and the only way to notice it has gone stale. */ brief?: string; /** Has this thread's workspace been materialized in this process? */ warm: boolean; /** What this thread's disk holds — the sync-back baseline, per conversation. */ tree: TreeState; /** * The TURN currently in flight, and the only thing the session's sinks are * allowed to close over. * * A session outlives the turn that opened it, so capturing that turn's `emit` * directly sent every later turn's text to a queue nobody was draining — * measured live 2026-08-02: the user's second message came back completely * empty. The box path routes through whichever message is in flight for * exactly this reason; local mode does the same. */ live?: Pick; } export interface LocalMachineOptions { threadId: string; /** The recorded v0 inference exception (design §9): a harness must reach a * model to think. Nothing else enters the SDK subprocess's environment. */ env: Record; /** Test seam — the real factory is loaded from {@link RUNNER}, with the SDK. */ openSession?: (input: Record) => LocalSession["session"]; /** Test seam; production uses {@link MESSAGE_BUDGET_MS}. */ messageBudgetMs?: number; } export declare function localMachine(options: LocalMachineOptions): Promise; /** Test + shutdown seam: end every local session this process holds. */ export declare function disposeLocalSessions(): Promise; export {}; //# sourceMappingURL=local.d.ts.map