(parts: ReadonlyArray<string>)
| 105 | }; |
| 106 | |
| 107 | export const buildToolPath = (parts: ReadonlyArray<string>): string => { |
| 108 | const segments = toToolPathSegments(parts); |
| 109 | if (segments.length === 0) { |
| 110 | throw new Error("Tool path must include at least one segment"); |
| 111 | } |
| 112 | if (segments.some((segment) => !TOOL_PATH_TOKEN.test(segment))) { |
| 113 | throw new Error("Tool path segments must contain only letters, numbers, '.', '_' or '-'"); |
| 114 | } |
| 115 | return segments.join("."); |
| 116 | }; |
| 117 | |
| 118 | const buildToolAccessExpression = (toolPath: string): string => { |
| 119 | const segments = toToolPathSegments([toolPath]); |
no test coverage detected