@rivetkit/rivetkit-wasm 0.0.0-skip-ready-wait-flatten-client-options.1cae221 → 0.0.0-sqlite-uds.ea644f1

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/index.d.ts CHANGED
@@ -1,2 +1,176 @@
1
- export * from "./pkg/rivetkit_wasm.js";
2
- export { default } from "./pkg/rivetkit_wasm.js";
1
+ export function start(): void;
2
+ export function awaitPromise(promise: Promise<any>): Promise<any>;
3
+ export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
4
+ export function bridgeRivetErrorPrefix(): string;
5
+ export function roundTripBytes(bytes: Uint8Array): Uint8Array;
6
+
7
+ export class ActorContext {
8
+ free(): void;
9
+ keepAwake(promise: Promise<any>): void;
10
+ saveState(payload: any): Promise<void>;
11
+ waitUntil(promise: Promise<any>): void;
12
+ abortSignal(): any;
13
+ connectConn(params: Uint8Array, request: any): Promise<ConnHandle>;
14
+ requestSave(opts: any): void;
15
+ registerTask(promise: Promise<any>): void;
16
+ runtimeState(): any;
17
+ endKeepAwake(region_id: number): void;
18
+ beginKeepAwake(): number;
19
+ inspectorSnapshot(): object;
20
+ endOnStateChange(): void;
21
+ restartRunHandler(): void;
22
+ beginOnStateChange(): void;
23
+ requestSaveAndWait(opts: any): Promise<void>;
24
+ verifyInspectorAuth(bearer_token?: string | null): Promise<void>;
25
+ endWebsocketCallback(region_id: number): void;
26
+ beginWebsocketCallback(): number;
27
+ dirtyHibernatableConns(): Array<any>;
28
+ kv(): Kv;
29
+ waitForTrackedShutdownWork(): Promise<boolean>;
30
+ takePendingHibernationChanges(): Array<any>;
31
+ key(): any;
32
+ constructor();
33
+ sql(): SqliteDb;
34
+ name(): string;
35
+ conns(): Array<any>;
36
+ queue(): Queue;
37
+ sleep(): void;
38
+ state(): Uint8Array;
39
+ region(): string;
40
+ destroy(): void;
41
+ actorId(): string;
42
+ schedule(): Schedule;
43
+ broadcast(name: string, args: Uint8Array): void;
44
+ setAlarm(timestamp_ms?: number | null): void;
45
+ }
46
+
47
+ export class ActorFactory {
48
+ free(): void;
49
+ constructor(callbacks: any, config: any);
50
+ }
51
+
52
+ export class CancellationToken {
53
+ free(): void;
54
+ onCancelled(callback: Function): void;
55
+ constructor();
56
+ cancel(): void;
57
+ aborted(): boolean;
58
+ }
59
+
60
+ export class ConnHandle {
61
+ private constructor();
62
+ free(): void;
63
+ disconnect(reason?: string | null): Promise<void>;
64
+ isHibernatable(): boolean;
65
+ id(): string;
66
+ send(name: string, args: Uint8Array): void;
67
+ state(): Uint8Array;
68
+ params(): Uint8Array;
69
+ setState(state: Uint8Array): void;
70
+ }
71
+
72
+ export class CoreRegistry {
73
+ free(): void;
74
+ handleServerlessRequest(
75
+ req: any,
76
+ on_stream_event: Function,
77
+ cancel_token: CancellationToken,
78
+ config: any,
79
+ ): Promise<any>;
80
+ constructor();
81
+ serve(config: any): Promise<void>;
82
+ register(name: string, factory: ActorFactory): void;
83
+ shutdown(): Promise<void>;
84
+ }
85
+
86
+ export class Kv {
87
+ private constructor();
88
+ free(): void;
89
+ delete(key: Uint8Array): Promise<void>;
90
+ listRange(start: Uint8Array, end: Uint8Array, options: any): Promise<any>;
91
+ listPrefix(prefix: Uint8Array, options: any): Promise<any>;
92
+ batchDelete(keys: Array<any>): Promise<void>;
93
+ deleteRange(start: Uint8Array, end: Uint8Array): Promise<void>;
94
+ get(key: Uint8Array): Promise<any>;
95
+ put(key: Uint8Array, value: Uint8Array): Promise<void>;
96
+ batchGet(keys: Array<any>): Promise<any>;
97
+ batchPut(entries: Array<any>): Promise<void>;
98
+ }
99
+
100
+ export class Queue {
101
+ private constructor();
102
+ free(): void;
103
+ nextBatch(
104
+ options: any,
105
+ signal?: CancellationToken | null,
106
+ ): Promise<Array<any>>;
107
+ tryNextBatch(options: any): Array<any>;
108
+ waitForNames(
109
+ names: any,
110
+ options: any,
111
+ signal?: CancellationToken | null,
112
+ ): Promise<QueueMessage>;
113
+ enqueueAndWait(
114
+ name: string,
115
+ body: Uint8Array,
116
+ options: any,
117
+ signal?: CancellationToken | null,
118
+ ): Promise<Uint8Array | undefined>;
119
+ inspectMessages(): Promise<Array<any>>;
120
+ waitForNamesAvailable(names: any, options: any): Promise<void>;
121
+ send(name: string, body: Uint8Array): Promise<QueueMessage>;
122
+ maxSize(): number;
123
+ reset(): Promise<void>;
124
+ }
125
+
126
+ export class QueueMessage {
127
+ private constructor();
128
+ free(): void;
129
+ createdAt(): number;
130
+ isCompletable(): boolean;
131
+ id(): bigint;
132
+ body(): Uint8Array;
133
+ name(): string;
134
+ complete(response: any): Promise<void>;
135
+ }
136
+
137
+ export class Schedule {
138
+ private constructor();
139
+ free(): void;
140
+ at(timestamp_ms: number, action_name: string, args: Uint8Array): void;
141
+ after(duration_ms: number, action_name: string, args: Uint8Array): void;
142
+ }
143
+
144
+ export class SqliteDb {
145
+ private constructor();
146
+ free(): void;
147
+ run(sql: string, params: any): Promise<any>;
148
+ exec(sql: string): Promise<any>;
149
+ close(): Promise<void>;
150
+ query(sql: string, params: any): Promise<any>;
151
+ execute(sql: string, params: any): Promise<any>;
152
+ }
153
+
154
+ export class WebSocketHandle {
155
+ private constructor();
156
+ free(): void;
157
+ setEventCallback(callback: Function): void;
158
+ send(data: Uint8Array, binary: boolean): void;
159
+ close(code?: number | null, reason?: string | null): Promise<void>;
160
+ }
161
+
162
+ export type InitInput =
163
+ | RequestInfo
164
+ | URL
165
+ | Response
166
+ | BufferSource
167
+ | WebAssembly.Module;
168
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
169
+ export interface InitOutput {
170
+ readonly memory: WebAssembly.Memory;
171
+ }
172
+
173
+ declare function init(
174
+ module_or_path?: InitInput | Promise<InitInput>,
175
+ ): Promise<InitOutput>;
176
+ export default init;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-wasm",
3
- "version": "0.0.0-skip-ready-wait-flatten-client-options.1cae221",
3
+ "version": "0.0.0-sqlite-uds.ea644f1",
4
4
  "description": "WebAssembly bindings for RivetKit core on edge JavaScript runtimes",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -28,6 +28,7 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "build": "node scripts/build.mjs",
