/**
 * Validate a user-supplied webhook URL before the scheduler POSTs to it.
 * Defends against accidental misconfig and basic SSRF: no protocols other
 * than http(s); no loopback / RFC1918 / link-local destinations unless the
 * operator explicitly opts in via IMHUB_ALLOW_PRIVATE_WEBHOOKS=1.
 *
 * Note: this is a lexical check (IP literals + "localhost"). DNS-rebinding
 * mitigation requires an at-fetch-time guard; tracked separately.
 */
export declare function validateWebhookUrl(raw: string): {
    ok: true;
    url: URL;
} | {
    ok: false;
    reason: string;
};
export interface Schedule {
    id: number;
    name: string;
    agent: string;
    prompt: string;
    cron: string;
    enabled: number;
    next_run: string;
    last_run: string | null;
    notify_url: string | null;
    created_at: string;
    /** IM userId of the originating caller, or '' for legacy / system rows. */
    creator_id: string;
    /** Workspace this schedule was created under, or '' if unknown. */
    workspace_id: string;
}
/** Filter / scoping options for owner-sensitive schedule APIs. Identical
 *  semantics to {@link OwnerOpts} on job-board.ts. */
export interface OwnerOpts {
    creatorId?: string;
    /** Optional agent-name filter, mirrors job-board.OwnerOpts.agent. */
    agent?: string;
}
export interface CreateScheduleInput {
    name: string;
    agent: string;
    prompt: string;
    cron: string;
    notifyUrl?: string;
    enabled?: boolean;
    /** IM userId of the originating caller. Empty / undefined → '' (legacy). */
    creatorId?: string;
    /** Workspace this schedule was created under. */
    workspaceId?: string;
}
export declare function createSchedule(input: CreateScheduleInput): number;
export declare function listSchedules(limit?: number, opts?: OwnerOpts): Schedule[];
export declare function getSchedule(id: number, opts?: OwnerOpts): Schedule | null;
export declare function deleteSchedule(id: number, opts?: OwnerOpts): boolean;
export declare function setEnabled(id: number, enabled: boolean, opts?: OwnerOpts): boolean;
/** Run one tick — exposed for tests so they don't have to wait for setInterval. */
export declare function tick(now?: Date): Promise<number>;
/** Start the periodic ticker. Idempotent. */
export declare function startScheduler(): void;
export declare function stopScheduler(): void;
/** Close the underlying SQLite handle. Called by cli.ts on graceful
 *  shutdown so the WAL is checkpointed before exit (L2). */
export declare function closeScheduleDb(): void;
//# sourceMappingURL=schedule.d.ts.map