Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

462 KB
Raw Blame
# This file was autogenerated by some hot garbage in the `uniffi` crate.
# Trust me, you don't want to mess with it!

# Common helper code.
#
# Ideally this would live in a separate .py file where it can be unittested etc
# in isolation, and perhaps even published as a re-useable package.
#
# However, it's important that the details of how this helper code works (e.g. the
# way that different builtin types are passed across the FFI) exactly match what's
# expected by the rust code on the other side of the interface. In practice right
# now that means coming from the exact some version of `uniffi` that was used to
# compile the rust component. The easiest way to ensure this is to bundle the Python
# helpers directly inline like we're doing here.

from __future__ import annotations
import os
import sys
import ctypes
from dataclasses import dataclass
import enum
import struct
import contextlib
import datetime
import threading
import itertools
import traceback
import typing
import asyncio
import platform
import cua_driver._native_contract


# Used for default argument values
_DEFAULT = object() # type: typing.Any


class _UniffiRustBuffer(ctypes.Structure):
    _fields_ = [
        ("capacity", ctypes.c_uint64),
        ("len", ctypes.c_uint64),
        ("data", ctypes.POINTER(ctypes.c_char)),
    ]

    @staticmethod
    def default():
        return _UniffiRustBuffer(0, 0, None)

    @staticmethod
    def alloc(size):
        return _uniffi_rust_call(_UniffiLib.ffi_cua_driver_sdk_rustbuffer_alloc, size)

    @staticmethod
    def reserve(rbuf, additional):
        return _uniffi_rust_call(_UniffiLib.ffi_cua_driver_sdk_rustbuffer_reserve, rbuf, additional)

    def free(self):
        return _uniffi_rust_call(_UniffiLib.ffi_cua_driver_sdk_rustbuffer_free, self)

    def __str__(self):
        return "_UniffiRustBuffer(capacity={}, len={}, data={})".format(
            self.capacity,
            self.len,
            self.data[0:self.len]
        )

    @contextlib.contextmanager
    def alloc_with_builder(*args):
        """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder.

        The allocated buffer will be automatically freed if an error occurs, ensuring that
        we don't accidentally leak it.
        """
        builder = _UniffiRustBufferBuilder()
        try:
            yield builder
        except:
            builder.discard()
            raise

    @contextlib.contextmanager
    def consume_with_stream(self):
        """Context-manager to consume a buffer using a _UniffiRustBufferStream.

        The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't
        leak it even if an error occurs.
        """
        try:
            s = _UniffiRustBufferStream.from_rust_buffer(self)
            yield s
            if s.remaining() != 0:
                raise RuntimeError(f"junk data left in buffer at end of consume_with_stream {s.remaining()}")
        finally:
            self.free()

    @contextlib.contextmanager
    def read_with_stream(self):
        """Context-manager to read a buffer using a _UniffiRustBufferStream.

        This is like consume_with_stream, but doesn't free the buffer afterwards.
        It should only be used with borrowed `_UniffiRustBuffer` data.
        """
        s = _UniffiRustBufferStream.from_rust_buffer(self)
        yield s
        if s.remaining() != 0:
            raise RuntimeError(f"junk data left in buffer at end of read_with_stream {s.remaining()}")

class _UniffiForeignBytes(ctypes.Structure):
    _fields_ = [
        ("len", ctypes.c_int32),
        ("data", ctypes.POINTER(ctypes.c_char)),
    ]

    def __str__(self):
        return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len])


class _UniffiRustBufferStream:
    """
    Helper for structured reading of bytes from a _UniffiRustBuffer
    """

    def __init__(self, data, len):
        self.data = data
        self.len = len
        self.offset = 0

    @classmethod
    def from_rust_buffer(cls, buf):
        return cls(buf.data, buf.len)

    def remaining(self):
        return self.len - self.offset

    def _unpack_from(self, size, format):
        if self.offset + size > self.len:
            raise InternalError("read past end of rust buffer")
        value = struct.unpack(format, self.data[self.offset:self.offset+size])[0]
        self.offset += size
        return value

    def read(self, size):
        if self.offset + size > self.len:
            raise InternalError("read past end of rust buffer")
        data = self.data[self.offset:self.offset+size]
        self.offset += size
        return data

    def read_i8(self):
        return self._unpack_from(1, ">b")

    def read_u8(self):
        return self._unpack_from(1, ">B")

    def read_i16(self):
        return self._unpack_from(2, ">h")

    def read_u16(self):
        return self._unpack_from(2, ">H")

    def read_i32(self):
        return self._unpack_from(4, ">i")

    def read_u32(self):
        return self._unpack_from(4, ">I")

    def read_i64(self):
        return self._unpack_from(8, ">q")

    def read_u64(self):
        return self._unpack_from(8, ">Q")

    def read_float(self):
        v = self._unpack_from(4, ">f")
        return v

    def read_double(self):
        return self._unpack_from(8, ">d")

class _UniffiRustBufferBuilder:
    """
    Helper for structured writing of bytes into a _UniffiRustBuffer.
    """

    def __init__(self):
        self.rbuf = _UniffiRustBuffer.alloc(16)
        self.rbuf.len = 0

    def finalize(self):
        rbuf = self.rbuf
        self.rbuf = None
        return rbuf

    def discard(self):
        if self.rbuf is not None:
            rbuf = self.finalize()
            rbuf.free()

    @contextlib.contextmanager
    def _reserve(self, num_bytes):
        if self.rbuf.len + num_bytes > self.rbuf.capacity:
            self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes)
        yield None
        self.rbuf.len += num_bytes

    def _pack_into(self, size, format, value):
        with self._reserve(size):
            # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out.
            for i, byte in enumerate(struct.pack(format, value)):
                self.rbuf.data[self.rbuf.len + i] = byte

    def write(self, value):
        with self._reserve(len(value)):
            for i, byte in enumerate(value):
                self.rbuf.data[self.rbuf.len + i] = byte

    def write_i8(self, v):
        self._pack_into(1, ">b", v)

    def write_u8(self, v):
        self._pack_into(1, ">B", v)

    def write_i16(self, v):
        self._pack_into(2, ">h", v)

    def write_u16(self, v):
        self._pack_into(2, ">H", v)

    def write_i32(self, v):
        self._pack_into(4, ">i", v)

    def write_u32(self, v):
        self._pack_into(4, ">I", v)

    def write_i64(self, v):
        self._pack_into(8, ">q", v)

    def write_u64(self, v):
        self._pack_into(8, ">Q", v)

    def write_float(self, v):
        self._pack_into(4, ">f", v)

    def write_double(self, v):
        self._pack_into(8, ">d", v)

    def write_c_size_t(self, v):
        self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v)
# A handful of classes and functions to support the generated data structures.
# This would be a good candidate for isolating in its own ffi-support lib.

class InternalError(Exception):
    pass

class _UniffiRustCallStatus(ctypes.Structure):
    """
    Error runtime.
    """
    _fields_ = [
        ("code", ctypes.c_int8),
        ("error_buf", _UniffiRustBuffer),
    ]

    # These match the values from the uniffi::rustcalls module
    CALL_SUCCESS = 0
    CALL_ERROR = 1
    CALL_UNEXPECTED_ERROR = 2

    @staticmethod
    def default():
        return _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer.default())

    def __str__(self):
        if self.code == _UniffiRustCallStatus.CALL_SUCCESS:
            return "_UniffiRustCallStatus(CALL_SUCCESS)"
        elif self.code == _UniffiRustCallStatus.CALL_ERROR:
            return "_UniffiRustCallStatus(CALL_ERROR)"
        elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR:
            return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)"
        else:
            return "_UniffiRustCallStatus(<invalid code>)"

def _uniffi_rust_call(fn, *args):
    # Call a rust function
    return _uniffi_rust_call_with_error(None, fn, *args)

def _uniffi_rust_call_with_error(error_ffi_converter, fn, *args):
    # Call a rust function and handle any errors
    #
    # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code.
    # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result.
    call_status = _UniffiRustCallStatus.default()

    args_with_error = args + (ctypes.byref(call_status),)
    result = fn(*args_with_error)
    _uniffi_check_call_status(error_ffi_converter, call_status)
    return result

def _uniffi_check_call_status(error_ffi_converter, call_status):
    if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS:
        pass
    elif call_status.code == _UniffiRustCallStatus.CALL_ERROR:
        if error_ffi_converter is None:
            call_status.error_buf.free()
            raise InternalError("_uniffi_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None")
        else:
            raise error_ffi_converter.lift(call_status.error_buf)
    elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR:
        # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer
        # with the message.  But if that code panics, then it just sends back
        # an empty buffer.
        if call_status.error_buf.len > 0:
            msg = _UniffiFfiConverterString.lift(call_status.error_buf)
        else:
            msg = "Unknown rust panic"
        raise InternalError(msg)
    else:
        raise InternalError("Invalid _UniffiRustCallStatus code: {}".format(
            call_status.code))

def _uniffi_trait_interface_call(call_status, make_call, write_return_value):
    try:
        return write_return_value(make_call())
    except Exception as e:
        call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR
        call_status.error_buf = _UniffiFfiConverterString.lower(repr(e))

def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error):
    try:
        try:
            return write_return_value(make_call())
        except error_type as e:
            call_status.code = _UniffiRustCallStatus.CALL_ERROR
            call_status.error_buf = lower_error(e)
    except Exception as e:
        call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR
        call_status.error_buf = _UniffiFfiConverterString.lower(repr(e))
# Initial value and increment amount for handles.
# These ensure that Python-generated handles always have the lowest bit set
_UNIFFI_HANDLEMAP_INITIAL = 1
_UNIFFI_HANDLEMAP_DELTA = 2

class _UniffiHandleMap:
    """
    A map where inserting, getting and removing data is synchronized with a lock.
    """

    def __init__(self):
        # type Handle = int
        self._map = {}  # type: Dict[Handle, Any]
        self._lock = threading.Lock()
        self._counter = _UNIFFI_HANDLEMAP_INITIAL

    def insert(self, obj):
        with self._lock:
            return self._insert(obj)

    """Low-level insert, this assumes `self._lock` is held."""
    def _insert(self, obj):
        handle = self._counter
        self._counter += _UNIFFI_HANDLEMAP_DELTA
        self._map[handle] = obj
        return handle

    def get(self, handle):
        try:
            with self._lock:
                return self._map[handle]
        except KeyError:
            raise InternalError(f"_UniffiHandleMap.get: Invalid handle {handle}")

    def clone(self, handle):
        try:
            with self._lock:
                obj = self._map[handle]
                return self._insert(obj)
        except KeyError:
            raise InternalError(f"_UniffiHandleMap.clone: Invalid handle {handle}")

    def remove(self, handle):
        try:
            with self._lock:
                return self._map.pop(handle)
        except KeyError:
            raise InternalError(f"_UniffiHandleMap.remove: Invalid handle: {handle}")

    def __len__(self):
        return len(self._map)
# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI.
class _UniffiConverterPrimitive:
    @classmethod
    def lift(cls, value):
        return value

    @classmethod
    def lower(cls, value):
        return value

class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive):
    @classmethod
    def check_lower(cls, value):
        try:
            value = value.__index__()
        except Exception:
            raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__))
        if not isinstance(value, int):
            raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__))
        if not cls.VALUE_MIN <= value < cls.VALUE_MAX:
            raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX))

class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive):
    @classmethod
    def check_lower(cls, value):
        try:
            value = value.__float__()
        except Exception:
            raise TypeError("must be real number, not {}".format(type(value).__name__))
        if not isinstance(value, float):
            raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__))

# Helper class for wrapper types that will always go through a _UniffiRustBuffer.
# Classes should inherit from this and implement the `read` and `write` static methods.
class _UniffiConverterRustBuffer:
    @classmethod
    def lift(cls, rbuf):
        with rbuf.consume_with_stream() as stream:
            return cls.read(stream)

    @classmethod
    def lower(cls, value):
        with _UniffiRustBuffer.alloc_with_builder() as builder:
            cls.write(value, builder)
            return builder.finalize()

# Contains loading, initialization code, and the FFI Function declarations.
# Define some ctypes FFI types that we use in the library

"""
Function pointer for a Rust task, which a callback function that takes a opaque pointer
"""
_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8)

def _uniffi_future_callback_t(return_type):
    """
    Factory function to create callback function types for async functions
    """
    return ctypes.CFUNCTYPE(None, ctypes.c_uint64, return_type, _UniffiRustCallStatus)

def _uniffi_load_indirect():
    """
    This is how we find and load the dynamic library provided by the component.
    For now we just look it up by name.
    """
    if sys.platform == "darwin":
        libname = "lib{}.dylib"
    elif sys.platform.startswith("win"):
        # As of python3.8, ctypes does not seem to search $PATH when loading DLLs.
        # We could use `os.add_dll_directory` to configure the search path, but
        # it doesn't feel right to mess with application-wide settings. Let's
        # assume that the `.dll` is next to the `.py` file and load by full path.
        libname = os.path.join(
            os.path.dirname(__file__),
            "{}.dll",
        )
    else:
        # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos
        libname = "lib{}.so"

    libname = libname.format("cua_driver_sdk")
    path = os.path.join(os.path.dirname(__file__), libname)
    lib = ctypes.cdll.LoadLibrary(path)
    return lib

def _uniffi_check_contract_api_version(lib):
    # Get the bindings contract version from our ComponentInterface
    bindings_contract_version = 30
    # Get the scaffolding contract version by calling the into the dylib
    scaffolding_contract_version = lib.ffi_cua_driver_sdk_uniffi_contract_version()
    if bindings_contract_version != scaffolding_contract_version:
        raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")

def _uniffi_check_api_checksums(lib):
    if lib.uniffi_cua_driver_sdk_checksum_func_connect_remote_channel() != 54784:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_create_remote_trusted_session() != 53066:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_create_trusted_session() != 50573:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_current_mac_os_permission_status() != 22890:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_cursor_click_effects() != 47083:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_cursor_motion_spec_for_style() != 60220:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_default_cursor_motion_params() != 63994:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_open_mac_os_screen_recording_settings() != 6663:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_open_mcp_driver_channel() != 952:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_plan_cursor_move() != 47047:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_plan_cursor_spec() != 61096:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_func_request_mac_os_permissions() != 61823:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_connect() != 60859:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_connect_with_client_kind() != 43287:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create() != 15191:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured() != 58596:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_activity_observer() != 37471:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_activity_observer_and_client_kind() != 50814:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_authorization_host() != 28087:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_authorization_host_and_client_kind() != 17837:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_client_kind() != 23819:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_host_integrations() != 2578:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_host_integrations_and_client_kind() != 25294:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_private_worker() != 8571:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_private_worker_with_client_kind() != 31571:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_with_client_kind() != 3630:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_call_tool() != 24493:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_click() != 22807:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_clipboard_read() != 58238:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_clipboard_write() != 8399:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_drag() != 25742:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_end_session() != 18486:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_escalate_session() != 6924:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_execution_mode() != 2639:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_agent_cursor_state() != 45642:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_cursor_position() != 34285:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_desktop_state() != 65084:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_screen_size() != 55616:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session() != 17834:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session_state() != 49966:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_window_state() != 62142:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_hotkey() != 53333:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_invoke_menu() != 13118:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_is_available() != 42961:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_apps() != 35505:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_host_sessions_json() != 13193:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_sessions() != 40131:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_tools_json() != 33039:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_windows() != 52601:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_metadata() != 55026:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_move_cursor() != 18320:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_parse_visual_regions() != 15013:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_press_key() != 63712:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_runtime_scope_prefix() != 2453:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_scroll() != 52290:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_enabled() != 26268:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_motion() != 12578:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_theme() != 53908:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_window_frame() != 6509:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_shutdown() != 36331:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_socket_path() != 48126:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_start_session() != 45055:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_type_text() != 25156:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriver_verify_state() != 26193:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_call_tool() != 52859:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_click() != 50816:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_clipboard_read() != 23560:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_clipboard_write() != 45732:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_close() != 58108:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_drag() != 5854:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_end_session() != 42785:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_escalate_session() != 34392:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_agent_cursor_state() != 60344:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_cursor_position() != 54838:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_desktop_state() != 26695:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_screen_size() != 9763:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session() != 54666:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session_state() != 55370:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_window_state() != 21266:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_hotkey() != 12820:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_invoke_menu() != 2742:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_apps() != 51520:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_sessions() != 32840:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_windows() != 20571:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_move_cursor() != 35768:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_parse_visual_regions() != 31748:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_press_key() != 36768:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_scroll() != 8013:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_enabled() != 37153:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_motion() != 26144:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_theme() != 29734:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_window_frame() != 65413:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_start_session() != 13118:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_type_text() != 63241:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_verify_state() != 36472:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_arrival_t() != 18003:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_duration() != 45567:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_effect_frame() != 63284:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_effects() != 30979:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_linger() != 61008:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_sample_at() != 63579:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_samples() != 43656:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_snap_t() != 61947:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_target() != 1238:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_target_known() != 24778:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_driveractivityobserver_on_activity() != 9786:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_driverauthorizationhost_authorize() != 10089:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_driverservicetransport_send() != 53285:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_embeddedcuadriverhost_new() != 10108:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_constructor_embeddedcuadriverhost_with_options() != 41121:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_connection() != 44467:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_last_diagnostics() != 57979:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_restart() != 27248:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_start() != 16011:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_state() != 42795:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_stop() != 28521:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_wait_for_exit() != 21124:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_identity() != 13418:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_negotiate() != 29939:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_exchange() != 707:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_bind_session() != 6555:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_cancel() != 60148:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_close() != 42601:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_close() != 59055:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_driver() != 6660:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_open() != 13274:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
    if lib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_public_session() != 15027:
        raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")

# A ctypes library to expose the extern-C FFI definitions.
# This is an implementation detail which will be called internally by the public API.

_UniffiLib = _uniffi_load_indirect()
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_alloc.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_alloc.restype = _UniffiRustBuffer
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_from_bytes.argtypes = (
    _UniffiForeignBytes,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_from_bytes.restype = _UniffiRustBuffer
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_free.argtypes = (
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_free.restype = None
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_reserve.argtypes = (
    _UniffiRustBuffer,
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rustbuffer_reserve.restype = _UniffiRustBuffer
_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_int8,
)
_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
)
class _UniffiForeignFutureDroppedCallbackStruct(ctypes.Structure):
    _fields_ = [
        ("handle", ctypes.c_uint64),
        ("free", _UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK),
    ]
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u8.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u8.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u8.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u8.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u8.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u8.restype = ctypes.c_uint8
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u8.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u8.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i8.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i8.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i8.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i8.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i8.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i8.restype = ctypes.c_int8
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i8.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i8.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u16.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u16.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u16.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u16.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u16.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u16.restype = ctypes.c_uint16
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u16.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u16.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i16.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i16.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i16.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i16.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i16.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i16.restype = ctypes.c_int16
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i16.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i16.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u32.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u32.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u32.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u32.restype = ctypes.c_uint32
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u32.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i32.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i32.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i32.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i32.restype = ctypes.c_int32
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i32.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u64.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u64.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_u64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u64.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u64.restype = ctypes.c_uint64
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u64.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_u64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i64.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_i64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i64.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_i64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i64.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_i64.restype = ctypes.c_int64
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i64.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_i64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_f32.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_f32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_f32.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_f32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_f32.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_f32.restype = ctypes.c_float
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_f32.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_f32.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_f64.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_f64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_f64.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_f64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_f64.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_f64.restype = ctypes.c_double
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_f64.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_f64.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_rust_buffer.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_rust_buffer.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void.argtypes = (
    ctypes.c_uint64,
    _UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK,
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_void.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_cancel_void.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void.restype = None
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_void.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.ffi_cua_driver_sdk_rust_future_free_void.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cuadriver.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cuadriver.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_cuadriver.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_cuadriver.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cuadriversession.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cuadriversession.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_cuadriversession.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_cuadriversession.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cursortrajectory.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cursortrajectory.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_cursortrajectory.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_cursortrajectory.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driveractivityobserver.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driveractivityobserver.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_driveractivityobserver.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_driveractivityobserver.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driverauthorizationhost.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driverauthorizationhost.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_driverauthorizationhost.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_driverauthorizationhost.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driverservicetransport.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driverservicetransport.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_driverservicetransport.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_driverservicetransport.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_embeddedcuadriverhost.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_embeddedcuadriverhost.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_embeddedcuadriverhost.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_embeddedcuadriverhost.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_foreigndriverenvelopechannel.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_foreigndriverenvelopechannel.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_foreigndriverenvelopechannel.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_foreigndriverenvelopechannel.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_mcpdriverchannel.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_clone_mcpdriverchannel.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_free_mcpdriverchannel.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_free_mcpdriverchannel.restype = None
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64,
)
_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
)
class _UniffiVTableCallbackInterfaceCuaDriverSdkDriverActivityObserver(ctypes.Structure):
    _fields_ = [
        ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER),
        ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER),
        ("on_activity", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER_METHOD0),
    ]
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_driveractivityobserver.argtypes = (
    ctypes.POINTER(_UniffiVTableCallbackInterfaceCuaDriverSdkDriverActivityObserver),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_driveractivityobserver.restype = None
class _UniffiForeignFutureResultRustBuffer(ctypes.Structure):
    _fields_ = [
        ("return_value", _UniffiRustBuffer),
        ("call_status", _UniffiRustCallStatus),
    ]
_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultRustBuffer,
)
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),
)
_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64,
)
_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
)
class _UniffiVTableCallbackInterfaceCuaDriverSdkDriverAuthorizationHost(ctypes.Structure):
    _fields_ = [
        ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST),
        ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST),
        ("authorize", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST_METHOD0),
    ]
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_driverauthorizationhost.argtypes = (
    ctypes.POINTER(_UniffiVTableCallbackInterfaceCuaDriverSdkDriverAuthorizationHost),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_driverauthorizationhost.restype = None
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),
)
_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64,
)
_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
)
class _UniffiVTableCallbackInterfaceCuaDriverSdkDriverServiceTransport(ctypes.Structure):
    _fields_ = [
        ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT),
        ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT),
        ("send", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT_METHOD0),
    ]
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_driverservicetransport.argtypes = (
    ctypes.POINTER(_UniffiVTableCallbackInterfaceCuaDriverSdkDriverServiceTransport),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_driverservicetransport.restype = None
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.POINTER(_UniffiRustBuffer),
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),
)
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),
)
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETERUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),
)
class _UniffiForeignFutureResultVoid(ctypes.Structure):
    _fields_ = [
        ("call_status", _UniffiRustCallStatus),
    ]
