@agents-inc/cli 0.46.0 → 0.47.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.
- package/CHANGELOG.md +13 -0
- package/dist/{chunk-G2WNOT3R.js → chunk-2RQYJFKA.js} +2 -2
- package/dist/{chunk-CD64ZNYI.js → chunk-3APMMQUA.js} +11 -3
- package/dist/chunk-3APMMQUA.js.map +1 -0
- package/dist/{chunk-DO5OZHSS.js → chunk-B4QYXVPZ.js} +2 -2
- package/dist/{chunk-5QRJUBK7.js → chunk-C4QI54PN.js} +20 -11
- package/dist/chunk-C4QI54PN.js.map +1 -0
- package/dist/{chunk-QBUOZVNZ.js → chunk-CJFWO46A.js} +2 -2
- package/dist/{chunk-VH3PI43B.js → chunk-DC333ZDC.js} +4 -4
- package/dist/{chunk-GVLYNP2I.js → chunk-DVW6ASTO.js} +4 -4
- package/dist/{chunk-NMXNHRAK.js → chunk-EZ46ZTAQ.js} +3 -3
- package/dist/{chunk-FUEZQ2H6.js → chunk-FMQ3A7W4.js} +4 -4
- package/dist/{chunk-74HSA7C4.js → chunk-FTD5Z6QD.js} +3 -1
- package/dist/{chunk-74HSA7C4.js.map → chunk-FTD5Z6QD.js.map} +1 -1
- package/dist/{chunk-KWQ2BQXF.js → chunk-FXQYEXLS.js} +3 -3
- package/dist/{chunk-RT6IBH37.js → chunk-GFDGYQ6M.js} +55 -21
- package/dist/chunk-GFDGYQ6M.js.map +1 -0
- package/dist/{chunk-CDGHSTB6.js → chunk-HLTJK3XB.js} +7 -5
- package/dist/chunk-HLTJK3XB.js.map +1 -0
- package/dist/{chunk-72GS6PIH.js → chunk-HPJP3HFD.js} +7 -7
- package/dist/{chunk-J64CA4V6.js → chunk-INKJBMPJ.js} +2 -2
- package/dist/{chunk-YVMYQSED.js → chunk-IRJADQM7.js} +2 -2
- package/dist/{chunk-PZLUO4OY.js → chunk-JTTTXGHX.js} +4 -4
- package/dist/{chunk-4C7PDDLY.js → chunk-JZHIF3K7.js} +5 -5
- package/dist/{chunk-D7JTL3DJ.js → chunk-KQ27IDYL.js} +2 -2
- package/dist/{chunk-SGXUMZWL.js → chunk-LJ5E4GXC.js} +2 -2
- package/dist/{chunk-LFZXMQOH.js → chunk-LNA6M2IE.js} +2 -2
- package/dist/{chunk-ODQ2BKWU.js → chunk-M4P5YJ45.js} +3 -3
- package/dist/{chunk-TOWP4T5L.js → chunk-MVEYK55V.js} +2 -2
- package/dist/{chunk-5M6JI76P.js → chunk-N5OCAAXY.js} +2 -2
- package/dist/{chunk-RWR56UVK.js → chunk-NRCKIHND.js} +11 -2
- package/dist/chunk-NRCKIHND.js.map +1 -0
- package/dist/{chunk-FKBCYT7B.js → chunk-OEJDFGAF.js} +5 -5
- package/dist/{chunk-I26YP2Q3.js → chunk-QR2TM4OY.js} +5 -5
- package/dist/{chunk-UK3AMBR7.js → chunk-SPSGZWTZ.js} +13 -6
- package/dist/{chunk-UK3AMBR7.js.map → chunk-SPSGZWTZ.js.map} +1 -1
- package/dist/{chunk-XE6RTHUD.js → chunk-TBB3THSL.js} +38 -3
- package/dist/chunk-TBB3THSL.js.map +1 -0
- package/dist/{chunk-7LDSHHKN.js → chunk-TWDVLTU6.js} +3 -3
- package/dist/{chunk-YT7UHV67.js → chunk-VAQJLHUW.js} +11 -9
- package/dist/chunk-VAQJLHUW.js.map +1 -0
- package/dist/{chunk-C7BO2ASM.js → chunk-VSZ5GDET.js} +2 -2
- package/dist/{chunk-CTQHZELA.js → chunk-XTRPYUWK.js} +14 -14
- package/dist/{chunk-HM3DHMW7.js → chunk-YTRFL3MR.js} +8 -8
- package/dist/chunk-YTRFL3MR.js.map +1 -0
- package/dist/{chunk-3WKFSTG6.js → chunk-ZWAL2ZY7.js} +2 -2
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +5 -5
- package/dist/commands/build/stack.js +5 -5
- package/dist/commands/compile.js +6 -6
- package/dist/commands/config/get.js +4 -4
- package/dist/commands/config/index.js +5 -5
- package/dist/commands/config/path.js +4 -4
- package/dist/commands/config/set-project.js +4 -4
- package/dist/commands/config/show.js +5 -5
- package/dist/commands/config/unset-project.js +4 -4
- package/dist/commands/diff.js +4 -4
- package/dist/commands/doctor.js +4 -4
- package/dist/commands/edit.js +29 -29
- package/dist/commands/eject.js +4 -4
- package/dist/commands/import/skill.js +5 -5
- package/dist/commands/info.js +5 -5
- package/dist/commands/init.js +28 -28
- package/dist/commands/list.js +4 -4
- package/dist/commands/new/agent.js +6 -6
- package/dist/commands/new/marketplace.js +5 -5
- package/dist/commands/new/skill.js +9 -6
- package/dist/commands/new/skill.js.map +1 -1
- package/dist/commands/outdated.js +4 -4
- package/dist/commands/search.js +7 -7
- package/dist/commands/uninstall.js +6 -6
- package/dist/commands/update.js +6 -6
- package/dist/commands/validate.js +229 -19
- package/dist/commands/validate.js.map +1 -1
- package/dist/components/skill-search/skill-search.js +3 -3
- package/dist/components/wizard/category-grid.js +2 -2
- package/dist/components/wizard/category-grid.test.js +122 -2
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/checkbox-grid.js +3 -3
- package/dist/components/wizard/checkbox-grid.test.js +3 -3
- package/dist/components/wizard/domain-selection.js +9 -9
- package/dist/components/wizard/help-modal.js +2 -2
- package/dist/components/wizard/menu-item.js +1 -1
- package/dist/components/wizard/search-modal.js +2 -2
- package/dist/components/wizard/search-modal.test.js +2 -2
- package/dist/components/wizard/section-progress.js +2 -2
- package/dist/components/wizard/section-progress.test.js +2 -2
- package/dist/components/wizard/selection-card.js +2 -2
- package/dist/components/wizard/source-grid.js +3 -3
- package/dist/components/wizard/source-grid.test.js +3 -3
- package/dist/components/wizard/stack-selection.js +8 -8
- package/dist/components/wizard/step-agents.js +8 -8
- package/dist/components/wizard/step-agents.test.js +9 -9
- package/dist/components/wizard/step-build.js +8 -8
- package/dist/components/wizard/step-build.test.js +78 -46
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +4 -4
- package/dist/components/wizard/step-confirm.test.js +8 -8
- package/dist/components/wizard/step-refine.js +2 -2
- package/dist/components/wizard/step-refine.test.js +2 -2
- package/dist/components/wizard/step-settings.js +5 -5
- package/dist/components/wizard/step-settings.test.js +8 -8
- package/dist/components/wizard/step-sources.js +10 -10
- package/dist/components/wizard/step-sources.test.js +11 -11
- package/dist/components/wizard/step-stack.js +12 -12
- package/dist/components/wizard/step-stack.test.js +13 -13
- package/dist/components/wizard/view-title.js +2 -2
- package/dist/components/wizard/wizard-layout.js +8 -8
- package/dist/components/wizard/wizard-tabs.js +2 -2
- package/dist/components/wizard/wizard-tabs.test.js +2 -2
- package/dist/components/wizard/wizard.js +25 -25
- package/dist/hooks/init.js +3 -3
- package/dist/{source-manager-6QZ2GDUA.js → source-manager-Q34LTUVM.js} +4 -4
- package/dist/src/agents/meta/documentor/examples.md +35 -36
- package/dist/src/agents/meta/documentor/workflow.md +91 -105
- package/dist/stores/wizard-store.js +5 -5
- package/dist/stores/wizard-store.test.js +48 -6
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/src/agents/meta/documentor/examples.md +35 -36
- package/src/agents/meta/documentor/workflow.md +91 -105
- package/src/schemas/agent.schema.json +3 -0
- package/src/schemas/metadata.schema.json +3 -0
- package/dist/chunk-5QRJUBK7.js.map +0 -1
- package/dist/chunk-CD64ZNYI.js.map +0 -1
- package/dist/chunk-CDGHSTB6.js.map +0 -1
- package/dist/chunk-HM3DHMW7.js.map +0 -1
- package/dist/chunk-RT6IBH37.js.map +0 -1
- package/dist/chunk-RWR56UVK.js.map +0 -1
- package/dist/chunk-XE6RTHUD.js.map +0 -1
- package/dist/chunk-YT7UHV67.js.map +0 -1
- /package/dist/{chunk-G2WNOT3R.js.map → chunk-2RQYJFKA.js.map} +0 -0
- /package/dist/{chunk-DO5OZHSS.js.map → chunk-B4QYXVPZ.js.map} +0 -0
- /package/dist/{chunk-QBUOZVNZ.js.map → chunk-CJFWO46A.js.map} +0 -0
- /package/dist/{chunk-VH3PI43B.js.map → chunk-DC333ZDC.js.map} +0 -0
- /package/dist/{chunk-GVLYNP2I.js.map → chunk-DVW6ASTO.js.map} +0 -0
- /package/dist/{chunk-NMXNHRAK.js.map → chunk-EZ46ZTAQ.js.map} +0 -0
- /package/dist/{chunk-FUEZQ2H6.js.map → chunk-FMQ3A7W4.js.map} +0 -0
- /package/dist/{chunk-KWQ2BQXF.js.map → chunk-FXQYEXLS.js.map} +0 -0
- /package/dist/{chunk-72GS6PIH.js.map → chunk-HPJP3HFD.js.map} +0 -0
- /package/dist/{chunk-J64CA4V6.js.map → chunk-INKJBMPJ.js.map} +0 -0
- /package/dist/{chunk-YVMYQSED.js.map → chunk-IRJADQM7.js.map} +0 -0
- /package/dist/{chunk-PZLUO4OY.js.map → chunk-JTTTXGHX.js.map} +0 -0
- /package/dist/{chunk-4C7PDDLY.js.map → chunk-JZHIF3K7.js.map} +0 -0
- /package/dist/{chunk-D7JTL3DJ.js.map → chunk-KQ27IDYL.js.map} +0 -0
- /package/dist/{chunk-SGXUMZWL.js.map → chunk-LJ5E4GXC.js.map} +0 -0
- /package/dist/{chunk-LFZXMQOH.js.map → chunk-LNA6M2IE.js.map} +0 -0
- /package/dist/{chunk-ODQ2BKWU.js.map → chunk-M4P5YJ45.js.map} +0 -0
- /package/dist/{chunk-TOWP4T5L.js.map → chunk-MVEYK55V.js.map} +0 -0
- /package/dist/{chunk-5M6JI76P.js.map → chunk-N5OCAAXY.js.map} +0 -0
- /package/dist/{chunk-FKBCYT7B.js.map → chunk-OEJDFGAF.js.map} +0 -0
- /package/dist/{chunk-I26YP2Q3.js.map → chunk-QR2TM4OY.js.map} +0 -0
- /package/dist/{chunk-7LDSHHKN.js.map → chunk-TWDVLTU6.js.map} +0 -0
- /package/dist/{chunk-C7BO2ASM.js.map → chunk-VSZ5GDET.js.map} +0 -0
- /package/dist/{chunk-CTQHZELA.js.map → chunk-XTRPYUWK.js.map} +0 -0
- /package/dist/{chunk-3WKFSTG6.js.map → chunk-ZWAL2ZY7.js.map} +0 -0
- /package/dist/{source-manager-6QZ2GDUA.js.map → source-manager-Q34LTUVM.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## [0.47.0] - 2026-02-25
|
|
13
|
+
|
|
14
|
+
**Custom domain support, source validation, wizard improvements, dead code cleanup**
|
|
15
|
+
|
|
16
|
+
- Domain field on skill metadata and agent YAML for custom marketplace support
|
|
17
|
+
- `validate --source` command for source repository validation
|
|
18
|
+
- Fix custom skill ID rejection in stacks validation
|
|
19
|
+
- Remove redundant verifyHash and legacy slash-in-skill-ID code
|
|
20
|
+
|
|
21
|
+
See [changelogs/0.47.0.md](./changelogs/0.47.0.md) for full details.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
12
25
|
## [0.46.0] - 2026-02-24
|
|
13
26
|
|
|
14
27
|
**Custom extensibility, new commands, agent-mapping removal, wizard improvements**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CLI_BIN_NAME,
|
|
4
4
|
DEFAULT_BRANDING
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FTD5Z6QD.js";
|
|
6
6
|
import {
|
|
7
7
|
init_esm_shims
|
|
8
8
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
INFO_MESSAGES,
|
|
68
68
|
DRY_RUN_MESSAGES
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-2RQYJFKA.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
CLI_COLORS,
|
|
7
7
|
SCROLL_VIEWPORT
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FTD5Z6QD.js";
|
|
9
9
|
import {
|
|
10
10
|
init_esm_shims
|
|
11
11
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -209,14 +209,21 @@ var CategorySection = ({
|
|
|
209
209
|
isLocked,
|
|
210
210
|
isFocused,
|
|
211
211
|
focusedOptionIndex,
|
|
212
|
-
showLabels
|
|
212
|
+
showLabels,
|
|
213
|
+
expertMode
|
|
213
214
|
}) => {
|
|
215
|
+
const selectedCount = options.filter((o) => o.selected).length;
|
|
216
|
+
const selectionCounter = expertMode ? null : category.exclusive ? `(${selectedCount} of 1)` : `(${selectedCount} selected)`;
|
|
214
217
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: isFirst ? 0 : 1, children: [
|
|
215
218
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "row", children: [
|
|
216
219
|
/* @__PURE__ */ jsx(Text, { dimColor: isLocked, color: isFocused ? "#fff" : "gray", children: category.displayName }),
|
|
217
220
|
category.required && /* @__PURE__ */ jsxs(Text, { color: isLocked ? CLI_COLORS.NEUTRAL : CLI_COLORS.ERROR, dimColor: isLocked, children: [
|
|
218
221
|
" ",
|
|
219
222
|
SYMBOL_REQUIRED
|
|
223
|
+
] }),
|
|
224
|
+
selectionCounter && /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
225
|
+
" ",
|
|
226
|
+
selectionCounter
|
|
220
227
|
] })
|
|
221
228
|
] }),
|
|
222
229
|
/* @__PURE__ */ jsx(Box, { flexDirection: "row", flexWrap: "wrap", marginTop: 0, children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
@@ -360,6 +367,7 @@ var CategoryGrid = ({
|
|
|
360
367
|
isFocused: index === focusedRow,
|
|
361
368
|
focusedOptionIndex: focusedCol,
|
|
362
369
|
showLabels,
|
|
370
|
+
expertMode,
|
|
363
371
|
isFirst: index === 0
|
|
364
372
|
}
|
|
365
373
|
) }, category.id);
|
|
@@ -373,4 +381,4 @@ var CategoryGrid = ({
|
|
|
373
381
|
export {
|
|
374
382
|
CategoryGrid
|
|
375
383
|
};
|
|
376
|
-
//# sourceMappingURL=chunk-
|
|
384
|
+
//# sourceMappingURL=chunk-3APMMQUA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/category-grid.tsx","../src/cli/components/hooks/use-category-grid-input.ts"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { Box, type DOMElement, Text, measureElement } from \"ink\";\n\nimport { CLI_COLORS, SCROLL_VIEWPORT } from \"../../consts.js\";\nimport type { SkillId, Subcategory } from \"../../types/index.js\";\nimport { isSectionLocked, useCategoryGridInput } from \"../hooks/use-category-grid-input.js\";\nimport { useFocusedListItem } from \"../hooks/use-focused-list-item.js\";\n\nexport type OptionState = \"normal\" | \"recommended\" | \"discouraged\" | \"disabled\";\n\nexport type CategoryOption = {\n id: SkillId;\n label: string;\n state: OptionState;\n stateReason?: string;\n selected: boolean;\n local?: boolean;\n installed?: boolean;\n};\n\nexport type CategoryRow = {\n id: Subcategory;\n displayName: string;\n required: boolean;\n exclusive: boolean;\n options: CategoryOption[];\n};\n\nexport type CategoryGridProps = {\n categories: CategoryRow[];\n /** Available height in terminal lines for the scrollable viewport. 0 = no constraint. */\n availableHeight?: number;\n showLabels: boolean;\n expertMode: boolean;\n onToggle: (categoryId: Subcategory, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n /** Optional initial focus row (default: 0). Use with React `key` to reset. */\n defaultFocusedRow?: number;\n /** Optional initial focus col (default: 0). Use with React `key` to reset. */\n defaultFocusedCol?: number;\n /** Optional callback fired whenever the focused position changes */\n onFocusChange?: (row: number, col: number) => void;\n};\n\nconst SYMBOL_REQUIRED = \"*\";\n\n/**\n * Priority order for skill states in the initial sort.\n * Lower numbers appear first. Selected skills are sorted above all states.\n */\nconst STATE_PRIORITY: Record<OptionState, number> = {\n recommended: 0,\n normal: 1,\n discouraged: 2,\n disabled: 3,\n};\n\n/**\n * Sort options by: selected first, then by state priority.\n * Within each group, original matrix order is preserved (stable sort).\n */\nconst stableSortByState = (options: CategoryOption[]): CategoryOption[] => {\n return [...options].sort((a, b) => {\n if (a.selected !== b.selected) return a.selected ? -1 : 1;\n return STATE_PRIORITY[a.state] - STATE_PRIORITY[b.state];\n });\n};\n\nconst findNextValidOption = (\n options: CategoryOption[],\n currentIndex: number,\n direction: 1 | -1,\n wrap = true,\n): number => {\n const length = options.length;\n if (length === 0) return currentIndex;\n\n let index = currentIndex + direction;\n\n if (wrap) {\n if (index < 0) index = length - 1;\n if (index >= length) index = 0;\n } else {\n if (index < 0) index = 0;\n if (index >= length) index = length - 1;\n }\n\n return index;\n};\n\ntype SkillTagProps = {\n option: CategoryOption;\n isFocused: boolean;\n isLocked: boolean;\n showLabels: boolean;\n};\n\nconst getCompatibilityLabel = (option: CategoryOption, isLocked: boolean): string | null => {\n if (option.selected) return \"(selected)\";\n if (isLocked || option.state === \"disabled\") return \"(disabled)\";\n if (option.state === \"recommended\") return \"(recommended)\";\n if (option.state === \"discouraged\") return \"(discouraged)\";\n return null;\n};\n\nconst SkillTag: React.FC<SkillTagProps> = ({ option, isFocused, isLocked, showLabels }) => {\n const getTextColor = (): string => {\n if (option.state === \"disabled\" && option.selected) return CLI_COLORS.PRIMARY;\n if (isLocked || option.state === \"disabled\") return CLI_COLORS.NEUTRAL;\n if (option.selected) return CLI_COLORS.PRIMARY;\n if (option.state === \"recommended\") return CLI_COLORS.UNFOCUSED;\n if (option.state === \"discouraged\") return CLI_COLORS.WARNING;\n\n return CLI_COLORS.NEUTRAL;\n };\n\n const getStateBorderColor = (): string => {\n if (option.state === \"disabled\" && option.selected) return CLI_COLORS.PRIMARY;\n if (isLocked || option.state === \"disabled\") return CLI_COLORS.NEUTRAL;\n if (option.selected) return CLI_COLORS.PRIMARY;\n if (option.state === \"recommended\") return CLI_COLORS.UNFOCUSED;\n if (option.state === \"discouraged\") return CLI_COLORS.WARNING;\n return CLI_COLORS.UNFOCUSED;\n };\n\n const textColor = getTextColor();\n const compatibilityLabel = showLabels ? getCompatibilityLabel(option, isLocked) : null;\n\n return (\n <Box\n marginRight={1}\n borderColor={isFocused ? getStateBorderColor() : CLI_COLORS.NEUTRAL}\n borderStyle=\"single\"\n flexShrink={0}\n >\n <>\n <Text color={textColor} bold dimColor={option.state === \"disabled\" && option.selected}>\n {\" \"}\n {option.label}{\" \"}\n </Text>\n {compatibilityLabel && <Text dimColor>{compatibilityLabel} </Text>}\n </>\n </Box>\n );\n};\n\ntype CategorySectionProps = {\n isFirst: boolean;\n category: CategoryRow;\n options: CategoryOption[];\n isLocked: boolean;\n isFocused: boolean;\n focusedOptionIndex: number;\n showLabels: boolean;\n expertMode: boolean;\n};\n\nconst CategorySection: React.FC<CategorySectionProps> = ({\n isFirst,\n category,\n options,\n isLocked,\n isFocused,\n focusedOptionIndex,\n showLabels,\n expertMode,\n}) => {\n const selectedCount = options.filter((o) => o.selected).length;\n\n const selectionCounter = expertMode\n ? null\n : category.exclusive\n ? `(${selectedCount} of 1)`\n : `(${selectedCount} selected)`;\n\n return (\n <Box flexDirection=\"column\" marginTop={isFirst ? 0 : 1}>\n <Box flexDirection=\"row\">\n <Text dimColor={isLocked} color={isFocused ? \"#fff\" : \"gray\"}>\n {category.displayName}\n </Text>\n {category.required && (\n <Text color={isLocked ? CLI_COLORS.NEUTRAL : CLI_COLORS.ERROR} dimColor={isLocked}>\n {\" \"}\n {SYMBOL_REQUIRED}\n </Text>\n )}\n {selectionCounter && <Text dimColor> {selectionCounter}</Text>}\n </Box>\n\n <Box flexDirection=\"row\" flexWrap=\"wrap\" marginTop={0}>\n {options.map((option, index) => (\n <SkillTag\n key={option.id}\n option={option}\n isFocused={isFocused && index === focusedOptionIndex && !isLocked}\n isLocked={isLocked}\n showLabels={showLabels}\n />\n ))}\n </Box>\n </Box>\n );\n};\n\ntype ProcessedCategory = CategoryRow & { sortedOptions: CategoryOption[] };\n\nexport const CategoryGrid: React.FC<CategoryGridProps> = ({\n categories,\n availableHeight = 0,\n showLabels,\n expertMode,\n onToggle,\n onToggleLabels,\n defaultFocusedRow = 0,\n defaultFocusedCol = 0,\n onFocusChange,\n}) => {\n // Cache the initial sort order per category so toggling selections does not reorder skills.\n // The ref resets when the component remounts (e.g., domain change via key={activeDomain}).\n const initialOrderRef = useRef<Map<string, SkillId[]>>(new Map());\n\n const processedCategories = useMemo(\n () =>\n categories.map((category) => {\n const cached = initialOrderRef.current.get(category.id);\n if (cached) {\n const orderMap = new Map(cached.map((id, idx) => [id, idx]));\n const sorted = [...category.options].sort((a, b) => {\n const aIdx = orderMap.get(a.id) ?? Infinity;\n const bIdx = orderMap.get(b.id) ?? Infinity;\n return aIdx - bIdx;\n });\n return { ...category, sortedOptions: sorted };\n }\n const sorted = stableSortByState(category.options);\n initialOrderRef.current.set(\n category.id,\n sorted.map((o) => o.id),\n );\n return { ...category, sortedOptions: sorted };\n }),\n [categories],\n );\n\n const getColCount = useCallback(\n (row: number): number => processedCategories[row]?.sortedOptions.length ?? 0,\n [processedCategories],\n );\n\n const isRowLocked = useCallback(\n (row: number): boolean => {\n const cat = processedCategories[row];\n return cat ? isSectionLocked(cat.id, categories) : false;\n },\n [processedCategories, categories],\n );\n\n const findValidCol = useCallback(\n (row: number, currentCol: number, direction: 1 | -1): number => {\n const options = processedCategories[row]?.sortedOptions || [];\n const catId = processedCategories[row]?.id;\n if (catId && isSectionLocked(catId, categories)) return currentCol;\n return findNextValidOption(options, currentCol, direction, true);\n },\n [processedCategories, categories],\n );\n\n const { focusedRow, focusedCol, setFocused, moveFocus } = useFocusedListItem(\n processedCategories.length,\n getColCount,\n {\n wrap: true,\n isRowLocked,\n findValidCol,\n onChange: onFocusChange,\n initialRow: defaultFocusedRow,\n initialCol: defaultFocusedCol,\n },\n );\n\n useCategoryGridInput({\n processedCategories,\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n });\n\n const sectionRefs = useRef<(DOMElement | null)[]>([]);\n const [sectionHeights, setSectionHeights] = useState<number[]>([]);\n const [scrollTopPx, setScrollTopPx] = useState(0);\n\n const setSectionRef = useCallback((index: number, el: DOMElement | null) => {\n sectionRefs.current[index] = el;\n }, []);\n\n useEffect(() => {\n const heights = sectionRefs.current.map((el) => {\n if (el) {\n const { height } = measureElement(el);\n return height;\n }\n return 0;\n });\n setSectionHeights((prev) => {\n if (prev.length === heights.length && prev.every((h, i) => h === heights[i])) {\n return prev;\n }\n return heights;\n });\n });\n\n const scrollEnabled = availableHeight > 0 && availableHeight >= SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS;\n\n useEffect(() => {\n if (!scrollEnabled || sectionHeights.length === 0) return;\n\n let topOfFocused = 0;\n for (let i = 0; i < focusedRow; i++) {\n topOfFocused += sectionHeights[i] ?? 0;\n }\n const focusedHeight = sectionHeights[focusedRow] ?? 0;\n const bottomOfFocused = topOfFocused + focusedHeight;\n\n setScrollTopPx((prev) => {\n if (topOfFocused < prev) {\n return topOfFocused;\n }\n if (bottomOfFocused > prev + availableHeight) {\n return bottomOfFocused - availableHeight;\n }\n return prev;\n });\n }, [focusedRow, sectionHeights, scrollEnabled, availableHeight]);\n\n if (categories.length === 0) {\n return (\n <Box flexDirection=\"column\">\n <Text dimColor>No categories to display.</Text>\n </Box>\n );\n }\n\n const sectionElements = processedCategories.map((category, index) => {\n const isLocked = isSectionLocked(category.id, categories);\n\n return (\n <Box key={category.id} ref={(el) => setSectionRef(index, el)} flexShrink={0}>\n <CategorySection\n category={category}\n options={category.sortedOptions}\n isLocked={isLocked}\n isFocused={index === focusedRow}\n focusedOptionIndex={focusedCol}\n showLabels={showLabels}\n expertMode={expertMode}\n isFirst={index === 0}\n />\n </Box>\n );\n });\n\n // When no height constraint, render flat (tests, or before first measurement)\n if (!scrollEnabled) {\n return (\n <Box flexDirection=\"column\" flexGrow={1} overflow=\"hidden\">\n {sectionElements}\n </Box>\n );\n }\n\n return (\n <Box flexDirection=\"column\" height={availableHeight} overflow=\"hidden\">\n <Box flexDirection=\"column\" marginTop={scrollTopPx > 0 ? -scrollTopPx : 0} flexShrink={0}>\n {sectionElements}\n </Box>\n </Box>\n );\n};\n","import { useCallback, useEffect, useRef } from \"react\";\nimport { useInput } from \"ink\";\n\nimport type { Subcategory, SkillId } from \"../../types/index.js\";\nimport type { CategoryOption, CategoryRow } from \"../wizard/category-grid.js\";\n\nconst FRAMEWORK_CATEGORY_ID = \"web-framework\";\n\n// Locked = non-framework section when no framework is selected\nexport const isSectionLocked = (categoryId: Subcategory, categories: CategoryRow[]): boolean => {\n if (categoryId === FRAMEWORK_CATEGORY_ID) {\n return false;\n }\n\n const frameworkCategory = categories.find((cat) => cat.id === FRAMEWORK_CATEGORY_ID);\n if (!frameworkCategory) return false;\n\n return !frameworkCategory.options.some((opt) => opt.selected);\n};\n\nexport const findValidStartColumn = (_options: CategoryOption[]): number => {\n return 0;\n};\n\n/** Find next unlocked section index (wrapping, direction: forward) */\nexport const findNextUnlockedIndex = (\n processed: { id: Subcategory; sortedOptions: CategoryOption[] }[],\n currentIndex: number,\n allCategories: CategoryRow[],\n): number => {\n const length = processed.length;\n if (length === 0) return currentIndex;\n\n let index = currentIndex;\n let attempts = 0;\n\n while (attempts < length) {\n index += 1;\n if (index >= length) index = 0;\n\n const category = processed[index];\n if (category && !isSectionLocked(category.id, allCategories)) {\n return index;\n }\n\n attempts++;\n }\n\n return currentIndex;\n};\n\ntype ProcessedCategory = CategoryRow & { sortedOptions: CategoryOption[] };\n\ntype UseCategoryGridInputOptions = {\n processedCategories: ProcessedCategory[];\n categories: CategoryRow[];\n focusedRow: number;\n focusedCol: number;\n setFocused: (row: number, col: number) => void;\n moveFocus: (direction: \"up\" | \"down\" | \"left\" | \"right\") => void;\n onToggle: (categoryId: Subcategory, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n};\n\nexport function useCategoryGridInput({\n processedCategories,\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n}: UseCategoryGridInputOptions): void {\n const currentRow = processedCategories[focusedRow];\n const currentOptions = currentRow?.sortedOptions || [];\n const currentLocked = currentRow ? isSectionLocked(currentRow.id, categories) : false;\n\n // Adjust column when current row's options change externally (e.g. option becomes disabled)\n useEffect(() => {\n if (!currentRow) return;\n\n const maxCol = currentOptions.length - 1;\n if (focusedCol > maxCol) {\n const newCol = Math.max(0, maxCol);\n setFocused(focusedRow, newCol);\n }\n }, [focusedRow, currentOptions, focusedCol, setFocused, currentRow]);\n\n // Bounce off locked sections when a section becomes locked (e.g. framework deselected)\n useEffect(() => {\n if (currentRow && currentLocked) {\n const nextUnlocked = findNextUnlockedIndex(processedCategories, focusedRow, categories);\n if (nextUnlocked !== focusedRow) {\n const newRowOptions = processedCategories[nextUnlocked]?.sortedOptions || [];\n const newCol = findValidStartColumn(newRowOptions);\n setFocused(nextUnlocked, newCol);\n }\n }\n }, [currentRow, currentLocked, focusedRow, processedCategories, categories, setFocused]);\n\n // Store the latest handler in a ref so that the useInput effect never needs to\n // re-register on the event emitter. This avoids a stale-closure race condition\n // where, after a domain switch (CategoryGrid remount via key={activeDomain}),\n // the useInput effect may not yet have re-registered the updated handler when\n // the first keypress arrives — causing the first space press to be silently lost.\n type InputKey = {\n leftArrow: boolean;\n rightArrow: boolean;\n upArrow: boolean;\n downArrow: boolean;\n tab: boolean;\n shift: boolean;\n };\n\n const handlerRef = useRef<((input: string, key: InputKey) => void) | null>(null);\n handlerRef.current = (input: string, key: InputKey) => {\n if (key.tab && key.shift) {\n onToggleLabels();\n return;\n }\n\n if (key.tab && !key.shift) {\n const nextSection = findNextUnlockedIndex(processedCategories, focusedRow, categories);\n if (nextSection !== focusedRow) {\n const newRowOptions = processedCategories[nextSection]?.sortedOptions || [];\n const newCol = findValidStartColumn(newRowOptions);\n setFocused(nextSection, newCol);\n }\n return;\n }\n\n if (input === \"d\" || input === \"D\") {\n onToggleLabels();\n return;\n }\n\n if (input === \" \") {\n if (currentLocked) return;\n const currentOption = currentOptions[focusedCol];\n if (currentOption && currentOption.state !== \"disabled\") {\n onToggle(currentRow.id, currentOption.id);\n }\n return;\n }\n\n const isLeft = key.leftArrow || input === \"h\";\n const isRight = key.rightArrow || input === \"l\";\n const isUp = key.upArrow || input === \"k\";\n const isDown = key.downArrow || input === \"j\";\n\n if (isLeft) {\n if (currentLocked) return;\n moveFocus(\"left\");\n } else if (isRight) {\n if (currentLocked) return;\n moveFocus(\"right\");\n } else if (isUp) {\n moveFocus(\"up\");\n } else if (isDown) {\n moveFocus(\"down\");\n }\n };\n\n // Stable handler reference — never changes, so useInput's effect registers once\n const stableHandler = useCallback((input: string, key: InputKey) => {\n handlerRef.current?.(input, key);\n }, []);\n\n useInput(stableHandler);\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AAAA,SAAgB,eAAAA,cAAa,aAAAC,YAAW,SAAS,UAAAC,SAAQ,gBAAgB;AAEzE,SAAS,KAAsB,MAAM,sBAAsB;;;ACF3D;AAAA,SAAS,aAAa,WAAW,cAAc;AAC/C,SAAS,gBAAgB;AAKzB,IAAM,wBAAwB;AAGvB,IAAM,kBAAkB,CAAC,YAAyB,eAAuC;AAC9F,MAAI,eAAe,uBAAuB;AACxC,WAAO;AAAA,EACT;AAEA,QAAM,oBAAoB,WAAW,KAAK,CAAC,QAAQ,IAAI,OAAO,qBAAqB;AACnF,MAAI,CAAC,kBAAmB,QAAO;AAE/B,SAAO,CAAC,kBAAkB,QAAQ,KAAK,CAAC,QAAQ,IAAI,QAAQ;AAC9D;AAEO,IAAM,uBAAuB,CAAC,aAAuC;AAC1E,SAAO;AACT;AAGO,IAAM,wBAAwB,CACnC,WACA,cACA,kBACW;AACX,QAAM,SAAS,UAAU;AACzB,MAAI,WAAW,EAAG,QAAO;AAEzB,MAAI,QAAQ;AACZ,MAAI,WAAW;AAEf,SAAO,WAAW,QAAQ;AACxB,aAAS;AACT,QAAI,SAAS,OAAQ,SAAQ;AAE7B,UAAM,WAAW,UAAU,KAAK;AA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Ac,UAAS,QAAQ,iBAAiB,UAAS,UAC5D,8BAAC,OAAI,eAAc,UAAS,WAAW,cAAc,IAAI,CAAC,cAAc,GAAG,YAAY,GACpF,2BACH,GACF;AAEJ;","names":["useCallback","useEffect","useRef","useRef","sorted","useCallback","useEffect"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CLI_COLORS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FTD5Z6QD.js";
|
|
5
5
|
import {
|
|
6
6
|
init_esm_shims
|
|
7
7
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -17,4 +17,4 @@ var ViewTitle = ({ children }) => {
|
|
|
17
17
|
export {
|
|
18
18
|
ViewTitle
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-B4QYXVPZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
KEBAB_CASE_PATTERN
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FTD5Z6QD.js";
|
|
5
5
|
import {
|
|
6
6
|
init_esm_shims
|
|
7
7
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -375,9 +375,10 @@ var skillMetadataLoaderSchema = z.object({
|
|
|
375
375
|
categoryExclusive: z.boolean().optional(),
|
|
376
376
|
author: z.string().optional(),
|
|
377
377
|
tags: z.array(z.string()).optional(),
|
|
378
|
-
requires: z.array(
|
|
379
|
-
compatibleWith: z.array(
|
|
380
|
-
conflictsWith: z.array(
|
|
378
|
+
requires: z.array(extensibleSkillIdSchema).optional(),
|
|
379
|
+
compatibleWith: z.array(extensibleSkillIdSchema).optional(),
|
|
380
|
+
conflictsWith: z.array(extensibleSkillIdSchema).optional(),
|
|
381
|
+
domain: extensibleDomainSchema.optional(),
|
|
381
382
|
custom: z.boolean().optional()
|
|
382
383
|
}).passthrough().superRefine(validateCategoryField);
|
|
383
384
|
var pluginAuthorSchema = z.object({
|
|
@@ -416,9 +417,10 @@ var agentYamlConfigSchema = z.object({
|
|
|
416
417
|
permissionMode: permissionModeSchema.optional(),
|
|
417
418
|
hooks: hooksRecordSchema.optional(),
|
|
418
419
|
outputFormat: z.string().optional(),
|
|
420
|
+
domain: extensibleDomainSchema.optional(),
|
|
419
421
|
custom: z.boolean().optional()
|
|
420
422
|
});
|
|
421
|
-
var skillAssignmentElementSchema = z.union([
|
|
423
|
+
var skillAssignmentElementSchema = z.union([extensibleSkillIdSchema, skillAssignmentSchema]);
|
|
422
424
|
var stackSubcategoryValues = new Set(SUBCATEGORY_VALUES);
|
|
423
425
|
var stackAgentConfigSchema = z.record(
|
|
424
426
|
z.string(),
|
|
@@ -555,15 +557,17 @@ var localRawMetadataSchema = z.object({
|
|
|
555
557
|
usageGuidance: z.string().optional(),
|
|
556
558
|
tags: z.array(z.string()).optional(),
|
|
557
559
|
/** Framework skills this is compatible with (for Build step filtering) */
|
|
558
|
-
compatibleWith: z.array(
|
|
560
|
+
compatibleWith: z.array(extensibleSkillIdSchema).optional(),
|
|
559
561
|
/** Skills that cannot coexist with this one */
|
|
560
|
-
conflictsWith: z.array(
|
|
562
|
+
conflictsWith: z.array(extensibleSkillIdSchema).optional(),
|
|
561
563
|
/** Skills that must be selected before this one */
|
|
562
|
-
requires: z.array(
|
|
564
|
+
requires: z.array(extensibleSkillIdSchema).optional(),
|
|
563
565
|
/** Setup skills that must be installed first (e.g., env setup) */
|
|
564
|
-
requiresSetup: z.array(
|
|
566
|
+
requiresSetup: z.array(extensibleSkillIdSchema).optional(),
|
|
565
567
|
/** Usage skills this setup skill configures (inverse relationship) */
|
|
566
|
-
providesSetupFor: z.array(
|
|
568
|
+
providesSetupFor: z.array(extensibleSkillIdSchema).optional(),
|
|
569
|
+
/** Explicit domain assignment (overrides inference from category prefix) */
|
|
570
|
+
domain: extensibleDomainSchema.optional(),
|
|
567
571
|
/** True if this skill was created outside the CLI's built-in vocabulary */
|
|
568
572
|
custom: z.boolean().optional()
|
|
569
573
|
}).passthrough().superRefine(validateCategoryField);
|
|
@@ -717,6 +721,7 @@ var agentYamlGenerationSchema = z.object({
|
|
|
717
721
|
permissionMode: permissionModeSchema.optional(),
|
|
718
722
|
hooks: strictHooksRecordSchema.optional(),
|
|
719
723
|
outputFormat: z.string().optional(),
|
|
724
|
+
domain: extensibleDomainSchema.optional(),
|
|
720
725
|
custom: z.boolean().optional()
|
|
721
726
|
}).strict();
|
|
722
727
|
var agentFrontmatterValidationSchema = z.object({
|
|
@@ -786,6 +791,8 @@ var metadataValidationSchema = z.object({
|
|
|
786
791
|
/** ISO date of the fork */
|
|
787
792
|
date: z.string()
|
|
788
793
|
}).optional(),
|
|
794
|
+
/** Explicit domain assignment (overrides inference from category prefix) */
|
|
795
|
+
domain: extensibleDomainSchema.optional(),
|
|
789
796
|
/** True if this skill was created outside the CLI's built-in vocabulary */
|
|
790
797
|
custom: z.boolean().optional()
|
|
791
798
|
}).strict();
|
|
@@ -900,12 +907,14 @@ export {
|
|
|
900
907
|
ensureDir,
|
|
901
908
|
remove,
|
|
902
909
|
copy,
|
|
910
|
+
DOMAIN_VALUES,
|
|
903
911
|
SUBCATEGORY_VALUES,
|
|
904
912
|
agentNameSchema,
|
|
905
913
|
skillDisplayNameSchema,
|
|
906
914
|
SKILL_ID_PATTERN,
|
|
907
915
|
isValidSkillId,
|
|
908
916
|
skillIdSchema,
|
|
917
|
+
extensibleDomainSchema,
|
|
909
918
|
categoryPathSchema,
|
|
910
919
|
hooksRecordSchema,
|
|
911
920
|
skillFrontmatterLoaderSchema,
|
|
@@ -932,4 +941,4 @@ export {
|
|
|
932
941
|
warnUnknownFields,
|
|
933
942
|
extendSchemasWithCustomValues
|
|
934
943
|
};
|
|
935
|
-
//# sourceMappingURL=chunk-
|
|
944
|
+
//# sourceMappingURL=chunk-C4QI54PN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/utils/errors.ts","../src/cli/utils/logger.ts","../src/cli/utils/fs.ts","../src/cli/lib/schemas.ts"],"sourcesContent":["/** Extract a human-readable message from an unknown error value. */\nexport function getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n","// Logging utility for lib/ modules that don't have access to oclif command context.\n// In oclif commands, prefer using this.log() instead.\n\nlet verboseMode = false;\n\nexport function setVerbose(enabled: boolean): void {\n verboseMode = enabled;\n}\n\nexport function verbose(msg: string): void {\n if (verboseMode) {\n console.log(` ${msg}`);\n }\n}\n\n// Always visible (not gated by verbose mode).\n// Used for user-facing progress output: compilation ticks, summaries, validation results.\nexport function log(msg: string): void {\n console.log(msg);\n}\n\n// Always visible (not gated by verbose mode).\n// Used for issues the user should know about, like unresolved references.\n//\n// Error/warning message style guide:\n// - Start with a capital letter (restructure if it would capitalize a function name)\n// - End with a period if it's a complete sentence\n// - End without a period if it's a fragment (e.g., \"Skipping 'foo': missing SKILL.md\")\n// - Wrap dynamic values in single quotes: 'value' (not bare or double-quoted)\n// - Do NOT prefix the message with \"Warning:\" — this function adds it automatically\n// - After a colon, use lowercase (e.g., \"Skipping 'foo': invalid frontmatter\")\n// - Use em dash for supplemental info (e.g., \"Missing category — defaulting to 'local'\")\nexport function warn(msg: string): void {\n console.warn(` Warning: ${msg}`);\n}\n","import fs from \"fs-extra\";\nimport fg from \"fast-glob\";\nimport path from \"path\";\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFile(filePath, \"utf-8\");\n}\n\n/**\n * Reads a file with a size limit check before reading content.\n * Throws if the file exceeds maxSizeBytes. Prevents DoS from oversized files.\n */\nexport async function readFileSafe(filePath: string, maxSizeBytes: number): Promise<string> {\n const stats = await fs.stat(filePath);\n if (stats.size > maxSizeBytes) {\n throw new Error(\n `File too large: '${filePath}' is ${stats.size} bytes (limit: ${maxSizeBytes} bytes)`,\n );\n }\n return fs.readFile(filePath, \"utf-8\");\n}\n\nexport async function readFileOptional(filePath: string, fallback = \"\"): Promise<string> {\n try {\n return await fs.readFile(filePath, \"utf-8\");\n } catch {\n return fallback;\n }\n}\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n return fs.pathExists(filePath);\n}\n\nexport async function directoryExists(dirPath: string): Promise<boolean> {\n try {\n const stat = await fs.stat(dirPath);\n return stat.isDirectory();\n } catch {\n return false;\n }\n}\n\nexport async function listDirectories(dirPath: string): Promise<string[]> {\n try {\n const entries = await fs.readdir(dirPath, { withFileTypes: true });\n return entries.filter((e) => e.isDirectory()).map((e) => e.name);\n } catch {\n return [];\n }\n}\n\nexport async function glob(pattern: string, cwd: string): Promise<string[]> {\n return fg(pattern, { cwd, onlyFiles: true });\n}\n\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n await fs.ensureDir(path.dirname(filePath));\n await fs.writeFile(filePath, content, \"utf-8\");\n}\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.ensureDir(dirPath);\n}\n\nexport async function remove(filePath: string): Promise<void> {\n await fs.remove(filePath);\n}\n\nexport async function copy(src: string, dest: string): Promise<void> {\n await fs.copy(src, dest);\n}\n","import { z } from \"zod\";\nimport { KEBAB_CASE_PATTERN } from \"../consts\";\nimport { warn } from \"../utils/logger\";\nimport type {\n AgentHookAction,\n AgentHookDefinition,\n AgentName,\n AgentYamlConfig,\n AlternativeGroup,\n BoundSkill,\n CategoryDefinition,\n CategoryPath,\n ConflictRule,\n DiscourageRule,\n Domain,\n Marketplace,\n MarketplaceMetadata,\n MarketplaceOwner,\n MarketplacePlugin,\n MarketplaceRemoteSource,\n ModelName,\n PermissionMode,\n PluginAuthor,\n PluginManifest,\n RecommendRule,\n RelationshipDefinitions,\n RequireRule,\n SkillAssignment,\n SkillDisplayName,\n SkillId,\n SkillSourceType,\n SkillsMatrixConfig,\n Subcategory,\n} from \"../types\";\n\n/**\n * Runtime-extensible sets of custom values discovered from source matrices.\n * Populated by extendSchemasWithCustomValues() after matrix merge.\n * Checked by categoryPathSchema, stackAgentConfigSchema, and agentYamlConfigSchema\n * to accept custom categories, domains, and agent names at parse time.\n */\nconst customExtensions = {\n categories: new Set<string>(),\n domains: new Set<string>(),\n agentNames: new Set<string>(),\n skillIds: new Set<string>(),\n};\n\n/** Raw domain values (before cast) — single source of truth for built-in domains */\nexport const DOMAIN_VALUES = [\"web\", \"api\", \"cli\", \"mobile\", \"shared\"] as const;\n\n// Bridge pattern: z.ZodType<ExistingType> ensures Zod output matches our union types\nexport const domainSchema = z.enum(DOMAIN_VALUES) as z.ZodType<Domain>;\n\nexport const skillSourceTypeSchema = z.enum([\n \"public\",\n \"private\",\n \"local\",\n]) as z.ZodType<SkillSourceType>;\n\nexport const boundSkillSchema: z.ZodType<BoundSkill> = z.object({\n id: z.string() as z.ZodType<SkillId>,\n sourceUrl: z.string(),\n sourceName: z.string(),\n boundTo: z.string(),\n description: z.string().optional(),\n});\n\n/** Raw subcategory values (before cast) — single source of truth for built-in subcategories */\nexport const SUBCATEGORY_VALUES = [\n \"web-framework\",\n \"web-styling\",\n \"web-client-state\",\n \"web-server-state\",\n \"web-forms\",\n \"web-testing\",\n \"web-ui-components\",\n \"web-mocking\",\n \"web-error-handling\",\n \"web-i18n\",\n \"web-file-upload\",\n \"web-files\",\n \"web-utilities\",\n \"web-realtime\",\n \"web-animation\",\n \"web-pwa\",\n \"web-accessibility\",\n \"web-performance\",\n \"web-base-framework\",\n \"api-api\",\n \"api-database\",\n \"api-auth\",\n \"api-observability\",\n \"api-analytics\",\n \"api-email\",\n \"api-performance\",\n \"mobile-framework\",\n \"mobile-platform\",\n \"shared-monorepo\",\n \"shared-tooling\",\n \"shared-security\",\n \"shared-methodology\",\n \"shared-research\",\n \"shared-reviewing\",\n \"shared-ci-cd\",\n \"cli-framework\",\n \"cli-prompts\",\n \"cli-testing\",\n] as const;\n\n// Bridge pattern: z.ZodType<ExistingType> ensures Zod output matches our union types\nexport const subcategorySchema = z.enum(SUBCATEGORY_VALUES) as z.ZodType<Subcategory>;\n\nexport const agentNameSchema = z.enum([\n \"web-developer\",\n \"api-developer\",\n \"cli-developer\",\n \"web-architecture\",\n \"agent-summoner\",\n \"documentor\",\n \"skill-summoner\",\n \"cli-migrator\",\n \"pattern-scout\",\n \"web-pattern-critique\",\n \"web-pm\",\n \"api-researcher\",\n \"web-researcher\",\n \"api-reviewer\",\n \"cli-reviewer\",\n \"web-reviewer\",\n \"cli-tester\",\n \"web-tester\",\n]) as z.ZodType<AgentName>;\n\nexport const modelNameSchema = z.enum([\n \"sonnet\",\n \"opus\",\n \"haiku\",\n \"inherit\",\n]) as z.ZodType<ModelName>;\n\nexport const permissionModeSchema = z.enum([\n \"default\",\n \"acceptEdits\",\n \"dontAsk\",\n \"bypassPermissions\",\n \"plan\",\n \"delegate\",\n]) as z.ZodType<PermissionMode>;\n\nexport const skillDisplayNameSchema = z.enum([\n \"react\",\n \"vue\",\n \"angular\",\n \"solidjs\",\n \"nextjs-app-router\",\n \"nextjs-server-actions\",\n \"remix\",\n \"nuxt\",\n \"scss-modules\",\n \"cva\",\n \"tailwind\",\n \"zustand\",\n \"redux-toolkit\",\n \"pinia\",\n \"ngrx-signalstore\",\n \"jotai\",\n \"mobx\",\n \"react-query\",\n \"swr\",\n \"graphql-apollo\",\n \"graphql-urql\",\n \"trpc\",\n \"react-hook-form\",\n \"vee-validate\",\n \"zod-validation\",\n \"vitest\",\n \"playwright-e2e\",\n \"cypress-e2e\",\n \"react-testing-library\",\n \"vue-test-utils\",\n \"msw\",\n \"shadcn-ui\",\n \"tanstack-table\",\n \"radix-ui\",\n \"hono\",\n \"express\",\n \"fastify\",\n \"drizzle\",\n \"prisma\",\n \"better-auth\",\n \"axiom-pino-sentry\",\n \"posthog\",\n \"posthog-flags\",\n \"resend\",\n \"github-actions\",\n \"react-native\",\n \"expo\",\n \"turborepo\",\n \"tooling\",\n \"posthog-setup\",\n \"env\",\n \"observability-setup\",\n \"email-setup\",\n \"framer-motion\",\n \"css-animations\",\n \"view-transitions\",\n \"storybook\",\n \"error-boundaries\",\n \"accessibility\",\n \"websockets\",\n \"sse\",\n \"socket-io\",\n \"service-workers\",\n \"file-upload\",\n \"image-handling\",\n \"date-fns\",\n \"api-testing\",\n \"api-performance\",\n \"web-performance\",\n \"security\",\n \"commander\",\n \"cli-commander\",\n \"oclif\",\n \"reviewing\",\n \"cli-reviewing\",\n \"research-methodology\",\n \"investigation-requirements\",\n \"anti-over-engineering\",\n \"success-criteria\",\n \"write-verification\",\n \"improvement-protocol\",\n \"context-management\",\n]) as z.ZodType<SkillDisplayName>;\n\n/** Matches SkillId format: prefix-subcategory-name (at least 3 dash-separated segments) */\nexport const SKILL_ID_PATTERN = /^(web|api|cli|mobile|infra|meta|security)-.+-.+$/;\n\n/**\n * Checks if a string is a valid skill ID: either matches the built-in prefix pattern\n * (web|api|cli|mobile|infra|meta|security) or was registered as a custom skill ID\n * via extendSchemasWithCustomValues().\n */\nexport function isValidSkillId(id: string): boolean {\n return SKILL_ID_PATTERN.test(id) || customExtensions.skillIds.has(id);\n}\n\n// Regex-based since Zod cannot express template literal types natively\nexport const skillIdSchema = z\n .string()\n .regex(\n SKILL_ID_PATTERN,\n \"Must be a valid skill ID (e.g., 'web-framework-react')\",\n ) as z.ZodType<SkillId>;\n\n/** Extensible schemas that accept both built-in values and custom values registered via extendSchemasWithCustomValues() */\nexport const extensibleDomainSchema = z\n .string()\n .refine(\n (val): val is Domain =>\n domainSchema.safeParse(val).success || customExtensions.domains.has(val),\n { message: \"Must be a valid domain\" },\n ) as z.ZodType<Domain>;\n\nconst extensibleSkillIdSchema = z\n .string()\n .refine(\n (val): val is SkillId =>\n skillIdSchema.safeParse(val).success || customExtensions.skillIds.has(val),\n { message: \"Must be a valid skill ID\" },\n ) as z.ZodType<SkillId>;\n\nconst extensibleSubcategorySchema = z\n .string()\n .refine(\n (val): val is Subcategory =>\n subcategorySchema.safeParse(val).success || customExtensions.categories.has(val),\n { message: \"Must be a valid subcategory\" },\n ) as z.ZodType<Subcategory>;\n\nconst extensibleAgentNameSchema = z\n .string()\n .refine(\n (val): val is AgentName =>\n agentNameSchema.safeParse(val).success || customExtensions.agentNames.has(val),\n { message: \"Must be a valid agent name\" },\n ) as z.ZodType<AgentName>;\n\n/** Validates category: strict categoryPathSchema by default, any kebab-case string when custom: true */\nfunction validateCategoryField(\n val: { category?: string; custom?: boolean },\n ctx: z.RefinementCtx,\n): void {\n if (!val.category) return;\n\n if (val.custom) {\n if (!KEBAB_CASE_PATTERN.test(val.category)) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"category\"],\n message: \"Custom category must be kebab-case\",\n });\n }\n return;\n }\n\n const result = categoryPathSchema.safeParse(val.category);\n if (!result.success) {\n for (const issue of result.error.issues) {\n ctx.addIssue({ ...issue, path: [\"category\"] });\n }\n }\n}\n\n/** Creates a superRefine callback that validates record keys against built-in + custom extension sets */\nfunction validateExtensibleRecordKeys(\n builtinSet: Set<string>,\n extensionSet: Set<string>,\n label: string,\n) {\n return (val: Record<string, unknown>, ctx: z.RefinementCtx) => {\n for (const key of Object.keys(val)) {\n if (!builtinSet.has(key) && !extensionSet.has(key)) {\n ctx.addIssue({\n code: \"custom\",\n path: [key],\n message: `Invalid ${label} '${key}'.`,\n });\n }\n }\n };\n}\n\n// Accepts: \"prefix-subcategory\", bare subcategory, \"local\", or custom category from extended schema\nexport const categoryPathSchema = z.string().refine(\n (val): val is CategoryPath => {\n if (val === \"local\") return true;\n if (/^(web|api|cli|mobile|infra|meta|security|shared)-.+$/.test(val)) return true;\n if (subcategorySchema.safeParse(val).success) return true;\n // Accept custom categories registered via extendSchemasWithCustomValues()\n return customExtensions.categories.has(val);\n },\n {\n message: \"Must be a valid category path (e.g., 'web-framework', 'shared-testing', or 'local')\",\n },\n) as z.ZodType<CategoryPath>;\n\nexport const agentHookActionSchema: z.ZodType<AgentHookAction> = z.object({\n type: z.enum([\"command\", \"script\", \"prompt\"]),\n command: z.string().optional(),\n script: z.string().optional(),\n prompt: z.string().optional(),\n});\n\nexport const agentHookDefinitionSchema: z.ZodType<AgentHookDefinition> = z.object({\n matcher: z.string().optional(),\n hooks: z.array(agentHookActionSchema).optional(),\n});\n\nexport const hooksRecordSchema = z.record(z.string(), z.array(agentHookDefinitionSchema));\n\n/** Strict hook definition — hooks array is required and must have at least one action */\nconst strictAgentHookDefinitionSchema = z.object({\n matcher: z.string().optional(),\n hooks: z.array(agentHookActionSchema).min(1),\n});\n\n/** Strict hooks record for validation schemas (requires at least one hook action per definition) */\nexport const strictHooksRecordSchema = z.record(\n z.string(),\n z.array(strictAgentHookDefinitionSchema),\n);\n\nexport const skillAssignmentSchema: z.ZodType<SkillAssignment> = z.object({\n id: extensibleSkillIdSchema,\n preloaded: z.boolean().optional(),\n local: z.boolean().optional(),\n path: z.string().optional(),\n});\n\n// Lenient: accepts any string for `name` since local/custom skills may not follow strict SkillId pattern\nexport const skillFrontmatterLoaderSchema = z.object({\n name: z.string(),\n description: z.string(),\n model: modelNameSchema.optional(),\n});\n\n// Loader schema: category strictness depends on custom field (see validateCategoryField)\nexport const skillMetadataLoaderSchema = z\n .object({\n // Field accepts any string; cross-field validation in superRefine enforces strict/custom rules\n category: (z.string() as z.ZodType<CategoryPath>).optional(),\n categoryExclusive: z.boolean().optional(),\n author: z.string().optional(),\n tags: z.array(z.string()).optional(),\n requires: z.array(extensibleSkillIdSchema).optional(),\n compatibleWith: z.array(extensibleSkillIdSchema).optional(),\n conflictsWith: z.array(extensibleSkillIdSchema).optional(),\n domain: extensibleDomainSchema.optional(),\n custom: z.boolean().optional(),\n })\n .passthrough()\n .superRefine(validateCategoryField);\n\nexport const pluginAuthorSchema: z.ZodType<PluginAuthor> = z.object({\n name: z.string().min(1),\n email: z.string().optional(),\n});\n\nexport const pluginManifestSchema: z.ZodType<PluginManifest> = z.object({\n name: z.string(),\n version: z.string().optional(),\n description: z.string().optional(),\n author: pluginAuthorSchema.optional(),\n keywords: z.array(z.string()).optional(),\n commands: z.union([z.string(), z.array(z.string())]).optional(),\n agents: z.union([z.string(), z.array(z.string())]).optional(),\n skills: z.union([z.string(), z.array(z.string())]).optional(),\n hooks: z.union([z.string(), hooksRecordSchema]).optional(),\n});\n\n/** Strict schema for plugin.json validation (IDE, agentsinc validate). Rejects unknown fields. */\nexport const pluginManifestValidationSchema = z\n .object({\n name: z.string().min(1),\n version: z.string().optional(),\n description: z.string().optional(),\n author: pluginAuthorSchema.optional(),\n keywords: z.array(z.string()).optional(),\n commands: z.union([z.string(), z.array(z.string())]).optional(),\n agents: z.union([z.string(), z.array(z.string())]).optional(),\n skills: z.union([z.string(), z.array(z.string())]).optional(),\n hooks: z.union([z.string(), strictHooksRecordSchema]).optional(),\n })\n .strict();\n\nexport const agentYamlConfigSchema: z.ZodType<AgentYamlConfig> = z.object({\n id: extensibleAgentNameSchema,\n title: z.string(),\n description: z.string(),\n model: modelNameSchema.optional(),\n tools: z.array(z.string()),\n disallowedTools: z.array(z.string()).optional(),\n permissionMode: permissionModeSchema.optional(),\n hooks: hooksRecordSchema.optional(),\n outputFormat: z.string().optional(),\n domain: extensibleDomainSchema.optional(),\n custom: z.boolean().optional(),\n});\n\n// Defined before projectConfigLoaderSchema so it can reference stackAgentConfigSchema\n// Single skill assignment element: either a bare SkillId string or an object { id, preloaded? }\nconst skillAssignmentElementSchema = z.union([extensibleSkillIdSchema, skillAssignmentSchema]);\n\n/**\n * Agent config within a stack: maps subcategory to skill assignment(s).\n * Keys restricted to valid Subcategory values from skills-matrix.yaml.\n * Lenient: accepts bare string, object, or array from YAML.\n * Consumers normalize all values to SkillAssignment[] after parsing.\n *\n * Uses z.record(z.string()) with superRefine for key validation because\n * z.record(z.enum()) treats all enum values as required properties.\n */\nconst stackSubcategoryValues: Set<string> = new Set(SUBCATEGORY_VALUES);\nexport const stackAgentConfigSchema = z\n .record(\n z.string(),\n z.union([skillAssignmentElementSchema, z.array(skillAssignmentElementSchema)]),\n )\n .superRefine(\n validateExtensibleRecordKeys(\n stackSubcategoryValues,\n customExtensions.categories,\n \"subcategory\",\n ),\n );\n\n/**\n * Lenient loader for .claude/config.yaml (ProjectConfig).\n * name/agents optional since partial configs are valid at load time.\n * Full validation happens in validateProjectConfig().\n */\nexport const projectConfigLoaderSchema = z\n .object({\n version: z.literal(\"1\").optional(),\n /** Project/plugin name in kebab-case */\n name: z.string().optional(),\n description: z.string().optional(),\n /** Agent IDs to compile (e.g., [\"web-developer\", \"api-developer\"]) */\n agents: z.array(z.string()).optional(),\n /** Flat list of all skill IDs used by this project */\n skills: z.array(extensibleSkillIdSchema).optional(),\n\n /** Author handle (e.g., \"@vince\") */\n author: z.string().optional(),\n /** \"local\" = .claude/agents, \"plugin\" = .claude/plugins/ (DEFAULT_PLUGIN_NAME) */\n installMode: z.enum([\"local\", \"plugin\"]).optional(),\n /** Whether expert mode (advanced/niche skills) was enabled in the wizard */\n expertMode: z.boolean().optional(),\n /** Selected domains from the wizard (persisted for edit mode restoration) */\n domains: z.array(extensibleDomainSchema).optional(),\n /** Selected agents from the wizard (persisted for edit mode restoration) */\n selectedAgents: z.array(z.string()).optional(),\n /** Agent-to-subcategory-to-skill mappings from selected stack (accepts same formats as stacks.yaml) */\n stack: z.record(z.string(), stackAgentConfigSchema).optional(),\n /** Skills source path or URL (e.g., \"github:my-org/skills\") */\n source: z.string().optional(),\n /** Marketplace identifier for plugin installation */\n marketplace: z.string().optional(),\n /** Separate source for agents when different from skills source */\n agentsSource: z.string().optional(),\n })\n .passthrough();\n\n/**\n * Strict schema for IDE validation of .claude-src/config.yaml (ProjectConfig).\n * Used to generate project-config.schema.json for yaml-language-server.\n * Requires name/agents (the fields validateProjectConfig checks) and\n * does NOT use .passthrough() so the IDE flags unknown properties.\n */\nexport const projectConfigValidationSchema = z.object({\n version: z.literal(\"1\").optional(),\n /** Project/plugin name in kebab-case */\n name: z.string(),\n description: z.string().optional(),\n /** Agent IDs to compile (e.g., [\"web-developer\", \"api-developer\"]) */\n agents: z.array(z.string()),\n /** Flat list of all skill IDs used by this project */\n skills: z.array(skillIdSchema),\n /** Author handle (e.g., \"@vince\") */\n author: z.string().optional(),\n /** \"local\" = .claude/agents, \"plugin\" = .claude/plugins/ (DEFAULT_PLUGIN_NAME) */\n installMode: z.enum([\"local\", \"plugin\"]),\n /** Whether expert mode (advanced/niche skills) was enabled in the wizard */\n expertMode: z.boolean().optional(),\n /** Selected domains from the wizard (persisted for edit mode restoration) */\n domains: z.array(domainSchema).optional(),\n /** Selected agents from the wizard (persisted for edit mode restoration) */\n selectedAgents: z.array(z.string()).optional(),\n /** Agent-to-subcategory-to-skill mappings from selected stack */\n stack: z.record(z.string(), stackAgentConfigSchema),\n /** Skills source path or URL (e.g., \"github:my-org/skills\") */\n source: z.string(),\n /** Marketplace identifier for plugin installation */\n marketplace: z.string().optional(),\n /** Separate source for agents when different from skills source */\n agentsSource: z.string().optional(),\n});\n\nexport const categoryDefinitionSchema: z.ZodType<CategoryDefinition> = z.object({\n id: extensibleSubcategorySchema,\n displayName: z.string(),\n description: z.string(),\n domain: extensibleDomainSchema.optional() as z.ZodType<Domain | undefined>,\n exclusive: z.boolean(),\n required: z.boolean(),\n order: z.number(),\n icon: z.string().optional(),\n custom: z.boolean().optional(),\n});\n\n// Lenient: accepts both SkillId and SkillDisplayName, resolved to canonical IDs by matrix-loader\nconst skillRefInYaml = z.string() as z.ZodType<SkillId>;\n\nexport const conflictRuleSchema: z.ZodType<ConflictRule> = z.object({\n skills: z.array(skillRefInYaml).min(2),\n reason: z.string(),\n});\n\nexport const discourageRuleSchema: z.ZodType<DiscourageRule> = z.object({\n skills: z.array(skillRefInYaml).min(2),\n reason: z.string(),\n});\n\nexport const recommendRuleSchema: z.ZodType<RecommendRule> = z.object({\n when: skillRefInYaml,\n suggest: z.array(skillRefInYaml).min(1),\n reason: z.string(),\n});\n\nexport const requireRuleSchema: z.ZodType<RequireRule> = z.object({\n skill: skillRefInYaml,\n needs: z.array(skillRefInYaml).min(1),\n needsAny: z.boolean().optional(),\n reason: z.string(),\n});\n\nexport const alternativeGroupSchema: z.ZodType<AlternativeGroup> = z.object({\n purpose: z.string(),\n skills: z.array(skillRefInYaml).min(1),\n});\n\nexport const relationshipDefinitionsSchema: z.ZodType<RelationshipDefinitions> = z.object({\n conflicts: z.array(conflictRuleSchema),\n discourages: z.array(discourageRuleSchema),\n recommends: z.array(recommendRuleSchema),\n requires: z.array(requireRuleSchema),\n alternatives: z.array(alternativeGroupSchema),\n});\n\n/**\n * Skills matrix config schema with runtime-extensible key validation.\n * Category keys and skill alias entries accept custom values registered via\n * extendSchemasWithCustomValues() (called by discoverAndExtendFromSource).\n *\n * Uses z.record(z.string()) + superRefine for key validation (same pattern as\n * stackAgentConfigSchema) because z.record(z.enum()) cannot be extended at runtime.\n *\n * Relationships and skillAliases are optional since source matrices may only define\n * custom categories without relationships or aliases.\n */\nconst builtinSubcategoryValues: Set<string> = new Set(SUBCATEGORY_VALUES);\n// Bridge cast removed: optional fields require runtime defaults in loadSkillsMatrix()\nexport const skillsMatrixConfigSchema = z.object({\n version: z.string(),\n categories: z\n .record(z.string(), categoryDefinitionSchema)\n .superRefine(\n validateExtensibleRecordKeys(\n builtinSubcategoryValues,\n customExtensions.categories,\n \"category key\",\n ),\n ) as z.ZodType<SkillsMatrixConfig[\"categories\"]>,\n relationships: relationshipDefinitionsSchema.optional(),\n skillAliases: z.record(z.string(), extensibleSkillIdSchema).optional(),\n});\n\n/**\n * Raw metadata from a local skill's metadata.yaml.\n * All fields optional — the loader validates cliName after parsing.\n */\nexport const localRawMetadataSchema = z\n .object({\n /** Short name shown in the wizard grid (e.g., \"my-custom-react\") */\n cliName: z.string().optional(),\n /** One-line description for the wizard */\n cliDescription: z.string().optional(),\n /** Subcategory to place this skill in (e.g., \"web-framework\") */\n // Field accepts any string; cross-field validation in superRefine enforces strict/custom rules\n category: (z.string() as z.ZodType<CategoryPath>).optional(),\n /** If true, only one skill from this category can be selected */\n categoryExclusive: z.boolean().optional(),\n /** When an AI agent should invoke this skill */\n usageGuidance: z.string().optional(),\n tags: z.array(z.string()).optional(),\n /** Framework skills this is compatible with (for Build step filtering) */\n compatibleWith: z.array(extensibleSkillIdSchema).optional(),\n /** Skills that cannot coexist with this one */\n conflictsWith: z.array(extensibleSkillIdSchema).optional(),\n /** Skills that must be selected before this one */\n requires: z.array(extensibleSkillIdSchema).optional(),\n /** Setup skills that must be installed first (e.g., env setup) */\n requiresSetup: z.array(extensibleSkillIdSchema).optional(),\n /** Usage skills this setup skill configures (inverse relationship) */\n providesSetupFor: z.array(extensibleSkillIdSchema).optional(),\n /** Explicit domain assignment (overrides inference from category prefix) */\n domain: extensibleDomainSchema.optional(),\n /** True if this skill was created outside the CLI's built-in vocabulary */\n custom: z.boolean().optional(),\n })\n .passthrough()\n .superRefine(validateCategoryField);\n\n/** Metadata for local skills that were forked/copied from a marketplace skill */\nexport const localSkillMetadataSchema = z\n .object({\n forkedFrom: z\n .object({\n /** Original skill ID before forking (e.g., \"web-framework-react\") */\n skillId: skillIdSchema,\n /** SHA hash of the original content at fork time (for diff detection) */\n contentHash: z.string(),\n /** ISO date when the fork was created */\n date: z.string(),\n /** Source URL the skill was installed from (e.g., \"github:agents-inc/skills\") */\n source: z.string().optional(),\n })\n .optional(),\n })\n .passthrough();\n\nexport const stackSchema = z.object({\n id: z.string().min(1),\n name: z.string().min(1),\n description: z.string(),\n /** Maps agent IDs to their subcategory-to-skill assignments */\n agents: z.record(z.string(), stackAgentConfigSchema),\n /** High-level philosophy guiding this stack's technology choices */\n philosophy: z.string().optional(),\n});\n\n// Pre-normalization schema: values may be string or string[].\n// loadStacks() normalizes to StacksConfig (all values SkillId[]) after parsing.\nexport const stacksConfigSchema = z.object({\n stacks: z.array(stackSchema).min(1),\n});\n\nexport const marketplaceRemoteSourceSchema: z.ZodType<MarketplaceRemoteSource> = z.object({\n source: z.enum([\"github\", \"url\"]),\n repo: z.string().optional(),\n url: z.string().optional(),\n ref: z.string().optional(),\n});\n\nexport const marketplacePluginSchema: z.ZodType<MarketplacePlugin> = z.object({\n name: z.string().min(1),\n /** Local directory path (relative to pluginRoot) or remote source config */\n source: z.union([z.string(), marketplaceRemoteSourceSchema]),\n description: z.string().optional(),\n version: z.string().optional(),\n author: pluginAuthorSchema.optional(),\n /** Marketplace category for grouping (e.g., \"framework\", \"testing\") */\n category: z.string().optional(),\n keywords: z.array(z.string()).optional(),\n});\n\nexport const marketplaceOwnerSchema: z.ZodType<MarketplaceOwner> = z.object({\n name: z.string().min(1),\n email: z.string().optional(),\n});\n\nexport const marketplaceMetadataSchema: z.ZodType<MarketplaceMetadata> = z.object({\n /** Base directory for resolving plugin source paths (e.g., \"plugins/\") */\n pluginRoot: z.string().optional(),\n});\n\nexport const marketplaceSchema: z.ZodType<Marketplace> = z.object({\n $schema: z.string().optional(),\n name: z.string().min(1),\n version: z.string().min(1),\n description: z.string().optional(),\n owner: marketplaceOwnerSchema,\n metadata: marketplaceMetadataSchema.optional(),\n plugins: z.array(marketplacePluginSchema).min(1),\n});\n\n/** Tool permission overrides (allow/deny lists for Claude Code tool access) */\nexport const permissionConfigSchema = z.object({\n /** Tool names or patterns to explicitly allow */\n allow: z.array(z.string()).optional(),\n /** Tool names or patterns to explicitly deny */\n deny: z.array(z.string()).optional(),\n});\n\n/** Settings file schema (.claude/settings.yaml) for project-level configuration */\nexport const settingsFileSchema = z\n .object({\n permissions: permissionConfigSchema.optional(),\n })\n .passthrough();\n\n/** Metadata for skills imported via `agentsinc import skill` (tracks original source for updates) */\nexport const importedSkillMetadataSchema = z\n .object({\n forkedFrom: z\n .object({\n /** Source URL or identifier where the skill was imported from */\n source: z.string(),\n /** Original skill name in the source */\n skillName: z.string(),\n /** SHA hash of the original content at import time */\n contentHash: z.string(),\n /** ISO date when the import was performed */\n date: z.string(),\n })\n .optional(),\n })\n .passthrough();\n\n/** Branding overrides for white-labeling the CLI */\nexport const brandingConfigSchema = z.object({\n /** Custom CLI name (e.g., \"Acme Dev Tools\") */\n name: z.string().optional(),\n /** Custom tagline shown in wizard header */\n tagline: z.string().optional(),\n});\n\n/**\n * Project source configuration from .claude/config.yaml.\n * Stores multi-source settings, custom directory overrides, and bound skills.\n */\nexport const projectSourceConfigSchema = z\n .object({\n /** Primary skills source (path or URL) */\n source: z.string().optional(),\n /** Author handle for this project's config */\n author: z.string().optional(),\n /** Marketplace identifier for plugin installation */\n marketplace: z.string().optional(),\n /** Separate source for agent definitions (when different from skills) */\n agentsSource: z.string().optional(),\n /** Additional skill sources (private marketplaces, custom repos) */\n sources: z\n .array(\n z.object({\n /** Display name for the source (shown in wizard) */\n name: z.string(),\n /** Source URL (e.g., \"github:acme-corp/claude-skills\") */\n url: z.string(),\n description: z.string().optional(),\n /** Git ref (branch/tag/commit) for the source */\n ref: z.string().optional(),\n }),\n )\n .optional(),\n /** Skills explicitly bound to subcategories via search (from Step Sources) */\n boundSkills: z.array(boundSkillSchema).optional(),\n /** Branding overrides for white-labeling the CLI */\n branding: brandingConfigSchema.optional(),\n /** Custom skills directory override (default: \"src/skills\") */\n skillsDir: z.string().optional(),\n /** Custom agents directory override (default: \"src/agents\") */\n agentsDir: z.string().optional(),\n /** Custom stacks file path override (default: \"config/stacks.yaml\") */\n stacksFile: z.string().optional(),\n /** Custom matrix file path override (default: \"config/skills-matrix.yaml\") */\n matrixFile: z.string().optional(),\n })\n .passthrough();\n\n/**\n * Strict schema for IDE validation of .claude-src/config.yaml (ProjectSourceConfig).\n * Used to generate project-source-config.schema.json for yaml-language-server.\n * All fields optional (source configs may have any subset) but no unknown properties.\n */\nexport const projectSourceConfigValidationSchema = z.object({\n source: z.string().optional(),\n author: z.string().optional(),\n marketplace: z.string().optional(),\n agentsSource: z.string().optional(),\n sources: z\n .array(\n z.object({\n name: z.string(),\n url: z.string(),\n description: z.string().optional(),\n ref: z.string().optional(),\n }),\n )\n .optional(),\n boundSkills: z.array(boundSkillSchema).optional(),\n branding: brandingConfigSchema.optional(),\n skillsDir: z.string().optional(),\n agentsDir: z.string().optional(),\n stacksFile: z.string().optional(),\n matrixFile: z.string().optional(),\n});\n\n// Strict validation schemas enforce all constraints and use .strict() to reject unknown fields,\n// unlike the lenient loader schemas above which use .passthrough() for forward compatibility at parse boundaries\n\n/** Strict schema for compiled agent.yaml output. Lenient id (any string) since marketplace agents may use custom identifiers. */\nexport const agentYamlGenerationSchema = z\n .object({\n $schema: z.string().optional(),\n id: z.string().min(1),\n title: z.string().min(1),\n description: z.string().min(1),\n model: modelNameSchema.optional(),\n tools: z.array(z.string()).min(1),\n disallowedTools: z.array(z.string()).optional(),\n permissionMode: permissionModeSchema.optional(),\n hooks: strictHooksRecordSchema.optional(),\n outputFormat: z.string().optional(),\n domain: extensibleDomainSchema.optional(),\n custom: z.boolean().optional(),\n })\n .strict();\n\n/** Strict validation for agent AGENT.md frontmatter (used by plugin-validator) */\nexport const agentFrontmatterValidationSchema = z\n .object({\n /** Agent name in kebab-case (becomes the Task tool identifier) */\n name: z.string().regex(KEBAB_CASE_PATTERN).min(1),\n description: z.string().min(1),\n /** Comma-separated list of allowed tools */\n tools: z.string().optional(),\n /** Comma-separated list of denied tools */\n disallowedTools: z.string().optional(),\n model: modelNameSchema.optional(),\n permissionMode: permissionModeSchema.optional(),\n /** Skill names to preload (embed in agent prompt) */\n skills: z.array(z.string().min(1)).optional(),\n hooks: strictHooksRecordSchema.optional(),\n })\n .strict();\n\n/** Strict validation for SKILL.md frontmatter (matches Claude Code plugin spec) */\nexport const skillFrontmatterValidationSchema = z\n .object({\n name: z.string().min(1),\n description: z.string().min(1),\n /** If true, Claude cannot invoke this skill on its own */\n \"disable-model-invocation\": z.boolean().optional(),\n /** If true, user can invoke this skill directly */\n \"user-invocable\": z.boolean().optional(),\n /** Comma-separated list of tools this skill can use */\n \"allowed-tools\": z.string().optional(),\n model: modelNameSchema.optional(),\n /** \"fork\" means skill runs in a forked context (separate conversation) */\n context: z.enum([\"fork\"]).optional(),\n /** Agent name this skill is scoped to */\n agent: z.string().optional(),\n /** Hint text shown when user invokes the skill */\n \"argument-hint\": z.string().optional(),\n })\n .strict();\n\n/** Strict validation for metadata.yaml in published skills (enforces author format, length limits) */\nexport const metadataValidationSchema = z\n .object({\n /** Domain-prefixed subcategory (e.g., \"web-framework\") */\n category: extensibleSubcategorySchema,\n categoryExclusive: z.boolean().optional(),\n /** Author handle — must start with @ (e.g., \"@vince\") */\n author: z.string().regex(/^@[a-z][a-z0-9-]*$/),\n /** Short display name for the wizard grid (max 30 chars) */\n cliName: z.string().min(1).max(30),\n /** One-line description for the wizard (max 60 chars) */\n cliDescription: z.string().min(1).max(60),\n /** When an AI agent should invoke this skill (min 10 chars to ensure usefulness) */\n usageGuidance: z.string().min(10),\n requires: z.array(z.string().min(1)).optional(),\n compatibleWith: z.array(z.string().min(1)).optional(),\n conflictsWith: z.array(z.string().min(1)).optional(),\n /** Searchable tags — kebab-case only */\n tags: z.array(z.string().regex(/^[a-z][a-z0-9-]*$/)).optional(),\n requiresSetup: z.array(z.string().min(1)).optional(),\n providesSetupFor: z.array(z.string().min(1)).optional(),\n /** 7-char hex SHA of skill content (for change detection) */\n contentHash: z\n .string()\n .regex(/^[a-f0-9]{7}$/)\n .optional(),\n /** ISO date of last update */\n updated: z.string().optional(),\n /** Provenance tracking when skill was forked from another */\n forkedFrom: z\n .object({\n /** Original skill ID */\n skillId: z.string(),\n /** Version of the original at fork time */\n version: z.number().int().min(1).optional(),\n /** Content hash of the original at fork time */\n contentHash: z.string(),\n /** Source URL or identifier */\n source: z.string().optional(),\n /** ISO date of the fork */\n date: z.string(),\n })\n .optional(),\n /** Explicit domain assignment (overrides inference from category prefix) */\n domain: extensibleDomainSchema.optional(),\n /** True if this skill was created outside the CLI's built-in vocabulary */\n custom: z.boolean().optional(),\n })\n .strict();\n\nconst stackSkillAssignmentSchema = z\n .object({\n id: z.string().min(1),\n /** If true, skill content is embedded in the compiled agent prompt */\n preloaded: z.boolean().optional(),\n })\n .strict();\n\n/** Strict validation for published stack config.yaml (marketplace stacks) */\nexport const stackConfigValidationSchema = z\n .object({\n /** Unique stack identifier in kebab-case */\n id: z.string().regex(KEBAB_CASE_PATTERN).optional(),\n name: z.string().min(1),\n version: z.string(),\n author: z.string().min(1),\n description: z.string().optional(),\n /** ISO date when this stack was first created */\n created: z.string().optional(),\n /** ISO date of last update */\n updated: z.string().optional(),\n /** Primary framework this stack is designed for (e.g., \"nextjs\", \"remix\") */\n framework: z.string().optional(),\n /** All skills used in this stack (flat list, at least one required) */\n skills: z.array(stackSkillAssignmentSchema).min(1),\n /** Agent IDs this stack compiles (at least one required) */\n agents: z.array(z.string().regex(KEBAB_CASE_PATTERN)).min(1),\n /** Per-agent skill assignments: { agentId: { subcategory: [skillAssignment] } } */\n agentSkills: z\n .record(z.string(), z.record(z.string(), z.array(stackSkillAssignmentSchema)))\n .optional(),\n /** High-level philosophy guiding technology choices */\n philosophy: z.string().optional(),\n /** Guiding principles for agents using this stack */\n principles: z.array(z.string().min(1)).optional(),\n tags: z.array(z.string().regex(KEBAB_CASE_PATTERN)).optional(),\n /** Per-skill overrides: alternative suggestions and lock status */\n overrides: z\n .record(\n z.string(),\n z\n .object({\n /** Suggested alternative skill IDs if this one is swapped */\n alternatives: z.array(z.string().min(1)).optional(),\n /** If true, this skill cannot be swapped by the user */\n locked: z.boolean().optional(),\n })\n .strict(),\n )\n .optional(),\n /** Community metrics for sorting/ranking */\n metrics: z\n .object({\n upvotes: z.number().int().min(0).optional(),\n downloads: z.number().int().min(0).optional(),\n })\n .strict()\n .optional(),\n /** Lifecycle hooks triggered by file changes or commands */\n hooks: z\n .record(\n z.string(),\n z.array(\n z.object({\n /** Glob pattern to match file paths (e.g., \"*.tsx\") */\n matcher: z.string().optional(),\n hooks: z.array(agentHookActionSchema).min(1),\n }),\n ),\n )\n .optional(),\n })\n .strict();\n\n/** Format Zod validation issues into a human-readable string (e.g., \"path.to.field: Expected string; other: Required\") */\nexport function formatZodErrors(issues: z.ZodIssue[]): string {\n return issues.map((i) => `${i.path.join(\".\")}: ${i.message}`).join(\"; \");\n}\n\n/**\n * Validates that a parsed JSON/YAML value does not exceed a maximum nesting depth.\n * Returns true if the structure is within limits, false if it exceeds maxDepth.\n */\nexport function validateNestingDepth(value: unknown, maxDepth: number): boolean {\n function check(val: unknown, depth: number): boolean {\n if (depth > maxDepth) return false;\n if (Array.isArray(val)) {\n return val.every((item) => check(item, depth + 1));\n }\n if (val !== null && typeof val === \"object\") {\n return Object.values(val).every((v) => check(v, depth + 1));\n }\n return true;\n }\n return check(value, 0);\n}\n\n/**\n * Logs warnings for unknown fields in a parsed object compared to a list of expected keys.\n * Used at security-critical parsing boundaries (marketplace, settings) where `.passthrough()`\n * is kept for forward compatibility but unexpected fields should be surfaced.\n */\nexport function warnUnknownFields(\n parsed: Record<string, unknown>,\n expectedKeys: readonly string[],\n context: string,\n): void {\n const expectedSet = new Set(expectedKeys);\n const unknownKeys = Object.keys(parsed).filter((k) => !expectedSet.has(k));\n if (unknownKeys.length > 0) {\n warn(`Unknown fields in ${context}: ${unknownKeys.join(\", \")}`);\n }\n}\n\nexport type SchemaExtensionOptions = {\n categories?: string[];\n domains?: string[];\n agentNames?: string[];\n skillIds?: string[];\n};\n\n/**\n * Extends runtime schema validation to accept custom values discovered from\n * source matrices, agent directories, and skill directories.\n *\n * This populates the customExtensions sets checked by categoryPathSchema,\n * stackAgentConfigSchema, agentYamlConfigSchema, metadataValidationSchema,\n * skillAssignmentSchema, and projectConfigLoaderSchema at parse time.\n *\n * Idempotent: calling multiple times accumulates values (Set deduplicates).\n */\nexport function extendSchemasWithCustomValues(options: SchemaExtensionOptions): void {\n for (const category of options.categories ?? []) {\n customExtensions.categories.add(category);\n }\n for (const domain of options.domains ?? []) {\n customExtensions.domains.add(domain);\n }\n for (const agentName of options.agentNames ?? []) {\n customExtensions.agentNames.add(agentName);\n }\n for (const skillId of options.skillIds ?? []) {\n customExtensions.skillIds.add(skillId);\n }\n}\n\n/**\n * Clears all custom schema extensions. Used in tests to reset state between runs.\n */\nexport function resetSchemaExtensions(): void {\n customExtensions.categories.clear();\n customExtensions.domains.clear();\n customExtensions.agentNames.clear();\n customExtens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,CAAC;AACvB;AAOO,SAAS,kBACd,QACA,cACA,SACM;AACN,QAAM,cAAc,IAAI,IAAI,YAAY;AACxC,QAAM,cAAc,OAAO,KAAK,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC;AACzE,MAAI,YAAY,SAAS,GAAG;AAC1B,SAAK,qBAAqB,OAAO,KAAK,YAAY,KAAK,IAAI,CAAC,EAAE;AAAA,EAChE;AACF;AAmBO,SAAS,8BAA8B,SAAuC;AACnF,aAAW,YAAY,QAAQ,cAAc,CAAC,GAAG;AAC/C,qBAAiB,WAAW,IAAI,QAAQ;AAAA,EAC1C;AACA,aAAW,UAAU,QAAQ,WAAW,CAAC,GAAG;AAC1C,qBAAiB,QAAQ,IAAI,MAAM;AAAA,EACrC;AACA,aAAW,aAAa,QAAQ,cAAc,CAAC,GAAG;AAChD,qBAAiB,WAAW,IAAI,SAAS;AAAA,EAC3C;AACA,aAAW,WAAW,QAAQ,YAAY,CAAC,GAAG;AAC5C,qBAAiB,SAAS,IAAI,OAAO;AAAA,EACvC;AACF;","names":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getErrorMessage,
|
|
4
4
|
warn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-C4QI54PN.js";
|
|
6
6
|
import {
|
|
7
7
|
init_esm_shims
|
|
8
8
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -180,4 +180,4 @@ export {
|
|
|
180
180
|
claudePluginMarketplaceAdd,
|
|
181
181
|
claudePluginUninstall
|
|
182
182
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-CJFWO46A.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BaseCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LNA6M2IE.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_SOURCE,
|
|
7
7
|
SOURCE_ENV_VAR,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
loadProjectSourceConfig,
|
|
11
11
|
resolveAgentsSource,
|
|
12
12
|
resolveSource
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GFDGYQ6M.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_BRANDING
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FTD5Z6QD.js";
|
|
17
17
|
import {
|
|
18
18
|
init_esm_shims
|
|
19
19
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -90,4 +90,4 @@ ${DEFAULT_BRANDING.NAME} Configuration
|
|
|
90
90
|
export {
|
|
91
91
|
ConfigShow
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-DC333ZDC.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getDomainDisplayName
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NRCKIHND.js";
|
|
5
5
|
import {
|
|
6
6
|
ViewTitle
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B4QYXVPZ.js";
|
|
8
8
|
import {
|
|
9
9
|
CLI_COLORS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FTD5Z6QD.js";
|
|
11
11
|
import {
|
|
12
12
|
init_esm_shims
|
|
13
13
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -84,4 +84,4 @@ var StepConfirm = ({
|
|
|
84
84
|
export {
|
|
85
85
|
StepConfirm
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
87
|
+
//# sourceMappingURL=chunk-DVW6ASTO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
cliTheme
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-N5OCAAXY.js";
|
|
5
5
|
import {
|
|
6
6
|
useTextInput
|
|
7
7
|
} from "./chunk-U3IGFMCY.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
CLI_COLORS,
|
|
10
10
|
UI_LAYOUT,
|
|
11
11
|
UI_SYMBOLS
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FTD5Z6QD.js";
|
|
13
13
|
import {
|
|
14
14
|
init_esm_shims
|
|
15
15
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -343,4 +343,4 @@ var SkillSearch = ({
|
|
|
343
343
|
export {
|
|
344
344
|
SkillSearch
|
|
345
345
|
};
|
|
346
|
-
//# sourceMappingURL=chunk-
|
|
346
|
+
//# sourceMappingURL=chunk-EZ46ZTAQ.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
StackSelection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QR2TM4OY.js";
|
|
5
5
|
import {
|
|
6
6
|
DomainSelection
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HLTJK3XB.js";
|
|
8
8
|
import {
|
|
9
9
|
useWizardStore
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SPSGZWTZ.js";
|
|
11
11
|
import {
|
|
12
12
|
init_esm_shims
|
|
13
13
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -26,4 +26,4 @@ var StepStack = ({ matrix, onCancel }) => {
|
|
|
26
26
|
export {
|
|
27
27
|
StepStack
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-FMQ3A7W4.js.map
|
|
@@ -140,6 +140,7 @@ var CLI_COLORS = {
|
|
|
140
140
|
UNFOCUSED: "white",
|
|
141
141
|
WHITE: "white"
|
|
142
142
|
};
|
|
143
|
+
var BUILT_IN_DOMAIN_ORDER = ["web", "api", "mobile", "cli"];
|
|
143
144
|
var DEFAULT_SCRATCH_DOMAINS = ["web", "api", "mobile"];
|
|
144
145
|
var ASCII_LOGO = ` \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
145
146
|
\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
|
|
@@ -196,8 +197,9 @@ export {
|
|
|
196
197
|
DEFAULT_BRANDING,
|
|
197
198
|
DEFAULT_PUBLIC_SOURCE_NAME,
|
|
198
199
|
CLI_COLORS,
|
|
200
|
+
BUILT_IN_DOMAIN_ORDER,
|
|
199
201
|
DEFAULT_SCRATCH_DOMAINS,
|
|
200
202
|
ASCII_LOGO,
|
|
201
203
|
DEFAULT_PRESELECTED_SKILLS
|
|
202
204
|
};
|
|
203
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-FTD5Z6QD.js.map
|
|
@@ -1 +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, SkillId } 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 DEFAULT_PLUGIN_NAME = \"agents-inc\";\n\nexport const CACHE_DIR = path.join(os.homedir(), \".cache\", DEFAULT_PLUGIN_NAME);\n\nexport const CLI_BIN_NAME = \"agentsinc\";\n\nexport const SKILLS_MATRIX_PATH = \"config/skills-matrix.yaml\";\nexport const STACKS_FILE_PATH = \"config/stacks.yaml\";\nexport const SKILLS_DIR_PATH = \"src/skills\";\nexport const LOCAL_SKILLS_PATH = \".claude/skills\";\nexport const ARCHIVED_SKILLS_DIR_NAME = \"_archived\";\n\nexport const DIRS = {\n agents: \"src/agents\",\n skills: \"src/skills\",\n stacks: \"src/stacks\",\n templates: \"src/agents/_templates\",\n commands: \"src/commands\",\n} as const;\n\nexport const STANDARD_FILES = {\n SKILL_MD: \"SKILL.md\",\n METADATA_YAML: \"metadata.yaml\",\n METADATA_JSON: \"metadata.json\",\n CONFIG_YAML: \"config.yaml\",\n SKILLS_MATRIX_YAML: \"skills-matrix.yaml\",\n AGENT_YAML: \"agent.yaml\",\n PLUGIN_JSON: \"plugin.json\",\n CLAUDE_MD: \"CLAUDE.md\",\n REFERENCE_MD: \"reference.md\",\n INTRO_MD: \"intro.md\",\n WORKFLOW_MD: \"workflow.md\",\n EXAMPLES_MD: \"examples.md\",\n OUTPUT_FORMAT_MD: \"output-format.md\",\n CRITICAL_REQUIREMENTS_MD: \"critical-requirements.md\",\n CRITICAL_REMINDERS_MD: \"critical-reminders.md\",\n} as const;\n\nexport const STANDARD_DIRS = {\n EXAMPLES: \"examples\",\n SCRIPTS: \"scripts\",\n SKILLS: \"skills\",\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.\nconst SCHEMA_PKG_PREFIX = \"https://raw.githubusercontent.com/agents-inc/cli/main/src/schemas\";\n\nexport const SCHEMA_PATHS = {\n agent: `${SCHEMA_PKG_PREFIX}/agent.schema.json`,\n metadata: `${SCHEMA_PKG_PREFIX}/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 skillsMatrix: `${SCHEMA_PKG_PREFIX}/skills-matrix.schema.json`,\n stacks: `${SCHEMA_PKG_PREFIX}/stacks.schema.json`,\n} as const;\n\n/** Generates a yaml-language-server schema comment for the top of YAML files. */\nexport function yamlSchemaComment(schemaPath: string): string {\n return `# yaml-language-server: $schema=${schemaPath}`;\n}\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\nexport const UI_SYMBOLS = {\n CHECKBOX_CHECKED: \"[x]\",\n CHECKBOX_UNCHECKED: \"[ ]\",\n CHEVRON: \"\\u276F\",\n CHEVRON_SPACER: \" \",\n SELECTED: \"\\u2713\",\n UNSELECTED: \"\\u25CB\",\n CURRENT: \"\\u25CF\",\n SKIPPED: \"\\u2013\",\n DISCOURAGED: \"!\",\n DISABLED: \"\\u2013\",\n SCROLL_UP: \"\\u25B2\",\n SCROLL_DOWN: \"\\u25BC\",\n} as const;\n\nexport const UI_LAYOUT = {\n MAX_VISIBLE_RESULTS: 10,\n DESCRIPTION_WIDTH: 30,\n COPIED_MESSAGE_TIMEOUT_MS: 2000,\n FALLBACK_MESSAGE_TIMEOUT_MS: 3000,\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\nexport const DEFAULT_SKILLS_SUBDIR = \"skills\";\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\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 /** Minimum terminal height to show the wizard at all */\n MIN_TERMINAL_HEIGHT: 15,\n} as const;\n\nexport const DEFAULT_BRANDING = {\n NAME: \"Agents Inc.\",\n TAGLINE: \"AI-powered development tools\",\n} as const;\n\n/** Fallback name for the default public marketplace when marketplace.json is unavailable */\nexport const DEFAULT_PUBLIC_SOURCE_NAME = \"Agents Inc\";\n\nexport const CLI_COLORS = {\n PRIMARY: \"cyan\",\n SUCCESS: \"green\",\n ERROR: \"red\",\n WARNING: \"yellow\",\n INFO: \"blue\",\n NEUTRAL: \"gray\",\n FOCUS: \"cyan\",\n UNFOCUSED: \"white\",\n WHITE: \"white\",\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\nexport const ASCII_LOGO = ` █████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ██╗███╗ ██╗ ██████╗\n██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██║████╗ ██║██╔════╝\n███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ██║██╔██╗ ██║██║\n██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ██║██║╚██╗██║██║\n██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ██║██║ ╚████║╚██████╗\n╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝`;\n\nexport const DEFAULT_PRESELECTED_SKILLS: readonly SkillId[] = [\n \"meta-methodology-anti-over-engineering\",\n \"meta-methodology-context-management\",\n \"meta-methodology-improvement-protocol\",\n \"meta-methodology-investigation-requirements\",\n \"meta-methodology-success-criteria\",\n \"meta-methodology-write-verification\",\n];\n"],"mappings":";;;;;;AAAA;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SA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T,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AACT;AAGO,IAAM,0BAA6C,CAAC,OAAO,OAAO,QAAQ;AAE1E,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAOnB,IAAM,6BAAiD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/consts.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport type { Domain, SkillId } 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 DEFAULT_PLUGIN_NAME = \"agents-inc\";\n\nexport const CACHE_DIR = path.join(os.homedir(), \".cache\", DEFAULT_PLUGIN_NAME);\n\nexport const CLI_BIN_NAME = \"agentsinc\";\n\nexport const SKILLS_MATRIX_PATH = \"config/skills-matrix.yaml\";\nexport const STACKS_FILE_PATH = \"config/stacks.yaml\";\nexport const SKILLS_DIR_PATH = \"src/skills\";\nexport const LOCAL_SKILLS_PATH = \".claude/skills\";\nexport const ARCHIVED_SKILLS_DIR_NAME = \"_archived\";\n\nexport const DIRS = {\n agents: \"src/agents\",\n skills: \"src/skills\",\n stacks: \"src/stacks\",\n templates: \"src/agents/_templates\",\n commands: \"src/commands\",\n} as const;\n\nexport const STANDARD_FILES = {\n SKILL_MD: \"SKILL.md\",\n METADATA_YAML: \"metadata.yaml\",\n METADATA_JSON: \"metadata.json\",\n CONFIG_YAML: \"config.yaml\",\n SKILLS_MATRIX_YAML: \"skills-matrix.yaml\",\n AGENT_YAML: \"agent.yaml\",\n PLUGIN_JSON: \"plugin.json\",\n CLAUDE_MD: \"CLAUDE.md\",\n REFERENCE_MD: \"reference.md\",\n INTRO_MD: \"intro.md\",\n WORKFLOW_MD: \"workflow.md\",\n EXAMPLES_MD: \"examples.md\",\n OUTPUT_FORMAT_MD: \"output-format.md\",\n CRITICAL_REQUIREMENTS_MD: \"critical-requirements.md\",\n CRITICAL_REMINDERS_MD: \"critical-reminders.md\",\n} as const;\n\nexport const STANDARD_DIRS = {\n EXAMPLES: \"examples\",\n SCRIPTS: \"scripts\",\n SKILLS: \"skills\",\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.\nconst SCHEMA_PKG_PREFIX = \"https://raw.githubusercontent.com/agents-inc/cli/main/src/schemas\";\n\nexport const SCHEMA_PATHS = {\n agent: `${SCHEMA_PKG_PREFIX}/agent.schema.json`,\n metadata: `${SCHEMA_PKG_PREFIX}/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 skillsMatrix: `${SCHEMA_PKG_PREFIX}/skills-matrix.schema.json`,\n stacks: `${SCHEMA_PKG_PREFIX}/stacks.schema.json`,\n} as const;\n\n/** Generates a yaml-language-server schema comment for the top of YAML files. */\nexport function yamlSchemaComment(schemaPath: string): string {\n return `# yaml-language-server: $schema=${schemaPath}`;\n}\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\nexport const UI_SYMBOLS = {\n CHECKBOX_CHECKED: \"[x]\",\n CHECKBOX_UNCHECKED: \"[ ]\",\n CHEVRON: \"\\u276F\",\n CHEVRON_SPACER: \" \",\n SELECTED: \"\\u2713\",\n UNSELECTED: \"\\u25CB\",\n CURRENT: \"\\u25CF\",\n SKIPPED: \"\\u2013\",\n DISCOURAGED: \"!\",\n DISABLED: \"\\u2013\",\n SCROLL_UP: \"\\u25B2\",\n SCROLL_DOWN: \"\\u25BC\",\n} as const;\n\nexport const UI_LAYOUT = {\n MAX_VISIBLE_RESULTS: 10,\n DESCRIPTION_WIDTH: 30,\n COPIED_MESSAGE_TIMEOUT_MS: 2000,\n FALLBACK_MESSAGE_TIMEOUT_MS: 3000,\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\nexport const DEFAULT_SKILLS_SUBDIR = \"skills\";\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\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 /** Minimum terminal height to show the wizard at all */\n MIN_TERMINAL_HEIGHT: 15,\n} as const;\n\nexport const DEFAULT_BRANDING = {\n NAME: \"Agents Inc.\",\n TAGLINE: \"AI-powered development tools\",\n} as const;\n\n/** Fallback name for the default public marketplace when marketplace.json is unavailable */\nexport const DEFAULT_PUBLIC_SOURCE_NAME = \"Agents Inc\";\n\nexport const CLI_COLORS = {\n PRIMARY: \"cyan\",\n SUCCESS: \"green\",\n ERROR: \"red\",\n WARNING: \"yellow\",\n INFO: \"blue\",\n NEUTRAL: \"gray\",\n FOCUS: \"cyan\",\n UNFOCUSED: \"white\",\n WHITE: \"white\",\n} as const;\n\n/** Canonical display order for built-in domains. Custom domains appear before these, alphabetically. */\nexport const BUILT_IN_DOMAIN_ORDER: readonly Domain[] = [\"web\", \"api\", \"mobile\", \"cli\"];\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\nexport const ASCII_LOGO = ` █████╗ ██████╗ ███████╗███╗ ██╗████████╗███████╗ ██╗███╗ ██╗ ██████╗\n██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██║████╗ ██║██╔════╝\n███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ███████╗ ██║██╔██╗ ██║██║\n██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ╚════██║ ██║██║╚██╗██║██║\n██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ███████║ ██║██║ ╚████║╚██████╗\n╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝`;\n\nexport const DEFAULT_PRESELECTED_SKILLS: readonly SkillId[] = [\n \"meta-methodology-anti-over-engineering\",\n \"meta-methodology-context-management\",\n \"meta-methodology-improvement-protocol\",\n \"meta-methodology-investigation-requirements\",\n \"meta-methodology-success-criteria\",\n \"meta-methodology-write-verification\",\n];\n"],"mappings":";;;;;;AAAA;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,sBAAsB;AAE5B,IAAM,YAAY,KAAK,KAAK,GAAG,QAAQ,GAAG,UAAU,mBAAmB;AAEvE,IAAM,eAAe;AAErB,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,oBAAoB;AAC1B,IAAM,2BAA2B;AAEjC,IAAM,OAAO;AAAA,EAClB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AACZ;AAEO,IAAM,iBAAiB;AAAA,EAC5B,UAAU;AAAA,EACV,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AAA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