Skip to content

Commit ce36dac

Browse files
authored
Merge pull request #189 from WebAssembly/update-wit-0.3.0-rc-2025-09-16
Update 0.3.0 WIT definitions to 0.3.0-rc-2025-09-16
2 parents 9089cbd + 3cc911f commit ce36dac

25 files changed

+278
-219
lines changed

wit-0.3.0-draft/deps.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[cli]
22
url = "https://github.com/WebAssembly/wasi-cli/archive/main.tar.gz"
33
subdir = "wit-0.3.0-draft"
4-
sha256 = "7f9cf181100ca1cadcb49a1efa3e80828d375df2d5ddf10a8f66e848d423aea5"
5-
sha512 = "569f6b4ed2a3bec913e5e06fd35caab564048cf31632795c2fbdd8c40ddb5f5eea7b1cc59d33c80e5d7b642ed246ba4a3e40d3edeaaa2c6a5c4bcd02e0b67212"
4+
sha256 = "5a4fb9ecf963e19b131821132dd835cc140424e6b03aa8434d4fb4df25a52ec4"
5+
sha512 = "48319184c0b7157bd358cdaf20b9bd054731a06fa032a4c785c72e1f8ced7c1260b135f9801d46d7e031efb3a38b62f0b1a1538955e44ef3abfda7ab353215e6"
66
deps = ["clocks", "filesystem", "random", "sockets"]
77

88
[clocks]
9-
sha256 = "626953ec28ae956ec1233c4350deab6e5cdcbdd9ae6d491e102ad7c6901cc8bf"
10-
sha512 = "ae375b002cfaacdbaa133bb87747d1b86675e13144067c3005d6c32cf5c37bb7a52b693ae46d5cd65fc4910a78d7255d0ada5142828a022497fd0eaacb61761f"
9+
sha256 = "cf61a3785c2838340ce530ee1cdc6dbee3257f1672d6000ca748dfe253808dec"
10+
sha512 = "f647de7d6c470595c3e5bf0dba6af98703beb9f701c66543cea5d42e81f7a1a73f199c3949035a9c2c1bd717056e5e68788f520af39b9d26480242b7626f22ce"
1111

1212
[filesystem]
13-
sha256 = "a65db475f8e41fa1701de4dc467ed748af5b807bdb2b5ff5027fefd0c0eab7a2"
14-
sha512 = "3a797b5eacad135ed8e0a903c3db8f9073e79ecc547e31bf1ec62e9576e2069ecd2e37561674c000ab6cabf1cfeec5c32648b58c592bf52911c5783f179db83a"
13+
sha256 = "99292288bdb7ecb04e0a1a7bee478a9410df9ab57af222c3dcde375f7b957181"
14+
sha512 = "4da72faf65b99263bd0521871a6004ea19fc9189e906451fb4d48b83d9da3269a8e4470c5775faf037a05e03151a0c05fd05cc0dfeb36757715fda2799dd1d85"
1515

1616
[random]
17-
sha256 = "fcc4d3b51564274bb05ebd7cad65ff036eed5c1ac1316639e0c04aa0d64fc938"
18-
sha512 = "d3b10e7791fc354730551f8e21beff96bdbf16f96ef655cd0ac7e0489a9e28c4a7a602d50b199de4a27981643bdbea7ec075cfa80ca351aea6ae74ea660b0568"
17+
sha256 = "0a0cead69094ce1773468ff363b2d324ded025aab4f03a1d53b2538710c31e43"
18+
sha512 = "3596bbd164c28254aefb0f7c7a047d81121df1de170808d16975f021c5170ea35dfe6fc1867f93469013ab8d36df8de14d4c5e1c9b70197bfd10e699fd6757e5"
1919

