/** * Copyright 2025 Vybestack LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type IContent } from '../services/history/IContent.js'; import { type SessionMetadata } from './types.js'; import { SessionRecordingService } from './SessionRecordingService.js'; import { type LockHandle } from './SessionLockManager.js'; /** * Sentinel constant for "resume most recent session". */ export declare const CONTINUE_LATEST: "__CONTINUE_LATEST__"; /** * Input to the resume flow. * * @pseudocode resume-flow.md lines 50-56 */ export interface ResumeRequest { continueRef: string | typeof CONTINUE_LATEST; projectHash: string; chatsDir: string; currentProvider: string; currentModel: string; workspaceDirs: string[]; } /** * Successful resume result — contains reconstructed history, metadata, * and an initialized recording service for appending new events. * * @requirement REQ-RSM-004 */ export interface ResumeResult { ok: true; history: IContent[]; metadata: SessionMetadata; recording: SessionRecordingService; lockHandle: LockHandle; warnings: string[]; } /** * Failed resume result — contains an error message. */ export interface ResumeError { ok: false; error: string; } /** * Resume a previously recorded session. * * Discovers sessions, resolves the target, acquires a lock, replays the * event log to reconstruct history, and initializes recording for append. * * @pseudocode resume-flow.md lines 50-124 */ export declare function resumeSession(request: ResumeRequest): Promise;