allagents 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +155 -86
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26188,7 +26188,8 @@ var init_user_workspace = __esm(() => {
|
|
|
26188
26188
|
"opencode",
|
|
26189
26189
|
"gemini",
|
|
26190
26190
|
"factory",
|
|
26191
|
-
"ampcode"
|
|
26191
|
+
"ampcode",
|
|
26192
|
+
"vscode"
|
|
26192
26193
|
];
|
|
26193
26194
|
});
|
|
26194
26195
|
|
|
@@ -27337,7 +27338,8 @@ var init_sync_state = __esm(() => {
|
|
|
27337
27338
|
SyncStateSchema = exports_external.object({
|
|
27338
27339
|
version: exports_external.literal(1),
|
|
27339
27340
|
lastSync: exports_external.string(),
|
|
27340
|
-
files: exports_external.record(ClientTypeSchema, exports_external.array(exports_external.string()))
|
|
27341
|
+
files: exports_external.record(ClientTypeSchema, exports_external.array(exports_external.string())),
|
|
27342
|
+
mcpServers: exports_external.record(exports_external.string(), exports_external.array(exports_external.string())).optional()
|
|
27341
27343
|
});
|
|
27342
27344
|
});
|
|
27343
27345
|
|
|
@@ -27365,12 +27367,14 @@ async function loadSyncState(workspacePath) {
|
|
|
27365
27367
|
return null;
|
|
27366
27368
|
}
|
|
27367
27369
|
}
|
|
27368
|
-
async function saveSyncState(workspacePath,
|
|
27370
|
+
async function saveSyncState(workspacePath, data) {
|
|
27369
27371
|
const statePath = getSyncStatePath(workspacePath);
|
|
27372
|
+
const normalizedData = "files" in data ? data : { files: data };
|
|
27370
27373
|
const state = {
|
|
27371
27374
|
version: 1,
|
|
27372
27375
|
lastSync: new Date().toISOString(),
|
|
27373
|
-
files
|
|
27376
|
+
files: normalizedData.files,
|
|
27377
|
+
...normalizedData.mcpServers && { mcpServers: normalizedData.mcpServers }
|
|
27374
27378
|
};
|
|
27375
27379
|
await mkdir7(dirname5(statePath), { recursive: true });
|
|
27376
27380
|
await writeFile6(statePath, JSON.stringify(state, null, 2), "utf-8");
|
|
@@ -27381,6 +27385,12 @@ function getPreviouslySyncedFiles(state, client) {
|
|
|
27381
27385
|
}
|
|
27382
27386
|
return state.files[client] ?? [];
|
|
27383
27387
|
}
|
|
27388
|
+
function getPreviouslySyncedMcpServers(state, scope) {
|
|
27389
|
+
if (!state?.mcpServers) {
|
|
27390
|
+
return [];
|
|
27391
|
+
}
|
|
27392
|
+
return state.mcpServers[scope] ?? [];
|
|
27393
|
+
}
|
|
27384
27394
|
var init_sync_state2 = __esm(() => {
|
|
27385
27395
|
init_constants();
|
|
27386
27396
|
init_sync_state();
|
|
@@ -27556,19 +27566,21 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
|
|
|
27556
27566
|
const dryRun = options2?.dryRun ?? false;
|
|
27557
27567
|
const force = options2?.force ?? false;
|
|
27558
27568
|
const configPath = options2?.configPath ?? getVscodeMcpConfigPath();
|
|
27569
|
+
const previouslyTracked = new Set(options2?.trackedServers ?? []);
|
|
27570
|
+
const hasTracking = options2?.trackedServers !== undefined;
|
|
27559
27571
|
const { servers: pluginServers, warnings } = collectMcpServers(validatedPlugins);
|
|
27560
27572
|
const result = {
|
|
27561
27573
|
added: 0,
|
|
27562
27574
|
skipped: 0,
|
|
27563
27575
|
overwritten: 0,
|
|
27576
|
+
removed: 0,
|
|
27564
27577
|
warnings: [...warnings],
|
|
27565
27578
|
addedServers: [],
|
|
27566
27579
|
skippedServers: [],
|
|
27567
|
-
overwrittenServers: []
|
|
27580
|
+
overwrittenServers: [],
|
|
27581
|
+
removedServers: [],
|
|
27582
|
+
trackedServers: []
|
|
27568
27583
|
};
|
|
27569
|
-
if (pluginServers.size === 0) {
|
|
27570
|
-
return result;
|
|
27571
|
-
}
|
|
27572
27584
|
let existingConfig = {};
|
|
27573
27585
|
if (existsSync11(configPath)) {
|
|
27574
27586
|
try {
|
|
@@ -27583,22 +27595,42 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
|
|
|
27583
27595
|
for (const [name, config] of pluginServers) {
|
|
27584
27596
|
if (name in existingServers) {
|
|
27585
27597
|
if (!deepEqual(existingServers[name], config)) {
|
|
27586
|
-
if (
|
|
27598
|
+
if (hasTracking && previouslyTracked.has(name)) {
|
|
27587
27599
|
existingServers[name] = config;
|
|
27588
27600
|
result.overwritten++;
|
|
27589
27601
|
result.overwrittenServers.push(name);
|
|
27602
|
+
result.trackedServers.push(name);
|
|
27603
|
+
} else if (force) {
|
|
27604
|
+
existingServers[name] = config;
|
|
27605
|
+
result.overwritten++;
|
|
27606
|
+
result.overwrittenServers.push(name);
|
|
27607
|
+
result.trackedServers.push(name);
|
|
27590
27608
|
} else {
|
|
27591
27609
|
result.skipped++;
|
|
27592
27610
|
result.skippedServers.push(name);
|
|
27593
27611
|
}
|
|
27612
|
+
} else if (hasTracking && previouslyTracked.has(name)) {
|
|
27613
|
+
result.trackedServers.push(name);
|
|
27594
27614
|
}
|
|
27595
27615
|
} else {
|
|
27596
27616
|
existingServers[name] = config;
|
|
27597
27617
|
result.added++;
|
|
27598
27618
|
result.addedServers.push(name);
|
|
27619
|
+
result.trackedServers.push(name);
|
|
27599
27620
|
}
|
|
27600
27621
|
}
|
|
27601
|
-
if (
|
|
27622
|
+
if (hasTracking) {
|
|
27623
|
+
const currentServerNames = new Set(pluginServers.keys());
|
|
27624
|
+
for (const trackedName of previouslyTracked) {
|
|
27625
|
+
if (!currentServerNames.has(trackedName) && trackedName in existingServers) {
|
|
27626
|
+
delete existingServers[trackedName];
|
|
27627
|
+
result.removed++;
|
|
27628
|
+
result.removedServers.push(trackedName);
|
|
27629
|
+
}
|
|
27630
|
+
}
|
|
27631
|
+
}
|
|
27632
|
+
const hasChanges = result.added > 0 || result.overwritten > 0 || result.removed > 0;
|
|
27633
|
+
if (hasChanges && !dryRun) {
|
|
27602
27634
|
existingConfig.servers = existingServers;
|
|
27603
27635
|
const dir = dirname6(configPath);
|
|
27604
27636
|
if (!existsSync11(dir)) {
|
|
@@ -27606,6 +27638,26 @@ function syncVscodeMcpConfig(validatedPlugins, options2) {
|
|
|
27606
27638
|
}
|
|
27607
27639
|
writeFileSync(configPath, `${JSON.stringify(existingConfig, null, 2)}
|
|
27608
27640
|
`, "utf-8");
|
|
27641
|
+
result.configPath = configPath;
|
|
27642
|
+
}
|
|
27643
|
+
if (pluginServers.size === 0 && hasTracking && previouslyTracked.size > 0) {
|
|
27644
|
+
for (const trackedName of previouslyTracked) {
|
|
27645
|
+
if (trackedName in existingServers) {
|
|
27646
|
+
delete existingServers[trackedName];
|
|
27647
|
+
result.removed++;
|
|
27648
|
+
result.removedServers.push(trackedName);
|
|
27649
|
+
}
|
|
27650
|
+
}
|
|
27651
|
+
if (result.removed > 0 && !dryRun) {
|
|
27652
|
+
existingConfig.servers = existingServers;
|
|
27653
|
+
const dir = dirname6(configPath);
|
|
27654
|
+
if (!existsSync11(dir)) {
|
|
27655
|
+
mkdirSync(dir, { recursive: true });
|
|
27656
|
+
}
|
|
27657
|
+
writeFileSync(configPath, `${JSON.stringify(existingConfig, null, 2)}
|
|
27658
|
+
`, "utf-8");
|
|
27659
|
+
result.configPath = configPath;
|
|
27660
|
+
}
|
|
27609
27661
|
}
|
|
27610
27662
|
return result;
|
|
27611
27663
|
}
|
|
@@ -28325,18 +28377,22 @@ ${failedValidations.map((v) => ` - ${v.plugin}: ${v.error}`).join(`
|
|
|
28325
28377
|
}
|
|
28326
28378
|
}
|
|
28327
28379
|
}
|
|
28328
|
-
if (!dryRun) {
|
|
28329
|
-
const allCopyResults = pluginResults.flatMap((r) => r.copyResults);
|
|
28330
|
-
const syncedFiles = collectSyncedPaths(allCopyResults, homeDir, clients, USER_CLIENT_MAPPINGS);
|
|
28331
|
-
await saveSyncState(homeDir, syncedFiles);
|
|
28332
|
-
}
|
|
28333
28380
|
let mcpResult;
|
|
28334
|
-
if (clients.includes("vscode")
|
|
28335
|
-
|
|
28381
|
+
if (clients.includes("vscode")) {
|
|
28382
|
+
const trackedMcpServers = getPreviouslySyncedMcpServers(previousState, "vscode");
|
|
28383
|
+
mcpResult = syncVscodeMcpConfig(validPlugins, { dryRun, force, trackedServers: trackedMcpServers });
|
|
28336
28384
|
if (mcpResult.warnings.length > 0) {
|
|
28337
28385
|
warnings.push(...mcpResult.warnings);
|
|
28338
28386
|
}
|
|
28339
28387
|
}
|
|
28388
|
+
if (!dryRun) {
|
|
28389
|
+
const allCopyResults = pluginResults.flatMap((r) => r.copyResults);
|
|
28390
|
+
const syncedFiles = collectSyncedPaths(allCopyResults, homeDir, clients, USER_CLIENT_MAPPINGS);
|
|
28391
|
+
await saveSyncState(homeDir, {
|
|
28392
|
+
files: syncedFiles,
|
|
28393
|
+
...mcpResult && { mcpServers: { vscode: mcpResult.trackedServers } }
|
|
28394
|
+
});
|
|
28395
|
+
}
|
|
28340
28396
|
return {
|
|
28341
28397
|
success: totalFailed === 0,
|
|
28342
28398
|
pluginResults,
|
|
@@ -28789,6 +28845,67 @@ var init_status2 = __esm(() => {
|
|
|
28789
28845
|
init_user_workspace();
|
|
28790
28846
|
});
|
|
28791
28847
|
|
|
28848
|
+
// src/cli/format-sync.ts
|
|
28849
|
+
function formatMcpResult(mcpResult) {
|
|
28850
|
+
const { added, overwritten, removed, skipped } = mcpResult;
|
|
28851
|
+
if (added === 0 && overwritten === 0 && removed === 0 && skipped === 0) {
|
|
28852
|
+
return [];
|
|
28853
|
+
}
|
|
28854
|
+
const lines = [];
|
|
28855
|
+
const parts = [`${added} added`];
|
|
28856
|
+
if (overwritten > 0)
|
|
28857
|
+
parts.push(`${overwritten} updated`);
|
|
28858
|
+
if (removed > 0)
|
|
28859
|
+
parts.push(`${removed} removed`);
|
|
28860
|
+
if (skipped > 0)
|
|
28861
|
+
parts.push(`${skipped} skipped`);
|
|
28862
|
+
lines.push(`MCP servers: ${parts.join(", ")}`);
|
|
28863
|
+
for (const name of mcpResult.addedServers) {
|
|
28864
|
+
lines.push(` + ${name}`);
|
|
28865
|
+
}
|
|
28866
|
+
for (const name of mcpResult.overwrittenServers) {
|
|
28867
|
+
lines.push(` ~ ${name}`);
|
|
28868
|
+
}
|
|
28869
|
+
for (const name of mcpResult.removedServers) {
|
|
28870
|
+
lines.push(` - ${name}`);
|
|
28871
|
+
}
|
|
28872
|
+
if (mcpResult.configPath) {
|
|
28873
|
+
lines.push(`File modified: ${mcpResult.configPath}`);
|
|
28874
|
+
}
|
|
28875
|
+
return lines;
|
|
28876
|
+
}
|
|
28877
|
+
function buildSyncData(result) {
|
|
28878
|
+
return {
|
|
28879
|
+
copied: result.totalCopied,
|
|
28880
|
+
generated: result.totalGenerated,
|
|
28881
|
+
failed: result.totalFailed,
|
|
28882
|
+
skipped: result.totalSkipped,
|
|
28883
|
+
plugins: result.pluginResults.map((pr) => ({
|
|
28884
|
+
plugin: pr.plugin,
|
|
28885
|
+
success: pr.success,
|
|
28886
|
+
error: pr.error,
|
|
28887
|
+
copied: pr.copyResults.filter((r) => r.action === "copied").length,
|
|
28888
|
+
generated: pr.copyResults.filter((r) => r.action === "generated").length,
|
|
28889
|
+
failed: pr.copyResults.filter((r) => r.action === "failed").length,
|
|
28890
|
+
copyResults: pr.copyResults
|
|
28891
|
+
})),
|
|
28892
|
+
purgedPaths: result.purgedPaths ?? [],
|
|
28893
|
+
...result.mcpResult && {
|
|
28894
|
+
mcpServers: {
|
|
28895
|
+
added: result.mcpResult.added,
|
|
28896
|
+
skipped: result.mcpResult.skipped,
|
|
28897
|
+
overwritten: result.mcpResult.overwritten,
|
|
28898
|
+
removed: result.mcpResult.removed,
|
|
28899
|
+
addedServers: result.mcpResult.addedServers,
|
|
28900
|
+
skippedServers: result.mcpResult.skippedServers,
|
|
28901
|
+
overwrittenServers: result.mcpResult.overwrittenServers,
|
|
28902
|
+
removedServers: result.mcpResult.removedServers,
|
|
28903
|
+
...result.mcpResult.configPath && { configPath: result.mcpResult.configPath }
|
|
28904
|
+
}
|
|
28905
|
+
}
|
|
28906
|
+
};
|
|
28907
|
+
}
|
|
28908
|
+
|
|
28792
28909
|
// src/core/skills.ts
|
|
28793
28910
|
import { existsSync as existsSync18 } from "node:fs";
|
|
28794
28911
|
import { readFile as readFile13, readdir as readdir4 } from "node:fs/promises";
|
|
@@ -29355,7 +29472,7 @@ var package_default;
|
|
|
29355
29472
|
var init_package = __esm(() => {
|
|
29356
29473
|
package_default = {
|
|
29357
29474
|
name: "allagents",
|
|
29358
|
-
version: "0.22.
|
|
29475
|
+
version: "0.22.2",
|
|
29359
29476
|
description: "CLI tool for managing multi-repo AI agent workspaces with plugin synchronization",
|
|
29360
29477
|
type: "module",
|
|
29361
29478
|
bin: {
|
|
@@ -31404,13 +31521,8 @@ async function runSync(context) {
|
|
|
31404
31521
|
const lines = userResult.pluginResults.map((pr) => `${pr.success ? "✓" : "✗"} ${pr.plugin}`);
|
|
31405
31522
|
lines.push("");
|
|
31406
31523
|
lines.push(`Copied: ${userResult.totalCopied} Failed: ${userResult.totalFailed} Skipped: ${userResult.totalSkipped}`);
|
|
31407
|
-
if (userResult.mcpResult
|
|
31408
|
-
|
|
31409
|
-
if (userResult.mcpResult.overwritten > 0)
|
|
31410
|
-
parts.push(`${userResult.mcpResult.overwritten} overwritten`);
|
|
31411
|
-
if (userResult.mcpResult.skipped > 0)
|
|
31412
|
-
parts.push(`${userResult.mcpResult.skipped} skipped`);
|
|
31413
|
-
lines.push(`MCP servers: ${parts.join(", ")}`);
|
|
31524
|
+
if (userResult.mcpResult) {
|
|
31525
|
+
lines.push(...formatMcpResult(userResult.mcpResult));
|
|
31414
31526
|
}
|
|
31415
31527
|
kt2(lines.join(`
|
|
31416
31528
|
`), "User Sync");
|
|
@@ -32551,34 +32663,6 @@ var repoListMeta = {
|
|
|
32551
32663
|
};
|
|
32552
32664
|
|
|
32553
32665
|
// src/cli/commands/workspace.ts
|
|
32554
|
-
function buildSyncData(result) {
|
|
32555
|
-
return {
|
|
32556
|
-
copied: result.totalCopied,
|
|
32557
|
-
generated: result.totalGenerated,
|
|
32558
|
-
failed: result.totalFailed,
|
|
32559
|
-
skipped: result.totalSkipped,
|
|
32560
|
-
plugins: result.pluginResults.map((pr) => ({
|
|
32561
|
-
plugin: pr.plugin,
|
|
32562
|
-
success: pr.success,
|
|
32563
|
-
error: pr.error,
|
|
32564
|
-
copied: pr.copyResults.filter((r) => r.action === "copied").length,
|
|
32565
|
-
generated: pr.copyResults.filter((r) => r.action === "generated").length,
|
|
32566
|
-
failed: pr.copyResults.filter((r) => r.action === "failed").length,
|
|
32567
|
-
copyResults: pr.copyResults
|
|
32568
|
-
})),
|
|
32569
|
-
purgedPaths: result.purgedPaths ?? [],
|
|
32570
|
-
...result.mcpResult && {
|
|
32571
|
-
mcpServers: {
|
|
32572
|
-
added: result.mcpResult.added,
|
|
32573
|
-
skipped: result.mcpResult.skipped,
|
|
32574
|
-
overwritten: result.mcpResult.overwritten,
|
|
32575
|
-
addedServers: result.mcpResult.addedServers,
|
|
32576
|
-
skippedServers: result.mcpResult.skippedServers,
|
|
32577
|
-
overwrittenServers: result.mcpResult.overwrittenServers
|
|
32578
|
-
}
|
|
32579
|
-
}
|
|
32580
|
-
};
|
|
32581
|
-
}
|
|
32582
32666
|
var initCmd = import_cmd_ts2.command({
|
|
32583
32667
|
name: "init",
|
|
32584
32668
|
description: buildDescription(initMeta),
|
|
@@ -32748,19 +32832,13 @@ Warnings:`);
|
|
|
32748
32832
|
console.log(` ⚠ ${warning}`);
|
|
32749
32833
|
}
|
|
32750
32834
|
}
|
|
32751
|
-
if (result.mcpResult
|
|
32752
|
-
const
|
|
32753
|
-
if (
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
|
|
32757
|
-
|
|
32758
|
-
MCP servers: ${parts.join(", ")}`);
|
|
32759
|
-
for (const name of result.mcpResult.addedServers) {
|
|
32760
|
-
console.log(` + ${name}`);
|
|
32761
|
-
}
|
|
32762
|
-
for (const name of result.mcpResult.overwrittenServers) {
|
|
32763
|
-
console.log(` ~ ${name}`);
|
|
32835
|
+
if (result.mcpResult) {
|
|
32836
|
+
const mcpLines = formatMcpResult(result.mcpResult);
|
|
32837
|
+
if (mcpLines.length > 0) {
|
|
32838
|
+
console.log("");
|
|
32839
|
+
for (const line of mcpLines) {
|
|
32840
|
+
console.log(line);
|
|
32841
|
+
}
|
|
32764
32842
|
}
|
|
32765
32843
|
}
|
|
32766
32844
|
console.log(`
|
|
@@ -33723,24 +33801,6 @@ var skillsCmd = conciseSubcommands({
|
|
|
33723
33801
|
});
|
|
33724
33802
|
|
|
33725
33803
|
// src/cli/commands/plugin.ts
|
|
33726
|
-
function buildSyncData2(result) {
|
|
33727
|
-
return {
|
|
33728
|
-
copied: result.totalCopied,
|
|
33729
|
-
generated: result.totalGenerated,
|
|
33730
|
-
failed: result.totalFailed,
|
|
33731
|
-
skipped: result.totalSkipped,
|
|
33732
|
-
plugins: result.pluginResults.map((pr) => ({
|
|
33733
|
-
plugin: pr.plugin,
|
|
33734
|
-
success: pr.success,
|
|
33735
|
-
error: pr.error,
|
|
33736
|
-
copied: pr.copyResults.filter((r) => r.action === "copied").length,
|
|
33737
|
-
generated: pr.copyResults.filter((r) => r.action === "generated").length,
|
|
33738
|
-
failed: pr.copyResults.filter((r) => r.action === "failed").length,
|
|
33739
|
-
copyResults: pr.copyResults
|
|
33740
|
-
})),
|
|
33741
|
-
purgedPaths: result.purgedPaths ?? []
|
|
33742
|
-
};
|
|
33743
|
-
}
|
|
33744
33804
|
async function runSyncAndPrint(options2) {
|
|
33745
33805
|
if (!isJsonMode()) {
|
|
33746
33806
|
console.log(`
|
|
@@ -33754,7 +33814,7 @@ Syncing workspace...
|
|
|
33754
33814
|
}
|
|
33755
33815
|
return { ok: false, syncData: null };
|
|
33756
33816
|
}
|
|
33757
|
-
const syncData =
|
|
33817
|
+
const syncData = buildSyncData(result);
|
|
33758
33818
|
if (!isJsonMode()) {
|
|
33759
33819
|
for (const pluginResult of result.pluginResults) {
|
|
33760
33820
|
const status = pluginResult.success ? "✓" : "✗";
|
|
@@ -33804,7 +33864,7 @@ Syncing user workspace...
|
|
|
33804
33864
|
}
|
|
33805
33865
|
return { ok: false, syncData: null };
|
|
33806
33866
|
}
|
|
33807
|
-
const syncData =
|
|
33867
|
+
const syncData = buildSyncData(result);
|
|
33808
33868
|
if (!isJsonMode()) {
|
|
33809
33869
|
for (const pluginResult of result.pluginResults) {
|
|
33810
33870
|
const status = pluginResult.success ? "✓" : "✗";
|
|
@@ -33826,6 +33886,15 @@ Syncing user workspace...
|
|
|
33826
33886
|
}
|
|
33827
33887
|
}
|
|
33828
33888
|
}
|
|
33889
|
+
if (result.mcpResult) {
|
|
33890
|
+
const mcpLines = formatMcpResult(result.mcpResult);
|
|
33891
|
+
if (mcpLines.length > 0) {
|
|
33892
|
+
console.log("");
|
|
33893
|
+
for (const line of mcpLines) {
|
|
33894
|
+
console.log(line);
|
|
33895
|
+
}
|
|
33896
|
+
}
|
|
33897
|
+
}
|
|
33829
33898
|
console.log(`
|
|
33830
33899
|
User sync complete:`);
|
|
33831
33900
|
console.log(` Total copied: ${result.totalCopied}`);
|