allagents 1.4.11 → 1.5.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 (3) hide show
  1. package/README.md +4 -4
  2. package/dist/index.js +228 -207
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -33,7 +33,7 @@ CLI tool for managing multi-repo AI agent workspaces with plugin synchronization
33
33
 
34
34
  ┌─────────────────┐
35
35
  │ AllAgents │ (sync & transform)
36
- workspace sync
36
+ sync
37
37
  └────────┬────────┘
38
38
 
39
39
  ┌────┴────┬────────┬─────────┐
@@ -69,7 +69,7 @@ allagents plugin install code-review@claude-plugins-official
69
69
  allagents plugin install my-plugin@someuser/their-repo
70
70
 
71
71
  # Sync plugins to workspace
72
- allagents workspace sync
72
+ allagents update
73
73
  ```
74
74
 
75
75
  ### Initialize from Remote Template
@@ -99,7 +99,7 @@ allagents workspace init <path>
99
99
  allagents workspace init <path> --from <source> # From local path or GitHub URL
100
100
 
101
101
  # Sync all plugins to workspace (non-destructive)
102
- allagents workspace sync [options]
102
+ allagents update [options]
103
103
  --force Force re-fetch of remote plugins even if cached
104
104
  --dry-run Preview changes without applying
105
105
 
@@ -124,7 +124,7 @@ allagents workspace repo list
124
124
 
125
125
  ### VSCode Workspace Generation
126
126
 
127
- When `vscode` is included in the `clients` list, `workspace sync` automatically generates a `.code-workspace` file. Repository paths are resolved to absolute paths. Plugin folders are included with prompt/instruction file location settings for Copilot.
127
+ When `vscode` is included in the `clients` list, `allagents update` automatically generates a `.code-workspace` file. Repository paths are resolved to absolute paths. Plugin folders are included with prompt/instruction file location settings for Copilot.
128
128
 
129
129
  ```yaml
130
130
  # workspace.yaml
package/dist/index.js CHANGED
@@ -27013,7 +27013,7 @@ function parseMarketplaceSource(source) {
27013
27013
  name
27014
27014
  };
27015
27015
  }
