import type { SessionStats, TurnRecord } from './slash/types.js'; import type { AgentModelInput } from '../agent/types.js'; import type { TraceActor } from '../agent/session/session-identity.js'; import { type SessionBinding, type SessionHandle } from '../agent/session/session-registry.js'; export interface StoredSession { sessionId?: string; name?: string; source?: 'cli' | 'telegram' | 'daemon' | 'web'; telegramChatId?: number; model: AgentModelInput; startedAt: number; savedAt: number; totalTurns: number; totalCostUsd: number; unpricedTurns?: number; totalTokens: number; totalDurationMs: number; turns: TurnRecord[]; forkedFrom?: string; forkedAt?: number; actor?: TraceActor; cwd?: string; handleId?: string; bindings?: SessionBinding[]; } export interface SessionListEntry { path: string; id: string; sessionId?: string; name?: string; source?: 'cli' | 'telegram' | 'daemon' | 'web'; actor?: TraceActor; telegramChatId?: number; model: AgentModelInput; startedAt: number; savedAt: number; totalTurns: number; totalCostUsd: number; cwd?: string; } export interface FoundSession { path: string; id: string; data: StoredSession; } export declare function saveSession(stats: SessionStats, overrideId?: string): string; export declare function forkStoredSession(stats: SessionStats, opts?: { newId?: string; }): { id: string; path: string; }; export declare function loadSession(idOrPath: string): StoredSession | undefined; export declare function findSession(idOrName: string): FoundSession | undefined; export declare function listSessions(): SessionListEntry[]; export declare function sdkSessionIdFor(idOrName: string): string | undefined; export declare function bindingsForStored(stored: StoredSession): SessionBinding[]; export declare function storedToHandle(stored: StoredSession, sidecarId: string): SessionHandle; export declare function storedFieldsFromHandle(handle: SessionHandle): Pick;