From b61349c29088635433cee421b7184ad5167c3c5a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Sep 2025 14:38:29 +0000 Subject: [PATCH] Update 0.3.0 WIT definitions to 0.3.0-rc-2025-09-16 --- wit-0.3.0-draft/deps.lock | 4 +-- wit-0.3.0-draft/deps/cli/run.wit | 2 +- wit-0.3.0-draft/deps/cli/stdio.wit | 48 ++++++++++++++++++++++++++++-- wit-0.3.0-draft/proxy.wit | 12 ++++---- wit-0.3.0-draft/types.wit | 2 +- 5 files changed, 55 insertions(+), 13 deletions(-) diff --git a/wit-0.3.0-draft/deps.lock b/wit-0.3.0-draft/deps.lock index be1b056..9912e0d 100644 --- a/wit-0.3.0-draft/deps.lock +++ b/wit-0.3.0-draft/deps.lock @@ -1,8 +1,8 @@ [cli] url = "https://github.com/WebAssembly/wasi-cli/archive/main.tar.gz" subdir = "wit-0.3.0-draft" -sha256 = "7f9cf181100ca1cadcb49a1efa3e80828d375df2d5ddf10a8f66e848d423aea5" -sha512 = "569f6b4ed2a3bec913e5e06fd35caab564048cf31632795c2fbdd8c40ddb5f5eea7b1cc59d33c80e5d7b642ed246ba4a3e40d3edeaaa2c6a5c4bcd02e0b67212" +sha256 = "5ff03c236a6fed89d2968c3fd5d9e2b3f4fcd7a606dc94ead51df5357bdabe76" +sha512 = "d0277a9b3692de917ef8b1bbe6be9247157d548962dde181b159788064a06513c6f6d775fcca94a3170fe2149ca75d609664938716f4dc877ef65cd7db07eb76" deps = ["clocks", "filesystem", "random", "sockets"] [clocks] diff --git a/wit-0.3.0-draft/deps/cli/run.wit b/wit-0.3.0-draft/deps/cli/run.wit index 6149db7..906b6ae 100644 --- a/wit-0.3.0-draft/deps/cli/run.wit +++ b/wit-0.3.0-draft/deps/cli/run.wit @@ -2,5 +2,5 @@ interface run { /// Run the program. @since(version = 0.3.0-rc-2025-08-15) - run: func() -> result; + run: async func() -> result; } diff --git a/wit-0.3.0-draft/deps/cli/stdio.wit b/wit-0.3.0-draft/deps/cli/stdio.wit index 6c99a56..c1bc8ac 100644 --- a/wit-0.3.0-draft/deps/cli/stdio.wit +++ b/wit-0.3.0-draft/deps/cli/stdio.wit @@ -1,17 +1,59 @@ +@since(version = 0.3.0-rc-2025-08-15) +interface stdio { + @since(version = 0.3.0-rc-2025-08-15) + enum error-code { + /// Input/output error + io, + /// Invalid or incomplete multibyte or wide character + illegal-byte-sequence, + /// Broken pipe + pipe, + } +} + @since(version = 0.3.0-rc-2025-08-15) interface stdin { + /// Return a stream for reading from stdin. + /// + /// This function returns a stream which provides data read from stdin, + /// and a future to signal read results. + /// + /// If the stream's readable end is dropped the future will resolve to success. + /// + /// If the stream's writable end is dropped the future will either resolve to + /// success if stdin was closed by the writer or to an error-code if reading + /// failed for some other reason. + /// + /// Multiple streams may be active at the same time. The behavior of concurrent + /// reads is implementation-specific. @since(version = 0.3.0-rc-2025-08-15) - get-stdin: func() -> stream; + read-via-stream: func() -> tuple, future>>; } @since(version = 0.3.0-rc-2025-08-15) interface stdout { + /// Write the given stream to stdout. + /// + /// If the stream's writable end is dropped this function will either return + /// success once the entire contents of the stream have been written or an + /// error-code representing a failure. + /// + /// Otherwise if there is an error the readable end of the stream will be + /// dropped and this function will return an error-code. @since(version = 0.3.0-rc-2025-08-15) - set-stdout: func(data: stream); + write-via-stream: async func(data: stream) -> result<_, error-code>; } @since(version = 0.3.0-rc-2025-08-15) interface stderr { + /// Write the given stream to stderr. + /// + /// If the stream's writable end is dropped this function will either return + /// success once the entire contents of the stream have been written or an + /// error-code representing a failure. + /// + /// Otherwise if there is an error the readable end of the stream will be + /// dropped and this function will return an error-code. @since(version = 0.3.0-rc-2025-08-15) - set-stderr: func(data: stream); + write-via-stream: async func(data: stream) -> result<_, error-code>; } diff --git a/wit-0.3.0-draft/proxy.wit b/wit-0.3.0-draft/proxy.wit index 31e5fac..223083e 100644 --- a/wit-0.3.0-draft/proxy.wit +++ b/wit-0.3.0-draft/proxy.wit @@ -1,22 +1,22 @@ -package wasi:http@0.3.0-rc-2025-08-15; +package wasi:http@0.3.0-rc-2025-09-16; /// The `wasi:http/imports` world imports all the APIs for HTTP proxies. /// It is intended to be `include`d in other worlds. world imports { /// HTTP proxies have access to time and randomness. - include wasi:clocks/imports@0.3.0-rc-2025-08-15; - import wasi:random/random@0.3.0-rc-2025-08-15; + include wasi:clocks/imports@0.3.0-rc-2025-09-16; + import wasi:random/random@0.3.0-rc-2025-09-16; /// Proxies have standard output and error streams which are expected to /// terminate in a developer-facing console provided by the host. - import wasi:cli/stdout@0.3.0-rc-2025-08-15; - import wasi:cli/stderr@0.3.0-rc-2025-08-15; + import wasi:cli/stdout@0.3.0-rc-2025-09-16; + import wasi:cli/stderr@0.3.0-rc-2025-09-16; /// TODO: this is a temporary workaround until component tooling is able to /// gracefully handle the absence of stdin. Hosts must return an eof stream /// for this import, which is what wasi-libc + tooling will do automatically /// when this import is properly removed. - import wasi:cli/stdin@0.3.0-rc-2025-08-15; + import wasi:cli/stdin@0.3.0-rc-2025-09-16; /// This is the default handler to use when user code simply wants to make an /// HTTP request (e.g., via `fetch()`). diff --git a/wit-0.3.0-draft/types.wit b/wit-0.3.0-draft/types.wit index d8933cd..8269eea 100644 --- a/wit-0.3.0-draft/types.wit +++ b/wit-0.3.0-draft/types.wit @@ -1,7 +1,7 @@ /// This interface defines all of the types and methods for implementing HTTP /// Requests and Responses, as well as their headers, trailers, and bodies. interface types { - use wasi:clocks/monotonic-clock@0.3.0-rc-2025-08-15.{duration}; + use wasi:clocks/monotonic-clock@0.3.0-rc-2025-09-16.{duration}; /// This type corresponds to HTTP standard Methods. variant method {