(prevDisabled: string[], prompt: string)
| 137 | * are never added mid-session — the tool list only grows. Pure. |
| 138 | */ |
| 139 | export function ratchetAutoDisabled(prevDisabled: string[], prompt: string): string[] { |
| 140 | if (prevDisabled.length === 0) return prevDisabled; |
| 141 | const keep = new Set(prevDisabled); |
| 142 | for (const g of GROUPS) { |
| 143 | if (!g.keepIfPrompt.test(prompt)) continue; |
| 144 | for (const n of [...keep]) if (g.members(n)) keep.delete(n); |
| 145 | } |
| 146 | return [...keep].sort(); |
| 147 | } |
no test coverage detected