(agentId: AgentId)
| 284 | } |
| 285 | |
| 286 | async function resolveAgentTranscriptPath(agentId: AgentId): Promise<string> { |
| 287 | const directPath = getAgentTranscriptPath(agentId) |
| 288 | try { |
| 289 | await stat(directPath) |
| 290 | return directPath |
| 291 | } catch (e) { |
| 292 | if (!isFsInaccessible(e)) throw e |
| 293 | } |
| 294 | |
| 295 | const projectDir = getSessionProjectDir() ?? getProjectDir(getOriginalCwd()) |
| 296 | const subagentsDir = join(projectDir, getSessionId(), 'subagents') |
| 297 | return ( |
| 298 | (await findNestedAgentFilePath(subagentsDir, `agent-${agentId}.jsonl`)) ?? |
| 299 | directPath |
| 300 | ) |
| 301 | } |
| 302 | |
| 303 | async function getAgentMetadataPath(agentId: AgentId): Promise<string> { |
| 304 | return (await resolveAgentTranscriptPath(agentId)).replace( |
no test coverage detected