/** * [WHO]: Provides SessionTreeController — session-tree navigation + branch summarization * [FROM]: Depends on session/compaction (generateBranchSummary), session-manager (BranchSummaryEntry), * extensions-host (TreePreparation, SessionBeforeTreeResult), platform/abort-slot, * and ./session-context (SessionTreeControllerContext) * [TO]: Consumed by core/runtime/agent-session.ts (constructs one, delegates navigateTree()/abortBranchSummary()) * [HERE]: core/runtime/agent-session.ts split (AS10) — owns the branch-summary abort slot * * Extracted from AgentSession (AS10). Owns navigateTree() and the branch-summary cancellation * state. Unlike fork() (a session-identity change), navigateTree stays in the same session file * and moves the leaf. Session state is reached through SessionTreeControllerContext; behavior is * identical to the former AgentSession.navigateTree(). */ import type { BranchSummaryEntry } from "../session/session-manager.js"; import type { SessionTreeControllerContext } from "./session-context.js"; export interface NavigateTreeOptions { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string; } export interface NavigateTreeResult { editorText?: string; cancelled: boolean; aborted?: boolean; summaryEntry?: BranchSummaryEntry; } export declare class SessionTreeController { private readonly ctx; /** Cancellation slot for the in-flight branch summarization. */ private readonly _slot; constructor(ctx: SessionTreeControllerContext); /** Cancel an in-progress branch summarization. */ abortBranchSummary(): void; /** * Navigate to a different node in the session tree (stays in the same session file; moves the * leaf). Optionally summarizes the abandoned branch. */ navigateTree(targetId: string, options?: NavigateTreeOptions): Promise; }