(agents: SetupAgent[], scope: Scope)
| 250 | } |
| 251 | |
| 252 | async function detectAvailableModes(agents: SetupAgent[], scope: Scope): Promise<UninstallMode[]> { |
| 253 | let hasMcpArtifacts = false; |
| 254 | let hasCliArtifacts = false; |
| 255 | let hasRuleArtifacts = false; |
| 256 | |
| 257 | for (const agent of agents) { |
| 258 | hasMcpArtifacts = |
| 259 | hasMcpArtifacts || |
| 260 | (await hasMcpConfig(agent, scope)) || |
| 261 | (await hasSkill(agent, scope, MODE_SKILLS.mcp[0])); |
| 262 | hasCliArtifacts = hasCliArtifacts || (await hasSkill(agent, scope, MODE_SKILLS.cli[0])); |
| 263 | hasRuleArtifacts = hasRuleArtifacts || (await hasRule(agent, scope)); |
| 264 | } |
| 265 | |
| 266 | const modes: UninstallMode[] = []; |
| 267 | if (hasMcpArtifacts) modes.push("mcp"); |
| 268 | if (hasCliArtifacts) modes.push("cli"); |
| 269 | |
| 270 | if (modes.length === 0 && hasRuleArtifacts) { |
| 271 | return ["mcp", "cli"]; |
| 272 | } |
| 273 | |
| 274 | return modes; |
| 275 | } |
| 276 | |
| 277 | async function hasAnyContext7Artifacts(agent: SetupAgent, scope: Scope): Promise<boolean> { |
| 278 | return ( |
no test coverage detected