@memoraone/mcp 0.1.42 → 0.1.43
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 +324 -315
- package/dist/daemon.cjs +52 -65
- package/dist/index.cjs +52 -67
- package/dist/pluginPairing.cjs +10046 -0
- package/package.json +8 -1
package/dist/cli.cjs
CHANGED
|
@@ -231,9 +231,16 @@ var require_package = __commonJS({
|
|
|
231
231
|
"package.json"(exports2, module2) {
|
|
232
232
|
module2.exports = {
|
|
233
233
|
name: "@memoraone/mcp",
|
|
234
|
-
version: "0.1.
|
|
234
|
+
version: "0.1.43",
|
|
235
235
|
type: "module",
|
|
236
236
|
main: "dist/index.cjs",
|
|
237
|
+
exports: {
|
|
238
|
+
".": "./dist/index.cjs",
|
|
239
|
+
"./plugin-pairing": "./dist/pluginPairing.cjs",
|
|
240
|
+
"./dist/*": "./dist/*",
|
|
241
|
+
"./dist-bin/*": "./dist-bin/*",
|
|
242
|
+
"./package.json": "./package.json"
|
|
243
|
+
},
|
|
237
244
|
bin: {
|
|
238
245
|
"memoraone-mcp": "dist-bin/memoraone-mcp.cjs"
|
|
239
246
|
},
|
|
@@ -524,7 +531,7 @@ async function acquireLocalLock(lockName, options = {}) {
|
|
|
524
531
|
`[memoraone-mcp] Failed to acquire lock ${lockName} after ${maxRetries} retries`
|
|
525
532
|
);
|
|
526
533
|
}
|
|
527
|
-
await new Promise((
|
|
534
|
+
await new Promise((resolve40) => setTimeout(resolve40, retryDelayMs));
|
|
528
535
|
continue;
|
|
529
536
|
}
|
|
530
537
|
throw err;
|
|
@@ -1085,9 +1092,9 @@ var init_memoraClient = __esm({
|
|
|
1085
1092
|
});
|
|
1086
1093
|
|
|
1087
1094
|
// src/localState/localConnectClient.ts
|
|
1088
|
-
async function requestJson(baseUrl, method,
|
|
1095
|
+
async function requestJson(baseUrl, method, path44, options = {}) {
|
|
1089
1096
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
1090
|
-
const url = `${baseUrl.replace(/\/+$/, "")}${
|
|
1097
|
+
const url = `${baseUrl.replace(/\/+$/, "")}${path44.startsWith("/") ? path44 : `/${path44}`}`;
|
|
1091
1098
|
const res = await fetchImpl(url, {
|
|
1092
1099
|
method,
|
|
1093
1100
|
headers: {
|
|
@@ -1161,8 +1168,10 @@ async function redeemLocalConnectCode(apiUrl, body, options = {}) {
|
|
|
1161
1168
|
recovered: Boolean(data.recovered)
|
|
1162
1169
|
};
|
|
1163
1170
|
}
|
|
1171
|
+
var path8;
|
|
1164
1172
|
var init_localConnectClient = __esm({
|
|
1165
1173
|
"src/localState/localConnectClient.ts"() {
|
|
1174
|
+
path8 = __toESM(require("path"), 1);
|
|
1166
1175
|
init_memoraClient();
|
|
1167
1176
|
}
|
|
1168
1177
|
});
|
|
@@ -1186,7 +1195,7 @@ var init_tokenRefreshCoordinator = __esm({
|
|
|
1186
1195
|
|
|
1187
1196
|
// src/localState/resolveLocalBinding.ts
|
|
1188
1197
|
async function detectLegacyM1Warning(workspaceRoot) {
|
|
1189
|
-
const candidate =
|
|
1198
|
+
const candidate = path9.join(path9.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
|
|
1190
1199
|
try {
|
|
1191
1200
|
await fs6.access(candidate);
|
|
1192
1201
|
return candidate;
|
|
@@ -1195,7 +1204,7 @@ async function detectLegacyM1Warning(workspaceRoot) {
|
|
|
1195
1204
|
}
|
|
1196
1205
|
}
|
|
1197
1206
|
async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
|
|
1198
|
-
const resolved =
|
|
1207
|
+
const resolved = path9.resolve(workspaceRoot);
|
|
1199
1208
|
const identity = await captureRootFilesystemIdentity(resolved, options.identityDeps);
|
|
1200
1209
|
const legacyM1WarningPath = await detectLegacyM1Warning(resolved);
|
|
1201
1210
|
const index = await loadPathIndex(options.homeDir);
|
|
@@ -1203,7 +1212,7 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
|
|
|
1203
1212
|
if (lookup.kind === "path") {
|
|
1204
1213
|
const record = await readBindingRecord(lookup.repositoryBindingId, options.homeDir);
|
|
1205
1214
|
if (record && identityMatchesStored(record.filesystemIdentity, identity)) {
|
|
1206
|
-
if (
|
|
1215
|
+
if (path9.resolve(record.workspaceRoot) !== resolved) {
|
|
1207
1216
|
const updated = {
|
|
1208
1217
|
...record,
|
|
1209
1218
|
workspaceRoot: resolved,
|
|
@@ -1265,7 +1274,7 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
|
|
|
1265
1274
|
};
|
|
1266
1275
|
}
|
|
1267
1276
|
async function resolveLocalBinding(workspaceRoot, options = {}) {
|
|
1268
|
-
const resolved =
|
|
1277
|
+
const resolved = path9.resolve(workspaceRoot);
|
|
1269
1278
|
const { repositoryBindingId, legacyM1WarningPath } = await ensureRepositoryBindingForRoot(
|
|
1270
1279
|
resolved,
|
|
1271
1280
|
{ ...options, createIfMissing: false }
|
|
@@ -1313,11 +1322,11 @@ async function resolveLocalBinding(workspaceRoot, options = {}) {
|
|
|
1313
1322
|
legacyM1WarningPath
|
|
1314
1323
|
};
|
|
1315
1324
|
}
|
|
1316
|
-
var fs6,
|
|
1325
|
+
var fs6, path9;
|
|
1317
1326
|
var init_resolveLocalBinding = __esm({
|
|
1318
1327
|
"src/localState/resolveLocalBinding.ts"() {
|
|
1319
1328
|
fs6 = __toESM(require("fs/promises"), 1);
|
|
1320
|
-
|
|
1329
|
+
path9 = __toESM(require("path"), 1);
|
|
1321
1330
|
init_projectBinding();
|
|
1322
1331
|
init_bindingStore();
|
|
1323
1332
|
init_installationCredentials();
|
|
@@ -1349,7 +1358,7 @@ function toResolvedBinding(local) {
|
|
|
1349
1358
|
};
|
|
1350
1359
|
}
|
|
1351
1360
|
async function warnLegacyM1IfPresent(workspaceRoot) {
|
|
1352
|
-
const candidate =
|
|
1361
|
+
const candidate = path10.join(path10.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
|
|
1353
1362
|
try {
|
|
1354
1363
|
await fs7.access(candidate);
|
|
1355
1364
|
process.stderr.write(
|
|
@@ -1408,7 +1417,7 @@ function normalizeWorkspaceSearchRoots(workspaceRoot) {
|
|
|
1408
1417
|
if (raw === void 0) continue;
|
|
1409
1418
|
const trimmed = String(raw).trim();
|
|
1410
1419
|
if (trimmed === "") continue;
|
|
1411
|
-
const resolved =
|
|
1420
|
+
const resolved = path10.resolve(trimmed);
|
|
1412
1421
|
if (!seen.has(resolved)) {
|
|
1413
1422
|
seen.add(resolved);
|
|
1414
1423
|
out.push(resolved);
|
|
@@ -1419,7 +1428,7 @@ function normalizeWorkspaceSearchRoots(workspaceRoot) {
|
|
|
1419
1428
|
function bindingRelevantValuesMatch(a, b) {
|
|
1420
1429
|
const envA = a.environment ?? void 0;
|
|
1421
1430
|
const envB = b.environment ?? void 0;
|
|
1422
|
-
return a.repositoryBindingId === b.repositoryBindingId && a.projectId.trim().toLowerCase() === b.projectId.trim().toLowerCase() &&
|
|
1431
|
+
return a.repositoryBindingId === b.repositoryBindingId && a.projectId.trim().toLowerCase() === b.projectId.trim().toLowerCase() && path10.resolve(a.workspaceRoot) === path10.resolve(b.workspaceRoot) && (a.installationPublicId ?? void 0) === (b.installationPublicId ?? void 0) && envA === envB && a.status === b.status;
|
|
1423
1432
|
}
|
|
1424
1433
|
async function reconcileResolvedBindingWithDisk(cached, options = {}) {
|
|
1425
1434
|
const repositoryBindingId = assertRepositoryBindingId(cached.repositoryBindingId);
|
|
@@ -1429,7 +1438,7 @@ async function reconcileResolvedBindingWithDisk(cached, options = {}) {
|
|
|
1429
1438
|
`[memoraone-mcp] Cached binding missing for ${repositoryBindingId}. Run: memoraone-mcp connect <code>`
|
|
1430
1439
|
);
|
|
1431
1440
|
}
|
|
1432
|
-
const workspaceRoot =
|
|
1441
|
+
const workspaceRoot = path10.resolve(record.workspaceRoot);
|
|
1433
1442
|
const identity = await captureRootFilesystemIdentity(workspaceRoot);
|
|
1434
1443
|
if (!identitiesMatch(record.filesystemIdentity, identity)) {
|
|
1435
1444
|
throw new ReconnectRequiredError(
|
|
@@ -1512,11 +1521,11 @@ function decodeResolvedBinding(value) {
|
|
|
1512
1521
|
status
|
|
1513
1522
|
};
|
|
1514
1523
|
}
|
|
1515
|
-
var fs7,
|
|
1524
|
+
var fs7, path10, uuidRegex, CANONICAL_M1_FILENAME;
|
|
1516
1525
|
var init_projectBinding = __esm({
|
|
1517
1526
|
"src/projectBinding.ts"() {
|
|
1518
1527
|
fs7 = __toESM(require("fs/promises"), 1);
|
|
1519
|
-
|
|
1528
|
+
path10 = __toESM(require("path"), 1);
|
|
1520
1529
|
init_resolveLocalBinding();
|
|
1521
1530
|
init_bindingStore();
|
|
1522
1531
|
init_rootFilesystemIdentity();
|
|
@@ -1590,7 +1599,7 @@ function isDaemonBindingMismatchError(err) {
|
|
|
1590
1599
|
}
|
|
1591
1600
|
function formatBindingMismatchError(socketPath, sidecar, expected, detail) {
|
|
1592
1601
|
const lines = [
|
|
1593
|
-
`[memoraone-mcp] Daemon socket binding mismatch at ${
|
|
1602
|
+
`[memoraone-mcp] Daemon socket binding mismatch at ${path11.basename(socketPath)}.`,
|
|
1594
1603
|
` socket: binding=${sidecar.repositoryBindingId} project=${sidecar.projectId} workspace=${sidecar.workspaceRoot}`,
|
|
1595
1604
|
` session: binding=${expected.repositoryBindingId} project=${expected.projectId} workspace=${expected.workspaceRoot}`
|
|
1596
1605
|
];
|
|
@@ -1625,11 +1634,11 @@ function verifyDaemonSidecarBinding(socketPath, expected, env2 = process.env, id
|
|
|
1625
1634
|
}
|
|
1626
1635
|
return sidecar;
|
|
1627
1636
|
}
|
|
1628
|
-
var fs8,
|
|
1637
|
+
var fs8, path11;
|
|
1629
1638
|
var init_bindingSidecar = __esm({
|
|
1630
1639
|
"src/bindingSidecar.ts"() {
|
|
1631
1640
|
fs8 = __toESM(require("fs"), 1);
|
|
1632
|
-
|
|
1641
|
+
path11 = __toESM(require("path"), 1);
|
|
1633
1642
|
init_bindingIdentity();
|
|
1634
1643
|
init_projectBinding();
|
|
1635
1644
|
init_socketPaths();
|
|
@@ -1654,8 +1663,8 @@ function getEnvWorkspaceRootCandidates() {
|
|
|
1654
1663
|
const raw = process.env.WORKSPACE_FOLDER_PATHS;
|
|
1655
1664
|
const parts = [];
|
|
1656
1665
|
if (raw !== void 0 && raw.trim() !== "") {
|
|
1657
|
-
for (const p of raw.split(
|
|
1658
|
-
parts.push(
|
|
1666
|
+
for (const p of raw.split(path12.delimiter).map((s) => s.trim()).filter(Boolean)) {
|
|
1667
|
+
parts.push(path12.resolve(p));
|
|
1659
1668
|
}
|
|
1660
1669
|
}
|
|
1661
1670
|
parts.push(process.cwd());
|
|
@@ -1679,7 +1688,7 @@ function extractWorkspaceRootsFromInitialize(params) {
|
|
|
1679
1688
|
if (uri === void 0 || uri.trim() === "") {
|
|
1680
1689
|
return;
|
|
1681
1690
|
}
|
|
1682
|
-
const resolved =
|
|
1691
|
+
const resolved = path12.resolve(uriToPath(uri));
|
|
1683
1692
|
if (!seen.has(resolved)) {
|
|
1684
1693
|
seen.add(resolved);
|
|
1685
1694
|
roots.push(resolved);
|
|
@@ -1701,7 +1710,7 @@ function getRepoScopedWorkspaceHint(env2 = process.env) {
|
|
|
1701
1710
|
if (raw === void 0 || raw.trim() === "") {
|
|
1702
1711
|
return null;
|
|
1703
1712
|
}
|
|
1704
|
-
return
|
|
1713
|
+
return path12.resolve(raw.trim());
|
|
1705
1714
|
}
|
|
1706
1715
|
function formatWorkspaceAmbiguityError(bindings) {
|
|
1707
1716
|
const lines = bindings.map(
|
|
@@ -1777,8 +1786,8 @@ async function resolveBindingFromInitializeParams(params, options = {}) {
|
|
|
1777
1786
|
const rootsListUris = options.rootsListUris ?? [];
|
|
1778
1787
|
const rootsListPaths = rootsListUris.map((uri) => uriToPath(uri)).filter(Boolean);
|
|
1779
1788
|
if (rootsListPaths.length > 1 && repoHint !== null) {
|
|
1780
|
-
const hintResolved =
|
|
1781
|
-
const matchingRoot = rootsListPaths.find((root) =>
|
|
1789
|
+
const hintResolved = path12.resolve(repoHint);
|
|
1790
|
+
const matchingRoot = rootsListPaths.find((root) => path12.resolve(root) === hintResolved);
|
|
1782
1791
|
if (!matchingRoot) {
|
|
1783
1792
|
throw new Error(formatRepoHintNotInRootsListError(repoHint, rootsListPaths));
|
|
1784
1793
|
}
|
|
@@ -1803,10 +1812,10 @@ async function resolveBindingFromInitializeParams(params, options = {}) {
|
|
|
1803
1812
|
respectExplicitM1Path: options.respectExplicitM1Path
|
|
1804
1813
|
});
|
|
1805
1814
|
}
|
|
1806
|
-
var
|
|
1815
|
+
var path12, import_node_url, MEMORAONE_WORKSPACE_ROOT_ENV;
|
|
1807
1816
|
var init_initializeBinding = __esm({
|
|
1808
1817
|
"src/initializeBinding.ts"() {
|
|
1809
|
-
|
|
1818
|
+
path12 = __toESM(require("path"), 1);
|
|
1810
1819
|
import_node_url = require("url");
|
|
1811
1820
|
init_bindingIdentity();
|
|
1812
1821
|
init_projectBinding();
|
|
@@ -1825,34 +1834,34 @@ async function pathExists(filePath) {
|
|
|
1825
1834
|
}
|
|
1826
1835
|
}
|
|
1827
1836
|
async function findMonorepoCliFrom(startDir) {
|
|
1828
|
-
let current =
|
|
1829
|
-
const root =
|
|
1837
|
+
let current = path13.resolve(startDir);
|
|
1838
|
+
const root = path13.parse(current).root;
|
|
1830
1839
|
while (true) {
|
|
1831
|
-
const candidate =
|
|
1840
|
+
const candidate = path13.join(current, MONOREPO_CLI_REL);
|
|
1832
1841
|
if (await pathExists(candidate)) {
|
|
1833
|
-
return
|
|
1842
|
+
return path13.resolve(candidate);
|
|
1834
1843
|
}
|
|
1835
1844
|
if (current === root) break;
|
|
1836
|
-
current =
|
|
1845
|
+
current = path13.dirname(current);
|
|
1837
1846
|
}
|
|
1838
1847
|
return null;
|
|
1839
1848
|
}
|
|
1840
1849
|
async function resolveFromRunningScript() {
|
|
1841
1850
|
if (!process.argv[1]) return null;
|
|
1842
|
-
const script =
|
|
1843
|
-
const base =
|
|
1851
|
+
const script = path13.resolve(process.argv[1]);
|
|
1852
|
+
const base = path13.basename(script);
|
|
1844
1853
|
if ((base === "cli.cjs" || base === "cli.ts" || base === "memoraone-mcp.cjs") && await pathExists(script)) {
|
|
1845
1854
|
return script;
|
|
1846
1855
|
}
|
|
1847
|
-
const here =
|
|
1856
|
+
const here = path13.dirname(script);
|
|
1848
1857
|
const candidates = [
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1858
|
+
path13.join(here, "cli.cjs"),
|
|
1859
|
+
path13.join(here, "..", "dist", "cli.cjs"),
|
|
1860
|
+
path13.join(here, "..", "..", "dist", "cli.cjs")
|
|
1852
1861
|
];
|
|
1853
1862
|
for (const candidate of candidates) {
|
|
1854
1863
|
if (await pathExists(candidate)) {
|
|
1855
|
-
return
|
|
1864
|
+
return path13.resolve(candidate);
|
|
1856
1865
|
}
|
|
1857
1866
|
}
|
|
1858
1867
|
return null;
|
|
@@ -1871,7 +1880,7 @@ async function resolveBuiltCliPathAsync(options) {
|
|
|
1871
1880
|
searchDirs.push(process.cwd());
|
|
1872
1881
|
const seen = /* @__PURE__ */ new Set();
|
|
1873
1882
|
for (const dir of searchDirs) {
|
|
1874
|
-
const key =
|
|
1883
|
+
const key = path13.resolve(dir);
|
|
1875
1884
|
if (seen.has(key)) continue;
|
|
1876
1885
|
seen.add(key);
|
|
1877
1886
|
const found = await findMonorepoCliFrom(key);
|
|
@@ -1882,12 +1891,12 @@ async function resolveBuiltCliPathAsync(options) {
|
|
|
1882
1891
|
}
|
|
1883
1892
|
return null;
|
|
1884
1893
|
}
|
|
1885
|
-
var fs9,
|
|
1894
|
+
var fs9, path13, MONOREPO_CLI_REL;
|
|
1886
1895
|
var init_resolveBuiltCliPath = __esm({
|
|
1887
1896
|
"src/resolveBuiltCliPath.ts"() {
|
|
1888
1897
|
fs9 = __toESM(require("fs/promises"), 1);
|
|
1889
|
-
|
|
1890
|
-
MONOREPO_CLI_REL =
|
|
1898
|
+
path13 = __toESM(require("path"), 1);
|
|
1899
|
+
MONOREPO_CLI_REL = path13.join("packages", "mcp", "dist", "cli.cjs");
|
|
1891
1900
|
}
|
|
1892
1901
|
});
|
|
1893
1902
|
|
|
@@ -1922,7 +1931,7 @@ function looksLikeLocalMonorepoCliPath(scriptPath) {
|
|
|
1922
1931
|
if (normalized.includes("/node_modules/@memoraone/mcp/")) return false;
|
|
1923
1932
|
if (normalized.includes("/.npm/_npx/")) return false;
|
|
1924
1933
|
if (normalized.includes("/_npx/")) return false;
|
|
1925
|
-
const base =
|
|
1934
|
+
const base = path14.basename(normalized);
|
|
1926
1935
|
if (base === "cli.ts" || base === "cli.cjs" || base === "memoraone-mcp.cjs") {
|
|
1927
1936
|
if (normalized.includes("/packages/mcp/dist/") || normalized.includes("/packages/mcp/dist-bin/") || normalized.includes("/packages/mcp/src/")) {
|
|
1928
1937
|
return true;
|
|
@@ -1943,7 +1952,7 @@ function channelFromEnv(env2) {
|
|
|
1943
1952
|
async function resolvePackageExecutionMode(options = {}) {
|
|
1944
1953
|
if (options.executionMode) return options.executionMode;
|
|
1945
1954
|
const env2 = options.env ?? process.env;
|
|
1946
|
-
const scriptPath = options.scriptPath !== void 0 ? options.scriptPath : process.argv[1] ?
|
|
1955
|
+
const scriptPath = options.scriptPath !== void 0 ? options.scriptPath : process.argv[1] ? path14.resolve(process.argv[1]) : null;
|
|
1947
1956
|
if (scriptPath && looksLikePublishedPackagePath(scriptPath)) {
|
|
1948
1957
|
const channel2 = channelFromEnv(env2) ?? npmPackageChannelFromApiUrl(options.apiUrl);
|
|
1949
1958
|
return { kind: "published", channel: channel2 };
|
|
@@ -1952,7 +1961,7 @@ async function resolvePackageExecutionMode(options = {}) {
|
|
|
1952
1961
|
return { kind: "local", cliPath: scriptPath };
|
|
1953
1962
|
}
|
|
1954
1963
|
if (options.cliPath) {
|
|
1955
|
-
return { kind: "local", cliPath:
|
|
1964
|
+
return { kind: "local", cliPath: path14.resolve(options.cliPath) };
|
|
1956
1965
|
}
|
|
1957
1966
|
const resolveCli = options.resolveBuiltCliPath ?? resolveBuiltCliPathAsync;
|
|
1958
1967
|
const builtCli = await resolveCli();
|
|
@@ -1988,10 +1997,10 @@ function formatIdeSetupRepairHint(workspaceRoot, mode) {
|
|
|
1988
1997
|
const stagingFlag = mode.channel === "staging" ? " --staging" : "";
|
|
1989
1998
|
return `Repair with (no new connect code): npx -y ${spec} setup-ide-files --all${stagingFlag} --force --workspace-root ${workspaceRoot}`;
|
|
1990
1999
|
}
|
|
1991
|
-
var
|
|
2000
|
+
var path14, PROD_API_URL, STAGING_API_URL, STAGING_API_URL_PREFIX;
|
|
1992
2001
|
var init_packageExecutionMode = __esm({
|
|
1993
2002
|
"src/packageExecutionMode.ts"() {
|
|
1994
|
-
|
|
2003
|
+
path14 = __toESM(require("path"), 1);
|
|
1995
2004
|
init_resolveBuiltCliPath();
|
|
1996
2005
|
PROD_API_URL = "https://api.memoraone.com";
|
|
1997
2006
|
STAGING_API_URL = "https://memora-api-staging-phbtrzocjq-uk.a.run.app";
|
|
@@ -2043,7 +2052,7 @@ function memoraoneWorkspaceRootFromServerEntry(entry) {
|
|
|
2043
2052
|
if (!entry || typeof entry !== "object" || Array.isArray(entry)) return void 0;
|
|
2044
2053
|
const env2 = envRecordFromEntry(entry);
|
|
2045
2054
|
const root = env2?.MEMORAONE_WORKSPACE_ROOT;
|
|
2046
|
-
return typeof root === "string" && root.trim() !== "" ?
|
|
2055
|
+
return typeof root === "string" && root.trim() !== "" ? path15.resolve(root) : void 0;
|
|
2047
2056
|
}
|
|
2048
2057
|
function tokensInvokeMemoraone(tokens) {
|
|
2049
2058
|
for (const token of tokens) {
|
|
@@ -2112,7 +2121,7 @@ function replaceMemoraoneRepositoryBindingInServerMap(servers, canonical, owners
|
|
|
2112
2121
|
const generatedTargetKey = memoraoneServerNameForRepositoryBinding(
|
|
2113
2122
|
ownership.repositoryBindingId
|
|
2114
2123
|
);
|
|
2115
|
-
const targetRoot =
|
|
2124
|
+
const targetRoot = path15.resolve(ownership.workspaceRoot);
|
|
2116
2125
|
const matchingRootKeys = Object.entries(servers).filter(
|
|
2117
2126
|
([key, value]) => REPOSITORY_SERVER_KEY_RE.test(key) && memoraoneWorkspaceRootFromServerEntry(value) === targetRoot
|
|
2118
2127
|
).map(([key]) => key).sort();
|
|
@@ -2144,7 +2153,7 @@ function stripMemoraoneRepositoryBindingFromServerMap(servers, ownership) {
|
|
|
2144
2153
|
memoraoneServerNameForRepositoryBinding
|
|
2145
2154
|
)
|
|
2146
2155
|
]);
|
|
2147
|
-
const targetRoot =
|
|
2156
|
+
const targetRoot = path15.resolve(ownership.workspaceRoot);
|
|
2148
2157
|
const next = {};
|
|
2149
2158
|
const removedKeys = [];
|
|
2150
2159
|
for (const [key, value] of Object.entries(servers)) {
|
|
@@ -2195,11 +2204,11 @@ function canonicalValueMatches(actual, expected) {
|
|
|
2195
2204
|
}
|
|
2196
2205
|
return false;
|
|
2197
2206
|
}
|
|
2198
|
-
var import_node_crypto4,
|
|
2207
|
+
var import_node_crypto4, path15, CANONICAL_MEMORAONE_MCP_SERVER_NAME, MEMORAONE_REPOSITORY_SERVER_NAME_PREFIX, REPOSITORY_SERVER_KEY_RE, LEGACY_MEMORAONE_SERVER_NAME_ALIASES, OWNED_NAME_NORMALIZED, MEMORAONE_PACKAGE_SPEC_RE, MEMORAONE_CLI_TOKEN_RE, MEMORAONE_LOCAL_CLI_PATH_RE, MEMORAONE_OWNED_SERVER_NAME_ALIASES;
|
|
2199
2208
|
var init_memoraoneMcpOwnership = __esm({
|
|
2200
2209
|
"src/memoraoneMcpOwnership.ts"() {
|
|
2201
2210
|
import_node_crypto4 = require("crypto");
|
|
2202
|
-
|
|
2211
|
+
path15 = __toESM(require("path"), 1);
|
|
2203
2212
|
CANONICAL_MEMORAONE_MCP_SERVER_NAME = "memoraone";
|
|
2204
2213
|
MEMORAONE_REPOSITORY_SERVER_NAME_PREFIX = "memoraone-";
|
|
2205
2214
|
REPOSITORY_SERVER_KEY_RE = /^memoraone-[0-9a-f]{16}$/;
|
|
@@ -2245,7 +2254,7 @@ function buildMemoraoneCursorMcpServer(options) {
|
|
|
2245
2254
|
env2.MEMORAONE_IDE_TYPE = ideType;
|
|
2246
2255
|
}
|
|
2247
2256
|
if (options.workspaceRoot !== void 0) {
|
|
2248
|
-
env2[MEMORAONE_WORKSPACE_ROOT_ENV] =
|
|
2257
|
+
env2[MEMORAONE_WORKSPACE_ROOT_ENV] = path16.resolve(options.workspaceRoot);
|
|
2249
2258
|
}
|
|
2250
2259
|
if (options.environment === "local") {
|
|
2251
2260
|
if (!options.cliPath) {
|
|
@@ -2281,7 +2290,7 @@ function stripLeadingLineComments(text) {
|
|
|
2281
2290
|
return text.split("\n").filter((line) => !/^\s*\/\//.test(line)).join("\n");
|
|
2282
2291
|
}
|
|
2283
2292
|
function getKnownCursorGlobalMcpConfigCandidates(homeDir) {
|
|
2284
|
-
return [
|
|
2293
|
+
return [path16.join(homeDir, ".cursor", "mcp.json")];
|
|
2285
2294
|
}
|
|
2286
2295
|
async function detectCursorGlobalMcpConfig(options) {
|
|
2287
2296
|
if (options?.explicitPath) {
|
|
@@ -2344,7 +2353,7 @@ async function resolveNpxPath() {
|
|
|
2344
2353
|
const pathSep = process.platform === "win32" ? ";" : ":";
|
|
2345
2354
|
for (const dir of (process.env.PATH ?? "").split(pathSep)) {
|
|
2346
2355
|
if (!dir) continue;
|
|
2347
|
-
candidates.push(
|
|
2356
|
+
candidates.push(path16.join(dir, npxName));
|
|
2348
2357
|
}
|
|
2349
2358
|
try {
|
|
2350
2359
|
const lookupCmd = process.platform === "win32" ? "where" : "which";
|
|
@@ -2355,7 +2364,7 @@ async function resolveNpxPath() {
|
|
|
2355
2364
|
}
|
|
2356
2365
|
const seen = /* @__PURE__ */ new Set();
|
|
2357
2366
|
for (const candidate of candidates) {
|
|
2358
|
-
const abs =
|
|
2367
|
+
const abs = path16.isAbsolute(candidate) ? candidate : path16.resolve(candidate);
|
|
2359
2368
|
const key = process.platform === "win32" ? abs.toLowerCase() : abs;
|
|
2360
2369
|
if (seen.has(key)) continue;
|
|
2361
2370
|
seen.add(key);
|
|
@@ -2415,7 +2424,7 @@ function mergeClaudeCodeMcpConfigObject(existing, writeOptions) {
|
|
|
2415
2424
|
};
|
|
2416
2425
|
}
|
|
2417
2426
|
function getClaudeCodeMcpConfigPath(repoRoot) {
|
|
2418
|
-
return
|
|
2427
|
+
return path16.join(path16.resolve(repoRoot), ".mcp.json");
|
|
2419
2428
|
}
|
|
2420
2429
|
function isMemoraoneManagedApiUrl(url) {
|
|
2421
2430
|
if (typeof url !== "string" || url.length === 0) return false;
|
|
@@ -2464,7 +2473,7 @@ function memoraoneServerMatches(server, matchOptions) {
|
|
|
2464
2473
|
if (e.MEMORAONE_IDE_TYPE !== "cursor") return false;
|
|
2465
2474
|
const workspaceRoot = e[MEMORAONE_WORKSPACE_ROOT_ENV];
|
|
2466
2475
|
if (matchOptions.repoRoot !== void 0) {
|
|
2467
|
-
return typeof workspaceRoot === "string" &&
|
|
2476
|
+
return typeof workspaceRoot === "string" && path16.resolve(workspaceRoot) === path16.resolve(matchOptions.repoRoot);
|
|
2468
2477
|
}
|
|
2469
2478
|
return workspaceRoot === void 0;
|
|
2470
2479
|
}
|
|
@@ -2499,7 +2508,7 @@ function validateCursorRepoMcpConfig(parsed2, matchOptions) {
|
|
|
2499
2508
|
}
|
|
2500
2509
|
}
|
|
2501
2510
|
function getCursorRepoMcpConfigPath(repoRoot) {
|
|
2502
|
-
return
|
|
2511
|
+
return path16.join(repoRoot, ".cursor", "mcp.json");
|
|
2503
2512
|
}
|
|
2504
2513
|
async function readCursorMcpConfigObject(configPath) {
|
|
2505
2514
|
try {
|
|
@@ -2530,12 +2539,12 @@ async function removeMemoraoneFromCursorGlobalConfig(options) {
|
|
|
2530
2539
|
return { changed: true, backupPath };
|
|
2531
2540
|
}
|
|
2532
2541
|
const next = { ...parsed2, mcpServers };
|
|
2533
|
-
await fs10.mkdir(
|
|
2542
|
+
await fs10.mkdir(path16.dirname(configPath), { recursive: true });
|
|
2534
2543
|
await fs10.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
|
|
2535
2544
|
return { changed: true, backupPath };
|
|
2536
2545
|
}
|
|
2537
2546
|
async function auditCursorMcpConfig(options) {
|
|
2538
|
-
const repoRoot =
|
|
2547
|
+
const repoRoot = path16.resolve(options?.repoRoot ?? process.cwd());
|
|
2539
2548
|
const repoConfigPath = getCursorRepoMcpConfigPath(repoRoot);
|
|
2540
2549
|
const globalDetection = await detectCursorGlobalMcpConfig({
|
|
2541
2550
|
homeDir: options?.homeDir,
|
|
@@ -2637,12 +2646,12 @@ function logCursorMcpCliSummary(info, dryRun, opts) {
|
|
|
2637
2646
|
);
|
|
2638
2647
|
}
|
|
2639
2648
|
}
|
|
2640
|
-
var fs10, os4,
|
|
2649
|
+
var fs10, os4, path16, import_node_child_process2, import_node_util2, execFileAsync2, MEMORAONE_PROD_API_URL, MEMORAONE_LOCAL_API_URL, MEMORAONE_STAGING_API_URL, MEMORAONE_STAGING_API_URL_PREFIX;
|
|
2641
2650
|
var init_cursorGlobalMcpConfig = __esm({
|
|
2642
2651
|
"src/cursorGlobalMcpConfig.ts"() {
|
|
2643
2652
|
fs10 = __toESM(require("fs/promises"), 1);
|
|
2644
2653
|
os4 = __toESM(require("os"), 1);
|
|
2645
|
-
|
|
2654
|
+
path16 = __toESM(require("path"), 1);
|
|
2646
2655
|
import_node_child_process2 = require("child_process");
|
|
2647
2656
|
import_node_util2 = require("util");
|
|
2648
2657
|
init_initializeBinding();
|
|
@@ -2868,7 +2877,7 @@ async function defaultListSocketPaths(projectId) {
|
|
|
2868
2877
|
if (!name.endsWith(".sock") || !isMemoraoneSocketFilename(name)) {
|
|
2869
2878
|
continue;
|
|
2870
2879
|
}
|
|
2871
|
-
const socketPath =
|
|
2880
|
+
const socketPath = path17.join(baseDir, name);
|
|
2872
2881
|
if (projectId === null) {
|
|
2873
2882
|
paths.push(socketPath);
|
|
2874
2883
|
continue;
|
|
@@ -2888,7 +2897,7 @@ async function defaultListSocketPaths(projectId) {
|
|
|
2888
2897
|
return paths.sort();
|
|
2889
2898
|
}
|
|
2890
2899
|
async function defaultListSocketPathsForWorkspaceRoot(workspaceRoot) {
|
|
2891
|
-
const resolvedRoot =
|
|
2900
|
+
const resolvedRoot = path17.resolve(workspaceRoot);
|
|
2892
2901
|
const baseDir = getMcpBaseDir();
|
|
2893
2902
|
let entries;
|
|
2894
2903
|
try {
|
|
@@ -2905,36 +2914,36 @@ async function defaultListSocketPathsForWorkspaceRoot(workspaceRoot) {
|
|
|
2905
2914
|
if (!name.endsWith(".sock") || !isHashSocketFilename(name)) {
|
|
2906
2915
|
continue;
|
|
2907
2916
|
}
|
|
2908
|
-
const socketPath =
|
|
2917
|
+
const socketPath = path17.join(baseDir, name);
|
|
2909
2918
|
const record = readBindingSidecarRecord(socketPath);
|
|
2910
2919
|
if (!record?.workspaceRoot) continue;
|
|
2911
|
-
if (
|
|
2920
|
+
if (path17.resolve(record.workspaceRoot) === resolvedRoot) {
|
|
2912
2921
|
paths.push(socketPath);
|
|
2913
2922
|
}
|
|
2914
2923
|
}
|
|
2915
2924
|
return paths.sort();
|
|
2916
2925
|
}
|
|
2917
2926
|
async function defaultListSocketPathsForM1Path(m1Path) {
|
|
2918
|
-
return defaultListSocketPathsForWorkspaceRoot(
|
|
2927
|
+
return defaultListSocketPathsForWorkspaceRoot(path17.dirname(path17.resolve(m1Path)));
|
|
2919
2928
|
}
|
|
2920
2929
|
async function filterSocketPathsByIdeForCleanup(socketPaths, projectId, ide, workspaceRoot) {
|
|
2921
2930
|
if (ide === void 0) return socketPaths;
|
|
2922
2931
|
const normalizedProjectId = projectId.trim().toLowerCase();
|
|
2923
|
-
const resolvedRoot = workspaceRoot ?
|
|
2932
|
+
const resolvedRoot = workspaceRoot ? path17.resolve(workspaceRoot) : null;
|
|
2924
2933
|
const filtered = [];
|
|
2925
2934
|
for (const socketPath of socketPaths) {
|
|
2926
|
-
const
|
|
2927
|
-
if (isLegacySocketFilename(
|
|
2928
|
-
if (isSocketFilenameForProjectAndIde(
|
|
2935
|
+
const basename31 = path17.basename(socketPath);
|
|
2936
|
+
if (isLegacySocketFilename(basename31)) {
|
|
2937
|
+
if (isSocketFilenameForProjectAndIde(basename31, normalizedProjectId, ide)) {
|
|
2929
2938
|
filtered.push(socketPath);
|
|
2930
2939
|
}
|
|
2931
2940
|
continue;
|
|
2932
2941
|
}
|
|
2933
|
-
if (isHashSocketFilename(
|
|
2942
|
+
if (isHashSocketFilename(basename31)) {
|
|
2934
2943
|
const record = readBindingSidecarRecord(socketPath);
|
|
2935
2944
|
if (!record || record.ideType !== ide) continue;
|
|
2936
2945
|
const sameProject = record.projectId.trim().toLowerCase() === normalizedProjectId;
|
|
2937
|
-
const sameWorkspace = resolvedRoot !== null &&
|
|
2946
|
+
const sameWorkspace = resolvedRoot !== null && path17.resolve(record.workspaceRoot) === resolvedRoot;
|
|
2938
2947
|
if (sameProject || sameWorkspace) {
|
|
2939
2948
|
filtered.push(socketPath);
|
|
2940
2949
|
}
|
|
@@ -2966,7 +2975,7 @@ async function defaultConfirm(message) {
|
|
|
2966
2975
|
}
|
|
2967
2976
|
async function resolveCleanupTarget(cwd2) {
|
|
2968
2977
|
try {
|
|
2969
|
-
const binding = await resolveAuthoritativeBinding([
|
|
2978
|
+
const binding = await resolveAuthoritativeBinding([path17.resolve(cwd2)]);
|
|
2970
2979
|
return {
|
|
2971
2980
|
workspaceRoot: binding.workspaceRoot,
|
|
2972
2981
|
repositoryBindingId: binding.repositoryBindingId,
|
|
@@ -3162,7 +3171,7 @@ async function runCleanup(opts) {
|
|
|
3162
3171
|
projectIds.add(proc.projectId);
|
|
3163
3172
|
}
|
|
3164
3173
|
for (const socketPath of socketPaths) {
|
|
3165
|
-
const id = extractProjectIdFromSocketFilename(
|
|
3174
|
+
const id = extractProjectIdFromSocketFilename(path17.basename(socketPath));
|
|
3166
3175
|
if (id) {
|
|
3167
3176
|
projectIds.add(id);
|
|
3168
3177
|
continue;
|
|
@@ -3345,11 +3354,11 @@ async function cliCleanup(argv) {
|
|
|
3345
3354
|
}
|
|
3346
3355
|
return result.exitCode;
|
|
3347
3356
|
}
|
|
3348
|
-
var fs11,
|
|
3357
|
+
var fs11, path17, readline, import_node_child_process3, import_node_util3, import_node_process, execFileAsync3, DAEMON_PROJECT_ID_RE, DAEMON_BINDING_ID_RE, PROJECT_ID_RE, MEMORAONE_MCP_COMMAND_RE, CLEANUP_PROJECT_ID_REQUIRED_ERROR;
|
|
3349
3358
|
var init_cleanup = __esm({
|
|
3350
3359
|
"src/cleanup.ts"() {
|
|
3351
3360
|
fs11 = __toESM(require("fs/promises"), 1);
|
|
3352
|
-
|
|
3361
|
+
path17 = __toESM(require("path"), 1);
|
|
3353
3362
|
readline = __toESM(require("readline/promises"), 1);
|
|
3354
3363
|
import_node_child_process3 = require("child_process");
|
|
3355
3364
|
import_node_util3 = require("util");
|
|
@@ -3391,17 +3400,17 @@ var init_configUtils = __esm({
|
|
|
3391
3400
|
});
|
|
3392
3401
|
|
|
3393
3402
|
// src/config.ts
|
|
3394
|
-
var process2, fs12,
|
|
3403
|
+
var process2, fs12, path18, dotenv, import_v4, dotenvPath, EnvSchema, requiredEnvVars, missingEnvVars, parsed, resolvedApiUrl, parseBooleanFlag2, config2;
|
|
3395
3404
|
var init_config = __esm({
|
|
3396
3405
|
"src/config.ts"() {
|
|
3397
3406
|
process2 = __toESM(require("process"), 1);
|
|
3398
3407
|
fs12 = __toESM(require("fs"), 1);
|
|
3399
|
-
|
|
3408
|
+
path18 = __toESM(require("path"), 1);
|
|
3400
3409
|
dotenv = __toESM(require("dotenv"), 1);
|
|
3401
3410
|
import_v4 = require("zod/v4");
|
|
3402
3411
|
init_configUtils();
|
|
3403
3412
|
init_socketPaths();
|
|
3404
|
-
dotenvPath =
|
|
3413
|
+
dotenvPath = path18.resolve(process2.cwd(), ".env");
|
|
3405
3414
|
if (fs12.existsSync(dotenvPath)) {
|
|
3406
3415
|
try {
|
|
3407
3416
|
dotenv.config({ path: dotenvPath });
|
|
@@ -3476,7 +3485,7 @@ var init_config = __esm({
|
|
|
3476
3485
|
function resolveRepoFingerprint(cwd2) {
|
|
3477
3486
|
const found = findGitRoot(cwd2);
|
|
3478
3487
|
if (!found) {
|
|
3479
|
-
const fallbackPath =
|
|
3488
|
+
const fallbackPath = path19.resolve(cwd2);
|
|
3480
3489
|
const fingerprint2 = sha256(fallbackPath);
|
|
3481
3490
|
debugLog(`repo fingerprint=${fingerprint2} source=path-fallback`);
|
|
3482
3491
|
return {
|
|
@@ -3498,7 +3507,7 @@ function resolveRepoFingerprint(cwd2) {
|
|
|
3498
3507
|
source: "git-remote"
|
|
3499
3508
|
};
|
|
3500
3509
|
}
|
|
3501
|
-
const fingerprint = sha256(
|
|
3510
|
+
const fingerprint = sha256(path19.resolve(gitRoot));
|
|
3502
3511
|
debugLog(`repo fingerprint=${fingerprint} source=path-fallback`);
|
|
3503
3512
|
return {
|
|
3504
3513
|
fingerprint,
|
|
@@ -3506,11 +3515,11 @@ function resolveRepoFingerprint(cwd2) {
|
|
|
3506
3515
|
source: "path-fallback"
|
|
3507
3516
|
};
|
|
3508
3517
|
}
|
|
3509
|
-
var fs13,
|
|
3518
|
+
var fs13, path19, crypto2, parseBooleanFlag3, debugEnabled2, debugLog, normalizeRemoteUrl, sha256, resolveGitDir, findGitRoot, readOriginRemote;
|
|
3510
3519
|
var init_repoFingerprint = __esm({
|
|
3511
3520
|
"src/repoFingerprint.ts"() {
|
|
3512
3521
|
fs13 = __toESM(require("fs"), 1);
|
|
3513
|
-
|
|
3522
|
+
path19 = __toESM(require("path"), 1);
|
|
3514
3523
|
crypto2 = __toESM(require("crypto"), 1);
|
|
3515
3524
|
parseBooleanFlag3 = (value) => {
|
|
3516
3525
|
if (!value) {
|
|
@@ -3549,7 +3558,7 @@ var init_repoFingerprint = __esm({
|
|
|
3549
3558
|
const match = content.match(/^gitdir:\s*(.+)$/m);
|
|
3550
3559
|
if (match) {
|
|
3551
3560
|
const gitDir = match[1].trim();
|
|
3552
|
-
return
|
|
3561
|
+
return path19.resolve(path19.dirname(gitPath), gitDir);
|
|
3553
3562
|
}
|
|
3554
3563
|
}
|
|
3555
3564
|
} catch {
|
|
@@ -3558,16 +3567,16 @@ var init_repoFingerprint = __esm({
|
|
|
3558
3567
|
return null;
|
|
3559
3568
|
};
|
|
3560
3569
|
findGitRoot = (start) => {
|
|
3561
|
-
let current =
|
|
3570
|
+
let current = path19.resolve(start);
|
|
3562
3571
|
while (true) {
|
|
3563
|
-
const gitPath =
|
|
3572
|
+
const gitPath = path19.join(current, ".git");
|
|
3564
3573
|
if (fs13.existsSync(gitPath)) {
|
|
3565
3574
|
const gitDir = resolveGitDir(gitPath);
|
|
3566
3575
|
if (gitDir) {
|
|
3567
3576
|
return { gitRoot: current, gitDir };
|
|
3568
3577
|
}
|
|
3569
3578
|
}
|
|
3570
|
-
const parent =
|
|
3579
|
+
const parent = path19.dirname(current);
|
|
3571
3580
|
if (parent === current) {
|
|
3572
3581
|
break;
|
|
3573
3582
|
}
|
|
@@ -3576,7 +3585,7 @@ var init_repoFingerprint = __esm({
|
|
|
3576
3585
|
return null;
|
|
3577
3586
|
};
|
|
3578
3587
|
readOriginRemote = (gitDir) => {
|
|
3579
|
-
const configPath =
|
|
3588
|
+
const configPath = path19.join(gitDir, "config");
|
|
3580
3589
|
try {
|
|
3581
3590
|
const content = fs13.readFileSync(configPath, "utf8");
|
|
3582
3591
|
const lines = content.split(/\r?\n/);
|
|
@@ -3619,12 +3628,12 @@ function formatJetBrainsBackupTimestamp(d = /* @__PURE__ */ new Date()) {
|
|
|
3619
3628
|
return `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}-${pad(d.getHours())}${pad(d.getMinutes())}${pad(d.getSeconds())}`;
|
|
3620
3629
|
}
|
|
3621
3630
|
function getJetBrainsGlobalMcpConfigPath(homeDir) {
|
|
3622
|
-
return
|
|
3631
|
+
return path20.join(homeDir, ".ai", "mcp", "mcp.json");
|
|
3623
3632
|
}
|
|
3624
3633
|
function getJetBrainsProjectMcpConfigPaths(repoRoot) {
|
|
3625
3634
|
return [
|
|
3626
|
-
{ kind: "project-ai", path:
|
|
3627
|
-
{ kind: "project-ij", path:
|
|
3635
|
+
{ kind: "project-ai", path: path20.join(repoRoot, ".ai", "mcp", "mcp.json") },
|
|
3636
|
+
{ kind: "project-ij", path: path20.join(repoRoot, ".ij", "mcp", "mcp.json") }
|
|
3628
3637
|
];
|
|
3629
3638
|
}
|
|
3630
3639
|
function getKnownJetBrainsMcpConfigLocations(homeDir, repoRoot) {
|
|
@@ -3659,7 +3668,7 @@ function buildMemoraoneJetBrainsMcpServer(options) {
|
|
|
3659
3668
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
3660
3669
|
}),
|
|
3661
3670
|
MEMORAONE_IDE_TYPE: "jetbrains",
|
|
3662
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
3671
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path20.resolve(options.workspaceRoot)
|
|
3663
3672
|
};
|
|
3664
3673
|
if (environment === "local" || options.devMode) {
|
|
3665
3674
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -3679,11 +3688,11 @@ function mergeJetBrainsMcpConfigObject(existing, memoraone, ownership) {
|
|
|
3679
3688
|
return { ...base, mcpServers: ownership ? replaceMemoraoneRepositoryBindingInServerMap(mcpServers, memoraone, ownership) : replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
3680
3689
|
}
|
|
3681
3690
|
async function writeJetBrainsMcpJsonAtomic(filePath, content) {
|
|
3682
|
-
const dir =
|
|
3691
|
+
const dir = path20.dirname(filePath);
|
|
3683
3692
|
await fs14.mkdir(dir, { recursive: true });
|
|
3684
|
-
const tmpPath =
|
|
3693
|
+
const tmpPath = path20.join(
|
|
3685
3694
|
dir,
|
|
3686
|
-
`.${
|
|
3695
|
+
`.${path20.basename(filePath)}.${process.pid}.${(0, import_node_crypto5.randomBytes)(8).toString("hex")}.tmp`
|
|
3687
3696
|
);
|
|
3688
3697
|
try {
|
|
3689
3698
|
await fs14.writeFile(tmpPath, content, "utf8");
|
|
@@ -3768,20 +3777,20 @@ async function removeMemoraoneFromProjectConfig(options) {
|
|
|
3768
3777
|
return { changed: true, backupPath };
|
|
3769
3778
|
}
|
|
3770
3779
|
const next = { ...parsed2, mcpServers };
|
|
3771
|
-
await fs14.mkdir(
|
|
3780
|
+
await fs14.mkdir(path20.dirname(configPath), { recursive: true });
|
|
3772
3781
|
await fs14.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
|
|
3773
3782
|
return { changed: true, backupPath };
|
|
3774
3783
|
}
|
|
3775
3784
|
async function resolveLocalCliPathAsync() {
|
|
3776
|
-
const here = process.argv[1] ?
|
|
3785
|
+
const here = process.argv[1] ? path20.dirname(path20.resolve(process.argv[1])) : process.cwd();
|
|
3777
3786
|
const candidates = [
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3787
|
+
path20.join(here, "cli.cjs"),
|
|
3788
|
+
path20.join(here, "..", "dist", "cli.cjs"),
|
|
3789
|
+
path20.join(here, "..", "..", "dist", "cli.cjs")
|
|
3781
3790
|
];
|
|
3782
3791
|
for (const candidate of candidates) {
|
|
3783
3792
|
if (await pathExists3(candidate)) {
|
|
3784
|
-
return
|
|
3793
|
+
return path20.resolve(candidate);
|
|
3785
3794
|
}
|
|
3786
3795
|
}
|
|
3787
3796
|
return null;
|
|
@@ -3838,7 +3847,7 @@ function formatOptionalJetBrainsHandshakeUnavailableDetail(detail) {
|
|
|
3838
3847
|
async function verifyJetBrainsMcpHandshake(options) {
|
|
3839
3848
|
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
3840
3849
|
const { server } = options;
|
|
3841
|
-
return new Promise((
|
|
3850
|
+
return new Promise((resolve40) => {
|
|
3842
3851
|
let settled = false;
|
|
3843
3852
|
const finish = (ok, detail, optionalUnavailable) => {
|
|
3844
3853
|
if (settled) return;
|
|
@@ -3848,7 +3857,7 @@ async function verifyJetBrainsMcpHandshake(options) {
|
|
|
3848
3857
|
child.kill();
|
|
3849
3858
|
} catch {
|
|
3850
3859
|
}
|
|
3851
|
-
|
|
3860
|
+
resolve40({ ok, detail, optionalUnavailable });
|
|
3852
3861
|
};
|
|
3853
3862
|
const child = (0, import_node_child_process4.spawn)(server.command, [...server.args], {
|
|
3854
3863
|
env: { ...process.env, ...server.env },
|
|
@@ -3922,7 +3931,7 @@ async function verifyJetBrainsMcpHandshake(options) {
|
|
|
3922
3931
|
async function setupJetBrainsMcpConfig(options) {
|
|
3923
3932
|
const homeDir = options.homeDir ?? os5.homedir();
|
|
3924
3933
|
const globalPath = options.globalConfigPath ?? getJetBrainsGlobalMcpConfigPath(homeDir);
|
|
3925
|
-
const workspaceRoot =
|
|
3934
|
+
const workspaceRoot = path20.resolve(options.repoRoot);
|
|
3926
3935
|
const repairActions = [];
|
|
3927
3936
|
const allLocations = getKnownJetBrainsMcpConfigLocations(homeDir, options.repoRoot);
|
|
3928
3937
|
for (const location of allLocations) {
|
|
@@ -4061,12 +4070,12 @@ function logJetBrainsMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
4061
4070
|
"[setup-ide-files] Fully quit JetBrains IDE and reopen this repo for MCP changes to take effect."
|
|
4062
4071
|
);
|
|
4063
4072
|
}
|
|
4064
|
-
var fs14, os5,
|
|
4073
|
+
var fs14, os5, path20, import_node_crypto5, import_node_child_process4, JETBRAINS_DEBUG_ENV_VARS;
|
|
4065
4074
|
var init_jetbrainsMcpConfig = __esm({
|
|
4066
4075
|
"src/jetbrainsMcpConfig.ts"() {
|
|
4067
4076
|
fs14 = __toESM(require("fs/promises"), 1);
|
|
4068
4077
|
os5 = __toESM(require("os"), 1);
|
|
4069
|
-
|
|
4078
|
+
path20 = __toESM(require("path"), 1);
|
|
4070
4079
|
import_node_crypto5 = require("crypto");
|
|
4071
4080
|
import_node_child_process4 = require("child_process");
|
|
4072
4081
|
init_configUtils();
|
|
@@ -4096,10 +4105,10 @@ async function pathExists4(filePath) {
|
|
|
4096
4105
|
}
|
|
4097
4106
|
}
|
|
4098
4107
|
function getWindsurfGlobalMcpConfigPath(homeDir) {
|
|
4099
|
-
return
|
|
4108
|
+
return path21.join(homeDir, ".config", "devin", "mcp_config.json");
|
|
4100
4109
|
}
|
|
4101
4110
|
function getWindsurfLegacyMcpConfigPath(homeDir) {
|
|
4102
|
-
return
|
|
4111
|
+
return path21.join(homeDir, ".codeium", "windsurf", "mcp_config.json");
|
|
4103
4112
|
}
|
|
4104
4113
|
function formatWindsurfBackupTimestamp(d = /* @__PURE__ */ new Date()) {
|
|
4105
4114
|
const pad = (n) => String(n).padStart(2, "0");
|
|
@@ -4113,7 +4122,7 @@ function buildMemoraoneWindsurfMcpServer(options) {
|
|
|
4113
4122
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
4114
4123
|
}),
|
|
4115
4124
|
MEMORAONE_IDE_TYPE: "windsurf",
|
|
4116
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
4125
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path21.resolve(options.workspaceRoot)
|
|
4117
4126
|
};
|
|
4118
4127
|
if (environment === "local" || options.devMode) {
|
|
4119
4128
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -4148,11 +4157,11 @@ function stripMemoraoneFromWindsurfConfigObject(existing) {
|
|
|
4148
4157
|
return { next: { ...base, mcpServers }, removed: true };
|
|
4149
4158
|
}
|
|
4150
4159
|
async function writeWindsurfMcpJsonAtomic(filePath, content) {
|
|
4151
|
-
const dir =
|
|
4160
|
+
const dir = path21.dirname(filePath);
|
|
4152
4161
|
await fs15.mkdir(dir, { recursive: true });
|
|
4153
|
-
const tmpPath =
|
|
4162
|
+
const tmpPath = path21.join(
|
|
4154
4163
|
dir,
|
|
4155
|
-
`.${
|
|
4164
|
+
`.${path21.basename(filePath)}.${process.pid}.${(0, import_node_crypto6.randomBytes)(8).toString("hex")}.tmp`
|
|
4156
4165
|
);
|
|
4157
4166
|
try {
|
|
4158
4167
|
await fs15.writeFile(tmpPath, content, "utf8");
|
|
@@ -4244,8 +4253,8 @@ async function setupWindsurfMcpConfig(options) {
|
|
|
4244
4253
|
const homeDir = options.homeDir ?? os6.homedir();
|
|
4245
4254
|
const activePath = options.globalConfigPath ?? getWindsurfGlobalMcpConfigPath(homeDir);
|
|
4246
4255
|
const legacyPath = options.legacyConfigPath ?? getWindsurfLegacyMcpConfigPath(homeDir);
|
|
4247
|
-
const samePath =
|
|
4248
|
-
const workspaceRoot =
|
|
4256
|
+
const samePath = path21.resolve(activePath) === path21.resolve(legacyPath);
|
|
4257
|
+
const workspaceRoot = path21.resolve(options.repoRoot);
|
|
4249
4258
|
const memoraone = await buildWindsurfMemoraoneServer({
|
|
4250
4259
|
workspaceRoot,
|
|
4251
4260
|
devMode: options.devMode,
|
|
@@ -4405,12 +4414,12 @@ function logWindsurfMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
4405
4414
|
"[setup-ide-files] Refresh MCP servers in Devin Desktop settings, or restart Devin Desktop, for MCP changes to take effect."
|
|
4406
4415
|
);
|
|
4407
4416
|
}
|
|
4408
|
-
var fs15, os6,
|
|
4417
|
+
var fs15, os6, path21, import_node_crypto6;
|
|
4409
4418
|
var init_windsurfMcpConfig = __esm({
|
|
4410
4419
|
"src/windsurfMcpConfig.ts"() {
|
|
4411
4420
|
fs15 = __toESM(require("fs/promises"), 1);
|
|
4412
4421
|
os6 = __toESM(require("os"), 1);
|
|
4413
|
-
|
|
4422
|
+
path21 = __toESM(require("path"), 1);
|
|
4414
4423
|
import_node_crypto6 = require("crypto");
|
|
4415
4424
|
init_configUtils();
|
|
4416
4425
|
init_cursorGlobalMcpConfig();
|
|
@@ -4431,13 +4440,13 @@ async function pathExists5(filePath) {
|
|
|
4431
4440
|
}
|
|
4432
4441
|
}
|
|
4433
4442
|
function getOpenCodeProjectMcpConfigPath(repoRoot) {
|
|
4434
|
-
return
|
|
4443
|
+
return path22.join(path22.resolve(repoRoot), "opencode.json");
|
|
4435
4444
|
}
|
|
4436
4445
|
function getOpenCodeProjectJsoncConfigPath(repoRoot) {
|
|
4437
|
-
return
|
|
4446
|
+
return path22.join(path22.resolve(repoRoot), "opencode.jsonc");
|
|
4438
4447
|
}
|
|
4439
4448
|
function getOpenCodeGlobalMcpConfigPath(homeDir) {
|
|
4440
|
-
return
|
|
4449
|
+
return path22.join(homeDir, ".config", "opencode", "opencode.json");
|
|
4441
4450
|
}
|
|
4442
4451
|
function buildMemoraoneOpenCodeMcpServer(options) {
|
|
4443
4452
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -4447,7 +4456,7 @@ function buildMemoraoneOpenCodeMcpServer(options) {
|
|
|
4447
4456
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
4448
4457
|
}),
|
|
4449
4458
|
MEMORAONE_IDE_TYPE: "opencode",
|
|
4450
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
4459
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path22.resolve(options.workspaceRoot)
|
|
4451
4460
|
};
|
|
4452
4461
|
if (environment === "local" || options.devMode) {
|
|
4453
4462
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -4478,11 +4487,11 @@ function mergeOpenCodeMcpConfigObject(existing, memoraone) {
|
|
|
4478
4487
|
return { ...base, mcp: replaceMemoraoneOwnedInServerMap(mcp, memoraone) };
|
|
4479
4488
|
}
|
|
4480
4489
|
async function writeOpenCodeMcpJsonAtomic(filePath, content) {
|
|
4481
|
-
const dir =
|
|
4490
|
+
const dir = path22.dirname(filePath);
|
|
4482
4491
|
await fs16.mkdir(dir, { recursive: true });
|
|
4483
|
-
const tmpPath =
|
|
4492
|
+
const tmpPath = path22.join(
|
|
4484
4493
|
dir,
|
|
4485
|
-
`.${
|
|
4494
|
+
`.${path22.basename(filePath)}.${process.pid}.${(0, import_node_crypto7.randomBytes)(8).toString("hex")}.tmp`
|
|
4486
4495
|
);
|
|
4487
4496
|
try {
|
|
4488
4497
|
await fs16.writeFile(tmpPath, content, "utf8");
|
|
@@ -4561,7 +4570,7 @@ async function buildOpenCodeMemoraoneServer(options) {
|
|
|
4561
4570
|
async function setupOpenCodeMcpConfig(options) {
|
|
4562
4571
|
const projectPath = options.projectConfigPath ?? getOpenCodeProjectMcpConfigPath(options.repoRoot);
|
|
4563
4572
|
const jsoncPath = getOpenCodeProjectJsoncConfigPath(options.repoRoot);
|
|
4564
|
-
const workspaceRoot =
|
|
4573
|
+
const workspaceRoot = path22.resolve(options.repoRoot);
|
|
4565
4574
|
const memoraone = await buildOpenCodeMemoraoneServer({
|
|
4566
4575
|
workspaceRoot,
|
|
4567
4576
|
devMode: options.devMode,
|
|
@@ -4624,11 +4633,11 @@ function logOpenCodeMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
4624
4633
|
"[setup-ide-files] Fully quit OpenCode and reopen this repo for MCP changes to take effect."
|
|
4625
4634
|
);
|
|
4626
4635
|
}
|
|
4627
|
-
var fs16,
|
|
4636
|
+
var fs16, path22, import_node_crypto7, OPENCODE_CONFIG_SCHEMA_URL, OpenCodeMcpJsonParseError, OpenCodeJsoncOnlyError;
|
|
4628
4637
|
var init_opencodeMcpConfig = __esm({
|
|
4629
4638
|
"src/opencodeMcpConfig.ts"() {
|
|
4630
4639
|
fs16 = __toESM(require("fs/promises"), 1);
|
|
4631
|
-
|
|
4640
|
+
path22 = __toESM(require("path"), 1);
|
|
4632
4641
|
import_node_crypto7 = require("crypto");
|
|
4633
4642
|
init_configUtils();
|
|
4634
4643
|
init_cursorGlobalMcpConfig();
|
|
@@ -4668,11 +4677,11 @@ async function pathExists6(filePath) {
|
|
|
4668
4677
|
}
|
|
4669
4678
|
}
|
|
4670
4679
|
function getCodexProjectMcpConfigPath(repoRoot) {
|
|
4671
|
-
return
|
|
4680
|
+
return path23.join(path23.resolve(repoRoot), ".codex", "config.toml");
|
|
4672
4681
|
}
|
|
4673
4682
|
function getCodexGlobalMcpConfigPath(homeDir, env2 = process.env) {
|
|
4674
|
-
const codexHome = env2.CODEX_HOME?.trim() ?
|
|
4675
|
-
return
|
|
4683
|
+
const codexHome = env2.CODEX_HOME?.trim() ? path23.resolve(env2.CODEX_HOME) : path23.join(homeDir, ".codex");
|
|
4684
|
+
return path23.join(codexHome, "config.toml");
|
|
4676
4685
|
}
|
|
4677
4686
|
function escapeTomlBasicString(value) {
|
|
4678
4687
|
return '"' + value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"';
|
|
@@ -4696,7 +4705,7 @@ function buildMemoraoneCodexMcpServer(options) {
|
|
|
4696
4705
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
4697
4706
|
}),
|
|
4698
4707
|
MEMORAONE_IDE_TYPE: "codex",
|
|
4699
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
4708
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path23.resolve(options.workspaceRoot)
|
|
4700
4709
|
};
|
|
4701
4710
|
if (environment === "local" || options.devMode) {
|
|
4702
4711
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -4923,11 +4932,11 @@ function parseCodexTomlOrThrow(source, configPath) {
|
|
|
4923
4932
|
}
|
|
4924
4933
|
}
|
|
4925
4934
|
async function writeCodexTomlAtomic(filePath, content) {
|
|
4926
|
-
const dir =
|
|
4935
|
+
const dir = path23.dirname(filePath);
|
|
4927
4936
|
await fs17.mkdir(dir, { recursive: true });
|
|
4928
|
-
const tmpPath =
|
|
4937
|
+
const tmpPath = path23.join(
|
|
4929
4938
|
dir,
|
|
4930
|
-
`.${
|
|
4939
|
+
`.${path23.basename(filePath)}.${process.pid}.${(0, import_node_crypto8.randomBytes)(8).toString("hex")}.tmp`
|
|
4931
4940
|
);
|
|
4932
4941
|
try {
|
|
4933
4942
|
await fs17.writeFile(tmpPath, content, "utf8");
|
|
@@ -4982,7 +4991,7 @@ async function buildCodexMemoraoneServer(options) {
|
|
|
4982
4991
|
}
|
|
4983
4992
|
async function setupCodexMcpConfig(options) {
|
|
4984
4993
|
const projectPath = options.projectConfigPath ?? getCodexProjectMcpConfigPath(options.repoRoot);
|
|
4985
|
-
const workspaceRoot =
|
|
4994
|
+
const workspaceRoot = path23.resolve(options.repoRoot);
|
|
4986
4995
|
const memoraone = await buildCodexMemoraoneServer({
|
|
4987
4996
|
workspaceRoot,
|
|
4988
4997
|
devMode: options.devMode,
|
|
@@ -5032,11 +5041,11 @@ function logCodexMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
5032
5041
|
"[setup-ide-files] Trust this project in Codex if prompted, then restart Codex."
|
|
5033
5042
|
);
|
|
5034
5043
|
}
|
|
5035
|
-
var fs17,
|
|
5044
|
+
var fs17, path23, import_node_crypto8, import_smol_toml, CODEX_MCP_SERVER_NAME, CODEX_OWNED_TABLE_PREFIX, CodexMcpTomlParseError, TABLE_HEADER_RE;
|
|
5036
5045
|
var init_codexMcpConfig = __esm({
|
|
5037
5046
|
"src/codexMcpConfig.ts"() {
|
|
5038
5047
|
fs17 = __toESM(require("fs/promises"), 1);
|
|
5039
|
-
|
|
5048
|
+
path23 = __toESM(require("path"), 1);
|
|
5040
5049
|
import_node_crypto8 = require("crypto");
|
|
5041
5050
|
import_smol_toml = require("smol-toml");
|
|
5042
5051
|
init_configUtils();
|
|
@@ -5073,7 +5082,7 @@ async function pathExists7(filePath) {
|
|
|
5073
5082
|
}
|
|
5074
5083
|
}
|
|
5075
5084
|
function getKiroProjectMcpConfigPath(repoRoot) {
|
|
5076
|
-
return
|
|
5085
|
+
return path24.join(path24.resolve(repoRoot), ".kiro", "settings", "mcp.json");
|
|
5077
5086
|
}
|
|
5078
5087
|
function buildMemoraoneKiroMcpServer(options) {
|
|
5079
5088
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -5082,7 +5091,7 @@ function buildMemoraoneKiroMcpServer(options) {
|
|
|
5082
5091
|
environment,
|
|
5083
5092
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
5084
5093
|
}),
|
|
5085
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
5094
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path24.resolve(options.workspaceRoot)
|
|
5086
5095
|
};
|
|
5087
5096
|
if (environment === "local" || options.devMode) {
|
|
5088
5097
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -5104,11 +5113,11 @@ function mergeKiroMcpConfigObject(existing, memoraone) {
|
|
|
5104
5113
|
return { ...base, mcpServers: replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
5105
5114
|
}
|
|
5106
5115
|
async function writeKiroMcpJsonAtomic(filePath, content) {
|
|
5107
|
-
const dir =
|
|
5116
|
+
const dir = path24.dirname(filePath);
|
|
5108
5117
|
await fs18.mkdir(dir, { recursive: true });
|
|
5109
|
-
const tmpPath =
|
|
5118
|
+
const tmpPath = path24.join(
|
|
5110
5119
|
dir,
|
|
5111
|
-
`.${
|
|
5120
|
+
`.${path24.basename(filePath)}.${process.pid}.${(0, import_node_crypto9.randomBytes)(8).toString("hex")}.tmp`
|
|
5112
5121
|
);
|
|
5113
5122
|
try {
|
|
5114
5123
|
await fs18.writeFile(tmpPath, content, "utf8");
|
|
@@ -5186,7 +5195,7 @@ async function buildKiroMemoraoneServer(options) {
|
|
|
5186
5195
|
}
|
|
5187
5196
|
async function setupKiroMcpConfig(options) {
|
|
5188
5197
|
const projectPath = options.projectConfigPath ?? getKiroProjectMcpConfigPath(options.repoRoot);
|
|
5189
|
-
const workspaceRoot =
|
|
5198
|
+
const workspaceRoot = path24.resolve(options.repoRoot);
|
|
5190
5199
|
const memoraone = await buildKiroMemoraoneServer({
|
|
5191
5200
|
workspaceRoot,
|
|
5192
5201
|
devMode: options.devMode,
|
|
@@ -5245,11 +5254,11 @@ function logKiroMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
5245
5254
|
"[setup-ide-files] Fully quit Kiro and reopen this repo for MCP changes to take effect."
|
|
5246
5255
|
);
|
|
5247
5256
|
}
|
|
5248
|
-
var fs18,
|
|
5257
|
+
var fs18, path24, import_node_crypto9, KiroMcpJsonParseError;
|
|
5249
5258
|
var init_kiroMcpConfig = __esm({
|
|
5250
5259
|
"src/kiroMcpConfig.ts"() {
|
|
5251
5260
|
fs18 = __toESM(require("fs/promises"), 1);
|
|
5252
|
-
|
|
5261
|
+
path24 = __toESM(require("path"), 1);
|
|
5253
5262
|
import_node_crypto9 = require("crypto");
|
|
5254
5263
|
init_configUtils();
|
|
5255
5264
|
init_cursorGlobalMcpConfig();
|
|
@@ -5282,7 +5291,7 @@ async function pathExists8(filePath) {
|
|
|
5282
5291
|
}
|
|
5283
5292
|
}
|
|
5284
5293
|
function getRooCodeProjectMcpConfigPath(repoRoot) {
|
|
5285
|
-
return
|
|
5294
|
+
return path25.join(path25.resolve(repoRoot), ".roo", "mcp.json");
|
|
5286
5295
|
}
|
|
5287
5296
|
function buildMemoraoneRooCodeMcpServer(options) {
|
|
5288
5297
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -5292,7 +5301,7 @@ function buildMemoraoneRooCodeMcpServer(options) {
|
|
|
5292
5301
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
5293
5302
|
}),
|
|
5294
5303
|
MEMORAONE_IDE_TYPE: "roo-code",
|
|
5295
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
5304
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path25.resolve(options.workspaceRoot)
|
|
5296
5305
|
};
|
|
5297
5306
|
if (environment === "local" || options.devMode) {
|
|
5298
5307
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -5314,11 +5323,11 @@ function mergeRooCodeMcpConfigObject(existing, memoraone) {
|
|
|
5314
5323
|
return { ...base, mcpServers: replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
5315
5324
|
}
|
|
5316
5325
|
async function writeRooCodeMcpJsonAtomic(filePath, content) {
|
|
5317
|
-
const dir =
|
|
5326
|
+
const dir = path25.dirname(filePath);
|
|
5318
5327
|
await fs19.mkdir(dir, { recursive: true });
|
|
5319
|
-
const tmpPath =
|
|
5328
|
+
const tmpPath = path25.join(
|
|
5320
5329
|
dir,
|
|
5321
|
-
`.${
|
|
5330
|
+
`.${path25.basename(filePath)}.${process.pid}.${(0, import_node_crypto10.randomBytes)(8).toString("hex")}.tmp`
|
|
5322
5331
|
);
|
|
5323
5332
|
try {
|
|
5324
5333
|
await fs19.writeFile(tmpPath, content, "utf8");
|
|
@@ -5396,7 +5405,7 @@ async function buildRooCodeMemoraoneServer(options) {
|
|
|
5396
5405
|
}
|
|
5397
5406
|
async function setupRooCodeMcpConfig(options) {
|
|
5398
5407
|
const projectPath = options.projectConfigPath ?? getRooCodeProjectMcpConfigPath(options.repoRoot);
|
|
5399
|
-
const workspaceRoot =
|
|
5408
|
+
const workspaceRoot = path25.resolve(options.repoRoot);
|
|
5400
5409
|
const memoraone = await buildRooCodeMemoraoneServer({
|
|
5401
5410
|
workspaceRoot,
|
|
5402
5411
|
devMode: options.devMode,
|
|
@@ -5461,11 +5470,11 @@ function logRooCodeMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
5461
5470
|
"[setup-ide-files] Fully quit Roo Code and reopen this repo for MCP changes to take effect."
|
|
5462
5471
|
);
|
|
5463
5472
|
}
|
|
5464
|
-
var fs19,
|
|
5473
|
+
var fs19, path25, import_node_crypto10, RooCodeMcpJsonParseError;
|
|
5465
5474
|
var init_rooCodeMcpConfig = __esm({
|
|
5466
5475
|
"src/rooCodeMcpConfig.ts"() {
|
|
5467
5476
|
fs19 = __toESM(require("fs/promises"), 1);
|
|
5468
|
-
|
|
5477
|
+
path25 = __toESM(require("path"), 1);
|
|
5469
5478
|
import_node_crypto10 = require("crypto");
|
|
5470
5479
|
init_configUtils();
|
|
5471
5480
|
init_cursorGlobalMcpConfig();
|
|
@@ -5498,10 +5507,10 @@ async function pathExists9(filePath) {
|
|
|
5498
5507
|
}
|
|
5499
5508
|
}
|
|
5500
5509
|
function getClineCliRootMcpConfigPath(homeDir) {
|
|
5501
|
-
return
|
|
5510
|
+
return path26.join(homeDir, ".cline", "mcp.json");
|
|
5502
5511
|
}
|
|
5503
5512
|
function getClineCliGlobalMcpConfigPath(homeDir) {
|
|
5504
|
-
return
|
|
5513
|
+
return path26.join(homeDir, ".cline", "data", "settings", "cline_mcp_settings.json");
|
|
5505
5514
|
}
|
|
5506
5515
|
function getClineCliMcpConfigPaths(homeDir) {
|
|
5507
5516
|
return {
|
|
@@ -5517,7 +5526,7 @@ function buildMemoraoneClineCliMcpServer(options) {
|
|
|
5517
5526
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
5518
5527
|
}),
|
|
5519
5528
|
MEMORAONE_IDE_TYPE: "cline-cli",
|
|
5520
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
5529
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path26.resolve(options.workspaceRoot)
|
|
5521
5530
|
};
|
|
5522
5531
|
if (environment === "local" || options.devMode) {
|
|
5523
5532
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -5544,11 +5553,11 @@ function mergeClineCliMcpConfigObject(existing, memoraone, ownership) {
|
|
|
5544
5553
|
};
|
|
5545
5554
|
}
|
|
5546
5555
|
async function writeClineCliMcpJsonAtomic(filePath, content) {
|
|
5547
|
-
const dir =
|
|
5556
|
+
const dir = path26.dirname(filePath);
|
|
5548
5557
|
await fs20.mkdir(dir, { recursive: true });
|
|
5549
|
-
const tmpPath =
|
|
5558
|
+
const tmpPath = path26.join(
|
|
5550
5559
|
dir,
|
|
5551
|
-
`.${
|
|
5560
|
+
`.${path26.basename(filePath)}.${process.pid}.${(0, import_node_crypto11.randomBytes)(8).toString("hex")}.tmp`
|
|
5552
5561
|
);
|
|
5553
5562
|
try {
|
|
5554
5563
|
await fs20.writeFile(tmpPath, content, "utf8");
|
|
@@ -5658,7 +5667,7 @@ async function setupClineCliMcpConfig(options) {
|
|
|
5658
5667
|
const defaults = getClineCliMcpConfigPaths(homeDir);
|
|
5659
5668
|
const rootConfigPath = options.rootConfigPath ?? defaults.rootConfigPath;
|
|
5660
5669
|
const settingsConfigPath = options.globalConfigPath ?? defaults.settingsConfigPath;
|
|
5661
|
-
const workspaceRoot =
|
|
5670
|
+
const workspaceRoot = path26.resolve(options.repoRoot);
|
|
5662
5671
|
const memoraone = await buildClineCliMemoraoneServer({
|
|
5663
5672
|
workspaceRoot,
|
|
5664
5673
|
devMode: options.devMode,
|
|
@@ -5743,12 +5752,12 @@ function logClineCliMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
5743
5752
|
"[setup-ide-files] Fully quit Cline CLI and reopen for MCP changes to take effect."
|
|
5744
5753
|
);
|
|
5745
5754
|
}
|
|
5746
|
-
var fs20, os7,
|
|
5755
|
+
var fs20, os7, path26, import_node_crypto11, CLINE_CLI_MCP_TIMEOUT_SECONDS, ClineCliMcpJsonParseError;
|
|
5747
5756
|
var init_clineCliMcpConfig = __esm({
|
|
5748
5757
|
"src/clineCliMcpConfig.ts"() {
|
|
5749
5758
|
fs20 = __toESM(require("fs/promises"), 1);
|
|
5750
5759
|
os7 = __toESM(require("os"), 1);
|
|
5751
|
-
|
|
5760
|
+
path26 = __toESM(require("path"), 1);
|
|
5752
5761
|
import_node_crypto11 = require("crypto");
|
|
5753
5762
|
init_configUtils();
|
|
5754
5763
|
init_cursorGlobalMcpConfig();
|
|
@@ -5782,7 +5791,7 @@ async function pathExists10(filePath) {
|
|
|
5782
5791
|
}
|
|
5783
5792
|
}
|
|
5784
5793
|
function getClaudeDesktopGlobalMcpConfigPath(homeDir) {
|
|
5785
|
-
return
|
|
5794
|
+
return path27.join(
|
|
5786
5795
|
homeDir,
|
|
5787
5796
|
"Library",
|
|
5788
5797
|
"Application Support",
|
|
@@ -5802,7 +5811,7 @@ function buildMemoraoneClaudeDesktopMcpServer(options) {
|
|
|
5802
5811
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
5803
5812
|
}),
|
|
5804
5813
|
MEMORAONE_IDE_TYPE: "claude-desktop",
|
|
5805
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
5814
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path27.resolve(options.workspaceRoot)
|
|
5806
5815
|
};
|
|
5807
5816
|
if (environment === "local" || options.devMode) {
|
|
5808
5817
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -5824,11 +5833,11 @@ function mergeClaudeDesktopMcpConfigObject(existing, memoraone, ownership) {
|
|
|
5824
5833
|
return { ...base, mcpServers: ownership ? replaceMemoraoneRepositoryBindingInServerMap(mcpServers, memoraone, ownership) : replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
5825
5834
|
}
|
|
5826
5835
|
async function writeClaudeDesktopMcpJsonAtomic(filePath, content) {
|
|
5827
|
-
const dir =
|
|
5836
|
+
const dir = path27.dirname(filePath);
|
|
5828
5837
|
await fs21.mkdir(dir, { recursive: true });
|
|
5829
|
-
const tmpPath =
|
|
5838
|
+
const tmpPath = path27.join(
|
|
5830
5839
|
dir,
|
|
5831
|
-
`.${
|
|
5840
|
+
`.${path27.basename(filePath)}.${process.pid}.${(0, import_node_crypto12.randomBytes)(8).toString("hex")}.tmp`
|
|
5832
5841
|
);
|
|
5833
5842
|
try {
|
|
5834
5843
|
await fs21.writeFile(tmpPath, content, "utf8");
|
|
@@ -5913,7 +5922,7 @@ async function buildClaudeDesktopMemoraoneServer(options) {
|
|
|
5913
5922
|
async function setupClaudeDesktopMcpConfig(options) {
|
|
5914
5923
|
const homeDir = options.homeDir ?? os8.homedir();
|
|
5915
5924
|
const activePath = options.globalConfigPath ?? getClaudeDesktopGlobalMcpConfigPath(homeDir);
|
|
5916
|
-
const workspaceRoot =
|
|
5925
|
+
const workspaceRoot = path27.resolve(options.repoRoot);
|
|
5917
5926
|
const memoraone = await buildClaudeDesktopMemoraoneServer({
|
|
5918
5927
|
workspaceRoot,
|
|
5919
5928
|
devMode: options.devMode,
|
|
@@ -5990,12 +5999,12 @@ function logClaudeDesktopMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
5990
5999
|
"[setup-ide-files] Fully quit Claude Desktop and reopen for MCP changes to take effect."
|
|
5991
6000
|
);
|
|
5992
6001
|
}
|
|
5993
|
-
var fs21, os8,
|
|
6002
|
+
var fs21, os8, path27, import_node_crypto12, ClaudeDesktopMcpJsonParseError;
|
|
5994
6003
|
var init_claudeDesktopMcpConfig = __esm({
|
|
5995
6004
|
"src/claudeDesktopMcpConfig.ts"() {
|
|
5996
6005
|
fs21 = __toESM(require("fs/promises"), 1);
|
|
5997
6006
|
os8 = __toESM(require("os"), 1);
|
|
5998
|
-
|
|
6007
|
+
path27 = __toESM(require("path"), 1);
|
|
5999
6008
|
import_node_crypto12 = require("crypto");
|
|
6000
6009
|
init_configUtils();
|
|
6001
6010
|
init_cursorGlobalMcpConfig();
|
|
@@ -6028,7 +6037,7 @@ async function pathExists11(filePath) {
|
|
|
6028
6037
|
}
|
|
6029
6038
|
}
|
|
6030
6039
|
function getZedProjectMcpConfigPath(repoRoot) {
|
|
6031
|
-
return
|
|
6040
|
+
return path28.join(path28.resolve(repoRoot), ".zed", "settings.json");
|
|
6032
6041
|
}
|
|
6033
6042
|
function buildMemoraoneZedMcpServer(options) {
|
|
6034
6043
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -6038,7 +6047,7 @@ function buildMemoraoneZedMcpServer(options) {
|
|
|
6038
6047
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
6039
6048
|
}),
|
|
6040
6049
|
MEMORAONE_IDE_TYPE: "zed",
|
|
6041
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
6050
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path28.resolve(options.workspaceRoot)
|
|
6042
6051
|
};
|
|
6043
6052
|
if (environment === "local" || options.devMode) {
|
|
6044
6053
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -6063,11 +6072,11 @@ function mergeZedMcpConfigObject(existing, memoraone) {
|
|
|
6063
6072
|
};
|
|
6064
6073
|
}
|
|
6065
6074
|
async function writeZedMcpJsonAtomic(filePath, content) {
|
|
6066
|
-
const dir =
|
|
6075
|
+
const dir = path28.dirname(filePath);
|
|
6067
6076
|
await fs22.mkdir(dir, { recursive: true });
|
|
6068
|
-
const tmpPath =
|
|
6077
|
+
const tmpPath = path28.join(
|
|
6069
6078
|
dir,
|
|
6070
|
-
`.${
|
|
6079
|
+
`.${path28.basename(filePath)}.${process.pid}.${(0, import_node_crypto13.randomBytes)(8).toString("hex")}.tmp`
|
|
6071
6080
|
);
|
|
6072
6081
|
try {
|
|
6073
6082
|
await fs22.writeFile(tmpPath, content, "utf8");
|
|
@@ -6145,7 +6154,7 @@ async function buildZedMemoraoneServer(options) {
|
|
|
6145
6154
|
}
|
|
6146
6155
|
async function setupZedMcpConfig(options) {
|
|
6147
6156
|
const projectPath = options.projectConfigPath ?? getZedProjectMcpConfigPath(options.repoRoot);
|
|
6148
|
-
const workspaceRoot =
|
|
6157
|
+
const workspaceRoot = path28.resolve(options.repoRoot);
|
|
6149
6158
|
const memoraone = await buildZedMemoraoneServer({
|
|
6150
6159
|
workspaceRoot,
|
|
6151
6160
|
devMode: options.devMode,
|
|
@@ -6208,11 +6217,11 @@ function logZedMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
6208
6217
|
"[setup-ide-files] Fully quit Zed and reopen this repo for MCP changes to take effect."
|
|
6209
6218
|
);
|
|
6210
6219
|
}
|
|
6211
|
-
var fs22,
|
|
6220
|
+
var fs22, path28, import_node_crypto13, ZedMcpJsonParseError;
|
|
6212
6221
|
var init_zedMcpConfig = __esm({
|
|
6213
6222
|
"src/zedMcpConfig.ts"() {
|
|
6214
6223
|
fs22 = __toESM(require("fs/promises"), 1);
|
|
6215
|
-
|
|
6224
|
+
path28 = __toESM(require("path"), 1);
|
|
6216
6225
|
import_node_crypto13 = require("crypto");
|
|
6217
6226
|
init_configUtils();
|
|
6218
6227
|
init_cursorGlobalMcpConfig();
|
|
@@ -6245,7 +6254,7 @@ async function pathExists12(filePath) {
|
|
|
6245
6254
|
}
|
|
6246
6255
|
}
|
|
6247
6256
|
function getVisualStudioProjectMcpConfigPath(repoRoot) {
|
|
6248
|
-
return
|
|
6257
|
+
return path29.join(path29.resolve(repoRoot), ".vs", "mcp.json");
|
|
6249
6258
|
}
|
|
6250
6259
|
function buildMemoraoneVisualStudioMcpServer(options) {
|
|
6251
6260
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -6255,7 +6264,7 @@ function buildMemoraoneVisualStudioMcpServer(options) {
|
|
|
6255
6264
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
6256
6265
|
}),
|
|
6257
6266
|
MEMORAONE_IDE_TYPE: "visual-studio",
|
|
6258
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
6267
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path29.resolve(options.workspaceRoot)
|
|
6259
6268
|
};
|
|
6260
6269
|
if (environment === "local" || options.devMode) {
|
|
6261
6270
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -6278,11 +6287,11 @@ function mergeVisualStudioMcpConfigObject(existing, memoraone) {
|
|
|
6278
6287
|
return { ...base, servers: replaceMemoraoneOwnedInServerMap(servers, memoraone) };
|
|
6279
6288
|
}
|
|
6280
6289
|
async function writeVisualStudioMcpJsonAtomic(filePath, content) {
|
|
6281
|
-
const dir =
|
|
6290
|
+
const dir = path29.dirname(filePath);
|
|
6282
6291
|
await fs23.mkdir(dir, { recursive: true });
|
|
6283
|
-
const tmpPath =
|
|
6292
|
+
const tmpPath = path29.join(
|
|
6284
6293
|
dir,
|
|
6285
|
-
`.${
|
|
6294
|
+
`.${path29.basename(filePath)}.${process.pid}.${(0, import_node_crypto14.randomBytes)(8).toString("hex")}.tmp`
|
|
6286
6295
|
);
|
|
6287
6296
|
try {
|
|
6288
6297
|
await fs23.writeFile(tmpPath, content, "utf8");
|
|
@@ -6360,7 +6369,7 @@ async function buildVisualStudioMemoraoneServer(options) {
|
|
|
6360
6369
|
}
|
|
6361
6370
|
async function setupVisualStudioMcpConfig(options) {
|
|
6362
6371
|
const projectPath = options.projectConfigPath ?? getVisualStudioProjectMcpConfigPath(options.repoRoot);
|
|
6363
|
-
const workspaceRoot =
|
|
6372
|
+
const workspaceRoot = path29.resolve(options.repoRoot);
|
|
6364
6373
|
const memoraone = await buildVisualStudioMemoraoneServer({
|
|
6365
6374
|
workspaceRoot,
|
|
6366
6375
|
devMode: options.devMode,
|
|
@@ -6425,11 +6434,11 @@ function logVisualStudioMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
6425
6434
|
"[setup-ide-files] Fully quit Visual Studio and reopen this repo for MCP changes to take effect."
|
|
6426
6435
|
);
|
|
6427
6436
|
}
|
|
6428
|
-
var fs23,
|
|
6437
|
+
var fs23, path29, import_node_crypto14, VisualStudioMcpJsonParseError;
|
|
6429
6438
|
var init_visualStudioMcpConfig = __esm({
|
|
6430
6439
|
"src/visualStudioMcpConfig.ts"() {
|
|
6431
6440
|
fs23 = __toESM(require("fs/promises"), 1);
|
|
6432
|
-
|
|
6441
|
+
path29 = __toESM(require("path"), 1);
|
|
6433
6442
|
import_node_crypto14 = require("crypto");
|
|
6434
6443
|
init_configUtils();
|
|
6435
6444
|
init_cursorGlobalMcpConfig();
|
|
@@ -6459,7 +6468,7 @@ async function pathExists13(filePath) {
|
|
|
6459
6468
|
}
|
|
6460
6469
|
}
|
|
6461
6470
|
function getContinueProjectMcpConfigPath(repoRoot) {
|
|
6462
|
-
return
|
|
6471
|
+
return path30.join(path30.resolve(repoRoot), ".continue", "mcpServers", "memoraone.yaml");
|
|
6463
6472
|
}
|
|
6464
6473
|
function buildMemoraoneContinueMcpServer(options) {
|
|
6465
6474
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -6469,7 +6478,7 @@ function buildMemoraoneContinueMcpServer(options) {
|
|
|
6469
6478
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
6470
6479
|
}),
|
|
6471
6480
|
MEMORAONE_IDE_TYPE: "continue",
|
|
6472
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
6481
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path30.resolve(options.workspaceRoot)
|
|
6473
6482
|
};
|
|
6474
6483
|
if (environment === "local" || options.devMode) {
|
|
6475
6484
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -6518,11 +6527,11 @@ function mergeContinueMcpConfigObject(existing, memoraone) {
|
|
|
6518
6527
|
return base;
|
|
6519
6528
|
}
|
|
6520
6529
|
async function writeContinueMcpYamlAtomic(filePath, content) {
|
|
6521
|
-
const dir =
|
|
6530
|
+
const dir = path30.dirname(filePath);
|
|
6522
6531
|
await fs24.mkdir(dir, { recursive: true });
|
|
6523
|
-
const tmpPath =
|
|
6532
|
+
const tmpPath = path30.join(
|
|
6524
6533
|
dir,
|
|
6525
|
-
`.${
|
|
6534
|
+
`.${path30.basename(filePath)}.${process.pid}.${(0, import_node_crypto15.randomBytes)(8).toString("hex")}.tmp`
|
|
6526
6535
|
);
|
|
6527
6536
|
try {
|
|
6528
6537
|
await fs24.writeFile(tmpPath, content, "utf8");
|
|
@@ -6610,7 +6619,7 @@ async function buildContinueMemoraoneServer(options) {
|
|
|
6610
6619
|
}
|
|
6611
6620
|
async function setupContinueMcpConfig(options) {
|
|
6612
6621
|
const projectPath = options.projectConfigPath ?? getContinueProjectMcpConfigPath(options.repoRoot);
|
|
6613
|
-
const workspaceRoot =
|
|
6622
|
+
const workspaceRoot = path30.resolve(options.repoRoot);
|
|
6614
6623
|
const memoraone = await buildContinueMemoraoneServer({
|
|
6615
6624
|
workspaceRoot,
|
|
6616
6625
|
devMode: options.devMode,
|
|
@@ -6683,11 +6692,11 @@ function logContinueMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
6683
6692
|
"[setup-ide-files] Fully quit Continue and reopen this repo for MCP changes to take effect."
|
|
6684
6693
|
);
|
|
6685
6694
|
}
|
|
6686
|
-
var fs24,
|
|
6695
|
+
var fs24, path30, import_node_crypto15, import_yaml, ContinueMcpYamlParseError;
|
|
6687
6696
|
var init_continueMcpConfig = __esm({
|
|
6688
6697
|
"src/continueMcpConfig.ts"() {
|
|
6689
6698
|
fs24 = __toESM(require("fs/promises"), 1);
|
|
6690
|
-
|
|
6699
|
+
path30 = __toESM(require("path"), 1);
|
|
6691
6700
|
import_node_crypto15 = require("crypto");
|
|
6692
6701
|
import_yaml = require("yaml");
|
|
6693
6702
|
init_configUtils();
|
|
@@ -6721,7 +6730,7 @@ async function pathExists14(filePath) {
|
|
|
6721
6730
|
}
|
|
6722
6731
|
}
|
|
6723
6732
|
function getClineProjectMcpConfigPath(repoRoot) {
|
|
6724
|
-
return
|
|
6733
|
+
return path31.join(path31.resolve(repoRoot), ".cline", "mcp.json");
|
|
6725
6734
|
}
|
|
6726
6735
|
function formatClineBackupTimestamp(d = /* @__PURE__ */ new Date()) {
|
|
6727
6736
|
const pad = (n) => String(n).padStart(2, "0");
|
|
@@ -6735,7 +6744,7 @@ function buildMemoraoneClineMcpServer(options) {
|
|
|
6735
6744
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
6736
6745
|
}),
|
|
6737
6746
|
MEMORAONE_IDE_TYPE: "cline",
|
|
6738
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
6747
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path31.resolve(options.workspaceRoot)
|
|
6739
6748
|
};
|
|
6740
6749
|
if (environment === "local" || options.devMode) env2.MEMORAONE_DEV_MODE = "1";
|
|
6741
6750
|
return { command: options.command, args: options.args, env: env2 };
|
|
@@ -6746,11 +6755,11 @@ function mergeClineMcpConfigObject(existing, memoraone) {
|
|
|
6746
6755
|
return { ...base, mcpServers: replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
6747
6756
|
}
|
|
6748
6757
|
async function writeClineMcpJsonAtomic(filePath, content) {
|
|
6749
|
-
const dir =
|
|
6758
|
+
const dir = path31.dirname(filePath);
|
|
6750
6759
|
await fs25.mkdir(dir, { recursive: true });
|
|
6751
|
-
const tmpPath =
|
|
6760
|
+
const tmpPath = path31.join(
|
|
6752
6761
|
dir,
|
|
6753
|
-
`.${
|
|
6762
|
+
`.${path31.basename(filePath)}.${process.pid}.${(0, import_node_crypto16.randomBytes)(8).toString("hex")}.tmp`
|
|
6754
6763
|
);
|
|
6755
6764
|
try {
|
|
6756
6765
|
await fs25.writeFile(tmpPath, content, "utf8");
|
|
@@ -6821,7 +6830,7 @@ async function buildClineMemoraoneServer(options) {
|
|
|
6821
6830
|
});
|
|
6822
6831
|
}
|
|
6823
6832
|
async function setupClineMcpConfig(options) {
|
|
6824
|
-
const workspaceRoot =
|
|
6833
|
+
const workspaceRoot = path31.resolve(options.repoRoot);
|
|
6825
6834
|
const configPath = options.projectConfigPath ?? getClineProjectMcpConfigPath(workspaceRoot);
|
|
6826
6835
|
const memoraone = await buildClineMemoraoneServer({
|
|
6827
6836
|
workspaceRoot,
|
|
@@ -6868,12 +6877,12 @@ function logClineMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
6868
6877
|
if (info.npxPath) println(`[setup-ide-files] Resolved npx: ${info.npxPath}`);
|
|
6869
6878
|
println("[setup-ide-files] Fully quit Cline and reopen this repository for MCP changes to take effect.");
|
|
6870
6879
|
}
|
|
6871
|
-
var import_node_crypto16, fs25,
|
|
6880
|
+
var import_node_crypto16, fs25, path31, ClineMcpJsonParseError;
|
|
6872
6881
|
var init_clineMcpConfig = __esm({
|
|
6873
6882
|
"src/clineMcpConfig.ts"() {
|
|
6874
6883
|
import_node_crypto16 = require("crypto");
|
|
6875
6884
|
fs25 = __toESM(require("fs/promises"), 1);
|
|
6876
|
-
|
|
6885
|
+
path31 = __toESM(require("path"), 1);
|
|
6877
6886
|
init_configUtils();
|
|
6878
6887
|
init_cursorGlobalMcpConfig();
|
|
6879
6888
|
init_initializeBinding();
|
|
@@ -6905,7 +6914,7 @@ async function pathExists15(filePath) {
|
|
|
6905
6914
|
}
|
|
6906
6915
|
}
|
|
6907
6916
|
function getCopilotCliProjectMcpConfigPath(repoRoot) {
|
|
6908
|
-
return
|
|
6917
|
+
return path32.join(path32.resolve(repoRoot), ".github", "mcp.json");
|
|
6909
6918
|
}
|
|
6910
6919
|
function buildMemoraoneCopilotCliMcpServer(options) {
|
|
6911
6920
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -6915,7 +6924,7 @@ function buildMemoraoneCopilotCliMcpServer(options) {
|
|
|
6915
6924
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
6916
6925
|
}),
|
|
6917
6926
|
MEMORAONE_IDE_TYPE: "copilot-cli",
|
|
6918
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
6927
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path32.resolve(options.workspaceRoot)
|
|
6919
6928
|
};
|
|
6920
6929
|
if (environment === "local" || options.devMode) {
|
|
6921
6930
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -6938,11 +6947,11 @@ function mergeCopilotCliMcpConfigObject(existing, memoraone) {
|
|
|
6938
6947
|
return { ...base, mcpServers: replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
6939
6948
|
}
|
|
6940
6949
|
async function writeCopilotCliMcpJsonAtomic(filePath, content) {
|
|
6941
|
-
const dir =
|
|
6950
|
+
const dir = path32.dirname(filePath);
|
|
6942
6951
|
await fs26.mkdir(dir, { recursive: true });
|
|
6943
|
-
const tmpPath =
|
|
6952
|
+
const tmpPath = path32.join(
|
|
6944
6953
|
dir,
|
|
6945
|
-
`.${
|
|
6954
|
+
`.${path32.basename(filePath)}.${process.pid}.${(0, import_node_crypto17.randomBytes)(8).toString("hex")}.tmp`
|
|
6946
6955
|
);
|
|
6947
6956
|
try {
|
|
6948
6957
|
await fs26.writeFile(tmpPath, content, "utf8");
|
|
@@ -7020,7 +7029,7 @@ async function buildCopilotCliMemoraoneServer(options) {
|
|
|
7020
7029
|
}
|
|
7021
7030
|
async function setupCopilotCliMcpConfig(options) {
|
|
7022
7031
|
const projectPath = options.projectConfigPath ?? getCopilotCliProjectMcpConfigPath(options.repoRoot);
|
|
7023
|
-
const workspaceRoot =
|
|
7032
|
+
const workspaceRoot = path32.resolve(options.repoRoot);
|
|
7024
7033
|
const memoraone = await buildCopilotCliMemoraoneServer({
|
|
7025
7034
|
workspaceRoot,
|
|
7026
7035
|
devMode: options.devMode,
|
|
@@ -7085,11 +7094,11 @@ function logCopilotCliMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
7085
7094
|
"[setup-ide-files] Fully quit Copilot CLI and reopen this repo for MCP changes to take effect."
|
|
7086
7095
|
);
|
|
7087
7096
|
}
|
|
7088
|
-
var fs26,
|
|
7097
|
+
var fs26, path32, import_node_crypto17, CopilotCliMcpJsonParseError;
|
|
7089
7098
|
var init_copilotCliMcpConfig = __esm({
|
|
7090
7099
|
"src/copilotCliMcpConfig.ts"() {
|
|
7091
7100
|
fs26 = __toESM(require("fs/promises"), 1);
|
|
7092
|
-
|
|
7101
|
+
path32 = __toESM(require("path"), 1);
|
|
7093
7102
|
import_node_crypto17 = require("crypto");
|
|
7094
7103
|
init_configUtils();
|
|
7095
7104
|
init_cursorGlobalMcpConfig();
|
|
@@ -7122,7 +7131,7 @@ async function pathExists16(filePath) {
|
|
|
7122
7131
|
}
|
|
7123
7132
|
}
|
|
7124
7133
|
function getAuggieProjectMcpConfigPath(repoRoot) {
|
|
7125
|
-
return
|
|
7134
|
+
return path33.join(path33.resolve(repoRoot), ".augment", "settings.json");
|
|
7126
7135
|
}
|
|
7127
7136
|
function buildMemoraoneAuggieMcpServer(options) {
|
|
7128
7137
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -7132,7 +7141,7 @@ function buildMemoraoneAuggieMcpServer(options) {
|
|
|
7132
7141
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
7133
7142
|
}),
|
|
7134
7143
|
MEMORAONE_IDE_TYPE: "auggie",
|
|
7135
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
7144
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path33.resolve(options.workspaceRoot)
|
|
7136
7145
|
};
|
|
7137
7146
|
if (environment === "local" || options.devMode) {
|
|
7138
7147
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -7154,11 +7163,11 @@ function mergeAuggieMcpConfigObject(existing, memoraone) {
|
|
|
7154
7163
|
return { ...base, mcpServers: replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
7155
7164
|
}
|
|
7156
7165
|
async function writeAuggieMcpJsonAtomic(filePath, content) {
|
|
7157
|
-
const dir =
|
|
7166
|
+
const dir = path33.dirname(filePath);
|
|
7158
7167
|
await fs27.mkdir(dir, { recursive: true });
|
|
7159
|
-
const tmpPath =
|
|
7168
|
+
const tmpPath = path33.join(
|
|
7160
7169
|
dir,
|
|
7161
|
-
`.${
|
|
7170
|
+
`.${path33.basename(filePath)}.${process.pid}.${(0, import_node_crypto18.randomBytes)(8).toString("hex")}.tmp`
|
|
7162
7171
|
);
|
|
7163
7172
|
try {
|
|
7164
7173
|
await fs27.writeFile(tmpPath, content, "utf8");
|
|
@@ -7236,7 +7245,7 @@ async function buildAuggieMemoraoneServer(options) {
|
|
|
7236
7245
|
}
|
|
7237
7246
|
async function setupAuggieMcpConfig(options) {
|
|
7238
7247
|
const projectPath = options.projectConfigPath ?? getAuggieProjectMcpConfigPath(options.repoRoot);
|
|
7239
|
-
const workspaceRoot =
|
|
7248
|
+
const workspaceRoot = path33.resolve(options.repoRoot);
|
|
7240
7249
|
const memoraone = await buildAuggieMemoraoneServer({
|
|
7241
7250
|
workspaceRoot,
|
|
7242
7251
|
devMode: options.devMode,
|
|
@@ -7301,11 +7310,11 @@ function logAuggieMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
7301
7310
|
"[setup-ide-files] Fully quit Augment Code / Auggie and reopen this repo for MCP changes to take effect."
|
|
7302
7311
|
);
|
|
7303
7312
|
}
|
|
7304
|
-
var fs27,
|
|
7313
|
+
var fs27, path33, import_node_crypto18, AuggieMcpJsonParseError;
|
|
7305
7314
|
var init_auggieMcpConfig = __esm({
|
|
7306
7315
|
"src/auggieMcpConfig.ts"() {
|
|
7307
7316
|
fs27 = __toESM(require("fs/promises"), 1);
|
|
7308
|
-
|
|
7317
|
+
path33 = __toESM(require("path"), 1);
|
|
7309
7318
|
import_node_crypto18 = require("crypto");
|
|
7310
7319
|
init_configUtils();
|
|
7311
7320
|
init_cursorGlobalMcpConfig();
|
|
@@ -7338,7 +7347,7 @@ async function pathExists17(filePath) {
|
|
|
7338
7347
|
}
|
|
7339
7348
|
}
|
|
7340
7349
|
function getGeminiCliProjectMcpConfigPath(repoRoot) {
|
|
7341
|
-
return
|
|
7350
|
+
return path34.join(path34.resolve(repoRoot), ".gemini", "settings.json");
|
|
7342
7351
|
}
|
|
7343
7352
|
function buildMemoraoneGeminiCliMcpServer(options) {
|
|
7344
7353
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -7348,7 +7357,7 @@ function buildMemoraoneGeminiCliMcpServer(options) {
|
|
|
7348
7357
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
7349
7358
|
}),
|
|
7350
7359
|
MEMORAONE_IDE_TYPE: "gemini-cli",
|
|
7351
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
7360
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path34.resolve(options.workspaceRoot)
|
|
7352
7361
|
};
|
|
7353
7362
|
if (environment === "local" || options.devMode) {
|
|
7354
7363
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -7370,11 +7379,11 @@ function mergeGeminiCliMcpConfigObject(existing, memoraone) {
|
|
|
7370
7379
|
return { ...base, mcpServers: replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
7371
7380
|
}
|
|
7372
7381
|
async function writeGeminiCliMcpJsonAtomic(filePath, content) {
|
|
7373
|
-
const dir =
|
|
7382
|
+
const dir = path34.dirname(filePath);
|
|
7374
7383
|
await fs28.mkdir(dir, { recursive: true });
|
|
7375
|
-
const tmpPath =
|
|
7384
|
+
const tmpPath = path34.join(
|
|
7376
7385
|
dir,
|
|
7377
|
-
`.${
|
|
7386
|
+
`.${path34.basename(filePath)}.${process.pid}.${(0, import_node_crypto19.randomBytes)(8).toString("hex")}.tmp`
|
|
7378
7387
|
);
|
|
7379
7388
|
try {
|
|
7380
7389
|
await fs28.writeFile(tmpPath, content, "utf8");
|
|
@@ -7452,7 +7461,7 @@ async function buildGeminiCliMemoraoneServer(options) {
|
|
|
7452
7461
|
}
|
|
7453
7462
|
async function setupGeminiCliMcpConfig(options) {
|
|
7454
7463
|
const projectPath = options.projectConfigPath ?? getGeminiCliProjectMcpConfigPath(options.repoRoot);
|
|
7455
|
-
const workspaceRoot =
|
|
7464
|
+
const workspaceRoot = path34.resolve(options.repoRoot);
|
|
7456
7465
|
const memoraone = await buildGeminiCliMemoraoneServer({
|
|
7457
7466
|
workspaceRoot,
|
|
7458
7467
|
devMode: options.devMode,
|
|
@@ -7517,11 +7526,11 @@ function logGeminiCliMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
7517
7526
|
"[setup-ide-files] Fully quit Gemini CLI and reopen this repo for MCP changes to take effect."
|
|
7518
7527
|
);
|
|
7519
7528
|
}
|
|
7520
|
-
var fs28,
|
|
7529
|
+
var fs28, path34, import_node_crypto19, GeminiCliMcpJsonParseError;
|
|
7521
7530
|
var init_geminiCliMcpConfig = __esm({
|
|
7522
7531
|
"src/geminiCliMcpConfig.ts"() {
|
|
7523
7532
|
fs28 = __toESM(require("fs/promises"), 1);
|
|
7524
|
-
|
|
7533
|
+
path34 = __toESM(require("path"), 1);
|
|
7525
7534
|
import_node_crypto19 = require("crypto");
|
|
7526
7535
|
init_configUtils();
|
|
7527
7536
|
init_cursorGlobalMcpConfig();
|
|
@@ -7554,14 +7563,14 @@ async function pathExists18(filePath) {
|
|
|
7554
7563
|
}
|
|
7555
7564
|
}
|
|
7556
7565
|
function getAntigravityUnifiedMcpConfigPath(homeDir) {
|
|
7557
|
-
return
|
|
7566
|
+
return path35.join(homeDir, ".gemini", "config", "mcp_config.json");
|
|
7558
7567
|
}
|
|
7559
7568
|
function getAntigravityLegacyMcpConfigPath(homeDir) {
|
|
7560
|
-
return
|
|
7569
|
+
return path35.join(homeDir, ".gemini", "antigravity", "mcp_config.json");
|
|
7561
7570
|
}
|
|
7562
7571
|
function getAntigravityGlobalMcpConfigPath(homeDir) {
|
|
7563
7572
|
const unified = getAntigravityUnifiedMcpConfigPath(homeDir);
|
|
7564
|
-
const migratedMarker =
|
|
7573
|
+
const migratedMarker = path35.join(homeDir, ".gemini", "config", ".migrated");
|
|
7565
7574
|
if (fsSync.existsSync(migratedMarker) || fsSync.existsSync(unified)) {
|
|
7566
7575
|
return unified;
|
|
7567
7576
|
}
|
|
@@ -7575,7 +7584,7 @@ function buildMemoraoneAntigravityMcpServer(options) {
|
|
|
7575
7584
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
7576
7585
|
}),
|
|
7577
7586
|
MEMORAONE_IDE_TYPE: "antigravity",
|
|
7578
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
7587
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path35.resolve(options.workspaceRoot)
|
|
7579
7588
|
};
|
|
7580
7589
|
if (environment === "local" || options.devMode) {
|
|
7581
7590
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -7610,11 +7619,11 @@ function stripMemoraoneFromAntigravityConfigObject(existing) {
|
|
|
7610
7619
|
return { next: { ...base, mcpServers }, removed: true };
|
|
7611
7620
|
}
|
|
7612
7621
|
async function writeAntigravityMcpJsonAtomic(filePath, content) {
|
|
7613
|
-
const dir =
|
|
7622
|
+
const dir = path35.dirname(filePath);
|
|
7614
7623
|
await fs29.mkdir(dir, { recursive: true });
|
|
7615
|
-
const tmpPath =
|
|
7624
|
+
const tmpPath = path35.join(
|
|
7616
7625
|
dir,
|
|
7617
|
-
`.${
|
|
7626
|
+
`.${path35.basename(filePath)}.${process.pid}.${(0, import_node_crypto20.randomBytes)(8).toString("hex")}.tmp`
|
|
7618
7627
|
);
|
|
7619
7628
|
try {
|
|
7620
7629
|
await fs29.writeFile(tmpPath, content, "utf8");
|
|
@@ -7702,8 +7711,8 @@ async function setupAntigravityMcpConfig(options) {
|
|
|
7702
7711
|
const activePath = options.globalConfigPath ?? getAntigravityGlobalMcpConfigPath(homeDir);
|
|
7703
7712
|
const legacyPath = options.legacyConfigPath ?? getAntigravityLegacyMcpConfigPath(homeDir);
|
|
7704
7713
|
const unifiedPath = getAntigravityUnifiedMcpConfigPath(homeDir);
|
|
7705
|
-
const writingUnified =
|
|
7706
|
-
const workspaceRoot =
|
|
7714
|
+
const writingUnified = path35.resolve(activePath) === path35.resolve(unifiedPath) && path35.resolve(activePath) !== path35.resolve(legacyPath);
|
|
7715
|
+
const workspaceRoot = path35.resolve(options.repoRoot);
|
|
7707
7716
|
const memoraone = await buildAntigravityMemoraoneServer({
|
|
7708
7717
|
workspaceRoot,
|
|
7709
7718
|
devMode: options.devMode,
|
|
@@ -7888,13 +7897,13 @@ function logAntigravityMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
7888
7897
|
"[setup-ide-files] Fully quit Antigravity and reopen for MCP changes to take effect."
|
|
7889
7898
|
);
|
|
7890
7899
|
}
|
|
7891
|
-
var fsSync, fs29, os9,
|
|
7900
|
+
var fsSync, fs29, os9, path35, import_node_crypto20, AntigravityMcpJsonParseError;
|
|
7892
7901
|
var init_antigravityMcpConfig = __esm({
|
|
7893
7902
|
"src/antigravityMcpConfig.ts"() {
|
|
7894
7903
|
fsSync = __toESM(require("fs"), 1);
|
|
7895
7904
|
fs29 = __toESM(require("fs/promises"), 1);
|
|
7896
7905
|
os9 = __toESM(require("os"), 1);
|
|
7897
|
-
|
|
7906
|
+
path35 = __toESM(require("path"), 1);
|
|
7898
7907
|
import_node_crypto20 = require("crypto");
|
|
7899
7908
|
init_configUtils();
|
|
7900
7909
|
init_cursorGlobalMcpConfig();
|
|
@@ -7927,7 +7936,7 @@ function isPlainObject2(value) {
|
|
|
7927
7936
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7928
7937
|
}
|
|
7929
7938
|
function getGooseGlobalMcpConfigPath(homeDir) {
|
|
7930
|
-
return
|
|
7939
|
+
return path36.join(homeDir, ".config", "goose", "config.yaml");
|
|
7931
7940
|
}
|
|
7932
7941
|
function isMemoraoneOwnedGooseExtension(key, entry) {
|
|
7933
7942
|
if (isMemoraoneOwnedServerName(key)) return true;
|
|
@@ -7979,10 +7988,10 @@ function replaceMemoraoneRepositoryBindingInGooseExtensions(extensions, canonica
|
|
|
7979
7988
|
const generatedTargetKey = memoraoneServerNameForRepositoryBinding(
|
|
7980
7989
|
ownership.repositoryBindingId
|
|
7981
7990
|
);
|
|
7982
|
-
const targetRoot =
|
|
7991
|
+
const targetRoot = path36.resolve(ownership.workspaceRoot);
|
|
7983
7992
|
const matchingRootKeys = Object.entries(extensions).filter(([key, value]) => {
|
|
7984
7993
|
const envs = isPlainObject2(value) && isPlainObject2(value.envs) ? value.envs : void 0;
|
|
7985
|
-
return key.startsWith("memoraone-") && typeof envs?.MEMORAONE_WORKSPACE_ROOT === "string" &&
|
|
7994
|
+
return key.startsWith("memoraone-") && typeof envs?.MEMORAONE_WORKSPACE_ROOT === "string" && path36.resolve(envs.MEMORAONE_WORKSPACE_ROOT) === targetRoot;
|
|
7986
7995
|
}).map(([key]) => key).sort();
|
|
7987
7996
|
const targetKey = matchingRootKeys.includes(generatedTargetKey) ? generatedTargetKey : matchingRootKeys[0] ?? generatedTargetKey;
|
|
7988
7997
|
const staleKeys = /* @__PURE__ */ new Set([
|
|
@@ -7995,7 +8004,7 @@ function replaceMemoraoneRepositoryBindingInGooseExtensions(extensions, canonica
|
|
|
7995
8004
|
const next = {};
|
|
7996
8005
|
for (const [key, value] of Object.entries(extensions)) {
|
|
7997
8006
|
const envs = isPlainObject2(value) && isPlainObject2(value.envs) ? value.envs : void 0;
|
|
7998
|
-
const legacyForRoot = isMemoraoneOwnedServerName(key) && !key.startsWith("memoraone-") && typeof envs?.MEMORAONE_WORKSPACE_ROOT === "string" &&
|
|
8007
|
+
const legacyForRoot = isMemoraoneOwnedServerName(key) && !key.startsWith("memoraone-") && typeof envs?.MEMORAONE_WORKSPACE_ROOT === "string" && path36.resolve(envs.MEMORAONE_WORKSPACE_ROOT) === targetRoot;
|
|
7999
8008
|
if (!staleKeys.has(key) && !matchingRootKeys.includes(key) && !legacyForRoot) {
|
|
8000
8009
|
next[key] = value;
|
|
8001
8010
|
}
|
|
@@ -8011,7 +8020,7 @@ function buildMemoraoneGooseMcpServer(options) {
|
|
|
8011
8020
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
8012
8021
|
}),
|
|
8013
8022
|
MEMORAONE_IDE_TYPE: "goose",
|
|
8014
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
8023
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path36.resolve(options.workspaceRoot)
|
|
8015
8024
|
};
|
|
8016
8025
|
if (environment === "local" || options.devMode) {
|
|
8017
8026
|
envs.MEMORAONE_DEV_MODE = "1";
|
|
@@ -8040,11 +8049,11 @@ function mergeGooseMcpConfigObject(existing, memoraone, ownership) {
|
|
|
8040
8049
|
};
|
|
8041
8050
|
}
|
|
8042
8051
|
async function writeGooseMcpYamlAtomic(filePath, content) {
|
|
8043
|
-
const dir =
|
|
8052
|
+
const dir = path36.dirname(filePath);
|
|
8044
8053
|
await fs30.mkdir(dir, { recursive: true });
|
|
8045
|
-
const tmpPath =
|
|
8054
|
+
const tmpPath = path36.join(
|
|
8046
8055
|
dir,
|
|
8047
|
-
`.${
|
|
8056
|
+
`.${path36.basename(filePath)}.${process.pid}.${(0, import_node_crypto21.randomBytes)(8).toString("hex")}.tmp`
|
|
8048
8057
|
);
|
|
8049
8058
|
try {
|
|
8050
8059
|
await fs30.writeFile(tmpPath, content, "utf8");
|
|
@@ -8133,7 +8142,7 @@ async function buildGooseMemoraoneServer(options) {
|
|
|
8133
8142
|
async function setupGooseMcpConfig(options) {
|
|
8134
8143
|
const homeDir = options.homeDir ?? os10.homedir();
|
|
8135
8144
|
const activePath = options.globalConfigPath ?? getGooseGlobalMcpConfigPath(homeDir);
|
|
8136
|
-
const workspaceRoot =
|
|
8145
|
+
const workspaceRoot = path36.resolve(options.repoRoot);
|
|
8137
8146
|
const memoraone = await buildGooseMemoraoneServer({
|
|
8138
8147
|
workspaceRoot,
|
|
8139
8148
|
devMode: options.devMode,
|
|
@@ -8207,12 +8216,12 @@ function logGooseMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
8207
8216
|
"[setup-ide-files] Fully quit Goose and reopen for MCP changes to take effect."
|
|
8208
8217
|
);
|
|
8209
8218
|
}
|
|
8210
|
-
var fs30, os10,
|
|
8219
|
+
var fs30, os10, path36, import_node_crypto21, import_yaml2, GooseMcpYamlParseError, MEMORAONE_PACKAGE_SPEC_RE2;
|
|
8211
8220
|
var init_gooseMcpConfig = __esm({
|
|
8212
8221
|
"src/gooseMcpConfig.ts"() {
|
|
8213
8222
|
fs30 = __toESM(require("fs/promises"), 1);
|
|
8214
8223
|
os10 = __toESM(require("os"), 1);
|
|
8215
|
-
|
|
8224
|
+
path36 = __toESM(require("path"), 1);
|
|
8216
8225
|
import_node_crypto21 = require("crypto");
|
|
8217
8226
|
import_yaml2 = require("yaml");
|
|
8218
8227
|
init_configUtils();
|
|
@@ -8247,7 +8256,7 @@ async function pathExists20(filePath) {
|
|
|
8247
8256
|
}
|
|
8248
8257
|
}
|
|
8249
8258
|
function getJunieProjectMcpConfigPath(repoRoot) {
|
|
8250
|
-
return
|
|
8259
|
+
return path37.join(path37.resolve(repoRoot), ".junie", "mcp", "mcp.json");
|
|
8251
8260
|
}
|
|
8252
8261
|
function buildMemoraoneJunieMcpServer(options) {
|
|
8253
8262
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -8257,7 +8266,7 @@ function buildMemoraoneJunieMcpServer(options) {
|
|
|
8257
8266
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
8258
8267
|
}),
|
|
8259
8268
|
MEMORAONE_IDE_TYPE: "junie",
|
|
8260
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
8269
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path37.resolve(options.workspaceRoot)
|
|
8261
8270
|
};
|
|
8262
8271
|
if (environment === "local" || options.devMode) {
|
|
8263
8272
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -8279,11 +8288,11 @@ function mergeJunieMcpConfigObject(existing, memoraone) {
|
|
|
8279
8288
|
return { ...base, mcpServers: replaceMemoraoneOwnedInServerMap(mcpServers, memoraone) };
|
|
8280
8289
|
}
|
|
8281
8290
|
async function writeJunieMcpJsonAtomic(filePath, content) {
|
|
8282
|
-
const dir =
|
|
8291
|
+
const dir = path37.dirname(filePath);
|
|
8283
8292
|
await fs31.mkdir(dir, { recursive: true });
|
|
8284
|
-
const tmpPath =
|
|
8293
|
+
const tmpPath = path37.join(
|
|
8285
8294
|
dir,
|
|
8286
|
-
`.${
|
|
8295
|
+
`.${path37.basename(filePath)}.${process.pid}.${(0, import_node_crypto22.randomBytes)(8).toString("hex")}.tmp`
|
|
8287
8296
|
);
|
|
8288
8297
|
try {
|
|
8289
8298
|
await fs31.writeFile(tmpPath, content, "utf8");
|
|
@@ -8361,7 +8370,7 @@ async function buildJunieMemoraoneServer(options) {
|
|
|
8361
8370
|
}
|
|
8362
8371
|
async function setupJunieMcpConfig(options) {
|
|
8363
8372
|
const projectPath = options.projectConfigPath ?? getJunieProjectMcpConfigPath(options.repoRoot);
|
|
8364
|
-
const workspaceRoot =
|
|
8373
|
+
const workspaceRoot = path37.resolve(options.repoRoot);
|
|
8365
8374
|
const memoraone = await buildJunieMemoraoneServer({
|
|
8366
8375
|
workspaceRoot,
|
|
8367
8376
|
devMode: options.devMode,
|
|
@@ -8426,11 +8435,11 @@ function logJunieMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
8426
8435
|
"[setup-ide-files] Fully quit JetBrains IDE / Junie and reopen this repo for MCP changes to take effect."
|
|
8427
8436
|
);
|
|
8428
8437
|
}
|
|
8429
|
-
var fs31,
|
|
8438
|
+
var fs31, path37, import_node_crypto22, JunieMcpJsonParseError;
|
|
8430
8439
|
var init_junieMcpConfig = __esm({
|
|
8431
8440
|
"src/junieMcpConfig.ts"() {
|
|
8432
8441
|
fs31 = __toESM(require("fs/promises"), 1);
|
|
8433
|
-
|
|
8442
|
+
path37 = __toESM(require("path"), 1);
|
|
8434
8443
|
import_node_crypto22 = require("crypto");
|
|
8435
8444
|
init_configUtils();
|
|
8436
8445
|
init_cursorGlobalMcpConfig();
|
|
@@ -8463,7 +8472,7 @@ async function pathExists21(filePath) {
|
|
|
8463
8472
|
}
|
|
8464
8473
|
}
|
|
8465
8474
|
function getXcodeGlobalMcpConfigPath(homeDir) {
|
|
8466
|
-
return
|
|
8475
|
+
return path38.join(homeDir, ".config", "github-copilot", "xcode", "mcp.json");
|
|
8467
8476
|
}
|
|
8468
8477
|
function buildMemoraoneXcodeMcpServer(options) {
|
|
8469
8478
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -8473,7 +8482,7 @@ function buildMemoraoneXcodeMcpServer(options) {
|
|
|
8473
8482
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
8474
8483
|
}),
|
|
8475
8484
|
MEMORAONE_IDE_TYPE: "xcode",
|
|
8476
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
8485
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path38.resolve(options.workspaceRoot)
|
|
8477
8486
|
};
|
|
8478
8487
|
if (environment === "local" || options.devMode) {
|
|
8479
8488
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -8496,11 +8505,11 @@ function mergeXcodeMcpConfigObject(existing, memoraone, ownership) {
|
|
|
8496
8505
|
return { ...base, servers: ownership ? replaceMemoraoneRepositoryBindingInServerMap(servers, memoraone, ownership) : replaceMemoraoneOwnedInServerMap(servers, memoraone) };
|
|
8497
8506
|
}
|
|
8498
8507
|
async function writeXcodeMcpJsonAtomic(filePath, content) {
|
|
8499
|
-
const dir =
|
|
8508
|
+
const dir = path38.dirname(filePath);
|
|
8500
8509
|
await fs32.mkdir(dir, { recursive: true });
|
|
8501
|
-
const tmpPath =
|
|
8510
|
+
const tmpPath = path38.join(
|
|
8502
8511
|
dir,
|
|
8503
|
-
`.${
|
|
8512
|
+
`.${path38.basename(filePath)}.${process.pid}.${(0, import_node_crypto23.randomBytes)(8).toString("hex")}.tmp`
|
|
8504
8513
|
);
|
|
8505
8514
|
try {
|
|
8506
8515
|
await fs32.writeFile(tmpPath, content, "utf8");
|
|
@@ -8580,7 +8589,7 @@ async function buildXcodeMemoraoneServer(options) {
|
|
|
8580
8589
|
async function setupXcodeMcpConfig(options) {
|
|
8581
8590
|
const homeDir = options.homeDir ?? os11.homedir();
|
|
8582
8591
|
const activePath = options.globalConfigPath ?? getXcodeGlobalMcpConfigPath(homeDir);
|
|
8583
|
-
const workspaceRoot =
|
|
8592
|
+
const workspaceRoot = path38.resolve(options.repoRoot);
|
|
8584
8593
|
const memoraone = await buildXcodeMemoraoneServer({
|
|
8585
8594
|
workspaceRoot,
|
|
8586
8595
|
devMode: options.devMode,
|
|
@@ -8647,12 +8656,12 @@ function logXcodeMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
8647
8656
|
"[setup-ide-files] Fully quit Xcode / Copilot for Xcode and reopen for MCP changes to take effect."
|
|
8648
8657
|
);
|
|
8649
8658
|
}
|
|
8650
|
-
var fs32, os11,
|
|
8659
|
+
var fs32, os11, path38, import_node_crypto23, XcodeMcpJsonParseError;
|
|
8651
8660
|
var init_xcodeMcpConfig = __esm({
|
|
8652
8661
|
"src/xcodeMcpConfig.ts"() {
|
|
8653
8662
|
fs32 = __toESM(require("fs/promises"), 1);
|
|
8654
8663
|
os11 = __toESM(require("os"), 1);
|
|
8655
|
-
|
|
8664
|
+
path38 = __toESM(require("path"), 1);
|
|
8656
8665
|
import_node_crypto23 = require("crypto");
|
|
8657
8666
|
init_configUtils();
|
|
8658
8667
|
init_cursorGlobalMcpConfig();
|
|
@@ -8685,7 +8694,7 @@ async function pathExists22(filePath) {
|
|
|
8685
8694
|
}
|
|
8686
8695
|
}
|
|
8687
8696
|
function getCopilotJetBrainsGlobalMcpConfigPath(homeDir) {
|
|
8688
|
-
return
|
|
8697
|
+
return path39.join(homeDir, ".config", "github-copilot", "intellij", "mcp.json");
|
|
8689
8698
|
}
|
|
8690
8699
|
function buildMemoraoneCopilotJetBrainsMcpServer(options) {
|
|
8691
8700
|
const environment = options.environment ?? (options.devMode ? "local" : "production");
|
|
@@ -8695,7 +8704,7 @@ function buildMemoraoneCopilotJetBrainsMcpServer(options) {
|
|
|
8695
8704
|
apiUrl: options.apiUrl ?? (environment === "local" ? DEV_API_URL : void 0)
|
|
8696
8705
|
}),
|
|
8697
8706
|
MEMORAONE_IDE_TYPE: "copilot-jetbrains",
|
|
8698
|
-
[MEMORAONE_WORKSPACE_ROOT_ENV]:
|
|
8707
|
+
[MEMORAONE_WORKSPACE_ROOT_ENV]: path39.resolve(options.workspaceRoot)
|
|
8699
8708
|
};
|
|
8700
8709
|
if (environment === "local" || options.devMode) {
|
|
8701
8710
|
env2.MEMORAONE_DEV_MODE = "1";
|
|
@@ -8718,11 +8727,11 @@ function mergeCopilotJetBrainsMcpConfigObject(existing, memoraone, ownership) {
|
|
|
8718
8727
|
return { ...base, servers: ownership ? replaceMemoraoneRepositoryBindingInServerMap(servers, memoraone, ownership) : replaceMemoraoneOwnedInServerMap(servers, memoraone) };
|
|
8719
8728
|
}
|
|
8720
8729
|
async function writeCopilotJetBrainsMcpJsonAtomic(filePath, content) {
|
|
8721
|
-
const dir =
|
|
8730
|
+
const dir = path39.dirname(filePath);
|
|
8722
8731
|
await fs33.mkdir(dir, { recursive: true });
|
|
8723
|
-
const tmpPath =
|
|
8732
|
+
const tmpPath = path39.join(
|
|
8724
8733
|
dir,
|
|
8725
|
-
`.${
|
|
8734
|
+
`.${path39.basename(filePath)}.${process.pid}.${(0, import_node_crypto24.randomBytes)(8).toString("hex")}.tmp`
|
|
8726
8735
|
);
|
|
8727
8736
|
try {
|
|
8728
8737
|
await fs33.writeFile(tmpPath, content, "utf8");
|
|
@@ -8806,7 +8815,7 @@ async function buildCopilotJetBrainsMemoraoneServer(options) {
|
|
|
8806
8815
|
async function setupCopilotJetBrainsMcpConfig(options) {
|
|
8807
8816
|
const homeDir = options.homeDir ?? os12.homedir();
|
|
8808
8817
|
const activePath = options.globalConfigPath ?? getCopilotJetBrainsGlobalMcpConfigPath(homeDir);
|
|
8809
|
-
const workspaceRoot =
|
|
8818
|
+
const workspaceRoot = path39.resolve(options.repoRoot);
|
|
8810
8819
|
const memoraone = await buildCopilotJetBrainsMemoraoneServer({
|
|
8811
8820
|
workspaceRoot,
|
|
8812
8821
|
devMode: options.devMode,
|
|
@@ -8877,12 +8886,12 @@ function logCopilotJetBrainsMcpCliSummary(info, dryRun, println = console.log) {
|
|
|
8877
8886
|
"[setup-ide-files] Fully quit JetBrains IDE / GitHub Copilot and reopen for MCP changes to take effect."
|
|
8878
8887
|
);
|
|
8879
8888
|
}
|
|
8880
|
-
var fs33, os12,
|
|
8889
|
+
var fs33, os12, path39, import_node_crypto24, CopilotJetBrainsMcpJsonParseError;
|
|
8881
8890
|
var init_copilotJetBrainsMcpConfig = __esm({
|
|
8882
8891
|
"src/copilotJetBrainsMcpConfig.ts"() {
|
|
8883
8892
|
fs33 = __toESM(require("fs/promises"), 1);
|
|
8884
8893
|
os12 = __toESM(require("os"), 1);
|
|
8885
|
-
|
|
8894
|
+
path39 = __toESM(require("path"), 1);
|
|
8886
8895
|
import_node_crypto24 = require("crypto");
|
|
8887
8896
|
init_configUtils();
|
|
8888
8897
|
init_cursorGlobalMcpConfig();
|
|
@@ -9456,7 +9465,7 @@ function buildMemoraoneMcpServer(ideType, options = {}) {
|
|
|
9456
9465
|
};
|
|
9457
9466
|
const includeWorkspaceRoot = options.workspaceRoot !== void 0 && (environment === "local" || ideType === "cursor" || ideType === "claude-code");
|
|
9458
9467
|
if (includeWorkspaceRoot) {
|
|
9459
|
-
env2[MEMORAONE_WORKSPACE_ROOT_ENV] =
|
|
9468
|
+
env2[MEMORAONE_WORKSPACE_ROOT_ENV] = path40.resolve(options.workspaceRoot);
|
|
9460
9469
|
}
|
|
9461
9470
|
if (environment === "local") {
|
|
9462
9471
|
if (!options.cliPath) {
|
|
@@ -9476,9 +9485,9 @@ function buildMemoraoneMcpServer(ideType, options = {}) {
|
|
|
9476
9485
|
};
|
|
9477
9486
|
}
|
|
9478
9487
|
function assertUnderRepoRoot(repoRoot, absPath) {
|
|
9479
|
-
const normRoot =
|
|
9480
|
-
const normPath =
|
|
9481
|
-
if (normPath !==
|
|
9488
|
+
const normRoot = path40.resolve(repoRoot) + path40.sep;
|
|
9489
|
+
const normPath = path40.resolve(absPath);
|
|
9490
|
+
if (normPath !== path40.resolve(repoRoot) && !normPath.startsWith(normRoot)) {
|
|
9482
9491
|
throw new Error(`[setup-ide-files] Refusing to write outside repo root: ${absPath}`);
|
|
9483
9492
|
}
|
|
9484
9493
|
}
|
|
@@ -9502,18 +9511,18 @@ async function ensureGitignoreMemoraone(_repoRoot, _opts) {
|
|
|
9502
9511
|
return "skipped";
|
|
9503
9512
|
}
|
|
9504
9513
|
async function findRepoRoot(startDir) {
|
|
9505
|
-
let current =
|
|
9506
|
-
const root =
|
|
9514
|
+
let current = path40.resolve(startDir);
|
|
9515
|
+
const root = path40.parse(current).root;
|
|
9507
9516
|
while (true) {
|
|
9508
|
-
const gitPath =
|
|
9509
|
-
const m1Path =
|
|
9517
|
+
const gitPath = path40.join(current, ".git");
|
|
9518
|
+
const m1Path = path40.join(current, "memoraone.m1");
|
|
9510
9519
|
if (await pathExists23(gitPath) || await pathExists23(m1Path)) {
|
|
9511
9520
|
return current;
|
|
9512
9521
|
}
|
|
9513
9522
|
if (current === root) {
|
|
9514
9523
|
return null;
|
|
9515
9524
|
}
|
|
9516
|
-
current =
|
|
9525
|
+
current = path40.dirname(current);
|
|
9517
9526
|
}
|
|
9518
9527
|
}
|
|
9519
9528
|
function stripLeadingLineComments18(text) {
|
|
@@ -9572,11 +9581,11 @@ function buildVscodeMcpJsonBody(existing, options = {}) {
|
|
|
9572
9581
|
return mcpJsonHeader() + JSON.stringify(merged, null, 2) + "\n";
|
|
9573
9582
|
}
|
|
9574
9583
|
async function writeSharedMcpJsonAtomic(filePath, content) {
|
|
9575
|
-
const dir =
|
|
9584
|
+
const dir = path40.dirname(filePath);
|
|
9576
9585
|
await fs34.mkdir(dir, { recursive: true });
|
|
9577
|
-
const tmpPath =
|
|
9586
|
+
const tmpPath = path40.join(
|
|
9578
9587
|
dir,
|
|
9579
|
-
`.${
|
|
9588
|
+
`.${path40.basename(filePath)}.${process.pid}.${(0, import_node_crypto25.randomBytes)(8).toString("hex")}.tmp`
|
|
9580
9589
|
);
|
|
9581
9590
|
try {
|
|
9582
9591
|
await fs34.writeFile(tmpPath, content, "utf8");
|
|
@@ -9630,7 +9639,7 @@ async function writeClaudeCodeMcpJson(repoRoot, buildBody, opts) {
|
|
|
9630
9639
|
return "updated";
|
|
9631
9640
|
}
|
|
9632
9641
|
async function writeManagedMarkdown(repoRoot, relPath, fullContent, opts) {
|
|
9633
|
-
const abs =
|
|
9642
|
+
const abs = path40.join(repoRoot, relPath);
|
|
9634
9643
|
assertUnderRepoRoot(repoRoot, abs);
|
|
9635
9644
|
let prior = "";
|
|
9636
9645
|
let existed = false;
|
|
@@ -9642,25 +9651,25 @@ async function writeManagedMarkdown(repoRoot, relPath, fullContent, opts) {
|
|
|
9642
9651
|
}
|
|
9643
9652
|
if (!existed) {
|
|
9644
9653
|
if (opts.dryRun) return "created";
|
|
9645
|
-
await fs34.mkdir(
|
|
9654
|
+
await fs34.mkdir(path40.dirname(abs), { recursive: true });
|
|
9646
9655
|
await fs34.writeFile(abs, fullContent, "utf8");
|
|
9647
9656
|
return "created";
|
|
9648
9657
|
}
|
|
9649
9658
|
if (prior.includes(MANAGED_MARKER)) {
|
|
9650
9659
|
if (prior === fullContent) return "skipped";
|
|
9651
9660
|
if (opts.dryRun) return "updated";
|
|
9652
|
-
await fs34.mkdir(
|
|
9661
|
+
await fs34.mkdir(path40.dirname(abs), { recursive: true });
|
|
9653
9662
|
await fs34.writeFile(abs, fullContent, "utf8");
|
|
9654
9663
|
return "updated";
|
|
9655
9664
|
}
|
|
9656
9665
|
if (!opts.force) return "skipped-untracked";
|
|
9657
9666
|
if (opts.dryRun) return "updated";
|
|
9658
|
-
await fs34.mkdir(
|
|
9667
|
+
await fs34.mkdir(path40.dirname(abs), { recursive: true });
|
|
9659
9668
|
await fs34.writeFile(abs, fullContent, "utf8");
|
|
9660
9669
|
return "updated";
|
|
9661
9670
|
}
|
|
9662
9671
|
async function writeIdeMcpJson(repoRoot, relPath, buildBody, opts) {
|
|
9663
|
-
const abs =
|
|
9672
|
+
const abs = path40.join(repoRoot, relPath);
|
|
9664
9673
|
assertUnderRepoRoot(repoRoot, abs);
|
|
9665
9674
|
let raw = "";
|
|
9666
9675
|
let existed = false;
|
|
@@ -10254,7 +10263,7 @@ async function runSetupIdeFiles(o) {
|
|
|
10254
10263
|
let junieMcp;
|
|
10255
10264
|
let xcodeMcp;
|
|
10256
10265
|
let copilotJetBrainsMcp;
|
|
10257
|
-
const repoRoot = o.workspaceRoot !== void 0 && o.workspaceRoot !== "" ?
|
|
10266
|
+
const repoRoot = o.workspaceRoot !== void 0 && o.workspaceRoot !== "" ? path40.resolve(o.workspaceRoot) : await findRepoRoot(o.cwd);
|
|
10258
10267
|
if (!repoRoot) {
|
|
10259
10268
|
return {
|
|
10260
10269
|
exitCode: 1,
|
|
@@ -11588,12 +11597,12 @@ async function cliSetupIdeFiles(argv, options = {}) {
|
|
|
11588
11597
|
}
|
|
11589
11598
|
return 0;
|
|
11590
11599
|
}
|
|
11591
|
-
var fs34, os13,
|
|
11600
|
+
var fs34, os13, path40, import_node_crypto25, MANAGED_MARKER, GITIGNORE_MEMORAONE_COMMENT, GITIGNORE_MEMORAONE_ENTRY, SharedMcpJsonParseError;
|
|
11592
11601
|
var init_setupIdeFiles = __esm({
|
|
11593
11602
|
"src/setupIdeFiles.ts"() {
|
|
11594
11603
|
fs34 = __toESM(require("fs/promises"), 1);
|
|
11595
11604
|
os13 = __toESM(require("os"), 1);
|
|
11596
|
-
|
|
11605
|
+
path40 = __toESM(require("path"), 1);
|
|
11597
11606
|
import_node_crypto25 = require("crypto");
|
|
11598
11607
|
init_cleanup();
|
|
11599
11608
|
init_cursorGlobalMcpConfig();
|
|
@@ -11664,10 +11673,10 @@ var init_setupIdeFiles = __esm({
|
|
|
11664
11673
|
|
|
11665
11674
|
// src/localState/replaceRootLocalState.ts
|
|
11666
11675
|
function canonicalizeWorkspaceRoot(workspaceRoot) {
|
|
11667
|
-
return
|
|
11676
|
+
return path41.resolve(workspaceRoot);
|
|
11668
11677
|
}
|
|
11669
11678
|
function getWorkspaceMapPathForHome(homeDir) {
|
|
11670
|
-
return
|
|
11679
|
+
return path41.join(getMemoraoneStateDir(homeDir), WORKSPACE_MAP_FILENAME);
|
|
11671
11680
|
}
|
|
11672
11681
|
async function loadWorkspaceMapFile(homeDir) {
|
|
11673
11682
|
const filePath = getWorkspaceMapPathForHome(homeDir);
|
|
@@ -11682,7 +11691,7 @@ async function saveWorkspaceMapFile(map, homeDir) {
|
|
|
11682
11691
|
await writeJsonAtomic(getWorkspaceMapPathForHome(homeDir), map);
|
|
11683
11692
|
}
|
|
11684
11693
|
function rootsMatch(a, b) {
|
|
11685
|
-
return
|
|
11694
|
+
return path41.resolve(a) === path41.resolve(b);
|
|
11686
11695
|
}
|
|
11687
11696
|
async function collectRootAssociatedBindingIds(workspaceRoot, options = {}) {
|
|
11688
11697
|
const canonicalRoot = canonicalizeWorkspaceRoot(workspaceRoot);
|
|
@@ -11839,11 +11848,11 @@ async function restoreRootLocalState(snapshot, options = {}) {
|
|
|
11839
11848
|
await writeInstallationCredentials(creds, options.credentialOptions);
|
|
11840
11849
|
}
|
|
11841
11850
|
}
|
|
11842
|
-
var fs35,
|
|
11851
|
+
var fs35, path41, WORKSPACE_MAP_FILENAME, FINGERPRINT_REGEX;
|
|
11843
11852
|
var init_replaceRootLocalState = __esm({
|
|
11844
11853
|
"src/localState/replaceRootLocalState.ts"() {
|
|
11845
11854
|
fs35 = __toESM(require("fs/promises"), 1);
|
|
11846
|
-
|
|
11855
|
+
path41 = __toESM(require("path"), 1);
|
|
11847
11856
|
init_installationCredentials();
|
|
11848
11857
|
init_bindingStore();
|
|
11849
11858
|
init_localLocks();
|
|
@@ -11925,7 +11934,7 @@ function classifyClineHubForConnect(_proc, _workspaceRoot) {
|
|
|
11925
11934
|
return "preserve";
|
|
11926
11935
|
}
|
|
11927
11936
|
async function runConnectRuntimeCleanup(options) {
|
|
11928
|
-
const workspaceRoot =
|
|
11937
|
+
const workspaceRoot = path42.resolve(options.workspaceRoot);
|
|
11929
11938
|
const newRepositoryBindingId = options.newRepositoryBindingId.trim();
|
|
11930
11939
|
const replacedBindingIds = new Set(
|
|
11931
11940
|
(options.replacedBindingIds ?? []).map((id) => id.trim()).filter(Boolean)
|
|
@@ -12096,10 +12105,10 @@ async function runConnectRuntimeCleanup(options) {
|
|
|
12096
12105
|
staleRuntimeRemains
|
|
12097
12106
|
};
|
|
12098
12107
|
}
|
|
12099
|
-
var
|
|
12108
|
+
var path42, import_node_child_process6, import_node_util5, fs36, execFileAsync5, CLINE_HUB_DAEMON_MARKER;
|
|
12100
12109
|
var init_connectRuntimeCleanup = __esm({
|
|
12101
12110
|
"src/connectRuntimeCleanup.ts"() {
|
|
12102
|
-
|
|
12111
|
+
path42 = __toESM(require("path"), 1);
|
|
12103
12112
|
import_node_child_process6 = require("child_process");
|
|
12104
12113
|
import_node_util5 = require("util");
|
|
12105
12114
|
fs36 = __toESM(require("fs/promises"), 1);
|
|
@@ -12133,7 +12142,7 @@ function normalizeGitRemote(remoteUrl) {
|
|
|
12133
12142
|
return normalized.toLowerCase() || null;
|
|
12134
12143
|
}
|
|
12135
12144
|
async function detectLegacyM1Warning2(workspaceRoot) {
|
|
12136
|
-
const candidate =
|
|
12145
|
+
const candidate = path43.join(path43.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
|
|
12137
12146
|
try {
|
|
12138
12147
|
await fs37.access(candidate);
|
|
12139
12148
|
return candidate;
|
|
@@ -12150,7 +12159,7 @@ async function rollbackFailedConnect(options) {
|
|
|
12150
12159
|
}
|
|
12151
12160
|
async function runConnectCommand(options) {
|
|
12152
12161
|
const code = normalizeConnectCode(options.code);
|
|
12153
|
-
const cwd2 =
|
|
12162
|
+
const cwd2 = path43.resolve(options.cwd ?? process.cwd());
|
|
12154
12163
|
const apiUrl = (options.apiUrl ?? config2.apiUrl).replace(/\/+$/, "");
|
|
12155
12164
|
const homeDir = options.homeDir ?? os14.homedir();
|
|
12156
12165
|
const environment = "local";
|
|
@@ -12179,7 +12188,7 @@ async function runConnectCommand(options) {
|
|
|
12179
12188
|
const legacyM1WarningPath = await detectLegacyM1Warning2(cwd2);
|
|
12180
12189
|
if (legacyM1WarningPath) {
|
|
12181
12190
|
process.stderr.write(
|
|
12182
|
-
`[memoraone-mcp] warning: ignoring legacy ${
|
|
12191
|
+
`[memoraone-mcp] warning: ignoring legacy ${path43.basename(legacyM1WarningPath)} at ${legacyM1WarningPath} (credentials and binding are package-managed)
|
|
12183
12192
|
`
|
|
12184
12193
|
);
|
|
12185
12194
|
}
|
|
@@ -12583,11 +12592,11 @@ async function cliConnect(argv, options = {}) {
|
|
|
12583
12592
|
return 1;
|
|
12584
12593
|
}
|
|
12585
12594
|
}
|
|
12586
|
-
var fs37,
|
|
12595
|
+
var fs37, path43, os14;
|
|
12587
12596
|
var init_connectCommand = __esm({
|
|
12588
12597
|
"src/localState/connectCommand.ts"() {
|
|
12589
12598
|
fs37 = __toESM(require("fs/promises"), 1);
|
|
12590
|
-
|
|
12599
|
+
path43 = __toESM(require("path"), 1);
|
|
12591
12600
|
os14 = __toESM(require("os"), 1);
|
|
12592
12601
|
init_config();
|
|
12593
12602
|
init_projectBinding();
|
|
@@ -12749,8 +12758,8 @@ var init_bridgeClientRoots = __esm({
|
|
|
12749
12758
|
if (this.closed) {
|
|
12750
12759
|
return null;
|
|
12751
12760
|
}
|
|
12752
|
-
return new Promise((
|
|
12753
|
-
this.waiters.push(
|
|
12761
|
+
return new Promise((resolve40) => {
|
|
12762
|
+
this.waiters.push(resolve40);
|
|
12754
12763
|
});
|
|
12755
12764
|
}
|
|
12756
12765
|
/** Re-queue lines read during an intermediate protocol step (e.g. roots/list) for the main bridge loop. */
|
|
@@ -12977,9 +12986,9 @@ function extractJsonRpcId(line) {
|
|
|
12977
12986
|
}
|
|
12978
12987
|
}
|
|
12979
12988
|
function connectWithRetry(socketPath, log, maxRetries, retryDelayMs, connect2) {
|
|
12980
|
-
return new Promise((
|
|
12989
|
+
return new Promise((resolve40, reject) => {
|
|
12981
12990
|
const tryConnect = (attempt) => {
|
|
12982
|
-
connect2(socketPath).then(
|
|
12991
|
+
connect2(socketPath).then(resolve40).catch((err) => {
|
|
12983
12992
|
if (attempt >= maxRetries) {
|
|
12984
12993
|
reject(err);
|
|
12985
12994
|
return;
|
|
@@ -13175,8 +13184,8 @@ var init_bridgeProxy = __esm({
|
|
|
13175
13184
|
this.maxRetries = options.maxRetries ?? 5;
|
|
13176
13185
|
this.retryDelayMs = options.retryDelayMs ?? 200;
|
|
13177
13186
|
this.lineReader = options.lineReader ?? null;
|
|
13178
|
-
this.connectImpl = options.connect ?? ((socketPath) => new Promise((
|
|
13179
|
-
const socket = net.connect(socketPath, () =>
|
|
13187
|
+
this.connectImpl = options.connect ?? ((socketPath) => new Promise((resolve40, reject) => {
|
|
13188
|
+
const socket = net.connect(socketPath, () => resolve40(socket));
|
|
13180
13189
|
socket.on("error", reject);
|
|
13181
13190
|
}));
|
|
13182
13191
|
this.spawnDaemonImpl = options.spawnDaemon ?? (async (binding) => {
|
|
@@ -13308,7 +13317,7 @@ var init_bridgeProxy = __esm({
|
|
|
13308
13317
|
}
|
|
13309
13318
|
waitForDaemonJsonRpcResponse(id, timeoutMs = 3e4) {
|
|
13310
13319
|
const key = this.waiterKey(id);
|
|
13311
|
-
return new Promise((
|
|
13320
|
+
return new Promise((resolve40, reject) => {
|
|
13312
13321
|
const timer = setTimeout(() => {
|
|
13313
13322
|
this.pendingDaemonResponseWaiters.delete(key);
|
|
13314
13323
|
reject(
|
|
@@ -13317,7 +13326,7 @@ var init_bridgeProxy = __esm({
|
|
|
13317
13326
|
)
|
|
13318
13327
|
);
|
|
13319
13328
|
}, timeoutMs);
|
|
13320
|
-
this.pendingDaemonResponseWaiters.set(key, { resolve:
|
|
13329
|
+
this.pendingDaemonResponseWaiters.set(key, { resolve: resolve40, reject, timer });
|
|
13321
13330
|
});
|
|
13322
13331
|
}
|
|
13323
13332
|
notifyDaemonResponseWaiters(line) {
|