agents-inc 0.153.0 → 0.155.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 (218) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/chunk-2H7UWE2G.js +246 -0
  3. package/dist/chunk-2H7UWE2G.js.map +1 -0
  4. package/dist/{chunk-ZNDLUWWD.js → chunk-4A4L3YIW.js} +5 -5
  5. package/dist/chunk-4G2YHZIM.js +132 -0
  6. package/dist/chunk-4G2YHZIM.js.map +1 -0
  7. package/dist/{chunk-WDAO3RUY.js → chunk-5F2YR5XV.js} +3 -3
  8. package/dist/{chunk-JFAUQDZM.js → chunk-5OKLCVM4.js} +3 -3
  9. package/dist/{chunk-REKOWTIB.js → chunk-5QZAK6J7.js} +44 -10
  10. package/dist/chunk-5QZAK6J7.js.map +1 -0
  11. package/dist/{chunk-VECFAKM5.js → chunk-6RLV45HN.js} +10 -10
  12. package/dist/{chunk-VECFAKM5.js.map → chunk-6RLV45HN.js.map} +1 -1
  13. package/dist/{chunk-K7PJDWER.js → chunk-CLFHC2DK.js} +15 -106
  14. package/dist/chunk-CLFHC2DK.js.map +1 -0
  15. package/dist/chunk-D2CAV7MG.js +61 -0
  16. package/dist/chunk-D2CAV7MG.js.map +1 -0
  17. package/dist/{chunk-NXGMM5YN.js → chunk-F2AMBBIA.js} +6 -6
  18. package/dist/{chunk-NXGMM5YN.js.map → chunk-F2AMBBIA.js.map} +1 -1
  19. package/dist/{chunk-HEBPKK5L.js → chunk-F5T6TV4Z.js} +213 -92
  20. package/dist/chunk-F5T6TV4Z.js.map +1 -0
  21. package/dist/{chunk-K3O3YQYG.js → chunk-G47TDUK3.js} +2 -2
  22. package/dist/{chunk-U2DNAHFE.js → chunk-GS2NZ3GD.js} +8 -8
  23. package/dist/chunk-GS2NZ3GD.js.map +1 -0
  24. package/dist/{chunk-ORJ5Y222.js → chunk-H6UTKTLK.js} +176 -256
  25. package/dist/chunk-H6UTKTLK.js.map +1 -0
  26. package/dist/{chunk-M5HSTNYU.js → chunk-HG4JPXJT.js} +11 -29
  27. package/dist/chunk-HG4JPXJT.js.map +1 -0
  28. package/dist/{chunk-VGEBYCQZ.js → chunk-HTYH7CKN.js} +4 -15
  29. package/dist/chunk-HTYH7CKN.js.map +1 -0
  30. package/dist/{chunk-JC7DBPRD.js → chunk-HXKOIWLU.js} +2 -2
  31. package/dist/chunk-HXKOIWLU.js.map +1 -0
  32. package/dist/{chunk-NSJ2S7R5.js → chunk-ILUVL7WM.js} +2 -2
  33. package/dist/{chunk-R54KIGN2.js → chunk-IO5YBKHV.js} +13 -2
  34. package/dist/chunk-IO5YBKHV.js.map +1 -0
  35. package/dist/chunk-IXRZAHZF.js +53 -0
  36. package/dist/chunk-IXRZAHZF.js.map +1 -0
  37. package/dist/chunk-JCPANDNR.js +35 -0
  38. package/dist/chunk-JCPANDNR.js.map +1 -0
  39. package/dist/{chunk-R4SEU3DF.js → chunk-LJCNUP6M.js} +2 -2
  40. package/dist/{chunk-FRWKCE6R.js → chunk-MHRC3KRX.js} +5 -5
  41. package/dist/chunk-MHRC3KRX.js.map +1 -0
  42. package/dist/chunk-MO5FGLVS.js +142 -0
  43. package/dist/chunk-MO5FGLVS.js.map +1 -0
  44. package/dist/{chunk-Q5FLW4JG.js → chunk-OKH64JZE.js} +2 -2
  45. package/dist/{chunk-WG6V6VJV.js → chunk-PCC4LBKB.js} +2 -2
  46. package/dist/chunk-PMUABBPG.js +258 -0
  47. package/dist/chunk-PMUABBPG.js.map +1 -0
  48. package/dist/{chunk-EFU6P3B7.js → chunk-PNMM5HNX.js} +5 -5
  49. package/dist/{chunk-4VYALFQZ.js → chunk-QWVXOCXO.js} +6 -6
  50. package/dist/{chunk-35VOK7XE.js → chunk-RWOYPOMR.js} +4365 -4355
  51. package/dist/chunk-RWOYPOMR.js.map +1 -0
  52. package/dist/{chunk-IO4VEW5U.js → chunk-SY4X2LND.js} +4 -4
  53. package/dist/{chunk-XGMOXMS4.js → chunk-TBOVYLQJ.js} +2 -2
  54. package/dist/{chunk-BMGBA6HJ.js → chunk-TNGMF4UX.js} +20 -20
  55. package/dist/{chunk-BMGBA6HJ.js.map → chunk-TNGMF4UX.js.map} +1 -1
  56. package/dist/{chunk-TY6CAOL7.js → chunk-UMH2YZKG.js} +14 -5
  57. package/dist/chunk-UMH2YZKG.js.map +1 -0
  58. package/dist/{chunk-6CNRMCFM.js → chunk-VPASBA7P.js} +2 -2
  59. package/dist/{chunk-NXQAY5U7.js → chunk-WCAUUBHO.js} +5860 -5126
  60. package/dist/chunk-WCAUUBHO.js.map +1 -0
  61. package/dist/{chunk-V3ENMW7G.js → chunk-WFRTHH3A.js} +3 -3
  62. package/dist/{chunk-2HC2SNRP.js → chunk-WTJ3AY33.js} +1 -5
  63. package/dist/chunk-WTJ3AY33.js.map +1 -0
  64. package/dist/{chunk-F7Z5I6GU.js → chunk-WUQ3MTPF.js} +11 -5
  65. package/dist/{chunk-F7Z5I6GU.js.map → chunk-WUQ3MTPF.js.map} +1 -1
  66. package/dist/{chunk-U2YSGBHA.js → chunk-XAXJWXI4.js} +93 -43
  67. package/dist/chunk-XAXJWXI4.js.map +1 -0
  68. package/dist/{chunk-ACKC577F.js → chunk-Y5Y7XHVU.js} +4 -4
  69. package/dist/{chunk-X5XJ6WKO.js → chunk-YO2LTXB4.js} +107 -16
  70. package/dist/chunk-YO2LTXB4.js.map +1 -0
  71. package/dist/{chunk-FIHTAFST.js → chunk-ZUAZHDKP.js} +64 -65
  72. package/dist/chunk-ZUAZHDKP.js.map +1 -0
  73. package/dist/commands/build/marketplace.js +98 -120
  74. package/dist/commands/build/marketplace.js.map +1 -1
  75. package/dist/commands/build/plugins.js +8 -8
  76. package/dist/commands/compile.js +57 -24
  77. package/dist/commands/compile.js.map +1 -1
  78. package/dist/commands/doctor.js +220 -79
  79. package/dist/commands/doctor.js.map +1 -1
  80. package/dist/commands/edit.js +608 -100
  81. package/dist/commands/edit.js.map +1 -1
  82. package/dist/commands/eject.js +26 -21
  83. package/dist/commands/eject.js.map +1 -1
  84. package/dist/commands/init.js +41 -39
  85. package/dist/commands/list.js +11 -11
  86. package/dist/commands/list.js.map +1 -1
  87. package/dist/commands/new/marketplace.js +243 -0
  88. package/dist/commands/new/marketplace.js.map +1 -0
  89. package/dist/commands/search.js +34 -24
  90. package/dist/commands/search.js.map +1 -1
  91. package/dist/commands/share.js +67 -0
  92. package/dist/commands/share.js.map +1 -0
  93. package/dist/commands/uninstall.js +234 -196
  94. package/dist/commands/uninstall.js.map +1 -1
  95. package/dist/commands/update.js +9 -9
  96. package/dist/commands/update.js.map +1 -1
  97. package/dist/components/common/prompt-confirm.js +1 -1
  98. package/dist/components/common/removal-plan-confirm.js +10 -0
  99. package/dist/components/common/select-list.js +2 -2
  100. package/dist/components/wizard/category-grid.js +5 -5
  101. package/dist/components/wizard/checkbox-grid.js +5 -5
  102. package/dist/components/wizard/domain-selection.js +11 -11
  103. package/dist/components/wizard/run-wizard-session.js +29 -28
  104. package/dist/components/wizard/scroll-affordance.js +2 -2
  105. package/dist/components/wizard/skill-agent-summary.js +6 -6
  106. package/dist/components/wizard/source-grid.js +6 -6
  107. package/dist/components/wizard/stack-selection.js +8 -8
  108. package/dist/components/wizard/step-agents.js +10 -11
  109. package/dist/components/wizard/step-build.js +9 -9
  110. package/dist/components/wizard/step-confirm.js +10 -10
  111. package/dist/components/wizard/step-sources.js +10 -10
  112. package/dist/components/wizard/step-stack.js +9 -9
  113. package/dist/components/wizard/summary-panel.js +9 -9
  114. package/dist/components/wizard/toast.js +2 -2
  115. package/dist/components/wizard/wizard-layout.js +14 -14
  116. package/dist/components/wizard/wizard-tabs.js +2 -2
  117. package/dist/components/wizard/wizard.js +27 -27
  118. package/dist/copy-local-skills-NSUTBVLJ.js +14 -0
  119. package/dist/hooks/init.js +42 -62
  120. package/dist/hooks/init.js.map +1 -1
  121. package/dist/load-agent-defs-X4E57I2U.js +15 -0
  122. package/dist/{loader-4U7UCE2Y.js → loader-G6BFG2VA.js} +3 -3
  123. package/dist/recompile-project-agents-JE4MM72I.js +20 -0
  124. package/dist/{source-loader-ZNSYJJCI.js → source-loader-3DL3NYUX.js} +7 -5
  125. package/dist/source-loader-3DL3NYUX.js.map +1 -0
  126. package/dist/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  127. package/dist/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  128. package/dist/src/agents/developer/ai-developer/identity.md +1 -1
  129. package/dist/src/agents/developer/ai-developer/playbook.md +1 -1
  130. package/dist/src/agents/developer/api-developer/identity.md +1 -1
  131. package/dist/src/agents/developer/cli-developer/identity.md +1 -1
  132. package/dist/src/agents/developer/web-developer/identity.md +1 -1
  133. package/dist/src/agents/meta/codex-keeper/identity.md +1 -1
  134. package/dist/src/agents/meta/convention-keeper/identity.md +1 -1
  135. package/dist/src/agents/meta/skill-summoner/identity.md +1 -1
  136. package/dist/src/agents/researcher/ai-researcher/identity.md +1 -1
  137. package/dist/src/agents/researcher/api-researcher/identity.md +1 -1
  138. package/dist/src/agents/researcher/cli-researcher/identity.md +1 -1
  139. package/dist/src/agents/researcher/web-researcher/identity.md +1 -1
  140. package/dist/src/agents/reviewer/reviewer/playbook.md +1 -1
  141. package/dist/src/agents/tester/ai-tester/identity.md +1 -1
  142. package/dist/src/agents/tester/api-tester/critical-reminders.md +1 -1
  143. package/dist/src/agents/tester/api-tester/critical-requirements.md +1 -1
  144. package/dist/src/agents/tester/api-tester/identity.md +2 -2
  145. package/dist/src/agents/tester/cli-tester/identity.md +1 -1
  146. package/dist/src/agents/tester/web-tester/identity.md +3 -3
  147. package/dist/stores/wizard-store.js +7 -5
  148. package/package.json +10 -7
  149. package/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  150. package/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  151. package/src/agents/developer/ai-developer/identity.md +1 -1
  152. package/src/agents/developer/ai-developer/playbook.md +1 -1
  153. package/src/agents/developer/api-developer/identity.md +1 -1
  154. package/src/agents/developer/cli-developer/identity.md +1 -1
  155. package/src/agents/developer/web-developer/identity.md +1 -1
  156. package/src/agents/meta/codex-keeper/identity.md +1 -1
  157. package/src/agents/meta/convention-keeper/identity.md +1 -1
  158. package/src/agents/meta/skill-summoner/identity.md +1 -1
  159. package/src/agents/researcher/ai-researcher/identity.md +1 -1
  160. package/src/agents/researcher/api-researcher/identity.md +1 -1
  161. package/src/agents/researcher/cli-researcher/identity.md +1 -1
  162. package/src/agents/researcher/web-researcher/identity.md +1 -1
  163. package/src/agents/reviewer/reviewer/playbook.md +1 -1
  164. package/src/agents/tester/ai-tester/identity.md +1 -1
  165. package/src/agents/tester/api-tester/critical-reminders.md +1 -1
  166. package/src/agents/tester/api-tester/critical-requirements.md +1 -1
  167. package/src/agents/tester/api-tester/identity.md +2 -2
  168. package/src/agents/tester/cli-tester/identity.md +1 -1
  169. package/src/agents/tester/web-tester/identity.md +3 -3
  170. package/src/schemas/custom-metadata.schema.json +3 -0
  171. package/src/schemas/metadata.schema.json +3 -0
  172. package/src/schemas/plugin.schema.json +3 -0
  173. package/src/schemas/project-config.schema.json +4 -8
  174. package/src/schemas/project-source-config.schema.json +2 -2
  175. package/dist/chunk-2HC2SNRP.js.map +0 -1
  176. package/dist/chunk-35VOK7XE.js.map +0 -1
  177. package/dist/chunk-FIHTAFST.js.map +0 -1
  178. package/dist/chunk-FRWKCE6R.js.map +0 -1
  179. package/dist/chunk-HEBPKK5L.js.map +0 -1
  180. package/dist/chunk-JC7DBPRD.js.map +0 -1
  181. package/dist/chunk-K7PJDWER.js.map +0 -1
  182. package/dist/chunk-KET3EVGX.js +0 -41
  183. package/dist/chunk-KET3EVGX.js.map +0 -1
  184. package/dist/chunk-M5HSTNYU.js.map +0 -1
  185. package/dist/chunk-NXQAY5U7.js.map +0 -1
  186. package/dist/chunk-OJJLYHM3.js +0 -34
  187. package/dist/chunk-OJJLYHM3.js.map +0 -1
  188. package/dist/chunk-ORJ5Y222.js.map +0 -1
  189. package/dist/chunk-R54KIGN2.js.map +0 -1
  190. package/dist/chunk-REKOWTIB.js.map +0 -1
  191. package/dist/chunk-TY6CAOL7.js.map +0 -1
  192. package/dist/chunk-U2DNAHFE.js.map +0 -1
  193. package/dist/chunk-U2YSGBHA.js.map +0 -1
  194. package/dist/chunk-VGEBYCQZ.js.map +0 -1
  195. package/dist/chunk-X5XJ6WKO.js.map +0 -1
  196. package/dist/copy-local-skills-KF2RAVD3.js +0 -14
  197. package/dist/load-agent-defs-DGXGBU3Q.js +0 -15
  198. package/dist/recompile-project-agents-CJVBAWDJ.js +0 -20
  199. /package/dist/{chunk-ZNDLUWWD.js.map → chunk-4A4L3YIW.js.map} +0 -0
  200. /package/dist/{chunk-WDAO3RUY.js.map → chunk-5F2YR5XV.js.map} +0 -0
  201. /package/dist/{chunk-JFAUQDZM.js.map → chunk-5OKLCVM4.js.map} +0 -0
  202. /package/dist/{chunk-K3O3YQYG.js.map → chunk-G47TDUK3.js.map} +0 -0
  203. /package/dist/{chunk-NSJ2S7R5.js.map → chunk-ILUVL7WM.js.map} +0 -0
  204. /package/dist/{chunk-R4SEU3DF.js.map → chunk-LJCNUP6M.js.map} +0 -0
  205. /package/dist/{chunk-Q5FLW4JG.js.map → chunk-OKH64JZE.js.map} +0 -0
  206. /package/dist/{chunk-WG6V6VJV.js.map → chunk-PCC4LBKB.js.map} +0 -0
  207. /package/dist/{chunk-EFU6P3B7.js.map → chunk-PNMM5HNX.js.map} +0 -0
  208. /package/dist/{chunk-4VYALFQZ.js.map → chunk-QWVXOCXO.js.map} +0 -0
  209. /package/dist/{chunk-IO4VEW5U.js.map → chunk-SY4X2LND.js.map} +0 -0
  210. /package/dist/{chunk-XGMOXMS4.js.map → chunk-TBOVYLQJ.js.map} +0 -0
  211. /package/dist/{chunk-6CNRMCFM.js.map → chunk-VPASBA7P.js.map} +0 -0
  212. /package/dist/{chunk-V3ENMW7G.js.map → chunk-WFRTHH3A.js.map} +0 -0
  213. /package/dist/{chunk-ACKC577F.js.map → chunk-Y5Y7XHVU.js.map} +0 -0
  214. /package/dist/{copy-local-skills-KF2RAVD3.js.map → components/common/removal-plan-confirm.js.map} +0 -0
  215. /package/dist/{load-agent-defs-DGXGBU3Q.js.map → copy-local-skills-NSUTBVLJ.js.map} +0 -0
  216. /package/dist/{loader-4U7UCE2Y.js.map → load-agent-defs-X4E57I2U.js.map} +0 -0
  217. /package/dist/{recompile-project-agents-CJVBAWDJ.js.map → loader-G6BFG2VA.js.map} +0 -0
  218. /package/dist/{source-loader-ZNSYJJCI.js.map → recompile-project-agents-JE4MM72I.js.map} +0 -0
