@mrrlin-dev/mcp 0.4.44 → 0.4.45

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 +33 -11
  2. package/package.json +4 -4
package/dist/bin.cjs CHANGED
@@ -42295,7 +42295,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
42295
42295
  }
42296
42296
 
42297
42297
  // src/_generated/version.ts
42298
- var PKG_VERSION = "0.4.44";
42298
+ var PKG_VERSION = "0.4.45";
42299
42299
 
42300
42300
  // src/api-base-url-migrate.ts
42301
42301
  var import_node_fs3 = __toESM(require("node:fs"), 1);
@@ -45021,6 +45021,7 @@ function resolveInstallationId(stateDir) {
45021
45021
 
45022
45022
  // src/telemetry/daily-uploader.ts
45023
45023
  var ROWS_FILE_RE = /^rows-(.+)-(\d{4}-\d{2}-\d{2})\.jsonl$/;
45024
+ var GATE_FILE_RE = /^gate-(.+)-(\d{4}-\d{2}-\d{2})\.jsonl$/;
45024
45025
  async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45025
45026
  const telemetryDir = (0, import_node_path15.join)(stateDir, "telemetry");
45026
45027
  let files;
@@ -45030,21 +45031,39 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45030
45031
  if (err?.code === "ENOENT") return;
45031
45032
  throw err;
45032
45033
  }
45033
- const pending = [];
45034
+ const discovered = /* @__PURE__ */ new Map();
45034
45035
  for (const file2 of files) {
45035
- const match = ROWS_FILE_RE.exec(file2);
45036
+ const rowsMatch = ROWS_FILE_RE.exec(file2);
45037
+ const match = rowsMatch ?? GATE_FILE_RE.exec(file2);
45036
45038
  if (!match) continue;
45037
45039
  const [, projectSlug, day] = match;
45040
+ const key = `${projectSlug}\0${day}`;
45041
+ const entry = discovered.get(key) ?? { projectSlug, day, rowsPath: null };
45042
+ if (rowsMatch) entry.rowsPath = (0, import_node_path15.join)(telemetryDir, file2);
45043
+ discovered.set(key, entry);
45044
+ }
45045
+ const today = telemetryDay();
45046
+ const pending = [];
45047
+ const deferred = [];
45048
+ for (const { projectSlug, day, rowsPath } of discovered.values()) {
45038
45049
  const markerPath = (0, import_node_path15.join)(telemetryDir, `.processed-${projectSlug}-${day}`);
45050
+ if (rowsPath === null && day >= today) {
45051
+ try {
45052
+ await (0, import_promises6.access)(markerPath);
45053
+ } catch {
45054
+ deferred.push({ projectSlug, day });
45055
+ }
45056
+ continue;
45057
+ }
45039
45058
  try {
45040
45059
  await (0, import_promises6.access)(markerPath);
45041
45060
  } catch {
45042
- pending.push({ projectSlug, day, rowsPath: (0, import_node_path15.join)(telemetryDir, file2), markerPath });
45061
+ pending.push({ projectSlug, day, rowsPath, markerPath });
45043
45062
  }
45044
45063
  }
45045
45064
  if (pending.length === 0) return;
45046
45065
  const knownCrashCount = bridgeHealth.knownCrashCount() ?? 0;
45047
- const fullUnprocessed = pending.map((p) => ({ projectSlug: p.projectSlug, day: p.day }));
45066
+ const fullUnprocessed = [...pending.map((p) => ({ projectSlug: p.projectSlug, day: p.day })), ...deferred];
45048
45067
  pending.sort((a, b) => a.day.localeCompare(b.day));
45049
45068
  for (const cur of pending) {
45050
45069
  const failurePath = (0, import_node_path15.join)(telemetryDir, `.failed-${cur.projectSlug}-${cur.day}.json`);
@@ -45061,12 +45080,14 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45061
45080
  }
45062
45081
  let success2 = false;
45063
45082
  try {
45064
- let raw;
45065
- try {
45066
- raw = await (0, import_promises6.readFile)(cur.rowsPath, "utf8");
45067
- } catch (err) {
45068
- console.error(`uploadPendingDays: failed to read ${cur.rowsPath}`, err);
45069
- throw err;
45083
+ let raw = "";
45084
+ if (cur.rowsPath !== null) {
45085
+ try {
45086
+ raw = await (0, import_promises6.readFile)(cur.rowsPath, "utf8");
45087
+ } catch (err) {
45088
+ console.error(`uploadPendingDays: failed to read ${cur.rowsPath}`, err);
45089
+ throw err;
45090
+ }
45070
45091
  }
45071
45092
  const rows = [];
45072
45093
  for (const line of raw.split("\n")) {
@@ -45088,6 +45109,7 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
45088
45109
  }
45089
45110
  } catch {
45090
45111
  }
45112
+ if (cur.rowsPath === null && gateCalls.length === 0) continue;
45091
45113
  const batch = {
45092
45114
  day: cur.day,
45093
45115
  bridgeVersion: PKG_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.44",
3
+ "version": "0.4.45",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"
@@ -22,11 +22,11 @@
22
22
  "esbuild": "^0.24.0",
23
23
  "tsx": "^4.22.3",
24
24
  "@mrrlin/agent-client": "0.0.0",
25
+ "@mrrlin/tsconfig": "0.0.0",
26
+ "@mrrlin/wiki": "0.0.0",
25
27
  "@mrrlin/client": "0.0.0",
26
28
  "@mrrlin/director-e2e": "0.0.0",
27
- "@mrrlin/schemas": "0.0.0",
28
- "@mrrlin/tsconfig": "0.0.0",
29
- "@mrrlin/wiki": "0.0.0"
29
+ "@mrrlin/schemas": "0.0.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "@iarna/toml": "^2.2.5",