MCPcopy Create free account
hub / github.com/apache/maka / applyLiveShellRunResultToParent

Function applyLiveShellRunResultToParent

packages/cli/src/pi-transcript.ts:1609–1617  ·  view source on GitHub ↗

* 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' }>,
)

Source from the content-addressed store, hash-verified

1607 * notifies the same way as the event-driven update.
1608 */
1609function 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
1619function isSettledShellRunCard(entry: MakaPiToolEntry): boolean {
1620 return entry.result?.kind === 'shell_run' && !isActiveShellRunStatus(entry.result.status);

Callers 1

Calls 4

isLiveShellRunCardFunction · 0.85
applyShellRunResultFunction · 0.85
isSettledShellRunCardFunction · 0.85

Tested by

no test coverage detected