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,80 +1,79 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SelectList
4
- } from "./chunk-XGMOXMS4.js";
4
+ } from "./chunk-TBOVYLQJ.js";
5
5
  import {
6
- promptValue
7
- } from "./chunk-OJJLYHM3.js";
6
+ seedToWizardResult
7
+ } from "./chunk-MO5FGLVS.js";
8
+ import {
9
+ runWizardSession
10
+ } from "./chunk-IXRZAHZF.js";
11
+ import {
12
+ useTerminalDimensions
13
+ } from "./chunk-HG4JPXJT.js";
8
14
  import {
9
15
  Spinner
10
16
  } from "./chunk-ZBPEFQ4G.js";
11
17
  import {
12
- runWizardSession
13
- } from "./chunk-KET3EVGX.js";
18
+ fetchSeedConfig,
19
+ registerExternalSkills,
20
+ writeExternalSkills
21
+ } from "./chunk-PMUABBPG.js";
14
22
  import {
15
- useTerminalDimensions
16
- } from "./chunk-M5HSTNYU.js";
23
+ promptValue
24
+ } from "./chunk-JCPANDNR.js";
17
25
  import {
18
26
  compileAgentsAllScopes,
19
27
  loadSource,
20
28
  writeProjectConfig
21
- } from "./chunk-F7Z5I6GU.js";
29
+ } from "./chunk-WUQ3MTPF.js";
22
30
  import {
23
31
  discoverInstalledSkills
24
- } from "./chunk-REKOWTIB.js";
25
- import {
26
- copyLocalSkills
27
- } from "./chunk-NXGMM5YN.js";
32
+ } from "./chunk-5QZAK6J7.js";
28
33
  import {
29
34
  loadAgentDefs
30
- } from "./chunk-FRWKCE6R.js";
35
+ } from "./chunk-MHRC3KRX.js";
36
+ import {
37
+ copyLocalSkills
38
+ } from "./chunk-F2AMBBIA.js";
31
39
  import {
32
40
  render
33
41
  } from "./chunk-JFLVEFFP.js";
34
- import {
35
- orderDomains
36
- } from "./chunk-HEBPKK5L.js";
37
42
  import {
38
43
  BaseCommand,
39
44
  EXIT_CODES
40
- } from "./chunk-X5XJ6WKO.js";
45
+ } from "./chunk-YO2LTXB4.js";
41
46
  import {
42
47
  clearTerminalScreen
43
- } from "./chunk-K3O3YQYG.js";
48
+ } from "./chunk-G47TDUK3.js";
44
49
  import {
45
- DEFAULT_SELECTION_OPTIONS,
46
50
  INSTALL_MODE_DESCRIPTIONS,
47
51
  INSTALL_MODE_LABELS,
48
52
  STATUS_MESSAGES,
49
53
  SUCCESS_MESSAGES,
50
- activeAgentNames,
51
54
  buildAgentScopeMap,
55
+ carriedSkillsWritten,
52
56
  deriveInstallMode,
53
57
  detectGlobalInstallation,
54
58
  detectInstallation,
55
59
  detectProjectInstallation,
56
60
  getInstallationInfo,
61
+ globalScopedAgentsHint,
57
62
  isHomeDirectory,
58
- isScopePairCompatible,
59
63
  loadProjectConfig,
60
- loadProjectConfigFromDir,
61
64
  resolveInstallPaths,
62
- seedPayloadSchema,
63
65
  sharedConfigExistingInstall,
64
66
  sharedConfigGlobalInstall,
65
- validateSelection
66
- } from "./chunk-NXQAY5U7.js";
67
+ skippedUnknownAgents,
68
+ skippedUnknownSkills
69
+ } from "./chunk-WCAUUBHO.js";
67
70
  import {
68
- AGENT_NAMES,
69
71
  fileExists,
70
72
  getErrorMessage,
71
73
  readFileSafe,
72
74
  settingsFileSchema,
73
75
  warn
74
- } from "./chunk-U2YSGBHA.js";
75
- import {
76
- getCategoryDomain
77
- } from "./chunk-35VOK7XE.js";
76
+ } from "./chunk-XAXJWXI4.js";
78
77
  import {
79
78
  ASCII_LOGO,
80
79
  CLAUDE_DIR,
@@ -82,173 +81,17 @@ import {
82
81
  CLI_COLORS,
83
82
  CLI_INVOKE_COMMAND,
84
83
  DEFAULT_BRANDING,
85
- DEFAULT_PUBLIC_SOURCE_NAME,
86
84
  EDIT_PROJECT_SETUP_FLAG,
87
85
  EJECT_SOURCE,
88
86
  MAX_CONFIG_FILE_SIZE,
89
87
  STANDARD_FILES
90
- } from "./chunk-R54KIGN2.js";
88
+ } from "./chunk-IO5YBKHV.js";
91
89
 
