( toolUseContext: ToolUseContext, )
| 1083 | } |
| 1084 | |
| 1085 | export function getAgentPendingMessageAttachments( |
| 1086 | toolUseContext: ToolUseContext, |
| 1087 | ): Attachment[] { |
| 1088 | const agentId = toolUseContext.agentId |
| 1089 | if (!agentId) return [] |
| 1090 | const drained = drainPendingMessages( |
| 1091 | agentId, |
| 1092 | toolUseContext.getAppState, |
| 1093 | toolUseContext.setAppStateForTasks ?? toolUseContext.setAppState, |
| 1094 | ) |
| 1095 | return drained.map(msg => ({ |
| 1096 | type: 'queued_command' as const, |
| 1097 | prompt: msg, |
| 1098 | origin: { kind: 'coordinator' as const }, |
| 1099 | isMeta: true, |
| 1100 | })) |
| 1101 | } |
| 1102 | |
| 1103 | async function buildImageContentBlocks( |
| 1104 | pastedContents: Record<number, PastedContent> | undefined, |
no test coverage detected