Space

A connected Space: shell, files, tools, windows, icons, displays, the hotspot and teleport.

Connected machine primitives; missing spacesd features return CapabilityMissing.

Space#

A connected Space. Every primitive checks the spacesd feature it needs first and fails with CapabilityMissing naming it.

Returned by Space.fork, Spaces.fork, Spaces.space.

MethodDescription
bashRuns a shell command (/bin/sh -c, cmd /C on Windows).
call_toolCalls a tool of the Space's MCP service with JSON arguments.
capabilities_jsonGetCapabilities of the spacesd, as proto3 JSON.
downloadCopies a guest file or folder into dest_dir on this host.
homeThe Space user's home directory.
hotspot_statusThis Space's hotspot status.
list_toolsTools of the Space's MCP service (driver, the default).
request_site_loginSigns in to a site in this Space's browser with a password the user saved in the Cua Keyvault.
screenshotCaptures the Space's display: PNG at full size on the primary display unless options say otherwise (for a small preview, Space.thumbnail reads the shared cache instead).
send_fileDrops a host file or folder into the Space's ~/Downloads[/subdir] (TeleportService.ReceiveFiles, per-file SHA-256).
set_presence_settingsSets this Space's presence settings.
start_hotspotStarts the reverse-SOCKS hotspot: this host serves the Space's egress.
stop_hotspotStops this Space's hotspot.
supportsWhether the spacesd supports feature.
uploadCopies a host file or folder to dest in the Space (default: the home directory).
writeWrites bytes to a guest path (parents created, verified by SHA-256).
agent_eventsNormalized events after cursor (0: the start), as the agent_events JSON (events, cursor, caught_up, status).
agent_interruptCancels the run's turn in flight; the session stays open.
agent_listEvery agent run in this Space.
agent_messageSends a follow-up message to a run.
agent_startStarts an agent CLI (claude-code, openai-codex, ...) with a prompt, as a detached spacesd process.
agent_statusA run's status with the last tail lines of output.
agent_stopStops a run.
app_iconThe icon the guest desktop shows for a window's app (pass the window's app_name, app_id and pid), or None when the Space has none: show no icon then, not a placeholder.
app_iconsIcons for many windows' apps at once, in request order (None: the Space has no icon for that app; show none).
attach_streamAttaches to a ticket from Self.open_stream and delivers the media socket's encoded frames and audio packets to the sinks as they arrive.
checkpointSaves this Space's state as checkpoint checkpoint (the sandbox API's Sandboxes.checkpoint): it keeps running, and Spaces.fork(checkpoint, name) (this machine) or Spaces.create with image checkpoint:<name> (any of your machines) starts new Spaces from it.
close_streamCloses a media session opened with Space.open_stream.
delete_serviceStops a service and forgets it (its logs go too).
displaysThe Space's displays, primary first, with their resolution in physical pixels.
forkStarts Space name, a fork of this one (with its memory when it is running), and returns it connected.
forwardForwards a free loopback port on this machine to guest port over this Space's own connection (cua-spacesd's tunnel): the same path its calls take, so a Space one of your machines provides on your LAN is reached directly, and never through a port opened on that machine's network.
join_presenceJoins presence.
join_presence_forJoins presence for the window being watched.
kept_servicesThis Space's services.
open_streamMints a media session (ticket + WebSocket URL) for another client to attach to.
put_serviceKeeps a command running in this Space (replacing a service of that name): restarted by its policy when it ends or fails its health check, started when the Space boots, its output kept in a log file.
restart_serviceRestarts a service.
routeWhich way this Space's calls go now (see super.spacesd.SpacesdClient.route): local …, direct …, relay …, mesh direct <ip:port> rtt <ms> ms, mesh relayed or cloud; empty when the Space runs no cua-spacesd.
service_logsThe end of a service's log (tail_bytes None: 64 KiB).
shareLets who (a verified email or an account id) watch (viewer, the default) or use (editor) this Space through the relay.
sharesWho this Space is shared with, and who of them is connected now.
spacesdThe cua-spacesd client over the connection this Space authenticated.
start_serviceStarts a stopped service.
stop_serviceStops a service and keeps it stopped (also across a reboot).
stream_sessionOpens a media session and delivers keyframe-gated encoded frames and audio to the sinks (one delivery thread; decoding stays with the caller).
teleportTeleports app's session into this Space.
teleport_manifestWhat teleporting app (full or tabs) would move from this host.
thumbnailThe Space's latest thumbnail (a small JPEG of its primary display) from the cache every client on this machine shares: returned at once when it is younger than max_age_ms (unset: any age), else captured fresh through cua-spacesd and kept for the next caller.
transportWhat carries this Space's calls, for a badge: mesh (end to end) or relay_https (the relay can read the session in transit; with fallback_reason when the mesh was wanted), or local, direct, cloud.
unshareStops sharing this Space with who at once, or with everyone when who is None.
usageProcessor, memory and storage use now (cheap: poll it at a low rate while a detail is visible).
websocket_headersHeaders a media WebSocket to this Space needs besides its ticket.
window_thumbnailA small JPEG preview of one of the Space's windows (window_id and epoch from windows), at most max_dimension px, reused for a few seconds (the SDK's preview cache); None when the guest captured nothing.
windowsStreamable windows, optionally of one app.
AccessorReturnsDescription
id()StringId.
info()SpaceInfoConnection-time snapshot; never refreshed. With spacesd, handshake os, os_name, os_pretty_name replace record values; missing/unknown families clear them. Other fields and non-spacesd services retain registry/discovery values. Spaces.list()/Spaces.resolve() remain record views.
services()Vec<String>The MCP services this Space exposes: driver when its spacesd has the tool registry, then every declared service (reached over generic MCP; no spacesd needed).

