agents-inc 0.149.2 → 0.150.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 (572) hide show
  1. package/CHANGELOG.md +2277 -0
  2. package/LICENSE +21 -0
  3. package/README.md +136 -19
  4. package/assets/demo.gif +0 -0
  5. package/assets/demo.tape +266 -0
  6. package/assets/logo.svg +75 -0
  7. package/dist/chunk-2RSNKBXC.js +84 -0
  8. package/dist/chunk-2RSNKBXC.js.map +1 -0
  9. package/dist/chunk-3LIU2ZEF.js +1355 -0
  10. package/dist/chunk-3LIU2ZEF.js.map +1 -0
  11. package/dist/chunk-4GL2F5AB.js +222 -0
  12. package/dist/chunk-4GL2F5AB.js.map +1 -0
  13. package/dist/chunk-4LPJZNT7.js +382 -0
  14. package/dist/chunk-4LPJZNT7.js.map +1 -0
  15. package/dist/chunk-5K5RBRTD.js +62 -0
  16. package/dist/chunk-5K5RBRTD.js.map +1 -0
  17. package/dist/chunk-6I6RZHYP.js +789 -0
  18. package/dist/chunk-6I6RZHYP.js.map +1 -0
  19. package/dist/chunk-7URSGJLE.js +430 -0
  20. package/dist/chunk-7URSGJLE.js.map +1 -0
  21. package/dist/chunk-C55DN7GE.js +35 -0
  22. package/dist/chunk-C55DN7GE.js.map +1 -0
  23. package/dist/chunk-CDMHSHBN.js +68 -0
  24. package/dist/chunk-CDMHSHBN.js.map +1 -0
  25. package/dist/chunk-CFQT72MJ.js +92 -0
  26. package/dist/chunk-CFQT72MJ.js.map +1 -0
  27. package/dist/chunk-DAG2ULNF.js +125 -0
  28. package/dist/chunk-DAG2ULNF.js.map +1 -0
  29. package/dist/chunk-DDG4F3FE.js +181 -0
  30. package/dist/chunk-DDG4F3FE.js.map +1 -0
  31. package/dist/chunk-DIBCRIMR.js +36 -0
  32. package/dist/chunk-DIBCRIMR.js.map +1 -0
  33. package/dist/chunk-DJAZE4PD.js +10929 -0
  34. package/dist/chunk-DJAZE4PD.js.map +1 -0
  35. package/dist/chunk-DUVWGO6E.js +54 -0
  36. package/dist/chunk-DUVWGO6E.js.map +1 -0
  37. package/dist/chunk-E4FT2KFV.js +174 -0
  38. package/dist/chunk-E4FT2KFV.js.map +1 -0
  39. package/dist/chunk-EKWAUOQB.js +96 -0
  40. package/dist/chunk-EKWAUOQB.js.map +1 -0
  41. package/dist/chunk-EN2GCPW7.js +300 -0
  42. package/dist/chunk-EN2GCPW7.js.map +1 -0
  43. package/dist/chunk-ES3NJZON.js +31 -0
  44. package/dist/chunk-ES3NJZON.js.map +1 -0
  45. package/dist/chunk-F3756A5B.js +20 -0
  46. package/dist/chunk-F3756A5B.js.map +1 -0
  47. package/dist/chunk-FWT3CBLL.js +51 -0
  48. package/dist/chunk-FWT3CBLL.js.map +1 -0
  49. package/dist/chunk-FYPUUYSG.js +31 -0
  50. package/dist/chunk-FYPUUYSG.js.map +1 -0
  51. package/dist/chunk-GRPSDKIS.js +112 -0
  52. package/dist/chunk-GRPSDKIS.js.map +1 -0
  53. package/dist/chunk-GYG5SE2D.js +81 -0
  54. package/dist/chunk-GYG5SE2D.js.map +1 -0
  55. package/dist/chunk-HIPGKIT3.js +287 -0
  56. package/dist/chunk-HIPGKIT3.js.map +1 -0
  57. package/dist/chunk-I3XKEGHM.js +16383 -0
  58. package/dist/chunk-I3XKEGHM.js.map +1 -0
  59. package/dist/chunk-IHO75PMZ.js +40 -0
  60. package/dist/chunk-IHO75PMZ.js.map +1 -0
  61. package/dist/chunk-IOJR5TOY.js +47 -0
  62. package/dist/chunk-IOJR5TOY.js.map +1 -0
  63. package/dist/chunk-K3OU6TGX.js +77 -0
  64. package/dist/chunk-K3OU6TGX.js.map +1 -0
  65. package/dist/chunk-KH7MOIM5.js +6010 -0
  66. package/dist/chunk-KH7MOIM5.js.map +1 -0
  67. package/dist/chunk-KIR7VYQD.js +63 -0
  68. package/dist/chunk-KIR7VYQD.js.map +1 -0
  69. package/dist/chunk-KOPEM3Q7.js +27 -0
  70. package/dist/chunk-KOPEM3Q7.js.map +1 -0
  71. package/dist/chunk-KSZ6PCY4.js +43 -0
  72. package/dist/chunk-KSZ6PCY4.js.map +1 -0
  73. package/dist/chunk-LRYNF3J7.js +111 -0
  74. package/dist/chunk-LRYNF3J7.js.map +1 -0
  75. package/dist/chunk-LYYXX2W5.js +87 -0
  76. package/dist/chunk-LYYXX2W5.js.map +1 -0
  77. package/dist/chunk-MC5DUZ3V.js +1135 -0
  78. package/dist/chunk-MC5DUZ3V.js.map +1 -0
  79. package/dist/chunk-N4IZ6GBO.js +300 -0
  80. package/dist/chunk-N4IZ6GBO.js.map +1 -0
  81. package/dist/chunk-NIKUMXE7.js +24 -0
  82. package/dist/chunk-NIKUMXE7.js.map +1 -0
  83. package/dist/chunk-NUIZ6ZUO.js +42 -0
  84. package/dist/chunk-NUIZ6ZUO.js.map +1 -0
  85. package/dist/chunk-O5ASLZ2K.js +270 -0
  86. package/dist/chunk-O5ASLZ2K.js.map +1 -0
  87. package/dist/chunk-OA5SUEQD.js +181 -0
  88. package/dist/chunk-OA5SUEQD.js.map +1 -0
  89. package/dist/chunk-OZZGXBCN.js +15 -0
  90. package/dist/chunk-OZZGXBCN.js.map +1 -0
  91. package/dist/chunk-P3PN5SVI.js +27 -0
  92. package/dist/chunk-P3PN5SVI.js.map +1 -0
  93. package/dist/chunk-P56WJ5FA.js +50 -0
  94. package/dist/chunk-P56WJ5FA.js.map +1 -0
  95. package/dist/chunk-PG4G4IIK.js +24 -0
  96. package/dist/chunk-PG4G4IIK.js.map +1 -0
  97. package/dist/chunk-QQLRX4KI.js +41 -0
  98. package/dist/chunk-QQLRX4KI.js.map +1 -0
  99. package/dist/chunk-RBHYLCUB.js +31 -0
  100. package/dist/chunk-RBHYLCUB.js.map +1 -0
  101. package/dist/chunk-RJN7W2C7.js +349 -0
  102. package/dist/chunk-RJN7W2C7.js.map +1 -0
  103. package/dist/chunk-RP7R73JO.js +179 -0
  104. package/dist/chunk-RP7R73JO.js.map +1 -0
  105. package/dist/chunk-SYUOXSPU.js +510 -0
  106. package/dist/chunk-SYUOXSPU.js.map +1 -0
  107. package/dist/chunk-THKIOI32.js +939 -0
  108. package/dist/chunk-THKIOI32.js.map +1 -0
  109. package/dist/chunk-UZRISDBZ.js +28 -0
  110. package/dist/chunk-UZRISDBZ.js.map +1 -0
  111. package/dist/chunk-V7QOSGQA.js +298 -0
  112. package/dist/chunk-V7QOSGQA.js.map +1 -0
  113. package/dist/chunk-VEP23B5W.js +27 -0
  114. package/dist/chunk-VEP23B5W.js.map +1 -0
  115. package/dist/chunk-VG2TVBFN.js +52 -0
  116. package/dist/chunk-VG2TVBFN.js.map +1 -0
  117. package/dist/chunk-VIFZ6NFH.js +27 -0
  118. package/dist/chunk-VIFZ6NFH.js.map +1 -0
  119. package/dist/chunk-XA57SX4T.js +115 -0
  120. package/dist/chunk-XA57SX4T.js.map +1 -0
  121. package/dist/chunk-YKKIJHZB.js +339 -0
  122. package/dist/chunk-YKKIJHZB.js.map +1 -0
  123. package/dist/chunk-YU2VGX5R.js +4205 -0
  124. package/dist/chunk-YU2VGX5R.js.map +1 -0
  125. package/dist/chunk-ZDLTLNU2.js +258 -0
  126. package/dist/chunk-ZDLTLNU2.js.map +1 -0
  127. package/dist/chunk-ZHTXPFDK.js +128 -0
  128. package/dist/chunk-ZHTXPFDK.js.map +1 -0
  129. package/dist/chunk-ZKJAJWK6.js +253 -0
  130. package/dist/chunk-ZKJAJWK6.js.map +1 -0
  131. package/dist/commands/build/marketplace.js +250 -0
  132. package/dist/commands/build/marketplace.js.map +1 -0
  133. package/dist/commands/build/plugins.js +176 -0
  134. package/dist/commands/build/plugins.js.map +1 -0
  135. package/dist/commands/compile.js +331 -0
  136. package/dist/commands/compile.js.map +1 -0
  137. package/dist/commands/doctor.js +475 -0
  138. package/dist/commands/doctor.js.map +1 -0
  139. package/dist/commands/edit.js +765 -0
  140. package/dist/commands/edit.js.map +1 -0
  141. package/dist/commands/eject.js +393 -0
  142. package/dist/commands/eject.js.map +1 -0
  143. package/dist/commands/import/skill.js +349 -0
  144. package/dist/commands/import/skill.js.map +1 -0
  145. package/dist/commands/init.js +66 -0
  146. package/dist/commands/init.js.map +1 -0
  147. package/dist/commands/list.js +115 -0
  148. package/dist/commands/list.js.map +1 -0
  149. package/dist/commands/new/agent.js +304 -0
  150. package/dist/commands/new/agent.js.map +1 -0
  151. package/dist/commands/new/marketplace.js +315 -0
  152. package/dist/commands/new/marketplace.js.map +1 -0
  153. package/dist/commands/new/skill.js +28 -0
  154. package/dist/commands/new/skill.js.map +1 -0
  155. package/dist/commands/search.js +176 -0
  156. package/dist/commands/search.js.map +1 -0
  157. package/dist/commands/uninstall.js +570 -0
  158. package/dist/commands/uninstall.js.map +1 -0
  159. package/dist/commands/update.js +368 -0
  160. package/dist/commands/update.js.map +1 -0
  161. package/dist/commands/validate.js +581 -0
  162. package/dist/commands/validate.js.map +1 -0
  163. package/dist/components/common/confirm.js +9 -0
  164. package/dist/components/common/confirm.js.map +1 -0
  165. package/dist/components/common/confirm.test.js +203 -0
  166. package/dist/components/common/confirm.test.js.map +1 -0
  167. package/dist/components/common/prompt-confirm.js +11 -0
  168. package/dist/components/common/prompt-confirm.js.map +1 -0
  169. package/dist/components/common/select-list.js +11 -0
  170. package/dist/components/common/select-list.js.map +1 -0
  171. package/dist/components/common/spinner.js +9 -0
  172. package/dist/components/common/spinner.js.map +1 -0
  173. package/dist/components/wizard/category-grid.js +16 -0
  174. package/dist/components/wizard/category-grid.js.map +1 -0
  175. package/dist/components/wizard/category-grid.test.js +1253 -0
  176. package/dist/components/wizard/category-grid.test.js.map +1 -0
  177. package/dist/components/wizard/checkbox-grid.js +14 -0
  178. package/dist/components/wizard/checkbox-grid.js.map +1 -0
  179. package/dist/components/wizard/checkbox-grid.test.js +264 -0
  180. package/dist/components/wizard/checkbox-grid.test.js.map +1 -0
  181. package/dist/components/wizard/domain-selection.js +22 -0
  182. package/dist/components/wizard/domain-selection.js.map +1 -0
  183. package/dist/components/wizard/run-wizard-session.js +47 -0
  184. package/dist/components/wizard/run-wizard-session.js.map +1 -0
  185. package/dist/components/wizard/scroll-affordance.js +10 -0
  186. package/dist/components/wizard/scroll-affordance.js.map +1 -0
  187. package/dist/components/wizard/search-modal.js +14 -0
  188. package/dist/components/wizard/search-modal.js.map +1 -0
  189. package/dist/components/wizard/search-modal.test.js +212 -0
  190. package/dist/components/wizard/search-modal.test.js.map +1 -0
  191. package/dist/components/wizard/selection-card.js +10 -0
  192. package/dist/components/wizard/selection-card.js.map +1 -0
  193. package/dist/components/wizard/skill-agent-summary.js +16 -0
  194. package/dist/components/wizard/skill-agent-summary.js.map +1 -0
  195. package/dist/components/wizard/source-grid.js +23 -0
  196. package/dist/components/wizard/source-grid.js.map +1 -0
  197. package/dist/components/wizard/source-grid.test.js +1094 -0
  198. package/dist/components/wizard/source-grid.test.js.map +1 -0
  199. package/dist/components/wizard/stack-selection.js +20 -0
  200. package/dist/components/wizard/stack-selection.js.map +1 -0
  201. package/dist/components/wizard/step-agents.js +22 -0
  202. package/dist/components/wizard/step-agents.js.map +1 -0
  203. package/dist/components/wizard/step-agents.test.js +204 -0
  204. package/dist/components/wizard/step-agents.test.js.map +1 -0
  205. package/dist/components/wizard/step-build.js +22 -0
  206. package/dist/components/wizard/step-build.js.map +1 -0
  207. package/dist/components/wizard/step-build.test.js +552 -0
  208. package/dist/components/wizard/step-build.test.js.map +1 -0
  209. package/dist/components/wizard/step-confirm.js +21 -0
  210. package/dist/components/wizard/step-confirm.js.map +1 -0
  211. package/dist/components/wizard/step-confirm.test.js +744 -0
  212. package/dist/components/wizard/step-confirm.test.js.map +1 -0
  213. package/dist/components/wizard/step-settings.js +19 -0
  214. package/dist/components/wizard/step-settings.js.map +1 -0
  215. package/dist/components/wizard/step-settings.test.js +244 -0
  216. package/dist/components/wizard/step-settings.test.js.map +1 -0
  217. package/dist/components/wizard/step-sources.js +28 -0
  218. package/dist/components/wizard/step-sources.js.map +1 -0
  219. package/dist/components/wizard/step-sources.test.js +155 -0
  220. package/dist/components/wizard/step-sources.test.js.map +1 -0
  221. package/dist/components/wizard/step-stack.js +21 -0
  222. package/dist/components/wizard/step-stack.js.map +1 -0
  223. package/dist/components/wizard/step-stack.test.js +262 -0
  224. package/dist/components/wizard/step-stack.test.js.map +1 -0
  225. package/dist/components/wizard/summary-panel.js +20 -0
  226. package/dist/components/wizard/summary-panel.js.map +1 -0
  227. package/dist/components/wizard/summary-panel.test.js +317 -0
  228. package/dist/components/wizard/summary-panel.test.js.map +1 -0
  229. package/dist/components/wizard/toast.js +10 -0
  230. package/dist/components/wizard/toast.js.map +1 -0
  231. package/dist/components/wizard/wizard-layout.js +26 -0
  232. package/dist/components/wizard/wizard-layout.js.map +1 -0
  233. package/dist/components/wizard/wizard-layout.test.js +200 -0
  234. package/dist/components/wizard/wizard-layout.test.js.map +1 -0
  235. package/dist/components/wizard/wizard-tabs.js +20 -0
  236. package/dist/components/wizard/wizard-tabs.js.map +1 -0
  237. package/dist/components/wizard/wizard-tabs.test.js +290 -0
  238. package/dist/components/wizard/wizard-tabs.test.js.map +1 -0
  239. package/dist/components/wizard/wizard.js +48 -0
  240. package/dist/components/wizard/wizard.js.map +1 -0
  241. package/dist/config-exports.js +20 -0
  242. package/dist/config-exports.js.map +1 -0
  243. package/dist/copy-local-skills-CA7P73RZ.js +15 -0
  244. package/dist/copy-local-skills-CA7P73RZ.js.map +1 -0
  245. package/dist/dist-VNJNNJK7.js +550 -0
  246. package/dist/dist-VNJNNJK7.js.map +1 -0
  247. package/dist/hooks/init.js +90 -0
  248. package/dist/hooks/init.js.map +1 -0
  249. package/dist/index.js +10 -0
  250. package/dist/index.js.map +1 -0
  251. package/dist/load-agent-defs-6MAY5ABI.js +16 -0
  252. package/dist/load-agent-defs-6MAY5ABI.js.map +1 -0
  253. package/dist/loader-E2ERJYVA.js +23 -0
  254. package/dist/loader-E2ERJYVA.js.map +1 -0
  255. package/dist/magic-string.es-5TV73NJD.js +1316 -0
  256. package/dist/magic-string.es-5TV73NJD.js.map +1 -0
  257. package/dist/recompile-project-agents-VYQJ6UZB.js +20 -0
  258. package/dist/recompile-project-agents-VYQJ6UZB.js.map +1 -0
  259. package/dist/source-loader-VVHMQEX5.js +20 -0
  260. package/dist/source-loader-VVHMQEX5.js.map +1 -0
  261. package/dist/source-manager-TPDXV5FO.js +18 -0
  262. package/dist/source-manager-TPDXV5FO.js.map +1 -0
  263. package/dist/src/agents/_templates/agent.liquid +161 -0
  264. package/dist/src/agents/_templates/methodologies/anti-over-engineering.liquid +121 -0
  265. package/dist/src/agents/_templates/methodologies/context-management.liquid +162 -0
  266. package/dist/src/agents/_templates/methodologies/improvement-protocol.liquid +150 -0
  267. package/dist/src/agents/_templates/methodologies/investigation-requirements.liquid +49 -0
  268. package/dist/src/agents/_templates/methodologies/success-criteria.liquid +111 -0
  269. package/dist/src/agents/_templates/methodologies/write-verification.liquid +43 -0
  270. package/dist/src/agents/developer/ai-developer/critical-reminders.md +54 -0
  271. package/dist/src/agents/developer/ai-developer/critical-requirements.md +59 -0
  272. package/dist/src/agents/developer/ai-developer/identity.md +51 -0
  273. package/dist/src/agents/developer/ai-developer/metadata.yaml +12 -0
  274. package/dist/src/agents/developer/ai-developer/output.md +366 -0
  275. package/dist/src/agents/developer/ai-developer/playbook.md +335 -0
  276. package/dist/src/agents/developer/api-developer/critical-reminders.md +46 -0
  277. package/dist/src/agents/developer/api-developer/critical-requirements.md +44 -0
  278. package/dist/src/agents/developer/api-developer/identity.md +49 -0
  279. package/dist/src/agents/developer/api-developer/metadata.yaml +12 -0
  280. package/dist/src/agents/developer/api-developer/output.md +432 -0
  281. package/dist/src/agents/developer/api-developer/playbook.md +352 -0
  282. package/dist/src/agents/developer/cli-developer/critical-reminders.md +51 -0
  283. package/dist/src/agents/developer/cli-developer/critical-requirements.md +51 -0
  284. package/dist/src/agents/developer/cli-developer/identity.md +51 -0
  285. package/dist/src/agents/developer/cli-developer/metadata.yaml +12 -0
  286. package/dist/src/agents/developer/cli-developer/output.md +285 -0
  287. package/dist/src/agents/developer/cli-developer/playbook.md +386 -0
  288. package/dist/src/agents/developer/web-architecture/critical-reminders.md +48 -0
  289. package/dist/src/agents/developer/web-architecture/critical-requirements.md +65 -0
  290. package/dist/src/agents/developer/web-architecture/identity.md +64 -0
  291. package/dist/src/agents/developer/web-architecture/metadata.yaml +12 -0
  292. package/dist/src/agents/developer/web-architecture/output.md +449 -0
  293. package/dist/src/agents/developer/web-architecture/playbook.md +481 -0
  294. package/dist/src/agents/developer/web-developer/critical-reminders.md +40 -0
  295. package/dist/src/agents/developer/web-developer/critical-requirements.md +39 -0
  296. package/dist/src/agents/developer/web-developer/identity.md +32 -0
  297. package/dist/src/agents/developer/web-developer/metadata.yaml +12 -0
  298. package/dist/src/agents/developer/web-developer/output.md +323 -0
  299. package/dist/src/agents/developer/web-developer/playbook.md +349 -0
  300. package/dist/src/agents/meta/agent-summoner/critical-reminders.md +45 -0
  301. package/dist/src/agents/meta/agent-summoner/critical-requirements.md +52 -0
  302. package/dist/src/agents/meta/agent-summoner/identity.md +34 -0
  303. package/dist/src/agents/meta/agent-summoner/metadata.yaml +12 -0
  304. package/dist/src/agents/meta/agent-summoner/output.md +296 -0
  305. package/dist/src/agents/meta/agent-summoner/playbook.md +1469 -0
  306. package/dist/src/agents/meta/codex-keeper/critical-reminders.md +39 -0
  307. package/dist/src/agents/meta/codex-keeper/critical-requirements.md +29 -0
  308. package/dist/src/agents/meta/codex-keeper/identity.md +45 -0
  309. package/dist/src/agents/meta/codex-keeper/metadata.yaml +12 -0
  310. package/dist/src/agents/meta/codex-keeper/output.md +384 -0
  311. package/dist/src/agents/meta/codex-keeper/playbook.md +1183 -0
  312. package/dist/src/agents/meta/convention-keeper/critical-reminders.md +32 -0
  313. package/dist/src/agents/meta/convention-keeper/critical-requirements.md +32 -0
  314. package/dist/src/agents/meta/convention-keeper/identity.md +33 -0
  315. package/dist/src/agents/meta/convention-keeper/metadata.yaml +12 -0
  316. package/dist/src/agents/meta/convention-keeper/output.md +206 -0
  317. package/dist/src/agents/meta/convention-keeper/playbook.md +180 -0
  318. package/dist/src/agents/meta/skill-summoner/critical-reminders.md +112 -0
  319. package/dist/src/agents/meta/skill-summoner/critical-requirements.md +62 -0
  320. package/dist/src/agents/meta/skill-summoner/identity.md +31 -0
  321. package/dist/src/agents/meta/skill-summoner/metadata.yaml +13 -0
  322. package/dist/src/agents/meta/skill-summoner/output.md +390 -0
  323. package/dist/src/agents/meta/skill-summoner/playbook.md +1457 -0
  324. package/dist/src/agents/pattern/pattern-scout/critical-reminders.md +71 -0
  325. package/dist/src/agents/pattern/pattern-scout/critical-requirements.md +31 -0
  326. package/dist/src/agents/pattern/pattern-scout/identity.md +25 -0
  327. package/dist/src/agents/pattern/pattern-scout/metadata.yaml +10 -0
  328. package/dist/src/agents/pattern/pattern-scout/output.md +290 -0
  329. package/dist/src/agents/pattern/pattern-scout/playbook.md +1806 -0
  330. package/dist/src/agents/pattern/web-pattern-critique/critical-reminders.md +30 -0
  331. package/dist/src/agents/pattern/web-pattern-critique/critical-requirements.md +28 -0
  332. package/dist/src/agents/pattern/web-pattern-critique/identity.md +41 -0
  333. package/dist/src/agents/pattern/web-pattern-critique/metadata.yaml +12 -0
  334. package/dist/src/agents/pattern/web-pattern-critique/output.md +314 -0
  335. package/dist/src/agents/pattern/web-pattern-critique/playbook.md +572 -0
  336. package/dist/src/agents/planning/api-pm/critical-reminders.md +48 -0
  337. package/dist/src/agents/planning/api-pm/critical-requirements.md +41 -0
  338. package/dist/src/agents/planning/api-pm/identity.md +39 -0
  339. package/dist/src/agents/planning/api-pm/metadata.yaml +12 -0
  340. package/dist/src/agents/planning/api-pm/output.md +475 -0
  341. package/dist/src/agents/planning/api-pm/playbook.md +129 -0
  342. package/dist/src/agents/planning/web-pm/critical-reminders.md +36 -0
  343. package/dist/src/agents/planning/web-pm/critical-requirements.md +32 -0
  344. package/dist/src/agents/planning/web-pm/identity.md +26 -0
  345. package/dist/src/agents/planning/web-pm/metadata.yaml +12 -0
  346. package/dist/src/agents/planning/web-pm/output.md +314 -0
  347. package/dist/src/agents/planning/web-pm/playbook.md +318 -0
  348. package/dist/src/agents/researcher/api-researcher/critical-reminders.md +27 -0
  349. package/dist/src/agents/researcher/api-researcher/critical-requirements.md +28 -0
  350. package/dist/src/agents/researcher/api-researcher/identity.md +71 -0
  351. package/dist/src/agents/researcher/api-researcher/metadata.yaml +10 -0
  352. package/dist/src/agents/researcher/api-researcher/output.md +254 -0
  353. package/dist/src/agents/researcher/api-researcher/playbook.md +201 -0
  354. package/dist/src/agents/researcher/web-researcher/critical-reminders.md +39 -0
  355. package/dist/src/agents/researcher/web-researcher/critical-requirements.md +26 -0
  356. package/dist/src/agents/researcher/web-researcher/identity.md +69 -0
  357. package/dist/src/agents/researcher/web-researcher/metadata.yaml +10 -0
  358. package/dist/src/agents/researcher/web-researcher/output.md +241 -0
  359. package/dist/src/agents/researcher/web-researcher/playbook.md +217 -0
  360. package/dist/src/agents/reviewer/ai-reviewer/critical-reminders.md +40 -0
  361. package/dist/src/agents/reviewer/ai-reviewer/critical-requirements.md +37 -0
  362. package/dist/src/agents/reviewer/ai-reviewer/identity.md +51 -0
  363. package/dist/src/agents/reviewer/ai-reviewer/metadata.yaml +10 -0
  364. package/dist/src/agents/reviewer/ai-reviewer/output.md +395 -0
  365. package/dist/src/agents/reviewer/ai-reviewer/playbook.md +90 -0
  366. package/dist/src/agents/reviewer/api-reviewer/critical-reminders.md +31 -0
  367. package/dist/src/agents/reviewer/api-reviewer/critical-requirements.md +27 -0
  368. package/dist/src/agents/reviewer/api-reviewer/identity.md +51 -0
  369. package/dist/src/agents/reviewer/api-reviewer/metadata.yaml +12 -0
  370. package/dist/src/agents/reviewer/api-reviewer/output.md +343 -0
  371. package/dist/src/agents/reviewer/api-reviewer/playbook.md +288 -0
  372. package/dist/src/agents/reviewer/cli-reviewer/critical-reminders.md +33 -0
  373. package/dist/src/agents/reviewer/cli-reviewer/critical-requirements.md +30 -0
  374. package/dist/src/agents/reviewer/cli-reviewer/identity.md +44 -0
  375. package/dist/src/agents/reviewer/cli-reviewer/metadata.yaml +12 -0
  376. package/dist/src/agents/reviewer/cli-reviewer/output.md +414 -0
  377. package/dist/src/agents/reviewer/cli-reviewer/playbook.md +218 -0
  378. package/dist/src/agents/reviewer/infra-reviewer/critical-reminders.md +38 -0
  379. package/dist/src/agents/reviewer/infra-reviewer/critical-requirements.md +38 -0
  380. package/dist/src/agents/reviewer/infra-reviewer/identity.md +53 -0
  381. package/dist/src/agents/reviewer/infra-reviewer/metadata.yaml +10 -0
  382. package/dist/src/agents/reviewer/infra-reviewer/output.md +364 -0
  383. package/dist/src/agents/reviewer/infra-reviewer/playbook.md +161 -0
  384. package/dist/src/agents/reviewer/web-reviewer/critical-reminders.md +31 -0
  385. package/dist/src/agents/reviewer/web-reviewer/critical-requirements.md +26 -0
  386. package/dist/src/agents/reviewer/web-reviewer/identity.md +40 -0
  387. package/dist/src/agents/reviewer/web-reviewer/metadata.yaml +12 -0
  388. package/dist/src/agents/reviewer/web-reviewer/output.md +333 -0
  389. package/dist/src/agents/reviewer/web-reviewer/playbook.md +156 -0
  390. package/dist/src/agents/tester/api-tester/critical-reminders.md +41 -0
  391. package/dist/src/agents/tester/api-tester/critical-requirements.md +41 -0
  392. package/dist/src/agents/tester/api-tester/identity.md +47 -0
  393. package/dist/src/agents/tester/api-tester/metadata.yaml +12 -0
  394. package/dist/src/agents/tester/api-tester/output.md +284 -0
  395. package/dist/src/agents/tester/api-tester/playbook.md +275 -0
  396. package/dist/src/agents/tester/cli-tester/critical-reminders.md +36 -0
  397. package/dist/src/agents/tester/cli-tester/critical-requirements.md +36 -0
  398. package/dist/src/agents/tester/cli-tester/identity.md +43 -0
  399. package/dist/src/agents/tester/cli-tester/metadata.yaml +12 -0
  400. package/dist/src/agents/tester/cli-tester/output.md +313 -0
  401. package/dist/src/agents/tester/cli-tester/playbook.md +221 -0
  402. package/dist/src/agents/tester/web-tester/critical-reminders.md +31 -0
  403. package/dist/src/agents/tester/web-tester/critical-requirements.md +28 -0
  404. package/dist/src/agents/tester/web-tester/identity.md +41 -0
  405. package/dist/src/agents/tester/web-tester/metadata.yaml +12 -0
  406. package/dist/src/agents/tester/web-tester/output.md +321 -0
  407. package/dist/src/agents/tester/web-tester/playbook.md +428 -0
  408. package/dist/stores/d227-same-scope-tombstone-duplicate.test.js +118 -0
  409. package/dist/stores/d227-same-scope-tombstone-duplicate.test.js.map +1 -0
  410. package/dist/stores/wizard-store.js +21 -0
  411. package/dist/stores/wizard-store.js.map +1 -0
  412. package/dist/stores/wizard-store.test.js +3053 -0
  413. package/dist/stores/wizard-store.test.js.map +1 -0
  414. package/package.json +130 -12
  415. package/src/agents/_templates/agent.liquid +161 -0
  416. package/src/agents/_templates/methodologies/anti-over-engineering.liquid +121 -0
  417. package/src/agents/_templates/methodologies/context-management.liquid +162 -0
  418. package/src/agents/_templates/methodologies/improvement-protocol.liquid +150 -0
  419. package/src/agents/_templates/methodologies/investigation-requirements.liquid +49 -0
  420. package/src/agents/_templates/methodologies/success-criteria.liquid +111 -0
  421. package/src/agents/_templates/methodologies/write-verification.liquid +43 -0
  422. package/src/agents/developer/ai-developer/critical-reminders.md +54 -0
  423. package/src/agents/developer/ai-developer/critical-requirements.md +59 -0
  424. package/src/agents/developer/ai-developer/identity.md +51 -0
  425. package/src/agents/developer/ai-developer/metadata.yaml +12 -0
  426. package/src/agents/developer/ai-developer/output.md +366 -0
  427. package/src/agents/developer/ai-developer/playbook.md +335 -0
  428. package/src/agents/developer/api-developer/critical-reminders.md +46 -0
  429. package/src/agents/developer/api-developer/critical-requirements.md +44 -0
  430. package/src/agents/developer/api-developer/identity.md +49 -0
  431. package/src/agents/developer/api-developer/metadata.yaml +12 -0
  432. package/src/agents/developer/api-developer/output.md +432 -0
  433. package/src/agents/developer/api-developer/playbook.md +352 -0
  434. package/src/agents/developer/cli-developer/critical-reminders.md +51 -0
  435. package/src/agents/developer/cli-developer/critical-requirements.md +51 -0
  436. package/src/agents/developer/cli-developer/identity.md +51 -0
  437. package/src/agents/developer/cli-developer/metadata.yaml +12 -0
  438. package/src/agents/developer/cli-developer/output.md +285 -0
  439. package/src/agents/developer/cli-developer/playbook.md +386 -0
  440. package/src/agents/developer/web-architecture/critical-reminders.md +48 -0
  441. package/src/agents/developer/web-architecture/critical-requirements.md +65 -0
  442. package/src/agents/developer/web-architecture/identity.md +64 -0
  443. package/src/agents/developer/web-architecture/metadata.yaml +12 -0
  444. package/src/agents/developer/web-architecture/output.md +449 -0
  445. package/src/agents/developer/web-architecture/playbook.md +481 -0
  446. package/src/agents/developer/web-developer/critical-reminders.md +40 -0
  447. package/src/agents/developer/web-developer/critical-requirements.md +39 -0
  448. package/src/agents/developer/web-developer/identity.md +32 -0
  449. package/src/agents/developer/web-developer/metadata.yaml +12 -0
  450. package/src/agents/developer/web-developer/output.md +323 -0
  451. package/src/agents/developer/web-developer/playbook.md +349 -0
  452. package/src/agents/meta/agent-summoner/critical-reminders.md +45 -0
  453. package/src/agents/meta/agent-summoner/critical-requirements.md +52 -0
  454. package/src/agents/meta/agent-summoner/identity.md +34 -0
  455. package/src/agents/meta/agent-summoner/metadata.yaml +12 -0
  456. package/src/agents/meta/agent-summoner/output.md +296 -0
  457. package/src/agents/meta/agent-summoner/playbook.md +1469 -0
  458. package/src/agents/meta/codex-keeper/critical-reminders.md +39 -0
  459. package/src/agents/meta/codex-keeper/critical-requirements.md +29 -0
  460. package/src/agents/meta/codex-keeper/identity.md +45 -0
  461. package/src/agents/meta/codex-keeper/metadata.yaml +12 -0
  462. package/src/agents/meta/codex-keeper/output.md +384 -0
  463. package/src/agents/meta/codex-keeper/playbook.md +1183 -0
  464. package/src/agents/meta/convention-keeper/critical-reminders.md +32 -0
  465. package/src/agents/meta/convention-keeper/critical-requirements.md +32 -0
  466. package/src/agents/meta/convention-keeper/identity.md +33 -0
  467. package/src/agents/meta/convention-keeper/metadata.yaml +12 -0
  468. package/src/agents/meta/convention-keeper/output.md +206 -0
  469. package/src/agents/meta/convention-keeper/playbook.md +180 -0
  470. package/src/agents/meta/skill-summoner/critical-reminders.md +112 -0
  471. package/src/agents/meta/skill-summoner/critical-requirements.md +62 -0
  472. package/src/agents/meta/skill-summoner/identity.md +31 -0
  473. package/src/agents/meta/skill-summoner/metadata.yaml +13 -0
  474. package/src/agents/meta/skill-summoner/output.md +390 -0
  475. package/src/agents/meta/skill-summoner/playbook.md +1457 -0
  476. package/src/agents/pattern/pattern-scout/critical-reminders.md +71 -0
  477. package/src/agents/pattern/pattern-scout/critical-requirements.md +31 -0
  478. package/src/agents/pattern/pattern-scout/identity.md +25 -0
  479. package/src/agents/pattern/pattern-scout/metadata.yaml +10 -0
  480. package/src/agents/pattern/pattern-scout/output.md +290 -0
  481. package/src/agents/pattern/pattern-scout/playbook.md +1806 -0
  482. package/src/agents/pattern/web-pattern-critique/critical-reminders.md +30 -0
  483. package/src/agents/pattern/web-pattern-critique/critical-requirements.md +28 -0
  484. package/src/agents/pattern/web-pattern-critique/identity.md +41 -0
  485. package/src/agents/pattern/web-pattern-critique/metadata.yaml +12 -0
  486. package/src/agents/pattern/web-pattern-critique/output.md +314 -0
  487. package/src/agents/pattern/web-pattern-critique/playbook.md +572 -0
  488. package/src/agents/planning/api-pm/critical-reminders.md +48 -0
  489. package/src/agents/planning/api-pm/critical-requirements.md +41 -0
  490. package/src/agents/planning/api-pm/identity.md +39 -0
  491. package/src/agents/planning/api-pm/metadata.yaml +12 -0
  492. package/src/agents/planning/api-pm/output.md +475 -0
  493. package/src/agents/planning/api-pm/playbook.md +129 -0
  494. package/src/agents/planning/web-pm/critical-reminders.md +36 -0
  495. package/src/agents/planning/web-pm/critical-requirements.md +32 -0
  496. package/src/agents/planning/web-pm/identity.md +26 -0
  497. package/src/agents/planning/web-pm/metadata.yaml +12 -0
  498. package/src/agents/planning/web-pm/output.md +314 -0
  499. package/src/agents/planning/web-pm/playbook.md +318 -0
  500. package/src/agents/researcher/api-researcher/critical-reminders.md +27 -0
  501. package/src/agents/researcher/api-researcher/critical-requirements.md +28 -0
  502. package/src/agents/researcher/api-researcher/identity.md +71 -0
  503. package/src/agents/researcher/api-researcher/metadata.yaml +10 -0
  504. package/src/agents/researcher/api-researcher/output.md +254 -0
  505. package/src/agents/researcher/api-researcher/playbook.md +201 -0
  506. package/src/agents/researcher/web-researcher/critical-reminders.md +39 -0
  507. package/src/agents/researcher/web-researcher/critical-requirements.md +26 -0
  508. package/src/agents/researcher/web-researcher/identity.md +69 -0
  509. package/src/agents/researcher/web-researcher/metadata.yaml +10 -0
  510. package/src/agents/researcher/web-researcher/output.md +241 -0
  511. package/src/agents/researcher/web-researcher/playbook.md +217 -0
  512. package/src/agents/reviewer/ai-reviewer/critical-reminders.md +40 -0
  513. package/src/agents/reviewer/ai-reviewer/critical-requirements.md +37 -0
  514. package/src/agents/reviewer/ai-reviewer/identity.md +51 -0
  515. package/src/agents/reviewer/ai-reviewer/metadata.yaml +10 -0
  516. package/src/agents/reviewer/ai-reviewer/output.md +395 -0
  517. package/src/agents/reviewer/ai-reviewer/playbook.md +90 -0
  518. package/src/agents/reviewer/api-reviewer/critical-reminders.md +31 -0
  519. package/src/agents/reviewer/api-reviewer/critical-requirements.md +27 -0
  520. package/src/agents/reviewer/api-reviewer/identity.md +51 -0
  521. package/src/agents/reviewer/api-reviewer/metadata.yaml +12 -0
  522. package/src/agents/reviewer/api-reviewer/output.md +343 -0
  523. package/src/agents/reviewer/api-reviewer/playbook.md +288 -0
  524. package/src/agents/reviewer/cli-reviewer/critical-reminders.md +33 -0
  525. package/src/agents/reviewer/cli-reviewer/critical-requirements.md +30 -0
  526. package/src/agents/reviewer/cli-reviewer/identity.md +44 -0
  527. package/src/agents/reviewer/cli-reviewer/metadata.yaml +12 -0
  528. package/src/agents/reviewer/cli-reviewer/output.md +414 -0
  529. package/src/agents/reviewer/cli-reviewer/playbook.md +218 -0
  530. package/src/agents/reviewer/infra-reviewer/critical-reminders.md +38 -0
  531. package/src/agents/reviewer/infra-reviewer/critical-requirements.md +38 -0
  532. package/src/agents/reviewer/infra-reviewer/identity.md +53 -0
  533. package/src/agents/reviewer/infra-reviewer/metadata.yaml +10 -0
  534. package/src/agents/reviewer/infra-reviewer/output.md +364 -0
  535. package/src/agents/reviewer/infra-reviewer/playbook.md +161 -0
  536. package/src/agents/reviewer/web-reviewer/critical-reminders.md +31 -0
  537. package/src/agents/reviewer/web-reviewer/critical-requirements.md +26 -0
  538. package/src/agents/reviewer/web-reviewer/identity.md +40 -0
  539. package/src/agents/reviewer/web-reviewer/metadata.yaml +12 -0
  540. package/src/agents/reviewer/web-reviewer/output.md +333 -0
  541. package/src/agents/reviewer/web-reviewer/playbook.md +156 -0
  542. package/src/agents/tester/api-tester/critical-reminders.md +41 -0
  543. package/src/agents/tester/api-tester/critical-requirements.md +41 -0
  544. package/src/agents/tester/api-tester/identity.md +47 -0
  545. package/src/agents/tester/api-tester/metadata.yaml +12 -0
  546. package/src/agents/tester/api-tester/output.md +284 -0
  547. package/src/agents/tester/api-tester/playbook.md +275 -0
  548. package/src/agents/tester/cli-tester/critical-reminders.md +36 -0
  549. package/src/agents/tester/cli-tester/critical-requirements.md +36 -0
  550. package/src/agents/tester/cli-tester/identity.md +43 -0
  551. package/src/agents/tester/cli-tester/metadata.yaml +12 -0
  552. package/src/agents/tester/cli-tester/output.md +313 -0
  553. package/src/agents/tester/cli-tester/playbook.md +221 -0
  554. package/src/agents/tester/web-tester/critical-reminders.md +31 -0
  555. package/src/agents/tester/web-tester/critical-requirements.md +28 -0
  556. package/src/agents/tester/web-tester/identity.md +41 -0
  557. package/src/agents/tester/web-tester/metadata.yaml +12 -0
  558. package/src/agents/tester/web-tester/output.md +321 -0
  559. package/src/agents/tester/web-tester/playbook.md +428 -0
  560. package/src/schemas/agent-frontmatter.schema.json +88 -0
  561. package/src/schemas/agent.schema.json +103 -0
  562. package/src/schemas/custom-metadata.schema.json +74 -0
  563. package/src/schemas/hooks.schema.json +47 -0
  564. package/src/schemas/marketplace.schema.json +119 -0
  565. package/src/schemas/metadata.schema.json +387 -0
  566. package/src/schemas/plugin.schema.json +127 -0
  567. package/src/schemas/project-config.schema.json +189 -0
  568. package/src/schemas/project-source-config.schema.json +96 -0
  569. package/src/schemas/skill-frontmatter.schema.json +42 -0
  570. package/src/schemas/stack.schema.json +191 -0
  571. package/src/schemas/stacks.schema.json +107 -0
  572. package/bin/run.js +0 -3
