agents-inc 0.153.0 → 0.155.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/chunk-2H7UWE2G.js +246 -0
  3. package/dist/chunk-2H7UWE2G.js.map +1 -0
  4. package/dist/{chunk-ZNDLUWWD.js → chunk-4A4L3YIW.js} +5 -5
  5. package/dist/chunk-4G2YHZIM.js +132 -0
  6. package/dist/chunk-4G2YHZIM.js.map +1 -0
  7. package/dist/{chunk-WDAO3RUY.js → chunk-5F2YR5XV.js} +3 -3
  8. package/dist/{chunk-JFAUQDZM.js → chunk-5OKLCVM4.js} +3 -3
  9. package/dist/{chunk-REKOWTIB.js → chunk-5QZAK6J7.js} +44 -10
  10. package/dist/chunk-5QZAK6J7.js.map +1 -0
  11. package/dist/{chunk-VECFAKM5.js → chunk-6RLV45HN.js} +10 -10
  12. package/dist/{chunk-VECFAKM5.js.map → chunk-6RLV45HN.js.map} +1 -1
  13. package/dist/{chunk-K7PJDWER.js → chunk-CLFHC2DK.js} +15 -106
  14. package/dist/chunk-CLFHC2DK.js.map +1 -0
  15. package/dist/chunk-D2CAV7MG.js +61 -0
  16. package/dist/chunk-D2CAV7MG.js.map +1 -0
  17. package/dist/{chunk-NXGMM5YN.js → chunk-F2AMBBIA.js} +6 -6
  18. package/dist/{chunk-NXGMM5YN.js.map → chunk-F2AMBBIA.js.map} +1 -1
  19. package/dist/{chunk-HEBPKK5L.js → chunk-F5T6TV4Z.js} +213 -92
  20. package/dist/chunk-F5T6TV4Z.js.map +1 -0
  21. package/dist/{chunk-K3O3YQYG.js → chunk-G47TDUK3.js} +2 -2
  22. package/dist/{chunk-U2DNAHFE.js → chunk-GS2NZ3GD.js} +8 -8
  23. package/dist/chunk-GS2NZ3GD.js.map +1 -0
  24. package/dist/{chunk-ORJ5Y222.js → chunk-H6UTKTLK.js} +176 -256
  25. package/dist/chunk-H6UTKTLK.js.map +1 -0
  26. package/dist/{chunk-M5HSTNYU.js → chunk-HG4JPXJT.js} +11 -29
  27. package/dist/chunk-HG4JPXJT.js.map +1 -0
  28. package/dist/{chunk-VGEBYCQZ.js → chunk-HTYH7CKN.js} +4 -15
  29. package/dist/chunk-HTYH7CKN.js.map +1 -0
  30. package/dist/{chunk-JC7DBPRD.js → chunk-HXKOIWLU.js} +2 -2
  31. package/dist/chunk-HXKOIWLU.js.map +1 -0
  32. package/dist/{chunk-NSJ2S7R5.js → chunk-ILUVL7WM.js} +2 -2
  33. package/dist/{chunk-R54KIGN2.js → chunk-IO5YBKHV.js} +13 -2
  34. package/dist/chunk-IO5YBKHV.js.map +1 -0
  35. package/dist/chunk-IXRZAHZF.js +53 -0
  36. package/dist/chunk-IXRZAHZF.js.map +1 -0
  37. package/dist/chunk-JCPANDNR.js +35 -0
  38. package/dist/chunk-JCPANDNR.js.map +1 -0
  39. package/dist/{chunk-R4SEU3DF.js → chunk-LJCNUP6M.js} +2 -2
  40. package/dist/{chunk-FRWKCE6R.js → chunk-MHRC3KRX.js} +5 -5
  41. package/dist/chunk-MHRC3KRX.js.map +1 -0
  42. package/dist/chunk-MO5FGLVS.js +142 -0
  43. package/dist/chunk-MO5FGLVS.js.map +1 -0
  44. package/dist/{chunk-Q5FLW4JG.js → chunk-OKH64JZE.js} +2 -2
  45. package/dist/{chunk-WG6V6VJV.js → chunk-PCC4LBKB.js} +2 -2
  46. package/dist/chunk-PMUABBPG.js +258 -0
  47. package/dist/chunk-PMUABBPG.js.map +1 -0
  48. package/dist/{chunk-EFU6P3B7.js → chunk-PNMM5HNX.js} +5 -5
  49. package/dist/{chunk-4VYALFQZ.js → chunk-QWVXOCXO.js} +6 -6
  50. package/dist/{chunk-35VOK7XE.js → chunk-RWOYPOMR.js} +4365 -4355
  51. package/dist/chunk-RWOYPOMR.js.map +1 -0
  52. package/dist/{chunk-IO4VEW5U.js → chunk-SY4X2LND.js} +4 -4
  53. package/dist/{chunk-XGMOXMS4.js → chunk-TBOVYLQJ.js} +2 -2
  54. package/dist/{chunk-BMGBA6HJ.js → chunk-TNGMF4UX.js} +20 -20
  55. package/dist/{chunk-BMGBA6HJ.js.map → chunk-TNGMF4UX.js.map} +1 -1
  56. package/dist/{chunk-TY6CAOL7.js → chunk-UMH2YZKG.js} +14 -5
  57. package/dist/chunk-UMH2YZKG.js.map +1 -0
  58. package/dist/{chunk-6CNRMCFM.js → chunk-VPASBA7P.js} +2 -2
  59. package/dist/{chunk-NXQAY5U7.js → chunk-WCAUUBHO.js} +5860 -5126
  60. package/dist/chunk-WCAUUBHO.js.map +1 -0
  61. package/dist/{chunk-V3ENMW7G.js → chunk-WFRTHH3A.js} +3 -3
  62. package/dist/{chunk-2HC2SNRP.js → chunk-WTJ3AY33.js} +1 -5
  63. package/dist/chunk-WTJ3AY33.js.map +1 -0
  64. package/dist/{chunk-F7Z5I6GU.js → chunk-WUQ3MTPF.js} +11 -5
  65. package/dist/{chunk-F7Z5I6GU.js.map → chunk-WUQ3MTPF.js.map} +1 -1
  66. package/dist/{chunk-U2YSGBHA.js → chunk-XAXJWXI4.js} +93 -43
  67. package/dist/chunk-XAXJWXI4.js.map +1 -0
  68. package/dist/{chunk-ACKC577F.js → chunk-Y5Y7XHVU.js} +4 -4
  69. package/dist/{chunk-X5XJ6WKO.js → chunk-YO2LTXB4.js} +107 -16
  70. package/dist/chunk-YO2LTXB4.js.map +1 -0
  71. package/dist/{chunk-FIHTAFST.js → chunk-ZUAZHDKP.js} +64 -65
  72. package/dist/chunk-ZUAZHDKP.js.map +1 -0
  73. package/dist/commands/build/marketplace.js +98 -120
  74. package/dist/commands/build/marketplace.js.map +1 -1
  75. package/dist/commands/build/plugins.js +8 -8
  76. package/dist/commands/compile.js +57 -24
  77. package/dist/commands/compile.js.map +1 -1
  78. package/dist/commands/doctor.js +220 -79
  79. package/dist/commands/doctor.js.map +1 -1
  80. package/dist/commands/edit.js +608 -100
  81. package/dist/commands/edit.js.map +1 -1
  82. package/dist/commands/eject.js +26 -21
  83. package/dist/commands/eject.js.map +1 -1
  84. package/dist/commands/init.js +41 -39
  85. package/dist/commands/list.js +11 -11
  86. package/dist/commands/list.js.map +1 -1
  87. package/dist/commands/new/marketplace.js +243 -0
  88. package/dist/commands/new/marketplace.js.map +1 -0
  89. package/dist/commands/search.js +34 -24
  90. package/dist/commands/search.js.map +1 -1
  91. package/dist/commands/share.js +67 -0
  92. package/dist/commands/share.js.map +1 -0
  93. package/dist/commands/uninstall.js +234 -196
  94. package/dist/commands/uninstall.js.map +1 -1
  95. package/dist/commands/update.js +9 -9
  96. package/dist/commands/update.js.map +1 -1
  97. package/dist/components/common/prompt-confirm.js +1 -1
  98. package/dist/components/common/removal-plan-confirm.js +10 -0
  99. package/dist/components/common/select-list.js +2 -2
  100. package/dist/components/wizard/category-grid.js +5 -5
  101. package/dist/components/wizard/checkbox-grid.js +5 -5
  102. package/dist/components/wizard/domain-selection.js +11 -11
  103. package/dist/components/wizard/run-wizard-session.js +29 -28
  104. package/dist/components/wizard/scroll-affordance.js +2 -2
  105. package/dist/components/wizard/skill-agent-summary.js +6 -6
  106. package/dist/components/wizard/source-grid.js +6 -6
  107. package/dist/components/wizard/stack-selection.js +8 -8
  108. package/dist/components/wizard/step-agents.js +10 -11
  109. package/dist/components/wizard/step-build.js +9 -9
  110. package/dist/components/wizard/step-confirm.js +10 -10
  111. package/dist/components/wizard/step-sources.js +10 -10
  112. package/dist/components/wizard/step-stack.js +9 -9
  113. package/dist/components/wizard/summary-panel.js +9 -9
  114. package/dist/components/wizard/toast.js +2 -2
  115. package/dist/components/wizard/wizard-layout.js +14 -14
  116. package/dist/components/wizard/wizard-tabs.js +2 -2
  117. package/dist/components/wizard/wizard.js +27 -27
  118. package/dist/copy-local-skills-NSUTBVLJ.js +14 -0
  119. package/dist/hooks/init.js +42 -62
  120. package/dist/hooks/init.js.map +1 -1
  121. package/dist/load-agent-defs-X4E57I2U.js +15 -0
  122. package/dist/{loader-4U7UCE2Y.js → loader-G6BFG2VA.js} +3 -3
  123. package/dist/recompile-project-agents-JE4MM72I.js +20 -0
  124. package/dist/{source-loader-ZNSYJJCI.js → source-loader-3DL3NYUX.js} +7 -5
  125. package/dist/source-loader-3DL3NYUX.js.map +1 -0
  126. package/dist/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  127. package/dist/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  128. package/dist/src/agents/developer/ai-developer/identity.md +1 -1
  129. package/dist/src/agents/developer/ai-developer/playbook.md +1 -1
  130. package/dist/src/agents/developer/api-developer/identity.md +1 -1
  131. package/dist/src/agents/developer/cli-developer/identity.md +1 -1
  132. package/dist/src/agents/developer/web-developer/identity.md +1 -1
  133. package/dist/src/agents/meta/codex-keeper/identity.md +1 -1
  134. package/dist/src/agents/meta/convention-keeper/identity.md +1 -1
  135. package/dist/src/agents/meta/skill-summoner/identity.md +1 -1
  136. package/dist/src/agents/researcher/ai-researcher/identity.md +1 -1
  137. package/dist/src/agents/researcher/api-researcher/identity.md +1 -1
  138. package/dist/src/agents/researcher/cli-researcher/identity.md +1 -1
  139. package/dist/src/agents/researcher/web-researcher/identity.md +1 -1
  140. package/dist/src/agents/reviewer/reviewer/playbook.md +1 -1
  141. package/dist/src/agents/tester/ai-tester/identity.md +1 -1
  142. package/dist/src/agents/tester/api-tester/critical-reminders.md +1 -1
  143. package/dist/src/agents/tester/api-tester/critical-requirements.md +1 -1
  144. package/dist/src/agents/tester/api-tester/identity.md +2 -2
  145. package/dist/src/agents/tester/cli-tester/identity.md +1 -1
  146. package/dist/src/agents/tester/web-tester/identity.md +3 -3
  147. package/dist/stores/wizard-store.js +7 -5
  148. package/package.json +10 -7
  149. package/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  150. package/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  151. package/src/agents/developer/ai-developer/identity.md +1 -1
  152. package/src/agents/developer/ai-developer/playbook.md +1 -1
  153. package/src/agents/developer/api-developer/identity.md +1 -1
  154. package/src/agents/developer/cli-developer/identity.md +1 -1
  155. package/src/agents/developer/web-developer/identity.md +1 -1
  156. package/src/agents/meta/codex-keeper/identity.md +1 -1
  157. package/src/agents/meta/convention-keeper/identity.md +1 -1
  158. package/src/agents/meta/skill-summoner/identity.md +1 -1
  159. package/src/agents/researcher/ai-researcher/identity.md +1 -1
  160. package/src/agents/researcher/api-researcher/identity.md +1 -1
  161. package/src/agents/researcher/cli-researcher/identity.md +1 -1
  162. package/src/agents/researcher/web-researcher/identity.md +1 -1
  163. package/src/agents/reviewer/reviewer/playbook.md +1 -1
  164. package/src/agents/tester/ai-tester/identity.md +1 -1
  165. package/src/agents/tester/api-tester/critical-reminders.md +1 -1
  166. package/src/agents/tester/api-tester/critical-requirements.md +1 -1
  167. package/src/agents/tester/api-tester/identity.md +2 -2
  168. package/src/agents/tester/cli-tester/identity.md +1 -1
  169. package/src/agents/tester/web-tester/identity.md +3 -3
  170. package/src/schemas/custom-metadata.schema.json +3 -0
  171. package/src/schemas/metadata.schema.json +3 -0
  172. package/src/schemas/plugin.schema.json +3 -0
  173. package/src/schemas/project-config.schema.json +4 -8
  174. package/src/schemas/project-source-config.schema.json +2 -2
  175. package/dist/chunk-2HC2SNRP.js.map +0 -1
  176. package/dist/chunk-35VOK7XE.js.map +0 -1
  177. package/dist/chunk-FIHTAFST.js.map +0 -1
  178. package/dist/chunk-FRWKCE6R.js.map +0 -1
  179. package/dist/chunk-HEBPKK5L.js.map +0 -1
  180. package/dist/chunk-JC7DBPRD.js.map +0 -1
  181. package/dist/chunk-K7PJDWER.js.map +0 -1
  182. package/dist/chunk-KET3EVGX.js +0 -41
  183. package/dist/chunk-KET3EVGX.js.map +0 -1
  184. package/dist/chunk-M5HSTNYU.js.map +0 -1
  185. package/dist/chunk-NXQAY5U7.js.map +0 -1
  186. package/dist/chunk-OJJLYHM3.js +0 -34
  187. package/dist/chunk-OJJLYHM3.js.map +0 -1
  188. package/dist/chunk-ORJ5Y222.js.map +0 -1
  189. package/dist/chunk-R54KIGN2.js.map +0 -1
  190. package/dist/chunk-REKOWTIB.js.map +0 -1
  191. package/dist/chunk-TY6CAOL7.js.map +0 -1
  192. package/dist/chunk-U2DNAHFE.js.map +0 -1
  193. package/dist/chunk-U2YSGBHA.js.map +0 -1
  194. package/dist/chunk-VGEBYCQZ.js.map +0 -1
  195. package/dist/chunk-X5XJ6WKO.js.map +0 -1
  196. package/dist/copy-local-skills-KF2RAVD3.js +0 -14
  197. package/dist/load-agent-defs-DGXGBU3Q.js +0 -15
  198. package/dist/recompile-project-agents-CJVBAWDJ.js +0 -20
  199. /package/dist/{chunk-ZNDLUWWD.js.map → chunk-4A4L3YIW.js.map} +0 -0
  200. /package/dist/{chunk-WDAO3RUY.js.map → chunk-5F2YR5XV.js.map} +0 -0
  201. /package/dist/{chunk-JFAUQDZM.js.map → chunk-5OKLCVM4.js.map} +0 -0
  202. /package/dist/{chunk-K3O3YQYG.js.map → chunk-G47TDUK3.js.map} +0 -0
  203. /package/dist/{chunk-NSJ2S7R5.js.map → chunk-ILUVL7WM.js.map} +0 -0
  204. /package/dist/{chunk-R4SEU3DF.js.map → chunk-LJCNUP6M.js.map} +0 -0
  205. /package/dist/{chunk-Q5FLW4JG.js.map → chunk-OKH64JZE.js.map} +0 -0
  206. /package/dist/{chunk-WG6V6VJV.js.map → chunk-PCC4LBKB.js.map} +0 -0
  207. /package/dist/{chunk-EFU6P3B7.js.map → chunk-PNMM5HNX.js.map} +0 -0
  208. /package/dist/{chunk-4VYALFQZ.js.map → chunk-QWVXOCXO.js.map} +0 -0
  209. /package/dist/{chunk-IO4VEW5U.js.map → chunk-SY4X2LND.js.map} +0 -0
  210. /package/dist/{chunk-XGMOXMS4.js.map → chunk-TBOVYLQJ.js.map} +0 -0
  211. /package/dist/{chunk-6CNRMCFM.js.map → chunk-VPASBA7P.js.map} +0 -0
  212. /package/dist/{chunk-V3ENMW7G.js.map → chunk-WFRTHH3A.js.map} +0 -0
  213. /package/dist/{chunk-ACKC577F.js.map → chunk-Y5Y7XHVU.js.map} +0 -0
  214. /package/dist/{copy-local-skills-KF2RAVD3.js.map → components/common/removal-plan-confirm.js.map} +0 -0
  215. /package/dist/{load-agent-defs-DGXGBU3Q.js.map → copy-local-skills-NSUTBVLJ.js.map} +0 -0
  216. /package/dist/{loader-4U7UCE2Y.js.map → load-agent-defs-X4E57I2U.js.map} +0 -0
  217. /package/dist/{recompile-project-agents-CJVBAWDJ.js.map → loader-G6BFG2VA.js.map} +0 -0
  218. /package/dist/{source-loader-ZNSYJJCI.js.map → recompile-project-agents-JE4MM72I.js.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  computeRowScrollTop
4
- } from "./chunk-Q5FLW4JG.js";
4
+ } from "./chunk-OKH64JZE.js";
5
5
  import {
6
6
  SCROLL_VIEWPORT
7
- } from "./chunk-R54KIGN2.js";
7
+ } from "./chunk-IO5YBKHV.js";
8
8
 
