( tools: Array<CodeModeTool>, prefix: string = '', )
| 13 | * @param prefix - Optional prefix to add to binding names (e.g., 'external_') |
| 14 | */ |
| 15 | export function toolsToBindings( |
| 16 | tools: Array<CodeModeTool>, |
| 17 | prefix: string = '', |
| 18 | ): Record<string, ToolBinding> { |
| 19 | const bindings: Record<string, ToolBinding> = {} |
| 20 | |
| 21 | for (const tool of tools) { |
| 22 | const bindingName = `${prefix}${tool.name}` |
| 23 | bindings[bindingName] = toolToBinding(tool, prefix) |
| 24 | } |
| 25 | |
| 26 | return bindings |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Convert a single TanStack AI tool to a ToolBinding |
no test coverage detected