allagents 1.4.10 → 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.
- package/README.md +4 -4
- package/dist/index.js +264 -209
- package/package.json +3 -3
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
|
-
│
|
|
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
|
|
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
|
|
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, `
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
27108
|
-
|
|
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
|
-
|
|
27120
|
-
|
|
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
|
-
...
|
|
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.
|
|
27576
|
+
if (!result.replaced) {
|
|
27588
27577
|
console.log(`Auto-registered GitHub marketplace: ${source}`);
|
|
27589
27578
|
}
|
|
27590
27579
|
registeredSourceCache.set(source, name);
|
|
@@ -28332,6 +28321,21 @@ async function updateRepositories(changes, workspacePath = process.cwd()) {
|
|
|
28332
28321
|
};
|
|
28333
28322
|
}
|
|
28334
28323
|
}
|
|
28324
|
+
async function setRepositories(repositories, workspacePath = process.cwd()) {
|
|
28325
|
+
const configPath = join11(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
28326
|
+
try {
|
|
28327
|
+
const content = await readFile7(configPath, "utf-8");
|
|
28328
|
+
const config = load(content);
|
|
28329
|
+
config.repositories = repositories;
|
|
28330
|
+
await writeFile4(configPath, dump(config, { lineWidth: -1 }), "utf-8");
|
|
28331
|
+
return { success: true };
|
|
28332
|
+
} catch (error) {
|
|
28333
|
+
return {
|
|
28334
|
+
success: false,
|
|
28335
|
+
error: error instanceof Error ? error.message : String(error)
|
|
28336
|
+
};
|
|
28337
|
+
}
|
|
28338
|
+
}
|
|
28335
28339
|
var DEFAULT_PROJECT_CLIENTS;
|
|
28336
28340
|
var init_workspace_modify = __esm(() => {
|
|
28337
28341
|
init_js_yaml();
|
|
@@ -28636,20 +28640,48 @@ var init_sync_state = __esm(() => {
|
|
|
28636
28640
|
});
|
|
28637
28641
|
});
|
|
28638
28642
|
|
|
28639
|
-
// src/core/
|
|
28640
|
-
import {
|
|
28643
|
+
// src/core/config-gitignore.ts
|
|
28644
|
+
import { writeFile as writeFile6, readFile as readFile9 } from "node:fs/promises";
|
|
28641
28645
|
import { existsSync as existsSync10 } from "node:fs";
|
|
28642
|
-
import { join as join13
|
|
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";
|
|
28643
28675
|
function getSyncStatePath(workspacePath) {
|
|
28644
|
-
return
|
|
28676
|
+
return join14(workspacePath, CONFIG_DIR, SYNC_STATE_FILE);
|
|
28645
28677
|
}
|
|
28646
28678
|
async function loadSyncState(workspacePath) {
|
|
28647
28679
|
const statePath = getSyncStatePath(workspacePath);
|
|
28648
|
-
if (!
|
|
28680
|
+
if (!existsSync11(statePath)) {
|
|
28649
28681
|
return null;
|
|
28650
28682
|
}
|
|
28651
28683
|
try {
|
|
28652
|
-
const content = await
|
|
28684
|
+
const content = await readFile10(statePath, "utf-8");
|
|
28653
28685
|
const parsed = JSON.parse(content);
|
|
28654
28686
|
const result = SyncStateSchema.safeParse(parsed);
|
|
28655
28687
|
if (!result.success) {
|
|
@@ -28673,7 +28705,8 @@ async function saveSyncState(workspacePath, data) {
|
|
|
28673
28705
|
...normalizedData.vscodeWorkspaceRepos && { vscodeWorkspaceRepos: normalizedData.vscodeWorkspaceRepos }
|
|
28674
28706
|
};
|
|
28675
28707
|
await mkdir7(dirname6(statePath), { recursive: true });
|
|
28676
|
-
await
|
|
28708
|
+
await ensureConfigGitignore(workspacePath);
|
|
28709
|
+
await writeFile7(statePath, JSON.stringify(state, null, 2), "utf-8");
|
|
28677
28710
|
}
|
|
28678
28711
|
function getPreviouslySyncedFiles(state, client) {
|
|
28679
28712
|
if (!state) {
|
|
@@ -28695,6 +28728,7 @@ function getPreviouslySyncedNativePlugins(state, client) {
|
|
|
28695
28728
|
var init_sync_state2 = __esm(() => {
|
|
28696
28729
|
init_constants();
|
|
28697
28730
|
init_sync_state();
|
|
28731
|
+
init_config_gitignore();
|
|
28698
28732
|
});
|
|
28699
28733
|
|
|
28700
28734
|
// src/core/vscode-workspace.ts
|
|
@@ -28809,6 +28843,7 @@ function reconcileVscodeWorkspaceFolders(workspacePath, codeWorkspaceFolders, la
|
|
|
28809
28843
|
const currentAbsPaths = new Set(currentReposByAbsPath.keys());
|
|
28810
28844
|
const added = [];
|
|
28811
28845
|
const removed = [];
|
|
28846
|
+
const renamed2 = [];
|
|
28812
28847
|
const updatedRepos = [];
|
|
28813
28848
|
for (const [absPath, repo] of currentReposByAbsPath) {
|
|
28814
28849
|
const inLastSync = lastSyncedSet.has(absPath);
|
|
@@ -28816,7 +28851,18 @@ function reconcileVscodeWorkspaceFolders(workspacePath, codeWorkspaceFolders, la
|
|
|
28816
28851
|
if (inLastSync && !inCodeWorkspace) {
|
|
28817
28852
|
removed.push(repo.path);
|
|
28818
28853
|
} else {
|
|
28819
|
-
|
|
28854
|
+
const folderName = codeWorkspaceNames.get(absPath);
|
|
28855
|
+
if (folderName !== repo.name) {
|
|
28856
|
+
const { name: _name, ...repoWithoutName } = repo;
|
|
28857
|
+
const updatedRepo = folderName === undefined ? { ...repoWithoutName } : { ...repo };
|
|
28858
|
+
if (folderName !== undefined) {
|
|
28859
|
+
updatedRepo.name = folderName;
|
|
28860
|
+
}
|
|
28861
|
+
updatedRepos.push(updatedRepo);
|
|
28862
|
+
renamed2.push(repo.path);
|
|
28863
|
+
} else {
|
|
28864
|
+
updatedRepos.push(repo);
|
|
28865
|
+
}
|
|
28820
28866
|
}
|
|
28821
28867
|
}
|
|
28822
28868
|
for (const absPath of codeWorkspaceAbsPaths) {
|
|
@@ -28832,7 +28878,7 @@ function reconcileVscodeWorkspaceFolders(workspacePath, codeWorkspaceFolders, la
|
|
|
28832
28878
|
updatedRepos.push(newRepo);
|
|
28833
28879
|
}
|
|
28834
28880
|
}
|
|
28835
|
-
return { updatedRepos, added, removed };
|
|
28881
|
+
return { updatedRepos, added, removed, renamed: renamed2 };
|
|
28836
28882
|
}
|
|
28837
28883
|
var DEFAULT_SETTINGS;
|
|
28838
28884
|
var init_vscode_workspace = __esm(() => {
|
|
@@ -28842,8 +28888,8 @@ var init_vscode_workspace = __esm(() => {
|
|
|
28842
28888
|
});
|
|
28843
28889
|
|
|
28844
28890
|
// src/core/vscode-mcp.ts
|
|
28845
|
-
import { existsSync as
|
|
28846
|
-
import { join as
|
|
28891
|
+
import { existsSync as existsSync12, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
28892
|
+
import { join as join15, dirname as dirname7 } from "node:path";
|
|
28847
28893
|
function deepEqual(a, b) {
|
|
28848
28894
|
if (a === b)
|
|
28849
28895
|
return true;
|
|
@@ -28875,17 +28921,17 @@ function getVscodeMcpConfigPath() {
|
|
|
28875
28921
|
if (!appData) {
|
|
28876
28922
|
throw new Error("APPDATA environment variable not set");
|
|
28877
28923
|
}
|
|
28878
|
-
return
|
|
28924
|
+
return join15(appData, "Code", "User", "mcp.json");
|
|
28879
28925
|
}
|
|
28880
28926
|
const home = getHomeDir();
|
|
28881
28927
|
if (platform2 === "darwin") {
|
|
28882
|
-
return
|
|
28928
|
+
return join15(home, "Library", "Application Support", "Code", "User", "mcp.json");
|
|
28883
28929
|
}
|
|
28884
|
-
return
|
|
28930
|
+
return join15(home, ".config", "Code", "User", "mcp.json");
|
|
28885
28931
|
}
|
|
28886
28932
|
function readPluginMcpConfig(pluginPath) {
|
|
28887
|
-
const mcpPath =
|
|
28888
|
-
if (!
|
|
28933
|
+
const mcpPath = join15(pluginPath, ".mcp.json");
|
|
28934
|
+
if (!existsSync12(mcpPath)) {
|
|
28889
28935
|
return null;
|
|
28890
28936
|
}
|
|
28891
28937
|
try {
|
|
@@ -28936,7 +28982,7 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
|
|
|
28936
28982
|
trackedServers: []
|
|
28937
28983
|
};
|
|
28938
28984
|
let existingConfig = {};
|
|
28939
|
-
if (
|
|
28985
|
+
if (existsSync12(configPath)) {
|
|
28940
28986
|
try {
|
|
28941
28987
|
const content = readFileSync(configPath, "utf-8");
|
|
28942
28988
|
existingConfig = import_json5.default.parse(content);
|
|
@@ -28987,7 +29033,7 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
|
|
|
28987
29033
|
if (hasChanges && !dryRun) {
|
|
28988
29034
|
existingConfig.servers = existingServers;
|
|
28989
29035
|
const dir = dirname7(configPath);
|
|
28990
|
-
if (!
|
|
29036
|
+
if (!existsSync12(dir)) {
|
|
28991
29037
|
mkdirSync(dir, { recursive: true });
|
|
28992
29038
|
}
|
|
28993
29039
|
writeFileSync(configPath, `${JSON.stringify(existingConfig, null, 2)}
|
|
@@ -29005,7 +29051,7 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
|
|
|
29005
29051
|
if (result.removed > 0 && !dryRun) {
|
|
29006
29052
|
existingConfig.servers = existingServers;
|
|
29007
29053
|
const dir = dirname7(configPath);
|
|
29008
|
-
if (!
|
|
29054
|
+
if (!existsSync12(dir)) {
|
|
29009
29055
|
mkdirSync(dir, { recursive: true });
|
|
29010
29056
|
}
|
|
29011
29057
|
writeFileSync(configPath, `${JSON.stringify(existingConfig, null, 2)}
|
|
@@ -29074,7 +29120,7 @@ function mergeNativeSyncResults(results) {
|
|
|
29074
29120
|
var init_types2 = () => {};
|
|
29075
29121
|
|
|
29076
29122
|
// src/core/codex-mcp.ts
|
|
29077
|
-
import { existsSync as
|
|
29123
|
+
import { existsSync as existsSync13, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
29078
29124
|
import { dirname as dirname8 } from "node:path";
|
|
29079
29125
|
function buildCodexMcpAddArgs(name, config) {
|
|
29080
29126
|
if (typeof config.url === "string") {
|
|
@@ -29285,7 +29331,7 @@ function syncCodexProjectMcpConfig(validatedPlugins, options2) {
|
|
|
29285
29331
|
trackedServers: []
|
|
29286
29332
|
};
|
|
29287
29333
|
let existingContent = "";
|
|
29288
|
-
if (
|
|
29334
|
+
if (existsSync13(configPath)) {
|
|
29289
29335
|
try {
|
|
29290
29336
|
existingContent = readFileSync2(configPath, "utf-8");
|
|
29291
29337
|
} catch {
|
|
@@ -29341,7 +29387,7 @@ function syncCodexProjectMcpConfig(validatedPlugins, options2) {
|
|
|
29341
29387
|
`)}
|
|
29342
29388
|
`;
|
|
29343
29389
|
const dir = dirname8(configPath);
|
|
29344
|
-
if (!
|
|
29390
|
+
if (!existsSync13(dir)) {
|
|
29345
29391
|
mkdirSync2(dir, { recursive: true });
|
|
29346
29392
|
}
|
|
29347
29393
|
writeFileSync2(configPath, output, "utf-8");
|
|
@@ -29355,7 +29401,7 @@ var init_codex_mcp = __esm(() => {
|
|
|
29355
29401
|
});
|
|
29356
29402
|
|
|
29357
29403
|
// src/core/claude-mcp.ts
|
|
29358
|
-
import { existsSync as
|
|
29404
|
+
import { existsSync as existsSync14, readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "node:fs";
|
|
29359
29405
|
import { dirname as dirname9 } from "node:path";
|
|
29360
29406
|
function deepEqual2(a, b) {
|
|
29361
29407
|
if (a === b)
|
|
@@ -29423,7 +29469,7 @@ function syncClaudeMcpConfig(validatedPlugins, options2) {
|
|
|
29423
29469
|
trackedServers: []
|
|
29424
29470
|
};
|
|
29425
29471
|
let existingConfig = {};
|
|
29426
|
-
if (
|
|
29472
|
+
if (existsSync14(configPath)) {
|
|
29427
29473
|
try {
|
|
29428
29474
|
const content = readFileSync3(configPath, "utf-8");
|
|
29429
29475
|
existingConfig = import_json52.default.parse(content);
|
|
@@ -29474,7 +29520,7 @@ function syncClaudeMcpConfig(validatedPlugins, options2) {
|
|
|
29474
29520
|
if (hasChanges && !dryRun) {
|
|
29475
29521
|
existingConfig.mcpServers = existingServers;
|
|
29476
29522
|
const dir = dirname9(configPath);
|
|
29477
|
-
if (!
|
|
29523
|
+
if (!existsSync14(dir)) {
|
|
29478
29524
|
mkdirSync3(dir, { recursive: true });
|
|
29479
29525
|
}
|
|
29480
29526
|
writeFileSync3(configPath, `${JSON.stringify(existingConfig, null, 2)}
|
|
@@ -29492,7 +29538,7 @@ function syncClaudeMcpConfig(validatedPlugins, options2) {
|
|
|
29492
29538
|
if (result.removed > 0 && !dryRun) {
|
|
29493
29539
|
existingConfig.mcpServers = existingServers;
|
|
29494
29540
|
const dir = dirname9(configPath);
|
|
29495
|
-
if (!
|
|
29541
|
+
if (!existsSync14(dir)) {
|
|
29496
29542
|
mkdirSync3(dir, { recursive: true });
|
|
29497
29543
|
}
|
|
29498
29544
|
writeFileSync3(configPath, `${JSON.stringify(existingConfig, null, 2)}
|
|
@@ -29591,9 +29637,9 @@ var init_claude_mcp = __esm(() => {
|
|
|
29591
29637
|
});
|
|
29592
29638
|
|
|
29593
29639
|
// src/core/copilot-mcp.ts
|
|
29594
|
-
import { join as
|
|
29640
|
+
import { join as join16 } from "node:path";
|
|
29595
29641
|
function getCopilotMcpConfigPath() {
|
|
29596
|
-
return
|
|
29642
|
+
return join16(getHomeDir(), ".copilot", "mcp-config.json");
|
|
29597
29643
|
}
|
|
29598
29644
|
var init_copilot_mcp = __esm(() => {
|
|
29599
29645
|
init_constants();
|
|
@@ -29891,9 +29937,9 @@ function padStart2(str3, len) {
|
|
|
29891
29937
|
}
|
|
29892
29938
|
|
|
29893
29939
|
// src/core/sync.ts
|
|
29894
|
-
import { existsSync as
|
|
29940
|
+
import { existsSync as existsSync15, readFileSync as readFileSync4, writeFileSync as writeFileSync4, lstatSync } from "node:fs";
|
|
29895
29941
|
import { rm as rm4, unlink as unlink2, rmdir, copyFile } from "node:fs/promises";
|
|
29896
|
-
import { join as
|
|
29942
|
+
import { join as join17, resolve as resolve9, dirname as dirname10, relative as relative4 } from "node:path";
|
|
29897
29943
|
function deduplicateClientsByPath(clients, clientMappings = CLIENT_MAPPINGS) {
|
|
29898
29944
|
const pathToClients = new Map;
|
|
29899
29945
|
for (const client of clients) {
|
|
@@ -30007,7 +30053,7 @@ async function selectivePurgeWorkspace(workspacePath, state, clients) {
|
|
|
30007
30053
|
const previousFiles = getPreviouslySyncedFiles(state, client);
|
|
30008
30054
|
const purgedPaths = [];
|
|
30009
30055
|
for (const filePath of previousFiles) {
|
|
30010
|
-
const fullPath =
|
|
30056
|
+
const fullPath = join17(workspacePath, filePath);
|
|
30011
30057
|
const cleanPath = fullPath.replace(/\/$/, "");
|
|
30012
30058
|
let stats;
|
|
30013
30059
|
try {
|
|
@@ -30036,8 +30082,8 @@ async function selectivePurgeWorkspace(workspacePath, state, clients) {
|
|
|
30036
30082
|
async function cleanupEmptyParents(workspacePath, filePath) {
|
|
30037
30083
|
let parentPath = dirname10(filePath);
|
|
30038
30084
|
while (parentPath && parentPath !== "." && parentPath !== "/") {
|
|
30039
|
-
const fullParentPath =
|
|
30040
|
-
if (!
|
|
30085
|
+
const fullParentPath = join17(workspacePath, parentPath);
|
|
30086
|
+
if (!existsSync15(fullParentPath)) {
|
|
30041
30087
|
parentPath = dirname10(parentPath);
|
|
30042
30088
|
continue;
|
|
30043
30089
|
}
|
|
@@ -30122,8 +30168,8 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
|
|
|
30122
30168
|
errors2.push(`Cannot resolve file '${file}' - no workspace.source configured`);
|
|
30123
30169
|
continue;
|
|
30124
30170
|
}
|
|
30125
|
-
const fullPath =
|
|
30126
|
-
if (!
|
|
30171
|
+
const fullPath = join17(defaultSourcePath, file);
|
|
30172
|
+
if (!existsSync15(fullPath)) {
|
|
30127
30173
|
errors2.push(`File source not found: ${fullPath}`);
|
|
30128
30174
|
}
|
|
30129
30175
|
continue;
|
|
@@ -30141,8 +30187,8 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
|
|
|
30141
30187
|
errors2.push(`GitHub cache not found for ${cacheKey}`);
|
|
30142
30188
|
continue;
|
|
30143
30189
|
}
|
|
30144
|
-
const fullPath =
|
|
30145
|
-
if (!
|
|
30190
|
+
const fullPath = join17(cachePath, parsed.filePath);
|
|
30191
|
+
if (!existsSync15(fullPath)) {
|
|
30146
30192
|
errors2.push(`Path not found in repository: ${cacheKey}/${parsed.filePath}`);
|
|
30147
30193
|
}
|
|
30148
30194
|
} else {
|
|
@@ -30152,11 +30198,11 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
|
|
|
30152
30198
|
} else if (file.source.startsWith("../")) {
|
|
30153
30199
|
fullPath = resolve9(file.source);
|
|
30154
30200
|
} else if (defaultSourcePath) {
|
|
30155
|
-
fullPath =
|
|
30201
|
+
fullPath = join17(defaultSourcePath, file.source);
|
|
30156
30202
|
} else {
|
|
30157
30203
|
fullPath = resolve9(file.source);
|
|
30158
30204
|
}
|
|
30159
|
-
if (!
|
|
30205
|
+
if (!existsSync15(fullPath)) {
|
|
30160
30206
|
errors2.push(`File source not found: ${fullPath}`);
|
|
30161
30207
|
}
|
|
30162
30208
|
}
|
|
@@ -30165,8 +30211,8 @@ function validateFileSources(files, defaultSourcePath, githubCache) {
|
|
|
30165
30211
|
errors2.push(`Cannot resolve file '${file.dest}' - no workspace.source configured and no explicit source provided`);
|
|
30166
30212
|
continue;
|
|
30167
30213
|
}
|
|
30168
|
-
const fullPath =
|
|
30169
|
-
if (!
|
|
30214
|
+
const fullPath = join17(defaultSourcePath, file.dest ?? "");
|
|
30215
|
+
if (!existsSync15(fullPath)) {
|
|
30170
30216
|
errors2.push(`File source not found: ${fullPath}`);
|
|
30171
30217
|
}
|
|
30172
30218
|
}
|
|
@@ -30312,7 +30358,7 @@ async function validatePlugin(pluginSource, workspacePath, offline) {
|
|
|
30312
30358
|
...fetchResult.error && { error: fetchResult.error }
|
|
30313
30359
|
};
|
|
30314
30360
|
}
|
|
30315
|
-
const resolvedPath2 = parsed?.subpath ?
|
|
30361
|
+
const resolvedPath2 = parsed?.subpath ? join17(fetchResult.cachePath, parsed.subpath) : fetchResult.cachePath;
|
|
30316
30362
|
return {
|
|
30317
30363
|
plugin: pluginSource,
|
|
30318
30364
|
resolved: resolvedPath2,
|
|
@@ -30322,7 +30368,7 @@ async function validatePlugin(pluginSource, workspacePath, offline) {
|
|
|
30322
30368
|
};
|
|
30323
30369
|
}
|
|
30324
30370
|
const resolvedPath = resolve9(workspacePath, pluginSource);
|
|
30325
|
-
if (!
|
|
30371
|
+
if (!existsSync15(resolvedPath)) {
|
|
30326
30372
|
return {
|
|
30327
30373
|
plugin: pluginSource,
|
|
30328
30374
|
resolved: resolvedPath,
|
|
@@ -30483,10 +30529,10 @@ function buildPluginSkillNameMaps(allSkills) {
|
|
|
30483
30529
|
return pluginMaps;
|
|
30484
30530
|
}
|
|
30485
30531
|
function generateVscodeWorkspaceFile(workspacePath, config) {
|
|
30486
|
-
const configDir =
|
|
30487
|
-
const templatePath =
|
|
30532
|
+
const configDir = join17(workspacePath, CONFIG_DIR);
|
|
30533
|
+
const templatePath = join17(configDir, VSCODE_TEMPLATE_FILE);
|
|
30488
30534
|
let template;
|
|
30489
|
-
if (
|
|
30535
|
+
if (existsSync15(templatePath)) {
|
|
30490
30536
|
try {
|
|
30491
30537
|
template = import_json53.default.parse(readFileSync4(templatePath, "utf-8"));
|
|
30492
30538
|
} catch (error) {
|
|
@@ -30633,7 +30679,7 @@ async function syncVscodeWorkspaceFile(workspacePath, config, configPath, previo
|
|
|
30633
30679
|
let updatedConfig = config;
|
|
30634
30680
|
if (previousState?.vscodeWorkspaceHash && previousState?.vscodeWorkspaceRepos) {
|
|
30635
30681
|
const outputPath = getWorkspaceOutputPath(workspacePath, config.vscode);
|
|
30636
|
-
if (
|
|
30682
|
+
if (existsSync15(outputPath)) {
|
|
30637
30683
|
const existingContent = readFileSync4(outputPath, "utf-8");
|
|
30638
30684
|
const currentHash = computeWorkspaceHash(existingContent);
|
|
30639
30685
|
if (currentHash !== previousState.vscodeWorkspaceHash) {
|
|
@@ -30641,8 +30687,11 @@ async function syncVscodeWorkspaceFile(workspacePath, config, configPath, previo
|
|
|
30641
30687
|
const existingWorkspace = JSON.parse(existingContent);
|
|
30642
30688
|
const folders = Array.isArray(existingWorkspace.folders) ? existingWorkspace.folders : [];
|
|
30643
30689
|
const reconciled = reconcileVscodeWorkspaceFolders(workspacePath, folders, previousState.vscodeWorkspaceRepos, config.repositories);
|
|
30644
|
-
if (reconciled.added.length > 0 || reconciled.removed.length > 0) {
|
|
30645
|
-
await updateRepositories({ remove: reconciled.removed, add: reconciled.added.map((p) => ({ path: p })) }, workspacePath);
|
|
30690
|
+
if (reconciled.added.length > 0 || reconciled.removed.length > 0 || reconciled.renamed.length > 0) {
|
|
30691
|
+
const updateResult = reconciled.renamed.length > 0 ? await setRepositories(reconciled.updatedRepos, workspacePath) : await updateRepositories({ remove: reconciled.removed, add: reconciled.added.map((p) => ({ path: p })) }, workspacePath);
|
|
30692
|
+
if (!updateResult.success) {
|
|
30693
|
+
throw new Error(updateResult.error ?? "Failed to update repositories");
|
|
30694
|
+
}
|
|
30646
30695
|
updatedConfig = await parseWorkspaceConfig(configPath);
|
|
30647
30696
|
if (reconciled.removed.length > 0) {
|
|
30648
30697
|
messages.push(`Repositories removed (from .code-workspace): ${reconciled.removed.join(", ")}`);
|
|
@@ -30650,6 +30699,9 @@ async function syncVscodeWorkspaceFile(workspacePath, config, configPath, previo
|
|
|
30650
30699
|
if (reconciled.added.length > 0) {
|
|
30651
30700
|
messages.push(`Repositories added (from .code-workspace): ${reconciled.added.join(", ")}`);
|
|
30652
30701
|
}
|
|
30702
|
+
if (reconciled.renamed.length > 0) {
|
|
30703
|
+
messages.push(`Repository names updated (from .code-workspace): ${reconciled.renamed.join(", ")}`);
|
|
30704
|
+
}
|
|
30653
30705
|
}
|
|
30654
30706
|
} catch {}
|
|
30655
30707
|
}
|
|
@@ -30691,9 +30743,9 @@ async function syncWorkspace(workspacePath = process.cwd(), options2 = {}) {
|
|
|
30691
30743
|
await migrateWorkspaceSkillsV1toV2(workspacePath);
|
|
30692
30744
|
const { offline = false, dryRun = false, workspaceSourceBase, skipAgentFiles = false } = options2;
|
|
30693
30745
|
const sw = new Stopwatch;
|
|
30694
|
-
const configDir =
|
|
30695
|
-
const configPath =
|
|
30696
|
-
if (!
|
|
30746
|
+
const configDir = join17(workspacePath, CONFIG_DIR);
|
|
30747
|
+
const configPath = join17(configDir, WORKSPACE_CONFIG_FILE);
|
|
30748
|
+
if (!existsSync15(configPath)) {
|
|
30697
30749
|
return failedSyncResult(`${CONFIG_DIR}/${WORKSPACE_CONFIG_FILE} not found in ${workspacePath}
|
|
30698
30750
|
Run 'allagents workspace init <path>' to create a new workspace`);
|
|
30699
30751
|
}
|
|
@@ -30782,8 +30834,8 @@ ${failedValidations.map((v) => ` - ${v.plugin}: ${v.error}`).join(`
|
|
|
30782
30834
|
const filesToCopy = [...config.workspace.files];
|
|
30783
30835
|
if (hasRepositories && sourcePath) {
|
|
30784
30836
|
for (const agentFile of AGENT_FILES) {
|
|
30785
|
-
const agentPath =
|
|
30786
|
-
if (
|
|
30837
|
+
const agentPath = join17(sourcePath, agentFile);
|
|
30838
|
+
if (existsSync15(agentPath) && !filesToCopy.includes(agentFile)) {
|
|
30787
30839
|
filesToCopy.push(agentFile);
|
|
30788
30840
|
}
|
|
30789
30841
|
}
|
|
@@ -30807,10 +30859,10 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
|
|
|
30807
30859
|
}
|
|
30808
30860
|
workspaceFileResults = await copyWorkspaceFiles(sourcePath, workspacePath, filesToCopy, { dryRun, githubCache, repositories: config.repositories });
|
|
30809
30861
|
if (hasRepositories && !dryRun && syncClients.includes("claude") && sourcePath) {
|
|
30810
|
-
const claudePath =
|
|
30811
|
-
const agentsPath =
|
|
30812
|
-
const claudeExistsInSource =
|
|
30813
|
-
if (!claudeExistsInSource &&
|
|
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)) {
|
|
30814
30866
|
await copyFile(agentsPath, claudePath);
|
|
30815
30867
|
}
|
|
30816
30868
|
}
|
|
@@ -30831,7 +30883,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
|
|
|
30831
30883
|
const mcpResults = {};
|
|
30832
30884
|
if (syncClients.includes("vscode")) {
|
|
30833
30885
|
const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "vscode");
|
|
30834
|
-
const projectMcpPath =
|
|
30886
|
+
const projectMcpPath = join17(workspacePath, ".vscode", "mcp.json");
|
|
30835
30887
|
const vscodeMcp = syncVscodeMcpConfig(validPlugins, {
|
|
30836
30888
|
dryRun,
|
|
30837
30889
|
force: false,
|
|
@@ -30845,7 +30897,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
|
|
|
30845
30897
|
}
|
|
30846
30898
|
if (syncClients.includes("claude")) {
|
|
30847
30899
|
const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "claude");
|
|
30848
|
-
const projectMcpJsonPath =
|
|
30900
|
+
const projectMcpJsonPath = join17(workspacePath, ".mcp.json");
|
|
30849
30901
|
const claudeMcp = syncClaudeMcpConfig(validPlugins, {
|
|
30850
30902
|
dryRun,
|
|
30851
30903
|
force: false,
|
|
@@ -30859,7 +30911,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
|
|
|
30859
30911
|
}
|
|
30860
30912
|
if (syncClients.includes("codex")) {
|
|
30861
30913
|
const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "codex");
|
|
30862
|
-
const projectCodexConfigPath =
|
|
30914
|
+
const projectCodexConfigPath = join17(workspacePath, ".codex", "config.toml");
|
|
30863
30915
|
const codexMcp = syncCodexProjectMcpConfig(validPlugins, {
|
|
30864
30916
|
dryRun,
|
|
30865
30917
|
force: false,
|
|
@@ -30873,7 +30925,7 @@ ${fileValidationErrors.map((e) => ` - ${e}`).join(`
|
|
|
30873
30925
|
}
|
|
30874
30926
|
if (syncClients.includes("copilot")) {
|
|
30875
30927
|
const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "copilot");
|
|
30876
|
-
const projectCopilotMcpPath =
|
|
30928
|
+
const projectCopilotMcpPath = join17(workspacePath, ".copilot", "mcp-config.json");
|
|
30877
30929
|
const copilotMcp = syncClaudeMcpConfig(validPlugins, {
|
|
30878
30930
|
dryRun,
|
|
30879
30931
|
force: false,
|
|
@@ -30943,7 +30995,7 @@ async function seedFetchCacheFromMarketplaces(results) {
|
|
|
30943
30995
|
}
|
|
30944
30996
|
function readGitBranch(repoPath) {
|
|
30945
30997
|
try {
|
|
30946
|
-
const head = readFileSync4(
|
|
30998
|
+
const head = readFileSync4(join17(repoPath, ".git", "HEAD"), "utf-8").trim();
|
|
30947
30999
|
const prefix = "ref: refs/heads/";
|
|
30948
31000
|
return head.startsWith(prefix) ? head.slice(prefix.length) : null;
|
|
30949
31001
|
} catch {
|
|
@@ -31107,11 +31159,11 @@ var init_sync = __esm(() => {
|
|
|
31107
31159
|
});
|
|
31108
31160
|
|
|
31109
31161
|
// src/core/github-fetch.ts
|
|
31110
|
-
import { existsSync as
|
|
31111
|
-
import { join as
|
|
31162
|
+
import { existsSync as existsSync16, readFileSync as readFileSync5 } from "node:fs";
|
|
31163
|
+
import { join as join18 } from "node:path";
|
|
31112
31164
|
function readFileFromClone(tempDir, filePath) {
|
|
31113
|
-
const fullPath =
|
|
31114
|
-
if (
|
|
31165
|
+
const fullPath = join18(tempDir, filePath);
|
|
31166
|
+
if (existsSync16(fullPath)) {
|
|
31115
31167
|
return readFileSync5(fullPath, "utf-8");
|
|
31116
31168
|
}
|
|
31117
31169
|
return null;
|
|
@@ -31210,15 +31262,15 @@ var init_github_fetch = __esm(() => {
|
|
|
31210
31262
|
});
|
|
31211
31263
|
|
|
31212
31264
|
// src/core/workspace.ts
|
|
31213
|
-
import { cp as cp2, mkdir as mkdir8, readFile as
|
|
31214
|
-
import { existsSync as
|
|
31215
|
-
import { join as
|
|
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";
|
|
31216
31268
|
import { fileURLToPath } from "node:url";
|
|
31217
31269
|
async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
31218
31270
|
const absoluteTarget = resolve10(targetPath);
|
|
31219
|
-
const configDir =
|
|
31220
|
-
const configPath =
|
|
31221
|
-
if (
|
|
31271
|
+
const configDir = join19(absoluteTarget, CONFIG_DIR);
|
|
31272
|
+
const configPath = join19(configDir, WORKSPACE_CONFIG_FILE);
|
|
31273
|
+
if (existsSync17(configPath)) {
|
|
31222
31274
|
if (options2.force) {
|
|
31223
31275
|
await unlink3(configPath);
|
|
31224
31276
|
} else {
|
|
@@ -31229,7 +31281,7 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
|
31229
31281
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
31230
31282
|
const currentFileDir = dirname11(currentFilePath);
|
|
31231
31283
|
const isProduction = currentFilePath.includes(`${sep2}dist${sep2}`);
|
|
31232
|
-
const defaultTemplatePath = isProduction ?
|
|
31284
|
+
const defaultTemplatePath = isProduction ? join19(currentFileDir, "templates", "default") : join19(currentFileDir, "..", "templates", "default");
|
|
31233
31285
|
let githubTempDir;
|
|
31234
31286
|
let parsedFromUrl;
|
|
31235
31287
|
let githubBasePath = "";
|
|
@@ -31237,6 +31289,7 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
|
31237
31289
|
try {
|
|
31238
31290
|
await mkdir8(absoluteTarget, { recursive: true });
|
|
31239
31291
|
await mkdir8(configDir, { recursive: true });
|
|
31292
|
+
await ensureConfigGitignore(absoluteTarget);
|
|
31240
31293
|
let workspaceYamlContent;
|
|
31241
31294
|
let sourceDir;
|
|
31242
31295
|
if (options2.from) {
|
|
@@ -31268,19 +31321,19 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
|
31268
31321
|
console.log(`✓ Using workspace.yaml from: ${options2.from}`);
|
|
31269
31322
|
} else {
|
|
31270
31323
|
const fromPath = resolve10(options2.from);
|
|
31271
|
-
if (!
|
|
31324
|
+
if (!existsSync17(fromPath)) {
|
|
31272
31325
|
throw new Error(`Template not found: ${fromPath}`);
|
|
31273
31326
|
}
|
|
31274
31327
|
const { stat: stat2 } = await import("node:fs/promises");
|
|
31275
31328
|
const fromStat = await stat2(fromPath);
|
|
31276
31329
|
let sourceYamlPath;
|
|
31277
31330
|
if (fromStat.isDirectory()) {
|
|
31278
|
-
const nestedPath =
|
|
31279
|
-
const rootPath =
|
|
31280
|
-
if (
|
|
31331
|
+
const nestedPath = join19(fromPath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
31332
|
+
const rootPath = join19(fromPath, WORKSPACE_CONFIG_FILE);
|
|
31333
|
+
if (existsSync17(nestedPath)) {
|
|
31281
31334
|
sourceYamlPath = nestedPath;
|
|
31282
31335
|
sourceDir = fromPath;
|
|
31283
|
-
} else if (
|
|
31336
|
+
} else if (existsSync17(rootPath)) {
|
|
31284
31337
|
sourceYamlPath = rootPath;
|
|
31285
31338
|
sourceDir = fromPath;
|
|
31286
31339
|
} else {
|
|
@@ -31296,7 +31349,7 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
|
31296
31349
|
sourceDir = parentDir;
|
|
31297
31350
|
}
|
|
31298
31351
|
}
|
|
31299
|
-
workspaceYamlContent = await
|
|
31352
|
+
workspaceYamlContent = await readFile11(sourceYamlPath, "utf-8");
|
|
31300
31353
|
if (sourceDir) {
|
|
31301
31354
|
const parsed2 = load(workspaceYamlContent);
|
|
31302
31355
|
const workspace = parsed2?.workspace;
|
|
@@ -31311,36 +31364,36 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
|
31311
31364
|
console.log(`✓ Using workspace.yaml from: ${sourceYamlPath}`);
|
|
31312
31365
|
}
|
|
31313
31366
|
} else {
|
|
31314
|
-
const defaultYamlPath =
|
|
31315
|
-
if (!
|
|
31367
|
+
const defaultYamlPath = join19(defaultTemplatePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
31368
|
+
if (!existsSync17(defaultYamlPath)) {
|
|
31316
31369
|
throw new Error(`Default template not found at: ${defaultTemplatePath}`);
|
|
31317
31370
|
}
|
|
31318
|
-
workspaceYamlContent = await
|
|
31371
|
+
workspaceYamlContent = await readFile11(defaultYamlPath, "utf-8");
|
|
31319
31372
|
}
|
|
31320
31373
|
if (options2.clients && options2.clients.length > 0) {
|
|
31321
31374
|
const configParsed = load(workspaceYamlContent);
|
|
31322
31375
|
configParsed.clients = options2.clients;
|
|
31323
31376
|
workspaceYamlContent = dump(configParsed, { lineWidth: -1 });
|
|
31324
31377
|
}
|
|
31325
|
-
await
|
|
31378
|
+
await writeFile8(configPath, workspaceYamlContent, "utf-8");
|
|
31326
31379
|
const parsed = load(workspaceYamlContent);
|
|
31327
31380
|
const clients = parsed?.clients ?? [];
|
|
31328
31381
|
const clientNames = getClientTypes(clients);
|
|
31329
31382
|
const VSCODE_TEMPLATE_FILE2 = "template.code-workspace";
|
|
31330
31383
|
if (clientNames.includes("vscode") && options2.from) {
|
|
31331
|
-
const targetTemplatePath =
|
|
31332
|
-
if (!
|
|
31384
|
+
const targetTemplatePath = join19(configDir, VSCODE_TEMPLATE_FILE2);
|
|
31385
|
+
if (!existsSync17(targetTemplatePath)) {
|
|
31333
31386
|
if (isGitHubUrl(options2.from) && githubTempDir) {
|
|
31334
31387
|
if (parsedFromUrl) {
|
|
31335
31388
|
const templatePath = githubBasePath ? `${githubBasePath}/${CONFIG_DIR}/${VSCODE_TEMPLATE_FILE2}` : `${CONFIG_DIR}/${VSCODE_TEMPLATE_FILE2}`;
|
|
31336
31389
|
const templateContent = readFileFromClone(githubTempDir, templatePath);
|
|
31337
31390
|
if (templateContent) {
|
|
31338
|
-
await
|
|
31391
|
+
await writeFile8(targetTemplatePath, templateContent, "utf-8");
|
|
31339
31392
|
}
|
|
31340
31393
|
}
|
|
31341
31394
|
} else if (sourceDir) {
|
|
31342
|
-
const sourceTemplatePath =
|
|
31343
|
-
if (
|
|
31395
|
+
const sourceTemplatePath = join19(sourceDir, CONFIG_DIR, VSCODE_TEMPLATE_FILE2);
|
|
31396
|
+
if (existsSync17(sourceTemplatePath)) {
|
|
31344
31397
|
await copyFile2(sourceTemplatePath, targetTemplatePath);
|
|
31345
31398
|
}
|
|
31346
31399
|
}
|
|
@@ -31353,15 +31406,15 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
|
31353
31406
|
if (options2.from && isGitHubUrl(options2.from) && githubTempDir) {
|
|
31354
31407
|
if (parsedFromUrl) {
|
|
31355
31408
|
for (const agentFile of AGENT_FILES) {
|
|
31356
|
-
const targetFilePath =
|
|
31357
|
-
if (
|
|
31409
|
+
const targetFilePath = join19(absoluteTarget, agentFile);
|
|
31410
|
+
if (existsSync17(targetFilePath)) {
|
|
31358
31411
|
copiedAgentFiles.push(agentFile);
|
|
31359
31412
|
continue;
|
|
31360
31413
|
}
|
|
31361
31414
|
const filePath = githubBasePath ? `${githubBasePath}/${agentFile}` : agentFile;
|
|
31362
31415
|
const content = readFileFromClone(githubTempDir, filePath);
|
|
31363
31416
|
if (content) {
|
|
31364
|
-
await
|
|
31417
|
+
await writeFile8(targetFilePath, content, "utf-8");
|
|
31365
31418
|
copiedAgentFiles.push(agentFile);
|
|
31366
31419
|
}
|
|
31367
31420
|
}
|
|
@@ -31369,30 +31422,30 @@ async function initWorkspace(targetPath = ".", options2 = {}) {
|
|
|
31369
31422
|
} else {
|
|
31370
31423
|
const effectiveSourceDir = sourceDir ?? defaultTemplatePath;
|
|
31371
31424
|
for (const agentFile of AGENT_FILES) {
|
|
31372
|
-
const targetFilePath =
|
|
31373
|
-
if (
|
|
31425
|
+
const targetFilePath = join19(absoluteTarget, agentFile);
|
|
31426
|
+
if (existsSync17(targetFilePath)) {
|
|
31374
31427
|
copiedAgentFiles.push(agentFile);
|
|
31375
31428
|
continue;
|
|
31376
31429
|
}
|
|
31377
|
-
const sourcePath =
|
|
31378
|
-
if (
|
|
31379
|
-
const content = await
|
|
31380
|
-
await
|
|
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");
|
|
31381
31434
|
copiedAgentFiles.push(agentFile);
|
|
31382
31435
|
}
|
|
31383
31436
|
}
|
|
31384
31437
|
}
|
|
31385
31438
|
if (copiedAgentFiles.length === 0) {
|
|
31386
|
-
await ensureWorkspaceRules(
|
|
31439
|
+
await ensureWorkspaceRules(join19(absoluteTarget, "AGENTS.md"), repositories);
|
|
31387
31440
|
copiedAgentFiles.push("AGENTS.md");
|
|
31388
31441
|
} else {
|
|
31389
31442
|
for (const agentFile of copiedAgentFiles) {
|
|
31390
|
-
await ensureWorkspaceRules(
|
|
31443
|
+
await ensureWorkspaceRules(join19(absoluteTarget, agentFile), repositories);
|
|
31391
31444
|
}
|
|
31392
31445
|
}
|
|
31393
31446
|
if (clientNames.includes("claude") && !copiedAgentFiles.includes("CLAUDE.md") && copiedAgentFiles.includes("AGENTS.md")) {
|
|
31394
|
-
const agentsPath =
|
|
31395
|
-
const claudePath =
|
|
31447
|
+
const agentsPath = join19(absoluteTarget, "AGENTS.md");
|
|
31448
|
+
const claudePath = join19(absoluteTarget, "CLAUDE.md");
|
|
31396
31449
|
await copyFile2(agentsPath, claudePath);
|
|
31397
31450
|
}
|
|
31398
31451
|
}
|
|
@@ -31437,14 +31490,14 @@ Next steps:`);
|
|
|
31437
31490
|
async function seedCacheFromClone(tempDir, owner, repo, branch) {
|
|
31438
31491
|
const cachePaths = [
|
|
31439
31492
|
getPluginCachePath(owner, repo, branch),
|
|
31440
|
-
|
|
31493
|
+
join19(getMarketplacesDir(), repo)
|
|
31441
31494
|
];
|
|
31442
31495
|
for (const cachePath of cachePaths) {
|
|
31443
|
-
if (
|
|
31496
|
+
if (existsSync17(cachePath))
|
|
31444
31497
|
continue;
|
|
31445
31498
|
try {
|
|
31446
31499
|
const parentDir = dirname11(cachePath);
|
|
31447
|
-
if (!
|
|
31500
|
+
if (!existsSync17(parentDir)) {
|
|
31448
31501
|
await mkdir8(parentDir, { recursive: true });
|
|
31449
31502
|
}
|
|
31450
31503
|
await cp2(tempDir, cachePath, { recursive: true });
|
|
@@ -31461,14 +31514,15 @@ var init_workspace = __esm(() => {
|
|
|
31461
31514
|
init_github_fetch();
|
|
31462
31515
|
init_git();
|
|
31463
31516
|
init_marketplace();
|
|
31517
|
+
init_config_gitignore();
|
|
31464
31518
|
});
|
|
31465
31519
|
|
|
31466
31520
|
// src/core/status.ts
|
|
31467
|
-
import { existsSync as
|
|
31468
|
-
import { join as
|
|
31521
|
+
import { existsSync as existsSync18 } from "node:fs";
|
|
31522
|
+
import { join as join20 } from "node:path";
|
|
31469
31523
|
async function getWorkspaceStatus(workspacePath = process.cwd()) {
|
|
31470
|
-
const configPath =
|
|
31471
|
-
if (!
|
|
31524
|
+
const configPath = join20(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
31525
|
+
if (!existsSync18(configPath) || isUserConfigPath(workspacePath)) {
|
|
31472
31526
|
const userPlugins = await getUserPluginStatuses();
|
|
31473
31527
|
return {
|
|
31474
31528
|
success: true,
|
|
@@ -31510,7 +31564,7 @@ async function getWorkspaceStatus(workspacePath = process.cwd()) {
|
|
|
31510
31564
|
function getPluginStatus(parsed) {
|
|
31511
31565
|
if (parsed.type === "github") {
|
|
31512
31566
|
const cachePath = parsed.owner && parsed.repo ? getPluginCachePath(parsed.owner, parsed.repo) : "";
|
|
31513
|
-
const available2 = cachePath ?
|
|
31567
|
+
const available2 = cachePath ? existsSync18(cachePath) : false;
|
|
31514
31568
|
return {
|
|
31515
31569
|
source: parsed.original,
|
|
31516
31570
|
type: "github",
|
|
@@ -31520,7 +31574,7 @@ function getPluginStatus(parsed) {
|
|
|
31520
31574
|
...parsed.repo && { repo: parsed.repo }
|
|
31521
31575
|
};
|
|
31522
31576
|
}
|
|
31523
|
-
const available =
|
|
31577
|
+
const available = existsSync18(parsed.normalized);
|
|
31524
31578
|
return {
|
|
31525
31579
|
source: parsed.original,
|
|
31526
31580
|
type: "local",
|
|
@@ -33657,9 +33711,9 @@ var init_prompt_clients = __esm(() => {
|
|
|
33657
33711
|
});
|
|
33658
33712
|
|
|
33659
33713
|
// src/core/skills.ts
|
|
33660
|
-
import { existsSync as
|
|
33661
|
-
import { readFile as
|
|
33662
|
-
import { join as
|
|
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";
|
|
33663
33717
|
async function resolvePluginPath(pluginSource, workspacePath) {
|
|
33664
33718
|
if (isPluginSpec(pluginSource)) {
|
|
33665
33719
|
const resolved2 = await resolvePluginSpecWithAutoRegister(pluginSource, {
|
|
@@ -33680,18 +33734,18 @@ async function resolvePluginPath(pluginSource, workspacePath) {
|
|
|
33680
33734
|
});
|
|
33681
33735
|
if (!result.success)
|
|
33682
33736
|
return null;
|
|
33683
|
-
const path = parsed?.subpath ?
|
|
33737
|
+
const path = parsed?.subpath ? join23(result.cachePath, parsed.subpath) : result.cachePath;
|
|
33684
33738
|
return { path };
|
|
33685
33739
|
}
|
|
33686
33740
|
const resolved = resolve12(workspacePath, pluginSource);
|
|
33687
|
-
return
|
|
33741
|
+
return existsSync21(resolved) ? { path: resolved } : null;
|
|
33688
33742
|
}
|
|
33689
33743
|
async function getAllSkillsFromPlugins(workspacePath = process.cwd()) {
|
|
33690
|
-
const configPath =
|
|
33691
|
-
if (!
|
|
33744
|
+
const configPath = join23(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
33745
|
+
if (!existsSync21(configPath)) {
|
|
33692
33746
|
return [];
|
|
33693
33747
|
}
|
|
33694
|
-
const content = await
|
|
33748
|
+
const content = await readFile13(configPath, "utf-8");
|
|
33695
33749
|
const config = load(content);
|
|
33696
33750
|
const isV1Fallback = config.version === undefined || config.version < 2;
|
|
33697
33751
|
const disabledSkills = isV1Fallback ? new Set(config.disabledSkills ?? []) : new Set;
|
|
@@ -33704,30 +33758,30 @@ async function getAllSkillsFromPlugins(workspacePath = process.cwd()) {
|
|
|
33704
33758
|
continue;
|
|
33705
33759
|
const pluginPath = resolved.path;
|
|
33706
33760
|
const pluginName = resolved.pluginName ?? getPluginName(pluginPath);
|
|
33707
|
-
const skillsDir =
|
|
33761
|
+
const skillsDir = join23(pluginPath, "skills");
|
|
33708
33762
|
const pluginSkillsConfig = typeof pluginEntry === "string" ? undefined : pluginEntry.skills;
|
|
33709
33763
|
const hasEnabledEntries = !pluginSkillsConfig && enabledSkills && [...enabledSkills].some((s) => s.startsWith(`${pluginName}`));
|
|
33710
33764
|
let skillEntries;
|
|
33711
|
-
if (
|
|
33765
|
+
if (existsSync21(skillsDir)) {
|
|
33712
33766
|
const entries = await readdir4(skillsDir, { withFileTypes: true });
|
|
33713
|
-
skillEntries = entries.filter((e) => e.isDirectory()).map((e) => ({ name: e.name, skillPath:
|
|
33767
|
+
skillEntries = entries.filter((e) => e.isDirectory()).map((e) => ({ name: e.name, skillPath: join23(skillsDir, e.name) }));
|
|
33714
33768
|
} else {
|
|
33715
33769
|
const entries = await readdir4(pluginPath, { withFileTypes: true });
|
|
33716
33770
|
const flatSkills = [];
|
|
33717
33771
|
for (const entry of entries) {
|
|
33718
33772
|
if (!entry.isDirectory())
|
|
33719
33773
|
continue;
|
|
33720
|
-
const skillMdPath =
|
|
33721
|
-
if (
|
|
33722
|
-
flatSkills.push({ name: entry.name, skillPath:
|
|
33774
|
+
const skillMdPath = join23(pluginPath, entry.name, "SKILL.md");
|
|
33775
|
+
if (existsSync21(skillMdPath)) {
|
|
33776
|
+
flatSkills.push({ name: entry.name, skillPath: join23(pluginPath, entry.name) });
|
|
33723
33777
|
}
|
|
33724
33778
|
}
|
|
33725
33779
|
if (flatSkills.length > 0) {
|
|
33726
33780
|
skillEntries = flatSkills;
|
|
33727
33781
|
} else {
|
|
33728
|
-
const rootSkillMd =
|
|
33729
|
-
if (
|
|
33730
|
-
const skillContent = await
|
|
33782
|
+
const rootSkillMd = join23(pluginPath, "SKILL.md");
|
|
33783
|
+
if (existsSync21(rootSkillMd)) {
|
|
33784
|
+
const skillContent = await readFile13(rootSkillMd, "utf-8");
|
|
33731
33785
|
const metadata = parseSkillMetadata(skillContent);
|
|
33732
33786
|
const skillName = metadata?.name ?? basename6(pluginPath);
|
|
33733
33787
|
skillEntries = [{ name: skillName, skillPath: pluginPath }];
|
|
@@ -33768,10 +33822,10 @@ async function findSkillByName(skillName, workspacePath = process.cwd()) {
|
|
|
33768
33822
|
return allSkills.filter((s) => s.name === skillName);
|
|
33769
33823
|
}
|
|
33770
33824
|
async function discoverSkillNames(pluginPath) {
|
|
33771
|
-
if (!
|
|
33825
|
+
if (!existsSync21(pluginPath))
|
|
33772
33826
|
return [];
|
|
33773
|
-
const skillsDir =
|
|
33774
|
-
if (
|
|
33827
|
+
const skillsDir = join23(pluginPath, "skills");
|
|
33828
|
+
if (existsSync21(skillsDir)) {
|
|
33775
33829
|
const entries2 = await readdir4(skillsDir, { withFileTypes: true });
|
|
33776
33830
|
return entries2.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
33777
33831
|
}
|
|
@@ -33780,16 +33834,16 @@ async function discoverSkillNames(pluginPath) {
|
|
|
33780
33834
|
for (const entry of entries) {
|
|
33781
33835
|
if (!entry.isDirectory())
|
|
33782
33836
|
continue;
|
|
33783
|
-
if (
|
|
33837
|
+
if (existsSync21(join23(pluginPath, entry.name, "SKILL.md"))) {
|
|
33784
33838
|
flatSkills.push(entry.name);
|
|
33785
33839
|
}
|
|
33786
33840
|
}
|
|
33787
33841
|
if (flatSkills.length > 0)
|
|
33788
33842
|
return flatSkills;
|
|
33789
|
-
const rootSkillMd =
|
|
33790
|
-
if (
|
|
33843
|
+
const rootSkillMd = join23(pluginPath, "SKILL.md");
|
|
33844
|
+
if (existsSync21(rootSkillMd)) {
|
|
33791
33845
|
try {
|
|
33792
|
-
const content = await
|
|
33846
|
+
const content = await readFile13(rootSkillMd, "utf-8");
|
|
33793
33847
|
const { parseSkillMetadata: parseSkillMetadata2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
|
|
33794
33848
|
const metadata = parseSkillMetadata2(content);
|
|
33795
33849
|
return [metadata?.name ?? basename6(pluginPath)];
|
|
@@ -34307,11 +34361,11 @@ var package_default;
|
|
|
34307
34361
|
var init_package = __esm(() => {
|
|
34308
34362
|
package_default = {
|
|
34309
34363
|
name: "allagents",
|
|
34310
|
-
version: "1.
|
|
34364
|
+
version: "1.5.0",
|
|
34311
34365
|
description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
|
|
34312
34366
|
type: "module",
|
|
34313
34367
|
bin: {
|
|
34314
|
-
allagents: "
|
|
34368
|
+
allagents: "dist/index.js"
|
|
34315
34369
|
},
|
|
34316
34370
|
files: [
|
|
34317
34371
|
"dist"
|
|
@@ -34353,7 +34407,7 @@ var init_package = __esm(() => {
|
|
|
34353
34407
|
license: "MIT",
|
|
34354
34408
|
repository: {
|
|
34355
34409
|
type: "git",
|
|
34356
|
-
url: "https://github.com/EntityProcess/allagents.git"
|
|
34410
|
+
url: "git+https://github.com/EntityProcess/allagents.git"
|
|
34357
34411
|
},
|
|
34358
34412
|
homepage: "https://allagents.dev",
|
|
34359
34413
|
dependencies: {
|
|
@@ -34387,13 +34441,13 @@ var init_package = __esm(() => {
|
|
|
34387
34441
|
});
|
|
34388
34442
|
|
|
34389
34443
|
// src/cli/update-check.ts
|
|
34390
|
-
import { readFile as
|
|
34391
|
-
import { join as
|
|
34444
|
+
import { readFile as readFile16 } from "node:fs/promises";
|
|
34445
|
+
import { join as join26 } from "node:path";
|
|
34392
34446
|
import { spawn as spawn3 } from "node:child_process";
|
|
34393
34447
|
async function getCachedUpdateInfo(path3) {
|
|
34394
|
-
const filePath = path3 ??
|
|
34448
|
+
const filePath = path3 ?? join26(getHomeDir(), CONFIG_DIR, CACHE_FILE);
|
|
34395
34449
|
try {
|
|
34396
|
-
const raw = await
|
|
34450
|
+
const raw = await readFile16(filePath, "utf-8");
|
|
34397
34451
|
const data = JSON.parse(raw);
|
|
34398
34452
|
if (typeof data.latestVersion === "string" && typeof data.lastCheckedAt === "string") {
|
|
34399
34453
|
return data;
|
|
@@ -34429,8 +34483,8 @@ function buildNotice(currentVersion, latestVersion) {
|
|
|
34429
34483
|
Run \`allagents self update\` to upgrade.`);
|
|
34430
34484
|
}
|
|
34431
34485
|
function backgroundUpdateCheck() {
|
|
34432
|
-
const dir =
|
|
34433
|
-
const filePath =
|
|
34486
|
+
const dir = join26(getHomeDir(), CONFIG_DIR);
|
|
34487
|
+
const filePath = join26(dir, CACHE_FILE);
|
|
34434
34488
|
const script = `
|
|
34435
34489
|
const https = require('https');
|
|
34436
34490
|
const fs = require('fs');
|
|
@@ -34517,15 +34571,15 @@ class TuiCache {
|
|
|
34517
34571
|
}
|
|
34518
34572
|
|
|
34519
34573
|
// src/cli/tui/context.ts
|
|
34520
|
-
import { existsSync as
|
|
34521
|
-
import { join as
|
|
34574
|
+
import { existsSync as existsSync24 } from "node:fs";
|
|
34575
|
+
import { join as join27 } from "node:path";
|
|
34522
34576
|
async function getTuiContext(cwd = process.cwd(), cache2) {
|
|
34523
34577
|
const cachedContext = cache2?.getContext();
|
|
34524
34578
|
if (cachedContext) {
|
|
34525
34579
|
return cachedContext;
|
|
34526
34580
|
}
|
|
34527
|
-
const configPath =
|
|
34528
|
-
const hasWorkspace =
|
|
34581
|
+
const configPath = join27(cwd, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
34582
|
+
const hasWorkspace = existsSync24(configPath) && !isUserConfigPath(cwd);
|
|
34529
34583
|
let projectPluginCount = 0;
|
|
34530
34584
|
if (hasWorkspace) {
|
|
34531
34585
|
try {
|
|
@@ -35941,8 +35995,8 @@ init_workspace();
|
|
|
35941
35995
|
init_sync();
|
|
35942
35996
|
init_status2();
|
|
35943
35997
|
var import_cmd_ts2 = __toESM(require_cjs(), 1);
|
|
35944
|
-
import { existsSync as
|
|
35945
|
-
import { join as
|
|
35998
|
+
import { existsSync as existsSync20 } from "node:fs";
|
|
35999
|
+
import { join as join22, resolve as resolve11 } from "node:path";
|
|
35946
36000
|
|
|
35947
36001
|
// src/core/prune.ts
|
|
35948
36002
|
init_js_yaml();
|
|
@@ -35950,9 +36004,9 @@ init_constants();
|
|
|
35950
36004
|
init_marketplace();
|
|
35951
36005
|
init_user_workspace();
|
|
35952
36006
|
init_workspace_config();
|
|
35953
|
-
import { readFile as
|
|
35954
|
-
import { existsSync as
|
|
35955
|
-
import { join as
|
|
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";
|
|
35956
36010
|
async function isOrphanedPlugin(pluginSpec) {
|
|
35957
36011
|
if (!isPluginSpec(pluginSpec))
|
|
35958
36012
|
return false;
|
|
@@ -35979,14 +36033,14 @@ async function prunePlugins(plugins) {
|
|
|
35979
36033
|
}
|
|
35980
36034
|
async function pruneOrphanedPlugins(workspacePath) {
|
|
35981
36035
|
let projectResult = { removed: [], kept: [], keptEntries: [] };
|
|
35982
|
-
const projectConfigPath =
|
|
35983
|
-
if (
|
|
35984
|
-
const content = await
|
|
36036
|
+
const projectConfigPath = join21(workspacePath, CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
36037
|
+
if (existsSync19(projectConfigPath) && !isUserConfigPath(workspacePath)) {
|
|
36038
|
+
const content = await readFile12(projectConfigPath, "utf-8");
|
|
35985
36039
|
const config = load(content);
|
|
35986
36040
|
projectResult = await prunePlugins(config.plugins);
|
|
35987
36041
|
if (projectResult.removed.length > 0) {
|
|
35988
36042
|
config.plugins = projectResult.keptEntries;
|
|
35989
|
-
await
|
|
36043
|
+
await writeFile9(projectConfigPath, dump(config, { lineWidth: -1 }), "utf-8");
|
|
35990
36044
|
}
|
|
35991
36045
|
}
|
|
35992
36046
|
let userResult = { removed: [], kept: [], keptEntries: [] };
|
|
@@ -35996,7 +36050,7 @@ async function pruneOrphanedPlugins(workspacePath) {
|
|
|
35996
36050
|
if (userResult.removed.length > 0) {
|
|
35997
36051
|
userConfig.plugins = userResult.keptEntries;
|
|
35998
36052
|
const userConfigPath = getUserWorkspaceConfigPath();
|
|
35999
|
-
await
|
|
36053
|
+
await writeFile9(userConfigPath, dump(userConfig, { lineWidth: -1 }), "utf-8");
|
|
36000
36054
|
}
|
|
36001
36055
|
}
|
|
36002
36056
|
return {
|
|
@@ -36058,14 +36112,14 @@ var initMeta = {
|
|
|
36058
36112
|
}
|
|
36059
36113
|
};
|
|
36060
36114
|
var syncMeta = {
|
|
36061
|
-
command: "
|
|
36062
|
-
description: "
|
|
36115
|
+
command: "update",
|
|
36116
|
+
description: "Update plugins in workspace",
|
|
36063
36117
|
whenToUse: "After modifying workspace.yaml or pulling shared config changes",
|
|
36064
36118
|
examples: [
|
|
36065
|
-
"allagents
|
|
36066
|
-
"allagents
|
|
36067
|
-
"allagents
|
|
36068
|
-
"allagents
|
|
36119
|
+
"allagents update",
|
|
36120
|
+
"allagents update --dry-run",
|
|
36121
|
+
"allagents update --offline",
|
|
36122
|
+
"allagents update --verbose"
|
|
36069
36123
|
],
|
|
36070
36124
|
expectedOutput: "Lists synced files with status per plugin. Exit 0 on success, exit 1 if any files failed.",
|
|
36071
36125
|
options: [
|
|
@@ -36256,8 +36310,8 @@ Plugin sync results:`);
|
|
|
36256
36310
|
}
|
|
36257
36311
|
});
|
|
36258
36312
|
var syncCmd = import_cmd_ts2.command({
|
|
36259
|
-
name: "
|
|
36260
|
-
aliases: ["
|
|
36313
|
+
name: "update",
|
|
36314
|
+
aliases: ["sync"],
|
|
36261
36315
|
description: buildDescription(syncMeta),
|
|
36262
36316
|
args: {
|
|
36263
36317
|
offline: import_cmd_ts2.flag({ long: "offline", description: "Use cached plugins without fetching latest from remote" }),
|
|
@@ -36272,8 +36326,8 @@ var syncCmd = import_cmd_ts2.command({
|
|
|
36272
36326
|
`);
|
|
36273
36327
|
}
|
|
36274
36328
|
const userConfigExists = !!await getUserWorkspaceConfig();
|
|
36275
|
-
const projectConfigPath =
|
|
36276
|
-
const projectConfigExists =
|
|
36329
|
+
const projectConfigPath = join22(process.cwd(), ".allagents", "workspace.yaml");
|
|
36330
|
+
const projectConfigExists = existsSync20(projectConfigPath);
|
|
36277
36331
|
if (!userConfigExists && !projectConfigExists) {
|
|
36278
36332
|
await ensureUserWorkspace();
|
|
36279
36333
|
if (isJsonMode()) {
|
|
@@ -36941,9 +36995,9 @@ init_workspace_modify();
|
|
|
36941
36995
|
init_user_workspace();
|
|
36942
36996
|
init_skills();
|
|
36943
36997
|
var import_cmd_ts3 = __toESM(require_cjs(), 1);
|
|
36944
|
-
import { existsSync as
|
|
36945
|
-
import { readFile as
|
|
36946
|
-
import { join as
|
|
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";
|
|
36947
37001
|
|
|
36948
37002
|
// src/cli/metadata/plugin-skills.ts
|
|
36949
37003
|
var skillsListMeta = {
|
|
@@ -37034,7 +37088,7 @@ init_skill();
|
|
|
37034
37088
|
init_marketplace();
|
|
37035
37089
|
init_marketplace_manifest_parser();
|
|
37036
37090
|
function hasProjectConfig(dir) {
|
|
37037
|
-
return
|
|
37091
|
+
return existsSync22(join24(dir, CONFIG_DIR, WORKSPACE_CONFIG_FILE));
|
|
37038
37092
|
}
|
|
37039
37093
|
function resolveScope(cwd) {
|
|
37040
37094
|
if (isUserConfigPath(cwd))
|
|
@@ -37065,7 +37119,7 @@ async function resolveSkillNameFromRepo(url, parsed, fallbackName, fetchFn = fet
|
|
|
37065
37119
|
if (!fetchResult.success)
|
|
37066
37120
|
return fallbackName;
|
|
37067
37121
|
try {
|
|
37068
|
-
const skillMd = await
|
|
37122
|
+
const skillMd = await readFile14(join24(fetchResult.cachePath, "SKILL.md"), "utf-8");
|
|
37069
37123
|
const metadata = parseSkillMetadata(skillMd);
|
|
37070
37124
|
return metadata?.name ?? fallbackName;
|
|
37071
37125
|
} catch {
|
|
@@ -37622,9 +37676,9 @@ init_format_sync();
|
|
|
37622
37676
|
init_workspace_config();
|
|
37623
37677
|
init_constants();
|
|
37624
37678
|
init_js_yaml();
|
|
37625
|
-
import { readFile as
|
|
37626
|
-
import { existsSync as
|
|
37627
|
-
import { join as
|
|
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";
|
|
37628
37682
|
async function runSyncAndPrint(options2) {
|
|
37629
37683
|
if (!isJsonMode()) {
|
|
37630
37684
|
console.log(`
|
|
@@ -37869,7 +37923,7 @@ var marketplaceAddCmd = import_cmd_ts4.command({
|
|
|
37869
37923
|
process.exit(1);
|
|
37870
37924
|
}
|
|
37871
37925
|
if (effectiveScope === "project") {
|
|
37872
|
-
if (!
|
|
37926
|
+
if (!existsSync23(join25(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE))) {
|
|
37873
37927
|
const msg = 'No workspace found in current directory. Run "allagents workspace init" first.';
|
|
37874
37928
|
if (isJsonMode()) {
|
|
37875
37929
|
jsonOutput({ success: false, command: "plugin marketplace add", error: msg });
|
|
@@ -38176,10 +38230,10 @@ var pluginListCmd = import_cmd_ts4.command({
|
|
|
38176
38230
|
};
|
|
38177
38231
|
const pluginClients = new Map;
|
|
38178
38232
|
async function loadConfigClients(configPath, scope) {
|
|
38179
|
-
if (!
|
|
38233
|
+
if (!existsSync23(configPath))
|
|
38180
38234
|
return;
|
|
38181
38235
|
try {
|
|
38182
|
-
const content = await
|
|
38236
|
+
const content = await readFile15(configPath, "utf-8");
|
|
38183
38237
|
const config = load(content);
|
|
38184
38238
|
if (!config?.plugins || !config?.clients)
|
|
38185
38239
|
return;
|
|
@@ -38191,8 +38245,8 @@ var pluginListCmd = import_cmd_ts4.command({
|
|
|
38191
38245
|
}
|
|
38192
38246
|
} catch {}
|
|
38193
38247
|
}
|
|
38194
|
-
const userConfigPath =
|
|
38195
|
-
const projectConfigPath =
|
|
38248
|
+
const userConfigPath = join25(getAllagentsDir(), WORKSPACE_CONFIG_FILE);
|
|
38249
|
+
const projectConfigPath = join25(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
38196
38250
|
const cwdIsHome = isUserConfigPath(process.cwd());
|
|
38197
38251
|
await loadConfigClients(userConfigPath, "user");
|
|
38198
38252
|
if (!cwdIsHome) {
|
|
@@ -38334,7 +38388,7 @@ var pluginInstallCmd = import_cmd_ts4.command({
|
|
|
38334
38388
|
const isUser = scope === "user" || !scope && isUserConfigPath(process.cwd());
|
|
38335
38389
|
if (isUser) {
|
|
38336
38390
|
const userConfigPath = getUserWorkspaceConfigPath();
|
|
38337
|
-
if (!
|
|
38391
|
+
if (!existsSync23(userConfigPath)) {
|
|
38338
38392
|
const { promptForClients: promptForClients2 } = await Promise.resolve().then(() => (init_prompt_clients(), exports_prompt_clients));
|
|
38339
38393
|
const clients = await promptForClients2();
|
|
38340
38394
|
if (clients === null) {
|
|
@@ -38346,8 +38400,8 @@ var pluginInstallCmd = import_cmd_ts4.command({
|
|
|
38346
38400
|
await ensureUserWorkspace(clients);
|
|
38347
38401
|
}
|
|
38348
38402
|
} else {
|
|
38349
|
-
const configPath =
|
|
38350
|
-
if (!
|
|
38403
|
+
const configPath = join25(process.cwd(), CONFIG_DIR, WORKSPACE_CONFIG_FILE);
|
|
38404
|
+
if (!existsSync23(configPath)) {
|
|
38351
38405
|
const { promptForClients: promptForClients2 } = await Promise.resolve().then(() => (init_prompt_clients(), exports_prompt_clients));
|
|
38352
38406
|
const clients = await promptForClients2();
|
|
38353
38407
|
if (clients === null) {
|
|
@@ -38624,14 +38678,14 @@ var pluginUpdateCmd = import_cmd_ts4.command({
|
|
|
38624
38678
|
}
|
|
38625
38679
|
}
|
|
38626
38680
|
if (updateProject && !isUserConfigPath(process.cwd())) {
|
|
38627
|
-
const { existsSync:
|
|
38628
|
-
const { readFile:
|
|
38629
|
-
const { join:
|
|
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");
|
|
38630
38684
|
const { load: load2 } = await Promise.resolve().then(() => (init_js_yaml(), exports_js_yaml));
|
|
38631
38685
|
const { CONFIG_DIR: CONFIG_DIR2, WORKSPACE_CONFIG_FILE: WORKSPACE_CONFIG_FILE2 } = await Promise.resolve().then(() => (init_constants(), exports_constants));
|
|
38632
|
-
const configPath =
|
|
38633
|
-
if (
|
|
38634
|
-
const content = await
|
|
38686
|
+
const configPath = join26(process.cwd(), CONFIG_DIR2, WORKSPACE_CONFIG_FILE2);
|
|
38687
|
+
if (existsSync24(configPath)) {
|
|
38688
|
+
const content = await readFile16(configPath, "utf-8");
|
|
38635
38689
|
const config = load2(content);
|
|
38636
38690
|
for (const entry of config.plugins ?? []) {
|
|
38637
38691
|
const p = getPluginSource(entry);
|
|
@@ -40547,6 +40601,7 @@ var app = conciseSubcommands({
|
|
|
40547
40601
|
` + "For AI agents: use --agent-help for machine-readable help, or --json for structured output",
|
|
40548
40602
|
version: package_default.version,
|
|
40549
40603
|
cmds: {
|
|
40604
|
+
update: syncCmd,
|
|
40550
40605
|
workspace: workspaceCmd,
|
|
40551
40606
|
plugin: pluginCmd,
|
|
40552
40607
|
self: selfCmd,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allagents",
|
|
3
|
-
"version": "1.
|
|
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": {
|
|
7
|
-
"allagents": "
|
|
7
|
+
"allagents": "dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"repository": {
|
|
48
48
|
"type": "git",
|
|
49
|
-
"url": "https://github.com/EntityProcess/allagents.git"
|
|
49
|
+
"url": "git+https://github.com/EntityProcess/allagents.git"
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://allagents.dev",
|
|
52
52
|
"dependencies": {
|