allagents 1.4.3 → 1.4.5

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 +108 -50
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -15625,6 +15625,42 @@ var init_esm = __esm(() => {
15625
15625
  esm_default = gitInstanceFactory;
15626
15626
  });
15627
15627
 
15628
+ // src/core/git-errors.ts
15629
+ function classifyError(error, url) {
15630
+ const errorMessage = error instanceof Error ? error.message : String(error);
15631
+ const isTimeout = errorMessage.includes("block timeout") || errorMessage.includes("timed out");
15632
+ const isAuthError = errorMessage.includes("Authentication failed") || errorMessage.includes("could not read Username") || errorMessage.includes("Permission denied") || errorMessage.includes("Repository not found");
15633
+ const isServerError = /returned error: 5\d\d/.test(errorMessage) || errorMessage.includes("Internal Server Error");
15634
+ if (isTimeout) {
15635
+ return new GitCloneError(`Clone timed out after 60s for ${url}.
15636
+ Check your network connection and repository access.
15637
+ For SSH: ssh-add -l (to check loaded keys)
15638
+ For HTTPS: Check your git credentials`, url, true, false);
15639
+ }
15640
+ if (isAuthError || isServerError) {
15641
+ return new GitCloneError(`Authentication failed for ${url}.
15642
+ For private repos, ensure you have access.
15643
+ For SSH: Check your keys with 'ssh -T git@github.com'
15644
+ For HTTPS: Configure git credentials or run 'gh auth setup-git'`, url, false, true);
15645
+ }
15646
+ return new GitCloneError(`Failed to clone ${url}: ${errorMessage}`, url, false, false);
15647
+ }
15648
+ var GitCloneError;
15649
+ var init_git_errors = __esm(() => {
15650
+ GitCloneError = class GitCloneError extends Error {
15651
+ url;
15652
+ isTimeout;
15653
+ isAuthError;
15654
+ constructor(message, url, isTimeout = false, isAuthError = false) {
15655
+ super(message);
15656
+ this.name = "GitCloneError";
15657
+ this.url = url;
15658
+ this.isTimeout = isTimeout;
15659
+ this.isAuthError = isAuthError;
15660
+ }
15661
+ };
15662
+ });
15663
+
15628
15664
  // src/core/git.ts
15629
15665
  import { mkdtemp, rm } from "node:fs/promises";
15630
15666
  import { tmpdir } from "node:os";
@@ -15689,39 +15725,10 @@ async function cleanupTempDir(dir) {
15689
15725
  }
15690
15726
  await rm(dir, { recursive: true, force: true });
15691
15727
  }
15692
- function classifyError(error, url) {
15693
- const errorMessage = error instanceof Error ? error.message : String(error);
15694
- const isTimeout = errorMessage.includes("block timeout") || errorMessage.includes("timed out");
15695
- const isAuthError = errorMessage.includes("Authentication failed") || errorMessage.includes("could not read Username") || errorMessage.includes("Permission denied") || errorMessage.includes("Repository not found");
15696
- if (isTimeout) {
15697
- return new GitCloneError(`Clone timed out after 60s for ${url}.
15698
- Check your network connection and repository access.
15699
- For SSH: ssh-add -l (to check loaded keys)
15700
- For HTTPS: Check your git credentials`, url, true, false);
15701
- }
15702
- if (isAuthError) {
15703
- return new GitCloneError(`Authentication failed for ${url}.
15704
- For private repos, ensure you have access.
15705
- For SSH: Check your keys with 'ssh -T git@github.com'
15706
- For HTTPS: Configure git credentials or run 'gh auth setup-git'`, url, false, true);
15707
- }
15708
- return new GitCloneError(`Failed to clone ${url}: ${errorMessage}`, url, false, false);
15709
- }
15710
- var CLONE_TIMEOUT_MS = 60000, GitCloneError;
15728
+ var CLONE_TIMEOUT_MS = 60000;
15711
15729
  var init_git = __esm(() => {
15712
15730
  init_esm();
15713
- GitCloneError = class GitCloneError extends Error {
15714
- url;
15715
- isTimeout;
15716
- isAuthError;
15717
- constructor(message, url, isTimeout = false, isAuthError = false) {
15718
- super(message);
15719
- this.name = "GitCloneError";
15720
- this.url = url;
15721
- this.isTimeout = isTimeout;
15722
- this.isAuthError = isAuthError;
15723
- }
15724
- };
15731
+ init_git_errors();
15725
15732
  });
15726
15733
 
15727
15734
  // src/utils/plugin-path.ts
