/**
 * Persisted session entries plus the `RuntimeSessionStore` interface the
 * runtime uses to read and append them.
 */
import type { ImageContent, TextContent } from '../ai/types.js';
import type { AgentMessage } from '../core/index.js';
export interface RuntimeSessionModelRef {
    provider: string;
    modelId: string;
}
export interface AgentSessionContext {
    messages: AgentMessage[];
    messageEntryIds?: string[];
    thinkingLevel: string;
    model: RuntimeSessionModelRef | null;
}
/** Type guard validating that an unknown value matches the AgentSessionContext shape. */
export declare function isAgentSessionContext(value: unknown): value is AgentSessionContext;
export interface RuntimeSessionHeader {
    type: 'session';
    version?: number;
    id: string;
    timestamp: string;
    cwd: string;
    parentSession?: string;
    isSubagent?: boolean;
}
export interface AgentSessionEntryBase {
    type: string;
    id: string;
    parentId: string | null;
    timestamp: string;
}
export interface RuntimeSessionMessageEntry extends AgentSessionEntryBase {
    type: 'message';
    message: AgentMessage;
    durationMs?: number;
}
export interface AgentThinkingLevelChangeEntry extends AgentSessionEntryBase {
    type: 'thinking_level_change';
    thinkingLevel: string;
}
export interface RuntimeModelChangeEntry extends AgentSessionEntryBase {
    type: 'model_change';
    provider: string;
    modelId: string;
}
export interface RuntimeCompactionEntry<T = unknown> extends AgentSessionEntryBase {
    type: 'compaction';
    summary: string;
    firstKeptEntryId: string;
    tokensBefore: number;
    details?: T;
    fromHook?: boolean;
}
export interface RuntimeCustomEntry<T = unknown> extends AgentSessionEntryBase {
    type: 'custom';
    customType: string;
    data?: T;
}
export interface RuntimeCustomMessageEntry<T = unknown> extends AgentSessionEntryBase {
    type: 'custom_message';
    customType: string;
    content: string | (TextContent | ImageContent)[];
    details?: T;
    display: boolean;
}
export interface RuntimeLabelEntry extends AgentSessionEntryBase {
    type: 'label';
    targetId: string;
    label: string | undefined;
}
export interface RuntimeSessionInfoEntry extends AgentSessionEntryBase {
    type: 'session_info';
    name?: string;
}
export interface RuntimeTurnStartEntry extends AgentSessionEntryBase {
    type: 'turn_start';
    turnIndex: number;
}
export interface RuntimeTurnEndEntry extends AgentSessionEntryBase {
    type: 'turn_end';
    turnIndex: number;
    durationMs: number;
}
export interface RuntimeSystemPromptEntry extends AgentSessionEntryBase {
    type: 'system_prompt';
    content: string;
}
export interface RuntimeToolDefinitionSnapshot {
    name: string;
    description: string;
    parameters: unknown;
}
export interface RuntimeToolDefinitionsEntry extends AgentSessionEntryBase {
    type: 'tool_definitions';
    tools: RuntimeToolDefinitionSnapshot[];
}
export interface RuntimeToolExecutionEndEntry extends AgentSessionEntryBase {
    type: 'tool_execution_end';
    toolCallId: string;
    toolName: string;
    isError: boolean;
    result: unknown;
}
export interface RuntimeLlmCallEntry extends AgentSessionEntryBase {
    type: 'llm_call';
    requestId: string;
    body: {
        effort_level?: 'low' | 'medium' | 'high' | 'max';
        max_tokens?: number;
        messages: readonly {
            content: string;
            role: string;
            thinking?: string;
            thinking_signature?: string;
            tool_call_id?: string;
            tool_calls?: readonly {
                arguments: string;
                id: string;
                name: string;
            }[];
        }[];
        model: string;
        speed?: 'fast' | 'standard';
        thinking_type?: 'adaptive' | 'off';
        userMessageId?: string;
        tools?: readonly {
            description: string;
            name: string;
            parameters: unknown;
        }[];
    };
}
export type AgentSessionEntry = RuntimeSessionMessageEntry | AgentThinkingLevelChangeEntry | RuntimeModelChangeEntry | RuntimeCompactionEntry | RuntimeCustomEntry | RuntimeCustomMessageEntry | RuntimeLabelEntry | RuntimeSessionInfoEntry | RuntimeTurnStartEntry | RuntimeTurnEndEntry | RuntimeSystemPromptEntry | RuntimeToolDefinitionsEntry | RuntimeToolExecutionEndEntry | RuntimeLlmCallEntry;
export interface RuntimeSessionTreeNode {
    entry: AgentSessionEntry;
    children: RuntimeSessionTreeNode[];
    label?: string;
}
export interface RuntimeNewSessionOptions {
    parentSession?: string;
    isSubagent?: boolean;
}
export interface RuntimeSessionStore {
    buildSessionContext(): AgentSessionContext;
    getCwd(): string;
    getBranch(): AgentSessionEntry[];
    getEntries(): AgentSessionEntry[];
    getEntry(entryId: string): AgentSessionEntry | undefined;
    getHeader(): RuntimeSessionHeader | null;
    getLeafId(): string | null;
    getLeafEntry(): AgentSessionEntry | undefined;
    getLabel(entryId: string): string | undefined;
    getSessionDir(): string;
    getSessionFile(): string | undefined;
    getSessionId(): string;
    getSessionName(): string | undefined;
    getTree(): RuntimeSessionTreeNode[];
    newSession(options?: RuntimeNewSessionOptions): string | undefined;
    setSessionFile(sessionPath: string): void;
    createBranchedSession(parentEntryId: string): string | undefined;
    resetLeaf(): void;
    branch(entryId: string): void;
    appendSessionInfo(name: string): string;
    appendLabelChange(targetId: string, label?: string): string;
    appendMessage(message: AgentMessage, durationMs?: number): string;
    appendCustomEntry<T = unknown>(customType: string, data?: T): string;
    appendCustomMessageEntry<T = unknown>(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details?: T): string;
    appendThinkingLevelChange(thinkingLevel: string): string;
    appendModelChange(provider: string, modelId: string): string;
    appendCompaction<T = unknown>(summary: string, firstKeptEntryId: string, tokensBefore: number, details?: T, fromHook?: boolean): string;
    appendSystemPrompt(content: string): string;
    appendToolDefinitions(tools: RuntimeToolDefinitionSnapshot[]): string;
    appendTurnStart(turnIndex: number): string;
    appendTurnEnd(turnIndex: number, durationMs: number): string;
}
//# sourceMappingURL=agent-session-store.d.ts.map