@agents-inc/cli 0.50.0 → 0.61.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 (237) hide show
  1. package/CHANGELOG.md +167 -5
  2. package/dist/{chunk-KQOU4POU.js → chunk-46DQG2N7.js} +72 -51
  3. package/dist/chunk-46DQG2N7.js.map +1 -0
  4. package/dist/{chunk-2BWCR762.js → chunk-52XO4ULK.js} +6 -8
  5. package/dist/chunk-52XO4ULK.js.map +1 -0
  6. package/dist/{chunk-DCE423KO.js → chunk-6DAZG54T.js} +5 -5
  7. package/dist/{chunk-AWP5A6IM.js → chunk-6OWHQ7HM.js} +14 -12
  8. package/dist/chunk-6OWHQ7HM.js.map +1 -0
  9. package/dist/{chunk-D72AFYQR.js → chunk-7FMEMXJ4.js} +71 -71
  10. package/dist/chunk-7FMEMXJ4.js.map +1 -0
  11. package/dist/{chunk-RA2IPRO2.js → chunk-AJJJE7F7.js} +2 -2
  12. package/dist/{chunk-4R52TQ3K.js → chunk-AX3SZZWA.js} +2 -2
  13. package/dist/{chunk-U2W5SENM.js → chunk-BFD5NZQ4.js} +5 -4
  14. package/dist/chunk-BFD5NZQ4.js.map +1 -0
  15. package/dist/{chunk-HYEUETIC.js → chunk-BKJHAJQW.js} +2 -2
  16. package/dist/{chunk-HYEUETIC.js.map → chunk-BKJHAJQW.js.map} +1 -1
  17. package/dist/{chunk-GBOW6FUW.js → chunk-BNQ5O6LE.js} +2 -2
  18. package/dist/{chunk-KAO3LKB5.js → chunk-C577AJE7.js} +3 -3
  19. package/dist/{chunk-C3Q43WLC.js → chunk-CIG7IKX3.js} +4 -4
  20. package/dist/chunk-EC3UJRKZ.js +1534 -0
  21. package/dist/chunk-EC3UJRKZ.js.map +1 -0
  22. package/dist/{chunk-HMSHB5EQ.js → chunk-FWMWWE3X.js} +3543 -3037
  23. package/dist/chunk-FWMWWE3X.js.map +1 -0
  24. package/dist/{chunk-YDYRAXSY.js → chunk-GH2RQ4MI.js} +6 -6
  25. package/dist/{chunk-5FPIKTSA.js → chunk-H5DASUX5.js} +7 -7
  26. package/dist/{chunk-JFF7P4LC.js → chunk-H7WJK7NJ.js} +22 -6
  27. package/dist/chunk-H7WJK7NJ.js.map +1 -0
  28. package/dist/chunk-HGTC76BX.js +16 -0
  29. package/dist/chunk-HGTC76BX.js.map +1 -0
  30. package/dist/{chunk-WFFV254H.js → chunk-IEEVXLJB.js} +110 -82
  31. package/dist/chunk-IEEVXLJB.js.map +1 -0
  32. package/dist/{chunk-5FCHJLM7.js → chunk-IGM6HA3S.js} +252 -38
  33. package/dist/chunk-IGM6HA3S.js.map +1 -0
  34. package/dist/{chunk-QB5HHTAA.js → chunk-KD2YS76O.js} +28 -12
  35. package/dist/chunk-KD2YS76O.js.map +1 -0
  36. package/dist/{chunk-5L724R4C.js → chunk-KDO6WU76.js} +8 -13
  37. package/dist/chunk-KDO6WU76.js.map +1 -0
  38. package/dist/{chunk-XDSVV5GZ.js → chunk-KIWFEBKH.js} +41 -11
  39. package/dist/chunk-KIWFEBKH.js.map +1 -0
  40. package/dist/{chunk-WBHPCBVN.js → chunk-LWXRUR6B.js} +66 -94
  41. package/dist/chunk-LWXRUR6B.js.map +1 -0
  42. package/dist/{chunk-SPFHPHYL.js → chunk-M6YWRMXH.js} +24 -14
  43. package/dist/chunk-M6YWRMXH.js.map +1 -0
  44. package/dist/{chunk-CMNKHDOX.js → chunk-MGNYPVOJ.js} +2 -2
  45. package/dist/{chunk-U7X4V4HE.js → chunk-MMFQNJPE.js} +2 -2
  46. package/dist/{chunk-WLZHCM7O.js → chunk-MR6OBL3B.js} +3 -11
  47. package/dist/{chunk-WLZHCM7O.js.map → chunk-MR6OBL3B.js.map} +1 -1
  48. package/dist/{chunk-RFKDGJAJ.js → chunk-O6BA7Q2B.js} +6 -6
  49. package/dist/chunk-O6BA7Q2B.js.map +1 -0
  50. package/dist/chunk-OCEFD7V6.js +201 -0
  51. package/dist/chunk-OCEFD7V6.js.map +1 -0
  52. package/dist/{chunk-YZTWZVGX.js → chunk-PUT7X3GA.js} +1 -1
  53. package/dist/chunk-PUT7X3GA.js.map +1 -0
  54. package/dist/{chunk-QYLCINGC.js → chunk-SDKCQXWE.js} +2 -2
  55. package/dist/{chunk-RDWGYKDY.js → chunk-SDLDPFNV.js} +6 -6
  56. package/dist/{chunk-7LV4V6A4.js → chunk-SRBN6RRD.js} +14 -10
  57. package/dist/chunk-SRBN6RRD.js.map +1 -0
  58. package/dist/{chunk-PGY5XROM.js → chunk-VR3CDXDT.js} +2 -6
  59. package/dist/chunk-VR3CDXDT.js.map +1 -0
  60. package/dist/{chunk-I6IOGZSZ.js → chunk-WHISPMAQ.js} +11 -15
  61. package/dist/chunk-WHISPMAQ.js.map +1 -0
  62. package/dist/{chunk-3VOL4WEG.js → chunk-WYVDNGJB.js} +3 -3
  63. package/dist/{chunk-WJHFV6RI.js → chunk-X5EG4EFP.js} +2 -2
  64. package/dist/{chunk-JWYRXE6C.js → chunk-XUDTFI4M.js} +2 -2
  65. package/dist/{chunk-4QWDB2MD.js → chunk-YHOHLNHM.js} +127 -105
  66. package/dist/chunk-YHOHLNHM.js.map +1 -0
  67. package/dist/{chunk-M3GQ2R3E.js → chunk-Z3TM4N37.js} +19 -7
  68. package/dist/chunk-Z3TM4N37.js.map +1 -0
  69. package/dist/commands/build/marketplace.js +4 -4
  70. package/dist/commands/build/plugins.js +9 -7
  71. package/dist/commands/build/plugins.js.map +1 -1
  72. package/dist/commands/build/stack.js +13 -10
  73. package/dist/commands/build/stack.js.map +1 -1
  74. package/dist/commands/compile.js +110 -129
  75. package/dist/commands/compile.js.map +1 -1
  76. package/dist/commands/config/index.js +7 -5
  77. package/dist/commands/config/index.js.map +1 -1
  78. package/dist/commands/config/path.js +8 -6
  79. package/dist/commands/config/path.js.map +1 -1
  80. package/dist/commands/config/show.js +7 -5
  81. package/dist/commands/diff.js +9 -7
  82. package/dist/commands/diff.js.map +1 -1
  83. package/dist/commands/doctor.js +20 -16
  84. package/dist/commands/doctor.js.map +1 -1
  85. package/dist/commands/edit.js +175 -79
  86. package/dist/commands/edit.js.map +1 -1
  87. package/dist/commands/eject.js +20 -41
  88. package/dist/commands/eject.js.map +1 -1
  89. package/dist/commands/import/skill.js +10 -18
  90. package/dist/commands/import/skill.js.map +1 -1
  91. package/dist/commands/info.js +21 -20
  92. package/dist/commands/info.js.map +1 -1
  93. package/dist/commands/init.js +32 -31
  94. package/dist/commands/list.js +8 -6
  95. package/dist/commands/list.js.map +1 -1
  96. package/dist/commands/new/agent.js +23 -11
  97. package/dist/commands/new/agent.js.map +1 -1
  98. package/dist/commands/new/marketplace.js +63 -46
  99. package/dist/commands/new/marketplace.js.map +1 -1
  100. package/dist/commands/new/skill.js +11 -9
  101. package/dist/commands/outdated.js +9 -7
  102. package/dist/commands/outdated.js.map +1 -1
  103. package/dist/commands/search.js +45 -35
  104. package/dist/commands/search.js.map +1 -1
  105. package/dist/commands/uninstall.js +93 -123
  106. package/dist/commands/uninstall.js.map +1 -1
  107. package/dist/commands/update.js +11 -9
  108. package/dist/commands/update.js.map +1 -1
  109. package/dist/commands/validate.js +23 -27
  110. package/dist/commands/validate.js.map +1 -1
  111. package/dist/components/common/confirm.test.js +4 -4
  112. package/dist/components/skill-search/skill-search.js +3 -3
  113. package/dist/components/wizard/category-grid.js +3 -3
  114. package/dist/components/wizard/category-grid.test.js +4 -4
  115. package/dist/components/wizard/category-grid.test.js.map +1 -1
  116. package/dist/components/wizard/checkbox-grid.js +5 -5
  117. package/dist/components/wizard/checkbox-grid.test.js +6 -6
  118. package/dist/components/wizard/domain-selection.js +12 -11
  119. package/dist/components/wizard/help-modal.js +2 -2
  120. package/dist/components/wizard/menu-item.js +1 -1
  121. package/dist/components/wizard/search-modal.js +2 -2
  122. package/dist/components/wizard/search-modal.test.js +3 -3
  123. package/dist/components/wizard/search-modal.test.js.map +1 -1
  124. package/dist/components/wizard/section-progress.js +2 -2
  125. package/dist/components/wizard/section-progress.test.js +4 -4
  126. package/dist/components/wizard/section-progress.test.js.map +1 -1
  127. package/dist/components/wizard/selection-card.js +2 -2
  128. package/dist/components/wizard/source-grid.js +4 -4
  129. package/dist/components/wizard/source-grid.test.js +5 -5
  130. package/dist/components/wizard/source-grid.test.js.map +1 -1
  131. package/dist/components/wizard/stack-selection.js +9 -8
  132. package/dist/components/wizard/step-agents.js +11 -10
  133. package/dist/components/wizard/step-agents.test.js +13 -12
  134. package/dist/components/wizard/step-agents.test.js.map +1 -1
  135. package/dist/components/wizard/step-build.js +11 -9
  136. package/dist/components/wizard/step-build.test.js +18 -22
  137. package/dist/components/wizard/step-build.test.js.map +1 -1
  138. package/dist/components/wizard/step-confirm.js +4 -4
  139. package/dist/components/wizard/step-confirm.test.js +83 -23
  140. package/dist/components/wizard/step-confirm.test.js.map +1 -1
  141. package/dist/components/wizard/step-refine.js +2 -2
  142. package/dist/components/wizard/step-refine.test.js +3 -3
  143. package/dist/components/wizard/step-settings.js +9 -7
  144. package/dist/components/wizard/step-settings.test.js +13 -11
  145. package/dist/components/wizard/step-settings.test.js.map +1 -1
  146. package/dist/components/wizard/step-sources.js +13 -11
  147. package/dist/components/wizard/step-sources.test.js +19 -17
  148. package/dist/components/wizard/step-sources.test.js.map +1 -1
  149. package/dist/components/wizard/step-stack.js +15 -14
  150. package/dist/components/wizard/step-stack.test.js +17 -16
  151. package/dist/components/wizard/step-stack.test.js.map +1 -1
  152. package/dist/components/wizard/view-title.js +2 -2
  153. package/dist/components/wizard/wizard-layout.js +10 -8
  154. package/dist/components/wizard/wizard-tabs.js +2 -2
  155. package/dist/components/wizard/wizard-tabs.test.js +2 -2
  156. package/dist/components/wizard/wizard.js +29 -27
  157. package/dist/config-exports.js +20 -0
  158. package/dist/config-exports.js.map +1 -0
  159. package/dist/hooks/init.js +34 -33
  160. package/dist/hooks/init.js.map +1 -1
  161. package/dist/loader-2O32KKAQ.js +19 -0
  162. package/dist/source-loader-KMEBBZCQ.js +16 -0
  163. package/dist/source-loader-KMEBBZCQ.js.map +1 -0
  164. package/dist/source-manager-5XBSPJNR.js +18 -0
  165. package/dist/source-manager-5XBSPJNR.js.map +1 -0
  166. package/dist/src/agents/meta/agent-summoner/workflow.md +3 -3
  167. package/dist/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
  168. package/dist/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
  169. package/dist/src/agents/meta/skill-summoner/intro.md +1 -1
  170. package/dist/src/agents/meta/skill-summoner/output-format.md +3 -3
  171. package/dist/src/agents/meta/skill-summoner/workflow.md +8 -8
  172. package/dist/stores/wizard-store.js +6 -5
  173. package/dist/stores/wizard-store.test.js +299 -59
  174. package/dist/stores/wizard-store.test.js.map +1 -1
  175. package/package.json +5 -1
  176. package/src/agents/meta/agent-summoner/workflow.md +3 -3
  177. package/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
  178. package/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
  179. package/src/agents/meta/skill-summoner/intro.md +1 -1
  180. package/src/agents/meta/skill-summoner/output-format.md +3 -3
  181. package/src/agents/meta/skill-summoner/workflow.md +8 -8
  182. package/src/schemas/metadata.schema.json +6 -0
  183. package/src/schemas/stacks.schema.json +1 -1
  184. package/config/skill-categories.yaml +0 -344
  185. package/config/skill-rules.yaml +0 -740
  186. package/config/stacks.yaml +0 -1864
  187. package/dist/chunk-26MXZUHU.js +0 -183
  188. package/dist/chunk-26MXZUHU.js.map +0 -1
  189. package/dist/chunk-2BWCR762.js.map +0 -1
  190. package/dist/chunk-4QWDB2MD.js.map +0 -1
  191. package/dist/chunk-5FCHJLM7.js.map +0 -1
  192. package/dist/chunk-5L724R4C.js.map +0 -1
  193. package/dist/chunk-7LV4V6A4.js.map +0 -1
  194. package/dist/chunk-AWP5A6IM.js.map +0 -1
  195. package/dist/chunk-D72AFYQR.js.map +0 -1
  196. package/dist/chunk-HMSHB5EQ.js.map +0 -1
  197. package/dist/chunk-I6IOGZSZ.js.map +0 -1
  198. package/dist/chunk-JFF7P4LC.js.map +0 -1
  199. package/dist/chunk-KQOU4POU.js.map +0 -1
  200. package/dist/chunk-M3GQ2R3E.js.map +0 -1
  201. package/dist/chunk-PGY5XROM.js.map +0 -1
  202. package/dist/chunk-QB5HHTAA.js.map +0 -1
  203. package/dist/chunk-RFKDGJAJ.js.map +0 -1
  204. package/dist/chunk-SPFHPHYL.js.map +0 -1
  205. package/dist/chunk-U2W5SENM.js.map +0 -1
  206. package/dist/chunk-UAD3SC27.js +0 -107
  207. package/dist/chunk-UAD3SC27.js.map +0 -1
  208. package/dist/chunk-WBHPCBVN.js.map +0 -1
  209. package/dist/chunk-WFFV254H.js.map +0 -1
  210. package/dist/chunk-XDSVV5GZ.js.map +0 -1
  211. package/dist/chunk-YZTWZVGX.js.map +0 -1
  212. package/dist/commands/config/get.js +0 -61
  213. package/dist/commands/config/get.js.map +0 -1
  214. package/dist/commands/config/set-project.js +0 -61
  215. package/dist/commands/config/set-project.js.map +0 -1
  216. package/dist/commands/config/unset-project.js +0 -57
  217. package/dist/commands/config/unset-project.js.map +0 -1
  218. package/dist/config/skill-categories.yaml +0 -344
  219. package/dist/config/skill-rules.yaml +0 -740
  220. package/dist/config/stacks.yaml +0 -1864
  221. package/dist/source-manager-BVB2SG73.js +0 -16
  222. /package/dist/{chunk-DCE423KO.js.map → chunk-6DAZG54T.js.map} +0 -0
  223. /package/dist/{chunk-RA2IPRO2.js.map → chunk-AJJJE7F7.js.map} +0 -0
  224. /package/dist/{chunk-4R52TQ3K.js.map → chunk-AX3SZZWA.js.map} +0 -0
  225. /package/dist/{chunk-GBOW6FUW.js.map → chunk-BNQ5O6LE.js.map} +0 -0
  226. /package/dist/{chunk-KAO3LKB5.js.map → chunk-C577AJE7.js.map} +0 -0
  227. /package/dist/{chunk-C3Q43WLC.js.map → chunk-CIG7IKX3.js.map} +0 -0
  228. /package/dist/{chunk-YDYRAXSY.js.map → chunk-GH2RQ4MI.js.map} +0 -0
  229. /package/dist/{chunk-5FPIKTSA.js.map → chunk-H5DASUX5.js.map} +0 -0
  230. /package/dist/{chunk-CMNKHDOX.js.map → chunk-MGNYPVOJ.js.map} +0 -0
  231. /package/dist/{chunk-U7X4V4HE.js.map → chunk-MMFQNJPE.js.map} +0 -0
  232. /package/dist/{chunk-QYLCINGC.js.map → chunk-SDKCQXWE.js.map} +0 -0
  233. /package/dist/{chunk-RDWGYKDY.js.map → chunk-SDLDPFNV.js.map} +0 -0
  234. /package/dist/{chunk-3VOL4WEG.js.map → chunk-WYVDNGJB.js.map} +0 -0
  235. /package/dist/{chunk-WJHFV6RI.js.map → chunk-X5EG4EFP.js.map} +0 -0
  236. /package/dist/{chunk-JWYRXE6C.js.map → chunk-XUDTFI4M.js.map} +0 -0
  237. /package/dist/{source-manager-BVB2SG73.js.map → loader-2O32KKAQ.js.map} +0 -0
