()
| 85 | |
| 86 | // 持久化并推送事件 |
| 87 | const emitUpdate = async () => { |
| 88 | const taskList = Array.from(tasks.values()); |
| 89 | if (options?.onSave) { |
| 90 | await options.onSave(taskList); |
| 91 | } |
| 92 | if (options?.sendEvent) { |
| 93 | options.sendEvent({ |
| 94 | type: "task_update", |
| 95 | tasks: taskList.map((t) => ({ |
| 96 | id: t.id, |
| 97 | subject: t.subject, |
| 98 | status: t.status, |
| 99 | description: t.description, |
| 100 | })), |
| 101 | }); |
| 102 | } |
| 103 | }; |
| 104 | |
| 105 | const createExecutor: ToolExecutor = { |
| 106 | execute: async (args: Record<string, unknown>) => { |
no test coverage detected