allagents 0.32.1 → 0.33.0-next.1

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +74 -37
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -155,7 +155,7 @@ Create `.allagents/template.code-workspace` for VSCode-specific settings, launch
155
155
  "settings": {
156
156
  "cSpell.words": ["myterm"],
157
157
  "chat.agent.maxRequests": 999,
158
- "chat.useClaudeSkills": true
158
+ "chat.useAgentSkills": true
159
159
  },
160
160
  "launch": {
161
161
  "configurations": [
package/dist/index.js CHANGED
@@ -22498,7 +22498,6 @@ var init_marketplace_manifest_parser = __esm(() => {
22498
22498
  var exports_user_workspace = {};
22499
22499
  __export(exports_user_workspace, {
22500
22500
  setUserClients: () => setUserClients,
22501
- resolveGitHubIdentity: () => resolveGitHubIdentity,
22502
22501
  removeUserPluginsForMarketplace: () => removeUserPluginsForMarketplace,
22503
22502
  removeUserPlugin: () => removeUserPlugin,
22504
22503
  removeUserEnabledSkill: () => removeUserEnabledSkill,
@@ -22669,29 +22668,6 @@ async function removeUserPluginsForMarketplace(marketplaceName) {
22669
22668
  await writeFile2(configPath, dump(config, { lineWidth: -1 }), "utf-8");
22670
22669
  return matching.map((entry) => getPluginSource(entry));
22671
22670
  }
22672
- async function resolveGitHubIdentity(pluginSource) {
22673
- if (isGitHubUrl(pluginSource)) {
22674
- const parsed = parseGitHubUrl(pluginSource);
22675
- return parsed ? `${parsed.owner}/${parsed.repo}`.toLowerCase() : null;
22676
- }
22677
- if (isPluginSpec(pluginSource)) {
22678
- const parsed = parsePluginSpec(pluginSource);
22679
- if (!parsed)
22680
- return null;
22681
- const marketplace = await getMarketplace(parsed.marketplaceName);
22682
- if (!marketplace)
22683
- return null;
22684
- const manifestResult = await parseMarketplaceManifest(marketplace.path);
22685
- if (!manifestResult.success)
22686
- return null;
22687
- const entry = manifestResult.data.plugins.find((p) => p.name === parsed.plugin);
22688
- if (!entry || typeof entry.source === "string")
22689
- return null;
22690
- const parsedUrl = parseGitHubUrl(entry.source.url);
22691
- return parsedUrl ? `${parsedUrl.owner}/${parsedUrl.repo}`.toLowerCase() : null;
22692
- }
22693
- return null;
22694
- }
22695
22671
  async function addPluginToUserConfig(plugin, configPath, autoRegistered) {
22696
22672
  try {
22697
22673
  const content = await readFile4(configPath, "utf-8");
@@ -22912,7 +22888,6 @@ var init_user_workspace = __esm(() => {
22912
22888
  init_js_yaml();
22913
22889
  init_constants();
22914
22890
  init_workspace_config();
22915
- init_marketplace_manifest_parser();
22916
22891
  init_plugin_path();
22917
22892
  init_marketplace();
22918
22893
  init_marketplace();
@@ -23488,7 +23463,7 @@ async function resolvePluginSpecWithAutoRegister(spec, options = {}) {
23488
23463
  Expected at: ${join9(marketplace.path, expectedSubpath, pluginName)}`
23489
23464
  };
23490
23465
  }
23491
- const shouldReturnRegisteredAs = didAutoRegister || marketplace.name !== marketplaceName;
23466
+ const shouldReturnRegisteredAs = didAutoRegister || marketplace.name !== marketplaceName || owner != null && subpath == null;
23492
23467
  const marketplaceSource = marketplace.source.type === "github" ? marketplace.source.location : undefined;
23493
23468
  return {
23494
23469
  success: true,
@@ -23670,6 +23645,19 @@ async function addPluginToConfig(plugin, configPath, autoRegistered) {
23670
23645
  error: `Plugin already exists in .allagents/workspace.yaml: ${plugin}`
23671
23646
  };
23672
23647
  }
23648
+ const newIdentity = await resolveGitHubIdentity(plugin);
23649
+ if (newIdentity) {
23650
+ for (const existing of config.plugins) {
23651
+ const existingSource = getPluginSource(existing);
23652
+ const existingIdentity = await resolveGitHubIdentity(existingSource);
23653
+ if (existingIdentity === newIdentity) {
23654
+ return {
23655
+ success: false,
23656
+ error: `Plugin duplicates existing entry '${existingSource}': both resolve to ${newIdentity}`
23657
+ };
23658
+ }
23659
+ }
23660
+ }
23673
23661
  config.plugins.push(plugin);
23674
23662
  const newContent = dump(config, { lineWidth: -1 });
23675
23663
  await writeFile4(configPath, newContent, "utf-8");
@@ -23724,6 +23712,21 @@ async function removePlugin(plugin, workspacePath = process.cwd()) {
23724
23712
  return source.startsWith(`${plugin}@`) || source === plugin;
23725
23713
  });
23726
23714
  }
23715
+ if (index === -1) {
23716
+ const identity = await resolveGitHubIdentity(plugin);
23717
+ if (identity) {
23718
+ for (let i2 = 0;i2 < config.plugins.length; i2++) {
23719
+ const p = config.plugins[i2];
23720
+ if (!p)
23721
+ continue;
23722
+ const existing = await resolveGitHubIdentity(getPluginSource(p));
23723
+ if (existing === identity) {
23724
+ index = i2;
23725
+ break;
23726
+ }
23727
+ }
23728
+ }
23729
+ }
23727
23730
  if (index === -1) {
23728
23731
  return {
23729
23732
  success: false,
@@ -23909,6 +23912,29 @@ function pruneEnabledSkillsForPlugin(config, pluginEntry) {
23909
23912
  config.enabledSkills = undefined;
23910
23913
  }
23911
23914
  }
23915
+ async function resolveGitHubIdentity(pluginSource) {
23916
+ if (isGitHubUrl(pluginSource)) {
23917
+ const parsed = parseGitHubUrl(pluginSource);
23918
+ return parsed ? `${parsed.owner}/${parsed.repo}`.toLowerCase() : null;
23919
+ }
23920
+ if (isPluginSpec(pluginSource)) {
23921
+ const parsed = parsePluginSpec(pluginSource);
23922
+ if (!parsed)
23923
+ return null;
23924
+ const marketplace = await getMarketplace(parsed.marketplaceName);
23925
+ if (!marketplace)
23926
+ return null;
23927
+ const manifestResult = await parseMarketplaceManifest(marketplace.path);
23928
+ if (!manifestResult.success)
23929
+ return null;
23930
+ const entry = manifestResult.data.plugins.find((p) => p.name === parsed.plugin);
23931
+ if (!entry || typeof entry.source === "string")
23932
+ return null;
23933
+ const parsedUrl = parseGitHubUrl(entry.source.url);
23934
+ return parsedUrl ? `${parsedUrl.owner}/${parsedUrl.repo}`.toLowerCase() : null;
23935
+ }
23936
+ return null;
23937
+ }
23912
23938
  async function updateRepositories(changes, workspacePath = process.cwd()) {
23913
23939
  if (changes.remove.length === 0 && changes.add.length === 0) {
23914
23940
  return { success: true };
@@ -23935,6 +23961,7 @@ var init_workspace_modify = __esm(() => {
23935
23961
  init_constants();
23936
23962
  init_workspace_config();
23937
23963
  init_plugin_path();
23964
+ init_marketplace_manifest_parser();
23938
23965
  init_marketplace();
23939
23966
  DEFAULT_PROJECT_CLIENTS = ["universal"];
23940
23967
  });
@@ -26060,7 +26087,7 @@ var init_github_fetch = __esm(() => {
26060
26087
  });
26061
26088
 
26062
26089
  // src/core/workspace.ts
26063
- import { mkdir as mkdir8, readFile as readFile9, writeFile as writeFile7, copyFile as copyFile2 } from "node:fs/promises";
26090
+ import { mkdir as mkdir8, readFile as readFile9, writeFile as writeFile7, copyFile as copyFile2, unlink as unlink3 } from "node:fs/promises";
26064
26091
  import { existsSync as existsSync13 } from "node:fs";
26065
26092
  import { join as join16, resolve as resolve10, dirname as dirname8, relative as relative5, sep as sep2, isAbsolute as isAbsolute4 } from "node:path";
26066
26093
  import { fileURLToPath } from "node:url";
@@ -26069,8 +26096,12 @@ async function initWorkspace(targetPath = ".", options = {}) {
26069
26096
  const configDir = join16(absoluteTarget, CONFIG_DIR);
26070
26097
  const configPath = join16(configDir, WORKSPACE_CONFIG_FILE);
26071
26098
  if (existsSync13(configPath)) {
26072
- throw new Error(`Workspace already exists: ${absoluteTarget}
26099
+ if (options.force) {
26100
+ await unlink3(configPath);
26101
+ } else {
26102
+ throw new Error(`Workspace already exists: ${absoluteTarget}
26073
26103
  Found existing ${CONFIG_DIR}/${WORKSPACE_CONFIG_FILE}`);
26104
+ }
26074
26105
  }
26075
26106
  const currentFilePath = fileURLToPath(import.meta.url);
26076
26107
  const currentFileDir = dirname8(currentFilePath);
@@ -28981,7 +29012,7 @@ var package_default;
28981
29012
  var init_package = __esm(() => {
28982
29013
  package_default = {
28983
29014
  name: "allagents",
28984
- version: "0.32.1",
29015
+ version: "0.33.0-next.1",
28985
29016
  description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
28986
29017
  type: "module",
28987
29018
  bin: {
@@ -30630,9 +30661,10 @@ var initCmd = import_cmd_ts2.command({
30630
30661
  args: {
30631
30662
  path: import_cmd_ts2.positional({ type: import_cmd_ts2.optional(import_cmd_ts2.string), displayName: "path" }),
30632
30663
  from: import_cmd_ts2.option({ type: import_cmd_ts2.optional(import_cmd_ts2.string), long: "from", description: "Copy workspace.yaml from existing template/workspace" }),
30633
- client: import_cmd_ts2.option({ type: import_cmd_ts2.optional(import_cmd_ts2.string), long: "client", short: "c", description: "Comma-separated clients with optional :mode (e.g., claude:native,copilot,cursor)" })
30664
+ client: import_cmd_ts2.option({ type: import_cmd_ts2.optional(import_cmd_ts2.string), long: "client", short: "c", description: "Comma-separated clients with optional :mode (e.g., claude:native,copilot,cursor)" }),
30665
+ force: import_cmd_ts2.flag({ long: "force", short: "f", description: "Overwrite existing workspace.yaml" })
30634
30666
  },
30635
- handler: async ({ path, from, client }) => {
30667
+ handler: async ({ path, from, client, force }) => {
30636
30668
  try {
30637
30669
  const targetPath = path ?? ".";
30638
30670
  let clients = client ? parseClientEntries(client) : undefined;
@@ -30649,7 +30681,8 @@ var initCmd = import_cmd_ts2.command({
30649
30681
  }
30650
30682
  const result = await initWorkspace(targetPath, {
30651
30683
  ...from ? { from } : {},
30652
- ...clients ? { clients } : {}
30684
+ ...clients ? { clients } : {},
30685
+ ...force ? { force } : {}
30653
30686
  });
30654
30687
  if (isJsonMode()) {
30655
30688
  const syncData = result.syncResult ? buildSyncData(result.syncResult) : null;
@@ -32281,6 +32314,9 @@ var pluginListCmd = import_cmd_ts4.command({
32281
32314
  args: {},
32282
32315
  handler: async () => {
32283
32316
  try {
32317
+ let canonicalKey = function(name, marketplace, scope) {
32318
+ return `${name}:${marketplace}:${scope}`;
32319
+ };
32284
32320
  const pluginClients = new Map;
32285
32321
  async function loadConfigClients(configPath, scope) {
32286
32322
  if (!existsSync19(configPath))
@@ -32309,13 +32345,13 @@ var pluginListCmd = import_cmd_ts4.command({
32309
32345
  const projectSyncState = await loadSyncState(process.cwd());
32310
32346
  const merged = new Map;
32311
32347
  for (const p of allInstalled) {
32312
- const key = `${p.spec}:${p.scope}`;
32348
+ const key = canonicalKey(p.name, p.marketplace, p.scope);
32313
32349
  merged.set(key, {
32314
32350
  spec: p.spec,
32315
32351
  name: p.name,
32316
32352
  marketplace: p.marketplace,
32317
32353
  scope: p.scope,
32318
- fileClients: pluginClients.get(key) ?? [],
32354
+ fileClients: pluginClients.get(`${p.spec}:${p.scope}`) ?? [],
32319
32355
  nativeClients: []
32320
32356
  });
32321
32357
  }
@@ -32325,7 +32361,8 @@ var pluginListCmd = import_cmd_ts4.command({
32325
32361
  ]) {
32326
32362
  for (const [client, specs] of Object.entries(state?.nativePlugins ?? {})) {
32327
32363
  for (const spec of specs) {
32328
- const key = `${spec}:${scope}`;
32364
+ const parsed = parsePluginSpec(spec);
32365
+ const key = parsed ? canonicalKey(parsed.plugin, parsed.marketplaceName, scope) : `${spec}::${scope}`;
32329
32366
  const existing = merged.get(key);
32330
32367
  if (existing) {
32331
32368
  if (!existing.nativeClients.includes(client)) {
@@ -32334,8 +32371,8 @@ var pluginListCmd = import_cmd_ts4.command({
32334
32371
  } else {
32335
32372
  merged.set(key, {
32336
32373
  spec,
32337
- name: spec.split("@")[0] ?? spec,
32338
- marketplace: spec.split("@")[1] ?? "",
32374
+ name: parsed?.plugin ?? spec,
32375
+ marketplace: parsed?.marketplaceName ?? "",
32339
32376
  scope,
32340
32377
  fileClients: [],
32341
32378
  nativeClients: [client]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "0.32.1",
3
+ "version": "0.33.0-next.1",
4
4
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
5
5
  "type": "module",
6
6
  "bin": {