allagents 0.20.3 → 0.21.0

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 +191 -65
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28289,6 +28289,72 @@ var init_status2 = __esm(() => {
28289
28289
  init_user_workspace();
28290
28290
  });
28291
28291
 
28292
+ // src/core/skills.ts
28293
+ import { existsSync as existsSync17 } from "node:fs";
28294
+ import { readFile as readFile13, readdir as readdir4 } from "node:fs/promises";
28295
+ import { join as join19, resolve as resolve12 } from "node:path";
28296
+ async function resolvePluginPath(pluginSource, workspacePath) {
28297
+ if (isPluginSpec(pluginSource)) {
28298
+ const resolved2 = await resolvePluginSpecWithAutoRegister(pluginSource);
28299
+ return resolved2.success ? resolved2.path ?? null : null;
28300
+ }
28301
+ if (isGitHubUrl(pluginSource)) {
28302
+ const parsed = parseGitHubUrl(pluginSource);
28303
+ const result = await fetchPlugin(pluginSource, {
28304
+ offline: true,
28305
+ ...parsed?.branch && { branch: parsed.branch }
28306
+ });
28307
+ if (!result.success)
28308
+ return null;
28309
+ return parsed?.subpath ? join19(result.cachePath, parsed.subpath) : result.cachePath;
28310
+ }
28311
+ const resolved = resolve12(workspacePath, pluginSource);
28312
+ return existsSync17(resolved) ? resolved : null;
28313
+ }
28314
+ async function getAllSkillsFromPlugins(workspacePath = process.cwd()) {
28315
+ const configPath = join19(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
28316
+ if (!existsSync17(configPath)) {
28317
+ return [];
28318
+ }
28319
+ const content = await readFile13(configPath, "utf-8");
28320
+ const config = load(content);
28321
+ const disabledSkills = new Set(config.disabledSkills ?? []);
28322
+ const skills = [];
28323
+ for (const pluginSource of config.plugins) {
28324
+ const pluginPath = await resolvePluginPath(pluginSource, workspacePath);
28325
+ if (!pluginPath)
28326
+ continue;
28327
+ const pluginName = await getPluginName(pluginPath);
28328
+ const skillsDir = join19(pluginPath, "skills");
28329
+ if (!existsSync17(skillsDir))
28330
+ continue;
28331
+ const entries = await readdir4(skillsDir, { withFileTypes: true });
28332
+ const skillDirs = entries.filter((e) => e.isDirectory());
28333
+ for (const entry of skillDirs) {
28334
+ const skillKey = `${pluginName}:${entry.name}`;
28335
+ skills.push({
28336
+ name: entry.name,
28337
+ pluginName,
28338
+ pluginSource,
28339
+ path: join19(skillsDir, entry.name),
28340
+ disabled: disabledSkills.has(skillKey)
28341
+ });
28342
+ }
28343
+ }
28344
+ return skills;
28345
+ }
28346
+ async function findSkillByName(skillName, workspacePath = process.cwd()) {
28347
+ const allSkills = await getAllSkillsFromPlugins(workspacePath);
28348
+ return allSkills.filter((s) => s.name === skillName);
28349
+ }
28350
+ var init_skills = __esm(() => {
28351
+ init_js_yaml();
28352
+ init_constants();
28353
+ init_plugin();
28354
+ init_plugin_path();
28355
+ init_marketplace();
28356
+ });
28357
+
28292
28358
  // node_modules/isexe/windows.js
28293
28359
  var require_windows = __commonJS((exports, module) => {
28294
28360
  module.exports = isexe;
@@ -30306,7 +30372,7 @@ var package_default;
30306
30372
  var init_package = __esm(() => {
30307
30373
  package_default = {
30308
30374
  name: "allagents",
30309
- version: "0.20.3",
30375
+ version: "0.21.0",
30310
30376
  description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
30311
30377
  type: "module",
30312
30378
  bin: {
@@ -32861,6 +32927,123 @@ var init_clients = __esm(() => {
32861
32927
  ({ multiselect: multiselect3 } = exports_dist);
32862
32928
  });
32863
32929
 
32930
+ // src/cli/tui/actions/skills.ts
32931
+ async function loadAllSkills(context) {
32932
+ const skills = [];
32933
+ const userSkills = await getAllSkillsFromPlugins(getHomeDir());
32934
+ const userKeys = new Set;
32935
+ for (const s of userSkills) {
32936
+ const skillKey = `${s.pluginName}:${s.name}`;
32937
+ userKeys.add(skillKey);
32938
+ skills.push({
32939
+ ...s,
32940
+ scope: "user",
32941
+ key: `user:${skillKey}`,
32942
+ skillKey
32943
+ });
32944
+ }
32945
+ if (context.workspacePath && !isUserConfigPath(context.workspacePath)) {
32946
+ const projectSkills = await getAllSkillsFromPlugins(context.workspacePath);
32947
+ for (const s of projectSkills) {
32948
+ const skillKey = `${s.pluginName}:${s.name}`;
32949
+ if (userKeys.has(skillKey))
32950
+ continue;
32951
+ skills.push({
32952
+ ...s,
32953
+ scope: "project",
32954
+ key: `project:${skillKey}`,
32955
+ skillKey
32956
+ });
32957
+ }
32958
+ }
32959
+ return skills;
32960
+ }
32961
+ async function runManageSkills(context, cache2) {
32962
+ try {
32963
+ const skills = await loadAllSkills(context);
32964
+ if (skills.length === 0) {
32965
+ kt2("No skills found. Install a plugin with skills first.", "Skills");
32966
+ return;
32967
+ }
32968
+ const options2 = skills.map((s2) => ({
32969
+ label: `${s2.name} (${s2.pluginName}) [${s2.scope}]`,
32970
+ value: s2.key
32971
+ }));
32972
+ const initialValues = skills.filter((s2) => !s2.disabled).map((s2) => s2.key);
32973
+ const selected = await multiselect4({
32974
+ message: "Toggle skills (selected = enabled)",
32975
+ options: options2,
32976
+ initialValues,
32977
+ required: false
32978
+ });
32979
+ if (Ct(selected)) {
32980
+ return;
32981
+ }
32982
+ const selectedSet = new Set(selected);
32983
+ const toDisable = skills.filter((s2) => !s2.disabled && !selectedSet.has(s2.key));
32984
+ const toEnable = skills.filter((s2) => s2.disabled && selectedSet.has(s2.key));
32985
+ if (toDisable.length === 0 && toEnable.length === 0) {
32986
+ kt2("No changes made.", "Skills");
32987
+ return;
32988
+ }
32989
+ const s = Ie();
32990
+ s.start("Updating skills...");
32991
+ let changedProject = false;
32992
+ let changedUser = false;
32993
+ for (const skill of toDisable) {
32994
+ if (skill.scope === "user") {
32995
+ await addUserDisabledSkill(skill.skillKey);
32996
+ changedUser = true;
32997
+ } else if (context.workspacePath) {
32998
+ await addDisabledSkill(skill.skillKey, context.workspacePath);
32999
+ changedProject = true;
33000
+ }
33001
+ }
33002
+ for (const skill of toEnable) {
33003
+ if (skill.scope === "user") {
33004
+ await removeUserDisabledSkill(skill.skillKey);
33005
+ changedUser = true;
33006
+ } else if (context.workspacePath) {
33007
+ await removeDisabledSkill(skill.skillKey, context.workspacePath);
33008
+ changedProject = true;
33009
+ }
33010
+ }
33011
+ s.stop("Skills updated");
33012
+ const syncS = Ie();
33013
+ syncS.start("Syncing...");
33014
+ if (changedProject && context.workspacePath) {
33015
+ await syncWorkspace(context.workspacePath);
33016
+ }
33017
+ if (changedUser) {
33018
+ await syncUserWorkspace();
33019
+ }
33020
+ syncS.stop("Sync complete");
33021
+ cache2?.invalidate();
33022
+ const changes = [];
33023
+ for (const skill of toEnable) {
33024
+ changes.push(`✓ Enabled: ${skill.name} (${skill.pluginName}) [${skill.scope}]`);
33025
+ }
33026
+ for (const skill of toDisable) {
33027
+ changes.push(`✗ Disabled: ${skill.name} (${skill.pluginName}) [${skill.scope}]`);
33028
+ }
33029
+ kt2(changes.join(`
33030
+ `), "Updated");
33031
+ } catch (error) {
33032
+ const message = error instanceof Error ? error.message : String(error);
33033
+ kt2(message, "Error");
33034
+ }
33035
+ }
33036
+ var multiselect4;
33037
+ var init_skills2 = __esm(() => {
33038
+ init_dist2();
33039
+ init_skills();
33040
+ init_workspace_modify();
33041
+ init_user_workspace();
33042
+ init_sync();
33043
+ init_constants();
33044
+ ({ multiselect: multiselect4 } = exports_dist);
33045
+ });
33046
+
32864
33047
  // src/cli/tui/actions/update.ts
32865
33048
  async function runUpdate() {
32866
33049
  try {
@@ -32916,12 +33099,14 @@ function buildMenuOptions(context) {
32916
33099
  options2.push({ label: "Install plugin", value: "install" });
32917
33100
  options2.push({ label: "Manage plugins", value: "manage" });
32918
33101
  options2.push({ label: "Manage clients", value: "manage-clients" });
33102
+ options2.push({ label: "Manage skills", value: "manage-skills" });
32919
33103
  options2.push({ label: "Manage marketplaces", value: "marketplace" });
32920
33104
  } else {
32921
33105
  options2.push({ label: "View status", value: "status" });
32922
33106
  options2.push({ label: "Install plugin", value: "install" });
32923
33107
  options2.push({ label: "Manage plugins", value: "manage" });
32924
33108
  options2.push({ label: "Manage clients", value: "manage-clients" });
33109
+ options2.push({ label: "Manage skills", value: "manage-skills" });
32925
33110
  options2.push({ label: "Manage marketplaces", value: "marketplace" });
32926
33111
  options2.push({ label: "Check for updates", value: "update" });
32927
33112
  }
@@ -32986,6 +33171,9 @@ async function runWizard() {
32986
33171
  case "manage-clients":
32987
33172
  await runManageClients(context, cache2);
32988
33173
  break;
33174
+ case "manage-skills":
33175
+ await runManageSkills(context, cache2);
33176
+ break;
32989
33177
  case "marketplace":
32990
33178
  await runBrowseMarketplaces(context, cache2);
32991
33179
  break;
@@ -33012,6 +33200,7 @@ var init_wizard = __esm(() => {
33012
33200
  init_status3();
33013
33201
  init_plugins();
33014
33202
  init_clients();
33203
+ init_skills2();
33015
33204
  init_update();
33016
33205
  init_update_check();
33017
33206
  ({ select: select2 } = exports_dist);
@@ -33964,74 +34153,11 @@ init_source();
33964
34153
  init_sync();
33965
34154
  init_workspace_modify();
33966
34155
  init_user_workspace();
34156
+ init_skills();
33967
34157
  var import_cmd_ts3 = __toESM(require_cjs(), 1);
33968
34158
  import { existsSync as existsSync18 } from "node:fs";
33969
34159
  import { join as join20 } from "node:path";
33970
34160
 
33971
- // src/core/skills.ts
33972
- init_js_yaml();
33973
- init_constants();
33974
- init_plugin();
33975
- init_plugin_path();
33976
- init_marketplace();
33977
- import { existsSync as existsSync17 } from "node:fs";
33978
- import { readFile as readFile13, readdir as readdir4 } from "node:fs/promises";
33979
- import { join as join19, resolve as resolve12 } from "node:path";
33980
- async function resolvePluginPath(pluginSource, workspacePath) {
33981
- if (isPluginSpec(pluginSource)) {
33982
- const resolved2 = await resolvePluginSpecWithAutoRegister(pluginSource);
33983
- return resolved2.success ? resolved2.path ?? null : null;
33984
- }
33985
- if (isGitHubUrl(pluginSource)) {
33986
- const parsed = parseGitHubUrl(pluginSource);
33987
- const result = await fetchPlugin(pluginSource, {
33988
- offline: true,
33989
- ...parsed?.branch && { branch: parsed.branch }
33990
- });
33991
- if (!result.success)
33992
- return null;
33993
- return parsed?.subpath ? join19(result.cachePath, parsed.subpath) : result.cachePath;
33994
- }
33995
- const resolved = resolve12(workspacePath, pluginSource);
33996
- return existsSync17(resolved) ? resolved : null;
33997
- }
33998
- async function getAllSkillsFromPlugins(workspacePath = process.cwd()) {
33999
- const configPath = join19(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
34000
- if (!existsSync17(configPath)) {
34001
- return [];
34002
- }
34003
- const content = await readFile13(configPath, "utf-8");
34004
- const config = load(content);
34005
- const disabledSkills = new Set(config.disabledSkills ?? []);
34006
- const skills = [];
34007
- for (const pluginSource of config.plugins) {
34008
- const pluginPath = await resolvePluginPath(pluginSource, workspacePath);
34009
- if (!pluginPath)
34010
- continue;
34011
- const pluginName = await getPluginName(pluginPath);
34012
- const skillsDir = join19(pluginPath, "skills");
34013
- if (!existsSync17(skillsDir))
34014
- continue;
34015
- const entries = await readdir4(skillsDir, { withFileTypes: true });
34016
- const skillDirs = entries.filter((e) => e.isDirectory());
34017
- for (const entry of skillDirs) {
34018
- const skillKey = `${pluginName}:${entry.name}`;
34019
- skills.push({
34020
- name: entry.name,
34021
- pluginName,
34022
- pluginSource,
34023
- path: join19(skillsDir, entry.name),
34024
- disabled: disabledSkills.has(skillKey)
34025
- });
34026
- }
34027
- }
34028
- return skills;
34029
- }
34030
- async function findSkillByName(skillName, workspacePath = process.cwd()) {
34031
- const allSkills = await getAllSkillsFromPlugins(workspacePath);
34032
- return allSkills.filter((s) => s.name === skillName);
34033
- }
34034
-
34035
34161
  // src/cli/metadata/plugin-skills.ts
34036
34162
  var skillsListMeta = {
34037
34163
  command: "plugin skills list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "0.20.3",
3
+ "version": "0.21.0",
4
4
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
5
5
  "type": "module",
6
6
  "bin": {