@mrrlin-dev/mcp 0.4.250 → 0.4.251

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 +40 -16
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -78549,9 +78549,9 @@ function createMrrlinClient(config2) {
78549
78549
  }
78550
78550
  return { id: data.id, mayDispatch: data.mayDispatch };
78551
78551
  },
78552
- async claimExecutionRun(projectSlug, runId) {
78552
+ async claimExecutionRun(projectSlug, runId, options) {
78553
78553
  try {
78554
- const body = await request(`${projectPath(projectSlug)}/execution-runs/${encodeURIComponent(runId)}/claim`, { method: "POST" });
78554
+ const body = await request(`${projectPath(projectSlug)}/execution-runs/${encodeURIComponent(runId)}/claim`, options?.progressLease ? { method: "POST", headers: { "x-mrrlin-lease-mode": "progress" } } : { method: "POST" });
78555
78555
  return executionRunClaimResponseSchema.parse(body).data;
78556
78556
  } catch (error51) {
78557
78557
  if (error51 instanceof MrrlinApiError && error51.status === 409)
@@ -101893,7 +101893,7 @@ function withAuth(options) {
101893
101893
  const authedFetch = async (input, init = {}) => {
101894
101894
  const headers = new Headers(init.headers ?? {});
101895
101895
  const bearerFile = process.env.MRRLIN_EXECUTOR_BEARER_FILE;
101896
- if (isExecutorThread() && (bearerFile || process.env.MRRLIN_EXECUTOR_RUN_ID || process.env.MRRLIN_EXECUTOR_LEASE_ID || process.env.MRRLIN_F54_PROGRESS_LEASE === "1")) {
101896
+ if (isExecutorThread() && (bearerFile || process.env.MRRLIN_EXECUTOR_RUN_ID || process.env.MRRLIN_EXECUTOR_LEASE_ID)) {
101897
101897
  if (!bearerFile) throw new Error("Executor credential is unavailable");
101898
101898
  const token2 = (await (0, import_promises12.readFile)(bearerFile, "utf8")).trim();
101899
101899
  if (!token2.startsWith("mrrlin_executor_v1.")) throw new Error("Executor credential is unavailable");
@@ -101959,7 +101959,7 @@ function pingAsyncWorkerDispatch(projectSlug, jobId) {
101959
101959
  }
101960
101960
  async function deliverBuiltIn(client, projectSlug, artifactKind, payload, extra = {}) {
101961
101961
  const capability = resolveKindCapability(artifactKind);
101962
- if (isExecutorThread() && (process.env.MRRLIN_EXECUTOR_BEARER_FILE || process.env.MRRLIN_EXECUTOR_LEASE_ID) && capability !== "wiki") {
101962
+ if (isExecutorThread() && (process.env.MRRLIN_EXECUTOR_BEARER_FILE || process.env.MRRLIN_EXECUTOR_LEASE_ID) && capability !== "wiki" && capability !== "artifacts") {
101963
101963
  throw new McpToolCodedError(
101964
101964
  "EXECUTION_RUN_EFFECT_UNAVAILABLE",
101965
101965
  "This destination cannot receive writes from an execution lease."
@@ -106855,7 +106855,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
106855
106855
  }
106856
106856
 
106857
106857
  // src/_generated/version.ts
106858
- var PKG_VERSION = "0.4.250";
106858
+ var PKG_VERSION = "0.4.251";
106859
106859
 
106860
106860
  // src/bridge-allowed-origins.ts
106861
106861
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -113446,17 +113446,32 @@ async function releaseRestartedWorktrees(deps, projectSlug, runId) {
113446
113446
  }));
113447
113447
  }
113448
113448
  }
113449
- async function driveRun(deps, projectSlug, runId, shutdown) {
113450
- if (shutdown?.aborted) return;
113451
- const progressLease = process.env.MRRLIN_F54_PROGRESS_LEASE === "1";
113452
- if (progressLease) {
113449
+ function f54ProgressRequested(env = process.env) {
113450
+ const raw = (env.MRRLIN_F54_PROGRESS_LEASE ?? "").trim().toLowerCase();
113451
+ return raw === "1" || raw === "true";
113452
+ }
113453
+ function resolveF54ProgressLease(containable, env = process.env) {
113454
+ return f54ProgressRequested(env) && containable;
113455
+ }
113456
+ async function claimIsContainable(deps, supervisor) {
113457
+ if (deps.verifyContainment || process.platform === "win32") {
113453
113458
  try {
113454
113459
  await (deps.verifyContainment ?? verifyOwnedExecutionContainment)();
113460
+ return true;
113455
113461
  } catch {
113456
- console.warn(JSON.stringify({ event: "execution_lease_containment_unavailable", projectSlug, runId }));
113457
- return;
113462
+ return false;
113458
113463
  }
113459
113464
  }
113465
+ return process.platform === "linux" && supervisor !== null && await supervisor.healthy().catch(() => false);
113466
+ }
113467
+ async function driveRun(deps, projectSlug, runId, shutdown) {
113468
+ if (shutdown?.aborted) return;
113469
+ const supervisor = deps.drainSupervisor === void 0 ? defaultDrainSupervisor() : deps.drainSupervisor;
113470
+ const requested = f54ProgressRequested();
113471
+ const askProgress = requested ? resolveF54ProgressLease(await claimIsContainable(deps, supervisor)) : false;
113472
+ if (requested && !askProgress) {
113473
+ console.warn(JSON.stringify({ event: "execution_lease_containment_unavailable", projectSlug, runId, mode: "legacy" }));
113474
+ }
113460
113475
  const started = import_node_perf_hooks.performance.now();
113461
113476
  const wallStarted = Date.now();
113462
113477
  let elapsedHighWater = 0;
@@ -113466,8 +113481,9 @@ async function driveRun(deps, projectSlug, runId, shutdown) {
113466
113481
  };
113467
113482
  if (shutdown?.aborted) return;
113468
113483
  const claimStartedMonotonicMs = elapsed();
113469
- const claimed = await deps.client.claimExecutionRun(projectSlug, runId);
113484
+ const claimed = askProgress ? await deps.client.claimExecutionRun(projectSlug, runId, { progressLease: true }) : await deps.client.claimExecutionRun(projectSlug, runId);
113470
113485
  if (!claimed) return;
113486
+ const progressLease = askProgress && typeof claimed.executorBearer === "string" && claimed.executorBearer.length > 0;
113471
113487
  if (!claimed.leaseId) {
113472
113488
  if (progressLease) {
113473
113489
  console.warn(JSON.stringify({ event: "execution_lease_window_unavailable", projectSlug, runId }));
@@ -113492,12 +113508,15 @@ async function driveRun(deps, projectSlug, runId, shutdown) {
113492
113508
  }), 3e3, "execution_lease_setup_release_timeout").catch(() => {
113493
113509
  });
113494
113510
  };
113495
- const supervisor = deps.drainSupervisor === void 0 ? defaultDrainSupervisor() : deps.drainSupervisor;
113496
113511
  const supervision = supervisor && await supervisor.healthy().catch(() => false) ? await openDrainSupervision(client, supervisor, projectSlug, runId, leaseId) : null;
113497
113512
  if (supervision === "refused") {
113498
113513
  await releaseUnstartedClaim("drain_supervision_unavailable");
113499
113514
  return;
113500
113515
  }
113516
+ if (progressLease && !supervision && process.platform !== "win32" && !deps.verifyContainment) {
113517
+ await releaseUnstartedClaim("drain_supervision_unavailable");
113518
+ return;
113519
+ }
113501
113520
  const runDeps = supervision ? { ...deps, attemptSupervision: supervision.attempt } : deps;
113502
113521
  try {
113503
113522
  if (supervision) {
@@ -116923,6 +116942,11 @@ async function driveClaimableAsyncJob(deps, projectSlug, jobId, preClaimJob, sec
116923
116942
  try {
116924
116943
  await (deps.verifyContainment ?? verifyOwnedExecutionContainment)();
116925
116944
  } catch {
116945
+ console.warn(JSON.stringify({
116946
+ event: secureReport ? "report_job_containment_unavailable" : "async_job_containment_unavailable",
116947
+ projectSlug,
116948
+ jobId
116949
+ }));
116926
116950
  return;
116927
116951
  }
116928
116952
  if (shutdown.aborted) return;
@@ -128185,7 +128209,7 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
128185
128209
  sink({ type: "async-result", directorSessionId, projectSlug: slug, deliveryKind, body });
128186
128210
  }
128187
128211
  };
128188
- const progressExecution = process.env.MRRLIN_F54_PROGRESS_LEASE === "1";
128212
+ const progressExecution = f54ProgressRequested();
128189
128213
  let executionStopping = false;
128190
128214
  const activeDrives = /* @__PURE__ */ new Map();
128191
128215
  const driveTracked = (slug, runId) => {
@@ -128204,7 +128228,7 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
128204
128228
  if (controller) activeDrives.set(controller, drive);
128205
128229
  };
128206
128230
  const driveRunNow = driveTracked;
128207
- const asyncShutdown = progressExecution ? new AbortController() : void 0;
128231
+ const asyncShutdown = progressExecution && process.platform === "win32" ? new AbortController() : void 0;
128208
128232
  startupRollback?.add(() => {
128209
128233
  executionStopping = true;
128210
128234
  asyncShutdown?.abort();
@@ -130378,7 +130402,7 @@ async function readCredential(path42) {
130378
130402
  }
130379
130403
  async function resolveBearer(explicitToken) {
130380
130404
  const file2 = process.env.MRRLIN_EXECUTOR_BEARER_FILE;
130381
- if (isExecutorThread() && (file2 || process.env.MRRLIN_EXECUTOR_RUN_ID || process.env.MRRLIN_EXECUTOR_LEASE_ID || process.env.MRRLIN_F54_PROGRESS_LEASE === "1")) {
130405
+ if (isExecutorThread() && (file2 || process.env.MRRLIN_EXECUTOR_RUN_ID || process.env.MRRLIN_EXECUTOR_LEASE_ID)) {
130382
130406
  if (!file2) throw new Error("STDIO_EXECUTOR_CREDENTIAL_UNAVAILABLE");
130383
130407
  const token = await readCredential(file2);
130384
130408
  if (!token?.startsWith("mrrlin_executor_v1.")) throw new Error("STDIO_EXECUTOR_CREDENTIAL_UNAVAILABLE");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.250",
3
+ "version": "0.4.251",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"