import type { AgentSession } from "../session/agent-session.js"; import { type RpcServe } from "./rpc.js"; import { type SessionBridgeClient, type SessionHostProtocol, type SessionMirrorState } from "./session-mirror.js"; /** Full state of a local session, as published to main. */ export declare function captureSessionState(session: AgentSession): SessionMirrorState; /** Publishes one worker-homed session to main; see the module doc. */ export declare class SessionPublisher { #private; readonly session: AgentSession; constructor(session: AgentSession, bridge: SessionBridgeClient); /** Post any state change now instead of at the end of the microtask. */ flush(): void; /** Start or stop forwarding the full event stream and the view state. */ watch(on: boolean): void; /** Post `closed` and stop observing the session. Idempotent. */ close(): void; /** Coalesce a publish into the end of the current microtask. */ schedule(): void; } /** Worker-side implementation of {@link SessionHostProtocol}; commands flush state before their result posts. */ export declare const SESSION_HOST_SERVE: RpcServe;