agents-inc 0.152.1 → 0.154.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 (442) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +31 -35
  3. package/dist/{chunk-FVDKAVOL.js → chunk-2IMYK4WN.js} +18 -51
  4. package/dist/chunk-2IMYK4WN.js.map +1 -0
  5. package/dist/{chunk-PMM2MYMA.js → chunk-4VCWL2IG.js} +649 -357
  6. package/dist/chunk-4VCWL2IG.js.map +1 -0
  7. package/dist/{chunk-PZIZNMHK.js → chunk-5MFJ24VM.js} +237 -150
  8. package/dist/chunk-5MFJ24VM.js.map +1 -0
  9. package/dist/{chunk-KXYVJGJP.js → chunk-6CNRMCFM.js} +3 -2
  10. package/dist/{chunk-KXYVJGJP.js.map → chunk-6CNRMCFM.js.map} +1 -1
  11. package/dist/chunk-7VZV4O6B.js +40 -0
  12. package/dist/chunk-7VZV4O6B.js.map +1 -0
  13. package/dist/{chunk-SX5H6TSC.js → chunk-AKQ5QISO.js} +11 -8
  14. package/dist/chunk-AKQ5QISO.js.map +1 -0
  15. package/dist/{chunk-BNSRA6HL.js → chunk-AURY6RT6.js} +39 -176
  16. package/dist/chunk-AURY6RT6.js.map +1 -0
  17. package/dist/{chunk-LZ52XEPR.js → chunk-B66SC72V.js} +7 -6
  18. package/dist/chunk-B66SC72V.js.map +1 -0
  19. package/dist/{chunk-LASI35KT.js → chunk-BZ4CZBOM.js} +14 -28
  20. package/dist/chunk-BZ4CZBOM.js.map +1 -0
  21. package/dist/chunk-CBF4ZYV3.js +18540 -0
  22. package/dist/chunk-CBF4ZYV3.js.map +1 -0
  23. package/dist/{chunk-5GUOIJSG.js → chunk-CHNA5RVS.js} +3 -15
  24. package/dist/chunk-CHNA5RVS.js.map +1 -0
  25. package/dist/{chunk-LDP5ASDM.js → chunk-DRKSYJZ2.js} +2 -19
  26. package/dist/chunk-DRKSYJZ2.js.map +1 -0
  27. package/dist/chunk-FMYHWKGG.js +325 -0
  28. package/dist/chunk-FMYHWKGG.js.map +1 -0
  29. package/dist/{chunk-SKQWRUPX.js → chunk-GUDGCFSF.js} +59 -33
  30. package/dist/chunk-GUDGCFSF.js.map +1 -0
  31. package/dist/{chunk-WKTHWQKM.js → chunk-IPJOMAWC.js} +5070 -6305
  32. package/dist/chunk-IPJOMAWC.js.map +1 -0
  33. package/dist/chunk-IXEDSKMH.js +48 -0
  34. package/dist/chunk-IXEDSKMH.js.map +1 -0
  35. package/dist/{chunk-TUPYW2IQ.js → chunk-JC7DBPRD.js} +9 -12
  36. package/dist/chunk-JC7DBPRD.js.map +1 -0
  37. package/dist/{chunk-ZL7PFNHN.js → chunk-K3O3YQYG.js} +2 -2
  38. package/dist/{chunk-QRDTLVXG.js → chunk-LA3JPESW.js} +9 -22
  39. package/dist/chunk-LA3JPESW.js.map +1 -0
  40. package/dist/{chunk-MWG4VU64.js → chunk-MJFIO5SX.js} +50 -74
  41. package/dist/chunk-MJFIO5SX.js.map +1 -0
  42. package/dist/{chunk-L7SZXUBJ.js → chunk-NFH6SA62.js} +7 -6
  43. package/dist/{chunk-L7SZXUBJ.js.map → chunk-NFH6SA62.js.map} +1 -1
  44. package/dist/{chunk-GRVKW3CC.js → chunk-NKCY2ULI.js} +3 -2
  45. package/dist/{chunk-GRVKW3CC.js.map → chunk-NKCY2ULI.js.map} +1 -1
  46. package/dist/{chunk-TJJPWUMA.js → chunk-NSJ2S7R5.js} +3 -2
  47. package/dist/{chunk-TJJPWUMA.js.map → chunk-NSJ2S7R5.js.map} +1 -1
  48. package/dist/{chunk-Q2KG7UV3.js → chunk-OJJLYHM3.js} +2 -1
  49. package/dist/{chunk-Q2KG7UV3.js.map → chunk-OJJLYHM3.js.map} +1 -1
  50. package/dist/{chunk-MJ2KHG24.js → chunk-ONWEOS77.js} +6 -6
  51. package/dist/{chunk-MJ2KHG24.js.map → chunk-ONWEOS77.js.map} +1 -1
  52. package/dist/{chunk-NR3OZGL4.js → chunk-OZXAJNLA.js} +2 -1
  53. package/dist/{chunk-NR3OZGL4.js.map → chunk-OZXAJNLA.js.map} +1 -1
  54. package/dist/{chunk-QZZJFYUQ.js → chunk-PRJD5MMQ.js} +3 -3
  55. package/dist/chunk-PRJD5MMQ.js.map +1 -0
  56. package/dist/{chunk-MM7CTTAV.js → chunk-Q5FLW4JG.js} +2 -2
  57. package/dist/{chunk-MM7CTTAV.js.map → chunk-Q5FLW4JG.js.map} +1 -1
  58. package/dist/{chunk-5UWKOOIS.js → chunk-QQTYMW7N.js} +131 -209
  59. package/dist/chunk-QQTYMW7N.js.map +1 -0
  60. package/dist/{chunk-MVR3SYMN.js → chunk-QUDQTO3O.js} +4 -3
  61. package/dist/{chunk-MVR3SYMN.js.map → chunk-QUDQTO3O.js.map} +1 -1
  62. package/dist/{chunk-76ADG7LQ.js → chunk-R54KIGN2.js} +8 -22
  63. package/dist/chunk-R54KIGN2.js.map +1 -0
  64. package/dist/{chunk-XHUODHZ4.js → chunk-R7JV22QK.js} +22 -49
  65. package/dist/chunk-R7JV22QK.js.map +1 -0
  66. package/dist/{chunk-E5X6RJ4E.js → chunk-TUQF577Z.js} +56 -53
  67. package/dist/chunk-TUQF577Z.js.map +1 -0
  68. package/dist/{chunk-IHUY4M22.js → chunk-UW44KSYL.js} +4 -4
  69. package/dist/{chunk-DTSG5XZB.js → chunk-V3ENMW7G.js} +3 -3
  70. package/dist/chunk-VZRO7RYT.js +3694 -0
  71. package/dist/chunk-VZRO7RYT.js.map +1 -0
  72. package/dist/{chunk-MQ7FLIYS.js → chunk-WRRP47PY.js} +3 -2
  73. package/dist/{chunk-MQ7FLIYS.js.map → chunk-WRRP47PY.js.map} +1 -1
  74. package/dist/{chunk-RNJWAKMO.js → chunk-XGMOXMS4.js} +9 -8
  75. package/dist/chunk-XGMOXMS4.js.map +1 -0
  76. package/dist/{chunk-STMHDOZD.js → chunk-XMEIVWAS.js} +12 -9
  77. package/dist/chunk-XMEIVWAS.js.map +1 -0
  78. package/dist/{chunk-IUQBOCSU.js → chunk-ZBPEFQ4G.js} +2 -1
  79. package/dist/{chunk-IUQBOCSU.js.map → chunk-ZBPEFQ4G.js.map} +1 -1
  80. package/dist/chunk-ZU6DAR4S.js +223 -0
  81. package/dist/chunk-ZU6DAR4S.js.map +1 -0
  82. package/dist/commands/build/marketplace.js +115 -35
  83. package/dist/commands/build/marketplace.js.map +1 -1
  84. package/dist/commands/build/plugins.js +9 -10
  85. package/dist/commands/build/plugins.js.map +1 -1
  86. package/dist/commands/compile.js +135 -70
  87. package/dist/commands/compile.js.map +1 -1
  88. package/dist/commands/doctor.js +793 -64
  89. package/dist/commands/doctor.js.map +1 -1
  90. package/dist/commands/edit.js +231 -236
  91. package/dist/commands/edit.js.map +1 -1
  92. package/dist/commands/eject.js +24 -39
  93. package/dist/commands/eject.js.map +1 -1
  94. package/dist/commands/init.js +41 -46
  95. package/dist/commands/list.js +10 -12
  96. package/dist/commands/list.js.map +1 -1
  97. package/dist/commands/search.js +35 -88
  98. package/dist/commands/search.js.map +1 -1
  99. package/dist/commands/uninstall.js +212 -167
  100. package/dist/commands/uninstall.js.map +1 -1
  101. package/dist/commands/update.js +82 -332
  102. package/dist/commands/update.js.map +1 -1
  103. package/dist/components/common/confirm.js +1 -1
  104. package/dist/components/common/prompt-confirm.js +1 -1
  105. package/dist/components/common/select-list.js +2 -2
  106. package/dist/components/common/spinner.js +1 -1
  107. package/dist/components/wizard/category-grid.js +5 -6
  108. package/dist/components/wizard/checkbox-grid.js +5 -6
  109. package/dist/components/wizard/domain-selection.js +12 -13
  110. package/dist/components/wizard/run-wizard-session.js +30 -36
  111. package/dist/components/wizard/scroll-affordance.js +2 -2
  112. package/dist/components/wizard/skill-agent-summary.js +7 -7
  113. package/dist/components/wizard/source-grid.js +6 -11
  114. package/dist/components/wizard/stack-selection.js +9 -9
  115. package/dist/components/wizard/step-agents.js +12 -12
  116. package/dist/components/wizard/step-build.js +10 -11
  117. package/dist/components/wizard/step-confirm.js +11 -11
  118. package/dist/components/wizard/step-sources.js +11 -17
  119. package/dist/components/wizard/step-stack.js +10 -10
  120. package/dist/components/wizard/summary-panel.js +10 -10
  121. package/dist/components/wizard/toast.js +2 -2
  122. package/dist/components/wizard/wizard-layout.js +15 -16
  123. package/dist/components/wizard/wizard-tabs.js +6 -12
  124. package/dist/components/wizard/wizard.js +29 -35
  125. package/dist/config-exports.js +1 -1
  126. package/dist/copy-local-skills-WVHJFRPK.js +14 -0
  127. package/dist/hooks/init.js +49 -48
  128. package/dist/hooks/init.js.map +1 -1
  129. package/dist/index.js +3 -1
  130. package/dist/index.js.map +1 -1
  131. package/dist/load-agent-defs-5OT54J5M.js +15 -0
  132. package/dist/{loader-5JP4S7CJ.js → loader-JIZDTR4G.js} +7 -5
  133. package/dist/recompile-project-agents-VREEPBDV.js +20 -0
  134. package/dist/{source-loader-MZYCPL2S.js → source-loader-OE6EJFPU.js} +6 -6
  135. package/dist/src/agents/developer/ai-developer/identity.md +4 -4
  136. package/dist/src/agents/developer/ai-developer/playbook.md +1 -1
  137. package/dist/src/agents/developer/api-developer/identity.md +4 -4
  138. package/dist/src/agents/developer/api-developer/metadata.yaml +1 -1
  139. package/dist/src/agents/developer/cli-developer/identity.md +4 -4
  140. package/dist/src/agents/developer/web-developer/identity.md +2 -2
  141. package/dist/src/agents/developer/web-developer/metadata.yaml +1 -1
  142. package/dist/src/agents/meta/agent-summoner/identity.md +4 -5
  143. package/dist/src/agents/meta/agent-summoner/output.md +2 -2
  144. package/dist/src/agents/meta/agent-summoner/playbook.md +15 -16
  145. package/dist/src/agents/meta/codex-keeper/identity.md +4 -4
  146. package/dist/src/agents/meta/codex-keeper/playbook.md +1 -1
  147. package/dist/src/agents/meta/convention-keeper/identity.md +1 -1
  148. package/dist/src/agents/meta/skill-summoner/critical-reminders.md +0 -34
  149. package/dist/src/agents/meta/skill-summoner/critical-requirements.md +27 -3
  150. package/dist/src/agents/meta/skill-summoner/identity.md +2 -2
  151. package/{src/agents/planning/web-pm → dist/src/agents/planning/pm}/critical-reminders.md +10 -7
  152. package/dist/src/agents/planning/{web-pm → pm}/critical-requirements.md +8 -4
  153. package/dist/src/agents/planning/pm/identity.md +47 -0
  154. package/dist/src/agents/planning/pm/metadata.yaml +12 -0
  155. package/dist/src/agents/planning/{web-pm → pm}/output.md +7 -90
  156. package/dist/src/agents/planning/pm/playbook.md +185 -0
  157. package/dist/src/agents/researcher/ai-researcher/critical-reminders.md +58 -0
  158. package/dist/src/agents/researcher/ai-researcher/critical-requirements.md +40 -0
  159. package/dist/src/agents/researcher/ai-researcher/identity.md +86 -0
  160. package/dist/src/agents/researcher/ai-researcher/metadata.yaml +10 -0
  161. package/dist/src/agents/researcher/ai-researcher/output.md +363 -0
  162. package/dist/src/agents/researcher/ai-researcher/playbook.md +545 -0
  163. package/dist/src/agents/researcher/api-researcher/critical-reminders.md +16 -0
  164. package/dist/src/agents/researcher/api-researcher/identity.md +7 -7
  165. package/dist/src/agents/researcher/cli-researcher/critical-reminders.md +50 -0
  166. package/dist/src/agents/researcher/cli-researcher/critical-requirements.md +36 -0
  167. package/dist/src/agents/researcher/cli-researcher/identity.md +87 -0
  168. package/dist/src/agents/researcher/cli-researcher/metadata.yaml +10 -0
  169. package/dist/src/agents/researcher/cli-researcher/output.md +343 -0
  170. package/dist/src/agents/researcher/cli-researcher/playbook.md +370 -0
  171. package/dist/src/agents/researcher/web-researcher/identity.md +5 -6
  172. package/dist/src/agents/reviewer/reviewer/critical-reminders.md +29 -0
  173. package/dist/src/agents/reviewer/reviewer/critical-requirements.md +31 -0
  174. package/dist/src/agents/reviewer/reviewer/identity.md +41 -0
  175. package/dist/src/agents/reviewer/reviewer/metadata.yaml +12 -0
  176. package/dist/src/agents/reviewer/reviewer/output.md +202 -0
  177. package/dist/src/agents/reviewer/reviewer/playbook.md +141 -0
  178. package/dist/src/agents/tester/ai-tester/critical-reminders.md +48 -0
  179. package/dist/src/agents/tester/ai-tester/critical-requirements.md +49 -0
  180. package/dist/src/agents/tester/ai-tester/identity.md +62 -0
  181. package/dist/src/agents/tester/ai-tester/metadata.yaml +12 -0
  182. package/dist/src/agents/tester/ai-tester/output.md +375 -0
  183. package/dist/src/agents/tester/ai-tester/playbook.md +789 -0
  184. package/dist/src/agents/tester/api-tester/identity.md +3 -3
  185. package/dist/src/agents/tester/cli-tester/critical-reminders.md +3 -3
  186. package/dist/src/agents/tester/cli-tester/critical-requirements.md +2 -2
  187. package/dist/src/agents/tester/cli-tester/identity.md +3 -3
  188. package/dist/src/agents/tester/cli-tester/output.md +4 -4
  189. package/dist/src/agents/tester/cli-tester/playbook.md +3 -3
  190. package/dist/src/agents/tester/web-tester/identity.md +3 -3
  191. package/dist/stores/wizard-store.js +8 -6
  192. package/package.json +13 -2
  193. package/src/agents/developer/ai-developer/identity.md +4 -4
  194. package/src/agents/developer/ai-developer/playbook.md +1 -1
  195. package/src/agents/developer/api-developer/identity.md +4 -4
  196. package/src/agents/developer/api-developer/metadata.yaml +1 -1
  197. package/src/agents/developer/cli-developer/identity.md +4 -4
  198. package/src/agents/developer/web-developer/identity.md +2 -2
  199. package/src/agents/developer/web-developer/metadata.yaml +1 -1
  200. package/src/agents/meta/agent-summoner/identity.md +4 -5
  201. package/src/agents/meta/agent-summoner/output.md +2 -2
  202. package/src/agents/meta/agent-summoner/playbook.md +15 -16
  203. package/src/agents/meta/codex-keeper/identity.md +4 -4
  204. package/src/agents/meta/codex-keeper/playbook.md +1 -1
  205. package/src/agents/meta/convention-keeper/identity.md +1 -1
  206. package/src/agents/meta/skill-summoner/critical-reminders.md +0 -34
  207. package/src/agents/meta/skill-summoner/critical-requirements.md +27 -3
  208. package/src/agents/meta/skill-summoner/identity.md +2 -2
  209. package/{dist/src/agents/planning/web-pm → src/agents/planning/pm}/critical-reminders.md +10 -7
  210. package/src/agents/planning/{web-pm → pm}/critical-requirements.md +8 -4
  211. package/src/agents/planning/pm/identity.md +47 -0
  212. package/src/agents/planning/pm/metadata.yaml +12 -0
  213. package/src/agents/planning/{web-pm → pm}/output.md +7 -90
  214. package/src/agents/planning/pm/playbook.md +185 -0
  215. package/src/agents/researcher/ai-researcher/critical-reminders.md +58 -0
  216. package/src/agents/researcher/ai-researcher/critical-requirements.md +40 -0
  217. package/src/agents/researcher/ai-researcher/identity.md +86 -0
  218. package/src/agents/researcher/ai-researcher/metadata.yaml +10 -0
  219. package/src/agents/researcher/ai-researcher/output.md +363 -0
  220. package/src/agents/researcher/ai-researcher/playbook.md +545 -0
  221. package/src/agents/researcher/api-researcher/critical-reminders.md +16 -0
  222. package/src/agents/researcher/api-researcher/identity.md +7 -7
  223. package/src/agents/researcher/cli-researcher/critical-reminders.md +50 -0
  224. package/src/agents/researcher/cli-researcher/critical-requirements.md +36 -0
  225. package/src/agents/researcher/cli-researcher/identity.md +87 -0
  226. package/src/agents/researcher/cli-researcher/metadata.yaml +10 -0
  227. package/src/agents/researcher/cli-researcher/output.md +343 -0
  228. package/src/agents/researcher/cli-researcher/playbook.md +370 -0
  229. package/src/agents/researcher/web-researcher/identity.md +5 -6
  230. package/src/agents/reviewer/reviewer/critical-reminders.md +29 -0
  231. package/src/agents/reviewer/reviewer/critical-requirements.md +31 -0
  232. package/src/agents/reviewer/reviewer/identity.md +41 -0
  233. package/src/agents/reviewer/reviewer/metadata.yaml +12 -0
  234. package/src/agents/reviewer/reviewer/output.md +202 -0
  235. package/src/agents/reviewer/reviewer/playbook.md +141 -0
  236. package/src/agents/tester/ai-tester/critical-reminders.md +48 -0
  237. package/src/agents/tester/ai-tester/critical-requirements.md +49 -0
  238. package/src/agents/tester/ai-tester/identity.md +62 -0
  239. package/src/agents/tester/ai-tester/metadata.yaml +12 -0
  240. package/src/agents/tester/ai-tester/output.md +375 -0
  241. package/src/agents/tester/ai-tester/playbook.md +789 -0
  242. package/src/agents/tester/api-tester/identity.md +3 -3
  243. package/src/agents/tester/cli-tester/critical-reminders.md +3 -3
  244. package/src/agents/tester/cli-tester/critical-requirements.md +2 -2
  245. package/src/agents/tester/cli-tester/identity.md +3 -3
  246. package/src/agents/tester/cli-tester/output.md +4 -4
  247. package/src/agents/tester/cli-tester/playbook.md +3 -3
  248. package/src/agents/tester/web-tester/identity.md +3 -3
  249. package/src/schemas/metadata.schema.json +31 -2
  250. package/src/schemas/plugin.schema.json +3 -0
  251. package/src/schemas/project-config.schema.json +61 -15
  252. package/src/schemas/project-source-config.schema.json +0 -47
  253. package/dist/chunk-5GUOIJSG.js.map +0 -1
  254. package/dist/chunk-5UWKOOIS.js.map +0 -1
  255. package/dist/chunk-76ADG7LQ.js.map +0 -1
  256. package/dist/chunk-BNSRA6HL.js.map +0 -1
  257. package/dist/chunk-E5X6RJ4E.js.map +0 -1
  258. package/dist/chunk-EEPELKOM.js +0 -5938
  259. package/dist/chunk-EEPELKOM.js.map +0 -1
  260. package/dist/chunk-F7T5AFFN.js +0 -20
  261. package/dist/chunk-F7T5AFFN.js.map +0 -1
  262. package/dist/chunk-FVDKAVOL.js.map +0 -1
  263. package/dist/chunk-KFB5CRXZ.js +0 -377
  264. package/dist/chunk-KFB5CRXZ.js.map +0 -1
  265. package/dist/chunk-KR65TPKC.js +0 -664
  266. package/dist/chunk-KR65TPKC.js.map +0 -1
  267. package/dist/chunk-LASI35KT.js.map +0 -1
  268. package/dist/chunk-LDP5ASDM.js.map +0 -1
  269. package/dist/chunk-LZ52XEPR.js.map +0 -1
  270. package/dist/chunk-M7HO7NBK.js +0 -88
  271. package/dist/chunk-M7HO7NBK.js.map +0 -1
  272. package/dist/chunk-MWG4VU64.js.map +0 -1
  273. package/dist/chunk-ODNDXQH2.js +0 -77
  274. package/dist/chunk-ODNDXQH2.js.map +0 -1
  275. package/dist/chunk-P44SXVH3.js +0 -80
  276. package/dist/chunk-P44SXVH3.js.map +0 -1
  277. package/dist/chunk-PMM2MYMA.js.map +0 -1
  278. package/dist/chunk-PZIZNMHK.js.map +0 -1
  279. package/dist/chunk-Q45ZU6HD.js +0 -37
  280. package/dist/chunk-Q45ZU6HD.js.map +0 -1
  281. package/dist/chunk-QRDTLVXG.js.map +0 -1
  282. package/dist/chunk-QZZJFYUQ.js.map +0 -1
  283. package/dist/chunk-R5NOI2LP.js +0 -170
  284. package/dist/chunk-R5NOI2LP.js.map +0 -1
  285. package/dist/chunk-RNJWAKMO.js.map +0 -1
  286. package/dist/chunk-SBHBBZKF.js +0 -284
  287. package/dist/chunk-SBHBBZKF.js.map +0 -1
  288. package/dist/chunk-SKQWRUPX.js.map +0 -1
  289. package/dist/chunk-STMHDOZD.js.map +0 -1
  290. package/dist/chunk-SX5H6TSC.js.map +0 -1
  291. package/dist/chunk-TUPYW2IQ.js.map +0 -1
  292. package/dist/chunk-UBEDZ4FD.js +0 -4198
  293. package/dist/chunk-UBEDZ4FD.js.map +0 -1
  294. package/dist/chunk-VY6MNOXL.js +0 -20
  295. package/dist/chunk-VY6MNOXL.js.map +0 -1
  296. package/dist/chunk-WBCPLH66.js +0 -42
  297. package/dist/chunk-WBCPLH66.js.map +0 -1
  298. package/dist/chunk-WKTHWQKM.js.map +0 -1
  299. package/dist/chunk-XHUODHZ4.js.map +0 -1
  300. package/dist/chunk-ZPPHXXAP.js +0 -252
  301. package/dist/chunk-ZPPHXXAP.js.map +0 -1
  302. package/dist/commands/import/skill.js +0 -344
  303. package/dist/commands/import/skill.js.map +0 -1
  304. package/dist/commands/new/agent.js +0 -300
  305. package/dist/commands/new/agent.js.map +0 -1
  306. package/dist/commands/new/marketplace.js +0 -310
  307. package/dist/commands/new/marketplace.js.map +0 -1
  308. package/dist/commands/new/skill.js +0 -26
  309. package/dist/commands/validate.js +0 -575
  310. package/dist/commands/validate.js.map +0 -1
  311. package/dist/components/wizard/search-modal.js +0 -13
  312. package/dist/components/wizard/selection-card.js +0 -9
  313. package/dist/components/wizard/step-settings.js +0 -18
  314. package/dist/copy-local-skills-6EMVN7RB.js +0 -14
  315. package/dist/load-agent-defs-BWOUVEAR.js +0 -15
  316. package/dist/load-agent-defs-BWOUVEAR.js.map +0 -1
  317. package/dist/loader-5JP4S7CJ.js.map +0 -1
  318. package/dist/recompile-project-agents-6DL45TDI.js +0 -19
  319. package/dist/recompile-project-agents-6DL45TDI.js.map +0 -1
  320. package/dist/source-loader-MZYCPL2S.js.map +0 -1
  321. package/dist/src/agents/developer/web-architecture/critical-reminders.md +0 -48
  322. package/dist/src/agents/developer/web-architecture/critical-requirements.md +0 -65
  323. package/dist/src/agents/developer/web-architecture/identity.md +0 -64
  324. package/dist/src/agents/developer/web-architecture/metadata.yaml +0 -12
  325. package/dist/src/agents/developer/web-architecture/output.md +0 -449
  326. package/dist/src/agents/developer/web-architecture/playbook.md +0 -481
  327. package/dist/src/agents/pattern/pattern-scout/critical-reminders.md +0 -71
  328. package/dist/src/agents/pattern/pattern-scout/critical-requirements.md +0 -31
  329. package/dist/src/agents/pattern/pattern-scout/identity.md +0 -25
  330. package/dist/src/agents/pattern/pattern-scout/metadata.yaml +0 -10
  331. package/dist/src/agents/pattern/pattern-scout/output.md +0 -290
  332. package/dist/src/agents/pattern/pattern-scout/playbook.md +0 -1806
  333. package/dist/src/agents/pattern/web-pattern-critique/critical-reminders.md +0 -30
  334. package/dist/src/agents/pattern/web-pattern-critique/critical-requirements.md +0 -28
  335. package/dist/src/agents/pattern/web-pattern-critique/identity.md +0 -41
  336. package/dist/src/agents/pattern/web-pattern-critique/metadata.yaml +0 -12
  337. package/dist/src/agents/pattern/web-pattern-critique/output.md +0 -314
  338. package/dist/src/agents/pattern/web-pattern-critique/playbook.md +0 -572
  339. package/dist/src/agents/planning/api-pm/critical-reminders.md +0 -48
  340. package/dist/src/agents/planning/api-pm/critical-requirements.md +0 -41
  341. package/dist/src/agents/planning/api-pm/identity.md +0 -39
  342. package/dist/src/agents/planning/api-pm/metadata.yaml +0 -12
  343. package/dist/src/agents/planning/api-pm/output.md +0 -475
  344. package/dist/src/agents/planning/api-pm/playbook.md +0 -129
  345. package/dist/src/agents/planning/web-pm/identity.md +0 -26
  346. package/dist/src/agents/planning/web-pm/metadata.yaml +0 -12
  347. package/dist/src/agents/planning/web-pm/playbook.md +0 -318
  348. package/dist/src/agents/reviewer/ai-reviewer/critical-reminders.md +0 -40
  349. package/dist/src/agents/reviewer/ai-reviewer/critical-requirements.md +0 -37
  350. package/dist/src/agents/reviewer/ai-reviewer/identity.md +0 -51
  351. package/dist/src/agents/reviewer/ai-reviewer/metadata.yaml +0 -10
  352. package/dist/src/agents/reviewer/ai-reviewer/output.md +0 -395
  353. package/dist/src/agents/reviewer/ai-reviewer/playbook.md +0 -90
  354. package/dist/src/agents/reviewer/api-reviewer/critical-reminders.md +0 -31
  355. package/dist/src/agents/reviewer/api-reviewer/critical-requirements.md +0 -27
  356. package/dist/src/agents/reviewer/api-reviewer/identity.md +0 -51
  357. package/dist/src/agents/reviewer/api-reviewer/metadata.yaml +0 -12
  358. package/dist/src/agents/reviewer/api-reviewer/output.md +0 -343
  359. package/dist/src/agents/reviewer/api-reviewer/playbook.md +0 -288
  360. package/dist/src/agents/reviewer/cli-reviewer/critical-reminders.md +0 -33
  361. package/dist/src/agents/reviewer/cli-reviewer/critical-requirements.md +0 -30
  362. package/dist/src/agents/reviewer/cli-reviewer/identity.md +0 -44
  363. package/dist/src/agents/reviewer/cli-reviewer/metadata.yaml +0 -12
  364. package/dist/src/agents/reviewer/cli-reviewer/output.md +0 -414
  365. package/dist/src/agents/reviewer/cli-reviewer/playbook.md +0 -218
  366. package/dist/src/agents/reviewer/infra-reviewer/critical-reminders.md +0 -38
  367. package/dist/src/agents/reviewer/infra-reviewer/critical-requirements.md +0 -38
  368. package/dist/src/agents/reviewer/infra-reviewer/identity.md +0 -53
  369. package/dist/src/agents/reviewer/infra-reviewer/metadata.yaml +0 -10
  370. package/dist/src/agents/reviewer/infra-reviewer/output.md +0 -364
  371. package/dist/src/agents/reviewer/infra-reviewer/playbook.md +0 -161
  372. package/dist/src/agents/reviewer/web-reviewer/critical-reminders.md +0 -31
  373. package/dist/src/agents/reviewer/web-reviewer/critical-requirements.md +0 -26
  374. package/dist/src/agents/reviewer/web-reviewer/identity.md +0 -40
  375. package/dist/src/agents/reviewer/web-reviewer/metadata.yaml +0 -12
  376. package/dist/src/agents/reviewer/web-reviewer/output.md +0 -333
  377. package/dist/src/agents/reviewer/web-reviewer/playbook.md +0 -156
  378. package/src/agents/developer/web-architecture/critical-reminders.md +0 -48
  379. package/src/agents/developer/web-architecture/critical-requirements.md +0 -65
  380. package/src/agents/developer/web-architecture/identity.md +0 -64
  381. package/src/agents/developer/web-architecture/metadata.yaml +0 -12
  382. package/src/agents/developer/web-architecture/output.md +0 -449
  383. package/src/agents/developer/web-architecture/playbook.md +0 -481
  384. package/src/agents/pattern/pattern-scout/critical-reminders.md +0 -71
  385. package/src/agents/pattern/pattern-scout/critical-requirements.md +0 -31
  386. package/src/agents/pattern/pattern-scout/identity.md +0 -25
  387. package/src/agents/pattern/pattern-scout/metadata.yaml +0 -10
  388. package/src/agents/pattern/pattern-scout/output.md +0 -290
  389. package/src/agents/pattern/pattern-scout/playbook.md +0 -1806
  390. package/src/agents/pattern/web-pattern-critique/critical-reminders.md +0 -30
  391. package/src/agents/pattern/web-pattern-critique/critical-requirements.md +0 -28
  392. package/src/agents/pattern/web-pattern-critique/identity.md +0 -41
  393. package/src/agents/pattern/web-pattern-critique/metadata.yaml +0 -12
  394. package/src/agents/pattern/web-pattern-critique/output.md +0 -314
  395. package/src/agents/pattern/web-pattern-critique/playbook.md +0 -572
  396. package/src/agents/planning/api-pm/critical-reminders.md +0 -48
  397. package/src/agents/planning/api-pm/critical-requirements.md +0 -41
  398. package/src/agents/planning/api-pm/identity.md +0 -39
  399. package/src/agents/planning/api-pm/metadata.yaml +0 -12
  400. package/src/agents/planning/api-pm/output.md +0 -475
  401. package/src/agents/planning/api-pm/playbook.md +0 -129
  402. package/src/agents/planning/web-pm/identity.md +0 -26
  403. package/src/agents/planning/web-pm/metadata.yaml +0 -12
  404. package/src/agents/planning/web-pm/playbook.md +0 -318
  405. package/src/agents/reviewer/ai-reviewer/critical-reminders.md +0 -40
  406. package/src/agents/reviewer/ai-reviewer/critical-requirements.md +0 -37
  407. package/src/agents/reviewer/ai-reviewer/identity.md +0 -51
  408. package/src/agents/reviewer/ai-reviewer/metadata.yaml +0 -10
  409. package/src/agents/reviewer/ai-reviewer/output.md +0 -395
  410. package/src/agents/reviewer/ai-reviewer/playbook.md +0 -90
  411. package/src/agents/reviewer/api-reviewer/critical-reminders.md +0 -31
  412. package/src/agents/reviewer/api-reviewer/critical-requirements.md +0 -27
  413. package/src/agents/reviewer/api-reviewer/identity.md +0 -51
  414. package/src/agents/reviewer/api-reviewer/metadata.yaml +0 -12
  415. package/src/agents/reviewer/api-reviewer/output.md +0 -343
  416. package/src/agents/reviewer/api-reviewer/playbook.md +0 -288
  417. package/src/agents/reviewer/cli-reviewer/critical-reminders.md +0 -33
  418. package/src/agents/reviewer/cli-reviewer/critical-requirements.md +0 -30
  419. package/src/agents/reviewer/cli-reviewer/identity.md +0 -44
  420. package/src/agents/reviewer/cli-reviewer/metadata.yaml +0 -12
  421. package/src/agents/reviewer/cli-reviewer/output.md +0 -414
  422. package/src/agents/reviewer/cli-reviewer/playbook.md +0 -218
  423. package/src/agents/reviewer/infra-reviewer/critical-reminders.md +0 -38
  424. package/src/agents/reviewer/infra-reviewer/critical-requirements.md +0 -38
  425. package/src/agents/reviewer/infra-reviewer/identity.md +0 -53
  426. package/src/agents/reviewer/infra-reviewer/metadata.yaml +0 -10
  427. package/src/agents/reviewer/infra-reviewer/output.md +0 -364
  428. package/src/agents/reviewer/infra-reviewer/playbook.md +0 -161
  429. package/src/agents/reviewer/web-reviewer/critical-reminders.md +0 -31
  430. package/src/agents/reviewer/web-reviewer/critical-requirements.md +0 -26
  431. package/src/agents/reviewer/web-reviewer/identity.md +0 -40
  432. package/src/agents/reviewer/web-reviewer/metadata.yaml +0 -12
  433. package/src/agents/reviewer/web-reviewer/output.md +0 -333
  434. package/src/agents/reviewer/web-reviewer/playbook.md +0 -156
  435. /package/dist/{chunk-ZL7PFNHN.js.map → chunk-K3O3YQYG.js.map} +0 -0
  436. /package/dist/{chunk-IHUY4M22.js.map → chunk-UW44KSYL.js.map} +0 -0
  437. /package/dist/{chunk-DTSG5XZB.js.map → chunk-V3ENMW7G.js.map} +0 -0
  438. /package/dist/{commands/new/skill.js.map → copy-local-skills-WVHJFRPK.js.map} +0 -0
  439. /package/dist/{components/wizard/search-modal.js.map → load-agent-defs-5OT54J5M.js.map} +0 -0
  440. /package/dist/{components/wizard/selection-card.js.map → loader-JIZDTR4G.js.map} +0 -0
  441. /package/dist/{components/wizard/step-settings.js.map → recompile-project-agents-VREEPBDV.js.map} +0 -0
  442. /package/dist/{copy-local-skills-6EMVN7RB.js.map → source-loader-OE6EJFPU.js.map} +0 -0
