allagents 1.4.4 → 1.4.6
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/index.js +97 -53
- 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
|
|
6381
|
+
module.exports = function parse2(text, reviver) {
|
|
6382
6382
|
source = String(text);
|
|
6383
6383
|
parseState = "start";
|
|
6384
6384
|
stack = [];
|
|
@@ -13476,7 +13476,7 @@ function gitInstanceFactory(baseDir, options2) {
|
|
|
13476
13476
|
}
|
|
13477
13477
|
var import_file_exists, import_debug, import_promise_deferred, import_promise_deferred2, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __esm2 = (fn, res) => function __init() {
|
|
13478
13478
|
return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
|
|
13479
|
-
}, __commonJS2 = (cb, mod) => function
|
|
13479
|
+
}, __commonJS2 = (cb, mod) => function __require2() {
|
|
13480
13480
|
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13481
13481
|
}, __export2 = (target, all) => {
|
|
13482
13482
|
for (var name in all)
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
@@ -15772,7 +15779,7 @@ function parseGitHubUrl(url) {
|
|
|
15772
15779
|
}
|
|
15773
15780
|
return null;
|
|
15774
15781
|
}
|
|
15775
|
-
const treeMatch = normalized.match(/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/]+?)\/tree\/(.+)$/);
|
|
15782
|
+
const treeMatch = normalized.match(/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/]+?)\/(?:tree|blob)\/(.+)$/);
|
|
15776
15783
|
if (treeMatch) {
|
|
15777
15784
|
const owner = treeMatch[1];
|
|
15778
15785
|
const repo = treeMatch[2]?.replace(/\.git$/, "");
|
|
@@ -21963,7 +21970,7 @@ var require_is_extendable = __commonJS((exports, module) => {
|
|
|
21963
21970
|
// node_modules/extend-shallow/index.js
|
|
21964
21971
|
var require_extend_shallow = __commonJS((exports, module) => {
|
|
21965
21972
|
var isObject2 = require_is_extendable();
|
|
21966
|
-
module.exports = function
|
|
21973
|
+
module.exports = function extend3(o) {
|
|
21967
21974
|
if (!isObject2(o)) {
|
|
21968
21975
|
o = {};
|
|
21969
21976
|
}
|
|
@@ -22157,7 +22164,7 @@ var require_exception = __commonJS((exports, module) => {
|
|
|
22157
22164
|
}
|
|
22158
22165
|
YAMLException2.prototype = Object.create(Error.prototype);
|
|
22159
22166
|
YAMLException2.prototype.constructor = YAMLException2;
|
|
22160
|
-
YAMLException2.prototype.toString = function
|
|
22167
|
+
YAMLException2.prototype.toString = function toString2(compact) {
|
|
22161
22168
|
var result = this.name + ": ";
|
|
22162
22169
|
result += this.reason || "(unknown reason)";
|
|
22163
22170
|
if (!compact && this.mark) {
|
|
@@ -22210,7 +22217,7 @@ var require_mark = __commonJS((exports, module) => {
|
|
|
22210
22217
|
return common2.repeat(" ", indent) + head + snippet2 + tail + `
|
|
22211
22218
|
` + common2.repeat(" ", indent + this.position - start + head.length) + "^";
|
|
22212
22219
|
};
|
|
22213
|
-
Mark.prototype.toString = function
|
|
22220
|
+
Mark.prototype.toString = function toString2(compact) {
|
|
22214
22221
|
var snippet2, where = "";
|
|
22215
22222
|
if (this.name) {
|
|
22216
22223
|
where += 'in "' + this.name + '" ';
|
|
@@ -23305,7 +23312,7 @@ var require_loader = __commonJS((exports, module) => {
|
|
|
23305
23312
|
}
|
|
23306
23313
|
}
|
|
23307
23314
|
var directiveHandlers2 = {
|
|
23308
|
-
YAML: function
|
|
23315
|
+
YAML: function handleYamlDirective2(state, name, args) {
|
|
23309
23316
|
var match, major, minor;
|
|
23310
23317
|
if (state.version !== null) {
|
|
23311
23318
|
throwError2(state, "duplication of %YAML directive");
|
|
@@ -23328,7 +23335,7 @@ var require_loader = __commonJS((exports, module) => {
|
|
|
23328
23335
|
throwWarning2(state, "unsupported YAML version of the document");
|
|
23329
23336
|
}
|
|
23330
23337
|
},
|
|
23331
|
-
TAG: function
|
|
23338
|
+
TAG: function handleTagDirective2(state, name, args) {
|
|
23332
23339
|
var handle, prefix;
|
|
23333
23340
|
if (args.length !== 2) {
|
|
23334
23341
|
throwError2(state, "TAG directive accepts exactly two arguments");
|
|
@@ -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
|
-
|
|
30535
|
-
if (
|
|
30536
|
-
|
|
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
|
-
|
|
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
|
|
@@ -33895,19 +33939,19 @@ var require_enoent = __commonJS((exports, module) => {
|
|
|
33895
33939
|
spawnargs: original.args
|
|
33896
33940
|
});
|
|
33897
33941
|
}
|
|
33898
|
-
function hookChildProcess(
|
|
33942
|
+
function hookChildProcess(cp3, parsed) {
|
|
33899
33943
|
if (!isWin) {
|
|
33900
33944
|
return;
|
|
33901
33945
|
}
|
|
33902
|
-
const originalEmit =
|
|
33903
|
-
|
|
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(
|
|
33951
|
+
return originalEmit.call(cp3, "error", err);
|
|
33908
33952
|
}
|
|
33909
33953
|
}
|
|
33910
|
-
return originalEmit.apply(
|
|
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
|
|
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 =
|
|
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 =
|
|
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.
|
|
34043
|
+
version: "1.4.6",
|
|
34000
34044
|
description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
|
|
34001
34045
|
type: "module",
|
|
34002
34046
|
bin: {
|