mcp-agents-memory 0.9.31 → 0.9.33

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/build/index.js +25 -15
  2. package/package.json +4 -2
package/build/index.js CHANGED
@@ -63734,6 +63734,7 @@ async function maybeRunLibrarian() {
63734
63734
  }
63735
63735
  var COLDPATH_ADVISORY_LOCK_KEY = 4242000017;
63736
63736
  var lockClient = null;
63737
+ var ownedColdPath = false;
63737
63738
  async function acquireColdPathLock() {
63738
63739
  if (lockClient) return true;
63739
63740
  const client2 = await db.getClient();
@@ -63741,6 +63742,7 @@ async function acquireColdPathLock() {
63741
63742
  const res = await client2.query("SELECT pg_try_advisory_lock($1) AS got", [COLDPATH_ADVISORY_LOCK_KEY]);
63742
63743
  if (res.rows[0]?.got === true) {
63743
63744
  lockClient = client2;
63745
+ ownedColdPath = true;
63744
63746
  return true;
63745
63747
  }
63746
63748
  client2.release();
@@ -63812,6 +63814,7 @@ function stopColdPathWorker() {
63812
63814
  console.error("\u{1F535} [ColdPath] stopped");
63813
63815
  }
63814
63816
  async function drainColdPath(maxTicks = 12) {
63817
+ if (!ownedColdPath) return 0;
63815
63818
  let waitCount = 0;
63816
63819
  while (running && waitCount < 30) {
63817
63820
  await new Promise((r) => setTimeout(r, 100));
@@ -64249,26 +64252,31 @@ function sqliteSync() {
64249
64252
  }
64250
64253
  return _DatabaseSync3;
64251
64254
  }
64252
- function lookupPlatform(sessionId) {
64255
+ function lookupThread(sessionId) {
64256
+ const fallback = { platform: "codex-mcp-client", model: null };
64253
64257
  const DatabaseSync = sqliteSync();
64254
- if (!DatabaseSync) return "codex-mcp-client";
64258
+ if (!DatabaseSync) return fallback;
64255
64259
  let db2 = null;
64256
64260
  try {
64257
64261
  db2 = new DatabaseSync(stateDbPath(), { readOnly: true });
64258
64262
  const cols = new Set(
64259
64263
  db2.prepare("PRAGMA table_info(threads)").all().map((c) => String(c.name))
64260
64264
  );
64261
- const hasOriginator = cols.has("originator");
64262
- const row = db2.prepare(
64263
- hasOriginator ? "SELECT source, originator FROM threads WHERE id = ? LIMIT 1" : "SELECT source FROM threads WHERE id = ? LIMIT 1"
64264
- ).get(sessionId);
64265
- if (!row) return "codex-mcp-client";
64266
- if (hasOriginator && typeof row.originator === "string") {
64265
+ const select = [
64266
+ "source",
64267
+ cols.has("originator") ? "originator" : "NULL AS originator",
64268
+ cols.has("model") ? "model" : "NULL AS model"
64269
+ ].join(", ");
64270
+ const row = db2.prepare(`SELECT ${select} FROM threads WHERE id = ? LIMIT 1`).get(sessionId);
64271
+ if (!row) return fallback;
64272
+ const model = typeof row.model === "string" && row.model.trim() ? row.model.trim() : null;
64273
+ if (typeof row.originator === "string") {
64267
64274
  const byOriginator = originatorToPlatform(row.originator);
64268
- if (byOriginator) return byOriginator;
64275
+ if (byOriginator) return { platform: byOriginator, model };
64269
64276
  }
64270
64277
  const source = typeof row.source === "string" ? row.source.trim() : "";
64271
- if (source) return sourceToPlatform(source);
64278
+ if (source) return { platform: sourceToPlatform(source), model };
64279
+ return { platform: fallback.platform, model };
64272
64280
  } catch {
64273
64281
  } finally {
64274
64282
  try {
@@ -64276,7 +64284,7 @@ function lookupPlatform(sessionId) {
64276
64284
  } catch {
64277
64285
  }
64278
64286
  }
64279
- return "codex-mcp-client";
64287
+ return fallback;
64280
64288
  }
64281
64289
  var _state7 = null;
64282
64290
  var SERVER_START_MS3 = Date.now();
@@ -64329,11 +64337,12 @@ function captureSessionStart7(_cwd) {
64329
64337
  }
64330
64338
  const sessionId = extractSessionId2(path10.basename(filePath));
64331
64339
  if (!sessionId) continue;
64340
+ const thread = lookupThread(sessionId);
64332
64341
  _state7.files.set(filePath, {
64333
64342
  cursorBytes: stat.size,
64334
64343
  sessionId,
64335
- agentPlatform: lookupPlatform(sessionId),
64336
- currentModel: null,
64344
+ agentPlatform: thread.platform,
64345
+ currentModel: thread.model,
64337
64346
  parseState: { mirrors: [] }
64338
64347
  });
64339
64348
  count++;
@@ -64535,11 +64544,12 @@ async function flushAllFiles5() {
64535
64544
  } else {
64536
64545
  console.error(`\u{1F4DD} [Codex] new rollout detected: ${path10.basename(filePath)}`);
64537
64546
  }
64547
+ const thread = lookupThread(sessionId);
64538
64548
  fileState = {
64539
64549
  cursorBytes: initialCursor,
64540
64550
  sessionId,
64541
- agentPlatform: lookupPlatform(sessionId),
64542
- currentModel: null,
64551
+ agentPlatform: thread.platform,
64552
+ currentModel: thread.model,
64543
64553
  parseState: { mirrors: [] }
64544
64554
  };
64545
64555
  _state7.files.set(filePath, fileState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-agents-memory",
3
- "version": "0.9.31",
3
+ "version": "0.9.33",
4
4
  "description": "Long-term memory for AI agents with provenance tracking",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -31,7 +31,9 @@
31
31
  "check:registry": "esbuild scripts/check_project_registry.ts --bundle --platform=node --format=esm --outfile=node_modules/.cache/mcp-agents-memory/check_project_registry.mjs --log-level=warning && node node_modules/.cache/mcp-agents-memory/check_project_registry.mjs",
32
32
  "check:alias-evidence": "esbuild scripts/check_alias_evidence.ts --bundle --platform=node --format=esm --outfile=node_modules/.cache/mcp-agents-memory/check_alias_evidence.mjs --log-level=warning && node node_modules/.cache/mcp-agents-memory/check_alias_evidence.mjs",
33
33
  "check:retag": "esbuild scripts/check_ptag_retag.ts --bundle --platform=node --format=esm --outfile=node_modules/.cache/mcp-agents-memory/check_ptag_retag.mjs --log-level=warning && node node_modules/.cache/mcp-agents-memory/check_ptag_retag.mjs",
34
- "check:coldpath-gate": "esbuild scripts/check_coldpath_gate.ts --bundle --platform=node --format=esm --packages=external --outfile=node_modules/.cache/mcp-agents-memory/check_coldpath_gate.mjs --log-level=warning && node node_modules/.cache/mcp-agents-memory/check_coldpath_gate.mjs"
34
+ "check:coldpath-gate": "esbuild scripts/check_coldpath_gate.ts --bundle --platform=node --format=esm --packages=external --outfile=node_modules/.cache/mcp-agents-memory/check_coldpath_gate.mjs --log-level=warning && node node_modules/.cache/mcp-agents-memory/check_coldpath_gate.mjs",
35
+ "check:codex-arm": "esbuild scripts/check_codex_arm.ts --bundle --platform=node --format=esm --packages=external --outfile=node_modules/.cache/mcp-agents-memory/check_codex_arm.mjs --log-level=warning && node node_modules/.cache/mcp-agents-memory/check_codex_arm.mjs",
36
+ "check:coldpath-drain": "esbuild scripts/check_coldpath_drain.ts --bundle --platform=node --format=esm --packages=external --outfile=node_modules/.cache/mcp-agents-memory/check_coldpath_drain.mjs --log-level=warning && node node_modules/.cache/mcp-agents-memory/check_coldpath_drain.mjs"
35
37
  },
36
38
  "keywords": [
37
39
  "mcp",