@agents-inc/cli 0.48.0 → 0.60.1

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 (306) hide show
  1. package/CHANGELOG.md +181 -5
  2. package/README.md +1 -2
  3. package/dist/{chunk-2DNDAXF6.js → chunk-52M2XF3W.js} +57 -27
  4. package/dist/chunk-52M2XF3W.js.map +1 -0
  5. package/dist/{chunk-WSGKCBY5.js → chunk-52XO4ULK.js} +6 -9
  6. package/dist/chunk-52XO4ULK.js.map +1 -0
  7. package/dist/{chunk-AMNCCZSG.js → chunk-6G3KZSO4.js} +82 -63
  8. package/dist/chunk-6G3KZSO4.js.map +1 -0
  9. package/dist/{chunk-LESHL6SM.js → chunk-6OWHQ7HM.js} +21 -13
  10. package/dist/chunk-6OWHQ7HM.js.map +1 -0
  11. package/dist/{chunk-X3SZIBVW.js → chunk-7FMEMXJ4.js} +71 -71
  12. package/dist/chunk-7FMEMXJ4.js.map +1 -0
  13. package/dist/{chunk-I52THVF6.js → chunk-AJJJE7F7.js} +2 -2
  14. package/dist/{chunk-ZML3OCYA.js → chunk-AX3SZZWA.js} +2 -2
  15. package/dist/{chunk-NJVJ7VO5.js → chunk-BFD5NZQ4.js} +5 -4
  16. package/dist/chunk-BFD5NZQ4.js.map +1 -0
  17. package/dist/{chunk-GSPPOXMG.js → chunk-BKJHAJQW.js} +2 -2
  18. package/dist/{chunk-GSPPOXMG.js.map → chunk-BKJHAJQW.js.map} +1 -1
  19. package/dist/{chunk-FPTUCWBY.js → chunk-BMJZBLP7.js} +46 -30
  20. package/dist/chunk-BMJZBLP7.js.map +1 -0
  21. package/dist/chunk-BNQ5O6LE.js +74 -0
  22. package/dist/chunk-BNQ5O6LE.js.map +1 -0
  23. package/dist/{chunk-W62XVWXB.js → chunk-C577AJE7.js} +3 -3
  24. package/dist/chunk-CIG7IKX3.js +118 -0
  25. package/dist/chunk-CIG7IKX3.js.map +1 -0
  26. package/dist/chunk-EC3UJRKZ.js +1534 -0
  27. package/dist/chunk-EC3UJRKZ.js.map +1 -0
  28. package/dist/{chunk-IS7GP6XC.js → chunk-EMIUPGPL.js} +57 -52
  29. package/dist/chunk-EMIUPGPL.js.map +1 -0
  30. package/dist/chunk-G6WHCALR.js +593 -0
  31. package/dist/chunk-G6WHCALR.js.map +1 -0
  32. package/dist/{chunk-OTTITQ7C.js → chunk-H7WJK7NJ.js} +48 -95
  33. package/dist/chunk-H7WJK7NJ.js.map +1 -0
  34. package/dist/chunk-HGTC76BX.js +16 -0
  35. package/dist/chunk-HGTC76BX.js.map +1 -0
  36. package/dist/{chunk-G5OZQ376.js → chunk-K6OLORQL.js} +6 -6
  37. package/dist/{chunk-OHDEJEYB.js → chunk-KIWFEBKH.js} +41 -11
  38. package/dist/chunk-KIWFEBKH.js.map +1 -0
  39. package/dist/{chunk-YMUWTPOM.js → chunk-LWXRUR6B.js} +92 -100
  40. package/dist/chunk-LWXRUR6B.js.map +1 -0
  41. package/dist/{chunk-U2AEK4ZL.js → chunk-MGNYPVOJ.js} +2 -2
  42. package/dist/chunk-MKCHLXMY.js +40 -0
  43. package/dist/chunk-MKCHLXMY.js.map +1 -0
  44. package/dist/{chunk-37QYD33C.js → chunk-MMFQNJPE.js} +2 -2
  45. package/dist/{chunk-DG2U2WY3.js → chunk-MR6OBL3B.js} +3 -11
  46. package/dist/{chunk-DG2U2WY3.js.map → chunk-MR6OBL3B.js.map} +1 -1
  47. package/dist/{chunk-7IAKVZL5.js → chunk-O6BA7Q2B.js} +28 -59
  48. package/dist/chunk-O6BA7Q2B.js.map +1 -0
  49. package/dist/chunk-OCEFD7V6.js +201 -0
  50. package/dist/chunk-OCEFD7V6.js.map +1 -0
  51. package/dist/{chunk-YZTWZVGX.js → chunk-PUT7X3GA.js} +1 -1
  52. package/dist/chunk-PUT7X3GA.js.map +1 -0
  53. package/dist/chunk-RO6LX3UV.js +342 -0
  54. package/dist/chunk-RO6LX3UV.js.map +1 -0
  55. package/dist/{chunk-34BP5BC4.js → chunk-SDKCQXWE.js} +2 -2
  56. package/dist/{chunk-VBAAATPU.js → chunk-SEJF7CGJ.js} +41 -28
  57. package/dist/chunk-SEJF7CGJ.js.map +1 -0
  58. package/dist/{chunk-5O6GKXAN.js → chunk-SZRK3VOR.js} +24 -14
  59. package/dist/chunk-SZRK3VOR.js.map +1 -0
  60. package/dist/{chunk-5MN5S3DV.js → chunk-TC3NHO34.js} +22 -17
  61. package/dist/chunk-TC3NHO34.js.map +1 -0
  62. package/dist/{chunk-SPVSWDFM.js → chunk-TGLRDEEL.js} +8 -14
  63. package/dist/chunk-TGLRDEEL.js.map +1 -0
  64. package/dist/{chunk-P2SFRDWI.js → chunk-TZXYBG3R.js} +3634 -2875
  65. package/dist/chunk-TZXYBG3R.js.map +1 -0
  66. package/dist/{chunk-2BVZOYJP.js → chunk-VR3CDXDT.js} +2 -6
  67. package/dist/chunk-VR3CDXDT.js.map +1 -0
  68. package/dist/{chunk-KPJJOLAQ.js → chunk-WF6RM73R.js} +272 -40
  69. package/dist/chunk-WF6RM73R.js.map +1 -0
  70. package/dist/chunk-WYVDNGJB.js +31 -0
  71. package/dist/chunk-WYVDNGJB.js.map +1 -0
  72. package/dist/{chunk-F7KTUFGU.js → chunk-X5EG4EFP.js} +3 -2
  73. package/dist/chunk-X5EG4EFP.js.map +1 -0
  74. package/dist/{chunk-FHKNG3UA.js → chunk-XUDTFI4M.js} +2 -2
  75. package/dist/{chunk-AXV7NFFJ.js → chunk-YHCYKUA3.js} +14 -10
  76. package/dist/chunk-YHCYKUA3.js.map +1 -0
  77. package/dist/commands/build/marketplace.js +4 -4
  78. package/dist/commands/build/plugins.js +9 -7
  79. package/dist/commands/build/plugins.js.map +1 -1
  80. package/dist/commands/build/stack.js +13 -10
  81. package/dist/commands/build/stack.js.map +1 -1
  82. package/dist/commands/compile.js +45 -72
  83. package/dist/commands/compile.js.map +1 -1
  84. package/dist/commands/config/index.js +7 -5
  85. package/dist/commands/config/index.js.map +1 -1
  86. package/dist/commands/config/path.js +8 -6
  87. package/dist/commands/config/path.js.map +1 -1
  88. package/dist/commands/config/show.js +7 -5
  89. package/dist/commands/diff.js +9 -7
  90. package/dist/commands/diff.js.map +1 -1
  91. package/dist/commands/doctor.js +20 -16
  92. package/dist/commands/doctor.js.map +1 -1
  93. package/dist/commands/edit.js +196 -94
  94. package/dist/commands/edit.js.map +1 -1
  95. package/dist/commands/eject.js +20 -41
  96. package/dist/commands/eject.js.map +1 -1
  97. package/dist/commands/import/skill.js +10 -18
  98. package/dist/commands/import/skill.js.map +1 -1
  99. package/dist/commands/info.js +21 -20
  100. package/dist/commands/info.js.map +1 -1
  101. package/dist/commands/init.js +41 -435
  102. package/dist/commands/init.js.map +1 -1
  103. package/dist/commands/list.js +8 -6
  104. package/dist/commands/list.js.map +1 -1
  105. package/dist/commands/new/agent.js +28 -15
  106. package/dist/commands/new/agent.js.map +1 -1
  107. package/dist/commands/new/marketplace.js +67 -31
  108. package/dist/commands/new/marketplace.js.map +1 -1
  109. package/dist/commands/new/skill.js +17 -208
  110. package/dist/commands/new/skill.js.map +1 -1
  111. package/dist/commands/outdated.js +16 -10
  112. package/dist/commands/outdated.js.map +1 -1
  113. package/dist/commands/search.js +45 -35
  114. package/dist/commands/search.js.map +1 -1
  115. package/dist/commands/uninstall.js +93 -123
  116. package/dist/commands/uninstall.js.map +1 -1
  117. package/dist/commands/update.js +11 -9
  118. package/dist/commands/update.js.map +1 -1
  119. package/dist/commands/validate.js +42 -267
  120. package/dist/commands/validate.js.map +1 -1
  121. package/dist/components/common/confirm.test.js +4 -4
  122. package/dist/components/skill-search/skill-search.js +3 -3
  123. package/dist/components/wizard/category-grid.js +3 -2
  124. package/dist/components/wizard/category-grid.test.js +113 -59
  125. package/dist/components/wizard/category-grid.test.js.map +1 -1
  126. package/dist/components/wizard/checkbox-grid.js +5 -3
  127. package/dist/components/wizard/checkbox-grid.test.js +6 -5
  128. package/dist/components/wizard/checkbox-grid.test.js.map +1 -1
  129. package/dist/components/wizard/domain-selection.js +12 -9
  130. package/dist/components/wizard/help-modal.js +2 -2
  131. package/dist/components/wizard/menu-item.js +1 -1
  132. package/dist/components/wizard/search-modal.js +2 -2
  133. package/dist/components/wizard/search-modal.test.js +3 -3
  134. package/dist/components/wizard/search-modal.test.js.map +1 -1
  135. package/dist/components/wizard/section-progress.js +2 -2
  136. package/dist/components/wizard/section-progress.test.js +4 -4
  137. package/dist/components/wizard/section-progress.test.js.map +1 -1
  138. package/dist/components/wizard/selection-card.js +2 -2
  139. package/dist/components/wizard/source-grid.js +4 -3
  140. package/dist/components/wizard/source-grid.test.js +5 -4
  141. package/dist/components/wizard/source-grid.test.js.map +1 -1
  142. package/dist/components/wizard/stack-selection.js +9 -8
  143. package/dist/components/wizard/step-agents.js +11 -8
  144. package/dist/components/wizard/step-agents.test.js +20 -18
  145. package/dist/components/wizard/step-agents.test.js.map +1 -1
  146. package/dist/components/wizard/step-build.js +11 -8
  147. package/dist/components/wizard/step-build.test.js +18 -36
  148. package/dist/components/wizard/step-build.test.js.map +1 -1
  149. package/dist/components/wizard/step-confirm.js +4 -4
  150. package/dist/components/wizard/step-confirm.test.js +83 -23
  151. package/dist/components/wizard/step-confirm.test.js.map +1 -1
  152. package/dist/components/wizard/step-refine.js +2 -2
  153. package/dist/components/wizard/step-refine.test.js +3 -3
  154. package/dist/components/wizard/step-settings.js +9 -5
  155. package/dist/components/wizard/step-settings.test.js +13 -9
  156. package/dist/components/wizard/step-settings.test.js.map +1 -1
  157. package/dist/components/wizard/step-sources.js +13 -10
  158. package/dist/components/wizard/step-sources.test.js +19 -16
  159. package/dist/components/wizard/step-sources.test.js.map +1 -1
  160. package/dist/components/wizard/step-stack.js +16 -12
  161. package/dist/components/wizard/step-stack.test.js +18 -14
  162. package/dist/components/wizard/step-stack.test.js.map +1 -1
  163. package/dist/components/wizard/view-title.js +2 -2
  164. package/dist/components/wizard/wizard-layout.js +10 -8
  165. package/dist/components/wizard/wizard-tabs.js +2 -2
  166. package/dist/components/wizard/wizard-tabs.test.js +2 -2
  167. package/dist/components/wizard/wizard.js +29 -25
  168. package/dist/config-exports.js +20 -0
  169. package/dist/config-exports.js.map +1 -0
  170. package/dist/hooks/init.js +56 -3
  171. package/dist/hooks/init.js.map +1 -1
  172. package/dist/loader-2O32KKAQ.js +19 -0
  173. package/dist/source-loader-A6B3NDI4.js +16 -0
  174. package/dist/source-loader-A6B3NDI4.js.map +1 -0
  175. package/dist/source-manager-Q7IQSGIX.js +18 -0
  176. package/dist/source-manager-Q7IQSGIX.js.map +1 -0
  177. package/dist/src/agents/meta/agent-summoner/critical-reminders.md +1 -1
  178. package/dist/src/agents/meta/agent-summoner/critical-requirements.md +1 -1
  179. package/dist/src/agents/meta/agent-summoner/examples.md +2 -2
  180. package/dist/src/agents/meta/agent-summoner/output-format.md +1 -1
  181. package/dist/src/agents/meta/agent-summoner/workflow.md +8 -10
  182. package/{src/agents/meta/documentor/agent.yaml → dist/src/agents/meta/documentor/metadata.yaml} +1 -0
  183. package/dist/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
  184. package/dist/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
  185. package/dist/src/agents/meta/skill-summoner/intro.md +1 -1
  186. package/dist/src/agents/meta/skill-summoner/output-format.md +3 -3
  187. package/dist/src/agents/meta/skill-summoner/workflow.md +8 -8
  188. package/dist/stores/wizard-store.js +6 -5
  189. package/dist/stores/wizard-store.test.js +367 -75
  190. package/dist/stores/wizard-store.test.js.map +1 -1
  191. package/package.json +5 -1
  192. package/src/agents/meta/agent-summoner/critical-reminders.md +1 -1
  193. package/src/agents/meta/agent-summoner/critical-requirements.md +1 -1
  194. package/src/agents/meta/agent-summoner/examples.md +2 -2
  195. package/src/agents/meta/agent-summoner/output-format.md +1 -1
  196. package/src/agents/meta/agent-summoner/workflow.md +8 -10
  197. package/{dist/src/agents/meta/documentor/agent.yaml → src/agents/meta/documentor/metadata.yaml} +1 -0
  198. package/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
  199. package/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
  200. package/src/agents/meta/skill-summoner/intro.md +1 -1
  201. package/src/agents/meta/skill-summoner/output-format.md +3 -3
  202. package/src/agents/meta/skill-summoner/workflow.md +8 -8
  203. package/src/schemas/agent.schema.json +1 -1
  204. package/src/schemas/metadata.schema.json +6 -0
  205. package/src/schemas/project-config.schema.json +0 -3
  206. package/src/schemas/stacks.schema.json +1 -1
  207. package/config/skill-categories.yaml +0 -344
  208. package/config/skill-rules.yaml +0 -740
  209. package/config/stacks.yaml +0 -1865
  210. package/dist/chunk-2BVZOYJP.js.map +0 -1
  211. package/dist/chunk-2DNDAXF6.js.map +0 -1
  212. package/dist/chunk-5MN5S3DV.js.map +0 -1
  213. package/dist/chunk-5O6GKXAN.js.map +0 -1
  214. package/dist/chunk-7IAKVZL5.js.map +0 -1
  215. package/dist/chunk-AMNCCZSG.js.map +0 -1
  216. package/dist/chunk-AXV7NFFJ.js.map +0 -1
  217. package/dist/chunk-AXZNJ5PN.js +0 -99
  218. package/dist/chunk-AXZNJ5PN.js.map +0 -1
  219. package/dist/chunk-C7DLY64D.js +0 -115
  220. package/dist/chunk-C7DLY64D.js.map +0 -1
  221. package/dist/chunk-F7KTUFGU.js.map +0 -1
  222. package/dist/chunk-FPTUCWBY.js.map +0 -1
  223. package/dist/chunk-IS7GP6XC.js.map +0 -1
  224. package/dist/chunk-KPJJOLAQ.js.map +0 -1
  225. package/dist/chunk-LESHL6SM.js.map +0 -1
  226. package/dist/chunk-NJVJ7VO5.js.map +0 -1
  227. package/dist/chunk-OHDEJEYB.js.map +0 -1
  228. package/dist/chunk-OTTITQ7C.js.map +0 -1
  229. package/dist/chunk-P2SFRDWI.js.map +0 -1
  230. package/dist/chunk-PY2XZUBF.js +0 -29
  231. package/dist/chunk-PY2XZUBF.js.map +0 -1
  232. package/dist/chunk-SPVSWDFM.js.map +0 -1
  233. package/dist/chunk-VBAAATPU.js.map +0 -1
  234. package/dist/chunk-WSGKCBY5.js.map +0 -1
  235. package/dist/chunk-X3SZIBVW.js.map +0 -1
  236. package/dist/chunk-YDASDMTH.js +0 -183
  237. package/dist/chunk-YDASDMTH.js.map +0 -1
  238. package/dist/chunk-YMUWTPOM.js.map +0 -1
  239. package/dist/chunk-YZTWZVGX.js.map +0 -1
  240. package/dist/commands/config/get.js +0 -61
  241. package/dist/commands/config/get.js.map +0 -1
  242. package/dist/commands/config/set-project.js +0 -61
  243. package/dist/commands/config/set-project.js.map +0 -1
  244. package/dist/commands/config/unset-project.js +0 -57
  245. package/dist/commands/config/unset-project.js.map +0 -1
  246. package/dist/config/skill-categories.yaml +0 -344
  247. package/dist/config/skill-rules.yaml +0 -740
  248. package/dist/config/stacks.yaml +0 -1865
  249. package/dist/source-manager-Y7R6WPOW.js +0 -16
  250. package/dist/src/agents/migration/cli-migrator/agent.yaml +0 -12
  251. package/dist/src/agents/migration/cli-migrator/anti-patterns.md +0 -158
  252. package/dist/src/agents/migration/cli-migrator/conversion-mappings.md +0 -63
  253. package/dist/src/agents/migration/cli-migrator/critical-reminders.md +0 -17
  254. package/dist/src/agents/migration/cli-migrator/critical-requirements.md +0 -13
  255. package/dist/src/agents/migration/cli-migrator/intro.md +0 -15
  256. package/dist/src/agents/migration/cli-migrator/output-format.md +0 -164
  257. package/dist/src/agents/migration/cli-migrator/workflow.md +0 -230
  258. package/src/agents/migration/cli-migrator/agent.yaml +0 -12
  259. package/src/agents/migration/cli-migrator/anti-patterns.md +0 -158
  260. package/src/agents/migration/cli-migrator/conversion-mappings.md +0 -63
  261. package/src/agents/migration/cli-migrator/critical-reminders.md +0 -17
  262. package/src/agents/migration/cli-migrator/critical-requirements.md +0 -13
  263. package/src/agents/migration/cli-migrator/intro.md +0 -15
  264. package/src/agents/migration/cli-migrator/output-format.md +0 -164
  265. package/src/agents/migration/cli-migrator/workflow.md +0 -230
  266. /package/dist/{chunk-I52THVF6.js.map → chunk-AJJJE7F7.js.map} +0 -0
  267. /package/dist/{chunk-ZML3OCYA.js.map → chunk-AX3SZZWA.js.map} +0 -0
  268. /package/dist/{chunk-W62XVWXB.js.map → chunk-C577AJE7.js.map} +0 -0
  269. /package/dist/{chunk-G5OZQ376.js.map → chunk-K6OLORQL.js.map} +0 -0
  270. /package/dist/{chunk-U2AEK4ZL.js.map → chunk-MGNYPVOJ.js.map} +0 -0
  271. /package/dist/{chunk-37QYD33C.js.map → chunk-MMFQNJPE.js.map} +0 -0
  272. /package/dist/{chunk-34BP5BC4.js.map → chunk-SDKCQXWE.js.map} +0 -0
  273. /package/dist/{chunk-FHKNG3UA.js.map → chunk-XUDTFI4M.js.map} +0 -0
  274. /package/dist/{source-manager-Y7R6WPOW.js.map → loader-2O32KKAQ.js.map} +0 -0
  275. /package/dist/src/agents/developer/api-developer/{agent.yaml → metadata.yaml} +0 -0
  276. /package/dist/src/agents/developer/cli-developer/{agent.yaml → metadata.yaml} +0 -0
  277. /package/dist/src/agents/developer/web-architecture/{agent.yaml → metadata.yaml} +0 -0
  278. /package/dist/src/agents/developer/web-developer/{agent.yaml → metadata.yaml} +0 -0
  279. /package/dist/src/agents/meta/agent-summoner/{agent.yaml → metadata.yaml} +0 -0
  280. /package/dist/src/agents/meta/skill-summoner/{agent.yaml → metadata.yaml} +0 -0
  281. /package/dist/src/agents/pattern/pattern-scout/{agent.yaml → metadata.yaml} +0 -0
  282. /package/dist/src/agents/pattern/web-pattern-critique/{agent.yaml → metadata.yaml} +0 -0
  283. /package/dist/src/agents/planning/web-pm/{agent.yaml → metadata.yaml} +0 -0
  284. /package/dist/src/agents/researcher/api-researcher/{agent.yaml → metadata.yaml} +0 -0
  285. /package/dist/src/agents/researcher/web-researcher/{agent.yaml → metadata.yaml} +0 -0
  286. /package/dist/src/agents/reviewer/api-reviewer/{agent.yaml → metadata.yaml} +0 -0
  287. /package/dist/src/agents/reviewer/cli-reviewer/{agent.yaml → metadata.yaml} +0 -0
  288. /package/dist/src/agents/reviewer/web-reviewer/{agent.yaml → metadata.yaml} +0 -0
  289. /package/dist/src/agents/tester/cli-tester/{agent.yaml → metadata.yaml} +0 -0
  290. /package/dist/src/agents/tester/web-tester/{agent.yaml → metadata.yaml} +0 -0
  291. /package/src/agents/developer/api-developer/{agent.yaml → metadata.yaml} +0 -0
  292. /package/src/agents/developer/cli-developer/{agent.yaml → metadata.yaml} +0 -0
  293. /package/src/agents/developer/web-architecture/{agent.yaml → metadata.yaml} +0 -0
  294. /package/src/agents/developer/web-developer/{agent.yaml → metadata.yaml} +0 -0
  295. /package/src/agents/meta/agent-summoner/{agent.yaml → metadata.yaml} +0 -0
  296. /package/src/agents/meta/skill-summoner/{agent.yaml → metadata.yaml} +0 -0
  297. /package/src/agents/pattern/pattern-scout/{agent.yaml → metadata.yaml} +0 -0
  298. /package/src/agents/pattern/web-pattern-critique/{agent.yaml → metadata.yaml} +0 -0
  299. /package/src/agents/planning/web-pm/{agent.yaml → metadata.yaml} +0 -0
  300. /package/src/agents/researcher/api-researcher/{agent.yaml → metadata.yaml} +0 -0
  301. /package/src/agents/researcher/web-researcher/{agent.yaml → metadata.yaml} +0 -0
  302. /package/src/agents/reviewer/api-reviewer/{agent.yaml → metadata.yaml} +0 -0
  303. /package/src/agents/reviewer/cli-reviewer/{agent.yaml → metadata.yaml} +0 -0
  304. /package/src/agents/reviewer/web-reviewer/{agent.yaml → metadata.yaml} +0 -0
  305. /package/src/agents/tester/cli-tester/{agent.yaml → metadata.yaml} +0 -0
  306. /package/src/agents/tester/web-tester/{agent.yaml → metadata.yaml} +0 -0