Space.bash#

Runs a shell command (/bin/sh -c, cmd /C on Windows).

async def bash(self, command: str, timeout_ms: Optional[int]) -> SpaceBashResult
ParameterTypeDefault
commandStringrequired
timeout_msOption<u64>required

Returns SpaceBashResult · Async · Raises CuaError

Space.call_tool#

Calls a tool of the Space's MCP service with JSON arguments.

async def call_tool(self, tool: str, arguments_json: Optional[str], service: Optional[str], timeout_ms: Optional[int]) -> SpaceToolResult
ParameterTypeDefault
toolStringrequired
arguments_jsonOption<String>required
serviceOption<String>required
timeout_msOption<u64>required

Returns SpaceToolResult · Async · Raises CuaError

Space.capabilities_json#

GetCapabilities of the spacesd, as proto3 JSON.

def capabilities_json(self) -> str

Returns String · Raises CuaError

Space.download#

Copies a guest file or folder into dest_dir on this host. Existing host files are never replaced: a name that is taken lands as name (1).ext, and the report's dest is the path used. Use download_file on the Space's environment to write one exact path.

async def download(self, remote_path: str, dest_dir: str) -> SpaceTransferReport
ParameterTypeDefault
remote_pathStringrequired
dest_dirStringrequired

Returns SpaceTransferReport · Async · Raises CuaError

Space.home#

The Space user's home directory.

async def home(self) -> str

Returns String · Async · Raises CuaError

Space.hotspot_status#

This Space's hotspot status.

async def hotspot_status(self) -> List[SpaceHotspotStatus]

Returns Vec<SpaceHotspotStatus> · Async · Raises CuaError

Space.list_tools#

Tools of the Space's MCP service (driver, the default).

async def list_tools(self, service: Optional[str]) -> List[SpaceToolInfo]
ParameterTypeDefault
serviceOption<String>required

Returns Vec<SpaceToolInfo> · Async · Raises CuaError

Space.request_site_login#

Signs in to a site in this Space's browser with a password the user saved in the Cua Keyvault. The first call files a request (status == "pending" with a request_id); the user approves it in Cua, then call again with that request_id and the Keyvault types the login through the Space's cua-driver (status == "filled"). A declined request is an error. The password never reaches the caller.

async def request_site_login(self, url: str, options: Optional[SiteLoginOptions]) -> SiteLoginReport
ParameterTypeDefault
urlStringrequired
optionsOption<SiteLoginOptions>required

Returns SiteLoginReport · Async · Raises CuaError

