import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent"; import type { V2ActionFrame } from "../timeline/v2_service.js"; import { type ActionCtx, type ActionReplySender } from "./handlers.js"; type SessionNewFrame = Extract; export interface SessionNewBridgeOptions { getPi(): ExtensionAPI | null; onCommandContext(ctx: ExtensionCommandContext): void; onReplaced(ctx: ActionCtx): void; onFinished(): void; } /** Bridges a remote action to Pi's command-only, process-local newSession API. */ export declare class SessionNewBridge { private readonly options; private readonly pending; private timeoutMs; private running; private switchPermit; constructor(options: SessionNewBridgeOptions); dispatch(sender: ActionReplySender, frame: SessionNewFrame): void; run(token: string, ctx: ExtensionCommandContext): Promise; beforeSwitch(reason: "new" | "resume"): { cancel: true; } | undefined; beforeFork(): { cancel: true; } | undefined; isRunning(): boolean; clear(error?: string): void; setTimeoutForTest(timeoutMs: number): void; private fail; private complete; } export {};