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
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-OZXAJNLA.js";
5
5
  import {
6
6
  CLI_COLORS
7
- } from "./chunk-IO5YBKHV.js";
7
+ } from "./chunk-G6G2FT2G.js";
8
8
 
9
9
  // src/cli/components/common/removal-plan-confirm.tsx
10
10
  import "react";
@@ -58,4 +58,4 @@ var RemovalPlanConfirm = ({
58
58
  export {
59
59
  RemovalPlanConfirm
60
60
  };
61
- //# sourceMappingURL=chunk-D2CAV7MG.js.map
61
+ //# sourceMappingURL=chunk-4DMFK67G.js.map
@@ -7,20 +7,19 @@ import {
7
7
  } from "./chunk-XVAQG2CV.js";
8
8
  import {
9
9
  useRowScroll
10
- } from "./chunk-WFRTHH3A.js";
10
+ } from "./chunk-TZRXWFF5.js";
11
11
  import {
12
+ showWarningsAsToast,
12
13
  useWizardStore
13
- } from "./chunk-F5T6TV4Z.js";
14
- import {
15
- matrix
16
- } from "./chunk-RWOYPOMR.js";
14
+ } from "./chunk-RLU2IXD3.js";
17
15
  import {
16
+ matrix,
18
17
  typedKeys
19
- } from "./chunk-VASLW636.js";
18
+ } from "./chunk-IGOFZG3S.js";
20
19
  import {
21
20
  CLI_COLORS,
22
21
  UI_SYMBOLS
23
- } from "./chunk-IO5YBKHV.js";
22
+ } from "./chunk-G6G2FT2G.js";
24
23
 
25
24
  // src/cli/components/wizard/stack-selection.tsx
26
25
  import { groupBy } from "remeda";
@@ -135,13 +134,13 @@ var StackSelection = ({ onCancel }) => {
135
134
  const globalPreselections = useWizardStore.getState().globalPreselections;
136
135
  const globalIds = globalPreselections?.map((s) => s.id) ?? [];
137
136
  const mergedIds = [.../* @__PURE__ */ new Set([...stack.allSkillIds, ...globalIds])];
138
- populateFromSkillIds(mergedIds, globalPreselections ?? void 0);
137
+ showWarningsAsToast(() => populateFromSkillIds(mergedIds, globalPreselections ?? void 0));
139
138
  setApproach("stack");
140
139
  setStep("domains");
141
140
  }
142
141
  function handleSelect(selectedId) {
143
142
  if (selectedId === "scratch") {
144
- startFromScratch();
143
+ showWarningsAsToast(startFromScratch);
145
144
  setStep("domains");
146
145
  return;
147
146
  }
@@ -195,4 +194,4 @@ var StackSelection = ({ onCancel }) => {
195
194
  export {
196
195
  StackSelection
197
196
  };
198
- //# sourceMappingURL=chunk-PNMM5HNX.js.map
197
+ //# sourceMappingURL=chunk-4EPJWN7C.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/components/wizard/stack-selection.tsx"],"sourcesContent":["import { groupBy } from \"remeda\";\nimport { useKeyboardNavigation } from \"../hooks/use-keyboard-navigation.js\";\nimport { Box, Text } from \"ink\";\nimport React, { useMemo } from \"react\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\nimport { matrix } from \"../../lib/matrix/matrix-provider.js\";\nimport { showWarningsAsToast, useWizardStore } from \"../../stores/wizard-store.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { useRowScroll } from \"../hooks/use-row-scroll.js\";\n\nimport type { AgentName, ResolvedStack } from \"../../types/index.js\";\nimport { typedKeys } from \"../../utils/typed-object.js\";\n\ntype StackItem = Pick<ResolvedStack, \"id\" | \"name\" | \"description\">;\ntype StackGroup = { label: string; items: StackItem[] };\n/** A focusable row id: a stack id, or the \"scratch\" sentinel for the \"Start from scratch\" row. */\ntype FocusId = string;\n\nconst OTHER_FRAMEWORKS_LABEL = \"Other Frameworks\";\nconst GROUP_ORDER: string[] = [\"React\", \"CLI\"];\nconst SCRATCH_LABEL = \"Start from scratch\";\nconst SCRATCH_DESCRIPTION = \"Select domains and skills manually\";\n\ntype GroupableStack = Pick<ResolvedStack, \"id\" | \"name\" | \"description\" | \"group\">;\n\nfunction toStackItem(stack: GroupableStack): StackItem {\n return { id: stack.id, name: stack.name, description: stack.description };\n}\n\n/** GROUP_ORDER labels first (in order), then unknown labels alphabetically. */\nfunction compareGroupLabels(a: string, b: string): number {\n const ai = GROUP_ORDER.indexOf(a);\n const bi = GROUP_ORDER.indexOf(b);\n if (ai !== -1 && bi !== -1) return ai - bi;\n if (ai !== -1) return -1;\n if (bi !== -1) return 1;\n return a.localeCompare(b);\n}\n\nfunction groupStacks(stacks: GroupableStack[]): StackGroup[] {\n // `|| undefined` keeps an empty-string group ungrouped; groupBy drops undefined keys.\n const byLabel = groupBy(stacks, (stack) => stack.group || undefined);\n const ungrouped = stacks.filter((stack) => !stack.group).map(toStackItem);\n\n // No explicit groups — flat list, no headers\n const labelled = Object.entries(byLabel).sort(([a], [b]) => compareGroupLabels(a, b));\n if (labelled.length === 0) {\n return [{ label: \"\", items: ungrouped }];\n }\n\n const groups = labelled.map(([label, stacksInGroup]) => ({\n label,\n items: stacksInGroup.map(toStackItem),\n }));\n return ungrouped.length > 0\n ? [...groups, { label: OTHER_FRAMEWORKS_LABEL, items: ungrouped }]\n : groups;\n}\n\nfunction buildFocusableIds(groups: StackGroup[]): FocusId[] {\n return [...groups.flatMap((g) => g.items.map((i) => i.id)), \"scratch\"];\n}\n\ntype StackListRow =\n | { type: \"header\"; label: string }\n | { type: \"spacer\" }\n | { type: \"stack\"; item: StackItem }\n | { type: \"scratch\" };\n\n/** One row per rendered line — headers, spacers, stack items, then the scratch row. */\nfunction buildStackRows(groups: StackGroup[]): StackListRow[] {\n const groupRows = groups.flatMap((group, groupIndex): StackListRow[] => [\n ...(groupIndex > 0 ? [{ type: \"spacer\" as const }] : []),\n ...(group.label ? [{ type: \"header\" as const, label: group.label }] : []),\n ...group.items.map((item): StackListRow => ({ type: \"stack\", item })),\n ]);\n return [...groupRows, { type: \"spacer\" }, { type: \"scratch\" }];\n}\n\nfunction isRowFocused(row: StackListRow, focusedId: FocusId): boolean {\n if (row.type === \"stack\") return row.item.id === focusedId;\n return row.type === \"scratch\" && focusedId === \"scratch\";\n}\n\nconst StackRow: React.FC<{ item: StackItem; isFocused: boolean }> = ({ item, isFocused }) => {\n const pointer = isFocused ? UI_SYMBOLS.CHEVRON : UI_SYMBOLS.CHEVRON_SPACER;\n return (\n <Box flexShrink={0}>\n <Text>\n <Text {...(isFocused && { color: CLI_COLORS.PRIMARY })}>{pointer}</Text>\n <Text {...(isFocused && { color: CLI_COLORS.PRIMARY })} bold={isFocused}>\n {\" \"}\n {item.name}\n </Text>\n <Text dimColor>\n {\" \"}\n {item.description}\n </Text>\n </Text>\n </Box>\n );\n};\n\nconst ScratchRow: React.FC<{ isFocused: boolean }> = ({ isFocused }) => {\n const pointer = isFocused ? UI_SYMBOLS.CHEVRON : UI_SYMBOLS.CHEVRON_SPACER;\n return (\n <Box flexShrink={0}>\n <Text>\n <Text {...(isFocused && { color: CLI_COLORS.PRIMARY })}>{pointer}</Text>\n <Text {...(isFocused && { color: CLI_COLORS.PRIMARY })} bold={isFocused}>\n {\" \"}\n {SCRATCH_LABEL}\n </Text>\n <Text dimColor>\n {\" \"}\n {SCRATCH_DESCRIPTION}\n </Text>\n </Text>\n </Box>\n );\n};\n\nexport type StackSelectionProps = {\n onCancel?: (() => void) | undefined;\n};\n\nexport const StackSelection: React.FC<StackSelectionProps> = ({ onCancel }) => {\n const {\n selectStack,\n setApproach,\n setStackAction,\n populateFromSkillIds,\n preselectAgentsFromStack,\n startFromScratch,\n setStep,\n } = useWizardStore();\n\n const stacks = matrix.suggestedStacks;\n const groups = useMemo(() => groupStacks(stacks), [stacks]);\n const rows = useMemo(() => buildStackRows(groups), [groups]);\n const focusableIds = useMemo(() => buildFocusableIds(groups), [groups]);\n\n const { focusedIndex } = useKeyboardNavigation(focusableIds.length, {\n ...(onCancel !== undefined && { onEscape: onCancel }),\n onEnter: (index) => handleSelect(focusableIds[index] ?? \"scratch\"),\n });\n const focusedId: FocusId = focusableIds[focusedIndex] ?? \"scratch\";\n const { ref: listRef, measuredHeight: listHeight } = useMeasuredHeight();\n\n const focusedVisualRow = useMemo(\n () => rows.findIndex((row) => isRowFocused(row, focusedId)),\n [rows, focusedId],\n );\n\n const { scrollEnabled, scrollTop } = useRowScroll({\n focusedIndex: focusedVisualRow,\n itemCount: rows.length,\n availableHeight: listHeight,\n });\n\n // The stack's own skills merged with the global preselections, and its agent\n // keys merged with the global agent preselections.\n //\n // The merge is the one population that runs while Ink owns the terminal: the global\n // preselections come from the global config, which can name a skill the loaded source does\n // not carry, so it warns from under a painted frame. `showWarningsAsToast` is what keeps that\n // off a stderr the next repaint would scroll away.\n function applyStack(stack: ResolvedStack): void {\n selectStack(stack.id);\n setStackAction(\"customize\");\n\n const stackAgents = typedKeys<AgentName>(stack.skills);\n preselectAgentsFromStack(stackAgents);\n\n const globalPreselections = useWizardStore.getState().globalPreselections;\n const globalIds = globalPreselections?.map((s) => s.id) ?? [];\n const mergedIds = [...new Set([...stack.allSkillIds, ...globalIds])];\n showWarningsAsToast(() => populateFromSkillIds(mergedIds, globalPreselections ?? undefined));\n\n setApproach(\"stack\");\n setStep(\"domains\");\n }\n\n function handleSelect(selectedId: FocusId): void {\n if (selectedId === \"scratch\") {\n // Same population, same frame: the scratch row applies the global preselections too.\n showWarningsAsToast(startFromScratch);\n setStep(\"domains\");\n return;\n }\n\n const focusedStack = stacks.find((s) => s.id === selectedId);\n if (focusedStack) applyStack(focusedStack);\n }\n\n return (\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 {rows.map((row, index) => {\n switch (row.type) {\n case \"spacer\":\n return (\n <Box key={`spacer-${index}`} flexShrink={0}>\n <Text> </Text>\n </Box>\n );\n case \"header\":\n return (\n <Box key={`header-${row.label}`} flexShrink={0}>\n <Text dimColor bold>\n {\" \"}\n {row.label}\n </Text>\n </Box>\n );\n case \"stack\":\n return (\n <StackRow\n key={row.item.id}\n item={row.item}\n isFocused={row.item.id === focusedId}\n />\n );\n case \"scratch\":\n return <ScratchRow key=\"scratch\" isFocused={focusedId === \"scratch\"} />;\n default: {\n const _exhaustive: never = row;\n return _exhaustive;\n }\n }\n })}\n </Box>\n </Box>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAExB,SAAS,KAAK,YAAY;AAC1B,SAAgB,eAAe;AA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BAFtB,IAAI,KAAK;AAAA,gBAGhB;AAAA,cAEJ,KAAK;AACH,uBAAO,oBAAC,cAAyB,WAAW,cAAc,aAAnC,SAA8C;AAAA,cACvE,SAAS;AACP,sBAAM,cAAqB;AAC3B,uBAAO;AAAA,cACT;AAAA,YACF;AAAA,UACF,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getAgentDefinitions
4
- } from "./chunk-ZUAZHDKP.js";
4
+ } from "./chunk-LDBVIPTP.js";
5
5
  import {
6
6
  loadMergedAgents
7
- } from "./chunk-XAXJWXI4.js";
7
+ } from "./chunk-RVXI5VQU.js";
8
8
 
