@totalreclaw/core 2.4.0 → 2.5.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.
- package/package.json +1 -1
- package/totalreclaw_core.d.ts +46 -0
- package/totalreclaw_core.js +145 -0
- package/totalreclaw_core_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@totalreclaw/core",
|
|
3
3
|
"description": "TotalReclaw core — E2EE crypto, reranker, wallet, UserOp, store/search pipelines. Single source of truth for all clients.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
package/totalreclaw_core.d.ts
CHANGED
|
@@ -170,6 +170,15 @@ export function canonicalizeClaim(claim_json: string): string;
|
|
|
170
170
|
*/
|
|
171
171
|
export function chunksToSummaries(chunks_json: string): any;
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Classify natural-language pin/unpin intent from a user utterance.
|
|
175
|
+
*
|
|
176
|
+
* Returns JSON of [`PinIntent`] when a trigger phrase matches, or `null` when
|
|
177
|
+
* the utterance contains no recognised pin gesture. Lowercase normalization
|
|
178
|
+
* is applied internally — callers pass the raw user text.
|
|
179
|
+
*/
|
|
180
|
+
export function classifyPinIntent(text: string): string;
|
|
181
|
+
|
|
173
182
|
/**
|
|
174
183
|
* WASM binding for `cluster_facts`.
|
|
175
184
|
*
|
|
@@ -229,6 +238,12 @@ export function decrypt(encrypted_base64: string, encryption_key_hex: string): s
|
|
|
229
238
|
*/
|
|
230
239
|
export function decryptAndRerank(facts_json: string, query: string, query_embedding: Float32Array, encryption_key_hex: string, top_k: number): any;
|
|
231
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Return the locked-default [`PinConfig`] as JSON. Clients that don't want
|
|
243
|
+
* to retune can pass this verbatim to [`wasm_pin_boost`].
|
|
244
|
+
*/
|
|
245
|
+
export function defaultPinConfig(): string;
|
|
246
|
+
|
|
232
247
|
/**
|
|
233
248
|
* Default P2-3 resolution weights as JSON.
|
|
234
249
|
*/
|
|
@@ -295,6 +310,11 @@ export function deterministicEntityId(name: string): string;
|
|
|
295
310
|
*/
|
|
296
311
|
export function encodeBatchCall(payloads_json: string): Uint8Array;
|
|
297
312
|
|
|
313
|
+
/**
|
|
314
|
+
* Like `encodeBatchCall` but targets an explicit DataEdge address (#366).
|
|
315
|
+
*/
|
|
316
|
+
export function encodeBatchCallTo(payloads_json: string, data_edge_address: string): Uint8Array;
|
|
317
|
+
|
|
298
318
|
/**
|
|
299
319
|
* Encode a fact payload as minimal protobuf wire format.
|
|
300
320
|
*
|
|
@@ -320,6 +340,15 @@ export function encodeFactProtobuf(json: string): Uint8Array;
|
|
|
320
340
|
*/
|
|
321
341
|
export function encodeSingleCall(protobuf_payload: Uint8Array): Uint8Array;
|
|
322
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Like `encodeSingleCall` but targets an explicit DataEdge address.
|
|
345
|
+
*
|
|
346
|
+
* Chain/environment-aware clients pass the authoritative address from the
|
|
347
|
+
* relay's `/v1/billing/status` `data_edge_address` (#366) — the isolated
|
|
348
|
+
* staging Gnosis DataEdge differs from prod's. Throws on a bad address.
|
|
349
|
+
*/
|
|
350
|
+
export function encodeSingleCallTo(protobuf_payload: Uint8Array, data_edge_address: string): Uint8Array;
|
|
351
|
+
|
|
323
352
|
/**
|
|
324
353
|
* Encode a tombstone protobuf for soft-deleting a fact.
|
|
325
354
|
*
|
|
@@ -655,6 +684,11 @@ export function parseDebriefResponse(response: string): any;
|
|
|
655
684
|
*/
|
|
656
685
|
export function parseDigestResponse(raw: string): string;
|
|
657
686
|
|
|
687
|
+
/**
|
|
688
|
+
* Parse a Gemini export (JSON or saved-info text) into a `ParseResult`.
|
|
689
|
+
*/
|
|
690
|
+
export function parseGemini(input: string): any;
|
|
691
|
+
|
|
658
692
|
/**
|
|
659
693
|
* Case-insensitive parse of a memory source string. Unknown input returns "user-inferred".
|
|
660
694
|
*/
|
|
@@ -707,6 +741,18 @@ export function parseTriageResponse(llm_output: string): any;
|
|
|
707
741
|
*/
|
|
708
742
|
export function parseWeightsFile(content: string): string;
|
|
709
743
|
|
|
744
|
+
/**
|
|
745
|
+
* Compute the [`PinTier`]'s multiplicative boost at a given timestamp.
|
|
746
|
+
*
|
|
747
|
+
* `tier_json`: internally-tagged JSON, e.g. `{"tier":"soft","pinned_at":1716000000}`,
|
|
748
|
+
* `{"tier":"hard"}`, `{"tier":"none"}`.
|
|
749
|
+
* `now_unix`: seconds since epoch.
|
|
750
|
+
* `config_json`: JSON of [`PinConfig`], e.g. `{"soft_half_life_days":90,"soft_max_boost":1.5,"hard_boost":1.5}`.
|
|
751
|
+
*
|
|
752
|
+
* Returns the multiplicative boost factor (1.0 for `none`).
|
|
753
|
+
*/
|
|
754
|
+
export function pinBoost(tier_json: string, now_unix: bigint, config_json: string): number;
|
|
755
|
+
|
|
710
756
|
/**
|
|
711
757
|
* Prepare a fact for on-chain storage.
|
|
712
758
|
*
|
package/totalreclaw_core.js
CHANGED
|
@@ -590,6 +590,37 @@ function chunksToSummaries(chunks_json) {
|
|
|
590
590
|
}
|
|
591
591
|
exports.chunksToSummaries = chunksToSummaries;
|
|
592
592
|
|
|
593
|
+
/**
|
|
594
|
+
* Classify natural-language pin/unpin intent from a user utterance.
|
|
595
|
+
*
|
|
596
|
+
* Returns JSON of [`PinIntent`] when a trigger phrase matches, or `null` when
|
|
597
|
+
* the utterance contains no recognised pin gesture. Lowercase normalization
|
|
598
|
+
* is applied internally — callers pass the raw user text.
|
|
599
|
+
* @param {string} text
|
|
600
|
+
* @returns {string}
|
|
601
|
+
*/
|
|
602
|
+
function classifyPinIntent(text) {
|
|
603
|
+
let deferred3_0;
|
|
604
|
+
let deferred3_1;
|
|
605
|
+
try {
|
|
606
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
607
|
+
const len0 = WASM_VECTOR_LEN;
|
|
608
|
+
const ret = wasm.classifyPinIntent(ptr0, len0);
|
|
609
|
+
var ptr2 = ret[0];
|
|
610
|
+
var len2 = ret[1];
|
|
611
|
+
if (ret[3]) {
|
|
612
|
+
ptr2 = 0; len2 = 0;
|
|
613
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
614
|
+
}
|
|
615
|
+
deferred3_0 = ptr2;
|
|
616
|
+
deferred3_1 = len2;
|
|
617
|
+
return getStringFromWasm0(ptr2, len2);
|
|
618
|
+
} finally {
|
|
619
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
exports.classifyPinIntent = classifyPinIntent;
|
|
623
|
+
|
|
593
624
|
/**
|
|
594
625
|
* WASM binding for `cluster_facts`.
|
|
595
626
|
*
|
|
@@ -791,6 +822,31 @@ function decryptAndRerank(facts_json, query, query_embedding, encryption_key_hex
|
|
|
791
822
|
}
|
|
792
823
|
exports.decryptAndRerank = decryptAndRerank;
|
|
793
824
|
|
|
825
|
+
/**
|
|
826
|
+
* Return the locked-default [`PinConfig`] as JSON. Clients that don't want
|
|
827
|
+
* to retune can pass this verbatim to [`wasm_pin_boost`].
|
|
828
|
+
* @returns {string}
|
|
829
|
+
*/
|
|
830
|
+
function defaultPinConfig() {
|
|
831
|
+
let deferred2_0;
|
|
832
|
+
let deferred2_1;
|
|
833
|
+
try {
|
|
834
|
+
const ret = wasm.defaultPinConfig();
|
|
835
|
+
var ptr1 = ret[0];
|
|
836
|
+
var len1 = ret[1];
|
|
837
|
+
if (ret[3]) {
|
|
838
|
+
ptr1 = 0; len1 = 0;
|
|
839
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
840
|
+
}
|
|
841
|
+
deferred2_0 = ptr1;
|
|
842
|
+
deferred2_1 = len1;
|
|
843
|
+
return getStringFromWasm0(ptr1, len1);
|
|
844
|
+
} finally {
|
|
845
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
exports.defaultPinConfig = defaultPinConfig;
|
|
849
|
+
|
|
794
850
|
/**
|
|
795
851
|
* Default P2-3 resolution weights as JSON.
|
|
796
852
|
* @returns {string}
|
|
@@ -1038,6 +1094,27 @@ function encodeBatchCall(payloads_json) {
|
|
|
1038
1094
|
}
|
|
1039
1095
|
exports.encodeBatchCall = encodeBatchCall;
|
|
1040
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* Like `encodeBatchCall` but targets an explicit DataEdge address (#366).
|
|
1099
|
+
* @param {string} payloads_json
|
|
1100
|
+
* @param {string} data_edge_address
|
|
1101
|
+
* @returns {Uint8Array}
|
|
1102
|
+
*/
|
|
1103
|
+
function encodeBatchCallTo(payloads_json, data_edge_address) {
|
|
1104
|
+
const ptr0 = passStringToWasm0(payloads_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1105
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1106
|
+
const ptr1 = passStringToWasm0(data_edge_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1107
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1108
|
+
const ret = wasm.encodeBatchCallTo(ptr0, len0, ptr1, len1);
|
|
1109
|
+
if (ret[3]) {
|
|
1110
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1111
|
+
}
|
|
1112
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1113
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1114
|
+
return v3;
|
|
1115
|
+
}
|
|
1116
|
+
exports.encodeBatchCallTo = encodeBatchCallTo;
|
|
1117
|
+
|
|
1041
1118
|
/**
|
|
1042
1119
|
* Encode a fact payload as minimal protobuf wire format.
|
|
1043
1120
|
*
|
|
@@ -1086,6 +1163,31 @@ function encodeSingleCall(protobuf_payload) {
|
|
|
1086
1163
|
}
|
|
1087
1164
|
exports.encodeSingleCall = encodeSingleCall;
|
|
1088
1165
|
|
|
1166
|
+
/**
|
|
1167
|
+
* Like `encodeSingleCall` but targets an explicit DataEdge address.
|
|
1168
|
+
*
|
|
1169
|
+
* Chain/environment-aware clients pass the authoritative address from the
|
|
1170
|
+
* relay's `/v1/billing/status` `data_edge_address` (#366) — the isolated
|
|
1171
|
+
* staging Gnosis DataEdge differs from prod's. Throws on a bad address.
|
|
1172
|
+
* @param {Uint8Array} protobuf_payload
|
|
1173
|
+
* @param {string} data_edge_address
|
|
1174
|
+
* @returns {Uint8Array}
|
|
1175
|
+
*/
|
|
1176
|
+
function encodeSingleCallTo(protobuf_payload, data_edge_address) {
|
|
1177
|
+
const ptr0 = passArray8ToWasm0(protobuf_payload, wasm.__wbindgen_malloc);
|
|
1178
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1179
|
+
const ptr1 = passStringToWasm0(data_edge_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1180
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1181
|
+
const ret = wasm.encodeSingleCallTo(ptr0, len0, ptr1, len1);
|
|
1182
|
+
if (ret[3]) {
|
|
1183
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1184
|
+
}
|
|
1185
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1186
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1187
|
+
return v3;
|
|
1188
|
+
}
|
|
1189
|
+
exports.encodeSingleCallTo = encodeSingleCallTo;
|
|
1190
|
+
|
|
1089
1191
|
/**
|
|
1090
1192
|
* Encode a tombstone protobuf for soft-deleting a fact.
|
|
1091
1193
|
*
|
|
@@ -2056,6 +2158,22 @@ function parseDigestResponse(raw) {
|
|
|
2056
2158
|
}
|
|
2057
2159
|
exports.parseDigestResponse = parseDigestResponse;
|
|
2058
2160
|
|
|
2161
|
+
/**
|
|
2162
|
+
* Parse a Gemini export (JSON or saved-info text) into a `ParseResult`.
|
|
2163
|
+
* @param {string} input
|
|
2164
|
+
* @returns {any}
|
|
2165
|
+
*/
|
|
2166
|
+
function parseGemini(input) {
|
|
2167
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2168
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2169
|
+
const ret = wasm.parseGemini(ptr0, len0);
|
|
2170
|
+
if (ret[2]) {
|
|
2171
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2172
|
+
}
|
|
2173
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2174
|
+
}
|
|
2175
|
+
exports.parseGemini = parseGemini;
|
|
2176
|
+
|
|
2059
2177
|
/**
|
|
2060
2178
|
* Case-insensitive parse of a memory source string. Unknown input returns "user-inferred".
|
|
2061
2179
|
* @param {string} s
|
|
@@ -2222,6 +2340,33 @@ function parseWeightsFile(content) {
|
|
|
2222
2340
|
}
|
|
2223
2341
|
exports.parseWeightsFile = parseWeightsFile;
|
|
2224
2342
|
|
|
2343
|
+
/**
|
|
2344
|
+
* Compute the [`PinTier`]'s multiplicative boost at a given timestamp.
|
|
2345
|
+
*
|
|
2346
|
+
* `tier_json`: internally-tagged JSON, e.g. `{"tier":"soft","pinned_at":1716000000}`,
|
|
2347
|
+
* `{"tier":"hard"}`, `{"tier":"none"}`.
|
|
2348
|
+
* `now_unix`: seconds since epoch.
|
|
2349
|
+
* `config_json`: JSON of [`PinConfig`], e.g. `{"soft_half_life_days":90,"soft_max_boost":1.5,"hard_boost":1.5}`.
|
|
2350
|
+
*
|
|
2351
|
+
* Returns the multiplicative boost factor (1.0 for `none`).
|
|
2352
|
+
* @param {string} tier_json
|
|
2353
|
+
* @param {bigint} now_unix
|
|
2354
|
+
* @param {string} config_json
|
|
2355
|
+
* @returns {number}
|
|
2356
|
+
*/
|
|
2357
|
+
function pinBoost(tier_json, now_unix, config_json) {
|
|
2358
|
+
const ptr0 = passStringToWasm0(tier_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2359
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2360
|
+
const ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2361
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2362
|
+
const ret = wasm.pinBoost(ptr0, len0, now_unix, ptr1, len1);
|
|
2363
|
+
if (ret[2]) {
|
|
2364
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2365
|
+
}
|
|
2366
|
+
return ret[0];
|
|
2367
|
+
}
|
|
2368
|
+
exports.pinBoost = pinBoost;
|
|
2369
|
+
|
|
2225
2370
|
/**
|
|
2226
2371
|
* Prepare a fact for on-chain storage.
|
|
2227
2372
|
*
|
package/totalreclaw_core_bg.wasm
CHANGED
|
Binary file
|