MCPcopy
hub / github.com/upstash/context7 / resolveModes

Function resolveModes

packages/cli/src/commands/remove.ts:298–324  ·  view source on GitHub ↗
(
  options: UninstallOptions,
  agents: SetupAgent[],
  scope: Scope
)

Source from the content-addressed store, hash-verified

296}
297
298async function resolveModes(
299 options: UninstallOptions,
300 agents: SetupAgent[],
301 scope: Scope
302): Promise<UninstallMode[]> {
303 if (options.all || options.mcp || options.cli) {
304 return resolveFlagModes(options);
305 }
306
307 const detectedModes = await detectAvailableModes(agents, scope);
308 if (detectedModes.length <= 1) {
309 return detectedModes.length === 1 ? detectedModes : ["mcp", "cli"];
310 }
311
312 if (options.yes) {
313 return detectedModes;
314 }
315
316 log.blank();
317 const selected = await promptModes(detectedModes);
318 if (!selected) {
319 log.warn("Remove cancelled");
320 return [];
321 }
322
323 return selected;
324}
325
326async function uninstallMcp(agentName: SetupAgent, scope: Scope): Promise<CleanupStatus> {
327 const agent = getAgent(agentName);

Callers 1

removeCommandFunction · 0.85

Calls 3

resolveFlagModesFunction · 0.85
detectAvailableModesFunction · 0.85
promptModesFunction · 0.85

Tested by

no test coverage detected