@@ -1,82 +1,92 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- getAgentDefinitions,
4
- recompileAgents
5
- } from "../chunk-7LV4V6A4.js";
6
2
  import {
7
3
  Wizard
8
- } from "../chunk-KQOU4POU.js";
9
- import "../chunk-I6IOGZSZ.js";
10
- import "../chunk-U7X4V4HE.js";
11
- import "../chunk-YDYRAXSY.js";
12
- import "../chunk-SPFHPHYL.js";
13
- import "../chunk-5FPIKTSA.js";
14
- import "../chunk-DCE423KO.js";
15
- import "../chunk-M3GQ2R3E.js";
16
- import "../chunk-QB5HHTAA.js";
4
+ } from "../chunk-46DQG2N7.js";
5
+ import "../chunk-GH2RQ4MI.js";
6
+ import "../chunk-M6YWRMXH.js";
7
+ import "../chunk-H5DASUX5.js";
8
+ import "../chunk-WHISPMAQ.js";
9
+ import "../chunk-MMFQNJPE.js";
10
+ import "../chunk-HGTC76BX.js";
11
+ import "../chunk-Z3TM4N37.js";
12
+ import "../chunk-KD2YS76O.js";
17
13
  import "../chunk-K77I4XGL.js";
18
- import "../chunk-XDSVV5GZ.js";
19
- import "../chunk-2BWCR762.js";
20
- import "../chunk-WJHFV6RI.js";
21
- import "../chunk-RFKDGJAJ.js";
14
+ import "../chunk-KIWFEBKH.js";
15
+ import "../chunk-O6BA7Q2B.js";
22
16
  import "../chunk-7SOPVGDV.js";
