agentinit 1.17.1 → 1.17.2
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 +7 -0
- package/README.md +2 -2
- package/dist/cli.js +256 -176
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +201 -132
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +49 -34
- package/dist/commands/skills.js.map +1 -1
- package/dist/core/pluginManager.d.ts +2 -0
- package/dist/core/pluginManager.d.ts.map +1 -1
- package/dist/core/pluginManager.js +7 -1
- package/dist/core/pluginManager.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -17204,7 +17204,11 @@ class PluginManager {
|
|
|
17204
17204
|
} catch {
|
|
17205
17205
|
throw new Error(`Invalid .claude-plugin/marketplace.json in ${pluginDir}`);
|
|
17206
17206
|
}
|
|
17207
|
-
const entries = Array.isArray(manifest.plugins) ? manifest.plugins.filter((entry) => typeof entry?.name === "string" && typeof entry?.source === "string")
|
|
17207
|
+
const entries = Array.isArray(manifest.plugins) ? manifest.plugins.filter((entry) => typeof entry?.name === "string" && typeof entry?.source === "string").map((entry) => ({
|
|
17208
|
+
name: entry.name,
|
|
17209
|
+
source: entry.source,
|
|
17210
|
+
...typeof entry.description === "string" ? { description: entry.description } : {}
|
|
17211
|
+
})) : [];
|
|
17208
17212
|
if (entries.length === 0) {
|
|
17209
17213
|
throw new Error(`No plugins declared in .claude-plugin/marketplace.json for ${pluginDir}`);
|
|
17210
17214
|
}
|
|
@@ -41237,41 +41241,43 @@ function registerSkillsCommand(program2) {
|
|
|
41237
41241
|
const agentManager9 = new AgentManager;
|
|
41238
41242
|
const skillsManager5 = new SkillsManager(agentManager9);
|
|
41239
41243
|
if (options2.list) {
|
|
41240
|
-
const
|
|
41244
|
+
const spinner = ora("Discovering skills...").start();
|
|
41241
41245
|
try {
|
|
41242
41246
|
const result = await skillsManager5.discoverFromSource(source, process.cwd(), {
|
|
41243
41247
|
from: options2.from
|
|
41244
41248
|
});
|
|
41245
|
-
|
|
41249
|
+
spinner.stop();
|
|
41246
41250
|
displayDiscoveredSkills(result.skills, result.warnings);
|
|
41247
41251
|
} catch (error) {
|
|
41248
41252
|
if (error instanceof MultipleBundlePluginsError) {
|
|
41249
|
-
|
|
41250
|
-
const selected = await
|
|
41253
|
+
spinner.stop();
|
|
41254
|
+
const selected = await selectBundlePlugins(error, "list");
|
|
41251
41255
|
if (!selected) {
|
|
41252
41256
|
return;
|
|
41253
41257
|
}
|
|
41254
|
-
const
|
|
41255
|
-
|
|
41256
|
-
|
|
41257
|
-
|
|
41258
|
-
|
|
41259
|
-
|
|
41260
|
-
|
|
41261
|
-
|
|
41262
|
-
|
|
41263
|
-
|
|
41264
|
-
|
|
41258
|
+
for (const pluginName of selected) {
|
|
41259
|
+
const retrySpinner = ora(`Discovering skills from ${pluginName}...`).start();
|
|
41260
|
+
try {
|
|
41261
|
+
const result = await skillsManager5.discoverFromSource(source, process.cwd(), {
|
|
41262
|
+
from: options2.from,
|
|
41263
|
+
pluginName
|
|
41264
|
+
});
|
|
41265
|
+
retrySpinner.stop();
|
|
41266
|
+
displayDiscoveredSkills(result.skills, result.warnings);
|
|
41267
|
+
} catch (retryError) {
|
|
41268
|
+
retrySpinner.fail(`Failed to discover skills from ${pluginName}`);
|
|
41269
|
+
logger.error(`Error: ${retryError instanceof Error ? retryError.message : "Unknown error"}`);
|
|
41270
|
+
}
|
|
41265
41271
|
}
|
|
41266
41272
|
} else {
|
|
41267
|
-
|
|
41273
|
+
spinner.fail("Failed to discover skills");
|
|
41268
41274
|
logger.error(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
41269
41275
|
}
|
|
41270
41276
|
}
|
|
41271
41277
|
return;
|
|
41272
41278
|
}
|
|
41273
41279
|
const verifySpinner = ora("Verifying skill source...").start();
|
|
41274
|
-
let
|
|
41280
|
+
let selectedPluginNames;
|
|
41275
41281
|
try {
|
|
41276
41282
|
await skillsManager5.prepareSource(source, process.cwd(), {
|
|
41277
41283
|
from: options2.from
|
|
@@ -41280,16 +41286,16 @@ function registerSkillsCommand(program2) {
|
|
|
41280
41286
|
} catch (error) {
|
|
41281
41287
|
if (error instanceof MultipleBundlePluginsError && !options2.yes) {
|
|
41282
41288
|
verifySpinner.stop();
|
|
41283
|
-
const selected = await
|
|
41289
|
+
const selected = await selectBundlePlugins(error, "install");
|
|
41284
41290
|
if (!selected) {
|
|
41285
41291
|
return;
|
|
41286
41292
|
}
|
|
41287
|
-
|
|
41293
|
+
selectedPluginNames = selected;
|
|
41288
41294
|
const retrySpinner = ora("Verifying skill source...").start();
|
|
41289
41295
|
try {
|
|
41290
41296
|
await skillsManager5.prepareSource(source, process.cwd(), {
|
|
41291
41297
|
from: options2.from,
|
|
41292
|
-
pluginName:
|
|
41298
|
+
...selectedPluginNames[0] ? { pluginName: selectedPluginNames[0] } : {}
|
|
41293
41299
|
});
|
|
41294
41300
|
retrySpinner.stop();
|
|
41295
41301
|
} catch (retryError) {
|
|
@@ -41321,22 +41327,31 @@ function registerSkillsCommand(program2) {
|
|
|
41321
41327
|
targetGlobal = selection.global;
|
|
41322
41328
|
}
|
|
41323
41329
|
}
|
|
41324
|
-
const buildInstallOptions = (
|
|
41325
|
-
...
|
|
41330
|
+
const buildInstallOptions = (pluginName) => ({
|
|
41331
|
+
...options2.from !== undefined ? { from: options2.from } : {},
|
|
41326
41332
|
...targetGlobal !== undefined ? { global: targetGlobal } : {},
|
|
41327
41333
|
...targetAgents !== undefined ? { agents: targetAgents } : {},
|
|
41328
41334
|
...options2.skill !== undefined ? { skills: options2.skill } : {},
|
|
41329
41335
|
...options2.copy !== undefined ? { copy: options2.copy } : {},
|
|
41330
|
-
...
|
|
41336
|
+
...pluginName !== undefined ? { pluginName } : {},
|
|
41331
41337
|
...options2.yes !== undefined ? { yes: options2.yes } : {}
|
|
41332
41338
|
});
|
|
41333
|
-
const
|
|
41334
|
-
|
|
41335
|
-
const
|
|
41336
|
-
|
|
41337
|
-
|
|
41338
|
-
|
|
41339
|
-
|
|
41339
|
+
const pluginsToInstall = selectedPluginNames || [undefined];
|
|
41340
|
+
for (const pluginName of pluginsToInstall) {
|
|
41341
|
+
const spinner = ora(pluginName ? `Installing skills from ${pluginName}...` : "Installing skills...").start();
|
|
41342
|
+
try {
|
|
41343
|
+
if (pluginName && pluginName !== selectedPluginNames?.[0]) {
|
|
41344
|
+
await skillsManager5.prepareSource(source, process.cwd(), {
|
|
41345
|
+
from: options2.from,
|
|
41346
|
+
pluginName
|
|
41347
|
+
});
|
|
41348
|
+
}
|
|
41349
|
+
const result = await skillsManager5.addFromSource(source, process.cwd(), buildInstallOptions(pluginName));
|
|
41350
|
+
displayInstallResult(result, spinner, agentManager9, skillsManager5, source, { from: options2.from });
|
|
41351
|
+
} catch (error) {
|
|
41352
|
+
spinner.fail(pluginName ? `Failed to install skills from ${pluginName}` : "Failed to install skills");
|
|
41353
|
+
logger.error(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
41354
|
+
}
|
|
41340
41355
|
}
|
|
41341
41356
|
});
|
|
41342
41357
|
skills3.command("list").alias("ls").description("List installed skills").option("-g, --global", "List only global skills").option("-a, --agent <agents...>", "Filter by specific agent(s)").action(async (options2) => {
|
|
@@ -41415,21 +41430,25 @@ function registerSkillsCommand(program2) {
|
|
|
41415
41430
|
}
|
|
41416
41431
|
});
|
|
41417
41432
|
}
|
|
41418
|
-
async function
|
|
41433
|
+
async function selectBundlePlugins(error, actionLabel) {
|
|
41434
|
+
logger.info(dim("Press Space to select, then Enter to confirm."));
|
|
41419
41435
|
const response = await import_prompts2.default({
|
|
41420
|
-
type: "
|
|
41421
|
-
name: "
|
|
41422
|
-
message: `This repository contains multiple plugins. Select
|
|
41436
|
+
type: "multiselect",
|
|
41437
|
+
name: "plugins",
|
|
41438
|
+
message: `This repository contains multiple plugins. Select which to ${actionLabel}:`,
|
|
41439
|
+
instructions: false,
|
|
41440
|
+
min: 1,
|
|
41423
41441
|
choices: error.entries.map((entry) => ({
|
|
41424
41442
|
title: entry.name,
|
|
41425
|
-
value: entry.name
|
|
41443
|
+
value: entry.name,
|
|
41444
|
+
...entry.description ? { description: entry.description } : {}
|
|
41426
41445
|
}))
|
|
41427
41446
|
});
|
|
41428
|
-
if (!response.
|
|
41447
|
+
if (!response.plugins || response.plugins.length === 0) {
|
|
41429
41448
|
logger.info("Cancelled.");
|
|
41430
41449
|
return null;
|
|
41431
41450
|
}
|
|
41432
|
-
return response.
|
|
41451
|
+
return response.plugins;
|
|
41433
41452
|
}
|
|
41434
41453
|
async function resolveInteractiveSkillTargets(skillsManager5, agentManager9, source, projectPath, options2) {
|
|
41435
41454
|
let installGlobal = !!options2.global;
|
|
@@ -42581,13 +42600,13 @@ function registerPluginsCommand(program2) {
|
|
|
42581
42600
|
const agentManager12 = new AgentManager;
|
|
42582
42601
|
const pluginManager3 = new PluginManager(agentManager12);
|
|
42583
42602
|
if (options2.list) {
|
|
42584
|
-
const
|
|
42603
|
+
const spinner = ora("Fetching plugin...").start();
|
|
42585
42604
|
try {
|
|
42586
|
-
const
|
|
42605
|
+
const preview = await pluginManager3.inspectPlugin(source, {
|
|
42587
42606
|
from: options2.from
|
|
42588
42607
|
});
|
|
42589
|
-
|
|
42590
|
-
const p =
|
|
42608
|
+
spinner.stop();
|
|
42609
|
+
const p = preview.plugin;
|
|
42591
42610
|
console.log("");
|
|
42592
42611
|
logger.info(`${bold(p.name)} ${dim(`v${p.version}`)} ${dim(`[${p.format} format]`)}`);
|
|
42593
42612
|
if (p.description)
|
|
@@ -42608,49 +42627,51 @@ function registerPluginsCommand(program2) {
|
|
|
42608
42627
|
if (p.skills.length === 0 && p.mcpServers.length === 0) {
|
|
42609
42628
|
logger.info(" No portable components found (no skills or MCP servers).");
|
|
42610
42629
|
}
|
|
42611
|
-
renderPluginWarnings(
|
|
42630
|
+
renderPluginWarnings(preview, process.cwd());
|
|
42612
42631
|
} catch (error) {
|
|
42613
42632
|
if (error instanceof MultipleBundlePluginsError) {
|
|
42614
|
-
|
|
42615
|
-
const selected = await
|
|
42633
|
+
spinner.stop();
|
|
42634
|
+
const selected = await selectBundlePlugins2(error, "preview");
|
|
42616
42635
|
if (!selected) {
|
|
42617
42636
|
return;
|
|
42618
42637
|
}
|
|
42619
|
-
const
|
|
42620
|
-
|
|
42621
|
-
|
|
42622
|
-
|
|
42623
|
-
|
|
42624
|
-
|
|
42625
|
-
|
|
42626
|
-
|
|
42627
|
-
|
|
42628
|
-
|
|
42629
|
-
|
|
42630
|
-
|
|
42631
|
-
|
|
42632
|
-
|
|
42633
|
-
|
|
42634
|
-
|
|
42635
|
-
|
|
42638
|
+
for (const pluginName of selected) {
|
|
42639
|
+
const retrySpinner = ora(`Fetching plugin ${pluginName}...`).start();
|
|
42640
|
+
try {
|
|
42641
|
+
const preview = await pluginManager3.inspectPlugin(source, {
|
|
42642
|
+
from: options2.from,
|
|
42643
|
+
pluginName
|
|
42644
|
+
});
|
|
42645
|
+
retrySpinner.stop();
|
|
42646
|
+
const p = preview.plugin;
|
|
42647
|
+
console.log("");
|
|
42648
|
+
logger.info(`${bold(p.name)} ${dim(`v${p.version}`)} ${dim(`[${p.format} format]`)}`);
|
|
42649
|
+
if (p.description)
|
|
42650
|
+
logger.info(` ${p.description}`);
|
|
42651
|
+
console.log("");
|
|
42652
|
+
if (p.skills.length > 0) {
|
|
42653
|
+
logger.info(` ${green("Skills")} (${p.skills.length}):`);
|
|
42654
|
+
for (const skill of p.skills) {
|
|
42655
|
+
logger.info(` ${green(skill.name)} - ${skill.description}`);
|
|
42656
|
+
}
|
|
42636
42657
|
}
|
|
42637
|
-
|
|
42638
|
-
|
|
42639
|
-
|
|
42640
|
-
|
|
42641
|
-
|
|
42658
|
+
if (p.mcpServers.length > 0) {
|
|
42659
|
+
logger.info(` ${cyan("MCP Servers")} (${p.mcpServers.length}):`);
|
|
42660
|
+
for (const mcp of p.mcpServers) {
|
|
42661
|
+
logger.info(` ${cyan(mcp.name)} [${mcp.type}]`);
|
|
42662
|
+
}
|
|
42642
42663
|
}
|
|
42664
|
+
if (p.skills.length === 0 && p.mcpServers.length === 0) {
|
|
42665
|
+
logger.info(" No portable components found (no skills or MCP servers).");
|
|
42666
|
+
}
|
|
42667
|
+
renderPluginWarnings(preview, process.cwd());
|
|
42668
|
+
} catch (retryError) {
|
|
42669
|
+
retrySpinner.fail(`Failed to fetch plugin ${pluginName}`);
|
|
42670
|
+
logger.error(`Error: ${retryError instanceof Error ? retryError.message : "Unknown error"}`);
|
|
42643
42671
|
}
|
|
42644
|
-
if (p.skills.length === 0 && p.mcpServers.length === 0) {
|
|
42645
|
-
logger.info(" No portable components found (no skills or MCP servers).");
|
|
42646
|
-
}
|
|
42647
|
-
renderPluginWarnings(preview2, process.cwd());
|
|
42648
|
-
} catch (retryError) {
|
|
42649
|
-
retrySpinner.fail("Failed to fetch plugin");
|
|
42650
|
-
logger.error(`Error: ${retryError instanceof Error ? retryError.message : "Unknown error"}`);
|
|
42651
42672
|
}
|
|
42652
42673
|
} else {
|
|
42653
|
-
|
|
42674
|
+
spinner.fail("Failed to fetch plugin");
|
|
42654
42675
|
logger.error(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
42655
42676
|
}
|
|
42656
42677
|
}
|
|
@@ -42658,34 +42679,42 @@ function registerPluginsCommand(program2) {
|
|
|
42658
42679
|
}
|
|
42659
42680
|
let agentIds = options2.agent;
|
|
42660
42681
|
let targetGlobal = options2.global;
|
|
42661
|
-
let
|
|
42682
|
+
let selectionPreview = null;
|
|
42662
42683
|
let previewRendered = false;
|
|
42663
|
-
let
|
|
42684
|
+
let selectedPluginNames;
|
|
42664
42685
|
if (!agentIds && !options2.yes) {
|
|
42665
42686
|
const previewSpinner = ora("Inspecting plugin...").start();
|
|
42666
42687
|
try {
|
|
42667
|
-
preview = await pluginManager3.preparePluginInstall(source, {
|
|
42688
|
+
const preview = await pluginManager3.preparePluginInstall(source, {
|
|
42668
42689
|
from: options2.from
|
|
42669
42690
|
});
|
|
42670
42691
|
previewSpinner.stop();
|
|
42671
|
-
|
|
42692
|
+
selectionPreview = buildPluginSelectionPreview([preview]);
|
|
42693
|
+
renderPreparedPluginWarnings([preview], process.cwd());
|
|
42672
42694
|
previewRendered = true;
|
|
42673
42695
|
} catch (error) {
|
|
42674
42696
|
if (error instanceof MultipleBundlePluginsError) {
|
|
42675
42697
|
previewSpinner.stop();
|
|
42676
|
-
const selected = await
|
|
42698
|
+
const selected = await selectBundlePlugins2(error, "install");
|
|
42677
42699
|
if (!selected) {
|
|
42678
42700
|
return;
|
|
42679
42701
|
}
|
|
42680
|
-
|
|
42702
|
+
selectedPluginNames = selected;
|
|
42681
42703
|
const retrySpinner = ora("Inspecting plugin...").start();
|
|
42682
42704
|
try {
|
|
42683
|
-
|
|
42684
|
-
|
|
42685
|
-
|
|
42686
|
-
|
|
42705
|
+
const previewsByPlugin = new Map;
|
|
42706
|
+
const previewOrder = selectedPluginNames.length > 1 ? [...selectedPluginNames.slice(1), selectedPluginNames[0]] : selectedPluginNames;
|
|
42707
|
+
for (const pluginName of previewOrder) {
|
|
42708
|
+
const preparedPreview = await pluginManager3.preparePluginInstall(source, {
|
|
42709
|
+
from: options2.from,
|
|
42710
|
+
pluginName
|
|
42711
|
+
});
|
|
42712
|
+
previewsByPlugin.set(pluginName, preparedPreview);
|
|
42713
|
+
}
|
|
42714
|
+
const previews = selectedPluginNames.map((pluginName) => previewsByPlugin.get(pluginName)).filter((value) => !!value);
|
|
42687
42715
|
retrySpinner.stop();
|
|
42688
|
-
|
|
42716
|
+
selectionPreview = buildPluginSelectionPreview(previews);
|
|
42717
|
+
renderPreparedPluginWarnings(previews, process.cwd());
|
|
42689
42718
|
previewRendered = true;
|
|
42690
42719
|
} catch (retryError) {
|
|
42691
42720
|
retrySpinner.fail("Failed to inspect plugin");
|
|
@@ -42699,7 +42728,7 @@ function registerPluginsCommand(program2) {
|
|
|
42699
42728
|
}
|
|
42700
42729
|
}
|
|
42701
42730
|
try {
|
|
42702
|
-
const selection = await interactiveAgentSelect(pluginManager3, agentManager12, process.cwd(), targetGlobal,
|
|
42731
|
+
const selection = await interactiveAgentSelect(pluginManager3, agentManager12, process.cwd(), targetGlobal, selectionPreview);
|
|
42703
42732
|
if (!selection || selection.aborted || !selection.agents || selection.agents.length === 0) {
|
|
42704
42733
|
await pluginManager3.discardPreparedPlugin(source, { from: options2.from });
|
|
42705
42734
|
logger.info("No agents selected. Aborting.");
|
|
@@ -42714,82 +42743,93 @@ function registerPluginsCommand(program2) {
|
|
|
42714
42743
|
}
|
|
42715
42744
|
}
|
|
42716
42745
|
}
|
|
42717
|
-
const
|
|
42718
|
-
|
|
42719
|
-
const
|
|
42720
|
-
|
|
42721
|
-
|
|
42722
|
-
|
|
42723
|
-
|
|
42724
|
-
|
|
42725
|
-
|
|
42726
|
-
});
|
|
42727
|
-
const p = result.plugin;
|
|
42728
|
-
const totalSkills = result.skills.installed.length;
|
|
42729
|
-
const totalMcp = result.mcpServers.applied.length;
|
|
42730
|
-
const totalNative = result.nativePlugins.installed.length;
|
|
42731
|
-
if (totalSkills === 0 && totalMcp === 0 && totalNative === 0) {
|
|
42732
|
-
spinner.warn(`Plugin "${p.name}" has no portable components to install.`);
|
|
42733
|
-
if (!previewRendered) {
|
|
42734
|
-
renderPluginWarnings(result, process.cwd());
|
|
42735
|
-
}
|
|
42736
|
-
return;
|
|
42737
|
-
}
|
|
42738
|
-
spinner.succeed(`Installed plugin ${green(bold(p.name))} ${dim(`v${p.version}`)}`);
|
|
42739
|
-
renderInstalledComponents(result, agentManager12, process.cwd());
|
|
42740
|
-
if (result.skills.skipped.length > 0 || result.mcpServers.skipped.length > 0 || result.nativePlugins.skipped.length > 0) {
|
|
42741
|
-
console.log("");
|
|
42742
|
-
for (const s of result.skills.skipped) {
|
|
42743
|
-
logger.debug(`Skipped skill ${s.name}: ${s.reason}`);
|
|
42746
|
+
const pluginsToInstall = selectedPluginNames || [undefined];
|
|
42747
|
+
for (const pluginName of pluginsToInstall) {
|
|
42748
|
+
const spinner = ora(pluginName ? `Installing plugin ${pluginName}...` : "Installing plugin...").start();
|
|
42749
|
+
try {
|
|
42750
|
+
if (pluginName && pluginName !== selectedPluginNames?.[0]) {
|
|
42751
|
+
await pluginManager3.preparePluginInstall(source, {
|
|
42752
|
+
from: options2.from,
|
|
42753
|
+
pluginName
|
|
42754
|
+
});
|
|
42744
42755
|
}
|
|
42745
|
-
|
|
42746
|
-
|
|
42756
|
+
const result = await pluginManager3.installPlugin(source, process.cwd(), {
|
|
42757
|
+
from: options2.from,
|
|
42758
|
+
agents: agentIds,
|
|
42759
|
+
global: targetGlobal,
|
|
42760
|
+
copySkills: options2.copySkills,
|
|
42761
|
+
yes: options2.yes,
|
|
42762
|
+
...pluginName ? { pluginName } : {}
|
|
42763
|
+
});
|
|
42764
|
+
const p = result.plugin;
|
|
42765
|
+
const totalSkills = result.skills.installed.length;
|
|
42766
|
+
const totalMcp = result.mcpServers.applied.length;
|
|
42767
|
+
const totalNative = result.nativePlugins.installed.length;
|
|
42768
|
+
if (totalSkills === 0 && totalMcp === 0 && totalNative === 0) {
|
|
42769
|
+
spinner.warn(`Plugin "${p.name}" has no portable components to install.`);
|
|
42770
|
+
if (!previewRendered) {
|
|
42771
|
+
renderPluginWarnings(result, process.cwd());
|
|
42772
|
+
}
|
|
42773
|
+
continue;
|
|
42747
42774
|
}
|
|
42748
|
-
|
|
42749
|
-
|
|
42775
|
+
spinner.succeed(`Installed plugin ${green(bold(p.name))} ${dim(`v${p.version}`)}`);
|
|
42776
|
+
renderInstalledComponents(result, agentManager12, process.cwd());
|
|
42777
|
+
if (result.skills.skipped.length > 0 || result.mcpServers.skipped.length > 0 || result.nativePlugins.skipped.length > 0) {
|
|
42778
|
+
console.log("");
|
|
42779
|
+
for (const s of result.skills.skipped) {
|
|
42780
|
+
logger.debug(`Skipped skill ${s.name}: ${s.reason}`);
|
|
42781
|
+
}
|
|
42782
|
+
for (const s of result.mcpServers.skipped) {
|
|
42783
|
+
logger.debug(`Skipped MCP ${s.name}: ${s.reason}`);
|
|
42784
|
+
}
|
|
42785
|
+
for (const s of result.nativePlugins.skipped) {
|
|
42786
|
+
logger.warn(`Skipped native plugin payload for ${s.agent}: ${s.reason}`);
|
|
42787
|
+
}
|
|
42750
42788
|
}
|
|
42751
|
-
|
|
42752
|
-
|
|
42753
|
-
renderPluginWarnings(result, process.cwd());
|
|
42754
|
-
}
|
|
42755
|
-
logger.success("Plugin installation complete.");
|
|
42756
|
-
} catch (error) {
|
|
42757
|
-
if (error instanceof MultipleBundlePluginsError && !options2.yes) {
|
|
42758
|
-
spinner.stop();
|
|
42759
|
-
const selected = await selectBundlePlugin2(error, "install");
|
|
42760
|
-
if (!selected) {
|
|
42761
|
-
return;
|
|
42789
|
+
if (!previewRendered) {
|
|
42790
|
+
renderPluginWarnings(result, process.cwd());
|
|
42762
42791
|
}
|
|
42763
|
-
|
|
42764
|
-
|
|
42765
|
-
|
|
42766
|
-
|
|
42767
|
-
|
|
42768
|
-
|
|
42769
|
-
copySkills: options2.copySkills,
|
|
42770
|
-
yes: options2.yes,
|
|
42771
|
-
pluginName: selected
|
|
42772
|
-
});
|
|
42773
|
-
const p = result.plugin;
|
|
42774
|
-
const totalSkills = result.skills.installed.length;
|
|
42775
|
-
const totalMcp = result.mcpServers.applied.length;
|
|
42776
|
-
const totalNative = result.nativePlugins.installed.length;
|
|
42777
|
-
if (totalSkills === 0 && totalMcp === 0 && totalNative === 0) {
|
|
42778
|
-
retrySpinner.warn(`Plugin "${p.name}" has no portable components to install.`);
|
|
42779
|
-
renderPluginWarnings(result, process.cwd());
|
|
42792
|
+
logger.success("Plugin installation complete.");
|
|
42793
|
+
} catch (error) {
|
|
42794
|
+
if (error instanceof MultipleBundlePluginsError && !options2.yes) {
|
|
42795
|
+
spinner.stop();
|
|
42796
|
+
const selected = await selectBundlePlugins2(error, "install");
|
|
42797
|
+
if (!selected) {
|
|
42780
42798
|
return;
|
|
42781
42799
|
}
|
|
42782
|
-
|
|
42783
|
-
|
|
42784
|
-
|
|
42785
|
-
|
|
42786
|
-
|
|
42787
|
-
|
|
42788
|
-
|
|
42800
|
+
for (const selectedName of selected) {
|
|
42801
|
+
const retrySpinner = ora(`Installing plugin ${selectedName}...`).start();
|
|
42802
|
+
try {
|
|
42803
|
+
const result = await pluginManager3.installPlugin(source, process.cwd(), {
|
|
42804
|
+
from: options2.from,
|
|
42805
|
+
agents: agentIds,
|
|
42806
|
+
global: targetGlobal,
|
|
42807
|
+
copySkills: options2.copySkills,
|
|
42808
|
+
yes: options2.yes,
|
|
42809
|
+
pluginName: selectedName
|
|
42810
|
+
});
|
|
42811
|
+
const p = result.plugin;
|
|
42812
|
+
const totalSkills = result.skills.installed.length;
|
|
42813
|
+
const totalMcp = result.mcpServers.applied.length;
|
|
42814
|
+
const totalNative = result.nativePlugins.installed.length;
|
|
42815
|
+
if (totalSkills === 0 && totalMcp === 0 && totalNative === 0) {
|
|
42816
|
+
retrySpinner.warn(`Plugin "${p.name}" has no portable components to install.`);
|
|
42817
|
+
renderPluginWarnings(result, process.cwd());
|
|
42818
|
+
continue;
|
|
42819
|
+
}
|
|
42820
|
+
retrySpinner.succeed(`Installed plugin ${green(bold(p.name))} ${dim(`v${p.version}`)}`);
|
|
42821
|
+
renderInstalledComponents(result, agentManager12, process.cwd());
|
|
42822
|
+
renderPluginWarnings(result, process.cwd());
|
|
42823
|
+
logger.success("Plugin installation complete.");
|
|
42824
|
+
} catch (retryError) {
|
|
42825
|
+
retrySpinner.fail(`Failed to install plugin ${selectedName}`);
|
|
42826
|
+
logger.error(`Error: ${retryError instanceof Error ? retryError.message : "Unknown error"}`);
|
|
42827
|
+
}
|
|
42828
|
+
}
|
|
42829
|
+
} else {
|
|
42830
|
+
spinner.fail("Failed to install plugin");
|
|
42831
|
+
logger.error(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
42789
42832
|
}
|
|
42790
|
-
} else {
|
|
42791
|
-
spinner.fail("Failed to install plugin");
|
|
42792
|
-
logger.error(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
42793
42833
|
}
|
|
42794
42834
|
}
|
|
42795
42835
|
});
|
|
@@ -42897,21 +42937,25 @@ function registerPluginsCommand(program2) {
|
|
|
42897
42937
|
}
|
|
42898
42938
|
});
|
|
42899
42939
|
}
|
|
42900
|
-
async function
|
|
42940
|
+
async function selectBundlePlugins2(error, actionLabel) {
|
|
42941
|
+
logger.info(dim("Press Space to select, then Enter to confirm."));
|
|
42901
42942
|
const response = await import_prompts3.default({
|
|
42902
|
-
type: "
|
|
42903
|
-
name: "
|
|
42904
|
-
message: `This repository contains multiple plugins. Select
|
|
42943
|
+
type: "multiselect",
|
|
42944
|
+
name: "plugins",
|
|
42945
|
+
message: `This repository contains multiple plugins. Select which to ${actionLabel}:`,
|
|
42946
|
+
instructions: false,
|
|
42947
|
+
min: 1,
|
|
42905
42948
|
choices: error.entries.map((entry) => ({
|
|
42906
42949
|
title: entry.name,
|
|
42907
|
-
value: entry.name
|
|
42950
|
+
value: entry.name,
|
|
42951
|
+
...entry.description ? { description: entry.description } : {}
|
|
42908
42952
|
}))
|
|
42909
42953
|
});
|
|
42910
|
-
if (!response.
|
|
42954
|
+
if (!response.plugins || response.plugins.length === 0) {
|
|
42911
42955
|
logger.info("Cancelled.");
|
|
42912
42956
|
return null;
|
|
42913
42957
|
}
|
|
42914
|
-
return response.
|
|
42958
|
+
return response.plugins;
|
|
42915
42959
|
}
|
|
42916
42960
|
var formatPathForDisplay = function(pathValue, projectPath) {
|
|
42917
42961
|
if (pathValue.startsWith(`${projectPath}/`)) {
|
|
@@ -42926,16 +42970,48 @@ var formatPathForDisplay = function(pathValue, projectPath) {
|
|
|
42926
42970
|
var getAgentLabel = function(agentIds, agentManager12) {
|
|
42927
42971
|
return agentIds.map((agentId) => agentManager12.getAgentById(agentId)?.name || agentId).join(", ");
|
|
42928
42972
|
};
|
|
42973
|
+
var buildPluginSelectionPreview = function(previews) {
|
|
42974
|
+
const nativeAgentIds = new Set;
|
|
42975
|
+
const nativeFeatures = new Set;
|
|
42976
|
+
const nativeInstallPaths = new Set;
|
|
42977
|
+
for (const preview of previews) {
|
|
42978
|
+
if (!preview.nativePreview) {
|
|
42979
|
+
continue;
|
|
42980
|
+
}
|
|
42981
|
+
nativeAgentIds.add(preview.nativePreview.agent);
|
|
42982
|
+
nativeInstallPaths.add(preview.nativePreview.installPath);
|
|
42983
|
+
for (const feature of preview.nativePreview.features) {
|
|
42984
|
+
nativeFeatures.add(feature);
|
|
42985
|
+
}
|
|
42986
|
+
}
|
|
42987
|
+
return {
|
|
42988
|
+
selectedCount: previews.length,
|
|
42989
|
+
skillCount: previews.reduce((total, preview) => total + preview.plugin.skills.length, 0),
|
|
42990
|
+
mcpServerCount: previews.reduce((total, preview) => total + preview.plugin.mcpServers.length, 0),
|
|
42991
|
+
nativeAgentIds: [...nativeAgentIds],
|
|
42992
|
+
nativeFeatures: [...nativeFeatures],
|
|
42993
|
+
nativeInstallPaths: [...nativeInstallPaths]
|
|
42994
|
+
};
|
|
42995
|
+
};
|
|
42929
42996
|
var getPortableComponentSummary = function(preview) {
|
|
42930
42997
|
const parts = [];
|
|
42931
|
-
if (preview.
|
|
42932
|
-
parts.push(`${preview.
|
|
42998
|
+
if (preview.skillCount > 0) {
|
|
42999
|
+
parts.push(`${preview.skillCount} skill(s)`);
|
|
42933
43000
|
}
|
|
42934
|
-
if (preview.
|
|
42935
|
-
parts.push(`${preview.
|
|
43001
|
+
if (preview.mcpServerCount > 0) {
|
|
43002
|
+
parts.push(`${preview.mcpServerCount} MCP server(s)`);
|
|
42936
43003
|
}
|
|
42937
43004
|
return parts.length > 0 ? parts.join(", ") : "No portable components";
|
|
42938
43005
|
};
|
|
43006
|
+
var renderPreparedPluginWarnings = function(previews, projectPath) {
|
|
43007
|
+
for (const preview of previews) {
|
|
43008
|
+
if (previews.length > 1) {
|
|
43009
|
+
console.log("");
|
|
43010
|
+
logger.info(`${bold(preview.plugin.name)} ${dim(`v${preview.plugin.version}`)}`);
|
|
43011
|
+
}
|
|
43012
|
+
renderPluginWarnings(preview, projectPath);
|
|
43013
|
+
}
|
|
43014
|
+
};
|
|
42939
43015
|
var getSourceWarnings = function(warnings) {
|
|
42940
43016
|
const items = [];
|
|
42941
43017
|
for (const warning of warnings) {
|
|
@@ -43178,31 +43254,35 @@ var shouldPreselectPluginGroup = function(group, installGlobal, preview) {
|
|
|
43178
43254
|
if (group.kind === "canonical-shared") {
|
|
43179
43255
|
return true;
|
|
43180
43256
|
}
|
|
43181
|
-
if (preview.
|
|
43182
|
-
return group.agents.some((agent) => agent.id
|
|
43257
|
+
if (preview.nativeAgentIds.length > 0) {
|
|
43258
|
+
return group.agents.some((agent) => preview.nativeAgentIds.includes(agent.id));
|
|
43183
43259
|
}
|
|
43184
43260
|
return false;
|
|
43185
43261
|
};
|
|
43186
43262
|
var getPluginGroupDescription = function(group, preview, projectPath) {
|
|
43187
43263
|
const portableSummary = getPortableComponentSummary(preview);
|
|
43188
|
-
if (
|
|
43264
|
+
if (preview.nativeAgentIds.length === 0) {
|
|
43189
43265
|
return portableSummary;
|
|
43190
43266
|
}
|
|
43191
|
-
const containsClaudeCode = group.agents.some((agent) => agent.id
|
|
43267
|
+
const containsClaudeCode = group.agents.some((agent) => preview.nativeAgentIds.includes(agent.id));
|
|
43192
43268
|
if (!containsClaudeCode) {
|
|
43193
|
-
return `${portableSummary}.
|
|
43269
|
+
return `${portableSummary}. Some selected plugins also include Claude-specific components that will not be fully available for these agents.`;
|
|
43194
43270
|
}
|
|
43195
|
-
const otherAgents = group.agents.filter((agent) => agent.id
|
|
43196
|
-
const installPath = formatPathForDisplay(preview.
|
|
43271
|
+
const otherAgents = group.agents.filter((agent) => !preview.nativeAgentIds.includes(agent.id)).map((agent) => agent.name);
|
|
43272
|
+
const installPath = preview.nativeInstallPaths.length === 1 ? formatPathForDisplay(preview.nativeInstallPaths[0], projectPath) : `~/.claude/plugins (${preview.nativeInstallPaths.length} plugin-specific install paths)`;
|
|
43273
|
+
const nativeSummary = preview.nativeFeatures.length > 0 ? ` Native components: ${preview.nativeFeatures.join(", ")}.` : "";
|
|
43197
43274
|
if (otherAgents.length === 0) {
|
|
43198
|
-
return `${portableSummary}. Full plugin support is available in Claude Code;
|
|
43275
|
+
return `${portableSummary}. Full plugin support is available in Claude Code; native components install at ${installPath}.${nativeSummary}`;
|
|
43199
43276
|
}
|
|
43200
43277
|
const otherAgentsLabel = otherAgents.join(", ");
|
|
43201
43278
|
const shareVerb = otherAgents.length === 1 ? "shares" : "share";
|
|
43202
43279
|
const receiveVerb = otherAgents.length === 1 ? "receives" : "receive";
|
|
43203
|
-
return `${portableSummary}. Full plugin support is available in Claude Code;
|
|
43280
|
+
return `${portableSummary}. Full plugin support is available in Claude Code; native components install at ${installPath}.${nativeSummary} ${otherAgentsLabel} ${shareVerb} this skills directory but only ${receiveVerb} the installed skills.`;
|
|
43204
43281
|
};
|
|
43205
43282
|
async function interactiveAgentSelect(pluginManager3, agentManager12, projectPath, global3, preview) {
|
|
43283
|
+
if (!preview) {
|
|
43284
|
+
return { aborted: true };
|
|
43285
|
+
}
|
|
43206
43286
|
let installGlobal = !!global3;
|
|
43207
43287
|
let groups = installGlobal ? buildGlobalPluginGroups(agentManager12, projectPath) : (await pluginManager3.groupAgentsBySkillsDir(projectPath, false)).map((group) => ({
|
|
43208
43288
|
...group,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/commands/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/commands/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqCpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0b7D"}
|