allagents 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/dist/index.js +107 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22313,6 +22313,10 @@ var MarketplaceManifestSchema = exports_external.object({
22313
22313
  owner: ContactSchema.optional(),
22314
22314
  plugins: exports_external.array(MarketplacePluginEntrySchema)
22315
22315
  });
22316
+ var MarketplaceManifestLenientSchema = exports_external.object({
22317
+ name: exports_external.string().optional(),
22318
+ plugins: exports_external.array(exports_external.unknown())
22319
+ }).passthrough();
22316
22320
 
22317
22321
  // src/utils/marketplace-manifest-parser.ts
22318
22322
  var MANIFEST_PATH = ".claude-plugin/marketplace.json";
@@ -22342,17 +22346,79 @@ async function parseMarketplaceManifest(marketplacePath) {
22342
22346
  error: "Failed to parse marketplace.json as JSON: invalid syntax"
22343
22347
  };
22344
22348
  }
22345
- const result = MarketplaceManifestSchema.safeParse(json2);
22346
- if (!result.success) {
22347
- const issues = result.error.issues.map((i2) => ` ${i2.path.join(".")}: ${i2.message}`).join(`
22348
- `);
22349
+ const strictResult = MarketplaceManifestSchema.safeParse(json2);
22350
+ if (strictResult.success) {
22351
+ return { success: true, data: strictResult.data, warnings: [] };
22352
+ }
22353
+ return parseLeniently(json2);
22354
+ }
22355
+ function parseLeniently(json2) {
22356
+ const lenientResult = MarketplaceManifestLenientSchema.safeParse(json2);
22357
+ if (!lenientResult.success) {
22349
22358
  return {
22350
22359
  success: false,
22351
- error: `Marketplace manifest validation failed:
22352
- ${issues}`
22360
+ error: 'Marketplace manifest must contain a "plugins" array'
22353
22361
  };
22354
22362
  }
22355
- return { success: true, data: result.data };
22363
+ const raw = lenientResult.data;
22364
+ const warnings = [];
22365
+ const obj = json2;
22366
+ const validPlugins = [];
22367
+ for (let i2 = 0;i2 < raw.plugins.length; i2++) {
22368
+ const entry = raw.plugins[i2];
22369
+ const entryResult = MarketplacePluginEntrySchema.safeParse(entry);
22370
+ if (entryResult.success) {
22371
+ validPlugins.push(entryResult.data);
22372
+ continue;
22373
+ }
22374
+ const extracted = extractPluginEntry(entry, i2, warnings);
22375
+ if (extracted) {
22376
+ validPlugins.push(extracted);
22377
+ }
22378
+ }
22379
+ const data = {
22380
+ name: typeof raw.name === "string" ? raw.name : "unknown",
22381
+ description: typeof obj.description === "string" ? obj.description : "",
22382
+ plugins: validPlugins
22383
+ };
22384
+ return { success: true, data, warnings };
22385
+ }
22386
+ function extractPluginEntry(entry, index, warnings) {
22387
+ if (!entry || typeof entry !== "object") {
22388
+ warnings.push(`plugins[${index}]: not an object, skipped`);
22389
+ return null;
22390
+ }
22391
+ const obj = entry;
22392
+ const name = typeof obj.name === "string" && obj.name ? obj.name : undefined;
22393
+ if (!name) {
22394
+ warnings.push(`plugins[${index}]: missing "name" field, skipped`);
22395
+ return null;
22396
+ }
22397
+ let description = "";
22398
+ if (typeof obj.description === "string" && obj.description) {
22399
+ description = obj.description;
22400
+ } else if (obj.metadata && typeof obj.metadata === "object" && typeof obj.metadata.description === "string") {
22401
+ description = obj.metadata.description;
22402
+ warnings.push(`plugins[${index}] ("${name}"): "description" found in metadata instead of top level`);
22403
+ } else {
22404
+ warnings.push(`plugins[${index}] ("${name}"): missing "description" field`);
22405
+ }
22406
+ let source = "";
22407
+ if (typeof obj.source === "string") {
22408
+ source = obj.source;
22409
+ } else if (obj.source && typeof obj.source === "object" && obj.source.source === "url" && typeof obj.source.url === "string") {
22410
+ source = obj.source;
22411
+ } else {
22412
+ warnings.push(`plugins[${index}] ("${name}"): missing or invalid "source" field`);
22413
+ }
22414
+ return {
22415
+ name,
22416
+ description,
22417
+ source,
22418
+ ...typeof obj.version === "string" && { version: obj.version },
22419
+ ...typeof obj.category === "string" && { category: obj.category },
22420
+ ...typeof obj.homepage === "string" && { homepage: obj.homepage }
22421
+ };
22356
22422
  }