23
- import "../chunk-QYLCINGC.js";
17
+ import "../chunk-SDKCQXWE.js";
24
18
  import "../chunk-KUV24B5M.js";
25
- import "../chunk-JFF7P4LC.js";
19
+ import "../chunk-6DAZG54T.js";
20
+ import "../chunk-X5EG4EFP.js";
21
+ import "../chunk-H7WJK7NJ.js";
26
22
  import "../chunk-GG4BSB6S.js";
27
- import "../chunk-5L724R4C.js";
28
- import "../chunk-HYEUETIC.js";
29
- import "../chunk-C3Q43WLC.js";
30
- import "../chunk-3VOL4WEG.js";
31
- import "../chunk-CMNKHDOX.js";
32
- import "../chunk-GBOW6FUW.js";
33
- import "../chunk-JWYRXE6C.js";
23
+ import "../chunk-KDO6WU76.js";
24
+ import "../chunk-BKJHAJQW.js";
25
+ import "../chunk-CIG7IKX3.js";
26
+ import "../chunk-WYVDNGJB.js";
27
+ import "../chunk-MGNYPVOJ.js";
28
+ import "../chunk-BNQ5O6LE.js";
29
+ import "../chunk-52XO4ULK.js";
30
+ import "../chunk-IGM6HA3S.js";
31
+ import "../chunk-XUDTFI4M.js";
34
32
  import "../chunk-U3IGFMCY.js";
