MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / InstalledAppsFor

Function InstalledAppsFor

internal/metadata/refresh.go:551–571  ·  view source on GitHub ↗

InstalledAppsFor returns the code agent IDs where the item is installed on disk. An item is considered installed to an app when a directory named after the item exists under that app's install path for its kind.

(item Item)

Source from the content-addressed store, hash-verified

549// An item is considered installed to an app when a directory named after the item
550// exists under that app's install path for its kind.
551func InstalledAppsFor(item Item) []string {
552 kind := entities.Kind(item.Kind)
553 apps := entities.AppPathsFor(kind)
554 if apps == nil {
555 return nil
556 }
557 name := installDirName(item)
558 if name == "" {
559 return nil
560 }
561 var installed []string
562 for app, dest := range apps {
563 // Expand ~ before joining so the home prefix survives on Windows
564 // (filepath.Join would otherwise flip ~/ to ~\ and break Expand).
565 resolved := filepath.Join(pathutil.Expand(dest), name)
566 if info, err := os.Stat(resolved); err == nil && info.IsDir() {
567 installed = append(installed, app)
568 }
569 }
570 return installed
571}
572
573// installDirName is the on-disk directory name used when the item is installed.
574// It prefers the item Name (matching entities.InstallToApp) and falls back to the

Callers 2

DetailMethod · 0.85
SearchPagedMethod · 0.85

Calls 4

KindTypeAlias · 0.92
AppPathsForFunction · 0.92
ExpandFunction · 0.92
installDirNameFunction · 0.85

Tested by

no test coverage detected