9
9
  // src/cli/lib/operations/project/load-agent-defs.ts
10
10
  async function loadAgentDefs() {
@@ -20,4 +20,4 @@ async function loadAgentDefs() {
20
20
  export {
21
21
  loadAgentDefs
22
22
  };
23
- //# sourceMappingURL=chunk-MHRC3KRX.js.map
23
+ //# sourceMappingURL=chunk-4KHUHPX4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/operations/project/load-agent-defs.ts"],"sourcesContent":["import { getAgentDefinitions } from \"../../agents/index.js\";\nimport { loadMergedAgents } from \"../../loading/index.js\";\nimport type { AgentDefinition, AgentName, AgentSourcePaths } from \"../../../types/index.js\";\n\nexport type AgentDefs = {\n /**\n * The CLI's own sub-agent definitions — every `metadata.yaml` under its `src/agents/`, and\n * nothing a marketplace declares.\n */\n agents: Partial<Record<AgentName, AgentDefinition>>;\n /** The sourcePath used to load agent partials (for compilation). */\n sourcePath: string;\n /** Full agent source paths (agentsDir, sourcePath). */\n agentSourcePaths: AgentSourcePaths;\n};\n\n/**\n * The single definition of which sub-agents exist.\n *\n * Every path that emits the sub-agent unions in a `config-types.ts` derives its roster from here,\n * and so does every compile pass, because the answer has to be the same one: agent partials\n * resolve under {@link getAgentDefinitions}' local branch, and the generated `AGENT_NAMES` is\n * built by `scripts/generate-source-types.ts` from that same `src/agents/` directory. A roster\n * that included a marketplace's own sub-agents would put a literal in `AgentName` that nothing\n * downstream can honour (owner ruling 2026-08-21).\n *\n * It takes no arguments because there is nothing here for a caller to vary: agent partials\n * ship with the CLI, so {@link getAgentDefinitions} is always asked for its local branch.\n *\n * That local branch answers `sourcePath: PROJECT_ROOT`, so {@link loadMergedAgents} below is\n * handed the CLI's own root as its \"source\" and both of its sides read the same directory. The\n * merge is real and degenerate, which is why this used to be documented as \"CLI defaults plus\n * source overrides\" — a sentence describing an argument this function has not taken for some\n * time. The wiring was the intent; the sentence was the fossil.\n */\nexport async function loadAgentDefs(): Promise<AgentDefs> {\n const agentSourcePaths = await getAgentDefinitions();\n const agents = await loadMergedAgents(agentSourcePaths.sourcePath);\n\n return {\n agents,\n sourcePath: agentSourcePaths.sourcePath,\n agentSourcePaths,\n };\n}\n"],"mappings":";;;;;;;;;AAmCA,eAAsB,gBAAoC;AACxD,QAAM,mBAAmB,MAAM,oBAAoB;AACnD,QAAM,SAAS,MAAM,iBAAiB,iBAAiB,UAAU;AAEjE,SAAO;AAAA,IACL;AAAA,IACA,YAAY,iBAAiB;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
@@ -3,30 +3,28 @@ import {
3
3
  SEED_API_URL,
4
4
  SEED_USER_AGENT,
5
5
  readCarriedSkills
6
- } from "./chunk-PMUABBPG.js";
6
+ } from "./chunk-24IGOJ7E.js";
7
7
  import {
8
8
  ERROR_MESSAGES,
9
9
  MATRIX_VERSION,
10
10
  SEED_VERSION,
11
+ directoryExists,
12
+ getErrorMessage,
13
+ installableSeedPayloadSchema,
11
14
  isScopePairCompatible,
12
15
  loadProjectConfig,
13
16
  readForkedFromMetadata,
14
17
  resolveInstallPaths,
15
- seedModelSchema,
16
- seedPayloadSchema
17
- } from "./chunk-WCAUUBHO.js";
18
- import {
19
- directoryExists,
20
- getErrorMessage
21
- } from "./chunk-XAXJWXI4.js";
18
+ seedModelSchema
19
+ } from "./chunk-RVXI5VQU.js";
22
20
  import {
23
21
  typedEntries,
24
22
  typedValues
25
- } from "./chunk-VASLW636.js";
23
+ } from "./chunk-IGOFZG3S.js";
26
24
  import {
27
25
  DEFAULT_PUBLIC_SOURCE_NAME,
28
26
  EJECT_SOURCE
29
- } from "./chunk-IO5YBKHV.js";
27
+ } from "./chunk-G6G2FT2G.js";
30
28
 
31
29
  // src/cli/lib/seed/installation-payload.ts
32
30
  import path from "path";
@@ -130,10 +128,13 @@ function configToSeedPayload(config, carried) {
130
128
  ...carried.uncarryable
131
129
  ];
132
130
  if (unshareable.length > 0) throw new Error(unshareableConfigError(unshareable));
