@mrrlin-dev/mcp 0.4.258 → 0.4.261

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 +35 -17
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -70277,10 +70277,7 @@ function planWindowsInstall(o) {
70277
70277
  grant(journalDir, `*${ADMINS}:(OI)(CI)F`, `*${SYSTEM}:(OI)(CI)F`, `*${sid}:(OI)(CI)M`),
70278
70278
  grant(spoolDir, `*${ADMINS}:(OI)(CI)F`, `*${SYSTEM}:(OI)(CI)F`, `*${sid}:(OI)(CI)M`, `*${o.providerSid}:(OI)(CI)(RX,D)`)
70279
70279
  ];
70280
- const apply = [
70281
- // The key: read by the service only; the service itself refuses a key anyone else may read.
70282
- grant(keyPath, `*${ADMINS}:F`, `*${SYSTEM}:F`, `*${sid}:R`),
70283
- [csc, "/nologo", "/target:exe", "/r:System.ServiceProcess.dll", `/out:${exePath}`, sourceCopy],
70280
+ const register = [
70284
70281
  [
70285
70282
  "sc.exe",
70286
70283
  "create",
@@ -70294,7 +70291,12 @@ function planWindowsInstall(o) {
70294
70291
  "DisplayName=",
70295
70292
  "Mrrlin drain service"
70296
70293
  ],
70297
- ["sc.exe", "sidtype", o.serviceName, "restricted"],
70294
+ ["sc.exe", "sidtype", o.serviceName, "restricted"]
70295
+ ];
70296
+ const apply = [
70297
+ // The key: read by the service only; the service itself refuses a key anyone else may read.
70298
+ grant(keyPath, `*${ADMINS}:F`, `*${SYSTEM}:F`, `*${sid}:R`),
70299
+ [csc, "/nologo", "/target:exe", "/r:System.ServiceProcess.dll", `/out:${exePath}`, sourceCopy],
70298
70300
  [
70299
70301
  "netsh",
70300
70302
  "advfirewall",
@@ -70309,7 +70311,7 @@ function planWindowsInstall(o) {
70309
70311
  ],
70310
70312
  ["sc.exe", "start", o.serviceName]
70311
70313
  ];
70312
- return { directories, lockdown, copies, apply, config: config2, configPath, exePath, serviceSid: sid };
70314
+ return { directories, register, lockdown, copies, apply, config: config2, configPath, exePath, serviceSid: sid };
70313
70315
  }
70314
70316
  function planWindowsUninstall(o) {
70315
70317
  if (!SERVICE_NAME.test(o.serviceName)) throw new Error("invalid service name");
@@ -70457,6 +70459,7 @@ async function runWindowsVerify(out, version2) {
70457
70459
  (0, import_node_fs33.rmSync)(paths.dataDir, { recursive: true, force: true });
70458
70460
  });
70459
70461
  for (const dir of plan.directories) (0, import_node_fs33.mkdirSync)(dir, { recursive: true });
70462
+ for (const argv of plan.register) run4(argv);
70460
70463
  for (const argv of plan.lockdown) run4(argv);
70461
70464
  for (const [from, to] of plan.copies) (0, import_node_fs33.copyFileSync)(from, to);
70462
70465
  const key = generateWindowsDrainKey();
@@ -71143,6 +71146,7 @@ async function runWindowsCli(command, rest, out, version2) {
71143
71146
  windowsDir: paths.windowsDir
71144
71147
  });
71145
71148
  for (const dir of plan.directories) (0, import_node_fs34.mkdirSync)(dir, { recursive: true });
71149
+ for (const argv of plan.register) runArgv(argv, { stdio: "inherit", windowsHide: true });
71146
71150
  for (const argv of plan.lockdown) runArgv(argv, { stdio: "inherit", windowsHide: true });
71147
71151
  for (const [from, to] of plan.copies) (0, import_node_fs34.copyFileSync)(from, to);
71148
71152
  (0, import_node_fs34.writeFileSync)(plan.configPath, JSON.stringify(plan.config, null, 2));
@@ -78682,8 +78686,9 @@ function createMrrlinClient(config2) {
78682
78686
  });
78683
78687
  return executionRunResponseSchema.parse(body).data;
