({ subject, description, activeForm, metadata }, context)
| 78 | return null |
| 79 | }, |
| 80 | async call({ subject, description, activeForm, metadata }, context) { |
| 81 | const taskId = await createTask(getTaskListId(), { |
| 82 | subject, |
| 83 | description, |
| 84 | activeForm, |
| 85 | status: 'pending', |
| 86 | owner: undefined, |
| 87 | blocks: [], |
| 88 | blockedBy: [], |
| 89 | metadata, |
| 90 | }) |
| 91 | |
| 92 | const blockingErrors: string[] = [] |
| 93 | const generator = executeTaskCreatedHooks( |
| 94 | taskId, |
| 95 | subject, |
| 96 | description, |
| 97 | getAgentName(), |
| 98 | getTeamName(), |
| 99 | undefined, |
| 100 | context?.abortController?.signal, |
| 101 | undefined, |
| 102 | context, |
| 103 | ) |
| 104 | for await (const result of generator) { |
| 105 | if (result.blockingError) { |
| 106 | blockingErrors.push(getTaskCreatedHookMessage(result.blockingError)) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | if (blockingErrors.length > 0) { |
| 111 | await deleteTask(getTaskListId(), taskId) |
| 112 | throw new Error(blockingErrors.join('\n')) |
| 113 | } |
| 114 | |
| 115 | // Auto-expand task list when creating tasks |
| 116 | context.setAppState(prev => { |
| 117 | if (prev.expandedView === 'tasks') return prev |
| 118 | return { ...prev, expandedView: 'tasks' as const } |
| 119 | }) |
| 120 | |
| 121 | return { |
| 122 | data: { |
| 123 | task: { |
| 124 | id: taskId, |
| 125 | subject, |
| 126 | }, |
| 127 | }, |
| 128 | } |
| 129 | }, |
| 130 | mapToolResultToToolResultBlockParam(content, toolUseID) { |
| 131 | const { task } = content as Output |
| 132 | return { |
nothing calls this directly
no test coverage detected