kobako 0.29.0 → 0.31.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 +552 -10
- data/Cargo.lock +595 -139
- data/README.md +126 -564
- data/ROADMAP.md +3 -2
- data/crates/kobako-runtime/CHANGELOG.md +488 -1
- data/crates/kobako-runtime/Cargo.toml +73 -15
- data/crates/kobako-runtime/README.md +11 -4
- data/crates/kobako-runtime/src/cred.rs +124 -0
- data/crates/kobako-runtime/src/dispatch.rs +5 -6
- data/crates/kobako-runtime/src/endpoint/buffer.rs +301 -0
- data/crates/kobako-runtime/src/endpoint/dispatch.rs +292 -0
- data/crates/kobako-runtime/src/endpoint/invoke.rs +181 -0
- data/crates/kobako-runtime/src/endpoint.rs +267 -0
- 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 +82 -0
- data/crates/kobako-runtime/src/filesystem/bind/lookup.rs +274 -0
- data/crates/kobako-runtime/src/filesystem/bind/walk.rs +248 -0
- data/crates/kobako-runtime/src/filesystem/bind.rs +2857 -0
- data/crates/kobako-runtime/src/filesystem/overlay/file.rs +89 -0
- data/crates/kobako-runtime/src/filesystem/overlay/inode.rs +106 -0
- data/crates/kobako-runtime/src/filesystem/overlay/path.rs +263 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/copy_up.rs +128 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/dir.rs +238 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/namei.rs +135 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/readdir.rs +54 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack.rs +316 -739
- data/crates/kobako-runtime/src/filesystem/overlay.rs +2627 -1154
- data/crates/kobako-runtime/src/filesystem/pipe.rs +224 -0
- data/crates/kobako-runtime/src/filesystem/rdir.rs +84 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/seed.rs +32 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/tmpfile.rs +32 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/whiteout.rs +107 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/xattr.rs +22 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs.rs +1997 -0
- data/crates/kobako-runtime/src/filesystem/wrap.rs +208 -0
- data/crates/kobako-runtime/src/filesystem.rs +25 -388
- data/crates/kobako-runtime/src/fork.rs +96 -0
- data/crates/kobako-runtime/src/grant.rs +3 -0
- data/crates/kobako-runtime/src/hashtable.rs +46 -0
- data/crates/kobako-runtime/src/lib.rs +27 -11
- data/crates/kobako-runtime/src/limits.rs +195 -0
- data/crates/kobako-runtime/src/locking/seqlock.rs +66 -0
- data/crates/kobako-runtime/src/locking.rs +228 -0
- data/crates/kobako-runtime/src/memcg.rs +383 -0
- data/crates/kobako-runtime/src/mount.rs +86 -101
- data/crates/kobako-runtime/src/net/backends.rs +43 -0
- data/crates/kobako-runtime/src/net/connections.rs +179 -0
- data/crates/kobako-runtime/src/net/credential.rs +125 -0
- data/crates/kobako-runtime/src/net/egress.rs +160 -0
- data/crates/kobako-runtime/src/net/family.rs +181 -0
- data/crates/kobako-runtime/src/net/http.rs +2733 -0
- data/crates/kobako-runtime/src/net/lookup.rs +285 -0
- data/crates/kobako-runtime/src/net/mock.rs +251 -0
- data/crates/kobako-runtime/src/net/namespace.rs +1366 -0
- data/crates/kobako-runtime/src/net/reactor.rs +531 -0
- data/crates/kobako-runtime/src/net/resolv/darwin.rs +275 -0
- data/crates/kobako-runtime/src/net/resolv/stub/tests.rs +469 -0
- data/crates/kobako-runtime/src/net/resolv/stub.rs +536 -0
- data/crates/kobako-runtime/src/net/resolv/windows.rs +248 -0
- data/crates/kobako-runtime/src/net/resolv.rs +227 -0
- data/crates/kobako-runtime/src/net/socket.rs +870 -0
- data/crates/kobako-runtime/src/net/tcp.rs +1588 -0
- data/crates/kobako-runtime/src/net/tls.rs +58 -0
- data/crates/kobako-runtime/src/net/transport.rs +279 -0
- data/crates/kobako-runtime/src/net/udp.rs +1003 -0
- data/crates/kobako-runtime/src/net.rs +42 -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 +37 -16
- data/crates/kobako-runtime/src/runtime.rs +3 -5
- data/crates/kobako-runtime/src/sched.rs +311 -0
- data/crates/kobako-runtime/src/security/entry_policy.rs +22 -0
- data/crates/kobako-runtime/src/security/hooks.rs +242 -0
- data/crates/kobako-runtime/src/security/mount_policy.rs +158 -0
- data/crates/kobako-runtime/src/security.rs +601 -0
- data/crates/kobako-runtime/src/snapshot.rs +121 -2
- data/crates/kobako-runtime/src/vfs/attr.rs +162 -0
- data/crates/kobako-runtime/src/vfs/dentry.rs +1466 -0
- data/crates/kobako-runtime/src/vfs/file.rs +1911 -0
- data/crates/kobako-runtime/src/vfs/inode.rs +425 -0
- data/crates/kobako-runtime/src/vfs/kern_path.rs +213 -0
- data/crates/kobako-runtime/src/vfs/mount.rs +60 -0
- data/crates/kobako-runtime/src/vfs/namei.rs +5837 -0
- data/crates/kobako-runtime/src/vfs/namespace.rs +162 -0
- data/crates/kobako-runtime/src/vfs/open_files.rs +69 -0
- data/crates/kobako-runtime/src/vfs/openat2.rs +116 -0
- data/crates/kobako-runtime/src/vfs/path.rs +64 -0
- data/crates/kobako-runtime/src/vfs/readdir.rs +163 -0
- data/crates/kobako-runtime/src/vfs/stat.rs +293 -0
- data/crates/kobako-runtime/src/vfs/super_block.rs +126 -0
- data/crates/kobako-runtime/src/vfs/utimes.rs +299 -0
- data/crates/kobako-runtime/src/vfs.rs +63 -0
- data/crates/kobako-runtime/src/wait.rs +356 -0
- data/crates/kobako-transport/CHANGELOG.md +39 -2
- data/crates/kobako-transport/Cargo.toml +3 -3
- data/crates/kobako-transport/README.md +8 -8
- data/crates/kobako-transport/src/abi.rs +78 -72
- data/crates/kobako-transport/src/envelope/bytes.rs +49 -30
- data/crates/kobako-transport/src/envelope/call.rs +37 -9
- data/crates/kobako-transport/src/envelope/compile_reply.rs +2 -2
- data/crates/kobako-transport/src/envelope/error_record.rs +24 -3
- data/crates/kobako-transport/src/envelope/fault.rs +2 -2
- data/crates/kobako-transport/src/envelope/name.rs +99 -0
- data/crates/kobako-transport/src/envelope/outcome.rs +11 -11
- data/crates/kobako-transport/src/envelope/preamble.rs +34 -31
- data/crates/kobako-transport/src/envelope/reply.rs +29 -29
- data/crates/kobako-transport/src/envelope/request.rs +2 -2
- data/crates/kobako-transport/src/envelope/run.rs +1 -1
- data/crates/kobako-transport/src/envelope/unsupported.rs +12 -12
- data/crates/kobako-transport/src/envelope.rs +15 -10
- data/crates/kobako-wasmtime/CHANGELOG.md +315 -8
- data/crates/kobako-wasmtime/Cargo.toml +35 -15
- data/crates/kobako-wasmtime/README.md +11 -6
- data/crates/kobako-wasmtime/build/preview2.rs +1339 -0
- data/crates/kobako-wasmtime/build.rs +16 -0
- data/crates/kobako-wasmtime/src/abi.rs +19 -47
- data/crates/kobako-wasmtime/src/ambient.rs +33 -19
- data/crates/kobako-wasmtime/src/cache.rs +28 -20
- data/crates/kobako-wasmtime/src/config.rs +59 -60
- data/crates/kobako-wasmtime/src/driver.rs +63 -145
- data/crates/kobako-wasmtime/src/exports.rs +147 -32
- data/crates/kobako-wasmtime/src/guest.rs +44 -0
- data/crates/kobako-wasmtime/src/guest_binary.rs +14 -0
- data/crates/kobako-wasmtime/src/imports.rs +48 -18
- data/crates/kobako-wasmtime/src/instance_pre.rs +7 -7
- data/crates/kobako-wasmtime/src/invocation.rs +93 -51
- data/crates/kobako-wasmtime/src/lib.rs +6 -7
- data/crates/kobako-wasmtime/src/limiter.rs +52 -211
- data/crates/kobako-wasmtime/src/preview1/descriptors.rs +309 -0
- data/crates/kobako-wasmtime/src/preview1/differential/mount.rs +70 -57
- data/crates/kobako-wasmtime/src/preview1/differential.rs +137 -27
- data/crates/kobako-wasmtime/src/preview1/errno.rs +90 -233
- data/crates/kobako-wasmtime/src/preview1/fd.rs +1301 -522
- data/crates/kobako-wasmtime/src/preview1/memory.rs +126 -150
- data/crates/kobako-wasmtime/src/preview1/mount_view/wrap.rs +192 -0
- data/crates/kobako-wasmtime/src/preview1/mount_view.rs +1989 -708
- data/crates/kobako-wasmtime/src/preview1/path.rs +181 -365
- data/crates/kobako-wasmtime/src/preview1/poll.rs +345 -173
- data/crates/kobako-wasmtime/src/preview1/sock.rs +10 -25
- data/crates/kobako-wasmtime/src/preview1/testsuite-expected.txt +6 -0
- data/crates/kobako-wasmtime/src/preview1/testsuite.rs +147 -0
- data/crates/kobako-wasmtime/src/preview1.rs +471 -416
- 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 +3959 -0
- data/crates/kobako-wasmtime/src/preview2/http.rs +1503 -0
- data/crates/kobako-wasmtime/src/preview2/io.rs +315 -0
- data/crates/kobako-wasmtime/src/preview2/sockets.rs +379 -0
- data/crates/kobako-wasmtime/src/preview2/table.rs +305 -0
- data/crates/kobako-wasmtime/src/preview2.rs +57 -0
- data/crates/kobako-wasmtime/src/trap.rs +31 -16
- data/crates/kobako-wasmtime/src/wasi.rs +238 -93
- 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/typenames.witx +750 -0
- data/crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx +441 -0
- data/data/kobako.wasm +0 -0
- data/ext/kobako/Cargo.toml +1 -1
- data/ext/kobako/src/{runtime/errors.rs → errors.rs} +35 -27
- data/ext/kobako/src/escape.rs +98 -0
- data/ext/kobako/src/{runtime/filesystem → filesystem}/grants.rs +36 -16
- data/ext/kobako/src/filesystem/ruby.rs +689 -0
- data/ext/kobako/src/filesystem.rs +217 -0
- data/ext/kobako/src/gvl.rs +306 -0
- data/ext/kobako/src/lib.rs +64 -3
- data/ext/kobako/src/network/mock.rs +187 -0
- data/ext/kobako/src/network.rs +591 -0
- data/ext/kobako/src/runtime/bridge.rs +31 -30
- data/ext/kobako/src/runtime/snapshot.rs +5 -5
- data/ext/kobako/src/runtime.rs +221 -138
- data/ext/kobako/src/wire.rs +42 -0
- data/lib/kobako/catalog/extensions.rb +19 -7
- data/lib/kobako/catalog/flags.rb +4 -6
- data/lib/kobako/catalog/grants.rb +5 -4
- data/lib/kobako/catalog/handles.rb +9 -31
- data/lib/kobako/catalog/mount.rb +12 -12
- data/lib/kobako/catalog/network.rb +35 -0
- data/lib/kobako/catalog/replacements.rb +28 -0
- data/lib/kobako/catalog/services.rb +7 -21
- data/lib/kobako/catalog/snippets.rb +10 -25
- data/lib/kobako/catalog.rb +4 -1
- data/lib/kobako/codec/{utils.rb → boundary.rb} +5 -3
- data/lib/kobako/codec/decoder.rb +12 -12
- data/lib/kobako/codec/ext_types.rb +5 -7
- data/lib/kobako/codec/handle_walk.rb +5 -47
- data/lib/kobako/codec/nesting.rb +7 -7
- data/lib/kobako/codec/value_budget.rb +134 -42
- data/lib/kobako/codec.rb +1 -1
- data/lib/kobako/context.rb +28 -15
- data/lib/kobako/errors.rb +15 -12
- data/lib/kobako/extension.rb +3 -2
- data/lib/kobako/filesystem.rb +53 -15
- data/lib/kobako/handle.rb +2 -2
- data/lib/kobako/names.rb +28 -0
- data/lib/kobako/network.rb +210 -0
- data/lib/kobako/outcome.rb +7 -7
- data/lib/kobako/payload/arguments.rb +2 -2
- data/lib/kobako/pool.rb +47 -25
- data/lib/kobako/runtime.rb +3 -2
- data/lib/kobako/sandbox.rb +113 -56
- data/lib/kobako/sandbox_options.rb +41 -107
- data/lib/kobako/snippet/bytecode.rb +1 -1
- data/lib/kobako/snippet/source.rb +1 -1
- data/lib/kobako/transport/argument_wrap.rb +64 -0
- data/lib/kobako/transport/block_failure.rb +1 -1
- data/lib/kobako/transport/dispatcher.rb +10 -10
- data/lib/kobako/transport/exposure.rb +28 -17
- data/lib/kobako/transport/reflection.rb +28 -11
- data/lib/kobako/transport/run.rb +13 -28
- data/lib/kobako/transport/yielder.rb +3 -10
- data/lib/kobako/transport.rb +1 -0
- data/lib/kobako/version.rb +1 -1
- data/lib/kobako.rb +38 -0
- data/release-please-config.json +16 -0
- data/sig/core/thread.rbs +6 -0
- data/sig/kobako/catalog/extensions.rbs +5 -3
- data/sig/kobako/catalog/grants.rbs +7 -4
- data/sig/kobako/catalog/handles.rbs +2 -4
- data/sig/kobako/catalog/mount.rbs +3 -5
- data/sig/kobako/catalog/network.rbs +20 -0
- data/sig/kobako/catalog/replacements.rbs +14 -0
- data/sig/kobako/catalog/services.rbs +1 -5
- data/sig/kobako/catalog/snippets.rbs +3 -5
- data/sig/kobako/catalog.rbs +1 -1
- data/sig/kobako/codec/boundary.rbs +9 -0
- data/sig/kobako/codec/decoder.rbs +1 -1
- data/sig/kobako/codec/handle_walk.rbs +0 -6
- data/sig/kobako/codec/nesting.rbs +2 -2
- data/sig/kobako/codec/value_budget.rbs +48 -5
- data/sig/kobako/codec.rbs +1 -2
- data/sig/kobako/context.rbs +4 -2
- data/sig/kobako/errors.rbs +4 -4
- data/sig/kobako/filesystem.rbs +38 -15
- data/sig/kobako/guest_yielder.rbs +1 -1
- data/sig/kobako/network.rbs +115 -0
- data/sig/kobako/outcome.rbs +1 -1
- data/sig/kobako/payload/arguments.rbs +1 -1
- data/sig/kobako/pool.rbs +8 -4
- data/sig/kobako/runtime.rbs +32 -3
- data/sig/kobako/sandbox.rbs +22 -7
- data/sig/kobako/sandbox_options.rbs +29 -38
- data/sig/kobako/transport/argument_wrap.rbs +15 -0
- data/sig/kobako/transport/dispatcher.rbs +2 -2
- data/sig/kobako/transport/error.rbs +1 -1
- data/sig/kobako/transport/exposure.rbs +3 -5
- data/sig/kobako/transport/reflection.rbs +12 -2
- data/sig/kobako/transport/run.rbs +3 -5
- data/sig/kobako/transport/yielder.rbs +0 -3
- data/sig/kobako/transport.rbs +2 -2
- data/sig/kobako.rbs +13 -0
- metadata +131 -34
- data/crates/kobako-runtime/src/filesystem/directory/spelling.rs +0 -194
- data/crates/kobako-runtime/src/filesystem/directory.rs +0 -1082
- data/crates/kobako-runtime/src/filesystem/memory.rs +0 -1100
- data/crates/kobako-runtime/src/filesystem/overlay/exclusive.rs +0 -88
- data/crates/kobako-runtime/src/filesystem/path.rs +0 -60
- data/crates/kobako-runtime/src/filesystem/temporary.rs +0 -167
- data/crates/kobako-wasmtime/src/capture.rs +0 -96
- data/crates/kobako-wasmtime/src/descriptors.rs +0 -167
- data/crates/kobako-wasmtime/src/dispatch.rs +0 -125
- data/crates/kobako-wasmtime/src/guest_mem.rs +0 -271
- data/crates/kobako-wasmtime/src/io.rs +0 -89
- data/crates/kobako-wasmtime/src/preview1/args.rs +0 -60
- data/crates/kobako-wasmtime/src/preview1/beneath.rs +0 -188
- data/crates/kobako-wasmtime/tests/compile_posture.rs +0 -43
- data/crates/kobako-wasmtime/tests/guest_file.rs +0 -1054
- data/crates/kobako-wasmtime/tests/preamble_flags.rs +0 -70
- data/crates/kobako-wasmtime/tests/snippet_compile.rs +0 -95
- data/crates/kobako-wasmtime/tests/support/mod.rs +0 -30
- data/crates/kobako-wasmtime/tests/unanswered_call.rs +0 -86
- data/crates/kobako-wasmtime/tests/unsupported_call.rs +0 -51
- data/ext/kobako/src/runtime/escape.rs +0 -53
- data/ext/kobako/src/runtime/filesystem/ruby.rs +0 -400
- data/ext/kobako/src/runtime/filesystem.rs +0 -236
- data/ext/kobako/src/runtime/gvl.rs +0 -112
- data/lib/kobako/constant_name.rb +0 -8
- data/sig/kobako/codec/utils.rbs +0 -9
- data/sig/kobako/constant_name.rbs +0 -3
- /data/ext/kobako/src/{runtime/pinned_value.rs → pinned_value.rs} +0 -0
|
@@ -14,15 +14,6 @@ module Kobako
|
|
|
14
14
|
PREDICATE = :respond_to_guest?
|
|
15
15
|
private_constant :PREDICATE
|
|
16
16
|
|
|
17
|
-
# Kernel's own reflection, bound onto each object so a forwarder or a
|
|
18
|
-
# BasicObject answers from its own method table rather than through
|
|
19
|
-
# +method_missing+ / +respond_to_missing?+.
|
|
20
|
-
CLASS_OF = Kernel.instance_method(:class)
|
|
21
|
-
SINGLETON_CLASS_OF = Kernel.instance_method(:singleton_class)
|
|
22
|
-
SINGLETON_METHODS = Kernel.instance_method(:singleton_methods)
|
|
23
|
-
PRIVATE_METHODS = Kernel.instance_method(:private_methods)
|
|
24
|
-
private_constant :CLASS_OF, :SINGLETON_CLASS_OF, :SINGLETON_METHODS, :PRIVATE_METHODS
|
|
25
|
-
|
|
26
17
|
CALLABLE = Set.new(Reflection::CALLABLE_ALLOW).freeze
|
|
27
18
|
NOTHING = Set.new.freeze
|
|
28
19
|
private_constant :CALLABLE, :NOTHING
|
|
@@ -31,18 +22,38 @@ module Kobako
|
|
|
31
22
|
# each class's own surface for a caller that makes many references at
|
|
32
23
|
# once (a Handle table), so two objects of one class enumerate it once.
|
|
33
24
|
def self.of(object, surfaces = {})
|
|
34
|
-
klass = CLASS_OF.bind_call(object)
|
|
35
|
-
names = narrows_itself?(object, klass) ? nil :
|
|
25
|
+
klass = Reflection::CLASS_OF.bind_call(object)
|
|
26
|
+
names = narrows_itself?(object, klass) ? nil : resolve_default_names(object, klass, surfaces)
|
|
36
27
|
new(object: object, names: names)
|
|
37
28
|
end
|
|
38
29
|
|
|
30
|
+
# The class of +object+ when no reference may stand for it, as its
|
|
31
|
+
# reachable surface is not Service behaviour; +nil+ otherwise. A
|
|
32
|
+
# +Binding+ / +Method+ / +UnboundMethod+ hands the guest a callable
|
|
33
|
+
# proxy onto host reflection (a returned +Binding+ reaches
|
|
34
|
+
# +Binding#eval+); a +Class+ or +Module+ hands over its class-level API
|
|
35
|
+
# (+File.popen+ / +read+, +Kernel.system+), which the owner-based
|
|
36
|
+
# dispatch floor cannot see because a singleton-class owner matches no
|
|
37
|
+
# core-module list; a +Delegator+ (+SimpleDelegator+, +DelegateClass+,
|
|
38
|
+
# +WeakRef+, +Tempfile+) is a transparent forwarder whose public
|
|
39
|
+
# +method_missing+ binds and calls the private method the guest names
|
|
40
|
+
# (+Kernel#system+), a surface the floor reads as ordinary Service
|
|
41
|
+
# behaviour.
|
|
42
|
+
def self.refused_class_of(object)
|
|
43
|
+
case object
|
|
44
|
+
when Binding, Method, UnboundMethod, Module, Delegator
|
|
45
|
+
# Delegator < BasicObject exposes no static +#class+.
|
|
46
|
+
Reflection::CLASS_OF.bind_call(object)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
39
50
|
# Whether the guest may call +name+ through this reference. The
|
|
40
51
|
# object's own predicate is consulted with the private surface
|
|
41
52
|
# included, so the guest's +public_send+ can never reach it.
|
|
42
53
|
def exposes?(name)
|
|
43
54
|
return names.include?(name) if names
|
|
44
55
|
|
|
45
|
-
|
|
56
|
+
Reflection::SEND.bind_call(object, PREDICATE, name) ? true : false
|
|
46
57
|
end
|
|
47
58
|
|
|
48
59
|
class << self
|
|
@@ -53,13 +64,13 @@ module Kobako
|
|
|
53
64
|
# +respond_to_missing?+ cannot answer for it.
|
|
54
65
|
def narrows_itself?(object, klass)
|
|
55
66
|
klass.method_defined?(PREDICATE) || klass.private_method_defined?(PREDICATE) ||
|
|
56
|
-
PRIVATE_METHODS.bind_call(object, false).include?(PREDICATE) ||
|
|
57
|
-
SINGLETON_METHODS.bind_call(object, false).include?(PREDICATE)
|
|
67
|
+
Reflection::PRIVATE_METHODS.bind_call(object, false).include?(PREDICATE) ||
|
|
68
|
+
Reflection::SINGLETON_METHODS.bind_call(object, false).include?(PREDICATE)
|
|
58
69
|
end
|
|
59
70
|
|
|
60
71
|
# A callable keeps its callable names; a class-level surface or a
|
|
61
72
|
# forwarder has no surface of its own to expose.
|
|
62
|
-
def
|
|
73
|
+
def resolve_default_names(object, klass, surfaces)
|
|
63
74
|
case object
|
|
64
75
|
when Proc, Method then CALLABLE
|
|
65
76
|
when Module, Delegator then NOTHING
|
|
@@ -76,9 +87,9 @@ module Kobako
|
|
|
76
87
|
end
|
|
77
88
|
|
|
78
89
|
def with_singleton(object, names)
|
|
79
|
-
return names if SINGLETON_METHODS.bind_call(object, false).empty?
|
|
90
|
+
return names if Reflection::SINGLETON_METHODS.bind_call(object, false).empty?
|
|
80
91
|
|
|
81
|
-
names.union(authored_names(SINGLETON_CLASS_OF.bind_call(object))).freeze
|
|
92
|
+
names.union(authored_names(Reflection::SINGLETON_CLASS_OF.bind_call(object))).freeze
|
|
82
93
|
end
|
|
83
94
|
|
|
84
95
|
# The public methods +owner+ itself defines in Ruby source.
|
|
@@ -17,6 +17,19 @@ module Kobako
|
|
|
17
17
|
# callable exposes by default, so the floor and the Exposure agree.
|
|
18
18
|
CALLABLE_ALLOW = %i[call [] yield arity lambda?].freeze
|
|
19
19
|
|
|
20
|
+
# Kernel's own reflection and dispatch, bound onto each object so a
|
|
21
|
+
# forwarder or a BasicObject answers from its own method table rather
|
|
22
|
+
# than through +method_missing+ / +respond_to_missing?+, for the floor,
|
|
23
|
+
# the Exposure, and the call alike.
|
|
24
|
+
CLASS_OF = Kernel.instance_method(:class)
|
|
25
|
+
IS_A = Kernel.instance_method(:is_a?)
|
|
26
|
+
SINGLETON_CLASS_OF = Kernel.instance_method(:singleton_class)
|
|
27
|
+
SINGLETON_METHODS = Kernel.instance_method(:singleton_methods)
|
|
28
|
+
PRIVATE_METHODS = Kernel.instance_method(:private_methods)
|
|
29
|
+
RESPOND_TO = Kernel.instance_method(:respond_to?)
|
|
30
|
+
PUBLIC_SEND = Kernel.instance_method(:public_send)
|
|
31
|
+
SEND = BasicObject.instance_method(:__send__)
|
|
32
|
+
|
|
20
33
|
# The reason +name+ is unreachable through +exposure+, or +nil+ when
|
|
21
34
|
# the dispatch may proceed. Composes the ambient-surface floor with the
|
|
22
35
|
# reference's Exposure, in that order: the Exposure only narrows and
|
|
@@ -77,20 +90,20 @@ module Kobako
|
|
|
77
90
|
# A name with no method never reaches +instance_method+, which would
|
|
78
91
|
# keep a guest-chosen name as a Symbol for the life of the process.
|
|
79
92
|
def ambient_refusal(target, name)
|
|
80
|
-
return
|
|
93
|
+
return service_refusal(name) if name == :method_missing
|
|
81
94
|
|
|
82
95
|
klass = lookup_class(target)
|
|
83
|
-
return
|
|
84
|
-
return "no public method #{name.inspect} on target" unless
|
|
85
|
-
return
|
|
96
|
+
return public_method_refusal(target, name, klass) if klass.public_method_defined?(name)
|
|
97
|
+
return "no public method #{name.inspect} on target" unless RESPOND_TO.bind_call(target, name)
|
|
98
|
+
return service_refusal(name) if klass.method_defined?(name) || klass.private_method_defined?(name)
|
|
86
99
|
|
|
87
100
|
owner_refusal(target, name, klass)
|
|
88
101
|
end
|
|
89
102
|
|
|
90
|
-
def
|
|
103
|
+
def public_method_refusal(target, name, klass)
|
|
91
104
|
method = klass.instance_method(name)
|
|
92
105
|
owner_refusal(target, name, method.owner) ||
|
|
93
|
-
(authored_for?(target, name, method, klass) ? nil :
|
|
106
|
+
(authored_for?(target, name, method, klass) ? nil : service_refusal(name))
|
|
94
107
|
end
|
|
95
108
|
|
|
96
109
|
# A bound callable keeps its callable names and a record its member
|
|
@@ -102,7 +115,7 @@ module Kobako
|
|
|
102
115
|
(klass <= Struct || klass <= Data) && target.members.include?(name)
|
|
103
116
|
end
|
|
104
117
|
|
|
105
|
-
def
|
|
118
|
+
def service_refusal(name)
|
|
106
119
|
"method #{name.inspect} is not a Service method"
|
|
107
120
|
end
|
|
108
121
|
|
|
@@ -110,16 +123,20 @@ module Kobako
|
|
|
110
123
|
return nil unless ambient_owner?(owner, target)
|
|
111
124
|
return nil if GADGET_OWNERS.include?(owner) && CALLABLE_ALLOW.include?(name)
|
|
112
125
|
|
|
113
|
-
|
|
126
|
+
service_refusal(name)
|
|
114
127
|
end
|
|
115
128
|
|
|
116
129
|
# The class a method lookup on +target+ starts at. A plain object's
|
|
117
130
|
# singleton class is taken only when it already holds a public
|
|
118
131
|
# method, since asking for it otherwise would create one.
|
|
119
132
|
def lookup_class(target)
|
|
120
|
-
return target
|
|
133
|
+
return SINGLETON_CLASS_OF.bind_call(target) if module?(target) || SINGLETON_METHODS.bind_call(target).any?
|
|
134
|
+
|
|
135
|
+
CLASS_OF.bind_call(target)
|
|
136
|
+
end
|
|
121
137
|
|
|
122
|
-
|
|
138
|
+
def module?(target)
|
|
139
|
+
IS_A.bind_call(target, Module)
|
|
123
140
|
end
|
|
124
141
|
|
|
125
142
|
# Whatever +Class+ inherits is surface every object shares rather
|
|
@@ -132,7 +149,7 @@ module Kobako
|
|
|
132
149
|
def ambient_owner?(owner, target)
|
|
133
150
|
owner >= Class ||
|
|
134
151
|
GADGET_OWNERS.include?(owner) ||
|
|
135
|
-
(
|
|
152
|
+
(module?(target) && owner.singleton_class?)
|
|
136
153
|
end
|
|
137
154
|
end
|
|
138
155
|
end
|
data/lib/kobako/transport/run.rb
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "../constant_name"
|
|
4
3
|
require_relative "../handle"
|
|
4
|
+
require_relative "../names"
|
|
5
5
|
require_relative "../codec"
|
|
6
6
|
require_relative "../payload"
|
|
7
|
+
require_relative "argument_wrap"
|
|
7
8
|
|
|
8
9
|
module Kobako
|
|
9
10
|
module Transport
|
|
@@ -11,9 +12,9 @@ module Kobako
|
|
|
11
12
|
# legitimately holds one.
|
|
12
13
|
class Run < Data.define(:entrypoint, :args, :kwargs) # :nodoc:
|
|
13
14
|
def initialize(entrypoint:, args: [], kwargs: {})
|
|
14
|
-
entrypoint =
|
|
15
|
-
validate_args
|
|
16
|
-
validate_kwargs
|
|
15
|
+
entrypoint = Kobako.to_constant_name(entrypoint, "entrypoint")
|
|
16
|
+
validate_args(args)
|
|
17
|
+
validate_kwargs(kwargs)
|
|
17
18
|
super
|
|
18
19
|
end
|
|
19
20
|
|
|
@@ -21,44 +22,28 @@ module Kobako
|
|
|
21
22
|
# invocation's table. The walk starts one level down, since +args+ and
|
|
22
23
|
# +kwargs+ ride inside the payload document the wire's nesting bound
|
|
23
24
|
# is counted from.
|
|
24
|
-
def
|
|
25
|
+
def encode_payload(handles)
|
|
25
26
|
Payload::Arguments.new(
|
|
26
|
-
args:
|
|
27
|
-
kwargs:
|
|
27
|
+
args: ArgumentWrap.wrap(args, handles, 1),
|
|
28
|
+
kwargs: ArgumentWrap.wrap(kwargs, handles, 1)
|
|
28
29
|
).encode
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
private
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def normalize_entrypoint(target)
|
|
36
|
-
unless target.is_a?(Symbol) || target.is_a?(String)
|
|
37
|
-
raise TypeError, "entrypoint must be a Symbol or String, got #{target.class}"
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
target_str = target.to_s
|
|
41
|
-
unless CONSTANT_NAME.match?(target_str)
|
|
42
|
-
raise ArgumentError,
|
|
43
|
-
"entrypoint must match #{CONSTANT_NAME.inspect} (got #{target.inspect})"
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
target_str.to_sym
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def validate_args!(args)
|
|
50
|
-
raise ArgumentError, "arguments must be an Array" unless args.is_a?(Array)
|
|
34
|
+
def validate_args(args)
|
|
35
|
+
raise TypeError, "arguments must be an Array" unless args.is_a?(Array)
|
|
51
36
|
raise ArgumentError, forged_handle_message("arguments") if args.any?(Kobako::Handle)
|
|
52
37
|
end
|
|
53
38
|
|
|
54
39
|
# Checked here so the Host App sees the host-side message before any
|
|
55
40
|
# encode boundary.
|
|
56
|
-
def validate_kwargs
|
|
57
|
-
raise
|
|
41
|
+
def validate_kwargs(kwargs)
|
|
42
|
+
raise TypeError, "keyword arguments must be a Hash" unless kwargs.is_a?(Hash)
|
|
58
43
|
|
|
59
44
|
bad_keys = kwargs.each_key.grep_v(Symbol)
|
|
60
45
|
unless bad_keys.empty?
|
|
61
|
-
raise
|
|
46
|
+
raise TypeError,
|
|
62
47
|
"keyword argument keys must be Symbols (got #{bad_keys.inspect})"
|
|
63
48
|
end
|
|
64
49
|
raise ArgumentError, forged_handle_message("keyword argument values") if kwargs.each_value.any?(Kobako::Handle)
|
|
@@ -11,18 +11,15 @@ module Kobako
|
|
|
11
11
|
@break_tag = break_tag
|
|
12
12
|
@handles = handles
|
|
13
13
|
@failure = failure
|
|
14
|
-
@active = true
|
|
15
14
|
end
|
|
16
15
|
|
|
17
16
|
# The ok value is consumed by the host Service, so a Capability Handle
|
|
18
17
|
# in it is restored. A block exit stays in the guest, so the Service
|
|
19
18
|
# is only unwound.
|
|
20
19
|
def yield(*args)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
arm, body, klass = @guest_yielder.call(encode_args(args))
|
|
20
|
+
arm, body, class_name = @guest_yielder.call(encode_args(args))
|
|
24
21
|
raise UnsupportedError, "the Sandbox runtime does not support yielding to a block" if arm == :unsupported
|
|
25
|
-
raise @failure.remember(BlockError.new(body,
|
|
22
|
+
raise @failure.remember(BlockError.new(body, class_name: class_name)) if arm == :error
|
|
26
23
|
|
|
27
24
|
throw @break_tag if arm == :break
|
|
28
25
|
|
|
@@ -33,16 +30,12 @@ module Kobako
|
|
|
33
30
|
method(:yield).to_proc
|
|
34
31
|
end
|
|
35
32
|
|
|
36
|
-
def invalidate
|
|
37
|
-
@active = false
|
|
38
|
-
end
|
|
39
|
-
|
|
40
33
|
private
|
|
41
34
|
|
|
42
35
|
# Restated so the Service reads a refusal of its own argument rather
|
|
43
36
|
# than a codec class it never named.
|
|
44
37
|
def encode_args(args)
|
|
45
|
-
Kobako::Codec::Nesting.assert_within_bound
|
|
38
|
+
Kobako::Codec::Nesting.assert_within_bound(args)
|
|
46
39
|
Kobako::Codec::Encoder.encode(args)
|
|
47
40
|
rescue Kobako::Codec::Error => e
|
|
48
41
|
raise YieldValueError, "Service yielded a value the block cannot receive: #{e.message}"
|
data/lib/kobako/transport.rb
CHANGED
data/lib/kobako/version.rb
CHANGED
data/lib/kobako.rb
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Inside +lib/+, the code sits in tiers: a tier may use the tiers below it
|
|
4
|
+
# and never one above.
|
|
5
|
+
#
|
|
6
|
+
# Orchestration Sandbox, Pool, Runtime (+ ext), Context
|
|
7
|
+
# |
|
|
8
|
+
# Catalog setup-time registries + the per-invocation Handle table
|
|
9
|
+
# |
|
|
10
|
+
# Transport --+ call value objects + dispatch
|
|
11
|
+
# Outcome ----+ guest-result attribution
|
|
12
|
+
# | |
|
|
13
|
+
# Payload <---+ the [args, kwargs] shape a Call or Run carries
|
|
14
|
+
# | |
|
|
15
|
+
# Codec <-----+ byte-level payload wire
|
|
16
|
+
# |
|
|
17
|
+
# Root dependency-free value objects and error classes
|
|
18
|
+
#
|
|
19
|
+
# The Envelope has no tier here, because the native side frames and
|
|
20
|
+
# decodes it.
|
|
21
|
+
#
|
|
22
|
+
# These rules keep the tiers acyclic:
|
|
23
|
+
#
|
|
24
|
+
# [A type sits at the lowest tier that needs it]
|
|
25
|
+
# Kobako::Handle sits at the root, for Codec.
|
|
26
|
+
# [A native piece sits at the tier of the constant it registers on]
|
|
27
|
+
# Kobako::Filesystem and Kobako::Network sit at the root, for the
|
|
28
|
+
# Catalog, and so do the name rules on Kobako itself, for the Catalog and
|
|
29
|
+
# Transport; Kobako::Runtime sits with the Sandbox that drives it.
|
|
30
|
+
# [Outcome may require <tt>transport/error.rb</tt>]
|
|
31
|
+
# The gem contract fixes the class name.
|
|
32
|
+
# [<tt>Codec.track_handles</tt> wraps only the decode call]
|
|
33
|
+
# Wrapping more leaks its flag into re-entry.
|
|
34
|
+
#
|
|
35
|
+
# Namespace follows dependency direction, not which tier reads a type most.
|
|
36
|
+
# Kobako::Transport::Error stays in Transport despite the lateral edge from
|
|
37
|
+
# Outcome, because its file depends only on the root <tt>errors.rb</tt>.
|
|
38
|
+
|
|
3
39
|
require_relative "kobako/version"
|
|
4
40
|
|
|
5
41
|
begin
|
|
@@ -10,7 +46,9 @@ rescue LoadError
|
|
|
10
46
|
end
|
|
11
47
|
|
|
12
48
|
require_relative "kobako/filesystem"
|
|
49
|
+
require_relative "kobako/network"
|
|
13
50
|
require_relative "kobako/errors"
|
|
51
|
+
require_relative "kobako/names"
|
|
14
52
|
require_relative "kobako/unresolved"
|
|
15
53
|
require_relative "kobako/extension"
|
|
16
54
|
require_relative "kobako/transport"
|
data/release-please-config.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
|
3
3
|
"release-type": "ruby",
|
|
4
4
|
"bump-minor-pre-major": true,
|
|
5
|
+
"commit-search-depth": 1000,
|
|
5
6
|
"last-release-sha": "98509af508988f708bf0d7a76a718bb0428a177e",
|
|
6
7
|
"packages": {
|
|
7
8
|
".": {
|
|
@@ -114,6 +115,11 @@
|
|
|
114
115
|
"path": "/wasm/kobako-baker/Cargo.lock",
|
|
115
116
|
"jsonpath": "$.package[?(@.name=='kobako-baker')].version"
|
|
116
117
|
},
|
|
118
|
+
{
|
|
119
|
+
"type": "toml",
|
|
120
|
+
"path": "/wasm/kobako-baker/Cargo.toml",
|
|
121
|
+
"jsonpath": "$.dependencies['kobako-transport'].version"
|
|
122
|
+
},
|
|
117
123
|
{
|
|
118
124
|
"type": "generic",
|
|
119
125
|
"path": "/wasm/kobako-baker/README.md"
|
|
@@ -139,6 +145,11 @@
|
|
|
139
145
|
"path": "/wasm/Cargo.lock",
|
|
140
146
|
"jsonpath": "$.package[?(@.name=='kobako-transport')].version"
|
|
141
147
|
},
|
|
148
|
+
{
|
|
149
|
+
"type": "toml",
|
|
150
|
+
"path": "/wasm/kobako-baker/Cargo.lock",
|
|
151
|
+
"jsonpath": "$.package[?(@.name=='kobako-transport')].version"
|
|
152
|
+
},
|
|
142
153
|
{
|
|
143
154
|
"type": "generic",
|
|
144
155
|
"path": "/crates/kobako-transport/README.md"
|
|
@@ -159,6 +170,11 @@
|
|
|
159
170
|
"path": "/wasm/Cargo.lock",
|
|
160
171
|
"jsonpath": "$.package[?(@.name=='kobako-codec')].version"
|
|
161
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"type": "toml",
|
|
175
|
+
"path": "/crates/kobako-codec/Cargo.toml",
|
|
176
|
+
"jsonpath": "$.dependencies['kobako-transport'].version"
|
|
177
|
+
},
|
|
162
178
|
{
|
|
163
179
|
"type": "generic",
|
|
164
180
|
"path": "/crates/kobako-codec/README.md"
|
data/sig/core/thread.rbs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# The block form rbs 4.2.0 leaves out. ruby/rbs types it after that release
|
|
2
|
+
# (7c396890); this goes once a release carrying it is the floor.
|
|
3
|
+
class Thread
|
|
4
|
+
def self.handle_interrupt: [T] (Hash[Class, :immediate | :on_blocking | :never] hash) { (nil) -> T } -> T
|
|
5
|
+
| ...
|
|
6
|
+
end
|
|
@@ -5,17 +5,19 @@ module Kobako
|
|
|
5
5
|
|
|
6
6
|
def install: (untyped extension, snippets: Kobako::Catalog::Snippets, services: Kobako::Catalog::Services) -> self
|
|
7
7
|
|
|
8
|
-
def assert_dependencies
|
|
8
|
+
def assert_dependencies: () -> self
|
|
9
9
|
|
|
10
10
|
def resolve: () -> Hash[String, untyped]
|
|
11
11
|
|
|
12
12
|
private
|
|
13
13
|
|
|
14
|
-
def
|
|
14
|
+
def object_of: (untyped backend) -> untyped
|
|
15
15
|
|
|
16
16
|
def resolve_backend: (untyped extension, Hash[String, untyped] resolved, Hash[untyped, untyped] by_provider) -> void
|
|
17
17
|
|
|
18
|
-
def validate
|
|
18
|
+
def validate: (untyped extension) -> void
|
|
19
|
+
|
|
20
|
+
def validate_dependencies: (untyped dependencies) -> void
|
|
19
21
|
|
|
20
22
|
def unmet_dependency: () -> [untyped, untyped]?
|
|
21
23
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
module Kobako
|
|
2
2
|
module Catalog
|
|
3
3
|
class Grants
|
|
4
|
-
|
|
4
|
+
type key = [Symbol, String]
|
|
5
|
+
|
|
6
|
+
type grant = Mount | Network
|
|
5
7
|
|
|
6
|
-
def
|
|
8
|
+
def initialize: () -> void
|
|
7
9
|
|
|
8
|
-
def
|
|
10
|
+
def register: (grant grant) -> nil
|
|
9
11
|
|
|
10
|
-
def
|
|
12
|
+
def include?: (grant grant) -> bool
|
|
13
|
+
def entries: (?Hash[key, grant] overrides) -> [Array[Mount::tuple], Array[Network::tuple]]
|
|
11
14
|
end
|
|
12
15
|
end
|
|
13
16
|
end
|
|
@@ -13,11 +13,9 @@ module Kobako
|
|
|
13
13
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
|
-
def
|
|
16
|
+
def ensure_capacity: () -> void
|
|
17
17
|
|
|
18
|
-
def
|
|
19
|
-
|
|
20
|
-
def require_bound!: (Integer id) -> void
|
|
18
|
+
def require_bound: (Integer id) -> void
|
|
21
19
|
end
|
|
22
20
|
end
|
|
23
21
|
end
|
|
@@ -14,15 +14,13 @@ module Kobako
|
|
|
14
14
|
|
|
15
15
|
def self.new: (at: untyped, access: untyped, filesystem: untyped, policy: policy?) -> Mount
|
|
16
16
|
|
|
17
|
-
def
|
|
17
|
+
def initialize: (at: untyped, access: untyped, filesystem: untyped, policy: policy?) -> void
|
|
18
|
+
|
|
19
|
+
def key: () -> Grants::key
|
|
18
20
|
|
|
19
21
|
def conflict: (Mount other) -> String?
|
|
20
22
|
|
|
21
23
|
def to_native: () -> tuple
|
|
22
|
-
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
def nested?: (String other) -> bool
|
|
26
24
|
end
|
|
27
25
|
end
|
|
28
26
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
module Catalog
|
|
3
|
+
class Network < Data
|
|
4
|
+
type tuple = [String, untyped]
|
|
5
|
+
|
|
6
|
+
attr_reader name: String
|
|
7
|
+
attr_reader entry: untyped
|
|
8
|
+
|
|
9
|
+
def self.new: (name: untyped, entry: untyped) ?{ (Kobako::Network::Builder) -> void } -> Network
|
|
10
|
+
|
|
11
|
+
def initialize: (name: untyped, entry: untyped) ?{ (Kobako::Network::Builder) -> void } -> void
|
|
12
|
+
|
|
13
|
+
def key: () -> Grants::key
|
|
14
|
+
|
|
15
|
+
def conflict: (Mount | Network other) -> String?
|
|
16
|
+
|
|
17
|
+
def to_native: () -> tuple
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Kobako
|
|
2
|
+
module Catalog
|
|
3
|
+
class Replacements
|
|
4
|
+
@grants: Grants
|
|
5
|
+
@replaced: Hash[Grants::key, Grants::grant]
|
|
6
|
+
|
|
7
|
+
def initialize: (Grants grants) -> void
|
|
8
|
+
|
|
9
|
+
def replace: (Grants::grant grant, String refusal) -> nil
|
|
10
|
+
|
|
11
|
+
def entries: () -> [Array[Mount::tuple], Array[Network::tuple]]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
module Kobako
|
|
2
2
|
module Catalog
|
|
3
3
|
class Services
|
|
4
|
-
RESERVED_NAMESPACE: String
|
|
5
|
-
|
|
6
4
|
def initialize: () -> void
|
|
7
5
|
|
|
8
6
|
def bind: (Symbol | String path, untyped object) -> self
|
|
@@ -15,9 +13,7 @@ module Kobako
|
|
|
15
13
|
|
|
16
14
|
private
|
|
17
15
|
|
|
18
|
-
def validate_path
|
|
19
|
-
|
|
20
|
-
def reserved?: (String path) -> bool
|
|
16
|
+
def validate_path: (Symbol | String path) -> String
|
|
21
17
|
|
|
22
18
|
def collision?: (String path) -> bool
|
|
23
19
|
end
|
|
@@ -15,15 +15,13 @@ module Kobako
|
|
|
15
15
|
|
|
16
16
|
private
|
|
17
17
|
|
|
18
|
-
def register_source
|
|
18
|
+
def register_source: (String? code, (Symbol | String)? name) -> nil
|
|
19
19
|
|
|
20
|
-
def ensure_source_args
|
|
20
|
+
def ensure_source_args: (String? code, (Symbol | String)? name) -> [String, Symbol | String]
|
|
21
21
|
|
|
22
|
-
def register_binary
|
|
22
|
+
def register_binary: (String bytes) -> nil
|
|
23
23
|
|
|
24
24
|
def entry_tuple: (entry) -> tuple
|
|
25
|
-
|
|
26
|
-
def normalize_name: (Symbol | String name) -> Symbol
|
|
27
25
|
end
|
|
28
26
|
end
|
|
29
27
|
end
|
data/sig/kobako/catalog.rbs
CHANGED
|
@@ -5,16 +5,10 @@ module Kobako
|
|
|
5
5
|
|
|
6
6
|
def self.representable?: (untyped value, ?Integer depth) -> bool
|
|
7
7
|
|
|
8
|
-
def self.deep_wrap: (untyped value, Kobako::Codec::_HandleTable handles, ?Integer depth) -> untyped
|
|
9
|
-
|
|
10
8
|
def self.deep_restore: (untyped value, Kobako::Codec::_HandleTable handles) -> untyped
|
|
11
9
|
|
|
12
10
|
private
|
|
13
11
|
|
|
14
|
-
def self.guard_nesting!: (Integer depth) -> void
|
|
15
|
-
|
|
16
|
-
def self.deep_wrap_hash: (Hash[untyped, untyped] hash, Kobako::Codec::_HandleTable handles, Integer depth) -> Hash[untyped, untyped]
|
|
17
|
-
|
|
18
12
|
def self.primitive_type?: (untyped value) -> bool
|
|
19
13
|
|
|
20
14
|
def self.container_representable?: (untyped value, Integer depth) -> bool
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
module Kobako
|
|
2
2
|
module Codec
|
|
3
3
|
module Nesting
|
|
4
|
-
def self.assert_within_bound
|
|
4
|
+
def self.assert_within_bound: (untyped value, ?Integer depth) -> void
|
|
5
5
|
|
|
6
|
-
def self.assert_members_within_bound
|
|
6
|
+
def self.assert_members_within_bound: (Array[untyped] members, Integer depth) -> void
|
|
7
7
|
end
|
|
8
8
|
end
|
|
9
9
|
end
|