Space.screenshot#

Captures the Space's display: PNG at full size on the primary display unless options say otherwise (for a small preview, Space.thumbnail reads the shared cache instead). Fails with CapabilityMissing (spacesd) when the image runs no cua-spacesd.

async def screenshot(self, options: Optional[ScreenshotOptions]) -> Screenshot
ParameterTypeDefault
optionsOption<ScreenshotOptions>required

Returns Screenshot · Async · Raises CuaError (CapabilityMissing)

Space.send_file#

Drops a host file or folder into the Space's ~/Downloads[/subdir] (TeleportService.ReceiveFiles, per-file SHA-256).

async def send_file(self, local_path: str, options: SpaceSendFileOptions) -> SpaceSendFileReport
ParameterTypeDefault
local_pathStringrequired
optionsSpaceSendFileOptionsrequired

Returns SpaceSendFileReport · Async · Raises CuaError

Space.set_presence_settings#

Sets this Space's presence settings. cursor_probe: whether cua-spacesd may read the real cursor shape by briefly moving the idle guest pointer to a participant's position (on by default); None leaves it unchanged.

async def set_presence_settings(self, cursor_probe: Optional[bool] = None) -> None
ParameterTypeDefault
cursor_probeOption<bool>None

Async · Raises CuaError

Space.start_hotspot#

Starts the reverse-SOCKS hotspot: this host serves the Space's egress. set_system_proxy points the guest's proxy settings at it (default false here).

async def start_hotspot(self, set_system_proxy: Optional[bool], bypass: Optional[List[str]]) -> SpaceHotspotStatus
ParameterTypeDefault
set_system_proxyOption<bool>required
bypassOption<Vec<String>>required

Returns SpaceHotspotStatus · Async · Raises CuaError

Space.stop_hotspot#

Stops this Space's hotspot. Returns the stopped Space ids.

async def stop_hotspot(self) -> List[str]

Returns Vec<String> · Async · Raises CuaError

Space.supports#

Whether the spacesd supports feature.

def supports(self, feature: str) -> bool
ParameterTypeDefault
featureStringrequired

Returns bool

Space.upload#

Copies a host file or folder to dest in the Space (default: the home directory).

async def upload(self, local_path: str, dest: Optional[str]) -> SpaceTransferReport
ParameterTypeDefault
local_pathStringrequired
destOption<String>required

Returns SpaceTransferReport · Async · Raises CuaError

Space.write#

Writes bytes to a guest path (parents created, verified by SHA-256).

async def write(self, path: str, content: bytes) -> SpaceWriteReport
ParameterTypeDefault
pathStringrequired
contentVec<u8>required

Returns SpaceWriteReport · Async · Raises CuaError

SpaceBashResult record#

Output of Space.bash.

Returned by Space.bash.

FieldTypeDefaultDescription
stdoutStringStdout.
stderrStringStderr.
exit_code / exitCodeOption<i32>Exit code (absent when signalled or timed out).
signalOption<String>Signal name, when killed by one.
timed_out / timedOutboolHit the timeout.
errorOption<String>Launch error.
renderedStringThe space_bash tool text (stdout, [stderr], [exit N]).

SpaceWriteReport record#

Result of Space.write.

Returned by Space.write.

FieldTypeDefaultDescription
pathStringGuest path.
bytesu64Bytes.
sha256StringSHA-256 verified in the Space.

SpaceTransferReport record#

Result of Space.upload / Space.download.

Returned by Space.download, Space.upload.

FieldTypeDefaultDescription
sourceStringSource.
destStringDestination.
kindStringfile or folder.
filesu64Files written.
directoriesu64Directories created (uploads).
bytesu64Total bytes.
sha256Option<String>SHA-256 (single files).
verifiedboolEvery file verified by SHA-256.

SpaceSendFileOptions record#

Options for Space.send_file.

FieldTypeDefaultDescription
target_directory / targetDirectoryOption<String>NoneDownloads subdirectory (None = ~/Downloads), or a ~/Downloads/… path.
respect_ignore_files / respectIgnoreFilesbooltrueHonor ignore files when sending a folder.
conflictOption<String>NoneWhen a file of the same name is already there: rename (default, keeps both as name (1).ext), skip, or overwrite to replace it.

