claudeup 4.18.0 → 4.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/bin/claudeup.js +43 -19
  2. package/package.json +14 -19
  3. package/scripts/build-binaries.ts +77 -0
  4. package/scripts/check-optional-deps.ts +49 -0
  5. package/scripts/test-isolated.ts +43 -0
  6. package/src/__tests__/alias-adopt.test.ts +364 -0
  7. package/src/__tests__/alias-parser.test.ts +92 -0
  8. package/src/__tests__/alias-shell-writer.test.ts +7 -0
  9. package/src/__tests__/alias-store.test.ts +77 -0
  10. package/src/__tests__/cli-router.test.ts +65 -0
  11. package/src/__tests__/conventions-integration.test.ts +745 -0
  12. package/src/__tests__/conventions-manager.test.ts +1172 -0
  13. package/src/__tests__/doctor-bins.test.ts +35 -0
  14. package/src/__tests__/doctor.test.ts +450 -0
  15. package/src/__tests__/dual-write-prevention.test.ts +14 -4
  16. package/src/__tests__/file-locking.test.ts +208 -0
  17. package/src/__tests__/gitignore-prerun.test.ts +1 -0
  18. package/src/__tests__/install-command.test.ts +81 -0
  19. package/src/__tests__/install-plan.test.ts +98 -0
  20. package/src/__tests__/manifest.test.ts +136 -0
  21. package/src/__tests__/marketplace-refresh.test.ts +267 -0
  22. package/src/__tests__/plugin-requires.test.ts +133 -0
  23. package/src/__tests__/plugin-setup.test.ts +118 -0
  24. package/src/__tests__/profile-command.test.ts +116 -0
  25. package/src/__tests__/profile-materializer.test.ts +82 -0
  26. package/src/__tests__/profile-sync.test.ts +136 -0
  27. package/src/__tests__/registry-version-resolution.test.ts +74 -0
  28. package/src/__tests__/resolve-executable.test.ts +42 -0
  29. package/src/__tests__/resolver.test.ts +218 -0
  30. package/src/__tests__/symlink-manager.test.ts +99 -0
  31. package/src/__tests__/toolchain.test.ts +56 -0
  32. package/src/cli/claude.ts +21 -0
  33. package/src/cli/doctor.ts +132 -0
  34. package/src/cli/install.ts +360 -0
  35. package/src/cli/profile.ts +166 -0
  36. package/src/cli/router.ts +107 -0
  37. package/src/cli/update.ts +85 -0
  38. package/src/data/alias-flags.ts +11 -1
  39. package/src/data/cli-tools.ts +7 -7
  40. package/src/data/gitignore-defaults.ts +4 -0
  41. package/src/data/marketplaces.ts +12 -0
  42. package/src/data/predefined-profiles.ts +3 -4
  43. package/src/main.tsx +11 -154
  44. package/src/prerunner/index.ts +62 -27
  45. package/src/services/alias-shell-writer.ts +382 -8
  46. package/src/services/alias-store.ts +60 -0
  47. package/src/services/claude-cli.ts +19 -22
  48. package/src/services/claude-settings.ts +99 -26
  49. package/src/services/conventions-manager.ts +865 -0
  50. package/src/services/doctor-bins.ts +49 -0
  51. package/src/services/doctor.ts +509 -0
  52. package/src/services/install-plan.ts +107 -0
  53. package/src/services/manifest.ts +166 -0
  54. package/src/services/marketplace-refresh.ts +173 -0
  55. package/src/services/plugin-manager.ts +7 -1
  56. package/src/services/plugin-requires.ts +215 -0
  57. package/src/services/plugin-setup.ts +61 -4
  58. package/src/services/plugin-version-check.ts +9 -4
  59. package/src/services/profile-materializer.ts +61 -0
  60. package/src/services/profile-sync.ts +150 -0
  61. package/src/services/resolver.ts +293 -0
  62. package/src/services/symlink-manager.ts +146 -0
  63. package/src/services/toolchain.ts +97 -0
  64. package/src/services/version-check.ts +10 -11
  65. package/src/types/index.ts +138 -31
  66. package/src/ui/App.tsx +16 -11
  67. package/src/ui/components/FlagDetailEditor.tsx +0 -0
  68. package/src/ui/components/modals/ConfirmModal.tsx +1 -1
  69. package/src/ui/screens/AliasScreen.tsx +491 -359
  70. package/src/ui/screens/CliToolsScreen.tsx +11 -3
  71. package/src/ui/screens/PluginsScreen.tsx +3 -1
  72. package/src/ui/screens/index.ts +0 -1
  73. package/src/ui/state/reducer.ts +6 -102
  74. package/src/ui/state/types.ts +8 -35
  75. package/src/utils/command-utils.ts +23 -0
  76. package/src/utils/file-locking.ts +144 -0
  77. package/src/data/alias-flags.js +0 -196
  78. package/src/data/cli-tools.js +0 -123
  79. package/src/data/gitignore-defaults.js +0 -24
  80. package/src/data/gitignore-reasons.js +0 -97
  81. package/src/data/gitignore-templates.js +0 -21
  82. package/src/data/marketplaces.js +0 -138
  83. package/src/data/mcp-servers.js +0 -509
  84. package/src/data/predefined-profiles.js +0 -248
  85. package/src/data/settings-catalog.js +0 -625
  86. package/src/data/skill-repos.js +0 -160
  87. package/src/data/statuslines.js +0 -159
  88. package/src/data/statuslines.ts +0 -188
  89. package/src/index.js +0 -4
  90. package/src/index.ts +0 -5
  91. package/src/main.js +0 -170
  92. package/src/prerunner/index.js +0 -252
  93. package/src/services/alias-settings.js +0 -51
  94. package/src/services/alias-shell-writer.js +0 -764
  95. package/src/services/alias-store.js +0 -77
  96. package/src/services/claude-cli.js +0 -189
  97. package/src/services/claude-runner.js +0 -28
  98. package/src/services/claude-settings.js +0 -1223
  99. package/src/services/gitignore-detector.js +0 -155
  100. package/src/services/gitignore-fixer.js +0 -231
  101. package/src/services/gitignore-prerun.js +0 -46
  102. package/src/services/gitignore-resolver.js +0 -143
  103. package/src/services/gitignore-service.js +0 -117
  104. package/src/services/local-marketplace.js +0 -339
  105. package/src/services/marketplace-fetcher.js +0 -96
  106. package/src/services/marketplace-sync.js +0 -94
  107. package/src/services/mcp-registry.js +0 -87
  108. package/src/services/plugin-manager.js +0 -473
  109. package/src/services/plugin-mcp-config.js +0 -177
  110. package/src/services/plugin-setup.js +0 -444
  111. package/src/services/plugin-version-check.js +0 -262
  112. package/src/services/profiles.js +0 -161
  113. package/src/services/settings-manager.js +0 -243
  114. package/src/services/skills-manager.js +0 -393
  115. package/src/services/skillsmp-client.js +0 -87
  116. package/src/services/update-cache.js +0 -52
  117. package/src/services/version-check.js +0 -99
  118. package/src/types/gitignore.js +0 -6
  119. package/src/types/index.js +0 -1
  120. package/src/ui/App.js +0 -346
  121. package/src/ui/adapters/pluginsAdapter.js +0 -139
  122. package/src/ui/adapters/settingsAdapter.js +0 -111
  123. package/src/ui/adapters/skillsAdapter.js +0 -154
  124. package/src/ui/components/CategoryHeader.js +0 -9
  125. package/src/ui/components/EmptyFilterState.js +0 -4
  126. package/src/ui/components/ScopeIndicator.js +0 -30
  127. package/src/ui/components/ScrollableList.js +0 -36
  128. package/src/ui/components/SearchInput.js +0 -19
  129. package/src/ui/components/StyledText.js +0 -39
  130. package/src/ui/components/TabBar.js +0 -19
  131. package/src/ui/components/layout/FooterHints.js +0 -29
  132. package/src/ui/components/layout/Panel.js +0 -6
  133. package/src/ui/components/layout/ProgressBar.js +0 -14
  134. package/src/ui/components/layout/ScopeTabs.js +0 -6
  135. package/src/ui/components/layout/ScreenLayout.js +0 -16
  136. package/src/ui/components/layout/index.js +0 -5
  137. package/src/ui/components/modals/ConfirmModal.js +0 -14
  138. package/src/ui/components/modals/InputModal.js +0 -5
  139. package/src/ui/components/modals/LoadingModal.js +0 -17
  140. package/src/ui/components/modals/MessageModal.js +0 -16
  141. package/src/ui/components/modals/ModalContainer.js +0 -137
  142. package/src/ui/components/modals/SelectModal.js +0 -18
  143. package/src/ui/components/modals/VersionMismatchModal.js +0 -36
  144. package/src/ui/components/modals/index.js +0 -6
  145. package/src/ui/components/primitives/ActionHints.js +0 -13
  146. package/src/ui/components/primitives/DetailSection.js +0 -7
  147. package/src/ui/components/primitives/KeyValueLine.js +0 -8
  148. package/src/ui/components/primitives/ListCategoryRow.js +0 -8
  149. package/src/ui/components/primitives/MetaText.js +0 -8
  150. package/src/ui/components/primitives/ScopeDetail.js +0 -32
  151. package/src/ui/components/primitives/ScopeSquares.js +0 -11
  152. package/src/ui/components/primitives/SelectableRow.js +0 -5
  153. package/src/ui/components/primitives/index.js +0 -8
  154. package/src/ui/hooks/index.js +0 -4
  155. package/src/ui/hooks/useAsyncData.js +0 -77
  156. package/src/ui/hooks/useGitignoreModal.js +0 -74
  157. package/src/ui/hooks/useKeyboard.js +0 -13
  158. package/src/ui/hooks/useKeyboardHandler.js +0 -39
  159. package/src/ui/hooks/useMismatchModal.js +0 -77
  160. package/src/ui/registry.js +0 -1
  161. package/src/ui/renderers/cliToolRenderers.js +0 -54
  162. package/src/ui/renderers/gitignoreRenderers.js +0 -46
  163. package/src/ui/renderers/mcpRenderers.js +0 -26
  164. package/src/ui/renderers/pluginRenderers.js +0 -124
  165. package/src/ui/renderers/profileRenderers.js +0 -177
  166. package/src/ui/renderers/settingsRenderers.js +0 -73
  167. package/src/ui/renderers/skillRenderers.js +0 -138
  168. package/src/ui/screens/AliasScreen.js +0 -1008
  169. package/src/ui/screens/CliToolsScreen.js +0 -338
  170. package/src/ui/screens/EnvVarsScreen.js +0 -152
  171. package/src/ui/screens/GitignoreScreen.js +0 -328
  172. package/src/ui/screens/McpRegistryScreen.js +0 -238
  173. package/src/ui/screens/McpScreen.js +0 -176
  174. package/src/ui/screens/ModelSelectorScreen.js +0 -296
  175. package/src/ui/screens/ModelSelectorScreen.tsx +0 -444
  176. package/src/ui/screens/PluginsScreen.js +0 -766
  177. package/src/ui/screens/ProfilesScreen.js +0 -298
  178. package/src/ui/screens/SkillsScreen.js +0 -549
  179. package/src/ui/screens/StatusLineScreen.js +0 -206
  180. package/src/ui/screens/StatusLineScreen.tsx +0 -416
  181. package/src/ui/screens/index.js +0 -10
  182. package/src/ui/state/AnimationContext.js +0 -34
  183. package/src/ui/state/AppContext.js +0 -162
  184. package/src/ui/state/DimensionsContext.js +0 -71
  185. package/src/ui/state/reducer.js +0 -543
  186. package/src/ui/state/types.js +0 -1
  187. package/src/ui/theme.js +0 -47
  188. package/src/utils/clipboard.js +0 -56
  189. package/src/utils/command-utils.js +0 -19
  190. package/src/utils/fuzzy-search.js +0 -101
  191. package/src/utils/string-utils.js +0 -62
