(
entry: MakaPiToolEntry,
result: Extract<ToolResultContent, { kind: 'shell_run' }>,
)
| 959 | } |
| 960 | |
| 961 | function applyShellRunResult( |
| 962 | entry: MakaPiToolEntry, |
| 963 | result: Extract<ToolResultContent, { kind: 'shell_run' }>, |
| 964 | ): boolean { |
| 965 | const current = entry.result?.kind === 'shell_run' ? entry.result : undefined; |
| 966 | const merged = mergeShellRunStateWithDiagnostics(current, result, 'cli.transcript'); |
| 967 | if (!merged.changed) return false; |
| 968 | entry.status = shellRunTranscriptStatus(merged.result.status); |
| 969 | entry.result = merged.result; |
| 970 | entry.output = formatToolResultContent(merged.result); |
| 971 | entry.durationMs = Math.max( |
| 972 | 0, |
| 973 | (merged.result.completedAt ?? merged.result.updatedAt) - merged.result.startedAt, |
| 974 | ); |
| 975 | entry.resultVersion += 1; |
| 976 | return true; |
| 977 | } |
| 978 | |
| 979 | function applyOwnShellRunResult( |
| 980 | entry: MakaPiToolEntry, |
no test coverage detected