agents-inc 0.164.0 → 0.165.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 (191) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +8 -9
  3. package/dist/{chunk-B6FSLXYN.js → chunk-42TNV2TK.js} +3 -3
  4. package/dist/chunk-4AAOOAIN.js +49 -0
  5. package/dist/chunk-4AAOOAIN.js.map +1 -0
  6. package/dist/{chunk-NQXO4LR3.js → chunk-4C7GL4F7.js} +16 -11
  7. package/dist/chunk-4C7GL4F7.js.map +1 -0
  8. package/dist/{chunk-Q4IRRVXK.js → chunk-57KU6SPH.js} +3 -3
  9. package/dist/{chunk-S63LXWMC.js → chunk-5M3PQNXI.js} +2 -2
  10. package/dist/{chunk-3WVH2CTK.js → chunk-5P26XBZO.js} +15 -8
  11. package/dist/chunk-5P26XBZO.js.map +1 -0
  12. package/dist/{chunk-G2JJ5BO5.js → chunk-6AIZPSEI.js} +337 -140
  13. package/dist/chunk-6AIZPSEI.js.map +1 -0
  14. package/dist/{chunk-NKGYKOB7.js → chunk-6CY6PW5X.js} +7 -8
  15. package/dist/chunk-6CY6PW5X.js.map +1 -0
  16. package/dist/{chunk-XHPWTL4I.js → chunk-6SW6SB7H.js} +3 -3
  17. package/dist/chunk-AAWZED5M.js +980 -0
  18. package/dist/chunk-AAWZED5M.js.map +1 -0
  19. package/dist/{chunk-UITEKY2R.js → chunk-AQXKAPCD.js} +30 -4
  20. package/dist/chunk-AQXKAPCD.js.map +1 -0
  21. package/dist/{chunk-X4SSJZLY.js → chunk-B5UUHBAM.js} +12 -261
  22. package/dist/chunk-B5UUHBAM.js.map +1 -0
  23. package/dist/{chunk-ARYNOWKF.js → chunk-BGU25XAY.js} +8 -8
  24. package/dist/{chunk-QGUP3QJF.js → chunk-CBMAO6OP.js} +22 -18
  25. package/dist/{chunk-QGUP3QJF.js.map → chunk-CBMAO6OP.js.map} +1 -1
  26. package/dist/{chunk-YRS3QZP2.js → chunk-CEBDGZID.js} +3 -3
  27. package/dist/{chunk-ABAZMMG4.js → chunk-CK5RM3DJ.js} +2 -2
  28. package/dist/{chunk-PHCPUQVR.js → chunk-CTUJO23Z.js} +2 -2
  29. package/dist/{chunk-QZX7SYKU.js → chunk-E6CHHXGY.js} +2 -2
  30. package/dist/{chunk-ZVXGW2IC.js → chunk-F2ZWFWTP.js} +4 -6
  31. package/dist/chunk-F2ZWFWTP.js.map +1 -0
  32. package/dist/{chunk-AVK2HEKB.js → chunk-GKPW33FP.js} +2 -6
  33. package/dist/{chunk-AVK2HEKB.js.map → chunk-GKPW33FP.js.map} +1 -1
  34. package/dist/{chunk-ECURHW3T.js → chunk-HR4YDSJK.js} +13 -12
  35. package/dist/chunk-HR4YDSJK.js.map +1 -0
  36. package/dist/{chunk-XPDVAJDH.js → chunk-IM45LLQX.js} +3599 -1558
  37. package/dist/chunk-IM45LLQX.js.map +1 -0
  38. package/dist/chunk-IVNKU4DM.js +39 -0
  39. package/dist/chunk-IVNKU4DM.js.map +1 -0
  40. package/dist/{chunk-XVAQG2CV.js → chunk-JOEA52NR.js} +10 -8
  41. package/dist/chunk-JOEA52NR.js.map +1 -0
  42. package/dist/{chunk-RGYDFBCT.js → chunk-JV4TKXEN.js} +5 -5
  43. package/dist/{chunk-4VL3CEOS.js → chunk-LXXGZAD3.js} +3 -3
  44. package/dist/chunk-MBUGQI2M.js +73 -0
  45. package/dist/chunk-MBUGQI2M.js.map +1 -0
  46. package/dist/{chunk-URXIQE7I.js → chunk-MWDY76MT.js} +2 -2
  47. package/dist/{chunk-V5GLL2JB.js → chunk-P3KJCYSR.js} +7 -7
  48. package/dist/{chunk-6MV4JOCL.js → chunk-PSX7CT6V.js} +2 -2
  49. package/dist/{chunk-B3Y3QMWI.js → chunk-TRTVOVHR.js} +4 -4
  50. package/dist/{chunk-AOTCIUGX.js → chunk-TV5Y53R2.js} +2 -2
  51. package/dist/{chunk-K5ITEA3I.js → chunk-UBSSIIWD.js} +34 -17
  52. package/dist/chunk-UBSSIIWD.js.map +1 -0
  53. package/dist/chunk-UCORXS4D.js +250 -0
  54. package/dist/chunk-UCORXS4D.js.map +1 -0
  55. package/dist/chunk-UR3RRTPO.js +159 -0
  56. package/dist/chunk-UR3RRTPO.js.map +1 -0
  57. package/dist/chunk-V5CWACR5.js +375 -0
  58. package/dist/chunk-V5CWACR5.js.map +1 -0
  59. package/dist/{chunk-LT5GXEB2.js → chunk-VPJUCVU7.js} +8 -7
  60. package/dist/chunk-VPJUCVU7.js.map +1 -0
  61. package/dist/chunk-VRXX4D6K.js +31 -0
  62. package/dist/chunk-VRXX4D6K.js.map +1 -0
  63. package/dist/{chunk-2CQNPLVF.js → chunk-WIFIAQZU.js} +63 -42
  64. package/dist/chunk-WIFIAQZU.js.map +1 -0
  65. package/dist/chunk-WSGX4IWC.js +356 -0
  66. package/dist/chunk-WSGX4IWC.js.map +1 -0
  67. package/dist/{chunk-X37UYIE3.js → chunk-WTANOSXK.js} +436 -739
  68. package/dist/chunk-WTANOSXK.js.map +1 -0
  69. package/dist/{chunk-XATLUKXK.js → chunk-X2KUI7V3.js} +6 -6
  70. package/dist/{chunk-NTF4UXGK.js → chunk-XATIKM3P.js} +73 -30
  71. package/dist/chunk-XATIKM3P.js.map +1 -0
  72. package/dist/{chunk-J27W6TXS.js → chunk-XQHZPINL.js} +8 -4
  73. package/dist/chunk-XQHZPINL.js.map +1 -0
  74. package/dist/{chunk-DSL66I4N.js → chunk-Y5SNGMB7.js} +6 -6
  75. package/dist/{chunk-7REKOTKG.js → chunk-YNOOZFIB.js} +3 -3
  76. package/dist/commands/build/marketplace.js +17 -17
  77. package/dist/commands/build/marketplace.js.map +1 -1
  78. package/dist/commands/build/plugins.js +11 -9
  79. package/dist/commands/build/plugins.js.map +1 -1
  80. package/dist/commands/compile.js +106 -27
  81. package/dist/commands/compile.js.map +1 -1
  82. package/dist/commands/doctor.js +427 -192
  83. package/dist/commands/doctor.js.map +1 -1
  84. package/dist/commands/edit.js +504 -314
  85. package/dist/commands/edit.js.map +1 -1
  86. package/dist/commands/eject.js +41 -23
  87. package/dist/commands/eject.js.map +1 -1
  88. package/dist/commands/init.js +44 -40
  89. package/dist/commands/list.js +44 -10
  90. package/dist/commands/list.js.map +1 -1
  91. package/dist/commands/new/marketplace.js +13 -10
  92. package/dist/commands/new/marketplace.js.map +1 -1
  93. package/dist/commands/search.js +12 -10
  94. package/dist/commands/search.js.map +1 -1
  95. package/dist/commands/share.js +103 -15
  96. package/dist/commands/share.js.map +1 -1
  97. package/dist/commands/uninstall.js +264 -106
  98. package/dist/commands/uninstall.js.map +1 -1
  99. package/dist/commands/update.js +50 -20
  100. package/dist/commands/update.js.map +1 -1
  101. package/dist/components/common/prompt-confirm.js +1 -1
  102. package/dist/components/common/removal-plan-confirm.js +2 -2
  103. package/dist/components/common/select-list.js +3 -3
  104. package/dist/components/common/spinner.js +6 -3
  105. package/dist/components/wizard/category-grid.js +5 -5
  106. package/dist/components/wizard/checkbox-grid.js +4 -4
  107. package/dist/components/wizard/domain-selection.js +9 -9
  108. package/dist/components/wizard/run-wizard-session.js +29 -29
  109. package/dist/components/wizard/scroll-affordance.js +2 -2
  110. package/dist/components/wizard/skill-agent-summary.js +5 -5
  111. package/dist/components/wizard/source-grid.js +6 -6
  112. package/dist/components/wizard/stack-selection.js +8 -8
  113. package/dist/components/wizard/step-agents.js +8 -8
  114. package/dist/components/wizard/step-build.js +8 -8
  115. package/dist/components/wizard/step-confirm.js +9 -9
  116. package/dist/components/wizard/step-sources.js +9 -9
  117. package/dist/components/wizard/step-stack.js +9 -9
  118. package/dist/components/wizard/summary-panel.js +8 -8
  119. package/dist/components/wizard/toast.js +2 -2
  120. package/dist/components/wizard/wizard-layout.js +12 -12
  121. package/dist/components/wizard/wizard-tabs.js +2 -2
  122. package/dist/components/wizard/wizard.js +27 -27
  123. package/dist/hooks/init.js +59 -43
  124. package/dist/hooks/init.js.map +1 -1
  125. package/dist/load-agent-defs-JHLE6MAE.js +14 -0
  126. package/dist/recompile-project-agents-ZPP5NOLZ.js +18 -0
  127. package/dist/{source-loader-GRBVNRAW.js → source-loader-RWZAYJ7E.js} +6 -4
  128. package/dist/src/agents/_templates/agent-body.liquid +55 -0
  129. package/dist/src/agents/_templates/agent.liquid +1 -55
  130. package/dist/src/agents/meta/agent-summoner/output.md +1 -1
  131. package/dist/src/agents/meta/agent-summoner/playbook.md +15 -7
  132. package/dist/stores/wizard-store.js +4 -4
  133. package/package.json +10 -9
  134. package/src/agents/_templates/agent-body.liquid +55 -0
  135. package/src/agents/_templates/agent.liquid +1 -55
  136. package/src/agents/meta/agent-summoner/output.md +1 -1
  137. package/src/agents/meta/agent-summoner/playbook.md +15 -7
  138. package/src/schemas/project-config.schema.json +1 -1
  139. package/src/schemas/project-source-config.schema.json +1 -1
  140. package/dist/chunk-2CQNPLVF.js.map +0 -1
  141. package/dist/chunk-3WVH2CTK.js.map +0 -1
  142. package/dist/chunk-7ANJQLPJ.js +0 -35
  143. package/dist/chunk-7ANJQLPJ.js.map +0 -1
  144. package/dist/chunk-ECURHW3T.js.map +0 -1
  145. package/dist/chunk-FLW25ORT.js +0 -130
  146. package/dist/chunk-FLW25ORT.js.map +0 -1
  147. package/dist/chunk-G2JJ5BO5.js.map +0 -1
  148. package/dist/chunk-J27W6TXS.js.map +0 -1
  149. package/dist/chunk-JCPANDNR.js +0 -35
  150. package/dist/chunk-JCPANDNR.js.map +0 -1
  151. package/dist/chunk-JIERYE6B.js +0 -480
  152. package/dist/chunk-JIERYE6B.js.map +0 -1
  153. package/dist/chunk-JU4ZGJ7A.js +0 -668
  154. package/dist/chunk-JU4ZGJ7A.js.map +0 -1
  155. package/dist/chunk-K5ITEA3I.js.map +0 -1
  156. package/dist/chunk-LT5GXEB2.js.map +0 -1
  157. package/dist/chunk-NKGYKOB7.js.map +0 -1
  158. package/dist/chunk-NQXO4LR3.js.map +0 -1
  159. package/dist/chunk-NTF4UXGK.js.map +0 -1
  160. package/dist/chunk-UITEKY2R.js.map +0 -1
  161. package/dist/chunk-X37UYIE3.js.map +0 -1
  162. package/dist/chunk-X4SSJZLY.js.map +0 -1
  163. package/dist/chunk-XPDVAJDH.js.map +0 -1
  164. package/dist/chunk-XVAQG2CV.js.map +0 -1
  165. package/dist/chunk-ZBPEFQ4G.js +0 -12
  166. package/dist/chunk-ZBPEFQ4G.js.map +0 -1
  167. package/dist/chunk-ZVXGW2IC.js.map +0 -1
  168. package/dist/load-agent-defs-7IM3GBEQ.js +0 -13
  169. package/dist/recompile-project-agents-VR4NLGOU.js +0 -17
  170. /package/dist/{chunk-B6FSLXYN.js.map → chunk-42TNV2TK.js.map} +0 -0
  171. /package/dist/{chunk-Q4IRRVXK.js.map → chunk-57KU6SPH.js.map} +0 -0
  172. /package/dist/{chunk-S63LXWMC.js.map → chunk-5M3PQNXI.js.map} +0 -0
  173. /package/dist/{chunk-XHPWTL4I.js.map → chunk-6SW6SB7H.js.map} +0 -0
  174. /package/dist/{chunk-ARYNOWKF.js.map → chunk-BGU25XAY.js.map} +0 -0
  175. /package/dist/{chunk-YRS3QZP2.js.map → chunk-CEBDGZID.js.map} +0 -0
  176. /package/dist/{chunk-ABAZMMG4.js.map → chunk-CK5RM3DJ.js.map} +0 -0
  177. /package/dist/{chunk-PHCPUQVR.js.map → chunk-CTUJO23Z.js.map} +0 -0
  178. /package/dist/{chunk-QZX7SYKU.js.map → chunk-E6CHHXGY.js.map} +0 -0
  179. /package/dist/{chunk-RGYDFBCT.js.map → chunk-JV4TKXEN.js.map} +0 -0
  180. /package/dist/{chunk-4VL3CEOS.js.map → chunk-LXXGZAD3.js.map} +0 -0
  181. /package/dist/{chunk-URXIQE7I.js.map → chunk-MWDY76MT.js.map} +0 -0
  182. /package/dist/{chunk-V5GLL2JB.js.map → chunk-P3KJCYSR.js.map} +0 -0
  183. /package/dist/{chunk-6MV4JOCL.js.map → chunk-PSX7CT6V.js.map} +0 -0
  184. /package/dist/{chunk-B3Y3QMWI.js.map → chunk-TRTVOVHR.js.map} +0 -0
  185. /package/dist/{chunk-AOTCIUGX.js.map → chunk-TV5Y53R2.js.map} +0 -0
  186. /package/dist/{chunk-XATLUKXK.js.map → chunk-X2KUI7V3.js.map} +0 -0
  187. /package/dist/{chunk-DSL66I4N.js.map → chunk-Y5SNGMB7.js.map} +0 -0
  188. /package/dist/{chunk-7REKOTKG.js.map → chunk-YNOOZFIB.js.map} +0 -0
  189. /package/dist/{load-agent-defs-7IM3GBEQ.js.map → load-agent-defs-JHLE6MAE.js.map} +0 -0
  190. /package/dist/{recompile-project-agents-VR4NLGOU.js.map → recompile-project-agents-ZPP5NOLZ.js.map} +0 -0
  191. /package/dist/{source-loader-GRBVNRAW.js.map → source-loader-RWZAYJ7E.js.map} +0 -0
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ConfigLoadError,
4
+ configDirsInPlay,
5
+ getErrorMessage,
6
+ hostAt,
7
+ loadInstalledConfig,
8
+ refuseUnofferedPlacements
9
+ } from "./chunk-IM45LLQX.js";
10
+
11
+ // src/cli/lib/hosts/configured-placements.ts
12
+ async function unofferablePlacementsFound(cwd) {
13
+ const findings = await Promise.all(configDirsInPlay(cwd).map(unofferablePlacementIn));
14
+ return findings.filter((finding) => finding !== null);
15
+ }
16
+ async function unofferablePlacementIn(root) {
17
+ const skills = await configuredSkillsAt(root);
18
+ if (skills === null) return null;
19
+ try {
20
+ refuseUnofferedPlacements(skills, hostAt(root));
21
+ return null;
22
+ } catch (error) {
23
+ return getErrorMessage(error);
24
+ }
25
+ }
26
+ async function configuredSkillsAt(root) {
27
+ try {
28
+ const loaded = await loadInstalledConfig(root);
29
+ return loaded?.config.skills ?? null;
30
+ } catch (error) {
31
+ if (error instanceof ConfigLoadError) return null;
32
+ throw error;
33
+ }
34
+ }
35
+
36
+ export {
37
+ unofferablePlacementsFound
38
+ };
39
+ //# sourceMappingURL=chunk-IVNKU4DM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/hosts/configured-placements.ts"],"sourcesContent":["/**\n * The placement refusal on the READ path: every command that acts on a configuration it did not\n * just write asks whether that configuration's host can place what it asks for.\n *\n * **Nothing ties a folder's contents to its name, and the ruling forbids the field that would.**\n * `config.ts` carries no provider — that is what keeps one saved configuration installable onto\n * either provider and every existing share id working — so a user who reads \"the folder says the\n * provider\" and copies `.agents-inc/claude/` to `.agents-inc/codex/` has a Codex installation\n * holding a configuration that never passed through `init --from --provider codex` and never met\n * its pre-flight. Every later command reads that file.\n *\n * **It reaches `compile`, `edit`, `update`, `share` and `doctor`, and it reached `compile` alone\n * until now.** The others were the half that made the refusal look complete while leaving the\n * configuration reachable: `edit` writes it, `update` acts on the marketplaces it names, `share`\n * publishes it to the store as \"what is installed here\", and `doctor` — the command whose whole\n * job is saying whether an installation is healthy — pronounced a clean bill of health on a\n * configuration no other command would act on. A diagnostic that disagrees with every command it\n * is diagnosing is worse than a missing one.\n *\n * **`share` was missing from that roster until 2026-09-22 while the roster claimed to be\n * complete**, which is the more expensive half of the defect: a list that names four commands and\n * says \"every such command\" stops anyone looking for a fifth. It was found by driving the commands\n * rather than by reading this sentence.\n *\n * **`uninstall` reads the same file and is deliberately not on the roster.** A refusal there would\n * make an unofferable installation unremovable, which is a guard that has swallowed its own\n * domain — the shape this package's rule against unpaired refusals is written about.\n *\n * **Doctor's is a ROW and the other four are refusals**, which is the same distinction\n * `BaseCommand.settleSourceLayoutBeforeWriting` already draws: a command that changes nothing must\n * not refuse to LOOK, because the state it is reporting on is exactly the state a user needs to\n * see. {@link unofferablePlacementsFound} is the shared reading and each caller decides its own\n * posture from it.\n *\n * One message, from one roster, at every door — `refuseUnofferedPlacements` reads the host's own\n * `offeredPlacements` — so the sentence a user gets from `compile` names the same cells the one\n * from `init` does. A second spelling written at the read path would be a second thing to keep\n * true.\n */\n\nimport {\n ConfigLoadError,\n configDirsInPlay,\n loadInstalledConfig,\n} from \"../configuration/project-config.js\";\nimport { getErrorMessage } from \"../../utils/errors.js\";\nimport type { SkillConfig } from \"../../types/config.js\";\nimport { hostAt } from \"./host-for.js\";\nimport { refuseUnofferedPlacements } from \"./offered-placements.js\";\n\n/**\n * Every unofferable-placement finding a run from `cwd` would meet, in the order it reads them.\n *\n * Both scopes, because a project inherits its global's rows and an unofferable row in either file\n * is a row the run would act on. Each installation is asked about its OWN host: two scopes can be\n * on different providers, and asking one host about the other's configuration is how a refusal\n * fires on a cell that is offered where the skill actually lives.\n *\n * **A config that exists and cannot be LOADED contributes nothing here**, and that is a posture\n * rather than an oversight: `BaseCommand.ensureConfigReadable` and `doctor`'s own Config row both\n * report that fault by name, and a second report of it wearing this refusal's words would name the\n * wrong cause. Only `ConfigLoadError` degrades — anything else is a real fault and propagates.\n */\nexport async function unofferablePlacementsFound(cwd: string): Promise<string[]> {\n const findings = await Promise.all(configDirsInPlay(cwd).map(unofferablePlacementIn));\n return findings.filter((finding): finding is string => finding !== null);\n}\n\n/** The finding one scope's configuration produces, or `null` when its host can place every row. */\nasync function unofferablePlacementIn(root: string): Promise<string | null> {\n const skills = await configuredSkillsAt(root);\n if (skills === null) return null;\n\n try {\n refuseUnofferedPlacements(skills, hostAt(root));\n return null;\n } catch (error) {\n return getErrorMessage(error);\n }\n}\n\n/**\n * The rows one scope's configuration carries, and `null` where there is nothing to ask about.\n *\n * DEGRADE posture, and only for `ConfigLoadError`: a configuration that exists and cannot be\n * parsed is a finding `ensureConfigReadable` and doctor's Config row each report by name, and\n * repeating it in this refusal's words would name the wrong cause. Every other failure is a real\n * fault and propagates, as `findConfigLoadFailures` does one module over.\n */\nasync function configuredSkillsAt(root: string): Promise<SkillConfig[] | null> {\n try {\n const loaded = await loadInstalledConfig(root);\n return loaded?.config.skills ?? null;\n } catch (error) {\n if (error instanceof ConfigLoadError) return null;\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;AA+DA,eAAsB,2BAA2B,KAAgC;AAC/E,QAAM,WAAW,MAAM,QAAQ,IAAI,iBAAiB,GAAG,EAAE,IAAI,sBAAsB,CAAC;AACpF,SAAO,SAAS,OAAO,CAAC,YAA+B,YAAY,IAAI;AACzE;AAGA,eAAe,uBAAuB,MAAsC;AAC1E,QAAM,SAAS,MAAM,mBAAmB,IAAI;AAC5C,MAAI,WAAW,KAAM,QAAO;AAE5B,MAAI;AACF,8BAA0B,QAAQ,OAAO,IAAI,CAAC;AAC9C,WAAO;AAAA,EACT,SAAS,OAAO;AACd,WAAO,gBAAgB,KAAK;AAAA,EAC9B;AACF;AAUA,eAAe,mBAAmB,MAA6C;AAC7E,MAAI;AACF,UAAM,SAAS,MAAM,oBAAoB,IAAI;AAC7C,WAAO,QAAQ,OAAO,UAAU;AAAA,EAClC,SAAS,OAAO;AACd,QAAI,iBAAiB,gBAAiB,QAAO;AAC7C,UAAM;AAAA,EACR;AACF;","names":[]}
@@ -1,16 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli/components/hooks/use-keyboard-navigation.ts
4
- import { useState, useCallback, useRef, useEffect } from "react";
4
+ import { useState, useCallback, useRef } from "react";
5
5
  import { useInput } from "ink";