@@ -1,76 +1,70 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ Spinner
4
+ } from "../chunk-ZBPEFQ4G.js";
2
5
  import {
3
6
  runWizardSession
4
- } from "../chunk-MVR3SYMN.js";
5
- import "../chunk-XHUODHZ4.js";
6
- import "../chunk-MWG4VU64.js";
7
- import "../chunk-TJJPWUMA.js";
8
- import "../chunk-TUPYW2IQ.js";
9
- import "../chunk-SKQWRUPX.js";
10
- import "../chunk-LASI35KT.js";
11
- import "../chunk-GRVKW3CC.js";
12
- import "../chunk-L7SZXUBJ.js";
13
- import "../chunk-ZPPHXXAP.js";
14
- import "../chunk-R5NOI2LP.js";
15
- import "../chunk-BNSRA6HL.js";
16
- import "../chunk-F7T5AFFN.js";
17
- import "../chunk-MQ7FLIYS.js";
18
- import "../chunk-FVDKAVOL.js";
7
+ } from "../chunk-QUDQTO3O.js";
8
+ import "../chunk-R7JV22QK.js";
9
+ import "../chunk-MJFIO5SX.js";
10
+ import "../chunk-NSJ2S7R5.js";
11
+ import "../chunk-JC7DBPRD.js";
12
+ import "../chunk-GUDGCFSF.js";
13
+ import "../chunk-BZ4CZBOM.js";
14
+ import "../chunk-NKCY2ULI.js";
15
+ import "../chunk-NFH6SA62.js";
16
+ import "../chunk-IXEDSKMH.js";
17
+ import "../chunk-AURY6RT6.js";
18
+ import "../chunk-WRRP47PY.js";
19
+ import "../chunk-2IMYK4WN.js";
19
20
  import "../chunk-TSIU7DME.js";
