mcp-agents-memory 0.9.31 → 0.9.32

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 +22 -15
  2. package/package.json +3 -2
package/build/index.js CHANGED
@@ -64249,26 +64249,31 @@ function sqliteSync() {
64249
64249
  }
64250
64250
  return _DatabaseSync3;
64251
64251
  }
64252
- function lookupPlatform(sessionId) {
64252
+ function lookupThread(sessionId) {
64253
+ const fallback = { platform: "codex-mcp-client", model: null };
64253
64254
  const DatabaseSync = sqliteSync();
64254
- if (!DatabaseSync) return "codex-mcp-client";
64255
+ if (!DatabaseSync) return fallback;
64255
64256
  let db2 = null;
64256
64257
  try {
64257
64258
  db2 = new DatabaseSync(stateDbPath(), { readOnly: true });
64258
64259
  const cols = new Set(
64259
64260
  db2.prepare("PRAGMA table_info(threads)").all().map((c) => String(c.name))
64260
64261
  );
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") {
64262
+ const select = [
64263
+ "source",
64264
+ cols.has("originator") ? "originator" : "NULL AS originator",
64265
+ cols.has("model") ? "model" : "NULL AS model"
64266
+ ].join(", ");
64267
+ const row = db2.prepare(`SELECT ${select} FROM threads WHERE id = ? LIMIT 1`).get(sessionId);
64268
+ if (!row) return fallback;
64269
+ const model = typeof row.model === "string" && row.model.trim() ? row.model.trim() : null;
64270
+ if (typeof row.originator === "string") {
64267
64271
  const byOriginator = originatorToPlatform(row.originator);
64268
- if (byOriginator) return byOriginator;
64272
+ if (byOriginator) return { platform: byOriginator, model };
64269
64273
  }
64270
64274
  const source = typeof row.source === "string" ? row.source.trim() : "";
64271
- if (source) return sourceToPlatform(source);
64275
+ if (source) return { platform: sourceToPlatform(source), model };
64276
+ return { platform: fallback.platform, model };
64272
64277
  } catch {
64273
64278
  } finally {
64274
64279
  try {
@@ -64276,7 +64281,7 @@ function lookupPlatform(sessionId) {
64276
64281
  } catch {
64277
64282
  }
64278
64283
  }
64279
- return "codex-mcp-client";
64284
+ return fallback;
64280
64285
  }
64281
64286
  var _state7 = null;
64282
64287
  var SERVER_START_MS3 = Date.now();
@@ -64329,11 +64334,12 @@ function captureSessionStart7(_cwd) {
64329
64334
  }
64330
64335
  const sessionId = extractSessionId2(path10.basename(filePath));
64331
64336
  if (!sessionId) continue;
64337
+ const thread = lookupThread(sessionId);
64332
64338
  _state7.files.set(filePath, {
64333
64339
  cursorBytes: stat.size,
64334
64340
  sessionId,
64335
- agentPlatform: lookupPlatform(sessionId),
64336
- currentModel: null,
64341
+ agentPlatform: thread.platform,
64342
+ currentModel: thread.model,
64337
64343
  parseState: { mirrors: [] }
64338
64344
  });
64339
64345
  count++;
@@ -64535,11 +64541,12 @@ async function flushAllFiles5() {
64535
64541
  } else {
64536
64542
  console.error(`\u{1F4DD} [Codex] new rollout detected: ${path10.basename(filePath)}`);
64537
64543
  }
64544
+ const thread = lookupThread(sessionId);
64538
64545
  fileState = {
64539
64546
  cursorBytes: initialCursor,
64540
64547
  sessionId,
64541
- agentPlatform: lookupPlatform(sessionId),
64542
- currentModel: null,
64548
+ agentPlatform: thread.platform,
64549
+ currentModel: thread.model,
64543
64550
  parseState: { mirrors: [] }
64544
64551
  };
64545
64552
  _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.32",
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,8 @@
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"
35
36
  },
36
37
  "keywords": [
37
38
  "mcp",