import type { AgentMessage } from '@earendil-works/pi-agent-core'; /** Logical speaker selection without changing append-only stored voice rows. */ export declare function learningRoleSql(role: 'user' | 'assistant', alias?: string): string; export declare function learningTranscriptMessage(row: { role: string | null; payload_json: string; }): AgentMessage | undefined; /** Match the canonical routing fallback used by resolveUserContextSessionAccess. */ export declare const OWNER_LEARNING_SESSION_SQL = "(json_extract(s.routing_json, '$.peerKind') IS NOT NULL OR s.session_type = 'chat')\n AND COALESCE(json_extract(s.routing_json, '$.peerKind'), 'direct') = 'direct'\n AND (COALESCE(json_extract(s.routing_json, '$.source'), s.source_channel) IN ('webchat','cli','tui') OR EXISTS (\n SELECT 1 FROM owner_identity_bindings b WHERE b.revoked_at IS NULL\n AND b.channel = COALESCE(json_extract(s.routing_json, '$.source'), s.source_channel)\n AND b.account_id = COALESCE(json_extract(s.routing_json, '$.accountId'), 'default')\n AND b.peer_id = COALESCE(json_extract(s.routing_json, '$.peerId'), s.source_chat_id)))";