9
9
  // src/cli/components/hooks/use-row-scroll.ts
10
10
  import { useRef } from "react";
@@ -24,4 +24,4 @@ function useRowScroll({
24
24
  export {
25
25
  useRowScroll
26
26
  };
27
- //# sourceMappingURL=chunk-V3ENMW7G.js.map
27
+ //# sourceMappingURL=chunk-WFRTHH3A.js.map
@@ -5,8 +5,6 @@ var HOTKEY_INFO = { key: "i", label: "I" };
5
5
  var HOTKEY_ACCEPT_DEFAULTS = { key: "a", label: "A" };
6
6
  var HOTKEY_SCOPE = { key: "s", label: "S" };
7
7
  var HOTKEY_TOGGLE_LABELS = { key: "d", label: "D" };
8
- var HOTKEY_SET_ALL_LOCAL = { key: "l", label: "L" };
9
- var HOTKEY_SET_ALL_PLUGIN = { key: "p", label: "P" };
10
8
  var KEY_SPACE = " ";
11
9
  var KEY_LABEL_ENTER = "ENTER";
12
10
  var KEY_LABEL_ESC = "ESC";
@@ -23,8 +21,6 @@ export {
23
21
  HOTKEY_ACCEPT_DEFAULTS,
24
22
  HOTKEY_SCOPE,
25
23
  HOTKEY_TOGGLE_LABELS,
26
- HOTKEY_SET_ALL_LOCAL,
27
- HOTKEY_SET_ALL_PLUGIN,
28
24
  KEY_SPACE,
29
25
  KEY_LABEL_ENTER,
30
26
  KEY_LABEL_ESC,
@@ -32,4 +28,4 @@ export {
32
28
  isHotkey,
33
29
  isInfoPanelAvailable
34
30
  };
35
- //# sourceMappingURL=chunk-2HC2SNRP.js.map
31
+ //# sourceMappingURL=chunk-WTJ3AY33.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/components/wizard/hotkeys.ts"],"sourcesContent":["/**\n * Centralized hotkey registry for wizard components.\n *\n * Every character-based hotkey and its display label lives here so that\n * changing a binding updates the key check, the footer hint, and the\n * info panel in one place.\n */\n\nimport type { WizardStep } from \"../../stores/wizard-store.js\";\n\n// ---------------------------------------------------------------------------\n// Global hotkeys (active across multiple wizard steps)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_INFO = { key: \"i\", label: \"I\" } as const;\nexport const HOTKEY_ACCEPT_DEFAULTS = { key: \"a\", label: \"A\" } as const;\nexport const HOTKEY_SCOPE = { key: \"s\", label: \"S\" } as const;\n\n// ---------------------------------------------------------------------------\n// Build step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_TOGGLE_LABELS = { key: \"d\", label: \"D\" } as const;\n\n// ---------------------------------------------------------------------------\n// Sources step hotkeys\n// ---------------------------------------------------------------------------\n\n// None. The step's two bulk install-mode keys — `l` (set all local) and `p` (set\n// all plugin) — are withdrawn. They rewrote `origin` on every active skill config\n// with no scope authority behind them, so from a project edit they reached the\n// inherited global rows the same step renders locked and non-focusable: the bulk\n// key could do what the per-row control provably cannot. Per-row SPACE on the\n// grid cell is the only install-mode surface, and its own inertness on a locked\n// row is the containment.\n\n// ---------------------------------------------------------------------------\n// Common key labels (for structural keys handled via Ink key objects)\n// ---------------------------------------------------------------------------\n\n/** The spacebar input character (Ink delivers a literal space for the space key). */\nexport const KEY_SPACE = \" \";\n\nexport const KEY_LABEL_ENTER = \"ENTER\" as const;\nexport const KEY_LABEL_ESC = \"ESC\" as const;\nexport const KEY_LABEL_SPACE = \"SPACE\" as const;\nexport const KEY_LABEL_DEL = \"DEL\" as const;\nexport const KEY_LABEL_ARROWS_VERT = \"\\u2191/\\u2193\" as const;\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Case-insensitive check for a character hotkey. */\nexport function isHotkey(input: string, hotkey: { key: string }): boolean {\n return input.toLowerCase() === hotkey.key.toLowerCase();\n}\n\n/**\n * Whether `HOTKEY_INFO` does anything on `step` — the single answer both the\n * key handler in `wizard.tsx` and the footer hint in `wizard-layout.tsx` read,\n * so the wizard never advertises a key it ignores.\n *\n * The confirm step is excluded because it already renders the panel the\n * overlay would show, and the overlay REPLACES the step rather than sitting\n * over it: opening it there would unmount the confirm step's `Enter` handler\n * and strand the user on a screen nothing can complete.\n */\nexport function isInfoPanelAvailable(step: WizardStep): boolean {\n return step !== \"confirm\";\n}\n"],"mappings":";;;AAcO,IAAM,cAAc,EAAE,KAAK,KAAK,OAAO,IAAI;AAC3C,IAAM,yBAAyB,EAAE,KAAK,KAAK,OAAO,IAAI;AACtD,IAAM,eAAe,EAAE,KAAK,KAAK,OAAO,IAAI;AAM5C,IAAM,uBAAuB,EAAE,KAAK,KAAK,OAAO,IAAI;AAmBpD,IAAM,YAAY;AAElB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AASxB,SAAS,SAAS,OAAe,QAAkC;AACxE,SAAO,MAAM,YAAY,MAAM,OAAO,IAAI,YAAY;AACxD;AAYO,SAAS,qBAAqB,MAA2B;AAC9D,SAAO,SAAS;AAClB;","names":[]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  compileAgents
4
- } from "./chunk-REKOWTIB.js";
4
+ } from "./chunk-5QZAK6J7.js";
5
5
  import {
6
6
  ConfigLoadError,
7
7
  buildAndMergeConfig,
@@ -14,14 +14,14 @@ import {
14
14
  loadSkillsMatrixFromSource,
15
15
  resolveInstallPaths,
16
16
  writeScopedFromWizard
17
- } from "./chunk-NXQAY5U7.js";
17
+ } from "./chunk-WCAUUBHO.js";
18
18
  import {
19
19
  disableBuffering,
20
20
  drainBuffer,
21
21
  enableBuffering,
22
22
  ensureDir,
23
23
  loadMergedAgents
24
- } from "./chunk-U2YSGBHA.js";
24
+ } from "./chunk-XAXJWXI4.js";
25
25
 
