@mrrlin-dev/mcp 0.4.50 → 0.4.52

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 +84 -5
  2. package/package.json +2 -2
package/dist/bin.cjs CHANGED
@@ -21963,6 +21963,70 @@ var CodexJsonRpcClient = class {
21963
21963
 
21964
21964
  // ../../packages/agent-client/dist/providers/codex/server-manager.js
21965
21965
  var import_node_child_process3 = require("node:child_process");
21966
+
21967
+ // ../../packages/agent-client/dist/providers/codex/stderr-diagnostics.js
21968
+ var AUTH_DIAGNOSTIC = [
21969
+ /could not be refreshed/i,
21970
+ /refresh token/i,
21971
+ /\brefreshing token\b/i,
21972
+ /reloading auth/i,
21973
+ /guarded reload/i,
21974
+ /refresh lock/i,
21975
+ /auth (?:lock|storage) is (?:poisoned|unavailable)/i,
21976
+ /no more recovery steps/i,
21977
+ /oauth token exchange/i,
21978
+ /invalid_grant/i,
21979
+ /\bnot logged in\b/i,
21980
+ /\b401\b(?!\d)/
21981
+ ];
21982
+ var MAX_LINE_CHARS = 500;
21983
+ var MAX_BUFFERED_CHARS = MAX_LINE_CHARS * 4;
21984
+ var SECRET_SHAPES = [
21985
+ // A JWT: three base64url segments. codex's id_token and access_token are both this shape.
21986
+ [/\b[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g, "<jwt>"],
21987
+ // Any long opaque run — codex's refresh_token is ~211 chars of this. 40 is comfortably above the
21988
+ // longest ordinary word, an ISO timestamp, or a UUID (36, and a UUID is not a secret).
21989
+ [/\b[A-Za-z0-9_-]{40,}\b/g, "<redacted>"]
21990
+ ];
21991
+ function scrubSecrets(line) {
21992
+ let out = line;
21993
+ for (const [pattern, replacement] of SECRET_SHAPES)
21994
+ out = out.replace(pattern, replacement);
21995
+ return out;
21996
+ }
21997
+ var MAX_DIAGNOSTIC_LINES = 200;
21998
+ function isAuthDiagnostic(line) {
21999
+ const flat = line.trim();
22000
+ if (!flat)
22001
+ return false;
22002
+ return AUTH_DIAGNOSTIC.some((pattern) => pattern.test(flat));
22003
+ }
22004
+ function createStderrDiagnosticFilter(emit, maxLines = MAX_DIAGNOSTIC_LINES) {
22005
+ let buffered = "";
22006
+ let emitted = 0;
22007
+ return (chunk) => {
22008
+ buffered += chunk.toString();
22009
+ const lines2 = buffered.split(/\r?\n/);
22010
+ buffered = lines2.pop() ?? "";
22011
+ if (buffered.length > MAX_BUFFERED_CHARS)
22012
+ buffered = buffered.slice(0, MAX_LINE_CHARS);
22013
+ for (const line of lines2) {
22014
+ if (emitted >= maxLines)
22015
+ return;
22016
+ if (!isAuthDiagnostic(line))
22017
+ continue;
22018
+ emitted += 1;
22019
+ const cleaned = scrubSecrets(line.trim()).slice(0, MAX_LINE_CHARS);
22020
+ if (emitted === maxLines) {
22021
+ emit(`${cleaned} [codex auth diagnostics capped at ${maxLines} lines]`);
22022
+ return;
22023
+ }
22024
+ emit(cleaned);
22025
+ }
22026
+ };
22027
+ }
22028
+
22029
+ // ../../packages/agent-client/dist/providers/codex/server-manager.js
21966
22030
  var CodexServerManager = class {
21967
22031
  client = null;
21968
22032
  process = null;
@@ -22021,8 +22085,12 @@ var CodexServerManager = class {
22021
22085
  throw new Error("Failed to spawn codex app-server: stdio not available");
22022
22086
  }
22023
22087
  const rpcClient = new CodexJsonRpcClient(child.stdin, child.stdout);
22024
- child.stderr?.on("data", () => {
22088
+ const emitDiagnostic = config2?.onStderrDiagnostic ?? ((line) => {
22089
+ process.stderr.write(`[codex-stderr] ${line}
22090
+ `);
22025
22091
  });
22092
+ const consumeStderr = createStderrDiagnosticFilter(emitDiagnostic);
22093
+ child.stderr?.on("data", consumeStderr);
22026
22094
  child.on("exit", () => {
22027
22095
  rpcClient.close();
22028
22096
  this.process = null;
@@ -42369,7 +42437,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
42369
42437
  }
42370
42438
 
42371
42439
  // src/_generated/version.ts
42372
- var PKG_VERSION = "0.4.50";
42440
+ var PKG_VERSION = "0.4.52";
42373
42441
 
42374
42442
  // src/api-base-url-migrate.ts
42375
42443
  var import_node_fs4 = __toESM(require("node:fs"), 1);
@@ -45096,6 +45164,12 @@ function resolveInstallationId(stateDir) {
45096
45164
  // src/telemetry/daily-uploader.ts
45097
45165
  var ROWS_FILE_RE = /^rows-(.+)-(\d{4}-\d{2}-\d{2})\.jsonl$/;
45098
45166
  var GATE_FILE_RE = /^gate-(.+)-(\d{4}-\d{2}-\d{2})\.jsonl$/;
45167
+ var MAX_CAUSE_CHARS = 512;
45168
+ function truncateCause(err) {
45169
+ const message = err instanceof Error ? err.message : String(err);
45170
+ if (message.length <= MAX_CAUSE_CHARS) return message;
45171
+ return `${message.slice(0, MAX_CAUSE_CHARS - 3)}...`;
45172
+ }
45099
45173
  async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45100
45174
  const telemetryDir = (0, import_node_path16.join)(stateDir, "telemetry");
45101
45175
  let files;
@@ -45153,6 +45227,7 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45153
45227
  continue;
45154
45228
  }
45155
45229
  let success2 = false;
45230
+ let lastError = null;
45156
45231
  try {
45157
45232
  let raw = "";
45158
45233
  if (cur.rowsPath !== null) {
@@ -45208,7 +45283,8 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45208
45283
  }
45209
45284
  await client.postTelemetry(targetProject, gateResult.artifact);
45210
45285
  success2 = true;
45211
- } catch {
45286
+ } catch (err) {
45287
+ lastError = truncateCause(err);
45212
45288
  success2 = false;
45213
45289
  }
45214
45290
  if (success2) {
@@ -45244,7 +45320,8 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45244
45320
  const nextAttemptAt = now + delayMs2;
45245
45321
  const newFailureState = {
45246
45322
  failureCount: newFailureCount,
45247
- nextAttemptAt
45323
+ nextAttemptAt,
45324
+ lastError
45248
45325
  };
45249
45326
  const tmpFailurePath = `${failurePath}.tmp-${process.pid}-${Math.random().toString(36).slice(2)}`;
45250
45327
  try {
@@ -45254,7 +45331,9 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45254
45331
  console.error(`uploadPendingDays: failed to write failure state for ${cur.projectSlug}/${cur.day}`, writeErr);
45255
45332
  }
45256
45333
  if (!failureState) {
45257
- console.error(`uploadPendingDays: partition ${cur.projectSlug}/${cur.day} entering backoff after first failure`);
45334
+ console.error(
45335
+ `uploadPendingDays: partition ${cur.projectSlug}/${cur.day} entering backoff after first failure: ${lastError ?? "cause unavailable"}`
45336
+ );
45258
45337
  }
45259
45338
  }
45260
45339
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.50",
3
+ "version": "0.4.52",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"
@@ -21,9 +21,9 @@
21
21
  "@types/ws": "^8.18.1",
22
22
  "esbuild": "^0.24.0",
23
23
  "tsx": "^4.22.3",
24
+ "@mrrlin/director-e2e": "0.0.0",
24
25
  "@mrrlin/agent-client": "0.0.0",
25
26
  "@mrrlin/client": "0.0.0",
26
- "@mrrlin/director-e2e": "0.0.0",
27
27
  "@mrrlin/schemas": "0.0.0",
28
28
  "@mrrlin/tsconfig": "0.0.0",
29
29
  "@mrrlin/wiki": "0.0.0"