import { DevcontainerConfig } from '../types/index.js'; /** Format version of the on-disk file, so future changes can be detected. */ export declare const SESSION_RECORD_VERSION = 1; export declare const SESSION_RECORD_FILE_NAME = "sessions.json"; /** A single session, described well enough to launch it again. */ export interface SessionRecord { /** Id of the in-memory session this record was written for. */ id: string; /** * Git repository root the session belongs to. Used to only offer sessions * of the repository the user is actually opening. */ projectPath: string; worktreePath: string; /** * Id of the command preset the session was launched with. Absent when the * preset could not be determined; the default preset is then used on * restore. Only the id is stored — the command itself stays owned by the * preset configuration. */ presetId?: string; /** User-assigned session name, if the user renamed the session. */ sessionName?: string; /** Devcontainer commands the session was launched through, if any. */ devcontainerConfig?: DevcontainerConfig; /** * Process id of the ccmanager run that owns this session. A record whose * owner process is still running belongs to another live ccmanager and must * not be restored, or the same session would end up running twice. */ ownerPid: number; createdAt: number; } export declare class SessionRestoreStore { private explicitFilePath?; /** * While true, mutations are ignored. Set just before ccmanager tears its * sessions down on exit: those sessions are exactly the ones the next run * should offer to restore, so their records must survive the teardown. */ private trackingSuspended; constructor(filePath?: string); /** * Resolved lazily rather than in the constructor so that merely importing * this module does not create the configuration directory. */ private get filePath(); /** All recorded sessions, including ones owned by other ccmanager runs. */ list(): SessionRecord[]; /** Add a session to the record, replacing any earlier record with the same id. */ record(session: SessionRecord): void; /** * Drop sessions from the record, so they are not offered on the next run. * Called when a session ends for a reason that means it should stay ended: * the user killed it, or the launched command exited by itself. */ forget(...ids: string[]): void; /** * Keep a renamed session's name in the record. An absent name means the * user cleared it. */ rename(id: string, sessionName?: string): void; /** * Stop applying further mutations. Used when ccmanager is shutting down and * destroys its sessions: without this the teardown would erase precisely the * records the next run needs. */ suspendTracking(): void; /** Resume applying mutations. Counterpart of {@link suspendTracking}. */ resumeTracking(): void; isTrackingSuspended(): boolean; private read; private write; } export declare const sessionRestoreStore: SessionRestoreStore;