@@ -1,82 +1,95 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- getAgentDefinitions,
4
- recompileAgents
5
- } from "../chunk-AXV7NFFJ.js";
6
2
  import {
7
3
  Wizard
8
- } from "../chunk-AMNCCZSG.js";
9
- import "../chunk-IS7GP6XC.js";
10
- import "../chunk-37QYD33C.js";
11
- import "../chunk-2DNDAXF6.js";
12
- import "../chunk-5O6GKXAN.js";
13
- import "../chunk-PY2XZUBF.js";
14
- import "../chunk-FPTUCWBY.js";
15
- import "../chunk-VBAAATPU.js";
16
- import "../chunk-5MN5S3DV.js";
4
+ } from "../chunk-6G3KZSO4.js";
5
+ import "../chunk-52M2XF3W.js";
6
+ import "../chunk-SZRK3VOR.js";
7
+ import "../chunk-MKCHLXMY.js";
8
+ import "../chunk-EMIUPGPL.js";
9
+ import "../chunk-MMFQNJPE.js";
10
+ import "../chunk-HGTC76BX.js";
11
+ import "../chunk-SEJF7CGJ.js";
12
+ import "../chunk-TC3NHO34.js";
17
13
  import "../chunk-K77I4XGL.js";
18
- import "../chunk-OHDEJEYB.js";
19
- import "../chunk-WSGKCBY5.js";
20
- import "../chunk-F7KTUFGU.js";
21
- import "../chunk-7IAKVZL5.js";
14
+ import "../chunk-KIWFEBKH.js";
15
+ import "../chunk-O6BA7Q2B.js";
22
16
  import "../chunk-7SOPVGDV.js";
