/** * 调度任务状态 */ export type ScheduleTaskStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'ready'; /** * 单个调度任务 */ export interface ScheduleTask { /** 唯一 ID,自动生成 */ id: string; /** 任务名称/描述 */ name: string; /** 目标迭代 */ iteration: string; /** 指定执行的 Task ID(单个模式),null 表示批量模式 */ taskId: string | null; /** 是否 --all 批量模式 */ all: boolean; /** 调度时间,格式: "2026-08-10 21:00:00" */ scheduledAt: string; /** ISO 8601 格式的调度时间 */ scheduledAtISO: string; /** 任务状态 */ status: ScheduleTaskStatus; /** 创建时间 */ createdAt: string; /** 实际执行时间 */ executedAt: string | null; /** 执行结果摘要 */ result: string | null; /** 执行参数 (传递给 execute 命令的额外选项) */ execOptions: { batchSize?: number; parallel?: number; assignee?: string; type?: string; priority?: string; status?: string; platform?: string; backend?: boolean; frontend?: boolean; }; } /** * 调度存储文件 */ export interface ScheduleStore { /** 版本号 */ version: number; /** 所有调度任务 */ tasks: ScheduleTask[]; /** 守护进程是否在运行 */ daemonRunning: boolean; /** 守护进程 PID */ daemonPid: number | null; /** 最后更新时间 */ updatedAt: string; } /** * 解析时间字符串 "2026-08-10 21:00:00" 为 Date 和 ISO 字符串 */ export declare function parseScheduleTime(timeStr: string): { date: Date; iso: string; }; /** * 格式化时间为 "YYYY-MM-DD HH:mm:ss" */ export declare function formatScheduleTime(date: Date): string; /** * 加载调度存储 */ export declare function loadScheduleStore(): Promise; /** * 保存调度存储 */ export declare function saveScheduleStore(store: ScheduleStore): Promise; /** * 创建调度任务 */ export declare function createScheduleTask(params: { name: string; iteration: string; taskId: string | null; all: boolean; scheduledAt: string; execOptions?: ScheduleTask['execOptions']; }): Promise; /** * 获取所有待执行的任务(按调度时间排序) */ export declare function getPendingTasks(): Promise; /** * 获取所有任务(按状态筛选) */ export declare function listScheduleTasks(status?: ScheduleTaskStatus): Promise; /** 获取单个调度任务详情 */ export declare function getScheduleTask(id: string): Promise; /** * 更新任务状态 */ export declare function updateScheduleTask(taskId: string, updates: Partial>): Promise; /** * 取消调度任务 */ export declare function cancelScheduleTask(taskId: string): Promise; /** * 删除调度任务(物理删除) */ export declare function deleteScheduleTask(taskId: string): Promise; /** * 获取所有已到期但未执行的任务 */ export declare function getDueTasks(): Promise; /** * 更新守护进程状态 */ export declare function updateDaemonStatus(running: boolean, pid: number | null): Promise; //# sourceMappingURL=schedule-store.d.ts.map