@totalreclaw/mcp-server 1.6.4 → 1.6.5
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.
- package/dist/cli/setup.js +0 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +2 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +28 -1
- package/dist/prompts.js.map +1 -1
- package/dist/subgraph/crypto.d.ts +30 -50
- package/dist/subgraph/crypto.d.ts.map +1 -1
- package/dist/subgraph/crypto.js +90 -168
- package/dist/subgraph/crypto.js.map +1 -1
- package/dist/subgraph/lsh.d.ts +9 -61
- package/dist/subgraph/lsh.d.ts.map +1 -1
- package/dist/subgraph/lsh.js +17 -169
- package/dist/subgraph/lsh.js.map +1 -1
- package/dist/subgraph/search.d.ts +11 -0
- package/dist/subgraph/search.d.ts.map +1 -1
- package/dist/subgraph/search.js +41 -0
- package/dist/subgraph/search.js.map +1 -1
- package/dist/tools/account.d.ts +32 -0
- package/dist/tools/account.d.ts.map +1 -0
- package/dist/tools/account.js +99 -0
- package/dist/tools/account.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/support.d.ts +31 -0
- package/dist/tools/support.d.ts.map +1 -0
- package/dist/tools/support.js +83 -0
- package/dist/tools/support.js.map +1 -0
- package/package.json +2 -1
package/dist/subgraph/lsh.js
CHANGED
|
@@ -1,45 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* TotalReclaw MCP - LSH Hasher (
|
|
3
|
+
* TotalReclaw MCP - LSH Hasher (WASM-backed)
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* the same buckets across sessions.
|
|
9
|
-
*
|
|
10
|
-
* Architecture overview:
|
|
11
|
-
* 1. Seed (32 bytes from HKDF) -> HKDF per table -> random bytes
|
|
12
|
-
* 2. Random bytes -> Box-Muller transform -> Gaussian-distributed hyperplanes
|
|
13
|
-
* 3. Embedding dot hyperplane -> sign bit -> N-bit signature per table
|
|
14
|
-
* 4. Signature -> `lsh_t{table}_{signature}` -> SHA-256 -> blind hash
|
|
15
|
-
*
|
|
16
|
-
* The blind hashes are merged with the existing blind word indices in the
|
|
17
|
-
* `blind_indices` array. The server never knows which hashes are word-based
|
|
18
|
-
* and which are LSH-based.
|
|
5
|
+
* Thin wrapper over `WasmLshHasher` from `@totalreclaw/core`. Same class
|
|
6
|
+
* interface as the previous pure-TS implementation so callers don't need
|
|
7
|
+
* to change.
|
|
19
8
|
*
|
|
20
9
|
* Default parameters:
|
|
21
|
-
* - 32 bits per table
|
|
22
|
-
* - 20 tables
|
|
23
|
-
* - Middle ground between 64-bit x 12 (too strict) and 12-bit x 28 (too loose)
|
|
24
|
-
*
|
|
25
|
-
* Dependencies: @noble/hashes only (already in project).
|
|
10
|
+
* - 32 bits per table
|
|
11
|
+
* - 20 tables
|
|
26
12
|
*/
|
|
27
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
14
|
exports.LSHHasher = void 0;
|
|
29
|
-
const
|
|
30
|
-
const sha2_js_1 = require("@noble/hashes/sha2.js");
|
|
31
|
-
// ---------------------------------------------------------------------------
|
|
32
|
-
// Constants
|
|
33
|
-
// ---------------------------------------------------------------------------
|
|
34
|
-
/** Default number of independent hash tables. */
|
|
35
|
-
const DEFAULT_N_TABLES = 20;
|
|
36
|
-
/** Default number of bits (hyperplanes) per table. */
|
|
37
|
-
const DEFAULT_N_BITS = 32;
|
|
38
|
-
/** Number of bytes needed per Gaussian float via Box-Muller (2 x uint32 = 8 bytes). */
|
|
39
|
-
const BYTES_PER_FLOAT = 8;
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
// LSHHasher
|
|
42
|
-
// ---------------------------------------------------------------------------
|
|
15
|
+
const core_1 = require("@totalreclaw/core");
|
|
43
16
|
/**
|
|
44
17
|
* Random Hyperplane LSH hasher.
|
|
45
18
|
*
|
|
@@ -47,164 +20,39 @@ const BYTES_PER_FLOAT = 8;
|
|
|
47
20
|
* Construct once per session; call `hash()` for every store/search operation.
|
|
48
21
|
*/
|
|
49
22
|
class LSHHasher {
|
|
50
|
-
|
|
51
|
-
* Flat hyperplane storage.
|
|
52
|
-
*
|
|
53
|
-
* `hyperplanes[t]` is a Float64Array of length `dims * nBits` containing the
|
|
54
|
-
* hyperplane matrix for table `t`. The hyperplane for bit `b` starts at
|
|
55
|
-
* offset `b * dims`.
|
|
56
|
-
*/
|
|
57
|
-
hyperplanes;
|
|
58
|
-
/** Embedding dimensionality. */
|
|
59
|
-
dims;
|
|
60
|
-
/** Number of independent hash tables. */
|
|
61
|
-
nTables;
|
|
62
|
-
/** Number of bits (hyperplanes) per table. */
|
|
63
|
-
nBits;
|
|
23
|
+
inner;
|
|
64
24
|
/**
|
|
65
25
|
* Create a new LSH hasher.
|
|
66
26
|
*
|
|
67
|
-
* @param seed
|
|
68
|
-
* @param dims
|
|
27
|
+
* @param seed - 32-byte seed from `deriveLshSeed()` in crypto.ts.
|
|
28
|
+
* @param dims - Embedding dimensionality (e.g. 1024 for Qwen3).
|
|
69
29
|
* @param nTables - Number of independent hash tables (default 20).
|
|
70
30
|
* @param nBits - Number of bits per table (default 32).
|
|
71
31
|
*/
|
|
72
|
-
constructor(seed, dims, nTables =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
if (dims < 1) {
|
|
77
|
-
throw new Error(`dims must be positive, got ${dims}`);
|
|
78
|
-
}
|
|
79
|
-
if (nTables < 1) {
|
|
80
|
-
throw new Error(`nTables must be positive, got ${nTables}`);
|
|
81
|
-
}
|
|
82
|
-
if (nBits < 1) {
|
|
83
|
-
throw new Error(`nBits must be positive, got ${nBits}`);
|
|
84
|
-
}
|
|
85
|
-
this.dims = dims;
|
|
86
|
-
this.nTables = nTables;
|
|
87
|
-
this.nBits = nBits;
|
|
88
|
-
this.hyperplanes = new Array(nTables);
|
|
89
|
-
// Generate hyperplane matrices deterministically from the seed.
|
|
90
|
-
for (let t = 0; t < nTables; t++) {
|
|
91
|
-
this.hyperplanes[t] = this.generateTableHyperplanes(seed, t);
|
|
92
|
-
}
|
|
32
|
+
constructor(seed, dims, nTables = 20, nBits = 32) {
|
|
33
|
+
const seedHex = Buffer.from(seed).toString('hex');
|
|
34
|
+
this.inner = core_1.WasmLshHasher.withParams(seedHex, dims, nTables, nBits);
|
|
93
35
|
}
|
|
94
|
-
// -------------------------------------------------------------------------
|
|
95
|
-
// Hyperplane generation (deterministic from seed)
|
|
96
|
-
// -------------------------------------------------------------------------
|
|
97
|
-
/**
|
|
98
|
-
* Generate the hyperplane matrix for a single table.
|
|
99
|
-
*
|
|
100
|
-
* Each table gets a unique HKDF-derived byte stream. We consume 8 bytes
|
|
101
|
-
* per Gaussian sample (Box-Muller uses two uniform uint32 values).
|
|
102
|
-
*
|
|
103
|
-
* The hyperplanes are NOT normalised to unit length. Normalisation is
|
|
104
|
-
* unnecessary because we only care about the sign of the dot product,
|
|
105
|
-
* which is scale-invariant.
|
|
106
|
-
*/
|
|
107
|
-
generateTableHyperplanes(seed, tableIndex) {
|
|
108
|
-
const totalFloats = this.dims * this.nBits;
|
|
109
|
-
const totalBytes = totalFloats * BYTES_PER_FLOAT;
|
|
110
|
-
// Derive enough random bytes for this table.
|
|
111
|
-
// HKDF can produce up to 255 * HashLen bytes (255 * 32 = 8,160 for SHA-256).
|
|
112
|
-
// For large dims (e.g. 1536 * 64 * 8 = 786,432 bytes) we need multiple
|
|
113
|
-
// HKDF calls with sub-block indexing.
|
|
114
|
-
const randomBytes = this.deriveRandomBytes(seed, `lsh_table_${tableIndex}`, totalBytes);
|
|
115
|
-
// Convert the random bytes to Gaussian-distributed floats via Box-Muller.
|
|
116
|
-
const hyperplaneMatrix = new Float64Array(totalFloats);
|
|
117
|
-
const view = new DataView(randomBytes.buffer, randomBytes.byteOffset, randomBytes.byteLength);
|
|
118
|
-
for (let i = 0; i < totalFloats; i++) {
|
|
119
|
-
const offset = i * BYTES_PER_FLOAT;
|
|
120
|
-
// Two uint32 values -> two uniform [0,1) samples -> one Gaussian via Box-Muller.
|
|
121
|
-
const u1Raw = view.getUint32(offset, true);
|
|
122
|
-
const u2Raw = view.getUint32(offset + 4, true);
|
|
123
|
-
// Map to (0, 1] -- avoid exactly 0 for the log in Box-Muller.
|
|
124
|
-
const u1 = (u1Raw + 1) / (0xFFFFFFFF + 2);
|
|
125
|
-
const u2 = (u2Raw + 1) / (0xFFFFFFFF + 2);
|
|
126
|
-
// Box-Muller transform (we only need one of the two outputs).
|
|
127
|
-
hyperplaneMatrix[i] = Math.sqrt(-2 * Math.log(u1)) * Math.cos(2 * Math.PI * u2);
|
|
128
|
-
}
|
|
129
|
-
return hyperplaneMatrix;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Derive `length` pseudo-random bytes from the seed using HKDF with
|
|
133
|
-
* chunked sub-blocks.
|
|
134
|
-
*
|
|
135
|
-
* A single HKDF-SHA256 call can output at most 255 * 32 = 8,160 bytes.
|
|
136
|
-
* For large embedding dimensions we need more, so we iterate over
|
|
137
|
-
* sub-block indices as part of the info string.
|
|
138
|
-
*/
|
|
139
|
-
deriveRandomBytes(seed, baseInfo, length) {
|
|
140
|
-
const MAX_HKDF_OUTPUT = 255 * 32; // SHA-256 hash length = 32
|
|
141
|
-
const result = new Uint8Array(length);
|
|
142
|
-
let offset = 0;
|
|
143
|
-
let blockIndex = 0;
|
|
144
|
-
while (offset < length) {
|
|
145
|
-
const remaining = length - offset;
|
|
146
|
-
const chunkLen = Math.min(remaining, MAX_HKDF_OUTPUT);
|
|
147
|
-
const info = Buffer.from(`${baseInfo}_block_${blockIndex}`, 'utf8');
|
|
148
|
-
const chunk = (0, hkdf_js_1.hkdf)(sha2_js_1.sha256, seed, new Uint8Array(0), info, chunkLen);
|
|
149
|
-
result.set(new Uint8Array(chunk), offset);
|
|
150
|
-
offset += chunkLen;
|
|
151
|
-
blockIndex++;
|
|
152
|
-
}
|
|
153
|
-
return result;
|
|
154
|
-
}
|
|
155
|
-
// -------------------------------------------------------------------------
|
|
156
|
-
// Hash function
|
|
157
|
-
// -------------------------------------------------------------------------
|
|
158
36
|
/**
|
|
159
37
|
* Hash an embedding vector to an array of blind-hashed bucket IDs.
|
|
160
38
|
*
|
|
161
|
-
* For each table:
|
|
162
|
-
* 1. Compute the 64-bit signature (sign of dot product with each hyperplane).
|
|
163
|
-
* 2. Build the bucket string: `lsh_t{tableIndex}_{binarySignature}`.
|
|
164
|
-
* 3. SHA-256 the bucket string to produce a blind hash (hex).
|
|
165
|
-
*
|
|
166
39
|
* @param embedding - The embedding vector (must have `dims` elements).
|
|
167
40
|
* @returns Array of `nTables` hex strings (one blind hash per table).
|
|
168
41
|
*/
|
|
169
42
|
hash(embedding) {
|
|
170
|
-
|
|
171
|
-
throw new Error(`Embedding dimension mismatch: expected ${this.dims}, got ${embedding.length}`);
|
|
172
|
-
}
|
|
173
|
-
const results = new Array(this.nTables);
|
|
174
|
-
for (let t = 0; t < this.nTables; t++) {
|
|
175
|
-
const matrix = this.hyperplanes[t];
|
|
176
|
-
// Build the binary signature.
|
|
177
|
-
const bits = new Array(this.nBits);
|
|
178
|
-
for (let b = 0; b < this.nBits; b++) {
|
|
179
|
-
const baseOffset = b * this.dims;
|
|
180
|
-
let dot = 0;
|
|
181
|
-
for (let d = 0; d < this.dims; d++) {
|
|
182
|
-
dot += matrix[baseOffset + d] * embedding[d];
|
|
183
|
-
}
|
|
184
|
-
bits[b] = dot >= 0 ? '1' : '0';
|
|
185
|
-
}
|
|
186
|
-
const signature = bits.join('');
|
|
187
|
-
const bucketId = `lsh_t${t}_${signature}`;
|
|
188
|
-
// Blind-hash the bucket ID with SHA-256.
|
|
189
|
-
const hashBytes = (0, sha2_js_1.sha256)(Buffer.from(bucketId, 'utf8'));
|
|
190
|
-
results[t] = Buffer.from(hashBytes).toString('hex');
|
|
191
|
-
}
|
|
192
|
-
return results;
|
|
43
|
+
return this.inner.hash(new Float64Array(embedding));
|
|
193
44
|
}
|
|
194
|
-
// -------------------------------------------------------------------------
|
|
195
|
-
// Accessors
|
|
196
|
-
// -------------------------------------------------------------------------
|
|
197
45
|
/** Number of hash tables. */
|
|
198
46
|
get tables() {
|
|
199
|
-
return this.
|
|
47
|
+
return this.inner.tables;
|
|
200
48
|
}
|
|
201
49
|
/** Number of bits per table. */
|
|
202
50
|
get bits() {
|
|
203
|
-
return this.
|
|
51
|
+
return this.inner.bits;
|
|
204
52
|
}
|
|
205
53
|
/** Embedding dimensionality. */
|
|
206
54
|
get dimensions() {
|
|
207
|
-
return this.
|
|
55
|
+
return this.inner.dimensions;
|
|
208
56
|
}
|
|
209
57
|
}
|
|
210
58
|
exports.LSHHasher = LSHHasher;
|
package/dist/subgraph/lsh.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsh.js","sourceRoot":"","sources":["../../src/subgraph/lsh.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"lsh.js","sourceRoot":"","sources":["../../src/subgraph/lsh.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,4CAAkD;AAElD;;;;;GAKG;AACH,MAAa,SAAS;IACZ,KAAK,CAAgB;IAE7B;;;;;;;OAOG;IACH,YACE,IAAgB,EAChB,IAAY,EACZ,UAAkB,EAAE,EACpB,QAAgB,EAAE;QAElB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,oBAAa,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,SAAmB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,6BAA6B;IAC7B,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,gCAAgC;IAChC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,gCAAgC;IAChC,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;IAC/B,CAAC;CACF;AA7CD,8BA6CC"}
|
|
@@ -59,4 +59,15 @@ export declare function searchSubgraph(owner: string, trapdoors: string[], maxCa
|
|
|
59
59
|
* falls back to getSubgraphConfig().relayUrl.
|
|
60
60
|
*/
|
|
61
61
|
export declare function getSubgraphFactCount(owner: string, relayUrl?: string, authKeyHex?: string): Promise<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Get per-owner active fact count from the subgraph.
|
|
64
|
+
*
|
|
65
|
+
* The Graph does not support aggregate count queries, so we paginate
|
|
66
|
+
* through facts fetching only `id` and count client-side.
|
|
67
|
+
*
|
|
68
|
+
* @param owner - Smart Account address (hex, lowercase)
|
|
69
|
+
* @param relayUrl - Optional relay URL override
|
|
70
|
+
* @param authKeyHex - Auth key for relay authorization
|
|
71
|
+
*/
|
|
72
|
+
export declare function getOwnerFactCount(owner: string, relayUrl?: string, authKeyHex?: string): Promise<number>;
|
|
62
73
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/subgraph/search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EA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;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAsCjB"}
|
package/dist/subgraph/search.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.searchSubgraph = searchSubgraph;
|
|
28
28
|
exports.getSubgraphFactCount = getSubgraphFactCount;
|
|
29
|
+
exports.getOwnerFactCount = getOwnerFactCount;
|
|
29
30
|
const store_js_1 = require("./store.js");
|
|
30
31
|
const client_id_js_1 = require("../client-id.js");
|
|
31
32
|
/** Small batches so rare trapdoor matches aren't drowned by common ones. */
|
|
@@ -221,4 +222,44 @@ async function getSubgraphFactCount(owner, relayUrl, authKeyHex) {
|
|
|
221
222
|
}
|
|
222
223
|
return 0;
|
|
223
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Get per-owner active fact count from the subgraph.
|
|
227
|
+
*
|
|
228
|
+
* The Graph does not support aggregate count queries, so we paginate
|
|
229
|
+
* through facts fetching only `id` and count client-side.
|
|
230
|
+
*
|
|
231
|
+
* @param owner - Smart Account address (hex, lowercase)
|
|
232
|
+
* @param relayUrl - Optional relay URL override
|
|
233
|
+
* @param authKeyHex - Auth key for relay authorization
|
|
234
|
+
*/
|
|
235
|
+
async function getOwnerFactCount(owner, relayUrl, authKeyHex) {
|
|
236
|
+
const effectiveRelayUrl = relayUrl ?? (0, store_js_1.getSubgraphConfig)().relayUrl;
|
|
237
|
+
const subgraphUrl = `${effectiveRelayUrl}/v1/subgraph`;
|
|
238
|
+
const pageSize = 1000;
|
|
239
|
+
let total = 0;
|
|
240
|
+
let lastId = '';
|
|
241
|
+
let hasMore = true;
|
|
242
|
+
while (hasMore) {
|
|
243
|
+
const query = lastId
|
|
244
|
+
? `query OwnerFactCount($owner: Bytes!, $first: Int!, $lastId: String!) {
|
|
245
|
+
facts(where: { owner: $owner, isActive: true, id_gt: $lastId }, first: $first, orderBy: id, orderDirection: asc) { id }
|
|
246
|
+
}`
|
|
247
|
+
: `query OwnerFactCountInitial($owner: Bytes!, $first: Int!) {
|
|
248
|
+
facts(where: { owner: $owner, isActive: true }, first: $first, orderBy: id, orderDirection: asc) { id }
|
|
249
|
+
}`;
|
|
250
|
+
const variables = { owner, first: pageSize };
|
|
251
|
+
if (lastId)
|
|
252
|
+
variables.lastId = lastId;
|
|
253
|
+
const data = await gqlQuery(subgraphUrl, query, variables, authKeyHex);
|
|
254
|
+
const facts = data?.facts ?? [];
|
|
255
|
+
total += facts.length;
|
|
256
|
+
if (facts.length < pageSize) {
|
|
257
|
+
hasMore = false;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
lastId = facts[facts.length - 1].id;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return total;
|
|
264
|
+
}
|
|
224
265
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/subgraph/search.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;AAyIH,wCAmFC;AAYD,oDA+BC;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/subgraph/search.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;AAyIH,wCAmFC;AAYD,oDA+BC;AAYD,8CA0CC;AA3TD,yCAA+C;AAC/C,kDAA8C;AAW9C,4EAA4E;AAC5E,MAAM,2BAA2B,GAAG,CAAC,CAAC;AACtC,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,sCAAsC;AAEtE;;;GAGG;AACH,KAAK,UAAU,QAAQ,CACrB,QAAgB,EAChB,KAAa,EACb,SAAkC,EAClC,UAAmB;IAEnB,IAAI,CAAC;QACH,MAAM,OAAO,GAA2B;YACt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
1
|
+
/**
|
|
2
|
+
* TotalReclaw MCP - Account Details Tool
|
|
3
|
+
*
|
|
4
|
+
* Shows account information: billing status, fact count, features,
|
|
5
|
+
* and a recovery phrase hint (first + last word only).
|
|
6
|
+
*/
|
|
7
|
+
export declare const accountToolDefinition: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: {};
|
|
13
|
+
};
|
|
14
|
+
annotations: {
|
|
15
|
+
readOnlyHint: boolean;
|
|
16
|
+
destructiveHint: boolean;
|
|
17
|
+
idempotentHint: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Handle a totalreclaw_account tool call.
|
|
22
|
+
*
|
|
23
|
+
* Fetches billing status and fact count, then returns a comprehensive
|
|
24
|
+
* account overview including a recovery phrase hint.
|
|
25
|
+
*/
|
|
26
|
+
export declare function handleAccount(serverUrl: string, authKeyHex: string, walletAddress: string, mnemonicHint: string, getFactCount: () => Promise<number>): Promise<{
|
|
27
|
+
content: Array<{
|
|
28
|
+
type: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CAYjC,CAAC;AAUF;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAwC7D"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TotalReclaw MCP - Account Details Tool
|
|
4
|
+
*
|
|
5
|
+
* Shows account information: billing status, fact count, features,
|
|
6
|
+
* and a recovery phrase hint (first + last word only).
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.accountToolDefinition = void 0;
|
|
10
|
+
exports.handleAccount = handleAccount;
|
|
11
|
+
const prompts_js_1 = require("../prompts.js");
|
|
12
|
+
const client_id_js_1 = require("../client-id.js");
|
|
13
|
+
exports.accountToolDefinition = {
|
|
14
|
+
name: 'totalreclaw_account',
|
|
15
|
+
description: prompts_js_1.ACCOUNT_TOOL_DESCRIPTION,
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {},
|
|
19
|
+
},
|
|
20
|
+
annotations: {
|
|
21
|
+
readOnlyHint: true,
|
|
22
|
+
destructiveHint: false,
|
|
23
|
+
idempotentHint: true,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Handle a totalreclaw_account tool call.
|
|
28
|
+
*
|
|
29
|
+
* Fetches billing status and fact count, then returns a comprehensive
|
|
30
|
+
* account overview including a recovery phrase hint.
|
|
31
|
+
*/
|
|
32
|
+
async function handleAccount(serverUrl, authKeyHex, walletAddress, mnemonicHint, getFactCount) {
|
|
33
|
+
// Fetch billing status and fact count in parallel
|
|
34
|
+
const [billingResult, factCount] = await Promise.all([
|
|
35
|
+
fetchBillingStatus(serverUrl, authKeyHex, walletAddress),
|
|
36
|
+
getFactCount().catch(() => null),
|
|
37
|
+
]);
|
|
38
|
+
if (billingResult.error) {
|
|
39
|
+
return {
|
|
40
|
+
content: [{
|
|
41
|
+
type: 'text',
|
|
42
|
+
text: JSON.stringify({
|
|
43
|
+
error: billingResult.error,
|
|
44
|
+
details: billingResult.details,
|
|
45
|
+
}),
|
|
46
|
+
}],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const billing = billingResult.data;
|
|
50
|
+
const tierLabel = billing.tier === 'pro' ? 'Pro' : 'Free';
|
|
51
|
+
const remaining = billing.free_writes_limit - billing.free_writes_used;
|
|
52
|
+
return {
|
|
53
|
+
content: [{
|
|
54
|
+
type: 'text',
|
|
55
|
+
text: JSON.stringify({
|
|
56
|
+
wallet_address: walletAddress,
|
|
57
|
+
tier: billing.tier,
|
|
58
|
+
tier_label: tierLabel,
|
|
59
|
+
expires_at: billing.expires_at,
|
|
60
|
+
writes_used: billing.free_writes_used,
|
|
61
|
+
writes_limit: billing.free_writes_limit,
|
|
62
|
+
remaining_writes: remaining,
|
|
63
|
+
total_facts_stored: factCount,
|
|
64
|
+
features: billing.features ?? {},
|
|
65
|
+
recovery_phrase_hint: mnemonicHint,
|
|
66
|
+
}),
|
|
67
|
+
}],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Fetch billing status from the relay server.
|
|
72
|
+
*/
|
|
73
|
+
async function fetchBillingStatus(serverUrl, authKeyHex, walletAddress) {
|
|
74
|
+
try {
|
|
75
|
+
const url = `${serverUrl.replace(/\/+$/, '')}/v1/billing/status?wallet_address=${encodeURIComponent(walletAddress)}`;
|
|
76
|
+
const response = await fetch(url, {
|
|
77
|
+
method: 'GET',
|
|
78
|
+
headers: {
|
|
79
|
+
'Authorization': `Bearer ${authKeyHex}`,
|
|
80
|
+
'Content-Type': 'application/json',
|
|
81
|
+
'X-TotalReclaw-Client': (0, client_id_js_1.getClientId)(),
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
if (!response.ok) {
|
|
85
|
+
const body = await response.text().catch(() => '');
|
|
86
|
+
return {
|
|
87
|
+
error: `Failed to fetch billing status (HTTP ${response.status})`,
|
|
88
|
+
details: body || response.statusText,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const data = (await response.json());
|
|
92
|
+
return { data };
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
96
|
+
return { error: `Failed to fetch billing status: ${message}` };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAiCH,sCA8CC;AA7ED,8CAAyD;AACzD,kDAA8C;AAEjC,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qCAAwB;IACrC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;KACf;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAUF;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CACjC,SAAiB,EACjB,UAAkB,EAClB,aAAqB,EACrB,YAAoB,EACpB,YAAmC;IAEnC,kDAAkD;IAClD,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnD,kBAAkB,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC;QACxD,YAAY,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;KACjC,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;QACxB,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,aAAa,CAAC,KAAK;wBAC1B,OAAO,EAAE,aAAa,CAAC,OAAO;qBAC/B,CAAC;iBACH,CAAC;SAC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AE,CAAC;YACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YACnD,OAAO;gBACL,KAAK,EAAE,wCAAwC,QAAQ,CAAC,MAAM,GAAG;gBACjE,OAAO,EAAE,IAAI,IAAI,QAAQ,CAAC,UAAU;aACrC,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA0B,CAAC;QAC9D,OAAO,EAAE,IAAI,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO,EAAE,KAAK,EAAE,mCAAmC,OAAO,EAAE,EAAE,CAAC;IACjE,CAAC;AACH,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -9,5 +9,7 @@ export { statusToolDefinition, handleStatus } from './status.js';
|
|
|
9
9
|
export { upgradeToolDefinition, handleUpgrade } from './upgrade.js';
|
|
10
10
|
export { migrateToolDefinition } from './migrate.js';
|
|
11
11
|
export { debriefToolDefinition, handleDebrief, parseDebriefResponse, DEBRIEF_SYSTEM_PROMPT, type DebriefItem } from './debrief.js';
|
|
12
|
+
export { supportToolDefinition, handleSupport } from './support.js';
|
|
13
|
+
export { accountToolDefinition, handleAccount } from './account.js';
|
|
12
14
|
export { fetchAllFactsFromSubgraph, fetchMainnetContentFps, fetchBlindIndicesForFacts, checkBillingTier, type SubgraphFactFull, type MigrationResult, } from './migrate.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,cAAc,E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AE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACnI,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkBillingTier = exports.fetchBlindIndicesForFacts = exports.fetchMainnetContentFps = exports.fetchAllFactsFromSubgraph = exports.DEBRIEF_SYSTEM_PROMPT = exports.parseDebriefResponse = exports.handleDebrief = exports.debriefToolDefinition = exports.migrateToolDefinition = exports.handleUpgrade = exports.upgradeToolDefinition = exports.handleStatus = exports.statusToolDefinition = exports.handleConsolidate = exports.consolidateToolDefinition = exports.handleImportFrom = exports.importFromToolDefinition = exports.handleImport = exports.importToolDefinition = exports.handleExport = exports.exportToolDefinition = exports.handleForget = exports.forgetToolDefinition = exports.handleRecall = exports.recallToolDefinition = exports.handleRemember = exports.rememberToolDefinition = void 0;
|
|
3
|
+
exports.checkBillingTier = exports.fetchBlindIndicesForFacts = exports.fetchMainnetContentFps = exports.fetchAllFactsFromSubgraph = exports.handleAccount = exports.accountToolDefinition = exports.handleSupport = exports.supportToolDefinition = exports.DEBRIEF_SYSTEM_PROMPT = exports.parseDebriefResponse = exports.handleDebrief = exports.debriefToolDefinition = exports.migrateToolDefinition = exports.handleUpgrade = exports.upgradeToolDefinition = exports.handleStatus = exports.statusToolDefinition = exports.handleConsolidate = exports.consolidateToolDefinition = exports.handleImportFrom = exports.importFromToolDefinition = exports.handleImport = exports.importToolDefinition = exports.handleExport = exports.exportToolDefinition = exports.handleForget = exports.forgetToolDefinition = exports.handleRecall = exports.recallToolDefinition = exports.handleRemember = exports.rememberToolDefinition = void 0;
|
|
4
4
|
var remember_js_1 = require("./remember.js");
|
|
5
5
|
Object.defineProperty(exports, "rememberToolDefinition", { enumerable: true, get: function () { return remember_js_1.rememberToolDefinition; } });
|
|
6
6
|
Object.defineProperty(exports, "handleRemember", { enumerable: true, get: function () { return remember_js_1.handleRemember; } });
|
|
@@ -35,6 +35,12 @@ Object.defineProperty(exports, "debriefToolDefinition", { enumerable: true, get:
|
|
|
35
35
|
Object.defineProperty(exports, "handleDebrief", { enumerable: true, get: function () { return debrief_js_1.handleDebrief; } });
|
|
36
36
|
Object.defineProperty(exports, "parseDebriefResponse", { enumerable: true, get: function () { return debrief_js_1.parseDebriefResponse; } });
|
|
37
37
|
Object.defineProperty(exports, "DEBRIEF_SYSTEM_PROMPT", { enumerable: true, get: function () { return debrief_js_1.DEBRIEF_SYSTEM_PROMPT; } });
|
|
38
|
+
var support_js_1 = require("./support.js");
|
|
39
|
+
Object.defineProperty(exports, "supportToolDefinition", { enumerable: true, get: function () { return support_js_1.supportToolDefinition; } });
|
|
40
|
+
Object.defineProperty(exports, "handleSupport", { enumerable: true, get: function () { return support_js_1.handleSupport; } });
|
|
41
|
+
var account_js_1 = require("./account.js");
|
|
42
|
+
Object.defineProperty(exports, "accountToolDefinition", { enumerable: true, get: function () { return account_js_1.accountToolDefinition; } });
|
|
43
|
+
Object.defineProperty(exports, "handleAccount", { enumerable: true, get: function () { return account_js_1.handleAccount; } });
|
|
38
44
|
var migrate_js_2 = require("./migrate.js");
|
|
39
45
|
Object.defineProperty(exports, "fetchAllFactsFromSubgraph", { enumerable: true, get: function () { return migrate_js_2.fetchAllFactsFromSubgraph; } });
|
|
40
46
|
Object.defineProperty(exports, "fetchMainnetContentFps", { enumerable: true, get: function () { return migrate_js_2.fetchMainnetContentFps; } });
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;AAAA,6CAAuE;AAA9D,qHAAA,sBAAsB,OAAA;AAAE,6GAAA,cAAc,OAAA;AAC/C,yCAAiE;AAAxD,iHAAA,oBAAoB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC3C,yCAAiE;AAAxD,iHAAA,oBAAoB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC3C,yCAAiE;AAAxD,iHAAA,oBAAoB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC3C,yCAAiE;AAAxD,iHAAA,oBAAoB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC3C,mDAA8E;AAArE,0HAAA,wBAAwB,OAAA;AAAE,kHAAA,gBAAgB,OAAA;AACnD,mDAAgF;AAAvE,2HAAA,yBAAyB,OAAA;AAAE,mHAAA,iBAAiB,OAAA;AACrD,yCAAiE;AAAxD,iHAAA,oBAAoB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAC3C,2CAAoE;AAA3D,mHAAA,qBAAqB,OAAA;AAAE,2GAAA,aAAa,OAAA;AAC7C,2CAAqD;AAA5C,mHAAA,qBAAqB,OAAA;AAC9B,2CAAmI;AAA1H,mHAAA,qBAAqB,OAAA;AAAE,2GAAA,aAAa,OAAA;AAAE,kHAAA,oBAAoB,OAAA;AAAE,mHAAA,qBAAqB,OAAA;AAC1F,2CAOsB;AANpB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,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TotalReclaw MCP - Support Tool
|
|
3
|
+
*
|
|
4
|
+
* Returns static support information and common troubleshooting steps.
|
|
5
|
+
* No server calls needed -- works in all modes including unconfigured.
|
|
6
|
+
*/
|
|
7
|
+
export declare const supportToolDefinition: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: {};
|
|
13
|
+
};
|
|
14
|
+
annotations: {
|
|
15
|
+
readOnlyHint: boolean;
|
|
16
|
+
destructiveHint: boolean;
|
|
17
|
+
idempotentHint: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Handle a totalreclaw_support tool call.
|
|
22
|
+
*
|
|
23
|
+
* Returns static support information. No server calls needed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function handleSupport(walletAddress: string | null): {
|
|
26
|
+
content: Array<{
|
|
27
|
+
type: string;
|
|
28
|
+
text: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/tools/support.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CAYjC,CAAC;AAyCF;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAqBpD"}
|