_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureResultVoid,
)
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD4 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),
)
_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD5 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETEVOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFutureDroppedCallbackStruct),
)
_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL = ctypes.CFUNCTYPE(ctypes.c_uint64,ctypes.c_uint64,
)
_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL = ctypes.CFUNCTYPE(None,ctypes.c_uint64,
)
class _UniffiVTableCallbackInterfaceCuaDriverSdkForeignDriverEnvelopeChannel(ctypes.Structure):
    _fields_ = [
        ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL),
        ("uniffi_clone", _UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL),
        ("identity", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD0),
        ("negotiate", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD1),
        ("exchange", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD2),
        ("bind_session", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD3),
        ("cancel", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD4),
        ("close", _UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD5),
    ]
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_foreigndriverenvelopechannel.argtypes = (
    ctypes.POINTER(_UniffiVTableCallbackInterfaceCuaDriverSdkForeignDriverEnvelopeChannel),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_init_callback_vtable_foreigndriverenvelopechannel.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_func_connect_remote_channel.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_connect_remote_channel.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_func_create_remote_trusted_session.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_create_remote_trusted_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_func_create_trusted_session.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_create_trusted_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_func_current_mac_os_permission_status.argtypes = (
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_current_mac_os_permission_status.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_func_cursor_click_effects.argtypes = (
    cua_driver._native_contract._UniffiRustBuffer,
    ctypes.c_double,
    ctypes.c_double,
    ctypes.c_double,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_cursor_click_effects.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_func_cursor_motion_spec_for_style.argtypes = (
    cua_driver._native_contract._UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_cursor_motion_spec_for_style.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_func_default_cursor_motion_params.argtypes = (
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_default_cursor_motion_params.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_func_open_mac_os_screen_recording_settings.argtypes = (
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_open_mac_os_screen_recording_settings.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_func_open_mcp_driver_channel.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_open_mcp_driver_channel.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_func_plan_cursor_move.argtypes = (
    _UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_plan_cursor_move.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_func_plan_cursor_spec.argtypes = (
    _UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_plan_cursor_spec.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_func_request_mac_os_permissions.argtypes = (
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_func_request_mac_os_permissions.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_connect.argtypes = (
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_connect.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_connect_with_client_kind.argtypes = (
    _UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_connect_with_client_kind.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create.argtypes = (
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured.argtypes = (
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_activity_observer.argtypes = (
    _UniffiRustBuffer,
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_activity_observer.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_activity_observer_and_client_kind.argtypes = (
    _UniffiRustBuffer,
    ctypes.c_uint64,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_activity_observer_and_client_kind.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_authorization_host.argtypes = (
    _UniffiRustBuffer,
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_authorization_host.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_authorization_host_and_client_kind.argtypes = (
    _UniffiRustBuffer,
    ctypes.c_uint64,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_authorization_host_and_client_kind.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_client_kind.argtypes = (
    _UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_client_kind.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_host_integrations.argtypes = (
    _UniffiRustBuffer,
    ctypes.c_uint64,
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_host_integrations.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_host_integrations_and_client_kind.argtypes = (
    _UniffiRustBuffer,
    ctypes.c_uint64,
    ctypes.c_uint64,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_host_integrations_and_client_kind.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_private_worker.argtypes = (
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_private_worker.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_private_worker_with_client_kind.argtypes = (
    _UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_private_worker_with_client_kind.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_with_client_kind.argtypes = (
    _UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_with_client_kind.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_call_tool.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_call_tool.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_click.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_click.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_clipboard_read.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_clipboard_read.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_clipboard_write.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_clipboard_write.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_drag.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_drag.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_end_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_end_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_escalate_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_escalate_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_execution_mode.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_execution_mode.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_agent_cursor_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_agent_cursor_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_cursor_position.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_cursor_position.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_desktop_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_desktop_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_screen_size.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_screen_size.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_session_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_session_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_window_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_window_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_hotkey.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_hotkey.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_invoke_menu.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_invoke_menu.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_is_available.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_is_available.restype = ctypes.c_int8
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_apps.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_apps.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_host_sessions_json.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_host_sessions_json.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_sessions.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_sessions.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_tools_json.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_tools_json.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_windows.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_windows.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_metadata.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_metadata.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_move_cursor.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_move_cursor.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_parse_visual_regions.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_parse_visual_regions.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_press_key.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_press_key.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_runtime_scope_prefix.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_runtime_scope_prefix.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_scroll.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_scroll.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_enabled.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_enabled.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_motion.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_motion.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_theme.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_theme.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_window_frame.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_window_frame.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_shutdown.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_shutdown.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_socket_path.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_socket_path.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_start_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_start_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_type_text.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_type_text.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_verify_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_verify_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_call_tool.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_call_tool.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_click.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_click.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_clipboard_read.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_clipboard_read.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_clipboard_write.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_clipboard_write.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_close.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_close.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_drag.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_drag.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_end_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_end_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_escalate_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_escalate_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_agent_cursor_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_agent_cursor_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_cursor_position.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_cursor_position.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_desktop_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_desktop_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_screen_size.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_screen_size.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_session_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_session_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_window_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_window_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_hotkey.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_hotkey.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_invoke_menu.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_invoke_menu.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_apps.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_apps.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_sessions.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_sessions.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_windows.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_windows.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_move_cursor.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_move_cursor.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_parse_visual_regions.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_parse_visual_regions.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_press_key.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_press_key.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_scroll.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_scroll.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_enabled.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_enabled.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_motion.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_motion.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_theme.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_theme.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_window_frame.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_window_frame.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_start_session.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_start_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_type_text.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_type_text.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_verify_state.argtypes = (
    ctypes.c_uint64,
    cua_driver._native_contract._UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_verify_state.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_arrival_t.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_arrival_t.restype = ctypes.c_double
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_duration.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_duration.restype = ctypes.c_double
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_effect_frame.argtypes = (
    ctypes.c_uint64,
    ctypes.c_double,
    ctypes.c_int8,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_effect_frame.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_effects.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_effects.restype = cua_driver._native_contract._UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_linger.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_linger.restype = ctypes.c_double
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_sample_at.argtypes = (
    ctypes.c_uint64,
    ctypes.c_double,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_sample_at.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_samples.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_samples.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_snap_t.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_snap_t.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_target.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_target.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_target_known.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_target_known.restype = ctypes.c_int8
_UniffiLib.uniffi_cua_driver_sdk_fn_method_driveractivityobserver_on_activity.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_driveractivityobserver_on_activity.restype = None
_UniffiLib.uniffi_cua_driver_sdk_fn_method_driverauthorizationhost_authorize.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_driverauthorizationhost_authorize.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_driverservicetransport_send.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_driverservicetransport_send.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_embeddedcuadriverhost_new.argtypes = (
    _UniffiRustBuffer,
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_embeddedcuadriverhost_new.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_embeddedcuadriverhost_with_options.argtypes = (
    _UniffiRustBuffer,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_constructor_embeddedcuadriverhost_with_options.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_connection.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_connection.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_last_diagnostics.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_last_diagnostics.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_restart.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_restart.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_start.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_start.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_state.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_state.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_stop.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_stop.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_wait_for_exit.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_wait_for_exit.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_identity.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_identity.restype = _UniffiRustBuffer
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_negotiate.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_negotiate.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_exchange.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_exchange.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_bind_session.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_bind_session.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_cancel.argtypes = (
    ctypes.c_uint64,
    _UniffiRustBuffer,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_cancel.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_close.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_close.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_close.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_close.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_driver.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_driver.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_open.argtypes = (
    ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_open.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_public_session.argtypes = (
    ctypes.c_uint64,
    ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_public_session.restype = _UniffiRustBuffer
_UniffiLib.ffi_cua_driver_sdk_uniffi_contract_version.argtypes = (
)
_UniffiLib.ffi_cua_driver_sdk_uniffi_contract_version.restype = ctypes.c_uint32
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_connect_remote_channel.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_connect_remote_channel.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_create_remote_trusted_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_create_remote_trusted_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_create_trusted_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_create_trusted_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_current_mac_os_permission_status.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_current_mac_os_permission_status.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_cursor_click_effects.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_cursor_click_effects.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_cursor_motion_spec_for_style.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_cursor_motion_spec_for_style.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_default_cursor_motion_params.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_default_cursor_motion_params.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_open_mac_os_screen_recording_settings.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_open_mac_os_screen_recording_settings.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_open_mcp_driver_channel.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_open_mcp_driver_channel.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_plan_cursor_move.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_plan_cursor_move.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_plan_cursor_spec.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_plan_cursor_spec.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_request_mac_os_permissions.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_func_request_mac_os_permissions.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_connect.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_connect.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_connect_with_client_kind.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_connect_with_client_kind.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_activity_observer.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_activity_observer.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_activity_observer_and_client_kind.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_activity_observer_and_client_kind.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_authorization_host.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_authorization_host.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_authorization_host_and_client_kind.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_authorization_host_and_client_kind.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_client_kind.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_client_kind.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_host_integrations.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_host_integrations.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_host_integrations_and_client_kind.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_configured_with_host_integrations_and_client_kind.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_private_worker.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_private_worker.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_private_worker_with_client_kind.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_private_worker_with_client_kind.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_with_client_kind.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_cuadriver_create_with_client_kind.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_call_tool.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_call_tool.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_click.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_click.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_clipboard_read.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_clipboard_read.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_clipboard_write.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_clipboard_write.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_drag.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_drag.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_end_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_end_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_escalate_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_escalate_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_execution_mode.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_execution_mode.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_agent_cursor_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_agent_cursor_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_cursor_position.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_cursor_position.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_desktop_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_desktop_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_screen_size.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_screen_size.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_session_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_window_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_get_window_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_hotkey.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_hotkey.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_invoke_menu.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_invoke_menu.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_is_available.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_is_available.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_apps.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_apps.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_host_sessions_json.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_host_sessions_json.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_sessions.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_sessions.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_tools_json.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_tools_json.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_windows.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_list_windows.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_metadata.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_metadata.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_move_cursor.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_move_cursor.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_parse_visual_regions.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_parse_visual_regions.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_press_key.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_press_key.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_runtime_scope_prefix.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_runtime_scope_prefix.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_scroll.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_scroll.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_enabled.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_enabled.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_motion.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_motion.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_theme.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_agent_cursor_theme.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_window_frame.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_set_window_frame.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_shutdown.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_shutdown.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_socket_path.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_socket_path.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_start_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_start_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_type_text.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_type_text.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_verify_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriver_verify_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_call_tool.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_call_tool.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_click.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_click.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_clipboard_read.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_clipboard_read.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_clipboard_write.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_clipboard_write.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_close.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_close.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_drag.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_drag.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_end_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_end_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_escalate_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_escalate_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_agent_cursor_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_agent_cursor_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_cursor_position.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_cursor_position.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_desktop_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_desktop_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_screen_size.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_screen_size.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_session_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_window_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_get_window_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_hotkey.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_hotkey.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_invoke_menu.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_invoke_menu.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_apps.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_apps.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_sessions.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_sessions.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_windows.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_list_windows.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_move_cursor.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_move_cursor.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_parse_visual_regions.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_parse_visual_regions.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_press_key.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_press_key.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_scroll.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_scroll.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_enabled.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_enabled.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_motion.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_motion.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_theme.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_agent_cursor_theme.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_window_frame.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_set_window_frame.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_start_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_start_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_type_text.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_type_text.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_verify_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cuadriversession_verify_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_arrival_t.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_arrival_t.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_duration.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_duration.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_effect_frame.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_effect_frame.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_effects.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_effects.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_linger.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_linger.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_sample_at.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_sample_at.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_samples.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_samples.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_snap_t.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_snap_t.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_target.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_target.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_target_known.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_cursortrajectory_target_known.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_driveractivityobserver_on_activity.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_driveractivityobserver_on_activity.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_driverauthorizationhost_authorize.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_driverauthorizationhost_authorize.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_driverservicetransport_send.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_driverservicetransport_send.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_embeddedcuadriverhost_new.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_embeddedcuadriverhost_new.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_embeddedcuadriverhost_with_options.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_constructor_embeddedcuadriverhost_with_options.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_connection.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_connection.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_last_diagnostics.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_last_diagnostics.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_restart.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_restart.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_start.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_start.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_state.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_state.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_stop.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_stop.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_wait_for_exit.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_embeddedcuadriverhost_wait_for_exit.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_identity.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_identity.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_negotiate.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_negotiate.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_exchange.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_exchange.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_bind_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_bind_session.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_cancel.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_cancel.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_close.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_foreigndriverenvelopechannel_close.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_close.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_close.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_driver.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_driver.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_open.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_open.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_public_session.argtypes = (
)
_UniffiLib.uniffi_cua_driver_sdk_checksum_method_mcpdriverchannel_public_session.restype = ctypes.c_uint16

_uniffi_check_contract_api_version(_UniffiLib)
# _uniffi_check_api_checksums(_UniffiLib)

# RustFuturePoll values
_UNIFFI_RUST_FUTURE_POLL_READY = 0
_UNIFFI_RUST_FUTURE_POLL_WAKE = 1

# Stores futures for _uniffi_continuation_callback
_UniffiContinuationHandleMap = _UniffiHandleMap()

_UNIFFI_GLOBAL_EVENT_LOOP = None

"""
Set the event loop to use for async functions

This is needed if some async functions run outside of the eventloop, for example:
    - A non-eventloop thread is spawned, maybe from `EventLoop.run_in_executor` or maybe from the
      Rust code spawning its own thread.
    - The Rust code calls an async callback method from a sync callback function, using something
      like `pollster` to block on the async call.

In this case, we need an event loop to run the Python async function, but there's no eventloop set
for the thread.  Use `uniffi_set_event_loop` to force an eventloop to be used in this case.
"""
def uniffi_set_event_loop(eventloop: asyncio.BaseEventLoop):
    global _UNIFFI_GLOBAL_EVENT_LOOP
    _UNIFFI_GLOBAL_EVENT_LOOP = eventloop

def _uniffi_get_event_loop():
    if _UNIFFI_GLOBAL_EVENT_LOOP is not None:
        return _UNIFFI_GLOBAL_EVENT_LOOP
    else:
        return asyncio.get_running_loop()

# Continuation callback for async functions
# lift the return value or error and resolve the future, causing the async function to resume.
@_UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK
def _uniffi_continuation_callback(future_ptr, poll_code):
    (eventloop, future) = _UniffiContinuationHandleMap.remove(future_ptr)
    eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code)

def _uniffi_set_future_result(future, poll_code):
    if not future.cancelled():
        future.set_result(poll_code)

async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter):
    try:
        eventloop = _uniffi_get_event_loop()

        # Loop and poll until we see a _UNIFFI_RUST_FUTURE_POLL_READY value
        while True:
            future = eventloop.create_future()
            ffi_poll(
                rust_future,
                _uniffi_continuation_callback,
                _UniffiContinuationHandleMap.insert((eventloop, future)),
            )
            poll_code = await future
            if poll_code == _UNIFFI_RUST_FUTURE_POLL_READY:
                break

        return lift_func(
            _uniffi_rust_call_with_error(error_ffi_converter, ffi_complete, rust_future)
        )
    finally:
        ffi_free(rust_future)
def _uniffi_trait_interface_call_async(make_call, uniffi_out_dropped_callback, handle_success, handle_error):
    async def make_call_and_call_callback():
        # Note: it's important we call either `handle_success` or `handle_error` exactly once.  Each
        # call consumes an Arc reference, which means there should be no possibility of a double
        # call.  The following code is structured so that will will never call both `handle_success`
        # and `handle_error`, even in the face of weird exceptions.
        #
        # In extreme circumstances we may not call either, for example if we fail to make the ctypes
        # call to `handle_success`.  This means we will leak the Arc reference, which is better than
        # double-freeing it.
        try:
            call_result = await make_call()
        except Exception as e:
            print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr)
            traceback.print_exc(file=sys.stderr)
            handle_error(
                _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR,
                _UniffiFfiConverterString.lower(repr(e)),
            )
        else:
            handle_success(call_result)
    eventloop = _uniffi_get_event_loop()
    task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop)
    handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task))
    uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback)

def _uniffi_trait_interface_call_async_with_error(make_call, uniffi_out_dropped_callback, handle_success, handle_error, error_type, lower_error):
    async def make_call_and_call_callback():
        # See the note in _uniffi_trait_interface_call_async for details on `handle_success` and
        # `handle_error`.
        try:
            try:
                call_result = await make_call()
            except error_type as e:
                handle_error(
                    _UniffiRustCallStatus.CALL_ERROR,
                    lower_error(e),
                )
            else:
                handle_success(call_result)
        except Exception as e:
            print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr)
            traceback.print_exc(file=sys.stderr)
            handle_error(
                _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR,
                _UniffiFfiConverterString.lower(repr(e)),
            )
    eventloop = _uniffi_get_event_loop()
    task = asyncio.run_coroutine_threadsafe(make_call_and_call_callback(), eventloop)
    handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task))
    uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback)

_UNIFFI_REMOTE_CHANNEL_LOOP_LOCK = threading.Lock()

def _uniffi_remote_channel_call_async(eventloop, make_call, uniffi_out_dropped_callback, handle_success, handle_error, error_type, lower_error):
    async def make_call_and_call_callback():
        # See the note in _uniffi_trait_interface_call_async for details on `handle_success` and
        # `handle_error`.
        try:
            try:
                call_result = await make_call()
            except error_type as e:
                handle_error(
                    _UniffiRustCallStatus.CALL_ERROR,
                    lower_error(e),
                )
            else:
                handle_success(call_result)
        except Exception as e:
            print("UniFFI: Unhandled exception in trait interface call", file=sys.stderr)
            traceback.print_exc(file=sys.stderr)
            handle_error(
                _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR,
                _UniffiFfiConverterString.lower(repr(e)),
            )
    coroutine = make_call_and_call_callback()
    try:
        task = asyncio.run_coroutine_threadsafe(coroutine, eventloop)
    except RuntimeError:
        coroutine.close()
        handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((None, None))
        uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback)
        handle_error(
            _UniffiRustCallStatus.CALL_ERROR,
            lower_error(error_type.Failed("remote Driver channel asyncio event loop is closed")),
        )
        return
    handle = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.insert((eventloop, task))
    uniffi_out_dropped_callback[0] = _UniffiForeignFutureDroppedCallbackStruct(handle, _uniffi_future_dropped_callback)

_UNIFFI_FOREIGN_FUTURE_HANDLE_MAP = _UniffiHandleMap()

@_UNIFFI_FOREIGN_FUTURE_DROPPED_CALLBACK
def _uniffi_future_dropped_callback(handle):
    (eventloop, task) = _UNIFFI_FOREIGN_FUTURE_HANDLE_MAP.remove(handle)
    if eventloop is None:
        return
    try:
        eventloop.call_soon_threadsafe(_uniffi_cancel_task, task)
    except RuntimeError:
        # The loop owner may have closed it after the callback completed.
        pass

def _uniffi_cancel_task(task):
    if not task.done():
        task.cancel()

# Public interface members begin here.


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 SessionPermissionMode(enum.Enum):
    """
    Permission mode chosen by trusted host code for a runtime or session.
"""

    STANDARD = 0

    BOUNDED = 1

    UNRESTRICTED = 2



class _UniffiFfiConverterTypeSessionPermissionMode(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return SessionPermissionMode.STANDARD
        if variant == 2:
            return SessionPermissionMode.BOUNDED
        if variant == 3:
            return SessionPermissionMode.UNRESTRICTED
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == SessionPermissionMode.STANDARD:
            return
        if value == SessionPermissionMode.BOUNDED:
            return
        if value == SessionPermissionMode.UNRESTRICTED:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == SessionPermissionMode.STANDARD:
            buf.write_i32(1)
        if value == SessionPermissionMode.BOUNDED:
            buf.write_i32(2)
        if value == SessionPermissionMode.UNRESTRICTED:
            buf.write_i32(3)



class _UniffiFfiConverterSequenceTypeSessionPermissionMode(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        for item in value:
            _UniffiFfiConverterTypeSessionPermissionMode.check_lower(item)

    @classmethod
    def write(cls, value, buf):
        items = len(value)
        buf.write_i32(items)
        for item in value:
            _UniffiFfiConverterTypeSessionPermissionMode.write(item, buf)

    @classmethod
    def read(cls, buf):
        count = buf.read_i32()
        if count < 0:
            raise InternalError("Unexpected negative sequence length")

        return [
            _UniffiFfiConverterTypeSessionPermissionMode.read(buf) for i in range(count)
        ]

class _UniffiFfiConverterString:
    @staticmethod
    def check_lower(value):
        if not isinstance(value, str):
            raise TypeError("argument must be str, not {}".format(type(value).__name__))
        return value

    @staticmethod
    def read(buf):
        size = buf.read_i32()
        if size < 0:
            raise InternalError("Unexpected negative string length")
        utf8_bytes = buf.read(size)
        return utf8_bytes.decode("utf-8")

    @staticmethod
    def write(value, buf):
        utf8_bytes = value.encode("utf-8")
        buf.write_i32(len(utf8_bytes))
        buf.write(utf8_bytes)

    @staticmethod
    def lift(buf):
        with buf.consume_with_stream() as stream:
            return stream.read(stream.remaining()).decode("utf-8")

    @staticmethod
    def lower(value):
        with _UniffiRustBuffer.alloc_with_builder() as builder:
            builder.write(value.encode("utf-8"))
            return builder.finalize()

class _UniffiFfiConverterOptionalString(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterString.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterString.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterString.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

class _UniffiFfiConverterUInt64(_UniffiConverterPrimitiveInt):
    CLASS_NAME = "u64"
    VALUE_MIN = 0
    VALUE_MAX = 2**64

    @staticmethod
    def read(buf):
        return buf.read_u64()

    @staticmethod
    def write(value, buf):
        buf.write_u64(value)

@dataclass
class RuntimeAuthorizationOptions:
    """
    Immutable authorization ceiling supplied before a runtime accepts actions.
"""
    def __init__(self, *, allowed_modes:typing.List[SessionPermissionMode], compatibility_mode:SessionPermissionMode, compatibility_capability_manifest_path:typing.Optional[str] = _DEFAULT, compatibility_bounded_manifest_path:typing.Optional[str], unrestricted_acknowledged:bool, max_session_ttl_seconds:int, max_idle_ttl_seconds:int):
        self.allowed_modes = allowed_modes
        self.compatibility_mode = compatibility_mode
        if compatibility_capability_manifest_path is _DEFAULT:
            self.compatibility_capability_manifest_path = None
        else:
            self.compatibility_capability_manifest_path = compatibility_capability_manifest_path
        self.compatibility_bounded_manifest_path = compatibility_bounded_manifest_path
        self.unrestricted_acknowledged = unrestricted_acknowledged
        self.max_session_ttl_seconds = max_session_ttl_seconds
        self.max_idle_ttl_seconds = max_idle_ttl_seconds




    def __str__(self):
        return "RuntimeAuthorizationOptions(allowed_modes={}, compatibility_mode={}, compatibility_capability_manifest_path={}, compatibility_bounded_manifest_path={}, unrestricted_acknowledged={}, max_session_ttl_seconds={}, max_idle_ttl_seconds={})".format(self.allowed_modes, self.compatibility_mode, self.compatibility_capability_manifest_path, self.compatibility_bounded_manifest_path, self.unrestricted_acknowledged, self.max_session_ttl_seconds, self.max_idle_ttl_seconds)
    def __eq__(self, other):
        if self.allowed_modes != other.allowed_modes:
            return False
        if self.compatibility_mode != other.compatibility_mode:
            return False
        if self.compatibility_capability_manifest_path != other.compatibility_capability_manifest_path:
            return False
        if self.compatibility_bounded_manifest_path != other.compatibility_bounded_manifest_path:
            return False
        if self.unrestricted_acknowledged != other.unrestricted_acknowledged:
            return False
        if self.max_session_ttl_seconds != other.max_session_ttl_seconds:
            return False
        if self.max_idle_ttl_seconds != other.max_idle_ttl_seconds:
            return False
        return True

class _UniffiFfiConverterTypeRuntimeAuthorizationOptions(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return RuntimeAuthorizationOptions(
            allowed_modes=_UniffiFfiConverterSequenceTypeSessionPermissionMode.read(buf),
            compatibility_mode=_UniffiFfiConverterTypeSessionPermissionMode.read(buf),
            compatibility_capability_manifest_path=_UniffiFfiConverterOptionalString.read(buf),
            compatibility_bounded_manifest_path=_UniffiFfiConverterOptionalString.read(buf),
            unrestricted_acknowledged=_UniffiFfiConverterBoolean.read(buf),
            max_session_ttl_seconds=_UniffiFfiConverterUInt64.read(buf),
            max_idle_ttl_seconds=_UniffiFfiConverterUInt64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterSequenceTypeSessionPermissionMode.check_lower(value.allowed_modes)
        _UniffiFfiConverterTypeSessionPermissionMode.check_lower(value.compatibility_mode)
        _UniffiFfiConverterOptionalString.check_lower(value.compatibility_capability_manifest_path)
        _UniffiFfiConverterOptionalString.check_lower(value.compatibility_bounded_manifest_path)
        _UniffiFfiConverterBoolean.check_lower(value.unrestricted_acknowledged)
        _UniffiFfiConverterUInt64.check_lower(value.max_session_ttl_seconds)
        _UniffiFfiConverterUInt64.check_lower(value.max_idle_ttl_seconds)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterSequenceTypeSessionPermissionMode.write(value.allowed_modes, buf)
        _UniffiFfiConverterTypeSessionPermissionMode.write(value.compatibility_mode, buf)
        _UniffiFfiConverterOptionalString.write(value.compatibility_capability_manifest_path, buf)
        _UniffiFfiConverterOptionalString.write(value.compatibility_bounded_manifest_path, buf)
        _UniffiFfiConverterBoolean.write(value.unrestricted_acknowledged, buf)
        _UniffiFfiConverterUInt64.write(value.max_session_ttl_seconds, buf)
        _UniffiFfiConverterUInt64.write(value.max_idle_ttl_seconds, buf)

@dataclass
class ConfiguredDriverOptions:
    """
    Additive configured-runtime constructor options. Existing callers continue
    to use [`DriverOptions`] and inherit the compatibility session.
"""
    def __init__(self, *, claude_code_compatibility:bool, authorization:RuntimeAuthorizationOptions):
        self.claude_code_compatibility = claude_code_compatibility
        self.authorization = authorization




    def __str__(self):
        return "ConfiguredDriverOptions(claude_code_compatibility={}, authorization={})".format(self.claude_code_compatibility, self.authorization)
    def __eq__(self, other):
        if self.claude_code_compatibility != other.claude_code_compatibility:
            return False
        if self.authorization != other.authorization:
            return False
        return True

class _UniffiFfiConverterTypeConfiguredDriverOptions(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ConfiguredDriverOptions(
            claude_code_compatibility=_UniffiFfiConverterBoolean.read(buf),
            authorization=_UniffiFfiConverterTypeRuntimeAuthorizationOptions.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterBoolean.check_lower(value.claude_code_compatibility)
        _UniffiFfiConverterTypeRuntimeAuthorizationOptions.check_lower(value.authorization)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterBoolean.write(value.claude_code_compatibility, buf)
        _UniffiFfiConverterTypeRuntimeAuthorizationOptions.write(value.authorization, buf)

class _UniffiFfiConverterFloat64(_UniffiConverterPrimitiveFloat):
    @staticmethod
    def read(buf):
        return buf.read_double()

    @staticmethod
    def write(value, buf):
        buf.write_double(value)

@dataclass
class CursorGlow:
    """
    Speed glow.
"""
    def __init__(self, *, x:float, y:float, r:float, alpha:float):
        self.x = x
        self.y = y
        self.r = r
        self.alpha = alpha




    def __str__(self):
        return "CursorGlow(x={}, y={}, r={}, alpha={})".format(self.x, self.y, self.r, self.alpha)
    def __eq__(self, other):
        if self.x != other.x:
            return False
        if self.y != other.y:
            return False
        if self.r != other.r:
            return False
        if self.alpha != other.alpha:
            return False
        return True

class _UniffiFfiConverterTypeCursorGlow(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorGlow(
            x=_UniffiFfiConverterFloat64.read(buf),
            y=_UniffiFfiConverterFloat64.read(buf),
            r=_UniffiFfiConverterFloat64.read(buf),
            alpha=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterFloat64.check_lower(value.x)
        _UniffiFfiConverterFloat64.check_lower(value.y)
        _UniffiFfiConverterFloat64.check_lower(value.r)
        _UniffiFfiConverterFloat64.check_lower(value.alpha)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterFloat64.write(value.x, buf)
        _UniffiFfiConverterFloat64.write(value.y, buf)
        _UniffiFfiConverterFloat64.write(value.r, buf)
        _UniffiFfiConverterFloat64.write(value.alpha, buf)

class _UniffiFfiConverterOptionalTypeCursorGlow(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeCursorGlow.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeCursorGlow.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeCursorGlow.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

@dataclass
class CursorTrailSegment:
    """
    One round-capped stroke of the comet trail.
"""
    def __init__(self, *, ax:float, ay:float, bx:float, by:float, width:float, alpha:float):
        self.ax = ax
        self.ay = ay
        self.bx = bx
        self.by = by
        self.width = width
        self.alpha = alpha




    def __str__(self):
        return "CursorTrailSegment(ax={}, ay={}, bx={}, by={}, width={}, alpha={})".format(self.ax, self.ay, self.bx, self.by, self.width, self.alpha)
    def __eq__(self, other):
        if self.ax != other.ax:
            return False
        if self.ay != other.ay:
            return False
        if self.bx != other.bx:
            return False
        if self.by != other.by:
            return False
        if self.width != other.width:
            return False
        if self.alpha != other.alpha:
            return False
        return True

class _UniffiFfiConverterTypeCursorTrailSegment(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorTrailSegment(
            ax=_UniffiFfiConverterFloat64.read(buf),
            ay=_UniffiFfiConverterFloat64.read(buf),
            bx=_UniffiFfiConverterFloat64.read(buf),
            by=_UniffiFfiConverterFloat64.read(buf),
            width=_UniffiFfiConverterFloat64.read(buf),
            alpha=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterFloat64.check_lower(value.ax)
        _UniffiFfiConverterFloat64.check_lower(value.ay)
        _UniffiFfiConverterFloat64.check_lower(value.bx)
        _UniffiFfiConverterFloat64.check_lower(value.by)
        _UniffiFfiConverterFloat64.check_lower(value.width)
        _UniffiFfiConverterFloat64.check_lower(value.alpha)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterFloat64.write(value.ax, buf)
        _UniffiFfiConverterFloat64.write(value.ay, buf)
        _UniffiFfiConverterFloat64.write(value.bx, buf)
        _UniffiFfiConverterFloat64.write(value.by, buf)
        _UniffiFfiConverterFloat64.write(value.width, buf)
        _UniffiFfiConverterFloat64.write(value.alpha, buf)

class _UniffiFfiConverterSequenceTypeCursorTrailSegment(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        for item in value:
            _UniffiFfiConverterTypeCursorTrailSegment.check_lower(item)

    @classmethod
    def write(cls, value, buf):
        items = len(value)
        buf.write_i32(items)
        for item in value:
            _UniffiFfiConverterTypeCursorTrailSegment.write(item, buf)

    @classmethod
    def read(cls, buf):
        count = buf.read_i32()
        if count < 0:
            raise InternalError("Unexpected negative sequence length")

        return [
            _UniffiFfiConverterTypeCursorTrailSegment.read(buf) for i in range(count)
        ]

@dataclass
class CursorMotionRect:
    """
    A target rect in screen points.
"""
    def __init__(self, *, x:float, y:float, width:float, height:float):
        self.x = x
        self.y = y
        self.width = width
        self.height = height




    def __str__(self):
        return "CursorMotionRect(x={}, y={}, width={}, height={})".format(self.x, self.y, self.width, self.height)
    def __eq__(self, other):
        if self.x != other.x:
            return False
        if self.y != other.y:
            return False
        if self.width != other.width:
            return False
        if self.height != other.height:
            return False
        return True

class _UniffiFfiConverterTypeCursorMotionRect(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorMotionRect(
            x=_UniffiFfiConverterFloat64.read(buf),
            y=_UniffiFfiConverterFloat64.read(buf),
            width=_UniffiFfiConverterFloat64.read(buf),
            height=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterFloat64.check_lower(value.x)
        _UniffiFfiConverterFloat64.check_lower(value.y)
        _UniffiFfiConverterFloat64.check_lower(value.width)
        _UniffiFfiConverterFloat64.check_lower(value.height)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterFloat64.write(value.x, buf)
        _UniffiFfiConverterFloat64.write(value.y, buf)
        _UniffiFfiConverterFloat64.write(value.width, buf)
        _UniffiFfiConverterFloat64.write(value.height, buf)

@dataclass
class CursorMagnet:
    """
    Glow around the target after a magnetic lock-on.
"""
    def __init__(self, *, rect:CursorMotionRect, glow:float):
        self.rect = rect
        self.glow = glow




    def __str__(self):
        return "CursorMagnet(rect={}, glow={})".format(self.rect, self.glow)
    def __eq__(self, other):
        if self.rect != other.rect:
            return False
        if self.glow != other.glow:
            return False
        return True

class _UniffiFfiConverterTypeCursorMagnet(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorMagnet(
            rect=_UniffiFfiConverterTypeCursorMotionRect.read(buf),
            glow=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterTypeCursorMotionRect.check_lower(value.rect)
        _UniffiFfiConverterFloat64.check_lower(value.glow)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterTypeCursorMotionRect.write(value.rect, buf)
        _UniffiFfiConverterFloat64.write(value.glow, buf)

class _UniffiFfiConverterOptionalTypeCursorMagnet(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeCursorMagnet.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeCursorMagnet.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeCursorMagnet.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

@dataclass
class CursorRipple:
    """
    Expanding click ring.
"""
    def __init__(self, *, x:float, y:float, r:float, width:float, alpha:float):
        self.x = x
        self.y = y
        self.r = r
        self.width = width
        self.alpha = alpha




    def __str__(self):
        return "CursorRipple(x={}, y={}, r={}, width={}, alpha={})".format(self.x, self.y, self.r, self.width, self.alpha)
    def __eq__(self, other):
        if self.x != other.x:
            return False
        if self.y != other.y:
            return False
        if self.r != other.r:
            return False
        if self.width != other.width:
            return False
        if self.alpha != other.alpha:
            return False
        return True

class _UniffiFfiConverterTypeCursorRipple(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorRipple(
            x=_UniffiFfiConverterFloat64.read(buf),
            y=_UniffiFfiConverterFloat64.read(buf),
            r=_UniffiFfiConverterFloat64.read(buf),
            width=_UniffiFfiConverterFloat64.read(buf),
            alpha=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterFloat64.check_lower(value.x)
        _UniffiFfiConverterFloat64.check_lower(value.y)
        _UniffiFfiConverterFloat64.check_lower(value.r)
        _UniffiFfiConverterFloat64.check_lower(value.width)
        _UniffiFfiConverterFloat64.check_lower(value.alpha)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterFloat64.write(value.x, buf)
        _UniffiFfiConverterFloat64.write(value.y, buf)
        _UniffiFfiConverterFloat64.write(value.r, buf)
        _UniffiFfiConverterFloat64.write(value.width, buf)
        _UniffiFfiConverterFloat64.write(value.alpha, buf)

class _UniffiFfiConverterOptionalTypeCursorRipple(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeCursorRipple.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeCursorRipple.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeCursorRipple.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

@dataclass
class CursorEffectFrame:
    """
    The effects to paint at one moment.
"""
    def __init__(self, *, glow:typing.Optional[CursorGlow], trail:typing.List[CursorTrailSegment], magnet:typing.Optional[CursorMagnet], ripple:typing.Optional[CursorRipple], squish:float):
        self.glow = glow
        self.trail = trail
        self.magnet = magnet
        self.ripple = ripple
        self.squish = squish




    def __str__(self):
        return "CursorEffectFrame(glow={}, trail={}, magnet={}, ripple={}, squish={})".format(self.glow, self.trail, self.magnet, self.ripple, self.squish)
    def __eq__(self, other):
        if self.glow != other.glow:
            return False
        if self.trail != other.trail:
            return False
        if self.magnet != other.magnet:
            return False
        if self.ripple != other.ripple:
            return False
        if self.squish != other.squish:
            return False
        return True

class _UniffiFfiConverterTypeCursorEffectFrame(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorEffectFrame(
            glow=_UniffiFfiConverterOptionalTypeCursorGlow.read(buf),
            trail=_UniffiFfiConverterSequenceTypeCursorTrailSegment.read(buf),
            magnet=_UniffiFfiConverterOptionalTypeCursorMagnet.read(buf),
            ripple=_UniffiFfiConverterOptionalTypeCursorRipple.read(buf),
            squish=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterOptionalTypeCursorGlow.check_lower(value.glow)
        _UniffiFfiConverterSequenceTypeCursorTrailSegment.check_lower(value.trail)
        _UniffiFfiConverterOptionalTypeCursorMagnet.check_lower(value.magnet)
        _UniffiFfiConverterOptionalTypeCursorRipple.check_lower(value.ripple)
        _UniffiFfiConverterFloat64.check_lower(value.squish)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterOptionalTypeCursorGlow.write(value.glow, buf)
        _UniffiFfiConverterSequenceTypeCursorTrailSegment.write(value.trail, buf)
        _UniffiFfiConverterOptionalTypeCursorMagnet.write(value.magnet, buf)
        _UniffiFfiConverterOptionalTypeCursorRipple.write(value.ripple, buf)
        _UniffiFfiConverterFloat64.write(value.squish, buf)







@dataclass
class CursorMotionParams:
    """
    Knobs of the built-in styles. Defaults match Cua Driver
    (`default_cursor_motion_params`).
"""
    def __init__(self, *, style:cua_driver._native_contract.CursorMotionStyle, timing:cua_driver._native_contract.CursorMotionTiming, effects:cua_driver._native_contract.CursorMotionEffects, start_handle:float, end_handle:float, arc_size:float, arc_flow:float, spring:float, glide_duration_ms:float, peak_speed:float, min_start_speed:float, min_end_speed:float, turn_radius:float):
        self.style = style
        self.timing = timing
        self.effects = effects
        self.start_handle = start_handle
        self.end_handle = end_handle
        self.arc_size = arc_size
        self.arc_flow = arc_flow
        self.spring = spring
        self.glide_duration_ms = glide_duration_ms
        self.peak_speed = peak_speed
        self.min_start_speed = min_start_speed
        self.min_end_speed = min_end_speed
        self.turn_radius = turn_radius




    def __str__(self):
        return "CursorMotionParams(style={}, timing={}, effects={}, start_handle={}, end_handle={}, arc_size={}, arc_flow={}, spring={}, glide_duration_ms={}, peak_speed={}, min_start_speed={}, min_end_speed={}, turn_radius={})".format(self.style, self.timing, self.effects, self.start_handle, self.end_handle, self.arc_size, self.arc_flow, self.spring, self.glide_duration_ms, self.peak_speed, self.min_start_speed, self.min_end_speed, self.turn_radius)
    def __eq__(self, other):
        if self.style != other.style:
            return False
        if self.timing != other.timing:
            return False
        if self.effects != other.effects:
            return False
        if self.start_handle != other.start_handle:
            return False
        if self.end_handle != other.end_handle:
            return False
        if self.arc_size != other.arc_size:
            return False
        if self.arc_flow != other.arc_flow:
            return False
        if self.spring != other.spring:
            return False
        if self.glide_duration_ms != other.glide_duration_ms:
            return False
        if self.peak_speed != other.peak_speed:
            return False
        if self.min_start_speed != other.min_start_speed:
            return False
        if self.min_end_speed != other.min_end_speed:
            return False
        if self.turn_radius != other.turn_radius:
            return False
        return True

class _UniffiFfiConverterTypeCursorMotionParams(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorMotionParams(
            style=cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionStyle.read(buf),
            timing=cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionTiming.read(buf),
            effects=cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffects.read(buf),
            start_handle=_UniffiFfiConverterFloat64.read(buf),
            end_handle=_UniffiFfiConverterFloat64.read(buf),
            arc_size=_UniffiFfiConverterFloat64.read(buf),
            arc_flow=_UniffiFfiConverterFloat64.read(buf),
            spring=_UniffiFfiConverterFloat64.read(buf),
            glide_duration_ms=_UniffiFfiConverterFloat64.read(buf),
            peak_speed=_UniffiFfiConverterFloat64.read(buf),
            min_start_speed=_UniffiFfiConverterFloat64.read(buf),
            min_end_speed=_UniffiFfiConverterFloat64.read(buf),
            turn_radius=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionStyle.check_lower(value.style)
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionTiming.check_lower(value.timing)
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffects.check_lower(value.effects)
        _UniffiFfiConverterFloat64.check_lower(value.start_handle)
        _UniffiFfiConverterFloat64.check_lower(value.end_handle)
        _UniffiFfiConverterFloat64.check_lower(value.arc_size)
        _UniffiFfiConverterFloat64.check_lower(value.arc_flow)
        _UniffiFfiConverterFloat64.check_lower(value.spring)
        _UniffiFfiConverterFloat64.check_lower(value.glide_duration_ms)
        _UniffiFfiConverterFloat64.check_lower(value.peak_speed)
        _UniffiFfiConverterFloat64.check_lower(value.min_start_speed)
        _UniffiFfiConverterFloat64.check_lower(value.min_end_speed)
        _UniffiFfiConverterFloat64.check_lower(value.turn_radius)

    @staticmethod
    def write(value, buf):
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionStyle.write(value.style, buf)
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionTiming.write(value.timing, buf)
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffects.write(value.effects, buf)
        _UniffiFfiConverterFloat64.write(value.start_handle, buf)
        _UniffiFfiConverterFloat64.write(value.end_handle, buf)
        _UniffiFfiConverterFloat64.write(value.arc_size, buf)
        _UniffiFfiConverterFloat64.write(value.arc_flow, buf)
        _UniffiFfiConverterFloat64.write(value.spring, buf)
        _UniffiFfiConverterFloat64.write(value.glide_duration_ms, buf)
        _UniffiFfiConverterFloat64.write(value.peak_speed, buf)
        _UniffiFfiConverterFloat64.write(value.min_start_speed, buf)
        _UniffiFfiConverterFloat64.write(value.min_end_speed, buf)
        _UniffiFfiConverterFloat64.write(value.turn_radius, buf)

@dataclass
class CursorMotionPoint:
    """
    A point in screen points (y down).
"""
    def __init__(self, *, x:float, y:float):
        self.x = x
        self.y = y




    def __str__(self):
        return "CursorMotionPoint(x={}, y={})".format(self.x, self.y)
    def __eq__(self, other):
        if self.x != other.x:
            return False
        if self.y != other.y:
            return False
        return True

class _UniffiFfiConverterTypeCursorMotionPoint(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorMotionPoint(
            x=_UniffiFfiConverterFloat64.read(buf),
            y=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterFloat64.check_lower(value.x)
        _UniffiFfiConverterFloat64.check_lower(value.y)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterFloat64.write(value.x, buf)
        _UniffiFfiConverterFloat64.write(value.y, buf)

@dataclass
class CursorMotionSample:
    """
    One sample: seconds from the start, the hotspot, and the arrow's heading.
"""
    def __init__(self, *, t:float, x:float, y:float, heading:float):
        self.t = t
        self.x = x
        self.y = y
        self.heading = heading




    def __str__(self):
        return "CursorMotionSample(t={}, x={}, y={}, heading={})".format(self.t, self.x, self.y, self.heading)
    def __eq__(self, other):
        if self.t != other.t:
            return False
        if self.x != other.x:
            return False
        if self.y != other.y:
            return False
        if self.heading != other.heading:
            return False
        return True

class _UniffiFfiConverterTypeCursorMotionSample(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorMotionSample(
            t=_UniffiFfiConverterFloat64.read(buf),
            x=_UniffiFfiConverterFloat64.read(buf),
            y=_UniffiFfiConverterFloat64.read(buf),
            heading=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterFloat64.check_lower(value.t)
        _UniffiFfiConverterFloat64.check_lower(value.x)
        _UniffiFfiConverterFloat64.check_lower(value.y)
        _UniffiFfiConverterFloat64.check_lower(value.heading)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterFloat64.write(value.t, buf)
        _UniffiFfiConverterFloat64.write(value.x, buf)
        _UniffiFfiConverterFloat64.write(value.y, buf)
        _UniffiFfiConverterFloat64.write(value.heading, buf)






class CursorPathShape:
    """
    Path shape of a custom motion.
"""
    def __init__(self):
        raise RuntimeError("CursorPathShape cannot be instantiated directly")

    # Each enum variant is a nested class of the enum itself.
    @dataclass
    class STRAIGHT:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorPathShape.STRAIGHT()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorPathShape):
                return NotImplemented
            if not other.is_STRAIGHT():
                return False
            return True

    @dataclass
    class ARC:
        """
        The Cua cubic bezier; a positive `arc_size` bends to the natural side.
"""

        def __init__(self, start_handle:float, end_handle:float, arc_size:float, arc_flow:float):
            self.start_handle = start_handle


            self.end_handle = end_handle


            self.arc_size = arc_size


            self.arc_flow = arc_flow


            pass





        def __str__(self):
            return "CursorPathShape.ARC(start_handle={}, end_handle={}, arc_size={}, arc_flow={})".format(self.start_handle, self.end_handle, self.arc_size, self.arc_flow)
        def __eq__(self, other):
            if not isinstance(other, CursorPathShape):
                return NotImplemented
            if not other.is_ARC():
                return False
            if self.start_handle != other.start_handle:
                return False
            if self.end_handle != other.end_handle:
                return False
            if self.arc_size != other.arc_size:
                return False
            if self.arc_flow != other.arc_flow:
                return False
            return True

    @dataclass
    class BOW:
        """
        A gentle quadratic bow.
"""

        def __init__(self, amount:float):
            self.amount = amount


            pass





        def __str__(self):
            return "CursorPathShape.BOW(amount={})".format(self.amount)
        def __eq__(self, other):
            if not isinstance(other, CursorPathShape):
                return NotImplemented
            if not other.is_BOW():
                return False
            if self.amount != other.amount:
                return False
            return True



    # For each variant, we have `is_NAME` and `is_name` methods for easily checking
    # whether an instance is that variant.
    def is_STRAIGHT(self) -> bool:
        return isinstance(self, CursorPathShape.STRAIGHT)
    def is_straight(self) -> bool:
        return isinstance(self, CursorPathShape.STRAIGHT)
    def is_ARC(self) -> bool:
        return isinstance(self, CursorPathShape.ARC)
    def is_arc(self) -> bool:
        return isinstance(self, CursorPathShape.ARC)
    def is_BOW(self) -> bool:
        return isinstance(self, CursorPathShape.BOW)
    def is_bow(self) -> bool:
        return isinstance(self, CursorPathShape.BOW)


# Now, a little trick - we make each nested variant class be a subclass of the main
# enum class, so that method calls and instance checks etc will work intuitively.
# We might be able to do this a little more neatly with a metaclass, but this'll do.
CursorPathShape.STRAIGHT = type("CursorPathShape.STRAIGHT", (CursorPathShape.STRAIGHT, CursorPathShape,), {})  # type: ignore
CursorPathShape.ARC = type("CursorPathShape.ARC", (CursorPathShape.ARC, CursorPathShape,), {})  # type: ignore
CursorPathShape.BOW = type("CursorPathShape.BOW", (CursorPathShape.BOW, CursorPathShape,), {})  # type: ignore




class _UniffiFfiConverterTypeCursorPathShape(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return CursorPathShape.STRAIGHT(
            )
        if variant == 2:
            return CursorPathShape.ARC(
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
            )
        if variant == 3:
            return CursorPathShape.BOW(
                _UniffiFfiConverterFloat64.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value.is_STRAIGHT():
            return
        if value.is_ARC():
            _UniffiFfiConverterFloat64.check_lower(value.start_handle)
            _UniffiFfiConverterFloat64.check_lower(value.end_handle)
            _UniffiFfiConverterFloat64.check_lower(value.arc_size)
            _UniffiFfiConverterFloat64.check_lower(value.arc_flow)
            return
        if value.is_BOW():
            _UniffiFfiConverterFloat64.check_lower(value.amount)
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value.is_STRAIGHT():
            buf.write_i32(1)
        if value.is_ARC():
            buf.write_i32(2)
            _UniffiFfiConverterFloat64.write(value.start_handle, buf)
            _UniffiFfiConverterFloat64.write(value.end_handle, buf)
            _UniffiFfiConverterFloat64.write(value.arc_size, buf)
            _UniffiFfiConverterFloat64.write(value.arc_flow, buf)
        if value.is_BOW():
            buf.write_i32(3)
            _UniffiFfiConverterFloat64.write(value.amount, buf)








class CursorEase:
    """
    Speed curve along the path.
"""
    def __init__(self):
        raise RuntimeError("CursorEase cannot be instantiated directly")

    # Each enum variant is a nested class of the enum itself.
    @dataclass
    class LINEAR:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorEase.LINEAR()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorEase):
                return NotImplemented
            if not other.is_LINEAR():
                return False
            return True

    @dataclass
    class MIN_JERK:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorEase.MIN_JERK()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorEase):
                return NotImplemented
            if not other.is_MIN_JERK():
                return False
            return True

    @dataclass
    class SMOOTHERSTEP:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorEase.SMOOTHERSTEP()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorEase):
                return NotImplemented
            if not other.is_SMOOTHERSTEP():
                return False
            return True

    @dataclass
    class IN_OUT_CUBIC:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorEase.IN_OUT_CUBIC()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorEase):
                return NotImplemented
            if not other.is_IN_OUT_CUBIC():
                return False
            return True

    @dataclass
    class IN_OUT_SINE:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorEase.IN_OUT_SINE()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorEase):
                return NotImplemented
            if not other.is_IN_OUT_SINE():
                return False
            return True

    @dataclass
    class OUT_CUBIC:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorEase.OUT_CUBIC()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorEase):
                return NotImplemented
            if not other.is_OUT_CUBIC():
                return False
            return True

    @dataclass
    class CUBIC_BEZIER:

        def __init__(self, x1:float, y1:float, x2:float, y2:float):
            self.x1 = x1


            self.y1 = y1


            self.x2 = x2


            self.y2 = y2


            pass





        def __str__(self):
            return "CursorEase.CUBIC_BEZIER(x1={}, y1={}, x2={}, y2={})".format(self.x1, self.y1, self.x2, self.y2)
        def __eq__(self, other):
            if not isinstance(other, CursorEase):
                return NotImplemented
            if not other.is_CUBIC_BEZIER():
                return False
            if self.x1 != other.x1:
                return False
            if self.y1 != other.y1:
                return False
            if self.x2 != other.x2:
                return False
            if self.y2 != other.y2:
                return False
            return True



    # For each variant, we have `is_NAME` and `is_name` methods for easily checking
    # whether an instance is that variant.
    def is_LINEAR(self) -> bool:
        return isinstance(self, CursorEase.LINEAR)
    def is_linear(self) -> bool:
        return isinstance(self, CursorEase.LINEAR)
    def is_MIN_JERK(self) -> bool:
        return isinstance(self, CursorEase.MIN_JERK)
    def is_min_jerk(self) -> bool:
        return isinstance(self, CursorEase.MIN_JERK)
    def is_SMOOTHERSTEP(self) -> bool:
        return isinstance(self, CursorEase.SMOOTHERSTEP)
    def is_smootherstep(self) -> bool:
        return isinstance(self, CursorEase.SMOOTHERSTEP)
    def is_IN_OUT_CUBIC(self) -> bool:
        return isinstance(self, CursorEase.IN_OUT_CUBIC)
    def is_in_out_cubic(self) -> bool:
        return isinstance(self, CursorEase.IN_OUT_CUBIC)
    def is_IN_OUT_SINE(self) -> bool:
        return isinstance(self, CursorEase.IN_OUT_SINE)
    def is_in_out_sine(self) -> bool:
        return isinstance(self, CursorEase.IN_OUT_SINE)
    def is_OUT_CUBIC(self) -> bool:
        return isinstance(self, CursorEase.OUT_CUBIC)
    def is_out_cubic(self) -> bool:
        return isinstance(self, CursorEase.OUT_CUBIC)
    def is_CUBIC_BEZIER(self) -> bool:
        return isinstance(self, CursorEase.CUBIC_BEZIER)
    def is_cubic_bezier(self) -> bool:
        return isinstance(self, CursorEase.CUBIC_BEZIER)


# Now, a little trick - we make each nested variant class be a subclass of the main
# enum class, so that method calls and instance checks etc will work intuitively.
# We might be able to do this a little more neatly with a metaclass, but this'll do.
CursorEase.LINEAR = type("CursorEase.LINEAR", (CursorEase.LINEAR, CursorEase,), {})  # type: ignore
CursorEase.MIN_JERK = type("CursorEase.MIN_JERK", (CursorEase.MIN_JERK, CursorEase,), {})  # type: ignore
CursorEase.SMOOTHERSTEP = type("CursorEase.SMOOTHERSTEP", (CursorEase.SMOOTHERSTEP, CursorEase,), {})  # type: ignore
CursorEase.IN_OUT_CUBIC = type("CursorEase.IN_OUT_CUBIC", (CursorEase.IN_OUT_CUBIC, CursorEase,), {})  # type: ignore
CursorEase.IN_OUT_SINE = type("CursorEase.IN_OUT_SINE", (CursorEase.IN_OUT_SINE, CursorEase,), {})  # type: ignore
CursorEase.OUT_CUBIC = type("CursorEase.OUT_CUBIC", (CursorEase.OUT_CUBIC, CursorEase,), {})  # type: ignore
CursorEase.CUBIC_BEZIER = type("CursorEase.CUBIC_BEZIER", (CursorEase.CUBIC_BEZIER, CursorEase,), {})  # type: ignore




class _UniffiFfiConverterTypeCursorEase(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return CursorEase.LINEAR(
            )
        if variant == 2:
            return CursorEase.MIN_JERK(
            )
        if variant == 3:
            return CursorEase.SMOOTHERSTEP(
            )
        if variant == 4:
            return CursorEase.IN_OUT_CUBIC(
            )
        if variant == 5:
            return CursorEase.IN_OUT_SINE(
            )
        if variant == 6:
            return CursorEase.OUT_CUBIC(
            )
        if variant == 7:
            return CursorEase.CUBIC_BEZIER(
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value.is_LINEAR():
            return
        if value.is_MIN_JERK():
            return
        if value.is_SMOOTHERSTEP():
            return
        if value.is_IN_OUT_CUBIC():
            return
        if value.is_IN_OUT_SINE():
            return
        if value.is_OUT_CUBIC():
            return
        if value.is_CUBIC_BEZIER():
            _UniffiFfiConverterFloat64.check_lower(value.x1)
            _UniffiFfiConverterFloat64.check_lower(value.y1)
            _UniffiFfiConverterFloat64.check_lower(value.x2)
            _UniffiFfiConverterFloat64.check_lower(value.y2)
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value.is_LINEAR():
            buf.write_i32(1)
        if value.is_MIN_JERK():
            buf.write_i32(2)
        if value.is_SMOOTHERSTEP():
            buf.write_i32(3)
        if value.is_IN_OUT_CUBIC():
            buf.write_i32(4)
        if value.is_IN_OUT_SINE():
            buf.write_i32(5)
        if value.is_OUT_CUBIC():
            buf.write_i32(6)
        if value.is_CUBIC_BEZIER():
            buf.write_i32(7)
            _UniffiFfiConverterFloat64.write(value.x1, buf)
            _UniffiFfiConverterFloat64.write(value.y1, buf)
            _UniffiFfiConverterFloat64.write(value.x2, buf)
            _UniffiFfiConverterFloat64.write(value.y2, buf)








class CursorSettle:
    """
    Overshoot or settle at the end of the glide.
"""
    def __init__(self):
        raise RuntimeError("CursorSettle cannot be instantiated directly")

    # Each enum variant is a nested class of the enum itself.
    @dataclass
    class NONE:

        def __init__(self, ):
            pass





        def __str__(self):
            return "CursorSettle.NONE()".format()
        def __eq__(self, other):
            if not isinstance(other, CursorSettle):
                return NotImplemented
            if not other.is_NONE():
                return False
            return True

    @dataclass
    class FOLLOW_THROUGH:

        def __init__(self, amount:float, max_pt:float, at:float):
            self.amount = amount


            self.max_pt = max_pt


            self.at = at


            pass





        def __str__(self):
            return "CursorSettle.FOLLOW_THROUGH(amount={}, max_pt={}, at={})".format(self.amount, self.max_pt, self.at)
        def __eq__(self, other):
            if not isinstance(other, CursorSettle):
                return NotImplemented
            if not other.is_FOLLOW_THROUGH():
                return False
            if self.amount != other.amount:
                return False
            if self.max_pt != other.max_pt:
                return False
            if self.at != other.at:
                return False
            return True

    @dataclass
    class SPRING:

        def __init__(self, amount:float, max_pt:float, cycles:float, decay:float, start:float, glide_end:float):
            self.amount = amount


            self.max_pt = max_pt


            self.cycles = cycles


            self.decay = decay


            self.start = start


            self.glide_end = glide_end


            pass





        def __str__(self):
            return "CursorSettle.SPRING(amount={}, max_pt={}, cycles={}, decay={}, start={}, glide_end={})".format(self.amount, self.max_pt, self.cycles, self.decay, self.start, self.glide_end)
        def __eq__(self, other):
            if not isinstance(other, CursorSettle):
                return NotImplemented
            if not other.is_SPRING():
                return False
            if self.amount != other.amount:
                return False
            if self.max_pt != other.max_pt:
                return False
            if self.cycles != other.cycles:
                return False
            if self.decay != other.decay:
                return False
            if self.start != other.start:
                return False
            if self.glide_end != other.glide_end:
                return False
            return True



    # For each variant, we have `is_NAME` and `is_name` methods for easily checking
    # whether an instance is that variant.
    def is_NONE(self) -> bool:
        return isinstance(self, CursorSettle.NONE)
    def is_none(self) -> bool:
        return isinstance(self, CursorSettle.NONE)
    def is_FOLLOW_THROUGH(self) -> bool:
        return isinstance(self, CursorSettle.FOLLOW_THROUGH)
    def is_follow_through(self) -> bool:
        return isinstance(self, CursorSettle.FOLLOW_THROUGH)
    def is_SPRING(self) -> bool:
        return isinstance(self, CursorSettle.SPRING)
    def is_spring(self) -> bool:
        return isinstance(self, CursorSettle.SPRING)


# Now, a little trick - we make each nested variant class be a subclass of the main
# enum class, so that method calls and instance checks etc will work intuitively.
# We might be able to do this a little more neatly with a metaclass, but this'll do.
CursorSettle.NONE = type("CursorSettle.NONE", (CursorSettle.NONE, CursorSettle,), {})  # type: ignore
CursorSettle.FOLLOW_THROUGH = type("CursorSettle.FOLLOW_THROUGH", (CursorSettle.FOLLOW_THROUGH, CursorSettle,), {})  # type: ignore
CursorSettle.SPRING = type("CursorSettle.SPRING", (CursorSettle.SPRING, CursorSettle,), {})  # type: ignore




class _UniffiFfiConverterTypeCursorSettle(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return CursorSettle.NONE(
            )
        if variant == 2:
            return CursorSettle.FOLLOW_THROUGH(
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
            )
        if variant == 3:
            return CursorSettle.SPRING(
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value.is_NONE():
            return
        if value.is_FOLLOW_THROUGH():
            _UniffiFfiConverterFloat64.check_lower(value.amount)
            _UniffiFfiConverterFloat64.check_lower(value.max_pt)
            _UniffiFfiConverterFloat64.check_lower(value.at)
            return
        if value.is_SPRING():
            _UniffiFfiConverterFloat64.check_lower(value.amount)
            _UniffiFfiConverterFloat64.check_lower(value.max_pt)
            _UniffiFfiConverterFloat64.check_lower(value.cycles)
            _UniffiFfiConverterFloat64.check_lower(value.decay)
            _UniffiFfiConverterFloat64.check_lower(value.start)
            _UniffiFfiConverterFloat64.check_lower(value.glide_end)
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value.is_NONE():
            buf.write_i32(1)
        if value.is_FOLLOW_THROUGH():
            buf.write_i32(2)
            _UniffiFfiConverterFloat64.write(value.amount, buf)
            _UniffiFfiConverterFloat64.write(value.max_pt, buf)
            _UniffiFfiConverterFloat64.write(value.at, buf)
        if value.is_SPRING():
            buf.write_i32(3)
            _UniffiFfiConverterFloat64.write(value.amount, buf)
            _UniffiFfiConverterFloat64.write(value.max_pt, buf)
            _UniffiFfiConverterFloat64.write(value.cycles, buf)
            _UniffiFfiConverterFloat64.write(value.decay, buf)
            _UniffiFfiConverterFloat64.write(value.start, buf)
            _UniffiFfiConverterFloat64.write(value.glide_end, buf)








class CursorMotionDuration:
    """
    Duration model of a custom motion.
"""
    def __init__(self):
        raise RuntimeError("CursorMotionDuration cannot be instantiated directly")

    # Each enum variant is a nested class of the enum itself.
    @dataclass
    class FIXED:

        def __init__(self, ms:float):
            self.ms = ms


            pass





        def __str__(self):
            return "CursorMotionDuration.FIXED(ms={})".format(self.ms)
        def __eq__(self, other):
            if not isinstance(other, CursorMotionDuration):
                return NotImplemented
            if not other.is_FIXED():
                return False
            if self.ms != other.ms:
                return False
            return True

    @dataclass
    class FITTS:

        def __init__(self, a:float, b:float, min_ms:float, max_ms:float, scale:float):
            self.a = a


            self.b = b


            self.min_ms = min_ms


            self.max_ms = max_ms


            self.scale = scale


            pass





        def __str__(self):
            return "CursorMotionDuration.FITTS(a={}, b={}, min_ms={}, max_ms={}, scale={})".format(self.a, self.b, self.min_ms, self.max_ms, self.scale)
        def __eq__(self, other):
            if not isinstance(other, CursorMotionDuration):
                return NotImplemented
            if not other.is_FITTS():
                return False
            if self.a != other.a:
                return False
            if self.b != other.b:
                return False
            if self.min_ms != other.min_ms:
                return False
            if self.max_ms != other.max_ms:
                return False
            if self.scale != other.scale:
                return False
            return True

    @dataclass
    class DISTANCE:

        def __init__(self, base_ms:float, ms_per_pt:float, min_ms:float, max_ms:float):
            self.base_ms = base_ms


            self.ms_per_pt = ms_per_pt


            self.min_ms = min_ms


            self.max_ms = max_ms


            pass





        def __str__(self):
            return "CursorMotionDuration.DISTANCE(base_ms={}, ms_per_pt={}, min_ms={}, max_ms={})".format(self.base_ms, self.ms_per_pt, self.min_ms, self.max_ms)
        def __eq__(self, other):
            if not isinstance(other, CursorMotionDuration):
                return NotImplemented
            if not other.is_DISTANCE():
                return False
            if self.base_ms != other.base_ms:
                return False
            if self.ms_per_pt != other.ms_per_pt:
                return False
            if self.min_ms != other.min_ms:
                return False
            if self.max_ms != other.max_ms:
                return False
            return True



    # For each variant, we have `is_NAME` and `is_name` methods for easily checking
    # whether an instance is that variant.
    def is_FIXED(self) -> bool:
        return isinstance(self, CursorMotionDuration.FIXED)
    def is_fixed(self) -> bool:
        return isinstance(self, CursorMotionDuration.FIXED)
    def is_FITTS(self) -> bool:
        return isinstance(self, CursorMotionDuration.FITTS)
    def is_fitts(self) -> bool:
        return isinstance(self, CursorMotionDuration.FITTS)
    def is_DISTANCE(self) -> bool:
        return isinstance(self, CursorMotionDuration.DISTANCE)
    def is_distance(self) -> bool:
        return isinstance(self, CursorMotionDuration.DISTANCE)


# Now, a little trick - we make each nested variant class be a subclass of the main
# enum class, so that method calls and instance checks etc will work intuitively.
# We might be able to do this a little more neatly with a metaclass, but this'll do.
CursorMotionDuration.FIXED = type("CursorMotionDuration.FIXED", (CursorMotionDuration.FIXED, CursorMotionDuration,), {})  # type: ignore
CursorMotionDuration.FITTS = type("CursorMotionDuration.FITTS", (CursorMotionDuration.FITTS, CursorMotionDuration,), {})  # type: ignore
CursorMotionDuration.DISTANCE = type("CursorMotionDuration.DISTANCE", (CursorMotionDuration.DISTANCE, CursorMotionDuration,), {})  # type: ignore




class _UniffiFfiConverterTypeCursorMotionDuration(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return CursorMotionDuration.FIXED(
                _UniffiFfiConverterFloat64.read(buf),
            )
        if variant == 2:
            return CursorMotionDuration.FITTS(
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
            )
        if variant == 3:
            return CursorMotionDuration.DISTANCE(
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
                _UniffiFfiConverterFloat64.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value.is_FIXED():
            _UniffiFfiConverterFloat64.check_lower(value.ms)
            return
        if value.is_FITTS():
            _UniffiFfiConverterFloat64.check_lower(value.a)
            _UniffiFfiConverterFloat64.check_lower(value.b)
            _UniffiFfiConverterFloat64.check_lower(value.min_ms)
            _UniffiFfiConverterFloat64.check_lower(value.max_ms)
            _UniffiFfiConverterFloat64.check_lower(value.scale)
            return
        if value.is_DISTANCE():
            _UniffiFfiConverterFloat64.check_lower(value.base_ms)
            _UniffiFfiConverterFloat64.check_lower(value.ms_per_pt)
            _UniffiFfiConverterFloat64.check_lower(value.min_ms)
            _UniffiFfiConverterFloat64.check_lower(value.max_ms)
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value.is_FIXED():
            buf.write_i32(1)
            _UniffiFfiConverterFloat64.write(value.ms, buf)
        if value.is_FITTS():
            buf.write_i32(2)
            _UniffiFfiConverterFloat64.write(value.a, buf)
            _UniffiFfiConverterFloat64.write(value.b, buf)
            _UniffiFfiConverterFloat64.write(value.min_ms, buf)
            _UniffiFfiConverterFloat64.write(value.max_ms, buf)
            _UniffiFfiConverterFloat64.write(value.scale, buf)
        if value.is_DISTANCE():
            buf.write_i32(3)
            _UniffiFfiConverterFloat64.write(value.base_ms, buf)
            _UniffiFfiConverterFloat64.write(value.ms_per_pt, buf)
            _UniffiFfiConverterFloat64.write(value.min_ms, buf)
            _UniffiFfiConverterFloat64.write(value.max_ms, buf)








class CursorHeading(enum.Enum):
    """
    `Tangent`: the tip leads the motion. `Fixed`: the rest pose.
"""

    TANGENT = 0

    FIXED = 1



class _UniffiFfiConverterTypeCursorHeading(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return CursorHeading.TANGENT
        if variant == 2:
            return CursorHeading.FIXED
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == CursorHeading.TANGENT:
            return
        if value == CursorHeading.FIXED:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == CursorHeading.TANGENT:
            buf.write_i32(1)
        if value == CursorHeading.FIXED:
            buf.write_i32(2)





class _UniffiFfiConverterUInt32(_UniffiConverterPrimitiveInt):
    CLASS_NAME = "u32"
    VALUE_MIN = 0
    VALUE_MAX = 2**32

    @staticmethod
    def read(buf):
        return buf.read_u32()

    @staticmethod
    def write(value, buf):
        buf.write_u32(value)

@dataclass
class CursorTrailSpec:
    """
    The comet trail.
"""
    def __init__(self, *, secs:float, fade_len:float, steps:int, tail_width:float, head_width:float, alpha:float, anchor_offset:float):
        self.secs = secs
        self.fade_len = fade_len
        self.steps = steps
        self.tail_width = tail_width
        self.head_width = head_width
        self.alpha = alpha
        self.anchor_offset = anchor_offset




    def __str__(self):
        return "CursorTrailSpec(secs={}, fade_len={}, steps={}, tail_width={}, head_width={}, alpha={}, anchor_offset={})".format(self.secs, self.fade_len, self.steps, self.tail_width, self.head_width, self.alpha, self.anchor_offset)
    def __eq__(self, other):
        if self.secs != other.secs:
            return False
        if self.fade_len != other.fade_len:
            return False
        if self.steps != other.steps:
            return False
        if self.tail_width != other.tail_width:
            return False
        if self.head_width != other.head_width:
            return False
        if self.alpha != other.alpha:
            return False
        if self.anchor_offset != other.anchor_offset:
            return False
        return True

class _UniffiFfiConverterTypeCursorTrailSpec(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorTrailSpec(
            secs=_UniffiFfiConverterFloat64.read(buf),
            fade_len=_UniffiFfiConverterFloat64.read(buf),
            steps=_UniffiFfiConverterUInt32.read(buf),
            tail_width=_UniffiFfiConverterFloat64.read(buf),
            head_width=_UniffiFfiConverterFloat64.read(buf),
            alpha=_UniffiFfiConverterFloat64.read(buf),
            anchor_offset=_UniffiFfiConverterFloat64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterFloat64.check_lower(value.secs)
        _UniffiFfiConverterFloat64.check_lower(value.fade_len)
        _UniffiFfiConverterUInt32.check_lower(value.steps)
        _UniffiFfiConverterFloat64.check_lower(value.tail_width)
        _UniffiFfiConverterFloat64.check_lower(value.head_width)
        _UniffiFfiConverterFloat64.check_lower(value.alpha)
        _UniffiFfiConverterFloat64.check_lower(value.anchor_offset)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterFloat64.write(value.secs, buf)
        _UniffiFfiConverterFloat64.write(value.fade_len, buf)
        _UniffiFfiConverterUInt32.write(value.steps, buf)
        _UniffiFfiConverterFloat64.write(value.tail_width, buf)
        _UniffiFfiConverterFloat64.write(value.head_width, buf)
        _UniffiFfiConverterFloat64.write(value.alpha, buf)
        _UniffiFfiConverterFloat64.write(value.anchor_offset, buf)

@dataclass
class CursorMotionSpec:
    """
    A complete custom motion.
"""
    def __init__(self, *, path:CursorPathShape, ease:CursorEase, settle:CursorSettle, duration:CursorMotionDuration, heading:CursorHeading, effects:cua_driver._native_contract.CursorMotionEffectsOutput, trail:CursorTrailSpec):
        self.path = path
        self.ease = ease
        self.settle = settle
        self.duration = duration
        self.heading = heading
        self.effects = effects
        self.trail = trail




    def __str__(self):
        return "CursorMotionSpec(path={}, ease={}, settle={}, duration={}, heading={}, effects={}, trail={})".format(self.path, self.ease, self.settle, self.duration, self.heading, self.effects, self.trail)
    def __eq__(self, other):
        if self.path != other.path:
            return False
        if self.ease != other.ease:
            return False
        if self.settle != other.settle:
            return False
        if self.duration != other.duration:
            return False
        if self.heading != other.heading:
            return False
        if self.effects != other.effects:
            return False
        if self.trail != other.trail:
            return False
        return True

class _UniffiFfiConverterTypeCursorMotionSpec(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorMotionSpec(
            path=_UniffiFfiConverterTypeCursorPathShape.read(buf),
            ease=_UniffiFfiConverterTypeCursorEase.read(buf),
            settle=_UniffiFfiConverterTypeCursorSettle.read(buf),
            duration=_UniffiFfiConverterTypeCursorMotionDuration.read(buf),
            heading=_UniffiFfiConverterTypeCursorHeading.read(buf),
            effects=cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffectsOutput.read(buf),
            trail=_UniffiFfiConverterTypeCursorTrailSpec.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterTypeCursorPathShape.check_lower(value.path)
        _UniffiFfiConverterTypeCursorEase.check_lower(value.ease)
        _UniffiFfiConverterTypeCursorSettle.check_lower(value.settle)
        _UniffiFfiConverterTypeCursorMotionDuration.check_lower(value.duration)
        _UniffiFfiConverterTypeCursorHeading.check_lower(value.heading)
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffectsOutput.check_lower(value.effects)
        _UniffiFfiConverterTypeCursorTrailSpec.check_lower(value.trail)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterTypeCursorPathShape.write(value.path, buf)
        _UniffiFfiConverterTypeCursorEase.write(value.ease, buf)
        _UniffiFfiConverterTypeCursorSettle.write(value.settle, buf)
        _UniffiFfiConverterTypeCursorMotionDuration.write(value.duration, buf)
        _UniffiFfiConverterTypeCursorHeading.write(value.heading, buf)
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffectsOutput.write(value.effects, buf)
        _UniffiFfiConverterTypeCursorTrailSpec.write(value.trail, buf)

class _UniffiFfiConverterOptionalFloat64(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterFloat64.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterFloat64.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterFloat64.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

class _UniffiFfiConverterOptionalTypeCursorMotionRect(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeCursorMotionRect.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeCursorMotionRect.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeCursorMotionRect.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

@dataclass
class CursorMoveRequest:
    """
    One move to plan.
"""
    def __init__(self, *, from_point:CursorMotionPoint, to_point:CursorMotionPoint, from_heading:typing.Optional[float], end_heading:typing.Optional[float], target:typing.Optional[CursorMotionRect], seed:str, reduced_motion:bool):
        self.from_point = from_point
        self.to_point = to_point
        self.from_heading = from_heading
        self.end_heading = end_heading
        self.target = target
        self.seed = seed
        self.reduced_motion = reduced_motion




    def __str__(self):
        return "CursorMoveRequest(from_point={}, to_point={}, from_heading={}, end_heading={}, target={}, seed={}, reduced_motion={})".format(self.from_point, self.to_point, self.from_heading, self.end_heading, self.target, self.seed, self.reduced_motion)
    def __eq__(self, other):
        if self.from_point != other.from_point:
            return False
        if self.to_point != other.to_point:
            return False
        if self.from_heading != other.from_heading:
            return False
        if self.end_heading != other.end_heading:
            return False
        if self.target != other.target:
            return False
        if self.seed != other.seed:
            return False
        if self.reduced_motion != other.reduced_motion:
            return False
        return True

class _UniffiFfiConverterTypeCursorMoveRequest(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return CursorMoveRequest(
            from_point=_UniffiFfiConverterTypeCursorMotionPoint.read(buf),
            to_point=_UniffiFfiConverterTypeCursorMotionPoint.read(buf),
            from_heading=_UniffiFfiConverterOptionalFloat64.read(buf),
            end_heading=_UniffiFfiConverterOptionalFloat64.read(buf),
            target=_UniffiFfiConverterOptionalTypeCursorMotionRect.read(buf),
            seed=_UniffiFfiConverterString.read(buf),
            reduced_motion=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterTypeCursorMotionPoint.check_lower(value.from_point)
        _UniffiFfiConverterTypeCursorMotionPoint.check_lower(value.to_point)
        _UniffiFfiConverterOptionalFloat64.check_lower(value.from_heading)
        _UniffiFfiConverterOptionalFloat64.check_lower(value.end_heading)
        _UniffiFfiConverterOptionalTypeCursorMotionRect.check_lower(value.target)
        _UniffiFfiConverterString.check_lower(value.seed)
        _UniffiFfiConverterBoolean.check_lower(value.reduced_motion)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterTypeCursorMotionPoint.write(value.from_point, buf)
        _UniffiFfiConverterTypeCursorMotionPoint.write(value.to_point, buf)
        _UniffiFfiConverterOptionalFloat64.write(value.from_heading, buf)
        _UniffiFfiConverterOptionalFloat64.write(value.end_heading, buf)
        _UniffiFfiConverterOptionalTypeCursorMotionRect.write(value.target, buf)
        _UniffiFfiConverterString.write(value.seed, buf)
        _UniffiFfiConverterBoolean.write(value.reduced_motion, buf)






class DriverActivityKind(enum.Enum):

    AUTHORIZED_ACTION = 0

    AUTHORIZATION_REFUSED = 1

    ACTION_FAILED = 2

    GRANT_ISSUED = 3

    GRANT_REVOKED = 4

    SESSION_STARTED = 5

    SESSION_ENDED = 6



class _UniffiFfiConverterTypeDriverActivityKind(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return DriverActivityKind.AUTHORIZED_ACTION
        if variant == 2:
            return DriverActivityKind.AUTHORIZATION_REFUSED
        if variant == 3:
            return DriverActivityKind.ACTION_FAILED
        if variant == 4:
            return DriverActivityKind.GRANT_ISSUED
        if variant == 5:
            return DriverActivityKind.GRANT_REVOKED
        if variant == 6:
            return DriverActivityKind.SESSION_STARTED
        if variant == 7:
            return DriverActivityKind.SESSION_ENDED
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == DriverActivityKind.AUTHORIZED_ACTION:
            return
        if value == DriverActivityKind.AUTHORIZATION_REFUSED:
            return
        if value == DriverActivityKind.ACTION_FAILED:
            return
        if value == DriverActivityKind.GRANT_ISSUED:
            return
        if value == DriverActivityKind.GRANT_REVOKED:
            return
        if value == DriverActivityKind.SESSION_STARTED:
            return
        if value == DriverActivityKind.SESSION_ENDED:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == DriverActivityKind.AUTHORIZED_ACTION:
            buf.write_i32(1)
        if value == DriverActivityKind.AUTHORIZATION_REFUSED:
            buf.write_i32(2)
        if value == DriverActivityKind.ACTION_FAILED:
            buf.write_i32(3)
        if value == DriverActivityKind.GRANT_ISSUED:
            buf.write_i32(4)
        if value == DriverActivityKind.GRANT_REVOKED:
            buf.write_i32(5)
        if value == DriverActivityKind.SESSION_STARTED:
            buf.write_i32(6)
        if value == DriverActivityKind.SESSION_ENDED:
            buf.write_i32(7)



class _UniffiFfiConverterSequenceString(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        for item in value:
            _UniffiFfiConverterString.check_lower(item)

    @classmethod
    def write(cls, value, buf):
        items = len(value)
        buf.write_i32(items)
        for item in value:
            _UniffiFfiConverterString.write(item, buf)

    @classmethod
    def read(cls, buf):
        count = buf.read_i32()
        if count < 0:
            raise InternalError("Unexpected negative sequence length")

        return [
            _UniffiFfiConverterString.read(buf) for i in range(count)
        ]

@dataclass
class DriverActivityEvent:
    """
    A content-free lifecycle event emitted after native authorization decides
    a call. It never carries arguments, page text, paths, typed input, images,
    or raw resource identities.
"""
    def __init__(self, *, kind:DriverActivityKind, unix_ms:int, tool_name:str, adapter_ids:typing.List[str], risk_class:str, public_session:typing.Optional[str], refusal_code:typing.Optional[str]):
        self.kind = kind
        self.unix_ms = unix_ms
        self.tool_name = tool_name
        self.adapter_ids = adapter_ids
        self.risk_class = risk_class
        self.public_session = public_session
        self.refusal_code = refusal_code




    def __str__(self):
        return "DriverActivityEvent(kind={}, unix_ms={}, tool_name={}, adapter_ids={}, risk_class={}, public_session={}, refusal_code={})".format(self.kind, self.unix_ms, self.tool_name, self.adapter_ids, self.risk_class, self.public_session, self.refusal_code)
    def __eq__(self, other):
        if self.kind != other.kind:
            return False
        if self.unix_ms != other.unix_ms:
            return False
        if self.tool_name != other.tool_name:
            return False
        if self.adapter_ids != other.adapter_ids:
            return False
        if self.risk_class != other.risk_class:
            return False
        if self.public_session != other.public_session:
            return False
        if self.refusal_code != other.refusal_code:
            return False
        return True

class _UniffiFfiConverterTypeDriverActivityEvent(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverActivityEvent(
            kind=_UniffiFfiConverterTypeDriverActivityKind.read(buf),
            unix_ms=_UniffiFfiConverterUInt64.read(buf),
            tool_name=_UniffiFfiConverterString.read(buf),
            adapter_ids=_UniffiFfiConverterSequenceString.read(buf),
            risk_class=_UniffiFfiConverterString.read(buf),
            public_session=_UniffiFfiConverterOptionalString.read(buf),
            refusal_code=_UniffiFfiConverterOptionalString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterTypeDriverActivityKind.check_lower(value.kind)
        _UniffiFfiConverterUInt64.check_lower(value.unix_ms)
        _UniffiFfiConverterString.check_lower(value.tool_name)
        _UniffiFfiConverterSequenceString.check_lower(value.adapter_ids)
        _UniffiFfiConverterString.check_lower(value.risk_class)
        _UniffiFfiConverterOptionalString.check_lower(value.public_session)
        _UniffiFfiConverterOptionalString.check_lower(value.refusal_code)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterTypeDriverActivityKind.write(value.kind, buf)
        _UniffiFfiConverterUInt64.write(value.unix_ms, buf)
        _UniffiFfiConverterString.write(value.tool_name, buf)
        _UniffiFfiConverterSequenceString.write(value.adapter_ids, buf)
        _UniffiFfiConverterString.write(value.risk_class, buf)
        _UniffiFfiConverterOptionalString.write(value.public_session, buf)
        _UniffiFfiConverterOptionalString.write(value.refusal_code, buf)






class DriverAuthorizationAction(enum.Enum):

    ALLOW = 0

    DENY = 1

    CANCEL = 2



class _UniffiFfiConverterTypeDriverAuthorizationAction(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return DriverAuthorizationAction.ALLOW
        if variant == 2:
            return DriverAuthorizationAction.DENY
        if variant == 3:
            return DriverAuthorizationAction.CANCEL
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == DriverAuthorizationAction.ALLOW:
            return
        if value == DriverAuthorizationAction.DENY:
            return
        if value == DriverAuthorizationAction.CANCEL:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == DriverAuthorizationAction.ALLOW:
            buf.write_i32(1)
        if value == DriverAuthorizationAction.DENY:
            buf.write_i32(2)
        if value == DriverAuthorizationAction.CANCEL:
            buf.write_i32(3)



@dataclass
class DriverAuthorizationDecision:
    def __init__(self, *, action:DriverAuthorizationAction, request_digest:str):
        self.action = action
        self.request_digest = request_digest




    def __str__(self):
        return "DriverAuthorizationDecision(action={}, request_digest={})".format(self.action, self.request_digest)
    def __eq__(self, other):
        if self.action != other.action:
            return False
        if self.request_digest != other.request_digest:
            return False
        return True

class _UniffiFfiConverterTypeDriverAuthorizationDecision(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverAuthorizationDecision(
            action=_UniffiFfiConverterTypeDriverAuthorizationAction.read(buf),
            request_digest=_UniffiFfiConverterString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterTypeDriverAuthorizationAction.check_lower(value.action)
        _UniffiFfiConverterString.check_lower(value.request_digest)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterTypeDriverAuthorizationAction.write(value.action, buf)
        _UniffiFfiConverterString.write(value.request_digest, buf)

@dataclass
class DriverAuthorizationRequest:
    """
    Content-bounded request delivered only to trusted host code.

    `resource_json` contains an attested resource identity. Hosts must avoid
    logging it or forwarding it to a model.
"""
    def __init__(self, *, schema:str, nonce:str, generation:int, daemon_instance:str, permission_mode:str, managed_policy_sha256:typing.Optional[str], user_policy_sha256:typing.Optional[str], adapter_id:str, risk_class:str, public_session:str, transport_session:str, resource_json:str, human_summary:str, expires_unix_ms:int, request_digest:str):
        self.schema = schema
        self.nonce = nonce
        self.generation = generation
        self.daemon_instance = daemon_instance
        self.permission_mode = permission_mode
        self.managed_policy_sha256 = managed_policy_sha256
        self.user_policy_sha256 = user_policy_sha256
        self.adapter_id = adapter_id
        self.risk_class = risk_class
        self.public_session = public_session
        self.transport_session = transport_session
        self.resource_json = resource_json
        self.human_summary = human_summary
        self.expires_unix_ms = expires_unix_ms
        self.request_digest = request_digest




    def __str__(self):
        return "DriverAuthorizationRequest(schema={}, nonce={}, generation={}, daemon_instance={}, permission_mode={}, managed_policy_sha256={}, user_policy_sha256={}, adapter_id={}, risk_class={}, public_session={}, transport_session={}, resource_json={}, human_summary={}, expires_unix_ms={}, request_digest={})".format(self.schema, self.nonce, self.generation, self.daemon_instance, self.permission_mode, self.managed_policy_sha256, self.user_policy_sha256, self.adapter_id, self.risk_class, self.public_session, self.transport_session, self.resource_json, self.human_summary, self.expires_unix_ms, self.request_digest)
    def __eq__(self, other):
        if self.schema != other.schema:
            return False
        if self.nonce != other.nonce:
            return False
        if self.generation != other.generation:
            return False
        if self.daemon_instance != other.daemon_instance:
            return False
        if self.permission_mode != other.permission_mode:
            return False
        if self.managed_policy_sha256 != other.managed_policy_sha256:
            return False
        if self.user_policy_sha256 != other.user_policy_sha256:
            return False
        if self.adapter_id != other.adapter_id:
            return False
        if self.risk_class != other.risk_class:
            return False
        if self.public_session != other.public_session:
            return False
        if self.transport_session != other.transport_session:
            return False
        if self.resource_json != other.resource_json:
            return False
        if self.human_summary != other.human_summary:
            return False
        if self.expires_unix_ms != other.expires_unix_ms:
            return False
        if self.request_digest != other.request_digest:
            return False
        return True

class _UniffiFfiConverterTypeDriverAuthorizationRequest(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverAuthorizationRequest(
            schema=_UniffiFfiConverterString.read(buf),
            nonce=_UniffiFfiConverterString.read(buf),
            generation=_UniffiFfiConverterUInt64.read(buf),
            daemon_instance=_UniffiFfiConverterString.read(buf),
            permission_mode=_UniffiFfiConverterString.read(buf),
            managed_policy_sha256=_UniffiFfiConverterOptionalString.read(buf),
            user_policy_sha256=_UniffiFfiConverterOptionalString.read(buf),
            adapter_id=_UniffiFfiConverterString.read(buf),
            risk_class=_UniffiFfiConverterString.read(buf),
            public_session=_UniffiFfiConverterString.read(buf),
            transport_session=_UniffiFfiConverterString.read(buf),
            resource_json=_UniffiFfiConverterString.read(buf),
            human_summary=_UniffiFfiConverterString.read(buf),
            expires_unix_ms=_UniffiFfiConverterUInt64.read(buf),
            request_digest=_UniffiFfiConverterString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.schema)
        _UniffiFfiConverterString.check_lower(value.nonce)
        _UniffiFfiConverterUInt64.check_lower(value.generation)
        _UniffiFfiConverterString.check_lower(value.daemon_instance)
        _UniffiFfiConverterString.check_lower(value.permission_mode)
        _UniffiFfiConverterOptionalString.check_lower(value.managed_policy_sha256)
        _UniffiFfiConverterOptionalString.check_lower(value.user_policy_sha256)
        _UniffiFfiConverterString.check_lower(value.adapter_id)
        _UniffiFfiConverterString.check_lower(value.risk_class)
        _UniffiFfiConverterString.check_lower(value.public_session)
        _UniffiFfiConverterString.check_lower(value.transport_session)
        _UniffiFfiConverterString.check_lower(value.resource_json)
        _UniffiFfiConverterString.check_lower(value.human_summary)
        _UniffiFfiConverterUInt64.check_lower(value.expires_unix_ms)
        _UniffiFfiConverterString.check_lower(value.request_digest)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.schema, buf)
        _UniffiFfiConverterString.write(value.nonce, buf)
        _UniffiFfiConverterUInt64.write(value.generation, buf)
        _UniffiFfiConverterString.write(value.daemon_instance, buf)
        _UniffiFfiConverterString.write(value.permission_mode, buf)
        _UniffiFfiConverterOptionalString.write(value.managed_policy_sha256, buf)
        _UniffiFfiConverterOptionalString.write(value.user_policy_sha256, buf)
        _UniffiFfiConverterString.write(value.adapter_id, buf)
        _UniffiFfiConverterString.write(value.risk_class, buf)
        _UniffiFfiConverterString.write(value.public_session, buf)
        _UniffiFfiConverterString.write(value.transport_session, buf)
        _UniffiFfiConverterString.write(value.resource_json, buf)
        _UniffiFfiConverterString.write(value.human_summary, buf)
        _UniffiFfiConverterUInt64.write(value.expires_unix_ms, buf)
        _UniffiFfiConverterString.write(value.request_digest, buf)

@dataclass
class DriverMetadata:
    """
    Transport-independent daemon identity used to prove that standalone and
    embedded SDK/MCP routes reached a compatible Rust implementation.
"""
    def __init__(self, *, driver_version:str, contract_version:str, tools_list_schema_version:str, capability_version:str, mcp_protocol_version:str, pid:int, embedded:bool, host_bundle_id:typing.Optional[str]):
        self.driver_version = driver_version
        self.contract_version = contract_version
        self.tools_list_schema_version = tools_list_schema_version
        self.capability_version = capability_version
        self.mcp_protocol_version = mcp_protocol_version
        self.pid = pid
        self.embedded = embedded
        self.host_bundle_id = host_bundle_id




    def __str__(self):
        return "DriverMetadata(driver_version={}, contract_version={}, tools_list_schema_version={}, capability_version={}, mcp_protocol_version={}, pid={}, embedded={}, host_bundle_id={})".format(self.driver_version, self.contract_version, self.tools_list_schema_version, self.capability_version, self.mcp_protocol_version, self.pid, self.embedded, self.host_bundle_id)
    def __eq__(self, other):
        if self.driver_version != other.driver_version:
            return False
        if self.contract_version != other.contract_version:
            return False
        if self.tools_list_schema_version != other.tools_list_schema_version:
            return False
        if self.capability_version != other.capability_version:
            return False
        if self.mcp_protocol_version != other.mcp_protocol_version:
            return False
        if self.pid != other.pid:
            return False
        if self.embedded != other.embedded:
            return False
        if self.host_bundle_id != other.host_bundle_id:
            return False
        return True

class _UniffiFfiConverterTypeDriverMetadata(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverMetadata(
            driver_version=_UniffiFfiConverterString.read(buf),
            contract_version=_UniffiFfiConverterString.read(buf),
            tools_list_schema_version=_UniffiFfiConverterString.read(buf),
            capability_version=_UniffiFfiConverterString.read(buf),
            mcp_protocol_version=_UniffiFfiConverterString.read(buf),
            pid=_UniffiFfiConverterUInt32.read(buf),
            embedded=_UniffiFfiConverterBoolean.read(buf),
            host_bundle_id=_UniffiFfiConverterOptionalString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.driver_version)
        _UniffiFfiConverterString.check_lower(value.contract_version)
        _UniffiFfiConverterString.check_lower(value.tools_list_schema_version)
        _UniffiFfiConverterString.check_lower(value.capability_version)
        _UniffiFfiConverterString.check_lower(value.mcp_protocol_version)
        _UniffiFfiConverterUInt32.check_lower(value.pid)
        _UniffiFfiConverterBoolean.check_lower(value.embedded)
        _UniffiFfiConverterOptionalString.check_lower(value.host_bundle_id)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.driver_version, buf)
        _UniffiFfiConverterString.write(value.contract_version, buf)
        _UniffiFfiConverterString.write(value.tools_list_schema_version, buf)
        _UniffiFfiConverterString.write(value.capability_version, buf)
        _UniffiFfiConverterString.write(value.mcp_protocol_version, buf)
        _UniffiFfiConverterUInt32.write(value.pid, buf)
        _UniffiFfiConverterBoolean.write(value.embedded, buf)
        _UniffiFfiConverterOptionalString.write(value.host_bundle_id, buf)

@dataclass
class DriverOptions:
    """
    Options for a same-process Cua Driver SDK runtime.
"""
    def __init__(self, *, claude_code_compatibility:bool):
        self.claude_code_compatibility = claude_code_compatibility




    def __str__(self):
        return "DriverOptions(claude_code_compatibility={})".format(self.claude_code_compatibility)
    def __eq__(self, other):
        if self.claude_code_compatibility != other.claude_code_compatibility:
            return False
        return True

class _UniffiFfiConverterTypeDriverOptions(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverOptions(
            claude_code_compatibility=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterBoolean.check_lower(value.claude_code_compatibility)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterBoolean.write(value.claude_code_compatibility, buf)

@dataclass
class DriverServiceHeader:
    def __init__(self, *, name:str, value:str):
        self.name = name
        self.value = value




    def __str__(self):
        return "DriverServiceHeader(name={}, value={})".format(self.name, self.value)
    def __eq__(self, other):
        if self.name != other.name:
            return False
        if self.value != other.value:
            return False
        return True

class _UniffiFfiConverterTypeDriverServiceHeader(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverServiceHeader(
            name=_UniffiFfiConverterString.read(buf),
            value=_UniffiFfiConverterString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.name)
        _UniffiFfiConverterString.check_lower(value.value)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.name, buf)
        _UniffiFfiConverterString.write(value.value, buf)

class _UniffiFfiConverterSequenceTypeDriverServiceHeader(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        for item in value:
            _UniffiFfiConverterTypeDriverServiceHeader.check_lower(item)

    @classmethod
    def write(cls, value, buf):
        items = len(value)
        buf.write_i32(items)
        for item in value:
            _UniffiFfiConverterTypeDriverServiceHeader.write(item, buf)

    @classmethod
    def read(cls, buf):
        count = buf.read_i32()
        if count < 0:
            raise InternalError("Unexpected negative sequence length")

        return [
            _UniffiFfiConverterTypeDriverServiceHeader.read(buf) for i in range(count)
        ]

class _UniffiFfiConverterBytes(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        size = buf.read_i32()
        if size < 0:
            raise InternalError("Unexpected negative byte string length")
        return buf.read(size)

    @staticmethod
    def check_lower(value):
        try:
            memoryview(value)
        except TypeError:
            raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__))

    @staticmethod
    def write(value, buf):
        buf.write_i32(len(value))
        buf.write(value)

@dataclass
class DriverServiceRequest:
    def __init__(self, *, method:str, path:str, headers:typing.List[DriverServiceHeader], body:bytes, timeout_ms:int):
        self.method = method
        self.path = path
        self.headers = headers
        self.body = body
        self.timeout_ms = timeout_ms




    def __str__(self):
        return "DriverServiceRequest(method={}, path={}, headers={}, body={}, timeout_ms={})".format(self.method, self.path, self.headers, self.body, self.timeout_ms)
    def __eq__(self, other):
        if self.method != other.method:
            return False
        if self.path != other.path:
            return False
        if self.headers != other.headers:
            return False
        if self.body != other.body:
            return False
        if self.timeout_ms != other.timeout_ms:
            return False
        return True

class _UniffiFfiConverterTypeDriverServiceRequest(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverServiceRequest(
            method=_UniffiFfiConverterString.read(buf),
            path=_UniffiFfiConverterString.read(buf),
            headers=_UniffiFfiConverterSequenceTypeDriverServiceHeader.read(buf),
            body=_UniffiFfiConverterBytes.read(buf),
            timeout_ms=_UniffiFfiConverterUInt64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.method)
        _UniffiFfiConverterString.check_lower(value.path)
        _UniffiFfiConverterSequenceTypeDriverServiceHeader.check_lower(value.headers)
        _UniffiFfiConverterBytes.check_lower(value.body)
        _UniffiFfiConverterUInt64.check_lower(value.timeout_ms)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.method, buf)
        _UniffiFfiConverterString.write(value.path, buf)
        _UniffiFfiConverterSequenceTypeDriverServiceHeader.write(value.headers, buf)
        _UniffiFfiConverterBytes.write(value.body, buf)
        _UniffiFfiConverterUInt64.write(value.timeout_ms, buf)

class _UniffiFfiConverterUInt16(_UniffiConverterPrimitiveInt):
    CLASS_NAME = "u16"
    VALUE_MIN = 0
    VALUE_MAX = 2**16

    @staticmethod
    def read(buf):
        return buf.read_u16()

    @staticmethod
    def write(value, buf):
        buf.write_u16(value)

@dataclass
class DriverServiceResponse:
    def __init__(self, *, status:int, headers:typing.List[DriverServiceHeader], body:bytes):
        self.status = status
        self.headers = headers
        self.body = body




    def __str__(self):
        return "DriverServiceResponse(status={}, headers={}, body={})".format(self.status, self.headers, self.body)
    def __eq__(self, other):
        if self.status != other.status:
            return False
        if self.headers != other.headers:
            return False
        if self.body != other.body:
            return False
        return True

class _UniffiFfiConverterTypeDriverServiceResponse(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return DriverServiceResponse(
            status=_UniffiFfiConverterUInt16.read(buf),
            headers=_UniffiFfiConverterSequenceTypeDriverServiceHeader.read(buf),
            body=_UniffiFfiConverterBytes.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterUInt16.check_lower(value.status)
        _UniffiFfiConverterSequenceTypeDriverServiceHeader.check_lower(value.headers)
        _UniffiFfiConverterBytes.check_lower(value.body)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterUInt16.write(value.status, buf)
        _UniffiFfiConverterSequenceTypeDriverServiceHeader.write(value.headers, buf)
        _UniffiFfiConverterBytes.write(value.body, buf)

@dataclass
class EmbeddedEnvironmentVariable:
    def __init__(self, *, name:str, value:str):
        self.name = name
        self.value = value




    def __str__(self):
        return "EmbeddedEnvironmentVariable(name={}, value={})".format(self.name, self.value)
    def __eq__(self, other):
        if self.name != other.name:
            return False
        if self.value != other.value:
            return False
        return True

class _UniffiFfiConverterTypeEmbeddedEnvironmentVariable(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return EmbeddedEnvironmentVariable(
            name=_UniffiFfiConverterString.read(buf),
            value=_UniffiFfiConverterString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.name)
        _UniffiFfiConverterString.check_lower(value.value)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.name, buf)
        _UniffiFfiConverterString.write(value.value, buf)

class _UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        for item in value:
            _UniffiFfiConverterTypeEmbeddedEnvironmentVariable.check_lower(item)

    @classmethod
    def write(cls, value, buf):
        items = len(value)
        buf.write_i32(items)
        for item in value:
            _UniffiFfiConverterTypeEmbeddedEnvironmentVariable.write(item, buf)

    @classmethod
    def read(cls, buf):
        count = buf.read_i32()
        if count < 0:
            raise InternalError("Unexpected negative sequence length")

        return [
            _UniffiFfiConverterTypeEmbeddedEnvironmentVariable.read(buf) for i in range(count)
        ]

@dataclass
class EmbeddedMcpConfiguration:
    def __init__(self, *, command:str, args:typing.List[str], environment:typing.List[EmbeddedEnvironmentVariable]):
        self.command = command
        self.args = args
        self.environment = environment




    def __str__(self):
        return "EmbeddedMcpConfiguration(command={}, args={}, environment={})".format(self.command, self.args, self.environment)
    def __eq__(self, other):
        if self.command != other.command:
            return False
        if self.args != other.args:
            return False
        if self.environment != other.environment:
            return False
        return True

class _UniffiFfiConverterTypeEmbeddedMcpConfiguration(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return EmbeddedMcpConfiguration(
            command=_UniffiFfiConverterString.read(buf),
            args=_UniffiFfiConverterSequenceString.read(buf),
            environment=_UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.command)
        _UniffiFfiConverterSequenceString.check_lower(value.args)
        _UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.check_lower(value.environment)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.command, buf)
        _UniffiFfiConverterSequenceString.write(value.args, buf)
        _UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.write(value.environment, buf)

@dataclass
class EmbeddedDriverConnection:
    def __init__(self, *, socket_path:str, pid:int, generation:str, driver_version:str, contract_version:str, mcp_protocol_version:str, mcp:EmbeddedMcpConfiguration):
        self.socket_path = socket_path
        self.pid = pid
        self.generation = generation
        self.driver_version = driver_version
        self.contract_version = contract_version
        self.mcp_protocol_version = mcp_protocol_version
        self.mcp = mcp




    def __str__(self):
        return "EmbeddedDriverConnection(socket_path={}, pid={}, generation={}, driver_version={}, contract_version={}, mcp_protocol_version={}, mcp={})".format(self.socket_path, self.pid, self.generation, self.driver_version, self.contract_version, self.mcp_protocol_version, self.mcp)
    def __eq__(self, other):
        if self.socket_path != other.socket_path:
            return False
        if self.pid != other.pid:
            return False
        if self.generation != other.generation:
            return False
        if self.driver_version != other.driver_version:
            return False
        if self.contract_version != other.contract_version:
            return False
        if self.mcp_protocol_version != other.mcp_protocol_version:
            return False
        if self.mcp != other.mcp:
            return False
        return True

class _UniffiFfiConverterTypeEmbeddedDriverConnection(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return EmbeddedDriverConnection(
            socket_path=_UniffiFfiConverterString.read(buf),
            pid=_UniffiFfiConverterUInt32.read(buf),
            generation=_UniffiFfiConverterString.read(buf),
            driver_version=_UniffiFfiConverterString.read(buf),
            contract_version=_UniffiFfiConverterString.read(buf),
            mcp_protocol_version=_UniffiFfiConverterString.read(buf),
            mcp=_UniffiFfiConverterTypeEmbeddedMcpConfiguration.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.socket_path)
        _UniffiFfiConverterUInt32.check_lower(value.pid)
        _UniffiFfiConverterString.check_lower(value.generation)
        _UniffiFfiConverterString.check_lower(value.driver_version)
        _UniffiFfiConverterString.check_lower(value.contract_version)
        _UniffiFfiConverterString.check_lower(value.mcp_protocol_version)
        _UniffiFfiConverterTypeEmbeddedMcpConfiguration.check_lower(value.mcp)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.socket_path, buf)
        _UniffiFfiConverterUInt32.write(value.pid, buf)
        _UniffiFfiConverterString.write(value.generation, buf)
        _UniffiFfiConverterString.write(value.driver_version, buf)
        _UniffiFfiConverterString.write(value.contract_version, buf)
        _UniffiFfiConverterString.write(value.mcp_protocol_version, buf)
        _UniffiFfiConverterTypeEmbeddedMcpConfiguration.write(value.mcp, buf)

class _UniffiFfiConverterInt32(_UniffiConverterPrimitiveInt):
    CLASS_NAME = "i32"
    VALUE_MIN = -2**31
    VALUE_MAX = 2**31

    @staticmethod
    def read(buf):
        return buf.read_i32()

    @staticmethod
    def write(value, buf):
        buf.write_i32(value)

class _UniffiFfiConverterOptionalInt32(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterInt32.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterInt32.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterInt32.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

@dataclass
class EmbeddedDriverDiagnostics:
    def __init__(self, *, lifecycle_phase:str, exit_code:typing.Optional[int], stderr_tail:str, stderr_truncated:bool):
        self.lifecycle_phase = lifecycle_phase
        self.exit_code = exit_code
        self.stderr_tail = stderr_tail
        self.stderr_truncated = stderr_truncated




    def __str__(self):
        return "EmbeddedDriverDiagnostics(lifecycle_phase={}, exit_code={}, stderr_tail={}, stderr_truncated={})".format(self.lifecycle_phase, self.exit_code, self.stderr_tail, self.stderr_truncated)
    def __eq__(self, other):
        if self.lifecycle_phase != other.lifecycle_phase:
            return False
        if self.exit_code != other.exit_code:
            return False
        if self.stderr_tail != other.stderr_tail:
            return False
        if self.stderr_truncated != other.stderr_truncated:
            return False
        return True

class _UniffiFfiConverterTypeEmbeddedDriverDiagnostics(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return EmbeddedDriverDiagnostics(
            lifecycle_phase=_UniffiFfiConverterString.read(buf),
            exit_code=_UniffiFfiConverterOptionalInt32.read(buf),
            stderr_tail=_UniffiFfiConverterString.read(buf),
            stderr_truncated=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.lifecycle_phase)
        _UniffiFfiConverterOptionalInt32.check_lower(value.exit_code)
        _UniffiFfiConverterString.check_lower(value.stderr_tail)
        _UniffiFfiConverterBoolean.check_lower(value.stderr_truncated)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.lifecycle_phase, buf)
        _UniffiFfiConverterOptionalInt32.write(value.exit_code, buf)
        _UniffiFfiConverterString.write(value.stderr_tail, buf)
        _UniffiFfiConverterBoolean.write(value.stderr_truncated, buf)

@dataclass
class EmbeddedDriverExit:
    def __init__(self, *, generation:str, code:typing.Optional[int], success:bool):
        self.generation = generation
        self.code = code
        self.success = success




    def __str__(self):
        return "EmbeddedDriverExit(generation={}, code={}, success={})".format(self.generation, self.code, self.success)
    def __eq__(self, other):
        if self.generation != other.generation:
            return False
        if self.code != other.code:
            return False
        if self.success != other.success:
            return False
        return True

class _UniffiFfiConverterTypeEmbeddedDriverExit(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return EmbeddedDriverExit(
            generation=_UniffiFfiConverterString.read(buf),
            code=_UniffiFfiConverterOptionalInt32.read(buf),
            success=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.generation)
        _UniffiFfiConverterOptionalInt32.check_lower(value.code)
        _UniffiFfiConverterBoolean.check_lower(value.success)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.generation, buf)
        _UniffiFfiConverterOptionalInt32.write(value.code, buf)
        _UniffiFfiConverterBoolean.write(value.success, buf)

class _UniffiFfiConverterOptionalUInt64(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterUInt64.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterUInt64.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterUInt64.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")






class EmbeddedPermissionMode(enum.Enum):

    STANDARD = 0

    BOUNDED = 1

    UNRESTRICTED = 2



class _UniffiFfiConverterTypeEmbeddedPermissionMode(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return EmbeddedPermissionMode.STANDARD
        if variant == 2:
            return EmbeddedPermissionMode.BOUNDED
        if variant == 3:
            return EmbeddedPermissionMode.UNRESTRICTED
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == EmbeddedPermissionMode.STANDARD:
            return
        if value == EmbeddedPermissionMode.BOUNDED:
            return
        if value == EmbeddedPermissionMode.UNRESTRICTED:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == EmbeddedPermissionMode.STANDARD:
            buf.write_i32(1)
        if value == EmbeddedPermissionMode.BOUNDED:
            buf.write_i32(2)
        if value == EmbeddedPermissionMode.UNRESTRICTED:
            buf.write_i32(3)



class _UniffiFfiConverterOptionalTypeEmbeddedPermissionMode(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeEmbeddedPermissionMode.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeEmbeddedPermissionMode.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeEmbeddedPermissionMode.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

@dataclass
class EmbeddedDriverHostOptions:
    def __init__(self, *, binary_path:str, host_bundle_id:str, socket_path:typing.Optional[str], startup_timeout_ms:typing.Optional[int], shutdown_timeout_ms:typing.Optional[int], permission_mode:typing.Optional[EmbeddedPermissionMode], capability_manifest_path:typing.Optional[str] = _DEFAULT, approve_capability_manifest:bool = False, session_policy_path:typing.Optional[str], approve_session_policy:bool, dangerously_bypass_approvals:bool, environment:typing.List[EmbeddedEnvironmentVariable], inherit_stderr:bool, no_overlay:bool = False, capture_stderr:bool = False):
        self.binary_path = binary_path
        self.host_bundle_id = host_bundle_id
        self.socket_path = socket_path
        self.startup_timeout_ms = startup_timeout_ms
        self.shutdown_timeout_ms = shutdown_timeout_ms
        self.permission_mode = permission_mode
        if capability_manifest_path is _DEFAULT:
            self.capability_manifest_path = None
        else:
            self.capability_manifest_path = capability_manifest_path
        self.approve_capability_manifest = approve_capability_manifest
        self.session_policy_path = session_policy_path
        self.approve_session_policy = approve_session_policy
        self.dangerously_bypass_approvals = dangerously_bypass_approvals
        self.environment = environment
        self.inherit_stderr = inherit_stderr
        self.no_overlay = no_overlay
        self.capture_stderr = capture_stderr




    def __str__(self):
        return "EmbeddedDriverHostOptions(binary_path={}, host_bundle_id={}, socket_path={}, startup_timeout_ms={}, shutdown_timeout_ms={}, permission_mode={}, capability_manifest_path={}, approve_capability_manifest={}, session_policy_path={}, approve_session_policy={}, dangerously_bypass_approvals={}, environment={}, inherit_stderr={}, no_overlay={}, capture_stderr={})".format(self.binary_path, self.host_bundle_id, self.socket_path, self.startup_timeout_ms, self.shutdown_timeout_ms, self.permission_mode, self.capability_manifest_path, self.approve_capability_manifest, self.session_policy_path, self.approve_session_policy, self.dangerously_bypass_approvals, self.environment, self.inherit_stderr, self.no_overlay, self.capture_stderr)
    def __eq__(self, other):
        if self.binary_path != other.binary_path:
            return False
        if self.host_bundle_id != other.host_bundle_id:
            return False
        if self.socket_path != other.socket_path:
            return False
        if self.startup_timeout_ms != other.startup_timeout_ms:
            return False
        if self.shutdown_timeout_ms != other.shutdown_timeout_ms:
            return False
        if self.permission_mode != other.permission_mode:
            return False
        if self.capability_manifest_path != other.capability_manifest_path:
            return False
        if self.approve_capability_manifest != other.approve_capability_manifest:
            return False
        if self.session_policy_path != other.session_policy_path:
            return False
        if self.approve_session_policy != other.approve_session_policy:
            return False
        if self.dangerously_bypass_approvals != other.dangerously_bypass_approvals:
            return False
        if self.environment != other.environment:
            return False
        if self.inherit_stderr != other.inherit_stderr:
            return False
        if self.no_overlay != other.no_overlay:
            return False
        if self.capture_stderr != other.capture_stderr:
            return False
        return True

class _UniffiFfiConverterTypeEmbeddedDriverHostOptions(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return EmbeddedDriverHostOptions(
            binary_path=_UniffiFfiConverterString.read(buf),
            host_bundle_id=_UniffiFfiConverterString.read(buf),
            socket_path=_UniffiFfiConverterOptionalString.read(buf),
            startup_timeout_ms=_UniffiFfiConverterOptionalUInt64.read(buf),
            shutdown_timeout_ms=_UniffiFfiConverterOptionalUInt64.read(buf),
            permission_mode=_UniffiFfiConverterOptionalTypeEmbeddedPermissionMode.read(buf),
            capability_manifest_path=_UniffiFfiConverterOptionalString.read(buf),
            approve_capability_manifest=_UniffiFfiConverterBoolean.read(buf),
            session_policy_path=_UniffiFfiConverterOptionalString.read(buf),
            approve_session_policy=_UniffiFfiConverterBoolean.read(buf),
            dangerously_bypass_approvals=_UniffiFfiConverterBoolean.read(buf),
            environment=_UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.read(buf),
            inherit_stderr=_UniffiFfiConverterBoolean.read(buf),
            no_overlay=_UniffiFfiConverterBoolean.read(buf),
            capture_stderr=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.binary_path)
        _UniffiFfiConverterString.check_lower(value.host_bundle_id)
        _UniffiFfiConverterOptionalString.check_lower(value.socket_path)
        _UniffiFfiConverterOptionalUInt64.check_lower(value.startup_timeout_ms)
        _UniffiFfiConverterOptionalUInt64.check_lower(value.shutdown_timeout_ms)
        _UniffiFfiConverterOptionalTypeEmbeddedPermissionMode.check_lower(value.permission_mode)
        _UniffiFfiConverterOptionalString.check_lower(value.capability_manifest_path)
        _UniffiFfiConverterBoolean.check_lower(value.approve_capability_manifest)
        _UniffiFfiConverterOptionalString.check_lower(value.session_policy_path)
        _UniffiFfiConverterBoolean.check_lower(value.approve_session_policy)
        _UniffiFfiConverterBoolean.check_lower(value.dangerously_bypass_approvals)
        _UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.check_lower(value.environment)
        _UniffiFfiConverterBoolean.check_lower(value.inherit_stderr)
        _UniffiFfiConverterBoolean.check_lower(value.no_overlay)
        _UniffiFfiConverterBoolean.check_lower(value.capture_stderr)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.binary_path, buf)
        _UniffiFfiConverterString.write(value.host_bundle_id, buf)
        _UniffiFfiConverterOptionalString.write(value.socket_path, buf)
        _UniffiFfiConverterOptionalUInt64.write(value.startup_timeout_ms, buf)
        _UniffiFfiConverterOptionalUInt64.write(value.shutdown_timeout_ms, buf)
        _UniffiFfiConverterOptionalTypeEmbeddedPermissionMode.write(value.permission_mode, buf)
        _UniffiFfiConverterOptionalString.write(value.capability_manifest_path, buf)
        _UniffiFfiConverterBoolean.write(value.approve_capability_manifest, buf)
        _UniffiFfiConverterOptionalString.write(value.session_policy_path, buf)
        _UniffiFfiConverterBoolean.write(value.approve_session_policy, buf)
        _UniffiFfiConverterBoolean.write(value.dangerously_bypass_approvals, buf)
        _UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.write(value.environment, buf)
        _UniffiFfiConverterBoolean.write(value.inherit_stderr, buf)
        _UniffiFfiConverterBoolean.write(value.no_overlay, buf)
        _UniffiFfiConverterBoolean.write(value.capture_stderr, buf)

@dataclass
class ForeignDriverChannelIdentity:
    """
    Opaque context established by the authenticated carrier, not guest claims.
"""
    def __init__(self, *, authenticated_principal:str, connection_generation:str):
        self.authenticated_principal = authenticated_principal
        self.connection_generation = connection_generation




    def __str__(self):
        return "ForeignDriverChannelIdentity(authenticated_principal={}, connection_generation={})".format(self.authenticated_principal, self.connection_generation)
    def __eq__(self, other):
        if self.authenticated_principal != other.authenticated_principal:
            return False
        if self.connection_generation != other.connection_generation:
            return False
        return True

class _UniffiFfiConverterTypeForeignDriverChannelIdentity(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ForeignDriverChannelIdentity(
            authenticated_principal=_UniffiFfiConverterString.read(buf),
            connection_generation=_UniffiFfiConverterString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.authenticated_principal)
        _UniffiFfiConverterString.check_lower(value.connection_generation)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.authenticated_principal, buf)
        _UniffiFfiConverterString.write(value.connection_generation, buf)



# ForeignDriverChannelError
# 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 ForeignDriverChannelError(Exception):
    pass

_UniffiTempForeignDriverChannelError = ForeignDriverChannelError

class ForeignDriverChannelError:  # type: ignore

    class Failed(_UniffiTempForeignDriverChannelError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "ForeignDriverChannelError.Failed({})".format(str(self))
    _UniffiTempForeignDriverChannelError.Failed = Failed # type: ignore

ForeignDriverChannelError = _UniffiTempForeignDriverChannelError # type: ignore
del _UniffiTempForeignDriverChannelError


class _UniffiFfiConverterTypeForeignDriverChannelError(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return ForeignDriverChannelError.Failed(
                _UniffiFfiConverterString.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if isinstance(value, ForeignDriverChannelError.Failed):
            _UniffiFfiConverterString.check_lower(value.reason)
            return

    @staticmethod
    def write(value, buf):
        if isinstance(value, ForeignDriverChannelError.Failed):
            buf.write_i32(1)
            _UniffiFfiConverterString.write(value.reason, buf)

@dataclass
class ForeignDriverChannelCapabilities:
    def __init__(self, *, minimum_envelope_version:int, maximum_envelope_version:int, supports_cancellation:bool):
        self.minimum_envelope_version = minimum_envelope_version
        self.maximum_envelope_version = maximum_envelope_version
        self.supports_cancellation = supports_cancellation




    def __str__(self):
        return "ForeignDriverChannelCapabilities(minimum_envelope_version={}, maximum_envelope_version={}, supports_cancellation={})".format(self.minimum_envelope_version, self.maximum_envelope_version, self.supports_cancellation)
    def __eq__(self, other):
        if self.minimum_envelope_version != other.minimum_envelope_version:
            return False
        if self.maximum_envelope_version != other.maximum_envelope_version:
            return False
        if self.supports_cancellation != other.supports_cancellation:
            return False
        return True

class _UniffiFfiConverterTypeForeignDriverChannelCapabilities(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ForeignDriverChannelCapabilities(
            minimum_envelope_version=_UniffiFfiConverterUInt32.read(buf),
            maximum_envelope_version=_UniffiFfiConverterUInt32.read(buf),
            supports_cancellation=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterUInt32.check_lower(value.minimum_envelope_version)
        _UniffiFfiConverterUInt32.check_lower(value.maximum_envelope_version)
        _UniffiFfiConverterBoolean.check_lower(value.supports_cancellation)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterUInt32.write(value.minimum_envelope_version, buf)
        _UniffiFfiConverterUInt32.write(value.maximum_envelope_version, buf)
        _UniffiFfiConverterBoolean.write(value.supports_cancellation, buf)

@dataclass
class ForeignDriverRequestEnvelope:
    def __init__(self, *, envelope_version:int, request_id:str, operation:str, name:typing.Optional[str], arguments_json:typing.Optional[str], deadline_unix_ms:int):
        self.envelope_version = envelope_version
        self.request_id = request_id
        self.operation = operation
        self.name = name
        self.arguments_json = arguments_json
        self.deadline_unix_ms = deadline_unix_ms




    def __str__(self):
        return "ForeignDriverRequestEnvelope(envelope_version={}, request_id={}, operation={}, name={}, arguments_json={}, deadline_unix_ms={})".format(self.envelope_version, self.request_id, self.operation, self.name, self.arguments_json, self.deadline_unix_ms)
    def __eq__(self, other):
        if self.envelope_version != other.envelope_version:
            return False
        if self.request_id != other.request_id:
            return False
        if self.operation != other.operation:
            return False
        if self.name != other.name:
            return False
        if self.arguments_json != other.arguments_json:
            return False
        if self.deadline_unix_ms != other.deadline_unix_ms:
            return False
        return True

class _UniffiFfiConverterTypeForeignDriverRequestEnvelope(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ForeignDriverRequestEnvelope(
            envelope_version=_UniffiFfiConverterUInt32.read(buf),
            request_id=_UniffiFfiConverterString.read(buf),
            operation=_UniffiFfiConverterString.read(buf),
            name=_UniffiFfiConverterOptionalString.read(buf),
            arguments_json=_UniffiFfiConverterOptionalString.read(buf),
            deadline_unix_ms=_UniffiFfiConverterUInt64.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterUInt32.check_lower(value.envelope_version)
        _UniffiFfiConverterString.check_lower(value.request_id)
        _UniffiFfiConverterString.check_lower(value.operation)
        _UniffiFfiConverterOptionalString.check_lower(value.name)
        _UniffiFfiConverterOptionalString.check_lower(value.arguments_json)
        _UniffiFfiConverterUInt64.check_lower(value.deadline_unix_ms)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterUInt32.write(value.envelope_version, buf)
        _UniffiFfiConverterString.write(value.request_id, buf)
        _UniffiFfiConverterString.write(value.operation, buf)
        _UniffiFfiConverterOptionalString.write(value.name, buf)
        _UniffiFfiConverterOptionalString.write(value.arguments_json, buf)
        _UniffiFfiConverterUInt64.write(value.deadline_unix_ms, buf)

@dataclass
class ForeignDriverResponseEnvelope:
    def __init__(self, *, envelope_version:int, request_id:str, ok:bool, result_json:typing.Optional[str], error:typing.Optional[str], error_code:typing.Optional[str], completion_known:bool):
        self.envelope_version = envelope_version
        self.request_id = request_id
        self.ok = ok
        self.result_json = result_json
        self.error = error
        self.error_code = error_code
        self.completion_known = completion_known




    def __str__(self):
        return "ForeignDriverResponseEnvelope(envelope_version={}, request_id={}, ok={}, result_json={}, error={}, error_code={}, completion_known={})".format(self.envelope_version, self.request_id, self.ok, self.result_json, self.error, self.error_code, self.completion_known)
    def __eq__(self, other):
        if self.envelope_version != other.envelope_version:
            return False
        if self.request_id != other.request_id:
            return False
        if self.ok != other.ok:
            return False
        if self.result_json != other.result_json:
            return False
        if self.error != other.error:
            return False
        if self.error_code != other.error_code:
            return False
        if self.completion_known != other.completion_known:
            return False
        return True

class _UniffiFfiConverterTypeForeignDriverResponseEnvelope(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ForeignDriverResponseEnvelope(
            envelope_version=_UniffiFfiConverterUInt32.read(buf),
            request_id=_UniffiFfiConverterString.read(buf),
            ok=_UniffiFfiConverterBoolean.read(buf),
            result_json=_UniffiFfiConverterOptionalString.read(buf),
            error=_UniffiFfiConverterOptionalString.read(buf),
            error_code=_UniffiFfiConverterOptionalString.read(buf),
            completion_known=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterUInt32.check_lower(value.envelope_version)
        _UniffiFfiConverterString.check_lower(value.request_id)
        _UniffiFfiConverterBoolean.check_lower(value.ok)
        _UniffiFfiConverterOptionalString.check_lower(value.result_json)
        _UniffiFfiConverterOptionalString.check_lower(value.error)
        _UniffiFfiConverterOptionalString.check_lower(value.error_code)
        _UniffiFfiConverterBoolean.check_lower(value.completion_known)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterUInt32.write(value.envelope_version, buf)
        _UniffiFfiConverterString.write(value.request_id, buf)
        _UniffiFfiConverterBoolean.write(value.ok, buf)
        _UniffiFfiConverterOptionalString.write(value.result_json, buf)
        _UniffiFfiConverterOptionalString.write(value.error, buf)
        _UniffiFfiConverterOptionalString.write(value.error_code, buf)
        _UniffiFfiConverterBoolean.write(value.completion_known, buf)

@dataclass
class TrustedSessionOptions:
    """
    Trusted host request for one immutable, connection-bound action surface.
"""
    def __init__(self, *, public_session:str, mode:SessionPermissionMode, ttl_seconds:int, idle_ttl_seconds:int, capability_manifest_path:typing.Optional[str] = _DEFAULT, bounded_manifest_path:typing.Optional[str]):
        self.public_session = public_session
        self.mode = mode
        self.ttl_seconds = ttl_seconds
        self.idle_ttl_seconds = idle_ttl_seconds
        if capability_manifest_path is _DEFAULT:
            self.capability_manifest_path = None
        else:
            self.capability_manifest_path = capability_manifest_path
        self.bounded_manifest_path = bounded_manifest_path




    def __str__(self):
        return "TrustedSessionOptions(public_session={}, mode={}, ttl_seconds={}, idle_ttl_seconds={}, capability_manifest_path={}, bounded_manifest_path={})".format(self.public_session, self.mode, self.ttl_seconds, self.idle_ttl_seconds, self.capability_manifest_path, self.bounded_manifest_path)
    def __eq__(self, other):
        if self.public_session != other.public_session:
            return False
        if self.mode != other.mode:
            return False
        if self.ttl_seconds != other.ttl_seconds:
            return False
        if self.idle_ttl_seconds != other.idle_ttl_seconds:
            return False
        if self.capability_manifest_path != other.capability_manifest_path:
            return False
        if self.bounded_manifest_path != other.bounded_manifest_path:
            return False
        return True

class _UniffiFfiConverterTypeTrustedSessionOptions(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return TrustedSessionOptions(
            public_session=_UniffiFfiConverterString.read(buf),
            mode=_UniffiFfiConverterTypeSessionPermissionMode.read(buf),
            ttl_seconds=_UniffiFfiConverterUInt64.read(buf),
            idle_ttl_seconds=_UniffiFfiConverterUInt64.read(buf),
            capability_manifest_path=_UniffiFfiConverterOptionalString.read(buf),
            bounded_manifest_path=_UniffiFfiConverterOptionalString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.public_session)
        _UniffiFfiConverterTypeSessionPermissionMode.check_lower(value.mode)
        _UniffiFfiConverterUInt64.check_lower(value.ttl_seconds)
        _UniffiFfiConverterUInt64.check_lower(value.idle_ttl_seconds)
        _UniffiFfiConverterOptionalString.check_lower(value.capability_manifest_path)
        _UniffiFfiConverterOptionalString.check_lower(value.bounded_manifest_path)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.public_session, buf)
        _UniffiFfiConverterTypeSessionPermissionMode.write(value.mode, buf)
        _UniffiFfiConverterUInt64.write(value.ttl_seconds, buf)
        _UniffiFfiConverterUInt64.write(value.idle_ttl_seconds, buf)
        _UniffiFfiConverterOptionalString.write(value.capability_manifest_path, buf)
        _UniffiFfiConverterOptionalString.write(value.bounded_manifest_path, buf)


class ForeignDriverEnvelopeChannel():
    """
    Trusted host implementation of the existing remote transport contract.
    Identity is captured once when each channel is adapted. A bound channel
    must retain its parent's authenticated principal and connection generation.
"""

    def identity(self, ) -> ForeignDriverChannelIdentity:
        raise NotImplementedError
    async def negotiate(self, ) -> ForeignDriverChannelCapabilities:
        raise NotImplementedError
    async def exchange(self, request: ForeignDriverRequestEnvelope) -> ForeignDriverResponseEnvelope:
        raise NotImplementedError
    async def bind_session(self, options: TrustedSessionOptions) -> ForeignDriverBoundChannel:
        raise NotImplementedError
    async def cancel(self, request_id: str) -> None:
        raise NotImplementedError
    async def close(self, ) -> None:
        raise NotImplementedError

class ForeignDriverEnvelopeChannelImpl(ForeignDriverEnvelopeChannel):
    """
    Trusted host implementation of the existing remote transport contract.
    Identity is captured once when each channel is adapted. A bound channel
    must retain its parent's authenticated principal and connection generation.
"""

    _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_cua_driver_sdk_fn_free_foreigndriverenvelopechannel, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_foreigndriverenvelopechannel, 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
    def identity(self, ) -> ForeignDriverChannelIdentity:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeForeignDriverChannelIdentity.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeForeignDriverChannelError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_identity,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def negotiate(self, ) -> ForeignDriverChannelCapabilities:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeForeignDriverChannelCapabilities.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeForeignDriverChannelError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_negotiate(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def exchange(self, request: ForeignDriverRequestEnvelope) -> ForeignDriverResponseEnvelope:

        _UniffiFfiConverterTypeForeignDriverRequestEnvelope.check_lower(request)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterTypeForeignDriverRequestEnvelope.lower(request),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeForeignDriverResponseEnvelope.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeForeignDriverChannelError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_exchange(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def bind_session(self, options: TrustedSessionOptions) -> ForeignDriverBoundChannel:

        _UniffiFfiConverterTypeTrustedSessionOptions.check_lower(options)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterTypeTrustedSessionOptions.lower(options),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeForeignDriverBoundChannel.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeForeignDriverChannelError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_bind_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def cancel(self, request_id: str) -> None:

        _UniffiFfiConverterString.check_lower(request_id)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterString.lower(request_id),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = _UniffiFfiConverterTypeForeignDriverChannelError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_cancel(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_void,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def close(self, ) -> None:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = _UniffiFfiConverterTypeForeignDriverChannelError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_foreigndriverenvelopechannel_close(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_void,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )




# Put all the bits inside a class to keep the top-level namespace clean
class _UniffiTraitImplForeignDriverEnvelopeChannelImpl:
    # For each method, generate a callback function to pass to Rust

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD0
    def identity(
            uniffi_handle,
            uniffi_out_return,
            uniffi_call_status_ptr,
        ):
        uniffi_obj = _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = ()
            uniffi_method = uniffi_obj.identity
            return uniffi_method(*uniffi_args)
        def write_return_value(v):
            uniffi_out_return[0] = _UniffiFfiConverterTypeForeignDriverChannelIdentity.lower(v)
        _uniffi_trait_interface_call_with_error(
                uniffi_call_status_ptr.contents,
                make_call,
                write_return_value,
                ForeignDriverChannelError,
                _UniffiFfiConverterTypeForeignDriverChannelError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD1
    def negotiate(
            uniffi_handle,
            uniffi_future_callback,
            uniffi_callback_data,
            uniffi_out_dropped_callback,
        ):
        uniffi_obj = _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = ()
            uniffi_method = uniffi_obj.negotiate
            return uniffi_method(*uniffi_args)
        def handle_success(return_value):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultRustBuffer(
                    _UniffiFfiConverterTypeForeignDriverChannelCapabilities.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_remote_channel_call_async(
            uniffi_obj._uniffi_foreign_driver_event_loop,
            make_call,
            uniffi_out_dropped_callback,
            handle_success,
            handle_error,
            ForeignDriverChannelError,
            _UniffiFfiConverterTypeForeignDriverChannelError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD2
    def exchange(
            uniffi_handle,
            request,
            uniffi_future_callback,
            uniffi_callback_data,
            uniffi_out_dropped_callback,
        ):
        uniffi_obj = _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = (_UniffiFfiConverterTypeForeignDriverRequestEnvelope.lift(request), )
            uniffi_method = uniffi_obj.exchange
            return uniffi_method(*uniffi_args)
        def handle_success(return_value):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultRustBuffer(
                    _UniffiFfiConverterTypeForeignDriverResponseEnvelope.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_remote_channel_call_async(
            uniffi_obj._uniffi_foreign_driver_event_loop,
            make_call,
            uniffi_out_dropped_callback,
            handle_success,
            handle_error,
            ForeignDriverChannelError,
            _UniffiFfiConverterTypeForeignDriverChannelError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD3
    def bind_session(
            uniffi_handle,
            options,
            uniffi_future_callback,
            uniffi_callback_data,
            uniffi_out_dropped_callback,
        ):
        uniffi_obj = _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = (_UniffiFfiConverterTypeTrustedSessionOptions.lift(options), )
            uniffi_method = uniffi_obj.bind_session
            return uniffi_method(*uniffi_args)
        def handle_success(return_value):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultRustBuffer(
                    _UniffiFfiConverterTypeForeignDriverBoundChannel.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_remote_channel_call_async(
            uniffi_obj._uniffi_foreign_driver_event_loop,
            make_call,
            uniffi_out_dropped_callback,
            handle_success,
            handle_error,
            ForeignDriverChannelError,
            _UniffiFfiConverterTypeForeignDriverChannelError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD4
    def cancel(
            uniffi_handle,
            request_id,
            uniffi_future_callback,
            uniffi_callback_data,
            uniffi_out_dropped_callback,
        ):
        uniffi_obj = _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = (_UniffiFfiConverterString.lift(request_id), )
            uniffi_method = uniffi_obj.cancel
            return uniffi_method(*uniffi_args)
        def handle_success(return_value):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultVoid(
                    _UniffiRustCallStatus.default()
                )
            )

        def handle_error(status_code, rust_buffer):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultVoid(
                    _UniffiRustCallStatus(status_code, rust_buffer),
                )
            )
        _uniffi_remote_channel_call_async(
            uniffi_obj._uniffi_foreign_driver_event_loop,
            make_call,
            uniffi_out_dropped_callback,
            handle_success,
            handle_error,
            ForeignDriverChannelError,
            _UniffiFfiConverterTypeForeignDriverChannelError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL_METHOD5
    def close(
            uniffi_handle,
            uniffi_future_callback,
            uniffi_callback_data,
            uniffi_out_dropped_callback,
        ):
        uniffi_obj = _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = ()
            uniffi_method = uniffi_obj.close
            return uniffi_method(*uniffi_args)
        def handle_success(return_value):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultVoid(
                    _UniffiRustCallStatus.default()
                )
            )

        def handle_error(status_code, rust_buffer):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultVoid(
                    _UniffiRustCallStatus(status_code, rust_buffer),
                )
            )
        _uniffi_remote_channel_call_async(
            uniffi_obj._uniffi_foreign_driver_event_loop,
            make_call,
            uniffi_out_dropped_callback,
            handle_success,
            handle_error,
            ForeignDriverChannelError,
            _UniffiFfiConverterTypeForeignDriverChannelError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL
    def _uniffi_free(uniffi_handle):
        _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.remove(uniffi_handle)

    @_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_FOREIGN_DRIVER_ENVELOPE_CHANNEL
    def _uniffi_clone(uniffi_handle):
        return _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.clone(uniffi_handle)

    # Generate the FFI VTable.  This has a field for each callback interface method.
    _uniffi_vtable = _UniffiVTableCallbackInterfaceCuaDriverSdkForeignDriverEnvelopeChannel(
        _uniffi_free,
        _uniffi_clone,
        identity,
        negotiate,
        exchange,
        bind_session,
        cancel,
        close,
    )
    # 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_cua_driver_sdk_fn_init_callback_vtable_foreigndriverenvelopechannel(ctypes.byref(_uniffi_vtable))

class _UniffiFfiConverterTypeForeignDriverEnvelopeChannel:
    _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 ForeignDriverEnvelopeChannelImpl._uniffi_make_instance(value)
        else:
            # Python-generated handle, get the object from the handle map
            return _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._handle_map.remove(value)

    @staticmethod
    def check_lower(value: ForeignDriverEnvelopeChannel):
        if not isinstance(value, ForeignDriverEnvelopeChannel):
            raise TypeError("Expected ForeignDriverEnvelopeChannel subclass, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: ForeignDriverEnvelopeChannel):
         if isinstance(value, ForeignDriverEnvelopeChannelImpl):
            # 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.
            eventloop = asyncio.get_running_loop()
            with _UNIFFI_REMOTE_CHANNEL_LOOP_LOCK:
                owner = getattr(value, "_uniffi_foreign_driver_event_loop", eventloop)
                if owner is not eventloop:
                    raise RuntimeError("remote Driver channel belongs to a different asyncio event loop")
                value._uniffi_foreign_driver_event_loop = eventloop
            return _UniffiFfiConverterTypeForeignDriverEnvelopeChannel._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: ForeignDriverEnvelopeChannel, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))

@dataclass
class ForeignDriverBoundChannel:
    def __init__(self, *, channel:ForeignDriverEnvelopeChannel):
        self.channel = channel




    def __str__(self):
        return "ForeignDriverBoundChannel(channel={})".format(self.channel)
    def __eq__(self, other):
        if self.channel != other.channel:
            return False
        return True

class _UniffiFfiConverterTypeForeignDriverBoundChannel(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ForeignDriverBoundChannel(
            channel=_UniffiFfiConverterTypeForeignDriverEnvelopeChannel.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterTypeForeignDriverEnvelopeChannel.check_lower(value.channel)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterTypeForeignDriverEnvelopeChannel.write(value.channel, buf)

@dataclass
class ImageContent:
    def __init__(self, *, mime_type:str, data_base64:str):
        self.mime_type = mime_type
        self.data_base64 = data_base64




    def __str__(self):
        return "ImageContent(mime_type={}, data_base64={})".format(self.mime_type, self.data_base64)
    def __eq__(self, other):
        if self.mime_type != other.mime_type:
            return False
        if self.data_base64 != other.data_base64:
            return False
        return True

class _UniffiFfiConverterTypeImageContent(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ImageContent(
            mime_type=_UniffiFfiConverterString.read(buf),
            data_base64=_UniffiFfiConverterString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.mime_type)
        _UniffiFfiConverterString.check_lower(value.data_base64)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.mime_type, buf)
        _UniffiFfiConverterString.write(value.data_base64, buf)

@dataclass
class MacOsPermissionStatus:
    """
    The TCC grants required by a macOS host application before it starts an
    embedded driver. These probes execute in the importing SDK process so the
    operating system attributes the request to the host application.
"""
    def __init__(self, *, accessibility:bool, screen_recording:bool):
        self.accessibility = accessibility
        self.screen_recording = screen_recording




    def __str__(self):
        return "MacOsPermissionStatus(accessibility={}, screen_recording={})".format(self.accessibility, self.screen_recording)
    def __eq__(self, other):
        if self.accessibility != other.accessibility:
            return False
        if self.screen_recording != other.screen_recording:
            return False
        return True

class _UniffiFfiConverterTypeMacOsPermissionStatus(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return MacOsPermissionStatus(
            accessibility=_UniffiFfiConverterBoolean.read(buf),
            screen_recording=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterBoolean.check_lower(value.accessibility)
        _UniffiFfiConverterBoolean.check_lower(value.screen_recording)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterBoolean.write(value.accessibility, buf)
        _UniffiFfiConverterBoolean.write(value.screen_recording, buf)

@dataclass
class PrivateWorkerOptions:
    """
    Options for a directly supervised process-isolated runtime.

    The child receives configuration and actions only over inherited stdio. It
    exposes no socket and cannot be reconnected after the host channel closes.
"""
    def __init__(self, *, binary_path:str, host_bundle_id:str, startup_timeout_ms:typing.Optional[int], shutdown_timeout_ms:typing.Optional[int], configured_driver:ConfiguredDriverOptions, environment:typing.List[EmbeddedEnvironmentVariable], inherit_stderr:bool):
        self.binary_path = binary_path
        self.host_bundle_id = host_bundle_id
        self.startup_timeout_ms = startup_timeout_ms
        self.shutdown_timeout_ms = shutdown_timeout_ms
        self.configured_driver = configured_driver
        self.environment = environment
        self.inherit_stderr = inherit_stderr




    def __str__(self):
        return "PrivateWorkerOptions(binary_path={}, host_bundle_id={}, startup_timeout_ms={}, shutdown_timeout_ms={}, configured_driver={}, environment={}, inherit_stderr={})".format(self.binary_path, self.host_bundle_id, self.startup_timeout_ms, self.shutdown_timeout_ms, self.configured_driver, self.environment, self.inherit_stderr)
    def __eq__(self, other):
        if self.binary_path != other.binary_path:
            return False
        if self.host_bundle_id != other.host_bundle_id:
            return False
        if self.startup_timeout_ms != other.startup_timeout_ms:
            return False
        if self.shutdown_timeout_ms != other.shutdown_timeout_ms:
            return False
        if self.configured_driver != other.configured_driver:
            return False
        if self.environment != other.environment:
            return False
        if self.inherit_stderr != other.inherit_stderr:
            return False
        return True

class _UniffiFfiConverterTypePrivateWorkerOptions(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return PrivateWorkerOptions(
            binary_path=_UniffiFfiConverterString.read(buf),
            host_bundle_id=_UniffiFfiConverterString.read(buf),
            startup_timeout_ms=_UniffiFfiConverterOptionalUInt64.read(buf),
            shutdown_timeout_ms=_UniffiFfiConverterOptionalUInt64.read(buf),
            configured_driver=_UniffiFfiConverterTypeConfiguredDriverOptions.read(buf),
            environment=_UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.read(buf),
            inherit_stderr=_UniffiFfiConverterBoolean.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.binary_path)
        _UniffiFfiConverterString.check_lower(value.host_bundle_id)
        _UniffiFfiConverterOptionalUInt64.check_lower(value.startup_timeout_ms)
        _UniffiFfiConverterOptionalUInt64.check_lower(value.shutdown_timeout_ms)
        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(value.configured_driver)
        _UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.check_lower(value.environment)
        _UniffiFfiConverterBoolean.check_lower(value.inherit_stderr)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.binary_path, buf)
        _UniffiFfiConverterString.write(value.host_bundle_id, buf)
        _UniffiFfiConverterOptionalUInt64.write(value.startup_timeout_ms, buf)
        _UniffiFfiConverterOptionalUInt64.write(value.shutdown_timeout_ms, buf)
        _UniffiFfiConverterTypeConfiguredDriverOptions.write(value.configured_driver, buf)
        _UniffiFfiConverterSequenceTypeEmbeddedEnvironmentVariable.write(value.environment, buf)
        _UniffiFfiConverterBoolean.write(value.inherit_stderr, buf)

class _UniffiFfiConverterSequenceTypeImageContent(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        for item in value:
            _UniffiFfiConverterTypeImageContent.check_lower(item)

    @classmethod
    def write(cls, value, buf):
        items = len(value)
        buf.write_i32(items)
        for item in value:
            _UniffiFfiConverterTypeImageContent.write(item, buf)

    @classmethod
    def read(cls, buf):
        count = buf.read_i32()
        if count < 0:
            raise InternalError("Unexpected negative sequence length")

        return [
            _UniffiFfiConverterTypeImageContent.read(buf) for i in range(count)
        ]



class _UniffiFfiConverterOptionalTypeActionResult(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            cua_driver._native_contract._UniffiFfiConverterTypeActionResult.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        cua_driver._native_contract._UniffiFfiConverterTypeActionResult.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return cua_driver._native_contract._UniffiFfiConverterTypeActionResult.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")



class _UniffiFfiConverterOptionalTypeVerifyStateOutput(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            cua_driver._native_contract._UniffiFfiConverterTypeVerifyStateOutput.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        cua_driver._native_contract._UniffiFfiConverterTypeVerifyStateOutput.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return cua_driver._native_contract._UniffiFfiConverterTypeVerifyStateOutput.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

@dataclass
class ToolResult:
    """
    Transport-neutral result envelope used for open-ended tool calls and
    desktop tools whose platform extensions are intentionally preserved as JSON.
"""
    def __init__(self, *, text:str, images:typing.List[ImageContent], structured_json:typing.Optional[str], is_error:bool, error_code:typing.Optional[str], action:typing.Optional[cua_driver._native_contract.ActionResult], verification:typing.Optional[cua_driver._native_contract.VerifyStateOutput], degraded:bool, raw_json:str):
        self.text = text
        self.images = images
        self.structured_json = structured_json
        self.is_error = is_error
        self.error_code = error_code
        self.action = action
        self.verification = verification
        self.degraded = degraded
        self.raw_json = raw_json




    def __str__(self):
        return "ToolResult(text={}, images={}, structured_json={}, is_error={}, error_code={}, action={}, verification={}, degraded={}, raw_json={})".format(self.text, self.images, self.structured_json, self.is_error, self.error_code, self.action, self.verification, self.degraded, self.raw_json)
    def __eq__(self, other):
        if self.text != other.text:
            return False
        if self.images != other.images:
            return False
        if self.structured_json != other.structured_json:
            return False
        if self.is_error != other.is_error:
            return False
        if self.error_code != other.error_code:
            return False
        if self.action != other.action:
            return False
        if self.verification != other.verification:
            return False
        if self.degraded != other.degraded:
            return False
        if self.raw_json != other.raw_json:
            return False
        return True

class _UniffiFfiConverterTypeToolResult(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        return ToolResult(
            text=_UniffiFfiConverterString.read(buf),
            images=_UniffiFfiConverterSequenceTypeImageContent.read(buf),
            structured_json=_UniffiFfiConverterOptionalString.read(buf),
            is_error=_UniffiFfiConverterBoolean.read(buf),
            error_code=_UniffiFfiConverterOptionalString.read(buf),
            action=_UniffiFfiConverterOptionalTypeActionResult.read(buf),
            verification=_UniffiFfiConverterOptionalTypeVerifyStateOutput.read(buf),
            degraded=_UniffiFfiConverterBoolean.read(buf),
            raw_json=_UniffiFfiConverterString.read(buf),
        )

    @staticmethod
    def check_lower(value):
        _UniffiFfiConverterString.check_lower(value.text)
        _UniffiFfiConverterSequenceTypeImageContent.check_lower(value.images)
        _UniffiFfiConverterOptionalString.check_lower(value.structured_json)
        _UniffiFfiConverterBoolean.check_lower(value.is_error)
        _UniffiFfiConverterOptionalString.check_lower(value.error_code)
        _UniffiFfiConverterOptionalTypeActionResult.check_lower(value.action)
        _UniffiFfiConverterOptionalTypeVerifyStateOutput.check_lower(value.verification)
        _UniffiFfiConverterBoolean.check_lower(value.degraded)
        _UniffiFfiConverterString.check_lower(value.raw_json)

    @staticmethod
    def write(value, buf):
        _UniffiFfiConverterString.write(value.text, buf)
        _UniffiFfiConverterSequenceTypeImageContent.write(value.images, buf)
        _UniffiFfiConverterOptionalString.write(value.structured_json, buf)
        _UniffiFfiConverterBoolean.write(value.is_error, buf)
        _UniffiFfiConverterOptionalString.write(value.error_code, buf)
        _UniffiFfiConverterOptionalTypeActionResult.write(value.action, buf)
        _UniffiFfiConverterOptionalTypeVerifyStateOutput.write(value.verification, buf)
        _UniffiFfiConverterBoolean.write(value.degraded, buf)
        _UniffiFfiConverterString.write(value.raw_json, buf)






class ActionCompletion(enum.Enum):

    NOT_STARTED = 0

    COMPLETED = 1

    UNKNOWN = 2



class _UniffiFfiConverterTypeActionCompletion(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return ActionCompletion.NOT_STARTED
        if variant == 2:
            return ActionCompletion.COMPLETED
        if variant == 3:
            return ActionCompletion.UNKNOWN
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == ActionCompletion.NOT_STARTED:
            return
        if value == ActionCompletion.COMPLETED:
            return
        if value == ActionCompletion.UNKNOWN:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == ActionCompletion.NOT_STARTED:
            buf.write_i32(1)
        if value == ActionCompletion.COMPLETED:
            buf.write_i32(2)
        if value == ActionCompletion.UNKNOWN:
            buf.write_i32(3)





# DriverAuthorizationHostError
# 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 DriverAuthorizationHostError(Exception):
    pass

_UniffiTempDriverAuthorizationHostError = DriverAuthorizationHostError

class DriverAuthorizationHostError:  # type: ignore

    class Failed(_UniffiTempDriverAuthorizationHostError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "DriverAuthorizationHostError.Failed({})".format(str(self))
    _UniffiTempDriverAuthorizationHostError.Failed = Failed # type: ignore

DriverAuthorizationHostError = _UniffiTempDriverAuthorizationHostError # type: ignore
del _UniffiTempDriverAuthorizationHostError


class _UniffiFfiConverterTypeDriverAuthorizationHostError(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return DriverAuthorizationHostError.Failed(
                _UniffiFfiConverterString.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if isinstance(value, DriverAuthorizationHostError.Failed):
            _UniffiFfiConverterString.check_lower(value.reason)
            return

    @staticmethod
    def write(value, buf):
        if isinstance(value, DriverAuthorizationHostError.Failed):
            buf.write_i32(1)
            _UniffiFfiConverterString.write(value.reason, buf)



# DriverError
# 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 DriverError(Exception):
    pass

_UniffiTempDriverError = DriverError

class DriverError:  # type: ignore

    class Configuration(_UniffiTempDriverError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "DriverError.Configuration({})".format(str(self))
    _UniffiTempDriverError.Configuration = Configuration # type: ignore
    class InvalidArguments(_UniffiTempDriverError):

        def __init__(self, tool, reason):
            super().__init__(", ".join([
                "tool={!r}".format(tool),
                "reason={!r}".format(reason),
            ]))
            self.tool = tool
            self.reason = reason

        def __repr__(self):
            return "DriverError.InvalidArguments({})".format(str(self))
    _UniffiTempDriverError.InvalidArguments = InvalidArguments # type: ignore
    class Transport(_UniffiTempDriverError):

        def __init__(self, socket_path, reason):
            super().__init__(", ".join([
                "socket_path={!r}".format(socket_path),
                "reason={!r}".format(reason),
            ]))
            self.socket_path = socket_path
            self.reason = reason

        def __repr__(self):
            return "DriverError.Transport({})".format(str(self))
    _UniffiTempDriverError.Transport = Transport # type: ignore
    class Protocol(_UniffiTempDriverError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "DriverError.Protocol({})".format(str(self))
    _UniffiTempDriverError.Protocol = Protocol # type: ignore
    class Tool(_UniffiTempDriverError):

        def __init__(self, tool, message, error_code):
            super().__init__(", ".join([
                "tool={!r}".format(tool),
                "message={!r}".format(message),
                "error_code={!r}".format(error_code),
            ]))
            self.tool = tool
            self.message = message
            self.error_code = error_code

        def __repr__(self):
            return "DriverError.Tool({})".format(str(self))
    _UniffiTempDriverError.Tool = Tool # type: ignore
    class Shutdown(_UniffiTempDriverError):

        def __init__(self):
            pass

        def __repr__(self):
            return "DriverError.Shutdown({})".format(str(self))
    _UniffiTempDriverError.Shutdown = Shutdown # type: ignore
    class RuntimeAlreadyExists(_UniffiTempDriverError):

        def __init__(self):
            pass

        def __repr__(self):
            return "DriverError.RuntimeAlreadyExists({})".format(str(self))
    _UniffiTempDriverError.RuntimeAlreadyExists = RuntimeAlreadyExists # type: ignore
    class Worker(_UniffiTempDriverError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "DriverError.Worker({})".format(str(self))
    _UniffiTempDriverError.Worker = Worker # type: ignore
    class Remote(_UniffiTempDriverError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "DriverError.Remote({})".format(str(self))
    _UniffiTempDriverError.Remote = Remote # type: ignore
    class ActionInterrupted(_UniffiTempDriverError):

        def __init__(self, completion, reason):
            super().__init__(", ".join([
                "completion={!r}".format(completion),
                "reason={!r}".format(reason),
            ]))
            self.completion = completion
            self.reason = reason

        def __repr__(self):
            return "DriverError.ActionInterrupted({})".format(str(self))
    _UniffiTempDriverError.ActionInterrupted = ActionInterrupted # type: ignore

DriverError = _UniffiTempDriverError # type: ignore
del _UniffiTempDriverError


class _UniffiFfiConverterTypeDriverError(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return DriverError.Configuration(
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 2:
            return DriverError.InvalidArguments(
                _UniffiFfiConverterString.read(buf),
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 3:
            return DriverError.Transport(
                _UniffiFfiConverterString.read(buf),
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 4:
            return DriverError.Protocol(
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 5:
            return DriverError.Tool(
                _UniffiFfiConverterString.read(buf),
                _UniffiFfiConverterString.read(buf),
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 6:
            return DriverError.Shutdown(
            )
        if variant == 7:
            return DriverError.RuntimeAlreadyExists(
            )
        if variant == 8:
            return DriverError.Worker(
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 9:
            return DriverError.Remote(
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 10:
            return DriverError.ActionInterrupted(
                _UniffiFfiConverterTypeActionCompletion.read(buf),
                _UniffiFfiConverterString.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if isinstance(value, DriverError.Configuration):
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, DriverError.InvalidArguments):
            _UniffiFfiConverterString.check_lower(value.tool)
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, DriverError.Transport):
            _UniffiFfiConverterString.check_lower(value.socket_path)
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, DriverError.Protocol):
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, DriverError.Tool):
            _UniffiFfiConverterString.check_lower(value.tool)
            _UniffiFfiConverterString.check_lower(value.message)
            _UniffiFfiConverterString.check_lower(value.error_code)
            return
        if isinstance(value, DriverError.Shutdown):
            return
        if isinstance(value, DriverError.RuntimeAlreadyExists):
            return
        if isinstance(value, DriverError.Worker):
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, DriverError.Remote):
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, DriverError.ActionInterrupted):
            _UniffiFfiConverterTypeActionCompletion.check_lower(value.completion)
            _UniffiFfiConverterString.check_lower(value.reason)
            return

    @staticmethod
    def write(value, buf):
        if isinstance(value, DriverError.Configuration):
            buf.write_i32(1)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, DriverError.InvalidArguments):
            buf.write_i32(2)
            _UniffiFfiConverterString.write(value.tool, buf)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, DriverError.Transport):
            buf.write_i32(3)
            _UniffiFfiConverterString.write(value.socket_path, buf)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, DriverError.Protocol):
            buf.write_i32(4)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, DriverError.Tool):
            buf.write_i32(5)
            _UniffiFfiConverterString.write(value.tool, buf)
            _UniffiFfiConverterString.write(value.message, buf)
            _UniffiFfiConverterString.write(value.error_code, buf)
        if isinstance(value, DriverError.Shutdown):
            buf.write_i32(6)
        if isinstance(value, DriverError.RuntimeAlreadyExists):
            buf.write_i32(7)
        if isinstance(value, DriverError.Worker):
            buf.write_i32(8)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, DriverError.Remote):
            buf.write_i32(9)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, DriverError.ActionInterrupted):
            buf.write_i32(10)
            _UniffiFfiConverterTypeActionCompletion.write(value.completion, buf)
            _UniffiFfiConverterString.write(value.reason, buf)






class DriverExecutionMode(enum.Enum):
    """
    Process topology used by this SDK object.
"""

    EMBEDDED = 0

    DAEMON = 1

    PRIVATE_WORKER = 2

    REMOTE = 3



class _UniffiFfiConverterTypeDriverExecutionMode(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return DriverExecutionMode.EMBEDDED
        if variant == 2:
            return DriverExecutionMode.DAEMON
        if variant == 3:
            return DriverExecutionMode.PRIVATE_WORKER
        if variant == 4:
            return DriverExecutionMode.REMOTE
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == DriverExecutionMode.EMBEDDED:
            return
        if value == DriverExecutionMode.DAEMON:
            return
        if value == DriverExecutionMode.PRIVATE_WORKER:
            return
        if value == DriverExecutionMode.REMOTE:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == DriverExecutionMode.EMBEDDED:
            buf.write_i32(1)
        if value == DriverExecutionMode.DAEMON:
            buf.write_i32(2)
        if value == DriverExecutionMode.PRIVATE_WORKER:
            buf.write_i32(3)
        if value == DriverExecutionMode.REMOTE:
            buf.write_i32(4)





# DriverServiceTransportError
# 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 DriverServiceTransportError(Exception):
    pass

_UniffiTempDriverServiceTransportError = DriverServiceTransportError

class DriverServiceTransportError:  # type: ignore

    class Failed(_UniffiTempDriverServiceTransportError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "DriverServiceTransportError.Failed({})".format(str(self))
    _UniffiTempDriverServiceTransportError.Failed = Failed # type: ignore

DriverServiceTransportError = _UniffiTempDriverServiceTransportError # type: ignore
del _UniffiTempDriverServiceTransportError


class _UniffiFfiConverterTypeDriverServiceTransportError(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return DriverServiceTransportError.Failed(
                _UniffiFfiConverterString.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if isinstance(value, DriverServiceTransportError.Failed):
            _UniffiFfiConverterString.check_lower(value.reason)
            return

    @staticmethod
    def write(value, buf):
        if isinstance(value, DriverServiceTransportError.Failed):
            buf.write_i32(1)
            _UniffiFfiConverterString.write(value.reason, buf)



# EmbeddedDriverError
# 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 EmbeddedDriverError(Exception):
    pass

_UniffiTempEmbeddedDriverError = EmbeddedDriverError

class EmbeddedDriverError:  # type: ignore

    class Configuration(_UniffiTempEmbeddedDriverError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "EmbeddedDriverError.Configuration({})".format(str(self))
    _UniffiTempEmbeddedDriverError.Configuration = Configuration # type: ignore
    class EndpointConflict(_UniffiTempEmbeddedDriverError):

        def __init__(self, path, reason):
            super().__init__(", ".join([
                "path={!r}".format(path),
                "reason={!r}".format(reason),
            ]))
            self.path = path
            self.reason = reason

        def __repr__(self):
            return "EmbeddedDriverError.EndpointConflict({})".format(str(self))
    _UniffiTempEmbeddedDriverError.EndpointConflict = EndpointConflict # type: ignore
    class Spawn(_UniffiTempEmbeddedDriverError):

        def __init__(self, binary_path, reason):
            super().__init__(", ".join([
                "binary_path={!r}".format(binary_path),
                "reason={!r}".format(reason),
            ]))
            self.binary_path = binary_path
            self.reason = reason

        def __repr__(self):
            return "EmbeddedDriverError.Spawn({})".format(str(self))
    _UniffiTempEmbeddedDriverError.Spawn = Spawn # type: ignore
    class StartupCancelled(_UniffiTempEmbeddedDriverError):

        def __init__(self):
            pass

        def __repr__(self):
            return "EmbeddedDriverError.StartupCancelled({})".format(str(self))
    _UniffiTempEmbeddedDriverError.StartupCancelled = StartupCancelled # type: ignore
    class StartupTimeout(_UniffiTempEmbeddedDriverError):

        def __init__(self, timeout_ms):
            super().__init__(", ".join([
                "timeout_ms={!r}".format(timeout_ms),
            ]))
            self.timeout_ms = timeout_ms

        def __repr__(self):
            return "EmbeddedDriverError.StartupTimeout({})".format(str(self))
    _UniffiTempEmbeddedDriverError.StartupTimeout = StartupTimeout # type: ignore
    class ExitedBeforeReady(_UniffiTempEmbeddedDriverError):

        def __init__(self, code):
            super().__init__(", ".join([
                "code={!r}".format(code),
            ]))
            self.code = code

        def __repr__(self):
            return "EmbeddedDriverError.ExitedBeforeReady({})".format(str(self))
    _UniffiTempEmbeddedDriverError.ExitedBeforeReady = ExitedBeforeReady # type: ignore
    class IncompatibleDaemon(_UniffiTempEmbeddedDriverError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "EmbeddedDriverError.IncompatibleDaemon({})".format(str(self))
    _UniffiTempEmbeddedDriverError.IncompatibleDaemon = IncompatibleDaemon # type: ignore
    class Lifecycle(_UniffiTempEmbeddedDriverError):

        def __init__(self, reason):
            super().__init__(", ".join([
                "reason={!r}".format(reason),
            ]))
            self.reason = reason

        def __repr__(self):
            return "EmbeddedDriverError.Lifecycle({})".format(str(self))
    _UniffiTempEmbeddedDriverError.Lifecycle = Lifecycle # type: ignore

EmbeddedDriverError = _UniffiTempEmbeddedDriverError # type: ignore
del _UniffiTempEmbeddedDriverError


class _UniffiFfiConverterTypeEmbeddedDriverError(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return EmbeddedDriverError.Configuration(
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 2:
            return EmbeddedDriverError.EndpointConflict(
                _UniffiFfiConverterString.read(buf),
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 3:
            return EmbeddedDriverError.Spawn(
                _UniffiFfiConverterString.read(buf),
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 4:
            return EmbeddedDriverError.StartupCancelled(
            )
        if variant == 5:
            return EmbeddedDriverError.StartupTimeout(
                _UniffiFfiConverterUInt64.read(buf),
            )
        if variant == 6:
            return EmbeddedDriverError.ExitedBeforeReady(
                _UniffiFfiConverterOptionalInt32.read(buf),
            )
        if variant == 7:
            return EmbeddedDriverError.IncompatibleDaemon(
                _UniffiFfiConverterString.read(buf),
            )
        if variant == 8:
            return EmbeddedDriverError.Lifecycle(
                _UniffiFfiConverterString.read(buf),
            )
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if isinstance(value, EmbeddedDriverError.Configuration):
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, EmbeddedDriverError.EndpointConflict):
            _UniffiFfiConverterString.check_lower(value.path)
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, EmbeddedDriverError.Spawn):
            _UniffiFfiConverterString.check_lower(value.binary_path)
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, EmbeddedDriverError.StartupCancelled):
            return
        if isinstance(value, EmbeddedDriverError.StartupTimeout):
            _UniffiFfiConverterUInt64.check_lower(value.timeout_ms)
            return
        if isinstance(value, EmbeddedDriverError.ExitedBeforeReady):
            _UniffiFfiConverterOptionalInt32.check_lower(value.code)
            return
        if isinstance(value, EmbeddedDriverError.IncompatibleDaemon):
            _UniffiFfiConverterString.check_lower(value.reason)
            return
        if isinstance(value, EmbeddedDriverError.Lifecycle):
            _UniffiFfiConverterString.check_lower(value.reason)
            return

    @staticmethod
    def write(value, buf):
        if isinstance(value, EmbeddedDriverError.Configuration):
            buf.write_i32(1)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, EmbeddedDriverError.EndpointConflict):
            buf.write_i32(2)
            _UniffiFfiConverterString.write(value.path, buf)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, EmbeddedDriverError.Spawn):
            buf.write_i32(3)
            _UniffiFfiConverterString.write(value.binary_path, buf)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, EmbeddedDriverError.StartupCancelled):
            buf.write_i32(4)
        if isinstance(value, EmbeddedDriverError.StartupTimeout):
            buf.write_i32(5)
            _UniffiFfiConverterUInt64.write(value.timeout_ms, buf)
        if isinstance(value, EmbeddedDriverError.ExitedBeforeReady):
            buf.write_i32(6)
            _UniffiFfiConverterOptionalInt32.write(value.code, buf)
        if isinstance(value, EmbeddedDriverError.IncompatibleDaemon):
            buf.write_i32(7)
            _UniffiFfiConverterString.write(value.reason, buf)
        if isinstance(value, EmbeddedDriverError.Lifecycle):
            buf.write_i32(8)
            _UniffiFfiConverterString.write(value.reason, buf)






class EmbeddedDriverHostState(enum.Enum):

    STOPPED = 0

    STARTING = 1

    READY = 2

    STOPPING = 3



class _UniffiFfiConverterTypeEmbeddedDriverHostState(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return EmbeddedDriverHostState.STOPPED
        if variant == 2:
            return EmbeddedDriverHostState.STARTING
        if variant == 3:
            return EmbeddedDriverHostState.READY
        if variant == 4:
            return EmbeddedDriverHostState.STOPPING
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == EmbeddedDriverHostState.STOPPED:
            return
        if value == EmbeddedDriverHostState.STARTING:
            return
        if value == EmbeddedDriverHostState.READY:
            return
        if value == EmbeddedDriverHostState.STOPPING:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == EmbeddedDriverHostState.STOPPED:
            buf.write_i32(1)
        if value == EmbeddedDriverHostState.STARTING:
            buf.write_i32(2)
        if value == EmbeddedDriverHostState.READY:
            buf.write_i32(3)
        if value == EmbeddedDriverHostState.STOPPING:
            buf.write_i32(4)








class SdkClientKind(enum.Enum):
    """
    Runtime that imported the shared UniFFI SDK library. The language package
    selects this automatically at its root entry point; callers do not need to
    supply telemetry metadata.
"""

    PYTHON = 0

    TYPESCRIPT = 1



class _UniffiFfiConverterTypeSdkClientKind(_UniffiConverterRustBuffer):
    @staticmethod
    def read(buf):
        variant = buf.read_i32()
        if variant == 1:
            return SdkClientKind.PYTHON
        if variant == 2:
            return SdkClientKind.TYPESCRIPT
        raise InternalError("Raw enum value doesn't match any cases")

    @staticmethod
    def check_lower(value):
        if value == SdkClientKind.PYTHON:
            return
        if value == SdkClientKind.TYPESCRIPT:
            return
        raise ValueError(value)

    @staticmethod
    def write(value, buf):
        if value == SdkClientKind.PYTHON:
            buf.write_i32(1)
        if value == SdkClientKind.TYPESCRIPT:
            buf.write_i32(2)














































































class CuaDriverProtocol(typing.Protocol):

    async def call_tool(self, name: str,arguments_json: str) -> ToolResult:
        """
        Generic protocol-adapter surface. Ordinary applications should prefer
        typed methods; MCP and other open-ended adapters use this method so they
        remain downstream of the same public SDK runtime.
"""
        raise NotImplementedError
    async def click(self, input: cua_driver._native_contract.ClickInput) -> cua_driver._native_contract.ActionResult:
        raise NotImplementedError
    async def clipboard_read(self, input: cua_driver._native_contract.ClipboardReadInput) -> ToolResult:
        raise NotImplementedError
    async def clipboard_write(self, input: cua_driver._native_contract.ClipboardWriteInput) -> ToolResult:
        raise NotImplementedError
    async def drag(self, input: cua_driver._native_contract.DragInput) -> ToolResult:
        raise NotImplementedError
    async def end_session(self, input: cua_driver._native_contract.EndSessionInput) -> cua_driver._native_contract.EndSessionOutput:
        raise NotImplementedError
    async def escalate_session(self, input: cua_driver._native_contract.EscalateSessionInput) -> cua_driver._native_contract.SessionStateOutput:
        raise NotImplementedError
    def execution_mode(self, ) -> DriverExecutionMode:
        raise NotImplementedError
    async def get_agent_cursor_state(self, input: cua_driver._native_contract.GetAgentCursorStateInput) -> ToolResult:
        raise NotImplementedError
    async def get_cursor_position(self, input: cua_driver._native_contract.GetCursorPositionInput) -> ToolResult:
        raise NotImplementedError
    async def get_desktop_state(self, input: cua_driver._native_contract.GetDesktopStateInput) -> ToolResult:
        raise NotImplementedError
    async def get_screen_size(self, input: cua_driver._native_contract.GetScreenSizeInput) -> ToolResult:
        raise NotImplementedError
    async def get_session(self, input: cua_driver._native_contract.GetSessionInput) -> cua_driver._native_contract.SessionOutput:
        raise NotImplementedError
    async def get_session_state(self, input: cua_driver._native_contract.GetSessionStateInput) -> cua_driver._native_contract.SessionStateOutput:
        raise NotImplementedError
    async def get_window_state(self, input: cua_driver._native_contract.GetWindowStateInput) -> cua_driver._native_contract.WindowStateOutput:
        raise NotImplementedError
    async def hotkey(self, input: cua_driver._native_contract.HotkeyInput) -> ToolResult:
        raise NotImplementedError
    async def invoke_menu(self, input: cua_driver._native_contract.InvokeMenuInput) -> ToolResult:
        raise NotImplementedError
    def is_available(self, ) -> bool:
        raise NotImplementedError
    async def list_apps(self, input: cua_driver._native_contract.ListAppsInput) -> cua_driver._native_contract.ListAppsOutput:
        raise NotImplementedError
    async def list_host_sessions_json(self, ) -> str:
        """
        Content-free lifecycle summaries for the trusted host's runtime or
        host-lease namespace. This is deliberately separate from the
        agent-facing `list_sessions` tool, whose view is transport scoped.
"""
        raise NotImplementedError
    async def list_sessions(self, input: cua_driver._native_contract.ListSessionsInput) -> cua_driver._native_contract.ListSessionsOutput:
        raise NotImplementedError
    async def list_tools_json(self, ) -> str:
        """
        Canonical tool inventory for MCP and other protocol adapters.
"""
        raise NotImplementedError
    async def list_windows(self, input: cua_driver._native_contract.ListWindowsInput) -> cua_driver._native_contract.ListWindowsOutput:
        raise NotImplementedError
    async def metadata(self, ) -> DriverMetadata:
        raise NotImplementedError
    async def move_cursor(self, input: cua_driver._native_contract.MoveCursorInput) -> ToolResult:
        raise NotImplementedError
    async def parse_visual_regions(self, input: cua_driver._native_contract.ParseVisualRegionsInput) -> ToolResult:
        raise NotImplementedError
    async def press_key(self, input: cua_driver._native_contract.PressKeyInput) -> ToolResult:
        raise NotImplementedError
    def runtime_scope_prefix(self, ) -> typing.Optional[str]:
        raise NotImplementedError
    async def scroll(self, input: cua_driver._native_contract.ScrollInput) -> ToolResult:
        raise NotImplementedError
    async def set_agent_cursor_enabled(self, input: cua_driver._native_contract.SetAgentCursorEnabledInput) -> ToolResult:
        raise NotImplementedError
    async def set_agent_cursor_motion(self, input: cua_driver._native_contract.SetAgentCursorMotionInput) -> ToolResult:
        raise NotImplementedError
    async def set_agent_cursor_theme(self, input: cua_driver._native_contract.SetAgentCursorThemeInput) -> ToolResult:
        raise NotImplementedError
    async def set_window_frame(self, input: cua_driver._native_contract.SetWindowFrameInput) -> ToolResult:
        raise NotImplementedError
    async def shutdown(self, ) -> None:
        """
        Stop accepting new embedded operations. Repeated calls are harmless;
        daemon compatibility clients do not own the daemon and therefore no-op.
"""
        raise NotImplementedError
    def socket_path(self, ) -> str:
        """
        Compatibility accessor. Embedded runtimes have no socket and return an
        empty string; new code should branch on [`Self::execution_mode`].
"""
        raise NotImplementedError
    async def start_session(self, input: cua_driver._native_contract.StartSessionInput) -> cua_driver._native_contract.StartSessionOutput:
        raise NotImplementedError
    async def type_text(self, input: cua_driver._native_contract.TypeTextInput) -> ToolResult:
        raise NotImplementedError
    async def verify_state(self, input: cua_driver._native_contract.VerifyStateInput) -> ToolResult:
        raise NotImplementedError

class CuaDriver(CuaDriverProtocol):

    _handle: ctypes.c_uint64
    @classmethod
    def connect(cls, socket_path: typing.Optional[str]) -> CuaDriver:
        """
        Connect to the default installed daemon or an explicitly selected socket.
        This is the temporary compatibility path for released socket clients.
"""

        _UniffiFfiConverterOptionalString.check_lower(socket_path)
        _uniffi_lowered_args = (
            _UniffiFfiConverterOptionalString.lower(socket_path),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_connect,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def connect_with_client_kind(cls, socket_path: typing.Optional[str],client_kind: SdkClientKind) -> CuaDriver:
        """
        Language-package entry point that preserves the public `connect` API
        while attaching a closed runtime category to daemon requests.
"""

        _UniffiFfiConverterOptionalString.check_lower(socket_path)

        _UniffiFfiConverterTypeSdkClientKind.check_lower(client_kind)
        _uniffi_lowered_args = (
            _UniffiFfiConverterOptionalString.lower(socket_path),
            _UniffiFfiConverterTypeSdkClientKind.lower(client_kind),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_connect_with_client_kind,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create(cls, options: typing.Optional[DriverOptions]) -> CuaDriver:
        """
        Create a same-process driver runtime. This constructor never launches
        `cua-driver` and never opens daemon IPC.
"""

        _UniffiFfiConverterOptionalTypeDriverOptions.check_lower(options)
        _uniffi_lowered_args = (
            _UniffiFfiConverterOptionalTypeDriverOptions.lower(options),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured(cls, options: ConfiguredDriverOptions) -> CuaDriver:
        """
        Create a same-process runtime with an explicit immutable authorization
        ceiling. This is a trusted host constructor and is not exposed as an
        agent tool. Existing `create()` callers remain unchanged.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured_with_activity_observer(cls, options: ConfiguredDriverOptions,observer: DriverActivityObserver) -> CuaDriver:
        """
        Create a configured same-process runtime with a content-free activity
        observer supplied by trusted embedding-host code.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeDriverActivityObserver.check_lower(observer)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
            _UniffiFfiConverterTypeDriverActivityObserver.lower(observer),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_activity_observer,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured_with_activity_observer_and_client_kind(cls, options: ConfiguredDriverOptions,observer: DriverActivityObserver,client_kind: SdkClientKind) -> CuaDriver:
        """
        Language-package entry point for a configured activity-observer runtime.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeDriverActivityObserver.check_lower(observer)

        _UniffiFfiConverterTypeSdkClientKind.check_lower(client_kind)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
            _UniffiFfiConverterTypeDriverActivityObserver.lower(observer),
            _UniffiFfiConverterTypeSdkClientKind.lower(client_kind),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_activity_observer_and_client_kind,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured_with_authorization_host(cls, options: ConfiguredDriverOptions,host: DriverAuthorizationHost) -> CuaDriver:
        """
        Create a configured same-process runtime with an optional residual
        authorization callback supplied by trusted embedding-host code.

        The callback object is immutable runtime configuration. Applications
        must not expose it to an agent or implement it using ordinary MCP
        elicitation, model-visible stdio, or an auto-accepting callback.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeDriverAuthorizationHost.check_lower(host)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
            _UniffiFfiConverterTypeDriverAuthorizationHost.lower(host),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_authorization_host,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured_with_authorization_host_and_client_kind(cls, options: ConfiguredDriverOptions,host: DriverAuthorizationHost,client_kind: SdkClientKind) -> CuaDriver:
        """
        Language-package entry point for a configured protected-host runtime.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeDriverAuthorizationHost.check_lower(host)

        _UniffiFfiConverterTypeSdkClientKind.check_lower(client_kind)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
            _UniffiFfiConverterTypeDriverAuthorizationHost.lower(host),
            _UniffiFfiConverterTypeSdkClientKind.lower(client_kind),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_authorization_host_and_client_kind,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured_with_client_kind(cls, options: ConfiguredDriverOptions,client_kind: SdkClientKind) -> CuaDriver:
        """
        Language-package entry point for an explicitly configured runtime.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeSdkClientKind.check_lower(client_kind)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
            _UniffiFfiConverterTypeSdkClientKind.lower(client_kind),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_client_kind,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured_with_host_integrations(cls, options: ConfiguredDriverOptions,host: DriverAuthorizationHost,observer: DriverActivityObserver) -> CuaDriver:
        """
        Create a configured same-process runtime with both residual
        authorization and content-free activity callbacks.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeDriverAuthorizationHost.check_lower(host)

        _UniffiFfiConverterTypeDriverActivityObserver.check_lower(observer)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
            _UniffiFfiConverterTypeDriverAuthorizationHost.lower(host),
            _UniffiFfiConverterTypeDriverActivityObserver.lower(observer),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_host_integrations,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_configured_with_host_integrations_and_client_kind(cls, options: ConfiguredDriverOptions,host: DriverAuthorizationHost,observer: DriverActivityObserver,client_kind: SdkClientKind) -> CuaDriver:
        """
        Language-package entry point for both trusted host callbacks.
"""

        _UniffiFfiConverterTypeConfiguredDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeDriverAuthorizationHost.check_lower(host)

        _UniffiFfiConverterTypeDriverActivityObserver.check_lower(observer)

        _UniffiFfiConverterTypeSdkClientKind.check_lower(client_kind)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeConfiguredDriverOptions.lower(options),
            _UniffiFfiConverterTypeDriverAuthorizationHost.lower(host),
            _UniffiFfiConverterTypeDriverActivityObserver.lower(observer),
            _UniffiFfiConverterTypeSdkClientKind.lower(client_kind),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_configured_with_host_integrations_and_client_kind,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_private_worker(cls, options: PrivateWorkerOptions) -> CuaDriver:
        """
        Create a process-isolated runtime owned by this SDK object.

        This constructor directly spawns the supplied Cua Driver binary and
        communicates only over inherited stdio. No daemon or reusable endpoint
        is created.
"""

        _UniffiFfiConverterTypePrivateWorkerOptions.check_lower(options)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypePrivateWorkerOptions.lower(options),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_private_worker,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_private_worker_with_client_kind(cls, options: PrivateWorkerOptions,client_kind: SdkClientKind) -> CuaDriver:
        """
        Language-package entry point that preserves the worker constructor
        while attaching the importing SDK runtime category.
"""

        _UniffiFfiConverterTypePrivateWorkerOptions.check_lower(options)

        _UniffiFfiConverterTypeSdkClientKind.check_lower(client_kind)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypePrivateWorkerOptions.lower(options),
            _UniffiFfiConverterTypeSdkClientKind.lower(client_kind),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_private_worker_with_client_kind,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)
    @classmethod
    def create_with_client_kind(cls, options: typing.Optional[DriverOptions],client_kind: SdkClientKind) -> CuaDriver:
        """
        Language-package entry point for the same-process runtime. The wrapper
        at each package root selects the client kind automatically.
"""

        _UniffiFfiConverterOptionalTypeDriverOptions.check_lower(options)

        _UniffiFfiConverterTypeSdkClientKind.check_lower(client_kind)
        _uniffi_lowered_args = (
            _UniffiFfiConverterOptionalTypeDriverOptions.lower(options),
            _UniffiFfiConverterTypeSdkClientKind.lower(client_kind),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_cuadriver_create_with_client_kind,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)

    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_cua_driver_sdk_fn_free_cuadriver, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cuadriver, 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 call_tool(self, name: str,arguments_json: str) -> ToolResult:
        """
        Generic protocol-adapter surface. Ordinary applications should prefer
        typed methods; MCP and other open-ended adapters use this method so they
        remain downstream of the same public SDK runtime.
"""

        _UniffiFfiConverterString.check_lower(name)

        _UniffiFfiConverterString.check_lower(arguments_json)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterString.lower(name),
            _UniffiFfiConverterString.lower(arguments_json),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_call_tool(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def click(self, input: cua_driver._native_contract.ClickInput) -> cua_driver._native_contract.ActionResult:

        cua_driver._native_contract._UniffiFfiConverterTypeClickInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeClickInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeActionResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_click(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def clipboard_read(self, input: cua_driver._native_contract.ClipboardReadInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeClipboardReadInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeClipboardReadInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_clipboard_read(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def clipboard_write(self, input: cua_driver._native_contract.ClipboardWriteInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeClipboardWriteInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeClipboardWriteInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_clipboard_write(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def drag(self, input: cua_driver._native_contract.DragInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeDragInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeDragInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_drag(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def end_session(self, input: cua_driver._native_contract.EndSessionInput) -> cua_driver._native_contract.EndSessionOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeEndSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeEndSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeEndSessionOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_end_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def escalate_session(self, input: cua_driver._native_contract.EscalateSessionInput) -> cua_driver._native_contract.SessionStateOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeEscalateSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeEscalateSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeSessionStateOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_escalate_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def execution_mode(self, ) -> DriverExecutionMode:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeDriverExecutionMode.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_execution_mode,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def get_agent_cursor_state(self, input: cua_driver._native_contract.GetAgentCursorStateInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetAgentCursorStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetAgentCursorStateInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_agent_cursor_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_cursor_position(self, input: cua_driver._native_contract.GetCursorPositionInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetCursorPositionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetCursorPositionInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_cursor_position(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_desktop_state(self, input: cua_driver._native_contract.GetDesktopStateInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetDesktopStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetDesktopStateInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_desktop_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_screen_size(self, input: cua_driver._native_contract.GetScreenSizeInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetScreenSizeInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetScreenSizeInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_screen_size(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_session(self, input: cua_driver._native_contract.GetSessionInput) -> cua_driver._native_contract.SessionOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeGetSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeSessionOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_session_state(self, input: cua_driver._native_contract.GetSessionStateInput) -> cua_driver._native_contract.SessionStateOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeGetSessionStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetSessionStateInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeSessionStateOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_session_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_window_state(self, input: cua_driver._native_contract.GetWindowStateInput) -> cua_driver._native_contract.WindowStateOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeGetWindowStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetWindowStateInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeWindowStateOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_get_window_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def hotkey(self, input: cua_driver._native_contract.HotkeyInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeHotkeyInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeHotkeyInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_hotkey(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def invoke_menu(self, input: cua_driver._native_contract.InvokeMenuInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeInvokeMenuInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeInvokeMenuInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_invoke_menu(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def is_available(self, ) -> bool:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterBoolean.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_is_available,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def list_apps(self, input: cua_driver._native_contract.ListAppsInput) -> cua_driver._native_contract.ListAppsOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeListAppsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeListAppsInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeListAppsOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_apps(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def list_host_sessions_json(self, ) -> str:
        """
        Content-free lifecycle summaries for the trusted host's runtime or
        host-lease namespace. This is deliberately separate from the
        agent-facing `list_sessions` tool, whose view is transport scoped.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterString.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_host_sessions_json(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def list_sessions(self, input: cua_driver._native_contract.ListSessionsInput) -> cua_driver._native_contract.ListSessionsOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeListSessionsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeListSessionsInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeListSessionsOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_sessions(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def list_tools_json(self, ) -> str:
        """
        Canonical tool inventory for MCP and other protocol adapters.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterString.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_tools_json(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def list_windows(self, input: cua_driver._native_contract.ListWindowsInput) -> cua_driver._native_contract.ListWindowsOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeListWindowsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeListWindowsInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeListWindowsOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_list_windows(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def metadata(self, ) -> DriverMetadata:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeDriverMetadata.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_metadata(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def move_cursor(self, input: cua_driver._native_contract.MoveCursorInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeMoveCursorInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeMoveCursorInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_move_cursor(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def parse_visual_regions(self, input: cua_driver._native_contract.ParseVisualRegionsInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeParseVisualRegionsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeParseVisualRegionsInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_parse_visual_regions(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def press_key(self, input: cua_driver._native_contract.PressKeyInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypePressKeyInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypePressKeyInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_press_key(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def runtime_scope_prefix(self, ) -> typing.Optional[str]:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterOptionalString.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_runtime_scope_prefix,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def scroll(self, input: cua_driver._native_contract.ScrollInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeScrollInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeScrollInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_scroll(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_agent_cursor_enabled(self, input: cua_driver._native_contract.SetAgentCursorEnabledInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorEnabledInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorEnabledInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_enabled(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_agent_cursor_motion(self, input: cua_driver._native_contract.SetAgentCursorMotionInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorMotionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorMotionInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_motion(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_agent_cursor_theme(self, input: cua_driver._native_contract.SetAgentCursorThemeInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorThemeInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorThemeInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_agent_cursor_theme(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_window_frame(self, input: cua_driver._native_contract.SetWindowFrameInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetWindowFrameInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetWindowFrameInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_set_window_frame(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def shutdown(self, ) -> None:
        """
        Stop accepting new embedded operations. Repeated calls are harmless;
        daemon compatibility clients do not own the daemon and therefore no-op.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_shutdown(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_void,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def socket_path(self, ) -> str:
        """
        Compatibility accessor. Embedded runtimes have no socket and return an
        empty string; new code should branch on [`Self::execution_mode`].
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterString.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_socket_path,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def start_session(self, input: cua_driver._native_contract.StartSessionInput) -> cua_driver._native_contract.StartSessionOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeStartSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeStartSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeStartSessionOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_start_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def type_text(self, input: cua_driver._native_contract.TypeTextInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeTypeTextInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeTypeTextInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_type_text(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def verify_state(self, input: cua_driver._native_contract.VerifyStateInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeVerifyStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeVerifyStateInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriver_verify_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )





class _UniffiFfiConverterTypeCuaDriver:
    @staticmethod
    def lift(value: int) -> CuaDriver:
        return CuaDriver._uniffi_make_instance(value)

    @staticmethod
    def check_lower(value: CuaDriver):
        if not isinstance(value, CuaDriver):
            raise TypeError("Expected CuaDriver instance, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: CuaDriver) -> ctypes.c_uint64:
        return value._uniffi_clone_handle()

    @classmethod
    def read(cls, buf: _UniffiRustBuffer) -> CuaDriver:
        ptr = buf.read_u64()
        if ptr == 0:
            raise InternalError("Raw handle value was null")
        return cls.lift(ptr)

    @classmethod
    def write(cls, value: CuaDriver, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))


class CuaDriverSessionProtocol(typing.Protocol):

    async def call_tool(self, name: str,arguments_json: str) -> ToolResult:
        raise NotImplementedError
    async def click(self, input: cua_driver._native_contract.ClickInput) -> cua_driver._native_contract.ActionResult:
        raise NotImplementedError
    async def clipboard_read(self, input: cua_driver._native_contract.ClipboardReadInput) -> ToolResult:
        raise NotImplementedError
    async def clipboard_write(self, input: cua_driver._native_contract.ClipboardWriteInput) -> ToolResult:
        raise NotImplementedError
    def close(self, ) -> None:
        """
        Revoke the session-bound authority and release its native handle.

        This operation is idempotent. Dropping the object performs the same
        cleanup, but trusted hosts should call it at their lifecycle boundary.
"""
        raise NotImplementedError
    async def drag(self, input: cua_driver._native_contract.DragInput) -> ToolResult:
        raise NotImplementedError
    async def end_session(self, input: cua_driver._native_contract.EndSessionInput) -> cua_driver._native_contract.EndSessionOutput:
        raise NotImplementedError
    async def escalate_session(self, input: cua_driver._native_contract.EscalateSessionInput) -> cua_driver._native_contract.SessionStateOutput:
        raise NotImplementedError
    async def get_agent_cursor_state(self, input: cua_driver._native_contract.GetAgentCursorStateInput) -> ToolResult:
        raise NotImplementedError
    async def get_cursor_position(self, input: cua_driver._native_contract.GetCursorPositionInput) -> ToolResult:
        raise NotImplementedError
    async def get_desktop_state(self, input: cua_driver._native_contract.GetDesktopStateInput) -> ToolResult:
        raise NotImplementedError
    async def get_screen_size(self, input: cua_driver._native_contract.GetScreenSizeInput) -> ToolResult:
        raise NotImplementedError
    async def get_session(self, input: cua_driver._native_contract.GetSessionInput) -> cua_driver._native_contract.SessionOutput:
        raise NotImplementedError
    async def get_session_state(self, input: cua_driver._native_contract.GetSessionStateInput) -> cua_driver._native_contract.SessionStateOutput:
        raise NotImplementedError
    async def get_window_state(self, input: cua_driver._native_contract.GetWindowStateInput) -> cua_driver._native_contract.WindowStateOutput:
        raise NotImplementedError
    async def hotkey(self, input: cua_driver._native_contract.HotkeyInput) -> ToolResult:
        raise NotImplementedError
    async def invoke_menu(self, input: cua_driver._native_contract.InvokeMenuInput) -> ToolResult:
        raise NotImplementedError
    async def list_apps(self, input: cua_driver._native_contract.ListAppsInput) -> cua_driver._native_contract.ListAppsOutput:
        raise NotImplementedError
    async def list_sessions(self, input: cua_driver._native_contract.ListSessionsInput) -> cua_driver._native_contract.ListSessionsOutput:
        raise NotImplementedError
    async def list_windows(self, input: cua_driver._native_contract.ListWindowsInput) -> cua_driver._native_contract.ListWindowsOutput:
        raise NotImplementedError
    async def move_cursor(self, input: cua_driver._native_contract.MoveCursorInput) -> ToolResult:
        raise NotImplementedError
    async def parse_visual_regions(self, input: cua_driver._native_contract.ParseVisualRegionsInput) -> ToolResult:
        raise NotImplementedError
    async def press_key(self, input: cua_driver._native_contract.PressKeyInput) -> ToolResult:
        raise NotImplementedError
    async def scroll(self, input: cua_driver._native_contract.ScrollInput) -> ToolResult:
        raise NotImplementedError
    async def set_agent_cursor_enabled(self, input: cua_driver._native_contract.SetAgentCursorEnabledInput) -> ToolResult:
        raise NotImplementedError
    async def set_agent_cursor_motion(self, input: cua_driver._native_contract.SetAgentCursorMotionInput) -> ToolResult:
        raise NotImplementedError
    async def set_agent_cursor_theme(self, input: cua_driver._native_contract.SetAgentCursorThemeInput) -> ToolResult:
        raise NotImplementedError
    async def set_window_frame(self, input: cua_driver._native_contract.SetWindowFrameInput) -> ToolResult:
        raise NotImplementedError
    async def start_session(self, input: cua_driver._native_contract.StartSessionInput) -> cua_driver._native_contract.StartSessionOutput:
        raise NotImplementedError
    async def type_text(self, input: cua_driver._native_contract.TypeTextInput) -> ToolResult:
        raise NotImplementedError
    async def verify_state(self, input: cua_driver._native_contract.VerifyStateInput) -> ToolResult:
        raise NotImplementedError

class CuaDriverSession(CuaDriverSessionProtocol):

    _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_cua_driver_sdk_fn_free_cuadriversession, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cuadriversession, 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 call_tool(self, name: str,arguments_json: str) -> ToolResult:

        _UniffiFfiConverterString.check_lower(name)

        _UniffiFfiConverterString.check_lower(arguments_json)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterString.lower(name),
            _UniffiFfiConverterString.lower(arguments_json),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_call_tool(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def click(self, input: cua_driver._native_contract.ClickInput) -> cua_driver._native_contract.ActionResult:

        cua_driver._native_contract._UniffiFfiConverterTypeClickInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeClickInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeActionResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_click(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def clipboard_read(self, input: cua_driver._native_contract.ClipboardReadInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeClipboardReadInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeClipboardReadInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_clipboard_read(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def clipboard_write(self, input: cua_driver._native_contract.ClipboardWriteInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeClipboardWriteInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeClipboardWriteInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_clipboard_write(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def close(self, ) -> None:
        """
        Revoke the session-bound authority and release its native handle.

        This operation is idempotent. Dropping the object performs the same
        cleanup, but trusted hosts should call it at their lifecycle boundary.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_close,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def drag(self, input: cua_driver._native_contract.DragInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeDragInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeDragInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_drag(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def end_session(self, input: cua_driver._native_contract.EndSessionInput) -> cua_driver._native_contract.EndSessionOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeEndSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeEndSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeEndSessionOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_end_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def escalate_session(self, input: cua_driver._native_contract.EscalateSessionInput) -> cua_driver._native_contract.SessionStateOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeEscalateSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeEscalateSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeSessionStateOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_escalate_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_agent_cursor_state(self, input: cua_driver._native_contract.GetAgentCursorStateInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetAgentCursorStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetAgentCursorStateInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_agent_cursor_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_cursor_position(self, input: cua_driver._native_contract.GetCursorPositionInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetCursorPositionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetCursorPositionInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_cursor_position(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_desktop_state(self, input: cua_driver._native_contract.GetDesktopStateInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetDesktopStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetDesktopStateInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_desktop_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_screen_size(self, input: cua_driver._native_contract.GetScreenSizeInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeGetScreenSizeInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetScreenSizeInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_screen_size(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_session(self, input: cua_driver._native_contract.GetSessionInput) -> cua_driver._native_contract.SessionOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeGetSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeSessionOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_session_state(self, input: cua_driver._native_contract.GetSessionStateInput) -> cua_driver._native_contract.SessionStateOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeGetSessionStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetSessionStateInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeSessionStateOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_session_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def get_window_state(self, input: cua_driver._native_contract.GetWindowStateInput) -> cua_driver._native_contract.WindowStateOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeGetWindowStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeGetWindowStateInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeWindowStateOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_get_window_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def hotkey(self, input: cua_driver._native_contract.HotkeyInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeHotkeyInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeHotkeyInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_hotkey(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def invoke_menu(self, input: cua_driver._native_contract.InvokeMenuInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeInvokeMenuInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeInvokeMenuInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_invoke_menu(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def list_apps(self, input: cua_driver._native_contract.ListAppsInput) -> cua_driver._native_contract.ListAppsOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeListAppsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeListAppsInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeListAppsOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_apps(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def list_sessions(self, input: cua_driver._native_contract.ListSessionsInput) -> cua_driver._native_contract.ListSessionsOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeListSessionsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeListSessionsInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeListSessionsOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_sessions(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def list_windows(self, input: cua_driver._native_contract.ListWindowsInput) -> cua_driver._native_contract.ListWindowsOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeListWindowsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeListWindowsInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeListWindowsOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_list_windows(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def move_cursor(self, input: cua_driver._native_contract.MoveCursorInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeMoveCursorInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeMoveCursorInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_move_cursor(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def parse_visual_regions(self, input: cua_driver._native_contract.ParseVisualRegionsInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeParseVisualRegionsInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeParseVisualRegionsInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_parse_visual_regions(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def press_key(self, input: cua_driver._native_contract.PressKeyInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypePressKeyInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypePressKeyInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_press_key(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def scroll(self, input: cua_driver._native_contract.ScrollInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeScrollInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeScrollInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_scroll(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_agent_cursor_enabled(self, input: cua_driver._native_contract.SetAgentCursorEnabledInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorEnabledInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorEnabledInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_enabled(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_agent_cursor_motion(self, input: cua_driver._native_contract.SetAgentCursorMotionInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorMotionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorMotionInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_motion(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_agent_cursor_theme(self, input: cua_driver._native_contract.SetAgentCursorThemeInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorThemeInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetAgentCursorThemeInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_agent_cursor_theme(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def set_window_frame(self, input: cua_driver._native_contract.SetWindowFrameInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeSetWindowFrameInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeSetWindowFrameInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_set_window_frame(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def start_session(self, input: cua_driver._native_contract.StartSessionInput) -> cua_driver._native_contract.StartSessionOutput:

        cua_driver._native_contract._UniffiFfiConverterTypeStartSessionInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeStartSessionInput.lower(input),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeStartSessionOutput.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_start_session(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def type_text(self, input: cua_driver._native_contract.TypeTextInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeTypeTextInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeTypeTextInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_type_text(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def verify_state(self, input: cua_driver._native_contract.VerifyStateInput) -> ToolResult:

        cua_driver._native_contract._UniffiFfiConverterTypeVerifyStateInput.check_lower(input)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            cua_driver._native_contract._UniffiFfiConverterTypeVerifyStateInput.lower(input),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeToolResult.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cuadriversession_verify_state(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )





class _UniffiFfiConverterTypeCuaDriverSession:
    @staticmethod
    def lift(value: int) -> CuaDriverSession:
        return CuaDriverSession._uniffi_make_instance(value)

    @staticmethod
    def check_lower(value: CuaDriverSession):
        if not isinstance(value, CuaDriverSession):
            raise TypeError("Expected CuaDriverSession instance, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: CuaDriverSession) -> ctypes.c_uint64:
        return value._uniffi_clone_handle()

    @classmethod
    def read(cls, buf: _UniffiRustBuffer) -> CuaDriverSession:
        ptr = buf.read_u64()
        if ptr == 0:
            raise InternalError("Raw handle value was null")
        return cls.lift(ptr)

    @classmethod
    def write(cls, value: CuaDriverSession, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))

class _UniffiFfiConverterSequenceTypeCursorMotionSample(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        for item in value:
            _UniffiFfiConverterTypeCursorMotionSample.check_lower(item)

    @classmethod
    def write(cls, value, buf):
        items = len(value)
        buf.write_i32(items)
        for item in value:
            _UniffiFfiConverterTypeCursorMotionSample.write(item, buf)

    @classmethod
    def read(cls, buf):
        count = buf.read_i32()
        if count < 0:
            raise InternalError("Unexpected negative sequence length")

        return [
            _UniffiFfiConverterTypeCursorMotionSample.read(buf) for i in range(count)
        ]


class CursorTrajectoryProtocol(typing.Protocol):
    """
    A planned move, played back by time.
"""

    def arrival_t(self, ) -> float:
        """
        When the tip first reaches the target, seconds.
"""
        raise NotImplementedError
    def duration(self, ) -> float:
        """
        Seconds until the last sample (any settle included).
"""
        raise NotImplementedError
    def effect_frame(self, t: float,blend: bool) -> CursorEffectFrame:
        """
        The move's effects (glow, trail, magnet) at `t`, around the arrow's
        body. `blend` is whether the surface can draw translucency.
"""
        raise NotImplementedError
    def effects(self, ) -> cua_driver._native_contract.CursorMotionEffectsOutput:
        raise NotImplementedError
    def linger(self, ) -> float:
        """
        When the move and its trail or magnet glow have finished, seconds.
"""
        raise NotImplementedError
    def sample_at(self, t: float) -> CursorMotionSample:
        """
        Interpolated sample at `t` seconds, clamped to the ends.
"""
        raise NotImplementedError
    def samples(self, ) -> typing.List[CursorMotionSample]:
        """
        Every sample at 120 Hz. Read once; interpolate locally per frame.
"""
        raise NotImplementedError
    def snap_t(self, ) -> typing.Optional[float]:
        """
        Magnetic lock-on time, seconds.
"""
        raise NotImplementedError
    def target(self, ) -> CursorMotionRect:
        """
        The target used for timing (the request's, or a 24 pt box).
"""
        raise NotImplementedError
    def target_known(self, ) -> bool:
        raise NotImplementedError

class CursorTrajectory(CursorTrajectoryProtocol):
    """
    A planned move, played back by time.
"""

    _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_cua_driver_sdk_fn_free_cursortrajectory, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_cursortrajectory, 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
    def arrival_t(self, ) -> float:
        """
        When the tip first reaches the target, seconds.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterFloat64.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_arrival_t,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def duration(self, ) -> float:
        """
        Seconds until the last sample (any settle included).
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterFloat64.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_duration,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def effect_frame(self, t: float,blend: bool) -> CursorEffectFrame:
        """
        The move's effects (glow, trail, magnet) at `t`, around the arrow's
        body. `blend` is whether the surface can draw translucency.
"""

        _UniffiFfiConverterFloat64.check_lower(t)

        _UniffiFfiConverterBoolean.check_lower(blend)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterFloat64.lower(t),
            _UniffiFfiConverterBoolean.lower(blend),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCursorEffectFrame.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_effect_frame,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def effects(self, ) -> cua_driver._native_contract.CursorMotionEffectsOutput:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffectsOutput.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_effects,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def linger(self, ) -> float:
        """
        When the move and its trail or magnet glow have finished, seconds.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterFloat64.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_linger,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def sample_at(self, t: float) -> CursorMotionSample:
        """
        Interpolated sample at `t` seconds, clamped to the ends.
"""

        _UniffiFfiConverterFloat64.check_lower(t)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterFloat64.lower(t),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCursorMotionSample.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_sample_at,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def samples(self, ) -> typing.List[CursorMotionSample]:
        """
        Every sample at 120 Hz. Read once; interpolate locally per frame.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterSequenceTypeCursorMotionSample.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_samples,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def snap_t(self, ) -> typing.Optional[float]:
        """
        Magnetic lock-on time, seconds.
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterOptionalFloat64.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_snap_t,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def target(self, ) -> CursorMotionRect:
        """
        The target used for timing (the request's, or a 24 pt box).
"""
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCursorMotionRect.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_target,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def target_known(self, ) -> bool:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterBoolean.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_cursortrajectory_target_known,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)





class _UniffiFfiConverterTypeCursorTrajectory:
    @staticmethod
    def lift(value: int) -> CursorTrajectory:
        return CursorTrajectory._uniffi_make_instance(value)

    @staticmethod
    def check_lower(value: CursorTrajectory):
        if not isinstance(value, CursorTrajectory):
            raise TypeError("Expected CursorTrajectory instance, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: CursorTrajectory) -> ctypes.c_uint64:
        return value._uniffi_clone_handle()

    @classmethod
    def read(cls, buf: _UniffiRustBuffer) -> CursorTrajectory:
        ptr = buf.read_u64()
        if ptr == 0:
            raise InternalError("Raw handle value was null")
        return cls.lift(ptr)

    @classmethod
    def write(cls, value: CursorTrajectory, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))


class DriverActivityObserver():
    """
    Optional observer implemented by trusted embedding-host code.

    Observations are informational and cannot grant authority or change a tool
    result. Implementations should return quickly and hand off expensive work.
"""

    def on_activity(self, event: DriverActivityEvent) -> None:
        raise NotImplementedError

class DriverActivityObserverImpl(DriverActivityObserver):
    """
    Optional observer implemented by trusted embedding-host code.

    Observations are informational and cannot grant authority or change a tool
    result. Implementations should return quickly and hand off expensive work.
"""

    _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_cua_driver_sdk_fn_free_driveractivityobserver, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driveractivityobserver, 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
    def on_activity(self, event: DriverActivityEvent) -> None:

        _UniffiFfiConverterTypeDriverActivityEvent.check_lower(event)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterTypeDriverActivityEvent.lower(event),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_driveractivityobserver_on_activity,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)




# Put all the bits inside a class to keep the top-level namespace clean
class _UniffiTraitImplDriverActivityObserverImpl:
    # For each method, generate a callback function to pass to Rust

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER_METHOD0
    def on_activity(
            uniffi_handle,
            event,
            uniffi_out_return,
            uniffi_call_status_ptr,
        ):
        uniffi_obj = _UniffiFfiConverterTypeDriverActivityObserver._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = (_UniffiFfiConverterTypeDriverActivityEvent.lift(event), )
            uniffi_method = uniffi_obj.on_activity
            return uniffi_method(*uniffi_args)
        write_return_value = lambda v: None
        _uniffi_trait_interface_call(
                uniffi_call_status_ptr.contents,
                make_call,
                write_return_value,
        )

    @_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER
    def _uniffi_free(uniffi_handle):
        _UniffiFfiConverterTypeDriverActivityObserver._handle_map.remove(uniffi_handle)

    @_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_ACTIVITY_OBSERVER
    def _uniffi_clone(uniffi_handle):
        return _UniffiFfiConverterTypeDriverActivityObserver._handle_map.clone(uniffi_handle)

    # Generate the FFI VTable.  This has a field for each callback interface method.
    _uniffi_vtable = _UniffiVTableCallbackInterfaceCuaDriverSdkDriverActivityObserver(
        _uniffi_free,
        _uniffi_clone,
        on_activity,
    )
    # 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_cua_driver_sdk_fn_init_callback_vtable_driveractivityobserver(ctypes.byref(_uniffi_vtable))

class _UniffiFfiConverterTypeDriverActivityObserver:
    _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 DriverActivityObserverImpl._uniffi_make_instance(value)
        else:
            # Python-generated handle, get the object from the handle map
            return _UniffiFfiConverterTypeDriverActivityObserver._handle_map.remove(value)

    @staticmethod
    def check_lower(value: DriverActivityObserver):
        if not isinstance(value, DriverActivityObserver):
            raise TypeError("Expected DriverActivityObserver subclass, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: DriverActivityObserver):
         if isinstance(value, DriverActivityObserverImpl):
            # 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 _UniffiFfiConverterTypeDriverActivityObserver._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: DriverActivityObserver, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))


class DriverAuthorizationHost():
    """
    Optional callback implemented by a trusted embedding application.

    Cua invokes this only for a residual boundary whose active permission mode
    requires a host grant. Routine standard-mode automation and every
    in-manifest bounded operation bypass it.
"""

    async def authorize(self, request: DriverAuthorizationRequest) -> DriverAuthorizationDecision:
        raise NotImplementedError

class DriverAuthorizationHostImpl(DriverAuthorizationHost):
    """
    Optional callback implemented by a trusted embedding application.

    Cua invokes this only for a residual boundary whose active permission mode
    requires a host grant. Routine standard-mode automation and every
    in-manifest bounded operation bypass it.
"""

    _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_cua_driver_sdk_fn_free_driverauthorizationhost, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driverauthorizationhost, 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 authorize(self, request: DriverAuthorizationRequest) -> DriverAuthorizationDecision:

        _UniffiFfiConverterTypeDriverAuthorizationRequest.check_lower(request)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterTypeDriverAuthorizationRequest.lower(request),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeDriverAuthorizationDecision.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverAuthorizationHostError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_driverauthorizationhost_authorize(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_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 _UniffiTraitImplDriverAuthorizationHostImpl:
    # For each method, generate a callback function to pass to Rust

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST_METHOD0
    def authorize(
            uniffi_handle,
            request,
            uniffi_future_callback,
            uniffi_callback_data,
            uniffi_out_dropped_callback,
        ):
        uniffi_obj = _UniffiFfiConverterTypeDriverAuthorizationHost._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = (_UniffiFfiConverterTypeDriverAuthorizationRequest.lift(request), )
            uniffi_method = uniffi_obj.authorize
            return uniffi_method(*uniffi_args)
        def handle_success(return_value):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultRustBuffer(
                    _UniffiFfiConverterTypeDriverAuthorizationDecision.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,
            DriverAuthorizationHostError,
            _UniffiFfiConverterTypeDriverAuthorizationHostError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST
    def _uniffi_free(uniffi_handle):
        _UniffiFfiConverterTypeDriverAuthorizationHost._handle_map.remove(uniffi_handle)

    @_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_AUTHORIZATION_HOST
    def _uniffi_clone(uniffi_handle):
        return _UniffiFfiConverterTypeDriverAuthorizationHost._handle_map.clone(uniffi_handle)

    # Generate the FFI VTable.  This has a field for each callback interface method.
    _uniffi_vtable = _UniffiVTableCallbackInterfaceCuaDriverSdkDriverAuthorizationHost(
        _uniffi_free,
        _uniffi_clone,
        authorize,
    )
    # 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_cua_driver_sdk_fn_init_callback_vtable_driverauthorizationhost(ctypes.byref(_uniffi_vtable))

class _UniffiFfiConverterTypeDriverAuthorizationHost:
    _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 DriverAuthorizationHostImpl._uniffi_make_instance(value)
        else:
            # Python-generated handle, get the object from the handle map
            return _UniffiFfiConverterTypeDriverAuthorizationHost._handle_map.remove(value)

    @staticmethod
    def check_lower(value: DriverAuthorizationHost):
        if not isinstance(value, DriverAuthorizationHost):
            raise TypeError("Expected DriverAuthorizationHost subclass, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: DriverAuthorizationHost):
         if isinstance(value, DriverAuthorizationHostImpl):
            # 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 _UniffiFfiConverterTypeDriverAuthorizationHost._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: DriverAuthorizationHost, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))


class DriverServiceTransport():
    """
    A host-bound named service, never a guest-selected URL or authority.
    The transport must enforce `timeout_ms` and bound buffered response bytes to
    16 MiB. Rust bounds caller waits independently but deliberately never aborts
    an active response stream during receiver teardown.
"""

    async def send(self, request: DriverServiceRequest) -> DriverServiceResponse:
        raise NotImplementedError

class DriverServiceTransportImpl(DriverServiceTransport):
    """
    A host-bound named service, never a guest-selected URL or authority.
    The transport must enforce `timeout_ms` and bound buffered response bytes to
    16 MiB. Rust bounds caller waits independently but deliberately never aborts
    an active response stream during receiver teardown.
"""

    _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_cua_driver_sdk_fn_free_driverservicetransport, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_driverservicetransport, 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 send(self, request: DriverServiceRequest) -> DriverServiceResponse:

        _UniffiFfiConverterTypeDriverServiceRequest.check_lower(request)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterTypeDriverServiceRequest.lower(request),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeDriverServiceResponse.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverServiceTransportError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_driverservicetransport_send(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_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 _UniffiTraitImplDriverServiceTransportImpl:
    # For each method, generate a callback function to pass to Rust

    @_UNIFFI_CALLBACK_INTERFACE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT_METHOD0
    def send(
            uniffi_handle,
            request,
            uniffi_future_callback,
            uniffi_callback_data,
            uniffi_out_dropped_callback,
        ):
        uniffi_obj = _UniffiFfiConverterTypeDriverServiceTransport._handle_map.get(uniffi_handle)
        def make_call():
            uniffi_args = (_UniffiFfiConverterTypeDriverServiceRequest.lift(request), )
            uniffi_method = uniffi_obj.send
            return uniffi_method(*uniffi_args)
        def handle_success(return_value):
            uniffi_future_callback(
                uniffi_callback_data,
                _UniffiForeignFutureResultRustBuffer(
                    _UniffiFfiConverterTypeDriverServiceResponse.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_remote_channel_call_async(
            uniffi_obj._uniffi_foreign_driver_event_loop,
            make_call,
            uniffi_out_dropped_callback,
            handle_success,
            handle_error,
            DriverServiceTransportError,
            _UniffiFfiConverterTypeDriverServiceTransportError.lower,
        )

    @_UNIFFI_CALLBACK_INTERFACE_FREE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT
    def _uniffi_free(uniffi_handle):
        _UniffiFfiConverterTypeDriverServiceTransport._handle_map.remove(uniffi_handle)

    @_UNIFFI_CALLBACK_INTERFACE_CLONE_CUA_DRIVER_SDK_DRIVER_SERVICE_TRANSPORT
    def _uniffi_clone(uniffi_handle):
        return _UniffiFfiConverterTypeDriverServiceTransport._handle_map.clone(uniffi_handle)

    # Generate the FFI VTable.  This has a field for each callback interface method.
    _uniffi_vtable = _UniffiVTableCallbackInterfaceCuaDriverSdkDriverServiceTransport(
        _uniffi_free,
        _uniffi_clone,
        send,
    )
    # 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_cua_driver_sdk_fn_init_callback_vtable_driverservicetransport(ctypes.byref(_uniffi_vtable))

class _UniffiFfiConverterTypeDriverServiceTransport:
    _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 DriverServiceTransportImpl._uniffi_make_instance(value)
        else:
            # Python-generated handle, get the object from the handle map
            return _UniffiFfiConverterTypeDriverServiceTransport._handle_map.remove(value)

    @staticmethod
    def check_lower(value: DriverServiceTransport):
        if not isinstance(value, DriverServiceTransport):
            raise TypeError("Expected DriverServiceTransport subclass, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: DriverServiceTransport):
         if isinstance(value, DriverServiceTransportImpl):
            # 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.
            eventloop = asyncio.get_running_loop()
            with _UNIFFI_REMOTE_CHANNEL_LOOP_LOCK:
                owner = getattr(value, "_uniffi_foreign_driver_event_loop", eventloop)
                if owner is not eventloop:
                    raise RuntimeError("Driver service transport belongs to a different asyncio event loop")
                value._uniffi_foreign_driver_event_loop = eventloop
            return _UniffiFfiConverterTypeDriverServiceTransport._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: DriverServiceTransport, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))

class _UniffiFfiConverterOptionalTypeEmbeddedDriverConnection(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeEmbeddedDriverConnection.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeEmbeddedDriverConnection.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeEmbeddedDriverConnection.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

class _UniffiFfiConverterOptionalTypeEmbeddedDriverDiagnostics(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeEmbeddedDriverDiagnostics.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeEmbeddedDriverDiagnostics.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeEmbeddedDriverDiagnostics.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")


class EmbeddedCuaDriverHostProtocol(typing.Protocol):

    def connection(self, ) -> typing.Optional[EmbeddedDriverConnection]:
        raise NotImplementedError
    def last_diagnostics(self, ) -> typing.Optional[EmbeddedDriverDiagnostics]:
        raise NotImplementedError
    async def restart(self, ) -> EmbeddedDriverConnection:
        raise NotImplementedError
    async def start(self, ) -> EmbeddedDriverConnection:
        raise NotImplementedError
    def state(self, ) -> EmbeddedDriverHostState:
        raise NotImplementedError
    async def stop(self, ) -> None:
        raise NotImplementedError
    async def wait_for_exit(self, generation: str) -> EmbeddedDriverExit:
        raise NotImplementedError

class EmbeddedCuaDriverHost(EmbeddedCuaDriverHostProtocol):

    _handle: ctypes.c_uint64
    def __init__(self, binary_path: str,host_bundle_id: str):

        _UniffiFfiConverterString.check_lower(binary_path)

        _UniffiFfiConverterString.check_lower(host_bundle_id)
        _uniffi_lowered_args = (
            _UniffiFfiConverterString.lower(binary_path),
            _UniffiFfiConverterString.lower(host_bundle_id),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeEmbeddedCuaDriverHost.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeEmbeddedDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_embeddedcuadriverhost_new,
            *_uniffi_lowered_args,
        )
        self._handle = _uniffi_ffi_result
    @classmethod
    def with_options(cls, options: EmbeddedDriverHostOptions) -> EmbeddedCuaDriverHost:

        _UniffiFfiConverterTypeEmbeddedDriverHostOptions.check_lower(options)
        _uniffi_lowered_args = (
            _UniffiFfiConverterTypeEmbeddedDriverHostOptions.lower(options),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeEmbeddedCuaDriverHost.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeEmbeddedDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_constructor_embeddedcuadriverhost_with_options,
            *_uniffi_lowered_args,
        )
        return cls._uniffi_make_instance(_uniffi_ffi_result)

    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_cua_driver_sdk_fn_free_embeddedcuadriverhost, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_embeddedcuadriverhost, 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
    def connection(self, ) -> typing.Optional[EmbeddedDriverConnection]:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterOptionalTypeEmbeddedDriverConnection.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_connection,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    def last_diagnostics(self, ) -> typing.Optional[EmbeddedDriverDiagnostics]:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterOptionalTypeEmbeddedDriverDiagnostics.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_last_diagnostics,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def restart(self, ) -> EmbeddedDriverConnection:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeEmbeddedDriverConnection.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeEmbeddedDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_restart(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def start(self, ) -> EmbeddedDriverConnection:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeEmbeddedDriverConnection.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeEmbeddedDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_start(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def state(self, ) -> EmbeddedDriverHostState:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeEmbeddedDriverHostState.lift
        _uniffi_error_converter = None
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_state,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def stop(self, ) -> None:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = _UniffiFfiConverterTypeEmbeddedDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_stop(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_void,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    async def wait_for_exit(self, generation: str) -> EmbeddedDriverExit:

        _UniffiFfiConverterString.check_lower(generation)
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
            _UniffiFfiConverterString.lower(generation),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeEmbeddedDriverExit.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeEmbeddedDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_embeddedcuadriverhost_wait_for_exit(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_rust_buffer,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_rust_buffer,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )





class _UniffiFfiConverterTypeEmbeddedCuaDriverHost:
    @staticmethod
    def lift(value: int) -> EmbeddedCuaDriverHost:
        return EmbeddedCuaDriverHost._uniffi_make_instance(value)

    @staticmethod
    def check_lower(value: EmbeddedCuaDriverHost):
        if not isinstance(value, EmbeddedCuaDriverHost):
            raise TypeError("Expected EmbeddedCuaDriverHost instance, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: EmbeddedCuaDriverHost) -> ctypes.c_uint64:
        return value._uniffi_clone_handle()

    @classmethod
    def read(cls, buf: _UniffiRustBuffer) -> EmbeddedCuaDriverHost:
        ptr = buf.read_u64()
        if ptr == 0:
            raise InternalError("Raw handle value was null")
        return cls.lift(ptr)

    @classmethod
    def write(cls, value: EmbeddedCuaDriverHost, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))


class McpDriverChannelProtocol(typing.Protocol):

    async def close(self, ) -> None:
        raise NotImplementedError
    def driver(self, ) -> CuaDriver:
        raise NotImplementedError
    async def open(self, ) -> None:
        raise NotImplementedError
    def public_session(self, ) -> str:
        raise NotImplementedError

class McpDriverChannel(McpDriverChannelProtocol):

    _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_cua_driver_sdk_fn_free_mcpdriverchannel, handle)

    def _uniffi_clone_handle(self):
        return _uniffi_rust_call(_UniffiLib.uniffi_cua_driver_sdk_fn_clone_mcpdriverchannel, 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 close(self, ) -> None:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_close(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_void,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def driver(self, ) -> CuaDriver:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_driver,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)
    async def open(self, ) -> None:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = lambda val: None
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        return await _uniffi_rust_call_async(
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_open(*_uniffi_lowered_args),
            _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_void,
            _UniffiLib.ffi_cua_driver_sdk_rust_future_free_void,
            _uniffi_lift_return,
            _uniffi_error_converter,
        )
    def public_session(self, ) -> str:
        _uniffi_lowered_args = (
            self._uniffi_clone_handle(),
        )
        _uniffi_lift_return = _UniffiFfiConverterString.lift
        _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
        _uniffi_ffi_result = _uniffi_rust_call_with_error(
            _uniffi_error_converter,
            _UniffiLib.uniffi_cua_driver_sdk_fn_method_mcpdriverchannel_public_session,
            *_uniffi_lowered_args,
        )
        return _uniffi_lift_return(_uniffi_ffi_result)





class _UniffiFfiConverterTypeMcpDriverChannel:
    @staticmethod
    def lift(value: int) -> McpDriverChannel:
        return McpDriverChannel._uniffi_make_instance(value)

    @staticmethod
    def check_lower(value: McpDriverChannel):
        if not isinstance(value, McpDriverChannel):
            raise TypeError("Expected McpDriverChannel instance, {} found".format(type(value).__name__))

    @staticmethod
    def lower(value: McpDriverChannel) -> ctypes.c_uint64:
        return value._uniffi_clone_handle()

    @classmethod
    def read(cls, buf: _UniffiRustBuffer) -> McpDriverChannel:
        ptr = buf.read_u64()
        if ptr == 0:
            raise InternalError("Raw handle value was null")
        return cls.lift(ptr)

    @classmethod
    def write(cls, value: McpDriverChannel, buf: _UniffiRustBuffer):
        buf.write_u64(cls.lower(value))

class _UniffiFfiConverterOptionalTypeCursorMotionSpec(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeCursorMotionSpec.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeCursorMotionSpec.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeCursorMotionSpec.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")

class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt):
    CLASS_NAME = "u8"
    VALUE_MIN = 0
    VALUE_MAX = 2**8

    @staticmethod
    def read(buf):
        return buf.read_u8()

    @staticmethod
    def write(value, buf):
        buf.write_u8(value)

class _UniffiFfiConverterOptionalTypeDriverOptions(_UniffiConverterRustBuffer):
    @classmethod
    def check_lower(cls, value):
        if value is not None:
            _UniffiFfiConverterTypeDriverOptions.check_lower(value)

    @classmethod
    def write(cls, value, buf):
        if value is None:
            buf.write_u8(0)
            return

        buf.write_u8(1)
        _UniffiFfiConverterTypeDriverOptions.write(value, buf)

    @classmethod
    def read(cls, buf):
        flag = buf.read_u8()
        if flag == 0:
            return None
        elif flag == 1:
            return _UniffiFfiConverterTypeDriverOptions.read(buf)
        else:
            raise InternalError("Unexpected flag byte for optional type")
def connect_remote_channel(channel: ForeignDriverEnvelopeChannel) -> CuaDriver:
    """
    Connect the canonical typed Driver to a host-provided remote carrier.
"""

    _UniffiFfiConverterTypeForeignDriverEnvelopeChannel.check_lower(channel)
    _uniffi_lowered_args = (
        _UniffiFfiConverterTypeForeignDriverEnvelopeChannel.lower(channel),
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriver.lift
    _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_connect_remote_channel,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
async def create_remote_trusted_session(driver: CuaDriver,options: TrustedSessionOptions) -> CuaDriverSession:
    """
    Bind a logical remote session without serializing its authority.
"""

    _UniffiFfiConverterTypeCuaDriver.check_lower(driver)

    _UniffiFfiConverterTypeTrustedSessionOptions.check_lower(options)
    _uniffi_lowered_args = (
        _UniffiFfiConverterTypeCuaDriver.lower(driver),
        _UniffiFfiConverterTypeTrustedSessionOptions.lower(options),
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriverSession.lift
    _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
    return await _uniffi_rust_call_async(
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_create_remote_trusted_session(*_uniffi_lowered_args),
        _UniffiLib.ffi_cua_driver_sdk_rust_future_poll_u64,
        _UniffiLib.ffi_cua_driver_sdk_rust_future_complete_u64,
        _UniffiLib.ffi_cua_driver_sdk_rust_future_free_u64,
        _uniffi_lift_return,
        _uniffi_error_converter,
    )
def create_trusted_session(driver: CuaDriver,options: TrustedSessionOptions) -> CuaDriverSession:
    """
    Generated-language host factory for a session-bound action surface.

    This remains a separate top-level capability instead of adding a required
    method to the released `CuaDriverProtocol` / `CuaDriverLike` structural
    interfaces.
"""

    _UniffiFfiConverterTypeCuaDriver.check_lower(driver)

    _UniffiFfiConverterTypeTrustedSessionOptions.check_lower(options)
    _uniffi_lowered_args = (
        _UniffiFfiConverterTypeCuaDriver.lower(driver),
        _UniffiFfiConverterTypeTrustedSessionOptions.lower(options),
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeCuaDriverSession.lift
    _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_create_trusted_session,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def current_mac_os_permission_status() -> MacOsPermissionStatus:
    _uniffi_lowered_args = (
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeMacOsPermissionStatus.lift
    _uniffi_error_converter = None
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_current_mac_os_permission_status,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def cursor_click_effects(effects: cua_driver._native_contract.CursorMotionEffectsOutput,age: float,x: float,y: float) -> CursorEffectFrame:
    """
    Click effects (ripple, squish) `age` seconds after a click at `(x, y)`.
"""

    cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffectsOutput.check_lower(effects)

    _UniffiFfiConverterFloat64.check_lower(age)

    _UniffiFfiConverterFloat64.check_lower(x)

    _UniffiFfiConverterFloat64.check_lower(y)
    _uniffi_lowered_args = (
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionEffectsOutput.lower(effects),
        _UniffiFfiConverterFloat64.lower(age),
        _UniffiFfiConverterFloat64.lower(x),
        _UniffiFfiConverterFloat64.lower(y),
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeCursorEffectFrame.lift
    _uniffi_error_converter = None
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_cursor_click_effects,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def cursor_motion_spec_for_style(style: cua_driver._native_contract.CursorMotionStyle,params: CursorMotionParams) -> typing.Optional[CursorMotionSpec]:
    """
    The spec behind a built-in style (`signature_arc`, `spring_settle` and
    `comet_swoop`); `None` for the simulated styles.
"""

    cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionStyle.check_lower(style)

    _UniffiFfiConverterTypeCursorMotionParams.check_lower(params)
    _uniffi_lowered_args = (
        cua_driver._native_contract._UniffiFfiConverterTypeCursorMotionStyle.lower(style),
        _UniffiFfiConverterTypeCursorMotionParams.lower(params),
    )
    _uniffi_lift_return = _UniffiFfiConverterOptionalTypeCursorMotionSpec.lift
    _uniffi_error_converter = None
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_cursor_motion_spec_for_style,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def default_cursor_motion_params() -> CursorMotionParams:
    """
    Cua Driver's default motion knobs.
"""
    _uniffi_lowered_args = (
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeCursorMotionParams.lift
    _uniffi_error_converter = None
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_default_cursor_motion_params,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def open_mac_os_screen_recording_settings() -> None:
    _uniffi_lowered_args = (
    )
    _uniffi_lift_return = lambda val: None
    _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_open_mac_os_screen_recording_settings,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def open_mcp_driver_channel(transport: DriverServiceTransport,authenticated_principal: str) -> McpDriverChannel:
    """
    Construct before opening so the owner can invalidate an in-flight initialize.
"""

    _UniffiFfiConverterTypeDriverServiceTransport.check_lower(transport)

    _UniffiFfiConverterString.check_lower(authenticated_principal)
    _uniffi_lowered_args = (
        _UniffiFfiConverterTypeDriverServiceTransport.lower(transport),
        _UniffiFfiConverterString.lower(authenticated_principal),
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeMcpDriverChannel.lift
    _uniffi_error_converter = _UniffiFfiConverterTypeDriverError
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_open_mcp_driver_channel,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def plan_cursor_move(params: CursorMotionParams,request: CursorMoveRequest) -> CursorTrajectory:
    """
    Plan one move for a built-in style.
"""

    _UniffiFfiConverterTypeCursorMotionParams.check_lower(params)

    _UniffiFfiConverterTypeCursorMoveRequest.check_lower(request)
    _uniffi_lowered_args = (
        _UniffiFfiConverterTypeCursorMotionParams.lower(params),
        _UniffiFfiConverterTypeCursorMoveRequest.lower(request),
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeCursorTrajectory.lift
    _uniffi_error_converter = None
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_plan_cursor_move,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def plan_cursor_spec(spec: CursorMotionSpec,request: CursorMoveRequest) -> CursorTrajectory:
    """
    Plan one move for a custom spec.
"""

    _UniffiFfiConverterTypeCursorMotionSpec.check_lower(spec)

    _UniffiFfiConverterTypeCursorMoveRequest.check_lower(request)
    _uniffi_lowered_args = (
        _UniffiFfiConverterTypeCursorMotionSpec.lower(spec),
        _UniffiFfiConverterTypeCursorMoveRequest.lower(request),
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeCursorTrajectory.lift
    _uniffi_error_converter = None
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_plan_cursor_spec,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)
def request_mac_os_permissions() -> MacOsPermissionStatus:
    _uniffi_lowered_args = (
    )
    _uniffi_lift_return = _UniffiFfiConverterTypeMacOsPermissionStatus.lift
    _uniffi_error_converter = None
    _uniffi_ffi_result = _uniffi_rust_call_with_error(
        _uniffi_error_converter,
        _UniffiLib.uniffi_cua_driver_sdk_fn_func_request_mac_os_permissions,
        *_uniffi_lowered_args,
    )
    return _uniffi_lift_return(_uniffi_ffi_result)

__all__ = [
    "InternalError",
    "SessionPermissionMode",
    "CursorPathShape",
    "CursorEase",
    "CursorSettle",
    "CursorMotionDuration",
    "CursorHeading",
    "DriverActivityKind",
    "DriverAuthorizationAction",
    "EmbeddedPermissionMode",
    "ForeignDriverChannelError",
    "ActionCompletion",
    "DriverAuthorizationHostError",
    "DriverError",
    "DriverExecutionMode",
    "DriverServiceTransportError",
    "EmbeddedDriverError",
    "EmbeddedDriverHostState",
    "SdkClientKind",
    "RuntimeAuthorizationOptions",
    "ConfiguredDriverOptions",
    "CursorGlow",
    "CursorTrailSegment",
    "CursorMotionRect",
    "CursorMagnet",
    "CursorRipple",
    "CursorEffectFrame",
    "CursorMotionParams",
    "CursorMotionPoint",
    "CursorMotionSample",
    "CursorTrailSpec",
    "CursorMotionSpec",
    "CursorMoveRequest",
    "DriverActivityEvent",
    "DriverAuthorizationDecision",
    "DriverAuthorizationRequest",
    "DriverMetadata",
    "DriverOptions",
    "DriverServiceHeader",
    "DriverServiceRequest",
    "DriverServiceResponse",
    "EmbeddedEnvironmentVariable",
    "EmbeddedMcpConfiguration",
    "EmbeddedDriverConnection",
    "EmbeddedDriverDiagnostics",
    "EmbeddedDriverExit",
    "EmbeddedDriverHostOptions",
    "ForeignDriverChannelIdentity",
    "ForeignDriverChannelCapabilities",
    "ForeignDriverRequestEnvelope",
    "ForeignDriverResponseEnvelope",
    "TrustedSessionOptions",
    "ForeignDriverBoundChannel",
    "ImageContent",
    "MacOsPermissionStatus",
    "PrivateWorkerOptions",
    "ToolResult",
    "connect_remote_channel",
    "create_remote_trusted_session",
    "create_trusted_session",
    "current_mac_os_permission_status",
    "cursor_click_effects",
    "cursor_motion_spec_for_style",
    "default_cursor_motion_params",
    "open_mac_os_screen_recording_settings",
    "open_mcp_driver_channel",
    "plan_cursor_move",
    "plan_cursor_spec",
    "request_mac_os_permissions",
    "ForeignDriverEnvelopeChannelImpl",
    "ForeignDriverEnvelopeChannel",
    "CuaDriver",
    "CuaDriverProtocol",
    "CuaDriverSession",
    "CuaDriverSessionProtocol",
    "CursorTrajectory",
    "CursorTrajectoryProtocol",
    "DriverActivityObserverImpl",
    "DriverActivityObserver",
    "DriverAuthorizationHostImpl",
    "DriverAuthorizationHost",
    "DriverServiceTransportImpl",
    "DriverServiceTransport",
    "EmbeddedCuaDriverHost",
    "EmbeddedCuaDriverHostProtocol",
    "McpDriverChannel",
    "McpDriverChannelProtocol",
]