@rivetkit/rivetkit-wasm 0.0.0-active-actors-fix-active-count.253e406 → 0.0.0-codex-rivetkit-cli-preview.5e414a8

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,175 @@
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
+ }
124
+
125
+ export class QueueMessage {
126
+ private constructor();
127
+ free(): void;
128
+ createdAt(): number;
129
+ isCompletable(): boolean;
130
+ id(): bigint;
131
+ body(): Uint8Array;
132
+ name(): string;
133
+ complete(response: any): Promise<void>;
134
+ }
135
+
136
+ export class Schedule {
137
+ private constructor();
138
+ free(): void;
139
+ at(timestamp_ms: number, action_name: string, args: Uint8Array): void;
140
+ after(duration_ms: number, action_name: string, args: Uint8Array): void;
141
+ }
142
+
143
+ export class SqliteDb {
144
+ private constructor();
145
+ free(): void;
146
+ run(sql: string, params: any): Promise<any>;
147
+ exec(sql: string): Promise<any>;
148
+ close(): Promise<void>;
149
+ query(sql: string, params: any): Promise<any>;
150
+ execute(sql: string, params: any): Promise<any>;
151
+ }
152
+
153
+ export class WebSocketHandle {
154
+ private constructor();
155
+ free(): void;
156
+ setEventCallback(callback: Function): void;
157
+ send(data: Uint8Array, binary: boolean): void;
158
+ close(code?: number | null, reason?: string | null): Promise<void>;
159
+ }
160
+
161
+ export type InitInput =
162
+ | RequestInfo
163
+ | URL
164
+ | Response
165
+ | BufferSource
166
+ | WebAssembly.Module;
167
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
168
+ export interface InitOutput {
169
+ readonly memory: WebAssembly.Memory;
170
+ }
171
+
172
+ declare function init(
173
+ module_or_path?: InitInput | Promise<InitInput>,
174
+ ): Promise<InitOutput>;
175
+ export default init;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-wasm",
3
- "version": "0.0.0-active-actors-fix-active-count.253e406",
3
+ "version": "0.0.0-codex-rivetkit-cli-preview.5e414a8",
4
4
  "description": "WebAssembly bindings for RivetKit core on edge JavaScript runtimes",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -37,6 +37,6 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "typescript": "^5.9.2",
40
- "wasm-pack": "0.14.0"
40
+ "wasm-pack": "0.15.0"
41
41
  }
42
42
  }
@@ -1,10 +1,10 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function roundTripBytes(bytes: Uint8Array): Uint8Array;
4
3
  export function start(): void;
4
+ export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
5
5
  export function awaitPromise(promise: Promise<any>): Promise<any>;
6
+ export function roundTripBytes(bytes: Uint8Array): Uint8Array;
6
7
  export function bridgeRivetErrorPrefix(): string;
