@agents-inc/cli 0.50.0 → 0.61.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 +167 -5
- package/dist/{chunk-KQOU4POU.js → chunk-46DQG2N7.js} +72 -51
- package/dist/chunk-46DQG2N7.js.map +1 -0
- package/dist/{chunk-2BWCR762.js → chunk-52XO4ULK.js} +6 -8
- package/dist/chunk-52XO4ULK.js.map +1 -0
- package/dist/{chunk-DCE423KO.js → chunk-6DAZG54T.js} +5 -5
- package/dist/{chunk-AWP5A6IM.js → chunk-6OWHQ7HM.js} +14 -12
- package/dist/chunk-6OWHQ7HM.js.map +1 -0
- package/dist/{chunk-D72AFYQR.js → chunk-7FMEMXJ4.js} +71 -71
- package/dist/chunk-7FMEMXJ4.js.map +1 -0
- package/dist/{chunk-RA2IPRO2.js → chunk-AJJJE7F7.js} +2 -2
- package/dist/{chunk-4R52TQ3K.js → chunk-AX3SZZWA.js} +2 -2
- package/dist/{chunk-U2W5SENM.js → chunk-BFD5NZQ4.js} +5 -4
- package/dist/chunk-BFD5NZQ4.js.map +1 -0
- package/dist/{chunk-HYEUETIC.js → chunk-BKJHAJQW.js} +2 -2
- package/dist/{chunk-HYEUETIC.js.map → chunk-BKJHAJQW.js.map} +1 -1
- package/dist/{chunk-GBOW6FUW.js → chunk-BNQ5O6LE.js} +2 -2
- package/dist/{chunk-KAO3LKB5.js → chunk-C577AJE7.js} +3 -3
- package/dist/{chunk-C3Q43WLC.js → chunk-CIG7IKX3.js} +4 -4
- package/dist/chunk-EC3UJRKZ.js +1534 -0
- package/dist/chunk-EC3UJRKZ.js.map +1 -0
- package/dist/{chunk-HMSHB5EQ.js → chunk-FWMWWE3X.js} +3543 -3037
- package/dist/chunk-FWMWWE3X.js.map +1 -0
- package/dist/{chunk-YDYRAXSY.js → chunk-GH2RQ4MI.js} +6 -6
- package/dist/{chunk-5FPIKTSA.js → chunk-H5DASUX5.js} +7 -7
- package/dist/{chunk-JFF7P4LC.js → chunk-H7WJK7NJ.js} +22 -6
- package/dist/chunk-H7WJK7NJ.js.map +1 -0
- package/dist/chunk-HGTC76BX.js +16 -0
- package/dist/chunk-HGTC76BX.js.map +1 -0
- package/dist/{chunk-WFFV254H.js → chunk-IEEVXLJB.js} +110 -82
- package/dist/chunk-IEEVXLJB.js.map +1 -0
- package/dist/{chunk-5FCHJLM7.js → chunk-IGM6HA3S.js} +252 -38
- package/dist/chunk-IGM6HA3S.js.map +1 -0
- package/dist/{chunk-QB5HHTAA.js → chunk-KD2YS76O.js} +28 -12
- package/dist/chunk-KD2YS76O.js.map +1 -0
- package/dist/{chunk-5L724R4C.js → chunk-KDO6WU76.js} +8 -13
- package/dist/chunk-KDO6WU76.js.map +1 -0
- package/dist/{chunk-XDSVV5GZ.js → chunk-KIWFEBKH.js} +41 -11
- package/dist/chunk-KIWFEBKH.js.map +1 -0
- package/dist/{chunk-WBHPCBVN.js → chunk-LWXRUR6B.js} +66 -94
- package/dist/chunk-LWXRUR6B.js.map +1 -0
- package/dist/{chunk-SPFHPHYL.js → chunk-M6YWRMXH.js} +24 -14
- package/dist/chunk-M6YWRMXH.js.map +1 -0
- package/dist/{chunk-CMNKHDOX.js → chunk-MGNYPVOJ.js} +2 -2
- package/dist/{chunk-U7X4V4HE.js → chunk-MMFQNJPE.js} +2 -2
- package/dist/{chunk-WLZHCM7O.js → chunk-MR6OBL3B.js} +3 -11
- package/dist/{chunk-WLZHCM7O.js.map → chunk-MR6OBL3B.js.map} +1 -1
- package/dist/{chunk-RFKDGJAJ.js → chunk-O6BA7Q2B.js} +6 -6
- package/dist/chunk-O6BA7Q2B.js.map +1 -0
- package/dist/chunk-OCEFD7V6.js +201 -0
- package/dist/chunk-OCEFD7V6.js.map +1 -0
- package/dist/{chunk-YZTWZVGX.js → chunk-PUT7X3GA.js} +1 -1
- package/dist/chunk-PUT7X3GA.js.map +1 -0
- package/dist/{chunk-QYLCINGC.js → chunk-SDKCQXWE.js} +2 -2
- package/dist/{chunk-RDWGYKDY.js → chunk-SDLDPFNV.js} +6 -6
- package/dist/{chunk-7LV4V6A4.js → chunk-SRBN6RRD.js} +14 -10
- package/dist/chunk-SRBN6RRD.js.map +1 -0
- package/dist/{chunk-PGY5XROM.js → chunk-VR3CDXDT.js} +2 -6
- package/dist/chunk-VR3CDXDT.js.map +1 -0
- package/dist/{chunk-I6IOGZSZ.js → chunk-WHISPMAQ.js} +11 -15
- package/dist/chunk-WHISPMAQ.js.map +1 -0
- package/dist/{chunk-3VOL4WEG.js → chunk-WYVDNGJB.js} +3 -3
- package/dist/{chunk-WJHFV6RI.js → chunk-X5EG4EFP.js} +2 -2
- package/dist/{chunk-JWYRXE6C.js → chunk-XUDTFI4M.js} +2 -2
- package/dist/{chunk-4QWDB2MD.js → chunk-YHOHLNHM.js} +127 -105
- package/dist/chunk-YHOHLNHM.js.map +1 -0
- package/dist/{chunk-M3GQ2R3E.js → chunk-Z3TM4N37.js} +19 -7
- package/dist/chunk-Z3TM4N37.js.map +1 -0
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +9 -7
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/build/stack.js +13 -10
- package/dist/commands/build/stack.js.map +1 -1
- package/dist/commands/compile.js +110 -129
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/config/index.js +7 -5
- package/dist/commands/config/index.js.map +1 -1
- package/dist/commands/config/path.js +8 -6
- package/dist/commands/config/path.js.map +1 -1
- package/dist/commands/config/show.js +7 -5
- package/dist/commands/diff.js +9 -7
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +20 -16
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +175 -79
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +20 -41
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/import/skill.js +10 -18
- package/dist/commands/import/skill.js.map +1 -1
- package/dist/commands/info.js +21 -20
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.js +32 -31
- package/dist/commands/list.js +8 -6
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/agent.js +23 -11
- package/dist/commands/new/agent.js.map +1 -1
- package/dist/commands/new/marketplace.js +63 -46
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/new/skill.js +11 -9
- package/dist/commands/outdated.js +9 -7
- package/dist/commands/outdated.js.map +1 -1
- package/dist/commands/search.js +45 -35
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/uninstall.js +93 -123
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +11 -9
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +23 -27
- package/dist/commands/validate.js.map +1 -1
- package/dist/components/common/confirm.test.js +4 -4
- package/dist/components/skill-search/skill-search.js +3 -3
- package/dist/components/wizard/category-grid.js +3 -3
- package/dist/components/wizard/category-grid.test.js +4 -4
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/checkbox-grid.js +5 -5
- package/dist/components/wizard/checkbox-grid.test.js +6 -6
- package/dist/components/wizard/domain-selection.js +12 -11
- 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 +3 -3
- package/dist/components/wizard/search-modal.test.js.map +1 -1
- package/dist/components/wizard/section-progress.js +2 -2
- package/dist/components/wizard/section-progress.test.js +4 -4
- package/dist/components/wizard/section-progress.test.js.map +1 -1
- package/dist/components/wizard/selection-card.js +2 -2
- package/dist/components/wizard/source-grid.js +4 -4
- package/dist/components/wizard/source-grid.test.js +5 -5
- package/dist/components/wizard/source-grid.test.js.map +1 -1
- package/dist/components/wizard/stack-selection.js +9 -8
- package/dist/components/wizard/step-agents.js +11 -10
- package/dist/components/wizard/step-agents.test.js +13 -12
- package/dist/components/wizard/step-agents.test.js.map +1 -1
- package/dist/components/wizard/step-build.js +11 -9
- package/dist/components/wizard/step-build.test.js +18 -22
- 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 +83 -23
- package/dist/components/wizard/step-confirm.test.js.map +1 -1
- package/dist/components/wizard/step-refine.js +2 -2
- package/dist/components/wizard/step-refine.test.js +3 -3
- package/dist/components/wizard/step-settings.js +9 -7
- package/dist/components/wizard/step-settings.test.js +13 -11
- package/dist/components/wizard/step-settings.test.js.map +1 -1
- package/dist/components/wizard/step-sources.js +13 -11
- package/dist/components/wizard/step-sources.test.js +19 -17
- package/dist/components/wizard/step-sources.test.js.map +1 -1
- package/dist/components/wizard/step-stack.js +15 -14
- package/dist/components/wizard/step-stack.test.js +17 -16
- package/dist/components/wizard/step-stack.test.js.map +1 -1
- package/dist/components/wizard/view-title.js +2 -2
- package/dist/components/wizard/wizard-layout.js +10 -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 +29 -27
- package/dist/config-exports.js +20 -0
- package/dist/config-exports.js.map +1 -0
- package/dist/hooks/init.js +34 -33
- package/dist/hooks/init.js.map +1 -1
- package/dist/loader-2O32KKAQ.js +19 -0
- package/dist/source-loader-KMEBBZCQ.js +16 -0
- package/dist/source-loader-KMEBBZCQ.js.map +1 -0
- package/dist/source-manager-5XBSPJNR.js +18 -0
- package/dist/source-manager-5XBSPJNR.js.map +1 -0
- package/dist/src/agents/meta/agent-summoner/workflow.md +3 -3
- package/dist/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
- package/dist/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
- package/dist/src/agents/meta/skill-summoner/intro.md +1 -1
- package/dist/src/agents/meta/skill-summoner/output-format.md +3 -3
- package/dist/src/agents/meta/skill-summoner/workflow.md +8 -8
- package/dist/stores/wizard-store.js +6 -5
- package/dist/stores/wizard-store.test.js +299 -59
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +5 -1
- package/src/agents/meta/agent-summoner/workflow.md +3 -3
- package/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
- package/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
- package/src/agents/meta/skill-summoner/intro.md +1 -1
- package/src/agents/meta/skill-summoner/output-format.md +3 -3
- package/src/agents/meta/skill-summoner/workflow.md +8 -8
- package/src/schemas/metadata.schema.json +6 -0
- package/src/schemas/stacks.schema.json +1 -1
- package/config/skill-categories.yaml +0 -344
- package/config/skill-rules.yaml +0 -740
- package/config/stacks.yaml +0 -1864
- package/dist/chunk-26MXZUHU.js +0 -183
- package/dist/chunk-26MXZUHU.js.map +0 -1
- package/dist/chunk-2BWCR762.js.map +0 -1
- package/dist/chunk-4QWDB2MD.js.map +0 -1
- package/dist/chunk-5FCHJLM7.js.map +0 -1
- package/dist/chunk-5L724R4C.js.map +0 -1
- package/dist/chunk-7LV4V6A4.js.map +0 -1
- package/dist/chunk-AWP5A6IM.js.map +0 -1
- package/dist/chunk-D72AFYQR.js.map +0 -1
- package/dist/chunk-HMSHB5EQ.js.map +0 -1
- package/dist/chunk-I6IOGZSZ.js.map +0 -1
- package/dist/chunk-JFF7P4LC.js.map +0 -1
- package/dist/chunk-KQOU4POU.js.map +0 -1
- package/dist/chunk-M3GQ2R3E.js.map +0 -1
- package/dist/chunk-PGY5XROM.js.map +0 -1
- package/dist/chunk-QB5HHTAA.js.map +0 -1
- package/dist/chunk-RFKDGJAJ.js.map +0 -1
- package/dist/chunk-SPFHPHYL.js.map +0 -1
- package/dist/chunk-U2W5SENM.js.map +0 -1
- package/dist/chunk-UAD3SC27.js +0 -107
- package/dist/chunk-UAD3SC27.js.map +0 -1
- package/dist/chunk-WBHPCBVN.js.map +0 -1
- package/dist/chunk-WFFV254H.js.map +0 -1
- package/dist/chunk-XDSVV5GZ.js.map +0 -1
- package/dist/chunk-YZTWZVGX.js.map +0 -1
- package/dist/commands/config/get.js +0 -61
- package/dist/commands/config/get.js.map +0 -1
- package/dist/commands/config/set-project.js +0 -61
- package/dist/commands/config/set-project.js.map +0 -1
- package/dist/commands/config/unset-project.js +0 -57
- package/dist/commands/config/unset-project.js.map +0 -1
- package/dist/config/skill-categories.yaml +0 -344
- package/dist/config/skill-rules.yaml +0 -740
- package/dist/config/stacks.yaml +0 -1864
- package/dist/source-manager-BVB2SG73.js +0 -16
- /package/dist/{chunk-DCE423KO.js.map → chunk-6DAZG54T.js.map} +0 -0
- /package/dist/{chunk-RA2IPRO2.js.map → chunk-AJJJE7F7.js.map} +0 -0
- /package/dist/{chunk-4R52TQ3K.js.map → chunk-AX3SZZWA.js.map} +0 -0
- /package/dist/{chunk-GBOW6FUW.js.map → chunk-BNQ5O6LE.js.map} +0 -0
- /package/dist/{chunk-KAO3LKB5.js.map → chunk-C577AJE7.js.map} +0 -0
- /package/dist/{chunk-C3Q43WLC.js.map → chunk-CIG7IKX3.js.map} +0 -0
- /package/dist/{chunk-YDYRAXSY.js.map → chunk-GH2RQ4MI.js.map} +0 -0
- /package/dist/{chunk-5FPIKTSA.js.map → chunk-H5DASUX5.js.map} +0 -0
- /package/dist/{chunk-CMNKHDOX.js.map → chunk-MGNYPVOJ.js.map} +0 -0
- /package/dist/{chunk-U7X4V4HE.js.map → chunk-MMFQNJPE.js.map} +0 -0
- /package/dist/{chunk-QYLCINGC.js.map → chunk-SDKCQXWE.js.map} +0 -0
- /package/dist/{chunk-RDWGYKDY.js.map → chunk-SDLDPFNV.js.map} +0 -0
- /package/dist/{chunk-3VOL4WEG.js.map → chunk-WYVDNGJB.js.map} +0 -0
- /package/dist/{chunk-WJHFV6RI.js.map → chunk-X5EG4EFP.js.map} +0 -0
- /package/dist/{chunk-JWYRXE6C.js.map → chunk-XUDTFI4M.js.map} +0 -0
- /package/dist/{source-manager-BVB2SG73.js.map → loader-2O32KKAQ.js.map} +0 -0
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
Wizard
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-46DQG2N7.js";
|
|
5
5
|
import {
|
|
6
|
-
claudePluginInstall,
|
|
7
|
-
claudePluginMarketplaceAdd,
|
|
8
|
-
claudePluginMarketplaceExists
|
|
9
|
-
} from "./chunk-26MXZUHU.js";
|
|
10
|
-
import {
|
|
11
|
-
DRY_RUN_MESSAGES,
|
|
12
6
|
STATUS_MESSAGES,
|
|
13
7
|
SUCCESS_MESSAGES
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
BaseCommand,
|
|
17
|
-
EXIT_CODES
|
|
18
|
-
} from "./chunk-PGY5XROM.js";
|
|
8
|
+
} from "./chunk-MR6OBL3B.js";
|
|
19
9
|
import {
|
|
10
|
+
claudePluginInstall,
|
|
11
|
+
claudePluginMarketplaceAdd,
|
|
12
|
+
claudePluginMarketplaceExists,
|
|
13
|
+
deriveInstallMode,
|
|
14
|
+
detectGlobalInstallation,
|
|
20
15
|
detectProjectInstallation,
|
|
16
|
+
ensureBlankGlobalConfig,
|
|
21
17
|
getInstallationInfo,
|
|
22
18
|
getMarketplaceLabel,
|
|
23
19
|
hasIndividualPlugins,
|
|
@@ -25,28 +21,32 @@ import {
|
|
|
25
21
|
installPluginConfig,
|
|
26
22
|
loadProjectConfig,
|
|
27
23
|
loadSkillsMatrixFromSource
|
|
28
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-FWMWWE3X.js";
|
|
25
|
+
import {
|
|
26
|
+
BaseCommand,
|
|
27
|
+
EXIT_CODES
|
|
28
|
+
} from "./chunk-VR3CDXDT.js";
|
|
29
29
|
import {
|
|
30
30
|
disableBuffering,
|
|
31
31
|
drainBuffer,
|
|
32
32
|
enableBuffering,
|
|
33
33
|
fileExists,
|
|
34
34
|
getErrorMessage,
|
|
35
|
-
pushBufferMessage,
|
|
36
35
|
readFileSafe,
|
|
37
36
|
settingsFileSchema,
|
|
38
37
|
warn,
|
|
39
38
|
warnUnknownFields
|
|
40
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LWXRUR6B.js";
|
|
41
40
|
import {
|
|
42
41
|
ASCII_LOGO,
|
|
43
42
|
CLAUDE_DIR,
|
|
43
|
+
CLAUDE_SRC_DIR,
|
|
44
44
|
CLI_BIN_NAME,
|
|
45
45
|
CLI_COLORS,
|
|
46
46
|
DEFAULT_BRANDING,
|
|
47
|
-
|
|
47
|
+
GLOBAL_INSTALL_ROOT,
|
|
48
48
|
MAX_CONFIG_FILE_SIZE
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-6OWHQ7HM.js";
|
|
50
50
|
import {
|
|
51
51
|
init_esm_shims
|
|
52
52
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -150,7 +150,7 @@ var Dashboard = ({
|
|
|
150
150
|
}) => {
|
|
151
151
|
const { exit } = useApp();
|
|
152
152
|
const [focusIndex, setFocusIndex] = useState(0);
|
|
153
|
-
useInput((
|
|
153
|
+
useInput((_input, key) => {
|
|
154
154
|
if (key.escape) {
|
|
155
155
|
onCancel();
|
|
156
156
|
exit();
|
|
@@ -208,11 +208,65 @@ var Dashboard = ({
|
|
|
208
208
|
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: " Use arrow keys to select, Enter to confirm, Esc to exit" })
|
|
209
209
|
] });
|
|
210
210
|
};
|
|
211
|
+
var GLOBAL_CONFIG_OPTIONS = [
|
|
212
|
+
{ label: "Edit global installation", choice: "edit-global" },
|
|
213
|
+
{ label: "Create new project installation", choice: "create-project" }
|
|
214
|
+
];
|
|
215
|
+
var GlobalConfigPrompt = ({
|
|
216
|
+
globalConfigDir,
|
|
217
|
+
onSelect,
|
|
218
|
+
onCancel
|
|
219
|
+
}) => {
|
|
220
|
+
const { exit } = useApp();
|
|
221
|
+
const [focusIndex, setFocusIndex] = useState(0);
|
|
222
|
+
useInput((_input, key) => {
|
|
223
|
+
if (key.escape) {
|
|
224
|
+
onCancel();
|
|
225
|
+
exit();
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (key.return) {
|
|
229
|
+
onSelect(GLOBAL_CONFIG_OPTIONS[focusIndex].choice);
|
|
230
|
+
exit();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (key.leftArrow) {
|
|
234
|
+
setFocusIndex((i) => i > 0 ? i - 1 : GLOBAL_CONFIG_OPTIONS.length - 1);
|
|
235
|
+
}
|
|
236
|
+
if (key.rightArrow) {
|
|
237
|
+
setFocusIndex((i) => i < GLOBAL_CONFIG_OPTIONS.length - 1 ? i + 1 : 0);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
|
|
241
|
+
/* @__PURE__ */ jsxs2(Text2, { children: [
|
|
242
|
+
"A global installation was found at ",
|
|
243
|
+
globalConfigDir
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ jsx2(Text2, { children: "What would you like to do?" }),
|
|
246
|
+
/* @__PURE__ */ jsx2(Text2, { children: " " }),
|
|
247
|
+
/* @__PURE__ */ jsxs2(Box2, { children: [
|
|
248
|
+
/* @__PURE__ */ jsx2(Text2, { children: " " }),
|
|
249
|
+
GLOBAL_CONFIG_OPTIONS.map((option, index) => /* @__PURE__ */ jsx2(Box2, { marginRight: 1, children: /* @__PURE__ */ jsxs2(
|
|
250
|
+
Text2,
|
|
251
|
+
{
|
|
252
|
+
color: index === focusIndex ? CLI_COLORS.FOCUS : void 0,
|
|
253
|
+
bold: index === focusIndex,
|
|
254
|
+
children: [
|
|
255
|
+
"[",
|
|
256
|
+
option.label,
|
|
257
|
+
"]"
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
) }, option.choice))
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: " Use arrow keys to select, Enter to confirm, Esc to exit" })
|
|
263
|
+
] });
|
|
264
|
+
};
|
|
211
265
|
async function getDashboardData(projectDir) {
|
|
212
266
|
const [info, loaded] = await Promise.all([getInstallationInfo(), loadProjectConfig(projectDir)]);
|
|
213
267
|
const skillCount = loaded?.config?.skills?.length ?? 0;
|
|
214
268
|
const agentCount = info?.agentCount ?? 0;
|
|
215
|
-
const mode = info?.mode ?? loaded?.config?.
|
|
269
|
+
const mode = info?.mode ?? (loaded?.config?.skills ? deriveInstallMode(loaded.config.skills) : "local");
|
|
216
270
|
const source = loaded?.config?.source;
|
|
217
271
|
return { skillCount, agentCount, mode, source };
|
|
218
272
|
}
|
|
@@ -268,18 +322,10 @@ var Init = class _Init extends BaseCommand {
|
|
|
268
322
|
description: "Start the setup wizard",
|
|
269
323
|
command: "<%= config.bin %> <%= command.id %>"
|
|
270
324
|
},
|
|
271
|
-
{
|
|
272
|
-
description: "Install globally to home directory",
|
|
273
|
-
command: "<%= config.bin %> <%= command.id %> --global"
|
|
274
|
-
},
|
|
275
325
|
{
|
|
276
326
|
description: "Initialize from a custom marketplace",
|
|
277
327
|
command: "<%= config.bin %> <%= command.id %> --source github:org/marketplace"
|
|
278
328
|
},
|
|
279
|
-
{
|
|
280
|
-
description: "Preview without creating files",
|
|
281
|
-
command: "<%= config.bin %> <%= command.id %> --dry-run"
|
|
282
|
-
},
|
|
283
329
|
{
|
|
284
330
|
description: "Force refresh skills from remote",
|
|
285
331
|
command: "<%= config.bin %> <%= command.id %> --refresh"
|
|
@@ -287,11 +333,6 @@ var Init = class _Init extends BaseCommand {
|
|
|
287
333
|
];
|
|
288
334
|
static flags = {
|
|
289
335
|
...BaseCommand.baseFlags,
|
|
290
|
-
global: Flags.boolean({
|
|
291
|
-
char: "g",
|
|
292
|
-
description: "Install globally to home directory (~/.claude-src/)",
|
|
293
|
-
default: false
|
|
294
|
-
}),
|
|
295
336
|
refresh: Flags.boolean({
|
|
296
337
|
description: "Force refresh from remote source",
|
|
297
338
|
default: false
|
|
@@ -299,7 +340,7 @@ var Init = class _Init extends BaseCommand {
|
|
|
299
340
|
};
|
|
300
341
|
async run() {
|
|
301
342
|
const { flags } = await this.parse(_Init);
|
|
302
|
-
const projectDir =
|
|
343
|
+
const projectDir = process.cwd();
|
|
303
344
|
const individualPluginsExist = await hasIndividualPlugins(projectDir);
|
|
304
345
|
const existingInstallation = await detectProjectInstallation(projectDir);
|
|
305
346
|
if (individualPluginsExist || existingInstallation) {
|
|
@@ -309,13 +350,45 @@ var Init = class _Init extends BaseCommand {
|
|
|
309
350
|
}
|
|
310
351
|
return;
|
|
311
352
|
}
|
|
312
|
-
|
|
313
|
-
|
|
353
|
+
const globalInstallation = await detectGlobalInstallation();
|
|
354
|
+
if (globalInstallation) {
|
|
355
|
+
const globalConfigDir = path2.join(os.homedir(), CLAUDE_SRC_DIR);
|
|
356
|
+
if (process.stdin.isTTY) {
|
|
357
|
+
let globalChoice = null;
|
|
358
|
+
const { waitUntilExit: waitForPrompt } = render(
|
|
359
|
+
/* @__PURE__ */ jsx2(
|
|
360
|
+
GlobalConfigPrompt,
|
|
361
|
+
{
|
|
362
|
+
globalConfigDir,
|
|
363
|
+
onSelect: (choice) => {
|
|
364
|
+
globalChoice = choice;
|
|
365
|
+
},
|
|
366
|
+
onCancel: () => {
|
|
367
|
+
globalChoice = null;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
);
|
|
372
|
+
await waitForPrompt();
|
|
373
|
+
if (globalChoice === "edit-global") {
|
|
374
|
+
const selectedCommand = await showDashboard(os.homedir(), (msg) => this.log(msg));
|
|
375
|
+
if (selectedCommand) {
|
|
376
|
+
await this.config.runCommand(selectedCommand);
|
|
377
|
+
}
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (globalChoice === null) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (projectDir !== GLOBAL_INSTALL_ROOT) {
|
|
386
|
+
const created = await ensureBlankGlobalConfig();
|
|
387
|
+
if (created) {
|
|
388
|
+
this.log("Created blank global config at ~/" + CLAUDE_SRC_DIR);
|
|
389
|
+
}
|
|
314
390
|
}
|
|
315
391
|
enableBuffering();
|
|
316
|
-
if (flags["dry-run"]) {
|
|
317
|
-
pushBufferMessage("info", DRY_RUN_MESSAGES.PREVIEW_NO_FILES_CREATED);
|
|
318
|
-
}
|
|
319
392
|
let sourceResult;
|
|
320
393
|
let startupMessages = [];
|
|
321
394
|
try {
|
|
@@ -343,7 +416,6 @@ var Init = class _Init extends BaseCommand {
|
|
|
343
416
|
marketplaceLabel,
|
|
344
417
|
logo: ASCII_LOGO,
|
|
345
418
|
projectDir,
|
|
346
|
-
initialInstallMode: sourceResult.marketplace ? "plugin" : "local",
|
|
347
419
|
startupMessages,
|
|
348
420
|
onComplete: (result2) => {
|
|
349
421
|
wizardResult = result2;
|
|
@@ -359,74 +431,22 @@ var Init = class _Init extends BaseCommand {
|
|
|
359
431
|
if (!result || result.cancelled) {
|
|
360
432
|
this.exit(EXIT_CODES.CANCELLED);
|
|
361
433
|
}
|
|
362
|
-
if (result.
|
|
434
|
+
if (result.skills.length === 0) {
|
|
363
435
|
this.error("No skills selected", { exit: EXIT_CODES.ERROR });
|
|
364
436
|
}
|
|
365
437
|
await this.handleInstallation(result, sourceResult, flags);
|
|
366
438
|
}
|
|
367
439
|
async handleInstallation(result, sourceResult, flags) {
|
|
368
|
-
const projectDir =
|
|
369
|
-
const
|
|
370
|
-
const dryRun = flags["dry-run"];
|
|
440
|
+
const projectDir = process.cwd();
|
|
441
|
+
const installMode = deriveInstallMode(result.skills);
|
|
371
442
|
this.log("\n");
|
|
372
|
-
this.log(`Selected ${result.
|
|
443
|
+
this.log(`Selected ${result.skills.length} skills`);
|
|
373
444
|
this.log(
|
|
374
|
-
`Install mode: ${
|
|
445
|
+
`Install mode: ${installMode === "plugin" ? "Plugin (native install)" : "Local (copy to .claude/skills/)"}`
|
|
375
446
|
);
|
|
376
|
-
if (
|
|
377
|
-
if (result.installMode === "plugin" && result.selectedStackId) {
|
|
378
|
-
const useMarketplace = !!sourceResult.marketplace;
|
|
379
|
-
if (useMarketplace) {
|
|
380
|
-
this.log(
|
|
381
|
-
`[dry-run] Would install stack "${result.selectedStackId}" from marketplace "${sourceResult.marketplace}"`
|
|
382
|
-
);
|
|
383
|
-
this.log(
|
|
384
|
-
`[dry-run] claude plugin install ${result.selectedStackId}@${sourceResult.marketplace} --scope ${pluginScope}`
|
|
385
|
-
);
|
|
386
|
-
} else {
|
|
387
|
-
this.log(
|
|
388
|
-
`[dry-run] Would compile and install stack "${result.selectedStackId}" as a native plugin`
|
|
389
|
-
);
|
|
390
|
-
this.log(
|
|
391
|
-
`[dry-run] claude plugin install ./compiled-stack/${result.selectedStackId} --scope ${pluginScope}`
|
|
392
|
-
);
|
|
393
|
-
this.log(
|
|
394
|
-
`[dry-run] Stack includes ${result.selectedSkills.length} skills and agents bundled together`
|
|
395
|
-
);
|
|
396
|
-
}
|
|
397
|
-
} else if (result.installMode === "plugin" && sourceResult.marketplace) {
|
|
398
|
-
this.log(
|
|
399
|
-
`[dry-run] Would install ${result.selectedSkills.length} skills as individual plugins from "${sourceResult.marketplace}"`
|
|
400
|
-
);
|
|
401
|
-
for (const skillId of result.selectedSkills) {
|
|
402
|
-
this.log(
|
|
403
|
-
`[dry-run] claude plugin install ${skillId}@${sourceResult.marketplace} --scope ${pluginScope}`
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
const localAgentsDir = path2.join(projectDir, CLAUDE_DIR, "agents");
|
|
407
|
-
this.log(`[dry-run] Would compile agents to ${localAgentsDir}`);
|
|
408
|
-
this.log(`[dry-run] Would save config to .claude-src/config.yaml`);
|
|
409
|
-
} else {
|
|
410
|
-
if (result.installMode === "plugin") {
|
|
411
|
-
this.log(
|
|
412
|
-
`[dry-run] Plugin Mode requires a marketplace for individual skills \u2014 would fall back to Local Mode`
|
|
413
|
-
);
|
|
414
|
-
}
|
|
415
|
-
const localSkillsDir = path2.join(projectDir, LOCAL_SKILLS_PATH);
|
|
416
|
-
const localAgentsDir = path2.join(projectDir, CLAUDE_DIR, "agents");
|
|
417
|
-
this.log(
|
|
418
|
-
`[dry-run] Would copy ${result.selectedSkills.length} skills to ${localSkillsDir}`
|
|
419
|
-
);
|
|
420
|
-
this.log(`[dry-run] Would compile agents to ${localAgentsDir}`);
|
|
421
|
-
this.log(`[dry-run] Would save config to .claude-src/config.yaml`);
|
|
422
|
-
}
|
|
423
|
-
this.log(`
|
|
424
|
-
${DRY_RUN_MESSAGES.COMPLETE_NO_FILES_CREATED}`);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
if (result.installMode === "plugin") {
|
|
447
|
+
if (installMode === "plugin") {
|
|
428
448
|
if (sourceResult.marketplace) {
|
|
429
|
-
await this.installIndividualPlugins(result, sourceResult, flags, projectDir
|
|
449
|
+
await this.installIndividualPlugins(result, sourceResult, flags, projectDir);
|
|
430
450
|
} else {
|
|
431
451
|
this.warn("Plugin Mode requires a marketplace for individual skill installation.");
|
|
432
452
|
this.log(`Falling back to Local Mode (copying to .claude/skills/)...`);
|
|
@@ -437,7 +457,7 @@ ${DRY_RUN_MESSAGES.COMPLETE_NO_FILES_CREATED}`);
|
|
|
437
457
|
}
|
|
438
458
|
await this.installLocalMode(result, sourceResult, flags, projectDir);
|
|
439
459
|
}
|
|
440
|
-
async installIndividualPlugins(result, sourceResult, flags, projectDir
|
|
460
|
+
async installIndividualPlugins(result, sourceResult, flags, projectDir) {
|
|
441
461
|
if (sourceResult.marketplace) {
|
|
442
462
|
const marketplaceExists = await claudePluginMarketplaceExists(sourceResult.marketplace);
|
|
443
463
|
if (!marketplaceExists) {
|
|
@@ -454,8 +474,9 @@ ${DRY_RUN_MESSAGES.COMPLETE_NO_FILES_CREATED}`);
|
|
|
454
474
|
}
|
|
455
475
|
}
|
|
456
476
|
this.log("Installing skill plugins...");
|
|
457
|
-
for (const
|
|
458
|
-
const pluginRef = `${
|
|
477
|
+
for (const skill of result.skills.filter((s) => s.source !== "local")) {
|
|
478
|
+
const pluginRef = `${skill.id}@${sourceResult.marketplace}`;
|
|
479
|
+
const pluginScope = skill.scope === "global" ? "user" : "project";
|
|
459
480
|
try {
|
|
460
481
|
await claudePluginInstall(pluginRef, pluginScope, projectDir);
|
|
461
482
|
this.log(` Installed ${pluginRef}`);
|
|
@@ -465,7 +486,8 @@ ${DRY_RUN_MESSAGES.COMPLETE_NO_FILES_CREATED}`);
|
|
|
465
486
|
});
|
|
466
487
|
}
|
|
467
488
|
}
|
|
468
|
-
|
|
489
|
+
const pluginSkillCount = result.skills.filter((s) => s.source !== "local").length;
|
|
490
|
+
this.log(`Installed ${pluginSkillCount} skill plugins
|
|
469
491
|
`);
|
|
470
492
|
this.log("Generating configuration...");
|
|
471
493
|
try {
|
|
@@ -495,7 +517,7 @@ ${DRY_RUN_MESSAGES.COMPLETE_NO_FILES_CREATED}`);
|
|
|
495
517
|
this.log(` ${configResult.configPath}`);
|
|
496
518
|
this.log("");
|
|
497
519
|
this.log("To customize agent-skill assignments:");
|
|
498
|
-
this.log(` 1. Edit .claude-src/config.
|
|
520
|
+
this.log(` 1. Edit .claude-src/config.ts`);
|
|
499
521
|
this.log(` 2. Run '${CLI_BIN_NAME} compile' to regenerate agents`);
|
|
500
522
|
this.log("");
|
|
501
523
|
const permissionWarning = await checkPermissions(projectDir);
|
|
@@ -548,7 +570,7 @@ ${DRY_RUN_MESSAGES.COMPLETE_NO_FILES_CREATED}`);
|
|
|
548
570
|
this.log(` ${installResult.configPath}`);
|
|
549
571
|
this.log("");
|
|
550
572
|
this.log("To customize agent-skill assignments:");
|
|
551
|
-
this.log(` 1. Edit .claude-src/config.
|
|
573
|
+
this.log(` 1. Edit .claude-src/config.ts`);
|
|
552
574
|
this.log(` 2. Run '${CLI_BIN_NAME} compile' to regenerate agents`);
|
|
553
575
|
this.log("");
|
|
554
576
|
const permissionWarning = await checkPermissions(projectDir);
|
|
@@ -568,4 +590,4 @@ export {
|
|
|
568
590
|
showDashboard,
|
|
569
591
|
Init
|
|
570
592
|
};
|
|
571
|
-
//# sourceMappingURL=chunk-
|
|
593
|
+
//# sourceMappingURL=chunk-YHOHLNHM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/init.tsx","../src/cli/lib/permission-checker.tsx"],"sourcesContent":["import React, { useState } from \"react\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render, Box, Text, useApp, useInput } from \"ink\";\nimport os from \"os\";\nimport path from \"path\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n loadSkillsMatrixFromSource,\n getMarketplaceLabel,\n type SourceLoadResult,\n} from \"../lib/loading/index.js\";\nimport {\n installLocal,\n installPluginConfig,\n detectGlobalInstallation,\n detectProjectInstallation,\n deriveInstallMode,\n} from \"../lib/installation/index.js\";\nimport { checkPermissions } from \"../lib/permission-checker.js\";\nimport { getInstallationInfo } from \"../lib/plugins/plugin-info.js\";\nimport { hasIndividualPlugins } from \"../lib/plugins/index.js\";\nimport {\n claudePluginInstall,\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n} from \"../utils/exec.js\";\nimport {\n ASCII_LOGO,\n CLAUDE_SRC_DIR,\n CLI_BIN_NAME,\n CLI_COLORS,\n DEFAULT_BRANDING,\n GLOBAL_INSTALL_ROOT,\n} from \"../consts.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { loadProjectConfig } from \"../lib/configuration/project-config.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { SUCCESS_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\nimport { ensureBlankGlobalConfig } from \"../lib/configuration/config-writer.js\";\n\ntype DashboardOption = {\n label: string;\n command: string;\n};\n\nconst DASHBOARD_OPTIONS: DashboardOption[] = [\n { label: \"Edit\", command: \"edit\" },\n { label: \"Compile\", command: \"compile\" },\n { label: \"Doctor\", command: \"doctor\" },\n { label: \"List\", command: \"list\" },\n];\n\ntype DashboardProps = DashboardData & {\n onSelect: (command: string) => void;\n onCancel: () => void;\n};\n\nconst Dashboard: React.FC<DashboardProps> = ({\n skillCount,\n agentCount,\n source,\n mode,\n onSelect,\n onCancel,\n}) => {\n const { exit } = useApp();\n const [focusIndex, setFocusIndex] = useState(0);\n\n useInput((_input, key) => {\n if (key.escape) {\n onCancel();\n exit();\n return;\n }\n if (key.return) {\n onSelect(DASHBOARD_OPTIONS[focusIndex].command);\n exit();\n return;\n }\n if (key.leftArrow) {\n setFocusIndex((i) => (i > 0 ? i - 1 : DASHBOARD_OPTIONS.length - 1));\n }\n if (key.rightArrow) {\n setFocusIndex((i) => (i < DASHBOARD_OPTIONS.length - 1 ? i + 1 : 0));\n }\n });\n\n return (\n <Box flexDirection=\"column\">\n <Text bold>{DEFAULT_BRANDING.NAME}</Text>\n <Text> </Text>\n <Text> Skills: {skillCount} installed</Text>\n <Text> Agents: {agentCount} compiled</Text>\n <Text> Mode: {mode === \"plugin\" ? \"Plugin\" : \"Local\"}</Text>\n {source && <Text> Source: {source}</Text>}\n <Text> </Text>\n <Box>\n <Text> </Text>\n {DASHBOARD_OPTIONS.map((option, index) => (\n <Box key={option.command} marginRight={1}>\n <Text\n color={index === focusIndex ? CLI_COLORS.FOCUS : undefined}\n bold={index === focusIndex}\n >\n [{option.label}]\n </Text>\n </Box>\n ))}\n </Box>\n <Text dimColor> Use arrow keys to select, Enter to confirm, Esc to exit</Text>\n </Box>\n );\n};\n\ntype GlobalConfigChoice = \"edit-global\" | \"create-project\";\n\nconst GLOBAL_CONFIG_OPTIONS: { label: string; choice: GlobalConfigChoice }[] = [\n { label: \"Edit global installation\", choice: \"edit-global\" },\n { label: \"Create new project installation\", choice: \"create-project\" },\n];\n\ntype GlobalConfigPromptProps = {\n globalConfigDir: string;\n onSelect: (choice: GlobalConfigChoice) => void;\n onCancel: () => void;\n};\n\nconst GlobalConfigPrompt: React.FC<GlobalConfigPromptProps> = ({\n globalConfigDir,\n onSelect,\n onCancel,\n}) => {\n const { exit } = useApp();\n const [focusIndex, setFocusIndex] = useState(0);\n\n useInput((_input, key) => {\n if (key.escape) {\n onCancel();\n exit();\n return;\n }\n if (key.return) {\n onSelect(GLOBAL_CONFIG_OPTIONS[focusIndex].choice);\n exit();\n return;\n }\n if (key.leftArrow) {\n setFocusIndex((i) => (i > 0 ? i - 1 : GLOBAL_CONFIG_OPTIONS.length - 1));\n }\n if (key.rightArrow) {\n setFocusIndex((i) => (i < GLOBAL_CONFIG_OPTIONS.length - 1 ? i + 1 : 0));\n }\n });\n\n return (\n <Box flexDirection=\"column\">\n <Text>A global installation was found at {globalConfigDir}</Text>\n <Text>What would you like to do?</Text>\n <Text> </Text>\n <Box>\n <Text> </Text>\n {GLOBAL_CONFIG_OPTIONS.map((option, index) => (\n <Box key={option.choice} marginRight={1}>\n <Text\n color={index === focusIndex ? CLI_COLORS.FOCUS : undefined}\n bold={index === focusIndex}\n >\n [{option.label}]\n </Text>\n </Box>\n ))}\n </Box>\n <Text dimColor> Use arrow keys to select, Enter to confirm, Esc to exit</Text>\n </Box>\n );\n};\n\nexport type DashboardData = {\n skillCount: number;\n agentCount: number;\n mode: string;\n source?: string;\n};\n\n/** Gathers dashboard data from the installation and project config. */\nexport async function getDashboardData(projectDir: string): Promise<DashboardData> {\n const [info, loaded] = await Promise.all([getInstallationInfo(), loadProjectConfig(projectDir)]);\n\n // Skill count from config (canonical source of truth for installed skills)\n const skillCount = loaded?.config?.skills?.length ?? 0;\n // Agent count from filesystem (compiled .md files in agents dir)\n const agentCount = info?.agentCount ?? 0;\n const mode =\n info?.mode ?? (loaded?.config?.skills ? deriveInstallMode(loaded.config.skills) : \"local\");\n const source = loaded?.config?.source;\n\n return { skillCount, agentCount, mode, source };\n}\n\n/** Formats the dashboard summary as plain text lines (for non-interactive/test output). */\nexport function formatDashboardText(data: DashboardData): string {\n const modeLabel = data.mode === \"plugin\" ? \"Plugin\" : \"Local\";\n const lines = [\n DEFAULT_BRANDING.NAME,\n \"\",\n ` Skills: ${data.skillCount} installed`,\n ` Agents: ${data.agentCount} compiled`,\n ` Mode: ${modeLabel}`,\n ];\n if (data.source) {\n lines.push(` Source: ${data.source}`);\n }\n lines.push(\"\");\n lines.push(` [Edit] [Compile] [Doctor] [List]`);\n return lines.join(\"\\n\");\n}\n\n/**\n * Shows the project dashboard and returns the selected command (or null if cancelled).\n * In non-interactive environments (no TTY), prints the summary text and returns null.\n */\nexport async function showDashboard(\n projectDir: string,\n log?: (message: string) => void,\n): Promise<string | null> {\n const data = await getDashboardData(projectDir);\n\n // Non-interactive: print text summary and exit (CI, piped, tests)\n if (!process.stdin.isTTY) {\n const output = log ?? console.log;\n output(formatDashboardText(data));\n return null;\n }\n\n let selectedCommand: string | null = null;\n\n const { waitUntilExit } = render(\n <Dashboard\n skillCount={data.skillCount}\n agentCount={data.agentCount}\n source={data.source}\n mode={data.mode}\n onSelect={(command) => {\n selectedCommand = command;\n }}\n onCancel={() => {\n selectedCommand = null;\n }}\n />,\n );\n\n await waitUntilExit();\n\n return selectedCommand;\n}\n\nexport default class Init extends BaseCommand {\n static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;\n static description =\n \"Interactive wizard to set up skills and agents. Supports Plugin Mode (native install) and Local Mode (copy to .claude/).\";\n\n static examples = [\n {\n description: \"Start the setup wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Initialize from a custom marketplace\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote source\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Init);\n const projectDir = process.cwd();\n\n // For \"already initialized\" check, only look at the target directory (no global fallback)\n const individualPluginsExist = await hasIndividualPlugins(projectDir);\n const existingInstallation = await detectProjectInstallation(projectDir);\n\n if (individualPluginsExist || existingInstallation) {\n const selectedCommand = await showDashboard(projectDir, (msg) => this.log(msg));\n if (selectedCommand) {\n await this.config.runCommand(selectedCommand);\n }\n return;\n }\n\n // No project config exists: check if a global installation exists\n const globalInstallation = await detectGlobalInstallation();\n if (globalInstallation) {\n const globalConfigDir = path.join(os.homedir(), CLAUDE_SRC_DIR);\n\n // Non-interactive: skip prompt and fall through to wizard\n if (process.stdin.isTTY) {\n let globalChoice: GlobalConfigChoice | null = null;\n\n const { waitUntilExit: waitForPrompt } = render(\n <GlobalConfigPrompt\n globalConfigDir={globalConfigDir}\n onSelect={(choice) => {\n globalChoice = choice;\n }}\n onCancel={() => {\n globalChoice = null;\n }}\n />,\n );\n\n await waitForPrompt();\n\n if (globalChoice === \"edit-global\") {\n const selectedCommand = await showDashboard(os.homedir(), (msg) => this.log(msg));\n if (selectedCommand) {\n await this.config.runCommand(selectedCommand);\n }\n return;\n }\n\n // User cancelled (Esc)\n if (globalChoice === null) {\n return;\n }\n\n // \"create-project\" falls through to wizard below\n }\n }\n\n // Auto-create blank global config on first init from a project directory.\n // This ensures the project config can always import from global.\n if (projectDir !== GLOBAL_INSTALL_ROOT) {\n const created = await ensureBlankGlobalConfig();\n if (created) {\n this.log(\"Created blank global config at ~/\" + CLAUDE_SRC_DIR);\n }\n }\n\n enableBuffering();\n\n let sourceResult: SourceLoadResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n } catch (error) {\n disableBuffering();\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n const { waitUntilExit } = render(\n <Wizard\n matrix={sourceResult.matrix}\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n logo={ASCII_LOGO}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n // Boundary cast: Ink render callback returns unknown result type\n wizardResult = result as WizardResultV2;\n }}\n onCancel={() => {\n this.log(\"Setup cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n // Boundary cast: re-narrow after Ink waitUntilExit()\n const result = wizardResult as WizardResultV2 | null;\n if (!result || result.cancelled) {\n this.exit(EXIT_CODES.CANCELLED);\n }\n\n if (result.skills.length === 0) {\n this.error(\"No skills selected\", { exit: EXIT_CODES.ERROR });\n }\n\n await this.handleInstallation(result, sourceResult, flags);\n }\n\n private async handleInstallation(\n result: WizardResultV2,\n sourceResult: SourceLoadResult,\n flags: { source?: string; refresh: boolean },\n ): Promise<void> {\n const projectDir = process.cwd();\n const installMode = deriveInstallMode(result.skills);\n\n this.log(\"\\n\");\n this.log(`Selected ${result.skills.length} skills`);\n this.log(\n `Install mode: ${installMode === \"plugin\" ? \"Plugin (native install)\" : \"Local (copy to .claude/skills/)\"}`,\n );\n\n if (installMode === \"plugin\") {\n if (sourceResult.marketplace) {\n await this.installIndividualPlugins(result, sourceResult, flags, projectDir);\n } else {\n this.warn(\"Plugin Mode requires a marketplace for individual skill installation.\");\n this.log(`Falling back to Local Mode (copying to .claude/skills/)...`);\n this.log(\"To use Plugin Mode, either select a stack or configure a marketplace source.\\n\");\n await this.installLocalMode(result, sourceResult, flags, projectDir);\n }\n return;\n }\n\n await this.installLocalMode(result, sourceResult, flags, projectDir);\n }\n\n private async installIndividualPlugins(\n result: WizardResultV2,\n sourceResult: SourceLoadResult,\n flags: { source?: string },\n projectDir: string,\n ): Promise<void> {\n if (sourceResult.marketplace) {\n const marketplaceExists = await claudePluginMarketplaceExists(sourceResult.marketplace);\n\n if (!marketplaceExists) {\n this.log(`Registering marketplace \"${sourceResult.marketplace}\"...`);\n try {\n const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n this.log(`Registered marketplace: ${sourceResult.marketplace}`);\n } catch (error) {\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n }\n\n this.log(\"Installing skill plugins...\");\n for (const skill of result.skills.filter((s) => s.source !== \"local\")) {\n const pluginRef = `${skill.id}@${sourceResult.marketplace}`;\n const pluginScope = skill.scope === \"global\" ? \"user\" : \"project\";\n try {\n await claudePluginInstall(pluginRef, pluginScope, projectDir);\n this.log(` Installed ${pluginRef}`);\n } catch (error) {\n this.error(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n const pluginSkillCount = result.skills.filter((s) => s.source !== \"local\").length;\n this.log(`Installed ${pluginSkillCount} skill plugins\\n`);\n\n this.log(\"Generating configuration...\");\n try {\n const configResult = await installPluginConfig({\n wizardResult: result,\n sourceResult,\n projectDir,\n sourceFlag: flags.source,\n });\n\n if (configResult.wasMerged) {\n this.log(`Merged with existing config at ${configResult.mergedConfigPath}`);\n }\n\n this.log(`Configuration saved (${configResult.config.agents.length} agents)\\n`);\n this.log(STATUS_MESSAGES.COMPILING_AGENTS);\n this.log(`Compiled ${configResult.compiledAgents.length} agents to .claude/agents/\\n`);\n\n this.log(`${SUCCESS_MESSAGES.INIT_SUCCESS}\\n`);\n this.log(\"Agents compiled to:\");\n this.log(` ${configResult.agentsDir}`);\n for (const agentName of configResult.compiledAgents) {\n this.log(` ${agentName}.md`);\n }\n this.log(\"\");\n this.log(\"Configuration:\");\n this.log(` ${configResult.configPath}`);\n this.log(\"\");\n this.log(\"To customize agent-skill assignments:\");\n this.log(` 1. Edit .claude-src/config.ts`);\n this.log(` 2. Run '${CLI_BIN_NAME} compile' to regenerate agents`);\n this.log(\"\");\n\n const permissionWarning = await checkPermissions(projectDir);\n if (permissionWarning) {\n const { waitUntilExit } = render(permissionWarning);\n await waitUntilExit();\n }\n } catch (error) {\n this.handleError(error);\n }\n }\n\n private async installLocalMode(\n result: WizardResultV2,\n sourceResult: SourceLoadResult,\n flags: { source?: string },\n projectDir: string,\n ): Promise<void> {\n const matrix = sourceResult.matrix;\n\n this.log(\"Copying skills to local directory...\");\n try {\n const installResult = await installLocal({\n wizardResult: result,\n sourceResult,\n projectDir,\n sourceFlag: flags.source,\n });\n\n this.log(`Copied ${installResult.copiedSkills.length} skills to .claude/skills/\\n`);\n this.log(\"Generating configuration...\");\n\n if (installResult.wasMerged) {\n this.log(`Merged with existing config at ${installResult.mergedConfigPath}`);\n }\n\n this.log(`Configuration saved (${installResult.config.agents.length} agents)\\n`);\n this.log(STATUS_MESSAGES.COMPILING_AGENTS);\n this.log(`Compiled ${installResult.compiledAgents.length} agents to .claude/agents/\\n`);\n\n this.log(`${SUCCESS_MESSAGES.INIT_SUCCESS}\\n`);\n this.log(\"Skills copied to:\");\n this.log(` ${installResult.skillsDir}`);\n for (const copiedSkill of installResult.copiedSkills) {\n const skill = matrix.skills[copiedSkill.skillId];\n const displayName = skill?.displayName || copiedSkill.skillId;\n this.log(` ${displayName}/`);\n }\n this.log(\"\");\n this.log(\"Agents compiled to:\");\n this.log(` ${installResult.agentsDir}`);\n for (const agentName of installResult.compiledAgents) {\n this.log(` ${agentName}.md`);\n }\n this.log(\"\");\n this.log(\"Configuration:\");\n this.log(` ${installResult.configPath}`);\n this.log(\"\");\n this.log(\"To customize agent-skill assignments:\");\n this.log(` 1. Edit .claude-src/config.ts`);\n this.log(` 2. Run '${CLI_BIN_NAME} compile' to regenerate agents`);\n this.log(\"\");\n\n const permissionWarning = await checkPermissions(projectDir);\n if (permissionWarning) {\n const { waitUntilExit } = render(permissionWarning);\n await waitUntilExit();\n }\n } catch (error) {\n this.handleError(error);\n }\n }\n}\n","import React from \"react\";\n\nimport { Text, Box } from \"ink\";\nimport path from \"path\";\n\nimport { CLAUDE_DIR, CLI_COLORS, MAX_CONFIG_FILE_SIZE } from \"../consts\";\nimport { fileExists, readFileSafe } from \"../utils/fs\";\nimport { warn } from \"../utils/logger\";\nimport { settingsFileSchema, warnUnknownFields } from \"./schemas\";\n\ntype PermissionConfig = {\n allow?: string[];\n deny?: string[];\n};\n\ntype SettingsFile = {\n permissions?: PermissionConfig;\n};\n\nexport async function checkPermissions(projectRoot: string): Promise<React.ReactElement | null> {\n const settingsPath = path.join(projectRoot, CLAUDE_DIR, \"settings.json\");\n const localSettingsPath = path.join(projectRoot, CLAUDE_DIR, \"settings.local.json\");\n\n let permissions: PermissionConfig | undefined;\n\n for (const filePath of [localSettingsPath, settingsPath]) {\n if (await fileExists(filePath)) {\n try {\n const content = await readFileSafe(filePath, MAX_CONFIG_FILE_SIZE);\n const raw = JSON.parse(content);\n if (typeof raw === \"object\" && raw !== null && !Array.isArray(raw)) {\n // Known Claude CLI settings.json fields (permissions is ours; the rest are managed by Claude CLI)\n const EXPECTED_SETTINGS_KEYS = [\n \"permissions\",\n \"enabledPlugins\",\n \"env\",\n \"allowedTools\",\n \"customInstructions\",\n \"defaultModel\",\n ] as const;\n warnUnknownFields(\n raw as Record<string, unknown>,\n EXPECTED_SETTINGS_KEYS,\n `settings file '${filePath}'`,\n );\n }\n const result = settingsFileSchema.safeParse(raw);\n const parsed: SettingsFile = result.success ? (result.data as SettingsFile) : {};\n if (parsed.permissions) {\n permissions = parsed.permissions;\n break;\n }\n } catch {\n warn(`Malformed settings file at '${filePath}' — skipping`);\n }\n }\n }\n\n if (!permissions) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Notice\n </Text>\n <Text>No permissions configured in .claude/settings.json</Text>\n <Text>Agents will prompt for approval on each tool use.</Text>\n <Text> </Text>\n <Text>For autonomous operation, add to .claude/settings.json:</Text>\n <Text> </Text>\n <Text color=\"dim\">{\"{\"}</Text>\n <Text color=\"dim\">{' \"permissions\": {'}</Text>\n <Text color=\"dim\">{' \"allow\": ['}</Text>\n <Text color=\"dim\">{' \"Read(*)\",'}</Text>\n <Text color=\"dim\">{' \"Bash(git *)\",'}</Text>\n <Text color=\"dim\">{' \"Bash(bun *)\"'}</Text>\n <Text color=\"dim\">{\" ]\"}</Text>\n <Text color=\"dim\">{\" }\"}</Text>\n <Text color=\"dim\">{\"}\"}</Text>\n </Box>\n );\n }\n\n const hasRestrictiveBash = permissions.deny?.some(\n (rule) => rule === \"Bash(*)\" || rule === \"Bash\",\n );\n const hasNoAllows = !permissions.allow || permissions.allow.length === 0;\n\n if (hasRestrictiveBash || hasNoAllows) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Warnings\n </Text>\n {hasRestrictiveBash && (\n <Text>\n ⚠ Bash is denied in permissions. Some agents require Bash for git, testing, and build\n commands.\n </Text>\n )}\n {hasNoAllows && (\n <Text>⚠ No allow rules configured. Agents will prompt for each tool use.</Text>\n )}\n </Box>\n );\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAgB,gBAAgB;AAEhC,SAAS,aAAa;AACtB,SAAS,QAAQ,OAAAA,MAAK,QAAAC,OAAM,QAAQ,gBAAgB;AACpD,OAAO,QAAQ;AACf,OAAOC,WAAU;;;ACLjB;AAEA,SAAS,MAAM,WAAW;AAC1B,OAAO,UAAU;AAyDX,SACE,KADF;AAzCN,eAAsB,iBAAiB,aAAyD;AAC9F,QAAM,eAAe,KAAK,KAAK,aAAa,YAAY,eAAe;AACvE,QAAM,oBAAoB,KAAK,KAAK,aAAa,YAAY,qBAAqB;AAElF,MAAI;AAEJ,aAAW,YAAY,CAAC,mBAAmB,YAAY,GAAG;AACxD,QAAI,MAAM,WAAW,QAAQ,GAAG;AAC9B,UAAI;AACF,cAAM,UAAU,MAAM,aAAa,UAAU,oBAAoB;AACjE,cAAM,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,cAAc,SAAS,EAAE;AACvC,iBAAW,aAAa,cAAc,gBAAgB;AACpD,aAAK,IAAI,OAAO,SAAS,KAAK;AAAA,MAChC;AACA,WAAK,IAAI,EAAE;AACX,WAAK,IAAI,gBAAgB;AACzB,WAAK,IAAI,KAAK,cAAc,UAAU,EAAE;AACxC,WAAK,IAAI,EAAE;AACX,WAAK,IAAI,uCAAuC;AAChD,WAAK,IAAI,iCAAiC;AAC1C,WAAK,IAAI,aAAa,YAAY,gCAAgC;AAClE,WAAK,IAAI,EAAE;AAEX,YAAM,oBAAoB,MAAM,iBAAiB,UAAU;AAC3D,UAAI,mBAAmB;AACrB,cAAM,EAAE,cAAc,IAAI,OAAO,iBAAiB;AAClD,cAAM,cAAc;AAAA,MACtB;AAAA,IACF,SAAS,OAAO;AACd,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF;AACF;","names":["Box","Text","path","jsx","jsxs","Box","Text","path","result"]}
|
|
@@ -4,23 +4,23 @@ import {
|
|
|
4
4
|
} from "./chunk-K77I4XGL.js";
|
|
5
5
|
import {
|
|
6
6
|
getDomainDisplayName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BKJHAJQW.js";
|
|
8
8
|
import {
|
|
9
9
|
useRowScroll
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WYVDNGJB.js";
|
|
11
11
|
import {
|
|
12
12
|
ViewTitle
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MGNYPVOJ.js";
|
|
14
14
|
import {
|
|
15
15
|
useWizardStore
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IGM6HA3S.js";
|
|
17
17
|
import {
|
|
18
18
|
typedKeys
|
|
19
19
|
} from "./chunk-T4EXUIBY.js";
|
|
20
20
|
import {
|
|
21
21
|
CLI_COLORS,
|
|
22
22
|
UI_SYMBOLS
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-6OWHQ7HM.js";
|
|
24
24
|
import {
|
|
25
25
|
init_esm_shims
|
|
26
26
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
// src/cli/components/wizard/step-agents.tsx
|
|
29
29
|
init_esm_shims();
|
|
30
30
|
import { Box, Text, useInput } from "ink";
|
|
31
|
-
import { useMemo, useState } from "react";
|
|
31
|
+
import React, { useMemo, useState } from "react";
|
|
32
32
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
33
|
var BUILT_IN_AGENT_GROUPS = [
|
|
34
34
|
{
|
|
@@ -184,6 +184,9 @@ var StepAgents = ({ matrix }) => {
|
|
|
184
184
|
store.toggleAgent(focusedId);
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
+
React.useEffect(() => {
|
|
188
|
+
store.setFocusedAgentId(focusedId === "continue" ? null : focusedId);
|
|
189
|
+
}, [focusedId, store]);
|
|
187
190
|
const selectedCount = store.selectedAgents.length;
|
|
188
191
|
const continueLabel = selectedCount > 0 ? `Continue with ${selectedCount} agent(s)` : "Continue without agents";
|
|
189
192
|
const isContinueFocused = focusedId === "continue";
|
|
@@ -201,6 +204,8 @@ var StepAgents = ({ matrix }) => {
|
|
|
201
204
|
const isSelected = store.selectedAgents.includes(row.agent.id);
|
|
202
205
|
const checkbox = isSelected ? "[\u2713]" : "[ ]";
|
|
203
206
|
const pointer = isFocused ? UI_SYMBOLS.CURRENT : " ";
|
|
207
|
+
const agentConfig = store.agentConfigs.find((ac) => ac.name === row.agent.id);
|
|
208
|
+
const scopeBadge = isSelected && agentConfig ? agentConfig.scope === "global" ? " [G]" : " [P]" : "";
|
|
204
209
|
return /* @__PURE__ */ jsx(Box, { flexShrink: 0, children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
205
210
|
/* @__PURE__ */ jsx(Text, { color: isFocused ? CLI_COLORS.PRIMARY : void 0, children: pointer }),
|
|
206
211
|
/* @__PURE__ */ jsxs(
|
|
@@ -216,6 +221,13 @@ var StepAgents = ({ matrix }) => {
|
|
|
216
221
|
]
|
|
217
222
|
}
|
|
218
223
|
),
|
|
224
|
+
scopeBadge && /* @__PURE__ */ jsx(
|
|
225
|
+
Text,
|
|
226
|
+
{
|
|
227
|
+
color: agentConfig?.scope === "global" ? CLI_COLORS.WARNING : CLI_COLORS.INFO,
|
|
228
|
+
children: scopeBadge
|
|
229
|
+
}
|
|
230
|
+
),
|
|
219
231
|
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
220
232
|
" - ",
|
|
221
233
|
row.agent.description
|
|
@@ -256,4 +268,4 @@ var StepAgents = ({ matrix }) => {
|
|
|
256
268
|
export {
|
|
257
269
|
StepAgents
|
|
258
270
|
};
|
|
259
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-Z3TM4N37.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/step-agents.tsx"],"sourcesContent":["import { Box, Text, useInput } from \"ink\";\nimport React, { useMemo, useState } from \"react\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\nimport { useRowScroll } from \"../hooks/use-row-scroll.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport type { AgentName, MergedSkillsMatrix } from \"../../types/index.js\";\nimport { typedKeys } from \"../../utils/typed-object.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { getDomainDisplayName } from \"./utils.js\";\nimport { ViewTitle } from \"./view-title.js\";\n\ntype AgentItem = {\n id: AgentName;\n label: string;\n description: string;\n};\n\ntype AgentGroup = {\n label: string;\n items: AgentItem[];\n};\n\nconst BUILT_IN_AGENT_GROUPS: AgentGroup[] = [\n {\n label: \"Web\",\n items: [\n {\n id: \"web-developer\",\n label: \"Web Developer\",\n description: \"Frontend features, components, TypeScript\",\n },\n { id: \"web-reviewer\", label: \"Web Reviewer\", description: \"UI component code review\" },\n { id: \"web-researcher\", label: \"Web Researcher\", description: \"Frontend pattern discovery\" },\n {\n id: \"web-tester\",\n label: \"Web Tester\",\n description: \"Frontend tests, E2E, component tests\",\n },\n { id: \"web-pm\", label: \"Web PM\", description: \"Implementation specs and planning\" },\n {\n id: \"web-architecture\",\n label: \"Web Architecture\",\n description: \"App scaffolding, foundational patterns\",\n },\n {\n id: \"web-pattern-critique\",\n label: \"Web Pattern Critique\",\n description: \"Critique patterns against industry standards\",\n },\n ],\n },\n {\n label: \"API\",\n items: [\n {\n id: \"api-developer\",\n label: \"API Developer\",\n description: \"Backend routes, database, middleware\",\n },\n { id: \"api-reviewer\", label: \"API Reviewer\", description: \"Backend and config code review\" },\n { id: \"api-researcher\", label: \"API Researcher\", description: \"Backend pattern discovery\" },\n ],\n },\n {\n label: \"CLI\",\n items: [\n {\n id: \"cli-developer\",\n label: \"CLI Developer\",\n description: \"CLI commands, interactive prompts\",\n },\n { id: \"cli-tester\", label: \"CLI Tester\", description: \"CLI application tests\" },\n { id: \"cli-reviewer\", label: \"CLI Reviewer\", description: \"CLI code review\" },\n ],\n },\n {\n label: \"Meta\",\n items: [\n {\n id: \"pattern-scout\",\n label: \"Pattern Scout\",\n description: \"Extract codebase patterns and standards\",\n },\n { id: \"agent-summoner\", label: \"Agent Summoner\", description: \"Create and improve agents\" },\n {\n id: \"skill-summoner\",\n label: \"Skill Summoner\",\n description: \"Create technology-specific skills\",\n },\n { id: \"documentor\", label: \"Documentor\", description: \"AI-focused documentation\" },\n ],\n },\n];\n\n/** IDs of all built-in agents for fast lookup. */\nconst BUILT_IN_AGENT_IDS = new Set<string>(\n BUILT_IN_AGENT_GROUPS.flatMap((group) => group.items.map((a) => a.id)),\n);\n\n/** Convert a kebab-case agent ID to a title-case label. */\nfunction agentIdToLabel(id: string): string {\n return id\n .split(\"-\")\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\ntype FocusId = AgentName | \"continue\";\n\ntype ListRow =\n | { type: \"header\"; label: string }\n | { type: \"spacer\" }\n | { type: \"agent\"; agent: AgentItem };\n\nfunction buildAgentGroups(matrix: MergedSkillsMatrix): AgentGroup[] {\n const customAgentIds: string[] = [];\n for (const stack of matrix.suggestedStacks) {\n for (const agentName of typedKeys(stack.skills)) {\n if (!BUILT_IN_AGENT_IDS.has(agentName) && !customAgentIds.includes(agentName)) {\n customAgentIds.push(agentName);\n }\n }\n }\n\n if (customAgentIds.length === 0) return BUILT_IN_AGENT_GROUPS;\n\n // Group custom agents by explicit domain (from metadata.yaml) or kebab prefix fallback\n const customGroupMap = new Map<string, AgentItem[]>();\n for (const agentId of customAgentIds) {\n // Boundary cast: custom agent names from matrix stacks are not in the AgentName union\n const explicitDomain = matrix.agentDefinedDomains?.[agentId as AgentName];\n const domainKey = explicitDomain ?? (agentId.split(\"-\")[0] || \"custom\");\n const groupLabel = getDomainDisplayName(domainKey);\n if (!customGroupMap.has(groupLabel)) {\n customGroupMap.set(groupLabel, []);\n }\n customGroupMap.get(groupLabel)!.push({\n id: agentId as AgentName,\n label: agentIdToLabel(agentId),\n description: \"Custom agent\",\n });\n }\n\n const customGroups: AgentGroup[] = [];\n for (const [label, items] of customGroupMap) {\n customGroups.push({ label, items });\n }\n\n return [...BUILT_IN_AGENT_GROUPS, ...customGroups];\n}\n\nfunction buildFlatRows(groups: AgentGroup[]): ListRow[] {\n return groups.flatMap((group, groupIndex): ListRow[] => [\n ...(groupIndex > 0 ? [{ type: \"spacer\" as const }] : []),\n { type: \"header\" as const, label: group.label },\n ...group.items.map((agent): ListRow => ({ type: \"agent\", agent })),\n ]);\n}\n\nfunction buildFocusableIds(groups: AgentGroup[]): FocusId[] {\n return [...groups.flatMap((group) => group.items.map((a) => a.id)), \"continue\"];\n}\n\ntype StepAgentsProps = {\n matrix: MergedSkillsMatrix;\n};\n\nexport const StepAgents: React.FC<StepAgentsProps> = ({ matrix }) => {\n const store = useWizardStore();\n\n const agentGroups = useMemo(() => buildAgentGroups(matrix), [matrix]);\n const flatRows = useMemo(() => buildFlatRows(agentGroups), [agentGroups]);\n const focusableIds = useMemo(() => buildFocusableIds(agentGroups), [agentGroups]);\n\n const [focusedId, setFocusedId] = useState<FocusId>(focusableIds[0]!);\n const { ref: listRef, measuredHeight: listHeight } = useMeasuredHeight();\n\n const focusedRowIndex =\n focusedId !== \"continue\"\n ? flatRows.findIndex((row) => row.type === \"agent\" && row.agent.id === focusedId)\n : -1;\n const { scrollEnabled, scrollTop } = useRowScroll({\n focusedIndex: Math.max(0, focusedRowIndex),\n itemCount: flatRows.length,\n availableHeight: listHeight,\n });\n\n useInput((input, key) => {\n if (key.escape) {\n store.goBack();\n return;\n }\n\n const currentIdx = focusableIds.indexOf(focusedId);\n\n if (key.upArrow || input === \"k\") {\n const nextIdx = currentIdx <= 0 ? focusableIds.length - 1 : currentIdx - 1;\n setFocusedId(focusableIds[nextIdx]!);\n return;\n }\n\n if (key.downArrow || input === \"j\") {\n const nextIdx = currentIdx >= focusableIds.length - 1 ? 0 : currentIdx + 1;\n setFocusedId(focusableIds[nextIdx]!);\n return;\n }\n\n if (key.return) {\n store.setStep(\"confirm\");\n return;\n }\n\n if (input === \" \" && focusedId !== \"continue\") {\n store.toggleAgent(focusedId);\n }\n });\n\n // Sync focusedAgentId so the wizard-level S key handler can toggle agent scope\n React.useEffect(() => {\n store.setFocusedAgentId(focusedId === \"continue\" ? null : focusedId);\n }, [focusedId, store]);\n\n const selectedCount = store.selectedAgents.length;\n const continueLabel =\n selectedCount > 0 ? `Continue with ${selectedCount} agent(s)` : \"Continue without agents\";\n\n const isContinueFocused = focusedId === \"continue\";\n\n const rowElements = flatRows.map((row, index) => {\n switch (row.type) {\n case \"header\":\n return (\n <Box key={`header-${row.label}`} flexShrink={0}>\n <Text dimColor bold>\n {\" \"}\n {row.label}\n </Text>\n </Box>\n );\n case \"spacer\":\n return (\n <Box key={`spacer-${index}`} flexShrink={0}>\n <Text> </Text>\n </Box>\n );\n case \"agent\": {\n const isFocused = row.agent.id === focusedId;\n const isSelected = store.selectedAgents.includes(row.agent.id);\n const checkbox = isSelected ? \"[\\u2713]\" : \"[ ]\";\n const pointer = isFocused ? UI_SYMBOLS.CURRENT : \" \";\n const agentConfig = store.agentConfigs.find((ac) => ac.name === row.agent.id);\n const scopeBadge =\n isSelected && agentConfig ? (agentConfig.scope === \"global\" ? \" [G]\" : \" [P]\") : \"\";\n return (\n <Box key={row.agent.id} flexShrink={0}>\n <Text>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined}>{pointer}</Text>\n <Text\n color={isSelected || isFocused ? CLI_COLORS.PRIMARY : undefined}\n bold={isFocused}\n >\n {\" \"}\n {checkbox} {row.agent.label}\n </Text>\n {scopeBadge && (\n <Text\n color={agentConfig?.scope === \"global\" ? CLI_COLORS.WARNING : CLI_COLORS.INFO}\n >\n {scopeBadge}\n </Text>\n )}\n <Text dimColor> - {row.agent.description}</Text>\n </Text>\n </Box>\n );\n }\n }\n });\n\n return (\n <Box flexDirection=\"column\" width=\"100%\" flexGrow={1} flexBasis={0}>\n <ViewTitle>Select agents to compile:</ViewTitle>\n\n <Box ref={listRef} flexDirection=\"column\" flexGrow={1} flexBasis={0}>\n <Box\n flexDirection=\"column\"\n flexGrow={1}\n {...(scrollEnabled && { overflow: \"hidden\" as const })}\n >\n <Box\n flexDirection=\"column\"\n marginTop={scrollTop > 0 ? -scrollTop : 0}\n {...(scrollEnabled && { flexShrink: 0 })}\n >\n {rowElements}\n </Box>\n </Box>\n </Box>\n\n <Text color={isContinueFocused ? CLI_COLORS.PRIMARY : undefined} bold={isContinueFocused}>\n {isContinueFocused ? UI_SYMBOLS.CURRENT : \" \"} {\"\\u2192\"} {continueLabel}\n </Text>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,KAAK,MAAM,gBAAgB;AACpC,OAAO,SAAS,SAAS,gBAAgB;AAuO/B,cACE,YADF;AAlNV,IAAM,wBAAsC;AAAA,EAC1C;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA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mBACpE;AAAA,0BAAoB,WAAW,UAAU;AAAA,MAAI;AAAA,MAAE;AAAA,MAAS;AAAA,MAAE;AAAA,OAC7D;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
generateMarketplace,
|
|
4
4
|
getMarketplaceStats,
|
|
5
5
|
writeMarketplace
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-C577AJE7.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCommand
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-VR3CDXDT.js";
|
|
10
10
|
import {
|
|
11
11
|
setVerbose
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-LWXRUR6B.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_BRANDING,
|
|
15
15
|
DEFAULT_PLUGIN_NAME,
|
|
16
16
|
DEFAULT_VERSION,
|
|
17
17
|
PLUGIN_MANIFEST_DIR
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-6OWHQ7HM.js";
|
|
19
19
|
import {
|
|
20
20
|
init_esm_shims
|
|
21
21
|
} from "../../chunk-DHET7RCE.js";
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
import {
|
|
3
3
|
compileAllAgentPlugins,
|
|
4
4
|
printAgentCompilationSummary
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import {
|
|
7
|
-
BaseCommand
|
|
8
|
-
} from "../../chunk-PGY5XROM.js";
|
|
5
|
+
} from "../../chunk-SRBN6RRD.js";
|
|
9
6
|
import {
|
|
10
7
|
compileAllSkillPlugins,
|
|
11
8
|
compileSkillPlugin,
|
|
12
9
|
printCompilationSummary
|
|
13
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-FWMWWE3X.js";
|
|
11
|
+
import "../../chunk-OCEFD7V6.js";
|
|
14
12
|
import "../../chunk-T4EXUIBY.js";
|
|
13
|
+
import {
|
|
14
|
+
BaseCommand
|
|
15
|
+
} from "../../chunk-VR3CDXDT.js";
|
|
15
16
|
import {
|
|
16
17
|
setVerbose
|
|
17
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-LWXRUR6B.js";
|
|
18
19
|
import {
|
|
19
20
|
DIRS
|
|
20
|
-
} from "../../chunk-
|
|
21
|
+
} from "../../chunk-6OWHQ7HM.js";
|
|
22
|
+
import "../../chunk-EC3UJRKZ.js";
|
|
21
23
|
import {
|
|
22
24
|
init_esm_shims
|
|
23
25
|
} from "../../chunk-DHET7RCE.js";
|