import type { AgentMessage } from "@pk-nerdsaver-ai/pi-agent-core";
import type { ServiceTier } from "@pk-nerdsaver-ai/pi-ai";
import { type CompactionEntry, type SessionEntry } from "./session-entries";
export interface SessionContext {
    messages: AgentMessage[];
    thinkingLevel?: string;
    serviceTier?: ServiceTier;
    /** Model roles: { default: "provider/modelId", small: "provider/modelId", ... } */
    models: Record<string, string>;
    /** Names of TTSR rules that have been injected this session */
    injectedTtsrRules: string[];
    /** MCP tool names selected through discovery for this session branch. */
    selectedMCPToolNames: string[];
    /** Whether this branch contains an explicit persisted MCP selection entry. */
    hasPersistedMCPToolSelection: boolean;
    /** Active mode (e.g. "plan") or "none" if no special mode is active */
    mode: string;
    /** Mode-specific data from the last mode_change entry */
    modeData?: Record<string, unknown>;
}
/** Lists session model strings to try when restoring, in fallback order. */
export declare function getRestorableSessionModels(models: Readonly<Record<string, string>>, lastModelChangeRole: string | undefined): string[];
export declare function getLatestCompactionEntry(entries: SessionEntry[]): CompactionEntry | null;
export interface BuildSessionContextOptions {
    /**
     * Build the full-history display transcript instead of the LLM context:
     * every path entry in chronological order, with each compaction emitted
     * inline as a `compactionSummary` message at the position it fired rather
     * than replacing the history before it. Display-only — never send the
     * result to a provider.
     */
    transcript?: boolean;
}
/**
 * Build the session context from entries using tree traversal.
 * If leafId is provided, walks from that entry to root.
 * Handles compaction and branch summaries along the path.
 */
export declare function buildSessionContext(entries: SessionEntry[], leafId?: string | null, byId?: Map<string, SessionEntry>, options?: BuildSessionContextOptions): SessionContext;