20
- import "../chunk-QRDTLVXG.js";
21
- import "../chunk-J27W6TXS.js";
22
- import "../chunk-SX5H6TSC.js";
23
- import "../chunk-5GUOIJSG.js";
24
- import "../chunk-MJ2KHG24.js";
25
- import "../chunk-DTSG5XZB.js";
26
- import "../chunk-MM7CTTAV.js";
27
- import "../chunk-KXYVJGJP.js";
28
- import "../chunk-P44SXVH3.js";
29
- import "../chunk-LDP5ASDM.js";
30
- import "../chunk-Q45ZU6HD.js";
31
- import "../chunk-WBCPLH66.js";
32
- import "../chunk-RNJWAKMO.js";
33
21
  import "../chunk-XVAQG2CV.js";
34
- import {
35
- Spinner
36
- } from "../chunk-IUQBOCSU.js";
37
- import {
38
- ERROR_MESSAGES,
39
- STATUS_MESSAGES
40
- } from "../chunk-ODNDXQH2.js";
22
+ import "../chunk-LA3JPESW.js";
23
+ import "../chunk-J27W6TXS.js";
24
+ import "../chunk-AKQ5QISO.js";
25
+ import "../chunk-CHNA5RVS.js";
26
+ import "../chunk-ONWEOS77.js";
27
+ import "../chunk-V3ENMW7G.js";
28
+ import "../chunk-DRKSYJZ2.js";
29
+ import "../chunk-Q5FLW4JG.js";
30
+ import "../chunk-6CNRMCFM.js";
41
31
  import {
42
32
  compileAgentsAllScopes,
43
33
  detectProject,
44
34
  loadSource,
45
35
  writeProjectConfig
46
- } from "../chunk-STMHDOZD.js";
36
+ } from "../chunk-XMEIVWAS.js";
47
37
  import {
48
38
  discoverInstalledSkills,
49
- installPluginSkills,
50
- pluginInstallFailureError,
39
+ removeCompiledAgents,
51
40
  uninstallPluginSkills
52
- } from "../chunk-SBHBBZKF.js";
41
+ } from "../chunk-ZU6DAR4S.js";
53
42
  import {
54
43
  copyLocalSkills
55
- } from "../chunk-IHUY4M22.js";
44
+ } from "../chunk-UW44KSYL.js";
56
45
  import {
57
46
  loadAgentDefs
58
- } from "../chunk-QZZJFYUQ.js";
59
- import "../chunk-E5X6RJ4E.js";
60
- import "../chunk-LZ52XEPR.js";
47
+ } from "../chunk-PRJD5MMQ.js";
48
+ import "../chunk-TUQF577Z.js";
49
+ import "../chunk-B66SC72V.js";
61
50
  import {
62
51
  render
63
52
  } from "../chunk-JFLVEFFP.js";
