agents-inc 0.168.0 → 0.170.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +18 -15
  3. package/dist/{chunk-JIBCVXXL.js → chunk-3G7X2WKI.js} +4 -4
  4. package/dist/{chunk-JOEA52NR.js → chunk-44TE3RKH.js} +46 -2
  5. package/dist/chunk-44TE3RKH.js.map +1 -0
  6. package/dist/{chunk-NU2K5G54.js → chunk-52HDHJ7I.js} +11 -19
  7. package/dist/chunk-52HDHJ7I.js.map +1 -0
  8. package/dist/{chunk-EH2PGPLP.js → chunk-6HNXYYVF.js} +39 -22
  9. package/dist/chunk-6HNXYYVF.js.map +1 -0
  10. package/dist/{chunk-4UKMQUAU.js → chunk-6ZRH5RHC.js} +10 -11
  11. package/dist/chunk-6ZRH5RHC.js.map +1 -0
  12. package/dist/{chunk-5JUQKGCP.js → chunk-7RDMTR64.js} +14 -34
  13. package/dist/chunk-7RDMTR64.js.map +1 -0
  14. package/dist/{chunk-3LZNY46H.js → chunk-BMRUNMPV.js} +4 -4
  15. package/dist/{chunk-VVRI35SK.js → chunk-CLPUWOSA.js} +4 -4
  16. package/dist/{chunk-VVRI35SK.js.map → chunk-CLPUWOSA.js.map} +1 -1
  17. package/dist/{chunk-TW35AEB4.js → chunk-F2BHT5C4.js} +9 -7
  18. package/dist/chunk-F2BHT5C4.js.map +1 -0
  19. package/dist/{chunk-27AVGFXH.js → chunk-F5EBEATU.js} +2 -2
  20. package/dist/{chunk-GE7NUPMI.js → chunk-HED2DAXZ.js} +3 -3
  21. package/dist/{chunk-7PYXS2QU.js → chunk-KOLDW6SF.js} +3 -3
  22. package/dist/{chunk-7PYXS2QU.js.map → chunk-KOLDW6SF.js.map} +1 -1
  23. package/dist/{chunk-C2UISKIM.js → chunk-MQ6CGZNJ.js} +109 -422
  24. package/dist/chunk-MQ6CGZNJ.js.map +1 -0
  25. package/dist/{chunk-P6I72PR3.js → chunk-NCWDK6L7.js} +115 -196
  26. package/dist/chunk-NCWDK6L7.js.map +1 -0
  27. package/dist/{chunk-VRXX4D6K.js → chunk-NEZ4OAOL.js} +1 -1
  28. package/dist/chunk-NEZ4OAOL.js.map +1 -0
  29. package/dist/chunk-NIHUOWE4.js +106 -0
  30. package/dist/chunk-NIHUOWE4.js.map +1 -0
  31. package/dist/{chunk-OI2H6M5I.js → chunk-NQW25DCF.js} +2 -2
  32. package/dist/chunk-NQW25DCF.js.map +1 -0
  33. package/dist/{chunk-ZUGH4MQG.js → chunk-OYJQUA3D.js} +3 -3
  34. package/dist/{chunk-ZUGH4MQG.js.map → chunk-OYJQUA3D.js.map} +1 -1
  35. package/dist/{chunk-AG3ZVM3B.js → chunk-PJWGTNOX.js} +186 -210
  36. package/dist/chunk-PJWGTNOX.js.map +1 -0
  37. package/dist/{chunk-HR7TK2XW.js → chunk-RIPSGNLU.js} +3 -3
  38. package/dist/chunk-RIPSGNLU.js.map +1 -0
  39. package/dist/{chunk-4DRFEYCE.js → chunk-SZYQISA2.js} +7 -7
  40. package/dist/chunk-SZYQISA2.js.map +1 -0
  41. package/dist/{chunk-W6GO2CYX.js → chunk-USVBYQSQ.js} +2 -2
  42. package/dist/{chunk-H4ZKGGTE.js → chunk-V3KTSP3Q.js} +50 -42
  43. package/dist/chunk-V3KTSP3Q.js.map +1 -0
  44. package/dist/{chunk-KTLKR4YY.js → chunk-WTWMGH2C.js} +2 -2
  45. package/dist/commands/build/marketplace.js +23 -22
  46. package/dist/commands/build/marketplace.js.map +1 -1
  47. package/dist/commands/build/plugins.js +8 -9
  48. package/dist/commands/build/plugins.js.map +1 -1
  49. package/dist/commands/compile.js +19 -20
  50. package/dist/commands/compile.js.map +1 -1
  51. package/dist/commands/doctor.js +17 -18
  52. package/dist/commands/doctor.js.map +1 -1
  53. package/dist/commands/edit.js +118 -297
  54. package/dist/commands/edit.js.map +1 -1
  55. package/dist/commands/eject.js +21 -33
  56. package/dist/commands/eject.js.map +1 -1
  57. package/dist/commands/init.js +17 -45
  58. package/dist/commands/list.js +19 -17
  59. package/dist/commands/list.js.map +1 -1
  60. package/dist/commands/new/marketplace.js +11 -11
  61. package/dist/commands/new/marketplace.js.map +1 -1
  62. package/dist/commands/search.js +12 -13
  63. package/dist/commands/search.js.map +1 -1
  64. package/dist/commands/share.js +11 -12
  65. package/dist/commands/share.js.map +1 -1
  66. package/dist/commands/uninstall.js +18 -20
  67. package/dist/commands/uninstall.js.map +1 -1
  68. package/dist/commands/update.js +8 -9
  69. package/dist/commands/update.js.map +1 -1
  70. package/dist/components/common/removal-plan-confirm.js +2 -2
  71. package/dist/components/common/scroll-affordance.js +9 -0
  72. package/dist/components/common/select-list.js +2 -3
  73. package/dist/components/common/skill-agent-summary.js +11 -0
  74. package/dist/components/common/spinner.js +1 -1
  75. package/dist/{chunk-QWFG7Y3R.js → components/common/summary-panel.js} +57 -31
  76. package/dist/components/common/summary-panel.js.map +1 -0
  77. package/dist/config-exports.js +1 -1
  78. package/dist/hooks/init.js +18 -46
  79. package/dist/hooks/init.js.map +1 -1
  80. package/dist/load-agent-defs-YMDWBFDP.js +14 -0
  81. package/dist/recompile-project-agents-SZ76WNTW.js +18 -0
  82. package/dist/{source-loader-FRJTCSDL.js → source-loader-C5SQXZXI.js} +5 -5
  83. package/dist/src/agents/meta/codex-keeper/playbook.md +2 -3
  84. package/package.json +2 -3
  85. package/src/agents/meta/codex-keeper/playbook.md +2 -3
  86. package/src/schemas/project-config.schema.json +1 -1
  87. package/assets/demo.tape +0 -266
  88. package/dist/chunk-23DNVNFP.js +0 -292
  89. package/dist/chunk-23DNVNFP.js.map +0 -1
  90. package/dist/chunk-3DIDV6H3.js +0 -268
  91. package/dist/chunk-3DIDV6H3.js.map +0 -1
  92. package/dist/chunk-4DRFEYCE.js.map +0 -1
  93. package/dist/chunk-4HWOYYY7.js +0 -92
  94. package/dist/chunk-4HWOYYY7.js.map +0 -1
  95. package/dist/chunk-4UKMQUAU.js.map +0 -1
  96. package/dist/chunk-5JUQKGCP.js.map +0 -1
  97. package/dist/chunk-6WGXTB2L.js +0 -28
  98. package/dist/chunk-6WGXTB2L.js.map +0 -1
  99. package/dist/chunk-AG3ZVM3B.js.map +0 -1
  100. package/dist/chunk-C2UISKIM.js.map +0 -1
  101. package/dist/chunk-CMJBKQUH.js +0 -23
  102. package/dist/chunk-CMJBKQUH.js.map +0 -1
  103. package/dist/chunk-DJEO3F2H.js +0 -230
  104. package/dist/chunk-DJEO3F2H.js.map +0 -1
  105. package/dist/chunk-EH2PGPLP.js.map +0 -1
  106. package/dist/chunk-GRL73YPF.js +0 -197
  107. package/dist/chunk-GRL73YPF.js.map +0 -1
  108. package/dist/chunk-H4ZKGGTE.js.map +0 -1
  109. package/dist/chunk-HI6YB7XP.js +0 -59
  110. package/dist/chunk-HI6YB7XP.js.map +0 -1
  111. package/dist/chunk-HL3GYRMR.js +0 -17
  112. package/dist/chunk-HL3GYRMR.js.map +0 -1
  113. package/dist/chunk-HR7TK2XW.js.map +0 -1
  114. package/dist/chunk-JOEA52NR.js.map +0 -1
  115. package/dist/chunk-JPMV4E4E.js +0 -118
  116. package/dist/chunk-JPMV4E4E.js.map +0 -1
  117. package/dist/chunk-JVUN6AOO.js +0 -237
  118. package/dist/chunk-JVUN6AOO.js.map +0 -1
  119. package/dist/chunk-KQ3PDARZ.js +0 -25
  120. package/dist/chunk-KQ3PDARZ.js.map +0 -1
  121. package/dist/chunk-L3W2JWBA.js +0 -168
  122. package/dist/chunk-L3W2JWBA.js.map +0 -1
  123. package/dist/chunk-LFUJCRCT.js +0 -27
  124. package/dist/chunk-LFUJCRCT.js.map +0 -1
  125. package/dist/chunk-NU2K5G54.js.map +0 -1
  126. package/dist/chunk-OI2H6M5I.js.map +0 -1
  127. package/dist/chunk-P6I72PR3.js.map +0 -1
  128. package/dist/chunk-PCFUXQJA.js +0 -317
  129. package/dist/chunk-PCFUXQJA.js.map +0 -1
  130. package/dist/chunk-PLX2FLEQ.js +0 -48
  131. package/dist/chunk-PLX2FLEQ.js.map +0 -1
  132. package/dist/chunk-QWFG7Y3R.js.map +0 -1
  133. package/dist/chunk-SLBL3WIP.js +0 -121
  134. package/dist/chunk-SLBL3WIP.js.map +0 -1
  135. package/dist/chunk-TSIU7DME.js +0 -43
  136. package/dist/chunk-TSIU7DME.js.map +0 -1
  137. package/dist/chunk-TW35AEB4.js.map +0 -1
  138. package/dist/chunk-VRXX4D6K.js.map +0 -1
  139. package/dist/chunk-W5KEYSOL.js +0 -51
  140. package/dist/chunk-W5KEYSOL.js.map +0 -1
  141. package/dist/chunk-WNLF5EDZ.js +0 -1170
  142. package/dist/chunk-WNLF5EDZ.js.map +0 -1
  143. package/dist/chunk-WTJ3AY33.js +0 -31
  144. package/dist/chunk-WTJ3AY33.js.map +0 -1
  145. package/dist/chunk-X6ZZEYO3.js +0 -53
  146. package/dist/chunk-X6ZZEYO3.js.map +0 -1
  147. package/dist/chunk-XQHZPINL.js +0 -89
  148. package/dist/chunk-XQHZPINL.js.map +0 -1
  149. package/dist/chunk-YN3SWF53.js +0 -35
  150. package/dist/chunk-YN3SWF53.js.map +0 -1
  151. package/dist/components/wizard/category-grid.js +0 -13
  152. package/dist/components/wizard/checkbox-grid.js +0 -12
  153. package/dist/components/wizard/domain-selection.js +0 -18
  154. package/dist/components/wizard/run-wizard-session.js +0 -40
  155. package/dist/components/wizard/run-wizard-session.js.map +0 -1
  156. package/dist/components/wizard/scroll-affordance.js +0 -9
  157. package/dist/components/wizard/skill-agent-summary.js +0 -13
  158. package/dist/components/wizard/source-grid.js +0 -16
  159. package/dist/components/wizard/source-grid.js.map +0 -1
  160. package/dist/components/wizard/stack-selection.js +0 -17
  161. package/dist/components/wizard/stack-selection.js.map +0 -1
  162. package/dist/components/wizard/step-agents.js +0 -18
  163. package/dist/components/wizard/step-agents.js.map +0 -1
  164. package/dist/components/wizard/step-build.js +0 -18
  165. package/dist/components/wizard/step-build.js.map +0 -1
  166. package/dist/components/wizard/step-confirm.js +0 -18
  167. package/dist/components/wizard/step-confirm.js.map +0 -1
  168. package/dist/components/wizard/step-sources.js +0 -19
  169. package/dist/components/wizard/step-sources.js.map +0 -1
  170. package/dist/components/wizard/step-stack.js +0 -18
  171. package/dist/components/wizard/step-stack.js.map +0 -1
  172. package/dist/components/wizard/summary-panel.js +0 -17
  173. package/dist/components/wizard/summary-panel.js.map +0 -1
  174. package/dist/components/wizard/toast.js +0 -9
  175. package/dist/components/wizard/toast.js.map +0 -1
  176. package/dist/components/wizard/wizard-layout.js +0 -22
  177. package/dist/components/wizard/wizard-layout.js.map +0 -1
  178. package/dist/components/wizard/wizard-tabs.js +0 -11
  179. package/dist/components/wizard/wizard-tabs.js.map +0 -1
  180. package/dist/components/wizard/wizard.js +0 -39
  181. package/dist/components/wizard/wizard.js.map +0 -1
  182. package/dist/load-agent-defs-5XMVB3MU.js +0 -14
  183. package/dist/load-agent-defs-5XMVB3MU.js.map +0 -1
  184. package/dist/recompile-project-agents-7PQWYQ6B.js +0 -18
  185. package/dist/recompile-project-agents-7PQWYQ6B.js.map +0 -1
  186. package/dist/source-loader-FRJTCSDL.js.map +0 -1
  187. package/dist/stores/wizard-store.js +0 -24
  188. package/dist/stores/wizard-store.js.map +0 -1
  189. /package/assets/{demo.gif → legacy-wizard.gif} +0 -0
  190. /package/dist/{chunk-JIBCVXXL.js.map → chunk-3G7X2WKI.js.map} +0 -0
  191. /package/dist/{chunk-3LZNY46H.js.map → chunk-BMRUNMPV.js.map} +0 -0
  192. /package/dist/{chunk-27AVGFXH.js.map → chunk-F5EBEATU.js.map} +0 -0
  193. /package/dist/{chunk-GE7NUPMI.js.map → chunk-HED2DAXZ.js.map} +0 -0
  194. /package/dist/{chunk-W6GO2CYX.js.map → chunk-USVBYQSQ.js.map} +0 -0
  195. /package/dist/{chunk-KTLKR4YY.js.map → chunk-WTWMGH2C.js.map} +0 -0
  196. /package/dist/components/{wizard → common}/scroll-affordance.js.map +0 -0
  197. /package/dist/components/{wizard → common}/skill-agent-summary.js.map +0 -0
  198. /package/dist/{components/wizard/category-grid.js.map → load-agent-defs-YMDWBFDP.js.map} +0 -0
  199. /package/dist/{components/wizard/checkbox-grid.js.map → recompile-project-agents-SZ76WNTW.js.map} +0 -0
  200. /package/dist/{components/wizard/domain-selection.js.map → source-loader-C5SQXZXI.js.map} +0 -0
