@batalabs/virlow-mcp-core 3.11.11 → 3.11.12

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.
@@ -13,3 +13,14 @@ export { computeExposure, filteredNotice } from './exposure.js';
13
13
  export type { Exposure } from './exposure.js';
14
14
  export { EmbeddingCache } from './embedding-cache.js';
15
15
  export { MEMORIES_DISABLED_MESSAGE, memoriesAllowed } from './memories-enabled.js';
16
+ /**
17
+ * The MCP tool surface is NOT exported here. It lives at the `/tools` subpath,
18
+ * which is ESM-only, because it depends on @modelcontextprotocol/sdk — an
19
+ * ESM-only package. This entry point is dual-published (virlow-api is
20
+ * CommonJS and require()s it), and a CommonJS build of the tools would emit a
21
+ * require() of an ESM-only package: ERR_REQUIRE_ESM at runtime, and a tsc
22
+ * heap exhaustion at build time before it even got that far.
23
+ *
24
+ * CommonJS consumers reach the tools with `await import(...)`, which is legal
25
+ * from CJS and is how virlow-api will host them.
26
+ */
package/dist/cjs/index.js CHANGED
@@ -30,3 +30,14 @@ Object.defineProperty(exports, "EmbeddingCache", { enumerable: true, get: functi
30
30
  var memories_enabled_js_1 = require("./memories-enabled.js");
31
31
  Object.defineProperty(exports, "MEMORIES_DISABLED_MESSAGE", { enumerable: true, get: function () { return memories_enabled_js_1.MEMORIES_DISABLED_MESSAGE; } });
32
32
  Object.defineProperty(exports, "memoriesAllowed", { enumerable: true, get: function () { return memories_enabled_js_1.memoriesAllowed; } });
33
+ /**
34
+ * The MCP tool surface is NOT exported here. It lives at the `/tools` subpath,
35
+ * which is ESM-only, because it depends on @modelcontextprotocol/sdk — an
36
+ * ESM-only package. This entry point is dual-published (virlow-api is
37
+ * CommonJS and require()s it), and a CommonJS build of the tools would emit a
38
+ * require() of an ESM-only package: ERR_REQUIRE_ESM at runtime, and a tsc
39
+ * heap exhaustion at build time before it even got that far.
40
+ *
41
+ * CommonJS consumers reach the tools with `await import(...)`, which is legal
42
+ * from CJS and is how virlow-api will host them.
43
+ */
package/dist/index.d.ts CHANGED
@@ -13,4 +13,15 @@ export { computeExposure, filteredNotice } from './exposure.js';
13
13
  export type { Exposure } from './exposure.js';
14
14
  export { EmbeddingCache } from './embedding-cache.js';
15
15
  export { MEMORIES_DISABLED_MESSAGE, memoriesAllowed } from './memories-enabled.js';
16
+ /**
17
+ * The MCP tool surface is NOT exported here. It lives at the `/tools` subpath,
18
+ * which is ESM-only, because it depends on @modelcontextprotocol/sdk — an
19
+ * ESM-only package. This entry point is dual-published (virlow-api is
20
+ * CommonJS and require()s it), and a CommonJS build of the tools would emit a
21
+ * require() of an ESM-only package: ERR_REQUIRE_ESM at runtime, and a tsc
22
+ * heap exhaustion at build time before it even got that far.
23
+ *
24
+ * CommonJS consumers reach the tools with `await import(...)`, which is legal
25
+ * from CJS and is how virlow-api will host them.
26
+ */
16
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EACL,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,C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ChE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEnF;;;;;;;;;;GAUG"}
package/dist/index.js CHANGED
@@ -7,4 +7,15 @@ export { MEMORIES_ROOT_NAME, ensureNamespace, resolveMemoryTree, } from './memor
7
7
  export { computeExposure, filteredNotice } from './exposure.js';
8
8
  export { EmbeddingCache } from './embedding-cache.js';
9
9
  export { MEMORIES_DISABLED_MESSAGE, memoriesAllowed } from './memories-enabled.js';
10
+ /**
11
+ * The MCP tool surface is NOT exported here. It lives at the `/tools` subpath,
12
+ * which is ESM-only, because it depends on @modelcontextprotocol/sdk — an
13
+ * ESM-only package. This entry point is dual-published (virlow-api is
14
+ * CommonJS and require()s it), and a CommonJS build of the tools would emit a
15
+ * require() of an ESM-only package: ERR_REQUIRE_ESM at runtime, and a tsc
16
+ * heap exhaustion at build time before it even got that far.
17
+ *
18
+ * CommonJS consumers reach the tools with `await import(...)`, which is legal
19
+ * from CJS and is how virlow-api will host them.
20
+ */
10
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EACL,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EACL,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEnF;;;;;;;;;;GAUG"}
@@ -0,0 +1,90 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { VirlowApi } from './api.js';
3
+ import { Vault } from './vault.js';
4
+ import { NotesService } from './notes.js';
5
+ import { MemoryStore } from './memories.js';
6
+ import { EmbeddingCache } from './embedding-cache.js';
7
+ /**
8
+ * How a client is told to unlock, which is the one part of the tool surface
9
+ * that genuinely differs between deployments.
10
+ *
11
+ * Locally, unlocking opens a browser window on the user's own machine and the
12
+ * master password never leaves it. Hosted, there is no browser to open and the
13
+ * password reaches the server — so the copy a model reads has to differ too,
14
+ * and a single baked-in description would be wrong for one of them.
15
+ */
16
+ export interface UnlockStrategy {
17
+ /**
18
+ * The unlock tool's description. Read by the calling model, so it carries the
19
+ * instruction never to ask for or relay the password itself.
20
+ */
21
+ description: string;
22
+ /** Begin unlocking. Returns the text the tool replies with. */
23
+ begin(services: ServerServices): Promise<string>;
24
+ }
25
+ export interface BuildServerOptions {
26
+ apiUrl: string;
27
+ /** Name and version reported in the MCP handshake. */
28
+ serverInfo: {
29
+ name: string;
30
+ version: string;
31
+ };
32
+ /** See UnlockStrategy — local opens a browser, hosted cannot. */
33
+ unlock: UnlockStrategy;
34
+ /**
35
+ * Where a user's embedding cache lives. Required rather than defaulted: the
36
+ * local CLI writes an encrypted file under the user's home directory, and a
37
+ * shared server must not silently do the same thing for every account it
38
+ * serves. Callers state where it goes.
39
+ */
40
+ createEmbeddingCache: (userId: string) => EmbeddingCache;
41
+ /** transformers.js model cache directory (public ONNX weights only). */
42
+ modelCacheDir?: string;
43
+ autoLockMs?: number;
44
+ /**
45
+ * Whether to expose the memory tools at all. When false they are not
46
+ * registered, so `tools/list` does not advertise them and a client cannot
47
+ * call them — rather than advertising tools that always error, which reads
48
+ * as a broken server instead of a deliberate setting.
49
+ *
50
+ * Notes tools are unaffected either way.
51
+ */
52
+ memoriesEnabled?: boolean;
53
+ }
54
+ export interface BuiltServer {
55
+ server: McpServer;
56
+ vault: Vault;
57
+ }
58
+ /**
59
+ * The stateful half of the process: the API client, the unlocked vault, and
60
+ * the caches built on top of them.
61
+ *
62
+ * Separated from the McpServer because the HTTP transport needs a *new*
63
+ * McpServer per request (the SDK binds one server to one transport) while
64
+ * every request must see the *same* vault — otherwise a tool call would land
65
+ * on a freshly-locked vault and the user would be asked to unlock on every
66
+ * message.
67
+ */
68
+ export interface ServerServices {
69
+ api: VirlowApi;
70
+ vault: Vault;
71
+ memoryStore: MemoryStore;
72
+ notesService: NotesService;
73
+ }
74
+ /**
75
+ * Builds the virlow-mcp server: registers all 19 tools against a fresh
76
+ * VirlowApi/Vault/MemoryStore/NotesService, and returns the server plus the
77
+ * vault (exposed mainly so callers/tests can inspect lock state directly).
78
+ * Nothing here talks to the network or the model — that only happens once a
79
+ * tool handler actually runs.
80
+ */
81
+ export declare function createServices(opts: BuildServerOptions): ServerServices;
82
+ /**
83
+ * Register all 19 tools against the given services. Callers that need one
84
+ * server (stdio) can omit `services` and get a fresh set; the HTTP transport
85
+ * passes shared ones so every request talks to the same vault.
86
+ */
87
+ export declare function buildServer(opts: BuildServerOptions & {
88
+ services?: ServerServices;
89
+ }): BuiltServer;
90
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAY,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAe,KAAK,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,KAAK,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,iEAAiE;IACjE,MAAM,EAAE,cAAc,CAAC;IACvB;;;;;OAKG;IACH,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,cAAc,CAAC;IACzD,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B;AA0DD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAgCvE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,kBAAkB,GAAG;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAE,GACvD,WAAW,CA6bb"}
package/dist/tools.js ADDED
@@ -0,0 +1,399 @@
1
+ /**
2
+ * The MCP tool surface, shared by the local CLI and the hosted connector.
3
+ *
4
+ * This lives here rather than in apps/mcp because the design requires the
5
+ * access gates — folders.mcpEnabled and the memories opt-in — to have one
6
+ * implementation, not two. A second copy in virlow-api would drift, and the
7
+ * thing it would drift on is who can read which notes.
8
+ *
9
+ * Everything deployment-specific is injected (see BuildServerOptions): how a
10
+ * user is asked to unlock, where their embedding cache lives, and what the
11
+ * server calls itself.
12
+ */
13
+ import { z } from 'zod';
14
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
15
+ import { createEmbedder } from '@batalabs/virlow-memory';
16
+ import { ApiError, VirlowApi } from './api.js';
17
+ import { LockedError, Vault } from './vault.js';
18
+ import { NotesService } from './notes.js';
19
+ import { MemoryStore } from './memories.js';
20
+ import { filteredNotice } from './exposure.js';
21
+ import { MEMORIES_DISABLED_MESSAGE, memoriesAllowed } from './memories-enabled.js';
22
+ // ---------- small result helpers ----------
23
+ function textResult(text) {
24
+ return { content: [{ type: 'text', text }] };
25
+ }
26
+ function errorResult(text) {
27
+ return { content: [{ type: 'text', text }], isError: true };
28
+ }
29
+ /** LockedError -> vault's own "ask the user to unlock" message; ApiError ->
30
+ * "API error <status>: <message>"; anything else -> its message verbatim.
31
+ * Every tool handler is wrapped with this so a locked vault or a failed API
32
+ * call never crashes the process — it always comes back as a normal
33
+ * (isError: true) tool result the calling agent can read and act on. */
34
+ function mapError(err) {
35
+ if (err instanceof LockedError)
36
+ return err.message;
37
+ if (err instanceof ApiError)
38
+ return `API error ${err.status}: ${err.message}`;
39
+ if (err instanceof Error)
40
+ return err.message;
41
+ return String(err);
42
+ }
43
+ /** Wraps a tool handler body so any thrown error becomes a mapped, non-throwing
44
+ * CallToolResult instead of an uncaught rejection. */
45
+ function wrap(fn) {
46
+ return async (...args) => {
47
+ try {
48
+ return await fn(...args);
49
+ }
50
+ catch (err) {
51
+ return errorResult(mapError(err));
52
+ }
53
+ };
54
+ }
55
+ function formatSyncStats(stats) {
56
+ return `synced ${stats.added} new, ${stats.updated} changed, removed ${stats.removed}`;
57
+ }
58
+ /** `[source · tags · confidence]`, omitted entirely when a memory carries none. */
59
+ function formatMeta(meta) {
60
+ const parts = [];
61
+ if (meta.source)
62
+ parts.push(meta.source);
63
+ if (meta.tags?.length)
64
+ parts.push(meta.tags.join(', '));
65
+ if (meta.confidence)
66
+ parts.push(`confidence ${meta.confidence}`);
67
+ return parts.length > 0 ? ` [${parts.join(' · ')}]` : '';
68
+ }
69
+ const truncate = (text, max = 120) => text.length > max ? `${text.slice(0, max)}…` : text;
70
+ /**
71
+ * Builds the virlow-mcp server: registers all 19 tools against a fresh
72
+ * VirlowApi/Vault/MemoryStore/NotesService, and returns the server plus the
73
+ * vault (exposed mainly so callers/tests can inspect lock state directly).
74
+ * Nothing here talks to the network or the model — that only happens once a
75
+ * tool handler actually runs.
76
+ */
77
+ export function createServices(opts) {
78
+ const api = new VirlowApi(opts.apiUrl);
79
+ const vault = new Vault(opts.autoLockMs);
80
+ // The real transformers.js embedder is expensive to load (downloads/loads
81
+ // ~30MB of public model weights) and is not needed for most tool calls
82
+ // (unlock/lock/status/notes tools never embed). Loading it eagerly here
83
+ // would slow down every server start; instead this proxy defers the real
84
+ // load until the first .embed() call, and memoizes it so concurrent or
85
+ // repeated calls share one load.
86
+ let embedderPromise = null;
87
+ const getRealEmbedder = () => {
88
+ // On rejection (e.g. a transient network failure partway through the
89
+ // ~30MB download), clear the memo so the *next* call retries instead of
90
+ // replaying the same rejected promise forever — otherwise one flaky
91
+ // download would permanently poison every memory tool until restart.
92
+ embedderPromise ??= createEmbedder({ cacheDir: opts.modelCacheDir }).catch((err) => {
93
+ embedderPromise = null;
94
+ throw err;
95
+ });
96
+ return embedderPromise;
97
+ };
98
+ const lazyEmbedder = {
99
+ embed: (text) => getRealEmbedder().then((embedder) => embedder.embed(text)),
100
+ };
101
+ // The cache file is keyed by user, and the user is only known after unlock,
102
+ // so the store builds it lazily rather than taking an instance.
103
+ const memoryStore = new MemoryStore(api, vault, lazyEmbedder, opts.createEmbeddingCache);
104
+ const notesService = new NotesService(api, vault);
105
+ return { api, vault, memoryStore, notesService };
106
+ }
107
+ /**
108
+ * Register all 19 tools against the given services. Callers that need one
109
+ * server (stdio) can omit `services` and get a fresh set; the HTTP transport
110
+ * passes shared ones so every request talks to the same vault.
111
+ */
112
+ export function buildServer(opts) {
113
+ const { api, vault, memoryStore, notesService } = opts.services ?? createServices(opts);
114
+ const server = new McpServer(opts.serverInfo);
115
+ // ---------- vault lifecycle ----------
116
+ server.registerTool('unlock', { description: opts.unlock.description }, wrap(async () => textResult(await opts.unlock.begin({ api, vault, memoryStore, notesService }))));
117
+ server.registerTool('lock', {
118
+ description: 'Immediately lock the vault, discarding the in-memory decryption key and clearing all cached ' +
119
+ 'memories and notes. Use this when the user is done with a session or asks to lock explicitly. Safe to ' +
120
+ 'call even if already locked.',
121
+ }, wrap(async () => {
122
+ vault.lock();
123
+ return textResult('Locked.');
124
+ }));
125
+ server.registerTool('status', {
126
+ description: "Report whether the vault is currently locked or unlocked, and which account it's unlocked as. " +
127
+ 'Call this after unlock to confirm the user finished the browser form, and before any memory/notes ' +
128
+ 'tool if you are unsure of the current lock state.',
129
+ }, wrap(async () => {
130
+ return textResult(JSON.stringify(vault.status()));
131
+ }));
132
+ // ---------- memories (only when enabled) ----------
133
+ //
134
+ // Two layers, covering different failures. `memoriesEnabled` decides whether
135
+ // the tools are registered at all, so a client sees an honest tool list.
136
+ // `requireMemories` re-checks the account setting on every call, because a
137
+ // client that ignored notifications/tools/list_changed — or one mid-flight
138
+ // when the user flipped the switch — must still be refused.
139
+ const requireMemories = async () => {
140
+ // A locked vault is the more useful error and the store already raises it;
141
+ // do not mask it with a preference check that could not succeed anyway.
142
+ if (!vault.isUnlocked())
143
+ return;
144
+ if (!(await memoriesAllowed(api))) {
145
+ throw new Error(MEMORIES_DISABLED_MESSAGE);
146
+ }
147
+ };
148
+ if (opts.memoriesEnabled !== false) {
149
+ // ---------- memories ----------
150
+ server.registerTool('add_memory', {
151
+ description: 'Store a distilled fact about the user or project so any AI tool can recall it later. The label is a ' +
152
+ 'short title for the memory; the text is the fact itself. Use the namespace argument for ' +
153
+ 'project-specific facts (omit it for facts that apply everywhere). If a very similar memory already ' +
154
+ 'exists it is updated in place rather than duplicated. Memories are ordinary encrypted notes in the ' +
155
+ "user's Memories folder — they can read and edit them, metadata included, in the Virlow app. Requires " +
156
+ 'the vault to be unlocked. First use in this process downloads ~30MB of public embedding-model weights.',
157
+ inputSchema: {
158
+ label: z.string().min(1).max(80),
159
+ text: z.string().min(1).max(4000),
160
+ namespace: z.string().max(100).optional(),
161
+ tags: z.array(z.string().max(50)).max(20).optional(),
162
+ confidence: z.string().max(20).optional(),
163
+ source: z.string().max(50).optional(),
164
+ },
165
+ }, wrap(async (args) => {
166
+ const meta = {};
167
+ if (args.tags !== undefined)
168
+ meta.tags = args.tags;
169
+ if (args.confidence !== undefined)
170
+ meta.confidence = args.confidence;
171
+ if (args.source !== undefined)
172
+ meta.source = args.source;
173
+ await requireMemories();
174
+ const result = await memoryStore.add(args.label, args.text, args.namespace, meta);
175
+ const message = result.action === 'updated'
176
+ ? `updated existing memory ${result.id}`
177
+ : `stored ${result.id}`;
178
+ if (result.similar.length === 0)
179
+ return textResult(message);
180
+ // Below the merge threshold but close enough that the agent should
181
+ // know it may be restating something.
182
+ const lines = result.similar.map((s) => `- [${s.id}] (${s.similarity}) ${s.label} — ${truncate(s.text)}`);
183
+ return textResult(`${message}\n\nsimilar existing memories:\n${lines.join('\n')}`);
184
+ }));
185
+ server.registerTool('search_memory', {
186
+ description: 'Search stored memories by semantic similarity to a query. Call this at the start of a task with the ' +
187
+ "task topic to recall relevant facts before acting. Results are ranked by similarity; use namespace to " +
188
+ 'scope to a project. Requires the vault to be unlocked. First use in this process downloads ~30MB of ' +
189
+ 'public embedding-model weights.',
190
+ inputSchema: {
191
+ query: z.string().min(1).max(500),
192
+ namespace: z.string().max(100).optional(),
193
+ limit: z.number().int().min(1).max(50).optional(),
194
+ },
195
+ }, wrap(async (args) => {
196
+ await requireMemories();
197
+ // sync() and search() are kicked off back-to-back without an
198
+ // intervening await, so search()'s internal sync() call reuses the
199
+ // same in-flight promise (MemoryStore.sync's syncInFlight dedup)
200
+ // instead of triggering a second round trip.
201
+ const statsPromise = memoryStore.sync();
202
+ const resultsPromise = memoryStore.search(args.query, args.namespace, args.limit ?? 10);
203
+ const [stats, results] = await Promise.all([statsPromise, resultsPromise]);
204
+ const lines = results.map((r, i) => `${i + 1}. [${r.id}] (similarity ${r.similarity}) ${r.label} — ${r.text}${r.namespace ? ` (namespace: ${r.namespace})` : ''}${formatMeta(r.meta)}`);
205
+ const body = lines.length > 0 ? lines.join('\n') : '(no matching memories found)';
206
+ return textResult(`${body}\n\n${formatSyncStats(stats)}`);
207
+ }));
208
+ server.registerTool('list_memories', {
209
+ description: 'List cached memories, optionally filtered by namespace. Syncs with the server first so the list ' +
210
+ 'reflects the latest state across devices. Requires the vault to be unlocked.',
211
+ inputSchema: {
212
+ namespace: z.string().max(100).optional(),
213
+ limit: z.number().int().min(1).max(50).optional(),
214
+ },
215
+ }, wrap(async (args) => {
216
+ await requireMemories();
217
+ const stats = await memoryStore.sync();
218
+ const items = memoryStore.list(args.namespace).slice(0, args.limit ?? 50);
219
+ const lines = items.map((m, i) => `${i + 1}. [${m.id}] ${m.label} — ${m.text}${m.namespace ? ` (namespace: ${m.namespace})` : ''}${formatMeta(m.meta)}`);
220
+ const body = lines.length > 0 ? lines.join('\n') : '(no memories found)';
221
+ return textResult(`${body}\n\n${formatSyncStats(stats)}`);
222
+ }));
223
+ server.registerTool('update_memory', {
224
+ description: 'Update an existing memory by id. Any field you omit is left alone, including metadata you do not ' +
225
+ 'name and the date the memory was first created. Requires the vault to be unlocked.',
226
+ inputSchema: {
227
+ id: z.string().min(1),
228
+ label: z.string().min(1).max(80).optional(),
229
+ text: z.string().min(1).max(4000).optional(),
230
+ tags: z.array(z.string().max(50)).max(20).optional(),
231
+ confidence: z.string().max(20).optional(),
232
+ },
233
+ }, wrap(async (args) => {
234
+ if (args.label === undefined &&
235
+ args.text === undefined &&
236
+ args.tags === undefined &&
237
+ args.confidence === undefined) {
238
+ throw new Error('update_memory needs at least one of label, text, tags, or confidence');
239
+ }
240
+ const meta = {};
241
+ if (args.tags !== undefined)
242
+ meta.tags = args.tags;
243
+ if (args.confidence !== undefined)
244
+ meta.confidence = args.confidence;
245
+ const changes = { meta };
246
+ if (args.label !== undefined)
247
+ changes.label = args.label;
248
+ if (args.text !== undefined)
249
+ changes.text = args.text;
250
+ await requireMemories();
251
+ await memoryStore.update(args.id, changes);
252
+ return textResult(`updated memory ${args.id}`);
253
+ }));
254
+ server.registerTool('delete_memory', {
255
+ description: "Move a memory to the Trash by id. It stops being recalled immediately, and the user can restore it " +
256
+ 'from the Virlow app. Requires the vault to be unlocked.',
257
+ inputSchema: {
258
+ id: z.string().min(1),
259
+ },
260
+ }, wrap(async (args) => {
261
+ await requireMemories();
262
+ await memoryStore.delete(args.id);
263
+ return textResult(`trashed memory ${args.id}`);
264
+ }));
265
+ }
266
+ // ---------- notes ----------
267
+ server.registerTool('search_notes', {
268
+ description: 'Full-text search over note titles and content, returning matching notes with a short snippet. ' +
269
+ 'Requires the vault to be unlocked.',
270
+ inputSchema: {
271
+ query: z.string().min(1).max(500),
272
+ limit: z.number().int().min(1).max(50).optional(),
273
+ },
274
+ }, wrap(async (args) => {
275
+ const { results, scanned, truncated } = await notesService.searchNotes(args.query, args.limit ?? 20);
276
+ const lines = results.map((r, i) => `${i + 1}. [${r.id}] ${r.title} — ${r.snippet}`);
277
+ const body = lines.length > 0 ? lines.join('\n') : '(no matching notes found)';
278
+ const scanNote = truncated
279
+ ? `\n\n(scanned ${scanned} notes; more notes exist than were scanned — narrow your query for full coverage)`
280
+ : '';
281
+ return textResult(`${body}${scanNote}`);
282
+ }));
283
+ server.registerTool('list_notes', {
284
+ description: 'List notes with pagination, optionally filtered by folder or starred/archived state. Requires the ' +
285
+ 'vault to be unlocked.',
286
+ inputSchema: {
287
+ folderId: z.string().optional(),
288
+ starred: z.boolean().optional(),
289
+ archived: z.boolean().optional(),
290
+ page: z.number().int().min(1).optional(),
291
+ limit: z.number().int().min(1).max(50).optional(),
292
+ },
293
+ }, wrap(async (args) => {
294
+ const { notes, pagination, withheld, exposure } = await notesService.listNotes(args);
295
+ const lines = notes.map((n, i) => `${i + 1}. [${n.id}]${n.starred ? ' *' : ''} ${n.title}`);
296
+ const body = lines.length > 0 ? lines.join('\n') : '(no notes found)';
297
+ return textResult(`${body}\n\npage ${pagination.page} of ${pagination.pages} (${pagination.total} total)` +
298
+ filteredNotice(withheld, exposure));
299
+ }));
300
+ server.registerTool('list_folders', {
301
+ description: 'List the note folders exposed to MCP. Folders the user has not switched on are ' +
302
+ 'not listed; the response says how many were withheld. Requires the vault to be unlocked.',
303
+ }, wrap(async () => {
304
+ const { folders, withheld } = await notesService.listFolders();
305
+ const lines = folders.map((f, i) => `${i + 1}. [${f.id}] ${f.name}`);
306
+ const body = lines.length > 0 ? lines.join('\n') : '(no folders are exposed to MCP)';
307
+ const notice = withheld > 0
308
+ ? `\n\n(${withheld} folder${withheld === 1 ? '' : 's'} not shown: not exposed to MCP. ` +
309
+ 'Turn on "Expose to MCP" in a folder\'s settings in the Virlow app to include it.)'
310
+ : '';
311
+ return textResult(body + notice);
312
+ }));
313
+ server.registerTool('read_note', {
314
+ description: 'Read the full title and content of a note by id. Requires the vault to be unlocked.',
315
+ inputSchema: {
316
+ id: z.string().min(1),
317
+ },
318
+ }, wrap(async (args) => {
319
+ const note = await notesService.readNote(args.id);
320
+ return textResult(`# ${note.title}\n\n${note.content}`);
321
+ }));
322
+ server.registerTool('create_note', {
323
+ description: 'Create a new note with a title and content, optionally placed in a folder. Requires the vault to be ' +
324
+ 'unlocked.',
325
+ inputSchema: {
326
+ title: z.string().min(1).max(200),
327
+ content: z.string().max(50000).optional(),
328
+ folderId: z.string().optional(),
329
+ type: z.string().max(50).optional(),
330
+ },
331
+ }, wrap(async (args) => {
332
+ const note = await notesService.createNote(args.title, args.content ?? '', args.folderId, args.type);
333
+ return textResult(`created note ${note.id}`);
334
+ }));
335
+ server.registerTool('update_note', {
336
+ description: 'Update the title and/or content of an existing note by id. Only the provided fields are changed. ' +
337
+ 'Requires the vault to be unlocked.',
338
+ inputSchema: {
339
+ id: z.string().min(1),
340
+ title: z.string().min(1).max(200).optional(),
341
+ content: z.string().max(50000).optional(),
342
+ },
343
+ }, wrap(async (args) => {
344
+ await notesService.updateNote(args.id, { title: args.title, content: args.content });
345
+ return textResult(`updated note ${args.id}`);
346
+ }));
347
+ server.registerTool('move_note', {
348
+ description: 'Move a note into a different folder, or to no folder by passing folderId: null. Requires the vault ' +
349
+ 'to be unlocked.',
350
+ inputSchema: {
351
+ id: z.string().min(1),
352
+ folderId: z.string().nullable(),
353
+ },
354
+ }, wrap(async (args) => {
355
+ await notesService.moveNote(args.id, args.folderId);
356
+ return textResult(`moved note ${args.id}`);
357
+ }));
358
+ server.registerTool('set_star', {
359
+ description: 'Star or unstar a note by id. Requires the vault to be unlocked.',
360
+ inputSchema: {
361
+ id: z.string().min(1),
362
+ starred: z.boolean(),
363
+ },
364
+ }, wrap(async (args) => {
365
+ await notesService.setStar(args.id, args.starred);
366
+ return textResult(args.starred ? `starred note ${args.id}` : `unstarred note ${args.id}`);
367
+ }));
368
+ server.registerTool('archive_note', {
369
+ description: 'Archive or unarchive a note by id. Requires the vault to be unlocked.',
370
+ inputSchema: {
371
+ id: z.string().min(1),
372
+ archived: z.boolean(),
373
+ },
374
+ }, wrap(async (args) => {
375
+ await notesService.archiveNote(args.id, args.archived);
376
+ return textResult(args.archived ? `archived note ${args.id}` : `unarchived note ${args.id}`);
377
+ }));
378
+ server.registerTool('trash_note', {
379
+ description: 'Move a note to the trash by id. Requires the vault to be unlocked.',
380
+ inputSchema: {
381
+ id: z.string().min(1),
382
+ },
383
+ }, wrap(async (args) => {
384
+ await notesService.trashNote(args.id);
385
+ return textResult(`trashed note ${args.id}`);
386
+ }));
387
+ server.registerTool('create_folder', {
388
+ description: 'Create a new note folder, optionally nested under a parent folder. Requires the vault to be unlocked.',
389
+ inputSchema: {
390
+ name: z.string().min(1).max(100),
391
+ parentId: z.string().nullable().optional(),
392
+ },
393
+ }, wrap(async (args) => {
394
+ const folder = await notesService.createFolder(args.name, args.parentId);
395
+ return textResult(`created folder ${folder.id}`);
396
+ }));
397
+ return { server, vault };
398
+ }
399
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAiB,MAAM,yBA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,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SACtB;KACF,EACD,IAAI,CAAC,KAAK,EAAE,IAAoB,EAAE,EAAE;QAClC,MAAM,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtC,OAAO,UAAU,CAAC,gBAAgB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EACT,uGAAuG;QACzG,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;YAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;SAC3C;KACF,EACD,IAAI,CAAC,KAAK,EAAE,IAAgD,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzE,OAAO,UAAU,CAAC,kBAAkB,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batalabs/virlow-mcp-core",
3
- "version": "3.11.11",
3
+ "version": "3.11.12",
4
4
  "type": "module",
5
5
  "description": "Virlow MCP connector core: encrypted note and memory access, folder exposure, and the memories opt-in. Shared by the local virlow-mcp CLI and the hosted connector.",
6
6
  "license": "MIT",
@@ -14,12 +14,20 @@
14
14
  "types": "./dist/cjs/index.d.ts",
15
15
  "default": "./dist/cjs/index.js"
16
16
  }
17
+ },
18
+ "./tools": {
19
+ "import": {
20
+ "types": "./dist/tools.d.ts",
21
+ "default": "./dist/tools.js"
22
+ }
17
23
  }
18
24
  },
19
25
  "dependencies": {
26
+ "@modelcontextprotocol/sdk": "^1.12.0",
20
27
  "yaml": ">=2.8.3 <3",
21
- "@batalabs/virlow-memory": "3.11.11",
22
- "@batalabs/virlow-crypto": "3.11.11"
28
+ "zod": "^3.24.0",
29
+ "@batalabs/virlow-crypto": "3.11.12",
30
+ "@batalabs/virlow-memory": "3.11.12"
23
31
  },
24
32
  "devDependencies": {
25
33
  "@types/node": "^22.10.0",