64
53
  import {
65
54
  formatScopeTag
66
- } from "../chunk-5UWKOOIS.js";
55
+ } from "../chunk-QQTYMW7N.js";
67
56
  import {
68
57
  BaseCommand,
69
- EXIT_CODES,
70
- source_default
71
- } from "../chunk-KR65TPKC.js";
72
- import "../chunk-ZL7PFNHN.js";
58
+ EXIT_CODES
59
+ } from "../chunk-FMYHWKGG.js";
60
+ import "../chunk-7VZV4O6B.js";
61
+ import "../chunk-K3O3YQYG.js";
73
62
  import {
63
+ ERROR_MESSAGES,
64
+ INFO_MESSAGES,
65
+ INSTALL_MODE_DESCRIPTIONS,
66
+ STATUS_MESSAGES,
67
+ activeAgentNames,
74
68
  activeAgentScopeMap,
75
69
  applyMigratedGlobalSources,
76
70
  buildMarketplacePluginRef,
@@ -83,20 +77,22 @@ import {
83
77
  installBaseDir,
84
78
  isActiveAt,
85
79
  isHomeDirectory,
80
+ localSkillsCopied,
86
81
  migrateLocalSkillScope,
87
82
  mutateGlobal,
83
+ recompileSummary,
88
84
  resolveInstallPaths,
89
- toClaudePluginScope
90
- } from "../chunk-EEPELKOM.js";
85
+ toClaudePluginScope,
86
+ unresolvedSkillRemovalReasons
87
+ } from "../chunk-CBF4ZYV3.js";
91
88
  import {
92
- getErrorMessage,
93
- remove
94
- } from "../chunk-PMM2MYMA.js";
89
+ getErrorMessage
90
+ } from "../chunk-4VCWL2IG.js";
95
91
  import {
96
92
  getSkillById,
97
93
  getSkillDisplayName,
98
94
  matrix
99
- } from "../chunk-WKTHWQKM.js";
95
+ } from "../chunk-IPJOMAWC.js";
100
96
  import {
101
97
  typedKeys
102
98
  } from "../chunk-VASLW636.js";
