* Get attachments for all unified tasks using the Task framework. * Replaces the old getBackgroundShellAttachments, getBackgroundRemoteSessionAttachments, * and getAsyncAgentAttachments functions.
( toolUseContext: ToolUseContext, )
| 3437 | * and getAsyncAgentAttachments functions. |
| 3438 | */ |
| 3439 | async function getUnifiedTaskAttachments( |
| 3440 | toolUseContext: ToolUseContext, |
| 3441 | ): Promise<Attachment[]> { |
| 3442 | const appState = toolUseContext.getAppState() |
| 3443 | const { attachments, updatedTaskOffsets, evictedTaskIds } = |
| 3444 | await generateTaskAttachments(appState) |
| 3445 | |
| 3446 | applyTaskOffsetsAndEvictions( |
| 3447 | toolUseContext.setAppState, |
| 3448 | updatedTaskOffsets, |
| 3449 | evictedTaskIds, |
| 3450 | ) |
| 3451 | |
| 3452 | // Convert TaskAttachment to Attachment format |
| 3453 | return attachments.map(taskAttachment => ({ |
| 3454 | type: 'task_status' as const, |
| 3455 | taskId: taskAttachment.taskId, |
| 3456 | taskType: taskAttachment.taskType, |
| 3457 | status: taskAttachment.status, |
| 3458 | description: taskAttachment.description, |
| 3459 | deltaSummary: taskAttachment.deltaSummary, |
| 3460 | outputFilePath: getTaskOutputPath(taskAttachment.taskId), |
| 3461 | })) |
| 3462 | } |
| 3463 | |
| 3464 | async function getAsyncHookResponseAttachments(): Promise<Attachment[]> { |
| 3465 | const responses = await checkForAsyncHookResponses() |
no test coverage detected