kobako 0.30.0 → 0.32.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/.githooks/linux-tests.sh +29 -0
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +460 -0
- data/Cargo.lock +868 -447
- data/README.md +43 -4
- data/ROADMAP.md +1 -2
- data/crates/kobako-runtime/CHANGELOG.md +309 -0
- data/crates/kobako-runtime/Cargo.toml +58 -11
- data/crates/kobako-runtime/README.md +7 -4
- data/crates/kobako-runtime/src/cred.rs +136 -0
- data/crates/kobako-runtime/src/dispatch.rs +4 -5
- data/crates/kobako-runtime/src/endpoint/buffer.rs +153 -44
- data/crates/kobako-runtime/src/endpoint/dispatch.rs +80 -41
- data/crates/kobako-runtime/src/endpoint/invoke.rs +23 -36
- data/crates/kobako-runtime/src/endpoint.rs +137 -36
- data/crates/kobako-runtime/src/errno.rs +391 -0
- data/crates/kobako-runtime/src/error.rs +31 -10
- data/crates/kobako-runtime/src/filesystem/anon_inodes.rs +52 -0
- data/crates/kobako-runtime/src/filesystem/bind/fid.rs +300 -22
- data/crates/kobako-runtime/src/filesystem/bind/lookup.rs +101 -29
- data/crates/kobako-runtime/src/filesystem/bind/unicode.rs +109 -0
- data/crates/kobako-runtime/src/filesystem/bind/walk.rs +52 -34
- data/crates/kobako-runtime/src/filesystem/bind.rs +812 -447
- data/crates/kobako-runtime/src/filesystem/overlay/file.rs +6 -6
- data/crates/kobako-runtime/src/filesystem/overlay/path.rs +43 -65
- data/crates/kobako-runtime/src/filesystem/overlay/stack/copy_up.rs +11 -16
- data/crates/kobako-runtime/src/filesystem/overlay/stack/dir.rs +47 -72
- data/crates/kobako-runtime/src/filesystem/overlay/stack/namei.rs +12 -12
- data/crates/kobako-runtime/src/filesystem/overlay/stack/readdir.rs +4 -7
- data/crates/kobako-runtime/src/filesystem/overlay/stack.rs +120 -37
- data/crates/kobako-runtime/src/filesystem/overlay.rs +578 -388
- data/crates/kobako-runtime/src/filesystem/pipe.rs +12 -9
- data/crates/kobako-runtime/src/filesystem/rdir.rs +14 -50
- data/crates/kobako-runtime/src/filesystem/testing.rs +31 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/seed.rs +32 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/tmpfile.rs +3 -3
- data/crates/kobako-runtime/src/filesystem/tmpfs/whiteout.rs +57 -35
- data/crates/kobako-runtime/src/filesystem/tmpfs/xattr.rs +2 -2
- data/crates/kobako-runtime/src/filesystem/tmpfs.rs +219 -173
- data/crates/kobako-runtime/src/filesystem/wrap.rs +36 -52
- data/crates/kobako-runtime/src/filesystem.rs +8 -3
- data/crates/kobako-runtime/src/fork.rs +319 -0
- data/crates/kobako-runtime/src/grant.rs +3 -0
- data/crates/kobako-runtime/src/hashtable.rs +4 -2
- data/crates/kobako-runtime/src/lib.rs +18 -7
- data/crates/kobako-runtime/src/limits.rs +171 -0
- data/crates/kobako-runtime/src/locking/seqlock.rs +29 -3
- data/crates/kobako-runtime/src/locking.rs +518 -113
- data/crates/kobako-runtime/src/memcg.rs +306 -0
- data/crates/kobako-runtime/src/mount.rs +37 -9
- data/crates/kobako-runtime/src/net/backends.rs +43 -0
- data/crates/kobako-runtime/src/net/connections.rs +219 -0
- data/crates/kobako-runtime/src/net/credential.rs +125 -0
- data/crates/kobako-runtime/src/net/egress.rs +180 -0
- data/crates/kobako-runtime/src/net/family.rs +181 -0
- data/crates/kobako-runtime/src/net/http.rs +3165 -0
- data/crates/kobako-runtime/src/net/lookup.rs +385 -0
- data/crates/kobako-runtime/src/net/mock.rs +251 -0
- data/crates/kobako-runtime/src/net/namespace.rs +1368 -0
- data/crates/kobako-runtime/src/net/reactor.rs +626 -0
- data/crates/kobako-runtime/src/net/resolv/darwin.rs +280 -0
- data/crates/kobako-runtime/src/net/resolv/stub/tests.rs +519 -0
- data/crates/kobako-runtime/src/net/resolv/stub.rs +542 -0
- data/crates/kobako-runtime/src/net/resolv/windows.rs +218 -0
- data/crates/kobako-runtime/src/net/resolv.rs +251 -0
- data/crates/kobako-runtime/src/net/skbuff.rs +109 -0
- data/crates/kobako-runtime/src/net/socket.rs +869 -0
- data/crates/kobako-runtime/src/net/task.rs +223 -0
- data/crates/kobako-runtime/src/net/tcp.rs +1840 -0
- data/crates/kobako-runtime/src/net/tls.rs +120 -0
- data/crates/kobako-runtime/src/net/transport.rs +304 -0
- data/crates/kobako-runtime/src/net/udp.rs +1105 -0
- data/crates/kobako-runtime/src/net.rs +45 -0
- data/crates/kobako-runtime/src/network/builder.rs +177 -0
- data/crates/kobako-runtime/src/network/ruleset.rs +777 -0
- data/crates/kobako-runtime/src/network.rs +551 -0
- data/crates/kobako-runtime/src/policy.rs +16 -0
- data/crates/kobako-runtime/src/profile.rs +29 -144
- data/crates/kobako-runtime/src/runtime.rs +3 -5
- data/crates/kobako-runtime/src/sched.rs +338 -51
- data/crates/kobako-runtime/src/security/entry_policy.rs +22 -0
- data/crates/kobako-runtime/src/{vfs/cred.rs → security/hooks.rs} +52 -144
- data/crates/kobako-runtime/src/security/mount_policy.rs +158 -0
- data/crates/kobako-runtime/src/security.rs +125 -209
- data/crates/kobako-runtime/src/snapshot.rs +121 -2
- data/crates/kobako-runtime/src/vfs/attr.rs +5 -5
- data/crates/kobako-runtime/src/vfs/dentry.rs +210 -117
- data/crates/kobako-runtime/src/vfs/file.rs +243 -248
- data/crates/kobako-runtime/src/vfs/inode.rs +41 -45
- data/crates/kobako-runtime/src/vfs/kern_path.rs +62 -53
- data/crates/kobako-runtime/src/vfs/mount.rs +10 -9
- data/crates/kobako-runtime/src/vfs/namei.rs +1162 -818
- data/crates/kobako-runtime/src/vfs/namespace.rs +245 -0
- data/crates/kobako-runtime/src/vfs/open_files.rs +69 -0
- data/crates/kobako-runtime/src/vfs/openat2.rs +3 -3
- data/crates/kobako-runtime/src/vfs/path.rs +6 -6
- data/crates/kobako-runtime/src/vfs/readdir.rs +6 -6
- data/crates/kobako-runtime/src/vfs/stat.rs +248 -23
- data/crates/kobako-runtime/src/vfs/super_block.rs +18 -14
- data/crates/kobako-runtime/src/vfs/utimes.rs +37 -27
- data/crates/kobako-runtime/src/vfs.rs +10 -6
- data/crates/kobako-runtime/src/wait.rs +381 -0
- data/crates/kobako-transport/CHANGELOG.md +38 -0
- data/crates/kobako-transport/Cargo.toml +1 -1
- data/crates/kobako-transport/README.md +3 -4
- data/crates/kobako-transport/src/abi.rs +78 -72
- data/crates/kobako-transport/src/envelope/bytes.rs +17 -6
- data/crates/kobako-transport/src/envelope/call.rs +32 -4
- data/crates/kobako-transport/src/envelope/error_record.rs +21 -0
- data/crates/kobako-transport/src/envelope/name.rs +99 -0
- data/crates/kobako-transport/src/envelope/outcome.rs +9 -9
- data/crates/kobako-transport/src/envelope/preamble.rs +24 -21
- data/crates/kobako-transport/src/envelope/reply.rs +27 -27
- data/crates/kobako-transport/src/envelope/unsupported.rs +10 -10
- data/crates/kobako-transport/src/envelope.rs +13 -8
- data/crates/kobako-wasmtime/CHANGELOG.md +208 -0
- data/crates/kobako-wasmtime/Cargo.toml +47 -7
- data/crates/kobako-wasmtime/README.md +4 -3
- data/crates/kobako-wasmtime/build/preview2.rs +1339 -0
- data/crates/kobako-wasmtime/build.rs +16 -0
- data/crates/kobako-wasmtime/src/abi.rs +18 -37
- data/crates/kobako-wasmtime/src/ambient.rs +43 -19
- data/crates/kobako-wasmtime/src/cache/unix.rs +95 -0
- data/crates/kobako-wasmtime/src/cache/windows.rs +359 -0
- data/crates/kobako-wasmtime/src/cache.rs +106 -113
- data/crates/kobako-wasmtime/src/config.rs +52 -68
- data/crates/kobako-wasmtime/src/driver.rs +80 -82
- data/crates/kobako-wasmtime/src/exports.rs +143 -17
- data/crates/kobako-wasmtime/src/guest.rs +12 -6
- data/crates/kobako-wasmtime/src/guest_binary.rs +14 -0
- data/crates/kobako-wasmtime/src/imports.rs +42 -18
- data/crates/kobako-wasmtime/src/instance_pre.rs +4 -4
- data/crates/kobako-wasmtime/src/invocation.rs +91 -15
- data/crates/kobako-wasmtime/src/lib.rs +7 -3
- data/crates/kobako-wasmtime/src/limiter.rs +130 -12
- data/crates/kobako-wasmtime/src/preview1/descriptors.rs +305 -0
- data/crates/kobako-wasmtime/src/preview1/differential/mount.rs +9 -20
- data/crates/kobako-wasmtime/src/preview1/differential.rs +27 -31
- data/crates/kobako-wasmtime/src/preview1/errno.rs +55 -66
- data/crates/kobako-wasmtime/src/preview1/fd.rs +347 -312
- data/crates/kobako-wasmtime/src/preview1/memory.rs +21 -12
- data/crates/kobako-wasmtime/src/preview1/mount_view/wrap.rs +34 -53
- data/crates/kobako-wasmtime/src/preview1/mount_view.rs +335 -388
- data/crates/kobako-wasmtime/src/preview1/path.rs +56 -121
- data/crates/kobako-wasmtime/src/preview1/poll.rs +255 -125
- data/crates/kobako-wasmtime/src/preview1/random.rs +125 -0
- data/crates/kobako-wasmtime/src/preview1/sock.rs +10 -8
- data/crates/kobako-wasmtime/src/preview1/testing.rs +31 -0
- data/crates/kobako-wasmtime/src/preview1/testsuite.rs +5 -15
- data/crates/kobako-wasmtime/src/preview1.rs +131 -51
- data/crates/kobako-wasmtime/src/preview2/abi.rs +227 -0
- data/crates/kobako-wasmtime/src/preview2/error.rs +118 -0
- data/crates/kobako-wasmtime/src/preview2/filesystem.rs +122 -0
- data/crates/kobako-wasmtime/src/preview2/host.rs +4319 -0
- data/crates/kobako-wasmtime/src/preview2/http.rs +1587 -0
- data/crates/kobako-wasmtime/src/preview2/io.rs +328 -0
- data/crates/kobako-wasmtime/src/preview2/sockets.rs +379 -0
- data/crates/kobako-wasmtime/src/preview2/table.rs +257 -0
- data/crates/kobako-wasmtime/src/preview2.rs +57 -0
- data/crates/kobako-wasmtime/src/trap.rs +88 -28
- data/crates/kobako-wasmtime/src/waits.rs +59 -0
- data/crates/kobako-wasmtime/src/wasi.rs +291 -81
- data/crates/kobako-wasmtime/wit/deps/cli.wit +233 -0
- data/crates/kobako-wasmtime/wit/deps/clocks.wit +162 -0
- data/crates/kobako-wasmtime/wit/deps/filesystem.wit +589 -0
- data/crates/kobako-wasmtime/wit/deps/http.wit +733 -0
- data/crates/kobako-wasmtime/wit/deps/io.wit +299 -0
- data/crates/kobako-wasmtime/wit/deps/random.wit +92 -0
- data/crates/kobako-wasmtime/wit/deps/sockets.wit +949 -0
- data/crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx +13 -0
- data/data/kobako.wasm +0 -0
- data/ext/kobako/Cargo.toml +6 -2
- data/ext/kobako/src/{runtime/errors.rs → errors.rs} +34 -26
- data/ext/kobako/src/escape.rs +404 -0
- data/ext/kobako/src/{runtime/filesystem → filesystem}/grants.rs +34 -32
- data/ext/kobako/src/{runtime/filesystem → filesystem}/ruby.rs +158 -170
- data/ext/kobako/src/{runtime/filesystem.rs → filesystem.rs} +71 -23
- data/ext/kobako/src/fork.rs +72 -0
- data/ext/kobako/src/gvl.rs +729 -0
- data/ext/kobako/src/handoff.rs +490 -0
- data/ext/kobako/src/lib.rs +74 -3
- data/ext/kobako/src/network/mock.rs +187 -0
- data/ext/kobako/src/network.rs +593 -0
- data/ext/kobako/src/pinned_value.rs +44 -0
- data/ext/kobako/src/runtime/bridge.rs +58 -50
- data/ext/kobako/src/runtime/snapshot.rs +4 -4
- data/ext/kobako/src/runtime.rs +272 -163
- data/ext/kobako/src/wire.rs +42 -0
- data/lib/kobako/catalog/extensions.rb +14 -2
- data/lib/kobako/catalog/flags.rb +3 -5
- data/lib/kobako/catalog/grants.rb +5 -4
- data/lib/kobako/catalog/handles.rb +14 -32
- data/lib/kobako/catalog/mount.rb +11 -3
- data/lib/kobako/catalog/network.rb +35 -0
- data/lib/kobako/catalog/replacements.rb +28 -0
- data/lib/kobako/catalog/services.rb +5 -19
- data/lib/kobako/catalog/snippets.rb +3 -18
- data/lib/kobako/catalog.rb +3 -0
- data/lib/kobako/codec/{utils.rb → boundary.rb} +4 -2
- data/lib/kobako/codec/decoder.rb +5 -5
- data/lib/kobako/codec/ext_types.rb +3 -3
- data/lib/kobako/codec/handle_walk.rb +3 -43
- data/lib/kobako/codec/state.rb +2 -18
- data/lib/kobako/codec/value_budget.rb +133 -41
- data/lib/kobako/codec.rb +6 -7
- data/lib/kobako/context.rb +24 -11
- data/lib/kobako/errors.rb +18 -18
- data/lib/kobako/extension.rb +3 -2
- data/lib/kobako/filesystem.rb +10 -3
- data/lib/kobako/fork.rb +42 -0
- data/lib/kobako/handle.rb +2 -3
- data/lib/kobako/names.rb +28 -0
- data/lib/kobako/network.rb +210 -0
- data/lib/kobako/outcome.rb +7 -7
- data/lib/kobako/runtime.rb +3 -2
- data/lib/kobako/sandbox.rb +73 -35
- data/lib/kobako/sandbox_options.rb +42 -109
- data/lib/kobako/transport/argument_wrap.rb +64 -0
- data/lib/kobako/transport/block_failure.rb +1 -1
- data/lib/kobako/transport/dispatcher.rb +6 -6
- data/lib/kobako/transport/exposure.rb +26 -15
- data/lib/kobako/transport/reflection.rb +21 -4
- data/lib/kobako/transport/run.rb +8 -23
- data/lib/kobako/transport/yielder.rb +2 -9
- data/lib/kobako/transport.rb +1 -0
- data/lib/kobako/usage.rb +4 -2
- data/lib/kobako/version.rb +1 -1
- data/lib/kobako.rb +8 -4
- data/release-please-config.json +15 -0
- data/sig/kobako/catalog/extensions.rbs +2 -0
- data/sig/kobako/catalog/grants.rbs +7 -4
- data/sig/kobako/catalog/handles.rbs +2 -2
- data/sig/kobako/catalog/mount.rbs +3 -1
- data/sig/kobako/catalog/network.rbs +20 -0
- data/sig/kobako/catalog/replacements.rbs +14 -0
- data/sig/kobako/catalog/services.rbs +0 -4
- data/sig/kobako/catalog/snippets.rbs +0 -2
- data/sig/kobako/codec/{utils.rbs → boundary.rbs} +2 -2
- data/sig/kobako/codec/handle_walk.rbs +0 -6
- data/sig/kobako/codec/state.rbs +0 -4
- data/sig/kobako/codec/value_budget.rbs +48 -5
- data/sig/kobako/codec.rbs +2 -2
- data/sig/kobako/context.rbs +3 -1
- data/sig/kobako/errors.rbs +4 -7
- data/sig/kobako/filesystem.rbs +21 -3
- data/sig/kobako/fork.rbs +17 -0
- data/sig/kobako/network.rbs +115 -0
- data/sig/kobako/outcome.rbs +1 -1
- data/sig/kobako/runtime.rbs +32 -3
- data/sig/kobako/sandbox.rbs +10 -2
- data/sig/kobako/sandbox_options.rbs +29 -40
- data/sig/kobako/transport/argument_wrap.rbs +15 -0
- data/sig/kobako/transport/error.rbs +1 -1
- data/sig/kobako/transport/exposure.rbs +2 -4
- data/sig/kobako/transport/reflection.rbs +10 -0
- data/sig/kobako/transport/run.rbs +0 -2
- data/sig/kobako/transport/yielder.rbs +0 -3
- data/sig/kobako/transport.rbs +1 -1
- data/sig/kobako.rbs +13 -0
- metadata +97 -37
- data/crates/kobako-runtime/src/endpoint/capture.rs +0 -115
- data/crates/kobako-runtime/src/endpoint/memory_cap.rs +0 -238
- data/crates/kobako-runtime/src/filesystem/path.rs +0 -21
- data/crates/kobako-runtime/src/vfs/errno.rs +0 -153
- data/crates/kobako-runtime/tests/linux_baseline/calls.rs +0 -171
- data/crates/kobako-runtime/tests/linux_baseline/concurrent.rs +0 -276
- data/crates/kobako-runtime/tests/linux_baseline/kobako.rs +0 -323
- data/crates/kobako-runtime/tests/linux_baseline/linux-baseline-expected.txt +0 -16
- data/crates/kobako-runtime/tests/linux_baseline/linux.rs +0 -449
- data/crates/kobako-runtime/tests/linux_baseline/main.rs +0 -611
- data/crates/kobako-runtime/tests/linux_baseline/permissions.rs +0 -236
- data/crates/kobako-wasmtime/src/descriptors.rs +0 -200
- data/crates/kobako-wasmtime/tests/integration/compile_posture.rs +0 -43
- data/crates/kobako-wasmtime/tests/integration/guest_file.rs +0 -1085
- data/crates/kobako-wasmtime/tests/integration/main.rs +0 -29
- data/crates/kobako-wasmtime/tests/integration/preamble_flags.rs +0 -70
- data/crates/kobako-wasmtime/tests/integration/snippet_compile.rs +0 -95
- data/crates/kobako-wasmtime/tests/integration/support/mod.rs +0 -30
- data/crates/kobako-wasmtime/tests/integration/unanswered_call.rs +0 -86
- data/crates/kobako-wasmtime/tests/integration/unsupported_call.rs +0 -51
- data/ext/kobako/src/runtime/escape.rs +0 -67
- data/ext/kobako/src/runtime/gvl.rs +0 -147
- data/ext/kobako/src/runtime/pinned_value.rs +0 -31
- data/lib/kobako/constant_name.rb +0 -8
- data/lib/kobako/pool.rb +0 -140
- data/sig/kobako/constant_name.rbs +0 -3
- data/sig/kobako/pool.rbs +0 -42
|
@@ -9,15 +9,58 @@ module Kobako
|
|
|
9
9
|
|
|
10
10
|
UINT: Hash[Integer, String]
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
FLOAT_FORMATS: Hash[Integer, String]
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
FLOATS: Regexp
|
|
15
|
+
|
|
16
|
+
NAN_ENTRY: Integer
|
|
17
|
+
|
|
18
|
+
def self.assert_within: (String bytes, Integer budget) -> void
|
|
19
|
+
|
|
20
|
+
class Count
|
|
21
|
+
class OpenContainer < Struct[untyped]
|
|
22
|
+
attr_accessor held: Integer
|
|
23
|
+
attr_accessor keyed: bool
|
|
24
|
+
attr_accessor read: Integer
|
|
25
|
+
attr_accessor nan_keys: Integer
|
|
26
|
+
attr_accessor holds_nan: bool
|
|
27
|
+
|
|
28
|
+
def self.new: (Integer held, bool keyed, Integer read, Integer nan_keys, bool holds_nan) -> OpenContainer
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
@bytes: String
|
|
32
|
+
@budget: Integer
|
|
33
|
+
@remaining: Integer
|
|
34
|
+
@open: Array[OpenContainer]
|
|
35
|
+
|
|
36
|
+
@ended: bool
|
|
37
|
+
|
|
38
|
+
def initialize: (String bytes, Integer budget) -> void
|
|
39
|
+
|
|
40
|
+
def run: () -> void
|
|
15
41
|
|
|
16
|
-
|
|
42
|
+
private
|
|
17
43
|
|
|
18
|
-
|
|
44
|
+
def count_value: (Integer pos, Integer children, bool keyed) -> void
|
|
45
|
+
|
|
46
|
+
def close_value: (bool holds_nan) -> void
|
|
47
|
+
|
|
48
|
+
def charge_key: (OpenContainer map) -> void
|
|
49
|
+
|
|
50
|
+
def spend: (Integer values) -> void
|
|
51
|
+
|
|
52
|
+
def nan?: (Integer pos) -> bool
|
|
53
|
+
|
|
54
|
+
def step: (Integer pos) -> [Integer?, Integer, bool]
|
|
55
|
+
|
|
56
|
+
def step_framed: (Integer pos, Integer marker) -> [Integer?, Integer, bool]
|
|
57
|
+
|
|
58
|
+
def uint: (Integer pos, Integer width) -> Integer
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
private
|
|
19
62
|
|
|
20
|
-
def self.
|
|
63
|
+
def self.within_by_size?: (String bytes, Integer budget) -> bool
|
|
21
64
|
end
|
|
22
65
|
end
|
|
23
66
|
end
|
data/sig/kobako/codec.rbs
CHANGED
|
@@ -2,6 +2,8 @@ module Kobako
|
|
|
2
2
|
module Codec
|
|
3
3
|
MAX_NESTING_DEPTH: Integer
|
|
4
4
|
|
|
5
|
+
MAX_PAYLOAD_VALUES: Integer
|
|
6
|
+
|
|
5
7
|
# A value in the closed wire type set: the scalar leaves, a Capability Handle, and Array / Hash
|
|
6
8
|
# containers of the same. The by-value payloads that cross the wire —
|
|
7
9
|
# dispatch arguments and success values — inhabit this type; a Fault is
|
|
@@ -13,8 +15,6 @@ module Kobako
|
|
|
13
15
|
|
|
14
16
|
def self.track_handles: [T] { () -> T } -> [T, bool]
|
|
15
17
|
|
|
16
|
-
def self.within_value_budget: [T] (Integer? budget) { () -> T } -> T
|
|
17
|
-
|
|
18
18
|
# The Handle allocator/resolver a wire walk works against: alloc
|
|
19
19
|
# registers a non-wire-representable object and returns its Handle,
|
|
20
20
|
# fetch resolves a wire Handle id back to the live object. The
|
data/sig/kobako/context.rbs
CHANGED
|
@@ -2,7 +2,7 @@ module Kobako
|
|
|
2
2
|
class Context
|
|
3
3
|
type preamble = [Array[String], Array[Kobako::Catalog::Snippets::tuple], Array[Kobako::Catalog::Flags::tuple]]
|
|
4
4
|
|
|
5
|
-
@
|
|
5
|
+
@replacements: Kobako::Catalog::Replacements
|
|
6
6
|
|
|
7
7
|
def initialize: (
|
|
8
8
|
runtime: Kobako::Runtime,
|
|
@@ -16,6 +16,8 @@ module Kobako
|
|
|
16
16
|
|
|
17
17
|
def mount: (String at, Kobako::Filesystem::mountable filesystem, ?access: Kobako::Filesystem::access) ?{ (String path, Kobako::Filesystem::access access) -> boolish } -> self
|
|
18
18
|
|
|
19
|
+
def network: (Symbol | String name, ?untyped entry) ?{ (Kobako::Network::Builder) -> void } -> self
|
|
20
|
+
|
|
19
21
|
def lookup: (Symbol | String path) -> Kobako::Transport::Exposure
|
|
20
22
|
|
|
21
23
|
def eval: (String code) ?{ (Kobako::Context) -> void } -> Kobako::Execution
|
data/sig/kobako/errors.rbs
CHANGED
|
@@ -21,18 +21,18 @@ module Kobako
|
|
|
21
21
|
class SetupError < Error
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
class
|
|
24
|
+
class GuestBinaryNotFoundError < SetupError
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
module Diagnosable : Error
|
|
28
28
|
attr_reader origin: String?
|
|
29
|
-
attr_reader
|
|
29
|
+
attr_reader class_name: String?
|
|
30
30
|
attr_reader backtrace_lines: Array[String]?
|
|
31
31
|
|
|
32
32
|
def initialize: (
|
|
33
33
|
String message,
|
|
34
34
|
?origin: String?,
|
|
35
|
-
?
|
|
35
|
+
?class_name: String?,
|
|
36
36
|
?backtrace_lines: Array[String]?
|
|
37
37
|
) -> void
|
|
38
38
|
end
|
|
@@ -81,11 +81,8 @@ module Kobako
|
|
|
81
81
|
?name: Symbol?,
|
|
82
82
|
?available: Array[Symbol],
|
|
83
83
|
?origin: String?,
|
|
84
|
-
?
|
|
84
|
+
?class_name: String?,
|
|
85
85
|
?backtrace_lines: Array[String]?
|
|
86
86
|
) -> void
|
|
87
87
|
end
|
|
88
|
-
|
|
89
|
-
class PoolTimeoutError < Error
|
|
90
|
-
end
|
|
91
88
|
end
|
data/sig/kobako/filesystem.rbs
CHANGED
|
@@ -4,14 +4,21 @@ module Kobako
|
|
|
4
4
|
|
|
5
5
|
type access = :read | :read_write
|
|
6
6
|
|
|
7
|
+
def self.validate_mount: (untyped at, untyped access, untyped filesystem) -> nil
|
|
8
|
+
|
|
7
9
|
# What a Filesystem written in Ruby answers to be mounted. One that
|
|
8
10
|
# also answers _Listable lists its directories, and one answering
|
|
9
11
|
# _Writable takes changes too; each method it lacks is refused alone.
|
|
12
|
+
# One answering _Exclusive vouches only the guest changes it.
|
|
10
13
|
interface _Readable
|
|
11
14
|
def open: (String path, Integer flags) -> _File
|
|
12
15
|
def stat: (String path) -> _Stat
|
|
13
16
|
end
|
|
14
17
|
|
|
18
|
+
interface _Exclusive
|
|
19
|
+
def exclusive?: () -> boolish
|
|
20
|
+
end
|
|
21
|
+
|
|
15
22
|
interface _Listable
|
|
16
23
|
def children: (String path) -> Array[String]
|
|
17
24
|
end
|
|
@@ -58,8 +65,9 @@ module Kobako
|
|
|
58
65
|
|
|
59
66
|
# What a Filesystem written in Ruby's +stat+ answers, as +File::Stat+
|
|
60
67
|
# does; an +ino+ of zero names no identity. One that also answers
|
|
61
|
-
# _StatDevice names the device its +ino+ belongs to,
|
|
62
|
-
#
|
|
68
|
+
# _StatDevice names the device its +ino+ belongs to, _StatKind says a
|
|
69
|
+
# special file is one, _StatTimes gives its times, and _StatLinks its
|
|
70
|
+
# count of names.
|
|
63
71
|
interface _Stat
|
|
64
72
|
def directory?: () -> boolish
|
|
65
73
|
def size: () -> Integer
|
|
@@ -74,6 +82,16 @@ module Kobako
|
|
|
74
82
|
def ftype: () -> String
|
|
75
83
|
end
|
|
76
84
|
|
|
85
|
+
interface _StatTimes
|
|
86
|
+
def atime: () -> Time
|
|
87
|
+
def mtime: () -> Time
|
|
88
|
+
def ctime: () -> Time
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
interface _StatLinks
|
|
92
|
+
def nlink: () -> Integer
|
|
93
|
+
end
|
|
94
|
+
|
|
77
95
|
class Tmpfs
|
|
78
96
|
# A bare <tt>"path" => contents</tt> arrives as keywords, which RBS
|
|
79
97
|
# cannot key by String; a Symbol keyword past +size+ and +nr_inodes+
|
|
@@ -82,7 +100,7 @@ module Kobako
|
|
|
82
100
|
end
|
|
83
101
|
|
|
84
102
|
class Bind
|
|
85
|
-
def initialize: (String path) -> void
|
|
103
|
+
def initialize: (String path, ?exclusive: bool) -> void
|
|
86
104
|
end
|
|
87
105
|
|
|
88
106
|
class Overlay
|
data/sig/kobako/fork.rbs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
module Fork
|
|
3
|
+
module Hook
|
|
4
|
+
def _fork: () -> Integer
|
|
5
|
+
|
|
6
|
+
def daemon: (?boolish nochdir, ?boolish noclose) -> 0
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def self.around: [T] () { () -> T } -> T
|
|
10
|
+
|
|
11
|
+
def self.install: () -> void
|
|
12
|
+
|
|
13
|
+
def self.prepare: () -> void
|
|
14
|
+
|
|
15
|
+
def self.release: () -> void
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
module Network
|
|
3
|
+
type protocol = :http | :tcp | :udp
|
|
4
|
+
|
|
5
|
+
UNWRITTEN: Object
|
|
6
|
+
|
|
7
|
+
def self.normalize_endpoint: (untyped host, untyped port, Hash[Symbol, untyped] written) ->
|
|
8
|
+
[String, Integer, protocol, Array[Symbol | String | IPAddr], Array[HttpRule]]
|
|
9
|
+
|
|
10
|
+
def self.normalize_rule: (bool allow, untyped method, untyped path) -> [bool, String?, String]
|
|
11
|
+
|
|
12
|
+
def self.normalize_credential: (Symbol | String placement, untyped placeholder) -> String
|
|
13
|
+
|
|
14
|
+
def self.validate_name: (String name) -> nil
|
|
15
|
+
|
|
16
|
+
class Mock
|
|
17
|
+
def initialize: (?local_addresses: Array[String]?) -> void
|
|
18
|
+
|
|
19
|
+
def resolve: (String name, to: String | Array[String]) -> nil
|
|
20
|
+
|
|
21
|
+
def route: (String address, Integer port, to: [String, Integer], ?protocol: :tcp | :udp) -> nil
|
|
22
|
+
|
|
23
|
+
def refuse: (String address, Integer port, singleton(SystemCallError) errno, ?protocol: :tcp | :udp) -> nil
|
|
24
|
+
|
|
25
|
+
def hold: [T] (String name) { () -> T } -> T
|
|
26
|
+
|
|
27
|
+
def lookups: () -> Array[String]
|
|
28
|
+
|
|
29
|
+
def dialed_addresses: () -> Array[[String, Integer]]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class Endpoint < Data
|
|
33
|
+
attr_reader host: String
|
|
34
|
+
attr_reader port: Integer
|
|
35
|
+
attr_reader protocol: protocol
|
|
36
|
+
attr_reader addresses: Array[Symbol | String | IPAddr]
|
|
37
|
+
attr_reader rules: Array[HttpRule]
|
|
38
|
+
|
|
39
|
+
def self.new: (host: untyped, port: untyped, ?protocol: untyped, ?addresses: untyped, ?rules: untyped) -> Endpoint
|
|
40
|
+
|
|
41
|
+
def initialize: (host: untyped, port: untyped, ?protocol: untyped, ?addresses: untyped, ?rules: untyped) -> void
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
class Connection < Data
|
|
45
|
+
attr_reader host: String
|
|
46
|
+
attr_reader port: Integer
|
|
47
|
+
attr_reader protocol: protocol
|
|
48
|
+
|
|
49
|
+
def self.new: (host: String, port: Integer, protocol: protocol) -> Connection
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class HttpRule
|
|
53
|
+
@allow: bool
|
|
54
|
+
|
|
55
|
+
def allow?: () -> bool
|
|
56
|
+
attr_reader method: String?
|
|
57
|
+
attr_reader path: String
|
|
58
|
+
|
|
59
|
+
def initialize: (allow: boolish, method: untyped, path: untyped) -> void
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
class Rules
|
|
63
|
+
@rules: Array[HttpRule]
|
|
64
|
+
|
|
65
|
+
def initialize: () -> void
|
|
66
|
+
|
|
67
|
+
def allow: (untyped method, untyped path) -> self
|
|
68
|
+
|
|
69
|
+
def deny: (untyped method, untyped path) -> self
|
|
70
|
+
|
|
71
|
+
def to_a: () -> Array[HttpRule]
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class Credential
|
|
75
|
+
@source: ^(Request) -> String?
|
|
76
|
+
|
|
77
|
+
attr_reader placement: Symbol | String
|
|
78
|
+
attr_reader placeholder: String
|
|
79
|
+
|
|
80
|
+
def initialize: (Symbol | String placement, placeholder: untyped) ?{ (Request) -> String? } -> void
|
|
81
|
+
|
|
82
|
+
def value: (Request request) -> String?
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class Request
|
|
86
|
+
attr_reader host: String
|
|
87
|
+
attr_reader port: Integer
|
|
88
|
+
attr_reader method: String
|
|
89
|
+
attr_reader scheme: String
|
|
90
|
+
attr_reader path: String
|
|
91
|
+
attr_reader header_names: Array[String]
|
|
92
|
+
|
|
93
|
+
def initialize: ([String, Integer] authority, String method, String scheme, String path, Array[String] header_names) -> void
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
class Builder
|
|
97
|
+
HOOKS: Array[Symbol]
|
|
98
|
+
|
|
99
|
+
@entry: untyped
|
|
100
|
+
@endpoints: Array[Endpoint]
|
|
101
|
+
@policies: Hash[Symbol, Array[^(untyped) -> boolish]]
|
|
102
|
+
@credentials: Array[Credential]
|
|
103
|
+
|
|
104
|
+
def initialize: (?untyped entry) -> void
|
|
105
|
+
|
|
106
|
+
def credential: (Symbol | String placement, placeholder: untyped) ?{ (Request) -> String? } -> self
|
|
107
|
+
|
|
108
|
+
def endpoint: (untyped host, port: untyped, ?protocol: untyped, ?addresses: untyped) ?{ (Rules) -> void } -> self
|
|
109
|
+
|
|
110
|
+
def policy: (Symbol hook) ?{ (untyped) -> boolish } -> self
|
|
111
|
+
|
|
112
|
+
def to_native: () -> [untyped, Array[Endpoint], Array[Credential], Hash[Symbol, Array[^(untyped) -> boolish]]]
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
data/sig/kobako/outcome.rbs
CHANGED
|
@@ -12,7 +12,7 @@ module Kobako
|
|
|
12
12
|
|
|
13
13
|
def self.panic_error: (panic_fields panic, Symbol? entrypoint) -> (SandboxError | ServiceError)
|
|
14
14
|
|
|
15
|
-
def self.error_class: (String origin, String
|
|
15
|
+
def self.error_class: (String origin, String class_name) -> (singleton(SandboxError) | singleton(ServiceError))
|
|
16
16
|
|
|
17
17
|
def self.decode_value: (String payload) -> Kobako::Codec::wire_value
|
|
18
18
|
|
data/sig/kobako/runtime.rbs
CHANGED
|
@@ -2,7 +2,30 @@ module Kobako
|
|
|
2
2
|
class Runtime
|
|
3
3
|
def self.default_path: () -> String
|
|
4
4
|
|
|
5
|
-
def self.
|
|
5
|
+
def self.default_options: () -> {
|
|
6
|
+
timeout: Float?,
|
|
7
|
+
setup_timeout: Float?,
|
|
8
|
+
memory_limit: Integer?,
|
|
9
|
+
stdout_limit: Integer?,
|
|
10
|
+
stderr_limit: Integer?,
|
|
11
|
+
open_file_limit: Integer?,
|
|
12
|
+
open_connection_limit: Integer?,
|
|
13
|
+
connection_limit: Integer?,
|
|
14
|
+
profile: Symbol,
|
|
15
|
+
gvl: Symbol,
|
|
16
|
+
network: nil
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def self.normalize_caps: (Hash[Symbol, untyped] caps) -> {
|
|
20
|
+
timeout: Float?,
|
|
21
|
+
setup_timeout: Float?,
|
|
22
|
+
memory_limit: Integer?,
|
|
23
|
+
stdout_limit: Integer?,
|
|
24
|
+
stderr_limit: Integer?,
|
|
25
|
+
open_file_limit: Integer?,
|
|
26
|
+
open_connection_limit: Integer?,
|
|
27
|
+
connection_limit: Integer?
|
|
28
|
+
}
|
|
6
29
|
|
|
7
30
|
def self.from_path: (
|
|
8
31
|
String path,
|
|
@@ -12,15 +35,19 @@ module Kobako
|
|
|
12
35
|
stdout_limit: Integer?,
|
|
13
36
|
stderr_limit: Integer?,
|
|
14
37
|
open_file_limit: Integer?,
|
|
38
|
+
open_connection_limit: Integer?,
|
|
39
|
+
connection_limit: Integer?,
|
|
15
40
|
profile: Symbol,
|
|
16
|
-
gvl: Symbol
|
|
41
|
+
gvl: Symbol,
|
|
42
|
+
network: Network::Mock?
|
|
17
43
|
) -> Runtime
|
|
18
44
|
|
|
19
45
|
type setup = [
|
|
20
46
|
Array[String],
|
|
21
47
|
Array[Kobako::Catalog::Snippets::tuple],
|
|
22
48
|
Array[Kobako::Catalog::Flags::tuple],
|
|
23
|
-
Array[Kobako::Catalog::Mount::tuple]
|
|
49
|
+
Array[Kobako::Catalog::Mount::tuple],
|
|
50
|
+
Array[Kobako::Catalog::Network::tuple]
|
|
24
51
|
]
|
|
25
52
|
|
|
26
53
|
def eval: (Kobako::Transport::dispatch_proc dispatch, setup setup, String source) -> Kobako::Snapshot
|
|
@@ -35,5 +62,7 @@ module Kobako
|
|
|
35
62
|
def profile: () -> Symbol
|
|
36
63
|
|
|
37
64
|
def compile: (Kobako::Context::preamble preamble) -> Array[String]?
|
|
65
|
+
|
|
66
|
+
def stat: () -> Hash[Symbol, Integer]
|
|
38
67
|
end
|
|
39
68
|
end
|
data/sig/kobako/sandbox.rbs
CHANGED
|
@@ -12,11 +12,14 @@ module Kobako
|
|
|
12
12
|
def stdout_limit: () -> Integer?
|
|
13
13
|
def stderr_limit: () -> Integer?
|
|
14
14
|
def open_file_limit: () -> Integer?
|
|
15
|
+
def open_connection_limit: () -> Integer?
|
|
16
|
+
def connection_limit: () -> Integer?
|
|
15
17
|
def profile: () -> Symbol
|
|
16
18
|
def gvl: () -> Symbol
|
|
17
19
|
|
|
18
|
-
# Every keyword beyond wasm_path
|
|
19
|
-
# SandboxOptions.new
|
|
20
|
+
# Every keyword beyond wasm_path lands on the runtime's defaults for
|
|
21
|
+
# SandboxOptions.new; the runtime judges the profile, the mode, and the
|
|
22
|
+
# floor.
|
|
20
23
|
def initialize: (
|
|
21
24
|
?wasm_path: String?,
|
|
22
25
|
**untyped options
|
|
@@ -28,6 +31,8 @@ module Kobako
|
|
|
28
31
|
|
|
29
32
|
def mount: (String at, Kobako::Filesystem::mountable filesystem, ?access: Kobako::Filesystem::access) ?{ (String path, Kobako::Filesystem::access access) -> boolish } -> Kobako::Sandbox
|
|
30
33
|
|
|
34
|
+
def network: (Symbol | String name, ?untyped entry) ?{ (Kobako::Network::Builder) -> void } -> Kobako::Sandbox
|
|
35
|
+
|
|
31
36
|
def preload: (code: String, name: Symbol | String) -> Kobako::Sandbox
|
|
32
37
|
| (binary: String) -> Kobako::Sandbox
|
|
33
38
|
|
|
@@ -37,6 +42,9 @@ module Kobako
|
|
|
37
42
|
|
|
38
43
|
def eval: (String code) ?{ (Kobako::Context) -> void } -> Kobako::Execution
|
|
39
44
|
|
|
45
|
+
def stat: () -> Hash[Symbol, Integer]
|
|
46
|
+
| (Symbol key) -> Integer
|
|
47
|
+
|
|
40
48
|
private
|
|
41
49
|
|
|
42
50
|
def build_runtime: () -> Kobako::Runtime
|
|
@@ -1,45 +1,43 @@
|
|
|
1
1
|
module Kobako
|
|
2
2
|
class SandboxOptions < Data
|
|
3
|
-
DEFAULT_TIMEOUT_SECONDS: Float
|
|
4
|
-
DEFAULT_SETUP_TIMEOUT_SECONDS: Float
|
|
5
|
-
DEFAULT_MEMORY_LIMIT: Integer
|
|
6
|
-
DEFAULT_OUTPUT_LIMIT: Integer
|
|
7
|
-
DEFAULT_OPEN_FILE_LIMIT: Integer
|
|
8
|
-
DEFAULT_PROFILE: Symbol
|
|
9
|
-
PROFILES: Array[Symbol]
|
|
10
|
-
GVL_MODES: Array[Symbol]
|
|
11
|
-
DEFAULT_GVL: Symbol
|
|
12
|
-
VALUE_BYTES: Integer
|
|
13
|
-
|
|
14
3
|
attr_reader timeout: Float?
|
|
15
4
|
attr_reader setup_timeout: Float?
|
|
16
5
|
attr_reader memory_limit: Integer?
|
|
17
6
|
attr_reader stdout_limit: Integer?
|
|
18
7
|
attr_reader stderr_limit: Integer?
|
|
19
8
|
attr_reader open_file_limit: Integer?
|
|
9
|
+
attr_reader open_connection_limit: Integer?
|
|
10
|
+
attr_reader connection_limit: Integer?
|
|
20
11
|
attr_reader profile: Symbol
|
|
21
12
|
attr_reader gvl: Symbol
|
|
13
|
+
attr_reader network: Network::Mock?
|
|
22
14
|
|
|
23
15
|
def self.new: (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
timeout: (Float | Integer)?,
|
|
17
|
+
setup_timeout: (Float | Integer)?,
|
|
18
|
+
memory_limit: Integer?,
|
|
19
|
+
stdout_limit: Integer?,
|
|
20
|
+
stderr_limit: Integer?,
|
|
21
|
+
open_file_limit: Integer?,
|
|
22
|
+
open_connection_limit: Integer?,
|
|
23
|
+
connection_limit: Integer?,
|
|
24
|
+
profile: Symbol,
|
|
25
|
+
gvl: Symbol,
|
|
26
|
+
network: Network::Mock?
|
|
32
27
|
) -> SandboxOptions
|
|
33
28
|
|
|
34
29
|
def initialize: (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
timeout: (Float | Integer)?,
|
|
31
|
+
setup_timeout: (Float | Integer)?,
|
|
32
|
+
memory_limit: Integer?,
|
|
33
|
+
stdout_limit: Integer?,
|
|
34
|
+
stderr_limit: Integer?,
|
|
35
|
+
open_file_limit: Integer?,
|
|
36
|
+
open_connection_limit: Integer?,
|
|
37
|
+
connection_limit: Integer?,
|
|
38
|
+
profile: Symbol,
|
|
39
|
+
gvl: Symbol,
|
|
40
|
+
network: Network::Mock?
|
|
43
41
|
) -> void
|
|
44
42
|
|
|
45
43
|
def to_h: () -> {
|
|
@@ -49,20 +47,11 @@ module Kobako
|
|
|
49
47
|
stdout_limit: Integer?,
|
|
50
48
|
stderr_limit: Integer?,
|
|
51
49
|
open_file_limit: Integer?,
|
|
50
|
+
open_connection_limit: Integer?,
|
|
51
|
+
connection_limit: Integer?,
|
|
52
52
|
profile: Symbol,
|
|
53
|
-
gvl: Symbol
|
|
53
|
+
gvl: Symbol,
|
|
54
|
+
network: Network::Mock?
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
def value_budget: () -> Integer?
|
|
57
|
-
|
|
58
|
-
def enforce_floor: (Symbol declared) -> void
|
|
59
|
-
|
|
60
|
-
private
|
|
61
|
-
|
|
62
|
-
def normalize_timeout: ((Float | Integer)? timeout, String name) -> Float?
|
|
63
|
-
|
|
64
|
-
def normalize_limit: (Integer? limit, String name) -> Integer?
|
|
65
|
-
|
|
66
|
-
def normalize_choice: (untyped value, Array[Symbol] choices, String name) -> Symbol
|
|
67
56
|
end
|
|
68
57
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
module Transport
|
|
3
|
+
module ArgumentWrap
|
|
4
|
+
def self.wrap: (untyped value, Kobako::Codec::_HandleTable handles, ?Integer depth) -> untyped
|
|
5
|
+
|
|
6
|
+
private
|
|
7
|
+
|
|
8
|
+
def self.refuse_past_nesting: (Integer depth) -> void
|
|
9
|
+
|
|
10
|
+
def self.wrap_leaf: (untyped value, Kobako::Codec::_HandleTable handles) -> untyped
|
|
11
|
+
|
|
12
|
+
def self.wrap_hash: (Hash[untyped, untyped] hash, Kobako::Codec::_HandleTable handles, Integer depth) -> Hash[untyped, untyped]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -2,10 +2,6 @@ module Kobako
|
|
|
2
2
|
module Transport
|
|
3
3
|
class Exposure < Data
|
|
4
4
|
PREDICATE: Symbol
|
|
5
|
-
CLASS_OF: UnboundMethod
|
|
6
|
-
SINGLETON_CLASS_OF: UnboundMethod
|
|
7
|
-
SINGLETON_METHODS: UnboundMethod
|
|
8
|
-
PRIVATE_METHODS: UnboundMethod
|
|
9
5
|
CALLABLE: Set[Symbol]
|
|
10
6
|
NOTHING: Set[Symbol]
|
|
11
7
|
|
|
@@ -17,6 +13,8 @@ module Kobako
|
|
|
17
13
|
|
|
18
14
|
def self.of: (untyped object, ?Hash[Module, Set[Symbol]] surfaces) -> Exposure
|
|
19
15
|
|
|
16
|
+
def self.refused_class_of: (untyped object) -> Module?
|
|
17
|
+
|
|
20
18
|
def initialize: (object: untyped, names: Set[Symbol]?) -> void
|
|
21
19
|
|
|
22
20
|
def with: (?object: untyped, ?names: Set[Symbol]?) -> Exposure
|
|
@@ -3,6 +3,14 @@ module Kobako
|
|
|
3
3
|
module Reflection
|
|
4
4
|
GADGET_OWNERS: Array[Module]
|
|
5
5
|
CALLABLE_ALLOW: Array[Symbol]
|
|
6
|
+
CLASS_OF: UnboundMethod
|
|
7
|
+
IS_A: UnboundMethod
|
|
8
|
+
SINGLETON_CLASS_OF: UnboundMethod
|
|
9
|
+
SINGLETON_METHODS: UnboundMethod
|
|
10
|
+
PRIVATE_METHODS: UnboundMethod
|
|
11
|
+
RESPOND_TO: UnboundMethod
|
|
12
|
+
PUBLIC_SEND: UnboundMethod
|
|
13
|
+
SEND: UnboundMethod
|
|
6
14
|
|
|
7
15
|
def self.refusal: (Kobako::Transport::Exposure exposure, Symbol name) -> String?
|
|
8
16
|
|
|
@@ -24,6 +32,8 @@ module Kobako
|
|
|
24
32
|
|
|
25
33
|
def self.lookup_class: (untyped target) -> Module
|
|
26
34
|
|
|
35
|
+
def self.module?: (untyped target) -> bool
|
|
36
|
+
|
|
27
37
|
def self.ambient_owner?: (Module owner, untyped target) -> bool
|
|
28
38
|
end
|
|
29
39
|
end
|
|
@@ -5,7 +5,6 @@ module Kobako
|
|
|
5
5
|
@break_tag: Symbol
|
|
6
6
|
@handles: Kobako::Codec::_HandleTable
|
|
7
7
|
@failure: Kobako::Transport::BlockFailure
|
|
8
|
-
@active: bool
|
|
9
8
|
|
|
10
9
|
def initialize: (Kobako::Transport::_GuestYielder guest_yielder, Symbol break_tag, Kobako::Codec::_HandleTable handles, Kobako::Transport::BlockFailure failure) -> void
|
|
11
10
|
|
|
@@ -13,8 +12,6 @@ module Kobako
|
|
|
13
12
|
|
|
14
13
|
def to_proc: () -> Proc
|
|
15
14
|
|
|
16
|
-
def invalidate: () -> void
|
|
17
|
-
|
|
18
15
|
private
|
|
19
16
|
|
|
20
17
|
def encode_args: (Array[untyped] args) -> String
|
data/sig/kobako/transport.rbs
CHANGED
|
@@ -2,7 +2,7 @@ module Kobako
|
|
|
2
2
|
module Transport
|
|
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
|
-
# +[arm, body,
|
|
5
|
+
# +[arm, body, class_name]+ triple.
|
|
6
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.
|
data/sig/kobako.rbs
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
module Kobako
|
|
2
|
+
def self.to_name: (untyped name, String what) -> String
|
|
3
|
+
|
|
4
|
+
def self.to_constant_name: (untyped name, String what) -> Symbol
|
|
5
|
+
|
|
6
|
+
def self.constant_name?: (String name) -> bool
|
|
7
|
+
|
|
8
|
+
def self.constant_path?: (String path) -> bool
|
|
9
|
+
|
|
10
|
+
def self.reserved_path?: (String path) -> bool
|
|
11
|
+
|
|
12
|
+
def self.paths_collide?: (String path, String bound) -> bool
|
|
13
|
+
|
|
14
|
+
def self.max_handle_id: () -> Integer
|
|
2
15
|
end
|