SpaceSendFileReport record#

Result of Space.send_file.

Returned by Space.send_file.

FieldTypeDefaultDescription
sourceStringHost source.
destinationStringTransfer root in the guest.
destStringWhere the file or folder landed.
kindStringfile or folder.
filesVec<SpaceSentFile>Files placed.
bytesu64Total bytes.
skipped_by_ignorefiles / skippedByIgnorefilesVec<String>Paths left out by ignore rules (first 200).
skipped_by_guest / skippedByGuestVec<String>Paths the guest skipped.
verifiedboolEvery hash matched.

SpaceSentFile record#

One file placed by Space.send_file.

FieldTypeDefaultDescription
pathStringGuest path.
sizeu64Bytes.
sha256StringSHA-256, verified on both ends.

SpaceWindow record#

A streamable window.

Returned by Space.windows.

FieldTypeDefaultDescription
window_id / windowIdStringWindow handle.
epochu64Generation.
titleStringTitle.
app_name / appNameStringApp name.
app_id / appIdStringApp id.
pidu32Pid.
boundsVec<f64>[x, y, width, height] in logical points.
on_screen / onScreenboolOn screen.
focusedboolFocused.
availableboolStreamable now.
limitationStringWhy not.
originOption<SpaceWindowOrigin>NoneWhere the picture comes from when another Space shows this window here (stream_space_window); None for the Space's own windows. Open it like any window: Space.open_stream with its window_id streams it straight from the origin when you may reach it.

SpaceToolInfo record#

A tool of a Space's MCP service.

Returned by Space.list_tools.

FieldTypeDefaultDescription
nameStringName.
descriptionStringDescription.
input_schema_json / inputSchemaJsonStringInput JSON Schema.
read_only / readOnlyboolRead-only.
destructiveboolDestructive.

SpaceToolResult record#

The result of a tool call (MCP content as JSON).

Returned by Space.call_tool, Spaces.call_tool_json.

FieldTypeDefaultDescription
content_json / contentJsonStringMCP content parts as a JSON array.
structured_json / structuredJsonOption<String>Structured content as JSON, when present.
is_error / isErrorboolThe tool failed.
textStringConcatenated text parts.
meta_json / metaJsonOption<String>The result's _meta as JSON, when present.

SpaceHotspotStatus record#

Hotspot state.

Returned by Space.hotspot_status, Space.start_hotspot.

FieldTypeDefaultDescription
spaceStringSpace.
stateStringstopped, waiting_for_peer or active.
hotspot_id / hotspotIdStringHotspot id.
socks_address / socksAddressStringGuest SOCKS address.
active_connections / activeConnectionsu32Open relayed connections.
bytes_out / bytesOutu64Bytes out of the guest.
bytes_in / bytesInu64Bytes into the guest.
served_here / servedHereboolServed by the process that owns the Spaces runtime.

NetworkEvent record#

One kind of connection a Space tried and its network refused (Spaces.network_log).

Returned by Spaces.network_log.

FieldTypeDefaultDescription
reasonStringWhy: platform:metadata, default:lan, default:host-loopback, user:deny, default:none, ...
dstStringWhere to (169.254.169.254:80, or the rule's network where only the host's firewall counted it).
protoOption<String>tcp or udp when known.
countu64How many times.
last_unix / lastUnixOption<u64>When the last one was refused (Unix seconds), when known.

SharedBase record#

