agents-inc 0.154.0 → 0.156.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 (213) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/chunk-2H7UWE2G.js +246 -0
  3. package/dist/chunk-2H7UWE2G.js.map +1 -0
  4. package/dist/{chunk-LA3JPESW.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-BZ4CZBOM.js → chunk-5F2YR5XV.js} +3 -3
  8. package/dist/{chunk-CHNA5RVS.js → chunk-5OKLCVM4.js} +3 -3
  9. package/dist/{chunk-ZU6DAR4S.js → chunk-5QZAK6J7.js} +7 -7
  10. package/dist/{chunk-ZU6DAR4S.js.map → chunk-5QZAK6J7.js.map} +1 -1
  11. package/dist/{chunk-NFH6SA62.js → chunk-6RLV45HN.js} +10 -10
  12. package/dist/{chunk-NFH6SA62.js.map → chunk-6RLV45HN.js.map} +1 -1
  13. package/dist/{chunk-GUDGCFSF.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-UW44KSYL.js → chunk-F2AMBBIA.js} +6 -6
  18. package/dist/{chunk-UW44KSYL.js.map → chunk-F2AMBBIA.js.map} +1 -1
  19. package/dist/{chunk-QQTYMW7N.js → chunk-F5T6TV4Z.js} +206 -73
  20. package/dist/chunk-F5T6TV4Z.js.map +1 -0
  21. package/dist/{chunk-K3O3YQYG.js → chunk-G47TDUK3.js} +2 -2
  22. package/dist/{chunk-AURY6RT6.js → chunk-GS2NZ3GD.js} +8 -8
  23. package/dist/chunk-GS2NZ3GD.js.map +1 -0
  24. package/dist/{chunk-5MFJ24VM.js → chunk-H6UTKTLK.js} +104 -250
  25. package/dist/chunk-H6UTKTLK.js.map +1 -0
  26. package/dist/{chunk-MJFIO5SX.js → chunk-HG4JPXJT.js} +11 -11
  27. package/dist/chunk-HG4JPXJT.js.map +1 -0
  28. package/dist/{chunk-IXEDSKMH.js → chunk-HTYH7CKN.js} +3 -3
  29. package/dist/{chunk-JC7DBPRD.js → chunk-HXKOIWLU.js} +2 -2
  30. package/dist/chunk-HXKOIWLU.js.map +1 -0
  31. package/dist/{chunk-NSJ2S7R5.js → chunk-ILUVL7WM.js} +2 -2
  32. package/dist/{chunk-R54KIGN2.js → chunk-IO5YBKHV.js} +13 -2
  33. package/dist/chunk-IO5YBKHV.js.map +1 -0
  34. package/dist/chunk-IXRZAHZF.js +53 -0
  35. package/dist/chunk-IXRZAHZF.js.map +1 -0
  36. package/dist/chunk-JCPANDNR.js +35 -0
  37. package/dist/chunk-JCPANDNR.js.map +1 -0
  38. package/dist/{chunk-NKCY2ULI.js → chunk-LJCNUP6M.js} +2 -2
  39. package/dist/{chunk-PRJD5MMQ.js → chunk-MHRC3KRX.js} +5 -5
  40. package/dist/chunk-MHRC3KRX.js.map +1 -0
  41. package/dist/chunk-MO5FGLVS.js +142 -0
  42. package/dist/chunk-MO5FGLVS.js.map +1 -0
  43. package/dist/{chunk-Q5FLW4JG.js → chunk-OKH64JZE.js} +2 -2
  44. package/dist/{chunk-WRRP47PY.js → chunk-PCC4LBKB.js} +2 -2
  45. package/dist/chunk-PMUABBPG.js +258 -0
  46. package/dist/chunk-PMUABBPG.js.map +1 -0
  47. package/dist/{chunk-2IMYK4WN.js → chunk-PNMM5HNX.js} +5 -5
  48. package/dist/{chunk-AKQ5QISO.js → chunk-QWVXOCXO.js} +6 -6
  49. package/dist/{chunk-IPJOMAWC.js → chunk-RWOYPOMR.js} +12 -2
  50. package/dist/{chunk-IPJOMAWC.js.map → chunk-RWOYPOMR.js.map} +1 -1
  51. package/dist/{chunk-ONWEOS77.js → chunk-SY4X2LND.js} +4 -4
  52. package/dist/{chunk-XGMOXMS4.js → chunk-TBOVYLQJ.js} +2 -2
  53. package/dist/{chunk-R7JV22QK.js → chunk-TNGMF4UX.js} +20 -20
  54. package/dist/{chunk-R7JV22QK.js.map → chunk-TNGMF4UX.js.map} +1 -1
  55. package/dist/{chunk-7VZV4O6B.js → chunk-UMH2YZKG.js} +14 -5
  56. package/dist/chunk-UMH2YZKG.js.map +1 -0
  57. package/dist/{chunk-6CNRMCFM.js → chunk-VPASBA7P.js} +2 -2
  58. package/dist/{chunk-CBF4ZYV3.js → chunk-WCAUUBHO.js} +1376 -741
  59. package/dist/chunk-WCAUUBHO.js.map +1 -0
  60. package/dist/{chunk-V3ENMW7G.js → chunk-WFRTHH3A.js} +3 -3
  61. package/dist/{chunk-DRKSYJZ2.js → chunk-WTJ3AY33.js} +1 -1
  62. package/dist/{chunk-DRKSYJZ2.js.map → chunk-WTJ3AY33.js.map} +1 -1
  63. package/dist/{chunk-XMEIVWAS.js → chunk-WUQ3MTPF.js} +11 -5
  64. package/dist/{chunk-XMEIVWAS.js.map → chunk-WUQ3MTPF.js.map} +1 -1
  65. package/dist/{chunk-4VCWL2IG.js → chunk-XAXJWXI4.js} +92 -59
  66. package/dist/chunk-XAXJWXI4.js.map +1 -0
  67. package/dist/{chunk-B66SC72V.js → chunk-Y5Y7XHVU.js} +4 -4
  68. package/dist/{chunk-FMYHWKGG.js → chunk-YO2LTXB4.js} +66 -16
  69. package/dist/chunk-YO2LTXB4.js.map +1 -0
  70. package/dist/{chunk-TUQF577Z.js → chunk-ZUAZHDKP.js} +40 -41
  71. package/dist/chunk-ZUAZHDKP.js.map +1 -0
  72. package/dist/commands/build/marketplace.js +98 -121
  73. package/dist/commands/build/marketplace.js.map +1 -1
  74. package/dist/commands/build/plugins.js +8 -8
  75. package/dist/commands/compile.js +19 -24
  76. package/dist/commands/compile.js.map +1 -1
  77. package/dist/commands/doctor.js +220 -79
  78. package/dist/commands/doctor.js.map +1 -1
  79. package/dist/commands/edit.js +549 -75
  80. package/dist/commands/edit.js.map +1 -1
  81. package/dist/commands/eject.js +26 -21
  82. package/dist/commands/eject.js.map +1 -1
  83. package/dist/commands/init.js +41 -39
  84. package/dist/commands/list.js +11 -11
  85. package/dist/commands/list.js.map +1 -1
  86. package/dist/commands/new/marketplace.js +243 -0
  87. package/dist/commands/new/marketplace.js.map +1 -0
  88. package/dist/commands/search.js +16 -14
  89. package/dist/commands/search.js.map +1 -1
  90. package/dist/commands/share.js +67 -0
  91. package/dist/commands/share.js.map +1 -0
  92. package/dist/commands/uninstall.js +61 -74
  93. package/dist/commands/uninstall.js.map +1 -1
  94. package/dist/commands/update.js +9 -9
  95. package/dist/commands/update.js.map +1 -1
  96. package/dist/components/common/prompt-confirm.js +1 -1
  97. package/dist/components/common/removal-plan-confirm.js +10 -0
  98. package/dist/components/common/select-list.js +2 -2
  99. package/dist/components/wizard/category-grid.js +5 -5
  100. package/dist/components/wizard/checkbox-grid.js +5 -5
  101. package/dist/components/wizard/domain-selection.js +11 -11
  102. package/dist/components/wizard/run-wizard-session.js +29 -28
  103. package/dist/components/wizard/scroll-affordance.js +2 -2
  104. package/dist/components/wizard/skill-agent-summary.js +6 -6
  105. package/dist/components/wizard/source-grid.js +6 -6
  106. package/dist/components/wizard/stack-selection.js +8 -8
  107. package/dist/components/wizard/step-agents.js +10 -11
  108. package/dist/components/wizard/step-build.js +9 -9
  109. package/dist/components/wizard/step-confirm.js +10 -10
  110. package/dist/components/wizard/step-sources.js +10 -10
  111. package/dist/components/wizard/step-stack.js +9 -9
  112. package/dist/components/wizard/summary-panel.js +9 -9
  113. package/dist/components/wizard/toast.js +2 -2
  114. package/dist/components/wizard/wizard-layout.js +14 -14
  115. package/dist/components/wizard/wizard-tabs.js +2 -2
  116. package/dist/components/wizard/wizard.js +27 -27
  117. package/dist/copy-local-skills-NSUTBVLJ.js +14 -0
  118. package/dist/hooks/init.js +42 -62
  119. package/dist/hooks/init.js.map +1 -1
  120. package/dist/load-agent-defs-X4E57I2U.js +15 -0
  121. package/dist/{loader-JIZDTR4G.js → loader-G6BFG2VA.js} +3 -3
  122. package/dist/recompile-project-agents-JE4MM72I.js +20 -0
  123. package/dist/{source-loader-OE6EJFPU.js → source-loader-3DL3NYUX.js} +7 -5
  124. package/dist/source-loader-3DL3NYUX.js.map +1 -0
  125. package/dist/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  126. package/dist/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  127. package/dist/src/agents/developer/ai-developer/identity.md +1 -1
  128. package/dist/src/agents/developer/ai-developer/playbook.md +1 -1
  129. package/dist/src/agents/developer/api-developer/identity.md +1 -1
  130. package/dist/src/agents/developer/cli-developer/identity.md +1 -1
  131. package/dist/src/agents/developer/web-developer/identity.md +1 -1
  132. package/dist/src/agents/meta/codex-keeper/identity.md +1 -1
  133. package/dist/src/agents/meta/convention-keeper/identity.md +1 -1
  134. package/dist/src/agents/meta/skill-summoner/identity.md +1 -1
  135. package/dist/src/agents/researcher/ai-researcher/identity.md +1 -1
  136. package/dist/src/agents/researcher/api-researcher/identity.md +1 -1
  137. package/dist/src/agents/researcher/cli-researcher/identity.md +1 -1
  138. package/dist/src/agents/researcher/web-researcher/identity.md +1 -1
  139. package/dist/src/agents/reviewer/reviewer/playbook.md +1 -1
  140. package/dist/src/agents/tester/ai-tester/identity.md +1 -1
  141. package/dist/src/agents/tester/api-tester/critical-reminders.md +1 -1
  142. package/dist/src/agents/tester/api-tester/critical-requirements.md +1 -1
  143. package/dist/src/agents/tester/api-tester/identity.md +2 -2
  144. package/dist/src/agents/tester/cli-tester/identity.md +1 -1
  145. package/dist/src/agents/tester/web-tester/identity.md +3 -3
  146. package/dist/stores/wizard-store.js +7 -5
  147. package/package.json +10 -7
  148. package/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  149. package/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  150. package/src/agents/developer/ai-developer/identity.md +1 -1
  151. package/src/agents/developer/ai-developer/playbook.md +1 -1
  152. package/src/agents/developer/api-developer/identity.md +1 -1
  153. package/src/agents/developer/cli-developer/identity.md +1 -1
  154. package/src/agents/developer/web-developer/identity.md +1 -1
  155. package/src/agents/meta/codex-keeper/identity.md +1 -1
  156. package/src/agents/meta/convention-keeper/identity.md +1 -1
  157. package/src/agents/meta/skill-summoner/identity.md +1 -1
  158. package/src/agents/researcher/ai-researcher/identity.md +1 -1
  159. package/src/agents/researcher/api-researcher/identity.md +1 -1
  160. package/src/agents/researcher/cli-researcher/identity.md +1 -1
  161. package/src/agents/researcher/web-researcher/identity.md +1 -1
  162. package/src/agents/reviewer/reviewer/playbook.md +1 -1
  163. package/src/agents/tester/ai-tester/identity.md +1 -1
  164. package/src/agents/tester/api-tester/critical-reminders.md +1 -1
  165. package/src/agents/tester/api-tester/critical-requirements.md +1 -1
  166. package/src/agents/tester/api-tester/identity.md +2 -2
  167. package/src/agents/tester/cli-tester/identity.md +1 -1
  168. package/src/agents/tester/web-tester/identity.md +3 -3
  169. package/src/schemas/custom-metadata.schema.json +3 -0
  170. package/src/schemas/metadata.schema.json +3 -0
  171. package/src/schemas/project-config.schema.json +4 -8
  172. package/src/schemas/project-source-config.schema.json +2 -2
  173. package/dist/chunk-4VCWL2IG.js.map +0 -1
  174. package/dist/chunk-5MFJ24VM.js.map +0 -1
  175. package/dist/chunk-7VZV4O6B.js.map +0 -1
  176. package/dist/chunk-AURY6RT6.js.map +0 -1
  177. package/dist/chunk-CBF4ZYV3.js.map +0 -1
  178. package/dist/chunk-FMYHWKGG.js.map +0 -1
  179. package/dist/chunk-GUDGCFSF.js.map +0 -1
  180. package/dist/chunk-JC7DBPRD.js.map +0 -1
  181. package/dist/chunk-MJFIO5SX.js.map +0 -1
  182. package/dist/chunk-OJJLYHM3.js +0 -34
  183. package/dist/chunk-OJJLYHM3.js.map +0 -1
  184. package/dist/chunk-PRJD5MMQ.js.map +0 -1
  185. package/dist/chunk-QQTYMW7N.js.map +0 -1
  186. package/dist/chunk-QUDQTO3O.js +0 -41
  187. package/dist/chunk-QUDQTO3O.js.map +0 -1
  188. package/dist/chunk-R54KIGN2.js.map +0 -1
  189. package/dist/chunk-TUQF577Z.js.map +0 -1
  190. package/dist/copy-local-skills-WVHJFRPK.js +0 -14
  191. package/dist/load-agent-defs-5OT54J5M.js +0 -15
  192. package/dist/recompile-project-agents-VREEPBDV.js +0 -20
  193. /package/dist/{chunk-LA3JPESW.js.map → chunk-4A4L3YIW.js.map} +0 -0
  194. /package/dist/{chunk-BZ4CZBOM.js.map → chunk-5F2YR5XV.js.map} +0 -0
  195. /package/dist/{chunk-CHNA5RVS.js.map → chunk-5OKLCVM4.js.map} +0 -0
  196. /package/dist/{chunk-K3O3YQYG.js.map → chunk-G47TDUK3.js.map} +0 -0
  197. /package/dist/{chunk-IXEDSKMH.js.map → chunk-HTYH7CKN.js.map} +0 -0
  198. /package/dist/{chunk-NSJ2S7R5.js.map → chunk-ILUVL7WM.js.map} +0 -0
  199. /package/dist/{chunk-NKCY2ULI.js.map → chunk-LJCNUP6M.js.map} +0 -0
  200. /package/dist/{chunk-Q5FLW4JG.js.map → chunk-OKH64JZE.js.map} +0 -0
  201. /package/dist/{chunk-WRRP47PY.js.map → chunk-PCC4LBKB.js.map} +0 -0
  202. /package/dist/{chunk-2IMYK4WN.js.map → chunk-PNMM5HNX.js.map} +0 -0
  203. /package/dist/{chunk-AKQ5QISO.js.map → chunk-QWVXOCXO.js.map} +0 -0
  204. /package/dist/{chunk-ONWEOS77.js.map → chunk-SY4X2LND.js.map} +0 -0
  205. /package/dist/{chunk-XGMOXMS4.js.map → chunk-TBOVYLQJ.js.map} +0 -0
  206. /package/dist/{chunk-6CNRMCFM.js.map → chunk-VPASBA7P.js.map} +0 -0
  207. /package/dist/{chunk-V3ENMW7G.js.map → chunk-WFRTHH3A.js.map} +0 -0
  208. /package/dist/{chunk-B66SC72V.js.map → chunk-Y5Y7XHVU.js.map} +0 -0
  209. /package/dist/{copy-local-skills-WVHJFRPK.js.map → components/common/removal-plan-confirm.js.map} +0 -0
  210. /package/dist/{load-agent-defs-5OT54J5M.js.map → copy-local-skills-NSUTBVLJ.js.map} +0 -0
  211. /package/dist/{loader-JIZDTR4G.js.map → load-agent-defs-X4E57I2U.js.map} +0 -0
  212. /package/dist/{recompile-project-agents-VREEPBDV.js.map → loader-G6BFG2VA.js.map} +0 -0
  213. /package/dist/{source-loader-OE6EJFPU.js.map → recompile-project-agents-JE4MM72I.js.map} +0 -0
