-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update wit files to match new structure
Signed-off-by: Michelle Dhanani <michelle@fermyon.com>
- Loading branch information
Showing
82 changed files
with
5,428 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package wasi:cli@0.2.0-rc-2023-10-18; | ||
|
||
world command { | ||
include reactor; | ||
|
||
export run; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
interface environment { | ||
/// Get the POSIX-style environment variables. | ||
/// | ||
/// Each environment variable is provided as a pair of string variable names | ||
/// and string value. | ||
/// | ||
/// Morally, these are a value import, but until value imports are available | ||
/// in the component model, this import function should return the same | ||
/// values each time it is called. | ||
get-environment: func() -> list<tuple<string, string>>; | ||
|
||
/// Get the POSIX-style arguments to the program. | ||
get-arguments: func() -> list<string>; | ||
|
||
/// Return a path that programs should use as their initial current working | ||
/// directory, interpreting `.` as shorthand for this. | ||
initial-cwd: func() -> option<string>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface exit { | ||
/// Exit the current instance and any linked instances. | ||
exit: func(status: result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package wasi:cli@0.2.0-rc-2023-10-18; | ||
|
||
world reactor { | ||
import wasi:clocks/wall-clock@0.2.0-rc-2023-10-18; | ||
import wasi:clocks/monotonic-clock@0.2.0-rc-2023-10-18; | ||
import wasi:clocks/timezone@0.2.0-rc-2023-10-18; | ||
import wasi:filesystem/types@0.2.0-rc-2023-10-18; | ||
import wasi:filesystem/preopens@0.2.0-rc-2023-10-18; | ||
import wasi:sockets/instance-network@0.2.0-rc-2023-10-18; | ||
import wasi:sockets/ip-name-lookup@0.2.0-rc-2023-10-18; | ||
import wasi:sockets/network@0.2.0-rc-2023-10-18; | ||
import wasi:sockets/tcp-create-socket@0.2.0-rc-2023-10-18; | ||
import wasi:sockets/tcp@0.2.0-rc-2023-10-18; | ||
import wasi:sockets/udp-create-socket@0.2.0-rc-2023-10-18; | ||
import wasi:sockets/udp@0.2.0-rc-2023-10-18; | ||
import wasi:random/random@0.2.0-rc-2023-10-18; | ||
import wasi:random/insecure@0.2.0-rc-2023-10-18; | ||
import wasi:random/insecure-seed@0.2.0-rc-2023-10-18; | ||
import wasi:io/poll@0.2.0-rc-2023-10-18; | ||
import wasi:io/streams@0.2.0-rc-2023-10-18; | ||
|
||
import environment; | ||
import exit; | ||
import stdin; | ||
import stdout; | ||
import stderr; | ||
import terminal-input; | ||
import terminal-output; | ||
import terminal-stdin; | ||
import terminal-stdout; | ||
import terminal-stderr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface run { | ||
/// Run the program. | ||
run: func() -> result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
interface stdin { | ||
use wasi:io/streams@0.2.0-rc-2023-10-18.{input-stream}; | ||
|
||
get-stdin: func() -> input-stream; | ||
} | ||
|
||
interface stdout { | ||
use wasi:io/streams@0.2.0-rc-2023-10-18.{output-stream}; | ||
|
||
get-stdout: func() -> output-stream; | ||
} | ||
|
||
interface stderr { | ||
use wasi:io/streams@0.2.0-rc-2023-10-18.{output-stream}; | ||
|
||
get-stderr: func() -> output-stream; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
interface terminal-input { | ||
/// The input side of a terminal. | ||
resource 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. | ||
} | ||
|
||
interface terminal-output { | ||
/// The output side of a terminal. | ||
resource 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. | ||
} | ||
|
||
/// An interface providing an optional `terminal-input` for stdin as a | ||
/// link-time authority. | ||
interface terminal-stdin { | ||
use terminal-input.{terminal-input}; | ||
|
||
/// If stdin is connected to a terminal, return a `terminal-input` handle | ||
/// allowing further interaction with it. | ||
get-terminal-stdin: func() -> option<terminal-input>; | ||
} | ||
|
||
/// An interface providing an optional `terminal-output` for stdout as a | ||
/// link-time authority. | ||
interface terminal-stdout { | ||
use terminal-output.{terminal-output}; | ||
|
||
/// If stdout is connected to a terminal, return a `terminal-output` handle | ||
/// allowing further interaction with it. | ||
get-terminal-stdout: func() -> option<terminal-output>; | ||
} | ||
|
||
/// An interface providing an optional `terminal-output` for stderr as a | ||
/// link-time authority. | ||
interface terminal-stderr { | ||
use terminal-output.{terminal-output}; | ||
|
||
/// If stderr is connected to a terminal, return a `terminal-output` handle | ||
/// allowing further interaction with it. | ||
get-terminal-stderr: func() -> option<terminal-output>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package wasi:cli@0.2.0-rc-2023-11-10; | ||
|
||
world command { | ||
include reactor; | ||
|
||
export run; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
interface environment { | ||
/// Get the POSIX-style environment variables. | ||
/// | ||
/// Each environment variable is provided as a pair of string variable names | ||
/// and string value. | ||
/// | ||
/// Morally, these are a value import, but until value imports are available | ||
/// in the component model, this import function should return the same | ||
/// values each time it is called. | ||
get-environment: func() -> list<tuple<string, string>>; | ||
|
||
/// Get the POSIX-style arguments to the program. | ||
get-arguments: func() -> list<string>; | ||
|
||
/// Return a path that programs should use as their initial current working | ||
/// directory, interpreting `.` as shorthand for this. | ||
initial-cwd: func() -> option<string>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface exit { | ||
/// Exit the current instance and any linked instances. | ||
exit: func(status: result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package wasi:cli@0.2.0-rc-2023-11-10; | ||
|
||
world reactor { | ||
import wasi:clocks/wall-clock@0.2.0-rc-2023-11-10; | ||
import wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-10; | ||
import wasi:filesystem/types@0.2.0-rc-2023-11-10; | ||
import wasi:filesystem/preopens@0.2.0-rc-2023-11-10; | ||
import wasi:sockets/instance-network@0.2.0-rc-2023-11-10; | ||
import wasi:sockets/ip-name-lookup@0.2.0-rc-2023-11-10; | ||
import wasi:sockets/network@0.2.0-rc-2023-11-10; | ||
import wasi:sockets/tcp-create-socket@0.2.0-rc-2023-11-10; | ||
import wasi:sockets/tcp@0.2.0-rc-2023-11-10; | ||
import wasi:sockets/udp-create-socket@0.2.0-rc-2023-11-10; | ||
import wasi:sockets/udp@0.2.0-rc-2023-11-10; | ||
import wasi:random/random@0.2.0-rc-2023-11-10; | ||
import wasi:random/insecure@0.2.0-rc-2023-11-10; | ||
import wasi:random/insecure-seed@0.2.0-rc-2023-11-10; | ||
import wasi:io/poll@0.2.0-rc-2023-11-10; | ||
import wasi:io/streams@0.2.0-rc-2023-11-10; | ||
|
||
import environment; | ||
import exit; | ||
import stdin; | ||
import stdout; | ||
import stderr; | ||
import terminal-input; | ||
import terminal-output; | ||
import terminal-stdin; | ||
import terminal-stdout; | ||
import terminal-stderr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface run { | ||
/// Run the program. | ||
run: func() -> result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
interface stdin { | ||
use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream}; | ||
|
||
get-stdin: func() -> input-stream; | ||
} | ||
|
||
interface stdout { | ||
use wasi:io/streams@0.2.0-rc-2023-11-10.{output-stream}; | ||
|
||
get-stdout: func() -> output-stream; | ||
} | ||
|
||
interface stderr { | ||
use wasi:io/streams@0.2.0-rc-2023-11-10.{output-stream}; | ||
|
||
get-stderr: func() -> output-stream; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
interface terminal-input { | ||
/// The input side of a terminal. | ||
resource 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. | ||
} | ||
|
||
interface terminal-output { | ||
/// The output side of a terminal. | ||
resource 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. | ||
} | ||
|
||
/// An interface providing an optional `terminal-input` for stdin as a | ||
/// link-time authority. | ||
interface terminal-stdin { | ||
use terminal-input.{terminal-input}; | ||
|
||
/// If stdin is connected to a terminal, return a `terminal-input` handle | ||
/// allowing further interaction with it. | ||
get-terminal-stdin: func() -> option<terminal-input>; | ||
} | ||
|
||
/// An interface providing an optional `terminal-output` for stdout as a | ||
/// link-time authority. | ||
interface terminal-stdout { | ||
use terminal-output.{terminal-output}; | ||
|
||
/// If stdout is connected to a terminal, return a `terminal-output` handle | ||
/// allowing further interaction with it. | ||
get-terminal-stdout: func() -> option<terminal-output>; | ||
} | ||
|
||
/// An interface providing an optional `terminal-output` for stderr as a | ||
/// link-time authority. | ||
interface terminal-stderr { | ||
use terminal-output.{terminal-output}; | ||
|
||
/// If stderr is connected to a terminal, return a `terminal-output` handle | ||
/// allowing further interaction with it. | ||
get-terminal-stderr: func() -> option<terminal-output>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed | ||
/// time. | ||
/// | ||
/// It is intended to be portable at least between Unix-family platforms and | ||
/// Windows. | ||
/// | ||
/// A monotonic clock is a clock which has an unspecified initial value, and | ||
/// successive reads of the clock will produce non-decreasing values. | ||
/// | ||
/// It is intended for measuring elapsed time. | ||
interface monotonic-clock { | ||
use wasi:io/poll@0.2.0-rc-2023-10-18.{pollable}; | ||
|
||
/// A timestamp in nanoseconds. | ||
type instant = u64; | ||
|
||
/// Read the current value of the clock. | ||
/// | ||
/// The clock is monotonic, therefore calling this function repeatedly will | ||
/// produce a sequence of non-decreasing values. | ||
now: func() -> instant; | ||
|
||
/// Query the resolution of the clock. | ||
resolution: func() -> instant; | ||
|
||
/// Create a `pollable` which will resolve once the specified time has been | ||
/// reached. | ||
subscribe: func( | ||
when: instant, | ||
absolute: bool | ||
) -> pollable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
interface timezone { | ||
use wall-clock.{datetime}; | ||
|
||
/// Return information needed to display the given `datetime`. This includes | ||
/// the UTC offset, the time zone name, and a flag indicating whether | ||
/// daylight saving time is active. | ||
/// | ||
/// If the timezone cannot be determined for the given `datetime`, return a | ||
/// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight | ||
/// saving time. | ||
display: func(when: datetime) -> timezone-display; | ||
|
||
/// The same as `display`, but only return the UTC offset. | ||
utc-offset: func(when: datetime) -> s32; | ||
|
||
/// Information useful for displaying the timezone of a specific `datetime`. | ||
/// | ||
/// This information may vary within a single `timezone` to reflect daylight | ||
/// saving time adjustments. | ||
record timezone-display { | ||
/// The number of seconds difference between UTC time and the local | ||
/// time of the timezone. | ||
/// | ||
/// The returned value will always be less than 86400 which is the | ||
/// number of seconds in a day (24*60*60). | ||
/// | ||
/// In implementations that do not expose an actual time zone, this | ||
/// should return 0. | ||
utc-offset: s32, | ||
|
||
/// The abbreviated name of the timezone to display to a user. The name | ||
/// `UTC` indicates Coordinated Universal Time. Otherwise, this should | ||
/// reference local standards for the name of the time zone. | ||
/// | ||
/// In implementations that do not expose an actual time zone, this | ||
/// should be the string `UTC`. | ||
/// | ||
/// In time zones that do not have an applicable name, a formatted | ||
/// representation of the UTC offset may be returned, such as `-04:00`. | ||
name: string, | ||
|
||
/// Whether daylight saving time is active. | ||
/// | ||
/// In implementations that do not expose an actual time zone, this | ||
/// should return false. | ||
in-daylight-saving-time: bool, | ||
} | ||
} |
Oops, something went wrong.