MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / uninstallTargets

Function uninstallTargets

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

Source from the content-addressed store, hash-verified

350 * across every target unconditionally.
351 */
352export function uninstallTargets(
353 targets: readonly AgentTarget[],
354 location: Location,
355): UninstallReport[] {
356 return targets.map((target) => {
357 if (!target.supportsLocation(location)) {
358 const only: Location = location === 'local' ? 'global' : 'local';
359 return {
360 id: target.id,
361 displayName: target.displayName,
362 status: 'unsupported' as const,
363 removedPaths: [],
364 notes: [`no ${location} config — this agent is ${only}-only`],
365 };
366 }
367 const result = target.uninstall(location);
368 const removedPaths = result.files
369 .filter((f) => f.action === 'removed')
370 .map((f) => f.path);
371 return {
372 id: target.id,
373 displayName: target.displayName,
374 status: removedPaths.length > 0 ? ('removed' as const) : ('not-configured' as const),
375 removedPaths,
376 notes: result.notes ?? [],
377 };
378 });
379}
380
381export type RefreshStatus = 'refreshed' | 'unchanged' | 'not-configured' | 'unsupported';
382

Callers 2

runUninstallerFunction · 0.85

Calls 2

supportsLocationMethod · 0.65
uninstallMethod · 0.65

Tested by

no test coverage detected