@moss-dev/moss-wasm 0.15.0 → 0.17.0
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/moss_wasm.d.ts +89 -19
- package/moss_wasm.js +202 -39
- package/moss_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/moss_wasm.d.ts
CHANGED
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/** What Web Crypto needs to decrypt the payload of a sealed model. */
|
|
5
|
+
export interface SealedModelDecryptParams {
|
|
6
|
+
iv: Uint8Array;
|
|
7
|
+
tag: Uint8Array;
|
|
8
|
+
additionalData: Uint8Array;
|
|
9
|
+
payloadOffset: number;
|
|
10
|
+
payloadLength: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Where the tokenizer and graph lie in a decrypted sealed model payload. */
|
|
14
|
+
export interface SealedModelSections {
|
|
15
|
+
tokenizerOffset: number;
|
|
16
|
+
tokenizerLength: number;
|
|
17
|
+
graphOffset: number;
|
|
18
|
+
graphLength: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
4
23
|
export class IndexManager {
|
|
5
24
|
free(): void;
|
|
6
25
|
[Symbol.dispose](): void;
|
|
26
|
+
/**
|
|
27
|
+
* Sends the pending usage counts now.
|
|
28
|
+
* They also go out every 3 seconds, on `pagehide` and when the manager is freed.
|
|
29
|
+
*/
|
|
30
|
+
flushUsageTelemetry(): Promise<any>;
|
|
7
31
|
getIndexInfo(index_name: string): Promise<any>;
|
|
8
32
|
hasIndex(index_name: string): Promise<any>;
|
|
9
33
|
loadIndex(index_name: string): Promise<any>;
|
|
10
34
|
constructor(project_id: string, project_key: string);
|
|
11
|
-
query(index_name: string, query_text: string, query_embedding: Float32Array, top_k: number | null | undefined, alpha: number | null | undefined, filter: any): Promise<any>;
|
|
12
|
-
queryMultiIndex(index_names: string[], query_text: string, query_embedding: Float32Array, top_k: number | null | undefined, alpha: number | null | undefined, filter: any): Promise<any>;
|
|
13
|
-
queryMultiIndexWithModelIdentity(index_names: string[], query_text: string, query_embedding: Float32Array, model_id: string, model_artifact_version: string, manifest_sha256: string, top_k: number | null | undefined, alpha: number | null | undefined, filter: any): Promise<any>;
|
|
14
|
-
queryWithModelIdentity(index_name: string, query_text: string, query_embedding: Float32Array, model_id: string, model_artifact_version: string, manifest_sha256: string, top_k: number | null | undefined, alpha: number | null | undefined, filter: any): Promise<any>;
|
|
35
|
+
query(index_name: string, query_text: string, query_embedding: Float32Array | null | undefined, top_k: number | null | undefined, alpha: number | null | undefined, filter: any, tuning: any): Promise<any>;
|
|
36
|
+
queryMultiIndex(index_names: string[], query_text: string, query_embedding: Float32Array | null | undefined, top_k: number | null | undefined, alpha: number | null | undefined, filter: any, tuning: any): Promise<any>;
|
|
37
|
+
queryMultiIndexWithModelIdentity(index_names: string[], query_text: string, query_embedding: Float32Array | null | undefined, model_id: string, model_artifact_version: string, manifest_sha256: string, top_k: number | null | undefined, alpha: number | null | undefined, filter: any, tuning: any): Promise<any>;
|
|
38
|
+
queryWithModelIdentity(index_name: string, query_text: string, query_embedding: Float32Array | null | undefined, model_id: string, model_artifact_version: string, manifest_sha256: string, top_k: number | null | undefined, alpha: number | null | undefined, filter: any, tuning: any): Promise<any>;
|
|
15
39
|
refreshIndex(index_name: string): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Always true. Its presence tells the browser SDK that `refreshIndex` skips an unchanged snapshot.
|
|
42
|
+
*/
|
|
43
|
+
refreshSkipsUnchanged(): boolean;
|
|
16
44
|
unloadIndex(index_name: string): Promise<any>;
|
|
17
45
|
unloadIndexes(index_names: string[]): Promise<any>;
|
|
18
46
|
static withAuthenticator(project_id: string, get_auth_header: Function, invalidate_cache?: Function | null, base_url?: string | null): IndexManager;
|
|
@@ -23,10 +51,10 @@ export class IndexManager {
|
|
|
23
51
|
export class ManageClient {
|
|
24
52
|
free(): void;
|
|
25
53
|
[Symbol.dispose](): void;
|
|
26
|
-
addDocs(name: string, docs: any, upsert?: boolean | null): Promise<any>;
|
|
27
|
-
createIndex(name: string, docs: any, model_id: string): Promise<any>;
|
|
28
|
-
createIndexFromFiles(name: string, files: any, model_id: string): Promise<any>;
|
|
29
|
-
deleteDocs(name: string, doc_ids: string[]): Promise<any>;
|
|
54
|
+
addDocs(name: string, docs: any, upsert?: boolean | null, on_progress?: Function | null): Promise<any>;
|
|
55
|
+
createIndex(name: string, docs: any, model_id: string, on_progress?: Function | null): Promise<any>;
|
|
56
|
+
createIndexFromFiles(name: string, files: any, model_id: string, on_progress?: Function | null): Promise<any>;
|
|
57
|
+
deleteDocs(name: string, doc_ids: string[], on_progress?: Function | null): Promise<any>;
|
|
30
58
|
deleteIndex(name: string): Promise<any>;
|
|
31
59
|
getDocs(name: string, doc_ids?: string[] | null): Promise<any>;
|
|
32
60
|
getIndex(name: string): Promise<any>;
|
|
@@ -41,6 +69,12 @@ export class ModelContentKeys {
|
|
|
41
69
|
private constructor();
|
|
42
70
|
free(): void;
|
|
43
71
|
[Symbol.dispose](): void;
|
|
72
|
+
/**
|
|
73
|
+
* Imports the content key into Web Crypto as an AES-GCM key that only decrypts.
|
|
74
|
+
* It cannot be exported, and the buffer `importKey` copies it from is then zeroed.
|
|
75
|
+
* The promise rejects when the global `crypto.subtle` is missing, as in an insecure context.
|
|
76
|
+
*/
|
|
77
|
+
importWebCryptoKey(): Promise<CryptoKey>;
|
|
44
78
|
readonly keyId: number;
|
|
45
79
|
}
|
|
46
80
|
|
|
@@ -75,12 +109,41 @@ export class Tokenizer {
|
|
|
75
109
|
tokenize(text: string): any;
|
|
76
110
|
}
|
|
77
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Opens a sealed model whose raw SHA-256 already matched the release entry.
|
|
114
|
+
*
|
|
115
|
+
* The envelope digest is read from the header instead of recomputed. The
|
|
116
|
+
* match pins every byte, and GCM still authenticates the digest through the
|
|
117
|
+
* AAD, so bytes that were never matched still fail closed, only later.
|
|
118
|
+
*/
|
|
119
|
+
export function openMatchedSealedModel(bytes: Uint8Array, keys: ModelContentKeys, sku: string): SealedModel;
|
|
120
|
+
|
|
78
121
|
export function openSealedModel(bytes: Uint8Array, keys: ModelContentKeys, sku: string): SealedModel;
|
|
79
122
|
|
|
80
123
|
export function poolAndNormalize(token_embeddings: Float32Array, attention_mask: Int32Array, hidden_dim: number): Float32Array;
|
|
81
124
|
|
|
82
125
|
export function sdk_version(): string;
|
|
83
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Returns the nonce, tag, AAD and payload range Web Crypto needs to open a sealed model.
|
|
129
|
+
* Only its header is copied out of `bytes`, whose raw SHA-256 already matched the release entry.
|
|
130
|
+
* The header gets the checks of `openMatchedSealedModel`, and its key id must be the granted one.
|
|
131
|
+
*/
|
|
132
|
+
export function sealedModelDecryptParams(bytes: Uint8Array, keys: ModelContentKeys, sku: string): SealedModelDecryptParams;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Returns where the tokenizer and graph lie in a sealed model payload Web Crypto decrypted.
|
|
136
|
+
* Only the inner header, the sku and the first bytes of the graph are copied out of `plaintext`.
|
|
137
|
+
* They get the checks `openSealedModel` runs after decrypting: the sku, an ORT graph, no gate op.
|
|
138
|
+
*/
|
|
139
|
+
export function sealedModelSections(plaintext: Uint8Array, sku: string): SealedModelSections;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Builds a tokenizer from the tokenizer section of a payload that Web Crypto decrypted,
|
|
143
|
+
* as `takeTokenizer` does, and wipes the copy of the bytes it parsed once the tokenizer is built.
|
|
144
|
+
*/
|
|
145
|
+
export function sealedModelTokenizer(tokenizer_json: Uint8Array): Tokenizer;
|
|
146
|
+
|
|
84
147
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
85
148
|
|
|
86
149
|
export interface InitOutput {
|
|
@@ -92,24 +155,26 @@ export interface InitOutput {
|
|
|
92
155
|
readonly __wbg_projectkeyauthenticator_free: (a: number, b: number) => void;
|
|
93
156
|
readonly __wbg_sealedmodel_free: (a: number, b: number) => void;
|
|
94
157
|
readonly __wbg_tokenizer_free: (a: number, b: number) => void;
|
|
158
|
+
readonly indexmanager_flushUsageTelemetry: (a: number) => any;
|
|
95
159
|
readonly indexmanager_getIndexInfo: (a: number, b: number, c: number) => any;
|
|
96
160
|
readonly indexmanager_hasIndex: (a: number, b: number, c: number) => any;
|
|
97
161
|
readonly indexmanager_loadIndex: (a: number, b: number, c: number) => any;
|
|
98
162
|
readonly indexmanager_new: (a: number, b: number, c: number, d: number) => number;
|
|
99
|
-
readonly indexmanager_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any) => any;
|
|
100
|
-
readonly indexmanager_queryMultiIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any) => any;
|
|
101
|
-
readonly indexmanager_queryMultiIndexWithModelIdentity: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: any) => any;
|
|
102
|
-
readonly indexmanager_queryWithModelIdentity: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: any) => any;
|
|
163
|
+
readonly indexmanager_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any, k: any) => any;
|
|
164
|
+
readonly indexmanager_queryMultiIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any, k: any) => any;
|
|
165
|
+
readonly indexmanager_queryMultiIndexWithModelIdentity: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: any, q: any) => any;
|
|
166
|
+
readonly indexmanager_queryWithModelIdentity: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: any, q: any) => any;
|
|
103
167
|
readonly indexmanager_refreshIndex: (a: number, b: number, c: number) => any;
|
|
168
|
+
readonly indexmanager_refreshSkipsUnchanged: (a: number) => number;
|
|
104
169
|
readonly indexmanager_unloadIndex: (a: number, b: number, c: number) => any;
|
|
105
170
|
readonly indexmanager_unloadIndexes: (a: number, b: number, c: number) => any;
|
|
106
171
|
readonly indexmanager_withAuthenticator: (a: number, b: number, c: any, d: number, e: number, f: number) => number;
|
|
107
172
|
readonly indexmanager_withBaseUrl: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
108
173
|
readonly indexmanager_withBaseUrls: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
109
|
-
readonly manageclient_addDocs: (a: number, b: number, c: number, d: any, e: number) => any;
|
|
110
|
-
readonly manageclient_createIndex: (a: number, b: number, c: number, d: any, e: number, f: number) => any;
|
|
111
|
-
readonly manageclient_createIndexFromFiles: (a: number, b: number, c: number, d: any, e: number, f: number) => any;
|
|
112
|
-
readonly manageclient_deleteDocs: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
174
|
+
readonly manageclient_addDocs: (a: number, b: number, c: number, d: any, e: number, f: number) => any;
|
|
175
|
+
readonly manageclient_createIndex: (a: number, b: number, c: number, d: any, e: number, f: number, g: number) => any;
|
|
176
|
+
readonly manageclient_createIndexFromFiles: (a: number, b: number, c: number, d: any, e: number, f: number, g: number) => any;
|
|
177
|
+
readonly manageclient_deleteDocs: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
113
178
|
readonly manageclient_deleteIndex: (a: number, b: number, c: number) => any;
|
|
114
179
|
readonly manageclient_getDocs: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
115
180
|
readonly manageclient_getIndex: (a: number, b: number, c: number) => any;
|
|
@@ -118,23 +183,28 @@ export interface InitOutput {
|
|
|
118
183
|
readonly manageclient_new: (a: number, b: number, c: number, d: number) => number;
|
|
119
184
|
readonly manageclient_withAuthenticator: (a: number, b: number, c: any, d: number, e: number, f: number) => number;
|
|
120
185
|
readonly manageclient_withBaseUrl: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
186
|
+
readonly modelcontentkeys_importWebCryptoKey: (a: number) => any;
|
|
121
187
|
readonly modelcontentkeys_keyId: (a: number) => number;
|
|
122
188
|
readonly modelkeyexchange_capabilityQuery: (a: number, b: number, c: number) => [number, number];
|
|
123
189
|
readonly modelkeyexchange_new: () => [number, number, number];
|
|
124
190
|
readonly modelkeyexchange_unwrap: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
191
|
+
readonly openMatchedSealedModel: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
125
192
|
readonly openSealedModel: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
126
193
|
readonly poolAndNormalize: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
127
194
|
readonly projectkeyauthenticator_getAuthHeader: (a: number) => any;
|
|
128
195
|
readonly projectkeyauthenticator_invalidate: (a: number) => any;
|
|
129
196
|
readonly projectkeyauthenticator_new: (a: number, b: number, c: number, d: number) => number;
|
|
130
197
|
readonly sdk_version: () => [number, number];
|
|
198
|
+
readonly sealedModelDecryptParams: (a: any, b: number, c: number, d: number) => [number, number, number];
|
|
199
|
+
readonly sealedModelSections: (a: any, b: number, c: number) => [number, number, number];
|
|
200
|
+
readonly sealedModelTokenizer: (a: any) => [number, number, number];
|
|
131
201
|
readonly sealedmodel_takeGraph: (a: number) => [number, number, number];
|
|
132
202
|
readonly sealedmodel_takeTokenizer: (a: number) => [number, number, number];
|
|
133
203
|
readonly tokenizer_new: (a: number, b: number) => [number, number, number];
|
|
134
204
|
readonly tokenizer_tokenize: (a: number, b: number, c: number) => [number, number, number];
|
|
135
|
-
readonly
|
|
136
|
-
readonly
|
|
137
|
-
readonly
|
|
205
|
+
readonly wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___wasm_bindgen_79e945b5d148b8ef___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_79e945b5d148b8ef___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
206
|
+
readonly wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
207
|
+
readonly wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
138
208
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
139
209
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
140
210
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/moss_wasm.js
CHANGED
|
@@ -17,6 +17,15 @@ export class IndexManager {
|
|
|
17
17
|
const ptr = this.__destroy_into_raw();
|
|
18
18
|
wasm.__wbg_indexmanager_free(ptr, 0);
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Sends the pending usage counts now.
|
|
22
|
+
* They also go out every 3 seconds, on `pagehide` and when the manager is freed.
|
|
23
|
+
* @returns {Promise<any>}
|
|
24
|
+
*/
|
|
25
|
+
flushUsageTelemetry() {
|
|
26
|
+
const ret = wasm.indexmanager_flushUsageTelemetry(this.__wbg_ptr);
|
|
27
|
+
return ret;
|
|
28
|
+
}
|
|
20
29
|
/**
|
|
21
30
|
* @param {string} index_name
|
|
22
31
|
* @returns {Promise<any>}
|
|
@@ -64,95 +73,99 @@ export class IndexManager {
|
|
|
64
73
|
/**
|
|
65
74
|
* @param {string} index_name
|
|
66
75
|
* @param {string} query_text
|
|
67
|
-
* @param {Float32Array} query_embedding
|
|
76
|
+
* @param {Float32Array | null | undefined} query_embedding
|
|
68
77
|
* @param {number | null | undefined} top_k
|
|
69
78
|
* @param {number | null | undefined} alpha
|
|
70
79
|
* @param {any} filter
|
|
80
|
+
* @param {any} tuning
|
|
71
81
|
* @returns {Promise<any>}
|
|
72
82
|
*/
|
|
73
|
-
query(index_name, query_text, query_embedding, top_k, alpha, filter) {
|
|
83
|
+
query(index_name, query_text, query_embedding, top_k, alpha, filter, tuning) {
|
|
74
84
|
const ptr0 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
75
85
|
const len0 = WASM_VECTOR_LEN;
|
|
76
86
|
const ptr1 = passStringToWasm0(query_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
77
87
|
const len1 = WASM_VECTOR_LEN;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const ret = wasm.indexmanager_query(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter);
|
|
88
|
+
var ptr2 = isLikeNone(query_embedding) ? 0 : passArrayF32ToWasm0(query_embedding, wasm.__wbindgen_malloc);
|
|
89
|
+
var len2 = WASM_VECTOR_LEN;
|
|
90
|
+
const ret = wasm.indexmanager_query(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter, tuning);
|
|
81
91
|
return ret;
|
|
82
92
|
}
|
|
83
93
|
/**
|
|
84
94
|
* @param {string[]} index_names
|
|
85
95
|
* @param {string} query_text
|
|
86
|
-
* @param {Float32Array} query_embedding
|
|
96
|
+
* @param {Float32Array | null | undefined} query_embedding
|
|
87
97
|
* @param {number | null | undefined} top_k
|
|
88
98
|
* @param {number | null | undefined} alpha
|
|
89
99
|
* @param {any} filter
|
|
100
|
+
* @param {any} tuning
|
|
90
101
|
* @returns {Promise<any>}
|
|
91
102
|
*/
|
|
92
|
-
queryMultiIndex(index_names, query_text, query_embedding, top_k, alpha, filter) {
|
|
103
|
+
queryMultiIndex(index_names, query_text, query_embedding, top_k, alpha, filter, tuning) {
|
|
93
104
|
const ptr0 = passArrayJsValueToWasm0(index_names, wasm.__wbindgen_malloc);
|
|
94
105
|
const len0 = WASM_VECTOR_LEN;
|
|
95
106
|
const ptr1 = passStringToWasm0(query_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
96
107
|
const len1 = WASM_VECTOR_LEN;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const ret = wasm.indexmanager_queryMultiIndex(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter);
|
|
108
|
+
var ptr2 = isLikeNone(query_embedding) ? 0 : passArrayF32ToWasm0(query_embedding, wasm.__wbindgen_malloc);
|
|
109
|
+
var len2 = WASM_VECTOR_LEN;
|
|
110
|
+
const ret = wasm.indexmanager_queryMultiIndex(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter, tuning);
|
|
100
111
|
return ret;
|
|
101
112
|
}
|
|
102
113
|
/**
|
|
103
114
|
* @param {string[]} index_names
|
|
104
115
|
* @param {string} query_text
|
|
105
|
-
* @param {Float32Array} query_embedding
|
|
116
|
+
* @param {Float32Array | null | undefined} query_embedding
|
|
106
117
|
* @param {string} model_id
|
|
107
118
|
* @param {string} model_artifact_version
|
|
108
119
|
* @param {string} manifest_sha256
|
|
109
120
|
* @param {number | null | undefined} top_k
|
|
110
121
|
* @param {number | null | undefined} alpha
|
|
111
122
|
* @param {any} filter
|
|
123
|
+
* @param {any} tuning
|
|
112
124
|
* @returns {Promise<any>}
|
|
113
125
|
*/
|
|
114
|
-
queryMultiIndexWithModelIdentity(index_names, query_text, query_embedding, model_id, model_artifact_version, manifest_sha256, top_k, alpha, filter) {
|
|
126
|
+
queryMultiIndexWithModelIdentity(index_names, query_text, query_embedding, model_id, model_artifact_version, manifest_sha256, top_k, alpha, filter, tuning) {
|
|
115
127
|
const ptr0 = passArrayJsValueToWasm0(index_names, wasm.__wbindgen_malloc);
|
|
116
128
|
const len0 = WASM_VECTOR_LEN;
|
|
117
129
|
const ptr1 = passStringToWasm0(query_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
118
130
|
const len1 = WASM_VECTOR_LEN;
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
var ptr2 = isLikeNone(query_embedding) ? 0 : passArrayF32ToWasm0(query_embedding, wasm.__wbindgen_malloc);
|
|
132
|
+
var len2 = WASM_VECTOR_LEN;
|
|
121
133
|
const ptr3 = passStringToWasm0(model_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
122
134
|
const len3 = WASM_VECTOR_LEN;
|
|
123
135
|
const ptr4 = passStringToWasm0(model_artifact_version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
124
136
|
const len4 = WASM_VECTOR_LEN;
|
|
125
137
|
const ptr5 = passStringToWasm0(manifest_sha256, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
126
138
|
const len5 = WASM_VECTOR_LEN;
|
|
127
|
-
const ret = wasm.indexmanager_queryMultiIndexWithModelIdentity(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter);
|
|
139
|
+
const ret = wasm.indexmanager_queryMultiIndexWithModelIdentity(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter, tuning);
|
|
128
140
|
return ret;
|
|
129
141
|
}
|
|
130
142
|
/**
|
|
131
143
|
* @param {string} index_name
|
|
132
144
|
* @param {string} query_text
|
|
133
|
-
* @param {Float32Array} query_embedding
|
|
145
|
+
* @param {Float32Array | null | undefined} query_embedding
|
|
134
146
|
* @param {string} model_id
|
|
135
147
|
* @param {string} model_artifact_version
|
|
136
148
|
* @param {string} manifest_sha256
|
|
137
149
|
* @param {number | null | undefined} top_k
|
|
138
150
|
* @param {number | null | undefined} alpha
|
|
139
151
|
* @param {any} filter
|
|
152
|
+
* @param {any} tuning
|
|
140
153
|
* @returns {Promise<any>}
|
|
141
154
|
*/
|
|
142
|
-
queryWithModelIdentity(index_name, query_text, query_embedding, model_id, model_artifact_version, manifest_sha256, top_k, alpha, filter) {
|
|
155
|
+
queryWithModelIdentity(index_name, query_text, query_embedding, model_id, model_artifact_version, manifest_sha256, top_k, alpha, filter, tuning) {
|
|
143
156
|
const ptr0 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
144
157
|
const len0 = WASM_VECTOR_LEN;
|
|
145
158
|
const ptr1 = passStringToWasm0(query_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
146
159
|
const len1 = WASM_VECTOR_LEN;
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
var ptr2 = isLikeNone(query_embedding) ? 0 : passArrayF32ToWasm0(query_embedding, wasm.__wbindgen_malloc);
|
|
161
|
+
var len2 = WASM_VECTOR_LEN;
|
|
149
162
|
const ptr3 = passStringToWasm0(model_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
150
163
|
const len3 = WASM_VECTOR_LEN;
|
|
151
164
|
const ptr4 = passStringToWasm0(model_artifact_version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
152
165
|
const len4 = WASM_VECTOR_LEN;
|
|
153
166
|
const ptr5 = passStringToWasm0(manifest_sha256, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
154
167
|
const len5 = WASM_VECTOR_LEN;
|
|
155
|
-
const ret = wasm.indexmanager_queryWithModelIdentity(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter);
|
|
168
|
+
const ret = wasm.indexmanager_queryWithModelIdentity(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, isLikeNone(top_k) ? Number.MAX_SAFE_INTEGER : (top_k) >>> 0, isLikeNone(alpha) ? Number.MAX_SAFE_INTEGER : Math.fround(alpha), filter, tuning);
|
|
156
169
|
return ret;
|
|
157
170
|
}
|
|
158
171
|
/**
|
|
@@ -165,6 +178,14 @@ export class IndexManager {
|
|
|
165
178
|
const ret = wasm.indexmanager_refreshIndex(this.__wbg_ptr, ptr0, len0);
|
|
166
179
|
return ret;
|
|
167
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Always true. Its presence tells the browser SDK that `refreshIndex` skips an unchanged snapshot.
|
|
183
|
+
* @returns {boolean}
|
|
184
|
+
*/
|
|
185
|
+
refreshSkipsUnchanged() {
|
|
186
|
+
const ret = wasm.indexmanager_refreshSkipsUnchanged(this.__wbg_ptr);
|
|
187
|
+
return ret !== 0;
|
|
188
|
+
}
|
|
168
189
|
/**
|
|
169
190
|
* @param {string} index_name
|
|
170
191
|
* @returns {Promise<any>}
|
|
@@ -259,53 +280,57 @@ export class ManageClient {
|
|
|
259
280
|
* @param {string} name
|
|
260
281
|
* @param {any} docs
|
|
261
282
|
* @param {boolean | null} [upsert]
|
|
283
|
+
* @param {Function | null} [on_progress]
|
|
262
284
|
* @returns {Promise<any>}
|
|
263
285
|
*/
|
|
264
|
-
addDocs(name, docs, upsert) {
|
|
286
|
+
addDocs(name, docs, upsert, on_progress) {
|
|
265
287
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
266
288
|
const len0 = WASM_VECTOR_LEN;
|
|
267
|
-
const ret = wasm.manageclient_addDocs(this.__wbg_ptr, ptr0, len0, docs, isLikeNone(upsert) ? 0xFFFFFF : upsert ? 1 : 0);
|
|
289
|
+
const ret = wasm.manageclient_addDocs(this.__wbg_ptr, ptr0, len0, docs, isLikeNone(upsert) ? 0xFFFFFF : upsert ? 1 : 0, isLikeNone(on_progress) ? 0 : addToExternrefTable0(on_progress));
|
|
268
290
|
return ret;
|
|
269
291
|
}
|
|
270
292
|
/**
|
|
271
293
|
* @param {string} name
|
|
272
294
|
* @param {any} docs
|
|
273
295
|
* @param {string} model_id
|
|
296
|
+
* @param {Function | null} [on_progress]
|
|
274
297
|
* @returns {Promise<any>}
|
|
275
298
|
*/
|
|
276
|
-
createIndex(name, docs, model_id) {
|
|
299
|
+
createIndex(name, docs, model_id, on_progress) {
|
|
277
300
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
278
301
|
const len0 = WASM_VECTOR_LEN;
|
|
279
302
|
const ptr1 = passStringToWasm0(model_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
280
303
|
const len1 = WASM_VECTOR_LEN;
|
|
281
|
-
const ret = wasm.manageclient_createIndex(this.__wbg_ptr, ptr0, len0, docs, ptr1, len1);
|
|
304
|
+
const ret = wasm.manageclient_createIndex(this.__wbg_ptr, ptr0, len0, docs, ptr1, len1, isLikeNone(on_progress) ? 0 : addToExternrefTable0(on_progress));
|
|
282
305
|
return ret;
|
|
283
306
|
}
|
|
284
307
|
/**
|
|
285
308
|
* @param {string} name
|
|
286
309
|
* @param {any} files
|
|
287
310
|
* @param {string} model_id
|
|
311
|
+
* @param {Function | null} [on_progress]
|
|
288
312
|
* @returns {Promise<any>}
|
|
289
313
|
*/
|
|
290
|
-
createIndexFromFiles(name, files, model_id) {
|
|
314
|
+
createIndexFromFiles(name, files, model_id, on_progress) {
|
|
291
315
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
292
316
|
const len0 = WASM_VECTOR_LEN;
|
|
293
317
|
const ptr1 = passStringToWasm0(model_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
294
318
|
const len1 = WASM_VECTOR_LEN;
|
|
295
|
-
const ret = wasm.manageclient_createIndexFromFiles(this.__wbg_ptr, ptr0, len0, files, ptr1, len1);
|
|
319
|
+
const ret = wasm.manageclient_createIndexFromFiles(this.__wbg_ptr, ptr0, len0, files, ptr1, len1, isLikeNone(on_progress) ? 0 : addToExternrefTable0(on_progress));
|
|
296
320
|
return ret;
|
|
297
321
|
}
|
|
298
322
|
/**
|
|
299
323
|
* @param {string} name
|
|
300
324
|
* @param {string[]} doc_ids
|
|
325
|
+
* @param {Function | null} [on_progress]
|
|
301
326
|
* @returns {Promise<any>}
|
|
302
327
|
*/
|
|
303
|
-
deleteDocs(name, doc_ids) {
|
|
328
|
+
deleteDocs(name, doc_ids, on_progress) {
|
|
304
329
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
305
330
|
const len0 = WASM_VECTOR_LEN;
|
|
306
331
|
const ptr1 = passArrayJsValueToWasm0(doc_ids, wasm.__wbindgen_malloc);
|
|
307
332
|
const len1 = WASM_VECTOR_LEN;
|
|
308
|
-
const ret = wasm.manageclient_deleteDocs(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
333
|
+
const ret = wasm.manageclient_deleteDocs(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(on_progress) ? 0 : addToExternrefTable0(on_progress));
|
|
309
334
|
return ret;
|
|
310
335
|
}
|
|
311
336
|
/**
|
|
@@ -423,6 +448,16 @@ export class ModelContentKeys {
|
|
|
423
448
|
const ptr = this.__destroy_into_raw();
|
|
424
449
|
wasm.__wbg_modelcontentkeys_free(ptr, 0);
|
|
425
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* Imports the content key into Web Crypto as an AES-GCM key that only decrypts.
|
|
453
|
+
* It cannot be exported, and the buffer `importKey` copies it from is then zeroed.
|
|
454
|
+
* The promise rejects when the global `crypto.subtle` is missing, as in an insecure context.
|
|
455
|
+
* @returns {Promise<CryptoKey>}
|
|
456
|
+
*/
|
|
457
|
+
importWebCryptoKey() {
|
|
458
|
+
const ret = wasm.modelcontentkeys_importWebCryptoKey(this.__wbg_ptr);
|
|
459
|
+
return ret;
|
|
460
|
+
}
|
|
426
461
|
/**
|
|
427
462
|
* @returns {number}
|
|
428
463
|
*/
|
|
@@ -623,6 +658,30 @@ export class Tokenizer {
|
|
|
623
658
|
}
|
|
624
659
|
if (Symbol.dispose) Tokenizer.prototype[Symbol.dispose] = Tokenizer.prototype.free;
|
|
625
660
|
|
|
661
|
+
/**
|
|
662
|
+
* Opens a sealed model whose raw SHA-256 already matched the release entry.
|
|
663
|
+
*
|
|
664
|
+
* The envelope digest is read from the header instead of recomputed. The
|
|
665
|
+
* match pins every byte, and GCM still authenticates the digest through the
|
|
666
|
+
* AAD, so bytes that were never matched still fail closed, only later.
|
|
667
|
+
* @param {Uint8Array} bytes
|
|
668
|
+
* @param {ModelContentKeys} keys
|
|
669
|
+
* @param {string} sku
|
|
670
|
+
* @returns {SealedModel}
|
|
671
|
+
*/
|
|
672
|
+
export function openMatchedSealedModel(bytes, keys, sku) {
|
|
673
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
674
|
+
const len0 = WASM_VECTOR_LEN;
|
|
675
|
+
_assertClass(keys, ModelContentKeys);
|
|
676
|
+
const ptr1 = passStringToWasm0(sku, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
677
|
+
const len1 = WASM_VECTOR_LEN;
|
|
678
|
+
const ret = wasm.openMatchedSealedModel(ptr0, len0, keys.__wbg_ptr, ptr1, len1);
|
|
679
|
+
if (ret[2]) {
|
|
680
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
681
|
+
}
|
|
682
|
+
return SealedModel.__wrap(ret[0]);
|
|
683
|
+
}
|
|
684
|
+
|
|
626
685
|
/**
|
|
627
686
|
* @param {Uint8Array} bytes
|
|
628
687
|
* @param {ModelContentKeys} keys
|
|
@@ -677,6 +736,58 @@ export function sdk_version() {
|
|
|
677
736
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
678
737
|
}
|
|
679
738
|
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Returns the nonce, tag, AAD and payload range Web Crypto needs to open a sealed model.
|
|
742
|
+
* Only its header is copied out of `bytes`, whose raw SHA-256 already matched the release entry.
|
|
743
|
+
* The header gets the checks of `openMatchedSealedModel`, and its key id must be the granted one.
|
|
744
|
+
* @param {Uint8Array} bytes
|
|
745
|
+
* @param {ModelContentKeys} keys
|
|
746
|
+
* @param {string} sku
|
|
747
|
+
* @returns {SealedModelDecryptParams}
|
|
748
|
+
*/
|
|
749
|
+
export function sealedModelDecryptParams(bytes, keys, sku) {
|
|
750
|
+
_assertClass(keys, ModelContentKeys);
|
|
751
|
+
const ptr0 = passStringToWasm0(sku, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
752
|
+
const len0 = WASM_VECTOR_LEN;
|
|
753
|
+
const ret = wasm.sealedModelDecryptParams(bytes, keys.__wbg_ptr, ptr0, len0);
|
|
754
|
+
if (ret[2]) {
|
|
755
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
756
|
+
}
|
|
757
|
+
return takeFromExternrefTable0(ret[0]);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Returns where the tokenizer and graph lie in a sealed model payload Web Crypto decrypted.
|
|
762
|
+
* Only the inner header, the sku and the first bytes of the graph are copied out of `plaintext`.
|
|
763
|
+
* They get the checks `openSealedModel` runs after decrypting: the sku, an ORT graph, no gate op.
|
|
764
|
+
* @param {Uint8Array} plaintext
|
|
765
|
+
* @param {string} sku
|
|
766
|
+
* @returns {SealedModelSections}
|
|
767
|
+
*/
|
|
768
|
+
export function sealedModelSections(plaintext, sku) {
|
|
769
|
+
const ptr0 = passStringToWasm0(sku, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
770
|
+
const len0 = WASM_VECTOR_LEN;
|
|
771
|
+
const ret = wasm.sealedModelSections(plaintext, ptr0, len0);
|
|
772
|
+
if (ret[2]) {
|
|
773
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
774
|
+
}
|
|
775
|
+
return takeFromExternrefTable0(ret[0]);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Builds a tokenizer from the tokenizer section of a payload that Web Crypto decrypted,
|
|
780
|
+
* as `takeTokenizer` does, and wipes the copy of the bytes it parsed once the tokenizer is built.
|
|
781
|
+
* @param {Uint8Array} tokenizer_json
|
|
782
|
+
* @returns {Tokenizer}
|
|
783
|
+
*/
|
|
784
|
+
export function sealedModelTokenizer(tokenizer_json) {
|
|
785
|
+
const ret = wasm.sealedModelTokenizer(tokenizer_json);
|
|
786
|
+
if (ret[2]) {
|
|
787
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
788
|
+
}
|
|
789
|
+
return Tokenizer.__wrap(ret[0]);
|
|
790
|
+
}
|
|
680
791
|
function __wbg_get_imports() {
|
|
681
792
|
const import0 = {
|
|
682
793
|
__proto__: null,
|
|
@@ -776,6 +887,9 @@ function __wbg_get_imports() {
|
|
|
776
887
|
__wbg_abort_eee9248a6d680839: function(arg0, arg1) {
|
|
777
888
|
arg0.abort(arg1);
|
|
778
889
|
},
|
|
890
|
+
__wbg_addEventListener_d85450ee1320c989: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
891
|
+
arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
892
|
+
}, arguments); },
|
|
779
893
|
__wbg_append_01c74e5c6b58aa64: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
780
894
|
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
781
895
|
}, arguments); },
|
|
@@ -815,6 +929,21 @@ function __wbg_get_imports() {
|
|
|
815
929
|
const ret = arg0.fetch(arg1);
|
|
816
930
|
return ret;
|
|
817
931
|
},
|
|
932
|
+
__wbg_fetch_e166fd0eb785670a: function() { return handleError(function (arg0, arg1, arg2) {
|
|
933
|
+
const ret = fetch(getStringFromWasm0(arg0, arg1), arg2);
|
|
934
|
+
return ret;
|
|
935
|
+
}, arguments); },
|
|
936
|
+
__wbg_fill_5663f5c647107cce: function(arg0, arg1, arg2, arg3) {
|
|
937
|
+
const ret = arg0.fill(arg1, arg2 >>> 0, arg3 >>> 0);
|
|
938
|
+
return ret;
|
|
939
|
+
},
|
|
940
|
+
__wbg_getItem_b96269ddc16cf24a: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
941
|
+
const ret = arg1.getItem(getStringFromWasm0(arg2, arg3));
|
|
942
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
943
|
+
var len1 = WASM_VECTOR_LEN;
|
|
944
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
945
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
946
|
+
}, arguments); },
|
|
818
947
|
__wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
|
|
819
948
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
820
949
|
}, arguments); },
|
|
@@ -853,6 +982,10 @@ function __wbg_get_imports() {
|
|
|
853
982
|
const ret = arg0.headers;
|
|
854
983
|
return ret;
|
|
855
984
|
},
|
|
985
|
+
__wbg_importKey_10a137b5a53c66ba: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
986
|
+
const ret = arg0.importKey(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5), arg6 !== 0, arg7);
|
|
987
|
+
return ret;
|
|
988
|
+
}, arguments); },
|
|
856
989
|
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
857
990
|
let result;
|
|
858
991
|
try {
|
|
@@ -964,7 +1097,7 @@ function __wbg_get_imports() {
|
|
|
964
1097
|
const a = state0.a;
|
|
965
1098
|
state0.a = 0;
|
|
966
1099
|
try {
|
|
967
|
-
return
|
|
1100
|
+
return wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
968
1101
|
} finally {
|
|
969
1102
|
state0.a = a;
|
|
970
1103
|
}
|
|
@@ -975,6 +1108,10 @@ function __wbg_get_imports() {
|
|
|
975
1108
|
state0.a = 0;
|
|
976
1109
|
}
|
|
977
1110
|
},
|
|
1111
|
+
__wbg_new_b667d279fd5aa943: function(arg0, arg1) {
|
|
1112
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1113
|
+
return ret;
|
|
1114
|
+
},
|
|
978
1115
|
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
979
1116
|
const ret = new Uint8Array(arg0);
|
|
980
1117
|
return ret;
|
|
@@ -994,7 +1131,7 @@ function __wbg_get_imports() {
|
|
|
994
1131
|
const a = state0.a;
|
|
995
1132
|
state0.a = 0;
|
|
996
1133
|
try {
|
|
997
|
-
return
|
|
1134
|
+
return wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
998
1135
|
} finally {
|
|
999
1136
|
state0.a = a;
|
|
1000
1137
|
}
|
|
@@ -1021,6 +1158,10 @@ function __wbg_get_imports() {
|
|
|
1021
1158
|
const ret = Date.now();
|
|
1022
1159
|
return ret;
|
|
1023
1160
|
},
|
|
1161
|
+
__wbg_of_85f52f8b6491a7ca: function(arg0) {
|
|
1162
|
+
const ret = Array.of(arg0);
|
|
1163
|
+
return ret;
|
|
1164
|
+
},
|
|
1024
1165
|
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
1025
1166
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1026
1167
|
},
|
|
@@ -1031,10 +1172,24 @@ function __wbg_get_imports() {
|
|
|
1031
1172
|
__wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
|
|
1032
1173
|
queueMicrotask(arg0);
|
|
1033
1174
|
},
|
|
1175
|
+
__wbg_reject_90df95b492dd8563: function(arg0) {
|
|
1176
|
+
const ret = Promise.reject(arg0);
|
|
1177
|
+
return ret;
|
|
1178
|
+
},
|
|
1179
|
+
__wbg_removeEventListener_a3f23c70077bdcc1: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1180
|
+
arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
1181
|
+
}, arguments); },
|
|
1034
1182
|
__wbg_resolve_2191a4dfe481c25b: function(arg0) {
|
|
1035
1183
|
const ret = Promise.resolve(arg0);
|
|
1036
1184
|
return ret;
|
|
1037
1185
|
},
|
|
1186
|
+
__wbg_setItem_364a11cf21db9039: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1187
|
+
arg0.setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1188
|
+
}, arguments); },
|
|
1189
|
+
__wbg_setTimeout_123855a087c71568: function(arg0, arg1) {
|
|
1190
|
+
const ret = setTimeout(arg0, arg1);
|
|
1191
|
+
return ret;
|
|
1192
|
+
},
|
|
1038
1193
|
__wbg_setTimeout_f757f00851f76c42: function(arg0, arg1) {
|
|
1039
1194
|
const ret = setTimeout(arg0, arg1);
|
|
1040
1195
|
return ret;
|
|
@@ -1046,6 +1201,10 @@ function __wbg_get_imports() {
|
|
|
1046
1201
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
1047
1202
|
arg0[arg1] = arg2;
|
|
1048
1203
|
},
|
|
1204
|
+
__wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1205
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1206
|
+
return ret;
|
|
1207
|
+
}, arguments); },
|
|
1049
1208
|
__wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
|
|
1050
1209
|
arg0[arg1 >>> 0] = arg2;
|
|
1051
1210
|
},
|
|
@@ -1098,6 +1257,10 @@ function __wbg_get_imports() {
|
|
|
1098
1257
|
const ret = JSON.stringify(arg0);
|
|
1099
1258
|
return ret;
|
|
1100
1259
|
}, arguments); },
|
|
1260
|
+
__wbg_subarray_3ed232c8a6baee09: function(arg0, arg1, arg2) {
|
|
1261
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1262
|
+
return ret;
|
|
1263
|
+
},
|
|
1101
1264
|
__wbg_text_d3a29f7525a132c3: function() { return handleError(function (arg0) {
|
|
1102
1265
|
const ret = arg0.text();
|
|
1103
1266
|
return ret;
|
|
@@ -1123,12 +1286,12 @@ function __wbg_get_imports() {
|
|
|
1123
1286
|
},
|
|
1124
1287
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1125
1288
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 155, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1126
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1289
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___wasm_bindgen_79e945b5d148b8ef___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_79e945b5d148b8ef___JsError___true_);
|
|
1127
1290
|
return ret;
|
|
1128
1291
|
},
|
|
1129
1292
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1130
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1131
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1293
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 47, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1294
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke_______true_);
|
|
1132
1295
|
return ret;
|
|
1133
1296
|
},
|
|
1134
1297
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -1167,19 +1330,19 @@ function __wbg_get_imports() {
|
|
|
1167
1330
|
};
|
|
1168
1331
|
}
|
|
1169
1332
|
|
|
1170
|
-
function
|
|
1171
|
-
wasm.
|
|
1333
|
+
function wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke_______true_(arg0, arg1) {
|
|
1334
|
+
wasm.wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke_______true_(arg0, arg1);
|
|
1172
1335
|
}
|
|
1173
1336
|
|
|
1174
|
-
function
|
|
1175
|
-
const ret = wasm.
|
|
1337
|
+
function wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___wasm_bindgen_79e945b5d148b8ef___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_79e945b5d148b8ef___JsError___true_(arg0, arg1, arg2) {
|
|
1338
|
+
const ret = wasm.wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___wasm_bindgen_79e945b5d148b8ef___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_79e945b5d148b8ef___JsError___true_(arg0, arg1, arg2);
|
|
1176
1339
|
if (ret[1]) {
|
|
1177
1340
|
throw takeFromExternrefTable0(ret[0]);
|
|
1178
1341
|
}
|
|
1179
1342
|
}
|
|
1180
1343
|
|
|
1181
|
-
function
|
|
1182
|
-
wasm.
|
|
1344
|
+
function wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
1345
|
+
wasm.wasm_bindgen_79e945b5d148b8ef___convert__closures_____invoke___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined___js_sys_47ef7e31b3f1968c___Function_fn_wasm_bindgen_79e945b5d148b8ef___JsValue_____wasm_bindgen_79e945b5d148b8ef___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
1183
1346
|
}
|
|
1184
1347
|
|
|
1185
1348
|
|
package/moss_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED