MCPcopy
hub / github.com/colbymchenry/codegraph / uninstallTargets

Function uninstallTargets

src/installer/index.ts:331–358  ·  view source on GitHub ↗
(
  targets: readonly AgentTarget[],
  location: Location,
)

Source from the content-addressed store, hash-verified

329 * across every target unconditionally.
330 */
331export function uninstallTargets(
332 targets: readonly AgentTarget[],
333 location: Location,
334): UninstallReport[] {
335 return targets.map((target) => {
336 if (!target.supportsLocation(location)) {
337 const only: Location = location === 'local' ? 'global' : 'local';
338 return {
339 id: target.id,
340 displayName: target.displayName,
341 status: 'unsupported' as const,
342 removedPaths: [],
343 notes: [`no ${location} config — this agent is ${only}-only`],
344 };
345 }
346 const result = target.uninstall(location);
347 const removedPaths = result.files
348 .filter((f) => f.action === 'removed')
349 .map((f) => f.path);
350 return {
351 id: target.id,
352 displayName: target.displayName,
353 status: removedPaths.length > 0 ? ('removed' as const) : ('not-configured' as const),
354 removedPaths,
355 notes: result.notes ?? [],
356 };
357 });
358}
359
360/**
361 * Interactive uninstaller — the inverse of `runInstallerWithOptions`.

Callers 2

runUninstallerFunction · 0.85

Calls 2

supportsLocationMethod · 0.65
uninstallMethod · 0.65

Tested by

no test coverage detected