31
+ "build:embed": "node scripts/build.mjs",
31
32
  "build:cloudflare": "node scripts/build.mjs --target bundler --out-dir pkg-cloudflare",
32
33
  "build:deno": "node scripts/build.mjs --target web --out-dir pkg-deno",
33
34
  "check:package": "node scripts/check-package.mjs",
@@ -37,6 +38,6 @@
37
38
  },
38
39
  "devDependencies": {
39
40
  "typescript": "^5.9.2",
40
- "wasm-pack": "0.14.0"
41
+ "wasm-pack": "0.15.0"
41
42
  }
42
43
  }
@@ -1,13 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function awaitPromise(promise: Promise<any>): Promise<any>;
4
3
  export function roundTripBytes(bytes: Uint8Array): Uint8Array;
5
4
  export function start(): void;
6
- export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
5
+ export function awaitPromise(promise: Promise<any>): Promise<any>;
7
6
  export function bridgeRivetErrorPrefix(): string;
7
+ export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
8
8
  export class ActorContext {
9
9
  free(): void;
10
- keepAwake(_promise: Promise<any>): void;
10
+ keepAwake(promise: Promise<any>): void;
11
11
  saveState(payload: any): Promise<void>;
12
12
  waitUntil(promise: Promise<any>): void;
13
13
  abortSignal(): any;
@@ -27,10 +27,12 @@ export class ActorContext {
27
27
  beginWebsocketCallback(): number;
28
28
  dirtyHibernatableConns(): Array<any>;
29
29
  kv(): Kv;
30
+ waitForTrackedShutdownWork(): Promise<boolean>;
30
31
  takePendingHibernationChanges(): Array<any>;
31
32
  key(): any;
32
33
  constructor();
33
34
  sql(): SqliteDb;
35
+ waitForTrackedShutdownWorkUnbounded(): Promise<void>;
34
36
  name(): string;
35
37
  conns(): Array<any>;
36
38
  queue(): Queue;
@@ -96,6 +98,7 @@ export class Queue {
96
98
  inspectMessages(): Promise<Array<any>>;
97
99
  waitForNamesAvailable(names: any, options: any): Promise<void>;
98
100
  send(name: string, body: Uint8Array): Promise<QueueMessage>;
101
+ reset(): Promise<void>;
99
102
  maxSize(): number;
100
103
  }
101
104
  export class QueueMessage {
@@ -176,6 +179,8 @@ export interface InitOutput {
176
179
  readonly actorcontext_state: (a: number) => [number, number];
177
180
  readonly actorcontext_takePendingHibernationChanges: (a: number) => any;
178
181
  readonly actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
182
+ readonly actorcontext_waitForTrackedShutdownWork: (a: number) => any;
183
+ readonly actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
179
184
  readonly actorcontext_waitUntil: (a: number, b: any) => void;
180
185
  readonly actorfactory_new: (a: any, b: any) => [number, number, number];
181
186
  readonly awaitPromise: (a: any) => any;
@@ -209,6 +214,7 @@ export interface InitOutput {
209
214
  readonly queue_inspectMessages: (a: number) => any;
210
215
  readonly queue_maxSize: (a: number) => number;
211
216
  readonly queue_nextBatch: (a: number, b: any, c: number) => any;
217
+ readonly queue_reset: (a: number) => any;
212
218
  readonly queue_send: (a: number, b: number, c: number, d: number, e: number) => any;
213
219
  readonly queue_tryNextBatch: (a: number, b: any) => [number, number, number];
214
220
  readonly queue_waitForNames: (a: number, b: any, c: any, d: number) => any;
@@ -244,9 +250,9 @@ export interface InitOutput {
244
250
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
245
251
  readonly __wbindgen_export_6: WebAssembly.Table;
246
252
  readonly __externref_table_dealloc: (a: number) => void;
247
- readonly closure1598_externref_shim: (a: number, b: number, c: any) => void;
248
- readonly closure1801_externref_shim: (a: number, b: number, c: any) => void;
249
- readonly closure2014_externref_shim: (a: number, b: number, c: any, d: any) => void;
253
+ readonly closure1608_externref_shim: (a: number, b: number, c: any) => void;
254
+ readonly closure1960_externref_shim: (a: number, b: number, c: any) => void;
255
+ readonly closure2191_externref_shim: (a: number, b: number, c: any, d: any) => void;
250
256
  readonly __wbindgen_start: () => void;
251
257
  }
252
258
 
@@ -221,15 +221,6 @@ function _assertClass(instance, klass) {
221
221
  throw new Error(`expected instance of ${klass.name}`);
222
222
  }
223
223
  }
224
- /**
225
- * @param {Promise<any>} promise
226
- * @returns {Promise<any>}
227
- */
228
- export function awaitPromise(promise) {
229
- const ret = wasm.awaitPromise(promise);
230
- return ret;
231
- }
232
-
233
224
  /**
234
225
  * @param {Uint8Array} bytes
235
226
  * @returns {Uint8Array}
@@ -248,13 +239,11 @@ export function start() {
248
239
  }
249
240
 
250
241
  /**
251
- * @param {Uint8Array} bytes
252
- * @returns {Uint8Array}
242
+ * @param {Promise<any>} promise
243
+ * @returns {Promise<any>}
253
244
  */
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);
245
+ export function awaitPromise(promise) {
246
+ const ret = wasm.awaitPromise(promise);
258
247
  return ret;
259
248
  }
260
249
 
@@ -274,16 +263,27 @@ export function bridgeRivetErrorPrefix() {
274
263
  }
275
264
  }
276
265
 
266
+ /**
267
+ * @param {Uint8Array} bytes
268
+ * @returns {Uint8Array}
269
+ */
270
+ export function uint8ArrayFromBytes(bytes) {
271
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
272
+ const len0 = WASM_VECTOR_LEN;
273
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
274
+ return ret;
275
+ }
276
+
277
277
  function __wbg_adapter_46(arg0, arg1, arg2) {
278
- wasm.closure1598_externref_shim(arg0, arg1, arg2);
278
+ wasm.closure1608_externref_shim(arg0, arg1, arg2);
279
279
  }
280
280
 
281
281
  function __wbg_adapter_55(arg0, arg1, arg2) {
282
- wasm.closure1801_externref_shim(arg0, arg1, arg2);
282
+ wasm.closure1960_externref_shim(arg0, arg1, arg2);
283
283
  }
284
284
 
285
- function __wbg_adapter_224(arg0, arg1, arg2, arg3) {
286
- wasm.closure2014_externref_shim(arg0, arg1, arg2, arg3);
285
+ function __wbg_adapter_239(arg0, arg1, arg2, arg3) {
286
+ wasm.closure2191_externref_shim(arg0, arg1, arg2, arg3);
287
287
  }
288
288
 
289
289
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -314,10 +314,10 @@ export class ActorContext {
314
314
  wasm.__wbg_actorcontext_free(ptr, 0);
315
315
  }
316
316
  /**
317
- * @param {Promise<any>} _promise
317
+ * @param {Promise<any>} promise
318
318
  */
319
- keepAwake(_promise) {
320
- wasm.actorcontext_keepAwake(this.__wbg_ptr, _promise);
319
+ keepAwake(promise) {
320
+ wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
321
321
  }
322
322
  /**
323
323
  * @param {any} payload
@@ -450,6 +450,13 @@ export class ActorContext {
450
450
  const ret = wasm.actorcontext_kv(this.__wbg_ptr);
451
451
  return Kv.__wrap(ret);
452
452
  }
453
+ /**
454
+ * @returns {Promise<boolean>}
455
+ */
456
+ waitForTrackedShutdownWork() {
457
+ const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
458
+ return ret;
459
+ }
453
460
  /**
454
461
  * @returns {Array<any>}
455
462
  */
@@ -483,6 +490,13 @@ export class ActorContext {
483
490
  const ret = wasm.actorcontext_sql(this.__wbg_ptr);
484
491
  return SqliteDb.__wrap(ret);
485
492
  }
493
+ /**
494
+ * @returns {Promise<void>}
495
+ */
496
+ waitForTrackedShutdownWorkUnbounded() {
497
+ const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
498
+ return ret;
499
+ }
486
500
  /**
487
501
  * @returns {string}
488
502
  */
@@ -1062,6 +1076,13 @@ export class Queue {
1062
1076
  const ret = wasm.queue_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1063
1077
  return ret;
1064
1078
  }
1079
+ /**
1080
+ * @returns {Promise<void>}
1081
+ */
1082
+ reset() {
1083
+ const ret = wasm.queue_reset(this.__wbg_ptr);
1084
+ return ret;
1085
+ }
1065
1086
  /**
1066
1087
  * @returns {number}
1067
1088
  */
@@ -1441,7 +1462,7 @@ function __wbg_get_imports() {
1441
1462
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1442
1463
  }
1443
1464
  };
1444
- imports.wbg.__wbg_getRandomValues_38097e921c2494c3 = function() { return handleError(function (arg0, arg1) {
1465
+ imports.wbg.__wbg_getRandomValues_6c498bf966d88108 = function() { return handleError(function (arg0, arg1) {
1445
1466
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1446
1467
  }, arguments) };
1447
1468
  imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
@@ -1555,7 +1576,7 @@ function __wbg_get_imports() {
1555
1576
  const a = state0.a;
1556
1577
  state0.a = 0;
1557
1578
  try {
1558
- return __wbg_adapter_224(a, state0.b, arg0, arg1);
1579
+ return __wbg_adapter_239(a, state0.b, arg0, arg1);
1559
1580
  } finally {
1560
1581
  state0.a = a;
1561
1582
  }
@@ -1767,24 +1788,24 @@ function __wbg_get_imports() {
1767
1788
  const ret = false;
1768
1789
  return ret;
1769
1790
  };
1770
- imports.wbg.__wbindgen_closure_wrapper3773 = function(arg0, arg1, arg2) {
1771
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1791
+ imports.wbg.__wbindgen_closure_wrapper3780 = function(arg0, arg1, arg2) {
1792
+ const ret = makeMutClosure(arg0, arg1, 1609, __wbg_adapter_46);
1772
1793
  return ret;
1773
1794
  };
1774
- imports.wbg.__wbindgen_closure_wrapper3775 = function(arg0, arg1, arg2) {
1775
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1795
+ imports.wbg.__wbindgen_closure_wrapper3782 = function(arg0, arg1, arg2) {
1796
+ const ret = makeMutClosure(arg0, arg1, 1609, __wbg_adapter_46);
1776
1797
  return ret;
1777
1798
  };
1778
- imports.wbg.__wbindgen_closure_wrapper3777 = function(arg0, arg1, arg2) {
1779
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1799
+ imports.wbg.__wbindgen_closure_wrapper3784 = function(arg0, arg1, arg2) {
1800
+ const ret = makeMutClosure(arg0, arg1, 1609, __wbg_adapter_46);
1780
1801
  return ret;
1781
1802
  };
1782
- imports.wbg.__wbindgen_closure_wrapper3779 = function(arg0, arg1, arg2) {
1783
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1803
+ imports.wbg.__wbindgen_closure_wrapper3786 = function(arg0, arg1, arg2) {
1804
+ const ret = makeMutClosure(arg0, arg1, 1609, __wbg_adapter_46);
1784
1805
  return ret;
1785
1806
  };
1786
- imports.wbg.__wbindgen_closure_wrapper4377 = function(arg0, arg1, arg2) {
1787
- const ret = makeMutClosure(arg0, arg1, 1802, __wbg_adapter_55);
1807
+ imports.wbg.__wbindgen_closure_wrapper4627 = function(arg0, arg1, arg2) {
1808
+ const ret = makeMutClosure(arg0, arg1, 1961, __wbg_adapter_55);
1788
1809
  return ret;
1789
1810
  };
1790
1811
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -42,6 +42,8 @@ export const actorcontext_sql: (a: number) => number;
42
42
  export const actorcontext_state: (a: number) => [number, number];
43
43
  export const actorcontext_takePendingHibernationChanges: (a: number) => any;
44
44
  export const actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
45
+ export const actorcontext_waitForTrackedShutdownWork: (a: number) => any;
46
+ export const actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
45
47
  export const actorcontext_waitUntil: (a: number, b: any) => void;
46
48
  export const actorfactory_new: (a: any, b: any) => [number, number, number];
47
49
  export const awaitPromise: (a: any) => any;
@@ -75,6 +77,7 @@ export const queue_enqueueAndWait: (a: number, b: number, c: number, d: number,
75
77
  export const queue_inspectMessages: (a: number) => any;
76
78
  export const queue_maxSize: (a: number) => number;
77
79
  export const queue_nextBatch: (a: number, b: any, c: number) => any;
80
+ export const queue_reset: (a: number) => any;
78
81
  export const queue_send: (a: number, b: number, c: number, d: number, e: number) => any;
79
82
  export const queue_tryNextBatch: (a: number, b: any) => [number, number, number];
80
83
  export const queue_waitForNames: (a: number, b: any, c: any, d: number) => any;
@@ -110,7 +113,7 @@ export const __wbindgen_export_4: WebAssembly.Table;
110
113
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
111
114
  export const __wbindgen_export_6: WebAssembly.Table;
112
115
  export const __externref_table_dealloc: (a: number) => void;
113
- export const closure1598_externref_shim: (a: number, b: number, c: any) => void;
114
- export const closure1801_externref_shim: (a: number, b: number, c: any) => void;
115
- export const closure2014_externref_shim: (a: number, b: number, c: any, d: any) => void;
116
+ export const closure1608_externref_shim: (a: number, b: number, c: any) => void;
117
+ export const closure1960_externref_shim: (a: number, b: number, c: any) => void;
118
+ export const closure2191_externref_shim: (a: number, b: number, c: any, d: any) => void;
116
119
  export const __wbindgen_start: () => void;