@totalreclaw/mcp-server 3.5.2 → 3.5.3

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 (54) hide show
  1. package/README.md +31 -24
  2. package/SKILL.md +1 -1
  3. package/dist/dispatch.d.ts.map +1 -1
  4. package/dist/dispatch.js +9 -10
  5. package/dist/dispatch.js.map +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +38 -26
  8. package/dist/index.js.map +1 -1
  9. package/dist/prompts.d.ts +8 -8
  10. package/dist/prompts.d.ts.map +1 -1
  11. package/dist/prompts.js +21 -20
  12. package/dist/prompts.js.map +1 -1
  13. package/dist/server-setup.d.ts +2 -0
  14. package/dist/server-setup.d.ts.map +1 -1
  15. package/dist/server-setup.js +14 -1
  16. package/dist/server-setup.js.map +1 -1
  17. package/dist/subgraph/search.d.ts +14 -0
  18. package/dist/subgraph/search.d.ts.map +1 -1
  19. package/dist/subgraph/search.js +48 -0
  20. package/dist/subgraph/search.js.map +1 -1
  21. package/dist/tools/debrief.d.ts +51 -62
  22. package/dist/tools/debrief.d.ts.map +1 -1
  23. package/dist/tools/debrief.js +32 -39
  24. package/dist/tools/debrief.js.map +1 -1
  25. package/dist/tools/forget.d.ts +23 -0
  26. package/dist/tools/forget.d.ts.map +1 -1
  27. package/dist/tools/forget.js +48 -0
  28. package/dist/tools/forget.js.map +1 -1
  29. package/dist/tools/import-batch.d.ts.map +1 -1
  30. package/dist/tools/import-batch.js +2 -3
  31. package/dist/tools/import-batch.js.map +1 -1
  32. package/dist/tools/pair.js +1 -1
  33. package/dist/tools/pair.js.map +1 -1
  34. package/dist/tools/pin.d.ts.map +1 -1
  35. package/dist/tools/pin.js +4 -1
  36. package/dist/tools/pin.js.map +1 -1
  37. package/dist/tools/recall.d.ts +2 -0
  38. package/dist/tools/recall.d.ts.map +1 -1
  39. package/dist/tools/recall.js +1 -0
  40. package/dist/tools/recall.js.map +1 -1
  41. package/dist/tools/retype.d.ts.map +1 -1
  42. package/dist/tools/retype.js +4 -1
  43. package/dist/tools/retype.js.map +1 -1
  44. package/dist/tools/set-scope.d.ts.map +1 -1
  45. package/dist/tools/set-scope.js +6 -8
  46. package/dist/tools/set-scope.js.map +1 -1
  47. package/dist/tools/status.d.ts.map +1 -1
  48. package/dist/tools/status.js +4 -1
  49. package/dist/tools/status.js.map +1 -1
  50. package/dist/tools/write-errors.d.ts +34 -0
  51. package/dist/tools/write-errors.d.ts.map +1 -0
  52. package/dist/tools/write-errors.js +98 -0
  53. package/dist/tools/write-errors.js.map +1 -0
  54. package/package.json +1 -1
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ /**
3
+ * Shared error handling for every write path (remember, debrief, pin, unpin,
4
+ * retype, set_scope).
5
+ *
6
+ * Two rules:
7
+ * 1. A quota error (relay 403 `quota_exceeded`) must never be swallowed into a
8
+ * per-item failure. Write paths call `rethrowIfQuota` first so the dispatch
9
+ * guard returns the standard quota response (`isError: true`, upgrade hint).
10
+ * 2. Any other submission failure is reported as ONE line (`shortErrorMessage`)
11
+ * — never viem's full request dump (callData, gas fields, signatures).
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.isQuotaExceededError = isQuotaExceededError;
15
+ exports.rethrowIfQuota = rethrowIfQuota;
16
+ exports.shortErrorMessage = shortErrorMessage;
17
+ exports.describeErrorFull = describeErrorFull;
18
+ exports.logWriteError = logWriteError;
19
+ /**
20
+ * True when the error is the relay's "monthly write limit reached" answer.
21
+ * Checks the full message (viem puts the relay body in `Details:` at the very
22
+ * end), the `details` field and the cause chain.
23
+ */
24
+ function isQuotaExceededError(error) {
25
+ const seen = new Set();
26
+ let cur = error;
27
+ for (let depth = 0; cur && depth < 5 && !seen.has(cur); depth++) {
28
+ seen.add(cur);
29
+ if (cur instanceof Error) {
30
+ const texts = [cur.message, cur.details];
31
+ for (const t of texts) {
32
+ if (typeof t === 'string') {
33
+ const lower = t.toLowerCase();
34
+ if (lower.includes('quota_exceeded') || lower.includes('quota exceeded'))
35
+ return true;
36
+ }
37
+ }
38
+ cur = cur.cause;
39
+ }
40
+ else {
41
+ break;
42
+ }
43
+ }
44
+ return false;
45
+ }
46
+ /** Rethrow quota errors so the dispatch guard turns them into the quota response. */
47
+ function rethrowIfQuota(error) {
48
+ if (isQuotaExceededError(error))
49
+ throw error;
50
+ }
51
+ /**
52
+ * One-line, hex-free description of a write failure: viem's `shortMessage`
53
+ * when present, otherwise the first line of `message`.
54
+ */
55
+ function shortErrorMessage(error) {
56
+ if (error instanceof Error) {
57
+ const short = error.shortMessage;
58
+ const raw = typeof short === 'string' && short.trim() ? short : error.message;
59
+ const line = (raw.split('\n')[0] ?? '').trim();
60
+ return line.length > 300 ? `${line.slice(0, 300)}...` : line || 'Unknown error';
61
+ }
62
+ const s = String(error ?? '').split('\n')[0]?.trim();
63
+ return s ? (s.length > 300 ? `${s.slice(0, 300)}...` : s) : 'Unknown error';
64
+ }
65
+ /**
66
+ * Full error text for operators (stderr only, never the tool response):
67
+ * message, viem `details`, and the cause chain, so codes like AA25 survive the
68
+ * one-line message the model sees. Callers must not pass phrase or key
69
+ * material; calldata hex and signatures in viem dumps are acceptable here.
70
+ */
71
+ function describeErrorFull(error) {
72
+ const parts = [];
73
+ const seen = new Set();
74
+ let cur = error;
75
+ for (let depth = 0; cur && depth < 5 && !seen.has(cur); depth++) {
76
+ seen.add(cur);
77
+ if (cur instanceof Error) {
78
+ parts.push(cur.message);
79
+ const details = cur.details;
80
+ if (typeof details === 'string' && details && !cur.message.includes(details)) {
81
+ parts.push(`details: ${details}`);
82
+ }
83
+ cur = cur.cause;
84
+ if (cur)
85
+ parts.push('caused by:');
86
+ }
87
+ else {
88
+ parts.push(String(cur));
89
+ break;
90
+ }
91
+ }
92
+ return parts.join('\n') || 'Unknown error';
93
+ }
94
+ /** Log the full error to stderr, tagged with the operation. */
95
+ function logWriteError(context, error) {
96
+ console.error(`${context}: ${describeErrorFull(error)}`);
97
+ }
98
+ //# sourceMappingURL=write-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-errors.js","sourceRoot":"","sources":["../../src/tools/write-errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAOH,oDAmBC;AAGD,wCAEC;AAMD,8CASC;AAQD,8CAoBC;AAGD,sCAEC;AA7ED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,KAAc;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAW,CAAC;IAChC,IAAI,GAAG,GAAY,KAAK,CAAC;IACzB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,GAAG,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAChE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,OAAO,EAAG,GAA6B,CAAC,OAAO,CAAC,CAAC;YACpE,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;gBACtB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;oBAC1B,MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;oBAC9B,IAAI,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC;wBAAE,OAAO,IAAI,CAAC;gBACxF,CAAC;YACH,CAAC;YACD,GAAG,GAAI,GAA2B,CAAC,KAAK,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qFAAqF;AACrF,SAAgB,cAAc,CAAC,KAAc;IAC3C,IAAI,oBAAoB,CAAC,KAAK,CAAC;QAAE,MAAM,KAAK,CAAC;AAC/C,CAAC;AAED;;;G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KAAK,EAAE,EAAE,CAAC;QAChE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACxB,MAAM,OAAO,GAAI,GAA6B,CAAC,OAAO,CAAC;YACvD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7E,KAAK,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;YACpC,CAAC;YACD,GAAG,GAAI,GAA2B,CAAC,KAAK,CAAC;YACzC,IAAI,GAAG;gBAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YACxB,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC;AAC7C,CAAC;AAED,+DAA+D;AAC/D,SAAgB,aAAa,CAAC,OAAe,EAAE,KAAc;IAC3D,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,KAAK,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@totalreclaw/mcp-server",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "End-to-end encrypted memory for AI agents \u2014 portable, yours forever. MCP server with XChaCha20-Poly1305 E2EE, semantic search, import/export, and on-chain storage",
5
5
  "homepage": "https://totalreclaw.xyz",
6
6
  "main": "dist/index.js",