@@ -1,54 +1,58 @@
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-QUDQTO3O.js";
18
+ fetchSeedConfig,
19
+ registerExternalSkills,
20
+ writeExternalSkills
21
+ } from "./chunk-PMUABBPG.js";
14
22
  import {
15
- useTerminalDimensions
16
- } from "./chunk-MJFIO5SX.js";
23
+ promptValue
24
+ } from "./chunk-JCPANDNR.js";
17
25
  import {
18
26
  compileAgentsAllScopes,
19
27
  loadSource,
20
28
  writeProjectConfig
21
- } from "./chunk-XMEIVWAS.js";
29
+ } from "./chunk-WUQ3MTPF.js";
22
30
  import {
23
31
  discoverInstalledSkills
24
- } from "./chunk-ZU6DAR4S.js";
25
- import {
26
- copyLocalSkills
27
- } from "./chunk-UW44KSYL.js";
32
+ } from "./chunk-5QZAK6J7.js";
28
33
  import {
29
34
  loadAgentDefs
30
- } from "./chunk-PRJD5MMQ.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-QQTYMW7N.js";
37
42
  import {
38
43
  BaseCommand,
39
44
  EXIT_CODES
40
- } from "./chunk-FMYHWKGG.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,
@@ -56,26 +60,20 @@ import {
56
60
  getInstallationInfo,
57
61
  globalScopedAgentsHint,
58
62
  isHomeDirectory,
59
- isScopePairCompatible,
60
63
  loadProjectConfig,
61
- loadProjectConfigFromDir,
62
64
  resolveInstallPaths,
63
- seedPayloadSchema,
64
65
  sharedConfigExistingInstall,
65
66
  sharedConfigGlobalInstall,
66
- validateSelection
67
- } from "./chunk-CBF4ZYV3.js";
67
+ skippedUnknownAgents,
68
+ skippedUnknownSkills
69
+ } from "./chunk-WCAUUBHO.js";
68
70
  import {
69
- AGENT_NAMES,
70
71
  fileExists,
71
72
  getErrorMessage,
72
73
  readFileSafe,
73
74
  settingsFileSchema,
74
75
  warn
75
- } from "./chunk-4VCWL2IG.js";
76
- import {
77
- getCategoryDomain
78
- } from "./chunk-IPJOMAWC.js";
76
+ } from "./chunk-XAXJWXI4.js";
79
77
  import {
80
78
  ASCII_LOGO,
81
79
  CLAUDE_DIR,
@@ -83,173 +81,17 @@ import {
83
81
  CLI_COLORS,
84
82
  CLI_INVOKE_COMMAND,
85
83
  DEFAULT_BRANDING,
86
- DEFAULT_PUBLIC_SOURCE_NAME,
87
84
  EDIT_PROJECT_SETUP_FLAG,
88
85
  EJECT_SOURCE,
89
86
  MAX_CONFIG_FILE_SIZE,
90
87
  STANDARD_FILES
91
- } from "./chunk-R54KIGN2.js";
88
+ } from "./chunk-IO5YBKHV.js";
92
89
 