27016
- async function addMarketplace(source, customName, branch, force, scopeOptions) {
27016
+ async function addMarketplace(source, customName, branch, _force, scopeOptions) {
27017
27017
  const parsed = parseMarketplaceSource(source);
27018
27018
  if (!parsed) {
27019
27019
  return {
@@ -27050,9 +27050,7 @@ async function addMarketplace(source, customName, branch, force, scopeOptions) {
27050
27050
  return parsed.location;
27051
27051
  })();
27052
27052
  const existingBySource = findBySourceLocation(registry, sourceLocation);
27053
- if (existingBySource && !force) {
27054
- return { success: true, marketplace: existingBySource, alreadyRegistered: true };
27055
- }
27053
+ let alreadyRegistered = !!existingBySource;
27056
27054
  let marketplacePath;
27057
27055
  if (parsed.type === "github" || parsed.type === "git") {
27058
27056
  marketplacePath = join10(getMarketplacesDir(), name);
@@ -27104,24 +27102,15 @@ async function addMarketplace(source, customName, branch, force, scopeOptions) {
27104
27102
  if (manifestResult.success && manifestResult.data.name) {
27105
27103
  const manifestName = manifestResult.data.name;
27106
27104
  if (manifestName !== name) {
27107
- const existing = registry.marketplaces[manifestName];
27108
- if (existing && !force) {
27109
- return {
27110
- success: true,
27111
- marketplace: existing,
27112
- alreadyRegistered: true
27113
- };
27105
+ if (registry.marketplaces[manifestName]) {
27106
+ alreadyRegistered = true;
27114
27107
  }
27115
27108
  name = manifestName;
27116
27109
  }
27117
27110
  }
27118
27111
  }
27119
- const wasAlreadyRegistered = !!registry.marketplaces[name];
27120
- if (wasAlreadyRegistered && !force) {
27121
- return {
27122
- success: false,
27123
- error: `Marketplace '${name}' already exists. Use 'update' to refresh it.`
27124
- };
27112
+ if (registry.marketplaces[name]) {
27113
+ alreadyRegistered = true;
27125
27114
  }
27126
27115
  let entryLocation;
27127
27116
  if (parsed.type === "github") {
@@ -27144,7 +27133,7 @@ async function addMarketplace(source, customName, branch, force, scopeOptions) {
27144
27133
  return {
27145
27134
  success: true,
27146
27135
  marketplace: entry,
27147
- ...wasAlreadyRegistered && force && { replaced: true }
27136
+ ...alreadyRegistered && { replaced: true }
27148
27137
  };
27149
27138
  }
27150
27139
  async function removeMarketplace(name, options2 = {}) {
@@ -27584,7 +27573,7 @@ async function autoRegisterMarketplace(source) {
27584
27573
  return { success: false, error: result.error || "Unknown error" };
27585
27574
  }
27586
27575
  const name = result.marketplace?.name ?? parts[1];
27587
- if (!result.alreadyRegistered) {
27576
+ if (!result.replaced) {
27588
27577
  console.log(`Auto-registered GitHub marketplace: ${source}`);
27589
27578
  }
27590
27579
  registeredSourceCache.set(source, name);
@@ -28651,20 +28640,48 @@ var init_sync_state = __esm(() => {
28651
28640
  });
28652
28641
  });
28653
28642
 
28654
- // src/core/sync-state.ts
28655
- import { readFile as readFile9, writeFile as writeFile6, mkdir as mkdir7 } from "node:fs/promises";
28643
+ // src/core/config-gitignore.ts
28644
+ import { writeFile as writeFile6, readFile as readFile9 } from "node:fs/promises";
28656
28645
  import { existsSync as existsSync10 } from "node:fs";
28657
- import { join as join13, dirname as dirname6 } from "node:path";
28646
+ import { join as join13 } from "node:path";
28647
+ async function ensureConfigGitignore(workspacePath) {
28648
+ const gitignorePath = join13(workspacePath, CONFIG_DIR, ".gitignore");
28649
+ let existing = "";
28650
+ if (existsSync10(gitignorePath)) {
28651
+ existing = await readFile9(gitignorePath, "utf-8");
28652
+ }
28653
+ const missing = GITIGNORE_ENTRIES.filter((entry) => !existing.split(`
28654
+ `).includes(entry));
28655
+ if (missing.length === 0)
28656
+ return;
28657
+ const content = existing ? `${existing.trimEnd()}
28658
+ ${missing.join(`
28659
+ `)}
28660
+ ` : `${missing.join(`
28661
+ `)}
28662
+ `;
28663
+ await writeFile6(gitignorePath, content, "utf-8");
28664
+ }
28665
+ var GITIGNORE_ENTRIES;
28666
+ var init_config_gitignore = __esm(() => {
28667
+ init_constants();
28668
+ GITIGNORE_ENTRIES = [SYNC_STATE_FILE];
28669
+ });
28670
+
28671
+ // src/core/sync-state.ts
28672
+ import { readFile as readFile10, writeFile as writeFile7, mkdir as mkdir7 } from "node:fs/promises";
28673
+ import { existsSync as existsSync11 } from "node:fs";
28674
+ import { join as join14, dirname as dirname6 } from "node:path";
28658
28675
  function getSyncStatePath(workspacePath) {
28659
- return join13(workspacePath, CONFIG_DIR, SYNC_STATE_FILE);
28676
+ return join14(workspacePath, CONFIG_DIR, SYNC_STATE_FILE);
28660
28677
  }
28661
28678
  async function loadSyncState(workspacePath) {
28662
28679
  const statePath = getSyncStatePath(workspacePath);
28663
- if (!existsSync10(statePath)) {
28680
+ if (!existsSync11(statePath)) {
28664
28681
  return null;
28665
28682
  }
28666
28683
  try {
28667
- const content = await readFile9(statePath, "utf-8");
28684
+ const content = await readFile10(statePath, "utf-8");
28668
28685
  const parsed = JSON.parse(content);
28669
28686
  const result = SyncStateSchema.safeParse(parsed);
28670
28687
  if (!result.success) {
@@ -28688,7 +28705,8 @@ async function saveSyncState(workspacePath, data) {
28688
28705
  ...normalizedData.vscodeWorkspaceRepos && { vscodeWorkspaceRepos: normalizedData.vscodeWorkspaceRepos }
28689
28706
  };
28690
28707
  await mkdir7(dirname6(statePath), { recursive: true });
28691
- await writeFile6(statePath, JSON.stringify(state, null, 2), "utf-8");
28708
+ await ensureConfigGitignore(workspacePath);
28709
+ await writeFile7(statePath, JSON.stringify(state, null, 2), "utf-8");
28692
28710
  }
28693
28711
  function getPreviouslySyncedFiles(state, client) {
28694
28712
  if (!state) {
@@ -28710,6 +28728,7 @@ function getPreviouslySyncedNativePlugins(state, client) {
28710
28728
  var init_sync_state2 = __esm(() => {
28711
28729
  init_constants();
28712
28730
  init_sync_state();
28731
+ init_config_gitignore();
28713
28732
  });
28714
28733
 
28715
28734
  // src/core/vscode-workspace.ts
@@ -28834,10 +28853,9 @@ function reconcileVscodeWorkspaceFolders(workspacePath, codeWorkspaceFolders, la
28834
28853
  } else {
28835
28854
  const folderName = codeWorkspaceNames.get(absPath);
28836
28855
  if (folderName !== repo.name) {
28837
- const updatedRepo = { ...repo };
28838
- if (folderName === undefined) {
28839
- delete updatedRepo.name;
28840
- } else {
28856
+ const { name: _name, ...repoWithoutName } = repo;
28857
+ const updatedRepo = folderName === undefined ? { ...repoWithoutName } : { ...repo };
28858
+ if (folderName !== undefined) {
28841
28859
  updatedRepo.name = folderName;
28842
28860
  }
28843
28861
  updatedRepos.push(updatedRepo);
@@ -28870,8 +28888,8 @@ var init_vscode_workspace = __esm(() => {
28870
28888
  });
28871
28889
 
28872
28890
  // src/core/vscode-mcp.ts
28873
- import { existsSync as existsSync11, readFileSync, writeFileSync, mkdirSync } from "node:fs";
28874
- import { join as join14, dirname as dirname7 } from "node:path";
28891
+ import { existsSync as existsSync12, readFileSync, writeFileSync, mkdirSync } from "node:fs";
28892
+ import { join as join15, dirname as dirname7 } from "node:path";
28875
28893
  function deepEqual(a, b) {
28876
28894
  if (a === b)
28877
28895
  return true;
@@ -28903,17 +28921,17 @@ function getVscodeMcpConfigPath() {
28903
28921
  if (!appData) {
28904
28922
  throw new Error("APPDATA environment variable not set");
28905
28923
  }
28906
- return join14(appData, "Code", "User", "mcp.json");
28924
+ return join15(appData, "Code", "User", "mcp.json");
28907
28925
  }
28908
28926
  const home = getHomeDir();
28909
28927
  if (platform2 === "darwin") {
28910
- return join14(home, "Library", "Application Support", "Code", "User", "mcp.json");
28928
+ return join15(home, "Library", "Application Support", "Code", "User", "mcp.json");
28911
28929
  }
28912
- return join14(home, ".config", "Code", "User", "mcp.json");
28930
+ return join15(home, ".config", "Code", "User", "mcp.json");
28913
28931
  }
28914
28932
  function readPluginMcpConfig(pluginPath) {
28915
- const mcpPath = join14(pluginPath, ".mcp.json");
28916
- if (!existsSync11(mcpPath)) {
28933
+ const mcpPath = join15(pluginPath, ".mcp.json");
28934
+ if (!existsSync12(mcpPath)) {
28917
28935
  return null;
28918
28936
  }
28919
28937
  try {
@@ -28964,7 +28982,7 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
28964
28982
  trackedServers: []
28965
28983
  };
28966
28984
  let existingConfig = {};
28967
- if (existsSync11(configPath)) {
28985
+ if (existsSync12(configPath)) {
28968
28986
  try {
28969
28987
  const content = readFileSync(configPath, "utf-8");
28970
28988
  existingConfig = import_json5.default.parse(content);
@@ -29015,7 +29033,7 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
29015
29033
  if (hasChanges && !dryRun) {
29016
29034
  existingConfig.servers = existingServers;
29017
29035
  const dir = dirname7(configPath);
29018
- if (!existsSync11(dir)) {
29036
+ if (!existsSync12(dir)) {
29019
29037
  mkdirSync(dir, { recursive: true });
29020
29038
  }
29021
29039
  writeFileSync(configPath, `${JSON.stringify(existingConfig, null, 2)}
@@ -29033,7 +29051,7 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
29033
29051
  if (result.removed > 0 && !dryRun) {
29034
29052
  existingConfig.servers = existingServers;
29035
29053
  const dir = dirname7(configPath);
29036
- if (!existsSync11(dir)) {
29054
+ if (!existsSync12(dir)) {
29037
29055
  mkdirSync(dir, { recursive: true });
29038
29056
  }
29039
29057
  writeFileSync(configPath, `${JSON.stringify(existingConfig, null, 2)}
@@ -29102,7 +29120,7 @@ function mergeNativeSyncResults(results) {
29102
29120
  var init_types2 = () => {};
29103
29121
 
29104
29122
  // src/core/codex-mcp.ts
29105
- import { existsSync as existsSync12, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
29123
+ import { existsSync as existsSync13, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
29106
29124
  import { dirname as dirname8 } from "node:path";
29107
29125
  function buildCodexMcpAddArgs(name, config) {
29108
29126
  if (typeof config.url === "string") {
@@ -29313,7 +29331,7 @@ function syncCodexProjectMcpConfig(validatedPlugins, options2) {
29313
29331
  trackedServers: []
29314
29332
  };
29315
29333
  let existingContent = "";
29316
- if (existsSync12(configPath)) {
29334
+ if (existsSync13(configPath)) {
29317
29335
  try {
29318
29336
  existingContent = readFileSync2(configPath, "utf-8");
29319
29337
  } catch {
@@ -29369,7 +29387,7 @@ function syncCodexProjectMcpConfig(validatedPlugins, options2) {
29369
29387
  `)}
29370
29388
  `;
29371
29389
  const dir = dirname8(configPath);
29372
- if (!existsSync12(dir)) {
29390
+ if (!existsSync13(dir)) {
29373
29391
  mkdirSync2(dir, { recursive: true });
29374
29392
  }
29375
29393
  writeFileSync2(configPath, output, "utf-8");
@@ -29383,7 +29401,7 @@ var init_codex_mcp = __esm(() => {
29383
29401
  });
29384
29402
 
29385
29403
  // src/core/claude-mcp.ts
29386
- import { existsSync as existsSync13, readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "node:fs";
29404
+ import { existsSync as existsSync14, readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "node:fs";
29387
29405
  import { dirname as dirname9 } from "node:path";
29388
29406
  function deepEqual2(a, b) {
29389
29407
  if (a === b)
@@ -29451,7 +29469,7 @@ function syncClaudeMcpConfig(validatedPlugins, options2) {
29451
29469
  trackedServers: []
29452
29470
  };
29453
29471
  let existingConfig = {};
29454
- if (existsSync13(configPath)) {
29472
+ if (existsSync14(configPath)) {
29455
29473
  try {
29456
29474
  const content = readFileSync3(configPath, "utf-8");
29457
29475
  existingConfig = import_json52.default.parse(content);
@@ -29502,7 +29520,7 @@ function syncClaudeMcpConfig(validatedPlugins, options2) {
29502
29520
  if (hasChanges && !dryRun) {
29503
29521
  existingConfig.mcpServers = existingServers;
29504
29522
  const dir = dirname9(configPath);
29505
- if (!existsSync13(dir)) {
29523
+ if (!existsSync14(dir)) {
29506
29524
  mkdirSync3(dir, { recursive: true });
29507
29525
  }
29508
29526
  writeFileSync3(configPath, `${JSON.stringify(existingConfig, null, 2)}
@@ -29520,7 +29538,7 @@ function syncClaudeMcpConfig(validatedPlugins, options2) {
29520
29538
  if (result.removed > 0 && !dryRun) {
29521
29539
  existingConfig.mcpServers = existingServers;
29522
29540
  const dir = dirname9(configPath);
29523
- if (!existsSync13(dir)) {
29541
+ if (!existsSync14(dir)) {
29524
29542
  mkdirSync3(dir, { recursive: true });
29525
29543
  }
29526
29544
  writeFileSync3(configPath, `${JSON.stringify(existingConfig, null, 2)}
@@ -29619,9 +29637,9 @@ var init_claude_mcp = __esm(() => {
29619
29637
  });
29620
29638
 
29621
29639
  // src/core/copilot-mcp.ts
29622
- import { join as join15 } from "node:path";
29640
+ import { join as join16 } from "node:path";
29623
29641
  function getCopilotMcpConfigPath() {
29624
- return join15(getHomeDir(), ".copilot", "mcp-config.json");
29642
+ return join16(getHomeDir(), ".copilot", "mcp-config.json");
29625
29643
  }
29626
29644
  var init_copilot_mcp = __esm(() => {
29627
29645
  init_constants();
@@ -29919,9 +29937,9 @@ function padStart2(str3, len) {
29919
29937
  }
29920
29938
 
29921
29939
  // src/core/sync.ts
29922
- import { existsSync as existsSync14, readFileSync as readFileSync4, writeFileSync as writeFileSync4, lstatSync } from "node:fs";
29940
+ import { existsSync as existsSync15, readFileSync as readFileSync4, writeFileSync as writeFileSync4, lstatSync } from "node:fs";
29923
29941
  import { rm as rm4, unlink as unlink2, rmdir, copyFile } from "node:fs/promises";
29924
- import { join as join16, resolve as resolve9, dirname as dirname10, relative as relative4 } from "node:path";
29942
+ import { join as join17, resolve as resolve9, dirname as dirname10, relative as relative4 } from "node:path";
29925
29943
  function deduplicateClientsByPath(clients, clientMappings = CLIENT_MAPPINGS) {
29926
29944
  const pathToClients = new Map;
29927
29945
  for (const client of clients) {
@@ -30035,7 +30053,7 @@ async function selectivePurgeWorkspace(workspacePath, state, clients) {
30035
30053
  const previousFiles = getPreviouslySyncedFiles(state, client);
30036
30054
  const purgedPaths = [];
30037
30055
  for (const filePath of previousFiles) {
30038
- const fullPath = join16(workspacePath, filePath);
30056
+ const fullPath = join17(workspacePath, filePath);
30039
30057
  const cleanPath = fullPath.replace(/\/$/, "");
30040
30058
  let stats;
30041
30059
  try {
@@ -30064,8 +30082,8 @@ async function selectivePurgeWorkspace(workspacePath, state, clients) {
30064
30082
  async function cleanupEmptyParents(workspacePath, filePath) {
30065
30083
  let parentPath = dirname10(filePath);
30066
30084
  while (parentPath && parentPath !== "." && parentPath !== "/") {
30067
- const fullParentPath = join16(workspacePath, parentPath);
30068
- if (!existsSync14(fullParentPath)) {
30085
+ const fullParentPath = join17(workspacePath, parentPath);
30086
+ if (!existsSync15(fullParentPath)) {
30069
30087
  parentPath = dirname10(parentPath);
30070
30088
  continue;
30071
30089
  }
@@ -30150,8 +30168,8 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
30150
30168
  errors2.push(`Cannot resolve file '${file}' - no workspace.source configured`);
30151
30169
  continue;
30152
30170
  }
30153
- const fullPath = join16(defaultSourcePath, file);
30154
- if (!existsSync14(fullPath)) {
30171
+ const fullPath = join17(defaultSourcePath, file);
30172
+ if (!existsSync15(fullPath)) {
30155
30173
  errors2.push(`File source not found: ${fullPath}`);
30156
30174
  }
30157
30175
  continue;
@@ -30169,8 +30187,8 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
30169
30187
  errors2.push(`GitHub cache not found for ${cacheKey}`);
30170
30188
  continue;
30171
30189
  }
30172
- const fullPath = join16(cachePath, parsed.filePath);
30173
- if (!existsSync14(fullPath)) {
30190
+ const fullPath = join17(cachePath, parsed.filePath);
30191
+ if (!existsSync15(fullPath)) {
30174
30192
  errors2.push(`Path not found in repository: ${cacheKey}/${parsed.filePath}`);
30175
30193
  }
30176
30194
  } else {
@@ -30180,11 +30198,11 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
30180
30198
  } else if (file.source.startsWith("../")) {
30181
30199
  fullPath = resolve9(file.source);
30182
30200
  } else if (defaultSourcePath) {
30183
- fullPath = join16(defaultSourcePath, file.source);
30201
+ fullPath = join17(defaultSourcePath, file.source);
30184
30202
  } else {
30185
30203
  fullPath = resolve9(file.source);
30186
30204
  }
30187
- if (!existsSync14(fullPath)) {
30205
+ if (!existsSync15(fullPath)) {
30188
30206
  errors2.push(`File source not found: ${fullPath}`);
30189
30207
  }
30190
30208
  }
@@ -30193,8 +30211,8 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
30193
30211
  errors2.push(`Cannot resolve file '${file.dest}' - no workspace.source configured and no explicit source provided`);
30194
30212
  continue;
30195
30213
  }
30196
- const fullPath = join16(defaultSourcePath, file.dest ?? "");
30197
- if (!existsSync14(fullPath)) {
30214
+ const fullPath = join17(defaultSourcePath, file.dest ?? "");
30215
+ if (!existsSync15(fullPath)) {
30198
30216
  errors2.push(`File source not found: ${fullPath}`);
30199
30217
  }
30200
30218
  }
@@ -30340,7 +30358,7 @@ async function validatePlugin(pluginSource, workspacePath, offline) {
30340
30358
  ...fetchResult.error && { error: fetchResult.error }
30341
30359
  };
30342
30360
  }
30343
- const resolvedPath2 = parsed?.subpath ? join16(fetchResult.cachePath, parsed.subpath) : fetchResult.cachePath;
30361
+ const resolvedPath2 = parsed?.subpath ? join17(fetchResult.cachePath, parsed.subpath) : fetchResult.cachePath;
30344
30362
  return {
30345
30363
  plugin: pluginSource,
30346
30364
  resolved: resolvedPath2,
@@ -30350,7 +30368,7 @@ async function validatePlugin(pluginSource, workspacePath, offline) {
30350
30368
  };
30351
30369
  }
30352
30370
  const resolvedPath = resolve9(workspacePath, pluginSource);
30353
- if (!existsSync14(resolvedPath)) {
30371
+ if (!existsSync15(resolvedPath)) {
30354
30372
  return {
30355
30373
  plugin: pluginSource,
30356
30374
  resolved: resolvedPath,
@@ -30511,10 +30529,10 @@ function buildPluginSkillNameMaps(allSkills) {
30511
30529
  return pluginMaps;
30512
30530
  }
30513
30531
  function generateVscodeWorkspaceFile(workspacePath, config) {
30514
- const configDir = join16(workspacePath, CONFIG_DIR);
30515
- const templatePath = join16(configDir, VSCODE_TEMPLATE_FILE);
30532
+ const configDir = join17(workspacePath, CONFIG_DIR);
30533
+ const templatePath = join17(configDir, VSCODE_TEMPLATE_FILE);
30516
30534
  let template;
30517
- if (existsSync14(templatePath)) {
30535
+ if (existsSync15(templatePath)) {
30518
30536
  try {
30519
30537
  template = import_json53.default.parse(readFileSync4(templatePath, "utf-8"));
30520
30538
  } catch (error) {
@@ -30661,7 +30679,7 @@ async function syncVscodeWorkspaceFile(workspacePath, config, configPath, previo
30661
30679
  let updatedConfig = config;
30662
30680
  if (previousState?.vscodeWorkspaceHash && previousState?.vscodeWorkspaceRepos) {
30663
30681
  const outputPath = getWorkspaceOutputPath(workspacePath, config.vscode);
30664
- if (existsSync14(outputPath)) {
30682
+ if (existsSync15(outputPath)) {
30665
30683
  const existingContent = readFileSync4(outputPath, "utf-8");
30666
30684
  const currentHash = computeWorkspaceHash(existingContent);
30667
30685
  if (currentHash !== previousState.vscodeWorkspaceHash) {
@@ -30725,9 +30743,9 @@ async function syncWorkspace(workspacePath = process.cwd(), options2 = {}) {
30725
30743
  await migrateWorkspaceSkillsV1toV2(workspacePath);
30726
30744
  const { offline = false, dryRun = false, workspaceSourceBase, skipAgentFiles = false } = options2;
30727
30745
  const sw = new Stopwatch;
30728
- const configDir = join16(workspacePath, CONFIG_DIR);
30729
- const configPath = join16(configDir, WORKSPACE_CONFIG_FILE);
30730
- if (!existsSync14(configPath)) {
30746
+ const configDir = join17(workspacePath, CONFIG_DIR);
30747
+ const configPath = join17(configDir, WORKSPACE_CONFIG_FILE);
30748
+ if (!existsSync15(configPath)) {
30731
30749
  return failedSyncResult(`${CONFIG_DIR}/${WORKSPACE_CONFIG_FILE} not found in ${workspacePath}
30732
30750
  Run 'allagents workspace init <path>' to create a new workspace`);
30733
30751
  }
@@ -30816,8 +30834,8 @@ ${failedValidations.map((v) => ` - ${v.plugin}: ${v.error}`).join(`
30816
30834
  const filesToCopy = [...config.workspace.files];
30817
30835
  if (hasRepositories && sourcePath) {
30818
30836
  for (const agentFile of AGENT_FILES) {
30819
- const agentPath = join16(sourcePath, agentFile);
30820
- if (existsSync14(agentPath) && !filesToCopy.includes(agentFile)) {
30837
+ const agentPath = join17(sourcePath, agentFile);
30838
+ if (existsSync15(agentPath) && !filesToCopy.includes(agentFile)) {
30821
30839
  filesToCopy.push(agentFile);
30822
30840
  }
30823
30841
  }
@@ -30841,10 +30859,10 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
30841
30859
  }
30842
30860
  workspaceFileResults = await copyWorkspaceFiles(sourcePath, workspacePath, filesToCopy, { dryRun, githubCache, repositories: config.repositories });
30843
30861
  if (hasRepositories && !dryRun && syncClients.includes("claude") && sourcePath) {
30844
- const claudePath = join16(workspacePath, "CLAUDE.md");
30845
- const agentsPath = join16(workspacePath, "AGENTS.md");
30846
- const claudeExistsInSource = existsSync14(join16(sourcePath, "CLAUDE.md"));
30847
- if (!claudeExistsInSource && existsSync14(agentsPath) && !existsSync14(claudePath)) {
30862
+ const claudePath = join17(workspacePath, "CLAUDE.md");
30863
+ const agentsPath = join17(workspacePath, "AGENTS.md");
30864
+ const claudeExistsInSource = existsSync15(join17(sourcePath, "CLAUDE.md"));
30865
+ if (!claudeExistsInSource && existsSync15(agentsPath) && !existsSync15(claudePath)) {
30848
30866
  await copyFile(agentsPath, claudePath);
30849
30867
  }
30850
30868
  }
@@ -30865,7 +30883,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
30865
30883
  const mcpResults = {};
30866
30884
  if (syncClients.includes("vscode")) {
30867
30885
  const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "vscode");
30868
- const projectMcpPath = join16(workspacePath, ".vscode", "mcp.json");
30886
+ const projectMcpPath = join17(workspacePath, ".vscode", "mcp.json");
30869
30887
  const vscodeMcp = syncVscodeMcpConfig(validPlugins, {
30870
30888
  dryRun,
30871
30889
  force: false,
@@ -30879,7 +30897,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
30879
30897
  }
30880
30898
  if (syncClients.includes("claude")) {
30881
30899
  const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "claude");
30882
- const projectMcpJsonPath = join16(workspacePath, ".mcp.json");
30900
+ const projectMcpJsonPath = join17(workspacePath, ".mcp.json");
30883
30901
  const claudeMcp = syncClaudeMcpConfig(validPlugins, {
30884
30902
  dryRun,
30885
30903
  force: false,
@@ -30893,7 +30911,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
30893
30911
  }
30894
30912
  if (syncClients.includes("codex")) {
30895
30913
  const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "codex");
30896
- const projectCodexConfigPath = join16(workspacePath, ".codex", "config.toml");
30914
+ const projectCodexConfigPath = join17(workspacePath, ".codex", "config.toml");
30897
30915
  const codexMcp = syncCodexProjectMcpConfig(validPlugins, {
30898
30916
  dryRun,
30899
30917
  force: false,
@@ -30907,7 +30925,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
30907
30925
  }
30908
30926
  if (syncClients.includes("copilot")) {
30909
30927
  const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "copilot");
30910
- const projectCopilotMcpPath = join16(workspacePath, ".copilot", "mcp-config.json");
30928
+ const projectCopilotMcpPath = join17(workspacePath, ".copilot", "mcp-config.json");
30911
30929
  const copilotMcp = syncClaudeMcpConfig(validPlugins, {
30912
30930
  dryRun,
30913
30931
  force: false,
@@ -30977,7 +30995,7 @@ async function seedFetchCacheFromMarketplaces(results) {
30977
30995
  }
30978
30996
  function readGitBranch(repoPath) {
30979
30997
  try {
30980
- const head = readFileSync4(join16(repoPath, ".git", "HEAD"), "utf-8").trim();
30998
+ const head = readFileSync4(join17(repoPath, ".git", "HEAD"), "utf-8").trim();
30981
30999
  const prefix = "ref: refs/heads/";
30982
31000
  return head.startsWith(prefix) ? head.slice(prefix.length) : null;
30983
31001
  } catch {
@@ -31141,11 +31159,11 @@ var init_sync = __esm(() => {
31141
31159
  });
31142
31160
 
31143
31161
  // src/core/github-fetch.ts
31144
- import { existsSync as existsSync15, readFileSync as readFileSync5 } from "node:fs";
31145
- import { join as join17 } from "node:path";
31162
+ import { existsSync as existsSync16, readFileSync as readFileSync5 } from "node:fs";
31163
+ import { join as join18 } from "node:path";
31146
31164
  function readFileFromClone(tempDir, filePath) {
31147
- const fullPath = join17(tempDir, filePath);
31148
- if (existsSync15(fullPath)) {
31165
+ const fullPath = join18(tempDir, filePath);
31166
+ if (existsSync16(fullPath)) {
31149
31167
  return readFileSync5(fullPath, "utf-8");
31150
31168
  }
31151
31169
  return null;
@@ -31244,15 +31262,15 @@ var init_github_fetch = __esm(() => {
31244
31262
  });
31245
31263
 
31246
31264
  // src/core/workspace.ts
31247
- import { cp as cp2, mkdir as mkdir8, readFile as readFile10, writeFile as writeFile7, copyFile as copyFile2, unlink as unlink3 } from "node:fs/promises";
31248
- import { existsSync as existsSync16 } from "node:fs";
31249
- import { join as join18, resolve as resolve10, dirname as dirname11, relative as relative5, sep as sep2, isAbsolute as isAbsolute4 } from "node:path";
31265
+ import { cp as cp2, mkdir as mkdir8, readFile as readFile11, writeFile as writeFile8, copyFile as copyFile2, unlink as unlink3 } from "node:fs/promises";
31266
+ import { existsSync as existsSync17 } from "node:fs";
31267
+ import { join as join19, resolve as resolve10, dirname as dirname11, relative as relative5, sep as sep2, isAbsolute as isAbsolute4 } from "node:path";
31250
31268
  import { fileURLToPath } from "node:url";
31251
31269
  async function initWorkspace(targetPath = ".", options2 = {}) {
31252
31270
  const absoluteTarget = resolve10(targetPath);
31253
- const configDir = join18(absoluteTarget, CONFIG_DIR);
31254
- const configPath = join18(configDir, WORKSPACE_CONFIG_FILE);
31255
- if (existsSync16(configPath)) {
31271
+ const configDir = join19(absoluteTarget, CONFIG_DIR);
31272
+ const configPath = join19(configDir, WORKSPACE_CONFIG_FILE);
31273
+ if (existsSync17(configPath)) {
31256
31274
  if (options2.force) {
31257
31275
  await unlink3(configPath);
31258
31276
  } else {
@@ -31263,7 +31281,7 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31263
31281
  const currentFilePath = fileURLToPath(import.meta.url);
31264
31282
  const currentFileDir = dirname11(currentFilePath);
31265
31283
  const isProduction = currentFilePath.includes(`${sep2}dist${sep2}`);
31266
- const defaultTemplatePath = isProduction ? join18(currentFileDir, "templates", "default") : join18(currentFileDir, "..", "templates", "default");
31284
+ const defaultTemplatePath = isProduction ? join19(currentFileDir, "templates", "default") : join19(currentFileDir, "..", "templates", "default");
31267
31285
  let githubTempDir;
31268
31286
  let parsedFromUrl;
31269
31287
  let githubBasePath = "";
@@ -31271,6 +31289,7 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31271
31289
  try {
31272
31290
  await mkdir8(absoluteTarget, { recursive: true });
31273
31291
  await mkdir8(configDir, { recursive: true });
31292
+ await ensureConfigGitignore(absoluteTarget);
31274
31293
  let workspaceYamlContent;
31275
31294
  let sourceDir;
31276
31295
  if (options2.from) {
@@ -31302,19 +31321,19 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31302
31321
  console.log(`✓ Using workspace.yaml from: ${options2.from}`);
31303
31322
  } else {
31304
31323
  const fromPath = resolve10(options2.from);
31305
- if (!existsSync16(fromPath)) {
31324
+ if (!existsSync17(fromPath)) {
31306
31325
  throw new Error(`Template not found: ${fromPath}`);
31307
31326
  }
31308
31327
  const { stat: stat2 } = await import("node:fs/promises");
31309
31328
  const fromStat = await stat2(fromPath);
31310
31329
  let sourceYamlPath;
31311
31330
  if (fromStat.isDirectory()) {
31312
- const nestedPath = join18(fromPath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
31313
- const rootPath = join18(fromPath, WORKSPACE_CONFIG_FILE);
31314
- if (existsSync16(nestedPath)) {
31331
+ const nestedPath = join19(fromPath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
31332
+ const rootPath = join19(fromPath, WORKSPACE_CONFIG_FILE);
31333
+ if (existsSync17(nestedPath)) {
31315
31334
  sourceYamlPath = nestedPath;
31316
31335
  sourceDir = fromPath;
31317
- } else if (existsSync16(rootPath)) {
31336
+ } else if (existsSync17(rootPath)) {
31318
31337
  sourceYamlPath = rootPath;
31319
31338
  sourceDir = fromPath;
31320
31339
  } else {
@@ -31330,7 +31349,7 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31330
31349
  sourceDir = parentDir;
31331
31350
  }
31332
31351
  }
31333
- workspaceYamlContent = await readFile10(sourceYamlPath, "utf-8");
31352
+ workspaceYamlContent = await readFile11(sourceYamlPath, "utf-8");
31334
31353
  if (sourceDir) {
31335
31354
  const parsed2 = load(workspaceYamlContent);
31336
31355
  const workspace = parsed2?.workspace;
@@ -31345,36 +31364,36 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31345
31364
  console.log(`✓ Using workspace.yaml from: ${sourceYamlPath}`);
31346
31365
  }
31347
31366
  } else {
31348
- const defaultYamlPath = join18(defaultTemplatePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
31349
- if (!existsSync16(defaultYamlPath)) {
31367
+ const defaultYamlPath = join19(defaultTemplatePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
31368
+ if (!existsSync17(defaultYamlPath)) {
31350
31369
  throw new Error(`Default template not found at: ${defaultTemplatePath}`);
31351
31370
  }
31352
- workspaceYamlContent = await readFile10(defaultYamlPath, "utf-8");
31371
+ workspaceYamlContent = await readFile11(defaultYamlPath, "utf-8");
31353
31372
  }
31354
31373
  if (options2.clients && options2.clients.length > 0) {
31355
31374
  const configParsed = load(workspaceYamlContent);
31356
31375
  configParsed.clients = options2.clients;
31357
31376
  workspaceYamlContent = dump(configParsed, { lineWidth: -1 });
31358
31377
  }
31359
- await writeFile7(configPath, workspaceYamlContent, "utf-8");
31378
+ await writeFile8(configPath, workspaceYamlContent, "utf-8");
31360
31379
  const parsed = load(workspaceYamlContent);
31361
31380
  const clients = parsed?.clients ?? [];
31362
31381
  const clientNames = getClientTypes(clients);
31363
31382
  const VSCODE_TEMPLATE_FILE2 = "template.code-workspace";
31364
31383
  if (clientNames.includes("vscode") && options2.from) {
31365
- const targetTemplatePath = join18(configDir, VSCODE_TEMPLATE_FILE2);
31366
- if (!existsSync16(targetTemplatePath)) {
31384
+ const targetTemplatePath = join19(configDir, VSCODE_TEMPLATE_FILE2);
31385
+ if (!existsSync17(targetTemplatePath)) {
31367
31386
  if (isGitHubUrl(options2.from) && githubTempDir) {
31368
31387
  if (parsedFromUrl) {
31369
31388
  const templatePath = githubBasePath ? `${githubBasePath}/${CONFIG_DIR}/${VSCODE_TEMPLATE_FILE2}` : `${CONFIG_DIR}/${VSCODE_TEMPLATE_FILE2}`;
31370
31389
  const templateContent = readFileFromClone(githubTempDir, templatePath);
31371
31390
  if (templateContent) {
31372
- await writeFile7(targetTemplatePath, templateContent, "utf-8");
31391
+ await writeFile8(targetTemplatePath, templateContent, "utf-8");
31373
31392
  }
31374
31393
  }
31375
31394
  } else if (sourceDir) {
31376
- const sourceTemplatePath = join18(sourceDir, CONFIG_DIR, VSCODE_TEMPLATE_FILE2);
31377
- if (existsSync16(sourceTemplatePath)) {
31395
+ const sourceTemplatePath = join19(sourceDir, CONFIG_DIR, VSCODE_TEMPLATE_FILE2);
31396
+ if (existsSync17(sourceTemplatePath)) {
31378
31397
  await copyFile2(sourceTemplatePath, targetTemplatePath);
31379
31398
  }
31380
31399
  }
@@ -31387,15 +31406,15 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31387
31406
  if (options2.from && isGitHubUrl(options2.from) && githubTempDir) {
31388
31407
  if (parsedFromUrl) {
31389
31408
  for (const agentFile of AGENT_FILES) {
31390
- const targetFilePath = join18(absoluteTarget, agentFile);
31391
- if (existsSync16(targetFilePath)) {
31409
+ const targetFilePath = join19(absoluteTarget, agentFile);
31410
+ if (existsSync17(targetFilePath)) {
31392
31411
  copiedAgentFiles.push(agentFile);
31393
31412
  continue;
31394
31413
  }
31395
31414
  const filePath = githubBasePath ? `${githubBasePath}/${agentFile}` : agentFile;
31396
31415
  const content = readFileFromClone(githubTempDir, filePath);
31397
31416
  if (content) {
31398
- await writeFile7(targetFilePath, content, "utf-8");
31417
+ await writeFile8(targetFilePath, content, "utf-8");
31399
31418
  copiedAgentFiles.push(agentFile);
31400
31419
  }
31401
31420
  }
@@ -31403,30 +31422,30 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
31403
31422
  } else {
31404
31423
  const effectiveSourceDir = sourceDir ?? defaultTemplatePath;
31405
31424
  for (const agentFile of AGENT_FILES) {
31406
- const targetFilePath = join18(absoluteTarget, agentFile);
31407
- if (existsSync16(targetFilePath)) {
31425
+ const targetFilePath = join19(absoluteTarget, agentFile);
31426
+ if (existsSync17(targetFilePath)) {
31408
31427
  copiedAgentFiles.push(agentFile);
31409
31428
  continue;
31410
31429
  }
31411
- const sourcePath = join18(effectiveSourceDir, agentFile);
31412
- if (existsSync16(sourcePath)) {
31413
- const content = await readFile10(sourcePath, "utf-8");
31414
- await writeFile7(targetFilePath, content, "utf-8");
31430
+ const sourcePath = join19(effectiveSourceDir, agentFile);
31431
+ if (existsSync17(sourcePath)) {
31432
+ const content = await readFile11(sourcePath, "utf-8");
31433
+ await writeFile8(targetFilePath, content, "utf-8");
31415
31434
  copiedAgentFiles.push(agentFile);
31416
31435
  }
31417
31436
  }
31418
31437
  }
31419
31438
  if (copiedAgentFiles.length === 0) {
31420
- await ensureWorkspaceRules(join18(absoluteTarget, "AGENTS.md"), repositories);
31439
+ await ensureWorkspaceRules(join19(absoluteTarget, "AGENTS.md"), repositories);
31421
31440
  copiedAgentFiles.push("AGENTS.md");
31422
31441
  } else {
31423
31442
  for (const agentFile of copiedAgentFiles) {
31424
- await ensureWorkspaceRules(join18(absoluteTarget, agentFile), repositories);
31443
+ await ensureWorkspaceRules(join19(absoluteTarget, agentFile), repositories);
31425
31444
  }
31426
31445
  }
31427
31446
  if (clientNames.includes("claude") && !copiedAgentFiles.includes("CLAUDE.md") && copiedAgentFiles.includes("AGENTS.md")) {
31428
- const agentsPath = join18(absoluteTarget, "AGENTS.md");
31429
- const claudePath = join18(absoluteTarget, "CLAUDE.md");
31447
+ const agentsPath = join19(absoluteTarget, "AGENTS.md");
31448
+ const claudePath = join19(absoluteTarget, "CLAUDE.md");
31430
31449
  await copyFile2(agentsPath, claudePath);
31431
31450
  }
31432
31451
  }
@@ -31471,14 +31490,14 @@ Next steps:`);
31471
31490
  async function seedCacheFromClone(tempDir, owner, repo, branch) {
31472
31491
  const cachePaths = [
31473
31492
  getPluginCachePath(owner, repo, branch),
31474
- join18(getMarketplacesDir(), repo)
31493
+ join19(getMarketplacesDir(), repo)
31475
31494
  ];
31476
31495
  for (const cachePath of cachePaths) {
31477
- if (existsSync16(cachePath))
31496
+ if (existsSync17(cachePath))
31478
31497
  continue;
31479
31498
  try {
31480
31499
  const parentDir = dirname11(cachePath);
31481
- if (!existsSync16(parentDir)) {
31500
+ if (!existsSync17(parentDir)) {
31482
31501
  await mkdir8(parentDir, { recursive: true });
31483
31502
  }
31484
31503
  await cp2(tempDir, cachePath, { recursive: true });
@@ -31495,14 +31514,15 @@ var init_workspace = __esm(() => {
31495
31514
  init_github_fetch();
31496
31515
  init_git();
31497
31516
  init_marketplace();
31517
+ init_config_gitignore();
31498
31518
  });
31499
31519
 
31500
31520
  // src/core/status.ts
31501
- import { existsSync as existsSync17 } from "node:fs";
31502
- import { join as join19 } from "node:path";
31521
+ import { existsSync as existsSync18 } from "node:fs";
31522
+ import { join as join20 } from "node:path";
31503
31523
  async function getWorkspaceStatus(workspacePath = process.cwd()) {
31504
- const configPath = join19(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
31505
- if (!existsSync17(configPath) || isUserConfigPath(workspacePath)) {
31524
+ const configPath = join20(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
31525
+ if (!existsSync18(configPath) || isUserConfigPath(workspacePath)) {
31506
31526
  const userPlugins = await getUserPluginStatuses();
31507
31527
  return {
31508
31528
  success: true,
@@ -31544,7 +31564,7 @@ async function getWorkspaceStatus(workspacePath = process.cwd()) {
31544
31564
  function getPluginStatus(parsed) {
31545
31565
  if (parsed.type === "github") {
31546
31566
  const cachePath = parsed.owner && parsed.repo ? getPluginCachePath(parsed.owner, parsed.repo) : "";
31547
- const available2 = cachePath ? existsSync17(cachePath) : false;
31567
+ const available2 = cachePath ? existsSync18(cachePath) : false;
31548
31568
  return {
31549
31569
  source: parsed.original,
31550
31570
  type: "github",
@@ -31554,7 +31574,7 @@ function getPluginStatus(parsed) {
31554
31574
  ...parsed.repo && { repo: parsed.repo }
31555
31575
  };
31556
31576
  }
31557
- const available = existsSync17(parsed.normalized);
31577
+ const available = existsSync18(parsed.normalized);
31558
31578
  return {
31559
31579
  source: parsed.original,
31560
31580
  type: "local",
@@ -33691,9 +33711,9 @@ var init_prompt_clients = __esm(() => {
33691
33711
  });
33692
33712
 
33693
33713
  // src/core/skills.ts
33694
- import { existsSync as existsSync20 } from "node:fs";
33695
- import { readFile as readFile12, readdir as readdir4 } from "node:fs/promises";
33696
- import { join as join22, basename as basename6, resolve as resolve12 } from "node:path";
33714
+ import { existsSync as existsSync21 } from "node:fs";
33715
+ import { readFile as readFile13, readdir as readdir4 } from "node:fs/promises";
33716
+ import { join as join23, basename as basename6, resolve as resolve12 } from "node:path";
33697
33717
  async function resolvePluginPath(pluginSource, workspacePath) {
33698
33718
  if (isPluginSpec(pluginSource)) {
33699
33719
  const resolved2 = await resolvePluginSpecWithAutoRegister(pluginSource, {
@@ -33714,18 +33734,18 @@ async function resolvePluginPath(pluginSource, workspacePath) {
33714
33734
  });
33715
33735
  if (!result.success)
33716
33736
  return null;
33717
- const path = parsed?.subpath ? join22(result.cachePath, parsed.subpath) : result.cachePath;
33737
+ const path = parsed?.subpath ? join23(result.cachePath, parsed.subpath) : result.cachePath;
33718
33738
  return { path };
33719
33739
  }
33720
33740
  const resolved = resolve12(workspacePath, pluginSource);
33721
- return existsSync20(resolved) ? { path: resolved } : null;
33741
+ return existsSync21(resolved) ? { path: resolved } : null;
33722
33742
  }
33723
33743
  async function getAllSkillsFromPlugins(workspacePath = process.cwd()) {
33724
- const configPath = join22(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
33725
- if (!existsSync20(configPath)) {
33744
+ const configPath = join23(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
33745
+ if (!existsSync21(configPath)) {
33726
33746
  return [];
33727
33747
  }
33728
- const content = await readFile12(configPath, "utf-8");
33748
+ const content = await readFile13(configPath, "utf-8");
33729
33749
  const config = load(content);
33730
33750
  const isV1Fallback = config.version === undefined || config.version < 2;
33731
33751
  const disabledSkills = isV1Fallback ? new Set(config.disabledSkills ?? []) : new Set;
@@ -33738,30 +33758,30 @@ async function getAllSkillsFromPlugins(workspacePath = process.cwd()) {
33738
33758
  continue;
33739
33759
  const pluginPath = resolved.path;
33740
33760
  const pluginName = resolved.pluginName ?? getPluginName(pluginPath);
33741
- const skillsDir = join22(pluginPath, "skills");
33761
+ const skillsDir = join23(pluginPath, "skills");
33742
33762
  const pluginSkillsConfig = typeof pluginEntry === "string" ? undefined : pluginEntry.skills;
33743
33763
  const hasEnabledEntries = !pluginSkillsConfig && enabledSkills && [...enabledSkills].some((s) => s.startsWith(`${pluginName}`));
33744
33764
  let skillEntries;
33745
- if (existsSync20(skillsDir)) {
33765
+ if (existsSync21(skillsDir)) {
33746
33766
  const entries = await readdir4(skillsDir, { withFileTypes: true });
33747
- skillEntries = entries.filter((e) => e.isDirectory()).map((e) => ({ name: e.name, skillPath: join22(skillsDir, e.name) }));
33767
+ skillEntries = entries.filter((e) => e.isDirectory()).map((e) => ({ name: e.name, skillPath: join23(skillsDir, e.name) }));
33748
33768
  } else {
33749
33769
  const entries = await readdir4(pluginPath, { withFileTypes: true });
33750
33770
  const flatSkills = [];
33751
33771
  for (const entry of entries) {
33752
33772
  if (!entry.isDirectory())
33753
33773
  continue;
33754
- const skillMdPath = join22(pluginPath, entry.name, "SKILL.md");
33755
- if (existsSync20(skillMdPath)) {
33756
- flatSkills.push({ name: entry.name, skillPath: join22(pluginPath, entry.name) });
33774
+ const skillMdPath = join23(pluginPath, entry.name, "SKILL.md");
33775
+ if (existsSync21(skillMdPath)) {
33776
+ flatSkills.push({ name: entry.name, skillPath: join23(pluginPath, entry.name) });
33757
33777
  }
33758
33778
  }
33759
33779
  if (flatSkills.length > 0) {
33760
33780
  skillEntries = flatSkills;
33761
33781
  } else {
33762
- const rootSkillMd = join22(pluginPath, "SKILL.md");
33763
- if (existsSync20(rootSkillMd)) {
33764
- const skillContent = await readFile12(rootSkillMd, "utf-8");
33782
+ const rootSkillMd = join23(pluginPath, "SKILL.md");
33783
+ if (existsSync21(rootSkillMd)) {
33784
+ const skillContent = await readFile13(rootSkillMd, "utf-8");
33765
33785
  const metadata = parseSkillMetadata(skillContent);
33766
33786
  const skillName = metadata?.name ?? basename6(pluginPath);
33767
33787
  skillEntries = [{ name: skillName, skillPath: pluginPath }];
@@ -33802,10 +33822,10 @@ async function findSkillByName(skillName, workspacePath = process.cwd()) {
33802
33822
  return allSkills.filter((s) => s.name === skillName);
33803
33823
  }
33804
33824
  async function discoverSkillNames(pluginPath) {
33805
- if (!existsSync20(pluginPath))
33825
+ if (!existsSync21(pluginPath))
33806
33826
  return [];
33807
- const skillsDir = join22(pluginPath, "skills");
33808
- if (existsSync20(skillsDir)) {
33827
+ const skillsDir = join23(pluginPath, "skills");
33828
+ if (existsSync21(skillsDir)) {
33809
33829
  const entries2 = await readdir4(skillsDir, { withFileTypes: true });
33810
33830
  return entries2.filter((e) => e.isDirectory()).map((e) => e.name);
33811
33831
  }
@@ -33814,16 +33834,16 @@ async function discoverSkillNames(pluginPath) {
33814
33834
  for (const entry of entries) {
33815
33835
  if (!entry.isDirectory())
33816
33836
  continue;
33817
- if (existsSync20(join22(pluginPath, entry.name, "SKILL.md"))) {
33837
+ if (existsSync21(join23(pluginPath, entry.name, "SKILL.md"))) {
33818
33838
  flatSkills.push(entry.name);
33819
33839
  }
33820
33840
  }
33821
33841
  if (flatSkills.length > 0)
33822
33842
  return flatSkills;
33823
- const rootSkillMd = join22(pluginPath, "SKILL.md");
33824
- if (existsSync20(rootSkillMd)) {
33843
+ const rootSkillMd = join23(pluginPath, "SKILL.md");
33844
+ if (existsSync21(rootSkillMd)) {
33825
33845
  try {
33826
- const content = await readFile12(rootSkillMd, "utf-8");
33846
+ const content = await readFile13(rootSkillMd, "utf-8");
33827
33847
  const { parseSkillMetadata: parseSkillMetadata2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
33828
33848
  const metadata = parseSkillMetadata2(content);
33829
33849
  return [metadata?.name ?? basename6(pluginPath)];
@@ -34341,7 +34361,7 @@ var package_default;
34341
34361
  var init_package = __esm(() => {
34342
34362
  package_default = {
34343
34363
  name: "allagents",
34344
- version: "1.4.11",
34364
+ version: "1.5.0",
34345
34365
  description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
34346
34366
  type: "module",
34347
34367
  bin: {
@@ -34421,13 +34441,13 @@ var init_package = __esm(() => {
34421
34441
  });
34422
34442
 
34423
34443
  // src/cli/update-check.ts
34424
- import { readFile as readFile15 } from "node:fs/promises";
34425
- import { join as join25 } from "node:path";
34444
+ import { readFile as readFile16 } from "node:fs/promises";
34445
+ import { join as join26 } from "node:path";
34426
34446
  import { spawn as spawn3 } from "node:child_process";
34427
34447
  async function getCachedUpdateInfo(path3) {
34428
- const filePath = path3 ?? join25(getHomeDir(), CONFIG_DIR, CACHE_FILE);
34448
+ const filePath = path3 ?? join26(getHomeDir(), CONFIG_DIR, CACHE_FILE);
34429
34449
  try {
34430
- const raw = await readFile15(filePath, "utf-8");
34450
+ const raw = await readFile16(filePath, "utf-8");
34431
34451
  const data = JSON.parse(raw);
34432
34452
  if (typeof data.latestVersion === "string" && typeof data.lastCheckedAt === "string") {
34433
34453
  return data;
@@ -34463,8 +34483,8 @@ function buildNotice(currentVersion, latestVersion) {
34463
34483
  Run \`allagents self update\` to upgrade.`);
34464
34484
  }
34465
34485
  function backgroundUpdateCheck() {
34466
- const dir = join25(getHomeDir(), CONFIG_DIR);
34467
- const filePath = join25(dir, CACHE_FILE);
34486
+ const dir = join26(getHomeDir(), CONFIG_DIR);
34487
+ const filePath = join26(dir, CACHE_FILE);
34468
34488
  const script = `
34469
34489
  const https = require('https');
34470
34490
  const fs = require('fs');
@@ -34551,15 +34571,15 @@ class TuiCache {
34551
34571
  }
34552
34572
 
34553
34573
  // src/cli/tui/context.ts
34554
- import { existsSync as existsSync23 } from "node:fs";
34555
- import { join as join26 } from "node:path";
34574
+ import { existsSync as existsSync24 } from "node:fs";
34575
+ import { join as join27 } from "node:path";
34556
34576
  async function getTuiContext(cwd = process.cwd(), cache2) {
34557
34577
  const cachedContext = cache2?.getContext();
34558
34578
  if (cachedContext) {
34559
34579
  return cachedContext;
34560
34580
  }
34561
- const configPath = join26(cwd, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
34562
- const hasWorkspace = existsSync23(configPath) && !isUserConfigPath(cwd);
34581
+ const configPath = join27(cwd, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
34582
+ const hasWorkspace = existsSync24(configPath) && !isUserConfigPath(cwd);
34563
34583
  let projectPluginCount = 0;
34564
34584
  if (hasWorkspace) {
34565
34585
  try {
@@ -35975,8 +35995,8 @@ init_workspace();
35975
35995
  init_sync();
35976
35996
  init_status2();
35977
35997
  var import_cmd_ts2 = __toESM(require_cjs(), 1);
35978
- import { existsSync as existsSync19 } from "node:fs";
35979
- import { join as join21, resolve as resolve11 } from "node:path";
35998
+ import { existsSync as existsSync20 } from "node:fs";
35999
+ import { join as join22, resolve as resolve11 } from "node:path";
35980
36000
 
35981
36001
  // src/core/prune.ts
35982
36002
  init_js_yaml();
@@ -35984,9 +36004,9 @@ init_constants();
35984
36004
  init_marketplace();
35985
36005
  init_user_workspace();
35986
36006
  init_workspace_config();
35987
- import { readFile as readFile11, writeFile as writeFile8 } from "node:fs/promises";
35988
- import { existsSync as existsSync18 } from "node:fs";
35989
- import { join as join20 } from "node:path";
36007
+ import { readFile as readFile12, writeFile as writeFile9 } from "node:fs/promises";
36008
+ import { existsSync as existsSync19 } from "node:fs";
36009
+ import { join as join21 } from "node:path";
35990
36010
  async function isOrphanedPlugin(pluginSpec) {
35991
36011
  if (!isPluginSpec(pluginSpec))
35992
36012
  return false;
@@ -36013,14 +36033,14 @@ async function prunePlugins(plugins) {
36013
36033
  }
36014
36034
  async function pruneOrphanedPlugins(workspacePath) {
36015
36035
  let projectResult = { removed: [], kept: [], keptEntries: [] };
36016
- const projectConfigPath = join20(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
36017
- if (existsSync18(projectConfigPath) && !isUserConfigPath(workspacePath)) {
36018
- const content = await readFile11(projectConfigPath, "utf-8");
36036
+ const projectConfigPath = join21(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
36037
+ if (existsSync19(projectConfigPath) && !isUserConfigPath(workspacePath)) {
36038
+ const content = await readFile12(projectConfigPath, "utf-8");
36019
36039
  const config = load(content);
36020
36040
  projectResult = await prunePlugins(config.plugins);
36021
36041
  if (projectResult.removed.length > 0) {
36022
36042
  config.plugins = projectResult.keptEntries;
36023
- await writeFile8(projectConfigPath, dump(config, { lineWidth: -1 }), "utf-8");
36043
+ await writeFile9(projectConfigPath, dump(config, { lineWidth: -1 }), "utf-8");
36024
36044
  }
36025
36045
  }
36026
36046
  let userResult = { removed: [], kept: [], keptEntries: [] };
@@ -36030,7 +36050,7 @@ async function pruneOrphanedPlugins(workspacePath) {
36030
36050
  if (userResult.removed.length > 0) {
36031
36051
  userConfig.plugins = userResult.keptEntries;
36032
36052
  const userConfigPath = getUserWorkspaceConfigPath();
36033
- await writeFile8(userConfigPath, dump(userConfig, { lineWidth: -1 }), "utf-8");
36053
+ await writeFile9(userConfigPath, dump(userConfig, { lineWidth: -1 }), "utf-8");
36034
36054
  }
36035
36055
  }
36036
36056
  return {
@@ -36092,14 +36112,14 @@ var initMeta = {
36092
36112
  }
36093
36113
  };
36094
36114
  var syncMeta = {
36095
- command: "workspace sync",
36096
- description: "Sync plugins to workspace",
36115
+ command: "update",
36116
+ description: "Update plugins in workspace",
36097
36117
  whenToUse: "After modifying workspace.yaml or pulling shared config changes",
36098
36118
  examples: [
36099
- "allagents workspace sync",
36100
- "allagents workspace sync --dry-run",
36101
- "allagents workspace sync --offline",
36102
- "allagents workspace sync --verbose"
36119
+ "allagents update",
36120
+ "allagents update --dry-run",
36121
+ "allagents update --offline",
36122
+ "allagents update --verbose"
36103
36123
  ],
36104
36124
  expectedOutput: "Lists synced files with status per plugin. Exit 0 on success, exit 1 if any files failed.",
36105
36125
  options: [
@@ -36290,8 +36310,8 @@ Plugin sync results:`);
36290
36310
  }
36291
36311
  });
36292
36312
  var syncCmd = import_cmd_ts2.command({
36293
- name: "sync",
36294
- aliases: ["update"],
36313
+ name: "update",
36314
+ aliases: ["sync"],
36295
36315
  description: buildDescription(syncMeta),
36296
36316
  args: {
36297
36317
  offline: import_cmd_ts2.flag({ long: "offline", description: "Use cached plugins without fetching latest from remote" }),
@@ -36306,8 +36326,8 @@ var syncCmd = import_cmd_ts2.command({
36306
36326
  `);
36307
36327
  }
36308
36328
  const userConfigExists = !!await getUserWorkspaceConfig();
36309
- const projectConfigPath = join21(process.cwd(), ".allagents", "workspace.yaml");
36310
- const projectConfigExists = existsSync19(projectConfigPath);
36329
+ const projectConfigPath = join22(process.cwd(), ".allagents", "workspace.yaml");
36330
+ const projectConfigExists = existsSync20(projectConfigPath);
36311
36331
  if (!userConfigExists && !projectConfigExists) {
36312
36332
  await ensureUserWorkspace();
36313
36333
  if (isJsonMode()) {
@@ -36975,9 +36995,9 @@ init_workspace_modify();
36975
36995
  init_user_workspace();
36976
36996
  init_skills();
36977
36997
  var import_cmd_ts3 = __toESM(require_cjs(), 1);
36978
- import { existsSync as existsSync21 } from "node:fs";
36979
- import { readFile as readFile13 } from "node:fs/promises";
36980
- import { join as join23 } from "node:path";
36998
+ import { existsSync as existsSync22 } from "node:fs";
36999
+ import { readFile as readFile14 } from "node:fs/promises";
37000
+ import { join as join24 } from "node:path";
36981
37001
 
36982
37002
  // src/cli/metadata/plugin-skills.ts
36983
37003
  var skillsListMeta = {
@@ -37068,7 +37088,7 @@ init_skill();
37068
37088
  init_marketplace();
37069
37089
  init_marketplace_manifest_parser();
37070
37090
  function hasProjectConfig(dir) {
37071
- return existsSync21(join23(dir, CONFIG_DIR, WORKSPACE_CONFIG_FILE));
37091
+ return existsSync22(join24(dir, CONFIG_DIR, WORKSPACE_CONFIG_FILE));
37072
37092
  }
37073
37093
  function resolveScope(cwd) {
37074
37094
  if (isUserConfigPath(cwd))
@@ -37099,7 +37119,7 @@ async function resolveSkillNameFromRepo(url, parsed, fallbackName, fetchFn = fet
37099
37119
  if (!fetchResult.success)
37100
37120
  return fallbackName;
37101
37121
  try {
37102
- const skillMd = await readFile13(join23(fetchResult.cachePath, "SKILL.md"), "utf-8");
37122
+ const skillMd = await readFile14(join24(fetchResult.cachePath, "SKILL.md"), "utf-8");
37103
37123
  const metadata = parseSkillMetadata(skillMd);
37104
37124
  return metadata?.name ?? fallbackName;
37105
37125
  } catch {
@@ -37656,9 +37676,9 @@ init_format_sync();
37656
37676
  init_workspace_config();
37657
37677
  init_constants();
37658
37678
  init_js_yaml();
37659
- import { readFile as readFile14 } from "node:fs/promises";
37660
- import { existsSync as existsSync22 } from "node:fs";
37661
- import { join as join24 } from "node:path";
37679
+ import { readFile as readFile15 } from "node:fs/promises";
37680
+ import { existsSync as existsSync23 } from "node:fs";
37681
+ import { join as join25 } from "node:path";
37662
37682
  async function runSyncAndPrint(options2) {
37663
37683
  if (!isJsonMode()) {
37664
37684
  console.log(`
@@ -37903,7 +37923,7 @@ var marketplaceAddCmd = import_cmd_ts4.command({
37903
37923
  process.exit(1);
37904
37924
  }
37905
37925
  if (effectiveScope === "project") {
37906
- if (!existsSync22(join24(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE))) {
37926
+ if (!existsSync23(join25(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE))) {
37907
37927
  const msg = 'No workspace found in current directory. Run "allagents workspace init" first.';
37908
37928
  if (isJsonMode()) {
37909
37929
  jsonOutput({ success: false, command: "plugin marketplace add", error: msg });
@@ -38210,10 +38230,10 @@ var pluginListCmd = import_cmd_ts4.command({
38210
38230
  };
38211
38231
  const pluginClients = new Map;
38212
38232
  async function loadConfigClients(configPath, scope) {
38213
- if (!existsSync22(configPath))
38233
+ if (!existsSync23(configPath))
38214
38234
  return;
38215
38235
  try {
38216
- const content = await readFile14(configPath, "utf-8");
38236
+ const content = await readFile15(configPath, "utf-8");
38217
38237
  const config = load(content);
38218
38238
  if (!config?.plugins || !config?.clients)
38219
38239
  return;
@@ -38225,8 +38245,8 @@ var pluginListCmd = import_cmd_ts4.command({
38225
38245
  }
38226
38246
  } catch {}
38227
38247
  }
38228
- const userConfigPath = join24(getAllagentsDir(), WORKSPACE_CONFIG_FILE);
38229
- const projectConfigPath = join24(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE);
38248
+ const userConfigPath = join25(getAllagentsDir(), WORKSPACE_CONFIG_FILE);
38249
+ const projectConfigPath = join25(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE);
38230
38250
  const cwdIsHome = isUserConfigPath(process.cwd());
38231
38251
  await loadConfigClients(userConfigPath, "user");
38232
38252
  if (!cwdIsHome) {
@@ -38368,7 +38388,7 @@ var pluginInstallCmd = import_cmd_ts4.command({
38368
38388
  const isUser = scope === "user" || !scope && isUserConfigPath(process.cwd());
38369
38389
  if (isUser) {
38370
38390
  const userConfigPath = getUserWorkspaceConfigPath();
38371
- if (!existsSync22(userConfigPath)) {
38391
+ if (!existsSync23(userConfigPath)) {
38372
38392
  const { promptForClients: promptForClients2 } = await Promise.resolve().then(() => (init_prompt_clients(), exports_prompt_clients));
38373
38393
  const clients = await promptForClients2();
38374
38394
  if (clients === null) {
@@ -38380,8 +38400,8 @@ var pluginInstallCmd = import_cmd_ts4.command({
38380
38400
  await ensureUserWorkspace(clients);
38381
38401
  }
38382
38402
  } else {
38383
- const configPath = join24(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE);
38384
- if (!existsSync22(configPath)) {
38403
+ const configPath = join25(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE);
38404
+ if (!existsSync23(configPath)) {
38385
38405
  const { promptForClients: promptForClients2 } = await Promise.resolve().then(() => (init_prompt_clients(), exports_prompt_clients));
38386
38406
  const clients = await promptForClients2();
38387
38407
  if (clients === null) {
@@ -38658,14 +38678,14 @@ var pluginUpdateCmd = import_cmd_ts4.command({
38658
38678
  }
38659
38679
  }
38660
38680
  if (updateProject && !isUserConfigPath(process.cwd())) {
38661
- const { existsSync: existsSync23 } = await import("node:fs");
38662
- const { readFile: readFile15 } = await import("node:fs/promises");
38663
- const { join: join25 } = await import("node:path");
38681
+ const { existsSync: existsSync24 } = await import("node:fs");
38682
+ const { readFile: readFile16 } = await import("node:fs/promises");
38683
+ const { join: join26 } = await import("node:path");
38664
38684
  const { load: load2 } = await Promise.resolve().then(() => (init_js_yaml(), exports_js_yaml));
38665
38685
  const { CONFIG_DIR: CONFIG_DIR2, WORKSPACE_CONFIG_FILE: WORKSPACE_CONFIG_FILE2 } = await Promise.resolve().then(() => (init_constants(), exports_constants));
38666
- const configPath = join25(process.cwd(), CONFIG_DIR2, WORKSPACE_CONFIG_FILE2);
38667
- if (existsSync23(configPath)) {
38668
- const content = await readFile15(configPath, "utf-8");
38686
+ const configPath = join26(process.cwd(), CONFIG_DIR2, WORKSPACE_CONFIG_FILE2);
38687
+ if (existsSync24(configPath)) {
38688
+ const content = await readFile16(configPath, "utf-8");
38669
38689
  const config = load2(content);
38670
38690
  for (const entry of config.plugins ?? []) {
38671
38691
  const p = getPluginSource(entry);
@@ -40581,6 +40601,7 @@ var app = conciseSubcommands({
40581
40601
  ` + "For AI agents: use --agent-help for machine-readable help, or --json for structured output",
40582
40602
  version: package_default.version,
40583
40603
  cmds: {
40604
+ update: syncCmd,
40584
40605
  workspace: workspaceCmd,
40585
40606
  plugin: pluginCmd,
40586
40607
  self: selfCmd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allagents",
3
- "version": "1.4.11",
3
+ "version": "1.5.0",
4
4
  "description": "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
5
5
  "type": "module",
6
6
  "bin": {