6
6
  function useKeyboardNavigation(itemCount, handlers = {}, options = {}) {
7
7
  const { onEnter, onEscape } = handlers;
8
8
  const { wrap = true, vimKeys = true, active = true } = options;
9
- const [focusedIndex, setFocusedIndex] = useState(0);
9
+ const [focusedIndex, setRenderedIndex] = useState(0);
10
10
  const focusedIndexRef = useRef(focusedIndex);
11
- useEffect(() => {
12
- focusedIndexRef.current = focusedIndex;
13
- }, [focusedIndex]);
11
+ const setFocusedIndex = useCallback((action) => {
12
+ const next = typeof action === "function" ? action(focusedIndexRef.current) : action;
13
+ focusedIndexRef.current = next;
14
+ setRenderedIndex(next);
15
+ }, []);
14
16
  const moveUp = useCallback(() => {
15
17
  setFocusedIndex((prev) => {
16
18
  if (wrap) {
@@ -18,7 +20,7 @@ function useKeyboardNavigation(itemCount, handlers = {}, options = {}) {
18
20
  }
19
21
  return Math.max(0, prev - 1);
20
22
  });
21
- }, [itemCount, wrap]);
23
+ }, [itemCount, wrap, setFocusedIndex]);
22
24
  const moveDown = useCallback(() => {
23
25
  setFocusedIndex((prev) => {
24
26
  if (wrap) {
@@ -26,7 +28,7 @@ function useKeyboardNavigation(itemCount, handlers = {}, options = {}) {
26
28
  }
27
29
  return Math.min(itemCount - 1, prev + 1);
28
30
  });
29
- }, [itemCount, wrap]);
31
+ }, [itemCount, wrap, setFocusedIndex]);
30
32
  useInput(
31
33
  useCallback(
32
34
  (input, key) => {
@@ -56,4 +58,4 @@ function useKeyboardNavigation(itemCount, handlers = {}, options = {}) {
56
58
  export {
57
59
  useKeyboardNavigation
58
60
  };
59
- //# sourceMappingURL=chunk-XVAQG2CV.js.map
61
+ //# sourceMappingURL=chunk-JOEA52NR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/components/hooks/use-keyboard-navigation.ts"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\nimport { useState, useCallback, useRef } from \"react\";\nimport { useInput, type Key } from \"ink\";\n\ntype KeyboardNavigationHandlers = {\n onEnter?: (focusedIndex: number) => void;\n onEscape?: () => void;\n};\n\ntype KeyboardNavigationOptions = {\n wrap?: boolean;\n vimKeys?: boolean;\n active?: boolean;\n};\n\nexport function useKeyboardNavigation(\n itemCount: number,\n handlers: KeyboardNavigationHandlers = {},\n options: KeyboardNavigationOptions = {},\n): {\n focusedIndex: number;\n setFocusedIndex: Dispatch<SetStateAction<number>>;\n} {\n const { onEnter, onEscape } = handlers;\n const { wrap = true, vimKeys = true, active = true } = options;\n\n const [focusedIndex, setRenderedIndex] = useState(0);\n // The focus the handlers read, written the moment it moves rather than once the move renders.\n // Keys that arrive in one chunk — a fast typist, a paste — are handled one after another with no\n // render between them, so a copy synced by an effect still held the focus from before the burst\n // when Enter read it: Down, Down, Enter on the dashboard ran Edit.\n const focusedIndexRef = useRef(focusedIndex);\n\n const setFocusedIndex = useCallback<Dispatch<SetStateAction<number>>>((action) => {\n const next = typeof action === \"function\" ? action(focusedIndexRef.current) : action;\n focusedIndexRef.current = next;\n setRenderedIndex(next);\n }, []);\n\n const moveUp = useCallback(() => {\n setFocusedIndex((prev) => {\n if (wrap) {\n return (prev - 1 + itemCount) % itemCount;\n }\n return Math.max(0, prev - 1);\n });\n }, [itemCount, wrap, setFocusedIndex]);\n\n const moveDown = useCallback(() => {\n setFocusedIndex((prev) => {\n if (wrap) {\n return (prev + 1) % itemCount;\n }\n return Math.min(itemCount - 1, prev + 1);\n });\n }, [itemCount, wrap, setFocusedIndex]);\n\n useInput(\n useCallback(\n (input: string, key: Key) => {\n if (key.escape) {\n onEscape?.();\n return;\n }\n\n if (key.return) {\n onEnter?.(focusedIndexRef.current);\n return;\n }\n\n if (key.upArrow || (vimKeys && input === \"k\")) {\n moveUp();\n return;\n }\n\n if (key.downArrow || (vimKeys && input === \"j\")) {\n moveDown();\n }\n },\n [onEnter, onEscape, vimKeys, moveUp, moveDown],\n ),\n { isActive: active },\n );\n\n return { focusedIndex, setFocusedIndex };\n}\n"],"mappings":";;;AACA,SAAS,UAAU,aAAa,cAAc;AAC9C,SAAS,gBAA0B;AAa5B,SAAS,sBACd,WACA,WAAuC,CAAC,GACxC,UAAqC,CAAC,GAItC;AACA,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,EAAE,OAAO,MAAM,UAAU,MAAM,SAAS,KAAK,IAAI;AAEvD,QAAM,CAAC,cAAc,gBAAgB,IAAI,SAAS,CAAC;AAKnD,QAAM,kBAAkB,OAAO,YAAY;AAE3C,QAAM,kBAAkB,YAA8C,CAAC,WAAW;AAChF,UAAM,OAAO,OAAO,WAAW,aAAa,OAAO,gBAAgB,OAAO,IAAI;AAC9E,oBAAgB,UAAU;AAC1B,qBAAiB,IAAI;AAAA,EACvB,GAAG,CAAC,CAAC;AAEL,QAAM,SAAS,YAAY,MAAM;AAC/B,oBAAgB,CAAC,SAAS;AACxB,UAAI,MAAM;AACR,gBAAQ,OAAO,IAAI,aAAa;AAAA,MAClC;AACA,aAAO,KAAK,IAAI,GAAG,OAAO,CAAC;AAAA,IAC7B,CAAC;AAAA,EACH,GAAG,CAAC,WAAW,MAAM,eAAe,CAAC;AAErC,QAAM,WAAW,YAAY,MAAM;AACjC,oBAAgB,CAAC,SAAS;AACxB,UAAI,MAAM;AACR,gBAAQ,OAAO,KAAK;AAAA,MACtB;AACA,aAAO,KAAK,IAAI,YAAY,GAAG,OAAO,CAAC;AAAA,IACzC,CAAC;AAAA,EACH,GAAG,CAAC,WAAW,MAAM,eAAe,CAAC;AAErC;AAAA,IACE;AAAA,MACE,CAAC,OAAe,QAAa;AAC3B,YAAI,IAAI,QAAQ;AACd,qBAAW;AACX;AAAA,QACF;AAEA,YAAI,IAAI,QAAQ;AACd,oBAAU,gBAAgB,OAAO;AACjC;AAAA,QACF;AAEA,YAAI,IAAI,WAAY,WAAW,UAAU,KAAM;AAC7C,iBAAO;AACP;AAAA,QACF;AAEA,YAAI,IAAI,aAAc,WAAW,UAAU,KAAM;AAC/C,mBAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,CAAC,SAAS,UAAU,SAAS,QAAQ,QAAQ;AAAA,IAC/C;AAAA,IACA,EAAE,UAAU,OAAO;AAAA,EACrB;AAEA,SAAO,EAAE,cAAc,gBAAgB;AACzC;","names":[]}
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Wizard
4
- } from "./chunk-ECURHW3T.js";
4
+ } from "./chunk-HR4YDSJK.js";
5
5
  import {
6
6
  promptValue
7
- } from "./chunk-JCPANDNR.js";
7
+ } from "./chunk-4AAOOAIN.js";
8
8
  import {
9
9
  hydrateWizardStore
10
- } from "./chunk-K5ITEA3I.js";
10
+ } from "./chunk-UBSSIIWD.js";
11
11
  import {
12
12
  disableBuffering,
13
13
  drainBuffer,
14
14
  enableBuffering
15
- } from "./chunk-XPDVAJDH.js";
15
+ } from "./chunk-IM45LLQX.js";
16
16
 
