agents-inc 0.156.0 → 0.157.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 (173) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/{chunk-PMUABBPG.js → chunk-24IGOJ7E.js} +9 -13
  3. package/dist/chunk-24IGOJ7E.js.map +1 -0
  4. package/dist/{chunk-H6UTKTLK.js → chunk-3E52LCYC.js} +98 -34
  5. package/dist/chunk-3E52LCYC.js.map +1 -0
  6. package/dist/{chunk-UMH2YZKG.js → chunk-4CIAZOTD.js} +4 -6
  7. package/dist/{chunk-UMH2YZKG.js.map → chunk-4CIAZOTD.js.map} +1 -1
  8. package/dist/{chunk-D2CAV7MG.js → chunk-4DMFK67G.js} +2 -2
  9. package/dist/{chunk-PNMM5HNX.js → chunk-4EPJWN7C.js} +9 -10
  10. package/dist/chunk-4EPJWN7C.js.map +1 -0
  11. package/dist/{chunk-MHRC3KRX.js → chunk-4KHUHPX4.js} +3 -3
  12. package/dist/chunk-4KHUHPX4.js.map +1 -0
  13. package/dist/{chunk-2H7UWE2G.js → chunk-CEGHC7L5.js} +13 -12
  14. package/dist/chunk-CEGHC7L5.js.map +1 -0
  15. package/dist/{chunk-MO5FGLVS.js → chunk-DCIC35R7.js} +11 -12
  16. package/dist/chunk-DCIC35R7.js.map +1 -0
  17. package/dist/{chunk-ILUVL7WM.js → chunk-DZD25NHW.js} +2 -2
  18. package/dist/{chunk-IO5YBKHV.js → chunk-G6G2FT2G.js} +10 -8
  19. package/dist/chunk-G6G2FT2G.js.map +1 -0
  20. package/dist/{chunk-RWOYPOMR.js → chunk-IGOFZG3S.js} +19 -5
  21. package/dist/chunk-IGOFZG3S.js.map +1 -0
  22. package/dist/{chunk-CLFHC2DK.js → chunk-K2VTGT45.js} +17 -18
  23. package/dist/chunk-K2VTGT45.js.map +1 -0
  24. package/dist/{chunk-YO2LTXB4.js → chunk-KTXVQ7OM.js} +115 -10
  25. package/dist/chunk-KTXVQ7OM.js.map +1 -0
  26. package/dist/{chunk-SY4X2LND.js → chunk-KUZBMEWR.js} +3 -3
  27. package/dist/{chunk-ZUAZHDKP.js → chunk-LDBVIPTP.js} +277 -40
  28. package/dist/chunk-LDBVIPTP.js.map +1 -0
  29. package/dist/{chunk-PCC4LBKB.js → chunk-MU2TQ5KK.js} +2 -2
  30. package/dist/{chunk-4G2YHZIM.js → chunk-O4K42CJB.js} +4 -6
  31. package/dist/{chunk-4G2YHZIM.js.map → chunk-O4K42CJB.js.map} +1 -1
  32. package/dist/{chunk-HXKOIWLU.js → chunk-P6OKOH62.js} +2 -6
  33. package/dist/chunk-P6OKOH62.js.map +1 -0
  34. package/dist/{chunk-IXRZAHZF.js → chunk-PGZSNNDA.js} +4 -4
  35. package/dist/{chunk-LJCNUP6M.js → chunk-PVPNVK3W.js} +2 -2
  36. package/dist/{chunk-4A4L3YIW.js → chunk-PXGDA2SY.js} +6 -7
  37. package/dist/chunk-PXGDA2SY.js.map +1 -0
  38. package/dist/{chunk-G47TDUK3.js → chunk-QNAMXQKF.js} +2 -2
  39. package/dist/{chunk-5OKLCVM4.js → chunk-QO4XD5V5.js} +3 -3
  40. package/dist/{chunk-5F2YR5XV.js → chunk-QXPMQBEI.js} +15 -5
  41. package/dist/chunk-QXPMQBEI.js.map +1 -0
  42. package/dist/{chunk-F5T6TV4Z.js → chunk-RLU2IXD3.js} +40 -14
  43. package/dist/chunk-RLU2IXD3.js.map +1 -0
  44. package/dist/{chunk-WCAUUBHO.js → chunk-RVXI5VQU.js} +14758 -14501
  45. package/dist/chunk-RVXI5VQU.js.map +1 -0
  46. package/dist/{chunk-WFRTHH3A.js → chunk-TZRXWFF5.js} +3 -3
  47. package/dist/{chunk-HG4JPXJT.js → chunk-V7PMQDDU.js} +23 -10
  48. package/dist/chunk-V7PMQDDU.js.map +1 -0
  49. package/dist/{chunk-Y5Y7XHVU.js → chunk-VI6U2PJG.js} +4 -4
  50. package/dist/{chunk-TBOVYLQJ.js → chunk-VTIDLRNA.js} +2 -2
  51. package/dist/{chunk-OKH64JZE.js → chunk-WCZNQECQ.js} +2 -2
  52. package/dist/{chunk-QWVXOCXO.js → chunk-WENBESZO.js} +7 -9
  53. package/dist/{chunk-QWVXOCXO.js.map → chunk-WENBESZO.js.map} +1 -1
  54. package/dist/{chunk-TNGMF4UX.js → chunk-XOZAKFTS.js} +12 -12
  55. package/dist/chunk-XOZAKFTS.js.map +1 -0
  56. package/dist/{chunk-6RLV45HN.js → chunk-YG5YPVTJ.js} +6 -6
  57. package/dist/chunk-YG5YPVTJ.js.map +1 -0
  58. package/dist/{chunk-HTYH7CKN.js → chunk-YKFCUVHG.js} +3 -3
  59. package/dist/{chunk-VPASBA7P.js → chunk-YXI3BTQQ.js} +2 -2
  60. package/dist/chunk-Z3H2K5PK.js +1352 -0
  61. package/dist/chunk-Z3H2K5PK.js.map +1 -0
  62. package/dist/{chunk-5QZAK6J7.js → chunk-ZAQ6WMJV.js} +50 -18
  63. package/dist/chunk-ZAQ6WMJV.js.map +1 -0
  64. package/dist/{chunk-GS2NZ3GD.js → chunk-ZBYVDXZG.js} +5 -5
  65. package/dist/chunk-ZBYVDXZG.js.map +1 -0
  66. package/dist/commands/build/marketplace.js +9 -12
  67. package/dist/commands/build/marketplace.js.map +1 -1
  68. package/dist/commands/build/plugins.js +9 -12
  69. package/dist/commands/build/plugins.js.map +1 -1
  70. package/dist/commands/compile.js +15 -19
  71. package/dist/commands/compile.js.map +1 -1
  72. package/dist/commands/doctor.js +75 -54
  73. package/dist/commands/doctor.js.map +1 -1
  74. package/dist/commands/edit.js +154 -109
  75. package/dist/commands/edit.js.map +1 -1
  76. package/dist/commands/eject.js +68 -38
  77. package/dist/commands/eject.js.map +1 -1
  78. package/dist/commands/init.js +36 -39
  79. package/dist/commands/list.js +8 -10
  80. package/dist/commands/list.js.map +1 -1
  81. package/dist/commands/new/marketplace.js +8 -11
  82. package/dist/commands/new/marketplace.js.map +1 -1
  83. package/dist/commands/search.js +10 -13
  84. package/dist/commands/search.js.map +1 -1
  85. package/dist/commands/share.js +8 -10
  86. package/dist/commands/share.js.map +1 -1
  87. package/dist/commands/uninstall.js +39 -28
  88. package/dist/commands/uninstall.js.map +1 -1
  89. package/dist/commands/update.js +7 -10
  90. package/dist/commands/update.js.map +1 -1
  91. package/dist/components/common/removal-plan-confirm.js +2 -2
  92. package/dist/components/common/select-list.js +2 -2
  93. package/dist/components/wizard/category-grid.js +4 -5
  94. package/dist/components/wizard/checkbox-grid.js +4 -4
  95. package/dist/components/wizard/domain-selection.js +9 -11
  96. package/dist/components/wizard/run-wizard-session.js +26 -28
  97. package/dist/components/wizard/scroll-affordance.js +2 -2
  98. package/dist/components/wizard/skill-agent-summary.js +5 -7
  99. package/dist/components/wizard/source-grid.js +5 -6
  100. package/dist/components/wizard/stack-selection.js +7 -9
  101. package/dist/components/wizard/step-agents.js +8 -10
  102. package/dist/components/wizard/step-build.js +7 -9
  103. package/dist/components/wizard/step-confirm.js +9 -11
  104. package/dist/components/wizard/step-sources.js +8 -10
  105. package/dist/components/wizard/step-stack.js +8 -10
  106. package/dist/components/wizard/summary-panel.js +8 -10
  107. package/dist/components/wizard/toast.js +2 -2
  108. package/dist/components/wizard/wizard-layout.js +12 -14
  109. package/dist/components/wizard/wizard-tabs.js +2 -4
  110. package/dist/components/wizard/wizard.js +25 -27
  111. package/dist/hooks/init.js +36 -39
  112. package/dist/hooks/init.js.map +1 -1
  113. package/dist/load-agent-defs-M6LRVISN.js +13 -0
  114. package/dist/recompile-project-agents-G7ZM25PC.js +17 -0
  115. package/dist/{source-loader-3DL3NYUX.js → source-loader-BIAEDR5R.js} +4 -8
  116. package/dist/src/agents/_templates/agent.liquid +2 -2
  117. package/dist/stores/wizard-store.js +6 -6
  118. package/package.json +1 -1
  119. package/src/agents/_templates/agent.liquid +2 -2
  120. package/src/schemas/custom-metadata.schema.json +1 -1
  121. package/src/schemas/marketplace.schema.json +2 -1
  122. package/dist/chunk-2H7UWE2G.js.map +0 -1
  123. package/dist/chunk-4A4L3YIW.js.map +0 -1
  124. package/dist/chunk-5F2YR5XV.js.map +0 -1
  125. package/dist/chunk-5QZAK6J7.js.map +0 -1
  126. package/dist/chunk-6RLV45HN.js.map +0 -1
  127. package/dist/chunk-CLFHC2DK.js.map +0 -1
  128. package/dist/chunk-F2AMBBIA.js +0 -64
  129. package/dist/chunk-F2AMBBIA.js.map +0 -1
  130. package/dist/chunk-F5T6TV4Z.js.map +0 -1
  131. package/dist/chunk-GS2NZ3GD.js.map +0 -1
  132. package/dist/chunk-H6UTKTLK.js.map +0 -1
  133. package/dist/chunk-HG4JPXJT.js.map +0 -1
  134. package/dist/chunk-HXKOIWLU.js.map +0 -1
  135. package/dist/chunk-IO5YBKHV.js.map +0 -1
  136. package/dist/chunk-MHRC3KRX.js.map +0 -1
  137. package/dist/chunk-MO5FGLVS.js.map +0 -1
  138. package/dist/chunk-PMUABBPG.js.map +0 -1
  139. package/dist/chunk-PNMM5HNX.js.map +0 -1
  140. package/dist/chunk-RWOYPOMR.js.map +0 -1
  141. package/dist/chunk-TNGMF4UX.js.map +0 -1
  142. package/dist/chunk-VASLW636.js +0 -23
  143. package/dist/chunk-VASLW636.js.map +0 -1
  144. package/dist/chunk-WCAUUBHO.js.map +0 -1
  145. package/dist/chunk-WUQ3MTPF.js +0 -173
  146. package/dist/chunk-WUQ3MTPF.js.map +0 -1
  147. package/dist/chunk-XAXJWXI4.js +0 -1667
  148. package/dist/chunk-XAXJWXI4.js.map +0 -1
  149. package/dist/chunk-YO2LTXB4.js.map +0 -1
  150. package/dist/chunk-ZUAZHDKP.js.map +0 -1
  151. package/dist/copy-local-skills-NSUTBVLJ.js +0 -14
  152. package/dist/load-agent-defs-X4E57I2U.js +0 -15
  153. package/dist/loader-G6BFG2VA.js +0 -24
  154. package/dist/recompile-project-agents-JE4MM72I.js +0 -20
  155. package/dist/recompile-project-agents-JE4MM72I.js.map +0 -1
  156. package/dist/source-loader-3DL3NYUX.js.map +0 -1
  157. /package/dist/{chunk-D2CAV7MG.js.map → chunk-4DMFK67G.js.map} +0 -0
  158. /package/dist/{chunk-ILUVL7WM.js.map → chunk-DZD25NHW.js.map} +0 -0
  159. /package/dist/{chunk-SY4X2LND.js.map → chunk-KUZBMEWR.js.map} +0 -0
  160. /package/dist/{chunk-PCC4LBKB.js.map → chunk-MU2TQ5KK.js.map} +0 -0
  161. /package/dist/{chunk-IXRZAHZF.js.map → chunk-PGZSNNDA.js.map} +0 -0
  162. /package/dist/{chunk-LJCNUP6M.js.map → chunk-PVPNVK3W.js.map} +0 -0
  163. /package/dist/{chunk-G47TDUK3.js.map → chunk-QNAMXQKF.js.map} +0 -0
  164. /package/dist/{chunk-5OKLCVM4.js.map → chunk-QO4XD5V5.js.map} +0 -0
  165. /package/dist/{chunk-WFRTHH3A.js.map → chunk-TZRXWFF5.js.map} +0 -0
  166. /package/dist/{chunk-Y5Y7XHVU.js.map → chunk-VI6U2PJG.js.map} +0 -0
  167. /package/dist/{chunk-TBOVYLQJ.js.map → chunk-VTIDLRNA.js.map} +0 -0
  168. /package/dist/{chunk-OKH64JZE.js.map → chunk-WCZNQECQ.js.map} +0 -0
  169. /package/dist/{chunk-HTYH7CKN.js.map → chunk-YKFCUVHG.js.map} +0 -0
  170. /package/dist/{chunk-VPASBA7P.js.map → chunk-YXI3BTQQ.js.map} +0 -0
  171. /package/dist/{copy-local-skills-NSUTBVLJ.js.map → load-agent-defs-M6LRVISN.js.map} +0 -0
  172. /package/dist/{load-agent-defs-X4E57I2U.js.map → recompile-project-agents-G7ZM25PC.js.map} +0 -0
  173. /package/dist/{loader-G6BFG2VA.js.map → source-loader-BIAEDR5R.js.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getDomainDisplayName
4
- } from "./chunk-5OKLCVM4.js";
4
+ } from "./chunk-QO4XD5V5.js";
5
5
  import {
6
6
  useMeasuredHeight
7
7
  } from "./chunk-TSIU7DME.js";
