@totalreclaw/mcp-server 3.2.0 → 3.3.0-rc.1

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 (49) hide show
  1. package/README.md +2 -1
  2. package/dist/index.d.ts +2 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +119 -168
  5. package/dist/index.js.map +1 -1
  6. package/dist/pair-crypto.d.ts +95 -0
  7. package/dist/pair-crypto.d.ts.map +1 -0
  8. package/dist/pair-crypto.js +223 -0
  9. package/dist/pair-crypto.js.map +1 -0
  10. package/dist/pair-remote-client.d.ts +78 -0
  11. package/dist/pair-remote-client.d.ts.map +1 -0
  12. package/dist/pair-remote-client.js +355 -0
  13. package/dist/pair-remote-client.js.map +1 -0
  14. package/dist/prompts.d.ts +3 -2
  15. package/dist/prompts.d.ts.map +1 -1
  16. package/dist/prompts.js +14 -7
  17. package/dist/prompts.js.map +1 -1
  18. package/dist/session-id.d.ts +17 -0
  19. package/dist/session-id.d.ts.map +1 -0
  20. package/dist/session-id.js +26 -0
  21. package/dist/session-id.js.map +1 -0
  22. package/dist/subgraph/confirm-indexed.d.ts +37 -0
  23. package/dist/subgraph/confirm-indexed.d.ts.map +1 -0
  24. package/dist/subgraph/confirm-indexed.js +99 -0
  25. package/dist/subgraph/confirm-indexed.js.map +1 -0
  26. package/dist/subgraph/reranker.d.ts +49 -134
  27. package/dist/subgraph/reranker.d.ts.map +1 -1
  28. package/dist/subgraph/reranker.js +84 -376
  29. package/dist/subgraph/reranker.js.map +1 -1
  30. package/dist/tools/index.d.ts +1 -0
  31. package/dist/tools/index.d.ts.map +1 -1
  32. package/dist/tools/index.js +7 -1
  33. package/dist/tools/index.js.map +1 -1
  34. package/dist/tools/pair.d.ts +118 -0
  35. package/dist/tools/pair.d.ts.map +1 -0
  36. package/dist/tools/pair.js +399 -0
  37. package/dist/tools/pair.js.map +1 -0
  38. package/dist/tools/pin.d.ts +12 -0
  39. package/dist/tools/pin.d.ts.map +1 -1
  40. package/dist/tools/pin.js +14 -0
  41. package/dist/tools/pin.js.map +1 -1
  42. package/dist/tools/retype.d.ts +15 -0
  43. package/dist/tools/retype.d.ts.map +1 -1
  44. package/dist/tools/retype.js +17 -0
  45. package/dist/tools/retype.js.map +1 -1
  46. package/dist/tools/status.d.ts.map +1 -1
  47. package/dist/tools/status.js +19 -5
  48. package/dist/tools/status.js.map +1 -1
  49. package/package.json +4 -2