23
- import "../chunk-34BP5BC4.js";
17
+ import "../chunk-SDKCQXWE.js";
24
18
  import "../chunk-KUV24B5M.js";
25
- import "../chunk-OTTITQ7C.js";
19
+ import "../chunk-BMJZBLP7.js";
20
+ import "../chunk-X5EG4EFP.js";
21
+ import "../chunk-H7WJK7NJ.js";
26
22
  import "../chunk-GG4BSB6S.js";
27
- import "../chunk-SPVSWDFM.js";
28
- import "../chunk-GSPPOXMG.js";
29
- import "../chunk-AXZNJ5PN.js";
30
- import "../chunk-U2AEK4ZL.js";
31
- import "../chunk-FHKNG3UA.js";
23
+ import "../chunk-TGLRDEEL.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-WF6RM73R.js";
31
+ import "../chunk-XUDTFI4M.js";
32
32
  import "../chunk-U3IGFMCY.js";
33
33
  import {
34
- claudePluginInstall,
35
- claudePluginUninstall
36
- } from "../chunk-YDASDMTH.js";
37
- import "../chunk-KPJJOLAQ.js";
38
- import "../chunk-C7DLY64D.js";
34
+ getAgentDefinitions,
35
+ recompileAgents
36
+ } from "../chunk-YHCYKUA3.js";
39
37
  import {
40
38
  ERROR_MESSAGES,
41
39
  INFO_MESSAGES,
42
40
  STATUS_MESSAGES
43
- } from "../chunk-DG2U2WY3.js";
41
+ } from "../chunk-MR6OBL3B.js";
44
42
  import {
45
- BaseCommand,
46
- EXIT_CODES
47
- } from "../chunk-2BVZOYJP.js";
48
- import {
49
- archiveLocalSkill,
43
+ buildAndMergeConfig,
44
+ claudePluginInstall,
45
+ claudePluginUninstall,
46
+ deleteLocalSkill,
47
+ deriveInstallMode,
50
48
  detectInstallation,
49
+ detectMigrations,
51
50
  discoverAllPluginSkills,
51
+ executeMigration,
52
52
  getMarketplaceLabel,
53
53
  loadProjectConfig,
54
54
  loadSkillsMatrixFromSource,
55
- restoreArchivedSkill
56
- } from "../chunk-P2SFRDWI.js";
55
+ migrateLocalSkillScope,
56
+ splitConfigByScope,
57
+ writeConfigFile
58
+ } from "../chunk-TZXYBG3R.js";
59
+ import "../chunk-OCEFD7V6.js";
60
+ import "../chunk-T4EXUIBY.js";
57
61
  import {
58
- typedEntries
59
- } from "../chunk-T4EXUIBY.js";
62
+ BaseCommand,
63
+ EXIT_CODES
64
+ } from "../chunk-VR3CDXDT.js";
60
65
  import {
61
- getErrorMessage
62
- } from "../chunk-YMUWTPOM.js";
66
+ disableBuffering,
67
+ drainBuffer,
68
+ enableBuffering,
69
+ getErrorMessage,
70
+ pushBufferMessage,
71
+ verbose
72
+ } from "../chunk-LWXRUR6B.js";
63
73
  import {
64
74
  ASCII_LOGO,
65
- CLI_BIN_NAME
66
- } from "../chunk-LESHL6SM.js";
75
+ CLAUDE_SRC_DIR,
76
+ CLI_BIN_NAME,
77
+ GLOBAL_INSTALL_ROOT,
78
+ SOURCE_DISPLAY_NAMES,
79
+ STANDARD_FILES
80
+ } from "../chunk-6OWHQ7HM.js";
81
+ import "../chunk-EC3UJRKZ.js";
67
82
  import {
68
83
  init_esm_shims
69
84
  } from "../chunk-DHET7RCE.js";