8
8
  import {
9
9
  useRowScroll
10
- } from "./chunk-WFRTHH3A.js";
10
+ } from "./chunk-TZRXWFF5.js";
11
11
  import {
12
12
  KEY_SPACE
13
13
  } from "./chunk-WTJ3AY33.js";
@@ -17,41 +17,40 @@ import {
17
17
  deriveScopeBadges,
18
18
  formatScopeTag,
19
19
  useWizardStore
20
- } from "./chunk-F5T6TV4Z.js";
20
+ } from "./chunk-RLU2IXD3.js";
21
21
  import {
22
+ isAgentName,
22
23
  toTitleCase
23
- } from "./chunk-WCAUUBHO.js";
24
- import {
25
- isAgentName
26
- } from "./chunk-XAXJWXI4.js";
27
- import {
28
- matrix
29
- } from "./chunk-RWOYPOMR.js";
24
+ } from "./chunk-RVXI5VQU.js";
30
25
  import {
26
+ matrix,
31
27
  typedKeys
32
- } from "./chunk-VASLW636.js";
28
+ } from "./chunk-IGOFZG3S.js";
33
29
  import {
34
30
  CLI_COLORS,
35
31
  UI_SYMBOLS
36
- } from "./chunk-IO5YBKHV.js";
32
+ } from "./chunk-G6G2FT2G.js";
37
33
 
38
34
  // src/cli/components/wizard/step-agents.tsx
39
35
  import { groupBy, unique } from "remeda";
40
36
  import { Box, Text, useInput } from "ink";
41
37
  import React, { useMemo, useState } from "react";
42
38
  import { jsx, jsxs } from "react/jsx-runtime";
