@agents-inc/cli 0.77.0 → 0.78.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 +10 -0
- package/dist/{chunk-ZIZFTSQY.js → chunk-7HGMFJ4Y.js} +2 -2
- package/dist/{chunk-R6QNVMN5.js → chunk-B4C2S5LP.js} +11 -11
- package/dist/{chunk-R6QNVMN5.js.map → chunk-B4C2S5LP.js.map} +1 -1
- package/dist/{chunk-B66E255O.js → chunk-D4T3HHE7.js} +3 -3
- package/dist/chunk-D4T3HHE7.js.map +1 -0
- package/dist/{chunk-KMLJCO5H.js → chunk-F4IZ3UAS.js} +15 -21
- package/dist/chunk-F4IZ3UAS.js.map +1 -0
- package/dist/{chunk-XU6N3OIS.js → chunk-HANGA633.js} +2 -6
- package/dist/{chunk-XU6N3OIS.js.map → chunk-HANGA633.js.map} +1 -1
- package/dist/{chunk-2I5SXGXR.js → chunk-KQDGLEBF.js} +80 -5
- package/dist/chunk-KQDGLEBF.js.map +1 -0
- package/dist/{chunk-G3YSDQJ2.js → chunk-KVRR4PEJ.js} +46 -37
- package/dist/chunk-KVRR4PEJ.js.map +1 -0
- package/dist/{chunk-J5OOAKB5.js → chunk-LVBRC2CP.js} +1 -5
- package/dist/chunk-LVBRC2CP.js.map +1 -0
- package/dist/chunk-N2XGUAJU.js +34 -0
- package/dist/{chunk-KB57OPUL.js.map → chunk-N2XGUAJU.js.map} +1 -1
- package/dist/{chunk-CY23HPDE.js → chunk-N34D3ROY.js} +10 -11
- package/dist/chunk-N34D3ROY.js.map +1 -0
- package/dist/{chunk-PDYKGJGR.js → chunk-NKLNT7N7.js} +3 -20
- package/dist/chunk-NKLNT7N7.js.map +1 -0
- package/dist/{chunk-CZLXZ75E.js → chunk-OIHZ2YH3.js} +107 -69
- package/dist/chunk-OIHZ2YH3.js.map +1 -0
- package/dist/{chunk-SGKNE6EJ.js → chunk-OOWNDQCG.js} +2 -2
- package/dist/{chunk-WMTYOK4E.js → chunk-OTMIGYBB.js} +48 -6
- package/dist/chunk-OTMIGYBB.js.map +1 -0
- package/dist/chunk-PZERKWE2.js +114 -0
- package/dist/chunk-PZERKWE2.js.map +1 -0
- package/dist/{chunk-N4KD5PBX.js → chunk-Q755X6QF.js} +2 -2
- package/dist/{chunk-AQ5KP4YW.js → chunk-QD3GQ2CH.js} +3 -3
- package/dist/{chunk-ERHTXNIF.js → chunk-RU5XLS5Q.js} +1 -5
- package/dist/{chunk-ERHTXNIF.js.map → chunk-RU5XLS5Q.js.map} +1 -1
- package/dist/{chunk-UZHD4DBD.js → chunk-SJNUTUSJ.js} +2 -2
- package/dist/{chunk-5DDHCCEB.js → chunk-VDVLM3KB.js} +42 -4
- package/dist/chunk-VDVLM3KB.js.map +1 -0
- package/dist/{chunk-CTZ4GEAD.js → chunk-W46L2PXK.js} +17 -8
- package/dist/chunk-W46L2PXK.js.map +1 -0
- package/dist/{chunk-A6XMJT2Q.js → chunk-YFHVP3VA.js} +3 -10
- package/dist/chunk-YFHVP3VA.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 +32 -16
- package/dist/commands/compile.js.map +1 -1
- 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 +29 -9
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +18 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +37 -27
- 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 +12 -4
- package/dist/commands/outdated.js.map +1 -1
- package/dist/commands/search.js +1 -1
- package/dist/commands/uninstall.js +9 -21
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +20 -10
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +1 -1
- package/dist/components/wizard/category-grid.js +1 -1
- package/dist/components/wizard/category-grid.test.js +3 -3
- package/dist/components/wizard/checkbox-grid.js +1 -2
- package/dist/components/wizard/checkbox-grid.test.js +2 -4
- package/dist/components/wizard/checkbox-grid.test.js.map +1 -1
- package/dist/components/wizard/domain-selection.js +4 -5
- package/dist/components/wizard/source-grid.js +1 -1
- package/dist/components/wizard/source-grid.test.js +3 -3
- package/dist/components/wizard/stack-selection.js +3 -3
- package/dist/components/wizard/stats-panel.js +12 -0
- package/dist/components/wizard/step-agents.js +3 -4
- package/dist/components/wizard/step-agents.test.js +7 -6
- package/dist/components/wizard/step-agents.test.js.map +1 -1
- package/dist/components/wizard/step-build.js +5 -6
- package/dist/components/wizard/step-build.test.js +23 -23
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +1 -3
- package/dist/components/wizard/step-confirm.test.js +17 -16
- package/dist/components/wizard/step-confirm.test.js.map +1 -1
- package/dist/components/wizard/step-refine.js +1 -2
- package/dist/components/wizard/step-refine.test.js +1 -2
- package/dist/components/wizard/step-refine.test.js.map +1 -1
- package/dist/components/wizard/step-settings.js +2 -3
- package/dist/components/wizard/step-settings.test.js +8 -9
- package/dist/components/wizard/step-settings.test.js.map +1 -1
- package/dist/components/wizard/step-sources.js +4 -5
- package/dist/components/wizard/step-sources.test.js +7 -9
- package/dist/components/wizard/step-sources.test.js.map +1 -1
- package/dist/components/wizard/step-stack.js +6 -7
- package/dist/components/wizard/step-stack.test.js +16 -15
- package/dist/components/wizard/step-stack.test.js.map +1 -1
- package/dist/components/wizard/view-title.js +21 -3
- package/dist/components/wizard/view-title.js.map +1 -1
- package/dist/components/wizard/wizard-layout.js +5 -4
- package/dist/components/wizard/wizard-tabs.js +1 -1
- package/dist/components/wizard/wizard-tabs.test.js +1 -1
- package/dist/components/wizard/wizard.js +17 -17
- package/dist/hooks/init.js +18 -18
- package/dist/{source-loader-H3QLG5AE.js → source-loader-D3VIG3GM.js} +2 -2
- package/dist/{source-manager-ZDBUHGIR.js → source-manager-FPYFJRR7.js} +2 -2
- package/dist/source-manager-FPYFJRR7.js.map +1 -0
- package/dist/stores/wizard-store.js +2 -2
- package/dist/stores/wizard-store.test.js +4 -4
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2I5SXGXR.js.map +0 -1
- package/dist/chunk-5DDHCCEB.js.map +0 -1
- package/dist/chunk-A6XMJT2Q.js.map +0 -1
- package/dist/chunk-B66E255O.js.map +0 -1
- package/dist/chunk-CTZ4GEAD.js.map +0 -1
- package/dist/chunk-CY23HPDE.js.map +0 -1
- package/dist/chunk-CZLXZ75E.js.map +0 -1
- package/dist/chunk-G3YSDQJ2.js.map +0 -1
- package/dist/chunk-J5OOAKB5.js.map +0 -1
- package/dist/chunk-JNQKCZA3.js +0 -28
- package/dist/chunk-JNQKCZA3.js.map +0 -1
- package/dist/chunk-KB57OPUL.js +0 -40
- package/dist/chunk-KMLJCO5H.js.map +0 -1
- package/dist/chunk-PDYKGJGR.js.map +0 -1
- package/dist/chunk-WMTYOK4E.js.map +0 -1
- /package/dist/{chunk-ZIZFTSQY.js.map → chunk-7HGMFJ4Y.js.map} +0 -0
- /package/dist/{chunk-SGKNE6EJ.js.map → chunk-OOWNDQCG.js.map} +0 -0
- /package/dist/{chunk-N4KD5PBX.js.map → chunk-Q755X6QF.js.map} +0 -0
- /package/dist/{chunk-AQ5KP4YW.js.map → chunk-QD3GQ2CH.js.map} +0 -0
- /package/dist/{chunk-UZHD4DBD.js.map → chunk-SJNUTUSJ.js.map} +0 -0
- /package/dist/{source-loader-H3QLG5AE.js.map → components/wizard/stats-panel.js.map} +0 -0
- /package/dist/{source-manager-ZDBUHGIR.js.map → source-loader-D3VIG3GM.js.map} +0 -0
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
|
|
102
102
|
// src/cli/lib/loading/source-loader.ts
|
|
103
103
|
init_esm_shims();
|
|
104
|
-
import
|
|
104
|
+
import os11 from "os";
|
|
105
105
|
import path28 from "path";
|
|
106
106
|
|
|
107
107
|
// src/cli/lib/metadata-keys.ts
|
|
@@ -580,12 +580,26 @@ function splitConfigByScope(config) {
|
|
|
580
580
|
const projectSkills = config.skills.filter((s) => s.scope === "project");
|
|
581
581
|
const globalAgents = config.agents.filter((a) => a.scope === "global");
|
|
582
582
|
const projectAgents = config.agents.filter((a) => a.scope === "project");
|
|
583
|
+
const globalSkillIds = new Set(globalSkills.map((s) => s.id));
|
|
583
584
|
const globalStack = {};
|
|
584
585
|
const projectStack = {};
|
|
585
586
|
if (config.stack) {
|
|
586
587
|
for (const agent of globalAgents) {
|
|
587
|
-
|
|
588
|
-
|
|
588
|
+
const agentStack = config.stack[agent.name];
|
|
589
|
+
if (agentStack) {
|
|
590
|
+
const filtered = {};
|
|
591
|
+
for (const [category, assignments] of typedEntries(
|
|
592
|
+
agentStack
|
|
593
|
+
)) {
|
|
594
|
+
if (!assignments) continue;
|
|
595
|
+
const globalOnly = assignments.filter((a) => globalSkillIds.has(a.id));
|
|
596
|
+
if (globalOnly.length > 0) {
|
|
597
|
+
filtered[category] = globalOnly;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
if (typedKeys(filtered).length > 0) {
|
|
601
|
+
globalStack[agent.name] = filtered;
|
|
602
|
+
}
|
|
589
603
|
}
|
|
590
604
|
}
|
|
591
605
|
for (const agent of projectAgents) {
|
|
@@ -597,29 +611,23 @@ function splitConfigByScope(config) {
|
|
|
597
611
|
const globalAgentNames = new Set(globalAgents.map((a) => a.name));
|
|
598
612
|
const globalSelectedAgents = config.selectedAgents?.filter((a) => globalAgentNames.has(a)) ?? [];
|
|
599
613
|
const projectSelectedAgents = config.selectedAgents?.filter((a) => !globalAgentNames.has(a)) ?? [];
|
|
600
|
-
const globalDomains = config.domains ?? [];
|
|
601
|
-
const globalDomainSet = new Set(globalDomains);
|
|
602
|
-
const projectOnlyDomains = (config.domains ?? []).filter((d) => !globalDomainSet.has(d));
|
|
603
614
|
const globalConfig = {
|
|
615
|
+
...config,
|
|
604
616
|
name: "global",
|
|
605
617
|
agents: globalAgents,
|
|
606
618
|
skills: globalSkills,
|
|
607
|
-
...Object.keys(globalStack).length > 0
|
|
608
|
-
|
|
609
|
-
|
|
619
|
+
...Object.keys(globalStack).length > 0 ? { stack: globalStack } : { stack: void 0 },
|
|
620
|
+
domains: config.domains,
|
|
621
|
+
selectedAgents: globalSelectedAgents.length > 0 ? globalSelectedAgents : void 0
|
|
610
622
|
};
|
|
611
623
|
const projectConfig = {
|
|
624
|
+
...config,
|
|
612
625
|
name: config.name,
|
|
613
626
|
agents: projectAgents,
|
|
614
627
|
skills: projectSkills,
|
|
615
|
-
...Object.keys(projectStack).length > 0
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
...config.source && { source: config.source },
|
|
619
|
-
...config.marketplace && { marketplace: config.marketplace },
|
|
620
|
-
...config.agentsSource && { agentsSource: config.agentsSource },
|
|
621
|
-
...projectOnlyDomains.length > 0 && { domains: projectOnlyDomains },
|
|
622
|
-
...projectSelectedAgents.length > 0 && { selectedAgents: projectSelectedAgents }
|
|
628
|
+
...Object.keys(projectStack).length > 0 ? { stack: projectStack } : { stack: void 0 },
|
|
629
|
+
domains: void 0,
|
|
630
|
+
selectedAgents: projectSelectedAgents.length > 0 ? projectSelectedAgents : void 0
|
|
623
631
|
};
|
|
624
632
|
return { global: globalConfig, project: projectConfig };
|
|
625
633
|
}
|
|
@@ -807,13 +815,17 @@ function mergeConfigs(newConfig, existingConfig) {
|
|
|
807
815
|
if (existingConfig.description) {
|
|
808
816
|
merged.description = existingConfig.description;
|
|
809
817
|
}
|
|
810
|
-
if (existingConfig.source) {
|
|
818
|
+
if (existingConfig.source && !newConfig.source) {
|
|
811
819
|
merged.source = existingConfig.source;
|
|
812
820
|
}
|
|
813
821
|
if (existingConfig.agents && existingConfig.agents.length > 0) {
|
|
822
|
+
const newAgentsByName = indexBy(merged.agents, (a) => a.name);
|
|
814
823
|
const existingNames = new Set(existingConfig.agents.map((a) => a.name));
|
|
815
|
-
const
|
|
816
|
-
|
|
824
|
+
const updatedExisting = existingConfig.agents.map(
|
|
825
|
+
(existing) => newAgentsByName[existing.name] ?? existing
|
|
826
|
+
);
|
|
827
|
+
const addedAgents = merged.agents.filter((a) => !existingNames.has(a.name));
|
|
828
|
+
merged.agents = [...updatedExisting, ...addedAgents];
|
|
817
829
|
}
|
|
818
830
|
if (existingConfig.skills && existingConfig.skills.length > 0) {
|
|
819
831
|
const newSkillsById = indexBy(merged.skills, (s) => s.id);
|
|
@@ -984,7 +996,7 @@ function loadConfigTypesDataInBackground(sourceFlag, projectDir) {
|
|
|
984
996
|
if (!await directoryExists(claudeSrcDir)) {
|
|
985
997
|
throw new Error(`${CLAUDE_SRC_DIR}/ not found \u2014 run '${CLI_BIN_NAME} init' first`);
|
|
986
998
|
}
|
|
987
|
-
const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-
|
|
999
|
+
const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-D3VIG3GM.js");
|
|
988
1000
|
const { loadAllAgents: loadAllAgents2 } = await import("./loader-JMOO2A7C.js");
|
|
989
1001
|
const sourceResult = await loadSkillsMatrixFromSource2({
|
|
990
1002
|
sourceFlag,
|
|
@@ -1041,7 +1053,7 @@ function generateConfigTypesSource(matrix2, agentNames, customAgentNames = [], e
|
|
|
1041
1053
|
const configCategories = deriveCategories(configSkillIds, matrix2);
|
|
1042
1054
|
categories = unique2([...configCategories, ...extraCategoriesArr]).sort();
|
|
1043
1055
|
const configDomains = deriveDomains(categories, matrix2);
|
|
1044
|
-
domains = unique2([...configDomains, ...extraDomainsArr]).sort();
|
|
1056
|
+
domains = unique2([...configDomains, ...config.domains ?? [], ...extraDomainsArr]).sort();
|
|
1045
1057
|
} else {
|
|
1046
1058
|
skillIds = unique2([...typedKeys(matrix2.skills), ...extraSkillIds]).sort();
|
|
1047
1059
|
sortedAgents = unique2([...agentNames, ...extraAgentNamesArr]).sort();
|
|
@@ -2483,20 +2495,13 @@ async function detectProjectInstallation(projectDir) {
|
|
|
2483
2495
|
}
|
|
2484
2496
|
const loaded = await loadProjectConfigFromDir(projectDir);
|
|
2485
2497
|
const mode = deriveInstallMode(loaded?.config?.skills ?? []);
|
|
2486
|
-
if (mode === "local") {
|
|
2487
|
-
return {
|
|
2488
|
-
mode: "local",
|
|
2489
|
-
configPath,
|
|
2490
|
-
agentsDir: path12.join(projectDir, CLAUDE_DIR, "agents"),
|
|
2491
|
-
skillsDir: path12.join(projectDir, CLAUDE_DIR, "skills"),
|
|
2492
|
-
projectDir
|
|
2493
|
-
};
|
|
2494
|
-
}
|
|
2495
2498
|
return {
|
|
2496
|
-
mode
|
|
2499
|
+
mode,
|
|
2497
2500
|
configPath,
|
|
2498
2501
|
agentsDir: path12.join(projectDir, CLAUDE_DIR, "agents"),
|
|
2499
|
-
|
|
2502
|
+
// Mixed mode has local skills in .claude/skills/ and plugins in cache;
|
|
2503
|
+
// use .claude/skills/ as the primary skillsDir (same as local mode)
|
|
2504
|
+
skillsDir: path12.join(projectDir, CLAUDE_DIR, mode === "plugin" ? PLUGINS_SUBDIR : "skills"),
|
|
2500
2505
|
projectDir
|
|
2501
2506
|
};
|
|
2502
2507
|
}
|
|
@@ -2508,20 +2513,11 @@ async function detectGlobalInstallation() {
|
|
|
2508
2513
|
}
|
|
2509
2514
|
const loaded = await loadProjectConfigFromDir(homeDir);
|
|
2510
2515
|
const mode = deriveInstallMode(loaded?.config?.skills ?? []);
|
|
2511
|
-
if (mode === "local") {
|
|
2512
|
-
return {
|
|
2513
|
-
mode: "local",
|
|
2514
|
-
configPath,
|
|
2515
|
-
agentsDir: path12.join(homeDir, CLAUDE_DIR, "agents"),
|
|
2516
|
-
skillsDir: path12.join(homeDir, CLAUDE_DIR, "skills"),
|
|
2517
|
-
projectDir: homeDir
|
|
2518
|
-
};
|
|
2519
|
-
}
|
|
2520
2516
|
return {
|
|
2521
|
-
mode
|
|
2517
|
+
mode,
|
|
2522
2518
|
configPath,
|
|
2523
2519
|
agentsDir: path12.join(homeDir, CLAUDE_DIR, "agents"),
|
|
2524
|
-
skillsDir: path12.join(homeDir, CLAUDE_DIR, PLUGINS_SUBDIR),
|
|
2520
|
+
skillsDir: path12.join(homeDir, CLAUDE_DIR, mode === "plugin" ? PLUGINS_SUBDIR : "skills"),
|
|
2525
2521
|
projectDir: homeDir
|
|
2526
2522
|
};
|
|
2527
2523
|
}
|
|
@@ -3639,6 +3635,20 @@ async function claudePluginMarketplaceAdd(source) {
|
|
|
3639
3635
|
throw new Error(`Failed to add marketplace: ${errorMessage.trim()}`);
|
|
3640
3636
|
}
|
|
3641
3637
|
}
|
|
3638
|
+
async function claudePluginMarketplaceUpdate(name) {
|
|
3639
|
+
validatePluginName(name);
|
|
3640
|
+
const args = ["plugin", "marketplace", "update", name];
|
|
3641
|
+
let result;
|
|
3642
|
+
try {
|
|
3643
|
+
result = await execCommand("claude", args, {});
|
|
3644
|
+
} catch (err) {
|
|
3645
|
+
throw new Error(`Failed to update marketplace: ${getErrorMessage(err)}`);
|
|
3646
|
+
}
|
|
3647
|
+
if (result.exitCode !== 0) {
|
|
3648
|
+
const errorMessage = result.stderr || result.stdout || "Unknown error";
|
|
3649
|
+
throw new Error(`Failed to update marketplace: ${errorMessage.trim()}`);
|
|
3650
|
+
}
|
|
3651
|
+
}
|
|
3642
3652
|
async function claudePluginUninstall(pluginName, scope, projectDir) {
|
|
3643
3653
|
validatePluginName(pluginName);
|
|
3644
3654
|
const cwd = resolvePluginCwd(scope, projectDir);
|
|
@@ -3667,11 +3677,11 @@ async function prepareDirectories(paths) {
|
|
|
3667
3677
|
await ensureDir(paths.agentsDir);
|
|
3668
3678
|
await ensureDir(path20.dirname(paths.configPath));
|
|
3669
3679
|
}
|
|
3670
|
-
async function deleteAndCopySkills(skills, sourceResult,
|
|
3680
|
+
async function deleteAndCopySkills(skills, sourceResult, baseDir, skillsDir) {
|
|
3671
3681
|
for (const skill of skills) {
|
|
3672
3682
|
if (skill.source && skill.source !== "local") {
|
|
3673
3683
|
verbose(`Using alternate source '${skill.source}' for ${skill.id}`);
|
|
3674
|
-
await deleteLocalSkill(
|
|
3684
|
+
await deleteLocalSkill(baseDir, skill.id);
|
|
3675
3685
|
}
|
|
3676
3686
|
}
|
|
3677
3687
|
const skillIds = skills.map((s) => s.id);
|
|
@@ -3988,7 +3998,7 @@ async function installLocal(options) {
|
|
|
3988
3998
|
}
|
|
3989
3999
|
await ensureDir(globalPaths.skillsDir);
|
|
3990
4000
|
const projectCopied = projectSkills.length > 0 ? await deleteAndCopySkills(projectSkills, sourceResult, projectDir, projectPaths.skillsDir) : [];
|
|
3991
|
-
const globalCopied = globalSkills.length > 0 ? await deleteAndCopySkills(globalSkills, sourceResult,
|
|
4001
|
+
const globalCopied = globalSkills.length > 0 ? await deleteAndCopySkills(globalSkills, sourceResult, os8.homedir(), globalPaths.skillsDir) : [];
|
|
3992
4002
|
const copiedSkills = [...projectCopied, ...globalCopied];
|
|
3993
4003
|
const localSkillsForResolution = buildLocalSkillsMap(copiedSkills);
|
|
3994
4004
|
const agents = await loadMergedAgents(sourceResult.sourcePath);
|
|
@@ -4033,6 +4043,7 @@ async function installLocal(options) {
|
|
|
4033
4043
|
|
|
4034
4044
|
// src/cli/lib/installation/mode-migrator.ts
|
|
4035
4045
|
init_esm_shims();
|
|
4046
|
+
import os9 from "os";
|
|
4036
4047
|
import path21 from "path";
|
|
4037
4048
|
function detectMigrations(oldSkills, newSkills) {
|
|
4038
4049
|
const toLocal = [];
|
|
@@ -4068,16 +4079,31 @@ async function executeMigration(plan, projectDir, sourceResult) {
|
|
|
4068
4079
|
const pluginizedSkills = [];
|
|
4069
4080
|
if (plan.toLocal.length > 0) {
|
|
4070
4081
|
try {
|
|
4071
|
-
const
|
|
4072
|
-
const
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4082
|
+
const projectMigrations = plan.toLocal.filter((m) => m.newScope !== "global");
|
|
4083
|
+
const globalMigrations = plan.toLocal.filter((m) => m.newScope === "global");
|
|
4084
|
+
if (projectMigrations.length > 0) {
|
|
4085
|
+
const projectSkillsDir = path21.join(projectDir, LOCAL_SKILLS_PATH);
|
|
4086
|
+
const copied = await copySkillsToLocalFlattened(
|
|
4087
|
+
projectMigrations.map((m) => m.id),
|
|
4088
|
+
projectSkillsDir,
|
|
4089
|
+
sourceResult.matrix,
|
|
4090
|
+
sourceResult
|
|
4091
|
+
);
|
|
4092
|
+
for (const skill of copied) {
|
|
4093
|
+
localizedSkills.push(skill.skillId);
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
if (globalMigrations.length > 0) {
|
|
4097
|
+
const globalSkillsDir = path21.join(os9.homedir(), LOCAL_SKILLS_PATH);
|
|
4098
|
+
const copied = await copySkillsToLocalFlattened(
|
|
4099
|
+
globalMigrations.map((m) => m.id),
|
|
4100
|
+
globalSkillsDir,
|
|
4101
|
+
sourceResult.matrix,
|
|
4102
|
+
sourceResult
|
|
4103
|
+
);
|
|
4104
|
+
for (const skill of copied) {
|
|
4105
|
+
localizedSkills.push(skill.skillId);
|
|
4106
|
+
}
|
|
4081
4107
|
}
|
|
4082
4108
|
for (const migration of plan.toLocal) {
|
|
4083
4109
|
try {
|
|
@@ -4096,7 +4122,8 @@ async function executeMigration(plan, projectDir, sourceResult) {
|
|
|
4096
4122
|
}
|
|
4097
4123
|
if (plan.toPlugin.length > 0) {
|
|
4098
4124
|
for (const migration of plan.toPlugin) {
|
|
4099
|
-
|
|
4125
|
+
const baseDir = migration.oldScope === "global" ? os9.homedir() : projectDir;
|
|
4126
|
+
await deleteLocalSkill(baseDir, migration.id);
|
|
4100
4127
|
}
|
|
4101
4128
|
if (sourceResult.marketplace) {
|
|
4102
4129
|
for (const migration of plan.toPlugin) {
|
|
@@ -4125,7 +4152,7 @@ init_esm_shims();
|
|
|
4125
4152
|
// src/cli/lib/plugins/plugin-settings.ts
|
|
4126
4153
|
init_esm_shims();
|
|
4127
4154
|
import path22 from "path";
|
|
4128
|
-
import
|
|
4155
|
+
import os10 from "os";
|
|
4129
4156
|
import { z as z2 } from "zod";
|
|
4130
4157
|
var pluginSettingsSchema = z2.object({
|
|
4131
4158
|
enabledPlugins: z2.record(z2.string(), z2.unknown()).optional()
|
|
@@ -4176,7 +4203,7 @@ async function resolvePluginInstallPaths(pluginKeys, projectDir) {
|
|
|
4176
4203
|
if (pluginKeys.length === 0) {
|
|
4177
4204
|
return [];
|
|
4178
4205
|
}
|
|
4179
|
-
const registryPath = path22.join(
|
|
4206
|
+
const registryPath = path22.join(os10.homedir(), CLAUDE_DIR, PLUGINS_SUBDIR, INSTALLED_PLUGINS_FILE);
|
|
4180
4207
|
if (!await fileExists(registryPath)) {
|
|
4181
4208
|
verbose(`Plugin registry not found at '${registryPath}'`);
|
|
4182
4209
|
return [];
|
|
@@ -5239,6 +5266,7 @@ async function loadSkillsMatrixFromSource(options = {}) {
|
|
|
5239
5266
|
verbose(`Loading skills from source: ${source}`);
|
|
5240
5267
|
let result;
|
|
5241
5268
|
if (source === DEFAULT_SOURCE && !devMode) {
|
|
5269
|
+
const fetchResult = await fetchFromSource(source, { forceRefresh });
|
|
5242
5270
|
result = {
|
|
5243
5271
|
matrix: {
|
|
5244
5272
|
...BUILT_IN_MATRIX,
|
|
@@ -5247,7 +5275,7 @@ async function loadSkillsMatrixFromSource(options = {}) {
|
|
|
5247
5275
|
suggestedStacks: [...BUILT_IN_MATRIX.suggestedStacks]
|
|
5248
5276
|
},
|
|
5249
5277
|
sourceConfig,
|
|
5250
|
-
sourcePath:
|
|
5278
|
+
sourcePath: fetchResult.path,
|
|
5251
5279
|
isLocal: false,
|
|
5252
5280
|
marketplace: sourceConfig.marketplace
|
|
5253
5281
|
};
|
|
@@ -5260,16 +5288,22 @@ async function loadSkillsMatrixFromSource(options = {}) {
|
|
|
5260
5288
|
}
|
|
5261
5289
|
}
|
|
5262
5290
|
const resolvedProjectDir = projectDir || process.cwd();
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5291
|
+
const homeDir = os11.homedir();
|
|
5292
|
+
if (resolvedProjectDir !== homeDir) {
|
|
5293
|
+
const globalLocalSkillsResult = await discoverLocalSkills(homeDir);
|
|
5294
|
+
if (globalLocalSkillsResult && globalLocalSkillsResult.skills.length > 0) {
|
|
5295
|
+
verbose(
|
|
5296
|
+
`Found ${globalLocalSkillsResult.skills.length} global local skill(s) in ${globalLocalSkillsResult.localSkillsPath}`
|
|
5297
|
+
);
|
|
5298
|
+
result.matrix = mergeLocalSkillsIntoMatrix(result.matrix, globalLocalSkillsResult);
|
|
5299
|
+
}
|
|
5267
5300
|
}
|
|
5268
|
-
|
|
5301
|
+
const projectLocalSkillsResult = await discoverLocalSkills(resolvedProjectDir);
|
|
5302
|
+
if (projectLocalSkillsResult && projectLocalSkillsResult.skills.length > 0) {
|
|
5269
5303
|
verbose(
|
|
5270
|
-
`Found ${
|
|
5304
|
+
`Found ${projectLocalSkillsResult.skills.length} project local skill(s) in ${projectLocalSkillsResult.localSkillsPath}`
|
|
5271
5305
|
);
|
|
5272
|
-
result.matrix = mergeLocalSkillsIntoMatrix(result.matrix,
|
|
5306
|
+
result.matrix = mergeLocalSkillsIntoMatrix(result.matrix, projectLocalSkillsResult);
|
|
5273
5307
|
}
|
|
5274
5308
|
if (!options.skipExtraSources) {
|
|
5275
5309
|
await loadSkillsFromAllSources(
|
|
@@ -5501,6 +5535,7 @@ export {
|
|
|
5501
5535
|
resolveAllSources,
|
|
5502
5536
|
loadStacks,
|
|
5503
5537
|
getStackSkillIds,
|
|
5538
|
+
loadProjectConfigFromDir,
|
|
5504
5539
|
loadProjectConfig,
|
|
5505
5540
|
validateProjectConfig,
|
|
5506
5541
|
IMPORT_DEFAULTS,
|
|
@@ -5540,6 +5575,7 @@ export {
|
|
|
5540
5575
|
isClaudeCLIAvailable,
|
|
5541
5576
|
claudePluginMarketplaceExists,
|
|
5542
5577
|
claudePluginMarketplaceAdd,
|
|
5578
|
+
claudePluginMarketplaceUpdate,
|
|
5543
5579
|
claudePluginUninstall,
|
|
5544
5580
|
loadSkillsMatrixFromSource,
|
|
5545
5581
|
convertStackToResolvedStack,
|
|
@@ -5559,7 +5595,9 @@ export {
|
|
|
5559
5595
|
detectProjectInstallation,
|
|
5560
5596
|
detectGlobalInstallation,
|
|
5561
5597
|
detectInstallation,
|
|
5598
|
+
resolveInstallPaths,
|
|
5562
5599
|
buildAndMergeConfig,
|
|
5600
|
+
buildAgentScopeMap,
|
|
5563
5601
|
writeScopedConfigs,
|
|
5564
5602
|
installPluginConfig,
|
|
5565
5603
|
installLocal,
|
|
@@ -5573,4 +5611,4 @@ export {
|
|
|
5573
5611
|
validateAllPlugins,
|
|
5574
5612
|
printPluginValidationResult
|
|
5575
5613
|
};
|
|
5576
|
-
//# sourceMappingURL=chunk-
|
|
5614
|
+
//# sourceMappingURL=chunk-OIHZ2YH3.js.map
|