@@ -106,19 +102,44 @@ import {
106
102
  EDIT_PROJECT_SETUP_FLAG,
107
103
  EJECT_SOURCE,
108
104
  formatSourceDisplayName
109
- } from "../chunk-76ADG7LQ.js";
110
- import "../chunk-UBEDZ4FD.js";
105
+ } from "../chunk-R54KIGN2.js";
106
+ import "../chunk-VZRO7RYT.js";
111
107
 
112
108
  // src/cli/commands/edit.tsx
113
109
  import path from "path";
110
+ import chalk from "chalk";
114
111
  import { Flags } from "@oclif/core";
115
112
  import { difference, indexBy } from "remeda";
116
113
  import { jsx } from "react/jsx-runtime";
114
+ var RECOMPILE_SUBJECT = "agents";
117
115
  function formatDualScopeTransition(displayName, to) {
118
116
  const isAdd = to === "project";
119
117
  const prefix = isAdd ? "+" : "-";
120
118
  const color = isAdd ? CLI_COLORS.SUCCESS : CLI_COLORS.ERROR;
121
- return source_default.hex(color)(` ${prefix} ${displayName} [P]`);
119
+ return chalk.hex(color)(` ${prefix} ${displayName} [P]`);
120
+ }
121
+ function formatSkillScopeChangeLine(skillId, change, dualScopeSkillTransitions) {
122
+ const displayName = getSkillDisplayName(skillId);
123
+ if (dualScopeSkillTransitions.has(skillId)) {
124
+ return formatDualScopeTransition(displayName, change.to);
125
+ }
126
+ const isGlobalToProject = change.from === "global" && change.to === "project";
127
+ const prefix = isGlobalToProject ? "+" : "~";
128
+ const color = isGlobalToProject ? CLI_COLORS.SUCCESS : CLI_COLORS.WARNING;
129
+ return chalk.hex(color)(` ${prefix} ${displayName}`) + chalk.hex(CLI_COLORS.NEUTRAL)(scopeArrow(change));
130
+ }
131
+ function formatAgentScopeChangeLine(agentName, change, dualScopeAgentTransitions) {
132
+ const agentSuffix = chalk.hex(CLI_COLORS.NEUTRAL)(" (agent)");
133
+ if (dualScopeAgentTransitions.has(agentName)) {
134
+ return formatDualScopeTransition(agentName, change.to) + agentSuffix;
135
+ }
136
+ return chalk.hex(CLI_COLORS.WARNING)(` ~ ${agentName}`) + chalk.hex(CLI_COLORS.NEUTRAL)(scopeArrow(change));
137
+ }
138
+ function scopeArrow(change) {
139
+ return ` (${formatScopeTag(change.from)} \u2192 ${formatScopeTag(change.to)})`;
140
+ }
141
+ function loadedSourceLabel(sourceResult) {
142
+ return sourceResult.marketplace ?? sourceResult.sourceConfig.source;
122
143
  }