17
17
  // src/cli/components/wizard/run-wizard-session.tsx
18
18
  import "react";
@@ -50,4 +50,4 @@ async function runWizardSession(options) {
50
50
  export {
51
51
  runWizardSession
52
52
  };
53
- //# sourceMappingURL=chunk-RGYDFBCT.js.map
53
+ //# sourceMappingURL=chunk-JV4TKXEN.js.map
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  isDomain
4
- } from "./chunk-XPDVAJDH.js";
4
+ } from "./chunk-IM45LLQX.js";
5
5
  import {
6
6
  findStack
7
- } from "./chunk-AVK2HEKB.js";
7
+ } from "./chunk-GKPW33FP.js";
8
8
 
9
9
  // src/cli/components/wizard/utils.ts
10
10
  var DOMAIN_DISPLAY_NAMES = {
@@ -32,4 +32,4 @@ export {
32
32
  getDomainDisplayName,
33
33
  getStackName
34
34
  };
35
- //# sourceMappingURL=chunk-4VL3CEOS.js.map
35
+ //# sourceMappingURL=chunk-LXXGZAD3.js.map
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ chooseProviderForThisRun,
4
+ detectInstallations
5
+ } from "./chunk-IM45LLQX.js";
6
+ import {
7
+ CLI_INVOKE_COMMAND,
8
+ EDITOR_URL,
9
+ PROVIDERS
10
+ } from "./chunk-AQXKAPCD.js";
11
+
12
+ // src/cli/lib/installation/provider-flag.ts
13
+ import os from "os";
14
+ import { Flags } from "@oclif/core";
15
+ function providerFlag() {
16
+ return Flags.string({
17
+ description: "Which provider's installation this run is about",
18
+ helpValue: `<${PROVIDERS.join("|")}>`,
19
+ options: [...PROVIDERS]
20
+ });
21
+ }
22
+ function providerNamedBy(flagValue) {
23
+ if (flagValue === void 0) return void 0;
24
+ return PROVIDERS.find((provider) => provider === flagValue);
25
+ }
26
+ function providerNeedsAConfigurationToInstall() {
27
+ return `--provider names which installation to create and needs the configuration to create it from, so it is only meaningful beside --from. Build one at ${EDITOR_URL}, then run '${CLI_INVOKE_COMMAND} init --from <id> --provider <provider>'.`;
28
+ }
29
+ function ambiguousInstallation(subject, providers, scopeRoot) {
30
+ return `${scopeRoot} holds ${providers.length} installations \u2014 ${providers.join(" and ")} \u2014 so ${subject} cannot tell which one you mean. Name it with --provider <${providers.join("|")}>. Nothing has been changed.`;
31
+ }
32
+ async function installationsInPlay(cwd) {
33
+ const found = await detectInstallations(cwd);
34
+ const inTheProject = atScope(found, "project");
35
+ if (inTheProject.length > 0) return { scopeRoot: cwd, providers: providersOf(inTheProject) };
36
+ return { scopeRoot: os.homedir(), providers: providersOf(atScope(found, "global")) };
37
+ }
38
+ function atScope(found, scope) {
39
+ return found.filter((installation) => installation.scope === scope);
40
+ }
41
+ function providersOf(installations) {
42
+ return installations.map((installation) => installation.provider);
43
+ }
44
+ async function refuseAnAmbiguousInstallation(cwd, subject, named, onAmbiguous) {
45
+ if (named !== void 0) {
46
+ chooseProviderForThisRun(named);
47
+ return;
48
+ }
49
+ const { scopeRoot, providers } = await installationsInPlay(cwd);
50
+ if (providers.length <= 1) return;
51
+ onAmbiguous(ambiguousInstallation(subject, providers, scopeRoot));
52
+ }
53
+ async function ambiguityFinding(cwd) {
54
+ const { scopeRoot, providers } = await installationsInPlay(cwd);
55
+ if (providers.length <= 1) return null;
56
+ return ambiguousInstallation("every command that acts on one", providers, scopeRoot);
57
+ }
58
+ async function otherInstallationsInThisScope(cwd, showing) {
59
+ const { scopeRoot, providers } = await installationsInPlay(cwd);
60
+ const others = providers.filter((provider) => provider !== showing);
61
+ if (others.length === 0) return null;
62
+ return `${scopeRoot} holds ${providers.length} installations \u2014 ${providers.join(" and ")} \u2014 and this is the ${showing} one. Show another with --provider <${providers.join("|")}>.`;
63
+ }
64
+
65
+ export {
66
+ providerFlag,
67
+ providerNamedBy,
68
+ providerNeedsAConfigurationToInstall,
69
+ refuseAnAmbiguousInstallation,
70
+ ambiguityFinding,
71
+ otherInstallationsInThisScope
72
+ };
73
+ //# sourceMappingURL=chunk-MBUGQI2M.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/installation/provider-flag.ts"],"sourcesContent":["/**\n * `--provider`: the one flag that names an installation this release cannot read off a folder.\n *\n * **The folder is the record, and this flag is not a second one.** There is no `provider` field in\n * `config.ts`, nothing in a shared payload carries one and a share id encodes none — which is what\n * keeps one saved configuration installable onto either provider and every existing id working.\n * So after an install the folder answers, `providerInUse` reads it, and no command needs a flag.\n * Two questions survive that, and both are the absence of a folder rather than a doubt about one:\n *\n * 1. **A greenfield `init --from <id> --provider codex`** — the folder does not exist yet, so\n * there is nothing to read. This is the flag's whole purpose, and it is why the flag is\n * meaningless without `--from`: the provider is chosen in the web app, so the only run that can\n * be told one is the run that installs what the app produced (D15). A wizard walked to the end\n * and then refused would have spent the user's time before saying so, and there is no wizard\n * step to choose a provider in.\n * 2. **A scope holding BOTH folders** — the disk has two answers, `providerInUse` resolves them by\n * roster order, and a command that acted on the roster's first answer would act on a user's\n * other installation with nothing on screen saying so. `edit`, `uninstall`, `share`, `eject`,\n * `compile` and `update` refuse instead, naming this flag; `list` takes it too and, given no\n * flag, names both installations above the one it is showing —\n * {@link otherInstallationsInThisScope}. **`compile`, `update` and `list` were outside this from C7b\n * until 2026-09-23**, on the reading that a command reading the provider off the FOLDER needs\n * no flag. True of a folder, false of a SCOPE: a scope holds up to one installation per\n * provider, and `providerInUse` then answers by roster order — so the two that write rewrote\n * one of a user's two in silence and the one that reports showed one of them.\n *\n * **The refusal and the selection are one module, deliberately.** A refusal naming a flag that\n * does nothing is worse than neither: the user reads the sentence, types the flag, and the command\n * refuses again or — worse — acts on whichever installation it was going to act on anyway.\n * {@link refuseAnAmbiguousInstallation} is the refusal and {@link chooseProviderForThisRun} is\n * what the flag it names does, and neither can be added without the other.\n *\n * **It was hidden through C6 and is on the help screens from C7b.** Between C4 and C5 a Codex\n * install compiled no sub-agents, so the flag was a user-reachable surface for a provider that\n * was not finished. Hiding it was never disabling it — oclif parses a hidden flag exactly as it\n * parses any other, which is what let the e2e suite drive it throughout and is why no behavioural\n * spec reddened when the hiding came off. The one surface that can tell a shipped flag from an\n * undiscoverable one is help output, so that is where the claim lives:\n * `e2e/commands/provider-is-on-every-help-screen.e2e.test.ts` asserts each command that declares\n * it advertises it with both provider names, and that `doctor` — which reports on every\n * installation in the scope rather than acting on one — does not.\n */\n\nimport os from \"os\";\n\nimport { Flags } from \"@oclif/core\";\n\nimport { PROVIDERS, EDITOR_URL, CLI_INVOKE_COMMAND, type Provider } from \"../../consts.js\";\nimport { detectInstallations, type DetectedInstallation } from \"./detect-installations.js\";\nimport { chooseProviderForThisRun } from \"./install-layout.js\";\n\n/**\n * The flag itself, declared once and built into each command's own `static flags`.\n *\n * `options` is what makes the roster closed: oclif refuses an unlisted value with exit 2 and a\n * message naming every provider there is, so a user who typed one wrong is told the spelling of\n * the one they wanted rather than that something was invalid.\n *\n * A FACTORY rather than a shared constant, for the reason `agentCodec` and\n * `claudeOfferedPlacements` each give: every command declaring it would otherwise hold one object\n * by identity, oclif writes onto a flag definition while building a command's flag map, and\n * nothing in the types says either thing.\n */\nexport function providerFlag() {\n return Flags.string({\n description: \"Which provider's installation this run is about\",\n helpValue: `<${PROVIDERS.join(\"|\")}>`,\n options: [...PROVIDERS],\n });\n}\n\n/**\n * The parsed flag as a {@link Provider}, or `undefined` for a run that named none.\n *\n * oclif has already refused anything outside the roster by the time this is reached — `options`\n * above is checked during `parse` — so the guard here is a narrowing rather than a second\n * validation, and it is written as a membership test rather than a cast because a cast would\n * survive the roster growing a member this switch has never seen.\n */\nexport function providerNamedBy(flagValue: string | undefined): Provider | undefined {\n if (flagValue === undefined) return undefined;\n return PROVIDERS.find((provider) => provider === flagValue);\n}\n\n/**\n * What `init` says when it is handed a provider and no configuration to install.\n *\n * Both halves are load-bearing. `--from` is what the flag needs, and the EDITOR is where an id\n * comes from — a user told only that `--from` is missing has no way to produce one, and the CLI\n * has no step that mints it. The `/editor` segment rather than the apex, because the apex is a\n * landing page that knows nothing about a configuration.\n */\nexport function providerNeedsAConfigurationToInstall(): string {\n return (\n `--provider names which installation to create and needs the configuration to create it ` +\n `from, so it is only meaningful beside --from. Build one at ${EDITOR_URL}, then run ` +\n `'${CLI_INVOKE_COMMAND} init --from <id> --provider <provider>'.`\n );\n}\n\n/**\n * What a command says when the scope it is about holds an installation of each provider.\n *\n * It names both, because \"there is more than one\" leaves the user to go and look; and it names the\n * flag, because the sentence is only worth printing if it says how to answer.\n */\nfunction ambiguousInstallation(\n subject: string,\n providers: readonly Provider[],\n scopeRoot: string,\n): string {\n return (\n `${scopeRoot} holds ${providers.length} installations — ${providers.join(\" and \")} — so ` +\n `${subject} cannot tell which one you mean. Name it with --provider <${providers.join(\"|\")}>. ` +\n `Nothing has been changed.`\n );\n}\n\n/** One scope's installations: the directory they are under, and which providers are there. */\ntype InstallationsInPlay = {\n scopeRoot: string;\n providers: Provider[];\n};\n\n/**\n * The installations a run from `cwd` could act on, and which providers they belong to.\n *\n * The project's own first and the global only when the project has none, which is the fallback\n * every command already walks — a project installation is the subject of a command run inside it,\n * and the global is what a run with no project installation is about. Answering over both at once\n * would refuse a Claude project on a machine whose HOME happens to carry two installations, which\n * is a fact about the machine rather than about this run.\n */\nasync function installationsInPlay(cwd: string): Promise<InstallationsInPlay> {\n const found = await detectInstallations(cwd);\n const inTheProject = atScope(found, \"project\");\n\n if (inTheProject.length > 0) return { scopeRoot: cwd, providers: providersOf(inTheProject) };\n // `os.homedir()` rather than a path derived from a config file, because it is the root\n // `detectInstallations` itself looked under — so the directory the message names is the\n // directory that was read, under a pinned HOME as much as under a real one.\n return { scopeRoot: os.homedir(), providers: providersOf(atScope(found, \"global\")) };\n}\n\n/** The installations one scope root holds. */\nfunction atScope(\n found: readonly DetectedInstallation[],\n scope: DetectedInstallation[\"scope\"],\n): DetectedInstallation[] {\n return found.filter((installation) => installation.scope === scope);\n}\n\n/** Which providers a set of installations belongs to, in the roster order discovery answered in. */\nfunction providersOf(installations: readonly DetectedInstallation[]): Provider[] {\n return installations.map((installation) => installation.provider);\n}\n\n/**\n * Settles which installation a command acts on, and refuses rather than guessing.\n *\n * Three endings, and the middle one is the whole point:\n *\n * - a run TOLD a provider commits to it for every path it builds, through\n * {@link chooseProviderForThisRun}. That is what makes the refusal below actionable.\n * - a scope holding two installations and no flag is refused by `onAmbiguous`, which never\n * returns: half of this — a refusal naming a flag that selects nothing — is worse than neither.\n * - anything else is left exactly as it was, so a scope holding one installation needs no flag and\n * every existing invocation keeps working.\n *\n * `onAmbiguous` is the command's own `this.error`, so the exit code and the rendering are oclif's\n * rather than this module's; it is typed `never` so a caller cannot forget to stop.\n */\nexport async function refuseAnAmbiguousInstallation(\n cwd: string,\n subject: string,\n named: Provider | undefined,\n onAmbiguous: (message: string) => never,\n): Promise<void> {\n if (named !== undefined) {\n chooseProviderForThisRun(named);\n return;\n }\n\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n if (providers.length <= 1) return;\n\n onAmbiguous(ambiguousInstallation(subject, providers, scopeRoot));\n}\n\n/**\n * The same question asked without refusing, for `doctor` — which changes nothing and therefore\n * reports rather than stops.\n *\n * A read-only command that refused would leave a user whose scope holds two installations unable\n * to LOOK at either, which is the one state they most need to see.\n */\nexport async function ambiguityFinding(cwd: string): Promise<string | null> {\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n if (providers.length <= 1) return null;\n\n return ambiguousInstallation(\"every command that acts on one\", providers, scopeRoot);\n}\n\n/**\n * The same question for a command that REPORTS one of the installations — `list`.\n *\n * A third sentence rather than either of the two above, because `list` is in neither of their\n * positions. It writes nothing, so refusing would leave a user unable to LOOK at what they have;\n * and it does not describe the whole scope the way `doctor` does, so \"every command that acts on\n * one\" would be a sentence about other commands printed above a report of one installation. What\n * it owes is the fact its own report omits: there is a second installation here, this is not it,\n * and here is how to ask for the other.\n *\n * `null` where the scope holds one installation, so the ordinary case prints nothing at all.\n */\nexport async function otherInstallationsInThisScope(\n cwd: string,\n showing: Provider,\n): Promise<string | null> {\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n const others = providers.filter((provider) => provider !== showing);\n if (others.length === 0) return null;\n\n return (\n `${scopeRoot} holds ${providers.length} installations — ${providers.join(\" and \")} — and this ` +\n `is the ${showing} one. Show another with --provider <${providers.join(\"|\")}>.`\n );\n}\n"],"mappings":";;;;;;;;;;;;AA2CA,OAAO,QAAQ;AAEf,SAAS,aAAa;AAkBf,SAAS,eAAe;AAC7B,SAAO,MAAM,OAAO;AAAA,IAClB,aAAa;AAAA,IACb,WAAW,IAAI,UAAU,KAAK,GAAG,CAAC;AAAA,IAClC,SAAS,CAAC,GAAG,SAAS;AAAA,EACxB,CAAC;AACH;AAUO,SAAS,gBAAgB,WAAqD;AACnF,MAAI,cAAc,OAAW,QAAO;AACpC,SAAO,UAAU,KAAK,CAAC,aAAa,aAAa,SAAS;AAC5D;AAUO,SAAS,uCAA+C;AAC7D,SACE,qJAC8D,UAAU,eACpE,kBAAkB;AAE1B;AAQA,SAAS,sBACP,SACA,WACA,WACQ;AACR,SACE,GAAG,SAAS,UAAU,UAAU,MAAM,yBAAoB,UAAU,KAAK,OAAO,CAAC,cAC9E,OAAO,6DAA6D,UAAU,KAAK,GAAG,CAAC;AAG9F;AAiBA,eAAe,oBAAoB,KAA2C;AAC5E,QAAM,QAAQ,MAAM,oBAAoB,GAAG;AAC3C,QAAM,eAAe,QAAQ,OAAO,SAAS;AAE7C,MAAI,aAAa,SAAS,EAAG,QAAO,EAAE,WAAW,KAAK,WAAW,YAAY,YAAY,EAAE;AAI3F,SAAO,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,YAAY,QAAQ,OAAO,QAAQ,CAAC,EAAE;AACrF;AAGA,SAAS,QACP,OACA,OACwB;AACxB,SAAO,MAAM,OAAO,CAAC,iBAAiB,aAAa,UAAU,KAAK;AACpE;AAGA,SAAS,YAAY,eAA4D;AAC/E,SAAO,cAAc,IAAI,CAAC,iBAAiB,aAAa,QAAQ;AAClE;AAiBA,eAAsB,8BACpB,KACA,SACA,OACA,aACe;AACf,MAAI,UAAU,QAAW;AACvB,6BAAyB,KAAK;AAC9B;AAAA,EACF;AAEA,QAAM,EAAE,WAAW,UAAU,IAAI,MAAM,oBAAoB,GAAG;AAC9D,MAAI,UAAU,UAAU,EAAG;AAE3B,cAAY,sBAAsB,SAAS,WAAW,SAAS,CAAC;AAClE;AASA,eAAsB,iBAAiB,KAAqC;AAC1E,QAAM,EAAE,WAAW,UAAU,IAAI,MAAM,oBAAoB,GAAG;AAC9D,MAAI,UAAU,UAAU,EAAG,QAAO;AAElC,SAAO,sBAAsB,kCAAkC,WAAW,SAAS;AACrF;AAcA,eAAsB,8BACpB,KACA,SACwB;AACxB,QAAM,EAAE,WAAW,UAAU,IAAI,MAAM,oBAAoB,GAAG;AAC9D,QAAM,SAAS,UAAU,OAAO,CAAC,aAAa,aAAa,OAAO;AAClE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,SACE,GAAG,SAAS,UAAU,UAAU,MAAM,yBAAoB,UAAU,KAAK,OAAO,CAAC,2BACvE,OAAO,uCAAuC,UAAU,KAAK,GAAG,CAAC;AAE/E;","names":[]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  StackSelection
4
- } from "./chunk-XATLUKXK.js";
4
+ } from "./chunk-X2KUI7V3.js";
5
5
 