93
90
  // src/cli/commands/init.tsx
94
- import os from "os";
95
91
  import "react";
96
92
  import { Flags } from "@oclif/core";
97
93
  import { Box as Box2, Text as Text2, useApp } from "ink";
98
94
 
99
- // src/cli/lib/seed/fetch-seed.ts
100
- var SEED_API_URL = process.env.AGENTS_INC_API_URL ?? "https://api.agentsinc.sh";
101
- var SEED_USER_AGENT = "agents-inc-cli";
102
- async function fetchSeedConfig(id) {
103
- const url = `${SEED_API_URL}/configs/${encodeURIComponent(id)}`;
104
- let response;
105
- try {
106
- response = await fetch(url, {
107
- headers: { accept: "application/json", "user-agent": SEED_USER_AGENT }
108
- });
109
- } catch {
110
- return { ok: false, error: `Could not reach ${SEED_API_URL} \u2014 check your connection.` };
111
- }
112
- if (response.status === 404) {
113
- return { ok: false, error: `No configuration found for id '${id}'.` };
114
- }
115
- if (!response.ok) {
116
- return { ok: false, error: `Fetching configuration failed (HTTP ${response.status}).` };
117
- }
118
- let body;
119
- try {
120
- body = await response.json();
121
- } catch {
122
- return { ok: false, error: "The configuration store returned something that is not JSON." };
123
- }
124
- const parsed = seedPayloadSchema.safeParse(body);
125
- if (!parsed.success) {
126
- return {
127
- ok: false,
128
- error: `Configuration '${id}' does not match the expected format \u2014 it may have been created by a newer version.`
129
- };
130
- }
131
- return { ok: true, payload: parsed.data };
132
- }
133
-
134
- // src/cli/lib/seed/seed-to-wizard.ts
135
- var KNOWN_AGENTS = new Set(AGENT_NAMES);
136
- function sourceForSkill(skill) {
137
- return skill?.availableSources?.find((s) => s.primary)?.name ?? DEFAULT_PUBLIC_SOURCE_NAME;
138
- }
139
- function addToDomainSelections(selections, domain, category, skillId) {
140
- const categorySelections = selections[domain] ??= {};
141
- const skillList = categorySelections[category] ??= [];
142
- if (!skillList.includes(skillId)) skillList.push(skillId);
143
- }
144
- function addToAgentStack(stack, agent, category, assignment) {
145
- const agentStack = stack[agent] ??= {};
146
- const assignments = agentStack[category] ??= [];
147
- assignments.push(assignment);
148
- }
149
- function toSkillAssignment(skillId, load) {
150
- return { id: skillId, preloaded: load === "preloaded" };
151
- }
152
- function readAgentMap(agents) {
153
- const known = /* @__PURE__ */ new Map();
154
- const switchedOff = /* @__PURE__ */ new Set();
155
- const unknown = [];
156
- for (const [name, entry] of Object.entries(agents)) {
157
- if (!KNOWN_AGENTS.has(name)) unknown.push(name);
158
- else if (entry.on === false) switchedOff.add(name);
159
- else known.set(name, entry);
160
- }
161
- return { known, switchedOff, unknown };
162
- }
163
- function seedAgentScope(entry) {
164
- return entry?.scope ?? DEFAULT_SELECTION_OPTIONS.scope;
165
- }
166
- function agentScopeConfig(name, entry) {
167
- return {
168
- name,
169
- scope: seedAgentScope(entry),
170
- ...entry?.model !== void 0 && { model: entry.model },
171
- ...entry?.effort !== void 0 && { effort: entry.effort }
172
- };
173
- }
174
- function unwritableAssignmentsError(assignments) {
175
- return [
176
- "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:",
177
- ...assignments.map(({ skillId, agent }) => ` ${skillId} -> ${agent}`),
178
- "Re-share it with each sub-agent above pinned to the project, or each skill above at global scope."
179
- ].join("\n");
180
- }
181
- function seedToWizardResult(payload, matrix) {
182
- const domainSelections = {};
183
- const assignedStack = {};
184
- const skills = [];
185
- const skippedSkillIds = [];
186
- const unwritable = [];
187
- const agentNames = /* @__PURE__ */ new Set();
188
- const agentMap = readAgentMap(payload.agents);
189
- const skippedAgentNames = new Set(agentMap.unknown);
190
- for (const [skillId, entry] of Object.entries(payload.skills)) {
191
- const skill = matrix.skills[skillId];
192
- const domain = skill?.category ? getCategoryDomain(skill.category) : void 0;
193
- if (!skill?.category || !domain) {
194
- skippedSkillIds.push(skillId);
195
- continue;
196
- }
197
- const id = skillId;
198
- const category = skill.category;
199
- addToDomainSelections(domainSelections, domain, category, id);
200
- skills.push({
201
- id,
202
- scope: entry.scope,
203
- // "eject" is a source in its own right; anything else names the marketplace it came from.
204
- source: entry.install === "eject" ? "eject" : sourceForSkill(skill)
205
- });
206
- for (const [agentName, load] of Object.entries(entry.assignments)) {
207
- if (agentMap.switchedOff.has(agentName)) continue;
208
- if (!KNOWN_AGENTS.has(agentName)) {
209
- skippedAgentNames.add(agentName);
210
- continue;
211
- }
212
- const agent = agentName;
213
- if (!isScopePairCompatible(entry.scope, seedAgentScope(agentMap.known.get(agent)))) {
214
- unwritable.push({ skillId: id, agent });
215
- continue;
216
- }
217
- agentNames.add(agent);
218
- addToAgentStack(assignedStack, agent, category, toSkillAssignment(id, load));
219
- }
220
- }
221
- if (unwritable.length > 0) throw new Error(unwritableAssignmentsError(unwritable));
222
- for (const [name, entry] of agentMap.known) {
223
- if (entry.on === true) agentNames.add(name);
224
- }
225
- const selectedAgents = [...agentNames];
226
- return {
227
- result: {
228
- skills,
229
- selectedAgents,
230
- agentConfigs: selectedAgents.map((name) => agentScopeConfig(name, agentMap.known.get(name))),
231
- assignedStack,
232
- selectedStackId: payload.stackId,
233
- domainSelections,
234
- selectedDomains: orderDomains(Object.keys(domainSelections)),
235
- // Nothing was dropped from a *saved config* — the skipped ids came off the wire and are
236
- // reported to the user directly, so there is no config removal to explain.
237
- unresolvableSkillIds: [],
238
- cancelled: false,
239
- // Revalidated here rather than taken on trust from the app that built the payload. That app
240
- // validated against ITS catalog; this one skips ids it does not know and carries its own
241
- // relationship rules, so a configuration that was consistent where it was authored can
242
- // arrive with a requirement genuinely unmet. Running the same validator the wizard runs
243
- // makes that this catalog's verdict on what it can install — reported through the spine
244
- // `init` already has, beside the skips that explain it — rather than a fault in what was
245
- // shared.
246
- validation: validateSelection(skills.map((skill) => skill.id))
247
- },
248
- skippedSkillIds,
249
- skippedAgentNames: [...skippedAgentNames]
250
- };
251
- }
252
-
253
95
  // src/cli/lib/permission-checker.tsx