123
144
  var Edit = class _Edit extends BaseCommand {
124
145
  static summary = "Edit skills in the plugin";
@@ -127,22 +148,9 @@ var Edit = class _Edit extends BaseCommand {
127
148
  {
128
149
  description: "Open the edit wizard",
129
150
  command: "<%= config.bin %> <%= command.id %>"
130
- },
131
- {
132
- description: "Edit with a custom source",
133
- command: "<%= config.bin %> <%= command.id %> --source github:org/marketplace"
134
- },
135
- {
136
- description: "Force refresh skills from remote",
137
- command: "<%= config.bin %> <%= command.id %> --refresh"
138
151
  }
139
152
  ];
140
153
  static flags = {
141
- ...BaseCommand.baseFlags,
142
- refresh: Flags.boolean({
143
- description: "Force refresh from remote sources",
144
- default: false
145
- }),
146
154
  [EDIT_PROJECT_SETUP_FLAG]: Flags.boolean({
147
155
  description: "Internal: this run continues an `init` project setup",
148
156
  default: false,
@@ -152,15 +160,16 @@ var Edit = class _Edit extends BaseCommand {
152
160
  async run() {
153
161
  const { flags } = await this.parse(_Edit);
154
162
  const cwd = process.cwd();
155
- const { unmount, clear: clearSpinner } = render(
156
- /* @__PURE__ */ jsx(Spinner, { label: STATUS_MESSAGES.LOADING_SKILLS })
163
+ await this.ensureConfigReadable(cwd);
164
+ const context = await this.loadContextUnderSpinner();
165
+ await this.ensureSavedSkillsReadable(
166
+ context.projectConfig?.skills ?? [],
167
+ context.sourceResult.matrix,
168
+ context.projectDir
157
169
  );
158
- const context = await this.loadContext(flags);
159
- clearSpinner();
160
- unmount();
161
170
  const result = await this.runEditWizard(context, cwd);
162
171
  if (!result) this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
163
- this.reportValidationErrors(result);
172
+ this.reportValidationErrors(result.validation);
164
173
  const activeNewSkills = result.skills.filter((s) => !s.excluded);
165
174
  const activeNewAgents = result.agentConfigs.filter((a) => !a.excluded);
166
175
  const activeOldSkills = (context.projectConfig?.skills ?? []).filter((s) => !s.excluded);
@@ -179,13 +188,24 @@ var Edit = class _Edit extends BaseCommand {
179
188
  });
180
189
  const isProjectSetup = flags[EDIT_PROJECT_SETUP_FLAG] && !isHomeDirectory(cwd);
181
190
  if (!hasAnyChanges(changes)) {
182
- this.log(source_default.hex(CLI_COLORS.NEUTRAL)("No changes made."));
191
+ this.log(chalk.hex(CLI_COLORS.NEUTRAL)("No changes made."));
183
192
  if (!isProjectSetup) return;
184
- await this.writeConfigAndCompile(result, context, flags, cwd);
193
+ await this.writeConfigAndCompile(result, context, cwd);
185
194
  this.logCompletionSummary(changes);
186
195
  return;
187
196
  }
188
- this.logChangeSummary(changes, filteredResult.skills, filteredOldConfig?.skills ?? []);
197
+ const removalReasons = await unresolvedSkillRemovalReasons(
198
+ result.unresolvableSkillIds,
199
+ activeOldSkills,
200
+ context.projectDir,
201
+ loadedSourceLabel(context.sourceResult)
202
+ );
203
+ this.logChangeSummary(
204
+ changes,
205
+ filteredResult.skills,
206
+ filteredOldConfig?.skills ?? [],
207
+ removalReasons
208
+ );
189
209
  const migratedSkillIds = await this.applyMigrations(
190
210
  changes,
191
211
  filteredResult,
@@ -199,11 +219,30 @@ var Edit = class _Edit extends BaseCommand {
199
219
  await this.applyPluginChanges(changes, filteredResult, activeOldSkills, context, cwd);
200
220
  await this.copyNewLocalSkills(changes, filteredResult, context, cwd);
201
221
  await this.removeDeletedLocalSkills(changes, activeOldSkills, cwd);
202
- await this.writeConfigAndCompile(result, context, flags, cwd);
222
+ await this.writeConfigAndCompile(result, context, cwd);
203
223
  await this.cleanupStaleAgentFiles(changes, activeOldAgents, cwd);
204
224
  this.logCompletionSummary(changes);
205
225
  }
206
- async loadContext(flags) {
226
+ /**
227
+ * The load below, behind a spinner that comes down whichever way the await ends.
228
+ *
229
+ * The cleanup is a `finally` because all three of `loadContext`'s refusals are raised
230
+ * while this spinner is mounted, and oclif would otherwise paint its error under an Ink
231
+ * tree still repainting over it. Never a `catch`: the throw reaches oclif untouched, or
232
+ * both the error rendering and the pinned exit codes change with it.
233
+ */
234
+ async loadContextUnderSpinner() {
235
+ const { unmount, clear: clearSpinner } = render(
236
+ /* @__PURE__ */ jsx(Spinner, { label: STATUS_MESSAGES.LOADING_SKILLS })
237
+ );
238
+ try {
239
+ return await this.loadContext();
240
+ } finally {
241
+ clearSpinner();
242
+ unmount();
243
+ }
244
+ }
245
+ async loadContext() {
207
246
  const detected = await detectProject();
208
247
  if (!detected) {
209
248
  this.error(ERROR_MESSAGES.NO_INSTALLATION, {
@@ -215,12 +254,7 @@ var Edit = class _Edit extends BaseCommand {
215
254
  let sourceResult;
216
255
  let startupMessages = [];
217
256
  try {
218
- const loaded = await loadSource({
219
- sourceFlag: flags.source,
220
- projectDir,
221
- forceRefresh: flags.refresh,
222
- captureStartupMessages: true
223
- });
257
+ const loaded = await loadSource({ projectDir, captureStartupMessages: true });
224
258
  sourceResult = loaded.sourceResult;
225
259
  startupMessages = loaded.startupMessages;
226
260
  const sourceInfo = sourceResult.isLocal ? "local" : sourceResult.sourceConfig.sourceOrigin;
@@ -236,9 +270,9 @@ var Edit = class _Edit extends BaseCommand {
236
270
  const discoveredSkills = await discoverAllPluginSkills(projectDir);
237
271
  const pluginSkillIds = typedKeys(discoveredSkills);
238
272
  const excludedConfigIds = new Set(
239
- projectConfig?.skills?.filter((s) => s.excluded).map((s) => s.id) ?? []
273
+ projectConfig?.skills.filter((s) => s.excluded).map((s) => s.id) ?? []
240
274
  );
241
- const configSkillIds = projectConfig?.skills?.filter((s) => !s.excluded).map((s) => s.id) ?? [];
275
+ const configSkillIds = projectConfig?.skills.filter((s) => !s.excluded).map((s) => s.id) ?? [];
242
276
  const filteredPluginSkillIds = pluginSkillIds.filter((id) => !excludedConfigIds.has(id));
243
277
  const mergedIds = /* @__PURE__ */ new Set([...filteredPluginSkillIds, ...configSkillIds]);
244
278
  currentSkillIds = [...mergedIds];
@@ -259,22 +293,24 @@ var Edit = class _Edit extends BaseCommand {
259
293
  };
260
294
  }
261
295
  async runEditWizard(context, cwd) {
262
- const { projectConfig, projectDir, currentSkillIds } = context;
296
+ const { projectConfig, currentSkillIds } = context;
297
+ const selectedAgents = projectConfig?.agents && activeAgentNames(projectConfig.agents);
263
298
  return runWizardSession({
264
299
  hydrate: {
265
300
  initialStep: "build",
266
- initialDomains: projectConfig?.domains,
267
- initialAgents: projectConfig?.selectedAgents,
301
+ ...projectConfig?.selectedDomains !== void 0 && {
302
+ initialDomains: projectConfig.selectedDomains
303
+ },
304
+ ...selectedAgents !== void 0 && { initialAgents: selectedAgents },
268
305
  installedSkillIds: currentSkillIds,
269
- installedSkillConfigs: projectConfig?.skills,
270
- installedAgentConfigs: projectConfig?.agents,
306
+ ...projectConfig?.skills !== void 0 && { installedSkillConfigs: projectConfig.skills },
307
+ ...projectConfig?.agents !== void 0 && { installedAgentConfigs: projectConfig.agents },
271
308
  isEditingFromGlobalScope: isHomeDirectory(cwd)
272
309
  },
273
310
  props: {
274
311
  version: this.config.version,
275
- initialAgents: projectConfig?.selectedAgents,
312
+ initialAgents: selectedAgents,
276
313
  installedSkillIds: currentSkillIds,
277
- projectDir,
278
314
  startupMessages: context.startupMessages
279
315
  },
280
316
  onCancel: () => this.log("\nEdit cancelled"),
@@ -299,8 +335,16 @@ var Edit = class _Edit extends BaseCommand {
299
335
  * `executeMigration` acted on this run are rewritten, and only their `source` field. Global
300
336
  * entries this session merely displayed, re-scoped or deselected are untouched, as are
301
337
  * `marketplace`, `stack`, `agents` and every other registered project's view of them.
302
- * Refusing the switch instead is not an option — driving a global-scope migration from a
303
- * project directory is a supported flow (`scope-aware-local-copy` lifecycle tests).
338
+ *
339
+ * Driving a global-scope migration from a project directory is NOT a supported flow, and this
340
+ * method is no longer the thing that permits it. The wizard now refuses it at source: the two
341
+ * bulk install-mode keys are withdrawn, and `setInstallMode` ignores a project-context call
342
+ * against a global slot the hydration snapshot owns — the same authority the Sources grid
343
+ * already enforced by rendering that row inert. What still reaches here is the residue that
344
+ * authority leaves legitimate: a mode change committed on the project half of a `[P][G]` pair
345
+ * and then carried to global scope by a P->G collapse (`s`) in the same session. The entry is
346
+ * the project's own to configure at the moment it is configured, and global at the moment it
347
+ * is written — so the migration is real, and the global config must record it.
304
348
  *
305
349
  * Runs BEFORE `writeConfigAndCompile`, so the global config written here is the one
306
350
  * the wizard write reloads, keeps (existing wins in `mergeGlobalConfigs`) and inlines
@@ -322,6 +366,10 @@ var Edit = class _Edit extends BaseCommand {
322
366
  const report = await mutateGlobal(
323
367
  { kind: "migrate-skill-sources", sources: migratedSources },
324
368
  {
369
+ // The deps contract in config-gate/deps.ts declares
370
+ // `() => Promise<MergedSkillsMatrix>`; this caller happens to have its
371
+ // matrix in hand already.
372
+ // eslint-disable-next-line @typescript-eslint/require-await -- deps contract
325
373
  loadMatrix: async () => context.sourceResult.matrix,
326
374
  loadAgents: async () => (await loadAgentDefs({ projectDir: cwd })).agents
327
375
  }
@@ -331,14 +379,7 @@ var Edit = class _Edit extends BaseCommand {
331
379
  this.warn(`Could not record global source change: ${getErrorMessage(error)}`);
332
380
  }
333
381
  }
334
- reportValidationErrors(result) {
335
- if (result.validation.errors.length > 0) {
336
- for (const err of result.validation.errors) {
337
- this.warn(err.message);
338
- }
339
- }
340
- }
341
- logChangeSummary(changes, newSkills, oldSkills) {
382
+ logChangeSummary(changes, newSkills, oldSkills, removalReasons) {
342
383
  const {
343
384
  addedSkills,
344
385
  removedSkills,
@@ -351,27 +392,30 @@ var Edit = class _Edit extends BaseCommand {
351
392
  dualScopeAgentTransitions
352
393
  } = changes;
353
394
  this.log(`
354
- ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
395
+ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
355
396
  for (const skillId of addedSkills) {
356
397
  const scope = newSkills.find((s) => s.id === skillId)?.scope;
357
398
  const scopeLabel = scope ? ` ${formatScopeTag(scope)}` : "";
358
399
  this.log(
359
- source_default.hex(CLI_COLORS.SUCCESS)(` + ${getSkillById(skillId).displayName}${scopeLabel}`)
400
+ chalk.hex(CLI_COLORS.SUCCESS)(` + ${getSkillById(skillId).displayName}${scopeLabel}`)
360
401
  );
361
402
  }
362
403
  for (const skillId of removedSkills) {
363
404
  const scope = oldSkills.find((s) => s.id === skillId)?.scope;
364
405
  const scopeLabel = scope ? ` ${formatScopeTag(scope)}` : "";
365
- this.log(source_default.hex(CLI_COLORS.ERROR)(` - ${getSkillDisplayName(skillId)}${scopeLabel}`));
406
+ const reason = removalReasons.get(skillId);
407
+ this.log(
408
+ chalk.hex(CLI_COLORS.ERROR)(` - ${getSkillDisplayName(skillId)}${scopeLabel}`) + (reason ? chalk.hex(CLI_COLORS.NEUTRAL)(` (${reason})`) : "")
409
+ );
366
410
  }
367
411
  for (const agentName of addedAgents) {
368
412
  this.log(
369
- source_default.hex(CLI_COLORS.SUCCESS)(` + ${agentName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(" (agent)")
413
+ chalk.hex(CLI_COLORS.SUCCESS)(` + ${agentName}`) + chalk.hex(CLI_COLORS.NEUTRAL)(" (agent)")
370
414
  );
371
415
  }
372
416
  for (const agentName of removedAgents) {
373
417
  this.log(
374
- source_default.hex(CLI_COLORS.ERROR)(` - ${agentName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(" (agent)")
418
+ chalk.hex(CLI_COLORS.ERROR)(` - ${agentName}`) + chalk.hex(CLI_COLORS.NEUTRAL)(" (agent)")
375
419
  );
376
420
  }
377
421
  for (const [skillId, change] of sourceChanges) {
@@ -379,75 +423,49 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
379
423
  const fromLabel = formatSourceDisplayName(change.from);
380
424
  const toLabel = formatSourceDisplayName(change.to);
381
425
  this.log(
382
- source_default.hex(CLI_COLORS.WARNING)(` ~ ${displayName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(` (${fromLabel} \u2192 ${toLabel})`)
426
+ chalk.hex(CLI_COLORS.WARNING)(` ~ ${displayName}`) + chalk.hex(CLI_COLORS.NEUTRAL)(` (${fromLabel} \u2192 ${toLabel})`)
383
427
  );
384
428
  }
385
429
  for (const [skillId, change] of scopeChanges) {
386
- const displayName = getSkillDisplayName(skillId);
387
- if (dualScopeSkillTransitions.has(skillId)) {
388
- this.log(formatDualScopeTransition(displayName, change.to));
389
- continue;
390
- }
391
- const fromLabel = formatScopeTag(change.from);
392
- const toLabel = formatScopeTag(change.to);
393
- const isGlobalToProject = change.from === "global" && change.to === "project";
394
- const prefix = isGlobalToProject ? "+" : "~";
395
- const color = isGlobalToProject ? CLI_COLORS.SUCCESS : CLI_COLORS.WARNING;
396
- this.log(
397
- source_default.hex(color)(` ${prefix} ${displayName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(` (${fromLabel} \u2192 ${toLabel})`)
398
- );
430
+ this.log(formatSkillScopeChangeLine(skillId, change, dualScopeSkillTransitions));
399
431
  }
400
432
  for (const [agentName, change] of agentScopeChanges) {
401
- if (dualScopeAgentTransitions.has(agentName)) {
402
- this.log(
403
- formatDualScopeTransition(agentName, change.to) + source_default.hex(CLI_COLORS.NEUTRAL)(" (agent)")
404
- );
405
- continue;
406
- }
407
- const fromLabel = formatScopeTag(change.from);
408
- const toLabel = formatScopeTag(change.to);
409
- this.log(
410
- source_default.hex(CLI_COLORS.WARNING)(` ~ ${agentName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(` (${fromLabel} \u2192 ${toLabel})`)
411
- );
433
+ this.log(formatAgentScopeChangeLine(agentName, change, dualScopeAgentTransitions));
412
434
  }
413
435
  this.log("");
414
436
  }
415
437
  async applyMigrations(_changes, filteredResult, activeOldSkills, context, cwd) {
416
438
  const migrationPlan = detectMigrations(activeOldSkills, filteredResult.skills);
417
- const hasMigrations = migrationPlan.toEject.length > 0 || migrationPlan.toPlugin.length > 0;
418
- if (hasMigrations) {
419
- if (migrationPlan.toEject.length > 0) {
420
- this.log(
421
- source_default.hex(CLI_COLORS.NEUTRAL)(
422
- `Switching ${migrationPlan.toEject.length} skill(s) to eject`
423
- )
424
- );
425
- }
426
- if (migrationPlan.toPlugin.length > 0) {
427
- this.log(
428
- source_default.hex(CLI_COLORS.NEUTRAL)(
429
- `Switching ${migrationPlan.toPlugin.length} skill(s) to plugin`
430
- )
431
- );
432
- await this.requireMarketplaceOrExit(context.sourceResult, "migrate skills to plugin mode");
433
- }
434
- const migrationResult = await executeMigration(migrationPlan, cwd, context.sourceResult);
435
- for (const warning of migrationResult.warnings) {
436
- this.warn(warning);
437
- }
438
- for (const item of migrationResult.failedPluginInstalls) {
439
- this.warn(`Failed to install plugin ${item.id}: ${item.error}`);
440
- }
441
- if (migrationResult.failedPluginInstalls.length > 0) {
442
- this.error(pluginInstallFailureError(migrationResult.failedPluginInstalls.length), {
443
- exit: EXIT_CODES.ERROR
444
- });
445
- }
446
- }
447
- return /* @__PURE__ */ new Set([
439
+ const migratedSkillIds = /* @__PURE__ */ new Set([
448
440
  ...migrationPlan.toEject.map((m) => m.id),
449
441
  ...migrationPlan.toPlugin.map((m) => m.id)
450
442
  ]);
443
+ if (migratedSkillIds.size === 0) return migratedSkillIds;
444
+ if (migrationPlan.toEject.length > 0) {
445
+ this.logModeSwitch(migrationPlan.toEject.length, INSTALL_MODE_DESCRIPTIONS.eject);
446
+ }
447
+ if (migrationPlan.toPlugin.length > 0) {
448
+ this.logModeSwitch(migrationPlan.toPlugin.length, INSTALL_MODE_DESCRIPTIONS.plugin);
449
+ await this.requireMarketplaceOrExit(context.sourceResult, "migrate skills to plugin mode");
450
+ this.announcePluginInstall();
451
+ }
452
+ const migrationResult = await executeMigration(migrationPlan, cwd, context.sourceResult);
453
+ for (const warning of migrationResult.warnings) {
454
+ this.warn(warning);
455
+ }
456
+ if (migrationPlan.toEject.length > 0) {
457
+ this.log(
458
+ chalk.hex(CLI_COLORS.NEUTRAL)(localSkillsCopied(migrationResult.ejectedSkills.length))
459
+ );
460
+ }
461
+ if (migrationPlan.toPlugin.length > 0) {
462
+ this.reportPluginInstalls(migrationResult.pluginInstalls);
463
+ }
464
+ return migratedSkillIds;
465
+ }
466
+ /** Names what this run is switching, in the words `init` describes an install mode with. */
467
+ logModeSwitch(count, modeDescription) {
468
+ this.log(chalk.hex(CLI_COLORS.NEUTRAL)(`Switching ${count} skill(s) to ${modeDescription}`));
451
469
  }
452
470
  async applyScopeChanges(changes, filteredResult, context, cwd) {
453
471
  const { scopeChanges } = changes;
@@ -503,20 +521,7 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
503
521
  "install or uninstall plugin skills"
504
522
  );
505
523
  if (addedPluginSkills.length > 0) {
506
- const pluginResult = await installPluginSkills(addedPluginSkills, marketplace, cwd);
507
- if (pluginResult.installed.length > 0) {
508
- this.log(
509
- source_default.hex(CLI_COLORS.NEUTRAL)(`Installed ${pluginResult.installed.length} plugin(s)`)
510
- );
511
- }
512
- for (const item of pluginResult.failed) {
513
- this.warn(`Failed to install plugin ${item.id}: ${item.error}`);
514
- }
515
- if (pluginResult.failed.length > 0) {
516
- this.error(pluginInstallFailureError(pluginResult.failed.length), {
517
- exit: EXIT_CODES.ERROR
518
- });
519
- }
524
+ await this.installPluginSkillsReported(addedPluginSkills, marketplace, cwd);
520
525
  }
521
526
  if (removedPluginSkills.length > 0) {
522
527
  const uninstallResult = await uninstallPluginSkills(
@@ -527,7 +532,7 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
527
532
  );
528
533
  if (uninstallResult.uninstalled.length > 0) {
529
534
  this.log(
530
- source_default.hex(CLI_COLORS.NEUTRAL)(`Removed ${uninstallResult.uninstalled.length} plugin(s)`)
535
+ chalk.hex(CLI_COLORS.NEUTRAL)(`Removed ${uninstallResult.uninstalled.length} plugin(s)`)
531
536
  );
532
537
  }
533
538
  for (const item of uninstallResult.failed) {
@@ -542,7 +547,7 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
542
547
  );
543
548
  if (addedLocalSkills.length > 0) {
544
549
  const copyResult = await copyLocalSkills(addedLocalSkills, cwd, context.sourceResult);
545
- this.log(source_default.hex(CLI_COLORS.NEUTRAL)(`Copied ${copyResult.totalCopied} local skill(s)`));
550
+ this.log(chalk.hex(CLI_COLORS.NEUTRAL)(localSkillsCopied(copyResult.totalCopied)));
546
551
  }
547
552
  }
548
553
  async removeDeletedLocalSkills(changes, activeOldSkills, cwd) {
@@ -554,12 +559,10 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
554
559
  await deleteLocalSkill(deleteDir, skillId);
555
560
  }
556
561
  }
557
- async writeConfigAndCompile(result, context, flags, cwd) {
562
+ async writeConfigAndCompile(result, context, cwd) {
558
563
  let agentDefsResult;
559
564
  try {
560
- agentDefsResult = await loadAgentDefs({
561
- forceRefresh: flags.refresh
562
- });
565
+ agentDefsResult = await loadAgentDefs({});
563
566
  } catch (error) {
564
567
  this.handleError(error);
565
568
  }
@@ -569,7 +572,6 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
569
572
  wizardResult: result,
570
573
  sourceResult: context.sourceResult,
571
574
  projectDir: cwd,
572
- sourceFlag: flags.source,
573
575
  agents: agentDefsResult.agents,
574
576
  // A full `cc edit` pass is authoritative over the roster it owns, so deselected entries
575
577
  // are removed rather than union-preserved (D-233 Scenario C). Global-context edit owns
@@ -580,6 +582,9 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
580
582
  } catch (error) {
581
583
  this.warn(`Could not update config: ${getErrorMessage(error)}`);
582
584
  }
585
+ if (configResult) {
586
+ this.reportUnassignedSkills(configResult.config);
587
+ }
583
588
  try {
584
589
  const agentScopeMap = activeAgentScopeMap(result.agentConfigs);
585
590
  const { allSkills } = await discoverInstalledSkills(cwd);
@@ -589,19 +594,23 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
589
594
  skills: allSkills,
590
595
  agentScopeMap
591
596
  });
592
- if (compilationResult.failed.length > 0) {
597
+ const { compiled, rewritten, failed, warnings } = compilationResult;
598
+ const summary = recompileSummary(
599
+ rewritten.length,
600
+ compiled.length - rewritten.length,
601
+ RECOMPILE_SUBJECT
602
+ );
603
+ if (failed.length > 0) {
593
604
  this.log(
594
- source_default.hex(CLI_COLORS.NEUTRAL)(`Recompiled ${compilationResult.compiled.length} agents`) + source_default.hex(CLI_COLORS.WARNING)(` (${compilationResult.failed.length} failed)`)
605
+ chalk.hex(CLI_COLORS.NEUTRAL)(summary) + chalk.hex(CLI_COLORS.WARNING)(` (${failed.length} failed)`)
595
606
  );
596
- for (const warning of compilationResult.warnings) {
607
+ for (const warning of warnings) {
597
608
  this.warn(warning);
598
609
  }
599
- } else if (compilationResult.compiled.length > 0) {
600
- this.log(
601
- source_default.hex(CLI_COLORS.NEUTRAL)(`Recompiled ${compilationResult.compiled.length} agents`)
602
- );
610
+ } else if (compiled.length > 0) {
611
+ this.log(chalk.hex(CLI_COLORS.NEUTRAL)(summary));
603
612
  } else {
604
- this.log(source_default.hex(CLI_COLORS.NEUTRAL)("No agents to recompile"));
613
+ this.log(chalk.hex(CLI_COLORS.NEUTRAL)(INFO_MESSAGES.NO_AGENTS_TO_RECOMPILE));
605
614
  }
606
615
  } catch (error) {
607
616
  this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);
@@ -611,57 +620,25 @@ ${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
611
620
  this.reportPropagatedRecompile(configResult.propagation);
612
621
  }
613
622
  }
614
- /**
615
- * Renders the recompile the gated write already performed on every OTHER
616
- * registered project this run's global change was propagated into.
617
- */
618
- reportPropagatedRecompile(propagation) {
619
- if (propagation.propagated.updated.length === 0) return;
620
- const { recompiledCount, failedCount, warnings } = propagation.recompile;
621
- for (const warning of warnings) {
622
- this.warn(warning);
623
- }
624
- const summary = source_default.hex(CLI_COLORS.NEUTRAL)(
625
- `Recompiled agents in ${recompiledCount} registered project(s)`
626
- );
627
- this.log(
628
- failedCount > 0 ? summary + source_default.hex(CLI_COLORS.WARNING)(` (${failedCount} failed)`) : summary
629
- );
630
- }
631
623
  async cleanupStaleAgentFiles(changes, oldAgents, cwd) {
632
- const { agentScopeChanges, removedAgents } = changes;
633
- for (const [agentName, change] of agentScopeChanges) {
634
- if (change.from === "global") continue;
635
- const oldAgentPath = path.join(
636
- resolveInstallPaths(cwd, "project").agentsDir,
637
- `${agentName}.md`
638
- );
639
- try {
640
- await remove(oldAgentPath);
641
- } catch (error) {
642
- this.warn(`Could not remove old agent file ${oldAgentPath}: ${getErrorMessage(error)}`);
643
- }
644
- }
645
- for (const agentName of removedAgents) {
646
- const oldScope = oldAgents.find((a) => a.name === agentName)?.scope ?? "project";
647
- const agentPath = path.join(resolveInstallPaths(cwd, oldScope).agentsDir, `${agentName}.md`);
648
- try {
649
- await remove(agentPath);
650
- } catch (error) {
651
- this.warn(`Could not remove agent file ${agentPath}: ${getErrorMessage(error)}`);
624
+ for (const removal of planStaleAgentRemovals(changes, oldAgents, cwd)) {
625
+ const { failed } = await removeCompiledAgents(removal);
626
+ for (const { name, error } of failed) {
627
+ const agentPath = path.join(removal.agentsDir, `${name}.md`);
628
+ this.warn(`Could not remove agent file ${agentPath}: ${error}`);
652
629
  }
653
630
  }
654
631
  }
655
632
  logCompletionSummary(_changes) {
656
633
  this.log(`
657
- ${source_default.hex(CLI_COLORS.SUCCESS)("\u2713 Done")}
634
+ ${chalk.hex(CLI_COLORS.SUCCESS)("\u2713 Done")}
658
635
  `);
659
636
  }
660
637
  };
661
638
  function detectConfigChanges(oldConfig, wizardResult, fullEntries) {
662
- const oldSkillIds = oldConfig?.skills?.map((s) => s.id) ?? [];
639
+ const oldSkillIds = oldConfig?.skills.map((s) => s.id) ?? [];
663
640
  const newSkillIds = wizardResult.skills.map((s) => s.id);
664
- const oldAgentNames = oldConfig?.agents?.map((a) => a.name) ?? [];
641
+ const oldAgentNames = oldConfig?.agents.map((a) => a.name) ?? [];
665
642
  const newAgentNames = wizardResult.agentConfigs.map((a) => a.name);
666
643
  const oldSkillsById = indexBy(oldConfig?.skills ?? [], (s) => s.id);
667
644
  const oldAgentsByName = indexBy(oldConfig?.agents ?? [], (a) => a.name);
@@ -727,6 +704,24 @@ function detectDualScopeTransitions(scopeChanges, fullNew, fullOld, getKey) {
727
704
  }
728
705
  return result;
729
706
  }
707
+ var STALE_AGENT_SCOPES = ["project", "global"];
708
+ var UNRECORDED_AGENT_SCOPE = "project";
709
+ function installedScope(name, oldAgents) {
710
+ return oldAgents.find((agent) => agent.name === name)?.scope ?? UNRECORDED_AGENT_SCOPE;
711
+ }
712
+ function planStaleAgentRemovals(changes, oldAgents, cwd) {
713
+ const supersededByGlobal = [...changes.agentScopeChanges].filter(([, change]) => change.from !== "global").map(([name]) => ({ name, scope: "project" }));
714
+ const deselected = changes.removedAgents.map((name) => ({
715
+ name,
716
+ scope: installedScope(name, oldAgents)
717
+ }));
718
+ const stale = [...supersededByGlobal, ...deselected];
719
+ const removalAtScope = (scope) => ({
720
+ agentsDir: resolveInstallPaths(cwd, scope).agentsDir,
721
+ agents: stale.filter((agent) => agent.scope === scope).map((agent) => agent.name)
722
+ });
723
+ return STALE_AGENT_SCOPES.map(removalAtScope).filter((removal) => removal.agents.length > 0);
724
+ }
730
725
  function hasAnyChanges(changes) {
731
726
  return changes.addedSkills.length > 0 || changes.removedSkills.length > 0 || changes.addedAgents.length > 0 || changes.removedAgents.length > 0 || changes.sourceChanges.size > 0 || changes.scopeChanges.size > 0 || changes.agentScopeChanges.size > 0;
732
727
  }