agents-inc 0.149.2 → 0.151.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 +2287 -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-3XFUQ6OL.js +68 -0
  12. package/dist/chunk-3XFUQ6OL.js.map +1 -0
  13. package/dist/chunk-3YGUHWLR.js +258 -0
  14. package/dist/chunk-3YGUHWLR.js.map +1 -0
  15. package/dist/chunk-44LLPS2N.js +1135 -0
  16. package/dist/chunk-44LLPS2N.js.map +1 -0
  17. package/dist/chunk-4R6PGHQQ.js +300 -0
  18. package/dist/chunk-4R6PGHQQ.js.map +1 -0
  19. package/dist/chunk-5V2O6C3T.js +112 -0
  20. package/dist/chunk-5V2O6C3T.js.map +1 -0
  21. package/dist/chunk-6RBQBOBS.js +287 -0
  22. package/dist/chunk-6RBQBOBS.js.map +1 -0
  23. package/dist/chunk-7QIHKQL5.js +181 -0
  24. package/dist/chunk-7QIHKQL5.js.map +1 -0
  25. package/dist/chunk-BNE4HHIH.js +28 -0
  26. package/dist/chunk-BNE4HHIH.js.map +1 -0
  27. package/dist/chunk-C55DN7GE.js +35 -0
  28. package/dist/chunk-C55DN7GE.js.map +1 -0
  29. package/dist/chunk-DAG2ULNF.js +125 -0
  30. package/dist/chunk-DAG2ULNF.js.map +1 -0
  31. package/dist/chunk-DG2NGZ7S.js +10929 -0
  32. package/dist/chunk-DG2NGZ7S.js.map +1 -0
  33. package/dist/chunk-DIBCRIMR.js +36 -0
  34. package/dist/chunk-DIBCRIMR.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-EKWAUOQB.js +96 -0
  38. package/dist/chunk-EKWAUOQB.js.map +1 -0
  39. package/dist/chunk-ES3NJZON.js +31 -0
  40. package/dist/chunk-ES3NJZON.js.map +1 -0
  41. package/dist/chunk-EVXG3X6G.js +179 -0
  42. package/dist/chunk-EVXG3X6G.js.map +1 -0
  43. package/dist/chunk-EZ7STXUV.js +349 -0
  44. package/dist/chunk-EZ7STXUV.js.map +1 -0
  45. package/dist/chunk-FYPUUYSG.js +31 -0
  46. package/dist/chunk-FYPUUYSG.js.map +1 -0
  47. package/dist/chunk-GYG5SE2D.js +81 -0
  48. package/dist/chunk-GYG5SE2D.js.map +1 -0
  49. package/dist/chunk-I3XKEGHM.js +16383 -0
  50. package/dist/chunk-I3XKEGHM.js.map +1 -0
  51. package/dist/chunk-IHO75PMZ.js +40 -0
  52. package/dist/chunk-IHO75PMZ.js.map +1 -0
  53. package/dist/chunk-IOJR5TOY.js +47 -0
  54. package/dist/chunk-IOJR5TOY.js.map +1 -0
  55. package/dist/chunk-K3OU6TGX.js +77 -0
  56. package/dist/chunk-K3OU6TGX.js.map +1 -0
  57. package/dist/chunk-KIR7VYQD.js +63 -0
  58. package/dist/chunk-KIR7VYQD.js.map +1 -0
  59. package/dist/chunk-KOPEM3Q7.js +27 -0
  60. package/dist/chunk-KOPEM3Q7.js.map +1 -0
  61. package/dist/chunk-KSZ6PCY4.js +43 -0
  62. package/dist/chunk-KSZ6PCY4.js.map +1 -0
  63. package/dist/chunk-LAXAQ3PZ.js +235 -0
  64. package/dist/chunk-LAXAQ3PZ.js.map +1 -0
  65. package/dist/chunk-LYYXX2W5.js +87 -0
  66. package/dist/chunk-LYYXX2W5.js.map +1 -0
  67. package/dist/chunk-NGLQ5W7U.js +339 -0
  68. package/dist/chunk-NGLQ5W7U.js.map +1 -0
  69. package/dist/chunk-NHCGC6DG.js +111 -0
  70. package/dist/chunk-NHCGC6DG.js.map +1 -0
  71. package/dist/chunk-NIKUMXE7.js +24 -0
  72. package/dist/chunk-NIKUMXE7.js.map +1 -0
  73. package/dist/chunk-NM3EDGB5.js +300 -0
  74. package/dist/chunk-NM3EDGB5.js.map +1 -0
  75. package/dist/chunk-O5ASLZ2K.js +270 -0
  76. package/dist/chunk-O5ASLZ2K.js.map +1 -0
  77. package/dist/chunk-OJIESW5B.js +174 -0
  78. package/dist/chunk-OJIESW5B.js.map +1 -0
  79. package/dist/chunk-OZZGXBCN.js +15 -0
  80. package/dist/chunk-OZZGXBCN.js.map +1 -0
  81. package/dist/chunk-P3PN5SVI.js +27 -0
  82. package/dist/chunk-P3PN5SVI.js.map +1 -0
  83. package/dist/chunk-P56WJ5FA.js +50 -0
  84. package/dist/chunk-P56WJ5FA.js.map +1 -0
  85. package/dist/chunk-PG4G4IIK.js +24 -0
  86. package/dist/chunk-PG4G4IIK.js.map +1 -0
  87. package/dist/chunk-PV2HNW4I.js +382 -0
  88. package/dist/chunk-PV2HNW4I.js.map +1 -0
  89. package/dist/chunk-QQLRX4KI.js +41 -0
  90. package/dist/chunk-QQLRX4KI.js.map +1 -0
  91. package/dist/chunk-QTFQEYDA.js +789 -0
  92. package/dist/chunk-QTFQEYDA.js.map +1 -0
  93. package/dist/chunk-RBHYLCUB.js +31 -0
  94. package/dist/chunk-RBHYLCUB.js.map +1 -0
  95. package/dist/chunk-SHHOMVWC.js +62 -0
  96. package/dist/chunk-SHHOMVWC.js.map +1 -0
  97. package/dist/chunk-SI5FOARI.js +42 -0
  98. package/dist/chunk-SI5FOARI.js.map +1 -0
  99. package/dist/chunk-SYUOXSPU.js +510 -0
  100. package/dist/chunk-SYUOXSPU.js.map +1 -0
  101. package/dist/chunk-THKIOI32.js +939 -0
  102. package/dist/chunk-THKIOI32.js.map +1 -0
  103. package/dist/chunk-TVHRMRD3.js +6014 -0
  104. package/dist/chunk-TVHRMRD3.js.map +1 -0
  105. package/dist/chunk-TYJLR32W.js +128 -0
  106. package/dist/chunk-TYJLR32W.js.map +1 -0
  107. package/dist/chunk-UFURYGD3.js +20 -0
  108. package/dist/chunk-UFURYGD3.js.map +1 -0
  109. package/dist/chunk-UTFN6UJS.js +253 -0
  110. package/dist/chunk-UTFN6UJS.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-WFWCZEMS.js +92 -0
  118. package/dist/chunk-WFWCZEMS.js.map +1 -0
  119. package/dist/chunk-WK4J2CHH.js +430 -0
  120. package/dist/chunk-WK4J2CHH.js.map +1 -0
  121. package/dist/chunk-XA57SX4T.js +115 -0
  122. package/dist/chunk-XA57SX4T.js.map +1 -0
  123. package/dist/chunk-Y4CXDA3I.js +181 -0
  124. package/dist/chunk-Y4CXDA3I.js.map +1 -0
  125. package/dist/chunk-YA4QQKKE.js +51 -0
  126. package/dist/chunk-YA4QQKKE.js.map +1 -0
  127. package/dist/chunk-YBVA7GPW.js +27 -0
  128. package/dist/chunk-YBVA7GPW.js.map +1 -0
  129. package/dist/chunk-YU2VGX5R.js +4205 -0
  130. package/dist/chunk-YU2VGX5R.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-UPA2GUZV.js +15 -0
  244. package/dist/copy-local-skills-UPA2GUZV.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-SB4XAOVB.js +16 -0
  252. package/dist/load-agent-defs-SB4XAOVB.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-U4ZY2GDX.js +20 -0
  258. package/dist/recompile-project-agents-U4ZY2GDX.js.map +1 -0
  259. package/dist/source-loader-5UNRU7EZ.js +20 -0
  260. package/dist/source-loader-5UNRU7EZ.js.map +1 -0
  261. package/dist/source-manager-3O54SIIB.js +18 -0
  262. package/dist/source-manager-3O54SIIB.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,87 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-P56WJ5FA.js";