78684
78688
  } catch (error51) {
78685
- if (error51 instanceof MrrlinApiError && error51.status === 409)
78689
+ if (error51 instanceof MrrlinApiError && error51.status === 409 && error51.code === "EXECUTION_RUN_OUTCOME_NOT_SETTLEABLE") {
78686
78690
  return null;
78691
+ }
78687
78692
  throw error51;
78688
78693
  }
78689
78694
  },
@@ -105700,6 +105705,17 @@ init_dist();
105700
105705
  function bridgeAccountKey(principal) {
105701
105706
  return (0, import_node_crypto24.createHash)("sha256").update(canonLogin(principal)).digest("hex").slice(0, 16);
105702
105707
  }
105708
+ function accountKeyFromOperatorToken(token) {
105709
+ const payload = token.split(".")[0];
105710
+ if (!payload) return null;
105711
+ try {
105712
+ const parsed = JSON.parse(Buffer.from(payload, "base64url").toString("utf8"));
105713
+ const login = parsed && typeof parsed === "object" ? parsed.login : void 0;
105714
+ return typeof login === "string" && login.trim() ? bridgeAccountKey(login) : null;
105715
+ } catch {
105716
+ return null;
105717
+ }
105718
+ }
105703
105719
 
105704
105720
  // src/bridge-scoped-run-read.ts
105705
105721
  function createScopedRunRead(options) {
@@ -106896,7 +106912,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
106896
106912
  }
106897
106913
 
106898
106914
  // src/_generated/version.ts
106899
- var PKG_VERSION = "0.4.258";
106915
+ var PKG_VERSION = "0.4.261";
106900
106916
 
106901
106917
  // src/bridge-allowed-origins.ts
106902
106918
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -115874,7 +115890,7 @@ ${lines2}`
115874
115890
  task,
115875
115891
  runId,
115876
115892
  leaseId,
115877
- `non_code_outcome_settlement_conflict: settlement was rejected while this consumer still held the lease.`
115893
+ `non_code_outcome_settlement_conflict: Mrrlin refused to record the result (${pageId}) while this helper still held the run.`
115878
115894
  );
115879
115895
  }
115880
115896
  } catch (error51) {
@@ -127883,6 +127899,11 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
127883
127899
  const apiBaseUrl = readDirectorBridgeApiBaseUrl();
127884
127900
  const envToken = process.env.MRRLIN_TOKEN?.trim() || void 0;
127885
127901
  let tokenProvider = null;
127902
+ let accountKey = null;
127903
+ const noteAccountFromToken = (token) => {
127904
+ const key = token ? accountKeyFromOperatorToken(token) : null;
127905
+ if (key) accountKey = key;
127906
+ };
127886
127907
  let tokenRefresher = null;
127887
127908
  let schedulerGenerations;
127888
127909
  let schedulerScope;
@@ -127934,7 +127955,10 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
127934
127955
  }
127935
127956
  tokenRefresher = createTokenRefresher({
127936
127957
  provider: refreshProvider,
127937
- persist: persistOperatorToken,
127958
+ persist: (token) => {
127959
+ noteAccountFromToken(token);
127960
+ persistOperatorToken(token);
127961
+ },
127938
127962
  intervalMs: tokenRefreshIntervalMs(),
127939
127963
  failureLog,
127940
127964
  onOk: () => health.setApiAuth("ok"),
@@ -127951,6 +127975,7 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
127951
127975
  } else {
127952
127976
  const apiToken = startupRollback?.bearer ?? envToken ?? readOperatorToken() ?? void 0;
127953
127977
  staticToken = apiToken;
127978
+ noteAccountFromToken(apiToken);
127954
127979
  if (envToken) {
127955
127980
  try {
127956
127981
  persistOperatorToken(envToken);
@@ -128578,13 +128603,6 @@ async function startBridge(startupDeps, agentSecret, startupRollback) {
128578
128603
  bridgeBinShaShort = import_node_crypto40.default.createHash("sha256").update(import_node_fs42.default.readFileSync(process.argv[1] ?? "")).digest("hex").slice(0, 12);
128579
128604
  } catch {
128580
128605
  }
128581
- let accountKey = null;
128582
- if (tokenProvider) {
128583
- void client.getMyAccount().then((account) => {
128584
- accountKey = bridgeAccountKey(account.data.principal);
128585
- }).catch(() => {
128586
- });
128587
- }
128588
128606
  const bridgeWss = attachBridgeWss(server, {
128589
128607
  getAccountKey: () => accountKey,
128590
128608
  token: config2.token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.258",
3
+ "version": "0.4.261",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"