agents-inc 0.151.0 → 0.152.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +25 -25
  3. package/dist/{chunk-YA4QQKKE.js → chunk-5GUOIJSG.js} +3 -7
  4. package/dist/{chunk-YA4QQKKE.js.map → chunk-5GUOIJSG.js.map} +1 -1
  5. package/dist/{chunk-44LLPS2N.js → chunk-5UWKOOIS.js} +6 -26
  6. package/dist/chunk-5UWKOOIS.js.map +1 -0
  7. package/dist/{chunk-O5ASLZ2K.js → chunk-76ADG7LQ.js} +1 -5
  8. package/dist/{chunk-O5ASLZ2K.js.map → chunk-76ADG7LQ.js.map} +1 -1
  9. package/dist/{chunk-WK4J2CHH.js → chunk-BNSRA6HL.js} +13 -18
  10. package/dist/{chunk-WK4J2CHH.js.map → chunk-BNSRA6HL.js.map} +1 -1
  11. package/dist/{chunk-FYPUUYSG.js → chunk-DTSG5XZB.js} +3 -7
  12. package/dist/{chunk-FYPUUYSG.js.map → chunk-DTSG5XZB.js.map} +1 -1
  13. package/dist/{chunk-NGLQ5W7U.js → chunk-E5X6RJ4E.js} +5 -15
  14. package/dist/chunk-E5X6RJ4E.js.map +1 -0
  15. package/dist/{chunk-TVHRMRD3.js → chunk-EEPELKOM.js} +4008 -4084
  16. package/dist/chunk-EEPELKOM.js.map +1 -0
  17. package/dist/{chunk-NIKUMXE7.js → chunk-F7T5AFFN.js} +1 -5
  18. package/dist/{chunk-NIKUMXE7.js.map → chunk-F7T5AFFN.js.map} +1 -1
  19. package/dist/{chunk-LAXAQ3PZ.js → chunk-FVDKAVOL.js} +10 -14
  20. package/dist/{chunk-LAXAQ3PZ.js.map → chunk-FVDKAVOL.js.map} +1 -1
  21. package/dist/{chunk-BNE4HHIH.js → chunk-GRVKW3CC.js} +2 -6
  22. package/dist/{chunk-BNE4HHIH.js.map → chunk-GRVKW3CC.js.map} +1 -1
  23. package/dist/{chunk-3XFUQ6OL.js → chunk-IHUY4M22.js} +4 -8
  24. package/dist/{chunk-3XFUQ6OL.js.map → chunk-IHUY4M22.js.map} +1 -1
  25. package/dist/{chunk-OZZGXBCN.js → chunk-IUQBOCSU.js} +1 -5
  26. package/dist/{chunk-OZZGXBCN.js.map → chunk-IUQBOCSU.js.map} +1 -1
  27. package/dist/{chunk-LYYXX2W5.js → chunk-J27W6TXS.js} +4 -6
  28. package/dist/{chunk-LYYXX2W5.js.map → chunk-J27W6TXS.js.map} +1 -1
  29. package/dist/chunk-JFLVEFFP.js +16 -0
  30. package/dist/chunk-JFLVEFFP.js.map +1 -0
  31. package/dist/{chunk-PV2HNW4I.js → chunk-KFB5CRXZ.js} +7 -12
  32. package/dist/{chunk-PV2HNW4I.js.map → chunk-KFB5CRXZ.js.map} +1 -1
  33. package/dist/{chunk-SYUOXSPU.js → chunk-KR65TPKC.js} +168 -14
  34. package/dist/chunk-KR65TPKC.js.map +1 -0
  35. package/dist/{chunk-KOPEM3Q7.js → chunk-KXYVJGJP.js} +2 -6
  36. package/dist/{chunk-KOPEM3Q7.js.map → chunk-KXYVJGJP.js.map} +1 -1
  37. package/dist/{chunk-TYJLR32W.js → chunk-L7SZXUBJ.js} +9 -14
  38. package/dist/{chunk-TYJLR32W.js.map → chunk-L7SZXUBJ.js.map} +1 -1
  39. package/dist/{chunk-NHCGC6DG.js → chunk-LASI35KT.js} +4 -9
  40. package/dist/{chunk-NHCGC6DG.js.map → chunk-LASI35KT.js.map} +1 -1
  41. package/dist/{chunk-VG2TVBFN.js → chunk-LDP5ASDM.js} +2 -6
  42. package/dist/{chunk-VG2TVBFN.js.map → chunk-LDP5ASDM.js.map} +1 -1
  43. package/dist/{chunk-5V2O6C3T.js → chunk-LZ52XEPR.js} +4 -8
  44. package/dist/{chunk-5V2O6C3T.js.map → chunk-LZ52XEPR.js.map} +1 -1
  45. package/dist/{chunk-WFWCZEMS.js → chunk-M7HO7NBK.js} +4 -8
  46. package/dist/{chunk-WFWCZEMS.js.map → chunk-M7HO7NBK.js.map} +1 -1
  47. package/dist/{chunk-XA57SX4T.js → chunk-MJ2KHG24.js} +4 -8
  48. package/dist/{chunk-XA57SX4T.js.map → chunk-MJ2KHG24.js.map} +1 -1
  49. package/dist/{chunk-DAG2ULNF.js → chunk-MM7CTTAV.js} +2 -6
  50. package/dist/chunk-MM7CTTAV.js.map +1 -0
  51. package/dist/{chunk-UFURYGD3.js → chunk-MQ7FLIYS.js} +2 -6
  52. package/dist/{chunk-UFURYGD3.js.map → chunk-MQ7FLIYS.js.map} +1 -1
  53. package/dist/{chunk-SI5FOARI.js → chunk-MVR3SYMN.js} +6 -8
  54. package/dist/chunk-MVR3SYMN.js.map +1 -0
  55. package/dist/{chunk-UTFN6UJS.js → chunk-MWG4VU64.js} +12 -17
  56. package/dist/{chunk-UTFN6UJS.js.map → chunk-MWG4VU64.js.map} +1 -1
  57. package/dist/{chunk-ES3NJZON.js → chunk-NR3OZGL4.js} +1 -5
  58. package/dist/{chunk-ES3NJZON.js.map → chunk-NR3OZGL4.js.map} +1 -1
  59. package/dist/{chunk-GYG5SE2D.js → chunk-ODNDXQH2.js} +2 -6
  60. package/dist/{chunk-GYG5SE2D.js.map → chunk-ODNDXQH2.js.map} +1 -1
  61. package/dist/{chunk-2RSNKBXC.js → chunk-P44SXVH3.js} +6 -10
  62. package/dist/{chunk-2RSNKBXC.js.map → chunk-P44SXVH3.js.map} +1 -1
  63. package/dist/{chunk-3LIU2ZEF.js → chunk-PMM2MYMA.js} +3 -16
  64. package/dist/{chunk-3LIU2ZEF.js.map → chunk-PMM2MYMA.js.map} +1 -1
  65. package/dist/{chunk-QTFQEYDA.js → chunk-PZIZNMHK.js} +24 -36
  66. package/dist/chunk-PZIZNMHK.js.map +1 -0
  67. package/dist/{chunk-C55DN7GE.js → chunk-Q2KG7UV3.js} +3 -5
  68. package/dist/chunk-Q2KG7UV3.js.map +1 -0
  69. package/dist/{chunk-QQLRX4KI.js → chunk-Q45ZU6HD.js} +2 -6
  70. package/dist/{chunk-QQLRX4KI.js.map → chunk-Q45ZU6HD.js.map} +1 -1
  71. package/dist/{chunk-6RBQBOBS.js → chunk-QRDTLVXG.js} +9 -14
  72. package/dist/{chunk-6RBQBOBS.js.map → chunk-QRDTLVXG.js.map} +1 -1
  73. package/dist/{chunk-YBVA7GPW.js → chunk-QZZJFYUQ.js} +3 -7
  74. package/dist/{chunk-YBVA7GPW.js.map → chunk-QZZJFYUQ.js.map} +1 -1
  75. package/dist/{chunk-OJIESW5B.js → chunk-R5NOI2LP.js} +13 -17
  76. package/dist/{chunk-OJIESW5B.js.map → chunk-R5NOI2LP.js.map} +1 -1
  77. package/dist/{chunk-DUVWGO6E.js → chunk-RNJWAKMO.js} +3 -7
  78. package/dist/{chunk-DUVWGO6E.js.map → chunk-RNJWAKMO.js.map} +1 -1
  79. package/dist/{chunk-4R6PGHQQ.js → chunk-SBHBBZKF.js} +7 -23
  80. package/dist/chunk-SBHBBZKF.js.map +1 -0
  81. package/dist/{chunk-NM3EDGB5.js → chunk-SKQWRUPX.js} +10 -14
  82. package/dist/{chunk-NM3EDGB5.js.map → chunk-SKQWRUPX.js.map} +1 -1
  83. package/dist/{chunk-Y4CXDA3I.js → chunk-STMHDOZD.js} +4 -21
  84. package/dist/chunk-STMHDOZD.js.map +1 -0
  85. package/dist/{chunk-SHHOMVWC.js → chunk-SX5H6TSC.js} +7 -11
  86. package/dist/chunk-SX5H6TSC.js.map +1 -0
  87. package/dist/{chunk-RBHYLCUB.js → chunk-TJJPWUMA.js} +2 -6
  88. package/dist/{chunk-RBHYLCUB.js.map → chunk-TJJPWUMA.js.map} +1 -1
  89. package/dist/{chunk-IOJR5TOY.js → chunk-TSIU7DME.js} +1 -5
  90. package/dist/{chunk-IOJR5TOY.js.map → chunk-TSIU7DME.js.map} +1 -1
  91. package/dist/{chunk-EVXG3X6G.js → chunk-TUPYW2IQ.js} +3 -7
  92. package/dist/{chunk-EVXG3X6G.js.map → chunk-TUPYW2IQ.js.map} +1 -1
  93. package/dist/{chunk-YU2VGX5R.js → chunk-UBEDZ4FD.js} +1 -8
  94. package/dist/{chunk-YU2VGX5R.js.map → chunk-UBEDZ4FD.js.map} +1 -1
  95. package/dist/{chunk-VEP23B5W.js → chunk-VASLW636.js} +1 -5
  96. package/dist/{chunk-VEP23B5W.js.map → chunk-VASLW636.js.map} +1 -1
  97. package/dist/{chunk-PG4G4IIK.js → chunk-VY6MNOXL.js} +2 -6
  98. package/dist/{chunk-PG4G4IIK.js.map → chunk-VY6MNOXL.js.map} +1 -1
  99. package/dist/{chunk-IHO75PMZ.js → chunk-WBCPLH66.js} +15 -13
  100. package/dist/chunk-WBCPLH66.js.map +1 -0
  101. package/dist/{chunk-DG2NGZ7S.js → chunk-WKTHWQKM.js} +2 -7
  102. package/dist/{chunk-DG2NGZ7S.js.map → chunk-WKTHWQKM.js.map} +1 -1
  103. package/dist/{chunk-EZ7STXUV.js → chunk-XHUODHZ4.js} +19 -25
  104. package/dist/{chunk-EZ7STXUV.js.map → chunk-XHUODHZ4.js.map} +1 -1
  105. package/dist/{chunk-KIR7VYQD.js → chunk-XVAQG2CV.js} +1 -5
  106. package/dist/{chunk-KIR7VYQD.js.map → chunk-XVAQG2CV.js.map} +1 -1
  107. package/dist/{chunk-P3PN5SVI.js → chunk-ZL7PFNHN.js} +2 -6
  108. package/dist/{chunk-P3PN5SVI.js.map → chunk-ZL7PFNHN.js.map} +1 -1
  109. package/dist/{chunk-3YGUHWLR.js → chunk-ZPPHXXAP.js} +9 -15
  110. package/dist/{chunk-3YGUHWLR.js.map → chunk-ZPPHXXAP.js.map} +1 -1
  111. package/dist/commands/build/marketplace.js +10 -15
  112. package/dist/commands/build/marketplace.js.map +1 -1
  113. package/dist/commands/build/plugins.js +9 -14
  114. package/dist/commands/build/plugins.js.map +1 -1
  115. package/dist/commands/compile.js +14 -19
  116. package/dist/commands/compile.js.map +1 -1
  117. package/dist/commands/doctor.js +13 -18
  118. package/dist/commands/doctor.js.map +1 -1
  119. package/dist/commands/edit.js +51 -55
  120. package/dist/commands/edit.js.map +1 -1
  121. package/dist/commands/eject.js +13 -18
  122. package/dist/commands/eject.js.map +1 -1
  123. package/dist/commands/import/skill.js +9 -14
  124. package/dist/commands/import/skill.js.map +1 -1
  125. package/dist/commands/init.js +50 -51
  126. package/dist/commands/list.js +14 -16
  127. package/dist/commands/list.js.map +1 -1
  128. package/dist/commands/new/agent.js +12 -16
  129. package/dist/commands/new/agent.js.map +1 -1
  130. package/dist/commands/new/marketplace.js +15 -20
  131. package/dist/commands/new/marketplace.js.map +1 -1
  132. package/dist/commands/new/skill.js +11 -13
  133. package/dist/commands/search.js +14 -19
  134. package/dist/commands/search.js.map +1 -1
  135. package/dist/commands/uninstall.js +17 -21
  136. package/dist/commands/uninstall.js.map +1 -1
  137. package/dist/commands/update.js +17 -21
  138. package/dist/commands/update.js.map +1 -1
  139. package/dist/commands/validate.js +10 -16
  140. package/dist/commands/validate.js.map +1 -1
  141. package/dist/components/common/confirm.js +1 -2
  142. package/dist/components/common/prompt-confirm.js +2 -2
  143. package/dist/components/common/select-list.js +3 -4
  144. package/dist/components/common/spinner.js +1 -2
  145. package/dist/components/wizard/category-grid.js +8 -9
  146. package/dist/components/wizard/checkbox-grid.js +6 -7
  147. package/dist/components/wizard/domain-selection.js +14 -15
  148. package/dist/components/wizard/run-wizard-session.js +40 -40
  149. package/dist/components/wizard/scroll-affordance.js +2 -3
  150. package/dist/components/wizard/search-modal.js +6 -7
  151. package/dist/components/wizard/selection-card.js +2 -3
  152. package/dist/components/wizard/skill-agent-summary.js +8 -9
  153. package/dist/components/wizard/source-grid.js +13 -14
  154. package/dist/components/wizard/stack-selection.js +12 -13
  155. package/dist/components/wizard/step-agents.js +14 -15
  156. package/dist/components/wizard/step-build.js +14 -15
  157. package/dist/components/wizard/step-confirm.js +13 -14
  158. package/dist/components/wizard/step-settings.js +11 -12
  159. package/dist/components/wizard/step-sources.js +20 -21
  160. package/dist/components/wizard/step-stack.js +13 -14
  161. package/dist/components/wizard/summary-panel.js +12 -13
  162. package/dist/components/wizard/toast.js +2 -3
  163. package/dist/components/wizard/wizard-layout.js +18 -19
  164. package/dist/components/wizard/wizard-tabs.js +8 -9
  165. package/dist/components/wizard/wizard.js +38 -39
  166. package/dist/config-exports.js +1 -7
  167. package/dist/config-exports.js.map +1 -1
  168. package/dist/copy-local-skills-6EMVN7RB.js +14 -0
  169. package/dist/hooks/init.js +50 -54
  170. package/dist/hooks/init.js.map +1 -1
  171. package/dist/index.js +0 -4
  172. package/dist/index.js.map +1 -1
  173. package/dist/load-agent-defs-BWOUVEAR.js +15 -0
  174. package/dist/{loader-E2ERJYVA.js → loader-5JP4S7CJ.js} +4 -5
  175. package/dist/recompile-project-agents-6DL45TDI.js +19 -0
  176. package/dist/{source-loader-5UNRU7EZ.js → source-loader-MZYCPL2S.js} +7 -8
  177. package/dist/stores/wizard-store.js +7 -8
  178. package/package.json +15 -14
  179. package/dist/chunk-44LLPS2N.js.map +0 -1
  180. package/dist/chunk-4R6PGHQQ.js.map +0 -1
  181. package/dist/chunk-7QIHKQL5.js +0 -181
  182. package/dist/chunk-7QIHKQL5.js.map +0 -1
  183. package/dist/chunk-C55DN7GE.js.map +0 -1
  184. package/dist/chunk-DAG2ULNF.js.map +0 -1
  185. package/dist/chunk-DIBCRIMR.js +0 -36
  186. package/dist/chunk-DIBCRIMR.js.map +0 -1
  187. package/dist/chunk-EKWAUOQB.js +0 -96
  188. package/dist/chunk-EKWAUOQB.js.map +0 -1
  189. package/dist/chunk-I3XKEGHM.js +0 -16383
  190. package/dist/chunk-I3XKEGHM.js.map +0 -1
  191. package/dist/chunk-IHO75PMZ.js.map +0 -1
  192. package/dist/chunk-K3OU6TGX.js +0 -77
  193. package/dist/chunk-K3OU6TGX.js.map +0 -1
  194. package/dist/chunk-KSZ6PCY4.js +0 -43
  195. package/dist/chunk-KSZ6PCY4.js.map +0 -1
  196. package/dist/chunk-NGLQ5W7U.js.map +0 -1
  197. package/dist/chunk-P56WJ5FA.js +0 -50
  198. package/dist/chunk-P56WJ5FA.js.map +0 -1
  199. package/dist/chunk-QTFQEYDA.js.map +0 -1
  200. package/dist/chunk-SHHOMVWC.js.map +0 -1
  201. package/dist/chunk-SI5FOARI.js.map +0 -1
  202. package/dist/chunk-SYUOXSPU.js.map +0 -1
  203. package/dist/chunk-THKIOI32.js +0 -939
  204. package/dist/chunk-THKIOI32.js.map +0 -1
  205. package/dist/chunk-TVHRMRD3.js.map +0 -1
  206. package/dist/chunk-V7QOSGQA.js +0 -298
  207. package/dist/chunk-V7QOSGQA.js.map +0 -1
  208. package/dist/chunk-Y4CXDA3I.js.map +0 -1
  209. package/dist/components/common/confirm.test.js +0 -203
  210. package/dist/components/common/confirm.test.js.map +0 -1
  211. package/dist/components/wizard/category-grid.test.js +0 -1253
  212. package/dist/components/wizard/category-grid.test.js.map +0 -1
  213. package/dist/components/wizard/checkbox-grid.test.js +0 -264
  214. package/dist/components/wizard/checkbox-grid.test.js.map +0 -1
  215. package/dist/components/wizard/search-modal.test.js +0 -212
  216. package/dist/components/wizard/search-modal.test.js.map +0 -1
  217. package/dist/components/wizard/source-grid.test.js +0 -1094
  218. package/dist/components/wizard/source-grid.test.js.map +0 -1
  219. package/dist/components/wizard/step-agents.test.js +0 -204
  220. package/dist/components/wizard/step-agents.test.js.map +0 -1
  221. package/dist/components/wizard/step-build.test.js +0 -552
  222. package/dist/components/wizard/step-build.test.js.map +0 -1
  223. package/dist/components/wizard/step-confirm.test.js +0 -744
  224. package/dist/components/wizard/step-confirm.test.js.map +0 -1
  225. package/dist/components/wizard/step-settings.test.js +0 -244
  226. package/dist/components/wizard/step-settings.test.js.map +0 -1
  227. package/dist/components/wizard/step-sources.test.js +0 -155
  228. package/dist/components/wizard/step-sources.test.js.map +0 -1
  229. package/dist/components/wizard/step-stack.test.js +0 -262
  230. package/dist/components/wizard/step-stack.test.js.map +0 -1
  231. package/dist/components/wizard/summary-panel.test.js +0 -317
  232. package/dist/components/wizard/summary-panel.test.js.map +0 -1
  233. package/dist/components/wizard/wizard-layout.test.js +0 -200
  234. package/dist/components/wizard/wizard-layout.test.js.map +0 -1
  235. package/dist/components/wizard/wizard-tabs.test.js +0 -290
  236. package/dist/components/wizard/wizard-tabs.test.js.map +0 -1
  237. package/dist/copy-local-skills-UPA2GUZV.js +0 -15
  238. package/dist/dist-VNJNNJK7.js +0 -550
  239. package/dist/dist-VNJNNJK7.js.map +0 -1
  240. package/dist/load-agent-defs-SB4XAOVB.js +0 -16
  241. package/dist/magic-string.es-5TV73NJD.js +0 -1316
  242. package/dist/magic-string.es-5TV73NJD.js.map +0 -1
  243. package/dist/recompile-project-agents-U4ZY2GDX.js +0 -20
  244. package/dist/source-manager-3O54SIIB.js +0 -18
  245. package/dist/source-manager-3O54SIIB.js.map +0 -1
  246. package/dist/stores/d227-same-scope-tombstone-duplicate.test.js +0 -118
  247. package/dist/stores/d227-same-scope-tombstone-duplicate.test.js.map +0 -1
  248. package/dist/stores/wizard-store.test.js +0 -3053
  249. package/dist/stores/wizard-store.test.js.map +0 -1
  250. /package/dist/{copy-local-skills-UPA2GUZV.js.map → copy-local-skills-6EMVN7RB.js.map} +0 -0
  251. /package/dist/{load-agent-defs-SB4XAOVB.js.map → load-agent-defs-BWOUVEAR.js.map} +0 -0
  252. /package/dist/{loader-E2ERJYVA.js.map → loader-5JP4S7CJ.js.map} +0 -0
  253. /package/dist/{recompile-project-agents-U4ZY2GDX.js.map → recompile-project-agents-6DL45TDI.js.map} +0 -0
  254. /package/dist/{source-loader-5UNRU7EZ.js.map → source-loader-MZYCPL2S.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/consts.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport type { Domain } from \"./types/index.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// After tsup build, dist/ is flat, so we go up one level from dist/ to get CLI root\n// In development (src/cli/consts.ts), we go up two levels\nconst isInDist = __dirname.includes(\"/dist\");\nconst CLI_ROOT = isInDist ? path.resolve(__dirname, \"..\") : path.resolve(__dirname, \"../..\");\nexport const PROJECT_ROOT = CLI_ROOT;\n\nexport const CLAUDE_DIR = \".claude\";\nexport const CLAUDE_SRC_DIR = \".claude-src\";\nexport const PLUGINS_SUBDIR = \"plugins\";\nexport const PLUGIN_MANIFEST_DIR = \".claude-plugin\";\nexport const PLUGIN_MANIFEST_FILE = \"plugin.json\";\nexport const MARKETPLACE_JSON = \"marketplace.json\";\n\n/** Compiled plugin output directory, relative to a marketplace root */\nexport const PLUGINS_DIST_PATH = \"dist/plugins\";\n\n/** Path to the marketplace manifest inside a marketplace/source root. */\nexport function marketplaceManifestPath(dir: string): string {\n return path.join(dir, PLUGIN_MANIFEST_DIR, MARKETPLACE_JSON);\n}\nexport const DEFAULT_PLUGIN_NAME = \"agents-inc\";\n\n/** Home directory used as the root for global installations */\nexport const GLOBAL_INSTALL_ROOT = os.homedir();\n\nexport const CACHE_DIR = path.join(os.homedir(), \".cache\", DEFAULT_PLUGIN_NAME);\n\n/**\n * Promoted invocation prefix shown in user-facing messages (e.g. \"Run '<CLI_INVOKE_COMMAND> init'\").\n *\n * `bin` in package.json registers BOTH names — `agents-inc` (primary, matching this constant and\n * the package name) and `agentsinc` (kept so existing global installs keep working). A global\n * install therefore answers to either spelling.\n *\n * `agents-inc` rather than `agentsinc` because it is the published package name, so `npx\n * agents-inc` resolves with nothing installed, and it is what agentsinc.sh hands people when they\n * copy an install command.\n *\n * CONVENTION: every user-facing instruction in this repo — messages, docs, code comments, agent\n * playbooks — writes commands in this `npx agents-inc <cmd>` form. Prose that merely names a\n * command (\"the `agents-inc list` table\") does not.\n */\nexport const CLI_INVOKE_COMMAND = \"npx agents-inc\";\n\n/**\n * Internal `edit` flag marking the invocation as the project-setup half of a `cc init`\n * that routed through the dashboard. Not part of the documented CLI surface (declared\n * `hidden`): `init` is the only caller, and it passes the flag so `edit` can tell\n * \"set this project up\" apart from a bare inspection.\n */\nexport const EDIT_PROJECT_SETUP_FLAG = \"project-setup\";\n\nexport const SKILL_CATEGORIES_PATH = \"config/skill-categories.ts\";\nexport const SKILL_RULES_PATH = \"config/skill-rules.ts\";\nexport const STACKS_FILE_PATH = \"config/stacks.ts\";\n/** Source root directory inside a marketplace/source repo (holds skills/, agents/, etc.). */\nexport const SOURCE_SRC_DIR = \"src\";\nexport const SKILLS_DIR_PATH = `${SOURCE_SRC_DIR}/skills`;\nexport const LOCAL_SKILLS_PATH = \".claude/skills\";\n\n/** Synthetic source name for skills copied into the project (ejected) rather than installed as plugins. */\nexport const EJECT_SOURCE = \"eject\";\n\n/** Pseudo-category assigned to local skills — not a `Category` union member; category traversals skip it. */\nexport const LOCAL_PSEUDO_CATEGORY = \"local\";\n\nexport const DIRS = {\n agents: \"src/agents\",\n skills: SKILLS_DIR_PATH,\n stacks: \"src/stacks\",\n templates: \"src/agents/_templates\",\n commands: \"src/commands\",\n} as const;\n\n/** Single source for the metadata file name shared by skill and agent metadata. */\nconst METADATA_YAML_FILE = \"metadata.yaml\";\n\nexport const STANDARD_FILES = {\n SKILL_MD: \"SKILL.md\",\n METADATA_YAML: METADATA_YAML_FILE,\n METADATA_JSON: \"metadata.json\",\n CONFIG_YAML: \"config.yaml\",\n SKILL_CATEGORIES_TS: \"skill-categories.ts\",\n SKILL_RULES_TS: \"skill-rules.ts\",\n AGENT_METADATA_YAML: METADATA_YAML_FILE,\n PLUGIN_JSON: PLUGIN_MANIFEST_FILE,\n CONFIG_TS: \"config.ts\",\n CONFIG_TYPES_TS: \"config-types.ts\",\n CLAUDE_MD: \"CLAUDE.md\",\n README_MD: \"README.md\",\n REFERENCE_MD: \"reference.md\",\n IDENTITY_MD: \"identity.md\",\n PLAYBOOK_MD: \"playbook.md\",\n OUTPUT_MD: \"output.md\",\n CRITICAL_REQUIREMENTS_MD: \"critical-requirements.md\",\n CRITICAL_REMINDERS_MD: \"critical-reminders.md\",\n SETTINGS_JSON: \"settings.json\",\n SETTINGS_LOCAL_JSON: \"settings.local.json\",\n} as const;\n\nexport const STANDARD_DIRS = {\n EXAMPLES: \"examples\",\n SCRIPTS: \"scripts\",\n SKILLS: \"skills\",\n AGENTS: \"agents\",\n COMMANDS: \"commands\",\n /** Legacy per-project template override directory (`.claude/templates`). */\n TEMPLATES: \"templates\",\n} as const;\n\nexport const DEFAULT_VERSION = \"1.0.0\";\n\n// \"0.0.0\" indicates no version was explicitly set\nexport const DEFAULT_DISPLAY_VERSION = \"0.0.0\";\n\n// JSON Schema URLs for yaml-language-server $schema comments.\n// Uses raw.githubusercontent.com so schemas resolve without requiring the CLI as a dependency.\n// The prefix encodes two things that have each moved once: the repository name (renamed to\n// agents-inc/agents-inc on 2026-08-04, when it stopped being only the CLI) and this package's\n// location inside it (packages/cli, since the monorepo merge). If either moves again this must\n// move with it, or every generated $schema comment 404s. GitHub redirects the old forms — files\n// written before each move still resolve, verified two renames deep — but a redirect is a\n// courtesy, so what we emit should be the current address rather than rely on one.\nconst SCHEMA_PKG_PREFIX =\n \"https://raw.githubusercontent.com/agents-inc/agents-inc/main/packages/cli/src/schemas\";\n\nexport const SCHEMA_PATHS = {\n agent: `${SCHEMA_PKG_PREFIX}/agent.schema.json`,\n metadata: `${SCHEMA_PKG_PREFIX}/metadata.schema.json`,\n customMetadata: `${SCHEMA_PKG_PREFIX}/custom-metadata.schema.json`,\n marketplace: `${SCHEMA_PKG_PREFIX}/marketplace.schema.json`,\n projectConfig: `${SCHEMA_PKG_PREFIX}/project-config.schema.json`,\n projectSourceConfig: `${SCHEMA_PKG_PREFIX}/project-source-config.schema.json`,\n stacks: `${SCHEMA_PKG_PREFIX}/stacks.schema.json`,\n} as const;\n\nexport const YAML_FORMATTING = {\n INDENT: 2,\n LINE_WIDTH: 120,\n /** lineWidth: 0 disables wrapping — used for metadata files */\n LINE_WIDTH_NONE: 0,\n} as const;\n\n// Shared glyphs: SELECTED/CHECK render the same checkmark; SKIPPED/DISABLED the\n// same en-dash. Both keys are kept so call sites express intent, but the value\n// has a single source.\nconst CHECK_GLYPH = \"\\u2713\";\nconst EN_DASH_GLYPH = \"\\u2013\";\n\nexport const UI_SYMBOLS = {\n CHECKBOX_CHECKED: \"[x]\",\n CHECKBOX_UNCHECKED: \"[ ]\",\n CHEVRON: \"\\u276F\",\n CHEVRON_SPACER: \" \",\n SELECTED: CHECK_GLYPH,\n UNSELECTED: \"\\u25CB\",\n CURRENT: \"\\u25CF\",\n SKIPPED: EN_DASH_GLYPH,\n DISCOURAGED: \"!\",\n DISABLED: EN_DASH_GLYPH,\n LOCK: \"\\uD83D\\uDD12\",\n EJECT: \"\\u23CF\",\n BULLET: \"\\u2022\",\n SCROLL_UP: \"\\u25B2\",\n SCROLL_DOWN: \"\\u25BC\",\n CHECK: CHECK_GLYPH,\n CROSS: \"\\u2717\",\n /** Removed/pending-removal diff marker (ASCII hyphen). Info panel + Sources tab share it. */\n REMOVED: \"-\",\n /** Added/newly-selected diff marker (ASCII plus). Info panel + Sources tab share it. */\n ADDED: \"+\",\n} as const;\n\nexport const GITHUB_SOURCE = {\n HTTPS_PREFIX: \"https://github.com/\",\n GITHUB_PREFIX: \"github:\",\n GH_PREFIX: \"gh:\",\n} as const;\n\n/** Conventional skills subdirectory name (same value as `STANDARD_DIRS.SKILLS`). */\nexport const DEFAULT_SKILLS_SUBDIR = STANDARD_DIRS.SKILLS;\n\n/** Name written into a global-scope config's `name` field (`~/.claude-src/config.ts`). */\nexport const GLOBAL_CONFIG_NAME = \"global\";\n\n/** Strict kebab-case: starts with letter, segments separated by single hyphens, no trailing hyphens */\nexport const KEBAB_CASE_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;\n\n/** Author handle format: `@` followed by a lowercase-led alphanumeric-hyphen slug. */\nexport const AUTHOR_HANDLE_PATTERN = /^@[a-z][a-z0-9-]*$/;\n\nexport const HASH_PREFIX_LENGTH = 7;\n\n/** Hex chars from SHA-256 hash used in cache directory names (64 bits of collision resistance) */\nexport const CACHE_HASH_LENGTH = 16;\n\n/** Max chars of human-readable prefix in cache directory names (for debugging) */\nexport const CACHE_READABLE_PREFIX_LENGTH = 32;\n\n// File size limits for parsing boundaries (DoS prevention)\nconst ONE_MB = 1024 * 1024;\nexport const MAX_MARKETPLACE_FILE_SIZE = 10 * ONE_MB;\nexport const MAX_PLUGIN_FILE_SIZE = ONE_MB;\nexport const MAX_CONFIG_FILE_SIZE = ONE_MB;\n\nexport const MAX_JSON_NESTING_DEPTH = 10;\nexport const MAX_MARKETPLACE_PLUGINS = 10_000;\n\nexport const SCROLL_VIEWPORT = {\n /** Height of the \"N more above\" scroll indicator */\n SCROLL_INDICATOR_HEIGHT: 1,\n /** Estimated lines per category name row (including top margin) */\n CATEGORY_NAME_LINES: 2,\n /** Margin between category sections (marginTop on CategorySection) */\n CATEGORY_MARGIN_LINES: 1,\n /** Minimum rows to show at least 1 category before enabling scroll */\n MIN_VIEWPORT_ROWS: 5,\n} as const;\n\n/**\n * The terminal geometry every command refuses to run below. This is the only\n * minimum-size gate there is: `BaseCommand.ensureTerminalSize` reads it and\n * blocks until the terminal is at least this big, so raising `ROWS` raises the\n * bar for the whole CLI, tests included.\n *\n * `ROWS: 20` is measured, not guessed. Driving the real binary to the build\n * step — the binding constraint, since it is the tallest step — gives:\n * 15/16/17 corrupt (overlapping card borders, unreadable); 18 the first clean\n * render (one complete category card, correctly clipped); 20 clean with one\n * full card plus the next category heading; 24 comfortable. 18 is the hard\n * correctness floor because it is where {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}\n * starts being satisfied — below it the shared scroll gate stops clipping and\n * the grid bleeds over its borders. 20 buys two rows of margin above that floor\n * while staying under the 24-row default of common terminals.\n */\nexport const MIN_TERMINAL_SIZE = {\n COLS: 80,\n ROWS: 20,\n} as const;\n\n/**\n * The terminal height at or above which the stack step paints the six-row ASCII\n * logo. Below it the logo is dropped — it is decoration, and the stack list is\n * the content.\n *\n * This is NOT a second size gate. {@link MIN_TERMINAL_SIZE} decides whether a\n * command runs at all; this decides only whether one decorative element renders\n * inside a terminal that already cleared that gate. Conflating them would be a\n * regression in both directions: raising `MIN_TERMINAL_SIZE.ROWS` to 26 would\n * refuse to run in the 24-row terminal that is still a common default, and\n * lowering this to 20 brings back the bleed below.\n *\n * 26 is measured against the real binary at 100 columns, on the stack step:\n *\n * | rows | stack step with the logo rendered |\n * | ---- | ----------------------------------------------------------------- |\n * | 20 | bleeds — stack rows paint over the \"Start from scratch\" row |\n * | 24 | bleeds — stack rows paint through the hotkey row and the footer |\n * | 26 | clean |\n * | 27 | clean |\n * | 28 | clean |\n *\n * The mechanism: the logo eats six rows of the stack step's list viewport,\n * starving it below {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}, at which point\n * the shared scroll hooks stop clipping and the rows bleed. Hiding the logo\n * returns those rows to the viewport; the bail-instead-of-clip behaviour itself\n * is untouched and remains the open underlying defect.\n */\nexport const LOGO_MIN_TERMINAL_ROWS = 26;\n\nexport const DEFAULT_BRANDING = {\n NAME: \"Agents Inc.\",\n TAGLINE: \"AI-powered development tools\",\n} as const;\n\n/**\n * Fallback name for the default public marketplace when marketplace.json is\n * unavailable. Same value as `DEFAULT_PLUGIN_NAME` but a distinct concept: this\n * is the resolved source/marketplace name, that is the plugin bundle name.\n */\nexport const DEFAULT_PUBLIC_SOURCE_NAME = DEFAULT_PLUGIN_NAME;\n\n/** Canonical name of the built-in public source. */\nexport const PUBLIC_SOURCE_NAME = \"public\";\n\n/** Human-readable labels for skill source types shown in the wizard and edit command */\nexport const SOURCE_DISPLAY_NAMES: Record<string, string> = {\n public: \"Public\",\n eject: \"Eject\",\n \"agents-inc\": \"Agents Inc\",\n};\n\n/**\n * Column-header labels for source types in the source grid. Distinct from\n * `SOURCE_DISPLAY_NAMES` (inline labels): headers read \"Local\"/\"Plugin\" where\n * the inline labels read \"Eject\"/\"Agents Inc\".\n */\nexport const SOURCE_HEADER_NAMES: Record<string, string> = {\n eject: \"Local\",\n \"agents-inc\": \"Plugin\",\n public: \"Public\",\n};\n\n/** Resolves a source name to its human-readable display label. */\nexport function formatSourceDisplayName(source: string): string {\n return SOURCE_DISPLAY_NAMES[source] ?? source;\n}\n\n/**\n * Marketplace-row value when skills are selected but every one of them is `EJECT_SOURCE`. \"eject\"\n * names no marketplace, so there is nothing to list — but the selection is not empty either, and\n * naming the default public marketplace would claim an origin none of those skills has.\n */\nexport const ALL_SKILLS_EJECTED_LABEL = \"All skills ejected\";\n\n// TODO: update naming convention to GRAY_1,2, etc\nexport const CLI_COLORS = {\n PRIMARY: \"#99FFFF\",\n SUCCESS: \"#90EE90\",\n ERROR: \"#DC343B\",\n WARNING: \"#E6A817\",\n INFO: \"#3B82F6\",\n NEUTRAL: \"#888888\",\n FOCUS: \"#87CEFA\",\n UNFOCUSED: \"#FFFFFF\",\n WHITE: \"#FFFFFF\",\n BLACK: \"#000000\",\n DIM: \"#666666\",\n GRAY_1: \"#ddd\",\n LABEL_BG: \"#383838\",\n TOAST_BG: \"#EEEEEE\",\n TOAST_FG: \"#000000\",\n HOVER_BG: \"#333333\",\n} as const;\n\n/** Canonical display order for built-in domains. Custom domains appear before these, alphabetically. */\nexport const BUILT_IN_DOMAIN_ORDER: readonly Domain[] = [\n \"web\",\n \"api\",\n \"ai\",\n \"mobile\",\n \"desktop\",\n \"cli\",\n \"infra\",\n \"meta\",\n \"shared\",\n];\n\n/** Default domains pre-selected when \"Start from scratch\" is chosen (all except CLI) */\nexport const DEFAULT_SCRATCH_DOMAINS: readonly Domain[] = [\"web\", \"api\", \"mobile\"];\n\n/** Domain used when no active domain can be resolved from wizard state. */\nexport const FALLBACK_DOMAIN: Domain = \"web\";\n\nexport const ASCII_LOGO = ` █████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ██╗███╗ ██╗ ██████╗\n██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██║████╗ ██║██╔════╝\n███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ██║██╔██╗ ██║██║\n██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ██║██║╚██╗██║██║\n██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ██║██║ ╚████║╚██████╗\n╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝`;\n"],"mappings":";;;;;;AAAA;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAG9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,KAAK,QAAQ,UAAU;AAIzC,IAAM,WAAW,UAAU,SAAS,OAAO;AAC3C,IAAM,WAAW,WAAW,KAAK,QAAQ,WAAW,IAAI,IAAI,KAAK,QAAQ,WAAW,OAAO;AACpF,IAAM,eAAe;AAErB,IAAM,aAAa;AACnB,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAGzB,IAAM,oBAAoB;AAG1B,SAAS,wBAAwB,KAAqB;AAC3D,SAAO,KAAK,KAAK,KAAK,qBAAqB,gBAAgB;AAC7D;AACO,IAAM,sBAAsB;AAG5B,IAAM,sBAAsB,GAAG,QAAQ;AAEvC,IAAM,YAAY,KAAK,KAAK,GAAG,QAAQ,GAAG,UAAU,mBAAmB;AAiBvE,IAAM,qBAAqB;AAQ3B,IAAM,0BAA0B;AAEhC,IAAM,wBAAwB;AAC9B,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;AAEzB,IAAM,iBAAiB;AACvB,IAAM,kBAAkB,GAAG,cAAc;AACzC,IAAM,oBAAoB;AAG1B,IAAM,eAAe;AAGrB,IAAM,wBAAwB;AAE9B,IAAM,OAAO;AAAA,EAClB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;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A,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,IAAM,wBAA2C;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,0BAA6C,CAAC,OAAO,OAAO,QAAQ;AAG1E,IAAM,kBAA0B;AAEhC,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/cli/consts.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport type { Domain } from \"./types/index.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// After tsup build, dist/ is flat, so we go up one level from dist/ to get CLI root\n// In development (src/cli/consts.ts), we go up two levels\nconst isInDist = __dirname.includes(\"/dist\");\nconst CLI_ROOT = isInDist ? path.resolve(__dirname, \"..\") : path.resolve(__dirname, \"../..\");\nexport const PROJECT_ROOT = CLI_ROOT;\n\nexport const CLAUDE_DIR = \".claude\";\nexport const CLAUDE_SRC_DIR = \".claude-src\";\nexport const PLUGINS_SUBDIR = \"plugins\";\nexport const PLUGIN_MANIFEST_DIR = \".claude-plugin\";\nexport const PLUGIN_MANIFEST_FILE = \"plugin.json\";\nexport const MARKETPLACE_JSON = \"marketplace.json\";\n\n/** Compiled plugin output directory, relative to a marketplace root */\nexport const PLUGINS_DIST_PATH = \"dist/plugins\";\n\n/** Path to the marketplace manifest inside a marketplace/source root. */\nexport function marketplaceManifestPath(dir: string): string {\n return path.join(dir, PLUGIN_MANIFEST_DIR, MARKETPLACE_JSON);\n}\nexport const DEFAULT_PLUGIN_NAME = \"agents-inc\";\n\n/** Home directory used as the root for global installations */\nexport const GLOBAL_INSTALL_ROOT = os.homedir();\n\nexport const CACHE_DIR = path.join(os.homedir(), \".cache\", DEFAULT_PLUGIN_NAME);\n\n/**\n * Promoted invocation prefix shown in user-facing messages (e.g. \"Run '<CLI_INVOKE_COMMAND> init'\").\n *\n * `bin` in package.json registers BOTH names — `agents-inc` (primary, matching this constant and\n * the package name) and `agentsinc` (kept so existing global installs keep working). A global\n * install therefore answers to either spelling.\n *\n * `agents-inc` rather than `agentsinc` because it is the published package name, so `npx\n * agents-inc` resolves with nothing installed, and it is what agentsinc.sh hands people when they\n * copy an install command.\n *\n * CONVENTION: every user-facing instruction in this repo — messages, docs, code comments, agent\n * playbooks — writes commands in this `npx agents-inc <cmd>` form. Prose that merely names a\n * command (\"the `agents-inc list` table\") does not.\n */\nexport const CLI_INVOKE_COMMAND = \"npx agents-inc\";\n\n/**\n * Internal `edit` flag marking the invocation as the project-setup half of a `cc init`\n * that routed through the dashboard. Not part of the documented CLI surface (declared\n * `hidden`): `init` is the only caller, and it passes the flag so `edit` can tell\n * \"set this project up\" apart from a bare inspection.\n */\nexport const EDIT_PROJECT_SETUP_FLAG = \"project-setup\";\n\nexport const SKILL_CATEGORIES_PATH = \"config/skill-categories.ts\";\nexport const SKILL_RULES_PATH = \"config/skill-rules.ts\";\nexport const STACKS_FILE_PATH = \"config/stacks.ts\";\n/** Source root directory inside a marketplace/source repo (holds skills/, agents/, etc.). */\nexport const SOURCE_SRC_DIR = \"src\";\nexport const SKILLS_DIR_PATH = `${SOURCE_SRC_DIR}/skills`;\nexport const LOCAL_SKILLS_PATH = \".claude/skills\";\n\n/** Synthetic source name for skills copied into the project (ejected) rather than installed as plugins. */\nexport const EJECT_SOURCE = \"eject\";\n\n/** Pseudo-category assigned to local skills — not a `Category` union member; category traversals skip it. */\nexport const LOCAL_PSEUDO_CATEGORY = \"local\";\n\nexport const DIRS = {\n agents: \"src/agents\",\n skills: SKILLS_DIR_PATH,\n stacks: \"src/stacks\",\n templates: \"src/agents/_templates\",\n commands: \"src/commands\",\n} as const;\n\n/** Single source for the metadata file name shared by skill and agent metadata. */\nconst METADATA_YAML_FILE = \"metadata.yaml\";\n\nexport const STANDARD_FILES = {\n SKILL_MD: \"SKILL.md\",\n METADATA_YAML: METADATA_YAML_FILE,\n METADATA_JSON: \"metadata.json\",\n CONFIG_YAML: \"config.yaml\",\n SKILL_CATEGORIES_TS: \"skill-categories.ts\",\n SKILL_RULES_TS: \"skill-rules.ts\",\n AGENT_METADATA_YAML: METADATA_YAML_FILE,\n PLUGIN_JSON: PLUGIN_MANIFEST_FILE,\n CONFIG_TS: \"config.ts\",\n CONFIG_TYPES_TS: \"config-types.ts\",\n CLAUDE_MD: \"CLAUDE.md\",\n README_MD: \"README.md\",\n REFERENCE_MD: \"reference.md\",\n IDENTITY_MD: \"identity.md\",\n PLAYBOOK_MD: \"playbook.md\",\n OUTPUT_MD: \"output.md\",\n CRITICAL_REQUIREMENTS_MD: \"critical-requirements.md\",\n CRITICAL_REMINDERS_MD: \"critical-reminders.md\",\n SETTINGS_JSON: \"settings.json\",\n SETTINGS_LOCAL_JSON: \"settings.local.json\",\n} as const;\n\nexport const STANDARD_DIRS = {\n EXAMPLES: \"examples\",\n SCRIPTS: \"scripts\",\n SKILLS: \"skills\",\n AGENTS: \"agents\",\n COMMANDS: \"commands\",\n /** Legacy per-project template override directory (`.claude/templates`). */\n TEMPLATES: \"templates\",\n} as const;\n\nexport const DEFAULT_VERSION = \"1.0.0\";\n\n// \"0.0.0\" indicates no version was explicitly set\nexport const DEFAULT_DISPLAY_VERSION = \"0.0.0\";\n\n// JSON Schema URLs for yaml-language-server $schema comments.\n// Uses raw.githubusercontent.com so schemas resolve without requiring the CLI as a dependency.\n// The prefix encodes two things that have each moved once: the repository name (renamed to\n// agents-inc/agents-inc on 2026-08-04, when it stopped being only the CLI) and this package's\n// location inside it (packages/cli, since the monorepo merge). If either moves again this must\n// move with it, or every generated $schema comment 404s. GitHub redirects the old forms — files\n// written before each move still resolve, verified two renames deep — but a redirect is a\n// courtesy, so what we emit should be the current address rather than rely on one.\nconst SCHEMA_PKG_PREFIX =\n \"https://raw.githubusercontent.com/agents-inc/agents-inc/main/packages/cli/src/schemas\";\n\nexport const SCHEMA_PATHS = {\n agent: `${SCHEMA_PKG_PREFIX}/agent.schema.json`,\n metadata: `${SCHEMA_PKG_PREFIX}/metadata.schema.json`,\n customMetadata: `${SCHEMA_PKG_PREFIX}/custom-metadata.schema.json`,\n marketplace: `${SCHEMA_PKG_PREFIX}/marketplace.schema.json`,\n projectConfig: `${SCHEMA_PKG_PREFIX}/project-config.schema.json`,\n projectSourceConfig: `${SCHEMA_PKG_PREFIX}/project-source-config.schema.json`,\n stacks: `${SCHEMA_PKG_PREFIX}/stacks.schema.json`,\n} as const;\n\nexport const YAML_FORMATTING = {\n INDENT: 2,\n LINE_WIDTH: 120,\n /** lineWidth: 0 disables wrapping — used for metadata files */\n LINE_WIDTH_NONE: 0,\n} as const;\n\n// Shared glyphs: SELECTED/CHECK render the same checkmark; SKIPPED/DISABLED the\n// same en-dash. Both keys are kept so call sites express intent, but the value\n// has a single source.\nconst CHECK_GLYPH = \"\\u2713\";\nconst EN_DASH_GLYPH = \"\\u2013\";\n\nexport const UI_SYMBOLS = {\n CHECKBOX_CHECKED: \"[x]\",\n CHECKBOX_UNCHECKED: \"[ ]\",\n CHEVRON: \"\\u276F\",\n CHEVRON_SPACER: \" \",\n SELECTED: CHECK_GLYPH,\n UNSELECTED: \"\\u25CB\",\n CURRENT: \"\\u25CF\",\n SKIPPED: EN_DASH_GLYPH,\n DISCOURAGED: \"!\",\n DISABLED: EN_DASH_GLYPH,\n LOCK: \"\\uD83D\\uDD12\",\n EJECT: \"\\u23CF\",\n BULLET: \"\\u2022\",\n SCROLL_UP: \"\\u25B2\",\n SCROLL_DOWN: \"\\u25BC\",\n CHECK: CHECK_GLYPH,\n CROSS: \"\\u2717\",\n /** Removed/pending-removal diff marker (ASCII hyphen). Info panel + Sources tab share it. */\n REMOVED: \"-\",\n /** Added/newly-selected diff marker (ASCII plus). Info panel + Sources tab share it. */\n ADDED: \"+\",\n} as const;\n\nexport const GITHUB_SOURCE = {\n HTTPS_PREFIX: \"https://github.com/\",\n GITHUB_PREFIX: \"github:\",\n GH_PREFIX: \"gh:\",\n} as const;\n\n/** Conventional skills subdirectory name (same value as `STANDARD_DIRS.SKILLS`). */\nexport const DEFAULT_SKILLS_SUBDIR = STANDARD_DIRS.SKILLS;\n\n/** Name written into a global-scope config's `name` field (`~/.claude-src/config.ts`). */\nexport const GLOBAL_CONFIG_NAME = \"global\";\n\n/** Strict kebab-case: starts with letter, segments separated by single hyphens, no trailing hyphens */\nexport const KEBAB_CASE_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;\n\n/** Author handle format: `@` followed by a lowercase-led alphanumeric-hyphen slug. */\nexport const AUTHOR_HANDLE_PATTERN = /^@[a-z][a-z0-9-]*$/;\n\nexport const HASH_PREFIX_LENGTH = 7;\n\n/** Hex chars from SHA-256 hash used in cache directory names (64 bits of collision resistance) */\nexport const CACHE_HASH_LENGTH = 16;\n\n/** Max chars of human-readable prefix in cache directory names (for debugging) */\nexport const CACHE_READABLE_PREFIX_LENGTH = 32;\n\n// File size limits for parsing boundaries (DoS prevention)\nconst ONE_MB = 1024 * 1024;\nexport const MAX_MARKETPLACE_FILE_SIZE = 10 * ONE_MB;\nexport const MAX_PLUGIN_FILE_SIZE = ONE_MB;\nexport const MAX_CONFIG_FILE_SIZE = ONE_MB;\n\nexport const MAX_JSON_NESTING_DEPTH = 10;\nexport const MAX_MARKETPLACE_PLUGINS = 10_000;\n\nexport const SCROLL_VIEWPORT = {\n /** Height of the \"N more above\" scroll indicator */\n SCROLL_INDICATOR_HEIGHT: 1,\n /** Estimated lines per category name row (including top margin) */\n CATEGORY_NAME_LINES: 2,\n /** Margin between category sections (marginTop on CategorySection) */\n CATEGORY_MARGIN_LINES: 1,\n /** Minimum rows to show at least 1 category before enabling scroll */\n MIN_VIEWPORT_ROWS: 5,\n} as const;\n\n/**\n * The terminal geometry every command refuses to run below. This is the only\n * minimum-size gate there is: `BaseCommand.ensureTerminalSize` reads it and\n * blocks until the terminal is at least this big, so raising `ROWS` raises the\n * bar for the whole CLI, tests included.\n *\n * `ROWS: 20` is measured, not guessed. Driving the real binary to the build\n * step — the binding constraint, since it is the tallest step — gives:\n * 15/16/17 corrupt (overlapping card borders, unreadable); 18 the first clean\n * render (one complete category card, correctly clipped); 20 clean with one\n * full card plus the next category heading; 24 comfortable. 18 is the hard\n * correctness floor because it is where {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}\n * starts being satisfied — below it the shared scroll gate stops clipping and\n * the grid bleeds over its borders. 20 buys two rows of margin above that floor\n * while staying under the 24-row default of common terminals.\n */\nexport const MIN_TERMINAL_SIZE = {\n COLS: 80,\n ROWS: 20,\n} as const;\n\n/**\n * The terminal height at or above which the stack step paints the six-row ASCII\n * logo. Below it the logo is dropped — it is decoration, and the stack list is\n * the content.\n *\n * This is NOT a second size gate. {@link MIN_TERMINAL_SIZE} decides whether a\n * command runs at all; this decides only whether one decorative element renders\n * inside a terminal that already cleared that gate. Conflating them would be a\n * regression in both directions: raising `MIN_TERMINAL_SIZE.ROWS` to 26 would\n * refuse to run in the 24-row terminal that is still a common default, and\n * lowering this to 20 brings back the bleed below.\n *\n * 26 is measured against the real binary at 100 columns, on the stack step:\n *\n * | rows | stack step with the logo rendered |\n * | ---- | ----------------------------------------------------------------- |\n * | 20 | bleeds — stack rows paint over the \"Start from scratch\" row |\n * | 24 | bleeds — stack rows paint through the hotkey row and the footer |\n * | 26 | clean |\n * | 27 | clean |\n * | 28 | clean |\n *\n * The mechanism: the logo eats six rows of the stack step's list viewport,\n * starving it below {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}, at which point\n * the shared scroll hooks stop clipping and the rows bleed. Hiding the logo\n * returns those rows to the viewport; the bail-instead-of-clip behaviour itself\n * is untouched and remains the open underlying defect.\n */\nexport const LOGO_MIN_TERMINAL_ROWS = 26;\n\nexport const DEFAULT_BRANDING = {\n NAME: \"Agents Inc.\",\n TAGLINE: \"AI-powered development tools\",\n} as const;\n\n/**\n * Fallback name for the default public marketplace when marketplace.json is\n * unavailable. Same value as `DEFAULT_PLUGIN_NAME` but a distinct concept: this\n * is the resolved source/marketplace name, that is the plugin bundle name.\n */\nexport const DEFAULT_PUBLIC_SOURCE_NAME = DEFAULT_PLUGIN_NAME;\n\n/** Canonical name of the built-in public source. */\nexport const PUBLIC_SOURCE_NAME = \"public\";\n\n/** Human-readable labels for skill source types shown in the wizard and edit command */\nexport const SOURCE_DISPLAY_NAMES: Record<string, string> = {\n public: \"Public\",\n eject: \"Eject\",\n \"agents-inc\": \"Agents Inc\",\n};\n\n/**\n * Column-header labels for source types in the source grid. Distinct from\n * `SOURCE_DISPLAY_NAMES` (inline labels): headers read \"Local\"/\"Plugin\" where\n * the inline labels read \"Eject\"/\"Agents Inc\".\n */\nexport const SOURCE_HEADER_NAMES: Record<string, string> = {\n eject: \"Local\",\n \"agents-inc\": \"Plugin\",\n public: \"Public\",\n};\n\n/** Resolves a source name to its human-readable display label. */\nexport function formatSourceDisplayName(source: string): string {\n return SOURCE_DISPLAY_NAMES[source] ?? source;\n}\n\n/**\n * Marketplace-row value when skills are selected but every one of them is `EJECT_SOURCE`. \"eject\"\n * names no marketplace, so there is nothing to list — but the selection is not empty either, and\n * naming the default public marketplace would claim an origin none of those skills has.\n */\nexport const ALL_SKILLS_EJECTED_LABEL = \"All skills ejected\";\n\n// TODO: update naming convention to GRAY_1,2, etc\nexport const CLI_COLORS = {\n PRIMARY: \"#99FFFF\",\n SUCCESS: \"#90EE90\",\n ERROR: \"#DC343B\",\n WARNING: \"#E6A817\",\n INFO: \"#3B82F6\",\n NEUTRAL: \"#888888\",\n FOCUS: \"#87CEFA\",\n UNFOCUSED: \"#FFFFFF\",\n WHITE: \"#FFFFFF\",\n BLACK: \"#000000\",\n DIM: \"#666666\",\n GRAY_1: \"#ddd\",\n LABEL_BG: \"#383838\",\n TOAST_BG: \"#EEEEEE\",\n TOAST_FG: \"#000000\",\n HOVER_BG: \"#333333\",\n} as const;\n\n/** Canonical display order for built-in domains. Custom domains appear before these, alphabetically. */\nexport const BUILT_IN_DOMAIN_ORDER: readonly Domain[] = [\n \"web\",\n \"api\",\n \"ai\",\n \"mobile\",\n \"desktop\",\n \"cli\",\n \"infra\",\n \"meta\",\n \"shared\",\n];\n\n/** Default domains pre-selected when \"Start from scratch\" is chosen (all except CLI) */\nexport const DEFAULT_SCRATCH_DOMAINS: readonly Domain[] = [\"web\", \"api\", \"mobile\"];\n\n/** Domain used when no active domain can be resolved from wizard state. */\nexport const FALLBACK_DOMAIN: Domain = \"web\";\n\nexport const ASCII_LOGO = ` █████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ██╗███╗ ██╗ ██████╗\n██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██║████╗ ██║██╔════╝\n███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ██║██╔██╗ ██║██║\n██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ██║██║╚██╗██║██║\n██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ██║██║ ╚████║╚██████╗\n╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝`;\n"],"mappings":";;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAG9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,KAAK,QAAQ,UAAU;AAIzC,IAAM,WAAW,UAAU,SAAS,OAAO;AAC3C,IAAM,WAAW,WAAW,KAAK,QAAQ,WAAW,IAAI,IAAI,KAAK,QAAQ,WAAW,OAAO;AACpF,IAAM,eAAe;AAErB,IAAM,aAAa;AACnB,IAAM,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;AAAA,EAErB,uBAAuB;AAAA;AAAA,EAEvB,mBAAmB;AACrB;AAkBO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,MAAM;AACR;AA8BO,IAAM,yBAAyB;AAE/B,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AACX;AAOO,IAAM,6BAA6B;AAGnC,IAAM,qBAAqB;AAG3B,IAAM,uBAA+C;AAAA,EAC1D,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAChB;AAOO,IAAM,sBAA8C;AAAA,EACzD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,QAAQ;AACV;AAGO,SAAS,wBAAwB,QAAwB;AAC9D,SAAO,qBAAqB,MAAM,KAAK;AACzC;AAOO,IAAM,2BAA2B;AAGjC,IAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,IAAM,wBAA2C;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,0BAA6C,CAAC,OAAO,OAAO,QAAQ;AAG1E,IAAM,kBAA0B;AAEhC,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
