@claude-collective/cli 0.13.4 → 0.21.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 +183 -0
- package/config/skills-matrix.yaml +180 -113
- package/config/stacks.yaml +6 -6
- package/dist/{chunk-K3NB6DSG.js → chunk-2LSGX6R4.js} +54 -114
- package/dist/chunk-2LSGX6R4.js.map +1 -0
- package/dist/chunk-2OKUEELH.js +32 -0
- package/dist/chunk-2OKUEELH.js.map +1 -0
- package/dist/{chunk-V46GGCCI.js → chunk-374JNMR6.js} +14 -96
- package/dist/chunk-374JNMR6.js.map +1 -0
- package/dist/chunk-3EHUF54X.js +133 -0
- package/dist/chunk-3EHUF54X.js.map +1 -0
- package/dist/{chunk-7Q44DMSP.js → chunk-3XR4PALU.js} +92 -145
- package/dist/chunk-3XR4PALU.js.map +1 -0
- package/dist/{chunk-IAUAQJQ2.js → chunk-5K2ZLUO5.js} +5 -5
- package/dist/{chunk-IAUAQJQ2.js.map → chunk-5K2ZLUO5.js.map} +1 -1
- package/dist/{chunk-ACNBKXXJ.js → chunk-5KXUDHAB.js} +8 -36
- package/dist/chunk-5KXUDHAB.js.map +1 -0
- package/dist/chunk-7SLV7CMF.js +615 -0
- package/dist/chunk-7SLV7CMF.js.map +1 -0
- package/dist/{chunk-CDX4W4DM.js → chunk-A46TPNBJ.js} +61 -32
- package/dist/chunk-A46TPNBJ.js.map +1 -0
- package/dist/{chunk-TKFPKEV3.js → chunk-AL74GBW4.js} +1 -1
- package/dist/chunk-AL74GBW4.js.map +1 -0
- package/dist/chunk-BQX23RBV.js +191 -0
- package/dist/chunk-BQX23RBV.js.map +1 -0
- package/dist/{chunk-IMDW5ZUP.js → chunk-CA4LH4LI.js} +5 -5
- package/dist/chunk-CA4LH4LI.js.map +1 -0
- package/dist/{chunk-D237EVNB.js → chunk-CBLPAMZO.js} +5 -8
- package/dist/chunk-CBLPAMZO.js.map +1 -0
- package/dist/{chunk-B7CCVP6Q.js → chunk-CKPQHGXR.js} +52 -274
- package/dist/chunk-CKPQHGXR.js.map +1 -0
- package/dist/{chunk-SVYPSDWY.js → chunk-CXOFOJCN.js} +6 -10
- package/dist/chunk-CXOFOJCN.js.map +1 -0
- package/dist/{chunk-UQTEPWU7.js → chunk-EHGD7HIE.js} +2 -6
- package/dist/chunk-EHGD7HIE.js.map +1 -0
- package/dist/{chunk-76DWXGQE.js → chunk-FJFEKPXF.js} +1 -1
- package/dist/chunk-FJFEKPXF.js.map +1 -0
- package/dist/{chunk-E3FJH4TF.js → chunk-HEOHU5EZ.js} +2 -13
- package/dist/chunk-HEOHU5EZ.js.map +1 -0
- package/dist/{chunk-JIPWV2FX.js → chunk-HGCBZUH5.js} +6 -27
- package/dist/chunk-HGCBZUH5.js.map +1 -0
- package/dist/{chunk-ED4E6Q2T.js → chunk-HPGFY5ZN.js} +4 -4
- package/dist/chunk-HPGFY5ZN.js.map +1 -0
- package/dist/chunk-INJ2EFRW.js +127 -0
- package/dist/chunk-INJ2EFRW.js.map +1 -0
- package/dist/{chunk-KAAEN2PO.js → chunk-IOBFMF6X.js} +6 -2
- package/dist/{chunk-KAAEN2PO.js.map → chunk-IOBFMF6X.js.map} +1 -1
- package/dist/{chunk-K7EVM5LY.js → chunk-KH3HA7J7.js} +8 -33
- package/dist/chunk-KH3HA7J7.js.map +1 -0
- package/dist/{chunk-4K4ZXQRM.js → chunk-N6JNE326.js} +38 -94
- package/dist/chunk-N6JNE326.js.map +1 -0
- package/dist/chunk-NAGU7TVZ.js +36 -0
- package/dist/chunk-NAGU7TVZ.js.map +1 -0
- package/dist/{chunk-Z7G4B5HJ.js → chunk-OQYYMQJR.js} +68 -142
- package/dist/chunk-OQYYMQJR.js.map +1 -0
- package/dist/{chunk-RFTSZDHV.js → chunk-PLZOUVDD.js} +159 -53
- package/dist/chunk-PLZOUVDD.js.map +1 -0
- package/dist/chunk-Q3J43SF3.js +21 -0
- package/dist/chunk-Q3J43SF3.js.map +1 -0
- package/dist/{chunk-3U3R4NCG.js → chunk-T25OEQFI.js} +6 -2
- package/dist/chunk-T25OEQFI.js.map +1 -0
- package/dist/chunk-UMORK7OK.js +29 -0
- package/dist/chunk-UMORK7OK.js.map +1 -0
- package/dist/{chunk-ZFPSUQOU.js → chunk-VFHWU7JU.js} +12 -121
- package/dist/chunk-VFHWU7JU.js.map +1 -0
- package/dist/{chunk-GDH553MV.js → chunk-VS4GVTZE.js} +3 -3
- package/dist/chunk-VS4GVTZE.js.map +1 -0
- package/dist/chunk-WFEFICFM.js +67 -0
- package/dist/chunk-WFEFICFM.js.map +1 -0
- package/dist/{chunk-P26A2K5N.js → chunk-WG6KIAPK.js} +6 -16
- package/dist/chunk-WG6KIAPK.js.map +1 -0
- package/dist/{chunk-X6QONICW.js → chunk-ZEI3ZUDU.js} +3 -7
- package/dist/chunk-ZEI3ZUDU.js.map +1 -0
- package/dist/chunk-ZNIDWLL5.js +68 -0
- package/dist/chunk-ZNIDWLL5.js.map +1 -0
- package/dist/chunk-ZSVMS677.js +45 -0
- package/dist/chunk-ZSVMS677.js.map +1 -0
- package/dist/cli/defaults/agent-mappings.yaml +13 -13
- package/dist/commands/build/marketplace.js +8 -14
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +10 -21
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/build/stack.js +13 -18
- package/dist/commands/build/stack.js.map +1 -1
- package/dist/commands/compile.js +25 -40
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/config/get.js +7 -7
- package/dist/commands/config/get.js.map +1 -1
- package/dist/commands/config/index.js +6 -6
- package/dist/commands/config/index.js.map +1 -1
- package/dist/commands/config/path.js +5 -7
- package/dist/commands/config/path.js.map +1 -1
- package/dist/commands/config/set-project.js +8 -9
- package/dist/commands/config/set-project.js.map +1 -1
- package/dist/commands/config/show.js +5 -5
- package/dist/commands/config/unset-project.js +8 -9
- package/dist/commands/config/unset-project.js.map +1 -1
- package/dist/commands/diff.js +17 -40
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +14 -25
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +41 -54
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +24 -44
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/import/skill.js +19 -39
- package/dist/commands/import/skill.js.map +1 -1
- package/dist/commands/info.js +10 -15
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.js +452 -451
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.js +85 -9
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/agent.js +9 -10
- package/dist/commands/new/agent.js.map +1 -1
- package/dist/commands/new/skill.js +12 -16
- package/dist/commands/new/skill.js.map +1 -1
- package/dist/commands/outdated.js +12 -89
- package/dist/commands/outdated.js.map +1 -1
- package/dist/commands/search.js +12 -18
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/uninstall.js +12 -21
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +26 -146
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +407 -15
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/version/bump.js +7 -23
- package/dist/commands/version/bump.js.map +1 -1
- package/dist/commands/version/index.js +6 -21
- package/dist/commands/version/index.js.map +1 -1
- package/dist/commands/version/set.js +6 -23
- package/dist/commands/version/set.js.map +1 -1
- package/dist/commands/version/show.js +6 -21
- package/dist/commands/version/show.js.map +1 -1
- package/dist/components/common/message.js +2 -6
- package/dist/components/common/message.js.map +1 -1
- package/dist/components/common/spinner.js.map +1 -1
- package/dist/components/skill-search/skill-search.js +1 -1
- package/dist/components/wizard/category-grid.js +1 -1
- package/dist/components/wizard/category-grid.test.js +20 -92
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/menu-item.js +9 -0
- package/dist/components/wizard/section-progress.js +1 -1
- package/dist/components/wizard/section-progress.test.js +13 -103
- package/dist/components/wizard/section-progress.test.js.map +1 -1
- package/dist/components/wizard/step-approach.js +5 -4
- package/dist/components/wizard/step-build.js +3 -4
- package/dist/components/wizard/step-build.test.js +81 -186
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +1 -2
- package/dist/components/wizard/step-refine.js +1 -2
- package/dist/components/wizard/step-refine.test.js +6 -14
- package/dist/components/wizard/step-refine.test.js.map +1 -1
- package/dist/components/wizard/step-stack.js +5 -3
- package/dist/components/wizard/view-title.js +9 -0
- package/dist/components/wizard/wizard-layout.js +16 -0
- package/dist/components/wizard/wizard-layout.js.map +1 -0
- package/dist/components/wizard/wizard-tabs.js +1 -1
- package/dist/components/wizard/wizard.js +12 -13
- package/dist/config/skills-matrix.yaml +180 -113
- package/dist/config/stacks.yaml +6 -6
- package/dist/hooks/init.js +5 -7
- package/dist/hooks/init.js.map +1 -1
- package/dist/src/agents/developer/web-developer/examples.md +1 -6
- package/dist/src/agents/meta/documentor/workflow.md +1 -5
- package/dist/src/agents/migration/cli-migrator/anti-patterns.md +1 -3
- package/dist/src/agents/tester/web-tester/output-format.md +1 -3
- package/dist/stores/wizard-store.js +2 -2
- package/dist/stores/wizard-store.test.js +60 -23
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/src/agents/developer/web-developer/examples.md +1 -6
- package/src/agents/meta/documentor/workflow.md +1 -5
- package/src/agents/migration/cli-migrator/anti-patterns.md +1 -3
- package/src/agents/tester/web-tester/output-format.md +1 -3
- package/dist/chunk-3U3R4NCG.js.map +0 -1
- package/dist/chunk-4K4ZXQRM.js.map +0 -1
- package/dist/chunk-76DWXGQE.js.map +0 -1
- package/dist/chunk-7Q44DMSP.js.map +0 -1
- package/dist/chunk-ACNBKXXJ.js.map +0 -1
- package/dist/chunk-B7CCVP6Q.js.map +0 -1
- package/dist/chunk-BDLUZVKU.js +0 -54
- package/dist/chunk-BDLUZVKU.js.map +0 -1
- package/dist/chunk-CDX4W4DM.js.map +0 -1
- package/dist/chunk-D237EVNB.js.map +0 -1
- package/dist/chunk-DRXPNNPB.js +0 -393
- package/dist/chunk-DRXPNNPB.js.map +0 -1
- package/dist/chunk-E3FJH4TF.js.map +0 -1
- package/dist/chunk-ED4E6Q2T.js.map +0 -1
- package/dist/chunk-GDH553MV.js.map +0 -1
- package/dist/chunk-HLJX2FTL.js +0 -95
- package/dist/chunk-HLJX2FTL.js.map +0 -1
- package/dist/chunk-I2DSLOXZ.js +0 -75
- package/dist/chunk-I2DSLOXZ.js.map +0 -1
- package/dist/chunk-I4TPKIYX.js +0 -493
- package/dist/chunk-I4TPKIYX.js.map +0 -1
- package/dist/chunk-IBE7JIAG.js +0 -129
- package/dist/chunk-IBE7JIAG.js.map +0 -1
- package/dist/chunk-IMDW5ZUP.js.map +0 -1
- package/dist/chunk-JIPWV2FX.js.map +0 -1
- package/dist/chunk-K3NB6DSG.js.map +0 -1
- package/dist/chunk-K7EVM5LY.js.map +0 -1
- package/dist/chunk-NDY25DTL.js +0 -453
- package/dist/chunk-NDY25DTL.js.map +0 -1
- package/dist/chunk-P26A2K5N.js.map +0 -1
- package/dist/chunk-RFTSZDHV.js.map +0 -1
- package/dist/chunk-SVYPSDWY.js.map +0 -1
- package/dist/chunk-TKFPKEV3.js.map +0 -1
- package/dist/chunk-UQTEPWU7.js.map +0 -1
- package/dist/chunk-V46GGCCI.js.map +0 -1
- package/dist/chunk-X6QONICW.js.map +0 -1
- package/dist/chunk-Y2LW7R3Y.js +0 -23
- package/dist/chunk-Y2LW7R3Y.js.map +0 -1
- package/dist/chunk-Z7G4B5HJ.js.map +0 -1
- package/dist/chunk-ZENYS6KW.js +0 -90
- package/dist/chunk-ZENYS6KW.js.map +0 -1
- package/dist/chunk-ZFPSUQOU.js.map +0 -1
- package/dist/commands/config/set.js +0 -61
- package/dist/commands/config/set.js.map +0 -1
- package/dist/commands/config/unset.js +0 -57
- package/dist/commands/config/unset.js.map +0 -1
- package/dist/commands/test-imports.js +0 -92
- package/dist/commands/test-imports.js.map +0 -1
- package/dist/components/wizard/step-stack-options.js +0 -11
- package/dist/components/wizard/wizard-footer.js +0 -9
- /package/dist/components/wizard/{step-stack-options.js.map → menu-item.js.map} +0 -0
- /package/dist/components/wizard/{wizard-footer.js.map → view-title.js.map} +0 -0
|
@@ -1,108 +1,91 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
StepRefine
|
|
4
|
-
} from "./chunk-E3FJH4TF.js";
|
|
5
|
-
import {
|
|
6
|
-
StepStackOptions
|
|
7
|
-
} from "./chunk-HLJX2FTL.js";
|
|
8
2
|
import {
|
|
9
3
|
StepStack
|
|
10
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A46TPNBJ.js";
|
|
11
5
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "./chunk-I2DSLOXZ.js";
|
|
6
|
+
WizardLayout
|
|
7
|
+
} from "./chunk-3EHUF54X.js";
|
|
15
8
|
import {
|
|
16
9
|
StepApproach
|
|
17
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WFEFICFM.js";
|
|
18
11
|
import {
|
|
19
12
|
StepBuild,
|
|
13
|
+
getStackName,
|
|
20
14
|
validateSelection
|
|
21
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3XR4PALU.js";
|
|
22
16
|
import {
|
|
23
17
|
StepConfirm
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import {
|
|
26
|
-
useWizardStore
|
|
27
|
-
} from "./chunk-D237EVNB.js";
|
|
18
|
+
} from "./chunk-ZEI3ZUDU.js";
|
|
28
19
|
import {
|
|
29
20
|
cliTheme
|
|
30
21
|
} from "./chunk-Z2CWURZ6.js";
|
|
22
|
+
import {
|
|
23
|
+
useWizardStore
|
|
24
|
+
} from "./chunk-CBLPAMZO.js";
|
|
31
25
|
import {
|
|
32
26
|
init_esm_shims
|
|
33
27
|
} from "./chunk-DHET7RCE.js";
|
|
34
28
|
|
|
35
29
|
// src/cli/components/wizard/wizard.tsx
|
|
36
30
|
init_esm_shims();
|
|
37
|
-
import { useCallback
|
|
31
|
+
import { useCallback } from "react";
|
|
38
32
|
import { Box, Text, useApp, useInput, useStdout } from "ink";
|
|
39
33
|
import { ThemeProvider } from "@inkjs/ui";
|
|
40
34
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const stack = matrix.suggestedStacks.find((s) => s.id === stackId);
|
|
45
|
-
return stack?.name;
|
|
46
|
-
}
|
|
47
|
-
function getStackTechnologyCount(stackId, matrix) {
|
|
48
|
-
if (!stackId) return 0;
|
|
49
|
-
const stack = matrix.suggestedStacks.find((s) => s.id === stackId);
|
|
50
|
-
if (!stack) return 0;
|
|
51
|
-
return stack.allSkillIds.length;
|
|
35
|
+
function getParentDomain(domain, matrix) {
|
|
36
|
+
const cat = Object.values(matrix.categories).find((c) => c.domain === domain && c.parent_domain);
|
|
37
|
+
return cat?.parent_domain;
|
|
52
38
|
}
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
onComplete,
|
|
56
|
-
onCancel,
|
|
57
|
-
version
|
|
58
|
-
}) => {
|
|
39
|
+
var MIN_TERMINAL_WIDTH = 80;
|
|
40
|
+
var Wizard = ({ matrix, onComplete, onCancel, version }) => {
|
|
59
41
|
const store = useWizardStore();
|
|
60
42
|
const { exit } = useApp();
|
|
61
43
|
const { stdout } = useStdout();
|
|
62
44
|
const terminalWidth = stdout.columns || MIN_TERMINAL_WIDTH;
|
|
63
45
|
const isNarrowTerminal = terminalWidth < MIN_TERMINAL_WIDTH;
|
|
64
|
-
const { completedSteps, skippedSteps } = useMemo(() => {
|
|
65
|
-
const completed = [];
|
|
66
|
-
const skipped = [];
|
|
67
|
-
if (store.step !== "approach") {
|
|
68
|
-
completed.push("approach");
|
|
69
|
-
}
|
|
70
|
-
if (store.step !== "approach" && store.step !== "stack" && store.step !== "stack-options") {
|
|
71
|
-
completed.push("stack");
|
|
72
|
-
}
|
|
73
|
-
if (store.approach === "stack" && store.selectedStackId && store.stackAction === "defaults") {
|
|
74
|
-
skipped.push("build");
|
|
75
|
-
} else if (store.step === "refine" || store.step === "confirm") {
|
|
76
|
-
completed.push("build");
|
|
77
|
-
}
|
|
78
|
-
if (store.step === "confirm") {
|
|
79
|
-
completed.push("refine");
|
|
80
|
-
}
|
|
81
|
-
return { completedSteps: completed, skippedSteps: skipped };
|
|
82
|
-
}, [store.step, store.approach, store.selectedStackId, store.stackAction]);
|
|
83
46
|
useInput((input, key) => {
|
|
84
47
|
if (key.escape) {
|
|
85
48
|
if (store.step === "approach") {
|
|
86
49
|
onCancel();
|
|
87
50
|
exit();
|
|
88
|
-
} else {
|
|
51
|
+
} else if (store.step !== "build" && store.step !== "confirm") {
|
|
89
52
|
store.goBack();
|
|
90
53
|
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if ((input === "a" || input === "A") && store.step === "build" && store.selectedStackId) {
|
|
57
|
+
store.setStackAction("defaults");
|
|
58
|
+
store.setStep("confirm");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (input === "e" || input === "E") {
|
|
62
|
+
store.toggleExpertMode();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (input === "p" || input === "P") {
|
|
66
|
+
store.toggleInstallMode();
|
|
67
|
+
return;
|
|
91
68
|
}
|
|
92
69
|
});
|
|
93
70
|
const handleComplete = useCallback(() => {
|
|
94
71
|
let allSkills;
|
|
95
72
|
if (store.selectedStackId && store.stackAction === "defaults") {
|
|
96
|
-
const stack = matrix.suggestedStacks.find(
|
|
97
|
-
(s) => s.id === store.selectedStackId
|
|
98
|
-
);
|
|
73
|
+
const stack = matrix.suggestedStacks.find((s) => s.id === store.selectedStackId);
|
|
99
74
|
if (!stack) {
|
|
100
75
|
console.warn(`Stack not found in matrix: ${store.selectedStackId}`);
|
|
101
76
|
}
|
|
102
77
|
allSkills = [...stack?.allSkillIds || []];
|
|
103
78
|
} else {
|
|
104
79
|
const techNames = store.getAllSelectedTechnologies();
|
|
105
|
-
allSkills = techNames.map((tech) =>
|
|
80
|
+
allSkills = techNames.map((tech) => {
|
|
81
|
+
const resolved = matrix.aliases[tech];
|
|
82
|
+
if (!resolved && !matrix.skills[tech]) {
|
|
83
|
+
console.warn(
|
|
84
|
+
`Warning: Technology '${tech}' could not be resolved to a skill ID \u2014 it may be missing from skill_aliases`
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
return resolved || tech;
|
|
88
|
+
});
|
|
106
89
|
}
|
|
107
90
|
const methodologySkills = store.getSelectedSkills();
|
|
108
91
|
for (const skill of methodologySkills) {
|
|
@@ -129,54 +112,36 @@ var Wizard = ({
|
|
|
129
112
|
return /* @__PURE__ */ jsx(StepApproach, {});
|
|
130
113
|
case "stack":
|
|
131
114
|
return /* @__PURE__ */ jsx(StepStack, { matrix });
|
|
132
|
-
case "stack-options": {
|
|
133
|
-
const stackName = getStackName(store.selectedStackId, matrix) || "Selected Stack";
|
|
134
|
-
const techCount = getStackTechnologyCount(
|
|
135
|
-
store.selectedStackId,
|
|
136
|
-
matrix
|
|
137
|
-
);
|
|
138
|
-
return /* @__PURE__ */ jsx(
|
|
139
|
-
StepStackOptions,
|
|
140
|
-
{
|
|
141
|
-
stackName,
|
|
142
|
-
technologyCount: techCount,
|
|
143
|
-
matrix
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
115
|
case "build": {
|
|
148
116
|
const currentDomain = store.getCurrentDomain();
|
|
149
117
|
const effectiveDomains = store.selectedDomains.length > 0 ? store.selectedDomains : ["web"];
|
|
150
118
|
const allSelections = store.getAllSelectedTechnologies();
|
|
119
|
+
const activeDomain = currentDomain || effectiveDomains[0] || "web";
|
|
120
|
+
const parentDomain = getParentDomain(activeDomain, matrix);
|
|
121
|
+
const parentDomainSelections = parentDomain ? store.domainSelections[parentDomain] : void 0;
|
|
151
122
|
return /* @__PURE__ */ jsx(
|
|
152
123
|
StepBuild,
|
|
153
124
|
{
|
|
154
125
|
matrix,
|
|
155
|
-
domain:
|
|
126
|
+
domain: activeDomain,
|
|
156
127
|
selectedDomains: effectiveDomains,
|
|
157
|
-
|
|
158
|
-
selections: store.domainSelections[currentDomain || "web"] || {},
|
|
128
|
+
selections: store.domainSelections[activeDomain] || {},
|
|
159
129
|
allSelections,
|
|
160
130
|
focusedRow: store.focusedRow,
|
|
161
131
|
focusedCol: store.focusedCol,
|
|
162
132
|
showDescriptions: store.showDescriptions,
|
|
163
133
|
expertMode: store.expertMode,
|
|
134
|
+
parentDomainSelections,
|
|
164
135
|
onToggle: (subcategoryId, techId) => {
|
|
165
136
|
const domain = store.getCurrentDomain() || "web";
|
|
166
137
|
const cat = matrix.categories[subcategoryId];
|
|
167
|
-
store.toggleTechnology(
|
|
168
|
-
domain,
|
|
169
|
-
subcategoryId,
|
|
170
|
-
techId,
|
|
171
|
-
cat?.exclusive ?? true
|
|
172
|
-
);
|
|
138
|
+
store.toggleTechnology(domain, subcategoryId, techId, cat?.exclusive ?? true);
|
|
173
139
|
},
|
|
174
140
|
onFocusChange: store.setFocus,
|
|
175
141
|
onToggleDescriptions: store.toggleShowDescriptions,
|
|
176
|
-
onToggleExpertMode: store.toggleExpertMode,
|
|
177
142
|
onContinue: () => {
|
|
178
143
|
if (!store.nextDomain()) {
|
|
179
|
-
store.setStep("
|
|
144
|
+
store.setStep("confirm");
|
|
180
145
|
}
|
|
181
146
|
},
|
|
182
147
|
onBack: () => {
|
|
@@ -187,17 +152,6 @@ var Wizard = ({
|
|
|
187
152
|
}
|
|
188
153
|
);
|
|
189
154
|
}
|
|
190
|
-
case "refine":
|
|
191
|
-
return /* @__PURE__ */ jsx(
|
|
192
|
-
StepRefine,
|
|
193
|
-
{
|
|
194
|
-
technologyCount: store.getAllSelectedTechnologies().length,
|
|
195
|
-
refineAction: store.refineAction,
|
|
196
|
-
onSelectAction: store.setRefineAction,
|
|
197
|
-
onContinue: () => store.setStep("confirm"),
|
|
198
|
-
onBack: store.goBack
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
155
|
case "confirm": {
|
|
202
156
|
const stackName = getStackName(store.selectedStackId, matrix);
|
|
203
157
|
return /* @__PURE__ */ jsx(
|
|
@@ -209,7 +163,7 @@ var Wizard = ({
|
|
|
209
163
|
selectedDomains: store.selectedDomains,
|
|
210
164
|
domainSelections: store.domainSelections,
|
|
211
165
|
technologyCount: store.getAllSelectedTechnologies().length,
|
|
212
|
-
skillCount: store.
|
|
166
|
+
skillCount: store.getAllSelectedTechnologies().length,
|
|
213
167
|
installMode: store.installMode,
|
|
214
168
|
onBack: store.goBack
|
|
215
169
|
}
|
|
@@ -224,7 +178,8 @@ var Wizard = ({
|
|
|
224
178
|
/* @__PURE__ */ jsxs(Text, { color: "yellow", children: [
|
|
225
179
|
"Terminal too narrow (",
|
|
226
180
|
terminalWidth,
|
|
227
|
-
" columns). Please resize to at least
|
|
181
|
+
" columns). Please resize to at least",
|
|
182
|
+
" ",
|
|
228
183
|
MIN_TERMINAL_WIDTH,
|
|
229
184
|
" columns."
|
|
230
185
|
] }),
|
|
@@ -235,25 +190,10 @@ var Wizard = ({
|
|
|
235
190
|
] }) })
|
|
236
191
|
] }) });
|
|
237
192
|
}
|
|
238
|
-
return /* @__PURE__ */ jsx(ThemeProvider, { theme: cliTheme, children: /* @__PURE__ */
|
|
239
|
-
version && /* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
240
|
-
"Claude Collective v",
|
|
241
|
-
version
|
|
242
|
-
] }) }),
|
|
243
|
-
/* @__PURE__ */ jsx(
|
|
244
|
-
WizardTabs,
|
|
245
|
-
{
|
|
246
|
-
steps: WIZARD_STEPS,
|
|
247
|
-
currentStep: store.step,
|
|
248
|
-
completedSteps,
|
|
249
|
-
skippedSteps
|
|
250
|
-
}
|
|
251
|
-
),
|
|
252
|
-
renderStep()
|
|
253
|
-
] }) });
|
|
193
|
+
return /* @__PURE__ */ jsx(ThemeProvider, { theme: cliTheme, children: /* @__PURE__ */ jsx(WizardLayout, { version, children: renderStep() }) });
|
|
254
194
|
};
|
|
255
195
|
|
|
256
196
|
export {
|
|
257
197
|
Wizard
|
|
258
198
|
};
|
|
259
|
-
//# sourceMappingURL=chunk-
|
|
199
|
+
//# sourceMappingURL=chunk-2LSGX6R4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/wizard.tsx"],"sourcesContent":["/**\n * Wizard component - Main orchestrator for the skill selection wizard.\n *\n * V2 Flow:\n * - approach: Choose stack template or build from scratch\n * - stack: Select pre-built stack (stack path) OR domains (scratch path)\n * - build: CategoryGrid for technology selection (pre-populated from stack if stack path)\n * - confirm: Final confirmation\n *\n * Navigation:\n * - ESC goes back through history\n * - ESC at approach cancels wizard\n * - Ctrl+C cancels at any point\n */\nimport React, { useCallback } from \"react\";\nimport { Box, Text, useApp, useInput, useStdout } from \"ink\";\nimport { ThemeProvider } from \"@inkjs/ui\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { cliTheme } from \"../themes/default.js\";\nimport { WizardLayout } from \"./wizard-layout.js\";\nimport { StepApproach } from \"./step-approach.js\";\nimport { StepStack } from \"./step-stack.js\";\nimport { StepBuild } from \"./step-build.js\";\nimport { StepConfirm } from \"./step-confirm.js\";\nimport { validateSelection } from \"../../lib/matrix-resolver.js\";\nimport type { MergedSkillsMatrix } from \"../../types-matrix.js\";\nimport { getStackName } from \"./utils.js\";\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport interface WizardResultV2 {\n selectedSkills: string[];\n selectedStackId: string | null;\n domainSelections: Record<string, Record<string, string[]>>;\n expertMode: boolean;\n installMode: \"plugin\" | \"local\";\n cancelled: boolean;\n validation: {\n valid: boolean;\n errors: Array<{ message: string }>;\n warnings: Array<{ message: string }>;\n };\n}\n\ninterface WizardProps {\n matrix: MergedSkillsMatrix;\n onComplete: (result: WizardResultV2) => void;\n onCancel: () => void;\n initialSkills?: string[];\n version?: string;\n}\n\n// =============================================================================\n// Helpers\n// =============================================================================\n\nfunction getParentDomain(domain: string, matrix: MergedSkillsMatrix): string | undefined {\n const cat = Object.values(matrix.categories).find((c) => c.domain === domain && c.parent_domain);\n return cat?.parent_domain;\n}\n\n// =============================================================================\n// Constants\n// =============================================================================\n\n/** Minimum terminal width required for the wizard */\nconst MIN_TERMINAL_WIDTH = 80;\n\n// =============================================================================\n// Main Component\n// =============================================================================\n\nexport const Wizard: React.FC<WizardProps> = ({ matrix, onComplete, onCancel, version }) => {\n const store = useWizardStore();\n const { exit } = useApp();\n const { stdout } = useStdout();\n\n // Check terminal width\n const terminalWidth = stdout.columns || MIN_TERMINAL_WIDTH;\n const isNarrowTerminal = terminalWidth < MIN_TERMINAL_WIDTH;\n\n // Global keyboard shortcut handler\n useInput((input, key) => {\n if (key.escape) {\n if (store.step === \"approach\") {\n onCancel();\n exit();\n } else if (store.step !== \"build\" && store.step !== \"confirm\") {\n // Only handle escape globally for steps that don't have their own escape handler.\n // Build and confirm handle escape via their onBack props.\n store.goBack();\n }\n return;\n }\n\n // Accept defaults shortcut (stack path only, during build step)\n if ((input === \"a\" || input === \"A\") && store.step === \"build\" && store.selectedStackId) {\n store.setStackAction(\"defaults\");\n store.setStep(\"confirm\");\n return;\n }\n\n // Global toggles\n if (input === \"e\" || input === \"E\") {\n store.toggleExpertMode();\n return;\n }\n if (input === \"p\" || input === \"P\") {\n store.toggleInstallMode();\n return;\n }\n });\n\n // Handle wizard completion\n const handleComplete = useCallback(() => {\n let allSkills: string[];\n\n if (store.selectedStackId && store.stackAction === \"defaults\") {\n // Stack + defaults path: use stack's allSkillIds directly\n const stack = matrix.suggestedStacks.find((s) => s.id === store.selectedStackId);\n if (!stack) {\n console.warn(`Stack not found in matrix: ${store.selectedStackId}`);\n }\n allSkills = [...(stack?.allSkillIds || [])];\n } else {\n // Scratch / Customize path: resolve domainSelections via aliases\n const techNames = store.getAllSelectedTechnologies();\n // Resolve each technology name to its full skill ID via aliases\n allSkills = techNames.map((tech) => {\n const resolved = matrix.aliases[tech];\n if (!resolved && !matrix.skills[tech]) {\n console.warn(\n `Warning: Technology '${tech}' could not be resolved to a skill ID — it may be missing from skill_aliases`,\n );\n }\n return resolved || tech;\n });\n }\n\n // Add methodology skills (always included)\n const methodologySkills = store.getSelectedSkills();\n for (const skill of methodologySkills) {\n if (!allSkills.includes(skill)) {\n allSkills.push(skill);\n }\n }\n\n const validation = validateSelection(allSkills, matrix);\n\n const result: WizardResultV2 = {\n selectedSkills: allSkills,\n selectedStackId: store.selectedStackId,\n domainSelections: store.domainSelections,\n expertMode: store.expertMode,\n installMode: store.installMode,\n cancelled: false,\n validation,\n };\n\n onComplete(result);\n exit();\n }, [store, matrix, onComplete, exit]);\n\n // Render current step\n const renderStep = () => {\n switch (store.step) {\n case \"approach\":\n return <StepApproach />;\n\n case \"stack\":\n return <StepStack matrix={matrix} />;\n\n case \"build\": {\n const currentDomain = store.getCurrentDomain();\n // For stack path with customize, use all domains from stack\n // For scratch path, use selectedDomains\n const effectiveDomains = store.selectedDomains.length > 0 ? store.selectedDomains : [\"web\"]; // Default to web if no domains selected\n\n const allSelections = store.getAllSelectedTechnologies();\n\n const activeDomain = currentDomain || effectiveDomains[0] || \"web\";\n const parentDomain = getParentDomain(activeDomain, matrix);\n const parentDomainSelections = parentDomain\n ? store.domainSelections[parentDomain]\n : undefined;\n\n return (\n <StepBuild\n matrix={matrix}\n domain={activeDomain}\n selectedDomains={effectiveDomains}\n selections={store.domainSelections[activeDomain] || {}}\n allSelections={allSelections}\n focusedRow={store.focusedRow}\n focusedCol={store.focusedCol}\n showDescriptions={store.showDescriptions}\n expertMode={store.expertMode}\n parentDomainSelections={parentDomainSelections}\n onToggle={(subcategoryId, techId) => {\n const domain = store.getCurrentDomain() || \"web\";\n const cat = matrix.categories[subcategoryId];\n store.toggleTechnology(domain, subcategoryId, techId, cat?.exclusive ?? true);\n }}\n onFocusChange={store.setFocus}\n onToggleDescriptions={store.toggleShowDescriptions}\n onContinue={() => {\n if (!store.nextDomain()) {\n store.setStep(\"confirm\");\n }\n }}\n onBack={() => {\n if (!store.prevDomain()) {\n store.goBack();\n }\n }}\n />\n );\n }\n\n case \"confirm\": {\n const stackName = getStackName(store.selectedStackId, matrix);\n return (\n <StepConfirm\n matrix={matrix}\n onComplete={handleComplete}\n stackName={stackName}\n selectedDomains={store.selectedDomains}\n domainSelections={store.domainSelections}\n technologyCount={store.getAllSelectedTechnologies().length}\n skillCount={store.getAllSelectedTechnologies().length}\n installMode={store.installMode}\n onBack={store.goBack}\n />\n );\n }\n\n default:\n return null;\n }\n };\n\n // Show warning if terminal is too narrow\n if (isNarrowTerminal) {\n return (\n <ThemeProvider theme={cliTheme}>\n <Box flexDirection=\"column\" padding={1}>\n <Text color=\"yellow\">\n Terminal too narrow ({terminalWidth} columns). Please resize to at least{\" \"}\n {MIN_TERMINAL_WIDTH} columns.\n </Text>\n <Box marginTop={1}>\n <Text dimColor>Current width: {terminalWidth} columns</Text>\n </Box>\n </Box>\n </ThemeProvider>\n );\n }\n\n return (\n <ThemeProvider theme={cliTheme}>\n <WizardLayout version={version}>{renderStep()}</WizardLayout>\n </ThemeProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAcA,SAAgB,mBAAmB;AACnC,SAAS,KAAK,MAAM,QAAQ,UAAU,iBAAiB;AACvD,SAAS,qBAAqB;AAyJf,cA+EL,YA/EK;AA/Gf,SAAS,gBAAgB,QAAgB,QAAgD;AACvF,QAAM,MAAM,OAAO,OAAO,OAAO,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,WAAW,UAAU,EAAE,aAAa;AAC/F,SAAO,KAAK;AACd;AAOA,IAAM,qBAAqB;AAMpB,IAAM,SAAgC,CAAC,EAAE,QAAQ,YAAY,UAAU,QAAQ,MAAM;AAC1F,QAAM,QAAQ,eAAe;AAC7B,QAAM,EAAE,KAAK,I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|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
fileExists
|
|
4
|
+
} from "./chunk-AL74GBW4.js";
|
|
5
|
+
import {
|
|
6
|
+
PLUGIN_MANIFEST_DIR,
|
|
7
|
+
PLUGIN_MANIFEST_FILE
|
|
8
|
+
} from "./chunk-FJFEKPXF.js";
|
|
9
|
+
import {
|
|
10
|
+
init_esm_shims
|
|
11
|
+
} from "./chunk-DHET7RCE.js";
|
|
12
|
+
|
|
13
|
+
// src/cli/lib/plugin-manifest-finder.ts
|
|
14
|
+
init_esm_shims();
|
|
15
|
+
import path from "path";
|
|
16
|
+
async function findPluginManifest(startDir) {
|
|
17
|
+
let currentDir = startDir;
|
|
18
|
+
const root = path.parse(currentDir).root;
|
|
19
|
+
while (currentDir !== root) {
|
|
20
|
+
const manifestPath = path.join(currentDir, PLUGIN_MANIFEST_DIR, PLUGIN_MANIFEST_FILE);
|
|
21
|
+
if (await fileExists(manifestPath)) {
|
|
22
|
+
return manifestPath;
|
|
23
|
+
}
|
|
24
|
+
currentDir = path.dirname(currentDir);
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
findPluginManifest
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-2OKUEELH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/lib/plugin-manifest-finder.ts"],"sourcesContent":["/**\n * Find the nearest plugin manifest by walking up the directory tree.\n */\nimport path from \"path\";\nimport { PLUGIN_MANIFEST_DIR, PLUGIN_MANIFEST_FILE } from \"../consts\";\nimport { fileExists } from \"../utils/fs\";\n\n/**\n * Walk up from `startDir` to the filesystem root, looking for\n * `PLUGIN_MANIFEST_DIR/PLUGIN_MANIFEST_FILE` (e.g. `.claude-plugin/plugin.json`).\n *\n * Returns the full path to the manifest file, or `null` if not found.\n */\nexport async function findPluginManifest(startDir: string): Promise<string | null> {\n let currentDir = startDir;\n const root = path.parse(currentDir).root;\n\n while (currentDir !== root) {\n const manifestPath = path.join(currentDir, PLUGIN_MANIFEST_DIR, PLUGIN_MANIFEST_FILE);\n if (await fileExists(manifestPath)) {\n return manifestPath;\n }\n currentDir = path.dirname(currentDir);\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AAGA,OAAO,UAAU;AAUjB,eAAsB,mBAAmB,UAA0C;AACjF,MAAI,aAAa;AACjB,QAAM,OAAO,KAAK,MAAM,UAAU,EAAE;AAEpC,SAAO,eAAe,MAAM;AAC1B,UAAM,eAAe,KAAK,KAAK,YAAY,qBAAqB,oBAAoB;AACpF,QAAI,MAAM,WAAW,YAAY,GAAG;AAClC,aAAO;AAAA,IACT;AACA,iBAAa,KAAK,QAAQ,UAAU;AAAA,EACtC;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
verbose
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-T25OEQFI.js";
|
|
5
5
|
import {
|
|
6
6
|
ensureDir,
|
|
7
7
|
fileExists,
|
|
8
8
|
readFile,
|
|
9
9
|
writeFile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AL74GBW4.js";
|
|
11
11
|
import {
|
|
12
12
|
CLAUDE_DIR,
|
|
13
13
|
CLAUDE_SRC_DIR
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FJFEKPXF.js";
|
|
15
15
|
import {
|
|
16
16
|
init_esm_shims
|
|
17
17
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -19,23 +19,15 @@ import {
|
|
|
19
19
|
// src/cli/lib/config.ts
|
|
20
20
|
init_esm_shims();
|
|
21
21
|
import path from "path";
|
|
22
|
-
import os from "os";
|
|
23
22
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
24
23
|
var DEFAULT_SOURCE = "github:claude-collective/skills";
|
|
25
24
|
var SOURCE_ENV_VAR = "CC_SOURCE";
|
|
26
|
-
var CONFIG_HOME_ENV_VAR = "CC_CONFIG_HOME";
|
|
27
|
-
var GLOBAL_CONFIG_FILE = "config.yaml";
|
|
28
25
|
var PROJECT_CONFIG_FILE = "config.yaml";
|
|
29
|
-
function getGlobalConfigDir() {
|
|
30
|
-
return process.env[CONFIG_HOME_ENV_VAR] || path.join(os.homedir(), ".claude-collective");
|
|
31
|
-
}
|
|
32
|
-
var GLOBAL_CONFIG_DIR = path.join(os.homedir(), ".claude-collective");
|
|
33
26
|
function isValidSourceEntry(entry) {
|
|
34
27
|
if (typeof entry !== "object" || entry === null) return false;
|
|
35
28
|
const e = entry;
|
|
36
29
|
if (typeof e.name !== "string" || typeof e.url !== "string") return false;
|
|
37
|
-
if (e.description !== void 0 && typeof e.description !== "string")
|
|
38
|
-
return false;
|
|
30
|
+
if (e.description !== void 0 && typeof e.description !== "string") return false;
|
|
39
31
|
if (e.ref !== void 0 && typeof e.ref !== "string") return false;
|
|
40
32
|
return true;
|
|
41
33
|
}
|
|
@@ -43,62 +35,19 @@ function isValidSourcesArray(arr) {
|
|
|
43
35
|
if (!Array.isArray(arr)) return false;
|
|
44
36
|
return arr.every(isValidSourceEntry);
|
|
45
37
|
}
|
|
46
|
-
function isValidGlobalConfig(obj) {
|
|
47
|
-
if (typeof obj !== "object" || obj === null) return false;
|
|
48
|
-
const config = obj;
|
|
49
|
-
if (config.source !== void 0 && typeof config.source !== "string")
|
|
50
|
-
return false;
|
|
51
|
-
if (config.author !== void 0 && typeof config.author !== "string")
|
|
52
|
-
return false;
|
|
53
|
-
if (config.marketplace !== void 0 && typeof config.marketplace !== "string")
|
|
54
|
-
return false;
|
|
55
|
-
if (config.agents_source !== void 0 && typeof config.agents_source !== "string")
|
|
56
|
-
return false;
|
|
57
|
-
if (config.sources !== void 0 && !isValidSourcesArray(config.sources))
|
|
58
|
-
return false;
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
38
|
function isValidProjectConfig(obj) {
|
|
62
39
|
if (typeof obj !== "object" || obj === null) return false;
|
|
63
40
|
const config = obj;
|
|
64
|
-
if (config.source !== void 0 && typeof config.source !== "string")
|
|
65
|
-
|
|
66
|
-
if (config.
|
|
67
|
-
|
|
68
|
-
if (config.
|
|
69
|
-
return false;
|
|
70
|
-
if (config.agents_source !== void 0 && typeof config.agents_source !== "string")
|
|
71
|
-
return false;
|
|
72
|
-
if (config.sources !== void 0 && !isValidSourcesArray(config.sources))
|
|
73
|
-
return false;
|
|
41
|
+
if (config.source !== void 0 && typeof config.source !== "string") return false;
|
|
42
|
+
if (config.author !== void 0 && typeof config.author !== "string") return false;
|
|
43
|
+
if (config.marketplace !== void 0 && typeof config.marketplace !== "string") return false;
|
|
44
|
+
if (config.agents_source !== void 0 && typeof config.agents_source !== "string") return false;
|
|
45
|
+
if (config.sources !== void 0 && !isValidSourcesArray(config.sources)) return false;
|
|
74
46
|
return true;
|
|
75
47
|
}
|
|
76
|
-
function getGlobalConfigPath() {
|
|
77
|
-
return path.join(getGlobalConfigDir(), GLOBAL_CONFIG_FILE);
|
|
78
|
-
}
|
|
79
48
|
function getProjectConfigPath(projectDir) {
|
|
80
49
|
return path.join(projectDir, CLAUDE_SRC_DIR, PROJECT_CONFIG_FILE);
|
|
81
50
|
}
|
|
82
|
-
async function loadGlobalConfig() {
|
|
83
|
-
const configPath = getGlobalConfigPath();
|
|
84
|
-
if (!await fileExists(configPath)) {
|
|
85
|
-
verbose(`Global config not found at ${configPath}`);
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
try {
|
|
89
|
-
const content = await readFile(configPath);
|
|
90
|
-
const parsed = parseYaml(content);
|
|
91
|
-
if (!isValidGlobalConfig(parsed)) {
|
|
92
|
-
verbose(`Invalid global config structure at ${configPath}`);
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
verbose(`Loaded global config from ${configPath}`);
|
|
96
|
-
return parsed;
|
|
97
|
-
} catch (error) {
|
|
98
|
-
verbose(`Failed to parse global config: ${error}`);
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
51
|
async function loadProjectConfig(projectDir) {
|
|
103
52
|
const srcConfigPath = getProjectConfigPath(projectDir);
|
|
104
53
|
const legacyConfigPath = path.join(projectDir, CLAUDE_DIR, "config.yaml");
|
|
@@ -108,9 +57,7 @@ async function loadProjectConfig(projectDir) {
|
|
|
108
57
|
configPath = legacyConfigPath;
|
|
109
58
|
verbose(`Using legacy config location: ${legacyConfigPath}`);
|
|
110
59
|
} else {
|
|
111
|
-
verbose(
|
|
112
|
-
`Project config not found at ${srcConfigPath} or ${legacyConfigPath}`
|
|
113
|
-
);
|
|
60
|
+
verbose(`Project config not found at ${srcConfigPath} or ${legacyConfigPath}`);
|
|
114
61
|
return null;
|
|
115
62
|
}
|
|
116
63
|
}
|
|
@@ -128,13 +75,6 @@ async function loadProjectConfig(projectDir) {
|
|
|
128
75
|
return null;
|
|
129
76
|
}
|
|
130
77
|
}
|
|
131
|
-
async function saveGlobalConfig(config) {
|
|
132
|
-
const configPath = getGlobalConfigPath();
|
|
133
|
-
await ensureDir(getGlobalConfigDir());
|
|
134
|
-
const content = stringifyYaml(config, { lineWidth: 0 });
|
|
135
|
-
await writeFile(configPath, content);
|
|
136
|
-
verbose(`Saved global config to ${configPath}`);
|
|
137
|
-
}
|
|
138
78
|
async function saveProjectConfig(projectDir, config) {
|
|
139
79
|
const configPath = getProjectConfigPath(projectDir);
|
|
140
80
|
await ensureDir(path.join(projectDir, CLAUDE_SRC_DIR));
|
|
@@ -178,9 +118,7 @@ async function resolveAgentsSource(flagValue, projectDir) {
|
|
|
178
118
|
}
|
|
179
119
|
const projectConfig = projectDir ? await loadProjectConfig(projectDir) : null;
|
|
180
120
|
if (projectConfig?.agents_source) {
|
|
181
|
-
verbose(
|
|
182
|
-
`Agents source from project config: ${projectConfig.agents_source}`
|
|
183
|
-
);
|
|
121
|
+
verbose(`Agents source from project config: ${projectConfig.agents_source}`);
|
|
184
122
|
return {
|
|
185
123
|
agentsSource: projectConfig.agents_source,
|
|
186
124
|
agentsSourceOrigin: "project"
|
|
@@ -195,8 +133,6 @@ function formatAgentsSourceOrigin(origin) {
|
|
|
195
133
|
return "--agent-source flag";
|
|
196
134
|
case "project":
|
|
197
135
|
return "project config (.claude-src/config.yaml)";
|
|
198
|
-
case "global":
|
|
199
|
-
return "global config (~/.claude-collective/config.yaml)";
|
|
200
136
|
case "default":
|
|
201
137
|
return "default (local CLI)";
|
|
202
138
|
}
|
|
@@ -213,15 +149,12 @@ function formatSourceOrigin(origin) {
|
|
|
213
149
|
return `${SOURCE_ENV_VAR} environment variable`;
|
|
214
150
|
case "project":
|
|
215
151
|
return "project config (.claude-src/config.yaml)";
|
|
216
|
-
case "global":
|
|
217
|
-
return "global config (~/.claude-collective/config.yaml)";
|
|
218
152
|
case "default":
|
|
219
153
|
return "default";
|
|
220
154
|
}
|
|
221
155
|
}
|
|
222
156
|
async function resolveAllSources(projectDir) {
|
|
223
157
|
const projectConfig = projectDir ? await loadProjectConfig(projectDir) : null;
|
|
224
|
-
const globalConfig = await loadGlobalConfig();
|
|
225
158
|
const resolvedConfig = await resolveSource(void 0, projectDir);
|
|
226
159
|
const primary = {
|
|
227
160
|
name: "marketplace",
|
|
@@ -238,14 +171,6 @@ async function resolveAllSources(projectDir) {
|
|
|
238
171
|
}
|
|
239
172
|
}
|
|
240
173
|
}
|
|
241
|
-
if (globalConfig?.sources) {
|
|
242
|
-
for (const source of globalConfig.sources) {
|
|
243
|
-
if (!seenNames.has(source.name)) {
|
|
244
|
-
seenNames.add(source.name);
|
|
245
|
-
extras.push(source);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
174
|
return { primary, extras };
|
|
250
175
|
}
|
|
251
176
|
function isLocalSource(source) {
|
|
@@ -261,14 +186,10 @@ function isLocalSource(source) {
|
|
|
261
186
|
"https://",
|
|
262
187
|
"http://"
|
|
263
188
|
];
|
|
264
|
-
const hasRemoteProtocol = remoteProtocols.some(
|
|
265
|
-
(prefix) => source.startsWith(prefix)
|
|
266
|
-
);
|
|
189
|
+
const hasRemoteProtocol = remoteProtocols.some((prefix) => source.startsWith(prefix));
|
|
267
190
|
if (!hasRemoteProtocol) {
|
|
268
191
|
if (source.includes("..") || source.includes("~")) {
|
|
269
|
-
throw new Error(
|
|
270
|
-
`Invalid source path: ${source}. Path traversal patterns are not allowed.`
|
|
271
|
-
);
|
|
192
|
+
throw new Error(`Invalid source path: ${source}. Path traversal patterns are not allowed.`);
|
|
272
193
|
}
|
|
273
194
|
}
|
|
274
195
|
return !hasRemoteProtocol;
|
|
@@ -277,11 +198,8 @@ function isLocalSource(source) {
|
|
|
277
198
|
export {
|
|
278
199
|
DEFAULT_SOURCE,
|
|
279
200
|
SOURCE_ENV_VAR,
|
|
280
|
-
getGlobalConfigPath,
|
|
281
201
|
getProjectConfigPath,
|
|
282
|
-
loadGlobalConfig,
|
|
283
202
|
loadProjectConfig,
|
|
284
|
-
saveGlobalConfig,
|
|
285
203
|
saveProjectConfig,
|
|
286
204
|
resolveSource,
|
|
287
205
|
resolveAgentsSource,
|
|
@@ -291,4 +209,4 @@ export {
|
|
|
291
209
|
resolveAllSources,
|
|
292
210
|
isLocalSource
|
|
293
211
|
};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
212
|
+
//# sourceMappingURL=chunk-374JNMR6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/lib/config.ts"],"sourcesContent":["import path from \"path\";\nimport { parse as parseYaml, stringify as stringifyYaml } from \"yaml\";\nimport { readFile, writeFile, fileExists, ensureDir } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport { CLAUDE_DIR, CLAUDE_SRC_DIR } from \"../consts\";\n\nexport const DEFAULT_SOURCE = \"github:claude-collective/skills\";\nexport const SOURCE_ENV_VAR = \"CC_SOURCE\";\nexport const PROJECT_CONFIG_FILE = \"config.yaml\";\n\n/**\n * Extra source entry for third-party skill repositories.\n * Used in project configs.\n */\nexport interface SourceEntry {\n /** Short name for the source (e.g., \"company\", \"team\") */\n name: string;\n /** GitHub URL or path (e.g., \"github:owner/repo\") */\n url: string;\n /** Optional description */\n description?: string;\n /** Optional ref to pin to (branch, tag, or commit) */\n ref?: string;\n}\n\nexport interface ProjectSourceConfig {\n source?: string;\n author?: string;\n marketplace?: string;\n agents_source?: string;\n /** Extra sources for third-party skills */\n sources?: SourceEntry[];\n}\n\nexport interface ResolvedConfig {\n source: string;\n sourceOrigin: \"flag\" | \"env\" | \"project\" | \"default\";\n marketplace?: string;\n}\n\nfunction isValidSourceEntry(entry: unknown): entry is SourceEntry {\n if (typeof entry !== \"object\" || entry === null) return false;\n const e = entry as Record<string, unknown>;\n if (typeof e.name !== \"string\" || typeof e.url !== \"string\") return false;\n if (e.description !== undefined && typeof e.description !== \"string\") return false;\n if (e.ref !== undefined && typeof e.ref !== \"string\") return false;\n return true;\n}\n\nfunction isValidSourcesArray(arr: unknown): arr is SourceEntry[] {\n if (!Array.isArray(arr)) return false;\n return arr.every(isValidSourceEntry);\n}\n\nfunction isValidProjectConfig(obj: unknown): obj is ProjectSourceConfig {\n if (typeof obj !== \"object\" || obj === null) return false;\n const config = obj as Record<string, unknown>;\n if (config.source !== undefined && typeof config.source !== \"string\") return false;\n if (config.author !== undefined && typeof config.author !== \"string\") return false;\n if (config.marketplace !== undefined && typeof config.marketplace !== \"string\") return false;\n if (config.agents_source !== undefined && typeof config.agents_source !== \"string\") return false;\n if (config.sources !== undefined && !isValidSourcesArray(config.sources)) return false;\n return true;\n}\n\nexport function getProjectConfigPath(projectDir: string): string {\n return path.join(projectDir, CLAUDE_SRC_DIR, PROJECT_CONFIG_FILE);\n}\n\nexport async function loadProjectConfig(projectDir: string): Promise<ProjectSourceConfig | null> {\n // Check .claude-src/config.yaml first (new location)\n const srcConfigPath = getProjectConfigPath(projectDir);\n // Fall back to .claude/config.yaml (legacy location)\n const legacyConfigPath = path.join(projectDir, CLAUDE_DIR, \"config.yaml\");\n\n let configPath = srcConfigPath;\n if (!(await fileExists(srcConfigPath))) {\n if (await fileExists(legacyConfigPath)) {\n configPath = legacyConfigPath;\n verbose(`Using legacy config location: ${legacyConfigPath}`);\n } else {\n verbose(`Project config not found at ${srcConfigPath} or ${legacyConfigPath}`);\n return null;\n }\n }\n\n try {\n const content = await readFile(configPath);\n const parsed = parseYaml(content);\n if (!isValidProjectConfig(parsed)) {\n verbose(`Invalid project config structure at ${configPath}`);\n return null;\n }\n verbose(`Loaded project config from ${configPath}`);\n return parsed;\n } catch (error) {\n verbose(`Failed to parse project config: ${error}`);\n return null;\n }\n}\n\nexport async function saveProjectConfig(\n projectDir: string,\n config: ProjectSourceConfig,\n): Promise<void> {\n const configPath = getProjectConfigPath(projectDir);\n await ensureDir(path.join(projectDir, CLAUDE_SRC_DIR));\n const content = stringifyYaml(config, { lineWidth: 0 });\n await writeFile(configPath, content);\n verbose(`Saved project config to ${configPath}`);\n}\n\n/** Resolve source with precedence: flag > env > project > default */\nexport async function resolveSource(\n flagValue?: string,\n projectDir?: string,\n): Promise<ResolvedConfig> {\n // Load project config for marketplace (marketplace is resolved separately from source)\n const projectConfig = projectDir ? await loadProjectConfig(projectDir) : null;\n\n // Resolve marketplace: project config only (no flag/env support for marketplace)\n const marketplace = projectConfig?.marketplace;\n\n if (flagValue !== undefined) {\n if (flagValue === \"\" || flagValue.trim() === \"\") {\n throw new Error(\"--source flag cannot be empty\");\n }\n verbose(`Source from --source flag: ${flagValue}`);\n return { source: flagValue, sourceOrigin: \"flag\", marketplace };\n }\n\n const envValue = process.env[SOURCE_ENV_VAR];\n if (envValue) {\n verbose(`Source from ${SOURCE_ENV_VAR} env var: ${envValue}`);\n return { source: envValue, sourceOrigin: \"env\", marketplace };\n }\n\n if (projectConfig?.source) {\n verbose(`Source from project config: ${projectConfig.source}`);\n return {\n source: projectConfig.source,\n sourceOrigin: \"project\",\n marketplace,\n };\n }\n\n verbose(`Using default source: ${DEFAULT_SOURCE}`);\n return { source: DEFAULT_SOURCE, sourceOrigin: \"default\", marketplace };\n}\n\nexport type AgentsSourceOrigin = \"flag\" | \"project\" | \"default\";\n\nexport interface ResolvedAgentsSource {\n agentsSource?: string;\n agentsSourceOrigin: AgentsSourceOrigin;\n}\n\n/** Resolve agents_source with precedence: flag > project > default (undefined) */\nexport async function resolveAgentsSource(\n flagValue?: string,\n projectDir?: string,\n): Promise<ResolvedAgentsSource> {\n if (flagValue !== undefined) {\n if (flagValue === \"\" || flagValue.trim() === \"\") {\n throw new Error(\"--agent-source flag cannot be empty\");\n }\n verbose(`Agents source from --agent-source flag: ${flagValue}`);\n return { agentsSource: flagValue, agentsSourceOrigin: \"flag\" };\n }\n\n const projectConfig = projectDir ? await loadProjectConfig(projectDir) : null;\n if (projectConfig?.agents_source) {\n verbose(`Agents source from project config: ${projectConfig.agents_source}`);\n return {\n agentsSource: projectConfig.agents_source,\n agentsSourceOrigin: \"project\",\n };\n }\n\n verbose(\"Using default agents source (local CLI)\");\n return { agentsSource: undefined, agentsSourceOrigin: \"default\" };\n}\n\nexport function formatAgentsSourceOrigin(origin: AgentsSourceOrigin): string {\n switch (origin) {\n case \"flag\":\n return \"--agent-source flag\";\n case \"project\":\n return \"project config (.claude-src/config.yaml)\";\n case \"default\":\n return \"default (local CLI)\";\n }\n}\n\n/** Resolve author from project config */\nexport async function resolveAuthor(projectDir?: string): Promise<string | undefined> {\n const projectConfig = projectDir ? await loadProjectConfig(projectDir) : null;\n return projectConfig?.author;\n}\n\nexport function formatSourceOrigin(origin: ResolvedConfig[\"sourceOrigin\"]): string {\n switch (origin) {\n case \"flag\":\n return \"--source flag\";\n case \"env\":\n return `${SOURCE_ENV_VAR} environment variable`;\n case \"project\":\n return \"project config (.claude-src/config.yaml)\";\n case \"default\":\n return \"default\";\n }\n}\n\n/**\n * Resolve all configured sources for skill search.\n * Returns primary source plus any extra sources from project config.\n */\nexport async function resolveAllSources(\n projectDir?: string,\n): Promise<{ primary: SourceEntry; extras: SourceEntry[] }> {\n const projectConfig = projectDir ? await loadProjectConfig(projectDir) : null;\n\n // Get primary source\n const resolvedConfig = await resolveSource(undefined, projectDir);\n const primary: SourceEntry = {\n name: \"marketplace\",\n url: resolvedConfig.source,\n description: \"Primary skills marketplace\",\n };\n\n // Collect extra sources from project config\n const extras: SourceEntry[] = [];\n const seenNames = new Set<string>();\n\n if (projectConfig?.sources) {\n for (const source of projectConfig.sources) {\n if (!seenNames.has(source.name)) {\n seenNames.add(source.name);\n extras.push(source);\n }\n }\n }\n\n return { primary, extras };\n}\n\nexport function isLocalSource(source: string): boolean {\n if (source.startsWith(\"/\") || source.startsWith(\".\")) {\n return true;\n }\n\n const remoteProtocols = [\n \"github:\",\n \"gh:\",\n \"gitlab:\",\n \"bitbucket:\",\n \"sourcehut:\",\n \"https://\",\n \"http://\",\n ];\n\n const hasRemoteProtocol = remoteProtocols.some((prefix) => source.startsWith(prefix));\n\n if (!hasRemoteProtocol) {\n if (source.includes(\"..\") || source.includes(\"~\")) {\n throw new Error(`Invalid source path: ${source}. Path traversal patterns are not allowed.`);\n }\n }\n\n return !hasRemoteProtocol;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,WAAW,aAAa,qBAAqB;AAKxD,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAgCnC,SAAS,mBAAmB,OAAsC;AAChE,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,IAAI;AACV,MAAI,OAAO,EAAE,SAAS,YAAY,OAAO,EAAE,QAAQ,SAAU,QAAO;AACpE,MAAI,EAAE,gBAAgB,UAAa,OAAO,EAAE,gBAAgB,SAAU,QAAO;AAC7E,MAAI,EAAE,QAAQ,UAAa,OAAO,EAAE,QAAQ,SAAU,QAAO;AAC7D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