@totalreclaw/mcp-server 1.6.3 → 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/client-id.d.ts +3 -0
- package/dist/client-id.d.ts.map +1 -0
- package/dist/client-id.js +16 -0
- package/dist/client-id.js.map +1 -0
- package/dist/index.js +178 -4
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +4 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +42 -2
- 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 +43 -1
- package/dist/subgraph/search.js.map +1 -1
- package/dist/subgraph/store.d.ts.map +1 -1
- package/dist/subgraph/store.js +3 -2
- package/dist/subgraph/store.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/debrief.d.ts +74 -0
- package/dist/tools/debrief.d.ts.map +1 -0
- package/dist/tools/debrief.js +189 -0
- package/dist/tools/debrief.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +12 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/migrate.d.ts.map +1 -1
- package/dist/tools/migrate.js +3 -2
- package/dist/tools/migrate.js.map +1 -1
- package/dist/tools/status.d.ts.map +1 -1
- package/dist/tools/status.js +2 -1
- package/dist/tools/status.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/dist/tools/upgrade.d.ts.map +1 -1
- package/dist/tools/upgrade.js +2 -1
- package/dist/tools/upgrade.js.map +1 -1
- package/package.json +2 -1
package/dist/subgraph/lsh.d.ts
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TotalReclaw MCP - LSH Hasher (
|
|
2
|
+
* TotalReclaw MCP - LSH Hasher (WASM-backed)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the same buckets across sessions.
|
|
8
|
-
*
|
|
9
|
-
* Architecture overview:
|
|
10
|
-
* 1. Seed (32 bytes from HKDF) -> HKDF per table -> random bytes
|
|
11
|
-
* 2. Random bytes -> Box-Muller transform -> Gaussian-distributed hyperplanes
|
|
12
|
-
* 3. Embedding dot hyperplane -> sign bit -> N-bit signature per table
|
|
13
|
-
* 4. Signature -> `lsh_t{table}_{signature}` -> SHA-256 -> blind hash
|
|
14
|
-
*
|
|
15
|
-
* The blind hashes are merged with the existing blind word indices in the
|
|
16
|
-
* `blind_indices` array. The server never knows which hashes are word-based
|
|
17
|
-
* and which are LSH-based.
|
|
4
|
+
* Thin wrapper over `WasmLshHasher` from `@totalreclaw/core`. Same class
|
|
5
|
+
* interface as the previous pure-TS implementation so callers don't need
|
|
6
|
+
* to change.
|
|
18
7
|
*
|
|
19
8
|
* Default parameters:
|
|
20
|
-
* - 32 bits per table
|
|
21
|
-
* - 20 tables
|
|
22
|
-
* - Middle ground between 64-bit x 12 (too strict) and 12-bit x 28 (too loose)
|
|
23
|
-
*
|
|
24
|
-
* Dependencies: @noble/hashes only (already in project).
|
|
9
|
+
* - 32 bits per table
|
|
10
|
+
* - 20 tables
|
|
25
11
|
*/
|
|
26
12
|
/**
|
|
27
13
|
* Random Hyperplane LSH hasher.
|
|
@@ -30,57 +16,19 @@
|
|
|
30
16
|
* Construct once per session; call `hash()` for every store/search operation.
|
|
31
17
|
*/
|
|
32
18
|
export declare class LSHHasher {
|
|
33
|
-
|
|
34
|
-
* Flat hyperplane storage.
|
|
35
|
-
*
|
|
36
|
-
* `hyperplanes[t]` is a Float64Array of length `dims * nBits` containing the
|
|
37
|
-
* hyperplane matrix for table `t`. The hyperplane for bit `b` starts at
|
|
38
|
-
* offset `b * dims`.
|
|
39
|
-
*/
|
|
40
|
-
private hyperplanes;
|
|
41
|
-
/** Embedding dimensionality. */
|
|
42
|
-
private readonly dims;
|
|
43
|
-
/** Number of independent hash tables. */
|
|
44
|
-
private readonly nTables;
|
|
45
|
-
/** Number of bits (hyperplanes) per table. */
|
|
46
|
-
private readonly nBits;
|
|
19
|
+
private inner;
|
|
47
20
|
/**
|
|
48
21
|
* Create a new LSH hasher.
|
|
49
22
|
*
|
|
50
|
-
* @param seed
|
|
51
|
-
* @param dims
|
|
23
|
+
* @param seed - 32-byte seed from `deriveLshSeed()` in crypto.ts.
|
|
24
|
+
* @param dims - Embedding dimensionality (e.g. 1024 for Qwen3).
|
|
52
25
|
* @param nTables - Number of independent hash tables (default 20).
|
|
53
26
|
* @param nBits - Number of bits per table (default 32).
|
|
54
27
|
*/
|
|
55
28
|
constructor(seed: Uint8Array, dims: number, nTables?: number, nBits?: number);
|
|
56
|
-
/**
|
|
57
|
-
* Generate the hyperplane matrix for a single table.
|
|
58
|
-
*
|
|
59
|
-
* Each table gets a unique HKDF-derived byte stream. We consume 8 bytes
|
|
60
|
-
* per Gaussian sample (Box-Muller uses two uniform uint32 values).
|
|
61
|
-
*
|
|
62
|
-
* The hyperplanes are NOT normalised to unit length. Normalisation is
|
|
63
|
-
* unnecessary because we only care about the sign of the dot product,
|
|
64
|
-
* which is scale-invariant.
|
|
65
|
-
*/
|
|
66
|
-
private generateTableHyperplanes;
|
|
67
|
-
/**
|
|
68
|
-
* Derive `length` pseudo-random bytes from the seed using HKDF with
|
|
69
|
-
* chunked sub-blocks.
|
|
70
|
-
*
|
|
71
|
-
* A single HKDF-SHA256 call can output at most 255 * 32 = 8,160 bytes.
|
|
72
|
-
* For large embedding dimensions we need more, so we iterate over
|
|
73
|
-
* sub-block indices as part of the info string.
|
|
74
|
-
*/
|
|
75
|
-
private deriveRandomBytes;
|
|
76
29
|
/**
|
|
77
30
|
* Hash an embedding vector to an array of blind-hashed bucket IDs.
|
|
78
31
|
*
|
|
79
|
-
* For each table:
|
|
80
|
-
* 1. Compute the 64-bit signature (sign of dot product with each hyperplane).
|
|
81
|
-
* 2. Build the bucket string: `lsh_t{tableIndex}_{binarySignature}`.
|
|
82
|
-
* 3. SHA-256 the bucket string to produce a blind hash (hex).
|
|
83
|
-
*
|
|
84
32
|
* @param embedding - The embedding vector (must have `dims` elements).
|
|
85
33
|
* @returns Array of `nTables` hex strings (one blind hash per table).
|
|
86
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsh.d.ts","sourceRoot":"","sources":["../../src/subgraph/lsh.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lsh.d.ts","sourceRoot":"","sources":["../../src/subgraph/lsh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAgB;IAE7B;;;;;;;OAOG;gBAED,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAW,EACpB,KAAK,GAAE,MAAW;IAMpB;;;;;OAKG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAInC,6BAA6B;IAC7B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,gCAAgC;IAChC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,gCAAgC;IAChC,IAAI,UAAU,IAAI,MAAM,CAEvB;CACF"}
|
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;
|
|
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,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AA4GD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EAAE,EACnB,aAAa,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA6E/B;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CA2BjB;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,7 +26,9 @@
|
|
|
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");
|
|
31
|
+
const client_id_js_1 = require("../client-id.js");
|
|
30
32
|
/** Small batches so rare trapdoor matches aren't drowned by common ones. */
|
|
31
33
|
const DEFAULT_TRAPDOOR_BATCH_SIZE = 5;
|
|
32
34
|
const DEFAULT_PAGE_SIZE = 1000; // Graph Studio limits `first` to 1000
|
|
@@ -38,7 +40,7 @@ async function gqlQuery(endpoint, query, variables, authKeyHex) {
|
|
|
38
40
|
try {
|
|
39
41
|
const headers = {
|
|
40
42
|
'Content-Type': 'application/json',
|
|
41
|
-
'X-TotalReclaw-Client':
|
|
43
|
+
'X-TotalReclaw-Client': (0, client_id_js_1.getClientId)(),
|
|
42
44
|
};
|
|
43
45
|
if (authKeyHex)
|
|
44
46
|
headers['Authorization'] = `Bearer ${authKeyHex}`;
|
|
@@ -220,4 +222,44 @@ async function getSubgraphFactCount(owner, relayUrl, authKeyHex) {
|
|
|
220
222
|
}
|
|
221
223
|
return 0;
|
|
222
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
|
+
}
|
|
223
265
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/subgraph/search.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;
|
|
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,CA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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/subgraph/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAoD,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/subgraph/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAoD,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAmBpF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CA2D5D;AAED,6CAA6C;AAC7C,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASlD;AAMD,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAWrD;AAED,gEAAgE;AAChE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAgGnE;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,gBAAgB,EAAE,MAAM,EAAE,EAC1B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAsFtF;AAMD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAG1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAe/F"}
|
package/dist/subgraph/store.js
CHANGED
|
@@ -24,6 +24,7 @@ exports.submitFactBatchOnChain = submitFactBatchOnChain;
|
|
|
24
24
|
exports.isSubgraphMode = isSubgraphMode;
|
|
25
25
|
exports.getSubgraphConfig = getSubgraphConfig;
|
|
26
26
|
const viem_1 = require("viem");
|
|
27
|
+
const client_id_js_1 = require("../client-id.js");
|
|
27
28
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
28
29
|
const accounts_1 = require("viem/accounts");
|
|
29
30
|
const chains_1 = require("viem/chains");
|
|
@@ -163,7 +164,7 @@ async function submitFactOnChain(protobufPayload, config) {
|
|
|
163
164
|
const entryPointAddr = (config.entryPointAddress || account_abstraction_1.entryPoint07Address);
|
|
164
165
|
// Build authenticated transport for relay server proxy
|
|
165
166
|
const headers = {
|
|
166
|
-
'X-TotalReclaw-Client':
|
|
167
|
+
'X-TotalReclaw-Client': (0, client_id_js_1.getClientId)(),
|
|
167
168
|
};
|
|
168
169
|
if (config.authKeyHex)
|
|
169
170
|
headers['Authorization'] = `Bearer ${config.authKeyHex}`;
|
|
@@ -265,7 +266,7 @@ async function submitFactBatchOnChain(protobufPayloads, config) {
|
|
|
265
266
|
const dataEdgeAddress = config.dataEdgeAddress;
|
|
266
267
|
const entryPointAddr = (config.entryPointAddress || account_abstraction_1.entryPoint07Address);
|
|
267
268
|
const headers = {
|
|
268
|
-
'X-TotalReclaw-Client':
|
|
269
|
+
'X-TotalReclaw-Client': (0, client_id_js_1.getClientId)(),
|
|
269
270
|
};
|
|
270
271
|
if (config.authKeyHex)
|
|
271
272
|
headers['Authorization'] = `Bearer ${config.authKeyHex}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/subgraph/store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/subgraph/store.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AA2DH,gDA2DC;AAGD,oCASC;AAOD,wCAWC;AAGD,gDAEC;AAmBD,8CAmGC;AAWD,wDAyFC;AAcD,wCAGC;AAmBD,8CAeC;AApaD,+BAAoF;AACpF,kDAA8C;AAC9C,kEAA+D;AAC/D,4CAAkD;AAClD,wCAAgE;AAChE,mDAA0D;AAC1D,sDAA+D;AAC/D,4DAAqE;AAErE,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,kEAAkE;AAClE,MAAM,yBAAyB,GAAG,4CAA4C,CAAC;AAE/E,uEAAuE;AACvE,MAAM,0BAA0B,GAAG,4CAA4C,CAAC;AA0BhF,8EAA8E;AAC9E,gCAAgC;AAChC,8EAA8E;AAE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EF,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,CAAC;IACxC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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"}
|