6
6
  // src/cli/components/wizard/step-stack.tsx
7
7
  import { Box } from "ink";
@@ -14,4 +14,4 @@ var StepStack = ({ onCancel }) => {
14
14
  export {
15
15
  StepStack
16
16
  };
17
- //# sourceMappingURL=chunk-URXIQE7I.js.map
17
+ //# sourceMappingURL=chunk-MWDY76MT.js.map
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getDomainDisplayName
4
- } from "./chunk-4VL3CEOS.js";
4
+ } from "./chunk-LXXGZAD3.js";
5
5
  import {
6
6
  useMeasuredHeight
7
7
  } from "./chunk-TSIU7DME.js";
8
8
  import {
9
9
  useRowScroll
10
- } from "./chunk-YRS3QZP2.js";
10
+ } from "./chunk-CEBDGZID.js";
11
11
  import {
12
12
  KEY_SPACE
13
13
  } from "./chunk-WTJ3AY33.js";
@@ -17,19 +17,19 @@ import {
17
17
  deriveScopeBadges,
18
18
  formatScopeTag,
19
19
  useWizardStore
20
- } from "./chunk-K5ITEA3I.js";
20
+ } from "./chunk-UBSSIIWD.js";
21
21
  import {
22
22
  isAgentName,
23
23
  toTitleCase
24
- } from "./chunk-XPDVAJDH.js";
24
+ } from "./chunk-IM45LLQX.js";
25
25
  import {
26
26
  matrix,
27
27
  typedKeys
28
- } from "./chunk-AVK2HEKB.js";
28
+ } from "./chunk-GKPW33FP.js";
29
29
  import {
30
30
  CLI_COLORS,
31
31
  UI_SYMBOLS
32
- } from "./chunk-UITEKY2R.js";
32
+ } from "./chunk-AQXKAPCD.js";
33
33
 