@@ -1,32 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- Confirm
4
- } from "../chunk-OZXAJNLA.js";
3
+ RemovalPlanConfirm
4
+ } from "../chunk-D2CAV7MG.js";
5
+ import "../chunk-OZXAJNLA.js";
5
6
  import {
6
7
  promptConfirm
7
- } from "../chunk-OJJLYHM3.js";
8
- import "../chunk-F7Z5I6GU.js";
9
- import "../chunk-REKOWTIB.js";
10
- import "../chunk-NXGMM5YN.js";
8
+ } from "../chunk-JCPANDNR.js";
9
+ import "../chunk-WUQ3MTPF.js";
10
+ import "../chunk-5QZAK6J7.js";
11
11
  import {
12
12
  loadAgentDefs
13
- } from "../chunk-FRWKCE6R.js";
13
+ } from "../chunk-MHRC3KRX.js";
14
+ import "../chunk-F2AMBBIA.js";
14
15
  import {
15
- listAgentMdFiles
16
- } from "../chunk-FIHTAFST.js";
16
+ listAgentMdFiles,
17
+ splitAgentsByProvenance
18
+ } from "../chunk-ZUAZHDKP.js";
17
19
  import "../chunk-JFLVEFFP.js";
18
20
  import {
19
21
  BaseCommand,
20
22
  EXIT_CODES
21
- } from "../chunk-X5XJ6WKO.js";
22
- import "../chunk-TY6CAOL7.js";
23
- import "../chunk-K3O3YQYG.js";
23
+ } from "../chunk-YO2LTXB4.js";
24
+ import "../chunk-UMH2YZKG.js";
25
+ import "../chunk-G47TDUK3.js";
24
26
  import {
25
27
  ConfigLoadError,
26
28
  INFO_MESSAGES,
27
29
  SUCCESS_MESSAGES,
30
+ UNINSTALL_PLAN,
28
31
  buildMarketplacePluginRef,
29
32
  claudePluginUninstallBestEffort,
33
+ compiledAgentsRemoval,
30
34
  getProjectPluginsDir,
31
35
  isClaudeCLIAvailable,
32
36
  isHomeDirectory,
@@ -34,6 +38,7 @@ import {
34
38
  listPluginNames,
35
39
  loadProjectConfigFromDir,
36
40
  loadSkillsMatrixFromSource,
41
+ localSkillsRemoval,
37
42
  mutateGlobal,
38
43
  parseMarketplacePluginRef,
39
44
  propagateGlobalRemoval,
@@ -42,94 +47,133 @@ import {
42
47
  registeredProjectsUpdateFailed,
43
48
  registeredProjectsUpdated,
44
49
  resolveInstallPaths,
45
- toClaudePluginScope
46
- } from "../chunk-NXQAY5U7.js";
50
+ toClaudePluginScope,
51
+ unmarkedAgentsKept
52
+ } from "../chunk-WCAUUBHO.js";
47
53
  import {
48
54
  directoryExists,
49
55
  fileExists,
50
56
  getErrorMessage,
51
57
  listDirectories,
52
- remove
53
- } from "../chunk-U2YSGBHA.js";
54
- import "../chunk-35VOK7XE.js";
58
+ remove,
59
+ removeDirIfEmpty
60
+ } from "../chunk-XAXJWXI4.js";
61
+ import "../chunk-RWOYPOMR.js";
55
62
  import "../chunk-VASLW636.js";