@@ -1,123 +0,0 @@
1
- export const cliTools = [
2
- {
3
- name: "claudeup",
4
- displayName: "claudeup",
5
- description: "TUI tool for managing Claude Code plugins, MCPs, and configuration",
6
- installCommand: "npm install -g claudeup",
7
- checkCommand: "claudeup --version",
8
- website: "https://github.com/MadAppGang/magus/tree/main/tools/claudeup",
9
- category: "ai-coding",
10
- packageManager: "npm",
11
- packageName: "claudeup",
12
- },
13
- {
14
- name: "mnemex",
15
- displayName: "Mnemex",
16
- description: "AST-aware code search with PageRank, callers/callees, and semantic embeddings",
17
- installCommand: "npm install -g mnemex",
18
- checkCommand: "mnemex --version",
19
- website: "https://github.com/MadAppGang/mnemex",
20
- category: "ai-coding",
21
- packageManager: "npm",
22
- packageName: "mnemex",
23
- },
24
- {
25
- name: "claudish",
26
- displayName: "Claudish",
27
- description: "Run Claude Code with OpenRouter models (Grok, GPT-5, Gemini)",
28
- installCommand: "npm install -g claudish",
29
- checkCommand: "claudish --version",
30
- website: "https://github.com/MadAppGang/claudish",
31
- category: "ai-coding",
32
- packageManager: "npm",
33
- packageName: "claudish",
34
- },
35
- {
36
- name: "claude",
37
- displayName: "Claude Code",
38
- description: "Anthropic official agentic coding tool",
39
- installCommand: "npm install -g @anthropic-ai/claude-code",
40
- checkCommand: "claude --version",
41
- website: "https://claude.ai/code",
42
- category: "ai-coding",
43
- packageManager: "npm",
44
- packageName: "@anthropic-ai/claude-code",
45
- },
46
- {
47
- name: "codex",
48
- displayName: "OpenAI Codex",
49
- description: "Lightweight coding agent from OpenAI that runs in your terminal",
50
- installCommand: "npm install -g @openai/codex",
51
- checkCommand: "codex --version",
52
- website: "https://github.com/openai/codex",
53
- category: "ai-coding",
54
- packageManager: "npm",
55
- packageName: "@openai/codex",
56
- },
57
- {
58
- name: "gemini",
59
- displayName: "Gemini CLI",
60
- description: "Google AI agent with 1M token context, free tier available",
61
- installCommand: "npm install -g @google/gemini-cli",
62
- checkCommand: "gemini --version",
63
- website: "https://github.com/google-gemini/gemini-cli",
64
- category: "ai-coding",
65
- packageManager: "npm",
66
- packageName: "@google/gemini-cli",
67
- },
68
- {
69
- name: "qwen",
70
- displayName: "Qwen Code",
71
- description: "Alibaba coding agent optimized for Qwen3-Coder models",
72
- installCommand: "npm install -g @qwen-code/qwen-code",
73
- checkCommand: "qwen --version",
74
- website: "https://github.com/QwenLM/qwen-code",
75
- category: "ai-coding",
76
- packageManager: "npm",
77
- packageName: "@qwen-code/qwen-code",
78
- },
79
- {
80
- name: "cline",
81
- displayName: "Cline",
82
- description: "Autonomous coding agent with plan & act, checkpoints, browser use",
83
- installCommand: "npm install -g cline",
84
- checkCommand: "cline --version",
85
- website: "https://cline.bot",
86
- category: "ai-coding",
87
- packageManager: "npm",
88
- packageName: "cline",
89
- },
90
- {
91
- name: "opencode",
92
- displayName: "OpenCode",
93
- description: "Open source AI coding agent trusted by 400k+ developers",
94
- installCommand: "npm install -g opencode-ai",
95
- checkCommand: "opencode --version",
96
- website: "https://opencode.ai",
97
- category: "ai-coding",
98
- packageManager: "npm",
99
- packageName: "opencode-ai",
100
- },
101
- {
102
- name: "aider",
103
- displayName: "Aider",
104
- description: "AI pair programming - works with Claude, GPT-4, local models",
105
- installCommand: "pip install aider-install && aider-install",
106
- checkCommand: "aider --version",
107
- website: "https://aider.chat",
108
- category: "ai-coding",
109
- packageManager: "pip",
110
- packageName: "aider-chat",
111
- },
112
- {
113
- name: "crush",
114
- displayName: "Crush",
115
- description: "AI coding assistant from Charm with terminal-native UX",
116
- installCommand: "npm install -g @charmland/crush",
117
- checkCommand: "crush --version",
118
- website: "https://github.com/charmbracelet/crush",
119
- category: "ai-coding",
120
- packageManager: "npm",
121
- packageName: "@charmland/crush",
122
- },
123
- ];
@@ -1,24 +0,0 @@
1
- /**
2
- * Conservative built-in defaults. These ship inside claudeup and apply to
3
- * every project unless overridden by a global or project manifest. Kept narrow
4
- * on purpose — broader patterns (node_modules, .env, .DS_Store, …) live in the
5
- * "common-dev" template which users opt into via `extends`.
6
- */
7
- export const BUILTIN_DEFAULTS = {
8
- ignore: [
9
- ".claude/settings.local.json",
10
- ".claude/scheduled_tasks.lock",
11
- ".claude/cache/",
12
- ".claude/.statusline-worktree-*",
13
- "ai-docs/sessions/",
14
- ".mnemex/",
15
- ".claudemem/",
16
- "gtd/sessions/",
17
- ".agents/",
18
- ],
19
- track: [
20
- ".claude/settings.json",
21
- ".mcp.json",
22
- "plugin.json",
23
- ],
24
- };
@@ -1,97 +0,0 @@
1
- const RULE_REASONS = new Map([
2
- [
3
- key("ignore", ".claude/settings.local.json"),
4
- "Personal Claude settings belong to each developer and should not be shared.",
5
- ],
6
- [
7
- key("ignore", ".claude/scheduled_tasks.lock"),
8
- "Runtime lock files are local process state and should be regenerated locally.",
9
- ],
10
- [
11
- key("ignore", ".claude/cache/"),
12
- "Claude cache contents are local generated data and can grow quickly.",
13
- ],
14
- [
15
- key("ignore", ".claude/.statusline-worktree-*"),
16
- "Statusline worktree markers are local runtime state.",
17
- ],
18
- [
19
- key("ignore", "ai-docs/sessions/"),
20
- "Session transcripts and scratch notes are local working artifacts.",
21
- ],
22
- [
23
- key("ignore", ".mnemex/"),
24
- "Local memory/index data is machine-specific and regenerated by tooling.",
25
- ],
26
- [
27
- key("ignore", ".claudemem/"),
28
- "Local claudemem indexes are generated from the repo and should not be committed.",
29
- ],
30
- [
31
- key("ignore", "gtd/sessions/"),
32
- "Local GTD session artifacts are personal workflow state.",
33
- ],
34
- [
35
- key("ignore", ".agents/"),
36
- "Local agent workspaces and runtime artifacts should stay out of team history.",
37
- ],
38
- [
39
- key("ignore", "node_modules/"),
40
- "Installed dependencies are restored from the package manager lockfile.",
41
- ],
42
- [
43
- key("ignore", ".env"),
44
- "Environment files commonly contain local secrets and machine-specific values.",
45
- ],
46
- [
47
- key("ignore", ".env.local"),
48
- "Local environment overrides commonly contain secrets or developer-specific values.",
49
- ],
50
- [
51
- key("ignore", ".DS_Store"),
52
- "macOS Finder metadata is machine-generated noise.",
53
- ],
54
- [
55
- key("ignore", "dist/"),
56
- "Distribution output is generated from source during builds.",
57
- ],
58
- [
59
- key("ignore", "build/"),
60
- "Build output is generated from source during builds.",
61
- ],
62
- [
63
- key("ignore", "*.log"),
64
- "Log files are runtime output and usually contain noisy local details.",
65
- ],
66
- [
67
- key("ignore", "coverage/"),
68
- "Coverage reports are generated by test runs.",
69
- ],
70
- [
71
- key("ignore", ".cache/"),
72
- "Tool cache contents are local generated data.",
73
- ],
74
- [
75
- key("track", ".claude/settings.json"),
76
- "Team Claude settings should be committed so everyone gets the same project behavior.",
77
- ],
78
- [
79
- key("track", ".mcp.json"),
80
- "Team MCP configuration should be committed so shared tools are discoverable.",
81
- ],
82
- [
83
- key("track", "plugin.json"),
84
- "The plugin manifest is source metadata required by the plugin system.",
85
- ],
86
- ]);
87
- export function getGitignoreRuleReason(action, pattern) {
88
- const reason = RULE_REASONS.get(key(action, pattern));
89
- if (reason)
90
- return reason;
91
- return action === "ignore"
92
- ? "A managed rule says this path should stay out of git."
93
- : "A managed rule says this path should stay tracked in git.";
94
- }
95
- function key(action, pattern) {
96
- return `${action}:${pattern}`;
97
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Opt-in templates a user manifest can pull in via `extends`. Kept separate
3
- * from BUILTIN_DEFAULTS so the active baseline stays minimal — these only
4
- * apply when explicitly requested.
5
- */
6
- export const BUILTIN_TEMPLATES = {
7
- "common-dev": {
8
- ignore: [
9
- "node_modules/",
10
- ".env",
11
- ".env.local",
12
- ".DS_Store",
13
- "dist/",
14
- "build/",
15
- "*.log",
16
- "coverage/",
17
- ".cache/",
18
- ],
19
- track: [],
20
- },
21
- };
@@ -1,138 +0,0 @@
1
- import { formatMarketplaceName } from "../utils/string-utils.js";
2
- /**
3
- * Known repo aliases — GitHub redirects the old repo to the new one,
4
- * so these should be treated as identical for deduplication.
5
- */
6
- const REPO_ALIASES = {
7
- "madappgang/claude-code": "madappgang/magus",
8
- };
9
- /** Normalize a repo string through known aliases. */
10
- function normalizeRepo(repo) {
11
- const lower = repo.toLowerCase();
12
- return REPO_ALIASES[lower] || lower;
13
- }
14
- /**
15
- * Deprecated marketplace names that should be hidden if the canonical
16
- * marketplace is already present. Maps deprecated name → canonical name.
17
- */
18
- export const deprecatedMarketplaces = {
19
- "mag-claude-plugins": "magus",
20
- "MadAppGang-claude-code": "magus",
21
- superpowers: "superpowers-marketplace",
22
- };
23
- export const defaultMarketplaces = [
24
- {
25
- name: "magus",
26
- displayName: "Magus",
27
- source: {
28
- source: "github",
29
- repo: "MadAppGang/magus",
30
- },
31
- description: "Professional plugins for frontend, backend, and code analysis",
32
- official: false,
33
- featured: true, // Always show plugins (expanded by default)
34
- },
35
- {
36
- name: "claude-plugins-official",
37
- displayName: "Anthropic Official",
38
- source: {
39
- source: "github",
40
- repo: "anthropics/claude-plugins-official",
41
- },
42
- description: "Official Anthropic-managed directory of high quality Claude Code plugins",
43
- official: true,
44
- },
45
- {
46
- name: "superpowers-marketplace",
47
- displayName: "Superpowers",
48
- source: {
49
- source: "github",
50
- repo: "obra/superpowers-marketplace",
51
- },
52
- description: "Curated Claude Code plugins for skills and workflows",
53
- featured: true,
54
- },
55
- {
56
- name: "claude-code-plugins",
57
- displayName: "Anthropic Deprecated",
58
- source: {
59
- source: "github",
60
- repo: "anthropics/claude-code",
61
- },
62
- description: "Legacy demo plugins from Anthropic (deprecated - use Official instead)",
63
- official: true,
64
- deprecated: true,
65
- },
66
- ];
67
- export function getMarketplaceByName(name) {
68
- return defaultMarketplaces.find((m) => m.name === name);
69
- }
70
- // Get all available marketplaces from local cache + hardcoded defaults
71
- // Local cache is primary source of truth, defaults are fallback
72
- // Deduplicates by normalized repo URL to avoid showing same marketplace twice
73
- export function getAllMarketplaces(localMarketplaces) {
74
- const all = new Map();
75
- const seenRepos = new Set();
76
- // Primary source: local cache (what's actually cloned)
77
- if (localMarketplaces) {
78
- for (const [name, local] of localMarketplaces) {
79
- const repo = normalizeRepo(local.gitRepo || "");
80
- // Skip deprecated marketplaces if their canonical replacement exists
81
- // (or will be added from defaults)
82
- const canonical = deprecatedMarketplaces[name];
83
- if (canonical) {
84
- // If canonical already in the map or in defaults, skip this entry
85
- if (all.has(canonical) ||
86
- defaultMarketplaces.some((m) => m.name === canonical)) {
87
- continue;
88
- }
89
- }
90
- // Skip if another marketplace already claimed this repo URL
91
- if (repo && seenRepos.has(repo))
92
- continue;
93
- if (repo)
94
- seenRepos.add(repo);
95
- // Check if this marketplace has defaults (for official/featured flags)
96
- const defaultMp = defaultMarketplaces.find((m) => m.name === name);
97
- all.set(name, {
98
- name,
99
- // Prefer default displayName over stale local clone data
100
- displayName: defaultMp?.displayName || local.name || formatMarketplaceName(name),
101
- source: {
102
- source: "github",
103
- repo: defaultMp?.source.repo || local.gitRepo || "",
104
- },
105
- description: defaultMp?.description || local.description || "",
106
- official: defaultMp?.official ?? repo.toLowerCase().includes("anthropics/"),
107
- featured: defaultMp?.featured,
108
- deprecated: defaultMp?.deprecated,
109
- });
110
- }
111
- }
112
- // Fallback: hardcoded defaults (only if their repo isn't already represented)
113
- for (const mp of defaultMarketplaces) {
114
- const repo = normalizeRepo(mp.source.repo || "");
115
- if (!all.has(mp.name) && !seenRepos.has(repo)) {
116
- all.set(mp.name, mp);
117
- if (repo)
118
- seenRepos.add(repo);
119
- }
120
- }
121
- // Sort: Magus first, deprecated last, then alphabetically
122
- return Array.from(all.values()).sort((a, b) => {
123
- // Magus (MadAppGang) always first
124
- const aIsMag = a.source.repo?.toLowerCase().includes("madappgang/");
125
- const bIsMag = b.source.repo?.toLowerCase().includes("madappgang/");
126
- if (aIsMag && !bIsMag)
127
- return -1;
128
- if (!aIsMag && bIsMag)
129
- return 1;
130
- // Deprecated entries always last
131
- if (a.deprecated && !b.deprecated)
132
- return 1;
133
- if (!a.deprecated && b.deprecated)
134
- return -1;
135
- // Then alphabetically by display name
136
- return (a.displayName || a.name).localeCompare(b.displayName || b.name);
137
- });
138
- }