26
26
  // src/cli/lib/operations/source/load-source.ts
27
27
  async function loadSource(options) {
@@ -108,7 +108,13 @@ async function writeProjectConfig(options) {
108
108
  agents,
109
109
  projectDir,
110
110
  projectConfigPath: projectPaths.configPath,
111
- projectInstallationExists: isProjectContext
111
+ projectInstallationExists: isProjectContext,
112
+ // The same word the merger above took. It decides the config ROW there and the GLOBAL
113
+ // config a project write commits here, and the two files disagree the moment it does not
114
+ // reach both: a row preserved for a skill whose directory the removal diff deleted.
115
+ ...options.authoritativeScope !== void 0 && {
116
+ authoritativeScope: options.authoritativeScope
117
+ }
112
118
  });
113
119
  return {
114
120
  config: finalConfig,
@@ -164,4 +170,4 @@ export {
164
170
  writeProjectConfig,
165
171
  compileAgentsAllScopes
166
172
  };
167
- //# sourceMappingURL=chunk-F7Z5I6GU.js.map
173
+ //# sourceMappingURL=chunk-WUQ3MTPF.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/lib/operations/source/load-source.ts","../src/cli/lib/operations/project/detect-project.ts","../src/cli/lib/operations/project/detect-both-installations.ts","../src/cli/lib/operations/project/write-project-config.ts","../src/cli/lib/operations/project/compile-agents-all-scopes.ts"],"sourcesContent":["import { loadSkillsMatrixFromSource, type SourceLoadResult } from \"../../loading/index.js\";\nimport type { SourceCaller } from \"../../configuration/index.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n type StartupMessage,\n} from \"../../../utils/logger.js\";\n\nexport type LoadSourceOptions = {\n /** Whether this load may reach the init-time source rungs — see {@link SourceCaller}. */\n caller?: SourceCaller;\n sourceFlag?: string;\n projectDir: string;\n /** When true, enables message buffering and captures startup messages. Default: false. */\n captureStartupMessages?: boolean;\n};\n\nexport type LoadedSource = {\n sourceResult: SourceLoadResult;\n /** Empty array when captureStartupMessages is false. */\n startupMessages: StartupMessage[];\n};\n\n/**\n * Loads the skills matrix from a resolved source.\n *\n * When `captureStartupMessages` is true, wraps the load in buffer mode so\n * warn() calls during loading are captured instead of written to stderr.\n * The caller (init/edit) hands them to the wizard, which paints them as a band\n * above the step — stderr does not survive the wizard clearing the terminal.\n *\n * @throws {Error} If source resolution or fetching fails.\n */\nexport async function loadSource(options: LoadSourceOptions): Promise<LoadedSource> {\n const { caller, sourceFlag, projectDir, captureStartupMessages } = options;\n\n if (captureStartupMessages) {\n enableBuffering();\n }\n\n let sourceResult: SourceLoadResult;\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n ...(caller !== undefined && { caller }),\n ...(sourceFlag !== undefined && { sourceFlag }),\n projectDir,\n });\n } catch (error) {\n if (captureStartupMessages) {\n disableBuffering();\n }\n throw error;\n }\n\n let startupMessages: StartupMessage[] = [];\n if (captureStartupMessages) {\n startupMessages = drainBuffer();\n disableBuffering();\n }\n\n return { sourceResult, startupMessages };\n}\n","import { detectInstallation, type Installation } from \"../../installation/index.js\";\nimport { ConfigLoadError, loadProjectConfig } from \"../../configuration/index.js\";\nimport type { ProjectConfig } from \"../../../types/index.js\";\n\nexport type DetectedProject = {\n installation: Installation;\n config: ProjectConfig | null;\n configPath: string | null;\n};\n\n/**\n * Detects an existing CLI installation and loads its project config.\n *\n * Uses detectInstallation() which checks project-level first, then falls back\n * to global. Returns the installation metadata plus the loaded config.\n *\n * Does NOT throw. Returns null when no installation is found OR when the config\n * file exists but is corrupt — the caller (doctor, edit) reports the resulting\n * null as a config/installation problem to the user. `compile` deliberately\n * does NOT use this wrapper: it detects scopes directly so it can hard-error on\n * a corrupt config instead of degrading to null.\n */\nexport async function detectProject(projectDir?: string): Promise<DetectedProject | null> {\n const resolvedDir = projectDir ?? process.cwd();\n\n let installation: Installation | null;\n try {\n installation = await detectInstallation(resolvedDir);\n } catch (error) {\n if (error instanceof ConfigLoadError) return null;\n throw error;\n }\n\n if (!installation) {\n return null;\n }\n\n const loaded = await loadProjectConfig(installation.projectDir);\n\n return {\n installation,\n config: loaded?.config ?? null,\n configPath: loaded?.configPath ?? null,\n };\n}\n","import {\n detectGlobalInstallation,\n detectProjectInstallation,\n isHomeDirectory,\n type Installation,\n} from \"../../installation/index.js\";\n\nexport type BothInstallations = {\n global: Installation | null;\n project: Installation | null;\n hasBoth: boolean;\n};\n\n/**\n * Detects both global and project installations.\n *\n * Skips project detection when projectDir is the home directory\n * to avoid double-compile. Returns a convenience `hasBoth` flag\n * used by callers to set scopeFilter on compile passes.\n */\nexport async function detectBothInstallations(projectDir: string): Promise<BothInstallations> {\n const global = await detectGlobalInstallation();\n\n const project = isHomeDirectory(projectDir) ? null : await detectProjectInstallation(projectDir);\n return { global, project, hasBoth: !!global && !!project };\n}\n","import path from \"path\";\nimport {\n buildAndMergeConfig,\n resolveInstallPaths,\n isHomeDirectory,\n} from \"../../installation/index.js\";\nimport { loadMergedAgents, type SourceLoadResult } from \"../../loading/index.js\";\nimport type { AuthoritativeScope } from \"../../configuration/index.js\";\nimport {\n ensureBlankPair,\n writeScopedFromWizard,\n type GateReport,\n} from \"../../config-gate/index.js\";\nimport { ensureDir } from \"../../../utils/fs.js\";\nimport type { ProjectConfig, AgentDefinition, AgentName } from \"../../../types/index.js\";\nimport type { WizardResultV2 } from \"../../../components/wizard/wizard.js\";\n\nexport type ConfigWriteOptions = {\n wizardResult: WizardResultV2;\n sourceResult: SourceLoadResult;\n projectDir: string;\n sourceFlag?: string;\n /** Pre-loaded agent definitions. If omitted, loads from CLI + source. */\n agents?: Partial<Record<AgentName, AgentDefinition>>;\n /**\n * Authority of `cc edit`'s newConfig over absent entries (D-233 Scenario C):\n * `\"all\"` (global edit) drops any deselected entry, `\"owned\"` (project edit) drops deselected\n * project-owned entries only, `undefined` (init) keeps additive union-preserve.\n */\n authoritativeScope?: AuthoritativeScope;\n};\n\nexport type ConfigWriteResult = {\n config: ProjectConfig;\n configPath: string;\n wasMerged: boolean;\n existingConfigPath?: string;\n filesWritten: number;\n /**\n * What the gated write did: what moved in the global config, which registered\n * projects it fanned out to, and the recompile it drove in them. The caller\n * renders it; the work is already done.\n */\n propagation: GateReport;\n};\n\n/**\n * Builds, merges, and writes project configuration files.\n *\n * Handles the full config pipeline:\n * 1. buildAndMergeConfig() — generates config from wizard result, merges with existing\n * 2. loadAllAgents() — loads agent definitions for config-types generation\n * 3. ensureBlankPair() — ensures the global config pair exists (when in project context)\n * 4. writeScopedFromWizard() — writes config.ts and config-types.ts split by scope,\n * fans global changes out to registered projects and recompiles their agents\n */\nexport async function writeProjectConfig(options: ConfigWriteOptions): Promise<ConfigWriteResult> {\n const { wizardResult, sourceResult, projectDir, sourceFlag } = options;\n const projectPaths = resolveInstallPaths(projectDir, \"project\");\n\n await ensureDir(path.dirname(projectPaths.configPath));\n\n let agents: Partial<Record<AgentName, AgentDefinition>>;\n if (options.agents) {\n agents = options.agents;\n } else {\n agents = await loadMergedAgents(sourceResult.sourcePath);\n }\n\n const mergeResult = await buildAndMergeConfig(\n wizardResult,\n sourceResult,\n projectDir,\n sourceFlag,\n options.authoritativeScope,\n );\n const finalConfig = mergeResult.config;\n\n const isProjectContext = !isHomeDirectory(projectDir);\n\n if (isProjectContext) {\n await ensureBlankPair();\n }\n\n const propagation = await writeScopedFromWizard({\n finalConfig,\n matrix: sourceResult.matrix,\n agents,\n projectDir,\n projectConfigPath: projectPaths.configPath,\n projectInstallationExists: isProjectContext,\n });\n\n return {\n config: finalConfig,\n configPath: projectPaths.configPath,\n wasMerged: mergeResult.merged,\n ...(mergeResult.existingConfigPath !== undefined && {\n existingConfigPath: mergeResult.existingConfigPath,\n }),\n filesWritten: isProjectContext ? 4 : 2,\n propagation,\n };\n}\n","import os from \"os\";\nimport { compileAgents, type CompilationResult } from \"./compile-agents.js\";\nimport { isHomeDirectory, resolveInstallPaths } from \"../../installation/index.js\";\nimport type { AgentName, SkillDefinitionMap, SkillScope } from \"../../../types/index.js\";\n\nexport type CompileAllScopesOptions = {\n /** Working directory of the command — a project root, or home for global context. */\n projectDir: string;\n sourcePath: string;\n skills: SkillDefinitionMap;\n agentScopeMap: Map<AgentName, SkillScope>;\n};\n\n/**\n * Compiles agents for every scope the current context owns.\n *\n * Home context: a single pass writing to the home agents directory.\n * Project context: a global pass (from home) then a project pass, each\n * filtered to its own scope so the project pass cannot overwrite global\n * agents with zero-skill versions. Results merge in pass order.\n */\nexport async function compileAgentsAllScopes(\n options: CompileAllScopesOptions,\n): Promise<CompilationResult> {\n const { projectDir, sourcePath, skills, agentScopeMap } = options;\n const base = { sourcePath, skills, agentScopeMap };\n\n if (isHomeDirectory(projectDir)) {\n return compileAgents({\n ...base,\n projectDir,\n outputDir: resolveInstallPaths(projectDir, \"project\").agentsDir,\n });\n }\n\n const globalResult = await compileAgents({\n ...base,\n projectDir: os.homedir(),\n outputDir: resolveInstallPaths(os.homedir(), \"global\").agentsDir,\n scopeFilter: \"global\",\n });\n const projectResult = await compileAgents({\n ...base,\n projectDir,\n outputDir: resolveInstallPaths(projectDir, \"project\").agentsDir,\n scopeFilter: \"project\",\n });\n return mergeCompilationResults(globalResult, projectResult);\n}\n\nfunction mergeCompilationResults(...results: CompilationResult[]): CompilationResult {\n return {\n compiled: results.flatMap((r) => r.compiled),\n rewritten: results.flatMap((r) => r.rewritten),\n failed: results.flatMap((r) => r.failed),\n warnings: results.flatMap((r) => r.warnings),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,WAAW,SAAmD;AAClF,QAAM,EAAE,QAAQ,YAAY,YAAY,uBAAuB,IAAI;AAEnE,MAAI,wBAAwB;AAC1B,oBAAgB;AAAA,EAClB;AAEA,MAAI;AACJ,MAAI;AACF,mBAAe,MAAM,2BAA2B;AAAA,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AC;AACD,SAAO,wBAAwB,cAAc,aAAa;AAC5D;AAEA,SAAS,2BAA2B,SAAiD;AACnF,SAAO;AAAA,IACL,UAAU,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ;AAAA,IAC3C,WAAW,QAAQ,QAAQ,CAAC,MAAM,EAAE,SAAS;AAAA,IAC7C,QAAQ,QAAQ,QAAQ,CAAC,MAAM,EAAE,MAAM;AAAA,IACvC,UAAU,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ;AAAA,EAC7C;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/cli/lib/operations/source/load-source.ts","../src/cli/lib/operations/project/detect-project.ts","../src/cli/lib/operations/project/detect-both-installations.ts","../src/cli/lib/operations/project/write-project-config.ts","../src/cli/lib/operations/project/compile-agents-all-scopes.ts"],"sourcesContent":["import { loadSkillsMatrixFromSource, type SourceLoadResult } from \"../../loading/index.js\";\nimport type { SourceCaller } from \"../../configuration/index.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n type StartupMessage,\n} from \"../../../utils/logger.js\";\n\nexport type LoadSourceOptions = {\n /** Whether this load may reach the init-time source rungs — see {@link SourceCaller}. */\n caller?: SourceCaller;\n sourceFlag?: string;\n projectDir: string;\n /** When true, enables message buffering and captures startup messages. Default: false. */\n captureStartupMessages?: boolean;\n};\n\nexport type LoadedSource = {\n sourceResult: SourceLoadResult;\n /** Empty array when captureStartupMessages is false. */\n startupMessages: StartupMessage[];\n};\n\n/**\n * Loads the skills matrix from a resolved source.\n *\n * When `captureStartupMessages` is true, wraps the load in buffer mode so\n * warn() calls during loading are captured instead of written to stderr.\n * The caller (init/edit) hands them to the wizard, which paints them as a band\n * above the step — stderr does not survive the wizard clearing the terminal.\n *\n * @throws {Error} If source resolution or fetching fails.\n */\nexport async function loadSource(options: LoadSourceOptions): Promise<LoadedSource> {\n const { caller, sourceFlag, projectDir, captureStartupMessages } = options;\n\n if (captureStartupMessages) {\n enableBuffering();\n }\n\n let sourceResult: SourceLoadResult;\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n ...(caller !== undefined && { caller }),\n ...(sourceFlag !== undefined && { sourceFlag }),\n projectDir,\n });\n } catch (error) {\n if (captureStartupMessages) {\n disableBuffering();\n }\n throw error;\n }\n\n let startupMessages: StartupMessage[] = [];\n if (captureStartupMessages) {\n startupMessages = drainBuffer();\n disableBuffering();\n }\n\n return { sourceResult, startupMessages };\n}\n","import { detectInstallation, type Installation } from \"../../installation/index.js\";\nimport { ConfigLoadError, loadProjectConfig } from \"../../configuration/index.js\";\nimport type { ProjectConfig } from \"../../../types/index.js\";\n\nexport type DetectedProject = {\n installation: Installation;\n config: ProjectConfig | null;\n configPath: string | null;\n};\n\n/**\n * Detects an existing CLI installation and loads its project config.\n *\n * Uses detectInstallation() which checks project-level first, then falls back\n * to global. Returns the installation metadata plus the loaded config.\n *\n * Does NOT throw. Returns null when no installation is found OR when the config\n * file exists but is corrupt — the caller (doctor, edit) reports the resulting\n * null as a config/installation problem to the user. `compile` deliberately\n * does NOT use this wrapper: it detects scopes directly so it can hard-error on\n * a corrupt config instead of degrading to null.\n */\nexport async function detectProject(projectDir?: string): Promise<DetectedProject | null> {\n const resolvedDir = projectDir ?? process.cwd();\n\n let installation: Installation | null;\n try {\n installation = await detectInstallation(resolvedDir);\n } catch (error) {\n if (error instanceof ConfigLoadError) return null;\n throw error;\n }\n\n if (!installation) {\n return null;\n }\n\n const loaded = await loadProjectConfig(installation.projectDir);\n\n return {\n installation,\n config: loaded?.config ?? null,\n configPath: loaded?.configPath ?? null,\n };\n}\n","import {\n detectGlobalInstallation,\n detectProjectInstallation,\n isHomeDirectory,\n type Installation,\n} from \"../../installation/index.js\";\n\nexport type BothInstallations = {\n global: Installation | null;\n project: Installation | null;\n hasBoth: boolean;\n};\n\n/**\n * Detects both global and project installations.\n *\n * Skips project detection when projectDir is the home directory\n * to avoid double-compile. Returns a convenience `hasBoth` flag\n * used by callers to set scopeFilter on compile passes.\n */\nexport async function detectBothInstallations(projectDir: string): Promise<BothInstallations> {\n const global = await detectGlobalInstallation();\n\n const project = isHomeDirectory(projectDir) ? null : await detectProjectInstallation(projectDir);\n return { global, project, hasBoth: !!global && !!project };\n}\n","import path from \"path\";\nimport {\n buildAndMergeConfig,\n resolveInstallPaths,\n isHomeDirectory,\n} from \"../../installation/index.js\";\nimport { loadMergedAgents, type SourceLoadResult } from \"../../loading/index.js\";\nimport type { AuthoritativeScope } from \"../../configuration/index.js\";\nimport {\n ensureBlankPair,\n writeScopedFromWizard,\n type GateReport,\n} from \"../../config-gate/index.js\";\nimport { ensureDir } from \"../../../utils/fs.js\";\nimport type { ProjectConfig, AgentDefinition, AgentName } from \"../../../types/index.js\";\nimport type { WizardResultV2 } from \"../../../components/wizard/wizard.js\";\n\nexport type ConfigWriteOptions = {\n wizardResult: WizardResultV2;\n sourceResult: SourceLoadResult;\n projectDir: string;\n sourceFlag?: string;\n /** Pre-loaded agent definitions. If omitted, loads from CLI + source. */\n agents?: Partial<Record<AgentName, AgentDefinition>>;\n /**\n * Authority of `cc edit`'s newConfig over absent entries (D-233 Scenario C):\n * `\"all\"` (global edit) drops any deselected entry, `\"owned\"` (project edit) drops deselected\n * project-owned entries only, `undefined` (init) keeps additive union-preserve.\n */\n authoritativeScope?: AuthoritativeScope;\n};\n\nexport type ConfigWriteResult = {\n config: ProjectConfig;\n configPath: string;\n wasMerged: boolean;\n existingConfigPath?: string;\n filesWritten: number;\n /**\n * What the gated write did: what moved in the global config, which registered\n * projects it fanned out to, and the recompile it drove in them. The caller\n * renders it; the work is already done.\n */\n propagation: GateReport;\n};\n\n/**\n * Builds, merges, and writes project configuration files.\n *\n * Handles the full config pipeline:\n * 1. buildAndMergeConfig() — generates config from wizard result, merges with existing\n * 2. loadAllAgents() — loads agent definitions for config-types generation\n * 3. ensureBlankPair() — ensures the global config pair exists (when in project context)\n * 4. writeScopedFromWizard() — writes config.ts and config-types.ts split by scope,\n * fans global changes out to registered projects and recompiles their agents\n */\nexport async function writeProjectConfig(options: ConfigWriteOptions): Promise<ConfigWriteResult> {\n const { wizardResult, sourceResult, projectDir, sourceFlag } = options;\n const projectPaths = resolveInstallPaths(projectDir, \"project\");\n\n await ensureDir(path.dirname(projectPaths.configPath));\n\n let agents: Partial<Record<AgentName, AgentDefinition>>;\n if (options.agents) {\n agents = options.agents;\n } else {\n agents = await loadMergedAgents(sourceResult.sourcePath);\n }\n\n const mergeResult = await buildAndMergeConfig(\n wizardResult,\n sourceResult,\n projectDir,\n sourceFlag,\n options.authoritativeScope,\n );\n const finalConfig = mergeResult.config;\n\n const isProjectContext = !isHomeDirectory(projectDir);\n\n if (isProjectContext) {\n await ensureBlankPair();\n }\n\n const propagation = await writeScopedFromWizard({\n finalConfig,\n matrix: sourceResult.matrix,\n agents,\n projectDir,\n projectConfigPath: projectPaths.configPath,\n projectInstallationExists: isProjectContext,\n // The same word the merger above took. It decides the config ROW there and the GLOBAL\n // config a project write commits here, and the two files disagree the moment it does not\n // reach both: a row preserved for a skill whose directory the removal diff deleted.\n ...(options.authoritativeScope !== undefined && {\n authoritativeScope: options.authoritativeScope,\n }),\n });\n\n return {\n config: finalConfig,\n configPath: projectPaths.configPath,\n wasMerged: mergeResult.merged,\n ...(mergeResult.existingConfigPath !== undefined && {\n existingConfigPath: mergeResult.existingConfigPath,\n }),\n filesWritten: isProjectContext ? 4 : 2,\n propagation,\n };\n}\n","import os from \"os\";\nimport { compileAgents, type CompilationResult } from \"./compile-agents.js\";\nimport { isHomeDirectory, resolveInstallPaths } from \"../../installation/index.js\";\nimport type { AgentName, SkillDefinitionMap, SkillScope } from \"../../../types/index.js\";\n\nexport type CompileAllScopesOptions = {\n /** Working directory of the command — a project root, or home for global context. */\n projectDir: string;\n sourcePath: string;\n skills: SkillDefinitionMap;\n agentScopeMap: Map<AgentName, SkillScope>;\n};\n\n/**\n * Compiles agents for every scope the current context owns.\n *\n * Home context: a single pass writing to the home agents directory.\n * Project context: a global pass (from home) then a project pass, each\n * filtered to its own scope so the project pass cannot overwrite global\n * agents with zero-skill versions. Results merge in pass order.\n */\nexport async function compileAgentsAllScopes(\n options: CompileAllScopesOptions,\n): Promise<CompilationResult> {\n const { projectDir, sourcePath, skills, agentScopeMap } = options;\n const base = { sourcePath, skills, agentScopeMap };\n\n if (isHomeDirectory(projectDir)) {\n return compileAgents({\n ...base,\n projectDir,\n outputDir: resolveInstallPaths(projectDir, \"project\").agentsDir,\n });\n }\n\n const globalResult = await compileAgents({\n ...base,\n projectDir: os.homedir(),\n outputDir: resolveInstallPaths(os.homedir(), \"global\").agentsDir,\n scopeFilter: \"global\",\n });\n const projectResult = await compileAgents({\n ...base,\n projectDir,\n outputDir: resolveInstallPaths(projectDir, \"project\").agentsDir,\n scopeFilter: \"project\",\n });\n return mergeCompilationResults(globalResult, projectResult);\n}\n\nfunction mergeCompilationResults(...results: CompilationResult[]): CompilationResult {\n return {\n compiled: results.flatMap((r) => r.compiled),\n rewritten: results.flatMap((r) => r.rewritten),\n failed: results.flatMap((r) => r.failed),\n warnings: results.flatMap((r) => r.warnings),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,eAAsB,WAAW,SAAmD;AAClF,QAAM,EAAE,QAAQ,YAAY,YAAY,uBAAuB,IAAI;AAEnE,MAAI,wBAAwB;AAC1B,oBAAgB;AAAA,EAClB;AAEA,MAAI;AACJ,MAAI;AACF,mBAAe,MAAM,2BAA2B;AAAA,MAC9C,GAAI,WAAW,UAAa,EAAE,OAAO;AAAA,MACrC,GAAI,eAAe,UAAa,EAAE,WAAW;AAAA,MAC7C;AAAA,IACF,CAAC;AAAA,EACH,SAAS,OAAO;AACd,QAAI,wBAAwB;AAC1B,uBAAiB;AAAA,IACnB;AACA,UAAM;AAAA,EACR;AAEA,MAAI,kBAAoC,CAAC;AACzC,MAAI,wBAAwB;AAC1B,sBAAkB,YAAY;AAC9B,qBAAiB;AAAA,EACnB;AAEA,SAAO,EAAE,cAAc,gBAAgB;AACzC;;;ACxCA,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E,MAAM;AAAA,IACvC,UAAU,QAAQ,QAAQ,CAAC,MAAM,EAAE,QAAQ;AAAA,EAC7C;AACF;","names":[]}
@@ -11,7 +11,7 @@ import {
11
11
  PROJECT_ROOT,
12
12
  STANDARD_DIRS,
13
13
  STANDARD_FILES
14
- } from "./chunk-R54KIGN2.js";
14
+ } from "./chunk-IO5YBKHV.js";
15
15
 