5
+
6
+ // src/cli/components/hooks/use-focused-list-item.ts
7
+ init_esm_shims();
8
+ import { useState, useCallback, useRef } from "react";
9
+ function useFocusedListItem(rowCount, getColCount, options = {}) {
10
+ const {
11
+ wrap = true,
12
+ findValidCol,
13
+ adjustCol,
14
+ onChange,
15
+ initialRow = 0,
16
+ initialCol = 0,
17
+ skipRow
18
+ } = options;
19
+ const [focusedRow, setFocusedRow] = useState(initialRow);
20
+ const [focusedCol, setFocusedCol] = useState(initialCol);
21
+ const focusedRowRef = useRef(focusedRow);
22
+ focusedRowRef.current = focusedRow;
23
+ const focusedColRef = useRef(focusedCol);
24
+ focusedColRef.current = focusedCol;
25
+ const onChangeRef = useRef(onChange);
26
+ onChangeRef.current = onChange;
27
+ const applyFocus = useCallback((row, col) => {
28
+ setFocusedRow(row);
29
+ setFocusedCol(col);
30
+ onChangeRef.current?.(row, col);
31
+ }, []);
32
+ const setFocused = applyFocus;
33
+ const findNextRow = useCallback(
34
+ (fromRow, direction) => {
35
+ if (rowCount === 0) return fromRow;
36
+ let next = fromRow;
37
+ for (let i = 0; i < rowCount; i++) {
38
+ if (wrap) {
39
+ next = (next + direction + rowCount) % rowCount;
40
+ } else {
41
+ next = next + direction;
42
+ if (next < 0 || next >= rowCount) return fromRow;
43
+ }
44
+ if (!skipRow || !skipRow(next)) return next;
45
+ }
46
+ return fromRow;
47
+ },
48
+ [rowCount, wrap, skipRow]
49
+ );
50
+ const moveFocus = useCallback(
51
+ (direction) => {
52
+ const currentRow = focusedRowRef.current;
53
+ const currentCol = focusedColRef.current;
54
+ if (direction === "left" || direction === "right") {
55
+ const colCount = getColCount(currentRow);
56
+ if (colCount === 0) return;
57
+ const step = direction === "right" ? 1 : -1;
58
+ if (findValidCol) {
59
+ const newCol = findValidCol(currentRow, currentCol, step);
60
+ applyFocus(currentRow, newCol);
61
+ } else if (wrap) {
62
+ const newCol = (currentCol + step + colCount) % colCount;
63
+ applyFocus(currentRow, newCol);
64
+ } else {
65
+ const newCol = Math.max(0, Math.min(colCount - 1, currentCol + step));
66
+ applyFocus(currentRow, newCol);
67
+ }
68
+ } else {
69
+ const step = direction === "down" ? 1 : -1;
70
+ const newRow = findNextRow(currentRow, step);
71
+ const newColCount = getColCount(newRow);
72
+ let finalCol = Math.min(currentCol, Math.max(0, newColCount - 1));
73
+ if (adjustCol) {
74
+ finalCol = adjustCol(newRow, finalCol);
75
+ }
76
+ applyFocus(newRow, finalCol);
77
+ }
78
+ },
79
+ [getColCount, wrap, findValidCol, adjustCol, findNextRow, applyFocus, skipRow]
80
+ );
81
+ return { focusedRow, focusedCol, setFocused, moveFocus };
82
+ }
83
+
84
+ export {
85
+ useFocusedListItem
86
+ };
87
+ //# sourceMappingURL=chunk-LYYXX2W5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/components/hooks/use-focused-list-item.ts"],"sourcesContent":["import { useState, useCallback, useRef } from \"react\";\n\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\";\n\ntype UseFocusedListItemOptions = {\n /** Wrap around when reaching boundaries (default: true) */\n wrap?: boolean;\n /** Custom column finder for skipping disabled items on horizontal nav.\n * Receives the row, current column, and direction (+1 right, -1 left).\n * Should return the next valid column index. */\n findValidCol?: (row: number, currentCol: number, direction: 1 | -1) => number;\n /** Called after vertical navigation to adjust the clamped column\n * (e.g. to skip disabled items). Returns the adjusted column index. */\n adjustCol?: (row: number, clampedCol: number) => number;\n /** Called whenever focused position changes */\n onChange?: (row: number, col: number) => void;\n /** Initial row index (default: 0) */\n initialRow?: number;\n /** Initial col index (default: 0) */\n initialCol?: number;\n /** Optional predicate: when it returns true for a row index, that row is skipped during vertical navigation. */\n skipRow?: (row: number) => boolean;\n};\n\ntype UseFocusedListItemResult = {\n focusedRow: number;\n focusedCol: number;\n setFocused: (row: number, col: number) => void;\n moveFocus: (direction: Direction) => void;\n};\n\n/**\n * 2D grid focus management: tracks (row, col) position and handles\n * directional movement with wrapping, column clamping,\n * and optional disabled-column skipping.\n */\nexport function useFocusedListItem(\n rowCount: number,\n getColCount: (row: number) => number,\n options: UseFocusedListItemOptions = {},\n): UseFocusedListItemResult {\n const {\n wrap = true,\n findValidCol,\n adjustCol,\n onChange,\n initialRow = 0,\n initialCol = 0,\n skipRow,\n } = options;\n\n const [focusedRow, setFocusedRow] = useState(initialRow);\n const [focusedCol, setFocusedCol] = useState(initialCol);\n\n // Refs for stable callback access without stale closures.\n // Synced during render (not via useEffect) to prevent a timing gap where\n // the ref holds stale values when an input event arrives between render\n // and effect execution (e.g. after a domain-switch remount).\n const focusedRowRef = useRef(focusedRow);\n focusedRowRef.current = focusedRow;\n\n const focusedColRef = useRef(focusedCol);\n focusedColRef.current = focusedCol;\n\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const applyFocus = useCallback((row: number, col: number) => {\n setFocusedRow(row);\n setFocusedCol(col);\n onChangeRef.current?.(row, col);\n }, []);\n\n const setFocused = applyFocus;\n\n const findNextRow = useCallback(\n (fromRow: number, direction: 1 | -1): number => {\n if (rowCount === 0) return fromRow;\n let next = fromRow;\n for (let i = 0; i < rowCount; i++) {\n if (wrap) {\n next = (next + direction + rowCount) % rowCount;\n } else {\n next = next + direction;\n if (next < 0 || next >= rowCount) return fromRow;\n }\n if (!skipRow || !skipRow(next)) return next;\n }\n return fromRow; // All rows skipped — stay put\n },\n [rowCount, wrap, skipRow],\n );\n\n const moveFocus = useCallback(\n (direction: Direction) => {\n const currentRow = focusedRowRef.current;\n const currentCol = focusedColRef.current;\n\n if (direction === \"left\" || direction === \"right\") {\n const colCount = getColCount(currentRow);\n if (colCount === 0) return;\n\n const step = direction === \"right\" ? 1 : -1;\n\n if (findValidCol) {\n const newCol = findValidCol(currentRow, currentCol, step);\n applyFocus(currentRow, newCol);\n } else if (wrap) {\n const newCol = (currentCol + step + colCount) % colCount;\n applyFocus(currentRow, newCol);\n } else {\n const newCol = Math.max(0, Math.min(colCount - 1, currentCol + step));\n applyFocus(currentRow, newCol);\n }\n } else {\n const step = direction === \"down\" ? 1 : -1;\n const newRow = findNextRow(currentRow, step);\n const newColCount = getColCount(newRow);\n let finalCol = Math.min(currentCol, Math.max(0, newColCount - 1));\n\n if (adjustCol) {\n finalCol = adjustCol(newRow, finalCol);\n }\n\n applyFocus(newRow, finalCol);\n }\n },\n [getColCount, wrap, findValidCol, adjustCol, findNextRow, applyFocus, skipRow],\n );\n\n return { focusedRow, focusedCol, setFocused, moveFocus };\n}\n"],"mappings":";;;;;;AAAA;AAAA,SAAS,UAAU,aAAa,cAAc;AAoCvC,SAAS,mBACd,UACA,aACA,UAAqC,CAAC,GACZ;AAC1B,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,UAAU;AACvD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,UAAU;AAMvD,QAAM,gBAAgB,OAAO,UAAU;AACvC,gBAAc,UAAU;AAExB,QAAM,gBAAgB,OAAO,UAAU;AACvC,gBAAc,UAAU;AAExB,QAAM,cAAc,OAAO,QAAQ;AACnC,cAAY,UAAU;AAEtB,QAAM,aAAa,YAAY,CAAC,KAAa,QAAgB;AAC3D,kBAAc,GAAG;AACjB,kBAAc,GAAG;AACjB,gBAAY,UAAU,KAAK,GAAG;AAAA,EAChC,GAAG,CAAC,CAAC;AAEL,QAAM,aAA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Q;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,CAAC,aAAa,MAAM,cAAc,WAAW,aAAa,YAAY,OAAO;AAAA,EAC/E;AAEA,SAAO,EAAE,YAAY,YAAY,YAAY,UAAU;AACzD;","names":[]}
@@ -0,0 +1,339 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ buildCompileAgents,
4
+ computeStringHash,
5
+ createLiquidEngine,
6
+ determinePluginVersion,
7
+ discoverAllPluginSkills,
8
+ effectivelyExcludedSkillIds,
9
+ fetchFromSource,
10
+ generateAgentPluginManifest,
11
+ getPluginAgentsDir,
12
+ getPluginManifestPath,
13
+ isAgentName,
14
+ loadProjectConfig,
15
+ loadProjectSourceConfig,
16
+ resolveAgents,
17
+ writeCompiledAgentsByScope,
18
+ writeContentHash,
19
+ writePluginManifest
20
+ } from "./chunk-TVHRMRD3.js";
21
+ import {
22
+ agentFrontmatterValidationSchema,
23
+ copy,
24
+ directoryExists,
25
+ ensureDir,
26
+ extractFrontmatter,
27
+ formatZodIssues,
28
+ getErrorMessage,
29
+ glob,
30
+ loadAllAgents,
31
+ loadProjectAgents,
32
+ log,
33
+ readFile,
34
+ remove,
35
+ verbose,
36
+ warn
37
+ } from "./chunk-3LIU2ZEF.js";
38
+ import {
39
+ typedEntries,
40
+ typedKeys
41
+ } from "./chunk-VEP23B5W.js";
42
+ import {
43
+ CLAUDE_DIR,
44
+ DIRS,
45
+ PROJECT_ROOT,
46
+ STANDARD_DIRS
47
+ } from "./chunk-O5ASLZ2K.js";
48
+ import {
49
+ init_esm_shims
50
+ } from "./chunk-P56WJ5FA.js";
51
+
52
+ // src/cli/lib/agents/agent-fetcher.ts
53
+ init_esm_shims();
54
+ import path from "path";
55
+ async function getAgentDefinitions(remoteSource, options = {}) {
56
+ if (remoteSource) {
57
+ return fetchAgentDefinitionsFromRemote(remoteSource, options);
58
+ }
59
+ return getLocalAgentDefinitions(options);
60
+ }
61
+ async function getLocalAgentDefinitions(options = {}) {
62
+ const agentsDir = path.join(PROJECT_ROOT, DIRS.agents);
63
+ if (!await directoryExists(agentsDir)) {
64
+ throw new Error(
65
+ `Agent partials not found at '${agentsDir}'. Ensure the CLI is properly installed.`
66
+ );
67
+ }
68
+ const localTemplatesDir = options.projectDir ? path.join(options.projectDir, CLAUDE_DIR, STANDARD_DIRS.TEMPLATES) : void 0;
69
+ const useLocalTemplates = localTemplatesDir !== void 0 && await directoryExists(localTemplatesDir);
70
+ if (useLocalTemplates) {
71
+ verbose(`Using local templates from: ${localTemplatesDir}`);
72
+ }
73
+ const templatesDir = useLocalTemplates ? localTemplatesDir : path.join(PROJECT_ROOT, DIRS.templates);
74
+ if (!await directoryExists(templatesDir)) {
75
+ verbose(`Templates directory not found: ${templatesDir}`);
76
+ }
77
+ verbose(`Agent partials loaded from CLI: ${agentsDir}`);
78
+ verbose(`Templates directory: ${templatesDir}`);
79
+ return {
80
+ agentsDir,
81
+ templatesDir,
82
+ sourcePath: PROJECT_ROOT
83
+ };
84
+ }
85
+ async function fetchAgentDefinitionsFromRemote(source, options = {}) {
86
+ verbose(`Fetching agent partials from remote: ${source}`);
87
+ const result = await fetchFromSource(source, {
88
+ forceRefresh: options.forceRefresh,
89
+ subdir: ""
90
+ });
91
+ const sourceProjectConfig = options.agentsDir ? void 0 : await loadProjectSourceConfig(result.path);
92
+ if (sourceProjectConfig?.agentsDir) {
93
+ verbose(`Using agentsDir from source config: ${sourceProjectConfig.agentsDir}`);
94
+ }
95
+ const agentsDirRelPath = options.agentsDir ?? sourceProjectConfig?.agentsDir ?? DIRS.agents;
96
+ const agentsDir = path.join(result.path, agentsDirRelPath);
97
+ const templatesDir = path.join(agentsDir, path.basename(DIRS.templates));
98
+ if (!await directoryExists(agentsDir)) {
99
+ throw new Error(`Agent partials not found at '${agentsDir}'`);
100
+ }
101
+ if (!await directoryExists(templatesDir)) {
102
+ verbose(`Templates directory not found: ${templatesDir}`);
103
+ }
104
+ verbose(`Agent partials fetched from: ${result.path}`);
105
+ return {
106
+ agentsDir,
107
+ templatesDir,
108
+ sourcePath: result.path
109
+ };
110
+ }
111
+
112
+ // src/cli/lib/agents/list-compiled-agents.ts
113
+ init_esm_shims();
114
+ import path2 from "path";
115
+ async function listAgentMdFiles(agentsDir) {
116
+ return glob("*.md", agentsDir);
117
+ }
118
+ async function listCompiledAgentNames(agentsDir) {
119
+ const files = await listAgentMdFiles(agentsDir);
120
+ return files.map((f) => path2.basename(f, ".md"));
121
+ }
122
+ async function pruneStaleCompiledAgents(agentsDir, keep) {
123
+ const isStaleCompiledAgent = (file) => {
124
+ const name = path2.basename(file, ".md");
125
+ return isAgentName(name) && !keep.has(name);
126
+ };
127
+ const files = await listAgentMdFiles(agentsDir);
128
+ await Promise.all(
129
+ files.filter(isStaleCompiledAgent).map((file) => remove(path2.join(agentsDir, file)))
130
+ );
131
+ }
132
+
133
+ // src/cli/lib/agents/agent-recompiler.ts
134
+ init_esm_shims();
135
+ import { partition } from "remeda";
136
+ import path3 from "path";
137
+ async function getExistingAgentNames(pluginDir) {
138
+ return listCompiledAgentNames(getPluginAgentsDir(pluginDir));
139
+ }
140
+ async function resolveAgentNames(params) {
141
+ const { specifiedAgents, projectConfig, allAgents, outputDir, pluginDir } = params;
142
+ if (specifiedAgents) {
143
+ return specifiedAgents;
144
+ }
145
+ if (projectConfig) {
146
+ const agentNames = projectConfig.agents.map((a) => a.name);
147
+ verbose(`Using agents from config: ${agentNames.join(", ")}`);
148
+ return agentNames;
149
+ }
150
+ if (outputDir) {
151
+ const names = typedKeys(allAgents);
152
+ verbose(`Using all available agents from source: ${names.join(", ")}`);
153
+ return names;
154
+ }
155
+ return getExistingAgentNames(pluginDir);
156
+ }
157
+ function buildRecompileResult(outcomes, priorWarnings) {
158
+ const [succeeded, failedOutcomes] = partition(
159
+ outcomes,
160
+ (outcome) => outcome.ok
161
+ );
162
+ succeeded.forEach(
163
+ (outcome) => verbose(` Recompiled: ${outcome.name} (${outcome.scope} -> ${outcome.targetDir})`)
164
+ );
165
+ return {
166
+ compiled: succeeded.map((outcome) => outcome.name),
167
+ failed: failedOutcomes.map((outcome) => outcome.name),
168
+ warnings: [
169
+ ...priorWarnings,
170
+ ...failedOutcomes.map(
171
+ (outcome) => `Failed to compile ${outcome.name}: ${getErrorMessage(outcome.error)}`
172
+ )
173
+ ]
174
+ };
175
+ }
176
+ function filterExcludedEntries(config) {
177
+ const excludedIds = effectivelyExcludedSkillIds(config.skills);
178
+ const activeSkills = config.skills.filter((s) => !s.excluded);
179
+ const activeAgents = config.agents.filter((a) => !a.excluded);
180
+ const filteredStack = config.stack ? Object.fromEntries(
181
+ typedEntries(config.stack).map(([agentName, agentStack]) => [
182
+ agentName,
183
+ Object.fromEntries(
184
+ typedEntries(agentStack).map(([category, assignments]) => [
185
+ category,
186
+ assignments.filter((a) => !excludedIds.has(a.id))
187
+ ])
188
+ )
189
+ ])
190
+ ) : void 0;
191
+ return { ...config, skills: activeSkills, agents: activeAgents, stack: filteredStack };
192
+ }
193
+ async function recompileAgents(options) {
194
+ const { pluginDir, sourcePath, skills: providedSkills, projectDir, outputDir } = options;
195
+ const configDir = projectDir ?? pluginDir;
196
+ const loadedConfig = await loadProjectConfig(configDir);
197
+ const projectConfig = loadedConfig?.config ?? null;
198
+ const filteredConfig = projectConfig ? filterExcludedEntries(projectConfig) : null;
199
+ const builtinAgents = await loadAllAgents(sourcePath);
200
+ const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};
201
+ const allAgents = {
202
+ ...builtinAgents,
203
+ ...projectAgents
204
+ };
205
+ const agentNames = await resolveAgentNames({
206
+ specifiedAgents: options.agents,
207
+ projectConfig: filteredConfig,
208
+ allAgents,
209
+ outputDir,
210
+ pluginDir
211
+ });
212
+ if (agentNames.length === 0) {
213
+ return { compiled: [], failed: [], warnings: ["No agents found to recompile"] };
214
+ }
215
+ verbose(`Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`);
216
+ const pluginSkills = providedSkills ?? await discoverAllPluginSkills(projectDir ?? pluginDir);
217
+ const allConfigAgents = filteredConfig ? buildCompileAgents(filteredConfig, allAgents) : {};
218
+ const [knownAgents, missingAgents] = partition(
219
+ agentNames,
220
+ (name) => Boolean(allConfigAgents[name] || allAgents[name])
221
+ );
222
+ const missingWarnings = missingAgents.map(
223
+ (name) => `Agent "${name}" not found in source definitions`
224
+ );
225
+ const configAgents = Object.fromEntries(
226
+ knownAgents.map((name) => [name, allConfigAgents[name] ?? {}])
227
+ );
228
+ const compileConfig = {
229
+ name: filteredConfig?.name || path3.basename(pluginDir),
230
+ description: filteredConfig?.description || "Recompiled plugin",
231
+ agents: configAgents
232
+ };
233
+ const engine = await createLiquidEngine(projectDir);
234
+ const resolvedAgents = await resolveAgents(allAgents, pluginSkills, compileConfig, sourcePath);
235
+ const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);
236
+ await ensureDir(agentsDir);
237
+ const outcomes = await writeCompiledAgentsByScope({
238
+ resolvedAgents,
239
+ sourcePath,
240
+ engine,
241
+ projectAgentsDir: agentsDir,
242
+ agentScopeMap: options.agentScopeMap
243
+ });
244
+ return buildRecompileResult(outcomes, missingWarnings);
245
+ }
246
+
247
+ // src/cli/lib/agents/agent-plugin-compiler.ts
248
+ init_esm_shims();
249
+ import path4 from "path";
250
+ function parseAgentFrontmatter(content, filePath) {
251
+ const raw = extractFrontmatter(content);
252
+ if (!raw) {
253
+ return null;
254
+ }
255
+ const result = agentFrontmatterValidationSchema.safeParse(raw);
256
+ if (!result.success) {
257
+ warn(`Invalid agent frontmatter in ${filePath}: ${formatZodIssues(result.error.issues)}`);
258
+ return null;
259
+ }
260
+ return { name: result.data.name, description: result.data.description };
261
+ }
262
+ async function compileAgentPlugin(options) {
263
+ const { agentPath, outputDir } = options;
264
+ const fileName = path4.basename(agentPath);
265
+ const content = await readFile(agentPath);
266
+ const frontmatter = parseAgentFrontmatter(content, agentPath);
267
+ if (!frontmatter) {
268
+ throw new Error(
269
+ `Agent '${fileName}' has invalid or missing YAML frontmatter. Required fields: 'name' and 'description'. File: ${agentPath}`
270
+ );
271
+ }
272
+ const agentName = frontmatter.name;
273
+ verbose(`Compiling agent plugin: ${agentName} from ${agentPath}`);
274
+ const pluginDir = path4.join(outputDir, `agent-${agentName}`);
275
+ const agentsDir = path4.join(pluginDir, "agents");
276
+ await ensureDir(pluginDir);
277
+ await ensureDir(agentsDir);
278
+ const newHash = computeStringHash(content);
279
+ const { version, contentHash } = await determinePluginVersion(
280
+ newHash,
281
+ pluginDir,
282
+ getPluginManifestPath
283
+ );
284
+ const manifest = generateAgentPluginManifest({
285
+ agentName,
286
+ description: frontmatter.description,
287
+ version
288
+ });
289
+ await writePluginManifest(pluginDir, manifest);
290
+ await writeContentHash(pluginDir, contentHash, getPluginManifestPath);
291
+ verbose(` Wrote plugin.json for ${agentName} (v${version})`);
292
+ await copy(agentPath, path4.join(agentsDir, `${agentName}.md`));
293
+ verbose(` Copied agent ${fileName} -> agents/${agentName}.md`);
294
+ return {
295
+ pluginPath: pluginDir,
296
+ manifest,
297
+ agentName
298
+ };
299
+ }
300
+ async function compileAllAgentPlugins(agentsDir, outputDir) {
301
+ const results = [];
302
+ const agentMdFiles = await listAgentMdFiles(agentsDir);
303
+ for (const agentFile of agentMdFiles) {
304
+ const agentPath = path4.join(agentsDir, agentFile);
305
+ try {
306
+ const result = await compileAgentPlugin({
307
+ agentPath,
308
+ outputDir
309
+ });
310
+ results.push(result);
311
+ log(` [OK] agent-${result.agentName}`);
312
+ } catch (error) {
313
+ const errorMessage = getErrorMessage(error);
314
+ warn(`Failed to compile agent from '${agentFile}': ${errorMessage}`);
315
+ }
316
+ }
317
+ return results;
318
+ }
319
+ function printAgentCompilationSummary(results) {
320
+ log(`
321
+ Compiled ${results.length} agent plugins:`);
322
+ for (const result of results) {
323
+ log(` - agent-${result.agentName} (v${result.manifest.version})`);
324
+ }
325
+ }
326
+
327
+ // src/cli/lib/agents/index.ts
328
+ init_esm_shims();
329
+
330
+ export {
331
+ getAgentDefinitions,
332
+ listAgentMdFiles,
333
+ pruneStaleCompiledAgents,
334
+ filterExcludedEntries,
335
+ recompileAgents,
336
+ compileAllAgentPlugins,
337
+ printAgentCompilationSummary
338
+ };
339
+ //# sourceMappingURL=chunk-NGLQ5W7U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/agents/agent-fetcher.ts","../src/cli/lib/agents/list-compiled-agents.ts","../src/cli/lib/agents/agent-recompiler.ts","../src/cli/lib/agents/agent-plugin-compiler.ts","../src/cli/lib/agents/index.ts"],"sourcesContent":["import path from \"path\";\nimport { directoryExists } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT, DIRS, CLAUDE_DIR, STANDARD_DIRS } from \"../../consts\";\nimport { fetchFromSource, type FetchOptions } from \"../loading\";\nimport { loadProjectSourceConfig } from \"../configuration\";\nimport type { AgentSourcePaths } from \"../../types\";\n\nexport type AgentDefinitionOptions = FetchOptions & {\n projectDir?: string;\n};\n\nexport async function getAgentDefinitions(\n remoteSource?: string,\n options: AgentDefinitionOptions = {},\n): Promise<AgentSourcePaths> {\n if (remoteSource) {\n return fetchAgentDefinitionsFromRemote(remoteSource, options);\n }\n return getLocalAgentDefinitions(options);\n}\n\nexport async function getLocalAgentDefinitions(\n options: AgentDefinitionOptions = {},\n): Promise<AgentSourcePaths> {\n const agentsDir = path.join(PROJECT_ROOT, DIRS.agents);\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(\n `Agent partials not found at '${agentsDir}'. Ensure the CLI is properly installed.`,\n );\n }\n\n const localTemplatesDir = options.projectDir\n ? path.join(options.projectDir, CLAUDE_DIR, STANDARD_DIRS.TEMPLATES)\n : undefined;\n const useLocalTemplates =\n localTemplatesDir !== undefined && (await directoryExists(localTemplatesDir));\n if (useLocalTemplates) {\n verbose(`Using local templates from: ${localTemplatesDir}`);\n }\n const templatesDir = useLocalTemplates\n ? localTemplatesDir\n : path.join(PROJECT_ROOT, DIRS.templates);\n\n if (!(await directoryExists(templatesDir))) {\n verbose(`Templates directory not found: ${templatesDir}`);\n }\n\n verbose(`Agent partials loaded from CLI: ${agentsDir}`);\n verbose(`Templates directory: ${templatesDir}`);\n\n return {\n agentsDir,\n templatesDir,\n sourcePath: PROJECT_ROOT,\n };\n}\n\nexport async function fetchAgentDefinitionsFromRemote(\n source: string,\n options: FetchOptions & { agentsDir?: string } = {},\n): Promise<AgentSourcePaths> {\n verbose(`Fetching agent partials from remote: ${source}`);\n\n const result = await fetchFromSource(source, {\n forceRefresh: options.forceRefresh,\n subdir: \"\",\n });\n\n const sourceProjectConfig = options.agentsDir\n ? undefined\n : await loadProjectSourceConfig(result.path);\n if (sourceProjectConfig?.agentsDir) {\n verbose(`Using agentsDir from source config: ${sourceProjectConfig.agentsDir}`);\n }\n const agentsDirRelPath = options.agentsDir ?? sourceProjectConfig?.agentsDir ?? DIRS.agents;\n\n const agentsDir = path.join(result.path, agentsDirRelPath);\n const templatesDir = path.join(agentsDir, path.basename(DIRS.templates));\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(`Agent partials not found at '${agentsDir}'`);\n }\n\n if (!(await directoryExists(templatesDir))) {\n verbose(`Templates directory not found: ${templatesDir}`);\n }\n\n verbose(`Agent partials fetched from: ${result.path}`);\n\n return {\n agentsDir,\n templatesDir,\n sourcePath: result.path,\n };\n}\n","import path from \"path\";\nimport { glob, remove } from \"../../utils/fs\";\nimport { isAgentName } from \"../../utils/type-guards\";\nimport type { AgentName } from \"../../types\";\n\n/** Lists compiled-agent markdown filenames (e.g. \"web-developer.md\") in a directory. */\nexport async function listAgentMdFiles(agentsDir: string): Promise<string[]> {\n return glob(\"*.md\", agentsDir);\n}\n\n/** Lists compiled-agent names (filenames without the `.md` extension) in a directory. */\nexport async function listCompiledAgentNames(agentsDir: string): Promise<AgentName[]> {\n const files = await listAgentMdFiles(agentsDir);\n // Boundary cast: compiled .md filenames are agent names by convention; custom\n // agents from marketplace stacks may not be members of the AgentName union.\n return files.map((f) => path.basename(f, \".md\") as AgentName);\n}\n\n/**\n * Removes stale CLI-compiled agent files from `agentsDir`: deletes any `.md`\n * whose basename is a built-in CLI agent name (`isAgentName`) that is NOT in\n * `keep`. The built-in-name check protects hand-authored agents (whose basename\n * is not a built-in name) — it is never the removal criterion. Only call this\n * when `keep` is the COMPLETE set of agents that should live in `agentsDir`.\n */\nexport async function pruneStaleCompiledAgents(\n agentsDir: string,\n keep: ReadonlySet<AgentName>,\n): Promise<void> {\n // A non-built-in basename is a hand-authored agent — always preserved.\n const isStaleCompiledAgent = (file: string): boolean => {\n const name = path.basename(file, \".md\");\n return isAgentName(name) && !keep.has(name);\n };\n\n const files = await listAgentMdFiles(agentsDir);\n await Promise.all(\n files.filter(isStaleCompiledAgent).map((file) => remove(path.join(agentsDir, file))),\n );\n}\n","import { partition } from \"remeda\";\nimport { writeCompiledAgentsByScope, type AgentWriteOutcome } from \"./write-compiled-agents\";\nimport { listCompiledAgentNames } from \"./list-compiled-agents\";\nimport path from \"path\";\n\nimport { getErrorMessage } from \"../../utils/errors\";\nimport type {\n AgentDefinition,\n AgentName,\n CompileAgentConfig,\n CompileConfig,\n ProjectConfig,\n SkillDefinitionMap,\n SkillScope,\n} from \"../../types\";\n\nimport { buildCompileAgents } from \"../installation/local-installer\";\nimport { ensureDir } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { typedEntries, typedKeys } from \"../../utils/typed-object\";\nimport { createLiquidEngine } from \"../compiler\";\nimport { loadProjectConfig, effectivelyExcludedSkillIds } from \"../configuration\";\nimport { loadAllAgents, loadProjectAgents } from \"../loading\";\nimport { getPluginAgentsDir } from \"../plugins\";\nimport { discoverAllPluginSkills } from \"../plugins/plugin-discovery\";\nimport { resolveAgents } from \"../resolver\";\n\nexport type RecompileAgentsOptions = {\n pluginDir: string;\n sourcePath: string;\n agents?: AgentName[];\n skills?: SkillDefinitionMap;\n projectDir?: string;\n outputDir?: string;\n /** When provided, routes agents by scope: global agents to ~/.claude/agents/, project agents to outputDir */\n agentScopeMap?: Map<AgentName, SkillScope>;\n};\n\nexport type RecompileAgentsResult = {\n compiled: AgentName[];\n failed: AgentName[];\n warnings: string[];\n};\n\nasync function getExistingAgentNames(pluginDir: string): Promise<AgentName[]> {\n return listCompiledAgentNames(getPluginAgentsDir(pluginDir));\n}\n\ntype ResolveAgentNamesParams = {\n specifiedAgents?: AgentName[];\n projectConfig: ProjectConfig | null;\n allAgents: Record<AgentName, AgentDefinition>;\n outputDir?: string;\n pluginDir: string;\n};\n\nasync function resolveAgentNames(params: ResolveAgentNamesParams): Promise<AgentName[]> {\n const { specifiedAgents, projectConfig, allAgents, outputDir, pluginDir } = params;\n\n if (specifiedAgents) {\n return specifiedAgents;\n }\n\n // A present config is authoritative over its agent roster — even when empty.\n // `agents: []` means \"no agents\", so it must NOT fall through to the\n // all-agents branch below; that branch exists only for the config-LESS case.\n if (projectConfig) {\n const agentNames = projectConfig.agents.map((a) => a.name);\n verbose(`Using agents from config: ${agentNames.join(\", \")}`);\n return agentNames;\n }\n\n if (outputDir) {\n const names = typedKeys<AgentName>(allAgents);\n verbose(`Using all available agents from source: ${names.join(\", \")}`);\n return names;\n }\n\n return getExistingAgentNames(pluginDir);\n}\n\n/** Splits write outcomes into the recompile result; logs each success at verbose level. */\nfunction buildRecompileResult(\n outcomes: AgentWriteOutcome[],\n priorWarnings: string[],\n): RecompileAgentsResult {\n const [succeeded, failedOutcomes] = partition(\n outcomes,\n (outcome): outcome is Extract<AgentWriteOutcome, { ok: true }> => outcome.ok,\n );\n succeeded.forEach((outcome) =>\n verbose(` Recompiled: ${outcome.name} (${outcome.scope} -> ${outcome.targetDir})`),\n );\n return {\n compiled: succeeded.map((outcome) => outcome.name),\n failed: failedOutcomes.map((outcome) => outcome.name),\n warnings: [\n ...priorWarnings,\n ...failedOutcomes.map(\n (outcome) => `Failed to compile ${outcome.name}: ${getErrorMessage(outcome.error)}`,\n ),\n ],\n };\n}\n\nexport function filterExcludedEntries(config: ProjectConfig): ProjectConfig {\n const excludedIds = effectivelyExcludedSkillIds(config.skills);\n const activeSkills = config.skills.filter((s) => !s.excluded);\n const activeAgents = config.agents.filter((a) => !a.excluded);\n\n // Also remove excluded skill refs from stack assignments\n const filteredStack = config.stack\n ? Object.fromEntries(\n typedEntries(config.stack).map(([agentName, agentStack]) => [\n agentName,\n Object.fromEntries(\n typedEntries(agentStack).map(([category, assignments]) => [\n category,\n assignments.filter((a) => !excludedIds.has(a.id)),\n ]),\n ),\n ]),\n )\n : undefined;\n\n return { ...config, skills: activeSkills, agents: activeAgents, stack: filteredStack };\n}\n\nexport async function recompileAgents(\n options: RecompileAgentsOptions,\n): Promise<RecompileAgentsResult> {\n const { pluginDir, sourcePath, skills: providedSkills, projectDir, outputDir } = options;\n\n const configDir = projectDir ?? pluginDir;\n const loadedConfig = await loadProjectConfig(configDir);\n const projectConfig = loadedConfig?.config ?? null;\n\n // Filter excluded entries once at the entry point — callees receive clean data\n const filteredConfig = projectConfig ? filterExcludedEntries(projectConfig) : null;\n\n const builtinAgents = await loadAllAgents(sourcePath);\n const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};\n\n // Priority: project agents > built-in agents\n const allAgents: Record<AgentName, AgentDefinition> = {\n ...builtinAgents,\n ...projectAgents,\n };\n\n const agentNames = await resolveAgentNames({\n specifiedAgents: options.agents,\n projectConfig: filteredConfig,\n allAgents,\n outputDir,\n pluginDir,\n });\n\n if (agentNames.length === 0) {\n return { compiled: [], failed: [], warnings: [\"No agents found to recompile\"] };\n }\n\n verbose(`Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`);\n\n // When skills are not provided, discover from all plugin directories.\n const pluginSkills: SkillDefinitionMap =\n providedSkills ?? (await discoverAllPluginSkills(projectDir ?? pluginDir));\n\n const allConfigAgents = filteredConfig ? buildCompileAgents(filteredConfig, allAgents) : {};\n\n // Restrict to only the agents we're compiling (agentNames).\n // buildCompileAgents returns entries for ALL agents in the config, but when\n // scopeFilter is active, we only want the agents matching that scope.\n // Without this filter, a project pass would compile global agents without\n // their stack (since the project config omits global agent stack entries)\n // and overwrite correctly compiled global agent files.\n const [knownAgents, missingAgents] = partition(agentNames, (name) =>\n Boolean(allConfigAgents[name] || allAgents[name]),\n );\n const missingWarnings = missingAgents.map(\n (name) => `Agent \"${name}\" not found in source definitions`,\n );\n const configAgents: Record<string, CompileAgentConfig> = Object.fromEntries(\n knownAgents.map((name) => [name, allConfigAgents[name] ?? {}]),\n );\n\n const compileConfig: CompileConfig = {\n name: filteredConfig?.name || path.basename(pluginDir),\n description: filteredConfig?.description || \"Recompiled plugin\",\n agents: configAgents,\n };\n\n const engine = await createLiquidEngine(projectDir);\n const resolvedAgents = await resolveAgents(allAgents, pluginSkills, compileConfig, sourcePath);\n\n const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);\n await ensureDir(agentsDir);\n\n const outcomes = await writeCompiledAgentsByScope({\n resolvedAgents,\n sourcePath,\n engine,\n projectAgentsDir: agentsDir,\n agentScopeMap: options.agentScopeMap,\n });\n return buildRecompileResult(outcomes, missingWarnings);\n}\n","import path from \"path\";\nimport { getErrorMessage } from \"../../utils/errors\";\nimport { readFile, ensureDir, copy } from \"../../utils/fs\";\nimport { log, verbose, warn } from \"../../utils/logger\";\nimport {\n generateAgentPluginManifest,\n writePluginManifest,\n getPluginManifestPath,\n} from \"../plugins\";\nimport { listAgentMdFiles } from \"./list-compiled-agents\";\nimport { computeStringHash, determinePluginVersion, writeContentHash } from \"../versioning\";\nimport { extractFrontmatter } from \"../../utils/frontmatter\";\nimport type { AgentFrontmatter, PluginManifest } from \"../../types\";\nimport { agentFrontmatterValidationSchema, formatZodIssues } from \"../schemas\";\n\nexport type AgentPluginOptions = {\n agentPath: string;\n outputDir: string;\n};\n\nexport type CompiledAgentPlugin = {\n pluginPath: string;\n manifest: PluginManifest;\n agentName: string;\n};\n\nfunction parseAgentFrontmatter(\n content: string,\n filePath: string,\n): Pick<AgentFrontmatter, \"name\" | \"description\"> | null {\n const raw = extractFrontmatter(content);\n if (!raw) {\n return null;\n }\n\n const result = agentFrontmatterValidationSchema.safeParse(raw);\n if (!result.success) {\n warn(`Invalid agent frontmatter in ${filePath}: ${formatZodIssues(result.error.issues)}`);\n return null;\n }\n\n return { name: result.data.name, description: result.data.description };\n}\n\nexport async function compileAgentPlugin(\n options: AgentPluginOptions,\n): Promise<CompiledAgentPlugin> {\n const { agentPath, outputDir } = options;\n const fileName = path.basename(agentPath);\n\n const content = await readFile(agentPath);\n const frontmatter = parseAgentFrontmatter(content, agentPath);\n\n if (!frontmatter) {\n throw new Error(\n `Agent '${fileName}' has invalid or missing YAML frontmatter. ` +\n `Required fields: 'name' and 'description'. File: ${agentPath}`,\n );\n }\n\n const agentName = frontmatter.name;\n\n verbose(`Compiling agent plugin: ${agentName} from ${agentPath}`);\n\n const pluginDir = path.join(outputDir, `agent-${agentName}`);\n const agentsDir = path.join(pluginDir, \"agents\");\n\n await ensureDir(pluginDir);\n await ensureDir(agentsDir);\n\n const newHash = computeStringHash(content);\n const { version, contentHash } = await determinePluginVersion(\n newHash,\n pluginDir,\n getPluginManifestPath,\n );\n\n const manifest = generateAgentPluginManifest({\n agentName,\n description: frontmatter.description,\n version,\n });\n\n await writePluginManifest(pluginDir, manifest);\n\n await writeContentHash(pluginDir, contentHash, getPluginManifestPath);\n\n verbose(` Wrote plugin.json for ${agentName} (v${version})`);\n\n await copy(agentPath, path.join(agentsDir, `${agentName}.md`));\n verbose(` Copied agent ${fileName} -> agents/${agentName}.md`);\n\n return {\n pluginPath: pluginDir,\n manifest,\n agentName,\n };\n}\n\nexport async function compileAllAgentPlugins(\n agentsDir: string,\n outputDir: string,\n): Promise<CompiledAgentPlugin[]> {\n const results: CompiledAgentPlugin[] = [];\n\n const agentMdFiles = await listAgentMdFiles(agentsDir);\n\n for (const agentFile of agentMdFiles) {\n const agentPath = path.join(agentsDir, agentFile);\n\n try {\n const result = await compileAgentPlugin({\n agentPath,\n outputDir,\n });\n results.push(result);\n log(` [OK] agent-${result.agentName}`);\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n warn(`Failed to compile agent from '${agentFile}': ${errorMessage}`);\n }\n }\n\n return results;\n}\n\nexport function printAgentCompilationSummary(results: CompiledAgentPlugin[]): void {\n log(`\\nCompiled ${results.length} agent plugins:`);\n for (const result of results) {\n log(` - agent-${result.agentName} (v${result.manifest.version})`);\n }\n}\n","export {\n type AgentDefinitionOptions,\n getAgentDefinitions,\n getLocalAgentDefinitions,\n fetchAgentDefinitionsFromRemote,\n} from \"./agent-fetcher\";\n\nexport {\n type RecompileAgentsOptions,\n type RecompileAgentsResult,\n recompileAgents,\n filterExcludedEntries,\n} from \"./agent-recompiler\";\n\nexport {\n type AgentPluginOptions,\n type CompiledAgentPlugin,\n compileAgentPlugin,\n compileAllAgentPlugins,\n printAgentCompilationSummary,\n} from \"./agent-plugin-compiler\";\n\nexport { listAgentMdFiles, listCompiledAgentNames } from \"./list-compiled-agents\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;AAYjB,eAAsB,oBACpB,cACA,UAAkC,CAAC,GACR;AAC3B,MAAI,cAAc;AAChB,WAAO,gCAAgC,cAAc,OAAO;AAAA,EAC9D;AACA,SAAO,yBAAyB,OAAO;AACzC;AAEA,eAAsB,yBACpB,UAAkC,CAAC,GACR;AAC3B,QAAM,YAAY,KAAK,KAAK,cAAc,KAAK,MAAM;AAErD,MAAI,CAAE,MAAM,gBAAgB,SAAS,GAAI;AACvC,UAAM,IAAI;AAAA,MACR,gCAAgC,SAAS;AAAA,IAC3C;AAAA,EACF;AAEA,QAAM,oBAAoB,QAAQ,aAC9B,KAAK,KAAK,QAAQ,YAAY,YAAY,cAAc,SAAS,IACjE;AACJ,QAAM,oBACJ,sBAAsB,UAAc,MAAM,gBAAgB,iBAAiB;AAC7E,MAAI,mBAAmB;AACrB,YAAQ,+BAA+B,iBAAiB,EAAE;AAAA,EAC5D;AACA,QAAM,eAAe,oBACjB,o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AM,iBAAiB,WAAW,aAAa,qBAAqB;AAEpE,UAAQ,2BAA2B,SAAS,MAAM,OAAO,GAAG;AAE5D,QAAM,KAAK,WAAWA,MAAK,KAAK,WAAW,GAAG,SAAS,KAAK,CAAC;AAC7D,UAAQ,kBAAkB,QAAQ,cAAc,SAAS,KAAK;AAE9D,SAAO;AAAA,IACL,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,EACF;AACF;AAEA,eAAsB,uBACpB,WACA,WACgC;AAChC,QAAM,UAAiC,CAAC;AAExC,QAAM,eAAe,MAAM,iBAAiB,SAAS;AAErD,aAAW,aAAa,cAAc;AACpC,UAAM,YAAYA,MAAK,KAAK,WAAW,SAAS;AAEhD,QAAI;AACF,YAAM,SAAS,MAAM,mBAAmB;AAAA,QACtC;AAAA,QACA;AAAA,MACF,CAAC;AACD,cAAQ,KAAK,MAAM;AACnB,UAAI,gBAAgB,OAAO,SAAS,EAAE;AAAA,IACxC,SAAS,OAAO;AACd,YAAM,eAAe,gBAAgB,KAAK;AAC1C,WAAK,iCAAiC,SAAS,MAAM,YAAY,EAAE;AAAA,IACrE;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,6BAA6B,SAAsC;AACjF,MAAI;AAAA,WAAc,QAAQ,MAAM,iBAAiB;AACjD,aAAW,UAAU,SAAS;AAC5B,QAAI,aAAa,OAAO,SAAS,MAAM,OAAO,SAAS,OAAO,GAAG;AAAA,EACnE;AACF;;;ACnIA;","names":["path","path","path","path","path","path"]}
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ useMeasuredHeight
4
+ } from "./chunk-IOJR5TOY.js";
5
+ import {
6
+ CategoryGrid
7
+ } from "./chunk-6RBQBOBS.js";
8
+ import {
9
+ buildCategoriesForDomain,
10
+ useWizardStore
11
+ } from "./chunk-44LLPS2N.js";
12
+ import {
13
+ init_esm_shims
14
+ } from "./chunk-P56WJ5FA.js";
15
+
16
+ // src/cli/components/wizard/step-build.tsx
17
+ init_esm_shims();
18
+ import { Box, useInput } from "ink";
19
+ import { useCallback, useMemo as useMemo2 } from "react";
20
+
21
+ // src/cli/components/hooks/use-framework-filtering.ts
22
+ init_esm_shims();
23
+ import { useMemo } from "react";
24
+ function useFrameworkFiltering({
25
+ domain,
26
+ allSelections,
27
+ selections,
28
+ installedSkillIds,
29
+ skillConfigs,
30
+ filterIncompatible
31
+ }) {
32
+ return useMemo(
33
+ () => buildCategoriesForDomain(
34
+ domain,
35
+ allSelections,
36
+ selections,
37
+ installedSkillIds,
38
+ skillConfigs,
39
+ filterIncompatible
40
+ ),
41
+ [domain, allSelections, selections, installedSkillIds, skillConfigs, filterIncompatible]
42
+ );
43
+ }
44
+
45
+ // src/cli/components/wizard/step-build.tsx
46
+ import { jsx } from "react/jsx-runtime";
47
+ var StepBuild = ({
48
+ domain: activeDomain,
49
+ selections,
50
+ allSelections,
51
+ showLabels,
52
+ filterIncompatible,
53
+ installedSkillIds,
54
+ onToggle,
55
+ onToggleLabels,
56
+ onToggleFilterIncompatible,
57
+ onContinue,
58
+ onBack
59
+ }) => {
60
+ const { ref: gridRef, measuredHeight: gridHeight } = useMeasuredHeight();
61
+ const skillConfigs = useWizardStore((s) => s.skillConfigs);
62
+ const handleFocusedSkillChange = useCallback(
63
+ (id) => useWizardStore.getState().setFocusedSkillId(id),
64
+ []
65
+ );
66
+ const categories = useFrameworkFiltering({
67
+ domain: activeDomain,
68
+ allSelections,
69
+ selections,
70
+ installedSkillIds,
71
+ skillConfigs,
72
+ filterIncompatible
73
+ });
74
+ const { initialRow, initialCol } = useMemo2(() => {
75
+ const skillId = useWizardStore.getState().focusedSkillId;
76
+ if (!skillId) return { initialRow: 0, initialCol: 0 };
77
+ const row = categories.findIndex((cat) => cat.options.some((o) => o.id === skillId));
78
+ if (row < 0) return { initialRow: 0, initialCol: 0 };
79
+ return {
80
+ initialRow: row,
81
+ initialCol: categories[row].options.findIndex((o) => o.id === skillId)
82
+ };
83
+ }, [categories]);
84
+ useInput((_input, key) => {
85
+ if (key.return) {
86
+ onContinue();
87
+ } else if (key.escape) {
88
+ onBack();
89
+ }
90
+ });
91
+ return /* @__PURE__ */ jsx(Box, { flexDirection: "column", width: "100%", flexGrow: 1, flexBasis: 0, children: /* @__PURE__ */ jsx(Box, { ref: gridRef, flexGrow: 1, flexBasis: 0, children: /* @__PURE__ */ jsx(
92
+ CategoryGrid,
93
+ {
94
+ categories,
95
+ availableHeight: gridHeight,
96
+ showLabels,
97
+ defaultFocusedRow: initialRow,
98
+ defaultFocusedCol: initialCol,
99
+ onToggle,
100
+ onToggleLabels,
101
+ onToggleFilterIncompatible,
102
+ onFocusedSkillChange: handleFocusedSkillChange
103
+ },
104
+ activeDomain
105
+ ) }) });
106
+ };
107
+
108
+ export {
109
+ StepBuild
110
+ };
111
+ //# sourceMappingURL=chunk-NHCGC6DG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/components/wizard/step-build.tsx","../src/cli/components/hooks/use-framework-filtering.ts"],"sourcesContent":["import { Box, useInput } from \"ink\";\nimport React, { useCallback, useMemo } from \"react\";\nimport type { Domain, SkillId, Category, CategorySelections } from \"../../types/index.js\";\nimport { useFrameworkFiltering } from \"../hooks/use-framework-filtering.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { CategoryGrid } from \"./category-grid.js\";\n\nexport type StepBuildProps = {\n domain: Domain;\n selectedDomains: Domain[];\n selections: CategorySelections;\n allSelections: SkillId[];\n showLabels: boolean;\n filterIncompatible: boolean;\n /** Skill IDs already installed on disk, shown with a dimmed checkmark */\n installedSkillIds?: SkillId[];\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n onToggleFilterIncompatible: () => void;\n onContinue: () => void;\n onBack: () => void;\n};\n\nexport const StepBuild: React.FC<StepBuildProps> = ({\n domain: activeDomain,\n selections,\n allSelections,\n showLabels,\n filterIncompatible,\n installedSkillIds,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n onContinue,\n onBack,\n}) => {\n const { ref: gridRef, measuredHeight: gridHeight } = useMeasuredHeight();\n const skillConfigs = useWizardStore((s) => s.skillConfigs);\n\n const handleFocusedSkillChange = useCallback(\n (id: SkillId | null) => useWizardStore.getState().setFocusedSkillId(id),\n [],\n );\n\n const categories = useFrameworkFiltering({\n domain: activeDomain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n });\n\n const { initialRow, initialCol } = useMemo(() => {\n const skillId = useWizardStore.getState().focusedSkillId;\n if (!skillId) return { initialRow: 0, initialCol: 0 };\n const row = categories.findIndex((cat) => cat.options.some((o) => o.id === skillId));\n if (row < 0) return { initialRow: 0, initialCol: 0 };\n return {\n initialRow: row,\n initialCol: categories[row].options.findIndex((o) => o.id === skillId),\n };\n }, [categories]);\n\n useInput((_input, key) => {\n if (key.return) {\n onContinue();\n } else if (key.escape) {\n onBack();\n }\n });\n\n return (\n <Box flexDirection=\"column\" width=\"100%\" flexGrow={1} flexBasis={0}>\n <Box ref={gridRef} flexGrow={1} flexBasis={0}>\n <CategoryGrid\n key={activeDomain}\n categories={categories}\n availableHeight={gridHeight}\n showLabels={showLabels}\n defaultFocusedRow={initialRow}\n defaultFocusedCol={initialCol}\n onToggle={onToggle}\n onToggleLabels={onToggleLabels}\n onToggleFilterIncompatible={onToggleFilterIncompatible}\n onFocusedSkillChange={handleFocusedSkillChange}\n />\n </Box>\n </Box>\n );\n};\n","import { useMemo } from \"react\";\nimport type { Domain, SkillId, CategorySelections } from \"../../types/index.js\";\nimport type { SkillConfig } from \"../../types/config.js\";\nimport { buildCategoriesForDomain } from \"../../lib/wizard/index.js\";\nimport type { CategoryRow } from \"../wizard/category-grid.js\";\n\ntype UseFrameworkFilteringOptions = {\n domain: Domain;\n allSelections: SkillId[];\n selections: CategorySelections;\n installedSkillIds?: SkillId[];\n skillConfigs?: SkillConfig[];\n filterIncompatible?: boolean;\n};\n\nexport function useFrameworkFiltering({\n domain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n}: UseFrameworkFilteringOptions): CategoryRow[] {\n return useMemo(\n () =>\n buildCategoriesForDomain(\n domain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n ),\n [domain, allSelections, selections, installedSkillIds, skillConfigs, filterIncompatible],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,KAAK,gBAAgB;AAC9B,SAAgB,aAAa,WAAAA,gBAAe;;;ACD5C;AAAA,SAAS,eAAe;AAejB,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgD;AAC9C,SAAO;AAAA,IACL,MACE;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACF,CAAC,QAAQ,eAAe,YAAY,mBAAmB,cAAc,kBAAkB;AAAA,EACzF;AACF;;;ADyCQ;AApDD,IAAM,YAAsC,CAAC;AAAA,EAClD,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,KAAK,SAAS,gBAAgB,WAAW,IAAI,kBAAkB;AACvE,QAAM,eAAe,eAAe,CAAC,MAAM,EAAE,YAAY;AAEzD,QAAM,2BAA2B;AAAA,IAC/B,CAAC,OAAuB,eAAe,SAAS,EAAE,kBAAkB,EAAE;AAAA,IACtE,CAAC;AAAA,EACH;AAEA,QAAM,aAAa,sBAAsB;AAAA,IACvC,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,EAAE,YAAY,WAAW,IAAIC,SAAQ,MAAM;AAC/C,UAAM,UAAU,eAAe,SAAS,EAAE;AAC1C,QAAI,CAAC,QAAS,QAAO,EAAE,YAAY,GAAG,YAAY,EAAE;AACpD,UAAM,MAAM,WAAW,UAAU,CAAC,QAAQ,IAAI,QAAQ,KAAK,CAAC,MAAM,EAAE,OAAO,OAAO,CAAC;AACnF,QAAI,MAAM,EAAG,QAAO,EAAE,YAAY,GAAG,YAAY,EAAE;AACnD,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,YAAY,WAAW,GAAG,EAAE,QAAQ,UAAU,CAAC,MAAM,EAAE,OAAO,OAAO;AAAA,IACvE;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AAEf,WAAS,CAAC,QAAQ,QAAQ;AACxB,QAAI,IAAI,QAAQ;AACd,iBAAW;AAAA,IACb,WAAW,IAAI,QAAQ;AACrB,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SACE,oBAAC,OAAI,eAAc,UAAS,OAAM,QAAO,UAAU,GAAG,WAAW,GAC/D,8BAAC,OAAI,KAAK,SAAS,UAAU,GAAG,WAAW,GACzC;AAAA,IAAC;AAAA;AAAA,MAEC;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA,MACA,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,sBAAsB;AAAA;AAAA,IATjB;AAAA,EAUP,GACF,GACF;AAEJ;","names":["useMemo","useMemo"]}
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-P56WJ5FA.js";
5
+
6
+ // src/cli/components/hooks/use-modal-state.ts
7
+ init_esm_shims();
8
+ import { useState, useCallback } from "react";
9
+ function useModalState() {
10
+ const [context, setContext] = useState(null);
11
+ const isOpen = context !== null;
12
+ const open = useCallback((ctx) => {
13
+ setContext(ctx);
14
+ }, []);
15
+ const close = useCallback(() => {
16
+ setContext(null);
17
+ }, []);
18
+ return { isOpen, context, open, close };
19
+ }
20
+
21
+ export {
22
+ useModalState
23
+ };
24
+ //# sourceMappingURL=chunk-NIKUMXE7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/components/hooks/use-modal-state.ts"],"sourcesContent":["import { useState, useCallback } from \"react\";\n\ntype UseModalStateResult<T> = {\n isOpen: boolean;\n context: T | null;\n open: (ctx: T) => void;\n close: () => void;\n};\n\n/**\n * Manages modal open/close lifecycle with optional typed context.\n * `open(ctx)` stores context and sets isOpen; `close()` resets both.\n */\nexport function useModalState<T = boolean>(): UseModalStateResult<T> {\n const [context, setContext] = useState<T | null>(null);\n\n const isOpen = context !== null;\n\n const open = useCallback((ctx: T) => {\n setContext(ctx);\n }, []);\n\n const close = useCallback(() => {\n setContext(null);\n }, []);\n\n return { isOpen, context, open, close };\n}\n"],"mappings":";;;;;;AAAA;AAAA,SAAS,UAAU,mBAAmB;AAa/B,SAAS,gBAAqD;AACnE,QAAM,CAAC,SAAS,UAAU,IAAI,SAAmB,IAAI;AAErD,QAAM,SAAS,YAAY;AAE3B,QAAM,OAAO,YAAY,CAAC,QAAW;AACnC,eAAW,GAAG;AAAA,EAChB,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ,YAAY,MAAM;AAC9B,eAAW,IAAI;AAAA,EACjB,GAAG,CAAC,CAAC;AAEL,SAAO,EAAE,QAAQ,SAAS,MAAM,MAAM;AACxC;","names":[]}