92
90
  // src/cli/commands/init.tsx
93
- import os from "os";
94
91
  import "react";
95
92
  import { Flags } from "@oclif/core";
96
93
  import { Box as Box2, Text as Text2, useApp } from "ink";
97
94
 
98
- // src/cli/lib/seed/fetch-seed.ts
99
- var SEED_API_URL = process.env.AGENTS_INC_API_URL ?? "https://api.agentsinc.sh";
100
- var SEED_USER_AGENT = "agents-inc-cli";
101
- async function fetchSeedConfig(id) {
102
- const url = `${SEED_API_URL}/configs/${encodeURIComponent(id)}`;
103
- let response;
104
- try {
105
- response = await fetch(url, {
106
- headers: { accept: "application/json", "user-agent": SEED_USER_AGENT }
107
- });
108
- } catch {
109
- return { ok: false, error: `Could not reach ${SEED_API_URL} \u2014 check your connection.` };
110
- }
111
- if (response.status === 404) {
112
- return { ok: false, error: `No configuration found for id '${id}'.` };
113
- }
114
- if (!response.ok) {
115
- return { ok: false, error: `Fetching configuration failed (HTTP ${response.status}).` };
116
- }
117
- let body;
118
- try {
119
- body = await response.json();
120
- } catch {
121
- return { ok: false, error: "The configuration store returned something that is not JSON." };
122
- }
123
- const parsed = seedPayloadSchema.safeParse(body);
124
- if (!parsed.success) {
125
- return {
126
- ok: false,
127
- error: `Configuration '${id}' does not match the expected format \u2014 it may have been created by a newer version.`
128
- };
129
- }
130
- return { ok: true, payload: parsed.data };
131
- }
132
-
133
- // src/cli/lib/seed/seed-to-wizard.ts
134
- var KNOWN_AGENTS = new Set(AGENT_NAMES);
135
- function sourceForSkill(skill) {
136
- return skill?.availableSources?.find((s) => s.primary)?.name ?? DEFAULT_PUBLIC_SOURCE_NAME;
137
- }
138
- function addToDomainSelections(selections, domain, category, skillId) {
139
- const categorySelections = selections[domain] ??= {};
140
- const skillList = categorySelections[category] ??= [];
141
- if (!skillList.includes(skillId)) skillList.push(skillId);
142
- }
143
- function addToAgentStack(stack, agent, category, assignment) {
144
- const agentStack = stack[agent] ??= {};
145
- const assignments = agentStack[category] ??= [];
146
- assignments.push(assignment);
147
- }
148
- function toSkillAssignment(skillId, load) {
149
- return { id: skillId, preloaded: load === "preloaded" };
150
- }
151
- function readAgentMap(agents) {
152
- const known = /* @__PURE__ */ new Map();
153
- const switchedOff = /* @__PURE__ */ new Set();
154
- const unknown = [];
155
- for (const [name, entry] of Object.entries(agents)) {
156
- if (!KNOWN_AGENTS.has(name)) unknown.push(name);
157
- else if (entry.on === false) switchedOff.add(name);
158
- else known.set(name, entry);
159
- }
160
- return { known, switchedOff, unknown };
161
- }
162
- function seedAgentScope(entry) {
163
- return entry?.scope ?? DEFAULT_SELECTION_OPTIONS.scope;
164
- }
165
- function agentScopeConfig(name, entry) {
166
- return {
167
- name,
168
- scope: seedAgentScope(entry),
169
- ...entry?.model !== void 0 && { model: entry.model },
170
- ...entry?.effort !== void 0 && { effort: entry.effort }
171
- };
172
- }
173
- function unwritableAssignmentsError(assignments) {
174
- return [
175
- "This configuration cannot be installed: a project-scoped skill never reaches a sub-agent that rests at global scope, so these assignments have nowhere to be written:",
176
- ...assignments.map(({ skillId, agent }) => ` ${skillId} -> ${agent}`),
177
- "Re-share it with each sub-agent above pinned to the project, or each skill above at global scope."
178
- ].join("\n");
179
- }
180
- function seedToWizardResult(payload, matrix) {
181
- const domainSelections = {};
182
- const assignedStack = {};
183
- const skills = [];
184
- const skippedSkillIds = [];
185
- const unwritable = [];
186
- const agentNames = /* @__PURE__ */ new Set();
187
- const agentMap = readAgentMap(payload.agents);
188
- const skippedAgentNames = new Set(agentMap.unknown);
189
- for (const [skillId, entry] of Object.entries(payload.skills)) {
190
- const skill = matrix.skills[skillId];
191
- const domain = skill?.category ? getCategoryDomain(skill.category) : void 0;
192
- if (!skill?.category || !domain) {
193
- skippedSkillIds.push(skillId);
194
- continue;
195
- }
196
- const id = skillId;
197
- const category = skill.category;
198
- addToDomainSelections(domainSelections, domain, category, id);
199
- skills.push({
200
- id,
201
- scope: entry.scope,
202
- // "eject" is a source in its own right; anything else names the marketplace it came from.
203
- source: entry.install === "eject" ? "eject" : sourceForSkill(skill)
204
- });
205
- for (const [agentName, load] of Object.entries(entry.assignments)) {
206
- if (agentMap.switchedOff.has(agentName)) continue;
207
- if (!KNOWN_AGENTS.has(agentName)) {
208
- skippedAgentNames.add(agentName);
209
- continue;
210
- }
211
- const agent = agentName;
212
- if (!isScopePairCompatible(entry.scope, seedAgentScope(agentMap.known.get(agent)))) {
213
- unwritable.push({ skillId: id, agent });
214
- continue;
215
- }
216
- agentNames.add(agent);
217
- addToAgentStack(assignedStack, agent, category, toSkillAssignment(id, load));
218
- }
219
- }
220
- if (unwritable.length > 0) throw new Error(unwritableAssignmentsError(unwritable));
221
- for (const [name, entry] of agentMap.known) {
222
- if (entry.on === true) agentNames.add(name);
223
- }
224
- const selectedAgents = [...agentNames];
225
- return {
226
- result: {
227
- skills,
228
- selectedAgents,
229
- agentConfigs: selectedAgents.map((name) => agentScopeConfig(name, agentMap.known.get(name))),
230
- assignedStack,
231
- selectedStackId: payload.stackId,
232
- domainSelections,
233
- selectedDomains: orderDomains(Object.keys(domainSelections)),
234
- // Nothing was dropped from a *saved config* — the skipped ids came off the wire and are
235
- // reported to the user directly, so there is no config removal to explain.
236
- unresolvableSkillIds: [],
237
- cancelled: false,
238
- // Revalidated here rather than taken on trust from the app that built the payload. That app
239
- // validated against ITS catalog; this one skips ids it does not know and carries its own
240
- // relationship rules, so a configuration that was consistent where it was authored can
241
- // arrive with a requirement genuinely unmet. Running the same validator the wizard runs
242
- // makes that this catalog's verdict on what it can install — reported through the spine
243
- // `init` already has, beside the skips that explain it — rather than a fault in what was
244
- // shared.
245
- validation: validateSelection(skills.map((skill) => skill.id))
246
- },
247
- skippedSkillIds,
248
- skippedAgentNames: [...skippedAgentNames]
249
- };
250
- }
251
-
252
95
  // src/cli/lib/permission-checker.tsx
