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

Function applyShellRunResult

packages/cli/src/pi-transcript.ts:961–977  ·  view source on GitHub ↗
(
  entry: MakaPiToolEntry,
  result: Extract<ToolResultContent, { kind: 'shell_run' }>,
)

Source from the content-addressed store, hash-verified

959}
960
961function 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
979function applyOwnShellRunResult(
980 entry: MakaPiToolEntry,

Calls 3

shellRunTranscriptStatusFunction · 0.85
formatToolResultContentFunction · 0.85

Tested by

no test coverage detected