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

Function refreshTargets

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

Source from the content-addressed store, hash-verified

415 * `uninstallTargets`.
416 */
417export function refreshTargets(
418 targets: readonly AgentTarget[],
419 location: Location,
420): RefreshReport[] {
421 return targets.map((target) => {
422 const base = { id: target.id, displayName: target.displayName, location };
423 if (!target.supportsLocation(location)) {
424 return { ...base, status: 'unsupported' as const, changedPaths: [] };
425 }
426 if (!target.detect(location).alreadyConfigured) {
427 return { ...base, status: 'not-configured' as const, changedPaths: [] };
428 }
429 const result = target.install(location, { autoAllow: false, promptHook: undefined });
430 const changedPaths = result.files
431 .filter((f) => f.action === 'created' || f.action === 'updated' || f.action === 'removed')
432 .map((f) => f.path);
433 return {
434 ...base,
435 status: changedPaths.length > 0 ? ('refreshed' as const) : ('unchanged' as const),
436 changedPaths,
437 };
438 });
439}
440
441/**
442 * Interactive uninstaller — the inverse of `runInstallerWithOptions`.

Callers 2

mainFunction · 0.85

Calls 3

supportsLocationMethod · 0.65
detectMethod · 0.65
installMethod · 0.65

Tested by

no test coverage detected