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

Function applyOwnShellRunResult

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

Source from the content-addressed store, hash-verified

977}
978
979function applyOwnShellRunResult(
980 entry: MakaPiToolEntry,
981 result: Extract<ToolResultContent, { kind: 'shell_run' }>,
982 operationDurationMs = entry.durationMs,
983): void {
984 entry.status =
985 entry.toolName === 'WriteStdin'
986 ? result.operation?.kind === 'pty_control' && result.operation.failed
987 ? 'error'
988 : 'done'
989 : shellRunTranscriptStatus(result.status);
990 entry.result = result;
991 entry.output = formatToolResultContent(result);
992 if (entry.toolName === 'WriteStdin') {
993 entry.durationMs = operationDurationMs;
994 } else {
995 entry.durationMs = Math.max(0, (result.completedAt ?? result.updatedAt) - result.startedAt);
996 }
997 entry.resultVersion += 1;
998}
999
1000function systemNoteToTranscriptEntry(
1001 message: SystemNoteMessage,

Calls 2

shellRunTranscriptStatusFunction · 0.85
formatToolResultContentFunction · 0.85

Tested by

no test coverage detected