70
85
 
71
86
  // src/cli/commands/edit.tsx
72
87
  init_esm_shims();
88
+ import os from "os";
89
+ import path from "path";
73
90
  import { Flags } from "@oclif/core";
74
91
  import { render } from "ink";
75
92
  import { jsx } from "react/jsx-runtime";
76
- var SOURCE_DISPLAY_NAMES = {
77
- public: "Public",
78
- local: "Local"
79
- };
80
93
  function formatSourceDisplayName(sourceName) {
81
94
  return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;
82
95
  }
@@ -115,13 +128,16 @@ var Edit = class _Edit extends BaseCommand {
115
128
  exit: EXIT_CODES.ERROR
116
129
  });
117
130
  }
118
- const projectDir = process.cwd();
119
- const isPluginMode = installation.mode === "plugin";
120
- const modeLabel = installation.mode === "local" ? "Local" : "Plugin";
121
- this.log(`Edit ${modeLabel} Skills
122
- `);
123
- this.log(STATUS_MESSAGES.LOADING_MARKETPLACE_SOURCE);
131
+ const projectDir = installation.projectDir;
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
+ }
124
139
  let sourceResult;
140
+ let startupMessages = [];
125
141
  try {
126
142
  sourceResult = await loadSkillsMatrixFromSource({
127
143
  sourceFlag: flags.source,
@@ -129,34 +145,36 @@ var Edit = class _Edit extends BaseCommand {
129
145
  forceRefresh: flags.refresh
130
146
  });
131
147
  const sourceInfo = sourceResult.isLocal ? "local" : sourceResult.sourceConfig.sourceOrigin;
132
- this.log(
133
- `\u2713 Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})
134
- `
148
+ pushBufferMessage(
149
+ "info",
150
+ `Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})`
135
151
  );
136
152
  } catch (error) {
153
+ disableBuffering();
137
154
  this.handleError(error);
138
155
  }
139
156
  const projectConfig = await loadProjectConfig(projectDir);
140
- this.log("Reading current skills...");
141
157
  let currentSkillIds;
142
158
  try {
143
159
  const discoveredSkills = await discoverAllPluginSkills(projectDir);
144
160
  currentSkillIds = Object.keys(discoveredSkills);
145
161
  if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {
146
- currentSkillIds = projectConfig.config.skills;
147
- this.log(`\u2713 Found ${currentSkillIds.length} skills from project config
148
- `);
162
+ currentSkillIds = projectConfig.config.skills.map((s) => s.id);
163
+ pushBufferMessage("info", `Found ${currentSkillIds.length} skills from project config`);
149
164
  } else {
150
- this.log(`\u2713 Current plugin has ${currentSkillIds.length} skills
151
- `);
165
+ pushBufferMessage("info", `Current plugin has ${currentSkillIds.length} skills`);
152
166
  }
153
167
  } catch (error) {
168
+ disableBuffering();
154
169
  this.handleError(error);
155
170
  }
171
+ startupMessages = drainBuffer();
172
+ disableBuffering();
156
173
  let wizardResult = null;
157
174
  const marketplaceLabel = getMarketplaceLabel(sourceResult);
158
- const savedInstallMode = projectConfig?.config?.installMode;
159
- 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);
160
178
  const { waitUntilExit } = render(
161
179
  /* @__PURE__ */ jsx(
162
180
  Wizard,
@@ -166,12 +184,14 @@ var Edit = class _Edit extends BaseCommand {
166
184
  marketplaceLabel,
167
185
  logo: ASCII_LOGO,
168
186
  initialStep: "build",
169
- initialInstallMode,
170
- initialExpertMode: projectConfig?.config?.expertMode,
171
187
  initialDomains: projectConfig?.config?.domains,
172
188
  initialAgents: projectConfig?.config?.selectedAgents,
173
189
  installedSkillIds: currentSkillIds,
174
- projectDir: process.cwd(),
190
+ installedSkillConfigs: projectConfig?.config?.skills,
191
+ lockedSkillIds,
192
+ lockedAgentNames,
193
+ projectDir,
194
+ startupMessages,
175
195
  onComplete: (result2) => {
176
196
  wizardResult = result2;
177
197
  },
@@ -193,30 +213,32 @@ var Edit = class _Edit extends BaseCommand {
193
213
  exit: EXIT_CODES.ERROR
194
214
  });
195
215
  }
196
- const addedSkills = result.selectedSkills.filter((id) => !currentSkillIds.includes(id));
197
- 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));
198
219
  const sourceChanges = /* @__PURE__ */ new Map();
