Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
browser WASM (#5955)
r33drichardsd285bb931b72
diff --git a/libs/fleet/Cargo.lock b/libs/fleet/Cargo.lockindex 454c726f46..dcbdb8c5c3 100644--- a/libs/fleet/Cargo.lock+++ b/libs/fleet/Cargo.lock@@ -56,6 +56,19 @@ dependencies = ["winnow 0.7.15",]+[[package]]+name = "async-compat"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a1ba85bc55464dcbf728b56d97e119d673f4cf9062be330a9a26f3acf504a590"+dependencies = [+ "futures-core",+ "futures-io",+ "once_cell",+ "pin-project-lite",+ "tokio",+]+[[package]]name = "async-trait"version = "0.1.91"@@ -100,6 +113,12 @@ version = "2.13.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"+[[package]]+name = "bumpalo"+version = "3.20.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"+[[package]]name = "bytes"version = "1.12.1"@@ -191,12 +210,17 @@ dependencies = ["camino","cyclops-sdk-schema","futures-timer",+ "gloo-timers",+ "js-sys","serde","serde_json","thiserror","tokio","uniffi","url",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "web-sys",][[package]]@@ -367,12 +391,51 @@ dependencies = ["autocfg",]+[[package]]+name = "futures-channel"+version = "0.3.33"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae"+dependencies = [+ "futures-core",+]++[[package]]+name = "futures-core"+version = "0.3.33"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7"++[[package]]+name = "futures-io"+version = "0.3.33"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a"++[[package]]+name = "futures-task"+version = "0.3.33"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109"+[[package]]name = "futures-timer"version = "3.0.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968"+[[package]]+name = "futures-util"+version = "0.3.33"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa"+dependencies = [+ "futures-core",+ "futures-task",+ "pin-project-lite",+ "slab",+]+[[package]]name = "getrandom"version = "0.4.3"@@ -390,6 +453,18 @@ version = "0.3.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"+[[package]]+name = "gloo-timers"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994"+dependencies = [+ "futures-channel",+ "futures-core",+ "js-sys",+ "wasm-bindgen",+]+[[package]]name = "goblin"version = "0.8.2"@@ -586,6 +661,17 @@ dependencies = ["syn 2.0.119",]+[[package]]+name = "js-sys"+version = "0.3.103"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102"+dependencies = [+ "cfg-if",+ "futures-util",+ "wasm-bindgen",+]+[[package]]name = "k8s-openapi"version = "0.28.0"@@ -825,6 +911,12 @@ dependencies = ["windows-sys",]+[[package]]+name = "rustversion"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"+[[package]]name = "ryu"version = "1.0.23"@@ -978,6 +1070,12 @@ version = "1.0.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"+[[package]]+name = "slab"+version = "0.4.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"+[[package]]name = "smallvec"version = "1.15.2"@@ -1208,6 +1306,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b0ef62e69762fbb9386dcb6c87cd3dd05d525fa8a3a579a290892e60ddbda47e"dependencies = ["anyhow",+ "async-compat","bytes","once_cell","static_assertions",@@ -1304,6 +1403,71 @@ version = "1.0.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"+[[package]]+name = "wasm-bindgen"+version = "0.2.126"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4"+dependencies = [+ "cfg-if",+ "once_cell",+ "rustversion",+ "wasm-bindgen-macro",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-futures"+version = "0.4.76"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]++[[package]]+name = "wasm-bindgen-macro"+version = "0.2.126"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1"+dependencies = [+ "quote",+ "wasm-bindgen-macro-support",+]++[[package]]+name = "wasm-bindgen-macro-support"+version = "0.2.126"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e"+dependencies = [+ "bumpalo",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-shared"+version = "0.2.126"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24"+dependencies = [+ "unicode-ident",+]++[[package]]+name = "web-sys"+version = "0.3.103"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]+[[package]]name = "weedle2"version = "5.0.0"diff --git a/libs/fleet/Cargo.toml b/libs/fleet/Cargo.tomlindex 58067aa6cc..a05a2964ff 100644--- a/libs/fleet/Cargo.toml+++ b/libs/fleet/Cargo.toml@@ -18,6 +18,6 @@ serde = { version = "1.0", features = ["derive", "rc"] }serde_json = "1.0"serde_yaml = "0.9"thiserror = "2.0"-tokio = { version = "1.0", features = ["macros", "rt-multi-thread", "sync"] }-uniffi = "=0.31.0"+tokio = { version = "1.0", features = ["macros", "rt", "sync"] }+uniffi = { version = "=0.31.0", features = ["tokio", "wasm-unstable-single-threaded"] }url = "2.5"diff --git a/libs/fleet/scripts/build-browser-sdk-binding.sh b/libs/fleet/scripts/build-browser-sdk-binding.shnew file mode 100755index 0000000000..6f209e37ef--- /dev/null+++ b/libs/fleet/scripts/build-browser-sdk-binding.sh@@ -0,0 +1,35 @@+#!/usr/bin/env bash+set -euo pipefail++repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"+binding_dir="$repo_root/cyclops-cs/sdk-bindings/ts-uniffi-browser"++for command in cargo rustup npm; do+ if ! command -v "$command" >/dev/null 2>&1; then+ echo "error: $command must be available on PATH" >&2+ exit 127+ fi+done++if ! rustup target list --installed | grep -qx 'wasm32-unknown-unknown'; then+ rustup target add wasm32-unknown-unknown+fi++wasm_bindgen_version="0.2.126"+if ! command -v wasm-bindgen >/dev/null 2>&1 || ! wasm-bindgen --version | grep -Fq "$wasm_bindgen_version"; then+ cargo install wasm-bindgen-cli --version "$wasm_bindgen_version" --locked+fi++npm ci --prefix "$binding_dir"+npm --prefix "$binding_dir" run build++for artifact in \+ "$binding_dir/ts/wasm-bindgen/index.js" \+ "$binding_dir/ts/wasm-bindgen/index_bg.wasm" \+ "$binding_dir/examples/dist/browser.js"; do+ if [ ! -s "$artifact" ]; then+ echo "error: expected generated browser SDK artifact is missing or empty: $artifact" >&2+ exit 1+ fi+ printf '%s\n' "$artifact"+donediff --git a/libs/fleet/scripts/generate-sdk-bindings.sh b/libs/fleet/scripts/generate-sdk-bindings.shindex 68a5d88107..fb2a85a261 100755--- a/libs/fleet/scripts/generate-sdk-bindings.sh+++ b/libs/fleet/scripts/generate-sdk-bindings.sh@@ -119,13 +119,23 @@ grep_matches_or_empty() {ruby_method_names() {source_file="$1"method_prefix="$2"- grep_matches_or_empty "${method_prefix}_Type[A-Za-z0-9_]+" "$source_file" | LC_ALL=C sort -u+ case "$method_prefix" in+ check_lower) pattern='check_lower_[A-Za-z0-9_]+' ;;+ read) pattern='read(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;+ write) pattern='write_(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;+ esac+ grep_matches_or_empty "$pattern" "$source_file" | LC_ALL=C sort -u}ruby_defined_method_names() {source_file="$1"method_prefix="$2"- sed -n -E "s/^[[:space:]]*def (self\\.)?(${method_prefix}_Type[A-Za-z0-9_]+).*/\\2/p" "$source_file" | LC_ALL=C sort -u+ case "$method_prefix" in+ check_lower) pattern='check_lower_[A-Za-z0-9_]+' ;;+ read) pattern='read(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;+ write) pattern='write_(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;+ esac+ sed -n -E "s/^[[:space:]]*def (self\\.)?(${pattern}).*/\\2/p" "$source_file" | LC_ALL=C sort -u}write_ruby_method_array() {@@ -610,33 +620,393 @@ mv "$raw_output/cyclops_sdk.rb" "$generated_root/ruby/cyclops_sdk/sdk.rb"mv "$raw_output/cyclops_sdk_schema.rb" "$generated_root/ruby/cyclops_sdk/schema.rb"# UniFFI 0.31.0 emits `OsGym` in cross-crate Ruby helper references while the# schema component exports `OSGym`; normalize the generated helper calls.-sed -i.bak "s/check_lower_TypeOsGym/check_lower_TypeOSGym/g" "$generated_root/ruby/cyclops_sdk/sdk.rb"-rm "$generated_root/ruby/cyclops_sdk/sdk.rb.bak"-# UniFFI 0.31.0 lowers a foreign callback interface as an object clone. Ruby-# callback implementations have no Rust handle, so avoid cloning nil handles.+for ruby_component in sdk schema; do+ sed -i.bak "s/OsGym/OSGym/g" "$generated_root/ruby/cyclops_sdk/$ruby_component.rb"+ rm "$generated_root/ruby/cyclops_sdk/$ruby_component.rb.bak"+done+# UniFFI 0.31.0 omits Ruby support for foreign callback interfaces.+# Add the callback-handle map and vtable that its Rust scaffolding expects.python3 - "$generated_root/ruby/cyclops_sdk/sdk.rb" <<'PYTHON_RUBY_PATCH'import pathlib+import reimport sys+path = pathlib.Path(sys.argv[1])text = path.read_text()-old = """ def uniffi_clone_handle()++text = text.replace("require 'ffi'\n", "require 'ffi'\nrequire 'monitor'\n", 1)+future_ffi_anchor = " ffi_lib 'cyclops_sdk'\n"+future_ffi = """ ffi_lib 'cyclops_sdk'++ callback :RustFutureContinuationCallback,+ [:uint64, :int8],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ [:uint64, :RustFutureContinuationCallback, :uint64],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ [:uint64, RustCallStatus.by_ref],+ RustBuffer.by_value+ attach_function :ffi_cyclops_sdk_rust_future_free_rust_buffer,+ [:uint64],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_poll_void,+ [:uint64, :RustFutureContinuationCallback, :uint64],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_complete_void,+ [:uint64, RustCallStatus.by_ref],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_free_void,+ [:uint64],+ :void+"""+if future_ffi_anchor not in text:+ raise SystemExit("expected Ruby FFI library declaration not found")+text = text.replace(future_ffi_anchor, future_ffi, 1)++future_runtime_anchor = "private_class_method :consume_buffer_into_error\n"+future_runtime = """UNIFFI_RUST_FUTURE_POLL_READY = 0+UNIFFI_RUST_FUTURE_POLL_WAKE = 1+UNIFFI_CALLBACK_SUCCESS = 0+UNIFFI_CALLBACK_ERROR = 1+UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2++def self.uniffi_lower_http_error(error)+ unless error.is_a?(HttpError::Transport)+ raise InternalError, "Unexpected HttpError variant: #{error.class}"+ end++ RustBuffer.allocWithBuilder do |builder|+ builder.write_U32(1)+ reason = error.reason+ reason = reason.fetch(:reason) if reason.is_a?(Hash) && reason.keys == [:reason]+ builder.write_String(reason)+ builder.finalize()+ end+end++def self.uniffi_trait_interface_call(call_status, make_call, write_return_value, error_type = nil, lower_error = nil)+ begin+ write_return_value.call make_call.call+ rescue StandardError => error+ buffer = if !error_type.nil? && uniffi_is_error_type?(error, error_type)+ call_status[:code] = UNIFFI_CALLBACK_ERROR+ lower_error.call error+ else+ call_status[:code] = UNIFFI_CALLBACK_UNEXPECTED_ERROR+ RustBuffer.allocFromString(error.inspect)+ end++ error_buffer = call_status[:error_buf]+ error_buffer[:capacity] = buffer[:capacity]+ error_buffer[:len] = buffer[:len]+ error_buffer[:data] = buffer[:data]+ end+end++def self.uniffi_is_error_type?(error, error_type)+ return true if error_type.is_a?(Class) && error.is_a?(error_type)++ error_type.constants.any? do |name|+ error_class = error_type.const_get(name)+ error_class.is_a?(Class) && error.is_a?(error_class)+ end+end++def self.uniffi_rust_future(error_module, handle, poll_function, complete_function, free_function)+ monitor = Monitor.new+ condition = monitor.new_cond+ poll_state = nil+ continuation = Proc.new do |_callback_data, state|+ monitor.synchronize do+ poll_state = state+ condition.signal+ end+ end++ begin+ loop do+ monitor.synchronize { poll_state = nil }+ UniFFILib.public_send(poll_function, handle, continuation, 0)+ state = monitor.synchronize do+ condition.wait_while { poll_state.nil? }+ poll_state+ end+ break if state == UNIFFI_RUST_FUTURE_POLL_READY+ next if state == UNIFFI_RUST_FUTURE_POLL_WAKE++ raise InternalError, "Unknown Rust future poll state: #{state}"+ end++ status = RustCallStatus.new+ result = UniFFILib.public_send(complete_function, handle, status)+ case status.code+ when CALL_SUCCESS+ result+ when CALL_ERROR+ if error_module.nil?+ status.error_buf.free+ raise InternalError, "CALL_ERROR with no error_module set"+ end+ raise consume_buffer_into_error(error_module, status.error_buf)+ when CALL_PANIC+ if status.error_buf.len > 0+ raise InternalError, status.error_buf.consumeIntoString()+ end+ raise InternalError, "Rust panic"+ else+ raise InternalError, "Unknown call status: #{status.code}"+ end+ ensure+ UniFFILib.public_send(free_function, handle) unless handle.nil?+ end+end++def self.uniffi_rust_future_rust_buffer(error_module, handle)+ uniffi_rust_future(+ error_module,+ handle,+ :ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ :ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ :ffi_cyclops_sdk_rust_future_free_rust_buffer,+ )+end++def self.uniffi_rust_future_void(error_module, handle)+ uniffi_rust_future(+ error_module,+ handle,+ :ffi_cyclops_sdk_rust_future_poll_void,+ :ffi_cyclops_sdk_rust_future_complete_void,+ :ffi_cyclops_sdk_rust_future_free_void,+ )+end++private_class_method :consume_buffer_into_error+"""+if future_runtime_anchor not in text:+ raise SystemExit("expected Ruby error helper declaration not found")+text = text.replace(future_runtime_anchor, future_runtime, 1)++buffer_pattern = r"(?m)^(\s*)result = CyclopsSdk\.rust_call_with_error\(([^,]+),:([a-z0-9_]+),(.*)\)$"+def replace_buffer(match):+ indent, error_module, function, arguments = match.groups()+ return (+ f"{indent}result = CyclopsSdk.uniffi_rust_future_rust_buffer(\n"+ f"{indent} {error_module},\n"+ f"{indent} UniFFILib.{function}({arguments},RustCallStatus.new),\n"+ f"{indent})"+ )+text, buffer_replacements = re.subn(buffer_pattern, replace_buffer, text)+if buffer_replacements != 11:+ raise SystemExit(f"expected 11 Ruby Rust-buffer future wrappers, found {buffer_replacements}")++void_pattern = r"(?m)^(\s*)CyclopsSdk\.rust_call_with_error\(([^,]+),:([a-z0-9_]+),(.*)\)$"+def replace_void(match):+ indent, error_module, function, arguments = match.groups()+ return (+ f"{indent}CyclopsSdk.uniffi_rust_future_void(\n"+ f"{indent} {error_module},\n"+ f"{indent} UniFFILib.{function}({arguments},RustCallStatus.new),\n"+ f"{indent})"+ )+text, void_replacements = re.subn(void_pattern, replace_void, text)+if void_replacements != 2:+ raise SystemExit(f"expected 2 Ruby void future wrappers, found {void_replacements}")++handle_map_anchor = """def self.uniffi_bytes(v)+ raise TypeError, \"no implicit conversion of #{v} into String\" unless v.respond_to?(:to_str)+ v.to_str+end++"""+handle_map = """def self.uniffi_bytes(v)+ raise TypeError, \"no implicit conversion of #{v} into String\" unless v.respond_to?(:to_str)+ v.to_str+end++class UniffiHandleMap+ def initialize+ @lock = Monitor.new+ @map = {}+ @counter = 1+ end++ def insert(object)+ @lock.synchronize do+ handle = @counter+ @counter += 2+ @map[handle] = object+ handle+ end+ end++ def get(handle)+ @lock.synchronize do+ object = @map.fetch(handle) { raise InternalError, \"unknown UniFFI callback handle #{handle}\" }+ object+ end+ end++ def clone_handle(handle)+ @lock.synchronize do+ object = @map.fetch(handle) { raise InternalError, \"unknown UniFFI callback handle #{handle}\" }+ new_handle = @counter+ @counter += 2+ @map[new_handle] = object+ new_handle+ end+ end++ def remove(handle)+ @lock.synchronize do+ @map.delete(handle) { raise InternalError, \"unknown UniFFI callback handle #{handle}\" }+ end+ end+end++private_constant :UniffiHandleMap++"""+if handle_map_anchor not in text:+ raise SystemExit("expected Ruby helper insertion point not found")+text = text.replace(handle_map_anchor, handle_map, 1)++old_init = """ attach_function :uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient,+ [:pointer, RustCallStatus.by_ref],+ :void+"""+new_init = """ callback :ForeignFutureDroppedCallback,+ [:uint64],+ :void+ callback :CallbackInterfaceFree,+ [:uint64],+ :void+ callback :CallbackInterfaceClone,+ [:uint64],+ :uint64+ class ForeignFutureDroppedCallbackStruct < FFI::Struct+ layout :handle, :uint64,+ :free, :ForeignFutureDroppedCallback+ end+ class ForeignFutureResultRustBuffer < FFI::Struct+ layout :return_value, RustBuffer.by_value,+ :call_status, RustCallStatus+ end+ callback :ForeignFutureCompleteRustBuffer,+ [:uint64, ForeignFutureResultRustBuffer.by_value],+ :void+ callback :CallbackInterfaceHttpClientMethod0,+ [:uint64, RustBuffer.by_value, :ForeignFutureCompleteRustBuffer, :uint64, ForeignFutureDroppedCallbackStruct.by_ref],+ :void+ class VTableCallbackInterfaceHttpClient < FFI::Struct+ layout :uniffi_free, :CallbackInterfaceFree,+ :uniffi_clone, :CallbackInterfaceClone,+ :execute, :CallbackInterfaceHttpClientMethod0+ end+ attach_function :uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient,+ [VTableCallbackInterfaceHttpClient.by_ref],+ :void+"""+if old_init not in text:+ raise SystemExit("expected HttpClient vtable initializer not found")+text = text.replace(old_init, new_init, 1)++old_http_client = """ # A private helper for lowering instances into a raw handle.+ # This does an explicit typecheck, because accidentally lowering a different type of+ # object in a place where this type is expected, could lead to memory unsafety.+ def self.uniffi_check_lower(inst)+ if not inst.is_a? self+ raise TypeError.new \"Expected a HttpClient instance, got #{inst}\"+ end+ end++ def uniffi_clone_handle()return CyclopsSdk.rust_call(:uniffi_cyclops_sdk_fn_clone_httpclient,@handle)end++ def self.uniffi_lower(inst)+ return inst.uniffi_clone_handle()+ end"""-new = """ def uniffi_clone_handle()- return 0 if @handle.nil?+new_http_client = """ @uniffi_handle_map = UniffiHandleMap.new++ class << self+ attr_reader :uniffi_handle_map+ end++ def self.uniffi_check_lower(inst)+ unless inst.is_a?(self) && inst.respond_to?(:execute)+ raise TypeError.new \"Expected a HttpClient instance, got #{inst}\"+ end+ end++ def uniffi_clone_handle()return CyclopsSdk.rust_call(:uniffi_cyclops_sdk_fn_clone_httpclient,@handle)end++ def self.uniffi_lower(inst)+ if inst.instance_variable_defined?(:@handle)+ inst.uniffi_clone_handle()+ else+ @uniffi_handle_map.insert(inst)+ end+ end+"""+if old_http_client not in text:+ raise SystemExit("expected HttpClient lowering block not found")+text = text.replace(old_http_client, new_http_client, 1)++vtable_pattern = r"end\s+class CyclopsCredentials\n"+vtable = """end++module UniffiCallbackInterfaceHttpClient+ UNIFFI_DROPPED_CALLBACK = Proc.new { |_handle| }++ EXECUTE_CALLBACK = Proc.new do |uniffi_handle, request, future_callback, callback_data, dropped_callback|+ dropped_callback[:handle] = 0+ dropped_callback[:free] = UNIFFI_DROPPED_CALLBACK+ result = UniFFILib::ForeignFutureResultRustBuffer.new+ status = RustCallStatus.new+ CyclopsSdk.uniffi_trait_interface_call(+ status,+ Proc.new { HttpClient.uniffi_handle_map.get(uniffi_handle).execute(request.consumeIntoTypeHttpRequest) },+ Proc.new { |response| result[:return_value] = RustBuffer.alloc_from_TypeHttpResponse(response) },+ HttpError,+ Proc.new { |error| CyclopsSdk.uniffi_lower_http_error(error) }+ )+ result[:call_status] = status+ future_callback.call(callback_data, result)+ end++ UNIFFI_FREE_CALLBACK = Proc.new do |uniffi_handle|+ HttpClient.uniffi_handle_map.remove(uniffi_handle)+ end++ UNIFFI_CLONE_CALLBACK = Proc.new do |uniffi_handle|+ HttpClient.uniffi_handle_map.clone_handle(uniffi_handle)+ end++ UNIFFI_VTABLE = UniFFILib::VTableCallbackInterfaceHttpClient.new+ UNIFFI_VTABLE[:uniffi_free] = UNIFFI_FREE_CALLBACK+ UNIFFI_VTABLE[:uniffi_clone] = UNIFFI_CLONE_CALLBACK+ UNIFFI_VTABLE[:execute] = EXECUTE_CALLBACK+ UniFFILib.uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(UNIFFI_VTABLE)+end++ class CyclopsCredentials"""-if old not in text:- raise SystemExit("expected HttpClient clone method not found")-path.write_text(text.replace(old, new, 1))+text, replacements = re.subn(vtable_pattern, vtable, text, count=1)+if replacements != 1:+ raise SystemExit("expected HttpClient vtable insertion point not found")++path.write_text(text)PYTHON_RUBY_PATCHwrite_ruby_facade \"$generated_root/ruby/cyclops_sdk/sdk.rb" \diff --git a/libs/fleet/scripts/run-browser-sdk-binding.sh b/libs/fleet/scripts/run-browser-sdk-binding.shnew file mode 100755index 0000000000..071b381700--- /dev/null+++ b/libs/fleet/scripts/run-browser-sdk-binding.sh@@ -0,0 +1,37 @@+#!/usr/bin/env bash+set -euo pipefail++repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"+binding_dir="$repo_root/cyclops-cs/sdk-bindings/ts-uniffi-browser"++for variable in CUA_CLIENT_ID CUA_CLIENT_SECRET CUA_TOKEN_URL CUA_BASE_URL CYCLOPS_NAMESPACE CUA_IMAGE CUA_IMAGE_PULL_SECRET; do+ if [ -z "${!variable:-}" ]; then+ echo "error: missing required environment variable: $variable" >&2+ exit 1+ fi+done++token_json="$(curl --fail --silent --show-error \+ --request POST \+ --url "$CUA_TOKEN_URL" \+ --header 'accept: application/json' \+ --header 'content-type: application/x-www-form-urlencoded' \+ --data-urlencode 'grant_type=client_credentials' \+ --data-urlencode "client_id=$CUA_CLIENT_ID" \+ --data-urlencode "client_secret=$CUA_CLIENT_SECRET")"+CYCLOPS_ACCESS_TOKEN="$(jq -er '.access_token | select(type == "string" and length > 0)' <<<"$token_json")"+export CYCLOPS_ACCESS_TOKEN++if [ "${GITHUB_ACTIONS:-}" = "true" ]; then+ echo "::add-mask::$CYCLOPS_ACCESS_TOKEN"+fi++"$repo_root/cyclops-cs/scripts/build-browser-sdk-binding.sh"+(+ cd "$binding_dir"+ ./node_modules/.bin/playwright test \+ --project=chromium \+ tests/browser-artifact.spec.ts \+ tests/browser-lifecycle.spec.ts \+ tests/browser-live.spec.ts+)diff --git a/libs/fleet/scripts/test-browser-sdk-bindings.sh b/libs/fleet/scripts/test-browser-sdk-bindings.shnew file mode 100755index 0000000000..97f1264504--- /dev/null+++ b/libs/fleet/scripts/test-browser-sdk-bindings.sh@@ -0,0 +1,12 @@+#!/usr/bin/env bash+set -euo pipefail++repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"+binding_file="$repo_root/cyclops-cs/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk.ts"++for symbol in AccessTokenProvider connectWithAccessTokenProvider connectWithAccessToken connectBrowserWithAccessToken; do+ if ! grep -Fq "$symbol" "$binding_file"; then+ echo "error: generated browser SDK binding is missing $symbol: $binding_file" >&2+ exit 1+ fi+donediff --git a/libs/fleet/scripts/test-generate-sdk-bindings.sh b/libs/fleet/scripts/test-generate-sdk-bindings.shindex 6eae66d31b..8490399783 100755--- a/libs/fleet/scripts/test-generate-sdk-bindings.sh+++ b/libs/fleet/scripts/test-generate-sdk-bindings.sh@@ -352,6 +352,29 @@ PYTHON_SMOKErm "$runtime_copy"runtime_copy="""$generator" --check+ruby_sdk_source="$bindings_dir/ruby/cyclops_sdk/sdk.rb"+grep -Fq -- "@uniffi_handle_map = UniffiHandleMap.new" "$ruby_sdk_source" || fail "Ruby callback bindings do not retain native callback objects"+grep -Fq -- "module UniffiCallbackInterfaceHttpClient" "$ruby_sdk_source" || fail "Ruby callback bindings do not register an HTTP callback vtable"+grep -Fq -- "[VTableCallbackInterfaceHttpClient.by_ref]" "$ruby_sdk_source" || fail "Ruby callback vtable initializer has the wrong FFI signature"+grep -Fq -- "def self.uniffi_rust_future_rust_buffer" "$ruby_sdk_source" || fail "Ruby bindings do not resolve Rust-buffer futures"+grep -Fq -- "def self.uniffi_trait_interface_call" "$ruby_sdk_source" || fail "Ruby callback bindings do not report callback results to Rust"+grep -Fq -- "def self.uniffi_lower_http_error" "$ruby_sdk_source" || fail "Ruby callback bindings do not serialize HttpError values"+grep -Fq -- "builder.write_U32(1)" "$ruby_sdk_source" || fail "Ruby callback bindings encode HttpError variant tags"+grep -Fq -- "reason = reason.fetch(:reason)" "$ruby_sdk_source" || fail "Ruby callback bindings normalize HttpError keyword payloads"+grep -Fq -- "def self.uniffi_is_error_type?" "$ruby_sdk_source" || fail "Ruby callback bindings do not classify callback errors"+grep -Fq -- "CyclopsSdk.uniffi_rust_future_rust_buffer" "$ruby_sdk_source" || fail "Ruby async methods do not resolve Rust-buffer futures"+grep -Fq -- "def self.uniffi_rust_future_void" "$ruby_sdk_source" || fail "Ruby bindings do not resolve void futures"+grep -Fq -- "CyclopsSdk.uniffi_rust_future_void" "$ruby_sdk_source" || fail "Ruby async void methods do not resolve Rust futures"+grep -Fq -- "UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_create_pool(uniffi_clone_handle(),RustBuffer.alloc_from_TypeCreatePoolRequest(request),RustCallStatus.new)" "$ruby_sdk_source" || fail "Ruby async factories do not pass the generated status placeholder"+grep -Fq -- " readTypePoolSpec" "$bindings_dir/ruby/cyclops_sdk.rb" || fail "Ruby facade does not delegate schema record readers"+if grep -Fq -- "OsGym" "$ruby_sdk_source"; then+ fail "Ruby SDK retains cross-crate OsGym helper names"+fi+grep -Fq -- " readTypeOSGymWorkspacePoolStatus" "$bindings_dir/ruby/cyclops_sdk.rb" || fail "Ruby facade does not delegate schema optional readers"+if grep -Fq -- "return 0 if @handle.nil?" "$ruby_sdk_source"; then+ fail "Ruby callback bindings lower native callbacks to an invalid zero handle"+fi+baseline_hash="$(tree_hash "$bindings_dir")"assert_no_harness_artifactsdiff --git a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/cyclops_sdk.kt b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/cyclops_sdk.ktindex 1097a60bff..2a16865d34 100644--- a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/cyclops_sdk.kt+++ b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/cyclops_sdk.kt@@ -632,9 +632,31 @@ internal open class UniffiForeignFutureResultVoid(internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback {fun callback(`callbackData`: Long,`result`: UniffiForeignFutureResultVoid.UniffiByValue,)}+internal interface UniffiCallbackInterfaceAccessTokenProviderMethod0 : com.sun.jna.Callback {+ fun callback(`uniffiHandle`: Long,`forceRefresh`: Byte,`uniffiFutureCallback`: UniffiForeignFutureCompleteRustBuffer,`uniffiCallbackData`: Long,`uniffiOutDroppedCallback`: UniffiForeignFutureDroppedCallbackStruct,)+}internal interface UniffiCallbackInterfaceHttpClientMethod0 : com.sun.jna.Callback {fun callback(`uniffiHandle`: Long,`request`: RustBuffer.ByValue,`uniffiFutureCallback`: UniffiForeignFutureCompleteRustBuffer,`uniffiCallbackData`: Long,`uniffiOutDroppedCallback`: UniffiForeignFutureDroppedCallbackStruct,)}[email protected]("uniffiFree", "uniffiClone", "getAccessToken")+internal open class UniffiVTableCallbackInterfaceAccessTokenProvider(+ @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null,+ @JvmField internal var `uniffiClone`: UniffiCallbackInterfaceClone? = null,+ @JvmField internal var `getAccessToken`: UniffiCallbackInterfaceAccessTokenProviderMethod0? = null,+) : Structure() {+ class UniffiByValue(+ `uniffiFree`: UniffiCallbackInterfaceFree? = null,+ `uniffiClone`: UniffiCallbackInterfaceClone? = null,+ `getAccessToken`: UniffiCallbackInterfaceAccessTokenProviderMethod0? = null,+ ): UniffiVTableCallbackInterfaceAccessTokenProvider(`uniffiFree`,`uniffiClone`,`getAccessToken`,), Structure.ByValue++ internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceAccessTokenProvider) {+ `uniffiFree` = other.`uniffiFree`+ `uniffiClone` = other.`uniffiClone`+ `getAccessToken` = other.`getAccessToken`+ }++}@Structure.FieldOrder("uniffiFree", "uniffiClone", "execute")internal open class UniffiVTableCallbackInterfaceHttpClient(@JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null,@@ -699,10 +721,18 @@ internal object IntegrityCheckingUniffiLib {): Shortexternal fun uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request(): Short+ external fun uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token(+ ): Shortexternal fun uniffi_cyclops_sdk_checksum_method_httpclient_execute(): Shortexternal fun uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect(): Short+ external fun uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token(+ ): Short+ external fun uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token(+ ): Short+ external fun uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider(+ ): Shortexternal fun uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new(): Shortexternal fun ffi_cyclops_sdk_uniffi_contract_version(@@ -721,6 +751,7 @@ internal object UniffiLib {init {Native.register(UniffiLib::class.java, findLibraryName(componentName = "cyclops_sdk"))+ uniffiCallbackInterfaceAccessTokenProvider.register(this)uniffiCallbackInterfaceHttpClient.register(this)ai.cua.cyclops.sdk.schema.uniffiEnsureInitialized()@@ -731,6 +762,12 @@ internal object UniffiLib {): Unitexternal fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect(`configuration`: RustBuffer.ByValue,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,): Long+ external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,+ ): Long+ external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token(`configuration`: RustBuffer.ByValue,`accessToken`: RustBuffer.ByValue,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,+ ): Long+ external fun uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(`configuration`: RustBuffer.ByValue,`tokenProvider`: Long,`httpClient`: Long,uniffi_out_err: UniffiRustCallStatus,+ ): Longexternal fun uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(`ptr`: Long,`request`: RustBuffer.ByValue,): Longexternal fun uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_claim(`ptr`: Long,`claim`: RustBuffer.ByValue,@@ -753,6 +790,14 @@ internal object UniffiLib {): Longexternal fun uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(`ptr`: Long,`sandbox`: RustBuffer.ByValue,`service`: RustBuffer.ByValue,`path`: RustBuffer.ByValue,`request`: RustBuffer.ByValue,): Long+ external fun uniffi_cyclops_sdk_fn_clone_accesstokenprovider(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,+ ): Long+ external fun uniffi_cyclops_sdk_fn_free_accesstokenprovider(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,+ ): Unit+ external fun uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(`vtable`: UniffiVTableCallbackInterfaceAccessTokenProvider,+ ): Unit+ external fun uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(`ptr`: Long,`forceRefresh`: Byte,+ ): Longexternal fun uniffi_cyclops_sdk_fn_clone_httpclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,): Longexternal fun uniffi_cyclops_sdk_fn_free_httpclient(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,@@ -919,12 +964,24 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {if (lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request() != 46699.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}+ if (lib.uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token() != 1180.toShort()) {+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ }if (lib.uniffi_cyclops_sdk_checksum_method_httpclient_execute() != 38803.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() != 54404.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}+ if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token() != 55589.toShort()) {+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ }+ if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token() != 10148.toShort()) {+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ }+ if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider() != 58487.toShort()) {+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ }if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() != 25746.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}@@ -1314,6 +1371,29 @@ public object FfiConverterULong: FfiConverter<ULong, Long> {}}+/**+ * @suppress+ */+public object FfiConverterBoolean: FfiConverter<Boolean, Byte> {+ override fun lift(value: Byte): Boolean {+ return value.toInt() != 0+ }++ override fun read(buf: ByteBuffer): Boolean {+ return lift(buf.get())+ }++ override fun lower(value: Boolean): Byte {+ return if (value) 1.toByte() else 0.toByte()+ }++ override fun allocationSize(value: Boolean) = 1UL++ override fun write(value: Boolean, buf: ByteBuffer) {+ buf.put(lower(value))+ }+}+/*** @suppress*/@@ -1486,6 +1566,342 @@ public object FfiConverterByteArray: FfiConverterRustBuffer<ByteArray> {//+public interface AccessTokenProvider {++ suspend fun `getAccessToken`(`forceRefresh`: kotlin.Boolean): kotlin.String++ companion object+}++open class AccessTokenProviderImpl: Disposable, AutoCloseable, AccessTokenProvider+{++ @Suppress("UNUSED_PARAMETER")+ /**+ * @suppress+ */+ constructor(withHandle: UniffiWithHandle, handle: Long) {+ this.handle = handle+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))+ }++ /**+ * @suppress+ *+ * This constructor can be used to instantiate a fake object. Only used for tests. Any+ * attempt to actually use an object constructed this way will fail as there is no+ * connected Rust object.+ */+ @Suppress("UNUSED_PARAMETER")+ constructor(noHandle: NoHandle) {+ this.handle = 0+ this.cleanable = null+ }++ protected val handle: Long+ protected val cleanable: UniffiCleaner.Cleanable?++ private val wasDestroyed = AtomicBoolean(false)+ private val callCounter = AtomicLong(1)++ override fun destroy() {+ // Only allow a single call to this method.+ // TODO: maybe we should log a warning if called more than once?+ if (this.wasDestroyed.compareAndSet(false, true)) {+ // This decrement always matches the initial count of 1 given at creation time.+ if (this.callCounter.decrementAndGet() == 0L) {+ cleanable?.clean()+ }+ }+ }++ @Synchronized+ override fun close() {+ this.destroy()+ }++ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {+ // Check and increment the call counter, to keep the object alive.+ // This needs a compare-and-set retry loop in case of concurrent updates.+ do {+ val c = this.callCounter.get()+ if (c == 0L) {+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")+ }+ if (c == Long.MAX_VALUE) {+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")+ }+ } while (! this.callCounter.compareAndSet(c, c + 1L))+ // Now we can safely do the method call without the handle being freed concurrently.+ try {+ return block(this.uniffiCloneHandle())+ } finally {+ // This decrement always matches the increment we performed above.+ if (this.callCounter.decrementAndGet() == 0L) {+ cleanable?.clean()+ }+ }+ }++ // Use a static inner class instead of a closure so as not to accidentally+ // capture `this` as part of the cleanable's action.+ private class UniffiCleanAction(private val handle: Long) : Runnable {+ override fun run() {+ if (handle == 0.toLong()) {+ // Fake object created with `NoHandle`, don't try to free.+ return;+ }+ uniffiRustCall { status ->+ UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider(handle, status)+ }+ }+ }++ /**+ * @suppress+ */+ fun uniffiCloneHandle(): Long {+ if (handle == 0.toLong()) {+ throw InternalException("uniffiCloneHandle() called on NoHandle object");+ }+ return uniffiRustCall() { status ->+ UniffiLib.uniffi_cyclops_sdk_fn_clone_accesstokenprovider(handle, status)+ }+ }+++ @Throws(AccessTokenProviderException::class)+ @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")+ override suspend fun `getAccessToken`(`forceRefresh`: kotlin.Boolean) : kotlin.String {+ return uniffiRustCallAsync(+ callWithHandle { uniffiHandle ->+ UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(+ uniffiHandle,+ FfiConverterBoolean.lower(`forceRefresh`),+ )+ },+ { future, callback, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_poll_rust_buffer(future, callback, continuation) },+ { future, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_complete_rust_buffer(future, continuation) },+ { future -> UniffiLib.ffi_cyclops_sdk_rust_future_free_rust_buffer(future) },+ // lift function+ { FfiConverterString.lift(it) },+ // Error FFI converter+ AccessTokenProviderException.ErrorHandler,+ )+ }+++++++++ /**+ * @suppress+ */+ companion object++}++++// Put the implementation in an object so we don't pollute the top-level namespace+internal object uniffiCallbackInterfaceAccessTokenProvider {+ internal object `getAccessToken`: UniffiCallbackInterfaceAccessTokenProviderMethod0 {+ override fun callback(`uniffiHandle`: Long,`forceRefresh`: Byte,`uniffiFutureCallback`: UniffiForeignFutureCompleteRustBuffer,`uniffiCallbackData`: Long,`uniffiOutDroppedCallback`: UniffiForeignFutureDroppedCallbackStruct,) {+ val uniffiObj = FfiConverterTypeAccessTokenProvider.handleMap.get(uniffiHandle)+ val makeCall = suspend { ->+ uniffiObj.`getAccessToken`(+ FfiConverterBoolean.lift(`forceRefresh`),+ )+ }+ val uniffiHandleSuccess = { returnValue: kotlin.String ->+ val uniffiResult = UniffiForeignFutureResultRustBuffer.UniffiByValue(+ FfiConverterString.lower(returnValue),+ UniffiRustCallStatus.ByValue()+ )+ uniffiResult.write()+ uniffiFutureCallback.callback(uniffiCallbackData, uniffiResult)+ }+ val uniffiHandleError = { callStatus: UniffiRustCallStatus.ByValue ->+ uniffiFutureCallback.callback(+ uniffiCallbackData,+ UniffiForeignFutureResultRustBuffer.UniffiByValue(+ RustBuffer.ByValue(),+ callStatus,+ ),+ )+ }+ uniffiTraitInterfaceCallAsyncWithError(+ makeCall,+ uniffiHandleSuccess,+ uniffiHandleError,+ { e: AccessTokenProviderException -> FfiConverterTypeAccessTokenProviderError.lower(e) },+ uniffiOutDroppedCallback+ )+ }+ }++ internal object uniffiFree: UniffiCallbackInterfaceFree {+ override fun callback(handle: Long) {+ FfiConverterTypeAccessTokenProvider.handleMap.remove(handle)+ }+ }++ internal object uniffiClone: UniffiCallbackInterfaceClone {+ override fun callback(handle: Long): Long {+ return FfiConverterTypeAccessTokenProvider.handleMap.clone(handle)+ }+ }++ internal var vtable = UniffiVTableCallbackInterfaceAccessTokenProvider.UniffiByValue(+ uniffiFree,+ uniffiClone,+ `getAccessToken`,+ )++ // Registers the foreign callback with the Rust side.+ // This method is generated for each callback interface.+ internal fun register(lib: UniffiLib) {+ lib.uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(vtable)+ }+}++/**+ * @suppress+ */+public object FfiConverterTypeAccessTokenProvider: FfiConverter<AccessTokenProvider, Long> {+ internal val handleMap = UniffiHandleMap<AccessTokenProvider>()++ override fun lower(value: AccessTokenProvider): Long {+ if (value is AccessTokenProviderImpl) {+ // Rust-implemented object. Clone the handle and return it+ return value.uniffiCloneHandle()+ } else {+ // Kotlin object, generate a new vtable handle and return that.+ return handleMap.insert(value)+ }+ }++ override fun lift(value: Long): AccessTokenProvider {+ if ((value and 1.toLong()) == 0.toLong()) {+ // Rust-generated handle, construct a new class that uses the handle to implement the+ // interface+ return AccessTokenProviderImpl(UniffiWithHandle, value)+ } else {+ // Kotlin-generated handle, get the object from the handle map+ return handleMap.remove(value)+ }+ }++ override fun read(buf: ByteBuffer): AccessTokenProvider {+ return lift(buf.getLong())+ }++ override fun allocationSize(value: AccessTokenProvider) = 8UL++ override fun write(value: AccessTokenProvider, buf: ByteBuffer) {+ buf.putLong(lower(value))+ }+}+++// This template implements a class for working with a Rust struct via a handle+// to the live Rust struct on the other side of the FFI.+//+// There's some subtlety here, because we have to be careful not to operate on a Rust+// struct after it has been dropped, and because we must expose a public API for freeing+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:+//+// * Each instance holds an opaque handle to the underlying Rust struct.+// Method calls need to read this handle from the object's state and pass it in to+// the Rust FFI.+//+// * When an instance is no longer needed, its handle should be passed to a+// special destructor function provided by the Rust FFI, which will drop the+// underlying Rust struct.+//+// * Given an instance, calling code is expected to call the special+// `destroy` method in order to free it after use, either by calling it explicitly+// or by using a higher-level helper like the `use` method. Failing to do so risks+// leaking the underlying Rust struct.+//+// * We can't assume that calling code will do the right thing, and must be prepared+// to handle Kotlin method calls executing concurrently with or even after a call to+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.+//+// * We must never allow Rust code to operate on the underlying Rust struct after+// the destructor has been called, and must never call the destructor more than once.+// Doing so may trigger memory unsafety.+//+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`+// is implemented to call the destructor when the Kotlin object becomes unreachable.+// This is done in a background thread. This is not a panacea, and client code should be aware that+// 1. the thread may starve if some there are objects that have poorly performing+// `drop` methods or do significant work in their `drop` methods.+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).+//+// If we try to implement this with mutual exclusion on access to the handle, there is the+// possibility of a race between a method call and a concurrent call to `destroy`:+//+// * Thread A starts a method call, reads the value of the handle, but is interrupted+// before it can pass the handle over the FFI to Rust.+// * Thread B calls `destroy` and frees the underlying Rust struct.+// * Thread A resumes, passing the already-read handle value to Rust and triggering+// a use-after-free.+//+// One possible solution would be to use a `ReadWriteLock`, with each method call taking+// a read lock (and thus allowed to run concurrently) and the special `destroy` method+// taking a write lock (and thus blocking on live method calls). However, we aim not to+// generate methods with any hidden blocking semantics, and a `destroy` method that might+// block if called incorrectly seems to meet that bar.+//+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`+// has been called. These are updated according to the following rules:+//+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.+// The initial value for the flag is false.+//+// * At the start of each method call, we atomically check the counter.+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.+//+// * At the end of each method call, we atomically decrement and check the counter.+// If it has reached zero then we destroy the underlying Rust struct.+//+// * When `destroy` is called, we atomically flip the flag from false to true.+// If the flag was already true we silently fail.+// Otherwise we atomically decrement and check the counter.+// If it has reached zero then we destroy the underlying Rust struct.+//+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.+//+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations+// of the underlying Rust code.+//+// This makes a cleaner a better alternative to _not_ calling `destroy()` as+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner+// thread may be starved, and the app will leak memory.+//+// In this case, `destroy`ing manually may be a better solution.+//+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects+// with Rust peers are reclaimed:+//+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:+// 3. The memory is reclaimed when the process terminates.+//+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219+//++public interface CyclopsClientInterface {suspend fun `createClaim`(`request`: CreateClaimRequest): Claim@@ -1862,6 +2278,42 @@ open class CyclopsClient: Disposable, AutoCloseable, CyclopsClientInterface+ @Throws(SdkException::class) fun `connectBrowserWithAccessToken`(`configuration`: CyclopsTokenProviderConfiguration, `accessToken`: kotlin.String): CyclopsClient {+ return FfiConverterTypeCyclopsClient.lift(+ uniffiRustCallWithError(SdkException) { _status ->+ UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token(++ FfiConverterTypeCyclopsTokenProviderConfiguration.lower(`configuration`),FfiConverterString.lower(`accessToken`),_status)+}+ )+ }++++ @Throws(SdkException::class) fun `connectWithAccessToken`(`configuration`: CyclopsTokenProviderConfiguration, `accessToken`: kotlin.String, `httpClient`: HttpClient): CyclopsClient {+ return FfiConverterTypeCyclopsClient.lift(+ uniffiRustCallWithError(SdkException) { _status ->+ UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token(++ FfiConverterTypeCyclopsTokenProviderConfiguration.lower(`configuration`),FfiConverterString.lower(`accessToken`),FfiConverterTypeHttpClient.lower(`httpClient`),_status)+}+ )+ }++++ @Throws(SdkException::class) fun `connectWithAccessTokenProvider`(`configuration`: CyclopsTokenProviderConfiguration, `tokenProvider`: AccessTokenProvider, `httpClient`: HttpClient): CyclopsClient {+ return FfiConverterTypeCyclopsClient.lift(+ uniffiRustCallWithError(SdkException) { _status ->+ UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(++ FfiConverterTypeCyclopsTokenProviderConfiguration.lower(`configuration`),FfiConverterTypeAccessTokenProvider.lower(`tokenProvider`),FfiConverterTypeHttpClient.lower(`httpClient`),_status)+}+ )+ }+++}}@@ -2677,6 +3129,59 @@ public object FfiConverterTypeCyclopsConfiguration: FfiConverterRustBuffer<Cyclo+data class CyclopsTokenProviderConfiguration (+ var `baseUrl`: kotlin.String+ ,+ var `poolPollIntervalMs`: kotlin.ULong+ ,+ var `poolPollLimit`: kotlin.UInt+ ,+ var `claimPollIntervalMs`: kotlin.ULong+ ,+ var `claimPollLimit`: kotlin.UInt++){++++++ companion object+}++/**+ * @suppress+ */+public object FfiConverterTypeCyclopsTokenProviderConfiguration: FfiConverterRustBuffer<CyclopsTokenProviderConfiguration> {+ override fun read(buf: ByteBuffer): CyclopsTokenProviderConfiguration {+ return CyclopsTokenProviderConfiguration(+ FfiConverterString.read(buf),+ FfiConverterULong.read(buf),+ FfiConverterUInt.read(buf),+ FfiConverterULong.read(buf),+ FfiConverterUInt.read(buf),+ )+ }++ override fun allocationSize(value: CyclopsTokenProviderConfiguration) = (+ FfiConverterString.allocationSize(value.`baseUrl`) ++ FfiConverterULong.allocationSize(value.`poolPollIntervalMs`) ++ FfiConverterUInt.allocationSize(value.`poolPollLimit`) ++ FfiConverterULong.allocationSize(value.`claimPollIntervalMs`) ++ FfiConverterUInt.allocationSize(value.`claimPollLimit`)+ )++ override fun write(value: CyclopsTokenProviderConfiguration, buf: ByteBuffer) {+ FfiConverterString.write(value.`baseUrl`, buf)+ FfiConverterULong.write(value.`poolPollIntervalMs`, buf)+ FfiConverterUInt.write(value.`poolPollLimit`, buf)+ FfiConverterULong.write(value.`claimPollIntervalMs`, buf)+ FfiConverterUInt.write(value.`claimPollLimit`, buf)+ }+}+++data class HttpHeader (var `name`: kotlin.String,@@ -2956,6 +3461,68 @@ public object FfiConverterTypeSandbox: FfiConverterRustBuffer<Sandbox> {+sealed class AccessTokenProviderException: kotlin.Exception() {++ class Failed(++ val `reason`: kotlin.String+ ) : AccessTokenProviderException() {+ override val message+ get() = "reason=${ `reason` }"+ }++++++ companion object ErrorHandler : UniffiRustCallStatusErrorHandler<AccessTokenProviderException> {+ override fun lift(error_buf: RustBuffer.ByValue): AccessTokenProviderException = FfiConverterTypeAccessTokenProviderError.lift(error_buf)+ }+++}++/**+ * @suppress+ */+public object FfiConverterTypeAccessTokenProviderError : FfiConverterRustBuffer<AccessTokenProviderException> {+ override fun read(buf: ByteBuffer): AccessTokenProviderException {+++ return when(buf.getInt()) {+ 1 -> AccessTokenProviderException.Failed(+ FfiConverterString.read(buf),+ )+ else -> throw RuntimeException("invalid error enum value, something is very wrong!!")+ }+ }++ override fun allocationSize(value: AccessTokenProviderException): ULong {+ return when(value) {+ is AccessTokenProviderException.Failed -> (+ // Add the size for the Int that specifies the variant plus the size needed for all fields+ 4UL+ + FfiConverterString.allocationSize(value.`reason`)+ )+ }+ }++ override fun write(value: AccessTokenProviderException, buf: ByteBuffer) {+ when(value) {+ is AccessTokenProviderException.Failed -> {+ buf.putInt(1)+ FfiConverterString.write(value.`reason`, buf)+ Unit+ }+ }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }+ }++}+++++sealed class HttpException: kotlin.Exception() {class Transport(diff --git a/libs/fleet/sdk-bindings/python/cyclops_sdk/_sdk.py b/libs/fleet/sdk-bindings/python/cyclops_sdk/_sdk.pyindex 57b8d0bd63..8408cc670b 100644--- a/libs/fleet/sdk-bindings/python/cyclops_sdk/_sdk.py+++ b/libs/fleet/sdk-bindings/python/cyclops_sdk/_sdk.py@@ -480,8 +480,16 @@ def _uniffi_check_contract_api_version(lib):raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")def _uniffi_check_api_checksums(lib):+ if lib.uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token() != 1180:+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")if lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() != 54404:raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ if lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token() != 55589:+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ if lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token() != 10148:+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ if lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider() != 58487:+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")if lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_claim() != 23330:raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")if lib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_pool() != 48557:@@ -771,6 +779,16 @@ _UniffiLib.ffi_cyclops_sdk_rust_future_free_void.argtypes = (ctypes.c_uint64,)_UniffiLib.ffi_cyclops_sdk_rust_future_free_void.restype = None+_UniffiLib.uniffi_cyclops_sdk_fn_clone_accesstokenprovider.argtypes = (+ ctypes.c_uint64,+ ctypes.POINTER(_UniffiRustCallStatus),+)+_UniffiLib.uniffi_cyclops_sdk_fn_clone_accesstokenprovider.restype = ctypes.c_uint64+_UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider.argtypes = (+ ctypes.c_uint64,+ ctypes.POINTER(_UniffiRustCallStatus),+)+_UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider.restype = None_UniffiLib.uniffi_cyclops_sdk_fn_clone_cyclopsclient.argtypes = (ctypes.c_uint64,ctypes.POINTER(_UniffiRustCallStatus),@@ -808,6 +826,22 @@ class _UniffiForeignFutureResultRustBuffer(ctypes.Structure):]_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultRustBuffer,)+_UNIFFI_CALLBACK_INTERFACE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),+)+_UNIFFI_CALLBACK_INTERFACE_CLONE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64,+)+_UNIFFI_CALLBACK_INTERFACE_FREE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,+)+class _UniffiVTableCallbackInterfaceCyclopsSdkAccessTokenProvider(ctypes.Structure):+ _fields_ = [+ ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER),+ ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER),+ ("get_access_token", _UNIFFI_CALLBACK_INTERFACE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER_METHOD0),+ ]+_UniffiLib.uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider.argtypes = (+ ctypes.POINTER(_UniffiVTableCallbackInterfaceCyclopsSdkAccessTokenProvider),+)+_UniffiLib.uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider.restype = None_UNIFFI_CALLBACK_INTERFACE_CYCLOPS_SDK_HTTP_CLIENT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),)_UNIFFI_CALLBACK_INTERFACE_CLONE_CYCLOPS_SDK_HTTP_CLIENT = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64,@@ -824,12 +858,37 @@ _UniffiLib.uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient.argtypes = (ctypes.POINTER(_UniffiVTableCallbackInterfaceCyclopsSdkHttpClient),)_UniffiLib.uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient.restype = None+_UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token.argtypes = (+ ctypes.c_uint64,+ ctypes.c_int8,+)+_UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token.restype = ctypes.c_uint64_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect.argtypes = (_UniffiRustBuffer,ctypes.c_uint64,ctypes.POINTER(_UniffiRustCallStatus),)_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect.restype = ctypes.c_uint64+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token.argtypes = (+ _UniffiRustBuffer,+ _UniffiRustBuffer,+ ctypes.POINTER(_UniffiRustCallStatus),+)+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token.restype = ctypes.c_uint64+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token.argtypes = (+ _UniffiRustBuffer,+ _UniffiRustBuffer,+ ctypes.c_uint64,+ ctypes.POINTER(_UniffiRustCallStatus),+)+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token.restype = ctypes.c_uint64+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider.argtypes = (+ _UniffiRustBuffer,+ ctypes.c_uint64,+ ctypes.c_uint64,+ ctypes.POINTER(_UniffiRustCallStatus),+)+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider.restype = ctypes.c_uint64_UniffiLib.uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim.argtypes = (ctypes.c_uint64,_UniffiRustBuffer,@@ -902,9 +961,21 @@ _UniffiLib.uniffi_cyclops_sdk_fn_method_httpclient_execute.restype = ctypes.c_ui_UniffiLib.ffi_cyclops_sdk_uniffi_contract_version.argtypes = ()_UniffiLib.ffi_cyclops_sdk_uniffi_contract_version.restype = ctypes.c_uint32+_UniffiLib.uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token.argtypes = (+)+_UniffiLib.uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token.restype = ctypes.c_uint16_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect.argtypes = ()_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect.restype = ctypes.c_uint16+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token.argtypes = (+)+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token.restype = ctypes.c_uint16+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token.argtypes = (+)+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token.restype = ctypes.c_uint16+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider.argtypes = (+)+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider.restype = ctypes.c_uint16_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_claim.argtypes = ()_UniffiLib.uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_claim.restype = ctypes.c_uint16@@ -1639,6 +1710,60 @@ class _UniffiFfiConverterTypeCyclopsConfiguration(_UniffiConverterRustBuffer):_UniffiFfiConverterUInt64.write(value.claim_poll_interval_ms, buf)_UniffiFfiConverterUInt32.write(value.claim_poll_limit, buf)+@dataclass+class CyclopsTokenProviderConfiguration:+ def __init__(self, *, base_url:str, pool_poll_interval_ms:int, pool_poll_limit:int, claim_poll_interval_ms:int, claim_poll_limit:int):+ self.base_url = base_url+ self.pool_poll_interval_ms = pool_poll_interval_ms+ self.pool_poll_limit = pool_poll_limit+ self.claim_poll_interval_ms = claim_poll_interval_ms+ self.claim_poll_limit = claim_poll_limit+++++ def __str__(self):+ return "CyclopsTokenProviderConfiguration(base_url={}, pool_poll_interval_ms={}, pool_poll_limit={}, claim_poll_interval_ms={}, claim_poll_limit={})".format(self.base_url, self.pool_poll_interval_ms, self.pool_poll_limit, self.claim_poll_interval_ms, self.claim_poll_limit)+ def __eq__(self, other):+ if self.base_url != other.base_url:+ return False+ if self.pool_poll_interval_ms != other.pool_poll_interval_ms:+ return False+ if self.pool_poll_limit != other.pool_poll_limit:+ return False+ if self.claim_poll_interval_ms != other.claim_poll_interval_ms:+ return False+ if self.claim_poll_limit != other.claim_poll_limit:+ return False+ return True++class _UniffiFfiConverterTypeCyclopsTokenProviderConfiguration(_UniffiConverterRustBuffer):+ @staticmethod+ def read(buf):+ return CyclopsTokenProviderConfiguration(+ base_url=_UniffiFfiConverterString.read(buf),+ pool_poll_interval_ms=_UniffiFfiConverterUInt64.read(buf),+ pool_poll_limit=_UniffiFfiConverterUInt32.read(buf),+ claim_poll_interval_ms=_UniffiFfiConverterUInt64.read(buf),+ claim_poll_limit=_UniffiFfiConverterUInt32.read(buf),+ )++ @staticmethod+ def check_lower(value):+ _UniffiFfiConverterString.check_lower(value.base_url)+ _UniffiFfiConverterUInt64.check_lower(value.pool_poll_interval_ms)+ _UniffiFfiConverterUInt32.check_lower(value.pool_poll_limit)+ _UniffiFfiConverterUInt64.check_lower(value.claim_poll_interval_ms)+ _UniffiFfiConverterUInt32.check_lower(value.claim_poll_limit)++ @staticmethod+ def write(value, buf):+ _UniffiFfiConverterString.write(value.base_url, buf)+ _UniffiFfiConverterUInt64.write(value.pool_poll_interval_ms, buf)+ _UniffiFfiConverterUInt32.write(value.pool_poll_limit, buf)+ _UniffiFfiConverterUInt64.write(value.claim_poll_interval_ms, buf)+ _UniffiFfiConverterUInt32.write(value.claim_poll_limit, buf)+@dataclassclass HttpHeader:def __init__(self, *, name:str, value:str):@@ -1919,6 +2044,59 @@ class _UniffiFfiConverterTypeSandbox(_UniffiConverterRustBuffer):+# AccessTokenProviderError+# We want to define each variant as a nested class that's also a subclass,+# which is tricky in Python. To accomplish this we're going to create each+# class separately, then manually add the child classes to the base class's+# __dict__. All of this happens in dummy class to avoid polluting the module+# namespace.+class AccessTokenProviderError(Exception):+ pass++_UniffiTempAccessTokenProviderError = AccessTokenProviderError++class AccessTokenProviderError: # type: ignore++ class Failed(_UniffiTempAccessTokenProviderError):++ def __init__(self, reason):+ super().__init__(", ".join([+ "reason={!r}".format(reason),+ ]))+ self.reason = reason++ def __repr__(self):+ return "AccessTokenProviderError.Failed({})".format(str(self))+ _UniffiTempAccessTokenProviderError.Failed = Failed # type: ignore++AccessTokenProviderError = _UniffiTempAccessTokenProviderError # type: ignore+del _UniffiTempAccessTokenProviderError+++class _UniffiFfiConverterTypeAccessTokenProviderError(_UniffiConverterRustBuffer):+ @staticmethod+ def read(buf):+ variant = buf.read_i32()+ if variant == 1:+ return AccessTokenProviderError.Failed(+ _UniffiFfiConverterString.read(buf),+ )+ raise InternalError("Raw enum value doesn't match any cases")++ @staticmethod+ def check_lower(value):+ if isinstance(value, AccessTokenProviderError.Failed):+ _UniffiFfiConverterString.check_lower(value.reason)+ return++ @staticmethod+ def write(value, buf):+ if isinstance(value, AccessTokenProviderError.Failed):+ buf.write_i32(1)+ _UniffiFfiConverterString.write(value.reason, buf)+++# HttpError# We want to define each variant as a nested class that's also a subclass,# which is tricky in Python. To accomplish this we're going to create each@@ -2236,6 +2414,177 @@ class _UniffiFfiConverterTypeSdkError(_UniffiConverterRustBuffer):if isinstance(value, SdkError.ClaimTimeout):buf.write_i32(10)+class _UniffiFfiConverterBoolean:+ @classmethod+ def check_lower(cls, value):+ return not not value++ @classmethod+ def lower(cls, value):+ return 1 if value else 0++ @staticmethod+ def lift(value):+ return value != 0++ @classmethod+ def read(cls, buf):+ return cls.lift(buf.read_u8())++ @classmethod+ def write(cls, value, buf):+ buf.write_u8(value)+++class AccessTokenProvider():++ async def get_access_token(self, force_refresh: bool) -> str:+ raise NotImplementedError++class AccessTokenProviderImpl(AccessTokenProvider):++ _handle: ctypes.c_uint64++ def __init__(self, *args, **kwargs):+ raise ValueError("This class has no default constructor")++ def __del__(self):+ # In case of partial initialization of instances.+ handle = getattr(self, "_handle", None)+ if handle is not None:+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider, handle)++ def _uniffi_clone_handle(self):+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_fn_clone_accesstokenprovider, self._handle)++ # Used by alternative constructors or any methods which return this type.+ @classmethod+ def _uniffi_make_instance(cls, handle):+ # Lightly yucky way to bypass the usual __init__ logic+ # and just create a new instance with the required handle.+ inst = cls.__new__(cls)+ inst._handle = handle+ return inst+ async def get_access_token(self, force_refresh: bool) -> str:++ _UniffiFfiConverterBoolean.check_lower(force_refresh)+ _uniffi_lowered_args = (+ self._uniffi_clone_handle(),+ _UniffiFfiConverterBoolean.lower(force_refresh),+ )+ _uniffi_lift_return = _UniffiFfiConverterString.lift+ _uniffi_error_converter = _UniffiFfiConverterTypeAccessTokenProviderError+ return await _uniffi_rust_call_async(+ _UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(*_uniffi_lowered_args),+ _UniffiLib.ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ _UniffiLib.ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ _UniffiLib.ffi_cyclops_sdk_rust_future_free_rust_buffer,+ _uniffi_lift_return,+ _uniffi_error_converter,+ )+++++# Put all the bits inside a class to keep the top-level namespace clean+class _UniffiTraitImplAccessTokenProviderImpl:+ # For each method, generate a callback function to pass to Rust++ @_UNIFFI_CALLBACK_INTERFACE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER_METHOD0+ def get_access_token(+ uniffi_handle,+ force_refresh,+ uniffi_future_callback,+ uniffi_callback_data,+ uniffi_out_dropped_callback,+ ):+ uniffi_obj = _UniffiFfiConverterTypeAccessTokenProvider._handle_map.get(uniffi_handle)+ def make_call():+ uniffi_args = (_UniffiFfiConverterBoolean.lift(force_refresh), )+ uniffi_method = uniffi_obj.get_access_token+ return uniffi_method(*uniffi_args)+ def handle_success(return_value):+ uniffi_future_callback(+ uniffi_callback_data,+ _UniffiForeignFutureResultRustBuffer(+ _UniffiFfiConverterString.lower(return_value),+ _UniffiRustCallStatus.default()+ )+ )++ def handle_error(status_code, rust_buffer):+ uniffi_future_callback(+ uniffi_callback_data,+ _UniffiForeignFutureResultRustBuffer(+ _UniffiRustBuffer.default(),+ _UniffiRustCallStatus(status_code, rust_buffer),+ )+ )+ _uniffi_trait_interface_call_async_with_error(+ make_call,+ uniffi_out_dropped_callback,+ handle_success,+ handle_error,+ AccessTokenProviderError,+ _UniffiFfiConverterTypeAccessTokenProviderError.lower,+ )++ @_UNIFFI_CALLBACK_INTERFACE_FREE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER+ def _uniffi_free(uniffi_handle):+ _UniffiFfiConverterTypeAccessTokenProvider._handle_map.remove(uniffi_handle)++ @_UNIFFI_CALLBACK_INTERFACE_CLONE_CYCLOPS_SDK_ACCESS_TOKEN_PROVIDER+ def _uniffi_clone(uniffi_handle):+ return _UniffiFfiConverterTypeAccessTokenProvider._handle_map.clone(uniffi_handle)++ # Generate the FFI VTable. This has a field for each callback interface method.+ _uniffi_vtable = _UniffiVTableCallbackInterfaceCyclopsSdkAccessTokenProvider(+ _uniffi_free,+ _uniffi_clone,+ get_access_token,+ )+ # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,+ # or else bad things will happen when Rust tries to access it.+ _UniffiLib.uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(ctypes.byref(_uniffi_vtable))++class _UniffiFfiConverterTypeAccessTokenProvider:+ _handle_map = _UniffiHandleMap()++ @staticmethod+ def lift(value: int):+ if (value & 1) == 0:+ # Rust-generated handle, construct a new class that uses the handle to implement the+ # interface+ return AccessTokenProviderImpl._uniffi_make_instance(value)+ else:+ # Python-generated handle, get the object from the handle map+ return _UniffiFfiConverterTypeAccessTokenProvider._handle_map.remove(value)++ @staticmethod+ def check_lower(value: AccessTokenProvider):+ if not isinstance(value, AccessTokenProvider):+ raise TypeError("Expected AccessTokenProvider subclass, {} found".format(type(value).__name__))++ @staticmethod+ def lower(value: AccessTokenProvider):+ if isinstance(value, AccessTokenProviderImpl):+ # Rust-implementated object. Clone the handle and return it+ return value._uniffi_clone_handle()+ else:+ # Python-implementated object, generate a new vtable handle and return that.+ return _UniffiFfiConverterTypeAccessTokenProvider._handle_map.insert(value)++ @classmethod+ def read(cls, buf: _UniffiRustBuffer):+ ptr = buf.read_u64()+ if ptr == 0:+ raise InternalError("Raw handle value was null")+ return cls.lift(ptr)++ @classmethod+ def write(cls, value: AccessTokenProvider, buf: _UniffiRustBuffer):+ buf.write_u64(cls.lower(value))+class _UniffiFfiConverterSequenceTypeClaim(_UniffiConverterRustBuffer):@classmethoddef check_lower(cls, value):@@ -2329,6 +2678,66 @@ class CyclopsClient(CyclopsClientProtocol):*_uniffi_lowered_args,)return cls._uniffi_make_instance(_uniffi_ffi_result)+ @classmethod+ def connect_browser_with_access_token(cls, configuration: CyclopsTokenProviderConfiguration,access_token: str) -> CyclopsClient:++ _UniffiFfiConverterTypeCyclopsTokenProviderConfiguration.check_lower(configuration)++ _UniffiFfiConverterString.check_lower(access_token)+ _uniffi_lowered_args = (+ _UniffiFfiConverterTypeCyclopsTokenProviderConfiguration.lower(configuration),+ _UniffiFfiConverterString.lower(access_token),+ )+ _uniffi_lift_return = _UniffiFfiConverterTypeCyclopsClient.lift+ _uniffi_error_converter = _UniffiFfiConverterTypeSdkError+ _uniffi_ffi_result = _uniffi_rust_call_with_error(+ _uniffi_error_converter,+ _UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token,+ *_uniffi_lowered_args,+ )+ return cls._uniffi_make_instance(_uniffi_ffi_result)+ @classmethod+ def connect_with_access_token(cls, configuration: CyclopsTokenProviderConfiguration,access_token: str,http_client: HttpClient) -> CyclopsClient:++ _UniffiFfiConverterTypeCyclopsTokenProviderConfiguration.check_lower(configuration)++ _UniffiFfiConverterString.check_lower(access_token)++ _UniffiFfiConverterTypeHttpClient.check_lower(http_client)+ _uniffi_lowered_args = (+ _UniffiFfiConverterTypeCyclopsTokenProviderConfiguration.lower(configuration),+ _UniffiFfiConverterString.lower(access_token),+ _UniffiFfiConverterTypeHttpClient.lower(http_client),+ )+ _uniffi_lift_return = _UniffiFfiConverterTypeCyclopsClient.lift+ _uniffi_error_converter = _UniffiFfiConverterTypeSdkError+ _uniffi_ffi_result = _uniffi_rust_call_with_error(+ _uniffi_error_converter,+ _UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token,+ *_uniffi_lowered_args,+ )+ return cls._uniffi_make_instance(_uniffi_ffi_result)+ @classmethod+ def connect_with_access_token_provider(cls, configuration: CyclopsTokenProviderConfiguration,token_provider: AccessTokenProvider,http_client: HttpClient) -> CyclopsClient:++ _UniffiFfiConverterTypeCyclopsTokenProviderConfiguration.check_lower(configuration)++ _UniffiFfiConverterTypeAccessTokenProvider.check_lower(token_provider)++ _UniffiFfiConverterTypeHttpClient.check_lower(http_client)+ _uniffi_lowered_args = (+ _UniffiFfiConverterTypeCyclopsTokenProviderConfiguration.lower(configuration),+ _UniffiFfiConverterTypeAccessTokenProvider.lower(token_provider),+ _UniffiFfiConverterTypeHttpClient.lower(http_client),+ )+ _uniffi_lift_return = _UniffiFfiConverterTypeCyclopsClient.lift+ _uniffi_error_converter = _UniffiFfiConverterTypeSdkError+ _uniffi_ffi_result = _uniffi_rust_call_with_error(+ _uniffi_error_converter,+ _UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider,+ *_uniffi_lowered_args,+ )+ return cls._uniffi_make_instance(_uniffi_ffi_result)def __init__(self, *args, **kwargs):raise ValueError("This class has no default constructor")@@ -2741,6 +3150,7 @@ class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt):__all__ = ["InternalError",+ "AccessTokenProviderError","HttpError","SdkError","ResourceMetadata",@@ -2749,12 +3159,15 @@ __all__ = ["CreateClaimRequest","CreatePoolRequest","CyclopsConfiguration",+ "CyclopsTokenProviderConfiguration","HttpHeader","HttpRequest","HttpResponse","Sandbox","CyclopsCredentials","CyclopsCredentialsProtocol",+ "AccessTokenProviderImpl",+ "AccessTokenProvider","CyclopsClient","CyclopsClientProtocol","HttpClientImpl",diff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rbindex 542f4369e0..808451957d 100644--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rb+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rb@@ -12,11 +12,15 @@ module CyclopsSdkcheck_lower_TypePoolSpec].freezeSCHEMA_READ_METHODS = %i[+ readTypeClaimSpec+ readTypeOSGymSandboxClaimStatus+ readTypeOSGymWorkspacePoolStatus+ readTypePoolSpec].freezeSCHEMA_WRITE_METHODS = %i[write_TypeClaimSpec- write_TypeOsGymSandboxClaimStatus- write_TypeOsGymWorkspacePoolStatus+ write_TypeOSGymSandboxClaimStatus+ write_TypeOSGymWorkspacePoolStatuswrite_TypePoolSpec].freezediff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rbindex a5f152f6e8..7eff16b74c 100644--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb@@ -201,8 +201,8 @@ enddef self.check_lower_TypeOSGymSandboxClaimStatus(v)RustBuffer.check_lower_Optionalstring(v.phase)- RustBuffer.check_lower_OptionalSequenceTypeOsGymSandboxClaimCondition(v.conditions)- RustBuffer.check_lower_OptionalTypeOsGymSandboxClaimSandbox(v.sandbox)+ RustBuffer.check_lower_OptionalSequenceTypeOSGymSandboxClaimCondition(v.conditions)+ RustBuffer.check_lower_OptionalTypeOSGymSandboxClaimSandbox(v.sandbox)enddef self.alloc_from_TypeOSGymSandboxClaimStatus(v)@@ -701,7 +701,7 @@ enddef self.check_lower_OptionalTypeOSGymSandboxClaimSandbox(v)if not v.nil?- RustBuffer.check_lower_TypeOsGymSandboxClaimSandbox(v)+ RustBuffer.check_lower_TypeOSGymSandboxClaimSandbox(v)endend@@ -890,7 +890,7 @@ enddef self.check_lower_OptionalSequenceTypeOSGymSandboxClaimCondition(v)if not v.nil?- RustBuffer.check_lower_SequenceTypeOsGymSandboxClaimCondition(v)+ RustBuffer.check_lower_SequenceTypeOSGymSandboxClaimCondition(v)endend@@ -995,7 +995,7 @@ enddef self.check_lower_SequenceTypeOSGymSandboxClaimCondition(v)v.each do |item|- RustBuffer.check_lower_TypeOsGymSandboxClaimCondition(item)+ RustBuffer.check_lower_TypeOSGymSandboxClaimCondition(item)endend@@ -1158,8 +1158,8 @@ class RustBufferStream# The Record type OSGymSandboxClaimCondition.- def readTypeOsGymSandboxClaimCondition- OsGymSandboxClaimCondition.new(+ def readTypeOSGymSandboxClaimCondition+ OSGymSandboxClaimCondition.new(type: readOptionalstring,status: readOptionalstring,reason: readOptionalstring,@@ -1170,8 +1170,8 @@ class RustBufferStream# The Record type OSGymSandboxClaimSandbox.- def readTypeOsGymSandboxClaimSandbox- OsGymSandboxClaimSandbox.new(+ def readTypeOSGymSandboxClaimSandbox+ OSGymSandboxClaimSandbox.new(name: readOptionalstring,service: readOptionalstring)@@ -1179,26 +1179,26 @@ class RustBufferStream# The Record type OSGymSandboxClaimStatus.- def readTypeOsGymSandboxClaimStatus- OsGymSandboxClaimStatus.new(+ def readTypeOSGymSandboxClaimStatus+ OSGymSandboxClaimStatus.new(phase: readOptionalstring,- conditions: readOptionalSequenceTypeOsGymSandboxClaimCondition,- sandbox: readOptionalTypeOsGymSandboxClaimSandbox+ conditions: readOptionalSequenceTypeOSGymSandboxClaimCondition,+ sandbox: readOptionalTypeOSGymSandboxClaimSandbox)end# The Record type OSGymSandboxSpec.- def readTypeOsGymSandboxSpec- OsGymSandboxSpec.new(+ def readTypeOSGymSandboxSpec+ OSGymSandboxSpec.new(vm_template: readTypeVmTemplate)end# The Record type OSGymSandboxStatus.- def readTypeOsGymSandboxStatus- OsGymSandboxStatus.new(+ def readTypeOSGymSandboxStatus+ OSGymSandboxStatus.new(phase: readOptionalstring,runtime: readOptionalstring,ready: readOptionalbool,@@ -1212,16 +1212,16 @@ class RustBufferStream# The Record type OSGymSandboxTemplateSpec.- def readTypeOsGymSandboxTemplateSpec- OsGymSandboxTemplateSpec.new(+ def readTypeOSGymSandboxTemplateSpec+ OSGymSandboxTemplateSpec.new(vm_template: readTypeVmTemplate)end# The Record type OSGymSandboxWarmPoolSpec.- def readTypeOsGymSandboxWarmPoolSpec- OsGymSandboxWarmPoolSpec.new(+ def readTypeOSGymSandboxWarmPoolSpec+ OSGymSandboxWarmPoolSpec.new(replicas: readU32,sandbox_template_ref: readTypeSandboxTemplateRef,autoscaling: readOptionalTypeWarmPoolAutoscaling@@ -1230,8 +1230,8 @@ class RustBufferStream# The Record type OSGymSandboxWarmPoolStatus.- def readTypeOsGymSandboxWarmPoolStatus- OsGymSandboxWarmPoolStatus.new(+ def readTypeOSGymSandboxWarmPoolStatus+ OSGymSandboxWarmPoolStatus.new(replicas: readOptionalu32,ready_replicas: readOptionalu32,selector: readOptionalstring@@ -1240,8 +1240,8 @@ class RustBufferStream# The Record type OSGymWorkspacePoolStatus.- def readTypeOsGymWorkspacePoolStatus- OsGymWorkspacePoolStatus.new(+ def readTypeOSGymWorkspacePoolStatus+ OSGymWorkspacePoolStatus.new(phase: readOptionalstring,total_count: readOptionalu32,available_count: readOptionalu32,@@ -1513,15 +1513,15 @@ class RustBufferStream# The Optional<T> type for TypeOSGymSandboxClaimSandbox.- def readOptionalTypeOsGymSandboxClaimSandbox+ def readOptionalTypeOSGymSandboxClaimSandboxflag = unpack_from 1, 'c'if flag == 0return nilelsif flag == 1- return readTypeOsGymSandboxClaimSandbox+ return readTypeOSGymSandboxClaimSandboxelse- raise InternalError, 'Unexpected flag byte for OptionalTypeOsGymSandboxClaimSandbox'+ raise InternalError, 'Unexpected flag byte for OptionalTypeOSGymSandboxClaimSandbox'endend@@ -1639,15 +1639,15 @@ class RustBufferStream# The Optional<T> type for SequenceTypeOSGymSandboxClaimCondition.- def readOptionalSequenceTypeOsGymSandboxClaimCondition+ def readOptionalSequenceTypeOSGymSandboxClaimConditionflag = unpack_from 1, 'c'if flag == 0return nilelsif flag == 1- return readSequenceTypeOsGymSandboxClaimCondition+ return readSequenceTypeOSGymSandboxClaimConditionelse- raise InternalError, 'Unexpected flag byte for OptionalSequenceTypeOsGymSandboxClaimCondition'+ raise InternalError, 'Unexpected flag byte for OptionalSequenceTypeOSGymSandboxClaimCondition'endend@@ -1713,7 +1713,7 @@ class RustBufferStream# The Sequence<T> type for TypeOSGymSandboxClaimCondition.- def readSequenceTypeOsGymSandboxClaimCondition+ def readSequenceTypeOSGymSandboxClaimConditioncount = unpack_from 4, 'l>'raise InternalError, 'Unexpected negative sequence length' if count.negative?@@ -1721,7 +1721,7 @@ class RustBufferStreamitems = []count.times do- items.append readTypeOsGymSandboxClaimCondition+ items.append readTypeOSGymSandboxClaimConditionenditems@@ -1853,7 +1853,7 @@ class RustBufferBuilder# The Record type OSGymSandboxClaimCondition.- def write_TypeOsGymSandboxClaimCondition(v)+ def write_TypeOSGymSandboxClaimCondition(v)self.write_Optionalstring(v.type)self.write_Optionalstring(v.status)self.write_Optionalstring(v.reason)@@ -1863,28 +1863,28 @@ class RustBufferBuilder# The Record type OSGymSandboxClaimSandbox.- def write_TypeOsGymSandboxClaimSandbox(v)+ def write_TypeOSGymSandboxClaimSandbox(v)self.write_Optionalstring(v.name)self.write_Optionalstring(v.service)end# The Record type OSGymSandboxClaimStatus.- def write_TypeOsGymSandboxClaimStatus(v)+ def write_TypeOSGymSandboxClaimStatus(v)self.write_Optionalstring(v.phase)- self.write_OptionalSequenceTypeOsGymSandboxClaimCondition(v.conditions)- self.write_OptionalTypeOsGymSandboxClaimSandbox(v.sandbox)+ self.write_OptionalSequenceTypeOSGymSandboxClaimCondition(v.conditions)+ self.write_OptionalTypeOSGymSandboxClaimSandbox(v.sandbox)end# The Record type OSGymSandboxSpec.- def write_TypeOsGymSandboxSpec(v)+ def write_TypeOSGymSandboxSpec(v)self.write_TypeVmTemplate(v.vm_template)end# The Record type OSGymSandboxStatus.- def write_TypeOsGymSandboxStatus(v)+ def write_TypeOSGymSandboxStatus(v)self.write_Optionalstring(v.phase)self.write_Optionalstring(v.runtime)self.write_Optionalbool(v.ready)@@ -1897,13 +1897,13 @@ class RustBufferBuilder# The Record type OSGymSandboxTemplateSpec.- def write_TypeOsGymSandboxTemplateSpec(v)+ def write_TypeOSGymSandboxTemplateSpec(v)self.write_TypeVmTemplate(v.vm_template)end# The Record type OSGymSandboxWarmPoolSpec.- def write_TypeOsGymSandboxWarmPoolSpec(v)+ def write_TypeOSGymSandboxWarmPoolSpec(v)self.write_U32(v.replicas)self.write_TypeSandboxTemplateRef(v.sandbox_template_ref)self.write_OptionalTypeWarmPoolAutoscaling(v.autoscaling)@@ -1911,7 +1911,7 @@ class RustBufferBuilder# The Record type OSGymSandboxWarmPoolStatus.- def write_TypeOsGymSandboxWarmPoolStatus(v)+ def write_TypeOSGymSandboxWarmPoolStatus(v)self.write_Optionalu32(v.replicas)self.write_Optionalu32(v.ready_replicas)self.write_Optionalstring(v.selector)@@ -1919,7 +1919,7 @@ class RustBufferBuilder# The Record type OSGymWorkspacePoolStatus.- def write_TypeOsGymWorkspacePoolStatus(v)+ def write_TypeOSGymWorkspacePoolStatus(v)self.write_Optionalstring(v.phase)self.write_Optionalu32(v.total_count)self.write_Optionalu32(v.available_count)@@ -2090,12 +2090,12 @@ class RustBufferBuilder# The Optional<T> type for TypeOSGymSandboxClaimSandbox.- def write_OptionalTypeOsGymSandboxClaimSandbox(v)+ def write_OptionalTypeOSGymSandboxClaimSandbox(v)if v.nil?pack_into(1, 'c', 0)elsepack_into(1, 'c', 1)- self.write_TypeOsGymSandboxClaimSandbox(v)+ self.write_TypeOSGymSandboxClaimSandbox(v)endend@@ -2189,12 +2189,12 @@ class RustBufferBuilder# The Optional<T> type for SequenceTypeOSGymSandboxClaimCondition.- def write_OptionalSequenceTypeOsGymSandboxClaimCondition(v)+ def write_OptionalSequenceTypeOSGymSandboxClaimCondition(v)if v.nil?pack_into(1, 'c', 0)elsepack_into(1, 'c', 1)- self.write_SequenceTypeOsGymSandboxClaimCondition(v)+ self.write_SequenceTypeOSGymSandboxClaimCondition(v)endend@@ -2242,11 +2242,11 @@ class RustBufferBuilder# The Sequence<T> type for TypeOSGymSandboxClaimCondition.- def write_SequenceTypeOsGymSandboxClaimCondition(items)+ def write_SequenceTypeOSGymSandboxClaimCondition(items)pack_into(4, 'l>', items.size)items.each do |item|- self.write_TypeOsGymSandboxClaimCondition(item)+ self.write_TypeOSGymSandboxClaimCondition(item)endend@@ -2566,7 +2566,7 @@ class ClaimSpecend# Record type OSGymSandboxClaimCondition-class OsGymSandboxClaimCondition+class OSGymSandboxClaimConditionattr_reader :type, :status, :reason, :message, :last_transition_timedef initialize(type:, status:, reason:, message:, last_transition_time:)@@ -2599,7 +2599,7 @@ class OsGymSandboxClaimConditionend# Record type OSGymSandboxClaimSandbox-class OsGymSandboxClaimSandbox+class OSGymSandboxClaimSandboxattr_reader :name, :servicedef initialize(name:, service:)@@ -2620,7 +2620,7 @@ class OsGymSandboxClaimSandboxend# Record type OSGymSandboxClaimStatus-class OsGymSandboxClaimStatus+class OSGymSandboxClaimStatusattr_reader :phase, :conditions, :sandboxdef initialize(phase:, conditions:, sandbox:)@@ -2789,7 +2789,7 @@ class VmTemplateend# Record type OSGymSandboxSpec-class OsGymSandboxSpec+class OSGymSandboxSpecattr_reader :vm_templatedef initialize(vm_template:)@@ -2806,7 +2806,7 @@ class OsGymSandboxSpecend# Record type OSGymSandboxStatus-class OsGymSandboxStatus+class OSGymSandboxStatusattr_reader :phase, :runtime, :ready, :vm_name, :service, :message, :reset_issued_at, :reset_vmi_uiddef initialize(phase:, runtime:, ready:, vm_name:, service:, message:, reset_issued_at:, reset_vmi_uid:)@@ -2851,7 +2851,7 @@ class OsGymSandboxStatusend# Record type OSGymSandboxTemplateSpec-class OsGymSandboxTemplateSpec+class OSGymSandboxTemplateSpecattr_reader :vm_templatedef initialize(vm_template:)@@ -2868,7 +2868,7 @@ class OsGymSandboxTemplateSpecend# Record type OSGymSandboxWarmPoolSpec-class OsGymSandboxWarmPoolSpec+class OSGymSandboxWarmPoolSpecattr_reader :replicas, :sandbox_template_ref, :autoscalingdef initialize(replicas:, sandbox_template_ref:, autoscaling:)@@ -2893,7 +2893,7 @@ class OsGymSandboxWarmPoolSpecend# Record type OSGymSandboxWarmPoolStatus-class OsGymSandboxWarmPoolStatus+class OSGymSandboxWarmPoolStatusattr_reader :replicas, :ready_replicas, :selectordef initialize(replicas:, ready_replicas:, selector:)@@ -2943,7 +2943,7 @@ class WarmPoolAutoscalingend# Record type OSGymWorkspacePoolStatus-class OsGymWorkspacePoolStatus+class OSGymWorkspacePoolStatusattr_reader :phase, :total_count, :available_count, :claimed_countdef initialize(phase:, total_count:, available_count:, claimed_count:)diff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rbindex f695afacb0..ba9aabd627 100644--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb@@ -14,6 +14,7 @@# helpers directly inline like we're doing here.require 'ffi'+require 'monitor'module CyclopsSdk@@ -36,6 +37,48 @@ def self.uniffi_bytes(v)v.to_strend+class UniffiHandleMap+ def initialize+ @lock = Monitor.new+ @map = {}+ @counter = 1+ end++ def insert(object)+ @lock.synchronize do+ handle = @counter+ @counter += 2+ @map[handle] = object+ handle+ end+ end++ def get(handle)+ @lock.synchronize do+ object = @map.fetch(handle) { raise InternalError, "unknown UniFFI callback handle #{handle}" }+ object+ end+ end++ def clone_handle(handle)+ @lock.synchronize do+ object = @map.fetch(handle) { raise InternalError, "unknown UniFFI callback handle #{handle}" }+ new_handle = @counter+ @counter += 2+ @map[new_handle] = object+ new_handle+ end+ end++ def remove(handle)+ @lock.synchronize do+ @map.delete(handle) { raise InternalError, "unknown UniFFI callback handle #{handle}" }+ end+ end+end++private_constant :UniffiHandleMap+class RustBuffer < FFI::Structlayout :capacity, :uint64,:len, :uint64,@@ -133,7 +176,7 @@ endRustBuffer.check_lower_TypeResourceMetadata(v.metadata)RustBuffer.check_lower_TypeClaimSpec(v.spec)- RustBuffer.check_lower_OptionalTypeOsGymSandboxClaimStatus(v.status)+ RustBuffer.check_lower_OptionalTypeOSGymSandboxClaimStatus(v.status)enddef self.alloc_from_TypeClaim(v)@@ -214,6 +257,29 @@ endendend+ # The Record type CyclopsTokenProviderConfiguration.++ def self.check_lower_TypeCyclopsTokenProviderConfiguration(v)++++++ end++ def self.alloc_from_TypeCyclopsTokenProviderConfiguration(v)+ RustBuffer.allocWithBuilder do |builder|+ builder.write_TypeCyclopsTokenProviderConfiguration(v)+ return builder.finalize+ end+ end++ def consumeIntoTypeCyclopsTokenProviderConfiguration+ consumeWithStream do |stream|+ return stream.readTypeCyclopsTokenProviderConfiguration+ end+ end+# The Record type HttpHeader.def self.check_lower_TypeHttpHeader(v)@@ -284,7 +350,7 @@ endRustBuffer.check_lower_TypeResourceMetadata(v.metadata)RustBuffer.check_lower_TypePoolSpec(v.spec)- RustBuffer.check_lower_OptionalTypeOsGymWorkspacePoolStatus(v.status)+ RustBuffer.check_lower_OptionalTypeOSGymWorkspacePoolStatus(v.status)enddef self.alloc_from_TypePool(v)@@ -347,6 +413,8 @@ end++# The Optional<T> type for bytes.def self.check_lower_Optionalbytes(v)@@ -614,6 +682,15 @@ class RustBufferStreamunpack_from 8, 'Q>'end+ def readBool+ v = unpack_from 1, 'c'++ return false if v == 0+ return true if v == 1++ raise InternalError, 'Unexpected byte for Boolean type'+ end+def readStringsize = unpack_from 4, 'l>'@@ -630,6 +707,13 @@ class RustBufferStreamread(size).force_encoding(Encoding::BINARY)end+ # The Object type AccessTokenProvider.++ def readTypeAccessTokenProvider+ handle = unpack_from 8, 'Q>'+ return AccessTokenProvider.uniffi_allocate(handle)+ end+# The Object type CyclopsClient.def readTypeCyclopsClient@@ -659,7 +743,7 @@ class RustBufferStreamkind: readString,metadata: readTypeResourceMetadata,spec: readTypeClaimSpec,- status: readOptionalTypeOsGymSandboxClaimStatus+ status: readOptionalTypeOSGymSandboxClaimStatus)end@@ -695,6 +779,18 @@ class RustBufferStream)end+ # The Record type CyclopsTokenProviderConfiguration.++ def readTypeCyclopsTokenProviderConfiguration+ CyclopsTokenProviderConfiguration.new(+ base_url: readString,+ pool_poll_interval_ms: readU64,+ pool_poll_limit: readU32,+ claim_poll_interval_ms: readU64,+ claim_poll_limit: readU32+ )+ end+# The Record type HttpHeader.def readTypeHttpHeader@@ -733,7 +829,7 @@ class RustBufferStreamkind: readString,metadata: readTypeResourceMetadata,spec: readTypePoolSpec,- status: readOptionalTypeOsGymWorkspacePoolStatus+ status: readOptionalTypeOSGymWorkspacePoolStatus)end@@ -762,6 +858,25 @@ class RustBufferStream+ # The Error type AccessTokenProviderError++ def readTypeAccessTokenProviderError+ variant = unpack_from 4, 'l>'++ if variant == 1+ return AccessTokenProviderError::Failed.new(+ readString()+ )+ end++ raise InternalError, 'Unexpected variant tag for TypeAccessTokenProviderError'+ end++++++# The Error type HttpErrordef readTypeHttpError@@ -875,29 +990,29 @@ class RustBufferStream# The Optional<T> type for TypeOSGymSandboxClaimStatus.- def readOptionalTypeOsGymSandboxClaimStatus+ def readOptionalTypeOSGymSandboxClaimStatusflag = unpack_from 1, 'c'if flag == 0return nilelsif flag == 1- return readTypeOsGymSandboxClaimStatus+ return readTypeOSGymSandboxClaimStatuselse- raise InternalError, 'Unexpected flag byte for OptionalTypeOsGymSandboxClaimStatus'+ raise InternalError, 'Unexpected flag byte for OptionalTypeOSGymSandboxClaimStatus'endend# The Optional<T> type for TypeOSGymWorkspacePoolStatus.- def readOptionalTypeOsGymWorkspacePoolStatus+ def readOptionalTypeOSGymWorkspacePoolStatusflag = unpack_from 1, 'c'if flag == 0return nilelsif flag == 1- return readTypeOsGymWorkspacePoolStatus+ return readTypeOSGymWorkspacePoolStatuselse- raise InternalError, 'Unexpected flag byte for OptionalTypeOsGymWorkspacePoolStatus'+ raise InternalError, 'Unexpected flag byte for OptionalTypeOSGymWorkspacePoolStatus'endend@@ -1053,6 +1168,10 @@ class RustBufferBuilderpack_into(8, 'Q>', v)end+ def write_Bool(v)+ pack_into(1, 'c', v ? 1 : 0)+ end+def write_String(v)v = CyclopsSdk::uniffi_utf8(v)pack_into 4, 'l>', v.bytes.size@@ -1065,6 +1184,13 @@ class RustBufferBuilderwrite vend+ # The Object type AccessTokenProvider.++ def write_TypeAccessTokenProvider(obj)+ handle = AccessTokenProvider.uniffi_lower obj+ pack_into(8, 'Q>', handle)+ end+# The Object type CyclopsClient.def write_TypeCyclopsClient(obj)@@ -1093,7 +1219,7 @@ class RustBufferBuilderself.write_String(v.kind)self.write_TypeResourceMetadata(v.metadata)self.write_TypeClaimSpec(v.spec)- self.write_OptionalTypeOsGymSandboxClaimStatus(v.status)+ self.write_OptionalTypeOSGymSandboxClaimStatus(v.status)end# The Record type CreateClaimRequest.@@ -1122,6 +1248,16 @@ class RustBufferBuilderself.write_U32(v.claim_poll_limit)end+ # The Record type CyclopsTokenProviderConfiguration.++ def write_TypeCyclopsTokenProviderConfiguration(v)+ self.write_String(v.base_url)+ self.write_U64(v.pool_poll_interval_ms)+ self.write_U32(v.pool_poll_limit)+ self.write_U64(v.claim_poll_interval_ms)+ self.write_U32(v.claim_poll_limit)+ end+# The Record type HttpHeader.def write_TypeHttpHeader(v)@@ -1153,7 +1289,7 @@ class RustBufferBuilderself.write_String(v.kind)self.write_TypeResourceMetadata(v.metadata)self.write_TypePoolSpec(v.spec)- self.write_OptionalTypeOsGymWorkspacePoolStatus(v.status)+ self.write_OptionalTypeOSGymWorkspacePoolStatus(v.status)end# The Record type ResourceMetadata.@@ -1177,6 +1313,8 @@ class RustBufferBuilder++# The Optional<T> type for bytes.def write_Optionalbytes(v)@@ -1201,23 +1339,23 @@ class RustBufferBuilder# The Optional<T> type for TypeOSGymSandboxClaimStatus.- def write_OptionalTypeOsGymSandboxClaimStatus(v)+ def write_OptionalTypeOSGymSandboxClaimStatus(v)if v.nil?pack_into(1, 'c', 0)elsepack_into(1, 'c', 1)- self.write_TypeOsGymSandboxClaimStatus(v)+ self.write_TypeOSGymSandboxClaimStatus(v)endend# The Optional<T> type for TypeOSGymWorkspacePoolStatus.- def write_OptionalTypeOsGymWorkspacePoolStatus(v)+ def write_OptionalTypeOSGymWorkspacePoolStatus(v)if v.nil?pack_into(1, 'c', 0)elsepack_into(1, 'c', 1)- self.write_TypeOsGymWorkspacePoolStatus(v)+ self.write_TypeOSGymWorkspacePoolStatus(v)endend@@ -1328,6 +1466,25 @@ CALL_ERROR = 1CALL_PANIC = 2+module AccessTokenProviderError+ class Failed < StandardError+ def initialize(reason)+ @reason = reason+ super()+ end++ attr_reader :reason+++ def to_s+ "#{self.class.name}(reason=#{@reason.inspect})"+ end+ end++end+++module HttpErrorclass Transport < StandardErrordef initialize(reason)@@ -1487,6 +1644,9 @@ end# Map error modules to the RustBuffer method name that reads themERROR_MODULE_TO_READER_METHOD = {+ AccessTokenProviderError => :readTypeAccessTokenProviderError,++HttpError => :readTypeHttpError,@@ -1550,6 +1710,123 @@ def self.rust_call_with_error(error_module, fn_name, *args)endend+UNIFFI_RUST_FUTURE_POLL_READY = 0+UNIFFI_RUST_FUTURE_POLL_WAKE = 1+UNIFFI_CALLBACK_SUCCESS = 0+UNIFFI_CALLBACK_ERROR = 1+UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2++def self.uniffi_lower_http_error(error)+ unless error.is_a?(HttpError::Transport)+ raise InternalError, "Unexpected HttpError variant: #{error.class}"+ end++ RustBuffer.allocWithBuilder do |builder|+ builder.write_U32(1)+ reason = error.reason+ reason = reason.fetch(:reason) if reason.is_a?(Hash) && reason.keys == [:reason]+ builder.write_String(reason)+ builder.finalize()+ end+end++def self.uniffi_trait_interface_call(call_status, make_call, write_return_value, error_type = nil, lower_error = nil)+ begin+ write_return_value.call make_call.call+ rescue StandardError => error+ buffer = if !error_type.nil? && uniffi_is_error_type?(error, error_type)+ call_status[:code] = UNIFFI_CALLBACK_ERROR+ lower_error.call error+ else+ call_status[:code] = UNIFFI_CALLBACK_UNEXPECTED_ERROR+ RustBuffer.allocFromString(error.inspect)+ end++ error_buffer = call_status[:error_buf]+ error_buffer[:capacity] = buffer[:capacity]+ error_buffer[:len] = buffer[:len]+ error_buffer[:data] = buffer[:data]+ end+end++def self.uniffi_is_error_type?(error, error_type)+ return true if error_type.is_a?(Class) && error.is_a?(error_type)++ error_type.constants.any? do |name|+ error_class = error_type.const_get(name)+ error_class.is_a?(Class) && error.is_a?(error_class)+ end+end++def self.uniffi_rust_future(error_module, handle, poll_function, complete_function, free_function)+ monitor = Monitor.new+ condition = monitor.new_cond+ poll_state = nil+ continuation = Proc.new do |_callback_data, state|+ monitor.synchronize do+ poll_state = state+ condition.signal+ end+ end++ begin+ loop do+ monitor.synchronize { poll_state = nil }+ UniFFILib.public_send(poll_function, handle, continuation, 0)+ state = monitor.synchronize do+ condition.wait_while { poll_state.nil? }+ poll_state+ end+ break if state == UNIFFI_RUST_FUTURE_POLL_READY+ next if state == UNIFFI_RUST_FUTURE_POLL_WAKE++ raise InternalError, "Unknown Rust future poll state: #{state}"+ end++ status = RustCallStatus.new+ result = UniFFILib.public_send(complete_function, handle, status)+ case status.code+ when CALL_SUCCESS+ result+ when CALL_ERROR+ if error_module.nil?+ status.error_buf.free+ raise InternalError, "CALL_ERROR with no error_module set"+ end+ raise consume_buffer_into_error(error_module, status.error_buf)+ when CALL_PANIC+ if status.error_buf.len > 0+ raise InternalError, status.error_buf.consumeIntoString()+ end+ raise InternalError, "Rust panic"+ else+ raise InternalError, "Unknown call status: #{status.code}"+ end+ ensure+ UniFFILib.public_send(free_function, handle) unless handle.nil?+ end+end++def self.uniffi_rust_future_rust_buffer(error_module, handle)+ uniffi_rust_future(+ error_module,+ handle,+ :ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ :ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ :ffi_cyclops_sdk_rust_future_free_rust_buffer,+ )+end++def self.uniffi_rust_future_void(error_module, handle)+ uniffi_rust_future(+ error_module,+ handle,+ :ffi_cyclops_sdk_rust_future_poll_void,+ :ffi_cyclops_sdk_rust_future_complete_void,+ :ffi_cyclops_sdk_rust_future_free_void,+ )+end+private_class_method :consume_buffer_into_error# This is how we find and load the dynamic library provided by the component.@@ -1560,6 +1837,28 @@ module UniFFILibffi_lib 'cyclops_sdk'+ callback :RustFutureContinuationCallback,+ [:uint64, :int8],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ [:uint64, :RustFutureContinuationCallback, :uint64],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ [:uint64, RustCallStatus.by_ref],+ RustBuffer.by_value+ attach_function :ffi_cyclops_sdk_rust_future_free_rust_buffer,+ [:uint64],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_poll_void,+ [:uint64, :RustFutureContinuationCallback, :uint64],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_complete_void,+ [:uint64, RustCallStatus.by_ref],+ :void+ attach_function :ffi_cyclops_sdk_rust_future_free_void,+ [:uint64],+ :void+attach_function :uniffi_cyclops_sdk_fn_clone_cyclopsclient,[:uint64, RustCallStatus.by_ref],@@ -1570,6 +1869,15 @@ module UniFFILibattach_function :uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect,[RustBuffer.by_value, :uint64, RustCallStatus.by_ref],:uint64+ attach_function :uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token,+ [RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],+ :uint64+ attach_function :uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token,+ [RustBuffer.by_value, RustBuffer.by_value, :uint64, RustCallStatus.by_ref],+ :uint64+ attach_function :uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider,+ [RustBuffer.by_value, :uint64, :uint64, RustCallStatus.by_ref],+ :uint64attach_function :uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim,[:uint64, RustBuffer.by_value, RustCallStatus.by_ref],:uint64@@ -1603,14 +1911,54 @@ module UniFFILibattach_function :uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request,[:uint64, RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],:uint64+ attach_function :uniffi_cyclops_sdk_fn_clone_accesstokenprovider,+ [:uint64, RustCallStatus.by_ref],+ :uint64+ attach_function :uniffi_cyclops_sdk_fn_free_accesstokenprovider,+ [:uint64, RustCallStatus.by_ref],+ :void+ attach_function :uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider,+ [:pointer, RustCallStatus.by_ref],+ :void+ attach_function :uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token,+ [:uint64, :int8, RustCallStatus.by_ref],+ :uint64attach_function :uniffi_cyclops_sdk_fn_clone_httpclient,[:uint64, RustCallStatus.by_ref],:uint64attach_function :uniffi_cyclops_sdk_fn_free_httpclient,[:uint64, RustCallStatus.by_ref],:void+ callback :ForeignFutureDroppedCallback,+ [:uint64],+ :void+ callback :CallbackInterfaceFree,+ [:uint64],+ :void+ callback :CallbackInterfaceClone,+ [:uint64],+ :uint64+ class ForeignFutureDroppedCallbackStruct < FFI::Struct+ layout :handle, :uint64,+ :free, :ForeignFutureDroppedCallback+ end+ class ForeignFutureResultRustBuffer < FFI::Struct+ layout :return_value, RustBuffer.by_value,+ :call_status, RustCallStatus+ end+ callback :ForeignFutureCompleteRustBuffer,+ [:uint64, ForeignFutureResultRustBuffer.by_value],+ :void+ callback :CallbackInterfaceHttpClientMethod0,+ [:uint64, RustBuffer.by_value, :ForeignFutureCompleteRustBuffer, :uint64, ForeignFutureDroppedCallbackStruct.by_ref],+ :void+ class VTableCallbackInterfaceHttpClient < FFI::Struct+ layout :uniffi_free, :CallbackInterfaceFree,+ :uniffi_clone, :CallbackInterfaceClone,+ :execute, :CallbackInterfaceHttpClientMethod0+ endattach_function :uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient,- [:pointer, RustCallStatus.by_ref],+ [VTableCallbackInterfaceHttpClient.by_ref],:voidattach_function :uniffi_cyclops_sdk_fn_method_httpclient_execute,[:uint64, RustBuffer.by_value, RustCallStatus.by_ref],@@ -1669,12 +2017,24 @@ module UniFFILibattach_function :uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request,[RustCallStatus.by_ref],:uint16+ attach_function :uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token,+ [RustCallStatus.by_ref],+ :uint16attach_function :uniffi_cyclops_sdk_checksum_method_httpclient_execute,[RustCallStatus.by_ref],:uint16attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect,[RustCallStatus.by_ref],:uint16+ attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token,+ [RustCallStatus.by_ref],+ :uint16+ attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token,+ [RustCallStatus.by_ref],+ :uint16+ attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider,+ [RustCallStatus.by_ref],+ :uint16attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new,[RustCallStatus.by_ref],:uint16@@ -1689,6 +2049,7 @@ end+# Record type Claimclass Claimattr_reader :api_version, :kind, :metadata, :spec, :status@@ -1805,6 +2166,39 @@ class CyclopsConfigurationendend+ # Record type CyclopsTokenProviderConfiguration+class CyclopsTokenProviderConfiguration+ attr_reader :base_url, :pool_poll_interval_ms, :pool_poll_limit, :claim_poll_interval_ms, :claim_poll_limit++ def initialize(base_url:, pool_poll_interval_ms:, pool_poll_limit:, claim_poll_interval_ms:, claim_poll_limit:)+ @base_url = base_url+ @pool_poll_interval_ms = pool_poll_interval_ms+ @pool_poll_limit = pool_poll_limit+ @claim_poll_interval_ms = claim_poll_interval_ms+ @claim_poll_limit = claim_poll_limit+ end++ def ==(other)+ if @base_url != other.base_url+ return false+ end+ if @pool_poll_interval_ms != other.pool_poll_interval_ms+ return false+ end+ if @pool_poll_limit != other.pool_poll_limit+ return false+ end+ if @claim_poll_interval_ms != other.claim_poll_interval_ms+ return false+ end+ if @claim_poll_limit != other.claim_poll_limit+ return false+ end++ true+ end+end+# Record type HttpHeaderclass HttpHeaderattr_reader :name, :value@@ -2024,66 +2418,136 @@ end# and just create a new instance with the required handle.return uniffi_allocate(CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect,RustBuffer.alloc_from_TypeCyclopsConfiguration(configuration),(HttpClient.uniffi_lower http_client)))end+ def self.connect_browser_with_access_token(configuration, access_token)+ configuration = configuration+ RustBuffer.check_lower_TypeCyclopsTokenProviderConfiguration(configuration)+ access_token = CyclopsSdk::uniffi_utf8(access_token)++ # Call the (fallible) function before creating any half-baked object instances.+ # Lightly yucky way to bypass the usual "initialize" logic+ # and just create a new instance with the required handle.+ return uniffi_allocate(CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token,RustBuffer.alloc_from_TypeCyclopsTokenProviderConfiguration(configuration),RustBuffer.allocFromString(access_token)))+ end+ def self.connect_with_access_token(configuration, access_token, http_client)+ configuration = configuration+ RustBuffer.check_lower_TypeCyclopsTokenProviderConfiguration(configuration)+ access_token = CyclopsSdk::uniffi_utf8(access_token)++ http_client = http_client+ (HttpClient.uniffi_check_lower http_client)+ # Call the (fallible) function before creating any half-baked object instances.+ # Lightly yucky way to bypass the usual "initialize" logic+ # and just create a new instance with the required handle.+ return uniffi_allocate(CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token,RustBuffer.alloc_from_TypeCyclopsTokenProviderConfiguration(configuration),RustBuffer.allocFromString(access_token),(HttpClient.uniffi_lower http_client)))+ end+ def self.connect_with_access_token_provider(configuration, token_provider, http_client)+ configuration = configuration+ RustBuffer.check_lower_TypeCyclopsTokenProviderConfiguration(configuration)+ token_provider = token_provider+ (AccessTokenProvider.uniffi_check_lower token_provider)+ http_client = http_client+ (HttpClient.uniffi_check_lower http_client)+ # Call the (fallible) function before creating any half-baked object instances.+ # Lightly yucky way to bypass the usual "initialize" logic+ # and just create a new instance with the required handle.+ return uniffi_allocate(CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider,RustBuffer.alloc_from_TypeCyclopsTokenProviderConfiguration(configuration),(AccessTokenProvider.uniffi_lower token_provider),(HttpClient.uniffi_lower http_client)))+ enddef create_claim(request)request = requestRustBuffer.check_lower_TypeCreateClaimRequest(request)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim,uniffi_clone_handle(),RustBuffer.alloc_from_TypeCreateClaimRequest(request))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(uniffi_clone_handle(),RustBuffer.alloc_from_TypeCreateClaimRequest(request),RustCallStatus.new),+ )return result.consumeIntoTypeClaimenddef delete_claim(claim)claim = claimRustBuffer.check_lower_TypeClaim(claim)- CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_claim,uniffi_clone_handle(),RustBuffer.alloc_from_TypeClaim(claim))+ CyclopsSdk.uniffi_rust_future_void(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_claim(uniffi_clone_handle(),RustBuffer.alloc_from_TypeClaim(claim),RustCallStatus.new),+ )enddef get_claim(claim)claim = claimRustBuffer.check_lower_TypeClaim(claim)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_get_claim,uniffi_clone_handle(),RustBuffer.alloc_from_TypeClaim(claim))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_get_claim(uniffi_clone_handle(),RustBuffer.alloc_from_TypeClaim(claim),RustCallStatus.new),+ )return result.consumeIntoTypeClaimenddef list_claims(namespace)namespace = CyclopsSdk::uniffi_utf8(namespace)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_list_claims,uniffi_clone_handle(),RustBuffer.allocFromString(namespace))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(++ SdkError,++ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_list_claims(uniffi_clone_handle(),RustBuffer.allocFromString(namespace),RustCallStatus.new),++ )return result.consumeIntoSequenceTypeClaimenddef wait_claim(claim)claim = claimRustBuffer.check_lower_TypeClaim(claim)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_wait_claim,uniffi_clone_handle(),RustBuffer.alloc_from_TypeClaim(claim))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_wait_claim(uniffi_clone_handle(),RustBuffer.alloc_from_TypeClaim(claim),RustCallStatus.new),+ )return result.consumeIntoTypeSandboxenddef create_pool(request)request = requestRustBuffer.check_lower_TypeCreatePoolRequest(request)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_create_pool,uniffi_clone_handle(),RustBuffer.alloc_from_TypeCreatePoolRequest(request))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_create_pool(uniffi_clone_handle(),RustBuffer.alloc_from_TypeCreatePoolRequest(request),RustCallStatus.new),+ )return result.consumeIntoTypePoolenddef delete_pool(pool)pool = poolRustBuffer.check_lower_TypePool(pool)- CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_pool,uniffi_clone_handle(),RustBuffer.alloc_from_TypePool(pool))+ CyclopsSdk.uniffi_rust_future_void(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_pool(uniffi_clone_handle(),RustBuffer.alloc_from_TypePool(pool),RustCallStatus.new),+ )enddef get_pool(pool)pool = poolRustBuffer.check_lower_TypePool(pool)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_get_pool,uniffi_clone_handle(),RustBuffer.alloc_from_TypePool(pool))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_get_pool(uniffi_clone_handle(),RustBuffer.alloc_from_TypePool(pool),RustCallStatus.new),+ )return result.consumeIntoTypePoolenddef list_pools(namespace)namespace = CyclopsSdk::uniffi_utf8(namespace)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools,uniffi_clone_handle(),RustBuffer.allocFromString(namespace))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(++ SdkError,++ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools(uniffi_clone_handle(),RustBuffer.allocFromString(namespace),RustCallStatus.new),++ )return result.consumeIntoSequenceTypePoolenddef update_pool(pool)pool = poolRustBuffer.check_lower_TypePool(pool)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool,uniffi_clone_handle(),RustBuffer.alloc_from_TypePool(pool))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool(uniffi_clone_handle(),RustBuffer.alloc_from_TypePool(pool),RustCallStatus.new),+ )return result.consumeIntoTypePoolenddef service_request(sandbox, service, path, request)@@ -2095,13 +2559,16 @@ endrequest = requestRustBuffer.check_lower_TypeHttpRequest(request)- result = CyclopsSdk.rust_call_with_error(SdkError,:uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request,uniffi_clone_handle(),RustBuffer.alloc_from_TypeSandbox(sandbox),RustBuffer.allocFromString(service),RustBuffer.allocFromString(path),RustBuffer.alloc_from_TypeHttpRequest(request))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ SdkError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(uniffi_clone_handle(),RustBuffer.alloc_from_TypeSandbox(sandbox),RustBuffer.allocFromString(service),RustBuffer.allocFromString(path),RustBuffer.alloc_from_TypeHttpRequest(request),RustCallStatus.new),+ )return result.consumeIntoTypeHttpResponseendend- class HttpClient+ class AccessTokenProvider# A private helper for initializing instances of the class from a raw handle,# bypassing any initialization logic and ensuring they are GC'd properly.@@ -2118,7 +2585,7 @@ enddef self.uniffi_define_finalizer_by_handle(handle, object_id)Proc.new do |_id|CyclopsSdk.rust_call(- :uniffi_cyclops_sdk_fn_free_httpclient,+ :uniffi_cyclops_sdk_fn_free_accesstokenprovider,handle)end@@ -2129,12 +2596,74 @@ end# object in a place where this type is expected, could lead to memory unsafety.def self.uniffi_check_lower(inst)if not inst.is_a? self+ raise TypeError.new "Expected a AccessTokenProvider instance, got #{inst}"+ end+ end++ def uniffi_clone_handle()+ return CyclopsSdk.rust_call(+ :uniffi_cyclops_sdk_fn_clone_accesstokenprovider,+ @handle+ )+ end++ def self.uniffi_lower(inst)+ return inst.uniffi_clone_handle()+ end++++ def get_access_token(force_refresh)+ force_refresh = force_refresh ? true : false++ result = CyclopsSdk.uniffi_rust_future_rust_buffer(++ AccessTokenProviderError,++ UniFFILib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(uniffi_clone_handle(),(force_refresh ? 1 : 0),RustCallStatus.new),++ )+ return result.consumeIntoString+ end++end++ class HttpClient++ # A private helper for initializing instances of the class from a raw handle,+ # bypassing any initialization logic and ensuring they are GC'd properly.+ def self.uniffi_allocate(handle)+ inst = allocate+ inst.instance_variable_set :@handle, handle+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))+ return inst+ end++ # A private helper for registering an object finalizer.+ # N.B. it's important that this does not capture a reference+ # to the actual instance, only its underlying handle.+ def self.uniffi_define_finalizer_by_handle(handle, object_id)+ Proc.new do |_id|+ CyclopsSdk.rust_call(+ :uniffi_cyclops_sdk_fn_free_httpclient,+ handle+ )+ end+ end++ @uniffi_handle_map = UniffiHandleMap.new++ class << self+ attr_reader :uniffi_handle_map+ end++ def self.uniffi_check_lower(inst)+ unless inst.is_a?(self) && inst.respond_to?(:execute)raise TypeError.new "Expected a HttpClient instance, got #{inst}"endenddef uniffi_clone_handle()- return 0 if @handle.nil?return CyclopsSdk.rust_call(:uniffi_cyclops_sdk_fn_clone_httpclient,@handle@@ -2142,7 +2671,11 @@ endenddef self.uniffi_lower(inst)- return inst.uniffi_clone_handle()+ if inst.instance_variable_defined?(:@handle)+ inst.uniffi_clone_handle()+ else+ @uniffi_handle_map.insert(inst)+ endend@@ -2150,12 +2683,49 @@ enddef execute(request)request = requestRustBuffer.check_lower_TypeHttpRequest(request)- result = CyclopsSdk.rust_call_with_error(HttpError,:uniffi_cyclops_sdk_fn_method_httpclient_execute,uniffi_clone_handle(),RustBuffer.alloc_from_TypeHttpRequest(request))+ result = CyclopsSdk.uniffi_rust_future_rust_buffer(+ HttpError,+ UniFFILib.uniffi_cyclops_sdk_fn_method_httpclient_execute(uniffi_clone_handle(),RustBuffer.alloc_from_TypeHttpRequest(request),RustCallStatus.new),+ )return result.consumeIntoTypeHttpResponseendend+module UniffiCallbackInterfaceHttpClient+ UNIFFI_DROPPED_CALLBACK = Proc.new { |_handle| }++ EXECUTE_CALLBACK = Proc.new do |uniffi_handle, request, future_callback, callback_data, dropped_callback|+ dropped_callback[:handle] = 0+ dropped_callback[:free] = UNIFFI_DROPPED_CALLBACK+ result = UniFFILib::ForeignFutureResultRustBuffer.new+ status = RustCallStatus.new+ CyclopsSdk.uniffi_trait_interface_call(+ status,+ Proc.new { HttpClient.uniffi_handle_map.get(uniffi_handle).execute(request.consumeIntoTypeHttpRequest) },+ Proc.new { |response| result[:return_value] = RustBuffer.alloc_from_TypeHttpResponse(response) },+ HttpError,+ Proc.new { |error| CyclopsSdk.uniffi_lower_http_error(error) }+ )+ result[:call_status] = status+ future_callback.call(callback_data, result)+ end++ UNIFFI_FREE_CALLBACK = Proc.new do |uniffi_handle|+ HttpClient.uniffi_handle_map.remove(uniffi_handle)+ end++ UNIFFI_CLONE_CALLBACK = Proc.new do |uniffi_handle|+ HttpClient.uniffi_handle_map.clone_handle(uniffi_handle)+ end++ UNIFFI_VTABLE = UniFFILib::VTableCallbackInterfaceHttpClient.new+ UNIFFI_VTABLE[:uniffi_free] = UNIFFI_FREE_CALLBACK+ UNIFFI_VTABLE[:uniffi_clone] = UNIFFI_CLONE_CALLBACK+ UNIFFI_VTABLE[:execute] = EXECUTE_CALLBACK+ UniFFILib.uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(UNIFFI_VTABLE)+end+class CyclopsCredentials# A private helper for initializing instances of the class from a raw handle,diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift b/libs/fleet/sdk-bindings/swift/CyclopsSdk.swiftindex dfba3f6f70..e451a2d037 100644--- a/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift@@ -470,6 +470,30 @@ fileprivate struct FfiConverterUInt64: FfiConverterPrimitive {}}+#if swift(>=5.8)+@_documentation(visibility: private)+#endif+fileprivate struct FfiConverterBool : FfiConverter {+ typealias FfiType = Int8+ typealias SwiftType = Bool++ public static func lift(_ value: Int8) throws -> Bool {+ return value != 0+ }++ public static func lower(_ value: Bool) -> Int8 {+ return value ? 1 : 0+ }++ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool {+ return try lift(readInt(&buf))+ }++ public static func write(_ value: Bool, into buf: inout [UInt8]) {+ writeInt(&buf, lower(value))+ }+}+#if swift(>=5.8)@_documentation(visibility: private)#endif@@ -532,6 +556,220 @@ fileprivate struct FfiConverterData: FfiConverterRustBuffer {+public protocol AccessTokenProvider: AnyObject, Sendable {++ func getAccessToken(forceRefresh: Bool) async throws -> String++}+open class AccessTokenProviderImpl: AccessTokenProvider, @unchecked Sendable {+ fileprivate let handle: UInt64++ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.+#if swift(>=5.8)+ @_documentation(visibility: private)+#endif+ public struct NoHandle {+ public init() {}+ }++ // TODO: We'd like this to be `private` but for Swifty reasons,+ // we can't implement `FfiConverter` without making this `required` and we can't+ // make it `required` without making it `public`.+#if swift(>=5.8)+ @_documentation(visibility: private)+#endif+ required public init(unsafeFromHandle handle: UInt64) {+ self.handle = handle+ }++ // This constructor can be used to instantiate a fake object.+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].+ //+ // - Warning:+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.+#if swift(>=5.8)+ @_documentation(visibility: private)+#endif+ public init(noHandle: NoHandle) {+ self.handle = 0+ }++#if swift(>=5.8)+ @_documentation(visibility: private)+#endif+ public func uniffiCloneHandle() -> UInt64 {+ return try! rustCall { uniffi_cyclops_sdk_fn_clone_accesstokenprovider(self.handle, $0) }+ }+ // No primary constructor declared for this class.++ deinit {+ if handle == 0 {+ // Mock objects have handle=0 don't try to free them+ return+ }++ try! rustCall { uniffi_cyclops_sdk_fn_free_accesstokenprovider(handle, $0) }+ }+++++open func getAccessToken(forceRefresh: Bool)async throws -> String {+ return+ try await uniffiRustCallAsync(+ rustFutureFunc: {+ uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(+ self.uniffiCloneHandle(),+ FfiConverterBool.lower(forceRefresh)+ )+ },+ pollFunc: ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ completeFunc: ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ freeFunc: ffi_cyclops_sdk_rust_future_free_rust_buffer,+ liftFunc: FfiConverterString.lift,+ errorHandler: FfiConverterTypeAccessTokenProviderError_lift+ )+}++++}++++// Put the implementation in a struct so we don't pollute the top-level namespace+fileprivate struct UniffiCallbackInterfaceAccessTokenProvider {++ // Create the VTable using a series of closures.+ // Swift automatically converts these into C callback functions.+ //+ // This creates 1-element array, since this seems to be the only way to construct a const+ // pointer that we can pass to the Rust code.+ static let vtable: [UniffiVTableCallbackInterfaceAccessTokenProvider] = [UniffiVTableCallbackInterfaceAccessTokenProvider(+ uniffiFree: { (uniffiHandle: UInt64) -> () in+ do {+ try FfiConverterTypeAccessTokenProvider.handleMap.remove(handle: uniffiHandle)+ } catch {+ print("Uniffi callback interface AccessTokenProvider: handle missing in uniffiFree")+ }+ },+ uniffiClone: { (uniffiHandle: UInt64) -> UInt64 in+ do {+ return try FfiConverterTypeAccessTokenProvider.handleMap.clone(handle: uniffiHandle)+ } catch {+ fatalError("Uniffi callback interface AccessTokenProvider: handle missing in uniffiClone")+ }+ },+ getAccessToken: { (+ uniffiHandle: UInt64,+ forceRefresh: Int8,+ uniffiFutureCallback: @escaping UniffiForeignFutureCompleteRustBuffer,+ uniffiCallbackData: UInt64,+ uniffiOutDroppedCallback: UnsafeMutablePointer<UniffiForeignFutureDroppedCallbackStruct>+ ) in+ let makeCall = {+ () async throws -> String in+ guard let uniffiObj = try? FfiConverterTypeAccessTokenProvider.handleMap.get(handle: uniffiHandle) else {+ throw UniffiInternalError.unexpectedStaleHandle+ }+ return try await uniffiObj.getAccessToken(+ forceRefresh: try FfiConverterBool.lift(forceRefresh)+ )+ }++ let uniffiHandleSuccess = { (returnValue: String) in+ uniffiFutureCallback(+ uniffiCallbackData,+ UniffiForeignFutureResultRustBuffer(+ returnValue: FfiConverterString.lower(returnValue),+ callStatus: RustCallStatus()+ )+ )+ }+ let uniffiHandleError = { (statusCode, errorBuf) in+ uniffiFutureCallback(+ uniffiCallbackData,+ UniffiForeignFutureResultRustBuffer(+ returnValue: RustBuffer.empty(),+ callStatus: RustCallStatus(code: statusCode, errorBuf: errorBuf)+ )+ )+ }+ uniffiTraitInterfaceCallAsyncWithError(+ makeCall: makeCall,+ handleSuccess: uniffiHandleSuccess,+ handleError: uniffiHandleError,+ lowerError: FfiConverterTypeAccessTokenProviderError_lower,+ droppedCallback: uniffiOutDroppedCallback+ )+ }+ )]+}++private func uniffiCallbackInitAccessTokenProvider() {+ uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(UniffiCallbackInterfaceAccessTokenProvider.vtable)+}++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public struct FfiConverterTypeAccessTokenProvider: FfiConverter {+ fileprivate static let handleMap = UniffiHandleMap<AccessTokenProvider>()++ typealias FfiType = UInt64+ typealias SwiftType = AccessTokenProvider++ public static func lift(_ handle: UInt64) throws -> AccessTokenProvider {+ if ((handle & 1) == 0) {+ // Rust-generated handle, construct a new class that uses the handle to implement the+ // interface+ return AccessTokenProviderImpl(unsafeFromHandle: handle)+ } else {+ // Swift-generated handle, get the object from the handle map+ return try handleMap.remove(handle: handle)+ }+ }++ public static func lower(_ value: AccessTokenProvider) -> UInt64 {+ if let rustImpl = value as? AccessTokenProviderImpl {+ // Rust-implemented object. Clone the handle and return it+ return rustImpl.uniffiCloneHandle()+ } else {+ // Swift object, generate a new vtable handle and return that.+ return handleMap.insert(obj: value)+ }+ }++ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccessTokenProvider {+ let handle: UInt64 = try readInt(&buf)+ return try lift(handle)+ }++ public static func write(_ value: AccessTokenProvider, into buf: inout [UInt8]) {+ writeInt(&buf, lower(value))+ }+}+++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeAccessTokenProvider_lift(_ handle: UInt64) throws -> AccessTokenProvider {+ return try FfiConverterTypeAccessTokenProvider.lift(handle)+}++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeAccessTokenProvider_lower(_ value: AccessTokenProvider) -> UInt64 {+ return FfiConverterTypeAccessTokenProvider.lower(value)+}++++++public protocol CyclopsClientProtocol: AnyObject, Sendable {func createClaim(request: CreateClaimRequest) async throws -> Claim@@ -617,6 +855,35 @@ public static func connect(configuration: CyclopsConfiguration, httpClient: Http})}+public static func connectBrowserWithAccessToken(configuration: CyclopsTokenProviderConfiguration, accessToken: String)throws -> CyclopsClient {+ return try FfiConverterTypeCyclopsClient_lift(try rustCallWithError(FfiConverterTypeSdkError_lift) {+ uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token(+ FfiConverterTypeCyclopsTokenProviderConfiguration_lower(configuration),+ FfiConverterString.lower(accessToken),$0+ )+})+}++public static func connectWithAccessToken(configuration: CyclopsTokenProviderConfiguration, accessToken: String, httpClient: HttpClient)throws -> CyclopsClient {+ return try FfiConverterTypeCyclopsClient_lift(try rustCallWithError(FfiConverterTypeSdkError_lift) {+ uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token(+ FfiConverterTypeCyclopsTokenProviderConfiguration_lower(configuration),+ FfiConverterString.lower(accessToken),+ FfiConverterTypeHttpClient_lower(httpClient),$0+ )+})+}++public static func connectWithAccessTokenProvider(configuration: CyclopsTokenProviderConfiguration, tokenProvider: AccessTokenProvider, httpClient: HttpClient)throws -> CyclopsClient {+ return try FfiConverterTypeCyclopsClient_lift(try rustCallWithError(FfiConverterTypeSdkError_lift) {+ uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(+ FfiConverterTypeCyclopsTokenProviderConfiguration_lower(configuration),+ FfiConverterTypeAccessTokenProvider_lower(tokenProvider),+ FfiConverterTypeHttpClient_lower(httpClient),$0+ )+})+}+open func createClaim(request: CreateClaimRequest)async throws -> Claim {@@ -1431,6 +1698,72 @@ public func FfiConverterTypeCyclopsConfiguration_lower(_ value: CyclopsConfigura}+public struct CyclopsTokenProviderConfiguration: Equatable, Hashable {+ public var baseUrl: String+ public var poolPollIntervalMs: UInt64+ public var poolPollLimit: UInt32+ public var claimPollIntervalMs: UInt64+ public var claimPollLimit: UInt32++ // Default memberwise initializers are never public by default, so we+ // declare one manually.+ public init(baseUrl: String, poolPollIntervalMs: UInt64, poolPollLimit: UInt32, claimPollIntervalMs: UInt64, claimPollLimit: UInt32) {+ self.baseUrl = baseUrl+ self.poolPollIntervalMs = poolPollIntervalMs+ self.poolPollLimit = poolPollLimit+ self.claimPollIntervalMs = claimPollIntervalMs+ self.claimPollLimit = claimPollLimit+ }+++++}++#if compiler(>=6)+extension CyclopsTokenProviderConfiguration: Sendable {}+#endif++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public struct FfiConverterTypeCyclopsTokenProviderConfiguration: FfiConverterRustBuffer {+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CyclopsTokenProviderConfiguration {+ return+ try CyclopsTokenProviderConfiguration(+ baseUrl: FfiConverterString.read(from: &buf),+ poolPollIntervalMs: FfiConverterUInt64.read(from: &buf),+ poolPollLimit: FfiConverterUInt32.read(from: &buf),+ claimPollIntervalMs: FfiConverterUInt64.read(from: &buf),+ claimPollLimit: FfiConverterUInt32.read(from: &buf)+ )+ }++ public static func write(_ value: CyclopsTokenProviderConfiguration, into buf: inout [UInt8]) {+ FfiConverterString.write(value.baseUrl, into: &buf)+ FfiConverterUInt64.write(value.poolPollIntervalMs, into: &buf)+ FfiConverterUInt32.write(value.poolPollLimit, into: &buf)+ FfiConverterUInt64.write(value.claimPollIntervalMs, into: &buf)+ FfiConverterUInt32.write(value.claimPollLimit, into: &buf)+ }+}+++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeCyclopsTokenProviderConfiguration_lift(_ buf: RustBuffer) throws -> CyclopsTokenProviderConfiguration {+ return try FfiConverterTypeCyclopsTokenProviderConfiguration.lift(buf)+}++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeCyclopsTokenProviderConfiguration_lower(_ value: CyclopsTokenProviderConfiguration) -> RustBuffer {+ return FfiConverterTypeCyclopsTokenProviderConfiguration.lower(value)+}++public struct HttpHeader: Equatable, Hashable {public var name: Stringpublic var value: String@@ -1795,6 +2128,80 @@ public func FfiConverterTypeSandbox_lower(_ value: Sandbox) -> RustBuffer {}+public enum AccessTokenProviderError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {++++ case Failed(reason: String+ )+++++++ public var errorDescription: String? {+ String(reflecting: self)+ }++}++#if compiler(>=6)+extension AccessTokenProviderError: Sendable {}+#endif++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public struct FfiConverterTypeAccessTokenProviderError: FfiConverterRustBuffer {+ typealias SwiftType = AccessTokenProviderError++ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccessTokenProviderError {+ let variant: Int32 = try readInt(&buf)+ switch variant {+++++ case 1: return .Failed(+ reason: try FfiConverterString.read(from: &buf)+ )++ default: throw UniffiInternalError.unexpectedEnumCase+ }+ }++ public static func write(_ value: AccessTokenProviderError, into buf: inout [UInt8]) {+ switch value {++++++ case let .Failed(reason):+ writeInt(&buf, Int32(1))+ FfiConverterString.write(reason, into: &buf)++ }+ }+}+++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeAccessTokenProviderError_lift(_ buf: RustBuffer) throws -> AccessTokenProviderError {+ return try FfiConverterTypeAccessTokenProviderError.lift(buf)+}++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeAccessTokenProviderError_lower(_ value: AccessTokenProviderError) -> RustBuffer {+ return FfiConverterTypeAccessTokenProviderError.lower(value)+}++public enum HttpError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {@@ -2472,16 +2879,29 @@ private let initializationResult: InitializationResult = {if (uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request() != 46699) {return InitializationResult.apiChecksumMismatch}+ if (uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token() != 1180) {+ return InitializationResult.apiChecksumMismatch+ }if (uniffi_cyclops_sdk_checksum_method_httpclient_execute() != 38803) {return InitializationResult.apiChecksumMismatch}if (uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() != 54404) {return InitializationResult.apiChecksumMismatch}+ if (uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token() != 55589) {+ return InitializationResult.apiChecksumMismatch+ }+ if (uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token() != 10148) {+ return InitializationResult.apiChecksumMismatch+ }+ if (uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider() != 58487) {+ return InitializationResult.apiChecksumMismatch+ }if (uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() != 25746) {return InitializationResult.apiChecksumMismatch}+ uniffiCallbackInitAccessTokenProvider()uniffiCallbackInitHttpClient()uniffiEnsureCyclopsSdkSchemaInitialized()return InitializationResult.okdiff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h b/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.hindex 8c1b2bec4c..b06b1814cd 100644--- a/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h@@ -242,12 +242,27 @@ typedef struct UniffiForeignFutureResultVoid {typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureResultVoid);+#endif+#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_ACCESS_TOKEN_PROVIDER_METHOD0+#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_ACCESS_TOKEN_PROVIDER_METHOD0+typedef void (*UniffiCallbackInterfaceAccessTokenProviderMethod0)(uint64_t, int8_t, UniffiForeignFutureCompleteRustBuffer _Nonnull, uint64_t, UniffiForeignFutureDroppedCallbackStruct* _Nonnull+ );+#endif#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_HTTP_CLIENT_METHOD0#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_HTTP_CLIENT_METHOD0typedef void (*UniffiCallbackInterfaceHttpClientMethod0)(uint64_t, RustBuffer, UniffiForeignFutureCompleteRustBuffer _Nonnull, uint64_t, UniffiForeignFutureDroppedCallbackStruct* _Nonnull);+#endif+#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_ACCESS_TOKEN_PROVIDER+#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_ACCESS_TOKEN_PROVIDER+typedef struct UniffiVTableCallbackInterfaceAccessTokenProvider {+ UniffiCallbackInterfaceFree _Nonnull uniffiFree;+ UniffiCallbackInterfaceClone _Nonnull uniffiClone;+ UniffiCallbackInterfaceAccessTokenProviderMethod0 _Nonnull getAccessToken;+} UniffiVTableCallbackInterfaceAccessTokenProvider;+#endif#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_HTTP_CLIENT#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_HTTP_CLIENT@@ -273,6 +288,21 @@ void uniffi_cyclops_sdk_fn_free_cyclopsclient(uint64_t handle, RustCallStatus *_uint64_t uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect(RustBuffer configuration, uint64_t http_client, RustCallStatus *_Nonnull out_status);#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_BROWSER_WITH_ACCESS_TOKEN+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_BROWSER_WITH_ACCESS_TOKEN+uint64_t uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token(RustBuffer configuration, RustBuffer access_token, RustCallStatus *_Nonnull out_status+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN+uint64_t uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token(RustBuffer configuration, RustBuffer access_token, uint64_t http_client, RustCallStatus *_Nonnull out_status+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN_PROVIDER+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN_PROVIDER+uint64_t uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(RustBuffer configuration, uint64_t token_provider, uint64_t http_client, RustCallStatus *_Nonnull out_status+);+#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CYCLOPSCLIENT_CREATE_CLAIM#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CYCLOPSCLIENT_CREATE_CLAIMuint64_t uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(uint64_t ptr, RustBuffer request@@ -328,6 +358,26 @@ uint64_t uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool(uint64_t ptr, Ruuint64_t uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(uint64_t ptr, RustBuffer sandbox, RustBuffer service, RustBuffer path, RustBuffer request);#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_ACCESSTOKENPROVIDER+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_ACCESSTOKENPROVIDER+uint64_t uniffi_cyclops_sdk_fn_clone_accesstokenprovider(uint64_t handle, RustCallStatus *_Nonnull out_status+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_FREE_ACCESSTOKENPROVIDER+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_FREE_ACCESSTOKENPROVIDER+void uniffi_cyclops_sdk_fn_free_accesstokenprovider(uint64_t handle, RustCallStatus *_Nonnull out_status+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_INIT_CALLBACK_VTABLE_ACCESSTOKENPROVIDER+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_INIT_CALLBACK_VTABLE_ACCESSTOKENPROVIDER+void uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(const UniffiVTableCallbackInterfaceAccessTokenProvider* _Nonnull vtable+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_ACCESSTOKENPROVIDER_GET_ACCESS_TOKEN+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_ACCESSTOKENPROVIDER_GET_ACCESS_TOKEN+uint64_t uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(uint64_t ptr, int8_t force_refresh+);+#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_HTTPCLIENT#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_HTTPCLIENTuint64_t uniffi_cyclops_sdk_fn_clone_httpclient(uint64_t handle, RustCallStatus *_Nonnull out_status@@ -687,6 +737,12 @@ uint16_t uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool(void#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CYCLOPSCLIENT_SERVICE_REQUESTuint16_t uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request(void+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_ACCESSTOKENPROVIDER_GET_ACCESS_TOKEN+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_ACCESSTOKENPROVIDER_GET_ACCESS_TOKEN+uint16_t uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token(void+);#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_HTTPCLIENT_EXECUTE@@ -699,6 +755,24 @@ uint16_t uniffi_cyclops_sdk_checksum_method_httpclient_execute(void#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECTuint16_t uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect(void+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_BROWSER_WITH_ACCESS_TOKEN+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_BROWSER_WITH_ACCESS_TOKEN+uint16_t uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token(void++);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN+uint16_t uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token(void++);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN_PROVIDER+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_ACCESS_TOKEN_PROVIDER+uint16_t uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider(void+);#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCREDENTIALS_NEWdiff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_module.rs b/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_module.rsindex 21a62cbe81..9f7ad399ef 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_module.rs+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/cpp/cyclops_sdk_module.rs@@ -15,6 +15,12 @@ extern "C" {http_client: u64,status_: &mut u::RustCallStatus,) -> u64;+ fn uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(+ configuration: u::RustBuffer,+ token_provider: u64,+ http_client: u64,+ status_: &mut u::RustCallStatus,+ ) -> u64;fn uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(ptr: u64,request: u::RustBuffer,@@ -62,6 +68,23 @@ extern "C" {path: u::RustBuffer,request: u::RustBuffer,) -> u64;+ fn uniffi_cyclops_sdk_fn_clone_accesstokenprovider(+ handle: u64,+ status_: &mut u::RustCallStatus,+ ) -> u64;+ fn uniffi_cyclops_sdk_fn_free_accesstokenprovider(+ handle: u64,+ status_: &mut u::RustCallStatus,+ );+ fn uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(+ vtable: std::ptr::NonNull<+ v_table_callback_interface_access_token_provider::VTableRs,+ >,+ );+ fn uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(+ ptr: u64,+ force_refresh: i8,+ ) -> u64;fn uniffi_cyclops_sdk_fn_clone_httpclient(handle: u64,status_: &mut u::RustCallStatus,@@ -233,8 +256,10 @@ extern "C" {fn uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools() -> u16;fn uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool() -> u16;fn uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request() -> u16;+ fn uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token() -> u16;fn uniffi_cyclops_sdk_checksum_method_httpclient_execute() -> u16;fn uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() -> u16;+ fn uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider() -> u16;fn uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() -> u16;fn ffi_cyclops_sdk_uniffi_contract_version() -> u32;}@@ -279,6 +304,25 @@ pub fn ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect(value_.into_js()}#[wasm_bindgen]+pub fn ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(+ configuration: js::ForeignBytes,+ token_provider: js::Handle,+ http_client: js::Handle,+ f_status_: &mut js::RustCallStatus,+) -> js::Handle {+ let mut u_status_ = u::RustCallStatus::default();+ let value_ = unsafe {+ uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(+ u::RustBuffer::into_rust(configuration),+ u64::into_rust(token_provider),+ u64::into_rust(http_client),+ &mut u_status_,+ )+ };+ f_status_.copy_from(u_status_);+ value_.into_js()+}+#[wasm_bindgen]pub unsafe fn ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(ptr: js::Handle,request: js::ForeignBytes,@@ -406,6 +450,56 @@ pub unsafe fn ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(.into_js()}#[wasm_bindgen]+pub fn ubrn_uniffi_cyclops_sdk_fn_clone_accesstokenprovider(+ handle: js::Handle,+ f_status_: &mut js::RustCallStatus,+) -> js::Handle {+ let mut u_status_ = u::RustCallStatus::default();+ let value_ = unsafe {+ uniffi_cyclops_sdk_fn_clone_accesstokenprovider(+ u64::into_rust(handle),+ &mut u_status_,+ )+ };+ f_status_.copy_from(u_status_);+ value_.into_js()+}+#[wasm_bindgen]+pub fn ubrn_uniffi_cyclops_sdk_fn_free_accesstokenprovider(+ handle: js::Handle,+ f_status_: &mut js::RustCallStatus,+) {+ let mut u_status_ = u::RustCallStatus::default();+ unsafe {+ uniffi_cyclops_sdk_fn_free_accesstokenprovider(+ u64::into_rust(handle),+ &mut u_status_,+ )+ };+ f_status_.copy_from(u_status_);+}+#[wasm_bindgen]+pub unsafe fn ubrn_uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(+ vtable: v_table_callback_interface_access_token_provider::VTableJs,+) {+ uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(+ std::ptr::NonNull::<+ v_table_callback_interface_access_token_provider::VTableRs,+ >::into_rust(vtable),+ );+}+#[wasm_bindgen]+pub unsafe fn ubrn_uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(+ ptr: js::Handle,+ force_refresh: js::Int8,+) -> js::Handle {+ uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(+ u64::into_rust(ptr),+ i8::into_rust(force_refresh),+ )+ .into_js()+}+#[wasm_bindgen]pub fn ubrn_uniffi_cyclops_sdk_fn_clone_httpclient(handle: js::Handle,f_status_: &mut js::RustCallStatus,@@ -926,6 +1020,10 @@ pub unsafe fn ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_requuniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request().into_js()}#[wasm_bindgen]+pub unsafe fn ubrn_uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token() -> js::UInt16 {+ uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token().into_js()+}+#[wasm_bindgen]pub unsafe fn ubrn_uniffi_cyclops_sdk_checksum_method_httpclient_execute() -> js::UInt16 {uniffi_cyclops_sdk_checksum_method_httpclient_execute().into_js()}@@ -934,6 +1032,11 @@ pub unsafe fn ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connectuniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect().into_js()}#[wasm_bindgen]+pub unsafe fn ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider() -> js::UInt16 {+ uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider()+ .into_js()+}+#[wasm_bindgen]pub unsafe fn ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() -> js::UInt16 {uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new().into_js()}@@ -941,25 +1044,25 @@ pub unsafe fn ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_nepub unsafe fn ubrn_ffi_cyclops_sdk_uniffi_contract_version() -> js::UInt32 {ffi_cyclops_sdk_uniffi_contract_version().into_js()}-mod foreign_future_result_i32 {+mod foreign_future_result_f64 {use super::*;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::Int32;+ fn return_value(this: &VTableJs) -> js::Float64;#[wasm_bindgen(method, getter)]fn call_status(this: &VTableJs) -> js::RustCallStatus;}#[repr(C)]pub(super) struct VTableRs {- return_value: i32,+ return_value: f64,call_status: u::RustCallStatus,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- return_value: i32::into_rust(v_.return_value()),+ return_value: f64::into_rust(v_.return_value()),call_status: u::RustCallStatus::into_rust(v_.call_status()),}}@@ -971,29 +1074,26 @@ mod foreign_future_result_i32 {}}}-mod foreign_future_dropped_callback_struct {+mod foreign_future_result_i8 {use super::*;- use super::foreign_future_dropped_callback as method_free;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn handle(this: &VTableJs) -> js::UInt64;+ fn return_value(this: &VTableJs) -> js::Int8;#[wasm_bindgen(method, getter)]- fn free(- this: &VTableJs,- ) -> method_free::JsCallbackFnForeignFutureDroppedCallback;+ fn call_status(this: &VTableJs) -> js::RustCallStatus;}#[repr(C)]pub(super) struct VTableRs {- handle: u64,- free: method_free::FnSig,+ return_value: i8,+ call_status: u::RustCallStatus,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- handle: u64::into_rust(v_.handle()),- free: method_free::FnSig::into_rust(v_.free()),+ return_value: i8::into_rust(v_.return_value()),+ call_status: u::RustCallStatus::into_rust(v_.call_status()),}}}@@ -1034,36 +1134,6 @@ mod foreign_future_result_u8 {}}}-mod foreign_future_result_rust_buffer {- use super::*;- #[wasm_bindgen]- extern "C" {- pub type VTableJs;- #[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::ForeignBytes;- #[wasm_bindgen(method, getter)]- fn call_status(this: &VTableJs) -> js::RustCallStatus;- }- #[repr(C)]- pub(super) struct VTableRs {- return_value: u::RustBuffer,- call_status: u::RustCallStatus,- }- impl IntoRust<VTableJs> for VTableRs {- fn into_rust(v_: VTableJs) -> Self {- Self {- return_value: u::RustBuffer::into_rust(v_.return_value()),- call_status: u::RustCallStatus::into_rust(v_.call_status()),- }- }- }- impl VTableJs {- #[allow(unused)]- pub(super) fn copy_into_return(self, rust: &mut VTableRs) {- *rust = <VTableRs>::into_rust(self);- }- }-}mod foreign_future_result_void {use super::*;#[wasm_bindgen]@@ -1090,85 +1160,25 @@ mod foreign_future_result_void {}}}-mod foreign_future_result_u64 {- use super::*;- #[wasm_bindgen]- extern "C" {- pub type VTableJs;- #[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::UInt64;- #[wasm_bindgen(method, getter)]- fn call_status(this: &VTableJs) -> js::RustCallStatus;- }- #[repr(C)]- pub(super) struct VTableRs {- return_value: u64,- call_status: u::RustCallStatus,- }- impl IntoRust<VTableJs> for VTableRs {- fn into_rust(v_: VTableJs) -> Self {- Self {- return_value: u64::into_rust(v_.return_value()),- call_status: u::RustCallStatus::into_rust(v_.call_status()),- }- }- }- impl VTableJs {- #[allow(unused)]- pub(super) fn copy_into_return(self, rust: &mut VTableRs) {- *rust = <VTableRs>::into_rust(self);- }- }-}-mod foreign_future_result_i8 {- use super::*;- #[wasm_bindgen]- extern "C" {- pub type VTableJs;- #[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::Int8;- #[wasm_bindgen(method, getter)]- fn call_status(this: &VTableJs) -> js::RustCallStatus;- }- #[repr(C)]- pub(super) struct VTableRs {- return_value: i8,- call_status: u::RustCallStatus,- }- impl IntoRust<VTableJs> for VTableRs {- fn into_rust(v_: VTableJs) -> Self {- Self {- return_value: i8::into_rust(v_.return_value()),- call_status: u::RustCallStatus::into_rust(v_.call_status()),- }- }- }- impl VTableJs {- #[allow(unused)]- pub(super) fn copy_into_return(self, rust: &mut VTableRs) {- *rust = <VTableRs>::into_rust(self);- }- }-}-mod foreign_future_result_u16 {+mod foreign_future_result_f32 {use super::*;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::UInt16;+ fn return_value(this: &VTableJs) -> js::Float32;#[wasm_bindgen(method, getter)]fn call_status(this: &VTableJs) -> js::RustCallStatus;}#[repr(C)]pub(super) struct VTableRs {- return_value: u16,+ return_value: f32,call_status: u::RustCallStatus,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- return_value: u16::into_rust(v_.return_value()),+ return_value: f32::into_rust(v_.return_value()),call_status: u::RustCallStatus::into_rust(v_.call_status()),}}@@ -1180,26 +1190,29 @@ mod foreign_future_result_u16 {}}}-mod foreign_future_result_i16 {+mod foreign_future_dropped_callback_struct {use super::*;+ use super::foreign_future_dropped_callback as method_free;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::Int16;+ fn handle(this: &VTableJs) -> js::UInt64;#[wasm_bindgen(method, getter)]- fn call_status(this: &VTableJs) -> js::RustCallStatus;+ fn free(+ this: &VTableJs,+ ) -> method_free::JsCallbackFnForeignFutureDroppedCallback;}#[repr(C)]pub(super) struct VTableRs {- return_value: i16,- call_status: u::RustCallStatus,+ handle: u64,+ free: method_free::FnSig,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- return_value: i16::into_rust(v_.return_value()),- call_status: u::RustCallStatus::into_rust(v_.call_status()),+ handle: u64::into_rust(v_.handle()),+ free: method_free::FnSig::into_rust(v_.free()),}}}@@ -1210,25 +1223,25 @@ mod foreign_future_result_i16 {}}}-mod foreign_future_result_f32 {+mod foreign_future_result_u64 {use super::*;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::Float32;+ fn return_value(this: &VTableJs) -> js::UInt64;#[wasm_bindgen(method, getter)]fn call_status(this: &VTableJs) -> js::RustCallStatus;}#[repr(C)]pub(super) struct VTableRs {- return_value: f32,+ return_value: u64,call_status: u::RustCallStatus,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- return_value: f32::into_rust(v_.return_value()),+ return_value: u64::into_rust(v_.return_value()),call_status: u::RustCallStatus::into_rust(v_.call_status()),}}@@ -1240,25 +1253,25 @@ mod foreign_future_result_f32 {}}}-mod foreign_future_result_i64 {+mod foreign_future_result_u32 {use super::*;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::Int64;+ fn return_value(this: &VTableJs) -> js::UInt32;#[wasm_bindgen(method, getter)]fn call_status(this: &VTableJs) -> js::RustCallStatus;}#[repr(C)]pub(super) struct VTableRs {- return_value: i64,+ return_value: u32,call_status: u::RustCallStatus,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- return_value: i64::into_rust(v_.return_value()),+ return_value: u32::into_rust(v_.return_value()),call_status: u::RustCallStatus::into_rust(v_.call_status()),}}@@ -1270,25 +1283,25 @@ mod foreign_future_result_i64 {}}}-mod foreign_future_result_f64 {+mod foreign_future_result_u16 {use super::*;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::Float64;+ fn return_value(this: &VTableJs) -> js::UInt16;#[wasm_bindgen(method, getter)]fn call_status(this: &VTableJs) -> js::RustCallStatus;}#[repr(C)]pub(super) struct VTableRs {- return_value: f64,+ return_value: u16,call_status: u::RustCallStatus,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- return_value: f64::into_rust(v_.return_value()),+ return_value: u16::into_rust(v_.return_value()),call_status: u::RustCallStatus::into_rust(v_.call_status()),}}@@ -1406,25 +1419,25 @@ mod v_table_callback_interface_http_client {}}}-mod foreign_future_result_u32 {+mod foreign_future_result_rust_buffer {use super::*;#[wasm_bindgen]extern "C" {pub type VTableJs;#[wasm_bindgen(method, getter)]- fn return_value(this: &VTableJs) -> js::UInt32;+ fn return_value(this: &VTableJs) -> js::ForeignBytes;#[wasm_bindgen(method, getter)]fn call_status(this: &VTableJs) -> js::RustCallStatus;}#[repr(C)]pub(super) struct VTableRs {- return_value: u32,+ return_value: u::RustBuffer,call_status: u::RustCallStatus,}impl IntoRust<VTableJs> for VTableRs {fn into_rust(v_: VTableJs) -> Self {Self {- return_value: u32::into_rust(v_.return_value()),+ return_value: u::RustBuffer::into_rust(v_.return_value()),call_status: u::RustCallStatus::into_rust(v_.call_status()),}}@@ -1436,39 +1449,205 @@ mod foreign_future_result_u32 {}}}-mod rust_future_continuation_callback {+mod foreign_future_result_i64 {use super::*;#[wasm_bindgen]extern "C" {- #[wasm_bindgen]- pub type JsCallbackFnRustFutureContinuationCallback;- #[wasm_bindgen(method)]- pub fn call(- this_: &JsCallbackFnRustFutureContinuationCallback,- ctx_: &JsCallbackFnRustFutureContinuationCallback,- data: js::UInt64,- poll_result: js::Int8,- );- }- thread_local! {- static CALLBACK : js::ForeignCell < JsCallbackFnRustFutureContinuationCallback >- = js::ForeignCell::new();+ pub type VTableJs;+ #[wasm_bindgen(method, getter)]+ fn return_value(this: &VTableJs) -> js::Int64;+ #[wasm_bindgen(method, getter)]+ fn call_status(this: &VTableJs) -> js::RustCallStatus;}- impl IntoRust<JsCallbackFnRustFutureContinuationCallback> for FnSig {- fn into_rust(callback: JsCallbackFnRustFutureContinuationCallback) -> Self {+ #[repr(C)]+ pub(super) struct VTableRs {+ return_value: i64,+ call_status: u::RustCallStatus,+ }+ impl IntoRust<VTableJs> for VTableRs {+ fn into_rust(v_: VTableJs) -> Self {+ Self {+ return_value: i64::into_rust(v_.return_value()),+ call_status: u::RustCallStatus::into_rust(v_.call_status()),+ }+ }+ }+ impl VTableJs {+ #[allow(unused)]+ pub(super) fn copy_into_return(self, rust: &mut VTableRs) {+ *rust = <VTableRs>::into_rust(self);+ }+ }+}+mod foreign_future_result_i32 {+ use super::*;+ #[wasm_bindgen]+ extern "C" {+ pub type VTableJs;+ #[wasm_bindgen(method, getter)]+ fn return_value(this: &VTableJs) -> js::Int32;+ #[wasm_bindgen(method, getter)]+ fn call_status(this: &VTableJs) -> js::RustCallStatus;+ }+ #[repr(C)]+ pub(super) struct VTableRs {+ return_value: i32,+ call_status: u::RustCallStatus,+ }+ impl IntoRust<VTableJs> for VTableRs {+ fn into_rust(v_: VTableJs) -> Self {+ Self {+ return_value: i32::into_rust(v_.return_value()),+ call_status: u::RustCallStatus::into_rust(v_.call_status()),+ }+ }+ }+ impl VTableJs {+ #[allow(unused)]+ pub(super) fn copy_into_return(self, rust: &mut VTableRs) {+ *rust = <VTableRs>::into_rust(self);+ }+ }+}+#[allow(non_snake_case)]+mod v_table_callback_interface_access_token_provider__free {+ use super::*;+ #[wasm_bindgen]+ extern "C" {+ #[wasm_bindgen]+ pub type JsCallbackFnVTableCallbackInterfaceAccessTokenProviderFree;+ #[wasm_bindgen(method)]+ pub fn call(+ this_: &JsCallbackFnVTableCallbackInterfaceAccessTokenProviderFree,+ ctx_: &JsCallbackFnVTableCallbackInterfaceAccessTokenProviderFree,+ handle: js::UInt64,+ );+ }+ thread_local! {+ static CALLBACK : js::ForeignCell <+ JsCallbackFnVTableCallbackInterfaceAccessTokenProviderFree > =+ js::ForeignCell::new();+ }+ impl IntoRust<JsCallbackFnVTableCallbackInterfaceAccessTokenProviderFree> for FnSig {+ fn into_rust(+ callback: JsCallbackFnVTableCallbackInterfaceAccessTokenProviderFree,+ ) -> Self {CALLBACK.with(|cell| cell.set(callback));implementation}}- pub(super) type FnSig = extern "C" fn(data: u64, poll_result: i8);- extern "C" fn implementation(data: u64, poll_result: i8) {+ pub(super) type FnSig = extern "C" fn(handle: u64);+ extern "C" fn implementation(handle: u64) {CALLBACK.with(|cell_| {- cell_- .with_value(|callback_| {- callback_.call(callback_, data.into_js(), poll_result.into_js())- })+ cell_.with_value(|callback_| callback_.call(callback_, handle.into_js()))+ });+ }+}+#[allow(non_snake_case)]+mod v_table_callback_interface_access_token_provider__clone {+ use super::*;+ #[wasm_bindgen]+ extern "C" {+ #[wasm_bindgen]+ pub type JsCallbackFnVTableCallbackInterfaceAccessTokenProviderClone;+ #[wasm_bindgen(method)]+ pub fn call(+ this_: &JsCallbackFnVTableCallbackInterfaceAccessTokenProviderClone,+ ctx_: &JsCallbackFnVTableCallbackInterfaceAccessTokenProviderClone,+ handle: js::UInt64,+ ) -> js::UInt64;+ }+ thread_local! {+ static CALLBACK : js::ForeignCell <+ JsCallbackFnVTableCallbackInterfaceAccessTokenProviderClone > =+ js::ForeignCell::new();+ }+ impl IntoRust<JsCallbackFnVTableCallbackInterfaceAccessTokenProviderClone>+ for FnSig {+ fn into_rust(+ callback: JsCallbackFnVTableCallbackInterfaceAccessTokenProviderClone,+ ) -> Self {+ CALLBACK.with(|cell| cell.set(callback));+ implementation+ }+ }+ pub(super) type FnSig = extern "C" fn(handle: u64) -> u64;+ extern "C" fn implementation(handle: u64) -> u64 {+ let uniffi_result_ = CALLBACK+ .with(|cell_| {+ cell_.with_value(|callback_| callback_.call(callback_, handle.into_js()))});+ u64::into_rust(uniffi_result_)+ }+}+mod v_table_callback_interface_access_token_provider {+ use super::*;+ use super::v_table_callback_interface_access_token_provider__free as method_uniffi_free;+ use super::v_table_callback_interface_access_token_provider__clone as method_uniffi_clone;+ use super::callback_interface_access_token_provider_method0 as method_get_access_token;+ #[wasm_bindgen]+ extern "C" {+ pub type VTableJs;+ #[wasm_bindgen(method, getter)]+ fn uniffi_free(+ this: &VTableJs,+ ) -> method_uniffi_free::JsCallbackFnVTableCallbackInterfaceAccessTokenProviderFree;+ #[wasm_bindgen(method, getter)]+ fn uniffi_clone(+ this: &VTableJs,+ ) -> method_uniffi_clone::JsCallbackFnVTableCallbackInterfaceAccessTokenProviderClone;+ #[wasm_bindgen(method, getter)]+ fn get_access_token(+ this: &VTableJs,+ ) -> method_get_access_token::JsCallbackFnCallbackInterfaceAccessTokenProviderMethod0;+ }+ #[repr(C)]+ pub(super) struct VTableRs {+ uniffi_free: method_uniffi_free::FnSig,+ uniffi_clone: method_uniffi_clone::FnSig,+ get_access_token: method_get_access_token::FnSig,+ }+ impl IntoRust<VTableJs> for VTableRs {+ fn into_rust(v_: VTableJs) -> Self {+ Self {+ uniffi_free: method_uniffi_free::FnSig::into_rust(v_.uniffi_free()),+ uniffi_clone: method_uniffi_clone::FnSig::into_rust(v_.uniffi_clone()),+ get_access_token: method_get_access_token::FnSig::into_rust(+ v_.get_access_token(),+ ),+ }+ }+ }+}+mod foreign_future_result_i16 {+ use super::*;+ #[wasm_bindgen]+ extern "C" {+ pub type VTableJs;+ #[wasm_bindgen(method, getter)]+ fn return_value(this: &VTableJs) -> js::Int16;+ #[wasm_bindgen(method, getter)]+ fn call_status(this: &VTableJs) -> js::RustCallStatus;+ }+ #[repr(C)]+ pub(super) struct VTableRs {+ return_value: i16,+ call_status: u::RustCallStatus,+ }+ impl IntoRust<VTableJs> for VTableRs {+ fn into_rust(v_: VTableJs) -> Self {+ Self {+ return_value: i16::into_rust(v_.return_value()),+ call_status: u::RustCallStatus::into_rust(v_.call_status()),+ }+ }+ }+ impl VTableJs {+ #[allow(unused)]+ pub(super) fn copy_into_return(self, rust: &mut VTableRs) {+ *rust = <VTableRs>::into_rust(self);+ }}}mod foreign_future_dropped_callback {@@ -1502,77 +1681,188 @@ mod foreign_future_dropped_callback {});}}-mod foreign_future_complete_u32 {+mod foreign_future_complete_i16 {use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteU32)]- pub struct JsCallbackFnForeignFutureCompleteU32 {+ #[wasm_bindgen(js_name = ForeignFutureCompleteI16)]+ pub struct JsCallbackFnForeignFutureCompleteI16 {callback: FnSig,}- impl JsCallbackFnForeignFutureCompleteU32 {+ impl JsCallbackFnForeignFutureCompleteI16 {fn new(callback: FnSig) -> Self {Self { callback }}}- #[wasm_bindgen(js_class = ForeignFutureCompleteU32)]- impl JsCallbackFnForeignFutureCompleteU32 {+ #[wasm_bindgen(js_class = ForeignFutureCompleteI16)]+ impl JsCallbackFnForeignFutureCompleteI16 {#[wasm_bindgen]pub fn call(&self,_ctx: &Self,callback_data: js::UInt64,- result: foreign_future_result_u32::VTableJs,+ result: foreign_future_result_i16::VTableJs,) {(self.callback)(u64::into_rust(callback_data),- foreign_future_result_u32::VTableRs::into_rust(result),+ foreign_future_result_i16::VTableRs::into_rust(result),)}}pub(super) type FnSig = extern "C" fn(callback_data: u64,- result: foreign_future_result_u32::VTableRs,+ result: foreign_future_result_i16::VTableRs,);- impl IntoJs<JsCallbackFnForeignFutureCompleteU32> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteU32 {- JsCallbackFnForeignFutureCompleteU32::new(self)+ impl IntoJs<JsCallbackFnForeignFutureCompleteI16> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteI16 {+ JsCallbackFnForeignFutureCompleteI16::new(self)}}}-mod foreign_future_complete_f32 {+mod foreign_future_complete_u8 {use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteF32)]- pub struct JsCallbackFnForeignFutureCompleteF32 {+ #[wasm_bindgen(js_name = ForeignFutureCompleteU8)]+ pub struct JsCallbackFnForeignFutureCompleteU8 {callback: FnSig,}- impl JsCallbackFnForeignFutureCompleteF32 {+ impl JsCallbackFnForeignFutureCompleteU8 {fn new(callback: FnSig) -> Self {Self { callback }}}- #[wasm_bindgen(js_class = ForeignFutureCompleteF32)]- impl JsCallbackFnForeignFutureCompleteF32 {+ #[wasm_bindgen(js_class = ForeignFutureCompleteU8)]+ impl JsCallbackFnForeignFutureCompleteU8 {#[wasm_bindgen]pub fn call(&self,_ctx: &Self,callback_data: js::UInt64,- result: foreign_future_result_f32::VTableJs,+ result: foreign_future_result_u8::VTableJs,) {(self.callback)(u64::into_rust(callback_data),- foreign_future_result_f32::VTableRs::into_rust(result),+ foreign_future_result_u8::VTableRs::into_rust(result),)}}pub(super) type FnSig = extern "C" fn(callback_data: u64,- result: foreign_future_result_f32::VTableRs,+ result: foreign_future_result_u8::VTableRs,);- impl IntoJs<JsCallbackFnForeignFutureCompleteF32> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteF32 {- JsCallbackFnForeignFutureCompleteF32::new(self)+ impl IntoJs<JsCallbackFnForeignFutureCompleteU8> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteU8 {+ JsCallbackFnForeignFutureCompleteU8::new(self)+ }+ }+}+mod foreign_future_complete_i8 {+ use super::*;+ #[wasm_bindgen(js_name = ForeignFutureCompleteI8)]+ pub struct JsCallbackFnForeignFutureCompleteI8 {+ callback: FnSig,+ }+ impl JsCallbackFnForeignFutureCompleteI8 {+ fn new(callback: FnSig) -> Self {+ Self { callback }+ }+ }+ #[wasm_bindgen(js_class = ForeignFutureCompleteI8)]+ impl JsCallbackFnForeignFutureCompleteI8 {+ #[wasm_bindgen]+ pub fn call(+ &self,+ _ctx: &Self,+ callback_data: js::UInt64,+ result: foreign_future_result_i8::VTableJs,+ ) {+ (self+ .callback)(+ u64::into_rust(callback_data),+ foreign_future_result_i8::VTableRs::into_rust(result),+ )+ }+ }+ pub(super) type FnSig = extern "C" fn(+ callback_data: u64,+ result: foreign_future_result_i8::VTableRs,+ );+ impl IntoJs<JsCallbackFnForeignFutureCompleteI8> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteI8 {+ JsCallbackFnForeignFutureCompleteI8::new(self)+ }+ }+}+mod foreign_future_complete_f64 {+ use super::*;+ #[wasm_bindgen(js_name = ForeignFutureCompleteF64)]+ pub struct JsCallbackFnForeignFutureCompleteF64 {+ callback: FnSig,+ }+ impl JsCallbackFnForeignFutureCompleteF64 {+ fn new(callback: FnSig) -> Self {+ Self { callback }+ }+ }+ #[wasm_bindgen(js_class = ForeignFutureCompleteF64)]+ impl JsCallbackFnForeignFutureCompleteF64 {+ #[wasm_bindgen]+ pub fn call(+ &self,+ _ctx: &Self,+ callback_data: js::UInt64,+ result: foreign_future_result_f64::VTableJs,+ ) {+ (self+ .callback)(+ u64::into_rust(callback_data),+ foreign_future_result_f64::VTableRs::into_rust(result),+ )+ }+ }+ pub(super) type FnSig = extern "C" fn(+ callback_data: u64,+ result: foreign_future_result_f64::VTableRs,+ );+ impl IntoJs<JsCallbackFnForeignFutureCompleteF64> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteF64 {+ JsCallbackFnForeignFutureCompleteF64::new(self)+ }+ }+}+mod foreign_future_complete_u32 {+ use super::*;+ #[wasm_bindgen(js_name = ForeignFutureCompleteU32)]+ pub struct JsCallbackFnForeignFutureCompleteU32 {+ callback: FnSig,+ }+ impl JsCallbackFnForeignFutureCompleteU32 {+ fn new(callback: FnSig) -> Self {+ Self { callback }+ }+ }+ #[wasm_bindgen(js_class = ForeignFutureCompleteU32)]+ impl JsCallbackFnForeignFutureCompleteU32 {+ #[wasm_bindgen]+ pub fn call(+ &self,+ _ctx: &Self,+ callback_data: js::UInt64,+ result: foreign_future_result_u32::VTableJs,+ ) {+ (self+ .callback)(+ u64::into_rust(callback_data),+ foreign_future_result_u32::VTableRs::into_rust(result),+ )+ }+ }+ pub(super) type FnSig = extern "C" fn(+ callback_data: u64,+ result: foreign_future_result_u32::VTableRs,+ );+ impl IntoJs<JsCallbackFnForeignFutureCompleteU32> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteU32 {+ JsCallbackFnForeignFutureCompleteU32::new(self)}}}@@ -1613,40 +1903,40 @@ mod foreign_future_complete_u16 {}}}-mod foreign_future_complete_i32 {+mod foreign_future_complete_i64 {use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteI32)]- pub struct JsCallbackFnForeignFutureCompleteI32 {+ #[wasm_bindgen(js_name = ForeignFutureCompleteI64)]+ pub struct JsCallbackFnForeignFutureCompleteI64 {callback: FnSig,}- impl JsCallbackFnForeignFutureCompleteI32 {+ impl JsCallbackFnForeignFutureCompleteI64 {fn new(callback: FnSig) -> Self {Self { callback }}}- #[wasm_bindgen(js_class = ForeignFutureCompleteI32)]- impl JsCallbackFnForeignFutureCompleteI32 {+ #[wasm_bindgen(js_class = ForeignFutureCompleteI64)]+ impl JsCallbackFnForeignFutureCompleteI64 {#[wasm_bindgen]pub fn call(&self,_ctx: &Self,callback_data: js::UInt64,- result: foreign_future_result_i32::VTableJs,+ result: foreign_future_result_i64::VTableJs,) {(self.callback)(u64::into_rust(callback_data),- foreign_future_result_i32::VTableRs::into_rust(result),+ foreign_future_result_i64::VTableRs::into_rust(result),)}}pub(super) type FnSig = extern "C" fn(callback_data: u64,- result: foreign_future_result_i32::VTableRs,+ result: foreign_future_result_i64::VTableRs,);- impl IntoJs<JsCallbackFnForeignFutureCompleteI32> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteI32 {- JsCallbackFnForeignFutureCompleteI32::new(self)+ impl IntoJs<JsCallbackFnForeignFutureCompleteI64> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteI64 {+ JsCallbackFnForeignFutureCompleteI64::new(self)}}}@@ -1687,114 +1977,114 @@ mod foreign_future_complete_u64 {}}}-mod foreign_future_complete_f64 {+mod foreign_future_complete_i32 {use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteF64)]- pub struct JsCallbackFnForeignFutureCompleteF64 {+ #[wasm_bindgen(js_name = ForeignFutureCompleteI32)]+ pub struct JsCallbackFnForeignFutureCompleteI32 {callback: FnSig,}- impl JsCallbackFnForeignFutureCompleteF64 {+ impl JsCallbackFnForeignFutureCompleteI32 {fn new(callback: FnSig) -> Self {Self { callback }}}- #[wasm_bindgen(js_class = ForeignFutureCompleteF64)]- impl JsCallbackFnForeignFutureCompleteF64 {+ #[wasm_bindgen(js_class = ForeignFutureCompleteI32)]+ impl JsCallbackFnForeignFutureCompleteI32 {#[wasm_bindgen]pub fn call(&self,_ctx: &Self,callback_data: js::UInt64,- result: foreign_future_result_f64::VTableJs,+ result: foreign_future_result_i32::VTableJs,) {(self.callback)(u64::into_rust(callback_data),- foreign_future_result_f64::VTableRs::into_rust(result),+ foreign_future_result_i32::VTableRs::into_rust(result),)}}pub(super) type FnSig = extern "C" fn(callback_data: u64,- result: foreign_future_result_f64::VTableRs,+ result: foreign_future_result_i32::VTableRs,);- impl IntoJs<JsCallbackFnForeignFutureCompleteF64> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteF64 {- JsCallbackFnForeignFutureCompleteF64::new(self)+ impl IntoJs<JsCallbackFnForeignFutureCompleteI32> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteI32 {+ JsCallbackFnForeignFutureCompleteI32::new(self)}}}-mod foreign_future_complete_i16 {+mod foreign_future_complete_f32 {use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteI16)]- pub struct JsCallbackFnForeignFutureCompleteI16 {+ #[wasm_bindgen(js_name = ForeignFutureCompleteF32)]+ pub struct JsCallbackFnForeignFutureCompleteF32 {callback: FnSig,}- impl JsCallbackFnForeignFutureCompleteI16 {+ impl JsCallbackFnForeignFutureCompleteF32 {fn new(callback: FnSig) -> Self {Self { callback }}}- #[wasm_bindgen(js_class = ForeignFutureCompleteI16)]- impl JsCallbackFnForeignFutureCompleteI16 {+ #[wasm_bindgen(js_class = ForeignFutureCompleteF32)]+ impl JsCallbackFnForeignFutureCompleteF32 {#[wasm_bindgen]pub fn call(&self,_ctx: &Self,callback_data: js::UInt64,- result: foreign_future_result_i16::VTableJs,+ result: foreign_future_result_f32::VTableJs,) {(self.callback)(u64::into_rust(callback_data),- foreign_future_result_i16::VTableRs::into_rust(result),+ foreign_future_result_f32::VTableRs::into_rust(result),)}}pub(super) type FnSig = extern "C" fn(callback_data: u64,- result: foreign_future_result_i16::VTableRs,+ result: foreign_future_result_f32::VTableRs,);- impl IntoJs<JsCallbackFnForeignFutureCompleteI16> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteI16 {- JsCallbackFnForeignFutureCompleteI16::new(self)+ impl IntoJs<JsCallbackFnForeignFutureCompleteF32> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteF32 {+ JsCallbackFnForeignFutureCompleteF32::new(self)}}}-mod foreign_future_complete_i8 {+mod foreign_future_complete_void {use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteI8)]- pub struct JsCallbackFnForeignFutureCompleteI8 {+ #[wasm_bindgen(js_name = ForeignFutureCompleteVoid)]+ pub struct JsCallbackFnForeignFutureCompleteVoid {callback: FnSig,}- impl JsCallbackFnForeignFutureCompleteI8 {+ impl JsCallbackFnForeignFutureCompleteVoid {fn new(callback: FnSig) -> Self {Self { callback }}}- #[wasm_bindgen(js_class = ForeignFutureCompleteI8)]- impl JsCallbackFnForeignFutureCompleteI8 {+ #[wasm_bindgen(js_class = ForeignFutureCompleteVoid)]+ impl JsCallbackFnForeignFutureCompleteVoid {#[wasm_bindgen]pub fn call(&self,_ctx: &Self,callback_data: js::UInt64,- result: foreign_future_result_i8::VTableJs,+ result: foreign_future_result_void::VTableJs,) {(self.callback)(u64::into_rust(callback_data),- foreign_future_result_i8::VTableRs::into_rust(result),+ foreign_future_result_void::VTableRs::into_rust(result),)}}pub(super) type FnSig = extern "C" fn(callback_data: u64,- result: foreign_future_result_i8::VTableRs,+ result: foreign_future_result_void::VTableRs,);- impl IntoJs<JsCallbackFnForeignFutureCompleteI8> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteI8 {- JsCallbackFnForeignFutureCompleteI8::new(self)+ impl IntoJs<JsCallbackFnForeignFutureCompleteVoid> for FnSig {+ fn into_js(self) -> JsCallbackFnForeignFutureCompleteVoid {+ JsCallbackFnForeignFutureCompleteVoid::new(self)}}}@@ -1835,42 +2125,100 @@ mod foreign_future_complete_rust_buffer {}}}-mod foreign_future_complete_u8 {+mod callback_interface_access_token_provider_method0 {use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteU8)]- pub struct JsCallbackFnForeignFutureCompleteU8 {- callback: FnSig,- }- impl JsCallbackFnForeignFutureCompleteU8 {- fn new(callback: FnSig) -> Self {- Self { callback }- }- }- #[wasm_bindgen(js_class = ForeignFutureCompleteU8)]- impl JsCallbackFnForeignFutureCompleteU8 {+ #[wasm_bindgen]+ extern "C" {#[wasm_bindgen]+ pub type JsCallbackFnCallbackInterfaceAccessTokenProviderMethod0;+ #[wasm_bindgen(method)]pub fn call(- &self,- _ctx: &Self,- callback_data: js::UInt64,- result: foreign_future_result_u8::VTableJs,- ) {- (self- .callback)(- u64::into_rust(callback_data),- foreign_future_result_u8::VTableRs::into_rust(result),- )+ this_: &JsCallbackFnCallbackInterfaceAccessTokenProviderMethod0,+ ctx_: &JsCallbackFnCallbackInterfaceAccessTokenProviderMethod0,+ uniffi_handle: js::UInt64,+ force_refresh: js::Int8,+ uniffi_future_callback: foreign_future_complete_rust_buffer::JsCallbackFnForeignFutureCompleteRustBuffer,+ uniffi_callback_data: js::UInt64,+ ) -> foreign_future_dropped_callback_struct::VTableJs;+ }+ thread_local! {+ static CALLBACK : js::ForeignCell <+ JsCallbackFnCallbackInterfaceAccessTokenProviderMethod0 > =+ js::ForeignCell::new();+ }+ impl IntoRust<JsCallbackFnCallbackInterfaceAccessTokenProviderMethod0> for FnSig {+ fn into_rust(+ callback: JsCallbackFnCallbackInterfaceAccessTokenProviderMethod0,+ ) -> Self {+ CALLBACK.with(|cell| cell.set(callback));+ implementation}}pub(super) type FnSig = extern "C" fn(- callback_data: u64,- result: foreign_future_result_u8::VTableRs,+ uniffi_handle: u64,+ force_refresh: i8,+ uniffi_future_callback: foreign_future_complete_rust_buffer::FnSig,+ uniffi_callback_data: u64,+ rs_return_: &mut foreign_future_dropped_callback_struct::VTableRs,);- impl IntoJs<JsCallbackFnForeignFutureCompleteU8> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteU8 {- JsCallbackFnForeignFutureCompleteU8::new(self)+ extern "C" fn implementation(+ uniffi_handle: u64,+ force_refresh: i8,+ uniffi_future_callback: foreign_future_complete_rust_buffer::FnSig,+ uniffi_callback_data: u64,+ rs_return_: &mut foreign_future_dropped_callback_struct::VTableRs,+ ) {+ let uniffi_result_ = CALLBACK+ .with(|cell_| {+ cell_+ .with_value(|callback_| {+ callback_+ .call(+ callback_,+ uniffi_handle.into_js(),+ force_refresh.into_js(),+ uniffi_future_callback.into_js(),+ uniffi_callback_data.into_js(),+ )+ })+ });+ uniffi_result_.copy_into_return(rs_return_);+ }+}+mod rust_future_continuation_callback {+ use super::*;+ #[wasm_bindgen]+ extern "C" {+ #[wasm_bindgen]+ pub type JsCallbackFnRustFutureContinuationCallback;+ #[wasm_bindgen(method)]+ pub fn call(+ this_: &JsCallbackFnRustFutureContinuationCallback,+ ctx_: &JsCallbackFnRustFutureContinuationCallback,+ data: js::UInt64,+ poll_result: js::Int8,+ );+ }+ thread_local! {+ static CALLBACK : js::ForeignCell < JsCallbackFnRustFutureContinuationCallback >+ = js::ForeignCell::new();+ }+ impl IntoRust<JsCallbackFnRustFutureContinuationCallback> for FnSig {+ fn into_rust(callback: JsCallbackFnRustFutureContinuationCallback) -> Self {+ CALLBACK.with(|cell| cell.set(callback));+ implementation}}+ pub(super) type FnSig = extern "C" fn(data: u64, poll_result: i8);+ extern "C" fn implementation(data: u64, poll_result: i8) {+ CALLBACK+ .with(|cell_| {+ cell_+ .with_value(|callback_| {+ callback_.call(callback_, data.into_js(), poll_result.into_js())+ })+ });+ }}mod callback_interface_http_client_method0 {use super::*;@@ -1929,77 +2277,3 @@ mod callback_interface_http_client_method0 {uniffi_result_.copy_into_return(rs_return_);}}-mod foreign_future_complete_void {- use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteVoid)]- pub struct JsCallbackFnForeignFutureCompleteVoid {- callback: FnSig,- }- impl JsCallbackFnForeignFutureCompleteVoid {- fn new(callback: FnSig) -> Self {- Self { callback }- }- }- #[wasm_bindgen(js_class = ForeignFutureCompleteVoid)]- impl JsCallbackFnForeignFutureCompleteVoid {- #[wasm_bindgen]- pub fn call(- &self,- _ctx: &Self,- callback_data: js::UInt64,- result: foreign_future_result_void::VTableJs,- ) {- (self- .callback)(- u64::into_rust(callback_data),- foreign_future_result_void::VTableRs::into_rust(result),- )- }- }- pub(super) type FnSig = extern "C" fn(- callback_data: u64,- result: foreign_future_result_void::VTableRs,- );- impl IntoJs<JsCallbackFnForeignFutureCompleteVoid> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteVoid {- JsCallbackFnForeignFutureCompleteVoid::new(self)- }- }-}-mod foreign_future_complete_i64 {- use super::*;- #[wasm_bindgen(js_name = ForeignFutureCompleteI64)]- pub struct JsCallbackFnForeignFutureCompleteI64 {- callback: FnSig,- }- impl JsCallbackFnForeignFutureCompleteI64 {- fn new(callback: FnSig) -> Self {- Self { callback }- }- }- #[wasm_bindgen(js_class = ForeignFutureCompleteI64)]- impl JsCallbackFnForeignFutureCompleteI64 {- #[wasm_bindgen]- pub fn call(- &self,- _ctx: &Self,- callback_data: js::UInt64,- result: foreign_future_result_i64::VTableJs,- ) {- (self- .callback)(- u64::into_rust(callback_data),- foreign_future_result_i64::VTableRs::into_rust(result),- )- }- }- pub(super) type FnSig = extern "C" fn(- callback_data: u64,- result: foreign_future_result_i64::VTableRs,- );- impl IntoJs<JsCallbackFnForeignFutureCompleteI64> for FnSig {- fn into_js(self) -> JsCallbackFnForeignFutureCompleteI64 {- JsCallbackFnForeignFutureCompleteI64::new(self)- }- }-}diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/README.md b/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/README.mdindex c8bda37e6f..8bbbd7fa4f 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/README.md+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/README.md@@ -6,25 +6,44 @@ UniFFI `HttpClient` callback.## Security-The page accepts an OAuth client secret and the generated SDK passes it to the-token endpoint. Do not deploy this page with a production secret. Use a-development-only OAuth client, HTTPS, and a trusted origin with required CORS-policies for the control plane and token endpoint.+The browser never receives OAuth client credentials. A trusted runner mints a+short-lived access token through client credentials, then injects only that+token through `window.__CYCLOPS_BROWSER_CONFIG__` before the page starts.++A browser app hosted on a different origin needs the control plane to allow+that origin with CORS. Do not work around a CORS failure by exposing client+credentials to browser code.++The GitHub Actions live test keeps its control-plane calls same-origin: Playwright+intercepts the generated bundle at a temporary `https://run.cua.ai` path. Vite on+`http://127.0.0.1:4174` remains only for the local artifact and UI-boundary tests.## Build prerequisiteThe generated browser sources import `ts/wasm-bindgen/index.js`. That module isemitted by the UniFFI React Native browser/WASM pipeline and is not checked into-this binding directory. Provide a project `ubrn.config.yaml` and run that WASM-build pipeline first so its crate and JS glue are generated beside `ts`.+this binding directory. `ts/wasm-bindgen/`, its Rust build directory, and the+bundled `examples/dist/` output are generated artifacts and are not committed.++Build the artifacts from the repository root:-After the WASM output exists, bundle `browser.ts` as an ESM browser entrypoint-to `examples/dist/browser.js` using the project's browser bundler. `index.html`-loads that compiled bundle rather than raw TypeScript.+```bash+cyclops-cs/scripts/build-browser-sdk-binding.sh+```++This also applies the pinned compatibility patch required by the UBRN WASM+template and bundles `browser.ts` as `examples/dist/browser.js`.## Serve and run-Serve this directory after bundling, for example with `npx serve .`, then open-the printed URL. Enter the settings, development OAuth client, image, and-namespace, then select **Run Lifecycle**. The example creates a one-replica pool+Set `window.__CYCLOPS_BROWSER_CONFIG__` before loading the page, then serve this+directory and select **Run Lifecycle**. The example creates a one-replica poolexposing `mcp` on port `3000`, sends `GET /health`, and cleans up its resources.++GitHub Actions uses the repository runner script, which mints and masks the+token before it runs the browser artifact, browser boundary, and live lifecycle+tests:++```bash+cyclops-cs/scripts/run-browser-sdk-binding.sh+```diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/browser.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/browser.tsindex 7ec06a3214..0e3ff42134 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/browser.ts+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/browser.ts@@ -1,121 +1,153 @@import {CyclopsClient,- CyclopsCredentials,+ uniffiInitAsync,type Claim,- type HttpClient,- type HttpRequest,- type HttpResponse,type Pool,-} from "../ts/cyclops_sdk";-import type { ClaimSpec, PoolSpec } from "../ts/cyclops_sdk_schema";--const serviceName = "mcp";-const servicePath = "/health";-const output = document.querySelector<HTMLPreElement>("#output")!;-const runButton = document.querySelector<HTMLButtonElement>("#run")!;-const form = document.querySelector<HTMLFormElement>("#config")!;--class FetchHttpClient implements HttpClient {- async execute(request: HttpRequest): Promise<HttpResponse> {- const response = await fetch(request.url, {- method: request.method,- headers: request.headers.map(({ name, value }) => [name, value]),- body: request.body,- });- return {- status: response.status,- headers: [...response.headers].map(([name, value]) => ({ name, value })),- body: await response.arrayBuffer(),- };+} from "../ts/index.web"+import type { PoolSpec } from "../ts/cyclops_sdk_schema"++declare global {+ interface Window {+ __CYCLOPS_BROWSER_CONFIG__?: BrowserRuntimeConfig}}+type BrowserRuntimeConfig = {+ accessToken: string+ baseUrl: string+ namespace: string+ image: string+ imagePullSecret?: string+}++const serviceName = "mcp"+const servicePath = "/health"+const output = document.querySelector<HTMLPreElement>("#output")!+const runButton = document.querySelector<HTMLButtonElement>("#run")!+const sdkReady = document.querySelector<HTMLElement>("[data-testid=sdk-ready]")!+const lifecycleStatus = document.querySelector<HTMLElement>("[data-testid=lifecycle-status]")!++const sdkInitialization = uniffiInitAsync().then(+ () => {+ sdkReady.textContent = "ready"+ },+ (error) => {+ sdkReady.textContent = "failed"+ log("SDK initialization failed:", error instanceof Error ? error.message : String(error))+ throw error+ },+)+function log(message: string, value?: unknown): void {- output.textContent += `\n${message}${value === undefined ? "" : ` ${JSON.stringify(value, null, 2)}`}`;+ output.textContent += `\n${message}${value === undefined ? "" : ` ${JSON.stringify(value, null, 2)}`}`+}++function describeError(error: unknown): Record<string, unknown> {+ if (error instanceof Error) {+ return {+ type: error.constructor.name,+ name: error.name,+ message: error.message,+ stack: error.stack,+ cause: error.cause instanceof Error ? { name: error.cause.name, message: error.cause.message, stack: error.cause.stack } : error.cause,+ }+ }++ return { type: typeof error, value: String(error) }}-function values(): Record<string, string> {- const data = new FormData(form);- return Object.fromEntries([...data.entries()].map(([key, value]) => [key, String(value).trim()]));+function runtimeConfig(): BrowserRuntimeConfig {+ const config = window.__CYCLOPS_BROWSER_CONFIG__+ if (!config) {+ throw new Error("browser runtime configuration is unavailable")+ }++ for (const [name, value] of Object.entries(config)) {+ if (!value?.trim()) {+ throw new Error(`browser runtime configuration is missing ${name}`)+ }+ }+ return config}-function makePoolSpec(image: string, imagePullSecret: string): PoolSpec {+function makePoolSpec(image: string, imagePullSecret?: string): PoolSpec {return {replicas: 1,template: {- // `containerDiskImage` is the only required template field. Production- // pools should also set resource and scheduling requirements.containerDiskImage: image,- imagePullSecret: imagePullSecret || undefined,+ cpuCores: 4,+ memory: "4Gi",+ imagePullSecret,},services: [{ name: serviceName, targetPort: 3000 }],- };+ }}async function runLifecycle(): Promise<void> {- const config = values();- const client = CyclopsClient.connect({- baseUrl: config.baseUrl,- tokenUrl: config.tokenUrl,- credentials: new CyclopsCredentials(config.clientId, config.clientSecret),- poolPollIntervalMs: 5000n,- poolPollLimit: 100,- claimPollIntervalMs: 2000n,- claimPollLimit: 100,- }, new FetchHttpClient());-- let pool: Pool | undefined;- let claim: Claim | undefined;- try {- log("[1/8] Listing existing pools...");- log("Pools:", await client.listPools(config.namespace));-- log("[2/8] Creating pool...");- pool = await client.createPool({ namespace: config.namespace, spec: makePoolSpec(config.image, config.imagePullSecret) });- log("Pool:", pool);-- log("[3/8] Listing pools after creation...");- log("Pools:", await client.listPools(config.namespace));+ await sdkInitialization+ const config = runtimeConfig()+ log("[auth] Supplying runner access token to SDK client.")+ const client = CyclopsClient.connectBrowserWithAccessToken(+ {+ baseUrl: config.baseUrl,+ poolPollIntervalMs: 5_000n,+ poolPollLimit: 120,+ claimPollIntervalMs: 5_000n,+ claimPollLimit: 120,+ },+ config.accessToken,+ )+ log("[auth] SDK client connected.")- log("[4/8] Creating claim...");- const spec: ClaimSpec = { sandboxTemplateRef: { name: pool.metadata.name } };- claim = await client.createClaim({ pool, spec });- log("Claim:", claim);+ let pool: Pool | undefined+ let claim: Claim | undefined+ try {+ log("[1/5] Creating pool...")+ pool = await client.createPool({+ namespace: config.namespace,+ spec: makePoolSpec(config.image, config.imagePullSecret),+ })- log("[5/8] Listing claims...");- log("Claims:", await client.listClaims(config.namespace));+ log("[2/5] Creating claim...")+ claim = await client.createClaim({ pool })- log("[6/8] Waiting for claim to bind a sandbox...");- const sandbox = await client.waitClaim(claim);- log("Sandbox:", sandbox);+ log("[3/5] Waiting for claim to bind a sandbox...")+ const sandbox = await client.waitClaim(claim)- log("[7/8] Calling the sandbox service...");+ log("[4/5] Calling the sandbox service...")const response = await client.serviceRequest(sandbox, serviceName, servicePath, {- method: "GET", url: `https://ignored.invalid${servicePath}`, headers: [],- });- log("Service response:", { status: response.status, body: new TextDecoder().decode(response.body) });- log("[8/8] Lifecycle completed; cleanup will now run.");+ method: "GET",+ url: `https://ignored.invalid${servicePath}`,+ headers: [],+ })+ log("Service response:", {+ status: response.status,+ body: new TextDecoder().decode(response.body),+ })+ lifecycleStatus.textContent = "completed"+ log("[5/5] Lifecycle completed; cleanup will now run.")} finally {if (claim) {- log("[cleanup] Deleting claim...");- await client.deleteClaim(claim);+ log("[cleanup] Deleting claim...")+ await client.deleteClaim(claim)}if (pool) {- log("[cleanup] Deleting pool...");- await client.deletePool(pool);+ log("[cleanup] Deleting pool...")+ await client.deletePool(pool)}}}runButton.addEventListener("click", async () => {- if (!form.reportValidity()) return;- output.textContent = "Running...";- runButton.disabled = true;+ output.textContent = "Running..."+ lifecycleStatus.textContent = "running"+ runButton.disabled = truetry {- await runLifecycle();+ await runLifecycle()} catch (error) {- log("Lifecycle failed:", error instanceof Error ? error.message : String(error));+ lifecycleStatus.textContent = "failed"+ log("Lifecycle failed:", describeError(error))} finally {- runButton.disabled = false;+ runButton.disabled = false}-});+})diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/index.html b/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/index.htmlindex dcb1ca04f3..878e2f8a86 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/index.html+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/examples/index.html@@ -6,27 +6,17 @@<title>Cyclops Browser Lifecycle Example</title><style>body { font: 16px/1.4 ui-monospace, monospace; margin: 2rem auto; max-width: 60rem; padding: 0 1rem; }- form { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }- label { display: grid; gap: .25rem; } input { font: inherit; padding: .4rem; }button { font: inherit; margin-top: 1rem; padding: .55rem .8rem; }pre { background: #111; color: #e8f5e9; min-height: 16rem; overflow: auto; padding: 1rem; white-space: pre-wrap; }</style></head><body><h1>Cyclops browser lifecycle</h1>- <p>This demonstration sends OAuth credentials from the browser. Use only a development-only client and trusted origin.</p>- <form id="config">- <label>Base URL <input name="baseUrl" placeholder="https://cyclops.example" required /></label>- <label>Token URL <input name="tokenUrl" placeholder="https://auth.example/oauth/token" required /></label>- <label>Client ID <input name="clientId" required /></label>- <label>Client secret <input name="clientSecret" type="password" required /></label>- <label>Namespace <input name="namespace" value="default" required /></label>- <label>Container-disk image <input name="image" placeholder="registry.example/cyclops-mcp:latest" required /></label>- <label>Image-pull secret <input name="imagePullSecret" /></label>- </form>+ <p>This development-only page receives a short-lived access token from its test runner; it never accepts a client secret.</p>+ <p>SDK initialization: <span data-testid="sdk-ready">initializing</span></p>+ <p>Lifecycle status: <span data-testid="lifecycle-status">idle</span></p><button id="run" type="button">Run Lifecycle</button><pre id="output" aria-live="polite">Ready.</pre>- <!-- Source entrypoint: browser.ts; the WASM-aware bundler writes dist/browser.js. -->- <script type="module" src="./dist/browser.js"></script>+ <script type="module" src="./browser.ts"></script></body></html>diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/package-lock.json b/libs/fleet/sdk-bindings/ts-uniffi-browser/package-lock.jsonnew file mode 100644index 0000000000..b91f5f63f4--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/package-lock.json@@ -0,0 +1,1102 @@+{+ "name": "cyclops-sdk-browser",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "cyclops-sdk-browser",+ "dependencies": {+ "@ubjs/core": "0.31.0-3"+ },+ "devDependencies": {+ "@playwright/test": "1.60.0",+ "prettier": "3.8.2",+ "typescript": "5.7.2",+ "uniffi-bindgen-react-native": "0.31.0-3",+ "vite": "5.4.11"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",+ "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",+ "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",+ "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",+ "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",+ "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",+ "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",+ "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",+ "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",+ "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",+ "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",+ "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",+ "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",+ "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",+ "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",+ "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",+ "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",+ "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",+ "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",+ "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",+ "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",+ "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",+ "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",+ "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@playwright/test": {+ "version": "1.60.0",+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.60.0.tgz",+ "integrity": "sha512-O71yZIbAh/PxDMNGns37GHBIfrVkEVyn+AXyIa5dOTfb4/xNvRWV+Vv/NMbNCtODB/pO7vLlF2OTmMVLhmr7Ag==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "playwright": "1.60.0"+ },+ "bin": {+ "playwright": "cli.js"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@rollup/rollup-android-arm-eabi": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz",+ "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-android-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz",+ "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-darwin-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz",+ "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-darwin-x64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz",+ "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz",+ "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-x64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz",+ "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz",+ "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz",+ "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz",+ "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz",+ "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz",+ "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz",+ "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz",+ "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz",+ "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz",+ "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz",+ "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-s390x-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz",+ "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz",+ "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz",+ "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-openbsd-x64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz",+ "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ]+ },+ "node_modules/@rollup/rollup-openharmony-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz",+ "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ]+ },+ "node_modules/@rollup/rollup-win32-arm64-msvc": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz",+ "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-ia32-msvc": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz",+ "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz",+ "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-msvc": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz",+ "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@types/estree": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@ubjs/core": {+ "version": "0.31.0-3",+ "resolved": "https://registry.npmjs.org/@ubjs/core/-/core-0.31.0-3.tgz",+ "integrity": "sha512-39XrJgUZ2VVb561sSnkXPhczNoeBsNiSRArecsV0JE7CJq69ajFkcn9/tBAUS2NpgHkLIDU+z6Ks2+1wXnboxg==",+ "license": "MPL-2.0"+ },+ "node_modules/esbuild": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",+ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=12"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.21.5",+ "@esbuild/android-arm": "0.21.5",+ "@esbuild/android-arm64": "0.21.5",+ "@esbuild/android-x64": "0.21.5",+ "@esbuild/darwin-arm64": "0.21.5",+ "@esbuild/darwin-x64": "0.21.5",+ "@esbuild/freebsd-arm64": "0.21.5",+ "@esbuild/freebsd-x64": "0.21.5",+ "@esbuild/linux-arm": "0.21.5",+ "@esbuild/linux-arm64": "0.21.5",+ "@esbuild/linux-ia32": "0.21.5",+ "@esbuild/linux-loong64": "0.21.5",+ "@esbuild/linux-mips64el": "0.21.5",+ "@esbuild/linux-ppc64": "0.21.5",+ "@esbuild/linux-riscv64": "0.21.5",+ "@esbuild/linux-s390x": "0.21.5",+ "@esbuild/linux-x64": "0.21.5",+ "@esbuild/netbsd-x64": "0.21.5",+ "@esbuild/openbsd-x64": "0.21.5",+ "@esbuild/sunos-x64": "0.21.5",+ "@esbuild/win32-arm64": "0.21.5",+ "@esbuild/win32-ia32": "0.21.5",+ "@esbuild/win32-x64": "0.21.5"+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.2",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/nanoid": {+ "version": "3.3.16",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz",+ "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/playwright": {+ "version": "1.60.0",+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.60.0.tgz",+ "integrity": "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "playwright-core": "1.60.0"+ },+ "bin": {+ "playwright": "cli.js"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "fsevents": "2.3.2"+ }+ },+ "node_modules/playwright-core": {+ "version": "1.60.0",+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.60.0.tgz",+ "integrity": "sha512-9bW6zvX/m0lEbgTKJ6YppOKx8H3VOPBMOCFh2irXFOT4BbHgrx5hPjwJYLT40Lu+4qtD36qKc/Hn56StUW57IA==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "playwright-core": "cli.js"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.21",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.21.tgz",+ "integrity": "sha512-v4sDNP3fdNiWMfabO7OwOQdOX8TiQSztKyT1Wj0w+j7LDallJThJRBBBmzVGyYj0crMh7jlV4zepPkiNu9UwDQ==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.16",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/prettier": {+ "version": "3.8.2",+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.2.tgz",+ "integrity": "sha512-8c3mgTe0ASwWAJK+78dpviD+A8EqhndQPUBpNUIPt6+xWlIigCwfN01lWr9MAede4uqXGTEKeQWTvzb3vjia0Q==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "prettier": "bin/prettier.cjs"+ },+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/prettier/prettier?sponsor=1"+ }+ },+ "node_modules/rollup": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz",+ "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "1.0.9"+ },+ "bin": {+ "rollup": "dist/bin/rollup"+ },+ "engines": {+ "node": ">=18.0.0",+ "npm": ">=8.0.0"+ },+ "optionalDependencies": {+ "@rollup/rollup-android-arm-eabi": "4.62.2",+ "@rollup/rollup-android-arm64": "4.62.2",+ "@rollup/rollup-darwin-arm64": "4.62.2",+ "@rollup/rollup-darwin-x64": "4.62.2",+ "@rollup/rollup-freebsd-arm64": "4.62.2",+ "@rollup/rollup-freebsd-x64": "4.62.2",+ "@rollup/rollup-linux-arm-gnueabihf": "4.62.2",+ "@rollup/rollup-linux-arm-musleabihf": "4.62.2",+ "@rollup/rollup-linux-arm64-gnu": "4.62.2",+ "@rollup/rollup-linux-arm64-musl": "4.62.2",+ "@rollup/rollup-linux-loong64-gnu": "4.62.2",+ "@rollup/rollup-linux-loong64-musl": "4.62.2",+ "@rollup/rollup-linux-ppc64-gnu": "4.62.2",+ "@rollup/rollup-linux-ppc64-musl": "4.62.2",+ "@rollup/rollup-linux-riscv64-gnu": "4.62.2",+ "@rollup/rollup-linux-riscv64-musl": "4.62.2",+ "@rollup/rollup-linux-s390x-gnu": "4.62.2",+ "@rollup/rollup-linux-x64-gnu": "4.62.2",+ "@rollup/rollup-linux-x64-musl": "4.62.2",+ "@rollup/rollup-openbsd-x64": "4.62.2",+ "@rollup/rollup-openharmony-arm64": "4.62.2",+ "@rollup/rollup-win32-arm64-msvc": "4.62.2",+ "@rollup/rollup-win32-ia32-msvc": "4.62.2",+ "@rollup/rollup-win32-x64-gnu": "4.62.2",+ "@rollup/rollup-win32-x64-msvc": "4.62.2",+ "fsevents": "~2.3.2"+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/typescript": {+ "version": "5.7.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",+ "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/uniffi-bindgen-react-native": {+ "version": "0.31.0-3",+ "resolved": "https://registry.npmjs.org/uniffi-bindgen-react-native/-/uniffi-bindgen-react-native-0.31.0-3.tgz",+ "integrity": "sha512-br7giBJRr/j00rdMXhOZGMGuDWMAVUcxC9O3lco0KRqzEAxUz00+gegPW5tKamvKbrnj7NB682XUCYrcagtxFA==",+ "dev": true,+ "license": "MPL-2.0",+ "bin": {+ "ubrn": "bin/cli.cjs",+ "uniffi-bindgen-react-native": "bin/cli.cjs"+ }+ },+ "node_modules/vite": {+ "version": "5.4.11",+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz",+ "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "^0.21.3",+ "postcss": "^8.4.43",+ "rollup": "^4.20.0"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^18.0.0 || >=20.0.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^18.0.0 || >=20.0.0",+ "less": "*",+ "lightningcss": "^1.21.0",+ "sass": "*",+ "sass-embedded": "*",+ "stylus": "*",+ "sugarss": "*",+ "terser": "^5.4.0"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "lightningcss": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ }+ }+ },+ "node_modules/vite/node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ }+ }+}diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/package.json b/libs/fleet/sdk-bindings/ts-uniffi-browser/package.jsonnew file mode 100644index 0000000000..c4c690db5a--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/package.json@@ -0,0 +1,25 @@+{+ "name": "cyclops-sdk-browser",+ "private": true,+ "type": "module",+ "scripts": {+ "build:wasm": "node scripts/patch-ubrn-wasm-template.mjs && ubrn build web --config ubrn.config.yaml --and-generate --release",+ "build": "npm run build:wasm && vite build",+ "test:artifact": "playwright test --project=chromium tests/browser-artifact.spec.ts",+ "test:live": "playwright test --project=chromium tests/browser-live.spec.ts"+ },+ "dependencies": {+ "@ubjs/core": "0.31.0-3"+ },+ "devDependencies": {+ "@playwright/test": "1.60.0",+ "typescript": "5.7.2",+ "uniffi-bindgen-react-native": "0.31.0-3",+ "vite": "5.4.11",+ "prettier": "3.8.2"+ },+ "repository": {+ "type": "git",+ "url": "https://github.com/trycua/cloud.git"+ }+}diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/playwright.config.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/playwright.config.tsnew file mode 100644index 0000000000..c2f140d658--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/playwright.config.ts@@ -0,0 +1,22 @@+import { defineConfig } from "@playwright/test"++export default defineConfig({+ testDir: "./tests",+ timeout: 30_000,+ use: {+ baseURL: "http://127.0.0.1:4174",+ headless: true,+ },+ webServer: {+ command: "./node_modules/.bin/vite --host 127.0.0.1 --port 4174",+ port: 4174,+ reuseExistingServer: true,+ timeout: 30_000,+ },+ projects: [+ {+ name: "chromium",+ use: { browserName: "chromium" },+ },+ ],+})diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/scripts/patch-ubrn-wasm-template.mjs b/libs/fleet/sdk-bindings/ts-uniffi-browser/scripts/patch-ubrn-wasm-template.mjsnew file mode 100644index 0000000000..7cb93ab838--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/scripts/patch-ubrn-wasm-template.mjs@@ -0,0 +1,43 @@+import { readFile, writeFile } from "node:fs/promises"+import { fileURLToPath } from "node:url"++const templateDirectory = new URL(+ "../node_modules/uniffi-bindgen-react-native/crates/ubrn_cli/templates/wasm/",+ import.meta.url,+)++await patchTemplate("Cargo.toml.txt", new Map([+ ['wasm-bindgen = "*"', 'wasm-bindgen = "=0.2.126"\nconsole_error_panic_hook = "0.1.7"'],+ ['opt-level = "3"', "opt-level = 3"],+]))++await patchTemplate("lib.rs", new Map([+ [+ "// Generated by uniffi-bindgen-react-native\n\n{{ entrypoint() }}",+ `// Generated by uniffi-bindgen-react-native++use wasm_bindgen::prelude::wasm_bindgen;++#[wasm_bindgen(start)]+pub fn initialize_panic_hook() {+ console_error_panic_hook::set_once();+}++{{ entrypoint() }}`,+ ],+]))++async function patchTemplate(name, replacements) {+ const templatePath = fileURLToPath(new URL(name, templateDirectory))+ let source = await readFile(templatePath, "utf8")++ for (const [invalid, valid] of replacements) {+ const matches = source.split(invalid).length - 1+ if (matches !== 1) {+ throw new Error(`expected exactly one ${invalid} in ${templatePath}, found ${matches}`)+ }+ source = source.replace(invalid, valid)+ }++ await writeFile(templatePath, source)+}diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-artifact.spec.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-artifact.spec.tsnew file mode 100644index 0000000000..eb4093321c--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-artifact.spec.ts@@ -0,0 +1,20 @@+import { expect, test } from "@playwright/test"+import { access } from "node:fs/promises"+import { fileURLToPath } from "node:url"++const bindingRoot = fileURLToPath(new URL("..", import.meta.url))+const requiredArtifacts = [+ new URL("../ts/wasm-bindgen/index.js", import.meta.url),+ new URL("../ts/wasm-bindgen/index_bg.wasm", import.meta.url),+]++test("loads the Vite bundle backed by the generated WASM SDK artifact", async ({+ page,+}) => {+ for (const artifact of requiredArtifacts) {+ await expect(access(fileURLToPath(artifact))).resolves.toBeUndefined()+ }++ await page.goto("/")+ await expect(page.getByTestId("sdk-ready")).toHaveText("ready")+})diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-lifecycle.spec.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-lifecycle.spec.tsnew file mode 100644index 0000000000..4dd6dc922e--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-lifecycle.spec.ts@@ -0,0 +1,23 @@+import { expect, test } from "@playwright/test"++test("uses runner-injected access tokens without browser credential fields", async ({+ page,+}) => {+ await page.addInitScript(() => {+ window.__CYCLOPS_BROWSER_CONFIG__ = {+ accessToken: "browser-token",+ baseUrl: "https://run.example",+ namespace: "browser-sdk-test",+ image: "registry.example/desktop:latest",+ imagePullSecret: "ecr-credentials",+ }+ })++ await page.goto("/")++ await expect(page.getByTestId("sdk-ready")).toHaveText("ready")+ await expect(page.getByRole("button", { name: "Run Lifecycle" })).toBeVisible()+ await expect(page.locator("input[name=clientSecret]")).toHaveCount(0)+ await expect(page.locator("input[name=clientId]")).toHaveCount(0)+ await expect(page.locator("input[name=tokenUrl]")).toHaveCount(0)+})diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-live.spec.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-live.spec.tsnew file mode 100644index 0000000000..2cecbd717b--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/tests/browser-live.spec.ts@@ -0,0 +1,115 @@+import { expect, test, type Page, type Route } from "@playwright/test"+import { readdir } from "node:fs/promises"+import { join } from "node:path"+import { fileURLToPath } from "node:url"++const bindingRoot = fileURLToPath(new URL("..", import.meta.url))+const distRoot = join(bindingRoot, "examples", "dist")++test.describe.configure({ mode: "serial" })+test.use({ trace: "off" })++test("runs the browser SDK lifecycle with a runner-injected access token", async ({+ page,+}) => {+ test.setTimeout(15 * 60_000)+ const config = requiredRuntimeConfig()++ const networkEvents: string[] = []+ const browserDiagnostics: string[] = []+ page.on("console", (message) => {+ if (message.type() === "error") {+ browserDiagnostics.push(`console error: ${message.text()}`)+ }+ })+ page.on("pageerror", (error) => {+ browserDiagnostics.push(`page error: ${error.stack ?? error.message}`)+ })+ page.on("request", (request) => {+ if (request.url().startsWith(`${config.baseUrl}/api/`)) {+ networkEvents.push(`request ${request.method()} ${new URL(request.url()).pathname}`)+ }+ })+ page.on("response", (response) => {+ if (response.url().startsWith(`${config.baseUrl}/api/`)) {+ networkEvents.push(`response ${response.status()} ${new URL(response.url()).pathname}`)+ }+ })+ page.on("requestfailed", (request) => {+ if (request.url().startsWith(`${config.baseUrl}/api/`)) {+ networkEvents.push(+ `request failed ${new URL(request.url()).pathname}: ${request.failure()?.errorText ?? "unknown error"}`,+ )+ }+ })++ await serveBundleFromControlPlaneOrigin(page, config.baseUrl)+ await page.addInitScript((runtimeConfig) => {+ window.__CYCLOPS_BROWSER_CONFIG__ = runtimeConfig+ }, config)+ await page.goto(new URL("/__cyclops-browser-sdk-live-test/", config.baseUrl).toString())++ await expect(page.getByTestId("sdk-ready")).toHaveText("ready")+ await page.getByRole("button", { name: "Run Lifecycle" }).click()++ const lifecycleStatus = page.getByTestId("lifecycle-status")+ await expect(lifecycleStatus).toHaveText(/^(completed|failed)$/, {+ timeout: 12 * 60_000,+ })+ if ((await lifecycleStatus.textContent()) !== "completed") {+ const output = await page.locator("#output").textContent()+ throw new Error(+ `browser lifecycle failed:\n${output ?? "no output"}\nnetwork:\n${networkEvents.join("\n") || "no control-plane requests"}\nbrowser diagnostics:\n${browserDiagnostics.join("\n") || "none"}`,+ )+ }+})++async function serveBundleFromControlPlaneOrigin(+ page: Page,+ baseUrl: string,+): Promise<void> {+ const assets = await readdir(join(distRoot, "assets"))+ const wasmFile = assets.find((file) => file.endsWith(".wasm"))+ if (!wasmFile) {+ throw new Error("generated browser bundle does not contain a WASM asset")+ }++ await page.route(new URL("/__cyclops-browser-sdk-live-test/", baseUrl).toString(), (route: Route) =>+ route.fulfill({ path: join(distRoot, "index.html") }),+ )+ await page.route(new URL("/browser.js", baseUrl).toString(), (route: Route) =>+ route.fulfill({ path: join(distRoot, "browser.js") }),+ )+ await page.route(new URL(`/assets/${wasmFile}`, baseUrl).toString(), (route: Route) =>+ route.fulfill({ path: join(distRoot, "assets", wasmFile) }),+ )+}++function requiredRuntimeConfig(): {+ accessToken: string+ baseUrl: string+ namespace: string+ image: string+ imagePullSecret: string+} {+ const values = {+ accessToken: process.env.CYCLOPS_ACCESS_TOKEN,+ baseUrl: process.env.CUA_BASE_URL,+ namespace: process.env.CYCLOPS_NAMESPACE,+ image: process.env.CUA_IMAGE,+ imagePullSecret: process.env.CUA_IMAGE_PULL_SECRET,+ }++ for (const [name, value] of Object.entries(values)) {+ if (!value) {+ throw new Error(`missing required environment variable: ${name}`)+ }+ }+ return values as {+ accessToken: string+ baseUrl: string+ namespace: string+ image: string+ imagePullSecret: string+ }+}diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk-ffi.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk-ffi.tsindex 44e0ea640a..65d8a8b447 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk-ffi.ts+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk-ffi.ts@@ -6,7 +6,10 @@// @ts-nocheck// Structs and function types for calling back into Typescript from Rust.-export type UniffiRustFutureContinuationCallback = (data: bigint, pollResult: number) => void;+export type UniffiRustFutureContinuationCallback = (+ data: bigint,+ pollResult: number,+) => void;export type UniffiForeignFutureDroppedCallback = (handle: bigint) => void;export type UniffiForeignFutureDroppedCallbackStruct = {handle: bigint;@@ -16,12 +19,39 @@ export type UniffiForeignFutureResultRustBuffer = {return_value: Uint8Array;call_status: UniffiRustCallStatus;};-export type UniffiForeignFutureCompleterustBuffer = (callbackData: bigint, result: UniffiForeignFutureResultRustBuffer) => void;-type UniffiCallbackInterfaceCyclopsSdkHttpClientMethod0 = (uniffiHandle: bigint, request: Uint8Array, uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer, uniffiCallbackData: bigint) => UniffiForeignFutureDroppedCallbackStruct;-type UniffiCallbackInterfaceCloneCyclopsSdkHttpClient = (handle: bigint) => UniffiResult<void>;+export type UniffiForeignFutureCompleterustBuffer = (+ callbackData: bigint,+ result: UniffiForeignFutureResultRustBuffer,+) => void;+type UniffiCallbackInterfaceCyclopsSdkAccessTokenProviderMethod0 = (+ uniffiHandle: bigint,+ forceRefresh: number,+ uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer,+ uniffiCallbackData: bigint,+) => UniffiForeignFutureDroppedCallbackStruct;+type UniffiCallbackInterfaceCloneCyclopsSdkAccessTokenProvider = (+ handle: bigint,+) => UniffiResult<void>;+type UniffiCallbackInterfaceFreeCyclopsSdkAccessTokenProvider = (+ handle: bigint,+) => void;+export type UniffiVTableCallbackInterfaceCyclopsSdkAccessTokenProvider = {+ uniffi_free: UniffiCallbackInterfaceFreeCyclopsSdkAccessTokenProvider;+ uniffi_clone: UniffiCallbackInterfaceCloneCyclopsSdkAccessTokenProvider;+ get_access_token: UniffiCallbackInterfaceCyclopsSdkAccessTokenProviderMethod0;+};+type UniffiCallbackInterfaceCyclopsSdkHttpClientMethod0 = (+ uniffiHandle: bigint,+ request: Uint8Array,+ uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer,+ uniffiCallbackData: bigint,+) => UniffiForeignFutureDroppedCallbackStruct;+type UniffiCallbackInterfaceCloneCyclopsSdkHttpClient = (+ handle: bigint,+) => UniffiResult<void>;type UniffiCallbackInterfaceFreeCyclopsSdkHttpClient = (handle: bigint) => void;export type UniffiVTableCallbackInterfaceCyclopsSdkHttpClient = {uniffi_free: UniffiCallbackInterfaceFreeCyclopsSdkHttpClient;uniffi_clone: UniffiCallbackInterfaceCloneCyclopsSdkHttpClient;execute: UniffiCallbackInterfaceCyclopsSdkHttpClientMethod0;-};\ No newline at end of file+};diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk.tsindex 34c631a070..a2889a0aa4 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk.ts+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk.ts@@ -4,14 +4,64 @@/* eslint-disable */// @ts-nocheckimport * as wasmBundle from "./wasm-bindgen/index.js";-import { type UniffiRustFutureContinuationCallback, type UniffiForeignFutureDroppedCallback, type UniffiForeignFutureDroppedCallbackStruct, type UniffiForeignFutureResultRustBuffer, type UniffiForeignFutureCompleterustBuffer, type UniffiVTableCallbackInterfaceCyclopsSdkHttpClient,+import {+ type UniffiRustFutureContinuationCallback,+ type UniffiForeignFutureDroppedCallback,+ type UniffiForeignFutureDroppedCallbackStruct,+ type UniffiForeignFutureResultRustBuffer,+ type UniffiForeignFutureCompleterustBuffer,+ type UniffiVTableCallbackInterfaceCyclopsSdkAccessTokenProvider,+ type UniffiVTableCallbackInterfaceCyclopsSdkHttpClient,} from "./cyclops_sdk-ffi";-import { type ClaimSpec, type OsGymSandboxClaimStatus, type OsGymWorkspacePoolStatus, type PoolSpec,+import {+ type ClaimSpec,+ type OsGymSandboxClaimStatus,+ type OsGymWorkspacePoolStatus,+ type PoolSpec,} from "./cyclops_sdk_schema";-import { type FfiConverter, type UniffiByteArray, type UniffiGcObject, type UniffiHandle, type UniffiObjectFactory, type UniffiReferenceHolder, type UniffiRustCallStatus, AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterInt32, FfiConverterMap, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt16, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, RustBuffer, UniffiAbstractObject, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol, variantOrdinalSymbol,+import {+ type FfiConverter,+ type UniffiByteArray,+ type UniffiGcObject,+ type UniffiHandle,+ type UniffiObjectFactory,+ type UniffiReferenceHolder,+ type UniffiRustCallStatus,+ AbstractFfiConverterByteArray,+ FfiConverterArray,+ FfiConverterArrayBuffer,+ FfiConverterBool,+ FfiConverterInt32,+ FfiConverterMap,+ FfiConverterObject,+ FfiConverterObjectWithCallbacks,+ FfiConverterOptional,+ FfiConverterUInt16,+ FfiConverterUInt32,+ FfiConverterUInt64,+ FfiConverterUInt8,+ RustBuffer,+ UniffiAbstractObject,+ UniffiError,+ UniffiInternalError,+ UniffiResult,+ UniffiRustCaller,+ destructorGuardSymbol,+ pointerLiteralSymbol,+ uniffiCreateFfiConverterString,+ uniffiCreateRecord,+ uniffiRustCallAsync,+ uniffiTraitInterfaceCallAsyncWithError,+ uniffiTypeNameSymbol,+ variantOrdinalSymbol,} from "@ubjs/core";import uniffiCyclopsSdkSchemaModule from "./cyclops_sdk_schema";-const { FfiConverterTypeClaimSpec, FfiConverterTypeOSGymSandboxClaimStatus, FfiConverterTypeOSGymWorkspacePoolStatus, FfiConverterTypePoolSpec } = uniffiCyclopsSdkSchemaModule.converters;+const {+ FfiConverterTypeClaimSpec,+ FfiConverterTypeOSGymSandboxClaimStatus,+ FfiConverterTypeOSGymWorkspacePoolStatus,+ FfiConverterTypePoolSpec,+} = uniffiCyclopsSdkSchemaModule.converters;// wasm1: wrap the wasm-bindgen namespace once so the codegen call sites can// uniformly reference `nativeModule().rustbuffer_alloc` / `.rustbuffer_free`.// For wasm1, RustBuffers are plain JS Uint8Arrays — no Rust-side allocation@@ -21,7 +71,9 @@ const _nativeModule = Object.assign({}, wasmBundle, {rustbuffer_free: (_: Uint8Array): void => {},});const nativeModule = () => _nativeModule;-const uniffiCaller = new UniffiRustCaller(() => new wasmBundle.RustCallStatus());+const uniffiCaller = new UniffiRustCaller(+ () => new wasmBundle.RustCallStatus(),+);const uniffiIsDebug =// @ts-ignore -- The process global might not be defined@@ -33,126 +85,130 @@ const uniffiIsDebug =// Public interface members begin here.const stringConverter = (() => {- const encoder = new TextEncoder();- const decoder = new TextDecoder();- return {- stringToBytes: (s: string) => encoder.encode(s),- bytesToString: (ab: UniffiByteArray) => decoder.decode(ab),- stringByteLength: (s: string) => encoder.encode(s).byteLength,- writeStringIntoBuffer: (s: string, buf: any, offset: number): number => {- const view = new Uint8Array(- buf.arrayBuffer,- offset,- buf.arrayBuffer.byteLength - offset,- );- return encoder.encodeInto(s, view).written;- },- readStringFromBuffer: (buf: any, offset: number, length: number): string =>- decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length)),- };+ const encoder = new TextEncoder();+ const decoder = new TextDecoder();+ return {+ stringToBytes: (s: string) => encoder.encode(s),+ bytesToString: (ab: UniffiByteArray) => decoder.decode(ab),+ stringByteLength: (s: string) => encoder.encode(s).byteLength,+ writeStringIntoBuffer: (s: string, buf: any, offset: number): number => {+ const view = new Uint8Array(+ buf.arrayBuffer,+ offset,+ buf.arrayBuffer.byteLength - offset,+ );+ return encoder.encodeInto(s, view).written;+ },+ readStringFromBuffer: (buf: any, offset: number, length: number): string =>+ decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length)),+ };})();const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);export type ResourceMetadata = {- namespace: string,- name: string,- labels?: Map<string, string>-}+ namespace: string;+ name: string;+ labels?: Map<string, string>;+};/*** Generated factory for {@link ResourceMetadata} record objects.*/export const ResourceMetadata = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<ResourceMetadata, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<ResourceMetadata>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<ResourceMetadata, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<ResourceMetadata>,+ });})();const FfiConverterTypeResourceMetadata = (() => {- type TypeName = ResourceMetadata;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- namespace: FfiConverterString.read(from),- name: FfiConverterString.read(from),- labels: FfiConverterOptionalMapStringString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.namespace, into);- FfiConverterString.write(value.name, into);- FfiConverterOptionalMapStringString.write(value.labels, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.namespace) +- FfiConverterString.allocationSize(value.name) +- FfiConverterOptionalMapStringString.allocationSize(value.labels);-- }- };- return new FFIConverter();+ type TypeName = ResourceMetadata;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ namespace: FfiConverterString.read(from),+ name: FfiConverterString.read(from),+ labels: FfiConverterOptionalMapStringString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.namespace, into);+ FfiConverterString.write(value.name, into);+ FfiConverterOptionalMapStringString.write(value.labels, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.namespace) ++ FfiConverterString.allocationSize(value.name) ++ FfiConverterOptionalMapStringString.allocationSize(value.labels)+ );+ }+ }+ return new FFIConverter();})();export type Claim = {- apiVersion: string,- kind: string,- metadata: ResourceMetadata,- spec: ClaimSpec,- status?: OsGymSandboxClaimStatus-}+ apiVersion: string;+ kind: string;+ metadata: ResourceMetadata;+ spec: ClaimSpec;+ status?: OsGymSandboxClaimStatus;+};/*** Generated factory for {@link Claim} record objects.*/export const Claim = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<Claim, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<Claim>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<Claim, ReturnType<typeof defaults>>(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<Claim>,+ });})();const FfiConverterTypeClaim = (() => {- type TypeName = Claim;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- apiVersion: FfiConverterString.read(from),- kind: FfiConverterString.read(from),- metadata: FfiConverterTypeResourceMetadata.read(from),- spec: FfiConverterTypeClaimSpec.read(from),- status: FfiConverterOptionalTypeOSGymSandboxClaimStatus.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.apiVersion, into);- FfiConverterString.write(value.kind, into);- FfiConverterTypeResourceMetadata.write(value.metadata, into);- FfiConverterTypeClaimSpec.write(value.spec, into);- FfiConverterOptionalTypeOSGymSandboxClaimStatus.write(value.status, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.apiVersion) +- FfiConverterString.allocationSize(value.kind) +- FfiConverterTypeResourceMetadata.allocationSize(value.metadata) +- FfiConverterTypeClaimSpec.allocationSize(value.spec) +- FfiConverterOptionalTypeOSGymSandboxClaimStatus.allocationSize(value.status);-- }- };- return new FFIConverter();+ type TypeName = Claim;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ apiVersion: FfiConverterString.read(from),+ kind: FfiConverterString.read(from),+ metadata: FfiConverterTypeResourceMetadata.read(from),+ spec: FfiConverterTypeClaimSpec.read(from),+ status: FfiConverterOptionalTypeOSGymSandboxClaimStatus.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.apiVersion, into);+ FfiConverterString.write(value.kind, into);+ FfiConverterTypeResourceMetadata.write(value.metadata, into);+ FfiConverterTypeClaimSpec.write(value.spec, into);+ FfiConverterOptionalTypeOSGymSandboxClaimStatus.write(value.status, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.apiVersion) ++ FfiConverterString.allocationSize(value.kind) ++ FfiConverterTypeResourceMetadata.allocationSize(value.metadata) ++ FfiConverterTypeClaimSpec.allocationSize(value.spec) ++ FfiConverterOptionalTypeOSGymSandboxClaimStatus.allocationSize(+ value.status,+ )+ );+ }+ }+ return new FFIConverter();})();/**@@ -160,1796 +216,2552 @@ const FfiConverterTypeClaim = (() => {* `OSGymWorkspacePoolStatus` and `OSGymSandboxClaimStatus` from cyclops_sdk_schema.*/export type Pool = {- apiVersion: string,- kind: string,- metadata: ResourceMetadata,- spec: PoolSpec,- status?: OsGymWorkspacePoolStatus-}+ apiVersion: string;+ kind: string;+ metadata: ResourceMetadata;+ spec: PoolSpec;+ status?: OsGymWorkspacePoolStatus;+};/*** Generated factory for {@link Pool} record objects.*/export const Pool = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<Pool, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<Pool>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<Pool, ReturnType<typeof defaults>>(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<Pool>,+ });})();const FfiConverterTypePool = (() => {- type TypeName = Pool;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- apiVersion: FfiConverterString.read(from),- kind: FfiConverterString.read(from),- metadata: FfiConverterTypeResourceMetadata.read(from),- spec: FfiConverterTypePoolSpec.read(from),- status: FfiConverterOptionalTypeOSGymWorkspacePoolStatus.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.apiVersion, into);- FfiConverterString.write(value.kind, into);- FfiConverterTypeResourceMetadata.write(value.metadata, into);- FfiConverterTypePoolSpec.write(value.spec, into);- FfiConverterOptionalTypeOSGymWorkspacePoolStatus.write(value.status, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.apiVersion) +- FfiConverterString.allocationSize(value.kind) +- FfiConverterTypeResourceMetadata.allocationSize(value.metadata) +- FfiConverterTypePoolSpec.allocationSize(value.spec) +- FfiConverterOptionalTypeOSGymWorkspacePoolStatus.allocationSize(value.status);-- }- };- return new FFIConverter();+ type TypeName = Pool;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ apiVersion: FfiConverterString.read(from),+ kind: FfiConverterString.read(from),+ metadata: FfiConverterTypeResourceMetadata.read(from),+ spec: FfiConverterTypePoolSpec.read(from),+ status: FfiConverterOptionalTypeOSGymWorkspacePoolStatus.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.apiVersion, into);+ FfiConverterString.write(value.kind, into);+ FfiConverterTypeResourceMetadata.write(value.metadata, into);+ FfiConverterTypePoolSpec.write(value.spec, into);+ FfiConverterOptionalTypeOSGymWorkspacePoolStatus.write(+ value.status,+ into,+ );+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.apiVersion) ++ FfiConverterString.allocationSize(value.kind) ++ FfiConverterTypeResourceMetadata.allocationSize(value.metadata) ++ FfiConverterTypePoolSpec.allocationSize(value.spec) ++ FfiConverterOptionalTypeOSGymWorkspacePoolStatus.allocationSize(+ value.status,+ )+ );+ }+ }+ return new FFIConverter();})();export type CreateClaimRequest = {- pool: Pool,- spec?: ClaimSpec-}+ pool: Pool;+ spec?: ClaimSpec;+};/*** Generated factory for {@link CreateClaimRequest} record objects.*/export const CreateClaimRequest = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<CreateClaimRequest, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<CreateClaimRequest>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<CreateClaimRequest, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<CreateClaimRequest>,+ });})();const FfiConverterTypeCreateClaimRequest = (() => {- type TypeName = CreateClaimRequest;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- pool: FfiConverterTypePool.read(from),- spec: FfiConverterOptionalTypeClaimSpec.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterTypePool.write(value.pool, into);- FfiConverterOptionalTypeClaimSpec.write(value.spec, into);- }- allocationSize(value: TypeName): number {- return FfiConverterTypePool.allocationSize(value.pool) +- FfiConverterOptionalTypeClaimSpec.allocationSize(value.spec);-- }- };- return new FFIConverter();+ type TypeName = CreateClaimRequest;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ pool: FfiConverterTypePool.read(from),+ spec: FfiConverterOptionalTypeClaimSpec.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterTypePool.write(value.pool, into);+ FfiConverterOptionalTypeClaimSpec.write(value.spec, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterTypePool.allocationSize(value.pool) ++ FfiConverterOptionalTypeClaimSpec.allocationSize(value.spec)+ );+ }+ }+ return new FFIConverter();})();export type CreatePoolRequest = {- namespace: string,- spec: PoolSpec-}+ namespace: string;+ spec: PoolSpec;+};/*** Generated factory for {@link CreatePoolRequest} record objects.*/export const CreatePoolRequest = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<CreatePoolRequest, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<CreatePoolRequest>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<CreatePoolRequest, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<CreatePoolRequest>,+ });})();const FfiConverterTypeCreatePoolRequest = (() => {- type TypeName = CreatePoolRequest;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- namespace: FfiConverterString.read(from),- spec: FfiConverterTypePoolSpec.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.namespace, into);- FfiConverterTypePoolSpec.write(value.spec, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.namespace) +- FfiConverterTypePoolSpec.allocationSize(value.spec);-- }- };- return new FFIConverter();+ type TypeName = CreatePoolRequest;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ namespace: FfiConverterString.read(from),+ spec: FfiConverterTypePoolSpec.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.namespace, into);+ FfiConverterTypePoolSpec.write(value.spec, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.namespace) ++ FfiConverterTypePoolSpec.allocationSize(value.spec)+ );+ }+ }+ return new FFIConverter();})();-export interface CyclopsCredentialsLike {--}+export interface CyclopsCredentialsLike {}/*** @deprecated Use `CyclopsCredentialsLike` instead.*/export type CyclopsCredentialsInterface = CyclopsCredentialsLike;--export class CyclopsCredentials extends UniffiAbstractObject implements CyclopsCredentialsLike {-- readonly [uniffiTypeNameSymbol] = "CyclopsCredentials";- readonly [destructorGuardSymbol]: UniffiGcObject;- readonly [pointerLiteralSymbol]: UniffiHandle;- constructor(clientId: string, clientSecret: string) {- super();- const pointer =- uniffiCaller.rustCall(- /*caller:*/ (callStatus) => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopscredentials_new(- FfiConverterString.lower(clientId, nativeModule().rustbuffer_alloc),- FfiConverterString.lower(clientSecret, nativeModule().rustbuffer_alloc),- callStatus);- },- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+export class CyclopsCredentials+ extends UniffiAbstractObject+ implements CyclopsCredentialsLike+{+ readonly [uniffiTypeNameSymbol] = "CyclopsCredentials";+ readonly [destructorGuardSymbol]: UniffiGcObject;+ readonly [pointerLiteralSymbol]: UniffiHandle;+ constructor(clientId: string, clientSecret: string) {+ super();+ const pointer = uniffiCaller.rustCall(+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopscredentials_new(+ FfiConverterString.lower(clientId, nativeModule().rustbuffer_alloc),+ FfiConverterString.lower(+ clientSecret,+ nativeModule().rustbuffer_alloc,+ ),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),);- this[pointerLiteralSymbol] = pointer;- this[destructorGuardSymbol] = uniffiTypeCyclopsCredentialsObjectFactory.bless(pointer);- }------ uniffiDestroy(): void {- const ptr = (this as any)[destructorGuardSymbol];- if (ptr !== undefined) {- const pointer = uniffiTypeCyclopsCredentialsObjectFactory.pointer(this);- uniffiTypeCyclopsCredentialsObjectFactory.freePointer(pointer);- uniffiTypeCyclopsCredentialsObjectFactory.unbless(ptr);- delete (this as any)[destructorGuardSymbol];- }- }+ this[pointerLiteralSymbol] = pointer;+ this[destructorGuardSymbol] =+ uniffiTypeCyclopsCredentialsObjectFactory.bless(pointer);+ }- static instanceOf(obj_: any): obj_ is CyclopsCredentials {- return uniffiTypeCyclopsCredentialsObjectFactory.isConcreteType(obj_);+ uniffiDestroy(): void {+ const ptr = (this as any)[destructorGuardSymbol];+ if (ptr !== undefined) {+ const pointer = uniffiTypeCyclopsCredentialsObjectFactory.pointer(this);+ uniffiTypeCyclopsCredentialsObjectFactory.freePointer(pointer);+ uniffiTypeCyclopsCredentialsObjectFactory.unbless(ptr);+ delete (this as any)[destructorGuardSymbol];}+ }-+ static instanceOf(obj_: any): obj_ is CyclopsCredentials {+ return uniffiTypeCyclopsCredentialsObjectFactory.isConcreteType(obj_);+ }}-const uniffiTypeCyclopsCredentialsObjectFactory: UniffiObjectFactory<CyclopsCredentialsLike> = (() => {-+const uniffiTypeCyclopsCredentialsObjectFactory: UniffiObjectFactory<CyclopsCredentialsLike> =+ (() => {/// <reference lib="es2021" />- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {- uniffiTypeCyclopsCredentialsObjectFactory.freePointer(heldValue);- }) : null;-+ const registry =+ typeof FinalizationRegistry !== "undefined"+ ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {+ uniffiTypeCyclopsCredentialsObjectFactory.freePointer(heldValue);+ })+ : null;+return {- create(pointer: UniffiHandle): CyclopsCredentialsLike {+ create(pointer: UniffiHandle): CyclopsCredentialsLike {const instance = Object.create(CyclopsCredentials.prototype);instance[pointerLiteralSymbol] = pointer;instance[destructorGuardSymbol] = this.bless(pointer);instance[uniffiTypeNameSymbol] = "CyclopsCredentials";return instance;- },+ },-- bless(p: UniffiHandle): UniffiGcObject {+ bless(p: UniffiHandle): UniffiGcObject {const ptr = {- p, // make sure this object doesn't get optimized away.- markDestroyed: () => undefined,+ p, // make sure this object doesn't get optimized away.+ markDestroyed: () => undefined,};if (registry) {- registry.register(ptr, p, ptr);+ registry.register(ptr, p, ptr);}return ptr;- },+ },- unbless(ptr_: UniffiGcObject) {+ unbless(ptr_: UniffiGcObject) {if (registry) {- registry.unregister(ptr_);+ registry.unregister(ptr_);}- },+ },- pointer(obj_: CyclopsCredentialsLike): UniffiHandle {+ pointer(obj_: CyclopsCredentialsLike): UniffiHandle {if ((obj_ as any)[destructorGuardSymbol] === undefined) {- throw new UniffiInternalError.UnexpectedNullPointer();+ throw new UniffiInternalError.UnexpectedNullPointer();}return (obj_ as any)[pointerLiteralSymbol];- },+ },- clonePointer(obj_: CyclopsCredentialsLike): UniffiHandle {+ clonePointer(obj_: CyclopsCredentialsLike): UniffiHandle {const pointer = this.pointer(obj_);return uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_fn_clone_cyclopscredentials(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_clone_cyclopscredentials(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- freePointer(pointer: UniffiHandle): void {+ freePointer(pointer: UniffiHandle): void {uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_fn_free_cyclopscredentials(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_free_cyclopscredentials(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- isConcreteType(obj_: any): obj_ is CyclopsCredentialsLike {- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "CyclopsCredentials";- },-}})();-const FfiConverterTypeCyclopsCredentials = new FfiConverterObject(uniffiTypeCyclopsCredentialsObjectFactory);+ isConcreteType(obj_: any): obj_ is CyclopsCredentialsLike {+ return (+ obj_[destructorGuardSymbol] &&+ obj_[uniffiTypeNameSymbol] === "CyclopsCredentials"+ );+ },+ };+ })();+const FfiConverterTypeCyclopsCredentials = new FfiConverterObject(+ uniffiTypeCyclopsCredentialsObjectFactory,+);export type CyclopsConfiguration = {- baseUrl: string,- tokenUrl: string,- credentials: CyclopsCredentialsLike,- poolPollIntervalMs: bigint,- poolPollLimit: number,- claimPollIntervalMs: bigint,- claimPollLimit: number-}+ baseUrl: string;+ tokenUrl: string;+ credentials: CyclopsCredentialsLike;+ poolPollIntervalMs: bigint;+ poolPollLimit: number;+ claimPollIntervalMs: bigint;+ claimPollLimit: number;+};/*** Generated factory for {@link CyclopsConfiguration} record objects.*/export const CyclopsConfiguration = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<CyclopsConfiguration, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<CyclopsConfiguration>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ CyclopsConfiguration,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<CyclopsConfiguration>,+ });})();const FfiConverterTypeCyclopsConfiguration = (() => {- type TypeName = CyclopsConfiguration;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- baseUrl: FfiConverterString.read(from),- tokenUrl: FfiConverterString.read(from),- credentials: FfiConverterTypeCyclopsCredentials.read(from),- poolPollIntervalMs: FfiConverterUInt64.read(from),- poolPollLimit: FfiConverterUInt32.read(from),- claimPollIntervalMs: FfiConverterUInt64.read(from),- claimPollLimit: FfiConverterUInt32.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.baseUrl, into);- FfiConverterString.write(value.tokenUrl, into);- FfiConverterTypeCyclopsCredentials.write(value.credentials, into);- FfiConverterUInt64.write(value.poolPollIntervalMs, into);- FfiConverterUInt32.write(value.poolPollLimit, into);- FfiConverterUInt64.write(value.claimPollIntervalMs, into);- FfiConverterUInt32.write(value.claimPollLimit, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.baseUrl) +- FfiConverterString.allocationSize(value.tokenUrl) +- FfiConverterTypeCyclopsCredentials.allocationSize(value.credentials) +- FfiConverterUInt64.allocationSize(value.poolPollIntervalMs) +- FfiConverterUInt32.allocationSize(value.poolPollLimit) +- FfiConverterUInt64.allocationSize(value.claimPollIntervalMs) +- FfiConverterUInt32.allocationSize(value.claimPollLimit);-- }- };- return new FFIConverter();+ type TypeName = CyclopsConfiguration;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ baseUrl: FfiConverterString.read(from),+ tokenUrl: FfiConverterString.read(from),+ credentials: FfiConverterTypeCyclopsCredentials.read(from),+ poolPollIntervalMs: FfiConverterUInt64.read(from),+ poolPollLimit: FfiConverterUInt32.read(from),+ claimPollIntervalMs: FfiConverterUInt64.read(from),+ claimPollLimit: FfiConverterUInt32.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.baseUrl, into);+ FfiConverterString.write(value.tokenUrl, into);+ FfiConverterTypeCyclopsCredentials.write(value.credentials, into);+ FfiConverterUInt64.write(value.poolPollIntervalMs, into);+ FfiConverterUInt32.write(value.poolPollLimit, into);+ FfiConverterUInt64.write(value.claimPollIntervalMs, into);+ FfiConverterUInt32.write(value.claimPollLimit, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.baseUrl) ++ FfiConverterString.allocationSize(value.tokenUrl) ++ FfiConverterTypeCyclopsCredentials.allocationSize(value.credentials) ++ FfiConverterUInt64.allocationSize(value.poolPollIntervalMs) ++ FfiConverterUInt32.allocationSize(value.poolPollLimit) ++ FfiConverterUInt64.allocationSize(value.claimPollIntervalMs) ++ FfiConverterUInt32.allocationSize(value.claimPollLimit)+ );+ }+ }+ return new FFIConverter();+})();++export type CyclopsTokenProviderConfiguration = {+ baseUrl: string;+ poolPollIntervalMs: bigint;+ poolPollLimit: number;+ claimPollIntervalMs: bigint;+ claimPollLimit: number;+};++/**+ * Generated factory for {@link CyclopsTokenProviderConfiguration} record objects.+ */+export const CyclopsTokenProviderConfiguration = (() => {+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ CyclopsTokenProviderConfiguration,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<CyclopsTokenProviderConfiguration>,+ });+})();++const FfiConverterTypeCyclopsTokenProviderConfiguration = (() => {+ type TypeName = CyclopsTokenProviderConfiguration;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ baseUrl: FfiConverterString.read(from),+ poolPollIntervalMs: FfiConverterUInt64.read(from),+ poolPollLimit: FfiConverterUInt32.read(from),+ claimPollIntervalMs: FfiConverterUInt64.read(from),+ claimPollLimit: FfiConverterUInt32.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.baseUrl, into);+ FfiConverterUInt64.write(value.poolPollIntervalMs, into);+ FfiConverterUInt32.write(value.poolPollLimit, into);+ FfiConverterUInt64.write(value.claimPollIntervalMs, into);+ FfiConverterUInt32.write(value.claimPollLimit, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.baseUrl) ++ FfiConverterUInt64.allocationSize(value.poolPollIntervalMs) ++ FfiConverterUInt32.allocationSize(value.poolPollLimit) ++ FfiConverterUInt64.allocationSize(value.claimPollIntervalMs) ++ FfiConverterUInt32.allocationSize(value.claimPollLimit)+ );+ }+ }+ return new FFIConverter();})();export type HttpHeader = {- name: string,- value: string-}+ name: string;+ value: string;+};/*** Generated factory for {@link HttpHeader} record objects.*/export const HttpHeader = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<HttpHeader, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<HttpHeader>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<HttpHeader, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<HttpHeader>,+ });})();const FfiConverterTypeHttpHeader = (() => {- type TypeName = HttpHeader;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- name: FfiConverterString.read(from),- value: FfiConverterString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.name, into);- FfiConverterString.write(value.value, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.name) +- FfiConverterString.allocationSize(value.value);-- }- };- return new FFIConverter();+ type TypeName = HttpHeader;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ name: FfiConverterString.read(from),+ value: FfiConverterString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.name, into);+ FfiConverterString.write(value.value, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.name) ++ FfiConverterString.allocationSize(value.value)+ );+ }+ }+ return new FFIConverter();})();export type HttpRequest = {- method: string,- url: string,- headers: Array<HttpHeader>,- body?: ArrayBuffer-}+ method: string;+ url: string;+ headers: Array<HttpHeader>;+ body?: ArrayBuffer;+};/*** Generated factory for {@link HttpRequest} record objects.*/export const HttpRequest = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<HttpRequest, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<HttpRequest>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<HttpRequest, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<HttpRequest>,+ });})();const FfiConverterTypeHttpRequest = (() => {- type TypeName = HttpRequest;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- method: FfiConverterString.read(from),- url: FfiConverterString.read(from),- headers: FfiConverterSequenceTypeHttpHeader.read(from),- body: FfiConverterOptionalBytes.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.method, into);- FfiConverterString.write(value.url, into);- FfiConverterSequenceTypeHttpHeader.write(value.headers, into);- FfiConverterOptionalBytes.write(value.body, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.method) +- FfiConverterString.allocationSize(value.url) +- FfiConverterSequenceTypeHttpHeader.allocationSize(value.headers) +- FfiConverterOptionalBytes.allocationSize(value.body);-- }- };- return new FFIConverter();+ type TypeName = HttpRequest;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ method: FfiConverterString.read(from),+ url: FfiConverterString.read(from),+ headers: FfiConverterSequenceTypeHttpHeader.read(from),+ body: FfiConverterOptionalBytes.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.method, into);+ FfiConverterString.write(value.url, into);+ FfiConverterSequenceTypeHttpHeader.write(value.headers, into);+ FfiConverterOptionalBytes.write(value.body, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.method) ++ FfiConverterString.allocationSize(value.url) ++ FfiConverterSequenceTypeHttpHeader.allocationSize(value.headers) ++ FfiConverterOptionalBytes.allocationSize(value.body)+ );+ }+ }+ return new FFIConverter();})();export type HttpResponse = {- status: number,- headers: Array<HttpHeader>,- body: ArrayBuffer-}+ status: number;+ headers: Array<HttpHeader>;+ body: ArrayBuffer;+};/*** Generated factory for {@link HttpResponse} record objects.*/export const HttpResponse = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<HttpResponse, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<HttpResponse>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<HttpResponse, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<HttpResponse>,+ });})();const FfiConverterTypeHttpResponse = (() => {- type TypeName = HttpResponse;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- status: FfiConverterUInt16.read(from),- headers: FfiConverterSequenceTypeHttpHeader.read(from),- body: FfiConverterArrayBuffer.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterUInt16.write(value.status, into);- FfiConverterSequenceTypeHttpHeader.write(value.headers, into);- FfiConverterArrayBuffer.write(value.body, into);- }- allocationSize(value: TypeName): number {- return FfiConverterUInt16.allocationSize(value.status) +- FfiConverterSequenceTypeHttpHeader.allocationSize(value.headers) +- FfiConverterArrayBuffer.allocationSize(value.body);-- }- };- return new FFIConverter();+ type TypeName = HttpResponse;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ status: FfiConverterUInt16.read(from),+ headers: FfiConverterSequenceTypeHttpHeader.read(from),+ body: FfiConverterArrayBuffer.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterUInt16.write(value.status, into);+ FfiConverterSequenceTypeHttpHeader.write(value.headers, into);+ FfiConverterArrayBuffer.write(value.body, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterUInt16.allocationSize(value.status) ++ FfiConverterSequenceTypeHttpHeader.allocationSize(value.headers) ++ FfiConverterArrayBuffer.allocationSize(value.body)+ );+ }+ }+ return new FFIConverter();})();export type Sandbox = {- namespace: string,- claim: string,- name: string,- services: Array<string>-}+ namespace: string;+ claim: string;+ name: string;+ services: Array<string>;+};/*** Generated factory for {@link Sandbox} record objects.*/export const Sandbox = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<Sandbox, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<Sandbox>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<Sandbox, ReturnType<typeof defaults>>(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<Sandbox>,+ });})();const FfiConverterTypeSandbox = (() => {- type TypeName = Sandbox;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- namespace: FfiConverterString.read(from),- claim: FfiConverterString.read(from),- name: FfiConverterString.read(from),- services: FfiConverterSequenceString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.namespace, into);- FfiConverterString.write(value.claim, into);- FfiConverterString.write(value.name, into);- FfiConverterSequenceString.write(value.services, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.namespace) +- FfiConverterString.allocationSize(value.claim) +- FfiConverterString.allocationSize(value.name) +- FfiConverterSequenceString.allocationSize(value.services);-- }- };- return new FFIConverter();+ type TypeName = Sandbox;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ namespace: FfiConverterString.read(from),+ claim: FfiConverterString.read(from),+ name: FfiConverterString.read(from),+ services: FfiConverterSequenceString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.namespace, into);+ FfiConverterString.write(value.claim, into);+ FfiConverterString.write(value.name, into);+ FfiConverterSequenceString.write(value.services, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.namespace) ++ FfiConverterString.allocationSize(value.claim) ++ FfiConverterString.allocationSize(value.name) ++ FfiConverterSequenceString.allocationSize(value.services)+ );+ }+ }+ return new FFIConverter();+})();++// Error type: AccessTokenProviderError+export enum AccessTokenProviderError_Tags {+ Failed = "Failed",+}+export const AccessTokenProviderError = (() => {+ type Failed__interface = {+ tag: AccessTokenProviderError_Tags.Failed;+ inner: Readonly<{ reason: string }>;+ };+ class Failed_ extends UniffiError implements Failed__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "AccessTokenProviderError";+ readonly tag = AccessTokenProviderError_Tags.Failed;+ readonly inner: Readonly<{ reason: string }>;+ constructor(inner: { reason: string }) {+ super("AccessTokenProviderError", "Failed");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { reason: string }): Failed_ {+ return new Failed_(inner);+ }++ static instanceOf(obj: any): obj is Failed_ {+ return obj.tag === AccessTokenProviderError_Tags.Failed;+ }+ static hasInner(obj: any): obj is Failed_ {+ return Failed_.instanceOf(obj);+ }++ static getInner(obj: Failed_): Readonly<{ reason: string }> {+ return obj.inner;+ }+ }++ function instanceOf(obj: any): obj is AccessTokenProviderError {+ return obj[uniffiTypeNameSymbol] === "AccessTokenProviderError";+ }++ return Object.freeze({+ instanceOf,+ Failed: Failed_,+ });})();+export type AccessTokenProviderError = InstanceType<+ (typeof AccessTokenProviderError)["Failed"]+>;+// FfiConverter for enum AccessTokenProviderError+const FfiConverterTypeAccessTokenProviderError = (() => {+ const ordinalConverter = FfiConverterInt32;+ type TypeName = AccessTokenProviderError;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return new AccessTokenProviderError.Failed({+ reason: FfiConverterString.read(from),+ });+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ write(value: TypeName, into: RustBuffer): void {+ switch (value.tag) {+ case AccessTokenProviderError_Tags.Failed: {+ ordinalConverter.write(1, into);+ const inner = value.inner;+ FfiConverterString.write(inner.reason, into);+ return;+ }+ default:+ // Throwing from here means that AccessTokenProviderError_Tags hasn't matched an ordinal.+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ allocationSize(value: TypeName): number {+ switch (value.tag) {+ case AccessTokenProviderError_Tags.Failed: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(1);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ }+ return new FFIConverter();+})();// Error type: HttpErrorexport enum HttpError_Tags {- Transport = "Transport"+ Transport = "Transport",}export const HttpError = (() => {+ type Transport__interface = {+ tag: HttpError_Tags.Transport;+ inner: Readonly<{ reason: string }>;+ };+ class Transport_ extends UniffiError implements Transport__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "HttpError";+ readonly tag = HttpError_Tags.Transport;+ readonly inner: Readonly<{ reason: string }>;+ constructor(inner: { reason: string }) {+ super("HttpError", "Transport");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { reason: string }): Transport_ {+ return new Transport_(inner);+ }- type Transport__interface = {- tag: HttpError_Tags.Transport;- inner:-Readonly<{reason: string}>- };- class Transport_ extends UniffiError implements Transport__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "HttpError";- readonly tag = HttpError_Tags.Transport;- readonly inner:-Readonly<{reason: string}>;- constructor(-inner: {reason: string }) {- super("HttpError", "Transport");-- this.inner = Object.freeze(inner);- }- static new(-inner: {reason: string }): Transport_ {- return new Transport_(inner);- }-- static instanceOf(obj: any): obj is Transport_ {- return obj.tag === HttpError_Tags.Transport;- }- static hasInner(obj: any): obj is Transport_ {- return Transport_.instanceOf(obj);- }-- static getInner(obj: Transport_):-Readonly<{reason: string}> {- return obj.inner;- }-+ static instanceOf(obj: any): obj is Transport_ {+ return obj.tag === HttpError_Tags.Transport;+ }+ static hasInner(obj: any): obj is Transport_ {+ return Transport_.instanceOf(obj);}- function instanceOf(obj: any): obj is HttpError {- return obj[uniffiTypeNameSymbol] === "HttpError";+ static getInner(obj: Transport_): Readonly<{ reason: string }> {+ return obj.inner;}+ }- return Object.freeze({- instanceOf,- Transport: Transport_- });+ function instanceOf(obj: any): obj is HttpError {+ return obj[uniffiTypeNameSymbol] === "HttpError";+ }+ return Object.freeze({+ instanceOf,+ Transport: Transport_,+ });})();-export type HttpError = InstanceType<- typeof HttpError['Transport']->;+export type HttpError = InstanceType<(typeof HttpError)["Transport"]>;// FfiConverter for enum HttpErrorconst FfiConverterTypeHttpError = (() => {- const ordinalConverter = FfiConverterInt32;- type TypeName = HttpError;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- switch (ordinalConverter.read(from)) {- case 1: return new HttpError.Transport({reason: FfiConverterString.read(from) });- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- write(value: TypeName, into: RustBuffer): void {- switch (value.tag) {- case HttpError_Tags.Transport: {- ordinalConverter.write(1, into);- const inner = value.inner;- FfiConverterString.write(inner.reason, into);- return;- }- default:- // Throwing from here means that HttpError_Tags hasn't matched an ordinal.- throw new UniffiInternalError.UnexpectedEnumCase();- }- }- allocationSize(value: TypeName): number {- switch (value.tag) {- case HttpError_Tags.Transport: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(1);- size += FfiConverterString.allocationSize(inner.reason);- return size;- }- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }+ const ordinalConverter = FfiConverterInt32;+ type TypeName = HttpError;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return new HttpError.Transport({+ reason: FfiConverterString.read(from),+ });+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ write(value: TypeName, into: RustBuffer): void {+ switch (value.tag) {+ case HttpError_Tags.Transport: {+ ordinalConverter.write(1, into);+ const inner = value.inner;+ FfiConverterString.write(inner.reason, into);+ return;+ }+ default:+ // Throwing from here means that HttpError_Tags hasn't matched an ordinal.+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ allocationSize(value: TypeName): number {+ switch (value.tag) {+ case HttpError_Tags.Transport: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(1);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }}- return new FFIConverter();+ }+ return new FFIConverter();})();-// Error type: SdkErrorexport enum SdkError_Tags {- Configuration = "Configuration",- InvalidResourceName = "InvalidResourceName",- Transport = "Transport",- Token = "Token",- Body = "Body",- Status = "Status",- UnknownService = "UnknownService",- InvalidServicePath = "InvalidServicePath",- ClaimFailed = "ClaimFailed",- ClaimTimeout = "ClaimTimeout"+ Configuration = "Configuration",+ InvalidResourceName = "InvalidResourceName",+ Transport = "Transport",+ Token = "Token",+ Body = "Body",+ Status = "Status",+ UnknownService = "UnknownService",+ InvalidServicePath = "InvalidServicePath",+ ClaimFailed = "ClaimFailed",+ ClaimTimeout = "ClaimTimeout",}export const SdkError = (() => {+ type Configuration__interface = {+ tag: SdkError_Tags.Configuration;+ inner: Readonly<{ reason: string }>;+ };+ class Configuration_ extends UniffiError implements Configuration__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.Configuration;+ readonly inner: Readonly<{ reason: string }>;+ constructor(inner: { reason: string }) {+ super("SdkError", "Configuration");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { reason: string }): Configuration_ {+ return new Configuration_(inner);+ }- type Configuration__interface = {- tag: SdkError_Tags.Configuration;- inner:-Readonly<{reason: string}>- };- class Configuration_ extends UniffiError implements Configuration__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.Configuration;- readonly inner:-Readonly<{reason: string}>;- constructor(-inner: {reason: string }) {- super("SdkError", "Configuration");-- this.inner = Object.freeze(inner);- }- static new(-inner: {reason: string }): Configuration_ {- return new Configuration_(inner);- }-- static instanceOf(obj: any): obj is Configuration_ {- return obj.tag === SdkError_Tags.Configuration;- }- static hasInner(obj: any): obj is Configuration_ {- return Configuration_.instanceOf(obj);- }+ static instanceOf(obj: any): obj is Configuration_ {+ return obj.tag === SdkError_Tags.Configuration;+ }+ static hasInner(obj: any): obj is Configuration_ {+ return Configuration_.instanceOf(obj);+ }- static getInner(obj: Configuration_):-Readonly<{reason: string}> {- return obj.inner;- }+ static getInner(obj: Configuration_): Readonly<{ reason: string }> {+ return obj.inner;+ }+ }+ type InvalidResourceName__interface = {+ tag: SdkError_Tags.InvalidResourceName;+ inner: Readonly<{ field: string; value: string; reason: string }>;+ };+ class InvalidResourceName_+ extends UniffiError+ implements InvalidResourceName__interface+ {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.InvalidResourceName;+ readonly inner: Readonly<{ field: string; value: string; reason: string }>;+ constructor(inner: { field: string; value: string; reason: string }) {+ super("SdkError", "InvalidResourceName");++ this.inner = Object.freeze(inner);+ }+ static new(inner: {+ field: string;+ value: string;+ reason: string;+ }): InvalidResourceName_ {+ return new InvalidResourceName_(inner);}- type InvalidResourceName__interface = {- tag: SdkError_Tags.InvalidResourceName;- inner:-Readonly<{field: string; value: string; reason: string}>- };- class InvalidResourceName_ extends UniffiError implements InvalidResourceName__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.InvalidResourceName;- readonly inner:-Readonly<{field: string; value: string; reason: string}>;- constructor(-inner: {field: string; value: string; reason: string }) {- super("SdkError", "InvalidResourceName");-- this.inner = Object.freeze(inner);- }- static new(-inner: {field: string; value: string; reason: string }): InvalidResourceName_ {- return new InvalidResourceName_(inner);- }+ static instanceOf(obj: any): obj is InvalidResourceName_ {+ return obj.tag === SdkError_Tags.InvalidResourceName;+ }+ static hasInner(obj: any): obj is InvalidResourceName_ {+ return InvalidResourceName_.instanceOf(obj);+ }- static instanceOf(obj: any): obj is InvalidResourceName_ {- return obj.tag === SdkError_Tags.InvalidResourceName;- }- static hasInner(obj: any): obj is InvalidResourceName_ {- return InvalidResourceName_.instanceOf(obj);- }+ static getInner(+ obj: InvalidResourceName_,+ ): Readonly<{ field: string; value: string; reason: string }> {+ return obj.inner;+ }+ }- static getInner(obj: InvalidResourceName_):-Readonly<{field: string; value: string; reason: string}> {- return obj.inner;- }+ type Transport__interface = {+ tag: SdkError_Tags.Transport;+ inner: Readonly<{ reason: string }>;+ };+ class Transport_ extends UniffiError implements Transport__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.Transport;+ readonly inner: Readonly<{ reason: string }>;+ constructor(inner: { reason: string }) {+ super("SdkError", "Transport");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { reason: string }): Transport_ {+ return new Transport_(inner);+ }+ static instanceOf(obj: any): obj is Transport_ {+ return obj.tag === SdkError_Tags.Transport;+ }+ static hasInner(obj: any): obj is Transport_ {+ return Transport_.instanceOf(obj);}- type Transport__interface = {- tag: SdkError_Tags.Transport;- inner:-Readonly<{reason: string}>- };- class Transport_ extends UniffiError implements Transport__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.Transport;- readonly inner:-Readonly<{reason: string}>;- constructor(-inner: {reason: string }) {- super("SdkError", "Transport");-- this.inner = Object.freeze(inner);- }- static new(-inner: {reason: string }): Transport_ {- return new Transport_(inner);- }+ static getInner(obj: Transport_): Readonly<{ reason: string }> {+ return obj.inner;+ }+ }- static instanceOf(obj: any): obj is Transport_ {- return obj.tag === SdkError_Tags.Transport;- }- static hasInner(obj: any): obj is Transport_ {- return Transport_.instanceOf(obj);- }+ type Token__interface = {+ tag: SdkError_Tags.Token;+ inner: Readonly<{ reason: string }>;+ };+ class Token_ extends UniffiError implements Token__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.Token;+ readonly inner: Readonly<{ reason: string }>;+ constructor(inner: { reason: string }) {+ super("SdkError", "Token");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { reason: string }): Token_ {+ return new Token_(inner);+ }- static getInner(obj: Transport_):-Readonly<{reason: string}> {- return obj.inner;- }+ static instanceOf(obj: any): obj is Token_ {+ return obj.tag === SdkError_Tags.Token;+ }+ static hasInner(obj: any): obj is Token_ {+ return Token_.instanceOf(obj);+ }+ static getInner(obj: Token_): Readonly<{ reason: string }> {+ return obj.inner;}+ }- type Token__interface = {- tag: SdkError_Tags.Token;- inner:-Readonly<{reason: string}>- };- class Token_ extends UniffiError implements Token__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.Token;- readonly inner:-Readonly<{reason: string}>;- constructor(-inner: {reason: string }) {- super("SdkError", "Token");-- this.inner = Object.freeze(inner);- }- static new(-inner: {reason: string }): Token_ {- return new Token_(inner);- }+ type Body__interface = {+ tag: SdkError_Tags.Body;+ inner: Readonly<{ reason: string }>;+ };+ class Body_ extends UniffiError implements Body__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.Body;+ readonly inner: Readonly<{ reason: string }>;+ constructor(inner: { reason: string }) {+ super("SdkError", "Body");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { reason: string }): Body_ {+ return new Body_(inner);+ }- static instanceOf(obj: any): obj is Token_ {- return obj.tag === SdkError_Tags.Token;- }- static hasInner(obj: any): obj is Token_ {- return Token_.instanceOf(obj);- }+ static instanceOf(obj: any): obj is Body_ {+ return obj.tag === SdkError_Tags.Body;+ }+ static hasInner(obj: any): obj is Body_ {+ return Body_.instanceOf(obj);+ }- static getInner(obj: Token_):-Readonly<{reason: string}> {- return obj.inner;- }+ static getInner(obj: Body_): Readonly<{ reason: string }> {+ return obj.inner;+ }+ }+ type Status__interface = {+ tag: SdkError_Tags.Status;+ inner: Readonly<{ operation: string; status: number; body: string }>;+ };+ class Status_ extends UniffiError implements Status__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.Status;+ readonly inner: Readonly<{+ operation: string;+ status: number;+ body: string;+ }>;+ constructor(inner: { operation: string; status: number; body: string }) {+ super("SdkError", "Status");++ this.inner = Object.freeze(inner);+ }+ static new(inner: {+ operation: string;+ status: number;+ body: string;+ }): Status_ {+ return new Status_(inner);}- type Body__interface = {- tag: SdkError_Tags.Body;- inner:-Readonly<{reason: string}>- };- class Body_ extends UniffiError implements Body__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.Body;- readonly inner:-Readonly<{reason: string}>;- constructor(-inner: {reason: string }) {- super("SdkError", "Body");-- this.inner = Object.freeze(inner);- }- static new(-inner: {reason: string }): Body_ {- return new Body_(inner);- }+ static instanceOf(obj: any): obj is Status_ {+ return obj.tag === SdkError_Tags.Status;+ }+ static hasInner(obj: any): obj is Status_ {+ return Status_.instanceOf(obj);+ }- static instanceOf(obj: any): obj is Body_ {- return obj.tag === SdkError_Tags.Body;- }- static hasInner(obj: any): obj is Body_ {- return Body_.instanceOf(obj);- }+ static getInner(+ obj: Status_,+ ): Readonly<{ operation: string; status: number; body: string }> {+ return obj.inner;+ }+ }- static getInner(obj: Body_):-Readonly<{reason: string}> {- return obj.inner;- }+ type UnknownService__interface = {+ tag: SdkError_Tags.UnknownService;+ inner: Readonly<{ requested: string; available: Array<string> }>;+ };+ class UnknownService_+ extends UniffiError+ implements UnknownService__interface+ {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.UnknownService;+ readonly inner: Readonly<{ requested: string; available: Array<string> }>;+ constructor(inner: { requested: string; available: Array<string> }) {+ super("SdkError", "UnknownService");++ this.inner = Object.freeze(inner);+ }+ static new(inner: {+ requested: string;+ available: Array<string>;+ }): UnknownService_ {+ return new UnknownService_(inner);+ }+ static instanceOf(obj: any): obj is UnknownService_ {+ return obj.tag === SdkError_Tags.UnknownService;+ }+ static hasInner(obj: any): obj is UnknownService_ {+ return UnknownService_.instanceOf(obj);}- type Status__interface = {- tag: SdkError_Tags.Status;- inner:-Readonly<{operation: string; status: number; body: string}>- };- class Status_ extends UniffiError implements Status__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.Status;- readonly inner:-Readonly<{operation: string; status: number; body: string}>;- constructor(-inner: {operation: string; status: number; body: string }) {- super("SdkError", "Status");-- this.inner = Object.freeze(inner);- }- static new(-inner: {operation: string; status: number; body: string }): Status_ {- return new Status_(inner);- }+ static getInner(+ obj: UnknownService_,+ ): Readonly<{ requested: string; available: Array<string> }> {+ return obj.inner;+ }+ }- static instanceOf(obj: any): obj is Status_ {- return obj.tag === SdkError_Tags.Status;- }- static hasInner(obj: any): obj is Status_ {- return Status_.instanceOf(obj);- }+ type InvalidServicePath__interface = {+ tag: SdkError_Tags.InvalidServicePath;+ inner: Readonly<{ path: string }>;+ };+ class InvalidServicePath_+ extends UniffiError+ implements InvalidServicePath__interface+ {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.InvalidServicePath;+ readonly inner: Readonly<{ path: string }>;+ constructor(inner: { path: string }) {+ super("SdkError", "InvalidServicePath");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { path: string }): InvalidServicePath_ {+ return new InvalidServicePath_(inner);+ }- static getInner(obj: Status_):-Readonly<{operation: string; status: number; body: string}> {- return obj.inner;- }+ static instanceOf(obj: any): obj is InvalidServicePath_ {+ return obj.tag === SdkError_Tags.InvalidServicePath;+ }+ static hasInner(obj: any): obj is InvalidServicePath_ {+ return InvalidServicePath_.instanceOf(obj);+ }+ static getInner(obj: InvalidServicePath_): Readonly<{ path: string }> {+ return obj.inner;}+ }- type UnknownService__interface = {- tag: SdkError_Tags.UnknownService;- inner:-Readonly<{requested: string; available: Array<string>}>- };- class UnknownService_ extends UniffiError implements UnknownService__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.UnknownService;- readonly inner:-Readonly<{requested: string; available: Array<string>}>;- constructor(-inner: {requested: string; available: Array<string> }) {- super("SdkError", "UnknownService");-- this.inner = Object.freeze(inner);- }- static new(-inner: {requested: string; available: Array<string> }): UnknownService_ {- return new UnknownService_(inner);- }+ type ClaimFailed__interface = {+ tag: SdkError_Tags.ClaimFailed;+ inner: Readonly<{ phase: string; status: string }>;+ };+ class ClaimFailed_ extends UniffiError implements ClaimFailed__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.ClaimFailed;+ readonly inner: Readonly<{ phase: string; status: string }>;+ constructor(inner: { phase: string; status: string }) {+ super("SdkError", "ClaimFailed");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { phase: string; status: string }): ClaimFailed_ {+ return new ClaimFailed_(inner);+ }- static instanceOf(obj: any): obj is UnknownService_ {- return obj.tag === SdkError_Tags.UnknownService;- }- static hasInner(obj: any): obj is UnknownService_ {- return UnknownService_.instanceOf(obj);- }+ static instanceOf(obj: any): obj is ClaimFailed_ {+ return obj.tag === SdkError_Tags.ClaimFailed;+ }+ static hasInner(obj: any): obj is ClaimFailed_ {+ return ClaimFailed_.instanceOf(obj);+ }- static getInner(obj: UnknownService_):-Readonly<{requested: string; available: Array<string>}> {- return obj.inner;- }+ static getInner(+ obj: ClaimFailed_,+ ): Readonly<{ phase: string; status: string }> {+ return obj.inner;+ }+ }+ type ClaimTimeout__interface = {+ tag: SdkError_Tags.ClaimTimeout;+ };+ class ClaimTimeout_ extends UniffiError implements ClaimTimeout__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "SdkError";+ readonly tag = SdkError_Tags.ClaimTimeout;+ constructor() {+ super("SdkError", "ClaimTimeout");}- type InvalidServicePath__interface = {- tag: SdkError_Tags.InvalidServicePath;- inner:-Readonly<{path: string}>- };- class InvalidServicePath_ extends UniffiError implements InvalidServicePath__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.InvalidServicePath;- readonly inner:-Readonly<{path: string}>;- constructor(-inner: {path: string }) {- super("SdkError", "InvalidServicePath");-- this.inner = Object.freeze(inner);- }- static new(-inner: {path: string }): InvalidServicePath_ {- return new InvalidServicePath_(inner);- }+ static new(): ClaimTimeout_ {+ return new ClaimTimeout_();+ }- static instanceOf(obj: any): obj is InvalidServicePath_ {- return obj.tag === SdkError_Tags.InvalidServicePath;- }- static hasInner(obj: any): obj is InvalidServicePath_ {- return InvalidServicePath_.instanceOf(obj);- }+ static instanceOf(obj: any): obj is ClaimTimeout_ {+ return obj.tag === SdkError_Tags.ClaimTimeout;+ }+ static hasInner(obj: any): obj is ClaimTimeout_ {+ return false;+ }+ }- static getInner(obj: InvalidServicePath_):-Readonly<{path: string}> {- return obj.inner;- }+ function instanceOf(obj: any): obj is SdkError {+ return obj[uniffiTypeNameSymbol] === "SdkError";+ }++ return Object.freeze({+ instanceOf,+ Configuration: Configuration_,+ InvalidResourceName: InvalidResourceName_,+ Transport: Transport_,+ Token: Token_,+ Body: Body_,+ Status: Status_,+ UnknownService: UnknownService_,+ InvalidServicePath: InvalidServicePath_,+ ClaimFailed: ClaimFailed_,+ ClaimTimeout: ClaimTimeout_,+ });+})();+export type SdkError = InstanceType<+ (typeof SdkError)[+ | "Configuration"+ | "InvalidResourceName"+ | "Transport"+ | "Token"+ | "Body"+ | "Status"+ | "UnknownService"+ | "InvalidServicePath"+ | "ClaimFailed"+ | "ClaimTimeout"]+>;+// FfiConverter for enum SdkError+const FfiConverterTypeSdkError = (() => {+ const ordinalConverter = FfiConverterInt32;+ type TypeName = SdkError;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return new SdkError.Configuration({+ reason: FfiConverterString.read(from),+ });+ case 2:+ return new SdkError.InvalidResourceName({+ field: FfiConverterString.read(from),+ value: FfiConverterString.read(from),+ reason: FfiConverterString.read(from),+ });+ case 3:+ return new SdkError.Transport({+ reason: FfiConverterString.read(from),+ });+ case 4:+ return new SdkError.Token({ reason: FfiConverterString.read(from) });+ case 5:+ return new SdkError.Body({ reason: FfiConverterString.read(from) });+ case 6:+ return new SdkError.Status({+ operation: FfiConverterString.read(from),+ status: FfiConverterUInt16.read(from),+ body: FfiConverterString.read(from),+ });+ case 7:+ return new SdkError.UnknownService({+ requested: FfiConverterString.read(from),+ available: FfiConverterSequenceString.read(from),+ });+ case 8:+ return new SdkError.InvalidServicePath({+ path: FfiConverterString.read(from),+ });+ case 9:+ return new SdkError.ClaimFailed({+ phase: FfiConverterString.read(from),+ status: FfiConverterString.read(from),+ });+ case 10:+ return new SdkError.ClaimTimeout();+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ write(value: TypeName, into: RustBuffer): void {+ switch (value.tag) {+ case SdkError_Tags.Configuration: {+ ordinalConverter.write(1, into);+ const inner = value.inner;+ FfiConverterString.write(inner.reason, into);+ return;+ }+ case SdkError_Tags.InvalidResourceName: {+ ordinalConverter.write(2, into);+ const inner = value.inner;+ FfiConverterString.write(inner.field, into);+ FfiConverterString.write(inner.value, into);+ FfiConverterString.write(inner.reason, into);+ return;+ }+ case SdkError_Tags.Transport: {+ ordinalConverter.write(3, into);+ const inner = value.inner;+ FfiConverterString.write(inner.reason, into);+ return;+ }+ case SdkError_Tags.Token: {+ ordinalConverter.write(4, into);+ const inner = value.inner;+ FfiConverterString.write(inner.reason, into);+ return;+ }+ case SdkError_Tags.Body: {+ ordinalConverter.write(5, into);+ const inner = value.inner;+ FfiConverterString.write(inner.reason, into);+ return;+ }+ case SdkError_Tags.Status: {+ ordinalConverter.write(6, into);+ const inner = value.inner;+ FfiConverterString.write(inner.operation, into);+ FfiConverterUInt16.write(inner.status, into);+ FfiConverterString.write(inner.body, into);+ return;+ }+ case SdkError_Tags.UnknownService: {+ ordinalConverter.write(7, into);+ const inner = value.inner;+ FfiConverterString.write(inner.requested, into);+ FfiConverterSequenceString.write(inner.available, into);+ return;+ }+ case SdkError_Tags.InvalidServicePath: {+ ordinalConverter.write(8, into);+ const inner = value.inner;+ FfiConverterString.write(inner.path, into);+ return;+ }+ case SdkError_Tags.ClaimFailed: {+ ordinalConverter.write(9, into);+ const inner = value.inner;+ FfiConverterString.write(inner.phase, into);+ FfiConverterString.write(inner.status, into);+ return;+ }+ case SdkError_Tags.ClaimTimeout: {+ ordinalConverter.write(10, into);+ return;+ }+ default:+ // Throwing from here means that SdkError_Tags hasn't matched an ordinal.+ throw new UniffiInternalError.UnexpectedEnumCase();+ }}+ allocationSize(value: TypeName): number {+ switch (value.tag) {+ case SdkError_Tags.Configuration: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(1);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ case SdkError_Tags.InvalidResourceName: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(2);+ size += FfiConverterString.allocationSize(inner.field);+ size += FfiConverterString.allocationSize(inner.value);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ case SdkError_Tags.Transport: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(3);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ case SdkError_Tags.Token: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(4);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ case SdkError_Tags.Body: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(5);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ case SdkError_Tags.Status: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(6);+ size += FfiConverterString.allocationSize(inner.operation);+ size += FfiConverterUInt16.allocationSize(inner.status);+ size += FfiConverterString.allocationSize(inner.body);+ return size;+ }+ case SdkError_Tags.UnknownService: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(7);+ size += FfiConverterString.allocationSize(inner.requested);+ size += FfiConverterSequenceString.allocationSize(inner.available);+ return size;+ }+ case SdkError_Tags.InvalidServicePath: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(8);+ size += FfiConverterString.allocationSize(inner.path);+ return size;+ }+ case SdkError_Tags.ClaimFailed: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(9);+ size += FfiConverterString.allocationSize(inner.phase);+ size += FfiConverterString.allocationSize(inner.status);+ return size;+ }+ case SdkError_Tags.ClaimTimeout: {+ return ordinalConverter.allocationSize(10);+ }+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ }+ return new FFIConverter();+})();- type ClaimFailed__interface = {- tag: SdkError_Tags.ClaimFailed;- inner:-Readonly<{phase: string; status: string}>- };- class ClaimFailed_ extends UniffiError implements ClaimFailed__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.ClaimFailed;- readonly inner:-Readonly<{phase: string; status: string}>;- constructor(-inner: {phase: string; status: string }) {- super("SdkError", "ClaimFailed");-- this.inner = Object.freeze(inner);- }- static new(-inner: {phase: string; status: string }): ClaimFailed_ {- return new ClaimFailed_(inner);- }+export interface AccessTokenProvider {+ getAccessToken(+ forceRefresh: boolean,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<string>;+}- static instanceOf(obj: any): obj is ClaimFailed_ {- return obj.tag === SdkError_Tags.ClaimFailed;- }- static hasInner(obj: any): obj is ClaimFailed_ {- return ClaimFailed_.instanceOf(obj);- }+export class AccessTokenProviderImpl+ extends UniffiAbstractObject+ implements AccessTokenProvider+{+ readonly [uniffiTypeNameSymbol] = "AccessTokenProviderImpl";+ readonly [destructorGuardSymbol]: UniffiGcObject;+ readonly [pointerLiteralSymbol]: UniffiHandle;+ // No primary constructor declared for this class.+ private constructor(pointer: UniffiHandle) {+ super();+ this[pointerLiteralSymbol] = pointer;+ this[destructorGuardSymbol] =+ uniffiTypeAccessTokenProviderImplObjectFactory.bless(pointer);+ }- static getInner(obj: ClaimFailed_):-Readonly<{phase: string; status: string}> {- return obj.inner;- }+ async getAccessToken(+ forceRefresh: boolean,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<string> /*throws*/ {+ return await uniffiRustCallAsync(+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(+ uniffiTypeAccessTokenProviderImplObjectFactory.clonePointer(this),+ FfiConverterBool.lower(forceRefresh, nativeModule().rustbuffer_alloc),+ );+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeAccessTokenProviderError.lift.bind(+ FfiConverterTypeAccessTokenProviderError,+ ),+ );+ }+ uniffiDestroy(): void {+ const ptr = (this as any)[destructorGuardSymbol];+ if (ptr !== undefined) {+ const pointer =+ uniffiTypeAccessTokenProviderImplObjectFactory.pointer(this);+ uniffiTypeAccessTokenProviderImplObjectFactory.freePointer(pointer);+ uniffiTypeAccessTokenProviderImplObjectFactory.unbless(ptr);+ delete (this as any)[destructorGuardSymbol];}+ }- type ClaimTimeout__interface = {- tag: SdkError_Tags.ClaimTimeout- };- class ClaimTimeout_ extends UniffiError implements ClaimTimeout__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "SdkError";- readonly tag = SdkError_Tags.ClaimTimeout;- constructor() {- super("SdkError", "ClaimTimeout");- }+ static instanceOf(obj_: any): obj_ is AccessTokenProviderImpl {+ return uniffiTypeAccessTokenProviderImplObjectFactory.isConcreteType(obj_);+ }+}++const uniffiTypeAccessTokenProviderImplObjectFactory: UniffiObjectFactory<AccessTokenProvider> =+ (() => {+ /// <reference lib="es2021" />+ const registry =+ typeof FinalizationRegistry !== "undefined"+ ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {+ uniffiTypeAccessTokenProviderImplObjectFactory.freePointer(+ heldValue,+ );+ })+ : null;++ return {+ create(pointer: UniffiHandle): AccessTokenProvider {+ const instance = Object.create(AccessTokenProviderImpl.prototype);+ instance[pointerLiteralSymbol] = pointer;+ instance[destructorGuardSymbol] = this.bless(pointer);+ instance[uniffiTypeNameSymbol] = "AccessTokenProviderImpl";+ return instance;+ },- static new(): ClaimTimeout_ {- return new ClaimTimeout_();+ bless(p: UniffiHandle): UniffiGcObject {+ const ptr = {+ p, // make sure this object doesn't get optimized away.+ markDestroyed: () => undefined,+ };+ if (registry) {+ registry.register(ptr, p, ptr);}+ return ptr;+ },- static instanceOf(obj: any): obj is ClaimTimeout_ {- return obj.tag === SdkError_Tags.ClaimTimeout;+ unbless(ptr_: UniffiGcObject) {+ if (registry) {+ registry.unregister(ptr_);}- static hasInner(obj: any): obj is ClaimTimeout_ {- return false;+ },++ pointer(obj_: AccessTokenProvider): UniffiHandle {+ if ((obj_ as any)[destructorGuardSymbol] === undefined) {+ throw new UniffiInternalError.UnexpectedNullPointer();}+ return (obj_ as any)[pointerLiteralSymbol];+ },- }+ clonePointer(obj_: AccessTokenProvider): UniffiHandle {+ const pointer = this.pointer(obj_);+ return uniffiCaller.rustCall(+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_clone_accesstokenprovider(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,+ );+ },- function instanceOf(obj: any): obj is SdkError {- return obj[uniffiTypeNameSymbol] === "SdkError";- }+ freePointer(pointer: UniffiHandle): void {+ uniffiCaller.rustCall(+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_free_accesstokenprovider(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,+ );+ },- return Object.freeze({- instanceOf,- Configuration: Configuration_,- InvalidResourceName: InvalidResourceName_,- Transport: Transport_,- Token: Token_,- Body: Body_,- Status: Status_,- UnknownService: UnknownService_,- InvalidServicePath: InvalidServicePath_,- ClaimFailed: ClaimFailed_,- ClaimTimeout: ClaimTimeout_- });+ isConcreteType(obj_: any): obj_ is AccessTokenProvider {+ return (+ obj_[destructorGuardSymbol] &&+ obj_[uniffiTypeNameSymbol] === "AccessTokenProviderImpl"+ );+ },+ };+ })();+const FfiConverterTypeAccessTokenProvider = new FfiConverterObjectWithCallbacks(+ uniffiTypeAccessTokenProviderImplObjectFactory,+);-})();-export type SdkError = InstanceType<- typeof SdkError['Configuration' | 'InvalidResourceName' | 'Transport' | 'Token' | 'Body' | 'Status' | 'UnknownService' | 'InvalidServicePath' | 'ClaimFailed' | 'ClaimTimeout']->;+// Add a vtable for the callbacks that go in AccessTokenProvider.-// FfiConverter for enum SdkError-const FfiConverterTypeSdkError = (() => {- const ordinalConverter = FfiConverterInt32;- type TypeName = SdkError;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- switch (ordinalConverter.read(from)) {- case 1: return new SdkError.Configuration({reason: FfiConverterString.read(from) });- case 2: return new SdkError.InvalidResourceName({field: FfiConverterString.read(from), value: FfiConverterString.read(from), reason: FfiConverterString.read(from) });- case 3: return new SdkError.Transport({reason: FfiConverterString.read(from) });- case 4: return new SdkError.Token({reason: FfiConverterString.read(from) });- case 5: return new SdkError.Body({reason: FfiConverterString.read(from) });- case 6: return new SdkError.Status({operation: FfiConverterString.read(from), status: FfiConverterUInt16.read(from), body: FfiConverterString.read(from) });- case 7: return new SdkError.UnknownService({requested: FfiConverterString.read(from), available: FfiConverterSequenceString.read(from) });- case 8: return new SdkError.InvalidServicePath({path: FfiConverterString.read(from) });- case 9: return new SdkError.ClaimFailed({phase: FfiConverterString.read(from), status: FfiConverterString.read(from) });- case 10: return new SdkError.ClaimTimeout();- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- write(value: TypeName, into: RustBuffer): void {- switch (value.tag) {- case SdkError_Tags.Configuration: {- ordinalConverter.write(1, into);- const inner = value.inner;- FfiConverterString.write(inner.reason, into);- return;- }- case SdkError_Tags.InvalidResourceName: {- ordinalConverter.write(2, into);- const inner = value.inner;- FfiConverterString.write(inner.field, into);- FfiConverterString.write(inner.value, into);- FfiConverterString.write(inner.reason, into);- return;- }- case SdkError_Tags.Transport: {- ordinalConverter.write(3, into);- const inner = value.inner;- FfiConverterString.write(inner.reason, into);- return;- }- case SdkError_Tags.Token: {- ordinalConverter.write(4, into);- const inner = value.inner;- FfiConverterString.write(inner.reason, into);- return;- }- case SdkError_Tags.Body: {- ordinalConverter.write(5, into);- const inner = value.inner;- FfiConverterString.write(inner.reason, into);- return;- }- case SdkError_Tags.Status: {- ordinalConverter.write(6, into);- const inner = value.inner;- FfiConverterString.write(inner.operation, into);- FfiConverterUInt16.write(inner.status, into);- FfiConverterString.write(inner.body, into);- return;- }- case SdkError_Tags.UnknownService: {- ordinalConverter.write(7, into);- const inner = value.inner;- FfiConverterString.write(inner.requested, into);- FfiConverterSequenceString.write(inner.available, into);- return;- }- case SdkError_Tags.InvalidServicePath: {- ordinalConverter.write(8, into);- const inner = value.inner;- FfiConverterString.write(inner.path, into);- return;- }- case SdkError_Tags.ClaimFailed: {- ordinalConverter.write(9, into);- const inner = value.inner;- FfiConverterString.write(inner.phase, into);- FfiConverterString.write(inner.status, into);- return;- }- case SdkError_Tags.ClaimTimeout: {- ordinalConverter.write(10, into);- return;- }- default:- // Throwing from here means that SdkError_Tags hasn't matched an ordinal.- throw new UniffiInternalError.UnexpectedEnumCase();- }- }- allocationSize(value: TypeName): number {- switch (value.tag) {- case SdkError_Tags.Configuration: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(1);- size += FfiConverterString.allocationSize(inner.reason);- return size;- }- case SdkError_Tags.InvalidResourceName: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(2);- size += FfiConverterString.allocationSize(inner.field);- size += FfiConverterString.allocationSize(inner.value);- size += FfiConverterString.allocationSize(inner.reason);- return size;- }- case SdkError_Tags.Transport: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(3);- size += FfiConverterString.allocationSize(inner.reason);- return size;- }- case SdkError_Tags.Token: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(4);- size += FfiConverterString.allocationSize(inner.reason);- return size;- }- case SdkError_Tags.Body: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(5);- size += FfiConverterString.allocationSize(inner.reason);- return size;- }- case SdkError_Tags.Status: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(6);- size += FfiConverterString.allocationSize(inner.operation);- size += FfiConverterUInt16.allocationSize(inner.status);- size += FfiConverterString.allocationSize(inner.body);- return size;- }- case SdkError_Tags.UnknownService: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(7);- size += FfiConverterString.allocationSize(inner.requested);- size += FfiConverterSequenceString.allocationSize(inner.available);- return size;- }- case SdkError_Tags.InvalidServicePath: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(8);- size += FfiConverterString.allocationSize(inner.path);- return size;- }- case SdkError_Tags.ClaimFailed: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(9);- size += FfiConverterString.allocationSize(inner.phase);- size += FfiConverterString.allocationSize(inner.status);- return size;- }- case SdkError_Tags.ClaimTimeout: {- return ordinalConverter.allocationSize(10);- }- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- }- return new FFIConverter();-})();+// Put the implementation in a struct so we don't pollute the top-level namespace+const uniffiCallbackInterfaceAccessTokenProvider: {+ vtable: any;+ register: () => void;+} = {+ // Create the VTable using a series of closures.+ // ts automatically converts these into C callback functions.+ vtable: {+ get_access_token: (+ uniffiHandle: bigint,+ forceRefresh: number,+ uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer,+ uniffiCallbackData: bigint,+ ) => {+ const uniffiMakeCall = async (signal: AbortSignal): Promise<string> => {+ const jsCallback =+ FfiConverterTypeAccessTokenProvider.lift(uniffiHandle);+ return await jsCallback.getAccessToken(+ FfiConverterBool.lift(forceRefresh),+ { signal },+ );+ };+ const uniffiHandleSuccess = (returnValue: string) => {+ uniffiFutureCallback.call(+ uniffiFutureCallback,+ uniffiCallbackData,+ /* UniffiForeignFutureResultRustBuffer */ {+ return_value: FfiConverterString.lower(+ returnValue,+ nativeModule().rustbuffer_alloc,+ ),+ call_status: uniffiCaller.createCallStatus(),+ },+ );+ };+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {+ uniffiFutureCallback.call(+ uniffiFutureCallback,+ uniffiCallbackData,+ /* UniffiForeignFutureResultRustBuffer */ {+ return_value: /*empty*/ new Uint8Array(0),+ // TODO create callstatus with error.+ call_status: uniffiCaller.createErrorStatus(code, errorBuf),+ },+ );+ };+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(+ /*makeCall:*/ uniffiMakeCall,+ /*handleSuccess:*/ uniffiHandleSuccess,+ /*handleError:*/ uniffiHandleError,+ /*isErrorType:*/ AccessTokenProviderError.instanceOf,+ /*lowerError:*/ FfiConverterTypeAccessTokenProviderError.lower.bind(+ FfiConverterTypeAccessTokenProviderError,+ ),+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),+ /*alloc:*/ nativeModule().rustbuffer_alloc,+ );+ return uniffiForeignFuture;+ },+ uniffi_free: (uniffiHandle: UniffiHandle): void => {+ // this will throw a stale handle error if the handle isn't found.+ FfiConverterTypeAccessTokenProvider.drop(uniffiHandle);+ },+ uniffi_clone: (uniffiHandle: UniffiHandle): UniffiHandle => {+ return FfiConverterTypeAccessTokenProvider.clone(uniffiHandle);+ },+ },+ register: () => {+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(+ uniffiCallbackInterfaceAccessTokenProvider.vtable,+ );+ },+};export interface CyclopsClientLike {-- createClaim(request: CreateClaimRequest, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Claim>;- createPool(request: CreatePoolRequest, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Pool>;- deleteClaim(claim: Claim, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;- deletePool(pool: Pool, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<void>;- getClaim(claim: Claim, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Claim>;- getPool(pool: Pool, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Pool>;- listClaims(namespace: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<Claim>>;- listPools(namespace: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Array<Pool>>;- serviceRequest(sandbox: Sandbox, service: string, path: string, request: HttpRequest, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<HttpResponse>;- updatePool(pool: Pool, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Pool>;- waitClaim(claim: Claim, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<Sandbox>;+ createClaim(+ request: CreateClaimRequest,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Claim>;+ createPool(+ request: CreatePoolRequest,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Pool>;+ deleteClaim(+ claim: Claim,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<void>;+ deletePool(+ pool: Pool,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<void>;+ getClaim(+ claim: Claim,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Claim>;+ getPool(+ pool: Pool,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Pool>;+ listClaims(+ namespace: string,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Array<Claim>>;+ listPools(+ namespace: string,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Array<Pool>>;+ serviceRequest(+ sandbox: Sandbox,+ service: string,+ path: string,+ request: HttpRequest,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<HttpResponse>;+ updatePool(+ pool: Pool,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Pool>;+ waitClaim(+ claim: Claim,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<Sandbox>;}/*** @deprecated Use `CyclopsClientLike` instead.*/export type CyclopsClientInterface = CyclopsClientLike;--export class CyclopsClient extends UniffiAbstractObject implements CyclopsClientLike {-- readonly [uniffiTypeNameSymbol] = "CyclopsClient";- readonly [destructorGuardSymbol]: UniffiGcObject;- readonly [pointerLiteralSymbol]: UniffiHandle;- // No primary constructor declared for this class.-private constructor(pointer: UniffiHandle) {+export class CyclopsClient+ extends UniffiAbstractObject+ implements CyclopsClientLike+{+ readonly [uniffiTypeNameSymbol] = "CyclopsClient";+ readonly [destructorGuardSymbol]: UniffiGcObject;+ readonly [pointerLiteralSymbol]: UniffiHandle;+ // No primary constructor declared for this class.+ private constructor(pointer: UniffiHandle) {super();this[pointerLiteralSymbol] = pointer;- this[destructorGuardSymbol] = uniffiTypeCyclopsClientObjectFactory.bless(pointer);-}+ this[destructorGuardSymbol] =+ uniffiTypeCyclopsClientObjectFactory.bless(pointer);+ }-- static connect(configuration: CyclopsConfiguration, httpClient: HttpClient): CyclopsClientLike /*throws*/ {- return FfiConverterTypeCyclopsClient.lift(uniffiCaller.rustCallWithError(- /*liftError:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError),- /*caller:*/ (callStatus) => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect(- FfiConverterTypeCyclopsConfiguration.lower(configuration, nativeModule().rustbuffer_alloc),- FfiConverterTypeHttpClient.lower(httpClient, nativeModule().rustbuffer_alloc),- callStatus);- },- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- ));- }-+ static connect(+ configuration: CyclopsConfiguration,+ httpClient: HttpClient,+ ): CyclopsClientLike /*throws*/ {+ return FfiConverterTypeCyclopsClient.lift(+ uniffiCaller.rustCallWithError(+ /*liftError:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect(+ FfiConverterTypeCyclopsConfiguration.lower(+ configuration,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterTypeHttpClient.lower(+ httpClient,+ nativeModule().rustbuffer_alloc,+ ),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ }++ static connectBrowserWithAccessToken(+ configuration: CyclopsTokenProviderConfiguration,+ accessToken: string,+ ): CyclopsClientLike /*throws*/ {+ return FfiConverterTypeCyclopsClient.lift(+ uniffiCaller.rustCallWithError(+ /*liftError:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_browser_with_access_token(+ FfiConverterTypeCyclopsTokenProviderConfiguration.lower(+ configuration,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterString.lower(+ accessToken,+ nativeModule().rustbuffer_alloc,+ ),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ }++ static connectWithAccessToken(+ configuration: CyclopsTokenProviderConfiguration,+ accessToken: string,+ httpClient: HttpClient,+ ): CyclopsClientLike /*throws*/ {+ return FfiConverterTypeCyclopsClient.lift(+ uniffiCaller.rustCallWithError(+ /*liftError:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token(+ FfiConverterTypeCyclopsTokenProviderConfiguration.lower(+ configuration,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterString.lower(+ accessToken,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterTypeHttpClient.lower(+ httpClient,+ nativeModule().rustbuffer_alloc,+ ),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ }-- async createClaim(request: CreateClaimRequest, asyncOpts_?: { signal: AbortSignal }): Promise<Claim> /*throws*/ {+ static connectWithAccessTokenProvider(+ configuration: CyclopsTokenProviderConfiguration,+ tokenProvider: AccessTokenProvider,+ httpClient: HttpClient,+ ): CyclopsClientLike /*throws*/ {+ return FfiConverterTypeCyclopsClient.lift(+ uniffiCaller.rustCallWithError(+ /*liftError:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect_with_access_token_provider(+ FfiConverterTypeCyclopsTokenProviderConfiguration.lower(+ configuration,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterTypeAccessTokenProvider.lower(+ tokenProvider,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterTypeHttpClient.lower(+ httpClient,+ nativeModule().rustbuffer_alloc,+ ),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ }++ async createClaim(+ request: CreateClaimRequest,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Claim> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypeCreateClaimRequest.lower(request, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypeClaim.lift.bind(FfiConverterTypeClaim),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_create_claim(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypeCreateClaimRequest.lower(+ request,+ nativeModule().rustbuffer_alloc,+ ),);- }-- async createPool(request: CreatePoolRequest, asyncOpts_?: { signal: AbortSignal }): Promise<Pool> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeClaim.lift.bind(FfiConverterTypeClaim),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async createPool(+ request: CreatePoolRequest,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Pool> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_create_pool(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypeCreatePoolRequest.lower(request, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypePool.lift.bind(FfiConverterTypePool),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_create_pool(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypeCreatePoolRequest.lower(+ request,+ nativeModule().rustbuffer_alloc,+ ),);- }-- async deleteClaim(claim: Claim, asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypePool.lift.bind(FfiConverterTypePool),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async deleteClaim(+ claim: Claim,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<void> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_claim(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypeClaim.lower(claim, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_void,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_void,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_void,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_void,- /*liftFunc:*/ (_v) => {},- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_claim(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypeClaim.lower(claim, nativeModule().rustbuffer_alloc),);- }-- async deletePool(pool: Pool, asyncOpts_?: { signal: AbortSignal }): Promise<void> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_void,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_void,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_void,+ /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_void,+ /*liftFunc:*/ (_v) => {},+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async deletePool(+ pool: Pool,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<void> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_pool(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypePool.lower(pool, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_void,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_void,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_void,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_void,- /*liftFunc:*/ (_v) => {},- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_delete_pool(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypePool.lower(pool, nativeModule().rustbuffer_alloc),);- }-- async getClaim(claim: Claim, asyncOpts_?: { signal: AbortSignal }): Promise<Claim> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_void,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_void,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_void,+ /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_void,+ /*liftFunc:*/ (_v) => {},+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async getClaim(+ claim: Claim,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Claim> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_get_claim(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypeClaim.lower(claim, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypeClaim.lift.bind(FfiConverterTypeClaim),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_get_claim(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypeClaim.lower(claim, nativeModule().rustbuffer_alloc),);- }-- async getPool(pool: Pool, asyncOpts_?: { signal: AbortSignal }): Promise<Pool> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeClaim.lift.bind(FfiConverterTypeClaim),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async getPool(+ pool: Pool,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Pool> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_get_pool(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypePool.lower(pool, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypePool.lift.bind(FfiConverterTypePool),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_get_pool(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypePool.lower(pool, nativeModule().rustbuffer_alloc),);- }-- async listClaims(namespace: string, asyncOpts_?: { signal: AbortSignal }): Promise<Array<Claim>> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypePool.lift.bind(FfiConverterTypePool),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async listClaims(+ namespace: string,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Array<Claim>> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_list_claims(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterString.lower(namespace, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterSequenceTypeClaim.lift.bind(FfiConverterSequenceTypeClaim),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_list_claims(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterString.lower(namespace, nativeModule().rustbuffer_alloc),);- }-- async listPools(namespace: string, asyncOpts_?: { signal: AbortSignal }): Promise<Array<Pool>> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterSequenceTypeClaim.lift.bind(+ FfiConverterSequenceTypeClaim,+ ),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async listPools(+ namespace: string,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Array<Pool>> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterString.lower(namespace, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterSequenceTypePool.lift.bind(FfiConverterSequenceTypePool),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_list_pools(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterString.lower(namespace, nativeModule().rustbuffer_alloc),);- }-- async serviceRequest(sandbox: Sandbox, service: string, path: string, request: HttpRequest, asyncOpts_?: { signal: AbortSignal }): Promise<HttpResponse> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterSequenceTypePool.lift.bind(+ FfiConverterSequenceTypePool,+ ),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async serviceRequest(+ sandbox: Sandbox,+ service: string,+ path: string,+ request: HttpRequest,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<HttpResponse> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypeSandbox.lower(sandbox, nativeModule().rustbuffer_alloc),FfiConverterString.lower(service, nativeModule().rustbuffer_alloc),FfiConverterString.lower(path, nativeModule().rustbuffer_alloc),FfiConverterTypeHttpRequest.lower(request, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypeHttpResponse.lift.bind(FfiConverterTypeHttpResponse),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_service_request(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypeSandbox.lower(+ sandbox,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterString.lower(service, nativeModule().rustbuffer_alloc),+ FfiConverterString.lower(path, nativeModule().rustbuffer_alloc),+ FfiConverterTypeHttpRequest.lower(+ request,+ nativeModule().rustbuffer_alloc,+ ),);- }-- async updatePool(pool: Pool, asyncOpts_?: { signal: AbortSignal }): Promise<Pool> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeHttpResponse.lift.bind(+ FfiConverterTypeHttpResponse,+ ),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async updatePool(+ pool: Pool,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Pool> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypePool.lower(pool, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypePool.lift.bind(FfiConverterTypePool),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_update_pool(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypePool.lower(pool, nativeModule().rustbuffer_alloc),);- }-- async waitClaim(claim: Claim, asyncOpts_?: { signal: AbortSignal }): Promise<Sandbox> /*throws*/ {+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypePool.lift.bind(FfiConverterTypePool),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }++ async waitClaim(+ claim: Claim,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<Sandbox> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_wait_claim(- uniffiTypeCyclopsClientObjectFactory.clonePointer(this),FfiConverterTypeClaim.lower(claim, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypeSandbox.lift.bind(FfiConverterTypeSandbox),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_cyclopsclient_wait_claim(+ uniffiTypeCyclopsClientObjectFactory.clonePointer(this),+ FfiConverterTypeClaim.lower(claim, nativeModule().rustbuffer_alloc),);- }--- uniffiDestroy(): void {- const ptr = (this as any)[destructorGuardSymbol];- if (ptr !== undefined) {- const pointer = uniffiTypeCyclopsClientObjectFactory.pointer(this);- uniffiTypeCyclopsClientObjectFactory.freePointer(pointer);- uniffiTypeCyclopsClientObjectFactory.unbless(ptr);- delete (this as any)[destructorGuardSymbol];- }- }+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeSandbox.lift.bind(FfiConverterTypeSandbox),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(+ FfiConverterTypeSdkError,+ ),+ );+ }- static instanceOf(obj_: any): obj_ is CyclopsClient {- return uniffiTypeCyclopsClientObjectFactory.isConcreteType(obj_);+ uniffiDestroy(): void {+ const ptr = (this as any)[destructorGuardSymbol];+ if (ptr !== undefined) {+ const pointer = uniffiTypeCyclopsClientObjectFactory.pointer(this);+ uniffiTypeCyclopsClientObjectFactory.freePointer(pointer);+ uniffiTypeCyclopsClientObjectFactory.unbless(ptr);+ delete (this as any)[destructorGuardSymbol];}+ }-+ static instanceOf(obj_: any): obj_ is CyclopsClient {+ return uniffiTypeCyclopsClientObjectFactory.isConcreteType(obj_);+ }}-const uniffiTypeCyclopsClientObjectFactory: UniffiObjectFactory<CyclopsClientLike> = (() => {-+const uniffiTypeCyclopsClientObjectFactory: UniffiObjectFactory<CyclopsClientLike> =+ (() => {/// <reference lib="es2021" />- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {- uniffiTypeCyclopsClientObjectFactory.freePointer(heldValue);- }) : null;-+ const registry =+ typeof FinalizationRegistry !== "undefined"+ ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {+ uniffiTypeCyclopsClientObjectFactory.freePointer(heldValue);+ })+ : null;+return {- create(pointer: UniffiHandle): CyclopsClientLike {+ create(pointer: UniffiHandle): CyclopsClientLike {const instance = Object.create(CyclopsClient.prototype);instance[pointerLiteralSymbol] = pointer;instance[destructorGuardSymbol] = this.bless(pointer);instance[uniffiTypeNameSymbol] = "CyclopsClient";return instance;- },+ },-- bless(p: UniffiHandle): UniffiGcObject {+ bless(p: UniffiHandle): UniffiGcObject {const ptr = {- p, // make sure this object doesn't get optimized away.- markDestroyed: () => undefined,+ p, // make sure this object doesn't get optimized away.+ markDestroyed: () => undefined,};if (registry) {- registry.register(ptr, p, ptr);+ registry.register(ptr, p, ptr);}return ptr;- },+ },- unbless(ptr_: UniffiGcObject) {+ unbless(ptr_: UniffiGcObject) {if (registry) {- registry.unregister(ptr_);+ registry.unregister(ptr_);}- },+ },- pointer(obj_: CyclopsClientLike): UniffiHandle {+ pointer(obj_: CyclopsClientLike): UniffiHandle {if ((obj_ as any)[destructorGuardSymbol] === undefined) {- throw new UniffiInternalError.UnexpectedNullPointer();+ throw new UniffiInternalError.UnexpectedNullPointer();}return (obj_ as any)[pointerLiteralSymbol];- },+ },- clonePointer(obj_: CyclopsClientLike): UniffiHandle {+ clonePointer(obj_: CyclopsClientLike): UniffiHandle {const pointer = this.pointer(obj_);return uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_fn_clone_cyclopsclient(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_clone_cyclopsclient(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- freePointer(pointer: UniffiHandle): void {+ freePointer(pointer: UniffiHandle): void {uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_fn_free_cyclopsclient(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_free_cyclopsclient(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- isConcreteType(obj_: any): obj_ is CyclopsClientLike {- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "CyclopsClient";- },-}})();-const FfiConverterTypeCyclopsClient = new FfiConverterObject(uniffiTypeCyclopsClientObjectFactory);+ isConcreteType(obj_: any): obj_ is CyclopsClientLike {+ return (+ obj_[destructorGuardSymbol] &&+ obj_[uniffiTypeNameSymbol] === "CyclopsClient"+ );+ },+ };+ })();+const FfiConverterTypeCyclopsClient = new FfiConverterObject(+ uniffiTypeCyclopsClientObjectFactory,+);export interface HttpClient {-- execute(request: HttpRequest, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<HttpResponse>;+ execute(+ request: HttpRequest,+ asyncOpts_?: { signal: AbortSignal },+ ) /*throws*/ : Promise<HttpResponse>;}-export class HttpClientImpl extends UniffiAbstractObject implements HttpClient {-- readonly [uniffiTypeNameSymbol] = "HttpClientImpl";- readonly [destructorGuardSymbol]: UniffiGcObject;- readonly [pointerLiteralSymbol]: UniffiHandle;- // No primary constructor declared for this class.-private constructor(pointer: UniffiHandle) {+ readonly [uniffiTypeNameSymbol] = "HttpClientImpl";+ readonly [destructorGuardSymbol]: UniffiGcObject;+ readonly [pointerLiteralSymbol]: UniffiHandle;+ // No primary constructor declared for this class.+ private constructor(pointer: UniffiHandle) {super();this[pointerLiteralSymbol] = pointer;- this[destructorGuardSymbol] = uniffiTypeHttpClientImplObjectFactory.bless(pointer);-}--+ this[destructorGuardSymbol] =+ uniffiTypeHttpClientImplObjectFactory.bless(pointer);+ }-- async execute(request: HttpRequest, asyncOpts_?: { signal: AbortSignal }): Promise<HttpResponse> /*throws*/ {+ async execute(+ request: HttpRequest,+ asyncOpts_?: { signal: AbortSignal },+ ): Promise<HttpResponse> /*throws*/ {return await uniffiRustCallAsync(- /*rustCaller:*/ uniffiCaller,- /*rustFutureFunc:*/ () => {- return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_httpclient_execute(- uniffiTypeHttpClientImplObjectFactory.clonePointer(this),FfiConverterTypeHttpRequest.lower(request, nativeModule().rustbuffer_alloc)- );- },- /*pollFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,- /*cancelFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,- /*completeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,- /*freeFunc:*/ nativeModule().ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,- // Async returns always go through the JS-side converter: the- // FFI symbol returns the future handle (u64), and the user-level- // RustBuffer comes back via the shared `rust_future_complete_*`- // export. The bytes the runtime hands back must be deserialized- // here using the per-callable return-type converter.- /*liftFunc:*/ FfiConverterTypeHttpResponse.lift.bind(FfiConverterTypeHttpResponse),- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- /*asyncOpts:*/ asyncOpts_,- /*errorHandler:*/ FfiConverterTypeHttpError.lift.bind(FfiConverterTypeHttpError)+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_fn_method_httpclient_execute(+ uniffiTypeHttpClientImplObjectFactory.clonePointer(this),+ FfiConverterTypeHttpRequest.lower(+ request,+ nativeModule().rustbuffer_alloc,+ ),);- }--- uniffiDestroy(): void {- const ptr = (this as any)[destructorGuardSymbol];- if (ptr !== undefined) {- const pointer = uniffiTypeHttpClientImplObjectFactory.pointer(this);- uniffiTypeHttpClientImplObjectFactory.freePointer(pointer);- uniffiTypeHttpClientImplObjectFactory.unbless(ptr);- delete (this as any)[destructorGuardSymbol];- }- }+ },+ /*pollFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule()+ .ubrn_ffi_cyclops_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeHttpResponse.lift.bind(+ FfiConverterTypeHttpResponse,+ ),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeHttpError.lift.bind(+ FfiConverterTypeHttpError,+ ),+ );+ }- static instanceOf(obj_: any): obj_ is HttpClientImpl {- return uniffiTypeHttpClientImplObjectFactory.isConcreteType(obj_);+ uniffiDestroy(): void {+ const ptr = (this as any)[destructorGuardSymbol];+ if (ptr !== undefined) {+ const pointer = uniffiTypeHttpClientImplObjectFactory.pointer(this);+ uniffiTypeHttpClientImplObjectFactory.freePointer(pointer);+ uniffiTypeHttpClientImplObjectFactory.unbless(ptr);+ delete (this as any)[destructorGuardSymbol];}+ }-+ static instanceOf(obj_: any): obj_ is HttpClientImpl {+ return uniffiTypeHttpClientImplObjectFactory.isConcreteType(obj_);+ }}-const uniffiTypeHttpClientImplObjectFactory: UniffiObjectFactory<HttpClient> = (() => {-+const uniffiTypeHttpClientImplObjectFactory: UniffiObjectFactory<HttpClient> =+ (() => {/// <reference lib="es2021" />- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {- uniffiTypeHttpClientImplObjectFactory.freePointer(heldValue);- }) : null;-+ const registry =+ typeof FinalizationRegistry !== "undefined"+ ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {+ uniffiTypeHttpClientImplObjectFactory.freePointer(heldValue);+ })+ : null;+return {- create(pointer: UniffiHandle): HttpClient {+ create(pointer: UniffiHandle): HttpClient {const instance = Object.create(HttpClientImpl.prototype);instance[pointerLiteralSymbol] = pointer;instance[destructorGuardSymbol] = this.bless(pointer);instance[uniffiTypeNameSymbol] = "HttpClientImpl";return instance;- },+ },-- bless(p: UniffiHandle): UniffiGcObject {+ bless(p: UniffiHandle): UniffiGcObject {const ptr = {- p, // make sure this object doesn't get optimized away.- markDestroyed: () => undefined,+ p, // make sure this object doesn't get optimized away.+ markDestroyed: () => undefined,};if (registry) {- registry.register(ptr, p, ptr);+ registry.register(ptr, p, ptr);}return ptr;- },+ },- unbless(ptr_: UniffiGcObject) {+ unbless(ptr_: UniffiGcObject) {if (registry) {- registry.unregister(ptr_);+ registry.unregister(ptr_);}- },+ },- pointer(obj_: HttpClient): UniffiHandle {+ pointer(obj_: HttpClient): UniffiHandle {if ((obj_ as any)[destructorGuardSymbol] === undefined) {- throw new UniffiInternalError.UnexpectedNullPointer();+ throw new UniffiInternalError.UnexpectedNullPointer();}return (obj_ as any)[pointerLiteralSymbol];- },+ },- clonePointer(obj_: HttpClient): UniffiHandle {+ clonePointer(obj_: HttpClient): UniffiHandle {const pointer = this.pointer(obj_);return uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_fn_clone_httpclient(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_clone_httpclient(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- freePointer(pointer: UniffiHandle): void {+ freePointer(pointer: UniffiHandle): void {uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_fn_free_httpclient(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_free_httpclient(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- isConcreteType(obj_: any): obj_ is HttpClient {- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "HttpClientImpl";- },-}})();-const FfiConverterTypeHttpClient = new FfiConverterObjectWithCallbacks(uniffiTypeHttpClientImplObjectFactory);+ isConcreteType(obj_: any): obj_ is HttpClient {+ return (+ obj_[destructorGuardSymbol] &&+ obj_[uniffiTypeNameSymbol] === "HttpClientImpl"+ );+ },+ };+ })();+const FfiConverterTypeHttpClient = new FfiConverterObjectWithCallbacks(+ uniffiTypeHttpClientImplObjectFactory,+);// Add a vtable for the callbacks that go in HttpClient.// Put the implementation in a struct so we don't pollute the top-level namespace-const uniffiCallbackInterfaceHttpClient: { vtable: any; register: () => void; } = {+const uniffiCallbackInterfaceHttpClient: { vtable: any; register: () => void } =+ {// Create the VTable using a series of closures.// ts automatically converts these into C callback functions.vtable: {- execute: (- uniffiHandle: bigint,- request: Uint8Array,- uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer,- uniffiCallbackData: bigint) => {- const uniffiMakeCall =- async (signal: AbortSignal)- : Promise<HttpResponse> => {- const jsCallback = FfiConverterTypeHttpClient.lift(uniffiHandle);- return await jsCallback.execute(- FfiConverterTypeHttpRequest.lift(request), { signal }- )- };- const uniffiHandleSuccess = (returnValue: HttpResponse) => {- uniffiFutureCallback.call(- uniffiFutureCallback,- uniffiCallbackData,- /* UniffiForeignFutureResultRustBuffer */{- return_value: FfiConverterTypeHttpResponse.lower(returnValue, nativeModule().rustbuffer_alloc),- call_status: uniffiCaller.createCallStatus()- }- );- };- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {- uniffiFutureCallback.call(- uniffiFutureCallback,- uniffiCallbackData,- /* UniffiForeignFutureResultRustBuffer */{- return_value: /*empty*/ new Uint8Array(0),- // TODO create callstatus with error.- call_status: uniffiCaller.createErrorStatus(code, errorBuf),- }- );- };- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(- /*makeCall:*/ uniffiMakeCall,- /*handleSuccess:*/ uniffiHandleSuccess,- /*handleError:*/ uniffiHandleError,- /*isErrorType:*/ HttpError.instanceOf,- /*lowerError:*/ FfiConverterTypeHttpError.lower.bind(FfiConverterTypeHttpError),- /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),- /*alloc:*/ nativeModule().rustbuffer_alloc,- );- return uniffiForeignFuture;- },- uniffi_free: (uniffiHandle: UniffiHandle): void => {- // this will throw a stale handle error if the handle isn't found.- FfiConverterTypeHttpClient.drop(uniffiHandle);- },- uniffi_clone: (uniffiHandle: UniffiHandle): UniffiHandle => {- return FfiConverterTypeHttpClient.clone(uniffiHandle);- }- },- register: () => {nativeModule().ubrn_uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(- uniffiCallbackInterfaceHttpClient.vtable+ execute: (+ uniffiHandle: bigint,+ request: Uint8Array,+ uniffiFutureCallback: UniffiForeignFutureCompleterustBuffer,+ uniffiCallbackData: bigint,+ ) => {+ const uniffiMakeCall = async (+ signal: AbortSignal,+ ): Promise<HttpResponse> => {+ const jsCallback = FfiConverterTypeHttpClient.lift(uniffiHandle);+ return await jsCallback.execute(+ FfiConverterTypeHttpRequest.lift(request),+ { signal },+ );+ };+ const uniffiHandleSuccess = (returnValue: HttpResponse) => {+ uniffiFutureCallback.call(+ uniffiFutureCallback,+ uniffiCallbackData,+ /* UniffiForeignFutureResultRustBuffer */ {+ return_value: FfiConverterTypeHttpResponse.lower(+ returnValue,+ nativeModule().rustbuffer_alloc,+ ),+ call_status: uniffiCaller.createCallStatus(),+ },+ );+ };+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {+ uniffiFutureCallback.call(+ uniffiFutureCallback,+ uniffiCallbackData,+ /* UniffiForeignFutureResultRustBuffer */ {+ return_value: /*empty*/ new Uint8Array(0),+ // TODO create callstatus with error.+ call_status: uniffiCaller.createErrorStatus(code, errorBuf),+ },+ );+ };+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(+ /*makeCall:*/ uniffiMakeCall,+ /*handleSuccess:*/ uniffiHandleSuccess,+ /*handleError:*/ uniffiHandleError,+ /*isErrorType:*/ HttpError.instanceOf,+ /*lowerError:*/ FfiConverterTypeHttpError.lower.bind(+ FfiConverterTypeHttpError,+ ),+ /*lowerString:*/ FfiConverterString.lower.bind(FfiConverterString),+ /*alloc:*/ nativeModule().rustbuffer_alloc,);+ return uniffiForeignFuture;+ },+ uniffi_free: (uniffiHandle: UniffiHandle): void => {+ // this will throw a stale handle error if the handle isn't found.+ FfiConverterTypeHttpClient.drop(uniffiHandle);+ },+ uniffi_clone: (uniffiHandle: UniffiHandle): UniffiHandle => {+ return FfiConverterTypeHttpClient.clone(uniffiHandle);+ },},-};+ register: () => {+ nativeModule().ubrn_uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(+ uniffiCallbackInterfaceHttpClient.vtable,+ );+ },+ };// FfiConverter for Map<string, string>-const FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);+const FfiConverterMapStringString = new FfiConverterMap(+ FfiConverterString,+ FfiConverterString,+);// FfiConverter for Map<string, string> | undefined-const FfiConverterOptionalMapStringString = new FfiConverterOptional(FfiConverterMapStringString);+const FfiConverterOptionalMapStringString = new FfiConverterOptional(+ FfiConverterMapStringString,+);// FfiConverter for OsGymSandboxClaimStatus | undefined-const FfiConverterOptionalTypeOSGymSandboxClaimStatus = new FfiConverterOptional(FfiConverterTypeOSGymSandboxClaimStatus);+const FfiConverterOptionalTypeOSGymSandboxClaimStatus =+ new FfiConverterOptional(FfiConverterTypeOSGymSandboxClaimStatus);// FfiConverter for OsGymWorkspacePoolStatus | undefined-const FfiConverterOptionalTypeOSGymWorkspacePoolStatus = new FfiConverterOptional(FfiConverterTypeOSGymWorkspacePoolStatus);+const FfiConverterOptionalTypeOSGymWorkspacePoolStatus =+ new FfiConverterOptional(FfiConverterTypeOSGymWorkspacePoolStatus);// FfiConverter for ClaimSpec | undefined-const FfiConverterOptionalTypeClaimSpec = new FfiConverterOptional(FfiConverterTypeClaimSpec);+const FfiConverterOptionalTypeClaimSpec = new FfiConverterOptional(+ FfiConverterTypeClaimSpec,+);// FfiConverter for Array<HttpHeader>-const FfiConverterSequenceTypeHttpHeader = new FfiConverterArray(FfiConverterTypeHttpHeader);+const FfiConverterSequenceTypeHttpHeader = new FfiConverterArray(+ FfiConverterTypeHttpHeader,+);// FfiConverter for ArrayBuffer | undefined-const FfiConverterOptionalBytes = new FfiConverterOptional(FfiConverterArrayBuffer);+const FfiConverterOptionalBytes = new FfiConverterOptional(+ FfiConverterArrayBuffer,+);// FfiConverter for Array<string>const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);// FfiConverter for Array<Claim>-const FfiConverterSequenceTypeClaim = new FfiConverterArray(FfiConverterTypeClaim);+const FfiConverterSequenceTypeClaim = new FfiConverterArray(+ FfiConverterTypeClaim,+);// FfiConverter for Array<Pool>-const FfiConverterSequenceTypePool = new FfiConverterArray(FfiConverterTypePool);-+const FfiConverterSequenceTypePool = new FfiConverterArray(+ FfiConverterTypePool,+);/*** This should be called before anything else.@@ -1962,68 +2774,178 @@ const FfiConverterSequenceTypePool = new FfiConverterArray(FfiConverterTypePool)* It also initializes the machinery to enable Rust to talk back to Javascript.*/function uniffiEnsureInitialized() {- // Get the bindings contract version from our ComponentInterface- const bindingsContractVersion = 30;- // Get the scaffolding contract version by calling the into the dylib- const scaffoldingContractVersion = nativeModule().ubrn_ffi_cyclops_sdk_uniffi_contract_version();- if (bindingsContractVersion !== scaffoldingContractVersion) {- throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() !== 54404) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_claim() !== 23330) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_claim");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_pool() !== 48557) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_pool");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_claim() !== 20460) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_claim");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_pool() !== 31235) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_pool");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_claim() !== 17760) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_claim");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_pool() !== 43327) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_pool");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_claims() !== 7802) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_claims");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools() !== 27984) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request() !== 46699) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool() !== 17695) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_wait_claim() !== 18984) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_cyclopsclient_wait_claim");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() !== 25746) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_httpclient_execute() !== 38803) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_checksum_method_httpclient_execute");- }+ // Get the bindings contract version from our ComponentInterface+ const bindingsContractVersion = 30;+ // Get the scaffolding contract version by calling the into the dylib+ const scaffoldingContractVersion =+ nativeModule().ubrn_ffi_cyclops_sdk_uniffi_contract_version();+ if (bindingsContractVersion !== scaffoldingContractVersion) {+ throw new UniffiInternalError.ContractVersionMismatch(+ scaffoldingContractVersion,+ bindingsContractVersion,+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token() !==+ 1180+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() !==+ 54404+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token() !==+ 55589+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token() !==+ 10148+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider() !==+ 58487+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_access_token_provider",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_claim() !==+ 23330+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_claim",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_pool() !==+ 48557+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_create_pool",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_claim() !==+ 20460+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_claim",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_pool() !==+ 31235+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_delete_pool",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_claim() !==+ 17760+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_claim",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_pool() !==+ 43327+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_get_pool",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_claims() !==+ 7802+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_claims",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools() !==+ 27984+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_list_pools",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request() !==+ 46699+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_service_request",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool() !==+ 17695+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_update_pool",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_cyclopsclient_wait_claim() !==+ 18984+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_cyclopsclient_wait_claim",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() !==+ 25746+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_checksum_method_httpclient_execute() !==+ 38803+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_checksum_method_httpclient_execute",+ );+ }- uniffiCallbackInterfaceHttpClient.register();- }+ uniffiCallbackInterfaceAccessTokenProvider.register();+ uniffiCallbackInterfaceHttpClient.register();+}export default Object.freeze({initialize: uniffiEnsureInitialized,converters: {+ FfiConverterTypeAccessTokenProvider,+ FfiConverterTypeAccessTokenProviderError,FfiConverterTypeClaim,FfiConverterTypeCreateClaimRequest,FfiConverterTypeCreatePoolRequest,FfiConverterTypeCyclopsClient,FfiConverterTypeCyclopsConfiguration,FfiConverterTypeCyclopsCredentials,+ FfiConverterTypeCyclopsTokenProviderConfiguration,FfiConverterTypeHttpClient,FfiConverterTypeHttpError,FfiConverterTypeHttpHeader,@@ -2033,5 +2955,5 @@ export default Object.freeze({FfiConverterTypeResourceMetadata,FfiConverterTypeSandbox,FfiConverterTypeSdkError,- }-});\ No newline at end of file+ },+});diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema-ffi.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema-ffi.tsindex 9641a3965d..1bad3d9373 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema-ffi.ts+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema-ffi.ts@@ -6,9 +6,12 @@// @ts-nocheck// Structs and function types for calling back into Typescript from Rust.-export type UniffiRustFutureContinuationCallback = (data: bigint, pollResult: number) => void;+export type UniffiRustFutureContinuationCallback = (+ data: bigint,+ pollResult: number,+) => void;export type UniffiForeignFutureDroppedCallback = (handle: bigint) => void;export type UniffiForeignFutureDroppedCallbackStruct = {handle: bigint;free: UniffiForeignFutureDroppedCallback;-};\ No newline at end of file+};diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.tsindex 416fa1fefc..4936b7ec57 100644--- a/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.ts+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/ts/cyclops_sdk_schema.ts@@ -4,9 +4,40 @@/* eslint-disable */// @ts-nocheckimport * as wasmBundle from "./wasm-bindgen/index.js";-import { type UniffiRustFutureContinuationCallback, type UniffiForeignFutureDroppedCallback, type UniffiForeignFutureDroppedCallbackStruct,+import {+ type UniffiRustFutureContinuationCallback,+ type UniffiForeignFutureDroppedCallback,+ type UniffiForeignFutureDroppedCallbackStruct,} from "./cyclops_sdk_schema-ffi";-import { type FfiConverter, type UniffiByteArray, type UniffiGcObject, type UniffiHandle, type UniffiObjectFactory, AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterInt32, FfiConverterMap, FfiConverterObject, FfiConverterOptional, FfiConverterUInt16, FfiConverterUInt32, FfiConverterUInt64, FfiConverterUInt8, RustBuffer, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiTypeNameSymbol, variantOrdinalSymbol,+import {+ type FfiConverter,+ type UniffiByteArray,+ type UniffiGcObject,+ type UniffiHandle,+ type UniffiObjectFactory,+ AbstractFfiConverterByteArray,+ FfiConverterArray,+ FfiConverterBool,+ FfiConverterInt32,+ FfiConverterMap,+ FfiConverterObject,+ FfiConverterOptional,+ FfiConverterUInt16,+ FfiConverterUInt32,+ FfiConverterUInt64,+ FfiConverterUInt8,+ RustBuffer,+ UniffiAbstractObject,+ UniffiEnum,+ UniffiError,+ UniffiInternalError,+ UniffiRustCaller,+ destructorGuardSymbol,+ pointerLiteralSymbol,+ uniffiCreateFfiConverterString,+ uniffiCreateRecord,+ uniffiTypeNameSymbol,+ variantOrdinalSymbol,} from "@ubjs/core";// wasm1: wrap the wasm-bindgen namespace once so the codegen call sites can// uniformly reference `nativeModule().rustbuffer_alloc` / `.rustbuffer_free`.@@ -17,7 +48,9 @@ const _nativeModule = Object.assign({}, wasmBundle, {rustbuffer_free: (_: Uint8Array): void => {},});const nativeModule = () => _nativeModule;-const uniffiCaller = new UniffiRustCaller(() => new wasmBundle.RustCallStatus());+const uniffiCaller = new UniffiRustCaller(+ () => new wasmBundle.RustCallStatus(),+);const uniffiIsDebug =// @ts-ignore -- The process global might not be defined@@ -29,1348 +62,1488 @@ const uniffiIsDebug =// Public interface members begin here.const stringConverter = (() => {- const encoder = new TextEncoder();- const decoder = new TextDecoder();- return {- stringToBytes: (s: string) => encoder.encode(s),- bytesToString: (ab: UniffiByteArray) => decoder.decode(ab),- stringByteLength: (s: string) => encoder.encode(s).byteLength,- writeStringIntoBuffer: (s: string, buf: any, offset: number): number => {- const view = new Uint8Array(- buf.arrayBuffer,- offset,- buf.arrayBuffer.byteLength - offset,- );- return encoder.encodeInto(s, view).written;- },- readStringFromBuffer: (buf: any, offset: number, length: number): string =>- decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length)),- };+ const encoder = new TextEncoder();+ const decoder = new TextDecoder();+ return {+ stringToBytes: (s: string) => encoder.encode(s),+ bytesToString: (ab: UniffiByteArray) => decoder.decode(ab),+ stringByteLength: (s: string) => encoder.encode(s).byteLength,+ writeStringIntoBuffer: (s: string, buf: any, offset: number): number => {+ const view = new Uint8Array(+ buf.arrayBuffer,+ offset,+ buf.arrayBuffer.byteLength - offset,+ );+ return encoder.encodeInto(s, view).written;+ },+ readStringFromBuffer: (buf: any, offset: number, length: number): string =>+ decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length)),+ };})();const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);export type ClaimLifecycle = {- shutdownTime?: string,- shutdownPolicy?: string,- autoRenew?: boolean-}+ shutdownTime?: string;+ shutdownPolicy?: string;+ autoRenew?: boolean;+};/*** Generated factory for {@link ClaimLifecycle} record objects.*/export const ClaimLifecycle = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<ClaimLifecycle, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<ClaimLifecycle>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<ClaimLifecycle, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<ClaimLifecycle>,+ });})();const FfiConverterTypeClaimLifecycle = (() => {- type TypeName = ClaimLifecycle;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- shutdownTime: FfiConverterOptionalString.read(from),- shutdownPolicy: FfiConverterOptionalString.read(from),- autoRenew: FfiConverterOptionalBoolean.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalString.write(value.shutdownTime, into);- FfiConverterOptionalString.write(value.shutdownPolicy, into);- FfiConverterOptionalBoolean.write(value.autoRenew, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalString.allocationSize(value.shutdownTime) +- FfiConverterOptionalString.allocationSize(value.shutdownPolicy) +- FfiConverterOptionalBoolean.allocationSize(value.autoRenew);-- }- };- return new FFIConverter();+ type TypeName = ClaimLifecycle;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ shutdownTime: FfiConverterOptionalString.read(from),+ shutdownPolicy: FfiConverterOptionalString.read(from),+ autoRenew: FfiConverterOptionalBoolean.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalString.write(value.shutdownTime, into);+ FfiConverterOptionalString.write(value.shutdownPolicy, into);+ FfiConverterOptionalBoolean.write(value.autoRenew, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalString.allocationSize(value.shutdownTime) ++ FfiConverterOptionalString.allocationSize(value.shutdownPolicy) ++ FfiConverterOptionalBoolean.allocationSize(value.autoRenew)+ );+ }+ }+ return new FFIConverter();})();export type SandboxTemplateRef = {- name: string-}+ name: string;+};/*** Generated factory for {@link SandboxTemplateRef} record objects.*/export const SandboxTemplateRef = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<SandboxTemplateRef, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<SandboxTemplateRef>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<SandboxTemplateRef, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<SandboxTemplateRef>,+ });})();const FfiConverterTypeSandboxTemplateRef = (() => {- type TypeName = SandboxTemplateRef;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- name: FfiConverterString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.name, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.name);-- }- };- return new FFIConverter();+ type TypeName = SandboxTemplateRef;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ name: FfiConverterString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.name, into);+ }+ allocationSize(value: TypeName): number {+ return FfiConverterString.allocationSize(value.name);+ }+ }+ return new FFIConverter();})();export type ClaimSpec = {- sandboxTemplateRef: SandboxTemplateRef,- warmpool?: string,- bindDeadline?: number,- lifecycle?: ClaimLifecycle-}+ sandboxTemplateRef: SandboxTemplateRef;+ warmpool?: string;+ bindDeadline?: number;+ lifecycle?: ClaimLifecycle;+};/*** Generated factory for {@link ClaimSpec} record objects.*/export const ClaimSpec = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<ClaimSpec, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<ClaimSpec>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<ClaimSpec, ReturnType<typeof defaults>>(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<ClaimSpec>,+ });})();const FfiConverterTypeClaimSpec = (() => {- type TypeName = ClaimSpec;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- sandboxTemplateRef: FfiConverterTypeSandboxTemplateRef.read(from),- warmpool: FfiConverterOptionalString.read(from),- bindDeadline: FfiConverterOptionalUInt32.read(from),- lifecycle: FfiConverterOptionalTypeClaimLifecycle.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterTypeSandboxTemplateRef.write(value.sandboxTemplateRef, into);- FfiConverterOptionalString.write(value.warmpool, into);- FfiConverterOptionalUInt32.write(value.bindDeadline, into);- FfiConverterOptionalTypeClaimLifecycle.write(value.lifecycle, into);- }- allocationSize(value: TypeName): number {- return FfiConverterTypeSandboxTemplateRef.allocationSize(value.sandboxTemplateRef) +- FfiConverterOptionalString.allocationSize(value.warmpool) +- FfiConverterOptionalUInt32.allocationSize(value.bindDeadline) +- FfiConverterOptionalTypeClaimLifecycle.allocationSize(value.lifecycle);-- }- };- return new FFIConverter();+ type TypeName = ClaimSpec;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ sandboxTemplateRef: FfiConverterTypeSandboxTemplateRef.read(from),+ warmpool: FfiConverterOptionalString.read(from),+ bindDeadline: FfiConverterOptionalUInt32.read(from),+ lifecycle: FfiConverterOptionalTypeClaimLifecycle.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterTypeSandboxTemplateRef.write(value.sandboxTemplateRef, into);+ FfiConverterOptionalString.write(value.warmpool, into);+ FfiConverterOptionalUInt32.write(value.bindDeadline, into);+ FfiConverterOptionalTypeClaimLifecycle.write(value.lifecycle, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterTypeSandboxTemplateRef.allocationSize(+ value.sandboxTemplateRef,+ ) ++ FfiConverterOptionalString.allocationSize(value.warmpool) ++ FfiConverterOptionalUInt32.allocationSize(value.bindDeadline) ++ FfiConverterOptionalTypeClaimLifecycle.allocationSize(value.lifecycle)+ );+ }+ }+ return new FFIConverter();})();export type OsGymSandboxClaimCondition = {- type?: string,- status?: string,- reason?: string,- message?: string,- lastTransitionTime?: string-}+ type?: string;+ status?: string;+ reason?: string;+ message?: string;+ lastTransitionTime?: string;+};/*** Generated factory for {@link OsGymSandboxClaimCondition} record objects.*/export const OsGymSandboxClaimCondition = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxClaimCondition, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxClaimCondition>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ OsGymSandboxClaimCondition,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<OsGymSandboxClaimCondition>,+ });})();const FfiConverterTypeOSGymSandboxClaimCondition = (() => {- type TypeName = OsGymSandboxClaimCondition;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- type: FfiConverterOptionalString.read(from),- status: FfiConverterOptionalString.read(from),- reason: FfiConverterOptionalString.read(from),- message: FfiConverterOptionalString.read(from),- lastTransitionTime: FfiConverterOptionalString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalString.write(value.type, into);- FfiConverterOptionalString.write(value.status, into);- FfiConverterOptionalString.write(value.reason, into);- FfiConverterOptionalString.write(value.message, into);- FfiConverterOptionalString.write(value.lastTransitionTime, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalString.allocationSize(value.type) +- FfiConverterOptionalString.allocationSize(value.status) +- FfiConverterOptionalString.allocationSize(value.reason) +- FfiConverterOptionalString.allocationSize(value.message) +- FfiConverterOptionalString.allocationSize(value.lastTransitionTime);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxClaimCondition;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ type: FfiConverterOptionalString.read(from),+ status: FfiConverterOptionalString.read(from),+ reason: FfiConverterOptionalString.read(from),+ message: FfiConverterOptionalString.read(from),+ lastTransitionTime: FfiConverterOptionalString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalString.write(value.type, into);+ FfiConverterOptionalString.write(value.status, into);+ FfiConverterOptionalString.write(value.reason, into);+ FfiConverterOptionalString.write(value.message, into);+ FfiConverterOptionalString.write(value.lastTransitionTime, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalString.allocationSize(value.type) ++ FfiConverterOptionalString.allocationSize(value.status) ++ FfiConverterOptionalString.allocationSize(value.reason) ++ FfiConverterOptionalString.allocationSize(value.message) ++ FfiConverterOptionalString.allocationSize(value.lastTransitionTime)+ );+ }+ }+ return new FFIConverter();})();export type OsGymSandboxClaimSandbox = {- name?: string,- service?: string-}+ name?: string;+ service?: string;+};/*** Generated factory for {@link OsGymSandboxClaimSandbox} record objects.*/export const OsGymSandboxClaimSandbox = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxClaimSandbox, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxClaimSandbox>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ OsGymSandboxClaimSandbox,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<OsGymSandboxClaimSandbox>,+ });})();const FfiConverterTypeOSGymSandboxClaimSandbox = (() => {- type TypeName = OsGymSandboxClaimSandbox;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- name: FfiConverterOptionalString.read(from),- service: FfiConverterOptionalString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalString.write(value.name, into);- FfiConverterOptionalString.write(value.service, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalString.allocationSize(value.name) +- FfiConverterOptionalString.allocationSize(value.service);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxClaimSandbox;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ name: FfiConverterOptionalString.read(from),+ service: FfiConverterOptionalString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalString.write(value.name, into);+ FfiConverterOptionalString.write(value.service, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalString.allocationSize(value.name) ++ FfiConverterOptionalString.allocationSize(value.service)+ );+ }+ }+ return new FFIConverter();})();export type OsGymSandboxClaimStatus = {- phase?: string,- conditions?: Array<OsGymSandboxClaimCondition>,- sandbox?: OsGymSandboxClaimSandbox-}+ phase?: string;+ conditions?: Array<OsGymSandboxClaimCondition>;+ sandbox?: OsGymSandboxClaimSandbox;+};/*** Generated factory for {@link OsGymSandboxClaimStatus} record objects.*/export const OsGymSandboxClaimStatus = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxClaimStatus, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxClaimStatus>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ OsGymSandboxClaimStatus,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<OsGymSandboxClaimStatus>,+ });})();const FfiConverterTypeOSGymSandboxClaimStatus = (() => {- type TypeName = OsGymSandboxClaimStatus;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- phase: FfiConverterOptionalString.read(from),- conditions: FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition.read(from),- sandbox: FfiConverterOptionalTypeOSGymSandboxClaimSandbox.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalString.write(value.phase, into);- FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition.write(value.conditions, into);- FfiConverterOptionalTypeOSGymSandboxClaimSandbox.write(value.sandbox, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalString.allocationSize(value.phase) +- FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition.allocationSize(value.conditions) +- FfiConverterOptionalTypeOSGymSandboxClaimSandbox.allocationSize(value.sandbox);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxClaimStatus;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ phase: FfiConverterOptionalString.read(from),+ conditions:+ FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition.read(from),+ sandbox: FfiConverterOptionalTypeOSGymSandboxClaimSandbox.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalString.write(value.phase, into);+ FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition.write(+ value.conditions,+ into,+ );+ FfiConverterOptionalTypeOSGymSandboxClaimSandbox.write(+ value.sandbox,+ into,+ );+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalString.allocationSize(value.phase) ++ FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition.allocationSize(+ value.conditions,+ ) ++ FfiConverterOptionalTypeOSGymSandboxClaimSandbox.allocationSize(+ value.sandbox,+ )+ );+ }+ }+ return new FFIConverter();})();export enum RuntimeKind {- Kubevirt,- Macos,- Gvisor+ Kubevirt,+ Macos,+ Gvisor,}const FfiConverterTypeRuntimeKind = (() => {- const ordinalConverter = FfiConverterInt32;- type TypeName = RuntimeKind;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- switch (ordinalConverter.read(from)) {- case 1: return RuntimeKind.Kubevirt;- case 2: return RuntimeKind.Macos;- case 3: return RuntimeKind.Gvisor;- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- write(value: TypeName, into: RustBuffer): void {- switch (value) {- case RuntimeKind.Kubevirt: return ordinalConverter.write(1, into);- case RuntimeKind.Macos: return ordinalConverter.write(2, into);- case RuntimeKind.Gvisor: return ordinalConverter.write(3, into);- }- }- allocationSize(value: TypeName): number {- return ordinalConverter.allocationSize(0);- }+ const ordinalConverter = FfiConverterInt32;+ type TypeName = RuntimeKind;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return RuntimeKind.Kubevirt;+ case 2:+ return RuntimeKind.Macos;+ case 3:+ return RuntimeKind.Gvisor;+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ write(value: TypeName, into: RustBuffer): void {+ switch (value) {+ case RuntimeKind.Kubevirt:+ return ordinalConverter.write(1, into);+ case RuntimeKind.Macos:+ return ordinalConverter.write(2, into);+ case RuntimeKind.Gvisor:+ return ordinalConverter.write(3, into);+ }+ }+ allocationSize(value: TypeName): number {+ return ordinalConverter.allocationSize(0);}- return new FFIConverter();+ }+ return new FFIConverter();})();export interface PreservedJsonLike {-- toJson(): string;+ toJson(): string;}/*** @deprecated Use `PreservedJsonLike` instead.*/export type PreservedJsonInterface = PreservedJsonLike;--export class PreservedJson extends UniffiAbstractObject implements PreservedJsonLike {-- readonly [uniffiTypeNameSymbol] = "PreservedJson";- readonly [destructorGuardSymbol]: UniffiGcObject;- readonly [pointerLiteralSymbol]: UniffiHandle;- // No primary constructor declared for this class.-private constructor(pointer: UniffiHandle) {+export class PreservedJson+ extends UniffiAbstractObject+ implements PreservedJsonLike+{+ readonly [uniffiTypeNameSymbol] = "PreservedJson";+ readonly [destructorGuardSymbol]: UniffiGcObject;+ readonly [pointerLiteralSymbol]: UniffiHandle;+ // No primary constructor declared for this class.+ private constructor(pointer: UniffiHandle) {super();this[pointerLiteralSymbol] = pointer;- this[destructorGuardSymbol] = uniffiTypePreservedJsonObjectFactory.bless(pointer);-}+ this[destructorGuardSymbol] =+ uniffiTypePreservedJsonObjectFactory.bless(pointer);+ }++ static fromJson(value: string): PreservedJsonLike /*throws*/ {+ return FfiConverterTypePreservedJson.lift(+ uniffiCaller.rustCallWithError(+ /*liftError:*/ FfiConverterTypeJsonValueError.lift.bind(+ FfiConverterTypeJsonValueError,+ ),+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(+ FfiConverterString.lower(value, nativeModule().rustbuffer_alloc),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ }-- static fromJson(value: string): PreservedJsonLike /*throws*/ {- return FfiConverterTypePreservedJson.lift(uniffiCaller.rustCallWithError(- /*liftError:*/ FfiConverterTypeJsonValueError.lift.bind(FfiConverterTypeJsonValueError),- /*caller:*/ (callStatus) => {- return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(- FfiConverterString.lower(value, nativeModule().rustbuffer_alloc),- callStatus);- },- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- ));- }---- toJson(): string {+ toJson(): string {return ((__rb: Uint8Array) => {- try {- return FfiConverterString.lift(__rb);- } finally {- nativeModule().rustbuffer_free(__rb);- }- })(uniffiCaller.rustCall(- /*caller:*/ (callStatus) => {- return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(- uniffiTypePreservedJsonObjectFactory.clonePointer(this),- callStatus);- },- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- ));- }--- uniffiDestroy(): void {- const ptr = (this as any)[destructorGuardSymbol];- if (ptr !== undefined) {- const pointer = uniffiTypePreservedJsonObjectFactory.pointer(this);- uniffiTypePreservedJsonObjectFactory.freePointer(pointer);- uniffiTypePreservedJsonObjectFactory.unbless(ptr);- delete (this as any)[destructorGuardSymbol];- }- }+ try {+ return FfiConverterString.lift(__rb);+ } finally {+ nativeModule().rustbuffer_free(__rb);+ }+ })(+ uniffiCaller.rustCall(+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(+ uniffiTypePreservedJsonObjectFactory.clonePointer(this),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ }- static instanceOf(obj_: any): obj_ is PreservedJson {- return uniffiTypePreservedJsonObjectFactory.isConcreteType(obj_);+ uniffiDestroy(): void {+ const ptr = (this as any)[destructorGuardSymbol];+ if (ptr !== undefined) {+ const pointer = uniffiTypePreservedJsonObjectFactory.pointer(this);+ uniffiTypePreservedJsonObjectFactory.freePointer(pointer);+ uniffiTypePreservedJsonObjectFactory.unbless(ptr);+ delete (this as any)[destructorGuardSymbol];}+ }-+ static instanceOf(obj_: any): obj_ is PreservedJson {+ return uniffiTypePreservedJsonObjectFactory.isConcreteType(obj_);+ }}-const uniffiTypePreservedJsonObjectFactory: UniffiObjectFactory<PreservedJsonLike> = (() => {-+const uniffiTypePreservedJsonObjectFactory: UniffiObjectFactory<PreservedJsonLike> =+ (() => {/// <reference lib="es2021" />- const registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {- uniffiTypePreservedJsonObjectFactory.freePointer(heldValue);- }) : null;-+ const registry =+ typeof FinalizationRegistry !== "undefined"+ ? new FinalizationRegistry<UniffiHandle>((heldValue: UniffiHandle) => {+ uniffiTypePreservedJsonObjectFactory.freePointer(heldValue);+ })+ : null;+return {- create(pointer: UniffiHandle): PreservedJsonLike {+ create(pointer: UniffiHandle): PreservedJsonLike {const instance = Object.create(PreservedJson.prototype);instance[pointerLiteralSymbol] = pointer;instance[destructorGuardSymbol] = this.bless(pointer);instance[uniffiTypeNameSymbol] = "PreservedJson";return instance;- },+ },-- bless(p: UniffiHandle): UniffiGcObject {+ bless(p: UniffiHandle): UniffiGcObject {const ptr = {- p, // make sure this object doesn't get optimized away.- markDestroyed: () => undefined,+ p, // make sure this object doesn't get optimized away.+ markDestroyed: () => undefined,};if (registry) {- registry.register(ptr, p, ptr);+ registry.register(ptr, p, ptr);}return ptr;- },+ },- unbless(ptr_: UniffiGcObject) {+ unbless(ptr_: UniffiGcObject) {if (registry) {- registry.unregister(ptr_);+ registry.unregister(ptr_);}- },+ },- pointer(obj_: PreservedJsonLike): UniffiHandle {+ pointer(obj_: PreservedJsonLike): UniffiHandle {if ((obj_ as any)[destructorGuardSymbol] === undefined) {- throw new UniffiInternalError.UnexpectedNullPointer();+ throw new UniffiInternalError.UnexpectedNullPointer();}return (obj_ as any)[pointerLiteralSymbol];- },+ },- clonePointer(obj_: PreservedJsonLike): UniffiHandle {+ clonePointer(obj_: PreservedJsonLike): UniffiHandle {const pointer = this.pointer(obj_);return uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_clone_preservedjson(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_clone_preservedjson(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- freePointer(pointer: UniffiHandle): void {+ freePointer(pointer: UniffiHandle): void {uniffiCaller.rustCall(- /*caller:*/ (callStatus) => nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_free_preservedjson(pointer, callStatus),- /*liftString:*/ FfiConverterString.lift+ /*caller:*/ (callStatus) =>+ nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_free_preservedjson(+ pointer,+ callStatus,+ ),+ /*liftString:*/ FfiConverterString.lift,);- },+ },- isConcreteType(obj_: any): obj_ is PreservedJsonLike {- return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "PreservedJson";- },-}})();-const FfiConverterTypePreservedJson = new FfiConverterObject(uniffiTypePreservedJsonObjectFactory);+ isConcreteType(obj_: any): obj_ is PreservedJsonLike {+ return (+ obj_[destructorGuardSymbol] &&+ obj_[uniffiTypeNameSymbol] === "PreservedJson"+ );+ },+ };+ })();+const FfiConverterTypePreservedJson = new FfiConverterObject(+ uniffiTypePreservedJsonObjectFactory,+);export enum ImagePullPolicy {- Always,- IfNotPresent,- Never+ Always,+ IfNotPresent,+ Never,}const FfiConverterTypeImagePullPolicy = (() => {- const ordinalConverter = FfiConverterInt32;- type TypeName = ImagePullPolicy;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- switch (ordinalConverter.read(from)) {- case 1: return ImagePullPolicy.Always;- case 2: return ImagePullPolicy.IfNotPresent;- case 3: return ImagePullPolicy.Never;- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- write(value: TypeName, into: RustBuffer): void {- switch (value) {- case ImagePullPolicy.Always: return ordinalConverter.write(1, into);- case ImagePullPolicy.IfNotPresent: return ordinalConverter.write(2, into);- case ImagePullPolicy.Never: return ordinalConverter.write(3, into);- }- }- allocationSize(value: TypeName): number {- return ordinalConverter.allocationSize(0);- }+ const ordinalConverter = FfiConverterInt32;+ type TypeName = ImagePullPolicy;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return ImagePullPolicy.Always;+ case 2:+ return ImagePullPolicy.IfNotPresent;+ case 3:+ return ImagePullPolicy.Never;+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }}- return new FFIConverter();+ write(value: TypeName, into: RustBuffer): void {+ switch (value) {+ case ImagePullPolicy.Always:+ return ordinalConverter.write(1, into);+ case ImagePullPolicy.IfNotPresent:+ return ordinalConverter.write(2, into);+ case ImagePullPolicy.Never:+ return ordinalConverter.write(3, into);+ }+ }+ allocationSize(value: TypeName): number {+ return ordinalConverter.allocationSize(0);+ }+ }+ return new FFIConverter();})();export enum Firmware {- Bios,- Efi+ Bios,+ Efi,}const FfiConverterTypeFirmware = (() => {- const ordinalConverter = FfiConverterInt32;- type TypeName = Firmware;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- switch (ordinalConverter.read(from)) {- case 1: return Firmware.Bios;- case 2: return Firmware.Efi;- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- write(value: TypeName, into: RustBuffer): void {- switch (value) {- case Firmware.Bios: return ordinalConverter.write(1, into);- case Firmware.Efi: return ordinalConverter.write(2, into);- }- }- allocationSize(value: TypeName): number {- return ordinalConverter.allocationSize(0);- }+ const ordinalConverter = FfiConverterInt32;+ type TypeName = Firmware;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return Firmware.Bios;+ case 2:+ return Firmware.Efi;+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ write(value: TypeName, into: RustBuffer): void {+ switch (value) {+ case Firmware.Bios:+ return ordinalConverter.write(1, into);+ case Firmware.Efi:+ return ordinalConverter.write(2, into);+ }+ }+ allocationSize(value: TypeName): number {+ return ordinalConverter.allocationSize(0);}- return new FFIConverter();+ }+ return new FFIConverter();})();export enum ServiceProtocol {- Tcp,- Udp+ Tcp,+ Udp,}const FfiConverterTypeServiceProtocol = (() => {- const ordinalConverter = FfiConverterInt32;- type TypeName = ServiceProtocol;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- switch (ordinalConverter.read(from)) {- case 1: return ServiceProtocol.Tcp;- case 2: return ServiceProtocol.Udp;- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- write(value: TypeName, into: RustBuffer): void {- switch (value) {- case ServiceProtocol.Tcp: return ordinalConverter.write(1, into);- case ServiceProtocol.Udp: return ordinalConverter.write(2, into);- }- }- allocationSize(value: TypeName): number {- return ordinalConverter.allocationSize(0);- }+ const ordinalConverter = FfiConverterInt32;+ type TypeName = ServiceProtocol;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return ServiceProtocol.Tcp;+ case 2:+ return ServiceProtocol.Udp;+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }}- return new FFIConverter();+ write(value: TypeName, into: RustBuffer): void {+ switch (value) {+ case ServiceProtocol.Tcp:+ return ordinalConverter.write(1, into);+ case ServiceProtocol.Udp:+ return ordinalConverter.write(2, into);+ }+ }+ allocationSize(value: TypeName): number {+ return ordinalConverter.allocationSize(0);+ }+ }+ return new FFIConverter();})();export type SandboxService = {- name: string,- targetPort: number,- protocol?: ServiceProtocol-}+ name: string;+ targetPort: number;+ protocol?: ServiceProtocol;+};/*** Generated factory for {@link SandboxService} record objects.*/export const SandboxService = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<SandboxService, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<SandboxService>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<SandboxService, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<SandboxService>,+ });})();const FfiConverterTypeSandboxService = (() => {- type TypeName = SandboxService;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- name: FfiConverterString.read(from),- targetPort: FfiConverterUInt16.read(from),- protocol: FfiConverterOptionalTypeServiceProtocol.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.name, into);- FfiConverterUInt16.write(value.targetPort, into);- FfiConverterOptionalTypeServiceProtocol.write(value.protocol, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.name) +- FfiConverterUInt16.allocationSize(value.targetPort) +- FfiConverterOptionalTypeServiceProtocol.allocationSize(value.protocol);-- }- };- return new FFIConverter();+ type TypeName = SandboxService;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ name: FfiConverterString.read(from),+ targetPort: FfiConverterUInt16.read(from),+ protocol: FfiConverterOptionalTypeServiceProtocol.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.name, into);+ FfiConverterUInt16.write(value.targetPort, into);+ FfiConverterOptionalTypeServiceProtocol.write(value.protocol, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.name) ++ FfiConverterUInt16.allocationSize(value.targetPort) ++ FfiConverterOptionalTypeServiceProtocol.allocationSize(value.protocol)+ );+ }+ }+ return new FFIConverter();})();export type OidcConfig = {- credentialsSecret: string,- tokenUrl: string,- awsRoleArn?: string,- awsRegion?: string,- refreshIntervalSeconds?: number-}+ credentialsSecret: string;+ tokenUrl: string;+ awsRoleArn?: string;+ awsRegion?: string;+ refreshIntervalSeconds?: number;+};/*** Generated factory for {@link OidcConfig} record objects.*/export const OidcConfig = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OidcConfig, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OidcConfig>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<OidcConfig, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<OidcConfig>,+ });})();const FfiConverterTypeOidcConfig = (() => {- type TypeName = OidcConfig;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- credentialsSecret: FfiConverterString.read(from),- tokenUrl: FfiConverterString.read(from),- awsRoleArn: FfiConverterOptionalString.read(from),- awsRegion: FfiConverterOptionalString.read(from),- refreshIntervalSeconds: FfiConverterOptionalUInt32.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.credentialsSecret, into);- FfiConverterString.write(value.tokenUrl, into);- FfiConverterOptionalString.write(value.awsRoleArn, into);- FfiConverterOptionalString.write(value.awsRegion, into);- FfiConverterOptionalUInt32.write(value.refreshIntervalSeconds, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.credentialsSecret) +- FfiConverterString.allocationSize(value.tokenUrl) +- FfiConverterOptionalString.allocationSize(value.awsRoleArn) +- FfiConverterOptionalString.allocationSize(value.awsRegion) +- FfiConverterOptionalUInt32.allocationSize(value.refreshIntervalSeconds);-- }- };- return new FFIConverter();+ type TypeName = OidcConfig;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ credentialsSecret: FfiConverterString.read(from),+ tokenUrl: FfiConverterString.read(from),+ awsRoleArn: FfiConverterOptionalString.read(from),+ awsRegion: FfiConverterOptionalString.read(from),+ refreshIntervalSeconds: FfiConverterOptionalUInt32.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.credentialsSecret, into);+ FfiConverterString.write(value.tokenUrl, into);+ FfiConverterOptionalString.write(value.awsRoleArn, into);+ FfiConverterOptionalString.write(value.awsRegion, into);+ FfiConverterOptionalUInt32.write(value.refreshIntervalSeconds, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.credentialsSecret) ++ FfiConverterString.allocationSize(value.tokenUrl) ++ FfiConverterOptionalString.allocationSize(value.awsRoleArn) ++ FfiConverterOptionalString.allocationSize(value.awsRegion) ++ FfiConverterOptionalUInt32.allocationSize(value.refreshIntervalSeconds)+ );+ }+ }+ return new FFIConverter();})();export type VmTemplate = {- containerDiskImage: string,- command?: Array<string>,- runtime?: RuntimeKind,- runtimeClassName?: string,- nodeSelector?: Map<string, string>,- tolerations?: Array<PreservedJsonLike>,- imagePullPolicy?: ImagePullPolicy,- imagePullSecret?: string,- cpuCores?: number,- memory?: string,- firmware?: Firmware,- probes?: PreservedJsonLike,- services?: Array<SandboxService>,- oidc?: OidcConfig-}+ containerDiskImage: string;+ command?: Array<string>;+ runtime?: RuntimeKind;+ runtimeClassName?: string;+ nodeSelector?: Map<string, string>;+ tolerations?: Array<PreservedJsonLike>;+ imagePullPolicy?: ImagePullPolicy;+ imagePullSecret?: string;+ cpuCores?: number;+ memory?: string;+ firmware?: Firmware;+ probes?: PreservedJsonLike;+ services?: Array<SandboxService>;+ oidc?: OidcConfig;+};/*** Generated factory for {@link VmTemplate} record objects.*/export const VmTemplate = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<VmTemplate, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<VmTemplate>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<VmTemplate, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<VmTemplate>,+ });})();const FfiConverterTypeVmTemplate = (() => {- type TypeName = VmTemplate;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- containerDiskImage: FfiConverterString.read(from),- command: FfiConverterOptionalSequenceString.read(from),- runtime: FfiConverterOptionalTypeRuntimeKind.read(from),- runtimeClassName: FfiConverterOptionalString.read(from),- nodeSelector: FfiConverterOptionalMapStringString.read(from),- tolerations: FfiConverterOptionalSequenceTypePreservedJson.read(from),- imagePullPolicy: FfiConverterOptionalTypeImagePullPolicy.read(from),- imagePullSecret: FfiConverterOptionalString.read(from),- cpuCores: FfiConverterOptionalUInt32.read(from),- memory: FfiConverterOptionalString.read(from),- firmware: FfiConverterOptionalTypeFirmware.read(from),- probes: FfiConverterOptionalTypePreservedJson.read(from),- services: FfiConverterOptionalSequenceTypeSandboxService.read(from),- oidc: FfiConverterOptionalTypeOidcConfig.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterString.write(value.containerDiskImage, into);- FfiConverterOptionalSequenceString.write(value.command, into);- FfiConverterOptionalTypeRuntimeKind.write(value.runtime, into);- FfiConverterOptionalString.write(value.runtimeClassName, into);- FfiConverterOptionalMapStringString.write(value.nodeSelector, into);- FfiConverterOptionalSequenceTypePreservedJson.write(value.tolerations, into);- FfiConverterOptionalTypeImagePullPolicy.write(value.imagePullPolicy, into);- FfiConverterOptionalString.write(value.imagePullSecret, into);- FfiConverterOptionalUInt32.write(value.cpuCores, into);- FfiConverterOptionalString.write(value.memory, into);- FfiConverterOptionalTypeFirmware.write(value.firmware, into);- FfiConverterOptionalTypePreservedJson.write(value.probes, into);- FfiConverterOptionalSequenceTypeSandboxService.write(value.services, into);- FfiConverterOptionalTypeOidcConfig.write(value.oidc, into);- }- allocationSize(value: TypeName): number {- return FfiConverterString.allocationSize(value.containerDiskImage) +- FfiConverterOptionalSequenceString.allocationSize(value.command) +- FfiConverterOptionalTypeRuntimeKind.allocationSize(value.runtime) +- FfiConverterOptionalString.allocationSize(value.runtimeClassName) +- FfiConverterOptionalMapStringString.allocationSize(value.nodeSelector) +- FfiConverterOptionalSequenceTypePreservedJson.allocationSize(value.tolerations) +- FfiConverterOptionalTypeImagePullPolicy.allocationSize(value.imagePullPolicy) +- FfiConverterOptionalString.allocationSize(value.imagePullSecret) +- FfiConverterOptionalUInt32.allocationSize(value.cpuCores) +- FfiConverterOptionalString.allocationSize(value.memory) +- FfiConverterOptionalTypeFirmware.allocationSize(value.firmware) +- FfiConverterOptionalTypePreservedJson.allocationSize(value.probes) +- FfiConverterOptionalSequenceTypeSandboxService.allocationSize(value.services) +- FfiConverterOptionalTypeOidcConfig.allocationSize(value.oidc);-- }- };- return new FFIConverter();+ type TypeName = VmTemplate;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ containerDiskImage: FfiConverterString.read(from),+ command: FfiConverterOptionalSequenceString.read(from),+ runtime: FfiConverterOptionalTypeRuntimeKind.read(from),+ runtimeClassName: FfiConverterOptionalString.read(from),+ nodeSelector: FfiConverterOptionalMapStringString.read(from),+ tolerations: FfiConverterOptionalSequenceTypePreservedJson.read(from),+ imagePullPolicy: FfiConverterOptionalTypeImagePullPolicy.read(from),+ imagePullSecret: FfiConverterOptionalString.read(from),+ cpuCores: FfiConverterOptionalUInt32.read(from),+ memory: FfiConverterOptionalString.read(from),+ firmware: FfiConverterOptionalTypeFirmware.read(from),+ probes: FfiConverterOptionalTypePreservedJson.read(from),+ services: FfiConverterOptionalSequenceTypeSandboxService.read(from),+ oidc: FfiConverterOptionalTypeOidcConfig.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.containerDiskImage, into);+ FfiConverterOptionalSequenceString.write(value.command, into);+ FfiConverterOptionalTypeRuntimeKind.write(value.runtime, into);+ FfiConverterOptionalString.write(value.runtimeClassName, into);+ FfiConverterOptionalMapStringString.write(value.nodeSelector, into);+ FfiConverterOptionalSequenceTypePreservedJson.write(+ value.tolerations,+ into,+ );+ FfiConverterOptionalTypeImagePullPolicy.write(+ value.imagePullPolicy,+ into,+ );+ FfiConverterOptionalString.write(value.imagePullSecret, into);+ FfiConverterOptionalUInt32.write(value.cpuCores, into);+ FfiConverterOptionalString.write(value.memory, into);+ FfiConverterOptionalTypeFirmware.write(value.firmware, into);+ FfiConverterOptionalTypePreservedJson.write(value.probes, into);+ FfiConverterOptionalSequenceTypeSandboxService.write(+ value.services,+ into,+ );+ FfiConverterOptionalTypeOidcConfig.write(value.oidc, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterString.allocationSize(value.containerDiskImage) ++ FfiConverterOptionalSequenceString.allocationSize(value.command) ++ FfiConverterOptionalTypeRuntimeKind.allocationSize(value.runtime) ++ FfiConverterOptionalString.allocationSize(value.runtimeClassName) ++ FfiConverterOptionalMapStringString.allocationSize(value.nodeSelector) ++ FfiConverterOptionalSequenceTypePreservedJson.allocationSize(+ value.tolerations,+ ) ++ FfiConverterOptionalTypeImagePullPolicy.allocationSize(+ value.imagePullPolicy,+ ) ++ FfiConverterOptionalString.allocationSize(value.imagePullSecret) ++ FfiConverterOptionalUInt32.allocationSize(value.cpuCores) ++ FfiConverterOptionalString.allocationSize(value.memory) ++ FfiConverterOptionalTypeFirmware.allocationSize(value.firmware) ++ FfiConverterOptionalTypePreservedJson.allocationSize(value.probes) ++ FfiConverterOptionalSequenceTypeSandboxService.allocationSize(+ value.services,+ ) ++ FfiConverterOptionalTypeOidcConfig.allocationSize(value.oidc)+ );+ }+ }+ return new FFIConverter();})();export type OsGymSandboxSpec = {- vmTemplate: VmTemplate-}+ vmTemplate: VmTemplate;+};/*** Generated factory for {@link OsGymSandboxSpec} record objects.*/export const OsGymSandboxSpec = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxSpec, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxSpec>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<OsGymSandboxSpec, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxSpec>,+ });})();const FfiConverterTypeOSGymSandboxSpec = (() => {- type TypeName = OsGymSandboxSpec;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- vmTemplate: FfiConverterTypeVmTemplate.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterTypeVmTemplate.write(value.vmTemplate, into);- }- allocationSize(value: TypeName): number {- return FfiConverterTypeVmTemplate.allocationSize(value.vmTemplate);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxSpec;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ vmTemplate: FfiConverterTypeVmTemplate.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterTypeVmTemplate.write(value.vmTemplate, into);+ }+ allocationSize(value: TypeName): number {+ return FfiConverterTypeVmTemplate.allocationSize(value.vmTemplate);+ }+ }+ return new FFIConverter();})();export type OsGymSandboxStatus = {- phase?: string,- runtime?: string,- ready?: boolean,- vmName?: string,- service?: string,- message?: string,- resetIssuedAt?: string,- resetVmiUid?: string-}+ phase?: string;+ runtime?: string;+ ready?: boolean;+ vmName?: string;+ service?: string;+ message?: string;+ resetIssuedAt?: string;+ resetVmiUid?: string;+};/*** Generated factory for {@link OsGymSandboxStatus} record objects.*/export const OsGymSandboxStatus = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxStatus, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxStatus>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<OsGymSandboxStatus, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxStatus>,+ });})();const FfiConverterTypeOSGymSandboxStatus = (() => {- type TypeName = OsGymSandboxStatus;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- phase: FfiConverterOptionalString.read(from),- runtime: FfiConverterOptionalString.read(from),- ready: FfiConverterOptionalBoolean.read(from),- vmName: FfiConverterOptionalString.read(from),- service: FfiConverterOptionalString.read(from),- message: FfiConverterOptionalString.read(from),- resetIssuedAt: FfiConverterOptionalString.read(from),- resetVmiUid: FfiConverterOptionalString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalString.write(value.phase, into);- FfiConverterOptionalString.write(value.runtime, into);- FfiConverterOptionalBoolean.write(value.ready, into);- FfiConverterOptionalString.write(value.vmName, into);- FfiConverterOptionalString.write(value.service, into);- FfiConverterOptionalString.write(value.message, into);- FfiConverterOptionalString.write(value.resetIssuedAt, into);- FfiConverterOptionalString.write(value.resetVmiUid, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalString.allocationSize(value.phase) +- FfiConverterOptionalString.allocationSize(value.runtime) +- FfiConverterOptionalBoolean.allocationSize(value.ready) +- FfiConverterOptionalString.allocationSize(value.vmName) +- FfiConverterOptionalString.allocationSize(value.service) +- FfiConverterOptionalString.allocationSize(value.message) +- FfiConverterOptionalString.allocationSize(value.resetIssuedAt) +- FfiConverterOptionalString.allocationSize(value.resetVmiUid);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxStatus;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ phase: FfiConverterOptionalString.read(from),+ runtime: FfiConverterOptionalString.read(from),+ ready: FfiConverterOptionalBoolean.read(from),+ vmName: FfiConverterOptionalString.read(from),+ service: FfiConverterOptionalString.read(from),+ message: FfiConverterOptionalString.read(from),+ resetIssuedAt: FfiConverterOptionalString.read(from),+ resetVmiUid: FfiConverterOptionalString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalString.write(value.phase, into);+ FfiConverterOptionalString.write(value.runtime, into);+ FfiConverterOptionalBoolean.write(value.ready, into);+ FfiConverterOptionalString.write(value.vmName, into);+ FfiConverterOptionalString.write(value.service, into);+ FfiConverterOptionalString.write(value.message, into);+ FfiConverterOptionalString.write(value.resetIssuedAt, into);+ FfiConverterOptionalString.write(value.resetVmiUid, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalString.allocationSize(value.phase) ++ FfiConverterOptionalString.allocationSize(value.runtime) ++ FfiConverterOptionalBoolean.allocationSize(value.ready) ++ FfiConverterOptionalString.allocationSize(value.vmName) ++ FfiConverterOptionalString.allocationSize(value.service) ++ FfiConverterOptionalString.allocationSize(value.message) ++ FfiConverterOptionalString.allocationSize(value.resetIssuedAt) ++ FfiConverterOptionalString.allocationSize(value.resetVmiUid)+ );+ }+ }+ return new FFIConverter();})();export type OsGymSandboxTemplateSpec = {- vmTemplate: VmTemplate-}+ vmTemplate: VmTemplate;+};/*** Generated factory for {@link OsGymSandboxTemplateSpec} record objects.*/export const OsGymSandboxTemplateSpec = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxTemplateSpec, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxTemplateSpec>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ OsGymSandboxTemplateSpec,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<OsGymSandboxTemplateSpec>,+ });})();const FfiConverterTypeOSGymSandboxTemplateSpec = (() => {- type TypeName = OsGymSandboxTemplateSpec;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- vmTemplate: FfiConverterTypeVmTemplate.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterTypeVmTemplate.write(value.vmTemplate, into);- }- allocationSize(value: TypeName): number {- return FfiConverterTypeVmTemplate.allocationSize(value.vmTemplate);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxTemplateSpec;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ vmTemplate: FfiConverterTypeVmTemplate.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterTypeVmTemplate.write(value.vmTemplate, into);+ }+ allocationSize(value: TypeName): number {+ return FfiConverterTypeVmTemplate.allocationSize(value.vmTemplate);+ }+ }+ return new FFIConverter();})();export type WarmPoolAutoscaling = {- minPoolSize?: number,- initialPoolSize?: number,- maxPoolSize?: number-}+ minPoolSize?: number;+ initialPoolSize?: number;+ maxPoolSize?: number;+};/*** Generated factory for {@link WarmPoolAutoscaling} record objects.*/export const WarmPoolAutoscaling = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<WarmPoolAutoscaling, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<WarmPoolAutoscaling>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<WarmPoolAutoscaling, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<WarmPoolAutoscaling>,+ });})();const FfiConverterTypeWarmPoolAutoscaling = (() => {- type TypeName = WarmPoolAutoscaling;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- minPoolSize: FfiConverterOptionalUInt32.read(from),- initialPoolSize: FfiConverterOptionalUInt32.read(from),- maxPoolSize: FfiConverterOptionalUInt32.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalUInt32.write(value.minPoolSize, into);- FfiConverterOptionalUInt32.write(value.initialPoolSize, into);- FfiConverterOptionalUInt32.write(value.maxPoolSize, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalUInt32.allocationSize(value.minPoolSize) +- FfiConverterOptionalUInt32.allocationSize(value.initialPoolSize) +- FfiConverterOptionalUInt32.allocationSize(value.maxPoolSize);-- }- };- return new FFIConverter();+ type TypeName = WarmPoolAutoscaling;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ minPoolSize: FfiConverterOptionalUInt32.read(from),+ initialPoolSize: FfiConverterOptionalUInt32.read(from),+ maxPoolSize: FfiConverterOptionalUInt32.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalUInt32.write(value.minPoolSize, into);+ FfiConverterOptionalUInt32.write(value.initialPoolSize, into);+ FfiConverterOptionalUInt32.write(value.maxPoolSize, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalUInt32.allocationSize(value.minPoolSize) ++ FfiConverterOptionalUInt32.allocationSize(value.initialPoolSize) ++ FfiConverterOptionalUInt32.allocationSize(value.maxPoolSize)+ );+ }+ }+ return new FFIConverter();})();export type OsGymSandboxWarmPoolSpec = {- replicas: number,- sandboxTemplateRef: SandboxTemplateRef,- autoscaling?: WarmPoolAutoscaling-}+ replicas: number;+ sandboxTemplateRef: SandboxTemplateRef;+ autoscaling?: WarmPoolAutoscaling;+};/*** Generated factory for {@link OsGymSandboxWarmPoolSpec} record objects.*/export const OsGymSandboxWarmPoolSpec = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxWarmPoolSpec, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxWarmPoolSpec>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ OsGymSandboxWarmPoolSpec,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<OsGymSandboxWarmPoolSpec>,+ });})();const FfiConverterTypeOSGymSandboxWarmPoolSpec = (() => {- type TypeName = OsGymSandboxWarmPoolSpec;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- replicas: FfiConverterUInt32.read(from),- sandboxTemplateRef: FfiConverterTypeSandboxTemplateRef.read(from),- autoscaling: FfiConverterOptionalTypeWarmPoolAutoscaling.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterUInt32.write(value.replicas, into);- FfiConverterTypeSandboxTemplateRef.write(value.sandboxTemplateRef, into);- FfiConverterOptionalTypeWarmPoolAutoscaling.write(value.autoscaling, into);- }- allocationSize(value: TypeName): number {- return FfiConverterUInt32.allocationSize(value.replicas) +- FfiConverterTypeSandboxTemplateRef.allocationSize(value.sandboxTemplateRef) +- FfiConverterOptionalTypeWarmPoolAutoscaling.allocationSize(value.autoscaling);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxWarmPoolSpec;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ replicas: FfiConverterUInt32.read(from),+ sandboxTemplateRef: FfiConverterTypeSandboxTemplateRef.read(from),+ autoscaling: FfiConverterOptionalTypeWarmPoolAutoscaling.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterUInt32.write(value.replicas, into);+ FfiConverterTypeSandboxTemplateRef.write(value.sandboxTemplateRef, into);+ FfiConverterOptionalTypeWarmPoolAutoscaling.write(+ value.autoscaling,+ into,+ );+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterUInt32.allocationSize(value.replicas) ++ FfiConverterTypeSandboxTemplateRef.allocationSize(+ value.sandboxTemplateRef,+ ) ++ FfiConverterOptionalTypeWarmPoolAutoscaling.allocationSize(+ value.autoscaling,+ )+ );+ }+ }+ return new FFIConverter();})();export type OsGymSandboxWarmPoolStatus = {- replicas?: number,- readyReplicas?: number,- selector?: string-}+ replicas?: number;+ readyReplicas?: number;+ selector?: string;+};/*** Generated factory for {@link OsGymSandboxWarmPoolStatus} record objects.*/export const OsGymSandboxWarmPoolStatus = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymSandboxWarmPoolStatus, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymSandboxWarmPoolStatus>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ OsGymSandboxWarmPoolStatus,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<OsGymSandboxWarmPoolStatus>,+ });})();const FfiConverterTypeOSGymSandboxWarmPoolStatus = (() => {- type TypeName = OsGymSandboxWarmPoolStatus;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- replicas: FfiConverterOptionalUInt32.read(from),- readyReplicas: FfiConverterOptionalUInt32.read(from),- selector: FfiConverterOptionalString.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalUInt32.write(value.replicas, into);- FfiConverterOptionalUInt32.write(value.readyReplicas, into);- FfiConverterOptionalString.write(value.selector, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalUInt32.allocationSize(value.replicas) +- FfiConverterOptionalUInt32.allocationSize(value.readyReplicas) +- FfiConverterOptionalString.allocationSize(value.selector);-- }- };- return new FFIConverter();+ type TypeName = OsGymSandboxWarmPoolStatus;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ replicas: FfiConverterOptionalUInt32.read(from),+ readyReplicas: FfiConverterOptionalUInt32.read(from),+ selector: FfiConverterOptionalString.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalUInt32.write(value.replicas, into);+ FfiConverterOptionalUInt32.write(value.readyReplicas, into);+ FfiConverterOptionalString.write(value.selector, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalUInt32.allocationSize(value.replicas) ++ FfiConverterOptionalUInt32.allocationSize(value.readyReplicas) ++ FfiConverterOptionalString.allocationSize(value.selector)+ );+ }+ }+ return new FFIConverter();})();export type OsGymWorkspacePoolStatus = {- phase?: string,- totalCount?: number,- availableCount?: number,- claimedCount?: number-}+ phase?: string;+ totalCount?: number;+ availableCount?: number;+ claimedCount?: number;+};/*** Generated factory for {@link OsGymWorkspacePoolStatus} record objects.*/export const OsGymWorkspacePoolStatus = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<OsGymWorkspacePoolStatus, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<OsGymWorkspacePoolStatus>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<+ OsGymWorkspacePoolStatus,+ ReturnType<typeof defaults>+ >(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () =>+ Object.freeze(defaults()) as Partial<OsGymWorkspacePoolStatus>,+ });})();const FfiConverterTypeOSGymWorkspacePoolStatus = (() => {- type TypeName = OsGymWorkspacePoolStatus;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- phase: FfiConverterOptionalString.read(from),- totalCount: FfiConverterOptionalUInt32.read(from),- availableCount: FfiConverterOptionalUInt32.read(from),- claimedCount: FfiConverterOptionalUInt32.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalString.write(value.phase, into);- FfiConverterOptionalUInt32.write(value.totalCount, into);- FfiConverterOptionalUInt32.write(value.availableCount, into);- FfiConverterOptionalUInt32.write(value.claimedCount, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalString.allocationSize(value.phase) +- FfiConverterOptionalUInt32.allocationSize(value.totalCount) +- FfiConverterOptionalUInt32.allocationSize(value.availableCount) +- FfiConverterOptionalUInt32.allocationSize(value.claimedCount);-- }- };- return new FFIConverter();+ type TypeName = OsGymWorkspacePoolStatus;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ phase: FfiConverterOptionalString.read(from),+ totalCount: FfiConverterOptionalUInt32.read(from),+ availableCount: FfiConverterOptionalUInt32.read(from),+ claimedCount: FfiConverterOptionalUInt32.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalString.write(value.phase, into);+ FfiConverterOptionalUInt32.write(value.totalCount, into);+ FfiConverterOptionalUInt32.write(value.availableCount, into);+ FfiConverterOptionalUInt32.write(value.claimedCount, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalString.allocationSize(value.phase) ++ FfiConverterOptionalUInt32.allocationSize(value.totalCount) ++ FfiConverterOptionalUInt32.allocationSize(value.availableCount) ++ FfiConverterOptionalUInt32.allocationSize(value.claimedCount)+ );+ }+ }+ return new FFIConverter();})();export type PoolTemplate = {- runtime?: RuntimeKind,- runtimeClassName?: string,- nodeSelector?: Map<string, string>,- tolerations?: Array<PreservedJsonLike>,- command?: Array<string>,- containerDiskImage: string,- imagePullSecret?: string,- cpuCores?: number,- memory?: string,- firmware?: Firmware,- probes?: PreservedJsonLike,- oidc?: OidcConfig-}+ runtime?: RuntimeKind;+ runtimeClassName?: string;+ nodeSelector?: Map<string, string>;+ tolerations?: Array<PreservedJsonLike>;+ command?: Array<string>;+ containerDiskImage: string;+ imagePullSecret?: string;+ cpuCores?: number;+ memory?: string;+ firmware?: Firmware;+ probes?: PreservedJsonLike;+ oidc?: OidcConfig;+};/*** Generated factory for {@link PoolTemplate} record objects.*/export const PoolTemplate = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<PoolTemplate, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<PoolTemplate>,- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<PoolTemplate, ReturnType<typeof defaults>>(+ defaults,+ );+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<PoolTemplate>,+ });})();const FfiConverterTypePoolTemplate = (() => {- type TypeName = PoolTemplate;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- runtime: FfiConverterOptionalTypeRuntimeKind.read(from),- runtimeClassName: FfiConverterOptionalString.read(from),- nodeSelector: FfiConverterOptionalMapStringString.read(from),- tolerations: FfiConverterOptionalSequenceTypePreservedJson.read(from),- command: FfiConverterOptionalSequenceString.read(from),- containerDiskImage: FfiConverterString.read(from),- imagePullSecret: FfiConverterOptionalString.read(from),- cpuCores: FfiConverterOptionalUInt32.read(from),- memory: FfiConverterOptionalString.read(from),- firmware: FfiConverterOptionalTypeFirmware.read(from),- probes: FfiConverterOptionalTypePreservedJson.read(from),- oidc: FfiConverterOptionalTypeOidcConfig.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterOptionalTypeRuntimeKind.write(value.runtime, into);- FfiConverterOptionalString.write(value.runtimeClassName, into);- FfiConverterOptionalMapStringString.write(value.nodeSelector, into);- FfiConverterOptionalSequenceTypePreservedJson.write(value.tolerations, into);- FfiConverterOptionalSequenceString.write(value.command, into);- FfiConverterString.write(value.containerDiskImage, into);- FfiConverterOptionalString.write(value.imagePullSecret, into);- FfiConverterOptionalUInt32.write(value.cpuCores, into);- FfiConverterOptionalString.write(value.memory, into);- FfiConverterOptionalTypeFirmware.write(value.firmware, into);- FfiConverterOptionalTypePreservedJson.write(value.probes, into);- FfiConverterOptionalTypeOidcConfig.write(value.oidc, into);- }- allocationSize(value: TypeName): number {- return FfiConverterOptionalTypeRuntimeKind.allocationSize(value.runtime) +- FfiConverterOptionalString.allocationSize(value.runtimeClassName) +- FfiConverterOptionalMapStringString.allocationSize(value.nodeSelector) +- FfiConverterOptionalSequenceTypePreservedJson.allocationSize(value.tolerations) +- FfiConverterOptionalSequenceString.allocationSize(value.command) +- FfiConverterString.allocationSize(value.containerDiskImage) +- FfiConverterOptionalString.allocationSize(value.imagePullSecret) +- FfiConverterOptionalUInt32.allocationSize(value.cpuCores) +- FfiConverterOptionalString.allocationSize(value.memory) +- FfiConverterOptionalTypeFirmware.allocationSize(value.firmware) +- FfiConverterOptionalTypePreservedJson.allocationSize(value.probes) +- FfiConverterOptionalTypeOidcConfig.allocationSize(value.oidc);-- }- };- return new FFIConverter();+ type TypeName = PoolTemplate;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ runtime: FfiConverterOptionalTypeRuntimeKind.read(from),+ runtimeClassName: FfiConverterOptionalString.read(from),+ nodeSelector: FfiConverterOptionalMapStringString.read(from),+ tolerations: FfiConverterOptionalSequenceTypePreservedJson.read(from),+ command: FfiConverterOptionalSequenceString.read(from),+ containerDiskImage: FfiConverterString.read(from),+ imagePullSecret: FfiConverterOptionalString.read(from),+ cpuCores: FfiConverterOptionalUInt32.read(from),+ memory: FfiConverterOptionalString.read(from),+ firmware: FfiConverterOptionalTypeFirmware.read(from),+ probes: FfiConverterOptionalTypePreservedJson.read(from),+ oidc: FfiConverterOptionalTypeOidcConfig.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterOptionalTypeRuntimeKind.write(value.runtime, into);+ FfiConverterOptionalString.write(value.runtimeClassName, into);+ FfiConverterOptionalMapStringString.write(value.nodeSelector, into);+ FfiConverterOptionalSequenceTypePreservedJson.write(+ value.tolerations,+ into,+ );+ FfiConverterOptionalSequenceString.write(value.command, into);+ FfiConverterString.write(value.containerDiskImage, into);+ FfiConverterOptionalString.write(value.imagePullSecret, into);+ FfiConverterOptionalUInt32.write(value.cpuCores, into);+ FfiConverterOptionalString.write(value.memory, into);+ FfiConverterOptionalTypeFirmware.write(value.firmware, into);+ FfiConverterOptionalTypePreservedJson.write(value.probes, into);+ FfiConverterOptionalTypeOidcConfig.write(value.oidc, into);+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterOptionalTypeRuntimeKind.allocationSize(value.runtime) ++ FfiConverterOptionalString.allocationSize(value.runtimeClassName) ++ FfiConverterOptionalMapStringString.allocationSize(value.nodeSelector) ++ FfiConverterOptionalSequenceTypePreservedJson.allocationSize(+ value.tolerations,+ ) ++ FfiConverterOptionalSequenceString.allocationSize(value.command) ++ FfiConverterString.allocationSize(value.containerDiskImage) ++ FfiConverterOptionalString.allocationSize(value.imagePullSecret) ++ FfiConverterOptionalUInt32.allocationSize(value.cpuCores) ++ FfiConverterOptionalString.allocationSize(value.memory) ++ FfiConverterOptionalTypeFirmware.allocationSize(value.firmware) ++ FfiConverterOptionalTypePreservedJson.allocationSize(value.probes) ++ FfiConverterOptionalTypeOidcConfig.allocationSize(value.oidc)+ );+ }+ }+ return new FFIConverter();})();export type PoolSpec = {- replicas: number,- template: PoolTemplate,- autoscaling?: WarmPoolAutoscaling,- services?: Array<SandboxService>-}+ replicas: number;+ template: PoolTemplate;+ autoscaling?: WarmPoolAutoscaling;+ services?: Array<SandboxService>;+};/*** Generated factory for {@link PoolSpec} record objects.*/export const PoolSpec = (() => {- const defaults = () => ({- });- const create = (() => {- return uniffiCreateRecord<PoolSpec, ReturnType<typeof defaults>>(defaults);- })();- return Object.freeze({- create,- new: create,- defaults: () => Object.freeze(defaults()) as Partial<PoolSpec>,- equals(self_: PoolSpec, other: PoolSpec): boolean {-- return FfiConverterBool.lift(uniffiCaller.rustCall(- /*caller:*/ (callStatus) => {- return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_poolspec_uniffi_trait_eq_eq(- FfiConverterTypePoolSpec.lower(self_, nativeModule().rustbuffer_alloc),- FfiConverterTypePoolSpec.lower(other, nativeModule().rustbuffer_alloc),- callStatus);- },- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- ));- },- hashCode(self_: PoolSpec): bigint {-- return FfiConverterUInt64.lift(uniffiCaller.rustCall(- /*caller:*/ (callStatus) => {- return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_poolspec_uniffi_trait_hash(- FfiConverterTypePoolSpec.lower(self_, nativeModule().rustbuffer_alloc),- callStatus);- },- /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),- ));- },- });+ const defaults = () => ({});+ const create = (() => {+ return uniffiCreateRecord<PoolSpec, ReturnType<typeof defaults>>(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<PoolSpec>,+ equals(self_: PoolSpec, other: PoolSpec): boolean {+ return FfiConverterBool.lift(+ uniffiCaller.rustCall(+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_poolspec_uniffi_trait_eq_eq(+ FfiConverterTypePoolSpec.lower(+ self_,+ nativeModule().rustbuffer_alloc,+ ),+ FfiConverterTypePoolSpec.lower(+ other,+ nativeModule().rustbuffer_alloc,+ ),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ },+ hashCode(self_: PoolSpec): bigint {+ return FfiConverterUInt64.lift(+ uniffiCaller.rustCall(+ /*caller:*/ (callStatus) => {+ return nativeModule().ubrn_uniffi_cyclops_sdk_schema_fn_method_poolspec_uniffi_trait_hash(+ FfiConverterTypePoolSpec.lower(+ self_,+ nativeModule().rustbuffer_alloc,+ ),+ callStatus,+ );+ },+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ ),+ );+ },+ });})();const FfiConverterTypePoolSpec = (() => {- type TypeName = PoolSpec;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- return {- replicas: FfiConverterUInt32.read(from),- template: FfiConverterTypePoolTemplate.read(from),- autoscaling: FfiConverterOptionalTypeWarmPoolAutoscaling.read(from),- services: FfiConverterOptionalSequenceTypeSandboxService.read(from)- };- }- write(value: TypeName, into: RustBuffer): void {- FfiConverterUInt32.write(value.replicas, into);- FfiConverterTypePoolTemplate.write(value.template, into);- FfiConverterOptionalTypeWarmPoolAutoscaling.write(value.autoscaling, into);- FfiConverterOptionalSequenceTypeSandboxService.write(value.services, into);- }- allocationSize(value: TypeName): number {- return FfiConverterUInt32.allocationSize(value.replicas) +- FfiConverterTypePoolTemplate.allocationSize(value.template) +- FfiConverterOptionalTypeWarmPoolAutoscaling.allocationSize(value.autoscaling) +- FfiConverterOptionalSequenceTypeSandboxService.allocationSize(value.services);-- }- };- return new FFIConverter();+ type TypeName = PoolSpec;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ replicas: FfiConverterUInt32.read(from),+ template: FfiConverterTypePoolTemplate.read(from),+ autoscaling: FfiConverterOptionalTypeWarmPoolAutoscaling.read(from),+ services: FfiConverterOptionalSequenceTypeSandboxService.read(from),+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterUInt32.write(value.replicas, into);+ FfiConverterTypePoolTemplate.write(value.template, into);+ FfiConverterOptionalTypeWarmPoolAutoscaling.write(+ value.autoscaling,+ into,+ );+ FfiConverterOptionalSequenceTypeSandboxService.write(+ value.services,+ into,+ );+ }+ allocationSize(value: TypeName): number {+ return (+ FfiConverterUInt32.allocationSize(value.replicas) ++ FfiConverterTypePoolTemplate.allocationSize(value.template) ++ FfiConverterOptionalTypeWarmPoolAutoscaling.allocationSize(+ value.autoscaling,+ ) ++ FfiConverterOptionalSequenceTypeSandboxService.allocationSize(+ value.services,+ )+ );+ }+ }+ return new FFIConverter();})();-// Error type: JsonValueErrorexport enum JsonValueError_Tags {- Invalid = "Invalid"+ Invalid = "Invalid",}export const JsonValueError = (() => {+ type Invalid__interface = {+ tag: JsonValueError_Tags.Invalid;+ inner: Readonly<{ reason: string }>;+ };+ class Invalid_ extends UniffiError implements Invalid__interface {+ /**+ * @private+ * This field is private and should not be used, use `tag` instead.+ */+ readonly [uniffiTypeNameSymbol] = "JsonValueError";+ readonly tag = JsonValueError_Tags.Invalid;+ readonly inner: Readonly<{ reason: string }>;+ constructor(inner: { reason: string }) {+ super("JsonValueError", "Invalid");++ this.inner = Object.freeze(inner);+ }+ static new(inner: { reason: string }): Invalid_ {+ return new Invalid_(inner);+ }- type Invalid__interface = {- tag: JsonValueError_Tags.Invalid;- inner:-Readonly<{reason: string}>- };- class Invalid_ extends UniffiError implements Invalid__interface {- /**- * @private- * This field is private and should not be used, use `tag` instead.- */- readonly [uniffiTypeNameSymbol] = "JsonValueError";- readonly tag = JsonValueError_Tags.Invalid;- readonly inner:-Readonly<{reason: string}>;- constructor(-inner: {reason: string }) {- super("JsonValueError", "Invalid");-- this.inner = Object.freeze(inner);- }- static new(-inner: {reason: string }): Invalid_ {- return new Invalid_(inner);- }-- static instanceOf(obj: any): obj is Invalid_ {- return obj.tag === JsonValueError_Tags.Invalid;- }- static hasInner(obj: any): obj is Invalid_ {- return Invalid_.instanceOf(obj);- }-- static getInner(obj: Invalid_):-Readonly<{reason: string}> {- return obj.inner;- }-+ static instanceOf(obj: any): obj is Invalid_ {+ return obj.tag === JsonValueError_Tags.Invalid;+ }+ static hasInner(obj: any): obj is Invalid_ {+ return Invalid_.instanceOf(obj);}- function instanceOf(obj: any): obj is JsonValueError {- return obj[uniffiTypeNameSymbol] === "JsonValueError";+ static getInner(obj: Invalid_): Readonly<{ reason: string }> {+ return obj.inner;}+ }- return Object.freeze({- instanceOf,- Invalid: Invalid_- });+ function instanceOf(obj: any): obj is JsonValueError {+ return obj[uniffiTypeNameSymbol] === "JsonValueError";+ }+ return Object.freeze({+ instanceOf,+ Invalid: Invalid_,+ });})();-export type JsonValueError = InstanceType<- typeof JsonValueError['Invalid']->;+export type JsonValueError = InstanceType<(typeof JsonValueError)["Invalid"]>;// FfiConverter for enum JsonValueErrorconst FfiConverterTypeJsonValueError = (() => {- const ordinalConverter = FfiConverterInt32;- type TypeName = JsonValueError;- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {- read(from: RustBuffer): TypeName {- switch (ordinalConverter.read(from)) {- case 1: return new JsonValueError.Invalid({reason: FfiConverterString.read(from) });- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }- write(value: TypeName, into: RustBuffer): void {- switch (value.tag) {- case JsonValueError_Tags.Invalid: {- ordinalConverter.write(1, into);- const inner = value.inner;- FfiConverterString.write(inner.reason, into);- return;- }- default:- // Throwing from here means that JsonValueError_Tags hasn't matched an ordinal.- throw new UniffiInternalError.UnexpectedEnumCase();- }- }- allocationSize(value: TypeName): number {- switch (value.tag) {- case JsonValueError_Tags.Invalid: {- const inner = value.inner;- let size = ordinalConverter.allocationSize(1);- size += FfiConverterString.allocationSize(inner.reason);- return size;- }- default: throw new UniffiInternalError.UnexpectedEnumCase();- }- }+ const ordinalConverter = FfiConverterInt32;+ type TypeName = JsonValueError;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ switch (ordinalConverter.read(from)) {+ case 1:+ return new JsonValueError.Invalid({+ reason: FfiConverterString.read(from),+ });+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ write(value: TypeName, into: RustBuffer): void {+ switch (value.tag) {+ case JsonValueError_Tags.Invalid: {+ ordinalConverter.write(1, into);+ const inner = value.inner;+ FfiConverterString.write(inner.reason, into);+ return;+ }+ default:+ // Throwing from here means that JsonValueError_Tags hasn't matched an ordinal.+ throw new UniffiInternalError.UnexpectedEnumCase();+ }}- return new FFIConverter();+ allocationSize(value: TypeName): number {+ switch (value.tag) {+ case JsonValueError_Tags.Invalid: {+ const inner = value.inner;+ let size = ordinalConverter.allocationSize(1);+ size += FfiConverterString.allocationSize(inner.reason);+ return size;+ }+ default:+ throw new UniffiInternalError.UnexpectedEnumCase();+ }+ }+ }+ return new FFIConverter();})();// FfiConverter for string | undefined@@ -1383,62 +1556,95 @@ const FfiConverterOptionalBoolean = new FfiConverterOptional(FfiConverterBool);const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);// FfiConverter for ClaimLifecycle | undefined-const FfiConverterOptionalTypeClaimLifecycle = new FfiConverterOptional(FfiConverterTypeClaimLifecycle);+const FfiConverterOptionalTypeClaimLifecycle = new FfiConverterOptional(+ FfiConverterTypeClaimLifecycle,+);// FfiConverter for Array<OsGymSandboxClaimCondition>-const FfiConverterSequenceTypeOSGymSandboxClaimCondition = new FfiConverterArray(FfiConverterTypeOSGymSandboxClaimCondition);+const FfiConverterSequenceTypeOSGymSandboxClaimCondition =+ new FfiConverterArray(FfiConverterTypeOSGymSandboxClaimCondition);// FfiConverter for Array<OsGymSandboxClaimCondition> | undefined-const FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition = new FfiConverterOptional(FfiConverterSequenceTypeOSGymSandboxClaimCondition);+const FfiConverterOptionalSequenceTypeOSGymSandboxClaimCondition =+ new FfiConverterOptional(FfiConverterSequenceTypeOSGymSandboxClaimCondition);// FfiConverter for OsGymSandboxClaimSandbox | undefined-const FfiConverterOptionalTypeOSGymSandboxClaimSandbox = new FfiConverterOptional(FfiConverterTypeOSGymSandboxClaimSandbox);+const FfiConverterOptionalTypeOSGymSandboxClaimSandbox =+ new FfiConverterOptional(FfiConverterTypeOSGymSandboxClaimSandbox);// FfiConverter for Array<string>const FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);// FfiConverter for Array<string> | undefined-const FfiConverterOptionalSequenceString = new FfiConverterOptional(FfiConverterSequenceString);+const FfiConverterOptionalSequenceString = new FfiConverterOptional(+ FfiConverterSequenceString,+);// FfiConverter for RuntimeKind | undefined-const FfiConverterOptionalTypeRuntimeKind = new FfiConverterOptional(FfiConverterTypeRuntimeKind);+const FfiConverterOptionalTypeRuntimeKind = new FfiConverterOptional(+ FfiConverterTypeRuntimeKind,+);// FfiConverter for Map<string, string>-const FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);+const FfiConverterMapStringString = new FfiConverterMap(+ FfiConverterString,+ FfiConverterString,+);// FfiConverter for Map<string, string> | undefined-const FfiConverterOptionalMapStringString = new FfiConverterOptional(FfiConverterMapStringString);+const FfiConverterOptionalMapStringString = new FfiConverterOptional(+ FfiConverterMapStringString,+);// FfiConverter for Array<PreservedJsonLike>-const FfiConverterSequenceTypePreservedJson = new FfiConverterArray(FfiConverterTypePreservedJson);+const FfiConverterSequenceTypePreservedJson = new FfiConverterArray(+ FfiConverterTypePreservedJson,+);// FfiConverter for Array<PreservedJsonLike> | undefined-const FfiConverterOptionalSequenceTypePreservedJson = new FfiConverterOptional(FfiConverterSequenceTypePreservedJson);+const FfiConverterOptionalSequenceTypePreservedJson = new FfiConverterOptional(+ FfiConverterSequenceTypePreservedJson,+);// FfiConverter for ImagePullPolicy | undefined-const FfiConverterOptionalTypeImagePullPolicy = new FfiConverterOptional(FfiConverterTypeImagePullPolicy);+const FfiConverterOptionalTypeImagePullPolicy = new FfiConverterOptional(+ FfiConverterTypeImagePullPolicy,+);// FfiConverter for Firmware | undefined-const FfiConverterOptionalTypeFirmware = new FfiConverterOptional(FfiConverterTypeFirmware);+const FfiConverterOptionalTypeFirmware = new FfiConverterOptional(+ FfiConverterTypeFirmware,+);// FfiConverter for PreservedJsonLike | undefined-const FfiConverterOptionalTypePreservedJson = new FfiConverterOptional(FfiConverterTypePreservedJson);+const FfiConverterOptionalTypePreservedJson = new FfiConverterOptional(+ FfiConverterTypePreservedJson,+);// FfiConverter for ServiceProtocol | undefined-const FfiConverterOptionalTypeServiceProtocol = new FfiConverterOptional(FfiConverterTypeServiceProtocol);+const FfiConverterOptionalTypeServiceProtocol = new FfiConverterOptional(+ FfiConverterTypeServiceProtocol,+);// FfiConverter for Array<SandboxService>-const FfiConverterSequenceTypeSandboxService = new FfiConverterArray(FfiConverterTypeSandboxService);+const FfiConverterSequenceTypeSandboxService = new FfiConverterArray(+ FfiConverterTypeSandboxService,+);// FfiConverter for Array<SandboxService> | undefined-const FfiConverterOptionalSequenceTypeSandboxService = new FfiConverterOptional(FfiConverterSequenceTypeSandboxService);+const FfiConverterOptionalSequenceTypeSandboxService = new FfiConverterOptional(+ FfiConverterSequenceTypeSandboxService,+);// FfiConverter for OidcConfig | undefined-const FfiConverterOptionalTypeOidcConfig = new FfiConverterOptional(FfiConverterTypeOidcConfig);+const FfiConverterOptionalTypeOidcConfig = new FfiConverterOptional(+ FfiConverterTypeOidcConfig,+);// FfiConverter for WarmPoolAutoscaling | undefined-const FfiConverterOptionalTypeWarmPoolAutoscaling = new FfiConverterOptional(FfiConverterTypeWarmPoolAutoscaling);-+const FfiConverterOptionalTypeWarmPoolAutoscaling = new FfiConverterOptional(+ FfiConverterTypeWarmPoolAutoscaling,+);/*** This should be called before anything else.@@ -1451,21 +1657,34 @@ const FfiConverterOptionalTypeWarmPoolAutoscaling = new FfiConverterOptional(Ffi* It also initializes the machinery to enable Rust to talk back to Javascript.*/function uniffiEnsureInitialized() {- // Get the bindings contract version from our ComponentInterface- const bindingsContractVersion = 30;- // Get the scaffolding contract version by calling the into the dylib- const scaffoldingContractVersion = nativeModule().ubrn_ffi_cyclops_sdk_schema_uniffi_contract_version();- if (bindingsContractVersion !== scaffoldingContractVersion) {- throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json() !== 24064) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json");- }- if (nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json() !== 8252) {- throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json");- }-- }+ // Get the bindings contract version from our ComponentInterface+ const bindingsContractVersion = 30;+ // Get the scaffolding contract version by calling the into the dylib+ const scaffoldingContractVersion =+ nativeModule().ubrn_ffi_cyclops_sdk_schema_uniffi_contract_version();+ if (bindingsContractVersion !== scaffoldingContractVersion) {+ throw new UniffiInternalError.ContractVersionMismatch(+ scaffoldingContractVersion,+ bindingsContractVersion,+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json() !==+ 24064+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json",+ );+ }+ if (+ nativeModule().ubrn_uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json() !==+ 8252+ ) {+ throw new UniffiInternalError.ApiChecksumMismatch(+ "uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json",+ );+ }+}export default Object.freeze({initialize: uniffiEnsureInitialized,@@ -1494,5 +1713,5 @@ export default Object.freeze({FfiConverterTypeServiceProtocol,FfiConverterTypeVmTemplate,FfiConverterTypeWarmPoolAutoscaling,- }-});\ No newline at end of file+ },+});diff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/ubrn.config.yaml b/libs/fleet/sdk-bindings/ts-uniffi-browser/ubrn.config.yamlnew file mode 100644index 0000000000..9ab2fc6232--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/ubrn.config.yaml@@ -0,0 +1,10 @@+rust:+ directory: ../..+ manifestPath: sdk/Cargo.toml+bindings:+ cpp: cpp+ ts: ts+web:+ manifestPath: rust_modules/wasm/Cargo.toml+ tsBindings: ts+ entrypoint: ts/index.web.tsdiff --git a/libs/fleet/sdk-bindings/ts-uniffi-browser/vite.config.ts b/libs/fleet/sdk-bindings/ts-uniffi-browser/vite.config.tsnew file mode 100644index 0000000000..f984710ff2--- /dev/null+++ b/libs/fleet/sdk-bindings/ts-uniffi-browser/vite.config.ts@@ -0,0 +1,20 @@+import { defineConfig } from "vite"++export default defineConfig({+ root: "examples",+ assetsInclude: ["**/*.wasm"],+ build: {+ outDir: "dist",+ emptyOutDir: true,+ rollupOptions: {+ output: {+ entryFileNames: "browser.js",+ },+ },+ },+ server: {+ fs: {+ allow: [".."],+ },+ },+})diff --git a/libs/fleet/sdk/Cargo.toml b/libs/fleet/sdk/Cargo.tomlindex 433d4f81e5..3140712bcd 100644--- a/libs/fleet/sdk/Cargo.toml+++ b/libs/fleet/sdk/Cargo.toml@@ -19,7 +19,14 @@ tokio = { workspace = true, features = ["sync"] }uniffi.workspace = trueurl.workspace = true+[target.'cfg(target_arch = "wasm32")'.dependencies]+gloo-timers = { version = "0.3", features = ["futures"] }+js-sys = "0.3"+wasm-bindgen = "0.2"+wasm-bindgen-futures = "0.4"+web-sys = { version = "0.3", features = ["Headers", "Request", "RequestInit", "Response", "Window"] }+[dev-dependencies]camino = "1.0"-tokio.workspace = true+tokio = { workspace = true, features = ["rt-multi-thread"] }uniffi = { workspace = true, features = ["bindgen"] }diff --git a/libs/fleet/sdk/src/claims.rs b/libs/fleet/sdk/src/claims.rsindex e97596b1bc..2fb2c87c68 100644--- a/libs/fleet/sdk/src/claims.rs+++ b/libs/fleet/sdk/src/claims.rs@@ -3,9 +3,14 @@ use crate::{ResourceMetadata, Sandbox, SdkError, routes,};use cyclops_sdk_schema::{ClaimSpec, SandboxTemplateRef};+#[cfg(not(target_arch = "wasm32"))]use futures_timer::Delay;+#[cfg(target_arch = "wasm32")]+use gloo_timers::future::TimeoutFuture;use serde::{Deserialize, Serialize, de::DeserializeOwned};-use std::{sync::Arc, time::Duration};+use std::sync::Arc;+#[cfg(not(target_arch = "wasm32"))]+use std::time::Duration;use url::Url;const JSON_CONTENT_TYPE: &str = "application/json";@@ -15,6 +20,14 @@ struct ResourceList<T> {items: Vec<T>,}+async fn wait_for_claim_poll_interval(interval_ms: u64) {+ #[cfg(target_arch = "wasm32")]+ TimeoutFuture::new(interval_ms.min(u64::from(u32::MAX)) as u32).await;++ #[cfg(not(target_arch = "wasm32"))]+ Delay::new(Duration::from_millis(interval_ms)).await;+}+#[uniffi::export]impl CyclopsClient {pub async fn create_claim(@@ -122,7 +135,7 @@ impl CyclopsClient {});}if attempt + 1 < self.claim_poll_limit() {- Delay::new(Duration::from_millis(self.claim_poll_interval_ms())).await;+ wait_for_claim_poll_interval(self.claim_poll_interval_ms()).await;}}Err(SdkError::ClaimTimeout)diff --git a/libs/fleet/sdk/src/client.rs b/libs/fleet/sdk/src/client.rsindex 5e4c6ff74c..c0b5fc9d74 100644--- a/libs/fleet/sdk/src/client.rs+++ b/libs/fleet/sdk/src/client.rs@@ -1,5 +1,6 @@use crate::{- CyclopsConfiguration, HttpClient, HttpRequest, HttpResponse, SdkError,+ AccessTokenProvider, CyclopsConfiguration, CyclopsTokenProviderConfiguration, HttpClient,+ HttpRequest, HttpResponse, SdkError,transport::{AuthenticatedRequestClass, Transport},};use std::{@@ -9,7 +10,9 @@ use std::{atomic::{AtomicU64, Ordering},},};-use tokio::sync::{Mutex as AsyncMutex, OwnedMutexGuard};+use tokio::sync::Mutex as AsyncMutex;+#[cfg(not(target_arch = "wasm32"))]+use tokio::sync::OwnedMutexGuard;use url::Url;#[derive(uniffi::Object)]@@ -27,9 +30,13 @@ struct NamespaceLifecycleLocks {}pub(crate) struct NamespaceLifecycleGuard {+ #[cfg(not(target_arch = "wasm32"))]guard: Option<OwnedMutexGuard<()>>,+ #[cfg(not(target_arch = "wasm32"))]lock: Arc<AsyncMutex<()>>,+ #[cfg(not(target_arch = "wasm32"))]locks: Arc<NamespaceLifecycleLocks>,+ #[cfg(not(target_arch = "wasm32"))]namespace: String,}@@ -58,6 +65,82 @@ impl CyclopsClient {transport,}))}++ #[uniffi::constructor]+ pub fn connect_with_access_token_provider(+ configuration: CyclopsTokenProviderConfiguration,+ token_provider: Arc<dyn AccessTokenProvider>,+ http_client: Arc<dyn HttpClient>,+ ) -> Result<Arc<Self>, SdkError> {+ validate_token_provider_configuration(&configuration)?;+ let base_url =+ Url::parse(&configuration.base_url).map_err(|error| SdkError::Configuration {+ reason: format!("base_url must be a valid URL: {error}"),+ })?;+ let transport =+ Transport::new_with_access_token_provider(&configuration, token_provider, http_client)?;++ Ok(Arc::new(Self {+ base_url,+ claim_sequence: AtomicU64::new(0),+ claim_poll_interval_ms: configuration.claim_poll_interval_ms,+ claim_poll_limit: configuration.claim_poll_limit,+ lifecycle_locks: Arc::new(NamespaceLifecycleLocks {+ namespaces: Mutex::new(HashMap::new()),+ }),+ transport,+ }))+ }++ #[uniffi::constructor]+ pub fn connect_with_access_token(+ configuration: CyclopsTokenProviderConfiguration,+ access_token: String,+ http_client: Arc<dyn HttpClient>,+ ) -> Result<Arc<Self>, SdkError> {+ validate_token_provider_configuration(&configuration)?;+ let base_url =+ Url::parse(&configuration.base_url).map_err(|error| SdkError::Configuration {+ reason: format!("base_url must be a valid URL: {error}"),+ })?;+ let transport =+ Transport::new_with_access_token(&configuration, access_token, http_client)?;++ Ok(Arc::new(Self {+ base_url,+ claim_sequence: AtomicU64::new(0),+ claim_poll_interval_ms: configuration.claim_poll_interval_ms,+ claim_poll_limit: configuration.claim_poll_limit,+ lifecycle_locks: Arc::new(NamespaceLifecycleLocks {+ namespaces: Mutex::new(HashMap::new()),+ }),+ transport,+ }))+ }++ #[uniffi::constructor]+ pub fn connect_browser_with_access_token(+ configuration: CyclopsTokenProviderConfiguration,+ access_token: String,+ ) -> Result<Arc<Self>, SdkError> {+ #[cfg(target_arch = "wasm32")]+ {+ return Self::connect_with_access_token(+ configuration,+ access_token,+ Arc::new(crate::transport::BrowserHttpClient),+ );+ }++ #[cfg(not(target_arch = "wasm32"))]+ {+ let _ = (configuration, access_token);+ Err(SdkError::Configuration {+ reason: "connect_browser_with_access_token is only available for wasm32 targets"+ .into(),+ })+ }+ }}impl CyclopsClient {@@ -84,6 +167,7 @@ impl CyclopsClient {self.claim_poll_limit}+ #[cfg(not(target_arch = "wasm32"))]pub(crate) async fn namespace_lifecycle_guard(&self,namespace: &str,@@ -114,6 +198,14 @@ impl CyclopsClient {}}+ #[cfg(target_arch = "wasm32")]+ pub(crate) async fn namespace_lifecycle_guard(+ &self,+ _namespace: &str,+ ) -> NamespaceLifecycleGuard {+ NamespaceLifecycleGuard {}+ }+pub async fn execute_authenticated(&self,request: HttpRequest,@@ -134,15 +226,40 @@ impl CyclopsClient {}fn validate_configuration(configuration: &CyclopsConfiguration) -> Result<(), SdkError> {- validate_http_url("base_url", &configuration.base_url)?;validate_http_url("token_url", &configuration.token_url)?;+ validate_client_configuration(+ &configuration.base_url,+ configuration.pool_poll_interval_ms,+ configuration.pool_poll_limit,+ configuration.claim_poll_interval_ms,+ configuration.claim_poll_limit,+ )+}++fn validate_token_provider_configuration(+ configuration: &CyclopsTokenProviderConfiguration,+) -> Result<(), SdkError> {+ validate_client_configuration(+ &configuration.base_url,+ configuration.pool_poll_interval_ms,+ configuration.pool_poll_limit,+ configuration.claim_poll_interval_ms,+ configuration.claim_poll_limit,+ )+}++fn validate_client_configuration(+ base_url: &str,+ pool_poll_interval_ms: u64,+ pool_poll_limit: u32,+ claim_poll_interval_ms: u64,+ claim_poll_limit: u32,+) -> Result<(), SdkError> {+ validate_http_url("base_url", base_url)?;for (name, value) in [- ("pool_poll_interval_ms", configuration.pool_poll_interval_ms),- (- "claim_poll_interval_ms",- configuration.claim_poll_interval_ms,- ),+ ("pool_poll_interval_ms", pool_poll_interval_ms),+ ("claim_poll_interval_ms", claim_poll_interval_ms),] {if value == 0 {return Err(SdkError::Configuration {@@ -152,8 +269,8 @@ fn validate_configuration(configuration: &CyclopsConfiguration) -> Result<(), Sd}for (name, value) in [- ("pool_poll_limit", configuration.pool_poll_limit),- ("claim_poll_limit", configuration.claim_poll_limit),+ ("pool_poll_limit", pool_poll_limit),+ ("claim_poll_limit", claim_poll_limit),] {if value == 0 {return Err(SdkError::Configuration {@@ -179,6 +296,7 @@ fn validate_http_url(field: &str, value: &str) -> Result<(), SdkError> {Ok(())}+#[cfg(not(target_arch = "wasm32"))]impl Drop for NamespaceLifecycleGuard {fn drop(&mut self) {drop(self.guard.take());diff --git a/libs/fleet/sdk/src/error.rs b/libs/fleet/sdk/src/error.rsindex ca365380f4..3e7754a0b2 100644--- a/libs/fleet/sdk/src/error.rs+++ b/libs/fleet/sdk/src/error.rs@@ -8,6 +8,12 @@ pub enum HttpError {Transport { reason: String },}+#[derive(Debug, Error, uniffi::Error)]+pub enum AccessTokenProviderError {+ #[error("access token unavailable: {reason}")]+ Failed { reason: String },+}+#[derive(Debug, Error, uniffi::Error)]pub enum SdkError {#[error("invalid configuration: {reason}")]diff --git a/libs/fleet/sdk/src/lib.rs b/libs/fleet/sdk/src/lib.rsindex 5bc0468d7c..ef9a59c504 100644--- a/libs/fleet/sdk/src/lib.rs+++ b/libs/fleet/sdk/src/lib.rs@@ -8,12 +8,15 @@ mod transport;mod types;pub use client::CyclopsClient;-pub use error::{HttpError, MAX_STATUS_BODY_BYTES, SdkError, bounded_body};+pub use error::{+ AccessTokenProviderError, HttpError, MAX_STATUS_BODY_BYTES, SdkError, bounded_body,+};pub use routes::validate_dns_label;-pub use transport::HttpClient;+pub use transport::{AccessTokenProvider, HttpClient};pub use types::{Claim, CreateClaimRequest, CreatePoolRequest, CyclopsConfiguration, CyclopsCredentials,- HttpHeader, HttpRequest, HttpResponse, Pool, ResourceMetadata, Sandbox,+ CyclopsTokenProviderConfiguration, HttpHeader, HttpRequest, HttpResponse, Pool,+ ResourceMetadata, Sandbox,};uniffi::setup_scaffolding!("cyclops_sdk");diff --git a/libs/fleet/sdk/src/transport.rs b/libs/fleet/sdk/src/transport.rsindex f6b22ad300..f165ff1ad1 100644--- a/libs/fleet/sdk/src/transport.rs+++ b/libs/fleet/sdk/src/transport.rs@@ -1,4 +1,7 @@-use crate::{CyclopsConfiguration, HttpError, HttpHeader, HttpRequest, HttpResponse, SdkError};+use crate::{+ AccessTokenProviderError, CyclopsConfiguration, CyclopsTokenProviderConfiguration, HttpError,+ HttpHeader, HttpRequest, HttpResponse, SdkError,+};use serde::Deserialize;use std::{sync::Arc,@@ -18,24 +21,101 @@ pub(crate) enum AuthenticatedRequestClass {}#[uniffi::export(with_foreign)]-#[async_trait::async_trait]+#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]+#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]pub trait HttpClient: Send + Sync {async fn execute(&self, request: HttpRequest) -> Result<HttpResponse, HttpError>;}+#[cfg(target_arch = "wasm32")]+pub(crate) struct BrowserHttpClient;++#[cfg(target_arch = "wasm32")]+#[async_trait::async_trait(?Send)]+impl HttpClient for BrowserHttpClient {+ async fn execute(&self, request: HttpRequest) -> Result<HttpResponse, HttpError> {+ use wasm_bindgen::JsCast;+ use wasm_bindgen_futures::JsFuture;++ let init = web_sys::RequestInit::new();+ init.set_method(&request.method);+ if let Some(body) = request.body {+ let body = js_sys::Uint8Array::from(body.as_slice());+ init.set_body(&body.into());+ }++ let browser_request = web_sys::Request::new_with_str_and_init(&request.url, &init)+ .map_err(browser_transport_error)?;+ let headers = browser_request.headers();+ for header in request.headers {+ headers+ .set(&header.name, &header.value)+ .map_err(browser_transport_error)?;+ }++ let window = web_sys::window().ok_or_else(|| HttpError::Transport {+ reason: "browser window is unavailable".into(),+ })?;+ let response = JsFuture::from(window.fetch_with_request(&browser_request))+ .await+ .map_err(browser_transport_error)?+ .dyn_into::<web_sys::Response>()+ .map_err(browser_transport_error)?;+ let body = JsFuture::from(response.array_buffer().map_err(browser_transport_error)?)+ .await+ .map_err(browser_transport_error)?;++ Ok(HttpResponse {+ status: response.status(),+ headers: vec![],+ body: js_sys::Uint8Array::new(&body).to_vec(),+ })+ }+}++#[cfg(target_arch = "wasm32")]+fn browser_transport_error(error: wasm_bindgen::JsValue) -> HttpError {+ let reason = error+ .as_string()+ .unwrap_or_else(|| format!("browser fetch failed: {error:?}"));+ HttpError::Transport { reason }+}++#[uniffi::export(with_foreign)]+#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]+#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]+pub trait AccessTokenProvider: Send + Sync {+ async fn get_access_token(+ &self,+ force_refresh: bool,+ ) -> Result<String, AccessTokenProviderError>;+}+pub(crate) struct Transport {base_origin: Origin,- token_url: String,- client_id: String,- client_secret: String,+ authentication: Authentication,http_client: Arc<dyn HttpClient>,- access_token: Mutex<Option<AccessToken>>,+}++enum Authentication {+ ClientCredentials {+ token_url: String,+ client_id: String,+ client_secret: String,+ cached: Mutex<Option<AccessToken>>,+ },+ TokenProvider {+ provider: Arc<dyn AccessTokenProvider>,+ },+ StaticAccessToken {+ value: String,+ },}#[derive(Clone)]struct AccessToken {value: String,- expires_at: Instant,+ expires_at: Option<Instant>,generation: Arc<TokenGeneration>,}@@ -57,11 +137,46 @@ impl Transport {) -> Result<Self, SdkError> {Ok(Self {base_origin: Origin::from_url(&configuration.base_url)?,- token_url: configuration.token_url.clone(),- client_id: configuration.client_id().to_owned(),- client_secret: configuration.client_secret().to_owned(),+ authentication: Authentication::ClientCredentials {+ token_url: configuration.token_url.clone(),+ client_id: configuration.client_id().to_owned(),+ client_secret: configuration.client_secret().to_owned(),+ cached: Mutex::new(None),+ },+ http_client,+ })+ }++ pub(crate) fn new_with_access_token_provider(+ configuration: &CyclopsTokenProviderConfiguration,+ provider: Arc<dyn AccessTokenProvider>,+ http_client: Arc<dyn HttpClient>,+ ) -> Result<Self, SdkError> {+ Ok(Self {+ base_origin: Origin::from_url(&configuration.base_url)?,+ authentication: Authentication::TokenProvider { provider },+ http_client,+ })+ }++ pub(crate) fn new_with_access_token(+ configuration: &CyclopsTokenProviderConfiguration,+ access_token: String,+ http_client: Arc<dyn HttpClient>,+ ) -> Result<Self, SdkError> {+ let value = access_token.trim();+ if value.is_empty() {+ return Err(SdkError::Token {+ reason: "access token must not be empty".into(),+ });+ }++ Ok(Self {+ base_origin: Origin::from_url(&configuration.base_url)?,+ authentication: Authentication::StaticAccessToken {+ value: value.into(),+ },http_client,- access_token: Mutex::new(None),})}@@ -131,45 +246,100 @@ impl Transport {}async fn access_token(&self) -> Result<AccessToken, SdkError> {- let mut cached = self.access_token.lock().await;- if let Some(token) = cached.as_ref().filter(|token| token.is_valid()) {- return Ok(token.clone());- }+ match &self.authentication {+ Authentication::ClientCredentials { cached, .. } => {+ let mut cached = cached.lock().await;+ if let Some(token) = cached.as_ref().filter(|token| token.is_valid()) {+ return Ok(token.clone());+ }- let token = self.acquire_token().await?;- *cached = Some(token.clone());- Ok(token)+ let token = self.acquire_client_credentials_token().await?;+ *cached = Some(token.clone());+ Ok(token)+ }+ Authentication::TokenProvider { provider } => {+ self.provider_token(provider, false).await+ }+ Authentication::StaticAccessToken { value } => Ok(AccessToken {+ value: value.clone(),+ expires_at: None,+ generation: Arc::new(TokenGeneration { _identity: 0 }),+ }),+ }}async fn refresh_after_unauthorized(&self,used_token: &AccessToken,) -> Result<AccessToken, SdkError> {- let mut cached = self.access_token.lock().await;- match cached.as_ref() {- Some(token) if !token.is_same_generation(used_token) && token.is_valid() => {- return Ok(token.clone());+ match &self.authentication {+ Authentication::ClientCredentials { cached, .. } => {+ let mut cached = cached.lock().await;+ match cached.as_ref() {+ Some(token) if !token.is_same_generation(used_token) && token.is_valid() => {+ return Ok(token.clone());+ }+ Some(token) if token.is_same_generation(used_token) => *cached = None,+ _ => {}+ }++ let token = self.acquire_client_credentials_token().await?;+ *cached = Some(token.clone());+ Ok(token)}- Some(token) if token.is_same_generation(used_token) => *cached = None,- _ => {}+ Authentication::TokenProvider { provider } => self.provider_token(provider, true).await,+ Authentication::StaticAccessToken { .. } => Err(SdkError::Token {+ reason: "static access token was rejected; create a new client with a fresh token"+ .into(),+ }),}+ }- let token = self.acquire_token().await?;- *cached = Some(token.clone());- Ok(token)+ async fn provider_token(+ &self,+ provider: &Arc<dyn AccessTokenProvider>,+ force_refresh: bool,+ ) -> Result<AccessToken, SdkError> {+ let value = provider+ .get_access_token(force_refresh)+ .await+ .map_err(|error| SdkError::Token {+ reason: error.to_string(),+ })?;+ let value = value.trim();+ if value.is_empty() {+ return Err(SdkError::Token {+ reason: "access-token provider returned an empty token".into(),+ });+ }++ Ok(AccessToken {+ value: value.into(),+ expires_at: Some(Instant::now()),+ generation: Arc::new(TokenGeneration { _identity: 0 }),+ })}- async fn acquire_token(&self) -> Result<AccessToken, SdkError> {+ async fn acquire_client_credentials_token(&self) -> Result<AccessToken, SdkError> {+ let Authentication::ClientCredentials {+ token_url,+ client_id,+ client_secret,+ ..+ } = &self.authentication+ else {+ unreachable!("client-credentials token acquisition requires client credentials")+ };let body = url::form_urlencoded::Serializer::new(String::new()).append_pair("grant_type", "client_credentials")- .append_pair("client_id", &self.client_id)- .append_pair("client_secret", &self.client_secret)+ .append_pair("client_id", client_id)+ .append_pair("client_secret", client_secret).finish();let response = self.http_client.execute(HttpRequest {method: "POST".into(),- url: self.token_url.clone(),+ url: token_url.clone(),headers: vec![HttpHeader {name: "accept".into(),@@ -207,7 +377,7 @@ impl Transport {.unwrap_or_else(Instant::now);Ok(AccessToken {value: token.access_token,- expires_at,+ expires_at: Some(expires_at),generation: Arc::new(TokenGeneration { _identity: 0 }),})}@@ -223,9 +393,11 @@ impl AccessToken {}fn is_valid(&self) -> bool {- self.expires_at- .checked_sub(TOKEN_EXPIRY_SKEW)- .is_some_and(|refresh_at| Instant::now() < refresh_at)+ self.expires_at.is_none_or(|expires_at| {+ expires_at+ .checked_sub(TOKEN_EXPIRY_SKEW)+ .is_some_and(|refresh_at| Instant::now() < refresh_at)+ })}}diff --git a/libs/fleet/sdk/src/types.rs b/libs/fleet/sdk/src/types.rsindex f49c76d262..6951ef33ec 100644--- a/libs/fleet/sdk/src/types.rs+++ b/libs/fleet/sdk/src/types.rs@@ -67,6 +67,15 @@ impl CyclopsConfiguration {}}+#[derive(Clone, Debug, uniffi::Record)]+pub struct CyclopsTokenProviderConfiguration {+ pub base_url: String,+ pub pool_poll_interval_ms: u64,+ pub pool_poll_limit: u32,+ pub claim_poll_interval_ms: u64,+ pub claim_poll_limit: u32,+}+#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, uniffi::Record)]pub struct ResourceMetadata {pub namespace: String,diff --git a/libs/fleet/sdk/tests/oauth.rs b/libs/fleet/sdk/tests/oauth.rsindex 9d0b5df539..b0b34d8f90 100644--- a/libs/fleet/sdk/tests/oauth.rs+++ b/libs/fleet/sdk/tests/oauth.rs@@ -1,11 +1,13 @@mod support;use cyclops_sdk::{- CyclopsClient, CyclopsConfiguration, CyclopsCredentials, HttpError, HttpHeader, HttpRequest,+ AccessTokenProvider, AccessTokenProviderError, CyclopsClient, CyclopsConfiguration,+ CyclopsCredentials, CyclopsTokenProviderConfiguration, HttpError, HttpHeader, HttpRequest,HttpResponse, SdkError,};-use std::sync::Arc;+use std::{collections::VecDeque, sync::Arc};use support::ScriptedHttpClient;+use tokio::sync::Mutex;const BASE_URL: &str = "https://cyclops.example:8443/api";const TOKEN_URL: &str = "https://identity.example/oauth/token";@@ -208,6 +210,77 @@ async fn refreshes_once_after_unauthorized() {assert_bearer(&requests[3], "token-b");}+#[tokio::test]+async fn provider_token_is_used_without_calling_the_token_endpoint() {+ let http = Arc::new(ScriptedHttpClient::new([Ok(response(200, b"ok"))]));+ let provider = Arc::new(ScriptedAccessTokenProvider::new([Ok(+ "browser-token".into()+ )]));+ let client = provider_client(Arc::clone(&http), provider);++ assert_eq!(+ client+ .execute_authenticated(request("https://cyclops.example:8443/api/pools"))+ .await+ .unwrap()+ .body,+ b"ok"+ );++ let requests = http.requests().await;+ assert_eq!(requests.len(), 1);+ assert_bearer(&requests[0], "browser-token");+}++#[tokio::test]+async fn provider_is_forced_to_refresh_once_after_a_control_plane_401() {+ let http = Arc::new(ScriptedHttpClient::new([+ Ok(response(401, b"expired")),+ Ok(response(200, b"ok")),+ ]));+ let provider = Arc::new(ScriptedAccessTokenProvider::new([+ Ok("browser-token-a".into()),+ Ok("browser-token-b".into()),+ ]));+ let client = provider_client(Arc::clone(&http), Arc::clone(&provider));++ assert_eq!(+ client+ .execute_authenticated(request("https://cyclops.example:8443/api/pools"))+ .await+ .unwrap()+ .body,+ b"ok"+ );++ assert_eq!(provider.refresh_requests().await, vec![false, true]);+ let requests = http.requests().await;+ assert_eq!(requests.len(), 2);+ assert_bearer(&requests[0], "browser-token-a");+ assert_bearer(&requests[1], "browser-token-b");+}++#[tokio::test]+async fn provider_error_and_empty_token_are_reported_as_token_errors() {+ let provider_error = Arc::new(ScriptedAccessTokenProvider::new([Err(+ AccessTokenProviderError::Failed {+ reason: "browser session expired".into(),+ },+ )]));+ let error = provider_client(Arc::new(ScriptedHttpClient::new([])), provider_error)+ .execute_authenticated(request("https://cyclops.example:8443/api/pools"))+ .await+ .unwrap_err();+ assert!(matches!(error, SdkError::Token { .. }));++ let empty_token = Arc::new(ScriptedAccessTokenProvider::new([Ok(" \n\t".into())]));+ let error = provider_client(Arc::new(ScriptedHttpClient::new([])), empty_token)+ .execute_authenticated(request("https://cyclops.example:8443/api/pools"))+ .await+ .unwrap_err();+ assert!(matches!(error, SdkError::Token { .. }));+}+#[tokio::test]async fn does_not_retry_a_second_unauthorized() {let http = Arc::new(ScriptedHttpClient::new([@@ -292,6 +365,57 @@ fn client(http: Arc<ScriptedHttpClient>) -> Arc<CyclopsClient> {.unwrap()}+fn provider_client(+ http: Arc<ScriptedHttpClient>,+ provider: Arc<ScriptedAccessTokenProvider>,+) -> Arc<CyclopsClient> {+ CyclopsClient::connect_with_access_token_provider(+ CyclopsTokenProviderConfiguration {+ base_url: BASE_URL.into(),+ pool_poll_interval_ms: 1,+ pool_poll_limit: 1,+ claim_poll_interval_ms: 1,+ claim_poll_limit: 1,+ },+ provider,+ http,+ )+ .unwrap()+}++struct ScriptedAccessTokenProvider {+ values: Mutex<VecDeque<Result<String, AccessTokenProviderError>>>,+ refresh_requests: Mutex<Vec<bool>>,+}++impl ScriptedAccessTokenProvider {+ fn new(values: impl IntoIterator<Item = Result<String, AccessTokenProviderError>>) -> Self {+ Self {+ values: Mutex::new(values.into_iter().collect()),+ refresh_requests: Mutex::new(Vec::new()),+ }+ }++ async fn refresh_requests(&self) -> Vec<bool> {+ self.refresh_requests.lock().await.clone()+ }+}++#[async_trait::async_trait]+impl AccessTokenProvider for ScriptedAccessTokenProvider {+ async fn get_access_token(+ &self,+ force_refresh: bool,+ ) -> Result<String, AccessTokenProviderError> {+ self.refresh_requests.lock().await.push(force_refresh);+ self.values+ .lock()+ .await+ .pop_front()+ .expect("access-token provider called more than scripted")+ }+}+fn request(url: &str) -> HttpRequest {HttpRequest {method: "GET".into(),@@ -346,3 +470,52 @@ fn assert_bearer(request: &HttpRequest, token: &str) {format!("Bearer {token}"));}++#[tokio::test]+async fn static_access_token_is_used_without_token_provider_callback() {+ let http = Arc::new(ScriptedHttpClient::new([Ok(response(200, b"ok"))]));+ let client = static_token_client(Arc::clone(&http), "browser-token");++ assert_eq!(+ client+ .execute_authenticated(request("https://cyclops.example:8443/api/pools"))+ .await+ .unwrap()+ .body,+ b"ok"+ );++ let requests = http.requests().await;+ assert_eq!(requests.len(), 1);+ assert_bearer(&requests[0], "browser-token");+}++fn static_token_client(http: Arc<ScriptedHttpClient>, access_token: &str) -> Arc<CyclopsClient> {+ CyclopsClient::connect_with_access_token(+ CyclopsTokenProviderConfiguration {+ base_url: BASE_URL.into(),+ pool_poll_interval_ms: 1,+ pool_poll_limit: 1,+ claim_poll_interval_ms: 1,+ claim_poll_limit: 1,+ },+ access_token.into(),+ http,+ )+ .unwrap()+}++#[tokio::test]+async fn static_access_token_is_not_retried_after_a_401() {+ let http = Arc::new(ScriptedHttpClient::new([Ok(response(401, b"expired"))]));+ let client = static_token_client(Arc::clone(&http), "browser-token");++ let error = client+ .execute_authenticated(request("https://cyclops.example:8443/api/pools"))+ .await+ .unwrap_err();+ assert!(+ matches!(error, SdkError::Token { reason } if reason.contains("static access token was rejected"))+ );+ assert_eq!(http.requests().await.len(), 1);+}