/**
 * 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.
 */
/**
 * Performs session resume - resolves session reference and swaps recording infrastructure.
 * Used by both browser-based resume and direct /continue command.
 *
 * @plan PLAN-20260214-SESSIONBROWSER.P11
 * @plan PLAN-20260214-SESSIONBROWSER.P09
 * @requirement REQ-PR-001, REQ-PR-002, REQ-SW-001, REQ-PR-005
 * @pseudocode perform-resume.md lines 10-170
 */
import { RecordingIntegration, type IContent, type SessionRecordingService, type LockHandle, type SessionMetadata, type DebugLogger } from '@vybestack/llxprt-code-core';
/**
 * Callbacks for swapping recording infrastructure during resume.
 * Uses callback pattern instead of mutable fields for thread safety.
 */
export interface RecordingSwapCallbacks {
    getCurrentRecording: () => SessionRecordingService | null;
    getCurrentIntegration: () => RecordingIntegration | null;
    getCurrentLockHandle: () => LockHandle | null;
    setRecording: (recording: SessionRecordingService, integration: RecordingIntegration, lock: LockHandle | null, metadata: SessionMetadata) => void;
}
/**
 * Context required for performing a session resume.
 */
export interface ResumeContext {
    chatsDir: string;
    projectHash: string;
    currentSessionId: string;
    currentProvider: string;
    currentModel: string;
    workspaceDirs: string[];
    recordingCallbacks: RecordingSwapCallbacks;
    logger?: DebugLogger;
}
/**
 * Discriminated union result for performResume.
 * Success returns history and metadata; failure returns error string.
 */
export type PerformResumeResult = {
    ok: true;
    history: IContent[];
    metadata: SessionMetadata;
    warnings: string[];
} | {
    ok: false;
    error: string;
};
/**
 * Performs session resume with all side effects.
 *
 * Resolves the session reference (ID, prefix, index, or "latest"),
 * acquires the target session, swaps recording infrastructure,
 * and returns the result.
 *
 * @param sessionRef - Session reference (ID, prefix, index number, or "latest")
 * @param context - Resume context with chatsDir, projectHash, and recording callbacks
 * @returns Promise resolving to success with history/metadata or failure with error
 */
export declare function performResume(sessionRef: string, context: ResumeContext): Promise<PerformResumeResult>;