253
96
  import "react";
254
97
  import "zod";
@@ -346,12 +189,12 @@ function formatDashboardText(data) {
346
189
  const lines = [
347
190
  DEFAULT_BRANDING.NAME,
348
191
  "",
349
- ` Skills: ${data.skillCount} installed`,
350
- ` Agents: ${data.agentCount} compiled`,
351
- ` Mode: ${modeLabel}`
192
+ ` Skills: ${data.skillCount} installed`,
193
+ ` Agents: ${data.agentCount} compiled`,
194
+ ` Mode: ${modeLabel}`
352
195
  ];
353
196
  if (data.source) {
354
- lines.push(` Source: ${data.source}`);
197
+ lines.push(` Marketplace: ${data.source}`);
355
198
  }
356
199
  lines.push("");
357
200
  lines.push(` [Edit] [Compile] [Doctor] [List]`);
@@ -387,6 +230,9 @@ async function runDashboardFlow(projectDir, config, origin, log) {
387
230
  function writesGlobalContent(result) {
388
231
  return result.skills.some((skill) => skill.scope === "global") || result.agentConfigs.some((agent) => agent.scope === "global");
389
232
  }
233
+ function sharedConfigSourceFlags(flags, payload) {
234
+ return { marketplace: flags.marketplace ?? payload.marketplace };
235
+ }
390
236
  var Init = class _Init extends BaseCommand {
391
237
  static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;
392
238
  static description = "Interactive wizard to set up skills and agents. Supports Plugin Mode (native install) and Eject Mode (copy to .claude/).";
@@ -397,13 +243,13 @@ var Init = class _Init extends BaseCommand {
397
243
  },
398
244
  {
399
245
  description: "Initialize from a custom marketplace",
400
- command: "<%= config.bin %> <%= command.id %> --source github:org/marketplace"
246
+ command: "<%= config.bin %> <%= command.id %> --marketplace github:org/marketplace"
401
247
  }
402
248
  ];
403
249
  static flags = {
404
- source: Flags.string({
405
- char: "s",
406
- description: "Skills source path or URL",
250
+ marketplace: Flags.string({
251
+ char: "m",
252
+ description: "Skills marketplace path or URL",
407
253
  required: false
408
254
  }),
409
255
  from: Flags.string({
@@ -430,44 +276,54 @@ var Init = class _Init extends BaseCommand {
430
276
  await this.handleInstallation(
431
277
  selection.result,
432
278
  selection.sourceResult,
433
- flags,
279
+ selection.sourceFlags,
434
280
  selection.interactive
435
281
  );
436
282
  }
437
283
  /** The interactive producer: load the source, run the wizard, return what was chosen. */
438
284
  async selectionFromWizard(flags, projectDir) {
439
285
  const isGlobalRoot = isHomeDirectory(projectDir);
440
- const { unmount, clear: clearSpinner } = render(
441
- /* @__PURE__ */ jsx2(Spinner, { label: STATUS_MESSAGES.LOADING_SKILLS })
442
- );
443
- const [{ sourceResult, startupMessages }, globalConfig] = await Promise.all([
444
- this.loadSourceOrFail(flags),
445
- this.loadGlobalConfigIfExists()
446
- ]);
447
- clearSpinner();
448
- unmount();
449
- const result = await this.runWizard(
450
- sourceResult,
451
- startupMessages,
452
- projectDir,
453
- globalConfig,
454
- isGlobalRoot
455
- );
286
+ const { sourceResult, startupMessages } = await this.loadWizardInputsUnderSpinner(flags);
287
+ const result = await this.runWizard(startupMessages, isGlobalRoot);
456
288
  if (!result) return null;
457
289
  return {
458
290
  result,
459
291
  sourceResult,
292
+ sourceFlags: flags,
460
293
  // A person is already at the terminal, so the permission notice can wait for them.
461
294
  interactive: true,
462
295
  emptyMessage: "No skills selected"
463
296
  };
464
297
  }
298
+ /**
299
+ * Everything the wizard needs, loaded behind a spinner that comes down whichever way the
300
+ * await ends.
301
+ *
302
+ * The cleanup is a `finally` because a source that cannot be loaded refuses the run from
303
+ * inside this await, and oclif would otherwise paint its error under an Ink tree still
304
+ * repainting over it. Never a `catch`: the throw reaches oclif untouched, or both the
305
+ * error rendering and the exit code change with it.
306
+ */
307
+ async loadWizardInputsUnderSpinner(flags) {
308
+ const { unmount, clear: clearSpinner } = render(
309
+ /* @__PURE__ */ jsx2(Spinner, { label: STATUS_MESSAGES.LOADING_SKILLS })
310
+ );
311
+ try {
312
+ return await this.loadSourceOrFail(flags);
313
+ } finally {
314
+ clearSpinner();
315
+ unmount();
316
+ }
317
+ }
465
318
  /**
466
319
  * The `--from <id>` producer: fetch and map, no wizard. Nothing here may assume a TTY — running
467
320
  * headless is most of why the flag exists.
468
321
  *
469
- * It is also greenfield-only, which is what the two refusals are: a shared configuration is
470
- * installed whole, so anything it would have to install over has to be uninstalled first.
322
+ * It is also greenfield-only, which is what two of the three refusals are: a shared
323
+ * configuration is installed whole, so anything it would have to install over has to be
324
+ * uninstalled first. The third is about the LOCATION rather than what is already in it — a
325
+ * global installation holds only global-scoped content, and this is the one producer that never
326
+ * asked. All three fire before anything is written.
471
327
  */
472
328
  async selectionFromSharedConfig(id, flags, projectDir) {
473
329
  await this.refuseInstalledProject(projectDir);
@@ -476,22 +332,22 @@ var Init = class _Init extends BaseCommand {
476
332
  if (!fetched.ok) {
477
333
  this.error(fetched.error, { exit: EXIT_CODES.ERROR });
478
334
  }
479
- const { sourceResult } = await this.loadSourceOrFail(flags);
335
+ const sourceFlags = sharedConfigSourceFlags(flags, fetched.payload);
336
+ const { sourceResult } = await this.loadSourceOrFail(sourceFlags);
337
+ const carriedSkills = this.registerExternalSkillsOrFail(
338
+ fetched.payload,
339
+ sourceResult.matrix,
340
+ projectDir
341
+ );
480
342
  const { result, skippedSkillIds, skippedAgentNames } = this.decodeSeedOrFail(
481
343
  fetched.payload,
482
344
  sourceResult.matrix
483
345
  );
346
+ this.refuseProjectScopedContentAtHome(result, projectDir);
484
347
  await this.refuseBlockingGlobalInstall(result);
485
- if (skippedSkillIds.length > 0) {
486
- this.warn(
487
- `Skipped ${skippedSkillIds.length} skill(s) this catalog does not know: ${skippedSkillIds.join(", ")}`
488
- );
489
- }
490
- if (skippedAgentNames.length > 0) {
491
- this.warn(
492
- `Skipped ${skippedAgentNames.length} unknown sub-agent(s): ${skippedAgentNames.join(", ")}`
493
- );
494
- }
348
+ await this.writeCarriedSkills(carriedSkills);
349
+ if (skippedSkillIds.length > 0) this.warn(skippedUnknownSkills(skippedSkillIds));
350
+ if (skippedAgentNames.length > 0) this.warn(skippedUnknownAgents(skippedAgentNames));
495
351
  if (result.skills.length > 0) {
496
352
  this.log(
497
353
  `Installing ${result.skills.length} skill(s) across ${result.selectedAgents.length} sub-agent(s)
@@ -501,6 +357,7 @@ var Init = class _Init extends BaseCommand {
501
357
  return {
502
358
  result,
503
359
  sourceResult,
360
+ sourceFlags,
504
361
  interactive: false,
505
362
  emptyMessage: `Configuration '${id}' contains no skills this catalog can install.`
506
363
  };
@@ -546,21 +403,35 @@ var Init = class _Init extends BaseCommand {
546
403
  this.handleError(error);
547
404
  }
548
405
  }
406
+ /**
407
+ * Seats the catalogue entries the payload carries with it, or refuses the run.
408
+ *
409
+ * The refusal is `registerExternalSkills`' own — a carried skill asked for as a plugin, which
410
+ * no marketplace serves — and is reported with this command's exit code for the same reason the
411
+ * decode's is.
412
+ */
413
+ registerExternalSkillsOrFail(payload, matrix, projectDir) {
414
+ try {
415
+ return registerExternalSkills(payload, matrix, projectDir);
416
+ } catch (error) {
417
+ this.handleError(error);
418
+ }
419
+ }
420
+ /** Writes the skills the payload brought with it, and says which they were. */
421
+ async writeCarriedSkills(carried) {
422
+ if (carried.length === 0) return;
423
+ await writeExternalSkills(carried);
424
+ this.log(carriedSkillsWritten(carried.map((skill) => skill.id)));
425
+ }
549
426
  async showDashboardIfInitialized(projectDir) {
550
427
  return runDashboardFlow(projectDir, this.config, "init", (msg) => this.log(msg));
551
428
  }
552
- async loadGlobalConfigIfExists() {
553
- const globalInstall = await detectGlobalInstallation();
554
- if (!globalInstall) return null;
555
- const loaded = await loadProjectConfigFromDir(os.homedir());
556
- return loaded?.config ?? null;
557
- }
558
429
  async loadSourceOrFail(flags) {
559
430
  try {
560
431
  const loaded = await loadSource({
561
- // The one load that may CHOOSE a source rather than read the stored one.
432
+ // The one load that may CHOOSE a marketplace rather than read the stored one.
562
433
  caller: "init",
563
- ...flags.source !== void 0 && { sourceFlag: flags.source },
434
+ ...flags.marketplace !== void 0 && { sourceFlag: flags.marketplace },
564
435
  projectDir: process.cwd(),
565
436
  captureStartupMessages: true
566
437
  });
@@ -571,24 +442,19 @@ var Init = class _Init extends BaseCommand {
571
442
  });
572
443
  }
573
444
  }
574
- async runWizard(sourceResult, startupMessages, projectDir, globalConfig, isGlobalRoot) {
575
- const selectedAgents = globalConfig?.agents && activeAgentNames(globalConfig.agents);
576
- const globalSkills = globalConfig?.skills;
445
+ /**
446
+ * `init`'s wizard opens on an empty selection, and can open on nothing else: it is reached
447
+ * only once {@link showDashboardIfInitialized} has found no installation, and that check
448
+ * falls back to the home directory — so a global roster to hydrate from would have diverted
449
+ * this run to the dashboard before the wizard was built. Hydrating a saved selection is
450
+ * `edit`'s job, and `Edit.runEditWizard` is where it happens.
451
+ */
452
+ async runWizard(startupMessages, isGlobalRoot) {
577
453
  return runWizardSession({
578
- hydrate: {
579
- ...selectedAgents !== void 0 && { initialAgents: selectedAgents },
580
- ...globalSkills !== void 0 && {
581
- installedSkillIds: globalSkills.map((s) => s.id),
582
- installedSkillConfigs: globalSkills
583
- },
584
- ...globalConfig?.agents !== void 0 && { installedAgentConfigs: globalConfig.agents },
585
- isEditingFromGlobalScope: isGlobalRoot
586
- },
454
+ hydrate: { isEditingFromGlobalScope: isGlobalRoot },
587
455
  props: {
588
456
  version: this.config.version,
589
457
  logo: ASCII_LOGO,
590
- initialAgents: selectedAgents,
591
- installedSkillIds: globalConfig?.skills.map((s) => s.id),
592
458
  startupMessages
593
459
  },
594
460
  onCancel: () => this.log("Setup cancelled"),
@@ -599,8 +465,8 @@ var Init = class _Init extends BaseCommand {
599
465
  const projectDir = process.cwd();
600
466
  const activeSkills = result.skills.filter((s) => !s.excluded);
601
467
  const installMode = deriveInstallMode(activeSkills);
602
- const ejectedSkills = activeSkills.filter((s) => s.source === EJECT_SOURCE);
603
- const pluginSkills = activeSkills.filter((s) => s.source !== EJECT_SOURCE);
468
+ const ejectedSkills = activeSkills.filter((s) => s.origin === EJECT_SOURCE);
469
+ const pluginSkills = activeSkills.filter((s) => s.origin !== EJECT_SOURCE);
604
470
  this.logInstallPlan(installMode, ejectedSkills, pluginSkills);
605
471
  const resolvedMarketplace = pluginSkills.length > 0 ? await this.requireMarketplaceOrExit(
606
472
  sourceResult,
@@ -609,7 +475,12 @@ var Init = class _Init extends BaseCommand {
609
475
  ) : null;
610
476
  const copyResult = installMode === "eject" || installMode === "mixed" ? await this.copyEjectSkillsStep(ejectedSkills, projectDir, sourceResult, installMode) : null;
611
477
  if (resolvedMarketplace !== null) {
612
- await this.installPluginSkillsReported(pluginSkills, resolvedMarketplace, projectDir);
478
+ await this.installPluginSkillsReported(
479
+ pluginSkills,
480
+ resolvedMarketplace,
481
+ projectDir,
482
+ sourceResult.matrix
483
+ );
613
484
  }
614
485
  const pluginModeSucceeded = resolvedMarketplace !== null;
615
486
  try {
@@ -681,13 +552,14 @@ var Init = class _Init extends BaseCommand {
681
552
  wizardResult: result,
682
553
  sourceResult,
683
554
  projectDir: process.cwd(),
684
- ...flags.source !== void 0 && { sourceFlag: flags.source }
555
+ ...flags.marketplace !== void 0 && { sourceFlag: flags.marketplace }
685
556
  });
686
557
  if (configResult.wasMerged) {
687
558
  this.log(`Merged with existing config at ${configResult.existingConfigPath}`);
688
559
  }
689
560
  this.log(`Configuration saved (${configResult.config.agents.length} agents)
690
561
  `);
562
+ this.reportUnassignedSkills(configResult.config);
691
563
  this.log(STATUS_MESSAGES.COMPILING_AGENTS);
692
564
  const cwd = process.cwd();
693
565
  const agentDefs = await loadAgentDefs();
@@ -712,12 +584,36 @@ var Init = class _Init extends BaseCommand {
712
584
  this.reportSkillsCopied(copyResult);
713
585
  }
714
586
  this.reportAgentsCompiled(compileResult.compiled, agentScopeMap);
587
+ this.reportConfiguration(configResult.configPath, agentScopeMap);
588
+ }
589
+ /**
590
+ * Names the config that actually holds this install's assignments, and where a
591
+ * recompile of them has to be run from.
592
+ *
593
+ * Split by the same `agentScopeMap` the two reporters above split on, because the
594
+ * same scope decides both. A project config's `stack` is filtered down to
595
+ * project-scoped agents on the way out, so a wholly GLOBAL install leaves it
596
+ * carrying no assignment at all — naming it sends the user to a file with nothing
597
+ * in it — and `compile` in this cwd runs the PROJECT pass, which recompiles no
598
+ * global agent. At the home root both scopes resolve to one file and one pass, so
599
+ * there is nothing to split and the project wording stands.
600
+ */
601
+ reportConfiguration(projectConfigPath, agentScopeMap) {
602
+ const cwd = process.cwd();
603
+ const paths = {
604
+ global: resolveInstallPaths(cwd, "global").configPath,
605
+ project: projectConfigPath
606
+ };
607
+ const split = splitAgentScopes(cwd, agentScopeMap);
715
608
  this.log("Configuration:");
716
- this.log(` ${configResult.configPath}`);
609
+ for (const configPath of configsHoldingAssignments(split, paths)) {
610
+ this.log(` ${configPath}`);
611
+ }
717
612
  this.log("");
718
613
  this.log("To customize agent-skill assignments:");
719
- this.log(` 1. Edit ${CLAUDE_SRC_DIR}/${STANDARD_FILES.CONFIG_TS}`);
720
- this.log(` 2. Run '${CLI_INVOKE_COMMAND} compile' to regenerate agents`);
614
+ for (const [index, step] of customizationSteps(split, paths.global).entries()) {
615
+ this.log(` ${index + 1}. ${step}`);
616
+ }
721
617
  this.log("");
722
618
  }
723
619
  /**
@@ -778,13 +674,37 @@ var Init = class _Init extends BaseCommand {
778
674
  }
779
675
  }
780
676
  };
677
+ function splitAgentScopes(cwd, agentScopeMap) {
678
+ if (isHomeDirectory(cwd)) return { globalAgentCount: 0, isGlobalOnly: false };
679
+ const scopes = [...agentScopeMap.values()];
680
+ const globalAgentCount = scopes.filter((scope) => scope === "global").length;
681
+ return {
682
+ globalAgentCount,
683
+ isGlobalOnly: globalAgentCount > 0 && globalAgentCount === scopes.length
684
+ };
685
+ }
686
+ function configsHoldingAssignments(split, paths) {
687
+ if (split.isGlobalOnly) return [paths.global];
688
+ if (split.globalAgentCount > 0) return [paths.global, paths.project];
689
+ return [paths.project];
690
+ }
691
+ function customizationSteps(split, globalConfigPath) {
692
+ if (split.isGlobalOnly) {
693
+ return [`Edit ${globalConfigPath}`, globalScopedAgentsHint(split.globalAgentCount)];
694
+ }
695
+ return [
696
+ `Edit ${CLAUDE_SRC_DIR}/${STANDARD_FILES.CONFIG_TS}`,
697
+ `Run '${CLI_INVOKE_COMMAND} compile' to regenerate agents`,
698
+ ...split.globalAgentCount > 0 ? [globalScopedAgentsHint(split.globalAgentCount)] : []
699
+ ];
700
+ }
781
701
  async function getDashboardData(projectDir) {
782
702
  const [info, loaded] = await Promise.all([getInstallationInfo(), loadProjectConfig(projectDir)]);
783
703
  const activeSkills = loaded?.config.skills.filter((s) => !s.excluded);
784
704
  const skillCount = info?.skillCount ?? 0;
785
705
  const agentCount = info?.agentCount ?? 0;
786
706
  const mode = info?.mode ?? (activeSkills ? deriveInstallMode(activeSkills) : "eject");
787
- const source = loaded?.config.source;
707
+ const source = loaded?.config.marketplace;
788
708
  return { skillCount, agentCount, mode, ...source !== void 0 && { source } };
789
709
  }
790
710
 
@@ -795,4 +715,4 @@ export {
795
715
  Init,
796
716
  getDashboardData
797
717
  };
798
- //# sourceMappingURL=chunk-ORJ5Y222.js.map
718
+ //# sourceMappingURL=chunk-H6UTKTLK.js.map