import { type SchedulePaths } from "./paths.js"; import { type ScheduleJob, type ScheduleRunResult } from "./types.js"; import type { DesktopNotifyOptions } from "../gateway/desktop-notify.js"; export interface RunOptions { /** Called when a job has expired (TTL passed or maxRuns reached) so the caller can uninstall the OS entry. */ onExpire?: (job: ScheduleJob) => void; /** * Override the notify implementation (tests). Defaults to `gateway/notify.notify`. * Returning anything falsy is treated as a delivery failure; the runner only * logs it to stderr — notify failures never propagate into the job result. */ notify?: (text: string, target: string) => Promise<{ ok: boolean; reason?: string; }>; /** * Override the desktop-notify implementation (tests). Defaults to * `gateway/desktop-notify.notifyDesktop`. Failures are logged to stderr only * and never propagate into the job result. */ notifyDesktop?: (opts: DesktopNotifyOptions) => Promise<{ ok: boolean; reason?: string; }>; } /** * PATH for the spawned agent. OS schedulers (cron/launchd/systemd) run the * entry with a minimal PATH (`/usr/bin:/bin`), so the agent CLI (`copilot`) * and the tools it shells out to (`gh`, `node`, …) would not resolve. * Augment with the locations of the current node and the omp wrapper plus * the usual user bin dirs; existing PATH entries are kept last. */ export declare function agentEnvPath(env?: NodeJS.ProcessEnv, ompBinPath?: string): string; /** Execute one scheduled run (expiry check, overlap lock, timeout, log capture, result append). */ export declare function runScheduledJob(job: ScheduleJob, paths: SchedulePaths, opts?: RunOptions): Promise;