/** * Scheduler Type Definitions * Lightweight JSON-based scheduling system with native OS cron integration */ /** * Timing Group - Represents a specific cron schedule with multiple tasks * One OS schedule is created per timing group, executing all active tasks in parallel */ export interface TimingGroup { id: string; name: string; cronExpression: string; timezone?: string; taskIds: string[]; createdAt: string; lastExecutionAt?: string; nextExecutionAt?: string; } /** * Scheduled Task - Individual task to execute at a specific timing * Multiple tasks can share the same timing group */ export interface ScheduledTask { id: string; name: string; description?: string; timingId: string; cronExpression?: string; timezone?: string; tool: string; parameters: Record; fireOnce: boolean; maxExecutions?: number; endDate?: string; catchupMissed?: boolean; createdAt: string; status: 'active' | 'paused' | 'completed' | 'error'; errorMessage?: string; workingDirectory?: string; executionCount: number; lastExecutionId?: string; lastExecutionAt?: string; } /** * Task Execution - Result of executing a single task */ export interface TaskExecution { executionId: string; taskId: string; taskName: string; timingId: string; tool: string; parameters: Record; startedAt: string; completedAt?: string; duration?: number; status: 'success' | 'failure' | 'timeout' | 'running'; result?: { content?: any[]; [key: string]: any; }; error?: { message: string; code?: number; data?: any; }; } /** * New storage format with timing groups (stored in schedule.json) */ export interface SchedulerStorage { version: string; tasks: Record; timings: Record; } export interface ScheduledJob { id: string; name: string; description?: string; cronExpression: string; timezone?: string; tool: string; parameters: Record; fireOnce: boolean; maxExecutions?: number; endDate?: string; createdAt: string; status: 'active' | 'paused' | 'completed' | 'error'; errorMessage?: string; workingDirectory?: string; executionCount: number; lastExecutionId?: string; lastExecutionAt?: string; nextExecutionAt?: string; } export interface JobExecution { executionId: string; jobId: string; jobName: string; tool: string; parameters: Record; startedAt: string; completedAt?: string; duration?: number; status: 'success' | 'failure' | 'timeout' | 'running'; result?: { content?: any[]; [key: string]: any; }; error?: { message: string; code?: number; data?: any; }; } export interface JobsStorage { version: string; jobs: Record; } export interface ExecutionSummary { executionId: string; jobId: string; jobName: string; tool: string; startedAt: string; duration: number | null; status: 'success' | 'failure' | 'timeout' | 'running'; errorMessage: string; } /** * Task Execution Summary - For displaying task execution history */ export interface TaskExecutionSummary { executionId: string; taskId: string; taskName: string; timingId: string; tool: string; startedAt: string; duration: number | null; status: 'success' | 'failure' | 'timeout' | 'running'; errorMessage: string; jobId?: string; jobName?: string; } export interface SchedulerConfig { maxExecutionsPerJob?: number; maxExecutionAgeDays?: number; cleanupSchedule?: string; enableAutoCleanup?: boolean; defaultTimeout?: number; } export interface NaturalLanguageParseResult { success: boolean; cronExpression?: string; explanation?: string; error?: string; fireOnce?: boolean; } //# sourceMappingURL=scheduler.d.ts.map