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/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 spinner2 = ora("Discovering skills...").start();
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
- spinner2.stop();
41249
+ spinner.stop();
41246
41250
  displayDiscoveredSkills(result.skills, result.warnings);
41247
41251
  } catch (error) {
41248
41252
  if (error instanceof MultipleBundlePluginsError) {
41249
- spinner2.stop();
41250
- const selected = await selectBundlePlugin(error, "list");
41253
+ spinner.stop();
41254
+ const selected = await selectBundlePlugins(error, "list");
41251
41255
  if (!selected) {
41252
41256
  return;
41253
41257
  }
41254
- const retrySpinner = ora("Discovering skills...").start();
41255
- try {
41256
- const result = await skillsManager5.discoverFromSource(source, process.cwd(), {
41257
- from: options2.from,
41258
- pluginName: selected
41259
- });
41260
- retrySpinner.stop();
41261
- displayDiscoveredSkills(result.skills, result.warnings);
41262
- } catch (retryError) {
41263
- retrySpinner.fail("Failed to discover skills");
41264
- logger.error(`Error: ${retryError instanceof Error ? retryError.message : "Unknown error"}`);
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
- spinner2.fail("Failed to discover skills");
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 selectedPluginName;
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 selectBundlePlugin(error, "install");
41289
+ const selected = await selectBundlePlugins(error, "install");
41284
41290
  if (!selected) {
41285
41291
  return;
41286
41292
  }
41287
- selectedPluginName = selected;
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: selectedPluginName
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 = (fromOverride) => ({
41325
- ...fromOverride !== undefined ? { from: fromOverride } : options2.from !== undefined ? { from: options2.from } : {},
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
- ...selectedPluginName !== undefined ? { pluginName: selectedPluginName } : {},
41336
+ ...pluginName !== undefined ? { pluginName } : {},
41331
41337
  ...options2.yes !== undefined ? { yes: options2.yes } : {}
41332
41338
  });
41333
- const spinner = ora("Installing skills...").start();
41334
- try {
41335
- const result = await skillsManager5.addFromSource(source, process.cwd(), buildInstallOptions());
41336
- displayInstallResult(result, spinner, agentManager9, skillsManager5, source, { from: options2.from });
41337
- } catch (error) {
41338
- spinner.fail("Failed to install skills");
41339
- logger.error(`Error: ${error instanceof Error ? error.message : "Unknown error"}`);
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 selectBundlePlugin(error, actionLabel) {
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: "select",
41421
- name: "plugin",
41422
- message: `This repository contains multiple plugins. Select one to ${actionLabel}:`,
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.plugin) {
41447
+ if (!response.plugins || response.plugins.length === 0) {
41429
41448
  logger.info("Cancelled.");
41430
41449
  return null;
41431
41450
  }
41432
- return response.plugin;
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 spinner2 = ora("Fetching plugin...").start();
42603
+ const spinner = ora("Fetching plugin...").start();
42585
42604
  try {
42586
- const preview2 = await pluginManager3.inspectPlugin(source, {
42605
+ const preview = await pluginManager3.inspectPlugin(source, {
42587
42606
  from: options2.from
42588
42607
  });
42589
- spinner2.stop();
42590
- const p = preview2.plugin;
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(preview2, process.cwd());
42630
+ renderPluginWarnings(preview, process.cwd());
42612
42631
  } catch (error) {
42613
42632
  if (error instanceof MultipleBundlePluginsError) {
42614
- spinner2.stop();
42615
- const selected = await selectBundlePlugin2(error, "preview");
42633
+ spinner.stop();
42634
+ const selected = await selectBundlePlugins2(error, "preview");
42616
42635
  if (!selected) {
42617
42636
  return;
42618
42637
  }
42619
- const retrySpinner = ora("Fetching plugin...").start();
42620
- try {
42621
- const preview2 = await pluginManager3.inspectPlugin(source, {
42622
- from: options2.from,
42623
- pluginName: selected
42624
- });
42625
- retrySpinner.stop();
42626
- const p = preview2.plugin;
42627
- console.log("");
42628
- logger.info(`${bold(p.name)} ${dim(`v${p.version}`)} ${dim(`[${p.format} format]`)}`);
42629
- if (p.description)
42630
- logger.info(` ${p.description}`);
42631
- console.log("");
42632
- if (p.skills.length > 0) {
42633
- logger.info(` ${green("Skills")} (${p.skills.length}):`);
42634
- for (const skill of p.skills) {
42635
- logger.info(` ${green(skill.name)} - ${skill.description}`);
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
- if (p.mcpServers.length > 0) {
42639
- logger.info(` ${cyan("MCP Servers")} (${p.mcpServers.length}):`);
42640
- for (const mcp of p.mcpServers) {
42641
- logger.info(` ${cyan(mcp.name)} [${mcp.type}]`);
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
- spinner2.fail("Failed to fetch plugin");
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 preview = null;
42682
+ let selectionPreview = null;
42662
42683
  let previewRendered = false;
42663
- let selectedPluginName;
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
- renderPluginWarnings(preview, process.cwd());
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 selectBundlePlugin2(error, "install");
42698
+ const selected = await selectBundlePlugins2(error, "install");
42677
42699
  if (!selected) {
42678
42700
  return;
42679
42701
  }
42680
- selectedPluginName = selected;
42702
+ selectedPluginNames = selected;
42681
42703
  const retrySpinner = ora("Inspecting plugin...").start();
42682
42704
  try {
42683
- preview = await pluginManager3.preparePluginInstall(source, {
42684
- from: options2.from,
42685
- pluginName: selectedPluginName
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
- renderPluginWarnings(preview, process.cwd());
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, preview);
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 spinner = ora("Installing plugin...").start();
42718
- try {
42719
- const result = await pluginManager3.installPlugin(source, process.cwd(), {
42720
- from: options2.from,
42721
- agents: agentIds,
42722
- global: targetGlobal,
42723
- copySkills: options2.copySkills,
42724
- yes: options2.yes,
42725
- ...selectedPluginName ? { pluginName: selectedPluginName } : {}
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
- for (const s of result.mcpServers.skipped) {
42746
- logger.debug(`Skipped MCP ${s.name}: ${s.reason}`);
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
- for (const s of result.nativePlugins.skipped) {
42749
- logger.warn(`Skipped native plugin payload for ${s.agent}: ${s.reason}`);
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
- if (!previewRendered) {
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
- const retrySpinner = ora("Installing plugin...").start();
42764
- try {
42765
- const result = await pluginManager3.installPlugin(source, process.cwd(), {
42766
- from: options2.from,
42767
- agents: agentIds,
42768
- global: targetGlobal,
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
- retrySpinner.succeed(`Installed plugin ${green(bold(p.name))} ${dim(`v${p.version}`)}`);
42783
- renderInstalledComponents(result, agentManager12, process.cwd());
42784
- renderPluginWarnings(result, process.cwd());
42785
- logger.success("Plugin installation complete.");
42786
- } catch (retryError) {
42787
- retrySpinner.fail("Failed to install plugin");
42788
- logger.error(`Error: ${retryError instanceof Error ? retryError.message : "Unknown error"}`);
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 selectBundlePlugin2(error, actionLabel) {
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: "select",
42903
- name: "plugin",
42904
- message: `This repository contains multiple plugins. Select one to ${actionLabel}:`,
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.plugin) {
42954
+ if (!response.plugins || response.plugins.length === 0) {
42911
42955
  logger.info("Cancelled.");
42912
42956
  return null;
42913
42957
  }
42914
- return response.plugin;
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.plugin.skills.length > 0) {
42932
- parts.push(`${preview.plugin.skills.length} skill(s)`);
42998
+ if (preview.skillCount > 0) {
42999
+ parts.push(`${preview.skillCount} skill(s)`);
42933
43000
  }
42934
- if (preview.plugin.mcpServers.length > 0) {
42935
- parts.push(`${preview.plugin.mcpServers.length} MCP server(s)`);
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.nativePreview) {
43182
- return group.agents.some((agent) => agent.id === preview.nativePreview?.agent);
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 (!preview.nativePreview) {
43264
+ if (preview.nativeAgentIds.length === 0) {
43189
43265
  return portableSummary;
43190
43266
  }
43191
- const containsClaudeCode = group.agents.some((agent) => agent.id === "claude");
43267
+ const containsClaudeCode = group.agents.some((agent) => preview.nativeAgentIds.includes(agent.id));
43192
43268
  if (!containsClaudeCode) {
43193
- return `${portableSummary}. Skills will be installed here, but Claude-specific components will not be fully available for these agents.`;
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 !== "claude").map((agent) => agent.name);
43196
- const installPath = formatPathForDisplay(preview.nativePreview.installPath, projectPath);
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; the native plugin installs at ${installPath}.`;
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; the native plugin installs at ${installPath}. ${otherAgentsLabel} ${shareVerb} this skills directory but only ${receiveVerb} the installed skills.`;
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;AA4BpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8Z7D"}
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"}