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.

feat(spaces): expose a Space's authenticated spacesd client (#4592)

injaneity1f9a62755785
diff --git a/docs/content/docs/cua-sdk/reference/index.mdx b/docs/content/docs/cua-sdk/reference/index.mdx
index ffddaeb975..34ee6de985 100644
--- a/docs/content/docs/cua-sdk/reference/index.mdx
+++ b/docs/content/docs/cua-sdk/reference/index.mdx
@@ -137,6 +137,6 @@ Pages marked *Cua Spaces app export* document the APIs the Cua Spaces apps are b
| --- | --- |
| [Protocol](/cua-sdk/reference/protocol) | The gRPC contracts of cua-spacesd (`cua.env.v1`) and the cua daemon (`cua.daemon.v1`). |
-290 items, 381 methods. The [Types](/cua-sdk/reference/types) page lists them.
+290 items, 382 methods. The [Types](/cua-sdk/reference/types) page lists them.
The Cua Spaces app export adds 723 items and 38 methods.
diff --git a/docs/content/docs/cua-sdk/reference/spaces/space.mdx b/docs/content/docs/cua-sdk/reference/spaces/space.mdx
index 876f7530c0..484ff276f1 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/space.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/space.mdx
@@ -56,6 +56,7 @@ Returned by [`Spaces.space`](/cua-sdk/reference/spaces#spacesspace).
| [`displays`](/cua-sdk/reference/spaces/windows#spacedisplays) | The Space's displays, primary first, with their resolution in physical pixels. |
| [`join_presence`](/cua-sdk/reference/spaces/streams#spacejoin_presence) | Joins presence. |
| [`open_stream`](/cua-sdk/reference/spaces/streams#spaceopen_stream) | Mints a media session (ticket + WebSocket URL) for another client to attach to. |
+| [`spacesd`](/cua-sdk/reference/spacesd#spacespacesd) | The cua-spacesd client over the connection this Space authenticated. |
| [`stream_session`](/cua-sdk/reference/spaces/streams#spacestream_session) | Opens a media session and delivers keyframe-gated encoded frames and audio to the sinks (one delivery thread; decoding stays with the caller). |
| [`teleport`](/cua-sdk/reference/spaces/teleport#spaceteleport) | Teleports `app`'s session into this Space. |
| [`teleport_manifest`](/cua-sdk/reference/spaces/teleport#spaceteleport_manifest) | What teleporting `app` (`full` or `tabs`) would move from this host. |
diff --git a/docs/content/docs/cua-sdk/reference/spacesd/index.mdx b/docs/content/docs/cua-sdk/reference/spacesd/index.mdx
index ee1fcba1b7..afdd69b388 100644
--- a/docs/content/docs/cua-sdk/reference/spacesd/index.mdx
+++ b/docs/content/docs/cua-sdk/reference/spacesd/index.mdx
@@ -12,17 +12,66 @@ description: "SpacesdClient: the cua-spacesd client for processes, files, the de
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
-`sandbox.spacesd()` (or `cua.spacesd(url, token)` for any spacesd) returns a `SpacesdClient`. It picks native gRPC or gRPC-Web, sends the token and chunks transfers. Methods by task: [processes](/cua-sdk/reference/spacesd/shell), [files](/cua-sdk/reference/spacesd/files), [computer](/cua-sdk/reference/spacesd/computer) and [media](/cua-sdk/reference/spacesd/media).
+`sandbox.spacesd()`, `space.spacesd()` (or `cua.spacesd(url, token)` for any spacesd) returns a `SpacesdClient`. It picks native gRPC or gRPC-Web, sends the token and chunks transfers. Methods by task: [processes](/cua-sdk/reference/spacesd/shell), [files](/cua-sdk/reference/spacesd/files), [computer](/cua-sdk/reference/spacesd/computer) and [media](/cua-sdk/reference/spacesd/media).
Python programs usually use the high-level API instead: [`cua_sandbox` interfaces](/cua-sdk/reference/python/interfaces).
cua-spacesd is optional: images without it still boot and serve their declared services, and `sandbox.spacesd()` raises `SpacesdNotAvailable`. `capabilities()` reports what this spacesd supports (`has_feature(name)` checks one feature). `call_json(method, json)` reaches every `cua.env.v1` RPC of the [protocol](/cua-sdk/reference/protocol), including those without a typed method.
+## From a Space
+
+Methods of [`Space`](/cua-sdk/reference/spaces/space#space).
+
+### `Space.spacesd`
+
+The cua-spacesd client over the connection this Space authenticated.
+
+<Tabs items={['Python', 'TypeScript', 'Swift', 'Kotlin', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Python">
+
+```python
+def spacesd(self) -> SpacesdClient
+```
+
+</Tab>
+<Tab value="TypeScript">
+
+```ts
+spacesd(): SpacesdClientLike
+```
+
+</Tab>
+<Tab value="Swift">
+
+```swift
+func spacesd() throws -> SpacesdClient
+```
+
+</Tab>
+<Tab value="Kotlin">
+
+```kotlin
+@Throws(CuaException::class)
+fun spacesd(): SpacesdClient
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn spacesd(&self) -> Result<Arc<SpacesdClient>, CuaError>
+```
+
+</Tab>
+</Tabs>
+
+**Returns** [`SpacesdClient`](#spacesdclient) · **Raises** [`CuaError`](/cua-sdk/reference/errors)
+
## `SpacesdClient`
Client for one cua-spacesd.
-Returned by [`Cua.spacesd`](/cua-sdk/reference/cua#cuaspacesd), [`Relay.connect`](/cua-sdk/reference/spaces/host#relayconnect), [`Sandbox.spacesd`](/cua-sdk/reference/sandbox#sandboxspacesd).
+Returned by [`Cua.spacesd`](/cua-sdk/reference/cua#cuaspacesd), [`Relay.connect`](/cua-sdk/reference/spaces/host#relayconnect), [`Sandbox.spacesd`](/cua-sdk/reference/sandbox#sandboxspacesd), [`Space.spacesd`](#spacespacesd).
| Method | Description |
| --- | --- |
diff --git a/libs/cua/crates/cua-sdk/src/native/spaces.rs b/libs/cua/crates/cua-sdk/src/native/spaces.rs
index 966a41192a..82b7714ab0 100644
--- a/libs/cua/crates/cua-sdk/src/native/spaces.rs
+++ b/libs/cua/crates/cua-sdk/src/native/spaces.rs
@@ -2879,6 +2879,21 @@ impl Space {
Ok(serde_json::to_string(self.inner.capabilities())?)
}
+ /// The cua-spacesd client over the connection this Space authenticated.
+ pub fn spacesd(&self) -> Result<Arc<super::spacesd::SpacesdClient>> {
+ let client = self.inner.spacesd()?.clone();
+ let s = self.inner.clone();
+ let refresh: super::spacesd::WsHeaderRefresh = Arc::new(move || {
+ let s = s.clone();
+ Box::pin(async move { Ok(s.websocket_headers().await?) })
+ });
+ Ok(Arc::new(
+ super::spacesd::SpacesdClient::new(client, vec![])
+ .at(self.inner.provider().as_str())
+ .with_ws_refresh(refresh),
+ ))
+ }
+
/// Headers a media WebSocket to this Space needs besides its ticket.
pub async fn websocket_headers(&self) -> Result<Vec<super::HttpHeader>> {
let s = self.inner.clone();
diff --git a/libs/cua/crates/cua-sdk/tests/topologies.rs b/libs/cua/crates/cua-sdk/tests/topologies.rs
index ec1f28de1d..af299adb71 100644
--- a/libs/cua/crates/cua-sdk/tests/topologies.rs
+++ b/libs/cua/crates/cua-sdk/tests/topologies.rs
@@ -487,6 +487,48 @@ async fn suite(t: Topology) {
assert_eq!(fenv.transport(), expected);
let out = fenv.run(cmd("echo", &["gw"])).await.unwrap();
assert_eq!(out.stdout, b"gw\n");
+ let spaces = cua.spaces();
+ let direct_space = spaces
+ .add(w.env.url.clone(), Some(TOKEN.into()), None)
+ .await
+ .unwrap();
+ let mut cat = cmd("cat", &[]);
+ cat.stdin = true;
+ let p = spaces
+ .space(direct_space.id.clone())
+ .await
+ .unwrap()
+ .spacesd()
+ .unwrap()
+ .spawn(cat)
+ .await
+ .unwrap();
+ p.write_stdin(b"over stdin".to_vec()).await.unwrap();
+ p.close_stdin().await.unwrap();
+ assert_eq!(p.wait().await.unwrap().stdout, b"over stdin");
+ spaces.remove(direct_space.id).await.unwrap();
+ let cloud_space = spaces
+ .add(format!("cloud:{}", fsb.info().name), None, None)
+ .await
+ .unwrap();
+ let cenv = spaces
+ .space(cloud_space.id.clone())
+ .await
+ .unwrap()
+ .spacesd()
+ .unwrap();
+ assert_eq!(
+ cenv.run(cmd("echo", &["space"])).await.unwrap().stdout,
+ b"space\n"
+ );
+ assert!(
+ cenv.current_ws_headers()
+ .await
+ .unwrap()
+ .iter()
+ .any(|(k, _)| k == "authorization")
+ );
+ spaces.remove(cloud_space.id).await.unwrap();
let svc = fsb.service("env".into()).unwrap();
// Cloud: signed service URLs, no Fleet vocabulary outside the details.
let signed = svc.url().await.unwrap();
diff --git a/libs/cua/kotlin/src/main/kotlin/ai/cua/sdk/cua_sdk.kt b/libs/cua/kotlin/src/main/kotlin/ai/cua/sdk/cua_sdk.kt
index ebf5a2f36b..d30b7722a2 100644
--- a/libs/cua/kotlin/src/main/kotlin/ai/cua/sdk/cua_sdk.kt
+++ b/libs/cua/kotlin/src/main/kotlin/ai/cua/sdk/cua_sdk.kt
@@ -1307,6 +1307,8 @@ external fun uniffi_cua_sdk_checksum_method_space_share(
): Short
external fun uniffi_cua_sdk_checksum_method_space_shares(
): Short
+external fun uniffi_cua_sdk_checksum_method_space_spacesd(
+): Short
external fun uniffi_cua_sdk_checksum_method_space_start_hotspot(
): Short
external fun uniffi_cua_sdk_checksum_method_space_stop_hotspot(
@@ -2219,6 +2221,8 @@ external fun uniffi_cua_sdk_fn_method_space_share(`ptr`: Long,`who`: RustBuffer.
): Long
external fun uniffi_cua_sdk_fn_method_space_shares(`ptr`: Long,
): Long
+external fun uniffi_cua_sdk_fn_method_space_spacesd(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
external fun uniffi_cua_sdk_fn_method_space_start_hotspot(`ptr`: Long,`setSystemProxy`: RustBuffer.ByValue,`bypass`: RustBuffer.ByValue,
): Long
external fun uniffi_cua_sdk_fn_method_space_stop_hotspot(`ptr`: Long,
@@ -3629,6 +3633,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_cua_sdk_checksum_method_space_shares() != 19234.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cua_sdk_checksum_method_space_spacesd() != 47873.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cua_sdk_checksum_method_space_start_hotspot() != 44744.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
@@ -16294,6 +16301,11 @@ public interface SpaceInterface {
*/
suspend fun `shares`(): SpaceShares
+ /**
+ * The cua-spacesd client over the connection this Space authenticated.
+ */
+ fun `spacesd`(): SpacesdClient
+
/**
* Starts the reverse-SOCKS hotspot: this host serves the Space's
* egress. `set_system_proxy` points the guest's proxy settings at it
@@ -17225,6 +17237,23 @@ open class Space: Disposable, AutoCloseable, SpaceInterface
}
+ /**
+ * The cua-spacesd client over the connection this Space authenticated.
+ */
+ @Throws(CuaException::class)override fun `spacesd`(): SpacesdClient {
+ return FfiConverterTypeSpacesdClient.lift(
+ callWithHandle {
+ uniffiRustCallWithError(CuaException) { _status ->
+ UniffiLib.uniffi_cua_sdk_fn_method_space_spacesd(
+ it,
+ _status)
+}
+ }
+ )
+ }
+
+
+
/**
* Starts the reverse-SOCKS hotspot: this host serves the Space's
* egress. `set_system_proxy` points the guest's proxy settings at it
diff --git a/libs/cua/python/src/cua/_native.py b/libs/cua/python/src/cua/_native.py
index 196e306dcd..f939d21fcb 100644
--- a/libs/cua/python/src/cua/_native.py
+++ b/libs/cua/python/src/cua/_native.py
@@ -1063,6 +1063,8 @@ def _uniffi_check_api_checksums(lib):
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cua_sdk_checksum_method_space_shares() != 19234:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cua_sdk_checksum_method_space_spacesd() != 47873:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cua_sdk_checksum_method_space_start_hotspot() != 44744:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cua_sdk_checksum_method_space_stop_hotspot() != 18254:
@@ -3526,6 +3528,11 @@ _UniffiLib.uniffi_cua_sdk_fn_method_space_shares.argtypes = (
ctypes.c_uint64,
)
_UniffiLib.uniffi_cua_sdk_fn_method_space_shares.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cua_sdk_fn_method_space_spacesd.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cua_sdk_fn_method_space_spacesd.restype = ctypes.c_uint64
_UniffiLib.uniffi_cua_sdk_fn_method_space_start_hotspot.argtypes = (
ctypes.c_uint64,
_UniffiRustBuffer,
@@ -5210,6 +5217,9 @@ _UniffiLib.uniffi_cua_sdk_checksum_method_space_share.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_sdk_checksum_method_space_shares.argtypes = (
)
_UniffiLib.uniffi_cua_sdk_checksum_method_space_shares.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cua_sdk_checksum_method_space_spacesd.argtypes = (
+)
+_UniffiLib.uniffi_cua_sdk_checksum_method_space_spacesd.restype = ctypes.c_uint16
_UniffiLib.uniffi_cua_sdk_checksum_method_space_start_hotspot.argtypes = (
)
_UniffiLib.uniffi_cua_sdk_checksum_method_space_start_hotspot.restype = ctypes.c_uint16
@@ -32286,6 +32296,11 @@ class SpaceProtocol(typing.Protocol):
async def shares(self, ) -> SpaceShares:
"""
Who this Space is shared with, and who of them is connected now.
+"""
+ raise NotImplementedError
+ def spacesd(self, ) -> SpacesdClient:
+ """
+ The cua-spacesd client over the connection this Space authenticated.
"""
raise NotImplementedError
async def start_hotspot(self, set_system_proxy: typing.Optional[bool],bypass: typing.Optional[typing.List[str]]) -> SpaceHotspotStatus:
@@ -33090,6 +33105,21 @@ class Space(SpaceProtocol):
_uniffi_lift_return,
_uniffi_error_converter,
)
+ def spacesd(self, ) -> SpacesdClient:
+ """
+ The cua-spacesd client over the connection this Space authenticated.
+"""
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSpacesdClient.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeCuaError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cua_sdk_fn_method_space_spacesd,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
async def start_hotspot(self, set_system_proxy: typing.Optional[bool],bypass: typing.Optional[typing.List[str]]) -> SpaceHotspotStatus:
"""
Starts the reverse-SOCKS hotspot: this host serves the Space's
diff --git a/libs/cua/swift/Sources/CuaSDK/CuaSDK.swift b/libs/cua/swift/Sources/CuaSDK/CuaSDK.swift
index b40a94a9cb..6a4d21ed63 100644
--- a/libs/cua/swift/Sources/CuaSDK/CuaSDK.swift
+++ b/libs/cua/swift/Sources/CuaSDK/CuaSDK.swift
@@ -8409,6 +8409,11 @@ public protocol SpaceProtocol: AnyObject, Sendable {
*/
func shares() async throws -> SpaceShares
+ /**
+ * The cua-spacesd client over the connection this Space authenticated.
+ */
+ func spacesd() throws -> SpacesdClient
+
/**
* Starts the reverse-SOCKS hotspot: this host serves the Space's
* egress. `set_system_proxy` points the guest's proxy settings at it
@@ -9167,6 +9172,17 @@ open func shares()async throws -> SpaceShares {
)
}
+ /**
+ * The cua-spacesd client over the connection this Space authenticated.
+ */
+open func spacesd()throws -> SpacesdClient {
+ return try FfiConverterTypeSpacesdClient_lift(try rustCallWithError(FfiConverterTypeCuaError_lift) {
+ uniffi_cua_sdk_fn_method_space_spacesd(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
/**
* Starts the reverse-SOCKS hotspot: this host serves the Space's
* egress. `set_system_proxy` points the guest's proxy settings at it
@@ -40693,6 +40709,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_cua_sdk_checksum_method_space_shares() != 19234) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cua_sdk_checksum_method_space_spacesd() != 47873) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cua_sdk_checksum_method_space_start_hotspot() != 44744) {
return InitializationResult.apiChecksumMismatch
}
diff --git a/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.h b/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.h
index a9f42b3f8c..8d28bb2382 100644
--- a/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.h
+++ b/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.h
@@ -1761,6 +1761,11 @@ uint64_t uniffi_cua_sdk_fn_method_space_share(uint64_t ptr, RustBuffer who, Rust
uint64_t uniffi_cua_sdk_fn_method_space_shares(uint64_t ptr
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACE_SPACESD
+#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACE_SPACESD
+uint64_t uniffi_cua_sdk_fn_method_space_spacesd(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACE_START_HOTSPOT
#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACE_START_HOTSPOT
uint64_t uniffi_cua_sdk_fn_method_space_start_hotspot(uint64_t ptr, RustBuffer set_system_proxy, RustBuffer bypass
@@ -4839,6 +4844,12 @@ uint16_t uniffi_cua_sdk_checksum_method_space_share(void
#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACE_SHARES
uint16_t uniffi_cua_sdk_checksum_method_space_shares(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACE_SPACESD
+#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACE_SPACESD
+uint16_t uniffi_cua_sdk_checksum_method_space_spacesd(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACE_START_HOTSPOT
diff --git a/libs/cua/typescript/src/native/cua_sdk-ffi.ts b/libs/cua/typescript/src/native/cua_sdk-ffi.ts
index 9161495c7f..75d7936d33 100644
--- a/libs/cua/typescript/src/native/cua_sdk-ffi.ts
+++ b/libs/cua/typescript/src/native/cua_sdk-ffi.ts
@@ -2053,6 +2053,11 @@ const DEFINITIONS = {
ret: FfiType.Handle,
hasRustCallStatus: false,
},
+ "uniffi_cua_sdk_fn_method_space_spacesd": {
+ args: [FfiType.Handle],
+ ret: FfiType.Handle,
+ hasRustCallStatus: true,
+ },
"uniffi_cua_sdk_fn_method_space_start_hotspot": {
args: [FfiType.Handle, FfiType.RustBuffer, FfiType.RustBuffer],
ret: FfiType.Handle,
@@ -4263,6 +4268,11 @@ const DEFINITIONS = {
ret: FfiType.UInt16,
hasRustCallStatus: false,
},
+ "uniffi_cua_sdk_checksum_method_space_spacesd": {
+ args: [],
+ ret: FfiType.UInt16,
+ hasRustCallStatus: false,
+ },
"uniffi_cua_sdk_checksum_method_space_start_hotspot": {
args: [],
ret: FfiType.UInt16,
@@ -5527,6 +5537,7 @@ interface NativeModuleInterface {
uniffi_cua_sdk_fn_method_space_set_presence_settings(uniffiSelf: bigint, cursorProbe: Uint8Array): bigint;
uniffi_cua_sdk_fn_method_space_share(uniffiSelf: bigint, who: Uint8Array, role: Uint8Array): bigint;
uniffi_cua_sdk_fn_method_space_shares(uniffiSelf: bigint): bigint;
+ uniffi_cua_sdk_fn_method_space_spacesd(uniffiSelf: bigint, uniffi_out_err: UniffiRustCallStatus): bigint;
uniffi_cua_sdk_fn_method_space_start_hotspot(uniffiSelf: bigint, setSystemProxy: Uint8Array, bypass: Uint8Array): bigint;
uniffi_cua_sdk_fn_method_space_stop_hotspot(uniffiSelf: bigint): bigint;
uniffi_cua_sdk_fn_method_space_stream_session(uniffiSelf: bigint, options: Uint8Array, frames: bigint, audio: Uint8Array): bigint;
@@ -5969,6 +5980,7 @@ interface NativeModuleInterface {
uniffi_cua_sdk_checksum_method_space_set_presence_settings(): number;
uniffi_cua_sdk_checksum_method_space_share(): number;
uniffi_cua_sdk_checksum_method_space_shares(): number;
+ uniffi_cua_sdk_checksum_method_space_spacesd(): number;
uniffi_cua_sdk_checksum_method_space_start_hotspot(): number;
uniffi_cua_sdk_checksum_method_space_stop_hotspot(): number;
uniffi_cua_sdk_checksum_method_space_stream_session(): number;
diff --git a/libs/cua/typescript/src/native/cua_sdk.ts b/libs/cua/typescript/src/native/cua_sdk.ts
index a15c6035e3..cd303ab321 100644
--- a/libs/cua/typescript/src/native/cua_sdk.ts
+++ b/libs/cua/typescript/src/native/cua_sdk.ts
@@ -30628,6 +30628,10 @@ export interface SpaceLike {
* Who this Space is shared with, and who of them is connected now.
*/
shares(asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpaceShares>;
+/**
+ * The cua-spacesd client over the connection this Space authenticated.
+ */
+ spacesd() /*throws*/: SpacesdClientLike;
/**
* Starts the reverse-SOCKS hotspot: this host serves the Space's
* egress. `set_system_proxy` points the guest's proxy settings at it
@@ -31757,6 +31761,21 @@ private constructor(pointer: UniffiHandle) {
}
}
+/**
+ * The cua-spacesd client over the connection this Space authenticated.
+ */
+ spacesd(): SpacesdClientLike /*throws*/ {
+ return FfiConverterTypeSpacesdClient.lift(uniffiCaller.rustCallWithError(
+ /*liftError:*/ FfiConverterTypeCuaError.lift.bind(FfiConverterTypeCuaError),
+ /*caller:*/ (callStatus) => {
+ return nativeModule().uniffi_cua_sdk_fn_method_space_spacesd(
+ uniffiTypeSpaceObjectFactory.clonePointer(this),
+ callStatus);
+ },
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
+ ));
+ }
+
/**
* Starts the reverse-SOCKS hotspot: this host serves the Space's
* egress. `set_system_proxy` points the guest's proxy settings at it
@@ -37609,6 +37628,9 @@ function uniffiEnsureInitialized() {
if (nativeModule().uniffi_cua_sdk_checksum_method_space_shares() !== 19234) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_space_shares");
}
+ if (nativeModule().uniffi_cua_sdk_checksum_method_space_spacesd() !== 47873) {
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_space_spacesd");
+ }
if (nativeModule().uniffi_cua_sdk_checksum_method_space_start_hotspot() !== 44744) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_space_start_hotspot");
}
diff --git a/scripts/docs-generators/cua-sdk.ts b/scripts/docs-generators/cua-sdk.ts
index 693e650ac9..daba4496f0 100644
--- a/scripts/docs-generators/cua-sdk.ts
+++ b/scripts/docs-generators/cua-sdk.ts
@@ -321,7 +321,8 @@ export const PAGES: PageSpec[] = [
title: 'Spacesd client',
description: 'SpacesdClient: the cua-spacesd client for processes, files, the desktop and media in a sandbox.',
intro:
- '`sandbox.spacesd()` (or `cua.spacesd(url, token)` for any spacesd) returns a `SpacesdClient`. It picks native gRPC or gRPC-Web, sends the token and chunks transfers. Methods by task: [processes](/cua-sdk/reference/spacesd/shell), [files](/cua-sdk/reference/spacesd/files), [computer](/cua-sdk/reference/spacesd/computer) and [media](/cua-sdk/reference/spacesd/media).',
+ '`sandbox.spacesd()`, `space.spacesd()` (or `cua.spacesd(url, token)` for any spacesd) returns a `SpacesdClient`. It picks native gRPC or gRPC-Web, sends the token and chunks transfers. Methods by task: [processes](/cua-sdk/reference/spacesd/shell), [files](/cua-sdk/reference/spacesd/files), [computer](/cua-sdk/reference/spacesd/computer) and [media](/cua-sdk/reference/spacesd/media).',
+ members: [{ object: 'Space', title: 'From a Space', methods: ['spacesd'] }],
items: ['SpacesdClient', 'SpacesdCapabilities', 'SpacesdFeature', 'SpacesdHttpRequest', 'SpacesdHttpResponse', 'SpacesdHttpHeader'],
modules: ['spacesd', 'types'],
python: [['`cua_sandbox` interfaces', `${PY}/interfaces`]],