virlow-mcp 3.14.5 → 3.14.7

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 +62 -6
  2. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -18,6 +18,33 @@ var ApiError = class extends Error {
18
18
  this.name = "ApiError";
19
19
  }
20
20
  };
21
+ function describeErrorBody(data, fallback) {
22
+ if (typeof data !== "object" || data === null)
23
+ return fallback;
24
+ const d = data;
25
+ const raw = d.error ?? d.message;
26
+ if (raw === void 0 || raw === null)
27
+ return fallback;
28
+ if (typeof raw === "string")
29
+ return raw;
30
+ const issues = raw.issues;
31
+ if (Array.isArray(issues)) {
32
+ const lines = issues.map((issue) => {
33
+ const i = issue;
34
+ const path5 = Array.isArray(i.path) && i.path.length > 0 ? i.path.join(".") : "";
35
+ const message = typeof i.message === "string" ? i.message : "invalid";
36
+ return path5 ? `${path5}: ${message}` : message;
37
+ }).filter((line) => line.length > 0);
38
+ if (lines.length > 0)
39
+ return lines.join("; ");
40
+ }
41
+ try {
42
+ const text = JSON.stringify(raw);
43
+ return text.length > 300 ? `${text.slice(0, 297)}...` : text;
44
+ } catch {
45
+ return fallback;
46
+ }
47
+ }
21
48
  var VirlowApi = class {
22
49
  baseUrl;
23
50
  tokens = null;
@@ -47,8 +74,7 @@ var VirlowApi = class {
47
74
  return void 0;
48
75
  const data = await res.json().catch(() => ({}));
49
76
  if (!res.ok) {
50
- const d = data;
51
- throw new ApiError(res.status, d.error ?? d.message ?? res.statusText);
77
+ throw new ApiError(res.status, describeErrorBody(data, res.statusText));
52
78
  }
53
79
  return data;
54
80
  }
@@ -103,8 +129,38 @@ var VirlowApi = class {
103
129
  updateNote(id, body) {
104
130
  return this.request("PUT", `/api/notes/${id}`, body);
105
131
  }
106
- listFolders() {
107
- return this.request("GET", "/api/folders");
132
+ /**
133
+ * Every folder, not the first page of them.
134
+ *
135
+ * `GET /api/folders` is paginated and defaults to 20. This asked for it with
136
+ * no parameters and treated the answer as the whole set, so on an account
137
+ * with more folders than that the rest simply did not exist as far as this
138
+ * client was concerned.
139
+ *
140
+ * Nothing about that failed loudly. Folder exposure was computed from a
141
+ * partial list, so notes in later folders were invisible; and
142
+ * `resolveMemoryTree` could not find a Memories folder that was really
143
+ * there, tried to create one, and got a correct 409 "Memories folder already
144
+ * exists" — permanently, on every memory tool call, for any account past one
145
+ * page of folders. The recovery path re-listed and found nothing, because
146
+ * re-listing had the same blind spot.
147
+ *
148
+ * 50 is the API's maximum page size, so this is the fewest round trips
149
+ * available. `pages` comes from the response rather than being inferred from
150
+ * a short page: a server that clamps the limit would otherwise stop this
151
+ * after one request with no sign anything was missing.
152
+ */
153
+ async listFolders() {
154
+ const PAGE_SIZE = 50;
155
+ const folders = [];
156
+ for (let page = 1; ; page += 1) {
157
+ const result = await this.request("GET", `/api/folders?page=${page}&limit=${PAGE_SIZE}`);
158
+ folders.push(...result.folders);
159
+ const pages = result.pagination?.pages ?? 1;
160
+ if (page >= pages || result.folders.length === 0)
161
+ break;
162
+ }
163
+ return { folders };
108
164
  }
109
165
  createFolder(name, parentId, kind) {
110
166
  const body = {
@@ -887,7 +943,7 @@ async function ensureNamespace(api, tree, name) {
887
943
  }
888
944
 
889
945
  // ../../packages/mcp-core/dist/memories.js
890
- var SYNC_PAGE_LIMIT = 100;
946
+ var SYNC_PAGE_LIMIT = 50;
891
947
  var round3 = (n) => Math.round(n * 1e3) / 1e3;
892
948
  var MemoryStore = class {
893
949
  api;
@@ -1923,7 +1979,7 @@ function startUnlockServer(api, vault, opts = {}) {
1923
1979
  }
1924
1980
 
1925
1981
  // src/version.ts
1926
- var VERSION = true ? "3.14.5" : "dev";
1982
+ var VERSION = true ? "3.14.7" : "dev";
1927
1983
 
1928
1984
  // src/server.ts
1929
1985
  function defaultEmbeddingCacheDir() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virlow-mcp",
3
- "version": "3.14.5",
3
+ "version": "3.14.7",
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.5",
38
- "@batalabs/virlow-memory": "3.14.5",
39
- "@batalabs/virlow-mcp-core": "3.14.5"
37
+ "@batalabs/virlow-memory": "3.14.7",
38
+ "@batalabs/virlow-mcp-core": "3.14.7",
39
+ "@batalabs/virlow-crypto": "3.14.7"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "node build.mjs",