(template: string, row: Record<string, unknown>)
| 7 | import type { ToolDefinition, ToolExecutionContext, ToolResult, SqlToolDef } from '../types' |
| 8 | |
| 9 | function formatRow(template: string, row: Record<string, unknown>): string { |
| 10 | return template.replace(/\{(\w+)\}/g, (_, col) => { |
| 11 | const val = row[col] |
| 12 | return val !== null && val !== undefined ? String(val) : '' |
| 13 | }) |
| 14 | } |
| 15 | |
| 16 | function resolveTemplate( |
| 17 | toolName: string, |
no outgoing calls
no test coverage detected