35
33
  import {
36
- claudePluginInstall,
37
- claudePluginUninstall
38
- } from "../chunk-26MXZUHU.js";
39
- import "../chunk-5FCHJLM7.js";
40
- import "../chunk-UAD3SC27.js";
34
+ getAgentDefinitions,
35
+ recompileAgents
36
+ } from "../chunk-SRBN6RRD.js";
41
37
  import {
42
38
  ERROR_MESSAGES,
43
39
  INFO_MESSAGES,
44
40
  STATUS_MESSAGES
45
- } from "../chunk-WLZHCM7O.js";
41
+ } from "../chunk-MR6OBL3B.js";
46
42
  import {
47
- BaseCommand,
48
- EXIT_CODES
49
- } from "../chunk-PGY5XROM.js";
50
- import {
51
- archiveLocalSkill,
43
+ buildAndMergeConfig,
44
+ claudePluginInstall,
45
+ claudePluginUninstall,
46
+ deleteLocalSkill,
47
+ deriveInstallMode,
52
48
  detectInstallation,
49
+ detectMigrations,
53
50
  discoverAllPluginSkills,
51
+ executeMigration,
54
52
  getMarketplaceLabel,
55
53
  loadProjectConfig,
56
54
  loadSkillsMatrixFromSource,
57
- restoreArchivedSkill
58
- } from "../chunk-HMSHB5EQ.js";
55
+ migrateLocalSkillScope,
56
+ splitConfigByScope,
57
+ writeConfigFile
58
+ } from "../chunk-FWMWWE3X.js";
59
+ import "../chunk-OCEFD7V6.js";
60
+ import "../chunk-T4EXUIBY.js";
59
61
  import {
60
- typedEntries
61
- } from "../chunk-T4EXUIBY.js";
62
+ BaseCommand,
63
+ EXIT_CODES
64
+ } from "../chunk-VR3CDXDT.js";
62
65
  import {
63
66
  disableBuffering,
64
67
  drainBuffer,
65
68
  enableBuffering,
66
69
  getErrorMessage,
67
- pushBufferMessage
68
- } from "../chunk-WBHPCBVN.js";
70
+ pushBufferMessage,
71
+ verbose
72
+ } from "../chunk-LWXRUR6B.js";
69
73
  import {
70
74
  ASCII_LOGO,
75
+ CLAUDE_SRC_DIR,
71
76
  CLI_BIN_NAME,
72
- SOURCE_DISPLAY_NAMES
73
- } from "../chunk-AWP5A6IM.js";
77
+ GLOBAL_INSTALL_ROOT,
78
+ SOURCE_DISPLAY_NAMES,
79
+ STANDARD_FILES
80
+ } from "../chunk-6OWHQ7HM.js";
81
+ import "../chunk-EC3UJRKZ.js";
74
82
  import {
75
83
  init_esm_shims
76
84
  } from "../chunk-DHET7RCE.js";
77
85
 
78
86
  // src/cli/commands/edit.tsx
79
87
  init_esm_shims();
88
+ import os from "os";
89
+ import path from "path";
80
90
  import { Flags } from "@oclif/core";
81
91
  import { render } from "ink";
82
92
  import { jsx } from "react/jsx-runtime";
@@ -119,12 +129,13 @@ var Edit = class _Edit extends BaseCommand {
119
129
  });
120
130
  }
121
131
  const projectDir = installation.projectDir;
122
- const isPluginMode = installation.mode === "plugin";
123
- const pluginScope = installation.scope === "global" ? "user" : "project";
124
- if (installation.scope === "global") {
125
- this.log("No project installation found. Using global installation from ~/.claude-src/\n");
126
- }
127
132
  enableBuffering();
133
+ if (installation.projectDir === os.homedir()) {
134
+ pushBufferMessage(
135
+ "info",
136
+ "No project installation found. Using global installation from ~/.claude-src/"
137
+ );
138
+ }
128
139
  let sourceResult;
129
140
  let startupMessages = [];
