@agents-inc/cli 0.74.7 → 0.74.10
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 +35 -0
- package/README.md +69 -111
- package/dist/{chunk-UKYWXIDT.js → chunk-2EXAK22V.js} +117 -112
- package/dist/chunk-2EXAK22V.js.map +1 -0
- package/dist/{chunk-HA35FGPO.js → chunk-54AECXSH.js} +2 -2
- package/dist/{chunk-2GD57LQE.js → chunk-C6YLN4AW.js} +5 -5
- package/dist/{chunk-6VIOO74O.js → chunk-CBYRFAUN.js} +1 -3
- package/dist/{chunk-6VIOO74O.js.map → chunk-CBYRFAUN.js.map} +1 -1
- package/dist/{chunk-BKTPEATV.js → chunk-EWKUUWYY.js} +6 -2
- package/dist/chunk-EWKUUWYY.js.map +1 -0
- package/dist/{chunk-JB2QTE7M.js → chunk-FW5C245M.js} +6 -7
- package/dist/chunk-FW5C245M.js.map +1 -0
- package/dist/{chunk-MVYJVKVT.js → chunk-HT5KOOUQ.js} +2 -2
- package/dist/{chunk-VMTZ5WC5.js → chunk-IYA5PSXU.js} +2 -2
- package/dist/{chunk-2ZQKORJI.js → chunk-M5IAGR5Z.js} +3 -3
- package/dist/{chunk-KYULKBFC.js → chunk-NA6I5P5P.js} +2 -2
- package/dist/{chunk-STC7IEVI.js → chunk-NDKIFVR4.js} +2 -2
- package/dist/{chunk-RO6BG4ZW.js → chunk-OINQ6OWM.js} +3 -5
- package/dist/chunk-OINQ6OWM.js.map +1 -0
- package/dist/{chunk-CJSCCLT5.js → chunk-PN65K3LH.js} +2 -2
- package/dist/{chunk-GFTBHBRQ.js → chunk-PUZLP4SL.js} +14 -3
- package/dist/chunk-PUZLP4SL.js.map +1 -0
- package/dist/{chunk-COZ75NET.js → chunk-TPXDHJDB.js} +2 -2
- package/dist/{chunk-2MHSOPIU.js → chunk-UFKDY45I.js} +2 -2
- package/dist/{chunk-MOWZ2FLG.js → chunk-VILTRTBT.js} +2 -2
- package/dist/{chunk-W3GHDONP.js → chunk-VIVOJASC.js} +4 -4
- package/dist/{chunk-RHAZARG3.js → chunk-VYHRCFMD.js} +5 -5
- package/dist/{chunk-JZPQI7YI.js → chunk-X6LXHVA6.js} +2 -2
- package/dist/{chunk-HIVZDWJC.js → chunk-XPRDNALD.js} +2 -2
- package/dist/{chunk-TJBOCGLR.js → chunk-YDBVG6RF.js} +11 -11
- package/dist/{chunk-FDIKV4ON.js → chunk-YZUAXX7F.js} +4 -88
- package/dist/chunk-YZUAXX7F.js.map +1 -0
- package/dist/commands/build/plugins.js +2 -2
- package/dist/commands/build/stack.js +2 -2
- package/dist/commands/compile.js +2 -2
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/path.js +1 -1
- package/dist/commands/config/show.js +2 -2
- package/dist/commands/diff.js +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/edit.js +47 -40
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +1 -1
- package/dist/commands/import/skill.js +1 -1
- package/dist/commands/info.js +1 -1
- package/dist/commands/init.js +18 -18
- package/dist/commands/list.js +1 -1
- package/dist/commands/new/agent.js +2 -2
- package/dist/commands/new/marketplace.js +2 -2
- package/dist/commands/new/skill.js +2 -2
- package/dist/commands/outdated.js +1 -1
- package/dist/commands/search.js +3 -3
- package/dist/commands/uninstall.js +1 -1
- package/dist/commands/update.js +2 -2
- package/dist/commands/validate.js +62 -44
- package/dist/commands/validate.js.map +1 -1
- package/dist/components/skill-search/skill-search.js +2 -2
- package/dist/components/wizard/category-grid.js +2 -2
- package/dist/components/wizard/category-grid.test.js +4 -4
- package/dist/components/wizard/domain-selection.js +3 -3
- package/dist/components/wizard/help-modal.js +2 -2
- package/dist/components/wizard/search-modal.js +2 -2
- package/dist/components/wizard/search-modal.test.js +2 -2
- package/dist/components/wizard/source-grid.js +3 -3
- package/dist/components/wizard/source-grid.test.js +5 -5
- package/dist/components/wizard/stack-selection.js +3 -3
- package/dist/components/wizard/step-agents.js +3 -3
- package/dist/components/wizard/step-agents.test.js +3 -3
- package/dist/components/wizard/step-build.js +5 -5
- package/dist/components/wizard/step-build.test.js +5 -5
- package/dist/components/wizard/step-confirm.js +2 -2
- package/dist/components/wizard/step-confirm.test.js +4 -4
- package/dist/components/wizard/step-refine.js +3 -2
- package/dist/components/wizard/step-refine.test.js +3 -2
- package/dist/components/wizard/step-refine.test.js.map +1 -1
- package/dist/components/wizard/step-settings.js +3 -3
- package/dist/components/wizard/step-settings.test.js +6 -6
- package/dist/components/wizard/step-sources.js +6 -6
- package/dist/components/wizard/step-sources.test.js +6 -6
- package/dist/components/wizard/step-stack.js +5 -5
- package/dist/components/wizard/step-stack.test.js +5 -5
- package/dist/components/wizard/wizard-layout.js +5 -5
- package/dist/components/wizard/wizard.js +17 -17
- package/dist/hooks/init.js +18 -18
- package/dist/source-loader-WBDPZJEW.js +23 -0
- package/dist/{source-manager-A3QLBYCU.js → source-manager-RRGK4SBP.js} +2 -2
- package/dist/stores/wizard-store.js +2 -2
- package/dist/stores/wizard-store.test.js +26 -5
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-BKTPEATV.js.map +0 -1
- package/dist/chunk-FDIKV4ON.js.map +0 -1
- package/dist/chunk-GFTBHBRQ.js.map +0 -1
- package/dist/chunk-JB2QTE7M.js.map +0 -1
- package/dist/chunk-RO6BG4ZW.js.map +0 -1
- package/dist/chunk-UKYWXIDT.js.map +0 -1
- package/dist/source-loader-HQTTAMS7.js +0 -17
- /package/dist/{chunk-HA35FGPO.js.map → chunk-54AECXSH.js.map} +0 -0
- /package/dist/{chunk-2GD57LQE.js.map → chunk-C6YLN4AW.js.map} +0 -0
- /package/dist/{chunk-MVYJVKVT.js.map → chunk-HT5KOOUQ.js.map} +0 -0
- /package/dist/{chunk-VMTZ5WC5.js.map → chunk-IYA5PSXU.js.map} +0 -0
- /package/dist/{chunk-2ZQKORJI.js.map → chunk-M5IAGR5Z.js.map} +0 -0
- /package/dist/{chunk-KYULKBFC.js.map → chunk-NA6I5P5P.js.map} +0 -0
- /package/dist/{chunk-STC7IEVI.js.map → chunk-NDKIFVR4.js.map} +0 -0
- /package/dist/{chunk-CJSCCLT5.js.map → chunk-PN65K3LH.js.map} +0 -0
- /package/dist/{chunk-COZ75NET.js.map → chunk-TPXDHJDB.js.map} +0 -0
- /package/dist/{chunk-2MHSOPIU.js.map → chunk-UFKDY45I.js.map} +0 -0
- /package/dist/{chunk-MOWZ2FLG.js.map → chunk-VILTRTBT.js.map} +0 -0
- /package/dist/{chunk-W3GHDONP.js.map → chunk-VIVOJASC.js.map} +0 -0
- /package/dist/{chunk-RHAZARG3.js.map → chunk-VYHRCFMD.js.map} +0 -0
- /package/dist/{chunk-JZPQI7YI.js.map → chunk-X6LXHVA6.js.map} +0 -0
- /package/dist/{chunk-HIVZDWJC.js.map → chunk-XPRDNALD.js.map} +0 -0
- /package/dist/{chunk-TJBOCGLR.js.map → chunk-YDBVG6RF.js.map} +0 -0
- /package/dist/{source-loader-HQTTAMS7.js.map → source-loader-WBDPZJEW.js.map} +0 -0
- /package/dist/{source-manager-A3QLBYCU.js.map → source-manager-RRGK4SBP.js.map} +0 -0
|
@@ -10,24 +10,24 @@ import {
|
|
|
10
10
|
} from "./chunk-MWGDG4QN.js";
|
|
11
11
|
import {
|
|
12
12
|
SourceGrid
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TPXDHJDB.js";
|
|
14
14
|
import {
|
|
15
15
|
ViewTitle
|
|
16
16
|
} from "./chunk-AQYAVLZK.js";
|
|
17
17
|
import {
|
|
18
18
|
useWizardStore
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PUZLP4SL.js";
|
|
20
20
|
import {
|
|
21
21
|
HOTKEY_SET_ALL_LOCAL,
|
|
22
22
|
HOTKEY_SET_ALL_PLUGIN,
|
|
23
23
|
KEY_LABEL_ENTER,
|
|
24
24
|
KEY_LABEL_ESC,
|
|
25
25
|
isHotkey
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CBYRFAUN.js";
|
|
27
27
|
import {
|
|
28
28
|
resolveAllSources,
|
|
29
29
|
searchExtraSources
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2EXAK22V.js";
|
|
31
31
|
import {
|
|
32
32
|
CLI_COLORS,
|
|
33
33
|
DEFAULT_BRANDING
|
|
@@ -181,4 +181,4 @@ var StepSources = ({ projectDir, onContinue, onBack }) => {
|
|
|
181
181
|
export {
|
|
182
182
|
StepSources
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-VYHRCFMD.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
HOTKEY_TOGGLE_LABELS,
|
|
10
10
|
isHotkey
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CBYRFAUN.js";
|
|
12
12
|
import {
|
|
13
13
|
getSkillById
|
|
14
14
|
} from "./chunk-NG2GGK6P.js";
|
|
@@ -341,4 +341,4 @@ var CategoryGrid = ({
|
|
|
341
341
|
export {
|
|
342
342
|
CategoryGrid
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-X6LXHVA6.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadProjectSourceConfig,
|
|
8
8
|
resolveAgentsSource,
|
|
9
9
|
resolveSource
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2EXAK22V.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseCommand
|
|
13
13
|
} from "./chunk-IJLAVOKZ.js";
|
|
@@ -90,4 +90,4 @@ ${DEFAULT_BRANDING.NAME} Configuration
|
|
|
90
90
|
export {
|
|
91
91
|
ConfigShow
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-XPRDNALD.js.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
WizardLayout
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FW5C245M.js";
|
|
5
5
|
import {
|
|
6
6
|
StepSettings
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-M5IAGR5Z.js";
|
|
8
8
|
import {
|
|
9
9
|
StepSources
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VYHRCFMD.js";
|
|
11
11
|
import {
|
|
12
12
|
StepStack
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VIVOJASC.js";
|
|
14
14
|
import {
|
|
15
15
|
StepAgents
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NDKIFVR4.js";
|
|
17
17
|
import {
|
|
18
18
|
StepBuild
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-C6YLN4AW.js";
|
|
20
20
|
import {
|
|
21
21
|
StepConfirm
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-PN65K3LH.js";
|
|
23
23
|
import {
|
|
24
24
|
getStackName
|
|
25
25
|
} from "./chunk-LVNNP7T4.js";
|
|
26
26
|
import {
|
|
27
27
|
useWizardStore
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-PUZLP4SL.js";
|
|
29
29
|
import {
|
|
30
30
|
cliTheme
|
|
31
31
|
} from "./chunk-T5DJCIUP.js";
|
|
@@ -35,11 +35,11 @@ import {
|
|
|
35
35
|
HOTKEY_SCOPE,
|
|
36
36
|
HOTKEY_SETTINGS,
|
|
37
37
|
isHotkey
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CBYRFAUN.js";
|
|
39
39
|
import {
|
|
40
40
|
resolveAlias,
|
|
41
41
|
validateSelection
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-2EXAK22V.js";
|
|
43
43
|
import {
|
|
44
44
|
findStack,
|
|
45
45
|
matrix
|
|
@@ -339,4 +339,4 @@ var Wizard = ({
|
|
|
339
339
|
export {
|
|
340
340
|
Wizard
|
|
341
341
|
};
|
|
342
|
-
//# sourceMappingURL=chunk-
|
|
342
|
+
//# sourceMappingURL=chunk-YDBVG6RF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
Wizard
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YDBVG6RF.js";
|
|
5
5
|
import {
|
|
6
6
|
SelectList
|
|
7
7
|
} from "./chunk-WF5PMBIR.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
KEY_LABEL_ARROWS_VERT,
|
|
10
10
|
KEY_LABEL_ENTER,
|
|
11
11
|
KEY_LABEL_ESC
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CBYRFAUN.js";
|
|
13
13
|
import {
|
|
14
14
|
STATUS_MESSAGES,
|
|
15
15
|
SUCCESS_MESSAGES
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
claudePluginMarketplaceAdd,
|
|
20
20
|
claudePluginMarketplaceExists,
|
|
21
21
|
deriveInstallMode,
|
|
22
|
-
detectGlobalInstallation,
|
|
23
22
|
detectProjectInstallation,
|
|
24
23
|
ensureBlankGlobalConfig,
|
|
25
24
|
fetchMarketplace,
|
|
@@ -29,7 +28,7 @@ import {
|
|
|
29
28
|
installPluginConfig,
|
|
30
29
|
loadProjectConfig,
|
|
31
30
|
loadSkillsMatrixFromSource
|
|
32
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-2EXAK22V.js";
|
|
33
32
|
import {
|
|
34
33
|
getSkillById
|
|
35
34
|
} from "./chunk-NG2GGK6P.js";
|
|
@@ -67,8 +66,6 @@ init_esm_shims();
|
|
|
67
66
|
import { Flags } from "@oclif/core";
|
|
68
67
|
import { render, Box as Box2, Text as Text2, useApp } from "ink";
|
|
69
68
|
import fs from "fs";
|
|
70
|
-
import os from "os";
|
|
71
|
-
import path2 from "path";
|
|
72
69
|
|
|
73
70
|
// src/cli/lib/permission-checker.tsx
|
|
74
71
|
init_esm_shims();
|
|
@@ -187,50 +184,6 @@ var Dashboard = ({ onSelect, onCancel }) => {
|
|
|
187
184
|
] })
|
|
188
185
|
] });
|
|
189
186
|
};
|
|
190
|
-
var GLOBAL_CONFIG_OPTIONS = [
|
|
191
|
-
{ label: "Edit global installation", value: "edit-global" },
|
|
192
|
-
{ label: "Create new project installation", value: "create-project" }
|
|
193
|
-
];
|
|
194
|
-
var GlobalConfigPrompt = ({
|
|
195
|
-
globalConfigDir,
|
|
196
|
-
onSelect,
|
|
197
|
-
onCancel
|
|
198
|
-
}) => {
|
|
199
|
-
const { exit } = useApp();
|
|
200
|
-
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
|
|
201
|
-
/* @__PURE__ */ jsxs2(Text2, { children: [
|
|
202
|
-
"A global installation was found at ",
|
|
203
|
-
globalConfigDir
|
|
204
|
-
] }),
|
|
205
|
-
/* @__PURE__ */ jsx2(Text2, { children: " " }),
|
|
206
|
-
/* @__PURE__ */ jsx2(
|
|
207
|
-
SelectList,
|
|
208
|
-
{
|
|
209
|
-
items: GLOBAL_CONFIG_OPTIONS,
|
|
210
|
-
onSelect: (choice) => {
|
|
211
|
-
onSelect(choice);
|
|
212
|
-
exit();
|
|
213
|
-
},
|
|
214
|
-
onCancel: () => {
|
|
215
|
-
onCancel();
|
|
216
|
-
exit();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
),
|
|
220
|
-
/* @__PURE__ */ jsx2(Text2, { children: " " }),
|
|
221
|
-
/* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
|
|
222
|
-
" ",
|
|
223
|
-
KEY_LABEL_ARROWS_VERT,
|
|
224
|
-
" Navigate ",
|
|
225
|
-
" ",
|
|
226
|
-
KEY_LABEL_ENTER,
|
|
227
|
-
" Confirm ",
|
|
228
|
-
" ",
|
|
229
|
-
KEY_LABEL_ESC,
|
|
230
|
-
" Exit"
|
|
231
|
-
] })
|
|
232
|
-
] });
|
|
233
|
-
};
|
|
234
187
|
async function getDashboardData(projectDir) {
|
|
235
188
|
const [info, loaded] = await Promise.all([getInstallationInfo(), loadProjectConfig(projectDir)]);
|
|
236
189
|
const skillCount = loaded?.config?.skills?.length ?? 0;
|
|
@@ -315,43 +268,6 @@ var Init = class _Init extends BaseCommand {
|
|
|
315
268
|
}
|
|
316
269
|
return;
|
|
317
270
|
}
|
|
318
|
-
const globalInstallation = await detectGlobalInstallation();
|
|
319
|
-
if (globalInstallation) {
|
|
320
|
-
const globalConfigDir = path2.join(os.homedir(), CLAUDE_SRC_DIR);
|
|
321
|
-
if (process.stdin.isTTY) {
|
|
322
|
-
let globalChoice = null;
|
|
323
|
-
const { waitUntilExit: waitForPrompt } = render(
|
|
324
|
-
/* @__PURE__ */ jsx2(
|
|
325
|
-
GlobalConfigPrompt,
|
|
326
|
-
{
|
|
327
|
-
globalConfigDir,
|
|
328
|
-
onSelect: (choice) => {
|
|
329
|
-
globalChoice = choice;
|
|
330
|
-
},
|
|
331
|
-
onCancel: () => {
|
|
332
|
-
globalChoice = null;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
)
|
|
336
|
-
);
|
|
337
|
-
await waitForPrompt();
|
|
338
|
-
clearTerminalOutput();
|
|
339
|
-
if (globalChoice === "edit-global") {
|
|
340
|
-
const editArgs = [];
|
|
341
|
-
if (flags.source) {
|
|
342
|
-
editArgs.push("--source", flags.source);
|
|
343
|
-
}
|
|
344
|
-
if (flags.refresh) {
|
|
345
|
-
editArgs.push("--refresh");
|
|
346
|
-
}
|
|
347
|
-
await this.config.runCommand("edit", editArgs);
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
if (globalChoice === null) {
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
271
|
const isGlobalRoot = fs.realpathSync(projectDir) === fs.realpathSync(GLOBAL_INSTALL_ROOT);
|
|
356
272
|
if (!isGlobalRoot) {
|
|
357
273
|
const created = await ensureBlankGlobalConfig();
|
|
@@ -560,4 +476,4 @@ export {
|
|
|
560
476
|
showDashboard,
|
|
561
477
|
Init
|
|
562
478
|
};
|
|
563
|
-
//# sourceMappingURL=chunk-
|
|
479
|
+
//# sourceMappingURL=chunk-YZUAXX7F.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/init.tsx","../src/cli/lib/permission-checker.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render, Box, Text, useApp } from \"ink\";\nimport fs from \"fs\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n loadSkillsMatrixFromSource,\n getMarketplaceLabel,\n fetchMarketplace,\n type SourceLoadResult,\n} from \"../lib/loading/index.js\";\nimport {\n installLocal,\n installPluginConfig,\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 {\n claudePluginInstall,\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n} from \"../utils/exec.js\";\nimport {\n ASCII_LOGO,\n CLAUDE_SRC_DIR,\n CLI_BIN_NAME,\n DEFAULT_BRANDING,\n GLOBAL_INSTALL_ROOT,\n} from \"../consts.js\";\nimport { SelectList, type SelectListItem } from \"../components/common/select-list.js\";\nimport {\n KEY_LABEL_ARROWS_VERT,\n KEY_LABEL_ENTER,\n KEY_LABEL_ESC,\n} from \"../components/wizard/hotkeys.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { getSkillById } from \"../lib/matrix/matrix-provider\";\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\n/** Clears the visible terminal area so the next render starts clean. */\nfunction clearTerminalOutput(): void {\n process.stdout.write(\"\\x1b[2J\\x1b[H\");\n}\n\nconst DASHBOARD_OPTIONS: SelectListItem<string>[] = [\n { label: \"Edit\", value: \"edit\" },\n { label: \"Compile\", value: \"compile\" },\n { label: \"Doctor\", value: \"doctor\" },\n { label: \"List\", value: \"list\" },\n];\n\ntype DashboardProps = {\n onSelect: (command: string) => void;\n onCancel: () => void;\n};\n\nconst Dashboard: React.FC<DashboardProps> = ({ onSelect, onCancel }) => {\n const { exit } = useApp();\n\n return (\n <Box flexDirection=\"column\">\n <Text bold>{DEFAULT_BRANDING.NAME}</Text>\n <Text> </Text>\n <SelectList\n items={DASHBOARD_OPTIONS}\n onSelect={(command) => {\n onSelect(command);\n exit();\n }}\n onCancel={() => {\n onCancel();\n exit();\n }}\n />\n <Text> </Text>\n <Text dimColor>\n {\" \"}\n {KEY_LABEL_ARROWS_VERT} Navigate {\" \"}\n {KEY_LABEL_ENTER} Confirm {\" \"}\n {KEY_LABEL_ESC} Exit\n </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 onSelect={(command) => {\n selectedCommand = command;\n }}\n onCancel={() => {\n selectedCommand = null;\n }}\n />,\n );\n\n await waitUntilExit();\n clearTerminalOutput();\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 existingInstallation = await detectProjectInstallation(projectDir);\n\n if (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 // Auto-create blank global config on first init from a project directory.\n // This ensures the project config can always import from global.\n // Resolve both paths through realpathSync — on macOS /var is a symlink to\n // /private/var, so os.homedir() and process.cwd() can return different\n // prefixes for the same directory.\n const isGlobalRoot = fs.realpathSync(projectDir) === fs.realpathSync(GLOBAL_INSTALL_ROOT);\n if (!isGlobalRoot) {\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 version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n logo={ASCII_LOGO}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result;\n }}\n onCancel={() => {\n this.log(\"Setup cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n // TypeScript can't track that onComplete callback mutates wizardResult before waitUntilExit resolves\n const result = wizardResult as WizardResultV2 | null;\n\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 await this.installIndividualPlugins(result, sourceResult, flags, projectDir);\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 // Lazily resolve marketplace name if not already set (e.g. BUILT_IN_MATRIX skips fetch)\n if (!sourceResult.marketplace) {\n try {\n const marketplaceResult = await fetchMarketplace(sourceResult.sourceConfig.source, {});\n sourceResult.marketplace = marketplaceResult.marketplace.name;\n } catch {\n this.warn(\"Could not resolve marketplace. Falling back to Local Mode...\");\n await this.installLocalMode(result, sourceResult, flags, projectDir);\n return;\n }\n }\n\n // After lazy resolution, marketplace is guaranteed to be set (or we returned above)\n const marketplace = sourceResult.marketplace;\n\n const marketplaceExists = await claudePluginMarketplaceExists(marketplace);\n\n if (!marketplaceExists) {\n this.log(`Registering marketplace \"${marketplace}\"...`);\n try {\n const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n this.log(`Registered marketplace: ${marketplace}`);\n } catch (error) {\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\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}@${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 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 displayName = getSkillById(copiedSkill.skillId).displayName;\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;AAEA,SAAS,aAAa;AACtB,SAAS,QAAQ,OAAAA,MAAK,QAAAC,OAAM,cAAc;AAC1C,OAAO,QAAQ;;;ACJf;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,MAAM,KAAK,MAAM,OAAO;AAC9B,YAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,CAAC,MAAM,QAAQ,GAAG,GAAG;AAElE,gBAAM,yBAAyB;AAAA,YAC7B;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AACA;AAAA,YACE;AAAA,YACA;AAAA,YACA,kBAAkB,QAAQ;AAAA,UAC5B;AAAA,QACF;AACA,cAAM,SAAS,mBAAmB,UAAU,GAAG;AAC/C,cAAM,SAAuB,OAAO,UAAW,OAAO,OAAwB,CAAC;AAC/E,Y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AI,YAAY,cAAc,eAAe,MAAM;AAAA,CAA8B;AAEtF,WAAK,IAAI,GAAG,iBAAiB,YAAY;AAAA,CAAI;AAC7C,WAAK,IAAI,mBAAmB;AAC5B,WAAK,IAAI,KAAK,cAAc,SAAS,EAAE;AACvC,iBAAW,eAAe,cAAc,cAAc;AACpD,cAAM,cAAc,aAAa,YAAY,OAAO,EAAE;AACtD,aAAK,IAAI,OAAO,WAAW,GAAG;AAAA,MAChC;AACA,WAAK,IAAI,EAAE;AACX,WAAK,IAAI,qBAAqB;AAC9B,WAAK,IAAI,KAAK,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","jsx","jsxs","Box","Text","result"]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
compileAllAgentPlugins,
|
|
4
4
|
printAgentCompilationSummary
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-OINQ6OWM.js";
|
|
6
6
|
import {
|
|
7
7
|
compileAllSkillPlugins,
|
|
8
8
|
compileSkillPlugin,
|
|
9
9
|
printCompilationSummary
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-2EXAK22V.js";
|
|
11
11
|
import "../../chunk-RRBWNEG3.js";
|
|
12
12
|
import "../../chunk-NG2GGK6P.js";
|
|
13
13
|
import {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-OINQ6OWM.js";
|
|
5
5
|
import {
|
|
6
6
|
compileStackPlugin,
|
|
7
7
|
loadStacks,
|
|
8
8
|
printStackCompilationSummary
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2EXAK22V.js";
|
|
10
10
|
import "../../chunk-RRBWNEG3.js";
|
|
11
11
|
import "../../chunk-NG2GGK6P.js";
|
|
12
12
|
import {
|
package/dist/commands/compile.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions,
|
|
4
4
|
recompileAgents
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-OINQ6OWM.js";
|
|
6
6
|
import {
|
|
7
7
|
ERROR_MESSAGES,
|
|
8
8
|
INFO_MESSAGES,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
detectProjectInstallation,
|
|
14
14
|
discoverAllPluginSkills,
|
|
15
15
|
resolveSource
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-2EXAK22V.js";
|
|
17
17
|
import {
|
|
18
18
|
parseFrontmatter
|
|
19
19
|
} from "../chunk-RRBWNEG3.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigShow
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-XPRDNALD.js";
|
|
5
|
+
import "../../chunk-2EXAK22V.js";
|
|
6
6
|
import "../../chunk-RRBWNEG3.js";
|
|
7
7
|
import "../../chunk-NG2GGK6P.js";
|
|
8
8
|
import "../../chunk-IJLAVOKZ.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigShow
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-XPRDNALD.js";
|
|
5
|
+
import "../../chunk-2EXAK22V.js";
|
|
6
6
|
import "../../chunk-RRBWNEG3.js";
|
|
7
7
|
import "../../chunk-NG2GGK6P.js";
|
|
8
8
|
import "../../chunk-IJLAVOKZ.js";
|
package/dist/commands/diff.js
CHANGED
package/dist/commands/doctor.js
CHANGED
package/dist/commands/edit.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
Wizard
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-YDBVG6RF.js";
|
|
5
|
+
import "../chunk-FW5C245M.js";
|
|
6
6
|
import "../chunk-SXGBPQY6.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-M5IAGR5Z.js";
|
|
8
|
+
import "../chunk-VYHRCFMD.js";
|
|
9
9
|
import "../chunk-HGTC76BX.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-VIVOJASC.js";
|
|
11
|
+
import "../chunk-VILTRTBT.js";
|
|
12
|
+
import "../chunk-NDKIFVR4.js";
|
|
13
|
+
import "../chunk-C6YLN4AW.js";
|
|
14
14
|
import "../chunk-K77I4XGL.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-PN65K3LH.js";
|
|
16
16
|
import "../chunk-MWGDG4QN.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-TPXDHJDB.js";
|
|
18
18
|
import "../chunk-7SOPVGDV.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-UFKDY45I.js";
|
|
20
|
+
import "../chunk-X6LXHVA6.js";
|
|
21
21
|
import "../chunk-GG4BSB6S.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-IYA5PSXU.js";
|
|
23
23
|
import "../chunk-LVNNP7T4.js";
|
|
24
24
|
import "../chunk-OV5UJWS5.js";
|
|
25
25
|
import "../chunk-XMLCXRTS.js";
|
|
26
26
|
import "../chunk-AQYAVLZK.js";
|
|
27
27
|
import "../chunk-AUNBGZS4.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-NA6I5P5P.js";
|
|
29
29
|
import "../chunk-WF5PMBIR.js";
|
|
30
30
|
import "../chunk-KUV24B5M.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-PUZLP4SL.js";
|
|
32
32
|
import "../chunk-T5DJCIUP.js";
|
|
33
33
|
import "../chunk-U3IGFMCY.js";
|
|
34
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-CBYRFAUN.js";
|
|
35
35
|
import {
|
|
36
36
|
getAgentDefinitions,
|
|
37
37
|
recompileAgents
|
|
38
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-OINQ6OWM.js";
|
|
39
39
|
import {
|
|
40
40
|
ERROR_MESSAGES,
|
|
41
41
|
INFO_MESSAGES,
|
|
@@ -52,13 +52,14 @@ import {
|
|
|
52
52
|
detectInstallation,
|
|
53
53
|
detectMigrations,
|
|
54
54
|
discoverAllPluginSkills,
|
|
55
|
+
ensureBlankGlobalConfig,
|
|
55
56
|
executeMigration,
|
|
56
57
|
getMarketplaceLabel,
|
|
57
58
|
loadProjectConfig,
|
|
58
59
|
loadSkillsMatrixFromSource,
|
|
59
60
|
migrateLocalSkillScope,
|
|
60
61
|
writeScopedConfigs
|
|
61
|
-
} from "../chunk-
|
|
62
|
+
} from "../chunk-2EXAK22V.js";
|
|
62
63
|
import {
|
|
63
64
|
loadAllAgents
|
|
64
65
|
} from "../chunk-RRBWNEG3.js";
|
|
@@ -79,10 +80,13 @@ import {
|
|
|
79
80
|
} from "../chunk-4CRWKTNQ.js";
|
|
80
81
|
import "../chunk-SRIH4U5Y.js";
|
|
81
82
|
import {
|
|
83
|
+
CLAUDE_DIR,
|
|
84
|
+
CLAUDE_SRC_DIR,
|
|
82
85
|
CLI_BIN_NAME,
|
|
83
86
|
GLOBAL_INSTALL_ROOT,
|
|
84
87
|
PROJECT_ROOT,
|
|
85
|
-
SOURCE_DISPLAY_NAMES
|
|
88
|
+
SOURCE_DISPLAY_NAMES,
|
|
89
|
+
STANDARD_FILES
|
|
86
90
|
} from "../chunk-EGMQ3SXN.js";
|
|
87
91
|
import "../chunk-NKKYTCBH.js";
|
|
88
92
|
import {
|
|
@@ -92,6 +96,7 @@ import {
|
|
|
92
96
|
// src/cli/commands/edit.tsx
|
|
93
97
|
init_esm_shims();
|
|
94
98
|
import os from "os";
|
|
99
|
+
import path from "path";
|
|
95
100
|
import { Flags } from "@oclif/core";
|
|
96
101
|
import { render } from "ink";
|
|
97
102
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -127,6 +132,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
127
132
|
};
|
|
128
133
|
async run() {
|
|
129
134
|
const { flags } = await this.parse(_Edit);
|
|
135
|
+
const cwd = process.cwd();
|
|
130
136
|
const installation = await detectInstallation();
|
|
131
137
|
if (!installation) {
|
|
132
138
|
this.error(ERROR_MESSAGES.NO_INSTALLATION, {
|
|
@@ -135,12 +141,6 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
135
141
|
}
|
|
136
142
|
const projectDir = installation.projectDir;
|
|
137
143
|
enableBuffering();
|
|
138
|
-
if (installation.projectDir === os.homedir()) {
|
|
139
|
-
pushBufferMessage(
|
|
140
|
-
"info",
|
|
141
|
-
"No project installation found. Using global installation from ~/.claude-src/"
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
144
|
let sourceResult;
|
|
145
145
|
let startupMessages = [];
|
|
146
146
|
try {
|
|
@@ -177,7 +177,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
177
177
|
disableBuffering();
|
|
178
178
|
let wizardResult = null;
|
|
179
179
|
const marketplaceLabel = getMarketplaceLabel(sourceResult);
|
|
180
|
-
const isGlobalDir =
|
|
180
|
+
const isGlobalDir = cwd === GLOBAL_INSTALL_ROOT;
|
|
181
181
|
const lockedSkillIds = isGlobalDir ? void 0 : projectConfig?.config?.skills?.filter((s) => s.scope === "global").map((s) => s.id);
|
|
182
182
|
const lockedAgentNames = isGlobalDir ? void 0 : projectConfig?.config?.agents?.filter((a) => a.scope === "global").map((a) => a.name);
|
|
183
183
|
const { waitUntilExit } = render(
|
|
@@ -300,7 +300,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
300
300
|
this.log(` - ${migration.id}`);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
const migrationResult = await executeMigration(migrationPlan,
|
|
303
|
+
const migrationResult = await executeMigration(migrationPlan, cwd, sourceResult);
|
|
304
304
|
for (const warning of migrationResult.warnings) {
|
|
305
305
|
this.warn(warning);
|
|
306
306
|
}
|
|
@@ -312,14 +312,14 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
312
312
|
for (const [skillId, change] of scopeChanges) {
|
|
313
313
|
const skillConfig = result.skills.find((s) => s.id === skillId);
|
|
314
314
|
if (skillConfig?.source === "local") {
|
|
315
|
-
await migrateLocalSkillScope(skillId, change.from,
|
|
315
|
+
await migrateLocalSkillScope(skillId, change.from, cwd);
|
|
316
316
|
} else if (sourceResult.marketplace && skillConfig) {
|
|
317
317
|
const oldPluginScope = change.from === "global" ? "user" : "project";
|
|
318
318
|
const newPluginScope = change.to === "global" ? "user" : "project";
|
|
319
319
|
try {
|
|
320
|
-
await claudePluginUninstall(skillId, oldPluginScope,
|
|
320
|
+
await claudePluginUninstall(skillId, oldPluginScope, cwd);
|
|
321
321
|
const pluginRef = `${skillId}@${sourceResult.marketplace}`;
|
|
322
|
-
await claudePluginInstall(pluginRef, newPluginScope,
|
|
322
|
+
await claudePluginInstall(pluginRef, newPluginScope, cwd);
|
|
323
323
|
} catch (error) {
|
|
324
324
|
this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);
|
|
325
325
|
}
|
|
@@ -330,7 +330,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
330
330
|
continue;
|
|
331
331
|
}
|
|
332
332
|
if (change.from === "local") {
|
|
333
|
-
await deleteLocalSkill(
|
|
333
|
+
await deleteLocalSkill(cwd, skillId);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
if (sourceResult.marketplace) {
|
|
@@ -348,7 +348,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
348
348
|
const pluginScope = skillConfig.scope === "global" ? "user" : "project";
|
|
349
349
|
this.log(`Installing plugin: ${pluginRef}...`);
|
|
350
350
|
try {
|
|
351
|
-
await claudePluginInstall(pluginRef, pluginScope,
|
|
351
|
+
await claudePluginInstall(pluginRef, pluginScope, cwd);
|
|
352
352
|
} catch (error) {
|
|
353
353
|
this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);
|
|
354
354
|
}
|
|
@@ -358,7 +358,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
358
358
|
const pluginScope = oldSkill?.scope === "global" ? "user" : "project";
|
|
359
359
|
this.log(`Uninstalling plugin: ${skillId}...`);
|
|
360
360
|
try {
|
|
361
|
-
await claudePluginUninstall(skillId, pluginScope,
|
|
361
|
+
await claudePluginUninstall(skillId, pluginScope, cwd);
|
|
362
362
|
} catch (error) {
|
|
363
363
|
this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);
|
|
364
364
|
}
|
|
@@ -378,30 +378,37 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
378
378
|
this.handleError(error);
|
|
379
379
|
}
|
|
380
380
|
try {
|
|
381
|
-
const mergeResult = await buildAndMergeConfig(result, sourceResult,
|
|
381
|
+
const mergeResult = await buildAndMergeConfig(result, sourceResult, cwd, flags.source);
|
|
382
382
|
const cliAgents = await loadAllAgents(PROJECT_ROOT);
|
|
383
383
|
const sourceAgents = await loadAllAgents(sourcePath);
|
|
384
384
|
const agents = { ...cliAgents, ...sourceAgents };
|
|
385
|
+
if (cwd !== os.homedir()) {
|
|
386
|
+
await ensureBlankGlobalConfig();
|
|
387
|
+
}
|
|
388
|
+
const configPath = path.join(cwd, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_TS);
|
|
389
|
+
const projectInstallationExists = path.resolve(installation.projectDir) !== path.resolve(os.homedir());
|
|
385
390
|
await writeScopedConfigs(
|
|
386
391
|
mergeResult.config,
|
|
387
392
|
sourceResult.matrix,
|
|
388
393
|
agents,
|
|
389
|
-
|
|
390
|
-
|
|
394
|
+
cwd,
|
|
395
|
+
configPath,
|
|
396
|
+
projectInstallationExists
|
|
391
397
|
);
|
|
392
398
|
} catch (error) {
|
|
393
399
|
this.warn(`Could not update config: ${getErrorMessage(error)}`);
|
|
394
400
|
}
|
|
395
401
|
this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);
|
|
396
402
|
try {
|
|
397
|
-
const recompileSkills = await discoverAllPluginSkills(
|
|
403
|
+
const recompileSkills = await discoverAllPluginSkills(cwd);
|
|
398
404
|
const agentScopeMap = new Map(result.agentConfigs.map((a) => [a.name, a.scope]));
|
|
405
|
+
const outputDir = path.join(cwd, CLAUDE_DIR, "agents");
|
|
399
406
|
const recompileResult = await recompileAgents({
|
|
400
|
-
pluginDir:
|
|
407
|
+
pluginDir: cwd,
|
|
401
408
|
sourcePath,
|
|
402
409
|
skills: recompileSkills,
|
|
403
|
-
projectDir,
|
|
404
|
-
outputDir
|
|
410
|
+
projectDir: cwd,
|
|
411
|
+
outputDir,
|
|
405
412
|
installMode: deriveInstallMode(result.skills),
|
|
406
413
|
agentScopeMap
|
|
407
414
|
});
|