@mrrlin-dev/mcp 0.4.257 → 0.4.258

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.
Files changed (2) hide show
  1. package/dist/bin.cjs +45 -20
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -70794,6 +70794,7 @@ var init_windows_verify = __esm({
70794
70794
  var cli_exports = {};
70795
70795
  __export(cli_exports, {
70796
70796
  WINDOWS_DRAIN_VERIFIED: () => WINDOWS_DRAIN_VERIFIED,
70797
+ drainServiceEndpointFor: () => drainServiceEndpointFor,
70797
70798
  drainServiceStatus: () => drainServiceStatus,
70798
70799
  readDrainServiceEndpoint: () => readDrainServiceEndpoint,
70799
70800
  runDrainServiceCli: () => runDrainServiceCli
@@ -70921,14 +70922,35 @@ Processes the provider starts outside the attempt tree (docker, pm2, user servic
70921
70922
  `);
70922
70923
  return 0;
70923
70924
  }
70924
- function readDrainServiceEndpoint() {
70925
- if (process.platform !== "linux" || !(0, import_node_fs34.existsSync)(CONFIG)) return null;
70926
- try {
70927
- const config2 = JSON.parse((0, import_node_fs34.readFileSync)(CONFIG, "utf8"));
70928
- return typeof config2.socketPath === "string" && typeof config2.spoolDir === "string" ? { socketPath: config2.socketPath, spoolDir: config2.spoolDir } : null;
70929
- } catch {
70930
- return null;
70925
+ function drainServiceEndpointFor(platform, readConfig, env = process.env) {
70926
+ const parse9 = (path42) => {
70927
+ const raw = readConfig(path42);
70928
+ if (raw === null) return null;
70929
+ try {
70930
+ const value = JSON.parse(raw);
70931
+ return value && typeof value === "object" ? value : null;
70932
+ } catch {
70933
+ return null;
70934
+ }
70935
+ };
70936
+ if (platform === "linux") {
70937
+ const config2 = parse9(CONFIG);
70938
+ return config2 && typeof config2.socketPath === "string" && typeof config2.spoolDir === "string" ? { socketPath: config2.socketPath, spoolDir: config2.spoolDir, elevated: sudoNonInteractiveSucceeds } : null;
70939
+ }
70940
+ if (platform === "win32" && WINDOWS_DRAIN_VERIFIED) {
70941
+ const config2 = parse9(windowsConfigPath(env));
70942
+ return config2 && typeof config2.pipeName === "string" && config2.pipeName.startsWith("\\\\.\\pipe\\") && typeof config2.spoolDir === "string" && /^[A-Za-z]:\\/.test(config2.spoolDir) ? { socketPath: config2.pipeName, spoolDir: config2.spoolDir, elevated: windowsIsElevated } : null;
70931
70943
  }
70944
+ return null;
70945
+ }
70946
+ function readDrainServiceEndpoint() {
70947
+ return drainServiceEndpointFor(process.platform, (path42) => {
70948
+ try {
70949
+ return (0, import_node_fs34.existsSync)(path42) ? (0, import_node_fs34.readFileSync)(path42, "utf8") : null;
70950
+ } catch {
70951
+ return null;
70952
+ }
70953
+ });
70932
70954
  }
70933
70955
  async function drainServiceStatus(version2) {
70934
70956
  if (process.platform === "win32") {
@@ -71178,7 +71200,7 @@ var init_cli = __esm({
71178
71200
  PREFIX = "/opt/mrrlin-drain";
71179
71201
  CONFIG = `${PREFIX}/config.json`;
71180
71202
  UNIT = "/etc/systemd/system/mrrlin-drain.service";
71181
- WINDOWS_DRAIN_VERIFIED = false;
71203
+ WINDOWS_DRAIN_VERIFIED = true;
71182
71204
  }
71183
71205
  });
71184
71206
 
@@ -106874,7 +106896,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
106874
106896
  }
106875
106897
 
106876
106898
  // src/_generated/version.ts
106877
- var PKG_VERSION = "0.4.257";
106899
+ var PKG_VERSION = "0.4.258";
106878
106900
 
106879
106901
  // src/bridge-allowed-origins.ts
106880
106902
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -113342,7 +113364,7 @@ function defaultDrainSupervisor() {
113342
113364
  if (!endpoint) return null;
113343
113365
  return {
113344
113366
  healthy: async () => (await drainServiceStatus(PKG_VERSION)).state === "healthy",
113345
- start: (start) => startDrainSupervision(endpoint.socketPath, start, { expectedVersion: PKG_VERSION }),
113367
+ start: (start) => startDrainSupervision(endpoint.socketPath, start, { expectedVersion: PKG_VERSION, elevated: endpoint.elevated }),
113346
113368
  relay: (relay) => relaySpool(endpoint.spoolDir, relay)
113347
113369
  };
113348
113370
  }
@@ -113472,16 +113494,19 @@ function f54ProgressRequested(env = process.env) {
113472
113494
  function resolveF54ProgressLease(containable, env = process.env) {
113473
113495
  return f54ProgressRequested(env) && containable;
113474
113496
  }
113475
- async function claimIsContainable(deps, supervisor) {
113476
- if (deps.verifyContainment || process.platform === "win32") {
113477
- try {
113478
- await (deps.verifyContainment ?? verifyOwnedExecutionContainment)();
113479
- return true;
113480
- } catch {
113481
- return false;
113482
- }
113497
+ async function claimIsContainable(deps, supervisor, platform = process.platform) {
113498
+ if (await launcherContains(deps, platform)) return true;
113499
+ if (deps.verifyContainment && platform !== "win32") return false;
113500
+ return (platform === "linux" || platform === "win32") && supervisor !== null && await supervisor.healthy().catch(() => false);
113501
+ }
113502
+ async function launcherContains(deps, platform) {
113503
+ if (!deps.verifyContainment && platform !== "win32") return false;
113504
+ try {
113505
+ await (deps.verifyContainment ?? verifyOwnedExecutionContainment)();
113506
+ return true;
113507
+ } catch {
113508
+ return false;
113483
113509
  }
113484
- return process.platform === "linux" && supervisor !== null && await supervisor.healthy().catch(() => false);
113485
113510
  }
113486
113511
  async function driveRun(deps, projectSlug, runId, shutdown) {
113487
113512
  if (shutdown?.aborted) return;
@@ -113532,7 +113557,7 @@ async function driveRun(deps, projectSlug, runId, shutdown) {
113532
113557
  await releaseUnstartedClaim("drain_supervision_unavailable");
113533
113558
  return;
113534
113559
  }
113535
- if (progressLease && !supervision && process.platform !== "win32" && !deps.verifyContainment) {
113560
+ if (progressLease && !supervision && !await launcherContains(deps, process.platform)) {
113536
113561
  await releaseUnstartedClaim("drain_supervision_unavailable");
113537
113562
  return;
113538
113563
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.257",
3
+ "version": "0.4.258",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"