MCPcopy Create free account
hub / github.com/Noumena-Network/code / getUnifiedTaskAttachments

Function getUnifiedTaskAttachments

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

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

Callers 1

getAttachmentsFunction · 0.85

Calls 3

generateTaskAttachmentsFunction · 0.85
getTaskOutputPathFunction · 0.50

Tested by

no test coverage detected