A base image several Spaces share copy-on-write (a container image's layers, the image a VM disk was cloned from).

FieldTypeDefaultDescription
keyStringWhich base: Spaces with the same key share the same blocks.
imageStringThe image reference it came from (ghcr.io/trycua/linux:24.04).
bytesOption<u64>What it takes on this computer, once for all its Spaces; absent when the runtime cannot tell it apart from the Spaces' own data.
shared_with / sharedWithu32Local Spaces that use it, this one included.

SiteLoginOptions record#

Options for Space.request_site_login.

FieldTypeDefaultDescription
usernameOption<String>NoneWhich saved username, when the site has several.
agentOption<String>NoneThe persistent agent asking (shown to the user in the approval).
sessionOption<String>Nonecua-driver lifecycle session of the tab to sign in.
target_id / targetIdOption<String>Nonecua-driver browser target id (from get_browser_state).
tab_id / tabIdOption<String>Nonecua-driver tab id (from get_browser_state).
request_id / requestIdOption<String>NoneThe request id a previous call returned (the retry after approval).
wait_secs / waitSecsOption<u32>NoneSeconds to wait for the user's decision on a retry (default 20, at most 120).

SiteLoginReport record#

What Space.request_site_login did. Never the password.

Returned by Space.request_site_login.

FieldTypeDefaultDescription
statusStringpending (the user has not approved yet) or filled.
request_id / requestIdOption<String>The Keyvault request to retry with, while pending.
siteOption<String>Site of the saved login (github.com), once filled.
originOption<String>The origin signed in to, once filled.
username_hint / usernameHintOption<String>The username, masked (a***@example.test).
submittedboolThe form was submitted.
page_url / pageUrlOption<String>The tab's URL after the fill.
sessionOption<String>The tab it signed in (cua-driver ids), to keep using it.
target_id / targetIdOption<String>See session.
tab_id / tabIdOption<String>See session.

SpaceCreatingElsewhere record#

A Space another of your computers is creating (SpaceList.creating).

FieldTypeDefaultDescription
machine_id / machineIdStringThe computer's relay machine id.
machine_name / machineNameStringThe computer's name.
nameStringThe Space's name.
osStringmacos, linux, windows, or empty when unknown.
phaseStringThe create's phase (preparing, pulling, booting, ...).
percentu32How far along the whole create is, 0 to 100.
updated_at_ms / updatedAtMsu64When the computer published it, unix ms.

SpaceWindowOrigin record#

The Space a window row's picture comes from (SpaceWindow.origin).

FieldTypeDefaultDescription
space_id / spaceIdStringThe origin Space (canonical id).
nameStringIts name.
osStringIts OS (macos, linux, windows, or empty).
window_id / windowIdStringThe window's handle in the origin.

EgressEnforcement enum#

Where a Space's egress policy is enforced (SpaceInfo.egress_enforced).

EgressEnforcement.HOST
VariantDescription
HostBy the host the Space runs on, outside the guest: nothing in the guest, root included, can change it.

Windows, icons and displays#

app_icons answers a whole window list in one call: cached icons come from memory or $CUA_HOME/cache/icons, and every miss costs one guest round trip. thumbnail is the Space's latest small preview from the cache every client on the machine shares ($CUA_HOME/cache/thumbnails, kept fresh by the daemon while someone asks). window_thumbnail previews one window, reused for a few seconds. displays lists the displays with their resolution and usage the memory and storage use.

Methods of Space.

Space.app_icons#

Icons for many windows' apps at once, in request order (None: the Space has no icon for that app; show none). Answered by the SDK's one icon cache (memory, then $CUA_HOME/cache/icons, keyed by the app and the Space's image, never the pid); every miss costs one guest round trip for the whole batch. macOS renders the app bundle of the pid; Linux reads the .desktop entry's Icon= from the icon theme; Windows has none.

async def app_icons(self, requests: List[SpaceAppIconRequest]) -> List[Optional[SpaceAppIcon]]
ParameterTypeDefault
requestsVec<SpaceAppIconRequest>required

Returns Vec<Option<SpaceAppIcon>> · Async · Raises CuaError

Space.app_icon#

The icon the guest desktop shows for a window's app (pass the window's app_name, app_id and pid), or None when the Space has none: show no icon then, not a placeholder. A window list should ask Space.app_icons once for all its windows instead.

async def app_icon(self, app_name: str, app_id: str, pid: int) -> Optional[SpaceAppIcon]
ParameterTypeDefault
app_nameStringrequired
app_idStringrequired
pidu32required

Returns Option<SpaceAppIcon> · Async · Raises CuaError

Space.thumbnail#

The Space's latest thumbnail (a small JPEG of its primary display) from the cache every client on this machine shares: returned at once when it is younger than max_age_ms (unset: any age), else captured fresh through cua-spacesd and kept for the next caller. When that capture fails, the older one comes back (captured_at_ms says how old). Asking keeps the daemon refreshing running Spaces' thumbnails in the background for a while (about every 90 s).

async def thumbnail(self, max_age_ms: Optional[int]) -> SpaceThumbnail
ParameterTypeDefault
max_age_msOption<u64>required

Returns SpaceThumbnail · Async · Raises CuaError

Space.window_thumbnail#

A small JPEG preview of one of the Space's windows (window_id and epoch from windows), at most max_dimension px, reused for a few seconds (the SDK's preview cache); None when the guest captured nothing.

