agents-inc 0.150.0 → 0.152.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 (255) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/{chunk-FWT3CBLL.js → chunk-5GUOIJSG.js} +3 -7
  3. package/dist/{chunk-FWT3CBLL.js.map → chunk-5GUOIJSG.js.map} +1 -1
  4. package/dist/{chunk-MC5DUZ3V.js → chunk-5UWKOOIS.js} +6 -26
  5. package/dist/chunk-5UWKOOIS.js.map +1 -0
  6. package/dist/{chunk-O5ASLZ2K.js → chunk-76ADG7LQ.js} +1 -5
  7. package/dist/{chunk-O5ASLZ2K.js.map → chunk-76ADG7LQ.js.map} +1 -1
  8. package/dist/{chunk-7URSGJLE.js → chunk-BNSRA6HL.js} +13 -18
  9. package/dist/{chunk-7URSGJLE.js.map → chunk-BNSRA6HL.js.map} +1 -1
  10. package/dist/{chunk-FYPUUYSG.js → chunk-DTSG5XZB.js} +3 -7
  11. package/dist/{chunk-FYPUUYSG.js.map → chunk-DTSG5XZB.js.map} +1 -1
  12. package/dist/{chunk-YKKIJHZB.js → chunk-E5X6RJ4E.js} +5 -15
  13. package/dist/chunk-E5X6RJ4E.js.map +1 -0
  14. package/dist/{chunk-KH7MOIM5.js → chunk-EEPELKOM.js} +3665 -3737
  15. package/dist/chunk-EEPELKOM.js.map +1 -0
  16. package/dist/{chunk-NIKUMXE7.js → chunk-F7T5AFFN.js} +1 -5
  17. package/dist/{chunk-NIKUMXE7.js.map → chunk-F7T5AFFN.js.map} +1 -1
  18. package/dist/{chunk-4GL2F5AB.js → chunk-FVDKAVOL.js} +57 -48
  19. package/dist/chunk-FVDKAVOL.js.map +1 -0
  20. package/dist/{chunk-UZRISDBZ.js → chunk-GRVKW3CC.js} +2 -6
  21. package/dist/{chunk-UZRISDBZ.js.map → chunk-GRVKW3CC.js.map} +1 -1
  22. package/dist/{chunk-CDMHSHBN.js → chunk-IHUY4M22.js} +4 -8
  23. package/dist/{chunk-CDMHSHBN.js.map → chunk-IHUY4M22.js.map} +1 -1
  24. package/dist/{chunk-OZZGXBCN.js → chunk-IUQBOCSU.js} +1 -5
  25. package/dist/{chunk-OZZGXBCN.js.map → chunk-IUQBOCSU.js.map} +1 -1
  26. package/dist/{chunk-LYYXX2W5.js → chunk-J27W6TXS.js} +4 -6
  27. package/dist/{chunk-LYYXX2W5.js.map → chunk-J27W6TXS.js.map} +1 -1
  28. package/dist/chunk-JFLVEFFP.js +16 -0
  29. package/dist/chunk-JFLVEFFP.js.map +1 -0
  30. package/dist/{chunk-4LPJZNT7.js → chunk-KFB5CRXZ.js} +7 -12
  31. package/dist/{chunk-4LPJZNT7.js.map → chunk-KFB5CRXZ.js.map} +1 -1
  32. package/dist/{chunk-SYUOXSPU.js → chunk-KR65TPKC.js} +168 -14
  33. package/dist/chunk-KR65TPKC.js.map +1 -0
  34. package/dist/{chunk-KOPEM3Q7.js → chunk-KXYVJGJP.js} +2 -6
  35. package/dist/{chunk-KOPEM3Q7.js.map → chunk-KXYVJGJP.js.map} +1 -1
  36. package/dist/{chunk-ZHTXPFDK.js → chunk-L7SZXUBJ.js} +9 -14
  37. package/dist/{chunk-ZHTXPFDK.js.map → chunk-L7SZXUBJ.js.map} +1 -1
  38. package/dist/{chunk-LRYNF3J7.js → chunk-LASI35KT.js} +4 -9
  39. package/dist/{chunk-LRYNF3J7.js.map → chunk-LASI35KT.js.map} +1 -1
  40. package/dist/{chunk-VG2TVBFN.js → chunk-LDP5ASDM.js} +2 -6
  41. package/dist/{chunk-VG2TVBFN.js.map → chunk-LDP5ASDM.js.map} +1 -1
  42. package/dist/{chunk-GRPSDKIS.js → chunk-LZ52XEPR.js} +4 -8
  43. package/dist/{chunk-GRPSDKIS.js.map → chunk-LZ52XEPR.js.map} +1 -1
  44. package/dist/{chunk-CFQT72MJ.js → chunk-M7HO7NBK.js} +4 -8
  45. package/dist/{chunk-CFQT72MJ.js.map → chunk-M7HO7NBK.js.map} +1 -1
  46. package/dist/{chunk-XA57SX4T.js → chunk-MJ2KHG24.js} +4 -8
  47. package/dist/{chunk-XA57SX4T.js.map → chunk-MJ2KHG24.js.map} +1 -1
  48. package/dist/{chunk-DAG2ULNF.js → chunk-MM7CTTAV.js} +2 -6
  49. package/dist/chunk-MM7CTTAV.js.map +1 -0
  50. package/dist/{chunk-F3756A5B.js → chunk-MQ7FLIYS.js} +2 -6
  51. package/dist/{chunk-F3756A5B.js.map → chunk-MQ7FLIYS.js.map} +1 -1
  52. package/dist/{chunk-NUIZ6ZUO.js → chunk-MVR3SYMN.js} +6 -8
  53. package/dist/chunk-MVR3SYMN.js.map +1 -0
  54. package/dist/{chunk-ZKJAJWK6.js → chunk-MWG4VU64.js} +12 -17
  55. package/dist/{chunk-ZKJAJWK6.js.map → chunk-MWG4VU64.js.map} +1 -1
  56. package/dist/{chunk-ES3NJZON.js → chunk-NR3OZGL4.js} +1 -5
  57. package/dist/{chunk-ES3NJZON.js.map → chunk-NR3OZGL4.js.map} +1 -1
  58. package/dist/{chunk-GYG5SE2D.js → chunk-ODNDXQH2.js} +2 -6
  59. package/dist/{chunk-GYG5SE2D.js.map → chunk-ODNDXQH2.js.map} +1 -1
  60. package/dist/{chunk-2RSNKBXC.js → chunk-P44SXVH3.js} +6 -10
  61. package/dist/{chunk-2RSNKBXC.js.map → chunk-P44SXVH3.js.map} +1 -1
  62. package/dist/{chunk-3LIU2ZEF.js → chunk-PMM2MYMA.js} +3 -16
  63. package/dist/{chunk-3LIU2ZEF.js.map → chunk-PMM2MYMA.js.map} +1 -1
  64. package/dist/{chunk-6I6RZHYP.js → chunk-PZIZNMHK.js} +24 -36
  65. package/dist/chunk-PZIZNMHK.js.map +1 -0
  66. package/dist/{chunk-C55DN7GE.js → chunk-Q2KG7UV3.js} +3 -5
  67. package/dist/chunk-Q2KG7UV3.js.map +1 -0
  68. package/dist/{chunk-QQLRX4KI.js → chunk-Q45ZU6HD.js} +2 -6
  69. package/dist/{chunk-QQLRX4KI.js.map → chunk-Q45ZU6HD.js.map} +1 -1
  70. package/dist/{chunk-HIPGKIT3.js → chunk-QRDTLVXG.js} +9 -14
  71. package/dist/{chunk-HIPGKIT3.js.map → chunk-QRDTLVXG.js.map} +1 -1
  72. package/dist/{chunk-VIFZ6NFH.js → chunk-QZZJFYUQ.js} +3 -7
  73. package/dist/{chunk-VIFZ6NFH.js.map → chunk-QZZJFYUQ.js.map} +1 -1
  74. package/dist/{chunk-E4FT2KFV.js → chunk-R5NOI2LP.js} +13 -17
  75. package/dist/{chunk-E4FT2KFV.js.map → chunk-R5NOI2LP.js.map} +1 -1
  76. package/dist/{chunk-DUVWGO6E.js → chunk-RNJWAKMO.js} +3 -7
  77. package/dist/{chunk-DUVWGO6E.js.map → chunk-RNJWAKMO.js.map} +1 -1
  78. package/dist/{chunk-N4IZ6GBO.js → chunk-SBHBBZKF.js} +7 -23
  79. package/dist/chunk-SBHBBZKF.js.map +1 -0
  80. package/dist/{chunk-EN2GCPW7.js → chunk-SKQWRUPX.js} +10 -14
  81. package/dist/{chunk-EN2GCPW7.js.map → chunk-SKQWRUPX.js.map} +1 -1
  82. package/dist/{chunk-DDG4F3FE.js → chunk-STMHDOZD.js} +4 -21
  83. package/dist/chunk-STMHDOZD.js.map +1 -0
  84. package/dist/{chunk-5K5RBRTD.js → chunk-SX5H6TSC.js} +7 -11
  85. package/dist/chunk-SX5H6TSC.js.map +1 -0
  86. package/dist/{chunk-RBHYLCUB.js → chunk-TJJPWUMA.js} +2 -6
  87. package/dist/{chunk-RBHYLCUB.js.map → chunk-TJJPWUMA.js.map} +1 -1
  88. package/dist/{chunk-IOJR5TOY.js → chunk-TSIU7DME.js} +1 -5
  89. package/dist/{chunk-IOJR5TOY.js.map → chunk-TSIU7DME.js.map} +1 -1
  90. package/dist/{chunk-RP7R73JO.js → chunk-TUPYW2IQ.js} +3 -7
  91. package/dist/{chunk-RP7R73JO.js.map → chunk-TUPYW2IQ.js.map} +1 -1
  92. package/dist/{chunk-YU2VGX5R.js → chunk-UBEDZ4FD.js} +1 -8
  93. package/dist/{chunk-YU2VGX5R.js.map → chunk-UBEDZ4FD.js.map} +1 -1
  94. package/dist/{chunk-VEP23B5W.js → chunk-VASLW636.js} +1 -5
  95. package/dist/{chunk-VEP23B5W.js.map → chunk-VASLW636.js.map} +1 -1
  96. package/dist/{chunk-PG4G4IIK.js → chunk-VY6MNOXL.js} +2 -6
  97. package/dist/{chunk-PG4G4IIK.js.map → chunk-VY6MNOXL.js.map} +1 -1
  98. package/dist/{chunk-IHO75PMZ.js → chunk-WBCPLH66.js} +15 -13
  99. package/dist/chunk-WBCPLH66.js.map +1 -0
  100. package/dist/{chunk-DJAZE4PD.js → chunk-WKTHWQKM.js} +297 -302
  101. package/dist/chunk-WKTHWQKM.js.map +1 -0
  102. package/dist/{chunk-RJN7W2C7.js → chunk-XHUODHZ4.js} +19 -25
  103. package/dist/{chunk-RJN7W2C7.js.map → chunk-XHUODHZ4.js.map} +1 -1
  104. package/dist/{chunk-KIR7VYQD.js → chunk-XVAQG2CV.js} +1 -5
  105. package/dist/{chunk-KIR7VYQD.js.map → chunk-XVAQG2CV.js.map} +1 -1
  106. package/dist/{chunk-P3PN5SVI.js → chunk-ZL7PFNHN.js} +2 -6
  107. package/dist/{chunk-P3PN5SVI.js.map → chunk-ZL7PFNHN.js.map} +1 -1
  108. package/dist/{chunk-ZDLTLNU2.js → chunk-ZPPHXXAP.js} +9 -15
  109. package/dist/{chunk-ZDLTLNU2.js.map → chunk-ZPPHXXAP.js.map} +1 -1
  110. package/dist/commands/build/marketplace.js +10 -15
  111. package/dist/commands/build/marketplace.js.map +1 -1
  112. package/dist/commands/build/plugins.js +9 -14
  113. package/dist/commands/build/plugins.js.map +1 -1
  114. package/dist/commands/compile.js +14 -19
  115. package/dist/commands/compile.js.map +1 -1
  116. package/dist/commands/doctor.js +13 -18
  117. package/dist/commands/doctor.js.map +1 -1
  118. package/dist/commands/edit.js +51 -55
  119. package/dist/commands/edit.js.map +1 -1
  120. package/dist/commands/eject.js +13 -18
  121. package/dist/commands/eject.js.map +1 -1
  122. package/dist/commands/import/skill.js +9 -14
  123. package/dist/commands/import/skill.js.map +1 -1
  124. package/dist/commands/init.js +50 -51
  125. package/dist/commands/list.js +14 -16
  126. package/dist/commands/list.js.map +1 -1
  127. package/dist/commands/new/agent.js +12 -16
  128. package/dist/commands/new/agent.js.map +1 -1
  129. package/dist/commands/new/marketplace.js +15 -20
  130. package/dist/commands/new/marketplace.js.map +1 -1
  131. package/dist/commands/new/skill.js +11 -13
  132. package/dist/commands/search.js +14 -19
  133. package/dist/commands/search.js.map +1 -1
  134. package/dist/commands/uninstall.js +17 -21
  135. package/dist/commands/uninstall.js.map +1 -1
  136. package/dist/commands/update.js +17 -21
  137. package/dist/commands/update.js.map +1 -1
  138. package/dist/commands/validate.js +10 -16
  139. package/dist/commands/validate.js.map +1 -1
  140. package/dist/components/common/confirm.js +1 -2
  141. package/dist/components/common/prompt-confirm.js +2 -2
  142. package/dist/components/common/select-list.js +3 -4
  143. package/dist/components/common/spinner.js +1 -2
  144. package/dist/components/wizard/category-grid.js +8 -9
  145. package/dist/components/wizard/checkbox-grid.js +6 -7
  146. package/dist/components/wizard/domain-selection.js +14 -15
  147. package/dist/components/wizard/run-wizard-session.js +40 -40
  148. package/dist/components/wizard/scroll-affordance.js +2 -3
  149. package/dist/components/wizard/search-modal.js +6 -7
  150. package/dist/components/wizard/selection-card.js +2 -3
  151. package/dist/components/wizard/skill-agent-summary.js +8 -9
  152. package/dist/components/wizard/source-grid.js +13 -14
  153. package/dist/components/wizard/stack-selection.js +12 -13
  154. package/dist/components/wizard/step-agents.js +14 -15
  155. package/dist/components/wizard/step-build.js +14 -15
  156. package/dist/components/wizard/step-confirm.js +13 -14
  157. package/dist/components/wizard/step-settings.js +11 -12
  158. package/dist/components/wizard/step-sources.js +20 -21
  159. package/dist/components/wizard/step-stack.js +13 -14
  160. package/dist/components/wizard/summary-panel.js +12 -13
  161. package/dist/components/wizard/toast.js +2 -3
  162. package/dist/components/wizard/wizard-layout.js +18 -19
  163. package/dist/components/wizard/wizard-tabs.js +8 -9
  164. package/dist/components/wizard/wizard.js +38 -39
  165. package/dist/config-exports.js +1 -7
  166. package/dist/config-exports.js.map +1 -1
  167. package/dist/copy-local-skills-6EMVN7RB.js +14 -0
  168. package/dist/hooks/init.js +50 -54
  169. package/dist/hooks/init.js.map +1 -1
  170. package/dist/index.js +0 -4
  171. package/dist/index.js.map +1 -1
  172. package/dist/load-agent-defs-BWOUVEAR.js +15 -0
  173. package/dist/{loader-E2ERJYVA.js → loader-5JP4S7CJ.js} +4 -5
  174. package/dist/recompile-project-agents-6DL45TDI.js +19 -0
  175. package/dist/{source-loader-VVHMQEX5.js → source-loader-MZYCPL2S.js} +7 -8
  176. package/dist/stores/wizard-store.js +7 -8
  177. package/package.json +22 -21
  178. package/dist/chunk-4GL2F5AB.js.map +0 -1
  179. package/dist/chunk-5K5RBRTD.js.map +0 -1
  180. package/dist/chunk-6I6RZHYP.js.map +0 -1
  181. package/dist/chunk-C55DN7GE.js.map +0 -1
  182. package/dist/chunk-DAG2ULNF.js.map +0 -1
  183. package/dist/chunk-DDG4F3FE.js.map +0 -1
  184. package/dist/chunk-DIBCRIMR.js +0 -36
  185. package/dist/chunk-DIBCRIMR.js.map +0 -1
  186. package/dist/chunk-DJAZE4PD.js.map +0 -1
  187. package/dist/chunk-EKWAUOQB.js +0 -96
  188. package/dist/chunk-EKWAUOQB.js.map +0 -1
  189. package/dist/chunk-I3XKEGHM.js +0 -16383
  190. package/dist/chunk-I3XKEGHM.js.map +0 -1
  191. package/dist/chunk-IHO75PMZ.js.map +0 -1
  192. package/dist/chunk-K3OU6TGX.js +0 -77
  193. package/dist/chunk-K3OU6TGX.js.map +0 -1
  194. package/dist/chunk-KH7MOIM5.js.map +0 -1
  195. package/dist/chunk-KSZ6PCY4.js +0 -43
  196. package/dist/chunk-KSZ6PCY4.js.map +0 -1
  197. package/dist/chunk-MC5DUZ3V.js.map +0 -1
  198. package/dist/chunk-N4IZ6GBO.js.map +0 -1
  199. package/dist/chunk-NUIZ6ZUO.js.map +0 -1
  200. package/dist/chunk-OA5SUEQD.js +0 -181
  201. package/dist/chunk-OA5SUEQD.js.map +0 -1
  202. package/dist/chunk-P56WJ5FA.js +0 -50
  203. package/dist/chunk-P56WJ5FA.js.map +0 -1
  204. package/dist/chunk-SYUOXSPU.js.map +0 -1
  205. package/dist/chunk-THKIOI32.js +0 -939
  206. package/dist/chunk-THKIOI32.js.map +0 -1
  207. package/dist/chunk-V7QOSGQA.js +0 -298
  208. package/dist/chunk-V7QOSGQA.js.map +0 -1
  209. package/dist/chunk-YKKIJHZB.js.map +0 -1
  210. package/dist/components/common/confirm.test.js +0 -203
  211. package/dist/components/common/confirm.test.js.map +0 -1
  212. package/dist/components/wizard/category-grid.test.js +0 -1253
  213. package/dist/components/wizard/category-grid.test.js.map +0 -1
  214. package/dist/components/wizard/checkbox-grid.test.js +0 -264
  215. package/dist/components/wizard/checkbox-grid.test.js.map +0 -1
  216. package/dist/components/wizard/search-modal.test.js +0 -212
  217. package/dist/components/wizard/search-modal.test.js.map +0 -1
  218. package/dist/components/wizard/source-grid.test.js +0 -1094
  219. package/dist/components/wizard/source-grid.test.js.map +0 -1
  220. package/dist/components/wizard/step-agents.test.js +0 -204
  221. package/dist/components/wizard/step-agents.test.js.map +0 -1
  222. package/dist/components/wizard/step-build.test.js +0 -552
  223. package/dist/components/wizard/step-build.test.js.map +0 -1
  224. package/dist/components/wizard/step-confirm.test.js +0 -744
  225. package/dist/components/wizard/step-confirm.test.js.map +0 -1
  226. package/dist/components/wizard/step-settings.test.js +0 -244
  227. package/dist/components/wizard/step-settings.test.js.map +0 -1
  228. package/dist/components/wizard/step-sources.test.js +0 -155
  229. package/dist/components/wizard/step-sources.test.js.map +0 -1
  230. package/dist/components/wizard/step-stack.test.js +0 -262
  231. package/dist/components/wizard/step-stack.test.js.map +0 -1
  232. package/dist/components/wizard/summary-panel.test.js +0 -317
  233. package/dist/components/wizard/summary-panel.test.js.map +0 -1
  234. package/dist/components/wizard/wizard-layout.test.js +0 -200
  235. package/dist/components/wizard/wizard-layout.test.js.map +0 -1
  236. package/dist/components/wizard/wizard-tabs.test.js +0 -290
  237. package/dist/components/wizard/wizard-tabs.test.js.map +0 -1
  238. package/dist/copy-local-skills-CA7P73RZ.js +0 -15
  239. package/dist/dist-VNJNNJK7.js +0 -550
  240. package/dist/dist-VNJNNJK7.js.map +0 -1
  241. package/dist/load-agent-defs-6MAY5ABI.js +0 -16
  242. package/dist/magic-string.es-5TV73NJD.js +0 -1316
  243. package/dist/magic-string.es-5TV73NJD.js.map +0 -1
  244. package/dist/recompile-project-agents-VYQJ6UZB.js +0 -20
  245. package/dist/source-manager-TPDXV5FO.js +0 -18
  246. package/dist/source-manager-TPDXV5FO.js.map +0 -1
  247. package/dist/stores/d227-same-scope-tombstone-duplicate.test.js +0 -118
  248. package/dist/stores/d227-same-scope-tombstone-duplicate.test.js.map +0 -1
  249. package/dist/stores/wizard-store.test.js +0 -3053
  250. package/dist/stores/wizard-store.test.js.map +0 -1
  251. /package/dist/{copy-local-skills-CA7P73RZ.js.map → copy-local-skills-6EMVN7RB.js.map} +0 -0
  252. /package/dist/{load-agent-defs-6MAY5ABI.js.map → load-agent-defs-BWOUVEAR.js.map} +0 -0
  253. /package/dist/{loader-E2ERJYVA.js.map → loader-5JP4S7CJ.js.map} +0 -0
  254. /package/dist/{recompile-project-agents-VYQJ6UZB.js.map → recompile-project-agents-6DL45TDI.js.map} +0 -0
  255. /package/dist/{source-loader-VVHMQEX5.js.map → source-loader-MZYCPL2S.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,10 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- init_esm_shims
4
- } from "./chunk-P56WJ5FA.js";
5
2
 
