(kind: "builtin" | "mcp" | "custom", name: string)
| 18 | const VALID_TOOL_NAME = /^[a-zA-Z0-9_-]+$/; |
| 19 | |
| 20 | function validateName(kind: "builtin" | "mcp" | "custom", name: string): void { |
| 21 | if (name === "*") { |
| 22 | return; |
| 23 | } |
| 24 | if (!VALID_TOOL_NAME.test(name)) { |
| 25 | throw new Error( |
| 26 | `Invalid ${kind} tool name '${name}': tool names must match /^[a-zA-Z0-9_-]+$/ ` + |
| 27 | `or be the wildcard '*'.` |
| 28 | ); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Builder that produces a list of source-qualified tool filter strings for |
no outgoing calls
no test coverage detected
searching dependent graphs…