130
141
  try {
@@ -148,7 +159,7 @@ var Edit = class _Edit extends BaseCommand {
148
159
  const discoveredSkills = await discoverAllPluginSkills(projectDir);
149
160
  currentSkillIds = Object.keys(discoveredSkills);
150
161
  if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {
151
- currentSkillIds = projectConfig.config.skills;
162
+ currentSkillIds = projectConfig.config.skills.map((s) => s.id);
152
163
  pushBufferMessage("info", `Found ${currentSkillIds.length} skills from project config`);
153
164
  } else {
154
165
  pushBufferMessage("info", `Current plugin has ${currentSkillIds.length} skills`);
@@ -161,8 +172,9 @@ var Edit = class _Edit extends BaseCommand {
161
172
  disableBuffering();
162
173
  let wizardResult = null;
163
174
  const marketplaceLabel = getMarketplaceLabel(sourceResult);
164
- const savedInstallMode = projectConfig?.config?.installMode;
165
- const initialInstallMode = savedInstallMode ?? (sourceResult.marketplace ? "plugin" : "local");
175
+ const isGlobalDir = projectDir === GLOBAL_INSTALL_ROOT;
176
+ const lockedSkillIds = isGlobalDir ? void 0 : projectConfig?.config?.skills?.filter((s) => s.scope === "global").map((s) => s.id);
177
+ const lockedAgentNames = isGlobalDir ? void 0 : projectConfig?.config?.agents?.filter((a) => a.scope === "global").map((a) => a.name);
166
178
  const { waitUntilExit } = render(
167
179
  /* @__PURE__ */ jsx(
168
180
  Wizard,
@@ -172,10 +184,12 @@ var Edit = class _Edit extends BaseCommand {
172
184
  marketplaceLabel,
173
185
  logo: ASCII_LOGO,
174
186
  initialStep: "build",
175
- initialInstallMode,
176
187
  initialDomains: projectConfig?.config?.domains,
177
188
  initialAgents: projectConfig?.config?.selectedAgents,
178
189
  installedSkillIds: currentSkillIds,
190
+ installedSkillConfigs: projectConfig?.config?.skills,
191
+ lockedSkillIds,
192
+ lockedAgentNames,
179
193
  projectDir,
180
194
  startupMessages,
181
195
  onComplete: (result2) => {
@@ -199,30 +213,32 @@ var Edit = class _Edit extends BaseCommand {
199
213
  exit: EXIT_CODES.ERROR
200
214
  });
201
215
  }
202
- const addedSkills = result.selectedSkills.filter((id) => !currentSkillIds.includes(id));
203
- const removedSkills = currentSkillIds.filter((id) => !result.selectedSkills.includes(id));
216
+ const newSkillIds = result.skills.map((s) => s.id);
217
+ const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));
218
+ const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));
204
219
  const sourceChanges = /* @__PURE__ */ new Map();
205
- for (const [skillId, selectedSource] of typedEntries(
206
- result.sourceSelections
207
- )) {
208
- const skill = sourceResult.matrix.skills[skillId];
209
- if (skill?.activeSource && skill.activeSource.name !== selectedSource) {
210
- sourceChanges.set(skillId, {
211
- from: skill.activeSource.name,
212
- to: selectedSource
213
- });
220
+ const scopeChanges = /* @__PURE__ */ new Map();
221
+ if (projectConfig?.config?.skills) {
222
+ for (const newSkill of result.skills) {
223
+ const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);
224
+ if (oldSkill && oldSkill.source !== newSkill.source) {
225
+ sourceChanges.set(newSkill.id, {
226
+ from: oldSkill.source,
227
+ to: newSkill.source
228
+ });
229
+ }
230
+ if (oldSkill && oldSkill.scope !== newSkill.scope) {
231
+ scopeChanges.set(newSkill.id, {
232
+ from: oldSkill.scope,
233
+ to: newSkill.scope
234
+ });
235
+ }
214
236
  }
215
237
  }
216
238
  const hasSourceChanges = sourceChanges.size > 0;
239
+ const hasScopeChanges = scopeChanges.size > 0;
217
240
  const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;
218
- if (result.validation.warnings.length > 0) {
219
- this.log("\nWarnings:");
220
- for (const warning of result.validation.warnings) {
221
- this.warn(` ! ${warning.message}`);
222
- }
223
- this.log("");
224
- }
225
- if (!hasSkillChanges && !hasSourceChanges) {
241
+ if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges) {
226
242
  this.log(INFO_MESSAGES.NO_CHANGES_MADE);
227
243
  this.log("Plugin unchanged\n");
228
244
  return;
@@ -241,18 +257,67 @@ var Edit = class _Edit extends BaseCommand {
241
257
  const toLabel = formatSourceDisplayName(change.to);
242
258
  this.log(` ~ ${skillId} (${fromLabel} \u2192 ${toLabel})`);
243
259
  }
260
+ for (const [skillId, change] of scopeChanges) {
261
+ const fromLabel = change.from === "global" ? "[G]" : "[P]";
262
+ const toLabel = change.to === "global" ? "[G]" : "[P]";
263
+ this.log(` ~ ${skillId} (${fromLabel} \u2192 ${toLabel})`);
264
+ }
244
265
  this.log("");
266
+ const oldSkills = projectConfig?.config?.skills ?? [];
267
+ const migrationPlan = detectMigrations(oldSkills, result.skills);
268
+ const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;
269
+ if (hasMigrations) {
270
+ if (migrationPlan.toLocal.length > 0) {
271
+ this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);
272
+ for (const migration of migrationPlan.toLocal) {
273
+ this.log(` - ${migration.id}`);
274
+ }
275
+ }
276
+ if (migrationPlan.toPlugin.length > 0) {
277
+ this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);
278
+ for (const migration of migrationPlan.toPlugin) {
279
+ this.log(` - ${migration.id}`);
280
+ }
281
+ }
282
+ const migrationResult = await executeMigration(migrationPlan, projectDir, sourceResult);
283
+ for (const warning of migrationResult.warnings) {
284
+ this.warn(warning);
285
+ }
286
+ }
287
+ const migratedSkillIds = /* @__PURE__ */ new Set([
288
+ ...migrationPlan.toLocal.map((m) => m.id),
289
+ ...migrationPlan.toPlugin.map((m) => m.id)
290
+ ]);
291
+ for (const [skillId, change] of scopeChanges) {
292
+ const skillConfig = result.skills.find((s) => s.id === skillId);
293
+ if (skillConfig?.source === "local") {
294
+ await migrateLocalSkillScope(skillId, change.from, projectDir);
295
+ } else if (sourceResult.marketplace && skillConfig) {
296
+ const oldPluginScope = change.from === "global" ? "user" : "project";
297
+ const newPluginScope = change.to === "global" ? "user" : "project";
298
+ try {
299
+ await claudePluginUninstall(skillId, oldPluginScope, projectDir);
300
+ const pluginRef = `${skillId}@${sourceResult.marketplace}`;
301
+ await claudePluginInstall(pluginRef, newPluginScope, projectDir);
302
+ } catch (error) {
303
+ this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);
304
+ }
305
+ }
306
+ }
245
307
  for (const [skillId, change] of sourceChanges) {
246
- if (change.from === "local") {
247
- await archiveLocalSkill(projectDir, skillId);
308
+ if (migratedSkillIds.has(skillId)) {
309
+ continue;
248
310
  }
249
- if (change.to === "local") {
250
- await restoreArchivedSkill(projectDir, skillId);
311
+ if (change.from === "local") {
312
+ await deleteLocalSkill(projectDir, skillId);
251
313
  }
252
314
  }
253
- if (isPluginMode && sourceResult.marketplace) {
315
+ if (sourceResult.marketplace) {
254
316
  for (const skillId of addedSkills) {
317
+ const skillConfig = result.skills.find((s) => s.id === skillId);
318
+ if (!skillConfig || skillConfig.source === "local") continue;
255
319
  const pluginRef = `${skillId}@${sourceResult.marketplace}`;
320
+ const pluginScope = skillConfig.scope === "global" ? "user" : "project";
256
321
  this.log(`Installing plugin: ${pluginRef}...`);
257
322
  try {
258
323
  await claudePluginInstall(pluginRef, pluginScope, projectDir);
@@ -261,6 +326,8 @@ var Edit = class _Edit extends BaseCommand {
261
326
  }
262
327
  }
263
328
  for (const skillId of removedSkills) {
329
+ const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);
330
+ const pluginScope = oldSkill?.scope === "global" ? "user" : "project";
264
331
  this.log(`Uninstalling plugin: ${skillId}...`);
265
332
  try {
266
333
  await claudePluginUninstall(skillId, pluginScope, projectDir);
@@ -269,6 +336,31 @@ var Edit = class _Edit extends BaseCommand {
269
336
  }
270
337
  }
271
338
  }
339
+ const isGlobalContext = projectDir === GLOBAL_INSTALL_ROOT;
340
+ try {
341
+ const mergeResult = await buildAndMergeConfig(result, sourceResult, projectDir, flags.source);
342
+ if (isGlobalContext) {
343
+ await writeConfigFile(mergeResult.config, installation.configPath);
344
+ verbose(`Updated global config at ${installation.configPath}`);
345
+ } else {
346
+ const { global: globalConfig, project: projectSplitConfig } = splitConfigByScope(
347
+ mergeResult.config
348
+ );
349
+ const globalConfigPath = path.join(
350
+ GLOBAL_INSTALL_ROOT,
351
+ CLAUDE_SRC_DIR,
352
+ STANDARD_FILES.CONFIG_TS
353
+ );
354
+ await writeConfigFile(globalConfig, globalConfigPath);
355
+ verbose(`Updated global config at ${globalConfigPath}`);
356
+ await writeConfigFile(projectSplitConfig, installation.configPath, {
357
+ isProjectConfig: true
358
+ });
359
+ verbose(`Updated project config at ${installation.configPath}`);
360
+ }
361
+ } catch (error) {
362
+ this.warn(`Could not update config: ${getErrorMessage(error)}`);
363
+ }
272
364
  let sourcePath;
273
365
  this.log(
274
366
  flags["agent-source"] ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS : STATUS_MESSAGES.LOADING_AGENT_PARTIALS
@@ -290,7 +382,8 @@ var Edit = class _Edit extends BaseCommand {
290
382
  sourcePath,
291
383
  skills: recompileSkills,
292
384
  projectDir,
293
- outputDir: installation.agentsDir
385
+ outputDir: installation.agentsDir,
386
+ installMode: deriveInstallMode(result.skills)
294
387
  });
295
388
  if (recompileResult.failed.length > 0) {
296
389
  this.log(
@@ -315,6 +408,9 @@ var Edit = class _Edit extends BaseCommand {
315
408
  if (hasSourceChanges) {
316
409
  summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? "s" : ""} changed`);
317
410
  }
411
+ if (hasScopeChanges) {
412
+ summaryParts.push(`${scopeChanges.size} scope${scopeChanges.size > 1 ? "s" : ""} changed`);
413
+ }
318
414
  this.log(`
319
415
  \u2713 Plugin updated! (${summaryParts.join(", ")})
320
416
  `);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/commands/edit.tsx"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport { ASCII_LOGO, CLI_BIN_NAME, SOURCE_DISPLAY_NAMES } from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { detectInstallation } from \"../lib/installation/index.js\";\nimport { getMarketplaceLabel, loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { archiveLocalSkill, restoreArchivedSkill } from \"../lib/skills/index.js\";\nimport type { SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { claudePluginInstall, claudePluginUninstall } from \"../utils/exec.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n pushBufferMessage,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\nimport { typedEntries } from \"../utils/typed-object.js\";\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const projectDir = installation.projectDir;\n const isPluginMode = installation.mode === \"plugin\";\n const pluginScope = installation.scope === \"global\" ? \"user\" : \"project\";\n\n if (installation.scope === \"global\") {\n this.log(\"No project installation found. Using global installation from ~/.claude-src/\\n\");\n }\n\n enableBuffering();\n let sourceResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n pushBufferMessage(\n \"info\",\n `Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})`,\n );\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills;\n pushBufferMessage(\"info\", `Found ${currentSkillIds.length} skills from project config`);\n } else {\n pushBufferMessage(\"info\", `Current plugin has ${currentSkillIds.length} skills`);\n }\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n\n // Read saved installMode from config; fall back to marketplace-derived default only if absent\n const savedInstallMode = projectConfig?.config?.installMode;\n const initialInstallMode = savedInstallMode ?? (sourceResult.marketplace ? \"plugin\" : \"local\");\n\n const { waitUntilExit } = render(\n <Wizard\n matrix={sourceResult.matrix}\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n logo={ASCII_LOGO}\n initialStep=\"build\"\n initialInstallMode={initialInstallMode}\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result as WizardResultV2;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (!result.validation.valid) {\n const errorMessages = result.validation.errors.map((e) => e.message).join(\"\\n \");\n this.error(`Selection has validation errors:\\n ${errorMessages}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const addedSkills = result.selectedSkills.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !result.selectedSkills.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n for (const [skillId, selectedSource] of typedEntries<SkillId, string>(\n result.sourceSelections,\n )) {\n const skill = sourceResult.matrix.skills[skillId];\n if (skill?.activeSource && skill.activeSource.name !== selectedSource) {\n sourceChanges.set(skillId, {\n from: skill.activeSource.name,\n to: selectedSource,\n });\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (result.validation.warnings.length > 0) {\n this.log(\"\\nWarnings:\");\n for (const warning of result.validation.warnings) {\n this.warn(` ! ${warning.message}`);\n }\n this.log(\"\");\n }\n\n if (!hasSkillChanges && !hasSourceChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` + ${skill?.displayName || skillId}`);\n }\n for (const skillId of removedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` - ${skill?.displayName || skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n for (const [skillId, change] of sourceChanges) {\n if (change.from === \"local\") {\n await archiveLocalSkill(projectDir, skillId);\n }\n if (change.to === \"local\") {\n await restoreArchivedSkill(projectDir, skillId);\n }\n }\n\n if (isPluginMode && sourceResult.marketplace) {\n for (const skillId of addedSkills) {\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(projectDir);\n\n const recompileResult = await recompileAgents({\n pluginDir: projectDir,\n sourcePath,\n skills: recompileSkills,\n projectDir,\n outputDir: installation.agentsDir,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa;AACtB,SAAS,cAAc;AAiIjB;AAxGN,SAAS,wBAAwB,YAA4B;AAC3D,SAAO,qBAAqB,UAAU,KAAK;AAC7C;AAEA,IAAqB,OAArB,MAAqB,cAAa,YAAY;AAAA,EAC5C,OAAO,UAAU;AAAA,EACjB,OAAO,cAAc;AAAA,EAErB,OAAO,WAAW;AAAA,IAChB;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,IACf,SAAS,MAAM,QAAQ;AAAA,MACrB,aAAa;AAAA,MAC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MAC1B,CAAC;AAED,UAAI,gBAAgB,OAAO,SAAS,GAAG;AACrC,aAAK;AAAA,UACH,qBAAgB,gBAAgB,SAAS,MAAM,YAAY,gBAAgB,OAAO,MAAM;AAAA;AAAA,QAC1F;AACA,mBAAW,WAAW,gBAAgB,UAAU;AAC9C,eAAK,KAAK,OAAO;AAAA,QACnB;AAAA,MACF,WAAW,gBAAgB,SAAS,SAAS,GAAG;AAC9C,aAAK,IAAI,qBAAgB,gBAAgB,SAAS,MAAM;AAAA,CAAW;AAAA,MACrE,OAAO;AACL,aAAK,IAAI,iCAA4B;AAAA,MACvC;AAAA,IACF,SAAS,OAAO;AACd,WAAK,KAAK,+BAA+B,gBAAgB,KAAK,CAAC,EAAE;AACjE,WAAK,IAAI,oCAAoC,YAAY;AAAA,CAAc;AAAA,IACzE;AAEA,UAAM,eAAe,CAAC,GAAG,YAAY,MAAM,UAAU,GAAG,cAAc,MAAM,UAAU;AACtF,QAAI,kBAAkB;AACpB,mBAAa,KAAK,GAAG,cAAc,IAAI,UAAU,cAAc,OAAO,IAAI,MAAM,EAAE,UAAU;AAAA,IAC9F;AACA,SAAK,IAAI;AAAA,0BAA6B,aAAa,KAAK,IAAI,CAAC;AAAA,CAAK;AAAA,EACpE;AACF;","names":["result"]}
1
+ {"version":3,"sources":["../../src/cli/commands/edit.tsx"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n ASCII_LOGO,\n CLI_BIN_NAME,\n CLAUDE_SRC_DIR,\n GLOBAL_INSTALL_ROOT,\n SOURCE_DISPLAY_NAMES,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { splitConfigByScope } from \"../lib/configuration/config-generator.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport {\n detectInstallation,\n buildAndMergeConfig,\n writeConfigFile,\n detectMigrations,\n executeMigration,\n deriveInstallMode,\n} from \"../lib/installation/index.js\";\nimport { getMarketplaceLabel, loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { deleteLocalSkill, migrateLocalSkillScope } from \"../lib/skills/index.js\";\nimport type { SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { claudePluginInstall, claudePluginUninstall } from \"../utils/exec.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n pushBufferMessage,\n verbose,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const projectDir = installation.projectDir;\n\n enableBuffering();\n\n if (installation.projectDir === os.homedir()) {\n pushBufferMessage(\n \"info\",\n \"No project installation found. Using global installation from ~/.claude-src/\",\n );\n }\n let sourceResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n pushBufferMessage(\n \"info\",\n `Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})`,\n );\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills.map((s) => s.id);\n pushBufferMessage(\"info\", `Found ${currentSkillIds.length} skills from project config`);\n } else {\n pushBufferMessage(\"info\", `Current plugin has ${currentSkillIds.length} skills`);\n }\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n\n // D9: In project context, existing global items are read-only (locked).\n // When editing from ~/ (global context), nothing is locked.\n const isGlobalDir = projectDir === GLOBAL_INSTALL_ROOT;\n const lockedSkillIds = isGlobalDir\n ? undefined\n : projectConfig?.config?.skills?.filter((s) => s.scope === \"global\").map((s) => s.id);\n const lockedAgentNames = isGlobalDir\n ? undefined\n : projectConfig?.config?.agents?.filter((a) => a.scope === \"global\").map((a) => a.name);\n\n const { waitUntilExit } = render(\n <Wizard\n matrix={sourceResult.matrix}\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n logo={ASCII_LOGO}\n initialStep=\"build\"\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n installedSkillConfigs={projectConfig?.config?.skills}\n lockedSkillIds={lockedSkillIds}\n lockedAgentNames={lockedAgentNames}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result as WizardResultV2;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (!result.validation.valid) {\n const errorMessages = result.validation.errors.map((e) => e.message).join(\"\\n \");\n this.error(`Selection has validation errors:\\n ${errorMessages}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const newSkillIds = result.skills.map((s) => s.id);\n const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n const scopeChanges = new Map<\n SkillId,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.skills) {\n for (const newSkill of result.skills) {\n const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);\n if (oldSkill && oldSkill.source !== newSkill.source) {\n sourceChanges.set(newSkill.id, {\n from: oldSkill.source,\n to: newSkill.source,\n });\n }\n if (oldSkill && oldSkill.scope !== newSkill.scope) {\n scopeChanges.set(newSkill.id, {\n from: oldSkill.scope,\n to: newSkill.scope,\n });\n }\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasScopeChanges = scopeChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` + ${skill?.displayName || skillId}`);\n }\n for (const skillId of removedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` - ${skill?.displayName || skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [skillId, change] of scopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n // Handle per-skill mode migrations (local <-> plugin)\n const oldSkills = projectConfig?.config?.skills ?? [];\n const migrationPlan = detectMigrations(oldSkills, result.skills);\n const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;\n\n if (hasMigrations) {\n if (migrationPlan.toLocal.length > 0) {\n this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);\n for (const migration of migrationPlan.toLocal) {\n this.log(` - ${migration.id}`);\n }\n }\n if (migrationPlan.toPlugin.length > 0) {\n this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);\n for (const migration of migrationPlan.toPlugin) {\n this.log(` - ${migration.id}`);\n }\n }\n\n const migrationResult = await executeMigration(migrationPlan, projectDir, sourceResult);\n\n for (const warning of migrationResult.warnings) {\n this.warn(warning);\n }\n }\n\n const migratedSkillIds = new Set([\n ...migrationPlan.toLocal.map((m) => m.id),\n ...migrationPlan.toPlugin.map((m) => m.id),\n ]);\n\n // Handle scope migrations (P→G or G→P) for local-mode skills\n for (const [skillId, change] of scopeChanges) {\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (skillConfig?.source === \"local\") {\n await migrateLocalSkillScope(skillId, change.from, projectDir);\n } else if (sourceResult.marketplace && skillConfig) {\n // Plugin-mode scope change: uninstall from old scope, install to new scope\n const oldPluginScope = change.from === \"global\" ? \"user\" : \"project\";\n const newPluginScope = change.to === \"global\" ? \"user\" : \"project\";\n try {\n await claudePluginUninstall(skillId, oldPluginScope, projectDir);\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n await claudePluginInstall(pluginRef, newPluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Handle remaining non-migration source changes (e.g., marketplace A -> marketplace B)\n for (const [skillId, change] of sourceChanges) {\n // Skip skills already handled by mode migration\n if (migratedSkillIds.has(skillId)) {\n continue;\n }\n if (change.from === \"local\") {\n await deleteLocalSkill(projectDir, skillId);\n }\n }\n\n if (sourceResult.marketplace) {\n for (const skillId of addedSkills) {\n // Find the skill config to get its scope\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (!skillConfig || skillConfig.source === \"local\") continue;\n\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n const pluginScope = skillConfig.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n // For removed skills, use old config to determine scope\n const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);\n const pluginScope = oldSkill?.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Persist wizard result to config.ts (split by scope when in project context)\n const isGlobalContext = projectDir === GLOBAL_INSTALL_ROOT;\n try {\n const mergeResult = await buildAndMergeConfig(result, sourceResult, projectDir, flags.source);\n\n if (isGlobalContext) {\n // Editing from ~/ — write directly to global config (no import preamble)\n await writeConfigFile(mergeResult.config, installation.configPath);\n verbose(`Updated global config at ${installation.configPath}`);\n } else {\n // Editing from project — split by scope and write to both locations\n const { global: globalConfig, project: projectSplitConfig } = splitConfigByScope(\n mergeResult.config,\n );\n\n // Write global config to ~/.claude-src/config.ts\n const globalConfigPath = path.join(\n GLOBAL_INSTALL_ROOT,\n CLAUDE_SRC_DIR,\n STANDARD_FILES.CONFIG_TS,\n );\n await writeConfigFile(globalConfig, globalConfigPath);\n verbose(`Updated global config at ${globalConfigPath}`);\n\n // Write project config with import from global\n await writeConfigFile(projectSplitConfig, installation.configPath, {\n isProjectConfig: true,\n });\n verbose(`Updated project config at ${installation.configPath}`);\n }\n } catch (error) {\n this.warn(`Could not update config: ${getErrorMessage(error)}`);\n }\n\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(projectDir);\n\n const recompileResult = await recompileAgents({\n pluginDir: projectDir,\n sourcePath,\n skills: recompileSkills,\n projectDir,\n outputDir: installation.agentsDir,\n installMode: deriveInstallMode(result.skills),\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n if (hasScopeChanges) {\n summaryParts.push(`${scopeChanges.size} scope${scopeChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,SAAS,aAAa;AACtB,SAAS,cAAc;AAuJjB;AA/GN,SAAS,wBAAwB,YAA4B;AAC3D,SAAO,qBAAqB,UAAU,KAAK;AAC7C;AAEA,IAAqB,OAArB,MAAqB,cAAa,YAAY;AAAA,EAC5C,OAAO,UAAU;AAAA,EACjB,OAAO,cAAc;AAAA,EAErB,OAAO,WAAW;AAAA,IAChB;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,IACf,SAAS,MAAM,QAAQ;AAAA,MACrB,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,gBAAgB,MAAM,OAAO;AAAA,MAC3B,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;A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K;AAAA,EACpE;AACF;","names":["result"]}
@@ -1,18 +1,19 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- BaseCommand,
4
- EXIT_CODES
5
- } from "../chunk-PGY5XROM.js";
6
2
  import {
7
3
  copySkillsToLocalFlattened,
8
4
  loadProjectSourceConfig,
9
5
  loadSkillsMatrixFromSource,
10
6
  resolveSource,
11
7
  saveSourceToProjectConfig
12
- } from "../chunk-HMSHB5EQ.js";
8
+ } from "../chunk-FWMWWE3X.js";
9
+ import "../chunk-OCEFD7V6.js";
13
10
  import {
14
11
  typedKeys
15
12
  } from "../chunk-T4EXUIBY.js";
13
+ import {
14
+ BaseCommand,
15
+ EXIT_CODES
16
+ } from "../chunk-VR3CDXDT.js";
16
17
  import {
17
18
  copy,
18
19
  directoryExists,
@@ -20,16 +21,16 @@ import {
20
21
  fileExists,
21
22
  listDirectories,
22
23
  writeFile
23
- } from "../chunk-WBHPCBVN.js";
24
+ } from "../chunk-LWXRUR6B.js";
24
25
  import {
25
26
  CLAUDE_SRC_DIR,
26
27
  DEFAULT_BRANDING,
27
28
  DIRS,
28
29
  LOCAL_SKILLS_PATH,
29
30
  PROJECT_ROOT,
30
- STANDARD_FILES,
31
- YAML_FORMATTING
32
- } from "../chunk-AWP5A6IM.js";
31
+ STANDARD_FILES
32
+ } from "../chunk-6OWHQ7HM.js";
33
+ import "../chunk-EC3UJRKZ.js";
33
34
  import {
34
35
  init_esm_shims
35
36
  } from "../chunk-DHET7RCE.js";
@@ -39,7 +40,6 @@ init_esm_shims();
39
40
  import { Args, Flags } from "@oclif/core";
40
41
  import path from "path";
41
42
  import os from "os";
42
- import { stringify as stringifyYaml } from "yaml";
43
43
  var EJECT_TYPES = ["agent-partials", "templates", "skills", "all"];
44
44
  var Eject = class _Eject extends BaseCommand {
45
45
  static summary = "Eject skills, agent partials, or templates for local customization";
@@ -162,23 +162,22 @@ var Eject = class _Eject extends BaseCommand {
162
162
  }
163
163
  if (flags.source) {
164
164
  await saveSourceToProjectConfig(projectDir, flags.source);
165
- this.log(`Source saved to .claude-src/config.yaml`);
165
+ this.log(`Source saved to .claude-src/config.ts`);
166
166
  }
167
167
  await this.ensureMinimalConfig(projectDir, flags.source, sourceResult);
168
168
  this.log("");
169
169
  this.logSuccess("Eject complete!");
170
170
  this.log("");
171
171
  }
172
- // Ensures a minimal config.yaml exists so `agentsinc compile` works after eject
172
+ // Ensures a minimal config exists so `agentsinc compile` works after eject
173
173
  async ensureMinimalConfig(projectDir, sourceFlag, sourceResult) {
174
- const configPath = path.join(projectDir, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_YAML);
175
- if (await fileExists(configPath)) {
174
+ const tsConfigPath = path.join(projectDir, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_TS);
175
+ if (await fileExists(tsConfigPath)) {
176
176
  return;
177
177
  }
178
178
  const projectName = path.basename(projectDir);
179
179
  const config = {
180
- name: projectName,
181
- installMode: "local"
180
+ name: projectName
182
181
  };
183
182
  const resolvedConfig = sourceResult?.sourceConfig ?? await resolveSource(sourceFlag, projectDir);
184
183
  if (sourceFlag) {
@@ -197,32 +196,12 @@ var Eject = class _Eject extends BaseCommand {
197
196
  config.agentsSource = existingProjectConfig.agentsSource;
198
197
  }
199
198
  await ensureDir(path.join(projectDir, CLAUDE_SRC_DIR));
200
- let configContent = stringifyYaml(config, { indent: YAML_FORMATTING.INDENT });
201
- const exampleStackComment = `
202
- # Example stack configuration (uncomment and customize):
203
- #
204
- # skills:
205
- # - web-framework-react
206
- # - web-styling-scss-modules
207
- # - api-framework-hono
208
- # - api-database-drizzle
209
- #
210
- # agents:
211
- # - web-developer
212
- # - api-developer
213
- # - web-reviewer
214
- #
215
- # stack:
216
- # web-developer:
217
- # framework: web-framework-react
218
- # styling: web-styling-scss-modules
219
- # api-developer:
220
- # api: api-framework-hono
221
- # database: api-database-drizzle
199
+ const cleaned = JSON.parse(JSON.stringify(config));
200
+ const body = JSON.stringify(cleaned, null, 2);
201
+ const content = `export default ${body};
222
202
  `;
223
- configContent += exampleStackComment;
224
- await writeFile(configPath, configContent);
225
- this.logSuccess(`Created ${CLAUDE_SRC_DIR}/config.yaml`);
203
+ await writeFile(tsConfigPath, content);
204
+ this.logSuccess(`Created ${CLAUDE_SRC_DIR}/config.ts`);
226
205
  }
227
206
  async ejectAgentPartials(outputBase, force, directOutput = false, templatesFlag = false) {
228
207
  const sourceDir = templatesFlag ? path.join(PROJECT_ROOT, DIRS.templates) : path.join(PROJECT_ROOT, DIRS.agents);