@@ -1,43 +1,38 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  useModalState
4
- } from "./chunk-NIKUMXE7.js";
5
- import {
6
- ScrollAffordance
7
- } from "./chunk-KOPEM3Q7.js";
8
- import {
9
- SearchModal
10
- } from "./chunk-2RSNKBXC.js";
4
+ } from "./chunk-F7T5AFFN.js";
11
5
  import {
12
6
  useFocusedListItem
13
- } from "./chunk-LYYXX2W5.js";
7
+ } from "./chunk-J27W6TXS.js";
14
8
  import {
15
9
  useSectionScroll
16
- } from "./chunk-DAG2ULNF.js";
10
+ } from "./chunk-MM7CTTAV.js";
11
+ import {
12
+ ScrollAffordance
13
+ } from "./chunk-KXYVJGJP.js";
14
+ import {
15
+ SearchModal
16
+ } from "./chunk-P44SXVH3.js";
17
17
  import {
18
18
  KEY_SPACE
19
- } from "./chunk-VG2TVBFN.js";
19
+ } from "./chunk-LDP5ASDM.js";
20
20
  import {
21
21
  getSkillById,
22
22
  matrix
23
- } from "./chunk-DG2NGZ7S.js";
23
+ } from "./chunk-WKTHWQKM.js";
24
24
  import {
25
25
  CLI_COLORS,
26
26
  SOURCE_DISPLAY_NAMES,
27
27
  SOURCE_HEADER_NAMES,
28
28
  UI_SYMBOLS
29
- } from "./chunk-O5ASLZ2K.js";
30
- import {
31
- init_esm_shims
32
- } from "./chunk-P56WJ5FA.js";
29
+ } from "./chunk-76ADG7LQ.js";
33
30
 