34
34
  // src/cli/components/wizard/step-agents.tsx
35
35
  import { groupBy, unique } from "remeda";
@@ -227,4 +227,4 @@ var StepAgents = () => {
227
227
  export {
228
228
  StepAgents
229
229
  };
230
- //# sourceMappingURL=chunk-V5GLL2JB.js.map
230
+ //# sourceMappingURL=chunk-P3KJCYSR.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SCROLL_VIEWPORT
4
- } from "./chunk-UITEKY2R.js";
4
+ } from "./chunk-AQXKAPCD.js";
5
5
 
6
6
  // src/cli/components/wizard/scroll-affordance.tsx
7
7
  import { Box, Text } from "ink";
@@ -21,4 +21,4 @@ var ScrollAffordance = ({ hiddenAbove, hiddenBelow }) => {
21
21
  export {
22
22
  ScrollAffordance
23
23
  };
24
- //# sourceMappingURL=chunk-6MV4JOCL.js.map
24
+ //# sourceMappingURL=chunk-PSX7CT6V.js.map
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  computeScopeDiff,
4
4
  useWizardStore
5
- } from "./chunk-K5ITEA3I.js";
5
+ } from "./chunk-UBSSIIWD.js";
6
6
  import {
7
7
  getSkillDisplayName
8
- } from "./chunk-AVK2HEKB.js";
8
+ } from "./chunk-GKPW33FP.js";
9
9
  import {
10
10
  CLI_COLORS,
11
11
  EJECT_SOURCE,
12
12
  UI_SYMBOLS
13
- } from "./chunk-UITEKY2R.js";
13
+ } from "./chunk-AQXKAPCD.js";
14
14
 
