新增任務模型與工具的關聯檔案支持,擴展任務參數以包含相關檔案列表,並更新驗證規則以確保檔案路徑、類型及描述的有效性,提升任務管理的靈活性與完整性。

This commit is contained in:
siage 2025-04-12 00:42:38 +08:00
parent 95628091fb
commit 9df1c0b34b
3 changed files with 22 additions and 1 deletions

View File

@ -261,6 +261,7 @@ export async function batchCreateOrUpdateTasks(
description: string;
notes?: string;
dependencies?: string[];
relatedFiles?: RelatedFile[];
}>,
isOverwrite: boolean
): Promise<Task[]> {
@ -287,7 +288,8 @@ export async function batchCreateOrUpdateTasks(
taskData.name,
taskData.description,
taskData.notes,
[] // 空依賴列表
[], // 空依賴列表
taskData.relatedFiles // 添加關聯檔案
);
// 將新任務添加到映射表

View File

@ -261,6 +261,24 @@ export const splitTasksSchema = z
.describe(
"此任務依賴的前置任務ID或任務名稱列表支持兩種引用方式名稱引用更直觀"
),
relatedFiles: z
.array(
z.object({
path: z
.string()
.min(1, { message: "檔案路徑不能為空" })
.describe("檔案路徑,相對於專案根目錄"),
type: z
.nativeEnum(RelatedFileType)
.describe("檔案類型,用於區分不同類型的檔案"),
description: z
.string()
.min(1, { message: "檔案描述不能為空" })
.describe("檔案描述,用於說明檔案的用途和內容"),
})
)
.optional()
.describe("與任務相關的檔案列表,包含檔案路徑、類型和描述"),
})
)
.min(1, { message: "至少需要提供一個任務,請確保任務列表不為空" })

View File

@ -71,6 +71,7 @@ export interface SplitTasksArgs {
description: string; // 詳細的任務描述,包含實施要點、技術細節和驗收標準
notes?: string; // 補充說明、特殊處理要求或實施建議(選填)
dependencies?: string[]; // 此任務依賴的前置任務ID列表形成任務的有向無環依賴圖
relatedFiles?: RelatedFile[]; // 與任務相關的文件列表(選填)
}>;
}