( infra: InfraSignals, prompt: string, allNames: string[], )
| 118 | * if EITHER its infrastructure exists OR the prompt mentions it. |
| 119 | */ |
| 120 | export function deriveAutoDisabledTools( |
| 121 | infra: InfraSignals, |
| 122 | prompt: string, |
| 123 | allNames: string[], |
| 124 | ): string[] { |
| 125 | const out = new Set<string>(); |
| 126 | for (const g of GROUPS) { |
| 127 | if (g.keepIfInfra(infra)) continue; |
| 128 | if (g.keepIfPrompt.test(prompt)) continue; |
| 129 | for (const n of allNames) if (g.members(n)) out.add(n); |
| 130 | } |
| 131 | return [...out].sort(); |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Session ratchet: given the previously auto-disabled set and a NEW prompt, |
no test coverage detected