/**
 * BranchManager — Owns branch creation and tree navigation.
 *
 * Extracted from AgentSession to isolate branch/fork/tree mutation logic
 * behind a narrow interface.
 */
import type { AgentController } from '../../core/index.js';
import type { BranchSessionStore } from './session-store-types.js';
/** Narrow deps interface — avoids coupling to the full AgentSession. */
export interface BranchManagerDeps {
    agent: AgentController;
    sessionManager: BranchSessionStore;
    getSessionFile: () => string | undefined;
    /** Called on fork to clear pending messages bound to old session state. */
    clearPendingNextTurnMessages: () => void;
    observability?: {
        setSessionId?: (sessionId: string) => void;
        info?: (input: {
            module: string;
            event: string;
            data?: Record<string, unknown>;
        }) => void;
    };
}
export interface ForkResult {
    selectedText: string;
    cancelled: boolean;
}
export interface NavigateTreeResult {
    editorText?: string;
    cancelled: boolean;
}
export declare class BranchManager {
    private readonly _deps;
    constructor(deps: BranchManagerDeps);
    /**
     * Create a fork from a specific entry.
     */
    fork(entryId: string): Promise<ForkResult>;
    /**
     * Navigate to a different node in the session tree.
     * Unlike fork() which creates a new session file, this stays in the same file.
     */
    navigateTree(targetId: string, options?: {
        label?: string;
    }): NavigateTreeResult;
    /**
     * Get all user messages from session for fork selector.
     */
    getUserMessagesForForking(): Array<{
        entryId: string;
        text: string;
    }>;
}
/** Extract text from user message content (string or content array). */
export declare function extractUserMessageText(content: string | Array<{
    type: string;
    text?: string;
}>): string;
//# sourceMappingURL=branch-manager.d.ts.map