133
- return seedPayloadSchema.parse({
131
+ return installableSeedPayloadSchema.parse({
134
132
  v: SEED_VERSION,
135
133
  matrixVersion: MATRIX_VERSION,
136
134
  stackId: null,
135
+ // Absent rather than empty, for the reason the marketplace ref is: an id is the hash of its
136
+ // body, so a key meaning what its absence already means would remint every ordinary payload.
137
+ ...config.description !== void 0 && { description: config.description },
137
138
  ...marketplace.ref !== void 0 && { marketplace: marketplace.ref },
138
139
  skills: Object.fromEntries(
139
140
  skills.map((skill) => [skill.id, toSeedSkill(skill, assignments.get(skill.id))])
@@ -243,4 +244,4 @@ export {
243
244
  skillsAuthoredHere,
244
245
  publishSeedConfig
245
246
  };
246
- //# sourceMappingURL=chunk-2H7UWE2G.js.map
247
+ //# sourceMappingURL=chunk-CEGHC7L5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/seed/installation-payload.ts","../src/cli/lib/seed/config-to-seed.ts","../src/cli/lib/seed/publish-seed.ts"],"sourcesContent":["import path from \"path\";\n\nimport { configToSeedPayload, isInstalled } from \"./config-to-seed.js\";\nimport { readCarriedSkills } from \"./external-skills.js\";\nimport { EJECT_SOURCE } from \"../../consts.js\";\nimport { loadProjectConfig } from \"../configuration/project-config.js\";\nimport { resolveInstallPaths } from \"../installation/install-base-dir.js\";\nimport { readForkedFromMetadata } from \"../skills/skill-metadata.js\";\nimport { getErrorMessage } from \"../../utils/errors.js\";\nimport { directoryExists } from \"../../utils/fs.js\";\nimport { ERROR_MESSAGES } from \"../../utils/messages.js\";\n\nimport type { ContentReading, OwnedSkillDir } from \"./external-skills.js\";\nimport type { ProjectConfig, SkillConfig, SkillId } from \"../../types/index.js\";\nimport type { SeedPayload } from \"@workspace/matrix/seed\";\n\n/**\n * A payload ready to post, and what it will install — counted the way the sharer's own screens\n * count it, off the payload rather than off the config, so what a caller announces and what it\n * posts cannot disagree.\n */\nexport type InstallationPayload =\n { ok: true; payload: SeedPayload; skills: number; agents: number } | { ok: false; error: string };\n\n/** The config to map, or the sentence explaining why there is none to map. */\ntype InstalledConfig = { ok: true; config: ProjectConfig } | { ok: false; error: string };\n\n/** The mapped payload, or every line naming something the contract cannot carry. */\ntype MappedPayload = { ok: true; payload: SeedPayload } | { ok: false; error: string };\n\n/** The installation as the round trip sees it: what it owns, and what it has to carry with it. */\ntype RoundTrip = { config: ProjectConfig; content: ContentReading };\n\n/**\n * What the round trip makes of one installed entry: whether it travels at all, and whether its\n * bytes travel with it.\n */\ntype SkillJudgement = { skill: SkillConfig; owned: boolean; carried: OwnedSkillDir | null };\n\n/**\n * Read, map, refuse — everything that can fail locally, failing before anybody spends a write.\n *\n * Shared by the two commands that mint an id for what is installed here: `share`, which reports\n * the id, and `edit --ui`, which opens it. They are one operation with two endings, and this is\n * the half that has to be identical — two spellings of \"the installation in this directory\"\n * would mint two different ids for one project, and only one of them would be true.\n *\n * Every failure is a message rather than a throw, because nothing has been written by the time\n * it runs: the caller's only job is to explain, and both callers explain the same way.\n */\nexport async function seedPayloadForInstallation(projectDir: string): Promise<InstallationPayload> {\n const installed = await readInstalledConfig(projectDir);\n if (!installed.ok) return installed;\n\n const mapped = mapOrRefuse(await readRoundTrip(installed.config, projectDir));\n if (!mapped.ok) return mapped;\n\n const { payload } = mapped;\n const skills = Object.keys(payload.skills).length;\n const agents = Object.keys(payload.agents).length;\n\n // The same guard `init --from` applies on arrival, applied here before the write instead of\n // there after it. A sub-agent is installable on its own — it has front-matter, a prompt and a\n // compiled file without owning a single skill — so only a configuration with neither skills\n // nor sub-agents is nothing to carry.\n if (skills === 0 && agents === 0) return { ok: false, error: ERROR_MESSAGES.NO_INSTALLATION };\n\n return { ok: true, payload, skills, agents };\n}\n\n/**\n * The installation this directory has: its own configuration, or the global one it inherits.\n *\n * That is the config every other command reads here, and it carries the entries of BOTH scopes\n * with each entry's own scope on it — which is exactly what the wire keys by. So a payload minted\n * from a project describes the whole of what is installed for it rather than half of it, and the\n * receiver puts each entry back where this one had it.\n *\n * A config file that exists but cannot be loaded is a fault, not an absence, so its own message\n * is reported rather than read as \"not installed\".\n */\nasync function readInstalledConfig(projectDir: string): Promise<InstalledConfig> {\n try {\n const loaded = await loadProjectConfig(projectDir);\n if (!loaded) return { ok: false, error: ERROR_MESSAGES.NO_INSTALLATION };\n return { ok: true, config: loaded.config };\n } catch (error) {\n return { ok: false, error: getErrorMessage(error) };\n }\n}\n\n/**\n * The installation minus what the round trip does not own, plus the content it has to take along.\n *\n * `forkedFrom` decides ownership, and the round trip leaves what it does not own alone. The CLI\n * stamps that key into every skill directory it writes — an ejected catalogue skill, and a skill\n * a payload carried inline — while a skill the user wrote by hand into `.claude/skills/` carries\n * none. So absence of the key is not the whole answer and provenance is: what the CLI put there\n * says so on disk, and what a person put there says nothing because nothing forked it.\n *\n * A user-authored skill is therefore neither carried nor refused — it is simply outside the\n * round trip, and nothing about leaving it home is lossy because it was never in scope. Dropping\n * it here rather than in a command is what keeps `share` and `edit --ui`, which mint an id from\n * the same directory, from disagreeing about a single project.\n *\n * The stack rows naming a dropped skill go with it: `configToSeedPayload` keys assignments by\n * the skills it carries, so a row whose skill is gone is gone too.\n *\n * One walk answers both questions, because they are asked of the same file: whether the CLI put\n * this directory here, and — for the one kind of skill no catalogue can resolve — where its bytes\n * came from, so they can travel a second time.\n */\nasync function readRoundTrip(config: ProjectConfig, projectDir: string): Promise<RoundTrip> {\n const owned = (await judgeSkills(config, projectDir)).filter((entry) => entry.owned);\n\n return {\n config: { ...config, skills: owned.map((entry) => entry.skill) },\n content: await readCarriedSkills(owned.flatMap((entry) => entry.carried ?? [])),\n };\n}\n\n/** Every installed entry, judged. One walk of the disk, whichever half of the trip is asking. */\nfunction judgeSkills(config: ProjectConfig, projectDir: string): Promise<SkillJudgement[]> {\n return Promise.all(config.skills.map((skill) => judgeSkill(skill, projectDir)));\n}\n\n/**\n * The installed skills the round trip does NOT own — the user's own work, sitting in\n * `.claude/skills/` with no `forkedFrom` to say the CLI put it there.\n *\n * The producer already drops these on the way out, so no payload minted here ever named one.\n * This is the same judgement read by the other half: `edit --from` applies a payload\n * destructively, and a payload that made no statement about a skill cannot be read as an\n * instruction to delete it. Both halves ask {@link judgeSkill}, so \"outside the round trip\" has\n * one definition and cannot come to mean two things on one machine.\n */\nexport async function skillsAuthoredHere(\n config: ProjectConfig,\n projectDir: string,\n): Promise<Set<SkillId>> {\n const judged = await judgeSkills(config, projectDir);\n return new Set(judged.filter((entry) => !entry.owned).map((entry) => entry.skill.id));\n}\n\n/** The entry travels and no directory is read for it: a row naming an id is the whole of it. */\nfunction travelsAsAnId(skill: SkillConfig): SkillJudgement {\n return { skill, owned: true, carried: null };\n}\n\n/**\n * How one installed entry answers to the round trip — asked of the disk, offline, exactly as\n * `uninstall` asks it before removing anything.\n *\n * Only a directory that EXISTS and carries no provenance is somebody's own work, and that is the\n * one thing this excludes; each guard below says why the case above it never gets that far.\n */\nasync function judgeSkill(skill: SkillConfig, projectDir: string): Promise<SkillJudgement> {\n // A marketplace skill has no local directory to hold provenance and needs none: the marketplace\n // is what installs it again.\n if (skill.origin !== EJECT_SOURCE) return travelsAsAnId(skill);\n // A tombstone is a statement about something that is NOT installed here, so there are no bytes\n // of it to carry — and a refusal raised over them would refuse a share for a skill it is not\n // sharing.\n if (!isInstalled(skill)) return travelsAsAnId(skill);\n\n const skillsDir = resolveInstallPaths(projectDir, skill.scope).skillsDir;\n const skillDir = path.join(skillsDir, skill.id);\n // A configuration recording an install that is not there is evidence of nothing rather than\n // evidence of authorship, so it travels as the configuration records it.\n if (!(await directoryExists(skillDir))) return travelsAsAnId(skill);\n\n const provenance = await readForkedFromMetadata(skillDir);\n if (provenance === null) return { skill, owned: false, carried: null };\n\n return { skill, owned: true, carried: { id: skill.id, skillDir, provenance } };\n}\n\n/**\n * The mapping, with its refusals turned into this module's own currency.\n *\n * `configToSeedPayload` throws, and what it throws is a list: every line names something this\n * installation has that a shared configuration cannot say. That is a message for the user, not a\n * fault to propagate — the alternative is worse than a failed command, because a payload quietly\n * missing what it could not say still mints an id, and that id installs a configuration nobody\n * chose.\n */\nfunction mapOrRefuse({ config, content }: RoundTrip): MappedPayload {\n try {\n return { ok: true, payload: configToSeedPayload(config, content) };\n } catch (error) {\n return { ok: false, error: getErrorMessage(error) };\n }\n}\n","import { MATRIX_VERSION } from \"@workspace/matrix\";\nimport {\n SEED_VERSION,\n installableSeedPayloadSchema,\n seedModelSchema,\n} from \"@workspace/matrix/seed\";\n\nimport { DEFAULT_PUBLIC_SOURCE_NAME, EJECT_SOURCE } from \"../../consts.js\";\nimport { isScopePairCompatible } from \"../configuration/config-generator.js\";\nimport { typedEntries, typedValues } from \"../../utils/typed-object.js\";\n\nimport type { ContentReading } from \"./external-skills.js\";\nimport type {\n AgentScopeConfig,\n ProjectConfig,\n SkillConfig,\n SkillScope,\n} from \"../../types/config.js\";\nimport type { ModelName } from \"../../types/matrix.js\";\nimport type { SkillId } from \"../../types/skills.js\";\nimport type {\n SeedAgent,\n SeedLoadState,\n SeedModel,\n SeedPayload,\n SeedSkill,\n} from \"@workspace/matrix/seed\";\n\n/** Sub-agent name -> load state for one skill: the shape the wire keys by skill. */\ntype SeedAssignments = Record<string, SeedLoadState>;\n\n/** What one walk of `config.stack` yields: the wire's assignments, and the rows that cannot be one. */\ntype StackReading = {\n assignments: Map<SkillId, SeedAssignments>;\n /** Pairs the config model has nowhere to write, worded for the refusal. */\n unwritable: string[];\n};\n\n/**\n * An installed entry. An excluded one is a tombstone — a statement about something that is NOT\n * installed here — and presence is selection on the wire, so it has nothing to say. Nothing is\n * lost by leaving it home either: `init --from` installs into a clean setup, where there is no\n * global install for a tombstone to mask.\n *\n * Exported because the reader that gathers what an installation CARRIES has to agree with the\n * mapper about what it installs: content read for an entry this payload will not name is content\n * paid for by nobody, and a refusal raised over it would refuse a share for a skill it is not\n * sharing.\n */\nexport function isInstalled(entry: { excluded?: boolean }): boolean {\n return !entry.excluded;\n}\n\n/**\n * Whether a skill from this origin obliges the payload to name a marketplace.\n *\n * Two do not. An ejected copy travels with the project, and the default public catalogue is what\n * an absent ref already means — so neither puts a ref on the wire, and two identical selections\n * cannot mint two different ids over one.\n */\nfunction needsMarketplaceNamed(origin: string): boolean {\n return origin !== EJECT_SOURCE && origin !== DEFAULT_PUBLIC_SOURCE_NAME;\n}\n\n/**\n * Asked of the contract's own enum rather than spelled out here, so widening `MODEL_NAMES`\n * without widening the wire cannot slip past as a silently dropped pin.\n */\nfunction isSeedModel(model: ModelName): model is SeedModel {\n return seedModelSchema.safeParse(model).success;\n}\n\n/** The wire spells as an enum what a stack entry spells as a boolean, and an absent flag is lazy. */\nfunction seedLoadState(preloaded: boolean | undefined): SeedLoadState {\n return preloaded === true ? \"preloaded\" : \"lazy\";\n}\n\nfunction unnameableOriginMessage(skill: SkillConfig): string {\n return `${skill.id} comes from the marketplace '${skill.origin}', and this installation does not record where that marketplace is fetched from`;\n}\n\nfunction unnameableModelMessage(agent: AgentScopeConfig[\"name\"], model: ModelName): string {\n return `${agent} pins model '${model}', which this contract has no word for — leaving it out would say \"keep the sub-agent's own metadata\", which is a different instruction`;\n}\n\nfunction unwritablePairMessage(skillId: SkillId, agent: string): string {\n return `${skillId} -> ${agent}: a project-scoped skill never reaches a sub-agent that rests at global scope`;\n}\n\n/**\n * Names everything the contract cannot carry at once, not one thing at a time: a sharer who fixes\n * one only to be refused for the next learns nothing the first message could not have told them.\n *\n * The refusal exists because the alternative is worse than a failed command. A payload quietly\n * missing what it could not say still mints an id, and that id installs a configuration nobody\n * chose — with nothing on either side saying so.\n */\nfunction unshareableConfigError(unshareable: string[]): string {\n return [\n \"This installation cannot be shared as it stands — a shared configuration has no way to carry:\",\n ...unshareable.map((line) => ` ${line}`),\n \"Sharing it anyway would mint an id that installs something else.\",\n ].join(\"\\n\");\n}\n\n/** The ref a payload has to carry, and the skills no ref this config holds can account for. */\ntype MarketplaceReading = {\n /** Absent when nothing installed here came from a marketplace. */\n ref: string | undefined;\n unnameable: string[];\n};\n\n/**\n * Whether the marketplace this installation reads is the one `skill` came from.\n *\n * A skill's `origin` is a marketplace's NAME, `config.marketplace` is the ref it was fetched from,\n * and `marketplaceName` is what joins them — the name the install read out of that repository's\n * own manifest. Without both halves agreeing, the ref would send the receiver to a repository that\n * never served this skill, which is the same silent swap under a different spelling.\n */\nfunction isRecordedMarketplace(config: ProjectConfig, skill: SkillConfig): boolean {\n return config.marketplace !== undefined && skill.origin === config.marketplaceName;\n}\n\n/** Which marketplace the payload names, decided by the skills that oblige it to name one. */\nfunction readMarketplace(config: ProjectConfig, skills: SkillConfig[]): MarketplaceReading {\n const served = skills.filter((skill) => needsMarketplaceNamed(skill.origin));\n if (served.length === 0) return { ref: undefined, unnameable: [] };\n\n const unaccounted = served.filter((skill) => !isRecordedMarketplace(config, skill));\n if (unaccounted.length > 0) {\n return { ref: undefined, unnameable: unaccounted.map(unnameableOriginMessage) };\n }\n\n return { ref: config.marketplace, unnameable: [] };\n}\n\nfunction unnameableModels(agents: AgentScopeConfig[]): string[] {\n return agents.flatMap((agent) =>\n agent.model !== undefined && !isSeedModel(agent.model)\n ? [unnameableModelMessage(agent.name, agent.model)]\n : [],\n );\n}\n\n/**\n * Turns `config.stack` inside out: it is keyed by sub-agent and this contract is keyed by skill.\n *\n * Rows naming a sub-agent or a skill this configuration does not install are dropped rather than\n * refused, because they are already no part of what is installed — `compile` warns about exactly\n * those and leaves them out of the agents it writes, so carrying them would share more than this\n * project has.\n *\n * A row the config model cannot write is the opposite case and is collected for the refusal: the\n * decoder turns the same pair away on the way back in, so minting it would produce an id that\n * cannot be installed.\n */\nfunction readStack(\n stack: ProjectConfig[\"stack\"],\n skillScopes: Map<SkillId, SkillScope>,\n agentScopes: Map<string, SkillScope>,\n): StackReading {\n const assignments = new Map<SkillId, SeedAssignments>();\n const unwritable: string[] = [];\n\n for (const [agent, agentStack] of typedEntries(stack ?? {})) {\n const agentScope = agentScopes.get(agent);\n if (agentScope === undefined) continue;\n\n for (const categoryAssignments of typedValues(agentStack)) {\n for (const { id, preloaded } of categoryAssignments) {\n const skillScope = skillScopes.get(id);\n if (skillScope === undefined) continue;\n\n if (!isScopePairCompatible(skillScope, agentScope)) {\n unwritable.push(unwritablePairMessage(id, agent));\n continue;\n }\n\n const forSkill = assignments.get(id) ?? {};\n forSkill[agent] = seedLoadState(preloaded);\n assignments.set(id, forSkill);\n }\n }\n }\n\n return { assignments, unwritable };\n}\n\nfunction toSeedSkill(skill: SkillConfig, assignments: SeedAssignments | undefined): SeedSkill {\n return {\n // \"eject\" is the project's own copy; anything else is a plugin the marketplace serves, and\n // which marketplace that is has already had to be one the envelope's ref accounts for.\n install: skill.origin === EJECT_SOURCE ? \"eject\" : \"plugin\",\n scope: skill.scope,\n assignments: assignments ?? {},\n };\n}\n\n/**\n * A sub-agent's own row, and it always says `on`.\n *\n * The web app pins `on` only where a person did, because there an agent switched on by its rows is\n * already implied by them. An installed config is not an inference — every sub-agent it names was\n * chosen and has a compiled file on disk — so saying so outright is what carries the one that owns\n * no skill, which is the only thing the agents map can do that assignments cannot.\n */\nfunction toSeedAgent(agent: AgentScopeConfig): SeedAgent {\n return {\n on: true,\n scope: agent.scope,\n ...(agent.model !== undefined && isSeedModel(agent.model) && { model: agent.model }),\n ...(agent.effort !== undefined && { effort: agent.effort }),\n };\n}\n\n/**\n * Turns the installation this directory records into the payload the config store holds, so the\n * CLI can mint an id rather than only consume one.\n *\n * The inverse of `seedToWizardResult` in `seed-to-wizard.ts`, and held to it: a\n * payload minted here and decoded there has to describe the same install. That is why the scope\n * of every skill and sub-agent travels per entry rather than being implied, why the whole stack\n * is carried as per-`(skill, sub-agent)` assignments, and why nothing here leans on a wire default\n * the decoder would have to guess back.\n *\n * What it will not do is share a thinner configuration than the one installed. Anything the\n * contract cannot state is refused by name — see {@link unshareableConfigError} — because the\n * failure mode of the alternative is an id that silently installs something else.\n *\n * `stackId` is always null. A saved config records a stack's expansion and never the id it came\n * from, and the assignments above carry that expansion in full; naming an id this module invented\n * would make the receiver overlay a stack's own preload flags over the curation being shared.\n *\n * `description` is what a resolvable id would have supplied that the assignments do not, so it is\n * carried directly instead. That is the whole of the trade: the sentence travels, the roster the id\n * would have dragged behind it does not.\n *\n * `marketplace` is the one field carried for the payload rather than for an entry, because the\n * receiver loads one catalogue before it reads a single skill row — see {@link readMarketplace}.\n *\n * `carried` arrives as an argument because it is read off disk and this mapping touches none:\n * every id above is resolved by the receiver against a catalogue it already has, and the entries\n * in `carried` are the ones that answer to no catalogue in either direction. Stated rather than\n * defaulted, because a producer that forgot the content is exactly the defect this closed.\n */\nexport function configToSeedPayload(config: ProjectConfig, carried: ContentReading): SeedPayload {\n const skills = config.skills.filter(isInstalled);\n const agents = config.agents.filter(isInstalled);\n const skillScopes = new Map(skills.map((skill) => [skill.id, skill.scope]));\n const agentScopes = new Map<string, SkillScope>(agents.map((agent) => [agent.name, agent.scope]));\n\n const { assignments, unwritable } = readStack(config.stack, skillScopes, agentScopes);\n const marketplace = readMarketplace(config, skills);\n\n const unshareable = [\n ...marketplace.unnameable,\n ...unnameableModels(agents),\n ...unwritable,\n ...carried.uncarryable,\n ];\n if (unshareable.length > 0) throw new Error(unshareableConfigError(unshareable));\n\n // Parsed rather than merely assembled, exactly as the web app's encoder is: it makes \"the JSON\n // the store will hold\" literal, and it is the one gate that catches a field whose values have\n // drifted out of the wire's enums since this module last named them.\n //\n // The INSTALLABLE half of the contract, which is the schema the store's POST route declares —\n // the lenient one exists for READING links already out in the world, and this module only ever\n // mints. It refuses nothing the refusal above permits, and that is the point: it is the belt\n // over those braces, so the day this module's own rule and the wire's disagree, the mint fails\n // loudly here instead of minting an id that cannot be installed.\n return installableSeedPayloadSchema.parse({\n v: SEED_VERSION,\n matrixVersion: MATRIX_VERSION,\n stackId: null,\n // Absent rather than empty, for the reason the marketplace ref is: an id is the hash of its\n // body, so a key meaning what its absence already means would remint every ordinary payload.\n ...(config.description !== undefined && { description: config.description }),\n ...(marketplace.ref !== undefined && { marketplace: marketplace.ref }),\n skills: Object.fromEntries(\n skills.map((skill) => [skill.id, toSeedSkill(skill, assignments.get(skill.id))]),\n ),\n // Absent rather than empty, for the reason the marketplace ref is: an id is the hash of its\n // body, so a key meaning what its absence already means would remint every ordinary payload.\n ...(Object.keys(carried.external).length > 0 && { external: carried.external }),\n agents: Object.fromEntries(agents.map((agent) => [agent.name, toSeedAgent(agent)])),\n });\n}\n","import { z } from \"zod\";\n\nimport { SEED_API_URL, SEED_USER_AGENT } from \"./fetch-seed.js\";\n\nimport type { SeedPayload } from \"@workspace/matrix/seed\";\n\n/**\n * The store answers a stored configuration with its content-addressed id and nothing else.\n * Revalidated rather than read off the response type, because that type describes the worker this\n * CLI was built against and what answers is whatever is deployed.\n */\nconst mintedSchema = z.object({ id: z.string().min(1) });\n\nexport type PublishSeedResult = { ok: true; id: string } | { ok: false; error: string };\n\n/**\n * Stores a configuration and returns the id it was given.\n *\n * The outbound half of the boundary `fetchSeedConfig` in `fetch-seed.ts` owns the inbound half\n * of, and it keeps the same posture: every failure is a message rather than a throw.\n * Nothing local has been written by the time this runs, so there is nothing to roll back and the\n * caller's only job is to explain.\n *\n * The id is the payload's own hash, so re-sharing an unchanged configuration returns the id it\n * had — the store spends no write, and a caller can share as often as it likes.\n */\nexport async function publishSeedConfig(payload: SeedPayload): Promise<PublishSeedResult> {\n const url = `${SEED_API_URL}/configs`;\n\n let response: Response;\n try {\n response = await fetch(url, {\n method: \"POST\",\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n // The same signal the fetch half sends: it is the only thing that tells the store a\n // configuration came from the CLI rather than from a browser.\n \"user-agent\": SEED_USER_AGENT,\n },\n body: JSON.stringify(payload),\n });\n } catch {\n return { ok: false, error: `Could not reach ${SEED_API_URL} — check your connection.` };\n }\n\n if (!response.ok) {\n return { ok: false, error: `Sharing this configuration failed (HTTP ${response.status}).` };\n }\n\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n return { ok: false, error: \"The configuration store returned something that is not JSON.\" };\n }\n\n const minted = mintedSchema.safeParse(body);\n if (!minted.success) {\n // Reporting success here would print an id nobody can install and tell the user to use it.\n return { ok: false, error: \"The configuration store did not return an id for this share.\" };\n }\n\n return { ok: true, id: minted.data.id };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;;;ACiDV,SAAS,YAAY,OAAwC;AAClE,SAAO,CAAC,MAAM;AAChB;AASA,SAAS,sBAAsB,QAAyB;AACtD,SAAO,WAAW,gBAAgB,WAAW;AAC/C;AAMA,SAAS,YAAY,OAAsC;AACzD,SAAO,gBAAgB,UAAU,KAAK,EAAE;AAC1C;AAGA,SAAS,cAAc,WAA+C;AACpE,SAAO,cAAc,OAAO,cAAc;AAC5C;AAEA,SAAS,wBAAwB,OAA4B;AAC3D,SAAO,GAAG,MAAM,EAAE,gCAAgC,MAAM,MAAM;AAChE;AAEA,SAAS,uBAAuB,OAAiC,OAA0B;AACzF,SAAO,GAAG,KAAK,gBAAgB,KAAK;AACtC;AAEA,SAAS,sBAAsB,SAAkB,OAAuB;AACtE,SAAO,GAAG,OAAO,OAAO,KAAK;AAC/B;AAUA,SAAS,uBAAuB,aAA+B;AAC7D,SAAO;AAAA,IACL;AAAA,IACA,GAAG,YAAY,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE;AAAA,IACxC;AAAA,EACF,EAAE,KAAK,IAAI;AACb;AAiBA,SAAS,sBAAsB,Q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T6TV4Z.js";
4
+ } from "./chunk-RLU2IXD3.js";
5
5
  import {
6
- DEFAULT_SELECTION_OPTIONS,
6
+ AGENT_NAMES,
7
7
  isScopePairCompatible,
8
+ seedAgentScope,
8
9
  validateSelection
9
- } from "./chunk-WCAUUBHO.js";
10
- import {
11
- AGENT_NAMES
12
- } from "./chunk-XAXJWXI4.js";
10
+ } from "./chunk-RVXI5VQU.js";
13
11
  import {
14
12
  getCategoryDomain
15
- } from "./chunk-RWOYPOMR.js";
13
+ } from "./chunk-IGOFZG3S.js";
16
14
  import {
17
15
  DEFAULT_PUBLIC_SOURCE_NAME
18
- } from "./chunk-IO5YBKHV.js";
16
+ } from "./chunk-G6G2FT2G.js";
19
17
 
20
18
  // src/cli/lib/seed/seed-to-wizard.ts
21
19
  var KNOWN_AGENTS = new Set(AGENT_NAMES);
@@ -46,9 +44,6 @@ function readAgentMap(agents) {
46
44
  }
47
45
  return { known, switchedOff, unknown };
48
46
  }