6
3
  // src/cli/index.ts
7
- init_esm_shims();
8
4
  import { run, flush, Errors } from "@oclif/core";
9
5
  run(void 0, import.meta.url).then(() => flush()).catch((error) => Errors.handle(error));
10
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/index.ts"],"sourcesContent":["import { run, flush, Errors } from \"@oclif/core\";\n\nrun(undefined, import.meta.url)\n .then(() => flush())\n .catch((error) => Errors.handle(error));\n"],"mappings":";;;;;;AAAA;AAAA,SAAS,KAAK,OAAO,cAAc;AAEnC,IAAI,QAAW,YAAY,GAAG,EAC3B,KAAK,MAAM,MAAM,CAAC,EAClB,MAAM,CAAC,UAAU,OAAO,OAAO,KAAK,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/cli/index.ts"],"sourcesContent":["import { run, flush, Errors } from \"@oclif/core\";\n\nrun(undefined, import.meta.url)\n .then(() => flush())\n .catch((error) => Errors.handle(error));\n"],"mappings":";;;AAAA,SAAS,KAAK,OAAO,cAAc;AAEnC,IAAI,QAAW,YAAY,GAAG,EAC3B,KAAK,MAAM,MAAM,CAAC,EAClB,MAAM,CAAC,UAAU,OAAO,OAAO,KAAK,CAAC;","names":[]}
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ loadAgentDefs
4
+ } from "./chunk-QZZJFYUQ.js";
5
+ import "./chunk-E5X6RJ4E.js";
6
+ import "./chunk-EEPELKOM.js";
7
+ import "./chunk-PMM2MYMA.js";
8
+ import "./chunk-WKTHWQKM.js";
9
+ import "./chunk-VASLW636.js";
10
+ import "./chunk-76ADG7LQ.js";
11
+ import "./chunk-UBEDZ4FD.js";
12
+ export {
13
+ loadAgentDefs
14
+ };
15
+ //# sourceMappingURL=load-agent-defs-BWOUVEAR.js.map
@@ -7,10 +7,9 @@ import {
7
7
  loadSkillsByIds,
8
8
  loadSkillsFromDir,
9
9
  parseFrontmatter
10
- } from "./chunk-3LIU2ZEF.js";
11
- import "./chunk-VEP23B5W.js";
12
- import "./chunk-O5ASLZ2K.js";
13
- import "./chunk-P56WJ5FA.js";
10
+ } from "./chunk-PMM2MYMA.js";
11
+ import "./chunk-VASLW636.js";
12
+ import "./chunk-76ADG7LQ.js";
14
13
  export {
15
14
  loadAllAgents,
16
15
  loadMergedAgents,
@@ -20,4 +19,4 @@ export {
20
19
  loadSkillsFromDir,
21
20
  parseFrontmatter
22
21
  };
23
- //# sourceMappingURL=loader-E2ERJYVA.js.map
22
+ //# sourceMappingURL=loader-5JP4S7CJ.js.map
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ recompilePropagatedProjectAgents,
4
+ recompileRegisteredProjectAgents
5
+ } from "./chunk-SBHBBZKF.js";
6
+ import "./chunk-IHUY4M22.js";
7
+ import "./chunk-QZZJFYUQ.js";
8
+ import "./chunk-E5X6RJ4E.js";
9
+ import "./chunk-EEPELKOM.js";
10
+ import "./chunk-PMM2MYMA.js";
11
+ import "./chunk-WKTHWQKM.js";
12
+ import "./chunk-VASLW636.js";
13
+ import "./chunk-76ADG7LQ.js";
14
+ import "./chunk-UBEDZ4FD.js";
15
+ export {
16
+ recompilePropagatedProjectAgents,
17
+ recompileRegisteredProjectAgents
18
+ };
19
+ //# sourceMappingURL=recompile-project-agents-6DL45TDI.js.map
@@ -4,17 +4,16 @@ import {
4
4
  extractSourceName,
5
5
  loadSkillsMatrixFromSource,
6
6
  mergeLocalSkillsIntoMatrix
7
- } from "./chunk-KH7MOIM5.js";
8
- import "./chunk-3LIU2ZEF.js";
9
- import "./chunk-DJAZE4PD.js";
10
- import "./chunk-VEP23B5W.js";
11
- import "./chunk-O5ASLZ2K.js";
12
- import "./chunk-YU2VGX5R.js";
13
- import "./chunk-P56WJ5FA.js";
7
+ } from "./chunk-EEPELKOM.js";
8
+ import "./chunk-PMM2MYMA.js";
9
+ import "./chunk-WKTHWQKM.js";
10
+ import "./chunk-VASLW636.js";
11
+ import "./chunk-76ADG7LQ.js";
12
+ import "./chunk-UBEDZ4FD.js";
14
13
  export {
15
14
  convertStackToResolvedStack,
16
15
  extractSourceName,
17
16
  loadSkillsMatrixFromSource,
18
17
  mergeLocalSkillsIntoMatrix
19
18
  };