22357
22423
  function resolvePluginSourcePath(source, marketplacePath) {
22358
22424
  if (typeof source === "object") {
@@ -22599,9 +22665,9 @@ async function updateMarketplace(name) {
22599
22665
  async function getMarketplacePluginsFromManifest(marketplacePath) {
22600
22666
  const result = await parseMarketplaceManifest(marketplacePath);
22601
22667
  if (!result.success) {
22602
- return [];
22668
+ return { plugins: [], warnings: [] };
22603
22669
  }
22604
- return result.data.plugins.map((plugin) => {
22670
+ const plugins = result.data.plugins.map((plugin) => {
22605
22671
  const resolvedSource = resolvePluginSourcePath(plugin.source, marketplacePath);
22606
22672
  const info = {
22607
22673
  name: plugin.name,
@@ -22615,28 +22681,30 @@ async function getMarketplacePluginsFromManifest(marketplacePath) {
22615
22681
  info.homepage = plugin.homepage;
22616
22682
  return info;
22617
22683
  });
22684
+ return { plugins, warnings: result.warnings };
22618
22685
  }
22619
22686
  async function listMarketplacePlugins(name) {
22620
22687
  const marketplace = await getMarketplace(name);
22621
22688
  if (!marketplace) {
22622
- return [];
22689
+ return { plugins: [], warnings: [] };
22623
22690
  }
22624
- const manifestPlugins = await getMarketplacePluginsFromManifest(marketplace.path);
22625
- if (manifestPlugins.length > 0) {
22626
- return manifestPlugins;
22691
+ const manifestResult = await getMarketplacePluginsFromManifest(marketplace.path);
22692
+ if (manifestResult.plugins.length > 0) {
22693
+ return manifestResult;
22627
22694
  }
22628
22695
  const pluginsDir = join6(marketplace.path, "plugins");
22629
22696
  if (!existsSync5(pluginsDir)) {
22630
- return [];
22697
+ return { plugins: [], warnings: manifestResult.warnings };
22631
22698
  }
22632
22699
  try {
22633
22700
  const entries = await readdir3(pluginsDir, { withFileTypes: true });
22634
- return entries.filter((e) => e.isDirectory()).map((e) => ({
22701
+ const plugins = entries.filter((e) => e.isDirectory()).map((e) => ({
22635
22702
  name: e.name,
22636
22703
  path: join6(pluginsDir, e.name)
22637
22704
  })).sort((a, b) => a.name.localeCompare(b.name));
22705
+ return { plugins, warnings: manifestResult.warnings };
22638
22706
  } catch {
22639
- return [];
22707
+ return { plugins: [], warnings: manifestResult.warnings };
22640
22708
  }
22641
22709
  }
22642
22710
  function parsePluginSpec(spec) {
@@ -24765,28 +24833,42 @@ var pluginListCmd = import_cmd_ts2.command({
24765
24833
  }
24766
24834
  if (isJsonMode()) {
24767
24835
  const allPlugins = [];
24836
+ const allWarnings = [];
24768
24837
  for (const mp of toList) {
24769
- const plugins = await listMarketplacePlugins(mp.name);
24770
- for (const plugin of plugins) {
24838
+ const result = await listMarketplacePlugins(mp.name);
24839
+ for (const plugin of result.plugins) {
24771
24840
  allPlugins.push({ name: plugin.name, marketplace: mp.name });
24772
24841
  }
24842
+ for (const warning of result.warnings) {
24843
+ allWarnings.push(`${mp.name}: ${warning}`);
24844
+ }
24773
24845
  }
24774
24846
  jsonOutput({
24775
24847
  success: true,
24776
24848
  command: "plugin list",
24777
- data: { plugins: allPlugins, total: allPlugins.length }
24849
+ data: {
24850
+ plugins: allPlugins,
24851
+ total: allPlugins.length,
24852
+ ...allWarnings.length > 0 && { warnings: allWarnings }
24853
+ }
24778
24854
  });
24779
24855
  return;
24780
24856
  }
24781
24857
  let totalPlugins = 0;
24782
24858
  for (const mp of toList) {
24783
- const plugins = await listMarketplacePlugins(mp.name);
24784
- if (plugins.length === 0) {
24859
+ const result = await listMarketplacePlugins(mp.name);
24860
+ if (result.plugins.length === 0 && result.warnings.length === 0) {
24785
24861
  console.log(`${mp.name}: (no plugins found)`);
24786
24862
  continue;
24787
24863
  }
24788
24864
  console.log(`${mp.name}:`);
24789
- for (const plugin of plugins) {
24865
+ for (const warning of result.warnings) {
24866
+ console.log(` Warning: ${warning}`);
24867
+ }
24868
+ if (result.plugins.length === 0) {
24869
+ console.log(" (no plugins found)");
24870
+ }
24871
+ for (const plugin of result.plugins) {
24790
24872
  console.log(` - ${plugin.name}@${mp.name}`);
24791
24873
  totalPlugins++;
24792
24874
  }
@@ -25061,7 +25143,9 @@ var packageJsonPath = join13(__dirname2, "..", "package.json");
25061
25143
  var packageJson = JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
25062
25144
  var app = import_cmd_ts4.subcommands({
25063
25145
  name: "allagents",
25064
- description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
25146
+ description: `CLI tool for managing multi-repo AI agent workspaces with plugin synchronization
25147
+
25148
+ ` + "For AI agents: use --agent-help for machine-readable help, or --json for structured output",
25065
25149
  version: packageJson.version,
25066
25150
  cmds: {
25067
25151
  workspace: workspaceCmd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
5
5
  "type": "module",
6
6
  "bin": {