( state: MakaPiTranscriptState, ref: string, childToolUseId: string, )
| 1566 | } |
| 1567 | |
| 1568 | function findShellRunParent( |
| 1569 | state: MakaPiTranscriptState, |
| 1570 | ref: string, |
| 1571 | childToolUseId: string, |
| 1572 | ): MakaPiToolEntry | undefined { |
| 1573 | return [...state.entries] |
| 1574 | .reverse() |
| 1575 | .find( |
| 1576 | (entry): entry is MakaPiToolEntry => |
| 1577 | entry.kind === 'tool' && |
| 1578 | entry.toolName === 'Bash' && |
| 1579 | entry.toolUseId !== childToolUseId && |
| 1580 | entry.result?.kind === 'shell_run' && |
| 1581 | entry.result.ref === ref, |
| 1582 | ); |
| 1583 | } |
| 1584 | |
| 1585 | /** The runtime-resource ref a tool call is aimed at, when the args carry one. */ |
| 1586 | function readArgsRef(args: unknown): string | undefined { |
no outgoing calls
no test coverage detected