allagents 0.19.1 → 0.20.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.
- package/dist/index.js +763 -139
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11424,7 +11424,8 @@ var init_workspace_config = __esm(() => {
|
|
|
11424
11424
|
plugins: exports_external.array(PluginSourceSchema),
|
|
11425
11425
|
clients: exports_external.array(ClientTypeSchema),
|
|
11426
11426
|
vscode: VscodeConfigSchema.optional(),
|
|
11427
|
-
syncMode: SyncModeSchema.optional()
|
|
11427
|
+
syncMode: SyncModeSchema.optional(),
|
|
11428
|
+
disabledSkills: exports_external.array(exports_external.string()).optional()
|
|
11428
11429
|
});
|
|
11429
11430
|
});
|
|
11430
11431
|
|
|
@@ -25006,7 +25007,10 @@ async function copySkills(pluginPath, workspacePath, client, options2 = {}) {
|
|
|
25006
25007
|
await mkdir3(destDir, { recursive: true });
|
|
25007
25008
|
}
|
|
25008
25009
|
const entries = await readdir2(sourceDir, { withFileTypes: true });
|
|
25009
|
-
|
|
25010
|
+
let skillDirs = entries.filter((e) => e.isDirectory());
|
|
25011
|
+
if (skillNameMap) {
|
|
25012
|
+
skillDirs = skillDirs.filter((e) => skillNameMap.has(e.name));
|
|
25013
|
+
}
|
|
25010
25014
|
const useSymlinks = syncMode === "symlink" && !isUniversalClient(client) && canonicalSkillsPath;
|
|
25011
25015
|
const copyPromises = skillDirs.map(async (entry) => {
|
|
25012
25016
|
const skillSourcePath = join6(sourceDir, entry.name);
|
|
@@ -25057,14 +25061,15 @@ async function copySkills(pluginPath, workspacePath, client, options2 = {}) {
|
|
|
25057
25061
|
});
|
|
25058
25062
|
return Promise.all(copyPromises);
|
|
25059
25063
|
}
|
|
25060
|
-
async function collectPluginSkills(pluginPath, pluginSource) {
|
|
25064
|
+
async function collectPluginSkills(pluginPath, pluginSource, disabledSkills, pluginName) {
|
|
25061
25065
|
const skillsDir = join6(pluginPath, "skills");
|
|
25062
25066
|
if (!existsSync4(skillsDir)) {
|
|
25063
25067
|
return [];
|
|
25064
25068
|
}
|
|
25065
25069
|
const entries = await readdir2(skillsDir, { withFileTypes: true });
|
|
25066
25070
|
const skillDirs = entries.filter((e) => e.isDirectory());
|
|
25067
|
-
|
|
25071
|
+
const filteredDirs = disabledSkills && pluginName ? skillDirs.filter((e) => !disabledSkills.has(`${pluginName}:${e.name}`)) : skillDirs;
|
|
25072
|
+
return filteredDirs.map((entry) => ({
|
|
25068
25073
|
folderName: entry.name,
|
|
25069
25074
|
skillPath: join6(skillsDir, entry.name),
|
|
25070
25075
|
pluginPath,
|
|
@@ -25553,15 +25558,18 @@ __export(exports_user_workspace, {
|
|
|
25553
25558
|
resolveGitHubIdentity: () => resolveGitHubIdentity,
|
|
25554
25559
|
removeUserPluginsForMarketplace: () => removeUserPluginsForMarketplace,
|
|
25555
25560
|
removeUserPlugin: () => removeUserPlugin,
|
|
25561
|
+
removeUserDisabledSkill: () => removeUserDisabledSkill,
|
|
25556
25562
|
isUserConfigPath: () => isUserConfigPath,
|
|
25557
25563
|
hasUserPlugin: () => hasUserPlugin,
|
|
25558
25564
|
getUserWorkspaceConfigPath: () => getUserWorkspaceConfigPath,
|
|
25559
25565
|
getUserWorkspaceConfig: () => getUserWorkspaceConfig,
|
|
25560
25566
|
getUserPluginsForMarketplace: () => getUserPluginsForMarketplace,
|
|
25567
|
+
getUserDisabledSkills: () => getUserDisabledSkills,
|
|
25561
25568
|
getInstalledUserPlugins: () => getInstalledUserPlugins,
|
|
25562
25569
|
getInstalledProjectPlugins: () => getInstalledProjectPlugins,
|
|
25563
25570
|
ensureUserWorkspace: () => ensureUserWorkspace,
|
|
25564
|
-
addUserPlugin: () => addUserPlugin
|
|
25571
|
+
addUserPlugin: () => addUserPlugin,
|
|
25572
|
+
addUserDisabledSkill: () => addUserDisabledSkill
|
|
25565
25573
|
});
|
|
25566
25574
|
import { readFile as readFile6, writeFile as writeFile2, mkdir as mkdir4 } from "node:fs/promises";
|
|
25567
25575
|
import { existsSync as existsSync6 } from "node:fs";
|
|
@@ -25741,7 +25749,54 @@ async function addPluginToUserConfig(plugin, configPath, autoRegistered) {
|
|
|
25741
25749
|
}
|
|
25742
25750
|
config.plugins.push(plugin);
|
|
25743
25751
|
await writeFile2(configPath, dump(config, { lineWidth: -1 }), "utf-8");
|
|
25744
|
-
return { success: true, ...autoRegistered && { autoRegistered } };
|
|
25752
|
+
return { success: true, ...autoRegistered && { autoRegistered }, normalizedPlugin: plugin };
|
|
25753
|
+
} catch (error) {
|
|
25754
|
+
return {
|
|
25755
|
+
success: false,
|
|
25756
|
+
error: error instanceof Error ? error.message : String(error)
|
|
25757
|
+
};
|
|
25758
|
+
}
|
|
25759
|
+
}
|
|
25760
|
+
async function getUserDisabledSkills() {
|
|
25761
|
+
const config = await getUserWorkspaceConfig();
|
|
25762
|
+
return config?.disabledSkills ?? [];
|
|
25763
|
+
}
|
|
25764
|
+
async function addUserDisabledSkill(skillKey) {
|
|
25765
|
+
await ensureUserWorkspace();
|
|
25766
|
+
const configPath = getUserWorkspaceConfigPath();
|
|
25767
|
+
try {
|
|
25768
|
+
const content = await readFile6(configPath, "utf-8");
|
|
25769
|
+
const config = load(content);
|
|
25770
|
+
const disabledSkills = config.disabledSkills ?? [];
|
|
25771
|
+
if (disabledSkills.includes(skillKey)) {
|
|
25772
|
+
return { success: false, error: `Skill '${skillKey}' is already disabled` };
|
|
25773
|
+
}
|
|
25774
|
+
config.disabledSkills = [...disabledSkills, skillKey];
|
|
25775
|
+
await writeFile2(configPath, dump(config, { lineWidth: -1 }), "utf-8");
|
|
25776
|
+
return { success: true };
|
|
25777
|
+
} catch (error) {
|
|
25778
|
+
return {
|
|
25779
|
+
success: false,
|
|
25780
|
+
error: error instanceof Error ? error.message : String(error)
|
|
25781
|
+
};
|
|
25782
|
+
}
|
|
25783
|
+
}
|
|
25784
|
+
async function removeUserDisabledSkill(skillKey) {
|
|
25785
|
+
await ensureUserWorkspace();
|
|
25786
|
+
const configPath = getUserWorkspaceConfigPath();
|
|
25787
|
+
try {
|
|
25788
|
+
const content = await readFile6(configPath, "utf-8");
|
|
25789
|
+
const config = load(content);
|
|
25790
|
+
const disabledSkills = config.disabledSkills ?? [];
|
|
25791
|
+
if (!disabledSkills.includes(skillKey)) {
|
|
25792
|
+
return { success: false, error: `Skill '${skillKey}' is already enabled` };
|
|
25793
|
+
}
|
|
25794
|
+
config.disabledSkills = disabledSkills.filter((s) => s !== skillKey);
|
|
25795
|
+
if (config.disabledSkills.length === 0) {
|
|
25796
|
+
config.disabledSkills = undefined;
|
|
25797
|
+
}
|
|
25798
|
+
await writeFile2(configPath, dump(config, { lineWidth: -1 }), "utf-8");
|
|
25799
|
+
return { success: true };
|
|
25745
25800
|
} catch (error) {
|
|
25746
25801
|
return {
|
|
25747
25802
|
success: false,
|
|
@@ -25851,14 +25906,22 @@ async function saveRegistry(registry) {
|
|
|
25851
25906
|
await writeFile3(registryPath, `${JSON.stringify(registry, null, 2)}
|
|
25852
25907
|
`);
|
|
25853
25908
|
}
|
|
25854
|
-
function
|
|
25855
|
-
if (
|
|
25856
|
-
|
|
25857
|
-
|
|
25858
|
-
location: WELL_KNOWN_MARKETPLACES[source],
|
|
25859
|
-
name: source
|
|
25860
|
-
};
|
|
25909
|
+
function getSourceLocationKey(source) {
|
|
25910
|
+
if (source.type === "github") {
|
|
25911
|
+
const { owner, repo } = parseLocation(source.location);
|
|
25912
|
+
return `${owner}/${repo}`;
|
|
25861
25913
|
}
|
|
25914
|
+
return source.location;
|
|
25915
|
+
}
|
|
25916
|
+
function findBySourceLocation(registry, sourceLocation) {
|
|
25917
|
+
for (const entry of Object.values(registry.marketplaces)) {
|
|
25918
|
+
if (getSourceLocationKey(entry.source) === sourceLocation) {
|
|
25919
|
+
return entry;
|
|
25920
|
+
}
|
|
25921
|
+
}
|
|
25922
|
+
return null;
|
|
25923
|
+
}
|
|
25924
|
+
function parseMarketplaceSource(source) {
|
|
25862
25925
|
if (source.startsWith("https://github.com/")) {
|
|
25863
25926
|
const match = source.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?(?:\/tree\/(.+))?$/);
|
|
25864
25927
|
if (match) {
|
|
@@ -25902,7 +25965,7 @@ async function addMarketplace(source, customName, branch) {
|
|
|
25902
25965
|
return {
|
|
25903
25966
|
success: false,
|
|
25904
25967
|
error: `Invalid marketplace source: ${source}
|
|
25905
|
-
Use: GitHub URL, owner/repo, local path
|
|
25968
|
+
Use: GitHub URL, owner/repo, or local path`
|
|
25906
25969
|
};
|
|
25907
25970
|
}
|
|
25908
25971
|
const effectiveBranch = branch || parsed.branch;
|
|
@@ -25930,6 +25993,11 @@ async function addMarketplace(source, customName, branch) {
|
|
|
25930
25993
|
error: `Marketplace '${name}' already exists. Use 'update' to refresh it.`
|
|
25931
25994
|
};
|
|
25932
25995
|
}
|
|
25996
|
+
const sourceLocation = parsed.type === "github" ? `${parseLocation(parsed.location).owner}/${parseLocation(parsed.location).repo}` : parsed.location;
|
|
25997
|
+
const existingBySource = findBySourceLocation(registry, sourceLocation);
|
|
25998
|
+
if (existingBySource) {
|
|
25999
|
+
return { success: true, marketplace: existingBySource };
|
|
26000
|
+
}
|
|
25933
26001
|
let marketplacePath;
|
|
25934
26002
|
if (parsed.type === "github") {
|
|
25935
26003
|
marketplacePath = join9(getMarketplacesDir(), name);
|
|
@@ -26049,11 +26117,7 @@ async function findMarketplace(name, sourceLocation) {
|
|
|
26049
26117
|
return registry.marketplaces[name];
|
|
26050
26118
|
}
|
|
26051
26119
|
if (sourceLocation) {
|
|
26052
|
-
|
|
26053
|
-
if (entry.source.location === sourceLocation) {
|
|
26054
|
-
return entry;
|
|
26055
|
-
}
|
|
26056
|
-
}
|
|
26120
|
+
return findBySourceLocation(registry, sourceLocation);
|
|
26057
26121
|
}
|
|
26058
26122
|
return null;
|
|
26059
26123
|
}
|
|
@@ -26286,6 +26350,7 @@ async function resolvePluginSpecWithAutoRegister(spec, options2 = {}) {
|
|
|
26286
26350
|
const { plugin: pluginName, marketplaceName, owner, repo, subpath } = parsed;
|
|
26287
26351
|
const sourceLocation = owner && repo ? `${owner}/${repo}` : undefined;
|
|
26288
26352
|
let marketplace = await findMarketplace(marketplaceName, sourceLocation);
|
|
26353
|
+
let didAutoRegister = false;
|
|
26289
26354
|
if (!marketplace) {
|
|
26290
26355
|
const sourceToRegister = owner && repo ? `${owner}/${repo}` : marketplaceName;
|
|
26291
26356
|
const autoRegResult = await autoRegisterMarketplace(sourceToRegister);
|
|
@@ -26296,6 +26361,7 @@ async function resolvePluginSpecWithAutoRegister(spec, options2 = {}) {
|
|
|
26296
26361
|
};
|
|
26297
26362
|
}
|
|
26298
26363
|
marketplace = await getMarketplace(autoRegResult.name ?? marketplaceName);
|
|
26364
|
+
didAutoRegister = true;
|
|
26299
26365
|
}
|
|
26300
26366
|
if (!marketplace) {
|
|
26301
26367
|
return {
|
|
@@ -26328,42 +26394,30 @@ async function resolvePluginSpecWithAutoRegister(spec, options2 = {}) {
|
|
|
26328
26394
|
Expected at: ${join9(marketplace.path, expectedSubpath, pluginName)}`
|
|
26329
26395
|
};
|
|
26330
26396
|
}
|
|
26397
|
+
const shouldReturnRegisteredAs = didAutoRegister || marketplace.name !== marketplaceName;
|
|
26331
26398
|
return {
|
|
26332
26399
|
success: true,
|
|
26333
26400
|
path: resolved.path,
|
|
26334
26401
|
pluginName: resolved.plugin,
|
|
26335
|
-
...
|
|
26402
|
+
...shouldReturnRegisteredAs && { registeredAs: marketplace.name }
|
|
26336
26403
|
};
|
|
26337
26404
|
}
|
|
26338
|
-
async function autoRegisterMarketplace(
|
|
26339
|
-
|
|
26340
|
-
|
|
26341
|
-
console.log(`Auto-registering well-known marketplace: ${name}`);
|
|
26342
|
-
const result = await addMarketplace(name);
|
|
26343
|
-
if (!result.success) {
|
|
26344
|
-
return { success: false, error: result.error || "Unknown error" };
|
|
26345
|
-
}
|
|
26346
|
-
return { success: true, name };
|
|
26347
|
-
}
|
|
26348
|
-
if (name.includes("/") && !name.includes("://")) {
|
|
26349
|
-
const parts = name.split("/");
|
|
26405
|
+
async function autoRegisterMarketplace(source) {
|
|
26406
|
+
if (source.includes("/") && !source.includes("://")) {
|
|
26407
|
+
const parts = source.split("/");
|
|
26350
26408
|
if (parts.length === 2 && parts[0] && parts[1]) {
|
|
26351
|
-
console.log(`Auto-registering GitHub marketplace: ${
|
|
26352
|
-
const result = await addMarketplace(
|
|
26409
|
+
console.log(`Auto-registering GitHub marketplace: ${source}`);
|
|
26410
|
+
const result = await addMarketplace(source);
|
|
26353
26411
|
if (!result.success) {
|
|
26354
26412
|
return { success: false, error: result.error || "Unknown error" };
|
|
26355
26413
|
}
|
|
26356
|
-
|
|
26357
|
-
return { success: true, name: registeredName };
|
|
26414
|
+
return { success: true, name: result.marketplace?.name ?? parts[1] };
|
|
26358
26415
|
}
|
|
26359
26416
|
}
|
|
26360
26417
|
return {
|
|
26361
26418
|
success: false,
|
|
26362
|
-
error: `Marketplace '${
|
|
26363
|
-
|
|
26364
|
-
1. Use fully qualified name: plugin@owner/repo
|
|
26365
|
-
2. Register first: allagents plugin marketplace add <source>
|
|
26366
|
-
3. Well-known marketplaces: ${Object.keys(wellKnown).join(", ")}`
|
|
26419
|
+
error: `Marketplace '${source}' not found.
|
|
26420
|
+
Use fully qualified format: plugin@owner/repo`
|
|
26367
26421
|
};
|
|
26368
26422
|
}
|
|
26369
26423
|
function isPluginSpec(spec) {
|
|
@@ -26373,8 +26427,35 @@ function isPluginSpec(spec) {
|
|
|
26373
26427
|
}
|
|
26374
26428
|
return true;
|
|
26375
26429
|
}
|
|
26376
|
-
function
|
|
26377
|
-
|
|
26430
|
+
function extractUniqueMarketplaceSources(plugins) {
|
|
26431
|
+
const sources = new Set;
|
|
26432
|
+
for (const plugin of plugins) {
|
|
26433
|
+
if (!isPluginSpec(plugin))
|
|
26434
|
+
continue;
|
|
26435
|
+
const parsed = parsePluginSpec(plugin);
|
|
26436
|
+
if (!parsed)
|
|
26437
|
+
continue;
|
|
26438
|
+
if (parsed.owner && parsed.repo) {
|
|
26439
|
+
sources.add(`${parsed.owner}/${parsed.repo}`);
|
|
26440
|
+
}
|
|
26441
|
+
}
|
|
26442
|
+
return Array.from(sources);
|
|
26443
|
+
}
|
|
26444
|
+
async function ensureMarketplacesRegistered(plugins) {
|
|
26445
|
+
const sources = extractUniqueMarketplaceSources(plugins);
|
|
26446
|
+
const results = [];
|
|
26447
|
+
for (const source of sources) {
|
|
26448
|
+
const parts = source.split("/");
|
|
26449
|
+
const sourceLocation = source;
|
|
26450
|
+
const existing = await findMarketplace(parts[1] ?? "", sourceLocation);
|
|
26451
|
+
if (existing) {
|
|
26452
|
+
results.push({ source, success: true, name: existing.name });
|
|
26453
|
+
continue;
|
|
26454
|
+
}
|
|
26455
|
+
const result = await autoRegisterMarketplace(source);
|
|
26456
|
+
results.push({ source, ...result });
|
|
26457
|
+
}
|
|
26458
|
+
return results;
|
|
26378
26459
|
}
|
|
26379
26460
|
async function getMarketplaceVersion(marketplacePath) {
|
|
26380
26461
|
if (!existsSync7(marketplacePath)) {
|
|
@@ -26388,7 +26469,6 @@ async function getMarketplaceVersion(marketplacePath) {
|
|
|
26388
26469
|
return null;
|
|
26389
26470
|
}
|
|
26390
26471
|
}
|
|
26391
|
-
var WELL_KNOWN_MARKETPLACES;
|
|
26392
26472
|
var init_marketplace = __esm(() => {
|
|
26393
26473
|
init_esm();
|
|
26394
26474
|
init_git();
|
|
@@ -26396,9 +26476,6 @@ var init_marketplace = __esm(() => {
|
|
|
26396
26476
|
init_plugin();
|
|
26397
26477
|
init_plugin_path();
|
|
26398
26478
|
init_constants();
|
|
26399
|
-
WELL_KNOWN_MARKETPLACES = {
|
|
26400
|
-
"claude-plugins-official": "anthropics/claude-plugins-official"
|
|
26401
|
-
};
|
|
26402
26479
|
});
|
|
26403
26480
|
|
|
26404
26481
|
// src/core/workspace-modify.ts
|
|
@@ -26493,7 +26570,8 @@ async function addPluginToConfig(plugin, configPath, autoRegistered) {
|
|
|
26493
26570
|
await writeFile4(configPath, newContent, "utf-8");
|
|
26494
26571
|
return {
|
|
26495
26572
|
success: true,
|
|
26496
|
-
...autoRegistered && { autoRegistered }
|
|
26573
|
+
...autoRegistered && { autoRegistered },
|
|
26574
|
+
normalizedPlugin: plugin
|
|
26497
26575
|
};
|
|
26498
26576
|
} catch (error) {
|
|
26499
26577
|
return {
|
|
@@ -26552,6 +26630,65 @@ async function removePlugin(plugin, workspacePath = process.cwd()) {
|
|
|
26552
26630
|
};
|
|
26553
26631
|
}
|
|
26554
26632
|
}
|
|
26633
|
+
async function addDisabledSkill(skillKey, workspacePath = process.cwd()) {
|
|
26634
|
+
const configPath = join10(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
26635
|
+
if (!existsSync8(configPath)) {
|
|
26636
|
+
return {
|
|
26637
|
+
success: false,
|
|
26638
|
+
error: `${CONFIG_DIR}/${WORKSPACE_CONFIG_FILE} not found in ${workspacePath}`
|
|
26639
|
+
};
|
|
26640
|
+
}
|
|
26641
|
+
try {
|
|
26642
|
+
const content = await readFile8(configPath, "utf-8");
|
|
26643
|
+
const config = load(content);
|
|
26644
|
+
const disabledSkills = config.disabledSkills ?? [];
|
|
26645
|
+
if (disabledSkills.includes(skillKey)) {
|
|
26646
|
+
return {
|
|
26647
|
+
success: false,
|
|
26648
|
+
error: `Skill '${skillKey}' is already disabled`
|
|
26649
|
+
};
|
|
26650
|
+
}
|
|
26651
|
+
config.disabledSkills = [...disabledSkills, skillKey];
|
|
26652
|
+
await writeFile4(configPath, dump(config, { lineWidth: -1 }), "utf-8");
|
|
26653
|
+
return { success: true };
|
|
26654
|
+
} catch (error) {
|
|
26655
|
+
return {
|
|
26656
|
+
success: false,
|
|
26657
|
+
error: error instanceof Error ? error.message : String(error)
|
|
26658
|
+
};
|
|
26659
|
+
}
|
|
26660
|
+
}
|
|
26661
|
+
async function removeDisabledSkill(skillKey, workspacePath = process.cwd()) {
|
|
26662
|
+
const configPath = join10(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
26663
|
+
if (!existsSync8(configPath)) {
|
|
26664
|
+
return {
|
|
26665
|
+
success: false,
|
|
26666
|
+
error: `${CONFIG_DIR}/${WORKSPACE_CONFIG_FILE} not found in ${workspacePath}`
|
|
26667
|
+
};
|
|
26668
|
+
}
|
|
26669
|
+
try {
|
|
26670
|
+
const content = await readFile8(configPath, "utf-8");
|
|
26671
|
+
const config = load(content);
|
|
26672
|
+
const disabledSkills = config.disabledSkills ?? [];
|
|
26673
|
+
if (!disabledSkills.includes(skillKey)) {
|
|
26674
|
+
return {
|
|
26675
|
+
success: false,
|
|
26676
|
+
error: `Skill '${skillKey}' is already enabled`
|
|
26677
|
+
};
|
|
26678
|
+
}
|
|
26679
|
+
config.disabledSkills = disabledSkills.filter((s) => s !== skillKey);
|
|
26680
|
+
if (config.disabledSkills.length === 0) {
|
|
26681
|
+
config.disabledSkills = undefined;
|
|
26682
|
+
}
|
|
26683
|
+
await writeFile4(configPath, dump(config, { lineWidth: -1 }), "utf-8");
|
|
26684
|
+
return { success: true };
|
|
26685
|
+
} catch (error) {
|
|
26686
|
+
return {
|
|
26687
|
+
success: false,
|
|
26688
|
+
error: error instanceof Error ? error.message : String(error)
|
|
26689
|
+
};
|
|
26690
|
+
}
|
|
26691
|
+
}
|
|
26555
26692
|
var DEFAULT_PROJECT_CLIENTS;
|
|
26556
26693
|
var init_workspace_modify = __esm(() => {
|
|
26557
26694
|
init_js_yaml();
|
|
@@ -27345,11 +27482,11 @@ async function copyValidatedPlugin(validatedPlugin, workspacePath, clients, dryR
|
|
|
27345
27482
|
copyResults
|
|
27346
27483
|
};
|
|
27347
27484
|
}
|
|
27348
|
-
async function collectAllSkills(validatedPlugins) {
|
|
27485
|
+
async function collectAllSkills(validatedPlugins, disabledSkills) {
|
|
27349
27486
|
const allSkills = [];
|
|
27350
27487
|
for (const plugin of validatedPlugins) {
|
|
27351
27488
|
const pluginName = plugin.pluginName ?? await getPluginName(plugin.resolved);
|
|
27352
|
-
const skills = await collectPluginSkills(plugin.resolved, plugin.plugin);
|
|
27489
|
+
const skills = await collectPluginSkills(plugin.resolved, plugin.plugin, disabledSkills, pluginName);
|
|
27353
27490
|
for (const skill of skills) {
|
|
27354
27491
|
allSkills.push({
|
|
27355
27492
|
folderName: skill.folderName,
|
|
@@ -27453,6 +27590,7 @@ async function syncWorkspace(workspacePath = process.cwd(), options2 = {}) {
|
|
|
27453
27590
|
};
|
|
27454
27591
|
}
|
|
27455
27592
|
}
|
|
27593
|
+
await ensureMarketplacesRegistered(config.plugins);
|
|
27456
27594
|
const validatedPlugins = await validateAllPlugins(config.plugins, workspacePath, offline);
|
|
27457
27595
|
let validatedWorkspaceSource = null;
|
|
27458
27596
|
if (config.workspace?.source) {
|
|
@@ -27497,7 +27635,8 @@ ${failedValidations.map((v) => ` - ${v.plugin}: ${v.error}`).join(`
|
|
|
27497
27635
|
partialSync: !!options2.clients
|
|
27498
27636
|
});
|
|
27499
27637
|
}
|
|
27500
|
-
const
|
|
27638
|
+
const disabledSkillsSet = new Set(config.disabledSkills ?? []);
|
|
27639
|
+
const allSkills = await collectAllSkills(validPlugins, disabledSkillsSet);
|
|
27501
27640
|
const pluginSkillMaps = buildPluginSkillNameMaps(allSkills);
|
|
27502
27641
|
const syncMode = config.syncMode ?? "symlink";
|
|
27503
27642
|
const pluginResults = await Promise.all(validPlugins.map((validatedPlugin) => {
|
|
@@ -27642,6 +27781,7 @@ async function syncUserWorkspace(options2 = {}) {
|
|
|
27642
27781
|
}
|
|
27643
27782
|
const clients = config.clients;
|
|
27644
27783
|
const { offline = false, dryRun = false } = options2;
|
|
27784
|
+
await ensureMarketplacesRegistered(config.plugins);
|
|
27645
27785
|
const validatedPlugins = await validateAllPlugins(config.plugins, homeDir, offline);
|
|
27646
27786
|
const failedValidations = validatedPlugins.filter((v) => !v.success);
|
|
27647
27787
|
const validPlugins = validatedPlugins.filter((v) => v.success);
|
|
@@ -27664,7 +27804,8 @@ ${failedValidations.map((v) => ` - ${v.plugin}: ${v.error}`).join(`
|
|
|
27664
27804
|
if (!dryRun) {
|
|
27665
27805
|
await selectivePurgeWorkspace(homeDir, previousState, clients);
|
|
27666
27806
|
}
|
|
27667
|
-
const
|
|
27807
|
+
const disabledSkillsSet = new Set(config.disabledSkills ?? []);
|
|
27808
|
+
const allSkills = await collectAllSkills(validPlugins, disabledSkillsSet);
|
|
27668
27809
|
const pluginSkillMaps = buildPluginSkillNameMaps(allSkills);
|
|
27669
27810
|
const syncMode = config.syncMode ?? "symlink";
|
|
27670
27811
|
const pluginResults = await Promise.all(validPlugins.map((vp) => {
|
|
@@ -28237,12 +28378,12 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
28237
28378
|
if (typeof Promise !== "function") {
|
|
28238
28379
|
throw new TypeError("callback not provided");
|
|
28239
28380
|
}
|
|
28240
|
-
return new Promise(function(
|
|
28381
|
+
return new Promise(function(resolve13, reject) {
|
|
28241
28382
|
isexe(path, options2 || {}, function(er, is) {
|
|
28242
28383
|
if (er) {
|
|
28243
28384
|
reject(er);
|
|
28244
28385
|
} else {
|
|
28245
|
-
|
|
28386
|
+
resolve13(is);
|
|
28246
28387
|
}
|
|
28247
28388
|
});
|
|
28248
28389
|
});
|
|
@@ -28304,27 +28445,27 @@ var require_which = __commonJS((exports, module) => {
|
|
|
28304
28445
|
opt = {};
|
|
28305
28446
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
28306
28447
|
const found = [];
|
|
28307
|
-
const step = (i2) => new Promise((
|
|
28448
|
+
const step = (i2) => new Promise((resolve13, reject) => {
|
|
28308
28449
|
if (i2 === pathEnv.length)
|
|
28309
|
-
return opt.all && found.length ?
|
|
28450
|
+
return opt.all && found.length ? resolve13(found) : reject(getNotFoundError(cmd));
|
|
28310
28451
|
const ppRaw = pathEnv[i2];
|
|
28311
28452
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
28312
28453
|
const pCmd = path.join(pathPart, cmd);
|
|
28313
28454
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
28314
|
-
|
|
28455
|
+
resolve13(subStep(p, i2, 0));
|
|
28315
28456
|
});
|
|
28316
|
-
const subStep = (p, i2, ii) => new Promise((
|
|
28457
|
+
const subStep = (p, i2, ii) => new Promise((resolve13, reject) => {
|
|
28317
28458
|
if (ii === pathExt.length)
|
|
28318
|
-
return
|
|
28459
|
+
return resolve13(step(i2 + 1));
|
|
28319
28460
|
const ext = pathExt[ii];
|
|
28320
28461
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
28321
28462
|
if (!er && is) {
|
|
28322
28463
|
if (opt.all)
|
|
28323
28464
|
found.push(p + ext);
|
|
28324
28465
|
else
|
|
28325
|
-
return
|
|
28466
|
+
return resolve13(p + ext);
|
|
28326
28467
|
}
|
|
28327
|
-
return
|
|
28468
|
+
return resolve13(subStep(p, i2, ii + 1));
|
|
28328
28469
|
});
|
|
28329
28470
|
});
|
|
28330
28471
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -28442,8 +28583,8 @@ var require_shebang_regex = __commonJS((exports, module) => {
|
|
|
28442
28583
|
// node_modules/shebang-command/index.js
|
|
28443
28584
|
var require_shebang_command = __commonJS((exports, module) => {
|
|
28444
28585
|
var shebangRegex = require_shebang_regex();
|
|
28445
|
-
module.exports = (
|
|
28446
|
-
const match =
|
|
28586
|
+
module.exports = (string4 = "") => {
|
|
28587
|
+
const match = string4.match(shebangRegex);
|
|
28447
28588
|
if (!match) {
|
|
28448
28589
|
return null;
|
|
28449
28590
|
}
|
|
@@ -28460,12 +28601,12 @@ var require_shebang_command = __commonJS((exports, module) => {
|
|
|
28460
28601
|
var require_readShebang = __commonJS((exports, module) => {
|
|
28461
28602
|
var fs = __require("fs");
|
|
28462
28603
|
var shebangCommand = require_shebang_command();
|
|
28463
|
-
function readShebang(
|
|
28604
|
+
function readShebang(command4) {
|
|
28464
28605
|
const size = 150;
|
|
28465
28606
|
const buffer = Buffer.alloc(size);
|
|
28466
28607
|
let fd;
|
|
28467
28608
|
try {
|
|
28468
|
-
fd = fs.openSync(
|
|
28609
|
+
fd = fs.openSync(command4, "r");
|
|
28469
28610
|
fs.readSync(fd, buffer, 0, size, 0);
|
|
28470
28611
|
fs.closeSync(fd);
|
|
28471
28612
|
} catch (e) {}
|
|
@@ -28511,7 +28652,7 @@ var require_parse5 = __commonJS((exports, module) => {
|
|
|
28511
28652
|
}
|
|
28512
28653
|
return parsed;
|
|
28513
28654
|
}
|
|
28514
|
-
function parse2(
|
|
28655
|
+
function parse2(command4, args, options2) {
|
|
28515
28656
|
if (args && !Array.isArray(args)) {
|
|
28516
28657
|
options2 = args;
|
|
28517
28658
|
args = null;
|
|
@@ -28519,12 +28660,12 @@ var require_parse5 = __commonJS((exports, module) => {
|
|
|
28519
28660
|
args = args ? args.slice(0) : [];
|
|
28520
28661
|
options2 = Object.assign({}, options2);
|
|
28521
28662
|
const parsed = {
|
|
28522
|
-
command:
|
|
28663
|
+
command: command4,
|
|
28523
28664
|
args,
|
|
28524
28665
|
options: options2,
|
|
28525
28666
|
file: undefined,
|
|
28526
28667
|
original: {
|
|
28527
|
-
command:
|
|
28668
|
+
command: command4,
|
|
28528
28669
|
args
|
|
28529
28670
|
}
|
|
28530
28671
|
};
|
|
@@ -28585,14 +28726,14 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
28585
28726
|
var cp2 = __require("child_process");
|
|
28586
28727
|
var parse2 = require_parse5();
|
|
28587
28728
|
var enoent = require_enoent();
|
|
28588
|
-
function spawn2(
|
|
28589
|
-
const parsed = parse2(
|
|
28729
|
+
function spawn2(command4, args, options2) {
|
|
28730
|
+
const parsed = parse2(command4, args, options2);
|
|
28590
28731
|
const spawned = cp2.spawn(parsed.command, parsed.args, parsed.options);
|
|
28591
28732
|
enoent.hookChildProcess(spawned, parsed);
|
|
28592
28733
|
return spawned;
|
|
28593
28734
|
}
|
|
28594
|
-
function spawnSync(
|
|
28595
|
-
const parsed = parse2(
|
|
28735
|
+
function spawnSync(command4, args, options2) {
|
|
28736
|
+
const parsed = parse2(command4, args, options2);
|
|
28596
28737
|
const result = cp2.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
28597
28738
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
28598
28739
|
return result;
|
|
@@ -29135,7 +29276,7 @@ var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription,
|
|
|
29135
29276
|
error,
|
|
29136
29277
|
signal,
|
|
29137
29278
|
exitCode,
|
|
29138
|
-
command:
|
|
29279
|
+
command: command4,
|
|
29139
29280
|
escapedCommand,
|
|
29140
29281
|
timedOut,
|
|
29141
29282
|
isCanceled,
|
|
@@ -29147,7 +29288,7 @@ var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription,
|
|
|
29147
29288
|
const signalDescription = signal === undefined ? undefined : signalsByName[signal].description;
|
|
29148
29289
|
const errorCode = error && error.code;
|
|
29149
29290
|
const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
|
|
29150
|
-
const execaMessage = `Command ${prefix}: ${
|
|
29291
|
+
const execaMessage = `Command ${prefix}: ${command4}`;
|
|
29151
29292
|
const isError = Object.prototype.toString.call(error) === "[object Error]";
|
|
29152
29293
|
const shortMessage = isError ? `${execaMessage}
|
|
29153
29294
|
${error.message}` : execaMessage;
|
|
@@ -29160,7 +29301,7 @@ ${error.message}` : execaMessage;
|
|
|
29160
29301
|
error = new Error(message);
|
|
29161
29302
|
}
|
|
29162
29303
|
error.shortMessage = shortMessage;
|
|
29163
|
-
error.command =
|
|
29304
|
+
error.command = command4;
|
|
29164
29305
|
error.escapedCommand = escapedCommand;
|
|
29165
29306
|
error.exitCode = exitCode;
|
|
29166
29307
|
error.signal = signal;
|
|
@@ -29457,7 +29598,7 @@ var DEFAULT_FORCE_KILL_TIMEOUT, spawnedKill = (kill, signal = "SIGTERM", options
|
|
|
29457
29598
|
return spawnedPromise;
|
|
29458
29599
|
}
|
|
29459
29600
|
let timeoutId;
|
|
29460
|
-
const timeoutPromise = new Promise((
|
|
29601
|
+
const timeoutPromise = new Promise((resolve13, reject) => {
|
|
29461
29602
|
timeoutId = setTimeout(() => {
|
|
29462
29603
|
timeoutKill(spawned, killSignal, reject);
|
|
29463
29604
|
}, timeout);
|
|
@@ -29847,9 +29988,9 @@ var nativePromisePrototype, descriptors, mergePromise = (spawned, promise) => {
|
|
|
29847
29988
|
const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
|
|
29848
29989
|
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
29849
29990
|
}
|
|
29850
|
-
}, getSpawnedPromise = (spawned) => new Promise((
|
|
29991
|
+
}, getSpawnedPromise = (spawned) => new Promise((resolve13, reject) => {
|
|
29851
29992
|
spawned.on("exit", (exitCode, signal) => {
|
|
29852
|
-
|
|
29993
|
+
resolve13({ exitCode, signal });
|
|
29853
29994
|
});
|
|
29854
29995
|
spawned.on("error", (error) => {
|
|
29855
29996
|
reject(error);
|
|
@@ -29950,7 +30091,7 @@ import childProcess from "node:child_process";
|
|
|
29950
30091
|
import process7 from "node:process";
|
|
29951
30092
|
function execa(file, args, options2) {
|
|
29952
30093
|
const parsed = handleArguments(file, args, options2);
|
|
29953
|
-
const
|
|
30094
|
+
const command4 = joinCommand(file, args);
|
|
29954
30095
|
const escapedCommand = getEscapedCommand(file, args);
|
|
29955
30096
|
logCommand(escapedCommand, parsed.options);
|
|
29956
30097
|
validateTimeout(parsed.options);
|
|
@@ -29964,7 +30105,7 @@ function execa(file, args, options2) {
|
|
|
29964
30105
|
stdout: "",
|
|
29965
30106
|
stderr: "",
|
|
29966
30107
|
all: "",
|
|
29967
|
-
command:
|
|
30108
|
+
command: command4,
|
|
29968
30109
|
escapedCommand,
|
|
29969
30110
|
parsed,
|
|
29970
30111
|
timedOut: false,
|
|
@@ -29993,7 +30134,7 @@ function execa(file, args, options2) {
|
|
|
29993
30134
|
stdout,
|
|
29994
30135
|
stderr,
|
|
29995
30136
|
all,
|
|
29996
|
-
command:
|
|
30137
|
+
command: command4,
|
|
29997
30138
|
escapedCommand,
|
|
29998
30139
|
parsed,
|
|
29999
30140
|
timedOut,
|
|
@@ -30006,7 +30147,7 @@ function execa(file, args, options2) {
|
|
|
30006
30147
|
throw returnedError;
|
|
30007
30148
|
}
|
|
30008
30149
|
return {
|
|
30009
|
-
command:
|
|
30150
|
+
command: command4,
|
|
30010
30151
|
escapedCommand,
|
|
30011
30152
|
exitCode: 0,
|
|
30012
30153
|
stdout,
|
|
@@ -30027,7 +30168,7 @@ function execa(file, args, options2) {
|
|
|
30027
30168
|
}
|
|
30028
30169
|
function execaSync(file, args, options2) {
|
|
30029
30170
|
const parsed = handleArguments(file, args, options2);
|
|
30030
|
-
const
|
|
30171
|
+
const command4 = joinCommand(file, args);
|
|
30031
30172
|
const escapedCommand = getEscapedCommand(file, args);
|
|
30032
30173
|
logCommand(escapedCommand, parsed.options);
|
|
30033
30174
|
const input = handleInputSync(parsed.options);
|
|
@@ -30040,7 +30181,7 @@ function execaSync(file, args, options2) {
|
|
|
30040
30181
|
stdout: "",
|
|
30041
30182
|
stderr: "",
|
|
30042
30183
|
all: "",
|
|
30043
|
-
command:
|
|
30184
|
+
command: command4,
|
|
30044
30185
|
escapedCommand,
|
|
30045
30186
|
parsed,
|
|
30046
30187
|
timedOut: false,
|
|
@@ -30057,7 +30198,7 @@ function execaSync(file, args, options2) {
|
|
|
30057
30198
|
error: result.error,
|
|
30058
30199
|
signal: result.signal,
|
|
30059
30200
|
exitCode: result.status,
|
|
30060
|
-
command:
|
|
30201
|
+
command: command4,
|
|
30061
30202
|
escapedCommand,
|
|
30062
30203
|
parsed,
|
|
30063
30204
|
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
@@ -30070,7 +30211,7 @@ function execaSync(file, args, options2) {
|
|
|
30070
30211
|
throw error;
|
|
30071
30212
|
}
|
|
30072
30213
|
return {
|
|
30073
|
-
command:
|
|
30214
|
+
command: command4,
|
|
30074
30215
|
escapedCommand,
|
|
30075
30216
|
exitCode: 0,
|
|
30076
30217
|
stdout,
|
|
@@ -30165,7 +30306,7 @@ var package_default;
|
|
|
30165
30306
|
var init_package = __esm(() => {
|
|
30166
30307
|
package_default = {
|
|
30167
30308
|
name: "allagents",
|
|
30168
|
-
version: "0.
|
|
30309
|
+
version: "0.20.1",
|
|
30169
30310
|
description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
|
|
30170
30311
|
type: "module",
|
|
30171
30312
|
bin: {
|
|
@@ -30234,13 +30375,13 @@ var init_package = __esm(() => {
|
|
|
30234
30375
|
});
|
|
30235
30376
|
|
|
30236
30377
|
// src/cli/update-check.ts
|
|
30237
|
-
import { readFile as
|
|
30238
|
-
import { join as
|
|
30378
|
+
import { readFile as readFile14 } from "node:fs/promises";
|
|
30379
|
+
import { join as join20 } from "node:path";
|
|
30239
30380
|
import { spawn as spawn2 } from "node:child_process";
|
|
30240
30381
|
async function getCachedUpdateInfo(path3) {
|
|
30241
|
-
const filePath = path3 ??
|
|
30382
|
+
const filePath = path3 ?? join20(getHomeDir(), CONFIG_DIR, CACHE_FILE);
|
|
30242
30383
|
try {
|
|
30243
|
-
const raw = await
|
|
30384
|
+
const raw = await readFile14(filePath, "utf-8");
|
|
30244
30385
|
const data = JSON.parse(raw);
|
|
30245
30386
|
if (typeof data.latestVersion === "string" && typeof data.lastCheckedAt === "string") {
|
|
30246
30387
|
return data;
|
|
@@ -30276,8 +30417,8 @@ function buildNotice(currentVersion, latestVersion) {
|
|
|
30276
30417
|
Run \`allagents self update\` to upgrade.`;
|
|
30277
30418
|
}
|
|
30278
30419
|
function backgroundUpdateCheck() {
|
|
30279
|
-
const dir =
|
|
30280
|
-
const filePath =
|
|
30420
|
+
const dir = join20(getHomeDir(), CONFIG_DIR);
|
|
30421
|
+
const filePath = join20(dir, CACHE_FILE);
|
|
30281
30422
|
const script = `
|
|
30282
30423
|
const https = require('https');
|
|
30283
30424
|
const fs = require('fs');
|
|
@@ -30328,17 +30469,17 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
30328
30469
|
var env2 = p.env || {};
|
|
30329
30470
|
var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
|
|
30330
30471
|
var formatter = (open, close, replace = open) => (input) => {
|
|
30331
|
-
let
|
|
30332
|
-
return ~index ? open + replaceClose(
|
|
30472
|
+
let string4 = "" + input, index = string4.indexOf(close, open.length);
|
|
30473
|
+
return ~index ? open + replaceClose(string4, close, replace, index) + close : open + string4 + close;
|
|
30333
30474
|
};
|
|
30334
|
-
var replaceClose = (
|
|
30475
|
+
var replaceClose = (string4, close, replace, index) => {
|
|
30335
30476
|
let result = "", cursor = 0;
|
|
30336
30477
|
do {
|
|
30337
|
-
result +=
|
|
30478
|
+
result += string4.substring(cursor, index) + replace;
|
|
30338
30479
|
cursor = index + close.length;
|
|
30339
|
-
index =
|
|
30480
|
+
index = string4.indexOf(close, cursor);
|
|
30340
30481
|
} while (~index);
|
|
30341
|
-
return result +
|
|
30482
|
+
return result + string4.substring(cursor);
|
|
30342
30483
|
};
|
|
30343
30484
|
var createColors = (enabled = isColorSupported) => {
|
|
30344
30485
|
let f = enabled ? formatter : () => String;
|
|
@@ -32113,15 +32254,15 @@ class TuiCache {
|
|
|
32113
32254
|
}
|
|
32114
32255
|
|
|
32115
32256
|
// src/cli/tui/context.ts
|
|
32116
|
-
import { existsSync as
|
|
32117
|
-
import { join as
|
|
32257
|
+
import { existsSync as existsSync18 } from "node:fs";
|
|
32258
|
+
import { join as join21 } from "node:path";
|
|
32118
32259
|
async function getTuiContext(cwd = process.cwd(), cache2) {
|
|
32119
32260
|
const cachedContext = cache2?.getContext();
|
|
32120
32261
|
if (cachedContext) {
|
|
32121
32262
|
return cachedContext;
|
|
32122
32263
|
}
|
|
32123
|
-
const configPath =
|
|
32124
|
-
const hasWorkspace =
|
|
32264
|
+
const configPath = join21(cwd, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
32265
|
+
const hasWorkspace = existsSync18(configPath) && !isUserConfigPath(cwd);
|
|
32125
32266
|
let projectPluginCount = 0;
|
|
32126
32267
|
if (hasWorkspace) {
|
|
32127
32268
|
try {
|
|
@@ -32878,7 +33019,7 @@ var init_wizard = __esm(() => {
|
|
|
32878
33019
|
});
|
|
32879
33020
|
|
|
32880
33021
|
// src/cli/index.ts
|
|
32881
|
-
var
|
|
33022
|
+
var import_cmd_ts6 = __toESM(require_cjs(), 1);
|
|
32882
33023
|
|
|
32883
33024
|
// src/cli/help.ts
|
|
32884
33025
|
var import_cmd_ts = __toESM(require_cjs(), 1);
|
|
@@ -33651,7 +33792,7 @@ init_marketplace();
|
|
|
33651
33792
|
init_sync();
|
|
33652
33793
|
init_workspace_modify();
|
|
33653
33794
|
init_user_workspace();
|
|
33654
|
-
var
|
|
33795
|
+
var import_cmd_ts4 = __toESM(require_cjs(), 1);
|
|
33655
33796
|
|
|
33656
33797
|
// src/cli/metadata/plugin.ts
|
|
33657
33798
|
var marketplaceListMeta = {
|
|
@@ -33818,6 +33959,474 @@ var pluginUninstallMeta = {
|
|
|
33818
33959
|
}
|
|
33819
33960
|
};
|
|
33820
33961
|
|
|
33962
|
+
// src/cli/commands/plugin-skills.ts
|
|
33963
|
+
init_sync();
|
|
33964
|
+
init_workspace_modify();
|
|
33965
|
+
init_user_workspace();
|
|
33966
|
+
var import_cmd_ts3 = __toESM(require_cjs(), 1);
|
|
33967
|
+
|
|
33968
|
+
// src/core/skills.ts
|
|
33969
|
+
init_js_yaml();
|
|
33970
|
+
init_constants();
|
|
33971
|
+
init_plugin();
|
|
33972
|
+
init_plugin_path();
|
|
33973
|
+
init_marketplace();
|
|
33974
|
+
import { existsSync as existsSync17 } from "node:fs";
|
|
33975
|
+
import { readFile as readFile13, readdir as readdir4 } from "node:fs/promises";
|
|
33976
|
+
import { join as join19, resolve as resolve12 } from "node:path";
|
|
33977
|
+
async function resolvePluginPath(pluginSource, workspacePath) {
|
|
33978
|
+
if (isPluginSpec(pluginSource)) {
|
|
33979
|
+
const resolved2 = await resolvePluginSpecWithAutoRegister(pluginSource);
|
|
33980
|
+
return resolved2.success ? resolved2.path ?? null : null;
|
|
33981
|
+
}
|
|
33982
|
+
if (isGitHubUrl(pluginSource)) {
|
|
33983
|
+
const parsed = parseGitHubUrl(pluginSource);
|
|
33984
|
+
const result = await fetchPlugin(pluginSource, {
|
|
33985
|
+
offline: true,
|
|
33986
|
+
...parsed?.branch && { branch: parsed.branch }
|
|
33987
|
+
});
|
|
33988
|
+
if (!result.success)
|
|
33989
|
+
return null;
|
|
33990
|
+
return parsed?.subpath ? join19(result.cachePath, parsed.subpath) : result.cachePath;
|
|
33991
|
+
}
|
|
33992
|
+
const resolved = resolve12(workspacePath, pluginSource);
|
|
33993
|
+
return existsSync17(resolved) ? resolved : null;
|
|
33994
|
+
}
|
|
33995
|
+
async function getAllSkillsFromPlugins(workspacePath = process.cwd()) {
|
|
33996
|
+
const configPath = join19(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
33997
|
+
if (!existsSync17(configPath)) {
|
|
33998
|
+
return [];
|
|
33999
|
+
}
|
|
34000
|
+
const content = await readFile13(configPath, "utf-8");
|
|
34001
|
+
const config = load(content);
|
|
34002
|
+
const disabledSkills = new Set(config.disabledSkills ?? []);
|
|
34003
|
+
const skills = [];
|
|
34004
|
+
for (const pluginSource of config.plugins) {
|
|
34005
|
+
const pluginPath = await resolvePluginPath(pluginSource, workspacePath);
|
|
34006
|
+
if (!pluginPath)
|
|
34007
|
+
continue;
|
|
34008
|
+
const pluginName = await getPluginName(pluginPath);
|
|
34009
|
+
const skillsDir = join19(pluginPath, "skills");
|
|
34010
|
+
if (!existsSync17(skillsDir))
|
|
34011
|
+
continue;
|
|
34012
|
+
const entries = await readdir4(skillsDir, { withFileTypes: true });
|
|
34013
|
+
const skillDirs = entries.filter((e) => e.isDirectory());
|
|
34014
|
+
for (const entry of skillDirs) {
|
|
34015
|
+
const skillKey = `${pluginName}:${entry.name}`;
|
|
34016
|
+
skills.push({
|
|
34017
|
+
name: entry.name,
|
|
34018
|
+
pluginName,
|
|
34019
|
+
pluginSource,
|
|
34020
|
+
path: join19(skillsDir, entry.name),
|
|
34021
|
+
disabled: disabledSkills.has(skillKey)
|
|
34022
|
+
});
|
|
34023
|
+
}
|
|
34024
|
+
}
|
|
34025
|
+
return skills;
|
|
34026
|
+
}
|
|
34027
|
+
async function findSkillByName(skillName, workspacePath = process.cwd()) {
|
|
34028
|
+
const allSkills = await getAllSkillsFromPlugins(workspacePath);
|
|
34029
|
+
return allSkills.filter((s) => s.name === skillName);
|
|
34030
|
+
}
|
|
34031
|
+
|
|
34032
|
+
// src/cli/metadata/plugin-skills.ts
|
|
34033
|
+
var skillsListMeta = {
|
|
34034
|
+
command: "plugin skills list",
|
|
34035
|
+
description: "List all skills from installed plugins",
|
|
34036
|
+
whenToUse: "To see available skills and their enabled/disabled status",
|
|
34037
|
+
examples: [
|
|
34038
|
+
"allagents plugin skills list",
|
|
34039
|
+
"allagents plugin skills list --scope user"
|
|
34040
|
+
],
|
|
34041
|
+
expectedOutput: "Lists skills grouped by plugin with enabled/disabled status",
|
|
34042
|
+
options: [
|
|
34043
|
+
{ flag: "--scope", short: "-s", type: "string", description: 'Scope: "project" (default) or "user"' }
|
|
34044
|
+
],
|
|
34045
|
+
outputSchema: {
|
|
34046
|
+
skills: [{ name: "string", plugin: "string", disabled: "boolean" }]
|
|
34047
|
+
}
|
|
34048
|
+
};
|
|
34049
|
+
var skillsRemoveMeta = {
|
|
34050
|
+
command: "plugin skills remove",
|
|
34051
|
+
description: "Disable a skill (exclude from sync)",
|
|
34052
|
+
whenToUse: "To prevent a specific skill from being synced to your workspace",
|
|
34053
|
+
examples: [
|
|
34054
|
+
"allagents plugin skills remove brainstorming",
|
|
34055
|
+
"allagents plugin skills remove brainstorming --plugin superpowers",
|
|
34056
|
+
"allagents plugin skills remove brainstorming --scope user"
|
|
34057
|
+
],
|
|
34058
|
+
expectedOutput: "Confirms skill was disabled and runs sync",
|
|
34059
|
+
positionals: [
|
|
34060
|
+
{ name: "skill", type: "string", required: true, description: "Skill name to disable" }
|
|
34061
|
+
],
|
|
34062
|
+
options: [
|
|
34063
|
+
{ flag: "--scope", short: "-s", type: "string", description: 'Scope: "project" (default) or "user"' },
|
|
34064
|
+
{ flag: "--plugin", short: "-p", type: "string", description: "Plugin name (required if skill exists in multiple plugins)" }
|
|
34065
|
+
],
|
|
34066
|
+
outputSchema: {
|
|
34067
|
+
skill: "string",
|
|
34068
|
+
plugin: "string",
|
|
34069
|
+
syncResult: { copied: "number", failed: "number" }
|
|
34070
|
+
}
|
|
34071
|
+
};
|
|
34072
|
+
var skillsAddMeta = {
|
|
34073
|
+
command: "plugin skills add",
|
|
34074
|
+
description: "Re-enable a previously disabled skill",
|
|
34075
|
+
whenToUse: "To re-enable a skill that was previously disabled",
|
|
34076
|
+
examples: [
|
|
34077
|
+
"allagents plugin skills add brainstorming",
|
|
34078
|
+
"allagents plugin skills add brainstorming --plugin superpowers"
|
|
34079
|
+
],
|
|
34080
|
+
expectedOutput: "Confirms skill was enabled and runs sync",
|
|
34081
|
+
positionals: [
|
|
34082
|
+
{ name: "skill", type: "string", required: true, description: "Skill name to enable" }
|
|
34083
|
+
],
|
|
34084
|
+
options: [
|
|
34085
|
+
{ flag: "--scope", short: "-s", type: "string", description: 'Scope: "project" (default) or "user"' },
|
|
34086
|
+
{ flag: "--plugin", short: "-p", type: "string", description: "Plugin name (required if skill exists in multiple plugins)" }
|
|
34087
|
+
],
|
|
34088
|
+
outputSchema: {
|
|
34089
|
+
skill: "string",
|
|
34090
|
+
plugin: "string",
|
|
34091
|
+
syncResult: { copied: "number", failed: "number" }
|
|
34092
|
+
}
|
|
34093
|
+
};
|
|
34094
|
+
|
|
34095
|
+
// src/cli/commands/plugin-skills.ts
|
|
34096
|
+
init_constants();
|
|
34097
|
+
function groupSkillsByPlugin(skills) {
|
|
34098
|
+
const grouped = new Map;
|
|
34099
|
+
for (const skill of skills) {
|
|
34100
|
+
const existing = grouped.get(skill.pluginName);
|
|
34101
|
+
if (existing) {
|
|
34102
|
+
existing.skills.push({ name: skill.name, disabled: skill.disabled });
|
|
34103
|
+
} else {
|
|
34104
|
+
grouped.set(skill.pluginName, {
|
|
34105
|
+
source: skill.pluginSource,
|
|
34106
|
+
skills: [{ name: skill.name, disabled: skill.disabled }]
|
|
34107
|
+
});
|
|
34108
|
+
}
|
|
34109
|
+
}
|
|
34110
|
+
return grouped;
|
|
34111
|
+
}
|
|
34112
|
+
var listCmd = import_cmd_ts3.command({
|
|
34113
|
+
name: "list",
|
|
34114
|
+
description: buildDescription(skillsListMeta),
|
|
34115
|
+
args: {
|
|
34116
|
+
scope: import_cmd_ts3.option({
|
|
34117
|
+
type: import_cmd_ts3.optional(import_cmd_ts3.string),
|
|
34118
|
+
long: "scope",
|
|
34119
|
+
short: "s",
|
|
34120
|
+
description: 'Scope: "project" (default) or "user"'
|
|
34121
|
+
})
|
|
34122
|
+
},
|
|
34123
|
+
handler: async ({ scope }) => {
|
|
34124
|
+
try {
|
|
34125
|
+
const isUser = scope === "user" || !scope && isUserConfigPath(process.cwd());
|
|
34126
|
+
const workspacePath = isUser ? getHomeDir() : process.cwd();
|
|
34127
|
+
const skills = await getAllSkillsFromPlugins(workspacePath);
|
|
34128
|
+
if (isJsonMode()) {
|
|
34129
|
+
jsonOutput({
|
|
34130
|
+
success: true,
|
|
34131
|
+
command: "plugin skills list",
|
|
34132
|
+
data: {
|
|
34133
|
+
scope: isUser ? "user" : "project",
|
|
34134
|
+
skills: skills.map((s) => ({
|
|
34135
|
+
name: s.name,
|
|
34136
|
+
plugin: s.pluginName,
|
|
34137
|
+
disabled: s.disabled
|
|
34138
|
+
}))
|
|
34139
|
+
}
|
|
34140
|
+
});
|
|
34141
|
+
return;
|
|
34142
|
+
}
|
|
34143
|
+
if (skills.length === 0) {
|
|
34144
|
+
console.log("No skills found. Install a plugin first with:");
|
|
34145
|
+
console.log(" allagents plugin install <plugin>");
|
|
34146
|
+
return;
|
|
34147
|
+
}
|
|
34148
|
+
const grouped = groupSkillsByPlugin(skills);
|
|
34149
|
+
for (const [pluginName, data] of grouped) {
|
|
34150
|
+
console.log(`
|
|
34151
|
+
${pluginName} (${data.source}):`);
|
|
34152
|
+
for (const skill of data.skills) {
|
|
34153
|
+
const icon = skill.disabled ? "✗" : "✓";
|
|
34154
|
+
const status = skill.disabled ? " (disabled)" : "";
|
|
34155
|
+
console.log(` ${icon} ${skill.name}${status}`);
|
|
34156
|
+
}
|
|
34157
|
+
}
|
|
34158
|
+
console.log();
|
|
34159
|
+
} catch (error) {
|
|
34160
|
+
if (error instanceof Error) {
|
|
34161
|
+
if (isJsonMode()) {
|
|
34162
|
+
jsonOutput({ success: false, command: "plugin skills list", error: error.message });
|
|
34163
|
+
process.exit(1);
|
|
34164
|
+
}
|
|
34165
|
+
console.error(`Error: ${error.message}`);
|
|
34166
|
+
process.exit(1);
|
|
34167
|
+
}
|
|
34168
|
+
throw error;
|
|
34169
|
+
}
|
|
34170
|
+
}
|
|
34171
|
+
});
|
|
34172
|
+
var removeCmd = import_cmd_ts3.command({
|
|
34173
|
+
name: "remove",
|
|
34174
|
+
description: buildDescription(skillsRemoveMeta),
|
|
34175
|
+
args: {
|
|
34176
|
+
skill: import_cmd_ts3.positional({ type: import_cmd_ts3.string, displayName: "skill" }),
|
|
34177
|
+
scope: import_cmd_ts3.option({
|
|
34178
|
+
type: import_cmd_ts3.optional(import_cmd_ts3.string),
|
|
34179
|
+
long: "scope",
|
|
34180
|
+
short: "s",
|
|
34181
|
+
description: 'Scope: "project" (default) or "user"'
|
|
34182
|
+
}),
|
|
34183
|
+
plugin: import_cmd_ts3.option({
|
|
34184
|
+
type: import_cmd_ts3.optional(import_cmd_ts3.string),
|
|
34185
|
+
long: "plugin",
|
|
34186
|
+
short: "p",
|
|
34187
|
+
description: "Plugin name (required if skill exists in multiple plugins)"
|
|
34188
|
+
})
|
|
34189
|
+
},
|
|
34190
|
+
handler: async ({ skill, scope, plugin }) => {
|
|
34191
|
+
try {
|
|
34192
|
+
const isUser = scope === "user" || !scope && isUserConfigPath(process.cwd());
|
|
34193
|
+
const workspacePath = isUser ? getHomeDir() : process.cwd();
|
|
34194
|
+
const matches = await findSkillByName(skill, workspacePath);
|
|
34195
|
+
if (matches.length === 0) {
|
|
34196
|
+
const allSkills = await getAllSkillsFromPlugins(workspacePath);
|
|
34197
|
+
const skillNames = [...new Set(allSkills.map((s) => s.name))].join(", ");
|
|
34198
|
+
const error = `Skill '${skill}' not found in any installed plugin.
|
|
34199
|
+
|
|
34200
|
+
Available skills: ${skillNames || "none"}`;
|
|
34201
|
+
if (isJsonMode()) {
|
|
34202
|
+
jsonOutput({ success: false, command: "plugin skills remove", error });
|
|
34203
|
+
process.exit(1);
|
|
34204
|
+
}
|
|
34205
|
+
console.error(`Error: ${error}`);
|
|
34206
|
+
process.exit(1);
|
|
34207
|
+
}
|
|
34208
|
+
let targetSkill = matches[0];
|
|
34209
|
+
if (!targetSkill) {
|
|
34210
|
+
throw new Error("Unexpected empty matches array");
|
|
34211
|
+
}
|
|
34212
|
+
if (matches.length > 1) {
|
|
34213
|
+
if (!plugin) {
|
|
34214
|
+
const pluginList = matches.map((m) => ` - ${m.pluginName} (${m.pluginSource})`).join(`
|
|
34215
|
+
`);
|
|
34216
|
+
const error = `'${skill}' exists in multiple plugins:
|
|
34217
|
+
${pluginList}
|
|
34218
|
+
|
|
34219
|
+
Use --plugin to specify: allagents plugin skills remove ${skill} --plugin <name>`;
|
|
34220
|
+
if (isJsonMode()) {
|
|
34221
|
+
jsonOutput({ success: false, command: "plugin skills remove", error });
|
|
34222
|
+
process.exit(1);
|
|
34223
|
+
}
|
|
34224
|
+
console.error(`Error: ${error}`);
|
|
34225
|
+
process.exit(1);
|
|
34226
|
+
}
|
|
34227
|
+
const filtered = matches.find((m) => m.pluginName === plugin);
|
|
34228
|
+
if (!filtered) {
|
|
34229
|
+
const error = `Plugin '${plugin}' not found. Installed plugins: ${matches.map((m) => m.pluginName).join(", ")}`;
|
|
34230
|
+
if (isJsonMode()) {
|
|
34231
|
+
jsonOutput({ success: false, command: "plugin skills remove", error });
|
|
34232
|
+
process.exit(1);
|
|
34233
|
+
}
|
|
34234
|
+
console.error(`Error: ${error}`);
|
|
34235
|
+
process.exit(1);
|
|
34236
|
+
}
|
|
34237
|
+
targetSkill = filtered;
|
|
34238
|
+
}
|
|
34239
|
+
if (targetSkill.disabled) {
|
|
34240
|
+
const msg = `Skill '${skill}' is already disabled.`;
|
|
34241
|
+
if (isJsonMode()) {
|
|
34242
|
+
jsonOutput({ success: false, command: "plugin skills remove", error: msg });
|
|
34243
|
+
process.exit(1);
|
|
34244
|
+
}
|
|
34245
|
+
console.log(msg);
|
|
34246
|
+
return;
|
|
34247
|
+
}
|
|
34248
|
+
const skillKey = `${targetSkill.pluginName}:${skill}`;
|
|
34249
|
+
const result = isUser ? await addUserDisabledSkill(skillKey) : await addDisabledSkill(skillKey, workspacePath);
|
|
34250
|
+
if (!result.success) {
|
|
34251
|
+
if (isJsonMode()) {
|
|
34252
|
+
jsonOutput({ success: false, command: "plugin skills remove", error: result.error ?? "Unknown error" });
|
|
34253
|
+
process.exit(1);
|
|
34254
|
+
}
|
|
34255
|
+
console.error(`Error: ${result.error}`);
|
|
34256
|
+
process.exit(1);
|
|
34257
|
+
}
|
|
34258
|
+
if (!isJsonMode()) {
|
|
34259
|
+
console.log(`✓ Disabled skill: ${skill} (${targetSkill.pluginName})`);
|
|
34260
|
+
console.log(`
|
|
34261
|
+
Syncing workspace...
|
|
34262
|
+
`);
|
|
34263
|
+
}
|
|
34264
|
+
const syncResult = isUser ? await syncUserWorkspace() : await syncWorkspace(workspacePath);
|
|
34265
|
+
if (isJsonMode()) {
|
|
34266
|
+
jsonOutput({
|
|
34267
|
+
success: syncResult.success,
|
|
34268
|
+
command: "plugin skills remove",
|
|
34269
|
+
data: {
|
|
34270
|
+
skill,
|
|
34271
|
+
plugin: targetSkill.pluginName,
|
|
34272
|
+
syncResult: {
|
|
34273
|
+
copied: syncResult.totalCopied,
|
|
34274
|
+
failed: syncResult.totalFailed
|
|
34275
|
+
}
|
|
34276
|
+
}
|
|
34277
|
+
});
|
|
34278
|
+
if (!syncResult.success)
|
|
34279
|
+
process.exit(1);
|
|
34280
|
+
return;
|
|
34281
|
+
}
|
|
34282
|
+
console.log("Sync complete.");
|
|
34283
|
+
} catch (error) {
|
|
34284
|
+
if (error instanceof Error) {
|
|
34285
|
+
if (isJsonMode()) {
|
|
34286
|
+
jsonOutput({ success: false, command: "plugin skills remove", error: error.message });
|
|
34287
|
+
process.exit(1);
|
|
34288
|
+
}
|
|
34289
|
+
console.error(`Error: ${error.message}`);
|
|
34290
|
+
process.exit(1);
|
|
34291
|
+
}
|
|
34292
|
+
throw error;
|
|
34293
|
+
}
|
|
34294
|
+
}
|
|
34295
|
+
});
|
|
34296
|
+
var addCmd = import_cmd_ts3.command({
|
|
34297
|
+
name: "add",
|
|
34298
|
+
description: buildDescription(skillsAddMeta),
|
|
34299
|
+
args: {
|
|
34300
|
+
skill: import_cmd_ts3.positional({ type: import_cmd_ts3.string, displayName: "skill" }),
|
|
34301
|
+
scope: import_cmd_ts3.option({
|
|
34302
|
+
type: import_cmd_ts3.optional(import_cmd_ts3.string),
|
|
34303
|
+
long: "scope",
|
|
34304
|
+
short: "s",
|
|
34305
|
+
description: 'Scope: "project" (default) or "user"'
|
|
34306
|
+
}),
|
|
34307
|
+
plugin: import_cmd_ts3.option({
|
|
34308
|
+
type: import_cmd_ts3.optional(import_cmd_ts3.string),
|
|
34309
|
+
long: "plugin",
|
|
34310
|
+
short: "p",
|
|
34311
|
+
description: "Plugin name (required if skill exists in multiple plugins)"
|
|
34312
|
+
})
|
|
34313
|
+
},
|
|
34314
|
+
handler: async ({ skill, scope, plugin }) => {
|
|
34315
|
+
try {
|
|
34316
|
+
const isUser = scope === "user" || !scope && isUserConfigPath(process.cwd());
|
|
34317
|
+
const workspacePath = isUser ? getHomeDir() : process.cwd();
|
|
34318
|
+
const matches = await findSkillByName(skill, workspacePath);
|
|
34319
|
+
if (matches.length === 0) {
|
|
34320
|
+
const allSkills = await getAllSkillsFromPlugins(workspacePath);
|
|
34321
|
+
const skillNames = [...new Set(allSkills.map((s) => s.name))].join(", ");
|
|
34322
|
+
const error = `Skill '${skill}' not found in any installed plugin.
|
|
34323
|
+
|
|
34324
|
+
Available skills: ${skillNames || "none"}`;
|
|
34325
|
+
if (isJsonMode()) {
|
|
34326
|
+
jsonOutput({ success: false, command: "plugin skills add", error });
|
|
34327
|
+
process.exit(1);
|
|
34328
|
+
}
|
|
34329
|
+
console.error(`Error: ${error}`);
|
|
34330
|
+
process.exit(1);
|
|
34331
|
+
}
|
|
34332
|
+
let targetSkill = matches[0];
|
|
34333
|
+
if (!targetSkill) {
|
|
34334
|
+
throw new Error("Unexpected empty matches array");
|
|
34335
|
+
}
|
|
34336
|
+
if (matches.length > 1) {
|
|
34337
|
+
if (!plugin) {
|
|
34338
|
+
const pluginList = matches.map((m) => ` - ${m.pluginName} (${m.pluginSource})`).join(`
|
|
34339
|
+
`);
|
|
34340
|
+
const error = `'${skill}' exists in multiple plugins:
|
|
34341
|
+
${pluginList}
|
|
34342
|
+
|
|
34343
|
+
Use --plugin to specify: allagents plugin skills add ${skill} --plugin <name>`;
|
|
34344
|
+
if (isJsonMode()) {
|
|
34345
|
+
jsonOutput({ success: false, command: "plugin skills add", error });
|
|
34346
|
+
process.exit(1);
|
|
34347
|
+
}
|
|
34348
|
+
console.error(`Error: ${error}`);
|
|
34349
|
+
process.exit(1);
|
|
34350
|
+
}
|
|
34351
|
+
const filtered = matches.find((m) => m.pluginName === plugin);
|
|
34352
|
+
if (!filtered) {
|
|
34353
|
+
const error = `Plugin '${plugin}' not found. Installed plugins: ${matches.map((m) => m.pluginName).join(", ")}`;
|
|
34354
|
+
if (isJsonMode()) {
|
|
34355
|
+
jsonOutput({ success: false, command: "plugin skills add", error });
|
|
34356
|
+
process.exit(1);
|
|
34357
|
+
}
|
|
34358
|
+
console.error(`Error: ${error}`);
|
|
34359
|
+
process.exit(1);
|
|
34360
|
+
}
|
|
34361
|
+
targetSkill = filtered;
|
|
34362
|
+
}
|
|
34363
|
+
if (!targetSkill.disabled) {
|
|
34364
|
+
const msg = `Skill '${skill}' is already enabled.`;
|
|
34365
|
+
if (isJsonMode()) {
|
|
34366
|
+
jsonOutput({ success: false, command: "plugin skills add", error: msg });
|
|
34367
|
+
process.exit(1);
|
|
34368
|
+
}
|
|
34369
|
+
console.log(msg);
|
|
34370
|
+
return;
|
|
34371
|
+
}
|
|
34372
|
+
const skillKey = `${targetSkill.pluginName}:${skill}`;
|
|
34373
|
+
const result = isUser ? await removeUserDisabledSkill(skillKey) : await removeDisabledSkill(skillKey, workspacePath);
|
|
34374
|
+
if (!result.success) {
|
|
34375
|
+
if (isJsonMode()) {
|
|
34376
|
+
jsonOutput({ success: false, command: "plugin skills add", error: result.error ?? "Unknown error" });
|
|
34377
|
+
process.exit(1);
|
|
34378
|
+
}
|
|
34379
|
+
console.error(`Error: ${result.error}`);
|
|
34380
|
+
process.exit(1);
|
|
34381
|
+
}
|
|
34382
|
+
if (!isJsonMode()) {
|
|
34383
|
+
console.log(`✓ Enabled skill: ${skill} (${targetSkill.pluginName})`);
|
|
34384
|
+
console.log(`
|
|
34385
|
+
Syncing workspace...
|
|
34386
|
+
`);
|
|
34387
|
+
}
|
|
34388
|
+
const syncResult = isUser ? await syncUserWorkspace() : await syncWorkspace(workspacePath);
|
|
34389
|
+
if (isJsonMode()) {
|
|
34390
|
+
jsonOutput({
|
|
34391
|
+
success: syncResult.success,
|
|
34392
|
+
command: "plugin skills add",
|
|
34393
|
+
data: {
|
|
34394
|
+
skill,
|
|
34395
|
+
plugin: targetSkill.pluginName,
|
|
34396
|
+
syncResult: {
|
|
34397
|
+
copied: syncResult.totalCopied,
|
|
34398
|
+
failed: syncResult.totalFailed
|
|
34399
|
+
}
|
|
34400
|
+
}
|
|
34401
|
+
});
|
|
34402
|
+
if (!syncResult.success)
|
|
34403
|
+
process.exit(1);
|
|
34404
|
+
return;
|
|
34405
|
+
}
|
|
34406
|
+
console.log("Sync complete.");
|
|
34407
|
+
} catch (error) {
|
|
34408
|
+
if (error instanceof Error) {
|
|
34409
|
+
if (isJsonMode()) {
|
|
34410
|
+
jsonOutput({ success: false, command: "plugin skills add", error: error.message });
|
|
34411
|
+
process.exit(1);
|
|
34412
|
+
}
|
|
34413
|
+
console.error(`Error: ${error.message}`);
|
|
34414
|
+
process.exit(1);
|
|
34415
|
+
}
|
|
34416
|
+
throw error;
|
|
34417
|
+
}
|
|
34418
|
+
}
|
|
34419
|
+
});
|
|
34420
|
+
var skillsCmd = conciseSubcommands({
|
|
34421
|
+
name: "skills",
|
|
34422
|
+
description: "Manage individual skills from plugins",
|
|
34423
|
+
cmds: {
|
|
34424
|
+
list: listCmd,
|
|
34425
|
+
remove: removeCmd,
|
|
34426
|
+
add: addCmd
|
|
34427
|
+
}
|
|
34428
|
+
});
|
|
34429
|
+
|
|
33821
34430
|
// src/cli/commands/plugin.ts
|
|
33822
34431
|
function buildSyncData2(result) {
|
|
33823
34432
|
return {
|
|
@@ -33937,7 +34546,7 @@ User sync complete:`);
|
|
|
33937
34546
|
}
|
|
33938
34547
|
return { ok: result.success && result.totalFailed === 0, syncData };
|
|
33939
34548
|
}
|
|
33940
|
-
var marketplaceListCmd =
|
|
34549
|
+
var marketplaceListCmd = import_cmd_ts4.command({
|
|
33941
34550
|
name: "list",
|
|
33942
34551
|
description: buildDescription(marketplaceListMeta),
|
|
33943
34552
|
args: {},
|
|
@@ -33958,11 +34567,9 @@ var marketplaceListCmd = import_cmd_ts3.command({
|
|
|
33958
34567
|
console.log("Add a marketplace with:");
|
|
33959
34568
|
console.log(` allagents plugin marketplace add <source>
|
|
33960
34569
|
`);
|
|
33961
|
-
console.log("
|
|
33962
|
-
|
|
33963
|
-
|
|
33964
|
-
console.log(` ${name} → ${repo}`);
|
|
33965
|
-
}
|
|
34570
|
+
console.log("Examples:");
|
|
34571
|
+
console.log(" allagents plugin marketplace add owner/repo");
|
|
34572
|
+
console.log(" allagents plugin marketplace add https://github.com/owner/repo");
|
|
33966
34573
|
return;
|
|
33967
34574
|
}
|
|
33968
34575
|
console.log(`Registered marketplaces:
|
|
@@ -33990,13 +34597,13 @@ var marketplaceListCmd = import_cmd_ts3.command({
|
|
|
33990
34597
|
}
|
|
33991
34598
|
}
|
|
33992
34599
|
});
|
|
33993
|
-
var marketplaceAddCmd =
|
|
34600
|
+
var marketplaceAddCmd = import_cmd_ts4.command({
|
|
33994
34601
|
name: "add",
|
|
33995
34602
|
description: buildDescription(marketplaceAddMeta),
|
|
33996
34603
|
args: {
|
|
33997
|
-
source:
|
|
33998
|
-
name:
|
|
33999
|
-
branch:
|
|
34604
|
+
source: import_cmd_ts4.positional({ type: import_cmd_ts4.string, displayName: "source" }),
|
|
34605
|
+
name: import_cmd_ts4.option({ type: import_cmd_ts4.optional(import_cmd_ts4.string), long: "name", short: "n", description: "Custom name for the marketplace" }),
|
|
34606
|
+
branch: import_cmd_ts4.option({ type: import_cmd_ts4.optional(import_cmd_ts4.string), long: "branch", short: "b", description: "Branch to checkout after cloning" })
|
|
34000
34607
|
},
|
|
34001
34608
|
handler: async ({ source, name, branch }) => {
|
|
34002
34609
|
try {
|
|
@@ -34041,11 +34648,11 @@ Error: ${result.error}`);
|
|
|
34041
34648
|
}
|
|
34042
34649
|
}
|
|
34043
34650
|
});
|
|
34044
|
-
var marketplaceRemoveCmd =
|
|
34651
|
+
var marketplaceRemoveCmd = import_cmd_ts4.command({
|
|
34045
34652
|
name: "remove",
|
|
34046
34653
|
description: buildDescription(marketplaceRemoveMeta),
|
|
34047
34654
|
args: {
|
|
34048
|
-
name:
|
|
34655
|
+
name: import_cmd_ts4.positional({ type: import_cmd_ts4.string, displayName: "name" })
|
|
34049
34656
|
},
|
|
34050
34657
|
handler: async ({ name }) => {
|
|
34051
34658
|
try {
|
|
@@ -34089,11 +34696,11 @@ var marketplaceRemoveCmd = import_cmd_ts3.command({
|
|
|
34089
34696
|
}
|
|
34090
34697
|
}
|
|
34091
34698
|
});
|
|
34092
|
-
var marketplaceUpdateCmd =
|
|
34699
|
+
var marketplaceUpdateCmd = import_cmd_ts4.command({
|
|
34093
34700
|
name: "update",
|
|
34094
34701
|
description: buildDescription(marketplaceUpdateMeta),
|
|
34095
34702
|
args: {
|
|
34096
|
-
name:
|
|
34703
|
+
name: import_cmd_ts4.positional({ type: import_cmd_ts4.optional(import_cmd_ts4.string), displayName: "name" })
|
|
34097
34704
|
},
|
|
34098
34705
|
handler: async ({ name }) => {
|
|
34099
34706
|
try {
|
|
@@ -34159,11 +34766,11 @@ var marketplaceCmd = conciseSubcommands({
|
|
|
34159
34766
|
update: marketplaceUpdateCmd
|
|
34160
34767
|
}
|
|
34161
34768
|
});
|
|
34162
|
-
var pluginListCmd =
|
|
34769
|
+
var pluginListCmd = import_cmd_ts4.command({
|
|
34163
34770
|
name: "list",
|
|
34164
34771
|
description: buildDescription(pluginListMeta),
|
|
34165
34772
|
args: {
|
|
34166
|
-
marketplace:
|
|
34773
|
+
marketplace: import_cmd_ts4.positional({ type: import_cmd_ts4.optional(import_cmd_ts4.string), displayName: "marketplace" })
|
|
34167
34774
|
},
|
|
34168
34775
|
handler: async ({ marketplace }) => {
|
|
34169
34776
|
try {
|
|
@@ -34195,11 +34802,25 @@ var pluginListCmd = import_cmd_ts3.command({
|
|
|
34195
34802
|
const userPlugins = await getInstalledUserPlugins();
|
|
34196
34803
|
const projectPlugins = await getInstalledProjectPlugins(process.cwd());
|
|
34197
34804
|
const installedMap = new Map;
|
|
34805
|
+
const repoToMarketplace = new Map;
|
|
34806
|
+
for (const mp of marketplaces) {
|
|
34807
|
+
if (mp.source.type === "github") {
|
|
34808
|
+
const parts = mp.source.location.split("/");
|
|
34809
|
+
if (parts.length >= 2 && parts[1]) {
|
|
34810
|
+
repoToMarketplace.set(parts[1], mp.name);
|
|
34811
|
+
}
|
|
34812
|
+
}
|
|
34813
|
+
}
|
|
34814
|
+
const resolveMarketplaceName = (name) => {
|
|
34815
|
+
return repoToMarketplace.get(name) ?? name;
|
|
34816
|
+
};
|
|
34198
34817
|
for (const p of userPlugins) {
|
|
34199
|
-
|
|
34818
|
+
const mpName = resolveMarketplaceName(p.marketplace);
|
|
34819
|
+
installedMap.set(`${p.name}@${mpName}`, p);
|
|
34200
34820
|
}
|
|
34201
34821
|
for (const p of projectPlugins) {
|
|
34202
|
-
|
|
34822
|
+
const mpName = resolveMarketplaceName(p.marketplace);
|
|
34823
|
+
installedMap.set(`${p.name}@${mpName}`, p);
|
|
34203
34824
|
}
|
|
34204
34825
|
const versionMap = new Map;
|
|
34205
34826
|
for (const mp of toList) {
|
|
@@ -34299,11 +34920,11 @@ var pluginListCmd = import_cmd_ts3.command({
|
|
|
34299
34920
|
}
|
|
34300
34921
|
}
|
|
34301
34922
|
});
|
|
34302
|
-
var pluginValidateCmd =
|
|
34923
|
+
var pluginValidateCmd = import_cmd_ts4.command({
|
|
34303
34924
|
name: "validate",
|
|
34304
34925
|
description: buildDescription(pluginValidateMeta),
|
|
34305
34926
|
args: {
|
|
34306
|
-
path:
|
|
34927
|
+
path: import_cmd_ts4.positional({ type: import_cmd_ts4.string, displayName: "path" })
|
|
34307
34928
|
},
|
|
34308
34929
|
handler: async ({ path }) => {
|
|
34309
34930
|
if (isJsonMode()) {
|
|
@@ -34318,12 +34939,12 @@ var pluginValidateCmd = import_cmd_ts3.command({
|
|
|
34318
34939
|
console.log("(validation not yet implemented)");
|
|
34319
34940
|
}
|
|
34320
34941
|
});
|
|
34321
|
-
var pluginInstallCmd =
|
|
34942
|
+
var pluginInstallCmd = import_cmd_ts4.command({
|
|
34322
34943
|
name: "install",
|
|
34323
34944
|
description: buildDescription(pluginInstallMeta),
|
|
34324
34945
|
args: {
|
|
34325
|
-
plugin:
|
|
34326
|
-
scope:
|
|
34946
|
+
plugin: import_cmd_ts4.positional({ type: import_cmd_ts4.string, displayName: "plugin" }),
|
|
34947
|
+
scope: import_cmd_ts4.option({ type: import_cmd_ts4.optional(import_cmd_ts4.string), long: "scope", short: "s", description: 'Installation scope: "project" (default) or "user"' })
|
|
34327
34948
|
},
|
|
34328
34949
|
handler: async ({ plugin, scope }) => {
|
|
34329
34950
|
try {
|
|
@@ -34339,11 +34960,12 @@ var pluginInstallCmd = import_cmd_ts3.command({
|
|
|
34339
34960
|
}
|
|
34340
34961
|
if (isJsonMode()) {
|
|
34341
34962
|
const { ok, syncData } = isUser ? await runUserSyncAndPrint() : await runSyncAndPrint();
|
|
34963
|
+
const displayPlugin2 = result.normalizedPlugin ?? plugin;
|
|
34342
34964
|
jsonOutput({
|
|
34343
34965
|
success: ok,
|
|
34344
34966
|
command: "plugin install",
|
|
34345
34967
|
data: {
|
|
34346
|
-
plugin,
|
|
34968
|
+
plugin: displayPlugin2,
|
|
34347
34969
|
scope: isUser ? "user" : "project",
|
|
34348
34970
|
autoRegistered: result.autoRegistered ?? null,
|
|
34349
34971
|
syncResult: syncData
|
|
@@ -34355,10 +34977,11 @@ var pluginInstallCmd = import_cmd_ts3.command({
|
|
|
34355
34977
|
}
|
|
34356
34978
|
return;
|
|
34357
34979
|
}
|
|
34980
|
+
const displayPlugin = result.normalizedPlugin ?? plugin;
|
|
34358
34981
|
if (result.autoRegistered) {
|
|
34359
34982
|
console.log(`✓ Auto-registered marketplace: ${result.autoRegistered}`);
|
|
34360
34983
|
}
|
|
34361
|
-
console.log(`✓ Installed plugin (${isUser ? "user" : "project"} scope): ${
|
|
34984
|
+
console.log(`✓ Installed plugin (${isUser ? "user" : "project"} scope): ${displayPlugin}`);
|
|
34362
34985
|
const { ok: syncOk } = isUser ? await runUserSyncAndPrint() : await runSyncAndPrint();
|
|
34363
34986
|
if (!syncOk) {
|
|
34364
34987
|
process.exit(1);
|
|
@@ -34376,13 +34999,13 @@ var pluginInstallCmd = import_cmd_ts3.command({
|
|
|
34376
34999
|
}
|
|
34377
35000
|
}
|
|
34378
35001
|
});
|
|
34379
|
-
var pluginUninstallCmd =
|
|
35002
|
+
var pluginUninstallCmd = import_cmd_ts4.command({
|
|
34380
35003
|
name: "uninstall",
|
|
34381
35004
|
description: buildDescription(pluginUninstallMeta),
|
|
34382
35005
|
aliases: ["remove"],
|
|
34383
35006
|
args: {
|
|
34384
|
-
plugin:
|
|
34385
|
-
scope:
|
|
35007
|
+
plugin: import_cmd_ts4.positional({ type: import_cmd_ts4.string, displayName: "plugin" }),
|
|
35008
|
+
scope: import_cmd_ts4.option({ type: import_cmd_ts4.optional(import_cmd_ts4.string), long: "scope", short: "s", description: 'Installation scope: "project" (default) or "user"' })
|
|
34386
35009
|
},
|
|
34387
35010
|
handler: async ({ plugin, scope }) => {
|
|
34388
35011
|
try {
|
|
@@ -34512,13 +35135,14 @@ var pluginCmd = conciseSubcommands({
|
|
|
34512
35135
|
uninstall: pluginUninstallCmd,
|
|
34513
35136
|
marketplace: marketplaceCmd,
|
|
34514
35137
|
list: pluginListCmd,
|
|
34515
|
-
validate: pluginValidateCmd
|
|
35138
|
+
validate: pluginValidateCmd,
|
|
35139
|
+
skills: skillsCmd
|
|
34516
35140
|
}
|
|
34517
35141
|
});
|
|
34518
35142
|
|
|
34519
35143
|
// src/cli/commands/self.ts
|
|
34520
35144
|
init_execa();
|
|
34521
|
-
var
|
|
35145
|
+
var import_cmd_ts5 = __toESM(require_cjs(), 1);
|
|
34522
35146
|
|
|
34523
35147
|
// src/cli/metadata/self.ts
|
|
34524
35148
|
var updateMeta = {
|
|
@@ -34556,12 +35180,12 @@ function detectPackageManager() {
|
|
|
34556
35180
|
function getCurrentVersion() {
|
|
34557
35181
|
return package_default.version;
|
|
34558
35182
|
}
|
|
34559
|
-
var updateCmd =
|
|
35183
|
+
var updateCmd = import_cmd_ts5.command({
|
|
34560
35184
|
name: "update",
|
|
34561
35185
|
description: buildDescription(updateMeta),
|
|
34562
35186
|
args: {
|
|
34563
|
-
npm:
|
|
34564
|
-
bun:
|
|
35187
|
+
npm: import_cmd_ts5.flag({ long: "npm", description: "Force update using npm" }),
|
|
35188
|
+
bun: import_cmd_ts5.flag({ long: "bun", description: "Force update using bun" })
|
|
34565
35189
|
},
|
|
34566
35190
|
handler: async ({ npm, bun }) => {
|
|
34567
35191
|
try {
|
|
@@ -34762,5 +35386,5 @@ if (agentHelp) {
|
|
|
34762
35386
|
const { runWizard: runWizard2 } = await Promise.resolve().then(() => (init_wizard(), exports_wizard));
|
|
34763
35387
|
await runWizard2();
|
|
34764
35388
|
} else {
|
|
34765
|
-
|
|
35389
|
+
import_cmd_ts6.run(app, finalArgs);
|
|
34766
35390
|
}
|