MCPcopy Create free account
hub / github.com/anomalyco/opencode / rawInput

Function rawInput

packages/opencode/src/acp/tool.ts:272–277  ·  view source on GitHub ↗
(toolName: string, input: ToolInput, cwd?: string)

Source from the content-addressed store, hash-verified

270// Enrich shell rawInput with the resolved working directory so clients can show
271// where the command runs, unless the model already specified one.
272function rawInput(toolName: string, input: ToolInput, cwd?: string): ToolInput {
273 if (!isShell(toolName)) return input
274 if (input.cwd || input.workdir) return input
275 const workdir = shellWorkdir(input, cwd)
276 return workdir ? { ...input, cwd: workdir } : input
277}
278
279function shellWorkdir(input: ToolInput, cwd?: string) {
280 const explicit = stringValue(input.workdir) ?? stringValue(input.cwd)

Callers 4

pendingToolCallFunction · 0.85
runningToolUpdateFunction · 0.85
errorToolUpdateFunction · 0.85

Calls 2

isShellFunction · 0.85
shellWorkdirFunction · 0.85

Tested by

no test coverage detected