@@ -1,26 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SelectList
4
- } from "./chunk-W5KEYSOL.js";
4
+ } from "./chunk-44TE3RKH.js";
5
5
  import {
6
6
  holdInstalledGlobal,
7
7
  installPlanLines,
8
8
  notInstalledGlobally,
9
9
  openUrl,
10
10
  readInstalledGlobal
11
- } from "./chunk-EH2PGPLP.js";
12
- import {
13
- runWizardSession
14
- } from "./chunk-X6ZZEYO3.js";
15
- import {
16
- useTerminalDimensions
17
- } from "./chunk-JVUN6AOO.js";
18
- import {
19
- awaitUnderSpinner
20
- } from "./chunk-VRXX4D6K.js";
11
+ } from "./chunk-6HNXYYVF.js";
21
12
  import {
22
13
  fetchSeedConfig
23
- } from "./chunk-ZUGH4MQG.js";
14
+ } from "./chunk-OYJQUA3D.js";
24
15
  import {
25
16
  promptConfirm,
26
17
  promptValue
@@ -30,7 +21,7 @@ import {
30
21
  } from "./chunk-OZXAJNLA.js";
31
22
  import {
32
23
  hostCompileNotices
33
- } from "./chunk-27AVGFXH.js";
24
+ } from "./chunk-F5EBEATU.js";
34
25
  import {
35
26
  compileAgentsAllScopes,
36
27
  compileProjectScope,
@@ -38,14 +29,14 @@ import {
38
29
  movedGlobalAgentInputs,
39
30
  sayCapturedWarnings,
40
31
  writeProjectConfig
41
- } from "./chunk-5JUQKGCP.js";
32
+ } from "./chunk-7RDMTR64.js";
42
33
  import {
43
34
  copyLocalSkills,
44
35
  discoverInstalledSkills
45
- } from "./chunk-TW35AEB4.js";
36
+ } from "./chunk-F2BHT5C4.js";
46
37
  import {
47
38
  loadAgentDefs
48
- } from "./chunk-GE7NUPMI.js";
39
+ } from "./chunk-HED2DAXZ.js";
49
40
  import {
50
41
  render
51
42
  } from "./chunk-JFLVEFFP.js";
