| 458 | } |
| 459 | |
| 460 | private checkToolConflicts( |
| 461 | activeToolName: string, |
| 462 | tools: Record<string, boolean>, |
| 463 | ) { |
| 464 | if (tools[activeToolName]) { |
| 465 | // Collect names of other enabled tools excluding the active tool itself |
| 466 | const conflicts = Object.entries(tools) |
| 467 | .filter(([name, enabled]) => name !== activeToolName && enabled) |
| 468 | .map(([name]) => name); |
| 469 | |
| 470 | if (conflicts.length) { |
| 471 | throw new Error( |
| 472 | `${activeToolName} cannot be used together with other tools, found the following incompatible tools enabled: ${conflicts.join( |
| 473 | ", ", |
| 474 | )}`, |
| 475 | ); |
| 476 | } |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | /** |
| 481 | * Adds default gitignore options for a Python project based on |