kobako 0.29.0-aarch64-linux → 0.31.0-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.release-please-manifest.json +1 -1
  3. data/CHANGELOG.md +552 -10
  4. data/README.md +126 -564
  5. data/ROADMAP.md +3 -2
  6. data/crates/kobako-runtime/CHANGELOG.md +488 -1
  7. data/crates/kobako-runtime/README.md +11 -4
  8. data/crates/kobako-transport/CHANGELOG.md +39 -2
  9. data/crates/kobako-transport/README.md +8 -8
  10. data/crates/kobako-wasmtime/CHANGELOG.md +315 -8
  11. data/crates/kobako-wasmtime/README.md +11 -6
  12. data/crates/kobako-wasmtime/src/preview1/testsuite-expected.txt +6 -0
  13. data/crates/kobako-wasmtime/wit/deps/cli.wit +233 -0
  14. data/crates/kobako-wasmtime/wit/deps/clocks.wit +162 -0
  15. data/crates/kobako-wasmtime/wit/deps/filesystem.wit +589 -0
  16. data/crates/kobako-wasmtime/wit/deps/http.wit +733 -0
  17. data/crates/kobako-wasmtime/wit/deps/io.wit +299 -0
  18. data/crates/kobako-wasmtime/wit/deps/random.wit +92 -0
  19. data/crates/kobako-wasmtime/wit/deps/sockets.wit +949 -0
  20. data/crates/kobako-wasmtime/witx/typenames.witx +750 -0
  21. data/crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx +441 -0
  22. data/data/kobako.wasm +0 -0
  23. data/lib/kobako/3.3/kobako.so +0 -0
  24. data/lib/kobako/3.4/kobako.so +0 -0
  25. data/lib/kobako/4.0/kobako.so +0 -0
  26. data/lib/kobako/catalog/extensions.rb +19 -7
  27. data/lib/kobako/catalog/flags.rb +4 -6
  28. data/lib/kobako/catalog/grants.rb +5 -4
  29. data/lib/kobako/catalog/handles.rb +9 -31
  30. data/lib/kobako/catalog/mount.rb +12 -12
  31. data/lib/kobako/catalog/network.rb +35 -0
  32. data/lib/kobako/catalog/replacements.rb +28 -0
  33. data/lib/kobako/catalog/services.rb +7 -21
  34. data/lib/kobako/catalog/snippets.rb +10 -25
  35. data/lib/kobako/catalog.rb +4 -1
  36. data/lib/kobako/codec/{utils.rb → boundary.rb} +5 -3
  37. data/lib/kobako/codec/decoder.rb +12 -12
  38. data/lib/kobako/codec/ext_types.rb +5 -7
  39. data/lib/kobako/codec/handle_walk.rb +5 -47
  40. data/lib/kobako/codec/nesting.rb +7 -7
  41. data/lib/kobako/codec/value_budget.rb +134 -42
  42. data/lib/kobako/codec.rb +1 -1
  43. data/lib/kobako/context.rb +28 -15
  44. data/lib/kobako/errors.rb +15 -12
  45. data/lib/kobako/extension.rb +3 -2
  46. data/lib/kobako/filesystem.rb +53 -15
  47. data/lib/kobako/handle.rb +2 -2
  48. data/lib/kobako/names.rb +28 -0
  49. data/lib/kobako/network.rb +210 -0
  50. data/lib/kobako/outcome.rb +7 -7
  51. data/lib/kobako/payload/arguments.rb +2 -2
  52. data/lib/kobako/pool.rb +47 -25
  53. data/lib/kobako/runtime.rb +3 -2
  54. data/lib/kobako/sandbox.rb +113 -56
  55. data/lib/kobako/sandbox_options.rb +41 -107
  56. data/lib/kobako/snippet/bytecode.rb +1 -1
  57. data/lib/kobako/snippet/source.rb +1 -1
  58. data/lib/kobako/transport/argument_wrap.rb +64 -0
  59. data/lib/kobako/transport/block_failure.rb +1 -1
  60. data/lib/kobako/transport/dispatcher.rb +10 -10
  61. data/lib/kobako/transport/exposure.rb +28 -17
  62. data/lib/kobako/transport/reflection.rb +28 -11
  63. data/lib/kobako/transport/run.rb +13 -28
  64. data/lib/kobako/transport/yielder.rb +3 -10
  65. data/lib/kobako/transport.rb +1 -0
  66. data/lib/kobako/version.rb +1 -1
  67. data/lib/kobako.rb +38 -0
  68. data/release-please-config.json +16 -0
  69. data/sig/core/thread.rbs +6 -0
  70. data/sig/kobako/catalog/extensions.rbs +5 -3
  71. data/sig/kobako/catalog/grants.rbs +7 -4
  72. data/sig/kobako/catalog/handles.rbs +2 -4
  73. data/sig/kobako/catalog/mount.rbs +3 -5
  74. data/sig/kobako/catalog/network.rbs +20 -0
  75. data/sig/kobako/catalog/replacements.rbs +14 -0
  76. data/sig/kobako/catalog/services.rbs +1 -5
  77. data/sig/kobako/catalog/snippets.rbs +3 -5
  78. data/sig/kobako/catalog.rbs +1 -1
  79. data/sig/kobako/codec/boundary.rbs +9 -0
  80. data/sig/kobako/codec/decoder.rbs +1 -1
  81. data/sig/kobako/codec/handle_walk.rbs +0 -6
  82. data/sig/kobako/codec/nesting.rbs +2 -2
  83. data/sig/kobako/codec/value_budget.rbs +48 -5
  84. data/sig/kobako/codec.rbs +1 -2
  85. data/sig/kobako/context.rbs +4 -2
  86. data/sig/kobako/errors.rbs +4 -4
  87. data/sig/kobako/filesystem.rbs +38 -15
  88. data/sig/kobako/guest_yielder.rbs +1 -1
  89. data/sig/kobako/network.rbs +115 -0
  90. data/sig/kobako/outcome.rbs +1 -1
  91. data/sig/kobako/payload/arguments.rbs +1 -1
  92. data/sig/kobako/pool.rbs +8 -4
  93. data/sig/kobako/runtime.rbs +32 -3
  94. data/sig/kobako/sandbox.rbs +22 -7
  95. data/sig/kobako/sandbox_options.rbs +29 -38
  96. data/sig/kobako/transport/argument_wrap.rbs +15 -0
  97. data/sig/kobako/transport/dispatcher.rbs +2 -2
  98. data/sig/kobako/transport/error.rbs +1 -1
  99. data/sig/kobako/transport/exposure.rbs +3 -5
  100. data/sig/kobako/transport/reflection.rbs +12 -2
  101. data/sig/kobako/transport/run.rbs +3 -5
  102. data/sig/kobako/transport/yielder.rbs +0 -3
  103. data/sig/kobako/transport.rbs +2 -2
  104. data/sig/kobako.rbs +13 -0
  105. metadata +26 -8
  106. data/lib/kobako/constant_name.rb +0 -8
  107. data/sig/kobako/codec/utils.rbs +0 -9
  108. data/sig/kobako/constant_name.rbs +0 -3