@@ -53,22 +44,21 @@ import {
53
44
  providerFlag,
54
45
  providerNamedBy,
55
46
  providerNeedsAConfigurationToInstall
56
- } from "./chunk-HR7TK2XW.js";
47
+ } from "./chunk-RIPSGNLU.js";
57
48
  import {
58
49
  BaseCommand,
59
50
  EXIT_CODES,
51
+ clearTerminalScreen,
60
52
  registerExternalSkills,
61
53
  writeExternalSkills
62
- } from "./chunk-H4ZKGGTE.js";
63
- import {
64
- clearTerminalScreen
65
- } from "./chunk-CMJBKQUH.js";
54
+ } from "./chunk-V3KTSP3Q.js";
66
55
  import {
67
56
  INCOMPLETE_WORK_RECOVERY,
68
57
  INSTALL_MODE_DESCRIPTIONS,
69
58
  INSTALL_MODE_LABELS,
70
59
  SHARED_CONFIG_ARRIVALS,
71
60
  STATUS_MESSAGES,
61
+ addMarketplaceInTheEditor,
72
62
  advisesOnPermissions,
73
63
  agentCodec,
74
64
  agentsNotCompiled,
@@ -79,7 +69,6 @@ import {
79
69
  deriveInstallMode,
80
70
  detectInstallation,
81
71
  detectProjectInstallation,
82
- editorLoadsItsOwnMarketplace,
83
72
  fileExists,
84
73
  getErrorMessage,
85
74
  getInstallationInfo,
@@ -89,10 +78,9 @@ import {
89
78
  initSucceeded,
90
79
  installBaseDir,
91
80
  isHomeDirectory,
92
- isSameMarketplace,
81
+ isLocalSource,
93
82
  keptAsInstalledGlobally,
94
83
  loadProjectConfig,
95
- marketplaceFixedAtInstall,
96
84
  permissionFiles,
97
85
  plural,
98
86
  providerInUse,
@@ -100,33 +88,55 @@ import {
100
88
  relativeConfigPath,
101
89
  resolveBranding,
102
90
  resolveInstallPaths,
103
- resolveSource,
104
- seedToWizardResult,
91
+ seedToInstallSelection,
105
92
  settingsFileSchema,
106
93
  sharedConfigExistingInstall,
107
94
  skippedUnknownAgents,
108
95
  skippedUnknownSkills,
109
- warn,
110
- wizardNeedsTerminal
111
- } from "./chunk-C2UISKIM.js";
96
+ warn
97
+ } from "./chunk-MQ6CGZNJ.js";
112
98
  import {
113
99
  ASCII_LOGO,
114
100
  CLI_COLORS,
115
101
  CLI_INVOKE_COMMAND,
116
102
  DEFAULT_BRANDING,
117
103
  EDITOR_URL,
118
- EDIT_PROJECT_SETUP_FLAG,
119
- EDIT_PROJECT_SETUP_MARKETPLACE_FLAG,
120
104
  EJECT_SOURCE,
121
105
  MAX_CONFIG_FILE_SIZE,
122
106
  editorConfigUrl
123
- } from "./chunk-AG3ZVM3B.js";
107
+ } from "./chunk-PJWGTNOX.js";
124
108
 
125
109
  // src/cli/commands/init.tsx
126
110
  import "react";
127
111
  import { Flags } from "@oclif/core";
128
112
  import { Box as Box2, Text as Text2, useApp } from "ink";
129
113
 
114
+ // src/cli/components/hooks/use-terminal-dimensions.ts
115
+ import { useState, useEffect } from "react";
116
+ import { useStdout } from "ink";
117
+ var DEFAULT_COLUMNS = 80;
118
+ var DEFAULT_ROWS = 24;
119
+ function useTerminalDimensions() {
120
+ const { stdout } = useStdout();
121
+ const [dimensions, setDimensions] = useState(() => ({
122
+ columns: stdout.columns || DEFAULT_COLUMNS,
123
+ rows: stdout.rows || DEFAULT_ROWS
124
+ }));
125
+ useEffect(() => {
126
+ const handleResize = () => {
127
+ setDimensions({
128
+ columns: stdout.columns || DEFAULT_COLUMNS,
129
+ rows: stdout.rows || DEFAULT_ROWS
130
+ });
131
+ };
132
+ stdout.on("resize", handleResize);
133
+ return () => {
134
+ stdout.off("resize", handleResize);
135
+ };
136
+ }, [stdout]);
137
+ return dimensions;
138
+ }
139
+
130
140
  // src/cli/lib/permission-checker.tsx
131
141
  import "react";
132
142
  import "zod";
@@ -209,11 +219,12 @@ async function checkPermissions(projectRoot) {
209
219
  // src/cli/commands/init.tsx
210
220
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
211
221
  var DASHBOARD_OPTIONS = [
212
- { label: "Edit", value: "edit" },
222
+ { label: "Edit in the web editor", value: "edit" },
213
223
  { label: "Compile", value: "compile" },
214
224
  { label: "Doctor", value: "doctor" },
215
225
  { label: "List", value: "list" }
216
226
  ];
227
+ var DASHBOARD_OPTIONS_LINE = ` ${DASHBOARD_OPTIONS.map(({ label }) => `[${label}]`).join(" ")}`;
217
228
  var DashboardTitle = ({ name }) => name === DEFAULT_BRANDING.NAME ? /* @__PURE__ */ jsx2(Text2, { children: ASCII_LOGO }) : /* @__PURE__ */ jsx2(Text2, { bold: true, children: name });
218
229
  var Dashboard = ({ data, onSelect, onCancel }) => {
219
230
  const { exit } = useApp();
@@ -249,13 +260,7 @@ function dashboardCountLines(data) {
249
260
  return lines;
250
261
  }
251
262
  function formatDashboardText(data) {
252
- return [
253
- data.name,
254
- "",
255
- ...dashboardCountLines(data),
256
- "",
257
- ` [Edit] [Compile] [Doctor] [List]`
258
- ].join("\n");
263
+ return [data.name, "", ...dashboardCountLines(data), "", DASHBOARD_OPTIONS_LINE].join("\n");
259
264
  }
260
265
  var DASHBOARD_INTERRUPTED = "interrupted";
261
266
  async function showDashboard(projectDir, log) {
@@ -279,21 +284,16 @@ async function showDashboard(projectDir, log) {
279
284
  clearTerminalScreen();
280
285
  return selectedCommand;
281
286
  }
282
- function dashboardCommandArgv(command, origin, setupMarketplace) {
283
- if (command !== "edit" || origin !== "init") return [];
284
- const marketplaceArgv = setupMarketplace === void 0 ? [] : [`--${EDIT_PROJECT_SETUP_MARKETPLACE_FLAG}`, setupMarketplace];
285
- return [`--${EDIT_PROJECT_SETUP_FLAG}`, ...marketplaceArgv];
287
+ function dashboardCommandArgv(command) {
288
+ return command === "edit" ? ["--ui"] : [];
286
289
  }
287
- async function runDashboardFlow(projectDir, config, origin, log, setupMarketplace) {
290
+ async function runDashboardFlow(projectDir, config, log) {
288
291
  const installation = await detectInstallation(projectDir);
289
292
  if (!installation) return "not-installed";
290
293
  const selectedCommand = await showDashboard(projectDir, log);
291
294
  if (selectedCommand === DASHBOARD_INTERRUPTED) return "cancelled";
292
295
  if (selectedCommand) {
293
- await config.runCommand(
294
- selectedCommand,
295
- dashboardCommandArgv(selectedCommand, origin, setupMarketplace)
296
- );
296
+ await config.runCommand(selectedCommand, dashboardCommandArgv(selectedCommand));
297
297
  }
298
298
  return "shown";
299
299
  }
@@ -309,29 +309,33 @@ var Init = class _Init extends BaseCommand {
309
309
  */
310
310
  brandingName = DEFAULT_BRANDING.NAME;
311
311
  static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;
312
- static description = "Interactive wizard to set up skills and agents. Supports Plugin Mode (native install) and Eject Mode (copy to .claude/).";
312
+ static description = "Build a configuration in agentsinc.sh/editor, or install one by id with --from. Over an existing installation, shows its dashboard.";
313
313
  static examples = [
314
314
  {
315
- description: "Start the setup wizard",
315
+ description: "Open the editor to build a configuration",
316
316
  command: "<%= config.bin %> <%= command.id %>"
317
317
  },
318
318
  {
319
- description: "Initialize from a custom marketplace",
320
- command: "<%= config.bin %> <%= command.id %> --marketplace github:org/marketplace"
319
+ description: "Install a configuration built in the editor",
320
+ command: "<%= config.bin %> <%= command.id %> --from <id>"
321
+ },
322
+ {
323
+ description: "Test local marketplace changes against a configuration built in the editor",
324
+ command: "<%= config.bin %> <%= command.id %> --from <id> --marketplace ./my-marketplace"
321
325
  }
322
326
  ];
323
327
  static flags = {
324
328
  marketplace: Flags.string({
325
329
  char: "m",
326
- description: "Skills marketplace path or URL",
330
+ description: "With --from, install from this marketplace instead of the one the configuration names. Without --from, open the editor and say how to add it there",
327
331
  required: false
328
332
  }),
329
333
  from: Flags.string({
330
- description: "Install a configuration shared from agentsinc.sh by its id, without the wizard",
334
+ description: "Install a configuration shared from agentsinc.sh by its id",
331
335
  helpValue: "<id>"
332
336
  }),
333
337
  ui: Flags.boolean({
334
- description: "Open agentsinc.sh/editor instead of the terminal \u2014 the id --from names, or the catalogue",
338
+ description: "Open agentsinc.sh/editor on the id --from names, or on the catalogue \u2014 what a bare init does where nothing is installed",
335
339
  default: false
336
340
  }),
337
341
  provider: providerFlag()
@@ -366,47 +370,51 @@ var Init = class _Init extends BaseCommand {
366
370
  * desktop session there is no browser to be anybody's — a link nobody can copy is the whole
367
371
  * loss, so opening one is the convenience on top and a failure to open is a warning beside a
368
372
  * link that still works.
373
+ *
374
+ * A marketplace named here cannot ride along: the address carries an id and nothing else, so
375
+ * the line under the link says how to add it in the editor.
369
376
  */
370
- async openEditor(id, projectDir) {
377
+ async openEditor(projectDir, id, marketplace) {
371
378
  const url = id === void 0 ? EDITOR_URL : editorConfigUrl(id);
379
+ const marketplaceLine = marketplace === void 0 ? void 0 : this.addMarketplaceLineOrFail(marketplace);
372
380
  this.log(id === void 0 ? `Build it at ${url}` : `Open it at ${url}`);
381
+ if (marketplaceLine !== void 0) this.log(marketplaceLine);
373
382
  this.log(applySharedConfigHere(id, await holdsItsOwnInstallation(projectDir)));
374
383
  if (!process.stdin.isTTY) return;
375
384
  const opened = await openUrl(url);
376
385
  if (!opened.ok) this.warn(opened.error);
377
386
  }
378
387
  /**
379
- * One spine, two producers. The wizard and a shared id differ only in *where the selection
380
- * comes from* — everything after it (the install pipeline) is identical, so it lives here once
381
- * rather than being written twice and drifting. What each producer refuses, it refuses itself:
382
- * `--from` asks a question the wizard does not, and every refusal it makes comes before it.
388
+ * Every route `init` has, in the order they are tried: the editor for `--ui` and for a
389
+ * marketplace named without `--from`; for a bare run, the installation's dashboard — or the
390
+ * editor where nothing is installed; and the install of the configuration `--from` names.
383
391
  */
384
392
  async install() {
385
393
  const { flags } = await this.parse(_Init);
386
394
  const projectDir = process.cwd();
387
395
  this.settleTheProviderForThisRun(flags);
388
- if (flags.ui) {
389
- this.refuseMarketplaceForTheEditor(flags.marketplace);
390
- return this.openEditor(flags.from, projectDir);
391
- }
396
+ if (opensTheEditor(flags)) return this.openEditor(projectDir, flags.from, flags.marketplace);
392
397
  await this.ensureConfigReadable(projectDir);
398
+ if (flags.from === void 0) return this.showDashboardOrOpenEditor(projectDir);
393
399
  this.brandingName = await this.resolveBrandingName(projectDir);
394
- if (!flags.from) {
395
- await this.refuseMarketplaceOtherThanTheInstalledOne(projectDir, flags.marketplace);
396
- const dashboard = await this.showDashboardIfInitialized(projectDir, flags.marketplace);
397
- if (dashboard === "cancelled") this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
398
- if (dashboard === "shown") return;
399
- }
400
- const selection = flags.from ? await this.selectionFromSharedConfig(flags.from, flags, projectDir) : await this.selectionFromWizard(flags, projectDir);
400
+ const selection = await this.selectionFromSharedConfig(flags.from, flags, projectDir);
401
401
  if (!selection) this.exit(EXIT_CODES.CANCELLED);
402
402
  this.reportValidationErrors(selection.result.validation);
403
- await this.handleInstallation(
404
- selection.result,
405
- selection.sourceResult,
406
- selection.sourceFlags,
407
- selection.interactive,
408
- selection.installedAlready
409
- );
403
+ await this.handleInstallation(selection);
404
+ }
405
+ /** A bare `init`: the installation's dashboard, or the editor where nothing is installed. */
406
+ async showDashboardOrOpenEditor(projectDir) {
407
+ const dashboard = await runDashboardFlow(projectDir, this.config, (msg) => this.log(msg));
408
+ if (dashboard === "cancelled") this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
409
+ if (dashboard === "not-installed") await this.openEditor(projectDir);
410
+ }
411
+ /** The editor's marketplace line, or the refusal the install route gives a ref it cannot read. */
412
+ addMarketplaceLineOrFail(ref) {
413
+ try {
414
+ return addMarketplaceInTheEditor(ref, isLocalSource(ref));
415
+ } catch (error) {
416
+ this.handleError(error);
417
+ }
410
418
  }
411
419
  /**
412
420
  * Commits this run to the provider `--provider` named, or refuses a flag with nothing to name.
@@ -417,11 +425,9 @@ var Init = class _Init extends BaseCommand {
417
425
  * "the flag selects an installation" would be indistinguishable from "the flag means Codex".
418
426
  *
419
427
  * **And it is meaningless without `--from` (D15).** The provider is chosen in the web app, so
420
- * the only run that can be told one is the run that installs what the app produced. There is no
421
- * wizard step to choose a provider in and none is planned — which is what makes "the interactive
422
- * flow is Claude-only" provable rather than conventional. It also gives the placement refusal
423
- * something to refuse BEFORE anything is written: with `--from` required, a provider always
424
- * arrives beside a payload the pre-flight can read.
428
+ * the only run that can be told one is the run that installs what the app produced. It also
429
+ * gives the placement refusal something to refuse BEFORE anything is written: with `--from`
430
+ * required, a provider always arrives beside a payload the pre-flight can read.
425
431
  */
426
432
  settleTheProviderForThisRun(flags) {
427
433
  const named = providerNamedBy(flags.provider);
@@ -431,35 +437,8 @@ var Init = class _Init extends BaseCommand {
431
437
  }
432
438
  chooseProviderForThisRun(named);
433
439
  }
434
- /** The interactive producer: load the source, run the wizard, return what was chosen. */
435
- async selectionFromWizard(flags, projectDir) {
436
- const isGlobalRoot = isHomeDirectory(projectDir);
437
- const { sourceResult, startupMessages } = await this.loadWizardInputsUnderSpinner(flags);
438
- if (!process.stdin.isTTY) {
439
- this.error(wizardNeedsTerminal("init"), { exit: EXIT_CODES.ERROR });
440
- }
441
- const result = await this.runWizard(startupMessages, isGlobalRoot);
442
- if (!result) return null;
443
- if (selectsNothing(result)) this.error("No skills selected", { exit: EXIT_CODES.ERROR });
444
- return {
445
- result,
446
- sourceResult,
447
- sourceFlags: flags,
448
- // A person is already at the terminal, so the permission notice can wait for them.
449
- interactive: true,
450
- // The wizard opens only where nothing is installed at all — see `runWizard`.
451
- installedAlready: /* @__PURE__ */ new Set()
452
- };
453
- }
454
440
  /**
455
- * Everything the wizard needs, loaded behind a spinner that comes down whichever way the
456
- * await ends — a source that cannot be loaded refuses the run from inside it.
457
- */
458
- async loadWizardInputsUnderSpinner(flags) {
459
- return awaitUnderSpinner(STATUS_MESSAGES.LOADING_SKILLS, () => this.loadSourceOrFail(flags));
460
- }
461
- /**
462
- * The `--from <id>` producer: fetch and map, no wizard — and, at a terminal, one question.
441
+ * The `--from <id>` producer: fetch and map — and, at a terminal, one question.
463
442
  *
464
443
  * It installs into a clean directory, which is what the first refusal is: a shared
465
444
  * configuration is installed whole, so a directory already holding one has it applied with
@@ -530,14 +509,13 @@ var Init = class _Init extends BaseCommand {
530
509
  result: held.result,
531
510
  sourceResult,
532
511
  sourceFlags,
533
- interactive: false,
534
512
  installedAlready: new Set(held.installed.skillIds)
535
513
  };
536
514
  }
537
515
  /**
538
516
  * The two lists — what goes into this project, and what into the global install — then the
539
- * global skills skipped as already installed, and the global entries the configuration states
540
- * otherwise than they are installed, which stay.
517
+ * global skills skipped as already installed, the held sub-agents a new skill joins, and the
518
+ * global entries the configuration states otherwise than they are installed, which stay.
541
519
  */
542
520
  logWhatGoesWhere(held) {
543
521
  for (const line of installPlanLines(held)) {
@@ -579,13 +557,13 @@ var Init = class _Init extends BaseCommand {
579
557
  });
580
558
  }
581
559
  /**
582
- * The decode refuses a payload the config model has nowhere to write (see `seedToWizardResult`).
583
- * That is a failure of this command, reported with this command's exit code rather than left to
584
- * surface as an unhandled throw.
560
+ * The decode refuses a payload the config model has nowhere to write (see
561
+ * `seedToInstallSelection`). That is a failure of this command, reported with this command's exit
562
+ * code rather than left to surface as an unhandled throw.
585
563
  */
586
564
  decodeSeedOrFail(payload, matrix) {
587
565
  try {
588
- return seedToWizardResult(payload, matrix);
566
+ return seedToInstallSelection(payload, matrix);
589
567
  } catch (error) {
590
568
  this.handleError(error);
591
569
  }
@@ -611,46 +589,6 @@ var Init = class _Init extends BaseCommand {
611
589
  await writeExternalSkills(carried);
612
590
  this.log(carriedSkillsWritten(carried.map((skill) => skill.id)));
613
591
  }
614
- async showDashboardIfInitialized(projectDir, setupMarketplace) {
615
- return runDashboardFlow(
616
- projectDir,
617
- this.config,
618
- "init",
619
- (msg) => this.log(msg),
620
- setupMarketplace
621
- );
622
- }
623
- /**
624
- * Refuses `--marketplace` beside `--ui`. The editor's address carries a configuration id and
625
- * nothing else, so the marketplace would be dropped on the way — and the editor loads
626
- * marketplaces itself.
627
- */
628
- refuseMarketplaceForTheEditor(named) {
629
- if (named === void 0) return;
630
- this.error(editorLoadsItsOwnMarketplace(named), { exit: EXIT_CODES.INVALID_ARGS });
631
- }
632
- /**
633
- * Refuses a marketplace other than the one this folder's OWN installation was made from.
634
- *
635
- * An installation's marketplace is chosen once, when it is made, and the dashboard every route
636
- * here ends on reads the one it stored — so naming another would be dropped, and a flag dropped
637
- * reads as honoured. Project-scoped detection, because a project with no installation of its
638
- * own is not refused for the global one above it: that is two installations, and the setup the
639
- * dashboard's Edit runs there takes the named marketplace. At the home directory the folder's
640
- * own installation IS the global one, and the same detection finds it.
641
- *
642
- * The stored marketplace is resolved the way every later command resolves it — this folder's
643
- * config, then the global one, then the default — so an installation that recorded none is
644
- * held to the one it has actually been reading. A folder named back by another spelling of its
645
- * path is that same marketplace.
646
- */
647
- async refuseMarketplaceOtherThanTheInstalledOne(projectDir, named) {
648
- if (named === void 0) return;
649
- if (!await detectProjectInstallation(projectDir)) return;
650
- const { source: stored } = await resolveSource({ caller: "stored", projectDir });
651
- if (isSameMarketplace(named, stored, projectDir)) return;
652
- this.error(marketplaceFixedAtInstall(stored, named), { exit: EXIT_CODES.INVALID_ARGS });
653
- }
654
592
  async loadSourceOrFail(flags) {
655
593
  try {
656
594
  const loaded = await loadSource({
@@ -667,33 +605,18 @@ var Init = class _Init extends BaseCommand {
667
605
  });
668
606
  }
669
607
  }
670
- /**
671
- * `init`'s wizard opens on an empty selection, and can open on nothing else: it is reached
672
- * only once {@link showDashboardIfInitialized} has found no installation, and that check
673
- * falls back to the home directory — so a global roster to hydrate from would have diverted
674
- * this run to the dashboard before the wizard was built. Hydrating a saved selection is
675
- * `edit`'s job, and `Edit.runEditWizard` is where it happens.
676
- */
677
- async runWizard(startupMessages, isGlobalRoot) {
678
- return runWizardSession({
679
- hydrate: { isEditingFromGlobalScope: isGlobalRoot },
680
- props: {
681
- version: this.config.version,
682
- logo: ASCII_LOGO,
683
- startupMessages
684
- },
685
- onCancel: () => this.log("Setup cancelled"),
686
- clearTerminal: () => this.clearTerminal()
687
- });
688
- }
689
- async handleInstallation(result, sourceResult, flags, interactive, installedAlready) {
608
+ async handleInstallation({
609
+ result,
610
+ sourceResult,
611
+ sourceFlags,
612
+ installedAlready
613
+ }) {
690
614
  const projectDir = process.cwd();
691
615
  const activeSkills = result.skills.filter((s) => !s.excluded);
692
616
  const toInstall = activeSkills.filter((s) => !installedAlready.has(s.id));
693
617
  const installMode = deriveInstallMode(toInstall);
694
618
  const ejectedSkills = toInstall.filter((s) => s.origin === EJECT_SOURCE);
695
619
  const pluginSkills = toInstall.filter((s) => s.origin !== EJECT_SOURCE);
696
- this.refuseUnofferablePlacementsBeforeWriting(activeSkills, projectDir);
697
620
  this.logInstallPlan(installMode, ejectedSkills, pluginSkills);
698
621
  const resolvedMarketplace = pluginSkills.length > 0 ? await this.requireMarketplaceOrExit(
699
622
  sourceResult,
@@ -715,7 +638,7 @@ var Init = class _Init extends BaseCommand {
715
638
  const { configResult, compileResult, agentScopeMap } = await this.writeConfigAndCompile(
716
639
  result,
717
640
  sourceResult,
718
- flags
641
+ sourceFlags
719
642
  );
720
643
  this.reportSuccess(
721
644
  configResult,
@@ -725,28 +648,21 @@ var Init = class _Init extends BaseCommand {
725
648
  pluginModeSucceeded,
726
649
  copyResult
727
650
  );
728
- await this.showPermissionNotice(projectDir, interactive);
651
+ await this.showPermissionNotice(projectDir);
729
652
  } catch (error) {
730
653
  this.handleError(error);
731
654
  }
732
655
  }
733
656
  /**
734
657
  * The permission notice, where there is one to show. It is an Ink app with no exit of its own,
735
- * so `waitUntilExit()` only ever resolves because a person is there to end it — which is fine
736
- * after the wizard and a hang everywhere else. Without a terminal to hold, one frame is
737
- * rendered and let go: the notice is information, not a prompt, so there is nothing to answer
738
- * and nothing to wait for.
658
+ * so one frame is rendered and let go: the notice is information, not a prompt, and `--from`
659
+ * has to complete over a pipe and in CI.
739
660
  */
740
- async showPermissionNotice(projectDir, interactive) {
661
+ async showPermissionNotice(projectDir) {
741
662
  const permissionWarning = await checkPermissions(projectDir);
742
663
  if (!permissionWarning) return;
743
- if (!interactive) {
744
- const { unmount } = render(permissionWarning);
745
- unmount();
746
- return;
747
- }
748
- const { waitUntilExit } = render(permissionWarning);
749
- await waitUntilExit();
664
+ const { unmount } = render(permissionWarning);
665
+ unmount();
750
666
  }
751
667
  logInstallPlan(installMode, ejectedSkills, pluginSkills) {
752
668
  this.log("\n");
@@ -768,7 +684,7 @@ var Init = class _Init extends BaseCommand {
768
684
  async writeConfigAndCompile(result, sourceResult, flags) {
769
685
  this.log("Generating configuration...");
770
686
  const configResult = await writeProjectConfig({
771
- wizardResult: result,
687
+ selection: result,
772
688
  sourceResult,
773
689
  projectDir: process.cwd(),
774
690
  ...flags.marketplace !== void 0 && { sourceFlag: flags.marketplace }
@@ -943,6 +859,9 @@ var Init = class _Init extends BaseCommand {
943
859
  }
944
860
  }
945
861
  };
862
+ function opensTheEditor(flags) {
863
+ return flags.ui || flags.from === void 0 && flags.marketplace !== void 0;
864
+ }
946
865
  function selectsNothing(result) {
947
866
  return result.skills.length === 0 && result.selectedAgents.length === 0;
948
867
  }
@@ -1021,4 +940,4 @@ export {
1021
940
  Init,
1022
941
  getDashboardData
1023
942
  };
1024
- //# sourceMappingURL=chunk-P6I72PR3.js.map
943
+ //# sourceMappingURL=chunk-NCWDK6L7.js.map