20
- //# sourceMappingURL=source-loader-VVHMQEX5.js.map
19
+ //# sourceMappingURL=source-loader-MZYCPL2S.js.map
@@ -4,14 +4,13 @@ import {
4
4
  createInitialState,
5
5
  hydrateWizardStore,
6
6
  useWizardStore
7
- } from "../chunk-MC5DUZ3V.js";
8
- import "../chunk-KH7MOIM5.js";
9
- import "../chunk-3LIU2ZEF.js";
10
- import "../chunk-DJAZE4PD.js";
11
- import "../chunk-VEP23B5W.js";
12
- import "../chunk-O5ASLZ2K.js";
13
- import "../chunk-YU2VGX5R.js";
14
- import "../chunk-P56WJ5FA.js";
7
+ } from "../chunk-5UWKOOIS.js";
8
+ import "../chunk-EEPELKOM.js";
9
+ import "../chunk-PMM2MYMA.js";
10
+ import "../chunk-WKTHWQKM.js";
11
+ import "../chunk-VASLW636.js";
12
+ import "../chunk-76ADG7LQ.js";
13
+ import "../chunk-UBEDZ4FD.js";
15
14
  export {
16
15
  WIZARD_STEP_ORDER,
17
16
  createInitialState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-inc",
3
- "version": "0.150.0",
3
+ "version": "0.152.0",
4
4
  "description": "CLI for managing Agents Inc. skills, stacks, and agents for Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,6 @@
19
19
  "files": [
20
20
  "dist/",
21
21
  "assets/",
22
- "config/",
23
22
  "src/agents/",
24
23
  "src/schemas/",
25
24
  "LICENSE",
@@ -79,12 +78,13 @@
79
78
  "format": "prettier --write .",
80
79
  "format:check": "prettier --check .",
81
80
  "lint": "eslint .",
82
- "typecheck": "tsc --noEmit && echo '✓ No TypeScript errors'",
81
+ "typecheck": "tsc --noEmit && tsc -p tsconfig.scripts.json --noEmit && tsc -p e2e/tsconfig.json --noEmit && echo '✓ No TypeScript errors'",
83
82
  "typecheck:scripts": "tsc -p tsconfig.scripts.json --noEmit",
84
83
  "generate:types": "bun scripts/generate-source-types.ts",
85
- "generate:schemas": "npx tsx scripts/generate-json-schemas.ts",
86
- "generate:schemas:check": "npm run generate:schemas && git diff --exit-code src/schemas/",
87
- "prepublishOnly": "bun run format:check && bun run lint && bun run typecheck && bun run build && bun run test"
84
+ "generate:schemas": "bun scripts/generate-json-schemas.ts",
85
+ "generate:schemas:check": "bun run generate:schemas && git diff --exit-code src/schemas/",
86
+ "prepublishOnly": "bun run format:check && bun run lint && bun run typecheck && bun run generate:schemas:check && bun run generate:types:check && bun run build && bun run test",
87
+ "generate:types:check": "bun run generate:types && git diff --exit-code src/cli/types/generated/"
88
88
  },
89
89
  "repository": {
90
90
  "type": "git",
@@ -110,35 +110,36 @@
110
110
  "fs-extra": "^11.2.0",
111
111
  "giget": "^1.2.0",
112
112
  "gray-matter": "^4.0.3",
113
- "ink": "^5.0.0",
113
+ "ink": "^7",
114
114
  "jiti": "2.4.2",
115
115
  "liquidjs": "^10.24.0",
116
- "react": "^18.2.0",
116
+ "react": "^19.2.6",
117
117
  "remeda": "^2.33.6",
118
- "yaml": "^2.8.2",
119
- "zod": "^4.3.6",
120
- "zustand": "^5.0.0"
118
+ "yaml": "^2.9.0",
119
+ "zod": "^4.4.3",
120
+ "zustand": "^5.0.14"
121
121
  },
122
122
  "devDependencies": {
123
- "@eslint/js": "^9.39.5",
123
+ "@eslint/js": "^10",
124
124
  "@lydell/node-pty": "^1.2.0-beta.3",
125
125
  "@oclif/test": "^4.0.0",
126
126
  "@types/fs-extra": "^11.0.0",
127
- "@types/node": "^22.0.0",
128
- "@types/react": "^18.2.0",
127
+ "@types/node": "^24",
128
+ "@types/react": "^19",
129
129
  "@vitest/coverage-v8": "^4.0.18",
130
130
  "@xterm/headless": "^6.0.0",
131
- "eslint": "^9.39.5",
132
- "eslint-config-prettier": "^10.1.8",
131
+ "eslint": "^10",
132
+ "eslint-config-prettier": "^10",
133
+ "eslint-plugin-react-hooks": "^7.1.1",
133
134
  "ink-testing-library": "^4.0.0",
134
- "prettier": "^3.2.0",
135
+ "prettier": "^3.8.3",
135
136
  "tree-kill": "^1.2.2",
136
137
  "tsup": "^8.0.0",
137
- "typescript": "^5.7.0",
138
- "typescript-eslint": "^8.65.0",
139
- "vitest": "^4.0.18"
138
+ "typescript": "~6",
139
+ "typescript-eslint": "^8",
140
+ "vitest": "^4"
140
141
  },
141
142
  "engines": {
142
- "node": ">=18.0.0"
143
+ "node": ">=22"
143
144
  }
144
145
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/components/wizard/stack-selection.tsx"],"sourcesContent":["import { groupBy } from \"remeda\";\nimport { useKeyboardNavigation } from \"../hooks/use-keyboard-navigation.js\";\nimport { Box, Text } from \"ink\";\nimport React, { useMemo } from \"react\";\nimport { CLI_COLORS, DEFAULT_SCRATCH_DOMAINS, UI_SYMBOLS } from \"../../consts.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { useRowScroll } from \"../hooks/use-row-scroll.js\";\n\nimport type { AgentName, ResolvedStack } from \"../../types/index.js\";\nimport { typedKeys } from \"../../utils/typed-object.js\";\n\ntype StackItem = Pick<ResolvedStack, \"id\" | \"name\" | \"description\">;\ntype StackGroup = { label: string; items: StackItem[] };\n/** A focusable row id: a stack id, or the \"scratch\" sentinel for the \"Start from scratch\" row. */\ntype FocusId = string;\n\nconst OTHER_FRAMEWORKS_LABEL = \"Other Frameworks\";\nconst GROUP_ORDER: string[] = [\"React\", \"CLI\"];\nconst SCRATCH_LABEL = \"Start from scratch\";\nconst SCRATCH_DESCRIPTION = \"Select domains and skills manually\";\n\ntype GroupableStack = Pick<ResolvedStack, \"id\" | \"name\" | \"description\" | \"group\">;\n\nfunction toStackItem(stack: GroupableStack): StackItem {\n return { id: stack.id, name: stack.name, description: stack.description };\n}\n\n/** GROUP_ORDER labels first (in order), then unknown labels alphabetically. */\nfunction compareGroupLabels(a: string, b: string): number {\n const ai = GROUP_ORDER.indexOf(a);\n const bi = GROUP_ORDER.indexOf(b);\n if (ai !== -1 && bi !== -1) return ai - bi;\n if (ai !== -1) return -1;\n if (bi !== -1) return 1;\n return a.localeCompare(b);\n}\n\nfunction groupStacks(stacks: GroupableStack[]): StackGroup[] {\n // `|| undefined` keeps an empty-string group ungrouped; groupBy drops undefined keys.\n const byLabel = groupBy(stacks, (stack) => stack.group || undefined);\n const ungrouped = stacks.filter((stack) => !stack.group).map(toStackItem);\n\n // No explicit groups — flat list, no headers\n const sortedLabels = Object.keys(byLabel).sort(compareGroupLabels);\n if (sortedLabels.length === 0) {\n return [{ label: \"\", items: ungrouped }];\n }\n\n const groups = sortedLabels.map((label) => ({\n label,\n items: byLabel[label].map(toStackItem),\n }));\n return ungrouped.length > 0\n ? [...groups, { label: OTHER_FRAMEWORKS_LABEL, items: ungrouped }]\n : groups;\n}\n\nfunction buildFocusableIds(groups: StackGroup[]): FocusId[] {\n return [...groups.flatMap((g) => g.items.map((i) => i.id)), \"scratch\"];\n}\n\ntype StackListRow =\n | { type: \"header\"; label: string }\n | { type: \"spacer\" }\n | { type: \"stack\"; item: StackItem }\n | { type: \"scratch\" };\n\n/** One row per rendered line — headers, spacers, stack items, then the scratch row. */\nfunction buildStackRows(groups: StackGroup[]): StackListRow[] {\n const groupRows = groups.flatMap((group, groupIndex): StackListRow[] => [\n ...(groupIndex > 0 ? [{ type: \"spacer\" as const }] : []),\n ...(group.label ? [{ type: \"header\" as const, label: group.label }] : []),\n ...group.items.map((item): StackListRow => ({ type: \"stack\", item })),\n ]);\n return [...groupRows, { type: \"spacer\" }, { type: \"scratch\" }];\n}\n\nfunction isRowFocused(row: StackListRow, focusedId: FocusId): boolean {\n if (row.type === \"stack\") return row.item.id === focusedId;\n return row.type === \"scratch\" && focusedId === \"scratch\";\n}\n\nconst StackRow: React.FC<{ item: StackItem; isFocused: boolean }> = ({ item, isFocused }) => {\n const pointer = isFocused ? UI_SYMBOLS.CHEVRON : UI_SYMBOLS.CHEVRON_SPACER;\n return (\n <Box flexShrink={0}>\n <Text>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined}>{pointer}</Text>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined} bold={isFocused}>\n {\" \"}\n {item.name}\n </Text>\n <Text dimColor>\n {\" \"}\n {item.description}\n </Text>\n </Text>\n </Box>\n );\n};\n\nconst ScratchRow: React.FC<{ isFocused: boolean }> = ({ isFocused }) => {\n const pointer = isFocused ? UI_SYMBOLS.CHEVRON : UI_SYMBOLS.CHEVRON_SPACER;\n return (\n <Box flexShrink={0}>\n <Text>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined}>{pointer}</Text>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined} bold={isFocused}>\n {\" \"}\n {SCRATCH_LABEL}\n </Text>\n <Text dimColor>\n {\" \"}\n {SCRATCH_DESCRIPTION}\n </Text>\n </Text>\n </Box>\n );\n};\n\nexport type StackSelectionProps = {\n onCancel?: () => void;\n};\n\nexport const StackSelection: React.FC<StackSelectionProps> = ({ onCancel }) => {\n const {\n selectStack,\n setApproach,\n setStackAction,\n populateFromSkillIds,\n preselectAgentsFromStack,\n toggleDomain,\n setStep,\n } = useWizardStore();\n\n const stacks = matrix.suggestedStacks;\n const groups = useMemo(() => groupStacks(stacks), [stacks]);\n const rows = useMemo(() => buildStackRows(groups), [groups]);\n const focusableIds = useMemo(() => buildFocusableIds(groups), [groups]);\n\n const { focusedIndex } = useKeyboardNavigation(focusableIds.length, {\n onEscape: onCancel,\n onEnter: (index) => handleSelect(focusableIds[index] ?? \"scratch\"),\n });\n const focusedId: FocusId = focusableIds[focusedIndex] ?? \"scratch\";\n const { ref: listRef, measuredHeight: listHeight } = useMeasuredHeight();\n\n const focusedVisualRow = useMemo(\n () => rows.findIndex((row) => isRowFocused(row, focusedId)),\n [rows, focusedId],\n );\n\n const { scrollEnabled, scrollTop } = useRowScroll({\n focusedIndex: focusedVisualRow,\n itemCount: rows.length,\n availableHeight: listHeight,\n });\n\n function handleSelect(selectedId: FocusId): void {\n if (selectedId === \"scratch\") {\n selectStack(null);\n setApproach(\"scratch\");\n\n // Restore global agent preselections (selectStack wipes selectedAgents/agentConfigs)\n const globalAgentPre = useWizardStore.getState().globalAgentPreselections;\n if (globalAgentPre) {\n useWizardStore.setState({\n selectedAgents: globalAgentPre.agents,\n agentConfigs: globalAgentPre.configs,\n });\n }\n\n // Pre-select global skills first (sets selectedDomains to global skill domains)\n const globalPreselections = useWizardStore.getState().globalPreselections;\n if (globalPreselections?.length) {\n populateFromSkillIds(\n globalPreselections.map((s) => s.id),\n globalPreselections,\n );\n }\n\n // Then toggle scratch domains (additive — adds any not already selected)\n for (const domain of DEFAULT_SCRATCH_DOMAINS) {\n if (!useWizardStore.getState().selectedDomains.includes(domain)) {\n toggleDomain(domain);\n }\n }\n\n setStep(\"domains\");\n return;\n }\n const focusedStack = stacks.find((s) => s.id === selectedId);\n if (focusedStack) {\n selectStack(focusedStack.id);\n setStackAction(\"customize\");\n\n // Derive agent preselection from stack agent keys, merged with global agent preselections\n const stackAgents = typedKeys<AgentName>(focusedStack.skills);\n preselectAgentsFromStack(stackAgents);\n\n // Merge global preselections with stack skills\n const globalPreselections = useWizardStore.getState().globalPreselections;\n const globalIds = globalPreselections?.map((s) => s.id) ?? [];\n const mergedIds = [...new Set([...focusedStack.allSkillIds, ...globalIds])];\n populateFromSkillIds(mergedIds, globalPreselections ?? undefined);\n\n setApproach(\"stack\");\n setStep(\"domains\");\n }\n }\n\n return (\n <Box ref={listRef} flexDirection=\"column\" flexGrow={1} flexBasis={0}>\n <Box\n flexDirection=\"column\"\n flexGrow={1}\n {...(scrollEnabled && { overflow: \"hidden\" as const })}\n >\n <Box\n flexDirection=\"column\"\n marginTop={scrollTop > 0 ? -scrollTop : 0}\n {...(scrollEnabled && { flexShrink: 0 })}\n >\n {rows.map((row, index) => {\n switch (row.type) {\n case \"spacer\":\n return (\n <Box key={`spacer-${index}`} flexShrink={0}>\n <Text> </Text>\n </Box>\n );\n case \"header\":\n return (\n <Box key={`header-${row.label}`} flexShrink={0}>\n <Text dimColor bold>\n {\" \"}\n {row.label}\n </Text>\n </Box>\n );\n case \"stack\":\n return (\n <StackRow\n key={row.item.id}\n item={row.item}\n isFocused={row.item.id === focusedId}\n />\n );\n case \"scratch\":\n return <ScratchRow key=\"scratch\" isFocused={focusedId === \"scratch\"} />;\n default: {\n const _exhaustive: never = row;\n return _exhaustive;\n }\n }\n })}\n </Box>\n </Box>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,eAAe;AAExB,SAAS,KAAK,YAAY;AAC1B,SAAgB,eAAe;AAsFvB,cACA,YADA;AAvER,IAAM,yBAAyB;AAC/B,IAAM,cAAwB,CAAC,SAAS,KAAK;AAC7C,IAAM,gBAAgB;AACtB,IAAM,sBAAsB;AAI5B,SAAS,YAAY,OAAkC;AACrD,SAAO,EAAE,IAAI,MAAM,IAAI,MAAM,MAAM,MAAM,aAAa,MAAM,YAAY;AAC1E;AAGA,SAAS,mBAAmB,GAAW,GAAmB;AACxD,QAAM,KAAK,YAAY,QAAQ,CAAC;AAChC,QAAM,KAAK,YAAY,QAAQ,CAAC;AAChC,MAAI,OAAO,MAAM,OAAO,GAAI,QAAO,KAAK;AACxC,MAAI,OAAO,GAAI,QAAO;AACtB,MAAI,OAAO,GAAI,QAAO;AACtB,SAAO,EAAE,cAAc,CAAC;AAC1B;AAEA,SAAS,YAAY,QAAwC;AAE3D,QAAM,UAAU,QAAQ,QAAQ,CAAC,UAAU,MAAM,SAAS,MAAS;AACnE,QAAM,YAAY,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,EAAE,IAAI,WAAW;AAGxE,QAAM,eAAe,OAAO,KAAK,OAAO,EAAE,KAAK,kBAAkB;AACjE,MAAI,aAAa,WAAW,GAAG;AAC7B,WAAO,CAAC,EAAE,OAAO,IAAI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AS,eAAc,UAAS,UAAU,GAAG,WAAW,GAChE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,UAAU;AAAA,MACT,GAAI,iBAAiB,EAAE,UAAU,SAAkB;AAAA,MAEpD;AAAA,QAAC;AAAA;AAAA,UACC,eAAc;AAAA,UACd,WAAW,YAAY,IAAI,CAAC,YAAY;AAAA,UACvC,GAAI,iBAAiB,EAAE,YAAY,EAAE;AAAA,UAErC,eAAK,IAAI,CAAC,KAAK,UAAU;AACxB,oBAAQ,IAAI,MAAM;AAAA,cAChB,KAAK;AACH,uBACE,oBAAC,OAA4B,YAAY,GACvC,8BAAC,QAAK,eAAC,KADC,UAAU,KAAK,EAEzB;AAAA,cAEJ,KAAK;AACH,uBACE,oBAAC,OAAgC,YAAY,GAC3C,+BAAC,QAAK,UAAQ,MAAC,MAAI,MAChB;AAAA;AAAA,kBACA,IAAI;AAAA,mBACP,KAJQ,UAAU,IAAI,KAAK,EAK7B;AAAA,cAEJ,KAAK;AACH,uBACE;AAAA,kBAAC;AAAA;AAAA,oBAEC,MAAM,IAAI;AAAA,oBACV,WAAW,IAAI,KAAK,OAAO;AAAA;AAAA,kBAFtB,IAAI,KAAK;AAAA,gBAGhB;AAAA,cAEJ,KAAK;AACH,uBAAO,oBAAC,cAAyB,WAAW,cAAc,aAAnC,SAA8C;AAAA,cACvE,SAAS;AACP,sBAAM,cAAqB;AAC3B,uBAAO;AAAA,cACT;AAAA,YACF;AAAA,UACF,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/components/wizard/domain-selection.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { unique } from \"remeda\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport type { Domain } from \"../../types/index.js\";\nimport { typedEntries } from \"../../utils/typed-object.js\";\nimport { CheckboxGrid, type CheckboxItem } from \"./checkbox-grid.js\";\nimport { BUILT_IN_DOMAIN_DESCRIPTIONS, getDomainDisplayName, orderDomains } from \"./utils.js\";\n\nexport const DomainSelection: React.FC = () => {\n const { selectedDomains, toggleDomain, setStep, setApproach, selectStack, goBack } =\n useWizardStore();\n\n const availableDomains = useMemo((): CheckboxItem<Domain>[] => {\n const matrixDomains = unique(\n typedEntries(matrix.categories)\n .map(([, cat]) => cat?.domain)\n .filter((d): d is Domain => d != null),\n );\n\n const ordered = orderDomains(matrixDomains);\n\n return ordered.map((domain) => ({\n id: domain,\n label: getDomainDisplayName(domain),\n description: BUILT_IN_DOMAIN_DESCRIPTIONS[domain],\n }));\n }, [matrix]);\n\n const handleBack = () => {\n setApproach(null);\n selectStack(null);\n goBack();\n };\n\n return (\n <CheckboxGrid\n items={availableDomains}\n selectedIds={selectedDomains}\n onToggle={toggleDomain}\n onContinue={() => setStep(\"build\")}\n onBack={handleBack}\n emptyMessage=\"Please select at least one domain\"\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAgB,eAAe;AAC/B,SAAS,cAAc;AAmCnB;AA3BG,IAAM,kBAA4B,MAAM;AAC7C,QAAM,EAAE,iBAAiB,cAAc,SAAS,aAAa,aAAa,OAAO,IAC/E,eAAe;AAEjB,QAAM,mBAAmB,QAAQ,MAA8B;AAC7D,UAAM,gBAAgB;AAAA,MACpB,aAAa,OAAO,UAAU,EAC3B,IAAI,CAAC,CAAC,EAAE,GAAG,MAAM,KAAK,MAAM,EAC5B,OAAO,CAAC,MAAmB,KAAK,IAAI;AAAA,IACzC;AAEA,UAAM,UAAU,aAAa,aAAa;AAE1C,WAAO,QAAQ,IAAI,CAAC,YAAY;AAAA,MAC9B,IAAI;AAAA,MACJ,OAAO,qBAAqB,MAAM;AAAA,MAClC,aAAa,6BAA6B,MAAM;AAAA,IAClD,EAAE;AAAA,EACJ,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,aAAa,MAAM;AACvB,gBAAY,IAAI;AAChB,gBAAY,IAAI;AAChB,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,aAAa;AAAA,MACb,UAAU;AAAA,MACV,YAAY,MAAM,QAAQ,OAAO;AAAA,MACjC,QAAQ;AAAA,MACR,cAAa;AAAA;AAAA,EACf;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/commands/init.tsx","../src/cli/lib/seed/fetch-seed.ts","../src/cli/lib/seed/seed-schema.ts","../src/cli/lib/seed/seed-to-wizard.ts","../src/cli/types/agents.ts","../src/cli/lib/permission-checker.tsx"],"sourcesContent":["import os from \"os\";\nimport React from \"react\";\n\nimport { Flags, type Interfaces } from \"@oclif/core\";\nimport { render, Box, Text, useApp } from \"ink\";\n\nimport { BaseCommand, type SourceRefreshFlags } from \"../base-command.js\";\nimport { type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport { runWizardSession } from \"../components/wizard/run-wizard-session.js\";\nimport { useTerminalDimensions } from \"../components/hooks/use-terminal-dimensions.js\";\nimport { type SourceLoadResult } from \"../lib/loading/index.js\";\nimport {\n loadSource,\n loadAgentDefs,\n copyLocalSkills,\n installPluginSkills,\n pluginInstallFailureError,\n writeProjectConfig,\n compileAgentsAllScopes,\n type CompilationResult,\n type SkillCopyResult,\n discoverInstalledSkills,\n} from \"../lib/operations/index.js\";\nimport type { GateReport } from \"../lib/config-gate/index.js\";\nimport { fetchSeedConfig } from \"../lib/seed/fetch-seed.js\";\nimport { seedToWizardResult } from \"../lib/seed/seed-to-wizard.js\";\nimport { getInstallationInfo } from \"../lib/plugins/plugin-info.js\";\nimport {\n loadProjectConfig,\n loadProjectConfigFromDir,\n} from \"../lib/configuration/project-config.js\";\nimport {\n type InstallMode,\n detectInstallation,\n detectGlobalInstallation,\n deriveInstallMode,\n resolveInstallPaths,\n buildAgentScopeMap,\n isHomeDirectory,\n INSTALL_MODE_LABELS,\n} from \"../lib/installation/index.js\";\nimport { checkPermissions } from \"../lib/permission-checker.js\";\nimport {\n ASCII_LOGO,\n CLAUDE_SRC_DIR,\n CLI_INVOKE_COMMAND,\n DEFAULT_BRANDING,\n EDIT_PROJECT_SETUP_FLAG,\n EJECT_SOURCE,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { clearTerminalScreen } from \"../utils/terminal.js\";\nimport { SelectList, type SelectListItem } from \"../components/common/select-list.js\";\nimport { promptValue } from \"../components/common/prompt-confirm.js\";\nimport { Spinner } from \"../components/common/spinner.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport type { AgentName, ProjectConfig, SkillScope } from \"../types/index.js\";\nimport { type StartupMessage } from \"../utils/logger.js\";\nimport { SUCCESS_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nconst DASHBOARD_OPTIONS = [\n { label: \"Edit\", value: \"edit\" },\n { label: \"Compile\", value: \"compile\" },\n { label: \"Doctor\", value: \"doctor\" },\n { label: \"List\", value: \"list\" },\n] as const satisfies readonly SelectListItem<string>[];\n\n/** The commands offered by the project dashboard (single source: DASHBOARD_OPTIONS). */\nexport type DashboardCommand = (typeof DASHBOARD_OPTIONS)[number][\"value\"];\n\ntype DashboardProps = {\n onSelect: (command: DashboardCommand) => void;\n onCancel: () => void;\n};\n\nconst Dashboard: React.FC<DashboardProps> = ({ onSelect, onCancel }) => {\n const { exit } = useApp();\n const { rows: terminalHeight } = useTerminalDimensions();\n\n return (\n <Box flexDirection=\"column\" height={terminalHeight}>\n <Box marginBottom={1}>\n <Text>{ASCII_LOGO}</Text>\n </Box>\n <SelectList\n items={DASHBOARD_OPTIONS}\n onSelect={(command) => {\n onSelect(command);\n exit();\n }}\n onCancel={() => {\n onCancel();\n exit();\n }}\n />\n </Box>\n );\n};\n\n/** Formats the dashboard summary as plain text lines (for non-interactive/test output). */\nexport function formatDashboardText(data: DashboardData): string {\n const modeLabel = INSTALL_MODE_LABELS[data.mode];\n const lines = [\n DEFAULT_BRANDING.NAME,\n \"\",\n ` Skills: ${data.skillCount} installed`,\n ` Agents: ${data.agentCount} compiled`,\n ` Mode: ${modeLabel}`,\n ];\n if (data.source) {\n lines.push(` Source: ${data.source}`);\n }\n lines.push(\"\");\n lines.push(` [Edit] [Compile] [Doctor] [List]`);\n return lines.join(\"\\n\");\n}\n\n/**\n * Shows the project dashboard and returns the selected command (or null if cancelled).\n * In non-interactive environments (no TTY), prints the summary text and returns null.\n */\nexport async function showDashboard(\n projectDir: string,\n log?: (message: string) => void,\n): Promise<DashboardCommand | null> {\n const data = await getDashboardData(projectDir);\n\n // Non-interactive: print text summary and exit (CI, piped, tests)\n if (!process.stdin.isTTY) {\n const output = log ?? console.log;\n output(formatDashboardText(data));\n return null;\n }\n\n // First-wins resolution via promptValue; clearOnResolve repaints a clean\n // terminal before unmount (dashboard occupies the full height).\n const selectedCommand = await promptValue<DashboardCommand | null>(\n (resolve) => (\n <Dashboard onSelect={(command) => resolve(command)} onCancel={() => resolve(null)} />\n ),\n { onExit: null, clearOnResolve: true },\n );\n\n clearTerminalScreen();\n\n return selectedCommand;\n}\n\n/**\n * Why the dashboard is on screen.\n *\n * `\"init\"` — the user ran `cc init` in an already-installed directory. That is a request\n * to set this project up, so choosing Edit continues the setup: it must materialise the\n * project even if the wizard changes nothing.\n *\n * `\"standalone\"` — the bare `cc` dashboard. Edit is just an editor there; a pass with no\n * changes is an inspection and must leave the filesystem untouched.\n */\nexport type DashboardOrigin = \"init\" | \"standalone\";\n\n/** The extra argv a dashboard selection needs to carry its origin into the command. */\nfunction dashboardCommandArgv(command: DashboardCommand, origin: DashboardOrigin): string[] {\n if (command !== \"edit\" || origin !== \"init\") return [];\n return [`--${EDIT_PROJECT_SETUP_FLAG}`];\n}\n\n/**\n * Shared dashboard entry: when the project is already initialized, shows the\n * dashboard and runs the chosen command. Returns true when the project was\n * initialized (dashboard shown), false otherwise. Never exits the process —\n * callers decide (the init hook exits SUCCESS at its own call site).\n */\nexport async function runDashboardFlow(\n projectDir: string,\n config: Interfaces.Config,\n origin: DashboardOrigin,\n log?: (message: string) => void,\n): Promise<boolean> {\n const installation = await detectInstallation(projectDir);\n if (!installation) return false;\n\n const selectedCommand = await showDashboard(projectDir, log);\n if (selectedCommand) {\n await config.runCommand(selectedCommand, dashboardCommandArgv(selectedCommand, origin));\n }\n return true;\n}\n\n/**\n * What `init` decided to install, and the little each producer knows that the shared spine does\n * not. Keeping these on the value rather than branching on a flag downstream is what stops the\n * two paths growing separate copies of the install sequence.\n */\ntype Selection = {\n result: WizardResultV2;\n sourceResult: SourceLoadResult;\n /** Whether a person is at the terminal, so the permission notice may wait for them. */\n interactive: boolean;\n /** What to say if the selection turns out to be empty — only the producer knows why it is. */\n emptyMessage: string;\n};\n\nexport default class Init extends BaseCommand {\n static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;\n static description =\n \"Interactive wizard to set up skills and agents. Supports Plugin Mode (native install) and Eject Mode (copy to .claude/).\";\n\n static examples = [\n {\n description: \"Start the setup wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Initialize from a custom marketplace\",\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 source\",\n default: false,\n }),\n from: Flags.string({\n description: \"Install a configuration shared from agentsinc.sh by its id, without the wizard\",\n helpValue: \"<id>\",\n }),\n };\n\n /**\n * One spine, two producers. The wizard and a shared id differ only in *where the selection\n * comes from* — everything after it (the empty guard, the install pipeline) is identical, so it\n * lives here once rather than being written twice and drifting.\n */\n async run(): Promise<void> {\n const { flags } = await this.parse(Init);\n const projectDir = process.cwd();\n\n // Only a bare `init` is diverted to the dashboard. An id is an explicit instruction to install\n // *that* configuration, so it overrides an existing installation instead.\n if (!flags.from && (await this.showDashboardIfInitialized(projectDir))) return;\n\n const selection = flags.from\n ? await this.selectionFromSharedConfig(flags.from, flags)\n : await this.selectionFromWizard(flags, projectDir);\n\n if (!selection) this.exit(EXIT_CODES.CANCELLED);\n\n // A sub-agent is installable on its own — it has front-matter, a prompt and a compiled file\n // without owning a single skill — so only a selection with neither is nothing to install.\n if (selection.result.skills.length === 0 && selection.result.selectedAgents.length === 0) {\n // The producer supplies the wording because only it knows why empty means what it means:\n // nothing chosen, versus a payload this catalog cannot install.\n this.error(selection.emptyMessage, { exit: EXIT_CODES.ERROR });\n }\n\n await this.handleInstallation(\n selection.result,\n selection.sourceResult,\n flags,\n selection.interactive,\n );\n }\n\n /** The interactive producer: load the source, run the wizard, return what was chosen. */\n private async selectionFromWizard(\n flags: SourceRefreshFlags,\n projectDir: string,\n ): Promise<Selection | null> {\n // The blank global config is created by writeProjectConfig() once the\n // wizard succeeds, never before it renders: a cancelled init must leave no\n // artifact that the next run could mistake for an existing installation.\n const isGlobalRoot = isHomeDirectory(projectDir);\n\n const { unmount, clear: clearSpinner } = render(\n <Spinner label={STATUS_MESSAGES.LOADING_SKILLS} />,\n );\n const [{ sourceResult, startupMessages }, globalConfig] = await Promise.all([\n this.loadSourceOrFail(flags),\n this.loadGlobalConfigIfExists(),\n ]);\n clearSpinner();\n unmount();\n\n const result = await this.runWizard(\n sourceResult,\n startupMessages,\n projectDir,\n globalConfig,\n isGlobalRoot,\n );\n if (!result) return null;\n\n return {\n result,\n sourceResult,\n // A person is already at the terminal, so the permission notice can wait for them.\n interactive: true,\n emptyMessage: \"No skills selected\",\n };\n }\n\n /**\n * The `--from <id>` producer: fetch and map, no wizard. Nothing here may assume a TTY — running\n * headless is most of why the flag exists.\n */\n private async selectionFromSharedConfig(\n id: string,\n flags: SourceRefreshFlags,\n ): Promise<Selection> {\n this.log(`Fetching configuration ${id}...`);\n const fetched = await fetchSeedConfig(id);\n if (!fetched.ok) {\n this.error(fetched.error, { exit: EXIT_CODES.ERROR });\n }\n\n const { sourceResult } = await this.loadSourceOrFail(flags);\n const { result, skippedSkillIds, skippedAgentNames } = seedToWizardResult(\n fetched.payload,\n sourceResult.matrix,\n );\n\n // Named, not counted. \"3 skills were skipped\" cannot be acted on; the ids can, and this is the\n // one moment the user can tell whether what they shared is what they are getting.\n if (skippedSkillIds.length > 0) {\n this.warn(\n `Skipped ${skippedSkillIds.length} skill(s) this catalog does not know: ${skippedSkillIds.join(\", \")}`,\n );\n }\n if (skippedAgentNames.length > 0) {\n this.warn(\n `Skipped ${skippedAgentNames.length} unknown sub-agent(s): ${skippedAgentNames.join(\", \")}`,\n );\n }\n\n if (result.skills.length > 0) {\n this.log(\n `Installing ${result.skills.length} skill(s) across ${result.selectedAgents.length} sub-agent(s)\\n`,\n );\n }\n\n return {\n result,\n sourceResult,\n interactive: false,\n emptyMessage: `Configuration '${id}' contains no skills this catalog can install.`,\n };\n }\n\n private async showDashboardIfInitialized(projectDir: string): Promise<boolean> {\n return runDashboardFlow(projectDir, this.config, \"init\", (msg) => this.log(msg));\n }\n\n private async loadGlobalConfigIfExists(): Promise<ProjectConfig | null> {\n const globalInstall = await detectGlobalInstallation();\n if (!globalInstall) return null;\n const loaded = await loadProjectConfigFromDir(os.homedir());\n return loaded?.config ?? null;\n }\n\n private async loadSourceOrFail(flags: {\n source?: string;\n refresh: boolean;\n }): Promise<{ sourceResult: SourceLoadResult; startupMessages: StartupMessage[] }> {\n try {\n const loaded = await loadSource({\n sourceFlag: flags.source,\n projectDir: process.cwd(),\n forceRefresh: flags.refresh,\n captureStartupMessages: true,\n });\n return { sourceResult: loaded.sourceResult, startupMessages: loaded.startupMessages };\n } catch (error) {\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n private async runWizard(\n sourceResult: SourceLoadResult,\n startupMessages: StartupMessage[],\n projectDir: string,\n globalConfig: ProjectConfig | null,\n isGlobalRoot: boolean,\n ): Promise<WizardResultV2 | null> {\n return runWizardSession({\n hydrate: {\n initialAgents: globalConfig?.selectedAgents,\n installedSkillIds: globalConfig?.skills?.map((s) => s.id),\n installedSkillConfigs: globalConfig?.skills,\n installedAgentConfigs: globalConfig?.agents,\n isEditingFromGlobalScope: isGlobalRoot,\n },\n props: {\n version: this.config.version,\n logo: ASCII_LOGO,\n initialAgents: globalConfig?.selectedAgents,\n installedSkillIds: globalConfig?.skills?.map((s) => s.id),\n projectDir,\n startupMessages,\n },\n onCancel: () => this.log(\"Setup cancelled\"),\n clearTerminal: () => this.clearTerminal(),\n });\n }\n\n private async handleInstallation(\n result: WizardResultV2,\n sourceResult: SourceLoadResult,\n flags: SourceRefreshFlags,\n /**\n * Whether the caller can hold the terminal. The permission notice is an Ink app with no exit\n * of its own, so `waitUntilExit()` only ever resolves because a person is there to end it —\n * which is fine after the wizard and a hang everywhere else. `--from` sets this false: it has\n * to complete over a pipe and in CI.\n */\n interactive = true,\n ): Promise<void> {\n const projectDir = process.cwd();\n const activeSkills = result.skills.filter((s) => !s.excluded);\n const installMode = deriveInstallMode(activeSkills);\n const ejectedSkills = activeSkills.filter((s) => s.source === EJECT_SOURCE);\n const pluginSkills = activeSkills.filter((s) => s.source !== EJECT_SOURCE);\n\n this.logInstallPlan(installMode, ejectedSkills, pluginSkills);\n\n // Resolve marketplace up front — BEFORE any filesystem mutation. If\n // resolution fails in mixed mode, the hard-error must fire before\n // `copyEjectSkillsStep` copies anything to `.claude/skills/`, otherwise\n // we leave an orphaned half-install with no config.ts to recognise it.\n const resolvedMarketplace =\n pluginSkills.length > 0\n ? await this.requireMarketplaceOrExit(\n sourceResult,\n \"install plugin skills\",\n (marketplace) => this.log(`Registering marketplace \"${marketplace}\"...`),\n )\n : null;\n\n const copyResult =\n installMode === \"eject\" || installMode === \"mixed\"\n ? await this.copyEjectSkillsStep(ejectedSkills, projectDir, sourceResult, installMode)\n : null;\n\n if (resolvedMarketplace !== null) {\n await this.installPluginsStep(pluginSkills, resolvedMarketplace, projectDir);\n }\n // installPluginsStep hard-errors on any failure, so reaching here with a\n // resolved marketplace means plugin mode fully succeeded.\n const pluginModeSucceeded = resolvedMarketplace !== null;\n\n try {\n const { configResult, compileResult, agentScopeMap } = await this.writeConfigAndCompile(\n result,\n sourceResult,\n flags,\n );\n this.reportSuccess(\n configResult,\n compileResult,\n agentScopeMap,\n installMode,\n pluginModeSucceeded,\n copyResult,\n );\n\n const permissionWarning = await checkPermissions(projectDir);\n if (permissionWarning) {\n if (interactive) {\n const { waitUntilExit } = render(permissionWarning);\n await waitUntilExit();\n } else {\n // Render one frame and let go. The notice is information, not a prompt — there is\n // nothing to answer, so nothing to wait for.\n const { unmount } = render(permissionWarning);\n unmount();\n }\n }\n } catch (error) {\n this.handleError(error);\n }\n }\n\n private logInstallPlan(\n installMode: InstallMode,\n ejectedSkills: WizardResultV2[\"skills\"],\n pluginSkills: WizardResultV2[\"skills\"],\n ): void {\n this.log(\"\\n\");\n this.log(`Selected ${ejectedSkills.length + pluginSkills.length} skills`);\n this.log(\n `Install mode: ${\n installMode === \"plugin\"\n ? `${INSTALL_MODE_LABELS.plugin} (native install)`\n : installMode === \"mixed\"\n ? `${INSTALL_MODE_LABELS.mixed} (${ejectedSkills.length} eject, ${pluginSkills.length} plugin)`\n : `${INSTALL_MODE_LABELS.eject} (copy to .claude/skills/)`\n }`,\n );\n }\n\n private async copyEjectSkillsStep(\n localSkills: WizardResultV2[\"skills\"],\n projectDir: string,\n sourceResult: SourceLoadResult,\n installMode: InstallMode,\n ): Promise<SkillCopyResult> {\n this.log(\"Copying skills to local directory...\");\n const copyResult = await copyLocalSkills(localSkills, projectDir, sourceResult);\n\n if (installMode === \"mixed\") {\n if (copyResult.projectCopied.length > 0 && copyResult.globalCopied.length > 0) {\n this.log(\n `Copied ${copyResult.totalCopied} local skills (${copyResult.projectCopied.length} project, ${copyResult.globalCopied.length} global)`,\n );\n } else if (copyResult.globalCopied.length > 0) {\n this.log(`Copied ${copyResult.globalCopied.length} local skills to ~/.claude/skills/`);\n } else {\n this.log(`Copied ${copyResult.projectCopied.length} local skills to .claude/skills/`);\n }\n } else {\n this.log(`Copied ${copyResult.totalCopied} skills to .claude/skills/\\n`);\n }\n\n return copyResult;\n }\n\n private async installPluginsStep(\n pluginSkills: WizardResultV2[\"skills\"],\n marketplace: string,\n projectDir: string,\n ): Promise<void> {\n this.log(\"Installing skill plugins...\");\n const pluginResult = await installPluginSkills(pluginSkills, marketplace, projectDir);\n\n for (const item of pluginResult.installed) {\n this.log(` Installed ${item.ref}`);\n }\n for (const item of pluginResult.failed) {\n this.warn(`Failed to install plugin ${item.id}: ${item.error}`);\n }\n\n // Plugin install intent is inviolable — if any skill failed to install, hard-error\n // BEFORE `writeConfigAndCompile` writes config.ts with orphan entries claiming\n // the skill is installed. Matches the no-plugin-to-eject-fallback rule.\n if (pluginResult.failed.length > 0) {\n this.error(pluginInstallFailureError(pluginResult.failed.length), {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n this.log(`Installed ${pluginResult.installed.length} skill plugins\\n`);\n }\n\n private async writeConfigAndCompile(\n result: WizardResultV2,\n sourceResult: SourceLoadResult,\n flags: SourceRefreshFlags,\n ): Promise<{\n configResult: Awaited<ReturnType<typeof writeProjectConfig>>;\n compileResult: CompilationResult;\n agentScopeMap: Map<AgentName, SkillScope>;\n }> {\n this.log(\"Generating configuration...\");\n const configResult = await writeProjectConfig({\n wizardResult: result,\n sourceResult,\n projectDir: process.cwd(),\n sourceFlag: flags.source,\n });\n\n if (configResult.wasMerged) {\n this.log(`Merged with existing config at ${configResult.existingConfigPath}`);\n }\n\n this.log(`Configuration saved (${configResult.config.agents.length} agents)\\n`);\n\n this.log(STATUS_MESSAGES.COMPILING_AGENTS);\n const cwd = process.cwd();\n const agentDefs = await loadAgentDefs();\n const { allSkills } = await discoverInstalledSkills(cwd);\n const agentScopeMap = buildAgentScopeMap(configResult.config);\n const compileResult = await compileAgentsAllScopes({\n projectDir: cwd,\n sourcePath: agentDefs.sourcePath,\n skills: allSkills,\n agentScopeMap,\n });\n this.log(`Compiled ${compileResult.compiled.length} agents\\n`);\n\n this.reportPropagatedRecompile(configResult.propagation);\n\n return { configResult, compileResult, agentScopeMap };\n }\n\n /**\n * Renders the recompile the gated write already performed on every OTHER\n * registered project this run's global change was propagated into.\n */\n private reportPropagatedRecompile(propagation: GateReport): void {\n if (propagation.propagated.updated.length === 0) return;\n\n const { recompiledCount, failedCount, warnings } = propagation.recompile;\n for (const warning of warnings) {\n this.warn(warning);\n }\n\n const failureSuffix = failedCount > 0 ? ` (${failedCount} failed)` : \"\";\n this.log(`Recompiled agents in ${recompiledCount} registered projects${failureSuffix}\\n`);\n }\n\n private reportSuccess(\n configResult: Awaited<ReturnType<typeof writeProjectConfig>>,\n compileResult: CompilationResult,\n agentScopeMap: Map<AgentName, SkillScope>,\n installMode: InstallMode,\n pluginModeSucceeded: boolean,\n copyResult: SkillCopyResult | null,\n ): void {\n this.log(`${SUCCESS_MESSAGES.INIT_SUCCESS}\\n`);\n\n const isEjectOutput =\n installMode === \"eject\" || (installMode === \"mixed\" && !pluginModeSucceeded);\n if (isEjectOutput && copyResult && copyResult.totalCopied > 0) {\n this.reportSkillsCopied(copyResult);\n }\n this.reportAgentsCompiled(compileResult.compiled, agentScopeMap);\n this.log(\"Configuration:\");\n this.log(` ${configResult.configPath}`);\n this.log(\"\");\n this.log(\"To customize agent-skill assignments:\");\n this.log(` 1. Edit ${CLAUDE_SRC_DIR}/${STANDARD_FILES.CONFIG_TS}`);\n this.log(` 2. Run '${CLI_INVOKE_COMMAND} compile' to regenerate agents`);\n this.log(\"\");\n }\n\n /**\n * Reports where the skills actually landed. `copyLocalSkills` splits by scope,\n * so a default install driven from a project directory writes every skill\n * under HOME — reporting the project path there names a directory that was\n * never written.\n *\n * This block is a filesystem listing, so the entries are the on-disk directory\n * names — skill ids, not display names. `copySkillsToLocalFlattened` names each\n * destination directory after `skill.id`, so a user can copy any line and `cd`\n * into it.\n */\n private reportSkillsCopied(copyResult: SkillCopyResult): void {\n const cwd = process.cwd();\n const groups = isHomeDirectory(cwd)\n ? [\n {\n dir: resolveInstallPaths(cwd, \"project\").skillsDir,\n copied: [...copyResult.globalCopied, ...copyResult.projectCopied],\n },\n ]\n : [\n { dir: resolveInstallPaths(cwd, \"global\").skillsDir, copied: copyResult.globalCopied },\n { dir: resolveInstallPaths(cwd, \"project\").skillsDir, copied: copyResult.projectCopied },\n ].filter((group) => group.copied.length > 0);\n\n for (const group of groups) {\n this.log(\"Skills copied to:\");\n this.log(` ${group.dir}`);\n for (const copied of group.copied) {\n this.log(` ${copied.skillId}/`);\n }\n this.log(\"\");\n }\n }\n\n /**\n * Reports where the agents actually landed, mirroring the scope split\n * `compileAgentsAllScopes` performs: one pass at the home root, otherwise a\n * global pass under HOME and a project pass under the project directory.\n */\n private reportAgentsCompiled(\n compiled: AgentName[],\n agentScopeMap: Map<AgentName, SkillScope>,\n ): void {\n const cwd = process.cwd();\n const groups = isHomeDirectory(cwd)\n ? [{ dir: resolveInstallPaths(cwd, \"project\").agentsDir, agents: compiled }]\n : [\n {\n dir: resolveInstallPaths(cwd, \"global\").agentsDir,\n agents: compiled.filter((name) => agentScopeMap.get(name) === \"global\"),\n },\n {\n dir: resolveInstallPaths(cwd, \"project\").agentsDir,\n agents: compiled.filter((name) => agentScopeMap.get(name) !== \"global\"),\n },\n ].filter((group) => group.agents.length > 0);\n\n for (const group of groups) {\n this.log(\"Agents compiled to:\");\n this.log(` ${group.dir}`);\n for (const agentName of group.agents) {\n this.log(` ${agentName}.md`);\n }\n this.log(\"\");\n }\n }\n}\n\nexport type DashboardData = {\n skillCount: number;\n agentCount: number;\n mode: InstallMode;\n source?: string;\n};\n\n/**\n * Gathers dashboard data from the installation and project config.\n *\n * Both counts come from the same scope-aware installation so the summary cannot\n * mix a project-only figure with a global one — a default install driven from a\n * project directory puts every skill and agent under HOME.\n */\nexport async function getDashboardData(projectDir: string): Promise<DashboardData> {\n const [info, loaded] = await Promise.all([getInstallationInfo(), loadProjectConfig(projectDir)]);\n\n const activeSkills = loaded?.config?.skills?.filter((s) => !s.excluded);\n const skillCount = info?.skillCount ?? 0;\n const agentCount = info?.agentCount ?? 0;\n const mode = info?.mode ?? (activeSkills ? deriveInstallMode(activeSkills) : \"eject\");\n const source = loaded?.config?.source;\n\n return { skillCount, agentCount, mode, source };\n}\n","import { seedPayloadSchema, type SeedPayload } from \"./seed-schema.js\";\n\n/** The config store behind agentsinc.sh. Overridable so tests never touch the network. */\nexport const SEED_API_URL = process.env.AGENTS_INC_API_URL ?? \"https://api.agentsinc.sh\";\n\n/**\n * Identifies this fetch as the CLI rather than a browser.\n *\n * `GET /configs/:id` is the only place either side can observe a config being *installed* rather\n * than merely built, and the worker can only separate that from someone opening a share link if\n * we say so. Without this the conversion signal does not exist.\n */\nexport const SEED_USER_AGENT = \"agents-inc-cli\";\n\nexport type FetchSeedResult = { ok: true; payload: SeedPayload } | { ok: false; error: string };\n\n/**\n * Fetches and validates a shared configuration.\n *\n * Every failure is a message rather than a throw: this runs before anything has been written, so\n * there is nothing to roll back and the caller's job is to explain rather than recover.\n */\nexport async function fetchSeedConfig(id: string): Promise<FetchSeedResult> {\n const url = `${SEED_API_URL}/configs/${encodeURIComponent(id)}`;\n\n let response: Response;\n try {\n response = await fetch(url, {\n headers: { accept: \"application/json\", \"user-agent\": SEED_USER_AGENT },\n });\n } catch {\n return { ok: false, error: `Could not reach ${SEED_API_URL} — check your connection.` };\n }\n\n if (response.status === 404) {\n return { ok: false, error: `No configuration found for id '${id}'.` };\n }\n if (!response.ok) {\n return { ok: false, error: `Fetching configuration failed (HTTP ${response.status}).` };\n }\n\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n return { ok: false, error: \"The configuration store returned something that is not JSON.\" };\n }\n\n const parsed = seedPayloadSchema.safeParse(body);\n if (!parsed.success) {\n // Validated on the way in, so a stored payload that no longer parses means the contract moved\n // underneath it — worth saying plainly rather than reporting a generic failure.\n return {\n ok: false,\n error: `Configuration '${id}' does not match the expected format — it may have been created by a newer version.`,\n };\n }\n\n return { ok: true, payload: parsed.data };\n}\n","import { z } from \"zod\";\n\n/**\n * VENDORED from `packages/matrix/src/seed.ts` — keep in sync.\n *\n * The wire contract for configs shared from agentsinc.sh. The web app POSTs a payload to the\n * config store and gets a short id back; `npx agents-inc init --from <id>` fetches that id and\n * validates it with this same schema.\n *\n * The reason for copying rather than depending has expired. It was that a shared package spanning\n * two repositories would need publishing and a release step for forty lines of Zod that no consumer\n * had exercised. The repositories merged on 2026-08-03, so `packages/matrix` is now a workspace\n * sibling: `@workspace/matrix` could be depended on directly, with no publish and no versioning.\n *\n * What keeps the copy is inertia, not that argument — nothing has re-examined it since the merge,\n * and this package deliberately ships to npm while `@workspace/matrix` is private, so a dependency\n * would have to be bundled rather than declared. De-duplicating is D-239's job, and D-239's premise\n * changed with the merge too.\n */\n\n/**\n * Bump when the payload shape changes. Only the current version is accepted: pre-1.0 policy is to\n * fail a stale id loudly rather than migrate it, so what installs is always what was shared.\n *\n * v3 gave the sub-agent its own scope. An additive-optional field would not normally need a\n * version, but this schema strips what it does not declare — so the version is what tells a\n * sharing app the field actually survives the trip.\n */\nexport const SEED_VERSION = 3;\n\nexport const seedModelSchema = z.enum([\"opus\", \"fable\", \"sonnet\", \"haiku\"]);\nexport const seedEffortSchema = z.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]);\nexport const seedLoadStateSchema = z.enum([\"lazy\", \"preloaded\"]);\n\nexport const seedSkillSchema = z.object({\n install: z.enum([\"plugin\", \"eject\"]),\n scope: z.enum([\"project\", \"global\"]),\n /** Sub-agent id -> load state; presence is assignment. */\n assignments: z.record(z.string(), seedLoadStateSchema),\n});\n\n/**\n * What a shared configuration says about one sub-agent. Every field is optional because each says\n * something different on its own: `on: true` is the only way a sub-agent with no skills of its own\n * can travel, while model/effort are overrides for an agent an assignment already selects.\n */\nexport const seedAgentSchema = z.object({\n /** Explicitly switched on (bare) or off. Absent means \"whatever the assignments imply\". */\n on: z.boolean().optional(),\n model: seedModelSchema.optional(),\n effort: seedEffortSchema.optional(),\n /**\n * Which `.claude/agents` directory this sub-agent's front-matter is written to. Absent means\n * `project` — the CLI's own default, so a resting choice never has to travel.\n */\n scope: z.enum([\"project\", \"global\"]).optional(),\n});\n\n/**\n * Ids are full catalog slugs, never positional indices, so a payload survives catalog churn:\n * consumers warn and skip unknown ids rather than failing the whole decode.\n */\nexport const seedPayloadSchema = z.object({\n v: z.literal(SEED_VERSION),\n /**\n * Diagnostics only. A mismatch with this CLI's matrix must never fail a decode — it explains\n * why some ids were skipped, it does not decide whether to try.\n */\n matrixVersion: z.string(),\n stackId: z.string().nullable(),\n /** Sparse — presence is selection. `remembered` never leaves the browser. */\n skills: z.record(z.string(), seedSkillSchema),\n /** Sparse — an agent with nothing to say has no entry. */\n agents: z.record(z.string(), seedAgentSchema),\n});\n\nexport type SeedModel = z.infer<typeof seedModelSchema>;\nexport type SeedEffort = z.infer<typeof seedEffortSchema>;\nexport type SeedLoadState = z.infer<typeof seedLoadStateSchema>;\nexport type SeedSkill = z.infer<typeof seedSkillSchema>;\nexport type SeedAgent = z.infer<typeof seedAgentSchema>;\nexport type SeedPayload = z.infer<typeof seedPayloadSchema>;\n","import { AGENT_NAMES } from \"../../types/agents.js\";\nimport { DEFAULT_PUBLIC_SOURCE_NAME } from \"../../consts.js\";\nimport { getCategoryDomain } from \"../matrix/matrix-provider.js\";\nimport { orderDomains } from \"../wizard/domain-order.js\";\n\nimport type { WizardResultV2 } from \"../../components/wizard/wizard.js\";\nimport type { AgentName } from \"../../types/agents.js\";\nimport type { AgentScopeConfig, SkillConfig } from \"../../types/config.js\";\nimport type {\n Category,\n Domain,\n DomainSelections,\n MergedSkillsMatrix,\n ResolvedSkill,\n} from \"../../types/matrix.js\";\nimport type { SkillAssignment, SkillId } from \"../../types/skills.js\";\nimport type { StackAgentConfig } from \"../../types/stacks.js\";\nimport type { SeedAgent, SeedLoadState, SeedPayload } from \"./seed-schema.js\";\n\nexport type SeedMapping = {\n result: WizardResultV2;\n /** Ids this matrix does not know. Reported, never fatal — see the decode policy. */\n skippedSkillIds: string[];\n skippedAgentNames: string[];\n};\n\nconst KNOWN_AGENTS = new Set<string>(AGENT_NAMES);\n\n/** A skill's primary source, or the default marketplace. Mirrors the wizard's own resolution. */\nfunction sourceForSkill(skill: ResolvedSkill | undefined): string {\n return skill?.availableSources?.find((s) => s.primary)?.name ?? DEFAULT_PUBLIC_SOURCE_NAME;\n}\n\nfunction addToDomainSelections(\n selections: DomainSelections,\n domain: Domain,\n category: Category,\n skillId: SkillId,\n): void {\n const categorySelections = (selections[domain] ??= {});\n const skillList = (categorySelections[category] ??= []);\n if (!skillList.includes(skillId)) skillList.push(skillId);\n}\n\n/**\n * The stack mirror of {@link addToDomainSelections}: one sub-agent's own category lists, appended\n * in payload order. A `(skill, sub-agent)` pair can only occur once — `skills` is keyed by id — so\n * there is nothing to de-duplicate here.\n */\nfunction addToAgentStack(\n stack: Partial<Record<AgentName, StackAgentConfig>>,\n agent: AgentName,\n category: Category,\n assignment: SkillAssignment,\n): void {\n const agentStack = (stack[agent] ??= {});\n const assignments = (agentStack[category] ??= []);\n assignments.push(assignment);\n}\n\n/** A load state is per `(skill, sub-agent)`; `preloaded` is the stack's word for the same thing. */\nfunction toSkillAssignment(skillId: SkillId, load: SeedLoadState): SkillAssignment {\n return { id: skillId, preloaded: load === \"preloaded\" };\n}\n\n/** The payload's `agents` map, split by what this catalog can do with each entry. */\ntype SeedAgentMap = {\n /** Known agents the map has something to say about, keyed by name. */\n known: Map<AgentName, SeedAgent>;\n /** Names explicitly switched off — dropped, and their assignment rows ignored with them. */\n switchedOff: Set<string>;\n /** Names this catalog does not know. Reported, never fatal — same policy as unknown skill ids. */\n unknown: string[];\n};\n\nfunction readAgentMap(agents: SeedPayload[\"agents\"]): SeedAgentMap {\n const known = new Map<AgentName, SeedAgent>();\n const switchedOff = new Set<string>();\n const unknown: string[] = [];\n\n for (const [name, entry] of Object.entries(agents)) {\n if (!KNOWN_AGENTS.has(name)) unknown.push(name);\n else if (entry.on === false) switchedOff.add(name);\n else known.set(name as AgentName, entry);\n }\n\n return { known, switchedOff, unknown };\n}\n\n/**\n * Where a sub-agent's front-matter is written is the payload's to say, per agent and\n * independently of any skill's scope: an entry may send its agent to the user's own ~/.claude,\n * and one that names no scope stays in the project, which is the CLI's default. Model and effort\n * ride along on the same terms — an absent key means \"keep whatever the agent's metadata says\".\n */\nfunction agentScopeConfig(name: AgentName, entry: SeedAgent | undefined): AgentScopeConfig {\n return {\n name,\n scope: entry?.scope ?? \"project\",\n ...(entry?.model !== undefined && { model: entry.model }),\n ...(entry?.effort !== undefined && { effort: entry.effort }),\n };\n}\n\n/**\n * Turns a shared configuration into the shape the install pipeline already consumes, so\n * `init --from` reuses `writeProjectConfig` -> skill install -> `compileAgentsAllScopes`\n * unchanged rather than growing a second path that can drift from the wizard's.\n *\n * Unknown ids are skipped, never fatal. Payloads carry catalog slugs precisely so they survive\n * catalog churn: a config shared before a skill was renamed should still install everything else,\n * and failing the whole decode would make every rename retroactively break every shared id.\n *\n * A sub-agent reaches the roster two ways: named by a surviving skill's assignment, or switched on\n * in the `agents` map. The map is the only place a configuration can say anything about an agent\n * no skill mentions, which is what makes a bare (skill-less) agent shareable at all; it also\n * carries that agent's model and effort onto its `AgentScopeConfig`.\n *\n * The `assignments` map is per `(skill, sub-agent)` and carries a load state, so it decides three\n * things the wizard cannot express separately: which sub-agents are selected, which skills land in\n * each one's stack entry, and which of those preload. That is why the result carries an\n * `assignedStack` — the install pipeline's ownership rules broadcast every scope-compatible skill\n * to every selected agent, which would hand a bare sub-agent someone else's skills.\n */\nexport function seedToWizardResult(payload: SeedPayload, matrix: MergedSkillsMatrix): SeedMapping {\n const domainSelections: DomainSelections = {};\n const assignedStack: Partial<Record<AgentName, StackAgentConfig>> = {};\n const skills: SkillConfig[] = [];\n const skippedSkillIds: string[] = [];\n const agentNames = new Set<AgentName>();\n const agentMap = readAgentMap(payload.agents);\n const skippedAgentNames = new Set<string>(agentMap.unknown);\n\n for (const [skillId, entry] of Object.entries(payload.skills)) {\n const skill = matrix.skills[skillId as SkillId];\n const domain = skill?.category ? getCategoryDomain(skill.category) : undefined;\n\n if (!skill?.category || !domain) {\n skippedSkillIds.push(skillId);\n continue;\n }\n\n // Past the guard the matrix knows this id, and its category is a real one: the `local`\n // pseudo-category has no domain, so it left with the skips.\n const id = skillId as SkillId;\n const category = skill.category as Category;\n\n addToDomainSelections(domainSelections, domain, category, id);\n\n skills.push({\n id,\n scope: entry.scope,\n // \"eject\" is a source in its own right; anything else names the marketplace it came from.\n source: entry.install === \"eject\" ? \"eject\" : sourceForSkill(skill),\n });\n\n // Only assignments on skills that survived — an agent should not be switched on by a skill\n // this catalog cannot install.\n for (const [agentName, load] of Object.entries(entry.assignments)) {\n if (agentMap.switchedOff.has(agentName)) continue;\n if (!KNOWN_AGENTS.has(agentName)) {\n skippedAgentNames.add(agentName);\n continue;\n }\n\n const agent = agentName as AgentName;\n agentNames.add(agent);\n // The assignment is the curation: this sub-agent holds this skill, at this load state, and\n // no sub-agent the payload did not name holds it at all.\n addToAgentStack(assignedStack, agent, category, toSkillAssignment(id, load));\n }\n }\n\n // Bare agents: switched on by the map alone, with no skill to carry them in.\n for (const [name, entry] of agentMap.known) {\n if (entry.on === true) agentNames.add(name);\n }\n\n const selectedAgents = [...agentNames];\n\n return {\n result: {\n skills,\n selectedAgents,\n agentConfigs: selectedAgents.map((name) => agentScopeConfig(name, agentMap.known.get(name))),\n assignedStack,\n selectedStackId: payload.stackId,\n domainSelections,\n selectedDomains: orderDomains(Object.keys(domainSelections) as Domain[]),\n // Nothing was dropped from a *saved config* — the skipped ids came off the wire and are\n // reported to the user directly, so there is no existing entry to preserve.\n unresolvableSkillIds: [],\n cancelled: false,\n // A shared configuration was already validated by the app that built it; this path has no\n // interactive step in which a validation warning could be acted on.\n validation: { valid: true, errors: [], warnings: [] },\n },\n skippedSkillIds,\n skippedAgentNames: [...skippedAgentNames],\n };\n}\n","import type { Domain, EffortLevel, ModelName, PermissionMode } from \"./matrix\";\nimport type { PluginSkillRef, Skill, SkillId } from \"./skills\";\nimport type { AgentName } from \"./generated/source-types\";\n\nexport type { AgentName } from \"./generated/source-types\";\nexport { AGENT_NAMES } from \"./generated/source-types\";\n\n/** Single hook action (command, script, or prompt) */\nexport type AgentHookAction = {\n type: \"command\" | \"script\" | \"prompt\";\n command?: string;\n script?: string;\n prompt?: string;\n};\n\n/** Hook definition with optional file matcher and actions */\nexport type AgentHookDefinition = {\n matcher?: string;\n hooks?: AgentHookAction[];\n};\n\n/**\n * Shared fields present on all agent type variants.\n * Extracted to avoid duplicating these 8 fields across AgentDefinition,\n * AgentConfig, and AgentYamlConfig.\n */\nexport type BaseAgentFields = {\n title: string;\n /** Brief description for Task tool */\n description: string;\n model?: ModelName;\n /** Reasoning effort. Emitted into compiled frontmatter only when set — there is no default. */\n effort?: EffortLevel;\n tools: string[];\n disallowedTools?: string[];\n permissionMode?: PermissionMode;\n hooks?: Record<string, AgentHookDefinition[]>;\n /** Which output format file to use */\n outputFormat?: string;\n};\n\n/** Base agent definition from agents.yaml (skills are defined in stacks, not agents) */\nexport type AgentDefinition = BaseAgentFields & {\n /** Relative path to agent directory (e.g., \"developer/api-developer\") */\n path?: string;\n /** Root path where this agent was loaded from (for template resolution) */\n sourceRoot?: string;\n /** Base directory for agent files relative to sourceRoot (e.g., \"src/agents\" or \".claude-src/agents\") */\n agentBaseDir?: string;\n /** Domain for wizard grouping */\n domain?: Domain;\n /** True if this agent was created outside the CLI's built-in vocabulary */\n custom?: boolean;\n};\n\n/** Fully resolved agent config (agent definition + stack config) used by the compiler */\nexport type AgentConfig = AgentDefinition & {\n name: string;\n /** Unified skills list (loaded dynamically via Skill tool) */\n skills: Skill[];\n};\n\n/** Agent configuration from metadata.yaml (co-located in each agent folder) */\nexport type AgentYamlConfig = BaseAgentFields & {\n id: AgentName;\n /** Domain for wizard grouping */\n domain?: Domain;\n /** True if this agent was created outside the CLI's built-in vocabulary */\n custom?: boolean;\n};\n\n/** Agent frontmatter matching official Claude Code plugin format for compiled .md files */\nexport type AgentFrontmatter = {\n /** Used as plugin name */\n name: string;\n /** Shown in Task tool description */\n description: string;\n /** Comma-separated list of tools available to this agent */\n tools?: string;\n /** Comma-separated list of tools this agent cannot use */\n disallowedTools?: string;\n /** Use \"inherit\" to use parent model */\n model?: ModelName;\n effort?: EffortLevel;\n permissionMode?: PermissionMode;\n /** Skill names that are preloaded for this agent */\n skills?: SkillId[];\n hooks?: Record<string, AgentHookDefinition[]>;\n};\n\n/** All data needed to render a compiled agent prompt */\nexport type CompiledAgentData = {\n agent: AgentConfig;\n identity: string;\n playbook: string;\n output: string;\n /** Rendered at the top of the agent prompt */\n criticalRequirementsTop: string;\n /** Rendered at the bottom of the agent prompt */\n criticalReminders: string;\n skills: Skill[];\n /** Skills with content embedded in the compiled agent */\n preloadedSkills: Skill[];\n /** Skills loaded via Skill tool (metadata only) */\n dynamicSkills: Skill[];\n /** Skill IDs (eject mode) or plugin refs (plugin mode) for frontmatter */\n preloadedSkillIds: (SkillId | PluginSkillRef)[];\n};\n\n/** Paths to fetched agent definition sources (directory paths, not agent data) */\nexport type AgentSourcePaths = {\n agentsDir: string;\n templatesDir: string;\n sourcePath: string;\n};\n","import React from \"react\";\nimport { z } from \"zod\";\n\nimport { Text, Box } from \"ink\";\nimport path from \"path\";\n\nimport { CLAUDE_DIR, CLI_COLORS, MAX_CONFIG_FILE_SIZE, STANDARD_FILES } from \"../consts\";\nimport { fileExists, readFileSafe } from \"../utils/fs\";\nimport { warn } from \"../utils/logger\";\nimport { settingsFileSchema } from \"./schemas\";\n\ntype SettingsFile = z.infer<typeof settingsFileSchema>;\ntype PermissionConfig = NonNullable<SettingsFile[\"permissions\"]>;\n\n/**\n * Reads one settings file's permissions block; undefined when absent, malformed, or empty.\n *\n * settings.json belongs to Claude Code, which adds keys on its own release schedule. This CLI\n * consumes `permissions` and owns nothing else in the file, so it stays silent about every other\n * field rather than warning about settings it has no standing to judge (D-304).\n */\nasync function readSettingsPermissions(filePath: string): Promise<PermissionConfig | undefined> {\n if (!(await fileExists(filePath))) return undefined;\n try {\n const content = await readFileSafe(filePath, MAX_CONFIG_FILE_SIZE);\n const raw = JSON.parse(content);\n const result = settingsFileSchema.safeParse(raw);\n const parsed: SettingsFile = result.success ? result.data : {};\n return parsed.permissions;\n } catch {\n warn(`Malformed settings file at '${filePath}' — skipping`);\n return undefined;\n }\n}\n\n/** Permissions from the first settings file that defines them — settings.local.json wins. */\nasync function loadPermissions(projectRoot: string): Promise<PermissionConfig | undefined> {\n const settingsPath = path.join(projectRoot, CLAUDE_DIR, STANDARD_FILES.SETTINGS_JSON);\n const localSettingsPath = path.join(projectRoot, CLAUDE_DIR, STANDARD_FILES.SETTINGS_LOCAL_JSON);\n\n for (const filePath of [localSettingsPath, settingsPath]) {\n const permissions = await readSettingsPermissions(filePath);\n if (permissions) return permissions;\n }\n return undefined;\n}\n\nexport async function checkPermissions(projectRoot: string): Promise<React.ReactElement | null> {\n const permissions = await loadPermissions(projectRoot);\n\n if (!permissions) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Notice\n </Text>\n <Text>No permissions configured in .claude/settings.json</Text>\n <Text>Agents will prompt for approval on each tool use.</Text>\n <Text> </Text>\n <Text>For autonomous operation, add to .claude/settings.json:</Text>\n <Text> </Text>\n <Text color={CLI_COLORS.DIM}>{\"{\"}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"permissions\": {'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"allow\": ['}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Read(*)\",'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Bash(git *)\",'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Bash(bun *)\"'}</Text>\n <Text color={CLI_COLORS.DIM}>{\" ]\"}</Text>\n <Text color={CLI_COLORS.DIM}>{\" }\"}</Text>\n <Text color={CLI_COLORS.DIM}>{\"}\"}</Text>\n </Box>\n );\n }\n\n const hasRestrictiveBash = permissions.deny?.some(\n (rule) => rule === \"Bash(*)\" || rule === \"Bash\",\n );\n const hasNoAllows = !permissions.allow || permissions.allow.length === 0;\n\n if (hasRestrictiveBash || hasNoAllows) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Warnings\n </Text>\n {hasRestrictiveBash && (\n <Text>\n ⚠ Bash is denied in permissions. Some agents require Bash for git, testing, and build\n commands.\n </Text>\n )}\n {hasNoAllows && (\n <Text>⚠ No allow rules configured. Agents will prompt for each tool use.</Text>\n )}\n </Box>\n );\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,QAAQ;AAGf,SAAS,aAA8B;AACvC,SAAS,QAAQ,OAAAA,MAAK,QAAAC,OAAM,cAAc;;;ACJ1C;;;ACAA;AAAA,SAAS,SAAS;AA4BX,IAAM,eAAe;AAErB,IAAM,kBAAkB,EAAE,KAAK,CAAC,QAAQ,SAAS,UAAU,OAAO,CAAC;AACnE,IAAM,mBAAmB,EAAE,KAAK,CAAC,OAAO,UAAU,QAAQ,SAAS,KAAK,CAAC;AACzE,IAAM,sBAAsB,EAAE,KAAK,CAAC,QAAQ,WAAW,CAAC;AAExD,IAAM,kBAAkB,EAAE,OAAO;AAAA,EACtC,SAAS,EAAE,KAAK,CAAC,UAAU,OAAO,CAAC;AAAA,EACnC,OAAO,EAAE,KAAK,CAAC,WAAW,QAAQ,CAAC;AAAA;AAAA,EAEnC,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,mBAAmB;AACvD,CAAC;AAOM,IAAM,kBAAkB,EAAE,OAAO;AAAA;A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Content":["import React from \"react\";\nimport { render } from \"ink\";\n\nexport type ConfirmHandlers = {\n onConfirm: () => void;\n onCancel: () => void;\n};\n\nexport type PromptValueOptions<T> = {\n /** Value resolved when the Ink app exits before any callback fires (Ctrl+C / render failure). */\n onExit: T;\n /** Call instance.clear() before unmount — repaints a clean terminal (used by the dashboard). */\n clearOnResolve?: boolean;\n};\n\n/**\n * Renders an Ink prompt and resolves with the value produced by its callbacks.\n * First-wins: the first resolve (a callback or the app-exit fallback) settles the\n * promise; later resolves are ignored. The element is unmounted at the resolution\n * site (optionally cleared first). Callers own exit policy (exit codes, logging).\n */\nexport async function promptValue<T>(\n build: (resolve: (value: T) => void) => React.ReactElement,\n options: PromptValueOptions<T>,\n): Promise<T> {\n return new Promise<T>((resolve) => {\n const instance = render(\n build((value) => {\n if (options.clearOnResolve) instance.clear();\n instance.unmount();\n resolve(value);\n }),\n );\n // App exit without a callback (e.g. Ctrl+C) or a render failure counts as the\n // fallback; resolve is first-wins, so a prior callback value is unaffected.\n instance.waitUntilExit().then(\n () => resolve(options.onExit),\n () => resolve(options.onExit),\n );\n });\n}\n\n/**\n * Renders a confirm UI and resolves with the user's choice. The element is\n * unmounted as soon as either handler fires; a clean exit or render failure\n * without a choice resolves as \"cancelled\". Callers own exit policy.\n */\nexport async function promptConfirm(\n build: (handlers: ConfirmHandlers) => React.ReactElement,\n): Promise<\"confirmed\" | \"cancelled\"> {\n return promptValue<\"confirmed\" | \"cancelled\">(\n (resolve) =>\n build({ onConfirm: () => resolve(\"confirmed\"), onCancel: () => resolve(\"cancelled\") }),\n { onExit: \"cancelled\" },\n );\n}\n"],"mappings":";;;;;;AAAA;AACA,SAAS,cAAc;AAoBvB,eAAsB,YACpB,OACA,SACY;AACZ,SAAO,IAAI,QAAW,CAAC,YAAY;AACjC,UAAM,WAAW;AAAA,MACf,MAAM,CAAC,UAAU;AACf,YAAI,QAAQ,eAAgB,UAAS,MAAM;AAC3C,iBAAS,QAAQ;AACjB,gBAAQ,KAAK;AAAA,MACf,CAAC;AAAA,IACH;AAGA,aAAS,cAAc,EAAE;AAAA,MACvB,MAAM,QAAQ,QAAQ,MAAM;AAAA,MAC5B,MAAM,QAAQ,QAAQ,MAAM;AAAA,IAC9B;AAAA,EACF,CAAC;AACH;AAOA,eAAsB,cACpB,OACoC;AACpC,SAAO;AAAA,IACL,CAAC,YACC,MAAM,EAAE,WAAW,MAAM,QAAQ,WAAW,GAAG,UAAU,MAAM,QAAQ,WAAW,EAAE,CAAC;AAAA,IACvF,EAAE,QAAQ,YAAY;AAAA,EACxB;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/components/hooks/use-section-scroll.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { type DOMElement, measureElement } from \"ink\";\nimport { SCROLL_VIEWPORT } from \"../../consts.js\";\n\nexport type UseSectionScrollOptions = {\n sectionCount: number;\n focusedIndex: number;\n availableHeight: number;\n /**\n * Minimum viewport rows before clipping engages (default {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}).\n * Views that must clip rather than bleed at very short heights (source-grid, which pairs the clip\n * with an overflow affordance) pass a lower value so the gate does not fall back to a bleeding\n * flex layout.\n */\n minViewportRows?: number;\n};\n\nexport type UseSectionScrollResult = {\n setSectionRef: (index: number, el: DOMElement | null) => void;\n /** Attach to the clipping viewport box so overflow counts exclude header/affordance chrome. */\n setViewportRef: (el: DOMElement | null) => void;\n /**\n * Attach to the scrolled content box so overflow counts measure the WHOLE rendered content —\n * section-group margins and labels included — not just the sum of per-section row heights.\n */\n setContentRef: (el: DOMElement | null) => void;\n scrollEnabled: boolean;\n scrollTopPx: number;\n /** Content lines scrolled off the top of the viewport (0 when not scrolling). */\n hiddenAbove: number;\n /** Content lines clipped below the viewport (0 when everything fits). */\n hiddenBelow: number;\n /** Scroll the viewport past the focus-following position to reveal clipped rows (e.g. trailing inert rows). */\n scrollBy: (deltaRows: number) => void;\n};\n\n/**\n * Shared pixel-offset scroll hook for views with variable-height sections.\n *\n * Manages section refs, height measurement, and scroll position to keep the\n * focused section visible within a constrained viewport. Extracted from the\n * identical scroll plumbing in category-grid.tsx and source-grid.tsx.\n *\n * On top of focus-following it exposes an overscroll channel (`scrollBy`) that\n * moves the viewport BEYOND the focused row so rows that can never take focus —\n * trailing inert Sources rows — can still be scrolled into view, plus the\n * `hidden{Above,Below}` counts. Overscroll resets whenever focus moves, so the\n * viewport snaps back to follow focus.\n *\n * The counts are OFFERED, not obligatory. `source-grid.tsx` feeds them to a\n * `ScrollAffordance` sibling; `category-grid.tsx` (the build grid) discards them\n * deliberately — on a grid that dense a half-cut card is self-evidently \"there\n * is more\", so a counted hint would be noise and would cost the viewport a row.\n * A consumer that ignores them is exercising that choice, not overlooking one.\n */\nexport function useSectionScroll({\n sectionCount,\n focusedIndex,\n availableHeight,\n minViewportRows = SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS,\n}: UseSectionScrollOptions): UseSectionScrollResult {\n const sectionRefs = useRef<(DOMElement | null)[]>([]);\n const viewportRef = useRef<DOMElement | null>(null);\n const contentRef = useRef<DOMElement | null>(null);\n const [sectionHeights, setSectionHeights] = useState<number[]>([]);\n const [viewportHeight, setViewportHeight] = useState(0);\n const [contentBoxHeight, setContentBoxHeight] = useState(0);\n const [focusScrollPx, setFocusScrollPx] = useState(0);\n const [overscrollPx, setOverscrollPx] = useState(0);\n\n const setSectionRef = useCallback((index: number, el: DOMElement | null) => {\n sectionRefs.current[index] = el;\n }, []);\n\n const setViewportRef = useCallback((el: DOMElement | null) => {\n viewportRef.current = el;\n }, []);\n\n const setContentRef = useCallback((el: DOMElement | null) => {\n contentRef.current = el;\n }, []);\n\n // A new row set (section count change) invalidates the monotonic content-height reading.\n useEffect(() => {\n setContentBoxHeight(0);\n }, [sectionCount]);\n\n // Measure section, viewport and content heights on every render\n useEffect(() => {\n const heights = sectionRefs.current.map((el) => {\n if (el) {\n const { height } = measureElement(el);\n return height;\n }\n return 0;\n });\n setSectionHeights((prev) => {\n if (prev.length === heights.length && prev.every((h, i) => h === heights[i])) {\n return prev;\n }\n return heights;\n });\n if (viewportRef.current) {\n const { height } = measureElement(viewportRef.current);\n setViewportHeight((prev) => (prev !== height ? height : prev));\n }\n if (contentRef.current) {\n const { height } = measureElement(contentRef.current);\n // Yoga under-reports a wrapped/clipped subtree in some layout passes, so the tallest reading\n // is the trustworthy one — mirrors info-panel/step-confirm. Reset above on row-set change.\n setContentBoxHeight((prev) => (height > prev ? height : prev));\n }\n });\n\n const scrollEnabled = availableHeight > 0 && availableHeight >= minViewportRows;\n\n // The measured content box includes section-group margins and labels; the per-section sum omits\n // them, so it is only the fallback for consumers that do not attach a content ref (category-grid).\n const contentHeight =\n contentBoxHeight > 0 ? contentBoxHeight : sectionHeights.reduce((sum, h) => sum + h, 0);\n // The measured viewport box excludes the header and affordance rows (both\n // siblings of it), so it is the height the sections actually get. Before the\n // first measurement, fall back to availableHeight (which category-grid always\n // uses — it has no separate header outside the viewport).\n const effectiveViewport = viewportHeight > 0 ? viewportHeight : availableHeight;\n const maxScrollPx = scrollEnabled ? Math.max(0, contentHeight - effectiveViewport) : 0;\n\n // Mirror the latest values into refs so `scrollBy` can clamp against them while\n // staying a stable callback (no re-created handler per render).\n const maxScrollRef = useRef(0);\n maxScrollRef.current = maxScrollPx;\n const focusScrollRef = useRef(0);\n focusScrollRef.current = focusScrollPx;\n\n // Keep focused section visible\n useEffect(() => {\n if (!scrollEnabled || sectionHeights.length === 0) return;\n\n let topOfFocused = 0;\n for (let i = 0; i < focusedIndex; i++) {\n topOfFocused += sectionHeights[i] ?? 0;\n }\n const focusedHeight = sectionHeights[focusedIndex] ?? 0;\n const bottomOfFocused = topOfFocused + focusedHeight;\n\n setFocusScrollPx((prev) => {\n if (topOfFocused < prev) {\n return topOfFocused;\n }\n if (bottomOfFocused > prev + effectiveViewport) {\n return bottomOfFocused - effectiveViewport;\n }\n return prev;\n });\n }, [focusedIndex, sectionHeights, scrollEnabled, effectiveViewport]);\n\n // Overscroll is user travel beyond the focus-following position. It resets on\n // focus movement so the viewport tracks the focused row again.\n useEffect(() => {\n setOverscrollPx(0);\n }, [focusedIndex]);\n\n const scrollBy = useCallback((deltaRows: number) => {\n setOverscrollPx((prev) => {\n const maxOverscroll = Math.max(0, maxScrollRef.current - focusScrollRef.current);\n return Math.min(maxOverscroll, Math.max(0, prev + deltaRows));\n });\n }, []);\n\n const scrollTopPx = Math.min(maxScrollPx, focusScrollPx + overscrollPx);\n const hiddenAbove = scrollEnabled ? scrollTopPx : 0;\n const hiddenBelow = scrollEnabled ? Math.max(0, maxScrollPx - scrollTopPx) : 0;\n\n return {\n setSectionRef,\n setViewportRef,\n setContentRef,\n scrollEnabled,\n scrollTopPx,\n hiddenAbove,\n hiddenBelow,\n scrollBy,\n };\n}\n\n/**\n * Pure function for row-based scroll offset computation.\n *\n * For views with uniform 1-line rows (step-agents, checkbox-grid, step-settings),\n * computes the scroll offset (in rows) to keep `focusedRow` visible within\n * a viewport of `viewportHeight` rows.\n */\nexport function computeRowScrollTop(\n focusedRow: number,\n currentScrollTop: number,\n viewportHeight: number,\n): number {\n if (focusedRow < currentScrollTop) {\n return focusedRow;\n }\n if (focusedRow + 1 > currentScrollTop + viewportHeight) {\n return focusedRow + 1 - viewportHeight;\n }\n return currentScrollTop;\n}\n"],"mappings":";;;;;;;;;AAAA;AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAA0B,sBAAsB;AAsDzC,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB,gBAAgB;AACpC,GAAoD;AAClD,QAAM,cAAc,OAA8B,CAAC,CAAC;AACpD,QAAM,cAAc,OAA0B,IAAI;AAClD,QAAM,aAAa,OAA0B,IAAI;AACjD,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAmB,CAAC,CAAC;AACjE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,CAAC;AACtD,QAAM,CAA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A,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AASO,SAAS,oBACd,YACA,kBACA,gBACQ;AACR,MAAI,aAAa,kBAAkB;AACjC,WAAO;AAAA,EACT;AACA,MAAI,aAAa,IAAI,mBAAmB,gBAAgB;AACtD,WAAO,aAAa,IAAI;AAAA,EAC1B;AACA,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/lib/operations/source/load-source.ts","../src/cli/lib/operations/source/index.ts","../src/cli/lib/operations/project/detect-project.ts","../src/cli/lib/operations/project/detect-both-installations.ts","../src/cli/lib/operations/project/write-project-config.ts","../src/cli/lib/operations/project/compile-agents-all-scopes.ts","../src/cli/lib/operations/project/index.ts","../src/cli/lib/operations/index.ts"],"sourcesContent":["import { loadSkillsMatrixFromSource, type SourceLoadResult } from \"../../loading/index.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n type StartupMessage,\n} from \"../../../utils/logger.js\";\n\nexport type LoadSourceOptions = {\n sourceFlag?: string;\n projectDir: string;\n forceRefresh?: boolean;\n /** When true, enables message buffering and captures startup messages. Default: false. */\n captureStartupMessages?: boolean;\n};\n\nexport type LoadedSource = {\n sourceResult: SourceLoadResult;\n /** Empty array when captureStartupMessages is false. */\n startupMessages: StartupMessage[];\n};\n\n/**\n * Loads the skills matrix from a resolved source.\n *\n * When `captureStartupMessages` is true, wraps the load in buffer mode so\n * warn() calls during loading are captured instead of written to stderr.\n * The caller (init/edit) passes these messages to the Wizard's <Static> block.\n *\n * @throws {Error} If source resolution or fetching fails.\n */\nexport async function loadSource(options: LoadSourceOptions): Promise<LoadedSource> {\n const { sourceFlag, projectDir, forceRefresh, captureStartupMessages } = options;\n\n if (captureStartupMessages) {\n enableBuffering();\n }\n\n let sourceResult: SourceLoadResult;\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag,\n projectDir,\n forceRefresh,\n });\n } catch (error) {\n if (captureStartupMessages) {\n disableBuffering();\n }\n throw error;\n }\n\n let startupMessages: StartupMessage[] = [];\n if (captureStartupMessages) {\n startupMessages = drainBuffer();\n disableBuffering();\n }\n\n return { sourceResult, startupMessages };\n}\n","export { loadSource, type LoadSourceOptions, type LoadedSource } from \"./load-source.js\";\nexport { ensureMarketplace, type MarketplaceResult } from \"./ensure-marketplace.js\";\nexport { requireMarketplace, type MarketplaceRequirement } from \"./require-marketplace.js\";\n","import { detectInstallation, type Installation } from \"../../installation/index.js\";\nimport { ConfigLoadError, loadProjectConfig } from \"../../configuration/index.js\";\nimport type { ProjectConfig } from \"../../../types/index.js\";\n\nexport type DetectedProject = {\n installation: Installation;\n config: ProjectConfig | null;\n configPath: string | null;\n};\n\n/**\n * Detects an existing CLI installation and loads its project config.\n *\n * Uses detectInstallation() which checks project-level first, then falls back\n * to global. Returns the installation metadata plus the loaded config.\n *\n * Does NOT throw. Returns null when no installation is found OR when the config\n * file exists but is corrupt — the caller (doctor, edit) reports the resulting\n * null as a config/installation problem to the user. `compile` deliberately\n * does NOT use this wrapper: it detects scopes directly so it can hard-error on\n * a corrupt config instead of degrading to null.\n */\nexport async function detectProject(projectDir?: string): Promise<DetectedProject | null> {\n const resolvedDir = projectDir ?? process.cwd();\n\n let installation: Installation | null;\n try {\n installation = await detectInstallation(resolvedDir);\n } catch (error) {\n if (error instanceof ConfigLoadError) return null;\n throw error;\n }\n\n if (!installation) {\n return null;\n }\n\n const loaded = await loadProjectConfig(installation.projectDir);\n\n return {\n installation,\n config: loaded?.config ?? null,\n configPath: loaded?.configPath ?? null,\n };\n}\n","import {\n detectGlobalInstallation,\n detectProjectInstallation,\n isHomeDirectory,\n type Installation,\n} from \"../../installation/index.js\";\n\nexport type BothInstallations = {\n global: Installation | null;\n project: Installation | null;\n hasBoth: boolean;\n};\n\n/**\n * Detects both global and project installations.\n *\n * Skips project detection when projectDir is the home directory\n * to avoid double-compile. Returns a convenience `hasBoth` flag\n * used by callers to set scopeFilter on compile passes.\n */\nexport async function detectBothInstallations(projectDir: string): Promise<BothInstallations> {\n const global = await detectGlobalInstallation();\n\n const project = isHomeDirectory(projectDir) ? null : await detectProjectInstallation(projectDir);\n return { global, project, hasBoth: !!global && !!project };\n}\n","import path from \"path\";\nimport {\n buildAndMergeConfig,\n resolveInstallPaths,\n isHomeDirectory,\n} from \"../../installation/index.js\";\nimport { loadMergedAgents, type SourceLoadResult } from \"../../loading/index.js\";\nimport type { AuthoritativeScope } from \"../../configuration/index.js\";\nimport {\n ensureBlankPair,\n writeScopedFromWizard,\n type GateReport,\n} from \"../../config-gate/index.js\";\nimport { ensureDir } from \"../../../utils/fs.js\";\nimport type { ProjectConfig, AgentDefinition, AgentName } from \"../../../types/index.js\";\nimport type { WizardResultV2 } from \"../../../components/wizard/wizard.js\";\n\nexport type ConfigWriteOptions = {\n wizardResult: WizardResultV2;\n sourceResult: SourceLoadResult;\n projectDir: string;\n sourceFlag?: string;\n /** Pre-loaded agent definitions. If omitted, loads from CLI + source. */\n agents?: Record<AgentName, AgentDefinition>;\n /**\n * Authority of `cc edit`'s newConfig over absent entries (D-233 Scenario C):\n * `\"all\"` (global edit) drops any deselected entry, `\"owned\"` (project edit) drops deselected\n * project-owned entries only, `undefined` (init) keeps additive union-preserve.\n */\n authoritativeScope?: AuthoritativeScope;\n};\n\nexport type ConfigWriteResult = {\n config: ProjectConfig;\n configPath: string;\n wasMerged: boolean;\n existingConfigPath?: string;\n filesWritten: number;\n /**\n * What the gated write did: what moved in the global config, which registered\n * projects it fanned out to, and the recompile it drove in them. The caller\n * renders it; the work is already done.\n */\n propagation: GateReport;\n};\n\n/**\n * Builds, merges, and writes project configuration files.\n *\n * Handles the full config pipeline:\n * 1. buildAndMergeConfig() — generates config from wizard result, merges with existing\n * 2. loadAllAgents() — loads agent definitions for config-types generation\n * 3. ensureBlankPair() — ensures the global config pair exists (when in project context)\n * 4. writeScopedFromWizard() — writes config.ts and config-types.ts split by scope,\n * fans global changes out to registered projects and recompiles their agents\n */\nexport async function writeProjectConfig(options: ConfigWriteOptions): Promise<ConfigWriteResult> {\n const { wizardResult, sourceResult, projectDir, sourceFlag } = options;\n const projectPaths = resolveInstallPaths(projectDir, \"project\");\n\n await ensureDir(path.dirname(projectPaths.configPath));\n\n let agents: Record<AgentName, AgentDefinition>;\n if (options.agents) {\n agents = options.agents;\n } else {\n agents = await loadMergedAgents(sourceResult.sourcePath);\n }\n\n const mergeResult = await buildAndMergeConfig(\n wizardResult,\n sourceResult,\n projectDir,\n sourceFlag,\n options.authoritativeScope,\n );\n const finalConfig = mergeResult.config;\n\n const isProjectContext = !isHomeDirectory(projectDir);\n\n if (isProjectContext) {\n await ensureBlankPair();\n }\n\n const propagation = await writeScopedFromWizard({\n finalConfig,\n matrix: sourceResult.matrix,\n agents,\n projectDir,\n projectConfigPath: projectPaths.configPath,\n projectInstallationExists: isProjectContext,\n });\n\n return {\n config: finalConfig,\n configPath: projectPaths.configPath,\n wasMerged: mergeResult.merged,\n existingConfigPath: mergeResult.existingConfigPath,\n filesWritten: isProjectContext ? 4 : 2,\n propagation,\n };\n}\n","import os from \"os\";\nimport { compileAgents, type CompilationResult } from \"./compile-agents.js\";\nimport { isHomeDirectory, resolveInstallPaths } from \"../../installation/index.js\";\nimport type { AgentName, SkillDefinitionMap, SkillScope } from \"../../../types/index.js\";\n\nexport type CompileAllScopesOptions = {\n /** Working directory of the command — a project root, or home for global context. */\n projectDir: string;\n sourcePath: string;\n skills: SkillDefinitionMap;\n agentScopeMap: Map<AgentName, SkillScope>;\n};\n\n/**\n * Compiles agents for every scope the current context owns.\n *\n * Home context: a single pass writing to the home agents directory.\n * Project context: a global pass (from home) then a project pass, each\n * filtered to its own scope so the project pass cannot overwrite global\n * agents with zero-skill versions. Results merge in pass order.\n */\nexport async function compileAgentsAllScopes(\n options: CompileAllScopesOptions,\n): Promise<CompilationResult> {\n const { projectDir, sourcePath, skills, agentScopeMap } = options;\n const base = { sourcePath, skills, agentScopeMap };\n\n if (isHomeDirectory(projectDir)) {\n return compileAgents({\n ...base,\n projectDir,\n outputDir: resolveInstallPaths(projectDir, \"project\").agentsDir,\n });\n }\n\n const globalResult = await compileAgents({\n ...base,\n projectDir: os.homedir(),\n outputDir: resolveInstallPaths(os.homedir(), \"global\").agentsDir,\n scopeFilter: \"global\",\n });\n const projectResult = await compileAgents({\n ...base,\n projectDir,\n outputDir: resolveInstallPaths(projectDir, \"project\").agentsDir,\n scopeFilter: \"project\",\n });\n return mergeCompilationResults(globalResult, projectResult);\n}\n\nfunction mergeCompilationResults(...results: CompilationResult[]): CompilationResult {\n return {\n compiled: results.flatMap((r) => r.compiled),\n failed: results.flatMap((r) => r.failed),\n warnings: results.flatMap((r) => r.warnings),\n };\n}\n","export { detectProject, type DetectedProject } from \"./detect-project.js\";\nexport { detectBothInstallations, type BothInstallations } from \"./detect-both-installations.js\";\nexport {\n writeProjectConfig,\n type ConfigWriteOptions,\n type ConfigWriteResult,\n} from \"./write-project-config.js\";\nexport {\n compileAgents,\n type CompileAgentsOptions,\n type CompilationResult,\n} from \"./compile-agents.js\";\nexport {\n type CompileAllScopesOptions,\n compileAgentsAllScopes,\n} from \"./compile-agents-all-scopes.js\";\nexport {\n recompileRegisteredProjectAgents,\n recompilePropagatedProjectAgents,\n type PropagatedRecompileSummary,\n} from \"./recompile-project-agents.js\";\nexport { loadAgentDefs, type AgentDefs } from \"./load-agent-defs.js\";\n","// Operations — composable building blocks for CLI commands.\n// Each operation wraps lower-level lib functions into a single typed call.\n\nexport {\n loadSource,\n type LoadSourceOptions,\n type LoadedSource,\n ensureMarketplace,\n type MarketplaceResult,\n requireMarketplace,\n type MarketplaceRequirement,\n} from \"./source/index.js\";\n\nexport {\n discoverInstalledSkills,\n discoverLocalProjectSkills,\n mergeSkills,\n type DiscoveredSkills,\n collectScopedSkillDirs,\n type ScopedSkillDir,\n type ScopedSkillDirsResult,\n copyLocalSkills,\n type SkillCopyResult,\n compareSkillsWithSource,\n buildSourceSkillsMap,\n type SkillComparisonResults,\n findSkillMatch,\n type SkillMatchResult,\n installPluginSkills,\n type PluginInstallResult,\n pluginInstallFailureError,\n uninstallPluginSkills,\n type PluginUninstallResult,\n} from \"./skills/index.js\";\n\nexport {\n detectProject,\n type DetectedProject,\n detectBothInstallations,\n type BothInstallations,\n writeProjectConfig,\n type ConfigWriteOptions,\n type ConfigWriteResult,\n compileAgents,\n type CompileAgentsOptions,\n type CompilationResult,\n compileAgentsAllScopes,\n type CompileAllScopesOptions,\n recompileRegisteredProjectAgents,\n recompilePropagatedProjectAgents,\n type PropagatedRecompileSummary,\n loadAgentDefs,\n type AgentDefs,\n} from \"./project/index.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AA+BA,eAAsB,WAAW,SAAmD;AAClF,QAAM,EAAE,YAAY,YAAY,cAAc,uBAAuB,IAAI;AAEzE,MAAI,wBAAwB;AAC1B,oBAAgB;AAAA,EAClB;AAEA,MAAI;AACJ,MAAI;AACF,mBAAe,MAAM,2BAA2B;AAAA,MAC9C;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,SAAS,OAAO;AACd,QAAI,wBAAwB;AAC1B,uBAAiB;AAAA,IACnB;AACA,UAAM;AAAA,EACR;AAEA,MAAI,kBAAoC,CAAC;AACzC,MAAI,wBAAwB;AAC1B,sBAAkB,YAAY;AAC9B,qBAAiB;AAAA,EACnB;AAEA,SAAO,EAAE,cAAc,gBAAgB;AACzC;;;AC3DA;;;ACAA;AAsBA,eAAsB,cAAc,YAAsD;AACxF,QAAM,cAAc,cAAc,QAAQ,IAAI;AAE9C,MAAI;AACJ,MAAI;AACF,mBAAe,MAAM,mBAAmB,WAAW;AAAA,EACrD,SAAS,OAAO;AACd,QAAI,iBAAiB,gBAAiB,QAAO;AAC7C,UAAM;AAAA,EACR;AAEA,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,MAAM,kBAAkB,aAAa,UAAU;AAE9D,SAAO;AAAA,IACL;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,EAAE,YAAY,YAAY,QAAQ,cAAc,IAAI;AAC1D,QAAM,OAAO,EAAE,YAAY,QAAQ,cAAc;AAEjD,MAAI,gBAAgB,UAAU,GAAG;AAC/B,WAAO,cAAc;AAAA,MACnB,GAAG;AAAA,MACH;AAAA,MACA,WAAW,oBAAoB,YAAY,SAAS,EAAE;AAAA,IACxD,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,MAAM,cAAc;AAAA,IACvC,GAAG;AAAA,IACH,YAAY,GAAG,QAAQ;AAAA,IACvB,WAAW,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,EAAE;AAAA,IACvD,aAAa;AAAA,EACf,CAAC;AACD,QAAM,gBAAgB,MAAM,cAAc;AAAA,IACxC,GAAG;AAAA,IACH;AAAA,IACA,WAAW,oBAAoB,YAAY,SAAS,EAAE;AAAA,IACtD,aAAa;AAAA,EACf,CAAC;AACD,SAAO,wBAAwB,cAAc,aAAa;AAC5D;AAEA,SAAS,2BAA2B,SAAiD;AACnF,SAAO;AAAA,IACL,UAAU,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ;AAAA,IAC3C,QAAQ,QAAQ,QAAQ,CAAC,MAAM,EAAE,MAAM;AAAA,IACvC,UAAU,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ;AAAA,EAC7C;AACF;;;ACxDA;;;ACAA;","names":[]}
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- init_esm_shims
4
- } from "./chunk-P56WJ5FA.js";
5
-
6
- // src/cli/lib/__tests__/helpers/wizard-simulation.ts
7
- init_esm_shims();
8
- function buildSkillConfig(id, overrides) {
9
- return {
10
- id,
11
- scope: overrides?.scope ?? "project",
12
- source: overrides?.source ?? "eject",
13
- ...overrides?.excluded !== void 0 && { excluded: overrides.excluded }
14
- };
15
- }
16
- function buildSkillConfigs(skillIds, overrides) {
17
- return skillIds.map((id) => buildSkillConfig(id, overrides));
18
- }
19
-
20
- // src/cli/lib/__tests__/factories/config-factories.ts
21
- init_esm_shims();
22
- function buildAgentConfigs(agentNames, overrides) {
23
- return agentNames.map((name) => ({
24
- name,
25
- scope: overrides?.scope ?? "project",
26
- ...overrides?.excluded !== void 0 && { excluded: overrides.excluded },
27
- ...overrides?.model !== void 0 && { model: overrides.model },
28
- ...overrides?.effort !== void 0 && { effort: overrides.effort }
29
- }));
30
- }
31
-
32
- export {
33
- buildSkillConfigs,
34
- buildAgentConfigs
35
- };
36
- //# sourceMappingURL=chunk-DIBCRIMR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/lib/__tests__/helpers/wizard-simulation.ts","../src/cli/lib/__tests__/factories/config-factories.ts"],"sourcesContent":["import type {\n Category,\n Domain,\n DomainSelections,\n MergedSkillsMatrix,\n SkillConfig,\n SkillId,\n} from \"../../../types\";\nimport { resolveSelectedSkillIds, type WizardResultV2 } from \"../../../components/wizard/wizard\";\nimport { useWizardStore } from \"../../../stores/wizard-store\";\nimport { validateSelection } from \"../../matrix\";\nimport { DEFAULT_PUBLIC_SOURCE_NAME } from \"../../../consts\";\n\n/** Build a single SkillConfig from an id with default scope and source */\nexport function buildSkillConfig(\n id: SkillId,\n overrides?: Partial<Omit<SkillConfig, \"id\">>,\n): SkillConfig {\n return {\n id,\n scope: overrides?.scope ?? \"project\",\n source: overrides?.source ?? \"eject\",\n ...(overrides?.excluded !== undefined && { excluded: overrides.excluded }),\n };\n}\n\n/** Build a SkillConfig array from skill IDs with default scope and source */\nexport function buildSkillConfigs(\n skillIds: SkillId[],\n overrides?: Partial<Omit<SkillConfig, \"id\">>,\n): SkillConfig[] {\n return skillIds.map((id) => buildSkillConfig(id, overrides));\n}\n\n/**\n * Simulates a user selecting specific skills via the wizard store.\n *\n * Sets up domainSelections as if the user toggled each skill in the build step,\n * using the matrix to look up the correct domain and category per skill.\n */\nexport function simulateSkillSelections(\n skillIds: SkillId[],\n matrix: MergedSkillsMatrix,\n selectedDomains: string[],\n): void {\n const domainSelections = skillIds.reduce<DomainSelections>((acc, skillId) => {\n const skill = matrix.skills[skillId];\n if (!skill) return acc;\n // Boundary cast: skill.category is a Category at runtime\n const category = skill.category as Category;\n const domain = matrix.categories[category]?.domain;\n if (!domain) return acc;\n const domainObj = acc[domain] ?? {};\n const subcatList = domainObj[category] ?? [];\n if (subcatList.includes(skillId)) return acc;\n return {\n ...acc,\n [domain]: { ...domainObj, [category]: [...subcatList, skillId] },\n };\n }, {});\n\n useWizardStore.setState({\n domainSelections,\n selectedDomains: selectedDomains as Domain[],\n approach: \"scratch\",\n step: \"confirm\",\n });\n}\n\n/**\n * Replicates `handleComplete` from wizard.tsx for the \"customize\" path.\n *\n * Given the wizard store state (after simulated user selections), this builds\n * the same WizardResultV2 that the real wizard produces, delegating skill-id\n * resolution to the wizard's own `resolveSelectedSkillIds` (stack defaults or\n * per-domain selections), then running validation. Requires the matrix\n * provider to be initialized (as the real wizard does).\n */\nexport function buildWizardResultFromStore(overrides?: Partial<WizardResultV2>): WizardResultV2 {\n const store = useWizardStore.getState();\n\n const allSkills = resolveSelectedSkillIds(store);\n\n const validation = validateSelection(allSkills);\n\n // Auto-scope skills to match agent scope when every agent is global — this mirrors\n // a home-dir install where both sides of the stack equation live at global scope.\n // Without alignment, the stack mutator correctly rejects the scope mismatch and\n // integration tests that simulate home installs end up with empty stacks.\n // Tests that verify cross-scope mismatch behavior must pass skills explicitly via\n // `skillConfigs` rather than relying on this synthesis path.\n const allAgentsGlobal =\n store.agentConfigs.length > 0 && store.agentConfigs.every((ac) => ac.scope === \"global\");\n const synthesizedSkills = allAgentsGlobal\n ? buildSkillConfigs(allSkills, { scope: \"global\", source: DEFAULT_PUBLIC_SOURCE_NAME })\n : buildSkillConfigs(allSkills);\n\n return {\n skills: store.skillConfigs.length > 0 ? store.skillConfigs : synthesizedSkills,\n selectedAgents: store.selectedAgents,\n agentConfigs: store.agentConfigs,\n selectedStackId: store.selectedStackId,\n domainSelections: store.domainSelections,\n selectedDomains: store.selectedDomains,\n unresolvableSkillIds: store.unresolvableSkillIds,\n cancelled: false,\n validation,\n ...overrides,\n };\n}\n\n/**\n * Extracts skill IDs from a stack assignment value, which may be:\n * - A bare string (e.g., \"web-framework-react\")\n * - An object with .id (e.g., { id: \"web-framework-react\", preloaded: true })\n * - An array of strings or objects\n */\nexport function extractSkillIdsFromAssignment(assignment: unknown): string[] {\n if (typeof assignment === \"string\") {\n return [assignment];\n }\n if (Array.isArray(assignment)) {\n return assignment.flatMap((item) => extractSkillIdsFromAssignment(item));\n }\n if (typeof assignment === \"object\" && assignment !== null && \"id\" in assignment) {\n return [String((assignment as { id: string }).id)];\n }\n return [];\n}\n","import type {\n AgentName,\n AgentScopeConfig,\n DomainSelections,\n MergedSkillsMatrix,\n ProjectConfig,\n SkillConfig,\n SkillId,\n} from \"../../../types\";\nimport type { WizardResultV2 } from \"../../../components/wizard/wizard\";\nimport type { SourceLoadResult } from \"../../loading/source-loader\";\nimport type { ResolvedConfig } from \"../../configuration/config\";\nimport type { GateReport } from \"../../config-gate/index.js\";\nimport type { TestProjectConfig } from \"../fixtures/create-test-source\";\nimport { initializeMatrix } from \"../../matrix/matrix-provider\";\nimport { NO_CHANGES } from \"../../config-gate/classify.js\";\nimport { NOTHING_RECOMPILED } from \"../../config-gate/recompile.js\";\nimport { buildSkillConfigs } from \"../helpers/wizard-simulation.js\";\n\nexport function buildSourceConfig(\n overrides?: Partial<ResolvedConfig> & Record<string, unknown>,\n): Record<string, unknown> {\n // Record return kept: source config is parse-boundary data callers vary with arbitrary fields.\n return {\n source: \"github:test-org/skills\",\n ...overrides,\n };\n}\n\n/**\n * The report a gated config write returns. Defaults to a write that changed the\n * global pair and reached nobody; pass `propagatedTo` for a fan-out, whose\n * projects are all reported as recompiled.\n */\nexport function buildGateReport(\n propagatedTo: string[] = [],\n overrides?: Partial<GateReport>,\n): GateReport {\n return {\n globalWritten: true,\n changes: NO_CHANGES,\n propagated: { updated: propagatedTo, skipped: [] },\n recompile: { ...NOTHING_RECOMPILED, recompiledCount: propagatedTo.length },\n ...overrides,\n };\n}\n\nexport function buildProjectConfig(overrides?: Partial<ProjectConfig>): ProjectConfig {\n return {\n name: \"test-project\",\n agents: [{ name: \"web-developer\", scope: \"project\" }],\n skills: buildSkillConfigs([\"web-framework-react\"]),\n ...overrides,\n };\n}\n\nexport function buildWizardResult(\n skills: SkillConfig[],\n overrides?: Partial<WizardResultV2>,\n): WizardResultV2 {\n const selectedAgents = overrides?.selectedAgents ?? [];\n // Keep agentConfigs in sync with selectedAgents by default — the production\n // pipeline (generateProjectConfigFromSkills) requires every selected agent\n // to have a matching AgentScopeConfig. Callers can override agentConfigs\n // explicitly to test mismatch behavior.\n const defaultAgentConfigs =\n selectedAgents.length > 0 ? buildAgentConfigs([...selectedAgents]) : [];\n return {\n skills,\n selectedAgents: [],\n agentConfigs: defaultAgentConfigs,\n selectedStackId: null,\n domainSelections: {} as DomainSelections,\n selectedDomains: [],\n unresolvableSkillIds: [],\n cancelled: false,\n validation: { valid: true, errors: [], warnings: [] },\n ...overrides,\n };\n}\n\nexport function buildAgentConfigs(\n agentNames: AgentName[],\n overrides?: Partial<Omit<AgentScopeConfig, \"name\">>,\n): AgentScopeConfig[] {\n return agentNames.map((name) => ({\n name,\n scope: overrides?.scope ?? \"project\",\n ...(overrides?.excluded !== undefined && { excluded: overrides.excluded }),\n ...(overrides?.model !== undefined && { model: overrides.model }),\n ...(overrides?.effort !== undefined && { effort: overrides.effort }),\n }));\n}\n\nexport function buildSourceResult(\n matrix: MergedSkillsMatrix,\n sourcePath: string,\n overrides?: Partial<SourceLoadResult>,\n): SourceLoadResult {\n const sourceConfig: ResolvedConfig = {\n source: sourcePath,\n sourceOrigin: \"flag\",\n };\n return {\n matrix,\n sourceConfig,\n sourcePath,\n isLocal: true,\n ...overrides,\n };\n}\n\n/**\n * Registers the matrix with the provider and returns a SourceLoadResult for it.\n * Composes initializeMatrix + buildSourceResult — the common per-test arrange\n * step for integration tests that both set the active matrix and pass a source\n * result into an install/copy operation.\n */\nexport function initMatrixAndSource(\n matrix: MergedSkillsMatrix,\n sourcePath: string,\n overrides?: Partial<SourceLoadResult>,\n): SourceLoadResult {\n initializeMatrix(matrix);\n return buildSourceResult(matrix, sourcePath, overrides);\n}\n\nexport function buildTestProjectConfig(\n agents: string[],\n skills: Array<string | { id: string }>,\n overrides?: Partial<TestProjectConfig>,\n): TestProjectConfig {\n const skillIds = skills.map((s) => (typeof s === \"string\" ? s : s.id));\n return {\n name: \"test-project\",\n description: \"Test project\",\n // Boundary cast: test callers pass loose string agent/skill identifiers\n // (some fictional). Emit the object-shaped config the loader schema requires —\n // buildAgentConfigs/buildSkillConfigs do no matrix lookups, so loose IDs are safe.\n agents: buildAgentConfigs(agents as AgentName[]),\n skills: buildSkillConfigs(skillIds as SkillId[]),\n ...overrides,\n };\n}\n"],"mappings":";;;;;;AAAA;AAcO,SAAS,iBACd,IACA,WACa;AACb,SAAO;AAAA,IACL;AAAA,IACA,OAAO,WAAW,SAAS;AAAA,IAC3B,QAAQ,WAAW,UAAU;AAAA,IAC7B,GAAI,WAAW,aAAa,UAAa,EAAE,UAAU,UAAU,SAAS;AAAA,EAC1E;AACF;AAGO,SAAS,kBACd,UACA,WACe;AACf,SAAO,SAAS,IAAI,CAAC,OAAO,iBAAiB,IAAI,SAAS,CAAC;AAC7D;;;AChCA;AAiFO,SAAS,kBACd,YACA,WACoB;AACpB,SAAO,WAAW,IAAI,CAAC,UAAU;AAAA,IAC/B;AAAA,IACA,OAAO,WAAW,SAAS;AAAA,IAC3B,GAAI,WAAW,aAAa,UAAa,EAAE,UAAU,UAAU,SAAS;AAAA,IACxE,GAAI,WAAW,UAAU,UAAa,EAAE,OAAO,UAAU,MAAM;AAAA,IAC/D,GAAI,WAAW,WAAW,UAAa,EAAE,QAAQ,UAAU,OAAO;AAAA,EACpE,EAAE;AACJ;","names":[]}