@bytecodealliance/jco 0.14.0 → 0.14.2
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/README.md +20 -6
- package/lib/wasi_snapshot_preview1.command.wasm +0 -0
- package/lib/wasi_snapshot_preview1.reactor.wasm +0 -0
- package/obj/js-component-bindgen-component.component.wasm +0 -0
- package/obj/js-component-bindgen-component.core.wasm +0 -0
- package/obj/js-component-bindgen-component.core2.wasm +0 -0
- package/obj/js-component-bindgen-component.d.ts +0 -1
- package/obj/js-component-bindgen-component.js +97 -112
- package/obj/wasm-tools.component.wasm +0 -0
- package/obj/wasm-tools.core.wasm +0 -0
- package/obj/wasm-tools.core2.wasm +0 -0
- package/obj/wasm-tools.d.ts +0 -1
- package/obj/wasm-tools.js +97 -112
- package/package.json +7 -5
- package/src/browser.d.ts +2 -3
- package/src/browser.d.ts.map +1 -1
- package/src/browser.js +11 -3
- package/src/cmd/componentize.d.ts.map +1 -1
- package/src/cmd/run.js +54 -24
- package/src/cmd/transpile.d.ts +4 -4
- package/src/cmd/transpile.d.ts.map +1 -1
- package/src/cmd/transpile.js +3 -5
- package/src/cmd/wasm-tools.d.ts.map +1 -1
- package/src/jco.js +41 -6
package/README.md
CHANGED
|
@@ -10,17 +10,24 @@
|
|
|
10
10
|
<p>
|
|
11
11
|
<a href="https://github.com/bytecodealliance/jco/actions?query=workflow%3ACI"><img src="https://github.com/bytecodealliance/jco/workflows/CI/badge.svg" alt="build status" /></a>
|
|
12
12
|
</p>
|
|
13
|
+
|
|
14
|
+
<h3>
|
|
15
|
+
<a href="https://bytecodealliance.github.io/jco/">Contributing</a>
|
|
16
|
+
<span> | </span>
|
|
17
|
+
<a href="https://bytecodealliance.zulipchat.com/#narrow/stream/409526-jco">Chat on Zulip</a>
|
|
18
|
+
</h3>
|
|
13
19
|
</div>
|
|
14
20
|
|
|
15
21
|
## Overview
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
JCO provides a fully native JS toolchain for working with [WebAssembly Components](https://github.com/WebAssembly/component-model) in JavaScript.
|
|
18
24
|
|
|
19
25
|
Features include:
|
|
20
26
|
|
|
21
27
|
* "Transpiling" Wasm Component binaries into ES modules that can run in any JS environment.
|
|
22
28
|
* WASI Preview2 support in Node.js ([undergoing stabilization](https://github.com/bytecodealliance/jco/milestone/1)) & browsers (experimental).
|
|
23
29
|
* Component builds of [Wasm Tools](https://github.com/bytecodealliance/wasm-tools) helpers, available for use as a library or CLI commands for use in native JS environments, as well as optimization helper for Components via Binaryen.
|
|
30
|
+
* Run and serve commands like Wasmtime, as JS implementations of the Command and HTTP Proxy worlds.
|
|
24
31
|
* "Componentize" command to easily create components written in JavaScript (wrapper of [ComponentizeJS](https://github.com/bytecodealliance/ComponentizeJS)).
|
|
25
32
|
|
|
26
33
|
For creating components in other languages, see the [Cargo Component](https://github.com/bytecodealliance/cargo-Component) project for Rust and [Wit Bindgen](https://github.com/bytecodealliance/wit-bindgen) for various guest bindgen helpers.
|
|
@@ -33,7 +40,7 @@ For creating components in other languages, see the [Cargo Component](https://gi
|
|
|
33
40
|
npm install @bytecodealliance/jco
|
|
34
41
|
```
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
JCO can be used as either a library import or as a CLI via the `jco` command.
|
|
37
44
|
|
|
38
45
|
## Example
|
|
39
46
|
|
|
@@ -54,7 +61,8 @@ Options:
|
|
|
54
61
|
Commands:
|
|
55
62
|
componentize [options] <js-source> Create a component from a JavaScript module
|
|
56
63
|
transpile [options] <component-path> Transpile a WebAssembly Component to JS + core Wasm for JavaScript execution
|
|
57
|
-
run <command> [args...]
|
|
64
|
+
run [options] <command> [args...] Run a WASI Command component
|
|
65
|
+
serve [options] <command> [args...] Serve a WASI HTTP component
|
|
58
66
|
opt [options] <component-file> optimizes a Wasm component, including running wasm-opt Binaryen optimizations
|
|
59
67
|
wit [options] <component-path> extract the WIT from a WebAssembly Component [wasm-tools component wit]
|
|
60
68
|
print [options] <input> print the WebAssembly WAT text for a binary file [wasm-tools print]
|
|
@@ -110,9 +118,9 @@ Options include:
|
|
|
110
118
|
|
|
111
119
|
To directly call into the transpilation in Rust, the bindgen used in jco is also available on crates.io as [js-component-bindgen](https://crates.io/crates/js-component-bindgen).
|
|
112
120
|
|
|
113
|
-
### Run
|
|
121
|
+
### Run & Serve
|
|
114
122
|
|
|
115
|
-
For Wasm components that implement the WASI Command world, a `jco run` utility is provided to run these applications in Node.js
|
|
123
|
+
For Wasm components that implement the WASI Command world, a `jco run` utility is provided to run these applications in Node.js.
|
|
116
124
|
|
|
117
125
|
```
|
|
118
126
|
jco run cowasy.component.wasm hello
|
|
@@ -120,7 +128,13 @@ jco run cowasy.component.wasm hello
|
|
|
120
128
|
|
|
121
129
|
Using the preview2-shim WASI implementation, full access to the underlying system primitives is provided, including filesystem and environment variable permissions.
|
|
122
130
|
|
|
123
|
-
|
|
131
|
+
For HTTP Proxy components, `jco serve` provides a JS server implementation:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
jco serve --port 8080 server.wasm
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
> [Wasmtime](https://github.com/bytecodealliance/wasmtime) generally provides the most performant implementation for executing command and proxy worlds to use. These implementations are rather for when JS virtualization is required or the most convenient approach.
|
|
124
138
|
|
|
125
139
|
### Componentize
|
|
126
140
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -69,7 +69,6 @@ import { WasiFilesystemTypes } from './interfaces/wasi-filesystem-types.js';
|
|
|
69
69
|
import { WasiIoError } from './interfaces/wasi-io-error.js';
|
|
70
70
|
import { WasiIoStreams } from './interfaces/wasi-io-streams.js';
|
|
71
71
|
import { WasiRandomRandom } from './interfaces/wasi-random-random.js';
|
|
72
|
-
import { WasiSocketsTcp } from './interfaces/wasi-sockets-tcp.js';
|
|
73
72
|
export function generate(component: Uint8Array, options: GenerateOptions): Transpiled;
|
|
74
73
|
export function generateTypes(name: string, options: TypeGenerationOptions): Files;
|
|
75
74
|
|
|
@@ -97,7 +97,7 @@ function utf8Encode(s, realloc, memory) {
|
|
|
97
97
|
let exports0;
|
|
98
98
|
let exports1;
|
|
99
99
|
|
|
100
|
-
function
|
|
100
|
+
function trampoline7() {
|
|
101
101
|
const ret = getStderr();
|
|
102
102
|
if (!(ret instanceof OutputStream)) {
|
|
103
103
|
throw new Error('Resource error: Not a valid "OutputStream" resource.');
|
|
@@ -107,7 +107,7 @@ function trampoline8() {
|
|
|
107
107
|
return handle0;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
function
|
|
110
|
+
function trampoline8(arg0) {
|
|
111
111
|
let variant0;
|
|
112
112
|
switch (arg0) {
|
|
113
113
|
case 0: {
|
|
@@ -131,7 +131,7 @@ function trampoline9(arg0) {
|
|
|
131
131
|
exit(variant0);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
function
|
|
134
|
+
function trampoline9() {
|
|
135
135
|
const ret = getStdin();
|
|
136
136
|
if (!(ret instanceof InputStream)) {
|
|
137
137
|
throw new Error('Resource error: Not a valid "InputStream" resource.');
|
|
@@ -141,7 +141,7 @@ function trampoline10() {
|
|
|
141
141
|
return handle0;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function
|
|
144
|
+
function trampoline10() {
|
|
145
145
|
const ret = getStdout();
|
|
146
146
|
if (!(ret instanceof OutputStream)) {
|
|
147
147
|
throw new Error('Resource error: Not a valid "OutputStream" resource.');
|
|
@@ -152,7 +152,7 @@ function trampoline11() {
|
|
|
152
152
|
}
|
|
153
153
|
let exports2;
|
|
154
154
|
|
|
155
|
-
function
|
|
155
|
+
function trampoline11(arg0) {
|
|
156
156
|
const ret = getDirectories();
|
|
157
157
|
var vec3 = ret;
|
|
158
158
|
var len3 = vec3.length;
|
|
@@ -163,8 +163,8 @@ function trampoline12(arg0) {
|
|
|
163
163
|
if (!(tuple0_0 instanceof Descriptor)) {
|
|
164
164
|
throw new Error('Resource error: Not a valid "Descriptor" resource.');
|
|
165
165
|
}
|
|
166
|
-
var handle1 =
|
|
167
|
-
|
|
166
|
+
var handle1 = handleCnt5++;
|
|
167
|
+
handleTable5.set(handle1, { rep: tuple0_0, own: true });
|
|
168
168
|
dataView(memory0).setInt32(base + 0, handle1, true);
|
|
169
169
|
var ptr2 = utf8Encode(tuple0_1, realloc0, memory0);
|
|
170
170
|
var len2 = utf8EncodedLen;
|
|
@@ -177,9 +177,9 @@ function trampoline12(arg0) {
|
|
|
177
177
|
let memory0;
|
|
178
178
|
let realloc0;
|
|
179
179
|
|
|
180
|
-
function
|
|
180
|
+
function trampoline12(arg0, arg1, arg2) {
|
|
181
181
|
var handle1 = arg0;
|
|
182
|
-
var rsc0 =
|
|
182
|
+
var rsc0 = handleTable5.get(handle1).rep;
|
|
183
183
|
let ret;
|
|
184
184
|
try {
|
|
185
185
|
ret = { tag: 'ok', val: Descriptor.prototype.readViaStream.call(rsc0, BigInt.asUintN(64, arg1)) };
|
|
@@ -370,9 +370,9 @@ function trampoline13(arg0, arg1, arg2) {
|
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
function
|
|
373
|
+
function trampoline13(arg0, arg1, arg2) {
|
|
374
374
|
var handle1 = arg0;
|
|
375
|
-
var rsc0 =
|
|
375
|
+
var rsc0 = handleTable5.get(handle1).rep;
|
|
376
376
|
let ret;
|
|
377
377
|
try {
|
|
378
378
|
ret = { tag: 'ok', val: Descriptor.prototype.writeViaStream.call(rsc0, BigInt.asUintN(64, arg1)) };
|
|
@@ -563,9 +563,9 @@ function trampoline14(arg0, arg1, arg2) {
|
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
|
|
566
|
-
function
|
|
566
|
+
function trampoline14(arg0, arg1) {
|
|
567
567
|
var handle1 = arg0;
|
|
568
|
-
var rsc0 =
|
|
568
|
+
var rsc0 = handleTable5.get(handle1).rep;
|
|
569
569
|
let ret;
|
|
570
570
|
try {
|
|
571
571
|
ret = { tag: 'ok', val: Descriptor.prototype.appendViaStream.call(rsc0) };
|
|
@@ -756,9 +756,9 @@ function trampoline15(arg0, arg1) {
|
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
|
|
759
|
-
function
|
|
759
|
+
function trampoline15(arg0, arg1) {
|
|
760
760
|
var handle1 = arg0;
|
|
761
|
-
var rsc0 =
|
|
761
|
+
var rsc0 = handleTable5.get(handle1).rep;
|
|
762
762
|
let ret;
|
|
763
763
|
try {
|
|
764
764
|
ret = { tag: 'ok', val: Descriptor.prototype.getType.call(rsc0) };
|
|
@@ -987,9 +987,9 @@ function trampoline16(arg0, arg1) {
|
|
|
987
987
|
}
|
|
988
988
|
}
|
|
989
989
|
|
|
990
|
-
function
|
|
990
|
+
function trampoline16(arg0, arg1) {
|
|
991
991
|
var handle1 = arg0;
|
|
992
|
-
var rsc0 =
|
|
992
|
+
var rsc0 = handleTable5.get(handle1).rep;
|
|
993
993
|
let ret;
|
|
994
994
|
try {
|
|
995
995
|
ret = { tag: 'ok', val: Descriptor.prototype.stat.call(rsc0) };
|
|
@@ -1251,9 +1251,9 @@ function trampoline17(arg0, arg1) {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
|
|
1254
|
-
function
|
|
1254
|
+
function trampoline17(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1255
1255
|
var handle1 = arg0;
|
|
1256
|
-
var rsc0 =
|
|
1256
|
+
var rsc0 = handleTable5.get(handle1).rep;
|
|
1257
1257
|
if ((arg1 & 4294967294) !== 0) {
|
|
1258
1258
|
throw new TypeError('flags have extraneous bits set');
|
|
1259
1259
|
}
|
|
@@ -1297,8 +1297,8 @@ function trampoline18(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
|
1297
1297
|
if (!(e instanceof Descriptor)) {
|
|
1298
1298
|
throw new Error('Resource error: Not a valid "Descriptor" resource.');
|
|
1299
1299
|
}
|
|
1300
|
-
var handle6 =
|
|
1301
|
-
|
|
1300
|
+
var handle6 = handleCnt5++;
|
|
1301
|
+
handleTable5.set(handle6, { rep: e, own: true });
|
|
1302
1302
|
dataView(memory0).setInt32(arg6 + 4, handle6, true);
|
|
1303
1303
|
break;
|
|
1304
1304
|
}
|
|
@@ -1473,9 +1473,9 @@ function trampoline18(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
1475
|
|
|
1476
|
-
function
|
|
1476
|
+
function trampoline18(arg0, arg1) {
|
|
1477
1477
|
var handle1 = arg0;
|
|
1478
|
-
var rsc0 =
|
|
1478
|
+
var rsc0 = handleTable5.get(handle1).rep;
|
|
1479
1479
|
let ret;
|
|
1480
1480
|
try {
|
|
1481
1481
|
ret = { tag: 'ok', val: Descriptor.prototype.metadataHash.call(rsc0) };
|
|
@@ -1663,7 +1663,7 @@ function trampoline19(arg0, arg1) {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
|
|
1666
|
-
function
|
|
1666
|
+
function trampoline19(arg0, arg1) {
|
|
1667
1667
|
var handle1 = arg0;
|
|
1668
1668
|
var rsc0 = handleTable0.get(handle1).rep;
|
|
1669
1669
|
const ret = filesystemErrorCode(rsc0);
|
|
@@ -1836,7 +1836,7 @@ function trampoline20(arg0, arg1) {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
1838
|
|
|
1839
|
-
function
|
|
1839
|
+
function trampoline20(arg0, arg1, arg2) {
|
|
1840
1840
|
var handle1 = arg0;
|
|
1841
1841
|
var rsc0 = handleTable1.get(handle1).rep;
|
|
1842
1842
|
let ret;
|
|
@@ -1891,7 +1891,7 @@ function trampoline21(arg0, arg1, arg2) {
|
|
|
1891
1891
|
}
|
|
1892
1892
|
}
|
|
1893
1893
|
|
|
1894
|
-
function
|
|
1894
|
+
function trampoline21(arg0, arg1, arg2) {
|
|
1895
1895
|
var handle1 = arg0;
|
|
1896
1896
|
var rsc0 = handleTable1.get(handle1).rep;
|
|
1897
1897
|
let ret;
|
|
@@ -1946,7 +1946,7 @@ function trampoline22(arg0, arg1, arg2) {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
}
|
|
1948
1948
|
|
|
1949
|
-
function
|
|
1949
|
+
function trampoline22(arg0, arg1) {
|
|
1950
1950
|
var handle1 = arg0;
|
|
1951
1951
|
var rsc0 = handleTable2.get(handle1).rep;
|
|
1952
1952
|
let ret;
|
|
@@ -1995,7 +1995,7 @@ function trampoline23(arg0, arg1) {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
}
|
|
1997
1997
|
|
|
1998
|
-
function
|
|
1998
|
+
function trampoline23(arg0, arg1, arg2, arg3) {
|
|
1999
1999
|
var handle1 = arg0;
|
|
2000
2000
|
var rsc0 = handleTable2.get(handle1).rep;
|
|
2001
2001
|
var ptr2 = arg1;
|
|
@@ -2046,7 +2046,7 @@ function trampoline24(arg0, arg1, arg2, arg3) {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
2048
|
|
|
2049
|
-
function
|
|
2049
|
+
function trampoline24(arg0, arg1, arg2, arg3) {
|
|
2050
2050
|
var handle1 = arg0;
|
|
2051
2051
|
var rsc0 = handleTable2.get(handle1).rep;
|
|
2052
2052
|
var ptr2 = arg1;
|
|
@@ -2097,7 +2097,7 @@ function trampoline25(arg0, arg1, arg2, arg3) {
|
|
|
2097
2097
|
}
|
|
2098
2098
|
}
|
|
2099
2099
|
|
|
2100
|
-
function
|
|
2100
|
+
function trampoline25(arg0, arg1) {
|
|
2101
2101
|
var handle1 = arg0;
|
|
2102
2102
|
var rsc0 = handleTable2.get(handle1).rep;
|
|
2103
2103
|
let ret;
|
|
@@ -2145,7 +2145,7 @@ function trampoline26(arg0, arg1) {
|
|
|
2145
2145
|
}
|
|
2146
2146
|
}
|
|
2147
2147
|
|
|
2148
|
-
function
|
|
2148
|
+
function trampoline26(arg0, arg1) {
|
|
2149
2149
|
const ret = getRandomBytes(BigInt.asUintN(64, arg0));
|
|
2150
2150
|
var val0 = ret;
|
|
2151
2151
|
var len0 = val0.byteLength;
|
|
@@ -2156,7 +2156,7 @@ function trampoline27(arg0, arg1) {
|
|
|
2156
2156
|
dataView(memory0).setInt32(arg1 + 0, ptr0, true);
|
|
2157
2157
|
}
|
|
2158
2158
|
|
|
2159
|
-
function
|
|
2159
|
+
function trampoline27(arg0) {
|
|
2160
2160
|
const ret = getEnvironment();
|
|
2161
2161
|
var vec3 = ret;
|
|
2162
2162
|
var len3 = vec3.length;
|
|
@@ -2177,7 +2177,7 @@ function trampoline28(arg0) {
|
|
|
2177
2177
|
dataView(memory0).setInt32(arg0 + 0, result3, true);
|
|
2178
2178
|
}
|
|
2179
2179
|
|
|
2180
|
-
function
|
|
2180
|
+
function trampoline28(arg0) {
|
|
2181
2181
|
const ret = getTerminalStdin();
|
|
2182
2182
|
var variant1 = ret;
|
|
2183
2183
|
if (variant1 === null || variant1=== undefined) {
|
|
@@ -2188,13 +2188,13 @@ function trampoline29(arg0) {
|
|
|
2188
2188
|
if (!(e instanceof TerminalInput)) {
|
|
2189
2189
|
throw new Error('Resource error: Not a valid "TerminalInput" resource.');
|
|
2190
2190
|
}
|
|
2191
|
-
var handle0 =
|
|
2192
|
-
|
|
2191
|
+
var handle0 = handleCnt3++;
|
|
2192
|
+
handleTable3.set(handle0, { rep: e, own: true });
|
|
2193
2193
|
dataView(memory0).setInt32(arg0 + 4, handle0, true);
|
|
2194
2194
|
}
|
|
2195
2195
|
}
|
|
2196
2196
|
|
|
2197
|
-
function
|
|
2197
|
+
function trampoline29(arg0) {
|
|
2198
2198
|
const ret = getTerminalStdout();
|
|
2199
2199
|
var variant1 = ret;
|
|
2200
2200
|
if (variant1 === null || variant1=== undefined) {
|
|
@@ -2205,13 +2205,13 @@ function trampoline30(arg0) {
|
|
|
2205
2205
|
if (!(e instanceof TerminalOutput)) {
|
|
2206
2206
|
throw new Error('Resource error: Not a valid "TerminalOutput" resource.');
|
|
2207
2207
|
}
|
|
2208
|
-
var handle0 =
|
|
2209
|
-
|
|
2208
|
+
var handle0 = handleCnt4++;
|
|
2209
|
+
handleTable4.set(handle0, { rep: e, own: true });
|
|
2210
2210
|
dataView(memory0).setInt32(arg0 + 4, handle0, true);
|
|
2211
2211
|
}
|
|
2212
2212
|
}
|
|
2213
2213
|
|
|
2214
|
-
function
|
|
2214
|
+
function trampoline30(arg0) {
|
|
2215
2215
|
const ret = getTerminalStderr();
|
|
2216
2216
|
var variant1 = ret;
|
|
2217
2217
|
if (variant1 === null || variant1=== undefined) {
|
|
@@ -2222,8 +2222,8 @@ function trampoline31(arg0) {
|
|
|
2222
2222
|
if (!(e instanceof TerminalOutput)) {
|
|
2223
2223
|
throw new Error('Resource error: Not a valid "TerminalOutput" resource.');
|
|
2224
2224
|
}
|
|
2225
|
-
var handle0 =
|
|
2226
|
-
|
|
2225
|
+
var handle0 = handleCnt4++;
|
|
2226
|
+
handleTable4.set(handle0, { rep: e, own: true });
|
|
2227
2227
|
dataView(memory0).setInt32(arg0 + 4, handle0, true);
|
|
2228
2228
|
}
|
|
2229
2229
|
}
|
|
@@ -2232,11 +2232,11 @@ let realloc1;
|
|
|
2232
2232
|
let postReturn0;
|
|
2233
2233
|
let postReturn1;
|
|
2234
2234
|
function trampoline0(handle) {
|
|
2235
|
-
const handleEntry =
|
|
2235
|
+
const handleEntry = handleTable6.get(handle);
|
|
2236
2236
|
if (!handleEntry) {
|
|
2237
2237
|
throw new Error(`Resource error: Invalid handle ${handle}`);
|
|
2238
2238
|
}
|
|
2239
|
-
|
|
2239
|
+
handleTable6.delete(handle);
|
|
2240
2240
|
if (handleEntry.own && handleEntry.rep[symbolDispose]) {
|
|
2241
2241
|
handleEntry.rep[symbolDispose]();
|
|
2242
2242
|
}
|
|
@@ -2272,16 +2272,6 @@ function trampoline3(handle) {
|
|
|
2272
2272
|
}
|
|
2273
2273
|
}
|
|
2274
2274
|
function trampoline4(handle) {
|
|
2275
|
-
const handleEntry = handleTable3.get(handle);
|
|
2276
|
-
if (!handleEntry) {
|
|
2277
|
-
throw new Error(`Resource error: Invalid handle ${handle}`);
|
|
2278
|
-
}
|
|
2279
|
-
handleTable3.delete(handle);
|
|
2280
|
-
if (handleEntry.own && handleEntry.rep[symbolDispose]) {
|
|
2281
|
-
handleEntry.rep[symbolDispose]();
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
function trampoline5(handle) {
|
|
2285
2275
|
const handleEntry = handleTable5.get(handle);
|
|
2286
2276
|
if (!handleEntry) {
|
|
2287
2277
|
throw new Error(`Resource error: Invalid handle ${handle}`);
|
|
@@ -2291,22 +2281,22 @@ function trampoline5(handle) {
|
|
|
2291
2281
|
handleEntry.rep[symbolDispose]();
|
|
2292
2282
|
}
|
|
2293
2283
|
}
|
|
2294
|
-
function
|
|
2295
|
-
const handleEntry =
|
|
2284
|
+
function trampoline5(handle) {
|
|
2285
|
+
const handleEntry = handleTable4.get(handle);
|
|
2296
2286
|
if (!handleEntry) {
|
|
2297
2287
|
throw new Error(`Resource error: Invalid handle ${handle}`);
|
|
2298
2288
|
}
|
|
2299
|
-
|
|
2289
|
+
handleTable4.delete(handle);
|
|
2300
2290
|
if (handleEntry.own && handleEntry.rep[symbolDispose]) {
|
|
2301
2291
|
handleEntry.rep[symbolDispose]();
|
|
2302
2292
|
}
|
|
2303
2293
|
}
|
|
2304
|
-
function
|
|
2305
|
-
const handleEntry =
|
|
2294
|
+
function trampoline6(handle) {
|
|
2295
|
+
const handleEntry = handleTable3.get(handle);
|
|
2306
2296
|
if (!handleEntry) {
|
|
2307
2297
|
throw new Error(`Resource error: Invalid handle ${handle}`);
|
|
2308
2298
|
}
|
|
2309
|
-
|
|
2299
|
+
handleTable3.delete(handle);
|
|
2310
2300
|
if (handleEntry.own && handleEntry.rep[symbolDispose]) {
|
|
2311
2301
|
handleEntry.rep[symbolDispose]();
|
|
2312
2302
|
}
|
|
@@ -2701,29 +2691,27 @@ const handleTable5= new Map();
|
|
|
2701
2691
|
let handleCnt5 = 0;
|
|
2702
2692
|
const handleTable6= new Map();
|
|
2703
2693
|
let handleCnt6 = 0;
|
|
2704
|
-
const handleTable7= new Map();
|
|
2705
|
-
let handleCnt7 = 0;
|
|
2706
2694
|
|
|
2707
2695
|
let _initialized = false;
|
|
2708
2696
|
export const $init = (async() => {
|
|
2709
2697
|
const module0 = fetchCompile(new URL('./js-component-bindgen-component.core.wasm', import.meta.url));
|
|
2710
2698
|
const module1 = fetchCompile(new URL('./js-component-bindgen-component.core2.wasm', import.meta.url));
|
|
2711
|
-
const module2 = base64Compile('AGFzbQEAAAABUQxgAX8AYAN/fn8AYAJ/fwBgB39/f39/f38AYAR/f39/
|
|
2712
|
-
const module3 = base64Compile('AGFzbQEAAAABUQxgAX8AYAN/fn8AYAJ/fwBgB39/f39/f38AYAR/f39/
|
|
2699
|
+
const module2 = base64Compile('AGFzbQEAAAABUQxgAX8AYAN/fn8AYAJ/fwBgB39/f39/f38AYAR/f39/AGACfn8AYAl/f39/f35+f38Bf2ACf38Bf2AEf39/fwF/YAF/AX9gA39/fwF/YAF/AAMgHwABAQICAgMCAgEBAgQEAgUAAAAABgcHCAgHBwkHCgsEBQFwAR8fB50BIAEwAAABMQABATIAAgEzAAMBNAAEATUABQE2AAYBNwAHATgACAE5AAkCMTAACgIxMQALAjEyAAwCMTMADQIxNAAOAjE1AA8CMTYAEAIxNwARAjE4ABICMTkAEwIyMAAUAjIxABUCMjIAFgIyMwAXAjI0ABgCMjUAGQIyNgAaAjI3ABsCMjgAHAIyOQAdAjMwAB4IJGltcG9ydHMBAAqZAx8JACAAQQARAAALDQAgACABIAJBAREBAAsNACAAIAEgAkECEQEACwsAIAAgAUEDEQIACwsAIAAgAUEEEQIACwsAIAAgAUEFEQIACxUAIAAgASACIAMgBCAFIAZBBhEDAAsLACAAIAFBBxECAAsLACAAIAFBCBECAAsNACAAIAEgAkEJEQEACw0AIAAgASACQQoRAQALCwAgACABQQsRAgALDwAgACABIAIgA0EMEQQACw8AIAAgASACIANBDREEAAsLACAAIAFBDhECAAsL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f39/f35+f38Bf2ACf38Bf2AEf39/fwF/YAF/AX9gA39/fwF/YAF/AALAASAAATAAAAABMQABAAEyAAEAATMAAgABNAACAAE1AAIAATYAAwABNwACAAE4AAIAATkAAQACMTAAAQACMTEAAgACMTIABAACMTMABAACMTQAAgACMTUABQACMTYAAAACMTcAAAACMTgAAAACMTkAAAACMjAABgACMjEABwACMjIABwACMjMACAACMjQACAACMjUABwACMjYABwACMjcACQACMjgABwACMjkACgACMzAACwAIJGltcG9ydHMBcAEfHwklAQBBAAsfAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHgAuCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BjAuMTkuMAAcBG5hbWUAFRR3aXQtY29tcG9uZW50OmZpeHVwcw');
|
|
2713
2701
|
({ exports: exports0 } = await instantiateCore(await module2));
|
|
2714
2702
|
({ exports: exports1 } = await instantiateCore(await module0, {
|
|
2715
2703
|
wasi_snapshot_preview1: {
|
|
2716
2704
|
environ_get: exports0['25'],
|
|
2717
2705
|
environ_sizes_get: exports0['26'],
|
|
2718
2706
|
fd_close: exports0['27'],
|
|
2719
|
-
fd_filestat_get: exports0['
|
|
2707
|
+
fd_filestat_get: exports0['21'],
|
|
2720
2708
|
fd_prestat_dir_name: exports0['29'],
|
|
2721
2709
|
fd_prestat_get: exports0['28'],
|
|
2722
|
-
fd_read: exports0['
|
|
2723
|
-
fd_write: exports0['
|
|
2724
|
-
path_open: exports0['
|
|
2710
|
+
fd_read: exports0['23'],
|
|
2711
|
+
fd_write: exports0['24'],
|
|
2712
|
+
path_open: exports0['20'],
|
|
2725
2713
|
proc_exit: exports0['30'],
|
|
2726
|
-
random_get: exports0['
|
|
2714
|
+
random_get: exports0['22'],
|
|
2727
2715
|
},
|
|
2728
2716
|
}));
|
|
2729
2717
|
({ exports: exports2 } = await instantiateCore(await module1, {
|
|
@@ -2733,34 +2721,34 @@ export const $init = (async() => {
|
|
|
2733
2721
|
env: {
|
|
2734
2722
|
memory: exports1.memory,
|
|
2735
2723
|
},
|
|
2736
|
-
'wasi:cli/environment@0.2.0-rc-2023-
|
|
2724
|
+
'wasi:cli/environment@0.2.0-rc-2023-12-05': {
|
|
2737
2725
|
'get-environment': exports0['16'],
|
|
2738
2726
|
},
|
|
2739
|
-
'wasi:cli/exit@0.2.0-rc-2023-
|
|
2740
|
-
exit:
|
|
2727
|
+
'wasi:cli/exit@0.2.0-rc-2023-12-05': {
|
|
2728
|
+
exit: trampoline8,
|
|
2741
2729
|
},
|
|
2742
|
-
'wasi:cli/stderr@0.2.0-rc-2023-
|
|
2743
|
-
'get-stderr':
|
|
2730
|
+
'wasi:cli/stderr@0.2.0-rc-2023-12-05': {
|
|
2731
|
+
'get-stderr': trampoline7,
|
|
2744
2732
|
},
|
|
2745
|
-
'wasi:cli/stdin@0.2.0-rc-2023-
|
|
2746
|
-
'get-stdin':
|
|
2733
|
+
'wasi:cli/stdin@0.2.0-rc-2023-12-05': {
|
|
2734
|
+
'get-stdin': trampoline9,
|
|
2747
2735
|
},
|
|
2748
|
-
'wasi:cli/stdout@0.2.0-rc-2023-
|
|
2749
|
-
'get-stdout':
|
|
2736
|
+
'wasi:cli/stdout@0.2.0-rc-2023-12-05': {
|
|
2737
|
+
'get-stdout': trampoline10,
|
|
2750
2738
|
},
|
|
2751
|
-
'wasi:cli/terminal-input@0.2.0-rc-2023-
|
|
2752
|
-
'[resource-drop]terminal-input':
|
|
2739
|
+
'wasi:cli/terminal-input@0.2.0-rc-2023-12-05': {
|
|
2740
|
+
'[resource-drop]terminal-input': trampoline6,
|
|
2753
2741
|
},
|
|
2754
|
-
'wasi:cli/terminal-output@0.2.0-rc-2023-
|
|
2755
|
-
'[resource-drop]terminal-output':
|
|
2742
|
+
'wasi:cli/terminal-output@0.2.0-rc-2023-12-05': {
|
|
2743
|
+
'[resource-drop]terminal-output': trampoline5,
|
|
2756
2744
|
},
|
|
2757
|
-
'wasi:cli/terminal-stderr@0.2.0-rc-2023-
|
|
2745
|
+
'wasi:cli/terminal-stderr@0.2.0-rc-2023-12-05': {
|
|
2758
2746
|
'get-terminal-stderr': exports0['19'],
|
|
2759
2747
|
},
|
|
2760
|
-
'wasi:cli/terminal-stdin@0.2.0-rc-2023-
|
|
2748
|
+
'wasi:cli/terminal-stdin@0.2.0-rc-2023-12-05': {
|
|
2761
2749
|
'get-terminal-stdin': exports0['17'],
|
|
2762
2750
|
},
|
|
2763
|
-
'wasi:cli/terminal-stdout@0.2.0-rc-2023-
|
|
2751
|
+
'wasi:cli/terminal-stdout@0.2.0-rc-2023-12-05': {
|
|
2764
2752
|
'get-terminal-stdout': exports0['18'],
|
|
2765
2753
|
},
|
|
2766
2754
|
'wasi:filesystem/preopens@0.2.0-rc-2023-11-10': {
|
|
@@ -2794,46 +2782,43 @@ export const $init = (async() => {
|
|
|
2794
2782
|
'wasi:random/random@0.2.0-rc-2023-11-10': {
|
|
2795
2783
|
'get-random-bytes': exports0['15'],
|
|
2796
2784
|
},
|
|
2797
|
-
'wasi:sockets/tcp@0.2.0-rc-2023-11-10': {
|
|
2798
|
-
'[resource-drop]tcp-socket': trampoline5,
|
|
2799
|
-
},
|
|
2800
2785
|
}));
|
|
2801
2786
|
memory0 = exports1.memory;
|
|
2802
2787
|
realloc0 = exports2.cabi_import_realloc;
|
|
2803
2788
|
({ exports: exports3 } = await instantiateCore(await module3, {
|
|
2804
2789
|
'': {
|
|
2805
2790
|
$imports: exports0.$imports,
|
|
2806
|
-
'0':
|
|
2807
|
-
'1':
|
|
2808
|
-
'10':
|
|
2809
|
-
'11':
|
|
2810
|
-
'12':
|
|
2811
|
-
'13':
|
|
2812
|
-
'14':
|
|
2813
|
-
'15':
|
|
2814
|
-
'16':
|
|
2815
|
-
'17':
|
|
2816
|
-
'18':
|
|
2817
|
-
'19':
|
|
2818
|
-
'2':
|
|
2819
|
-
'20': exports2.
|
|
2820
|
-
'21': exports2.
|
|
2821
|
-
'22': exports2.
|
|
2822
|
-
'23': exports2.
|
|
2823
|
-
'24': exports2.
|
|
2791
|
+
'0': trampoline11,
|
|
2792
|
+
'1': trampoline12,
|
|
2793
|
+
'10': trampoline21,
|
|
2794
|
+
'11': trampoline22,
|
|
2795
|
+
'12': trampoline23,
|
|
2796
|
+
'13': trampoline24,
|
|
2797
|
+
'14': trampoline25,
|
|
2798
|
+
'15': trampoline26,
|
|
2799
|
+
'16': trampoline27,
|
|
2800
|
+
'17': trampoline28,
|
|
2801
|
+
'18': trampoline29,
|
|
2802
|
+
'19': trampoline30,
|
|
2803
|
+
'2': trampoline13,
|
|
2804
|
+
'20': exports2.path_open,
|
|
2805
|
+
'21': exports2.fd_filestat_get,
|
|
2806
|
+
'22': exports2.random_get,
|
|
2807
|
+
'23': exports2.fd_read,
|
|
2808
|
+
'24': exports2.fd_write,
|
|
2824
2809
|
'25': exports2.environ_get,
|
|
2825
2810
|
'26': exports2.environ_sizes_get,
|
|
2826
2811
|
'27': exports2.fd_close,
|
|
2827
2812
|
'28': exports2.fd_prestat_get,
|
|
2828
2813
|
'29': exports2.fd_prestat_dir_name,
|
|
2829
|
-
'3':
|
|
2814
|
+
'3': trampoline14,
|
|
2830
2815
|
'30': exports2.proc_exit,
|
|
2831
|
-
'4':
|
|
2832
|
-
'5':
|
|
2833
|
-
'6':
|
|
2834
|
-
'7':
|
|
2835
|
-
'8':
|
|
2836
|
-
'9':
|
|
2816
|
+
'4': trampoline15,
|
|
2817
|
+
'5': trampoline16,
|
|
2818
|
+
'6': trampoline17,
|
|
2819
|
+
'7': trampoline18,
|
|
2820
|
+
'8': trampoline19,
|
|
2821
|
+
'9': trampoline20,
|
|
2837
2822
|
},
|
|
2838
2823
|
}));
|
|
2839
2824
|
realloc1 = exports1.cabi_realloc;
|
|
Binary file
|
package/obj/wasm-tools.core.wasm
CHANGED
|
Binary file
|
|
Binary file
|
package/obj/wasm-tools.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ import { WasiFilesystemTypes } from './interfaces/wasi-filesystem-types.js';
|
|
|
14
14
|
import { WasiIoError } from './interfaces/wasi-io-error.js';
|
|
15
15
|
import { WasiIoStreams } from './interfaces/wasi-io-streams.js';
|
|
16
16
|
import { WasiRandomRandom } from './interfaces/wasi-random-random.js';
|
|
17
|
-
import { WasiSocketsTcp } from './interfaces/wasi-sockets-tcp.js';
|
|
18
17
|
import { LocalWasmToolsTools } from './interfaces/local-wasm-tools-tools.js';
|
|
19
18
|
export const tools: typeof LocalWasmToolsTools;
|
|
20
19
|
|