orez-sync-cf-host 0.10.5 → 0.10.6

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.
@@ -0,0 +1,822 @@
1
+ /**
2
+ * Apply one ordered catch-up page to staging without touching the live table
3
+ * namespace or live upstream watermark.
4
+ * @param {any} db
5
+ * @param {any} schema
6
+ * @param {string} generation
7
+ * @param {any} batch
8
+ * @returns {any}
9
+ */
10
+ export function engine_apply_snapshot_changes(db, schema, generation, batch) {
11
+ const ptr0 = passStringToWasm0(generation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
12
+ const len0 = WASM_VECTOR_LEN;
13
+ const ret = wasm.engine_apply_snapshot_changes(db, schema, ptr0, len0, batch);
14
+ if (ret[2]) {
15
+ throw takeFromExternrefTable0(ret[1]);
16
+ }
17
+ return takeFromExternrefTable0(ret[0]);
18
+ }
19
+
20
+ /**
21
+ * Apply one bounded source page to staging and commit its opaque cursor with
22
+ * the rows. The host owns one transaction per call.
23
+ * @param {any} db
24
+ * @param {any} schema
25
+ * @param {string} generation
26
+ * @param {string} table
27
+ * @param {any} rows
28
+ * @param {string | null} [next_cursor]
29
+ * @returns {any}
30
+ */
31
+ export function engine_apply_snapshot_page(db, schema, generation, table, rows, next_cursor) {
32
+ const ptr0 = passStringToWasm0(generation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
33
+ const len0 = WASM_VECTOR_LEN;
34
+ const ptr1 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
35
+ const len1 = WASM_VECTOR_LEN;
36
+ var ptr2 = isLikeNone(next_cursor) ? 0 : passStringToWasm0(next_cursor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
37
+ var len2 = WASM_VECTOR_LEN;
38
+ const ret = wasm.engine_apply_snapshot_page(db, schema, ptr0, len0, ptr1, len1, rows, ptr2, len2);
39
+ if (ret[2]) {
40
+ throw takeFromExternrefTable0(ret[1]);
41
+ }
42
+ return takeFromExternrefTable0(ret[0]);
43
+ }
44
+
45
+ /**
46
+ * Apply one ordered page from the upstream ZeroSqlDO change feed. The host
47
+ * owns one transaction around this call; application triggers append the
48
+ * ordinary engine change-log entries consumed by pull/CVR code.
49
+ * @param {any} db
50
+ * @param {any} schema
51
+ * @param {any} batch
52
+ * @returns {any}
53
+ */
54
+ export function engine_apply_upstream(db, schema, batch) {
55
+ const ret = wasm.engine_apply_upstream(db, schema, batch);
56
+ if (ret[2]) {
57
+ throw takeFromExternrefTable0(ret[1]);
58
+ }
59
+ return takeFromExternrefTable0(ret[0]);
60
+ }
61
+
62
+ /**
63
+ * Atomically rebuild application rows from a point-in-time upstream snapshot.
64
+ * @param {any} db
65
+ * @param {any} schema
66
+ * @param {any} snapshot
67
+ * @returns {any}
68
+ */
69
+ export function engine_apply_upstream_snapshot(db, schema, snapshot) {
70
+ const ret = wasm.engine_apply_upstream_snapshot(db, schema, snapshot);
71
+ if (ret[2]) {
72
+ throw takeFromExternrefTable0(ret[1]);
73
+ }
74
+ return takeFromExternrefTable0(ret[0]);
75
+ }
76
+
77
+ /**
78
+ * @param {any} results
79
+ * @returns {any}
80
+ */
81
+ export function engine_assemble_push_response(results) {
82
+ const ret = wasm.engine_assemble_push_response(results);
83
+ if (ret[2]) {
84
+ throw takeFromExternrefTable0(ret[1]);
85
+ }
86
+ return takeFromExternrefTable0(ret[0]);
87
+ }
88
+
89
+ /**
90
+ * Create a new staged generation. `start_watermark` is captured by the host
91
+ * from the first source snapshot-page response. The host owns the transaction.
92
+ * @param {any} db
93
+ * @param {any} schema
94
+ * @param {string} start_watermark
95
+ * @returns {any}
96
+ */
97
+ export function engine_begin_snapshot_generation(db, schema, start_watermark) {
98
+ const ptr0 = passStringToWasm0(start_watermark, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
99
+ const len0 = WASM_VECTOR_LEN;
100
+ const ret = wasm.engine_begin_snapshot_generation(db, schema, ptr0, len0);
101
+ if (ret[2]) {
102
+ throw takeFromExternrefTable0(ret[1]);
103
+ }
104
+ return takeFromExternrefTable0(ret[0]);
105
+ }
106
+
107
+ /**
108
+ * Compile a validated Zero query AST for a consumer mutator's transactional
109
+ * `tx.run(...)`. Execution remains in the host-owned application transaction.
110
+ * @param {any} schema
111
+ * @param {any} ast
112
+ * @param {any} format
113
+ * @returns {any}
114
+ */
115
+ export function engine_compile_query(schema, ast, format) {
116
+ const ret = wasm.engine_compile_query(schema, ast, format);
117
+ if (ret[2]) {
118
+ throw takeFromExternrefTable0(ret[1]);
119
+ }
120
+ return takeFromExternrefTable0(ret[0]);
121
+ }
122
+
123
+ /**
124
+ * @param {any} db
125
+ * @param {string} client_group_id
126
+ * @param {string} client_id
127
+ * @param {string} mutation_id
128
+ */
129
+ export function engine_finalize(db, client_group_id, client_id, mutation_id) {
130
+ const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
131
+ const len0 = WASM_VECTOR_LEN;
132
+ const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
133
+ const len1 = WASM_VECTOR_LEN;
134
+ const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
135
+ const len2 = WASM_VECTOR_LEN;
136
+ const ret = wasm.engine_finalize(db, ptr0, len0, ptr1, len1, ptr2, len2);
137
+ if (ret[1]) {
138
+ throw takeFromExternrefTable0(ret[0]);
139
+ }
140
+ }
141
+
142
+ /**
143
+ * Atomically rename a drained staged generation into the live namespace,
144
+ * invalidate pre-cutover client cookies, and advance the live source cursor.
145
+ * @param {any} db
146
+ * @param {any} schema
147
+ * @param {string} generation
148
+ * @param {string} watermark
149
+ * @returns {any}
150
+ */
151
+ export function engine_finalize_snapshot_generation(db, schema, generation, watermark) {
152
+ const ptr0 = passStringToWasm0(generation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ptr1 = passStringToWasm0(watermark, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
155
+ const len1 = WASM_VECTOR_LEN;
156
+ const ret = wasm.engine_finalize_snapshot_generation(db, schema, ptr0, len0, ptr1, len1);
157
+ if (ret[2]) {
158
+ throw takeFromExternrefTable0(ret[1]);
159
+ }
160
+ return takeFromExternrefTable0(ret[0]);
161
+ }
162
+
163
+ /**
164
+ * Production pull entry. The TypeScript host owns `transactionSync`.
165
+ * @param {any} db
166
+ * @param {any} schema
167
+ * @param {any} visibility
168
+ * @param {any} caps
169
+ * @param {string} retain_changes
170
+ * @param {any} body
171
+ * @param {string} user_id
172
+ * @returns {any}
173
+ */
174
+ export function engine_handle_pull(db, schema, visibility, caps, retain_changes, body, user_id) {
175
+ const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
176
+ const len0 = WASM_VECTOR_LEN;
177
+ const ptr1 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ const len1 = WASM_VECTOR_LEN;
179
+ const ret = wasm.engine_handle_pull(db, schema, visibility, caps, ptr0, len0, body, ptr1, len1);
180
+ if (ret[2]) {
181
+ throw takeFromExternrefTable0(ret[1]);
182
+ }
183
+ return takeFromExternrefTable0(ret[0]);
184
+ }
185
+
186
+ /**
187
+ * Query-aware pull entry point. Desired-query ASTs are already resolved and
188
+ * validated by the consumer host before crossing this boundary.
189
+ * @param {any} db
190
+ * @param {any} schema
191
+ * @param {string} retain_changes
192
+ * @param {any} body
193
+ * @param {string} user_id
194
+ * @returns {any}
195
+ */
196
+ export function engine_handle_query_pull(db, schema, retain_changes, body, user_id) {
197
+ const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
198
+ const len0 = WASM_VECTOR_LEN;
199
+ const ptr1 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
200
+ const len1 = WASM_VECTOR_LEN;
201
+ const ret = wasm.engine_handle_query_pull(db, schema, ptr0, len0, body, ptr1, len1);
202
+ if (ret[2]) {
203
+ throw takeFromExternrefTable0(ret[1]);
204
+ }
205
+ return takeFromExternrefTable0(ret[0]);
206
+ }
207
+
208
+ /**
209
+ * Initialize the additive query-aware durable tables. The host owns the
210
+ * transaction boundary, exactly as it does for the baseline schema.
211
+ * @param {any} db
212
+ */
213
+ export function engine_init_query_schema(db) {
214
+ const ret = wasm.engine_init_query_schema(db);
215
+ if (ret[1]) {
216
+ throw takeFromExternrefTable0(ret[0]);
217
+ }
218
+ }
219
+
220
+ /**
221
+ * Initialize the sync engine's durable metadata and triggers. The host calls
222
+ * this inside startup `transactionSync` after application DDL and seed.
223
+ * @param {any} db
224
+ * @param {any} schema
225
+ */
226
+ export function engine_init_schema(db, schema) {
227
+ const ret = wasm.engine_init_schema(db, schema);
228
+ if (ret[1]) {
229
+ throw takeFromExternrefTable0(ret[0]);
230
+ }
231
+ }
232
+
233
+ /**
234
+ * @param {any} db
235
+ */
236
+ export function engine_invalidate(db) {
237
+ const ret = wasm.engine_invalidate(db);
238
+ if (ret[1]) {
239
+ throw takeFromExternrefTable0(ret[0]);
240
+ }
241
+ }
242
+
243
+ /**
244
+ * Linear-memory size for authenticated operator soak diagnostics. This is a
245
+ * byte count only; it contains no application or query data.
246
+ * @returns {number}
247
+ */
248
+ export function engine_memory_bytes() {
249
+ const ret = wasm.engine_memory_bytes();
250
+ if (ret[2]) {
251
+ throw takeFromExternrefTable0(ret[1]);
252
+ }
253
+ return ret[0] >>> 0;
254
+ }
255
+
256
+ /**
257
+ * @param {any} db
258
+ * @param {string} client_group_id
259
+ * @param {string} client_id
260
+ * @param {string} mutation_id
261
+ * @param {string} user_id
262
+ * @returns {any}
263
+ */
264
+ export function engine_preflight(db, client_group_id, client_id, mutation_id, user_id) {
265
+ const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
266
+ const len0 = WASM_VECTOR_LEN;
267
+ const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
268
+ const len1 = WASM_VECTOR_LEN;
269
+ const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
270
+ const len2 = WASM_VECTOR_LEN;
271
+ const ptr3 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
272
+ const len3 = WASM_VECTOR_LEN;
273
+ const ret = wasm.engine_preflight(db, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
274
+ if (ret[2]) {
275
+ throw takeFromExternrefTable0(ret[1]);
276
+ }
277
+ return takeFromExternrefTable0(ret[0]);
278
+ }
279
+
280
+ /**
281
+ * @param {any} db
282
+ * @param {string} retain_changes
283
+ */
284
+ export function engine_prune(db, retain_changes) {
285
+ const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
286
+ const len0 = WASM_VECTOR_LEN;
287
+ const ret = wasm.engine_prune(db, ptr0, len0);
288
+ if (ret[1]) {
289
+ throw takeFromExternrefTable0(ret[0]);
290
+ }
291
+ }
292
+
293
+ /**
294
+ * Validate an entire push before the host opens the first mutation tx.
295
+ * @param {any} body
296
+ * @returns {any}
297
+ */
298
+ export function engine_push_validate(body) {
299
+ const ret = wasm.engine_push_validate(body);
300
+ if (ret[2]) {
301
+ throw takeFromExternrefTable0(ret[1]);
302
+ }
303
+ return takeFromExternrefTable0(ret[0]);
304
+ }
305
+
306
+ /**
307
+ * Strictly read resumable snapshot progress. Storage and row-shape failures
308
+ * are errors; only a successful query with no active row returns null.
309
+ * @param {any} db
310
+ * @returns {any}
311
+ */
312
+ export function engine_read_snapshot_progress(db) {
313
+ const ret = wasm.engine_read_snapshot_progress(db);
314
+ if (ret[2]) {
315
+ throw takeFromExternrefTable0(ret[1]);
316
+ }
317
+ return takeFromExternrefTable0(ret[0]);
318
+ }
319
+
320
+ /**
321
+ * @param {any} db
322
+ * @param {string} client_group_id
323
+ * @param {string} client_id
324
+ * @param {string} mutation_id
325
+ * @param {string} user_id
326
+ */
327
+ export function engine_record_app_error(db, client_group_id, client_id, mutation_id, user_id) {
328
+ const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
329
+ const len0 = WASM_VECTOR_LEN;
330
+ const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
331
+ const len1 = WASM_VECTOR_LEN;
332
+ const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
333
+ const len2 = WASM_VECTOR_LEN;
334
+ const ptr3 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
335
+ const len3 = WASM_VECTOR_LEN;
336
+ const ret = wasm.engine_record_app_error(db, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
337
+ if (ret[1]) {
338
+ throw takeFromExternrefTable0(ret[0]);
339
+ }
340
+ }
341
+
342
+ /**
343
+ * @param {any} db
344
+ * @returns {any}
345
+ */
346
+ export function engine_state(db) {
347
+ const ret = wasm.engine_state(db);
348
+ if (ret[2]) {
349
+ throw takeFromExternrefTable0(ret[1]);
350
+ }
351
+ return takeFromExternrefTable0(ret[0]);
352
+ }
353
+
354
+ /**
355
+ * @returns {string}
356
+ */
357
+ export function engine_version() {
358
+ let deferred1_0;
359
+ let deferred1_1;
360
+ try {
361
+ const ret = wasm.engine_version();
362
+ deferred1_0 = ret[0];
363
+ deferred1_1 = ret[1];
364
+ return getStringFromWasm0(ret[0], ret[1]);
365
+ } finally {
366
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
367
+ }
368
+ }
369
+ export function __wbg_Error_92b29b0548f8b746(arg0, arg1) {
370
+ const ret = Error(getStringFromWasm0(arg0, arg1));
371
+ return ret;
372
+ }
373
+ export function __wbg_Number_9a4e0ecb0fa16705(arg0) {
374
+ const ret = Number(arg0);
375
+ return ret;
376
+ }
377
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
378
+ const ret = String(arg1);
379
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
380
+ const len1 = WASM_VECTOR_LEN;
381
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
382
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
383
+ }
384
+ export function __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f(arg0, arg1) {
385
+ const v = arg1;
386
+ const ret = typeof(v) === 'bigint' ? v : undefined;
387
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
388
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
389
+ }
390
+ export function __wbg___wbindgen_boolean_get_fa956cfa2d1bd751(arg0) {
391
+ const v = arg0;
392
+ const ret = typeof(v) === 'boolean' ? v : undefined;
393
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
394
+ }
395
+ export function __wbg___wbindgen_debug_string_c25d447a39f5578f(arg0, arg1) {
396
+ const ret = debugString(arg1);
397
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
398
+ const len1 = WASM_VECTOR_LEN;
399
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
400
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
401
+ }
402
+ export function __wbg___wbindgen_in_aca499c5de7ff5e5(arg0, arg1) {
403
+ const ret = arg0 in arg1;
404
+ return ret;
405
+ }
406
+ export function __wbg___wbindgen_is_bigint_2f76dc55065b4273(arg0) {
407
+ const ret = typeof(arg0) === 'bigint';
408
+ return ret;
409
+ }
410
+ export function __wbg___wbindgen_is_function_1ff95bcc5517c252(arg0) {
411
+ const ret = typeof(arg0) === 'function';
412
+ return ret;
413
+ }
414
+ export function __wbg___wbindgen_is_object_a27215656b807791(arg0) {
415
+ const val = arg0;
416
+ const ret = typeof(val) === 'object' && val !== null;
417
+ return ret;
418
+ }
419
+ export function __wbg___wbindgen_is_string_ea5e6cc2e4141dfe(arg0) {
420
+ const ret = typeof(arg0) === 'string';
421
+ return ret;
422
+ }
423
+ export function __wbg___wbindgen_is_undefined_c05833b95a3cf397(arg0) {
424
+ const ret = arg0 === undefined;
425
+ return ret;
426
+ }
427
+ export function __wbg___wbindgen_jsval_eq_e659fcf7b0e32763(arg0, arg1) {
428
+ const ret = arg0 === arg1;
429
+ return ret;
430
+ }
431
+ export function __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170(arg0, arg1) {
432
+ const ret = arg0 == arg1;
433
+ return ret;
434
+ }
435
+ export function __wbg___wbindgen_memory_de265df8aadd6273() {
436
+ const ret = wasm.memory;
437
+ return ret;
438
+ }
439
+ export function __wbg___wbindgen_number_get_394265ed1e1b84ee(arg0, arg1) {
440
+ const obj = arg1;
441
+ const ret = typeof(obj) === 'number' ? obj : undefined;
442
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
443
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
444
+ }
445
+ export function __wbg___wbindgen_string_get_b0ca35b86a603356(arg0, arg1) {
446
+ const obj = arg1;
447
+ const ret = typeof(obj) === 'string' ? obj : undefined;
448
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
449
+ var len1 = WASM_VECTOR_LEN;
450
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
451
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
452
+ }
453
+ export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
454
+ throw new Error(getStringFromWasm0(arg0, arg1));
455
+ }
456
+ export function __wbg_buffer_0f212447ac64c53b(arg0) {
457
+ const ret = arg0.buffer;
458
+ return ret;
459
+ }
460
+ export function __wbg_byteLength_47eafd0bff4dce39(arg0) {
461
+ const ret = arg0.byteLength;
462
+ return ret;
463
+ }
464
+ export function __wbg_call_8a2dd23819f8a60a() { return handleError(function (arg0, arg1) {
465
+ const ret = arg0.call(arg1);
466
+ return ret;
467
+ }, arguments); }
468
+ export function __wbg_done_89b2b13e91a60321(arg0) {
469
+ const ret = arg0.done;
470
+ return ret;
471
+ }
472
+ export function __wbg_entries_015dc610cd81ede0(arg0) {
473
+ const ret = Object.entries(arg0);
474
+ return ret;
475
+ }
476
+ export function __wbg_exec_0b4e8f9e7a8c0e02() { return handleError(function (arg0, arg1, arg2, arg3) {
477
+ arg0.exec(getStringFromWasm0(arg1, arg2), arg3);
478
+ }, arguments); }
479
+ export function __wbg_get_507a50627bffa49b(arg0, arg1) {
480
+ const ret = arg0[arg1 >>> 0];
481
+ return ret;
482
+ }
483
+ export function __wbg_get_c7eb1f358a7654df() { return handleError(function (arg0, arg1) {
484
+ const ret = Reflect.get(arg0, arg1);
485
+ return ret;
486
+ }, arguments); }
487
+ export function __wbg_get_unchecked_6e0ad6d2a41b06f6(arg0, arg1) {
488
+ const ret = arg0[arg1 >>> 0];
489
+ return ret;
490
+ }
491
+ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
492
+ const ret = arg0[arg1];
493
+ return ret;
494
+ }
495
+ export function __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb(arg0) {
496
+ let result;
497
+ try {
498
+ result = arg0 instanceof ArrayBuffer;
499
+ } catch (_) {
500
+ result = false;
501
+ }
502
+ const ret = result;
503
+ return ret;
504
+ }
505
+ export function __wbg_instanceof_Map_e5b5e3db98422fcc(arg0) {
506
+ let result;
507
+ try {
508
+ result = arg0 instanceof Map;
509
+ } catch (_) {
510
+ result = false;
511
+ }
512
+ const ret = result;
513
+ return ret;
514
+ }
515
+ export function __wbg_instanceof_Memory_2550e651acb3f2f1(arg0) {
516
+ let result;
517
+ try {
518
+ result = arg0 instanceof WebAssembly.Memory;
519
+ } catch (_) {
520
+ result = false;
521
+ }
522
+ const ret = result;
523
+ return ret;
524
+ }
525
+ export function __wbg_instanceof_Uint8Array_309b927aaf7a3fc7(arg0) {
526
+ let result;
527
+ try {
528
+ result = arg0 instanceof Uint8Array;
529
+ } catch (_) {
530
+ result = false;
531
+ }
532
+ const ret = result;
533
+ return ret;
534
+ }
535
+ export function __wbg_isArray_0677c962b281d01a(arg0) {
536
+ const ret = Array.isArray(arg0);
537
+ return ret;
538
+ }
539
+ export function __wbg_isSafeInteger_04f36e4056f1b851(arg0) {
540
+ const ret = Number.isSafeInteger(arg0);
541
+ return ret;
542
+ }
543
+ export function __wbg_iterator_6f722e4a93058b71() {
544
+ const ret = Symbol.iterator;
545
+ return ret;
546
+ }
547
+ export function __wbg_length_1f0964f4a5e2c6d8(arg0) {
548
+ const ret = arg0.length;
549
+ return ret;
550
+ }
551
+ export function __wbg_length_370319915dc99107(arg0) {
552
+ const ret = arg0.length;
553
+ return ret;
554
+ }
555
+ export function __wbg_new_32b398fb48b6d94a() {
556
+ const ret = new Array();
557
+ return ret;
558
+ }
559
+ export function __wbg_new_7796ffc7ed656783() {
560
+ const ret = new Map();
561
+ return ret;
562
+ }
563
+ export function __wbg_new_b667d279fd5aa943(arg0, arg1) {
564
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
565
+ return ret;
566
+ }
567
+ export function __wbg_new_cd45aabdf6073e84(arg0) {
568
+ const ret = new Uint8Array(arg0);
569
+ return ret;
570
+ }
571
+ export function __wbg_new_da52cf8fe3429cb2() {
572
+ const ret = new Object();
573
+ return ret;
574
+ }
575
+ export function __wbg_next_6dbf2c0ac8cde20f(arg0) {
576
+ const ret = arg0.next;
577
+ return ret;
578
+ }
579
+ export function __wbg_next_71f2aa1cb3d1e37e() { return handleError(function (arg0) {
580
+ const ret = arg0.next();
581
+ return ret;
582
+ }, arguments); }
583
+ export function __wbg_prototypesetcall_4770620bbe4688a0(arg0, arg1, arg2) {
584
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
585
+ }
586
+ export function __wbg_query_61b60d4aa0a8eccc() { return handleError(function (arg0, arg1, arg2, arg3) {
587
+ const ret = arg0.query(getStringFromWasm0(arg1, arg2), arg3);
588
+ return ret;
589
+ }, arguments); }
590
+ export function __wbg_set_575dd786d51585f8(arg0, arg1, arg2) {
591
+ const ret = arg0.set(arg1, arg2);
592
+ return ret;
593
+ }
594
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
595
+ arg0[arg1] = arg2;
596
+ }
597
+ export function __wbg_set_8535240470bf2500() { return handleError(function (arg0, arg1, arg2) {
598
+ const ret = Reflect.set(arg0, arg1, arg2);
599
+ return ret;
600
+ }, arguments); }
601
+ export function __wbg_set_8a16b38e4805b298(arg0, arg1, arg2) {
602
+ arg0[arg1 >>> 0] = arg2;
603
+ }
604
+ export function __wbg_value_a5d5488a9589444a(arg0) {
605
+ const ret = arg0.value;
606
+ return ret;
607
+ }
608
+ export function __wbindgen_cast_0000000000000001(arg0) {
609
+ // Cast intrinsic for `F64 -> Externref`.
610
+ const ret = arg0;
611
+ return ret;
612
+ }
613
+ export function __wbindgen_cast_0000000000000002(arg0) {
614
+ // Cast intrinsic for `I64 -> Externref`.
615
+ const ret = arg0;
616
+ return ret;
617
+ }
618
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
619
+ // Cast intrinsic for `Ref(String) -> Externref`.
620
+ const ret = getStringFromWasm0(arg0, arg1);
621
+ return ret;
622
+ }
623
+ export function __wbindgen_cast_0000000000000004(arg0) {
624
+ // Cast intrinsic for `U64 -> Externref`.
625
+ const ret = BigInt.asUintN(64, arg0);
626
+ return ret;
627
+ }
628
+ export function __wbindgen_init_externref_table() {
629
+ const table = wasm.__wbindgen_externrefs;
630
+ const offset = table.grow(4);
631
+ table.set(0, undefined);
632
+ table.set(offset + 0, undefined);
633
+ table.set(offset + 1, null);
634
+ table.set(offset + 2, true);
635
+ table.set(offset + 3, false);
636
+ }
637
+ function addToExternrefTable0(obj) {
638
+ const idx = wasm.__externref_table_alloc();
639
+ wasm.__wbindgen_externrefs.set(idx, obj);
640
+ return idx;
641
+ }
642
+
643
+ function debugString(val) {
644
+ // primitive types
645
+ const type = typeof val;
646
+ if (type == 'number' || type == 'boolean' || val == null) {
647
+ return `${val}`;
648
+ }
649
+ if (type == 'string') {
650
+ return `"${val}"`;
651
+ }
652
+ if (type == 'symbol') {
653
+ const description = val.description;
654
+ if (description == null) {
655
+ return 'Symbol';
656
+ } else {
657
+ return `Symbol(${description})`;
658
+ }
659
+ }
660
+ if (type == 'function') {
661
+ const name = val.name;
662
+ if (typeof name == 'string' && name.length > 0) {
663
+ return `Function(${name})`;
664
+ } else {
665
+ return 'Function';
666
+ }
667
+ }
668
+ // objects
669
+ if (Array.isArray(val)) {
670
+ const length = val.length;
671
+ let debug = '[';
672
+ if (length > 0) {
673
+ debug += debugString(val[0]);
674
+ }
675
+ for(let i = 1; i < length; i++) {
676
+ debug += ', ' + debugString(val[i]);
677
+ }
678
+ debug += ']';
679
+ return debug;
680
+ }
681
+ // Test for built-in
682
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
683
+ let className;
684
+ if (builtInMatches && builtInMatches.length > 1) {
685
+ className = builtInMatches[1];
686
+ } else {
687
+ // Failed to match the standard '[object ClassName]'
688
+ return toString.call(val);
689
+ }
690
+ if (className == 'Object') {
691
+ // we're a user defined class or Object
692
+ // JSON.stringify avoids problems with cycles, and is generally much
693
+ // easier than looping through ownProperties of `val`.
694
+ try {
695
+ return 'Object(' + JSON.stringify(val) + ')';
696
+ } catch (_) {
697
+ return 'Object';
698
+ }
699
+ }
700
+ // errors
701
+ if (val instanceof Error) {
702
+ return `${val.name}: ${val.message}\n${val.stack}`;
703
+ }
704
+ // TODO we could test for more things here, like `Set`s and `Map`s.
705
+ return className;
706
+ }
707
+
708
+ function getArrayU8FromWasm0(ptr, len) {
709
+ ptr = ptr >>> 0;
710
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
711
+ }
712
+
713
+ let cachedDataViewMemory0 = null;
714
+ function getDataViewMemory0() {
715
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
716
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
717
+ }
718
+ return cachedDataViewMemory0;
719
+ }
720
+
721
+ function getStringFromWasm0(ptr, len) {
722
+ return decodeText(ptr >>> 0, len);
723
+ }
724
+
725
+ let cachedUint8ArrayMemory0 = null;
726
+ function getUint8ArrayMemory0() {
727
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
728
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
729
+ }
730
+ return cachedUint8ArrayMemory0;
731
+ }
732
+
733
+ function handleError(f, args) {
734
+ try {
735
+ return f.apply(this, args);
736
+ } catch (e) {
737
+ const idx = addToExternrefTable0(e);
738
+ wasm.__wbindgen_exn_store(idx);
739
+ }
740
+ }
741
+
742
+ function isLikeNone(x) {
743
+ return x === undefined || x === null;
744
+ }
745
+
746
+ function passStringToWasm0(arg, malloc, realloc) {
747
+ if (realloc === undefined) {
748
+ const buf = cachedTextEncoder.encode(arg);
749
+ const ptr = malloc(buf.length, 1) >>> 0;
750
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
751
+ WASM_VECTOR_LEN = buf.length;
752
+ return ptr;
753
+ }
754
+
755
+ let len = arg.length;
756
+ let ptr = malloc(len, 1) >>> 0;
757
+
758
+ const mem = getUint8ArrayMemory0();
759
+
760
+ let offset = 0;
761
+
762
+ for (; offset < len; offset++) {
763
+ const code = arg.charCodeAt(offset);
764
+ if (code > 0x7F) break;
765
+ mem[ptr + offset] = code;
766
+ }
767
+ if (offset !== len) {
768
+ if (offset !== 0) {
769
+ arg = arg.slice(offset);
770
+ }
771
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
772
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
773
+ const ret = cachedTextEncoder.encodeInto(arg, view);
774
+
775
+ offset += ret.written;
776
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
777
+ }
778
+
779
+ WASM_VECTOR_LEN = offset;
780
+ return ptr;
781
+ }
782
+
783
+ function takeFromExternrefTable0(idx) {
784
+ const value = wasm.__wbindgen_externrefs.get(idx);
785
+ wasm.__externref_table_dealloc(idx);
786
+ return value;
787
+ }
788
+
789
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
790
+ cachedTextDecoder.decode();
791
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
792
+ let numBytesDecoded = 0;
793
+ function decodeText(ptr, len) {
794
+ numBytesDecoded += len;
795
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
796
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
797
+ cachedTextDecoder.decode();
798
+ numBytesDecoded = len;
799
+ }
800
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
801
+ }
802
+
803
+ const cachedTextEncoder = new TextEncoder();
804
+
805
+ if (!('encodeInto' in cachedTextEncoder)) {
806
+ cachedTextEncoder.encodeInto = function (arg, view) {
807
+ const buf = cachedTextEncoder.encode(arg);
808
+ view.set(buf);
809
+ return {
810
+ read: arg.length,
811
+ written: buf.length
812
+ };
813
+ };
814
+ }
815
+
816
+ let WASM_VECTOR_LEN = 0;
817
+
818
+
819
+ let wasm;
820
+ export function __wbg_set_wasm(val) {
821
+ wasm = val;
822
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orez-sync-cf-host",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "scripts": {
40
40
  "build:dependencies": "bun run --cwd ../sync-executor build",
41
- "build:wasm": "wasm-pack build ../../crates/sync-wasm --target web --release --out-dir ../../packages/sync-cf-host/src/generated --out-name sync_wasm && rm -f src/generated/.gitignore && bun scripts/write-wasm-module-type.ts",
42
- "build:wasm:platform": "wasm-pack build ../../crates/sync-wasm --target web --release --out-dir ../../packages/sync-cf-host/src/generated --out-name sync_wasm -- --features platform-probes && rm -f src/generated/.gitignore && bun scripts/write-wasm-module-type.ts",
41
+ "build:wasm": "wasm-pack build ../../crates/sync-wasm --target web --release --out-dir ../../packages/sync-cf-host/src/generated --out-name sync_wasm && rm -f src/generated/.gitignore && bun scripts/finish-wasm-build.ts",
42
+ "build:wasm:platform": "wasm-pack build ../../crates/sync-wasm --target web --release --out-dir ../../packages/sync-cf-host/src/generated --out-name sync_wasm -- --features platform-probes && rm -f src/generated/.gitignore && bun scripts/finish-wasm-build.ts --platform-probes",
43
43
  "build:runtime": "rm -rf dist && mkdir -p dist && cp -R src/generated dist/generated && tsc -p tsconfig.build.json",
44
44
  "build:dist": "bun run build:dependencies && bun run build:wasm && bun run build:runtime",
45
45
  "build:dist:platform": "bun run build:dependencies && bun run build:wasm:platform && bun run build:runtime",
@@ -56,7 +56,7 @@
56
56
  "typecheck": "bun run build:dist:platform && tsc --noEmit"
57
57
  },
58
58
  "dependencies": {
59
- "orez-sync-executor": "0.10.5"
59
+ "orez-sync-executor": "0.10.6"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@cloudflare/workers-types": "4.20260617.1",