laminark 2.22.4 → 2.22.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laminark",
3
- "version": "2.22.4",
3
+ "version": "2.22.6",
4
4
  "description": "Persistent adaptive memory for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "laminark",
3
3
  "description": "Persistent adaptive memory for Claude Code. Automatic observation capture, semantic search, topic detection, knowledge graph, and web visualization.",
4
- "version": "2.22.4",
4
+ "version": "2.22.6",
5
5
  "author": {
6
6
  "name": "NoobyNull"
7
7
  },
@@ -6629,10 +6629,10 @@ function safeParseJson(json) {
6629
6629
  *
6630
6630
  * @module web/routes/admin
6631
6631
  */
6632
- const __dirname = dirname(fileURLToPath$1(import.meta.url));
6632
+ const __dirname$1 = dirname(fileURLToPath$1(import.meta.url));
6633
6633
  const LAMINARK_VERSION = (() => {
6634
6634
  try {
6635
- return JSON.parse(readFileSync(join(__dirname, "..", "..", "package.json"), "utf-8")).version || "unknown";
6635
+ return JSON.parse(readFileSync(join(__dirname$1, "..", "..", "package.json"), "utf-8")).version || "unknown";
6636
6636
  } catch {
6637
6637
  return "unknown";
6638
6638
  }
@@ -7175,6 +7175,67 @@ function startWebServer(app, port = 37820) {
7175
7175
  return server;
7176
7176
  }
7177
7177
 
7178
+ //#endregion
7179
+ //#region src/mcp/version-check.ts
7180
+ /**
7181
+ * Update-available notification for Laminark.
7182
+ *
7183
+ * Checks the npm registry for a newer version and queues a notification
7184
+ * if one is found. All errors are silently caught — this is fire-and-forget.
7185
+ *
7186
+ * @module mcp/version-check
7187
+ */
7188
+ const __dirname = dirname(fileURLToPath$1(import.meta.url));
7189
+ /** Read the installed version from plugin.json (canonical source for plugin version). */
7190
+ function getInstalledVersion() {
7191
+ try {
7192
+ return JSON.parse(readFileSync(join(__dirname, "..", ".claude-plugin", "plugin.json"), "utf-8")).version || "unknown";
7193
+ } catch {
7194
+ return "unknown";
7195
+ }
7196
+ }
7197
+ /** Simple semver comparison: returns true if `a` is strictly less than `b`. */
7198
+ function isOlder(a, b) {
7199
+ const pa = a.split(".").map(Number);
7200
+ const pb = b.split(".").map(Number);
7201
+ for (let i = 0; i < 3; i++) {
7202
+ const av = pa[i] || 0;
7203
+ const bv = pb[i] || 0;
7204
+ if (av < bv) return true;
7205
+ if (av > bv) return false;
7206
+ }
7207
+ return false;
7208
+ }
7209
+ /**
7210
+ * Fire-and-forget update check. Queries the npm registry and queues a
7211
+ * notification via the store if a newer version is available.
7212
+ */
7213
+ async function checkForUpdate(store, projectHash) {
7214
+ try {
7215
+ const installed = getInstalledVersion();
7216
+ if (installed === "unknown") {
7217
+ debug("mcp", "Version check skipped: could not read installed version");
7218
+ return;
7219
+ }
7220
+ const res = await fetch("https://registry.npmjs.org/laminark/latest", { signal: AbortSignal.timeout(8e3) });
7221
+ if (!res.ok) {
7222
+ debug("mcp", `Version check: registry returned ${res.status}`);
7223
+ return;
7224
+ }
7225
+ const latest = (await res.json()).version;
7226
+ if (!latest) {
7227
+ debug("mcp", "Version check: no version field in registry response");
7228
+ return;
7229
+ }
7230
+ if (isOlder(installed, latest)) {
7231
+ debug("mcp", `Update available: ${installed} -> ${latest}`);
7232
+ store.add(projectHash, `Update available: v${installed} → v${latest}. Run: npx laminark@latest update`);
7233
+ } else debug("mcp", `Version check: up to date (${installed})`);
7234
+ } catch (err) {
7235
+ debug("mcp", "Version check failed", { error: err.message });
7236
+ }
7237
+ }
7238
+
7178
7239
  //#endregion
7179
7240
  //#region src/index.ts
7180
7241
  const noGui = process.argv.includes("--no_gui");
@@ -7370,6 +7431,7 @@ const haikuProcessor = new HaikuProcessor(db.db, projectHashRef.current, {
7370
7431
  });
7371
7432
  startServer(server).then(() => {
7372
7433
  haikuProcessor.start();
7434
+ checkForUpdate(notificationStore, projectHashRef.current);
7373
7435
  }).catch((err) => {
7374
7436
  debug("mcp", "Fatal: failed to start server", { error: err.message });
7375
7437
  clearInterval(embedTimer);