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

Function findShellRunParent

packages/cli/src/pi-transcript.ts:1568–1583  ·  view source on GitHub ↗
(
  state: MakaPiTranscriptState,
  ref: string,
  childToolUseId: string,
)

Source from the content-addressed store, hash-verified

1566}
1567
1568function findShellRunParent(
1569 state: MakaPiTranscriptState,
1570 ref: string,
1571 childToolUseId: string,
1572): MakaPiToolEntry | undefined {
1573 return [...state.entries]
1574 .reverse()
1575 .find(
1576 (entry): entry is MakaPiToolEntry =>
1577 entry.kind === 'tool' &&
1578 entry.toolName === 'Bash' &&
1579 entry.toolUseId !== childToolUseId &&
1580 entry.result?.kind === 'shell_run' &&
1581 entry.result.ref === ref,
1582 );
1583}
1584
1585/** The runtime-resource ref a tool call is aimed at, when the args carry one. */
1586function readArgsRef(args: unknown): string | undefined {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected