@rivetkit/rivetkit-wasm 0.0.0-pr.4880.b43a278 → 0.0.0-pr.4931.24d1999

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-wasm",
3
- "version": "0.0.0-pr.4880.b43a278",
3
+ "version": "0.0.0-pr.4931.24d1999",
4
4
  "description": "WebAssembly bindings for RivetKit core on edge JavaScript runtimes",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -36,6 +36,7 @@
36
36
  "prepack": "node scripts/build.mjs"
37
37
  },
38
38
  "devDependencies": {
39
- "typescript": "^5.9.2"
39
+ "typescript": "^5.9.2",
40
+ "wasm-pack": "0.14.0"
40
41
  }
41
42
  }
@@ -1,9 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function awaitPromise(promise: Promise<any>): Promise<any>;
4
+ export function roundTripBytes(bytes: Uint8Array): Uint8Array;
3
5
  export function start(): void;
4
6
  export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
5
- export function roundTripBytes(bytes: Uint8Array): Uint8Array;
6
- export function awaitPromise(promise: Promise<any>): Promise<any>;
7
7
  export function bridgeRivetErrorPrefix(): string;
8
8
  export class ActorContext {
9
9
  free(): void;
@@ -115,7 +115,6 @@ export class Schedule {
115
115
  export class SqliteDb {
116
116
  private constructor();
117
117
  free(): void;
118
- executeWrite(sql: string, params: any): Promise<any>;
119
118
  run(sql: string, params: any): Promise<any>;
120
119
  exec(sql: string): Promise<any>;
121
120
  close(): Promise<void>;
@@ -173,6 +172,7 @@ export interface InitOutput {
173
172
  readonly actorcontext_state: (a: number) => [number, number];
174
173
  readonly actorcontext_takePendingHibernationChanges: (a: number) => any;
175
174
  readonly actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
175
+ readonly actorcontext_waitUntil: (a: number, b: any) => void;
176
176
  readonly actorfactory_new: (a: any, b: any) => [number, number, number];
177
177
  readonly awaitPromise: (a: any) => any;
178
178
  readonly bridgeRivetErrorPrefix: () => [number, number];
@@ -221,7 +221,6 @@ export interface InitOutput {
221
221
  readonly sqlitedb_close: (a: number) => any;
222
222
  readonly sqlitedb_exec: (a: number, b: number, c: number) => any;
223
223
  readonly sqlitedb_execute: (a: number, b: number, c: number, d: any) => any;
224
- readonly sqlitedb_executeWrite: (a: number, b: number, c: number, d: any) => any;
225
224
  readonly sqlitedb_query: (a: number, b: number, c: number, d: any) => any;
226
225
  readonly sqlitedb_run: (a: number, b: number, c: number, d: any) => any;
227
226
  readonly uint8ArrayFromBytes: (a: number, b: number) => any;
@@ -229,7 +228,6 @@ export interface InitOutput {
229
228
  readonly websockethandle_send: (a: number, b: number, c: number, d: number) => [number, number];
230
229
  readonly websockethandle_setEventCallback: (a: number, b: any) => void;
231
230
  readonly start: () => void;
232
- readonly actorcontext_waitUntil: (a: number, b: any) => void;
233
231
  readonly actorcontext_queue: (a: number) => number;
234
232
  readonly actorcontext_schedule: (a: number) => number;
235
233
  readonly __wbg_schedule_free: (a: number, b: number) => void;
@@ -242,9 +240,9 @@ export interface InitOutput {
242
240
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
243
241
  readonly __wbindgen_export_6: WebAssembly.Table;
244
242
  readonly __externref_table_dealloc: (a: number) => void;
245
- readonly closure1552_externref_shim: (a: number, b: number, c: any) => void;
246
- readonly closure1755_externref_shim: (a: number, b: number, c: any) => void;
247
- readonly closure1974_externref_shim: (a: number, b: number, c: any, d: any) => void;
243
+ readonly closure1601_externref_shim: (a: number, b: number, c: any) => void;
244
+ readonly closure1804_externref_shim: (a: number, b: number, c: any) => void;
245
+ readonly closure2017_externref_shim: (a: number, b: number, c: any, d: any) => void;
248
246
  readonly __wbindgen_start: () => void;
249
247
  }
250
248
 
@@ -221,19 +221,12 @@ function _assertClass(instance, klass) {
221
221
  throw new Error(`expected instance of ${klass.name}`);
222
222
  }
223
223
  }
224
-
225
- export function start() {
226
- wasm.start();
227
- }
228
-
229
224
  /**
230
- * @param {Uint8Array} bytes
231
- * @returns {Uint8Array}
225
+ * @param {Promise<any>} promise
226
+ * @returns {Promise<any>}
232
227
  */
233
- export function uint8ArrayFromBytes(bytes) {
234
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
235
- const len0 = WASM_VECTOR_LEN;
236
- const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
228
+ export function awaitPromise(promise) {
229
+ const ret = wasm.awaitPromise(promise);
237
230
  return ret;
238
231
  }
239
232
 
@@ -250,12 +243,18 @@ export function roundTripBytes(bytes) {
250
243
  return v2;
251
244
  }
252
245
 
246
+ export function start() {
247
+ wasm.start();
248
+ }
249
+
253
250
  /**
254
- * @param {Promise<any>} promise
255
- * @returns {Promise<any>}
251
+ * @param {Uint8Array} bytes
252
+ * @returns {Uint8Array}
256
253
  */
257
- export function awaitPromise(promise) {
258
- const ret = wasm.awaitPromise(promise);
254
+ export function uint8ArrayFromBytes(bytes) {
255
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
256
+ const len0 = WASM_VECTOR_LEN;
257
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
259
258
  return ret;
260
259
  }
261
260
 
@@ -276,15 +275,15 @@ export function bridgeRivetErrorPrefix() {
276
275
  }
277
276
 
278
277
  function __wbg_adapter_46(arg0, arg1, arg2) {
279
- wasm.closure1552_externref_shim(arg0, arg1, arg2);
278
+ wasm.closure1601_externref_shim(arg0, arg1, arg2);
280
279
  }
281
280
 
282
281
  function __wbg_adapter_55(arg0, arg1, arg2) {
283
- wasm.closure1755_externref_shim(arg0, arg1, arg2);
282
+ wasm.closure1804_externref_shim(arg0, arg1, arg2);
284
283
  }
285
284
 
286
- function __wbg_adapter_223(arg0, arg1, arg2, arg3) {
287
- wasm.closure1974_externref_shim(arg0, arg1, arg2, arg3);
285
+ function __wbg_adapter_222(arg0, arg1, arg2, arg3) {
286
+ wasm.closure2017_externref_shim(arg0, arg1, arg2, arg3);
288
287
  }
289
288
 
290
289
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -1217,17 +1216,6 @@ export class SqliteDb {
1217
1216
  const ptr = this.__destroy_into_raw();
1218
1217
  wasm.__wbg_sqlitedb_free(ptr, 0);
1219
1218
  }
1220
- /**
1221
- * @param {string} sql
1222
- * @param {any} params
1223
- * @returns {Promise<any>}
1224
- */
1225
- executeWrite(sql, params) {
1226
- const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1227
- const len0 = WASM_VECTOR_LEN;
1228
- const ret = wasm.sqlitedb_executeWrite(this.__wbg_ptr, ptr0, len0, params);
1229
- return ret;
1230
- }
1231
1219
  /**
1232
1220
  * @param {string} sql
1233
1221
  * @param {any} params
@@ -1556,7 +1544,7 @@ function __wbg_get_imports() {
1556
1544
  const a = state0.a;
1557
1545
  state0.a = 0;
1558
1546
  try {
1559
- return __wbg_adapter_223(a, state0.b, arg0, arg1);
1547
+ return __wbg_adapter_222(a, state0.b, arg0, arg1);
1560
1548
  } finally {
1561
1549
  state0.a = a;
1562
1550
  }
@@ -1768,24 +1756,24 @@ function __wbg_get_imports() {
1768
1756
  const ret = false;
1769
1757
  return ret;
1770
1758
  };
1771
- imports.wbg.__wbindgen_closure_wrapper3601 = function(arg0, arg1, arg2) {
1772
- const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1759
+ imports.wbg.__wbindgen_closure_wrapper3766 = function(arg0, arg1, arg2) {
1760
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1773
1761
  return ret;
1774
1762
  };
1775
- imports.wbg.__wbindgen_closure_wrapper3603 = function(arg0, arg1, arg2) {
1776
- const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1763
+ imports.wbg.__wbindgen_closure_wrapper3768 = function(arg0, arg1, arg2) {
1764
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1777
1765
  return ret;
1778
1766
  };
1779
- imports.wbg.__wbindgen_closure_wrapper3605 = function(arg0, arg1, arg2) {
1780
- const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1767
+ imports.wbg.__wbindgen_closure_wrapper3770 = function(arg0, arg1, arg2) {
1768
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1781
1769
  return ret;
1782
1770
  };
1783
- imports.wbg.__wbindgen_closure_wrapper3607 = function(arg0, arg1, arg2) {
1784
- const ret = makeMutClosure(arg0, arg1, 1553, __wbg_adapter_46);
1771
+ imports.wbg.__wbindgen_closure_wrapper3772 = function(arg0, arg1, arg2) {
1772
+ const ret = makeMutClosure(arg0, arg1, 1602, __wbg_adapter_46);
1785
1773
  return ret;
1786
1774
  };
1787
- imports.wbg.__wbindgen_closure_wrapper4200 = function(arg0, arg1, arg2) {
1788
- const ret = makeMutClosure(arg0, arg1, 1756, __wbg_adapter_55);
1775
+ imports.wbg.__wbindgen_closure_wrapper4370 = function(arg0, arg1, arg2) {
1776
+ const ret = makeMutClosure(arg0, arg1, 1805, __wbg_adapter_55);
1789
1777
  return ret;
1790
1778
  };
1791
1779
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -40,6 +40,7 @@ export const actorcontext_sql: (a: number) => number;
40
40
  export const actorcontext_state: (a: number) => [number, number];
41
41
  export const actorcontext_takePendingHibernationChanges: (a: number) => any;
42
42
  export const actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
43
+ export const actorcontext_waitUntil: (a: number, b: any) => void;
43
44
  export const actorfactory_new: (a: any, b: any) => [number, number, number];
44
45
  export const awaitPromise: (a: any) => any;
45
46
  export const bridgeRivetErrorPrefix: () => [number, number];
@@ -88,7 +89,6 @@ export const schedule_at: (a: number, b: number, c: number, d: number, e: number
88
89
  export const sqlitedb_close: (a: number) => any;
89
90
  export const sqlitedb_exec: (a: number, b: number, c: number) => any;
90
91
  export const sqlitedb_execute: (a: number, b: number, c: number, d: any) => any;
91
- export const sqlitedb_executeWrite: (a: number, b: number, c: number, d: any) => any;
92
92
  export const sqlitedb_query: (a: number, b: number, c: number, d: any) => any;
93
93
  export const sqlitedb_run: (a: number, b: number, c: number, d: any) => any;
94
94
  export const uint8ArrayFromBytes: (a: number, b: number) => any;
@@ -96,7 +96,6 @@ export const websockethandle_close: (a: number, b: number, c: number, d: number)
96
96
  export const websockethandle_send: (a: number, b: number, c: number, d: number) => [number, number];
97
97
  export const websockethandle_setEventCallback: (a: number, b: any) => void;
98
98
  export const start: () => void;
99
- export const actorcontext_waitUntil: (a: number, b: any) => void;
100
99
  export const actorcontext_queue: (a: number) => number;
101
100
  export const actorcontext_schedule: (a: number) => number;
102
101
  export const __wbg_schedule_free: (a: number, b: number) => void;
@@ -109,7 +108,7 @@ export const __wbindgen_export_4: WebAssembly.Table;
109
108
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
110
109
  export const __wbindgen_export_6: WebAssembly.Table;
111
110
  export const __externref_table_dealloc: (a: number) => void;
112
- export const closure1552_externref_shim: (a: number, b: number, c: any) => void;
113
- export const closure1755_externref_shim: (a: number, b: number, c: any) => void;
114
- export const closure1974_externref_shim: (a: number, b: number, c: any, d: any) => void;
111
+ export const closure1601_externref_shim: (a: number, b: number, c: any) => void;
112
+ export const closure1804_externref_shim: (a: number, b: number, c: any) => void;
113
+ export const closure2017_externref_shim: (a: number, b: number, c: any, d: any) => void;
115
114
  export const __wbindgen_start: () => void;
package/scripts/build.mjs CHANGED
@@ -1,11 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import { execFileSync } from "node:child_process";
3
3
  import { existsSync } from "node:fs";
4
+ import { createRequire } from "node:module";
4
5
  import { dirname, join } from "node:path";
5
6
  import { fileURLToPath } from "node:url";
6
7
 
7
8
  const packageDir = dirname(dirname(fileURLToPath(import.meta.url)));
8
9
  const pkgDir = join(packageDir, "pkg");
10
+ const require = createRequire(import.meta.url);
11
+
12
+ function resolveWasmPackBin() {
13
+ try {
14
+ const packageJsonPath = require.resolve("wasm-pack/package.json", {
15
+ paths: [packageDir],
16
+ });
17
+ return join(dirname(packageJsonPath), "run.js");
18
+ } catch (err) {
19
+ throw new Error(
20
+ "Missing pinned wasm-pack dependency. Run pnpm install before building @rivetkit/rivetkit-wasm.",
21
+ { cause: err },
22
+ );
23
+ }
24
+ }
9
25
 
10
26
  if (["1", "true"].includes(process.env.SKIP_WASM_BUILD ?? "")) {
11
27
  const hasPkg = existsSync(join(pkgDir, "rivetkit_wasm.js"));
@@ -33,7 +49,6 @@ if (!outDir) {
33
49
  }
34
50
 
35
51
  const cmd = [
36
- "wasm-pack",
37
52
  "build",
38
53
  "--target",
39
54
  target,
@@ -43,5 +58,7 @@ const cmd = [
43
58
  "rivetkit_wasm",
44
59
  ];
45
60
 
46
- console.log(`[rivetkit-wasm/build] running: ${cmd.join(" ")}`);
47
- execFileSync("npx", ["-y", ...cmd], { stdio: "inherit" });
61
+ const wasmPackBin = resolveWasmPackBin();
62
+
63
+ console.log(`[rivetkit-wasm/build] running: wasm-pack ${cmd.join(" ")}`);
64
+ execFileSync(process.execPath, [wasmPackBin, ...cmd], { stdio: "inherit" });