@@ -26210,14 +26217,14 @@ function isUserConfigPath(workspacePath) {
26210
26217
  const userConfigPath = getUserWorkspaceConfigPath();
26211
26218
  return resolve6(projectConfigPath) === resolve6(userConfigPath);
26212
26219
  }
26213
- async function ensureUserWorkspace() {
26220
+ async function ensureUserWorkspace(clients) {
26214
26221
  const configPath = getUserWorkspaceConfigPath();
26215
26222
  if (existsSync6(configPath))
26216
26223
  return;
26217
26224
  const defaultConfig = {
26218
26225
  repositories: [],
26219
26226
  plugins: [],
26220
- clients: [...DEFAULT_USER_CLIENTS]
26227
+ clients: clients ? [...clients] : [...DEFAULT_USER_CLIENTS]
26221
26228
  };
26222
26229
  await mkdir4(getAllagentsDir(), { recursive: true });
26223
26230
  await writeFile2(configPath, dump(defaultConfig, { lineWidth: -1 }), "utf-8");
@@ -27538,6 +27545,10 @@ async function ensureMarketplacesRegistered(plugins) {
27538
27545
  return results;
27539
27546
  }
27540
27547
  async function loadMergedRegistries(userRegistryPath, projectRegistryPath) {
27548
+ if (resolve7(userRegistryPath) === resolve7(projectRegistryPath)) {
27549
+ const registry = await loadRegistryFromPath(userRegistryPath);
27550
+ return { registry, overrides: [] };
27551
+ }
27541
27552
  const [userRegistry, projectRegistry] = await Promise.all([
27542
27553
  loadRegistryFromPath(userRegistryPath),
27543
27554
  loadRegistryFromPath(projectRegistryPath)
@@ -27563,6 +27574,13 @@ async function getMarketplaceOverrides(userRegistryPath, projectRegistryPath) {
27563
27574
  return overrides;
27564
27575
  }
27565
27576
  async function listMarketplacesWithScope(userRegistryPath, projectRegistryPath) {
27577
+ if (resolve7(userRegistryPath) === resolve7(projectRegistryPath)) {
27578
+ const registry = await loadRegistryFromPath(userRegistryPath);
27579
+ return {
27580
+ entries: Object.values(registry.marketplaces).map((entry) => ({ ...entry, scope: "user" })).sort((a, b) => a.name.localeCompare(b.name)),
27581
+ overrides: []
27582
+ };
27583
+ }
27566
27584
  const [userRegistry, projectRegistry] = await Promise.all([
27567
27585
  loadRegistryFromPath(userRegistryPath),
27568
27586
  loadRegistryFromPath(projectRegistryPath)
@@ -30529,17 +30547,21 @@ async function syncWorkspace(workspacePath = process.cwd(), options2 = {}) {
30529
30547
  await ensureMarketplacesRegistered(filteredPlans.map((plan) => plan.source));
30530
30548
  const validatedPlugins = await validateAllPlugins(filteredPlans, workspacePath, offline);
30531
30549
  let validatedWorkspaceSource = null;
30550
+ const workspaceSourceWarnings = [];
30532
30551
  if (config.workspace?.source) {
30533
30552
  const sourceBasePath = workspaceSourceBase ?? workspacePath;
30534
- validatedWorkspaceSource = await validatePlugin(config.workspace.source, sourceBasePath, offline);
30535
- if (!validatedWorkspaceSource.success) {
30536
- return failedSyncResult(`Workspace source validation failed: ${validatedWorkspaceSource.error}`, { totalFailed: 1 });
30553
+ const wsSourceResult = await validatePlugin(config.workspace.source, sourceBasePath, offline);
30554
+ if (wsSourceResult.success) {
30555
+ validatedWorkspaceSource = wsSourceResult;
30556
+ } else {
30557
+ workspaceSourceWarnings.push(`Workspace source: ${wsSourceResult.error}`);
30537
30558
  }
30538
30559
  }
30539
30560
  const failedValidations = validatedPlugins.filter((v) => !v.success);
30540
30561
  const validPlugins = validatedPlugins.filter((v) => v.success);
30541
30562
  const warnings = [
30542
30563
  ...planWarnings,
30564
+ ...workspaceSourceWarnings,
30543
30565
  ...failedValidations.map((v) => `${v.plugin}: ${v.error} (skipped)`)
30544
30566
  ];
30545
30567
  const messages = [];
@@ -30569,7 +30591,8 @@ ${failedValidations.map((v) => ` - ${v.plugin}: ${v.error}`).join(`
30569
30591
  }));
30570
30592
  const nativeResult = await syncNativePlugins(validPlugins, previousState, "project", workspacePath, dryRun, warnings, messages);
30571
30593
  let workspaceFileResults = [];
30572
- if (config.workspace) {
30594
+ const skipWorkspaceFiles = !!config.workspace?.source && !validatedWorkspaceSource;
30595
+ if (config.workspace && !skipWorkspaceFiles) {
30573
30596
  const sourcePath = validatedWorkspaceSource?.resolved;
30574
30597
  const filesToCopy = [...config.workspace.files];
30575
30598
  if (hasRepositories && sourcePath) {
@@ -30970,7 +30993,7 @@ var init_github_fetch = __esm(() => {
30970
30993
  });
30971
30994
 
30972
30995
  // src/core/workspace.ts
30973
- import { mkdir as mkdir8, readFile as readFile10, writeFile as writeFile7, copyFile as copyFile2, unlink as unlink3 } from "node:fs/promises";
30996
+ import { cp as cp2, mkdir as mkdir8, readFile as readFile10, writeFile as writeFile7, copyFile as copyFile2, unlink as unlink3 } from "node:fs/promises";
30974
30997
  import { existsSync as existsSync16 } from "node:fs";
30975
30998
  import { join as join18, resolve as resolve10, dirname as dirname11, relative as relative5, sep as sep2, isAbsolute as isAbsolute4 } from "node:path";
30976
30999
  import { fileURLToPath } from "node:url";
@@ -31156,6 +31179,9 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31156
31179
  await copyFile2(agentsPath, claudePath);
31157
31180
  }
31158
31181
  }
31182
+ if (githubTempDir && parsedFromUrl) {
31183
+ await seedCacheFromClone(githubTempDir, parsedFromUrl.owner, parsedFromUrl.repo, githubBranch);
31184
+ }
31159
31185
  if (githubTempDir) {
31160
31186
  await cleanupTempDir(githubTempDir);
31161
31187
  }
@@ -31191,6 +31217,23 @@ Next steps:`);
31191
31217
  throw error;
31192
31218
  }
31193
31219
  }
31220
+ async function seedCacheFromClone(tempDir, owner, repo, branch) {
31221
+ const cachePaths = [
31222
+ getPluginCachePath(owner, repo, branch),
31223
+ join18(getMarketplacesDir(), repo)
31224
+ ];
31225
+ for (const cachePath of cachePaths) {
31226
+ if (existsSync16(cachePath))
31227
+ continue;
31228
+ try {
31229
+ const parentDir = dirname11(cachePath);
31230
+ if (!existsSync16(parentDir)) {
31231
+ await mkdir8(parentDir, { recursive: true });
31232
+ }
31233
+ await cp2(tempDir, cachePath, { recursive: true });
31234
+ } catch {}
31235
+ }
31236
+ }
31194
31237
  var init_workspace = __esm(() => {
31195
31238
  init_js_yaml();
31196
31239
  init_sync();
@@ -31200,6 +31243,7 @@ var init_workspace = __esm(() => {
31200
31243
  init_plugin_path();
31201
31244
  init_github_fetch();
31202
31245
  init_git();
31246
+ init_marketplace();
31203
31247
  });
31204
31248
 
31205
31249
  // src/core/status.ts
@@ -33326,7 +33370,7 @@ async function promptForClients() {
33326
33370
  const selected = await autocompleteMultiselect({
33327
33371
  message: "Which AI clients do you use?",
33328
33372
  options: options2,
33329
- initialValues: ["universal"],
33373
+ initialValues: ["universal", "copilot", "vscode"],
33330
33374
  required: false
33331
33375
  });
33332
33376
  if (Ct(selected)) {
@@ -33895,19 +33939,19 @@ var require_enoent = __commonJS((exports, module) => {
33895
33939
  spawnargs: original.args
33896
33940
  });
33897
33941
  }
33898
- function hookChildProcess(cp2, parsed) {
33942
+ function hookChildProcess(cp3, parsed) {
33899
33943
  if (!isWin) {
33900
33944
  return;
33901
33945
  }
33902
- const originalEmit = cp2.emit;
33903
- cp2.emit = function(name, arg1) {
33946
+ const originalEmit = cp3.emit;
33947
+ cp3.emit = function(name, arg1) {
33904
33948
  if (name === "exit") {
33905
33949
  const err = verifyENOENT(arg1, parsed);
33906
33950
  if (err) {
33907
- return originalEmit.call(cp2, "error", err);
33951
+ return originalEmit.call(cp3, "error", err);
33908
33952
  }
33909
33953
  }
33910
- return originalEmit.apply(cp2, arguments);
33954
+ return originalEmit.apply(cp3, arguments);
33911
33955
  };
33912
33956
  }
33913
33957
  function verifyENOENT(status, parsed) {
@@ -33932,18 +33976,18 @@ var require_enoent = __commonJS((exports, module) => {
33932
33976
 
33933
33977
  // node_modules/cross-spawn/index.js
33934
33978
  var require_cross_spawn = __commonJS((exports, module) => {
33935
- var cp2 = __require("child_process");
33979
+ var cp3 = __require("child_process");
33936
33980
  var parse2 = require_parse5();
33937
33981
  var enoent = require_enoent();
33938
33982
  function spawn3(command4, args, options2) {
33939
33983
  const parsed = parse2(command4, args, options2);
33940
- const spawned = cp2.spawn(parsed.command, parsed.args, parsed.options);
33984
+ const spawned = cp3.spawn(parsed.command, parsed.args, parsed.options);
33941
33985
  enoent.hookChildProcess(spawned, parsed);
33942
33986
  return spawned;
33943
33987
  }
33944
33988
  function spawnSync(command4, args, options2) {
33945
33989
  const parsed = parse2(command4, args, options2);
33946
- const result = cp2.spawnSync(parsed.command, parsed.args, parsed.options);
33990
+ const result = cp3.spawnSync(parsed.command, parsed.args, parsed.options);
33947
33991
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
33948
33992
  return result;
33949
33993
  }
@@ -33996,7 +34040,7 @@ var package_default;
33996
34040
  var init_package = __esm(() => {
33997
34041
  package_default = {
33998
34042
  name: "allagents",
33999
- version: "1.4.3",
34043
+ version: "1.4.5",
34000
34044
  description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
34001
34045
  type: "module",
34002
34046
  bin: {
@@ -34023,7 +34067,8 @@ var init_package = __esm(() => {
34023
34067
  prepare: "bun run build && (test -d .git && bunx prek install -t pre-push || true)",
34024
34068
  release: "bun run scripts/release.ts",
34025
34069
  "release:next": "bun run scripts/release.ts next",
34026
- "publish:next": "bun run build && bun publish --tag next",
34070
+ prepublishOnly: `test "$ALLOW_PUBLISH" = '1' || (echo 'ERROR: Use bun run publish:next, then bun run promote:latest' && exit 1)`,
34071
+ "publish:next": "bun run build && ALLOW_PUBLISH=1 npm publish --tag next",
34027
34072
  "promote:latest": "bun scripts/tag-channel.ts latest"
34028
34073
  },
34029
34074
  keywords: [
@@ -37996,7 +38041,20 @@ var pluginInstallCmd = import_cmd_ts4.command({
37996
38041
  handler: async ({ plugin, scope, skills }) => {
37997
38042
  try {
37998
38043
  const isUser = scope === "user" || !scope && isUserConfigPath(process.cwd());
37999
- if (!isUser) {
38044
+ if (isUser) {
38045
+ const userConfigPath = getUserWorkspaceConfigPath();
38046
+ if (!existsSync22(userConfigPath)) {
38047
+ const { promptForClients: promptForClients2 } = await Promise.resolve().then(() => (init_prompt_clients(), exports_prompt_clients));
38048
+ const clients = await promptForClients2();
38049
+ if (clients === null) {
38050
+ if (isJsonMode()) {
38051
+ jsonOutput({ success: false, command: "plugin install", error: "Cancelled" });
38052
+ }
38053
+ return;
38054
+ }
38055
+ await ensureUserWorkspace(clients);
38056
+ }
38057
+ } else {
38000
38058
  const configPath = join24(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE);
38001
38059
  if (!existsSync22(configPath)) {
38002
38060
  const { promptForClients: promptForClients2 } = await Promise.resolve().then(() => (init_prompt_clients(), exports_prompt_clients));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,7 +27,8 @@
27
27
  "prepare": "bun run build && (test -d .git && bunx prek install -t pre-push || true)",
28
28
  "release": "bun run scripts/release.ts",
29
29
  "release:next": "bun run scripts/release.ts next",
30
- "publish:next": "bun run build && bun publish --tag next",
30
+ "prepublishOnly": "test \"$ALLOW_PUBLISH\" = '1' || (echo 'ERROR: Use bun run publish:next, then bun run promote:latest' && exit 1)",
31
+ "publish:next": "bun run build && ALLOW_PUBLISH=1 npm publish --tag next",
31
32
  "promote:latest": "bun scripts/tag-channel.ts latest"
32
33
  },
33
34
  "keywords": [