MCPcopy Create free account
hub / github.com/echoVic/blade-code / addTask

Method addTask

src/prompt/WorkflowManager.ts:282–298  ·  view source on GitHub ↗

* 添加任务

(task: Omit<WorkflowTask, 'id' | 'createdAt' | 'updatedAt'>)

Source from the content-addressed store, hash-verified

280 * 添加任务
281 */
282 public addTask(task: Omit<WorkflowTask, 'id' | 'createdAt' | 'updatedAt'>): WorkflowTask {
283 const id = this.generateTaskId();
284 const newTask: WorkflowTask = {
285 ...task,
286 id,
287 createdAt: new Date(),
288 updatedAt: new Date(),
289 };
290
291 this.tasks.set(id, newTask);
292
293 if (this.config.autoSave) {
294 this.saveTodoFile();
295 }
296
297 return newTask;
298 }
299
300 /**
301 * 更新任务

Callers

nothing calls this directly

Calls 3

generateTaskIdMethod · 0.95
saveTodoFileMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected