| 2138 | } |
| 2139 | |
| 2140 | function withRequiredProjectPath(defs: ToolDefinition[]): ToolDefinition[] { |
| 2141 | return defs.map((tool) => { |
| 2142 | if (!tool.inputSchema.properties.projectPath) return tool; |
| 2143 | const required = tool.inputSchema.required ?? []; |
| 2144 | if (required.includes('projectPath')) return tool; |
| 2145 | return { |
| 2146 | ...tool, |
| 2147 | inputSchema: { ...tool.inputSchema, required: [...required, 'projectPath'] }, |
| 2148 | }; |
| 2149 | }); |
| 2150 | } |
| 2151 | |
| 2152 | /** |
| 2153 | * Allowlist-filtered tool definitions WITHOUT an engine — the static surface the |