wontopos-mcp 1.0.5 → 1.0.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.
Files changed (2) hide show
  1. package/index.mjs +40 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -35,7 +35,14 @@ const READ_ONLY = flag(process.env.WONTOPOS_READ_ONLY);
35
35
  // do not even expose a user_id argument — a prompt-injected or confused model
36
36
  // cannot reach a sibling store. Opt out per install with ALLOW_STORE_OVERRIDE.
37
37
  const ALLOW_STORE_OVERRIDE = flag(process.env.WONTOPOS_ALLOW_STORE_OVERRIDE);
38
- const STORE = process.env.WONTOPOS_USER_ID || "default";
38
+ // Whether the store was CHOSEN or fallen back to. Worth tracking, because the
39
+ // fallback is silent in the worst way: if WONTOPOS_USER_ID never reaches this
40
+ // process (a typo in the host config, an --env that did not take), everything goes
41
+ // to `default` — and since every account is seeded with a `default` store, the boot
42
+ // check below SUCCEEDS, so nothing looks wrong while the configured store sits
43
+ // untouched. Say it out loud instead.
44
+ const STORE_FROM_ENV = (process.env.WONTOPOS_USER_ID || "").trim();
45
+ const STORE = STORE_FROM_ENV || "default";
39
46
  // Cap what a tool result may inject into the model's context. The SDK's 64MB cap
40
47
  // protects the process; this protects the conversation (a 2MB memory must not
41
48
  // become 2MB of context). Measured in UTF-8 BYTES, not JS chars: `str.length`
@@ -306,10 +313,24 @@ server.registerTool(
306
313
  "'deep_recall' searches then expands around the top match — thorough answer to one specific " +
307
314
  "question; 'timeline' returns memories ordered by when events happened — 'when did X', " +
308
315
  "histories; 'gather' expands around the top few matches — collect everything related to a " +
309
- "topic. Heavier than search, so reach for it when recall/search came back thin or the user " +
310
- "asks for a full picture.",
316
+ "topic; 'equilibrium' re-widens retrieval when a long session has narrowed it to whatever " +
317
+ "the current turn resembles — for replies that loop or flatten, not for a factual lookup; " +
318
+ "'tone_stabilizer' returns the assistant's OWN earlier words so it can come back to its " +
319
+ "usual register (needs turns stored with speaker \"me\"). " +
320
+ "Heavier than search, so reach for it when recall/search came back thin or the user asks " +
321
+ "for a full picture. Call the API's GET /api/v1/engram for the live catalogue.",
311
322
  inputSchema: {
312
- name: z.enum(["deep_recall", "timeline", "gather"]),
323
+ // A plain string, NOT an enum: the enum was pinned to the original three, so
324
+ // every engram the service added afterwards was uncallable from here until
325
+ // this package was republished. The API validates the name and answers 400
326
+ // with the list it accepts, so an unknown name fails clearly and a new engram
327
+ // works the day it ships.
328
+ name: z
329
+ .string()
330
+ .min(1)
331
+ .describe(
332
+ "Engram name: deep_recall | timeline | gather | equilibrium | tone_stabilizer (the service is the authority; an unknown name returns the accepted list)."
333
+ ),
313
334
  query: z.string().describe("What to retrieve, phrased like the user's need."),
314
335
  ...storeArg,
315
336
  },
@@ -367,13 +388,26 @@ await server.connect(transport);
367
388
  return inner?.(msg, extra);
368
389
  };
369
390
  }
370
- console.error(`wontopos-mcp ${VERSION} ready (store: ${STORE}${READ_ONLY ? ", read-only" : ""})`);
391
+ console.error(
392
+ `wontopos-mcp ${VERSION} ready (store: ${STORE}${STORE_FROM_ENV ? "" : " — FALLBACK: WONTOPOS_USER_ID is not set"}${READ_ONLY ? ", read-only" : ""})`
393
+ );
371
394
 
372
395
  // Boot check (one metered stats call, after connect so host startup never waits):
373
396
  // "ready" above is a claim — verify it. A wrong key can do nothing → exit loudly.
374
397
  // A missing store is recoverable (the agent can create_store) → warn and serve.
375
398
  mem.stats().then(
376
- (s) => console.error(`wontopos-mcp: store "${STORE}" verified (${s?.total_memories ?? "?"} memories).`),
399
+ (s) => {
400
+ console.error(`wontopos-mcp: store "${STORE}" verified (${s?.total_memories ?? "?"} memories).`);
401
+ // Verified, but on the fallback store — the case a misconfiguration hides in.
402
+ // The seeded `default` always exists, so this check passes and the operator has
403
+ // no other signal that the store they configured is not the one in use.
404
+ if (!STORE_FROM_ENV) {
405
+ console.error(
406
+ 'wontopos-mcp: WONTOPOS_USER_ID is not set, so this server is using the seeded "default" store. ' +
407
+ "If you meant a different store, set WONTOPOS_USER_ID in the MCP server's env and restart."
408
+ );
409
+ }
410
+ },
377
411
  (e) => {
378
412
  const status = e instanceof WosError ? e.status : 0;
379
413
  if (status === 401) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wontopos-mcp",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "mcpName": "com.wontopos/mcp",
5
5
  "description": "(beta) Wontopos (WOS) long-term memory as an MCP server — one memory across Claude Code, Claude Desktop, Cursor, ChatGPT, and your own agents.",
6
6
  "keywords": [