199
- for (const [skillId, selectedSource] of typedEntries(
200
- result.sourceSelections
201
- )) {
202
- const skill = sourceResult.matrix.skills[skillId];
203
- if (skill?.activeSource && skill.activeSource.name !== selectedSource) {
204
- sourceChanges.set(skillId, {
205
- from: skill.activeSource.name,
206
- to: selectedSource
207
- });
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
+ }
208
236
  }
209
237
  }
210
238
  const hasSourceChanges = sourceChanges.size > 0;
239
+ const hasScopeChanges = scopeChanges.size > 0;
211
240
  const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;
212
- if (result.validation.warnings.length > 0) {
213
- this.log("\nWarnings:");
214
- for (const warning of result.validation.warnings) {
215
- this.warn(` ! ${warning.message}`);
216
- }
217
- this.log("");
218
- }
219
- if (!hasSkillChanges && !hasSourceChanges) {
241
+ if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges) {
220
242
  this.log(INFO_MESSAGES.NO_CHANGES_MADE);
221
243
  this.log("Plugin unchanged\n");
222
244
  return;
@@ -235,34 +257,110 @@ var Edit = class _Edit extends BaseCommand {
235
257
  const toLabel = formatSourceDisplayName(change.to);
236
258
  this.log(` ~ ${skillId} (${fromLabel} \u2192 ${toLabel})`);
237
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
+ }
238
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
+ }
239
307
  for (const [skillId, change] of sourceChanges) {
240
- if (change.from === "local") {
241
- await archiveLocalSkill(projectDir, skillId);
308
+ if (migratedSkillIds.has(skillId)) {
309
+ continue;
242
310
  }
243
- if (change.to === "local") {
244
- await restoreArchivedSkill(projectDir, skillId);
311
+ if (change.from === "local") {
312
+ await deleteLocalSkill(projectDir, skillId);
245
313
  }
246
314
  }
247
- if (isPluginMode && sourceResult.marketplace) {
315
+ if (sourceResult.marketplace) {
248
316
  for (const skillId of addedSkills) {
317
+ const skillConfig = result.skills.find((s) => s.id === skillId);
318
+ if (!skillConfig || skillConfig.source === "local") continue;
249
319
  const pluginRef = `${skillId}@${sourceResult.marketplace}`;
320
+ const pluginScope = skillConfig.scope === "global" ? "user" : "project";
250
321
  this.log(`Installing plugin: ${pluginRef}...`);
251
322
  try {
252
- await claudePluginInstall(pluginRef, "project", projectDir);
323
+ await claudePluginInstall(pluginRef, pluginScope, projectDir);
253
324
  } catch (error) {
254
325
  this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);
255
326
  }
256
327
  }
257
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";
258
331
  this.log(`Uninstalling plugin: ${skillId}...`);
259
332
  try {
260
- await claudePluginUninstall(skillId, "project", projectDir);
333
+ await claudePluginUninstall(skillId, pluginScope, projectDir);
261
334
  } catch (error) {
262
335
  this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);
263
336
  }
264
337
  }
265
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
+ }
266
364
  let sourcePath;
