(toolName: string, input: ToolInput, cwd?: string)
| 270 | // Enrich shell rawInput with the resolved working directory so clients can show |
| 271 | // where the command runs, unless the model already specified one. |
| 272 | function 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 | |
| 279 | function shellWorkdir(input: ToolInput, cwd?: string) { |
| 280 | const explicit = stringValue(input.workdir) ?? stringValue(input.cwd) |
no test coverage detected