async def window_thumbnail(self, window_id: str, epoch: int, max_dimension: int) -> Optional[bytes]
ParameterTypeDefault
window_idStringrequired
epochu64required
max_dimensionu32required

Returns Option<Vec<u8>> · Async · Raises CuaError

Space.displays#

The Space's displays, primary first, with their resolution in physical pixels.

async def displays(self) -> List[SpaceDisplay]

Returns Vec<SpaceDisplay> · Async · Raises CuaError

Space.usage#

Processor, memory and storage use now (cheap: poll it at a low rate while a detail is visible).

async def usage(self) -> SpaceUsage

Returns SpaceUsage · Async · Raises CuaError

SpaceAppIcon record#

An app icon from Space.app_icons: the icon the guest desktop uses, normalized by the SDK's icon cache.

Returned by Space.app_icon, Space.app_icons.

FieldTypeDefaultDescription
bytesVec<u8>The 64 px PNG (2x), or an SVG the guest could not rasterize.
content_type / contentTypeStringimage/png or image/svg+xml.
bytes_1x / bytes1xVec<u8>The 32 px PNG (1x); empty for an SVG.

SpaceAppIconRequest record#

One window's app, for Space.app_icons.

FieldTypeDefaultDescription
app_name / appNameStringApp name, as the window list reports it.
app_id / appIdString""App id (bundle id, .desktop id).
pidu320A process of the app (0 when unknown).

SpaceDisplay record#

One of a Space's displays (Space.displays).

Returned by Space.displays.

FieldTypeDefaultDescription
idStringDisplay id.
nameStringName ("XVFB-0", "Built-in Retina Display").
primaryboolThe primary display.
width_px / widthPxu32Framebuffer width in physical pixels.
height_px / heightPxu32Framebuffer height in physical pixels.
scale_factor / scaleFactorf64Physical pixels per logical point.

SpaceThumbnail record#

A Space's latest thumbnail, from the cache every client on this machine shares (crate.native.spaces.Space.thumbnail).

Returned by Space.thumbnail.

FieldTypeDefaultDescription
imageVec<u8>Encoded image (a small JPEG of the primary display).
formatImageFormatEncoding.
widthu32Pixel width.
heightu32Pixel height.
captured_at_ms / capturedAtMsu64When it was captured, Unix milliseconds.

SpaceUsage record#

Processor, memory and storage use (Space.usage). A size is the guest's own limit only when its *_limited flag says so (a VM's memory or disk, a container's cgroup memory limit).

Returned by Space.usage.

FieldTypeDefaultDescription
cpu_count / cpuCountu320Cores the guest sees (0 from a guest that does not report it).
cpu_percent / cpuPercentf640.0Busy now, 0 to 100.
load_average_1m / loadAverage1mf640.01-minute load average.
memory_used / memoryUsedu64Memory in use, bytes.
memory_total / memoryTotalu64Memory size, bytes.
memory_limited / memoryLimitedboolmemory_total is the guest's limit.
disk_used / diskUsedu64Home filesystem bytes in use.
disk_total / diskTotalu64Home filesystem size, bytes.
disk_limited / diskLimitedbooldisk_total is the guest's own disk.

Teleport#

Teleport exports an app session from this machine and imports it on another. A consent callback sees the manifest first. Space.teleport and Space.teleport_manifest ask the Cua Spaces daemon, which runs teleport; an embedded runtime without Cua Spaces raises HostCapabilityMissing. To bring any app into a Space (install it, open files in it), see Teleport an app.

Teleport into a Space#

Methods of Space.

Space.teleport#

