MCPcopy
hub / github.com/codeaashu/claude-code / getUnifiedTaskAttachments

Function getUnifiedTaskAttachments

src/utils/attachments.ts:3439–3462  ·  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

3437 * and getAsyncAgentAttachments functions.
3438 */
3439async 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
3464async function getAsyncHookResponseAttachments(): Promise<Attachment[]> {
3465 const responses = await checkForAsyncHookResponses()

Callers 1

getAttachmentsFunction · 0.85

Calls 3

generateTaskAttachmentsFunction · 0.85
getTaskOutputPathFunction · 0.85

Tested by

no test coverage detected