@vulcan-energy/mcp-helper 0.1.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/README.md +154 -0
- package/dist/bin/vulcan-mcp-helper.d.ts +9 -0
- package/dist/bin/vulcan-mcp-helper.d.ts.map +1 -0
- package/dist/bin/vulcan-mcp-helper.js +58 -0
- package/dist/bin/vulcan-mcp-helper.js.map +1 -0
- package/dist/src/engine/filesystem.d.ts +30 -0
- package/dist/src/engine/filesystem.d.ts.map +1 -0
- package/dist/src/engine/filesystem.js +61 -0
- package/dist/src/engine/filesystem.js.map +1 -0
- package/dist/src/engine/wasm.d.ts +23 -0
- package/dist/src/engine/wasm.d.ts.map +1 -0
- package/dist/src/engine/wasm.js +333 -0
- package/dist/src/engine/wasm.js.map +1 -0
- package/dist/src/engine/workspace.d.ts +23 -0
- package/dist/src/engine/workspace.d.ts.map +1 -0
- package/dist/src/engine/workspace.js +82 -0
- package/dist/src/engine/workspace.js.map +1 -0
- package/dist/src/server.d.ts +8 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +166 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/tools/calculateMetrics.d.ts +31 -0
- package/dist/src/tools/calculateMetrics.d.ts.map +1 -0
- package/dist/src/tools/calculateMetrics.js +347 -0
- package/dist/src/tools/calculateMetrics.js.map +1 -0
- package/dist/src/tools/createBatchConfig.d.ts +25 -0
- package/dist/src/tools/createBatchConfig.d.ts.map +1 -0
- package/dist/src/tools/createBatchConfig.js +128 -0
- package/dist/src/tools/createBatchConfig.js.map +1 -0
- package/dist/src/tools/getBatchStatus.d.ts +23 -0
- package/dist/src/tools/getBatchStatus.d.ts.map +1 -0
- package/dist/src/tools/getBatchStatus.js +194 -0
- package/dist/src/tools/getBatchStatus.js.map +1 -0
- package/dist/src/tools/index.d.ts +67 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +361 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/listBatchModels.d.ts +25 -0
- package/dist/src/tools/listBatchModels.d.ts.map +1 -0
- package/dist/src/tools/listBatchModels.js +86 -0
- package/dist/src/tools/listBatchModels.js.map +1 -0
- package/dist/src/tools/listCsvColumns.d.ts +27 -0
- package/dist/src/tools/listCsvColumns.d.ts.map +1 -0
- package/dist/src/tools/listCsvColumns.js +93 -0
- package/dist/src/tools/listCsvColumns.js.map +1 -0
- package/dist/src/tools/listParameters.d.ts +25 -0
- package/dist/src/tools/listParameters.d.ts.map +1 -0
- package/dist/src/tools/listParameters.js +64 -0
- package/dist/src/tools/listParameters.js.map +1 -0
- package/dist/src/tools/runBatch.d.ts +19 -0
- package/dist/src/tools/runBatch.d.ts.map +1 -0
- package/dist/src/tools/runBatch.js +90 -0
- package/dist/src/tools/runBatch.js.map +1 -0
- package/dist/src/tools/saveParameter.d.ts +23 -0
- package/dist/src/tools/saveParameter.d.ts.map +1 -0
- package/dist/src/tools/saveParameter.js +87 -0
- package/dist/src/tools/saveParameter.js.map +1 -0
- package/dist/src/tools/viewParameter.d.ts +18 -0
- package/dist/src/tools/viewParameter.d.ts.map +1 -0
- package/dist/src/tools/viewParameter.js +51 -0
- package/dist/src/tools/viewParameter.js.map +1 -0
- package/dist/src/utils/batchConfig.d.ts +32 -0
- package/dist/src/utils/batchConfig.d.ts.map +1 -0
- package/dist/src/utils/batchConfig.js +130 -0
- package/dist/src/utils/batchConfig.js.map +1 -0
- package/dist/src/utils/fileLoader.d.ts +21 -0
- package/dist/src/utils/fileLoader.d.ts.map +1 -0
- package/dist/src/utils/fileLoader.js +86 -0
- package/dist/src/utils/fileLoader.js.map +1 -0
- package/package.json +47 -0
- package/wasm/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
- package/wasm/wasm_version.json +8 -0
- package/wasm/wasm_wrapper.js +1190 -0
- package/wasm/wasm_wrapper_bg.wasm +0 -0
|
@@ -0,0 +1,1190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROPRIETARY SOFTWARE LICENSE
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 Home Energy Foundry Limited
|
|
5
|
+
*
|
|
6
|
+
* This software and associated documentation files (the "Software") are the
|
|
7
|
+
* proprietary and confidential information of Home Energy Foundry Limited.
|
|
8
|
+
* The Software is licensed, not sold.
|
|
9
|
+
*
|
|
10
|
+
* All rights reserved. No part of this Software may be reproduced, distributed,
|
|
11
|
+
* or transmitted in any form or by any means, including photocopying, recording,
|
|
12
|
+
* or other electronic or mechanical methods, without the prior written permission
|
|
13
|
+
* of Home Energy Foundry Limited.
|
|
14
|
+
*
|
|
15
|
+
* This Software is provided "AS IS" without warranty of any kind, either express
|
|
16
|
+
* or implied, including but not limited to the implied warranties of
|
|
17
|
+
* merchantability and fitness for a particular purpose.
|
|
18
|
+
*
|
|
19
|
+
* For licensing inquiries, contact: info@usevulcan.app
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { startWorkers } from './snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js';
|
|
23
|
+
|
|
24
|
+
let wasm;
|
|
25
|
+
|
|
26
|
+
function addToExternrefTable0(obj) {
|
|
27
|
+
const idx = wasm.__externref_table_alloc();
|
|
28
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
29
|
+
return idx;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function handleError(f, args) {
|
|
33
|
+
try {
|
|
34
|
+
return f.apply(this, args);
|
|
35
|
+
} catch (e) {
|
|
36
|
+
const idx = addToExternrefTable0(e);
|
|
37
|
+
wasm.__wbindgen_exn_store(idx);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
42
|
+
|
|
43
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
44
|
+
|
|
45
|
+
let cachedUint8ArrayMemory0 = null;
|
|
46
|
+
|
|
47
|
+
function getUint8ArrayMemory0() {
|
|
48
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
|
|
49
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
50
|
+
}
|
|
51
|
+
return cachedUint8ArrayMemory0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function getStringFromWasm0(ptr, len) {
|
|
55
|
+
ptr = ptr >>> 0;
|
|
56
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function isLikeNone(x) {
|
|
60
|
+
return x === undefined || x === null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function debugString(val) {
|
|
64
|
+
// primitive types
|
|
65
|
+
const type = typeof val;
|
|
66
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
67
|
+
return `${val}`;
|
|
68
|
+
}
|
|
69
|
+
if (type == 'string') {
|
|
70
|
+
return `"${val}"`;
|
|
71
|
+
}
|
|
72
|
+
if (type == 'symbol') {
|
|
73
|
+
const description = val.description;
|
|
74
|
+
if (description == null) {
|
|
75
|
+
return 'Symbol';
|
|
76
|
+
} else {
|
|
77
|
+
return `Symbol(${description})`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (type == 'function') {
|
|
81
|
+
const name = val.name;
|
|
82
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
83
|
+
return `Function(${name})`;
|
|
84
|
+
} else {
|
|
85
|
+
return 'Function';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// objects
|
|
89
|
+
if (Array.isArray(val)) {
|
|
90
|
+
const length = val.length;
|
|
91
|
+
let debug = '[';
|
|
92
|
+
if (length > 0) {
|
|
93
|
+
debug += debugString(val[0]);
|
|
94
|
+
}
|
|
95
|
+
for(let i = 1; i < length; i++) {
|
|
96
|
+
debug += ', ' + debugString(val[i]);
|
|
97
|
+
}
|
|
98
|
+
debug += ']';
|
|
99
|
+
return debug;
|
|
100
|
+
}
|
|
101
|
+
// Test for built-in
|
|
102
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
103
|
+
let className;
|
|
104
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
105
|
+
className = builtInMatches[1];
|
|
106
|
+
} else {
|
|
107
|
+
// Failed to match the standard '[object ClassName]'
|
|
108
|
+
return toString.call(val);
|
|
109
|
+
}
|
|
110
|
+
if (className == 'Object') {
|
|
111
|
+
// we're a user defined class or Object
|
|
112
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
113
|
+
// easier than looping through ownProperties of `val`.
|
|
114
|
+
try {
|
|
115
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
116
|
+
} catch (_) {
|
|
117
|
+
return 'Object';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// errors
|
|
121
|
+
if (val instanceof Error) {
|
|
122
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
123
|
+
}
|
|
124
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
125
|
+
return className;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let WASM_VECTOR_LEN = 0;
|
|
129
|
+
|
|
130
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
131
|
+
|
|
132
|
+
const encodeString = function (arg, view) {
|
|
133
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
134
|
+
view.set(buf);
|
|
135
|
+
return {
|
|
136
|
+
read: arg.length,
|
|
137
|
+
written: buf.length
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
142
|
+
|
|
143
|
+
if (realloc === undefined) {
|
|
144
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
145
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
146
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
147
|
+
WASM_VECTOR_LEN = buf.length;
|
|
148
|
+
return ptr;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
let len = arg.length;
|
|
152
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
153
|
+
|
|
154
|
+
const mem = getUint8ArrayMemory0();
|
|
155
|
+
|
|
156
|
+
let offset = 0;
|
|
157
|
+
|
|
158
|
+
for (; offset < len; offset++) {
|
|
159
|
+
const code = arg.charCodeAt(offset);
|
|
160
|
+
if (code > 0x7F) break;
|
|
161
|
+
mem[ptr + offset] = code;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (offset !== len) {
|
|
165
|
+
if (offset !== 0) {
|
|
166
|
+
arg = arg.slice(offset);
|
|
167
|
+
}
|
|
168
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
169
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
170
|
+
const ret = encodeString(arg, view);
|
|
171
|
+
|
|
172
|
+
offset += ret.written;
|
|
173
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
WASM_VECTOR_LEN = offset;
|
|
177
|
+
return ptr;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let cachedDataViewMemory0 = null;
|
|
181
|
+
|
|
182
|
+
function getDataViewMemory0() {
|
|
183
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
184
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
185
|
+
}
|
|
186
|
+
return cachedDataViewMemory0;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Build stamp function to identify WASM builds and detect stale caching
|
|
190
|
+
* This returns a unique identifier that changes with each build
|
|
191
|
+
* @returns {string}
|
|
192
|
+
*/
|
|
193
|
+
export function build_stamp() {
|
|
194
|
+
let deferred1_0;
|
|
195
|
+
let deferred1_1;
|
|
196
|
+
try {
|
|
197
|
+
const ret = wasm.build_stamp();
|
|
198
|
+
deferred1_0 = ret[0];
|
|
199
|
+
deferred1_1 = ret[1];
|
|
200
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
201
|
+
} finally {
|
|
202
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Get the actual build hash from the version file (for granular build identification)
|
|
208
|
+
* This should be called after WASM loads to get the real build hash
|
|
209
|
+
* @returns {string}
|
|
210
|
+
*/
|
|
211
|
+
export function get_build_hash() {
|
|
212
|
+
let deferred1_0;
|
|
213
|
+
let deferred1_1;
|
|
214
|
+
try {
|
|
215
|
+
const ret = wasm.get_build_hash();
|
|
216
|
+
deferred1_0 = ret[0];
|
|
217
|
+
deferred1_1 = ret[1];
|
|
218
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
219
|
+
} finally {
|
|
220
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Get a granular build identifier that includes the hash
|
|
226
|
+
* This is the main function to use for detecting stale WASM
|
|
227
|
+
* @returns {string}
|
|
228
|
+
*/
|
|
229
|
+
export function get_granular_build_id() {
|
|
230
|
+
let deferred1_0;
|
|
231
|
+
let deferred1_1;
|
|
232
|
+
try {
|
|
233
|
+
const ret = wasm.get_granular_build_id();
|
|
234
|
+
deferred1_0 = ret[0];
|
|
235
|
+
deferred1_1 = ret[1];
|
|
236
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
237
|
+
} finally {
|
|
238
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Get build info as JSON for more detailed debugging
|
|
244
|
+
* @returns {string}
|
|
245
|
+
*/
|
|
246
|
+
export function get_build_info() {
|
|
247
|
+
let deferred1_0;
|
|
248
|
+
let deferred1_1;
|
|
249
|
+
try {
|
|
250
|
+
const ret = wasm.get_build_info();
|
|
251
|
+
deferred1_0 = ret[0];
|
|
252
|
+
deferred1_1 = ret[1];
|
|
253
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
254
|
+
} finally {
|
|
255
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Set up panic hook for WASM to capture panic information
|
|
261
|
+
*/
|
|
262
|
+
export function setup_panic_hook() {
|
|
263
|
+
wasm.setup_panic_hook();
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Initialize the thread pool for rayon multi-threading
|
|
268
|
+
*/
|
|
269
|
+
export function init() {
|
|
270
|
+
wasm.init();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* @param {bigint} left
|
|
275
|
+
* @param {bigint} right
|
|
276
|
+
* @returns {bigint}
|
|
277
|
+
*/
|
|
278
|
+
export function add(left, right) {
|
|
279
|
+
const ret = wasm.add(left, right);
|
|
280
|
+
return BigInt.asUintN(64, ret);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @returns {number}
|
|
285
|
+
*/
|
|
286
|
+
export function global_rng_example() {
|
|
287
|
+
const ret = wasm.global_rng_example();
|
|
288
|
+
return ret >>> 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Convert Geometry CSV -> HEM JSON using shared core (browser path)
|
|
293
|
+
* @param {string} csv
|
|
294
|
+
* @param {string} schema_json
|
|
295
|
+
* @param {string} defaults_json
|
|
296
|
+
* @returns {string}
|
|
297
|
+
*/
|
|
298
|
+
export function convert_geometry_csv_to_json(csv, schema_json, defaults_json) {
|
|
299
|
+
let deferred4_0;
|
|
300
|
+
let deferred4_1;
|
|
301
|
+
try {
|
|
302
|
+
const ptr0 = passStringToWasm0(csv, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
|
+
const len0 = WASM_VECTOR_LEN;
|
|
304
|
+
const ptr1 = passStringToWasm0(schema_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
305
|
+
const len1 = WASM_VECTOR_LEN;
|
|
306
|
+
const ptr2 = passStringToWasm0(defaults_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
307
|
+
const len2 = WASM_VECTOR_LEN;
|
|
308
|
+
const ret = wasm.convert_geometry_csv_to_json(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
309
|
+
deferred4_0 = ret[0];
|
|
310
|
+
deferred4_1 = ret[1];
|
|
311
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
312
|
+
} finally {
|
|
313
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Validate a snippet in-browser using hem-batch-core validation core.
|
|
319
|
+
* All inputs are JSON strings to avoid file I/O and be WASM friendly.
|
|
320
|
+
* @param {string} category
|
|
321
|
+
* @param {string} snippet_json
|
|
322
|
+
* @param {string} schema_json
|
|
323
|
+
* @param {string} baseline_json
|
|
324
|
+
* @param {string | null} [simplified_example_json]
|
|
325
|
+
* @returns {string}
|
|
326
|
+
*/
|
|
327
|
+
export function validate_snippet_js(category, snippet_json, schema_json, baseline_json, simplified_example_json) {
|
|
328
|
+
let deferred6_0;
|
|
329
|
+
let deferred6_1;
|
|
330
|
+
try {
|
|
331
|
+
const ptr0 = passStringToWasm0(category, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
332
|
+
const len0 = WASM_VECTOR_LEN;
|
|
333
|
+
const ptr1 = passStringToWasm0(snippet_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
334
|
+
const len1 = WASM_VECTOR_LEN;
|
|
335
|
+
const ptr2 = passStringToWasm0(schema_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
336
|
+
const len2 = WASM_VECTOR_LEN;
|
|
337
|
+
const ptr3 = passStringToWasm0(baseline_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
338
|
+
const len3 = WASM_VECTOR_LEN;
|
|
339
|
+
var ptr4 = isLikeNone(simplified_example_json) ? 0 : passStringToWasm0(simplified_example_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
340
|
+
var len4 = WASM_VECTOR_LEN;
|
|
341
|
+
const ret = wasm.validate_snippet_js(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
342
|
+
deferred6_0 = ret[0];
|
|
343
|
+
deferred6_1 = ret[1];
|
|
344
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
345
|
+
} finally {
|
|
346
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Dummy simulation function for testing WASM build and integration.
|
|
352
|
+
* This is a placeholder that will be replaced with real HEM engine calls.
|
|
353
|
+
*
|
|
354
|
+
* # Arguments
|
|
355
|
+
* * `model_json` - JSON string containing the building model data
|
|
356
|
+
* * `weather_json` - JSON string containing weather data
|
|
357
|
+
*
|
|
358
|
+
* # Returns
|
|
359
|
+
* * JSON string with dummy simulation results
|
|
360
|
+
* @param {string} model_json
|
|
361
|
+
* @param {string} weather_json
|
|
362
|
+
* @returns {string}
|
|
363
|
+
*/
|
|
364
|
+
export function run_simulation_dummy(model_json, weather_json) {
|
|
365
|
+
let deferred3_0;
|
|
366
|
+
let deferred3_1;
|
|
367
|
+
try {
|
|
368
|
+
const ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
369
|
+
const len0 = WASM_VECTOR_LEN;
|
|
370
|
+
const ptr1 = passStringToWasm0(weather_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
371
|
+
const len1 = WASM_VECTOR_LEN;
|
|
372
|
+
const ret = wasm.run_simulation_dummy(ptr0, len0, ptr1, len1);
|
|
373
|
+
deferred3_0 = ret[0];
|
|
374
|
+
deferred3_1 = ret[1];
|
|
375
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
376
|
+
} finally {
|
|
377
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Real batch simulation function using the shared crate.
|
|
383
|
+
* This replicates the desktop pattern by calling the same run_batch function.
|
|
384
|
+
*
|
|
385
|
+
* # Arguments
|
|
386
|
+
* * `config_json` - JSON string containing the batch configuration
|
|
387
|
+
* * `base_params_json` - JSON string containing base parameters
|
|
388
|
+
* * `weather_content` - Weather data content
|
|
389
|
+
* * `config_name` - The actual config filename (e.g., "benchmark_rust_config")
|
|
390
|
+
* * `job_id` - Unique job identifier
|
|
391
|
+
*
|
|
392
|
+
* # Returns
|
|
393
|
+
* * JSON string with simulation results
|
|
394
|
+
* @param {string} config_json
|
|
395
|
+
* @param {string} base_params_json
|
|
396
|
+
* @param {string} weather_content
|
|
397
|
+
* @param {string} config_name
|
|
398
|
+
* @param {string} job_id
|
|
399
|
+
* @returns {string}
|
|
400
|
+
*/
|
|
401
|
+
export function run_batch_simulation(config_json, base_params_json, weather_content, config_name, job_id) {
|
|
402
|
+
let deferred6_0;
|
|
403
|
+
let deferred6_1;
|
|
404
|
+
try {
|
|
405
|
+
const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
406
|
+
const len0 = WASM_VECTOR_LEN;
|
|
407
|
+
const ptr1 = passStringToWasm0(base_params_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
408
|
+
const len1 = WASM_VECTOR_LEN;
|
|
409
|
+
const ptr2 = passStringToWasm0(weather_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
410
|
+
const len2 = WASM_VECTOR_LEN;
|
|
411
|
+
const ptr3 = passStringToWasm0(config_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
412
|
+
const len3 = WASM_VECTOR_LEN;
|
|
413
|
+
const ptr4 = passStringToWasm0(job_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
414
|
+
const len4 = WASM_VECTOR_LEN;
|
|
415
|
+
const ret = wasm.run_batch_simulation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
416
|
+
deferred6_0 = ret[0];
|
|
417
|
+
deferred6_1 = ret[1];
|
|
418
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
419
|
+
} finally {
|
|
420
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Browser version of run_batch that matches the desktop native_runner::run_batch signature
|
|
426
|
+
* This is the main function that should be called for batch processing in the browser
|
|
427
|
+
*
|
|
428
|
+
* # Arguments
|
|
429
|
+
* * `workspace_dir` - Workspace directory path (relative in browser)
|
|
430
|
+
* * `config_path` - Path to the config file
|
|
431
|
+
* * `job_id` - Unique job identifier
|
|
432
|
+
*
|
|
433
|
+
* # Returns
|
|
434
|
+
* * JSON string with execution result
|
|
435
|
+
* @param {string} workspace_dir
|
|
436
|
+
* @param {string} config_path
|
|
437
|
+
* @param {string} job_id
|
|
438
|
+
* @returns {string}
|
|
439
|
+
*/
|
|
440
|
+
export function run_batch_browser(workspace_dir, config_path, job_id) {
|
|
441
|
+
let deferred4_0;
|
|
442
|
+
let deferred4_1;
|
|
443
|
+
try {
|
|
444
|
+
const ptr0 = passStringToWasm0(workspace_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
445
|
+
const len0 = WASM_VECTOR_LEN;
|
|
446
|
+
const ptr1 = passStringToWasm0(config_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
447
|
+
const len1 = WASM_VECTOR_LEN;
|
|
448
|
+
const ptr2 = passStringToWasm0(job_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
449
|
+
const len2 = WASM_VECTOR_LEN;
|
|
450
|
+
const ret = wasm.run_batch_browser(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
451
|
+
deferred4_0 = ret[0];
|
|
452
|
+
deferred4_1 = ret[1];
|
|
453
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
454
|
+
} finally {
|
|
455
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Process a batch configuration using the existing hem-batch-core logic
|
|
461
|
+
* This function uses the same run_batch_from_config function as the desktop version
|
|
462
|
+
*
|
|
463
|
+
* # Arguments
|
|
464
|
+
* * `config_json` - JSON string containing the batch configuration
|
|
465
|
+
* * `project_root` - Project root directory (relative in browser)
|
|
466
|
+
* * `output_dir` - Output directory (relative in browser)
|
|
467
|
+
* * `config_name` - The actual config filename (e.g., "benchmark_rust_config")
|
|
468
|
+
* * `job_id` - Unique job identifier for progress tracking
|
|
469
|
+
*
|
|
470
|
+
* # Returns
|
|
471
|
+
* * JSON string with processing results
|
|
472
|
+
* @param {string} config_json
|
|
473
|
+
* @param {string} project_root
|
|
474
|
+
* @param {string} output_dir
|
|
475
|
+
* @param {string} config_name
|
|
476
|
+
* @param {string} job_id
|
|
477
|
+
* @returns {string}
|
|
478
|
+
*/
|
|
479
|
+
export function process_batch_config(config_json, project_root, output_dir, config_name, job_id) {
|
|
480
|
+
let deferred6_0;
|
|
481
|
+
let deferred6_1;
|
|
482
|
+
try {
|
|
483
|
+
const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
484
|
+
const len0 = WASM_VECTOR_LEN;
|
|
485
|
+
const ptr1 = passStringToWasm0(project_root, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
486
|
+
const len1 = WASM_VECTOR_LEN;
|
|
487
|
+
const ptr2 = passStringToWasm0(output_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
488
|
+
const len2 = WASM_VECTOR_LEN;
|
|
489
|
+
const ptr3 = passStringToWasm0(config_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
490
|
+
const len3 = WASM_VECTOR_LEN;
|
|
491
|
+
const ptr4 = passStringToWasm0(job_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
492
|
+
const len4 = WASM_VECTOR_LEN;
|
|
493
|
+
const ret = wasm.process_batch_config(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
494
|
+
deferred6_0 = ret[0];
|
|
495
|
+
deferred6_1 = ret[1];
|
|
496
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
497
|
+
} finally {
|
|
498
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function takeFromExternrefTable0(idx) {
|
|
503
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
504
|
+
wasm.__externref_table_dealloc(idx);
|
|
505
|
+
return value;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Calculate metrics from pre-parsed CoreResultsData
|
|
509
|
+
* This function accepts JSON data that has been parsed by the JavaScript CSV parser
|
|
510
|
+
* and returns metric calculation results
|
|
511
|
+
*
|
|
512
|
+
* # Arguments
|
|
513
|
+
* * `data_json` - JSON string containing CoreResultsData (from CSV parser)
|
|
514
|
+
* * `metrics_json` - JSON string containing array of metric definitions
|
|
515
|
+
* * `time_range_json` - Optional JSON string containing TimeRange for filtering
|
|
516
|
+
* * `tariff_rates_json` - Optional JSON string containing tariff rates array for cost metrics
|
|
517
|
+
*
|
|
518
|
+
* # Returns
|
|
519
|
+
* * JSON string with metric calculation results
|
|
520
|
+
* @param {string} data_json
|
|
521
|
+
* @param {string} metrics_json
|
|
522
|
+
* @param {string | null} [time_range_json]
|
|
523
|
+
* @param {string | null} [tariff_rates_json]
|
|
524
|
+
* @returns {string}
|
|
525
|
+
*/
|
|
526
|
+
export function calculate_metrics_from_parsed_data(data_json, metrics_json, time_range_json, tariff_rates_json) {
|
|
527
|
+
let deferred6_0;
|
|
528
|
+
let deferred6_1;
|
|
529
|
+
try {
|
|
530
|
+
const ptr0 = passStringToWasm0(data_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
531
|
+
const len0 = WASM_VECTOR_LEN;
|
|
532
|
+
const ptr1 = passStringToWasm0(metrics_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
533
|
+
const len1 = WASM_VECTOR_LEN;
|
|
534
|
+
var ptr2 = isLikeNone(time_range_json) ? 0 : passStringToWasm0(time_range_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
535
|
+
var len2 = WASM_VECTOR_LEN;
|
|
536
|
+
var ptr3 = isLikeNone(tariff_rates_json) ? 0 : passStringToWasm0(tariff_rates_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
537
|
+
var len3 = WASM_VECTOR_LEN;
|
|
538
|
+
const ret = wasm.calculate_metrics_from_parsed_data(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
539
|
+
var ptr5 = ret[0];
|
|
540
|
+
var len5 = ret[1];
|
|
541
|
+
if (ret[3]) {
|
|
542
|
+
ptr5 = 0; len5 = 0;
|
|
543
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
544
|
+
}
|
|
545
|
+
deferred6_0 = ptr5;
|
|
546
|
+
deferred6_1 = len5;
|
|
547
|
+
return getStringFromWasm0(ptr5, len5);
|
|
548
|
+
} finally {
|
|
549
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* @param {number} num_threads
|
|
555
|
+
* @returns {Promise<any>}
|
|
556
|
+
*/
|
|
557
|
+
export function initThreadPool(num_threads) {
|
|
558
|
+
const ret = wasm.initThreadPool(num_threads);
|
|
559
|
+
return ret;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* @param {number} receiver
|
|
564
|
+
*/
|
|
565
|
+
export function wbg_rayon_start_worker(receiver) {
|
|
566
|
+
wasm.wbg_rayon_start_worker(receiver);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Write a file using the JavaScript fileService
|
|
571
|
+
* @param {string} path
|
|
572
|
+
* @param {string} content
|
|
573
|
+
*/
|
|
574
|
+
export function write_file(path, content) {
|
|
575
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
576
|
+
const len0 = WASM_VECTOR_LEN;
|
|
577
|
+
const ptr1 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
578
|
+
const len1 = WASM_VECTOR_LEN;
|
|
579
|
+
const ret = wasm.write_file(ptr0, len0, ptr1, len1);
|
|
580
|
+
if (ret[1]) {
|
|
581
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Read a file using the JavaScript fileService
|
|
587
|
+
* @param {string} path
|
|
588
|
+
* @returns {string}
|
|
589
|
+
*/
|
|
590
|
+
export function read_file(path) {
|
|
591
|
+
let deferred3_0;
|
|
592
|
+
let deferred3_1;
|
|
593
|
+
try {
|
|
594
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
595
|
+
const len0 = WASM_VECTOR_LEN;
|
|
596
|
+
const ret = wasm.read_file(ptr0, len0);
|
|
597
|
+
var ptr2 = ret[0];
|
|
598
|
+
var len2 = ret[1];
|
|
599
|
+
if (ret[3]) {
|
|
600
|
+
ptr2 = 0; len2 = 0;
|
|
601
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
602
|
+
}
|
|
603
|
+
deferred3_0 = ptr2;
|
|
604
|
+
deferred3_1 = len2;
|
|
605
|
+
return getStringFromWasm0(ptr2, len2);
|
|
606
|
+
} finally {
|
|
607
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Check if a file exists using the JavaScript fileService
|
|
613
|
+
* @param {string} path
|
|
614
|
+
* @returns {boolean}
|
|
615
|
+
*/
|
|
616
|
+
export function file_exists(path) {
|
|
617
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
618
|
+
const len0 = WASM_VECTOR_LEN;
|
|
619
|
+
const ret = wasm.file_exists(ptr0, len0);
|
|
620
|
+
return ret !== 0;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Create directories recursively using the JavaScript fileService
|
|
625
|
+
* @param {string} path
|
|
626
|
+
*/
|
|
627
|
+
export function create_dir_all(path) {
|
|
628
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
629
|
+
const len0 = WASM_VECTOR_LEN;
|
|
630
|
+
const ret = wasm.create_dir_all(ptr0, len0);
|
|
631
|
+
if (ret[1]) {
|
|
632
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Report batch progress to JavaScript
|
|
638
|
+
* This function will be called from Rust and will invoke the JavaScript report_batch_progress callback
|
|
639
|
+
* @param {string} progress_json
|
|
640
|
+
*/
|
|
641
|
+
export function report_batch_progress(progress_json) {
|
|
642
|
+
const ptr0 = passStringToWasm0(progress_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
643
|
+
const len0 = WASM_VECTOR_LEN;
|
|
644
|
+
const ret = wasm.report_batch_progress(ptr0, len0);
|
|
645
|
+
if (ret[1]) {
|
|
646
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Report simulation progress to JavaScript
|
|
652
|
+
* This function will be called from Rust and will invoke the JavaScript report_simulation_progress callback
|
|
653
|
+
* @param {string} progress_json
|
|
654
|
+
*/
|
|
655
|
+
export function report_simulation_progress(progress_json) {
|
|
656
|
+
const ptr0 = passStringToWasm0(progress_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
657
|
+
const len0 = WASM_VECTOR_LEN;
|
|
658
|
+
const ret = wasm.report_simulation_progress(ptr0, len0);
|
|
659
|
+
if (ret[1]) {
|
|
660
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
665
|
+
ptr = ptr >>> 0;
|
|
666
|
+
const mem = getDataViewMemory0();
|
|
667
|
+
const result = [];
|
|
668
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
669
|
+
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
|
|
670
|
+
}
|
|
671
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
672
|
+
return result;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* List files in a directory using the JavaScript fileService
|
|
676
|
+
* @param {string} path
|
|
677
|
+
* @returns {string[]}
|
|
678
|
+
*/
|
|
679
|
+
export function list_dir(path) {
|
|
680
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
681
|
+
const len0 = WASM_VECTOR_LEN;
|
|
682
|
+
const ret = wasm.list_dir(ptr0, len0);
|
|
683
|
+
if (ret[3]) {
|
|
684
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
685
|
+
}
|
|
686
|
+
var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
687
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
688
|
+
return v2;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Worker file system functions that use message passing to main thread
|
|
693
|
+
* Write a file using synchronous cache (like main thread)
|
|
694
|
+
* @param {string} path
|
|
695
|
+
* @param {string} content
|
|
696
|
+
*/
|
|
697
|
+
export function worker_write_file(path, content) {
|
|
698
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
699
|
+
const len0 = WASM_VECTOR_LEN;
|
|
700
|
+
const ptr1 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
701
|
+
const len1 = WASM_VECTOR_LEN;
|
|
702
|
+
const ret = wasm.worker_write_file(ptr0, len0, ptr1, len1);
|
|
703
|
+
if (ret[1]) {
|
|
704
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Read a file using synchronous cache (like main thread)
|
|
710
|
+
* @param {string} path
|
|
711
|
+
* @returns {string}
|
|
712
|
+
*/
|
|
713
|
+
export function worker_read_file(path) {
|
|
714
|
+
let deferred3_0;
|
|
715
|
+
let deferred3_1;
|
|
716
|
+
try {
|
|
717
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
718
|
+
const len0 = WASM_VECTOR_LEN;
|
|
719
|
+
const ret = wasm.worker_read_file(ptr0, len0);
|
|
720
|
+
var ptr2 = ret[0];
|
|
721
|
+
var len2 = ret[1];
|
|
722
|
+
if (ret[3]) {
|
|
723
|
+
ptr2 = 0; len2 = 0;
|
|
724
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
725
|
+
}
|
|
726
|
+
deferred3_0 = ptr2;
|
|
727
|
+
deferred3_1 = len2;
|
|
728
|
+
return getStringFromWasm0(ptr2, len2);
|
|
729
|
+
} finally {
|
|
730
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Check if a file exists using synchronous cache (like main thread)
|
|
736
|
+
* @param {string} path
|
|
737
|
+
* @returns {boolean}
|
|
738
|
+
*/
|
|
739
|
+
export function worker_file_exists(path) {
|
|
740
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
741
|
+
const len0 = WASM_VECTOR_LEN;
|
|
742
|
+
const ret = wasm.worker_file_exists(ptr0, len0);
|
|
743
|
+
if (ret[2]) {
|
|
744
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
745
|
+
}
|
|
746
|
+
return ret[0] !== 0;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Create directories using synchronous cache (like main thread)
|
|
751
|
+
* @param {string} path
|
|
752
|
+
*/
|
|
753
|
+
export function worker_create_dir_all(path) {
|
|
754
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
755
|
+
const len0 = WASM_VECTOR_LEN;
|
|
756
|
+
const ret = wasm.worker_create_dir_all(ptr0, len0);
|
|
757
|
+
if (ret[1]) {
|
|
758
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* List files in a directory using synchronous cache (like main thread)
|
|
764
|
+
* @param {string} path
|
|
765
|
+
* @returns {string[]}
|
|
766
|
+
*/
|
|
767
|
+
export function worker_list_dir(path) {
|
|
768
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
769
|
+
const len0 = WASM_VECTOR_LEN;
|
|
770
|
+
const ret = wasm.worker_list_dir(ptr0, len0);
|
|
771
|
+
if (ret[3]) {
|
|
772
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
773
|
+
}
|
|
774
|
+
var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
775
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
776
|
+
return v2;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Report batch progress using message passing to main thread
|
|
781
|
+
* @param {string} progress_json
|
|
782
|
+
*/
|
|
783
|
+
export function worker_report_batch_progress(progress_json) {
|
|
784
|
+
const ptr0 = passStringToWasm0(progress_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
785
|
+
const len0 = WASM_VECTOR_LEN;
|
|
786
|
+
const ret = wasm.worker_report_batch_progress(ptr0, len0);
|
|
787
|
+
if (ret[1]) {
|
|
788
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Report simulation progress using message passing to main thread
|
|
794
|
+
* @param {string} progress_json
|
|
795
|
+
*/
|
|
796
|
+
export function worker_report_simulation_progress(progress_json) {
|
|
797
|
+
const ptr0 = passStringToWasm0(progress_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
798
|
+
const len0 = WASM_VECTOR_LEN;
|
|
799
|
+
const ret = wasm.worker_report_simulation_progress(ptr0, len0);
|
|
800
|
+
if (ret[1]) {
|
|
801
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
const wbg_rayon_PoolBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
806
|
+
? { register: () => {}, unregister: () => {} }
|
|
807
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wbg_rayon_poolbuilder_free(ptr >>> 0, 1));
|
|
808
|
+
|
|
809
|
+
export class wbg_rayon_PoolBuilder {
|
|
810
|
+
|
|
811
|
+
static __wrap(ptr) {
|
|
812
|
+
ptr = ptr >>> 0;
|
|
813
|
+
const obj = Object.create(wbg_rayon_PoolBuilder.prototype);
|
|
814
|
+
obj.__wbg_ptr = ptr;
|
|
815
|
+
wbg_rayon_PoolBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
816
|
+
return obj;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
__destroy_into_raw() {
|
|
820
|
+
const ptr = this.__wbg_ptr;
|
|
821
|
+
this.__wbg_ptr = 0;
|
|
822
|
+
wbg_rayon_PoolBuilderFinalization.unregister(this);
|
|
823
|
+
return ptr;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
free() {
|
|
827
|
+
const ptr = this.__destroy_into_raw();
|
|
828
|
+
wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 0);
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* @returns {string}
|
|
832
|
+
*/
|
|
833
|
+
mainJS() {
|
|
834
|
+
const ret = wasm.wbg_rayon_poolbuilder_mainJS(this.__wbg_ptr);
|
|
835
|
+
return ret;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* @returns {number}
|
|
839
|
+
*/
|
|
840
|
+
numThreads() {
|
|
841
|
+
const ret = wasm.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr);
|
|
842
|
+
return ret >>> 0;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* @returns {number}
|
|
846
|
+
*/
|
|
847
|
+
receiver() {
|
|
848
|
+
const ret = wasm.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr);
|
|
849
|
+
return ret >>> 0;
|
|
850
|
+
}
|
|
851
|
+
build() {
|
|
852
|
+
wasm.wbg_rayon_poolbuilder_build(this.__wbg_ptr);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
async function __wbg_load(module, imports) {
|
|
857
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
858
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
859
|
+
try {
|
|
860
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
861
|
+
|
|
862
|
+
} catch (e) {
|
|
863
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
864
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
865
|
+
|
|
866
|
+
} else {
|
|
867
|
+
throw e;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
const bytes = await module.arrayBuffer();
|
|
873
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
874
|
+
|
|
875
|
+
} else {
|
|
876
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
877
|
+
|
|
878
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
879
|
+
return { instance, module };
|
|
880
|
+
|
|
881
|
+
} else {
|
|
882
|
+
return instance;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
function __wbg_get_imports() {
|
|
888
|
+
const imports = {};
|
|
889
|
+
imports.wbg = {};
|
|
890
|
+
imports.wbg.__wbg_apply_36be6a55257c99bf = function() { return handleError(function (arg0, arg1, arg2) {
|
|
891
|
+
const ret = arg0.apply(arg1, arg2);
|
|
892
|
+
return ret;
|
|
893
|
+
}, arguments) };
|
|
894
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
895
|
+
const ret = arg0.buffer;
|
|
896
|
+
return ret;
|
|
897
|
+
};
|
|
898
|
+
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
899
|
+
const ret = arg0.call(arg1);
|
|
900
|
+
return ret;
|
|
901
|
+
}, arguments) };
|
|
902
|
+
imports.wbg.__wbg_error_524f506f44df1645 = function(arg0) {
|
|
903
|
+
console.error(arg0);
|
|
904
|
+
};
|
|
905
|
+
imports.wbg.__wbg_getRandomValues_80578b2ff2a093ba = function() { return handleError(function (arg0) {
|
|
906
|
+
globalThis.crypto.getRandomValues(arg0);
|
|
907
|
+
}, arguments) };
|
|
908
|
+
imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
909
|
+
const ret = Reflect.get(arg0, arg1);
|
|
910
|
+
return ret;
|
|
911
|
+
}, arguments) };
|
|
912
|
+
imports.wbg.__wbg_get_74b8744f6a23f4fa = function(arg0, arg1, arg2) {
|
|
913
|
+
const ret = arg0[getStringFromWasm0(arg1, arg2)];
|
|
914
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
915
|
+
};
|
|
916
|
+
imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
917
|
+
const ret = arg0[arg1 >>> 0];
|
|
918
|
+
return ret;
|
|
919
|
+
};
|
|
920
|
+
imports.wbg.__wbg_hardwareConcurrency_e840281060cd1953 = function(arg0) {
|
|
921
|
+
const ret = arg0.hardwareConcurrency;
|
|
922
|
+
return ret;
|
|
923
|
+
};
|
|
924
|
+
imports.wbg.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) {
|
|
925
|
+
const ret = Reflect.has(arg0, arg1);
|
|
926
|
+
return ret;
|
|
927
|
+
}, arguments) };
|
|
928
|
+
imports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function(arg0) {
|
|
929
|
+
let result;
|
|
930
|
+
try {
|
|
931
|
+
result = arg0 instanceof Window;
|
|
932
|
+
} catch (_) {
|
|
933
|
+
result = false;
|
|
934
|
+
}
|
|
935
|
+
const ret = result;
|
|
936
|
+
return ret;
|
|
937
|
+
};
|
|
938
|
+
imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
939
|
+
const ret = Array.isArray(arg0);
|
|
940
|
+
return ret;
|
|
941
|
+
};
|
|
942
|
+
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
943
|
+
const ret = arg0.length;
|
|
944
|
+
return ret;
|
|
945
|
+
};
|
|
946
|
+
imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
947
|
+
const ret = arg0.length;
|
|
948
|
+
return ret;
|
|
949
|
+
};
|
|
950
|
+
imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) {
|
|
951
|
+
console.log(arg0);
|
|
952
|
+
};
|
|
953
|
+
imports.wbg.__wbg_navigator_1577371c070c8947 = function(arg0) {
|
|
954
|
+
const ret = arg0.navigator;
|
|
955
|
+
return ret;
|
|
956
|
+
};
|
|
957
|
+
imports.wbg.__wbg_new_405e22f390576ce2 = function() {
|
|
958
|
+
const ret = new Object();
|
|
959
|
+
return ret;
|
|
960
|
+
};
|
|
961
|
+
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
962
|
+
const ret = new Array();
|
|
963
|
+
return ret;
|
|
964
|
+
};
|
|
965
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
966
|
+
const ret = new Uint8Array(arg0);
|
|
967
|
+
return ret;
|
|
968
|
+
};
|
|
969
|
+
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
970
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
971
|
+
return ret;
|
|
972
|
+
};
|
|
973
|
+
imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
974
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
975
|
+
return ret;
|
|
976
|
+
};
|
|
977
|
+
imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) {
|
|
978
|
+
const ret = arg0.now();
|
|
979
|
+
return ret;
|
|
980
|
+
};
|
|
981
|
+
imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) {
|
|
982
|
+
const ret = arg0.performance;
|
|
983
|
+
return ret;
|
|
984
|
+
};
|
|
985
|
+
imports.wbg.__wbg_postMessage_78f8ee924c64d038 = function(arg0) {
|
|
986
|
+
self.postMessage(arg0);
|
|
987
|
+
};
|
|
988
|
+
imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
|
|
989
|
+
const ret = arg0.push(arg1);
|
|
990
|
+
return ret;
|
|
991
|
+
};
|
|
992
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
993
|
+
arg0[arg1] = arg2;
|
|
994
|
+
};
|
|
995
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
996
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
997
|
+
};
|
|
998
|
+
imports.wbg.__wbg_startWorkers_2329d931beb7bef4 = function(arg0, arg1, arg2) {
|
|
999
|
+
const ret = startWorkers(arg0, arg1, wbg_rayon_PoolBuilder.__wrap(arg2));
|
|
1000
|
+
return ret;
|
|
1001
|
+
};
|
|
1002
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
1003
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1004
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1005
|
+
};
|
|
1006
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
1007
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1008
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1009
|
+
};
|
|
1010
|
+
imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
1011
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1012
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1013
|
+
};
|
|
1014
|
+
imports.wbg.__wbg_static_accessor_URL_151cb8815849ce83 = function() {
|
|
1015
|
+
const ret = import.meta.url;
|
|
1016
|
+
return ret;
|
|
1017
|
+
};
|
|
1018
|
+
imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
1019
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1020
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1021
|
+
};
|
|
1022
|
+
imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
1023
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1024
|
+
return ret;
|
|
1025
|
+
};
|
|
1026
|
+
imports.wbg.__wbg_timeOrigin_9f29a08704a944d0 = function(arg0) {
|
|
1027
|
+
const ret = arg0.timeOrigin;
|
|
1028
|
+
return ret;
|
|
1029
|
+
};
|
|
1030
|
+
imports.wbg.__wbg_warn_4ca3906c248c47c4 = function(arg0) {
|
|
1031
|
+
console.warn(arg0);
|
|
1032
|
+
};
|
|
1033
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
1034
|
+
const v = arg0;
|
|
1035
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1036
|
+
return ret;
|
|
1037
|
+
};
|
|
1038
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
1039
|
+
const ret = debugString(arg1);
|
|
1040
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1041
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1042
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1043
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1044
|
+
};
|
|
1045
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
1046
|
+
const table = wasm.__wbindgen_export_2;
|
|
1047
|
+
const offset = table.grow(4);
|
|
1048
|
+
table.set(0, undefined);
|
|
1049
|
+
table.set(offset + 0, undefined);
|
|
1050
|
+
table.set(offset + 1, null);
|
|
1051
|
+
table.set(offset + 2, true);
|
|
1052
|
+
table.set(offset + 3, false);
|
|
1053
|
+
;
|
|
1054
|
+
};
|
|
1055
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
1056
|
+
const ret = typeof(arg0) === 'function';
|
|
1057
|
+
return ret;
|
|
1058
|
+
};
|
|
1059
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
1060
|
+
const val = arg0;
|
|
1061
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1062
|
+
return ret;
|
|
1063
|
+
};
|
|
1064
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
1065
|
+
const ret = arg0 === undefined;
|
|
1066
|
+
return ret;
|
|
1067
|
+
};
|
|
1068
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
1069
|
+
const ret = wasm.memory;
|
|
1070
|
+
return ret;
|
|
1071
|
+
};
|
|
1072
|
+
imports.wbg.__wbindgen_module = function() {
|
|
1073
|
+
const ret = __wbg_init.__wbindgen_wasm_module;
|
|
1074
|
+
return ret;
|
|
1075
|
+
};
|
|
1076
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
1077
|
+
const obj = arg1;
|
|
1078
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1079
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1080
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1081
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1082
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1083
|
+
};
|
|
1084
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1085
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1086
|
+
return ret;
|
|
1087
|
+
};
|
|
1088
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
1089
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
return imports;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
function __wbg_init_memory(imports, memory) {
|
|
1096
|
+
imports.wbg.memory = memory || new WebAssembly.Memory({initial:55,maximum:16384,shared:true});
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
function __wbg_finalize_init(instance, module, thread_stack_size) {
|
|
1100
|
+
wasm = instance.exports;
|
|
1101
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
1102
|
+
cachedDataViewMemory0 = null;
|
|
1103
|
+
cachedUint8ArrayMemory0 = null;
|
|
1104
|
+
|
|
1105
|
+
if (typeof thread_stack_size !== 'undefined' && (typeof thread_stack_size !== 'number' || thread_stack_size === 0 || thread_stack_size % 65536 !== 0)) { throw 'invalid stack size' }
|
|
1106
|
+
wasm.__wbindgen_start(thread_stack_size);
|
|
1107
|
+
return wasm;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
function initSync(module, memory) {
|
|
1111
|
+
if (wasm !== undefined) return wasm;
|
|
1112
|
+
|
|
1113
|
+
let thread_stack_size
|
|
1114
|
+
if (typeof module !== 'undefined') {
|
|
1115
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1116
|
+
({module, memory, thread_stack_size} = module)
|
|
1117
|
+
} else {
|
|
1118
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
const imports = __wbg_get_imports();
|
|
1123
|
+
|
|
1124
|
+
__wbg_init_memory(imports, memory);
|
|
1125
|
+
|
|
1126
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1127
|
+
module = new WebAssembly.Module(module);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1131
|
+
|
|
1132
|
+
return __wbg_finalize_init(instance, module, thread_stack_size);
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
async function __wbg_init(module_or_path, memory) {
|
|
1136
|
+
if (wasm !== undefined) return wasm;
|
|
1137
|
+
|
|
1138
|
+
let thread_stack_size
|
|
1139
|
+
if (typeof module_or_path !== 'undefined') {
|
|
1140
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1141
|
+
({module_or_path, memory, thread_stack_size} = module_or_path)
|
|
1142
|
+
} else {
|
|
1143
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
if (typeof module_or_path === 'undefined') {
|
|
1148
|
+
module_or_path = new URL('wasm_wrapper_bg.wasm', import.meta.url);
|
|
1149
|
+
}
|
|
1150
|
+
const imports = __wbg_get_imports();
|
|
1151
|
+
|
|
1152
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1153
|
+
module_or_path = fetch(module_or_path);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
__wbg_init_memory(imports, memory);
|
|
1157
|
+
|
|
1158
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1159
|
+
|
|
1160
|
+
return __wbg_finalize_init(instance, module, thread_stack_size);
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
export { initSync };
|
|
1164
|
+
export default __wbg_init;
|
|
1165
|
+
|
|
1166
|
+
// Build hash injected at build time
|
|
1167
|
+
export const BUILD_HASH = "20b9ffb958cb95391c32784cae48e8cf05b104d308a178be072120c2148f2bc5";
|
|
1168
|
+
export const BUILD_ID = "20251125-090723";
|
|
1169
|
+
export const WASM_FILENAME = "wasm_wrapper_bg.wasm";
|
|
1170
|
+
export const JS_FILENAME = "wasm_wrapper.js";
|
|
1171
|
+
|
|
1172
|
+
// Function to get the current build hash
|
|
1173
|
+
export function getBuildHash() {
|
|
1174
|
+
return "20b9ffb958cb95391c32784cae48e8cf05b104d308a178be072120c2148f2bc5";
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
// Function to get the current build ID
|
|
1178
|
+
export function getBuildId() {
|
|
1179
|
+
return "20251125-090723";
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
// Function to get the WASM filename
|
|
1183
|
+
export function getWasmFilename() {
|
|
1184
|
+
return "wasm_wrapper_bg.wasm";
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
// Function to get the JS filename
|
|
1188
|
+
export function getJsFilename() {
|
|
1189
|
+
return "wasm_wrapper.js";
|
|
1190
|
+
}
|