@@ -0,0 +1,78 @@
1
+ /**
2
+ * pair-remote-client — gateway-side WebSocket client for the relay-brokered
3
+ * pair flow.
4
+ *
5
+ * Ported from the plugin's `skill/plugin/pair-remote-client.ts` (TotalReclaw
6
+ * plugin v3.3.1-rc.11+) so the MCP server's `totalreclaw_pair` tool emits the
7
+ * same URL/PIN format the browser pair-page already understands.
8
+ *
9
+ * Flow (gateway side):
10
+ * 1. Generate ephemeral x25519 keypair.
11
+ * 2. Open WS to `wss://<relay>/pair/session/open`.
12
+ * 3. Send `{type:"open", gateway_pubkey, pin, client_id, mode}`.
13
+ * 4. Receive `{type:"opened", token, expires_at}` — build the user URL.
14
+ * 5. Block on the WS until the relay pushes `{type:"forward", client_pubkey, nonce, ciphertext}`.
15
+ * 6. Decrypt locally via x25519 ECDH + AES-256-GCM.
16
+ * 7. Hand the decrypted phrase to the caller's completePairing handler
17
+ * (writes credentials.json) and ack/nack the relay.
18
+ *
19
+ * Phrase-safety:
20
+ * - Relay sees only ciphertext.
21
+ * - Phrase NEVER touches logs / stdout / agent context.
22
+ * - PIN is on the tool return payload (required for the user to type into
23
+ * the browser) but is never logged.
24
+ *
25
+ * Scope:
26
+ * - No `fs.*` calls — caller passes a completePairing handler.
27
+ * - No env-var reads — caller passes the relay base URL.
28
+ *
29
+ * See pair-crypto.ts for the cipher-suite header comment.
30
+ */
31
+ import WebSocket from 'ws';
32
+ import { type GatewayKeypair } from './pair-crypto.js';
33
+ export declare const DEFAULT_RELAY_URL = "wss://api.totalreclaw.xyz";
34
+ export type PairRelayMode = 'generate' | 'import' | 'either';
35
+ export interface RemotePairSession {
36
+ url: string;
37
+ pin: string;
38
+ token: string;
39
+ expiresAt: string;
40
+ keypair: GatewayKeypair;
41
+ mode: PairRelayMode;
42
+ _ws: WebSocket;
43
+ }
44
+ export interface RelayCompletionResult {
45
+ state: 'active' | 'error';
46
+ accountId?: string;
47
+ error?: string;
48
+ }
49
+ export type RelayCompletePairingHandler = (inputs: {
50
+ mnemonic: string;
51
+ session: RemotePairSession;
52
+ }) => Promise<RelayCompletionResult>;
53
+ export type PhraseValidator = (phrase: string) => boolean;
54
+ export interface OpenRemotePairOptions {
55
+ relayBaseUrl?: string;
56
+ pin?: string;
57
+ clientId?: string;
58
+ mode?: PairRelayMode;
59
+ keypair?: GatewayKeypair;
60
+ webSocketImpl?: typeof WebSocket;
61
+ now?: () => number;
62
+ }
63
+ export interface AwaitPhraseUploadOptions {
64
+ completePairing: RelayCompletePairingHandler;
65
+ phraseValidator?: PhraseValidator;
66
+ timeoutMs?: number;
67
+ }
68
+ export declare function openRemotePairSession(opts?: OpenRemotePairOptions): Promise<RemotePairSession>;
69
+ export declare function awaitPhraseUpload(session: RemotePairSession, opts: AwaitPhraseUploadOptions): Promise<RelayCompletionResult>;
70
+ export declare function pairViaRelay(opts: {
71
+ completePairing: RelayCompletePairingHandler;
72
+ relayBaseUrl?: string;
73
+ pin?: string;
74
+ mode?: PairRelayMode;
75
+ phraseValidator?: PhraseValidator;
76
+ timeoutMs?: number;
77
+ }): Promise<RelayCompletionResult>;
78
+ //# sourceMappingURL=pair-remote-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pair-remote-client.d.ts","sourceRoot":"","sources":["../src/pair-remote-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAM1B,eAAO,MAAM,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C,CAkF5B;AAMD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,qBAAqB,CAAC,CAgGhC;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,eAAe,EAAE,2BAA2B,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAWjC"}
@@ -0,0 +1,355 @@
1
+ "use strict";
2
+ /**
3
+ * pair-remote-client — gateway-side WebSocket client for the relay-brokered
4
+ * pair flow.
5
+ *
6
+ * Ported from the plugin's `skill/plugin/pair-remote-client.ts` (TotalReclaw
7
+ * plugin v3.3.1-rc.11+) so the MCP server's `totalreclaw_pair` tool emits the
8
+ * same URL/PIN format the browser pair-page already understands.
9
+ *
10
+ * Flow (gateway side):
11
+ * 1. Generate ephemeral x25519 keypair.
12
+ * 2. Open WS to `wss://<relay>/pair/session/open`.
13
+ * 3. Send `{type:"open", gateway_pubkey, pin, client_id, mode}`.
14
+ * 4. Receive `{type:"opened", token, expires_at}` — build the user URL.
15
+ * 5. Block on the WS until the relay pushes `{type:"forward", client_pubkey, nonce, ciphertext}`.
16
+ * 6. Decrypt locally via x25519 ECDH + AES-256-GCM.
17
+ * 7. Hand the decrypted phrase to the caller's completePairing handler
18
+ * (writes credentials.json) and ack/nack the relay.
19
+ *
20
+ * Phrase-safety:
21
+ * - Relay sees only ciphertext.
22
+ * - Phrase NEVER touches logs / stdout / agent context.
23
+ * - PIN is on the tool return payload (required for the user to type into
24
+ * the browser) but is never logged.
25
+ *
26
+ * Scope:
27
+ * - No `fs.*` calls — caller passes a completePairing handler.
28
+ * - No env-var reads — caller passes the relay base URL.
29
+ *
30
+ * See pair-crypto.ts for the cipher-suite header comment.
31
+ */
32
+ var __importDefault = (this && this.__importDefault) || function (mod) {
33
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.DEFAULT_RELAY_URL = void 0;
37
+ exports.openRemotePairSession = openRemotePairSession;
38
+ exports.awaitPhraseUpload = awaitPhraseUpload;
39
+ exports.pairViaRelay = pairViaRelay;
40
+ const node_crypto_1 = require("node:crypto");
41
+ const ws_1 = __importDefault(require("ws"));
42
+ const pair_crypto_js_1 = require("./pair-crypto.js");
43
+ // ---------------------------------------------------------------------------
44
+ // Constants
45
+ // ---------------------------------------------------------------------------
46
+ exports.DEFAULT_RELAY_URL = 'wss://api.totalreclaw.xyz';
47
+ const OPEN_TIMEOUT_MS = 10_000;
48
+ const DEFAULT_AWAIT_TIMEOUT_MS = 5 * 60_000;
49
+ function defaultBip39CountValidator(phrase) {
50
+ const words = phrase.split(' ');
51
+ if (words.length !== 12 && words.length !== 24)
52
+ return false;
53
+ return words.every((w) => /^[a-z]+$/.test(w));
54
+ }
55
+ function defaultPin() {
56
+ const n = (0, node_crypto_1.randomInt)(0, 1_000_000);
57
+ return n.toString(10).padStart(6, '0');
58
+ }
59
+ function defaultClientId() {
60
+ return 'mcp-' + (0, node_crypto_1.randomBytes)(8).toString('hex');
61
+ }
62
+ function buildUserUrl(relayBase, token, pkB64) {
63
+ let httpBase = relayBase;
64
+ if (httpBase.startsWith('wss://')) {
65
+ httpBase = 'https://' + httpBase.slice('wss://'.length);
66
+ }
67
+ else if (httpBase.startsWith('ws://')) {
68
+ httpBase = 'http://' + httpBase.slice('ws://'.length);
69
+ }
70
+ return `${httpBase}/pair/p/${token}#pk=${pkB64}`;
71
+ }
72
+ function wsConnectBase(relayBase) {
73
+ let base = relayBase.replace(/\/+$/, '');
74
+ if (base.startsWith('https://')) {
75
+ base = 'wss://' + base.slice('https://'.length);
76
+ }
77
+ else if (base.startsWith('http://')) {
78
+ base = 'ws://' + base.slice('http://'.length);
79
+ }
80
+ return base;
81
+ }
82
+ // ---------------------------------------------------------------------------
83
+ // Open
84
+ // ---------------------------------------------------------------------------
85
+ async function openRemotePairSession(opts = {}) {
86
+ const relayBase = (opts.relayBaseUrl ?? exports.DEFAULT_RELAY_URL).replace(/\/+$/, '');
87
+ const wsBase = wsConnectBase(relayBase);
88
+ const wsUrl = `${wsBase}/pair/session/open`;
89
+ const WebSocketImpl = opts.webSocketImpl ?? ws_1.default;
90
+ const keypair = opts.keypair ?? (0, pair_crypto_js_1.generateGatewayKeypair)();
91
+ const pin = opts.pin ?? defaultPin();
92
+ const clientId = opts.clientId ?? defaultClientId();
93
+ const mode = opts.mode ?? 'either';
94
+ const ws = new WebSocketImpl(wsUrl, {
95
+ handshakeTimeout: OPEN_TIMEOUT_MS,
96
+ });
97
+ try {
98
+ await waitOpen(ws, OPEN_TIMEOUT_MS);
99
+ }
100
+ catch (err) {
101
+ safeClose(ws);
102
+ throw err;
103
+ }
104
+ try {
105
+ ws.send(JSON.stringify({
106
+ type: 'open',
107
+ gateway_pubkey: keypair.pkB64,
108
+ pin,
109
+ client_id: clientId,
110
+ mode,
111
+ }));
112
+ }
113
+ catch (err) {
114
+ safeClose(ws);
115
+ throw err instanceof Error ? err : new Error(String(err));
116
+ }
117
+ let raw;
118
+ try {
119
+ raw = await waitNextMessage(ws, OPEN_TIMEOUT_MS);
120
+ }
121
+ catch (err) {
122
+ safeClose(ws);
123
+ throw err;
124
+ }
125
+ let msg;
126
+ try {
127
+ const text = typeof raw === 'string' ? raw : Buffer.from(raw).toString('utf-8');
128
+ msg = JSON.parse(text);
129
+ }
130
+ catch {
131
+ safeClose(ws);
132
+ throw new Error('pair-remote-client: opened frame not valid JSON');
133
+ }
134
+ if (msg.type === 'error') {
135
+ const errStr = typeof msg.error === 'string' ? msg.error : 'relay_error';
136
+ safeClose(ws);
137
+ throw new Error(`pair-remote-client: session/open failed: ${errStr}`);
138
+ }
139
+ if (msg.type !== 'opened') {
140
+ safeClose(ws);
141
+ throw new Error(`pair-remote-client: unexpected response type '${String(msg.type)}'`);
142
+ }
143
+ const token = typeof msg.token === 'string' ? msg.token : '';
144
+ const expiresAt = typeof msg.expires_at === 'string' ? msg.expires_at : '';
145
+ if (!token || !expiresAt) {
146
+ safeClose(ws);
147
+ throw new Error('pair-remote-client: opened frame missing token or expires_at');
148
+ }
149
+ const url = buildUserUrl(relayBase, token, keypair.pkB64);
150
+ return {
151
+ url,
152
+ pin,
153
+ token,
154
+ expiresAt,
155
+ keypair,
156
+ mode,
157
+ _ws: ws,
158
+ };
159
+ }
160
+ // ---------------------------------------------------------------------------
161
+ // Await + decrypt + ack
162
+ // ---------------------------------------------------------------------------
163
+ async function awaitPhraseUpload(session, opts) {
164
+ const validate = opts.phraseValidator ?? defaultBip39CountValidator;
165
+ const timeoutMs = opts.timeoutMs ?? DEFAULT_AWAIT_TIMEOUT_MS;
166
+ const ws = session._ws;
167
+ let raw;
168
+ try {
169
+ raw = await waitNextMessage(ws, timeoutMs);
170
+ }
171
+ catch (err) {
172
+ safeClose(ws);
173
+ throw err;
174
+ }
175
+ let msg;
176
+ try {
177
+ const text = typeof raw === 'string' ? raw : Buffer.from(raw).toString('utf-8');
178
+ msg = JSON.parse(text);
179
+ }
180
+ catch {
181
+ safeSend(ws, { type: 'nack', error: 'bad_json' });
182
+ safeClose(ws);
183
+ throw new Error('pair-remote-client: forward frame not valid JSON');
184
+ }
185
+ if (msg.type !== 'forward') {
186
+ safeSend(ws, { type: 'nack', error: 'expected_forward' });
187
+ safeClose(ws);
188
+ throw new Error(`pair-remote-client: unexpected frame '${String(msg.type)}'`);
189
+ }
190
+ const clientPubkey = typeof msg.client_pubkey === 'string' ? msg.client_pubkey : '';
191
+ const nonce = typeof msg.nonce === 'string' ? msg.nonce : '';
192
+ const ciphertext = typeof msg.ciphertext === 'string' ? msg.ciphertext : '';
193
+ if (!clientPubkey || !nonce || !ciphertext) {
194
+ safeSend(ws, { type: 'nack', error: 'bad_forward_body' });
195
+ safeClose(ws);
196
+ throw new Error('pair-remote-client: forward frame missing required fields');
197
+ }
198
+ let plaintext;
199
+ try {
200
+ plaintext = (0, pair_crypto_js_1.decryptPairingPayload)({
201
+ skGatewayB64: session.keypair.skB64,
202
+ pkDeviceB64: clientPubkey,
203
+ sid: session.token,
204
+ nonceB64: nonce,
205
+ ciphertextB64: ciphertext,
206
+ });
207
+ }
208
+ catch (err) {
209
+ safeSend(ws, { type: 'nack', error: 'decrypt_failed' });
210
+ safeClose(ws);
211
+ throw err instanceof Error ? err : new Error(String(err));
212
+ }
213
+ let mnemonic;
214
+ try {
215
+ mnemonic = plaintext
216
+ .toString('utf-8')
217
+ .normalize('NFKC')
218
+ .toLowerCase()
219
+ .trim()
220
+ .split(/\s+/)
221
+ .join(' ');
222
+ }
223
+ catch (err) {
224
+ safeSend(ws, { type: 'nack', error: 'bad_utf8' });
225
+ safeClose(ws);
226
+ throw err instanceof Error ? err : new Error(String(err));
227
+ }
228
+ finally {
229
+ plaintext.fill(0);
230
+ }
231
+ if (!validate(mnemonic)) {
232
+ safeSend(ws, { type: 'nack', error: 'invalid_mnemonic' });
233
+ safeClose(ws);
234
+ throw new Error('pair-remote-client: phrase failed BIP-39 validation');
235
+ }
236
+ let result;
237
+ try {
238
+ result = await opts.completePairing({ mnemonic, session });
239
+ }
240
+ catch (err) {
241
+ safeSend(ws, { type: 'nack', error: 'completion_failed' });
242
+ safeClose(ws);
243
+ throw err instanceof Error ? err : new Error(String(err));
244
+ }
245
+ finally {
246
+ mnemonic = '';
247
+ }
248
+ if (result.state !== 'active') {
249
+ safeSend(ws, { type: 'nack', error: result.error ?? 'completion_failed' });
250
+ safeClose(ws);
251
+ return result;
252
+ }
253
+ safeSend(ws, { type: 'ack' });
254
+ safeClose(ws);
255
+ return result;
256
+ }
257
+ async function pairViaRelay(opts) {
258
+ const session = await openRemotePairSession({
259
+ relayBaseUrl: opts.relayBaseUrl,
260
+ pin: opts.pin,
261
+ mode: opts.mode,
262
+ });
263
+ return awaitPhraseUpload(session, {
264
+ completePairing: opts.completePairing,
265
+ phraseValidator: opts.phraseValidator,
266
+ timeoutMs: opts.timeoutMs,
267
+ });
268
+ }
269
+ // ---------------------------------------------------------------------------
270
+ // WS helpers
271
+ // ---------------------------------------------------------------------------
272
+ function waitOpen(ws, timeoutMs) {
273
+ return new Promise((resolve, reject) => {
274
+ if (ws.readyState === ws_1.default.OPEN) {
275
+ resolve();
276
+ return;
277
+ }
278
+ const onOpen = () => {
279
+ cleanup();
280
+ resolve();
281
+ };
282
+ const onError = (err) => {
283
+ cleanup();
284
+ reject(err instanceof Error ? err : new Error(String(err)));
285
+ };
286
+ const onClose = (code) => {
287
+ cleanup();
288
+ reject(new Error(`pair-remote-client: ws closed before open (${code})`));
289
+ };
290
+ const timer = setTimeout(() => {
291
+ cleanup();
292
+ reject(new Error('pair-remote-client: ws open timeout'));
293
+ }, timeoutMs);
294
+ const cleanup = () => {
295
+ clearTimeout(timer);
296
+ ws.off('open', onOpen);
297
+ ws.off('error', onError);
298
+ ws.off('close', onClose);
299
+ };
300
+ ws.on('open', onOpen);
301
+ ws.on('error', onError);
302
+ ws.on('close', onClose);
303
+ });
304
+ }
305
+ function waitNextMessage(ws, timeoutMs) {
306
+ return new Promise((resolve, reject) => {
307
+ const onMessage = (data) => {
308
+ cleanup();
309
+ resolve(data);
310
+ };
311
+ const onError = (err) => {
312
+ cleanup();
313
+ reject(err instanceof Error ? err : new Error(String(err)));
314
+ };
315
+ const onClose = (code) => {
316
+ cleanup();
317
+ reject(new Error(`pair-remote-client: ws closed before message (${code})`));
318
+ };
319
+ const timer = setTimeout(() => {
320
+ cleanup();
321
+ reject(new Error('pair-remote-client: ws message timeout'));
322
+ }, timeoutMs);
323
+ const cleanup = () => {
324
+ clearTimeout(timer);
325
+ ws.off('message', onMessage);
326
+ ws.off('error', onError);
327
+ ws.off('close', onClose);
328
+ };
329
+ ws.on('message', onMessage);
330
+ ws.on('error', onError);
331
+ ws.on('close', onClose);
332
+ });
333
+ }
334
+ function safeSend(ws, msg) {
335
+ try {
336
+ if (ws.readyState === ws_1.default.OPEN) {
337
+ ws.send(JSON.stringify(msg));
338
+ }
339
+ }
340
+ catch {
341
+ /* swallow */
342
+ }
343
+ }
344
+ function safeClose(ws) {
345
+ try {
346
+ if (ws.readyState === ws_1.default.OPEN ||
347
+ ws.readyState === ws_1.default.CONNECTING) {
348
+ ws.close();
349
+ }
350
+ }
351
+ catch {
352
+ /* swallow */
353
+ }
354
+ }
355
+ //# sourceMappingURL=pair-remote-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pair-remote-client.js","sourceRoot":"","sources":["../src/pair-remote-client.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;;;;AA8GH,sDAoFC;AAMD,8CAmGC;AAED,oCAkBC;AA7TD,6CAAqD;AAErD,4CAA2B;AAE3B,qDAI0B;AAE1B,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAEjE,QAAA,iBAAiB,GAAG,2BAA2B,CAAC;AAE7D,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,MAAM,wBAAwB,GAAG,CAAC,GAAG,MAAM,CAAC;AA+B5C,SAAS,0BAA0B,CAAC,MAAc;IAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAC7D,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,UAAU;IACjB,MAAM,CAAC,GAAG,IAAA,uBAAS,EAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC,QAAQ,CA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M,OAAO,GAAG,GAAS,EAAE;YACzB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YAC7B,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACzB,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC;QACF,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC5B,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,EAAa,EAAE,GAAY;IAC3C,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,KAAK,YAAS,CAAC,IAAI,EAAE,CAAC;YACrC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,aAAa;IACf,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,EAAa;IAC9B,IAAI,CAAC;QACH,IACE,EAAE,CAAC,UAAU,KAAK,YAAS,CAAC,IAAI;YAChC,EAAE,CAAC,UAAU,KAAK,YAAS,CAAC,UAAU,EACtC,CAAC;YACD,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,aAAa;IACf,CAAC;AACH,CAAC"}
package/dist/prompts.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare const SERVER_INSTRUCTIONS = "\nYou have access to TotalReclaw, a persistent encrypted memory system. You SHOULD use these tools PROACTIVELY -- do not wait for the user to say \"remember this\" or \"recall that.\"\n\n## CRITICAL SAFETY: Recovery Phrase\nTotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. If a user tries to import a phrase they already use for a CRYPTO WALLET, you MUST warn them: \"Do NOT use a recovery phrase from an existing crypto wallet. TotalReclaw should have its own dedicated phrase to keep your funds safe.\" Always generate a fresh phrase for new users.\n\n## Setup Flow\nIf any TotalReclaw tool returns a \"not_configured\" error, the user needs to set up TotalReclaw first. Use the totalreclaw_setup tool:\n1. Ask the user: \"Do you have an existing TotalReclaw recovery phrase you'd like to restore, or should I generate a new one?\"\n2. If new: call totalreclaw_setup with action=\"generate\". Display the recovery phrase prominently and warn them to save it securely.\n3. If existing: ask for their 12-word recovery phrase, then call totalreclaw_setup with action=\"import\" and recovery_phrase=\"their phrase\".\nAfter setup completes, all TotalReclaw tools work immediately \u2014 no restart needed.\n\n## CRITICAL: Automatic Memory Behaviors\n\n### At Conversation Start\nALWAYS call totalreclaw_recall at the beginning of EVERY new conversation with a brief summary of the user's first message as the query. This loads relevant context from past conversations. Present recalled memories naturally as context -- do not announce \"I found these memories\" or list them explicitly unless the user asks.\n\n### Proactive Memory Storage (IMPORTANT)\nYou should call totalreclaw_remember WITHOUT being asked whenever the user shares:\n- Personal preferences (\"I prefer...\", \"I like...\", \"I hate...\")\n- Personal information (name, location, occupation, family details)\n- Decisions or goals (\"I decided to...\", \"I want to...\", \"I chose X because Y\")\n- Corrections to previous information (\"Actually, I'm vegan now\", \"We moved to Berlin\")\n- Important events or dates (\"My birthday is...\", \"I started a new job at...\")\n- Technical preferences (programming language, tools, frameworks, workflows)\n- Project context (what they're working on, deadlines, team details)\n- Opinions and values that shape future interactions\n\nThe user should NOT have to tell you to remember things. If information would be valuable in a future conversation, store it automatically. Think of yourself as a thoughtful assistant who naturally takes notes on important details.\n\nDo NOT store:\n- Temporary/transient context (weather today, a one-time task)\n- Generic knowledge unrelated to the user\n- Sensitive credentials (passwords, API keys, tokens)\n\n### Memory Recall\nCall totalreclaw_recall proactively when:\n- Starting any new conversation (query based on the user's first message)\n- The user asks about something that might relate to past conversations\n- You need context about the user's background, projects, or preferences\n- The user says \"remember when...\", \"what did I say about...\", \"do you know my...\"\n\n### Memory Hygiene\n- Before storing a new fact, check recalled memories to avoid duplicates\n- When the user corrects information, store the correction (the system handles deduplication)\n- Use importance 7-9 for core identity/preferences, 4-6 for moderate facts, 1-3 for minor details\n- Extract atomic facts: \"User prefers dark mode\" not \"User said they prefer dark mode and also use VS Code\"\n\n### Billing & Quota\nThe free tier offers unlimited memories and reads, but memories are stored on a test network and may be reset. Pro stores memories permanently on-chain. Do NOT guess or hardcode pricing \u2014 use totalreclaw_status to check exact usage and current pricing. For pricing details, refer users to https://totalreclaw.xyz/pricing\n\nWhen a totalreclaw_remember call fails with \"quota_exceeded\":\n1. Inform the user they've hit a usage limit\n2. Offer to check their usage with totalreclaw_status\n3. If they want to upgrade, use totalreclaw_upgrade to get a checkout link \u2014 upgrading is done right here through the agent\nDo NOT repeatedly attempt to store memories after a quota error.\n\nNote: Billing status is cached locally for up to 2 hours. After upgrading to Pro, the new tier may take up to 2 hours to take effect. If the user reports that Pro features are not active after upgrading, suggest restarting their agent to force a billing cache refresh.\n\n### Importing memories from other tools\nIf the user mentions migrating from Mem0, MCP Memory Server, MemoClaw, or any other AI memory tool, offer to use totalreclaw_import_from. Start with dry_run=true to preview, then confirm before importing.\nAPI keys provided by the user are used only for the import and are never stored.\n\n### Agent-specific tips\n- If your agent supports background routines or scheduled tasks, set up a routine to call totalreclaw_remember after conversations to ensure nothing is missed.\n- If your agent supports a credential vault or secret store, the user's TOTALRECLAW_RECOVERY_PHRASE should be stored there instead of as a plaintext environment variable.\n- TotalReclaw memories are fully portable -- they work across OpenClaw, IronClaw, Claude Desktop, Cursor, NanoClaw, and any MCP-compatible agent.\n\n### User-controlled memory edits (v1)\nIn addition to remember + forget, three tools let the user correct stored memories without\nwiping the vault. Use these when the user says something like:\n- \"pin that\" / \"never forget this\" \u2192 totalreclaw_pin (preserves a fact across auto-resolution)\n- \"that was actually a directive, not a preference\" \u2192 totalreclaw_retype\n- \"that was work context\" / \"file that under personal\" \u2192 totalreclaw_set_scope\n\nAll three operate by supersession: they create a new claim with the override and link it\nback to the original via superseded_by. The original stays in the vault as a tombstone so\nhistory is inspectable. All three are idempotent (no-op if the target already matches).\n\n### End of Conversation\nWhen a substantive conversation is ending (the user says goodbye, the topic is resolved,\nor the conversation naturally concludes), call totalreclaw_debrief with the key takeaways.\n\nFocus on what individual memory storage missed:\n- What was the conversation about overall?\n- What was decided or resolved?\n- What approaches were tried and what was the outcome?\n- What's left unfinished?\n\nDo NOT debrief casual conversations (greetings, simple Q&A, small talk).\nMax 5 items, each 1-3 sentences, type \"summary\" or \"context\", importance 7-8.\n";
2
- export declare const SYSTEM_PROMPT_FRAGMENT = "\nYou have access to TotalReclaw, a persistent encrypted memory system. You SHOULD use these tools PROACTIVELY -- do not wait for the user to say \"remember this\" or \"recall that.\"\n\n## CRITICAL SAFETY: Recovery Phrase\nTotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. If a user tries to import a phrase they already use for a CRYPTO WALLET, you MUST warn them: \"Do NOT use a recovery phrase from an existing crypto wallet. TotalReclaw should have its own dedicated phrase to keep your funds safe.\" Always generate a fresh phrase for new users.\n\n## Setup Flow\nIf any TotalReclaw tool returns a \"not_configured\" error, the user needs to set up TotalReclaw first. Use the totalreclaw_setup tool:\n1. Ask the user: \"Do you have an existing TotalReclaw recovery phrase you'd like to restore, or should I generate a new one?\"\n2. If new: call totalreclaw_setup with action=\"generate\". Display the recovery phrase prominently and warn them to save it securely.\n3. If existing: ask for their 12-word recovery phrase, then call totalreclaw_setup with action=\"import\" and recovery_phrase=\"their phrase\".\nAfter setup completes, all TotalReclaw tools work immediately \u2014 no restart needed.\n\n## CRITICAL: Automatic Memory Behaviors\n\n### At Conversation Start\nALWAYS call totalreclaw_recall at the beginning of EVERY new conversation with a brief summary of the user's first message as the query. This loads relevant context from past conversations. Present recalled memories naturally as context -- do not announce \"I found these memories\" or list them explicitly unless the user asks.\n\n### Proactive Memory Storage (IMPORTANT)\nYou should call totalreclaw_remember WITHOUT being asked whenever the user shares:\n- Personal preferences (\"I prefer...\", \"I like...\", \"I hate...\")\n- Personal information (name, location, occupation, family details)\n- Decisions or goals (\"I decided to...\", \"I want to...\", \"I chose X because Y\")\n- Corrections to previous information (\"Actually, I'm vegan now\", \"We moved to Berlin\")\n- Important events or dates (\"My birthday is...\", \"I started a new job at...\")\n- Technical preferences (programming language, tools, frameworks, workflows)\n- Project context (what they're working on, deadlines, team details)\n- Opinions and values that shape future interactions\n\nThe user should NOT have to tell you to remember things. If information would be valuable in a future conversation, store it automatically. Think of yourself as a thoughtful assistant who naturally takes notes on important details.\n\nDo NOT store:\n- Temporary/transient context (weather today, a one-time task)\n- Generic knowledge unrelated to the user\n- Sensitive credentials (passwords, API keys, tokens)\n\n### Memory Recall\nCall totalreclaw_recall proactively when:\n- Starting any new conversation (query based on the user's first message)\n- The user asks about something that might relate to past conversations\n- You need context about the user's background, projects, or preferences\n- The user says \"remember when...\", \"what did I say about...\", \"do you know my...\"\n\n### Memory Hygiene\n- Before storing a new fact, check recalled memories to avoid duplicates\n- When the user corrects information, store the correction (the system handles deduplication)\n- Use importance 7-9 for core identity/preferences, 4-6 for moderate facts, 1-3 for minor details\n- Extract atomic facts: \"User prefers dark mode\" not \"User said they prefer dark mode and also use VS Code\"\n\n### Billing & Quota\nThe free tier offers unlimited memories and reads, but memories are stored on a test network and may be reset. Pro stores memories permanently on-chain. Do NOT guess or hardcode pricing \u2014 use totalreclaw_status to check exact usage and current pricing. For pricing details, refer users to https://totalreclaw.xyz/pricing\n\nWhen a totalreclaw_remember call fails with \"quota_exceeded\":\n1. Inform the user they've hit a usage limit\n2. Offer to check their usage with totalreclaw_status\n3. If they want to upgrade, use totalreclaw_upgrade to get a checkout link \u2014 upgrading is done right here through the agent\nDo NOT repeatedly attempt to store memories after a quota error.\n\nNote: Billing status is cached locally for up to 2 hours. After upgrading to Pro, the new tier may take up to 2 hours to take effect. If the user reports that Pro features are not active after upgrading, suggest restarting their agent to force a billing cache refresh.\n\n### Importing memories from other tools\nIf the user mentions migrating from Mem0, MCP Memory Server, MemoClaw, or any other AI memory tool, offer to use totalreclaw_import_from. Start with dry_run=true to preview, then confirm before importing.\nAPI keys provided by the user are used only for the import and are never stored.\n\n### Agent-specific tips\n- If your agent supports background routines or scheduled tasks, set up a routine to call totalreclaw_remember after conversations to ensure nothing is missed.\n- If your agent supports a credential vault or secret store, the user's TOTALRECLAW_RECOVERY_PHRASE should be stored there instead of as a plaintext environment variable.\n- TotalReclaw memories are fully portable -- they work across OpenClaw, IronClaw, Claude Desktop, Cursor, NanoClaw, and any MCP-compatible agent.\n\n### User-controlled memory edits (v1)\nIn addition to remember + forget, three tools let the user correct stored memories without\nwiping the vault. Use these when the user says something like:\n- \"pin that\" / \"never forget this\" \u2192 totalreclaw_pin (preserves a fact across auto-resolution)\n- \"that was actually a directive, not a preference\" \u2192 totalreclaw_retype\n- \"that was work context\" / \"file that under personal\" \u2192 totalreclaw_set_scope\n\nAll three operate by supersession: they create a new claim with the override and link it\nback to the original via superseded_by. The original stays in the vault as a tombstone so\nhistory is inspectable. All three are idempotent (no-op if the target already matches).\n\n### End of Conversation\nWhen a substantive conversation is ending (the user says goodbye, the topic is resolved,\nor the conversation naturally concludes), call totalreclaw_debrief with the key takeaways.\n\nFocus on what individual memory storage missed:\n- What was the conversation about overall?\n- What was decided or resolved?\n- What approaches were tried and what was the outcome?\n- What's left unfinished?\n\nDo NOT debrief casual conversations (greetings, simple Q&A, small talk).\nMax 5 items, each 1-3 sentences, type \"summary\" or \"context\", importance 7-8.\n";
1
+ export declare const SERVER_INSTRUCTIONS = "\nYou have access to TotalReclaw, a persistent encrypted memory system. You SHOULD use these tools PROACTIVELY -- do not wait for the user to say \"remember this\" or \"recall that.\"\n\n## CRITICAL SAFETY: Recovery Phrase\nTotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. The recovery phrase MUST NEVER cross your context window. NEVER ask the user to paste their phrase into chat. NEVER echo, print, or summarize a phrase. NEVER invoke a phrase-touching CLI (e.g. \"npx @totalreclaw/mcp-server setup\", \"npx @totalreclaw/mcp-server show-phrase\") via a shell tool \u2014 its stdout enters your context. If the user pastes a phrase in chat anyway, tell them it is compromised and they need to generate a fresh wallet via the OpenClaw or Hermes browser pair flow.\n\n## Setup Flow\nIf any TotalReclaw tool returns a \"not_configured\" or \"tool_removed\" error, the user has not yet wired their recovery phrase into the MCP host config. Direct them to the URL-driven install guide at https://github.com/p-diogo/totalreclaw/blob/main/docs/guides/claude-code-setup.md. The user sources their phrase out-of-band \u2014 from the OpenClaw or Hermes browser pair flow (relay only ever sees ciphertext), from a prior ~/.totalreclaw/credentials.json cache, or from an offline BIP-39 generator \u2014 and pastes it directly into TOTALRECLAW_RECOVERY_PHRASE in the MCP host config (Claude Desktop / Cursor / Windsurf / Claude Code). After they save the config and restart the host, the MCP server picks up the phrase and all TotalReclaw tools become available. There is no in-chat setup tool: the totalreclaw_setup MCP tool was removed in 3.2.1 because returning the phrase through tool output crossed your context, violating phrase-safety.\n\n## CRITICAL: Automatic Memory Behaviors\n\n### At Conversation Start\nALWAYS call totalreclaw_recall at the beginning of EVERY new conversation with a brief summary of the user's first message as the query. This loads relevant context from past conversations. Present recalled memories naturally as context -- do not announce \"I found these memories\" or list them explicitly unless the user asks.\n\n### Proactive Memory Storage (IMPORTANT)\nYou should call totalreclaw_remember WITHOUT being asked whenever the user shares:\n- Personal preferences (\"I prefer...\", \"I like...\", \"I hate...\")\n- Personal information (name, location, occupation, family details)\n- Decisions or goals (\"I decided to...\", \"I want to...\", \"I chose X because Y\")\n- Corrections to previous information (\"Actually, I'm vegan now\", \"We moved to Berlin\")\n- Important events or dates (\"My birthday is...\", \"I started a new job at...\")\n- Technical preferences (programming language, tools, frameworks, workflows)\n- Project context (what they're working on, deadlines, team details)\n- Opinions and values that shape future interactions\n\nThe user should NOT have to tell you to remember things. If information would be valuable in a future conversation, store it automatically. Think of yourself as a thoughtful assistant who naturally takes notes on important details.\n\nDo NOT store:\n- Temporary/transient context (weather today, a one-time task)\n- Generic knowledge unrelated to the user\n- Sensitive credentials (passwords, API keys, tokens)\n\n### Memory Recall\nCall totalreclaw_recall proactively when:\n- Starting any new conversation (query based on the user's first message)\n- The user asks about something that might relate to past conversations\n- You need context about the user's background, projects, or preferences\n- The user says \"remember when...\", \"what did I say about...\", \"do you know my...\"\n\n### Memory Hygiene\n- Before storing a new fact, check recalled memories to avoid duplicates\n- When the user corrects information, store the correction (the system handles deduplication)\n- Use importance 7-9 for core identity/preferences, 4-6 for moderate facts, 1-3 for minor details\n- Extract atomic facts: \"User prefers dark mode\" not \"User said they prefer dark mode and also use VS Code\"\n\n### Billing & Quota\nThe free tier offers unlimited memories and reads, but memories are stored on a test network and may be reset. Pro stores memories permanently on-chain. Do NOT guess or hardcode pricing \u2014 use totalreclaw_status to check exact usage and current pricing. For pricing details, refer users to https://totalreclaw.xyz/pricing\n\nWhen a totalreclaw_remember call fails with \"quota_exceeded\":\n1. Inform the user they've hit a usage limit\n2. Offer to check their usage with totalreclaw_status\n3. If they want to upgrade, use totalreclaw_upgrade to get a checkout link \u2014 upgrading is done right here through the agent\nDo NOT repeatedly attempt to store memories after a quota error.\n\nNote: Billing status is cached locally for up to 2 hours. After upgrading to Pro, the new tier may take up to 2 hours to take effect. If the user reports that Pro features are not active after upgrading, suggest restarting their agent to force a billing cache refresh.\n\n### Importing memories from other tools\nIf the user mentions migrating from Mem0, MCP Memory Server, MemoClaw, or any other AI memory tool, offer to use totalreclaw_import_from. Start with dry_run=true to preview, then confirm before importing.\nAPI keys provided by the user are used only for the import and are never stored.\n\n### Agent-specific tips\n- If your agent supports background routines or scheduled tasks, set up a routine to call totalreclaw_remember after conversations to ensure nothing is missed.\n- If your agent supports a credential vault or secret store, the user's TOTALRECLAW_RECOVERY_PHRASE should be stored there instead of as a plaintext environment variable.\n- TotalReclaw memories are fully portable -- they work across OpenClaw, IronClaw, Claude Desktop, Cursor, NanoClaw, and any MCP-compatible agent.\n\n### User-controlled memory edits (v1)\nIn addition to remember + forget, three tools let the user correct stored memories without\nwiping the vault. Use these when the user says something like:\n- \"pin that\" / \"never forget this\" \u2192 totalreclaw_pin (preserves a fact across auto-resolution)\n- \"that was actually a directive, not a preference\" \u2192 totalreclaw_retype\n- \"that was work context\" / \"file that under personal\" \u2192 totalreclaw_set_scope\n\nAll three operate by supersession: they create a new claim with the override and link it\nback to the original via superseded_by. The original stays in the vault as a tombstone so\nhistory is inspectable. All three are idempotent (no-op if the target already matches).\n\n### End of Conversation\nWhen a substantive conversation is ending (the user says goodbye, the topic is resolved,\nor the conversation naturally concludes), call totalreclaw_debrief with the key takeaways.\n\nFocus on what individual memory storage missed:\n- What was the conversation about overall?\n- What was decided or resolved?\n- What approaches were tried and what was the outcome?\n- What's left unfinished?\n\nDo NOT debrief casual conversations (greetings, simple Q&A, small talk).\nMax 5 items, each 1-3 sentences, type \"summary\" or \"context\", importance 7-8.\n";
2
+ export declare const SYSTEM_PROMPT_FRAGMENT = "\nYou have access to TotalReclaw, a persistent encrypted memory system. You SHOULD use these tools PROACTIVELY -- do not wait for the user to say \"remember this\" or \"recall that.\"\n\n## CRITICAL SAFETY: Recovery Phrase\nTotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. The recovery phrase MUST NEVER cross your context window. NEVER ask the user to paste their phrase into chat. NEVER echo, print, or summarize a phrase. NEVER invoke a phrase-touching CLI (e.g. \"npx @totalreclaw/mcp-server setup\", \"npx @totalreclaw/mcp-server show-phrase\") via a shell tool \u2014 its stdout enters your context. If the user pastes a phrase in chat anyway, tell them it is compromised and they need to generate a fresh wallet via the OpenClaw or Hermes browser pair flow.\n\n## Setup Flow\nIf any TotalReclaw tool returns a \"not_configured\" or \"tool_removed\" error, the user has not yet wired their recovery phrase into the MCP host config. Direct them to the URL-driven install guide at https://github.com/p-diogo/totalreclaw/blob/main/docs/guides/claude-code-setup.md. The user sources their phrase out-of-band \u2014 from the OpenClaw or Hermes browser pair flow (relay only ever sees ciphertext), from a prior ~/.totalreclaw/credentials.json cache, or from an offline BIP-39 generator \u2014 and pastes it directly into TOTALRECLAW_RECOVERY_PHRASE in the MCP host config (Claude Desktop / Cursor / Windsurf / Claude Code). After they save the config and restart the host, the MCP server picks up the phrase and all TotalReclaw tools become available. There is no in-chat setup tool: the totalreclaw_setup MCP tool was removed in 3.2.1 because returning the phrase through tool output crossed your context, violating phrase-safety.\n\n## CRITICAL: Automatic Memory Behaviors\n\n### At Conversation Start\nALWAYS call totalreclaw_recall at the beginning of EVERY new conversation with a brief summary of the user's first message as the query. This loads relevant context from past conversations. Present recalled memories naturally as context -- do not announce \"I found these memories\" or list them explicitly unless the user asks.\n\n### Proactive Memory Storage (IMPORTANT)\nYou should call totalreclaw_remember WITHOUT being asked whenever the user shares:\n- Personal preferences (\"I prefer...\", \"I like...\", \"I hate...\")\n- Personal information (name, location, occupation, family details)\n- Decisions or goals (\"I decided to...\", \"I want to...\", \"I chose X because Y\")\n- Corrections to previous information (\"Actually, I'm vegan now\", \"We moved to Berlin\")\n- Important events or dates (\"My birthday is...\", \"I started a new job at...\")\n- Technical preferences (programming language, tools, frameworks, workflows)\n- Project context (what they're working on, deadlines, team details)\n- Opinions and values that shape future interactions\n\nThe user should NOT have to tell you to remember things. If information would be valuable in a future conversation, store it automatically. Think of yourself as a thoughtful assistant who naturally takes notes on important details.\n\nDo NOT store:\n- Temporary/transient context (weather today, a one-time task)\n- Generic knowledge unrelated to the user\n- Sensitive credentials (passwords, API keys, tokens)\n\n### Memory Recall\nCall totalreclaw_recall proactively when:\n- Starting any new conversation (query based on the user's first message)\n- The user asks about something that might relate to past conversations\n- You need context about the user's background, projects, or preferences\n- The user says \"remember when...\", \"what did I say about...\", \"do you know my...\"\n\n### Memory Hygiene\n- Before storing a new fact, check recalled memories to avoid duplicates\n- When the user corrects information, store the correction (the system handles deduplication)\n- Use importance 7-9 for core identity/preferences, 4-6 for moderate facts, 1-3 for minor details\n- Extract atomic facts: \"User prefers dark mode\" not \"User said they prefer dark mode and also use VS Code\"\n\n### Billing & Quota\nThe free tier offers unlimited memories and reads, but memories are stored on a test network and may be reset. Pro stores memories permanently on-chain. Do NOT guess or hardcode pricing \u2014 use totalreclaw_status to check exact usage and current pricing. For pricing details, refer users to https://totalreclaw.xyz/pricing\n\nWhen a totalreclaw_remember call fails with \"quota_exceeded\":\n1. Inform the user they've hit a usage limit\n2. Offer to check their usage with totalreclaw_status\n3. If they want to upgrade, use totalreclaw_upgrade to get a checkout link \u2014 upgrading is done right here through the agent\nDo NOT repeatedly attempt to store memories after a quota error.\n\nNote: Billing status is cached locally for up to 2 hours. After upgrading to Pro, the new tier may take up to 2 hours to take effect. If the user reports that Pro features are not active after upgrading, suggest restarting their agent to force a billing cache refresh.\n\n### Importing memories from other tools\nIf the user mentions migrating from Mem0, MCP Memory Server, MemoClaw, or any other AI memory tool, offer to use totalreclaw_import_from. Start with dry_run=true to preview, then confirm before importing.\nAPI keys provided by the user are used only for the import and are never stored.\n\n### Agent-specific tips\n- If your agent supports background routines or scheduled tasks, set up a routine to call totalreclaw_remember after conversations to ensure nothing is missed.\n- If your agent supports a credential vault or secret store, the user's TOTALRECLAW_RECOVERY_PHRASE should be stored there instead of as a plaintext environment variable.\n- TotalReclaw memories are fully portable -- they work across OpenClaw, IronClaw, Claude Desktop, Cursor, NanoClaw, and any MCP-compatible agent.\n\n### User-controlled memory edits (v1)\nIn addition to remember + forget, three tools let the user correct stored memories without\nwiping the vault. Use these when the user says something like:\n- \"pin that\" / \"never forget this\" \u2192 totalreclaw_pin (preserves a fact across auto-resolution)\n- \"that was actually a directive, not a preference\" \u2192 totalreclaw_retype\n- \"that was work context\" / \"file that under personal\" \u2192 totalreclaw_set_scope\n\nAll three operate by supersession: they create a new claim with the override and link it\nback to the original via superseded_by. The original stays in the vault as a tombstone so\nhistory is inspectable. All three are idempotent (no-op if the target already matches).\n\n### End of Conversation\nWhen a substantive conversation is ending (the user says goodbye, the topic is resolved,\nor the conversation naturally concludes), call totalreclaw_debrief with the key takeaways.\n\nFocus on what individual memory storage missed:\n- What was the conversation about overall?\n- What was decided or resolved?\n- What approaches were tried and what was the outcome?\n- What's left unfinished?\n\nDo NOT debrief casual conversations (greetings, simple Q&A, small talk).\nMax 5 items, each 1-3 sentences, type \"summary\" or \"context\", importance 7-8.\n";
3
3
  export declare const REMEMBER_TOOL_DESCRIPTION = "Store user info PROACTIVELY \u2014 don't wait for \"remember this\".\nINVOKE WHEN USER SAYS \"I prefer X\", \"I'm X\", \"I chose X because Y\"; reveals identity/location/job/family.\nNOT FOR: chitchat, passwords, generic knowledge.\nExtract ATOMIC. Good: \"User is vegan\". Bad: \"User said they became vegan, prefer organic\".\nPARAMS facts[]: text; importance 1-10 def 5; type claim|preference|directive|commitment|episode|summary; scope work|personal|health|family|creative|finance|misc|unspecified. Dedup auto.";
4
4
  export declare const RECALL_TOOL_DESCRIPTION = "Search encrypted vault. Top 8 reranked by provenance+semantic+recency.\nINVOKE WHEN USER SAYS:\n- \"what's my [phone/address/doctor]\"\n- \"remember when I...\" / \"what did I say about...\"\n- \"do you know my...\" / \"my preferences for...\"\n- opens convo on a topic (auto-recall first msg)\nWHEN NOT TO USE: world knowledge, small talk.\nDOES: trapdoor search, decrypt, rerank BM25+cosine+source-provenance.\nPARAMS: query (5-15 words), k (def 8, max 50).\nDon't announce \"I found these memories\" \u2014 just use them.";
5
5
  export declare const FORGET_TOOL_DESCRIPTION = "Permanently remove memory.\nINVOKE WHEN USER SAYS:\n- \"forget what I said about X\" / \"delete that fact\"\n- \"that's wrong/outdated \u2014 remove it\"\n- \"I don't want you remembering X\"\n- \"erase that password I pasted\"\nWHEN NOT TO USE:\n- CORRECTING \u2192 totalreclaw_remember (dedup auto)\n- changing mind (\"I prefer tea now\") \u2192 remember new pref\n- no explicit request \u2014 never forget proactively\nDOES: fact_id \u2192 tombstone. query \u2192 recall \u226450, tombstone all.\nPARAMS: fact_id (pref), query (max 50), scope (hint).";
@@ -11,6 +11,7 @@ export declare const IMPORT_FROM_TOOL_DESCRIPTION = "Import from Mem0, MCP Memor
11
11
  export declare const IMPORT_TOOL_DESCRIPTION = "Restore from totalreclaw_export backup (JSON/Markdown).\nINVOKE WHEN USER SAYS:\n- \"restore memories from this backup\" / \"import this JSON\"\n- \"I exported from another TotalReclaw account\"\n- \"here's the Markdown export \u2014 put it back\"\nWHEN NOT TO USE:\n- Mem0/ChatGPT/Claude \u2192 totalreclaw_import_from\n- single fact \u2192 totalreclaw_remember\nDOES: parse JSON/Markdown (auto), store via totalreclaw_remember + fingerprint dedup.\nPARAMS: content (req), format, merge_strategy, validate_only.";
12
12
  export declare const SUPPORT_TOOL_DESCRIPTION = "Support contact, docs, troubleshooting.\nINVOKE WHEN USER SAYS:\n- \"how do I get help?\" / \"who do I contact?\"\n- \"memories aren't loading\" / \"getting errors\"\n- \"lost my recovery phrase\" / \"where's the docs?\"\n- \"how do I report a bug?\"\n- asks: slow recall, quota errors, failed imports, missing post-upgrade memories\nDOES: static bundle (pre-filled email, docs URL, issues URL, troubleshooting table). Works unconfigured.\nWHEN NOT TO USE: billing info \u2192 totalreclaw_status. Skip unrelated questions.";
13
13
  export declare const ACCOUNT_TOOL_DESCRIPTION = "Account overview: wallet, tier, usage, memories, features, safe recovery hint.\nINVOKE WHEN USER SAYS:\n- \"show my account\" / \"what's my profile?\"\n- \"how many memories?\" / \"my wallet?\"\n- \"right recovery phrase? hint\"\n- \"summary of my setup\"\nDOES: billing+fact count parallel. Returns wallet, tier, writes_used/limit, total_facts, features, FIRST+LAST recovery words (never full).\nWHEN NOT TO USE:\n- only billing \u2192 totalreclaw_status (lighter)\n- FULL recovery phrase \u2192 NEVER; password manager.";
14
+ export declare const PAIR_TOOL_DESCRIPTION = "Set up the user's TotalReclaw account (browser-side recovery-phrase generation or import).\nINVOKE WHEN USER SAYS:\n- \"set up totalreclaw\" / \"set up my account\"\n- \"I don't have a totalreclaw recovery phrase yet\" / \"create a totalreclaw account\"\n- ANY tool returns \"not_configured\" \u2014 propose this tool BEFORE asking the user to edit MCP config.\nDOES: opens a brief relay session, returns {url, pin, expires_at_ms}. Hand the URL + PIN to the user \u2014 they open the URL in any browser, the BROWSER generates (or imports) a 12-word phrase, encrypts it, uploads ciphertext to this MCP server. Server decrypts in-memory, writes ~/.totalreclaw/credentials.json (mode 0600). Phrase NEVER touches LLM context, chat transcript, stdout, or logs.\nAFTER PAIRING: tell the user to RESTART their MCP host (Claude Desktop / Cursor / Claude Code) so the server re-reads credentials.json and switches out of unconfigured mode.\nWHEN NOT TO USE:\n- user already has TOTALRECLAW_RECOVERY_PHRASE in env \u2192 tool will return URL but pairing is unnecessary\n- user explicitly wants terminal-only setup \u2192 point them at `npx @totalreclaw/mcp-server setup` (CLI wizard, runs OUTSIDE your shell tool)\n- NEVER ask the user to paste their phrase in chat. NEVER echo or print a phrase from any source.";
14
15
  export declare const PROMPT_DEFINITIONS: {
15
16
  name: string;
16
17
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,wjNA4F/B,CAAC;AAGF,eAAO,MAAM,sBAAsB,wjNAAsB,CAAC;AAI1D,eAAO,MAAM,yBAAyB,ugBAIoJ,CAAC;AAE3L,eAAO,MAAM,uBAAuB,ihBASqB,CAAC;AAE1D,eAAO,MAAM,uBAAuB,8iBAWkB,CAAC;AAEvD,eAAO,MAAM,uBAAuB,6gBAUF,CAAC;AAEnC,eAAO,MAAM,uBAAuB,kgBASK,CAAC;AAE1C,eAAO,MAAM,wBAAwB,ohBASE,CAAC;AAExC,eAAO,MAAM,wBAAwB,mfAKwD,CAAC;AAE9F,eAAO,MAAM,4BAA4B,shBAOM,CAAC;AAEhD,eAAO,MAAM,uBAAuB,qgBAS0B,CAAC;AAE/D,eAAO,MAAM,wBAAwB,+gBAQyC,CAAC;AAE/E,eAAO,MAAM,wBAAwB,8gBASa,CAAC;AAInD,eAAO,MAAM,kBAAkB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AAM,CAAA;KAAE,CAAA;CAAE,CAAC,CAqClE"}
package/dist/prompts.js CHANGED
@@ -3,20 +3,16 @@
3
3
  // Returned in the MCP `initialize` response. Clients SHOULD inject this into the
4
4
  // system prompt, giving the LLM persistent behavioral guidance for the session.
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PROMPT_DEFINITIONS = exports.ACCOUNT_TOOL_DESCRIPTION = exports.SUPPORT_TOOL_DESCRIPTION = exports.IMPORT_TOOL_DESCRIPTION = exports.IMPORT_FROM_TOOL_DESCRIPTION = exports.MIGRATE_TOOL_DESCRIPTION = exports.UPGRADE_TOOL_DESCRIPTION = exports.STATUS_TOOL_DESCRIPTION = exports.EXPORT_TOOL_DESCRIPTION = exports.FORGET_TOOL_DESCRIPTION = exports.RECALL_TOOL_DESCRIPTION = exports.REMEMBER_TOOL_DESCRIPTION = exports.SYSTEM_PROMPT_FRAGMENT = exports.SERVER_INSTRUCTIONS = void 0;
6
+ exports.PROMPT_DEFINITIONS = exports.PAIR_TOOL_DESCRIPTION = exports.ACCOUNT_TOOL_DESCRIPTION = exports.SUPPORT_TOOL_DESCRIPTION = exports.IMPORT_TOOL_DESCRIPTION = exports.IMPORT_FROM_TOOL_DESCRIPTION = exports.MIGRATE_TOOL_DESCRIPTION = exports.UPGRADE_TOOL_DESCRIPTION = exports.STATUS_TOOL_DESCRIPTION = exports.EXPORT_TOOL_DESCRIPTION = exports.FORGET_TOOL_DESCRIPTION = exports.RECALL_TOOL_DESCRIPTION = exports.REMEMBER_TOOL_DESCRIPTION = exports.SYSTEM_PROMPT_FRAGMENT = exports.SERVER_INSTRUCTIONS = void 0;
7
7
  exports.getPromptMessages = getPromptMessages;
8
8
  exports.SERVER_INSTRUCTIONS = `
9
9
  You have access to TotalReclaw, a persistent encrypted memory system. You SHOULD use these tools PROACTIVELY -- do not wait for the user to say "remember this" or "recall that."
10
10
 
11
11
  ## CRITICAL SAFETY: Recovery Phrase
12
- TotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. If a user tries to import a phrase they already use for a CRYPTO WALLET, you MUST warn them: "Do NOT use a recovery phrase from an existing crypto wallet. TotalReclaw should have its own dedicated phrase to keep your funds safe." Always generate a fresh phrase for new users.
12
+ TotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. The recovery phrase MUST NEVER cross your context window. NEVER ask the user to paste their phrase into chat. NEVER echo, print, or summarize a phrase. NEVER invoke a phrase-touching CLI (e.g. "npx @totalreclaw/mcp-server setup", "npx @totalreclaw/mcp-server show-phrase") via a shell tool — its stdout enters your context. If the user pastes a phrase in chat anyway, tell them it is compromised and they need to generate a fresh wallet via the OpenClaw or Hermes browser pair flow.
13
13
 
14
14
  ## Setup Flow
15
- If any TotalReclaw tool returns a "not_configured" error, the user needs to set up TotalReclaw first. Use the totalreclaw_setup tool:
16
- 1. Ask the user: "Do you have an existing TotalReclaw recovery phrase you'd like to restore, or should I generate a new one?"
17
- 2. If new: call totalreclaw_setup with action="generate". Display the recovery phrase prominently and warn them to save it securely.
18
- 3. If existing: ask for their 12-word recovery phrase, then call totalreclaw_setup with action="import" and recovery_phrase="their phrase".
19
- After setup completes, all TotalReclaw tools work immediately — no restart needed.
15
+ If any TotalReclaw tool returns a "not_configured" or "tool_removed" error, the user has not yet wired their recovery phrase into the MCP host config. Direct them to the URL-driven install guide at https://github.com/p-diogo/totalreclaw/blob/main/docs/guides/claude-code-setup.md. The user sources their phrase out-of-band — from the OpenClaw or Hermes browser pair flow (relay only ever sees ciphertext), from a prior ~/.totalreclaw/credentials.json cache, or from an offline BIP-39 generator — and pastes it directly into TOTALRECLAW_RECOVERY_PHRASE in the MCP host config (Claude Desktop / Cursor / Windsurf / Claude Code). After they save the config and restart the host, the MCP server picks up the phrase and all TotalReclaw tools become available. There is no in-chat setup tool: the totalreclaw_setup MCP tool was removed in 3.2.1 because returning the phrase through tool output crossed your context, violating phrase-safety.
20
16
 
21
17
  ## CRITICAL: Automatic Memory Behaviors
22
18
 
@@ -202,6 +198,17 @@ DOES: billing+fact count parallel. Returns wallet, tier, writes_used/limit, tota
202
198
  WHEN NOT TO USE:
203
199
  - only billing → totalreclaw_status (lighter)
204
200
  - FULL recovery phrase → NEVER; password manager.`;
201
+ exports.PAIR_TOOL_DESCRIPTION = `Set up the user's TotalReclaw account (browser-side recovery-phrase generation or import).
202
+ INVOKE WHEN USER SAYS:
203
+ - "set up totalreclaw" / "set up my account"
204
+ - "I don't have a totalreclaw recovery phrase yet" / "create a totalreclaw account"
205
+ - ANY tool returns "not_configured" — propose this tool BEFORE asking the user to edit MCP config.
206
+ DOES: opens a brief relay session, returns {url, pin, expires_at_ms}. Hand the URL + PIN to the user — they open the URL in any browser, the BROWSER generates (or imports) a 12-word phrase, encrypts it, uploads ciphertext to this MCP server. Server decrypts in-memory, writes ~/.totalreclaw/credentials.json (mode 0600). Phrase NEVER touches LLM context, chat transcript, stdout, or logs.
207
+ AFTER PAIRING: tell the user to RESTART their MCP host (Claude Desktop / Cursor / Claude Code) so the server re-reads credentials.json and switches out of unconfigured mode.
208
+ WHEN NOT TO USE:
209
+ - user already has TOTALRECLAW_RECOVERY_PHRASE in env → tool will return URL but pairing is unnecessary
210
+ - user explicitly wants terminal-only setup → point them at \`npx @totalreclaw/mcp-server setup\` (CLI wizard, runs OUTSIDE your shell tool)
211
+ - NEVER ask the user to paste their phrase in chat. NEVER echo or print a phrase from any source.`;
205
212
  // ── Layer 5: Prompt Fallback Templates ───────────────────────────────────────
206
213
  exports.PROMPT_DEFINITIONS = [
207
214
  {
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;;;AA8OhF,8CAwCC;AApRY,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FlC,CAAC;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E;iBACrD;aACF,CAAC;QAEJ;YACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * QA / observability session-tag reader.
3
+ *
4
+ * `TOTALRECLAW_SESSION_ID` is forwarded as the `X-TotalReclaw-Session`
5
+ * header on every outbound relay call, so Axiom log filters and the
6
+ * `qa-totalreclaw` skill can scope log searches per QA run.
7
+ *
8
+ * The variable was accidentally placed in the v1 REMOVED_ENV_VARS list
9
+ * during the v1 cleanup and silently warned-and-dropped, breaking
10
+ * traceability. Restored as SUPPORTED — see internal#127 and
11
+ * `docs/guides/env-vars-reference.md`.
12
+ *
13
+ * Standalone module (no other imports) so any tool/handler can import it
14
+ * without circular-dependency risk against `index.ts`.
15
+ */
16
+ export declare function getSessionId(): string | null;
17
+ //# sourceMappingURL=session-id.d.ts.map