@memoraone/mcp 0.1.47 → 0.1.49
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/cli.cjs +440 -314
- package/dist/daemon.cjs +223 -84
- package/dist/index.cjs +212 -73
- package/dist/pluginPairing.cjs +223 -254
- package/package.json +1 -1
package/dist/pluginPairing.cjs
CHANGED
|
@@ -944,16 +944,14 @@ var config2 = {
|
|
|
944
944
|
};
|
|
945
945
|
|
|
946
946
|
// src/localState/connectCommand.ts
|
|
947
|
-
var
|
|
947
|
+
var fs35 = __toESM(require("fs/promises"), 1);
|
|
948
948
|
var path43 = __toESM(require("path"), 1);
|
|
949
949
|
var os14 = __toESM(require("os"), 1);
|
|
950
950
|
|
|
951
951
|
// src/projectBinding.ts
|
|
952
|
-
var fs8 = __toESM(require("fs/promises"), 1);
|
|
953
952
|
var path11 = __toESM(require("path"), 1);
|
|
954
953
|
|
|
955
954
|
// src/localState/resolveLocalBinding.ts
|
|
956
|
-
var fs7 = __toESM(require("fs/promises"), 1);
|
|
957
955
|
var path10 = __toESM(require("path"), 1);
|
|
958
956
|
|
|
959
957
|
// src/localState/pathIndex.ts
|
|
@@ -1171,19 +1169,9 @@ function identityMatchesStored(stored, current) {
|
|
|
1171
1169
|
}
|
|
1172
1170
|
|
|
1173
1171
|
// src/localState/resolveLocalBinding.ts
|
|
1174
|
-
async function detectLegacyM1Warning(workspaceRoot) {
|
|
1175
|
-
const candidate = path10.join(path10.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
|
|
1176
|
-
try {
|
|
1177
|
-
await fs7.access(candidate);
|
|
1178
|
-
return candidate;
|
|
1179
|
-
} catch {
|
|
1180
|
-
return void 0;
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
1172
|
async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
|
|
1184
1173
|
const resolved = path10.resolve(workspaceRoot);
|
|
1185
1174
|
const identity = await captureRootFilesystemIdentity(resolved, options.identityDeps);
|
|
1186
|
-
const legacyM1WarningPath = await detectLegacyM1Warning(resolved);
|
|
1187
1175
|
const index = await loadPathIndex(options.homeDir);
|
|
1188
1176
|
const lookup = lookupPathIndex(index, resolved, identity);
|
|
1189
1177
|
if (lookup.kind === "path") {
|
|
@@ -1207,8 +1195,7 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
|
|
|
1207
1195
|
return {
|
|
1208
1196
|
repositoryBindingId: record.repositoryBindingId,
|
|
1209
1197
|
identity,
|
|
1210
|
-
created: false
|
|
1211
|
-
legacyM1WarningPath
|
|
1198
|
+
created: false
|
|
1212
1199
|
};
|
|
1213
1200
|
}
|
|
1214
1201
|
}
|
|
@@ -1232,8 +1219,7 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
|
|
|
1232
1219
|
repositoryBindingId: record.repositoryBindingId,
|
|
1233
1220
|
identity,
|
|
1234
1221
|
created: false,
|
|
1235
|
-
renamedFrom: lookup.previousPath
|
|
1236
|
-
legacyM1WarningPath
|
|
1222
|
+
renamedFrom: lookup.previousPath
|
|
1237
1223
|
};
|
|
1238
1224
|
}
|
|
1239
1225
|
}
|
|
@@ -1246,13 +1232,12 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
|
|
|
1246
1232
|
return {
|
|
1247
1233
|
repositoryBindingId,
|
|
1248
1234
|
identity,
|
|
1249
|
-
created: true
|
|
1250
|
-
legacyM1WarningPath
|
|
1235
|
+
created: true
|
|
1251
1236
|
};
|
|
1252
1237
|
}
|
|
1253
1238
|
async function resolveLocalBinding(workspaceRoot, options = {}) {
|
|
1254
1239
|
const resolved = path10.resolve(workspaceRoot);
|
|
1255
|
-
const { repositoryBindingId
|
|
1240
|
+
const { repositoryBindingId } = await ensureRepositoryBindingForRoot(
|
|
1256
1241
|
resolved,
|
|
1257
1242
|
{ ...options, createIfMissing: false }
|
|
1258
1243
|
);
|
|
@@ -1295,8 +1280,7 @@ async function resolveLocalBinding(workspaceRoot, options = {}) {
|
|
|
1295
1280
|
installationPublicId: record.installationPublicId ?? creds.installationPublicId,
|
|
1296
1281
|
environment: record.environment,
|
|
1297
1282
|
bindingSource: "local-binding",
|
|
1298
|
-
status: record.status
|
|
1299
|
-
legacyM1WarningPath
|
|
1283
|
+
status: record.status
|
|
1300
1284
|
};
|
|
1301
1285
|
}
|
|
1302
1286
|
|
|
@@ -1318,23 +1302,9 @@ function toResolvedBinding(local) {
|
|
|
1318
1302
|
installationPublicId: local.installationPublicId,
|
|
1319
1303
|
environment: local.environment,
|
|
1320
1304
|
bindingSource: "local-binding",
|
|
1321
|
-
status: local.status
|
|
1322
|
-
legacyM1WarningPath: local.legacyM1WarningPath
|
|
1305
|
+
status: local.status
|
|
1323
1306
|
};
|
|
1324
1307
|
}
|
|
1325
|
-
async function warnLegacyM1IfPresent(workspaceRoot) {
|
|
1326
|
-
const candidate = path11.join(path11.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
|
|
1327
|
-
try {
|
|
1328
|
-
await fs8.access(candidate);
|
|
1329
|
-
process.stderr.write(
|
|
1330
|
-
`[memoraone-mcp] warning: ignoring legacy ${CANONICAL_M1_FILENAME} (not used for credentials or binding)
|
|
1331
|
-
`
|
|
1332
|
-
);
|
|
1333
|
-
return candidate;
|
|
1334
|
-
} catch {
|
|
1335
|
-
return void 0;
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
1308
|
async function resolveAuthoritativeBinding(workspaceRoot, _options = {}) {
|
|
1339
1309
|
const candidates = normalizeWorkspaceSearchRoots(workspaceRoot);
|
|
1340
1310
|
if (candidates.length === 0) {
|
|
@@ -1344,7 +1314,6 @@ async function resolveAuthoritativeBinding(workspaceRoot, _options = {}) {
|
|
|
1344
1314
|
}
|
|
1345
1315
|
const bindings = [];
|
|
1346
1316
|
for (const root of candidates) {
|
|
1347
|
-
await warnLegacyM1IfPresent(root);
|
|
1348
1317
|
try {
|
|
1349
1318
|
const local = await resolveLocalBinding(root);
|
|
1350
1319
|
bindings.push(toResolvedBinding(local));
|
|
@@ -1440,12 +1409,12 @@ function decodeResolvedBinding(value) {
|
|
|
1440
1409
|
var path13 = __toESM(require("path"), 1);
|
|
1441
1410
|
|
|
1442
1411
|
// src/resolveBuiltCliPath.ts
|
|
1443
|
-
var
|
|
1412
|
+
var fs7 = __toESM(require("fs/promises"), 1);
|
|
1444
1413
|
var path12 = __toESM(require("path"), 1);
|
|
1445
1414
|
var MONOREPO_CLI_REL = path12.join("packages", "mcp", "dist", "cli.cjs");
|
|
1446
1415
|
async function pathExists(filePath) {
|
|
1447
1416
|
try {
|
|
1448
|
-
await
|
|
1417
|
+
await fs7.access(filePath);
|
|
1449
1418
|
return true;
|
|
1450
1419
|
} catch {
|
|
1451
1420
|
return false;
|
|
@@ -1612,7 +1581,7 @@ function formatIdeSetupRepairHint(workspaceRoot, mode) {
|
|
|
1612
1581
|
}
|
|
1613
1582
|
|
|
1614
1583
|
// src/repoFingerprint.ts
|
|
1615
|
-
var
|
|
1584
|
+
var fs8 = __toESM(require("fs"), 1);
|
|
1616
1585
|
var path14 = __toESM(require("path"), 1);
|
|
1617
1586
|
var crypto2 = __toESM(require("crypto"), 1);
|
|
1618
1587
|
var parseBooleanFlag3 = (value) => {
|
|
@@ -1643,12 +1612,12 @@ var sha256 = (value) => {
|
|
|
1643
1612
|
};
|
|
1644
1613
|
var resolveGitDir = (gitPath) => {
|
|
1645
1614
|
try {
|
|
1646
|
-
const stat4 =
|
|
1615
|
+
const stat4 = fs8.statSync(gitPath);
|
|
1647
1616
|
if (stat4.isDirectory()) {
|
|
1648
1617
|
return gitPath;
|
|
1649
1618
|
}
|
|
1650
1619
|
if (stat4.isFile()) {
|
|
1651
|
-
const content =
|
|
1620
|
+
const content = fs8.readFileSync(gitPath, "utf8");
|
|
1652
1621
|
const match = content.match(/^gitdir:\s*(.+)$/m);
|
|
1653
1622
|
if (match) {
|
|
1654
1623
|
const gitDir = match[1].trim();
|
|
@@ -1664,7 +1633,7 @@ var findGitRoot = (start) => {
|
|
|
1664
1633
|
let current = path14.resolve(start);
|
|
1665
1634
|
while (true) {
|
|
1666
1635
|
const gitPath = path14.join(current, ".git");
|
|
1667
|
-
if (
|
|
1636
|
+
if (fs8.existsSync(gitPath)) {
|
|
1668
1637
|
const gitDir = resolveGitDir(gitPath);
|
|
1669
1638
|
if (gitDir) {
|
|
1670
1639
|
return { gitRoot: current, gitDir };
|
|
@@ -1681,7 +1650,7 @@ var findGitRoot = (start) => {
|
|
|
1681
1650
|
var readOriginRemote = (gitDir) => {
|
|
1682
1651
|
const configPath = path14.join(gitDir, "config");
|
|
1683
1652
|
try {
|
|
1684
|
-
const content =
|
|
1653
|
+
const content = fs8.readFileSync(configPath, "utf8");
|
|
1685
1654
|
const lines = content.split(/\r?\n/);
|
|
1686
1655
|
let inOrigin = false;
|
|
1687
1656
|
for (const line of lines) {
|
|
@@ -1737,13 +1706,13 @@ function resolveRepoFingerprint(cwd2) {
|
|
|
1737
1706
|
}
|
|
1738
1707
|
|
|
1739
1708
|
// src/setupIdeFiles.ts
|
|
1740
|
-
var
|
|
1709
|
+
var fs32 = __toESM(require("fs/promises"), 1);
|
|
1741
1710
|
var os13 = __toESM(require("os"), 1);
|
|
1742
1711
|
var path40 = __toESM(require("path"), 1);
|
|
1743
1712
|
var import_node_crypto25 = require("crypto");
|
|
1744
1713
|
|
|
1745
1714
|
// src/cleanup.ts
|
|
1746
|
-
var
|
|
1715
|
+
var fs11 = __toESM(require("fs/promises"), 1);
|
|
1747
1716
|
var path19 = __toESM(require("path"), 1);
|
|
1748
1717
|
var readline = __toESM(require("readline/promises"), 1);
|
|
1749
1718
|
var import_node_child_process3 = require("child_process");
|
|
@@ -1751,7 +1720,7 @@ var import_node_util3 = require("util");
|
|
|
1751
1720
|
var import_node_process = require("process");
|
|
1752
1721
|
|
|
1753
1722
|
// src/bindingSidecar.ts
|
|
1754
|
-
var
|
|
1723
|
+
var fs9 = __toESM(require("fs"), 1);
|
|
1755
1724
|
var path15 = __toESM(require("path"), 1);
|
|
1756
1725
|
function bindingSidecarPath(socketPath) {
|
|
1757
1726
|
if (socketPath.endsWith(".sock")) {
|
|
@@ -1784,7 +1753,7 @@ function parseSidecarRecord(raw) {
|
|
|
1784
1753
|
}
|
|
1785
1754
|
function readBindingSidecarRecord(socketPath) {
|
|
1786
1755
|
try {
|
|
1787
|
-
const raw =
|
|
1756
|
+
const raw = fs9.readFileSync(bindingSidecarPath(socketPath), "utf8");
|
|
1788
1757
|
return parseSidecarRecord(raw);
|
|
1789
1758
|
} catch {
|
|
1790
1759
|
return null;
|
|
@@ -1792,7 +1761,7 @@ function readBindingSidecarRecord(socketPath) {
|
|
|
1792
1761
|
}
|
|
1793
1762
|
|
|
1794
1763
|
// src/cursorGlobalMcpConfig.ts
|
|
1795
|
-
var
|
|
1764
|
+
var fs10 = __toESM(require("fs/promises"), 1);
|
|
1796
1765
|
var os4 = __toESM(require("os"), 1);
|
|
1797
1766
|
var path18 = __toESM(require("path"), 1);
|
|
1798
1767
|
var import_node_child_process2 = require("child_process");
|
|
@@ -2075,7 +2044,7 @@ function buildMemoraoneCursorMcpServer(options) {
|
|
|
2075
2044
|
}
|
|
2076
2045
|
async function pathExists2(filePath) {
|
|
2077
2046
|
try {
|
|
2078
|
-
await
|
|
2047
|
+
await fs10.access(filePath);
|
|
2079
2048
|
return true;
|
|
2080
2049
|
} catch {
|
|
2081
2050
|
return false;
|
|
@@ -2126,7 +2095,7 @@ async function isWorkingNpx(npxPath) {
|
|
|
2126
2095
|
if (!await pathExists2(npxPath)) return false;
|
|
2127
2096
|
if (process.platform !== "win32") {
|
|
2128
2097
|
try {
|
|
2129
|
-
await
|
|
2098
|
+
await fs10.access(npxPath, fs10.constants.X_OK);
|
|
2130
2099
|
} catch {
|
|
2131
2100
|
return false;
|
|
2132
2101
|
}
|
|
@@ -2239,7 +2208,7 @@ function getCursorRepoMcpConfigPath(repoRoot) {
|
|
|
2239
2208
|
}
|
|
2240
2209
|
async function readCursorMcpConfigObject(configPath) {
|
|
2241
2210
|
try {
|
|
2242
|
-
const raw = await
|
|
2211
|
+
const raw = await fs10.readFile(configPath, "utf8");
|
|
2243
2212
|
return JSON.parse(stripLeadingLineComments(raw));
|
|
2244
2213
|
} catch (err) {
|
|
2245
2214
|
const code = err && typeof err === "object" && "code" in err ? err.code : void 0;
|
|
@@ -2257,17 +2226,17 @@ async function removeMemoraoneFromCursorGlobalConfig(options) {
|
|
|
2257
2226
|
return { changed: true, backupPath: `${configPath}.backup-<timestamp>` };
|
|
2258
2227
|
}
|
|
2259
2228
|
const backupPath = `${configPath}.backup-${formatBackupTimestamp()}`;
|
|
2260
|
-
await
|
|
2229
|
+
await fs10.copyFile(configPath, backupPath);
|
|
2261
2230
|
const mcpServersRaw = typeof parsed2.mcpServers === "object" && parsed2.mcpServers !== null && !Array.isArray(parsed2.mcpServers) ? parsed2.mcpServers : {};
|
|
2262
2231
|
const { next: mcpServers } = stripMemoraoneOwnedFromServerMap(mcpServersRaw);
|
|
2263
2232
|
const hasOtherServers = Object.keys(mcpServers).length > 0;
|
|
2264
2233
|
if (!hasOtherServers) {
|
|
2265
|
-
await
|
|
2234
|
+
await fs10.unlink(configPath);
|
|
2266
2235
|
return { changed: true, backupPath };
|
|
2267
2236
|
}
|
|
2268
2237
|
const next = { ...parsed2, mcpServers };
|
|
2269
|
-
await
|
|
2270
|
-
await
|
|
2238
|
+
await fs10.mkdir(path18.dirname(configPath), { recursive: true });
|
|
2239
|
+
await fs10.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
|
|
2271
2240
|
return { changed: true, backupPath };
|
|
2272
2241
|
}
|
|
2273
2242
|
async function auditCursorMcpConfig(options) {
|
|
@@ -2462,7 +2431,7 @@ async function defaultListSocketPaths(projectId) {
|
|
|
2462
2431
|
const baseDir = getMcpBaseDir();
|
|
2463
2432
|
let entries;
|
|
2464
2433
|
try {
|
|
2465
|
-
entries = await
|
|
2434
|
+
entries = await fs11.readdir(baseDir);
|
|
2466
2435
|
} catch (err) {
|
|
2467
2436
|
const code = err && typeof err === "object" && "code" in err ? err.code : void 0;
|
|
2468
2437
|
if (code === "ENOENT") {
|
|
@@ -2499,7 +2468,7 @@ async function defaultListSocketPathsForWorkspaceRoot(workspaceRoot) {
|
|
|
2499
2468
|
const baseDir = getMcpBaseDir();
|
|
2500
2469
|
let entries;
|
|
2501
2470
|
try {
|
|
2502
|
-
entries = await
|
|
2471
|
+
entries = await fs11.readdir(baseDir);
|
|
2503
2472
|
} catch (err) {
|
|
2504
2473
|
const code = err && typeof err === "object" && "code" in err ? err.code : void 0;
|
|
2505
2474
|
if (code === "ENOENT") {
|
|
@@ -2550,9 +2519,9 @@ async function defaultKillProcess(pid, signal = "SIGTERM") {
|
|
|
2550
2519
|
process.kill(pid, signal);
|
|
2551
2520
|
}
|
|
2552
2521
|
async function defaultRemoveSocket(socketPath) {
|
|
2553
|
-
await
|
|
2522
|
+
await fs11.unlink(socketPath);
|
|
2554
2523
|
try {
|
|
2555
|
-
await
|
|
2524
|
+
await fs11.unlink(bindingSidecarPath(socketPath));
|
|
2556
2525
|
} catch {
|
|
2557
2526
|
}
|
|
2558
2527
|
}
|
|
@@ -2891,7 +2860,7 @@ async function runCleanup(opts) {
|
|
|
2891
2860
|
}
|
|
2892
2861
|
|
|
2893
2862
|
// src/jetbrainsMcpConfig.ts
|
|
2894
|
-
var
|
|
2863
|
+
var fs12 = __toESM(require("fs/promises"), 1);
|
|
2895
2864
|
var os5 = __toESM(require("os"), 1);
|
|
2896
2865
|
var path20 = __toESM(require("path"), 1);
|
|
2897
2866
|
var import_node_crypto5 = require("crypto");
|
|
@@ -2901,7 +2870,7 @@ function stripLeadingLineComments2(text) {
|
|
|
2901
2870
|
}
|
|
2902
2871
|
async function pathExists3(filePath) {
|
|
2903
2872
|
try {
|
|
2904
|
-
await
|
|
2873
|
+
await fs12.access(filePath);
|
|
2905
2874
|
return true;
|
|
2906
2875
|
} catch {
|
|
2907
2876
|
return false;
|
|
@@ -2928,7 +2897,7 @@ function getKnownJetBrainsMcpConfigLocations(homeDir, repoRoot) {
|
|
|
2928
2897
|
}
|
|
2929
2898
|
async function isZeroByteConfigFile(filePath) {
|
|
2930
2899
|
if (!await pathExists3(filePath)) return false;
|
|
2931
|
-
const stat4 = await
|
|
2900
|
+
const stat4 = await fs12.stat(filePath);
|
|
2932
2901
|
return stat4.size === 0;
|
|
2933
2902
|
}
|
|
2934
2903
|
function buildMemoraoneJetBrainsMcpServer(options) {
|
|
@@ -2960,17 +2929,17 @@ function mergeJetBrainsMcpConfigObject(existing, memoraone, ownership) {
|
|
|
2960
2929
|
}
|
|
2961
2930
|
async function writeJetBrainsMcpJsonAtomic(filePath, content) {
|
|
2962
2931
|
const dir = path20.dirname(filePath);
|
|
2963
|
-
await
|
|
2932
|
+
await fs12.mkdir(dir, { recursive: true });
|
|
2964
2933
|
const tmpPath = path20.join(
|
|
2965
2934
|
dir,
|
|
2966
2935
|
`.${path20.basename(filePath)}.${process.pid}.${(0, import_node_crypto5.randomBytes)(8).toString("hex")}.tmp`
|
|
2967
2936
|
);
|
|
2968
2937
|
try {
|
|
2969
|
-
await
|
|
2970
|
-
await
|
|
2938
|
+
await fs12.writeFile(tmpPath, content, "utf8");
|
|
2939
|
+
await fs12.rename(tmpPath, filePath);
|
|
2971
2940
|
} catch (err) {
|
|
2972
2941
|
try {
|
|
2973
|
-
await
|
|
2942
|
+
await fs12.unlink(tmpPath);
|
|
2974
2943
|
} catch {
|
|
2975
2944
|
}
|
|
2976
2945
|
throw err;
|
|
@@ -2996,13 +2965,13 @@ function validateJetBrainsMcpConfig(parsed2, expected, serverName = CANONICAL_ME
|
|
|
2996
2965
|
}
|
|
2997
2966
|
}
|
|
2998
2967
|
async function readJsonConfig(filePath) {
|
|
2999
|
-
const raw = await
|
|
2968
|
+
const raw = await fs12.readFile(filePath, "utf8");
|
|
3000
2969
|
if (raw.trim() === "") return null;
|
|
3001
2970
|
return JSON.parse(stripLeadingLineComments2(raw));
|
|
3002
2971
|
}
|
|
3003
2972
|
async function backupConfigFile(filePath) {
|
|
3004
2973
|
const backupPath = `${filePath}.bak-${formatJetBrainsBackupTimestamp()}`;
|
|
3005
|
-
await
|
|
2974
|
+
await fs12.copyFile(filePath, backupPath);
|
|
3006
2975
|
return backupPath;
|
|
3007
2976
|
}
|
|
3008
2977
|
async function repairZeroByteConfigFile(filePath, dryRun) {
|
|
@@ -3013,7 +2982,7 @@ async function repairZeroByteConfigFile(filePath, dryRun) {
|
|
|
3013
2982
|
return { repaired: true, backupPath: `${filePath}.bak-<timestamp>` };
|
|
3014
2983
|
}
|
|
3015
2984
|
const backupPath = await backupConfigFile(filePath);
|
|
3016
|
-
await
|
|
2985
|
+
await fs12.unlink(filePath);
|
|
3017
2986
|
return { repaired: true, backupPath };
|
|
3018
2987
|
}
|
|
3019
2988
|
function configHasMemoraone(parsed2) {
|
|
@@ -3044,12 +3013,12 @@ async function removeMemoraoneFromProjectConfig(options) {
|
|
|
3044
3013
|
const { next: mcpServers } = stripMemoraoneOwnedFromServerMap(mcpServersRaw);
|
|
3045
3014
|
const hasOtherServers = Object.keys(mcpServers).length > 0;
|
|
3046
3015
|
if (!hasOtherServers) {
|
|
3047
|
-
await
|
|
3016
|
+
await fs12.unlink(configPath);
|
|
3048
3017
|
return { changed: true, backupPath };
|
|
3049
3018
|
}
|
|
3050
3019
|
const next = { ...parsed2, mcpServers };
|
|
3051
|
-
await
|
|
3052
|
-
await
|
|
3020
|
+
await fs12.mkdir(path20.dirname(configPath), { recursive: true });
|
|
3021
|
+
await fs12.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
|
|
3053
3022
|
return { changed: true, backupPath };
|
|
3054
3023
|
}
|
|
3055
3024
|
async function resolveLocalCliPathAsync() {
|
|
@@ -3274,7 +3243,7 @@ async function setupJetBrainsMcpConfig(options) {
|
|
|
3274
3243
|
backupPath = await backupConfigFile(globalPath);
|
|
3275
3244
|
}
|
|
3276
3245
|
await writeJetBrainsMcpJsonAtomic(globalPath, body);
|
|
3277
|
-
const verifyRaw = await
|
|
3246
|
+
const verifyRaw = await fs12.readFile(globalPath, "utf8");
|
|
3278
3247
|
const verifyParsed = JSON.parse(stripLeadingLineComments2(verifyRaw));
|
|
3279
3248
|
validateJetBrainsMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
|
|
3280
3249
|
const outcome = existed ? "updated" : "created";
|
|
@@ -3295,7 +3264,7 @@ async function setupJetBrainsMcpConfig(options) {
|
|
|
3295
3264
|
}
|
|
3296
3265
|
|
|
3297
3266
|
// src/windsurfMcpConfig.ts
|
|
3298
|
-
var
|
|
3267
|
+
var fs13 = __toESM(require("fs/promises"), 1);
|
|
3299
3268
|
var os6 = __toESM(require("os"), 1);
|
|
3300
3269
|
var path21 = __toESM(require("path"), 1);
|
|
3301
3270
|
var import_node_crypto6 = require("crypto");
|
|
@@ -3304,7 +3273,7 @@ function stripLeadingLineComments3(text) {
|
|
|
3304
3273
|
}
|
|
3305
3274
|
async function pathExists4(filePath) {
|
|
3306
3275
|
try {
|
|
3307
|
-
await
|
|
3276
|
+
await fs13.access(filePath);
|
|
3308
3277
|
return true;
|
|
3309
3278
|
} catch {
|
|
3310
3279
|
return false;
|
|
@@ -3364,17 +3333,17 @@ function stripMemoraoneFromWindsurfConfigObject(existing) {
|
|
|
3364
3333
|
}
|
|
3365
3334
|
async function writeWindsurfMcpJsonAtomic(filePath, content) {
|
|
3366
3335
|
const dir = path21.dirname(filePath);
|
|
3367
|
-
await
|
|
3336
|
+
await fs13.mkdir(dir, { recursive: true });
|
|
3368
3337
|
const tmpPath = path21.join(
|
|
3369
3338
|
dir,
|
|
3370
3339
|
`.${path21.basename(filePath)}.${process.pid}.${(0, import_node_crypto6.randomBytes)(8).toString("hex")}.tmp`
|
|
3371
3340
|
);
|
|
3372
3341
|
try {
|
|
3373
|
-
await
|
|
3374
|
-
await
|
|
3342
|
+
await fs13.writeFile(tmpPath, content, "utf8");
|
|
3343
|
+
await fs13.rename(tmpPath, filePath);
|
|
3375
3344
|
} catch (err) {
|
|
3376
3345
|
try {
|
|
3377
|
-
await
|
|
3346
|
+
await fs13.unlink(tmpPath);
|
|
3378
3347
|
} catch {
|
|
3379
3348
|
}
|
|
3380
3349
|
throw err;
|
|
@@ -3400,13 +3369,13 @@ function validateWindsurfMcpConfig(parsed2, expected, serverName = CANONICAL_MEM
|
|
|
3400
3369
|
}
|
|
3401
3370
|
}
|
|
3402
3371
|
async function readJsonConfig2(filePath) {
|
|
3403
|
-
const raw = await
|
|
3372
|
+
const raw = await fs13.readFile(filePath, "utf8");
|
|
3404
3373
|
if (raw.trim() === "") return null;
|
|
3405
3374
|
return JSON.parse(stripLeadingLineComments3(raw));
|
|
3406
3375
|
}
|
|
3407
3376
|
async function backupConfigFile2(filePath) {
|
|
3408
3377
|
const backupPath = `${filePath}.bak-${formatWindsurfBackupTimestamp()}`;
|
|
3409
|
-
await
|
|
3378
|
+
await fs13.copyFile(filePath, backupPath);
|
|
3410
3379
|
return backupPath;
|
|
3411
3380
|
}
|
|
3412
3381
|
function extractMemoraone(existing) {
|
|
@@ -3541,7 +3510,7 @@ async function setupWindsurfMcpConfig(options) {
|
|
|
3541
3510
|
}
|
|
3542
3511
|
if (!activeAlreadyCorrect) {
|
|
3543
3512
|
await writeWindsurfMcpJsonAtomic(activePath, body);
|
|
3544
|
-
const verifyRaw = await
|
|
3513
|
+
const verifyRaw = await fs13.readFile(activePath, "utf8");
|
|
3545
3514
|
const verifyParsed = JSON.parse(stripLeadingLineComments3(verifyRaw));
|
|
3546
3515
|
validateWindsurfMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
|
|
3547
3516
|
}
|
|
@@ -3581,7 +3550,7 @@ async function setupWindsurfMcpConfig(options) {
|
|
|
3581
3550
|
}
|
|
3582
3551
|
|
|
3583
3552
|
// src/opencodeMcpConfig.ts
|
|
3584
|
-
var
|
|
3553
|
+
var fs14 = __toESM(require("fs/promises"), 1);
|
|
3585
3554
|
var path22 = __toESM(require("path"), 1);
|
|
3586
3555
|
var import_node_crypto7 = require("crypto");
|
|
3587
3556
|
var OPENCODE_CONFIG_SCHEMA_URL = "https://opencode.ai/config.json";
|
|
@@ -3605,7 +3574,7 @@ var OpenCodeJsoncOnlyError = class extends Error {
|
|
|
3605
3574
|
};
|
|
3606
3575
|
async function pathExists5(filePath) {
|
|
3607
3576
|
try {
|
|
3608
|
-
await
|
|
3577
|
+
await fs14.access(filePath);
|
|
3609
3578
|
return true;
|
|
3610
3579
|
} catch {
|
|
3611
3580
|
return false;
|
|
@@ -3657,17 +3626,17 @@ function mergeOpenCodeMcpConfigObject(existing, memoraone) {
|
|
|
3657
3626
|
}
|
|
3658
3627
|
async function writeOpenCodeMcpJsonAtomic(filePath, content) {
|
|
3659
3628
|
const dir = path22.dirname(filePath);
|
|
3660
|
-
await
|
|
3629
|
+
await fs14.mkdir(dir, { recursive: true });
|
|
3661
3630
|
const tmpPath = path22.join(
|
|
3662
3631
|
dir,
|
|
3663
3632
|
`.${path22.basename(filePath)}.${process.pid}.${(0, import_node_crypto7.randomBytes)(8).toString("hex")}.tmp`
|
|
3664
3633
|
);
|
|
3665
3634
|
try {
|
|
3666
|
-
await
|
|
3667
|
-
await
|
|
3635
|
+
await fs14.writeFile(tmpPath, content, "utf8");
|
|
3636
|
+
await fs14.rename(tmpPath, filePath);
|
|
3668
3637
|
} catch (err) {
|
|
3669
3638
|
try {
|
|
3670
|
-
await
|
|
3639
|
+
await fs14.unlink(tmpPath);
|
|
3671
3640
|
} catch {
|
|
3672
3641
|
}
|
|
3673
3642
|
throw err;
|
|
@@ -3692,7 +3661,7 @@ function validateOpenCodeMcpConfig(parsed2, expected) {
|
|
|
3692
3661
|
}
|
|
3693
3662
|
}
|
|
3694
3663
|
async function readJsonConfig3(filePath) {
|
|
3695
|
-
const raw = await
|
|
3664
|
+
const raw = await fs14.readFile(filePath, "utf8");
|
|
3696
3665
|
if (raw.trim() === "") return null;
|
|
3697
3666
|
return JSON.parse(raw);
|
|
3698
3667
|
}
|
|
@@ -3777,7 +3746,7 @@ async function setupOpenCodeMcpConfig(options) {
|
|
|
3777
3746
|
return { outcome: jsonExists ? "updated" : "created", memoraone };
|
|
3778
3747
|
}
|
|
3779
3748
|
await writeOpenCodeMcpJsonAtomic(projectPath, body);
|
|
3780
|
-
const verifyRaw = await
|
|
3749
|
+
const verifyRaw = await fs14.readFile(projectPath, "utf8");
|
|
3781
3750
|
const verifyParsed = JSON.parse(verifyRaw);
|
|
3782
3751
|
validateOpenCodeMcpConfig(verifyParsed, memoraone);
|
|
3783
3752
|
return {
|
|
@@ -3787,7 +3756,7 @@ async function setupOpenCodeMcpConfig(options) {
|
|
|
3787
3756
|
}
|
|
3788
3757
|
|
|
3789
3758
|
// src/codexMcpConfig.ts
|
|
3790
|
-
var
|
|
3759
|
+
var fs15 = __toESM(require("fs/promises"), 1);
|
|
3791
3760
|
var path23 = __toESM(require("path"), 1);
|
|
3792
3761
|
var import_node_crypto8 = require("crypto");
|
|
3793
3762
|
var import_smol_toml = require("smol-toml");
|
|
@@ -3804,7 +3773,7 @@ var CodexMcpTomlParseError = class extends Error {
|
|
|
3804
3773
|
};
|
|
3805
3774
|
async function pathExists6(filePath) {
|
|
3806
3775
|
try {
|
|
3807
|
-
await
|
|
3776
|
+
await fs15.access(filePath);
|
|
3808
3777
|
return true;
|
|
3809
3778
|
} catch {
|
|
3810
3779
|
return false;
|
|
@@ -4064,17 +4033,17 @@ function parseCodexTomlOrThrow(source, configPath) {
|
|
|
4064
4033
|
}
|
|
4065
4034
|
async function writeCodexTomlAtomic(filePath, content) {
|
|
4066
4035
|
const dir = path23.dirname(filePath);
|
|
4067
|
-
await
|
|
4036
|
+
await fs15.mkdir(dir, { recursive: true });
|
|
4068
4037
|
const tmpPath = path23.join(
|
|
4069
4038
|
dir,
|
|
4070
4039
|
`.${path23.basename(filePath)}.${process.pid}.${(0, import_node_crypto8.randomBytes)(8).toString("hex")}.tmp`
|
|
4071
4040
|
);
|
|
4072
4041
|
try {
|
|
4073
|
-
await
|
|
4074
|
-
await
|
|
4042
|
+
await fs15.writeFile(tmpPath, content, "utf8");
|
|
4043
|
+
await fs15.rename(tmpPath, filePath);
|
|
4075
4044
|
} catch (err) {
|
|
4076
4045
|
try {
|
|
4077
|
-
await
|
|
4046
|
+
await fs15.unlink(tmpPath);
|
|
4078
4047
|
} catch {
|
|
4079
4048
|
}
|
|
4080
4049
|
throw err;
|
|
@@ -4135,7 +4104,7 @@ async function setupCodexMcpConfig(options) {
|
|
|
4135
4104
|
const exists = await pathExists6(projectPath);
|
|
4136
4105
|
let existingRaw = null;
|
|
4137
4106
|
if (exists) {
|
|
4138
|
-
existingRaw = await
|
|
4107
|
+
existingRaw = await fs15.readFile(projectPath, "utf8");
|
|
4139
4108
|
const parsed2 = parseCodexTomlOrThrow(existingRaw, projectPath);
|
|
4140
4109
|
const current = extractMemoraoneFromCodexParsed(parsed2);
|
|
4141
4110
|
if (memoraoneServerMatches4(current, memoraone)) {
|
|
@@ -4147,7 +4116,7 @@ async function setupCodexMcpConfig(options) {
|
|
|
4147
4116
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
4148
4117
|
}
|
|
4149
4118
|
await writeCodexTomlAtomic(projectPath, next);
|
|
4150
|
-
const verifyRaw = await
|
|
4119
|
+
const verifyRaw = await fs15.readFile(projectPath, "utf8");
|
|
4151
4120
|
const verifyParsed = parseCodexTomlOrThrow(verifyRaw, projectPath);
|
|
4152
4121
|
validateCodexMcpConfig(verifyParsed, memoraone);
|
|
4153
4122
|
return {
|
|
@@ -4157,7 +4126,7 @@ async function setupCodexMcpConfig(options) {
|
|
|
4157
4126
|
}
|
|
4158
4127
|
|
|
4159
4128
|
// src/kiroMcpConfig.ts
|
|
4160
|
-
var
|
|
4129
|
+
var fs16 = __toESM(require("fs/promises"), 1);
|
|
4161
4130
|
var path24 = __toESM(require("path"), 1);
|
|
4162
4131
|
var import_node_crypto9 = require("crypto");
|
|
4163
4132
|
var KiroMcpJsonParseError = class extends Error {
|
|
@@ -4174,7 +4143,7 @@ function stripLeadingLineComments4(text) {
|
|
|
4174
4143
|
}
|
|
4175
4144
|
async function pathExists7(filePath) {
|
|
4176
4145
|
try {
|
|
4177
|
-
await
|
|
4146
|
+
await fs16.access(filePath);
|
|
4178
4147
|
return true;
|
|
4179
4148
|
} catch {
|
|
4180
4149
|
return false;
|
|
@@ -4213,17 +4182,17 @@ function mergeKiroMcpConfigObject(existing, memoraone) {
|
|
|
4213
4182
|
}
|
|
4214
4183
|
async function writeKiroMcpJsonAtomic(filePath, content) {
|
|
4215
4184
|
const dir = path24.dirname(filePath);
|
|
4216
|
-
await
|
|
4185
|
+
await fs16.mkdir(dir, { recursive: true });
|
|
4217
4186
|
const tmpPath = path24.join(
|
|
4218
4187
|
dir,
|
|
4219
4188
|
`.${path24.basename(filePath)}.${process.pid}.${(0, import_node_crypto9.randomBytes)(8).toString("hex")}.tmp`
|
|
4220
4189
|
);
|
|
4221
4190
|
try {
|
|
4222
|
-
await
|
|
4223
|
-
await
|
|
4191
|
+
await fs16.writeFile(tmpPath, content, "utf8");
|
|
4192
|
+
await fs16.rename(tmpPath, filePath);
|
|
4224
4193
|
} catch (err) {
|
|
4225
4194
|
try {
|
|
4226
|
-
await
|
|
4195
|
+
await fs16.unlink(tmpPath);
|
|
4227
4196
|
} catch {
|
|
4228
4197
|
}
|
|
4229
4198
|
throw err;
|
|
@@ -4248,7 +4217,7 @@ function validateKiroMcpConfig(parsed2, expected) {
|
|
|
4248
4217
|
}
|
|
4249
4218
|
}
|
|
4250
4219
|
async function readJsonConfig4(filePath) {
|
|
4251
|
-
const raw = await
|
|
4220
|
+
const raw = await fs16.readFile(filePath, "utf8");
|
|
4252
4221
|
if (raw.trim() === "") return null;
|
|
4253
4222
|
return JSON.parse(stripLeadingLineComments4(raw));
|
|
4254
4223
|
}
|
|
@@ -4328,7 +4297,7 @@ async function setupKiroMcpConfig(options) {
|
|
|
4328
4297
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
4329
4298
|
}
|
|
4330
4299
|
await writeKiroMcpJsonAtomic(projectPath, body);
|
|
4331
|
-
const verifyRaw = await
|
|
4300
|
+
const verifyRaw = await fs16.readFile(projectPath, "utf8");
|
|
4332
4301
|
const verifyParsed = JSON.parse(stripLeadingLineComments4(verifyRaw));
|
|
4333
4302
|
validateKiroMcpConfig(verifyParsed, memoraone);
|
|
4334
4303
|
return {
|
|
@@ -4338,7 +4307,7 @@ async function setupKiroMcpConfig(options) {
|
|
|
4338
4307
|
}
|
|
4339
4308
|
|
|
4340
4309
|
// src/rooCodeMcpConfig.ts
|
|
4341
|
-
var
|
|
4310
|
+
var fs17 = __toESM(require("fs/promises"), 1);
|
|
4342
4311
|
var path25 = __toESM(require("path"), 1);
|
|
4343
4312
|
var import_node_crypto10 = require("crypto");
|
|
4344
4313
|
var RooCodeMcpJsonParseError = class extends Error {
|
|
@@ -4355,7 +4324,7 @@ function stripLeadingLineComments5(text) {
|
|
|
4355
4324
|
}
|
|
4356
4325
|
async function pathExists8(filePath) {
|
|
4357
4326
|
try {
|
|
4358
|
-
await
|
|
4327
|
+
await fs17.access(filePath);
|
|
4359
4328
|
return true;
|
|
4360
4329
|
} catch {
|
|
4361
4330
|
return false;
|
|
@@ -4395,17 +4364,17 @@ function mergeRooCodeMcpConfigObject(existing, memoraone) {
|
|
|
4395
4364
|
}
|
|
4396
4365
|
async function writeRooCodeMcpJsonAtomic(filePath, content) {
|
|
4397
4366
|
const dir = path25.dirname(filePath);
|
|
4398
|
-
await
|
|
4367
|
+
await fs17.mkdir(dir, { recursive: true });
|
|
4399
4368
|
const tmpPath = path25.join(
|
|
4400
4369
|
dir,
|
|
4401
4370
|
`.${path25.basename(filePath)}.${process.pid}.${(0, import_node_crypto10.randomBytes)(8).toString("hex")}.tmp`
|
|
4402
4371
|
);
|
|
4403
4372
|
try {
|
|
4404
|
-
await
|
|
4405
|
-
await
|
|
4373
|
+
await fs17.writeFile(tmpPath, content, "utf8");
|
|
4374
|
+
await fs17.rename(tmpPath, filePath);
|
|
4406
4375
|
} catch (err) {
|
|
4407
4376
|
try {
|
|
4408
|
-
await
|
|
4377
|
+
await fs17.unlink(tmpPath);
|
|
4409
4378
|
} catch {
|
|
4410
4379
|
}
|
|
4411
4380
|
throw err;
|
|
@@ -4430,7 +4399,7 @@ function validateRooCodeMcpConfig(parsed2, expected) {
|
|
|
4430
4399
|
}
|
|
4431
4400
|
}
|
|
4432
4401
|
async function readJsonConfig5(filePath) {
|
|
4433
|
-
const raw = await
|
|
4402
|
+
const raw = await fs17.readFile(filePath, "utf8");
|
|
4434
4403
|
if (raw.trim() === "") return null;
|
|
4435
4404
|
return JSON.parse(stripLeadingLineComments5(raw));
|
|
4436
4405
|
}
|
|
@@ -4510,7 +4479,7 @@ async function setupRooCodeMcpConfig(options) {
|
|
|
4510
4479
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
4511
4480
|
}
|
|
4512
4481
|
await writeRooCodeMcpJsonAtomic(projectPath, body);
|
|
4513
|
-
const verifyRaw = await
|
|
4482
|
+
const verifyRaw = await fs17.readFile(projectPath, "utf8");
|
|
4514
4483
|
const verifyParsed = JSON.parse(stripLeadingLineComments5(verifyRaw));
|
|
4515
4484
|
validateRooCodeMcpConfig(verifyParsed, memoraone);
|
|
4516
4485
|
return {
|
|
@@ -4520,7 +4489,7 @@ async function setupRooCodeMcpConfig(options) {
|
|
|
4520
4489
|
}
|
|
4521
4490
|
|
|
4522
4491
|
// src/clineCliMcpConfig.ts
|
|
4523
|
-
var
|
|
4492
|
+
var fs18 = __toESM(require("fs/promises"), 1);
|
|
4524
4493
|
var os7 = __toESM(require("os"), 1);
|
|
4525
4494
|
var path26 = __toESM(require("path"), 1);
|
|
4526
4495
|
var import_node_crypto11 = require("crypto");
|
|
@@ -4539,7 +4508,7 @@ function stripLeadingLineComments6(text) {
|
|
|
4539
4508
|
}
|
|
4540
4509
|
async function pathExists9(filePath) {
|
|
4541
4510
|
try {
|
|
4542
|
-
await
|
|
4511
|
+
await fs18.access(filePath);
|
|
4543
4512
|
return true;
|
|
4544
4513
|
} catch {
|
|
4545
4514
|
return false;
|
|
@@ -4593,17 +4562,17 @@ function mergeClineCliMcpConfigObject(existing, memoraone, ownership) {
|
|
|
4593
4562
|
}
|
|
4594
4563
|
async function writeClineCliMcpJsonAtomic(filePath, content) {
|
|
4595
4564
|
const dir = path26.dirname(filePath);
|
|
4596
|
-
await
|
|
4565
|
+
await fs18.mkdir(dir, { recursive: true });
|
|
4597
4566
|
const tmpPath = path26.join(
|
|
4598
4567
|
dir,
|
|
4599
4568
|
`.${path26.basename(filePath)}.${process.pid}.${(0, import_node_crypto11.randomBytes)(8).toString("hex")}.tmp`
|
|
4600
4569
|
);
|
|
4601
4570
|
try {
|
|
4602
|
-
await
|
|
4603
|
-
await
|
|
4571
|
+
await fs18.writeFile(tmpPath, content, "utf8");
|
|
4572
|
+
await fs18.rename(tmpPath, filePath);
|
|
4604
4573
|
} catch (err) {
|
|
4605
4574
|
try {
|
|
4606
|
-
await
|
|
4575
|
+
await fs18.unlink(tmpPath);
|
|
4607
4576
|
} catch {
|
|
4608
4577
|
}
|
|
4609
4578
|
throw err;
|
|
@@ -4629,7 +4598,7 @@ function validateClineCliMcpConfig(parsed2, expected, serverName = CANONICAL_MEM
|
|
|
4629
4598
|
}
|
|
4630
4599
|
}
|
|
4631
4600
|
async function readJsonConfig6(filePath) {
|
|
4632
|
-
const raw = await
|
|
4601
|
+
const raw = await fs18.readFile(filePath, "utf8");
|
|
4633
4602
|
if (raw.trim() === "") return null;
|
|
4634
4603
|
return JSON.parse(stripLeadingLineComments6(raw));
|
|
4635
4604
|
}
|
|
@@ -4750,7 +4719,7 @@ async function setupClineCliMcpConfig(options) {
|
|
|
4750
4719
|
for (const prepared of [rootPrepared, settingsPrepared]) {
|
|
4751
4720
|
if (prepared.alreadyCorrect) continue;
|
|
4752
4721
|
await writeClineCliMcpJsonAtomic(prepared.filePath, prepared.body);
|
|
4753
|
-
const verifyRaw = await
|
|
4722
|
+
const verifyRaw = await fs18.readFile(prepared.filePath, "utf8");
|
|
4754
4723
|
const verifyParsed = JSON.parse(stripLeadingLineComments6(verifyRaw));
|
|
4755
4724
|
validateClineCliMcpConfig(
|
|
4756
4725
|
verifyParsed,
|
|
@@ -4770,7 +4739,7 @@ async function setupClineCliMcpConfig(options) {
|
|
|
4770
4739
|
}
|
|
4771
4740
|
|
|
4772
4741
|
// src/claudeDesktopMcpConfig.ts
|
|
4773
|
-
var
|
|
4742
|
+
var fs19 = __toESM(require("fs/promises"), 1);
|
|
4774
4743
|
var os8 = __toESM(require("os"), 1);
|
|
4775
4744
|
var path27 = __toESM(require("path"), 1);
|
|
4776
4745
|
var import_node_crypto12 = require("crypto");
|
|
@@ -4788,7 +4757,7 @@ function stripLeadingLineComments7(text) {
|
|
|
4788
4757
|
}
|
|
4789
4758
|
async function pathExists10(filePath) {
|
|
4790
4759
|
try {
|
|
4791
|
-
await
|
|
4760
|
+
await fs19.access(filePath);
|
|
4792
4761
|
return true;
|
|
4793
4762
|
} catch {
|
|
4794
4763
|
return false;
|
|
@@ -4838,17 +4807,17 @@ function mergeClaudeDesktopMcpConfigObject(existing, memoraone, ownership) {
|
|
|
4838
4807
|
}
|
|
4839
4808
|
async function writeClaudeDesktopMcpJsonAtomic(filePath, content) {
|
|
4840
4809
|
const dir = path27.dirname(filePath);
|
|
4841
|
-
await
|
|
4810
|
+
await fs19.mkdir(dir, { recursive: true });
|
|
4842
4811
|
const tmpPath = path27.join(
|
|
4843
4812
|
dir,
|
|
4844
4813
|
`.${path27.basename(filePath)}.${process.pid}.${(0, import_node_crypto12.randomBytes)(8).toString("hex")}.tmp`
|
|
4845
4814
|
);
|
|
4846
4815
|
try {
|
|
4847
|
-
await
|
|
4848
|
-
await
|
|
4816
|
+
await fs19.writeFile(tmpPath, content, "utf8");
|
|
4817
|
+
await fs19.rename(tmpPath, filePath);
|
|
4849
4818
|
} catch (err) {
|
|
4850
4819
|
try {
|
|
4851
|
-
await
|
|
4820
|
+
await fs19.unlink(tmpPath);
|
|
4852
4821
|
} catch {
|
|
4853
4822
|
}
|
|
4854
4823
|
throw err;
|
|
@@ -4874,13 +4843,13 @@ function validateClaudeDesktopMcpConfig(parsed2, expected, serverName = CANONICA
|
|
|
4874
4843
|
}
|
|
4875
4844
|
}
|
|
4876
4845
|
async function readJsonConfig7(filePath) {
|
|
4877
|
-
const raw = await
|
|
4846
|
+
const raw = await fs19.readFile(filePath, "utf8");
|
|
4878
4847
|
if (raw.trim() === "") return null;
|
|
4879
4848
|
return JSON.parse(stripLeadingLineComments7(raw));
|
|
4880
4849
|
}
|
|
4881
4850
|
async function backupConfigFile3(filePath) {
|
|
4882
4851
|
const backupPath = `${filePath}.bak-${formatClaudeDesktopBackupTimestamp()}`;
|
|
4883
|
-
await
|
|
4852
|
+
await fs19.copyFile(filePath, backupPath);
|
|
4884
4853
|
return backupPath;
|
|
4885
4854
|
}
|
|
4886
4855
|
async function buildClaudeDesktopMemoraoneServer(options) {
|
|
@@ -4967,7 +4936,7 @@ async function setupClaudeDesktopMcpConfig(options) {
|
|
|
4967
4936
|
backupPath = await backupConfigFile3(activePath);
|
|
4968
4937
|
}
|
|
4969
4938
|
await writeClaudeDesktopMcpJsonAtomic(activePath, body);
|
|
4970
|
-
const verifyRaw = await
|
|
4939
|
+
const verifyRaw = await fs19.readFile(activePath, "utf8");
|
|
4971
4940
|
const verifyParsed = JSON.parse(stripLeadingLineComments7(verifyRaw));
|
|
4972
4941
|
validateClaudeDesktopMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
|
|
4973
4942
|
return {
|
|
@@ -4979,7 +4948,7 @@ async function setupClaudeDesktopMcpConfig(options) {
|
|
|
4979
4948
|
}
|
|
4980
4949
|
|
|
4981
4950
|
// src/zedMcpConfig.ts
|
|
4982
|
-
var
|
|
4951
|
+
var fs20 = __toESM(require("fs/promises"), 1);
|
|
4983
4952
|
var path28 = __toESM(require("path"), 1);
|
|
4984
4953
|
var import_node_crypto13 = require("crypto");
|
|
4985
4954
|
var ZedMcpJsonParseError = class extends Error {
|
|
@@ -4996,7 +4965,7 @@ function stripLeadingLineComments8(text) {
|
|
|
4996
4965
|
}
|
|
4997
4966
|
async function pathExists11(filePath) {
|
|
4998
4967
|
try {
|
|
4999
|
-
await
|
|
4968
|
+
await fs20.access(filePath);
|
|
5000
4969
|
return true;
|
|
5001
4970
|
} catch {
|
|
5002
4971
|
return false;
|
|
@@ -5039,17 +5008,17 @@ function mergeZedMcpConfigObject(existing, memoraone) {
|
|
|
5039
5008
|
}
|
|
5040
5009
|
async function writeZedMcpJsonAtomic(filePath, content) {
|
|
5041
5010
|
const dir = path28.dirname(filePath);
|
|
5042
|
-
await
|
|
5011
|
+
await fs20.mkdir(dir, { recursive: true });
|
|
5043
5012
|
const tmpPath = path28.join(
|
|
5044
5013
|
dir,
|
|
5045
5014
|
`.${path28.basename(filePath)}.${process.pid}.${(0, import_node_crypto13.randomBytes)(8).toString("hex")}.tmp`
|
|
5046
5015
|
);
|
|
5047
5016
|
try {
|
|
5048
|
-
await
|
|
5049
|
-
await
|
|
5017
|
+
await fs20.writeFile(tmpPath, content, "utf8");
|
|
5018
|
+
await fs20.rename(tmpPath, filePath);
|
|
5050
5019
|
} catch (err) {
|
|
5051
5020
|
try {
|
|
5052
|
-
await
|
|
5021
|
+
await fs20.unlink(tmpPath);
|
|
5053
5022
|
} catch {
|
|
5054
5023
|
}
|
|
5055
5024
|
throw err;
|
|
@@ -5074,7 +5043,7 @@ function validateZedMcpConfig(parsed2, expected) {
|
|
|
5074
5043
|
}
|
|
5075
5044
|
}
|
|
5076
5045
|
async function readJsonConfig8(filePath) {
|
|
5077
|
-
const raw = await
|
|
5046
|
+
const raw = await fs20.readFile(filePath, "utf8");
|
|
5078
5047
|
if (raw.trim() === "") return null;
|
|
5079
5048
|
return JSON.parse(stripLeadingLineComments8(raw));
|
|
5080
5049
|
}
|
|
@@ -5154,7 +5123,7 @@ async function setupZedMcpConfig(options) {
|
|
|
5154
5123
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
5155
5124
|
}
|
|
5156
5125
|
await writeZedMcpJsonAtomic(projectPath, body);
|
|
5157
|
-
const verifyRaw = await
|
|
5126
|
+
const verifyRaw = await fs20.readFile(projectPath, "utf8");
|
|
5158
5127
|
const verifyParsed = JSON.parse(stripLeadingLineComments8(verifyRaw));
|
|
5159
5128
|
validateZedMcpConfig(verifyParsed, memoraone);
|
|
5160
5129
|
return {
|
|
@@ -5164,7 +5133,7 @@ async function setupZedMcpConfig(options) {
|
|
|
5164
5133
|
}
|
|
5165
5134
|
|
|
5166
5135
|
// src/visualStudioMcpConfig.ts
|
|
5167
|
-
var
|
|
5136
|
+
var fs21 = __toESM(require("fs/promises"), 1);
|
|
5168
5137
|
var path29 = __toESM(require("path"), 1);
|
|
5169
5138
|
var import_node_crypto14 = require("crypto");
|
|
5170
5139
|
var VisualStudioMcpJsonParseError = class extends Error {
|
|
@@ -5181,7 +5150,7 @@ function stripLeadingLineComments9(text) {
|
|
|
5181
5150
|
}
|
|
5182
5151
|
async function pathExists12(filePath) {
|
|
5183
5152
|
try {
|
|
5184
|
-
await
|
|
5153
|
+
await fs21.access(filePath);
|
|
5185
5154
|
return true;
|
|
5186
5155
|
} catch {
|
|
5187
5156
|
return false;
|
|
@@ -5222,17 +5191,17 @@ function mergeVisualStudioMcpConfigObject(existing, memoraone) {
|
|
|
5222
5191
|
}
|
|
5223
5192
|
async function writeVisualStudioMcpJsonAtomic(filePath, content) {
|
|
5224
5193
|
const dir = path29.dirname(filePath);
|
|
5225
|
-
await
|
|
5194
|
+
await fs21.mkdir(dir, { recursive: true });
|
|
5226
5195
|
const tmpPath = path29.join(
|
|
5227
5196
|
dir,
|
|
5228
5197
|
`.${path29.basename(filePath)}.${process.pid}.${(0, import_node_crypto14.randomBytes)(8).toString("hex")}.tmp`
|
|
5229
5198
|
);
|
|
5230
5199
|
try {
|
|
5231
|
-
await
|
|
5232
|
-
await
|
|
5200
|
+
await fs21.writeFile(tmpPath, content, "utf8");
|
|
5201
|
+
await fs21.rename(tmpPath, filePath);
|
|
5233
5202
|
} catch (err) {
|
|
5234
5203
|
try {
|
|
5235
|
-
await
|
|
5204
|
+
await fs21.unlink(tmpPath);
|
|
5236
5205
|
} catch {
|
|
5237
5206
|
}
|
|
5238
5207
|
throw err;
|
|
@@ -5257,7 +5226,7 @@ function validateVisualStudioMcpConfig(parsed2, expected) {
|
|
|
5257
5226
|
}
|
|
5258
5227
|
}
|
|
5259
5228
|
async function readJsonConfig9(filePath) {
|
|
5260
|
-
const raw = await
|
|
5229
|
+
const raw = await fs21.readFile(filePath, "utf8");
|
|
5261
5230
|
if (raw.trim() === "") return null;
|
|
5262
5231
|
return JSON.parse(stripLeadingLineComments9(raw));
|
|
5263
5232
|
}
|
|
@@ -5337,7 +5306,7 @@ async function setupVisualStudioMcpConfig(options) {
|
|
|
5337
5306
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
5338
5307
|
}
|
|
5339
5308
|
await writeVisualStudioMcpJsonAtomic(projectPath, body);
|
|
5340
|
-
const verifyRaw = await
|
|
5309
|
+
const verifyRaw = await fs21.readFile(projectPath, "utf8");
|
|
5341
5310
|
const verifyParsed = JSON.parse(stripLeadingLineComments9(verifyRaw));
|
|
5342
5311
|
validateVisualStudioMcpConfig(verifyParsed, memoraone);
|
|
5343
5312
|
return {
|
|
@@ -5347,7 +5316,7 @@ async function setupVisualStudioMcpConfig(options) {
|
|
|
5347
5316
|
}
|
|
5348
5317
|
|
|
5349
5318
|
// src/continueMcpConfig.ts
|
|
5350
|
-
var
|
|
5319
|
+
var fs22 = __toESM(require("fs/promises"), 1);
|
|
5351
5320
|
var path30 = __toESM(require("path"), 1);
|
|
5352
5321
|
var import_node_crypto15 = require("crypto");
|
|
5353
5322
|
var import_yaml = require("yaml");
|
|
@@ -5362,7 +5331,7 @@ var ContinueMcpYamlParseError = class extends Error {
|
|
|
5362
5331
|
};
|
|
5363
5332
|
async function pathExists13(filePath) {
|
|
5364
5333
|
try {
|
|
5365
|
-
await
|
|
5334
|
+
await fs22.access(filePath);
|
|
5366
5335
|
return true;
|
|
5367
5336
|
} catch {
|
|
5368
5337
|
return false;
|
|
@@ -5429,17 +5398,17 @@ function mergeContinueMcpConfigObject(existing, memoraone) {
|
|
|
5429
5398
|
}
|
|
5430
5399
|
async function writeContinueMcpYamlAtomic(filePath, content) {
|
|
5431
5400
|
const dir = path30.dirname(filePath);
|
|
5432
|
-
await
|
|
5401
|
+
await fs22.mkdir(dir, { recursive: true });
|
|
5433
5402
|
const tmpPath = path30.join(
|
|
5434
5403
|
dir,
|
|
5435
5404
|
`.${path30.basename(filePath)}.${process.pid}.${(0, import_node_crypto15.randomBytes)(8).toString("hex")}.tmp`
|
|
5436
5405
|
);
|
|
5437
5406
|
try {
|
|
5438
|
-
await
|
|
5439
|
-
await
|
|
5407
|
+
await fs22.writeFile(tmpPath, content, "utf8");
|
|
5408
|
+
await fs22.rename(tmpPath, filePath);
|
|
5440
5409
|
} catch (err) {
|
|
5441
5410
|
try {
|
|
5442
|
-
await
|
|
5411
|
+
await fs22.unlink(tmpPath);
|
|
5443
5412
|
} catch {
|
|
5444
5413
|
}
|
|
5445
5414
|
throw err;
|
|
@@ -5534,7 +5503,7 @@ async function setupContinueMcpConfig(options) {
|
|
|
5534
5503
|
let existing = null;
|
|
5535
5504
|
if (exists) {
|
|
5536
5505
|
try {
|
|
5537
|
-
const raw = await
|
|
5506
|
+
const raw = await fs22.readFile(projectPath, "utf8");
|
|
5538
5507
|
existing = parseContinueYaml(raw);
|
|
5539
5508
|
} catch {
|
|
5540
5509
|
throw new ContinueMcpYamlParseError(projectPath);
|
|
@@ -5559,7 +5528,7 @@ async function setupContinueMcpConfig(options) {
|
|
|
5559
5528
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
5560
5529
|
}
|
|
5561
5530
|
await writeContinueMcpYamlAtomic(projectPath, body);
|
|
5562
|
-
const verifyRaw = await
|
|
5531
|
+
const verifyRaw = await fs22.readFile(projectPath, "utf8");
|
|
5563
5532
|
let verifyParsed;
|
|
5564
5533
|
try {
|
|
5565
5534
|
verifyParsed = (0, import_yaml.parse)(verifyRaw);
|
|
@@ -5575,7 +5544,7 @@ async function setupContinueMcpConfig(options) {
|
|
|
5575
5544
|
|
|
5576
5545
|
// src/clineMcpConfig.ts
|
|
5577
5546
|
var import_node_crypto16 = require("crypto");
|
|
5578
|
-
var
|
|
5547
|
+
var fs23 = __toESM(require("fs/promises"), 1);
|
|
5579
5548
|
var path31 = __toESM(require("path"), 1);
|
|
5580
5549
|
var ClineMcpJsonParseError = class extends Error {
|
|
5581
5550
|
constructor(configPath) {
|
|
@@ -5591,7 +5560,7 @@ function stripLeadingLineComments10(text) {
|
|
|
5591
5560
|
}
|
|
5592
5561
|
async function pathExists14(filePath) {
|
|
5593
5562
|
try {
|
|
5594
|
-
await
|
|
5563
|
+
await fs23.access(filePath);
|
|
5595
5564
|
return true;
|
|
5596
5565
|
} catch {
|
|
5597
5566
|
return false;
|
|
@@ -5624,17 +5593,17 @@ function mergeClineMcpConfigObject(existing, memoraone) {
|
|
|
5624
5593
|
}
|
|
5625
5594
|
async function writeClineMcpJsonAtomic(filePath, content) {
|
|
5626
5595
|
const dir = path31.dirname(filePath);
|
|
5627
|
-
await
|
|
5596
|
+
await fs23.mkdir(dir, { recursive: true });
|
|
5628
5597
|
const tmpPath = path31.join(
|
|
5629
5598
|
dir,
|
|
5630
5599
|
`.${path31.basename(filePath)}.${process.pid}.${(0, import_node_crypto16.randomBytes)(8).toString("hex")}.tmp`
|
|
5631
5600
|
);
|
|
5632
5601
|
try {
|
|
5633
|
-
await
|
|
5634
|
-
await
|
|
5602
|
+
await fs23.writeFile(tmpPath, content, "utf8");
|
|
5603
|
+
await fs23.rename(tmpPath, filePath);
|
|
5635
5604
|
} catch (err) {
|
|
5636
5605
|
try {
|
|
5637
|
-
await
|
|
5606
|
+
await fs23.unlink(tmpPath);
|
|
5638
5607
|
} catch {
|
|
5639
5608
|
}
|
|
5640
5609
|
throw err;
|
|
@@ -5657,13 +5626,13 @@ function validateClineMcpConfig(parsed2, expected) {
|
|
|
5657
5626
|
}
|
|
5658
5627
|
}
|
|
5659
5628
|
async function readJsonConfig10(filePath) {
|
|
5660
|
-
const raw = await
|
|
5629
|
+
const raw = await fs23.readFile(filePath, "utf8");
|
|
5661
5630
|
if (raw.trim() === "") return null;
|
|
5662
5631
|
return JSON.parse(stripLeadingLineComments10(raw));
|
|
5663
5632
|
}
|
|
5664
5633
|
async function backupConfigFile4(filePath) {
|
|
5665
5634
|
const backupPath = `${filePath}.bak-${formatClineBackupTimestamp()}`;
|
|
5666
|
-
await
|
|
5635
|
+
await fs23.copyFile(filePath, backupPath);
|
|
5667
5636
|
return backupPath;
|
|
5668
5637
|
}
|
|
5669
5638
|
async function buildClineMemoraoneServer(options) {
|
|
@@ -5729,12 +5698,12 @@ async function setupClineMcpConfig(options) {
|
|
|
5729
5698
|
if (options.dryRun) return { activeConfigPath: configPath, outcome, memoraone };
|
|
5730
5699
|
const backupPath = existed ? await backupConfigFile4(configPath) : void 0;
|
|
5731
5700
|
await writeClineMcpJsonAtomic(configPath, JSON.stringify(merged, null, 2) + "\n");
|
|
5732
|
-
validateClineMcpConfig(JSON.parse(await
|
|
5701
|
+
validateClineMcpConfig(JSON.parse(await fs23.readFile(configPath, "utf8")), memoraone);
|
|
5733
5702
|
return { activeConfigPath: configPath, outcome, backupPath, memoraone };
|
|
5734
5703
|
}
|
|
5735
5704
|
|
|
5736
5705
|
// src/copilotCliMcpConfig.ts
|
|
5737
|
-
var
|
|
5706
|
+
var fs24 = __toESM(require("fs/promises"), 1);
|
|
5738
5707
|
var path32 = __toESM(require("path"), 1);
|
|
5739
5708
|
var import_node_crypto17 = require("crypto");
|
|
5740
5709
|
var CopilotCliMcpJsonParseError = class extends Error {
|
|
@@ -5751,7 +5720,7 @@ function stripLeadingLineComments11(text) {
|
|
|
5751
5720
|
}
|
|
5752
5721
|
async function pathExists15(filePath) {
|
|
5753
5722
|
try {
|
|
5754
|
-
await
|
|
5723
|
+
await fs24.access(filePath);
|
|
5755
5724
|
return true;
|
|
5756
5725
|
} catch {
|
|
5757
5726
|
return false;
|
|
@@ -5792,17 +5761,17 @@ function mergeCopilotCliMcpConfigObject(existing, memoraone) {
|
|
|
5792
5761
|
}
|
|
5793
5762
|
async function writeCopilotCliMcpJsonAtomic(filePath, content) {
|
|
5794
5763
|
const dir = path32.dirname(filePath);
|
|
5795
|
-
await
|
|
5764
|
+
await fs24.mkdir(dir, { recursive: true });
|
|
5796
5765
|
const tmpPath = path32.join(
|
|
5797
5766
|
dir,
|
|
5798
5767
|
`.${path32.basename(filePath)}.${process.pid}.${(0, import_node_crypto17.randomBytes)(8).toString("hex")}.tmp`
|
|
5799
5768
|
);
|
|
5800
5769
|
try {
|
|
5801
|
-
await
|
|
5802
|
-
await
|
|
5770
|
+
await fs24.writeFile(tmpPath, content, "utf8");
|
|
5771
|
+
await fs24.rename(tmpPath, filePath);
|
|
5803
5772
|
} catch (err) {
|
|
5804
5773
|
try {
|
|
5805
|
-
await
|
|
5774
|
+
await fs24.unlink(tmpPath);
|
|
5806
5775
|
} catch {
|
|
5807
5776
|
}
|
|
5808
5777
|
throw err;
|
|
@@ -5827,7 +5796,7 @@ function validateCopilotCliMcpConfig(parsed2, expected) {
|
|
|
5827
5796
|
}
|
|
5828
5797
|
}
|
|
5829
5798
|
async function readJsonConfig11(filePath) {
|
|
5830
|
-
const raw = await
|
|
5799
|
+
const raw = await fs24.readFile(filePath, "utf8");
|
|
5831
5800
|
if (raw.trim() === "") return null;
|
|
5832
5801
|
return JSON.parse(stripLeadingLineComments11(raw));
|
|
5833
5802
|
}
|
|
@@ -5907,7 +5876,7 @@ async function setupCopilotCliMcpConfig(options) {
|
|
|
5907
5876
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
5908
5877
|
}
|
|
5909
5878
|
await writeCopilotCliMcpJsonAtomic(projectPath, body);
|
|
5910
|
-
const verifyRaw = await
|
|
5879
|
+
const verifyRaw = await fs24.readFile(projectPath, "utf8");
|
|
5911
5880
|
const verifyParsed = JSON.parse(stripLeadingLineComments11(verifyRaw));
|
|
5912
5881
|
validateCopilotCliMcpConfig(verifyParsed, memoraone);
|
|
5913
5882
|
return {
|
|
@@ -5917,7 +5886,7 @@ async function setupCopilotCliMcpConfig(options) {
|
|
|
5917
5886
|
}
|
|
5918
5887
|
|
|
5919
5888
|
// src/auggieMcpConfig.ts
|
|
5920
|
-
var
|
|
5889
|
+
var fs25 = __toESM(require("fs/promises"), 1);
|
|
5921
5890
|
var path33 = __toESM(require("path"), 1);
|
|
5922
5891
|
var import_node_crypto18 = require("crypto");
|
|
5923
5892
|
var AuggieMcpJsonParseError = class extends Error {
|
|
@@ -5934,7 +5903,7 @@ function stripLeadingLineComments12(text) {
|
|
|
5934
5903
|
}
|
|
5935
5904
|
async function pathExists16(filePath) {
|
|
5936
5905
|
try {
|
|
5937
|
-
await
|
|
5906
|
+
await fs25.access(filePath);
|
|
5938
5907
|
return true;
|
|
5939
5908
|
} catch {
|
|
5940
5909
|
return false;
|
|
@@ -5974,17 +5943,17 @@ function mergeAuggieMcpConfigObject(existing, memoraone) {
|
|
|
5974
5943
|
}
|
|
5975
5944
|
async function writeAuggieMcpJsonAtomic(filePath, content) {
|
|
5976
5945
|
const dir = path33.dirname(filePath);
|
|
5977
|
-
await
|
|
5946
|
+
await fs25.mkdir(dir, { recursive: true });
|
|
5978
5947
|
const tmpPath = path33.join(
|
|
5979
5948
|
dir,
|
|
5980
5949
|
`.${path33.basename(filePath)}.${process.pid}.${(0, import_node_crypto18.randomBytes)(8).toString("hex")}.tmp`
|
|
5981
5950
|
);
|
|
5982
5951
|
try {
|
|
5983
|
-
await
|
|
5984
|
-
await
|
|
5952
|
+
await fs25.writeFile(tmpPath, content, "utf8");
|
|
5953
|
+
await fs25.rename(tmpPath, filePath);
|
|
5985
5954
|
} catch (err) {
|
|
5986
5955
|
try {
|
|
5987
|
-
await
|
|
5956
|
+
await fs25.unlink(tmpPath);
|
|
5988
5957
|
} catch {
|
|
5989
5958
|
}
|
|
5990
5959
|
throw err;
|
|
@@ -6009,7 +5978,7 @@ function validateAuggieMcpConfig(parsed2, expected) {
|
|
|
6009
5978
|
}
|
|
6010
5979
|
}
|
|
6011
5980
|
async function readJsonConfig12(filePath) {
|
|
6012
|
-
const raw = await
|
|
5981
|
+
const raw = await fs25.readFile(filePath, "utf8");
|
|
6013
5982
|
if (raw.trim() === "") return null;
|
|
6014
5983
|
return JSON.parse(stripLeadingLineComments12(raw));
|
|
6015
5984
|
}
|
|
@@ -6089,7 +6058,7 @@ async function setupAuggieMcpConfig(options) {
|
|
|
6089
6058
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
6090
6059
|
}
|
|
6091
6060
|
await writeAuggieMcpJsonAtomic(projectPath, body);
|
|
6092
|
-
const verifyRaw = await
|
|
6061
|
+
const verifyRaw = await fs25.readFile(projectPath, "utf8");
|
|
6093
6062
|
const verifyParsed = JSON.parse(stripLeadingLineComments12(verifyRaw));
|
|
6094
6063
|
validateAuggieMcpConfig(verifyParsed, memoraone);
|
|
6095
6064
|
return {
|
|
@@ -6099,7 +6068,7 @@ async function setupAuggieMcpConfig(options) {
|
|
|
6099
6068
|
}
|
|
6100
6069
|
|
|
6101
6070
|
// src/geminiCliMcpConfig.ts
|
|
6102
|
-
var
|
|
6071
|
+
var fs26 = __toESM(require("fs/promises"), 1);
|
|
6103
6072
|
var path34 = __toESM(require("path"), 1);
|
|
6104
6073
|
var import_node_crypto19 = require("crypto");
|
|
6105
6074
|
var GeminiCliMcpJsonParseError = class extends Error {
|
|
@@ -6116,7 +6085,7 @@ function stripLeadingLineComments13(text) {
|
|
|
6116
6085
|
}
|
|
6117
6086
|
async function pathExists17(filePath) {
|
|
6118
6087
|
try {
|
|
6119
|
-
await
|
|
6088
|
+
await fs26.access(filePath);
|
|
6120
6089
|
return true;
|
|
6121
6090
|
} catch {
|
|
6122
6091
|
return false;
|
|
@@ -6156,17 +6125,17 @@ function mergeGeminiCliMcpConfigObject(existing, memoraone) {
|
|
|
6156
6125
|
}
|
|
6157
6126
|
async function writeGeminiCliMcpJsonAtomic(filePath, content) {
|
|
6158
6127
|
const dir = path34.dirname(filePath);
|
|
6159
|
-
await
|
|
6128
|
+
await fs26.mkdir(dir, { recursive: true });
|
|
6160
6129
|
const tmpPath = path34.join(
|
|
6161
6130
|
dir,
|
|
6162
6131
|
`.${path34.basename(filePath)}.${process.pid}.${(0, import_node_crypto19.randomBytes)(8).toString("hex")}.tmp`
|
|
6163
6132
|
);
|
|
6164
6133
|
try {
|
|
6165
|
-
await
|
|
6166
|
-
await
|
|
6134
|
+
await fs26.writeFile(tmpPath, content, "utf8");
|
|
6135
|
+
await fs26.rename(tmpPath, filePath);
|
|
6167
6136
|
} catch (err) {
|
|
6168
6137
|
try {
|
|
6169
|
-
await
|
|
6138
|
+
await fs26.unlink(tmpPath);
|
|
6170
6139
|
} catch {
|
|
6171
6140
|
}
|
|
6172
6141
|
throw err;
|
|
@@ -6191,7 +6160,7 @@ function validateGeminiCliMcpConfig(parsed2, expected) {
|
|
|
6191
6160
|
}
|
|
6192
6161
|
}
|
|
6193
6162
|
async function readJsonConfig13(filePath) {
|
|
6194
|
-
const raw = await
|
|
6163
|
+
const raw = await fs26.readFile(filePath, "utf8");
|
|
6195
6164
|
if (raw.trim() === "") return null;
|
|
6196
6165
|
return JSON.parse(stripLeadingLineComments13(raw));
|
|
6197
6166
|
}
|
|
@@ -6271,7 +6240,7 @@ async function setupGeminiCliMcpConfig(options) {
|
|
|
6271
6240
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
6272
6241
|
}
|
|
6273
6242
|
await writeGeminiCliMcpJsonAtomic(projectPath, body);
|
|
6274
|
-
const verifyRaw = await
|
|
6243
|
+
const verifyRaw = await fs26.readFile(projectPath, "utf8");
|
|
6275
6244
|
const verifyParsed = JSON.parse(stripLeadingLineComments13(verifyRaw));
|
|
6276
6245
|
validateGeminiCliMcpConfig(verifyParsed, memoraone);
|
|
6277
6246
|
return {
|
|
@@ -6282,7 +6251,7 @@ async function setupGeminiCliMcpConfig(options) {
|
|
|
6282
6251
|
|
|
6283
6252
|
// src/antigravityMcpConfig.ts
|
|
6284
6253
|
var fsSync = __toESM(require("fs"), 1);
|
|
6285
|
-
var
|
|
6254
|
+
var fs27 = __toESM(require("fs/promises"), 1);
|
|
6286
6255
|
var os9 = __toESM(require("os"), 1);
|
|
6287
6256
|
var path35 = __toESM(require("path"), 1);
|
|
6288
6257
|
var import_node_crypto20 = require("crypto");
|
|
@@ -6300,7 +6269,7 @@ function stripLeadingLineComments14(text) {
|
|
|
6300
6269
|
}
|
|
6301
6270
|
async function pathExists18(filePath) {
|
|
6302
6271
|
try {
|
|
6303
|
-
await
|
|
6272
|
+
await fs27.access(filePath);
|
|
6304
6273
|
return true;
|
|
6305
6274
|
} catch {
|
|
6306
6275
|
return false;
|
|
@@ -6364,17 +6333,17 @@ function stripMemoraoneFromAntigravityConfigObject(existing) {
|
|
|
6364
6333
|
}
|
|
6365
6334
|
async function writeAntigravityMcpJsonAtomic(filePath, content) {
|
|
6366
6335
|
const dir = path35.dirname(filePath);
|
|
6367
|
-
await
|
|
6336
|
+
await fs27.mkdir(dir, { recursive: true });
|
|
6368
6337
|
const tmpPath = path35.join(
|
|
6369
6338
|
dir,
|
|
6370
6339
|
`.${path35.basename(filePath)}.${process.pid}.${(0, import_node_crypto20.randomBytes)(8).toString("hex")}.tmp`
|
|
6371
6340
|
);
|
|
6372
6341
|
try {
|
|
6373
|
-
await
|
|
6374
|
-
await
|
|
6342
|
+
await fs27.writeFile(tmpPath, content, "utf8");
|
|
6343
|
+
await fs27.rename(tmpPath, filePath);
|
|
6375
6344
|
} catch (err) {
|
|
6376
6345
|
try {
|
|
6377
|
-
await
|
|
6346
|
+
await fs27.unlink(tmpPath);
|
|
6378
6347
|
} catch {
|
|
6379
6348
|
}
|
|
6380
6349
|
throw err;
|
|
@@ -6400,7 +6369,7 @@ function validateAntigravityMcpConfig(parsed2, expected, serverName = CANONICAL_
|
|
|
6400
6369
|
}
|
|
6401
6370
|
}
|
|
6402
6371
|
async function readJsonConfig14(filePath) {
|
|
6403
|
-
const raw = await
|
|
6372
|
+
const raw = await fs27.readFile(filePath, "utf8");
|
|
6404
6373
|
if (raw.trim() === "") return null;
|
|
6405
6374
|
return JSON.parse(stripLeadingLineComments14(raw));
|
|
6406
6375
|
}
|
|
@@ -6520,7 +6489,7 @@ async function setupAntigravityMcpConfig(options) {
|
|
|
6520
6489
|
};
|
|
6521
6490
|
}
|
|
6522
6491
|
await writeAntigravityMcpJsonAtomic(activePath, body);
|
|
6523
|
-
const verifyRaw = await
|
|
6492
|
+
const verifyRaw = await fs27.readFile(activePath, "utf8");
|
|
6524
6493
|
const verifyParsed = JSON.parse(stripLeadingLineComments14(verifyRaw));
|
|
6525
6494
|
validateAntigravityMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
|
|
6526
6495
|
return {
|
|
@@ -6559,7 +6528,7 @@ async function setupAntigravityMcpConfig(options) {
|
|
|
6559
6528
|
}
|
|
6560
6529
|
if (!activeAlreadyCorrect) {
|
|
6561
6530
|
await writeAntigravityMcpJsonAtomic(activePath, body);
|
|
6562
|
-
const verifyRaw = await
|
|
6531
|
+
const verifyRaw = await fs27.readFile(activePath, "utf8");
|
|
6563
6532
|
const verifyParsed = JSON.parse(stripLeadingLineComments14(verifyRaw));
|
|
6564
6533
|
validateAntigravityMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
|
|
6565
6534
|
}
|
|
@@ -6602,7 +6571,7 @@ async function setupAntigravityMcpConfig(options) {
|
|
|
6602
6571
|
}
|
|
6603
6572
|
|
|
6604
6573
|
// src/gooseMcpConfig.ts
|
|
6605
|
-
var
|
|
6574
|
+
var fs28 = __toESM(require("fs/promises"), 1);
|
|
6606
6575
|
var os10 = __toESM(require("os"), 1);
|
|
6607
6576
|
var path36 = __toESM(require("path"), 1);
|
|
6608
6577
|
var import_node_crypto21 = require("crypto");
|
|
@@ -6619,7 +6588,7 @@ var GooseMcpYamlParseError = class extends Error {
|
|
|
6619
6588
|
var MEMORAONE_PACKAGE_SPEC_RE2 = /@memoraone\/mcp(?:@|$)/;
|
|
6620
6589
|
async function pathExists19(filePath) {
|
|
6621
6590
|
try {
|
|
6622
|
-
await
|
|
6591
|
+
await fs28.access(filePath);
|
|
6623
6592
|
return true;
|
|
6624
6593
|
} catch {
|
|
6625
6594
|
return false;
|
|
@@ -6743,17 +6712,17 @@ function mergeGooseMcpConfigObject(existing, memoraone, ownership) {
|
|
|
6743
6712
|
}
|
|
6744
6713
|
async function writeGooseMcpYamlAtomic(filePath, content) {
|
|
6745
6714
|
const dir = path36.dirname(filePath);
|
|
6746
|
-
await
|
|
6715
|
+
await fs28.mkdir(dir, { recursive: true });
|
|
6747
6716
|
const tmpPath = path36.join(
|
|
6748
6717
|
dir,
|
|
6749
6718
|
`.${path36.basename(filePath)}.${process.pid}.${(0, import_node_crypto21.randomBytes)(8).toString("hex")}.tmp`
|
|
6750
6719
|
);
|
|
6751
6720
|
try {
|
|
6752
|
-
await
|
|
6753
|
-
await
|
|
6721
|
+
await fs28.writeFile(tmpPath, content, "utf8");
|
|
6722
|
+
await fs28.rename(tmpPath, filePath);
|
|
6754
6723
|
} catch (err) {
|
|
6755
6724
|
try {
|
|
6756
|
-
await
|
|
6725
|
+
await fs28.unlink(tmpPath);
|
|
6757
6726
|
} catch {
|
|
6758
6727
|
}
|
|
6759
6728
|
throw err;
|
|
@@ -6849,7 +6818,7 @@ async function setupGooseMcpConfig(options) {
|
|
|
6849
6818
|
let existing = null;
|
|
6850
6819
|
if (exists) {
|
|
6851
6820
|
try {
|
|
6852
|
-
const raw = await
|
|
6821
|
+
const raw = await fs28.readFile(activePath, "utf8");
|
|
6853
6822
|
existing = parseGooseYaml(raw);
|
|
6854
6823
|
} catch {
|
|
6855
6824
|
throw new GooseMcpYamlParseError(activePath);
|
|
@@ -6874,7 +6843,7 @@ async function setupGooseMcpConfig(options) {
|
|
|
6874
6843
|
};
|
|
6875
6844
|
}
|
|
6876
6845
|
await writeGooseMcpYamlAtomic(activePath, body);
|
|
6877
|
-
const verifyRaw = await
|
|
6846
|
+
const verifyRaw = await fs28.readFile(activePath, "utf8");
|
|
6878
6847
|
let verifyParsed;
|
|
6879
6848
|
try {
|
|
6880
6849
|
verifyParsed = (0, import_yaml2.parse)(verifyRaw);
|
|
@@ -6890,7 +6859,7 @@ async function setupGooseMcpConfig(options) {
|
|
|
6890
6859
|
}
|
|
6891
6860
|
|
|
6892
6861
|
// src/junieMcpConfig.ts
|
|
6893
|
-
var
|
|
6862
|
+
var fs29 = __toESM(require("fs/promises"), 1);
|
|
6894
6863
|
var path37 = __toESM(require("path"), 1);
|
|
6895
6864
|
var import_node_crypto22 = require("crypto");
|
|
6896
6865
|
var JunieMcpJsonParseError = class extends Error {
|
|
@@ -6907,7 +6876,7 @@ function stripLeadingLineComments15(text) {
|
|
|
6907
6876
|
}
|
|
6908
6877
|
async function pathExists20(filePath) {
|
|
6909
6878
|
try {
|
|
6910
|
-
await
|
|
6879
|
+
await fs29.access(filePath);
|
|
6911
6880
|
return true;
|
|
6912
6881
|
} catch {
|
|
6913
6882
|
return false;
|
|
@@ -6947,17 +6916,17 @@ function mergeJunieMcpConfigObject(existing, memoraone) {
|
|
|
6947
6916
|
}
|
|
6948
6917
|
async function writeJunieMcpJsonAtomic(filePath, content) {
|
|
6949
6918
|
const dir = path37.dirname(filePath);
|
|
6950
|
-
await
|
|
6919
|
+
await fs29.mkdir(dir, { recursive: true });
|
|
6951
6920
|
const tmpPath = path37.join(
|
|
6952
6921
|
dir,
|
|
6953
6922
|
`.${path37.basename(filePath)}.${process.pid}.${(0, import_node_crypto22.randomBytes)(8).toString("hex")}.tmp`
|
|
6954
6923
|
);
|
|
6955
6924
|
try {
|
|
6956
|
-
await
|
|
6957
|
-
await
|
|
6925
|
+
await fs29.writeFile(tmpPath, content, "utf8");
|
|
6926
|
+
await fs29.rename(tmpPath, filePath);
|
|
6958
6927
|
} catch (err) {
|
|
6959
6928
|
try {
|
|
6960
|
-
await
|
|
6929
|
+
await fs29.unlink(tmpPath);
|
|
6961
6930
|
} catch {
|
|
6962
6931
|
}
|
|
6963
6932
|
throw err;
|
|
@@ -6982,7 +6951,7 @@ function validateJunieMcpConfig(parsed2, expected) {
|
|
|
6982
6951
|
}
|
|
6983
6952
|
}
|
|
6984
6953
|
async function readJsonConfig15(filePath) {
|
|
6985
|
-
const raw = await
|
|
6954
|
+
const raw = await fs29.readFile(filePath, "utf8");
|
|
6986
6955
|
if (raw.trim() === "") return null;
|
|
6987
6956
|
return JSON.parse(stripLeadingLineComments15(raw));
|
|
6988
6957
|
}
|
|
@@ -7062,7 +7031,7 @@ async function setupJunieMcpConfig(options) {
|
|
|
7062
7031
|
return { outcome: exists ? "updated" : "created", memoraone };
|
|
7063
7032
|
}
|
|
7064
7033
|
await writeJunieMcpJsonAtomic(projectPath, body);
|
|
7065
|
-
const verifyRaw = await
|
|
7034
|
+
const verifyRaw = await fs29.readFile(projectPath, "utf8");
|
|
7066
7035
|
const verifyParsed = JSON.parse(stripLeadingLineComments15(verifyRaw));
|
|
7067
7036
|
validateJunieMcpConfig(verifyParsed, memoraone);
|
|
7068
7037
|
return {
|
|
@@ -7072,7 +7041,7 @@ async function setupJunieMcpConfig(options) {
|
|
|
7072
7041
|
}
|
|
7073
7042
|
|
|
7074
7043
|
// src/xcodeMcpConfig.ts
|
|
7075
|
-
var
|
|
7044
|
+
var fs30 = __toESM(require("fs/promises"), 1);
|
|
7076
7045
|
var os11 = __toESM(require("os"), 1);
|
|
7077
7046
|
var path38 = __toESM(require("path"), 1);
|
|
7078
7047
|
var import_node_crypto23 = require("crypto");
|
|
@@ -7090,7 +7059,7 @@ function stripLeadingLineComments16(text) {
|
|
|
7090
7059
|
}
|
|
7091
7060
|
async function pathExists21(filePath) {
|
|
7092
7061
|
try {
|
|
7093
|
-
await
|
|
7062
|
+
await fs30.access(filePath);
|
|
7094
7063
|
return true;
|
|
7095
7064
|
} catch {
|
|
7096
7065
|
return false;
|
|
@@ -7131,17 +7100,17 @@ function mergeXcodeMcpConfigObject(existing, memoraone, ownership) {
|
|
|
7131
7100
|
}
|
|
7132
7101
|
async function writeXcodeMcpJsonAtomic(filePath, content) {
|
|
7133
7102
|
const dir = path38.dirname(filePath);
|
|
7134
|
-
await
|
|
7103
|
+
await fs30.mkdir(dir, { recursive: true });
|
|
7135
7104
|
const tmpPath = path38.join(
|
|
7136
7105
|
dir,
|
|
7137
7106
|
`.${path38.basename(filePath)}.${process.pid}.${(0, import_node_crypto23.randomBytes)(8).toString("hex")}.tmp`
|
|
7138
7107
|
);
|
|
7139
7108
|
try {
|
|
7140
|
-
await
|
|
7141
|
-
await
|
|
7109
|
+
await fs30.writeFile(tmpPath, content, "utf8");
|
|
7110
|
+
await fs30.rename(tmpPath, filePath);
|
|
7142
7111
|
} catch (err) {
|
|
7143
7112
|
try {
|
|
7144
|
-
await
|
|
7113
|
+
await fs30.unlink(tmpPath);
|
|
7145
7114
|
} catch {
|
|
7146
7115
|
}
|
|
7147
7116
|
throw err;
|
|
@@ -7167,7 +7136,7 @@ function validateXcodeMcpConfig(parsed2, expected, serverName = CANONICAL_MEMORA
|
|
|
7167
7136
|
}
|
|
7168
7137
|
}
|
|
7169
7138
|
async function readJsonConfig16(filePath) {
|
|
7170
|
-
const raw = await
|
|
7139
|
+
const raw = await fs30.readFile(filePath, "utf8");
|
|
7171
7140
|
if (raw.trim() === "") return null;
|
|
7172
7141
|
return JSON.parse(stripLeadingLineComments16(raw));
|
|
7173
7142
|
}
|
|
@@ -7251,7 +7220,7 @@ async function setupXcodeMcpConfig(options) {
|
|
|
7251
7220
|
};
|
|
7252
7221
|
}
|
|
7253
7222
|
await writeXcodeMcpJsonAtomic(activePath, body);
|
|
7254
|
-
const verifyRaw = await
|
|
7223
|
+
const verifyRaw = await fs30.readFile(activePath, "utf8");
|
|
7255
7224
|
const verifyParsed = JSON.parse(stripLeadingLineComments16(verifyRaw));
|
|
7256
7225
|
validateXcodeMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
|
|
7257
7226
|
return {
|
|
@@ -7262,7 +7231,7 @@ async function setupXcodeMcpConfig(options) {
|
|
|
7262
7231
|
}
|
|
7263
7232
|
|
|
7264
7233
|
// src/copilotJetBrainsMcpConfig.ts
|
|
7265
|
-
var
|
|
7234
|
+
var fs31 = __toESM(require("fs/promises"), 1);
|
|
7266
7235
|
var os12 = __toESM(require("os"), 1);
|
|
7267
7236
|
var path39 = __toESM(require("path"), 1);
|
|
7268
7237
|
var import_node_crypto24 = require("crypto");
|
|
@@ -7280,7 +7249,7 @@ function stripLeadingLineComments17(text) {
|
|
|
7280
7249
|
}
|
|
7281
7250
|
async function pathExists22(filePath) {
|
|
7282
7251
|
try {
|
|
7283
|
-
await
|
|
7252
|
+
await fs31.access(filePath);
|
|
7284
7253
|
return true;
|
|
7285
7254
|
} catch {
|
|
7286
7255
|
return false;
|
|
@@ -7321,17 +7290,17 @@ function mergeCopilotJetBrainsMcpConfigObject(existing, memoraone, ownership) {
|
|
|
7321
7290
|
}
|
|
7322
7291
|
async function writeCopilotJetBrainsMcpJsonAtomic(filePath, content) {
|
|
7323
7292
|
const dir = path39.dirname(filePath);
|
|
7324
|
-
await
|
|
7293
|
+
await fs31.mkdir(dir, { recursive: true });
|
|
7325
7294
|
const tmpPath = path39.join(
|
|
7326
7295
|
dir,
|
|
7327
7296
|
`.${path39.basename(filePath)}.${process.pid}.${(0, import_node_crypto24.randomBytes)(8).toString("hex")}.tmp`
|
|
7328
7297
|
);
|
|
7329
7298
|
try {
|
|
7330
|
-
await
|
|
7331
|
-
await
|
|
7299
|
+
await fs31.writeFile(tmpPath, content, "utf8");
|
|
7300
|
+
await fs31.rename(tmpPath, filePath);
|
|
7332
7301
|
} catch (err) {
|
|
7333
7302
|
try {
|
|
7334
|
-
await
|
|
7303
|
+
await fs31.unlink(tmpPath);
|
|
7335
7304
|
} catch {
|
|
7336
7305
|
}
|
|
7337
7306
|
throw err;
|
|
@@ -7361,7 +7330,7 @@ function validateCopilotJetBrainsMcpConfig(parsed2, expected, serverName = CANON
|
|
|
7361
7330
|
}
|
|
7362
7331
|
}
|
|
7363
7332
|
async function readJsonConfig17(filePath) {
|
|
7364
|
-
const raw = await
|
|
7333
|
+
const raw = await fs31.readFile(filePath, "utf8");
|
|
7365
7334
|
if (raw.trim() === "") return null;
|
|
7366
7335
|
return JSON.parse(stripLeadingLineComments17(raw));
|
|
7367
7336
|
}
|
|
@@ -7445,7 +7414,7 @@ async function setupCopilotJetBrainsMcpConfig(options) {
|
|
|
7445
7414
|
};
|
|
7446
7415
|
}
|
|
7447
7416
|
await writeCopilotJetBrainsMcpJsonAtomic(activePath, body);
|
|
7448
|
-
const verifyRaw = await
|
|
7417
|
+
const verifyRaw = await fs31.readFile(activePath, "utf8");
|
|
7449
7418
|
const verifyParsed = JSON.parse(stripLeadingLineComments17(verifyRaw));
|
|
7450
7419
|
validateCopilotJetBrainsMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
|
|
7451
7420
|
return {
|
|
@@ -7499,7 +7468,7 @@ function assertUnderRepoRoot(repoRoot, absPath) {
|
|
|
7499
7468
|
}
|
|
7500
7469
|
async function pathExists23(filePath) {
|
|
7501
7470
|
try {
|
|
7502
|
-
await
|
|
7471
|
+
await fs32.access(filePath);
|
|
7503
7472
|
return true;
|
|
7504
7473
|
} catch {
|
|
7505
7474
|
return false;
|
|
@@ -7588,17 +7557,17 @@ function buildVscodeMcpJsonBody(existing, options = {}) {
|
|
|
7588
7557
|
}
|
|
7589
7558
|
async function writeSharedMcpJsonAtomic(filePath, content) {
|
|
7590
7559
|
const dir = path40.dirname(filePath);
|
|
7591
|
-
await
|
|
7560
|
+
await fs32.mkdir(dir, { recursive: true });
|
|
7592
7561
|
const tmpPath = path40.join(
|
|
7593
7562
|
dir,
|
|
7594
7563
|
`.${path40.basename(filePath)}.${process.pid}.${(0, import_node_crypto25.randomBytes)(8).toString("hex")}.tmp`
|
|
7595
7564
|
);
|
|
7596
7565
|
try {
|
|
7597
|
-
await
|
|
7598
|
-
await
|
|
7566
|
+
await fs32.writeFile(tmpPath, content, "utf8");
|
|
7567
|
+
await fs32.rename(tmpPath, filePath);
|
|
7599
7568
|
} catch (err) {
|
|
7600
7569
|
try {
|
|
7601
|
-
await
|
|
7570
|
+
await fs32.unlink(tmpPath);
|
|
7602
7571
|
} catch {
|
|
7603
7572
|
}
|
|
7604
7573
|
throw err;
|
|
@@ -7627,7 +7596,7 @@ async function writeClaudeCodeMcpJson(repoRoot, buildBody, opts) {
|
|
|
7627
7596
|
let raw = "";
|
|
7628
7597
|
let existed = false;
|
|
7629
7598
|
try {
|
|
7630
|
-
raw = await
|
|
7599
|
+
raw = await fs32.readFile(abs, "utf8");
|
|
7631
7600
|
existed = true;
|
|
7632
7601
|
} catch (err) {
|
|
7633
7602
|
if (err?.code !== "ENOENT") throw err;
|
|
@@ -7659,28 +7628,28 @@ async function writeManagedMarkdown(repoRoot, relPath, fullContent, opts) {
|
|
|
7659
7628
|
let prior = "";
|
|
7660
7629
|
let existed = false;
|
|
7661
7630
|
try {
|
|
7662
|
-
prior = await
|
|
7631
|
+
prior = await fs32.readFile(abs, "utf8");
|
|
7663
7632
|
existed = true;
|
|
7664
7633
|
} catch (err) {
|
|
7665
7634
|
if (err?.code !== "ENOENT") throw err;
|
|
7666
7635
|
}
|
|
7667
7636
|
if (!existed) {
|
|
7668
7637
|
if (opts.dryRun) return "created";
|
|
7669
|
-
await
|
|
7670
|
-
await
|
|
7638
|
+
await fs32.mkdir(path40.dirname(abs), { recursive: true });
|
|
7639
|
+
await fs32.writeFile(abs, fullContent, "utf8");
|
|
7671
7640
|
return "created";
|
|
7672
7641
|
}
|
|
7673
7642
|
if (prior.includes(MANAGED_MARKER)) {
|
|
7674
7643
|
if (prior === fullContent) return "skipped";
|
|
7675
7644
|
if (opts.dryRun) return "updated";
|
|
7676
|
-
await
|
|
7677
|
-
await
|
|
7645
|
+
await fs32.mkdir(path40.dirname(abs), { recursive: true });
|
|
7646
|
+
await fs32.writeFile(abs, fullContent, "utf8");
|
|
7678
7647
|
return "updated";
|
|
7679
7648
|
}
|
|
7680
7649
|
if (!opts.force) return "skipped-untracked";
|
|
7681
7650
|
if (opts.dryRun) return "updated";
|
|
7682
|
-
await
|
|
7683
|
-
await
|
|
7651
|
+
await fs32.mkdir(path40.dirname(abs), { recursive: true });
|
|
7652
|
+
await fs32.writeFile(abs, fullContent, "utf8");
|
|
7684
7653
|
return "updated";
|
|
7685
7654
|
}
|
|
7686
7655
|
async function writeIdeMcpJson(repoRoot, relPath, buildBody, opts) {
|
|
@@ -7689,7 +7658,7 @@ async function writeIdeMcpJson(repoRoot, relPath, buildBody, opts) {
|
|
|
7689
7658
|
let raw = "";
|
|
7690
7659
|
let existed = false;
|
|
7691
7660
|
try {
|
|
7692
|
-
raw = await
|
|
7661
|
+
raw = await fs32.readFile(abs, "utf8");
|
|
7693
7662
|
existed = true;
|
|
7694
7663
|
} catch (err) {
|
|
7695
7664
|
if (err?.code !== "ENOENT") throw err;
|
|
@@ -9112,7 +9081,7 @@ alwaysApply: true
|
|
|
9112
9081
|
}
|
|
9113
9082
|
|
|
9114
9083
|
// src/localState/replaceRootLocalState.ts
|
|
9115
|
-
var
|
|
9084
|
+
var fs33 = __toESM(require("fs/promises"), 1);
|
|
9116
9085
|
var path41 = __toESM(require("path"), 1);
|
|
9117
9086
|
var WORKSPACE_MAP_FILENAME = "workspaces.json";
|
|
9118
9087
|
var FINGERPRINT_REGEX = /^[0-9a-f]{64}$/i;
|
|
@@ -9234,7 +9203,7 @@ async function snapshotAndRemoveRootLocalState(workspaceRoot, options = {}) {
|
|
|
9234
9203
|
} catch {
|
|
9235
9204
|
}
|
|
9236
9205
|
try {
|
|
9237
|
-
await
|
|
9206
|
+
await fs33.unlink(getBindingFilePath(id, options.homeDir));
|
|
9238
9207
|
} catch (err) {
|
|
9239
9208
|
if (err?.code !== "ENOENT") throw err;
|
|
9240
9209
|
}
|
|
@@ -9257,7 +9226,7 @@ async function restoreRootLocalState(snapshot, options = {}) {
|
|
|
9257
9226
|
} catch {
|
|
9258
9227
|
}
|
|
9259
9228
|
try {
|
|
9260
|
-
await
|
|
9229
|
+
await fs33.unlink(getBindingFilePath(id, options.homeDir));
|
|
9261
9230
|
} catch (err) {
|
|
9262
9231
|
if (err?.code !== "ENOENT") throw err;
|
|
9263
9232
|
}
|
|
@@ -9297,7 +9266,7 @@ async function restoreRootLocalState(snapshot, options = {}) {
|
|
|
9297
9266
|
var path42 = __toESM(require("path"), 1);
|
|
9298
9267
|
var import_node_child_process6 = require("child_process");
|
|
9299
9268
|
var import_node_util5 = require("util");
|
|
9300
|
-
var
|
|
9269
|
+
var fs34 = __toESM(require("fs/promises"), 1);
|
|
9301
9270
|
var execFileAsync5 = (0, import_node_util5.promisify)(import_node_child_process6.execFile);
|
|
9302
9271
|
var CLINE_HUB_DAEMON_MARKER = "--cline-hub-daemon";
|
|
9303
9272
|
function parseClineHubCwdFromCommandLine(commandLine) {
|
|
@@ -9344,9 +9313,9 @@ async function defaultListClineHubProcesses() {
|
|
|
9344
9313
|
return parseClineHubProcessLines(stdout.split("\n"));
|
|
9345
9314
|
}
|
|
9346
9315
|
async function defaultRemoveSocket2(socketPath) {
|
|
9347
|
-
await
|
|
9316
|
+
await fs34.unlink(socketPath);
|
|
9348
9317
|
try {
|
|
9349
|
-
await
|
|
9318
|
+
await fs34.unlink(bindingSidecarPath(socketPath));
|
|
9350
9319
|
} catch {
|
|
9351
9320
|
}
|
|
9352
9321
|
}
|
|
@@ -9557,10 +9526,10 @@ function normalizeGitRemote(remoteUrl) {
|
|
|
9557
9526
|
normalized = normalized.replace(/\/+$/, "");
|
|
9558
9527
|
return normalized.toLowerCase() || null;
|
|
9559
9528
|
}
|
|
9560
|
-
async function
|
|
9529
|
+
async function detectLegacyM1Warning(workspaceRoot) {
|
|
9561
9530
|
const candidate = path43.join(path43.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
|
|
9562
9531
|
try {
|
|
9563
|
-
await
|
|
9532
|
+
await fs35.access(candidate);
|
|
9564
9533
|
return candidate;
|
|
9565
9534
|
} catch {
|
|
9566
9535
|
return void 0;
|
|
@@ -9601,7 +9570,7 @@ async function runConnectCommand(options) {
|
|
|
9601
9570
|
resolvedMode = { kind: "local", cliPath };
|
|
9602
9571
|
}
|
|
9603
9572
|
const fingerprint = resolveRepoFingerprint(cwd2);
|
|
9604
|
-
const legacyM1WarningPath = await
|
|
9573
|
+
const legacyM1WarningPath = await detectLegacyM1Warning(cwd2);
|
|
9605
9574
|
if (legacyM1WarningPath) {
|
|
9606
9575
|
process.stderr.write(
|
|
9607
9576
|
`[memoraone-mcp] warning: ignoring legacy ${path43.basename(legacyM1WarningPath)} at ${legacyM1WarningPath} (credentials and binding are package-managed)
|