( taskId: string, taskSubject: string, taskDescription?: string, teammateName?: string, teamName?: string, permissionMode?: string, signal?: AbortSignal, timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS, toolUseContext?: ToolUseContext, )
| 3747 | * @returns Async generator that yields progress messages and blocking errors |
| 3748 | */ |
| 3749 | export async function* executeTaskCreatedHooks( |
| 3750 | taskId: string, |
| 3751 | taskSubject: string, |
| 3752 | taskDescription?: string, |
| 3753 | teammateName?: string, |
| 3754 | teamName?: string, |
| 3755 | permissionMode?: string, |
| 3756 | signal?: AbortSignal, |
| 3757 | timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS, |
| 3758 | toolUseContext?: ToolUseContext, |
| 3759 | ): AsyncGenerator<AggregatedHookResult> { |
| 3760 | const hookInput: TaskCreatedHookInput = { |
| 3761 | ...createBaseHookInput(permissionMode), |
| 3762 | hook_event_name: 'TaskCreated', |
| 3763 | task_id: taskId, |
| 3764 | task_subject: taskSubject, |
| 3765 | task_description: taskDescription, |
| 3766 | teammate_name: teammateName, |
| 3767 | team_name: teamName, |
| 3768 | } |
| 3769 | |
| 3770 | yield* executeHooks({ |
| 3771 | hookInput, |
| 3772 | toolUseID: randomUUID(), |
| 3773 | signal, |
| 3774 | timeoutMs, |
| 3775 | toolUseContext, |
| 3776 | }) |
| 3777 | } |
| 3778 | |
| 3779 | /** |
| 3780 | * Execute TaskCompleted hooks when a task is being marked as completed. |
no test coverage detected