import type { AgentMessage } from '@earendil-works/pi-agent-core'; import type { SessionAgentConfig } from '../../session/config-types.js'; import { type TranscriptStoredRow } from '../../session/session-context-for-llm.js'; import { type GlobalSessionStats, type SessionMetadata } from '../../session/types.js'; export type SessionRow = { session_key: string; agent_id: string; session_id: string; status: string; name: string | null; tags_json: string; created_at: number; updated_at: number; last_accessed_at: number; session_started_at: number | null; last_interaction_at: number | null; source_channel: string; source_chat_id: string; session_type: string | null; hidden_from_session_list: number | null; parent_session_key: string | null; workflow_run_id: string | null; workflow_definition_id: string | null; workflow_agent_id: string | null; workflow_agent_label: string | null; project_id: string | null; routing_json: string | null; custom_data_json: string | null; message_count: number; estimated_tokens: number; compacted_count: number; last_flushed_at: string | null; flush_count: number; thinking_level: string | null; verbose_level: string | null; cwd?: string | null; }; export type TranscriptEntryRow = { entry_id: string; session_id: string; seq: number; entry_kind: string; role: string | null; payload_json: string; created_at: number; }; export type SessionConfigRow = { session_key: string; thinking_level: string | null; reasoning_level: string | null; verbose_level: string | null; elevated_mode: string | null; model_override: string | null; provider_override: string | null; working_directory_override: string | null; response_language: string | null; user_context_mode: string | null; updated_at: number; }; export declare function sessionRowToMetadata(sessionKey: string, row: SessionRow): SessionMetadata; export declare function metadataToSessionInsert(sessionKey: string, sessionId: string, metadata: SessionMetadata, thinkingLevel?: string | null, verboseLevel?: string | null): { sessionKey: string; agentId: string; sessionId: string; status: string; name: string | null; tagsJson: string; createdAt: number; updatedAt: number; lastAccessedAt: number; sessionStartedAt: number | null; lastInteractionAt: number | null; sourceChannel: string; sourceChatId: string; sessionType: string; hiddenFromSessionList: number; parentSessionKey: string | null; workflowRunId: string | null; workflowDefinitionId: string | null; workflowAgentId: string | null; workflowAgentLabel: string | null; projectId: string | null; routingJson: string | null; customDataJson: string | null; messageCount: number; estimatedTokens: number; compactedCount: number; lastFlushedAt: string | null; flushCount: number; thinkingLevel: string | null; verboseLevel: string | null; }; export declare function sessionConfigRowToConfig(row: SessionConfigRow): SessionAgentConfig; export declare function transcriptEntryRowToStoredRow(row: TranscriptEntryRow): TranscriptStoredRow; export declare function classifyStoredRow(row: TranscriptStoredRow): { entryKind: 'message' | 'context' | 'compaction'; role: string | null; }; export declare function extractFtsContent(row: TranscriptStoredRow): string; export declare function estimateTokensFromMessages(messages: AgentMessage[]): number; export declare function buildGlobalSessionStats(sessions: SessionMetadata[]): GlobalSessionStats;