( agentIds: string[], )
| 4341 | * Load subagent transcripts for the given agent IDs |
| 4342 | */ |
| 4343 | export async function loadSubagentTranscripts( |
| 4344 | agentIds: string[], |
| 4345 | ): Promise<{ [agentId: string]: Message[] }> { |
| 4346 | const results = await Promise.all( |
| 4347 | agentIds.map(async agentId => { |
| 4348 | try { |
| 4349 | const result = await getAgentTranscript(asAgentId(agentId)) |
| 4350 | if (result && result.messages.length > 0) { |
| 4351 | return { agentId, transcript: result.messages } |
| 4352 | } |
| 4353 | return null |
| 4354 | } catch { |
| 4355 | // Skip if transcript can't be loaded |
| 4356 | return null |
| 4357 | } |
| 4358 | }), |
| 4359 | ) |
| 4360 | |
| 4361 | const transcripts: { [agentId: string]: Message[] } = {} |
| 4362 | for (const result of results) { |
| 4363 | if (result) { |
| 4364 | transcripts[result.agentId] = result.transcript |
| 4365 | } |
| 4366 | } |
| 4367 | return transcripts |
| 4368 | } |
| 4369 | |
| 4370 | // Globs the session's subagents dir directly — unlike AppState.tasks, this survives task eviction. |
| 4371 | export async function loadAllSubagentTranscriptsFromDisk(): Promise<{ |
no test coverage detected