allagents 1.0.6 → 1.0.7

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 +183 -46
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6378,7 +6378,7 @@ var require_parse = __commonJS((exports, module) => {
6378
6378
  var token;
6379
6379
  var key;
6380
6380
  var root;
6381
- module.exports = function parse2(text, reviver) {
6381
+ module.exports = function parse(text, reviver) {
6382
6382
  source = String(text);
6383
6383
  parseState = "start";
6384
6384
  stack = [];
@@ -13446,7 +13446,7 @@ function gitInstanceFactory(baseDir, options2) {
13446
13446
  }
13447
13447
  var import_file_exists, import_debug, import_promise_deferred, import_promise_deferred2, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __esm2 = (fn, res) => function __init() {
13448
13448
  return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
13449
- }, __commonJS2 = (cb, mod) => function __require2() {
13449
+ }, __commonJS2 = (cb, mod) => function __require() {
13450
13450
  return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13451
13451
  }, __export2 = (target, all) => {
13452
13452
  for (var name in all)
@@ -21933,7 +21933,7 @@ var require_is_extendable = __commonJS((exports, module) => {
21933
21933
  // node_modules/extend-shallow/index.js
21934
21934
  var require_extend_shallow = __commonJS((exports, module) => {
21935
21935
  var isObject2 = require_is_extendable();
21936
- module.exports = function extend3(o) {
21936
+ module.exports = function extend(o) {
21937
21937
  if (!isObject2(o)) {
21938
21938
  o = {};
21939
21939
  }
@@ -22127,7 +22127,7 @@ var require_exception = __commonJS((exports, module) => {
22127
22127
  }
22128
22128
  YAMLException2.prototype = Object.create(Error.prototype);
22129
22129
  YAMLException2.prototype.constructor = YAMLException2;
22130
- YAMLException2.prototype.toString = function toString2(compact) {
22130
+ YAMLException2.prototype.toString = function toString(compact) {
22131
22131
  var result = this.name + ": ";
22132
22132
  result += this.reason || "(unknown reason)";
22133
22133
  if (!compact && this.mark) {
@@ -22180,7 +22180,7 @@ var require_mark = __commonJS((exports, module) => {
22180
22180
  return common2.repeat(" ", indent) + head + snippet2 + tail + `
22181
22181
  ` + common2.repeat(" ", indent + this.position - start + head.length) + "^";
22182
22182
  };
22183
- Mark.prototype.toString = function toString2(compact) {
22183
+ Mark.prototype.toString = function toString(compact) {
22184
22184
  var snippet2, where = "";
22185
22185
  if (this.name) {
22186
22186
  where += 'in "' + this.name + '" ';
@@ -23275,7 +23275,7 @@ var require_loader = __commonJS((exports, module) => {
23275
23275
  }
23276
23276
  }
23277
23277
  var directiveHandlers2 = {
23278
- YAML: function handleYamlDirective2(state, name, args) {
23278
+ YAML: function handleYamlDirective(state, name, args) {
23279
23279
  var match, major, minor;
23280
23280
  if (state.version !== null) {
23281
23281
  throwError2(state, "duplication of %YAML directive");
@@ -23298,7 +23298,7 @@ var require_loader = __commonJS((exports, module) => {
23298
23298
  throwWarning2(state, "unsupported YAML version of the document");
23299
23299
  }
23300
23300
  },
23301
- TAG: function handleTagDirective2(state, name, args) {
23301
+ TAG: function handleTagDirective(state, name, args) {
23302
23302
  var handle, prefix;
23303
23303
  if (args.length !== 2) {
23304
23304
  throwError2(state, "TAG directive accepts exactly two arguments");
@@ -33416,7 +33416,7 @@ var package_default;
33416
33416
  var init_package = __esm(() => {
33417
33417
  package_default = {
33418
33418
  name: "allagents",
33419
- version: "1.0.6",
33419
+ version: "1.0.7",
33420
33420
  description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
33421
33421
  type: "module",
33422
33422
  bin: {
@@ -36092,6 +36092,8 @@ init_constants();
36092
36092
  init_plugin_path();
36093
36093
  init_plugin();
36094
36094
  init_skill();
36095
+ init_marketplace();
36096
+ init_marketplace_manifest_parser();
36095
36097
  function hasProjectConfig(dir) {
36096
36098
  return existsSync19(join22(dir, CONFIG_DIR, WORKSPACE_CONFIG_FILE));
36097
36099
  }
@@ -36355,6 +36357,148 @@ Syncing workspace...
36355
36357
  }
36356
36358
  }
36357
36359
  });
36360
+ async function installSkillFromSource(opts) {
36361
+ const { skill, from, isUser, workspacePath } = opts;
36362
+ if (!isJsonMode()) {
36363
+ console.log(`Skill '${skill}' not found. Installing from: ${from}...`);
36364
+ }
36365
+ const parsed = isGitHubUrl(from) ? parseGitHubUrl(from) : null;
36366
+ const fetchResult = await fetchPlugin(from, {
36367
+ ...parsed?.branch && { branch: parsed.branch }
36368
+ });
36369
+ if (!fetchResult.success) {
36370
+ return { success: false, error: `Failed to fetch '${from}': ${fetchResult.error ?? "Unknown error"}` };
36371
+ }
36372
+ const manifestResult = await parseMarketplaceManifest(fetchResult.cachePath);
36373
+ if (manifestResult.success) {
36374
+ return installSkillViaMarketplace({ skill, from, isUser, workspacePath });
36375
+ }
36376
+ return installSkillDirect({ skill, from, isUser, workspacePath, cachePath: fetchResult.cachePath });
36377
+ }
36378
+ async function installSkillViaMarketplace(opts) {
36379
+ const { skill, from, isUser, workspacePath } = opts;
36380
+ if (!isJsonMode()) {
36381
+ console.log("Detected marketplace. Registering...");
36382
+ }
36383
+ const parsed = isGitHubUrl(from) ? parseGitHubUrl(from) : null;
36384
+ const scopeOptions = isUser ? undefined : { scope: "project", workspacePath };
36385
+ let marketplaceName;
36386
+ const mktResult = await addMarketplace(from, parsed?.branch ? `${parsed.repo}-${parsed.branch}` : undefined, parsed?.branch ?? undefined, undefined, scopeOptions);
36387
+ if (mktResult.success) {
36388
+ marketplaceName = mktResult.marketplace?.name;
36389
+ } else if (mktResult.error?.includes("already exists") || mktResult.alreadyRegistered) {
36390
+ const sourceLocation = parsed ? `${parsed.owner}/${parsed.repo}` : undefined;
36391
+ const existing = await findMarketplace(parsed?.repo ?? from, sourceLocation, isUser ? undefined : workspacePath);
36392
+ if (existing) {
36393
+ marketplaceName = existing.name;
36394
+ if (!isJsonMode()) {
36395
+ console.log(`Marketplace '${marketplaceName}' already registered. Updating...`);
36396
+ }
36397
+ await updateMarketplace(marketplaceName, isUser ? undefined : workspacePath);
36398
+ }
36399
+ }
36400
+ if (!marketplaceName) {
36401
+ return { success: false, error: `Failed to register marketplace: ${mktResult.error ?? "Unknown error"}` };
36402
+ }
36403
+ const mktPlugins = await listMarketplacePlugins(marketplaceName, isUser ? undefined : workspacePath);
36404
+ if (mktPlugins.plugins.length === 0) {
36405
+ return { success: false, error: `No plugins found in marketplace '${marketplaceName}'.` };
36406
+ }
36407
+ let targetPluginName = null;
36408
+ const allAvailableSkills = [];
36409
+ for (const mktPlugin of mktPlugins.plugins) {
36410
+ const skillNames = await discoverSkillNames(mktPlugin.path);
36411
+ allAvailableSkills.push(...skillNames);
36412
+ if (!targetPluginName && skillNames.includes(skill)) {
36413
+ targetPluginName = mktPlugin.name;
36414
+ }
36415
+ }
36416
+ if (!targetPluginName) {
36417
+ return {
36418
+ success: false,
36419
+ error: `Skill '${skill}' not found in marketplace '${marketplaceName}'.
36420
+
36421
+ Available skills: ${allAvailableSkills.join(", ") || "none"}`
36422
+ };
36423
+ }
36424
+ const pluginSpec = `${targetPluginName}@${marketplaceName}`;
36425
+ if (!isJsonMode()) {
36426
+ console.log(`Found skill '${skill}' in plugin '${targetPluginName}'. Installing ${pluginSpec}...`);
36427
+ }
36428
+ const installResult = isUser ? await addUserPlugin(pluginSpec) : await addPlugin(pluginSpec, workspacePath);
36429
+ if (!installResult.success) {
36430
+ if (!installResult.error?.includes("already exists") && !installResult.error?.includes("duplicates existing")) {
36431
+ return { success: false, error: `Failed to install plugin '${pluginSpec}': ${installResult.error ?? "Unknown error"}` };
36432
+ }
36433
+ if (!isJsonMode()) {
36434
+ console.log(`Plugin '${pluginSpec}' already installed.`);
36435
+ }
36436
+ }
36437
+ return applySkillAllowlist({ skill, pluginName: targetPluginName, isUser, workspacePath });
36438
+ }
36439
+ async function installSkillDirect(opts) {
36440
+ const { skill, from, isUser, workspacePath, cachePath } = opts;
36441
+ const availableSkills = await discoverSkillNames(cachePath);
36442
+ if (!availableSkills.includes(skill)) {
36443
+ return {
36444
+ success: false,
36445
+ error: `Skill '${skill}' not found in plugin '${from}'.
36446
+
36447
+ Available skills: ${availableSkills.join(", ") || "none"}
36448
+
36449
+ Tip: run \`allagents skills list\` to see all installed skills.`
36450
+ };
36451
+ }
36452
+ const installResult = isUser ? await addUserPlugin(from) : await addPlugin(from, workspacePath);
36453
+ if (!installResult.success) {
36454
+ if (!installResult.error?.includes("already exists") && !installResult.error?.includes("duplicates existing")) {
36455
+ return { success: false, error: `Failed to install plugin '${from}': ${installResult.error ?? "Unknown error"}` };
36456
+ }
36457
+ if (!isJsonMode()) {
36458
+ console.log("Plugin already installed.");
36459
+ }
36460
+ }
36461
+ const pluginName = getPluginName(cachePath);
36462
+ return applySkillAllowlist({ skill, pluginName, isUser, workspacePath });
36463
+ }
36464
+ async function applySkillAllowlist(opts) {
36465
+ const { skill, pluginName, isUser, workspacePath } = opts;
36466
+ const allSkills = await getAllSkillsFromPlugins(workspacePath);
36467
+ const pluginSkills = allSkills.filter((s) => s.pluginName === pluginName);
36468
+ const currentMode = pluginSkills[0]?.pluginSkillsMode ?? "none";
36469
+ if (currentMode === "allowlist") {
36470
+ const skillKey = `${pluginName}:${skill}`;
36471
+ const addResult = isUser ? await addUserEnabledSkill(skillKey) : await addEnabledSkill(skillKey, workspacePath);
36472
+ if (!addResult.success) {
36473
+ if (!addResult.error?.includes("already enabled")) {
36474
+ return { success: false, error: `Failed to enable skill: ${addResult.error ?? "Unknown error"}` };
36475
+ }
36476
+ }
36477
+ } else {
36478
+ const setModeResult = isUser ? await setUserPluginSkillsMode(pluginName, "allowlist", [skill]) : await setPluginSkillsMode(pluginName, "allowlist", [skill], workspacePath);
36479
+ if (!setModeResult.success) {
36480
+ return { success: false, error: `Failed to configure skill allowlist: ${setModeResult.error ?? "Unknown error"}` };
36481
+ }
36482
+ }
36483
+ if (!isJsonMode()) {
36484
+ console.log(`✓ Enabled skill: ${skill} (${pluginName})`);
36485
+ console.log(`
36486
+ Syncing workspace...
36487
+ `);
36488
+ }
36489
+ const syncResult = isUser ? await syncUserWorkspace() : await syncWorkspace(workspacePath);
36490
+ if (!syncResult.success) {
36491
+ return { success: false, error: "Sync failed" };
36492
+ }
36493
+ return {
36494
+ success: true,
36495
+ pluginName,
36496
+ syncResult: {
36497
+ copied: syncResult.totalCopied,
36498
+ failed: syncResult.totalFailed
36499
+ }
36500
+ };
36501
+ }
36358
36502
  var addCmd = import_cmd_ts3.command({
36359
36503
  name: "add",
36360
36504
  description: buildDescription(skillsAddMeta),
@@ -36403,56 +36547,49 @@ var addCmd = import_cmd_ts3.command({
36403
36547
  skill = urlResolved.skill;
36404
36548
  }
36405
36549
  }
36406
- let matches = await findSkillByName(skill, workspacePath);
36550
+ const matches = await findSkillByName(skill, workspacePath);
36407
36551
  if (matches.length === 0) {
36408
36552
  if (from) {
36409
- if (!isJsonMode()) {
36410
- console.log(`Skill '${skill}' not found. Installing plugin: ${from}...`);
36411
- }
36412
- const installResult = isUser ? await addUserPlugin(from) : await addPlugin(from, workspacePath);
36413
- if (!installResult.success) {
36414
- const error = `Failed to install plugin '${from}': ${installResult.error ?? "Unknown error"}`;
36553
+ const installFromResult = await installSkillFromSource({
36554
+ skill,
36555
+ from,
36556
+ isUser,
36557
+ workspacePath
36558
+ });
36559
+ if (!installFromResult.success) {
36415
36560
  if (isJsonMode()) {
36416
- jsonOutput({ success: false, command: "plugin skills add", error });
36561
+ jsonOutput({ success: false, command: "plugin skills add", error: installFromResult.error });
36417
36562
  process.exit(1);
36418
36563
  }
36419
- console.error(`Error: ${error}`);
36564
+ console.error(`Error: ${installFromResult.error}`);
36420
36565
  process.exit(1);
36421
36566
  }
36422
- if (!isJsonMode()) {
36423
- console.log(`Running initial sync...
36424
- `);
36425
- }
36426
- await (isUser ? syncUserWorkspace() : syncWorkspace(workspacePath));
36427
- matches = await findSkillByName(skill, workspacePath);
36428
- if (matches.length === 0) {
36429
- const allSkills = await getAllSkillsFromPlugins(workspacePath);
36430
- const skillNames = [...new Set(allSkills.map((s) => s.name))].join(", ");
36431
- const error = `Skill '${skill}' not found in plugin '${from}'.
36432
-
36433
- Available skills: ${skillNames || "none"}
36434
-
36435
- Tip: run \`allagents skills list\` to see all installed skills.`;
36436
- if (isJsonMode()) {
36437
- jsonOutput({ success: false, command: "plugin skills add", error });
36438
- process.exit(1);
36439
- }
36440
- console.error(`Error: ${error}`);
36441
- process.exit(1);
36567
+ if (isJsonMode()) {
36568
+ jsonOutput({
36569
+ success: true,
36570
+ command: "plugin skills add",
36571
+ data: {
36572
+ skill,
36573
+ plugin: installFromResult.pluginName,
36574
+ syncResult: installFromResult.syncResult
36575
+ }
36576
+ });
36577
+ return;
36442
36578
  }
36443
- } else {
36444
- const allSkills = await getAllSkillsFromPlugins(workspacePath);
36445
- const skillNames = [...new Set(allSkills.map((s) => s.name))].join(", ");
36446
- const error = `Skill '${skill}' not found in any installed plugin.
36579
+ console.log("Sync complete.");
36580
+ return;
36581
+ }
36582
+ const allSkills = await getAllSkillsFromPlugins(workspacePath);
36583
+ const skillNames = [...new Set(allSkills.map((s) => s.name))].join(", ");
36584
+ const error = `Skill '${skill}' not found in any installed plugin.
36447
36585
 
36448
36586
  Available skills: ${skillNames || "none"}`;
36449
- if (isJsonMode()) {
36450
- jsonOutput({ success: false, command: "plugin skills add", error });
36451
- process.exit(1);
36452
- }
36453
- console.error(`Error: ${error}`);
36587
+ if (isJsonMode()) {
36588
+ jsonOutput({ success: false, command: "plugin skills add", error });
36454
36589
  process.exit(1);
36455
36590
  }
36591
+ console.error(`Error: ${error}`);
36592
+ process.exit(1);
36456
36593
  }
36457
36594
  let targetSkill = matches[0];
36458
36595
  if (!targetSkill) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
5
5
  "type": "module",
6
6
  "bin": {