Teleports app's session into this Space. approver sees the manifest and returns the human's decision; None cancels (raises TeleportRefused). Sensitive items need an explicit acknowledgement.

Through a daemon, this may need two calls (see TeleportReceipt): the first returns status: "pending" with a request_id once the user's approval is filed with the Cua Keyvault; call again with that same request_id (approver is not consulted again -- the decision it already made was what the first call filed) until status: "moved". request_id is ignored for an embedded host, which always finishes in one call.

async def teleport(self, app: str, scope: Optional[str], approver: TeleportApprover, request_id: Optional[str] = None) -> TeleportReceipt
ParameterTypeDefault
appStringrequired
scopeOption<String>required
approverTeleportApproverrequired
request_idOption<String>None

Returns TeleportReceipt · Async · Raises CuaError (TeleportRefused)

Space.teleport_manifest#

What teleporting app (full or tabs) would move from this host.

async def teleport_manifest(self, app: str, scope: Optional[str]) -> TeleportManifest
ParameterTypeDefault
appStringrequired
scopeOption<String>required

Returns TeleportManifest · Async · Raises CuaError

TeleportApprover#

The consent gate of Space.teleport: shown the manifest, returns the human's decision, or None to cancel. Runs on a blocking worker thread; it may take as long as the human needs.

You implement TeleportApprover and pass it to the SDK (a callback interface): subclass it in Python, implement the interface in TypeScript, the TeleportApprover protocol in Swift, the interface in Kotlin and the trait in Rust.

MethodDescription
approveDecides.

TeleportApprover.approve#

Decides.

def approve(self, manifest: TeleportManifest) -> Optional[TeleportDecision]
ParameterTypeDefault
manifestTeleportManifestrequired

Returns Option<TeleportDecision>

TeleportDecision record#

A human's answer to a teleport manifest.

Returned by TeleportApprover.approve.

FieldTypeDefaultDescription
includeOption<Vec<String>>NoneItems to send (None = the provider's default-checked set, never everything). An empty list is refused as ambiguous.
acknowledge_sensitive / acknowledgeSensitiveboolfalseThe human acknowledged the sensitive items in the selection.

TeleportReceipt record#

What a teleport moved, or how to retry a pending Keyvault approval.

Through a daemon (Host::Daemon), the underlying teleport_app tool is consent-gated: a first call never delivers, it only files the request and returns status: "pending" with a request_id; show the user the Keyvault approval step, then call Space.teleport again with that same request_id (TeleportRetry::request_id). A second "pending" means the user has not decided yet -- call again the same way. Only status: "moved" means the session actually landed. An embedded host (no separate daemon) always returns "moved" in one call: there is nothing to retry.

Returned by Space.teleport.

FieldTypeDefaultDescription
statusStringmoved or pending.
request_id / requestIdOption<String>The Keyvault request to retry with, while pending.
appStringApp.
spaceStringSpace.
methodStringimport_session.
transferred_paths / transferredPathsVec<String>Paths sent.
bundle_bytes / bundleBytesu64Bundle bytes.
bundle_sha256 / bundleSha256StringBundle SHA-256, verified by the Space.
importedVec<String>Groups imported.
skippedVec<String>Items skipped, with reasons.
launchedboolThe app was launched.

TeleportItem record#

One item a teleport would move.

FieldTypeDefaultDescription
relative_path / relativePathStringBundle-relative path (what an approval names).
labelStringLabel.
estimated_bytes / estimatedBytesu64Estimated bytes.
is_sensitive / isSensitiveboolCredentials, cookies, tokens, transcripts.
is_checked_by_default / isCheckedByDefaultboolIn the default selection.
countOption<u64>Count of things it holds.
count_noun / countNounOption<String>Noun for count.

TeleportManifest record#

Exactly what would leave this machine.

Returned by Space.teleport_manifest.

FieldTypeDefaultDescription
appStringProvider id (firefox, chrome, claude-code, ...).
display_name / displayNameStringDisplay name.
scopeStringfull or tabs.
itemsVec<TeleportItem>Items.
total_estimated_bytes / totalEstimatedBytesu64Provider total.
notesVec<String>Provider caveats.