267
365
  this.log(
268
366
  flags["agent-source"] ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS : STATUS_MESSAGES.LOADING_AGENT_PARTIALS
@@ -284,7 +382,8 @@ var Edit = class _Edit extends BaseCommand {
284
382
  sourcePath,
285
383
  skills: recompileSkills,
286
384
  projectDir,
287
- outputDir: installation.agentsDir
385
+ outputDir: installation.agentsDir,
386
+ installMode: deriveInstallMode(result.skills)
288
387
  });
289
388
  if (recompileResult.failed.length > 0) {
290
389
  this.log(
@@ -309,6 +408,9 @@ var Edit = class _Edit extends BaseCommand {
309
408
  if (hasSourceChanges) {
310
409
  summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? "s" : ""} changed`);
311
410
  }
411
+ if (hasScopeChanges) {
412
+ summaryParts.push(`${scopeChanges.size} scope${scopeChanges.size > 1 ? "s" : ""} changed`);
413
+ }
312
414
  this.log(`
313
415
  \u2713 Plugin updated! (${summaryParts.join(", ")})
314
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 } 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 { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\nimport { typedEntries } from \"../utils/typed-object.js\";\n\nconst SOURCE_DISPLAY_NAMES: Record<string, string> = {\n public: \"Public\",\n local: \"Local\",\n};\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 = process.cwd();\n const isPluginMode = installation.mode === \"plugin\";\n\n const modeLabel = installation.mode === \"local\" ? \"Local\" : \"Plugin\";\n this.log(`Edit ${modeLabel} Skills\\n`);\n\n this.log(STATUS_MESSAGES.LOADING_MARKETPLACE_SOURCE);\n let sourceResult;\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 this.log(\n `✓ Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})\\n`,\n );\n } catch (error) {\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n this.log(\"Reading current skills...\");\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 this.log(`✓ Found ${currentSkillIds.length} skills from project config\\n`);\n } else {\n this.log(`✓ Current plugin has ${currentSkillIds.length} skills\\n`);\n }\n } catch (error) {\n this.handleError(error);\n }\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 initialExpertMode={projectConfig?.config?.expertMode}\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n projectDir={process.cwd()}\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, \"project\", 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, \"project\", 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;AAuHjB;AArGN,IAAM,uBAA+C;AAAA,EACnD,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,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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;AAAA,QACX;AAAA,QACA,QAAQ;AAAA,QACR;AAAA,QACA,WAAW,aAAa;AAAA,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;AAA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C3F;AACA,SAAK,IAAI;AAAA,0BAA6B,aAAa,KAAK,IAAI,CAAC;AAAA,CAAK;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-2BVZOYJP.js";
6
2
  import {
7
3
  copySkillsToLocalFlattened,
8
4
  loadProjectSourceConfig,
9
5
  loadSkillsMatrixFromSource,
10
6
  resolveSource,
11
7
  saveSourceToProjectConfig
12
- } from "../chunk-P2SFRDWI.js";
8
+ } from "../chunk-TZXYBG3R.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-YMUWTPOM.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-LESHL6SM.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);