(ctx context.Context, args map[string]interface{})
| 278 | } |
| 279 | |
| 280 | func executeSandboxRuntimeRunShell(ctx context.Context, args map[string]interface{}) (*ToolResult, error) { |
| 281 | command, ok := args["command"].(string) |
| 282 | if !ok || strings.TrimSpace(command) == "" { |
| 283 | return nil, fmt.Errorf("missing command argument") |
| 284 | } |
| 285 | session, err := runtimeSessionForContext(ctx) |
| 286 | if err != nil { |
| 287 | return nil, err |
| 288 | } |
| 289 | timeout := 30 |
| 290 | if v, exists := args["timeout"]; exists { |
| 291 | timeout = parseIntValue(v, timeout) |
| 292 | } |
| 293 | cwd := resolveSandboxCWD(ctx, args) |
| 294 | if strings.TrimSpace(cwd) == "" { |
| 295 | cwd = config.SandboxRuntimeContainerWorkdir |
| 296 | } |
| 297 | result, err := getSandboxRuntimeResult(ctx, session, sandboxruntime.CommandRequest{ |
| 298 | Command: command, |
| 299 | Cwd: cwd, |
| 300 | Env: resolveSandboxEnvVars(ctx, args), |
| 301 | TimeoutSeconds: timeout, |
| 302 | }) |
| 303 | if err != nil { |
| 304 | return nil, err |
| 305 | } |
| 306 | return result, nil |
| 307 | } |
| 308 | |
| 309 | func executeSandboxRuntimeReadFile(ctx context.Context, args map[string]interface{}) (*ToolResult, error) { |
| 310 | path, ok := args["path"].(string) |
no test coverage detected