/**
 * Startup engine-switch boundary.
 *
 * VisionClaw's session ID is opaque to the underlying engine: Claude
 * Code stores its transcript under `~/.claude/projects/<slug>/<id>.jsonl`
 * while the Pi Coding Agent writes to
 * `<profile>/pi-agent/<mode>/sessions/<id>.jsonl`. The two stores share
 * nothing — switching engines mid-session would split the conversation
 * across them with no logical continuity.
 *
 * The engine itself is **not** persisted anywhere — it is always derived
 * from `config.json` via `getAgentEngine()`. The *prior* engine is
 * inferred at startup from where the existing transcript file lives on
 * disk; no extra `session.json` field is required.
 *
 * ## Collapse semantics
 *
 * Dual-session adds another wrinkle: the prior run may have had a
 * general session AND a paused/in-progress coding session, possibly
 * with cross-session memos in the mailbox. On engine switch we don't
 * try to migrate any of that state — the new engine wouldn't know how
 * to resume a transcript it didn't write, and a half-resumed coding
 * task with a stale mailbox is more confusing than useful.
 *
 * Instead, when **either** the general or coding transcript was
 * written by a different engine than `config.json` currently selects:
 *
 *   1. Summarize every existing transcript (general + coding if any).
 *   2. Snapshot the mailbox (active mode, memos, coding-session info)
 *      into a text section so the agent doesn't lose track of what was
 *      in flight or what the coding task was supposed to be.
 *   3. Combine summaries + mailbox snapshot into a single document.
 *   4. Rotate every persisted general/coding session id into
 *      `previousSessionIds` (the old transcripts remain on disk for
 *      `memory_transcript_search`).
 *   5. Clear the mailbox (mark active=general, drop memos, reset
 *      codingSession to idle).
 *   6. Inject the combined summary into the freshly created general
 *      session as priority context for its first turn.
 *
 * If a persisted session id has no transcript at any known engine path,
 * but also cannot be safely resumed by the current engine, we still retire
 * it without transcript summarization. This protects startup from looping
 * on stale cross-engine ids when the transcript filename cannot be resolved.
 *
 * `SessionManager` constructs the coding session conditionally on
 * mailbox state, so clearing the mailbox before constructing the
 * manager naturally yields a single general-only session.
 */
import type { VisionClawConfig } from "../config/types.js";
import { type SessionMode } from "./mailbox.js";
import type { AgentEngine } from "./engines/engine-factory.js";
interface PriorSessionInfo {
    mode: SessionMode;
    sessionId: string;
    engine: AgentEngine;
    transcriptPath: string;
}
export interface EngineSwitchBoundary {
    /** The engine the current config selects (target of the switch). */
    toEngine: AgentEngine;
    /** Every prior session we found a transcript for, in display order. */
    priorSessions: PriorSessionInfo[];
    /** The combined summary, ready to be injected into the new general session. */
    combinedSummary: string;
}
/**
 * Infer which engine wrote the transcript for `sessionId` by checking
 * the on-disk locations both engines use. Returns `null` when neither
 * transcript exists (legacy / never-run session).
 */
export declare function inferPriorEngine(mode: SessionMode, sessionId: string): {
    engine: AgentEngine;
    transcriptPath: string;
} | null;
/**
 * Detect, summarize, and collapse a cross-engine session boundary if
 * one applies for this restart. Returns `null` when no engine switch is
 * needed (all existing transcripts were written by `currentEngine`, or
 * there are no prior transcripts at all).
 *
 * Side effects when a boundary is detected and a summary is produced:
 *  - every persisted general/coding session id is rotated into
 *    `previousSessionIds`,
 *  - the mailbox is cleared.
 *
 * Callers must invoke this **before** constructing `SessionManager` so
 * the manager sees the post-collapse mailbox (single general session,
 * no coding session). After construction, hand `combinedSummary` to
 * `sessionManager.injectSummary("general", ...)`.
 */
export declare function prepareEngineSwitchBoundary(config: VisionClawConfig, currentEngine: AgentEngine): Promise<EngineSwitchBoundary | null>;
export {};
//# sourceMappingURL=engine-switch.d.ts.map