Skip to content

Commit 4f28d09

Browse files
authored
Merge pull request #186 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 e3df7c1 + b61349c commit 4f28d09

File tree

5 files changed

+55
-13
lines changed

5 files changed

+55
-13
lines changed

wit-0.3.0-draft/deps.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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 = "5ff03c236a6fed89d2968c3fd5d9e2b3f4fcd7a606dc94ead51df5357bdabe76"
5+
sha512 = "d0277a9b3692de917ef8b1bbe6be9247157d548962dde181b159788064a06513c6f6d775fcca94a3170fe2149ca75d609664938716f4dc877ef65cd7db07eb76"
66
deps = ["clocks", "filesystem", "random", "sockets"]
77

88
[clocks]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
interface run {
33
/// Run the program.
44
@since(version = 0.3.0-rc-2025-08-15)
5-
run: func() -> result;
5+
run: async func() -> result;
66
}

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

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,59 @@
1+
@since(version = 0.3.0-rc-2025-08-15)
2+
interface stdio {
3+
@since(version = 0.3.0-rc-2025-08-15)
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+
114
@since(version = 0.3.0-rc-2025-08-15)
215
interface stdin {
16+
/// Return a stream for reading from stdin.
17+
///
18+
/// This function returns a stream which provides data read from stdin,
19+
/// and a future to signal read results.
20+
///
21+
/// If the stream's readable end is dropped the future will resolve to success.
22+
///
23+
/// If the stream's writable end is dropped the future will either resolve to
24+
/// success if stdin was closed by the writer or to an error-code if reading
25+
/// failed for some other reason.
26+
///
27+
/// Multiple streams may be active at the same time. The behavior of concurrent
28+
/// reads is implementation-specific.
329
@since(version = 0.3.0-rc-2025-08-15)
4-
get-stdin: func() -> stream<u8>;
30+
read-via-stream: func() -> tuple<stream<u8>, future<result<_, error-code>>>;
531
}
632

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

1347
@since(version = 0.3.0-rc-2025-08-15)
1448
interface stderr {
49+
/// Write the given stream to stderr.
50+
///
51+
/// If the stream's writable end is dropped this function will either return
52+
/// success once the entire contents of the stream have been written or an
53+
/// error-code representing a failure.
54+
///
55+
/// Otherwise if there is an error the readable end of the stream will be
56+
/// dropped and this function will return an error-code.
1557
@since(version = 0.3.0-rc-2025-08-15)
16-
set-stderr: func(data: stream<u8>);
58+
write-via-stream: async func(data: stream<u8>) -> result<_, error-code>;
1759
}

wit-0.3.0-draft/proxy.wit

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
package wasi:http@0.3.0-rc-2025-08-15;
1+
package wasi:http@0.3.0-rc-2025-09-16;
22

33
/// The `wasi:http/imports` world imports all the APIs for HTTP proxies.
44
/// It is intended to be `include`d in other worlds.
55
world imports {
66
/// HTTP proxies have access to time and randomness.
7-
include wasi:clocks/imports@0.3.0-rc-2025-08-15;
8-
import wasi:random/random@0.3.0-rc-2025-08-15;
7+
include wasi:clocks/imports@0.3.0-rc-2025-09-16;
8+
import wasi:random/random@0.3.0-rc-2025-09-16;
99

1010
/// Proxies have standard output and error streams which are expected to
1111
/// terminate in a developer-facing console provided by the host.
12-
import wasi:cli/stdout@0.3.0-rc-2025-08-15;
13-
import wasi:cli/stderr@0.3.0-rc-2025-08-15;
12+
import wasi:cli/stdout@0.3.0-rc-2025-09-16;
13+
import wasi:cli/stderr@0.3.0-rc-2025-09-16;
1414

1515
/// TODO: this is a temporary workaround until component tooling is able to
1616
/// gracefully handle the absence of stdin. Hosts must return an eof stream
1717
/// for this import, which is what wasi-libc + tooling will do automatically
1818
/// when this import is properly removed.
19-
import wasi:cli/stdin@0.3.0-rc-2025-08-15;
19+
import wasi:cli/stdin@0.3.0-rc-2025-09-16;
2020

2121
/// This is the default handler to use when user code simply wants to make an
2222
/// HTTP request (e.g., via `fetch()`).

wit-0.3.0-draft/types.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// This interface defines all of the types and methods for implementing HTTP
22
/// Requests and Responses, as well as their headers, trailers, and bodies.
33
interface types {
4-
use wasi:clocks/monotonic-clock@0.3.0-rc-2025-08-15.{duration};
4+
use wasi:clocks/monotonic-clock@0.3.0-rc-2025-09-16.{duration};
55

66
/// This type corresponds to HTTP standard Methods.
77
variant method {

0 commit comments

Comments
 (0)