import type { ChannelDestination } from "./channels/types.js"; /** * The managed `schedules/` declaration primitive. * * A schedule is a proactive, time-triggered agent run. Files under * `schedules/*.ts` export a named `schedule` created with `defineSchedule(...)`; * the compiler materializes those declarations into LangGraph cron entries. */ /** Thread behavior for scheduled runs. */ export type ScheduleThreadConfig = { /** * Create a fresh thread for each scheduled run. * * This is the default and recommended behavior for reports, digests, and * background sweeps. MDA emits `on_run_completed: "delete"` so the * temporary thread is cleaned up after the run completes. */ mode?: "ephemeral"; } | { /** * Reuse the same durable thread across scheduled runs. * * Use this only when the schedule intentionally needs accumulated thread * state across invocations. */ mode: "persistent"; /** * Stable thread id to reuse for every run of this schedule. * * Required when `mode` is `"persistent"`. */ id: string; }; /** Optional channel delivery target for a scheduled run result. */ export interface ScheduleDeliveryTarget { /** * Configured outbound channel id. * * For the first channel integrations this may be a provider name such as * `"slack"`. If a deployment configures multiple channels of the same * provider, this can become the file-derived channel id. */ channel: "slack" | "discord" | "email" | string; /** * Explicit destination in the configured channel. * * Schedules have no originating channel or thread, so `current_thread` is not * valid here; provide a provider conversation or provider thread. */ to: Exclude; /** * Whether MDA should automatically post the agent's final response to * `to`. * * Defaults to `true` once channel delivery is supported. */ autoPost?: boolean; } /** Configuration accepted by {@link defineSchedule}. */ export interface ScheduleConfig { /** * Standard 5-field cron expression: * minute hour day-of-month month day-of-week. */ cron: string; /** * Optional IANA timezone. LangSmith crons default to UTC; when supplied, this * is passed through to the underlying cron definition. */ timezone?: string; /** Natural-language prompt sent to the agent when the schedule fires. */ prompt?: string; /** Structured input sent to the agent when the schedule fires. */ input?: unknown; /** Optional thread behavior. Defaults to `{ mode: "ephemeral" }`. */ thread?: ScheduleThreadConfig; /** * Optional channel delivery for the agent's final response after the cron * run. Phase 1 supports Slack (`channel: "slack"`) via Web API auto-post. */ deliverTo?: ScheduleDeliveryTarget; } /** The object exported from `schedules/*.ts`. */ export interface ScheduleDefinition extends ScheduleConfig { readonly kind: "schedule"; } /** * Declare a managed schedule that the compiler provisions as a LangGraph cron. */ export declare function defineSchedule(config: ScheduleConfig): ScheduleDefinition; //# sourceMappingURL=schedules.d.ts.map