virlow-mcp 3.14.3 → 3.14.4

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/cli.js +43 -3
  2. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -120,7 +120,7 @@ var VirlowApi = class {
120
120
  // ../../packages/mcp-core/dist/vault.js
121
121
  var LockedError = class extends Error {
122
122
  };
123
- var Vault = class {
123
+ var Vault = class _Vault {
124
124
  autoLockMs;
125
125
  _session = null;
126
126
  _timerHandle = null;
@@ -177,10 +177,50 @@ var Vault = class {
177
177
  }
178
178
  return this._session;
179
179
  }
180
+ /**
181
+ * The largest delay `setTimeout` can actually hold: a 32-bit signed integer
182
+ * of milliseconds, about 24.9 days.
183
+ */
184
+ static MAX_TIMEOUT_MS = 2147483647;
185
+ /**
186
+ * Arm the auto-lock, unless the configured delay cannot be one.
187
+ *
188
+ * The guard is the whole point. `setTimeout` does not treat an out-of-range
189
+ * delay as "later" or as an error — it coerces it to **1 millisecond** and
190
+ * fires:
191
+ *
192
+ * TimeoutOverflowWarning: Infinity does not fit into a 32-bit signed
193
+ * integer. Timeout duration was set to 1.
194
+ *
195
+ * So `new Vault(Number.POSITIVE_INFINITY)`, which reads as "never auto-lock,
196
+ * something else owns the timeout", locked the vault a millisecond after
197
+ * every unlock and every touch. The hosted connector is built exactly that
198
+ * way — its session store owns the idle timeout — and the result was a vault
199
+ * that reported itself unlocked on the request that opened it and locked on
200
+ * every request after:
201
+ *
202
+ * status -> {"locked": false, "email": "..."}
203
+ * list_folders -> "Vault is locked." (2 seconds later, same session)
204
+ *
205
+ * Nothing in the store was wrong, which is what made it so hard to see: the
206
+ * session was found on every request, and the vault built from it had already
207
+ * locked itself. touch() re-armed the same 1ms timer, so activity made it
208
+ * worse rather than better.
209
+ *
210
+ * A delay that cannot be scheduled therefore means no auto-lock at all, which
211
+ * is what every caller passing one intends. Zero and negatives are the same
212
+ * case — a vault that locks on the next tick is not a security posture, it is
213
+ * a broken one — and a caller wanting an immediate lock has `lock()`.
214
+ */
180
215
  _scheduleAutoLock() {
216
+ const ms = this.autoLockMs;
217
+ if (!Number.isFinite(ms) || ms <= 0 || ms > _Vault.MAX_TIMEOUT_MS) {
218
+ this._timerHandle = null;
219
+ return;
220
+ }
181
221
  this._timerHandle = setTimeout(() => {
182
222
  this.lock();
183
- }, this.autoLockMs);
223
+ }, ms);
184
224
  this._timerHandle.unref?.();
185
225
  }
186
226
  _clearTimer() {
@@ -1881,7 +1921,7 @@ function startUnlockServer(api, vault, opts = {}) {
1881
1921
  }
1882
1922
 
1883
1923
  // src/version.ts
1884
- var VERSION = true ? "3.14.3" : "dev";
1924
+ var VERSION = true ? "3.14.4" : "dev";
1885
1925
 
1886
1926
  // src/server.ts
1887
1927
  function defaultEmbeddingCacheDir() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virlow-mcp",
3
- "version": "3.14.3",
3
+ "version": "3.14.4",
4
4
  "description": "Local MCP server for Virlow Secure Notes: end-to-end-encrypted AI memories and notes for Cursor, Claude, Codex, and any MCP client.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,9 +34,9 @@
34
34
  "esbuild": "^0.25.0",
35
35
  "typescript": "^5.8.0",
36
36
  "vitest": "^3.0.0",
37
- "@batalabs/virlow-crypto": "3.14.3",
38
- "@batalabs/virlow-memory": "3.14.3",
39
- "@batalabs/virlow-mcp-core": "3.14.3"
37
+ "@batalabs/virlow-crypto": "3.14.4",
38
+ "@batalabs/virlow-memory": "3.14.4",
39
+ "@batalabs/virlow-mcp-core": "3.14.4"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "node build.mjs",