2020
[sockets]
21-
sha256 = "307e8459b8be0587000871d3f67fc04041e4cb1eb6c27e97183332fdb641926f"
22-
sha512 = "183054d40082bf9e0fd38daf77df0189445c54384537548d5d37bc1b3cfd05190b1ca4377760a7108c39650785c74e5e230abd296e0fda8e2a5b263cd41f848b"
21+
sha256 = "57e9d6df8389015116c5407641af76b717cf0d1a79e36384af3cb7d7fa9687ed"
22+
sha512 = "45dab8dd2fa48450c480b1e770a3739793f6156b07b39075414510ce2cde3db6e714da87f47f0e9b9c82b5ef38a963a59f4d86449aa5f2310c78bc79134d0dd5"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package wasi:cli@0.3.0-rc-2025-08-15;
1+
package wasi:cli@0.3.0-rc-2025-09-16;
22

3-
@since(version = 0.3.0-rc-2025-08-15)
3+
@since(version = 0.3.0-rc-2025-09-16)
44
world command {
5-
@since(version = 0.3.0-rc-2025-08-15)
5+
@since(version = 0.3.0-rc-2025-09-16)
66
include imports;
77

8-
@since(version = 0.3.0-rc-2025-08-15)
8+
@since(version = 0.3.0-rc-2025-09-16)
99
export run;
1010
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@since(version = 0.3.0-rc-2025-08-15)
1+
@since(version = 0.3.0-rc-2025-09-16)
22
interface environment {
33
/// Get the POSIX-style environment variables.
44
///
@@ -8,15 +8,15 @@ interface environment {
88
/// Morally, these are a value import, but until value imports are available
99
/// in the component model, this import function should return the same
1010
/// values each time it is called.
11-
@since(version = 0.3.0-rc-2025-08-15)
11+
@since(version = 0.3.0-rc-2025-09-16)
1212
get-environment: func() -> list<tuple<string, string>>;
1313

1414
/// Get the POSIX-style arguments to the program.
15-
@since(version = 0.3.0-rc-2025-08-15)
15+
@since(version = 0.3.0-rc-2025-09-16)
1616
get-arguments: func() -> list<string>;
1717

1818
/// Return a path that programs should use as their initial current working
1919
/// directory, interpreting `.` as shorthand for this.
20-
@since(version = 0.3.0-rc-2025-08-15)
20+
@since(version = 0.3.0-rc-2025-09-16)
2121
get-initial-cwd: func() -> option<string>;
2222
}

wit-0.3.0-draft/deps/cli/exit.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@since(version = 0.3.0-rc-2025-08-15)
1+
@since(version = 0.3.0-rc-2025-09-16)
22
interface exit {
33
/// Exit the current instance and any linked instances.
4-
@since(version = 0.3.0-rc-2025-08-15)
4+
@since(version = 0.3.0-rc-2025-09-16)
55
exit: func(status: result);
66

77
/// Exit the current instance and any linked instances, reporting the
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
package wasi:cli@0.3.0-rc-2025-08-15;
1+
package wasi:cli@0.3.0-rc-2025-09-16;
22

3-
@since(version = 0.3.0-rc-2025-08-15)
3+
@since(version = 0.3.0-rc-2025-09-16)
44
world imports {
5-
@since(version = 0.3.0-rc-2025-08-15)
6-
include wasi:clocks/imports@0.3.0-rc-2025-08-15;
7-
@since(version = 0.3.0-rc-2025-08-15)
8-
include wasi:filesystem/imports@0.3.0-rc-2025-08-15;
9-
@since(version = 0.3.0-rc-2025-08-15)
10-
include wasi:sockets/imports@0.3.0-rc-2025-08-15;
11-
@since(version = 0.3.0-rc-2025-08-15)
12-
include wasi:random/imports@0.3.0-rc-2025-08-15;
5+
@since(version = 0.3.0-rc-2025-09-16)
6+
include wasi:clocks/imports@0.3.0-rc-2025-09-16;
7+
@since(version = 0.3.0-rc-2025-09-16)
8+
include wasi:filesystem/imports@0.3.0-rc-2025-09-16;
9+
@since(version = 0.3.0-rc-2025-09-16)
10+
include wasi:sockets/imports@0.3.0-rc-2025-09-16;
11+
@since(version = 0.3.0-rc-2025-09-16)
12+
include wasi:random/imports@0.3.0-rc-2025-09-16;
1313

14-
@since(version = 0.3.0-rc-2025-08-15)
14+
@since(version = 0.3.0-rc-2025-09-16)
1515
import environment;
16-
@since(version = 0.3.0-rc-2025-08-15)
16+
@since(version = 0.3.0-rc-2025-09-16)
1717
import exit;
18-
@since(version = 0.3.0-rc-2025-08-15)
18+
@since(version = 0.3.0-rc-2025-09-16)
1919
import stdin;
20-
@since(version = 0.3.0-rc-2025-08-15)
20+
@since(version = 0.3.0-rc-2025-09-16)
2121
import stdout;
22-
@since(version = 0.3.0-rc-2025-08-15)
22+
@since(version = 0.3.0-rc-2025-09-16)
2323
import stderr;
24-
@since(version = 0.3.0-rc-2025-08-15)
24+
@since(version = 0.3.0-rc-2025-09-16)
2525
import terminal-input;
26-
@since(version = 0.3.0-rc-2025-08-15)
26+
@since(version = 0.3.0-rc-2025-09-16)
2727
import terminal-output;
28-
@since(version = 0.3.0-rc-2025-08-15)
28+
@since(version = 0.3.0-rc-2025-09-16)
2929
import terminal-stdin;
30-
@since(version = 0.3.0-rc-2025-08-15)
30+
@since(version = 0.3.0-rc-2025-09-16)
3131
import terminal-stdout;
32-
@since(version = 0.3.0-rc-2025-08-15)
32+
@since(version = 0.3.0-rc-2025-09-16)
3333
import terminal-stderr;
3434
}

wit-0.3.0-draft/deps/cli/run.wit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@since(version = 0.3.0-rc-2025-08-15)
1+
@since(version = 0.3.0-rc-2025-09-16)
22
interface run {
33
/// Run the program.
4-
@since(version = 0.3.0-rc-2025-08-15)
5-
run: func() -> result;
4+
@since(version = 0.3.0-rc-2025-09-16)
5+
run: async func() -> result;
66
}

wit-0.3.0-draft/deps/cli/stdio.wit

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,65 @@
1-
@since(version = 0.3.0-rc-2025-08-15)
1+
@since(version = 0.3.0-rc-2025-09-16)
2+
interface types {
3+
@since(version = 0.3.0-rc-2025-09-16)
4+
enum error-code {
5+
/// Input/output error
6+
io,
7+
/// Invalid or incomplete multibyte or wide character
8+
illegal-byte-sequence,
9+
/// Broken pipe
10+
pipe,
11+
}
12+
}
13+
14+
@since(version = 0.3.0-rc-2025-09-16)
215
interface stdin {
3-
@since(version = 0.3.0-rc-2025-08-15)
4-
get-stdin: func() -> stream<u8>;
16+
use types.{error-code};
17+
18+
/// Return a stream for reading from stdin.
19+
///
20+
/// This function returns a stream which provides data read from stdin,
21+
/// and a future to signal read results.
22+
///
23+
/// If the stream's readable end is dropped the future will resolve to success.
24+
///
25+
/// If the stream's writable end is dropped the future will either resolve to
26+
/// success if stdin was closed by the writer or to an error-code if reading
27+
/// failed for some other reason.
28+
///
29+
/// Multiple streams may be active at the same time. The behavior of concurrent
30+
/// reads is implementation-specific.
31+
@since(version = 0.3.0-rc-2025-09-16)
32+
read-via-stream: func() -> tuple<stream<u8>, future<result<_, error-code>>>;
533
}
634

7-
@since(version = 0.3.0-rc-2025-08-15)
35+
@since(version = 0.3.0-rc-2025-09-16)
836
interface stdout {
9-
@since(version = 0.3.0-rc-2025-08-15)
10-
set-stdout: func(data: stream<u8>);
37+
use types.{error-code};
38+
39+
/// Write the given stream to stdout.
40+
///
41+
/// If the stream's writable end is dropped this function will either return
42+
/// success once the entire contents of the stream have been written or an
43+
/// error-code representing a failure.
44+
///
45+
/// Otherwise if there is an error the readable end of the stream will be
46+
/// dropped and this function will return an error-code.
47+
@since(version = 0.3.0-rc-2025-09-16)
48+
write-via-stream: async func(data: stream<u8>) -> result<_, error-code>;
1149
}
1250

13-
@since(version = 0.3.0-rc-2025-08-15)
51+
@since(version = 0.3.0-rc-2025-09-16)
1452
interface stderr {
15-
@since(version = 0.3.0-rc-2025-08-15)
16-
set-stderr: func(data: stream<u8>);
53+
use types.{error-code};
54+
55+
/// Write the given stream to stderr.
56+
///
57+
/// If the stream's writable end is dropped this function will either return
58+
/// success once the entire contents of the stream have been written or an
59+
/// error-code representing a failure.
60+
///
61+
/// Otherwise if there is an error the readable end of the stream will be
62+
/// dropped and this function will return an error-code.
63+
@since(version = 0.3.0-rc-2025-09-16)
64+
write-via-stream: async func(data: stream<u8>) -> result<_, error-code>;
1765
}

wit-0.3.0-draft/deps/cli/terminal.wit

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/// In the future, this may include functions for disabling echoing,
44
/// disabling input buffering so that keyboard events are sent through
55
/// immediately, querying supported features, and so on.
6-
@since(version = 0.3.0-rc-2025-08-15)
6+
@since(version = 0.3.0-rc-2025-09-16)
77
interface terminal-input {
88
/// The input side of a terminal.
9-
@since(version = 0.3.0-rc-2025-08-15)
9+
@since(version = 0.3.0-rc-2025-09-16)
1010
resource terminal-input;
1111
}
1212

@@ -15,48 +15,48 @@ interface terminal-input {
1515
/// In the future, this may include functions for querying the terminal
1616
/// size, being notified of terminal size changes, querying supported
1717
/// features, and so on.
18-
@since(version = 0.3.0-rc-2025-08-15)
18+
@since(version = 0.3.0-rc-2025-09-16)
1919
interface terminal-output {
2020
/// The output side of a terminal.
21-
@since(version = 0.3.0-rc-2025-08-15)
21+
@since(version = 0.3.0-rc-2025-09-16)
2222
resource terminal-output;
2323
}
2424

2525
/// An interface providing an optional `terminal-input` for stdin as a
2626
/// link-time authority.
27-
@since(version = 0.3.0-rc-2025-08-15)
27+
@since(version = 0.3.0-rc-2025-09-16)
2828
interface terminal-stdin {
29-
@since(version = 0.3.0-rc-2025-08-15)
29+
@since(version = 0.3.0-rc-2025-09-16)
3030
use terminal-input.{terminal-input};
3131

3232
/// If stdin is connected to a terminal, return a `terminal-input` handle
3333
/// allowing further interaction with it.
34-
@since(version = 0.3.0-rc-2025-08-15)
34+
@since(version = 0.3.0-rc-2025-09-16)
3535
get-terminal-stdin: func() -> option<terminal-input>;
3636
}
3737

3838
/// An interface providing an optional `terminal-output` for stdout as a
3939
/// link-time authority.
40-
@since(version = 0.3.0-rc-2025-08-15)
40+
@since(version = 0.3.0-rc-2025-09-16)
4141
interface terminal-stdout {
42-
@since(version = 0.3.0-rc-2025-08-15)
42+
@since(version = 0.3.0-rc-2025-09-16)
4343
use terminal-output.{terminal-output};
4444

4545
/// If stdout is connected to a terminal, return a `terminal-output` handle
4646
/// allowing further interaction with it.
47-
@since(version = 0.3.0-rc-2025-08-15)
47+
@since(version = 0.3.0-rc-2025-09-16)
4848
get-terminal-stdout: func() -> option<terminal-output>;
4949
}
5050

5151
/// An interface providing an optional `terminal-output` for stderr as a
5252
/// link-time authority.
53-
@since(version = 0.3.0-rc-2025-08-15)
53+
@since(version = 0.3.0-rc-2025-09-16)
5454
interface terminal-stderr {
55-
@since(version = 0.3.0-rc-2025-08-15)
55+
@since(version = 0.3.0-rc-2025-09-16)
5656
use terminal-output.{terminal-output};
5757

5858
/// If stderr is connected to a terminal, return a `terminal-output` handle
5959
/// allowing further interaction with it.
60-
@since(version = 0.3.0-rc-2025-08-15)
60+
@since(version = 0.3.0-rc-2025-09-16)
6161
get-terminal-stderr: func() -> option<terminal-output>;
6262
}

wit-0.3.0-draft/deps/clocks/monotonic-clock.wit

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.3.0-rc-2025-08-15;
1+
package wasi:clocks@0.3.0-rc-2025-09-16;
22
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
33
/// time.
44
///
@@ -7,38 +7,41 @@ package wasi:[email protected];
77
///
88
/// A monotonic clock is a clock which has an unspecified initial value, and
99
/// successive reads of the clock will produce non-decreasing values.
10-
@since(version = 0.3.0-rc-2025-08-15)
10+
@since(version = 0.3.0-rc-2025-09-16)
1111
interface monotonic-clock {
12+
use types.{duration};
13+
1214
/// An instant in time, in nanoseconds. An instant is relative to an
1315
/// unspecified initial value, and can only be compared to instances from
1416
/// the same monotonic-clock.
15-
@since(version = 0.3.0-rc-2025-08-15)
17+
@since(version = 0.3.0-rc-2025-09-16)
1618
type instant = u64;
1719

18-
/// A duration of time, in nanoseconds.
19-
@since(version = 0.3.0-rc-2025-08-15)
20-
type duration = u64;
21-
2220
/// Read the current value of the clock.
2321
///
2422
/// The clock is monotonic, therefore calling this function repeatedly will
2523
/// produce a sequence of non-decreasing values.
26-
@since(version = 0.3.0-rc-2025-08-15)
24+
///
25+
/// For completeness, this function traps if it's not possible to represent
26+
/// the value of the clock in an `instant`. Consequently, implementations
27+
/// should ensure that the starting time is low enough to avoid the
28+
/// possibility of overflow in practice.
29+
@since(version = 0.3.0-rc-2025-09-16)
2730
now: func() -> instant;
2831

2932
/// Query the resolution of the clock. Returns the duration of time
3033
/// corresponding to a clock tick.
31-
@since(version = 0.3.0-rc-2025-08-15)
34+
@since(version = 0.3.0-rc-2025-09-16)
3235
get-resolution: func() -> duration;
3336

3437
/// Wait until the specified instant has occurred.
35-
@since(version = 0.3.0-rc-2025-08-15)
38+
@since(version = 0.3.0-rc-2025-09-16)
3639
wait-until: async func(
3740
when: instant,
3841
);
3942

40-
/// Wait for the specified duration has elapsed.
41-
@since(version = 0.3.0-rc-2025-08-15)
43+
/// Wait for the specified duration to elapse.
44+
@since(version = 0.3.0-rc-2025-09-16)
4245
wait-for: async func(
4346
how-long: duration,
4447
);

wit-0.3.0-draft/deps/clocks/timezone.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.3.0-rc-2025-08-15;
1+
package wasi:clocks@0.3.0-rc-2025-09-16;
22

33
@unstable(feature = clocks-timezone)
44
interface timezone {

0 commit comments

Comments
 (0)