kobako 0.28.0 → 0.29.0
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.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +170 -0
- data/Cargo.lock +111 -82
- data/README.md +154 -36
- data/ROADMAP.md +5 -0
- data/SECURITY.md +1 -1
- data/crates/kobako-runtime/CHANGELOG.md +86 -0
- data/crates/kobako-runtime/Cargo.toml +27 -6
- data/crates/kobako-runtime/README.md +13 -8
- data/crates/kobako-runtime/src/dispatch.rs +8 -0
- data/crates/kobako-runtime/src/filesystem/directory/spelling.rs +194 -0
- data/crates/kobako-runtime/src/filesystem/directory.rs +1082 -0
- data/crates/kobako-runtime/src/filesystem/memory.rs +1100 -0
- data/crates/kobako-runtime/src/filesystem/overlay/exclusive.rs +88 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack.rs +808 -0
- data/crates/kobako-runtime/src/filesystem/overlay.rs +1955 -0
- data/crates/kobako-runtime/src/filesystem/path.rs +60 -0
- data/crates/kobako-runtime/src/filesystem/temporary.rs +167 -0
- data/crates/kobako-runtime/src/filesystem.rs +392 -0
- data/crates/kobako-runtime/src/grant.rs +20 -0
- data/crates/kobako-runtime/src/lib.rs +11 -1
- data/crates/kobako-runtime/src/mount.rs +178 -0
- data/crates/kobako-runtime/src/profile.rs +4 -4
- data/crates/kobako-runtime/src/runtime.rs +12 -0
- data/crates/kobako-runtime/src/snapshot.rs +20 -5
- data/crates/kobako-runtime/src/yielder.rs +11 -6
- data/crates/kobako-transport/CHANGELOG.md +17 -0
- data/crates/kobako-transport/Cargo.toml +1 -1
- data/crates/kobako-transport/README.md +1 -1
- data/crates/kobako-transport/src/abi.rs +1 -1
- data/crates/kobako-transport/src/envelope/fault.rs +2 -1
- data/crates/kobako-transport/src/envelope/preamble.rs +12 -12
- data/crates/kobako-transport/src/envelope/reply.rs +32 -14
- data/crates/kobako-transport/src/envelope/request.rs +18 -8
- data/crates/kobako-wasmtime/CHANGELOG.md +119 -0
- data/crates/kobako-wasmtime/Cargo.toml +21 -16
- data/crates/kobako-wasmtime/README.md +5 -3
- data/crates/kobako-wasmtime/src/abi.rs +66 -32
- data/crates/kobako-wasmtime/src/ambient.rs +63 -4
- data/crates/kobako-wasmtime/src/cache.rs +185 -74
- data/crates/kobako-wasmtime/src/config.rs +58 -1
- data/crates/kobako-wasmtime/src/descriptors.rs +167 -0
- data/crates/kobako-wasmtime/src/dispatch.rs +47 -29
- data/crates/kobako-wasmtime/src/driver.rs +46 -44
- data/crates/kobako-wasmtime/src/guest_mem.rs +13 -7
- data/crates/kobako-wasmtime/src/imports.rs +46 -0
- data/crates/kobako-wasmtime/src/instance_pre.rs +17 -45
- data/crates/kobako-wasmtime/src/invocation.rs +35 -46
- data/crates/kobako-wasmtime/src/io.rs +5 -202
- data/crates/kobako-wasmtime/src/lib.rs +4 -0
- data/crates/kobako-wasmtime/src/preview1/args.rs +60 -0
- data/crates/kobako-wasmtime/src/preview1/beneath.rs +188 -0
- data/crates/kobako-wasmtime/src/preview1/differential/mount.rs +609 -0
- data/crates/kobako-wasmtime/src/preview1/differential.rs +372 -0
- data/crates/kobako-wasmtime/src/preview1/errno.rs +267 -0
- data/crates/kobako-wasmtime/src/preview1/fd.rs +672 -0
- data/crates/kobako-wasmtime/src/preview1/memory.rs +205 -0
- data/crates/kobako-wasmtime/src/preview1/mount_view.rs +2499 -0
- data/crates/kobako-wasmtime/src/preview1/path.rs +421 -0
- data/crates/kobako-wasmtime/src/preview1/poll.rs +333 -0
- data/crates/kobako-wasmtime/src/preview1/sock.rs +30 -0
- data/crates/kobako-wasmtime/src/preview1.rs +461 -0
- data/crates/kobako-wasmtime/src/trap.rs +39 -19
- data/crates/kobako-wasmtime/src/wasi.rs +317 -0
- data/crates/kobako-wasmtime/tests/compile_posture.rs +43 -0
- data/crates/kobako-wasmtime/tests/guest_file.rs +1054 -0
- data/crates/kobako-wasmtime/tests/preamble_flags.rs +3 -2
- data/crates/kobako-wasmtime/tests/snippet_compile.rs +4 -3
- data/crates/kobako-wasmtime/tests/support/mod.rs +9 -13
- data/crates/kobako-wasmtime/tests/unanswered_call.rs +86 -0
- data/crates/kobako-wasmtime/tests/unsupported_call.rs +1 -0
- data/data/kobako.wasm +0 -0
- data/ext/kobako/Cargo.toml +4 -2
- data/ext/kobako/src/runtime/bridge.rs +154 -81
- data/ext/kobako/src/runtime/escape.rs +53 -0
- data/ext/kobako/src/runtime/filesystem/grants.rs +91 -0
- data/ext/kobako/src/runtime/filesystem/ruby.rs +400 -0
- data/ext/kobako/src/runtime/filesystem.rs +236 -0
- data/ext/kobako/src/runtime/gvl.rs +7 -1
- data/ext/kobako/src/runtime/pinned_value.rs +31 -0
- data/ext/kobako/src/runtime/snapshot.rs +127 -0
- data/ext/kobako/src/runtime.rs +120 -199
- data/lib/kobako/catalog/flags.rb +2 -14
- data/lib/kobako/catalog/grants.rb +30 -0
- data/lib/kobako/catalog/mount.rb +27 -0
- data/lib/kobako/catalog/services.rb +11 -0
- data/lib/kobako/catalog/snippets.rb +5 -9
- data/lib/kobako/catalog.rb +11 -0
- data/lib/kobako/codec/decoder.rb +1 -0
- data/lib/kobako/codec/ext_types.rb +1 -1
- data/lib/kobako/codec/state.rb +19 -3
- data/lib/kobako/codec/value_budget.rb +86 -0
- data/lib/kobako/codec.rb +7 -0
- data/lib/kobako/context.rb +38 -11
- data/lib/kobako/errors.rb +15 -14
- data/lib/kobako/filesystem.rb +38 -0
- data/lib/kobako/pool.rb +2 -2
- data/lib/kobako/sandbox.rb +40 -12
- data/lib/kobako/sandbox_options.rb +39 -12
- data/lib/kobako/snippet/{binary.rb → bytecode.rb} +1 -1
- data/lib/kobako/snippet.rb +1 -1
- data/lib/kobako/transport/block_failure.rb +35 -0
- data/lib/kobako/transport/dispatcher.rb +30 -26
- data/lib/kobako/transport/exposure.rb +5 -7
- data/lib/kobako/transport/reflection.rb +79 -23
- data/lib/kobako/transport/yielder.rb +8 -30
- data/lib/kobako/transport.rb +1 -0
- data/lib/kobako/version.rb +1 -1
- data/lib/kobako.rb +1 -0
- data/sig/kobako/catalog/flags.rbs +0 -4
- data/sig/kobako/catalog/grants.rbs +13 -0
- data/sig/kobako/catalog/mount.rbs +28 -0
- data/sig/kobako/catalog/services.rbs +4 -0
- data/sig/kobako/catalog/snippets.rbs +1 -1
- data/sig/kobako/catalog.rbs +1 -0
- data/sig/kobako/codec/state.rbs +7 -1
- data/sig/kobako/codec/value_budget.rbs +23 -0
- data/sig/kobako/codec.rbs +2 -0
- data/sig/kobako/context.rbs +14 -6
- data/sig/kobako/errors.rbs +4 -4
- data/sig/kobako/filesystem.rbs +88 -0
- data/sig/kobako/guest_yielder.rbs +9 -0
- data/sig/kobako/pool.rbs +1 -1
- data/sig/kobako/runtime.rbs +21 -49
- data/sig/kobako/sandbox.rbs +7 -1
- data/sig/kobako/sandbox_options.rbs +24 -2
- data/sig/kobako/snapshot.rbs +20 -0
- data/sig/kobako/snippet/bytecode.rbs +12 -0
- data/sig/kobako/transport/block_failure.rbs +13 -0
- data/sig/kobako/transport/dispatcher.rbs +3 -3
- data/sig/kobako/transport/exposure.rbs +1 -1
- data/sig/kobako/transport/reflection.rbs +14 -1
- data/sig/kobako/transport/yielder.rbs +3 -7
- data/sig/kobako/transport.rbs +2 -2
- metadata +60 -7
- data/sig/kobako/snippet/binary.rbs +0 -12
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
module Filesystem
|
|
3
|
+
type mountable = Memory | Temporary | Directory | Overlay | _Readable
|
|
4
|
+
|
|
5
|
+
type access = :read | :read_write
|
|
6
|
+
|
|
7
|
+
# What a Filesystem written in Ruby answers to be mounted. One that
|
|
8
|
+
# also answers _Listable lists its directories, and one answering
|
|
9
|
+
# _Writable takes changes too; each method it lacks is refused alone.
|
|
10
|
+
interface _Readable
|
|
11
|
+
def open: (String path, Integer flags) -> _File
|
|
12
|
+
def stat: (String path) -> _Stat
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
interface _Listable
|
|
16
|
+
def children: (String path) -> Array[String]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
interface _Writable
|
|
20
|
+
def mkdir: (String path) -> void
|
|
21
|
+
def rmdir: (String path) -> void
|
|
22
|
+
def unlink: (String path) -> void
|
|
23
|
+
def rename: (String from, String to, directory: bool?) -> void
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# A file a Filesystem written in Ruby opened; +::File+ answers it. One
|
|
27
|
+
# that also answers _WritableFile takes writes too, one answering
|
|
28
|
+
# _AppendableFile takes appends, and any file may answer _SyncableFile
|
|
29
|
+
# to flush or _ClosableFile to close.
|
|
30
|
+
interface _File
|
|
31
|
+
def pread: (Integer length, Integer offset) -> String?
|
|
32
|
+
def size: () -> Integer
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
interface _WritableFile
|
|
36
|
+
def pwrite: (String data, Integer offset) -> Integer
|
|
37
|
+
def truncate: (Integer length) -> void
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Writes all of +data+ at the end in one step, answering where the file
|
|
41
|
+
# then ends.
|
|
42
|
+
interface _AppendableFile
|
|
43
|
+
def append: (String data) -> Integer
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
interface _SyncableFile
|
|
47
|
+
def fsync: () -> void
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
interface _ClosableFile
|
|
51
|
+
def close: () -> void
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# What a Filesystem written in Ruby's +stat+ answers, as +File::Stat+
|
|
55
|
+
# does; an +ino+ of zero names no identity. One that also answers
|
|
56
|
+
# _StatDevice names the device its +ino+ belongs to.
|
|
57
|
+
interface _Stat
|
|
58
|
+
def directory?: () -> boolish
|
|
59
|
+
def size: () -> Integer
|
|
60
|
+
def ino: () -> Integer
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
interface _StatDevice
|
|
64
|
+
def dev: () -> Integer
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
class Memory
|
|
68
|
+
# A bare <tt>"path" => contents</tt> arrives as keywords, which RBS
|
|
69
|
+
# cannot key by String; a Symbol keyword past +limit+ and +inodes+
|
|
70
|
+
# raises ArgumentError.
|
|
71
|
+
def initialize: (?Hash[String, String] files, ?limit: Integer?, ?inodes: Integer?, **String) -> void
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class Temporary
|
|
75
|
+
def initialize: (?limit: Integer?, ?inodes: Integer?) -> void
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
class Directory
|
|
79
|
+
def initialize: (String path) -> void
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
class Overlay
|
|
83
|
+
def initialize: () -> void
|
|
84
|
+
def layer: (mountable filesystem, ?access: access) -> Overlay
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
# Frame-scoped guest re-entry handle the ext hands the dispatch Proc as
|
|
3
|
+
# its last argument — the production conformer of
|
|
4
|
+
# +Kobako::Transport::_GuestYielder+, answering the Yield Reply already
|
|
5
|
+
# split off the core envelope.
|
|
6
|
+
class GuestYielder
|
|
7
|
+
def call: (String args_bytes) -> [Symbol, String, String?]
|
|
8
|
+
end
|
|
9
|
+
end
|
data/sig/kobako/pool.rbs
CHANGED
data/sig/kobako/runtime.rbs
CHANGED
|
@@ -2,66 +2,38 @@ module Kobako
|
|
|
2
2
|
class Runtime
|
|
3
3
|
def self.default_path: () -> String
|
|
4
4
|
|
|
5
|
+
def self.validate_mount!: (untyped at, untyped access, untyped filesystem) -> nil
|
|
6
|
+
|
|
5
7
|
def self.from_path: (
|
|
6
8
|
String path,
|
|
7
|
-
(Float | Integer)
|
|
8
|
-
Integer
|
|
9
|
-
Integer
|
|
10
|
-
Integer
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
timeout: (Float | Integer)?,
|
|
10
|
+
setup_timeout: (Float | Integer)?,
|
|
11
|
+
memory_limit: Integer?,
|
|
12
|
+
stdout_limit: Integer?,
|
|
13
|
+
stderr_limit: Integer?,
|
|
14
|
+
open_file_limit: Integer?,
|
|
15
|
+
profile: Symbol,
|
|
16
|
+
gvl: Symbol
|
|
13
17
|
) -> Runtime
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Array[
|
|
18
|
-
Array[Kobako::Catalog::
|
|
19
|
-
Array[Kobako::Catalog::
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
type setup = [
|
|
20
|
+
Array[String],
|
|
21
|
+
Array[Kobako::Catalog::Snippets::tuple],
|
|
22
|
+
Array[Kobako::Catalog::Flags::tuple],
|
|
23
|
+
Array[Kobako::Catalog::Mount::tuple]
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
def eval: (Kobako::Transport::dispatch_proc dispatch, setup setup, String source) -> Kobako::Snapshot
|
|
22
27
|
|
|
23
28
|
def run: (
|
|
24
29
|
Kobako::Transport::dispatch_proc dispatch,
|
|
25
|
-
|
|
26
|
-
Array[Kobako::Catalog::Snippets::tuple] snippets,
|
|
27
|
-
Array[Kobako::Catalog::Flags::tuple] flags,
|
|
30
|
+
setup setup,
|
|
28
31
|
String entrypoint,
|
|
29
32
|
String payload
|
|
30
|
-
) -> Kobako::
|
|
33
|
+
) -> Kobako::Snapshot
|
|
31
34
|
|
|
32
35
|
def profile: () -> Symbol
|
|
33
36
|
|
|
34
|
-
def compile: (
|
|
35
|
-
Array[String] paths,
|
|
36
|
-
Array[Kobako::Catalog::Snippets::tuple] snippets,
|
|
37
|
-
Array[Kobako::Catalog::Flags::tuple] flags
|
|
38
|
-
) -> Array[String]?
|
|
39
|
-
|
|
40
|
-
# Frame-scoped guest re-entry handle the ext hands the dispatch Proc as
|
|
41
|
-
# its last argument — the production conformer of
|
|
42
|
-
# +Kobako::Transport::_GuestYielder+, answering the Yield Reply already
|
|
43
|
-
# split off the core envelope.
|
|
44
|
-
class GuestYielder
|
|
45
|
-
def call: (String args_bytes) -> [Symbol, String, String?]
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# One invocation's result — the whole Snapshot the driver produced.
|
|
49
|
-
class Snapshot
|
|
50
|
-
def outcome: () -> [String, Kobako::Outcome::panic_fields?]
|
|
51
|
-
|
|
52
|
-
def trap_error: () -> Kobako::TrapError?
|
|
53
|
-
|
|
54
|
-
def wall_time: () -> Float
|
|
55
|
-
|
|
56
|
-
def memory_peak: () -> Integer
|
|
57
|
-
|
|
58
|
-
def stdout: () -> String
|
|
59
|
-
|
|
60
|
-
def stdout_truncated?: () -> bool
|
|
61
|
-
|
|
62
|
-
def stderr: () -> String
|
|
63
|
-
|
|
64
|
-
def stderr_truncated?: () -> bool
|
|
65
|
-
end
|
|
37
|
+
def compile: (Kobako::Context::preamble preamble) -> Array[String]?
|
|
66
38
|
end
|
|
67
39
|
end
|
data/sig/kobako/sandbox.rbs
CHANGED
|
@@ -7,14 +7,16 @@ module Kobako
|
|
|
7
7
|
|
|
8
8
|
# Forwarded to @options via Forwardable#def_delegators.
|
|
9
9
|
def timeout: () -> Float?
|
|
10
|
+
def setup_timeout: () -> Float?
|
|
10
11
|
def memory_limit: () -> Integer?
|
|
11
12
|
def stdout_limit: () -> Integer?
|
|
12
13
|
def stderr_limit: () -> Integer?
|
|
14
|
+
def open_file_limit: () -> Integer?
|
|
13
15
|
def profile: () -> Symbol
|
|
14
16
|
def gvl: () -> Symbol
|
|
15
17
|
|
|
16
18
|
# Every keyword beyond wasm_path forwards verbatim to
|
|
17
|
-
# SandboxOptions.new (the
|
|
19
|
+
# SandboxOptions.new (the caps + the profile floor).
|
|
18
20
|
def initialize: (
|
|
19
21
|
?wasm_path: String?,
|
|
20
22
|
**untyped options
|
|
@@ -24,6 +26,8 @@ module Kobako
|
|
|
24
26
|
|
|
25
27
|
def install: (*untyped extensions) -> Kobako::Sandbox
|
|
26
28
|
|
|
29
|
+
def mount: (String at, Kobako::Filesystem::mountable filesystem, ?access: Kobako::Filesystem::access) ?{ (String path, Kobako::Filesystem::access access) -> boolish } -> Kobako::Sandbox
|
|
30
|
+
|
|
27
31
|
def preload: (code: String, name: Symbol | String) -> Kobako::Sandbox
|
|
28
32
|
| (binary: String) -> Kobako::Sandbox
|
|
29
33
|
|
|
@@ -39,6 +43,8 @@ module Kobako
|
|
|
39
43
|
|
|
40
44
|
def new_invocation: () -> Kobako::Context
|
|
41
45
|
|
|
46
|
+
def preamble: (Array[Kobako::Catalog::Snippets::tuple] snippets) -> Kobako::Context::preamble
|
|
47
|
+
|
|
42
48
|
def refuse_once_invoked!: (String verb) -> void
|
|
43
49
|
|
|
44
50
|
def begin_invocation!: () -> void
|
|
@@ -1,45 +1,67 @@
|
|
|
1
1
|
module Kobako
|
|
2
2
|
class SandboxOptions < Data
|
|
3
3
|
DEFAULT_TIMEOUT_SECONDS: Float
|
|
4
|
+
DEFAULT_SETUP_TIMEOUT_SECONDS: Float
|
|
4
5
|
DEFAULT_MEMORY_LIMIT: Integer
|
|
5
6
|
DEFAULT_OUTPUT_LIMIT: Integer
|
|
7
|
+
DEFAULT_OPEN_FILE_LIMIT: Integer
|
|
6
8
|
DEFAULT_PROFILE: Symbol
|
|
7
9
|
PROFILES: Array[Symbol]
|
|
8
10
|
GVL_MODES: Array[Symbol]
|
|
9
11
|
DEFAULT_GVL: Symbol
|
|
12
|
+
VALUE_BYTES: Integer
|
|
10
13
|
|
|
11
14
|
attr_reader timeout: Float?
|
|
15
|
+
attr_reader setup_timeout: Float?
|
|
12
16
|
attr_reader memory_limit: Integer?
|
|
13
17
|
attr_reader stdout_limit: Integer?
|
|
14
18
|
attr_reader stderr_limit: Integer?
|
|
19
|
+
attr_reader open_file_limit: Integer?
|
|
15
20
|
attr_reader profile: Symbol
|
|
16
21
|
attr_reader gvl: Symbol
|
|
17
22
|
|
|
18
23
|
def self.new: (
|
|
19
24
|
?timeout: (Float | Integer)?,
|
|
25
|
+
?setup_timeout: (Float | Integer)?,
|
|
20
26
|
?memory_limit: Integer?,
|
|
21
27
|
?stdout_limit: Integer?,
|
|
22
28
|
?stderr_limit: Integer?,
|
|
29
|
+
?open_file_limit: Integer?,
|
|
23
30
|
?profile: Symbol,
|
|
24
31
|
?gvl: Symbol
|
|
25
32
|
) -> SandboxOptions
|
|
26
33
|
|
|
27
34
|
def initialize: (
|
|
28
35
|
?timeout: (Float | Integer)?,
|
|
36
|
+
?setup_timeout: (Float | Integer)?,
|
|
29
37
|
?memory_limit: Integer?,
|
|
30
38
|
?stdout_limit: Integer?,
|
|
31
39
|
?stderr_limit: Integer?,
|
|
40
|
+
?open_file_limit: Integer?,
|
|
32
41
|
?profile: Symbol,
|
|
33
42
|
?gvl: Symbol
|
|
34
43
|
) -> void
|
|
35
44
|
|
|
45
|
+
def to_h: () -> {
|
|
46
|
+
timeout: Float?,
|
|
47
|
+
setup_timeout: Float?,
|
|
48
|
+
memory_limit: Integer?,
|
|
49
|
+
stdout_limit: Integer?,
|
|
50
|
+
stderr_limit: Integer?,
|
|
51
|
+
open_file_limit: Integer?,
|
|
52
|
+
profile: Symbol,
|
|
53
|
+
gvl: Symbol
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
def value_budget: () -> Integer?
|
|
57
|
+
|
|
36
58
|
def enforce_floor!: (Symbol declared) -> void
|
|
37
59
|
|
|
38
60
|
private
|
|
39
61
|
|
|
40
|
-
def normalize_timeout: ((Float | Integer)? timeout) -> Float?
|
|
62
|
+
def normalize_timeout: ((Float | Integer)? timeout, String name) -> Float?
|
|
41
63
|
|
|
42
|
-
def
|
|
64
|
+
def normalize_limit: (Integer? limit, String name) -> Integer?
|
|
43
65
|
|
|
44
66
|
def normalize_choice: (untyped value, Array[Symbol] choices, String name) -> Symbol
|
|
45
67
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
# One invocation's result — the whole Snapshot the driver produced.
|
|
3
|
+
class Snapshot
|
|
4
|
+
def outcome: () -> [String, Kobako::Outcome::panic_fields?]
|
|
5
|
+
|
|
6
|
+
def trap_error: () -> Kobako::TrapError?
|
|
7
|
+
|
|
8
|
+
def wall_time: () -> Float
|
|
9
|
+
|
|
10
|
+
def memory_peak: () -> Integer
|
|
11
|
+
|
|
12
|
+
def stdout: () -> String
|
|
13
|
+
|
|
14
|
+
def stdout_truncated?: () -> bool
|
|
15
|
+
|
|
16
|
+
def stderr: () -> String
|
|
17
|
+
|
|
18
|
+
def stderr_truncated?: () -> bool
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -9,9 +9,9 @@ module Kobako
|
|
|
9
9
|
|
|
10
10
|
BREAK_THROW: Symbol
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
BARE_FAULTS: Hash[singleton(StandardError), String]
|
|
13
13
|
|
|
14
|
-
def self.dispatch: (Kobako::Transport::Call call, Kobako::Transport::_ServiceResolver resolver, Kobako::Transport::_HandleTable handles, Kobako::Transport::_GuestYielder guest_yielder) -> [
|
|
14
|
+
def self.dispatch: (Kobako::Transport::Call call, Kobako::Transport::_ServiceResolver resolver, Kobako::Transport::_HandleTable handles, Kobako::Transport::BlockFailure failure, Kobako::Transport::_GuestYielder guest_yielder) -> [Symbol, String, String?]
|
|
15
15
|
|
|
16
16
|
private
|
|
17
17
|
|
|
@@ -21,7 +21,7 @@ module Kobako
|
|
|
21
21
|
|
|
22
22
|
def self.resolve_call_args: (Kobako::Payload::Arguments arguments, Kobako::Codec::_HandleTable handles, bool carried_handle) -> [Array[untyped], Hash[Symbol, untyped]]
|
|
23
23
|
|
|
24
|
-
def self.caught_fault: (StandardError error, Kobako::Transport::
|
|
24
|
+
def self.caught_fault: (StandardError error, Kobako::Transport::BlockFailure failure) -> [String, String]
|
|
25
25
|
|
|
26
26
|
def self.invoke: (Kobako::Transport::Exposure exposure, String method, Array[untyped] args, Hash[Symbol, untyped] kwargs, Kobako::Transport::Yielder? yielder) -> untyped
|
|
27
27
|
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
module Kobako
|
|
2
2
|
module Transport
|
|
3
3
|
module Reflection
|
|
4
|
-
META_OWNERS: Array[Module]
|
|
5
4
|
GADGET_OWNERS: Array[Module]
|
|
6
5
|
CALLABLE_ALLOW: Array[Symbol]
|
|
7
6
|
|
|
8
7
|
def self.refusal: (Kobako::Transport::Exposure exposure, Symbol name) -> String?
|
|
9
8
|
|
|
9
|
+
def self.authored?: (UnboundMethod method) -> bool
|
|
10
|
+
|
|
10
11
|
private
|
|
11
12
|
|
|
13
|
+
def self.ambient_copy?: (UnboundMethod method) -> bool
|
|
14
|
+
|
|
12
15
|
def self.ambient_refusal: (untyped target, Symbol name) -> String?
|
|
13
16
|
|
|
17
|
+
def self.defined_refusal: (untyped target, Symbol name, Module klass) -> String?
|
|
18
|
+
|
|
19
|
+
def self.authored_for?: (untyped target, Symbol name, UnboundMethod method, Module klass) -> bool
|
|
20
|
+
|
|
21
|
+
def self.refused: (Symbol name) -> String
|
|
22
|
+
|
|
23
|
+
def self.owner_refusal: (untyped target, Symbol name, Module owner) -> String?
|
|
24
|
+
|
|
25
|
+
def self.lookup_class: (untyped target) -> Module
|
|
26
|
+
|
|
14
27
|
def self.ambient_owner?: (Module owner, untyped target) -> bool
|
|
15
28
|
end
|
|
16
29
|
end
|
|
@@ -4,25 +4,21 @@ module Kobako
|
|
|
4
4
|
@guest_yielder: Kobako::Transport::_GuestYielder
|
|
5
5
|
@break_tag: Symbol
|
|
6
6
|
@handles: Kobako::Codec::_HandleTable
|
|
7
|
+
@failure: Kobako::Transport::BlockFailure
|
|
7
8
|
@active: bool
|
|
8
|
-
@raised: Kobako::BlockError?
|
|
9
9
|
|
|
10
|
-
def initialize: (Kobako::Transport::_GuestYielder guest_yielder, Symbol break_tag, Kobako::Codec::_HandleTable handles) -> void
|
|
11
|
-
|
|
12
|
-
def fault_text: (Exception error) -> String?
|
|
10
|
+
def initialize: (Kobako::Transport::_GuestYielder guest_yielder, Symbol break_tag, Kobako::Codec::_HandleTable handles, Kobako::Transport::BlockFailure failure) -> void
|
|
13
11
|
|
|
14
12
|
def yield: (*untyped args) -> untyped
|
|
15
13
|
|
|
16
14
|
def to_proc: () -> Proc
|
|
17
15
|
|
|
18
|
-
def invalidate
|
|
16
|
+
def invalidate: () -> void
|
|
19
17
|
|
|
20
18
|
private
|
|
21
19
|
|
|
22
20
|
def encode_args: (Array[untyped] args) -> String
|
|
23
21
|
|
|
24
|
-
def remember: (Kobako::BlockError error) -> Kobako::BlockError
|
|
25
|
-
|
|
26
22
|
def decode_body: (String body) -> [untyped, bool]
|
|
27
23
|
|
|
28
24
|
def restore: (untyped value, bool carried_handle) -> untyped
|
data/sig/kobako/transport.rbs
CHANGED
|
@@ -3,7 +3,7 @@ module Kobako
|
|
|
3
3
|
# The guest re-entry callable a dispatch hands to a Yielder: invoked
|
|
4
4
|
# with the encoded yield args, it returns the decoded Yield Reply as an
|
|
5
5
|
# +[arm, body, klass]+ triple.
|
|
6
|
-
# The ext's Kobako::
|
|
6
|
+
# The ext's Kobako::GuestYielder is the production conformer;
|
|
7
7
|
# modelled structurally so the Transport layer needs no upward
|
|
8
8
|
# dependency on Runtime.
|
|
9
9
|
interface _GuestYielder
|
|
@@ -14,7 +14,7 @@ module Kobako
|
|
|
14
14
|
# side already decoded off the core envelope and answering the arm and
|
|
15
15
|
# body it puts on the Reply. Named here so the producer (Context) and the
|
|
16
16
|
# consumer (Runtime) cannot declare it differently.
|
|
17
|
-
type dispatch_proc = ^(String | Integer, String, bool, String, _GuestYielder) -> [
|
|
17
|
+
type dispatch_proc = ^(String | Integer, String, bool, String, _GuestYielder) -> [Symbol, String, String?]
|
|
18
18
|
|
|
19
19
|
# What a dispatch resolves constant-path targets against. The
|
|
20
20
|
# invocation's Kobako::Context is the production conformer, so its
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kobako
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.29.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aotokitsuruya
|
|
@@ -13,16 +13,22 @@ dependencies:
|
|
|
13
13
|
name: msgpack
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 1.8.2
|
|
19
|
+
- - "<"
|
|
17
20
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
21
|
+
version: '2'
|
|
19
22
|
type: :runtime
|
|
20
23
|
prerelease: false
|
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
25
|
requirements:
|
|
23
|
-
- - "
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: 1.8.2
|
|
29
|
+
- - "<"
|
|
24
30
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
31
|
+
version: '2'
|
|
26
32
|
- !ruby/object:Gem::Dependency
|
|
27
33
|
name: rb_sys
|
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -60,7 +66,18 @@ files:
|
|
|
60
66
|
- crates/kobako-runtime/README.md
|
|
61
67
|
- crates/kobako-runtime/src/dispatch.rs
|
|
62
68
|
- crates/kobako-runtime/src/error.rs
|
|
69
|
+
- crates/kobako-runtime/src/filesystem.rs
|
|
70
|
+
- crates/kobako-runtime/src/filesystem/directory.rs
|
|
71
|
+
- crates/kobako-runtime/src/filesystem/directory/spelling.rs
|
|
72
|
+
- crates/kobako-runtime/src/filesystem/memory.rs
|
|
73
|
+
- crates/kobako-runtime/src/filesystem/overlay.rs
|
|
74
|
+
- crates/kobako-runtime/src/filesystem/overlay/exclusive.rs
|
|
75
|
+
- crates/kobako-runtime/src/filesystem/overlay/stack.rs
|
|
76
|
+
- crates/kobako-runtime/src/filesystem/path.rs
|
|
77
|
+
- crates/kobako-runtime/src/filesystem/temporary.rs
|
|
78
|
+
- crates/kobako-runtime/src/grant.rs
|
|
63
79
|
- crates/kobako-runtime/src/lib.rs
|
|
80
|
+
- crates/kobako-runtime/src/mount.rs
|
|
64
81
|
- crates/kobako-runtime/src/profile.rs
|
|
65
82
|
- crates/kobako-runtime/src/runtime.rs
|
|
66
83
|
- crates/kobako-runtime/src/snapshot.rs
|
|
@@ -91,19 +108,37 @@ files:
|
|
|
91
108
|
- crates/kobako-wasmtime/src/cache.rs
|
|
92
109
|
- crates/kobako-wasmtime/src/capture.rs
|
|
93
110
|
- crates/kobako-wasmtime/src/config.rs
|
|
111
|
+
- crates/kobako-wasmtime/src/descriptors.rs
|
|
94
112
|
- crates/kobako-wasmtime/src/dispatch.rs
|
|
95
113
|
- crates/kobako-wasmtime/src/driver.rs
|
|
96
114
|
- crates/kobako-wasmtime/src/exports.rs
|
|
97
115
|
- crates/kobako-wasmtime/src/guest_mem.rs
|
|
116
|
+
- crates/kobako-wasmtime/src/imports.rs
|
|
98
117
|
- crates/kobako-wasmtime/src/instance_pre.rs
|
|
99
118
|
- crates/kobako-wasmtime/src/invocation.rs
|
|
100
119
|
- crates/kobako-wasmtime/src/io.rs
|
|
101
120
|
- crates/kobako-wasmtime/src/lib.rs
|
|
102
121
|
- crates/kobako-wasmtime/src/limiter.rs
|
|
122
|
+
- crates/kobako-wasmtime/src/preview1.rs
|
|
123
|
+
- crates/kobako-wasmtime/src/preview1/args.rs
|
|
124
|
+
- crates/kobako-wasmtime/src/preview1/beneath.rs
|
|
125
|
+
- crates/kobako-wasmtime/src/preview1/differential.rs
|
|
126
|
+
- crates/kobako-wasmtime/src/preview1/differential/mount.rs
|
|
127
|
+
- crates/kobako-wasmtime/src/preview1/errno.rs
|
|
128
|
+
- crates/kobako-wasmtime/src/preview1/fd.rs
|
|
129
|
+
- crates/kobako-wasmtime/src/preview1/memory.rs
|
|
130
|
+
- crates/kobako-wasmtime/src/preview1/mount_view.rs
|
|
131
|
+
- crates/kobako-wasmtime/src/preview1/path.rs
|
|
132
|
+
- crates/kobako-wasmtime/src/preview1/poll.rs
|
|
133
|
+
- crates/kobako-wasmtime/src/preview1/sock.rs
|
|
103
134
|
- crates/kobako-wasmtime/src/trap.rs
|
|
135
|
+
- crates/kobako-wasmtime/src/wasi.rs
|
|
136
|
+
- crates/kobako-wasmtime/tests/compile_posture.rs
|
|
137
|
+
- crates/kobako-wasmtime/tests/guest_file.rs
|
|
104
138
|
- crates/kobako-wasmtime/tests/preamble_flags.rs
|
|
105
139
|
- crates/kobako-wasmtime/tests/snippet_compile.rs
|
|
106
140
|
- crates/kobako-wasmtime/tests/support/mod.rs
|
|
141
|
+
- crates/kobako-wasmtime/tests/unanswered_call.rs
|
|
107
142
|
- crates/kobako-wasmtime/tests/unsupported_call.rs
|
|
108
143
|
- data/kobako.wasm
|
|
109
144
|
- ext/kobako/Cargo.toml
|
|
@@ -112,13 +147,21 @@ files:
|
|
|
112
147
|
- ext/kobako/src/runtime.rs
|
|
113
148
|
- ext/kobako/src/runtime/bridge.rs
|
|
114
149
|
- ext/kobako/src/runtime/errors.rs
|
|
150
|
+
- ext/kobako/src/runtime/escape.rs
|
|
151
|
+
- ext/kobako/src/runtime/filesystem.rs
|
|
152
|
+
- ext/kobako/src/runtime/filesystem/grants.rs
|
|
153
|
+
- ext/kobako/src/runtime/filesystem/ruby.rs
|
|
115
154
|
- ext/kobako/src/runtime/gvl.rs
|
|
155
|
+
- ext/kobako/src/runtime/pinned_value.rs
|
|
156
|
+
- ext/kobako/src/runtime/snapshot.rs
|
|
116
157
|
- lib/kobako.rb
|
|
117
158
|
- lib/kobako/capture.rb
|
|
118
159
|
- lib/kobako/catalog.rb
|
|
119
160
|
- lib/kobako/catalog/extensions.rb
|
|
120
161
|
- lib/kobako/catalog/flags.rb
|
|
162
|
+
- lib/kobako/catalog/grants.rb
|
|
121
163
|
- lib/kobako/catalog/handles.rb
|
|
164
|
+
- lib/kobako/catalog/mount.rb
|
|
122
165
|
- lib/kobako/catalog/services.rb
|
|
123
166
|
- lib/kobako/catalog/snippets.rb
|
|
124
167
|
- lib/kobako/codec.rb
|
|
@@ -130,11 +173,13 @@ files:
|
|
|
130
173
|
- lib/kobako/codec/nesting.rb
|
|
131
174
|
- lib/kobako/codec/state.rb
|
|
132
175
|
- lib/kobako/codec/utils.rb
|
|
176
|
+
- lib/kobako/codec/value_budget.rb
|
|
133
177
|
- lib/kobako/constant_name.rb
|
|
134
178
|
- lib/kobako/context.rb
|
|
135
179
|
- lib/kobako/errors.rb
|
|
136
180
|
- lib/kobako/execution.rb
|
|
137
181
|
- lib/kobako/extension.rb
|
|
182
|
+
- lib/kobako/filesystem.rb
|
|
138
183
|
- lib/kobako/handle.rb
|
|
139
184
|
- lib/kobako/outcome.rb
|
|
140
185
|
- lib/kobako/payload.rb
|
|
@@ -144,9 +189,10 @@ files:
|
|
|
144
189
|
- lib/kobako/sandbox.rb
|
|
145
190
|
- lib/kobako/sandbox_options.rb
|
|
146
191
|
- lib/kobako/snippet.rb
|
|
147
|
-
- lib/kobako/snippet/
|
|
192
|
+
- lib/kobako/snippet/bytecode.rb
|
|
148
193
|
- lib/kobako/snippet/source.rb
|
|
149
194
|
- lib/kobako/transport.rb
|
|
195
|
+
- lib/kobako/transport/block_failure.rb
|
|
150
196
|
- lib/kobako/transport/call.rb
|
|
151
197
|
- lib/kobako/transport/dispatcher.rb
|
|
152
198
|
- lib/kobako/transport/error.rb
|
|
@@ -163,7 +209,9 @@ files:
|
|
|
163
209
|
- sig/kobako/catalog.rbs
|
|
164
210
|
- sig/kobako/catalog/extensions.rbs
|
|
165
211
|
- sig/kobako/catalog/flags.rbs
|
|
212
|
+
- sig/kobako/catalog/grants.rbs
|
|
166
213
|
- sig/kobako/catalog/handles.rbs
|
|
214
|
+
- sig/kobako/catalog/mount.rbs
|
|
167
215
|
- sig/kobako/catalog/services.rbs
|
|
168
216
|
- sig/kobako/catalog/snippets.rbs
|
|
169
217
|
- sig/kobako/codec.rbs
|
|
@@ -175,11 +223,14 @@ files:
|
|
|
175
223
|
- sig/kobako/codec/nesting.rbs
|
|
176
224
|
- sig/kobako/codec/state.rbs
|
|
177
225
|
- sig/kobako/codec/utils.rbs
|
|
226
|
+
- sig/kobako/codec/value_budget.rbs
|
|
178
227
|
- sig/kobako/constant_name.rbs
|
|
179
228
|
- sig/kobako/context.rbs
|
|
180
229
|
- sig/kobako/errors.rbs
|
|
181
230
|
- sig/kobako/execution.rbs
|
|
182
231
|
- sig/kobako/extension.rbs
|
|
232
|
+
- sig/kobako/filesystem.rbs
|
|
233
|
+
- sig/kobako/guest_yielder.rbs
|
|
183
234
|
- sig/kobako/handle.rbs
|
|
184
235
|
- sig/kobako/outcome.rbs
|
|
185
236
|
- sig/kobako/payload.rbs
|
|
@@ -188,10 +239,12 @@ files:
|
|
|
188
239
|
- sig/kobako/runtime.rbs
|
|
189
240
|
- sig/kobako/sandbox.rbs
|
|
190
241
|
- sig/kobako/sandbox_options.rbs
|
|
242
|
+
- sig/kobako/snapshot.rbs
|
|
191
243
|
- sig/kobako/snippet.rbs
|
|
192
|
-
- sig/kobako/snippet/
|
|
244
|
+
- sig/kobako/snippet/bytecode.rbs
|
|
193
245
|
- sig/kobako/snippet/source.rbs
|
|
194
246
|
- sig/kobako/transport.rbs
|
|
247
|
+
- sig/kobako/transport/block_failure.rbs
|
|
195
248
|
- sig/kobako/transport/call.rbs
|
|
196
249
|
- sig/kobako/transport/dispatcher.rbs
|
|
197
250
|
- sig/kobako/transport/error.rbs
|