@oona/vlo 0.0.0-stage → 0.1.1
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/LICENSE +201 -0
- package/NOTICE +5 -0
- package/README.md +83 -2
- package/dist/agent.d.ts +151 -0
- package/dist/agent.js +445 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +1540 -0
- package/dist/define-DwM_Qhbw.js +74 -0
- package/dist/domain-Bs8TeDCv.js +338 -0
- package/dist/domain-CJN6n_JD.d.ts +860 -0
- package/dist/host.d.ts +844 -0
- package/dist/host.js +314 -0
- package/dist/index-CIIcdblQ.d.ts +824 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +4 -0
- package/dist/roles-D25bG980.js +3869 -0
- package/dist/src-DVCYkPA7.js +734 -0
- package/dist/testing.d.ts +58 -0
- package/dist/testing.js +511 -0
- package/dist/types-BLQQMmkc.d.ts +746 -0
- package/dist/vlo_kernel-CtzHHfHA.js +276 -0
- package/package.json +95 -4
- package/wasm/vlo_kernel.d.ts +82 -0
- package/wasm/vlo_kernel.js +382 -0
- package/wasm/vlo_kernel_bg.wasm +0 -0
- package/wasm/vlo_kernel_bg.wasm.d.ts +15 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
// wasm/vlo_kernel.js
|
|
2
|
+
/**
|
|
3
|
+
* Hash `(kernel_state, state)`; input `StateHashInput`, value `StateHashOutput`.
|
|
4
|
+
* @param {string} input
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
function compute_state_hash(input) {
|
|
8
|
+
let deferred2_0;
|
|
9
|
+
let deferred2_1;
|
|
10
|
+
try {
|
|
11
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
12
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
13
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14
|
+
wasm.compute_state_hash(retptr, ptr0, len0);
|
|
15
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
16
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
17
|
+
deferred2_0 = r0;
|
|
18
|
+
deferred2_1 = r1;
|
|
19
|
+
return getStringFromWasm0(r0, r1);
|
|
20
|
+
} finally {
|
|
21
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
22
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Derive `task_id`, `idempotency_key` and `child_run_id`; input `DeriveIdsInput`, value `DeriveIdsOutput`.
|
|
27
|
+
* @param {string} input
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
function derive_ids(input) {
|
|
31
|
+
let deferred2_0;
|
|
32
|
+
let deferred2_1;
|
|
33
|
+
try {
|
|
34
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
35
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
36
|
+
const len0 = WASM_VECTOR_LEN;
|
|
37
|
+
wasm.derive_ids(retptr, ptr0, len0);
|
|
38
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
39
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
40
|
+
deferred2_0 = r0;
|
|
41
|
+
deferred2_1 = r1;
|
|
42
|
+
return getStringFromWasm0(r0, r1);
|
|
43
|
+
} finally {
|
|
44
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
45
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Kernel crate version, protocol version and feature list.
|
|
50
|
+
* @returns {string}
|
|
51
|
+
*/
|
|
52
|
+
function kernel_version() {
|
|
53
|
+
let deferred1_0;
|
|
54
|
+
let deferred1_1;
|
|
55
|
+
try {
|
|
56
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
57
|
+
wasm.kernel_version(retptr);
|
|
58
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
59
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
60
|
+
deferred1_0 = r0;
|
|
61
|
+
deferred1_1 = r1;
|
|
62
|
+
return getStringFromWasm0(r0, r1);
|
|
63
|
+
} finally {
|
|
64
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
65
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Plan the next attempt from policy, cause and journaled `random`; input `PlanRetryInput`, value `RetryPlan`.
|
|
70
|
+
* @param {string} input
|
|
71
|
+
* @returns {string}
|
|
72
|
+
*/
|
|
73
|
+
function plan_retry(input) {
|
|
74
|
+
let deferred2_0;
|
|
75
|
+
let deferred2_1;
|
|
76
|
+
try {
|
|
77
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
78
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
79
|
+
const len0 = WASM_VECTOR_LEN;
|
|
80
|
+
wasm.plan_retry(retptr, ptr0, len0);
|
|
81
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
82
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
83
|
+
deferred2_0 = r0;
|
|
84
|
+
deferred2_1 = r1;
|
|
85
|
+
return getStringFromWasm0(r0, r1);
|
|
86
|
+
} finally {
|
|
87
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
88
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Classify an event into a reducer call or a lifecycle write-set; input `PrepareEventInput`, value `Prepared`.
|
|
93
|
+
* @param {string} input
|
|
94
|
+
* @returns {string}
|
|
95
|
+
*/
|
|
96
|
+
function prepare_event(input) {
|
|
97
|
+
let deferred2_0;
|
|
98
|
+
let deferred2_1;
|
|
99
|
+
try {
|
|
100
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
101
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
102
|
+
const len0 = WASM_VECTOR_LEN;
|
|
103
|
+
wasm.prepare_event(retptr, ptr0, len0);
|
|
104
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
105
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
106
|
+
deferred2_0 = r0;
|
|
107
|
+
deferred2_1 = r1;
|
|
108
|
+
return getStringFromWasm0(r0, r1);
|
|
109
|
+
} finally {
|
|
110
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
111
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Turn a reducer's `(state, commands)` into the write-set; input `ReduceStepInput`, value `Transition`.
|
|
116
|
+
* @param {string} input
|
|
117
|
+
* @returns {string}
|
|
118
|
+
*/
|
|
119
|
+
function reduce_step(input) {
|
|
120
|
+
let deferred2_0;
|
|
121
|
+
let deferred2_1;
|
|
122
|
+
try {
|
|
123
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
124
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
wasm.reduce_step(retptr, ptr0, len0);
|
|
127
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
128
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
129
|
+
deferred2_0 = r0;
|
|
130
|
+
deferred2_1 = r1;
|
|
131
|
+
return getStringFromWasm0(r0, r1);
|
|
132
|
+
} finally {
|
|
133
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
134
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Find the first divergent `(seq, hash)` between journal and re-fold; input `RefoldCheckInput`, value `RefoldCheckOutput`.
|
|
139
|
+
* @param {string} input
|
|
140
|
+
* @returns {string}
|
|
141
|
+
*/
|
|
142
|
+
function refold_check(input) {
|
|
143
|
+
let deferred2_0;
|
|
144
|
+
let deferred2_1;
|
|
145
|
+
try {
|
|
146
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
147
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
148
|
+
const len0 = WASM_VECTOR_LEN;
|
|
149
|
+
wasm.refold_check(retptr, ptr0, len0);
|
|
150
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
151
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
152
|
+
deferred2_0 = r0;
|
|
153
|
+
deferred2_1 = r1;
|
|
154
|
+
return getStringFromWasm0(r0, r1);
|
|
155
|
+
} finally {
|
|
156
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
157
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Field and enum checks on an event envelope; input `EventInput`, value `ValidateEventOutput`.
|
|
162
|
+
* @param {string} input
|
|
163
|
+
* @returns {string}
|
|
164
|
+
*/
|
|
165
|
+
function validate_event(input) {
|
|
166
|
+
let deferred2_0;
|
|
167
|
+
let deferred2_1;
|
|
168
|
+
try {
|
|
169
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
170
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
171
|
+
const len0 = WASM_VECTOR_LEN;
|
|
172
|
+
wasm.validate_event(retptr, ptr0, len0);
|
|
173
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
|
|
174
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
|
|
175
|
+
deferred2_0 = r0;
|
|
176
|
+
deferred2_1 = r1;
|
|
177
|
+
return getStringFromWasm0(r0, r1);
|
|
178
|
+
} finally {
|
|
179
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
180
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function __wbg_get_imports() {
|
|
184
|
+
return {
|
|
185
|
+
__proto__: null,
|
|
186
|
+
"./vlo_kernel_bg.js": { __proto__: null }
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
let cachedDataViewMemory0 = null;
|
|
190
|
+
function getDataViewMemory0() {
|
|
191
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
192
|
+
return cachedDataViewMemory0;
|
|
193
|
+
}
|
|
194
|
+
function getStringFromWasm0(ptr, len) {
|
|
195
|
+
return decodeText(ptr >>> 0, len);
|
|
196
|
+
}
|
|
197
|
+
let cachedUint8ArrayMemory0 = null;
|
|
198
|
+
function getUint8ArrayMemory0() {
|
|
199
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
200
|
+
return cachedUint8ArrayMemory0;
|
|
201
|
+
}
|
|
202
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
203
|
+
if (realloc === void 0) {
|
|
204
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
205
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
206
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
207
|
+
WASM_VECTOR_LEN = buf.length;
|
|
208
|
+
return ptr;
|
|
209
|
+
}
|
|
210
|
+
let len = arg.length;
|
|
211
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
212
|
+
const mem = getUint8ArrayMemory0();
|
|
213
|
+
let offset = 0;
|
|
214
|
+
for (; offset < len; offset++) {
|
|
215
|
+
const code = arg.charCodeAt(offset);
|
|
216
|
+
if (code > 127) break;
|
|
217
|
+
mem[ptr + offset] = code;
|
|
218
|
+
}
|
|
219
|
+
if (offset !== len) {
|
|
220
|
+
if (offset !== 0) arg = arg.slice(offset);
|
|
221
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
222
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
223
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
224
|
+
offset += ret.written;
|
|
225
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
226
|
+
}
|
|
227
|
+
WASM_VECTOR_LEN = offset;
|
|
228
|
+
return ptr;
|
|
229
|
+
}
|
|
230
|
+
let cachedTextDecoder = new TextDecoder("utf-8", {
|
|
231
|
+
ignoreBOM: true,
|
|
232
|
+
fatal: true
|
|
233
|
+
});
|
|
234
|
+
cachedTextDecoder.decode();
|
|
235
|
+
const MAX_SAFARI_DECODE_BYTES = 0x7ff00000;
|
|
236
|
+
let numBytesDecoded = 0;
|
|
237
|
+
function decodeText(ptr, len) {
|
|
238
|
+
numBytesDecoded += len;
|
|
239
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
240
|
+
cachedTextDecoder = new TextDecoder("utf-8", {
|
|
241
|
+
ignoreBOM: true,
|
|
242
|
+
fatal: true
|
|
243
|
+
});
|
|
244
|
+
cachedTextDecoder.decode();
|
|
245
|
+
numBytesDecoded = len;
|
|
246
|
+
}
|
|
247
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
248
|
+
}
|
|
249
|
+
const cachedTextEncoder = new TextEncoder();
|
|
250
|
+
if (!("encodeInto" in cachedTextEncoder)) cachedTextEncoder.encodeInto = function(arg, view) {
|
|
251
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
252
|
+
view.set(buf);
|
|
253
|
+
return {
|
|
254
|
+
read: arg.length,
|
|
255
|
+
written: buf.length
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
let WASM_VECTOR_LEN = 0;
|
|
259
|
+
let wasm;
|
|
260
|
+
function __wbg_finalize_init(instance, module) {
|
|
261
|
+
wasm = instance.exports;
|
|
262
|
+
cachedDataViewMemory0 = null;
|
|
263
|
+
cachedUint8ArrayMemory0 = null;
|
|
264
|
+
return wasm;
|
|
265
|
+
}
|
|
266
|
+
function initSync(module) {
|
|
267
|
+
if (wasm !== void 0) return wasm;
|
|
268
|
+
if (module !== void 0) {
|
|
269
|
+
if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
|
|
270
|
+
else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
271
|
+
}
|
|
272
|
+
const imports = __wbg_get_imports();
|
|
273
|
+
if (!(module instanceof WebAssembly.Module)) module = new WebAssembly.Module(module);
|
|
274
|
+
return __wbg_finalize_init(new WebAssembly.Instance(module, imports), module);
|
|
275
|
+
}
|
|
276
|
+
export { compute_state_hash, derive_ids, initSync, kernel_version, plan_retry, prepare_event, reduce_step, refold_check, validate_event };
|
package/package.json
CHANGED
|
@@ -1,6 +1,97 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oona/vlo",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Vlo: an event-sourced durable execution engine for workflows and agents. Workflows are pure reducers; the kernel is Rust compiled to wasm; your Postgres or SQLite is the journal.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/oonalab/vlo.git",
|
|
11
|
+
"directory": "sdk/ts/sdk"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://oonalab.github.io/vlo/",
|
|
14
|
+
"bugs": "https://github.com/oonalab/vlo/issues",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"workflow",
|
|
17
|
+
"durable-execution",
|
|
18
|
+
"event-sourcing",
|
|
19
|
+
"state-machine",
|
|
20
|
+
"wasm",
|
|
21
|
+
"agents",
|
|
22
|
+
"postgres",
|
|
23
|
+
"sqlite",
|
|
24
|
+
"llm",
|
|
25
|
+
"budget"
|
|
26
|
+
],
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=22.5"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"wasm",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"NOTICE"
|
|
39
|
+
],
|
|
40
|
+
"bin": {
|
|
41
|
+
"vlo": "./dist/cli.js"
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"import": "./dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./host": {
|
|
49
|
+
"types": "./dist/host.d.ts",
|
|
50
|
+
"import": "./dist/host.js"
|
|
51
|
+
},
|
|
52
|
+
"./testing": {
|
|
53
|
+
"types": "./dist/testing.d.ts",
|
|
54
|
+
"import": "./dist/testing.js"
|
|
55
|
+
},
|
|
56
|
+
"./agent": {
|
|
57
|
+
"types": "./dist/agent.d.ts",
|
|
58
|
+
"import": "./dist/agent.js"
|
|
59
|
+
},
|
|
60
|
+
"./package.json": "./package.json"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsdown",
|
|
64
|
+
"typecheck": "tsc --noEmit",
|
|
65
|
+
"test": "vitest run",
|
|
66
|
+
"test:watch": "vitest",
|
|
67
|
+
"kernel:build": "../../../scripts/build-kernel.sh",
|
|
68
|
+
"size": "node scripts/size-gate.mjs",
|
|
69
|
+
"docs:api": "typedoc --options ../typedoc.json",
|
|
70
|
+
"prepack": "cp ../../../LICENSE ../../../NOTICE ."
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"pg": "^8.16.3"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"@google-cloud/storage": "^7",
|
|
77
|
+
"zod": "^4.0.0"
|
|
78
|
+
},
|
|
79
|
+
"peerDependenciesMeta": {
|
|
80
|
+
"@google-cloud/storage": {
|
|
81
|
+
"optional": true
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@google-cloud/storage": "^7.0.0",
|
|
86
|
+
"@types/node": "^24.0.0",
|
|
87
|
+
"@types/pg": "^8.15.0",
|
|
88
|
+
"tsdown": "^0.23.0",
|
|
89
|
+
"tsx": "^4.19.0",
|
|
90
|
+
"typedoc": "^0.28.20",
|
|
91
|
+
"typedoc-plugin-markdown": "^4.14.1",
|
|
92
|
+
"typedoc-vitepress-theme": "^1.1.4",
|
|
93
|
+
"typescript": "^5.7.0",
|
|
94
|
+
"vitest": "^4.1.9",
|
|
95
|
+
"zod": "^4.0.0"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hash `(kernel_state, state)`; input `StateHashInput`, value `StateHashOutput`.
|
|
6
|
+
*/
|
|
7
|
+
export function compute_state_hash(input: string): string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Derive `task_id`, `idempotency_key` and `child_run_id`; input `DeriveIdsInput`, value `DeriveIdsOutput`.
|
|
11
|
+
*/
|
|
12
|
+
export function derive_ids(input: string): string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Kernel crate version, protocol version and feature list.
|
|
16
|
+
*/
|
|
17
|
+
export function kernel_version(): string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Plan the next attempt from policy, cause and journaled `random`; input `PlanRetryInput`, value `RetryPlan`.
|
|
21
|
+
*/
|
|
22
|
+
export function plan_retry(input: string): string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Classify an event into a reducer call or a lifecycle write-set; input `PrepareEventInput`, value `Prepared`.
|
|
26
|
+
*/
|
|
27
|
+
export function prepare_event(input: string): string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Turn a reducer's `(state, commands)` into the write-set; input `ReduceStepInput`, value `Transition`.
|
|
31
|
+
*/
|
|
32
|
+
export function reduce_step(input: string): string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Find the first divergent `(seq, hash)` between journal and re-fold; input `RefoldCheckInput`, value `RefoldCheckOutput`.
|
|
36
|
+
*/
|
|
37
|
+
export function refold_check(input: string): string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Field and enum checks on an event envelope; input `EventInput`, value `ValidateEventOutput`.
|
|
41
|
+
*/
|
|
42
|
+
export function validate_event(input: string): string;
|
|
43
|
+
|
|
44
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
45
|
+
|
|
46
|
+
export interface InitOutput {
|
|
47
|
+
readonly memory: WebAssembly.Memory;
|
|
48
|
+
readonly compute_state_hash: (a: number, b: number, c: number) => void;
|
|
49
|
+
readonly derive_ids: (a: number, b: number, c: number) => void;
|
|
50
|
+
readonly kernel_version: (a: number) => void;
|
|
51
|
+
readonly plan_retry: (a: number, b: number, c: number) => void;
|
|
52
|
+
readonly prepare_event: (a: number, b: number, c: number) => void;
|
|
53
|
+
readonly reduce_step: (a: number, b: number, c: number) => void;
|
|
54
|
+
readonly refold_check: (a: number, b: number, c: number) => void;
|
|
55
|
+
readonly validate_event: (a: number, b: number, c: number) => void;
|
|
56
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
57
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
58
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
59
|
+
readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
66
|
+
* a precompiled `WebAssembly.Module`.
|
|
67
|
+
*
|
|
68
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
69
|
+
*
|
|
70
|
+
* @returns {InitOutput}
|
|
71
|
+
*/
|
|
72
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
76
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
77
|
+
*
|
|
78
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
79
|
+
*
|
|
80
|
+
* @returns {Promise<InitOutput>}
|
|
81
|
+
*/
|
|
82
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|