(path: readonly string[], args: unknown)
| 123 | * package depends on this one, never the reverse. |
| 124 | */ |
| 125 | export const formatToolCallCode = (path: readonly string[], args: unknown): string => { |
| 126 | for (const segment of path) { |
| 127 | if (!TOOL_PATH_SEGMENT.test(segment)) { |
| 128 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: unreachable by construction (every segment came from a parsed path or a stored binding); a defect here must not become a malformed emission |
| 129 | throw new Error("Invalid resolved tool path."); |
| 130 | } |
| 131 | } |
| 132 | return `return await tools${path.map(formatToolPathSegment).join("")}(${JSON.stringify(args ?? {})})`; |
| 133 | }; |
no outgoing calls
no test coverage detected