allagents 1.0.1 → 1.0.3

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 +199 -22
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26146,6 +26146,7 @@ var init_marketplace_manifest_parser = __esm(() => {
26146
26146
  // src/core/user-workspace.ts
26147
26147
  var exports_user_workspace = {};
26148
26148
  __export(exports_user_workspace, {
26149
+ setUserPluginSkillsMode: () => setUserPluginSkillsMode,
26149
26150
  setUserClients: () => setUserClients,
26150
26151
  removeUserPluginsForMarketplace: () => removeUserPluginsForMarketplace,
26151
26152
  removeUserPlugin: () => removeUserPlugin,
@@ -26625,6 +26626,34 @@ async function removeUserEnabledSkill(skillKey) {
26625
26626
  };
26626
26627
  }
26627
26628
  }
26629
+ async function setUserPluginSkillsMode(pluginName, mode, skillNames) {
26630
+ await ensureUserWorkspace();
26631
+ const configPath = getUserWorkspaceConfigPath();
26632
+ try {
26633
+ const content = await readFile5(configPath, "utf-8");
26634
+ const config = load(content);
26635
+ const index = findPluginEntryByName(config, pluginName);
26636
+ if (index === -1) {
26637
+ return {
26638
+ success: false,
26639
+ error: `Plugin '${pluginName}' not found in user workspace config`
26640
+ };
26641
+ }
26642
+ const entry = ensureObjectPluginEntry(config, index);
26643
+ if (mode === "allowlist") {
26644
+ entry.skills = [...skillNames];
26645
+ } else {
26646
+ entry.skills = skillNames.length > 0 ? { exclude: [...skillNames] } : undefined;
26647
+ }
26648
+ await writeFile2(configPath, dump(config, { lineWidth: -1 }), "utf-8");
26649
+ return { success: true };
26650
+ } catch (error) {
26651
+ return {
26652
+ success: false,
26653
+ error: error instanceof Error ? error.message : String(error)
26654
+ };
26655
+ }
26656
+ }
26628
26657
  function pluginSourceToInfo(plugin, scope) {
26629
26658
  const parsed = parsePluginSpec(plugin);
26630
26659
  if (parsed) {
@@ -28010,6 +28039,39 @@ async function removeEnabledSkill(skillKey, workspacePath = process.cwd()) {
28010
28039
  };
28011
28040
  }
28012
28041
  }
28042
+ async function setPluginSkillsMode(pluginName, mode, skillNames, workspacePath = process.cwd()) {
28043
+ const configPath = join11(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
28044
+ if (!existsSync8(configPath)) {
28045
+ return {
28046
+ success: false,
28047
+ error: `${CONFIG_DIR}/${WORKSPACE_CONFIG_FILE} not found in ${workspacePath}`
28048
+ };
28049
+ }
28050
+ try {
28051
+ const content = await readFile7(configPath, "utf-8");
28052
+ const config = load(content);
28053
+ const index = findPluginEntryByName(config, pluginName);
28054
+ if (index === -1) {
28055
+ return {
28056
+ success: false,
28057
+ error: `Plugin '${pluginName}' not found in workspace config`
28058
+ };
28059
+ }
28060
+ const entry = ensureObjectPluginEntry(config, index);
28061
+ if (mode === "allowlist") {
28062
+ entry.skills = [...skillNames];
28063
+ } else {
28064
+ entry.skills = skillNames.length > 0 ? { exclude: [...skillNames] } : undefined;
28065
+ }
28066
+ await writeFile4(configPath, dump(config, { lineWidth: -1 }), "utf-8");
28067
+ return { success: true };
28068
+ } catch (error) {
28069
+ return {
28070
+ success: false,
28071
+ error: error instanceof Error ? error.message : String(error)
28072
+ };
28073
+ }
28074
+ }
28013
28075
  function pruneEnabledSkillsForPlugin(config, pluginEntry) {
28014
28076
  if (!config.enabledSkills?.length)
28015
28077
  return;
@@ -30790,7 +30852,15 @@ function formatDeletedArtifacts(artifacts) {
30790
30852
  list.push(artifact);
30791
30853
  }
30792
30854
  return Array.from(byClient.entries()).map(([displayClient, items]) => {
30793
- const names = items.map((a) => `${a.type} '${a.name}'`).join(", ");
30855
+ const seen = new Set;
30856
+ const unique = items.filter((a) => {
30857
+ const key = `${a.type}:${a.name}`;
30858
+ if (seen.has(key))
30859
+ return false;
30860
+ seen.add(key);
30861
+ return true;
30862
+ });
30863
+ const names = unique.map((a) => `${a.type} '${a.name}'`).join(", ");
30794
30864
  return ` Deleted (${displayClient}): ${names}`;
30795
30865
  });
30796
30866
  }
@@ -33341,7 +33411,7 @@ var package_default;
33341
33411
  var init_package = __esm(() => {
33342
33412
  package_default = {
33343
33413
  name: "allagents",
33344
- version: "1.0.1",
33414
+ version: "1.0.3",
33345
33415
  description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
33346
33416
  type: "module",
33347
33417
  bin: {
@@ -33959,14 +34029,28 @@ async function runPlugins(context, cache2) {
33959
34029
  kt2(message, "Error");
33960
34030
  }
33961
34031
  }
34032
+ async function getPluginSkillsMode(pluginSource, scope, workspacePath) {
34033
+ const effectivePath = scope === "user" ? getHomeDir() : workspacePath;
34034
+ const allSkills = await getAllSkillsFromPlugins(effectivePath);
34035
+ const pluginSkills = allSkills.filter((s) => s.pluginSource === pluginSource);
34036
+ const first2 = pluginSkills[0];
34037
+ if (first2 && first2.pluginSkillsMode === "allowlist") {
34038
+ return "allowlist";
34039
+ }
34040
+ return "blocklist";
34041
+ }
33962
34042
  async function runPluginDetail(pluginKey, context, cache2) {
33963
34043
  const scope = pluginKey.startsWith("project:") ? "project" : "user";
33964
34044
  const pluginSource = pluginKey.replace(/^(project|user):/, "");
33965
34045
  while (true) {
34046
+ const workspacePath = context.workspacePath ?? process.cwd();
34047
+ const currentMode = await getPluginSkillsMode(pluginSource, scope, workspacePath);
34048
+ const autoEnableLabel = currentMode === "allowlist" ? "Auto-enable new skills: OFF" : "Auto-enable new skills: ON";
33966
34049
  const action = await select({
33967
34050
  message: `Plugin: ${pluginSource} [${scope}]`,
33968
34051
  options: [
33969
34052
  { label: "Browse skills", value: "browse" },
34053
+ { label: autoEnableLabel, value: "toggle_auto_enable" },
33970
34054
  { label: "Update", value: "update" },
33971
34055
  { label: "Remove", value: "remove" },
33972
34056
  { label: "Back", value: "back" }
@@ -33979,6 +34063,50 @@ async function runPluginDetail(pluginKey, context, cache2) {
33979
34063
  await runBrowsePluginSkills(pluginSource, scope, context, cache2);
33980
34064
  continue;
33981
34065
  }
34066
+ if (action === "toggle_auto_enable") {
34067
+ const effectivePath = scope === "user" ? getHomeDir() : workspacePath;
34068
+ const allSkills = await getAllSkillsFromPlugins(effectivePath);
34069
+ const pluginSkills = allSkills.filter((s2) => s2.pluginSource === pluginSource);
34070
+ const firstSkill = pluginSkills[0];
34071
+ if (!firstSkill) {
34072
+ kt2("No skills found in this plugin.", "Skills");
34073
+ continue;
34074
+ }
34075
+ const pluginName = firstSkill.pluginName;
34076
+ const s = Ie();
34077
+ if (currentMode === "allowlist") {
34078
+ const disabledNames = pluginSkills.filter((sk) => sk.disabled).map((sk) => sk.name);
34079
+ s.start("Switching to auto-enable...");
34080
+ const result = scope === "user" ? await setUserPluginSkillsMode(pluginName, "blocklist", disabledNames) : await setPluginSkillsMode(pluginName, "blocklist", disabledNames, workspacePath);
34081
+ if (!result.success) {
34082
+ s.stop("Failed");
34083
+ kt2(result.error ?? "Unknown error", "Error");
34084
+ continue;
34085
+ }
34086
+ } else {
34087
+ const enabledNames = pluginSkills.filter((sk) => !sk.disabled).map((sk) => sk.name);
34088
+ s.start("Switching to manual approval...");
34089
+ const result = scope === "user" ? await setUserPluginSkillsMode(pluginName, "allowlist", enabledNames) : await setPluginSkillsMode(pluginName, "allowlist", enabledNames, workspacePath);
34090
+ if (!result.success) {
34091
+ s.stop("Failed");
34092
+ kt2(result.error ?? "Unknown error", "Error");
34093
+ continue;
34094
+ }
34095
+ }
34096
+ s.stop("Mode updated");
34097
+ const syncS = Ie();
34098
+ syncS.start("Syncing...");
34099
+ if (scope === "project" && context.workspacePath) {
34100
+ await syncWorkspace(context.workspacePath);
34101
+ } else {
34102
+ await syncUserWorkspace();
34103
+ }
34104
+ syncS.stop("Sync complete");
34105
+ cache2?.invalidate();
34106
+ const newMode = currentMode === "allowlist" ? "ON" : "OFF";
34107
+ kt2(`Auto-enable new skills: ${newMode}`, "Updated");
34108
+ continue;
34109
+ }
33982
34110
  if (action === "update") {
33983
34111
  await runUpdatePlugin(pluginSource, scope, context, cache2);
33984
34112
  continue;
@@ -34057,18 +34185,34 @@ async function runBrowsePluginSkills(pluginSource, scope, context, cache2) {
34057
34185
  s.start("Updating skills...");
34058
34186
  for (const skill of toDisable) {
34059
34187
  const skillKey = `${skill.pluginName}:${skill.name}`;
34060
- if (scope === "user") {
34061
- await addUserDisabledSkill(skillKey);
34062
- } else if (context.workspacePath) {
34063
- await addDisabledSkill(skillKey, context.workspacePath);
34188
+ if (skill.pluginSkillsMode === "allowlist") {
34189
+ if (scope === "user") {
34190
+ await removeUserEnabledSkill(skillKey);
34191
+ } else if (context.workspacePath) {
34192
+ await removeEnabledSkill(skillKey, context.workspacePath);
34193
+ }
34194
+ } else {
34195
+ if (scope === "user") {
34196
+ await addUserDisabledSkill(skillKey);
34197
+ } else if (context.workspacePath) {
34198
+ await addDisabledSkill(skillKey, context.workspacePath);
34199
+ }
34064
34200
  }
34065
34201
  }
34066
34202
  for (const skill of toEnable) {
34067
34203
  const skillKey = `${skill.pluginName}:${skill.name}`;
34068
- if (scope === "user") {
34069
- await removeUserDisabledSkill(skillKey);
34070
- } else if (context.workspacePath) {
34071
- await removeDisabledSkill(skillKey, context.workspacePath);
34204
+ if (skill.pluginSkillsMode === "allowlist") {
34205
+ if (scope === "user") {
34206
+ await addUserEnabledSkill(skillKey);
34207
+ } else if (context.workspacePath) {
34208
+ await addEnabledSkill(skillKey, context.workspacePath);
34209
+ }
34210
+ } else {
34211
+ if (scope === "user") {
34212
+ await removeUserDisabledSkill(skillKey);
34213
+ } else if (context.workspacePath) {
34214
+ await removeDisabledSkill(skillKey, context.workspacePath);
34215
+ }
34072
34216
  }
34073
34217
  }
34074
34218
  s.stop("Skills updated");
@@ -34584,22 +34728,42 @@ async function runToggleSkills(skills, context, cache2) {
34584
34728
  let changedProject = false;
34585
34729
  let changedUser = false;
34586
34730
  for (const skill of toDisable) {
34587
- if (skill.scope === "user") {
34588
- await addUserDisabledSkill(skill.skillKey);
34731
+ if (skill.pluginSkillsMode === "allowlist") {
34732
+ if (skill.scope === "user") {
34733
+ await removeUserEnabledSkill(skill.skillKey);
34734
+ } else if (context.workspacePath) {
34735
+ await removeEnabledSkill(skill.skillKey, context.workspacePath);
34736
+ }
34737
+ } else {
34738
+ if (skill.scope === "user") {
34739
+ await addUserDisabledSkill(skill.skillKey);
34740
+ } else if (context.workspacePath) {
34741
+ await addDisabledSkill(skill.skillKey, context.workspacePath);
34742
+ }
34743
+ }
34744
+ if (skill.scope === "user")
34589
34745
  changedUser = true;
34590
- } else if (context.workspacePath) {
34591
- await addDisabledSkill(skill.skillKey, context.workspacePath);
34746
+ else
34592
34747
  changedProject = true;
34593
- }
34594
34748
  }
34595
34749
  for (const skill of toEnable) {
34596
- if (skill.scope === "user") {
34597
- await removeUserDisabledSkill(skill.skillKey);
34750
+ if (skill.pluginSkillsMode === "allowlist") {
34751
+ if (skill.scope === "user") {
34752
+ await addUserEnabledSkill(skill.skillKey);
34753
+ } else if (context.workspacePath) {
34754
+ await addEnabledSkill(skill.skillKey, context.workspacePath);
34755
+ }
34756
+ } else {
34757
+ if (skill.scope === "user") {
34758
+ await removeUserDisabledSkill(skill.skillKey);
34759
+ } else if (context.workspacePath) {
34760
+ await removeDisabledSkill(skill.skillKey, context.workspacePath);
34761
+ }
34762
+ }
34763
+ if (skill.scope === "user")
34598
34764
  changedUser = true;
34599
- } else if (context.workspacePath) {
34600
- await removeDisabledSkill(skill.skillKey, context.workspacePath);
34765
+ else
34601
34766
  changedProject = true;
34602
- }
34603
34767
  }
34604
34768
  s.stop("Skills updated");
34605
34769
  const syncS = Ie();
@@ -34659,13 +34823,26 @@ Use "Manage marketplaces" to add one first.`, "Skills");
34659
34823
  }
34660
34824
  options2.push({ label: "Back", value: "__back__" });
34661
34825
  const selected = await select4({
34662
- message: "Select a plugin to install",
34826
+ message: "Select a plugin",
34663
34827
  options: options2
34664
34828
  });
34665
34829
  if (Ct(selected) || selected === "__back__") {
34666
34830
  return;
34667
34831
  }
34668
- await installSelectedPlugin(selected, context, cache2);
34832
+ const workspacePath = context.workspacePath ?? process.cwd();
34833
+ const isInstalledProject = context.workspacePath ? await hasPlugin(selected, workspacePath) : false;
34834
+ const isInstalledUser = await hasUserPlugin(selected);
34835
+ if (isInstalledProject || isInstalledUser) {
34836
+ const scope = isInstalledUser ? "user" : "project";
34837
+ await runBrowsePluginSkills(selected, scope, context, cache2);
34838
+ return;
34839
+ }
34840
+ const installed = await installSelectedPlugin(selected, context, cache2);
34841
+ if (installed) {
34842
+ const nowInstalledUser = await hasUserPlugin(selected);
34843
+ const scope = nowInstalledUser ? "user" : "project";
34844
+ await runBrowsePluginSkills(selected, scope, context, cache2);
34845
+ }
34669
34846
  }
34670
34847
  var multiselect2, select4;
34671
34848
  var init_skills2 = __esm(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
5
5
  "type": "module",
6
6
  "bin": {