254
96
  import "react";
255
97
  import "zod";
@@ -347,12 +189,12 @@ function formatDashboardText(data) {
347
189
  const lines = [
348
190
  DEFAULT_BRANDING.NAME,
349
191
  "",
350
- ` Skills: ${data.skillCount} installed`,
351
- ` Agents: ${data.agentCount} compiled`,
352
- ` Mode: ${modeLabel}`
192
+ ` Skills: ${data.skillCount} installed`,
193
+ ` Agents: ${data.agentCount} compiled`,
194
+ ` Mode: ${modeLabel}`
353
195
  ];
354
196
  if (data.source) {
355
- lines.push(` Source: ${data.source}`);
197
+ lines.push(` Marketplace: ${data.source}`);
356
198
  }
357
199
  lines.push("");
358
200
  lines.push(` [Edit] [Compile] [Doctor] [List]`);
@@ -388,6 +230,9 @@ async function runDashboardFlow(projectDir, config, origin, log) {
388
230
  function writesGlobalContent(result) {
389
231
  return result.skills.some((skill) => skill.scope === "global") || result.agentConfigs.some((agent) => agent.scope === "global");
390
232
  }
233
+ function sharedConfigSourceFlags(flags, payload) {
234
+ return { marketplace: flags.marketplace ?? payload.marketplace };
235
+ }
391
236
  var Init = class _Init extends BaseCommand {
392
237
  static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;
393
238
  static description = "Interactive wizard to set up skills and agents. Supports Plugin Mode (native install) and Eject Mode (copy to .claude/).";
@@ -398,13 +243,13 @@ var Init = class _Init extends BaseCommand {
398
243
  },
399
244
  {
400
245
  description: "Initialize from a custom marketplace",
401
- command: "<%= config.bin %> <%= command.id %> --source github:org/marketplace"
246
+ command: "<%= config.bin %> <%= command.id %> --marketplace github:org/marketplace"
402
247
  }
403
248
  ];
404
249
  static flags = {
405
- source: Flags.string({
406
- char: "s",
407
- description: "Skills source path or URL",
250
+ marketplace: Flags.string({
251
+ char: "m",
252
+ description: "Skills marketplace path or URL",
408
253
  required: false
409
254
  }),
410
255
  from: Flags.string({
@@ -431,25 +276,20 @@ var Init = class _Init extends BaseCommand {
431
276
  await this.handleInstallation(
432
277
  selection.result,
433
278
  selection.sourceResult,
434
- flags,
279
+ selection.sourceFlags,
435
280
  selection.interactive
436
281
  );
437
282
  }
438
283
  /** The interactive producer: load the source, run the wizard, return what was chosen. */
439
284
  async selectionFromWizard(flags, projectDir) {
440
285
  const isGlobalRoot = isHomeDirectory(projectDir);
441
- const { sourceResult, startupMessages, globalConfig } = await this.loadWizardInputsUnderSpinner(flags);
442
- const result = await this.runWizard(
443
- sourceResult,
444
- startupMessages,
445
- projectDir,
446
- globalConfig,
447
- isGlobalRoot
448
- );
286
+ const { sourceResult, startupMessages } = await this.loadWizardInputsUnderSpinner(flags);
287
+ const result = await this.runWizard(startupMessages, isGlobalRoot);
449
288
  if (!result) return null;
450
289
  return {
451
290
  result,
452
291
  sourceResult,
292
+ sourceFlags: flags,
453
293
  // A person is already at the terminal, so the permission notice can wait for them.
454
294
  interactive: true,
455
295
  emptyMessage: "No skills selected"
@@ -469,11 +309,7 @@ var Init = class _Init extends BaseCommand {
469
309
  /* @__PURE__ */ jsx2(Spinner, { label: STATUS_MESSAGES.LOADING_SKILLS })
470
310
  );
471
311
  try {
472
- const [source, globalConfig] = await Promise.all([
473
- this.loadSourceOrFail(flags),
474
- this.loadGlobalConfigIfExists()
475
- ]);
476
- return { ...source, globalConfig };
312
+ return await this.loadSourceOrFail(flags);
477
313
  } finally {
478
314
  clearSpinner();
479
315
  unmount();
@@ -483,8 +319,11 @@ var Init = class _Init extends BaseCommand {
483
319
  * The `--from <id>` producer: fetch and map, no wizard. Nothing here may assume a TTY — running
484
320
  * headless is most of why the flag exists.
485
321
  *
486
- * It is also greenfield-only, which is what the two refusals are: a shared configuration is
487
- * 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.
488
327
  */
489
328
  async selectionFromSharedConfig(id, flags, projectDir) {
490
329
  await this.refuseInstalledProject(projectDir);
@@ -493,22 +332,22 @@ var Init = class _Init extends BaseCommand {
493
332
  if (!fetched.ok) {
494
333
  this.error(fetched.error, { exit: EXIT_CODES.ERROR });
495
334
  }
496
- 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
+ );
497
342
  const { result, skippedSkillIds, skippedAgentNames } = this.decodeSeedOrFail(
498
343
  fetched.payload,
499
344
  sourceResult.matrix
500
345
  );
346
+ this.refuseProjectScopedContentAtHome(result, projectDir);
501
347
  await this.refuseBlockingGlobalInstall(result);
502
- if (skippedSkillIds.length > 0) {
503
- this.warn(
504
- `Skipped ${skippedSkillIds.length} skill(s) this catalog does not know: ${skippedSkillIds.join(", ")}`
505
- );
506
- }
507
- if (skippedAgentNames.length > 0) {
508
- this.warn(
509
- `Skipped ${skippedAgentNames.length} unknown sub-agent(s): ${skippedAgentNames.join(", ")}`
510
- );
511
- }
348
+ await this.writeCarriedSkills(carriedSkills);
349
+ if (skippedSkillIds.length > 0) this.warn(skippedUnknownSkills(skippedSkillIds));
350
+ if (skippedAgentNames.length > 0) this.warn(skippedUnknownAgents(skippedAgentNames));
512
351
  if (result.skills.length > 0) {
513
352
  this.log(
514
353
  `Installing ${result.skills.length} skill(s) across ${result.selectedAgents.length} sub-agent(s)
@@ -518,6 +357,7 @@ var Init = class _Init extends BaseCommand {
518
357
  return {
519
358
  result,
520
359
  sourceResult,
360
+ sourceFlags,
521
361
  interactive: false,
522
362
  emptyMessage: `Configuration '${id}' contains no skills this catalog can install.`
523
363
  };
@@ -563,21 +403,35 @@ var Init = class _Init extends BaseCommand {
563
403
  this.handleError(error);
564
404
  }
565
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
+ }
566
426
  async showDashboardIfInitialized(projectDir) {
567
427
  return runDashboardFlow(projectDir, this.config, "init", (msg) => this.log(msg));
568
428
  }
569
- async loadGlobalConfigIfExists() {
570
- const globalInstall = await detectGlobalInstallation();
571
- if (!globalInstall) return null;
572
- const loaded = await loadProjectConfigFromDir(os.homedir());
573
- return loaded?.config ?? null;
574
- }
575
429
  async loadSourceOrFail(flags) {
576
430
  try {
577
431
  const loaded = await loadSource({
578
- // 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.
579
433
  caller: "init",
580
- ...flags.source !== void 0 && { sourceFlag: flags.source },
434
+ ...flags.marketplace !== void 0 && { sourceFlag: flags.marketplace },
581
435
  projectDir: process.cwd(),
582
436
  captureStartupMessages: true
583
437
  });
@@ -588,24 +442,19 @@ var Init = class _Init extends BaseCommand {
588
442
  });
589
443
  }
590
444
  }
591
- async runWizard(sourceResult, startupMessages, projectDir, globalConfig, isGlobalRoot) {
592
- const selectedAgents = globalConfig?.agents && activeAgentNames(globalConfig.agents);
593
- 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) {
594
453
  return runWizardSession({
595
- hydrate: {
596
- ...selectedAgents !== void 0 && { initialAgents: selectedAgents },
597
- ...globalSkills !== void 0 && {
598
- installedSkillIds: globalSkills.map((s) => s.id),
599
- installedSkillConfigs: globalSkills
600
- },
601
- ...globalConfig?.agents !== void 0 && { installedAgentConfigs: globalConfig.agents },
602
- isEditingFromGlobalScope: isGlobalRoot
603
- },
454
+ hydrate: { isEditingFromGlobalScope: isGlobalRoot },
604
455
  props: {
605
456
  version: this.config.version,
606
457
  logo: ASCII_LOGO,
607
- initialAgents: selectedAgents,
608
- installedSkillIds: globalConfig?.skills.map((s) => s.id),
609
458
  startupMessages
610
459
  },
611
460
  onCancel: () => this.log("Setup cancelled"),
@@ -616,8 +465,8 @@ var Init = class _Init extends BaseCommand {
616
465
  const projectDir = process.cwd();
617
466
  const activeSkills = result.skills.filter((s) => !s.excluded);
618
467
  const installMode = deriveInstallMode(activeSkills);
619
- const ejectedSkills = activeSkills.filter((s) => s.source === EJECT_SOURCE);
620
- 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);
621
470
  this.logInstallPlan(installMode, ejectedSkills, pluginSkills);
622
471
  const resolvedMarketplace = pluginSkills.length > 0 ? await this.requireMarketplaceOrExit(
623
472
  sourceResult,
@@ -626,7 +475,12 @@ var Init = class _Init extends BaseCommand {
626
475
  ) : null;
627
476
  const copyResult = installMode === "eject" || installMode === "mixed" ? await this.copyEjectSkillsStep(ejectedSkills, projectDir, sourceResult, installMode) : null;
628
477
  if (resolvedMarketplace !== null) {
629
- await this.installPluginSkillsReported(pluginSkills, resolvedMarketplace, projectDir);
478
+ await this.installPluginSkillsReported(
479
+ pluginSkills,
480
+ resolvedMarketplace,
481
+ projectDir,
482
+ sourceResult.matrix
483
+ );
630
484
  }
631
485
  const pluginModeSucceeded = resolvedMarketplace !== null;
632
486
  try {
@@ -698,7 +552,7 @@ var Init = class _Init extends BaseCommand {
698
552
  wizardResult: result,
699
553
  sourceResult,
700
554
  projectDir: process.cwd(),
701
- ...flags.source !== void 0 && { sourceFlag: flags.source }
555
+ ...flags.marketplace !== void 0 && { sourceFlag: flags.marketplace }
702
556
  });
703
557
  if (configResult.wasMerged) {
704
558
  this.log(`Merged with existing config at ${configResult.existingConfigPath}`);
@@ -850,7 +704,7 @@ async function getDashboardData(projectDir) {
850
704
  const skillCount = info?.skillCount ?? 0;
851
705
  const agentCount = info?.agentCount ?? 0;
852
706
  const mode = info?.mode ?? (activeSkills ? deriveInstallMode(activeSkills) : "eject");
853
- const source = loaded?.config.source;
707
+ const source = loaded?.config.marketplace;
854
708
  return { skillCount, agentCount, mode, ...source !== void 0 && { source } };
855
709
  }
856
710
 
@@ -861,4 +715,4 @@ export {
861
715
  Init,
862
716
  getDashboardData
863
717
  };
864
- //# sourceMappingURL=chunk-5MFJ24VM.js.map
718
+ //# sourceMappingURL=chunk-H6UTKTLK.js.map