import { type BackgroundAutomationContext, type BackgroundAutomationDeps } from "../jobs/background-automation-runner.js"; import type { TriggerFrontmatter } from "./types.js"; import type { AutomationWebhookTaskPayload } from "./webhook.js"; export declare function parseTriggerFrontmatter(content: string): { meta: TriggerFrontmatter; body: string; }; export declare function buildTriggerContent(meta: TriggerFrontmatter, body: string): string; export interface TriggerDispatcherDeps extends BackgroundAutomationDeps { getInitialToolNames?: (automation?: BackgroundAutomationContext) => string[] | undefined; } export type AutomationWebhookTaskResult = "completed" | "retry"; export declare function buildAutomationTriggerPrompt(input: { triggerName: string; event?: string | undefined; eventId?: string | undefined; firedAt?: string | undefined; payload: unknown; body: string; }): string; export declare function initTriggerDispatcher(deps: TriggerDispatcherDeps): Promise; export declare function stopTriggerQueueWorker(): Promise; /** * Reloads which events have automations, e.g. after one is defined or * deleted. `false` means the load failed; the next event reads fresh. */ export declare function refreshEventSubscriptions(): Promise; /** * Whether an enabled event automation in this app listens for `eventName`. * Only a cached `true` is reused: callers act on `false` by discarding work * (Mail advances its history cursor), so `false` is always backed by a * fingerprint read made by this call. Rejects when automations cannot be read. */ export declare function hasEventAutomation(eventName: string): Promise; export declare function dispatchAutomationWebhookTask(task: AutomationWebhookTaskPayload): Promise;