34
31
  // src/cli/components/wizard/source-grid.tsx
35
- init_esm_shims();
36
32
  import { useCallback as useCallback2, useMemo } from "react";
37
33
  import { Box, Text, useInput } from "ink";
38
34
 
39
35
  // src/cli/components/hooks/use-source-grid-search-modal.ts
40
- init_esm_shims();
41
36
  import { useCallback, useState } from "react";
42
37
  function useSourceGridSearchModal({
43
38
  rows,
@@ -427,4 +422,4 @@ export {
427
422
  isRowInert,
428
423
  SourceGrid
429
424
  };
430
- //# sourceMappingURL=chunk-WK4J2CHH.js.map
425
+ //# sourceMappingURL=chunk-BNSRA6HL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/components/wizard/source-grid.tsx","../src/cli/components/hooks/use-source-grid-search-modal.ts"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { Box, Text, useInput, type Key } from \"ink\";\nimport type { BoundSkillCandidate, SkillAlias, SkillId, SkillScope } from \"../../types/index.js\";\nimport { CLI_COLORS, SOURCE_DISPLAY_NAMES, SOURCE_HEADER_NAMES, UI_SYMBOLS } from \"../../consts.js\";\nimport { getSkillById } from \"../../lib/matrix/matrix-provider.js\";\nimport { useFocusedListItem } from \"../hooks/use-focused-list-item.js\";\nimport { useSectionScroll } from \"../hooks/use-section-scroll.js\";\nimport { useSourceGridSearchModal } from \"../hooks/use-source-grid-search-modal.js\";\nimport { KEY_SPACE } from \"./hotkeys.js\";\nimport { ScrollAffordance } from \"./scroll-affordance.js\";\nimport { SearchModal } from \"./search-modal.js\";\n\nconst SEARCH_PILL_LABEL = \"\\u2315 Search\";\n\n/**\n * Skill-name cell: the 24 columns the name itself gets, plus the fixed 2-column marker cell that\n * shares the box (see `rowStatusMarker`). Widening by exactly the marker width keeps every name\n * that fitted before the marker was reserved fitting still.\n */\nconst SKILL_NAME_WIDTH = 26;\nconst SOURCE_COL_WIDTH = 18;\n\n/**\n * Scope gutter: the column of `Global` / `Project` row headers down the left of a scope-grouped\n * grid. Present only in the grouped layout — a single-scope grid has nothing to head, and renders\n * flat with no gutter at all. The header row reserves the width but prints no caption in it: the\n * labels below already name the column, so a caption over them would only repeat them.\n */\nconst SCOPE_COL_WIDTH = 11;\n\n/** Row-header label each scope block is headed by. */\nconst SCOPE_ROW_HEADERS: Record<SkillScope, string> = {\n global: \"Global\",\n project: \"Project\",\n};\n\n/** Blank marker cell — the same two columns a `${glyph} ` marker costs, so names never shift. */\nconst ROW_MARKER_BLANK = \" \";\n\n/**\n * Sources always clips-and-signals rather than bleeding, even at the very short viewports the wizard\n * still renders at (the Sources step is squeezed by the tab bar, dropdown card and footer): a single\n * clipped row plus the overflow affordance beats a bled grid. Distinct from the grid views that fall\n * back to a flex layout below SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS.\n */\nconst SOURCE_GRID_MIN_VIEWPORT_ROWS = 1;\n\n/**\n * The pinned column header and the overflow affordance each cost one row of the clipped viewport.\n * Below this height there is no room for the header AND a readable pair of content rows, so the\n * column labels yield to content — a header row = column labels (1) + content (2) + affordance (1).\n */\nconst SOURCE_GRID_HEADER_MIN_HEIGHT = 4;\n\nexport type SourceOption = {\n id: string;\n selected: boolean;\n installed: boolean;\n};\n\nexport type SourceRow = {\n skillId: SkillId;\n options: SourceOption[];\n scope?: SkillScope;\n readOnly?: boolean;\n /**\n * Saved skill deselected this session — still shown so the user can see what saving removes,\n * but inert. Distinct from `readOnly`, which means \"locked because it is installed globally\".\n */\n disabled?: boolean;\n /**\n * Skill selected this session but absent from the hydration snapshot (D-258). Renders inline in\n * its normal position with the info panel's added marker (`+`) in green, and stays a normal\n * selectable/editable row — unlike `disabled`/`readOnly`, an added row is NOT inert.\n */\n added?: boolean;\n};\n\n/** Rows the user cannot act on: globally locked (`readOnly`) or pending removal (`disabled`). */\nexport function isRowInert(row: SourceRow): boolean {\n return !!row.readOnly || !!row.disabled;\n}\n\n/**\n * Status marker before the skill name. Lock = \"installed globally, not yours to change here\".\n * The removal marker + red colour and the added marker + green colour mirror the info panel's\n * removed/added-diff treatment (DIFF_PREFIX/DIFF_COLOR in skill-agent-summary.tsx) so a\n * pending-removal or added row reads the same on both surfaces. The marker (not the colour) is\n * what carries the meaning in no-color terminals.\n *\n * ALWAYS two columns wide — glyph plus one separating space, or `ROW_MARKER_BLANK` on a row with no\n * status — so every skill name starts in the same column whether or not its row is marked. Same\n * contract as DIFF_PREFIX, which gives even `unchanged` a 2-char prefix. `UI_SYMBOLS.LOCK` is\n * double-width and still renders a locked row one column wider; known and accepted.\n */\nfunction rowStatusMarker(row: SourceRow): string {\n if (row.readOnly) return `${UI_SYMBOLS.LOCK} `;\n if (row.disabled) return `${UI_SYMBOLS.REMOVED} `;\n if (row.added) return `${UI_SYMBOLS.ADDED} `;\n return ROW_MARKER_BLANK;\n}\n\n/**\n * Diff colour for a row's skill name, matching the info panel's palette (DIFF_COLOR in\n * skill-agent-summary.tsx): red = pending removal, green = added. `undefined` means the row carries\n * no diff status, so each caller supplies its own default.\n */\nfunction rowDiffColor(row: SourceRow): string | undefined {\n if (row.disabled) return CLI_COLORS.ERROR;\n if (row.added) return CLI_COLORS.SUCCESS;\n return undefined;\n}\n\n/** Skill-name colour for an unfocused row: its diff colour, or the neutral default. */\nfunction rowLabelColor(row: SourceRow): string {\n return rowDiffColor(row) ?? CLI_COLORS.NEUTRAL;\n}\n\n/**\n * Skill-name colour for the FOCUSED row, which renders on the dark LABEL_BG highlight. A diff row\n * keeps its diff colour — focus is not a reason to lose the added/removed signal. An ordinary row\n * deliberately stays plain WHITE rather than falling through to `rowLabelColor`: NEUTRAL grey on\n * LABEL_BG is the low-contrast pairing, so reusing it here would dim every ordinary focused row to\n * fix rows that have no diff to show in the first place.\n */\nfunction focusedRowLabelColor(row: SourceRow): string {\n return rowDiffColor(row) ?? CLI_COLORS.WHITE;\n}\n\nexport type SourceGridProps = {\n rows: SourceRow[];\n /** Available height in terminal lines for the scrollable viewport. 0 = no constraint. */\n availableHeight?: number;\n onSelect: (skillId: SkillId, sourceId: string) => void;\n onSearch?: (alias: SkillAlias) => Promise<BoundSkillCandidate[]>;\n onBind?: (candidate: BoundSkillCandidate) => void;\n onSearchStateChange?: (active: boolean) => void;\n /** Optional initial focus row (default: 0). Use with React `key` to reset. */\n defaultFocusedRow?: number;\n /** Optional initial focus col (default: 0). Use with React `key` to reset. */\n defaultFocusedCol?: number;\n /** Optional callback fired whenever the focused position changes */\n onFocusChange?: (row: number, col: number) => void;\n};\n\ntype SearchPillProps = {\n isFocused: boolean;\n};\n\nconst SearchPill: React.FC<SearchPillProps> = ({ isFocused }) => {\n return (\n <Box marginRight={1}>\n <Text dimColor={!isFocused} bold={isFocused}>\n {SEARCH_PILL_LABEL}\n </Text>\n </Box>\n );\n};\n\ntype SourceSectionProps = {\n row: SourceRow;\n isFocused: boolean;\n focusedOptionIndex: number;\n showSearchPill: boolean;\n};\n\nfunction formatSourceLabel(option: SourceOption): string {\n return SOURCE_DISPLAY_NAMES[option.id] ?? option.id;\n}\n\nconst SourceTag: React.FC<{\n option: SourceOption;\n isFocused: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n}> = ({ option, isFocused, readOnly, disabled }) => {\n if (readOnly || disabled) {\n // Inert rows carry selection in the same vocabulary editable ones do — weight, plus brightness\n // on the locked row whose cells are otherwise all dimmed. Never a glyph: a check appears nowhere\n // else in the grid, and on a pending-removal row it would tick the source the row is losing. The\n // prefix slot stays a blank spacer so the source labels line up with every other row's.\n return (\n <Box width={SOURCE_COL_WIDTH}>\n <Text\n color={disabled ? CLI_COLORS.ERROR : undefined}\n bold={option.selected}\n dimColor={!disabled && !option.selected}\n >\n {`${UI_SYMBOLS.CHEVRON_SPACER} `}\n {formatSourceLabel(option)}\n </Text>\n </Box>\n );\n }\n\n const textColor = option.selected ? CLI_COLORS.PRIMARY : CLI_COLORS.WHITE;\n const isBold = isFocused || option.selected;\n const prefix = isFocused ? `${UI_SYMBOLS.CHEVRON} ` : `${UI_SYMBOLS.CHEVRON_SPACER} `;\n\n return (\n <Box width={SOURCE_COL_WIDTH}>\n <Text color={textColor} bold={isBold} dimColor={!option.selected && !isFocused}>\n {prefix}\n {formatSourceLabel(option)}\n </Text>\n </Box>\n );\n};\n\nconst SourceSection: React.FC<SourceSectionProps> = ({\n row,\n isFocused,\n focusedOptionIndex,\n showSearchPill,\n}) => {\n const searchPillIndex = row.options.length;\n const isInert = isRowInert(row);\n const effectiveFocused = isInert ? false : isFocused;\n const effectiveShowSearchPill = isInert ? false : showSearchPill;\n // Unlike removal, an added row stays a normal editable row — only its marker/colour differ.\n const statusMarker = rowStatusMarker(row);\n\n return (\n <Box flexDirection=\"row\">\n <Box width={SKILL_NAME_WIDTH}>\n {effectiveFocused ? (\n // The marker sits INSIDE the highlight, and the marker's own separating space is the only\n // one before the name — so the band is the same width on every focused row and the name\n // does not shift a column when focus arrives.\n <Text color={focusedRowLabelColor(row)} backgroundColor={CLI_COLORS.LABEL_BG}>\n {statusMarker}\n {`${getSkillById(row.skillId).displayName} `}\n </Text>\n ) : (\n <Text color={rowLabelColor(row)} dimColor={!!row.readOnly}>\n {statusMarker}\n {getSkillById(row.skillId).displayName}\n </Text>\n )}\n </Box>\n\n <Box flexDirection=\"row\" flexWrap=\"wrap\">\n {row.options.map((option, index) => (\n <SourceTag\n key={option.id}\n option={option}\n isFocused={effectiveFocused && index === focusedOptionIndex}\n readOnly={row.readOnly}\n disabled={row.disabled}\n />\n ))}\n {effectiveShowSearchPill && (\n <SearchPill isFocused={effectiveFocused && focusedOptionIndex === searchPillIndex} />\n )}\n </Box>\n </Box>\n );\n};\n\n/** Total navigable columns for a row (options + search pill if applicable) */\nconst getNavigableCount = (row: SourceRow, showSearchPill: boolean): number => {\n return row.options.length + (showSearchPill ? 1 : 0);\n};\n\ntype ScopeGroup = {\n scope: SkillScope;\n rows: { row: SourceRow; originalIndex: number }[];\n};\n\n/**\n * One row's cell in the scope gutter. Only the first row of a block prints the block's label; every\n * other row reserves the same width empty, which is what indents the rest of the block under its\n * header.\n */\nconst ScopeRowHeader: React.FC<{ scope: SkillScope; isGroupStart: boolean }> = ({\n scope,\n isGroupStart,\n}) => (\n <Box width={SCOPE_COL_WIDTH}>\n {isGroupStart && (\n <Text color={CLI_COLORS.WARNING} bold>\n {SCOPE_ROW_HEADERS[scope]}\n </Text>\n )}\n </Box>\n);\n\n/** First focusable row index at or cyclically after `startRow`; `startRow` when every row is inert. */\nfunction firstFocusableRowIndex(rows: SourceRow[], startRow: number): number {\n const cyclicRowOrder = rows.map((_, offset) => (startRow + offset) % rows.length);\n return (\n cyclicRowOrder.find((row) => {\n const candidate = rows[row];\n return candidate && !isRowInert(candidate);\n }) ?? startRow\n );\n}\n\n/** Index of the last focusable (non-inert) row, or -1 when every row is inert. */\nfunction lastFocusableRowIndex(rows: SourceRow[]): number {\n for (let i = rows.length - 1; i >= 0; i--) {\n const candidate = rows[i];\n if (candidate && !isRowInert(candidate)) return i;\n }\n return -1;\n}\n\n/**\n * Groups rows by scope so the two blocks render separated by a blank line, each headed by its scope\n * in the gutter. Returns an empty array when all rows share the same scope: one block needs no\n * header to tell it from another, so that grid renders flat with no gutter at all.\n */\nfunction groupRowsByScope(rows: SourceRow[]): ScopeGroup[] {\n const indexed = rows.map((row, i) => ({ row, originalIndex: i }));\n const globalRows = indexed.filter(({ row }) => row.scope === \"global\");\n const projectRows = indexed.filter(({ row }) => row.scope !== \"global\");\n\n if (globalRows.length === 0 || projectRows.length === 0) return [];\n\n return [\n { scope: \"global\", rows: globalRows },\n { scope: \"project\", rows: projectRows },\n ];\n}\n\nexport const SourceGrid: React.FC<SourceGridProps> = ({\n rows,\n availableHeight = 0,\n onSelect,\n onSearch,\n onBind,\n onSearchStateChange,\n defaultFocusedRow = 0,\n defaultFocusedCol = 0,\n onFocusChange,\n}) => {\n const {\n searchModal,\n searchResults,\n searchAlias,\n handleSearchTrigger,\n handleBind,\n handleCloseSearch,\n } = useSourceGridSearchModal({ rows, onSearch, onBind, onSearchStateChange });\n\n const showSearchPill = !!onSearch;\n\n const getColCount = useCallback(\n (row: number): number => {\n const rowData = rows[row];\n return rowData ? getNavigableCount(rowData, showSearchPill) : 0;\n },\n [rows, showSearchPill],\n );\n\n const skipRow = useCallback(\n (row: number): boolean => {\n const candidate = rows[row];\n return !!candidate && isRowInert(candidate);\n },\n [rows],\n );\n\n const effectiveDefaultRow = firstFocusableRowIndex(rows, defaultFocusedRow);\n\n const { focusedRow, focusedCol, moveFocus } = useFocusedListItem(rows.length, getColCount, {\n wrap: true,\n onChange: onFocusChange,\n initialRow: effectiveDefaultRow,\n initialCol: defaultFocusedCol,\n skipRow,\n });\n\n const {\n setSectionRef,\n setViewportRef,\n setContentRef,\n scrollEnabled,\n scrollTopPx,\n hiddenAbove,\n hiddenBelow,\n scrollBy,\n } = useSectionScroll({\n sectionCount: rows.length,\n focusedIndex: focusedRow,\n availableHeight,\n minViewportRows: SOURCE_GRID_MIN_VIEWPORT_ROWS,\n });\n\n const lastFocusableRow = useMemo(() => lastFocusableRowIndex(rows), [rows]);\n\n useInput(\n useCallback(\n (input: string, key: Key) => {\n if (input === KEY_SPACE) {\n const currentRow = rows[focusedRow];\n if (!currentRow || isRowInert(currentRow)) return;\n if (showSearchPill && focusedCol === currentRow.options.length) {\n void handleSearchTrigger(focusedRow);\n return;\n }\n if (focusedCol < currentRow.options.length) {\n const currentOption = currentRow.options[focusedCol];\n if (currentOption) {\n onSelect(currentRow.skillId, currentOption.id);\n }\n }\n return;\n }\n\n // With no focusable row (every row inert — a run of locked-global rows plus the\n // pending-removal row) there is no focus to move or to anchor overscroll on, so\n // vertical keys drive the viewport directly. Otherwise, overscroll only kicks in\n // once focus sits on the last focusable row (below it are only inert rows).\n const noFocusableRow = lastFocusableRow === -1;\n const atLastFocusableRow = focusedRow === lastFocusableRow;\n\n if (key.leftArrow) {\n moveFocus(\"left\");\n } else if (key.rightArrow) {\n moveFocus(\"right\");\n } else if (key.upArrow) {\n if (scrollEnabled && noFocusableRow && hiddenAbove > 0) {\n scrollBy(-1);\n } else {\n moveFocus(\"up\");\n }\n } else if (key.downArrow) {\n // Keep scrolling the viewport to reveal trailing inert rows (e.g. the\n // pending-removal row) instead of wrapping. Focus never lands on them, so the\n // viewport travels past the last focusable row (or scrolls on its own when\n // nothing is focusable).\n if (scrollEnabled && (noFocusableRow || atLastFocusableRow) && hiddenBelow > 0) {\n scrollBy(1);\n } else {\n moveFocus(\"down\");\n }\n }\n },\n [\n rows,\n focusedRow,\n focusedCol,\n onSelect,\n showSearchPill,\n handleSearchTrigger,\n moveFocus,\n scrollEnabled,\n lastFocusableRow,\n hiddenAbove,\n hiddenBelow,\n scrollBy,\n ],\n ),\n { isActive: !searchModal.isOpen },\n );\n\n if (rows.length === 0) {\n return (\n <Box flexDirection=\"column\">\n <Text dimColor>No skills to display.</Text>\n </Box>\n );\n }\n\n const noShrink = scrollEnabled ? { flexShrink: 0 } : {};\n\n const scopeGroups = groupRowsByScope(rows);\n\n const headerSources = rows[0]?.options ?? [];\n // Drop the header's spacer row while clipping so the squeezed viewport keeps a content row for the\n // pinned column header plus the affordance; the spacer is cosmetic and only shows when not scrolling.\n const headerMarginBottom = scrollEnabled || scopeGroups.length > 0 ? 0 : 1;\n // At the shortest viewports the pinned column header would starve the content of readable rows, so\n // the labels give way — every row still shows its own source cells, only the column caption is lost.\n const showPinnedHeader = !scrollEnabled || availableHeight >= SOURCE_GRID_HEADER_MIN_HEIGHT;\n const headerElement = (\n <Box flexDirection=\"row\" marginBottom={headerMarginBottom} {...noShrink}>\n {/* Neither the scope gutter nor the skill-name column carries a caption; both boxes reserve\n their width so the source headers stay above the source cells. */}\n {scopeGroups.length > 0 && <Box width={SCOPE_COL_WIDTH} />}\n <Box width={SKILL_NAME_WIDTH} />\n {headerSources.map((option) => (\n <Box key={option.id} width={SOURCE_COL_WIDTH}>\n <Text\n color={CLI_COLORS.WARNING}\n bold\n >{`${UI_SYMBOLS.CHEVRON_SPACER} ${SOURCE_HEADER_NAMES[option.id] ?? option.id}`}</Text>\n </Box>\n ))}\n </Box>\n );\n\n const sectionElements =\n scopeGroups.length > 0\n ? scopeGroups.map((group) => (\n <Box key={group.scope} flexDirection=\"column\" marginTop={1} {...noShrink}>\n {group.rows.map(({ row, originalIndex }, rowIndexInGroup) => (\n <Box\n key={`${row.skillId}-${row.scope ?? \"default\"}`}\n flexDirection=\"row\"\n ref={(el) => setSectionRef(originalIndex, el)}\n {...noShrink}\n >\n <ScopeRowHeader scope={group.scope} isGroupStart={rowIndexInGroup === 0} />\n <SourceSection\n row={row}\n isFocused={originalIndex === focusedRow}\n focusedOptionIndex={focusedCol}\n showSearchPill={showSearchPill}\n />\n </Box>\n ))}\n </Box>\n ))\n : rows.map((row, rowIndex) => (\n <Box\n key={`${row.skillId}-${row.scope ?? \"default\"}`}\n ref={(el) => setSectionRef(rowIndex, el)}\n {...noShrink}\n >\n <SourceSection\n row={row}\n isFocused={rowIndex === focusedRow}\n focusedOptionIndex={focusedCol}\n showSearchPill={showSearchPill}\n />\n </Box>\n ));\n\n const searchModalElement = searchModal.isOpen && (\n <SearchModal\n results={searchResults}\n alias={searchAlias}\n onBind={handleBind}\n onClose={handleCloseSearch}\n />\n );\n\n return (\n <Box\n flexDirection=\"column\"\n {...(scrollEnabled\n ? { height: availableHeight, overflow: \"hidden\" as const }\n : { flexGrow: 1 })}\n >\n {showPinnedHeader && headerElement}\n <Box ref={setViewportRef} flexDirection=\"column\" overflow=\"hidden\" flexGrow={1}>\n <Box\n ref={setContentRef}\n flexDirection=\"column\"\n marginTop={scrollTopPx > 0 ? -scrollTopPx : 0}\n {...noShrink}\n >\n {sectionElements}\n </Box>\n </Box>\n <ScrollAffordance hiddenAbove={hiddenAbove} hiddenBelow={hiddenBelow} />\n {searchModalElement}\n </Box>\n );\n};\n","import { useCallback, useState } from \"react\";\nimport type { BoundSkillCandidate, SkillAlias } from \"../../types/index.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport { useModalState } from \"./use-modal-state.js\";\nimport type { SourceRow } from \"../wizard/source-grid.js\";\n\ntype UseSourceGridSearchModalOptions = {\n rows: SourceRow[];\n onSearch?: (alias: SkillAlias) => Promise<BoundSkillCandidate[]>;\n onBind?: (candidate: BoundSkillCandidate) => void;\n onSearchStateChange?: (active: boolean) => void;\n};\n\ntype UseSourceGridSearchModalResult = {\n searchModal: { isOpen: boolean };\n searchResults: BoundSkillCandidate[];\n searchAlias: string;\n handleSearchTrigger: (rowIndex: number) => Promise<void>;\n handleBind: (candidate: BoundSkillCandidate) => void;\n handleCloseSearch: () => void;\n};\n\nexport function useSourceGridSearchModal({\n rows,\n onSearch,\n onBind,\n onSearchStateChange,\n}: UseSourceGridSearchModalOptions): UseSourceGridSearchModalResult {\n const searchModal = useModalState<number>();\n const [searchResults, setSearchResults] = useState<BoundSkillCandidate[]>([]);\n const [searchAlias, setSearchAlias] = useState(\"\");\n\n const resetSearch = useCallback(() => {\n searchModal.close();\n setSearchResults([]);\n setSearchAlias(\"\");\n onSearchStateChange?.(false);\n }, [onSearchStateChange, searchModal]);\n\n const handleSearchTrigger = useCallback(\n async (rowIndex: number) => {\n const row = rows[rowIndex];\n if (!row || !onSearch) return;\n\n const alias = matrix.slugMap.idToSlug[row.skillId];\n if (!alias) return;\n setSearchAlias(alias);\n searchModal.open(rowIndex);\n onSearchStateChange?.(true);\n\n const results = await onSearch(alias);\n setSearchResults(results);\n },\n [rows, onSearch, onSearchStateChange, searchModal],\n );\n\n const handleBind = useCallback(\n (candidate: BoundSkillCandidate) => {\n onBind?.(candidate);\n resetSearch();\n },\n [onBind, resetSearch],\n );\n\n const handleCloseSearch = useCallback(() => {\n resetSearch();\n }, [resetSearch]);\n\n return {\n searchModal: { isOpen: searchModal.isOpen },\n searchResults,\n searchAlias,\n handleSearchTrigger,\n handleBind,\n handleCloseSearch,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAgB,eAAAA,cAAa,eAAe;AAC5C,SAAS,KAAK,MAAM,gBAA0B;;;ACD9C;AAAA,SAAS,aAAa,gBAAgB;AAsB/B,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoE;AAClE,QAAM,cAAc,cAAsB;AAC1C,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAgC,CAAC,CAAC;AAC5E,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AAEjD,QAAM,cAAc,YAAY,MAAM;AACpC,gBAAY,MAAM;AAClB,qBAAiB,CAAC,CAAC;AACnB,mBAAe,EAAE;AACjB,0BAAsB,KAAK;AAAA,EAC7B,GAAG,CAAC,qBAAqB,WAAW,CAAC;AAErC,QAAM,sBAAsB;AAAA,IAC1B,OAAO,aAAqB;AAC1B,YAAM,MAAM,KAAK,QAAQ;AACzB,UAAI,CAAC,OAAO,CAAC,SAAU;AAEvB,YAAM,QAAQ,OAAO,QAAQ,SAAS,IAAI,OAAO;AACjD,UAAI,CAAC,MAAO;AAC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CAAC,cAAc;AAAA,YAC3C,GAAG;AAAA,YAEH;AAAA;AAAA,QACH,GACF;AAAA,QACA,oBAAC,oBAAiB,aAA0B,aAA0B;AAAA,QACrE;AAAA;AAAA;AAAA,EACH;AAEJ;","names":["useCallback","useCallback"]}
1
+ {"version":3,"sources":["../src/cli/components/wizard/source-grid.tsx","../src/cli/components/hooks/use-source-grid-search-modal.ts"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { Box, Text, useInput, type Key } from \"ink\";\nimport type { BoundSkillCandidate, SkillAlias, SkillId, SkillScope } from \"../../types/index.js\";\nimport { CLI_COLORS, SOURCE_DISPLAY_NAMES, SOURCE_HEADER_NAMES, UI_SYMBOLS } from \"../../consts.js\";\nimport { getSkillById } from \"../../lib/matrix/matrix-provider.js\";\nimport { useFocusedListItem } from \"../hooks/use-focused-list-item.js\";\nimport { useSectionScroll } from \"../hooks/use-section-scroll.js\";\nimport { useSourceGridSearchModal } from \"../hooks/use-source-grid-search-modal.js\";\nimport { KEY_SPACE } from \"./hotkeys.js\";\nimport { ScrollAffordance } from \"./scroll-affordance.js\";\nimport { SearchModal } from \"./search-modal.js\";\n\nconst SEARCH_PILL_LABEL = \"\\u2315 Search\";\n\n/**\n * Skill-name cell: the 24 columns the name itself gets, plus the fixed 2-column marker cell that\n * shares the box (see `rowStatusMarker`). Widening by exactly the marker width keeps every name\n * that fitted before the marker was reserved fitting still.\n */\nconst SKILL_NAME_WIDTH = 26;\nconst SOURCE_COL_WIDTH = 18;\n\n/**\n * Scope gutter: the column of `Global` / `Project` row headers down the left of a scope-grouped\n * grid. Present only in the grouped layout — a single-scope grid has nothing to head, and renders\n * flat with no gutter at all. The header row reserves the width but prints no caption in it: the\n * labels below already name the column, so a caption over them would only repeat them.\n */\nconst SCOPE_COL_WIDTH = 11;\n\n/** Row-header label each scope block is headed by. */\nconst SCOPE_ROW_HEADERS: Record<SkillScope, string> = {\n global: \"Global\",\n project: \"Project\",\n};\n\n/** Blank marker cell — the same two columns a `${glyph} ` marker costs, so names never shift. */\nconst ROW_MARKER_BLANK = \" \";\n\n/**\n * Sources always clips-and-signals rather than bleeding, even at the very short viewports the wizard\n * still renders at (the Sources step is squeezed by the tab bar, dropdown card and footer): a single\n * clipped row plus the overflow affordance beats a bled grid. Distinct from the grid views that fall\n * back to a flex layout below SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS.\n */\nconst SOURCE_GRID_MIN_VIEWPORT_ROWS = 1;\n\n/**\n * The pinned column header and the overflow affordance each cost one row of the clipped viewport.\n * Below this height there is no room for the header AND a readable pair of content rows, so the\n * column labels yield to content — a header row = column labels (1) + content (2) + affordance (1).\n */\nconst SOURCE_GRID_HEADER_MIN_HEIGHT = 4;\n\nexport type SourceOption = {\n id: string;\n selected: boolean;\n installed: boolean;\n};\n\nexport type SourceRow = {\n skillId: SkillId;\n options: SourceOption[];\n scope?: SkillScope;\n readOnly?: boolean;\n /**\n * Saved skill deselected this session — still shown so the user can see what saving removes,\n * but inert. Distinct from `readOnly`, which means \"locked because it is installed globally\".\n */\n disabled?: boolean;\n /**\n * Skill selected this session but absent from the hydration snapshot (D-258). Renders inline in\n * its normal position with the info panel's added marker (`+`) in green, and stays a normal\n * selectable/editable row — unlike `disabled`/`readOnly`, an added row is NOT inert.\n */\n added?: boolean;\n};\n\n/** Rows the user cannot act on: globally locked (`readOnly`) or pending removal (`disabled`). */\nexport function isRowInert(row: SourceRow): boolean {\n return !!row.readOnly || !!row.disabled;\n}\n\n/**\n * Status marker before the skill name. Lock = \"installed globally, not yours to change here\".\n * The removal marker + red colour and the added marker + green colour mirror the info panel's\n * removed/added-diff treatment (DIFF_PREFIX/DIFF_COLOR in skill-agent-summary.tsx) so a\n * pending-removal or added row reads the same on both surfaces. The marker (not the colour) is\n * what carries the meaning in no-color terminals.\n *\n * ALWAYS two columns wide — glyph plus one separating space, or `ROW_MARKER_BLANK` on a row with no\n * status — so every skill name starts in the same column whether or not its row is marked. Same\n * contract as DIFF_PREFIX, which gives even `unchanged` a 2-char prefix. `UI_SYMBOLS.LOCK` is\n * double-width and still renders a locked row one column wider; known and accepted.\n */\nfunction rowStatusMarker(row: SourceRow): string {\n if (row.readOnly) return `${UI_SYMBOLS.LOCK} `;\n if (row.disabled) return `${UI_SYMBOLS.REMOVED} `;\n if (row.added) return `${UI_SYMBOLS.ADDED} `;\n return ROW_MARKER_BLANK;\n}\n\n/**\n * Diff colour for a row's skill name, matching the info panel's palette (DIFF_COLOR in\n * skill-agent-summary.tsx): red = pending removal, green = added. `undefined` means the row carries\n * no diff status, so each caller supplies its own default.\n */\nfunction rowDiffColor(row: SourceRow): string | undefined {\n if (row.disabled) return CLI_COLORS.ERROR;\n if (row.added) return CLI_COLORS.SUCCESS;\n return undefined;\n}\n\n/** Skill-name colour for an unfocused row: its diff colour, or the neutral default. */\nfunction rowLabelColor(row: SourceRow): string {\n return rowDiffColor(row) ?? CLI_COLORS.NEUTRAL;\n}\n\n/**\n * Skill-name colour for the FOCUSED row, which renders on the dark LABEL_BG highlight. A diff row\n * keeps its diff colour — focus is not a reason to lose the added/removed signal. An ordinary row\n * deliberately stays plain WHITE rather than falling through to `rowLabelColor`: NEUTRAL grey on\n * LABEL_BG is the low-contrast pairing, so reusing it here would dim every ordinary focused row to\n * fix rows that have no diff to show in the first place.\n */\nfunction focusedRowLabelColor(row: SourceRow): string {\n return rowDiffColor(row) ?? CLI_COLORS.WHITE;\n}\n\nexport type SourceGridProps = {\n rows: SourceRow[];\n /** Available height in terminal lines for the scrollable viewport. 0 = no constraint. */\n availableHeight?: number;\n onSelect: (skillId: SkillId, sourceId: string) => void;\n onSearch?: (alias: SkillAlias) => Promise<BoundSkillCandidate[]>;\n onBind?: (candidate: BoundSkillCandidate) => void;\n onSearchStateChange?: (active: boolean) => void;\n /** Optional initial focus row (default: 0). Use with React `key` to reset. */\n defaultFocusedRow?: number;\n /** Optional initial focus col (default: 0). Use with React `key` to reset. */\n defaultFocusedCol?: number;\n /** Optional callback fired whenever the focused position changes */\n onFocusChange?: (row: number, col: number) => void;\n};\n\ntype SearchPillProps = {\n isFocused: boolean;\n};\n\nconst SearchPill: React.FC<SearchPillProps> = ({ isFocused }) => {\n return (\n <Box marginRight={1}>\n <Text dimColor={!isFocused} bold={isFocused}>\n {SEARCH_PILL_LABEL}\n </Text>\n </Box>\n );\n};\n\ntype SourceSectionProps = {\n row: SourceRow;\n isFocused: boolean;\n focusedOptionIndex: number;\n showSearchPill: boolean;\n};\n\nfunction formatSourceLabel(option: SourceOption): string {\n return SOURCE_DISPLAY_NAMES[option.id] ?? option.id;\n}\n\nconst SourceTag: React.FC<{\n option: SourceOption;\n isFocused: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n}> = ({ option, isFocused, readOnly, disabled }) => {\n if (readOnly || disabled) {\n // Inert rows carry selection in the same vocabulary editable ones do — weight, plus brightness\n // on the locked row whose cells are otherwise all dimmed. Never a glyph: a check appears nowhere\n // else in the grid, and on a pending-removal row it would tick the source the row is losing. The\n // prefix slot stays a blank spacer so the source labels line up with every other row's.\n return (\n <Box width={SOURCE_COL_WIDTH}>\n <Text\n color={disabled ? CLI_COLORS.ERROR : undefined}\n bold={option.selected}\n dimColor={!disabled && !option.selected}\n >\n {`${UI_SYMBOLS.CHEVRON_SPACER} `}\n {formatSourceLabel(option)}\n </Text>\n </Box>\n );\n }\n\n const textColor = option.selected ? CLI_COLORS.PRIMARY : CLI_COLORS.WHITE;\n const isBold = isFocused || option.selected;\n const prefix = isFocused ? `${UI_SYMBOLS.CHEVRON} ` : `${UI_SYMBOLS.CHEVRON_SPACER} `;\n\n return (\n <Box width={SOURCE_COL_WIDTH}>\n <Text color={textColor} bold={isBold} dimColor={!option.selected && !isFocused}>\n {prefix}\n {formatSourceLabel(option)}\n </Text>\n </Box>\n );\n};\n\nconst SourceSection: React.FC<SourceSectionProps> = ({\n row,\n isFocused,\n focusedOptionIndex,\n showSearchPill,\n}) => {\n const searchPillIndex = row.options.length;\n const isInert = isRowInert(row);\n const effectiveFocused = isInert ? false : isFocused;\n const effectiveShowSearchPill = isInert ? false : showSearchPill;\n // Unlike removal, an added row stays a normal editable row — only its marker/colour differ.\n const statusMarker = rowStatusMarker(row);\n\n return (\n <Box flexDirection=\"row\">\n <Box width={SKILL_NAME_WIDTH}>\n {effectiveFocused ? (\n // The marker sits INSIDE the highlight, and the marker's own separating space is the only\n // one before the name — so the band is the same width on every focused row and the name\n // does not shift a column when focus arrives.\n <Text color={focusedRowLabelColor(row)} backgroundColor={CLI_COLORS.LABEL_BG}>\n {statusMarker}\n {`${getSkillById(row.skillId).displayName} `}\n </Text>\n ) : (\n <Text color={rowLabelColor(row)} dimColor={!!row.readOnly}>\n {statusMarker}\n {getSkillById(row.skillId).displayName}\n </Text>\n )}\n </Box>\n\n <Box flexDirection=\"row\" flexWrap=\"wrap\">\n {row.options.map((option, index) => (\n <SourceTag\n key={option.id}\n option={option}\n isFocused={effectiveFocused && index === focusedOptionIndex}\n readOnly={row.readOnly}\n disabled={row.disabled}\n />\n ))}\n {effectiveShowSearchPill && (\n <SearchPill isFocused={effectiveFocused && focusedOptionIndex === searchPillIndex} />\n )}\n </Box>\n </Box>\n );\n};\n\n/** Total navigable columns for a row (options + search pill if applicable) */\nconst getNavigableCount = (row: SourceRow, showSearchPill: boolean): number => {\n return row.options.length + (showSearchPill ? 1 : 0);\n};\n\ntype ScopeGroup = {\n scope: SkillScope;\n rows: { row: SourceRow; originalIndex: number }[];\n};\n\n/**\n * One row's cell in the scope gutter. Only the first row of a block prints the block's label; every\n * other row reserves the same width empty, which is what indents the rest of the block under its\n * header.\n */\nconst ScopeRowHeader: React.FC<{ scope: SkillScope; isGroupStart: boolean }> = ({\n scope,\n isGroupStart,\n}) => (\n <Box width={SCOPE_COL_WIDTH}>\n {isGroupStart && (\n <Text color={CLI_COLORS.WARNING} bold>\n {SCOPE_ROW_HEADERS[scope]}\n </Text>\n )}\n </Box>\n);\n\n/** First focusable row index at or cyclically after `startRow`; `startRow` when every row is inert. */\nfunction firstFocusableRowIndex(rows: SourceRow[], startRow: number): number {\n const cyclicRowOrder = rows.map((_, offset) => (startRow + offset) % rows.length);\n return (\n cyclicRowOrder.find((row) => {\n const candidate = rows[row];\n return candidate && !isRowInert(candidate);\n }) ?? startRow\n );\n}\n\n/** Index of the last focusable (non-inert) row, or -1 when every row is inert. */\nfunction lastFocusableRowIndex(rows: SourceRow[]): number {\n for (let i = rows.length - 1; i >= 0; i--) {\n const candidate = rows[i];\n if (candidate && !isRowInert(candidate)) return i;\n }\n return -1;\n}\n\n/**\n * Groups rows by scope so the two blocks render separated by a blank line, each headed by its scope\n * in the gutter. Returns an empty array when all rows share the same scope: one block needs no\n * header to tell it from another, so that grid renders flat with no gutter at all.\n */\nfunction groupRowsByScope(rows: SourceRow[]): ScopeGroup[] {\n const indexed = rows.map((row, i) => ({ row, originalIndex: i }));\n const globalRows = indexed.filter(({ row }) => row.scope === \"global\");\n const projectRows = indexed.filter(({ row }) => row.scope !== \"global\");\n\n if (globalRows.length === 0 || projectRows.length === 0) return [];\n\n return [\n { scope: \"global\", rows: globalRows },\n { scope: \"project\", rows: projectRows },\n ];\n}\n\nexport const SourceGrid: React.FC<SourceGridProps> = ({\n rows,\n availableHeight = 0,\n onSelect,\n onSearch,\n onBind,\n onSearchStateChange,\n defaultFocusedRow = 0,\n defaultFocusedCol = 0,\n onFocusChange,\n}) => {\n const {\n searchModal,\n searchResults,\n searchAlias,\n handleSearchTrigger,\n handleBind,\n handleCloseSearch,\n } = useSourceGridSearchModal({ rows, onSearch, onBind, onSearchStateChange });\n\n const showSearchPill = !!onSearch;\n\n const getColCount = useCallback(\n (row: number): number => {\n const rowData = rows[row];\n return rowData ? getNavigableCount(rowData, showSearchPill) : 0;\n },\n [rows, showSearchPill],\n );\n\n const skipRow = useCallback(\n (row: number): boolean => {\n const candidate = rows[row];\n return !!candidate && isRowInert(candidate);\n },\n [rows],\n );\n\n const effectiveDefaultRow = firstFocusableRowIndex(rows, defaultFocusedRow);\n\n const { focusedRow, focusedCol, moveFocus } = useFocusedListItem(rows.length, getColCount, {\n wrap: true,\n onChange: onFocusChange,\n initialRow: effectiveDefaultRow,\n initialCol: defaultFocusedCol,\n skipRow,\n });\n\n const {\n setSectionRef,\n setViewportRef,\n setContentRef,\n scrollEnabled,\n scrollTopPx,\n hiddenAbove,\n hiddenBelow,\n scrollBy,\n } = useSectionScroll({\n sectionCount: rows.length,\n focusedIndex: focusedRow,\n availableHeight,\n minViewportRows: SOURCE_GRID_MIN_VIEWPORT_ROWS,\n });\n\n const lastFocusableRow = useMemo(() => lastFocusableRowIndex(rows), [rows]);\n\n useInput(\n useCallback(\n (input: string, key: Key) => {\n if (input === KEY_SPACE) {\n const currentRow = rows[focusedRow];\n if (!currentRow || isRowInert(currentRow)) return;\n if (showSearchPill && focusedCol === currentRow.options.length) {\n void handleSearchTrigger(focusedRow);\n return;\n }\n if (focusedCol < currentRow.options.length) {\n const currentOption = currentRow.options[focusedCol];\n if (currentOption) {\n onSelect(currentRow.skillId, currentOption.id);\n }\n }\n return;\n }\n\n // With no focusable row (every row inert — a run of locked-global rows plus the\n // pending-removal row) there is no focus to move or to anchor overscroll on, so\n // vertical keys drive the viewport directly. Otherwise, overscroll only kicks in\n // once focus sits on the last focusable row (below it are only inert rows).\n const noFocusableRow = lastFocusableRow === -1;\n const atLastFocusableRow = focusedRow === lastFocusableRow;\n\n if (key.leftArrow) {\n moveFocus(\"left\");\n } else if (key.rightArrow) {\n moveFocus(\"right\");\n } else if (key.upArrow) {\n if (scrollEnabled && noFocusableRow && hiddenAbove > 0) {\n scrollBy(-1);\n } else {\n moveFocus(\"up\");\n }\n } else if (key.downArrow) {\n // Keep scrolling the viewport to reveal trailing inert rows (e.g. the\n // pending-removal row) instead of wrapping. Focus never lands on them, so the\n // viewport travels past the last focusable row (or scrolls on its own when\n // nothing is focusable).\n if (scrollEnabled && (noFocusableRow || atLastFocusableRow) && hiddenBelow > 0) {\n scrollBy(1);\n } else {\n moveFocus(\"down\");\n }\n }\n },\n [\n rows,\n focusedRow,\n focusedCol,\n onSelect,\n showSearchPill,\n handleSearchTrigger,\n moveFocus,\n scrollEnabled,\n lastFocusableRow,\n hiddenAbove,\n hiddenBelow,\n scrollBy,\n ],\n ),\n { isActive: !searchModal.isOpen },\n );\n\n if (rows.length === 0) {\n return (\n <Box flexDirection=\"column\">\n <Text dimColor>No skills to display.</Text>\n </Box>\n );\n }\n\n const noShrink = scrollEnabled ? { flexShrink: 0 } : {};\n\n const scopeGroups = groupRowsByScope(rows);\n\n const headerSources = rows[0]?.options ?? [];\n // Drop the header's spacer row while clipping so the squeezed viewport keeps a content row for the\n // pinned column header plus the affordance; the spacer is cosmetic and only shows when not scrolling.\n const headerMarginBottom = scrollEnabled || scopeGroups.length > 0 ? 0 : 1;\n // At the shortest viewports the pinned column header would starve the content of readable rows, so\n // the labels give way — every row still shows its own source cells, only the column caption is lost.\n const showPinnedHeader = !scrollEnabled || availableHeight >= SOURCE_GRID_HEADER_MIN_HEIGHT;\n const headerElement = (\n <Box flexDirection=\"row\" marginBottom={headerMarginBottom} {...noShrink}>\n {/* Neither the scope gutter nor the skill-name column carries a caption; both boxes reserve\n their width so the source headers stay above the source cells. */}\n {scopeGroups.length > 0 && <Box width={SCOPE_COL_WIDTH} />}\n <Box width={SKILL_NAME_WIDTH} />\n {headerSources.map((option) => (\n <Box key={option.id} width={SOURCE_COL_WIDTH}>\n <Text\n color={CLI_COLORS.WARNING}\n bold\n >{`${UI_SYMBOLS.CHEVRON_SPACER} ${SOURCE_HEADER_NAMES[option.id] ?? option.id}`}</Text>\n </Box>\n ))}\n </Box>\n );\n\n const sectionElements =\n scopeGroups.length > 0\n ? scopeGroups.map((group) => (\n <Box key={group.scope} flexDirection=\"column\" marginTop={1} {...noShrink}>\n {group.rows.map(({ row, originalIndex }, rowIndexInGroup) => (\n <Box\n key={`${row.skillId}-${row.scope ?? \"default\"}`}\n flexDirection=\"row\"\n ref={(el) => setSectionRef(originalIndex, el)}\n {...noShrink}\n >\n <ScopeRowHeader scope={group.scope} isGroupStart={rowIndexInGroup === 0} />\n <SourceSection\n row={row}\n isFocused={originalIndex === focusedRow}\n focusedOptionIndex={focusedCol}\n showSearchPill={showSearchPill}\n />\n </Box>\n ))}\n </Box>\n ))\n : rows.map((row, rowIndex) => (\n <Box\n key={`${row.skillId}-${row.scope ?? \"default\"}`}\n ref={(el) => setSectionRef(rowIndex, el)}\n {...noShrink}\n >\n <SourceSection\n row={row}\n isFocused={rowIndex === focusedRow}\n focusedOptionIndex={focusedCol}\n showSearchPill={showSearchPill}\n />\n </Box>\n ));\n\n const searchModalElement = searchModal.isOpen && (\n <SearchModal\n results={searchResults}\n alias={searchAlias}\n onBind={handleBind}\n onClose={handleCloseSearch}\n />\n );\n\n return (\n <Box\n flexDirection=\"column\"\n {...(scrollEnabled\n ? { height: availableHeight, overflow: \"hidden\" as const }\n : { flexGrow: 1 })}\n >\n {showPinnedHeader && headerElement}\n <Box ref={setViewportRef} flexDirection=\"column\" overflow=\"hidden\" flexGrow={1}>\n <Box\n ref={setContentRef}\n flexDirection=\"column\"\n marginTop={scrollTopPx > 0 ? -scrollTopPx : 0}\n {...noShrink}\n >\n {sectionElements}\n </Box>\n </Box>\n <ScrollAffordance hiddenAbove={hiddenAbove} hiddenBelow={hiddenBelow} />\n {searchModalElement}\n </Box>\n );\n};\n","import { useCallback, useState } from \"react\";\nimport type { BoundSkillCandidate, SkillAlias } from \"../../types/index.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport { useModalState } from \"./use-modal-state.js\";\nimport type { SourceRow } from \"../wizard/source-grid.js\";\n\ntype UseSourceGridSearchModalOptions = {\n rows: SourceRow[];\n onSearch?: (alias: SkillAlias) => Promise<BoundSkillCandidate[]>;\n onBind?: (candidate: BoundSkillCandidate) => void;\n onSearchStateChange?: (active: boolean) => void;\n};\n\ntype UseSourceGridSearchModalResult = {\n searchModal: { isOpen: boolean };\n searchResults: BoundSkillCandidate[];\n searchAlias: string;\n handleSearchTrigger: (rowIndex: number) => Promise<void>;\n handleBind: (candidate: BoundSkillCandidate) => void;\n handleCloseSearch: () => void;\n};\n\nexport function useSourceGridSearchModal({\n rows,\n onSearch,\n onBind,\n onSearchStateChange,\n}: UseSourceGridSearchModalOptions): UseSourceGridSearchModalResult {\n const searchModal = useModalState<number>();\n const [searchResults, setSearchResults] = useState<BoundSkillCandidate[]>([]);\n const [searchAlias, setSearchAlias] = useState(\"\");\n\n const resetSearch = useCallback(() => {\n searchModal.close();\n setSearchResults([]);\n setSearchAlias(\"\");\n onSearchStateChange?.(false);\n }, [onSearchStateChange, searchModal]);\n\n const handleSearchTrigger = useCallback(\n async (rowIndex: number) => {\n const row = rows[rowIndex];\n if (!row || !onSearch) return;\n\n const alias = matrix.slugMap.idToSlug[row.skillId];\n if (!alias) return;\n setSearchAlias(alias);\n searchModal.open(rowIndex);\n onSearchStateChange?.(true);\n\n const results = await onSearch(alias);\n setSearchResults(results);\n },\n [rows, onSearch, onSearchStateChange, searchModal],\n );\n\n const handleBind = useCallback(\n (candidate: BoundSkillCandidate) => {\n onBind?.(candidate);\n resetSearch();\n },\n [onBind, resetSearch],\n );\n\n const handleCloseSearch = useCallback(() => {\n resetSearch();\n }, [resetSearch]);\n\n return {\n searchModal: { isOpen: searchModal.isOpen },\n searchResults,\n searchAlias,\n handleSearchTrigger,\n handleBind,\n handleCloseSearch,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,eAAAA,cAAa,eAAe;AAC5C,SAAS,KAAK,MAAM,gBAA0B;;;ACD9C,SAAS,aAAa,gBAAgB;AAsB/B,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoE;AAClE,QAAM,cAAc,cAAsB;AAC1C,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAgC,CAAC,CAAC;AAC5E,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AAEjD,QAAM,cAAc,YA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AAS;AAAA;AAAA,EACX;AAGF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACb,GAAI,gBACD,EAAE,QAAQ,iBAAiB,UAAU,SAAkB,IACvD,EAAE,UAAU,EAAE;AAAA,MAEjB;AAAA,4BAAoB;AAAA,QACrB,oBAAC,OAAI,KAAK,gBAAgB,eAAc,UAAS,UAAS,UAAS,UAAU,GAC3E;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL,eAAc;AAAA,YACd,WAAW,cAAc,IAAI,CAAC,cAAc;AAAA,YAC3C,GAAG;AAAA,YAEH;AAAA;AAAA,QACH,GACF;AAAA,QACA,oBAAC,oBAAiB,aAA0B,aAA0B;AAAA,QACrE;AAAA;AAAA;AAAA,EACH;AAEJ;","names":["useCallback","useCallback"]}
@@ -1,16 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  computeRowScrollTop
4
- } from "./chunk-DAG2ULNF.js";
4
+ } from "./chunk-MM7CTTAV.js";
5
5
  import {
6
6
  SCROLL_VIEWPORT
7
- } from "./chunk-O5ASLZ2K.js";
8
- import {
9
- init_esm_shims
10
- } from "./chunk-P56WJ5FA.js";
7
+ } from "./chunk-76ADG7LQ.js";
11
8
 
