/** * SDK helper for a calendar one-shot. Not a host trigger type. * * Live host parseStoredTrigger / KNOWN_TRIGGER_TYPES is still cron + event * listeners + group. `{ type: "once", at }` is not in that allowlist — the * host would drop it (or drop it from a group and keep slack/etc.). * * createAgentAutomation / updateAgentAutomation translate a standalone once * to a dated cron (`M H D M *`) in the host cron zone so something still fires, * and append a prompt footer telling the agent to delete the routine after it * executes. Live host cron is user-local Pacific/Auckland (unless the host * process has CRON_TZ=). This helper emits those clock fields — it does not * prefix `CRON_TZ=` on the schedule; SDK normalizeSchedule only trims, and * nothing extracted from FileAutomationStore says the host keeps that prefix. * Dated cron annual-repeats; the host has no disable-after-fire contract. * Unrelated to gateway/oneshot.ts throwaway runs. */ /** Live host cron zone when CRON_TZ is unset. */ export declare const HOST_CRON_TIME_ZONE = "Pacific/Auckland"; import type { AutomationTrigger, CronTrigger, OnceTrigger } from "./types.js"; /** Epoch ms must be strictly after 2001-09-09T01:46:40.000Z. Rejects 0, negatives, seconds. */ export declare const ONCE_AT_MIN_MS = 1000000000000; /** * Appended to `prompt` only when create/update translate standalone * `{ type: "once", at }` to dated cron. Cron-only and event-listener specs * are left unchanged. The host has no disable-after-fire contract, so the * agent must delete the routine after it executes. */ export declare const ONCE_DATED_CRON_DELETE_INSTRUCTION = "This is a one-time dated cron. Delete this routine after it executes; it would otherwise annual-repeat next year."; /** * Parse `at` to epoch ms. * Prefer ISO-8601 with a time and timezone (`Z` or offset). Also accepts * epoch milliseconds (number or digit string) strictly greater than 1e12. * * Rejects: whitespace-only, date-only (`2026-08-18`), missing timezone, * epoch seconds, 0, negatives, NaN. Date-only is ambiguous (local vs UTC * midnight) so it is not treated as 00:00Z. */ export declare function parseOnceAtMs(value: unknown): number | null; export declare function isValidOnceAt(value: unknown): value is string | number; /** Trim + UTC ISO-8601 (`YYYY-MM-DDTHH:mm:ss.sssZ`). */ export declare function normalizeOnceAt(value: unknown): string | null; export declare function parseOnceTrigger(value: unknown): OnceTrigger | null; /** * Live host path for a calendar fire: dated cron (`M H D M *`) in host-local * fields (default Pacific/Auckland). Pass `timeZone` when the host has CRON_TZ=. * Minute resolution — seconds are dropped. Annual-repeats; a past `at` still * becomes that month/day/time and fires on the next matching calendar date. * There is no host contract to disable or delete the routine after it fires; * `toHostAutomationSpec` appends ONCE_DATED_CRON_DELETE_INSTRUCTION instead. */ export declare function onceToDatedCron(at: string | number, timeZone?: string): CronTrigger; /** * Fail closed toward the host: never emit `{ type: "once" }`. * Standalone once → dated cron (still fires). once in a group/list → throw. */ export declare function toHostAutomationTrigger(value: unknown): AutomationTrigger; export declare function toHostAutomationSpec(spec: T): T & { trigger: AutomationTrigger; }; //# sourceMappingURL=once-trigger.d.ts.map