import type { Config } from '../../config/schema.js'; import type { AutomationEventEnvelope } from '../../automations/domain/types.js'; import { type AttentionLiveContextItem } from '../context-probe.js'; import { type OneShotStateChange } from './one-shot-follow-up.js'; import { type AttentionThread } from './repository.js'; export interface ProactivityDeps { ownerId?: string; getConfig: () => Config; isAvailable: (conversationId: string) => boolean; notify: (conversationId: string, outreachId: string) => void; onFollowUpUpdated?: (change: OneShotStateChange) => void; onBeforePublishOneShot?: (info: { ownerId: string; taskId: string; waitId: string; followUpId: string; outreachId: string; now: number; }) => void; collectLiveContext?: (thread: AttentionThread, now: number) => Promise | AttentionLiveContextItem[]; call?: (conversationId: string, operation: string, prompt: string, signal: AbortSignal) => Promise; now?: () => number; } export declare class ProactivityService { private readonly deps; private running; private stopped; private controller?; private readonly stopWaiters; constructor(deps: ProactivityDeps); private ownerId; private now; private accessible; private available; private hasDeliveredTaskResult; private call; stop(): Promise; start(): void; /** SQL-only admission; the bounded worker runs outside the scheduler transaction. */ tick(): void; /** The durable automation projection retries this admission before acknowledging its event. */ ingestEvent(event: AutomationEventEnvelope): void; drain(): Promise; private extract; private evaluate; private publish; }