16
16
  // src/cli/lib/loading/loader.ts
17
17
  import { parse as parseYaml2 } from "yaml";
@@ -110,8 +110,8 @@ async function listDirectories(dirPath) {
110
110
  return [];
111
111
  }
112
112
  }
113
- async function glob(pattern, cwd) {
114
- return fg(pattern, { cwd, onlyFiles: true });
113
+ async function glob(pattern, cwd, { dot = false } = {}) {
114
+ return fg(pattern, { cwd, onlyFiles: true, dot });
115
115
  }
116
116
  function isGlobalPairPath(resolvedPath) {
117
117
  const globalConfigDir = path.join(os.homedir(), CLAUDE_SRC_DIR);
@@ -129,6 +129,20 @@ async function ensureDir(dirPath) {
129
129
  async function remove(filePath) {
130
130
  await fs.remove(filePath);
131
131
  }
132
+ async function isDirectoryEmpty(dirPath) {
133
+ try {
134
+ const entries = await fs.readdir(dirPath);
135
+ return entries.length === 0;
136
+ } catch {
137
+ return true;
138
+ }
139
+ }
140
+ async function removeDirIfEmpty(dir) {
141
+ if (!await directoryExists(dir)) return false;
142
+ if (!await isDirectoryEmpty(dir)) return false;
143
+ await remove(dir);
144
+ return true;
145
+ }
132
146
  async function copy(src, dest) {
133
147
  await fs.copy(src, dest);
134
148
  }
@@ -806,6 +820,24 @@ var AGENT_NAMES = [
806
820
  "web-tester"
807
821
  ];
808
822
 
823
+ // src/cli/utils/type-guards.ts
824
+ function isRecord(value) {
825
+ return typeof value === "object" && value !== null && !Array.isArray(value);
826
+ }
827
+ function isDomain(value) {
828
+ return DOMAINS.includes(value);
829
+ }
830
+ function isAgentName(value) {
831
+ return AGENT_NAMES.includes(value);
832
+ }
833
+ function isSkillId(value) {
834
+ return SKILL_IDS.includes(value);
835
+ }
836
+ function isSkillAssignment(value) {
837
+ if (typeof value !== "object" || value === null) return false;
838
+ return typeof value.id === "string";
839
+ }
840
+
809
841
  // src/cli/types/matrix.ts
810
842
  var MODEL_NAMES = ["sonnet", "opus", "haiku", "fable", "inherit"];
811
843
  var EFFORT_NAMES = ["low", "medium", "high", "xhigh", "max"];
@@ -823,25 +855,6 @@ var modelNameSchema = z2.enum(MODEL_NAMES);
823
855
  var effortLevelSchema = z2.enum(EFFORT_NAMES);
824
856
  var permissionModeSchema = z2.enum(PERMISSION_MODES);
825
857
  var skillSlugSchema = z2.enum(SKILL_SLUGS);
826
- function validateCategoryField(val, ctx) {
827
- if (!val.category) return;
828
- if (val.custom) {
829
- if (!KEBAB_CASE_PATTERN.test(val.category)) {
830
- ctx.addIssue({
831
- code: "custom",
832
- path: ["category"],
833
- message: "Custom category must be kebab-case"
834
- });
835
- }
836
- return;
837
- }
838
- const result = categoryPathSchema.safeParse(val.category);
839
- if (!result.success) {
840
- for (const issue of result.error.issues) {
841
- ctx.addIssue({ ...issue, path: ["category"] });
842
- }
843
- }
844
- }
845
858
  var categoryPathSchema = z2.string().refine(
846
859
  (val) => {
847
860
  if (val === LOCAL_PSEUDO_CATEGORY) return true;
@@ -884,12 +897,11 @@ var skillFrontmatterLoaderSchema = z2.object({
884
897
  model: modelNameSchema.exactOptional()
885
898
  });
886
899
  var skillMetadataLoaderSchema = z2.object({
887
- // Field accepts any string; cross-field validation in superRefine enforces strict/custom rules
888
- category: z2.string().exactOptional(),
900
+ category: categoryPathSchema.exactOptional(),
889
901
  author: z2.string().exactOptional(),
890
902
  domain: z2.string(),
891
903
  custom: z2.boolean().exactOptional()
892
- }).passthrough().superRefine(validateCategoryField);
904
+ }).passthrough();
893
905
  var matrixRawMetadataSchema = z2.object({
894
906
  category: categoryPathSchema,
895
907
  author: z2.string(),
@@ -910,6 +922,8 @@ var pluginManifestObjectSchema = z2.object({
910
922
  version: z2.string().exactOptional(),
911
923
  description: z2.string().exactOptional(),
912
924
  author: pluginAuthorSchema.exactOptional(),
925
+ /** Lenient: a plugin authored elsewhere may carry any category string or none at all */
926
+ category: z2.string().exactOptional(),
913
927
  keywords: z2.array(z2.string()).exactOptional(),
914
928
  commands: z2.union([z2.string(), z2.array(z2.string())]).exactOptional(),
915
929
  agents: z2.union([z2.string(), z2.array(z2.string())]).exactOptional(),
@@ -940,7 +954,33 @@ var stackAgentConfigSchema = z2.record(
940
954
  z2.string(),
941
955
  z2.union([skillAssignmentElementSchema, z2.array(skillAssignmentElementSchema)])
942
956
  );
943
- var projectConfigLoaderSchema = z2.object({
957
+ var RENAMED_CONFIG_FIELDS = { source: "marketplace" };
958
+ var RENAMED_SKILL_ENTRY_FIELDS = { source: "origin" };
959
+ function renamedFieldMessage(oldKey, newKey) {
960
+ return `"${oldKey}" was renamed to "${newKey}". Rename the key in this config \u2014 the CLI does not read "${oldKey}" any more and will not fall back to it.`;
961
+ }
962
+ function reportRenamedKeys(record, renames, path3, ctx) {
963
+ for (const [oldKey, newKey] of Object.entries(renames)) {
964
+ if (!(oldKey in record)) continue;
965
+ ctx.addIssue({
966
+ code: "custom",
967
+ path: [...path3, oldKey],
968
+ message: renamedFieldMessage(oldKey, newKey)
969
+ });
970
+ }
971
+ }
972
+ function refuseRenamedFields(config, ctx) {
973
+ if (!isRecord(config)) return;
974
+ reportRenamedKeys(config, RENAMED_CONFIG_FIELDS, [], ctx);
975
+ const { skills } = config;
976
+ if (!Array.isArray(skills)) return;
977
+ for (const [index, entry] of skills.entries()) {
978
+ if (!isRecord(entry)) continue;
979
+ reportRenamedKeys(entry, RENAMED_SKILL_ENTRY_FIELDS, ["skills", index], ctx);
980
+ }
981
+ }
982
+ var renamedFieldGuard = z2.unknown().superRefine(refuseRenamedFields);
983
+ var projectConfigFields = z2.object({
944
984
  /** Project/plugin name in kebab-case */
945
985
  name: z2.string().exactOptional(),
946
986
  description: z2.string().exactOptional(),
@@ -955,12 +995,12 @@ var projectConfigLoaderSchema = z2.object({
955
995
  excluded: z2.boolean().exactOptional()
956
996
  })
957
997
  ).exactOptional(),
958
- /** Per-skill configuration with scope and source */
998
+ /** Per-skill configuration with scope and provenance */
959
999
  skills: z2.array(
960
1000
  z2.object({
961
1001
  id: z2.string(),
962
1002
  scope: z2.enum(["project", "global"]),
963
- source: z2.string(),
1003
+ origin: z2.string(),
964
1004
  excluded: z2.boolean().exactOptional()
965
1005
  })
966
1006
  ).exactOptional(),
@@ -970,15 +1010,16 @@ var projectConfigLoaderSchema = z2.object({
970
1010
  selectedDomains: z2.array(z2.string()).exactOptional(),
971
1011
  /** Agent-to-category-to-skill mappings from selected stack (accepts same formats as stacks.ts) */
972
1012
  stack: z2.record(z2.string(), stackAgentConfigSchema).exactOptional(),
973
- /** Skills source path or URL (e.g., "github:my-org/skills") */
974
- source: z2.string().exactOptional(),
975
- /** Marketplace identifier for plugin installation */
1013
+ /** The marketplace this install reads skills from, as a path or URL (e.g., "github:my-org/skills") */
976
1014
  marketplace: z2.string().exactOptional(),
1015
+ /** The name that marketplace's manifest gives it, which plugins are registered under */
1016
+ marketplaceName: z2.string().exactOptional(),
977
1017
  /** Separate source for agents when different from skills source */
978
1018
  agentsSource: z2.string().exactOptional(),
979
1019
  /** Tracked project installation paths (global config only) */
980
1020
  projects: z2.array(z2.string()).exactOptional()
981
1021
  }).passthrough();
1022
+ var projectConfigLoaderSchema = renamedFieldGuard.pipe(projectConfigFields);
982
1023
  var categoryDefinitionSchema = z2.object({
983
1024
  id: z2.string(),
984
1025
  displayName: z2.string(),
@@ -1028,15 +1069,14 @@ var localRawMetadataSchema = z2.object({
1028
1069
  /** One-line description for the wizard */
1029
1070
  cliDescription: z2.string().exactOptional(),
1030
1071
  /** Category to place this skill in (e.g., "web-framework") */
1031
- // Field accepts any string; cross-field validation in superRefine enforces strict/custom rules
1032
- category: z2.string(),
1072
+ category: categoryPathSchema,
1033
1073
  /** When an AI agent should invoke this skill */
1034
1074
  usageGuidance: z2.string().exactOptional(),
1035
1075
  /** Domain this skill belongs to (e.g., "web", "api", "cli") */
1036
1076
  domain: z2.string(),
1037
1077
  /** True if this skill was created outside the CLI's built-in vocabulary */
1038
1078
  custom: z2.boolean().exactOptional()
1039
- }).passthrough().superRefine(validateCategoryField);
1079
+ }).passthrough();
1040
1080
  var localSkillMetadataSchema = z2.object({
1041
1081
  forkedFrom: z2.object({
1042
1082
  /** Original skill ID before forking — lenient (any string) since custom/extra-source skills have non-builtin IDs */
@@ -1046,7 +1086,9 @@ var localSkillMetadataSchema = z2.object({
1046
1086
  /** ISO date when the fork was created */
1047
1087
  date: z2.string(),
1048
1088
  /** Source URL the skill was installed from (e.g., "github:agents-inc/skills") */
1049
- source: z2.string().exactOptional()
1089
+ source: z2.string().exactOptional(),
1090
+ /** Directory inside that repository, for a skill only its own bytes can install again */
1091
+ path: z2.string().exactOptional()
1050
1092
  }).exactOptional()
1051
1093
  }).passthrough();
1052
1094
  var stackSchema = z2.object({
@@ -1112,13 +1154,13 @@ var brandingConfigSchema = z2.object({
1112
1154
  /** Custom tagline shown in wizard header */
1113
1155
  tagline: z2.string().exactOptional()
1114
1156
  });
1115
- var projectSourceConfigSchema = z2.object({
1116
- /** Primary skills source (path or URL) */
1117
- source: z2.string().exactOptional(),
1157
+ var projectSourceConfigFields = z2.object({
1158
+ /** The marketplace this install reads skills from, as a path or URL */
1159
+ marketplace: z2.string().exactOptional(),
1118
1160
  /** Author handle for this project's config */
1119
1161
  author: z2.string().exactOptional(),
1120
- /** Marketplace identifier for plugin installation */
1121
- marketplace: z2.string().exactOptional(),
1162
+ /** The name that marketplace's manifest gives it, which plugins are registered under */
1163
+ marketplaceName: z2.string().exactOptional(),
1122
1164
  /** Separate source for agent definitions (when different from skills) */
1123
1165
  agentsSource: z2.string().exactOptional(),
1124
1166
  /** Branding overrides for white-labeling the CLI */
@@ -1134,6 +1176,7 @@ var projectSourceConfigSchema = z2.object({
1134
1176
  /** Custom rules file path override (default: "config/skill-rules.ts") */
1135
1177
  rulesFile: z2.string().exactOptional()
1136
1178
  }).passthrough();
1179
+ var projectSourceConfigSchema = renamedFieldGuard.pipe(projectSourceConfigFields);
1137
1180
  var agentYamlGenerationSchema = z2.object({
1138
1181
  $schema: z2.string().exactOptional(),
1139
1182
  id: z2.string().min(1),
@@ -1190,6 +1233,8 @@ var forkedFromSchema = z2.object({
1190
1233
  contentHash: z2.string(),
1191
1234
  /** Source URL or identifier */
1192
1235
  source: z2.string().exactOptional(),
1236
+ /** Directory inside that source, for a skill only its own bytes can install again */
1237
+ path: z2.string().exactOptional(),
1193
1238
  /** ISO date of the fork */
1194
1239
  date: z2.string()
1195
1240
  });
@@ -1567,6 +1612,8 @@ export {
1567
1612
  writeFile,
1568
1613
  ensureDir,
1569
1614
  remove,
1615
+ isDirectoryEmpty,
1616
+ removeDirIfEmpty,
1570
1617
  copy,
1571
1618
  setVerbose,
1572
1619
  verbose,
@@ -1576,9 +1623,12 @@ export {
1576
1623
  disableBuffering,
1577
1624
  warn,
1578
1625
  formatZodErrors,
1579
- SKILL_IDS,
1580
- DOMAINS,
1581
1626
  AGENT_NAMES,
1627
+ isRecord,
1628
+ isDomain,
1629
+ isAgentName,
1630
+ isSkillId,
1631
+ isSkillAssignment,
1582
1632
  MODEL_NAMES,
1583
1633
  EFFORT_NAMES,
1584
1634
  skillMetadataLoaderSchema,
@@ -1614,4 +1664,4 @@ export {
1614
1664
  loadSkillsFromDir,
1615
1665
  loadPluginSkills
1616
1666
  };
1617
- //# sourceMappingURL=chunk-U2YSGBHA.js.map
1667
+ //# sourceMappingURL=chunk-XAXJWXI4.js.map