@lute-lang/runtime 0.0.0-stage → 0.40.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/dist/Bundle.d.ts +17 -0
- package/dist/BundleSource.d.ts +21 -0
- package/dist/Errors.d.ts +122 -0
- package/dist/InputLog.d.ts +474 -0
- package/dist/LuteRuntime.d.ts +20 -0
- package/dist/LuteWasm.d.ts +26 -0
- package/dist/Program.d.ts +48 -0
- package/dist/Replay.d.ts +17 -0
- package/dist/Session.d.ts +56 -0
- package/dist/browser.d.ts +25 -0
- package/dist/browser.js +28 -0
- package/dist/bun.d.ts +21 -0
- package/dist/bun.js +28 -0
- package/dist/generated/Contract.d.ts +1791 -0
- package/dist/generated/Ir.d.ts +2535 -0
- package/dist/index-wshk3yvw.js +918 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1031 -0
- package/dist/wasm/lute_runtime_wasm.d.ts +167 -0
- package/dist/wasm/lute_runtime_wasm.js +624 -0
- package/dist/wasm/lute_runtime_wasm_bg.wasm +0 -0
- package/dist/wasm/lute_runtime_wasm_bg.wasm.d.ts +35 -0
- package/package.json +63 -4
- package/README.md +0 -3
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
/* @ts-self-types="./lute_runtime_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The result of loading a bundle.
|
|
5
|
+
*/
|
|
6
|
+
export class LoadResult {
|
|
7
|
+
static __wrap(ptr) {
|
|
8
|
+
const obj = Object.create(LoadResult.prototype);
|
|
9
|
+
obj.__wbg_ptr = ptr;
|
|
10
|
+
LoadResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
__destroy_into_raw() {
|
|
14
|
+
const ptr = this.__wbg_ptr;
|
|
15
|
+
this.__wbg_ptr = 0;
|
|
16
|
+
LoadResultFinalization.unregister(this);
|
|
17
|
+
return ptr;
|
|
18
|
+
}
|
|
19
|
+
free() {
|
|
20
|
+
const ptr = this.__destroy_into_raw();
|
|
21
|
+
wasm.__wbg_loadresult_free(ptr, 0);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @returns {boolean}
|
|
25
|
+
*/
|
|
26
|
+
get ok() {
|
|
27
|
+
const ret = wasm.loadresult_ok(this.__wbg_ptr);
|
|
28
|
+
return ret !== 0;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @returns {Program | undefined}
|
|
32
|
+
*/
|
|
33
|
+
get program() {
|
|
34
|
+
const ret = wasm.loadresult_program(this.__wbg_ptr);
|
|
35
|
+
return ret === 0 ? undefined : Program.__wrap(ret);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @returns {string | undefined}
|
|
39
|
+
*/
|
|
40
|
+
get rejected() {
|
|
41
|
+
const ret = wasm.loadresult_rejected(this.__wbg_ptr);
|
|
42
|
+
let v1;
|
|
43
|
+
if (ret[0] !== 0) {
|
|
44
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
45
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
46
|
+
}
|
|
47
|
+
return v1;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (Symbol.dispose) LoadResult.prototype[Symbol.dispose] = LoadResult.prototype.free;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A loaded execution bundle.
|
|
54
|
+
*/
|
|
55
|
+
export class Program {
|
|
56
|
+
static __wrap(ptr) {
|
|
57
|
+
const obj = Object.create(Program.prototype);
|
|
58
|
+
obj.__wbg_ptr = ptr;
|
|
59
|
+
ProgramFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
60
|
+
return obj;
|
|
61
|
+
}
|
|
62
|
+
__destroy_into_raw() {
|
|
63
|
+
const ptr = this.__wbg_ptr;
|
|
64
|
+
this.__wbg_ptr = 0;
|
|
65
|
+
ProgramFinalization.unregister(this);
|
|
66
|
+
return ptr;
|
|
67
|
+
}
|
|
68
|
+
free() {
|
|
69
|
+
const ptr = this.__destroy_into_raw();
|
|
70
|
+
wasm.__wbg_program_free(ptr, 0);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Begin a run from a JSON seed.
|
|
74
|
+
* @param {string} seed
|
|
75
|
+
* @returns {StepResult}
|
|
76
|
+
*/
|
|
77
|
+
begin(seed) {
|
|
78
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
79
|
+
const len0 = WASM_VECTOR_LEN;
|
|
80
|
+
const ret = wasm.program_begin(this.__wbg_ptr, ptr0, len0);
|
|
81
|
+
return StepResult.__wrap(ret);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The candidates of `occasion` (for `target`) in selection order, as a
|
|
85
|
+
* JSON array of `Candidate`.
|
|
86
|
+
* @param {State} state
|
|
87
|
+
* @param {string} occasion
|
|
88
|
+
* @param {string | null} [target]
|
|
89
|
+
* @returns {string}
|
|
90
|
+
*/
|
|
91
|
+
candidates(state, occasion, target) {
|
|
92
|
+
let deferred3_0;
|
|
93
|
+
let deferred3_1;
|
|
94
|
+
try {
|
|
95
|
+
_assertClass(state, State);
|
|
96
|
+
const ptr0 = passStringToWasm0(occasion, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
97
|
+
const len0 = WASM_VECTOR_LEN;
|
|
98
|
+
var ptr1 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
99
|
+
var len1 = WASM_VECTOR_LEN;
|
|
100
|
+
const ret = wasm.program_candidates(this.__wbg_ptr, state.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
101
|
+
deferred3_0 = ret[0];
|
|
102
|
+
deferred3_1 = ret[1];
|
|
103
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
104
|
+
} finally {
|
|
105
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The clock position, as `ClockAt` JSON or `null` without a clock.
|
|
110
|
+
* @param {State} state
|
|
111
|
+
* @returns {string}
|
|
112
|
+
*/
|
|
113
|
+
clock(state) {
|
|
114
|
+
let deferred1_0;
|
|
115
|
+
let deferred1_1;
|
|
116
|
+
try {
|
|
117
|
+
_assertClass(state, State);
|
|
118
|
+
const ret = wasm.program_clock(this.__wbg_ptr, state.__wbg_ptr);
|
|
119
|
+
deferred1_0 = ret[0];
|
|
120
|
+
deferred1_1 = ret[1];
|
|
121
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
122
|
+
} finally {
|
|
123
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The verdict of `beat` (for `member`), as `Candidate` JSON or `null`.
|
|
128
|
+
* @param {State} state
|
|
129
|
+
* @param {string} beat
|
|
130
|
+
* @param {string | null} [member]
|
|
131
|
+
* @returns {string}
|
|
132
|
+
*/
|
|
133
|
+
eligibility(state, beat, member) {
|
|
134
|
+
let deferred3_0;
|
|
135
|
+
let deferred3_1;
|
|
136
|
+
try {
|
|
137
|
+
_assertClass(state, State);
|
|
138
|
+
const ptr0 = passStringToWasm0(beat, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
139
|
+
const len0 = WASM_VECTOR_LEN;
|
|
140
|
+
var ptr1 = isLikeNone(member) ? 0 : passStringToWasm0(member, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
141
|
+
var len1 = WASM_VECTOR_LEN;
|
|
142
|
+
const ret = wasm.program_eligibility(this.__wbg_ptr, state.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
143
|
+
deferred3_0 = ret[0];
|
|
144
|
+
deferred3_1 = ret[1];
|
|
145
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
146
|
+
} finally {
|
|
147
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @returns {string}
|
|
152
|
+
*/
|
|
153
|
+
get fingerprint() {
|
|
154
|
+
let deferred1_0;
|
|
155
|
+
let deferred1_1;
|
|
156
|
+
try {
|
|
157
|
+
const ret = wasm.program_fingerprint(this.__wbg_ptr);
|
|
158
|
+
deferred1_0 = ret[0];
|
|
159
|
+
deferred1_1 = ret[1];
|
|
160
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
161
|
+
} finally {
|
|
162
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Load a `project.index.json` and an object mapping artifact paths to IR.
|
|
167
|
+
*
|
|
168
|
+
* Bundle decoding and validation failures are returned as a rejected value
|
|
169
|
+
* rather than escaping into JavaScript as an exception.
|
|
170
|
+
* @param {string} index
|
|
171
|
+
* @param {string} artifacts
|
|
172
|
+
* @returns {LoadResult}
|
|
173
|
+
*/
|
|
174
|
+
static load(index, artifacts) {
|
|
175
|
+
const ptr0 = passStringToWasm0(index, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
176
|
+
const len0 = WASM_VECTOR_LEN;
|
|
177
|
+
const ptr1 = passStringToWasm0(artifacts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
178
|
+
const len1 = WASM_VECTOR_LEN;
|
|
179
|
+
const ret = wasm.program_load(ptr0, len0, ptr1, len1);
|
|
180
|
+
return LoadResult.__wrap(ret);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Restore a state from a versioned snapshot JSON.
|
|
184
|
+
* @param {string} snapshot
|
|
185
|
+
* @returns {RestoreResult}
|
|
186
|
+
*/
|
|
187
|
+
restore(snapshot) {
|
|
188
|
+
const ptr0 = passStringToWasm0(snapshot, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
189
|
+
const len0 = WASM_VECTOR_LEN;
|
|
190
|
+
const ret = wasm.program_restore(this.__wbg_ptr, ptr0, len0);
|
|
191
|
+
return RestoreResult.__wrap(ret);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Serialize a state to its versioned snapshot JSON (keys sorted, the
|
|
195
|
+
* contract's canonical form).
|
|
196
|
+
* @param {State} state
|
|
197
|
+
* @returns {string}
|
|
198
|
+
*/
|
|
199
|
+
snapshot(state) {
|
|
200
|
+
let deferred1_0;
|
|
201
|
+
let deferred1_1;
|
|
202
|
+
try {
|
|
203
|
+
_assertClass(state, State);
|
|
204
|
+
const ret = wasm.program_snapshot(this.__wbg_ptr, state.__wbg_ptr);
|
|
205
|
+
deferred1_0 = ret[0];
|
|
206
|
+
deferred1_1 = ret[1];
|
|
207
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
208
|
+
} finally {
|
|
209
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* The persistent presentation stage as canonical JSON.
|
|
214
|
+
* @param {State} state
|
|
215
|
+
* @returns {string}
|
|
216
|
+
*/
|
|
217
|
+
stage(state) {
|
|
218
|
+
let deferred1_0;
|
|
219
|
+
let deferred1_1;
|
|
220
|
+
try {
|
|
221
|
+
_assertClass(state, State);
|
|
222
|
+
const ret = wasm.program_stage(this.__wbg_ptr, state.__wbg_ptr);
|
|
223
|
+
deferred1_0 = ret[0];
|
|
224
|
+
deferred1_1 = ret[1];
|
|
225
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
226
|
+
} finally {
|
|
227
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Apply a JSON input without invalidating the supplied state handle.
|
|
232
|
+
* @param {State} state
|
|
233
|
+
* @param {string} input
|
|
234
|
+
* @returns {StepResult}
|
|
235
|
+
*/
|
|
236
|
+
step(state, input) {
|
|
237
|
+
_assertClass(state, State);
|
|
238
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
239
|
+
const len0 = WASM_VECTOR_LEN;
|
|
240
|
+
const ret = wasm.program_step(this.__wbg_ptr, state.__wbg_ptr, ptr0, len0);
|
|
241
|
+
return StepResult.__wrap(ret);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Whether this state is terminal.
|
|
245
|
+
* @param {State} state
|
|
246
|
+
* @returns {boolean}
|
|
247
|
+
*/
|
|
248
|
+
terminal(state) {
|
|
249
|
+
_assertClass(state, State);
|
|
250
|
+
const ret = wasm.program_terminal(this.__wbg_ptr, state.__wbg_ptr);
|
|
251
|
+
return ret !== 0;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* The world view, as `WorldView` JSON (facts only when `with_facts`).
|
|
255
|
+
* @param {State} state
|
|
256
|
+
* @param {boolean} with_facts
|
|
257
|
+
* @returns {string}
|
|
258
|
+
*/
|
|
259
|
+
view(state, with_facts) {
|
|
260
|
+
let deferred1_0;
|
|
261
|
+
let deferred1_1;
|
|
262
|
+
try {
|
|
263
|
+
_assertClass(state, State);
|
|
264
|
+
const ret = wasm.program_view(this.__wbg_ptr, state.__wbg_ptr, with_facts);
|
|
265
|
+
deferred1_0 = ret[0];
|
|
266
|
+
deferred1_1 = ret[1];
|
|
267
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
268
|
+
} finally {
|
|
269
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (Symbol.dispose) Program.prototype[Symbol.dispose] = Program.prototype.free;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The result of restoring a snapshot.
|
|
277
|
+
*/
|
|
278
|
+
export class RestoreResult {
|
|
279
|
+
static __wrap(ptr) {
|
|
280
|
+
const obj = Object.create(RestoreResult.prototype);
|
|
281
|
+
obj.__wbg_ptr = ptr;
|
|
282
|
+
RestoreResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
283
|
+
return obj;
|
|
284
|
+
}
|
|
285
|
+
__destroy_into_raw() {
|
|
286
|
+
const ptr = this.__wbg_ptr;
|
|
287
|
+
this.__wbg_ptr = 0;
|
|
288
|
+
RestoreResultFinalization.unregister(this);
|
|
289
|
+
return ptr;
|
|
290
|
+
}
|
|
291
|
+
free() {
|
|
292
|
+
const ptr = this.__destroy_into_raw();
|
|
293
|
+
wasm.__wbg_restoreresult_free(ptr, 0);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* @returns {boolean}
|
|
297
|
+
*/
|
|
298
|
+
get ok() {
|
|
299
|
+
const ret = wasm.restoreresult_ok(this.__wbg_ptr);
|
|
300
|
+
return ret !== 0;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* @returns {string | undefined}
|
|
304
|
+
*/
|
|
305
|
+
get rejected() {
|
|
306
|
+
const ret = wasm.restoreresult_rejected(this.__wbg_ptr);
|
|
307
|
+
let v1;
|
|
308
|
+
if (ret[0] !== 0) {
|
|
309
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
310
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
311
|
+
}
|
|
312
|
+
return v1;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @returns {State | undefined}
|
|
316
|
+
*/
|
|
317
|
+
get state() {
|
|
318
|
+
const ret = wasm.restoreresult_state(this.__wbg_ptr);
|
|
319
|
+
return ret === 0 ? undefined : State.__wrap(ret);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (Symbol.dispose) RestoreResult.prototype[Symbol.dispose] = RestoreResult.prototype.free;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* An opaque immutable state handle.
|
|
326
|
+
*/
|
|
327
|
+
export class State {
|
|
328
|
+
static __wrap(ptr) {
|
|
329
|
+
const obj = Object.create(State.prototype);
|
|
330
|
+
obj.__wbg_ptr = ptr;
|
|
331
|
+
StateFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
332
|
+
return obj;
|
|
333
|
+
}
|
|
334
|
+
__destroy_into_raw() {
|
|
335
|
+
const ptr = this.__wbg_ptr;
|
|
336
|
+
this.__wbg_ptr = 0;
|
|
337
|
+
StateFinalization.unregister(this);
|
|
338
|
+
return ptr;
|
|
339
|
+
}
|
|
340
|
+
free() {
|
|
341
|
+
const ptr = this.__destroy_into_raw();
|
|
342
|
+
wasm.__wbg_state_free(ptr, 0);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (Symbol.dispose) State.prototype[Symbol.dispose] = State.prototype.free;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* The result of beginning or stepping a program.
|
|
349
|
+
*/
|
|
350
|
+
export class StepResult {
|
|
351
|
+
static __wrap(ptr) {
|
|
352
|
+
const obj = Object.create(StepResult.prototype);
|
|
353
|
+
obj.__wbg_ptr = ptr;
|
|
354
|
+
StepResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
355
|
+
return obj;
|
|
356
|
+
}
|
|
357
|
+
__destroy_into_raw() {
|
|
358
|
+
const ptr = this.__wbg_ptr;
|
|
359
|
+
this.__wbg_ptr = 0;
|
|
360
|
+
StepResultFinalization.unregister(this);
|
|
361
|
+
return ptr;
|
|
362
|
+
}
|
|
363
|
+
free() {
|
|
364
|
+
const ptr = this.__destroy_into_raw();
|
|
365
|
+
wasm.__wbg_stepresult_free(ptr, 0);
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* @returns {boolean}
|
|
369
|
+
*/
|
|
370
|
+
get ok() {
|
|
371
|
+
const ret = wasm.stepresult_ok(this.__wbg_ptr);
|
|
372
|
+
return ret !== 0;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* @returns {string | undefined}
|
|
376
|
+
*/
|
|
377
|
+
get output() {
|
|
378
|
+
const ret = wasm.stepresult_output(this.__wbg_ptr);
|
|
379
|
+
let v1;
|
|
380
|
+
if (ret[0] !== 0) {
|
|
381
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
382
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
383
|
+
}
|
|
384
|
+
return v1;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* @returns {string | undefined}
|
|
388
|
+
*/
|
|
389
|
+
get rejected() {
|
|
390
|
+
const ret = wasm.stepresult_rejected(this.__wbg_ptr);
|
|
391
|
+
let v1;
|
|
392
|
+
if (ret[0] !== 0) {
|
|
393
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
394
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
395
|
+
}
|
|
396
|
+
return v1;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* @returns {State | undefined}
|
|
400
|
+
*/
|
|
401
|
+
get state() {
|
|
402
|
+
const ret = wasm.stepresult_state(this.__wbg_ptr);
|
|
403
|
+
return ret === 0 ? undefined : State.__wrap(ret);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (Symbol.dispose) StepResult.prototype[Symbol.dispose] = StepResult.prototype.free;
|
|
407
|
+
function __wbg_get_imports() {
|
|
408
|
+
const import0 = {
|
|
409
|
+
__proto__: null,
|
|
410
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
411
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
412
|
+
},
|
|
413
|
+
__wbindgen_init_externref_table: function() {
|
|
414
|
+
const table = wasm.__wbindgen_externrefs;
|
|
415
|
+
const offset = table.grow(4);
|
|
416
|
+
table.set(0, undefined);
|
|
417
|
+
table.set(offset + 0, undefined);
|
|
418
|
+
table.set(offset + 1, null);
|
|
419
|
+
table.set(offset + 2, true);
|
|
420
|
+
table.set(offset + 3, false);
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
return {
|
|
424
|
+
__proto__: null,
|
|
425
|
+
"./lute_runtime_wasm_bg.js": import0,
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const LoadResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
430
|
+
? { register: () => {}, unregister: () => {} }
|
|
431
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_loadresult_free(ptr, 1));
|
|
432
|
+
const ProgramFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
433
|
+
? { register: () => {}, unregister: () => {} }
|
|
434
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_program_free(ptr, 1));
|
|
435
|
+
const RestoreResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
436
|
+
? { register: () => {}, unregister: () => {} }
|
|
437
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_restoreresult_free(ptr, 1));
|
|
438
|
+
const StateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
439
|
+
? { register: () => {}, unregister: () => {} }
|
|
440
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_state_free(ptr, 1));
|
|
441
|
+
const StepResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
442
|
+
? { register: () => {}, unregister: () => {} }
|
|
443
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_stepresult_free(ptr, 1));
|
|
444
|
+
|
|
445
|
+
function _assertClass(instance, klass) {
|
|
446
|
+
if (!(instance instanceof klass)) {
|
|
447
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function getStringFromWasm0(ptr, len) {
|
|
452
|
+
return decodeText(ptr >>> 0, len);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
let cachedUint8ArrayMemory0 = null;
|
|
456
|
+
function getUint8ArrayMemory0() {
|
|
457
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
458
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
459
|
+
}
|
|
460
|
+
return cachedUint8ArrayMemory0;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function isLikeNone(x) {
|
|
464
|
+
return x === undefined || x === null;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
468
|
+
if (realloc === undefined) {
|
|
469
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
470
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
471
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
472
|
+
WASM_VECTOR_LEN = buf.length;
|
|
473
|
+
return ptr;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
let len = arg.length;
|
|
477
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
478
|
+
|
|
479
|
+
const mem = getUint8ArrayMemory0();
|
|
480
|
+
|
|
481
|
+
let offset = 0;
|
|
482
|
+
|
|
483
|
+
for (; offset < len; offset++) {
|
|
484
|
+
const code = arg.charCodeAt(offset);
|
|
485
|
+
if (code > 0x7F) break;
|
|
486
|
+
mem[ptr + offset] = code;
|
|
487
|
+
}
|
|
488
|
+
if (offset !== len) {
|
|
489
|
+
if (offset !== 0) {
|
|
490
|
+
arg = arg.slice(offset);
|
|
491
|
+
}
|
|
492
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
493
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
494
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
495
|
+
|
|
496
|
+
offset += ret.written;
|
|
497
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
WASM_VECTOR_LEN = offset;
|
|
501
|
+
return ptr;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
505
|
+
cachedTextDecoder.decode();
|
|
506
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
507
|
+
let numBytesDecoded = 0;
|
|
508
|
+
function decodeText(ptr, len) {
|
|
509
|
+
numBytesDecoded += len;
|
|
510
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
511
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
512
|
+
cachedTextDecoder.decode();
|
|
513
|
+
numBytesDecoded = len;
|
|
514
|
+
}
|
|
515
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const cachedTextEncoder = new TextEncoder();
|
|
519
|
+
|
|
520
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
521
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
522
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
523
|
+
view.set(buf);
|
|
524
|
+
return {
|
|
525
|
+
read: arg.length,
|
|
526
|
+
written: buf.length
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
let WASM_VECTOR_LEN = 0;
|
|
532
|
+
|
|
533
|
+
let wasmModule, wasmInstance, wasm;
|
|
534
|
+
function __wbg_finalize_init(instance, module) {
|
|
535
|
+
wasmInstance = instance;
|
|
536
|
+
wasm = instance.exports;
|
|
537
|
+
wasmModule = module;
|
|
538
|
+
cachedUint8ArrayMemory0 = null;
|
|
539
|
+
wasm.__wbindgen_start();
|
|
540
|
+
return wasm;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
async function __wbg_load(module, imports) {
|
|
544
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
545
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
546
|
+
try {
|
|
547
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
548
|
+
} catch (e) {
|
|
549
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
550
|
+
|
|
551
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
552
|
+
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);
|
|
553
|
+
|
|
554
|
+
} else { throw e; }
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
const bytes = await module.arrayBuffer();
|
|
559
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
560
|
+
} else {
|
|
561
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
562
|
+
|
|
563
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
564
|
+
return { instance, module };
|
|
565
|
+
} else {
|
|
566
|
+
return instance;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function expectedResponseType(type) {
|
|
571
|
+
switch (type) {
|
|
572
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
573
|
+
}
|
|
574
|
+
return false;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
function initSync(module) {
|
|
579
|
+
if (wasm !== undefined) return wasm;
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
if (module !== undefined) {
|
|
583
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
584
|
+
({module} = module)
|
|
585
|
+
} else {
|
|
586
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
const imports = __wbg_get_imports();
|
|
591
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
592
|
+
module = new WebAssembly.Module(module);
|
|
593
|
+
}
|
|
594
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
595
|
+
return __wbg_finalize_init(instance, module);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
async function __wbg_init(module_or_path) {
|
|
599
|
+
if (wasm !== undefined) return wasm;
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
if (module_or_path !== undefined) {
|
|
603
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
604
|
+
({module_or_path} = module_or_path)
|
|
605
|
+
} else {
|
|
606
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
if (module_or_path === undefined) {
|
|
611
|
+
module_or_path = new URL('lute_runtime_wasm_bg.wasm', import.meta.url);
|
|
612
|
+
}
|
|
613
|
+
const imports = __wbg_get_imports();
|
|
614
|
+
|
|
615
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
616
|
+
module_or_path = fetch(module_or_path);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
620
|
+
|
|
621
|
+
return __wbg_finalize_init(instance, module);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_loadresult_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_program_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_restoreresult_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_state_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_stepresult_free: (a: number, b: number) => void;
|
|
9
|
+
export const loadresult_ok: (a: number) => number;
|
|
10
|
+
export const loadresult_program: (a: number) => number;
|
|
11
|
+
export const loadresult_rejected: (a: number) => [number, number];
|
|
12
|
+
export const program_begin: (a: number, b: number, c: number) => number;
|
|
13
|
+
export const program_candidates: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
14
|
+
export const program_clock: (a: number, b: number) => [number, number];
|
|
15
|
+
export const program_eligibility: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
16
|
+
export const program_fingerprint: (a: number) => [number, number];
|
|
17
|
+
export const program_load: (a: number, b: number, c: number, d: number) => number;
|
|
18
|
+
export const program_restore: (a: number, b: number, c: number) => number;
|
|
19
|
+
export const program_snapshot: (a: number, b: number) => [number, number];
|
|
20
|
+
export const program_stage: (a: number, b: number) => [number, number];
|
|
21
|
+
export const program_step: (a: number, b: number, c: number, d: number) => number;
|
|
22
|
+
export const program_terminal: (a: number, b: number) => number;
|
|
23
|
+
export const program_view: (a: number, b: number, c: number) => [number, number];
|
|
24
|
+
export const restoreresult_ok: (a: number) => number;
|
|
25
|
+
export const restoreresult_rejected: (a: number) => [number, number];
|
|
26
|
+
export const restoreresult_state: (a: number) => number;
|
|
27
|
+
export const stepresult_ok: (a: number) => number;
|
|
28
|
+
export const stepresult_output: (a: number) => [number, number];
|
|
29
|
+
export const stepresult_rejected: (a: number) => [number, number];
|
|
30
|
+
export const stepresult_state: (a: number) => number;
|
|
31
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
32
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
33
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
34
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
35
|
+
export const __wbindgen_start: () => void;
|