virlow-mcp 3.14.6 → 3.15.0

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 +38 -5
  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
  }
@@ -917,7 +943,7 @@ async function ensureNamespace(api, tree, name) {
917
943
  }
918
944
 
919
945
  // ../../packages/mcp-core/dist/memories.js
920
- var SYNC_PAGE_LIMIT = 100;
946
+ var SYNC_PAGE_LIMIT = 50;
921
947
  var round3 = (n) => Math.round(n * 1e3) / 1e3;
922
948
  var MemoryStore = class {
923
949
  api;
@@ -1357,6 +1383,11 @@ function mapError(err) {
1357
1383
  return String(err);
1358
1384
  }
1359
1385
  var CONTENT_FORMAT = 'CONTENT FORMAT: content is HTML, not Markdown. Virlow renders it in a rich-text editor, so Markdown syntax is stored and displayed literally \u2014 "# Heading" appears as those characters, not as a heading. Use <h1>-<h4>, <p>, <strong>, <em>, <u>, <s>, <mark>, <ul>/<ol>/<li>, <blockquote>, <pre><code>, <a href>, <hr>, <img src>, and <table>/<tr>/<th>/<td>. Task lists are <ul data-type="taskList"> with <li data-checked="true|false">. Wrap every paragraph in <p>; a bare newline is not a paragraph break. STYLE: never use em-dashes (\u2014). Use a comma, a colon, or two sentences.';
1386
+ function serverInstructions(memoriesEnabled) {
1387
+ const memory = "MEMORY: Virlow holds durable facts about this user, their preferences and their projects. At the start of a task, call search_memory with the topic of the task (and namespace set to the project, when there is one) before acting, so earlier decisions are honoured instead of rediscovered. When you learn something that will still be true next week and would be wasteful to work out again (a decision, a convention, a preference, a fact about the environment), call add_memory with a short label and the fact itself; do this without being asked. Do not store transient task state, secrets, or anything the user asked to keep out. Memories are ordinary encrypted notes the user can read and edit in the Virlow app. ";
1388
+ const notes = "NOTES: note content is HTML, never Markdown; wrap paragraphs in <p>. Never use em-dashes. If a tool reports the vault is locked, call unlock, tell the user to finish in the browser, and confirm with status before retrying.";
1389
+ return (memoriesEnabled ? memory : "") + notes;
1390
+ }
1360
1391
  var HTML_FIELD_HINT = "Note body as HTML (not Markdown). Paragraphs in <p>, headings in <h1>-<h4>. See the tool description for the full tag list.";
1361
1392
  function wrap(fn) {
1362
1393
  return async (...args) => {
@@ -1401,7 +1432,9 @@ function createServices(opts) {
1401
1432
  }
1402
1433
  function buildServer(opts) {
1403
1434
  const { api, vault, memoryStore, notesService } = opts.services ?? createServices(opts);
1404
- const server = new McpServer(opts.serverInfo);
1435
+ const server = new McpServer(opts.serverInfo, {
1436
+ instructions: serverInstructions(opts.memoriesEnabled !== false)
1437
+ });
1405
1438
  server.registerTool("unlock", { description: opts.unlock.description }, wrap(async () => textResult(await opts.unlock.begin({ api, vault, memoryStore, notesService }))));
1406
1439
  server.registerTool("lock", {
1407
1440
  description: "Immediately lock the vault, discarding the in-memory decryption key and clearing all cached memories and notes. Use this when the user is done with a session or asks to lock explicitly. Safe to call even if already locked."
@@ -1953,7 +1986,7 @@ function startUnlockServer(api, vault, opts = {}) {
1953
1986
  }
1954
1987
 
1955
1988
  // src/version.ts
1956
- var VERSION = true ? "3.14.6" : "dev";
1989
+ var VERSION = true ? "3.15.0" : "dev";
1957
1990
 
1958
1991
  // src/server.ts
1959
1992
  function defaultEmbeddingCacheDir() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virlow-mcp",
3
- "version": "3.14.6",
3
+ "version": "3.15.0",
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.6",
38
- "@batalabs/virlow-memory": "3.14.6",
39
- "@batalabs/virlow-mcp-core": "3.14.6"
37
+ "@batalabs/virlow-crypto": "3.15.0",
38
+ "@batalabs/virlow-mcp-core": "3.15.0",
39
+ "@batalabs/virlow-memory": "3.15.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "node build.mjs",