@memoraone/mcp 0.1.47 → 0.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -231,7 +231,7 @@ var require_package = __commonJS({
231
231
  "package.json"(exports2, module2) {
232
232
  module2.exports = {
233
233
  name: "@memoraone/mcp",
234
- version: "0.1.47",
234
+ version: "0.1.49",
235
235
  type: "module",
236
236
  main: "dist/index.cjs",
237
237
  exports: {
@@ -531,7 +531,7 @@ async function acquireLocalLock(lockName, options = {}) {
531
531
  `[memoraone-mcp] Failed to acquire lock ${lockName} after ${maxRetries} retries`
532
532
  );
533
533
  }
534
- await new Promise((resolve43) => setTimeout(resolve43, retryDelayMs));
534
+ await new Promise((resolve44) => setTimeout(resolve44, retryDelayMs));
535
535
  continue;
536
536
  }
537
537
  throw err;
@@ -1092,9 +1092,9 @@ var init_memoraClient = __esm({
1092
1092
  });
1093
1093
 
1094
1094
  // src/localState/localConnectClient.ts
1095
- async function requestJson(baseUrl, method, path47, options = {}) {
1095
+ async function requestJson(baseUrl, method, path48, options = {}) {
1096
1096
  const fetchImpl = options.fetchImpl ?? fetch;
1097
- const url = `${baseUrl.replace(/\/+$/, "")}${path47.startsWith("/") ? path47 : `/${path47}`}`;
1097
+ const url = `${baseUrl.replace(/\/+$/, "")}${path48.startsWith("/") ? path48 : `/${path48}`}`;
1098
1098
  const res = await fetchImpl(url, {
1099
1099
  method,
1100
1100
  headers: {
@@ -1273,19 +1273,9 @@ var init_tokenRefreshCoordinator = __esm({
1273
1273
  });
1274
1274
 
1275
1275
  // src/localState/resolveLocalBinding.ts
1276
- async function detectLegacyM1Warning(workspaceRoot) {
1277
- const candidate = path9.join(path9.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
1278
- try {
1279
- await fs6.access(candidate);
1280
- return candidate;
1281
- } catch {
1282
- return void 0;
1283
- }
1284
- }
1285
1276
  async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
1286
1277
  const resolved = path9.resolve(workspaceRoot);
1287
1278
  const identity = await captureRootFilesystemIdentity(resolved, options.identityDeps);
1288
- const legacyM1WarningPath = await detectLegacyM1Warning(resolved);
1289
1279
  const index = await loadPathIndex(options.homeDir);
1290
1280
  const lookup = lookupPathIndex(index, resolved, identity);
1291
1281
  if (lookup.kind === "path") {
@@ -1309,8 +1299,7 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
1309
1299
  return {
1310
1300
  repositoryBindingId: record.repositoryBindingId,
1311
1301
  identity,
1312
- created: false,
1313
- legacyM1WarningPath
1302
+ created: false
1314
1303
  };
1315
1304
  }
1316
1305
  }
@@ -1334,8 +1323,7 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
1334
1323
  repositoryBindingId: record.repositoryBindingId,
1335
1324
  identity,
1336
1325
  created: false,
1337
- renamedFrom: lookup.previousPath,
1338
- legacyM1WarningPath
1326
+ renamedFrom: lookup.previousPath
1339
1327
  };
1340
1328
  }
1341
1329
  }
@@ -1348,8 +1336,7 @@ async function ensureRepositoryBindingForRoot(workspaceRoot, options = {}) {
1348
1336
  return {
1349
1337
  repositoryBindingId,
1350
1338
  identity,
1351
- created: true,
1352
- legacyM1WarningPath
1339
+ created: true
1353
1340
  };
1354
1341
  }
1355
1342
  async function lookupLocalBindingIdentity(workspaceRoot, options = {}) {
@@ -1378,7 +1365,7 @@ async function lookupLocalBindingIdentity(workspaceRoot, options = {}) {
1378
1365
  }
1379
1366
  async function resolveLocalBinding(workspaceRoot, options = {}) {
1380
1367
  const resolved = path9.resolve(workspaceRoot);
1381
- const { repositoryBindingId, legacyM1WarningPath } = await ensureRepositoryBindingForRoot(
1368
+ const { repositoryBindingId } = await ensureRepositoryBindingForRoot(
1382
1369
  resolved,
1383
1370
  { ...options, createIfMissing: false }
1384
1371
  );
@@ -1421,16 +1408,13 @@ async function resolveLocalBinding(workspaceRoot, options = {}) {
1421
1408
  installationPublicId: record.installationPublicId ?? creds.installationPublicId,
1422
1409
  environment: record.environment,
1423
1410
  bindingSource: "local-binding",
1424
- status: record.status,
1425
- legacyM1WarningPath
1411
+ status: record.status
1426
1412
  };
1427
1413
  }
1428
- var fs6, path9;
1414
+ var path9;
1429
1415
  var init_resolveLocalBinding = __esm({
1430
1416
  "src/localState/resolveLocalBinding.ts"() {
1431
- fs6 = __toESM(require("fs/promises"), 1);
1432
1417
  path9 = __toESM(require("path"), 1);
1433
- init_projectBinding();
1434
1418
  init_bindingStore();
1435
1419
  init_installationCredentials();
1436
1420
  init_pathIndex();
@@ -1456,23 +1440,9 @@ function toResolvedBinding(local) {
1456
1440
  installationPublicId: local.installationPublicId,
1457
1441
  environment: local.environment,
1458
1442
  bindingSource: "local-binding",
1459
- status: local.status,
1460
- legacyM1WarningPath: local.legacyM1WarningPath
1443
+ status: local.status
1461
1444
  };
1462
1445
  }
1463
- async function warnLegacyM1IfPresent(workspaceRoot) {
1464
- const candidate = path10.join(path10.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
1465
- try {
1466
- await fs7.access(candidate);
1467
- process.stderr.write(
1468
- `[memoraone-mcp] warning: ignoring legacy ${CANONICAL_M1_FILENAME} (not used for credentials or binding)
1469
- `
1470
- );
1471
- return candidate;
1472
- } catch {
1473
- return void 0;
1474
- }
1475
- }
1476
1446
  async function resolveAuthoritativeBinding(workspaceRoot, _options = {}) {
1477
1447
  const candidates = normalizeWorkspaceSearchRoots(workspaceRoot);
1478
1448
  if (candidates.length === 0) {
@@ -1482,7 +1452,6 @@ async function resolveAuthoritativeBinding(workspaceRoot, _options = {}) {
1482
1452
  }
1483
1453
  const bindings = [];
1484
1454
  for (const root of candidates) {
1485
- await warnLegacyM1IfPresent(root);
1486
1455
  try {
1487
1456
  const local = await resolveLocalBinding(root);
1488
1457
  bindings.push(toResolvedBinding(local));
@@ -1624,10 +1593,9 @@ function decodeResolvedBinding(value) {
1624
1593
  status
1625
1594
  };
1626
1595
  }
1627
- var fs7, path10, uuidRegex, CANONICAL_M1_FILENAME;
1596
+ var path10, uuidRegex, CANONICAL_M1_FILENAME;
1628
1597
  var init_projectBinding = __esm({
1629
1598
  "src/projectBinding.ts"() {
1630
- fs7 = __toESM(require("fs/promises"), 1);
1631
1599
  path10 = __toESM(require("path"), 1);
1632
1600
  init_resolveLocalBinding();
1633
1601
  init_bindingStore();
@@ -1671,7 +1639,7 @@ function parseSidecarRecord(raw) {
1671
1639
  }
1672
1640
  function readBindingSidecarRecord(socketPath) {
1673
1641
  try {
1674
- const raw = fs8.readFileSync(bindingSidecarPath(socketPath), "utf8");
1642
+ const raw = fs6.readFileSync(bindingSidecarPath(socketPath), "utf8");
1675
1643
  return parseSidecarRecord(raw);
1676
1644
  } catch {
1677
1645
  return null;
@@ -1686,14 +1654,14 @@ function readBindingSidecar(socketPath) {
1686
1654
  }
1687
1655
  function removeBindingSidecar(socketPath) {
1688
1656
  try {
1689
- fs8.unlinkSync(bindingSidecarPath(socketPath));
1657
+ fs6.unlinkSync(bindingSidecarPath(socketPath));
1690
1658
  } catch {
1691
1659
  }
1692
1660
  }
1693
1661
  function removeDaemonSocketArtifacts(socketPath) {
1694
1662
  removeBindingSidecar(socketPath);
1695
1663
  try {
1696
- fs8.unlinkSync(socketPath);
1664
+ fs6.unlinkSync(socketPath);
1697
1665
  } catch {
1698
1666
  }
1699
1667
  }
@@ -1737,10 +1705,10 @@ function verifyDaemonSidecarBinding(socketPath, expected, env2 = process.env, id
1737
1705
  }
1738
1706
  return sidecar;
1739
1707
  }
1740
- var fs8, path11;
1708
+ var fs6, path11;
1741
1709
  var init_bindingSidecar = __esm({
1742
1710
  "src/bindingSidecar.ts"() {
1743
- fs8 = __toESM(require("fs"), 1);
1711
+ fs6 = __toESM(require("fs"), 1);
1744
1712
  path11 = __toESM(require("path"), 1);
1745
1713
  init_bindingIdentity();
1746
1714
  init_projectBinding();
@@ -1930,7 +1898,7 @@ var init_initializeBinding = __esm({
1930
1898
  // src/resolveBuiltCliPath.ts
1931
1899
  async function pathExists(filePath) {
1932
1900
  try {
1933
- await fs9.access(filePath);
1901
+ await fs7.access(filePath);
1934
1902
  return true;
1935
1903
  } catch {
1936
1904
  return false;
@@ -1994,10 +1962,10 @@ async function resolveBuiltCliPathAsync(options) {
1994
1962
  }
1995
1963
  return null;
1996
1964
  }
1997
- var fs9, path13, MONOREPO_CLI_REL;
1965
+ var fs7, path13, MONOREPO_CLI_REL;
1998
1966
  var init_resolveBuiltCliPath = __esm({
1999
1967
  "src/resolveBuiltCliPath.ts"() {
2000
- fs9 = __toESM(require("fs/promises"), 1);
1968
+ fs7 = __toESM(require("fs/promises"), 1);
2001
1969
  path13 = __toESM(require("path"), 1);
2002
1970
  MONOREPO_CLI_REL = path13.join("packages", "mcp", "dist", "cli.cjs");
2003
1971
  }
@@ -2383,7 +2351,7 @@ function buildMemoraoneCursorMcpServer(options) {
2383
2351
  }
2384
2352
  async function pathExists2(filePath) {
2385
2353
  try {
2386
- await fs10.access(filePath);
2354
+ await fs8.access(filePath);
2387
2355
  return true;
2388
2356
  } catch {
2389
2357
  return false;
@@ -2434,7 +2402,7 @@ async function isWorkingNpx(npxPath) {
2434
2402
  if (!await pathExists2(npxPath)) return false;
2435
2403
  if (process.platform !== "win32") {
2436
2404
  try {
2437
- await fs10.access(npxPath, fs10.constants.X_OK);
2405
+ await fs8.access(npxPath, fs8.constants.X_OK);
2438
2406
  } catch {
2439
2407
  return false;
2440
2408
  }
@@ -2615,7 +2583,7 @@ function getCursorRepoMcpConfigPath(repoRoot) {
2615
2583
  }
2616
2584
  async function readCursorMcpConfigObject(configPath) {
2617
2585
  try {
2618
- const raw = await fs10.readFile(configPath, "utf8");
2586
+ const raw = await fs8.readFile(configPath, "utf8");
2619
2587
  return JSON.parse(stripLeadingLineComments(raw));
2620
2588
  } catch (err) {
2621
2589
  const code = err && typeof err === "object" && "code" in err ? err.code : void 0;
@@ -2633,17 +2601,17 @@ async function removeMemoraoneFromCursorGlobalConfig(options) {
2633
2601
  return { changed: true, backupPath: `${configPath}.backup-<timestamp>` };
2634
2602
  }
2635
2603
  const backupPath = `${configPath}.backup-${formatBackupTimestamp()}`;
2636
- await fs10.copyFile(configPath, backupPath);
2604
+ await fs8.copyFile(configPath, backupPath);
2637
2605
  const mcpServersRaw = typeof parsed2.mcpServers === "object" && parsed2.mcpServers !== null && !Array.isArray(parsed2.mcpServers) ? parsed2.mcpServers : {};
2638
2606
  const { next: mcpServers } = stripMemoraoneOwnedFromServerMap(mcpServersRaw);
2639
2607
  const hasOtherServers = Object.keys(mcpServers).length > 0;
2640
2608
  if (!hasOtherServers) {
2641
- await fs10.unlink(configPath);
2609
+ await fs8.unlink(configPath);
2642
2610
  return { changed: true, backupPath };
2643
2611
  }
2644
2612
  const next = { ...parsed2, mcpServers };
2645
- await fs10.mkdir(path16.dirname(configPath), { recursive: true });
2646
- await fs10.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
2613
+ await fs8.mkdir(path16.dirname(configPath), { recursive: true });
2614
+ await fs8.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
2647
2615
  return { changed: true, backupPath };
2648
2616
  }
2649
2617
  async function auditCursorMcpConfig(options) {
@@ -2749,10 +2717,10 @@ function logCursorMcpCliSummary(info, dryRun, opts) {
2749
2717
  );
2750
2718
  }
2751
2719
  }
2752
- 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;
2720
+ var fs8, 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;
2753
2721
  var init_cursorGlobalMcpConfig = __esm({
2754
2722
  "src/cursorGlobalMcpConfig.ts"() {
2755
- fs10 = __toESM(require("fs/promises"), 1);
2723
+ fs8 = __toESM(require("fs/promises"), 1);
2756
2724
  os4 = __toESM(require("os"), 1);
2757
2725
  path16 = __toESM(require("path"), 1);
2758
2726
  import_node_child_process2 = require("child_process");
@@ -2967,7 +2935,7 @@ async function defaultListSocketPaths(projectId) {
2967
2935
  const baseDir = getMcpBaseDir();
2968
2936
  let entries;
2969
2937
  try {
2970
- entries = await fs11.readdir(baseDir);
2938
+ entries = await fs9.readdir(baseDir);
2971
2939
  } catch (err) {
2972
2940
  const code = err && typeof err === "object" && "code" in err ? err.code : void 0;
2973
2941
  if (code === "ENOENT") {
@@ -3004,7 +2972,7 @@ async function defaultListSocketPathsForWorkspaceRoot(workspaceRoot) {
3004
2972
  const baseDir = getMcpBaseDir();
3005
2973
  let entries;
3006
2974
  try {
3007
- entries = await fs11.readdir(baseDir);
2975
+ entries = await fs9.readdir(baseDir);
3008
2976
  } catch (err) {
3009
2977
  const code = err && typeof err === "object" && "code" in err ? err.code : void 0;
3010
2978
  if (code === "ENOENT") {
@@ -3058,9 +3026,9 @@ async function defaultKillProcess(pid, signal = "SIGTERM") {
3058
3026
  process.kill(pid, signal);
3059
3027
  }
3060
3028
  async function defaultRemoveSocket(socketPath) {
3061
- await fs11.unlink(socketPath);
3029
+ await fs9.unlink(socketPath);
3062
3030
  try {
3063
- await fs11.unlink(bindingSidecarPath(socketPath));
3031
+ await fs9.unlink(bindingSidecarPath(socketPath));
3064
3032
  } catch {
3065
3033
  }
3066
3034
  }
@@ -3457,10 +3425,10 @@ async function cliCleanup(argv) {
3457
3425
  }
3458
3426
  return result.exitCode;
3459
3427
  }
3460
- 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;
3428
+ var fs9, 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;
3461
3429
  var init_cleanup = __esm({
3462
3430
  "src/cleanup.ts"() {
3463
- fs11 = __toESM(require("fs/promises"), 1);
3431
+ fs9 = __toESM(require("fs/promises"), 1);
3464
3432
  path17 = __toESM(require("path"), 1);
3465
3433
  readline = __toESM(require("readline/promises"), 1);
3466
3434
  import_node_child_process3 = require("child_process");
@@ -3503,18 +3471,18 @@ var init_configUtils = __esm({
3503
3471
  });
3504
3472
 
3505
3473
  // src/config.ts
3506
- var process2, fs12, path18, dotenv, import_v4, dotenvPath, EnvSchema, requiredEnvVars, missingEnvVars, parsed, resolvedApiUrl, parseBooleanFlag2, config2;
3474
+ var process2, fs10, path18, dotenv, import_v4, dotenvPath, EnvSchema, requiredEnvVars, missingEnvVars, parsed, resolvedApiUrl, parseBooleanFlag2, config2;
3507
3475
  var init_config = __esm({
3508
3476
  "src/config.ts"() {
3509
3477
  process2 = __toESM(require("process"), 1);
3510
- fs12 = __toESM(require("fs"), 1);
3478
+ fs10 = __toESM(require("fs"), 1);
3511
3479
  path18 = __toESM(require("path"), 1);
3512
3480
  dotenv = __toESM(require("dotenv"), 1);
3513
3481
  import_v4 = require("zod/v4");
3514
3482
  init_configUtils();
3515
3483
  init_socketPaths();
3516
3484
  dotenvPath = path18.resolve(process2.cwd(), ".env");
3517
- if (fs12.existsSync(dotenvPath)) {
3485
+ if (fs10.existsSync(dotenvPath)) {
3518
3486
  try {
3519
3487
  dotenv.config({ path: dotenvPath });
3520
3488
  } catch (err) {
@@ -3618,10 +3586,10 @@ function resolveRepoFingerprint(cwd2) {
3618
3586
  source: "path-fallback"
3619
3587
  };
3620
3588
  }
3621
- var fs13, path19, crypto2, parseBooleanFlag3, debugEnabled2, debugLog, normalizeRemoteUrl, sha256, resolveGitDir, findGitRoot, readOriginRemote;
3589
+ var fs11, path19, crypto2, parseBooleanFlag3, debugEnabled2, debugLog, normalizeRemoteUrl, sha256, resolveGitDir, findGitRoot, readOriginRemote;
3622
3590
  var init_repoFingerprint = __esm({
3623
3591
  "src/repoFingerprint.ts"() {
3624
- fs13 = __toESM(require("fs"), 1);
3592
+ fs11 = __toESM(require("fs"), 1);
3625
3593
  path19 = __toESM(require("path"), 1);
3626
3594
  crypto2 = __toESM(require("crypto"), 1);
3627
3595
  parseBooleanFlag3 = (value) => {
@@ -3652,12 +3620,12 @@ var init_repoFingerprint = __esm({
3652
3620
  };
3653
3621
  resolveGitDir = (gitPath) => {
3654
3622
  try {
3655
- const stat6 = fs13.statSync(gitPath);
3623
+ const stat6 = fs11.statSync(gitPath);
3656
3624
  if (stat6.isDirectory()) {
3657
3625
  return gitPath;
3658
3626
  }
3659
3627
  if (stat6.isFile()) {
3660
- const content = fs13.readFileSync(gitPath, "utf8");
3628
+ const content = fs11.readFileSync(gitPath, "utf8");
3661
3629
  const match = content.match(/^gitdir:\s*(.+)$/m);
3662
3630
  if (match) {
3663
3631
  const gitDir = match[1].trim();
@@ -3673,7 +3641,7 @@ var init_repoFingerprint = __esm({
3673
3641
  let current = path19.resolve(start);
3674
3642
  while (true) {
3675
3643
  const gitPath = path19.join(current, ".git");
3676
- if (fs13.existsSync(gitPath)) {
3644
+ if (fs11.existsSync(gitPath)) {
3677
3645
  const gitDir = resolveGitDir(gitPath);
3678
3646
  if (gitDir) {
3679
3647
  return { gitRoot: current, gitDir };
@@ -3690,7 +3658,7 @@ var init_repoFingerprint = __esm({
3690
3658
  readOriginRemote = (gitDir) => {
3691
3659
  const configPath = path19.join(gitDir, "config");
3692
3660
  try {
3693
- const content = fs13.readFileSync(configPath, "utf8");
3661
+ const content = fs11.readFileSync(configPath, "utf8");
3694
3662
  const lines = content.split(/\r?\n/);
3695
3663
  let inOrigin = false;
3696
3664
  for (const line of lines) {
@@ -3720,7 +3688,7 @@ function stripLeadingLineComments2(text) {
3720
3688
  }
3721
3689
  async function pathExists3(filePath) {
3722
3690
  try {
3723
- await fs14.access(filePath);
3691
+ await fs12.access(filePath);
3724
3692
  return true;
3725
3693
  } catch {
3726
3694
  return false;
@@ -3747,7 +3715,7 @@ function getKnownJetBrainsMcpConfigLocations(homeDir, repoRoot) {
3747
3715
  }
3748
3716
  async function isZeroByteConfigFile(filePath) {
3749
3717
  if (!await pathExists3(filePath)) return false;
3750
- const stat6 = await fs14.stat(filePath);
3718
+ const stat6 = await fs12.stat(filePath);
3751
3719
  return stat6.size === 0;
3752
3720
  }
3753
3721
  function stripDebugEnvVars(env2) {
@@ -3792,17 +3760,17 @@ function mergeJetBrainsMcpConfigObject(existing, memoraone, ownership) {
3792
3760
  }
3793
3761
  async function writeJetBrainsMcpJsonAtomic(filePath, content) {
3794
3762
  const dir = path20.dirname(filePath);
3795
- await fs14.mkdir(dir, { recursive: true });
3763
+ await fs12.mkdir(dir, { recursive: true });
3796
3764
  const tmpPath = path20.join(
3797
3765
  dir,
3798
3766
  `.${path20.basename(filePath)}.${process.pid}.${(0, import_node_crypto5.randomBytes)(8).toString("hex")}.tmp`
3799
3767
  );
3800
3768
  try {
3801
- await fs14.writeFile(tmpPath, content, "utf8");
3802
- await fs14.rename(tmpPath, filePath);
3769
+ await fs12.writeFile(tmpPath, content, "utf8");
3770
+ await fs12.rename(tmpPath, filePath);
3803
3771
  } catch (err) {
3804
3772
  try {
3805
- await fs14.unlink(tmpPath);
3773
+ await fs12.unlink(tmpPath);
3806
3774
  } catch {
3807
3775
  }
3808
3776
  throw err;
@@ -3828,13 +3796,13 @@ function validateJetBrainsMcpConfig(parsed2, expected, serverName = CANONICAL_ME
3828
3796
  }
3829
3797
  }
3830
3798
  async function readJsonConfig(filePath) {
3831
- const raw = await fs14.readFile(filePath, "utf8");
3799
+ const raw = await fs12.readFile(filePath, "utf8");
3832
3800
  if (raw.trim() === "") return null;
3833
3801
  return JSON.parse(stripLeadingLineComments2(raw));
3834
3802
  }
3835
3803
  async function backupConfigFile(filePath) {
3836
3804
  const backupPath = `${filePath}.bak-${formatJetBrainsBackupTimestamp()}`;
3837
- await fs14.copyFile(filePath, backupPath);
3805
+ await fs12.copyFile(filePath, backupPath);
3838
3806
  return backupPath;
3839
3807
  }
3840
3808
  async function repairZeroByteConfigFile(filePath, dryRun) {
@@ -3845,7 +3813,7 @@ async function repairZeroByteConfigFile(filePath, dryRun) {
3845
3813
  return { repaired: true, backupPath: `${filePath}.bak-<timestamp>` };
3846
3814
  }
3847
3815
  const backupPath = await backupConfigFile(filePath);
3848
- await fs14.unlink(filePath);
3816
+ await fs12.unlink(filePath);
3849
3817
  return { repaired: true, backupPath };
3850
3818
  }
3851
3819
  function configHasMemoraone(parsed2) {
@@ -3876,12 +3844,12 @@ async function removeMemoraoneFromProjectConfig(options) {
3876
3844
  const { next: mcpServers } = stripMemoraoneOwnedFromServerMap(mcpServersRaw);
3877
3845
  const hasOtherServers = Object.keys(mcpServers).length > 0;
3878
3846
  if (!hasOtherServers) {
3879
- await fs14.unlink(configPath);
3847
+ await fs12.unlink(configPath);
3880
3848
  return { changed: true, backupPath };
3881
3849
  }
3882
3850
  const next = { ...parsed2, mcpServers };
3883
- await fs14.mkdir(path20.dirname(configPath), { recursive: true });
3884
- await fs14.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
3851
+ await fs12.mkdir(path20.dirname(configPath), { recursive: true });
3852
+ await fs12.writeFile(configPath, JSON.stringify(next, null, 2) + "\n", "utf8");
3885
3853
  return { changed: true, backupPath };
3886
3854
  }
3887
3855
  async function resolveLocalCliPathAsync() {
@@ -3950,7 +3918,7 @@ function formatOptionalJetBrainsHandshakeUnavailableDetail(detail) {
3950
3918
  async function verifyJetBrainsMcpHandshake(options) {
3951
3919
  const timeoutMs = options.timeoutMs ?? 15e3;
3952
3920
  const { server } = options;
3953
- return new Promise((resolve43) => {
3921
+ return new Promise((resolve44) => {
3954
3922
  let settled = false;
3955
3923
  const finish = (ok, detail, optionalUnavailable) => {
3956
3924
  if (settled) return;
@@ -3960,7 +3928,7 @@ async function verifyJetBrainsMcpHandshake(options) {
3960
3928
  child.kill();
3961
3929
  } catch {
3962
3930
  }
3963
- resolve43({ ok, detail, optionalUnavailable });
3931
+ resolve44({ ok, detail, optionalUnavailable });
3964
3932
  };
3965
3933
  const child = (0, import_node_child_process4.spawn)(server.command, [...server.args], {
3966
3934
  env: { ...process.env, ...server.env },
@@ -4106,7 +4074,7 @@ async function setupJetBrainsMcpConfig(options) {
4106
4074
  backupPath = await backupConfigFile(globalPath);
4107
4075
  }
4108
4076
  await writeJetBrainsMcpJsonAtomic(globalPath, body);
4109
- const verifyRaw = await fs14.readFile(globalPath, "utf8");
4077
+ const verifyRaw = await fs12.readFile(globalPath, "utf8");
4110
4078
  const verifyParsed = JSON.parse(stripLeadingLineComments2(verifyRaw));
4111
4079
  validateJetBrainsMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
4112
4080
  const outcome = existed ? "updated" : "created";
@@ -4173,10 +4141,10 @@ function logJetBrainsMcpCliSummary(info, dryRun, println = console.log) {
4173
4141
  "[setup-ide-files] Fully quit JetBrains IDE and reopen this repo for MCP changes to take effect."
4174
4142
  );
4175
4143
  }
4176
- var fs14, os5, path20, import_node_crypto5, import_node_child_process4, JETBRAINS_DEBUG_ENV_VARS;
4144
+ var fs12, os5, path20, import_node_crypto5, import_node_child_process4, JETBRAINS_DEBUG_ENV_VARS;
4177
4145
  var init_jetbrainsMcpConfig = __esm({
4178
4146
  "src/jetbrainsMcpConfig.ts"() {
4179
- fs14 = __toESM(require("fs/promises"), 1);
4147
+ fs12 = __toESM(require("fs/promises"), 1);
4180
4148
  os5 = __toESM(require("os"), 1);
4181
4149
  path20 = __toESM(require("path"), 1);
4182
4150
  import_node_crypto5 = require("crypto");
@@ -4201,7 +4169,7 @@ function stripLeadingLineComments3(text) {
4201
4169
  }
4202
4170
  async function pathExists4(filePath) {
4203
4171
  try {
4204
- await fs15.access(filePath);
4172
+ await fs13.access(filePath);
4205
4173
  return true;
4206
4174
  } catch {
4207
4175
  return false;
@@ -4261,17 +4229,17 @@ function stripMemoraoneFromWindsurfConfigObject(existing) {
4261
4229
  }
4262
4230
  async function writeWindsurfMcpJsonAtomic(filePath, content) {
4263
4231
  const dir = path21.dirname(filePath);
4264
- await fs15.mkdir(dir, { recursive: true });
4232
+ await fs13.mkdir(dir, { recursive: true });
4265
4233
  const tmpPath = path21.join(
4266
4234
  dir,
4267
4235
  `.${path21.basename(filePath)}.${process.pid}.${(0, import_node_crypto6.randomBytes)(8).toString("hex")}.tmp`
4268
4236
  );
4269
4237
  try {
4270
- await fs15.writeFile(tmpPath, content, "utf8");
4271
- await fs15.rename(tmpPath, filePath);
4238
+ await fs13.writeFile(tmpPath, content, "utf8");
4239
+ await fs13.rename(tmpPath, filePath);
4272
4240
  } catch (err) {
4273
4241
  try {
4274
- await fs15.unlink(tmpPath);
4242
+ await fs13.unlink(tmpPath);
4275
4243
  } catch {
4276
4244
  }
4277
4245
  throw err;
@@ -4297,13 +4265,13 @@ function validateWindsurfMcpConfig(parsed2, expected, serverName = CANONICAL_MEM
4297
4265
  }
4298
4266
  }
4299
4267
  async function readJsonConfig2(filePath) {
4300
- const raw = await fs15.readFile(filePath, "utf8");
4268
+ const raw = await fs13.readFile(filePath, "utf8");
4301
4269
  if (raw.trim() === "") return null;
4302
4270
  return JSON.parse(stripLeadingLineComments3(raw));
4303
4271
  }
4304
4272
  async function backupConfigFile2(filePath) {
4305
4273
  const backupPath = `${filePath}.bak-${formatWindsurfBackupTimestamp()}`;
4306
- await fs15.copyFile(filePath, backupPath);
4274
+ await fs13.copyFile(filePath, backupPath);
4307
4275
  return backupPath;
4308
4276
  }
4309
4277
  function extractMemoraone(existing) {
@@ -4438,7 +4406,7 @@ async function setupWindsurfMcpConfig(options) {
4438
4406
  }
4439
4407
  if (!activeAlreadyCorrect) {
4440
4408
  await writeWindsurfMcpJsonAtomic(activePath, body);
4441
- const verifyRaw = await fs15.readFile(activePath, "utf8");
4409
+ const verifyRaw = await fs13.readFile(activePath, "utf8");
4442
4410
  const verifyParsed = JSON.parse(stripLeadingLineComments3(verifyRaw));
4443
4411
  validateWindsurfMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
4444
4412
  }
@@ -4517,10 +4485,10 @@ function logWindsurfMcpCliSummary(info, dryRun, println = console.log) {
4517
4485
  "[setup-ide-files] Refresh MCP servers in Devin Desktop settings, or restart Devin Desktop, for MCP changes to take effect."
4518
4486
  );
4519
4487
  }
4520
- var fs15, os6, path21, import_node_crypto6;
4488
+ var fs13, os6, path21, import_node_crypto6;
4521
4489
  var init_windsurfMcpConfig = __esm({
4522
4490
  "src/windsurfMcpConfig.ts"() {
4523
- fs15 = __toESM(require("fs/promises"), 1);
4491
+ fs13 = __toESM(require("fs/promises"), 1);
4524
4492
  os6 = __toESM(require("os"), 1);
4525
4493
  path21 = __toESM(require("path"), 1);
4526
4494
  import_node_crypto6 = require("crypto");
@@ -4536,7 +4504,7 @@ var init_windsurfMcpConfig = __esm({
4536
4504
  // src/opencodeMcpConfig.ts
4537
4505
  async function pathExists5(filePath) {
4538
4506
  try {
4539
- await fs16.access(filePath);
4507
+ await fs14.access(filePath);
4540
4508
  return true;
4541
4509
  } catch {
4542
4510
  return false;
@@ -4591,17 +4559,17 @@ function mergeOpenCodeMcpConfigObject(existing, memoraone) {
4591
4559
  }
4592
4560
  async function writeOpenCodeMcpJsonAtomic(filePath, content) {
4593
4561
  const dir = path22.dirname(filePath);
4594
- await fs16.mkdir(dir, { recursive: true });
4562
+ await fs14.mkdir(dir, { recursive: true });
4595
4563
  const tmpPath = path22.join(
4596
4564
  dir,
4597
4565
  `.${path22.basename(filePath)}.${process.pid}.${(0, import_node_crypto7.randomBytes)(8).toString("hex")}.tmp`
4598
4566
  );
4599
4567
  try {
4600
- await fs16.writeFile(tmpPath, content, "utf8");
4601
- await fs16.rename(tmpPath, filePath);
4568
+ await fs14.writeFile(tmpPath, content, "utf8");
4569
+ await fs14.rename(tmpPath, filePath);
4602
4570
  } catch (err) {
4603
4571
  try {
4604
- await fs16.unlink(tmpPath);
4572
+ await fs14.unlink(tmpPath);
4605
4573
  } catch {
4606
4574
  }
4607
4575
  throw err;
@@ -4626,7 +4594,7 @@ function validateOpenCodeMcpConfig(parsed2, expected) {
4626
4594
  }
4627
4595
  }
4628
4596
  async function readJsonConfig3(filePath) {
4629
- const raw = await fs16.readFile(filePath, "utf8");
4597
+ const raw = await fs14.readFile(filePath, "utf8");
4630
4598
  if (raw.trim() === "") return null;
4631
4599
  return JSON.parse(raw);
4632
4600
  }
@@ -4711,7 +4679,7 @@ async function setupOpenCodeMcpConfig(options) {
4711
4679
  return { outcome: jsonExists ? "updated" : "created", memoraone };
4712
4680
  }
4713
4681
  await writeOpenCodeMcpJsonAtomic(projectPath, body);
4714
- const verifyRaw = await fs16.readFile(projectPath, "utf8");
4682
+ const verifyRaw = await fs14.readFile(projectPath, "utf8");
4715
4683
  const verifyParsed = JSON.parse(verifyRaw);
4716
4684
  validateOpenCodeMcpConfig(verifyParsed, memoraone);
4717
4685
  return {
@@ -4736,10 +4704,10 @@ function logOpenCodeMcpCliSummary(info, dryRun, println = console.log) {
4736
4704
  "[setup-ide-files] Fully quit OpenCode and reopen this repo for MCP changes to take effect."
4737
4705
  );
4738
4706
  }
4739
- var fs16, path22, import_node_crypto7, OPENCODE_CONFIG_SCHEMA_URL, OpenCodeMcpJsonParseError, OpenCodeJsoncOnlyError;
4707
+ var fs14, path22, import_node_crypto7, OPENCODE_CONFIG_SCHEMA_URL, OpenCodeMcpJsonParseError, OpenCodeJsoncOnlyError;
4740
4708
  var init_opencodeMcpConfig = __esm({
4741
4709
  "src/opencodeMcpConfig.ts"() {
4742
- fs16 = __toESM(require("fs/promises"), 1);
4710
+ fs14 = __toESM(require("fs/promises"), 1);
4743
4711
  path22 = __toESM(require("path"), 1);
4744
4712
  import_node_crypto7 = require("crypto");
4745
4713
  init_configUtils();
@@ -4773,7 +4741,7 @@ var init_opencodeMcpConfig = __esm({
4773
4741
  // src/codexMcpConfig.ts
4774
4742
  async function pathExists6(filePath) {
4775
4743
  try {
4776
- await fs17.access(filePath);
4744
+ await fs15.access(filePath);
4777
4745
  return true;
4778
4746
  } catch {
4779
4747
  return false;
@@ -5036,17 +5004,17 @@ function parseCodexTomlOrThrow(source, configPath) {
5036
5004
  }
5037
5005
  async function writeCodexTomlAtomic(filePath, content) {
5038
5006
  const dir = path23.dirname(filePath);
5039
- await fs17.mkdir(dir, { recursive: true });
5007
+ await fs15.mkdir(dir, { recursive: true });
5040
5008
  const tmpPath = path23.join(
5041
5009
  dir,
5042
5010
  `.${path23.basename(filePath)}.${process.pid}.${(0, import_node_crypto8.randomBytes)(8).toString("hex")}.tmp`
5043
5011
  );
5044
5012
  try {
5045
- await fs17.writeFile(tmpPath, content, "utf8");
5046
- await fs17.rename(tmpPath, filePath);
5013
+ await fs15.writeFile(tmpPath, content, "utf8");
5014
+ await fs15.rename(tmpPath, filePath);
5047
5015
  } catch (err) {
5048
5016
  try {
5049
- await fs17.unlink(tmpPath);
5017
+ await fs15.unlink(tmpPath);
5050
5018
  } catch {
5051
5019
  }
5052
5020
  throw err;
@@ -5107,7 +5075,7 @@ async function setupCodexMcpConfig(options) {
5107
5075
  const exists = await pathExists6(projectPath);
5108
5076
  let existingRaw = null;
5109
5077
  if (exists) {
5110
- existingRaw = await fs17.readFile(projectPath, "utf8");
5078
+ existingRaw = await fs15.readFile(projectPath, "utf8");
5111
5079
  const parsed2 = parseCodexTomlOrThrow(existingRaw, projectPath);
5112
5080
  const current = extractMemoraoneFromCodexParsed(parsed2);
5113
5081
  if (memoraoneServerMatches5(current, memoraone)) {
@@ -5119,7 +5087,7 @@ async function setupCodexMcpConfig(options) {
5119
5087
  return { outcome: exists ? "updated" : "created", memoraone };
5120
5088
  }
5121
5089
  await writeCodexTomlAtomic(projectPath, next);
5122
- const verifyRaw = await fs17.readFile(projectPath, "utf8");
5090
+ const verifyRaw = await fs15.readFile(projectPath, "utf8");
5123
5091
  const verifyParsed = parseCodexTomlOrThrow(verifyRaw, projectPath);
5124
5092
  validateCodexMcpConfig(verifyParsed, memoraone);
5125
5093
  return {
@@ -5144,10 +5112,10 @@ function logCodexMcpCliSummary(info, dryRun, println = console.log) {
5144
5112
  "[setup-ide-files] Trust this project in Codex if prompted, then restart Codex."
5145
5113
  );
5146
5114
  }
5147
- var fs17, path23, import_node_crypto8, import_smol_toml, CODEX_MCP_SERVER_NAME, CODEX_OWNED_TABLE_PREFIX, CodexMcpTomlParseError, TABLE_HEADER_RE;
5115
+ var fs15, path23, import_node_crypto8, import_smol_toml, CODEX_MCP_SERVER_NAME, CODEX_OWNED_TABLE_PREFIX, CodexMcpTomlParseError, TABLE_HEADER_RE;
5148
5116
  var init_codexMcpConfig = __esm({
5149
5117
  "src/codexMcpConfig.ts"() {
5150
- fs17 = __toESM(require("fs/promises"), 1);
5118
+ fs15 = __toESM(require("fs/promises"), 1);
5151
5119
  path23 = __toESM(require("path"), 1);
5152
5120
  import_node_crypto8 = require("crypto");
5153
5121
  import_smol_toml = require("smol-toml");
@@ -5178,7 +5146,7 @@ function stripLeadingLineComments4(text) {
5178
5146
  }
5179
5147
  async function pathExists7(filePath) {
5180
5148
  try {
5181
- await fs18.access(filePath);
5149
+ await fs16.access(filePath);
5182
5150
  return true;
5183
5151
  } catch {
5184
5152
  return false;
@@ -5217,17 +5185,17 @@ function mergeKiroMcpConfigObject(existing, memoraone) {
5217
5185
  }
5218
5186
  async function writeKiroMcpJsonAtomic(filePath, content) {
5219
5187
  const dir = path24.dirname(filePath);
5220
- await fs18.mkdir(dir, { recursive: true });
5188
+ await fs16.mkdir(dir, { recursive: true });
5221
5189
  const tmpPath = path24.join(
5222
5190
  dir,
5223
5191
  `.${path24.basename(filePath)}.${process.pid}.${(0, import_node_crypto9.randomBytes)(8).toString("hex")}.tmp`
5224
5192
  );
5225
5193
  try {
5226
- await fs18.writeFile(tmpPath, content, "utf8");
5227
- await fs18.rename(tmpPath, filePath);
5194
+ await fs16.writeFile(tmpPath, content, "utf8");
5195
+ await fs16.rename(tmpPath, filePath);
5228
5196
  } catch (err) {
5229
5197
  try {
5230
- await fs18.unlink(tmpPath);
5198
+ await fs16.unlink(tmpPath);
5231
5199
  } catch {
5232
5200
  }
5233
5201
  throw err;
@@ -5252,7 +5220,7 @@ function validateKiroMcpConfig(parsed2, expected) {
5252
5220
  }
5253
5221
  }
5254
5222
  async function readJsonConfig4(filePath) {
5255
- const raw = await fs18.readFile(filePath, "utf8");
5223
+ const raw = await fs16.readFile(filePath, "utf8");
5256
5224
  if (raw.trim() === "") return null;
5257
5225
  return JSON.parse(stripLeadingLineComments4(raw));
5258
5226
  }
@@ -5332,7 +5300,7 @@ async function setupKiroMcpConfig(options) {
5332
5300
  return { outcome: exists ? "updated" : "created", memoraone };
5333
5301
  }
5334
5302
  await writeKiroMcpJsonAtomic(projectPath, body);
5335
- const verifyRaw = await fs18.readFile(projectPath, "utf8");
5303
+ const verifyRaw = await fs16.readFile(projectPath, "utf8");
5336
5304
  const verifyParsed = JSON.parse(stripLeadingLineComments4(verifyRaw));
5337
5305
  validateKiroMcpConfig(verifyParsed, memoraone);
5338
5306
  return {
@@ -5357,10 +5325,10 @@ function logKiroMcpCliSummary(info, dryRun, println = console.log) {
5357
5325
  "[setup-ide-files] Fully quit Kiro and reopen this repo for MCP changes to take effect."
5358
5326
  );
5359
5327
  }
5360
- var fs18, path24, import_node_crypto9, KiroMcpJsonParseError;
5328
+ var fs16, path24, import_node_crypto9, KiroMcpJsonParseError;
5361
5329
  var init_kiroMcpConfig = __esm({
5362
5330
  "src/kiroMcpConfig.ts"() {
5363
- fs18 = __toESM(require("fs/promises"), 1);
5331
+ fs16 = __toESM(require("fs/promises"), 1);
5364
5332
  path24 = __toESM(require("path"), 1);
5365
5333
  import_node_crypto9 = require("crypto");
5366
5334
  init_configUtils();
@@ -5387,7 +5355,7 @@ function stripLeadingLineComments5(text) {
5387
5355
  }
5388
5356
  async function pathExists8(filePath) {
5389
5357
  try {
5390
- await fs19.access(filePath);
5358
+ await fs17.access(filePath);
5391
5359
  return true;
5392
5360
  } catch {
5393
5361
  return false;
@@ -5427,17 +5395,17 @@ function mergeRooCodeMcpConfigObject(existing, memoraone) {
5427
5395
  }
5428
5396
  async function writeRooCodeMcpJsonAtomic(filePath, content) {
5429
5397
  const dir = path25.dirname(filePath);
5430
- await fs19.mkdir(dir, { recursive: true });
5398
+ await fs17.mkdir(dir, { recursive: true });
5431
5399
  const tmpPath = path25.join(
5432
5400
  dir,
5433
5401
  `.${path25.basename(filePath)}.${process.pid}.${(0, import_node_crypto10.randomBytes)(8).toString("hex")}.tmp`
5434
5402
  );
5435
5403
  try {
5436
- await fs19.writeFile(tmpPath, content, "utf8");
5437
- await fs19.rename(tmpPath, filePath);
5404
+ await fs17.writeFile(tmpPath, content, "utf8");
5405
+ await fs17.rename(tmpPath, filePath);
5438
5406
  } catch (err) {
5439
5407
  try {
5440
- await fs19.unlink(tmpPath);
5408
+ await fs17.unlink(tmpPath);
5441
5409
  } catch {
5442
5410
  }
5443
5411
  throw err;
@@ -5462,7 +5430,7 @@ function validateRooCodeMcpConfig(parsed2, expected) {
5462
5430
  }
5463
5431
  }
5464
5432
  async function readJsonConfig5(filePath) {
5465
- const raw = await fs19.readFile(filePath, "utf8");
5433
+ const raw = await fs17.readFile(filePath, "utf8");
5466
5434
  if (raw.trim() === "") return null;
5467
5435
  return JSON.parse(stripLeadingLineComments5(raw));
5468
5436
  }
@@ -5542,7 +5510,7 @@ async function setupRooCodeMcpConfig(options) {
5542
5510
  return { outcome: exists ? "updated" : "created", memoraone };
5543
5511
  }
5544
5512
  await writeRooCodeMcpJsonAtomic(projectPath, body);
5545
- const verifyRaw = await fs19.readFile(projectPath, "utf8");
5513
+ const verifyRaw = await fs17.readFile(projectPath, "utf8");
5546
5514
  const verifyParsed = JSON.parse(stripLeadingLineComments5(verifyRaw));
5547
5515
  validateRooCodeMcpConfig(verifyParsed, memoraone);
5548
5516
  return {
@@ -5573,10 +5541,10 @@ function logRooCodeMcpCliSummary(info, dryRun, println = console.log) {
5573
5541
  "[setup-ide-files] Fully quit Roo Code and reopen this repo for MCP changes to take effect."
5574
5542
  );
5575
5543
  }
5576
- var fs19, path25, import_node_crypto10, RooCodeMcpJsonParseError;
5544
+ var fs17, path25, import_node_crypto10, RooCodeMcpJsonParseError;
5577
5545
  var init_rooCodeMcpConfig = __esm({
5578
5546
  "src/rooCodeMcpConfig.ts"() {
5579
- fs19 = __toESM(require("fs/promises"), 1);
5547
+ fs17 = __toESM(require("fs/promises"), 1);
5580
5548
  path25 = __toESM(require("path"), 1);
5581
5549
  import_node_crypto10 = require("crypto");
5582
5550
  init_configUtils();
@@ -5603,7 +5571,7 @@ function stripLeadingLineComments6(text) {
5603
5571
  }
5604
5572
  async function pathExists9(filePath) {
5605
5573
  try {
5606
- await fs20.access(filePath);
5574
+ await fs18.access(filePath);
5607
5575
  return true;
5608
5576
  } catch {
5609
5577
  return false;
@@ -5657,17 +5625,17 @@ function mergeClineCliMcpConfigObject(existing, memoraone, ownership) {
5657
5625
  }
5658
5626
  async function writeClineCliMcpJsonAtomic(filePath, content) {
5659
5627
  const dir = path26.dirname(filePath);
5660
- await fs20.mkdir(dir, { recursive: true });
5628
+ await fs18.mkdir(dir, { recursive: true });
5661
5629
  const tmpPath = path26.join(
5662
5630
  dir,
5663
5631
  `.${path26.basename(filePath)}.${process.pid}.${(0, import_node_crypto11.randomBytes)(8).toString("hex")}.tmp`
5664
5632
  );
5665
5633
  try {
5666
- await fs20.writeFile(tmpPath, content, "utf8");
5667
- await fs20.rename(tmpPath, filePath);
5634
+ await fs18.writeFile(tmpPath, content, "utf8");
5635
+ await fs18.rename(tmpPath, filePath);
5668
5636
  } catch (err) {
5669
5637
  try {
5670
- await fs20.unlink(tmpPath);
5638
+ await fs18.unlink(tmpPath);
5671
5639
  } catch {
5672
5640
  }
5673
5641
  throw err;
@@ -5693,7 +5661,7 @@ function validateClineCliMcpConfig(parsed2, expected, serverName = CANONICAL_MEM
5693
5661
  }
5694
5662
  }
5695
5663
  async function readJsonConfig6(filePath) {
5696
- const raw = await fs20.readFile(filePath, "utf8");
5664
+ const raw = await fs18.readFile(filePath, "utf8");
5697
5665
  if (raw.trim() === "") return null;
5698
5666
  return JSON.parse(stripLeadingLineComments6(raw));
5699
5667
  }
@@ -5814,7 +5782,7 @@ async function setupClineCliMcpConfig(options) {
5814
5782
  for (const prepared of [rootPrepared, settingsPrepared]) {
5815
5783
  if (prepared.alreadyCorrect) continue;
5816
5784
  await writeClineCliMcpJsonAtomic(prepared.filePath, prepared.body);
5817
- const verifyRaw = await fs20.readFile(prepared.filePath, "utf8");
5785
+ const verifyRaw = await fs18.readFile(prepared.filePath, "utf8");
5818
5786
  const verifyParsed = JSON.parse(stripLeadingLineComments6(verifyRaw));
5819
5787
  validateClineCliMcpConfig(
5820
5788
  verifyParsed,
@@ -5855,10 +5823,10 @@ function logClineCliMcpCliSummary(info, dryRun, println = console.log) {
5855
5823
  "[setup-ide-files] Fully quit Cline CLI and reopen for MCP changes to take effect."
5856
5824
  );
5857
5825
  }
5858
- var fs20, os7, path26, import_node_crypto11, CLINE_CLI_MCP_TIMEOUT_SECONDS, ClineCliMcpJsonParseError;
5826
+ var fs18, os7, path26, import_node_crypto11, CLINE_CLI_MCP_TIMEOUT_SECONDS, ClineCliMcpJsonParseError;
5859
5827
  var init_clineCliMcpConfig = __esm({
5860
5828
  "src/clineCliMcpConfig.ts"() {
5861
- fs20 = __toESM(require("fs/promises"), 1);
5829
+ fs18 = __toESM(require("fs/promises"), 1);
5862
5830
  os7 = __toESM(require("os"), 1);
5863
5831
  path26 = __toESM(require("path"), 1);
5864
5832
  import_node_crypto11 = require("crypto");
@@ -5887,7 +5855,7 @@ function stripLeadingLineComments7(text) {
5887
5855
  }
5888
5856
  async function pathExists10(filePath) {
5889
5857
  try {
5890
- await fs21.access(filePath);
5858
+ await fs19.access(filePath);
5891
5859
  return true;
5892
5860
  } catch {
5893
5861
  return false;
@@ -5937,17 +5905,17 @@ function mergeClaudeDesktopMcpConfigObject(existing, memoraone, ownership) {
5937
5905
  }
5938
5906
  async function writeClaudeDesktopMcpJsonAtomic(filePath, content) {
5939
5907
  const dir = path27.dirname(filePath);
5940
- await fs21.mkdir(dir, { recursive: true });
5908
+ await fs19.mkdir(dir, { recursive: true });
5941
5909
  const tmpPath = path27.join(
5942
5910
  dir,
5943
5911
  `.${path27.basename(filePath)}.${process.pid}.${(0, import_node_crypto12.randomBytes)(8).toString("hex")}.tmp`
5944
5912
  );
5945
5913
  try {
5946
- await fs21.writeFile(tmpPath, content, "utf8");
5947
- await fs21.rename(tmpPath, filePath);
5914
+ await fs19.writeFile(tmpPath, content, "utf8");
5915
+ await fs19.rename(tmpPath, filePath);
5948
5916
  } catch (err) {
5949
5917
  try {
5950
- await fs21.unlink(tmpPath);
5918
+ await fs19.unlink(tmpPath);
5951
5919
  } catch {
5952
5920
  }
5953
5921
  throw err;
@@ -5973,13 +5941,13 @@ function validateClaudeDesktopMcpConfig(parsed2, expected, serverName = CANONICA
5973
5941
  }
5974
5942
  }
5975
5943
  async function readJsonConfig7(filePath) {
5976
- const raw = await fs21.readFile(filePath, "utf8");
5944
+ const raw = await fs19.readFile(filePath, "utf8");
5977
5945
  if (raw.trim() === "") return null;
5978
5946
  return JSON.parse(stripLeadingLineComments7(raw));
5979
5947
  }
5980
5948
  async function backupConfigFile3(filePath) {
5981
5949
  const backupPath = `${filePath}.bak-${formatClaudeDesktopBackupTimestamp()}`;
5982
- await fs21.copyFile(filePath, backupPath);
5950
+ await fs19.copyFile(filePath, backupPath);
5983
5951
  return backupPath;
5984
5952
  }
5985
5953
  async function buildClaudeDesktopMemoraoneServer(options) {
@@ -6066,7 +6034,7 @@ async function setupClaudeDesktopMcpConfig(options) {
6066
6034
  backupPath = await backupConfigFile3(activePath);
6067
6035
  }
6068
6036
  await writeClaudeDesktopMcpJsonAtomic(activePath, body);
6069
- const verifyRaw = await fs21.readFile(activePath, "utf8");
6037
+ const verifyRaw = await fs19.readFile(activePath, "utf8");
6070
6038
  const verifyParsed = JSON.parse(stripLeadingLineComments7(verifyRaw));
6071
6039
  validateClaudeDesktopMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
6072
6040
  return {
@@ -6102,10 +6070,10 @@ function logClaudeDesktopMcpCliSummary(info, dryRun, println = console.log) {
6102
6070
  "[setup-ide-files] Fully quit Claude Desktop and reopen for MCP changes to take effect."
6103
6071
  );
6104
6072
  }
6105
- var fs21, os8, path27, import_node_crypto12, ClaudeDesktopMcpJsonParseError;
6073
+ var fs19, os8, path27, import_node_crypto12, ClaudeDesktopMcpJsonParseError;
6106
6074
  var init_claudeDesktopMcpConfig = __esm({
6107
6075
  "src/claudeDesktopMcpConfig.ts"() {
6108
- fs21 = __toESM(require("fs/promises"), 1);
6076
+ fs19 = __toESM(require("fs/promises"), 1);
6109
6077
  os8 = __toESM(require("os"), 1);
6110
6078
  path27 = __toESM(require("path"), 1);
6111
6079
  import_node_crypto12 = require("crypto");
@@ -6133,7 +6101,7 @@ function stripLeadingLineComments8(text) {
6133
6101
  }
6134
6102
  async function pathExists11(filePath) {
6135
6103
  try {
6136
- await fs22.access(filePath);
6104
+ await fs20.access(filePath);
6137
6105
  return true;
6138
6106
  } catch {
6139
6107
  return false;
@@ -6176,17 +6144,17 @@ function mergeZedMcpConfigObject(existing, memoraone) {
6176
6144
  }
6177
6145
  async function writeZedMcpJsonAtomic(filePath, content) {
6178
6146
  const dir = path28.dirname(filePath);
6179
- await fs22.mkdir(dir, { recursive: true });
6147
+ await fs20.mkdir(dir, { recursive: true });
6180
6148
  const tmpPath = path28.join(
6181
6149
  dir,
6182
6150
  `.${path28.basename(filePath)}.${process.pid}.${(0, import_node_crypto13.randomBytes)(8).toString("hex")}.tmp`
6183
6151
  );
6184
6152
  try {
6185
- await fs22.writeFile(tmpPath, content, "utf8");
6186
- await fs22.rename(tmpPath, filePath);
6153
+ await fs20.writeFile(tmpPath, content, "utf8");
6154
+ await fs20.rename(tmpPath, filePath);
6187
6155
  } catch (err) {
6188
6156
  try {
6189
- await fs22.unlink(tmpPath);
6157
+ await fs20.unlink(tmpPath);
6190
6158
  } catch {
6191
6159
  }
6192
6160
  throw err;
@@ -6211,7 +6179,7 @@ function validateZedMcpConfig(parsed2, expected) {
6211
6179
  }
6212
6180
  }
6213
6181
  async function readJsonConfig8(filePath) {
6214
- const raw = await fs22.readFile(filePath, "utf8");
6182
+ const raw = await fs20.readFile(filePath, "utf8");
6215
6183
  if (raw.trim() === "") return null;
6216
6184
  return JSON.parse(stripLeadingLineComments8(raw));
6217
6185
  }
@@ -6291,7 +6259,7 @@ async function setupZedMcpConfig(options) {
6291
6259
  return { outcome: exists ? "updated" : "created", memoraone };
6292
6260
  }
6293
6261
  await writeZedMcpJsonAtomic(projectPath, body);
6294
- const verifyRaw = await fs22.readFile(projectPath, "utf8");
6262
+ const verifyRaw = await fs20.readFile(projectPath, "utf8");
6295
6263
  const verifyParsed = JSON.parse(stripLeadingLineComments8(verifyRaw));
6296
6264
  validateZedMcpConfig(verifyParsed, memoraone);
6297
6265
  return {
@@ -6320,10 +6288,10 @@ function logZedMcpCliSummary(info, dryRun, println = console.log) {
6320
6288
  "[setup-ide-files] Fully quit Zed and reopen this repo for MCP changes to take effect."
6321
6289
  );
6322
6290
  }
6323
- var fs22, path28, import_node_crypto13, ZedMcpJsonParseError;
6291
+ var fs20, path28, import_node_crypto13, ZedMcpJsonParseError;
6324
6292
  var init_zedMcpConfig = __esm({
6325
6293
  "src/zedMcpConfig.ts"() {
6326
- fs22 = __toESM(require("fs/promises"), 1);
6294
+ fs20 = __toESM(require("fs/promises"), 1);
6327
6295
  path28 = __toESM(require("path"), 1);
6328
6296
  import_node_crypto13 = require("crypto");
6329
6297
  init_configUtils();
@@ -6350,7 +6318,7 @@ function stripLeadingLineComments9(text) {
6350
6318
  }
6351
6319
  async function pathExists12(filePath) {
6352
6320
  try {
6353
- await fs23.access(filePath);
6321
+ await fs21.access(filePath);
6354
6322
  return true;
6355
6323
  } catch {
6356
6324
  return false;
@@ -6391,17 +6359,17 @@ function mergeVisualStudioMcpConfigObject(existing, memoraone) {
6391
6359
  }
6392
6360
  async function writeVisualStudioMcpJsonAtomic(filePath, content) {
6393
6361
  const dir = path29.dirname(filePath);
6394
- await fs23.mkdir(dir, { recursive: true });
6362
+ await fs21.mkdir(dir, { recursive: true });
6395
6363
  const tmpPath = path29.join(
6396
6364
  dir,
6397
6365
  `.${path29.basename(filePath)}.${process.pid}.${(0, import_node_crypto14.randomBytes)(8).toString("hex")}.tmp`
6398
6366
  );
6399
6367
  try {
6400
- await fs23.writeFile(tmpPath, content, "utf8");
6401
- await fs23.rename(tmpPath, filePath);
6368
+ await fs21.writeFile(tmpPath, content, "utf8");
6369
+ await fs21.rename(tmpPath, filePath);
6402
6370
  } catch (err) {
6403
6371
  try {
6404
- await fs23.unlink(tmpPath);
6372
+ await fs21.unlink(tmpPath);
6405
6373
  } catch {
6406
6374
  }
6407
6375
  throw err;
@@ -6426,7 +6394,7 @@ function validateVisualStudioMcpConfig(parsed2, expected) {
6426
6394
  }
6427
6395
  }
6428
6396
  async function readJsonConfig9(filePath) {
6429
- const raw = await fs23.readFile(filePath, "utf8");
6397
+ const raw = await fs21.readFile(filePath, "utf8");
6430
6398
  if (raw.trim() === "") return null;
6431
6399
  return JSON.parse(stripLeadingLineComments9(raw));
6432
6400
  }
@@ -6506,7 +6474,7 @@ async function setupVisualStudioMcpConfig(options) {
6506
6474
  return { outcome: exists ? "updated" : "created", memoraone };
6507
6475
  }
6508
6476
  await writeVisualStudioMcpJsonAtomic(projectPath, body);
6509
- const verifyRaw = await fs23.readFile(projectPath, "utf8");
6477
+ const verifyRaw = await fs21.readFile(projectPath, "utf8");
6510
6478
  const verifyParsed = JSON.parse(stripLeadingLineComments9(verifyRaw));
6511
6479
  validateVisualStudioMcpConfig(verifyParsed, memoraone);
6512
6480
  return {
@@ -6537,10 +6505,10 @@ function logVisualStudioMcpCliSummary(info, dryRun, println = console.log) {
6537
6505
  "[setup-ide-files] Fully quit Visual Studio and reopen this repo for MCP changes to take effect."
6538
6506
  );
6539
6507
  }
6540
- var fs23, path29, import_node_crypto14, VisualStudioMcpJsonParseError;
6508
+ var fs21, path29, import_node_crypto14, VisualStudioMcpJsonParseError;
6541
6509
  var init_visualStudioMcpConfig = __esm({
6542
6510
  "src/visualStudioMcpConfig.ts"() {
6543
- fs23 = __toESM(require("fs/promises"), 1);
6511
+ fs21 = __toESM(require("fs/promises"), 1);
6544
6512
  path29 = __toESM(require("path"), 1);
6545
6513
  import_node_crypto14 = require("crypto");
6546
6514
  init_configUtils();
@@ -6564,7 +6532,7 @@ var init_visualStudioMcpConfig = __esm({
6564
6532
  // src/continueMcpConfig.ts
6565
6533
  async function pathExists13(filePath) {
6566
6534
  try {
6567
- await fs24.access(filePath);
6535
+ await fs22.access(filePath);
6568
6536
  return true;
6569
6537
  } catch {
6570
6538
  return false;
@@ -6631,17 +6599,17 @@ function mergeContinueMcpConfigObject(existing, memoraone) {
6631
6599
  }
6632
6600
  async function writeContinueMcpYamlAtomic(filePath, content) {
6633
6601
  const dir = path30.dirname(filePath);
6634
- await fs24.mkdir(dir, { recursive: true });
6602
+ await fs22.mkdir(dir, { recursive: true });
6635
6603
  const tmpPath = path30.join(
6636
6604
  dir,
6637
6605
  `.${path30.basename(filePath)}.${process.pid}.${(0, import_node_crypto15.randomBytes)(8).toString("hex")}.tmp`
6638
6606
  );
6639
6607
  try {
6640
- await fs24.writeFile(tmpPath, content, "utf8");
6641
- await fs24.rename(tmpPath, filePath);
6608
+ await fs22.writeFile(tmpPath, content, "utf8");
6609
+ await fs22.rename(tmpPath, filePath);
6642
6610
  } catch (err) {
6643
6611
  try {
6644
- await fs24.unlink(tmpPath);
6612
+ await fs22.unlink(tmpPath);
6645
6613
  } catch {
6646
6614
  }
6647
6615
  throw err;
@@ -6736,7 +6704,7 @@ async function setupContinueMcpConfig(options) {
6736
6704
  let existing = null;
6737
6705
  if (exists) {
6738
6706
  try {
6739
- const raw = await fs24.readFile(projectPath, "utf8");
6707
+ const raw = await fs22.readFile(projectPath, "utf8");
6740
6708
  existing = parseContinueYaml(raw);
6741
6709
  } catch {
6742
6710
  throw new ContinueMcpYamlParseError(projectPath);
@@ -6761,7 +6729,7 @@ async function setupContinueMcpConfig(options) {
6761
6729
  return { outcome: exists ? "updated" : "created", memoraone };
6762
6730
  }
6763
6731
  await writeContinueMcpYamlAtomic(projectPath, body);
6764
- const verifyRaw = await fs24.readFile(projectPath, "utf8");
6732
+ const verifyRaw = await fs22.readFile(projectPath, "utf8");
6765
6733
  let verifyParsed;
6766
6734
  try {
6767
6735
  verifyParsed = (0, import_yaml.parse)(verifyRaw);
@@ -6795,10 +6763,10 @@ function logContinueMcpCliSummary(info, dryRun, println = console.log) {
6795
6763
  "[setup-ide-files] Fully quit Continue and reopen this repo for MCP changes to take effect."
6796
6764
  );
6797
6765
  }
6798
- var fs24, path30, import_node_crypto15, import_yaml, ContinueMcpYamlParseError;
6766
+ var fs22, path30, import_node_crypto15, import_yaml, ContinueMcpYamlParseError;
6799
6767
  var init_continueMcpConfig = __esm({
6800
6768
  "src/continueMcpConfig.ts"() {
6801
- fs24 = __toESM(require("fs/promises"), 1);
6769
+ fs22 = __toESM(require("fs/promises"), 1);
6802
6770
  path30 = __toESM(require("path"), 1);
6803
6771
  import_node_crypto15 = require("crypto");
6804
6772
  import_yaml = require("yaml");
@@ -6826,7 +6794,7 @@ function stripLeadingLineComments10(text) {
6826
6794
  }
6827
6795
  async function pathExists14(filePath) {
6828
6796
  try {
6829
- await fs25.access(filePath);
6797
+ await fs23.access(filePath);
6830
6798
  return true;
6831
6799
  } catch {
6832
6800
  return false;
@@ -6859,17 +6827,17 @@ function mergeClineMcpConfigObject(existing, memoraone) {
6859
6827
  }
6860
6828
  async function writeClineMcpJsonAtomic(filePath, content) {
6861
6829
  const dir = path31.dirname(filePath);
6862
- await fs25.mkdir(dir, { recursive: true });
6830
+ await fs23.mkdir(dir, { recursive: true });
6863
6831
  const tmpPath = path31.join(
6864
6832
  dir,
6865
6833
  `.${path31.basename(filePath)}.${process.pid}.${(0, import_node_crypto16.randomBytes)(8).toString("hex")}.tmp`
6866
6834
  );
6867
6835
  try {
6868
- await fs25.writeFile(tmpPath, content, "utf8");
6869
- await fs25.rename(tmpPath, filePath);
6836
+ await fs23.writeFile(tmpPath, content, "utf8");
6837
+ await fs23.rename(tmpPath, filePath);
6870
6838
  } catch (err) {
6871
6839
  try {
6872
- await fs25.unlink(tmpPath);
6840
+ await fs23.unlink(tmpPath);
6873
6841
  } catch {
6874
6842
  }
6875
6843
  throw err;
@@ -6892,13 +6860,13 @@ function validateClineMcpConfig(parsed2, expected) {
6892
6860
  }
6893
6861
  }
6894
6862
  async function readJsonConfig10(filePath) {
6895
- const raw = await fs25.readFile(filePath, "utf8");
6863
+ const raw = await fs23.readFile(filePath, "utf8");
6896
6864
  if (raw.trim() === "") return null;
6897
6865
  return JSON.parse(stripLeadingLineComments10(raw));
6898
6866
  }
6899
6867
  async function backupConfigFile4(filePath) {
6900
6868
  const backupPath = `${filePath}.bak-${formatClineBackupTimestamp()}`;
6901
- await fs25.copyFile(filePath, backupPath);
6869
+ await fs23.copyFile(filePath, backupPath);
6902
6870
  return backupPath;
6903
6871
  }
6904
6872
  async function buildClineMemoraoneServer(options) {
@@ -6964,7 +6932,7 @@ async function setupClineMcpConfig(options) {
6964
6932
  if (options.dryRun) return { activeConfigPath: configPath, outcome, memoraone };
6965
6933
  const backupPath = existed ? await backupConfigFile4(configPath) : void 0;
6966
6934
  await writeClineMcpJsonAtomic(configPath, JSON.stringify(merged, null, 2) + "\n");
6967
- validateClineMcpConfig(JSON.parse(await fs25.readFile(configPath, "utf8")), memoraone);
6935
+ validateClineMcpConfig(JSON.parse(await fs23.readFile(configPath, "utf8")), memoraone);
6968
6936
  return { activeConfigPath: configPath, outcome, backupPath, memoraone };
6969
6937
  }
6970
6938
  function logClineMcpCliSummary(info, dryRun, println = console.log) {
@@ -6980,11 +6948,11 @@ function logClineMcpCliSummary(info, dryRun, println = console.log) {
6980
6948
  if (info.npxPath) println(`[setup-ide-files] Resolved npx: ${info.npxPath}`);
6981
6949
  println("[setup-ide-files] Fully quit Cline and reopen this repository for MCP changes to take effect.");
6982
6950
  }
6983
- var import_node_crypto16, fs25, path31, ClineMcpJsonParseError;
6951
+ var import_node_crypto16, fs23, path31, ClineMcpJsonParseError;
6984
6952
  var init_clineMcpConfig = __esm({
6985
6953
  "src/clineMcpConfig.ts"() {
6986
6954
  import_node_crypto16 = require("crypto");
6987
- fs25 = __toESM(require("fs/promises"), 1);
6955
+ fs23 = __toESM(require("fs/promises"), 1);
6988
6956
  path31 = __toESM(require("path"), 1);
6989
6957
  init_configUtils();
6990
6958
  init_cursorGlobalMcpConfig();
@@ -7010,7 +6978,7 @@ function stripLeadingLineComments11(text) {
7010
6978
  }
7011
6979
  async function pathExists15(filePath) {
7012
6980
  try {
7013
- await fs26.access(filePath);
6981
+ await fs24.access(filePath);
7014
6982
  return true;
7015
6983
  } catch {
7016
6984
  return false;
@@ -7051,17 +7019,17 @@ function mergeCopilotCliMcpConfigObject(existing, memoraone) {
7051
7019
  }
7052
7020
  async function writeCopilotCliMcpJsonAtomic(filePath, content) {
7053
7021
  const dir = path32.dirname(filePath);
7054
- await fs26.mkdir(dir, { recursive: true });
7022
+ await fs24.mkdir(dir, { recursive: true });
7055
7023
  const tmpPath = path32.join(
7056
7024
  dir,
7057
7025
  `.${path32.basename(filePath)}.${process.pid}.${(0, import_node_crypto17.randomBytes)(8).toString("hex")}.tmp`
7058
7026
  );
7059
7027
  try {
7060
- await fs26.writeFile(tmpPath, content, "utf8");
7061
- await fs26.rename(tmpPath, filePath);
7028
+ await fs24.writeFile(tmpPath, content, "utf8");
7029
+ await fs24.rename(tmpPath, filePath);
7062
7030
  } catch (err) {
7063
7031
  try {
7064
- await fs26.unlink(tmpPath);
7032
+ await fs24.unlink(tmpPath);
7065
7033
  } catch {
7066
7034
  }
7067
7035
  throw err;
@@ -7086,7 +7054,7 @@ function validateCopilotCliMcpConfig(parsed2, expected) {
7086
7054
  }
7087
7055
  }
7088
7056
  async function readJsonConfig11(filePath) {
7089
- const raw = await fs26.readFile(filePath, "utf8");
7057
+ const raw = await fs24.readFile(filePath, "utf8");
7090
7058
  if (raw.trim() === "") return null;
7091
7059
  return JSON.parse(stripLeadingLineComments11(raw));
7092
7060
  }
@@ -7166,7 +7134,7 @@ async function setupCopilotCliMcpConfig(options) {
7166
7134
  return { outcome: exists ? "updated" : "created", memoraone };
7167
7135
  }
7168
7136
  await writeCopilotCliMcpJsonAtomic(projectPath, body);
7169
- const verifyRaw = await fs26.readFile(projectPath, "utf8");
7137
+ const verifyRaw = await fs24.readFile(projectPath, "utf8");
7170
7138
  const verifyParsed = JSON.parse(stripLeadingLineComments11(verifyRaw));
7171
7139
  validateCopilotCliMcpConfig(verifyParsed, memoraone);
7172
7140
  return {
@@ -7197,10 +7165,10 @@ function logCopilotCliMcpCliSummary(info, dryRun, println = console.log) {
7197
7165
  "[setup-ide-files] Fully quit Copilot CLI and reopen this repo for MCP changes to take effect."
7198
7166
  );
7199
7167
  }
7200
- var fs26, path32, import_node_crypto17, CopilotCliMcpJsonParseError;
7168
+ var fs24, path32, import_node_crypto17, CopilotCliMcpJsonParseError;
7201
7169
  var init_copilotCliMcpConfig = __esm({
7202
7170
  "src/copilotCliMcpConfig.ts"() {
7203
- fs26 = __toESM(require("fs/promises"), 1);
7171
+ fs24 = __toESM(require("fs/promises"), 1);
7204
7172
  path32 = __toESM(require("path"), 1);
7205
7173
  import_node_crypto17 = require("crypto");
7206
7174
  init_configUtils();
@@ -7227,7 +7195,7 @@ function stripLeadingLineComments12(text) {
7227
7195
  }
7228
7196
  async function pathExists16(filePath) {
7229
7197
  try {
7230
- await fs27.access(filePath);
7198
+ await fs25.access(filePath);
7231
7199
  return true;
7232
7200
  } catch {
7233
7201
  return false;
@@ -7267,17 +7235,17 @@ function mergeAuggieMcpConfigObject(existing, memoraone) {
7267
7235
  }
7268
7236
  async function writeAuggieMcpJsonAtomic(filePath, content) {
7269
7237
  const dir = path33.dirname(filePath);
7270
- await fs27.mkdir(dir, { recursive: true });
7238
+ await fs25.mkdir(dir, { recursive: true });
7271
7239
  const tmpPath = path33.join(
7272
7240
  dir,
7273
7241
  `.${path33.basename(filePath)}.${process.pid}.${(0, import_node_crypto18.randomBytes)(8).toString("hex")}.tmp`
7274
7242
  );
7275
7243
  try {
7276
- await fs27.writeFile(tmpPath, content, "utf8");
7277
- await fs27.rename(tmpPath, filePath);
7244
+ await fs25.writeFile(tmpPath, content, "utf8");
7245
+ await fs25.rename(tmpPath, filePath);
7278
7246
  } catch (err) {
7279
7247
  try {
7280
- await fs27.unlink(tmpPath);
7248
+ await fs25.unlink(tmpPath);
7281
7249
  } catch {
7282
7250
  }
7283
7251
  throw err;
@@ -7302,7 +7270,7 @@ function validateAuggieMcpConfig(parsed2, expected) {
7302
7270
  }
7303
7271
  }
7304
7272
  async function readJsonConfig12(filePath) {
7305
- const raw = await fs27.readFile(filePath, "utf8");
7273
+ const raw = await fs25.readFile(filePath, "utf8");
7306
7274
  if (raw.trim() === "") return null;
7307
7275
  return JSON.parse(stripLeadingLineComments12(raw));
7308
7276
  }
@@ -7382,7 +7350,7 @@ async function setupAuggieMcpConfig(options) {
7382
7350
  return { outcome: exists ? "updated" : "created", memoraone };
7383
7351
  }
7384
7352
  await writeAuggieMcpJsonAtomic(projectPath, body);
7385
- const verifyRaw = await fs27.readFile(projectPath, "utf8");
7353
+ const verifyRaw = await fs25.readFile(projectPath, "utf8");
7386
7354
  const verifyParsed = JSON.parse(stripLeadingLineComments12(verifyRaw));
7387
7355
  validateAuggieMcpConfig(verifyParsed, memoraone);
7388
7356
  return {
@@ -7413,10 +7381,10 @@ function logAuggieMcpCliSummary(info, dryRun, println = console.log) {
7413
7381
  "[setup-ide-files] Fully quit Augment Code / Auggie and reopen this repo for MCP changes to take effect."
7414
7382
  );
7415
7383
  }
7416
- var fs27, path33, import_node_crypto18, AuggieMcpJsonParseError;
7384
+ var fs25, path33, import_node_crypto18, AuggieMcpJsonParseError;
7417
7385
  var init_auggieMcpConfig = __esm({
7418
7386
  "src/auggieMcpConfig.ts"() {
7419
- fs27 = __toESM(require("fs/promises"), 1);
7387
+ fs25 = __toESM(require("fs/promises"), 1);
7420
7388
  path33 = __toESM(require("path"), 1);
7421
7389
  import_node_crypto18 = require("crypto");
7422
7390
  init_configUtils();
@@ -7443,7 +7411,7 @@ function stripLeadingLineComments13(text) {
7443
7411
  }
7444
7412
  async function pathExists17(filePath) {
7445
7413
  try {
7446
- await fs28.access(filePath);
7414
+ await fs26.access(filePath);
7447
7415
  return true;
7448
7416
  } catch {
7449
7417
  return false;
@@ -7483,17 +7451,17 @@ function mergeGeminiCliMcpConfigObject(existing, memoraone) {
7483
7451
  }
7484
7452
  async function writeGeminiCliMcpJsonAtomic(filePath, content) {
7485
7453
  const dir = path34.dirname(filePath);
7486
- await fs28.mkdir(dir, { recursive: true });
7454
+ await fs26.mkdir(dir, { recursive: true });
7487
7455
  const tmpPath = path34.join(
7488
7456
  dir,
7489
7457
  `.${path34.basename(filePath)}.${process.pid}.${(0, import_node_crypto19.randomBytes)(8).toString("hex")}.tmp`
7490
7458
  );
7491
7459
  try {
7492
- await fs28.writeFile(tmpPath, content, "utf8");
7493
- await fs28.rename(tmpPath, filePath);
7460
+ await fs26.writeFile(tmpPath, content, "utf8");
7461
+ await fs26.rename(tmpPath, filePath);
7494
7462
  } catch (err) {
7495
7463
  try {
7496
- await fs28.unlink(tmpPath);
7464
+ await fs26.unlink(tmpPath);
7497
7465
  } catch {
7498
7466
  }
7499
7467
  throw err;
@@ -7518,7 +7486,7 @@ function validateGeminiCliMcpConfig(parsed2, expected) {
7518
7486
  }
7519
7487
  }
7520
7488
  async function readJsonConfig13(filePath) {
7521
- const raw = await fs28.readFile(filePath, "utf8");
7489
+ const raw = await fs26.readFile(filePath, "utf8");
7522
7490
  if (raw.trim() === "") return null;
7523
7491
  return JSON.parse(stripLeadingLineComments13(raw));
7524
7492
  }
@@ -7598,7 +7566,7 @@ async function setupGeminiCliMcpConfig(options) {
7598
7566
  return { outcome: exists ? "updated" : "created", memoraone };
7599
7567
  }
7600
7568
  await writeGeminiCliMcpJsonAtomic(projectPath, body);
7601
- const verifyRaw = await fs28.readFile(projectPath, "utf8");
7569
+ const verifyRaw = await fs26.readFile(projectPath, "utf8");
7602
7570
  const verifyParsed = JSON.parse(stripLeadingLineComments13(verifyRaw));
7603
7571
  validateGeminiCliMcpConfig(verifyParsed, memoraone);
7604
7572
  return {
@@ -7629,10 +7597,10 @@ function logGeminiCliMcpCliSummary(info, dryRun, println = console.log) {
7629
7597
  "[setup-ide-files] Fully quit Gemini CLI and reopen this repo for MCP changes to take effect."
7630
7598
  );
7631
7599
  }
7632
- var fs28, path34, import_node_crypto19, GeminiCliMcpJsonParseError;
7600
+ var fs26, path34, import_node_crypto19, GeminiCliMcpJsonParseError;
7633
7601
  var init_geminiCliMcpConfig = __esm({
7634
7602
  "src/geminiCliMcpConfig.ts"() {
7635
- fs28 = __toESM(require("fs/promises"), 1);
7603
+ fs26 = __toESM(require("fs/promises"), 1);
7636
7604
  path34 = __toESM(require("path"), 1);
7637
7605
  import_node_crypto19 = require("crypto");
7638
7606
  init_configUtils();
@@ -7659,7 +7627,7 @@ function stripLeadingLineComments14(text) {
7659
7627
  }
7660
7628
  async function pathExists18(filePath) {
7661
7629
  try {
7662
- await fs29.access(filePath);
7630
+ await fs27.access(filePath);
7663
7631
  return true;
7664
7632
  } catch {
7665
7633
  return false;
@@ -7723,17 +7691,17 @@ function stripMemoraoneFromAntigravityConfigObject(existing) {
7723
7691
  }
7724
7692
  async function writeAntigravityMcpJsonAtomic(filePath, content) {
7725
7693
  const dir = path35.dirname(filePath);
7726
- await fs29.mkdir(dir, { recursive: true });
7694
+ await fs27.mkdir(dir, { recursive: true });
7727
7695
  const tmpPath = path35.join(
7728
7696
  dir,
7729
7697
  `.${path35.basename(filePath)}.${process.pid}.${(0, import_node_crypto20.randomBytes)(8).toString("hex")}.tmp`
7730
7698
  );
7731
7699
  try {
7732
- await fs29.writeFile(tmpPath, content, "utf8");
7733
- await fs29.rename(tmpPath, filePath);
7700
+ await fs27.writeFile(tmpPath, content, "utf8");
7701
+ await fs27.rename(tmpPath, filePath);
7734
7702
  } catch (err) {
7735
7703
  try {
7736
- await fs29.unlink(tmpPath);
7704
+ await fs27.unlink(tmpPath);
7737
7705
  } catch {
7738
7706
  }
7739
7707
  throw err;
@@ -7759,7 +7727,7 @@ function validateAntigravityMcpConfig(parsed2, expected, serverName = CANONICAL_
7759
7727
  }
7760
7728
  }
7761
7729
  async function readJsonConfig14(filePath) {
7762
- const raw = await fs29.readFile(filePath, "utf8");
7730
+ const raw = await fs27.readFile(filePath, "utf8");
7763
7731
  if (raw.trim() === "") return null;
7764
7732
  return JSON.parse(stripLeadingLineComments14(raw));
7765
7733
  }
@@ -7879,7 +7847,7 @@ async function setupAntigravityMcpConfig(options) {
7879
7847
  };
7880
7848
  }
7881
7849
  await writeAntigravityMcpJsonAtomic(activePath, body);
7882
- const verifyRaw = await fs29.readFile(activePath, "utf8");
7850
+ const verifyRaw = await fs27.readFile(activePath, "utf8");
7883
7851
  const verifyParsed = JSON.parse(stripLeadingLineComments14(verifyRaw));
7884
7852
  validateAntigravityMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
7885
7853
  return {
@@ -7918,7 +7886,7 @@ async function setupAntigravityMcpConfig(options) {
7918
7886
  }
7919
7887
  if (!activeAlreadyCorrect) {
7920
7888
  await writeAntigravityMcpJsonAtomic(activePath, body);
7921
- const verifyRaw = await fs29.readFile(activePath, "utf8");
7889
+ const verifyRaw = await fs27.readFile(activePath, "utf8");
7922
7890
  const verifyParsed = JSON.parse(stripLeadingLineComments14(verifyRaw));
7923
7891
  validateAntigravityMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
7924
7892
  }
@@ -8000,11 +7968,11 @@ function logAntigravityMcpCliSummary(info, dryRun, println = console.log) {
8000
7968
  "[setup-ide-files] Fully quit Antigravity and reopen for MCP changes to take effect."
8001
7969
  );
8002
7970
  }
8003
- var fsSync, fs29, os9, path35, import_node_crypto20, AntigravityMcpJsonParseError;
7971
+ var fsSync, fs27, os9, path35, import_node_crypto20, AntigravityMcpJsonParseError;
8004
7972
  var init_antigravityMcpConfig = __esm({
8005
7973
  "src/antigravityMcpConfig.ts"() {
8006
7974
  fsSync = __toESM(require("fs"), 1);
8007
- fs29 = __toESM(require("fs/promises"), 1);
7975
+ fs27 = __toESM(require("fs/promises"), 1);
8008
7976
  os9 = __toESM(require("os"), 1);
8009
7977
  path35 = __toESM(require("path"), 1);
8010
7978
  import_node_crypto20 = require("crypto");
@@ -8029,7 +7997,7 @@ var init_antigravityMcpConfig = __esm({
8029
7997
  // src/gooseMcpConfig.ts
8030
7998
  async function pathExists19(filePath) {
8031
7999
  try {
8032
- await fs30.access(filePath);
8000
+ await fs28.access(filePath);
8033
8001
  return true;
8034
8002
  } catch {
8035
8003
  return false;
@@ -8153,17 +8121,17 @@ function mergeGooseMcpConfigObject(existing, memoraone, ownership) {
8153
8121
  }
8154
8122
  async function writeGooseMcpYamlAtomic(filePath, content) {
8155
8123
  const dir = path36.dirname(filePath);
8156
- await fs30.mkdir(dir, { recursive: true });
8124
+ await fs28.mkdir(dir, { recursive: true });
8157
8125
  const tmpPath = path36.join(
8158
8126
  dir,
8159
8127
  `.${path36.basename(filePath)}.${process.pid}.${(0, import_node_crypto21.randomBytes)(8).toString("hex")}.tmp`
8160
8128
  );
8161
8129
  try {
8162
- await fs30.writeFile(tmpPath, content, "utf8");
8163
- await fs30.rename(tmpPath, filePath);
8130
+ await fs28.writeFile(tmpPath, content, "utf8");
8131
+ await fs28.rename(tmpPath, filePath);
8164
8132
  } catch (err) {
8165
8133
  try {
8166
- await fs30.unlink(tmpPath);
8134
+ await fs28.unlink(tmpPath);
8167
8135
  } catch {
8168
8136
  }
8169
8137
  throw err;
@@ -8259,7 +8227,7 @@ async function setupGooseMcpConfig(options) {
8259
8227
  let existing = null;
8260
8228
  if (exists) {
8261
8229
  try {
8262
- const raw = await fs30.readFile(activePath, "utf8");
8230
+ const raw = await fs28.readFile(activePath, "utf8");
8263
8231
  existing = parseGooseYaml(raw);
8264
8232
  } catch {
8265
8233
  throw new GooseMcpYamlParseError(activePath);
@@ -8284,7 +8252,7 @@ async function setupGooseMcpConfig(options) {
8284
8252
  };
8285
8253
  }
8286
8254
  await writeGooseMcpYamlAtomic(activePath, body);
8287
- const verifyRaw = await fs30.readFile(activePath, "utf8");
8255
+ const verifyRaw = await fs28.readFile(activePath, "utf8");
8288
8256
  let verifyParsed;
8289
8257
  try {
8290
8258
  verifyParsed = (0, import_yaml2.parse)(verifyRaw);
@@ -8319,10 +8287,10 @@ function logGooseMcpCliSummary(info, dryRun, println = console.log) {
8319
8287
  "[setup-ide-files] Fully quit Goose and reopen for MCP changes to take effect."
8320
8288
  );
8321
8289
  }
8322
- var fs30, os10, path36, import_node_crypto21, import_yaml2, GooseMcpYamlParseError, MEMORAONE_PACKAGE_SPEC_RE2;
8290
+ var fs28, os10, path36, import_node_crypto21, import_yaml2, GooseMcpYamlParseError, MEMORAONE_PACKAGE_SPEC_RE2;
8323
8291
  var init_gooseMcpConfig = __esm({
8324
8292
  "src/gooseMcpConfig.ts"() {
8325
- fs30 = __toESM(require("fs/promises"), 1);
8293
+ fs28 = __toESM(require("fs/promises"), 1);
8326
8294
  os10 = __toESM(require("os"), 1);
8327
8295
  path36 = __toESM(require("path"), 1);
8328
8296
  import_node_crypto21 = require("crypto");
@@ -8352,7 +8320,7 @@ function stripLeadingLineComments15(text) {
8352
8320
  }
8353
8321
  async function pathExists20(filePath) {
8354
8322
  try {
8355
- await fs31.access(filePath);
8323
+ await fs29.access(filePath);
8356
8324
  return true;
8357
8325
  } catch {
8358
8326
  return false;
@@ -8392,17 +8360,17 @@ function mergeJunieMcpConfigObject(existing, memoraone) {
8392
8360
  }
8393
8361
  async function writeJunieMcpJsonAtomic(filePath, content) {
8394
8362
  const dir = path37.dirname(filePath);
8395
- await fs31.mkdir(dir, { recursive: true });
8363
+ await fs29.mkdir(dir, { recursive: true });
8396
8364
  const tmpPath = path37.join(
8397
8365
  dir,
8398
8366
  `.${path37.basename(filePath)}.${process.pid}.${(0, import_node_crypto22.randomBytes)(8).toString("hex")}.tmp`
8399
8367
  );
8400
8368
  try {
8401
- await fs31.writeFile(tmpPath, content, "utf8");
8402
- await fs31.rename(tmpPath, filePath);
8369
+ await fs29.writeFile(tmpPath, content, "utf8");
8370
+ await fs29.rename(tmpPath, filePath);
8403
8371
  } catch (err) {
8404
8372
  try {
8405
- await fs31.unlink(tmpPath);
8373
+ await fs29.unlink(tmpPath);
8406
8374
  } catch {
8407
8375
  }
8408
8376
  throw err;
@@ -8427,7 +8395,7 @@ function validateJunieMcpConfig(parsed2, expected) {
8427
8395
  }
8428
8396
  }
8429
8397
  async function readJsonConfig15(filePath) {
8430
- const raw = await fs31.readFile(filePath, "utf8");
8398
+ const raw = await fs29.readFile(filePath, "utf8");
8431
8399
  if (raw.trim() === "") return null;
8432
8400
  return JSON.parse(stripLeadingLineComments15(raw));
8433
8401
  }
@@ -8507,7 +8475,7 @@ async function setupJunieMcpConfig(options) {
8507
8475
  return { outcome: exists ? "updated" : "created", memoraone };
8508
8476
  }
8509
8477
  await writeJunieMcpJsonAtomic(projectPath, body);
8510
- const verifyRaw = await fs31.readFile(projectPath, "utf8");
8478
+ const verifyRaw = await fs29.readFile(projectPath, "utf8");
8511
8479
  const verifyParsed = JSON.parse(stripLeadingLineComments15(verifyRaw));
8512
8480
  validateJunieMcpConfig(verifyParsed, memoraone);
8513
8481
  return {
@@ -8538,10 +8506,10 @@ function logJunieMcpCliSummary(info, dryRun, println = console.log) {
8538
8506
  "[setup-ide-files] Fully quit JetBrains IDE / Junie and reopen this repo for MCP changes to take effect."
8539
8507
  );
8540
8508
  }
8541
- var fs31, path37, import_node_crypto22, JunieMcpJsonParseError;
8509
+ var fs29, path37, import_node_crypto22, JunieMcpJsonParseError;
8542
8510
  var init_junieMcpConfig = __esm({
8543
8511
  "src/junieMcpConfig.ts"() {
8544
- fs31 = __toESM(require("fs/promises"), 1);
8512
+ fs29 = __toESM(require("fs/promises"), 1);
8545
8513
  path37 = __toESM(require("path"), 1);
8546
8514
  import_node_crypto22 = require("crypto");
8547
8515
  init_configUtils();
@@ -8568,7 +8536,7 @@ function stripLeadingLineComments16(text) {
8568
8536
  }
8569
8537
  async function pathExists21(filePath) {
8570
8538
  try {
8571
- await fs32.access(filePath);
8539
+ await fs30.access(filePath);
8572
8540
  return true;
8573
8541
  } catch {
8574
8542
  return false;
@@ -8609,17 +8577,17 @@ function mergeXcodeMcpConfigObject(existing, memoraone, ownership) {
8609
8577
  }
8610
8578
  async function writeXcodeMcpJsonAtomic(filePath, content) {
8611
8579
  const dir = path38.dirname(filePath);
8612
- await fs32.mkdir(dir, { recursive: true });
8580
+ await fs30.mkdir(dir, { recursive: true });
8613
8581
  const tmpPath = path38.join(
8614
8582
  dir,
8615
8583
  `.${path38.basename(filePath)}.${process.pid}.${(0, import_node_crypto23.randomBytes)(8).toString("hex")}.tmp`
8616
8584
  );
8617
8585
  try {
8618
- await fs32.writeFile(tmpPath, content, "utf8");
8619
- await fs32.rename(tmpPath, filePath);
8586
+ await fs30.writeFile(tmpPath, content, "utf8");
8587
+ await fs30.rename(tmpPath, filePath);
8620
8588
  } catch (err) {
8621
8589
  try {
8622
- await fs32.unlink(tmpPath);
8590
+ await fs30.unlink(tmpPath);
8623
8591
  } catch {
8624
8592
  }
8625
8593
  throw err;
@@ -8645,7 +8613,7 @@ function validateXcodeMcpConfig(parsed2, expected, serverName = CANONICAL_MEMORA
8645
8613
  }
8646
8614
  }
8647
8615
  async function readJsonConfig16(filePath) {
8648
- const raw = await fs32.readFile(filePath, "utf8");
8616
+ const raw = await fs30.readFile(filePath, "utf8");
8649
8617
  if (raw.trim() === "") return null;
8650
8618
  return JSON.parse(stripLeadingLineComments16(raw));
8651
8619
  }
@@ -8729,7 +8697,7 @@ async function setupXcodeMcpConfig(options) {
8729
8697
  };
8730
8698
  }
8731
8699
  await writeXcodeMcpJsonAtomic(activePath, body);
8732
- const verifyRaw = await fs32.readFile(activePath, "utf8");
8700
+ const verifyRaw = await fs30.readFile(activePath, "utf8");
8733
8701
  const verifyParsed = JSON.parse(stripLeadingLineComments16(verifyRaw));
8734
8702
  validateXcodeMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
8735
8703
  return {
@@ -8759,10 +8727,10 @@ function logXcodeMcpCliSummary(info, dryRun, println = console.log) {
8759
8727
  "[setup-ide-files] Fully quit Xcode / Copilot for Xcode and reopen for MCP changes to take effect."
8760
8728
  );
8761
8729
  }
8762
- var fs32, os11, path38, import_node_crypto23, XcodeMcpJsonParseError;
8730
+ var fs30, os11, path38, import_node_crypto23, XcodeMcpJsonParseError;
8763
8731
  var init_xcodeMcpConfig = __esm({
8764
8732
  "src/xcodeMcpConfig.ts"() {
8765
- fs32 = __toESM(require("fs/promises"), 1);
8733
+ fs30 = __toESM(require("fs/promises"), 1);
8766
8734
  os11 = __toESM(require("os"), 1);
8767
8735
  path38 = __toESM(require("path"), 1);
8768
8736
  import_node_crypto23 = require("crypto");
@@ -8790,7 +8758,7 @@ function stripLeadingLineComments17(text) {
8790
8758
  }
8791
8759
  async function pathExists22(filePath) {
8792
8760
  try {
8793
- await fs33.access(filePath);
8761
+ await fs31.access(filePath);
8794
8762
  return true;
8795
8763
  } catch {
8796
8764
  return false;
@@ -8831,17 +8799,17 @@ function mergeCopilotJetBrainsMcpConfigObject(existing, memoraone, ownership) {
8831
8799
  }
8832
8800
  async function writeCopilotJetBrainsMcpJsonAtomic(filePath, content) {
8833
8801
  const dir = path39.dirname(filePath);
8834
- await fs33.mkdir(dir, { recursive: true });
8802
+ await fs31.mkdir(dir, { recursive: true });
8835
8803
  const tmpPath = path39.join(
8836
8804
  dir,
8837
8805
  `.${path39.basename(filePath)}.${process.pid}.${(0, import_node_crypto24.randomBytes)(8).toString("hex")}.tmp`
8838
8806
  );
8839
8807
  try {
8840
- await fs33.writeFile(tmpPath, content, "utf8");
8841
- await fs33.rename(tmpPath, filePath);
8808
+ await fs31.writeFile(tmpPath, content, "utf8");
8809
+ await fs31.rename(tmpPath, filePath);
8842
8810
  } catch (err) {
8843
8811
  try {
8844
- await fs33.unlink(tmpPath);
8812
+ await fs31.unlink(tmpPath);
8845
8813
  } catch {
8846
8814
  }
8847
8815
  throw err;
@@ -8871,7 +8839,7 @@ function validateCopilotJetBrainsMcpConfig(parsed2, expected, serverName = CANON
8871
8839
  }
8872
8840
  }
8873
8841
  async function readJsonConfig17(filePath) {
8874
- const raw = await fs33.readFile(filePath, "utf8");
8842
+ const raw = await fs31.readFile(filePath, "utf8");
8875
8843
  if (raw.trim() === "") return null;
8876
8844
  return JSON.parse(stripLeadingLineComments17(raw));
8877
8845
  }
@@ -8955,7 +8923,7 @@ async function setupCopilotJetBrainsMcpConfig(options) {
8955
8923
  };
8956
8924
  }
8957
8925
  await writeCopilotJetBrainsMcpJsonAtomic(activePath, body);
8958
- const verifyRaw = await fs33.readFile(activePath, "utf8");
8926
+ const verifyRaw = await fs31.readFile(activePath, "utf8");
8959
8927
  const verifyParsed = JSON.parse(stripLeadingLineComments17(verifyRaw));
8960
8928
  validateCopilotJetBrainsMcpConfig(verifyParsed, memoraone, options.ownership ? memoraoneServerNameForRepositoryBinding(options.ownership.repositoryBindingId) : CANONICAL_MEMORAONE_MCP_SERVER_NAME);
8961
8929
  return {
@@ -8989,10 +8957,10 @@ function logCopilotJetBrainsMcpCliSummary(info, dryRun, println = console.log) {
8989
8957
  "[setup-ide-files] Fully quit JetBrains IDE / GitHub Copilot and reopen for MCP changes to take effect."
8990
8958
  );
8991
8959
  }
8992
- var fs33, os12, path39, import_node_crypto24, CopilotJetBrainsMcpJsonParseError;
8960
+ var fs31, os12, path39, import_node_crypto24, CopilotJetBrainsMcpJsonParseError;
8993
8961
  var init_copilotJetBrainsMcpConfig = __esm({
8994
8962
  "src/copilotJetBrainsMcpConfig.ts"() {
8995
- fs33 = __toESM(require("fs/promises"), 1);
8963
+ fs31 = __toESM(require("fs/promises"), 1);
8996
8964
  os12 = __toESM(require("os"), 1);
8997
8965
  path39 = __toESM(require("path"), 1);
8998
8966
  import_node_crypto24 = require("crypto");
@@ -9596,7 +9564,7 @@ function assertUnderRepoRoot(repoRoot, absPath) {
9596
9564
  }
9597
9565
  async function pathExists23(filePath) {
9598
9566
  try {
9599
- await fs34.access(filePath);
9567
+ await fs32.access(filePath);
9600
9568
  return true;
9601
9569
  } catch {
9602
9570
  return false;
@@ -9693,17 +9661,17 @@ function buildVscodeMcpJsonBody(existing, options = {}) {
9693
9661
  }
9694
9662
  async function writeSharedMcpJsonAtomic(filePath, content) {
9695
9663
  const dir = path40.dirname(filePath);
9696
- await fs34.mkdir(dir, { recursive: true });
9664
+ await fs32.mkdir(dir, { recursive: true });
9697
9665
  const tmpPath = path40.join(
9698
9666
  dir,
9699
9667
  `.${path40.basename(filePath)}.${process.pid}.${(0, import_node_crypto25.randomBytes)(8).toString("hex")}.tmp`
9700
9668
  );
9701
9669
  try {
9702
- await fs34.writeFile(tmpPath, content, "utf8");
9703
- await fs34.rename(tmpPath, filePath);
9670
+ await fs32.writeFile(tmpPath, content, "utf8");
9671
+ await fs32.rename(tmpPath, filePath);
9704
9672
  } catch (err) {
9705
9673
  try {
9706
- await fs34.unlink(tmpPath);
9674
+ await fs32.unlink(tmpPath);
9707
9675
  } catch {
9708
9676
  }
9709
9677
  throw err;
@@ -9723,7 +9691,7 @@ async function writeClaudeCodeMcpJson(repoRoot, buildBody, opts) {
9723
9691
  let raw = "";
9724
9692
  let existed = false;
9725
9693
  try {
9726
- raw = await fs34.readFile(abs, "utf8");
9694
+ raw = await fs32.readFile(abs, "utf8");
9727
9695
  existed = true;
9728
9696
  } catch (err) {
9729
9697
  if (err?.code !== "ENOENT") throw err;
@@ -9755,28 +9723,28 @@ async function writeManagedMarkdown(repoRoot, relPath, fullContent, opts) {
9755
9723
  let prior = "";
9756
9724
  let existed = false;
9757
9725
  try {
9758
- prior = await fs34.readFile(abs, "utf8");
9726
+ prior = await fs32.readFile(abs, "utf8");
9759
9727
  existed = true;
9760
9728
  } catch (err) {
9761
9729
  if (err?.code !== "ENOENT") throw err;
9762
9730
  }
9763
9731
  if (!existed) {
9764
9732
  if (opts.dryRun) return "created";
9765
- await fs34.mkdir(path40.dirname(abs), { recursive: true });
9766
- await fs34.writeFile(abs, fullContent, "utf8");
9733
+ await fs32.mkdir(path40.dirname(abs), { recursive: true });
9734
+ await fs32.writeFile(abs, fullContent, "utf8");
9767
9735
  return "created";
9768
9736
  }
9769
9737
  if (prior.includes(MANAGED_MARKER)) {
9770
9738
  if (prior === fullContent) return "skipped";
9771
9739
  if (opts.dryRun) return "updated";
9772
- await fs34.mkdir(path40.dirname(abs), { recursive: true });
9773
- await fs34.writeFile(abs, fullContent, "utf8");
9740
+ await fs32.mkdir(path40.dirname(abs), { recursive: true });
9741
+ await fs32.writeFile(abs, fullContent, "utf8");
9774
9742
  return "updated";
9775
9743
  }
9776
9744
  if (!opts.force) return "skipped-untracked";
9777
9745
  if (opts.dryRun) return "updated";
9778
- await fs34.mkdir(path40.dirname(abs), { recursive: true });
9779
- await fs34.writeFile(abs, fullContent, "utf8");
9746
+ await fs32.mkdir(path40.dirname(abs), { recursive: true });
9747
+ await fs32.writeFile(abs, fullContent, "utf8");
9780
9748
  return "updated";
9781
9749
  }
9782
9750
  async function writeIdeMcpJson(repoRoot, relPath, buildBody, opts) {
@@ -9785,7 +9753,7 @@ async function writeIdeMcpJson(repoRoot, relPath, buildBody, opts) {
9785
9753
  let raw = "";
9786
9754
  let existed = false;
9787
9755
  try {
9788
- raw = await fs34.readFile(abs, "utf8");
9756
+ raw = await fs32.readFile(abs, "utf8");
9789
9757
  existed = true;
9790
9758
  } catch (err) {
9791
9759
  if (err?.code !== "ENOENT") throw err;
@@ -11709,10 +11677,10 @@ async function cliSetupIdeFiles(argv, options = {}) {
11709
11677
  }
11710
11678
  return 0;
11711
11679
  }
11712
- var fs34, os13, path40, import_node_crypto25, MANAGED_MARKER, GITIGNORE_MEMORAONE_COMMENT, GITIGNORE_MEMORAONE_ENTRY, SharedMcpJsonParseError;
11680
+ var fs32, os13, path40, import_node_crypto25, MANAGED_MARKER, GITIGNORE_MEMORAONE_COMMENT, GITIGNORE_MEMORAONE_ENTRY, SharedMcpJsonParseError;
11713
11681
  var init_setupIdeFiles = __esm({
11714
11682
  "src/setupIdeFiles.ts"() {
11715
- fs34 = __toESM(require("fs/promises"), 1);
11683
+ fs32 = __toESM(require("fs/promises"), 1);
11716
11684
  os13 = __toESM(require("os"), 1);
11717
11685
  path40 = __toESM(require("path"), 1);
11718
11686
  import_node_crypto25 = require("crypto");
@@ -11902,7 +11870,7 @@ async function snapshotAndRemoveRootLocalState(workspaceRoot, options = {}) {
11902
11870
  } catch {
11903
11871
  }
11904
11872
  try {
11905
- await fs35.unlink(getBindingFilePath(id, options.homeDir));
11873
+ await fs33.unlink(getBindingFilePath(id, options.homeDir));
11906
11874
  } catch (err) {
11907
11875
  if (err?.code !== "ENOENT") throw err;
11908
11876
  }
@@ -11925,7 +11893,7 @@ async function restoreRootLocalState(snapshot, options = {}) {
11925
11893
  } catch {
11926
11894
  }
11927
11895
  try {
11928
- await fs35.unlink(getBindingFilePath(id, options.homeDir));
11896
+ await fs33.unlink(getBindingFilePath(id, options.homeDir));
11929
11897
  } catch (err) {
11930
11898
  if (err?.code !== "ENOENT") throw err;
11931
11899
  }
@@ -11960,10 +11928,10 @@ async function restoreRootLocalState(snapshot, options = {}) {
11960
11928
  await writeInstallationCredentials(creds, options.credentialOptions);
11961
11929
  }
11962
11930
  }
11963
- var fs35, path41, WORKSPACE_MAP_FILENAME, FINGERPRINT_REGEX;
11931
+ var fs33, path41, WORKSPACE_MAP_FILENAME, FINGERPRINT_REGEX;
11964
11932
  var init_replaceRootLocalState = __esm({
11965
11933
  "src/localState/replaceRootLocalState.ts"() {
11966
- fs35 = __toESM(require("fs/promises"), 1);
11934
+ fs33 = __toESM(require("fs/promises"), 1);
11967
11935
  path41 = __toESM(require("path"), 1);
11968
11936
  init_installationCredentials();
11969
11937
  init_bindingStore();
@@ -12022,9 +11990,9 @@ async function defaultListClineHubProcesses() {
12022
11990
  return parseClineHubProcessLines(stdout.split("\n"));
12023
11991
  }
12024
11992
  async function defaultRemoveSocket2(socketPath) {
12025
- await fs36.unlink(socketPath);
11993
+ await fs34.unlink(socketPath);
12026
11994
  try {
12027
- await fs36.unlink(bindingSidecarPath(socketPath));
11995
+ await fs34.unlink(bindingSidecarPath(socketPath));
12028
11996
  } catch {
12029
11997
  }
12030
11998
  }
@@ -12217,13 +12185,13 @@ async function runConnectRuntimeCleanup(options) {
12217
12185
  staleRuntimeRemains
12218
12186
  };
12219
12187
  }
12220
- var path42, import_node_child_process6, import_node_util5, fs36, execFileAsync5, CLINE_HUB_DAEMON_MARKER;
12188
+ var path42, import_node_child_process6, import_node_util5, fs34, execFileAsync5, CLINE_HUB_DAEMON_MARKER;
12221
12189
  var init_connectRuntimeCleanup = __esm({
12222
12190
  "src/connectRuntimeCleanup.ts"() {
12223
12191
  path42 = __toESM(require("path"), 1);
12224
12192
  import_node_child_process6 = require("child_process");
12225
12193
  import_node_util5 = require("util");
12226
- fs36 = __toESM(require("fs/promises"), 1);
12194
+ fs34 = __toESM(require("fs/promises"), 1);
12227
12195
  init_cleanup();
12228
12196
  init_bindingSidecar();
12229
12197
  execFileAsync5 = (0, import_node_util5.promisify)(import_node_child_process6.execFile);
@@ -12253,10 +12221,10 @@ function normalizeGitRemote(remoteUrl) {
12253
12221
  normalized = normalized.replace(/\/+$/, "");
12254
12222
  return normalized.toLowerCase() || null;
12255
12223
  }
12256
- async function detectLegacyM1Warning2(workspaceRoot) {
12224
+ async function detectLegacyM1Warning(workspaceRoot) {
12257
12225
  const candidate = path43.join(path43.resolve(workspaceRoot), CANONICAL_M1_FILENAME);
12258
12226
  try {
12259
- await fs37.access(candidate);
12227
+ await fs35.access(candidate);
12260
12228
  return candidate;
12261
12229
  } catch {
12262
12230
  return void 0;
@@ -12297,7 +12265,7 @@ async function runConnectCommand(options) {
12297
12265
  resolvedMode = { kind: "local", cliPath };
12298
12266
  }
12299
12267
  const fingerprint = resolveRepoFingerprint(cwd2);
12300
- const legacyM1WarningPath = await detectLegacyM1Warning2(cwd2);
12268
+ const legacyM1WarningPath = await detectLegacyM1Warning(cwd2);
12301
12269
  if (legacyM1WarningPath) {
12302
12270
  process.stderr.write(
12303
12271
  `[memoraone-mcp] warning: ignoring legacy ${path43.basename(legacyM1WarningPath)} at ${legacyM1WarningPath} (credentials and binding are package-managed)
@@ -12704,10 +12672,10 @@ async function cliConnect(argv, options = {}) {
12704
12672
  return 1;
12705
12673
  }
12706
12674
  }
12707
- var fs37, path43, os14;
12675
+ var fs35, path43, os14;
12708
12676
  var init_connectCommand = __esm({
12709
12677
  "src/localState/connectCommand.ts"() {
12710
- fs37 = __toESM(require("fs/promises"), 1);
12678
+ fs35 = __toESM(require("fs/promises"), 1);
12711
12679
  path43 = __toESM(require("path"), 1);
12712
12680
  os14 = __toESM(require("os"), 1);
12713
12681
  init_config();
@@ -12993,13 +12961,13 @@ function writeEvent(event, stdoutWrite) {
12993
12961
  }
12994
12962
  function delay(ms, signal) {
12995
12963
  if (ms <= 0 || signal?.aborted) return Promise.resolve();
12996
- return new Promise((resolve43) => {
12964
+ return new Promise((resolve44) => {
12997
12965
  const timer = setTimeout(finish, ms);
12998
12966
  const onAbort = () => finish();
12999
12967
  function finish() {
13000
12968
  clearTimeout(timer);
13001
12969
  signal?.removeEventListener("abort", onAbort);
13002
- resolve43();
12970
+ resolve44();
13003
12971
  }
13004
12972
  signal?.addEventListener("abort", onAbort, { once: true });
13005
12973
  });
@@ -13007,7 +12975,7 @@ function delay(ms, signal) {
13007
12975
  async function resolveWorkspaceRoot(workspaceRoot) {
13008
12976
  const resolved = path45.resolve(workspaceRoot);
13009
12977
  try {
13010
- const st = await fs38.stat(resolved);
12978
+ const st = await fs36.stat(resolved);
13011
12979
  if (!st.isDirectory()) {
13012
12980
  return { error: "workspace-root must be a directory" };
13013
12981
  }
@@ -13182,10 +13150,10 @@ async function cliPluginPair(argv, options = {}) {
13182
13150
  }
13183
13151
  }
13184
13152
  }
13185
- var fs38, path45, PLUGIN_PAIR_USAGE, DEFAULT_PLUGIN_PAIR_POLL_INTERVAL_MS, SECRET_OUTPUT_RE;
13153
+ var fs36, path45, PLUGIN_PAIR_USAGE, DEFAULT_PLUGIN_PAIR_POLL_INTERVAL_MS, SECRET_OUTPUT_RE;
13186
13154
  var init_pluginPairCommand = __esm({
13187
13155
  "src/pluginPairCommand.ts"() {
13188
- fs38 = __toESM(require("fs/promises"), 1);
13156
+ fs36 = __toESM(require("fs/promises"), 1);
13189
13157
  path45 = __toESM(require("path"), 1);
13190
13158
  init_pluginPairing();
13191
13159
  init_projectBinding();
@@ -13239,7 +13207,7 @@ function writeJson(payload, stdoutWrite) {
13239
13207
  async function resolveWorkspaceRoot2(workspaceRoot) {
13240
13208
  const resolved = path46.resolve(workspaceRoot);
13241
13209
  try {
13242
- const st = await fs39.stat(resolved);
13210
+ const st = await fs37.stat(resolved);
13243
13211
  if (!st.isDirectory()) {
13244
13212
  return { error: "workspace-root must be a directory", workspaceRoot: resolved };
13245
13213
  }
@@ -13291,10 +13259,10 @@ async function cliRuntimeIdentity(argv, options = {}) {
13291
13259
  return 1;
13292
13260
  }
13293
13261
  }
13294
- var fs39, path46, RUNTIME_IDENTITY_USAGE, SECRET_OUTPUT_RE2;
13262
+ var fs37, path46, RUNTIME_IDENTITY_USAGE, SECRET_OUTPUT_RE2;
13295
13263
  var init_runtimeIdentityCommand = __esm({
13296
13264
  "src/runtimeIdentityCommand.ts"() {
13297
- fs39 = __toESM(require("fs/promises"), 1);
13265
+ fs37 = __toESM(require("fs/promises"), 1);
13298
13266
  path46 = __toESM(require("path"), 1);
13299
13267
  init_resolveLocalBinding();
13300
13268
  RUNTIME_IDENTITY_USAGE = "Usage: memoraone-mcp runtime-identity --workspace-root <path>";
@@ -13442,8 +13410,8 @@ var init_bridgeClientRoots = __esm({
13442
13410
  if (this.closed) {
13443
13411
  return null;
13444
13412
  }
13445
- return new Promise((resolve43) => {
13446
- this.waiters.push(resolve43);
13413
+ return new Promise((resolve44) => {
13414
+ this.waiters.push(resolve44);
13447
13415
  });
13448
13416
  }
13449
13417
  /** Re-queue lines read during an intermediate protocol step (e.g. roots/list) for the main bridge loop. */
@@ -13463,6 +13431,153 @@ var init_bridgeClientRoots = __esm({
13463
13431
  }
13464
13432
  });
13465
13433
 
13434
+ // src/pluginStartupBindingWait.ts
13435
+ function errorMessage(err) {
13436
+ return err instanceof Error ? err.message : String(err);
13437
+ }
13438
+ function isUnboundPluginStartupBindingMessage(message) {
13439
+ return UNBOUND_MESSAGE_MARKERS.some((marker) => message.includes(marker));
13440
+ }
13441
+ function isCredentialsMissingMessage(message) {
13442
+ return message.includes(CREDENTIALS_MISSING_MARKER);
13443
+ }
13444
+ async function pendingBindingWindowOpen(isPendingBinding) {
13445
+ if (!isPendingBinding) {
13446
+ return false;
13447
+ }
13448
+ try {
13449
+ return Boolean(await isPendingBinding());
13450
+ } catch {
13451
+ return false;
13452
+ }
13453
+ }
13454
+ function shouldWaitForPluginStartupBinding(options = {}) {
13455
+ const env2 = options.env ?? process.env;
13456
+ if (env2[MEMORAONE_PLUGIN_ENV] !== MEMORAONE_CURSOR_PLUGIN) {
13457
+ return false;
13458
+ }
13459
+ if (options.daemonBindingHint) {
13460
+ return false;
13461
+ }
13462
+ return true;
13463
+ }
13464
+ function collectPluginStartupBindingRoots(options) {
13465
+ const seen = /* @__PURE__ */ new Set();
13466
+ const roots = [];
13467
+ const add = (raw) => {
13468
+ if (raw === void 0 || raw === null || raw.trim() === "") {
13469
+ return;
13470
+ }
13471
+ const resolved = path47.resolve(raw);
13472
+ if (seen.has(resolved)) {
13473
+ return;
13474
+ }
13475
+ seen.add(resolved);
13476
+ roots.push(resolved);
13477
+ };
13478
+ for (const root of options.initializeRoots ?? []) {
13479
+ add(root);
13480
+ }
13481
+ for (const uri of options.rootsListUris ?? []) {
13482
+ add(uriToPath(uri));
13483
+ }
13484
+ add(getRepoScopedWorkspaceHint(options.env));
13485
+ return roots;
13486
+ }
13487
+ async function hasPendingPluginStartupBinding(workspaceRoots, options = {}) {
13488
+ for (const root of workspaceRoots) {
13489
+ try {
13490
+ const identity = await lookupLocalBindingIdentity(root, {
13491
+ homeDir: options.homeDir
13492
+ });
13493
+ if (identity.status !== "resolved") {
13494
+ continue;
13495
+ }
13496
+ const record = await readBindingRecord(
13497
+ identity.repositoryBindingId,
13498
+ options.homeDir
13499
+ );
13500
+ if (record?.status === "pending") {
13501
+ return true;
13502
+ }
13503
+ } catch {
13504
+ continue;
13505
+ }
13506
+ }
13507
+ return false;
13508
+ }
13509
+ async function isRetryablePluginStartupBindingError(err, options = {}) {
13510
+ const message = errorMessage(err);
13511
+ if (isUnboundPluginStartupBindingMessage(message)) {
13512
+ return true;
13513
+ }
13514
+ if (isCredentialsMissingMessage(message) && await pendingBindingWindowOpen(options.isPendingBinding)) {
13515
+ return true;
13516
+ }
13517
+ return false;
13518
+ }
13519
+ function defaultSleep(ms) {
13520
+ return new Promise((resolve44) => {
13521
+ setTimeout(resolve44, ms);
13522
+ });
13523
+ }
13524
+ async function waitForPluginStartupBinding(resolve44, options = {}) {
13525
+ const now = options.now ?? Date.now;
13526
+ const sleep = options.sleep ?? defaultSleep;
13527
+ const timeoutMs = options.timeoutMs ?? PLUGIN_STARTUP_BINDING_WAIT_TIMEOUT_MS;
13528
+ const intervalMs = options.intervalMs ?? PLUGIN_STARTUP_BINDING_WAIT_INTERVAL_MS;
13529
+ const startedAt = now();
13530
+ let waitingLogged = false;
13531
+ let lastError;
13532
+ while (true) {
13533
+ try {
13534
+ const binding = await resolve44();
13535
+ if (waitingLogged) {
13536
+ options.log?.(
13537
+ `local MemoraOne binding available after Cursor plugin pairing (${now() - startedAt}ms)`
13538
+ );
13539
+ }
13540
+ return binding;
13541
+ } catch (err) {
13542
+ lastError = err;
13543
+ const retryable = await isRetryablePluginStartupBindingError(err, {
13544
+ isPendingBinding: options.isPendingBinding
13545
+ });
13546
+ if (!retryable) {
13547
+ throw err;
13548
+ }
13549
+ if (now() - startedAt >= timeoutMs) {
13550
+ throw lastError;
13551
+ }
13552
+ if (!waitingLogged) {
13553
+ options.log?.(
13554
+ "waiting for local MemoraOne binding after Cursor plugin pairing"
13555
+ );
13556
+ waitingLogged = true;
13557
+ }
13558
+ await sleep(intervalMs);
13559
+ }
13560
+ }
13561
+ }
13562
+ var path47, MEMORAONE_PLUGIN_ENV, MEMORAONE_CURSOR_PLUGIN, PLUGIN_STARTUP_BINDING_WAIT_TIMEOUT_MS, PLUGIN_STARTUP_BINDING_WAIT_INTERVAL_MS, UNBOUND_MESSAGE_MARKERS, CREDENTIALS_MISSING_MARKER;
13563
+ var init_pluginStartupBindingWait = __esm({
13564
+ "src/pluginStartupBindingWait.ts"() {
13565
+ path47 = __toESM(require("path"), 1);
13566
+ init_initializeBinding();
13567
+ init_bindingStore();
13568
+ init_resolveLocalBinding();
13569
+ MEMORAONE_PLUGIN_ENV = "MEMORAONE_PLUGIN";
13570
+ MEMORAONE_CURSOR_PLUGIN = "cursor";
13571
+ PLUGIN_STARTUP_BINDING_WAIT_TIMEOUT_MS = 5 * 60 * 1e3;
13572
+ PLUGIN_STARTUP_BINDING_WAIT_INTERVAL_MS = 250;
13573
+ UNBOUND_MESSAGE_MARKERS = [
13574
+ "No local MemoraOne binding for this workspace",
13575
+ "No local binding for workspace"
13576
+ ];
13577
+ CREDENTIALS_MISSING_MARKER = "Installation credentials missing";
13578
+ }
13579
+ });
13580
+
13466
13581
  // src/ideType.ts
13467
13582
  function mapReliableClientInfoName(name) {
13468
13583
  if (typeof name !== "string") {
@@ -13670,9 +13785,9 @@ function extractJsonRpcId(line) {
13670
13785
  }
13671
13786
  }
13672
13787
  function connectWithRetry(socketPath, log, maxRetries, retryDelayMs, connect2) {
13673
- return new Promise((resolve43, reject) => {
13788
+ return new Promise((resolve44, reject) => {
13674
13789
  const tryConnect = (attempt) => {
13675
- connect2(socketPath).then(resolve43).catch((err) => {
13790
+ connect2(socketPath).then(resolve44).catch((err) => {
13676
13791
  if (attempt >= maxRetries) {
13677
13792
  reject(err);
13678
13793
  return;
@@ -13841,6 +13956,7 @@ var init_bridgeProxy = __esm({
13841
13956
  init_bridgeClientRoots();
13842
13957
  init_cleanup();
13843
13958
  init_initializeBinding();
13959
+ init_pluginStartupBindingWait();
13844
13960
  init_projectBinding();
13845
13961
  init_ideType();
13846
13962
  init_socketPaths();
@@ -13868,8 +13984,8 @@ var init_bridgeProxy = __esm({
13868
13984
  this.maxRetries = options.maxRetries ?? 5;
13869
13985
  this.retryDelayMs = options.retryDelayMs ?? 200;
13870
13986
  this.lineReader = options.lineReader ?? null;
13871
- this.connectImpl = options.connect ?? ((socketPath) => new Promise((resolve43, reject) => {
13872
- const socket = net.connect(socketPath, () => resolve43(socket));
13987
+ this.connectImpl = options.connect ?? ((socketPath) => new Promise((resolve44, reject) => {
13988
+ const socket = net.connect(socketPath, () => resolve44(socket));
13873
13989
  socket.on("error", reject);
13874
13990
  }));
13875
13991
  this.spawnDaemonImpl = options.spawnDaemon ?? (async (binding) => {
@@ -13953,10 +14069,20 @@ var init_bridgeProxy = __esm({
13953
14069
  );
13954
14070
  }
13955
14071
  }
13956
- const binding = await resolveBridgeSessionBinding(params, this.env, {
14072
+ const resolveBinding = () => resolveBridgeSessionBinding(params, this.env, {
13957
14073
  rootsListUris,
13958
14074
  rootsListAttempted
13959
14075
  });
14076
+ const binding = shouldWaitForPluginStartupBinding({ env: this.env }) ? await waitForPluginStartupBinding(resolveBinding, {
14077
+ isPendingBinding: () => hasPendingPluginStartupBinding(
14078
+ collectPluginStartupBindingRoots({
14079
+ initializeRoots,
14080
+ rootsListUris,
14081
+ env: this.env
14082
+ })
14083
+ ),
14084
+ log: this.log
14085
+ }) : await resolveBinding();
13960
14086
  const environmentLog = binding.environment !== void 0 ? ` environment=${binding.environment}` : "";
13961
14087
  this.log(
13962
14088
  `session binding binding=${binding.repositoryBindingId} project=${binding.projectId} workspace=${binding.workspaceRoot} source=${binding.bindingSource}${environmentLog}`
@@ -14001,7 +14127,7 @@ var init_bridgeProxy = __esm({
14001
14127
  }
14002
14128
  waitForDaemonJsonRpcResponse(id, timeoutMs = 3e4) {
14003
14129
  const key = this.waiterKey(id);
14004
- return new Promise((resolve43, reject) => {
14130
+ return new Promise((resolve44, reject) => {
14005
14131
  const timer = setTimeout(() => {
14006
14132
  this.pendingDaemonResponseWaiters.delete(key);
14007
14133
  reject(
@@ -14010,7 +14136,7 @@ var init_bridgeProxy = __esm({
14010
14136
  )
14011
14137
  );
14012
14138
  }, timeoutMs);
14013
- this.pendingDaemonResponseWaiters.set(key, { resolve: resolve43, reject, timer });
14139
+ this.pendingDaemonResponseWaiters.set(key, { resolve: resolve44, reject, timer });
14014
14140
  });
14015
14141
  }
14016
14142
  notifyDaemonResponseWaiters(line) {