@@ -0,0 +1,1135 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ deriveInstallMode,
4
+ getAvailableSkills,
5
+ getUnmetRequiredBy,
6
+ isActiveAt,
7
+ isCompatibleWithSelections,
8
+ isGlobalTombstone,
9
+ isProjectOwned
10
+ } from "./chunk-KH7MOIM5.js";
11
+ import {
12
+ warn
13
+ } from "./chunk-3LIU2ZEF.js";
14
+ import {
15
+ getCategoryDomain,
16
+ getSkillById,
17
+ matrix
18
+ } from "./chunk-DJAZE4PD.js";
19
+ import {
20
+ typedEntries,
21
+ typedFromEntries,
22
+ typedKeys,
23
+ typedValues
24
+ } from "./chunk-VEP23B5W.js";
25
+ import {
26
+ BUILT_IN_DOMAIN_ORDER,
27
+ DEFAULT_PUBLIC_SOURCE_NAME,
28
+ EJECT_SOURCE,
29
+ FALLBACK_DOMAIN
30
+ } from "./chunk-O5ASLZ2K.js";
31
+ import {
32
+ init_esm_shims
33
+ } from "./chunk-P56WJ5FA.js";
34
+
35
+ // src/cli/stores/wizard-store.ts
36
+ init_esm_shims();
37
+ import { flatMap } from "remeda";
38
+ import { create } from "zustand";
39
+
40
+ // src/cli/lib/wizard/index.ts
41
+ init_esm_shims();
42
+
43
+ // src/cli/lib/wizard/build-step-logic.ts
44
+ init_esm_shims();
45
+ import { sortBy } from "remeda";
46
+
47
+ // src/cli/lib/wizard/scope-diff.ts
48
+ init_esm_shims();
49
+ function computeScopeDiff(input) {
50
+ const { currentSkills, currentAgents, installedSkillConfigs, installedAgentConfigs, isInitMode } = input;
51
+ const projectSkills = currentSkills.filter((s) => s.scope === "project" && !s.excluded);
52
+ const globalSkills = currentSkills.filter((s) => s.scope === "global" && !s.excluded);
53
+ const projectAgents = currentAgents.filter((a) => a.scope === "project" && !a.excluded);
54
+ const globalAgents = currentAgents.filter((a) => a.scope === "global" && !a.excluded);
55
+ const excludedGlobalSkills = currentSkills.filter((s) => s.scope === "global" && !!s.excluded);
56
+ const excludedGlobalAgents = currentAgents.filter((a) => a.scope === "global" && !!a.excluded);
57
+ const prevSkillKeySet = installedSkillConfigs ? new Set(installedSkillConfigs.map((s) => skillSlotKey(s.id, s.scope))) : null;
58
+ const prevSourceMap = installedSkillConfigs ? new Map(
59
+ installedSkillConfigs.filter((s) => !s.excluded).map((s) => [skillSlotKey(s.id, s.scope), s.source])
60
+ ) : null;
61
+ const prevAgentKeySet = installedAgentConfigs ? new Set(installedAgentConfigs.map((a) => agentSlotKey(a.name, a.scope))) : null;
62
+ const activeSkillBaseline = installedSkillConfigs ? installedSkillConfigs.filter((s) => !s.excluded) : [];
63
+ const activeAgentBaseline = installedAgentConfigs ? installedAgentConfigs.filter((a) => !a.excluded) : [];
64
+ const inheritedGlobalSkills = activeSkillBaseline.filter(
65
+ (s) => s.scope === "global" && !globalSkills.some((g) => g.id === s.id) && !excludedGlobalSkills.some((e) => e.id === s.id) && projectSkills.some((p) => p.id === s.id)
66
+ );
67
+ const inheritedGlobalAgents = activeAgentBaseline.filter(
68
+ (a) => a.scope === "global" && !globalAgents.some((g) => g.name === a.name) && !excludedGlobalAgents.some((e) => e.name === a.name) && projectAgents.some((p) => p.name === a.name)
69
+ );
70
+ const removedSkills = installedSkillConfigs ? installedSkillConfigs.filter(
71
+ (s) => !currentSkills.some((c) => c.id === s.id && c.scope === s.scope)
72
+ ) : [];
73
+ const removedAgents = installedAgentConfigs ? installedAgentConfigs.filter(
74
+ (a) => !currentAgents.some((c) => c.name === a.name && c.scope === a.scope)
75
+ ) : [];
76
+ const inheritedSkillIdSet = new Set(inheritedGlobalSkills.map((s) => s.id));
77
+ const uniqueExcludedGlobalSkills = excludedGlobalSkills.filter(
78
+ (s) => !inheritedSkillIdSet.has(s.id)
79
+ );
80
+ const allGlobalSkills = [
81
+ ...globalSkills,
82
+ ...inheritedGlobalSkills,
83
+ ...uniqueExcludedGlobalSkills
84
+ ];
85
+ const inheritedAgentNameSet = new Set(inheritedGlobalAgents.map((a) => a.name));
86
+ const uniqueExcludedGlobalAgents = excludedGlobalAgents.filter(
87
+ (a) => !inheritedAgentNameSet.has(a.name)
88
+ );
89
+ const allGlobalAgents = [
90
+ ...globalAgents,
91
+ ...inheritedGlobalAgents,
92
+ ...uniqueExcludedGlobalAgents
93
+ ];
94
+ const removedGlobalSkills = isInitMode ? [] : removedSkills.filter((s) => s.scope === "global");
95
+ const removedProjectSkills = removedSkills.filter((s) => s.scope === "project");
96
+ const removedGlobalAgents = isInitMode ? [] : removedAgents.filter((a) => a.scope === "global");
97
+ const removedProjectAgents = removedAgents.filter((a) => a.scope === "project");
98
+ const projectSkillRows = [
99
+ ...projectSkills.map((s) => classifyDiffRow(s, prevSkillKeySet, prevSourceMap)),
100
+ ...removedProjectSkills.map(toRemovedSkillRow)
101
+ ];
102
+ const globalSkillRows = [
103
+ ...allGlobalSkills.map((s) => classifyDiffRow(s, prevSkillKeySet, prevSourceMap)),
104
+ ...removedGlobalSkills.map(toRemovedSkillRow)
105
+ ];
106
+ const projectAgentRows = [
107
+ ...projectAgents.map((a) => classifyAgentDiffRow(a, prevAgentKeySet)),
108
+ ...removedProjectAgents.map(toRemovedAgentRow)
109
+ ];
110
+ const globalAgentRows = [
111
+ ...allGlobalAgents.map((a) => classifyAgentDiffRow(a, prevAgentKeySet)),
112
+ ...removedGlobalAgents.map(toRemovedAgentRow)
113
+ ];
114
+ const hasContent = projectSkillRows.length > 0 || globalSkillRows.length > 0 || projectAgentRows.length > 0 || globalAgentRows.length > 0;
115
+ return { projectSkillRows, globalSkillRows, projectAgentRows, globalAgentRows, hasContent };
116
+ }
117
+ function skillSlotKey(id, scope) {
118
+ return `${id}:${scope}`;
119
+ }
120
+ function agentSlotKey(name, scope) {
121
+ return `${name}:${scope}`;
122
+ }
123
+ function formatScopeTag(scope) {
124
+ return scope === "global" ? "[G]" : "[P]";
125
+ }
126
+ function deriveScopeBadges(activeConfig, excludedConfig) {
127
+ const secondaryScope = excludedConfig && activeConfig && excludedConfig.scope !== activeConfig.scope ? excludedConfig.scope : void 0;
128
+ return { scope: activeConfig?.scope, secondaryScope };
129
+ }
130
+ function classifyDiffRow(skill, prevKeySet, prevSourceMap) {
131
+ const key = skillSlotKey(skill.id, skill.scope);
132
+ const isNew = prevKeySet === null || !prevKeySet.has(key);
133
+ const prevSource = prevSourceMap?.get(key);
134
+ const sourceChanged = !isNew && prevSource != null && prevSource !== skill.source;
135
+ if (sourceChanged) {
136
+ return { id: skill.id, source: skill.source, status: "source-changed" };
137
+ }
138
+ return { id: skill.id, source: skill.source, status: isNew ? "added" : "unchanged" };
139
+ }
140
+ function classifyAgentDiffRow(agent, prevKeySet) {
141
+ const isNew = prevKeySet === null || !prevKeySet.has(agentSlotKey(agent.name, agent.scope));
142
+ return { name: agent.name, status: isNew ? "added" : "unchanged" };
143
+ }
144
+ function toRemovedSkillRow(skill) {
145
+ return { id: skill.id, source: skill.source, status: "removed" };
146
+ }
147
+ function toRemovedAgentRow(agent) {
148
+ return { name: agent.name, status: "removed" };
149
+ }
150
+
151
+ // src/cli/lib/wizard/build-step-logic.ts
152
+ var FRAMEWORK_CATEGORY_ID = "web-framework";
153
+ var WEB_DOMAIN_ID = "web";
154
+ function validateBuildStep(categories, selections) {
155
+ const emptyRequired = categories.find(
156
+ (category) => category.required && !selections[category.id]?.length
157
+ );
158
+ return emptyRequired ? {
159
+ valid: true,
160
+ message: `No skills selected in ${emptyRequired.displayName} (required category)`
161
+ } : { valid: true };
162
+ }
163
+ function getSelectedFrameworks(selections) {
164
+ return (selections[FRAMEWORK_CATEGORY_ID] ?? []).map((alias) => getSkillById(alias).id);
165
+ }
166
+ function isCompatibleWithSelectedFrameworks(skillId, selectedFrameworkIds) {
167
+ return isCompatibleWithSelections(getSkillById(skillId), selectedFrameworkIds);
168
+ }
169
+ function buildCategoriesForDomain(domain, allSelections, selections, installedSkillIds, skillConfigs, filterIncompatible) {
170
+ const selectedFrameworkIds = getSelectedFrameworks(selections);
171
+ const shouldFilter = filterIncompatible && domain === WEB_DOMAIN_ID && selectedFrameworkIds.length > 0;
172
+ const categories = sortBy(
173
+ typedValues(matrix.categories).filter((cat) => cat.domain === domain),
174
+ (cat) => cat.order ?? 0
175
+ );
176
+ const categoryRows = categories.map((cat) => {
177
+ const skillOptions = getAvailableSkills(cat.id, allSelections);
178
+ const filteredOptions = shouldFilter && cat.id !== FRAMEWORK_CATEGORY_ID ? skillOptions.filter(
179
+ (skill) => isCompatibleWithSelectedFrameworks(skill.id, selectedFrameworkIds)
180
+ ) : skillOptions;
181
+ const isExclusive = cat.exclusive ?? true;
182
+ const sortedOptions = sortBy(
183
+ filteredOptions,
184
+ (skill) => getSkillById(skill.id).displayName.toLowerCase()
185
+ );
186
+ const options = sortedOptions.map((skill) => {
187
+ const activeConfig = skillConfigs?.find((sc) => sc.id === skill.id && !sc.excluded);
188
+ const excludedConfig = skillConfigs?.find((sc) => sc.id === skill.id && sc.excluded);
189
+ const { secondaryScope } = deriveScopeBadges(activeConfig, excludedConfig);
190
+ return {
191
+ id: skill.id,
192
+ state: isExclusive && skill.advisoryState.status === "incompatible" ? { status: "normal" } : skill.advisoryState,
193
+ selected: skill.selected,
194
+ local: getSkillById(skill.id).local,
195
+ installed: installedSkillIds?.includes(skill.id) || false,
196
+ scope: activeConfig?.scope,
197
+ secondaryScope,
198
+ source: activeConfig?.source,
199
+ hasUnmetRequirements: skill.hasUnmetRequirements,
200
+ unmetRequirementsReason: skill.unmetRequirementsReason,
201
+ requiredBy: skill.selected ? void 0 : getUnmetRequiredBy(skill.id, allSelections)
202
+ };
203
+ });
204
+ return {
205
+ id: cat.id,
206
+ displayName: cat.displayName,
207
+ required: cat.required ?? false,
208
+ exclusive: cat.exclusive ?? true,
209
+ options
210
+ };
211
+ });
212
+ return categoryRows.filter((row) => row.options.length > 0);
213
+ }
214
+
215
+ // src/cli/lib/wizard/domain-order.ts
216
+ init_esm_shims();
217
+ function orderDomains(domains) {
218
+ const builtInSet = new Set(BUILT_IN_DOMAIN_ORDER);
219
+ return [
220
+ ...domains.filter((d) => !builtInSet.has(d)).sort(),
221
+ ...BUILT_IN_DOMAIN_ORDER.filter((d) => domains.includes(d))
222
+ ];
223
+ }
224
+
225
+ // src/cli/stores/wizard-store.ts
226
+ var TOAST_MESSAGES = {
227
+ GLOBAL_SKILLS_LOCKED: "Global skills cannot be changed from project scope",
228
+ ONLY_SKILL_IN_CATEGORY: "Cannot deselect the only skill in this category",
229
+ ALREADY_EJECTED_AT_GLOBAL: "Already exists as ejected skill at global scope",
230
+ GLOBAL_AGENTS_LOCKED: "Global agents cannot be changed from project scope"
231
+ };
232
+ function resolveEffectiveSource(...candidates) {
233
+ return candidates.find((source) => source !== void 0) ?? DEFAULT_PUBLIC_SOURCE_NAME;
234
+ }
235
+ function primarySourceName(skill) {
236
+ return skill?.availableSources?.find((s) => s.primary)?.name;
237
+ }
238
+ function createDefaultSkillConfig(id) {
239
+ const skill = matrix.skills[id];
240
+ const primarySource = primarySourceName(skill);
241
+ return { id, scope: "global", source: primarySource ?? DEFAULT_PUBLIC_SOURCE_NAME };
242
+ }
243
+ function findIncompatibleWebSkills(webSelections, skillConfigs) {
244
+ const frameworkSelections = webSelections[FRAMEWORK_CATEGORY_ID] ?? [];
245
+ if (frameworkSelections.length === 0) return /* @__PURE__ */ new Set();
246
+ const excludedIds = new Set(skillConfigs.filter((s) => s.excluded).map((s) => s.id));
247
+ const selectedFrameworkIds = frameworkSelections.map((alias) => getSkillById(alias).id);
248
+ return new Set(
249
+ flatMap(
250
+ typedEntries(webSelections),
251
+ ([cat, skills]) => cat === FRAMEWORK_CATEGORY_ID || !skills ? [] : skills.filter(
252
+ (id) => !excludedIds.has(id) && !isCompatibleWithSelectedFrameworks(id, selectedFrameworkIds)
253
+ )
254
+ )
255
+ );
256
+ }
257
+ function removeSkillsFromSelections(selections, toRemove) {
258
+ return typedFromEntries(
259
+ typedEntries(selections).map(([cat, skills]) => [
260
+ cat,
261
+ skills?.filter((id) => !toRemove.has(id)) ?? []
262
+ ])
263
+ );
264
+ }
265
+ function hasProjectActive(configs, id) {
266
+ return configs.some((sc) => sc.id === id && isActiveAt(sc, "project"));
267
+ }
268
+ function findGlobalActive(configs, id) {
269
+ return configs.find((sc) => sc.id === id && isActiveAt(sc, "global"));
270
+ }
271
+ function hasGlobalActive(configs, id) {
272
+ return findGlobalActive(configs, id) !== void 0;
273
+ }
274
+ function hasGlobalTombstone(configs, id) {
275
+ return configs.some((sc) => sc.id === id && isGlobalTombstone(sc));
276
+ }
277
+ function isDualScopePair(configs, id) {
278
+ return hasProjectActive(configs, id) && hasGlobalTombstone(configs, id);
279
+ }
280
+ function isGloballyLockedSkill(installed, liveConfigs, id) {
281
+ return hasGlobalActive(installed, id) || hasGlobalTombstone(installed, id) && hasGlobalActive(liveConfigs, id) || isDualScopePair(liveConfigs, id);
282
+ }
283
+ function wouldOverwriteGlobalEject(config, liveConfigs, installedSkillConfigs) {
284
+ if (config.scope !== "project" || config.source !== EJECT_SOURCE) return false;
285
+ const globalEjectInstalled = installedSkillConfigs?.some(
286
+ (sc) => sc.id === config.id && sc.scope === "global" && sc.source === EJECT_SOURCE && !sc.excluded
287
+ );
288
+ if (!globalEjectInstalled) return false;
289
+ return !liveConfigs.some((sc) => sc.id === config.id && sc.excluded);
290
+ }
291
+ function withActiveEntrySource(configs, id, scope, source) {
292
+ return configs.map(
293
+ (sc) => sc.id === id && !sc.excluded && sc.scope === scope ? { ...sc, source } : sc
294
+ );
295
+ }
296
+ function applySkillRemoval(configs, removedIds, installedSkillConfigs) {
297
+ const removed = removedIds instanceof Set ? removedIds : new Set(removedIds);
298
+ const installedIds = new Set((installedSkillConfigs ?? []).map((s) => s.id));
299
+ const survivesRemoval = (entry) => !isDualScopePair(configs, entry.id) && !isProjectOwned(entry) && installedIds.has(entry.id);
300
+ const retained = configs.filter((sc) => !removed.has(sc.id) || survivesRemoval(sc));
301
+ const resurfacedInheritedGlobals = [...removed].filter((id) => isDualScopePair(configs, id)).map((id) => ({
302
+ id,
303
+ scope: "global",
304
+ source: configs.find((sc) => sc.id === id && sc.scope === "global")?.source ?? DEFAULT_PUBLIC_SOURCE_NAME
305
+ }));
306
+ return [...retained, ...resurfacedInheritedGlobals];
307
+ }
308
+ function flattenCategorySelections(selections) {
309
+ return typedValues(selections).flat();
310
+ }
311
+ function collectSkillIdsFromSelections(selections) {
312
+ return new Set(flattenCategorySelections(selections));
313
+ }
314
+ function reconcileSkillConfigs(configs, added, removed, installedSkillConfigs, isEditingFromGlobalScope) {
315
+ const effectiveInstalled = isEditingFromGlobalScope ? null : installedSkillConfigs;
316
+ let result = applySkillRemoval(configs, removed, effectiveInstalled);
317
+ for (const id of added) {
318
+ if (!isEditingFromGlobalScope && hasGlobalTombstone(installedSkillConfigs ?? [], id) && !hasProjectActive(result, id)) {
319
+ const globalEntry = (installedSkillConfigs ?? []).find((sc) => sc.id === id && sc.scope === "global") ?? result.find((sc) => sc.id === id && sc.scope === "global");
320
+ const source = globalEntry?.source ?? DEFAULT_PUBLIC_SOURCE_NAME;
321
+ result = [
322
+ ...result.filter((sc) => sc.id !== id),
323
+ { id, scope: "project", source },
324
+ { id, scope: "global", excluded: true, source }
325
+ ];
326
+ continue;
327
+ }
328
+ const existingExcluded = result.find((sc) => sc.id === id && sc.excluded);
329
+ if (existingExcluded) {
330
+ result = result.map(
331
+ (sc) => sc.id === id && sc.excluded ? { ...sc, excluded: void 0 } : sc
332
+ );
333
+ } else if (!result.some((sc) => sc.id === id)) {
334
+ result = [...result, buildSkillConfigForId(id, installedSkillConfigs)];
335
+ }
336
+ }
337
+ return result;
338
+ }
339
+ function agentHasProjectActive(configs, name) {
340
+ return configs.some((ac) => ac.name === name && ac.scope === "project" && !ac.excluded);
341
+ }
342
+ function agentHasGlobalActive(configs, name) {
343
+ return configs.some((ac) => ac.name === name && ac.scope === "global" && !ac.excluded);
344
+ }
345
+ function agentHasGlobalTombstone(configs, name) {
346
+ return configs.some((ac) => ac.name === name && ac.scope === "global" && ac.excluded);
347
+ }
348
+ function isDualScopeAgentPair(configs, name) {
349
+ return agentHasProjectActive(configs, name) && agentHasGlobalTombstone(configs, name);
350
+ }
351
+ function collectTombstones(configs) {
352
+ return configs.filter((entry) => entry.excluded);
353
+ }
354
+ function applyAgentToggle(configs, agent, isSelected) {
355
+ if (isSelected) {
356
+ return configs.filter((ac) => ac.name !== agent);
357
+ }
358
+ const existingExcluded = configs.find((ac) => ac.name === agent && ac.excluded);
359
+ if (existingExcluded) {
360
+ return configs.map(
361
+ (ac) => ac.name === agent && ac.excluded ? { ...ac, excluded: void 0 } : ac
362
+ );
363
+ }
364
+ return [...configs, { name: agent, scope: "global" }];
365
+ }
366
+ function survivesRosterRebuild(agentConfig, roster) {
367
+ if (agentConfig.excluded) return true;
368
+ return !isProjectOwned(agentConfig) && !roster.has(agentConfig.name);
369
+ }
370
+ function restoreDualScopeAgent(selectedAgents, agentConfigs, agent) {
371
+ return {
372
+ selectedAgents: [...selectedAgents, agent],
373
+ agentConfigs: [
374
+ ...agentConfigs.filter((ac) => ac.name !== agent),
375
+ { name: agent, scope: "project" },
376
+ { name: agent, scope: "global", excluded: true }
377
+ ]
378
+ };
379
+ }
380
+ function nextSelectedAgents(selectedAgents, agent, flags) {
381
+ if (flags.isSelected) return selectedAgents.filter((a) => a !== agent);
382
+ if (flags.isInList) return selectedAgents;
383
+ return [...selectedAgents, agent];
384
+ }
385
+ function buildSkillConfigForId(id, savedConfigs) {
386
+ const saved = savedConfigs?.find((sc) => sc.id === id && !sc.excluded && sc.scope === "project") ?? savedConfigs?.find((sc) => sc.id === id && !sc.excluded);
387
+ const skill = matrix.skills[id];
388
+ const primarySource = primarySourceName(skill);
389
+ return {
390
+ id,
391
+ scope: saved?.scope ?? "global",
392
+ source: resolveEffectiveSource(saved?.source, primarySource)
393
+ };
394
+ }
395
+ function buildAgentConfigForName(name, savedConfigs) {
396
+ const saved = savedConfigs?.find((ac) => ac.name === name && !ac.excluded && ac.scope === "project") ?? savedConfigs?.find((ac) => ac.name === name && !ac.excluded);
397
+ return {
398
+ name,
399
+ scope: saved?.scope ?? "global",
400
+ // Model and effort are the user's deliberate choice, not something the roster re-derives —
401
+ // they survive the rebuild on the same terms as scope.
402
+ ...saved?.model !== void 0 && { model: saved.model },
403
+ ...saved?.effort !== void 0 && { effort: saved.effort }
404
+ };
405
+ }
406
+ function restoreSkillConfigs(existingConfigs, restoredIds) {
407
+ const restoredSet = new Set(restoredIds);
408
+ const existingIds = new Set(existingConfigs.map((sc) => sc.id));
409
+ const updated = existingConfigs.map(
410
+ (sc) => restoredSet.has(sc.id) && sc.excluded ? { ...sc, excluded: void 0 } : sc
411
+ );
412
+ const newConfigs = restoredIds.filter((id) => !existingIds.has(id)).map(createDefaultSkillConfig);
413
+ return [...updated, ...newConfigs];
414
+ }
415
+ var DOMAIN_AGENTS = {
416
+ web: [
417
+ "web-developer",
418
+ "web-reviewer",
419
+ "web-researcher",
420
+ "web-tester",
421
+ "web-pm",
422
+ "web-architecture"
423
+ ],
424
+ api: ["api-developer", "api-reviewer", "api-researcher"],
425
+ cli: ["cli-developer", "cli-tester", "cli-reviewer"]
426
+ };
427
+ var SOURCE_SORT_TIER_LOCAL = 1;
428
+ var SOURCE_SORT_TIER_SCOPED = 2;
429
+ var SOURCE_SORT_TIER_PUBLIC = 3;
430
+ var SOURCE_SORT_TIER_THIRD_PARTY = 4;
431
+ function getSourceSortTier(source) {
432
+ if (source.type === "local") return SOURCE_SORT_TIER_LOCAL;
433
+ if (source.primary) return SOURCE_SORT_TIER_SCOPED;
434
+ if (source.type === "public") return SOURCE_SORT_TIER_PUBLIC;
435
+ return SOURCE_SORT_TIER_THIRD_PARTY;
436
+ }
437
+ function resolveSkillForPopulation(skillId) {
438
+ const { skills } = matrix;
439
+ const skill = skills[skillId];
440
+ if (!skill?.category) {
441
+ warn(
442
+ `Installed skill '${skillId}' is missing from the marketplace \u2014 it may have been removed or renamed`
443
+ );
444
+ return null;
445
+ }
446
+ const domain = getCategoryDomain(skill.category);
447
+ if (!domain) {
448
+ warn(`Installed skill '${skillId}' has unknown category '${skill.category}' \u2014 skipping`);
449
+ return null;
450
+ }
451
+ const subcat = skill.category;
452
+ return { domain, subcat, techId: skillId };
453
+ }
454
+ function addToDomainSelections(selections, domain, category, skillId) {
455
+ const categorySelections = selections[domain] ??= {};
456
+ const skillList = categorySelections[category] ??= [];
457
+ if (skillList.includes(skillId)) return false;
458
+ skillList.push(skillId);
459
+ return true;
460
+ }
461
+ function buildBoundSkillOptions(boundSkills, alias, selectedSource) {
462
+ return boundSkills.filter((b) => b.boundTo === alias).map((bound) => ({
463
+ id: bound.sourceName,
464
+ selected: selectedSource === bound.sourceName,
465
+ installed: false
466
+ }));
467
+ }
468
+ function buildSkillSourceOptions(skill, selectedSource, boundSkills) {
469
+ const sortedSources = [...skill.availableSources || []].sort(
470
+ (a, b) => getSourceSortTier(a) - getSourceSortTier(b)
471
+ );
472
+ const baseOptions = sortedSources.length > 0 ? sortedSources.map((source) => ({
473
+ id: source.name,
474
+ selected: selectedSource === source.name,
475
+ installed: source.installed
476
+ })) : [
477
+ {
478
+ id: DEFAULT_PUBLIC_SOURCE_NAME,
479
+ selected: selectedSource === DEFAULT_PUBLIC_SOURCE_NAME,
480
+ installed: false
481
+ }
482
+ ];
483
+ const withEject = baseOptions.some((o) => o.id === EJECT_SOURCE) ? baseOptions : [
484
+ { id: EJECT_SOURCE, selected: selectedSource === EJECT_SOURCE, installed: false },
485
+ ...baseOptions
486
+ ];
487
+ return [...withEject, ...buildBoundSkillOptions(boundSkills, skill.slug, selectedSource)];
488
+ }
489
+ function collectRemovedInstalledEntries(installedSkillConfigs, skillConfigs) {
490
+ if (!installedSkillConfigs) return [];
491
+ const occupiedSlots = new Set(skillConfigs.map((sc) => skillSlotKey(sc.id, sc.scope)));
492
+ return installedSkillConfigs.filter(
493
+ (sc) => !sc.excluded && !occupiedSlots.has(skillSlotKey(sc.id, sc.scope)) && // A skill the marketplace no longer carries has nothing to render — hydration already
494
+ // skipped it into unresolvableSkillIds, and getSkillById would throw on it downstream.
495
+ !!matrix.skills[sc.id]
496
+ );
497
+ }
498
+ function collectInstalledSkillSlots(installedSkillConfigs) {
499
+ if (!installedSkillConfigs) return /* @__PURE__ */ new Set();
500
+ return new Set(installedSkillConfigs.map((sc) => skillSlotKey(sc.id, sc.scope)));
501
+ }
502
+ function addedSlotFlag(installedSkillSlots, id, scope) {
503
+ return installedSkillSlots.has(skillSlotKey(id, scope)) ? {} : { added: true };
504
+ }
505
+ function withSelectedSource(options, sourceId) {
506
+ return options.map((option) => ({ ...option, selected: option.id === sourceId }));
507
+ }
508
+ function resolveSkillRowInputs(id, skillConfigs, boundSkills) {
509
+ const skill = getSkillById(id);
510
+ const configEntry = skillConfigs.find((sc) => sc.id === skill.id);
511
+ const selectedSource = resolveEffectiveSource(
512
+ configEntry?.source,
513
+ skill.activeSource?.name,
514
+ primarySourceName(skill)
515
+ );
516
+ return {
517
+ skillId: skill.id,
518
+ configEntry,
519
+ options: buildSkillSourceOptions(skill, selectedSource, boundSkills)
520
+ };
521
+ }
522
+ function toPendingRemovalRow(skillId, options, removedInstalledEntry) {
523
+ return {
524
+ skillId,
525
+ options: withSelectedSource(options, removedInstalledEntry.source),
526
+ scope: removedInstalledEntry.scope,
527
+ disabled: true
528
+ };
529
+ }
530
+ function isSlotAlreadyRendered(rows, removedInstalledEntry) {
531
+ const slot = skillSlotKey(removedInstalledEntry.id, removedInstalledEntry.scope);
532
+ return rows.some((row) => skillSlotKey(row.skillId, row.scope) === slot);
533
+ }
534
+ function toLockedGlobalRow(skillId, options, installedSource, installedSkillSlots) {
535
+ return {
536
+ skillId,
537
+ options: withSelectedSource(options, installedSource),
538
+ scope: "global",
539
+ readOnly: true,
540
+ ...addedSlotFlag(installedSkillSlots, skillId, "global")
541
+ };
542
+ }
543
+ function classifySkillSourceRows(skillId, options, context) {
544
+ const { configEntry, installedSkillConfigs, isEditingFromGlobalScope, installedSkillSlots } = context;
545
+ const installedGlobalConfig = findGlobalActive(installedSkillConfigs ?? [], skillId);
546
+ const isExcludedGlobal = configEntry?.excluded && configEntry.scope === "global";
547
+ if (isExcludedGlobal && !isEditingFromGlobalScope) {
548
+ return [
549
+ toLockedGlobalRow(
550
+ skillId,
551
+ options,
552
+ installedGlobalConfig?.source ?? configEntry.source,
553
+ installedSkillSlots
554
+ )
555
+ ];
556
+ }
557
+ if (!isEditingFromGlobalScope && installedGlobalConfig && configEntry?.scope === "project") {
558
+ return [
559
+ toLockedGlobalRow(skillId, options, installedGlobalConfig.source, installedSkillSlots),
560
+ {
561
+ skillId,
562
+ options,
563
+ scope: "project",
564
+ ...addedSlotFlag(installedSkillSlots, skillId, "project")
565
+ }
566
+ ];
567
+ }
568
+ const readOnly = !isEditingFromGlobalScope && !!installedGlobalConfig;
569
+ return [
570
+ {
571
+ skillId,
572
+ options,
573
+ scope: configEntry?.scope,
574
+ ...readOnly ? { readOnly: true } : {},
575
+ ...addedSlotFlag(installedSkillSlots, skillId, configEntry?.scope)
576
+ }
577
+ ];
578
+ }
579
+ function sourceRowSortTier(row) {
580
+ if (row.scope === "global" && row.readOnly) return 0;
581
+ if (row.scope === "global") return 1;
582
+ return 2;
583
+ }
584
+ var WIZARD_STEP_ORDER = [
585
+ "stack",
586
+ "domains",
587
+ "build",
588
+ "sources",
589
+ "agents",
590
+ "confirm"
591
+ ];
592
+ var createInitialState = (overrides) => ({
593
+ step: "stack",
594
+ approach: null,
595
+ selectedStackId: null,
596
+ stackAction: null,
597
+ selectedDomains: [],
598
+ currentDomainIndex: 0,
599
+ domainSelections: {},
600
+ /** Snapshot of domainSelections from populateFromSkillIds, used to restore on domain re-toggle */
601
+ _stackDomainSelections: null,
602
+ showLabels: false,
603
+ filterIncompatible: false,
604
+ skillConfigs: [],
605
+ focusedSkillId: null,
606
+ unresolvableSkillIds: [],
607
+ customizeSources: false,
608
+ showSettings: false,
609
+ showInfo: false,
610
+ selectedAgents: [],
611
+ agentConfigs: [],
612
+ focusedAgentId: null,
613
+ boundSkills: [],
614
+ installedSkillConfigs: null,
615
+ installedAgentConfigs: null,
616
+ isInitMode: false,
617
+ isEditingFromGlobalScope: false,
618
+ toastMessage: null,
619
+ globalPreselections: null,
620
+ globalAgentPreselections: null,
621
+ history: [],
622
+ ...overrides
623
+ });
624
+ var useWizardStore = create((set, get) => ({
625
+ ...createInitialState(),
626
+ setStep: (step) => {
627
+ set((state) => ({
628
+ step,
629
+ history: [...state.history, state.step]
630
+ }));
631
+ if (step === "build") get().seedFocusedSkillForActiveDomain();
632
+ },
633
+ setApproach: (approach) => set({ approach }),
634
+ selectStack: (stackId) => set({
635
+ selectedStackId: stackId,
636
+ domainSelections: {},
637
+ _stackDomainSelections: null,
638
+ selectedDomains: [],
639
+ skillConfigs: [],
640
+ selectedAgents: [],
641
+ agentConfigs: [],
642
+ boundSkills: [],
643
+ currentDomainIndex: 0,
644
+ stackAction: null
645
+ }),
646
+ setStackAction: (action) => set({ stackAction: action }),
647
+ populateFromSkillIds: (skillIds, savedConfigs) => set(() => {
648
+ const domainSelections = {};
649
+ const resolvedSkillIds = [];
650
+ const unresolvableSkillIds = [];
651
+ for (const skillId of skillIds) {
652
+ const resolved = resolveSkillForPopulation(skillId);
653
+ if (!resolved) {
654
+ unresolvableSkillIds.push(skillId);
655
+ continue;
656
+ }
657
+ const { domain, subcat, techId } = resolved;
658
+ if (addToDomainSelections(domainSelections, domain, subcat, techId)) {
659
+ resolvedSkillIds.push(techId);
660
+ }
661
+ }
662
+ if (unresolvableSkillIds.length > 0) {
663
+ warn(
664
+ `${unresolvableSkillIds.length} installed skill(s) could not be resolved and were skipped`
665
+ );
666
+ }
667
+ const selectedDomains = orderDomains(typedKeys(domainSelections));
668
+ const skillConfigs = resolvedSkillIds.map(
669
+ (id) => buildSkillConfigForId(id, savedConfigs)
670
+ );
671
+ const excludedConfigs = collectTombstones(savedConfigs ?? []);
672
+ return {
673
+ domainSelections,
674
+ _stackDomainSelections: structuredClone(domainSelections),
675
+ selectedDomains,
676
+ skillConfigs: [...skillConfigs, ...excludedConfigs],
677
+ unresolvableSkillIds
678
+ };
679
+ }),
680
+ toggleDomain: (domain) => set((state) => {
681
+ const isSelected = state.selectedDomains.includes(domain);
682
+ if (isSelected) {
683
+ const { [domain]: _removed, ...remainingSelections } = state.domainSelections;
684
+ const removedSkillIds = _removed ? collectSkillIdsFromSelections(_removed) : /* @__PURE__ */ new Set();
685
+ return {
686
+ selectedDomains: state.selectedDomains.filter((d) => d !== domain),
687
+ domainSelections: remainingSelections,
688
+ // Global-scope edit: no overlay, so deselecting a domain uninstalls its skills cleanly
689
+ // rather than tombstoning them in the global config (D-233 Scenario C).
690
+ skillConfigs: applySkillRemoval(
691
+ state.skillConfigs,
692
+ removedSkillIds,
693
+ state.isEditingFromGlobalScope ? null : state.installedSkillConfigs
694
+ )
695
+ };
696
+ }
697
+ const stackSelections = state._stackDomainSelections?.[domain];
698
+ if (stackSelections) {
699
+ const restoredSkillIds = [...collectSkillIdsFromSelections(stackSelections)];
700
+ return {
701
+ selectedDomains: orderDomains([...state.selectedDomains, domain]),
702
+ domainSelections: {
703
+ ...state.domainSelections,
704
+ [domain]: structuredClone(stackSelections)
705
+ },
706
+ skillConfigs: restoreSkillConfigs(state.skillConfigs, restoredSkillIds)
707
+ };
708
+ }
709
+ return {
710
+ selectedDomains: orderDomains([...state.selectedDomains, domain])
711
+ };
712
+ }),
713
+ toggleTechnology: (domain, category, technology, exclusive) => set((state) => {
714
+ const installed = state.installedSkillConfigs ?? [];
715
+ const currentSelections = state.domainSelections[domain]?.[category] || [];
716
+ const isSelected = currentSelections.includes(technology);
717
+ const isGlobalLocked = isSelected ? isGloballyLockedSkill(installed, state.skillConfigs, technology) : hasGlobalActive(installed, technology);
718
+ if (isGlobalLocked && !state.isEditingFromGlobalScope) {
719
+ return { toastMessage: TOAST_MESSAGES.GLOBAL_SKILLS_LOCKED };
720
+ }
721
+ if (isSelected) {
722
+ const categoryDef = matrix.categories[category];
723
+ if (categoryDef?.exclusive && categoryDef?.required) {
724
+ const categorySkillCount = typedValues(matrix.skills).filter(
725
+ (s) => s.category === category
726
+ ).length;
727
+ if (categorySkillCount <= 1) {
728
+ return { toastMessage: TOAST_MESSAGES.ONLY_SKILL_IN_CATEGORY };
729
+ }
730
+ }
731
+ }
732
+ if (exclusive && !isSelected) {
733
+ const wouldDropLockedSkill = currentSelections.some(
734
+ (selectedId) => isGloballyLockedSkill(installed, state.skillConfigs, selectedId)
735
+ );
736
+ if (wouldDropLockedSkill && !state.isEditingFromGlobalScope) {
737
+ return { toastMessage: TOAST_MESSAGES.GLOBAL_SKILLS_LOCKED };
738
+ }
739
+ }
740
+ let newSelections;
741
+ if (exclusive) {
742
+ newSelections = isSelected ? [] : [technology];
743
+ } else {
744
+ newSelections = isSelected ? currentSelections.filter((t) => t !== technology) : [...currentSelections, technology];
745
+ }
746
+ const removed = currentSelections.filter((id) => !newSelections.includes(id));
747
+ const added = newSelections.filter((id) => !currentSelections.includes(id));
748
+ const skillConfigs = reconcileSkillConfigs(
749
+ state.skillConfigs,
750
+ added,
751
+ removed,
752
+ state.installedSkillConfigs,
753
+ state.isEditingFromGlobalScope
754
+ );
755
+ const stillActiveAfterRemoval = isSelected && !newSelections.includes(technology) && (hasProjectActive(skillConfigs, technology) || hasGlobalActive(skillConfigs, technology));
756
+ const resolvedSelections = stillActiveAfterRemoval ? [...newSelections, technology] : newSelections;
757
+ return {
758
+ skillConfigs,
759
+ domainSelections: {
760
+ ...state.domainSelections,
761
+ [domain]: {
762
+ ...state.domainSelections[domain],
763
+ [category]: resolvedSelections
764
+ }
765
+ }
766
+ };
767
+ }),
768
+ nextDomain: () => {
769
+ const state = get();
770
+ if (state.currentDomainIndex < state.selectedDomains.length - 1) {
771
+ set({
772
+ currentDomainIndex: state.currentDomainIndex + 1
773
+ });
774
+ get().seedFocusedSkillForActiveDomain();
775
+ return true;
776
+ }
777
+ return false;
778
+ },
779
+ prevDomain: () => {
780
+ const state = get();
781
+ if (state.currentDomainIndex > 0) {
782
+ set({
783
+ currentDomainIndex: state.currentDomainIndex - 1
784
+ });
785
+ get().seedFocusedSkillForActiveDomain();
786
+ return true;
787
+ }
788
+ return false;
789
+ },
790
+ setCurrentDomainIndex: (index) => {
791
+ const state = get();
792
+ if (index >= 0 && index < state.selectedDomains.length) {
793
+ set({ currentDomainIndex: index });
794
+ get().seedFocusedSkillForActiveDomain();
795
+ }
796
+ },
797
+ toggleShowLabels: () => set((state) => ({ showLabels: !state.showLabels })),
798
+ toggleFilterIncompatible: () => set((state) => {
799
+ if (state.filterIncompatible) return { filterIncompatible: false };
800
+ const webSelections = state.domainSelections.web;
801
+ if (!webSelections) return { filterIncompatible: true };
802
+ const removed = findIncompatibleWebSkills(webSelections, state.skillConfigs);
803
+ if (removed.size === 0) return { filterIncompatible: true };
804
+ const installed = state.installedSkillConfigs ?? [];
805
+ const removesLockedGlobal = [...removed].some(
806
+ (id) => hasGlobalActive(installed, id) || hasGlobalTombstone(installed, id) && hasGlobalActive(state.skillConfigs, id)
807
+ );
808
+ if (removesLockedGlobal && !state.isEditingFromGlobalScope) {
809
+ return { toastMessage: TOAST_MESSAGES.GLOBAL_SKILLS_LOCKED };
810
+ }
811
+ return {
812
+ filterIncompatible: true,
813
+ domainSelections: {
814
+ ...state.domainSelections,
815
+ web: removeSkillsFromSelections(webSelections, removed)
816
+ },
817
+ // Global-scope edit: clean uninstall, no tombstone (D-233 Scenario C).
818
+ skillConfigs: applySkillRemoval(
819
+ state.skillConfigs,
820
+ removed,
821
+ state.isEditingFromGlobalScope ? null : state.installedSkillConfigs
822
+ )
823
+ };
824
+ }),
825
+ deriveInstallMode: () => {
826
+ const { skillConfigs } = get();
827
+ return deriveInstallMode(skillConfigs);
828
+ },
829
+ toggleSkillScope: (skillId) => set((state) => {
830
+ if (state.isEditingFromGlobalScope) return state;
831
+ const config = state.skillConfigs.find((sc) => sc.id === skillId && !sc.excluded);
832
+ if (!config) return state;
833
+ if (wouldOverwriteGlobalEject(config, state.skillConfigs, state.installedSkillConfigs)) {
834
+ return { toastMessage: TOAST_MESSAGES.ALREADY_EJECTED_AT_GLOBAL };
835
+ }
836
+ const wasInstalledGlobally = state.installedSkillConfigs?.some((sc) => sc.id === skillId && sc.scope === "global") ?? false;
837
+ const newScope = config.scope === "project" ? "global" : "project";
838
+ const rescoped = state.skillConfigs.map(
839
+ (sc) => sc.id === skillId && !sc.excluded ? { ...sc, scope: newScope } : sc
840
+ );
841
+ if (newScope === "project") {
842
+ const needsTombstone = wasInstalledGlobally && !rescoped.some((sc) => sc.id === skillId && sc.excluded);
843
+ return {
844
+ skillConfigs: needsTombstone ? [
845
+ ...rescoped,
846
+ { id: skillId, scope: "global", excluded: true, source: config.source }
847
+ ] : rescoped
848
+ };
849
+ }
850
+ return { skillConfigs: rescoped.filter((sc) => !(sc.id === skillId && sc.excluded)) };
851
+ }),
852
+ setFocusedSkillId: (id) => set({ focusedSkillId: id }),
853
+ seedFocusedSkillForActiveDomain: () => {
854
+ const state = get();
855
+ const domain = state.getCurrentDomain() ?? FALLBACK_DOMAIN;
856
+ const categories = buildCategoriesForDomain(
857
+ domain,
858
+ state.getAllSelectedTechnologies(),
859
+ state.domainSelections[domain] ?? {},
860
+ void 0,
861
+ state.skillConfigs,
862
+ state.filterIncompatible
863
+ );
864
+ set({ focusedSkillId: categories[0]?.options[0]?.id ?? null });
865
+ },
866
+ setSourceSelection: (skillId, sourceId, scope) => set((state) => {
867
+ if (!skillId) {
868
+ warn("Ignoring setSourceSelection call with empty skillId");
869
+ return state;
870
+ }
871
+ if (!sourceId) {
872
+ warn(`Ignoring setSourceSelection call with empty sourceId for skill '${skillId}'`);
873
+ return state;
874
+ }
875
+ return {
876
+ skillConfigs: withActiveEntrySource(state.skillConfigs, skillId, scope, sourceId)
877
+ };
878
+ }),
879
+ setCustomizeSources: (customize) => set({ customizeSources: customize }),
880
+ toggleSettings: () => set((state) => ({ showSettings: !state.showSettings })),
881
+ toggleInfo: () => set((state) => ({ showInfo: !state.showInfo })),
882
+ setToastMessage: (message) => set({ toastMessage: message }),
883
+ bindSkill: (skill) => set((state) => {
884
+ const exists = state.boundSkills.some(
885
+ (b) => b.id === skill.id && b.sourceUrl === skill.sourceUrl
886
+ );
887
+ if (exists) {
888
+ warn(`Skill '${skill.id}' from '${skill.sourceUrl}' is already bound \u2014 skipping duplicate`);
889
+ return state;
890
+ }
891
+ return { boundSkills: [...state.boundSkills, skill] };
892
+ }),
893
+ goBack: () => set((state) => {
894
+ if (state.history.length === 0) return state;
895
+ const history = [...state.history];
896
+ const previousStep = history.pop();
897
+ return {
898
+ step: previousStep,
899
+ history
900
+ };
901
+ }),
902
+ toggleAgent: (agent) => set((state) => {
903
+ const installed = state.installedAgentConfigs ?? [];
904
+ const isDualScopePairRow = !state.isEditingFromGlobalScope && isDualScopeAgentPair(state.agentConfigs, agent);
905
+ if (isDualScopePairRow) {
906
+ return { toastMessage: TOAST_MESSAGES.GLOBAL_AGENTS_LOCKED };
907
+ }
908
+ const isInheritedGlobalReselect = !state.isEditingFromGlobalScope && agentHasGlobalActive(state.agentConfigs, agent) && !agentHasProjectActive(state.agentConfigs, agent) && !state.selectedAgents.includes(agent) && agentHasGlobalTombstone(installed, agent);
909
+ if (isInheritedGlobalReselect) {
910
+ return restoreDualScopeAgent(state.selectedAgents, state.agentConfigs, agent);
911
+ }
912
+ const isActiveGlobal = agentHasGlobalActive(installed, agent) || agentHasGlobalTombstone(installed, agent) && agentHasGlobalActive(state.agentConfigs, agent);
913
+ if (isActiveGlobal && !state.isEditingFromGlobalScope) {
914
+ return { toastMessage: TOAST_MESSAGES.GLOBAL_AGENTS_LOCKED };
915
+ }
916
+ const isInList = state.selectedAgents.includes(agent);
917
+ const hasExcludedTombstone = state.agentConfigs.some(
918
+ (ac) => ac.name === agent && ac.excluded
919
+ );
920
+ const isSelected = isInList && !hasExcludedTombstone;
921
+ return {
922
+ selectedAgents: nextSelectedAgents(state.selectedAgents, agent, { isSelected, isInList }),
923
+ agentConfigs: applyAgentToggle(state.agentConfigs, agent, isSelected)
924
+ };
925
+ }),
926
+ toggleAgentScope: (agentName) => set((state) => {
927
+ if (state.isEditingFromGlobalScope) return state;
928
+ const config = state.agentConfigs.find((ac) => ac.name === agentName && !ac.excluded);
929
+ if (!config) return state;
930
+ const wasInstalledGlobally = state.installedAgentConfigs?.some((ac) => ac.name === agentName && ac.scope === "global") ?? false;
931
+ const newScope = config.scope === "project" ? "global" : "project";
932
+ const rescoped = state.agentConfigs.map(
933
+ (ac) => ac.name === agentName && !ac.excluded ? { ...ac, scope: newScope } : ac
934
+ );
935
+ if (newScope === "project") {
936
+ const needsTombstone = wasInstalledGlobally && !rescoped.some((ac) => ac.name === agentName && ac.excluded);
937
+ return {
938
+ agentConfigs: needsTombstone ? [...rescoped, { name: agentName, scope: "global", excluded: true }] : rescoped
939
+ };
940
+ }
941
+ return { agentConfigs: rescoped.filter((ac) => !(ac.name === agentName && ac.excluded)) };
942
+ }),
943
+ setFocusedAgentId: (id) => set({ focusedAgentId: id }),
944
+ preselectAgentsFromDomains: () => set((state) => {
945
+ const sorted = state.selectedDomains.flatMap((domain) => DOMAIN_AGENTS[domain] ?? []).sort();
946
+ const roster = new Set(sorted);
947
+ const merged = sorted.map((name) => buildAgentConfigForName(name, state.agentConfigs));
948
+ const retained = state.agentConfigs.filter((ac) => survivesRosterRebuild(ac, roster));
949
+ return {
950
+ selectedAgents: sorted,
951
+ agentConfigs: [...merged, ...retained]
952
+ };
953
+ }),
954
+ preselectAgentsFromStack: (stackAgents) => set((state) => {
955
+ const savedConfigs = state.globalAgentPreselections?.configs ?? [];
956
+ const globalAgents = state.globalAgentPreselections?.agents ?? [];
957
+ const mergedAgents = [.../* @__PURE__ */ new Set([...stackAgents, ...globalAgents])].sort();
958
+ const merged = mergedAgents.map((name) => buildAgentConfigForName(name, savedConfigs));
959
+ const excludedConfigs = collectTombstones(savedConfigs);
960
+ return {
961
+ selectedAgents: mergedAgents,
962
+ agentConfigs: [...merged, ...excludedConfigs]
963
+ };
964
+ }),
965
+ reset: () => set(createInitialState()),
966
+ getAllSelectedTechnologies: () => {
967
+ return typedValues(get().domainSelections).flatMap(flattenCategorySelections);
968
+ },
969
+ getSelectedTechnologiesPerDomain: () => {
970
+ const entries = typedEntries(get().domainSelections).map(([domain, domainSel]) => [domain, flattenCategorySelections(domainSel)]).filter(([, techs]) => techs.length > 0);
971
+ return typedFromEntries(entries);
972
+ },
973
+ getCurrentDomain: () => {
974
+ const state = get();
975
+ return state.selectedDomains[state.currentDomainIndex] || null;
976
+ },
977
+ getTechnologyCount: () => {
978
+ return get().getAllSelectedTechnologies().length;
979
+ },
980
+ getStepProgress: () => {
981
+ const state = get();
982
+ const isStackDefaults = state.approach === "stack" && !!state.selectedStackId && state.stackAction === "defaults";
983
+ const skippedSteps = isStackDefaults ? ["build", "sources", "agents"] : [];
984
+ const precedingSteps = WIZARD_STEP_ORDER.slice(0, WIZARD_STEP_ORDER.indexOf(state.step));
985
+ const completedSteps = precedingSteps.filter((step) => !skippedSteps.includes(step));
986
+ return { completedSteps, skippedSteps };
987
+ },
988
+ canGoToNextDomain: () => {
989
+ const state = get();
990
+ return state.currentDomainIndex < state.selectedDomains.length - 1;
991
+ },
992
+ canGoToPreviousDomain: () => {
993
+ const state = get();
994
+ return state.currentDomainIndex > 0;
995
+ },
996
+ setAllSourcesEject: () => {
997
+ set((state) => ({
998
+ // Never touch tombstones — a dual-scope skill's excluded global tombstone keeps describing
999
+ // the masked global install. The bulk set-all applies only to active entries, mirroring the
1000
+ // D-262 per-skill setSkillSource/setSourceSelection guard (D-265).
1001
+ skillConfigs: state.skillConfigs.map(
1002
+ (sc) => sc.excluded ? sc : { ...sc, source: EJECT_SOURCE }
1003
+ )
1004
+ }));
1005
+ },
1006
+ setAllSourcesPlugin: () => {
1007
+ set((state) => ({
1008
+ // Never touch tombstones (see setAllSourcesEject) — the excluded global tombstone keeps its
1009
+ // marketplace source describing the masked global install (D-265).
1010
+ skillConfigs: state.skillConfigs.map((sc) => {
1011
+ if (sc.excluded) return sc;
1012
+ const marketplaceSource = getSkillById(sc.id).availableSources?.find(
1013
+ (source) => source.type !== "local"
1014
+ );
1015
+ return marketplaceSource ? { ...sc, source: marketplaceSource.name } : sc;
1016
+ })
1017
+ }));
1018
+ },
1019
+ buildSourceRows: () => {
1020
+ const state = get();
1021
+ const selectedTechnologies = get().getAllSelectedTechnologies();
1022
+ const { skillConfigs, boundSkills } = state;
1023
+ const selectedSet = new Set(selectedTechnologies);
1024
+ const inheritedSkillIds = skillConfigs.filter((sc) => !sc.excluded && !selectedSet.has(sc.id)).map((sc) => sc.id);
1025
+ const allActiveIds = /* @__PURE__ */ new Set([...inheritedSkillIds, ...selectedTechnologies]);
1026
+ const excludedGlobalIds = skillConfigs.filter((sc) => isGlobalTombstone(sc) && !allActiveIds.has(sc.id)).map((sc) => sc.id);
1027
+ const liveSkillIds = [...inheritedSkillIds, ...selectedTechnologies, ...excludedGlobalIds];
1028
+ const installedSkillSlots = collectInstalledSkillSlots(state.installedSkillConfigs);
1029
+ const resolveRowInputs = (id) => resolveSkillRowInputs(id, skillConfigs, boundSkills);
1030
+ const liveRows = liveSkillIds.flatMap((id) => {
1031
+ const { skillId, configEntry, options } = resolveRowInputs(id);
1032
+ return classifySkillSourceRows(skillId, options, {
1033
+ configEntry,
1034
+ installedSkillConfigs: state.installedSkillConfigs,
1035
+ isEditingFromGlobalScope: state.isEditingFromGlobalScope,
1036
+ installedSkillSlots
1037
+ });
1038
+ });
1039
+ const pendingRemovalRows = collectRemovedInstalledEntries(
1040
+ state.installedSkillConfigs,
1041
+ skillConfigs
1042
+ ).filter((entry) => !isSlotAlreadyRendered(liveRows, entry)).map((entry) => {
1043
+ const { skillId, options } = resolveRowInputs(entry.id);
1044
+ return toPendingRemovalRow(skillId, options, entry);
1045
+ });
1046
+ const rows = [...liveRows, ...pendingRemovalRows];
1047
+ rows.sort((a, b) => sourceRowSortTier(a) - sourceRowSortTier(b));
1048
+ return rows;
1049
+ }
1050
+ }));
1051
+ function hydrateWizardStore(options) {
1052
+ useWizardStore.setState(createInitialState());
1053
+ const { initialStep } = options;
1054
+ const isEditFlow = initialStep !== void 0;
1055
+ if (isEditFlow) {
1056
+ hydrateForEdit(initialStep, options);
1057
+ } else {
1058
+ hydrateForInit(options);
1059
+ }
1060
+ }
1061
+ function hydrateForEdit(initialStep, options) {
1062
+ const {
1063
+ initialDomains,
1064
+ initialAgents,
1065
+ installedSkillIds,
1066
+ installedSkillConfigs,
1067
+ installedAgentConfigs,
1068
+ isEditingFromGlobalScope
1069
+ } = options;
1070
+ if (installedSkillIds?.length) {
1071
+ useWizardStore.getState().populateFromSkillIds(installedSkillIds, installedSkillConfigs);
1072
+ }
1073
+ useWizardStore.setState({
1074
+ isInitMode: false,
1075
+ // Jump directly to initialStep with empty history. The user is starting
1076
+ // fresh at this step — no prior steps to navigate back through.
1077
+ step: initialStep,
1078
+ history: [],
1079
+ approach: "scratch",
1080
+ // Saved domains/agents from config override what populateFromSkillIds derived.
1081
+ ...initialDomains?.length ? { selectedDomains: initialDomains, currentDomainIndex: 0 } : {},
1082
+ ...initialAgents?.length ? { selectedAgents: initialAgents } : {},
1083
+ ...initialAgents?.length && installedAgentConfigs?.length ? { agentConfigs: installedAgentConfigs } : {},
1084
+ // Snapshot installed configs for diff rendering in SkillAgentSummary
1085
+ ...installedSkillConfigs?.length || installedAgentConfigs?.length ? {
1086
+ installedSkillConfigs: installedSkillConfigs ?? null,
1087
+ installedAgentConfigs: installedAgentConfigs ?? null
1088
+ } : {},
1089
+ ...isEditingFromGlobalScope ? { isEditingFromGlobalScope: true } : {}
1090
+ });
1091
+ useWizardStore.getState().seedFocusedSkillForActiveDomain();
1092
+ }
1093
+ function hydrateForInit(options) {
1094
+ const {
1095
+ initialDomains,
1096
+ initialAgents,
1097
+ installedSkillConfigs,
1098
+ installedAgentConfigs,
1099
+ isEditingFromGlobalScope
1100
+ } = options;
1101
+ useWizardStore.setState({
1102
+ isInitMode: true,
1103
+ ...initialDomains?.length ? { selectedDomains: initialDomains, currentDomainIndex: 0 } : {},
1104
+ ...initialAgents?.length ? { selectedAgents: initialAgents } : {},
1105
+ ...initialAgents?.length && installedAgentConfigs?.length ? { agentConfigs: installedAgentConfigs } : {},
1106
+ // Snapshot installed configs for diff rendering in SkillAgentSummary
1107
+ ...installedSkillConfigs?.length || installedAgentConfigs?.length ? {
1108
+ installedSkillConfigs: installedSkillConfigs ?? null,
1109
+ installedAgentConfigs: installedAgentConfigs ?? null
1110
+ } : {},
1111
+ ...isEditingFromGlobalScope ? { isEditingFromGlobalScope: true } : {},
1112
+ ...installedSkillConfigs?.length ? { globalPreselections: installedSkillConfigs } : {},
1113
+ ...initialAgents?.length || installedAgentConfigs?.length ? {
1114
+ globalAgentPreselections: {
1115
+ agents: initialAgents ?? [],
1116
+ configs: installedAgentConfigs ?? []
1117
+ }
1118
+ } : {}
1119
+ });
1120
+ useWizardStore.getState().seedFocusedSkillForActiveDomain();
1121
+ }
1122
+
1123
+ export {
1124
+ computeScopeDiff,
1125
+ formatScopeTag,
1126
+ deriveScopeBadges,
1127
+ validateBuildStep,
1128
+ buildCategoriesForDomain,
1129
+ orderDomains,
1130
+ WIZARD_STEP_ORDER,
1131
+ createInitialState,
1132
+ useWizardStore,
1133
+ hydrateWizardStore
1134
+ };
1135
+ //# sourceMappingURL=chunk-MC5DUZ3V.js.map