import type { PDTaskSpec } from './pd-task-types.js'; export interface CronJobState { nextRunAtMs?: number; runningAtMs?: number; lastRunAtMs?: number; lastRunStatus?: string; lastStatus?: 'ok' | 'error' | 'skipped'; lastError?: string; lastDurationMs?: number; consecutiveErrors?: number; } export interface CronJob { id: string; name: string; agentId?: string; description?: string; enabled: boolean; deleteAfterRun?: boolean; createdAtMs: number; updatedAtMs: number; schedule: { kind: 'every'; everyMs: number; } | { kind: 'at'; at: string; } | { kind: 'cron'; expr: string; tz?: string; }; sessionTarget: string; wakeMode: string; payload: { kind: 'systemEvent'; text: string; } | { kind: 'agentTurn'; message: string; model?: string; thinking?: string; timeoutSeconds?: number; lightContext?: boolean; toolsAllow?: string[]; }; delivery?: { mode: string; channel?: string; to?: string; }; state: CronJobState; metadata?: Record; } export interface CronStoreFile { version: number; jobs: CronJob[]; } export type DiffActionType = 'CREATE' | 'UPDATE' | 'DISABLE' | 'ORPHAN' | 'SKIP'; export interface DiffAction { type: DiffActionType; task?: PDTaskSpec; job?: CronJob; } export interface ReconcileError { taskId: string; message: string; } export interface ReconcileResult { created: string[]; updated: string[]; skipped: string[]; orphaned: string[]; errors: ReconcileError[]; } export interface ReconcileOptions { dryRun?: boolean; workspaceDir: string; logger?: { info?: (_: string) => void; warn?: (_: string) => void; }; } export declare function reconcilePDTasks(workspaceDir: string, options?: Partial): Promise; export declare function trigger(taskId: string, workspaceDir: string, options?: { force?: boolean; }): Promise<{ ok: boolean; error?: string; }>;