7
- export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
8
8
  export class ActorContext {
9
9
  free(): void;
10
10
  keepAwake(promise: Promise<any>): void;
@@ -32,6 +32,7 @@ export class ActorContext {
32
32
  key(): any;
33
33
  constructor();
34
34
  sql(): SqliteDb;
35
+ waitForTrackedShutdownWorkUnbounded(): Promise<void>;
35
36
  name(): string;
36
37
  conns(): Array<any>;
37
38
  queue(): Queue;
@@ -178,6 +179,7 @@ export interface InitOutput {
178
179
  readonly actorcontext_takePendingHibernationChanges: (a: number) => any;
179
180
  readonly actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
180
181
  readonly actorcontext_waitForTrackedShutdownWork: (a: number) => any;
182
+ readonly actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
181
183
  readonly actorcontext_waitUntil: (a: number, b: any) => void;
182
184
  readonly actorfactory_new: (a: any, b: any) => [number, number, number];
183
185
  readonly awaitPromise: (a: any) => any;
@@ -246,9 +248,9 @@ export interface InitOutput {
246
248
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
247
249
  readonly __wbindgen_export_6: WebAssembly.Table;
248
250
  readonly __externref_table_dealloc: (a: number) => void;
249
- readonly closure1688_externref_shim: (a: number, b: number, c: any) => void;
250
- readonly closure1892_externref_shim: (a: number, b: number, c: any) => void;
251
- readonly closure2115_externref_shim: (a: number, b: number, c: any, d: any) => void;
251
+ readonly closure1598_externref_shim: (a: number, b: number, c: any) => void;
252
+ readonly closure1950_externref_shim: (a: number, b: number, c: any) => void;
253
+ readonly closure2181_externref_shim: (a: number, b: number, c: any, d: any) => void;
252
254
  readonly __wbindgen_start: () => void;
253
255
  }
254
256
 
@@ -221,21 +221,20 @@ 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
+
224
229
  /**
225
230
  * @param {Uint8Array} bytes
226
231
  * @returns {Uint8Array}
227
232
  */
228
- export function roundTripBytes(bytes) {
233
+ export function uint8ArrayFromBytes(bytes) {
229
234
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
230
235
  const len0 = WASM_VECTOR_LEN;
231
- const ret = wasm.roundTripBytes(ptr0, len0);
232
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
233
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
234
- return v2;
235
- }
236
-
237
- export function start() {
238
- wasm.start();
236
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
237
+ return ret;
239
238
  }
240
239
 
241
240
  /**
@@ -247,6 +246,19 @@ export function awaitPromise(promise) {
247
246
  return ret;
248
247
  }
249
248
 
249
+ /**
250
+ * @param {Uint8Array} bytes
251
+ * @returns {Uint8Array}
252
+ */
253
+ export function roundTripBytes(bytes) {
254
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
255
+ const len0 = WASM_VECTOR_LEN;
256
+ const ret = wasm.roundTripBytes(ptr0, len0);
257
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
258
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
259
+ return v2;
260
+ }
261
+
250
262
  /**
251
263
  * @returns {string}
252
264
  */
@@ -263,27 +275,16 @@ export function bridgeRivetErrorPrefix() {
263
275
  }
264
276
  }
265
277
 
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
278
  function __wbg_adapter_46(arg0, arg1, arg2) {
278
- wasm.closure1688_externref_shim(arg0, arg1, arg2);
279
+ wasm.closure1598_externref_shim(arg0, arg1, arg2);
279
280
  }
280
281
 
281
282
  function __wbg_adapter_55(arg0, arg1, arg2) {
282
- wasm.closure1892_externref_shim(arg0, arg1, arg2);
283
+ wasm.closure1950_externref_shim(arg0, arg1, arg2);
283
284
  }
284
285
 
285
- function __wbg_adapter_225(arg0, arg1, arg2, arg3) {
286
- wasm.closure2115_externref_shim(arg0, arg1, arg2, arg3);
286
+ function __wbg_adapter_268(arg0, arg1, arg2, arg3) {
287
+ wasm.closure2181_externref_shim(arg0, arg1, arg2, arg3);
287
288
  }
288
289
 
289
290
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -490,6 +491,13 @@ export class ActorContext {
490
491
  const ret = wasm.actorcontext_sql(this.__wbg_ptr);
491
492
  return SqliteDb.__wrap(ret);
492
493
  }
494
+ /**
495
+ * @returns {Promise<void>}
496
+ */
497
+ waitForTrackedShutdownWorkUnbounded() {
498
+ const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
499
+ return ret;
500
+ }
493
501
  /**
494
502
  * @returns {string}
495
503
  */
@@ -1448,7 +1456,7 @@ function __wbg_get_imports() {
1448
1456
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1449
1457
  }
1450
1458
  };
1451
- imports.wbg.__wbg_getRandomValues_38097e921c2494c3 = function() { return handleError(function (arg0, arg1) {
1459
+ imports.wbg.__wbg_getRandomValues_6c498bf966d88108 = function() { return handleError(function (arg0, arg1) {
1452
1460
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1453
1461
  }, arguments) };
1454
1462
  imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
@@ -1562,7 +1570,7 @@ function __wbg_get_imports() {
1562
1570
  const a = state0.a;
1563
1571
  state0.a = 0;
1564
1572
  try {
1565
- return __wbg_adapter_225(a, state0.b, arg0, arg1);
1573
+ return __wbg_adapter_268(a, state0.b, arg0, arg1);
1566
1574
  } finally {
1567
1575
  state0.a = a;
1568
1576
  }
@@ -1774,24 +1782,24 @@ function __wbg_get_imports() {
1774
1782
  const ret = false;
1775
1783
  return ret;
1776
1784
  };
1777
- imports.wbg.__wbindgen_closure_wrapper3861 = function(arg0, arg1, arg2) {
1778
- const ret = makeMutClosure(arg0, arg1, 1689, __wbg_adapter_46);
1785
+ imports.wbg.__wbindgen_closure_wrapper3727 = function(arg0, arg1, arg2) {
1786
+ const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1779
1787
  return ret;
1780
1788
  };
1781
- imports.wbg.__wbindgen_closure_wrapper3863 = function(arg0, arg1, arg2) {
1782
- const ret = makeMutClosure(arg0, arg1, 1689, __wbg_adapter_46);
1789
+ imports.wbg.__wbindgen_closure_wrapper3729 = function(arg0, arg1, arg2) {
1790
+ const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1783
1791
  return ret;
1784
1792
  };
1785
- imports.wbg.__wbindgen_closure_wrapper3865 = function(arg0, arg1, arg2) {
1786
- const ret = makeMutClosure(arg0, arg1, 1689, __wbg_adapter_46);
1793
+ imports.wbg.__wbindgen_closure_wrapper3731 = function(arg0, arg1, arg2) {
1794
+ const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1787
1795
  return ret;
1788
1796
  };
1789
- imports.wbg.__wbindgen_closure_wrapper3867 = function(arg0, arg1, arg2) {
1790
- const ret = makeMutClosure(arg0, arg1, 1689, __wbg_adapter_46);
1797
+ imports.wbg.__wbindgen_closure_wrapper3733 = function(arg0, arg1, arg2) {
1798
+ const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
1791
1799
  return ret;
1792
1800
  };
1793
- imports.wbg.__wbindgen_closure_wrapper4467 = function(arg0, arg1, arg2) {
1794
- const ret = makeMutClosure(arg0, arg1, 1893, __wbg_adapter_55);
1801
+ imports.wbg.__wbindgen_closure_wrapper4574 = function(arg0, arg1, arg2) {
1802
+ const ret = makeMutClosure(arg0, arg1, 1951, __wbg_adapter_55);
1795
1803
  return ret;
1796
1804
  };
1797
1805
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -43,6 +43,7 @@ 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
45
  export const actorcontext_waitForTrackedShutdownWork: (a: number) => any;
46
+ export const actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
46
47
  export const actorcontext_waitUntil: (a: number, b: any) => void;
47
48
  export const actorfactory_new: (a: any, b: any) => [number, number, number];
48
49
  export const awaitPromise: (a: any) => any;
@@ -111,7 +112,7 @@ export const __wbindgen_export_4: WebAssembly.Table;
111
112
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
112
113
  export const __wbindgen_export_6: WebAssembly.Table;
113
114
  export const __externref_table_dealloc: (a: number) => void;
114
- export const closure1688_externref_shim: (a: number, b: number, c: any) => void;
115
- export const closure1892_externref_shim: (a: number, b: number, c: any) => void;
116
- export const closure2115_externref_shim: (a: number, b: number, c: any, d: any) => void;
115
+ export const closure1598_externref_shim: (a: number, b: number, c: any) => void;
116
+ export const closure1950_externref_shim: (a: number, b: number, c: any) => void;
117
+ export const closure2181_externref_shim: (a: number, b: number, c: any, d: any) => void;
117
118
  export const __wbindgen_start: () => void;