15
15
  // src/cli/components/wizard/skill-agent-summary.tsx
16
16
  import { Box, Text } from "ink";
@@ -106,4 +106,4 @@ var SkillAgentSummary = ({
106
106
  export {
107
107
  SkillAgentSummary
108
108
  };
109
- //# sourceMappingURL=chunk-B3Y3QMWI.js.map
109
+ //# sourceMappingURL=chunk-TRTVOVHR.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SummaryPanel
4
- } from "./chunk-LT5GXEB2.js";
4
+ } from "./chunk-VPJUCVU7.js";
5
5
 
6
6
  // src/cli/components/wizard/step-confirm.tsx
7
7
  import { useInput } from "ink";
@@ -22,4 +22,4 @@ var StepConfirm = ({ onComplete, onBack }) => {
22
22
  export {
23
23
  StepConfirm
24
24
  };
25
- //# sourceMappingURL=chunk-AOTCIUGX.js.map
25
+ //# sourceMappingURL=chunk-TV5Y53R2.js.map
@@ -9,7 +9,7 @@ import {
9
9
  getUnmetRequiredBy,
10
10
  isLocalOnlySkill,
11
11
  warn
12
- } from "./chunk-XPDVAJDH.js";
12
+ } from "./chunk-IM45LLQX.js";
13
13
  import {
14
14
  getCategoryDomain,
15
15
  getSkillById,
@@ -18,7 +18,7 @@ import {
18
18
  typedFromEntries,
19
19
  typedKeys,
20
20
  typedValues
21
- } from "./chunk-AVK2HEKB.js";
21
+ } from "./chunk-GKPW33FP.js";
22
22
  import {
23
23
  CLI_INVOKE_COMMAND,
24
24
  DEFAULT_PUBLIC_SOURCE_NAME,
@@ -31,7 +31,7 @@ import {
31
31
  isGlobalTombstone,
32
32
  isProjectOwned,
33
33
  orderDomains
34
- } from "./chunk-UITEKY2R.js";
34
+ } from "./chunk-AQXKAPCD.js";
35
35
 