12
9
  // src/cli/components/hooks/use-row-scroll.ts
13
- init_esm_shims();
14
10
  import { useRef } from "react";
15
11
  function useRowScroll({
16
12
  focusedIndex,
@@ -28,4 +24,4 @@ function useRowScroll({
28
24
  export {
29
25
  useRowScroll
30
26
  };
31
- //# sourceMappingURL=chunk-FYPUUYSG.js.map
27
+ //# sourceMappingURL=chunk-DTSG5XZB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/components/hooks/use-row-scroll.ts"],"sourcesContent":["import { useRef } from \"react\";\nimport { SCROLL_VIEWPORT } from \"../../consts.js\";\nimport { computeRowScrollTop } from \"./use-section-scroll.js\";\n\nexport type UseRowScrollOptions = {\n focusedIndex: number;\n itemCount: number;\n availableHeight: number;\n};\n\nexport type UseRowScrollResult = {\n scrollEnabled: boolean;\n scrollTop: number;\n};\n\n/**\n * Row-based scroll hook for views with uniform 1-line rows.\n *\n * Manages a scroll offset (in rows) to keep the focused row visible within\n * a constrained viewport. Extracted from the identical scroll plumbing in\n * checkbox-grid.tsx, step-agents.tsx, and stack-selection.tsx.\n *\n * Deliberately exposes NO hidden-line counts — unlike `useSectionScroll`, which\n * computes them for the `ScrollAffordance` the Sources grid renders. Every\n * consumer here (Domains, Agents, Stack) clips silently by owner decision: a\n * half-cut row is self-evident, and a counted hint would cost the viewport a row\n * to say the same thing. Adding the counts is a product change, not a gap.\n */\nexport function useRowScroll({\n focusedIndex,\n itemCount,\n availableHeight,\n}: UseRowScrollOptions): UseRowScrollResult {\n const scrollTopRef = useRef(0);\n\n const scrollEnabled =\n availableHeight > 0 &&\n availableHeight >= SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS &&\n itemCount > availableHeight;\n\n if (scrollEnabled) {\n scrollTopRef.current = computeRowScrollTop(focusedIndex, scrollTopRef.current, availableHeight);\n }\n\n return { scrollEnabled, scrollTop: scrollTopRef.current };\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA,SAAS,cAAc;AA4BhB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,eAAe,OAAO,CAAC;AAE7B,QAAM,gBACJ,kBAAkB,KAClB,mBAAmB,gBAAgB,qBACnC,YAAY;AAEd,MAAI,eAAe;AACjB,iBAAa,UAAU,oBAAoB,cAAc,aAAa,SAAS,eAAe;AAAA,EAChG;AAEA,SAAO,EAAE,eAAe,WAAW,aAAa,QAAQ;AAC1D;","names":[]}
1
+ {"version":3,"sources":["../src/cli/components/hooks/use-row-scroll.ts"],"sourcesContent":["import { useRef } from \"react\";\nimport { SCROLL_VIEWPORT } from \"../../consts.js\";\nimport { computeRowScrollTop } from \"./use-section-scroll.js\";\n\nexport type UseRowScrollOptions = {\n focusedIndex: number;\n itemCount: number;\n availableHeight: number;\n};\n\nexport type UseRowScrollResult = {\n scrollEnabled: boolean;\n scrollTop: number;\n};\n\n/**\n * Row-based scroll hook for views with uniform 1-line rows.\n *\n * Manages a scroll offset (in rows) to keep the focused row visible within\n * a constrained viewport. Extracted from the identical scroll plumbing in\n * checkbox-grid.tsx, step-agents.tsx, and stack-selection.tsx.\n *\n * Deliberately exposes NO hidden-line counts — unlike `useSectionScroll`, which\n * computes them for the `ScrollAffordance` the Sources grid renders. Every\n * consumer here (Domains, Agents, Stack) clips silently by owner decision: a\n * half-cut row is self-evident, and a counted hint would cost the viewport a row\n * to say the same thing. Adding the counts is a product change, not a gap.\n */\nexport function useRowScroll({\n focusedIndex,\n itemCount,\n availableHeight,\n}: UseRowScrollOptions): UseRowScrollResult {\n const scrollTopRef = useRef(0);\n\n const scrollEnabled =\n availableHeight > 0 &&\n availableHeight >= SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS &&\n itemCount > availableHeight;\n\n if (scrollEnabled) {\n scrollTopRef.current = computeRowScrollTop(focusedIndex, scrollTopRef.current, availableHeight);\n }\n\n return { scrollEnabled, scrollTop: scrollTopRef.current };\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,cAAc;AA4BhB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,eAAe,OAAO,CAAC;AAE7B,QAAM,gBACJ,kBAAkB,KAClB,mBAAmB,gBAAgB,qBACnC,YAAY;AAEd,MAAI,eAAe;AACjB,iBAAa,UAAU,oBAAoB,cAAc,aAAa,SAAS,eAAe;AAAA,EAChG;AAEA,SAAO,EAAE,eAAe,WAAW,aAAa,QAAQ;AAC1D;","names":[]}
@@ -17,7 +17,7 @@ import {
17
17
  writeCompiledAgentsByScope,
18
18
  writeContentHash,
19
19
  writePluginManifest
20
- } from "./chunk-TVHRMRD3.js";
20
+ } from "./chunk-EEPELKOM.js";
21
21
  import {
22
22
  agentFrontmatterValidationSchema,
23
23
  copy,
@@ -34,23 +34,19 @@ import {
34
34
  remove,
35
35
  verbose,
36
36
  warn
37
- } from "./chunk-3LIU2ZEF.js";
37
+ } from "./chunk-PMM2MYMA.js";
38
38
  import {
39
39
  typedEntries,
40
40
  typedKeys
41
- } from "./chunk-VEP23B5W.js";
41
+ } from "./chunk-VASLW636.js";
42
42
  import {
43
43
  CLAUDE_DIR,
44
44
  DIRS,
45
45
  PROJECT_ROOT,
46
46
  STANDARD_DIRS
47
- } from "./chunk-O5ASLZ2K.js";
48
- import {
49
- init_esm_shims
50
- } from "./chunk-P56WJ5FA.js";
47
+ } from "./chunk-76ADG7LQ.js";
51
48
 
52
49
  // src/cli/lib/agents/agent-fetcher.ts
53
- init_esm_shims();
54
50
  import path from "path";
55
51
  async function getAgentDefinitions(remoteSource, options = {}) {
56
52
  if (remoteSource) {
@@ -110,7 +106,6 @@ async function fetchAgentDefinitionsFromRemote(source, options = {}) {
110
106
  }
111
107
 
112
108
  // src/cli/lib/agents/list-compiled-agents.ts
113
- init_esm_shims();
114
109
  import path2 from "path";
115
110
  async function listAgentMdFiles(agentsDir) {
116
111
  return glob("*.md", agentsDir);
@@ -131,7 +126,6 @@ async function pruneStaleCompiledAgents(agentsDir, keep) {
131
126
  }
132
127
 
133
128
  // src/cli/lib/agents/agent-recompiler.ts
134
- init_esm_shims();
135
129
  import { partition } from "remeda";
136
130
  import path3 from "path";
137
131
  async function getExistingAgentNames(pluginDir) {
@@ -245,7 +239,6 @@ async function recompileAgents(options) {
245
239
  }
246
240
 
247
241
  // src/cli/lib/agents/agent-plugin-compiler.ts
248
- init_esm_shims();
249
242
  import path4 from "path";
250
243
  function parseAgentFrontmatter(content, filePath) {
251
244
  const raw = extractFrontmatter(content);
@@ -324,9 +317,6 @@ Compiled ${results.length} agent plugins:`);
324
317
  }
325
318
  }
326
319
 
327
- // src/cli/lib/agents/index.ts
328
- init_esm_shims();
329
-
330
320
  export {
331
321
  getAgentDefinitions,
332
322
  listAgentMdFiles,
@@ -336,4 +326,4 @@ export {
336
326
  compileAllAgentPlugins,
337
327
  printAgentCompilationSummary
338
328
  };
339
- //# sourceMappingURL=chunk-NGLQ5W7U.js.map
329
+ //# sourceMappingURL=chunk-E5X6RJ4E.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"],"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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,oBACA,KAAK,KAAK,cAAc,KAAK,SAAS;AAE1C,MAAI,CAAE,MAAM,gBAAgB,YAAY,GAAI;AAC1C,YAAQ,kCAAkC,YAAY,EAAE;AAAA,EAC1D;AAEA,UAAQ,mCAAmC,SAAS,EAAE;AACtD,UAAQ,wBAAwB,YAAY,EAAE;AAE9C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EACd;AACF;AAEA,eAAsB,gCACpB,QACA,UAAiD,CAAC,GACvB;AAC3B,UAAQ,wCAAwC,MAAM,EAAE;AAExD,QAAM,SAAS,MAAM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