* Apply a live result to a parent Bash card, announcing a running → settled * transition exactly once. Shared by both poll paths (folded at tool_start and * the tool_result fold) so a settle observed through the model's polling * notifies the same way as the event-driven update.
(
state: MakaPiTranscriptState,
parent: MakaPiToolEntry,
result: Extract<ToolResultContent, { kind: 'shell_run' }>,
)
| 1607 | * notifies the same way as the event-driven update. |
| 1608 | */ |
| 1609 | function applyLiveShellRunResultToParent( |
| 1610 | state: MakaPiTranscriptState, |
| 1611 | parent: MakaPiToolEntry, |
| 1612 | result: Extract<ToolResultContent, { kind: 'shell_run' }>, |
| 1613 | ): void { |
| 1614 | const wasLive = isLiveShellRunCard(parent); |
| 1615 | applyShellRunResult(parent, result); |
| 1616 | if (wasLive && isSettledShellRunCard(parent)) pushShellRunSettledNotice(state, parent); |
| 1617 | } |
| 1618 | |
| 1619 | function isSettledShellRunCard(entry: MakaPiToolEntry): boolean { |
| 1620 | return entry.result?.kind === 'shell_run' && !isActiveShellRunStatus(entry.result.status); |
no test coverage detected