36
36
  // src/cli/stores/wizard-store.ts
37
37
  import { create } from "zustand";
@@ -347,7 +347,7 @@ function wouldOverwriteGlobalEject(config, liveConfigs, installedSkillConfigs) {
347
347
  }
348
348
  function isInheritedGlobalSlot(installed, id, scope) {
349
349
  if (installed === null) return false;
350
- return scope === "global" && hasGlobalActive(installed, id);
350
+ return scope === "global" && (hasGlobalActive(installed, id) || hasGlobalTombstone(installed, id));
351
351
  }
352
352
  function withActiveEntryOrigin(configs, id, scope, origin) {
353
353
  return configs.map(
@@ -445,13 +445,23 @@ function survivesRosterRebuild(agentConfig, roster, rebuiltSlots) {
445
445
  }
446
446
  return !isProjectOwned(agentConfig) && !roster.has(agentConfig.name);
447
447
  }
448
+ function tuningOf(agentConfig) {
449
+ return {
450
+ ...agentConfig?.model !== void 0 && { model: agentConfig.model },
451
+ ...agentConfig?.effort !== void 0 && { effort: agentConfig.effort }
452
+ };
453
+ }
454
+ function tunedEntryFor(agentConfigs, agent) {
455
+ return agentConfigs?.find((ac) => ac.name === agent && !ac.excluded && ac.scope === "project") ?? agentConfigs?.find((ac) => ac.name === agent && !ac.excluded);
456
+ }
448
457
  function restoreDualScopeAgent(selectedAgents, agentConfigs, agent) {
458
+ const tuning = tuningOf(tunedEntryFor(agentConfigs, agent));
449
459
  return {
450
460
  selectedAgents: [...selectedAgents, agent],
451
461
  agentConfigs: [
452
462
  ...agentConfigs.filter((ac) => ac.name !== agent),
453
- { name: agent, scope: "project" },
454
- { name: agent, scope: "global", excluded: true }
463
+ { name: agent, scope: "project", ...tuning },
464
+ { name: agent, scope: "global", ...tuning, excluded: true }
455
465
  ]
456
466
  };
457
467
  }
@@ -469,14 +479,13 @@ function buildSkillConfigForId(id, savedConfigs) {
469
479
  };
470
480
  }
