(name: string, args?: Record<string, unknown>)
| 255 | const globals = replContext.vmContext as Record<string, unknown> |
| 256 | |
| 257 | const callTool = async (name: string, args?: Record<string, unknown>) => { |
| 258 | if (typeof name !== 'string' || name.trim() === '') { |
| 259 | throw new Error('callTool(name, args) requires a non-empty tool name') |
| 260 | } |
| 261 | const tool = replContext.registeredTools.get(name) |
| 262 | if (!tool) { |
| 263 | throw new Error(`Unknown JavaScript REPL tool: ${name}`) |
| 264 | } |
| 265 | return tool.handler(ensureRecord(args)) |
| 266 | } |
| 267 | |
| 268 | const listTools = () => |
| 269 | [...replContext.registeredTools.values()].map(tool => ({ |
nothing calls this directly
no test coverage detected