56
63
  import {
57
64
  CLAUDE_DIR,
58
65
  CLAUDE_SRC_DIR,
59
- CLI_COLORS,
60
66
  DEFAULT_BRANDING,
61
67
  EJECT_SOURCE,
62
68
  STANDARD_FILES
63
- } from "../chunk-R54KIGN2.js";
69
+ } from "../chunk-IO5YBKHV.js";
64
70
  import "../chunk-VZRO7RYT.js";
65
71
 
66
72
  // src/cli/commands/uninstall.tsx
67
73
  import "react";
68
74
  import { partition } from "remeda";
69
75
  import path from "path";
70
- import { readdir } from "fs/promises";
71
76
  import { Flags } from "@oclif/core";
72
- import { Box, Text, useApp } from "ink";
73
- import { jsx, jsxs } from "react/jsx-runtime";
77
+ import { jsx } from "react/jsx-runtime";
74
78
  function buildRemovalPlan(target) {
75
- const sections = [];
76
- if (target.hasPlugins) {
77
- sections.push({ label: "Plugins:", items: [...target.cliPluginNames] });
78
- }
79
- if (target.hasLocalSkills || target.hasLocalAgents) {
80
- const items = [];
81
- if (target.hasLocalSkills) items.push(`${target.skillsDir}/ (matching sources)`);
82
- if (target.hasLocalAgents) items.push(`${target.agentsDir}/ (CLI-compiled)`);
83
- sections.push({ label: "CLI-managed files:", items });
84
- }
85
- if (target.hasClaudeSrcConfig || target.hasClaudeSrcConfigTypes) {
86
- const items = [];
87
- if (target.hasClaudeSrcConfig) {
88
- items.push(`${target.claudeSrcDir}/${STANDARD_FILES.CONFIG_TS}`);
89
- }
90
- if (target.hasClaudeSrcConfigTypes) {
91
- items.push(`${target.claudeSrcDir}/${STANDARD_FILES.CONFIG_TYPES_TS}`);
79
+ const agents = compiledAgentsEntry(target);
80
+ return {
81
+ entries: [
82
+ ...pluginsEntry(target),
83
+ ...localSkillsEntry(target),
84
+ ...agents,
85
+ ...configManifestEntry(target)
86
+ ],
87
+ kept: keptStatements(target, agents)
88
+ };
89
+ }
90
+ function hasAnythingToRemove(plan) {
91
+ return plan.entries.length > 0;
92
+ }
93
+ function pluginsEntry(target) {
94
+ if (!target.hasPlugins) return [];
95
+ return [{ kind: "plugins", pluginsDir: target.pluginsDir, names: [...target.cliPluginNames] }];
96
+ }
97
+ function localSkillsEntry(target) {
98
+ if (!target.hasLocalSkills) return [];
99
+ return [{ kind: "skills", skillsDir: target.skillsDir }];
100
+ }
101
+ function compiledAgentsEntry(target) {
102
+ if (!target.hasLocalAgents) return [];
103
+ const agentNames = identifiableAgents(target);
104
+ if (agentNames.length === 0) return [];
105
+ return [{ kind: "agents", agentsDir: target.agentsDir, agentNames }];
106
+ }
107
+ function identifiableAgents(target) {
108
+ if (target.configuredAgents.length > 0) return target.configuredAgents;
109
+ return target.markedAgents;
110
+ }
111
+ function configManifestEntry(target) {
112
+ const fileNames = [
113
+ ...target.hasClaudeSrcConfig ? [STANDARD_FILES.CONFIG_TS] : [],
114
+ ...target.hasClaudeSrcConfigTypes ? [STANDARD_FILES.CONFIG_TYPES_TS] : []
115
+ ];
116
+ if (fileNames.length === 0) return [];
117
+ return [{ kind: "config", claudeSrcDir: target.claudeSrcDir, fileNames }];
118
+ }
119
+ function keptStatements(target, agentRemovals) {
120
+ const removing = new Set(agentRemovals.flatMap((entry) => entry.agentNames));
121
+ const kept = target.unmarkedAgents.filter((name) => !removing.has(name));
122
+ if (kept.length === 0) return [];
123
+ return [unmarkedAgentsKept(target.agentsDir, kept.length)];
124
+ }
125
+ function planEntry(plan, kind) {
126
+ return plan.entries.find(
127
+ (entry) => entry.kind === kind
128
+ );
129
+ }
130
+ function describeEntry(entry) {
131
+ switch (entry.kind) {
132
+ case "plugins":
133
+ return { label: UNINSTALL_PLAN.PLUGINS_HEADING, items: entry.names };
134
+ case "skills":
135
+ return {
136
+ label: UNINSTALL_PLAN.CLI_MANAGED_FILES_HEADING,
137
+ items: [localSkillsRemoval(entry.skillsDir)]
138
+ };
139
+ case "agents":
140
+ return {
141
+ label: UNINSTALL_PLAN.CLI_MANAGED_FILES_HEADING,
142
+ items: [compiledAgentsRemoval(entry.agentsDir)]
143
+ };
144
+ case "config":
145
+ return {
146
+ label: UNINSTALL_PLAN.CONFIG_HEADING,
147
+ items: entry.fileNames.map((fileName) => `${entry.claudeSrcDir}/${fileName}`)
148
+ };
149
+ default: {
150
+ const _exhaustive = entry;
151
+ return _exhaustive;
92
152
  }
93
- sections.push({ label: "Config:", items });
94
153
  }
95
- return sections;
96
154
  }
97
- var UninstallConfirm = ({ target, onConfirm, onCancel }) => {
98
- const { exit } = useApp();
99
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
100
- /* @__PURE__ */ jsx(Text, { bold: true, children: "The following will be removed:" }),
101
- /* @__PURE__ */ jsx(Text, { children: " " }),
102
- buildRemovalPlan(target).map((section) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
103
- /* @__PURE__ */ jsxs(Text, { color: CLI_COLORS.ERROR, children: [
104
- " ",
105
- section.label
106
- ] }),
107
- section.items.map((item) => /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
108
- " ",
109
- item
110
- ] }, item))
111
- ] }, section.label)),
112
- /* @__PURE__ */ jsx(Text, { children: " " }),
113
- /* @__PURE__ */ jsx(
114
- Confirm,
115
- {
116
- message: "Are you sure you want to uninstall?",
117
- onConfirm: () => {
118
- onConfirm();
119
- exit();
120
- },
121
- onCancel: () => {
122
- onCancel();
123
- exit();
124
- },
125
- defaultValue: false
126
- }
127
- )
128
- ] });
129
- };
155
+ var PLAN_SECTION_ORDER = [
156
+ UNINSTALL_PLAN.PLUGINS_HEADING,
157
+ UNINSTALL_PLAN.CLI_MANAGED_FILES_HEADING,
158
+ UNINSTALL_PLAN.CONFIG_HEADING
159
+ ];
160
+ function planSections(entries) {
161
+ const described = entries.map(describeEntry);
162
+ return PLAN_SECTION_ORDER.flatMap(
163
+ (label) => sectionWithItems(label, itemsUnder(described, label))
164
+ );
165
+ }
166
+ function itemsUnder(described, label) {
167
+ return described.filter((section) => section.label === label).flatMap((section) => section.items);
168
+ }
169
+ function sectionWithItems(label, items) {
170
+ if (items.length === 0) return [];
171
+ return [{ label, items }];
172
+ }
173
+ var UNINSTALL_CONFIRM_MESSAGE = "Are you sure you want to uninstall?";
130
174
  var Uninstall = class _Uninstall extends BaseCommand {
131
175
  static summary = `Remove ${DEFAULT_BRANDING.NAME} from this project`;
132
- static description = `Uninstall ${DEFAULT_BRANDING.NAME} from this project. Removes CLI-managed skills (matched by source), compiled agents, plugins, and the .claude-src/ config manifest (config.ts + config-types.ts). User-created content is preserved.`;
176
+ static description = `Uninstall ${DEFAULT_BRANDING.NAME} from this project. Removes CLI-managed skills (matched by marketplace), compiled agents, plugins, and the .claude-src/ config manifest (config.ts + config-types.ts). User-created content is preserved.`;
133
177
  static examples = [
134
178
  "<%= config.bin %> <%= command.id %>",
135
179
  "<%= config.bin %> <%= command.id %> --yes"
@@ -151,17 +195,18 @@ var Uninstall = class _Uninstall extends BaseCommand {
151
195
  `Could not read the project config \u2014 plugins and compiled agents it lists may be left behind: ${reason}`
152
196
  )
153
197
  );
154
- if (!hasAnythingToRemove(target)) {
198
+ const plan = buildRemovalPlan(target);
199
+ if (!hasAnythingToRemove(plan)) {
155
200
  this.reportNothingToUninstall();
156
201
  return;
157
202
  }
158
- const confirmed = flags.yes ? this.printRemovalPlan(target) : await this.confirmRemoval(target);
203
+ const confirmed = flags.yes ? this.printRemovalPlan(plan) : await this.confirmRemoval(plan);
159
204
  if (!confirmed) {
160
205
  this.log("");
161
206
  this.log("Uninstall cancelled");
162
207
  this.exit(EXIT_CODES.CANCELLED);
163
208
  }
164
- await this.executeUninstall(target, projectDir);
209
+ await this.executeUninstall(plan, target, projectDir);
165
210
  this.reportSuccess();
166
211
  }
167
212
  printHeader() {
@@ -176,45 +221,42 @@ var Uninstall = class _Uninstall extends BaseCommand {
176
221
  this.log("");
177
222
  this.log(INFO_MESSAGES.NO_CHANGES_MADE);
178
223
  }
179
- printRemovalPlan(target) {
180
- this.log("The following will be removed:");
224
+ printRemovalPlan(plan) {
225
+ this.log(UNINSTALL_PLAN.PREVIEW_HEADING);
181
226
  this.log("");
182
- for (const section of buildRemovalPlan(target)) {
227
+ for (const section of planSections(plan.entries)) {
183
228
  this.log(` ${section.label}`);
184
229
  for (const item of section.items) {
185
230
  this.log(` ${item}`);
186
231
  }
187
232
  }
233
+ for (const statement of plan.kept) {
234
+ this.log("");
235
+ this.log(statement);
236
+ }
188
237
  this.log("");
189
238
  return true;
190
239
  }
191
- async confirmRemoval(target) {
192
- const outcome = await promptConfirm(({ onConfirm, onCancel }) => /* @__PURE__ */ jsx(UninstallConfirm, { target, onConfirm, onCancel }));
240
+ async confirmRemoval(plan) {
241
+ const outcome = await promptConfirm(({ onConfirm, onCancel }) => /* @__PURE__ */ jsx(
242
+ RemovalPlanConfirm,
243
+ {
244
+ heading: UNINSTALL_PLAN.PREVIEW_HEADING,
245
+ sections: planSections(plan.entries),
246
+ statements: plan.kept,
247
+ message: UNINSTALL_CONFIRM_MESSAGE,
248
+ onConfirm,
249
+ onCancel
250
+ }
251
+ ));
193
252
  return outcome === "confirmed";
194
253
  }
195
- async executeUninstall(target, projectDir) {
254
+ async executeUninstall(plan, target, projectDir) {
196
255
  const isGlobalUninstall = isHomeDirectory(projectDir);
197
256
  const propagation = isGlobalUninstall ? await this.prepareGlobalPropagation(target, projectDir) : null;
198
- if (target.hasPlugins) {
199
- this.log("Uninstalling plugins...");
200
- try {
201
- const pluginResult = await uninstallPlugins(
202
- target,
203
- projectDir,
204
- (name) => this.log(` Uninstalled plugin '${name}'`)
205
- );
206
- this.logSuccess(
207
- `Uninstalled ${pluginResult.totalUninstalled} ${pluginResult.totalUninstalled === 1 ? "plugin" : "plugins"}`
208
- );
209
- } catch (error) {
210
- this.log("Plugin uninstall failed");
211
- this.error(getErrorMessage(error), {
212
- exit: EXIT_CODES.ERROR
213
- });
214
- }
215
- }
257
+ await this.removePlannedPlugins(planEntry(plan, "plugins"), target.config, projectDir);
216
258
  try {
217
- await this.removeLocalFiles(target);
259
+ await this.removeLocalFiles(plan, target);
218
260
  } catch (error) {
219
261
  this.log("Failed to remove local files");
220
262
  this.error(getErrorMessage(error), {
@@ -260,7 +302,7 @@ var Uninstall = class _Uninstall extends BaseCommand {
260
302
  skipExtraSources: true,
261
303
  matrixOnly: true
262
304
  }),
263
- loadAgentDefs({ projectDir })
305
+ loadAgentDefs()
264
306
  ]);
265
307
  return { globalConfig, matrix: sourceResult.matrix, agents: agentDefs.agents };
266
308
  } catch (error) {
@@ -299,27 +341,17 @@ var Uninstall = class _Uninstall extends BaseCommand {
299
341
  this.logSuccess(SUCCESS_MESSAGES.UNINSTALL_COMPLETE);
300
342
  this.log("");
301
343
  }
302
- async removeLocalFiles(target) {
303
- const skillResult = await removeMatchingSkills(
304
- target,
305
- (dirName) => this.log(` Uninstalled skill '${dirName}'`),
306
- (dirName) => this.warn(`Skipping '${dirName}': not created by ${DEFAULT_BRANDING.NAME} CLI`)
307
- );
308
- if (skillResult.removedCount > 0) {
309
- this.logSuccess(
310
- `Removed ${skillResult.removedCount} CLI-installed ${skillResult.removedCount === 1 ? "skill" : "skills"}`
311
- );
312
- }
313
- const agentResult = await removeMatchingAgents(
314
- target,
315
- (agentName) => this.log(` Uninstalled agent '${agentName}'`)
316
- );
317
- if (agentResult.removedCount > 0) {
318
- this.logSuccess(
319
- `Removed ${agentResult.removedCount} compiled ${agentResult.removedCount === 1 ? "agent" : "agents"}`
320
- );
344
+ /**
345
+ * Each step acts only when the plan carries its entry, so what the user was shown and
346
+ * what this run removes are the same list read twice.
347
+ */
348
+ async removeLocalFiles(plan, target) {
349
+ await this.removePlannedSkills(planEntry(plan, "skills"));
350
+ await this.removePlannedAgents(planEntry(plan, "agents"));
351
+ for (const statement of plan.kept) {
352
+ this.log(statement);
321
353
  }
322
- const cleanup = await cleanupEmptyDirs(target);
354
+ const cleanup = await cleanupEmptyDirs(target, planEntry(plan, "config"));
323
355
  if (cleanup.claudeSrcDirRemoved) {
324
356
  this.logSuccess(`Removed ${CLAUDE_SRC_DIR}/`);
325
357
  } else if (cleanup.claudeSrcManifestRemoved) {
@@ -331,24 +363,64 @@ var Uninstall = class _Uninstall extends BaseCommand {
331
363
  this.log(`Kept ${CLAUDE_DIR}/ (contains user content)`);
332
364
  }
333
365
  }
366
+ async removePlannedPlugins(entry, config, projectDir) {
367
+ if (!entry) return;
368
+ this.log("Uninstalling plugins...");
369
+ try {
370
+ const pluginResult = await uninstallPlugins(
371
+ entry,
372
+ config,
373
+ projectDir,
374
+ (name) => this.log(` Uninstalled plugin '${name}'`)
375
+ );
376
+ this.logSuccess(
377
+ `Uninstalled ${pluginResult.totalUninstalled} ${pluginResult.totalUninstalled === 1 ? "plugin" : "plugins"}`
378
+ );
379
+ } catch (error) {
380
+ this.log("Plugin uninstall failed");
381
+ this.error(getErrorMessage(error), {
382
+ exit: EXIT_CODES.ERROR
383
+ });
384
+ }
385
+ }
386
+ async removePlannedSkills(entry) {
387
+ if (!entry) return;
388
+ const result = await removeMatchingSkills(
389
+ entry,
390
+ (dirName) => this.log(` Uninstalled skill '${dirName}'`),
391
+ (dirName) => this.warn(`Skipping '${dirName}': not created by ${DEFAULT_BRANDING.NAME} CLI`)
392
+ );
393
+ if (result.removedCount === 0) return;
394
+ this.logSuccess(
395
+ `Removed ${result.removedCount} CLI-installed ${result.removedCount === 1 ? "skill" : "skills"}`
396
+ );
397
+ }
398
+ async removePlannedAgents(entry) {
399
+ if (!entry) return;
400
+ const result = await removeMatchingAgents(
401
+ entry,
402
+ (agentName) => this.log(` Uninstalled agent '${agentName}'`)
403
+ );
404
+ if (result.removedCount === 0) return;
405
+ this.logSuccess(
406
+ `Removed ${result.removedCount} compiled ${result.removedCount === 1 ? "agent" : "agents"}`
407
+ );
408
+ }
334
409
  };
335
- function hasAnythingToRemove(target) {
336
- return target.hasPlugins || target.hasLocalSkills || target.hasLocalAgents || target.hasClaudeSrcConfig || target.hasClaudeSrcConfigTypes;
337
- }
338
410
  function collectConfiguredAgents(config) {
339
411
  if (!config?.agents) return [];
340
412
  return config.agents.map((a) => a.name);
341
413
  }
342
414
  function getCliInstalledPluginKeys(config) {
343
415
  if (!config?.skills) return /* @__PURE__ */ new Set();
344
- const { marketplace } = config;
416
+ const { marketplaceName } = config;
345
417
  return new Set(
346
418
  config.skills.flatMap((skill) => [
347
- // Primary key: skill.id@skill.source
348
- buildMarketplacePluginRef(skill.id, skill.source),
419
+ // Primary key: skill.id@skill.origin
420
+ buildMarketplacePluginRef(skill.id, skill.origin),
349
421
  // Marketplace variant for plugins installed via marketplace where
350
- // skill.source may differ (e.g., "eject" vs the marketplace name)
351
- ...marketplace && skill.source !== marketplace && skill.source !== EJECT_SOURCE ? [buildMarketplacePluginRef(skill.id, marketplace)] : []
422
+ // skill.origin may differ (e.g., "eject" vs the marketplace name)
423
+ ...marketplaceName && skill.origin !== marketplaceName && skill.origin !== EJECT_SOURCE ? [buildMarketplacePluginRef(skill.id, marketplaceName)] : []
352
424
  ])
353
425
  );
354
426
  }
@@ -375,14 +447,16 @@ async function detectUninstallTarget(projectDir, onConfigLoadFailed) {
375
447
  hasClaudeDir,
376
448
  hasClaudeSrcConfig,
377
449
  hasClaudeSrcConfigTypes,
378
- config
450
+ config,
451
+ agentProvenance
379
452
  ] = await Promise.all([
380
453
  directoryExists(skillsDir),
381
454
  directoryExists(agentsDir),
382
455
  directoryExists(claudeDir),
383
456
  fileExists(claudeSrcConfigPath),
384
457
  fileExists(claudeSrcConfigTypesPath),
385
- loadUninstallConfig(projectDir, onConfigLoadFailed)
458
+ loadUninstallConfig(projectDir, onConfigLoadFailed),
459
+ splitAgentsByProvenance(agentsDir)
386
460
  ]);
387
461
  let pluginNames = [];
388
462
  try {
@@ -412,30 +486,23 @@ async function detectUninstallTarget(projectDir, onConfigLoadFailed) {
412
486
  claudeDir,
413
487
  claudeSrcDir,
414
488
  config,
415
- configuredAgents
489
+ configuredAgents,
490
+ markedAgents: agentProvenance.marked,
491
+ unmarkedAgents: agentProvenance.unmarked
416
492
  };
417
493
  }
418
494
  function shouldRemoveSkill(forkedFrom) {
419
495
  return forkedFrom !== null;
420
496
  }
421
- async function removeMatchingSkills(target, onRemoved, onSkipped) {
422
- if (!target.hasLocalSkills) {
423
- return {
424
- removedCount: 0,
425
- skippedCount: 0,
426
- removedNames: [],
427
- skippedNames: [],
428
- dirCleaned: false
429
- };
430
- }
431
- const classified = await classifySkillDirs(target.skillsDir);
497
+ async function removeMatchingSkills(entry, onRemoved, onSkipped) {
498
+ const classified = await classifySkillDirs(entry.skillsDir);
432
499
  const removedNames = await removeClassifiedSkills(
433
500
  classified.toRemove,
434
- target.skillsDir,
501
+ entry.skillsDir,
435
502
  onRemoved
436
503
  );
437
504
  classified.toSkip.forEach((name) => onSkipped?.(name));
438
- const dirCleaned = await cleanupSkillsDir(target.skillsDir, classified.toSkip.length === 0);
505
+ const dirCleaned = await cleanupSkillsDir(entry.skillsDir, classified.toSkip.length === 0);
439
506
  return {
440
507
  removedCount: removedNames.length,
441
508
  skippedCount: classified.toSkip.length,
@@ -466,68 +533,47 @@ async function cleanupSkillsDir(dir, allRemoved) {
466
533
  if (!allRemoved) return false;
467
534
  return removeDirIfEmpty(dir);
468
535
  }
469
- async function removeDirIfEmpty(dir) {
470
- if (!await directoryExists(dir)) return false;
471
- if (!await isDirectoryEmpty(dir)) return false;
472
- await remove(dir);
473
- return true;
474
- }
475
- async function removeMatchingAgents(target, onRemoved) {
476
- if (!target.hasLocalAgents) {
477
- return { removedCount: 0, removedNames: [], dirCleaned: false };
478
- }
479
- if (target.configuredAgents.length === 0) {
480
- return { removedCount: 0, removedNames: [], dirCleaned: false };
481
- }
482
- const agentFiles = await listAgentFiles(target.agentsDir);
483
- const removedNames = agentFiles.map((agentFile) => agentFile.replace(/\.md$/, "")).filter((agentName) => target.configuredAgents.includes(agentName));
536
+ async function removeMatchingAgents(entry, onRemoved) {
537
+ const agentFiles = await listAgentFiles(entry.agentsDir);
538
+ const removedNames = agentFiles.map((agentFile) => agentFile.replace(/\.md$/, "")).filter((agentName) => entry.agentNames.includes(agentName));
484
539
  for (const agentName of removedNames) {
485
- await remove(path.join(target.agentsDir, `${agentName}.md`));
540
+ await remove(path.join(entry.agentsDir, `${agentName}.md`));
486
541
  onRemoved?.(agentName);
487
542
  }
488
- const dirCleaned = await removeDirIfEmpty(target.agentsDir);
543
+ const dirCleaned = await removeDirIfEmpty(entry.agentsDir);
489
544
  return {
490
545
  removedCount: removedNames.length,
491
546
  removedNames,
492
547
  dirCleaned
493
548
  };
494
549
  }
495
- async function uninstallPlugins(target, projectDir, onUninstalled) {
496
- if (!target.hasPlugins) {
497
- return { uninstalledNames: [], totalUninstalled: 0 };
498
- }
550
+ async function uninstallPlugins(entry, config, projectDir, onUninstalled) {
499
551
  const cliAvailable = await isClaudeCLIAvailable();
500
- for (const pluginName of target.cliPluginNames) {
552
+ for (const pluginName of entry.names) {
501
553
  if (cliAvailable) {
502
554
  const skillId = parseMarketplacePluginRef(pluginName);
503
- const skillConfig = target.config?.skills.find((s) => s.id === skillId);
555
+ const skillConfig = config?.skills.find((s) => s.id === skillId);
504
556
  const primaryScope = toClaudePluginScope(skillConfig?.scope);
505
557
  await claudePluginUninstallBestEffort(pluginName, primaryScope, projectDir);
506
558
  }
507
- const pluginPath = path.join(target.pluginsDir, pluginName);
559
+ const pluginPath = path.join(entry.pluginsDir, pluginName);
508
560
  await remove(pluginPath);
509
561
  onUninstalled?.(pluginName);
510
562
  }
511
563
  return {
512
- uninstalledNames: target.cliPluginNames,
513
- totalUninstalled: target.cliPluginNames.length
564
+ uninstalledNames: entry.names,
565
+ totalUninstalled: entry.names.length
514
566
  };
515
567
  }
516
- async function removeConfigManifest(target) {
517
- let manifestRemoved = false;
518
- if (target.hasClaudeSrcConfig) {
519
- await remove(path.join(target.claudeSrcDir, STANDARD_FILES.CONFIG_TS));
520
- manifestRemoved = true;
521
- }
522
- if (target.hasClaudeSrcConfigTypes) {
523
- await remove(path.join(target.claudeSrcDir, STANDARD_FILES.CONFIG_TYPES_TS));
524
- manifestRemoved = true;
525
- }
526
- const dirRemoved = manifestRemoved && await removeDirIfEmpty(target.claudeSrcDir);
527
- return { manifestRemoved, dirRemoved };
568
+ async function removeConfigManifest(entry) {
569
+ if (!entry) return { manifestRemoved: false, dirRemoved: false };
570
+ await Promise.all(
571
+ entry.fileNames.map((fileName) => remove(path.join(entry.claudeSrcDir, fileName)))
572
+ );
573
+ return { manifestRemoved: true, dirRemoved: await removeDirIfEmpty(entry.claudeSrcDir) };
528
574
  }
529
- async function cleanupEmptyDirs(target) {
530
- const manifest = await removeConfigManifest(target);
575
+ async function cleanupEmptyDirs(target, manifestEntry) {
576
+ const manifest = await removeConfigManifest(manifestEntry);
531
577
  const claudeDirRemoved = target.hasClaudeDir && await removeDirIfEmpty(target.claudeDir);
532
578
  const claudeDirKept = !claudeDirRemoved && target.hasClaudeDir && await directoryExists(target.claudeDir);
533
579
  return {
@@ -537,14 +583,6 @@ async function cleanupEmptyDirs(target) {
537
583
  claudeDirKept
538
584
  };
539
585
  }
540
- async function isDirectoryEmpty(dirPath) {
541
- try {
542
- const allEntries = await readdir(dirPath);
543
- return allEntries.length === 0;
544
- } catch {
545
- return true;
546
- }
547
- }
548
586
  async function listAgentFiles(agentsDir) {
549
587
  try {
550
588
  return await listAgentMdFiles(agentsDir);