@rivetkit/rivetkit-wasm 0.0.0-pr.4860.7a44823
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 +83 -0
- package/index.js +2 -0
- package/package.json +32 -0
- package/pkg/package.json +19 -0
- package/pkg/rivetkit_wasm.d.ts +95 -0
- package/pkg/rivetkit_wasm.js +970 -0
- package/pkg/rivetkit_wasm_bg.wasm +0 -0
- package/pkg/rivetkit_wasm_bg.wasm.d.ts +35 -0
- package/scripts/build.mjs +47 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export interface ServeConfig {
|
|
2
|
+
version: number;
|
|
3
|
+
endpoint: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
namespace: string;
|
|
6
|
+
poolName: string;
|
|
7
|
+
engineBinaryPath?: string;
|
|
8
|
+
handleInspectorHttpInRuntime?: boolean;
|
|
9
|
+
serverlessBasePath?: string;
|
|
10
|
+
serverlessPackageVersion: string;
|
|
11
|
+
serverlessClientEndpoint?: string;
|
|
12
|
+
serverlessClientNamespace?: string;
|
|
13
|
+
serverlessClientToken?: string;
|
|
14
|
+
serverlessValidateEndpoint: boolean;
|
|
15
|
+
serverlessMaxStartPayloadBytes: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ActorConfig {
|
|
19
|
+
name?: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
hasDatabase?: boolean;
|
|
22
|
+
remoteSqlite?: boolean;
|
|
23
|
+
hasState?: boolean;
|
|
24
|
+
canHibernateWebsocket?: boolean;
|
|
25
|
+
stateSaveIntervalMs?: number;
|
|
26
|
+
createStateTimeoutMs?: number;
|
|
27
|
+
onCreateTimeoutMs?: number;
|
|
28
|
+
createVarsTimeoutMs?: number;
|
|
29
|
+
createConnStateTimeoutMs?: number;
|
|
30
|
+
onBeforeConnectTimeoutMs?: number;
|
|
31
|
+
onConnectTimeoutMs?: number;
|
|
32
|
+
onMigrateTimeoutMs?: number;
|
|
33
|
+
onWakeTimeoutMs?: number;
|
|
34
|
+
onBeforeActorStartTimeoutMs?: number;
|
|
35
|
+
actionTimeoutMs?: number;
|
|
36
|
+
onRequestTimeoutMs?: number;
|
|
37
|
+
sleepTimeoutMs?: number;
|
|
38
|
+
noSleep?: boolean;
|
|
39
|
+
sleepGracePeriodMs?: number;
|
|
40
|
+
connectionLivenessTimeoutMs?: number;
|
|
41
|
+
connectionLivenessIntervalMs?: number;
|
|
42
|
+
maxQueueSize?: number;
|
|
43
|
+
maxQueueMessageSize?: number;
|
|
44
|
+
maxIncomingMessageSize?: number;
|
|
45
|
+
maxOutgoingMessageSize?: number;
|
|
46
|
+
preloadMaxWorkflowBytes?: number;
|
|
47
|
+
preloadMaxConnectionsBytes?: number;
|
|
48
|
+
actions?: Array<{ name: string }>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class CoreRegistry {
|
|
52
|
+
constructor();
|
|
53
|
+
register(name: string, factory: ActorFactory): void;
|
|
54
|
+
serve(config: ServeConfig): Promise<void>;
|
|
55
|
+
shutdown(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class ActorFactory {
|
|
59
|
+
constructor(callbacks: unknown, config?: ActorConfig | null);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export class CancellationToken {
|
|
63
|
+
constructor();
|
|
64
|
+
aborted(): boolean;
|
|
65
|
+
cancel(): void;
|
|
66
|
+
onCancelled(callback: () => void): void;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class ActorContext {
|
|
70
|
+
constructor();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export class ConnHandle {}
|
|
74
|
+
|
|
75
|
+
export class WebSocketHandle {}
|
|
76
|
+
|
|
77
|
+
export function bridgeRivetErrorPrefix(): string;
|
|
78
|
+
export function roundTripBytes(bytes: Uint8Array): Uint8Array;
|
|
79
|
+
export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
|
|
80
|
+
export function awaitPromise<T>(promise: Promise<T>): Promise<T>;
|
|
81
|
+
|
|
82
|
+
declare const init: (input?: RequestInfo | URL | Response | BufferSource | WebAssembly.Module) => Promise<void>;
|
|
83
|
+
export default init;
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rivetkit/rivetkit-wasm",
|
|
3
|
+
"version": "0.0.0-pr.4860.7a44823",
|
|
4
|
+
"description": "WebAssembly bindings for RivetKit core on edge JavaScript runtimes",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"default": "./index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"pkg/**/*",
|
|
19
|
+
"package.json",
|
|
20
|
+
"scripts/build.mjs"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "node scripts/build.mjs",
|
|
24
|
+
"build:cloudflare": "node scripts/build.mjs --target bundler --out-dir pkg-cloudflare",
|
|
25
|
+
"build:deno": "node scripts/build.mjs --target web --out-dir pkg-deno",
|
|
26
|
+
"check-types": "tsc --noEmit",
|
|
27
|
+
"check:wasm": "cargo check -p rivetkit-wasm --target wasm32-unknown-unknown"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript": "^5.9.2"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/pkg/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rivetkit-wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"Rivet Gaming, LLC <developer@rivet.gg>"
|
|
6
|
+
],
|
|
7
|
+
"version": "2.3.0-rc.4",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"files": [
|
|
10
|
+
"rivetkit_wasm_bg.wasm",
|
|
11
|
+
"rivetkit_wasm.js",
|
|
12
|
+
"rivetkit_wasm.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"main": "rivetkit_wasm.js",
|
|
15
|
+
"types": "rivetkit_wasm.d.ts",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"./snippets/*"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
|
|
4
|
+
export function bridgeRivetErrorPrefix(): string;
|
|
5
|
+
export function awaitPromise(promise: Promise<any>): Promise<any>;
|
|
6
|
+
export function roundTripBytes(bytes: Uint8Array): Uint8Array;
|
|
7
|
+
export class ActorContext {
|
|
8
|
+
free(): void;
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
export class ActorFactory {
|
|
12
|
+
free(): void;
|
|
13
|
+
constructor(_callbacks: any, config: any);
|
|
14
|
+
}
|
|
15
|
+
export class CancellationToken {
|
|
16
|
+
free(): void;
|
|
17
|
+
onCancelled(callback: Function): void;
|
|
18
|
+
constructor();
|
|
19
|
+
cancel(): void;
|
|
20
|
+
aborted(): boolean;
|
|
21
|
+
}
|
|
22
|
+
export class ConnHandle {
|
|
23
|
+
private constructor();
|
|
24
|
+
free(): void;
|
|
25
|
+
}
|
|
26
|
+
export class CoreRegistry {
|
|
27
|
+
free(): void;
|
|
28
|
+
constructor();
|
|
29
|
+
serve(config: any): Promise<void>;
|
|
30
|
+
register(name: string, factory: ActorFactory): void;
|
|
31
|
+
shutdown(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export class WebSocketHandle {
|
|
34
|
+
private constructor();
|
|
35
|
+
free(): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
39
|
+
|
|
40
|
+
export interface InitOutput {
|
|
41
|
+
readonly memory: WebAssembly.Memory;
|
|
42
|
+
readonly __wbg_actorcontext_free: (a: number, b: number) => void;
|
|
43
|
+
readonly __wbg_actorfactory_free: (a: number, b: number) => void;
|
|
44
|
+
readonly __wbg_cancellationtoken_free: (a: number, b: number) => void;
|
|
45
|
+
readonly __wbg_coreregistry_free: (a: number, b: number) => void;
|
|
46
|
+
readonly actorcontext_new: () => [number, number, number];
|
|
47
|
+
readonly actorfactory_new: (a: any, b: any) => [number, number, number];
|
|
48
|
+
readonly awaitPromise: (a: any) => any;
|
|
49
|
+
readonly bridgeRivetErrorPrefix: () => [number, number];
|
|
50
|
+
readonly cancellationtoken_aborted: (a: number) => number;
|
|
51
|
+
readonly cancellationtoken_cancel: (a: number) => void;
|
|
52
|
+
readonly cancellationtoken_new: () => number;
|
|
53
|
+
readonly cancellationtoken_onCancelled: (a: number, b: any) => void;
|
|
54
|
+
readonly coreregistry_new: () => number;
|
|
55
|
+
readonly coreregistry_register: (a: number, b: number, c: number, d: number) => [number, number];
|
|
56
|
+
readonly coreregistry_serve: (a: number, b: any) => any;
|
|
57
|
+
readonly coreregistry_shutdown: (a: number) => any;
|
|
58
|
+
readonly roundTripBytes: (a: number, b: number) => [number, number];
|
|
59
|
+
readonly uint8ArrayFromBytes: (a: number, b: number) => any;
|
|
60
|
+
readonly __wbg_connhandle_free: (a: number, b: number) => void;
|
|
61
|
+
readonly __wbg_websockethandle_free: (a: number, b: number) => void;
|
|
62
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
63
|
+
readonly __externref_table_alloc: () => number;
|
|
64
|
+
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
65
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
66
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
67
|
+
readonly __wbindgen_export_5: WebAssembly.Table;
|
|
68
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
69
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
70
|
+
readonly closure1115_externref_shim: (a: number, b: number, c: any) => void;
|
|
71
|
+
readonly closure1290_externref_shim: (a: number, b: number, c: any) => void;
|
|
72
|
+
readonly closure1517_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
73
|
+
readonly __wbindgen_start: () => void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
77
|
+
/**
|
|
78
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
79
|
+
* a precompiled `WebAssembly.Module`.
|
|
80
|
+
*
|
|
81
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
82
|
+
*
|
|
83
|
+
* @returns {InitOutput}
|
|
84
|
+
*/
|
|
85
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
89
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
90
|
+
*
|
|
91
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
92
|
+
*
|
|
93
|
+
* @returns {Promise<InitOutput>}
|
|
94
|
+
*/
|
|
95
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
function addToExternrefTable0(obj) {
|
|
4
|
+
const idx = wasm.__externref_table_alloc();
|
|
5
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
6
|
+
return idx;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function handleError(f, args) {
|
|
10
|
+
try {
|
|
11
|
+
return f.apply(this, args);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
const idx = addToExternrefTable0(e);
|
|
14
|
+
wasm.__wbindgen_exn_store(idx);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
19
|
+
|
|
20
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
21
|
+
|
|
22
|
+
let cachedUint8ArrayMemory0 = null;
|
|
23
|
+
|
|
24
|
+
function getUint8ArrayMemory0() {
|
|
25
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
26
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
27
|
+
}
|
|
28
|
+
return cachedUint8ArrayMemory0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getStringFromWasm0(ptr, len) {
|
|
32
|
+
ptr = ptr >>> 0;
|
|
33
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
37
|
+
ptr = ptr >>> 0;
|
|
38
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let WASM_VECTOR_LEN = 0;
|
|
42
|
+
|
|
43
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
44
|
+
|
|
45
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
46
|
+
? function (arg, view) {
|
|
47
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
48
|
+
}
|
|
49
|
+
: function (arg, view) {
|
|
50
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
51
|
+
view.set(buf);
|
|
52
|
+
return {
|
|
53
|
+
read: arg.length,
|
|
54
|
+
written: buf.length
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
59
|
+
|
|
60
|
+
if (realloc === undefined) {
|
|
61
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
62
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
63
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
64
|
+
WASM_VECTOR_LEN = buf.length;
|
|
65
|
+
return ptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let len = arg.length;
|
|
69
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
70
|
+
|
|
71
|
+
const mem = getUint8ArrayMemory0();
|
|
72
|
+
|
|
73
|
+
let offset = 0;
|
|
74
|
+
|
|
75
|
+
for (; offset < len; offset++) {
|
|
76
|
+
const code = arg.charCodeAt(offset);
|
|
77
|
+
if (code > 0x7F) break;
|
|
78
|
+
mem[ptr + offset] = code;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (offset !== len) {
|
|
82
|
+
if (offset !== 0) {
|
|
83
|
+
arg = arg.slice(offset);
|
|
84
|
+
}
|
|
85
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
86
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
87
|
+
const ret = encodeString(arg, view);
|
|
88
|
+
|
|
89
|
+
offset += ret.written;
|
|
90
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
WASM_VECTOR_LEN = offset;
|
|
94
|
+
return ptr;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let cachedDataViewMemory0 = null;
|
|
98
|
+
|
|
99
|
+
function getDataViewMemory0() {
|
|
100
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
101
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
102
|
+
}
|
|
103
|
+
return cachedDataViewMemory0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function isLikeNone(x) {
|
|
107
|
+
return x === undefined || x === null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
111
|
+
? { register: () => {}, unregister: () => {} }
|
|
112
|
+
: new FinalizationRegistry(state => {
|
|
113
|
+
wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b)
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
117
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
118
|
+
const real = (...args) => {
|
|
119
|
+
// First up with a closure we increment the internal reference
|
|
120
|
+
// count. This ensures that the Rust closure environment won't
|
|
121
|
+
// be deallocated while we're invoking it.
|
|
122
|
+
state.cnt++;
|
|
123
|
+
const a = state.a;
|
|
124
|
+
state.a = 0;
|
|
125
|
+
try {
|
|
126
|
+
return f(a, state.b, ...args);
|
|
127
|
+
} finally {
|
|
128
|
+
if (--state.cnt === 0) {
|
|
129
|
+
wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
|
|
130
|
+
CLOSURE_DTORS.unregister(state);
|
|
131
|
+
} else {
|
|
132
|
+
state.a = a;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
real.original = state;
|
|
137
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
138
|
+
return real;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function debugString(val) {
|
|
142
|
+
// primitive types
|
|
143
|
+
const type = typeof val;
|
|
144
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
145
|
+
return `${val}`;
|
|
146
|
+
}
|
|
147
|
+
if (type == 'string') {
|
|
148
|
+
return `"${val}"`;
|
|
149
|
+
}
|
|
150
|
+
if (type == 'symbol') {
|
|
151
|
+
const description = val.description;
|
|
152
|
+
if (description == null) {
|
|
153
|
+
return 'Symbol';
|
|
154
|
+
} else {
|
|
155
|
+
return `Symbol(${description})`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (type == 'function') {
|
|
159
|
+
const name = val.name;
|
|
160
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
161
|
+
return `Function(${name})`;
|
|
162
|
+
} else {
|
|
163
|
+
return 'Function';
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// objects
|
|
167
|
+
if (Array.isArray(val)) {
|
|
168
|
+
const length = val.length;
|
|
169
|
+
let debug = '[';
|
|
170
|
+
if (length > 0) {
|
|
171
|
+
debug += debugString(val[0]);
|
|
172
|
+
}
|
|
173
|
+
for(let i = 1; i < length; i++) {
|
|
174
|
+
debug += ', ' + debugString(val[i]);
|
|
175
|
+
}
|
|
176
|
+
debug += ']';
|
|
177
|
+
return debug;
|
|
178
|
+
}
|
|
179
|
+
// Test for built-in
|
|
180
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
181
|
+
let className;
|
|
182
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
183
|
+
className = builtInMatches[1];
|
|
184
|
+
} else {
|
|
185
|
+
// Failed to match the standard '[object ClassName]'
|
|
186
|
+
return toString.call(val);
|
|
187
|
+
}
|
|
188
|
+
if (className == 'Object') {
|
|
189
|
+
// we're a user defined class or Object
|
|
190
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
191
|
+
// easier than looping through ownProperties of `val`.
|
|
192
|
+
try {
|
|
193
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
194
|
+
} catch (_) {
|
|
195
|
+
return 'Object';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// errors
|
|
199
|
+
if (val instanceof Error) {
|
|
200
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
201
|
+
}
|
|
202
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
203
|
+
return className;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function takeFromExternrefTable0(idx) {
|
|
207
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
208
|
+
wasm.__externref_table_dealloc(idx);
|
|
209
|
+
return value;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function _assertClass(instance, klass) {
|
|
213
|
+
if (!(instance instanceof klass)) {
|
|
214
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
219
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
220
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
221
|
+
WASM_VECTOR_LEN = arg.length;
|
|
222
|
+
return ptr;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @param {Uint8Array} bytes
|
|
226
|
+
* @returns {Uint8Array}
|
|
227
|
+
*/
|
|
228
|
+
export function uint8ArrayFromBytes(bytes) {
|
|
229
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
230
|
+
const len0 = WASM_VECTOR_LEN;
|
|
231
|
+
const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
|
|
232
|
+
return ret;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @returns {string}
|
|
237
|
+
*/
|
|
238
|
+
export function bridgeRivetErrorPrefix() {
|
|
239
|
+
let deferred1_0;
|
|
240
|
+
let deferred1_1;
|
|
241
|
+
try {
|
|
242
|
+
const ret = wasm.bridgeRivetErrorPrefix();
|
|
243
|
+
deferred1_0 = ret[0];
|
|
244
|
+
deferred1_1 = ret[1];
|
|
245
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
246
|
+
} finally {
|
|
247
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @param {Promise<any>} promise
|
|
253
|
+
* @returns {Promise<any>}
|
|
254
|
+
*/
|
|
255
|
+
export function awaitPromise(promise) {
|
|
256
|
+
const ret = wasm.awaitPromise(promise);
|
|
257
|
+
return ret;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @param {Uint8Array} bytes
|
|
262
|
+
* @returns {Uint8Array}
|
|
263
|
+
*/
|
|
264
|
+
export function roundTripBytes(bytes) {
|
|
265
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
266
|
+
const len0 = WASM_VECTOR_LEN;
|
|
267
|
+
const ret = wasm.roundTripBytes(ptr0, len0);
|
|
268
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
269
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
270
|
+
return v2;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function __wbg_adapter_44(arg0, arg1, arg2) {
|
|
274
|
+
wasm.closure1115_externref_shim(arg0, arg1, arg2);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function __wbg_adapter_53(arg0, arg1, arg2) {
|
|
278
|
+
wasm.closure1290_externref_shim(arg0, arg1, arg2);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function __wbg_adapter_122(arg0, arg1, arg2, arg3) {
|
|
282
|
+
wasm.closure1517_externref_shim(arg0, arg1, arg2, arg3);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
286
|
+
|
|
287
|
+
const ActorContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
288
|
+
? { register: () => {}, unregister: () => {} }
|
|
289
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_actorcontext_free(ptr >>> 0, 1));
|
|
290
|
+
|
|
291
|
+
export class ActorContext {
|
|
292
|
+
|
|
293
|
+
__destroy_into_raw() {
|
|
294
|
+
const ptr = this.__wbg_ptr;
|
|
295
|
+
this.__wbg_ptr = 0;
|
|
296
|
+
ActorContextFinalization.unregister(this);
|
|
297
|
+
return ptr;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
free() {
|
|
301
|
+
const ptr = this.__destroy_into_raw();
|
|
302
|
+
wasm.__wbg_actorcontext_free(ptr, 0);
|
|
303
|
+
}
|
|
304
|
+
constructor() {
|
|
305
|
+
const ret = wasm.actorcontext_new();
|
|
306
|
+
if (ret[2]) {
|
|
307
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
308
|
+
}
|
|
309
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
310
|
+
ActorContextFinalization.register(this, this.__wbg_ptr, this);
|
|
311
|
+
return this;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const ActorFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
316
|
+
? { register: () => {}, unregister: () => {} }
|
|
317
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_actorfactory_free(ptr >>> 0, 1));
|
|
318
|
+
|
|
319
|
+
export class ActorFactory {
|
|
320
|
+
|
|
321
|
+
__destroy_into_raw() {
|
|
322
|
+
const ptr = this.__wbg_ptr;
|
|
323
|
+
this.__wbg_ptr = 0;
|
|
324
|
+
ActorFactoryFinalization.unregister(this);
|
|
325
|
+
return ptr;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
free() {
|
|
329
|
+
const ptr = this.__destroy_into_raw();
|
|
330
|
+
wasm.__wbg_actorfactory_free(ptr, 0);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* @param {any} _callbacks
|
|
334
|
+
* @param {any} config
|
|
335
|
+
*/
|
|
336
|
+
constructor(_callbacks, config) {
|
|
337
|
+
const ret = wasm.actorfactory_new(_callbacks, config);
|
|
338
|
+
if (ret[2]) {
|
|
339
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
340
|
+
}
|
|
341
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
342
|
+
ActorFactoryFinalization.register(this, this.__wbg_ptr, this);
|
|
343
|
+
return this;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
348
|
+
? { register: () => {}, unregister: () => {} }
|
|
349
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr >>> 0, 1));
|
|
350
|
+
|
|
351
|
+
export class CancellationToken {
|
|
352
|
+
|
|
353
|
+
__destroy_into_raw() {
|
|
354
|
+
const ptr = this.__wbg_ptr;
|
|
355
|
+
this.__wbg_ptr = 0;
|
|
356
|
+
CancellationTokenFinalization.unregister(this);
|
|
357
|
+
return ptr;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
free() {
|
|
361
|
+
const ptr = this.__destroy_into_raw();
|
|
362
|
+
wasm.__wbg_cancellationtoken_free(ptr, 0);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* @param {Function} callback
|
|
366
|
+
*/
|
|
367
|
+
onCancelled(callback) {
|
|
368
|
+
wasm.cancellationtoken_onCancelled(this.__wbg_ptr, callback);
|
|
369
|
+
}
|
|
370
|
+
constructor() {
|
|
371
|
+
const ret = wasm.cancellationtoken_new();
|
|
372
|
+
this.__wbg_ptr = ret >>> 0;
|
|
373
|
+
CancellationTokenFinalization.register(this, this.__wbg_ptr, this);
|
|
374
|
+
return this;
|
|
375
|
+
}
|
|
376
|
+
cancel() {
|
|
377
|
+
wasm.cancellationtoken_cancel(this.__wbg_ptr);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* @returns {boolean}
|
|
381
|
+
*/
|
|
382
|
+
aborted() {
|
|
383
|
+
const ret = wasm.cancellationtoken_aborted(this.__wbg_ptr);
|
|
384
|
+
return ret !== 0;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
const ConnHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
389
|
+
? { register: () => {}, unregister: () => {} }
|
|
390
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_connhandle_free(ptr >>> 0, 1));
|
|
391
|
+
|
|
392
|
+
export class ConnHandle {
|
|
393
|
+
|
|
394
|
+
__destroy_into_raw() {
|
|
395
|
+
const ptr = this.__wbg_ptr;
|
|
396
|
+
this.__wbg_ptr = 0;
|
|
397
|
+
ConnHandleFinalization.unregister(this);
|
|
398
|
+
return ptr;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
free() {
|
|
402
|
+
const ptr = this.__destroy_into_raw();
|
|
403
|
+
wasm.__wbg_connhandle_free(ptr, 0);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const CoreRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
408
|
+
? { register: () => {}, unregister: () => {} }
|
|
409
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_coreregistry_free(ptr >>> 0, 1));
|
|
410
|
+
|
|
411
|
+
export class CoreRegistry {
|
|
412
|
+
|
|
413
|
+
__destroy_into_raw() {
|
|
414
|
+
const ptr = this.__wbg_ptr;
|
|
415
|
+
this.__wbg_ptr = 0;
|
|
416
|
+
CoreRegistryFinalization.unregister(this);
|
|
417
|
+
return ptr;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
free() {
|
|
421
|
+
const ptr = this.__destroy_into_raw();
|
|
422
|
+
wasm.__wbg_coreregistry_free(ptr, 0);
|
|
423
|
+
}
|
|
424
|
+
constructor() {
|
|
425
|
+
const ret = wasm.coreregistry_new();
|
|
426
|
+
this.__wbg_ptr = ret >>> 0;
|
|
427
|
+
CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
|
|
428
|
+
return this;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* @param {any} config
|
|
432
|
+
* @returns {Promise<void>}
|
|
433
|
+
*/
|
|
434
|
+
serve(config) {
|
|
435
|
+
const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
|
|
436
|
+
return ret;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* @param {string} name
|
|
440
|
+
* @param {ActorFactory} factory
|
|
441
|
+
*/
|
|
442
|
+
register(name, factory) {
|
|
443
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
444
|
+
const len0 = WASM_VECTOR_LEN;
|
|
445
|
+
_assertClass(factory, ActorFactory);
|
|
446
|
+
const ret = wasm.coreregistry_register(this.__wbg_ptr, ptr0, len0, factory.__wbg_ptr);
|
|
447
|
+
if (ret[1]) {
|
|
448
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* @returns {Promise<void>}
|
|
453
|
+
*/
|
|
454
|
+
shutdown() {
|
|
455
|
+
const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
|
|
456
|
+
return ret;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
461
|
+
? { register: () => {}, unregister: () => {} }
|
|
462
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr >>> 0, 1));
|
|
463
|
+
|
|
464
|
+
export class WebSocketHandle {
|
|
465
|
+
|
|
466
|
+
__destroy_into_raw() {
|
|
467
|
+
const ptr = this.__wbg_ptr;
|
|
468
|
+
this.__wbg_ptr = 0;
|
|
469
|
+
WebSocketHandleFinalization.unregister(this);
|
|
470
|
+
return ptr;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
free() {
|
|
474
|
+
const ptr = this.__destroy_into_raw();
|
|
475
|
+
wasm.__wbg_websockethandle_free(ptr, 0);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
async function __wbg_load(module, imports) {
|
|
480
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
481
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
482
|
+
try {
|
|
483
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
484
|
+
|
|
485
|
+
} catch (e) {
|
|
486
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
487
|
+
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);
|
|
488
|
+
|
|
489
|
+
} else {
|
|
490
|
+
throw e;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const bytes = await module.arrayBuffer();
|
|
496
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
497
|
+
|
|
498
|
+
} else {
|
|
499
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
500
|
+
|
|
501
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
502
|
+
return { instance, module };
|
|
503
|
+
|
|
504
|
+
} else {
|
|
505
|
+
return instance;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function __wbg_get_imports() {
|
|
511
|
+
const imports = {};
|
|
512
|
+
imports.wbg = {};
|
|
513
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
514
|
+
const ret = arg0.buffer;
|
|
515
|
+
return ret;
|
|
516
|
+
};
|
|
517
|
+
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
518
|
+
const ret = arg0.call(arg1);
|
|
519
|
+
return ret;
|
|
520
|
+
}, arguments) };
|
|
521
|
+
imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
522
|
+
const ret = arg0.call(arg1, arg2);
|
|
523
|
+
return ret;
|
|
524
|
+
}, arguments) };
|
|
525
|
+
imports.wbg.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
526
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
527
|
+
return ret;
|
|
528
|
+
}, arguments) };
|
|
529
|
+
imports.wbg.__wbg_close_2893b7d056a0627d = function() { return handleError(function (arg0) {
|
|
530
|
+
arg0.close();
|
|
531
|
+
}, arguments) };
|
|
532
|
+
imports.wbg.__wbg_close_e1253d480ed93ce3 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
533
|
+
arg0.close(arg1, getStringFromWasm0(arg2, arg3));
|
|
534
|
+
}, arguments) };
|
|
535
|
+
imports.wbg.__wbg_code_f4ec1e6e2e1b0417 = function(arg0) {
|
|
536
|
+
const ret = arg0.code;
|
|
537
|
+
return ret;
|
|
538
|
+
};
|
|
539
|
+
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
540
|
+
const ret = arg0.crypto;
|
|
541
|
+
return ret;
|
|
542
|
+
};
|
|
543
|
+
imports.wbg.__wbg_data_432d9c3df2630942 = function(arg0) {
|
|
544
|
+
const ret = arg0.data;
|
|
545
|
+
return ret;
|
|
546
|
+
};
|
|
547
|
+
imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
548
|
+
const ret = arg0.done;
|
|
549
|
+
return ret;
|
|
550
|
+
};
|
|
551
|
+
imports.wbg.__wbg_getRandomValues_38097e921c2494c3 = function() { return handleError(function (arg0, arg1) {
|
|
552
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
553
|
+
}, arguments) };
|
|
554
|
+
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
555
|
+
arg0.getRandomValues(arg1);
|
|
556
|
+
}, arguments) };
|
|
557
|
+
imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
558
|
+
const ret = Reflect.get(arg0, arg1);
|
|
559
|
+
return ret;
|
|
560
|
+
}, arguments) };
|
|
561
|
+
imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
562
|
+
const ret = arg0[arg1 >>> 0];
|
|
563
|
+
return ret;
|
|
564
|
+
};
|
|
565
|
+
imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
|
566
|
+
const ret = arg0[arg1];
|
|
567
|
+
return ret;
|
|
568
|
+
};
|
|
569
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
570
|
+
let result;
|
|
571
|
+
try {
|
|
572
|
+
result = arg0 instanceof ArrayBuffer;
|
|
573
|
+
} catch (_) {
|
|
574
|
+
result = false;
|
|
575
|
+
}
|
|
576
|
+
const ret = result;
|
|
577
|
+
return ret;
|
|
578
|
+
};
|
|
579
|
+
imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
580
|
+
let result;
|
|
581
|
+
try {
|
|
582
|
+
result = arg0 instanceof Uint8Array;
|
|
583
|
+
} catch (_) {
|
|
584
|
+
result = false;
|
|
585
|
+
}
|
|
586
|
+
const ret = result;
|
|
587
|
+
return ret;
|
|
588
|
+
};
|
|
589
|
+
imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
590
|
+
const ret = Array.isArray(arg0);
|
|
591
|
+
return ret;
|
|
592
|
+
};
|
|
593
|
+
imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
|
594
|
+
const ret = Number.isSafeInteger(arg0);
|
|
595
|
+
return ret;
|
|
596
|
+
};
|
|
597
|
+
imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
598
|
+
const ret = Symbol.iterator;
|
|
599
|
+
return ret;
|
|
600
|
+
};
|
|
601
|
+
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
602
|
+
const ret = arg0.length;
|
|
603
|
+
return ret;
|
|
604
|
+
};
|
|
605
|
+
imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
606
|
+
const ret = arg0.length;
|
|
607
|
+
return ret;
|
|
608
|
+
};
|
|
609
|
+
imports.wbg.__wbg_message_d1685a448ba00178 = function(arg0, arg1) {
|
|
610
|
+
const ret = arg1.message;
|
|
611
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
612
|
+
const len1 = WASM_VECTOR_LEN;
|
|
613
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
614
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
615
|
+
};
|
|
616
|
+
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
617
|
+
const ret = arg0.msCrypto;
|
|
618
|
+
return ret;
|
|
619
|
+
};
|
|
620
|
+
imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
621
|
+
try {
|
|
622
|
+
var state0 = {a: arg0, b: arg1};
|
|
623
|
+
var cb0 = (arg0, arg1) => {
|
|
624
|
+
const a = state0.a;
|
|
625
|
+
state0.a = 0;
|
|
626
|
+
try {
|
|
627
|
+
return __wbg_adapter_122(a, state0.b, arg0, arg1);
|
|
628
|
+
} finally {
|
|
629
|
+
state0.a = a;
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
const ret = new Promise(cb0);
|
|
633
|
+
return ret;
|
|
634
|
+
} finally {
|
|
635
|
+
state0.a = state0.b = 0;
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
639
|
+
const ret = new Array();
|
|
640
|
+
return ret;
|
|
641
|
+
};
|
|
642
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
643
|
+
const ret = new Uint8Array(arg0);
|
|
644
|
+
return ret;
|
|
645
|
+
};
|
|
646
|
+
imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
647
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
648
|
+
return ret;
|
|
649
|
+
};
|
|
650
|
+
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
651
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
652
|
+
return ret;
|
|
653
|
+
};
|
|
654
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
655
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
656
|
+
return ret;
|
|
657
|
+
};
|
|
658
|
+
imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
659
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
660
|
+
return ret;
|
|
661
|
+
};
|
|
662
|
+
imports.wbg.__wbg_newwithstrsequence_6e9d6479e1cf978d = function() { return handleError(function (arg0, arg1, arg2) {
|
|
663
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
|
|
664
|
+
return ret;
|
|
665
|
+
}, arguments) };
|
|
666
|
+
imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
667
|
+
const ret = arg0.next;
|
|
668
|
+
return ret;
|
|
669
|
+
};
|
|
670
|
+
imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
671
|
+
const ret = arg0.next();
|
|
672
|
+
return ret;
|
|
673
|
+
}, arguments) };
|
|
674
|
+
imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
|
|
675
|
+
const ret = arg0.node;
|
|
676
|
+
return ret;
|
|
677
|
+
};
|
|
678
|
+
imports.wbg.__wbg_now_807e54c39636c349 = function() {
|
|
679
|
+
const ret = Date.now();
|
|
680
|
+
return ret;
|
|
681
|
+
};
|
|
682
|
+
imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
|
|
683
|
+
const ret = arg0.process;
|
|
684
|
+
return ret;
|
|
685
|
+
};
|
|
686
|
+
imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
|
|
687
|
+
const ret = arg0.push(arg1);
|
|
688
|
+
return ret;
|
|
689
|
+
};
|
|
690
|
+
imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
|
691
|
+
queueMicrotask(arg0);
|
|
692
|
+
};
|
|
693
|
+
imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
|
694
|
+
const ret = arg0.queueMicrotask;
|
|
695
|
+
return ret;
|
|
696
|
+
};
|
|
697
|
+
imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
|
|
698
|
+
arg0.randomFillSync(arg1);
|
|
699
|
+
}, arguments) };
|
|
700
|
+
imports.wbg.__wbg_readyState_7ef6e63c349899ed = function(arg0) {
|
|
701
|
+
const ret = arg0.readyState;
|
|
702
|
+
return ret;
|
|
703
|
+
};
|
|
704
|
+
imports.wbg.__wbg_reason_49f1cede8bcf23dd = function(arg0, arg1) {
|
|
705
|
+
const ret = arg1.reason;
|
|
706
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
707
|
+
const len1 = WASM_VECTOR_LEN;
|
|
708
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
709
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
710
|
+
};
|
|
711
|
+
imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
|
|
712
|
+
const ret = module.require;
|
|
713
|
+
return ret;
|
|
714
|
+
}, arguments) };
|
|
715
|
+
imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
|
716
|
+
const ret = Promise.resolve(arg0);
|
|
717
|
+
return ret;
|
|
718
|
+
};
|
|
719
|
+
imports.wbg.__wbg_send_fc0c204e8a1757f4 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
720
|
+
arg0.send(getArrayU8FromWasm0(arg1, arg2));
|
|
721
|
+
}, arguments) };
|
|
722
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
723
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
724
|
+
};
|
|
725
|
+
imports.wbg.__wbg_setbinaryType_92fa1ffd873b327c = function(arg0, arg1) {
|
|
726
|
+
arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
|
|
727
|
+
};
|
|
728
|
+
imports.wbg.__wbg_setonclose_14fc475a49d488fc = function(arg0, arg1) {
|
|
729
|
+
arg0.onclose = arg1;
|
|
730
|
+
};
|
|
731
|
+
imports.wbg.__wbg_setonerror_8639efe354b947cd = function(arg0, arg1) {
|
|
732
|
+
arg0.onerror = arg1;
|
|
733
|
+
};
|
|
734
|
+
imports.wbg.__wbg_setonmessage_6eccab530a8fb4c7 = function(arg0, arg1) {
|
|
735
|
+
arg0.onmessage = arg1;
|
|
736
|
+
};
|
|
737
|
+
imports.wbg.__wbg_setonopen_2da654e1f39745d5 = function(arg0, arg1) {
|
|
738
|
+
arg0.onopen = arg1;
|
|
739
|
+
};
|
|
740
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
741
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
742
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
743
|
+
};
|
|
744
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
745
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
746
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
747
|
+
};
|
|
748
|
+
imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
749
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
750
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
751
|
+
};
|
|
752
|
+
imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
753
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
754
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
755
|
+
};
|
|
756
|
+
imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
|
|
757
|
+
const ret = JSON.stringify(arg0);
|
|
758
|
+
return ret;
|
|
759
|
+
}, arguments) };
|
|
760
|
+
imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
761
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
762
|
+
return ret;
|
|
763
|
+
};
|
|
764
|
+
imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
|
765
|
+
const ret = arg0.then(arg1);
|
|
766
|
+
return ret;
|
|
767
|
+
};
|
|
768
|
+
imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
|
|
769
|
+
const ret = arg0.then(arg1, arg2);
|
|
770
|
+
return ret;
|
|
771
|
+
};
|
|
772
|
+
imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
773
|
+
const ret = arg0.value;
|
|
774
|
+
return ret;
|
|
775
|
+
};
|
|
776
|
+
imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
|
|
777
|
+
const ret = arg0.versions;
|
|
778
|
+
return ret;
|
|
779
|
+
};
|
|
780
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
781
|
+
const ret = +arg0;
|
|
782
|
+
return ret;
|
|
783
|
+
};
|
|
784
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
785
|
+
const v = arg0;
|
|
786
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
787
|
+
return ret;
|
|
788
|
+
};
|
|
789
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
790
|
+
const obj = arg0.original;
|
|
791
|
+
if (obj.cnt-- == 1) {
|
|
792
|
+
obj.a = 0;
|
|
793
|
+
return true;
|
|
794
|
+
}
|
|
795
|
+
const ret = false;
|
|
796
|
+
return ret;
|
|
797
|
+
};
|
|
798
|
+
imports.wbg.__wbindgen_closure_wrapper2516 = function(arg0, arg1, arg2) {
|
|
799
|
+
const ret = makeMutClosure(arg0, arg1, 1116, __wbg_adapter_44);
|
|
800
|
+
return ret;
|
|
801
|
+
};
|
|
802
|
+
imports.wbg.__wbindgen_closure_wrapper2518 = function(arg0, arg1, arg2) {
|
|
803
|
+
const ret = makeMutClosure(arg0, arg1, 1116, __wbg_adapter_44);
|
|
804
|
+
return ret;
|
|
805
|
+
};
|
|
806
|
+
imports.wbg.__wbindgen_closure_wrapper2520 = function(arg0, arg1, arg2) {
|
|
807
|
+
const ret = makeMutClosure(arg0, arg1, 1116, __wbg_adapter_44);
|
|
808
|
+
return ret;
|
|
809
|
+
};
|
|
810
|
+
imports.wbg.__wbindgen_closure_wrapper2522 = function(arg0, arg1, arg2) {
|
|
811
|
+
const ret = makeMutClosure(arg0, arg1, 1116, __wbg_adapter_44);
|
|
812
|
+
return ret;
|
|
813
|
+
};
|
|
814
|
+
imports.wbg.__wbindgen_closure_wrapper3055 = function(arg0, arg1, arg2) {
|
|
815
|
+
const ret = makeMutClosure(arg0, arg1, 1291, __wbg_adapter_53);
|
|
816
|
+
return ret;
|
|
817
|
+
};
|
|
818
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
819
|
+
const ret = debugString(arg1);
|
|
820
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
821
|
+
const len1 = WASM_VECTOR_LEN;
|
|
822
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
823
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
824
|
+
};
|
|
825
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
826
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
827
|
+
return ret;
|
|
828
|
+
};
|
|
829
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
830
|
+
const ret = arg0 in arg1;
|
|
831
|
+
return ret;
|
|
832
|
+
};
|
|
833
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
834
|
+
const table = wasm.__wbindgen_export_2;
|
|
835
|
+
const offset = table.grow(4);
|
|
836
|
+
table.set(0, undefined);
|
|
837
|
+
table.set(offset + 0, undefined);
|
|
838
|
+
table.set(offset + 1, null);
|
|
839
|
+
table.set(offset + 2, true);
|
|
840
|
+
table.set(offset + 3, false);
|
|
841
|
+
;
|
|
842
|
+
};
|
|
843
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
844
|
+
const ret = typeof(arg0) === 'function';
|
|
845
|
+
return ret;
|
|
846
|
+
};
|
|
847
|
+
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
848
|
+
const ret = arg0 === null;
|
|
849
|
+
return ret;
|
|
850
|
+
};
|
|
851
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
852
|
+
const val = arg0;
|
|
853
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
854
|
+
return ret;
|
|
855
|
+
};
|
|
856
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
857
|
+
const ret = typeof(arg0) === 'string';
|
|
858
|
+
return ret;
|
|
859
|
+
};
|
|
860
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
861
|
+
const ret = arg0 === undefined;
|
|
862
|
+
return ret;
|
|
863
|
+
};
|
|
864
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
865
|
+
const ret = arg0 == arg1;
|
|
866
|
+
return ret;
|
|
867
|
+
};
|
|
868
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
869
|
+
const ret = wasm.memory;
|
|
870
|
+
return ret;
|
|
871
|
+
};
|
|
872
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
873
|
+
const obj = arg1;
|
|
874
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
875
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
876
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
877
|
+
};
|
|
878
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
879
|
+
const ret = arg0;
|
|
880
|
+
return ret;
|
|
881
|
+
};
|
|
882
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
883
|
+
const obj = arg1;
|
|
884
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
885
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
886
|
+
var len1 = WASM_VECTOR_LEN;
|
|
887
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
888
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
889
|
+
};
|
|
890
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
891
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
892
|
+
return ret;
|
|
893
|
+
};
|
|
894
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
895
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
return imports;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
function __wbg_init_memory(imports, memory) {
|
|
902
|
+
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
function __wbg_finalize_init(instance, module) {
|
|
906
|
+
wasm = instance.exports;
|
|
907
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
908
|
+
cachedDataViewMemory0 = null;
|
|
909
|
+
cachedUint8ArrayMemory0 = null;
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
wasm.__wbindgen_start();
|
|
913
|
+
return wasm;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
function initSync(module) {
|
|
917
|
+
if (wasm !== undefined) return wasm;
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
if (typeof module !== 'undefined') {
|
|
921
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
922
|
+
({module} = module)
|
|
923
|
+
} else {
|
|
924
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
const imports = __wbg_get_imports();
|
|
929
|
+
|
|
930
|
+
__wbg_init_memory(imports);
|
|
931
|
+
|
|
932
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
933
|
+
module = new WebAssembly.Module(module);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
937
|
+
|
|
938
|
+
return __wbg_finalize_init(instance, module);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
async function __wbg_init(module_or_path) {
|
|
942
|
+
if (wasm !== undefined) return wasm;
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
if (typeof module_or_path !== 'undefined') {
|
|
946
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
947
|
+
({module_or_path} = module_or_path)
|
|
948
|
+
} else {
|
|
949
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
if (typeof module_or_path === 'undefined') {
|
|
954
|
+
module_or_path = new URL('rivetkit_wasm_bg.wasm', import.meta.url);
|
|
955
|
+
}
|
|
956
|
+
const imports = __wbg_get_imports();
|
|
957
|
+
|
|
958
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
959
|
+
module_or_path = fetch(module_or_path);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
__wbg_init_memory(imports);
|
|
963
|
+
|
|
964
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
965
|
+
|
|
966
|
+
return __wbg_finalize_init(instance, module);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
export { initSync };
|
|
970
|
+
export default __wbg_init;
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_actorcontext_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_actorfactory_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_cancellationtoken_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_coreregistry_free: (a: number, b: number) => void;
|
|
8
|
+
export const actorcontext_new: () => [number, number, number];
|
|
9
|
+
export const actorfactory_new: (a: any, b: any) => [number, number, number];
|
|
10
|
+
export const awaitPromise: (a: any) => any;
|
|
11
|
+
export const bridgeRivetErrorPrefix: () => [number, number];
|
|
12
|
+
export const cancellationtoken_aborted: (a: number) => number;
|
|
13
|
+
export const cancellationtoken_cancel: (a: number) => void;
|
|
14
|
+
export const cancellationtoken_new: () => number;
|
|
15
|
+
export const cancellationtoken_onCancelled: (a: number, b: any) => void;
|
|
16
|
+
export const coreregistry_new: () => number;
|
|
17
|
+
export const coreregistry_register: (a: number, b: number, c: number, d: number) => [number, number];
|
|
18
|
+
export const coreregistry_serve: (a: number, b: any) => any;
|
|
19
|
+
export const coreregistry_shutdown: (a: number) => any;
|
|
20
|
+
export const roundTripBytes: (a: number, b: number) => [number, number];
|
|
21
|
+
export const uint8ArrayFromBytes: (a: number, b: number) => any;
|
|
22
|
+
export const __wbg_connhandle_free: (a: number, b: number) => void;
|
|
23
|
+
export const __wbg_websockethandle_free: (a: number, b: number) => void;
|
|
24
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
25
|
+
export const __externref_table_alloc: () => number;
|
|
26
|
+
export const __wbindgen_export_2: WebAssembly.Table;
|
|
27
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
28
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
29
|
+
export const __wbindgen_export_5: WebAssembly.Table;
|
|
30
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
31
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
32
|
+
export const closure1115_externref_shim: (a: number, b: number, c: any) => void;
|
|
33
|
+
export const closure1290_externref_shim: (a: number, b: number, c: any) => void;
|
|
34
|
+
export const closure1517_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
35
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const packageDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
8
|
+
const pkgDir = join(packageDir, "pkg");
|
|
9
|
+
|
|
10
|
+
if (["1", "true"].includes(process.env.SKIP_WASM_BUILD ?? "")) {
|
|
11
|
+
const hasPkg = existsSync(join(pkgDir, "rivetkit_wasm.js"));
|
|
12
|
+
console.log(
|
|
13
|
+
hasPkg
|
|
14
|
+
? "[rivetkit-wasm/build] using existing pkg artifact"
|
|
15
|
+
: "[rivetkit-wasm/build] skipped",
|
|
16
|
+
);
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const targetIndex = args.indexOf("--target");
|
|
22
|
+
const outDirIndex = args.indexOf("--out-dir");
|
|
23
|
+
|
|
24
|
+
const target = targetIndex >= 0 ? args[targetIndex + 1] : "web";
|
|
25
|
+
const outDir = outDirIndex >= 0 ? args[outDirIndex + 1] : "pkg";
|
|
26
|
+
|
|
27
|
+
if (!target) {
|
|
28
|
+
throw new Error("--target requires a value");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!outDir) {
|
|
32
|
+
throw new Error("--out-dir requires a value");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const cmd = [
|
|
36
|
+
"wasm-pack",
|
|
37
|
+
"build",
|
|
38
|
+
"--target",
|
|
39
|
+
target,
|
|
40
|
+
"--out-dir",
|
|
41
|
+
outDir,
|
|
42
|
+
"--out-name",
|
|
43
|
+
"rivetkit_wasm",
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
console.log(`[rivetkit-wasm/build] running: ${cmd.join(" ")}`);
|
|
47
|
+
execFileSync("npx", ["-y", ...cmd], { stdio: "inherit" });
|