diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f47982..767e091 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,15 +10,15 @@ jobs: name: Check ABI files are up-to-date runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: ensure `./wit/deps` are in sync run: | - curl -Lo 'wit-deps' https://github.com/bytecodealliance/wit-deps/releases/download/v0.3.3/wit-deps-x86_64-unknown-linux-musl + curl -Lo 'wit-deps' https://github.com/bytecodealliance/wit-deps/releases/download/v0.3.5/wit-deps-x86_64-unknown-linux-musl chmod +x wit-deps ./wit-deps lock git add -N wit/deps git diff --exit-code - - uses: WebAssembly/wit-abi-up-to-date@v16 + - uses: WebAssembly/wit-abi-up-to-date@v17 with: - wit-bindgen: '0.15.0' + wit-bindgen: '0.16.0' worlds: "command imports" diff --git a/command.md b/command.md index 928f2f1..2159bd3 100644 --- a/command.md +++ b/command.md @@ -206,6 +206,10 @@ polled for using wasi:io/poll.

Functions

[method]input-stream.read: func

Perform a non-blocking read from the stream.

+

When the source of a read is binary data, the bytes from the source +are returned verbatim. When the source of a read is known to the +implementation to be text, bytes containing the UTF-8 encoding of the +text are returned.

This function returns a list of bytes containing the read data, when successful. The returned list will contain up to len bytes; it may return fewer than requested, but not more. The list is @@ -301,6 +305,11 @@ error.

[method]output-stream.write: func

Perform a write. This function never blocks.

+

When the destination of a write is binary data, the bytes from +contents are written verbatim. When the destination of a write is +known to the implementation to be text, the bytes of contents are +transcoded from UTF-8 into the encoding of the destination and then +written.

Precondition: check-write gave permit of Ok(n) and contents has a length of less than or equal to n. Otherwise, this function will trap.

returns Err(closed) without writing if the stream has closed since @@ -514,11 +523,19 @@ is ready for reading, before performing the splice.

  • own<output-stream>
  • Import interface wasi:cli/terminal-input@0.2.0-rc-2023-12-05

    +

    Terminal input.

    +

    In the future, this may include functions for disabling echoing, +disabling input buffering so that keyboard events are sent through +immediately, querying supported features, and so on.


    Types

    resource terminal-input

    The input side of a terminal.

    Import interface wasi:cli/terminal-output@0.2.0-rc-2023-12-05

    +

    Terminal output.

    +

    In the future, this may include functions for querying the terminal +size, being notified of terminal size changes, querying supported +features, and so on.


    Types

    resource terminal-output

    @@ -1659,18 +1676,20 @@ combined with a couple of errors that are always possible:

  • connection-refused

    -

    The connection was forcefully rejected +

    The TCP connection was forcefully rejected

  • connection-reset

    -

    The connection was reset. +

    The TCP connection was reset.

  • connection-aborted

    -

    A connection was aborted. +

    A TCP connection was aborted.

  • datagram-too-large

    +

    The size of a datagram sent to a UDP socket exceeded the maximum +supported size.

  • name-unresolvable

    @@ -1726,16 +1745,34 @@ combined with a couple of errors that are always possible:

    record ipv4-socket-address

    Record Fields

    record ipv6-socket-address

    Record Fields

    variant ip-socket-address

    Variant Cases
    @@ -2313,6 +2350,11 @@ implicitly bind the socket.

  • not-in-progress: A bind operation is not in progress.
  • would-block: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN)
  • +

    Implementors note

    +

    When binding to a non-zero port, this bind operation shouldn't be affected by the TIME_WAIT +state of a recently closed socket on the same local address. In practice this means that the SO_REUSEADDR +socket option should be set implicitly on all platforms, except on Windows where this is the default behavior +and SO_REUSEADDR performs something different entirely.

    References

    [method]output-stream.write: func

    Perform a write. This function never blocks.

    +

    When the destination of a write is binary data, the bytes from +contents are written verbatim. When the destination of a write is +known to the implementation to be text, the bytes of contents are +transcoded from UTF-8 into the encoding of the destination and then +written.

    Precondition: check-write gave permit of Ok(n) and contents has a length of less than or equal to n. Otherwise, this function will trap.

    returns Err(closed) without writing if the stream has closed since @@ -509,11 +518,19 @@ is ready for reading, before performing the splice.

  • own<output-stream>
  • Import interface wasi:cli/terminal-input@0.2.0-rc-2023-12-05

    +

    Terminal input.

    +

    In the future, this may include functions for disabling echoing, +disabling input buffering so that keyboard events are sent through +immediately, querying supported features, and so on.


    Types

    resource terminal-input

    The input side of a terminal.

    Import interface wasi:cli/terminal-output@0.2.0-rc-2023-12-05

    +

    Terminal output.

    +

    In the future, this may include functions for querying the terminal +size, being notified of terminal size changes, querying supported +features, and so on.


    Types

    resource terminal-output

    @@ -1654,18 +1671,20 @@ combined with a couple of errors that are always possible:

  • connection-refused

    -

    The connection was forcefully rejected +

    The TCP connection was forcefully rejected

  • connection-reset

    -

    The connection was reset. +

    The TCP connection was reset.

  • connection-aborted

    -

    A connection was aborted. +

    A TCP connection was aborted.

  • datagram-too-large

    +

    The size of a datagram sent to a UDP socket exceeded the maximum +supported size.

  • name-unresolvable

    @@ -1721,16 +1740,34 @@ combined with a couple of errors that are always possible:

    record ipv4-socket-address

    Record Fields

    record ipv6-socket-address

    Record Fields

    variant ip-socket-address

    Variant Cases
    @@ -2308,6 +2345,11 @@ implicitly bind the socket.

  • not-in-progress: A bind operation is not in progress.
  • would-block: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN)
  • +

    Implementors note

    +

    When binding to a non-zero port, this bind operation shouldn't be affected by the TIME_WAIT +state of a recently closed socket on the same local address. In practice this means that the SO_REUSEADDR +socket option should be set implicitly on all platforms, except on Windows where this is the default behavior +and SO_REUSEADDR performs something different entirely.

    References