import type { DatabaseSync } from 'node:sqlite'; import type { OneShotDestination, OneShotTerminalReason } from '@xopcai/gateway-contract'; export interface AttentionThread { id: string; owner_id: string; agent_id: string; conversation_id: string; subject: string; summary: string; kind: 'outcome' | 'discussion' | 'interest'; status: 'candidate' | 'active' | 'paused' | 'completed' | 'expired'; authority: 'user_explicit' | 'inferred'; task_id: string | null; project_id: string | null; next_check_at: number | null; pause_until: number | null; expires_at: number; last_meaningful_at: number; revision: number; created_at: number; updated_at: number; follow_up_mode: 'recurring' | 'one_shot'; wait_id: string | null; destination: OneShotDestination | null; check_at: number | null; valid_until: number | null; timezone: string | null; contract_key: string | null; session_input_id: string | null; last_checked_at: number | null; last_check_error: string | null; terminal_reason: OneShotTerminalReason | null; } export interface AttentionSource { entryId: string; transcriptId: string; conversationId: string; excerpt: string; processingPolicy: string | null; version: string; } export interface Wakeup { id: string; thread_id: string; trigger_kind: string; source_event_id: string | null; thread_revision: number; lease_token: string | null; attempts: number; expires_at: number; } export interface Outreach { id: string; wakeup_id: string; thread_id: string; conversation_id: string; origin_transcript_id: string; thread_revision: number; context_revision: number; policy_revision: number; decision: string; reason: string; state: string; text: string | null; provenance_json: string; valid_until: number; message_entry_id: string | null; notified_at: number | null; created_at: number; published_at: number | null; destination: OneShotDestination; acknowledged_at: number | null; } export declare function userText(payload: { content?: unknown; }): string; export declare function sourceFingerprint(sources: AttentionSource[]): string; export declare function getAttention(id: string, ownerId?: string, db?: DatabaseSync): AttentionThread | undefined; export declare function listAttention(conversationId: string, db?: DatabaseSync): AttentionThread[]; export declare function getAttentionSources(threadId: string, entryIds?: string[], db?: DatabaseSync): AttentionSource[]; export declare function hasPendingAssistantTaskReply(conversationId: string, db?: DatabaseSync): boolean;