49
- function seedAgentScope(entry) {
50
- return entry?.scope ?? DEFAULT_SELECTION_OPTIONS.scope;
51
- }
52
47
  function agentScopeConfig(name, entry) {
53
48
  return {
54
49
  name,
@@ -116,6 +111,10 @@ function seedToWizardResult(payload, matrix) {
116
111
  agentConfigs: selectedAgents.map((name) => agentScopeConfig(name, agentMap.known.get(name))),
117
112
  assignedStack,
118
113
  selectedStackId: payload.stackId,
114
+ // Spread-conditional rather than passed through, because absent and present-holding-undefined
115
+ // are different files on disk: a config describing itself with no key is not one describing
116
+ // itself with an empty sentence, and the writer emits whichever key it is handed.
117
+ ...payload.description !== void 0 && { description: payload.description },
119
118
  domainSelections,
120
119
  selectedDomains: orderDomains(Object.keys(domainSelections)),
121
120
  // Nothing was dropped from a *saved config* — the skipped ids came off the wire and are
@@ -139,4 +138,4 @@ function seedToWizardResult(payload, matrix) {
139
138
  export {
140
139
  seedToWizardResult
141
140
  };
142
- //# sourceMappingURL=chunk-MO5FGLVS.js.map
141
+ //# sourceMappingURL=chunk-DCIC35R7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/seed/seed-to-wizard.ts"],"sourcesContent":["import { seedAgentScope } from \"@workspace/matrix\";\n\nimport { AGENT_NAMES } from \"../../types/agents.js\";\nimport { DEFAULT_PUBLIC_SOURCE_NAME } from \"../../consts.js\";\nimport { isScopePairCompatible } from \"../configuration/config-generator.js\";\nimport { getCategoryDomain } from \"../matrix/matrix-provider.js\";\nimport { validateSelection } from \"../matrix/matrix-resolver.js\";\nimport { orderDomains } from \"../wizard/domain-order.js\";\n\nimport type { WizardResultV2 } from \"../../components/wizard/wizard.js\";\nimport type { AgentName } from \"../../types/agents.js\";\nimport type { AgentScopeConfig, SkillConfig } from \"../../types/config.js\";\nimport type {\n Category,\n Domain,\n DomainSelections,\n MergedSkillsMatrix,\n ResolvedSkill,\n} from \"../../types/matrix.js\";\nimport type { SkillAssignment, SkillId } from \"../../types/skills.js\";\nimport type { StackAgentConfig } from \"../../types/stacks.js\";\nimport type { SeedAgent, SeedLoadState, SeedPayload } from \"@workspace/matrix/seed\";\n\nexport type SeedMapping = {\n result: WizardResultV2;\n /** Ids this matrix does not know. Reported, never fatal — see the decode policy. */\n skippedSkillIds: string[];\n skippedAgentNames: string[];\n};\n\nconst KNOWN_AGENTS = new Set<string>(AGENT_NAMES);\n\n/** A skill's primary source, or the default marketplace. Mirrors the wizard's own resolution. */\nfunction sourceForSkill(skill: ResolvedSkill | undefined): string {\n return skill?.availableSources?.find((s) => s.primary)?.name ?? DEFAULT_PUBLIC_SOURCE_NAME;\n}\n\nfunction addToDomainSelections(\n selections: DomainSelections,\n domain: Domain,\n category: Category,\n skillId: SkillId,\n): void {\n const categorySelections = (selections[domain] ??= {});\n const skillList = (categorySelections[category] ??= []);\n if (!skillList.includes(skillId)) skillList.push(skillId);\n}\n\n/**\n * The stack mirror of {@link addToDomainSelections}: one sub-agent's own category lists, appended\n * in payload order. A `(skill, sub-agent)` pair can only occur once — `skills` is keyed by id — so\n * there is nothing to de-duplicate here.\n */\nfunction addToAgentStack(\n stack: Partial<Record<AgentName, StackAgentConfig>>,\n agent: AgentName,\n category: Category,\n assignment: SkillAssignment,\n): void {\n const agentStack = (stack[agent] ??= {});\n const assignments = (agentStack[category] ??= []);\n assignments.push(assignment);\n}\n\n/** A load state is per `(skill, sub-agent)`; `preloaded` is the stack's word for the same thing. */\nfunction toSkillAssignment(skillId: SkillId, load: SeedLoadState): SkillAssignment {\n return { id: skillId, preloaded: load === \"preloaded\" };\n}\n\n/** The payload's `agents` map, split by what this catalog can do with each entry. */\ntype SeedAgentMap = {\n /** Known agents the map has something to say about, keyed by name. */\n known: Map<AgentName, SeedAgent>;\n /** Names explicitly switched off — dropped, and their assignment rows ignored with them. */\n switchedOff: Set<string>;\n /** Names this catalog does not know. Reported, never fatal — same policy as unknown skill ids. */\n unknown: string[];\n};\n\nfunction readAgentMap(agents: SeedPayload[\"agents\"]): SeedAgentMap {\n const known = new Map<AgentName, SeedAgent>();\n const switchedOff = new Set<string>();\n const unknown: string[] = [];\n\n for (const [name, entry] of Object.entries(agents)) {\n if (!KNOWN_AGENTS.has(name)) unknown.push(name);\n else if (entry.on === false) switchedOff.add(name);\n else known.set(name as AgentName, entry);\n }\n\n return { known, switchedOff, unknown };\n}\n\n/**\n * A sub-agent's own row. Model and effort ride along on the same terms as its scope — an absent\n * key means \"keep whatever the agent's metadata says\".\n */\nfunction agentScopeConfig(name: AgentName, entry: SeedAgent | undefined): AgentScopeConfig {\n return {\n name,\n scope: seedAgentScope(entry),\n ...(entry?.model !== undefined && { model: entry.model }),\n ...(entry?.effort !== undefined && { effort: entry.effort }),\n };\n}\n\n/** A `(skill, sub-agent)` assignment the config model has nowhere to write. */\ntype UnwritableAssignment = { skillId: SkillId; agent: AgentName };\n\n/**\n * Names every unwritable pair, not just the first: a sharer who fixes one only to be refused for\n * the next learns nothing the first message could not have told them. Both halves of each pair are\n * named because neither alone says what to change — the skill can move to global scope, or the\n * sub-agent can be pinned to the project, and only the sharer knows which they meant.\n */\nfunction unwritableAssignmentsError(assignments: UnwritableAssignment[]): string {\n return [\n \"This configuration cannot be installed: a project-scoped skill never reaches a sub-agent \" +\n \"that rests at global scope, so these assignments have nowhere to be written:\",\n ...assignments.map(({ skillId, agent }) => ` ${skillId} -> ${agent}`),\n \"Re-share it with each sub-agent above pinned to the project, or each skill above at global scope.\",\n ].join(\"\\n\");\n}\n\n/**\n * Turns a shared configuration into the shape the install pipeline already consumes, so\n * `init --from` reuses `writeProjectConfig` -> skill install -> `compileAgentsAllScopes`\n * unchanged rather than growing a second path that can drift from the wizard's.\n *\n * Unknown ids are skipped, never fatal. Payloads carry catalog slugs precisely so they survive\n * catalog churn: a config shared before a skill was renamed should still install everything else,\n * and failing the whole decode would make every rename retroactively break every shared id.\n *\n * A sub-agent reaches the roster two ways: named by a surviving skill's assignment, or switched on\n * in the `agents` map. The map is the only place a configuration can say anything about an agent\n * no skill mentions, which is what makes a bare (skill-less) agent shareable at all; it also\n * carries that agent's model and effort onto its `AgentScopeConfig`.\n *\n * The `assignments` map is per `(skill, sub-agent)` and carries a load state, so it decides three\n * things the wizard cannot express separately: which sub-agents are selected, which skills land in\n * each one's stack entry, and which of those preload. That is why the result carries an\n * `assignedStack` — the install pipeline's ownership rules broadcast every scope-compatible skill\n * to every selected agent, which would hand a bare sub-agent someone else's skills.\n *\n * An unwritable `(skill, sub-agent)` pair is the one thing here that IS fatal, and it is fatal for\n * the opposite reason to the skips: an unknown id is content this catalog does not have, while an\n * unwritable pair is content it has and cannot place. Because `assignedStack` replaces the derived\n * stack wholesale, no scope filter runs on these rows downstream — they reach the writers, which\n * put them in neither half of the split config and say nothing. Refusing at the decode is what\n * keeps a payload from installing as a quieter configuration than the one that was shared.\n */\nexport function seedToWizardResult(payload: SeedPayload, matrix: MergedSkillsMatrix): SeedMapping {\n const domainSelections: DomainSelections = {};\n const assignedStack: Partial<Record<AgentName, StackAgentConfig>> = {};\n const skills: SkillConfig[] = [];\n const skippedSkillIds: string[] = [];\n const unwritable: UnwritableAssignment[] = [];\n const agentNames = new Set<AgentName>();\n const agentMap = readAgentMap(payload.agents);\n const skippedAgentNames = new Set<string>(agentMap.unknown);\n\n for (const [skillId, entry] of Object.entries(payload.skills)) {\n const skill = matrix.skills[skillId as SkillId];\n const domain = skill?.category ? getCategoryDomain(skill.category) : undefined;\n\n if (!skill?.category || !domain) {\n skippedSkillIds.push(skillId);\n continue;\n }\n\n // Past the guard the matrix knows this id, and its category is a real one: the `local`\n // pseudo-category has no domain, so it left with the skips.\n const id = skillId as SkillId;\n const category = skill.category as Category;\n\n addToDomainSelections(domainSelections, domain, category, id);\n\n skills.push({\n id,\n scope: entry.scope,\n // \"eject\" is an origin in its own right; anything else names the marketplace it came from.\n origin: entry.install === \"eject\" ? \"eject\" : sourceForSkill(skill),\n });\n\n // Only assignments on skills that survived — an agent should not be switched on by a skill\n // this catalog cannot install.\n for (const [agentName, load] of Object.entries(entry.assignments)) {\n if (agentMap.switchedOff.has(agentName)) continue;\n if (!KNOWN_AGENTS.has(agentName)) {\n skippedAgentNames.add(agentName);\n continue;\n }\n\n const agent = agentName as AgentName;\n // Rows the decode was going to ignore anyway have already left, so what reaches here is a\n // pair the payload really asked for — and the config model's one rule about pairs applies.\n if (!isScopePairCompatible(entry.scope, seedAgentScope(agentMap.known.get(agent)))) {\n unwritable.push({ skillId: id, agent });\n continue;\n }\n\n agentNames.add(agent);\n // The assignment is the curation: this sub-agent holds this skill, at this load state, and\n // no sub-agent the payload did not name holds it at all.\n addToAgentStack(assignedStack, agent, category, toSkillAssignment(id, load));\n }\n }\n\n if (unwritable.length > 0) throw new Error(unwritableAssignmentsError(unwritable));\n\n // Bare agents: switched on by the map alone, with no skill to carry them in.\n for (const [name, entry] of agentMap.known) {\n if (entry.on === true) agentNames.add(name);\n }\n\n const selectedAgents = [...agentNames];\n\n return {\n result: {\n skills,\n selectedAgents,\n agentConfigs: selectedAgents.map((name) => agentScopeConfig(name, agentMap.known.get(name))),\n assignedStack,\n selectedStackId: payload.stackId,\n // Spread-conditional rather than passed through, because absent and present-holding-undefined\n // are different files on disk: a config describing itself with no key is not one describing\n // itself with an empty sentence, and the writer emits whichever key it is handed.\n ...(payload.description !== undefined && { description: payload.description }),\n domainSelections,\n selectedDomains: orderDomains(Object.keys(domainSelections) as Domain[]),\n // Nothing was dropped from a *saved config* — the skipped ids came off the wire and are\n // reported to the user directly, so there is no config removal to explain.\n unresolvableSkillIds: [],\n cancelled: false,\n // Revalidated here rather than taken on trust from the app that built the payload. That app\n // validated against ITS catalog; this one skips ids it does not know and carries its own\n // relationship rules, so a configuration that was consistent where it was authored can\n // arrive with a requirement genuinely unmet. Running the same validator the wizard runs\n // makes that this catalog's verdict on what it can install — reported through the spine\n // `init` already has, beside the skips that explain it — rather than a fault in what was\n // shared.\n validation: validateSelection(skills.map((skill) => skill.id)),\n },\n skippedSkillIds,\n skippedAgentNames: [...skippedAgentNames],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,IAAM,eAAe,IAAI,IAAY,WAAW;AAGhD,SAAS,eAAe,OAA0C;AAChE,SAAO,OAAO,kBAAkB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,QAAQ;AAClE;AAEA,SAAS,sBACP,YACA,QACA,UACA,SACM;AACN,QAAM,qBAAsB,WAAW,MAAM,MAAM,CAAC;AACpD,QAAM,YAAa,mBAAmB,QAAQ,MAAM,CAAC;AACrD,MAAI,CAAC,UAAU,SAAS,OAAO,EAAG,WAAU,KAAK,OAAO;AAC1D;AAOA,SAAS,gBACP,OACA,OACA,UACA,YACM;AACN,QAAM,aAAc,MAAM,KAAK,MAAM,CAAC;AACtC,QAAM,cAAe,WAAW,QAAQ,MAAM,CAAC;AAC/C,cAAY,KAAK,UAAU;AAC7B;AAGA,SAAS,kBAAkB,SAAkB,MAAsC;AACjF,SAAO,EAAE,IAAI,SAAS,WAAW,SAAS,YAAY;AACxD;AAYA,SAAS,aAAa,QAA6C;AACjE,QAAM,QAAQ,oBAA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AAY;AAAA,MAC5E;AAAA,MACA,iBAAiB,aAAa,OAAO,KAAK,gBAAgB,CAAa;AAAA;AAAA;AAAA,MAGvE,sBAAsB,CAAC;AAAA,MACvB,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQX,YAAY,kBAAkB,OAAO,IAAI,CAAC,UAAU,MAAM,EAAE,CAAC;AAAA,IAC/D;AAAA,IACA;AAAA,IACA,mBAAmB,CAAC,GAAG,iBAAiB;AAAA,EAC1C;AACF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CLI_COLORS
4
- } from "./chunk-IO5YBKHV.js";
4
+ } from "./chunk-G6G2FT2G.js";
5
5
 
6
6
  // src/cli/components/wizard/toast.tsx
7
7
  import { Box, Text } from "ink";
@@ -25,4 +25,4 @@ var Toast = ({ children }) => {
25
25
  export {
26
26
  Toast
27
27
  };
28
- //# sourceMappingURL=chunk-ILUVL7WM.js.map
28
+ //# sourceMappingURL=chunk-DZD25NHW.js.map
@@ -22,8 +22,12 @@ function marketplaceManifestPath(dir) {
22
22
  return path.join(dir, PLUGIN_MANIFEST_DIR, MARKETPLACE_JSON);
23
23
  }
24
24
  var DEFAULT_PLUGIN_NAME = "agents-inc";
25
- var GLOBAL_INSTALL_ROOT = os.homedir();
26
- var CACHE_DIR = path.join(os.homedir(), ".cache", DEFAULT_PLUGIN_NAME);
25
+ function globalInstallRoot() {
26
+ return os.homedir();
27
+ }
28
+ function cacheRoot() {
29
+ return path.join(os.homedir(), ".cache", DEFAULT_PLUGIN_NAME);
30
+ }
27
31
  var CLI_INVOKE_COMMAND = "npx agents-inc";
28
32
  var EDITOR_URL = "https://agentsinc.sh";
29
33
  function editorConfigUrl(id) {
@@ -42,8 +46,7 @@ var DIRS = {
42
46
  agents: "src/agents",
43
47
  skills: SKILLS_DIR_PATH,
44
48
  stacks: "src/stacks",
45
- templates: "src/agents/_templates",
46
- commands: "src/commands"
49
+ templates: "src/agents/_templates"
47
50
  };
48
51
  var METADATA_YAML_FILE = "metadata.yaml";
49
52
  var STANDARD_FILES = {
@@ -74,7 +77,6 @@ var STANDARD_DIRS = {
74
77
  SCRIPTS: "scripts",
75
78
  SKILLS: "skills",
76
79
  AGENTS: "agents",
77
- COMMANDS: "commands",
78
80
  /** Legacy per-project template override directory (`.claude/templates`). */
79
81
  TEMPLATES: "templates"
80
82
  };
@@ -212,8 +214,8 @@ export {
212
214
  PLUGINS_DIST_PATH,
213
215
  marketplaceManifestPath,
214
216
  DEFAULT_PLUGIN_NAME,
215
- GLOBAL_INSTALL_ROOT,
216
- CACHE_DIR,
217
+ globalInstallRoot,
218
+ cacheRoot,
217
219
  CLI_INVOKE_COMMAND,
218
220
  EDITOR_URL,
219
221
  editorConfigUrl,
@@ -260,4 +262,4 @@ export {
260
262
  FALLBACK_DOMAIN,
261
263
  ASCII_LOGO
262
264
  };
263
- //# sourceMappingURL=chunk-IO5YBKHV.js.map
265
+ //# sourceMappingURL=chunk-G6G2FT2G.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/consts.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport type { Domain, InstallMode } from \"./types/index.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// After tsup build, dist/ is flat, so we go up one level from dist/ to get CLI root\n// In development (src/cli/consts.ts), we go up two levels\nconst isInDist = __dirname.includes(\"/dist\");\nconst CLI_ROOT = isInDist ? path.resolve(__dirname, \"..\") : path.resolve(__dirname, \"../..\");\nexport const PROJECT_ROOT = CLI_ROOT;\n\nexport const CLAUDE_DIR = \".claude\";\nexport const CLAUDE_SRC_DIR = \".claude-src\";\nexport const PLUGINS_SUBDIR = \"plugins\";\nexport const PLUGIN_MANIFEST_DIR = \".claude-plugin\";\nexport const PLUGIN_MANIFEST_FILE = \"plugin.json\";\nexport const MARKETPLACE_JSON = \"marketplace.json\";\n\n/**\n * The catalogue a marketplace publishes beside its manifest — its whole matrix\n * as JSON, in the shape `@workspace/matrix`'s `matrixSchema` describes.\n *\n * `marketplace.json` lists what a marketplace installs; this lists what it\n * OFFERS — every skill, category and stack, with the relationships resolved. The\n * editor fetches it directly and parses it with that schema, so nothing between\n * the two transforms it.\n */\nexport const CATALOG_JSON = \"catalog.json\";\n\n/**\n * What `generatedAt` says on a matrix that was WRITTEN to disk rather than built\n * in memory — a fixed word where the live matrix carries an ISO timestamp.\n *\n * A moment recorded in a committed artefact makes every regeneration a diff even\n * when nothing about the matrix moved, which costs the vendored\n * `types/generated/matrix.ts` a pull request of pure noise and costs\n * {@link CATALOG_JSON} its cache: the editor fetches the catalogue directly, and\n * a file whose bytes always change can never answer a conditional request.\n * Nothing reads the field back, so there is nothing a real timestamp would buy.\n *\n * Both emitters — `scripts/generate-source-types.ts` and `build marketplace` —\n * stamp this, and they are the only two places a matrix becomes a file.\n */\nexport const GENERATED_AT_BUILD = \"build\";\n\n/** Compiled plugin output directory, relative to a marketplace root */\nexport const PLUGINS_DIST_PATH = \"dist/plugins\";\n\n/** Path to the marketplace manifest inside a marketplace/source root. */\nexport function marketplaceManifestPath(dir: string): string {\n return path.join(dir, PLUGIN_MANIFEST_DIR, MARKETPLACE_JSON);\n}\nexport const DEFAULT_PLUGIN_NAME = \"agents-inc\";\n\n/**\n * Home directory used as the root for global installations, read when it is asked for.\n *\n * A `const` here froze whichever home was in force when this module was first imported, and the\n * damage was invisible: `runCliCommand` drives oclif through `dist/`, a SECOND module graph first\n * imported by whichever spec runs a command first, so the value settled on that spec's fake home\n * and every later spec in the file wrote under a directory its own `afterEach` had removed — the\n * writes succeeding, into the wrong tree. In the `src` graph it was worse still: `consts.ts` is\n * imported while vitest collects, before any hook has redirected the home, so the constant held\n * the DEVELOPER'S own home in every unit test that read it.\n *\n * Every other home-dir reader in the codebase already calls `os.homedir()` at call time —\n * `installBaseDir`, `isHomeDirectory`, `globalPairPaths` — each with its own note saying why.\n * This is that rule arriving at the constants file, and `home-dir-read-at-call-time.test.ts`\n * refuses the frozen shape from coming back.\n */\nexport function globalInstallRoot(): string {\n return os.homedir();\n}\n\n/** Root of the CLI's own cache, read at call time for the reason {@link globalInstallRoot} carries. */\nexport function cacheRoot(): string {\n return path.join(os.homedir(), \".cache\", DEFAULT_PLUGIN_NAME);\n}\n\n/**\n * Promoted invocation prefix shown in user-facing messages (e.g. \"Run '<CLI_INVOKE_COMMAND> init'\").\n *\n * `bin` in package.json registers BOTH names — `agents-inc` (primary, matching this constant and\n * the package name) and `agentsinc` (kept so existing global installs keep working). A global\n * install therefore answers to either spelling.\n *\n * `agents-inc` rather than `agentsinc` because it is the published package name, so `npx\n * agents-inc` resolves with nothing installed, and it is what agentsinc.sh hands people when they\n * copy an install command.\n *\n * CONVENTION: every user-facing instruction in this repo — messages, docs, code comments, agent\n * playbooks — writes commands in this `npx agents-inc <cmd>` form. Prose that merely names a\n * command (\"the `agents-inc list` table\") does not.\n */\nexport const CLI_INVOKE_COMMAND = \"npx agents-inc\";\n\n/**\n * The editor — the web half of the product, where a configuration is built without the wizard\n * and handed to `init --from <id>`. `agentsinc.sh` is the editor Worker's custom domain\n * (`apps/editor/wrangler.jsonc`); the config store it posts to is the sibling\n * `api.agentsinc.sh`, spelled once in `lib/seed/fetch-seed.ts` because that one is\n * overridable for tests and this one is not.\n */\nexport const EDITOR_URL = \"https://agentsinc.sh\";\n\n/**\n * Where a shared configuration opens in the editor — the form the editor's own Share button\n * copies, so a link the CLI prints and one the web app hands out are the same link.\n *\n * Exported before it had a second caller, and now it has two: `share` prints it, and\n * `edit --ui` hands it to a browser. Two surfaces each building their own query string is\n * exactly how one of them ends up pointing at a page the other never opens.\n */\nexport function editorConfigUrl(id: string): string {\n return `${EDITOR_URL}/?fromId=${encodeURIComponent(id)}`;\n}\n\n/**\n * Internal `edit` flag marking the invocation as the project-setup half of a `cc init`\n * that routed through the dashboard. Not part of the documented CLI surface (declared\n * `hidden`): `init` is the only caller, and it passes the flag so `edit` can tell\n * \"set this project up\" apart from a bare inspection.\n */\nexport const EDIT_PROJECT_SETUP_FLAG = \"project-setup\";\n\nexport const SKILL_CATEGORIES_PATH = \"config/skill-categories.ts\";\nexport const SKILL_RULES_PATH = \"config/skill-rules.ts\";\nexport const STACKS_FILE_PATH = \"config/stacks.ts\";\n/** Source root directory inside a marketplace/source repo (holds skills/, agents/, etc.). */\nexport const SOURCE_SRC_DIR = \"src\";\nexport const SKILLS_DIR_PATH = `${SOURCE_SRC_DIR}/skills`;\nexport const LOCAL_SKILLS_PATH = \".claude/skills\";\n\n/** Synthetic source name for skills copied into the project (ejected) rather than installed as plugins. */\nexport const EJECT_SOURCE = \"eject\";\n\n/** Pseudo-category assigned to local skills — not a `Category` union member; category traversals skip it. */\nexport const LOCAL_PSEUDO_CATEGORY = \"local\";\n\nexport const DIRS = {\n agents: \"src/agents\",\n skills: SKILLS_DIR_PATH,\n stacks: \"src/stacks\",\n templates: \"src/agents/_templates\",\n} as const;\n\n/** Single source for the metadata file name shared by skill and agent metadata. */\nconst METADATA_YAML_FILE = \"metadata.yaml\";\n\nexport const STANDARD_FILES = {\n SKILL_MD: \"SKILL.md\",\n METADATA_YAML: METADATA_YAML_FILE,\n METADATA_JSON: \"metadata.json\",\n CONFIG_YAML: \"config.yaml\",\n SKILL_CATEGORIES_TS: \"skill-categories.ts\",\n SKILL_RULES_TS: \"skill-rules.ts\",\n AGENT_METADATA_YAML: METADATA_YAML_FILE,\n PLUGIN_JSON: PLUGIN_MANIFEST_FILE,\n CONFIG_TS: \"config.ts\",\n CONFIG_TYPES_TS: \"config-types.ts\",\n CLAUDE_MD: \"CLAUDE.md\",\n README_MD: \"README.md\",\n REFERENCE_MD: \"reference.md\",\n IDENTITY_MD: \"identity.md\",\n PLAYBOOK_MD: \"playbook.md\",\n OUTPUT_MD: \"output.md\",\n CRITICAL_REQUIREMENTS_MD: \"critical-requirements.md\",\n CRITICAL_REMINDERS_MD: \"critical-reminders.md\",\n SETTINGS_JSON: \"settings.json\",\n SETTINGS_LOCAL_JSON: \"settings.local.json\",\n PACKAGE_JSON: \"package.json\",\n} as const;\n\nexport const STANDARD_DIRS = {\n EXAMPLES: \"examples\",\n SCRIPTS: \"scripts\",\n SKILLS: \"skills\",\n AGENTS: \"agents\",\n /** Legacy per-project template override directory (`.claude/templates`). */\n TEMPLATES: \"templates\",\n} as const;\n\nexport const DEFAULT_VERSION = \"1.0.0\";\n\n// \"0.0.0\" indicates no version was explicitly set\nexport const DEFAULT_DISPLAY_VERSION = \"0.0.0\";\n\n// JSON Schema URLs for yaml-language-server $schema comments.\n// Uses raw.githubusercontent.com so schemas resolve without requiring the CLI as a dependency.\n// The prefix encodes two things that have each moved once: the repository name (renamed to\n// agents-inc/agents-inc on 2026-08-04, when it stopped being only the CLI) and this package's\n// location inside it (packages/cli, since the monorepo merge). If either moves again this must\n// move with it, or every generated $schema comment 404s. GitHub redirects the old forms — files\n// written before each move still resolve, verified two renames deep — but a redirect is a\n// courtesy, so what we emit should be the current address rather than rely on one.\nconst SCHEMA_PKG_PREFIX =\n \"https://raw.githubusercontent.com/agents-inc/agents-inc/main/packages/cli/src/schemas\";\n\nexport const SCHEMA_PATHS = {\n agent: `${SCHEMA_PKG_PREFIX}/agent.schema.json`,\n metadata: `${SCHEMA_PKG_PREFIX}/metadata.schema.json`,\n customMetadata: `${SCHEMA_PKG_PREFIX}/custom-metadata.schema.json`,\n marketplace: `${SCHEMA_PKG_PREFIX}/marketplace.schema.json`,\n projectConfig: `${SCHEMA_PKG_PREFIX}/project-config.schema.json`,\n projectSourceConfig: `${SCHEMA_PKG_PREFIX}/project-source-config.schema.json`,\n stacks: `${SCHEMA_PKG_PREFIX}/stacks.schema.json`,\n} as const;\n\nexport const YAML_FORMATTING = {\n INDENT: 2,\n LINE_WIDTH: 120,\n /** lineWidth: 0 disables wrapping — used for metadata files */\n LINE_WIDTH_NONE: 0,\n} as const;\n\n// Shared glyphs: SELECTED/CHECK render the same checkmark; SKIPPED/DISABLED the\n// same en-dash. Both keys are kept so call sites express intent, but the value\n// has a single source.\nconst CHECK_GLYPH = \"\\u2713\";\nconst EN_DASH_GLYPH = \"\\u2013\";\n\nexport const UI_SYMBOLS = {\n CHECKBOX_CHECKED: \"[x]\",\n CHECKBOX_UNCHECKED: \"[ ]\",\n CHEVRON: \"\\u276F\",\n CHEVRON_SPACER: \" \",\n SELECTED: CHECK_GLYPH,\n UNSELECTED: \"\\u25CB\",\n CURRENT: \"\\u25CF\",\n SKIPPED: EN_DASH_GLYPH,\n DISCOURAGED: \"!\",\n DISABLED: EN_DASH_GLYPH,\n LOCK: \"\\uD83D\\uDD12\",\n EJECT: \"\\u23CF\",\n BULLET: \"\\u2022\",\n SCROLL_UP: \"\\u25B2\",\n SCROLL_DOWN: \"\\u25BC\",\n CHECK: CHECK_GLYPH,\n CROSS: \"\\u2717\",\n /** Removed/pending-removal diff marker (ASCII hyphen). Info panel + Sources tab share it. */\n REMOVED: \"-\",\n /** Added/newly-selected diff marker (ASCII plus). Info panel + Sources tab share it. */\n ADDED: \"+\",\n} as const;\n\nexport const GITHUB_SOURCE = {\n HTTPS_PREFIX: \"https://github.com/\",\n GITHUB_PREFIX: \"github:\",\n GH_PREFIX: \"gh:\",\n} as const;\n\n/** Name written into a global-scope config's `name` field (`~/.claude-src/config.ts`). */\nexport const GLOBAL_CONFIG_NAME = \"global\";\n\n/** Strict kebab-case: starts with letter, segments separated by single hyphens, no trailing hyphens */\nexport const KEBAB_CASE_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;\n\n/** Author handle format: `@` followed by a lowercase-led alphanumeric-hyphen slug. */\nexport const AUTHOR_HANDLE_PATTERN = /^@[a-z][a-z0-9-]*$/;\n\nexport const HASH_PREFIX_LENGTH = 7;\n\n/** Hex chars from SHA-256 hash used in cache directory names (64 bits of collision resistance) */\nexport const CACHE_HASH_LENGTH = 16;\n\n/** Max chars of human-readable prefix in cache directory names (for debugging) */\nexport const CACHE_READABLE_PREFIX_LENGTH = 32;\n\n// File size limits for parsing boundaries (DoS prevention)\nconst ONE_MB = 1024 * 1024;\nexport const MAX_MARKETPLACE_FILE_SIZE = 10 * ONE_MB;\nexport const MAX_PLUGIN_FILE_SIZE = ONE_MB;\nexport const MAX_CONFIG_FILE_SIZE = ONE_MB;\n\nexport const MAX_JSON_NESTING_DEPTH = 10;\nexport const MAX_MARKETPLACE_PLUGINS = 10_000;\n\nexport const SCROLL_VIEWPORT = {\n /** Height of the \"N more above\" scroll indicator */\n SCROLL_INDICATOR_HEIGHT: 1,\n /** Estimated lines per category name row (including top margin) */\n CATEGORY_NAME_LINES: 2,\n /** Margin between category sections (marginTop on CategorySection) */\n CATEGORY_MARGIN_LINES: 1,\n /** Minimum rows to show at least 1 category before enabling scroll */\n MIN_VIEWPORT_ROWS: 5,\n} as const;\n\n/**\n * The terminal geometry every command refuses to run below. This is the only\n * minimum-size gate there is: `BaseCommand.ensureTerminalSize` reads it and\n * blocks until the terminal is at least this big, so raising `ROWS` raises the\n * bar for the whole CLI, tests included.\n *\n * `ROWS: 20` is measured, not guessed. Driving the real binary to the build\n * step — the binding constraint, since it is the tallest step — gives:\n * 15/16/17 corrupt (overlapping card borders, unreadable); 18 the first clean\n * render (one complete category card, correctly clipped); 20 clean with one\n * full card plus the next category heading; 24 comfortable. 18 is the hard\n * correctness floor because it is where {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}\n * starts being satisfied — below it the shared scroll gate stops clipping and\n * the grid bleeds over its borders. 20 buys two rows of margin above that floor\n * while staying under the 24-row default of common terminals.\n */\nexport const MIN_TERMINAL_SIZE = {\n COLS: 80,\n ROWS: 20,\n} as const;\n\n/**\n * The terminal height at or above which the stack step paints the six-row ASCII\n * logo. Below it the logo is dropped — it is decoration, and the stack list is\n * the content.\n *\n * This is NOT a second size gate. {@link MIN_TERMINAL_SIZE} decides whether a\n * command runs at all; this decides only whether one decorative element renders\n * inside a terminal that already cleared that gate. Conflating them would be a\n * regression in both directions: raising `MIN_TERMINAL_SIZE.ROWS` to 26 would\n * refuse to run in the 24-row terminal that is still a common default, and\n * lowering this to 20 brings back the bleed below.\n *\n * 26 is measured against the real binary at 100 columns, on the stack step:\n *\n * | rows | stack step with the logo rendered |\n * | ---- | ----------------------------------------------------------------- |\n * | 20 | bleeds — stack rows paint over the \"Start from scratch\" row |\n * | 24 | bleeds — stack rows paint through the hotkey row and the footer |\n * | 26 | clean |\n * | 27 | clean |\n * | 28 | clean |\n *\n * The mechanism: the logo eats six rows of the stack step's list viewport,\n * starving it below {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}, at which point\n * the shared scroll hooks stop clipping and the rows bleed. Hiding the logo\n * returns those rows to the viewport; the bail-instead-of-clip behaviour itself\n * is untouched and remains the open underlying defect.\n */\nexport const LOGO_MIN_TERMINAL_ROWS = 26;\n\nexport const DEFAULT_BRANDING = {\n NAME: \"Agents Inc.\",\n TAGLINE: \"AI-powered development tools\",\n} as const;\n\n/**\n * Fallback name for the default public marketplace when marketplace.json is\n * unavailable. Same value as `DEFAULT_PLUGIN_NAME` but a distinct concept: this\n * is the resolved source/marketplace name, that is the plugin bundle name.\n */\nexport const DEFAULT_PUBLIC_SOURCE_NAME = DEFAULT_PLUGIN_NAME;\n\n/**\n * The npm package the public catalogue publishes from, and the one thing that\n * tells the catalogue apart from a marketplace merely calling itself\n * {@link DEFAULT_PUBLIC_SOURCE_NAME}.\n *\n * Nothing a marketplace ships is unforgeable — every signal is a string in a file\n * its author controls, this one included. What it does is make the reserved\n * namespace unreachable by ACCIDENT: taking it requires renaming your own package\n * to the catalogue's published, npm-scope-governed name, which is impersonation\n * rather than drift.\n *\n * Two guards read it and must agree, which is why it lives here rather than in\n * either: `validateMarketplaceName` (`lib/marketplace-generator.ts`) exempts the\n * catalogue from the reserved-name refusal at BUILD time, and the collision guard\n * in `lib/loading/source-loader.ts` exempts it from the catalogue-id refusal at\n * LOAD time. Two definitions of who the catalogue is would let a source be the\n * catalogue to one guard and not to the other.\n */\nexport const PUBLIC_CATALOGUE_PACKAGE = \"@agents-inc/skills\";\n\n/** Human-readable labels for skill source types shown in the wizard and edit command */\nexport const SOURCE_DISPLAY_NAMES: Record<string, string> = {\n public: \"Public\",\n eject: \"Eject\",\n \"agents-inc\": \"Agents Inc\",\n};\n\n/** The two install modes a Sources row offers, in the order the grid renders them. */\nexport const INSTALL_MODES = [\"eject\", \"plugin\"] as const satisfies readonly Exclude<\n InstallMode,\n \"mixed\"\n>[];\n\n/**\n * How the Sources grid captions each of its two cells.\n *\n * Deliberately not `INSTALL_MODE_LABELS` (`Eject`/`Plugin`), which names a mode by what it does\n * to the files, nor `SOURCE_DISPLAY_NAMES`, which labels a `SkillConfig.origin` VALUE on the\n * summary surfaces. The grid asks where the skill should LIVE, and the two answers are the\n * project's own copy or the marketplace plugin — so the cells read `Local` and `Plugin`, which\n * is also the two-state badge the editor settled on (`.claude-design/DECISIONS.md`).\n */\nexport const INSTALL_MODE_CELL_LABELS = {\n eject: \"Local\",\n plugin: \"Plugin\",\n} as const satisfies Record<Exclude<InstallMode, \"mixed\">, string>;\n\n/** Resolves a source name to its human-readable display label. */\nexport function formatSourceDisplayName(source: string): string {\n return SOURCE_DISPLAY_NAMES[source] ?? source;\n}\n\n/**\n * Marketplace-row value when skills are selected but every one of them is `EJECT_SOURCE`. \"eject\"\n * names no marketplace, so there is nothing to list — but the selection is not empty either, and\n * naming the default public marketplace would claim an origin none of those skills has.\n */\nexport const ALL_SKILLS_EJECTED_LABEL = \"All skills ejected\";\n\n// TODO: update naming convention to GRAY_1,2, etc\nexport const CLI_COLORS = {\n PRIMARY: \"#99FFFF\",\n SUCCESS: \"#90EE90\",\n ERROR: \"#DC343B\",\n WARNING: \"#E6A817\",\n INFO: \"#3B82F6\",\n NEUTRAL: \"#888888\",\n FOCUS: \"#87CEFA\",\n UNFOCUSED: \"#FFFFFF\",\n WHITE: \"#FFFFFF\",\n BLACK: \"#000000\",\n DIM: \"#666666\",\n GRAY_1: \"#ddd\",\n LABEL_BG: \"#383838\",\n TOAST_BG: \"#EEEEEE\",\n TOAST_FG: \"#000000\",\n HOVER_BG: \"#333333\",\n} as const;\n\n/** Default domains pre-selected when \"Start from scratch\" is chosen (all except CLI) */\nexport const DEFAULT_SCRATCH_DOMAINS: readonly Domain[] = [\"web\", \"api\", \"mobile\"];\n\n/** Domain used when no active domain can be resolved from wizard state. */\nexport const FALLBACK_DOMAIN: Domain = \"web\";\n\nexport const ASCII_LOGO = ` █████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ██╗███╗ ██╗ ██████╗\n██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██║████╗ ██║██╔════╝\n███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ██║██╔██╗ ██║██║\n██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ██║██║╚██╗██║██║\n██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ██║██║ ╚████║╚██████╗\n╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝`;\n"],"mappings":";;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAG9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,KAAK,QAAQ,UAAU;AAIzC,IAAM,WAAW,UAAU,SAAS,OAAO;AAC3C,IAAM,WAAW,WAAW,KAAK,QAAQ,WAAW,IAAI,IAAI,KAAK,QAAQ,WAAW,OAAO;AACpF,IAAM,eAAe;AAErB,IAAM,aAAa;AACnB,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAWzB,IAAM,eAAe;AAgBrB,IAAM,qBAAqB;AAG3B,IAAM,oBAAoB;AAG1B,SAAS,wBAAwB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,mBAAmB;AACrB;AAkBO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,MAAM;AACR;AA8BO,IAAM,yBAAyB;AAE/B,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AACX;AAOO,IAAM,6BAA6B;AAoBnC,IAAM,2BAA2B;AAGjC,IAAM,uBAA+C;AAAA,EAC1D,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,cAAc;AAChB;AAGO,IAAM,gBAAgB,CAAC,SAAS,QAAQ;AAcxC,IAAM,2BAA2B;AAAA,EACtC,OAAO;AAAA,EACP,QAAQ;AACV;AAGO,SAAS,wBAAwB,QAAwB;AAC9D,SAAO,qBAAqB,MAAM,KAAK;AACzC;AAOO,IAAM,2BAA2B;AAGjC,IAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,IAAM,0BAA6C,CAAC,OAAO,OAAO,QAAQ;AAG1E,IAAM,kBAA0B;AAEhC,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
@@ -1,8 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- typedKeys,
4
- typedValues
5
- } from "./chunk-VASLW636.js";
6
2
 
7
3
  // src/cli/types/generated/matrix.ts
8
4
  var BUILT_IN_MATRIX = {
@@ -9650,6 +9646,20 @@ var BUILT_IN_MATRIX = {
9650
9646
  generatedAt: "build"
9651
9647
  };
9652
9648
 
9649
+ // src/cli/utils/typed-object.ts
9650
+ function typedEntries(obj) {
9651
+ return Object.entries(obj);
9652
+ }
9653
+ function typedKeys(obj) {
9654
+ return Object.keys(obj);
9655
+ }
9656
+ function typedFromEntries(entries) {
9657
+ return Object.fromEntries(entries);
9658
+ }
9659
+ function typedValues(obj) {
9660
+ return Object.values(obj).filter((value) => value !== void 0);
9661
+ }
9662
+
9653
9663
  // src/cli/lib/matrix/matrix-provider.ts
9654
9664
  var matrix = BUILT_IN_MATRIX;
9655
9665
  function initializeMatrix(merged) {
@@ -9686,6 +9696,10 @@ function byCategoryDeclarationOrder() {
9686
9696
 
9687
9697
  export {
9688
9698
  BUILT_IN_MATRIX,
9699
+ typedEntries,
9700
+ typedKeys,
9701
+ typedFromEntries,
9702
+ typedValues,
9689
9703
  matrix,
9690
9704
  initializeMatrix,
9691
9705
  getSkillById,
@@ -9696,4 +9710,4 @@ export {
9696
9710
  findStack,
9697
9711
  byCategoryDeclarationOrder
9698
9712
  };
9699
- //# sourceMappingURL=chunk-RWOYPOMR.js.map
9713
+ //# sourceMappingURL=chunk-IGOFZG3S.js.map