39
+ function agentIdsNamedByStacks(matrix2) {
40
+ return unique(matrix2.suggestedStacks.flatMap((stack) => typedKeys(stack.skills)));
41
+ }
42
+ function selectableSourceAgents(matrix2) {
43
+ return agentIdsNamedByStacks(matrix2).filter(isAgentName).filter((agentName) => !BUILT_IN_AGENT_IDS.has(agentName));
44
+ }
43
45
  function buildAgentGroups(matrix2) {
44
- const customAgentIds = unique(
45
- matrix2.suggestedStacks.flatMap((stack) => typedKeys(stack.skills))
46
- ).filter((agentName) => !BUILT_IN_AGENT_IDS.has(agentName));
46
+ const customAgentIds = selectableSourceAgents(matrix2);
47
47
  if (customAgentIds.length === 0) return BUILT_IN_AGENT_GROUPS;
48
48
  const customItems = customAgentIds.map((agentId) => {
49
- const explicitDomain = isAgentName(agentId) ? matrix2.agentDefinedDomains?.[agentId] : void 0;
49
+ const explicitDomain = matrix2.agentDefinedDomains?.[agentId];
50
50
  const domainKey = explicitDomain ?? (agentId.split("-")[0] || "custom");
51
51
  return {
52
52
  groupLabel: getDomainDisplayName(domainKey),
53
53
  item: {
54
- // Boundary cast: custom agent names from marketplace stacks are not in the AgentName union
55
54
  id: agentId,
56
55
  label: toTitleCase(agentId),
57
56
  description: "Custom agent"
@@ -228,4 +227,4 @@ var StepAgents = () => {
228
227
  export {
229
228
  StepAgents
230
229
  };
231
- //# sourceMappingURL=chunk-CLFHC2DK.js.map
230
+ //# sourceMappingURL=chunk-K2VTGT45.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/components/wizard/step-agents.tsx"],"sourcesContent":["import { groupBy, unique } from \"remeda\";\nimport { Box, Text, useInput } from \"ink\";\nimport {\n BUILT_IN_AGENT_GROUPS,\n BUILT_IN_AGENT_IDS,\n deriveScopeBadges,\n formatScopeTag,\n} from \"../../lib/wizard/index.js\";\nimport type { AgentGroup, AgentItem } from \"../../lib/wizard/index.js\";\nimport React, { useMemo, useState } from \"react\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport type { AgentName, MergedSkillsMatrix } from \"../../types/index.js\";\nimport { isAgentName } from \"../../utils/type-guards.js\";\nimport { typedKeys } from \"../../utils/typed-object.js\";\nimport { toTitleCase } from \"../../utils/string.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { useRowScroll } from \"../hooks/use-row-scroll.js\";\nimport { KEY_SPACE } from \"./hotkeys.js\";\nimport { getDomainDisplayName } from \"./utils.js\";\n\ntype FocusId = AgentName | \"continue\";\n\ntype ListRow =\n { type: \"header\"; label: string } | { type: \"spacer\" } | { type: \"agent\"; agent: AgentItem };\n\n/**\n * The sub-agents a loaded source's stacks name, as the strings a stack file spells them.\n *\n * `typedKeys` types them `AgentName` because `ResolvedStack.skills` is keyed by it, but the keys\n * arrive from a marketplace's own YAML and nothing between there and here narrows them — which\n * is exactly the claim the filter below has to test.\n */\nfunction agentIdsNamedByStacks(matrix: MergedSkillsMatrix): string[] {\n return unique(matrix.suggestedStacks.flatMap((stack) => typedKeys(stack.skills)));\n}\n\n/**\n * The rows a loaded source adds to the built-in grid.\n *\n * Narrowed with `isAgentName` and deliberately NOT cast to it. A row here is a name the user can\n * put into `config.agents`, and only the CLI's own `src/agents/` declares a sub-agent a compile\n * pass can honour — that directory is the whole of the roster (owner ruling 2026-08-21) and is\n * what `AGENT_NAMES` is generated from. So a stack naming an agent the CLI does not ship\n * contributes nothing: offering it a row wrote a name that reached `AgentName`,\n * `SelectedAgentName` and `ProjectAgentName` alike and then left `compile` with no definition to\n * compile.\n */\nfunction selectableSourceAgents(matrix: MergedSkillsMatrix): AgentName[] {\n return agentIdsNamedByStacks(matrix)\n .filter(isAgentName)\n .filter((agentName) => !BUILT_IN_AGENT_IDS.has(agentName));\n}\n\nfunction buildAgentGroups(matrix: MergedSkillsMatrix): AgentGroup[] {\n const customAgentIds = selectableSourceAgents(matrix);\n\n if (customAgentIds.length === 0) return BUILT_IN_AGENT_GROUPS;\n\n // Group custom agents by explicit domain (from metadata.yaml) or kebab prefix fallback\n const customItems = customAgentIds.map((agentId) => {\n const explicitDomain = matrix.agentDefinedDomains?.[agentId];\n const domainKey = explicitDomain ?? (agentId.split(\"-\")[0] || \"custom\");\n return {\n groupLabel: getDomainDisplayName(domainKey),\n item: {\n id: agentId,\n label: toTitleCase(agentId),\n description: \"Custom agent\",\n },\n };\n });\n const customGroups: AgentGroup[] = Object.entries(groupBy(customItems, (c) => c.groupLabel)).map(\n ([label, entries]) => ({ label, items: entries.map((entry) => entry.item) }),\n );\n\n return [...BUILT_IN_AGENT_GROUPS, ...customGroups];\n}\n\nfunction buildFlatRows(groups: AgentGroup[]): ListRow[] {\n return groups.flatMap((group, groupIndex): ListRow[] => [\n ...(groupIndex > 0 ? [{ type: \"spacer\" as const }] : []),\n { type: \"header\" as const, label: group.label },\n ...group.items.map((agent): ListRow => ({ type: \"agent\", agent })),\n ]);\n}\n\nfunction buildFocusableIds(groups: AgentGroup[]): FocusId[] {\n return [...groups.flatMap((group) => group.items.map((a) => a.id)), \"continue\"];\n}\n\n/**\n * Asserting row lookup. `buildFocusableIds` always appends \"continue\", so the\n * list is never empty and every caller below wraps within it — a miss means the\n * wrap arithmetic is wrong, which is worth a diagnostic rather than a focus that\n * silently stops moving.\n */\nfunction focusableIdAt(ids: FocusId[], index: number): FocusId {\n const id = ids[index];\n if (id === undefined) throw new Error(`No focusable row at index ${index} of ${ids.length}`);\n return id;\n}\n\nexport const StepAgents: React.FC = () => {\n const selectedAgents = useWizardStore((s) => s.selectedAgents);\n const agentConfigs = useWizardStore((s) => s.agentConfigs);\n\n const agentGroups = useMemo(() => buildAgentGroups(matrix), []);\n const flatRows = useMemo(() => buildFlatRows(agentGroups), [agentGroups]);\n const focusableIds = useMemo(() => buildFocusableIds(agentGroups), [agentGroups]);\n\n const [focusedId, setFocusedId] = useState<FocusId>(() => {\n const stored = useWizardStore.getState().focusedAgentId;\n return stored && focusableIds.includes(stored) ? stored : focusableIdAt(focusableIds, 0);\n });\n const { ref: listRef, measuredHeight: listHeight } = useMeasuredHeight();\n\n const focusedRowIndex =\n focusedId !== \"continue\"\n ? flatRows.findIndex((row) => row.type === \"agent\" && row.agent.id === focusedId)\n : -1;\n // The Agents grid clips silently: `useRowScroll` exposes no hidden-line counts\n // and this view renders no `ScrollAffordance`, by owner decision — see the\n // hook's doc comment.\n const { scrollEnabled, scrollTop } = useRowScroll({\n focusedIndex: Math.max(0, focusedRowIndex),\n itemCount: flatRows.length,\n availableHeight: listHeight,\n });\n\n useInput((input, key) => {\n if (key.escape) {\n useWizardStore.getState().goBack();\n return;\n }\n\n const currentIdx = focusableIds.indexOf(focusedId);\n\n if (key.upArrow || input === \"k\") {\n const nextIdx = currentIdx <= 0 ? focusableIds.length - 1 : currentIdx - 1;\n setFocusedId(focusableIdAt(focusableIds, nextIdx));\n return;\n }\n\n if (key.downArrow || input === \"j\") {\n const nextIdx = currentIdx >= focusableIds.length - 1 ? 0 : currentIdx + 1;\n setFocusedId(focusableIdAt(focusableIds, nextIdx));\n return;\n }\n\n if (key.return) {\n useWizardStore.getState().setStep(\"confirm\");\n return;\n }\n\n if (input === KEY_SPACE && focusedId !== \"continue\") {\n useWizardStore.getState().toggleAgent(focusedId);\n }\n });\n\n // Sync focusedAgentId so the wizard-level S key handler can toggle agent scope\n React.useEffect(() => {\n useWizardStore.getState().setFocusedAgentId(focusedId === \"continue\" ? null : focusedId);\n }, [focusedId]);\n\n const focusedGroupLabel = agentGroups.find((g) => g.items.some((a) => a.id === focusedId))?.label;\n\n const selectedCount = selectedAgents.length;\n const continueLabel =\n selectedCount > 0 ? `Continue with ${selectedCount} agent(s)` : \"Continue without agents\";\n\n const isContinueFocused = focusedId === \"continue\";\n\n const rowElements = flatRows.map((row, index) => {\n switch (row.type) {\n case \"header\":\n return (\n <Box key={`header-${row.label}`} flexShrink={0}>\n {row.label === focusedGroupLabel ? (\n <Text\n color={CLI_COLORS.WHITE}\n backgroundColor={CLI_COLORS.LABEL_BG}\n >{` ${row.label} `}</Text>\n ) : (\n <Text dimColor bold>\n {\" \"}\n {row.label}\n </Text>\n )}\n </Box>\n );\n case \"spacer\":\n return (\n <Box key={`spacer-${index}`} flexShrink={0}>\n <Text> </Text>\n </Box>\n );\n case \"agent\": {\n const isFocused = row.agent.id === focusedId;\n const isSelected = selectedAgents.includes(row.agent.id);\n const checkbox = isSelected ? \"[\\u2713]\" : \"[ ]\";\n const pointer = isFocused ? UI_SYMBOLS.CHEVRON : UI_SYMBOLS.CHEVRON_SPACER;\n const agentConfig = agentConfigs.find((ac) => ac.name === row.agent.id && !ac.excluded);\n const excludedConfig = agentConfigs.find((ac) => ac.name === row.agent.id && ac.excluded);\n const badges = deriveScopeBadges(agentConfig, excludedConfig);\n const scope = badges.scope ?? \"global\";\n const secondaryScope = badges.secondaryScope;\n return (\n <Box key={row.agent.id} flexShrink={0}>\n <Text>\n <Text {...(isFocused && { color: CLI_COLORS.PRIMARY })}>{pointer}</Text>\n <Text\n {...((isSelected || isFocused) && { color: CLI_COLORS.PRIMARY })}\n bold={isFocused}\n >\n {\" \"}\n {checkbox}{\" \"}\n </Text>\n <Text color={scope === \"global\" ? CLI_COLORS.WARNING : CLI_COLORS.TOAST_BG}>\n {formatScopeTag(scope)}\n </Text>\n {secondaryScope && (\n <Text\n color={secondaryScope === \"global\" ? CLI_COLORS.WARNING : CLI_COLORS.TOAST_BG}\n >\n {formatScopeTag(secondaryScope)}\n </Text>\n )}\n <Text\n {...((isSelected || isFocused) && { color: CLI_COLORS.PRIMARY })}\n bold={isFocused}\n >\n {\" \"}\n {row.agent.label}\n </Text>\n <Text dimColor> {row.agent.description}</Text>\n </Text>\n </Box>\n );\n }\n default: {\n const _exhaustive: never = row;\n return _exhaustive;\n }\n }\n });\n\n return (\n <Box flexDirection=\"column\" width=\"100%\" flexGrow={1} flexBasis={0}>\n <Box ref={listRef} flexDirection=\"column\" flexGrow={1} flexBasis={0}>\n <Box\n flexDirection=\"column\"\n flexGrow={1}\n {...(scrollEnabled && { overflow: \"hidden\" as const })}\n >\n <Box\n flexDirection=\"column\"\n marginTop={scrollTop > 0 ? -scrollTop : 0}\n {...(scrollEnabled && { flexShrink: 0 })}\n >\n {rowElements}\n </Box>\n </Box>\n </Box>\n\n <Text {...(isContinueFocused && { color: CLI_COLORS.PRIMARY })} bold={isContinueFocused}>\n {isContinueFocused ? UI_SYMBOLS.CHEVRON : UI_SYMBOLS.CHEVRON_SPACER} {\"\\u2192\"}{\" \"}\n {continueLabel}\n </Text>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,cAAc;AAChC,S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AAA,gBACA,IAAI,MAAM;AAAA;AAAA;AAAA,UACb;AAAA,UACA,qBAAC,QAAK,UAAQ,MAAC;AAAA;AAAA,YAAE,IAAI,MAAM;AAAA,aAAY;AAAA,WACzC,KA5BQ,IAAI,MAAM,EA6BpB;AAAA,MAEJ;AAAA,MACA,SAAS;AACP,cAAM,cAAqB;AAC3B,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF,CAAC;AAED,SACE,qBAAC,OAAI,eAAc,UAAS,OAAM,QAAO,UAAU,GAAG,WAAW,GAC/D;AAAA,wBAAC,OAAI,KAAK,SAAS,eAAc,UAAS,UAAU,GAAG,WAAW,GAChE;AAAA,MAAC;AAAA;AAAA,QACC,eAAc;AAAA,QACd,UAAU;AAAA,QACT,GAAI,iBAAiB,EAAE,UAAU,SAAkB;AAAA,QAEpD;AAAA,UAAC;AAAA;AAAA,YACC,eAAc;AAAA,YACd,WAAW,YAAY,IAAI,CAAC,YAAY;AAAA,YACvC,GAAI,iBAAiB,EAAE,YAAY,EAAE;AAAA,YAErC;AAAA;AAAA,QACH;AAAA;AAAA,IACF,GACF;AAAA,IAEA,qBAAC,QAAM,GAAI,qBAAqB,EAAE,OAAO,WAAW,QAAQ,GAAI,MAAM,mBACnE;AAAA,0BAAoB,WAAW,UAAU,WAAW;AAAA,MAAe;AAAA,MAAE;AAAA,MAAU;AAAA,MAC/E;AAAA,OACH;AAAA,KACF;AAEJ;","names":["matrix"]}
@@ -4,40 +4,42 @@ import {
4
4
  pluginInstallFailureError,
5
5
  unbackedPluginInstallError,
6
6
  unbackedPluginSkillIds
7
- } from "./chunk-UMH2YZKG.js";
7
+ } from "./chunk-4CIAZOTD.js";
8
8
  import {
9
9
  clearTerminalScreen,
10
10
  formatTerminalTooSmallMessage,
11
11
  isTerminalLargeEnough
12
- } from "./chunk-G47TDUK3.js";
12
+ } from "./chunk-QNAMXQKF.js";
13
13
  import {
14
14
  STATUS_MESSAGES,
15
15
  claudePluginMarketplaceAdd,
16
16
  claudePluginMarketplaceExists,
17
17
  claudePluginMarketplaceUpdate,
18
+ completedWithFailures,
18
19
  configUnreadableError,
19
20
  fetchMarketplace,
20
21
  findConfigLoadFailures,
21
22
  findUnusableSavedSkillMetadata,
23
+ getErrorMessage,
22
24
  getStackSkillIds,
23
25
  isActiveAt,
24
26
  isHomeDirectory,
25
27
  pluginsInstalled,
26
28
  propagatedRecompileSummary,
29
+ resolveBranding,
27
30
  savedSkillMetadataUnusableError,
28
31
  scopeBlockedStackAssignment,
29
32
  sharedConfigProjectScopeAtHome,
30
33
  skillAssignedToNoAgent,
31
- skillMetadataUnusableDetail
32
- } from "./chunk-WCAUUBHO.js";
33
- import {
34
- getErrorMessage,
34
+ skillMetadataUnusableDetail,
35
+ verbose,
35
36
  warn
36
- } from "./chunk-XAXJWXI4.js";
37
+ } from "./chunk-RVXI5VQU.js";
37
38
  import {
38
39
  CLI_COLORS,
40
+ DEFAULT_BRANDING,
39
41
  MIN_TERMINAL_SIZE
40
- } from "./chunk-IO5YBKHV.js";
42
+ } from "./chunk-G6G2FT2G.js";
41
43
 
42
44
  // src/cli/lib/exit-codes.ts
43
45
  var EXIT_CODES = {
@@ -45,7 +47,20 @@ var EXIT_CODES = {
45
47
  ERROR: 1,
46
48
  INVALID_ARGS: 2,
47
49
  NETWORK_ERROR: 3,
48
- CANCELLED: 4
50
+ CANCELLED: 4,
51
+ /**
52
+ * The command ran to the end and part of what it set out to do did not happen.
53
+ *
54
+ * Distinct from {@link EXIT_CODES.ERROR} because the two ask opposite things of whoever reads
55
+ * them: an `ERROR` aborted, so nothing landed and the run can be repeated; this one landed and
56
+ * the repeat is the wrong move — what is owed is the remedy the output names, per failure.
57
+ * Collapsing it into `ERROR` would re-make the defect it exists to close one value along, and
58
+ * a spec asserting `not.toBe(0)` cannot tell a refusal from a partial apply either.
59
+ *
60
+ * It is raised at the END of a command, never mid-flight: the work completes first, which is
61
+ * the whole difference between this and `this.error`.
62
+ */
63
+ COMPLETED_WITH_FAILURES: 5
49
64
  };
50
65
 
51
66
  // src/cli/base-command.ts
@@ -132,6 +147,18 @@ function projectScopedContent(result) {
132
147
  };
133
148
  }
134
149
  var BaseCommand = class extends Command {
150
+ /**
151
+ * Everything this run set out to do and did not, in the order it hit them.
152
+ *
153
+ * Non-empty is the whole of the exit-code decision — see {@link exitIfWorkIncomplete}. It is
154
+ * deliberately not a boolean: a non-zero exit whose output does not say what failed and what
155
+ * finishes it is worse than the silent success it replaces.
156
+ *
157
+ * Private, with {@link hasIncompleteWork} the only reading a subclass gets. A command records
158
+ * through the two methods below and asks whether anything is owed; the list itself is this
159
+ * class's, because it is this class that answers for it.
160
+ */
161
+ incompleteWork = [];
135
162
  async init() {
136
163
  await super.init();
137
164
  await this.ensureTerminalSize();
@@ -151,6 +178,34 @@ var BaseCommand = class extends Command {
151
178
  const message = getErrorMessage(error);
152
179
  this.error(message, { exit: EXIT_CODES.ERROR });
153
180
  }
181
+ /**
182
+ * The name this run prints itself under: `branding.name` where a config supplies one, and
183
+ * {@link DEFAULT_BRANDING.NAME} everywhere else.
184
+ *
185
+ * **DEGRADE is the posture, and it is chosen here for every command that prints a name.**
186
+ * `loadSourceConfig` raises for a config that exists and cannot be evaluated, and three of the
187
+ * four callers must survive precisely that state: `doctor`'s whole job is naming it,
188
+ * `uninstall` is the only way out of it, and `eject` already catches the same fault one method
189
+ * down so an ejection that landed is never reported as a run that did nothing. A heading is
190
+ * decoration — nothing about a display name is worth refusing a command over, and refusing
191
+ * here would turn the branding wiring into a new way for an unreadable config to abort three
192
+ * commands that survive it today. `init` is the fourth caller and cannot reach the catch at
193
+ * all: {@link ensureConfigReadable} has already refused every config this would read.
194
+ *
195
+ * The cause is not swallowed: it goes to `verbose`, and the command's own config reader reports
196
+ * it in full where the user needs to act on it. Reporting it twice would put a warning about
197
+ * the configuration above a heading, which is the one line that has to be the first thing on
198
+ * screen.
199
+ */
200
+ async resolveBrandingName(projectDir) {
201
+ try {
202
+ const branding = await resolveBranding(projectDir);
203
+ return branding.name;
204
+ } catch (error) {
205
+ verbose(`Could not read branding from the config: ${getErrorMessage(error)}`);
206
+ return DEFAULT_BRANDING.NAME;
207
+ }
208
+ }
154
209
  logSuccess(message) {
155
210
  this.log(`\u2713 ${message}`);
156
211
  }
@@ -366,10 +421,60 @@ var BaseCommand = class extends Command {
366
421
  if (skillIds.length === 0 && agentNames.length === 0) return;
367
422
  this.error(sharedConfigProjectScopeAtHome(skillIds, agentNames), { exit: EXIT_CODES.ERROR });
368
423
  }
424
+ /** Whether this run owes an account — the one thing a command may ask about the list. */
425
+ get hasIncompleteWork() {
426
+ return this.incompleteWork.length > 0;
427
+ }
428
+ /**
429
+ * Warns about work this run attempted and did not complete, and records it for the ending.
430
+ *
431
+ * Both halves, always. The warning stays at the point of failure because that is where it is
432
+ * explicable and where the surrounding output says what was being attempted; the record is
433
+ * what decides the exit code, and a failure the user is told about while the process reports
434
+ * success is exactly the state this closes.
435
+ *
436
+ * What it must never do is abort. Every caller sits past the point where the mutation it is
437
+ * reporting on has already happened, so stopping would relabel a state already committed to
438
+ * disk rather than prevent it — and would abandon the steps after it that can still land.
439
+ *
440
+ * The `recovery` sentences live in `INCOMPLETE_WORK_RECOVERY` in `utils/messages.ts`. One
441
+ * spelling per remedy is what matters; three spellings of "run compile" read as three
442
+ * different instructions.
443
+ */
444
+ reportIncompleteWork(what, recovery) {
445
+ this.warn(what);
446
+ this.recordIncompleteWork(what, recovery);
447
+ }
448
+ /**
449
+ * The recording half alone, for a caller that has already said its piece: a recompile warns
450
+ * once per failed sub-agent with the compiler's own reason, so the ending names the roster
451
+ * those reasons belong to instead of repeating any of them.
452
+ */
453
+ recordIncompleteWork(what, recovery) {
454
+ this.incompleteWork.push({ what, recovery });
455
+ }
456
+ /**
457
+ * The command's last word: what did not happen, what finishes it, and a non-zero exit.
458
+ *
459
+ * `this.exit` raises oclif's `ExitError`, which the framework carries to the process exit
460
+ * code and prints nothing for — so the account printed here is the whole of the output, with
461
+ * none of the `Error:` framing `this.error` would add to a command that in fact completed.
462
+ *
463
+ * A command that records must call this, or it files failures into a list nothing reads —
464
+ * which is the original silence wearing the mechanism built to close it, and is what
465
+ * `failure-reporting-classification.test.ts` holds every command in `src/cli/commands/` to.
466
+ */
467
+ exitIfWorkIncomplete() {
468
+ if (!this.hasIncompleteWork) return;
469
+ this.log(`
470
+ ${chalk.hex(CLI_COLORS.WARNING)(completedWithFailures(this.incompleteWork))}
471
+ `);
472
+ this.exit(EXIT_CODES.COMPLETED_WITH_FAILURES);
473
+ }
369
474
  };
370
475
 
371
476
  export {
372
477
  EXIT_CODES,
373
478
  BaseCommand
374
479
  };
375
- //# sourceMappingURL=chunk-YO2LTXB4.js.map
480
+ //# sourceMappingURL=chunk-KTXVQ7OM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/exit-codes.ts","../src/cli/base-command.ts","../src/cli/lib/operations/source/ensure-marketplace.ts","../src/cli/lib/operations/source/require-marketplace.ts"],"sourcesContent":["export const EXIT_CODES = {\n SUCCESS: 0,\n ERROR: 1,\n INVALID_ARGS: 2,\n NETWORK_ERROR: 3,\n CANCELLED: 4,\n /**\n * The command ran to the end and part of what it set out to do did not happen.\n *\n * Distinct from {@link EXIT_CODES.ERROR} because the two ask opposite things of whoever reads\n * them: an `ERROR` aborted, so nothing landed and the run can be repeated; this one landed and\n * the repeat is the wrong move — what is owed is the remedy the output names, per failure.\n * Collapsing it into `ERROR` would re-make the defect it exists to close one value along, and\n * a spec asserting `not.toBe(0)` cannot tell a refusal from a partial apply either.\n *\n * It is raised at the END of a command, never mid-flight: the work completes first, which is\n * the whole difference between this and `this.error`.\n */\n COMPLETED_WITH_FAILURES: 5,\n} as const;\n","import { Command } from \"@oclif/core\";\n\nimport chalk from \"chalk\";\nimport { unique } from \"remeda\";\n\nimport { CLI_COLORS, DEFAULT_BRANDING, MIN_TERMINAL_SIZE } from \"./consts.js\";\nimport { getErrorMessage } from \"./utils/errors.js\";\nimport { verbose } from \"./utils/logger.js\";\nimport {\n completedWithFailures,\n configUnreadableError,\n type IncompleteWork,\n pluginsInstalled,\n propagatedRecompileSummary,\n savedSkillMetadataUnusableError,\n scopeBlockedStackAssignment,\n sharedConfigProjectScopeAtHome,\n skillAssignedToNoAgent,\n skillMetadataUnusableDetail,\n STATUS_MESSAGES,\n} from \"./utils/messages.js\";\nimport {\n clearTerminalScreen,\n formatTerminalTooSmallMessage,\n isTerminalLargeEnough,\n} from \"./utils/terminal.js\";\nimport { EXIT_CODES } from \"./lib/exit-codes.js\";\nimport { isActiveAt } from \"./lib/configuration/scope-predicates.js\";\nimport { resolveBranding } from \"./lib/configuration/config.js\";\nimport { isHomeDirectory } from \"./lib/installation/index.js\";\nimport type { WizardResultV2 } from \"./components/wizard/wizard.js\";\nimport { getStackSkillIds } from \"./lib/stacks/index.js\";\nimport type {\n AgentName,\n MergedSkillsMatrix,\n ProjectConfig,\n SelectionValidation,\n SkillConfig,\n SkillId,\n} from \"./types/index.js\";\nimport { findConfigLoadFailures } from \"./lib/configuration/project-config.js\";\nimport { findUnusableSavedSkillMetadata } from \"./lib/skills/index.js\";\nimport { requireMarketplace } from \"./lib/operations/source/require-marketplace.js\";\nimport {\n installPluginSkills,\n pluginInstallFailureError,\n unbackedPluginInstallError,\n unbackedPluginSkillIds,\n type PluginInstallResult,\n} from \"./lib/operations/skills/install-plugin-skills.js\";\nimport type { GateReport } from \"./lib/config-gate/index.js\";\nimport type { SourceLoadResult } from \"./lib/loading/source-loader.js\";\n\n/**\n * How often the size gate re-reads the terminal while it is blocked. `resize` is what normally\n * ends the wait; the poll is the belt for the terminals and multiplexers that resize without\n * ever emitting one, and it is the only reason a blocked command is not a hung one there.\n */\nconst TERMINAL_RESIZE_POLL_MS = 500;\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- @types/node declares this as `number`; it is undefined whenever stdout is not a TTY\nconst terminalColumns = (): number => process.stdout.columns ?? MIN_TERMINAL_SIZE.COLS;\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- @types/node declares this as `number`; it is undefined whenever stdout is not a TTY\nconst terminalRows = (): number => process.stdout.rows ?? MIN_TERMINAL_SIZE.ROWS;\n\nfunction isTerminalBigEnough(): boolean {\n return isTerminalLargeEnough(terminalColumns(), terminalRows());\n}\n\n/**\n * Resolves the moment the terminal satisfies `isSatisfied` — on the resize event where there is\n * one, on the poll where there is not. Both listeners are torn down before resolving, so a\n * command that got past the gate leaves nothing behind holding the process open.\n */\nfunction waitForTerminal(isSatisfied: () => boolean): Promise<void> {\n return new Promise<void>((resolve) => {\n const check = () => {\n if (!isSatisfied()) return;\n clearInterval(interval);\n process.stdout.off(\"resize\", check);\n resolve();\n };\n const interval = setInterval(check, TERMINAL_RESIZE_POLL_MS);\n process.stdout.on(\"resize\", check);\n });\n}\n\n/** A selected skill no sub-agent's stack carries, and the sub-agents the scope rule blocked. */\ntype UnassignedSkill = { skillId: SkillId; blockedBy: AgentName[] };\n\n/**\n * Every active skill of a saved config that no agent's stack references, paired with the\n * global-scoped sub-agents that could not have carried it.\n *\n * `blockedBy` is empty for a global-scoped skill: the scope rule had no say there, and the\n * skill reached nothing for a different reason (no selected sub-agent the resolver\n * considers it relevant to). Naming sub-agents there would blame the wrong rule.\n */\nfunction findUnassignedSkills(config: ProjectConfig): UnassignedSkill[] {\n const assignedIds = new Set(config.stack ? getStackSkillIds(config.stack) : []);\n const globalAgentNames = config.agents\n .filter((agent) => isActiveAt(agent, \"global\"))\n .map((agent) => agent.name);\n\n const unassignedIds = unique(\n config.skills\n .filter((skill) => !skill.excluded)\n .map((skill) => skill.id)\n .filter((skillId) => !assignedIds.has(skillId)),\n );\n\n return unassignedIds.map((skillId) => ({\n skillId,\n blockedBy: hasActiveProjectEntry(config.skills, skillId) ? globalAgentNames : [],\n }));\n}\n\n/** True when an ACTIVE entry for this id sits at project scope — the only case the rule explains. */\nfunction hasActiveProjectEntry(skills: readonly SkillConfig[], skillId: SkillId): boolean {\n return skills.some((skill) => skill.id === skillId && isActiveAt(skill, \"project\"));\n}\n\n/**\n * What a decoded selection would file at PROJECT scope, split by kind because a skill's scope\n * and a sub-agent's are independent decisions in a payload — a refusal naming only one kind\n * would send the sharer to change the wrong entry.\n */\nfunction projectScopedContent(result: WizardResultV2): {\n skillIds: SkillId[];\n agentNames: AgentName[];\n} {\n return {\n skillIds: result.skills\n .filter((skill) => isActiveAt(skill, \"project\"))\n .map((skill) => skill.id),\n agentNames: result.agentConfigs\n .filter((agent) => isActiveAt(agent, \"project\"))\n .map((agent) => agent.name),\n };\n}\n\n/**\n * Nothing is inherited by every command, so this class declares no `baseFlags`.\n *\n * There was one — the marketplace flag — until naming a marketplace became `init`'s\n * decision alone (owner ruling 2026-08-09). Six commands were already opting out of it\n * through an exported empty-object cast; a flag one command wants is that command's flag,\n * so it is declared in `init` as `--marketplace` and the six opt-outs went with it.\n */\nexport abstract class BaseCommand extends Command {\n /**\n * Everything this run set out to do and did not, in the order it hit them.\n *\n * Non-empty is the whole of the exit-code decision — see {@link exitIfWorkIncomplete}. It is\n * deliberately not a boolean: a non-zero exit whose output does not say what failed and what\n * finishes it is worse than the silent success it replaces.\n *\n * Private, with {@link hasIncompleteWork} the only reading a subclass gets. A command records\n * through the two methods below and asks whether anything is owed; the list itself is this\n * class's, because it is this class that answers for it.\n */\n private readonly incompleteWork: IncompleteWork[] = [];\n\n async init(): Promise<void> {\n await super.init();\n await this.ensureTerminalSize();\n }\n\n /**\n * Blocks the command from launching in a terminal below\n * {@link MIN_TERMINAL_SIZE}. This runs once, before Ink mounts; the terminal\n * shrinking mid-session is caught by the matching guard in `WizardLayout`.\n */\n protected async ensureTerminalSize(): Promise<void> {\n if (isTerminalBigEnough()) return;\n\n this.clearTerminal();\n this.log(chalk.hex(CLI_COLORS.WARNING)(formatTerminalTooSmallMessage(terminalColumns())));\n\n await waitForTerminal(isTerminalBigEnough);\n }\n\n protected handleError(error: unknown): never {\n const message = getErrorMessage(error);\n this.error(message, { exit: EXIT_CODES.ERROR });\n }\n\n /**\n * The name this run prints itself under: `branding.name` where a config supplies one, and\n * {@link DEFAULT_BRANDING.NAME} everywhere else.\n *\n * **DEGRADE is the posture, and it is chosen here for every command that prints a name.**\n * `loadSourceConfig` raises for a config that exists and cannot be evaluated, and three of the\n * four callers must survive precisely that state: `doctor`'s whole job is naming it,\n * `uninstall` is the only way out of it, and `eject` already catches the same fault one method\n * down so an ejection that landed is never reported as a run that did nothing. A heading is\n * decoration — nothing about a display name is worth refusing a command over, and refusing\n * here would turn the branding wiring into a new way for an unreadable config to abort three\n * commands that survive it today. `init` is the fourth caller and cannot reach the catch at\n * all: {@link ensureConfigReadable} has already refused every config this would read.\n *\n * The cause is not swallowed: it goes to `verbose`, and the command's own config reader reports\n * it in full where the user needs to act on it. Reporting it twice would put a warning about\n * the configuration above a heading, which is the one line that has to be the first thing on\n * screen.\n */\n protected async resolveBrandingName(projectDir: string): Promise<string> {\n try {\n const branding = await resolveBranding(projectDir);\n return branding.name;\n } catch (error) {\n verbose(`Could not read branding from the config: ${getErrorMessage(error)}`);\n return DEFAULT_BRANDING.NAME;\n }\n }\n\n protected logSuccess(message: string): void {\n this.log(`✓ ${message}`);\n }\n\n protected logWarning(message: string): void {\n this.warn(message);\n }\n\n protected logInfo(message: string): void {\n this.log(message);\n }\n\n protected clearTerminal(): void {\n clearTerminalScreen();\n }\n\n /**\n * Resolves the marketplace required for a plugin operation, or hard-exits with\n * an actionable error when it cannot be resolved. `onRegistered` is invoked\n * (when provided) if the marketplace had to be registered — init uses it to log.\n */\n protected async requireMarketplaceOrExit(\n sourceResult: SourceLoadResult,\n purpose: string,\n onRegistered?: (marketplace: string) => void,\n ): Promise<string> {\n const required = await requireMarketplace(sourceResult, purpose);\n if (!required.ok) {\n this.error(required.error, { exit: EXIT_CODES.ERROR });\n }\n if (required.registered) {\n onRegistered?.(required.marketplace);\n }\n return required.marketplace;\n }\n\n /**\n * Reports every constraint a completed selection breaks — a conflicting pair, an unmet\n * requirement, an exclusive category with two picks.\n *\n * Shared by `init` and `edit` so one selection cannot be reported two ways. Both commands ask\n * the same question of the same matrix, so a roster that draws a warning through one must draw\n * the same warning through the other; `init` used to compute the answer and drop it, which is\n * the whole reason this lives here rather than on either command.\n *\n * These are advisory (`ValidationError` in types/matrix.ts): the selection is installed either\n * way and neither command's exit code turns on them, so they are warnings and not errors. The\n * loop is its own guard — an accepted selection carries no errors and says nothing.\n */\n protected reportValidationErrors(validation: SelectionValidation): void {\n for (const error of validation.errors) {\n this.warn(error.message);\n }\n }\n\n /**\n * Installs skill plugins and narrates the operation.\n *\n * Shared by `init` and `edit` for the same reason as {@link reportValidationErrors}:\n * both run the SAME install against the same marketplace, so a line one prints about\n * it the other owes. `edit` used to run it in silence — a real `claude plugin install`\n * was indistinguishable in the output from nothing having happened.\n *\n * The skills nothing carries are refused FIRST, by name: an install no marketplace\n * could serve is knowable before the Claude CLI is asked, and the generic\n * install-failure advice is unfollowable for a skill the user wrote themselves.\n */\n protected async installPluginSkillsReported(\n skills: SkillConfig[],\n marketplace: string,\n projectDir: string,\n matrix: MergedSkillsMatrix,\n ): Promise<PluginInstallResult> {\n const unbacked = unbackedPluginSkillIds(skills, matrix);\n if (unbacked.length > 0) {\n this.error(unbackedPluginInstallError(unbacked), { exit: EXIT_CODES.ERROR });\n }\n\n this.announcePluginInstall();\n const result = await installPluginSkills(skills, marketplace, projectDir);\n this.reportPluginInstalls(result);\n return result;\n }\n\n /**\n * The opening half of the narration above, exposed for the one caller that cannot\n * use the whole of it: an eject→plugin migration installs each plugin and deletes\n * that skill's working copy in the same step (see `executeMigration`), so the\n * install it performs is not this command's to run.\n */\n protected announcePluginInstall(): void {\n this.log(STATUS_MESSAGES.INSTALLING_PLUGINS);\n }\n\n /**\n * The closing half: what was installed, what was not, and the refusal to continue\n * past a failure.\n *\n * The hard-error is part of the report rather than each caller's own postscript\n * because it is the same rule everywhere — plugin install intent is inviolable, so\n * a run that could not honor it must stop BEFORE any config records a marketplace\n * `origin` for a skill with no plugin registration.\n */\n protected reportPluginInstalls(result: PluginInstallResult): void {\n for (const item of result.installed) {\n this.log(` Installed ${item.ref}`);\n }\n for (const item of result.failed) {\n this.warn(`Failed to install plugin ${item.id}: ${item.error}`);\n }\n if (result.failed.length > 0) {\n this.error(pluginInstallFailureError(result.failed.length), { exit: EXIT_CODES.ERROR });\n }\n this.log(`${pluginsInstalled(result.installed.length)}\\n`);\n }\n\n /**\n * Renders the recompile a gated write already performed on every OTHER registered\n * project this run's global change was propagated into.\n *\n * Shared by all four commands that fan out — the count and its wording are one\n * statement about one operation, and four copies of it had already drifted into two\n * spellings of the same sentence.\n */\n protected reportPropagatedRecompile(report: GateReport): void {\n if (report.propagated.updated.length === 0) return;\n\n const { rewrittenCount, unchangedCount, failedCount, warnings } = report.recompile;\n for (const warning of warnings) {\n this.warn(warning);\n }\n this.log(propagatedRecompileSummary(rewrittenCount, unchangedCount, failedCount));\n }\n\n /**\n * Names every selected skill this save left in no sub-agent's stack, and — where the\n * scope rule is why — every sub-agent it was kept away from.\n *\n * Shared by `init` and `edit` for the reason {@link reportValidationErrors} is: both\n * build the stack from the same rules over the same selection, so a skill that reaches\n * nothing through one reaches nothing through the other. The rule being reported is\n * CORRECT and nothing here changes it — a project-scoped skill installs, is written to\n * `config.ts`, and is loaded by nobody, which every other surface reports as a clean\n * install.\n *\n * `compile` says the same thing about the same shape one layer over, for a config\n * hand-edited into it — see `Compile.warnScopeDroppedStackPairs`.\n */\n protected reportUnassignedSkills(config: ProjectConfig): void {\n for (const { skillId, blockedBy } of findUnassignedSkills(config)) {\n this.warn(skillAssignedToNoAgent(skillId));\n if (blockedBy.length > 0) {\n this.warn(scopeBlockedStackAssignment(blockedBy, skillId));\n }\n }\n }\n\n /**\n * Refuses to run when a config file exists but cannot be loaded.\n *\n * Both configs this run would read are checked, because both are read on the way through: a\n * project's own `config.ts` and the global one every project write inlines. Checking up\n * front is the whole point — an unreadable GLOBAL config otherwise surfaced only at the\n * config write, after the wizard had copied skills and installed plugins, as a warning that\n * the write never happened.\n *\n * A MISSING config is not a corrupt one and passes here untouched: it is the legitimate\n * state `init` exists for, and the state `edit` reports as \"no installation\".\n */\n protected async ensureConfigReadable(projectDir: string): Promise<void> {\n const [failure] = await findConfigLoadFailures(projectDir);\n if (failure) {\n this.error(configUnreadableError(failure.message), { exit: EXIT_CODES.ERROR });\n }\n }\n\n /**\n * Refuses to run when a saved skill entry names a local skill that IS installed and whose\n * metadata.yaml describes no skill.\n *\n * One layer below {@link ensureConfigReadable} and for the same reason: the config parses,\n * and a file it points at does not. Both wizards resolve their saved roster against the\n * loaded catalogue, and an id nothing can be loaded for reaches no screen — so without this\n * the entry is dropped and reported as a skill the marketplace no longer carries, which is a\n * removal the user never asked for and a sentence blaming the wrong thing.\n *\n * Only entries the catalogue does not carry are looked at, so a healthy install pays a\n * filesystem read for nothing. An entry whose files are simply GONE is not refused — there\n * is no file to repair, so it is removed with a reason that says so\n * (`unresolvedSkillRemovalReasons`).\n *\n * Runs before the wizard mounts, which is the whole point: past that, a refusal costs the\n * user the session they had already spent, and everything this protects has been rewritten.\n */\n protected async ensureSavedSkillsReadable(\n savedSkills: readonly SkillConfig[],\n matrix: MergedSkillsMatrix,\n projectDir: string,\n ): Promise<void> {\n const unresolved = savedSkills\n .filter((saved) => !saved.excluded && !matrix.skills[saved.id])\n .map((saved) => saved.id);\n if (unresolved.length === 0) return;\n\n const unusable = await findUnusableSavedSkillMetadata(unresolved, savedSkills, projectDir);\n if (unusable.length === 0) return;\n\n // The detail is LOGGED and only the refusal is raised — oclif hard-wraps error text at the\n // terminal width, and a path broken across two lines is one nobody can copy. Same split\n // `compile` makes over the same verdict.\n for (const entry of unusable) {\n this.log(skillMetadataUnusableDetail(entry));\n }\n this.error(savedSkillMetadataUnusableError(unusable), { exit: EXIT_CODES.ERROR });\n }\n\n /**\n * Refuses a shared configuration carrying project-scoped content at the home directory.\n *\n * The home directory IS the global scope, and a global installation holds only global-scoped\n * content. Both scopes resolve to the same files there — one config, one skills directory, one\n * agents directory — so a project-scoped entry does not land somewhere else; it lands in the\n * global config wearing a label that contradicts the file it is in, and `toClaudePluginScope`\n * maps that declared scope onward, registering the skill against `$HOME` as a project. Nothing\n * below this point reads the scope again, so whatever the boundary lets through becomes the\n * truth.\n *\n * Shared by `init --from` and `edit --from` for the reason {@link reportValidationErrors} is\n * shared: it is a fact about the payload and the directory, identical whichever command asked,\n * and an invariant enforced on one producer and not the other is enforced nowhere. It matters\n * more on the destructive one — `edit --from` reaches the same contradiction through the other\n * door and can remove global entries on the way.\n *\n * The interactive producer has always answered this for itself — `isHomeDirectory(projectDir)`\n * reaches the wizard session as `isGlobalRoot` and the scope toggles are inert under it — so\n * this puts both `--from` paths on the rule the wizard already follows.\n *\n * It takes the DECODED selection, so it must run after the decode and can run no earlier: an\n * all-global configuration is exactly what a global installation is for, and only the decode\n * says which entries survived this catalogue and what scope each rests at. Every caller runs it\n * before it reports a skip and before it writes anything, so a run about to be refused neither\n * narrates nor mutates.\n */\n protected refuseProjectScopedContentAtHome(result: WizardResultV2, projectDir: string): void {\n if (!isHomeDirectory(projectDir)) return;\n\n const { skillIds, agentNames } = projectScopedContent(result);\n if (skillIds.length === 0 && agentNames.length === 0) return;\n\n this.error(sharedConfigProjectScopeAtHome(skillIds, agentNames), { exit: EXIT_CODES.ERROR });\n }\n\n /** Whether this run owes an account — the one thing a command may ask about the list. */\n protected get hasIncompleteWork(): boolean {\n return this.incompleteWork.length > 0;\n }\n\n /**\n * Warns about work this run attempted and did not complete, and records it for the ending.\n *\n * Both halves, always. The warning stays at the point of failure because that is where it is\n * explicable and where the surrounding output says what was being attempted; the record is\n * what decides the exit code, and a failure the user is told about while the process reports\n * success is exactly the state this closes.\n *\n * What it must never do is abort. Every caller sits past the point where the mutation it is\n * reporting on has already happened, so stopping would relabel a state already committed to\n * disk rather than prevent it — and would abandon the steps after it that can still land.\n *\n * The `recovery` sentences live in `INCOMPLETE_WORK_RECOVERY` in `utils/messages.ts`. One\n * spelling per remedy is what matters; three spellings of \"run compile\" read as three\n * different instructions.\n */\n protected reportIncompleteWork(what: string, recovery: string): void {\n this.warn(what);\n this.recordIncompleteWork(what, recovery);\n }\n\n /**\n * The recording half alone, for a caller that has already said its piece: a recompile warns\n * once per failed sub-agent with the compiler's own reason, so the ending names the roster\n * those reasons belong to instead of repeating any of them.\n */\n protected recordIncompleteWork(what: string, recovery: string): void {\n this.incompleteWork.push({ what, recovery });\n }\n\n /**\n * The command's last word: what did not happen, what finishes it, and a non-zero exit.\n *\n * `this.exit` raises oclif's `ExitError`, which the framework carries to the process exit\n * code and prints nothing for — so the account printed here is the whole of the output, with\n * none of the `Error:` framing `this.error` would add to a command that in fact completed.\n *\n * A command that records must call this, or it files failures into a list nothing reads —\n * which is the original silence wearing the mechanism built to close it, and is what\n * `failure-reporting-classification.test.ts` holds every command in `src/cli/commands/` to.\n */\n protected exitIfWorkIncomplete(): void {\n if (!this.hasIncompleteWork) return;\n\n this.log(`\\n${chalk.hex(CLI_COLORS.WARNING)(completedWithFailures(this.incompleteWork))}\\n`);\n this.exit(EXIT_CODES.COMPLETED_WITH_FAILURES);\n }\n}\n","import {\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n claudePluginMarketplaceUpdate,\n} from \"../../../utils/exec.js\";\nimport { fetchMarketplace } from \"../../loading/index.js\";\nimport { warn } from \"../../../utils/logger.js\";\nimport { getErrorMessage } from \"../../../utils/errors.js\";\nimport type { SourceLoadResult } from \"../../loading/source-loader.js\";\n\nexport type MarketplaceResult = {\n /** The resolved marketplace name, or null if no marketplace is configured. */\n marketplace: string | null;\n /** Whether a new marketplace was registered (vs. updated or already existed). */\n registered: boolean;\n};\n\n/**\n * Ensures the marketplace is registered with the Claude CLI.\n *\n * If the marketplace does not exist, registers it. If it exists, updates it.\n * Handles lazy marketplace name resolution when sourceResult.marketplace is undefined.\n *\n * Reports nothing on success — commands decide what to log based on the `registered`\n * flag — but never swallows a failure: `requireMarketplace` turns a null marketplace\n * into a hard error whose text cannot tell a transient fetch failure apart from a\n * source that genuinely ships no marketplace, so the cause is warned here or nowhere.\n */\nexport async function ensureMarketplace(\n sourceResult: SourceLoadResult,\n): Promise<MarketplaceResult> {\n const source = sourceResult.sourceConfig.source;\n\n if (!sourceResult.marketplace) {\n try {\n const marketplaceResult = await fetchMarketplace(source);\n sourceResult.marketplace = marketplaceResult.marketplace.name;\n } catch (error) {\n warn(`Could not resolve a marketplace from '${source}': ${getErrorMessage(error)}`);\n return { marketplace: null, registered: false };\n }\n }\n\n const marketplace = sourceResult.marketplace;\n const exists = await claudePluginMarketplaceExists(marketplace);\n\n if (!exists) {\n const marketplaceSource = source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n return { marketplace, registered: true };\n }\n\n try {\n await claudePluginMarketplaceUpdate(marketplace);\n } catch {\n warn(\"Could not update marketplace — continuing with cached version\");\n }\n\n return { marketplace, registered: false };\n}\n","import { ensureMarketplace } from \"./ensure-marketplace.js\";\nimport type { SourceLoadResult } from \"../../loading/source-loader.js\";\n\nexport type MarketplaceRequirement =\n { ok: true; marketplace: string; registered: boolean } | { ok: false; error: string };\n\n/**\n * Resolves the marketplace required for plugin operations. Plugin install\n * intent is inviolable — callers must hard-error on `ok: false` rather than\n * silently falling back to eject or skipping, and must do so BEFORE any\n * filesystem mutation so a failure leaves no partial state on disk.\n */\nexport async function requireMarketplace(\n sourceResult: SourceLoadResult,\n purpose: string,\n): Promise<MarketplaceRequirement> {\n const mpResult = await ensureMarketplace(sourceResult);\n if (!mpResult.marketplace) {\n return {\n ok: false,\n error:\n `Cannot ${purpose}: marketplace could not be resolved from '${sourceResult.sourceConfig.source}'. ` +\n `Plugin install mode requires a marketplace — fix the marketplace or switch the affected skills to eject mode.`,\n };\n }\n return { ok: true, marketplace: mpResult.marketplace, registered: mpResult.registered };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,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AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,qBAAqB,MAAc,UAAwB;AACnE,SAAK,eAAe,KAAK,EAAE,MAAM,SAAS,CAAC;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaU,uBAA6B;AACrC,QAAI,CAAC,KAAK,kBAAmB;AAE7B,SAAK,IAAI;AAAA,EAAK,MAAM,IAAI,WAAW,OAAO,EAAE,sBAAsB,KAAK,cAAc,CAAC,CAAC;AAAA,CAAI;AAC3F,SAAK,KAAK,WAAW,uBAAuB;AAAA,EAC9C;AACF;","names":[]}
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  useRowScroll
4
- } from "./chunk-WFRTHH3A.js";
4
+ } from "./chunk-TZRXWFF5.js";
5
5
  import {
6
6
  KEY_SPACE
7
7
  } from "./chunk-WTJ3AY33.js";
8
8
  import {
9
9
  CLI_COLORS,
10
10
  UI_SYMBOLS
11
- } from "./chunk-IO5YBKHV.js";
11
+ } from "./chunk-G6G2FT2G.js";
12
12
 
13
13
  // src/cli/components/wizard/checkbox-grid.tsx
14
14
  import { Box, Text, useInput } from "ink";
@@ -108,4 +108,4 @@ var CheckboxGrid = ({
108
108
  export {
109
109
  CheckboxGrid
110
110
  };
111
- //# sourceMappingURL=chunk-SY4X2LND.js.map
111
+ //# sourceMappingURL=chunk-KUZBMEWR.js.map