/** * Shared Task Utils — 跨命令共享的工具函数 * * 消除 goal/bugfix/research/new-task 中的重复代码 */ /** * 检测项目根目录(向上查找 .speccore/) */ export declare function findProjectRoot(): string | null; /** * 确保在 SpecCore 项目根目录执行 */ export declare function ensureProjectRoot(): string; /** * 获取迭代目录(统一路径解析) */ export declare function getIterationDir(iteration: string): string; /** * 获取任务目录 */ export declare function getTaskDir(iteration: string, taskId: string): string; /** * 扫描迭代中的任务列表 */ export declare function scanIterationTasks(iterationDir: string): string[]; /** * 读取任务类型文件 */ export declare function readTaskType(taskDir: string): string | null; /** * 获取当前日期 YYYY-MM-DD */ export declare function today(): string; /** * 获取当前时间 ISO 字符串 */ export declare function now(): string; /** * 写入前自动备份:旧文件按时间戳重命名,永不覆盖 * 返回备份文件路径(无旧文件则返回 null) */ export declare function backupWithTimestamp(filePath: string): Promise; /** * 目录备份:旧目录按时间戳重命名,永不覆盖 * 返回备份目录路径(无旧目录则返回 null) */ export declare function backupDirWithTimestamp(dirPath: string): Promise; /** * 判断文件名是否为时间戳备份文件(如 ANALYSIS-20260813021034.md) */ export declare function isTimestampBackup(filename: string): boolean; /** * 写入前智能决策:交互模式询问用户,自动模式静默备份 * @returns true = 可以继续写入,false = 用户取消 */ export declare function shouldOverwrite(filePath: string, interactive: boolean): Promise; //# sourceMappingURL=task-utils.d.ts.map