MCPcopy Create free account
hub / github.com/WJX20/claude-code / getUnifiedTaskAttachments

Function getUnifiedTaskAttachments

src/utils/attachments.ts:3440–3463  ·  view source on GitHub ↗

* Get attachments for all unified tasks using the Task framework. * Replaces the old getBackgroundShellAttachments, getBackgroundRemoteSessionAttachments, * and getAsyncAgentAttachments functions.

(
  toolUseContext: ToolUseContext,
)

Source from the content-addressed store, hash-verified

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

Callers 1

getAttachmentsFunction · 0.85

Calls 3

generateTaskAttachmentsFunction · 0.85
getTaskOutputPathFunction · 0.85

Tested by

no test coverage detected