/** * Trigger dispatcher — bridges the event bus to the automation system. * * On startup, loads all event-triggered jobs from the resources store, * subscribes to their events, and dispatches them (condition eval → agent * loop) when matching events fire. */ import { type ActionEntry } from "../agent/production-agent.js"; import type { TriggerFrontmatter } from "./types.js"; export declare function parseTriggerFrontmatter(content: string): { meta: TriggerFrontmatter; body: string; }; export declare function buildTriggerContent(meta: TriggerFrontmatter, body: string): string; export interface TriggerDispatcherDeps { getActions: () => Record; getSystemPrompt: (owner: string) => Promise; /** * Tool names to expose on the FIRST engine request for a trigger run. See * `SchedulerDeps.getInitialToolNames` (`jobs/scheduler.ts`) — same * semantics. Omit to keep the full `getActions()` set visible up front * (current behavior). */ getInitialToolNames?: () => string[] | undefined; apiKey?: string; model?: string; /** App/template id used for org-scoped per-app model defaults. */ appId?: string; } /** * Initialize the trigger dispatcher. Call once at server startup. * Loads all event-triggered jobs and subscribes to their events. */ export declare function initTriggerDispatcher(deps: TriggerDispatcherDeps): Promise; /** * Refresh event subscriptions from the resource store. * Call after creating/updating triggers. */ export declare function refreshEventSubscriptions(): Promise; //# sourceMappingURL=dispatcher.d.ts.map