471
481
  function buildAgentConfigForName(name, savedConfigs) {
472
- const saved = savedConfigs?.find((ac) => ac.name === name && !ac.excluded && ac.scope === "project") ?? savedConfigs?.find((ac) => ac.name === name && !ac.excluded);
482
+ const saved = tunedEntryFor(savedConfigs, name);
473
483
  return {
474
484
  name,
475
485
  scope: saved?.scope ?? "global",
476
- // Model and effort are the user's deliberate choice, not something the roster re-derives —
477
- // they survive the rebuild on the same terms as scope.
478
- ...saved?.model !== void 0 && { model: saved.model },
479
- ...saved?.effort !== void 0 && { effort: saved.effort }
486
+ // The tuning is the user's deliberate choice, not something the roster re-derives — it
487
+ // survives the rebuild on the same terms as scope.
488
+ ...tuningOf(saved)
480
489
  };
481
490
  }
482
491
  function restoreSkillConfigs(existingConfigs, restoredIds) {
@@ -615,7 +624,7 @@ function classifySkillSourceRows(skillId, options, context) {
615
624
  }
616
625
  ];
617
626
  }
618
- const readOnly = !isEditingFromGlobalScope && !!installedGlobalConfig;
627
+ const readOnly = !isEditingFromGlobalScope && (!!installedGlobalConfig || isInheritedGlobalSlot(installedSkillConfigs, skillId, configEntry?.scope));
619
628
  return [
620
629
  {
621
630
  skillId,
@@ -664,6 +673,8 @@ var createInitialState = (overrides) => ({
664
673
  skillConfigs: [],
665
674
  focusedSkillId: null,
666
675
  unresolvableSkillIds: [],
676
+ foldedSkillIds: [],
677
+ setupMarketplace: null,
667
678
  showInfo: false,
668
679
  selectedAgents: [],
669
680
  agentConfigs: [],
@@ -881,10 +892,14 @@ var useWizardStore = create((set, get) => ({
881
892
  skillConfigs: needsTombstone ? [
882
893
  ...rescoped,
883
894
  { id: skillId, scope: "global", excluded: true, origin: config.origin }
884
- ] : rescoped
895
+ ] : rescoped,
896
+ foldedSkillIds: state.foldedSkillIds.filter((id) => id !== skillId)
885
897
  };
886
898
  }
887
- return { skillConfigs: rescoped.filter((sc) => !(sc.id === skillId && sc.excluded)) };
899
+ return {
900
+ skillConfigs: rescoped.filter((sc) => !(sc.id === skillId && sc.excluded)),
901
+ foldedSkillIds: isDualScopePair(state.skillConfigs, skillId) ? [...state.foldedSkillIds, skillId] : state.foldedSkillIds
902
+ };
888
903
  }),
889
904
  setFocusedSkillId: (id) => set({ focusedSkillId: id }),
890
905
  seedFocusedSkillForActiveDomain: () => {
@@ -1084,7 +1099,8 @@ function hydrateForEdit(initialStep, options) {
1084
1099
  installedSkillIds,
1085
1100
  installedSkillConfigs,
1086
1101
  installedAgentConfigs,
1087
- isEditingFromGlobalScope
1102
+ isEditingFromGlobalScope,
1103
+ setupMarketplace
1088
1104
  } = options;
1089
1105
  if (installedSkillIds?.length) {
1090
1106
  useWizardStore.getState().populateFromSkillIds(installedSkillIds, installedSkillConfigs);
@@ -1105,7 +1121,8 @@ function hydrateForEdit(initialStep, options) {
1105
1121
  installedSkillConfigs: installedSkillConfigs ?? null,
1106
1122
  installedAgentConfigs: installedAgentConfigs ?? null
1107
1123
  } : {},
1108
- ...isEditingFromGlobalScope ? { isEditingFromGlobalScope: true } : {}
1124
+ ...isEditingFromGlobalScope ? { isEditingFromGlobalScope: true } : {},
1125
+ ...setupMarketplace !== void 0 && { setupMarketplace }
1109
1126
  });
1110
1127
  useWizardStore.getState().seedFocusedSkillForActiveDomain();
1111
1128
  }
@@ -1159,4 +1176,4 @@ export {
1159
1176
  showWarningsAsToast,
1160
1177
  hydrateWizardStore
1161
1178
  };
1162
- //# sourceMappingURL=chunk-K5ITEA3I.js.map
1179
+ //# sourceMappingURL=chunk-UBSSIIWD.js.map