MCPcopy Index your code
hub / github.com/anomalyco/opencode / claimShell

Function claimShell

packages/opencode/src/cli/cmd/run/session-data.ts:641–657  ·  view source on GitHub ↗
(data: SessionData, callID: string, source: ShellCall["source"], command?: string)

Source from the content-addressed store, hash-verified

639}
640
641function claimShell(data: SessionData, callID: string, source: ShellCall["source"], command?: string): ShellCall {
642 const current = data.shell.get(callID)
643 if (current) {
644 if (command && !current.command) {
645 current.command = command
646 }
647
648 return current
649 }
650
651 const next = {
652 source,
653 ...(command ? { command } : {}),
654 } satisfies ShellCall
655 data.shell.set(callID, next)
656 return next
657}
658
659function bashCommand(part: ToolPart): string | undefined {
660 if (part.tool !== "bash") {

Callers 1

reduceSessionDataFunction · 0.85

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected