UNPKG

@mastra/core

Version:
36 lines 1.99 kB
import type { Schedule } from '../storage/domains/schedules/base.js'; export declare const NOTIFICATION_DISPATCH_WORKFLOW_ID = "__mastra_notification_dispatcher"; /** * Schedule row id for the lazily-created dispatcher schedule. Deliberately * NOT `wf_`-prefixed: `registerDeclarativeSchedules` orphan-cleanup deletes * `wf_`-prefixed rows that are no longer declared in code, and this row is * created imperatively (like heartbeat rows) on first deferred notification. */ export declare const NOTIFICATION_DISPATCH_SCHEDULE_ROW_ID = "__mastra_notification_dispatch"; export declare const NOTIFICATION_DISPATCH_DEFAULT_CRON = "*/1 * * * *"; export declare const NOTIFICATION_DISPATCH_DEFAULT_BATCH_SIZE = 100; export type NotificationDispatchConfig = { /** Defaults to true. Set false to opt out of automatic scheduled dispatch. */ enabled?: boolean; cron?: string; batchSize?: number; }; export declare function parseNotificationDispatchNow(input?: string): Date; /** * Builds the imperative schedule row that drives the notification dispatcher. * Created lazily by `Mastra.__ensureNotificationDispatchReady()` on the first * deferred notification, rather than declared on the workflow, so idle apps * never start the scheduler. */ export declare function buildNotificationDispatchSchedule({ cron, batchSize, }?: Omit<NotificationDispatchConfig, 'enabled'>): Schedule; export declare function createNotificationDispatchWorkflow({ batchSize, }?: Omit<NotificationDispatchConfig, 'enabled' | 'cron'>): import("../workflows").Workflow<import("../workflows/evented").EventedEngineType, import("../workflows").Step<string, any, any, any, any, any, import("../workflows/evented").EventedEngineType, unknown>[], "__mastra_notification_dispatcher", unknown, { now?: string | undefined; limit?: number | undefined; }, { delivered: number; failed: number; }, { delivered: number; failed: number; }, unknown>; //# sourceMappingURL=workflow.d.ts.map