( agentIds: string[], )
| 4521 | * Load subagent transcripts for the given agent IDs |
| 4522 | */ |
| 4523 | export async function loadSubagentTranscripts( |
| 4524 | agentIds: string[], |
| 4525 | ): Promise<{ [agentId: string]: Message[] }> { |
| 4526 | const results = await Promise.all( |
| 4527 | agentIds.map(async agentId => { |
| 4528 | try { |
| 4529 | const result = await getAgentTranscript(asAgentId(agentId)) |
| 4530 | if (result && result.messages.length > 0) { |
| 4531 | return { agentId, transcript: result.messages } |
| 4532 | } |
| 4533 | return null |
| 4534 | } catch { |
| 4535 | // Skip if transcript can't be loaded |
| 4536 | return null |
| 4537 | } |
| 4538 | }), |
| 4539 | ) |
| 4540 | |
| 4541 | const transcripts: { [agentId: string]: Message[] } = {} |
| 4542 | for (const result of results) { |
| 4543 | if (result) { |
| 4544 | transcripts[result.agentId] = result.transcript |
| 4545 | } |
| 4546 | } |
| 4547 | return transcripts |
| 4548 | } |
| 4549 | |
| 4550 | // Globs the session's subagents dir directly — unlike AppState.tasks, this survives task eviction. |
| 4551 | export async function loadAllSubagentTranscriptsFromDisk(): Promise<{ |
no test coverage detected