@@ -0,0 +1,233 @@
1
+ package wasi:cli@0.2.12;
2
+
3
+ @since(version = 0.2.0)
4
+ interface environment {
5
+ /// Get the POSIX-style environment variables.
6
+ ///
7
+ /// Each environment variable is provided as a pair of string variable names
8
+ /// and string value.
9
+ ///
10
+ /// Morally, these are a value import, but until value imports are available
11
+ /// in the component model, this import function should return the same
12
+ /// values each time it is called.
13
+ @since(version = 0.2.0)
14
+ get-environment: func() -> list<tuple<string, string>>;
15
+
16
+ /// Get the POSIX-style arguments to the program.
17
+ @since(version = 0.2.0)
18
+ get-arguments: func() -> list<string>;
19
+
20
+ /// Return a path that programs should use as their initial current working
21
+ /// directory, interpreting `.` as shorthand for this.
22
+ @since(version = 0.2.0)
23
+ initial-cwd: func() -> option<string>;
24
+ }
25
+
26
+ @since(version = 0.2.0)
27
+ interface exit {
28
+ /// Exit the current instance and any linked instances.
29
+ @since(version = 0.2.0)
30
+ exit: func(status: result);
31
+
32
+ /// Exit the current instance and any linked instances, reporting the
33
+ /// specified status code to the host.
34
+ ///
35
+ /// The meaning of the code depends on the context, with 0 usually meaning
36
+ /// "success", and other values indicating various types of failure.
37
+ ///
38
+ /// This function does not return; the effect is analogous to a trap, but
39
+ /// without the connotation that something bad has happened.
40
+ @since(version = 0.2.12)
41
+ exit-with-code: func(status-code: u8);
42
+ }
43
+
44
+ @since(version = 0.2.0)
45
+ interface run {
46
+ /// Run the program.
47
+ @since(version = 0.2.0)
48
+ run: func() -> result;
49
+ }
50
+
51
+ @since(version = 0.2.0)
52
+ interface stdin {
53
+ @since(version = 0.2.0)
54
+ use wasi:io/streams@0.2.12.{input-stream};
55
+
56
+ @since(version = 0.2.0)
57
+ get-stdin: func() -> input-stream;
58
+ }
59
+
60
+ @since(version = 0.2.0)
61
+ interface stdout {
62
+ @since(version = 0.2.0)
63
+ use wasi:io/streams@0.2.12.{output-stream};
64
+
65
+ @since(version = 0.2.0)
66
+ get-stdout: func() -> output-stream;
67
+ }
68
+
69
+ @since(version = 0.2.0)
70
+ interface stderr {
71
+ @since(version = 0.2.0)
72
+ use wasi:io/streams@0.2.12.{output-stream};
73
+
74
+ @since(version = 0.2.0)
75
+ get-stderr: func() -> output-stream;
76
+ }
77
+
78
+ /// Terminal input.
79
+ ///
80
+ /// In the future, this may include functions for disabling echoing,
81
+ /// disabling input buffering so that keyboard events are sent through
82
+ /// immediately, querying supported features, and so on.
83
+ @since(version = 0.2.0)
84
+ interface terminal-input {
85
+ /// The input side of a terminal.
86
+ @since(version = 0.2.0)
87
+ resource terminal-input;
88
+ }
89
+
90
+ /// Terminal output.
91
+ ///
92
+ /// In the future, this may include functions for querying the terminal
93
+ /// size, being notified of terminal size changes, querying supported
94
+ /// features, and so on.
95
+ @since(version = 0.2.0)
96
+ interface terminal-output {
97
+ /// The output side of a terminal.
98
+ @since(version = 0.2.0)
99
+ resource terminal-output;
100
+ }
101
+
102
+ /// An interface providing an optional `terminal-input` for stdin as a
103
+ /// link-time authority.
104
+ @since(version = 0.2.0)
105
+ interface terminal-stdin {
106
+ @since(version = 0.2.0)
107
+ use terminal-input.{terminal-input};
108
+
109
+ /// If stdin is connected to a terminal, return a `terminal-input` handle
110
+ /// allowing further interaction with it.
111
+ @since(version = 0.2.0)
112
+ get-terminal-stdin: func() -> option<terminal-input>;
113
+ }
114
+
115
+ /// An interface providing an optional `terminal-output` for stdout as a
116
+ /// link-time authority.
117
+ @since(version = 0.2.0)
118
+ interface terminal-stdout {
119
+ @since(version = 0.2.0)
120
+ use terminal-output.{terminal-output};
121
+
122
+ /// If stdout is connected to a terminal, return a `terminal-output` handle
123
+ /// allowing further interaction with it.
124
+ @since(version = 0.2.0)
125
+ get-terminal-stdout: func() -> option<terminal-output>;
126
+ }
127
+
128
+ /// An interface providing an optional `terminal-output` for stderr as a
129
+ /// link-time authority.
130
+ @since(version = 0.2.0)
131
+ interface terminal-stderr {
132
+ @since(version = 0.2.0)
133
+ use terminal-output.{terminal-output};
134
+
135
+ /// If stderr is connected to a terminal, return a `terminal-output` handle
136
+ /// allowing further interaction with it.
137
+ @since(version = 0.2.0)
138
+ get-terminal-stderr: func() -> option<terminal-output>;
139
+ }
140
+
141
+ @since(version = 0.2.0)
142
+ world imports {
143
+ @since(version = 0.2.0)
144
+ import environment;
145
+ @since(version = 0.2.0)
146
+ import exit;
147
+ @since(version = 0.2.0)
148
+ import wasi:io/error@0.2.12;
149
+ @since(version = 0.2.0)
150
+ import wasi:io/poll@0.2.12;
151
+ @since(version = 0.2.0)
152
+ import wasi:io/streams@0.2.12;
153
+ @since(version = 0.2.0)
154
+ import stdin;
155
+ @since(version = 0.2.0)
156
+ import stdout;
157
+ @since(version = 0.2.0)
158
+ import stderr;
159
+ @since(version = 0.2.0)
160
+ import terminal-input;
161
+ @since(version = 0.2.0)
162
+ import terminal-output;
163
+ @since(version = 0.2.0)
164
+ import terminal-stdin;
165
+ @since(version = 0.2.0)
166
+ import terminal-stdout;
167
+ @since(version = 0.2.0)
168
+ import terminal-stderr;
169
+ import wasi:clocks/monotonic-clock@0.2.12;
170
+ import wasi:clocks/wall-clock@0.2.12;
171
+ @unstable(feature = clocks-timezone)
172
+ import wasi:clocks/timezone@0.2.12;
173
+ import wasi:filesystem/types@0.2.12;
174
+ import wasi:filesystem/preopens@0.2.12;
175
+ import wasi:sockets/network@0.2.12;
176
+ import wasi:sockets/instance-network@0.2.12;
177
+ import wasi:sockets/udp@0.2.12;
178
+ import wasi:sockets/udp-create-socket@0.2.12;
179
+ import wasi:sockets/tcp@0.2.12;
180
+ import wasi:sockets/tcp-create-socket@0.2.12;
181
+ import wasi:sockets/ip-name-lookup@0.2.12;
182
+ import wasi:random/random@0.2.12;
183
+ import wasi:random/insecure@0.2.12;
184
+ import wasi:random/insecure-seed@0.2.12;
185
+ }
186
+ @since(version = 0.2.0)
187
+ world command {
188
+ @since(version = 0.2.0)
189
+ import environment;
190
+ @since(version = 0.2.0)
191
+ import exit;
192
+ @since(version = 0.2.0)
193
+ import wasi:io/error@0.2.12;
194
+ @since(version = 0.2.0)
195
+ import wasi:io/poll@0.2.12;
196
+ @since(version = 0.2.0)
197
+ import wasi:io/streams@0.2.12;
198
+ @since(version = 0.2.0)
199
+ import stdin;
200
+ @since(version = 0.2.0)
201
+ import stdout;
202
+ @since(version = 0.2.0)
203
+ import stderr;
204
+ @since(version = 0.2.0)
205
+ import terminal-input;
206
+ @since(version = 0.2.0)
207
+ import terminal-output;
208
+ @since(version = 0.2.0)
209
+ import terminal-stdin;
210
+ @since(version = 0.2.0)
211
+ import terminal-stdout;
212
+ @since(version = 0.2.0)
213
+ import terminal-stderr;
214
+ import wasi:clocks/monotonic-clock@0.2.12;
215
+ import wasi:clocks/wall-clock@0.2.12;
216
+ @unstable(feature = clocks-timezone)
217
+ import wasi:clocks/timezone@0.2.12;
218
+ import wasi:filesystem/types@0.2.12;
219
+ import wasi:filesystem/preopens@0.2.12;
220
+ import wasi:sockets/network@0.2.12;
221
+ import wasi:sockets/instance-network@0.2.12;
222
+ import wasi:sockets/udp@0.2.12;
223
+ import wasi:sockets/udp-create-socket@0.2.12;
224
+ import wasi:sockets/tcp@0.2.12;
225
+ import wasi:sockets/tcp-create-socket@0.2.12;
226
+ import wasi:sockets/ip-name-lookup@0.2.12;
227
+ import wasi:random/random@0.2.12;
228
+ import wasi:random/insecure@0.2.12;
229
+ import wasi:random/insecure-seed@0.2.12;
230
+
231
+ @since(version = 0.2.0)
232
+ export run;
233
+ }
@@ -0,0 +1,162 @@
1
+ package wasi:clocks@0.2.12;
2
+
3
+ /// WASI Monotonic Clock is a clock API intended to let users measure elapsed
4
+ /// time.
5
+ ///
6
+ /// It is intended to be portable at least between Unix-family platforms and
7
+ /// Windows.
8
+ ///
9
+ /// A monotonic clock is a clock which has an unspecified initial value, and
10
+ /// successive reads of the clock will produce non-decreasing values.
11
+ @since(version = 0.2.0)
12
+ interface monotonic-clock {
13
+ @since(version = 0.2.0)
14
+ use wasi:io/poll@0.2.12.{pollable};
15
+
16
+ /// An instant in time, in nanoseconds. An instant is relative to an
17
+ /// unspecified initial value, and can only be compared to instances from
18
+ /// the same monotonic-clock.
19
+ @since(version = 0.2.0)
20
+ type instant = u64;
21
+
22
+ /// A duration of time, in nanoseconds.
23
+ @since(version = 0.2.0)
24
+ type duration = u64;
25
+
26
+ /// Read the current value of the clock.
27
+ ///
28
+ /// The clock is monotonic, therefore calling this function repeatedly will
29
+ /// produce a sequence of non-decreasing values.
30
+ ///
31
+ /// For completeness, this function traps if it's not possible to represent
32
+ /// the value of the clock in an `instant`. Consequently, implementations
33
+ /// should ensure that the starting time is low enough to avoid the
34
+ /// possibility of overflow in practice.
35
+ @since(version = 0.2.0)
36
+ now: func() -> instant;
37
+
38
+ /// Query the resolution of the clock. Returns the duration of time
39
+ /// corresponding to a clock tick.
40
+ @since(version = 0.2.0)
41
+ resolution: func() -> duration;
42
+
43
+ /// Create a `pollable` which will resolve once the specified instant
44
+ /// has occurred.
45
+ @since(version = 0.2.0)
46
+ subscribe-instant: func(when: instant) -> pollable;
47
+
48
+ /// Create a `pollable` that will resolve after the specified duration has
49
+ /// elapsed from the time this function is invoked.
50
+ @since(version = 0.2.0)
51
+ subscribe-duration: func(when: duration) -> pollable;
52
+ }
53
+
54
+ /// WASI Wall Clock is a clock API intended to let users query the current
55
+ /// time. The name "wall" makes an analogy to a "clock on the wall", which
56
+ /// is not necessarily monotonic as it may be reset.
57
+ ///
58
+ /// It is intended to be portable at least between Unix-family platforms and
59
+ /// Windows.
60
+ ///
61
+ /// A wall clock is a clock which measures the date and time according to
62
+ /// some external reference.
63
+ ///
64
+ /// External references may be reset, so this clock is not necessarily
65
+ /// monotonic, making it unsuitable for measuring elapsed time.
66
+ ///
67
+ /// It is intended for reporting the current date and time for humans.
68
+ @since(version = 0.2.0)
69
+ interface wall-clock {
70
+ /// A time and date in seconds plus nanoseconds.
71
+ @since(version = 0.2.0)
72
+ record datetime {
73
+ seconds: u64,
74
+ nanoseconds: u32,
75
+ }
76
+
77
+ /// Read the current value of the clock.
78
+ ///
79
+ /// This clock is not monotonic, therefore calling this function repeatedly
80
+ /// will not necessarily produce a sequence of non-decreasing values.
81
+ ///
82
+ /// The returned timestamps represent the number of seconds since
83
+ /// 1970-01-01T00:00:00Z, also known as [POSIX's Seconds Since the Epoch],
84
+ /// also known as [Unix Time].
85
+ ///
86
+ /// The nanoseconds field of the output is always less than 1000000000.
87
+ ///
88
+ /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16
89
+ /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time
90
+ @since(version = 0.2.0)
91
+ now: func() -> datetime;
92
+
93
+ /// Query the resolution of the clock.
94
+ ///
95
+ /// The nanoseconds field of the output is always less than 1000000000.
96
+ @since(version = 0.2.0)
97
+ resolution: func() -> datetime;
98
+ }
99
+
100
+ @unstable(feature = clocks-timezone)
101
+ interface timezone {
102
+ @unstable(feature = clocks-timezone)
103
+ use wall-clock.{datetime};
104
+
105
+ /// Information useful for displaying the timezone of a specific `datetime`.
106
+ ///
107
+ /// This information may vary within a single `timezone` to reflect daylight
108
+ /// saving time adjustments.
109
+ @unstable(feature = clocks-timezone)
110
+ record timezone-display {
111
+ /// The number of seconds difference between UTC time and the local
112
+ /// time of the timezone.
113
+ ///
114
+ /// The returned value will always be less than 86400 which is the
115
+ /// number of seconds in a day (24*60*60).
116
+ ///
117
+ /// In implementations that do not expose an actual time zone, this
118
+ /// should return 0.
119
+ utc-offset: s32,
120
+ /// The abbreviated name of the timezone to display to a user. The name
121
+ /// `UTC` indicates Coordinated Universal Time. Otherwise, this should
122
+ /// reference local standards for the name of the time zone.
123
+ ///
124
+ /// In implementations that do not expose an actual time zone, this
125
+ /// should be the string `UTC`.
126
+ ///
127
+ /// In time zones that do not have an applicable name, a formatted
128
+ /// representation of the UTC offset may be returned, such as `-04:00`.
129
+ name: string,
130
+ /// Whether daylight saving time is active.
131
+ ///
132
+ /// In implementations that do not expose an actual time zone, this
133
+ /// should return false.
134
+ in-daylight-saving-time: bool,
135
+ }
136
+
137
+ /// Return information needed to display the given `datetime`. This includes
138
+ /// the UTC offset, the time zone name, and a flag indicating whether
139
+ /// daylight saving time is active.
140
+ ///
141
+ /// If the timezone cannot be determined for the given `datetime`, return a
142
+ /// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
143
+ /// saving time.
144
+ @unstable(feature = clocks-timezone)
145
+ display: func(when: datetime) -> timezone-display;
146
+
147
+ /// The same as `display`, but only return the UTC offset.
148
+ @unstable(feature = clocks-timezone)
149
+ utc-offset: func(when: datetime) -> s32;
150
+ }
151
+
152
+ @since(version = 0.2.0)
153
+ world imports {
154
+ @since(version = 0.2.0)
155
+ import wasi:io/poll@0.2.12;
156
+ @since(version = 0.2.0)
157
+ import monotonic-clock;
158
+ @since(version = 0.2.0)
159
+ import wall-clock;
160
+ @unstable(feature = clocks-timezone)
161
+ import timezone;
162
+ }