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

Method updateTask

src/prompt/WorkflowManager.ts:303–326  ·  view source on GitHub ↗

* 更新任务

(
    id: string,
    updates: Partial<Omit<WorkflowTask, 'id' | 'createdAt'>>
  )

Source from the content-addressed store, hash-verified

301 * 更新任务
302 */
303 public updateTask(
304 id: string,
305 updates: Partial<Omit<WorkflowTask, 'id' | 'createdAt'>>
306 ): WorkflowTask {
307 const task = this.tasks.get(id);
308 if (!task) {
309 throw new Error(`任务不存在: ${id}`);
310 }
311
312 const updatedTask: WorkflowTask = {
313 ...task,
314 ...updates,
315 updatedAt: new Date(),
316 completedAt: updates.status === 'completed' ? new Date() : task.completedAt,
317 };
318
319 this.tasks.set(id, updatedTask);
320
321 if (this.config.autoSave) {
322 this.saveTodoFile();
323 }
324
325 return updatedTask;
326 }
327
328 /**
329 * 删除任务

Callers 5

startTaskMethod · 0.95
completeTaskMethod · 0.95
blockTaskMethod · 0.95
cancelTaskMethod · 0.95
addTaskNoteMethod · 0.95

Calls 3

saveTodoFileMethod · 0.95
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected