( agentIds: string[], )
| 4295 | * Load subagent transcripts for the given agent IDs |
| 4296 | */ |
| 4297 | export async function loadSubagentTranscripts( |
| 4298 | agentIds: string[], |
| 4299 | ): Promise<{ [agentId: string]: Message[] }> { |
| 4300 | const results = await Promise.all( |
| 4301 | agentIds.map(async agentId => { |
| 4302 | try { |
| 4303 | const result = await getAgentTranscript(asAgentId(agentId)) |
| 4304 | if (result && result.messages.length > 0) { |
| 4305 | return { agentId, transcript: result.messages } |
| 4306 | } |
| 4307 | return null |
| 4308 | } catch { |
| 4309 | // Skip if transcript can't be loaded |
| 4310 | return null |
| 4311 | } |
| 4312 | }), |
| 4313 | ) |
| 4314 | |
| 4315 | const transcripts: { [agentId: string]: Message[] } = {} |
| 4316 | for (const result of results) { |
| 4317 | if (result) { |
| 4318 | transcripts[result.agentId] = result.transcript |
| 4319 | } |
| 4320 | } |
| 4321 | return transcripts |
| 4322 | } |
| 4323 | |
| 4324 | // Globs the session's subagents dir directly — unlike AppState.tasks, this survives task eviction. |
| 4325 | export async function loadAllSubagentTranscriptsFromDisk(): Promise<{ |
no test coverage detected