/** * Companion CLI to Part 14 (peaks cron init/list/run). The * scheduler is a long-running background daemon that wakes up * once per minute, reads `.peaks/cron/schedule.json`, and runs * any due tasks via detached execSync (so a misbehaving task * cannot block the scheduler). Best-effort persistence via * `.peaks/cron/scheduler.pid` (advisory — operators can `kill * $(cat scheduler.pid)` if a stale entry lingers). * * Why a separate `peaks-cron-scheduler` CLI (not a peaks * subcommand) — long-running daemons that are spawned from a * `peaks ...` invocation confuse a future "which peaks version * is running" check. A dedicated binary name keeps the * scheduler's startup visible to operators. * * Windows: the scheduler writes its pid to a file. To run as * a real Windows service, the operator wires NSSM (or * node-windows) to call `peaks-cron-scheduler start` on * service start. Future slice: ship an NSSM install recipe * in the operator docs. * * POSIX: same pid-file pattern; an init.d / systemd unit * file would call `peaks-cron-scheduler start` and rely on * the scheduler to write its own pid. Or just run from * `nohup peaks-cron-scheduler start &` if you don't need * restart-on-crash. * * This file owns `registerCronSchedulerCommand`, `runSchedulerLoop` and the * standalone entry shim the `bin/peaks-cron-scheduler.js` script loads; the * four verb bodies live beside it, over the pid-file vocabulary in * `cron-scheduler-shared.ts`. */ import type { Command } from 'commander'; import { type ProgramIO } from '../cli-helpers.js'; export declare function registerCronSchedulerCommand(program: Command, io: ProgramIO): void; /** * Standalone scheduler entry point (the process the CLI spawns). * Runs a setInterval tick + reads schedule + runs due tasks. * Exits cleanly on SIGTERM. * * Exported as `runSchedulerLoop` so the dedicated * `peaks-cron-scheduler.js` entry shim can call it; the * command-side `registerCronSchedulerCommand` only uses * start/stop/status, not the loop. */ export declare function runSchedulerLoop(args: { projectRoot: string; tickMs?: number; signal?: AbortSignal; }): Promise;