/** * Module-scoped writable SessionManager for parent-mode session access. * Spec: §3.1.0 — Round-2 finding C2: ctx.sessionManager is ReadonlySessionManager * * The parent extension needs to write LLM-context entries (orca:agent-completion via * appendCustomMessageEntry) into its own session file. This module caches a writable * SessionManager handle opened once at session_start. */ import { SessionManager } from "@earendil-works/pi-coding-agent"; /** * Initialize the parent-mode writable SessionManager. * Must be called from session_start in parent mode AFTER persistence gate check. * * @param sessionFile - Parent's session file path * @param sessionDir - Parent's session directory (optional, for SessionManager.open) */ export declare function initParentWritable(sessionFile: string, sessionDir?: string): void; /** * Get the cached writable SessionManager. * Returns undefined if not initialized or if initialization failed. * * @returns Writable SessionManager or undefined */ export declare function getParentWritable(): SessionManager | undefined; /** * Dispose the cached writable SessionManager. * Called from session_before_switch/session_before_fork to clear state before transition. * SessionManager has no explicit close() method (per §1.3), so we just clear the reference. */ export declare function disposeParentWritable(): void; /** * Check if the parent has a writable SessionManager available. * Useful for conditionally writing LLM-context entries only when safe. * * @returns True if writable SessionManager is available */ export declare function hasParentWritable(): boolean; //# sourceMappingURL=parent-writable.d.ts.map