import type { WebsiteBlocklistConfig } from '../agent/tools/url-safety.js'; export declare const MATTERS_STATE_NAMESPACE = "proactive.follow-up-matters"; export declare const MIN_MATTER_INTERVAL_MS: number; export declare const DEFAULT_MATTER_INTERVAL_MS: number; export declare const MAX_MATTER_INTERVAL_MS: number; export declare const MAX_ACTIVE_MATTERS = 20; export type MatterStatus = 'active' | 'waiting_user' | 'paused' | 'resolved' | 'expired'; export type MatterDeliveryPreference = 'auto' | 'chat' | 'inbox'; export type MatterBinding = { kind: 'web_url'; watchId: string; url: string; label: string; } | { kind: 'event_source'; subscriptionId: string; sourcePattern: string; eventTypePattern: string; label: string; keyword?: string; sender?: string; } | { kind: 'web_search'; query: string; label: string; } | { kind: 'task'; taskId: string; label?: string; } | { kind: 'project'; projectId: string; label?: string; }; export interface MatterProgressEntry { id: string; at: number; kind: 'created' | 'check_silent' | 'update_sent' | 'action_proposed' | 'resolved' | 'blocked' | 'user_note' | 'state_changed'; summary: string; evidenceRefs?: string[]; preparedDraft?: string; inboxItemId?: string; outreachId?: string; nextCheckAt?: number | null; } export interface FollowUpMatter { id: string; ownerId: string; conversationId: string; title: string; goal: string; notifyWhen: string; doneCriteria?: string; status: MatterStatus; deliveryPreference: MatterDeliveryPreference; deadlineAt: number | null; checkIntervalMs: number; nextCheckAt: number | null; lastCheckedAt: number | null; lastSummary: string; lastError: string | null; errorNotifiedAt: number | null; bindings: MatterBinding[]; progressLog: MatterProgressEntry[]; revision: number; createdAt: number; updatedAt: number; } export interface MatterEventSourceInput { source: 'gmail' | 'calendar' | 'github' | 'linear' | 'local_folder' | 'local_git' | 'browser' | 'desktop'; keyword?: string; sender?: string; } export declare function listMatters(ownerId: string, options?: { includeClosed?: boolean; }): FollowUpMatter[]; export declare function getMatter(ownerId: string, matterId: string): FollowUpMatter | undefined; export interface CreateMatterInput { ownerId: string; conversationId: string; title: string; goal: string; notifyWhen: string; doneCriteria?: string; deliveryPreference?: MatterDeliveryPreference; deadlineAt?: number | null; checkIntervalMs?: number; projectId?: string; taskId?: string; urls?: readonly string[]; eventSources?: readonly MatterEventSourceInput[]; searchQueries?: readonly string[]; blocklist?: WebsiteBlocklistConfig; } export declare function createOrReuseMatter(input: CreateMatterInput, now?: number): { outcome: 'created' | 'reused_active'; matter: FollowUpMatter; createdWatchIds: string[]; }; export interface PatchMatterInput { expectedRevision?: number; title?: string; goal?: string; notifyWhen?: string; doneCriteria?: string; status?: MatterStatus; deliveryPreference?: MatterDeliveryPreference; deadlineAt?: number | null; checkIntervalMs?: number; nextCheckAt?: number | null; userNote?: string; addUrls?: readonly string[]; addEventSources?: readonly MatterEventSourceInput[]; addSearchQueries?: readonly string[]; blocklist?: WebsiteBlocklistConfig; } export declare function patchMatter(ownerId: string, matterId: string, patch: PatchMatterInput, now?: number): { matter: FollowUpMatter; createdWatchIds: string[]; }; export declare function recordMatterInvestigationOutcome(ownerId: string, matterId: string, outcome: { status: MatterStatus; logKind: MatterProgressEntry['kind']; summary: string; evidenceRefs?: string[]; preparedDraft?: string; inboxItemId?: string; outreachId?: string; nextCheckAt: number | null; lastError?: string | null; errorNotifiedAt?: number | null; }, now?: number): FollowUpMatter | undefined; export declare function expireConversationMatters(ownerId: string, conversationId: string, now?: number): number; export declare function deleteMatter(ownerId: string, matterId: string, now?: number): boolean; export declare function findMattersMatchingBinding(ownerId: string, match: { watchId?: string; subscriptionId?: string; taskId?: string; projectId?: string; }): FollowUpMatter[];