(data: ReplToolCallProgress)
| 357 | } |
| 358 | |
| 359 | function renderProgressHint(data: ReplToolCallProgress): string { |
| 360 | if (data.phase !== 'start') { |
| 361 | return 'Running JavaScript REPL script...' |
| 362 | } |
| 363 | const input = data.toolInput |
| 364 | const hintRaw = |
| 365 | typeof input.command === 'string' |
| 366 | ? input.command |
| 367 | : typeof input.file_path === 'string' |
| 368 | ? input.file_path |
| 369 | : typeof input.path === 'string' |
| 370 | ? input.path |
| 371 | : typeof input.pattern === 'string' |
| 372 | ? input.pattern |
| 373 | : undefined |
| 374 | if (!hintRaw) { |
| 375 | return `Running ${data.toolName}...` |
| 376 | } |
| 377 | return `Running ${data.toolName}: ${preview(hintRaw, 200)}` |
| 378 | } |
| 379 | |
| 380 | export function createJavascriptReplTool( |
| 381 | config: JavascriptReplToolConfig, |
no test coverage detected