Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
feat(spaces): Stop frees a local VM's memory; cua spaces suspend and resize (#5912)
ddupontff40ec3e2c8a
diff --git a/apps/cua-spaces-desktop/src/native/generated/cua_sdk-ffi.ts b/apps/cua-spaces-desktop/src/native/generated/cua_sdk-ffi.tsindex d5863981af..f5b8fb96aa 100644--- a/apps/cua-spaces-desktop/src/native/generated/cua_sdk-ffi.ts+++ b/apps/cua-spaces-desktop/src/native/generated/cua_sdk-ffi.ts@@ -2564,6 +2564,11 @@ const DEFINITIONS = {ret: FfiType.Handle,hasRustCallStatus: false,},+ "uniffi_cua_sdk_fn_method_spaces_resize": {+ args: [FfiType.Handle, FfiType.RustBuffer, FfiType.RustBuffer, FfiType.RustBuffer, FfiType.RustBuffer],+ ret: FfiType.Handle,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_fn_method_spaces_resolve": {args: [FfiType.Handle, FfiType.RustBuffer],ret: FfiType.Handle,@@ -2619,6 +2624,11 @@ const DEFINITIONS = {ret: FfiType.Handle,hasRustCallStatus: false,},+ "uniffi_cua_sdk_fn_method_spaces_suspend": {+ args: [FfiType.Handle, FfiType.RustBuffer],+ ret: FfiType.Handle,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_fn_method_spaces_volume_approve": {args: [FfiType.Handle, FfiType.RustBuffer, FfiType.RustBuffer],ret: FfiType.Handle,@@ -4979,6 +4989,11 @@ const DEFINITIONS = {ret: FfiType.UInt16,hasRustCallStatus: false,},+ "uniffi_cua_sdk_checksum_method_spaces_resize": {+ args: [],+ ret: FfiType.UInt16,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_checksum_method_spaces_resolve": {args: [],ret: FfiType.UInt16,@@ -5034,6 +5049,11 @@ const DEFINITIONS = {ret: FfiType.UInt16,hasRustCallStatus: false,},+ "uniffi_cua_sdk_checksum_method_spaces_suspend": {+ args: [],+ ret: FfiType.UInt16,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_checksum_method_spaces_volume_approve": {args: [],ret: FfiType.UInt16,@@ -6182,6 +6202,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_fn_method_spaces_relay_unregister(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_remove(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_remove_prewarm(uniffiSelf: bigint, id: Uint8Array): bigint;+ uniffi_cua_sdk_fn_method_spaces_resize(uniffiSelf: bigint, space: Uint8Array, cpus: Uint8Array, memoryMb: Uint8Array, diskGb: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_resolve(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_resources(uniffiSelf: bigint, visible: number): bigint;uniffi_cua_sdk_fn_method_spaces_routine_add(uniffiSelf: bigint, agent: Uint8Array, title: Uint8Array, prompt: Uint8Array, everyMinutes: Uint8Array, dailyAt: Uint8Array, weeklyOn: Uint8Array): bigint;@@ -6193,6 +6214,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_fn_method_spaces_space(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_start(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_stop(uniffiSelf: bigint, space: Uint8Array): bigint;+ uniffi_cua_sdk_fn_method_spaces_suspend(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_volume_approve(uniffiSelf: bigint, requestId: Uint8Array, expiresInSecs: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_volume_audit(uniffiSelf: bigint, limit: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_volume_cache_clear(uniffiSelf: bigint): bigint;@@ -6665,6 +6687,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_checksum_method_spaces_relay_unregister(): number;uniffi_cua_sdk_checksum_method_spaces_remove(): number;uniffi_cua_sdk_checksum_method_spaces_remove_prewarm(): number;+ uniffi_cua_sdk_checksum_method_spaces_resize(): number;uniffi_cua_sdk_checksum_method_spaces_resolve(): number;uniffi_cua_sdk_checksum_method_spaces_resources(): number;uniffi_cua_sdk_checksum_method_spaces_routine_add(): number;@@ -6676,6 +6699,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_checksum_method_spaces_space(): number;uniffi_cua_sdk_checksum_method_spaces_start(): number;uniffi_cua_sdk_checksum_method_spaces_stop(): number;+ uniffi_cua_sdk_checksum_method_spaces_suspend(): number;uniffi_cua_sdk_checksum_method_spaces_volume_approve(): number;uniffi_cua_sdk_checksum_method_spaces_volume_audit(): number;uniffi_cua_sdk_checksum_method_spaces_volume_cache_clear(): number;diff --git a/apps/cua-spaces-desktop/src/native/generated/cua_sdk.ts b/apps/cua-spaces-desktop/src/native/generated/cua_sdk.tsindex 164600277a..018664d3ac 100644--- a/apps/cua-spaces-desktop/src/native/generated/cua_sdk.ts+++ b/apps/cua-spaces-desktop/src/native/generated/cua_sdk.ts@@ -18954,8 +18954,8 @@ export type SpacePowerReport = {*/state: string,/**- * How it turns off: `suspend` (its memory is kept) or `stop` (its- * disk is kept).+ * How it was turned off: `suspend` (its memory is kept, and still in+ * use) or `stop` (its disk is kept; its memory is freed).*/power: string,/**@@ -19081,6 +19081,79 @@ const FfiConverterTypeSpaceRelayRegistration = (() => {return new FFIConverter();})();+/**+ * What [`Spaces::resize`] did: the shape the Space has now.+ */+export type SpaceResizeReport = {+ /**+ * The Space.+ */+ space: string,+ /**+ * vCPUs (when changed).+ */+ cpus?: number,+ /**+ * Memory in MiB (when changed).+ */+ memoryMb?: bigint,+ /**+ * Disk in GiB (when grown).+ */+ diskGb?: number,+ /**+ * What happened, for people.+ */+ message: string+}++/**+ * Generated factory for {@link SpaceResizeReport} record objects.+ */+export const SpaceResizeReport = (() => {+ const defaults = () => ({+ });+ const create = (() => {+ return uniffiCreateRecord<SpaceResizeReport, ReturnType<typeof defaults>>(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<SpaceResizeReport>,+ });+})();++const FfiConverterTypeSpaceResizeReport = (() => {+ type TypeName = SpaceResizeReport;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ space: FfiConverterString.read(from),+ cpus: FfiConverterOptionalUInt32.read(from),+ memoryMb: FfiConverterOptionalUInt64.read(from),+ diskGb: FfiConverterOptionalUInt32.read(from),+ message: FfiConverterString.read(from)+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.space, into);+ FfiConverterOptionalUInt32.write(value.cpus, into);+ FfiConverterOptionalUInt64.write(value.memoryMb, into);+ FfiConverterOptionalUInt32.write(value.diskGb, into);+ FfiConverterString.write(value.message, into);+ }+ allocationSize(value: TypeName): number {+ return FfiConverterString.allocationSize(value.space) ++ FfiConverterOptionalUInt32.allocationSize(value.cpus) ++ FfiConverterOptionalUInt64.allocationSize(value.memoryMb) ++ FfiConverterOptionalUInt32.allocationSize(value.diskGb) ++ FfiConverterString.allocationSize(value.message);++ }+ };+ return new FFIConverter();+})();+/*** Options for [`Space::send_file`].*/@@ -38915,6 +38988,14 @@ export interface SpacesLike {* Ends prewarm `id` (its ready Spaces go). `false`: no such prewarm.*/removePrewarm(id: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<boolean>;+/**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+ resize(space: string, cpus: number | undefined, memoryMb: bigint | undefined, diskGb: number | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpaceResizeReport>;/*** Resolves an id, legacy id, URL or display name.*/@@ -38972,12 +39053,20 @@ export interface SpacesLike {start(space: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpacePowerReport>;/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/stop(space: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpacePowerReport>;+/**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+ suspend(space: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpacePowerReport>;/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -41036,6 +41125,45 @@ private constructor(pointer: UniffiHandle) {}}+/**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+ async resize(space: string, cpus: number | undefined, memoryMb: bigint | undefined, diskGb: number | undefined, asyncOpts_?: { signal: AbortSignal }): Promise<SpaceResizeReport> /*throws*/ {+ const __stack = uniffiIsDebug ? new Error().stack : undefined;+ try {+ return await uniffiRustCallAsync(+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().uniffi_cua_sdk_fn_method_spaces_resize(+ uniffiTypeSpacesObjectFactory.clonePointer(this),FfiConverterString.lower(space, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt32.lower(cpus, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(memoryMb, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt32.lower(diskGb, nativeModule().rustbuffer_alloc)+ );+ },+ /*pollFunc:*/ nativeModule().ffi_cua_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule().ffi_cua_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeSpaceResizeReport.lift.bind(FfiConverterTypeSpaceResizeReport),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeCuaError.lift.bind(FfiConverterTypeCuaError)+ );+ } catch (__error: any) {+ if (uniffiIsDebug && __error instanceof Error) {+ __error.stack = __stack;+ }+ throw __error;+ }+ }+/*** Resolves an id, legacy id, URL or display name.*/@@ -41393,10 +41521,12 @@ private constructor(pointer: UniffiHandle) {/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/async stop(space: string, asyncOpts_?: { signal: AbortSignal }): Promise<SpacePowerReport> /*throws*/ {const __stack = uniffiIsDebug ? new Error().stack : undefined;@@ -41430,6 +41560,43 @@ private constructor(pointer: UniffiHandle) {}}+/**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+ async suspend(space: string, asyncOpts_?: { signal: AbortSignal }): Promise<SpacePowerReport> /*throws*/ {+ const __stack = uniffiIsDebug ? new Error().stack : undefined;+ try {+ return await uniffiRustCallAsync(+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().uniffi_cua_sdk_fn_method_spaces_suspend(+ uniffiTypeSpacesObjectFactory.clonePointer(this),FfiConverterString.lower(space, nativeModule().rustbuffer_alloc)+ );+ },+ /*pollFunc:*/ nativeModule().ffi_cua_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule().ffi_cua_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeSpacePowerReport.lift.bind(FfiConverterTypeSpacePowerReport),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeCuaError.lift.bind(FfiConverterTypeCuaError)+ );+ } catch (__error: any) {+ if (uniffiIsDebug && __error instanceof Error) {+ __error.stack = __stack;+ }+ throw __error;+ }+ }+/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -45529,6 +45696,9 @@ function uniffiEnsureInitialized() {if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_remove_prewarm() !== 56425) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_remove_prewarm");}+ if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_resize() !== 2886) {+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_resize");+ }if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_resolve() !== 9986) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_resolve");}@@ -45559,9 +45729,12 @@ function uniffiEnsureInitialized() {if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_start() !== 32898) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_start");}- if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_stop() !== 64586) {+ if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_stop() !== 59057) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_stop");}+ if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_suspend() !== 23817) {+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_suspend");+ }if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_volume_approve() !== 8640) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_volume_approve");}@@ -46090,6 +46263,7 @@ export default Object.freeze({FfiConverterTypeSpacePowerReport,FfiConverterTypeSpacePresence,FfiConverterTypeSpaceRelayRegistration,+ FfiConverterTypeSpaceResizeReport,FfiConverterTypeSpaceResources,FfiConverterTypeSpaceSendFileOptions,FfiConverterTypeSpaceSendFileReport,diff --git a/docs/content/docs/cua-cli/reference/cli/index.mdx b/docs/content/docs/cua-cli/reference/cli/index.mdxindex 9c08e5e4e3..09624eecee 100644--- a/docs/content/docs/cua-cli/reference/cli/index.mdx+++ b/docs/content/docs/cua-cli/reference/cli/index.mdx@@ -24,7 +24,7 @@ Your Spaces and machines, unattended access on this machine, devices, teams, you| Command | Description | Subcommands || --- | --- | --- |-| <span id="cua-spaces"></span><span id="cua-spaces-ls"></span><span id="cua-spaces-add"></span><span id="cua-spaces-create"></span><span id="cua-spaces-prewarm"></span><span id="cua-spaces-egress"></span><span id="cua-spaces-cancel"></span><span id="cua-spaces-gpus"></span><span id="cua-spaces-delete"></span><span id="cua-spaces-stop"></span><span id="cua-spaces-start"></span><span id="cua-spaces-rm"></span><span id="cua-spaces-share"></span><span id="cua-spaces-unshare"></span><span id="cua-spaces-shares"></span><span id="cua-spaces-relay-register"></span><span id="cua-spaces-relay-unregister"></span>[`cua spaces`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces) | Spaces: registered ones and your computers on the relay. | [`ls`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-ls), [`add`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-add), [`create`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-create), [`prewarm`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-prewarm), [`egress`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-egress), [`cancel`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-cancel), [`gpus`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-gpus), [`delete`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-delete), [`stop`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-stop), [`start`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-start), [`rm`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-rm), [`share`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-share), [`unshare`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-unshare), [`shares`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-shares), [`relay-register`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-relay-register), [`relay-unregister`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-relay-unregister) |+| <span id="cua-spaces"></span><span id="cua-spaces-ls"></span><span id="cua-spaces-add"></span><span id="cua-spaces-create"></span><span id="cua-spaces-prewarm"></span><span id="cua-spaces-egress"></span><span id="cua-spaces-cancel"></span><span id="cua-spaces-gpus"></span><span id="cua-spaces-delete"></span><span id="cua-spaces-stop"></span><span id="cua-spaces-suspend"></span><span id="cua-spaces-resize"></span><span id="cua-spaces-start"></span><span id="cua-spaces-rm"></span><span id="cua-spaces-share"></span><span id="cua-spaces-unshare"></span><span id="cua-spaces-shares"></span><span id="cua-spaces-relay-register"></span><span id="cua-spaces-relay-unregister"></span>[`cua spaces`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces) | Spaces: registered ones and your computers on the relay. | [`ls`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-ls), [`add`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-add), [`create`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-create), [`prewarm`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-prewarm), [`egress`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-egress), [`cancel`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-cancel), [`gpus`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-gpus), [`delete`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-delete), [`stop`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-stop), [`suspend`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-suspend), [`resize`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-resize), [`start`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-start), [`rm`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-rm), [`share`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-share), [`unshare`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-unshare), [`shares`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-shares), [`relay-register`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-relay-register), [`relay-unregister`](/cua-cli/reference/cli/spaces-and-computers#cua-spaces-relay-unregister) || <span id="cua-host"></span><span id="cua-host-setup"></span><span id="cua-host-pair"></span><span id="cua-host-config"></span><span id="cua-host-status"></span><span id="cua-host-stop"></span><span id="cua-host-start"></span><span id="cua-host-share"></span><span id="cua-host-unshare"></span><span id="cua-host-migrate"></span><span id="cua-host-remove"></span>[`cua host`](/cua-cli/reference/cli/spaces-and-computers#cua-host) | Unattended access to this computer (setup, status, stop, start, remove). | [`setup`](/cua-cli/reference/cli/spaces-and-computers#cua-host-setup), [`pair`](/cua-cli/reference/cli/spaces-and-computers#cua-host-pair), [`config`](/cua-cli/reference/cli/spaces-and-computers#cua-host-config), [`status`](/cua-cli/reference/cli/spaces-and-computers#cua-host-status), [`stop`](/cua-cli/reference/cli/spaces-and-computers#cua-host-stop), [`start`](/cua-cli/reference/cli/spaces-and-computers#cua-host-start), [`share`](/cua-cli/reference/cli/spaces-and-computers#cua-host-share), [`unshare`](/cua-cli/reference/cli/spaces-and-computers#cua-host-unshare), [`migrate`](/cua-cli/reference/cli/spaces-and-computers#cua-host-migrate), [`remove`](/cua-cli/reference/cli/spaces-and-computers#cua-host-remove) || <span id="cua-devices"></span><span id="cua-devices-status"></span><span id="cua-devices-enroll"></span><span id="cua-devices-approve"></span><span id="cua-devices-ls"></span><span id="cua-devices-rename"></span><span id="cua-devices-revoke"></span><span id="cua-devices-audit"></span>[`cua devices`](/cua-cli/reference/cli/spaces-and-computers#cua-devices) | This device as a client of your cua.ai account on the relay: enroll (second factor), approve other devices, list, rename, revoke, and the audit log of who accessed what. | [`status`](/cua-cli/reference/cli/spaces-and-computers#cua-devices-status), [`enroll`](/cua-cli/reference/cli/spaces-and-computers#cua-devices-enroll), [`approve`](/cua-cli/reference/cli/spaces-and-computers#cua-devices-approve), [`ls`](/cua-cli/reference/cli/spaces-and-computers#cua-devices-ls), [`rename`](/cua-cli/reference/cli/spaces-and-computers#cua-devices-rename), [`revoke`](/cua-cli/reference/cli/spaces-and-computers#cua-devices-revoke), [`audit`](/cua-cli/reference/cli/spaces-and-computers#cua-devices-audit) || <span id="cua-team"></span><span id="cua-team-create"></span><span id="cua-team-ls"></span><span id="cua-team-show"></span><span id="cua-team-invite"></span><span id="cua-team-join"></span><span id="cua-team-leave"></span><span id="cua-team-remove-member"></span><span id="cua-team-set-role"></span><span id="cua-team-devices"></span><span id="cua-team-approve"></span><span id="cua-team-deny"></span><span id="cua-team-request"></span><span id="cua-team-add-machine"></span><span id="cua-team-remove-machine"></span><span id="cua-team-audit"></span><span id="cua-team-delete"></span>[`cua team`](/cua-cli/reference/cli/spaces-and-computers#cua-team) | Teams (organizations of your cua.ai account) share computers with every member and their agents. | [`create`](/cua-cli/reference/cli/spaces-and-computers#cua-team-create), [`ls`](/cua-cli/reference/cli/spaces-and-computers#cua-team-ls), [`show`](/cua-cli/reference/cli/spaces-and-computers#cua-team-show), [`invite`](/cua-cli/reference/cli/spaces-and-computers#cua-team-invite), [`join`](/cua-cli/reference/cli/spaces-and-computers#cua-team-join), [`leave`](/cua-cli/reference/cli/spaces-and-computers#cua-team-leave), [`remove-member`](/cua-cli/reference/cli/spaces-and-computers#cua-team-remove-member), [`set-role`](/cua-cli/reference/cli/spaces-and-computers#cua-team-set-role), [`devices`](/cua-cli/reference/cli/spaces-and-computers#cua-team-devices), [`approve`](/cua-cli/reference/cli/spaces-and-computers#cua-team-approve), [`deny`](/cua-cli/reference/cli/spaces-and-computers#cua-team-deny), [`request`](/cua-cli/reference/cli/spaces-and-computers#cua-team-request), [`add-machine`](/cua-cli/reference/cli/spaces-and-computers#cua-team-add-machine), [`remove-machine`](/cua-cli/reference/cli/spaces-and-computers#cua-team-remove-machine), [`audit`](/cua-cli/reference/cli/spaces-and-computers#cua-team-audit), [`delete`](/cua-cli/reference/cli/spaces-and-computers#cua-team-delete) |diff --git a/docs/content/docs/cua-cli/reference/cli/spaces-and-computers.mdx b/docs/content/docs/cua-cli/reference/cli/spaces-and-computers.mdxindex 689b27e9d7..fe2ad809c3 100644--- a/docs/content/docs/cua-cli/reference/cli/spaces-and-computers.mdx+++ b/docs/content/docs/cua-cli/reference/cli/spaces-and-computers.mdx@@ -21,7 +21,9 @@ description: "Your Spaces and machines, unattended access on this machine, devic| [`cua spaces cancel`](#cua-spaces-cancel) | Cancel a create that is still running (here, in the daemon, or in another terminal): it stops and what it made is removed. || [`cua spaces gpus`](#cua-spaces-gpus) | The GPU options each runtime offers on this computer (or in your own cloud account). || [`cua spaces delete`](#cua-spaces-delete) | Delete a Space's sandbox (on this computer, on the computer that provides it, or in your own cloud account) and forget it (asks first). |-| [`cua spaces stop`](#cua-spaces-stop) | Turn a Space off: a local container or QEMU VM is suspended (its memory is kept), a Lume VM or a Space one of your computers provides is stopped (its disk is kept), and so is a Space in your own cloud (`--on aws`, `gcp`: compute billing stops; `hetzner`: still billed). |+| [`cua spaces stop`](#cua-spaces-stop) | Turn a Space off: a local VM (QEMU or Lume) or a Space one of your computers provides is stopped, keeping its disk and freeing its memory, and so is a Space in your own cloud (`--on aws`, `gcp`: compute billing stops; `hetzner`: still billed). |+| [`cua spaces suspend`](#cua-spaces-suspend) | Suspend a local Space (a container or QEMU VM): its memory is kept, and stays in use, so it resumes where it was with `cua spaces start`. |+| [`cua spaces resize`](#cua-spaces-resize) | Give a local VM Space more or fewer vCPUs, more or less memory, or a bigger disk. || [`cua spaces start`](#cua-spaces-start) | Turn a Space back on: resume a suspended one or boot a stopped one. || [`cua spaces rm`](#cua-spaces-rm) | Forget a registered Space and its stored token. || [`cua spaces share`](#cua-spaces-share) | Let someone in your team watch (viewer) or use (editor) a Space, through the relay. |@@ -334,7 +336,7 @@ cua spaces delete local:studio --force### `cua spaces stop`-Turn a Space off: a local container or QEMU VM is suspended (its memory is kept), a Lume VM or a Space one of your computers provides is stopped (its disk is kept), and so is a Space in your own cloud (`--on aws`, `gcp`: compute billing stops; `hetzner`: still billed). Modal sandboxes and Spaces added by address cannot be turned off.+Turn a Space off: a local VM (QEMU or Lume) or a Space one of your computers provides is stopped, keeping its disk and freeing its memory, and so is a Space in your own cloud (`--on aws`, `gcp`: compute billing stops; `hetzner`: still billed). A local container is stopped or suspended as its runtime can. `cua spaces suspend` keeps a local Space's memory instead. Modal sandboxes and Spaces added by address cannot be turned off.```text outputcua spaces stop [OPTIONS] <SPACE>@@ -351,6 +353,49 @@ cua spaces stop local:studiocua spaces stop relay:space-0123456789abcdef --json```+### `cua spaces suspend`++Suspend a local Space (a container or QEMU VM): its memory is kept, and stays in use, so it resumes where it was with `cua spaces start`. `cua spaces stop` frees the memory instead.++```text output+cua spaces suspend [OPTIONS] <SPACE>+```++| Argument | Type | Default | Description |+| --- | --- | --- | --- |+| `<SPACE>` | string | required | Space id or name. |++**Examples**++```bash test="cli-shape" id="ref-cua-spaces-suspend"+cua spaces suspend local:studio+```++### `cua spaces resize`++Give a local VM Space more or fewer vCPUs, more or less memory, or a bigger disk. It shuts down and boots again from its own disk (a stopped one boots): its files stay, its running processes do not. A disk never shrinks.++```text output+cua spaces resize [OPTIONS] <SPACE>+```++| Argument | Type | Default | Description |+| --- | --- | --- | --- |+| `<SPACE>` | string | required | Space id or name. |++| Flag | Type | Default | Description |+| --- | --- | --- | --- |+| <span id="cua-spaces-resize--cpus"></span>`--cpus` | integer | | vCPUs. |+| <span id="cua-spaces-resize--memory-mb"></span>`--memory-mb` | integer | | Memory in MiB. |+| <span id="cua-spaces-resize--disk-gb"></span>`--disk-gb` | integer | | Grow the disk to this many GiB. |++**Examples**++```bash test="cli-shape" id="ref-cua-spaces-resize"+cua spaces resize local:builder --memory-mb 24576+cua spaces resize builder --cpus 8 --disk-gb 200 --json+```+### `cua spaces start`Turn a Space back on: resume a suspended one or boot a stopped one.diff --git a/docs/content/docs/cua-cli/reference/mcp-tools.mdx b/docs/content/docs/cua-cli/reference/mcp-tools.mdxindex 0cf10836cc..2f93cbee08 100644--- a/docs/content/docs/cua-cli/reference/mcp-tools.mdx+++ b/docs/content/docs/cua-cli/reference/mcp-tools.mdx@@ -31,7 +31,8 @@ Full entries: [Space lifecycle](/spaces/reference/spaces#space-lifecycle).| <span id="list_spaces"></span>[`list_spaces`](/spaces/reference/spaces#list_spaces) | List the Spaces this connection can see. || <span id="create_space"></span>[`create_space`](/spaces/reference/spaces#create_space) | Create a Space: a new sandbox on this computer, on one of your computers, or in the cloud. || <span id="delete_space"></span>[`delete_space`](/spaces/reference/spaces#delete_space) | Delete a Space's sandbox and forget it. |-| <span id="stop_space"></span>[`stop_space`](/spaces/reference/spaces#stop_space) | Turn a Space off: suspend it (memory kept) or stop it (disk kept). |+| <span id="stop_space"></span>[`stop_space`](/spaces/reference/spaces#stop_space) | Turn a Space off: stop it (disk kept, memory freed) or, with suspend, suspend it (memory kept). |+| <span id="resize_space"></span>[`resize_space`](/spaces/reference/spaces#resize_space) | Change a Space's vCPUs, memory or disk size. || <span id="start_space"></span>[`start_space`](/spaces/reference/spaces#start_space) | Turn a Space back on: resume or boot it. |### Commands and files@@ -1181,5 +1182,5 @@ Tools are gated by `--permissions` (or `CUA_MCP_PERMISSIONS`), a comma-separated| `sandbox:all` | 11 permissions | `sandbox:list`, `sandbox:get` || `share:all` | `share:create`, `share:read`, `share:stop` | `share:read` || `skills:all` | `skills:list`, `skills:read`, `skills:record`, `skills:delete` | `skills:list`, `skills:read` |-| `spaces:all` | 96 permissions | 31 permissions |+| `spaces:all` | 97 permissions | 31 permissions || `teleport:all` | `teleport:browser` | none |diff --git a/docs/content/docs/cua-sdk/reference/index.mdx b/docs/content/docs/cua-sdk/reference/index.mdxindex 1f3eba47cc..c8e675e681 100644--- a/docs/content/docs/cua-sdk/reference/index.mdx+++ b/docs/content/docs/cua-sdk/reference/index.mdx@@ -54,6 +54,7 @@ The Cua SDK in Python, TypeScript, Swift, Kotlin and Rust, all generated from th| Page | Covers || --- | --- || [Spaces](/cua-sdk/reference/spaces) | The Spaces registry: create, add, resolve, delete and remove Spaces, their create options, and agent runs in a Space. |+| [Resize a Space](/cua-sdk/reference/spaces/resize) | Change a local VM's CPU, memory or disk while keeping its files. || [Lifetime and egress](/cua-sdk/reference/spaces/lifetime) | How long a Space lives and which destinations it may reach, set after it exists. || [Space](/cua-sdk/reference/spaces/space) | A connected Space: shell, files, tools, windows, icons, displays, the hotspot and teleport. || [Elastic pool and prewarm](/cua-sdk/reference/spaces/elastic) | Plan where Spaces go and what it costs, add and remove cloud hosts, set the budget, and keep Spaces ready. |@@ -94,4 +95,4 @@ The Cua SDK in Python, TypeScript, Swift, Kotlin and Rust, all generated from th| --- | --- || [Protocol](/cua-sdk/reference/protocol) | The gRPC contracts of cua-spacesd (`cua.env.v1`) and the cua daemon (`cua.daemon.v1`). |-338 items, 422 methods. The [Types](/cua-sdk/reference/types) page lists them.+339 items, 424 methods. The [Types](/cua-sdk/reference/types) page lists them.diff --git a/docs/content/docs/cua-sdk/reference/rust/cua-sdk.mdx b/docs/content/docs/cua-sdk/reference/rust/cua-sdk.mdxindex 022dbcec8a..ecc3407eed 100644--- a/docs/content/docs/cua-sdk/reference/rust/cua-sdk.mdx+++ b/docs/content/docs/cua-sdk/reference/rust/cua-sdk.mdx@@ -18,7 +18,7 @@ The cua SDK: the only `#[uniffi::export]` crate of `libs/cua`.These are the objects, records, enums and functions the language bindings export, documented once in the [Cua SDK reference](/cua-sdk/reference), whose Rust tabs show each signature. Objects are `Arc<T>` handles whose methods are `async fn` returning `Result<_, CuaError>`, records are structs with public fields, and names are snake_case.-[`agent_event_category`](/cua-sdk/reference/agents#agent_event_category), [`agent_harnesses`](/cua-sdk/reference/agents#agent_harnesses), [`AgentActionReport`](/cua-sdk/reference/spaces/agents#agentactionreport-record), [`AgentArtifact`](/cua-sdk/reference/agents#agentartifact-record), [`AgentDelivery`](/cua-sdk/reference/spaces/persistent-agents#agentdelivery-record), [`AgentEvent`](/cua-sdk/reference/agents#agentevent-record), [`AgentEventPage`](/cua-sdk/reference/agents#agenteventpage-record), [`AgentFile`](/cua-sdk/reference/agents#agentfile-record), [`AgentInfo`](/cua-sdk/reference/agent-setup#agentinfo-record), [`AgentMcpServer`](/cua-sdk/reference/agent-setup#agentmcpserver-record), [`AgentPauseReport`](/cua-sdk/reference/spaces/persistent-agents#agentpausereport-record), [`AgentResumeReport`](/cua-sdk/reference/spaces/persistent-agents#agentresumereport-record), [`AgentRun`](/cua-sdk/reference/agents#agentrun), [`AgentRunInfo`](/cua-sdk/reference/agents#agentruninfo-record), [`AgentRunMcpServer`](/cua-sdk/reference/agents#agentrunmcpserver-record), [`AgentRunOptions`](/cua-sdk/reference/agents#agentrunoptions-record), [`AgentRunResult`](/cua-sdk/reference/agents#agentrunresult-record), [`AgentRunStatus`](/cua-sdk/reference/spaces/agents#agentrunstatus-record), [`Agents`](/cua-sdk/reference/agents#agents), [`AgentSetup`](/cua-sdk/reference/agent-setup#agentsetup), [`AgentSetupChange`](/cua-sdk/reference/agent-setup#agentsetupchange-enum), [`AgentSetupOutcome`](/cua-sdk/reference/agent-setup#agentsetupoutcome-record), [`AgentSetupTarget`](/cua-sdk/reference/agent-setup#agentsetuptarget-enum), [`AgentStartReport`](/cua-sdk/reference/spaces/agents#agentstartreport-record), [`AgentTranscript`](/cua-sdk/reference/agents#agenttranscript), [`AgentTranscriptItem`](/cua-sdk/reference/agents#agenttranscriptitem-record), [`ambiguous_sandbox_candidates`](/cua-sdk/reference/sandbox/lifecycle#ambiguous_sandbox_candidates), [`AudioPacket`](/cua-sdk/reference/spacesd/computer#audiopacket-record), [`AudioSink`](/cua-sdk/reference/spacesd/computer#audiosink), [`Auth`](/cua-sdk/reference/auth#auth), [`AuthIdentity`](/cua-sdk/reference/auth#authidentity-record), [`AuthStatus`](/cua-sdk/reference/auth#authstatus-record), [`BakeForkCheck`](/cua-sdk/reference/sandbox/bake#bakeforkcheck-record), [`BakeOptions`](/cua-sdk/reference/sandbox/bake#bakeoptions-record), [`BakeSummary`](/cua-sdk/reference/sandbox/bake#bakesummary-record), [`BuildFile`](/cua-sdk/reference/image#buildfile-record), [`BuildImageConfig`](/cua-sdk/reference/spaces/build#buildimageconfig-record), [`BuildInfo`](/cua-sdk/reference/spaces/build#buildinfo-record), [`BuildListener`](/cua-sdk/reference/spaces/build#buildlistener), [`BuildOptions`](/cua-sdk/reference/spaces/build#buildoptions-record), [`BuildProgress`](/cua-sdk/reference/spaces/build#buildprogress-record), [`BuildResult`](/cua-sdk/reference/spaces/build#buildresult-record), [`BuildStep`](/cua-sdk/reference/spaces/build#buildstep-enum), [`BuildStepResult`](/cua-sdk/reference/spaces/build#buildstepresult-record), [`BundledSkill`](/cua-sdk/reference/agent-setup#bundledskill-record), [`canonical_image`](/cua-sdk/reference/image#canonical_image), [`canonical_image_tier`](/cua-sdk/reference/image#canonical_image_tier), [`check_placement`](/cua-sdk/reference/cua#check_placement), [`CheckpointSummary`](/cua-sdk/reference/sandbox/checkpoints#checkpointsummary-record), [`CloudAuditEntry`](/cua-sdk/reference/spaces/persistent-agents#cloudauditentry-record), [`CloudCheck`](/cua-sdk/reference/spaces/persistent-agents#cloudcheck-record), [`CloudConnected`](/cua-sdk/reference/spaces/persistent-agents#cloudconnected-record), [`CloudCredentials`](/cua-sdk/reference/spaces/persistent-agents#cloudcredentials-record), [`CloudDisconnected`](/cua-sdk/reference/spaces/persistent-agents#clouddisconnected-record), [`CloudKind`](/cua-sdk/reference/spaces/persistent-agents#cloudkind-record), [`CloudProvider`](/cua-sdk/reference/spaces/persistent-agents#cloudprovider-record), [`CloudResource`](/cua-sdk/reference/spaces/persistent-agents#cloudresource-record), [`CloudStatus`](/cua-sdk/reference/spaces/persistent-agents#cloudstatus-record), [`CloudSweepItem`](/cua-sdk/reference/spaces/persistent-agents#cloudsweepitem-record), [`CloudSweepReport`](/cua-sdk/reference/spaces/persistent-agents#cloudsweepreport-record), [`CloudTarget`](/cua-sdk/reference/spaces/persistent-agents#cloudtarget-record), [`CloudTestReport`](/cua-sdk/reference/spaces/persistent-agents#cloudtestreport-record), [`ComputerGrant`](/cua-sdk/reference/spaces/persistent-agents#computergrant-record), [`ComputerResources`](/cua-sdk/reference/spaces/resources#computerresources-record), [`config_get`](/cua-sdk/reference/cua#config_get), [`config_list`](/cua-sdk/reference/cua#config_list), [`config_path`](/cua-sdk/reference/cua#config_path), [`config_set`](/cua-sdk/reference/cua#config_set), [`config_unset`](/cua-sdk/reference/cua#config_unset), [`ConfigEntry`](/cua-sdk/reference/cua#configentry-record), [`Container`](/cua-sdk/reference/image#container-record), [`contrib_providers_built`](/cua-sdk/reference/sandbox#contrib_providers_built), [`Cua`](/cua-sdk/reference/cua#cua), [`CuaConfig`](/cua-sdk/reference/cua#cuaconfig-record), [`CuaInfo`](/cua-sdk/reference/cua#cuainfo-record), [`CuaMode`](/cua-sdk/reference/cua#cuamode-enum), [`CursorArt`](/cua-sdk/reference/spaces/streams#cursorart-record), [`DeviceEnrollment`](/cua-sdk/reference/spaces/host#deviceenrollment-record), [`Devices`](/cua-sdk/reference/spaces/host#devices), [`DevicesSnapshot`](/cua-sdk/reference/spaces/host#devicessnapshot-record), [`DiskLevel`](/cua-sdk/reference/spaces/resources#disklevel-enum), [`DiskOnHost`](/cua-sdk/reference/spaces/resources#diskonhost-record), [`DiskWarning`](/cua-sdk/reference/spaces/resources#diskwarning-record), [`DoctorReport`](/cua-sdk/reference/cua#doctorreport-record), [`DriveAccessRequest`](/cua-sdk/reference/spaces/volume#driveaccessrequest-record), [`DriveAudit`](/cua-sdk/reference/spaces/volume#driveaudit-record), [`DriveAuditEvent`](/cua-sdk/reference/spaces/volume#driveauditevent-record), [`DriveCacheStats`](/cua-sdk/reference/spaces/volume#drivecachestats-record), [`DriveConflict`](/cua-sdk/reference/spaces/volume#driveconflict-record), [`DriveDevice`](/cua-sdk/reference/spaces/volume#drivedevice-record), [`DriveEntry`](/cua-sdk/reference/spaces/volume#driveentry-record), [`DriveFile`](/cua-sdk/reference/spaces/volume#drivefile-record), [`DriveFileSync`](/cua-sdk/reference/spaces/volume#drivefilesync-record), [`DriveGrant`](/cua-sdk/reference/spaces/volume#drivegrant-record), [`DriveListing`](/cua-sdk/reference/spaces/volume#drivelisting-record), [`DriveMountStatus`](/cua-sdk/reference/spaces/volume#drivemountstatus-record), [`DriveObject`](/cua-sdk/reference/spaces/volume#driveobject-record), [`DrivePendingUpload`](/cua-sdk/reference/spaces/volume#drivependingupload-record), [`DriveS3Settings`](/cua-sdk/reference/spaces/volume#drives3settings-record), [`DriveSpaceVolume`](/cua-sdk/reference/spaces/volume#drivespacevolume-record), [`DriveStorage`](/cua-sdk/reference/spaces/volume#drivestorage-record), [`DriveStorageCheck`](/cua-sdk/reference/spaces/volume#drivestoragecheck-record), [`DriveStorageUpdate`](/cua-sdk/reference/spaces/volume#drivestorageupdate-record), [`DriveSyncEvent`](/cua-sdk/reference/spaces/volume#drivesyncevent-record), [`DriveSyncEvents`](/cua-sdk/reference/spaces/volume#drivesyncevents-record), [`DriveSyncStatus`](/cua-sdk/reference/spaces/volume#drivesyncstatus-record), [`DriveVersion`](/cua-sdk/reference/spaces/volume#driveversion-record), [`DriveView`](/cua-sdk/reference/spaces/volume#driveview-record), [`EgressEnforcement`](/cua-sdk/reference/spaces/space#egressenforcement-enum), [`EgressPolicy`](/cua-sdk/reference/spaces#egresspolicy-record), [`ElasticAssignment`](/cua-sdk/reference/spaces/elastic#elasticassignment-record), [`ElasticBudget`](/cua-sdk/reference/spaces/elastic#elasticbudget-record), [`ElasticBudgetUpdate`](/cua-sdk/reference/spaces/elastic#elasticbudgetupdate-record), [`ElasticDecision`](/cua-sdk/reference/spaces/elastic#elasticdecision-record), [`ElasticHost`](/cua-sdk/reference/spaces/elastic#elastichost-record), [`ElasticNewHost`](/cua-sdk/reference/spaces/elastic#elasticnewhost-record), [`ElasticPlan`](/cua-sdk/reference/spaces/elastic#elasticplan-record), [`ElasticPlanRequest`](/cua-sdk/reference/spaces/elastic#elasticplanrequest-record), [`ElasticRemoved`](/cua-sdk/reference/spaces/elastic#elasticremoved-record), [`ElasticUnplaced`](/cua-sdk/reference/spaces/elastic#elasticunplaced-record), [`ForkBatch`](/cua-sdk/reference/sandbox/fork-batch#forkbatch), [`ForkBatchEvent`](/cua-sdk/reference/sandbox/fork-batch#forkbatchevent-enum), [`ForkBatchItem`](/cua-sdk/reference/sandbox/fork-batch#forkbatchitem-record), [`ForkBatchPlacement`](/cua-sdk/reference/sandbox/fork-batch#forkbatchplacement-record), [`ForkBatchResult`](/cua-sdk/reference/sandbox/fork-batch#forkbatchresult-record), [`ForkBatchSummary`](/cua-sdk/reference/sandbox/fork-batch#forkbatchsummary-record), [`ForkGroup`](/cua-sdk/reference/sandbox/fork-batch#forkgroup-record), [`ForkManyOptions`](/cua-sdk/reference/sandbox/fork-batch#forkmanyoptions-record), [`FrameSink`](/cua-sdk/reference/spacesd/computer#framesink), [`GpuOption`](/cua-sdk/reference/spaces#gpuoption-record), [`GpuSupport`](/cua-sdk/reference/spaces#gpusupport-record), [`GuestDisplay`](/cua-sdk/reference/spacesd#guestdisplay), [`GuestUsage`](/cua-sdk/reference/spaces/resources#guestusage-record), [`HomeTransfer`](/cua-sdk/reference/spaces/persistent-agents#hometransfer-record), [`Host`](/cua-sdk/reference/spaces/host#host), [`HostAccessRecord`](/cua-sdk/reference/spaces/host#hostaccessrecord-record), [`HostPermission`](/cua-sdk/reference/spaces/host#hostpermission-record), [`HostProvidedSpace`](/cua-sdk/reference/spaces/host#hostprovidedspace-record), [`HostServiceMigration`](/cua-sdk/reference/spaces/host#hostservicemigration-record), [`HostSettingsChange`](/cua-sdk/reference/spaces/host#hostsettingschange-record), [`HostSetupOptions`](/cua-sdk/reference/spaces/host#hostsetupoptions-record), [`HostSpacesAuditRecord`](/cua-sdk/reference/spaces/host#hostspacesauditrecord-record), [`HostStatus`](/cua-sdk/reference/spaces/host#hoststatus-record), [`HttpHeader`](/cua-sdk/reference/services#httpheader-record), [`HttpResponse`](/cua-sdk/reference/services#httpresponse-record), [`image_alias`](/cua-sdk/reference/image#image_alias), [`ImageBuild`](/cua-sdk/reference/image#imagebuild-record), [`ImageInfo`](/cua-sdk/reference/image#imageinfo-record), [`ImageLayer`](/cua-sdk/reference/image#imagelayer-enum), [`Local`](/cua-sdk/reference/cua#local), [`LocalImage`](/cua-sdk/reference/cua#localimage-record), [`LocalStorage`](/cua-sdk/reference/cua#localstorage-record), [`LocationInfo`](/cua-sdk/reference/cua#locationinfo-record), [`locations`](/cua-sdk/reference/cua#locations), [`LoginAttempt`](/cua-sdk/reference/auth#loginattempt), [`LoginMethod`](/cua-sdk/reference/auth#loginmethod-enum), [`MachineHealth`](/cua-sdk/reference/spaces/host#machinehealth-record), [`MachineHealthCheck`](/cua-sdk/reference/spaces/host#machinehealthcheck-record), [`may_have_session`](/cua-sdk/reference/auth#may_have_session), [`mcp_connect`](/cua-sdk/reference/services#mcp_connect), [`mcp_connect_url`](/cua-sdk/reference/services#mcp_connect_url), [`McpClient`](/cua-sdk/reference/services#mcpclient), [`McpConfig`](/cua-sdk/reference/services#mcpconfig-record), [`MediaBridge`](/cua-sdk/reference/spacesd/computer#mediabridge-record), [`MediaEvent`](/cua-sdk/reference/spacesd/computer#mediaevent-record), [`MediaSession`](/cua-sdk/reference/spacesd/computer#mediasession), [`MediaStats`](/cua-sdk/reference/spacesd/computer#mediastats-record), [`NamedVolume`](/cua-sdk/reference/spaces/volume#namedvolume-record), [`normalize_image`](/cua-sdk/reference/image#normalize_image), [`NotificationInfo`](/cua-sdk/reference/spaces/persistent-agents#notificationinfo-record), [`omarchy_image`](/cua-sdk/reference/image#omarchy_image), [`Overlay`](/cua-sdk/reference/sandbox#overlay-record), [`OverlayResult`](/cua-sdk/reference/sandbox#overlayresult-record), [`PairingCode`](/cua-sdk/reference/spaces/host#pairingcode-record), [`parse_sandbox_ref`](/cua-sdk/reference/sandbox/lifecycle#parse_sandbox_ref), [`PersistentAgentInfo`](/cua-sdk/reference/spaces/persistent-agents#persistentagentinfo-record), [`PersistentAgentOptions`](/cua-sdk/reference/spaces/persistent-agents#persistentagentoptions-record), [`PoolCreateOptions`](/cua-sdk/reference/image#poolcreateoptions-record), [`PortForward`](/cua-sdk/reference/services#portforward), [`presence_color`](/cua-sdk/reference/spaces/streams#presence_color), [`presence_conformance_json`](/cua-sdk/reference/spaces/streams#presence_conformance_json), [`presence_cursor_art`](/cua-sdk/reference/spaces/streams#presence_cursor_art), [`presence_cursor_art_all`](/cua-sdk/reference/spaces/streams#presence_cursor_art_all), [`presence_cursor_art_svg`](/cua-sdk/reference/spaces/streams#presence_cursor_art_svg), [`presence_now_ms`](/cua-sdk/reference/spaces/streams#presence_now_ms), [`presence_text_color`](/cua-sdk/reference/spaces/streams#presence_text_color), [`PresenceCursor`](/cua-sdk/reference/spaces/streams#presencecursor-record), [`PresenceDrawable`](/cua-sdk/reference/spaces/streams#presencedrawable-record), [`PresenceEvent`](/cua-sdk/reference/spaces/streams#presenceevent-record), [`PresenceIdentity`](/cua-sdk/reference/spaces/streams#presenceidentity-record), [`PresenceMember`](/cua-sdk/reference/spaces/streams#presencemember-record), [`PresenceParticipant`](/cua-sdk/reference/spaces/streams#presenceparticipant-record), [`PresencePoint`](/cua-sdk/reference/spaces/streams#presencepoint-record), [`PresenceView`](/cua-sdk/reference/spaces/streams#presenceview), [`Prewarm`](/cua-sdk/reference/spaces/elastic#prewarm-record), [`PrewarmOptions`](/cua-sdk/reference/spaces/elastic#prewarmoptions-record), [`PrewarmPlacement`](/cua-sdk/reference/spaces/elastic#prewarmplacement-record), [`PublicUrl`](/cua-sdk/reference/services#publicurl-record), [`qualify_sandbox_ref`](/cua-sdk/reference/sandbox/lifecycle#qualify_sandbox_ref), [`ReadinessProbe`](/cua-sdk/reference/image#readinessprobe-record), [`RegistrySecret`](/cua-sdk/reference/image#registrysecret-enum), [`Relay`](/cua-sdk/reference/spaces/host#relay), [`RelayAuditEvent`](/cua-sdk/reference/spaces/host#relayauditevent-record), [`RelayClientInfo`](/cua-sdk/reference/spaces/host#relayclientinfo-record), [`RelayDevice`](/cua-sdk/reference/spaces/host#relaydevice-record), [`RelayMachine`](/cua-sdk/reference/spaces/host#relaymachine-record), [`ReplayMode`](/cua-sdk/reference/spacesd/shell#replaymode-enum), [`resolve_image`](/cua-sdk/reference/image#resolve_image), [`resolve_image_with_secret`](/cua-sdk/reference/image#resolve_image_with_secret), [`ResolvedImage`](/cua-sdk/reference/image#resolvedimage-record), [`ResourcesEvent`](/cua-sdk/reference/spaces/resources#resourcesevent-enum), [`ResourcesListener`](/cua-sdk/reference/spaces/resources#resourceslistener), [`ResourcesSnapshot`](/cua-sdk/reference/spaces/resources#resourcessnapshot-record), [`ResourcesUpdate`](/cua-sdk/reference/spaces/resources#resourcesupdate-record), [`ResourcesWatch`](/cua-sdk/reference/spaces/resources#resourceswatch), [`RoutineInfo`](/cua-sdk/reference/spaces/persistent-agents#routineinfo-record), [`RuntimeCheck`](/cua-sdk/reference/cua#runtimecheck-record), [`RuntimeCheckStatus`](/cua-sdk/reference/cua#runtimecheckstatus-enum), [`Sandbox`](/cua-sdk/reference/sandbox#sandbox), [`sandbox_locations`](/cua-sdk/reference/sandbox#sandbox_locations), [`SandboxCreateOptions`](/cua-sdk/reference/image#sandboxcreateoptions-record), [`Sandboxes`](/cua-sdk/reference/sandbox#sandboxes), [`SandboxInfo`](/cua-sdk/reference/sandbox#sandboxinfo-record), [`SandboxListing`](/cua-sdk/reference/sandbox#sandboxlisting-record), [`SandboxPhase`](/cua-sdk/reference/sandbox#sandboxphase-enum), [`SandboxPool`](/cua-sdk/reference/image#sandboxpool-record), [`SandboxRefParts`](/cua-sdk/reference/sandbox/lifecycle#sandboxrefparts-record), [`SandboxStatus`](/cua-sdk/reference/sandbox#sandboxstatus-enum), [`Service`](/cua-sdk/reference/services#service), [`ServiceEndpoint`](/cua-sdk/reference/services#serviceendpoint-record), [`SetupStep`](/cua-sdk/reference/cua#setupstep-record), [`Share`](/cua-sdk/reference/share#share-record), [`ShareAccess`](/cua-sdk/reference/share#shareaccess-enum), [`ShareCheck`](/cua-sdk/reference/share#sharecheck-record), [`SiteLoginOptions`](/cua-sdk/reference/spaces/space#siteloginoptions-record), [`SiteLoginReport`](/cua-sdk/reference/spaces/space#siteloginreport-record), [`SnapshotFallbackOptions`](/cua-sdk/reference/sandbox/fork-batch#snapshotfallbackoptions-record), [`SnapshotSyncProgress`](/cua-sdk/reference/sandbox/fork-batch#snapshotsyncprogress-record), [`Space`](/cua-sdk/reference/spaces/space#space), [`SpaceAgentOptions`](/cua-sdk/reference/spaces/agents#spaceagentoptions-record), [`SpaceAppIcon`](/cua-sdk/reference/spaces/space#spaceappicon-record), [`SpaceAppIconRequest`](/cua-sdk/reference/spaces/space#spaceappiconrequest-record), [`SpaceBashResult`](/cua-sdk/reference/spaces/space#spacebashresult-record), [`SpaceCancelOutcome`](/cua-sdk/reference/spaces#spacecanceloutcome-record), [`SpaceCreateListener`](/cua-sdk/reference/spaces#spacecreatelistener), [`SpaceCreateOptions`](/cua-sdk/reference/spaces#spacecreateoptions-record), [`SpaceCreateProgress`](/cua-sdk/reference/spaces#spacecreateprogress-record), [`SpaceCreateResult`](/cua-sdk/reference/spaces#spacecreateresult-record), [`SpaceDisplay`](/cua-sdk/reference/spaces/space#spacedisplay-record), [`SpaceHotspotStatus`](/cua-sdk/reference/spaces/space#spacehotspotstatus-record), [`SpaceInfo`](/cua-sdk/reference/spaces#spaceinfo-record), [`SpaceList`](/cua-sdk/reference/spaces#spacelist-record), [`SpacePowerReport`](/cua-sdk/reference/spaces#spacepowerreport-record), [`SpacePresence`](/cua-sdk/reference/spaces/streams#spacepresence), [`SpaceRelayRegistration`](/cua-sdk/reference/spaces/space#spacerelayregistration-record), [`SpaceResources`](/cua-sdk/reference/spaces/resources#spaceresources-record), [`Spaces`](/cua-sdk/reference/spaces#spaces), [`spaces_tool_methods`](/cua-sdk/reference/spaces#spaces_tool_methods), [`SpacesdClient`](/cua-sdk/reference/spacesd#spacesdclient), [`SpacesdDownload`](/cua-sdk/reference/spacesd#spacesddownload), [`SpacesdForward`](/cua-sdk/reference/spacesd#spacesdforward), [`SpacesdHttpHeader`](/cua-sdk/reference/spacesd#spacesdhttpheader-record), [`SpacesdHttpRequest`](/cua-sdk/reference/spacesd#spacesdhttprequest-record), [`SpacesdHttpResponse`](/cua-sdk/reference/spacesd#spacesdhttpresponse-record), [`SpacesdProcess`](/cua-sdk/reference/spacesd/shell#spacesdprocess), [`SpaceSendFileOptions`](/cua-sdk/reference/spaces/space#spacesendfileoptions-record), [`SpaceSendFileReport`](/cua-sdk/reference/spaces/space#spacesendfilereport-record), [`SpaceSentFile`](/cua-sdk/reference/spaces/space#spacesentfile-record), [`SpaceShareEntry`](/cua-sdk/reference/spaces/space#spaceshareentry-record), [`SpaceShares`](/cua-sdk/reference/spaces/space#spaceshares-record), [`SpacesHost`](/cua-sdk/reference/spaces/host#spaceshost-record), [`SpacesHostLimit`](/cua-sdk/reference/spaces/host#spaceshostlimit-record), [`SpacesHostLoad`](/cua-sdk/reference/spaces/host#spaceshostload-record), [`SpacesListListener`](/cua-sdk/reference/spaces/list-watch#spaceslistlistener), [`SpacesListWatch`](/cua-sdk/reference/spaces/list-watch#spaceslistwatch), [`SpacesToolMethod`](/cua-sdk/reference/spaces#spacestoolmethod-record), [`SpaceStreamOptions`](/cua-sdk/reference/spaces/streams#spacestreamoptions-record), [`SpaceStreamSession`](/cua-sdk/reference/spaces/streams#spacestreamsession), [`SpaceStreamStats`](/cua-sdk/reference/spaces/streams#spacestreamstats-record), [`SpaceStreamTicket`](/cua-sdk/reference/spaces/streams#spacestreamticket-record), [`SpaceToolInfo`](/cua-sdk/reference/spaces/space#spacetoolinfo-record), [`SpaceToolResult`](/cua-sdk/reference/spaces/space#spacetoolresult-record), [`SpaceTransferReport`](/cua-sdk/reference/spaces/space#spacetransferreport-record), [`SpaceTransport`](/cua-sdk/reference/spaces/channel#spacetransport-record), [`SpaceUsage`](/cua-sdk/reference/spaces/space#spaceusage-record), [`SpaceWindow`](/cua-sdk/reference/spaces/space#spacewindow-record), [`SpaceWriteReport`](/cua-sdk/reference/spaces/space#spacewritereport-record), [`StorageVolume`](/cua-sdk/reference/cua#storagevolume-record), [`StreamStatsReport`](/cua-sdk/reference/auth#streamstatsreport-record), [`telemetry_acknowledge_link_notice`](/cua-sdk/reference/auth#telemetry_acknowledge_link_notice), [`telemetry_acknowledge_notice`](/cua-sdk/reference/auth#telemetry_acknowledge_notice), [`telemetry_flush`](/cua-sdk/reference/auth#telemetry_flush), [`telemetry_link_notice`](/cua-sdk/reference/auth#telemetry_link_notice), [`telemetry_link_notice_due`](/cua-sdk/reference/auth#telemetry_link_notice_due), [`telemetry_link_state`](/cua-sdk/reference/auth#telemetry_link_state), [`telemetry_notice_text`](/cua-sdk/reference/auth#telemetry_notice_text), [`telemetry_record_bench_run`](/cua-sdk/reference/auth#telemetry_record_bench_run), [`telemetry_record_feature`](/cua-sdk/reference/auth#telemetry_record_feature), [`telemetry_record_onboarding_step`](/cua-sdk/reference/auth#telemetry_record_onboarding_step), [`telemetry_record_stream_stats`](/cua-sdk/reference/auth#telemetry_record_stream_stats), [`telemetry_reset_id`](/cua-sdk/reference/auth#telemetry_reset_id), [`telemetry_schema_json`](/cua-sdk/reference/auth#telemetry_schema_json), [`telemetry_set_enabled`](/cua-sdk/reference/auth#telemetry_set_enabled), [`telemetry_set_surface`](/cua-sdk/reference/auth#telemetry_set_surface), [`telemetry_show_last`](/cua-sdk/reference/auth#telemetry_show_last), [`telemetry_status`](/cua-sdk/reference/auth#telemetry_status), [`telemetry_sync_account`](/cua-sdk/reference/auth#telemetry_sync_account), [`telemetry_use_app_notice`](/cua-sdk/reference/auth#telemetry_use_app_notice), [`TelemetryLinkNotice`](/cua-sdk/reference/auth#telemetrylinknotice-record), [`TelemetryStatus`](/cua-sdk/reference/auth#telemetrystatus-record), [`TeleportApprover`](/cua-sdk/reference/spaces/space#teleportapprover), [`TeleportDecision`](/cua-sdk/reference/spaces/space#teleportdecision-record), [`TeleportItem`](/cua-sdk/reference/spaces/space#teleportitem-record), [`TeleportManifest`](/cua-sdk/reference/spaces/space#teleportmanifest-record), [`TeleportReceipt`](/cua-sdk/reference/spaces/space#teleportreceipt-record), [`VideoFrame`](/cua-sdk/reference/spacesd/computer#videoframe-record), [`ViewerLink`](/cua-sdk/reference/sandbox#viewerlink-record), [`ViewerOptions`](/cua-sdk/reference/sandbox#vieweroptions-record), [`VolumeMount`](/cua-sdk/reference/spaces/volume#volumemount-record).+[`agent_event_category`](/cua-sdk/reference/agents#agent_event_category), [`agent_harnesses`](/cua-sdk/reference/agents#agent_harnesses), [`AgentActionReport`](/cua-sdk/reference/spaces/agents#agentactionreport-record), [`AgentArtifact`](/cua-sdk/reference/agents#agentartifact-record), [`AgentDelivery`](/cua-sdk/reference/spaces/persistent-agents#agentdelivery-record), [`AgentEvent`](/cua-sdk/reference/agents#agentevent-record), [`AgentEventPage`](/cua-sdk/reference/agents#agenteventpage-record), [`AgentFile`](/cua-sdk/reference/agents#agentfile-record), [`AgentInfo`](/cua-sdk/reference/agent-setup#agentinfo-record), [`AgentMcpServer`](/cua-sdk/reference/agent-setup#agentmcpserver-record), [`AgentPauseReport`](/cua-sdk/reference/spaces/persistent-agents#agentpausereport-record), [`AgentResumeReport`](/cua-sdk/reference/spaces/persistent-agents#agentresumereport-record), [`AgentRun`](/cua-sdk/reference/agents#agentrun), [`AgentRunInfo`](/cua-sdk/reference/agents#agentruninfo-record), [`AgentRunMcpServer`](/cua-sdk/reference/agents#agentrunmcpserver-record), [`AgentRunOptions`](/cua-sdk/reference/agents#agentrunoptions-record), [`AgentRunResult`](/cua-sdk/reference/agents#agentrunresult-record), [`AgentRunStatus`](/cua-sdk/reference/spaces/agents#agentrunstatus-record), [`Agents`](/cua-sdk/reference/agents#agents), [`AgentSetup`](/cua-sdk/reference/agent-setup#agentsetup), [`AgentSetupChange`](/cua-sdk/reference/agent-setup#agentsetupchange-enum), [`AgentSetupOutcome`](/cua-sdk/reference/agent-setup#agentsetupoutcome-record), [`AgentSetupTarget`](/cua-sdk/reference/agent-setup#agentsetuptarget-enum), [`AgentStartReport`](/cua-sdk/reference/spaces/agents#agentstartreport-record), [`AgentTranscript`](/cua-sdk/reference/agents#agenttranscript), [`AgentTranscriptItem`](/cua-sdk/reference/agents#agenttranscriptitem-record), [`ambiguous_sandbox_candidates`](/cua-sdk/reference/sandbox/lifecycle#ambiguous_sandbox_candidates), [`AudioPacket`](/cua-sdk/reference/spacesd/computer#audiopacket-record), [`AudioSink`](/cua-sdk/reference/spacesd/computer#audiosink), [`Auth`](/cua-sdk/reference/auth#auth), [`AuthIdentity`](/cua-sdk/reference/auth#authidentity-record), [`AuthStatus`](/cua-sdk/reference/auth#authstatus-record), [`BakeForkCheck`](/cua-sdk/reference/sandbox/bake#bakeforkcheck-record), [`BakeOptions`](/cua-sdk/reference/sandbox/bake#bakeoptions-record), [`BakeSummary`](/cua-sdk/reference/sandbox/bake#bakesummary-record), [`BuildFile`](/cua-sdk/reference/image#buildfile-record), [`BuildImageConfig`](/cua-sdk/reference/spaces/build#buildimageconfig-record), [`BuildInfo`](/cua-sdk/reference/spaces/build#buildinfo-record), [`BuildListener`](/cua-sdk/reference/spaces/build#buildlistener), [`BuildOptions`](/cua-sdk/reference/spaces/build#buildoptions-record), [`BuildProgress`](/cua-sdk/reference/spaces/build#buildprogress-record), [`BuildResult`](/cua-sdk/reference/spaces/build#buildresult-record), [`BuildStep`](/cua-sdk/reference/spaces/build#buildstep-enum), [`BuildStepResult`](/cua-sdk/reference/spaces/build#buildstepresult-record), [`BundledSkill`](/cua-sdk/reference/agent-setup#bundledskill-record), [`canonical_image`](/cua-sdk/reference/image#canonical_image), [`canonical_image_tier`](/cua-sdk/reference/image#canonical_image_tier), [`check_placement`](/cua-sdk/reference/cua#check_placement), [`CheckpointSummary`](/cua-sdk/reference/sandbox/checkpoints#checkpointsummary-record), [`CloudAuditEntry`](/cua-sdk/reference/spaces/persistent-agents#cloudauditentry-record), [`CloudCheck`](/cua-sdk/reference/spaces/persistent-agents#cloudcheck-record), [`CloudConnected`](/cua-sdk/reference/spaces/persistent-agents#cloudconnected-record), [`CloudCredentials`](/cua-sdk/reference/spaces/persistent-agents#cloudcredentials-record), [`CloudDisconnected`](/cua-sdk/reference/spaces/persistent-agents#clouddisconnected-record), [`CloudKind`](/cua-sdk/reference/spaces/persistent-agents#cloudkind-record), [`CloudProvider`](/cua-sdk/reference/spaces/persistent-agents#cloudprovider-record), [`CloudResource`](/cua-sdk/reference/spaces/persistent-agents#cloudresource-record), [`CloudStatus`](/cua-sdk/reference/spaces/persistent-agents#cloudstatus-record), [`CloudSweepItem`](/cua-sdk/reference/spaces/persistent-agents#cloudsweepitem-record), [`CloudSweepReport`](/cua-sdk/reference/spaces/persistent-agents#cloudsweepreport-record), [`CloudTarget`](/cua-sdk/reference/spaces/persistent-agents#cloudtarget-record), [`CloudTestReport`](/cua-sdk/reference/spaces/persistent-agents#cloudtestreport-record), [`ComputerGrant`](/cua-sdk/reference/spaces/persistent-agents#computergrant-record), [`ComputerResources`](/cua-sdk/reference/spaces/resources#computerresources-record), [`config_get`](/cua-sdk/reference/cua#config_get), [`config_list`](/cua-sdk/reference/cua#config_list), [`config_path`](/cua-sdk/reference/cua#config_path), [`config_set`](/cua-sdk/reference/cua#config_set), [`config_unset`](/cua-sdk/reference/cua#config_unset), [`ConfigEntry`](/cua-sdk/reference/cua#configentry-record), [`Container`](/cua-sdk/reference/image#container-record), [`contrib_providers_built`](/cua-sdk/reference/sandbox#contrib_providers_built), [`Cua`](/cua-sdk/reference/cua#cua), [`CuaConfig`](/cua-sdk/reference/cua#cuaconfig-record), [`CuaInfo`](/cua-sdk/reference/cua#cuainfo-record), [`CuaMode`](/cua-sdk/reference/cua#cuamode-enum), [`CursorArt`](/cua-sdk/reference/spaces/streams#cursorart-record), [`DeviceEnrollment`](/cua-sdk/reference/spaces/host#deviceenrollment-record), [`Devices`](/cua-sdk/reference/spaces/host#devices), [`DevicesSnapshot`](/cua-sdk/reference/spaces/host#devicessnapshot-record), [`DiskLevel`](/cua-sdk/reference/spaces/resources#disklevel-enum), [`DiskOnHost`](/cua-sdk/reference/spaces/resources#diskonhost-record), [`DiskWarning`](/cua-sdk/reference/spaces/resources#diskwarning-record), [`DoctorReport`](/cua-sdk/reference/cua#doctorreport-record), [`DriveAccessRequest`](/cua-sdk/reference/spaces/volume#driveaccessrequest-record), [`DriveAudit`](/cua-sdk/reference/spaces/volume#driveaudit-record), [`DriveAuditEvent`](/cua-sdk/reference/spaces/volume#driveauditevent-record), [`DriveCacheStats`](/cua-sdk/reference/spaces/volume#drivecachestats-record), [`DriveConflict`](/cua-sdk/reference/spaces/volume#driveconflict-record), [`DriveDevice`](/cua-sdk/reference/spaces/volume#drivedevice-record), [`DriveEntry`](/cua-sdk/reference/spaces/volume#driveentry-record), [`DriveFile`](/cua-sdk/reference/spaces/volume#drivefile-record), [`DriveFileSync`](/cua-sdk/reference/spaces/volume#drivefilesync-record), [`DriveGrant`](/cua-sdk/reference/spaces/volume#drivegrant-record), [`DriveListing`](/cua-sdk/reference/spaces/volume#drivelisting-record), [`DriveMountStatus`](/cua-sdk/reference/spaces/volume#drivemountstatus-record), [`DriveObject`](/cua-sdk/reference/spaces/volume#driveobject-record), [`DrivePendingUpload`](/cua-sdk/reference/spaces/volume#drivependingupload-record), [`DriveS3Settings`](/cua-sdk/reference/spaces/volume#drives3settings-record), [`DriveSpaceVolume`](/cua-sdk/reference/spaces/volume#drivespacevolume-record), [`DriveStorage`](/cua-sdk/reference/spaces/volume#drivestorage-record), [`DriveStorageCheck`](/cua-sdk/reference/spaces/volume#drivestoragecheck-record), [`DriveStorageUpdate`](/cua-sdk/reference/spaces/volume#drivestorageupdate-record), [`DriveSyncEvent`](/cua-sdk/reference/spaces/volume#drivesyncevent-record), [`DriveSyncEvents`](/cua-sdk/reference/spaces/volume#drivesyncevents-record), [`DriveSyncStatus`](/cua-sdk/reference/spaces/volume#drivesyncstatus-record), [`DriveVersion`](/cua-sdk/reference/spaces/volume#driveversion-record), [`DriveView`](/cua-sdk/reference/spaces/volume#driveview-record), [`EgressEnforcement`](/cua-sdk/reference/spaces/space#egressenforcement-enum), [`EgressPolicy`](/cua-sdk/reference/spaces#egresspolicy-record), [`ElasticAssignment`](/cua-sdk/reference/spaces/elastic#elasticassignment-record), [`ElasticBudget`](/cua-sdk/reference/spaces/elastic#elasticbudget-record), [`ElasticBudgetUpdate`](/cua-sdk/reference/spaces/elastic#elasticbudgetupdate-record), [`ElasticDecision`](/cua-sdk/reference/spaces/elastic#elasticdecision-record), [`ElasticHost`](/cua-sdk/reference/spaces/elastic#elastichost-record), [`ElasticNewHost`](/cua-sdk/reference/spaces/elastic#elasticnewhost-record), [`ElasticPlan`](/cua-sdk/reference/spaces/elastic#elasticplan-record), [`ElasticPlanRequest`](/cua-sdk/reference/spaces/elastic#elasticplanrequest-record), [`ElasticRemoved`](/cua-sdk/reference/spaces/elastic#elasticremoved-record), [`ElasticUnplaced`](/cua-sdk/reference/spaces/elastic#elasticunplaced-record), [`ForkBatch`](/cua-sdk/reference/sandbox/fork-batch#forkbatch), [`ForkBatchEvent`](/cua-sdk/reference/sandbox/fork-batch#forkbatchevent-enum), [`ForkBatchItem`](/cua-sdk/reference/sandbox/fork-batch#forkbatchitem-record), [`ForkBatchPlacement`](/cua-sdk/reference/sandbox/fork-batch#forkbatchplacement-record), [`ForkBatchResult`](/cua-sdk/reference/sandbox/fork-batch#forkbatchresult-record), [`ForkBatchSummary`](/cua-sdk/reference/sandbox/fork-batch#forkbatchsummary-record), [`ForkGroup`](/cua-sdk/reference/sandbox/fork-batch#forkgroup-record), [`ForkManyOptions`](/cua-sdk/reference/sandbox/fork-batch#forkmanyoptions-record), [`FrameSink`](/cua-sdk/reference/spacesd/computer#framesink), [`GpuOption`](/cua-sdk/reference/spaces#gpuoption-record), [`GpuSupport`](/cua-sdk/reference/spaces#gpusupport-record), [`GuestDisplay`](/cua-sdk/reference/spacesd#guestdisplay), [`GuestUsage`](/cua-sdk/reference/spaces/resources#guestusage-record), [`HomeTransfer`](/cua-sdk/reference/spaces/persistent-agents#hometransfer-record), [`Host`](/cua-sdk/reference/spaces/host#host), [`HostAccessRecord`](/cua-sdk/reference/spaces/host#hostaccessrecord-record), [`HostPermission`](/cua-sdk/reference/spaces/host#hostpermission-record), [`HostProvidedSpace`](/cua-sdk/reference/spaces/host#hostprovidedspace-record), [`HostServiceMigration`](/cua-sdk/reference/spaces/host#hostservicemigration-record), [`HostSettingsChange`](/cua-sdk/reference/spaces/host#hostsettingschange-record), [`HostSetupOptions`](/cua-sdk/reference/spaces/host#hostsetupoptions-record), [`HostSpacesAuditRecord`](/cua-sdk/reference/spaces/host#hostspacesauditrecord-record), [`HostStatus`](/cua-sdk/reference/spaces/host#hoststatus-record), [`HttpHeader`](/cua-sdk/reference/services#httpheader-record), [`HttpResponse`](/cua-sdk/reference/services#httpresponse-record), [`image_alias`](/cua-sdk/reference/image#image_alias), [`ImageBuild`](/cua-sdk/reference/image#imagebuild-record), [`ImageInfo`](/cua-sdk/reference/image#imageinfo-record), [`ImageLayer`](/cua-sdk/reference/image#imagelayer-enum), [`Local`](/cua-sdk/reference/cua#local), [`LocalImage`](/cua-sdk/reference/cua#localimage-record), [`LocalStorage`](/cua-sdk/reference/cua#localstorage-record), [`LocationInfo`](/cua-sdk/reference/cua#locationinfo-record), [`locations`](/cua-sdk/reference/cua#locations), [`LoginAttempt`](/cua-sdk/reference/auth#loginattempt), [`LoginMethod`](/cua-sdk/reference/auth#loginmethod-enum), [`MachineHealth`](/cua-sdk/reference/spaces/host#machinehealth-record), [`MachineHealthCheck`](/cua-sdk/reference/spaces/host#machinehealthcheck-record), [`may_have_session`](/cua-sdk/reference/auth#may_have_session), [`mcp_connect`](/cua-sdk/reference/services#mcp_connect), [`mcp_connect_url`](/cua-sdk/reference/services#mcp_connect_url), [`McpClient`](/cua-sdk/reference/services#mcpclient), [`McpConfig`](/cua-sdk/reference/services#mcpconfig-record), [`MediaBridge`](/cua-sdk/reference/spacesd/computer#mediabridge-record), [`MediaEvent`](/cua-sdk/reference/spacesd/computer#mediaevent-record), [`MediaSession`](/cua-sdk/reference/spacesd/computer#mediasession), [`MediaStats`](/cua-sdk/reference/spacesd/computer#mediastats-record), [`NamedVolume`](/cua-sdk/reference/spaces/volume#namedvolume-record), [`normalize_image`](/cua-sdk/reference/image#normalize_image), [`NotificationInfo`](/cua-sdk/reference/spaces/persistent-agents#notificationinfo-record), [`omarchy_image`](/cua-sdk/reference/image#omarchy_image), [`Overlay`](/cua-sdk/reference/sandbox#overlay-record), [`OverlayResult`](/cua-sdk/reference/sandbox#overlayresult-record), [`PairingCode`](/cua-sdk/reference/spaces/host#pairingcode-record), [`parse_sandbox_ref`](/cua-sdk/reference/sandbox/lifecycle#parse_sandbox_ref), [`PersistentAgentInfo`](/cua-sdk/reference/spaces/persistent-agents#persistentagentinfo-record), [`PersistentAgentOptions`](/cua-sdk/reference/spaces/persistent-agents#persistentagentoptions-record), [`PoolCreateOptions`](/cua-sdk/reference/image#poolcreateoptions-record), [`PortForward`](/cua-sdk/reference/services#portforward), [`presence_color`](/cua-sdk/reference/spaces/streams#presence_color), [`presence_conformance_json`](/cua-sdk/reference/spaces/streams#presence_conformance_json), [`presence_cursor_art`](/cua-sdk/reference/spaces/streams#presence_cursor_art), [`presence_cursor_art_all`](/cua-sdk/reference/spaces/streams#presence_cursor_art_all), [`presence_cursor_art_svg`](/cua-sdk/reference/spaces/streams#presence_cursor_art_svg), [`presence_now_ms`](/cua-sdk/reference/spaces/streams#presence_now_ms), [`presence_text_color`](/cua-sdk/reference/spaces/streams#presence_text_color), [`PresenceCursor`](/cua-sdk/reference/spaces/streams#presencecursor-record), [`PresenceDrawable`](/cua-sdk/reference/spaces/streams#presencedrawable-record), [`PresenceEvent`](/cua-sdk/reference/spaces/streams#presenceevent-record), [`PresenceIdentity`](/cua-sdk/reference/spaces/streams#presenceidentity-record), [`PresenceMember`](/cua-sdk/reference/spaces/streams#presencemember-record), [`PresenceParticipant`](/cua-sdk/reference/spaces/streams#presenceparticipant-record), [`PresencePoint`](/cua-sdk/reference/spaces/streams#presencepoint-record), [`PresenceView`](/cua-sdk/reference/spaces/streams#presenceview), [`Prewarm`](/cua-sdk/reference/spaces/elastic#prewarm-record), [`PrewarmOptions`](/cua-sdk/reference/spaces/elastic#prewarmoptions-record), [`PrewarmPlacement`](/cua-sdk/reference/spaces/elastic#prewarmplacement-record), [`PublicUrl`](/cua-sdk/reference/services#publicurl-record), [`qualify_sandbox_ref`](/cua-sdk/reference/sandbox/lifecycle#qualify_sandbox_ref), [`ReadinessProbe`](/cua-sdk/reference/image#readinessprobe-record), [`RegistrySecret`](/cua-sdk/reference/image#registrysecret-enum), [`Relay`](/cua-sdk/reference/spaces/host#relay), [`RelayAuditEvent`](/cua-sdk/reference/spaces/host#relayauditevent-record), [`RelayClientInfo`](/cua-sdk/reference/spaces/host#relayclientinfo-record), [`RelayDevice`](/cua-sdk/reference/spaces/host#relaydevice-record), [`RelayMachine`](/cua-sdk/reference/spaces/host#relaymachine-record), [`ReplayMode`](/cua-sdk/reference/spacesd/shell#replaymode-enum), [`resolve_image`](/cua-sdk/reference/image#resolve_image), [`resolve_image_with_secret`](/cua-sdk/reference/image#resolve_image_with_secret), [`ResolvedImage`](/cua-sdk/reference/image#resolvedimage-record), [`ResourcesEvent`](/cua-sdk/reference/spaces/resources#resourcesevent-enum), [`ResourcesListener`](/cua-sdk/reference/spaces/resources#resourceslistener), [`ResourcesSnapshot`](/cua-sdk/reference/spaces/resources#resourcessnapshot-record), [`ResourcesUpdate`](/cua-sdk/reference/spaces/resources#resourcesupdate-record), [`ResourcesWatch`](/cua-sdk/reference/spaces/resources#resourceswatch), [`RoutineInfo`](/cua-sdk/reference/spaces/persistent-agents#routineinfo-record), [`RuntimeCheck`](/cua-sdk/reference/cua#runtimecheck-record), [`RuntimeCheckStatus`](/cua-sdk/reference/cua#runtimecheckstatus-enum), [`Sandbox`](/cua-sdk/reference/sandbox#sandbox), [`sandbox_locations`](/cua-sdk/reference/sandbox#sandbox_locations), [`SandboxCreateOptions`](/cua-sdk/reference/image#sandboxcreateoptions-record), [`Sandboxes`](/cua-sdk/reference/sandbox#sandboxes), [`SandboxInfo`](/cua-sdk/reference/sandbox#sandboxinfo-record), [`SandboxListing`](/cua-sdk/reference/sandbox#sandboxlisting-record), [`SandboxPhase`](/cua-sdk/reference/sandbox#sandboxphase-enum), [`SandboxPool`](/cua-sdk/reference/image#sandboxpool-record), [`SandboxRefParts`](/cua-sdk/reference/sandbox/lifecycle#sandboxrefparts-record), [`SandboxStatus`](/cua-sdk/reference/sandbox#sandboxstatus-enum), [`Service`](/cua-sdk/reference/services#service), [`ServiceEndpoint`](/cua-sdk/reference/services#serviceendpoint-record), [`SetupStep`](/cua-sdk/reference/cua#setupstep-record), [`Share`](/cua-sdk/reference/share#share-record), [`ShareAccess`](/cua-sdk/reference/share#shareaccess-enum), [`ShareCheck`](/cua-sdk/reference/share#sharecheck-record), [`SiteLoginOptions`](/cua-sdk/reference/spaces/space#siteloginoptions-record), [`SiteLoginReport`](/cua-sdk/reference/spaces/space#siteloginreport-record), [`SnapshotFallbackOptions`](/cua-sdk/reference/sandbox/fork-batch#snapshotfallbackoptions-record), [`SnapshotSyncProgress`](/cua-sdk/reference/sandbox/fork-batch#snapshotsyncprogress-record), [`Space`](/cua-sdk/reference/spaces/space#space), [`SpaceAgentOptions`](/cua-sdk/reference/spaces/agents#spaceagentoptions-record), [`SpaceAppIcon`](/cua-sdk/reference/spaces/space#spaceappicon-record), [`SpaceAppIconRequest`](/cua-sdk/reference/spaces/space#spaceappiconrequest-record), [`SpaceBashResult`](/cua-sdk/reference/spaces/space#spacebashresult-record), [`SpaceCancelOutcome`](/cua-sdk/reference/spaces#spacecanceloutcome-record), [`SpaceCreateListener`](/cua-sdk/reference/spaces#spacecreatelistener), [`SpaceCreateOptions`](/cua-sdk/reference/spaces#spacecreateoptions-record), [`SpaceCreateProgress`](/cua-sdk/reference/spaces#spacecreateprogress-record), [`SpaceCreateResult`](/cua-sdk/reference/spaces#spacecreateresult-record), [`SpaceDisplay`](/cua-sdk/reference/spaces/space#spacedisplay-record), [`SpaceHotspotStatus`](/cua-sdk/reference/spaces/space#spacehotspotstatus-record), [`SpaceInfo`](/cua-sdk/reference/spaces#spaceinfo-record), [`SpaceList`](/cua-sdk/reference/spaces#spacelist-record), [`SpacePowerReport`](/cua-sdk/reference/spaces#spacepowerreport-record), [`SpacePresence`](/cua-sdk/reference/spaces/streams#spacepresence), [`SpaceRelayRegistration`](/cua-sdk/reference/spaces/space#spacerelayregistration-record), [`SpaceResizeReport`](/cua-sdk/reference/spaces/resize#spaceresizereport-record), [`SpaceResources`](/cua-sdk/reference/spaces/resources#spaceresources-record), [`Spaces`](/cua-sdk/reference/spaces#spaces), [`spaces_tool_methods`](/cua-sdk/reference/spaces#spaces_tool_methods), [`SpacesdClient`](/cua-sdk/reference/spacesd#spacesdclient), [`SpacesdDownload`](/cua-sdk/reference/spacesd#spacesddownload), [`SpacesdForward`](/cua-sdk/reference/spacesd#spacesdforward), [`SpacesdHttpHeader`](/cua-sdk/reference/spacesd#spacesdhttpheader-record), [`SpacesdHttpRequest`](/cua-sdk/reference/spacesd#spacesdhttprequest-record), [`SpacesdHttpResponse`](/cua-sdk/reference/spacesd#spacesdhttpresponse-record), [`SpacesdProcess`](/cua-sdk/reference/spacesd/shell#spacesdprocess), [`SpaceSendFileOptions`](/cua-sdk/reference/spaces/space#spacesendfileoptions-record), [`SpaceSendFileReport`](/cua-sdk/reference/spaces/space#spacesendfilereport-record), [`SpaceSentFile`](/cua-sdk/reference/spaces/space#spacesentfile-record), [`SpaceShareEntry`](/cua-sdk/reference/spaces/space#spaceshareentry-record), [`SpaceShares`](/cua-sdk/reference/spaces/space#spaceshares-record), [`SpacesHost`](/cua-sdk/reference/spaces/host#spaceshost-record), [`SpacesHostLimit`](/cua-sdk/reference/spaces/host#spaceshostlimit-record), [`SpacesHostLoad`](/cua-sdk/reference/spaces/host#spaceshostload-record), [`SpacesListListener`](/cua-sdk/reference/spaces/list-watch#spaceslistlistener), [`SpacesListWatch`](/cua-sdk/reference/spaces/list-watch#spaceslistwatch), [`SpacesToolMethod`](/cua-sdk/reference/spaces#spacestoolmethod-record), [`SpaceStreamOptions`](/cua-sdk/reference/spaces/streams#spacestreamoptions-record), [`SpaceStreamSession`](/cua-sdk/reference/spaces/streams#spacestreamsession), [`SpaceStreamStats`](/cua-sdk/reference/spaces/streams#spacestreamstats-record), [`SpaceStreamTicket`](/cua-sdk/reference/spaces/streams#spacestreamticket-record), [`SpaceToolInfo`](/cua-sdk/reference/spaces/space#spacetoolinfo-record), [`SpaceToolResult`](/cua-sdk/reference/spaces/space#spacetoolresult-record), [`SpaceTransferReport`](/cua-sdk/reference/spaces/space#spacetransferreport-record), [`SpaceTransport`](/cua-sdk/reference/spaces/channel#spacetransport-record), [`SpaceUsage`](/cua-sdk/reference/spaces/space#spaceusage-record), [`SpaceWindow`](/cua-sdk/reference/spaces/space#spacewindow-record), [`SpaceWriteReport`](/cua-sdk/reference/spaces/space#spacewritereport-record), [`StorageVolume`](/cua-sdk/reference/cua#storagevolume-record), [`StreamStatsReport`](/cua-sdk/reference/auth#streamstatsreport-record), [`telemetry_acknowledge_link_notice`](/cua-sdk/reference/auth#telemetry_acknowledge_link_notice), [`telemetry_acknowledge_notice`](/cua-sdk/reference/auth#telemetry_acknowledge_notice), [`telemetry_flush`](/cua-sdk/reference/auth#telemetry_flush), [`telemetry_link_notice`](/cua-sdk/reference/auth#telemetry_link_notice), [`telemetry_link_notice_due`](/cua-sdk/reference/auth#telemetry_link_notice_due), [`telemetry_link_state`](/cua-sdk/reference/auth#telemetry_link_state), [`telemetry_notice_text`](/cua-sdk/reference/auth#telemetry_notice_text), [`telemetry_record_bench_run`](/cua-sdk/reference/auth#telemetry_record_bench_run), [`telemetry_record_feature`](/cua-sdk/reference/auth#telemetry_record_feature), [`telemetry_record_onboarding_step`](/cua-sdk/reference/auth#telemetry_record_onboarding_step), [`telemetry_record_stream_stats`](/cua-sdk/reference/auth#telemetry_record_stream_stats), [`telemetry_reset_id`](/cua-sdk/reference/auth#telemetry_reset_id), [`telemetry_schema_json`](/cua-sdk/reference/auth#telemetry_schema_json), [`telemetry_set_enabled`](/cua-sdk/reference/auth#telemetry_set_enabled), [`telemetry_set_surface`](/cua-sdk/reference/auth#telemetry_set_surface), [`telemetry_show_last`](/cua-sdk/reference/auth#telemetry_show_last), [`telemetry_status`](/cua-sdk/reference/auth#telemetry_status), [`telemetry_sync_account`](/cua-sdk/reference/auth#telemetry_sync_account), [`telemetry_use_app_notice`](/cua-sdk/reference/auth#telemetry_use_app_notice), [`TelemetryLinkNotice`](/cua-sdk/reference/auth#telemetrylinknotice-record), [`TelemetryStatus`](/cua-sdk/reference/auth#telemetrystatus-record), [`TeleportApprover`](/cua-sdk/reference/spaces/space#teleportapprover), [`TeleportDecision`](/cua-sdk/reference/spaces/space#teleportdecision-record), [`TeleportItem`](/cua-sdk/reference/spaces/space#teleportitem-record), [`TeleportManifest`](/cua-sdk/reference/spaces/space#teleportmanifest-record), [`TeleportReceipt`](/cua-sdk/reference/spaces/space#teleportreceipt-record), [`VideoFrame`](/cua-sdk/reference/spacesd/computer#videoframe-record), [`ViewerLink`](/cua-sdk/reference/sandbox#viewerlink-record), [`ViewerOptions`](/cua-sdk/reference/sandbox#vieweroptions-record), [`VolumeMount`](/cua-sdk/reference/spaces/volume#volumemount-record).## Typesdiff --git a/docs/content/docs/cua-sdk/reference/spaces/index.mdx b/docs/content/docs/cua-sdk/reference/spaces/index.mdxindex eda84871fc..ee95e4725b 100644--- a/docs/content/docs/cua-sdk/reference/spaces/index.mdx+++ b/docs/content/docs/cua-sdk/reference/spaces/index.mdx@@ -13,7 +13,7 @@ description: "The Spaces registry: create, add, resolve, delete and remove Spaceimport { Callout } from 'fumadocs-ui/components/callout';import { Tab, Tabs } from 'fumadocs-ui/components/tabs';-`cua.spaces()` returns the `Spaces` registry. Create a Space where `on` says (local or cloud), or add an existing machine by URL, then open a [`Space`](/cua-sdk/reference/spaces/space).+`cua.spaces()` returns the `Spaces` registry. Create a Space where `on` says (local or cloud), or add an existing machine by URL, then open a [`Space`](/cua-sdk/reference/spaces/space). See [resize](/cua-sdk/reference/spaces/resize) to change a local VM's shape.## `Spaces`@@ -42,7 +42,8 @@ Returned by [`Cua.spaces`](/cua-sdk/reference/cua#cua).| [`resolve`](#spacesresolve) | Resolves an id, legacy id, URL or display name. || [`space`](#spacesspace) | A connected handle to a registered Space. || [`start`](#spacesstart) | Turns a Space on again: resumes a suspended one, boots a stopped one (a Space one of your machines provides joins the relay again), and leaves a running one as it is. |-| [`stop`](#spacesstop) | Turns a Space off the way its provider can (`SpaceInfo.power`): suspends it, keeping its memory (a local container or QEMU VM), or stops it, keeping its disk (a local Lume VM; a Space one of your machines provides, which that machine stops). |+| [`stop`](#spacesstop) | Turns a Space off the way its provider can (`SpaceInfo.power`): stops it, keeping its disk and freeing its memory (a local VM; a Space one of your machines provides, which that machine stops), or suspends it, keeping its memory (a local container that cannot stop). `Spaces.suspend` suspends a local container or QEMU VM on purpose. |+| [`suspend`](#spacessuspend) | Suspends a local Space (a container or a QEMU VM), keeping its memory: it resumes where it was, and its memory stays in use until then. `Spaces.stop` stops it instead and frees its memory. || [`agent_capabilities`](/cua-sdk/reference/spaces/agents#spacesagent_capabilities) | What every agent harness is and cannot do (`agent_capabilities`), as JSON. || [`agent_pause`](/cua-sdk/reference/spaces/persistent-agents#spacesagent_pause) | Pauses a persistent agent: run, routines and (local) Space. || [`agent_resume`](/cua-sdk/reference/spaces/persistent-agents#spacesagent_resume) | Resumes a paused persistent agent; with `prompt`, starts a run. |@@ -80,6 +81,7 @@ Returned by [`Cua.spaces`](/cua-sdk/reference/cua#cua).| [`prewarm`](/cua-sdk/reference/spaces/elastic#spacesprewarm) | Keeps Spaces of `image` ready where the elastic pool puts them (the same solve as `on` `auto`, under the budget and pins), so the next creates of that shape start in a fraction of a second. || [`prewarms`](/cua-sdk/reference/spaces/elastic#spacesprewarms) | The prewarms, with how many each keeps ready now. || [`remove_prewarm`](/cua-sdk/reference/spaces/elastic#spacesremove_prewarm) | Ends prewarm `id` (its ready Spaces go). |+| [`resize`](/cua-sdk/reference/spaces/resize#spacesresize) | Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). || [`resources`](/cua-sdk/reference/spaces/resources#spacesresources) | What this Mac, its extra Spaces and your other computers use now: processor, memory and disk, as one snapshot (a few seconds old at most). || [`routine_add`](/cua-sdk/reference/spaces/persistent-agents#spacesroutine_add) | Adds a routine. || [`routine_remove`](/cua-sdk/reference/spaces/persistent-agents#spacesroutine_remove) | Deletes a routine. |@@ -1082,10 +1084,12 @@ pub async fn start(&self, space: String) -> Result<SpacePowerReport, CuaError>### `Spaces.stop`Turns a Space off the way its provider can (`SpaceInfo.power`):-suspends it, keeping its memory (a local container or QEMU VM), or-stops it, keeping its disk (a local Lume VM; a Space one of your-machines provides, which that machine stops). A cloud Space, a Space-added by address and your own computers cannot be turned off.+stops it, keeping its disk and freeing its memory (a local VM; a+Space one of your machines provides, which that machine stops), or+suspends it, keeping its memory (a local container that cannot+stop). `Spaces.suspend` suspends a local container or QEMU VM on+purpose. A Space added by address and your own computers cannot be+turned off.<Tabs items={['Python', 'TypeScript', 'Swift', 'Kotlin', 'Rust']} groupId="sdk-lang" persist><Tab value="Python">@@ -1132,6 +1136,57 @@ pub async fn stop(&self, space: String) -> Result<SpacePowerReport, CuaError>**Returns** [`SpacePowerReport`](#spacepowerreport-record) · **Async** · **Raises** [`CuaError`](/cua-sdk/reference/errors)+### `Spaces.suspend`++Suspends a local Space (a container or a QEMU VM), keeping its+memory: it resumes where it was, and its memory stays in use until+then. `Spaces.stop` stops it instead and frees its memory.++<Tabs items={['Python', 'TypeScript', 'Swift', 'Kotlin', 'Rust']} groupId="sdk-lang" persist>+<Tab value="Python">++```python+async def suspend(self, space: str) -> SpacePowerReport+```++</Tab>+<Tab value="TypeScript">++```ts+suspend(space: string, asyncOpts_?: { signal: AbortSignal }): Promise<SpacePowerReport>+```++</Tab>+<Tab value="Swift">++```swift+func suspend(space: String) async throws -> SpacePowerReport+```++</Tab>+<Tab value="Kotlin">++```kotlin+@Throws(CuaException::class)+suspend fun suspend(space: String): SpacePowerReport+```++</Tab>+<Tab value="Rust">++```rust+pub async fn suspend(&self, space: String) -> Result<SpacePowerReport, CuaError>+```++</Tab>+</Tabs>++| Parameter | Type | Default |+| --- | --- | --- |+| `space` | `String` | required |++**Returns** [`SpacePowerReport`](#spacepowerreport-record) · **Async** · **Raises** [`CuaError`](/cua-sdk/reference/errors)+## `SpaceInfo` recordA registered Space.@@ -1189,13 +1244,13 @@ Returned by [`Spaces.list_known`](#spaceslist_known).What `Spaces.stop` or `Spaces.start` did.-Returned by [`Spaces.start`](#spacesstart), [`Spaces.stop`](#spacesstop).+Returned by [`Spaces.start`](#spacesstart), [`Spaces.stop`](#spacesstop), [`Spaces.suspend`](#spacessuspend).| Field | Type | Default | Description || --- | --- | --- | --- || `space` | `String` | | The Space. || `state` | `String` | | `running`, `suspended` or `stopped`: the state it is in now. |-| `power` | `String` | | How it turns off: `suspend` (its memory is kept) or `stop` (its disk is kept). |+| `power` | `String` | | How it was turned off: `suspend` (its memory is kept, and still in use) or `stop` (its disk is kept; its memory is freed). || `message` | `String` | | What happened, for people. |## `spaces_tool_methods`diff --git a/docs/content/docs/cua-sdk/reference/spaces/meta.json b/docs/content/docs/cua-sdk/reference/spaces/meta.jsonindex 32e82980e7..2a6a0fc561 100644--- a/docs/content/docs/cua-sdk/reference/spaces/meta.json+++ b/docs/content/docs/cua-sdk/reference/spaces/meta.json@@ -1,6 +1,7 @@{"title": "Spaces","pages": [+ "resize","lifetime","space","elastic",diff --git a/docs/content/docs/cua-sdk/reference/spaces/resize.mdx b/docs/content/docs/cua-sdk/reference/spaces/resize.mdxnew file mode 100644index 0000000000..4a0999bdf1--- /dev/null+++ b/docs/content/docs/cua-sdk/reference/spaces/resize.mdx@@ -0,0 +1,89 @@+---+title: "Resize a Space"+description: "Change a local VM's CPU, memory or disk while keeping its files."+---++{/*+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY+ Generated by: pnpm --dir docs docs:generate:cua-sdk+ Source: cua-bindgen docs (UniFFI metadata of libcua_sdk)+ Version: 0.9.0+*/}++import { Tab, Tabs } from 'fumadocs-ui/components/tabs';++`Spaces.resize` boots a stopped local VM from its own disk after changing its shape. The disk can grow; its files stay in place.++## Resize++Methods of [`Spaces`](/cua-sdk/reference/spaces#spaces).++### `Spaces.resize`++Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+shuts down and boots again from its own disk (a stopped one boots),+so its files stay and its memory and processes do not. Returns once+it is ready again.++<Tabs items={['Python', 'TypeScript', 'Swift', 'Kotlin', 'Rust']} groupId="sdk-lang" persist>+<Tab value="Python">++```python+async def resize(self, space: str, cpus: Optional[int], memory_mb: Optional[int], disk_gb: Optional[int]) -> SpaceResizeReport+```++</Tab>+<Tab value="TypeScript">++```ts+resize(space: string, cpus: number | undefined, memoryMb: bigint | undefined, diskGb: number | undefined, asyncOpts_?: { signal: AbortSignal }): Promise<SpaceResizeReport>+```++</Tab>+<Tab value="Swift">++```swift+func resize(space: String, cpus: UInt32?, memoryMb: UInt64?, diskGb: UInt32?) async throws -> SpaceResizeReport+```++</Tab>+<Tab value="Kotlin">++```kotlin+@Throws(CuaException::class)+suspend fun resize(space: String, cpus: UInt?, memoryMb: ULong?, diskGb: UInt?): SpaceResizeReport+```++</Tab>+<Tab value="Rust">++```rust+pub async fn resize(&self, space: String, cpus: Option<u32>, memory_mb: Option<u64>, disk_gb: Option<u32>) -> Result<SpaceResizeReport, CuaError>+```++</Tab>+</Tabs>++| Parameter | Type | Default |+| --- | --- | --- |+| `space` | `String` | required |+| `cpus` | `Option<u32>` | required |+| `memory_mb` | `Option<u64>` | required |+| `disk_gb` | `Option<u32>` | required |++**Returns** [`SpaceResizeReport`](#spaceresizereport-record) · **Async** · **Raises** [`CuaError`](/cua-sdk/reference/errors)++## `SpaceResizeReport` record++What `Spaces.resize` did: the shape the Space has now.++Returned by [`Spaces.resize`](#spacesresize).++| Field | Type | Default | Description |+| --- | --- | --- | --- |+| `space` | `String` | | The Space. |+| `cpus` | `Option<u32>` | | vCPUs (when changed). |+| `memory_mb` / `memoryMb` | `Option<u64>` | | Memory in MiB (when changed). |+| `disk_gb` / `diskGb` | `Option<u32>` | | Disk in GiB (when grown). |+| `message` | `String` | | What happened, for people. |diff --git a/docs/content/docs/cua-sdk/reference/types.mdx b/docs/content/docs/cua-sdk/reference/types.mdxindex 17fdfa7cd3..8719431f07 100644--- a/docs/content/docs/cua-sdk/reference/types.mdx+++ b/docs/content/docs/cua-sdk/reference/types.mdx@@ -48,7 +48,7 @@ Renamed members: in Kotlin, objects implement `AutoCloseable`, whose `close()` f## All items-310 items. Methods are listed on their object.+311 items. Methods are listed on their object.The 10 items of Batched forks are listed on [its page](/cua-sdk/reference/sandbox/fork-batch#all-items).@@ -299,6 +299,7 @@ The 11 items of Processor, memory and disk are listed on [its page](/cua-sdk/ref| [`SpacePowerReport`](/cua-sdk/reference/spaces#spacepowerreport-record) | record | What `Spaces.stop` or `Spaces.start` did. || [`SpacePresence`](/cua-sdk/reference/spaces/streams#spacepresence) | object | A joined presence session. || [`SpaceRelayRegistration`](/cua-sdk/reference/spaces/space#spacerelayregistration-record) | record | A Space published on the relay (`Spaces.relay_register`). |+| [`SpaceResizeReport`](/cua-sdk/reference/spaces/resize#spaceresizereport-record) | record | What `Spaces.resize` did: the shape the Space has now. || [`Spaces`](/cua-sdk/reference/spaces#spaces) | object | The Spaces registry: add a machine by URL, provision a local one, and get `Space` handles. || [`spaces_tool_methods`](/cua-sdk/reference/spaces#spaces_tool_methods) | function | Which SDK method covers each Spaces contract tool. || [`SpacesdCapabilities`](/cua-sdk/reference/spacesd#spacesdcapabilities-record) | record | `SystemService.GetCapabilities`, summarized. |diff --git a/docs/content/docs/spaces/reference/index.mdx b/docs/content/docs/spaces/reference/index.mdxindex dc1c0f97c4..575e453f26 100644--- a/docs/content/docs/spaces/reference/index.mdx+++ b/docs/content/docs/spaces/reference/index.mdx@@ -10,7 +10,7 @@ description: "Every Spaces tool by category, with parameters, results, errors anVersion: 0.7.0*/}-The Spaces contract: 96 tools with the same names and schemas on every surface: `cua mcp`, `cua daemon mcp` and the Spaces SDKs. Contract 0.7.0, MCP protocol revision 2025-06-18, transports `mcp_stdio` and `mcp_streamable_http`. Experimental: names and shapes can change between minor versions.+The Spaces contract: 97 tools with the same names and schemas on every surface: `cua mcp`, `cua daemon mcp` and the Spaces SDKs. Contract 0.7.0, MCP protocol revision 2025-06-18, transports `mcp_stdio` and `mcp_streamable_http`. Experimental: names and shapes can change between minor versions.## Tools@@ -25,7 +25,8 @@ Register, provision, list and release Spaces.| [`list_spaces`](/spaces/reference/spaces#list_spaces) | List the Spaces this connection can see. | read-only, idempotent || [`create_space`](/spaces/reference/spaces#create_space) | Create a Space: a new sandbox on this computer, on one of your computers, or in the cloud. | destructive || [`delete_space`](/spaces/reference/spaces#delete_space) | Delete a Space's sandbox and forget it. | destructive |-| [`stop_space`](/spaces/reference/spaces#stop_space) | Turn a Space off: suspend it (memory kept) or stop it (disk kept). | mutating, idempotent |+| [`stop_space`](/spaces/reference/spaces#stop_space) | Turn a Space off: stop it (disk kept, memory freed) or, with suspend, suspend it (memory kept). | mutating, idempotent |+| [`resize_space`](/spaces/reference/spaces#resize_space) | Change a Space's vCPUs, memory or disk size. | mutating, idempotent || [`start_space`](/spaces/reference/spaces#start_space) | Turn a Space back on: resume or boot it. | mutating, idempotent |### [Commands and files](/spaces/reference/spaces#commands-and-files)@@ -270,7 +271,7 @@ An argument is missing, malformed or out of range.Fix: Check the call against the tool's input schema; the message names the argument.-Listed by [`volume_storage_set`](/spaces/reference/agents#volume_storage_set), [`volume_cache_set`](/spaces/reference/agents#volume_cache_set), [`relay_unregister_space`](/spaces/reference/spaces#relay_unregister_space), [`cloud_add_host`](/spaces/reference/spaces#cloud_add_host), [`cloud_budget`](/spaces/reference/spaces#cloud_budget), [`prewarm`](/spaces/reference/spaces#prewarm).+Listed by [`resize_space`](/spaces/reference/spaces#resize_space), [`volume_storage_set`](/spaces/reference/agents#volume_storage_set), [`volume_cache_set`](/spaces/reference/agents#volume_cache_set), [`relay_unregister_space`](/spaces/reference/spaces#relay_unregister_space), [`cloud_add_host`](/spaces/reference/spaces#cloud_add_host), [`cloud_budget`](/spaces/reference/spaces#cloud_budget), [`prewarm`](/spaces/reference/spaces#prewarm).#### not_found@@ -304,7 +305,7 @@ The operation does not apply to this kind of Space.Fix: Use a tool that serves the Space's provider (see the tool's `providers`).-Listed by [`stop_space`](/spaces/reference/spaces#stop_space), [`start_space`](/spaces/reference/spaces#start_space).+Listed by [`stop_space`](/spaces/reference/spaces#stop_space), [`resize_space`](/spaces/reference/spaces#resize_space), [`start_space`](/spaces/reference/spaces#start_space).#### unauthenticated@@ -388,7 +389,7 @@ A wait ran out: a claim that never bound, a Space that never became ready, or aFix: Retry, or raise the tool's timeout.-Listed by [`create_space`](/spaces/reference/spaces#create_space), [`start_space`](/spaces/reference/spaces#start_space), [`space_bash`](/spaces/reference/spaces#space_bash).+Listed by [`create_space`](/spaces/reference/spaces#create_space), [`resize_space`](/spaces/reference/spaces#resize_space), [`start_space`](/spaces/reference/spaces#start_space), [`space_bash`](/spaces/reference/spaces#space_bash).#### cancelled@@ -424,7 +425,7 @@ Starting, stopping or deleting the Space's sandbox failed.Fix: Check the local runtime (`cua doctor`) or the cloud pool, then retry.-Listed by [`create_space`](/spaces/reference/spaces#create_space), [`delete_space`](/spaces/reference/spaces#delete_space), [`stop_space`](/spaces/reference/spaces#stop_space), [`start_space`](/spaces/reference/spaces#start_space), [`agent_pause`](/spaces/reference/agents#agent_pause), [`agent_resume`](/spaces/reference/agents#agent_resume).+Listed by [`create_space`](/spaces/reference/spaces#create_space), [`delete_space`](/spaces/reference/spaces#delete_space), [`stop_space`](/spaces/reference/spaces#stop_space), [`resize_space`](/spaces/reference/spaces#resize_space), [`start_space`](/spaces/reference/spaces#start_space), [`agent_pause`](/spaces/reference/agents#agent_pause), [`agent_resume`](/spaces/reference/agents#agent_resume).#### clouddiff --git a/docs/content/docs/spaces/reference/spaces.mdx b/docs/content/docs/spaces/reference/spaces.mdxindex 5612701029..f140769d5f 100644--- a/docs/content/docs/spaces/reference/spaces.mdx+++ b/docs/content/docs/spaces/reference/spaces.mdx@@ -21,7 +21,8 @@ Register, provision, list and release Spaces.| [`list_spaces`](#list_spaces) | List the Spaces this connection can see. || [`create_space`](#create_space) | Create a Space: a new sandbox on this computer, on one of your computers, or in the cloud. || [`delete_space`](#delete_space) | Delete a Space's sandbox and forget it. |-| [`stop_space`](#stop_space) | Turn a Space off: suspend it (memory kept) or stop it (disk kept). |+| [`stop_space`](#stop_space) | Turn a Space off: stop it (disk kept, memory freed) or, with suspend, suspend it (memory kept). |+| [`resize_space`](#resize_space) | Change a Space's vCPUs, memory or disk size. || [`start_space`](#start_space) | Turn a Space back on: resume or boot it. |### add_space@@ -194,9 +195,9 @@ Text: what was deleted (`Deleted <id> (...)`), or `Removed <id> (...)` for a Spa### stop_space-Turn a Space off: suspend it (memory kept) or stop it (disk kept).+Turn a Space off: stop it (disk kept, memory freed) or, with suspend, suspend it (memory kept).-Turns a Space off the way its provider can: a local container or QEMU VM is suspended (its memory is kept and it resumes where it was), a local Lume VM is stopped (its disk is kept and it boots again), a Space one of your computers provides is stopped by that computer, which frees its memory, and a Space in your own cloud (on="aws", "gcp") is stopped there: compute billing stops, its disk stays (storage is still billed); a Hetzner server (on="hetzner") is stopped too, but Hetzner keeps billing a stopped server, so delete it to stop the charge. Anything streaming from the Space and any hotspot on it end first. A Modal sandbox, a Space added by address and your own computers on the relay cannot be turned off (wrong_provider); delete_space deletes a Space instead. start_space turns it on again.+Turns a Space off the way its provider can. By default it stops: a local VM (QEMU or Lume) shuts down with its disk kept and gives its memory back to the machine, a local container stops or is suspended as its runtime can, a Space one of your computers provides is stopped by that computer, and a Space in your own cloud (on="aws", "gcp") is stopped there: compute billing stops, its disk stays (storage is still billed); a Hetzner server (on="hetzner") is stopped too, but Hetzner keeps billing a stopped server, so delete it to stop the charge. suspend=true suspends a local container or QEMU VM instead: its memory is kept (so it still uses it) and it resumes where it was. Anything streaming from the Space and any hotspot on it end first. A Modal sandbox, a Space added by address and your own computers on the relay cannot be turned off (wrong_provider); delete_space deletes a Space instead. start_space turns it on again.| | || --- | --- |@@ -212,6 +213,7 @@ Turns a Space off the way its provider can: a local container or QEMU VM is susp| Parameter | Type | Default | Description || --- | --- | --- | --- || `space` | `string` | required | Space id or name. |+| `suspend` | `boolean` | `false` | Suspend it instead: keep its memory so it resumes where it was (a local container or QEMU VM). Default false: stop it, keeping its disk and giving its memory back to the machine. |#### Result@@ -225,6 +227,38 @@ JSON: `space`, `state` (`suspended` or `stopped`), `power` (`suspend` or `stop`)- list_spaces says which Spaces turn off (`power`: `suspend` or `stop`; absent when it cannot) and how they were left (`power_state`).+### resize_space++Change a Space's vCPUs, memory or disk size.++Gives a local VM Space (QEMU) another shape: `cpus` vCPUs, `memory_mb` MiB of memory, a disk grown to `disk_gb` GiB; what you leave out stays. The VM shuts down and boots again from its own disk, so its files stay but its memory and running processes do not; a stopped one boots. A disk never shrinks. Returns once it is ready again. Containers, Lume VMs and Spaces on other computers are refused (wrong_provider).++| | |+| --- | --- |+| Providers | all (cloud, local, direct, relay) |+| Platforms | all (macos, windows, linux) |+| Metering | free |+| Approval | permission `spaces:resize_space`; mutating, idempotent |+| Swift SDK | `Spaces.resize(space, cpus, memory_mb, disk_gb)` |+| Rust | `Spaces::resize` |++#### Parameters++| Parameter | Type | Default | Description |+| --- | --- | --- | --- |+| `cpus` | `integer` | none | vCPUs. At least 0. |+| `disk_gb` | `integer` | none | Grow the disk to this many GiB (a disk never shrinks). At least 0. |+| `memory_mb` | `integer` | none | Memory in MiB. At least 0. |+| `space` | `string` | required | Space id or name. |++#### Result++JSON: `space`, `cpus`, `memory_mb`, `disk_gb` (what it has now) and `message`.++#### Errors++[`invalid_argument`](/spaces/reference#invalid_argument), [`not_found`](/spaces/reference#not_found), [`ambiguous_sandbox`](/spaces/reference#ambiguous_sandbox), [`wrong_provider`](/spaces/reference#wrong_provider), [`sandbox`](/spaces/reference#sandbox), [`timeout`](/spaces/reference#timeout)+### start_spaceTurn a Space back on: resume or boot it.diff --git a/libs/cua/crates/cua-cli/src/host.rs b/libs/cua/crates/cua-cli/src/host.rsindex a0be422364..377f368e44 100644--- a/libs/cua/crates/cua-cli/src/host.rs+++ b/libs/cua/crates/cua-cli/src/host.rs@@ -521,11 +521,13 @@ Examples:#[arg(long, short)]force: bool,},- /// Turn a Space off: a local container or QEMU VM is suspended (its- /// memory is kept), a Lume VM or a Space one of your computers provides- /// is stopped (its disk is kept), and so is a Space in your own cloud- /// (`--on aws`, `gcp`: compute billing stops; `hetzner`: still billed).- /// Modal sandboxes and Spaces added by address cannot be turned off.+ /// Turn a Space off: a local VM (QEMU or Lume) or a Space one of your+ /// computers provides is stopped, keeping its disk and freeing its+ /// memory, and so is a Space in your own cloud (`--on aws`, `gcp`:+ /// compute billing stops; `hetzner`: still billed). A local container+ /// is stopped or suspended as its runtime can. `cua spaces suspend`+ /// keeps a local Space's memory instead. Modal sandboxes and Spaces+ /// added by address cannot be turned off.#[command(after_help = "Examples:cua spaces stop local:studiocua spaces stop relay:space-0123456789abcdef --json")]@@ -533,6 +535,35 @@ Examples:/// Space id or name.space: String,},+ /// Suspend a local Space (a container or QEMU VM): its memory is kept,+ /// and stays in use, so it resumes where it was with `cua spaces+ /// start`. `cua spaces stop` frees the memory instead.+ #[command(after_help = "Examples:+ cua spaces suspend local:studio")]+ Suspend {+ /// Space id or name.+ space: String,+ },+ /// Give a local VM Space more or fewer vCPUs, more or less memory, or a+ /// bigger disk. It shuts down and boots again from its own disk (a+ /// stopped one boots): its files stay, its running processes do not. A+ /// disk never shrinks.+ #[command(after_help = "Examples:+ cua spaces resize local:builder --memory-mb 24576+ cua spaces resize builder --cpus 8 --disk-gb 200 --json")]+ Resize {+ /// Space id or name.+ space: String,+ /// vCPUs.+ #[arg(long)]+ cpus: Option<u32>,+ /// Memory in MiB.+ #[arg(long)]+ memory_mb: Option<u64>,+ /// Grow the disk to this many GiB.+ #[arg(long)]+ disk_gb: Option<u32>,+ },/// Turn a Space back on: resume a suspended one or boot a stopped one.#[command(after_help = "Examples:cua spaces start local:studio@@ -970,6 +1001,25 @@ pub async fn run_spaces_sdk(}}SpacesCmd::Stop { space } => power_line(spaces.stop(space).await?, json, out),+ SpacesCmd::Suspend { space } => power_line(spaces.suspend(space).await?, json, out),+ SpacesCmd::Resize {+ space,+ cpus,+ memory_mb,+ disk_gb,+ } => {+ let r = spaces.resize(space, cpus, memory_mb, disk_gb).await?;+ if json {+ line(+ out,+ serde_json::json!({"space": r.space, "cpus": r.cpus,+ "memory_mb": r.memory_mb, "disk_gb": r.disk_gb, "message": r.message})+ .to_string(),+ );+ } else {+ line(out, r.message);+ }+ }SpacesCmd::Start { space } => power_line(spaces.start(space).await?, json, out),SpacesCmd::Prewarm {image,diff --git a/libs/cua/crates/cua-cli/src/lib.rs b/libs/cua/crates/cua-cli/src/lib.rsindex 4ed4731b1a..c1eeee2dad 100644--- a/libs/cua/crates/cua-cli/src/lib.rs+++ b/libs/cua/crates/cua-cli/src/lib.rs@@ -1725,6 +1725,8 @@ async fn run(cli: Cli, out: &mut dyn Write) -> Result<i32, CuaError> {| host::SpacesCmd::Gpus { .. }| host::SpacesCmd::Delete { .. }| host::SpacesCmd::Stop { .. }+ | host::SpacesCmd::Suspend { .. }+ | host::SpacesCmd::Resize { .. }| host::SpacesCmd::Start { .. }| host::SpacesCmd::Egress { .. }| host::SpacesCmd::Prewarm { .. }diff --git a/libs/cua/crates/cua-cli/src/mcp.rs b/libs/cua/crates/cua-cli/src/mcp.rsindex d15d3647c1..a87da7b6d8 100644--- a/libs/cua/crates/cua-cli/src/mcp.rs+++ b/libs/cua/crates/cua-cli/src/mcp.rs@@ -1681,7 +1681,9 @@ fn tool_budget(tool: &str, arguments: &Value, env: Option<&str>) -> Duration {}let base = match tool {// A macOS image pull is ~25 GB before readiness starts counting.- "create_space" | "start_space" | "sandbox_create" | "sandbox_start" => 2 * 3600,+ "create_space" | "start_space" | "resize_space" | "sandbox_create" | "sandbox_start" => {+ 2 * 3600+ }"upload"| "send_file"| "download"diff --git a/libs/cua/crates/cua-cli/tests/spaces_power.rs b/libs/cua/crates/cua-cli/tests/spaces_power.rsnew file mode 100644index 0000000000..d6b7181572--- /dev/null+++ b/libs/cua/crates/cua-cli/tests/spaces_power.rs@@ -0,0 +1,33 @@+//! `cua spaces suspend` and `cua spaces resize` reach the Spaces runtime:+//! an unknown Space is reported as unknown (not refused as a command the+//! CLI cannot run). Everything runs in a temp home with no daemon.++mod common;++use common::Home;++#[tokio::test]+async fn suspend_and_resize_name_the_unknown_space() {+ let h = Home::new();+ for args in [+ vec!["--embedded", "spaces", "suspend", "local:nope"],+ vec![+ "--embedded",+ "spaces",+ "resize",+ "local:nope",+ "--memory-mb",+ "2048",+ ],+ ] {+ let o = h.run(&args).await;+ assert_ne!(o.code, 0, "{o:?}");+ assert!(!o.stderr.contains("only `cua spaces ls`"), "{o:?}");+ assert!(o.stderr.contains("nope"), "{o:?}");+ }+ // A resize says what to change.+ let o = h+ .run(&["--embedded", "spaces", "resize", "local:nope"])+ .await;+ assert_ne!(o.code, 0, "{o:?}");+}diff --git a/libs/cua/crates/cua-daemon/src/local.rs b/libs/cua/crates/cua-daemon/src/local.rsindex 3d635a5c17..f2802af51b 100644--- a/libs/cua/crates/cua-daemon/src/local.rs+++ b/libs/cua/crates/cua-daemon/src/local.rs@@ -1987,18 +1987,9 @@ impl LocalRuntime for VmmLocal {}async fn resume(&self, name: &str) -> RuntimeResult<LocalInstance> {- let (kind, rt) = self.owner(name).await?;- // QEMU resumes a paused VM over QMP; a stopped one has no process- // to resume and no start spec to boot from.- if kind == BackendKind::Qemu && rt.status(name).await.map_err(rt_err)? == Status::Stopped {- return Err(RuntimeError::Unsupported {- backend: "qemu".into(),- op: format!(- "starting {name} again: a QEMU VM resumes from suspend only, and this one \- was stopped (its disk is kept; delete it and create a new one)"- ),- });- }+ // A paused QEMU VM runs again over QMP; a stopped one boots again+ // from its own disk (`QemuRuntime::resume`).+ let (_, rt) = self.owner(name).await?;let inst = rt.resume(name).await.map_err(rt_err)?;Ok(LocalInstance {backend: runtime_label(&inst),@@ -2019,19 +2010,22 @@ impl LocalRuntime for VmmLocal {})}- /// Containers pause in memory (`docker pause`) and QEMU VMs pause over- /// QMP; Lume has no pause, so a Lume VM stops and boots again. On the+ /// Containers pause in memory (`docker pause`). VMs stop and boot again+ /// from their disk: turning a VM off gives its memory back to the+ /// machine (a paused QEMU VM would keep all of it; `Sandboxes::suspend`+ /// still pauses one when asked), and Lume has no pause at all. On the/// built-in Linux runtime containers stop too, so its VM can stop once/// no Linux Space runs (a paused one would hold it up).fn power_control(&self, runtime_type: &str) -> Option<cua_sandbox_core::PowerControl> {use cua_sandbox_core::PowerControl;match runtime_type.trim().to_ascii_lowercase().as_str() {- // Neither has a pause: the VM stops and boots again.- "lume" | "containerization" => Some(PowerControl::Stop),+ // The VM stops (its memory goes back to the machine) and boots+ // again from its disk.+ "lume" | "containerization" | "qemu" => Some(PowerControl::Stop),"gvisor" | "runsc" | "runc" | "container" | "docker" if managed::in_use() => {Some(PowerControl::Stop)}- "gvisor" | "runsc" | "runc" | "container" | "docker" | "qemu-docker" | "qemu"+ "gvisor" | "runsc" | "runc" | "container" | "docker" | "qemu-docker"| "firecracker" | "vz" => Some(PowerControl::Suspend),_ => None,}@@ -3217,6 +3211,23 @@ mod tests {assert!(local.fork_has_own_identity("qemu"));}+ /// Turning a VM off frees its memory: QEMU and Lume VMs stop (their+ /// disk is kept) and boot again; containers still pause.+ #[test]+ fn vms_stop_and_free_their_memory_containers_pause() {+ use cua_sandbox_core::{LocalRuntime, PowerControl};+ let local = VmmLocal::default();+ assert_eq!(local.power_control("qemu"), Some(PowerControl::Stop));+ assert_eq!(local.power_control("lume"), Some(PowerControl::Stop));+ if !managed::in_use() {+ assert_eq!(local.power_control("gvisor"), Some(PowerControl::Suspend));+ }+ assert_eq!(+ local.power_control("firecracker"),+ Some(PowerControl::Suspend)+ );+ }+/// A Mac's microVMs under cua-vz: found by their label, paused when/// idle (in memory, like Firecracker's), and a fork restored from/// memory gets its own identity from the guest init.diff --git a/libs/cua/crates/cua-daemon/tests/build_qemu.rs b/libs/cua/crates/cua-daemon/tests/build_qemu.rsindex ab035c6273..c1200320eb 100644--- a/libs/cua/crates/cua-daemon/tests/build_qemu.rs+++ b/libs/cua/crates/cua-daemon/tests/build_qemu.rs@@ -126,6 +126,43 @@ async fn builds_caches_forks_and_fails_cleanly() {assert_eq!(lines[6], "cua");spaces.delete(&created.id).await.unwrap();+ // A Space from the tag with its own size: more memory and a bigger+ // disk than the build's machine, and still every build step's files.+ let sized = spaces+ .create(cua_spaces::SpaceCreate {+ image: Some(format!("build:{tag}")),+ name: Some(format!("{tag}-big")),+ cpus: Some(3),+ memory_mb: Some(3072),+ disk_gb: Some(40),+ ..Default::default()+ })+ .await+ .unwrap()+ .ready()+ .unwrap();+ let space = spaces.space(&sized.id).await.unwrap();+ let out = space+ .bash(+ "nproc; awk '/MemTotal/{print $2}' /proc/meminfo; df -BG --output=size / | tail -1; cat /srv/app/hello.txt",+ Duration::from_secs(60),+ )+ .await+ .unwrap();+ assert!(out.success(), "{}", out.render());+ let lines: Vec<&str> = out.stdout.lines().map(str::trim).collect();+ assert_eq!(lines[0], "3", "{}", out.stdout);+ let kib: u64 = lines[1].parse().unwrap();+ assert!((2_700_000..=3_200_000).contains(&kib), "{}", out.stdout);+ let disk: u64 = lines[2].trim_end_matches('G').parse().unwrap();+ assert!(disk >= 35, "{}", out.stdout);+ assert!(+ !lines[3].is_empty(),+ "the build's files are kept: {}",+ out.stdout+ );+ spaces.delete(&sized.id).await.unwrap();+// A changed context file rebuilds the COPY and what follows only.std::fs::write(ctx.path().join("hello.txt"), "changed\n").unwrap();let changed = spacesdiff --git a/libs/cua/crates/cua-sdk/src/native/spaces.rs b/libs/cua/crates/cua-sdk/src/native/spaces.rsindex 6deaf0b082..ece2ae0f23 100644--- a/libs/cua/crates/cua-sdk/src/native/spaces.rs+++ b/libs/cua/crates/cua-sdk/src/native/spaces.rs@@ -39,6 +39,7 @@ pub const SPACES_TOOL_METHODS: &[(&str, &str)] = &[("delete_space", "Spaces.delete"),("stop_space", "Spaces.stop"),("start_space", "Spaces.start"),+ ("resize_space", "Spaces.resize"),("space_bash", "Space.bash"),("space_write", "Space.write"),("upload", "Space.upload"),@@ -2025,14 +2026,33 @@ pub struct SpacePowerReport {pub space: String,/// `running`, `suspended` or `stopped`: the state it is in now.pub state: String,- /// How it turns off: `suspend` (its memory is kept) or `stop` (its- /// disk is kept).+ /// How it was turned off: `suspend` (its memory is kept, and still in+ /// use) or `stop` (its disk is kept; its memory is freed).pub power: String,/// What happened, for people.#[serde(default)]pub message: String,}+/// What [`Spaces::resize`] did: the shape the Space has now.+#[derive(Debug, Clone, PartialEq, Eq, uniffi::Record, Deserialize)]+pub struct SpaceResizeReport {+ /// The Space.+ pub space: String,+ /// vCPUs (when changed).+ #[serde(default)]+ pub cpus: Option<u32>,+ /// Memory in MiB (when changed).+ #[serde(default)]+ pub memory_mb: Option<u64>,+ /// Disk in GiB (when grown).+ #[serde(default)]+ pub disk_gb: Option<u32>,+ /// What happened, for people.+ #[serde(default)]+ pub message: String,+}+/// Result of [`Space::agent_start`].#[derive(Debug, Clone, PartialEq, Eq, uniffi::Record)]pub struct AgentStartReport {@@ -3692,10 +3712,12 @@ impl Spaces {}/// Turns a Space off the way its provider can (`SpaceInfo.power`):- /// suspends it, keeping its memory (a local container or QEMU VM), or- /// stops it, keeping its disk (a local Lume VM; a Space one of your- /// machines provides, which that machine stops). A cloud Space, a Space- /// added by address and your own computers cannot be turned off.+ /// stops it, keeping its disk and freeing its memory (a local VM; a+ /// Space one of your machines provides, which that machine stops), or+ /// suspends it, keeping its memory (a local container that cannot+ /// stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ /// purpose. A Space added by address and your own computers cannot be+ /// turned off.pub async fn stop(&self, space: String) -> Result<SpacePowerReport> {let host = self.host.clone();run(async move {@@ -3707,6 +3729,45 @@ impl Spaces {.await}+ /// Suspends a local Space (a container or a QEMU VM), keeping its+ /// memory: it resumes where it was, and its memory stays in use until+ /// then. [`Spaces::stop`] stops it instead and frees its memory.+ pub async fn suspend(&self, space: String) -> Result<SpacePowerReport> {+ let host = self.host.clone();+ run(async move {+ parse(+ host.tool_value("stop_space", json!({"space": space, "suspend": true}))+ .await?,+ )+ })+ .await+ }++ /// Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ /// of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ /// shuts down and boots again from its own disk (a stopped one boots),+ /// so its files stay and its memory and processes do not. Returns once+ /// it is ready again.+ pub async fn resize(+ &self,+ space: String,+ cpus: Option<u32>,+ memory_mb: Option<u64>,+ disk_gb: Option<u32>,+ ) -> Result<SpaceResizeReport> {+ let host = self.host.clone();+ run(async move {+ parse(+ host.tool_value(+ "resize_space",+ json!({"space": space, "cpus": cpus, "memory_mb": memory_mb, "disk_gb": disk_gb}),+ )+ .await?,+ )+ })+ .await+ }+/// Turns a Space on again: resumes a suspended one, boots a stopped one/// (a Space one of your machines provides joins the relay again), and/// leaves a running one as it is. Returns once it answers (bounded).diff --git a/libs/cua/crates/cua-spaces-contract/src/inputs.rs b/libs/cua/crates/cua-spaces-contract/src/inputs.rsindex e6864a55fe..f34b6c4e43 100644--- a/libs/cua/crates/cua-spaces-contract/src/inputs.rs+++ b/libs/cua/crates/cua-spaces-contract/src/inputs.rs@@ -220,6 +220,35 @@ pub struct SpaceOnly {pub space: SpaceArg,}+/// `stop_space`: turn a Space off.+#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]+pub struct StopSpace {+ /// Space id or name.+ pub space: SpaceArg,+ /// Suspend it instead: keep its memory so it resumes where it was (a+ /// local container or QEMU VM). Default false: stop it, keeping its+ /// disk and giving its memory back to the machine.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub suspend: Option<bool>,+}++/// `resize_space`: give a Space more or fewer vCPUs, more or less memory,+/// or a bigger disk.+#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]+pub struct ResizeSpace {+ /// Space id or name.+ pub space: SpaceArg,+ /// vCPUs.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub cpus: Option<u32>,+ /// Memory in MiB.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub memory_mb: Option<u64>,+ /// Grow the disk to this many GiB (a disk never shrinks).+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub disk_gb: Option<u32>,+}+/// `space_bash`: run a shell command inside the Space.#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]pub struct SpaceBash {diff --git a/libs/cua/crates/cua-spaces-contract/src/lib.rs b/libs/cua/crates/cua-spaces-contract/src/lib.rsindex 585097c0af..182481a483 100644--- a/libs/cua/crates/cua-spaces-contract/src/lib.rs+++ b/libs/cua/crates/cua-spaces-contract/src/lib.rs@@ -613,7 +613,7 @@ const AGENT_EVENTS_INSTRUCTIONS: &str = "Normalized events (install, session, tuconst PERSISTENT_INSTRUCTIONS: &str = "A persistent agent is a harness with a name, a Space and a home in the Cua Volume (agents/<name>/). Its harness keeps its memory in the home (Claude Code auto memory, Codex memories, Hermes MEMORY.md, the OpenClaw workspace), which is restored into the Space before each run and saved after each turn, so the agent remembers across runs, Space releases and computers. One run writes a home at a time. Start it with persistent_agent_send (or agent_start with home=<name>); the daemon notifies the user when a turn ends. Inside the Space the agent gets the `cua` bridge: notify_user, the drive, and the user's computers it was granted.";-const POWER_INSTRUCTIONS: &str = "Turns a Space off the way its provider can: a local container or QEMU VM is suspended (its memory is kept and it resumes where it was), a local Lume VM is stopped (its disk is kept and it boots again), a Space one of your computers provides is stopped by that computer, which frees its memory, and a Space in your own cloud (on=\"aws\", \"gcp\") is stopped there: compute billing stops, its disk stays (storage is still billed); a Hetzner server (on=\"hetzner\") is stopped too, but Hetzner keeps billing a stopped server, so delete it to stop the charge. Anything streaming from the Space and any hotspot on it end first. A Modal sandbox, a Space added by address and your own computers on the relay cannot be turned off (wrong_provider); delete_space deletes a Space instead. start_space turns it on again.";+const POWER_INSTRUCTIONS: &str = "Turns a Space off the way its provider can. By default it stops: a local VM (QEMU or Lume) shuts down with its disk kept and gives its memory back to the machine, a local container stops or is suspended as its runtime can, a Space one of your computers provides is stopped by that computer, and a Space in your own cloud (on=\"aws\", \"gcp\") is stopped there: compute billing stops, its disk stays (storage is still billed); a Hetzner server (on=\"hetzner\") is stopped too, but Hetzner keeps billing a stopped server, so delete it to stop the charge. suspend=true suspends a local container or QEMU VM instead: its memory is kept (so it still uses it) and it resumes where it was. Anything streaming from the Space and any hotspot on it end first. A Modal sandbox, a Space added by address and your own computers on the relay cannot be turned off (wrong_provider); delete_space deletes a Space instead. start_space turns it on again.";const PAUSE_INSTRUCTIONS: &str = "One call: stops the run, saves the home, releases the home's lease, keeps the agent's routines from firing, and suspends its Space when it is local. A cloud Space cannot be suspended, so pausing releases it after the home is saved; agent_resume creates it again from the same image and restores the home. Apps open in a released cloud Space do not come back. The user's own computers are never suspended.";@@ -711,9 +711,21 @@ pub fn tools() -> Vec<Tool> {sdk_symbol: "Spaces.stop(space)",rust_symbol: "Spaces::stop",notes: &["list_spaces says which Spaces turn off (`power`: `suspend` or `stop`; absent when it cannot) and how they were left (`power_state`)."],- ..Spec::new("stop_space", "Turn a Space off: suspend it (memory kept) or stop it (disk kept).")+ ..Spec::new("stop_space", "Turn a Space off: stop it (disk kept, memory freed) or, with suspend, suspend it (memory kept).")}- .with::<i::SpaceOnly>(),+ .with::<i::StopSpace>(),+ Spec {+ category: Category::Lifecycle,+ result: "JSON: `space`, `cpus`, `memory_mb`, `disk_gb` (what it has now) and `message`.",+ errors: &["wrong_provider", "sandbox", "invalid_argument", "timeout"],+ instructions: "Gives a local VM Space (QEMU) another shape: `cpus` vCPUs, `memory_mb` MiB of memory, a disk grown to `disk_gb` GiB; what you leave out stays. The VM shuts down and boots again from its own disk, so its files stay but its memory and running processes do not; a stopped one boots. A disk never shrinks. Returns once it is ready again. Containers, Lume VMs and Spaces on other computers are refused (wrong_provider).",+ capabilities: &["space.power"],+ annotations: Annotations::mutating_idempotent(),+ sdk_symbol: "Spaces.resize(space, cpus, memory_mb, disk_gb)",+ rust_symbol: "Spaces::resize",+ ..Spec::new("resize_space", "Change a Space's vCPUs, memory or disk size.")+ }+ .with::<i::ResizeSpace>(),Spec {category: Category::Lifecycle,result: "JSON: `space`, `state` (`running`), `power` (`suspend` or `stop`) and `message`.",@@ -1897,7 +1909,7 @@ mod tests {#[test]fn advertises_every_tool() {- assert_eq!(tools().len(), 96);+ assert_eq!(tools().len(), 97);}#[test]@@ -1984,6 +1996,7 @@ mod tests {"delete_space","stop_space","start_space",+ "resize_space","add_space","remove_space","list_spaces",diff --git a/libs/cua/crates/cua-spaces/src/build/host.rs b/libs/cua/crates/cua-spaces/src/build/host.rsindex 5f2834cf03..9e294cfd76 100644--- a/libs/cua/crates/cua-spaces/src/build/host.rs+++ b/libs/cua/crates/cua-spaces/src/build/host.rs@@ -396,8 +396,11 @@ impl Spaces {/// A Space made from a build: a fork of the build's checkpoint with the/// image's environment, working directory and user (`image` is- /// `build:<tag, key or checkpoint>`). The machine is the build's, so- /// options that would resize or reshape it are refused.+ /// `build:<tag, key or checkpoint>`). The machine is the build's: a VM+ /// fork given other vCPUs, memory or a bigger disk is resized right+ /// after the fork (it boots again from its own disk, which has every+ /// build step on it); options that would reshape it otherwise are+ /// refused.pub(crate) async fn create_from_build(&self,reference: &str,@@ -415,15 +418,12 @@ impl Spaces {opts.on.as_ref().map(|o| o.to_string()).unwrap_or_default())));}- if opts.cpus.is_some() {- return refuse("cpus");- }- if opts.memory_mb.is_some() {- return refuse("memory");- }- if opts.disk_gb.is_some() {- return refuse("disk_gb");- }+ let reshape = cua_sandbox_core::Resize {+ cpus: opts.cpus,+ memory_mb: opts.memory_mb,+ disk_gb: opts.disk_gb,+ probes: Vec::new(),+ };if opts.gpu.is_some() {return refuse("gpu");}@@ -448,6 +448,30 @@ impl Spaces {let create = async {report(Progress::phase(Phase::Creating));let info = self.fork_local(&checkpoint, opts.name.clone()).await?;+ if !reshape.is_empty() {+ let name = info+ .id+ .strip_prefix("local:")+ .unwrap_or(&info.id)+ .to_string();+ let sized = async {+ let runtime = self.sandboxes().get(&name).await?.runtime_type;+ if runtime != "qemu" {+ return Err(Error::invalid(format!(+ "cpus, memory and disk_gb of a Space made from a build need a VM build \+ (this one runs on {runtime}); set them when you build instead"+ )));+ }+ self.sandboxes().resize(&name, &reshape).await?;+ Ok(())+ }+ .await;+ if let Err(e) = sized {+ // Nothing half-made stays behind.+ let _ = self.delete(&info.id).await;+ return Err(e);+ }+ }let mut config = self.build_config(reference).unwrap_or_default();// `env` of the create is the Space's environment, over the image's.config.env.extend(opts.env.clone());diff --git a/libs/cua/crates/cua-spaces/src/client/control.rs b/libs/cua/crates/cua-spaces/src/client/control.rsindex 54a4d068d2..c7f13117c0 100644--- a/libs/cua/crates/cua-spaces/src/client/control.rs+++ b/libs/cua/crates/cua-spaces/src/client/control.rs@@ -638,12 +638,35 @@ impl Space {self.connection.delete_space(&self.info.id)}- /// `stop_space`: turns this Space off (suspended or stopped, as its- /// provider can). Returns `space`, `state`, `power` and `message`.+ /// `stop_space`: turns this Space off (stopped, its memory freed, or+ /// suspended where its provider cannot stop it). Returns `space`,+ /// `state`, `power` and `message`.pub fn stop(&self) -> Result<Map<String, Value>> {self.call_object("stop_space", self.arguments(json!({})))}+ /// `stop_space` with `suspend`: suspends this Space, keeping its+ /// memory (a local container or QEMU VM).+ pub fn suspend(&self) -> Result<Map<String, Value>> {+ self.call_object("stop_space", self.arguments(json!({ "suspend": true })))+ }++ /// `resize_space`: gives this local VM Space `cpus` vCPUs, `memory_mb`+ /// MiB of memory or a disk grown to `disk_gb` GiB; it boots again from+ /// its own disk. Returns `space`, `cpus`, `memory_mb`, `disk_gb` and+ /// `message`.+ pub fn resize(+ &self,+ cpus: Option<u32>,+ memory_mb: Option<u64>,+ disk_gb: Option<u32>,+ ) -> Result<Map<String, Value>> {+ self.call_object(+ "resize_space",+ self.arguments(json!({ "cpus": cpus, "memory_mb": memory_mb, "disk_gb": disk_gb })),+ )+ }+/// `start_space`: turns this Space on again (resumed or booted).pub fn start(&self) -> Result<Map<String, Value>> {self.call_object("start_space", self.arguments(json!({})))diff --git a/libs/cua/crates/cua-spaces/src/client/coverage.rs b/libs/cua/crates/cua-spaces/src/client/coverage.rsindex 63b64eafa5..ff6e6e9529 100644--- a/libs/cua/crates/cua-spaces/src/client/coverage.rs+++ b/libs/cua/crates/cua-spaces/src/client/coverage.rs@@ -23,7 +23,7 @@ pub struct ToolCoverage {}/// tool name → the typed Rust path that reaches it.-const SYMBOLS: [(&str, &str); 96] = [+const SYMBOLS: [(&str, &str); 97] = [("add_space", "Connection::add_space"),("remove_space", "Connection::remove_space"),("list_spaces", "Connection::spaces"),@@ -31,6 +31,7 @@ const SYMBOLS: [(&str, &str); 96] = [("delete_space", "Space::delete"),("stop_space", "Space::stop"),("start_space", "Space::start"),+ ("resize_space", "Space::resize"),("space_bash", "Space::bash"),("space_write", "Space::write_text"),("upload", "Space::upload"),diff --git a/libs/cua/crates/cua-spaces/src/host_spaces.rs b/libs/cua/crates/cua-spaces/src/host_spaces.rsindex 81c86f80d0..40dbca220d 100644--- a/libs/cua/crates/cua-spaces/src/host_spaces.rs+++ b/libs/cua/crates/cua-spaces/src/host_spaces.rs@@ -2004,9 +2004,8 @@ impl HostSpacesServer {}/// `SetHostSpacePower`: turns a Space this host provides off or on.- /// Off stops it with its disk kept, so it frees the host's memory (a- /// QEMU VM, which cannot boot again from its state, is suspended- /// instead); on boots it again and attaches it to its relay machine+ /// Off stops it with its disk kept, so it frees the host's memory; on+ /// boots it again and attaches it to its relay machine/// again, with the machine token the host keeps. The owner powers any;/// another account only the ones it created.pub async fn set_power(@@ -2047,7 +2046,7 @@ impl HostSpacesServer {)));};let sandboxes = self.spaces.sandboxes();- let Some(own) = sandboxes.power_control(name) else {+ if sandboxes.power_control(name).is_none() {// The core's refusal names the runtime that cannot.let e = sandboxes.power_off(name)@@ -2056,11 +2055,8 @@ impl HostSpacesServer {.map(Error::from).unwrap_or_else(|| Error::invalid("no power control"));return Err(self.refuse(caller, &space, e));- };- let control = match sandboxes.get(name).await.map(|i| i.runtime_type) {- Ok(runtime) if runtime == "qemu" => own,- _ => cua_sandbox_core::PowerControl::Stop,- };+ }+ let control = cua_sandbox_core::PowerControl::Stop;self.spaces.drop_connection(&id).await;let label = record.label();// What the audit names it by: its relay machine, or for a directdiff --git a/libs/cua/crates/cua-spaces/src/lib.rs b/libs/cua/crates/cua-spaces/src/lib.rsindex 3772eb4806..0d6bbccef6 100644--- a/libs/cua/crates/cua-spaces/src/lib.rs+++ b/libs/cua/crates/cua-spaces/src/lib.rs@@ -143,7 +143,9 @@ pub use id::{Provider, SpaceId};pub use listing::{LIST_WAIT, ListProgress, SpaceListing};pub use relay::{RelayAccount, RelayMachine};pub use route::{ChannelRoute, Transport};-pub use space::{SPACESD_FEATURE, ServiceSource, Space, SpaceInfo, SpacePower, SpaceService};+pub use space::{+ SPACESD_FEATURE, ServiceSource, Space, SpaceInfo, SpacePower, SpaceResize, SpaceService,+};pub use spaces::{CreatePhase, CreateProgress, DEFAULT_PROBE_TIMEOUT, PendingSpace, ProgressSink,RecoveredCreate, RecoveryOutcome, SpaceCreate, SpaceCreated, Spaces, SpacesBuilder,diff --git a/libs/cua/crates/cua-spaces/src/mcp/tools.rs b/libs/cua/crates/cua-spaces/src/mcp/tools.rsindex eb1a8c0455..d68ed27fcc 100644--- a/libs/cua/crates/cua-spaces/src/mcp/tools.rs+++ b/libs/cua/crates/cua-spaces/src/mcp/tools.rs@@ -300,8 +300,20 @@ async fn dispatch(Ok(ToolOutcome::text(spaces.delete(&a.space).await?))}"stop_space" => {- let a: i::SpaceOnly = args(tool, a)?;- Ok(ToolOutcome::json(&spaces.stop(&a.space).await?))+ let a: i::StopSpace = args(tool, a)?;+ if a.suspend.unwrap_or(false) {+ Ok(ToolOutcome::json(&spaces.suspend(&a.space).await?))+ } else {+ Ok(ToolOutcome::json(&spaces.stop(&a.space).await?))+ }+ }+ "resize_space" => {+ let a: i::ResizeSpace = args(tool, a)?;+ Ok(ToolOutcome::json(+ &spaces+ .resize(&a.space, a.cpus, a.memory_mb, a.disk_gb)+ .await?,+ ))}"start_space" => {let a: i::SpaceOnly = args(tool, a)?;diff --git a/libs/cua/crates/cua-spaces/src/share.rs b/libs/cua/crates/cua-spaces/src/share.rsindex ecef1c53e4..5895ff8a95 100644--- a/libs/cua/crates/cua-spaces/src/share.rs+++ b/libs/cua/crates/cua-spaces/src/share.rs@@ -842,6 +842,20 @@ impl Spaces {/// network, the Cua app elsewhere) reach it as `relay:<machine>`, and/// nobody else until it is shared. Idempotent; re-attaches after the/// Space restarted. Returns the relay Space id.+ /// After a local Space booted again (a start of a stopped VM, a+ /// resize), attaches it to the relay again when it was on it: its+ /// guest forgot the attachment when it shut down. Best effort; a Space+ /// that was never on the relay is left alone.+ pub(crate) async fn reattach_relay_after_boot(&self, id: &SpaceId) {+ let canonical = id.to_string();+ if !self.attached().contains_key(&canonical) {+ return;+ }+ if let Err(e) = self.relay_register(&canonical).await {+ tracing::warn!(space = %canonical, error = %e, "re-attaching to the relay after a boot failed");+ }+ }+pub async fn relay_register(&self, space: &str) -> Result<RelayRegistration> {let canonical = self.resolve(space)?.to_string();let machine = self.ensure_shared_machine(&canonical).await?;diff --git a/libs/cua/crates/cua-spaces/src/space.rs b/libs/cua/crates/cua-spaces/src/space.rsindex 4a2e925d60..c4c5f56e32 100644--- a/libs/cua/crates/cua-spaces/src/space.rs+++ b/libs/cua/crates/cua-spaces/src/space.rs@@ -751,6 +751,21 @@ pub struct SpacePower {pub message: String,}+/// What [`crate::Spaces::resize`] did: the shape the Space has now.+#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]+pub struct SpaceResize {+ /// The Space.+ pub space: String,+ /// vCPUs.+ pub cpus: Option<u32>,+ /// Memory, MiB.+ pub memory_mb: Option<u64>,+ /// Disk, GiB (when it was grown).+ pub disk_gb: Option<u32>,+ /// What happened, for people.+ pub message: String,+}+impl SpacePower {/// The report for `space`, now in `state`, turned off with `control`.pub fn new(@@ -762,8 +777,12 @@ impl SpacePower {let message = match (state, control) {(PowerState::Running, PowerControl::Suspend) => format!("Resumed {space}."),(PowerState::Running, PowerControl::Stop) => format!("Started {space}."),- (PowerState::Suspended, _) => format!("Suspended {space} (its memory is kept)."),- (PowerState::Stopped, _) => format!("Stopped {space} (its disk is kept)."),+ (PowerState::Suspended, _) => {+ format!("Suspended {space} (its memory is kept, and still in use).")+ }+ (PowerState::Stopped, _) => {+ format!("Stopped {space} (its disk is kept; its memory is free).")+ }};Self {space: space.into(),diff --git a/libs/cua/crates/cua-spaces/src/spaces.rs b/libs/cua/crates/cua-spaces/src/spaces.rsindex faf70e7b7d..a9d62adf9f 100644--- a/libs/cua/crates/cua-spaces/src/spaces.rs+++ b/libs/cua/crates/cua-spaces/src/spaces.rs@@ -7,7 +7,7 @@ use crate::error::{Error, Result};use crate::id::{Provider, SpaceId, authority};use crate::operator::{ControlServerDisplay, OperatorDisplay};use crate::registry::{Credential, Registry, cua_home};-use crate::space::{Gateway, Space, SpaceInfo, SpacePower};+use crate::space::{Gateway, Space, SpaceInfo, SpacePower, SpaceResize};use crate::space::{ServiceSource, SpaceService};use cua_proto::daemon::v1 as dpb;use cua_sandbox_core::placement::{Kind, On, Runtime};@@ -3346,6 +3346,96 @@ impl Spaces {self.set_power(space, true).await}+ /// Suspends a local Space, keeping its memory (it resumes where it+ /// was, and its memory stays in use meanwhile): a container or a QEMU+ /// VM. [`Self::stop`] stops it instead and frees its memory. Other+ /// Spaces are refused.+ pub async fn suspend(&self, space: &str) -> Result<SpacePower> {+ let id = self.resolve(space)?;+ let SpaceId::Local { name } = &id else {+ return Err(Error::WrongProvider {+ op: "Suspending".into(),+ provider: format!("{} (only a Space on this computer)", id.provider()),+ });+ };+ let sandboxes = &self.inner.sandboxes;+ if sandboxes.power_control(name).is_none() {+ return Err(Error::invalid(format!("{space} cannot be suspended")));+ }+ self.drop_connection(&id).await;+ let state = sandboxes+ .power_off_as(name, cua_sandbox_core::PowerControl::Suspend)+ .await?;+ Ok(SpacePower::new(+ &id.to_string(),+ cua_sandbox_core::PowerControl::Suspend,+ state,+ ))+ }++ /// Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ /// of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). The+ /// VM shuts down and boots again from its own disk (a stopped one+ /// boots), so its files stay and its memory and processes do not.+ /// Returns once it is ready again. Other Spaces are refused.+ pub async fn resize(+ &self,+ space: &str,+ cpus: Option<u32>,+ memory_mb: Option<u64>,+ disk_gb: Option<u32>,+ ) -> Result<SpaceResize> {+ if cpus.is_none() && memory_mb.is_none() && disk_gb.is_none() {+ return Err(Error::invalid(+ "say what to change: cpus, memory_mb or disk_gb",+ ));+ }+ let id = self.resolve(space)?;+ let SpaceId::Local { name } = &id else {+ return Err(Error::WrongProvider {+ op: "Resizing".into(),+ provider: format!(+ "{} (only a VM on this computer; resize it on the computer that runs it)",+ id.provider()+ ),+ });+ };+ self.drop_connection(&id).await;+ let shape = cua_sandbox_core::Resize {+ cpus,+ memory_mb,+ disk_gb,+ probes: Vec::new(),+ };+ self.inner.sandboxes.resize(name, &shape).await?;+ #[cfg(feature = "mcp")]+ self.notify_connected(&id);+ // It booted again: a Space that was on the relay goes back on it.+ #[cfg(feature = "spaces-agents")]+ self.reattach_relay_after_boot(&id).await;+ let mut what = Vec::new();+ if let Some(c) = cpus {+ what.push(format!("{c} vCPUs"));+ }+ if let Some(m) = memory_mb {+ what.push(format!("{m} MiB of memory"));+ }+ if let Some(d) = disk_gb {+ what.push(format!("a {d} GiB disk"));+ }+ Ok(SpaceResize {+ space: id.to_string(),+ cpus,+ memory_mb,+ disk_gb,+ message: format!(+ "{} now has {}; it booted again from its disk.",+ id,+ what.join(", ")+ ),+ })+ }+async fn set_power(&self, space: &str, on: bool) -> Result<SpacePower> {let id = self.resolve(space)?;let cloud = self.cloud_sandbox_of(&id.to_string())?;@@ -3366,6 +3456,9 @@ impl Spaces {// again now, not only when something next connects.#[cfg(feature = "mcp")]self.notify_connected(&id);+ // A guest that booted again forgot its relay attachment.+ #[cfg(feature = "spaces-agents")]+ self.reattach_relay_after_boot(&id).await;cua_sandbox_core::PowerState::Running} else {sandboxes.power_off(name).await?diff --git a/libs/cua/crates/cua-spaces/tests/host_spaces.rs b/libs/cua/crates/cua-spaces/tests/host_spaces.rsindex 923d4da9c2..92ca826dc3 100644--- a/libs/cua/crates/cua-spaces/tests/host_spaces.rs+++ b/libs/cua/crates/cua-spaces/tests/host_spaces.rs@@ -1096,7 +1096,7 @@ async fn the_host_turns_a_provided_space_off_and_on_and_it_rejoins_the_relay() {assert_eq!(off.message,format!(- "Stopped relay:space-ada00011 (its disk is kept) ({} on Mac mini (spare))",+ "Stopped relay:space-ada00011 (its disk is kept; its memory is free) ({} on Mac mini (spare))",space.local_space));@@ -1190,7 +1190,10 @@ async fn a_local_space_suspends_and_resumes_and_others_refuse() {(off.space.as_str(), off.state.as_str(), off.power.as_str()),(id.as_str(), "suspended", "suspend"));- assert_eq!(off.message, format!("Suspended {id} (its memory is kept)."));+ assert_eq!(+ off.message,+ format!("Suspended {id} (its memory is kept, and still in use).")+ );assert!(f.rt.paused.lock().unwrap().contains(&name));assert_eq!(listed(&f.spaces),@@ -1228,6 +1231,27 @@ async fn a_local_space_suspends_and_resumes_and_others_refuse() {f.spaces.power_of("direct:10.0.0.5:3211"),(String::new(), String::new()));++ // Suspending on purpose keeps the memory, the same way.+ let off = f.spaces.suspend(&id).await.unwrap();+ assert_eq!(+ (off.state.as_str(), off.power.as_str()),+ ("suspended", "suspend")+ );+ assert!(f.rt.paused.lock().unwrap().contains(&name));+ f.spaces.start(&id).await.unwrap();+ // Only a Space on this computer suspends or resizes.+ let e = f.spaces.suspend("direct:10.0.0.5:3211").await.unwrap_err();+ assert_eq!(e.tag(), "wrong_provider", "{e}");+ let e = f+ .spaces+ .resize("direct:10.0.0.5:3211", None, Some(4096), None)+ .await+ .unwrap_err();+ assert_eq!(e.tag(), "wrong_provider", "{e}");+ // A resize says what to change.+ let e = f.spaces.resize(&id, None, None, None).await.unwrap_err();+ assert!(e.to_string().contains("cpus, memory_mb or disk_gb"), "{e}");}/// Your other Mac must not vanish from "Run on" while its service is downdiff --git a/libs/cua/crates/cua-telemetry/src/cli_commands.in b/libs/cua/crates/cua-telemetry/src/cli_commands.inindex 499b9495f0..c0f692f208 100644--- a/libs/cua/crates/cua-telemetry/src/cli_commands.in+++ b/libs/cua/crates/cua-telemetry/src/cli_commands.in@@ -193,11 +193,13 @@"spaces.prewarm","spaces.relay-register","spaces.relay-unregister",+ "spaces.resize","spaces.rm","spaces.share","spaces.shares","spaces.start","spaces.stop",+ "spaces.suspend","spaces.unshare","spacesd.call","spacesd.caps",diff --git a/libs/cua/crates/cua-vmm/src/qemu/mod.rs b/libs/cua/crates/cua-vmm/src/qemu/mod.rsindex 75e4622c5b..8a37f08a8c 100644--- a/libs/cua/crates/cua-vmm/src/qemu/mod.rs+++ b/libs/cua/crates/cua-vmm/src/qemu/mod.rs@@ -1509,6 +1509,63 @@ impl QemuRuntime {}impl QemuRuntime {+ /// Stops the VM `name` (when it runs or is paused) and boots it again+ /// from its own disk, with `shape`'s vCPUs, memory and disk where given+ /// and its own otherwise, and the configuration it first started with.+ /// The guest's disk, ports and token are kept; its memory and running+ /// processes are not. A VM forked from a memory snapshot boots cold.+ async fn boot_from_disk(&self, name: &str, shape: &Resize) -> Result<Instance> {+ let mut st = self.load(name)?;+ {+ let _g = self.lock.lock().await;+ // The guest is shut down, not cut off: what it wrote in its last+ // seconds (host keys, the token file) must reach the disk. A+ // paused VM runs again first so that it can.+ if st.paused+ && let Ok(mut q) = self.qmp(name).await+ {+ let _ = q.cont().await;+ }+ let graceful = self.cfg.graceful_stop.max(Duration::from_secs(30));+ self.force_stop(&mut st, graceful).await?;+ st.paused = false;+ // A memory snapshot holds the old shape's machine.+ st.restore_from = None;+ self.save(&st)?;+ }+ let dir = self.dir(name);+ let boot = Self::read_boot_config(&dir);+ let mut spec = StartSpec::new(name, ImageSource::Existing);+ spec.os = st.os;+ spec.arch = Some(st.arch);+ spec.cpus = shape.cpus.unwrap_or(st.cpus);+ spec.memory_mb = shape.memory_mb.unwrap_or(st.memory_mb);+ spec.disk_size_gb = shape.disk_gb;+ // 22 is added again for managed SSH.+ spec.ports = st+ .ports+ .keys()+ .copied()+ .filter(|p| !(*p == 22 && st.ssh.is_some()))+ .collect();+ spec.env = boot.env;+ if let Some(t) = self.guest_token(&dir) {+ spec.env+ .entry(crate::cloudinit::ENV_TOKEN_VAR.into())+ .or_insert(t);+ }+ spec.command = boot.command;+ spec.cloud_init_user_data = boot.cloud_init_user_data;+ spec.ssh = st.ssh.clone();+ spec.restrict_network = st.restrict_network;+ spec.extra_args = st.extra_args.clone();+ spec.gpu = st.gpu.clone();+ spec.probes = shape.probes.clone();+ spec.labels.insert(KEEP_SEED_LABEL.into(), "1".into());+ spec.labels.insert(KEEP_PORTS_LABEL.into(), "1".into());+ self.start(&spec).await+ }+/// Readiness probes with a slirp-aware TCP check: user-mode NAT accepts/// host connections before the guest does, so a TCP probe connects and/// then asks QEMU (`info usernet`) whether *the guest side* of that@@ -2265,7 +2322,14 @@ impl Runtime for QemuRuntime {self.save(&st)}+ /// Runs a paused VM again over QMP. A VM that was stopped (its process+ /// ended; its disk is kept) boots again from its own disk, in the shape+ /// it had, as [`Self::resize`] boots it.async fn resume(&self, name: &str) -> Result<Instance> {+ let st = self.load(name)?;+ if st.kind == EntryKind::Instance && !Self::is_running(&st) {+ return self.boot_from_disk(name, &Resize::default()).await;+ }let mut q = self.qmp(name).await?;q.cont().await?;let mut st = self.load(name)?;@@ -2281,7 +2345,7 @@ impl Runtime for QemuRuntime {/// running processes are not (a VM's shape is fixed while it runs).async fn resize(&self, name: &str, shape: &Resize) -> Result<Instance> {validate_name(name)?;- let mut st = self.load(name)?;+ let st = self.load(name)?;if st.kind != EntryKind::Instance {return Err(VmmError::invalid(format!("'{name}' is not a VM instance")));}@@ -2305,54 +2369,7 @@ impl Runtime for QemuRuntime {)));}}- {- let _g = self.lock.lock().await;- // The guest is shut down, not cut off: what it wrote in its last- // seconds (host keys, the token file) must reach the disk. A- // paused VM runs again first so that it can.- if st.paused- && let Ok(mut q) = self.qmp(name).await- {- let _ = q.cont().await;- }- let graceful = self.cfg.graceful_stop.max(Duration::from_secs(30));- self.force_stop(&mut st, graceful).await?;- st.paused = false;- // A memory snapshot holds the old shape's machine.- st.restore_from = None;- self.save(&st)?;- }- let dir = self.dir(name);- let boot = Self::read_boot_config(&dir);- let mut spec = StartSpec::new(name, ImageSource::Existing);- spec.os = st.os;- spec.arch = Some(st.arch);- spec.cpus = shape.cpus.unwrap_or(st.cpus);- spec.memory_mb = shape.memory_mb.unwrap_or(st.memory_mb);- spec.disk_size_gb = shape.disk_gb;- // 22 is added again for managed SSH.- spec.ports = st- .ports- .keys()- .copied()- .filter(|p| !(*p == 22 && st.ssh.is_some()))- .collect();- spec.env = boot.env;- if let Some(t) = self.guest_token(&dir) {- spec.env- .entry(crate::cloudinit::ENV_TOKEN_VAR.into())- .or_insert(t);- }- spec.command = boot.command;- spec.cloud_init_user_data = boot.cloud_init_user_data;- spec.ssh = st.ssh.clone();- spec.restrict_network = st.restrict_network;- spec.extra_args = st.extra_args.clone();- spec.gpu = st.gpu.clone();- spec.probes = shape.probes.clone();- spec.labels.insert(KEEP_SEED_LABEL.into(), "1".into());- spec.labels.insert(KEEP_PORTS_LABEL.into(), "1".into());- self.start(&spec).await+ self.boot_from_disk(name, shape).await}/// Renames running pool member `member` to `new_name` (QEMU keeps itsdiff --git a/libs/cua/crates/cua-vmm/tests/qemu_stop_start.rs b/libs/cua/crates/cua-vmm/tests/qemu_stop_start.rsnew file mode 100644index 0000000000..2f08a668db--- /dev/null+++ b/libs/cua/crates/cua-vmm/tests/qemu_stop_start.rs@@ -0,0 +1,136 @@+//! Opt-in: a stopped QEMU VM (its process gone, its memory given back)+//! boots again from its own disk, and a resize gives it another shape.+//! Boots ONE guest from the linux disk:+//!+//! ```text+//! CUA_VMM_TEST_QEMU=1 CUA_VMM_TEST_DISK=~/.cache/cua-images/linux/arm64/disk.img \+//! cargo test -p cua-vmm --features qemu --test qemu_stop_start -- --ignored --nocapture+//! ```+//!+//! 2 GiB RAM (3 GiB after the resize), state in a temp dir; the VM is+//! deleted on every path.++#![cfg(all(feature = "qemu", unix))]++use std::path::PathBuf;+use std::time::Duration;++use cua_vmm::qemu::{QemuConfig, QemuRuntime};+use cua_vmm::{ImageSource, Probe, Resize, Runtime, StartSpec, Status};++fn disk() -> Option<PathBuf> {+ std::env::var_os("CUA_VMM_TEST_DISK")+ .map(PathBuf::from)+ .filter(|p| p.exists())+}++async fn guest_run(url: &str, token: &str, cmd: &str) -> Result<String, String> {+ let mut last = String::new();+ for _ in 0..40 {+ match cua_spacesd_client::SpacesdClient::connect_url(url, Some(token.to_string())).await {+ Ok(env) => match env.run(cmd).await {+ Ok(out) => return Ok(out.stdout_str().to_string()),+ Err(e) => last = format!("run: {e}"),+ },+ Err(e) => last = format!("connect: {e}"),+ }+ tokio::time::sleep(Duration::from_secs(3)).await;+ }+ Err(format!("guest never answered `{cmd}`: {last}"))+}++fn url_of(inst: &cua_vmm::Instance) -> Result<String, String> {+ let port = *inst+ .endpoints+ .ports+ .get(&3211)+ .ok_or("3211 not published")?;+ Ok(format!("http://{}:{port}", inst.endpoints.host))+}++#[tokio::test]+#[ignore = "boots a QEMU VM; set CUA_VMM_TEST_QEMU=1 and CUA_VMM_TEST_DISK, run with --ignored"]+async fn a_stopped_vm_boots_again_from_its_disk_and_resizes() {+ if std::env::var("CUA_VMM_TEST_QEMU").as_deref() != Ok("1") {+ eprintln!("skipped: set CUA_VMM_TEST_QEMU=1");+ return;+ }+ let Some(disk) = disk() else {+ panic!("linux disk not found; set CUA_VMM_TEST_DISK");+ };+ let root = tempfile::tempdir().unwrap();+ let rt = QemuRuntime::new(QemuConfig {+ root: root.path().to_path_buf(),+ vnc: false,+ graceful_stop: Duration::from_secs(10),+ ..QemuConfig::default()+ });+ // A token in the shape cua-spaces' provision_local makes (128-bit hex);+ // the guest's spacesd accepts no other.+ let token = format!(+ "{:016x}{:016x}",+ (std::process::id() as u64).wrapping_mul(0x9e37_79b9_7f4a_7c15),+ std::time::SystemTime::now()+ .duration_since(std::time::UNIX_EPOCH)+ .unwrap()+ .as_nanos() as u64+ );+ let name = format!("cua-e2e-stopstart-{}", std::process::id());+ let spec = StartSpec::new(&name, ImageSource::Disk { path: disk })+ .cpus(2)+ .memory_mb(2048)+ .env("CUA_ENV_TOKEN", &token)+ .probe(Probe::Tcp { port: 3211 })+ .ready_timeout(Duration::from_secs(300));++ let result = async {+ let inst = rt.start(&spec).await.map_err(|e| format!("start: {e}"))?;+ let url = url_of(&inst)?;+ guest_run(&url, &token, "echo kept > /var/tmp/marker && sync").await?;++ // Stop: the process ends, so the memory goes back to the machine.+ rt.stop(&name).await.map_err(|e| format!("stop: {e}"))?;+ let st = rt.status(&name).await.map_err(|e| format!("status: {e}"))?;+ if st != Status::Stopped {+ return Err(format!("after stop the VM is {st:?}, not stopped"));+ }++ // Start (resume) a stopped VM: it boots from its own disk.+ let inst = rt.resume(&name).await.map_err(|e| format!("resume: {e}"))?;+ let url = url_of(&inst)?;+ let marker = guest_run(&url, &token, "cat /var/tmp/marker").await?;+ if marker.trim() != "kept" {+ return Err(format!("the disk was not kept: {marker:?}"));+ }++ // Resize: another memory size, booted from the same disk.+ let shape = Resize {+ memory_mb: Some(3072),+ ..Default::default()+ };+ let inst = rt+ .resize(&name, &shape)+ .await+ .map_err(|e| format!("resize: {e}"))?;+ let url = url_of(&inst)?;+ let mem = guest_run(&url, &token, "awk '/MemTotal/{print $2}' /proc/meminfo").await?;+ let kib: u64 = mem+ .trim()+ .parse()+ .map_err(|_| format!("meminfo: {mem:?}"))?;+ if !(2_700_000..=3_200_000).contains(&kib) {+ return Err(format!("after the resize the guest has {kib} KiB"));+ }+ let marker = guest_run(&url, &token, "cat /var/tmp/marker").await?;+ if marker.trim() != "kept" {+ return Err(format!("the resize lost the disk: {marker:?}"));+ }+ Ok::<(), String>(())+ }+ .await;+ let _ = rt.stop(&name).await;+ let _ = rt.delete(&name).await;+ if let Err(e) = result {+ panic!("{e}");+ }+}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.ktindex a8a3fe2c86..179792b3e4 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@@ -1543,6 +1543,8 @@ external fun uniffi_cua_sdk_checksum_method_spaces_relay_unregister(): Shortexternal fun uniffi_cua_sdk_checksum_method_spaces_remove(): Short+external fun uniffi_cua_sdk_checksum_method_spaces_resize(+): Shortexternal fun uniffi_cua_sdk_checksum_method_spaces_resolve(): Shortexternal fun uniffi_cua_sdk_checksum_method_spaces_resources(@@ -1557,6 +1559,8 @@ external fun uniffi_cua_sdk_checksum_method_spaces_start(): Shortexternal fun uniffi_cua_sdk_checksum_method_spaces_stop(): Short+external fun uniffi_cua_sdk_checksum_method_spaces_suspend(+): Shortexternal fun uniffi_cua_sdk_checksum_method_spaces_volume_approve(): Shortexternal fun uniffi_cua_sdk_checksum_method_spaces_volume_audit(@@ -2564,6 +2568,8 @@ external fun uniffi_cua_sdk_fn_method_spaces_relay_unregister(`ptr`: Long,`space): Longexternal fun uniffi_cua_sdk_fn_method_spaces_remove(`ptr`: Long,`space`: RustBuffer.ByValue,): Long+external fun uniffi_cua_sdk_fn_method_spaces_resize(`ptr`: Long,`space`: RustBuffer.ByValue,`cpus`: RustBuffer.ByValue,`memoryMb`: RustBuffer.ByValue,`diskGb`: RustBuffer.ByValue,+): Longexternal fun uniffi_cua_sdk_fn_method_spaces_resolve(`ptr`: Long,`space`: RustBuffer.ByValue,): Longexternal fun uniffi_cua_sdk_fn_method_spaces_resources(`ptr`: Long,`visible`: Byte,@@ -2578,6 +2584,8 @@ external fun uniffi_cua_sdk_fn_method_spaces_start(`ptr`: Long,`space`: RustBuff): Longexternal fun uniffi_cua_sdk_fn_method_spaces_stop(`ptr`: Long,`space`: RustBuffer.ByValue,): Long+external fun uniffi_cua_sdk_fn_method_spaces_suspend(`ptr`: Long,`space`: RustBuffer.ByValue,+): Longexternal fun uniffi_cua_sdk_fn_method_spaces_volume_approve(`ptr`: Long,`requestId`: RustBuffer.ByValue,`expiresInSecs`: RustBuffer.ByValue,): Longexternal fun uniffi_cua_sdk_fn_method_spaces_volume_audit(`ptr`: Long,`limit`: RustBuffer.ByValue,@@ -4147,6 +4155,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {if (lib.uniffi_cua_sdk_checksum_method_spaces_remove() != 23086.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}+ if (lib.uniffi_cua_sdk_checksum_method_spaces_resize() != 2886.toShort()) {+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ }if (lib.uniffi_cua_sdk_checksum_method_spaces_resolve() != 9986.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}@@ -4165,7 +4176,10 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {if (lib.uniffi_cua_sdk_checksum_method_spaces_start() != 32898.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}- if (lib.uniffi_cua_sdk_checksum_method_spaces_stop() != 64586.toShort()) {+ if (lib.uniffi_cua_sdk_checksum_method_spaces_stop() != 59057.toShort()) {+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ }+ if (lib.uniffi_cua_sdk_checksum_method_spaces_suspend() != 23817.toShort()) {throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")}if (lib.uniffi_cua_sdk_checksum_method_spaces_volume_approve() != 8640.toShort()) {@@ -20503,6 +20517,15 @@ public interface SpacesInterface {*/suspend fun `remove`(`space`: kotlin.String)+ /**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+ suspend fun `resize`(`space`: kotlin.String, `cpus`: kotlin.UInt?, `memoryMb`: kotlin.ULong?, `diskGb`: kotlin.UInt?): SpaceResizeReport+/*** Resolves an id, legacy id, URL or display name.*/@@ -20549,13 +20572,22 @@ public interface SpacesInterface {/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/suspend fun `stop`(`space`: kotlin.String): SpacePowerReport+ /**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+ suspend fun `suspend`(`space`: kotlin.String): SpacePowerReport+/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -22176,6 +22208,34 @@ open class Spaces: Disposable, AutoCloseable, SpacesInterface}+ /**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+ @Throws(CuaException::class)+ @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")+ override suspend fun `resize`(`space`: kotlin.String, `cpus`: kotlin.UInt?, `memoryMb`: kotlin.ULong?, `diskGb`: kotlin.UInt?) : SpaceResizeReport {+ return uniffiRustCallAsync(+ callWithHandle { uniffiHandle ->+ UniffiLib.uniffi_cua_sdk_fn_method_spaces_resize(+ uniffiHandle,+ FfiConverterString.lower(`space`),FfiConverterOptionalUInt.lower(`cpus`),FfiConverterOptionalULong.lower(`memoryMb`),FfiConverterOptionalUInt.lower(`diskGb`),+ )+ },+ { future, callback, continuation -> UniffiLib.ffi_cua_sdk_rust_future_poll_rust_buffer(future, callback, continuation) },+ { future, continuation -> UniffiLib.ffi_cua_sdk_rust_future_complete_rust_buffer(future, continuation) },+ { future -> UniffiLib.ffi_cua_sdk_rust_future_free_rust_buffer(future) },+ // lift function+ { FfiConverterTypeSpaceResizeReport.lift(it) },+ // Error FFI converter+ CuaException.ErrorHandler,+ )+ }++/*** Resolves an id, legacy id, URL or display name.*/@@ -22337,10 +22397,12 @@ open class Spaces: Disposable, AutoCloseable, SpacesInterface/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/@Throws(CuaException::class)@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")@@ -22363,6 +22425,32 @@ open class Spaces: Disposable, AutoCloseable, SpacesInterface}+ /**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+ @Throws(CuaException::class)+ @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")+ override suspend fun `suspend`(`space`: kotlin.String) : SpacePowerReport {+ return uniffiRustCallAsync(+ callWithHandle { uniffiHandle ->+ UniffiLib.uniffi_cua_sdk_fn_method_spaces_suspend(+ uniffiHandle,+ FfiConverterString.lower(`space`),+ )+ },+ { future, callback, continuation -> UniffiLib.ffi_cua_sdk_rust_future_poll_rust_buffer(future, callback, continuation) },+ { future, continuation -> UniffiLib.ffi_cua_sdk_rust_future_complete_rust_buffer(future, continuation) },+ { future -> UniffiLib.ffi_cua_sdk_rust_future_free_rust_buffer(future) },+ // lift function+ { FfiConverterTypeSpacePowerReport.lift(it) },+ // Error FFI converter+ CuaException.ErrorHandler,+ )+ }++/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -42430,8 +42518,8 @@ data class SpacePowerReport (var `state`: kotlin.String,/**- * How it turns off: `suspend` (its memory is kept) or `stop` (its- * disk is kept).+ * How it was turned off: `suspend` (its memory is kept, and still in+ * use) or `stop` (its disk is kept; its memory is freed).*/var `power`: kotlin.String,@@ -42550,6 +42638,77 @@ public object FfiConverterTypeSpaceRelayRegistration: FfiConverterRustBuffer<Spa+/**+ * What [`Spaces::resize`] did: the shape the Space has now.+ */+data class SpaceResizeReport (+ /**+ * The Space.+ */+ var `space`: kotlin.String+ ,+ /**+ * vCPUs (when changed).+ */+ var `cpus`: kotlin.UInt?+ ,+ /**+ * Memory in MiB (when changed).+ */+ var `memoryMb`: kotlin.ULong?+ ,+ /**+ * Disk in GiB (when grown).+ */+ var `diskGb`: kotlin.UInt?+ ,+ /**+ * What happened, for people.+ */+ var `message`: kotlin.String++){++++++ companion object+}++/**+ * @suppress+ */+public object FfiConverterTypeSpaceResizeReport: FfiConverterRustBuffer<SpaceResizeReport> {+ override fun read(buf: ByteBuffer): SpaceResizeReport {+ return SpaceResizeReport(+ FfiConverterString.read(buf),+ FfiConverterOptionalUInt.read(buf),+ FfiConverterOptionalULong.read(buf),+ FfiConverterOptionalUInt.read(buf),+ FfiConverterString.read(buf),+ )+ }++ override fun allocationSize(value: SpaceResizeReport) = (+ FfiConverterString.allocationSize(value.`space`) ++ FfiConverterOptionalUInt.allocationSize(value.`cpus`) ++ FfiConverterOptionalULong.allocationSize(value.`memoryMb`) ++ FfiConverterOptionalUInt.allocationSize(value.`diskGb`) ++ FfiConverterString.allocationSize(value.`message`)+ )++ override fun write(value: SpaceResizeReport, buf: ByteBuffer) {+ FfiConverterString.write(value.`space`, buf)+ FfiConverterOptionalUInt.write(value.`cpus`, buf)+ FfiConverterOptionalULong.write(value.`memoryMb`, buf)+ FfiConverterOptionalUInt.write(value.`diskGb`, buf)+ FfiConverterString.write(value.`message`, buf)+ }+}+++/*** One extra Space on this Mac.*/diff --git a/libs/cua/python/src/cua/_native.py b/libs/cua/python/src/cua/_native.pyindex 68143cbd10..a7359daf60 100644--- a/libs/cua/python/src/cua/_native.py+++ b/libs/cua/python/src/cua/_native.py@@ -1235,6 +1235,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_spaces_remove_prewarm() != 56425:raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ if lib.uniffi_cua_sdk_checksum_method_spaces_resize() != 2886:+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")if lib.uniffi_cua_sdk_checksum_method_spaces_resolve() != 9986:raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")if lib.uniffi_cua_sdk_checksum_method_spaces_resources() != 12146:@@ -1255,7 +1257,9 @@ 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_spaces_start() != 32898:raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")- if lib.uniffi_cua_sdk_checksum_method_spaces_stop() != 64586:+ if lib.uniffi_cua_sdk_checksum_method_spaces_stop() != 59057:+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")+ if lib.uniffi_cua_sdk_checksum_method_spaces_suspend() != 23817:raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")if lib.uniffi_cua_sdk_checksum_method_spaces_volume_approve() != 8640:raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")@@ -4162,6 +4166,14 @@ _UniffiLib.uniffi_cua_sdk_fn_method_spaces_remove_prewarm.argtypes = (_UniffiRustBuffer,)_UniffiLib.uniffi_cua_sdk_fn_method_spaces_remove_prewarm.restype = ctypes.c_uint64+_UniffiLib.uniffi_cua_sdk_fn_method_spaces_resize.argtypes = (+ ctypes.c_uint64,+ _UniffiRustBuffer,+ _UniffiRustBuffer,+ _UniffiRustBuffer,+ _UniffiRustBuffer,+)+_UniffiLib.uniffi_cua_sdk_fn_method_spaces_resize.restype = ctypes.c_uint64_UniffiLib.uniffi_cua_sdk_fn_method_spaces_resolve.argtypes = (ctypes.c_uint64,_UniffiRustBuffer,@@ -4226,6 +4238,11 @@ _UniffiLib.uniffi_cua_sdk_fn_method_spaces_stop.argtypes = (_UniffiRustBuffer,)_UniffiLib.uniffi_cua_sdk_fn_method_spaces_stop.restype = ctypes.c_uint64+_UniffiLib.uniffi_cua_sdk_fn_method_spaces_suspend.argtypes = (+ ctypes.c_uint64,+ _UniffiRustBuffer,+)+_UniffiLib.uniffi_cua_sdk_fn_method_spaces_suspend.restype = ctypes.c_uint64_UniffiLib.uniffi_cua_sdk_fn_method_spaces_volume_approve.argtypes = (ctypes.c_uint64,_UniffiRustBuffer,@@ -5877,6 +5894,9 @@ _UniffiLib.uniffi_cua_sdk_checksum_method_spaces_remove.restype = ctypes.c_uint1_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_remove_prewarm.argtypes = ()_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_remove_prewarm.restype = ctypes.c_uint16+_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_resize.argtypes = (+)+_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_resize.restype = ctypes.c_uint16_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_resolve.argtypes = ()_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_resolve.restype = ctypes.c_uint16@@ -5910,6 +5930,9 @@ _UniffiLib.uniffi_cua_sdk_checksum_method_spaces_start.restype = ctypes.c_uint16_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_stop.argtypes = ()_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_stop.restype = ctypes.c_uint16+_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_suspend.argtypes = (+)+_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_suspend.restype = ctypes.c_uint16_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_volume_approve.argtypes = ()_UniffiLib.uniffi_cua_sdk_checksum_method_spaces_volume_approve.restype = ctypes.c_uint16@@ -23989,6 +24012,63 @@ class _UniffiFfiConverterTypeSpaceRelayRegistration(_UniffiConverterRustBuffer):_UniffiFfiConverterString.write(value.url, buf)_UniffiFfiConverterBoolean.write(value.online, buf)+@dataclass+class SpaceResizeReport:+ """+ What [`Spaces::resize`] did: the shape the Space has now.+"""+ def __init__(self, *, space:str, cpus:typing.Optional[int], memory_mb:typing.Optional[int], disk_gb:typing.Optional[int], message:str):+ self.space = space+ self.cpus = cpus+ self.memory_mb = memory_mb+ self.disk_gb = disk_gb+ self.message = message+++++ def __str__(self):+ return "SpaceResizeReport(space={}, cpus={}, memory_mb={}, disk_gb={}, message={})".format(self.space, self.cpus, self.memory_mb, self.disk_gb, self.message)+ def __eq__(self, other):+ if self.space != other.space:+ return False+ if self.cpus != other.cpus:+ return False+ if self.memory_mb != other.memory_mb:+ return False+ if self.disk_gb != other.disk_gb:+ return False+ if self.message != other.message:+ return False+ return True++class _UniffiFfiConverterTypeSpaceResizeReport(_UniffiConverterRustBuffer):+ @staticmethod+ def read(buf):+ return SpaceResizeReport(+ space=_UniffiFfiConverterString.read(buf),+ cpus=_UniffiFfiConverterOptionalUInt32.read(buf),+ memory_mb=_UniffiFfiConverterOptionalUInt64.read(buf),+ disk_gb=_UniffiFfiConverterOptionalUInt32.read(buf),+ message=_UniffiFfiConverterString.read(buf),+ )++ @staticmethod+ def check_lower(value):+ _UniffiFfiConverterString.check_lower(value.space)+ _UniffiFfiConverterOptionalUInt32.check_lower(value.cpus)+ _UniffiFfiConverterOptionalUInt64.check_lower(value.memory_mb)+ _UniffiFfiConverterOptionalUInt32.check_lower(value.disk_gb)+ _UniffiFfiConverterString.check_lower(value.message)++ @staticmethod+ def write(value, buf):+ _UniffiFfiConverterString.write(value.space, buf)+ _UniffiFfiConverterOptionalUInt32.write(value.cpus, buf)+ _UniffiFfiConverterOptionalUInt64.write(value.memory_mb, buf)+ _UniffiFfiConverterOptionalUInt32.write(value.disk_gb, buf)+ _UniffiFfiConverterString.write(value.message, buf)+@dataclassclass SpaceSendFileOptions:"""@@ -40555,6 +40635,15 @@ class SpacesProtocol(typing.Protocol):async def remove_prewarm(self, id: str) -> bool:"""Ends prewarm `id` (its ready Spaces go). `false`: no such prewarm.+"""+ raise NotImplementedError+ async def resize(self, space: str,cpus: typing.Optional[int],memory_mb: typing.Optional[int],disk_gb: typing.Optional[int]) -> SpaceResizeReport:+ """+ Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ shuts down and boots again from its own disk (a stopped one boots),+ so its files stay and its memory and processes do not. Returns once+ it is ready again."""raise NotImplementedErrorasync def resolve(self, space: str) -> SpaceInfo:@@ -40625,10 +40714,19 @@ class SpacesProtocol(typing.Protocol):async def stop(self, space: str) -> SpacePowerReport:"""Turns a Space off the way its provider can (`SpaceInfo.power`):- suspends it, keeping its memory (a local container or QEMU VM), or- stops it, keeping its disk (a local Lume VM; a Space one of your- machines provides, which that machine stops). A cloud Space, a Space- added by address and your own computers cannot be turned off.+ stops it, keeping its disk and freeing its memory (a local VM; a+ Space one of your machines provides, which that machine stops), or+ suspends it, keeping its memory (a local container that cannot+ stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ purpose. A Space added by address and your own computers cannot be+ turned off.+"""+ raise NotImplementedError+ async def suspend(self, space: str) -> SpacePowerReport:+ """+ Suspends a local Space (a container or a QEMU VM), keeping its+ memory: it resumes where it was, and its memory stays in use until+ then. [`Spaces::stop`] stops it instead and frees its memory."""raise NotImplementedErrorasync def volume_approve(self, request_id: str,expires_in_secs: typing.Optional[int]) -> DriveGrant:@@ -42017,6 +42115,39 @@ class Spaces(SpacesProtocol):_uniffi_lift_return,_uniffi_error_converter,)+ async def resize(self, space: str,cpus: typing.Optional[int],memory_mb: typing.Optional[int],disk_gb: typing.Optional[int]) -> SpaceResizeReport:+ """+ Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ shuts down and boots again from its own disk (a stopped one boots),+ so its files stay and its memory and processes do not. Returns once+ it is ready again.+"""++ _UniffiFfiConverterString.check_lower(space)++ _UniffiFfiConverterOptionalUInt32.check_lower(cpus)++ _UniffiFfiConverterOptionalUInt64.check_lower(memory_mb)++ _UniffiFfiConverterOptionalUInt32.check_lower(disk_gb)+ _uniffi_lowered_args = (+ self._uniffi_clone_handle(),+ _UniffiFfiConverterString.lower(space),+ _UniffiFfiConverterOptionalUInt32.lower(cpus),+ _UniffiFfiConverterOptionalUInt64.lower(memory_mb),+ _UniffiFfiConverterOptionalUInt32.lower(disk_gb),+ )+ _uniffi_lift_return = _UniffiFfiConverterTypeSpaceResizeReport.lift+ _uniffi_error_converter = _UniffiFfiConverterTypeCuaError+ return await _uniffi_rust_call_async(+ _UniffiLib.uniffi_cua_sdk_fn_method_spaces_resize(*_uniffi_lowered_args),+ _UniffiLib.ffi_cua_sdk_rust_future_poll_rust_buffer,+ _UniffiLib.ffi_cua_sdk_rust_future_complete_rust_buffer,+ _UniffiLib.ffi_cua_sdk_rust_future_free_rust_buffer,+ _uniffi_lift_return,+ _uniffi_error_converter,+ )async def resolve(self, space: str) -> SpaceInfo:"""Resolves an id, legacy id, URL or display name.@@ -42262,10 +42393,12 @@ class Spaces(SpacesProtocol):async def stop(self, space: str) -> SpacePowerReport:"""Turns a Space off the way its provider can (`SpaceInfo.power`):- suspends it, keeping its memory (a local container or QEMU VM), or- stops it, keeping its disk (a local Lume VM; a Space one of your- machines provides, which that machine stops). A cloud Space, a Space- added by address and your own computers cannot be turned off.+ stops it, keeping its disk and freeing its memory (a local VM; a+ Space one of your machines provides, which that machine stops), or+ suspends it, keeping its memory (a local container that cannot+ stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ purpose. A Space added by address and your own computers cannot be+ turned off."""_UniffiFfiConverterString.check_lower(space)@@ -42283,6 +42416,28 @@ class Spaces(SpacesProtocol):_uniffi_lift_return,_uniffi_error_converter,)+ async def suspend(self, space: str) -> SpacePowerReport:+ """+ Suspends a local Space (a container or a QEMU VM), keeping its+ memory: it resumes where it was, and its memory stays in use until+ then. [`Spaces::stop`] stops it instead and frees its memory.+"""++ _UniffiFfiConverterString.check_lower(space)+ _uniffi_lowered_args = (+ self._uniffi_clone_handle(),+ _UniffiFfiConverterString.lower(space),+ )+ _uniffi_lift_return = _UniffiFfiConverterTypeSpacePowerReport.lift+ _uniffi_error_converter = _UniffiFfiConverterTypeCuaError+ return await _uniffi_rust_call_async(+ _UniffiLib.uniffi_cua_sdk_fn_method_spaces_suspend(*_uniffi_lowered_args),+ _UniffiLib.ffi_cua_sdk_rust_future_poll_rust_buffer,+ _UniffiLib.ffi_cua_sdk_rust_future_complete_rust_buffer,+ _UniffiLib.ffi_cua_sdk_rust_future_free_rust_buffer,+ _uniffi_lift_return,+ _uniffi_error_converter,+ )async def volume_approve(self, request_id: str,expires_in_secs: typing.Optional[int]) -> DriveGrant:"""`volume_approve`: the request becomes a grant (with presence).@@ -45278,6 +45433,7 @@ __all__ = ["SpaceList","SpacePowerReport","SpaceRelayRegistration",+ "SpaceResizeReport","SpaceSendFileOptions","SpaceSentFile","SpaceSendFileReport",diff --git a/libs/cua/python/tests/test_spaces.py b/libs/cua/python/tests/test_spaces.pyindex 23950227af..3c542590e9 100644--- a/libs/cua/python/tests/test_spaces.py+++ b/libs/cua/python/tests/test_spaces.py@@ -34,7 +34,7 @@ class Approver(cua.TeleportApprover):def test_every_contract_tool_maps_to_a_generated_method():rows = cua.spaces_tool_methods()- assert len(rows) == 96+ assert len(rows) == 97classes = {"Spaces": cua.Spaces, "Space": cua.Space}for row in rows:cls, method = row.method.split(".")diff --git a/libs/cua/spaces-contract/fixtures/control/session.json b/libs/cua/spaces-contract/fixtures/control/session.jsonindex a8cdc011ba..c1f76fba88 100644--- a/libs/cua/spaces-contract/fixtures/control/session.json+++ b/libs/cua/spaces-contract/fixtures/control/session.json@@ -66,6 +66,17 @@],"metering": "free"},+ {+ "tool": "resize_space",+ "sdk_symbol": "Space::resize",+ "providers": [+ "cloud",+ "local",+ "direct",+ "relay"+ ],+ "metering": "free"+ },{"tool": "start_space","sdk_symbol": "Space::start",diff --git a/libs/cua/spaces-contract/manifest.json b/libs/cua/spaces-contract/manifest.jsonindex 6805e22f86..7cc52e8c84 100644--- a/libs/cua/spaces-contract/manifest.json+++ b/libs/cua/spaces-contract/manifest.json@@ -9,7 +9,7 @@"mcp_stdio","mcp_streamable_http"],- "tool_count": 96,+ "tool_count": 97,"categories": [{"id": "lifecycle",@@ -595,8 +595,8 @@{"name": "stop_space","category": "lifecycle",- "description": "Turn a Space off: suspend it (memory kept) or stop it (disk kept).",- "instructions": "Turns a Space off the way its provider can: a local container or QEMU VM is suspended (its memory is kept and it resumes where it was), a local Lume VM is stopped (its disk is kept and it boots again), a Space one of your computers provides is stopped by that computer, which frees its memory, and a Space in your own cloud (on=\"aws\", \"gcp\") is stopped there: compute billing stops, its disk stays (storage is still billed); a Hetzner server (on=\"hetzner\") is stopped too, but Hetzner keeps billing a stopped server, so delete it to stop the charge. Anything streaming from the Space and any hotspot on it end first. A Modal sandbox, a Space added by address and your own computers on the relay cannot be turned off (wrong_provider); delete_space deletes a Space instead. start_space turns it on again.",+ "description": "Turn a Space off: stop it (disk kept, memory freed) or, with suspend, suspend it (memory kept).",+ "instructions": "Turns a Space off the way its provider can. By default it stops: a local VM (QEMU or Lume) shuts down with its disk kept and gives its memory back to the machine, a local container stops or is suspended as its runtime can, a Space one of your computers provides is stopped by that computer, and a Space in your own cloud (on=\"aws\", \"gcp\") is stopped there: compute billing stops, its disk stays (storage is still billed); a Hetzner server (on=\"hetzner\") is stopped too, but Hetzner keeps billing a stopped server, so delete it to stop the charge. suspend=true suspends a local container or QEMU VM instead: its memory is kept (so it still uses it) and it resumes where it was. Anything streaming from the Space and any hotspot on it end first. A Modal sandbox, a Space added by address and your own computers on the relay cannot be turned off (wrong_provider); delete_space deletes a Space instead. start_space turns it on again.","platforms": ["macos","windows",@@ -635,6 +635,79 @@],"input_schema": {"properties": {+ "space": {+ "description": "Space id or name.",+ "type": "string"+ },+ "suspend": {+ "description": "Suspend it instead: keep its memory so it resumes where it was (a\nlocal container or QEMU VM). Default false: stop it, keeping its\ndisk and giving its memory back to the machine.",+ "type": "boolean"+ }+ },+ "required": [+ "space"+ ],+ "type": "object"+ }+ },+ {+ "name": "resize_space",+ "category": "lifecycle",+ "description": "Change a Space's vCPUs, memory or disk size.",+ "instructions": "Gives a local VM Space (QEMU) another shape: `cpus` vCPUs, `memory_mb` MiB of memory, a disk grown to `disk_gb` GiB; what you leave out stays. The VM shuts down and boots again from its own disk, so its files stay but its memory and running processes do not; a stopped one boots. A disk never shrinks. Returns once it is ready again. Containers, Lume VMs and Spaces on other computers are refused (wrong_provider).",+ "platforms": [+ "macos",+ "windows",+ "linux"+ ],+ "providers": [+ "cloud",+ "local",+ "direct",+ "relay"+ ],+ "metering": "free",+ "capabilities": [+ "space.power"+ ],+ "requires": [],+ "host_requires": [],+ "annotations": {+ "read_only": false,+ "destructive": false,+ "idempotent": true,+ "open_world": true+ },+ "sdk_symbol": "Spaces.resize(space, cpus, memory_mb, disk_gb)",+ "rust_symbol": "Spaces::resize",+ "notes": [],+ "result": "JSON: `space`, `cpus`, `memory_mb`, `disk_gb` (what it has now) and `message`.",+ "errors": [+ "wrong_provider",+ "sandbox",+ "invalid_argument",+ "timeout"+ ],+ "input_schema": {+ "properties": {+ "cpus": {+ "description": "vCPUs.",+ "format": "uint32",+ "minimum": 0,+ "type": "integer"+ },+ "disk_gb": {+ "description": "Grow the disk to this many GiB (a disk never shrinks).",+ "format": "uint32",+ "minimum": 0,+ "type": "integer"+ },+ "memory_mb": {+ "description": "Memory in MiB.",+ "format": "uint64",+ "minimum": 0,+ "type": "integer"+ },"space": {"description": "Space id or name.","type": "string"diff --git a/libs/cua/swift/Sources/CuaSDK/CuaSDK.swift b/libs/cua/swift/Sources/CuaSDK/CuaSDK.swiftindex 09298d2730..325ebcf3c8 100644--- a/libs/cua/swift/Sources/CuaSDK/CuaSDK.swift+++ b/libs/cua/swift/Sources/CuaSDK/CuaSDK.swift@@ -11230,6 +11230,15 @@ public protocol SpacesProtocol: AnyObject, Sendable {*/func remove(space: String) async throws+ /**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+ func resize(space: String, cpus: UInt32?, memoryMb: UInt64?, diskGb: UInt32?) async throws -> SpaceResizeReport+/*** Resolves an id, legacy id, URL or display name.*/@@ -11276,13 +11285,22 @@ public protocol SpacesProtocol: AnyObject, Sendable {/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/func stop(space: String) async throws -> SpacePowerReport+ /**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+ func suspend(space: String) async throws -> SpacePowerReport+/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -12647,6 +12665,30 @@ open func remove(space: String)async throws {)}+ /**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+open func resize(space: String, cpus: UInt32?, memoryMb: UInt64?, diskGb: UInt32?)async throws -> SpaceResizeReport {+ return+ try await uniffiRustCallAsync(+ rustFutureFunc: {+ uniffi_cua_sdk_fn_method_spaces_resize(+ self.uniffiCloneHandle(),+ FfiConverterString.lower(space),FfiConverterOptionUInt32.lower(cpus),FfiConverterOptionUInt64.lower(memoryMb),FfiConverterOptionUInt32.lower(diskGb)+ )+ },+ pollFunc: ffi_cua_sdk_rust_future_poll_rust_buffer,+ completeFunc: ffi_cua_sdk_rust_future_complete_rust_buffer,+ freeFunc: ffi_cua_sdk_rust_future_free_rust_buffer,+ liftFunc: FfiConverterTypeSpaceResizeReport_lift,+ errorHandler: FfiConverterTypeCuaError_lift+ )+}+/*** Resolves an id, legacy id, URL or display name.*/@@ -12783,10 +12825,12 @@ open func start(space: String)async throws -> SpacePowerReport {/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/open func stop(space: String)async throws -> SpacePowerReport {return@@ -12805,6 +12849,28 @@ open func stop(space: String)async throws -> SpacePowerReport {)}+ /**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+open func suspend(space: String)async throws -> SpacePowerReport {+ return+ try await uniffiRustCallAsync(+ rustFutureFunc: {+ uniffi_cua_sdk_fn_method_spaces_suspend(+ self.uniffiCloneHandle(),+ FfiConverterString.lower(space)+ )+ },+ pollFunc: ffi_cua_sdk_rust_future_poll_rust_buffer,+ completeFunc: ffi_cua_sdk_rust_future_complete_rust_buffer,+ freeFunc: ffi_cua_sdk_rust_future_free_rust_buffer,+ liftFunc: FfiConverterTypeSpacePowerReport_lift,+ errorHandler: FfiConverterTypeCuaError_lift+ )+}+/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -36969,8 +37035,8 @@ public struct SpacePowerReport: Equatable, Hashable {*/public var state: String/**- * How it turns off: `suspend` (its memory is kept) or `stop` (its- * disk is kept).+ * How it was turned off: `suspend` (its memory is kept, and still in+ * use) or `stop` (its disk is kept; its memory is freed).*/public var power: String/**@@ -36988,8 +37054,8 @@ public struct SpacePowerReport: Equatable, Hashable {* `running`, `suspended` or `stopped`: the state it is in now.*/state: String,/**- * How it turns off: `suspend` (its memory is kept) or `stop` (its- * disk is kept).+ * How it was turned off: `suspend` (its memory is kept, and still in+ * use) or `stop` (its disk is kept; its memory is freed).*/power: String,/*** What happened, for people.@@ -37146,6 +37212,105 @@ public func FfiConverterTypeSpaceRelayRegistration_lower(_ value: SpaceRelayRegi}+/**+ * What [`Spaces::resize`] did: the shape the Space has now.+ */+public struct SpaceResizeReport: Equatable, Hashable {+ /**+ * The Space.+ */+ public var space: String+ /**+ * vCPUs (when changed).+ */+ public var cpus: UInt32?+ /**+ * Memory in MiB (when changed).+ */+ public var memoryMb: UInt64?+ /**+ * Disk in GiB (when grown).+ */+ public var diskGb: UInt32?+ /**+ * What happened, for people.+ */+ public var message: String++ // Default memberwise initializers are never public by default, so we+ // declare one manually.+ public init(+ /**+ * The Space.+ */space: String,+ /**+ * vCPUs (when changed).+ */cpus: UInt32?,+ /**+ * Memory in MiB (when changed).+ */memoryMb: UInt64?,+ /**+ * Disk in GiB (when grown).+ */diskGb: UInt32?,+ /**+ * What happened, for people.+ */message: String) {+ self.space = space+ self.cpus = cpus+ self.memoryMb = memoryMb+ self.diskGb = diskGb+ self.message = message+ }+++++}++#if compiler(>=6)+extension SpaceResizeReport: Sendable {}+#endif++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public struct FfiConverterTypeSpaceResizeReport: FfiConverterRustBuffer {+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SpaceResizeReport {+ return+ try SpaceResizeReport(+ space: FfiConverterString.read(from: &buf),+ cpus: FfiConverterOptionUInt32.read(from: &buf),+ memoryMb: FfiConverterOptionUInt64.read(from: &buf),+ diskGb: FfiConverterOptionUInt32.read(from: &buf),+ message: FfiConverterString.read(from: &buf)+ )+ }++ public static func write(_ value: SpaceResizeReport, into buf: inout [UInt8]) {+ FfiConverterString.write(value.space, into: &buf)+ FfiConverterOptionUInt32.write(value.cpus, into: &buf)+ FfiConverterOptionUInt64.write(value.memoryMb, into: &buf)+ FfiConverterOptionUInt32.write(value.diskGb, into: &buf)+ FfiConverterString.write(value.message, into: &buf)+ }+}+++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeSpaceResizeReport_lift(_ buf: RustBuffer) throws -> SpaceResizeReport {+ return try FfiConverterTypeSpaceResizeReport.lift(buf)+}++#if swift(>=5.8)+@_documentation(visibility: private)+#endif+public func FfiConverterTypeSpaceResizeReport_lower(_ value: SpaceResizeReport) -> RustBuffer {+ return FfiConverterTypeSpaceResizeReport.lower(value)+}++/*** One extra Space on this Mac.*/@@ -49676,6 +49841,9 @@ private let initializationResult: InitializationResult = {if (uniffi_cua_sdk_checksum_method_spaces_remove() != 23086) {return InitializationResult.apiChecksumMismatch}+ if (uniffi_cua_sdk_checksum_method_spaces_resize() != 2886) {+ return InitializationResult.apiChecksumMismatch+ }if (uniffi_cua_sdk_checksum_method_spaces_resolve() != 9986) {return InitializationResult.apiChecksumMismatch}@@ -49694,7 +49862,10 @@ private let initializationResult: InitializationResult = {if (uniffi_cua_sdk_checksum_method_spaces_start() != 32898) {return InitializationResult.apiChecksumMismatch}- if (uniffi_cua_sdk_checksum_method_spaces_stop() != 64586) {+ if (uniffi_cua_sdk_checksum_method_spaces_stop() != 59057) {+ return InitializationResult.apiChecksumMismatch+ }+ if (uniffi_cua_sdk_checksum_method_spaces_suspend() != 23817) {return InitializationResult.apiChecksumMismatch}if (uniffi_cua_sdk_checksum_method_spaces_volume_approve() != 8640) {diff --git a/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.h b/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.hindex 50e1a92019..866cab9a47 100644--- a/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.h+++ b/libs/cua/swift/Sources/cua_sdkFFI/include/cua_sdkFFI.h@@ -2294,6 +2294,11 @@ uint64_t uniffi_cua_sdk_fn_method_spaces_relay_unregister(uint64_t ptr, RustBuffuint64_t uniffi_cua_sdk_fn_method_spaces_remove(uint64_t ptr, RustBuffer space);#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_RESIZE+#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_RESIZE+uint64_t uniffi_cua_sdk_fn_method_spaces_resize(uint64_t ptr, RustBuffer space, RustBuffer cpus, RustBuffer memory_mb, RustBuffer disk_gb+);+#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_RESOLVE#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_RESOLVEuint64_t uniffi_cua_sdk_fn_method_spaces_resolve(uint64_t ptr, RustBuffer space@@ -2329,6 +2334,11 @@ uint64_t uniffi_cua_sdk_fn_method_spaces_start(uint64_t ptr, RustBuffer spaceuint64_t uniffi_cua_sdk_fn_method_spaces_stop(uint64_t ptr, RustBuffer space);#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_SUSPEND+#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_SUSPEND+uint64_t uniffi_cua_sdk_fn_method_spaces_suspend(uint64_t ptr, RustBuffer space+);+#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_VOLUME_APPROVE#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_FN_METHOD_SPACES_VOLUME_APPROVEuint64_t uniffi_cua_sdk_fn_method_spaces_volume_approve(uint64_t ptr, RustBuffer request_id, RustBuffer expires_in_secs@@ -5680,6 +5690,12 @@ uint16_t uniffi_cua_sdk_checksum_method_spaces_relay_unregister(void#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_REMOVEuint16_t uniffi_cua_sdk_checksum_method_spaces_remove(void+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_RESIZE+#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_RESIZE+uint16_t uniffi_cua_sdk_checksum_method_spaces_resize(void+);#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_RESOLVE@@ -5722,6 +5738,12 @@ uint16_t uniffi_cua_sdk_checksum_method_spaces_start(void#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_STOPuint16_t uniffi_cua_sdk_checksum_method_spaces_stop(void+);+#endif+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_SUSPEND+#define UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_SUSPEND+uint16_t uniffi_cua_sdk_checksum_method_spaces_suspend(void+);#endif#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SDK_CHECKSUM_METHOD_SPACES_VOLUME_APPROVEdiff --git a/libs/cua/swift/Tests/CuaTests/SpacesTests.swift b/libs/cua/swift/Tests/CuaTests/SpacesTests.swiftindex d2437a649b..6f591b130a 100644--- a/libs/cua/swift/Tests/CuaTests/SpacesTests.swift+++ b/libs/cua/swift/Tests/CuaTests/SpacesTests.swift@@ -125,12 +125,12 @@ func exerciseSpaces(_ cua: Cua, _ fx: Fixtures, tmp: URL, teleport: Bool = false@Suite(.serialized) struct SpacesTests {@Test func everyContractToolMapsToAGeneratedMethod() {let rows = spacesToolMethods()- #expect(rows.count == 96)+ #expect(rows.count == 97)// Swift spells `Class.method_name` as `methodName` on the generated// protocol; check each against the protocol's requirement list.let spaceMethods: Set<String> = ["add", "list", "resolve", "remove", "create", "delete",- "stop", "start", "space", "agentCapabilities", "listToolsJson", "callToolJson",+ "stop", "start", "resize", "space", "agentCapabilities", "listToolsJson", "callToolJson","cloudStatus", "cloudConnect", "cloudTest", "cloudDisconnect", "cloudSweep", "cloudAudit","cloudAddHost", "cloudBudget", "cloudHosts", "cloudPlan", "cloudReconcile","cloudRemoveHost", "prewarm", "prewarms", "removePrewarm",@@ -164,7 +164,8 @@ func exerciseSpaces(_ cua: Cua, _ fx: Fixtures, tmp: URL, teleport: Bool = false// line fails to compile if any is missing.let _: [(any SpacesProtocol) -> Any] = [{ $0.add }, { $0.list }, { $0.resolve }, { $0.remove }, { $0.create },- { $0.delete }, { $0.stop }, { $0.start }, { $0.space }, { $0.agentCapabilities },+ { $0.delete }, { $0.stop }, { $0.start }, { $0.resize }, { $0.suspend }, { $0.space },+ { $0.agentCapabilities },{ $0.listToolsJson }, { $0.callToolJson },{ $0.cloudStatus }, { $0.cloudConnect }, { $0.cloudTest }, { $0.cloudDisconnect },{ $0.cloudSweep }, { $0.cloudAudit },diff --git a/libs/cua/typescript/src/native/cua_sdk-ffi.ts b/libs/cua/typescript/src/native/cua_sdk-ffi.tsindex 1655096823..2ac9d5bd04 100644--- a/libs/cua/typescript/src/native/cua_sdk-ffi.ts+++ b/libs/cua/typescript/src/native/cua_sdk-ffi.ts@@ -2558,6 +2558,11 @@ const DEFINITIONS = {ret: FfiType.Handle,hasRustCallStatus: false,},+ "uniffi_cua_sdk_fn_method_spaces_resize": {+ args: [FfiType.Handle, FfiType.RustBuffer, FfiType.RustBuffer, FfiType.RustBuffer, FfiType.RustBuffer],+ ret: FfiType.Handle,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_fn_method_spaces_resolve": {args: [FfiType.Handle, FfiType.RustBuffer],ret: FfiType.Handle,@@ -2613,6 +2618,11 @@ const DEFINITIONS = {ret: FfiType.Handle,hasRustCallStatus: false,},+ "uniffi_cua_sdk_fn_method_spaces_suspend": {+ args: [FfiType.Handle, FfiType.RustBuffer],+ ret: FfiType.Handle,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_fn_method_spaces_volume_approve": {args: [FfiType.Handle, FfiType.RustBuffer, FfiType.RustBuffer],ret: FfiType.Handle,@@ -4973,6 +4983,11 @@ const DEFINITIONS = {ret: FfiType.UInt16,hasRustCallStatus: false,},+ "uniffi_cua_sdk_checksum_method_spaces_resize": {+ args: [],+ ret: FfiType.UInt16,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_checksum_method_spaces_resolve": {args: [],ret: FfiType.UInt16,@@ -5028,6 +5043,11 @@ const DEFINITIONS = {ret: FfiType.UInt16,hasRustCallStatus: false,},+ "uniffi_cua_sdk_checksum_method_spaces_suspend": {+ args: [],+ ret: FfiType.UInt16,+ hasRustCallStatus: false,+ },"uniffi_cua_sdk_checksum_method_spaces_volume_approve": {args: [],ret: FfiType.UInt16,@@ -6176,6 +6196,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_fn_method_spaces_relay_unregister(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_remove(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_remove_prewarm(uniffiSelf: bigint, id: Uint8Array): bigint;+ uniffi_cua_sdk_fn_method_spaces_resize(uniffiSelf: bigint, space: Uint8Array, cpus: Uint8Array, memoryMb: Uint8Array, diskGb: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_resolve(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_resources(uniffiSelf: bigint, visible: number): bigint;uniffi_cua_sdk_fn_method_spaces_routine_add(uniffiSelf: bigint, agent: Uint8Array, title: Uint8Array, prompt: Uint8Array, everyMinutes: Uint8Array, dailyAt: Uint8Array, weeklyOn: Uint8Array): bigint;@@ -6187,6 +6208,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_fn_method_spaces_space(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_start(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_stop(uniffiSelf: bigint, space: Uint8Array): bigint;+ uniffi_cua_sdk_fn_method_spaces_suspend(uniffiSelf: bigint, space: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_volume_approve(uniffiSelf: bigint, requestId: Uint8Array, expiresInSecs: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_volume_audit(uniffiSelf: bigint, limit: Uint8Array): bigint;uniffi_cua_sdk_fn_method_spaces_volume_cache_clear(uniffiSelf: bigint): bigint;@@ -6659,6 +6681,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_checksum_method_spaces_relay_unregister(): number;uniffi_cua_sdk_checksum_method_spaces_remove(): number;uniffi_cua_sdk_checksum_method_spaces_remove_prewarm(): number;+ uniffi_cua_sdk_checksum_method_spaces_resize(): number;uniffi_cua_sdk_checksum_method_spaces_resolve(): number;uniffi_cua_sdk_checksum_method_spaces_resources(): number;uniffi_cua_sdk_checksum_method_spaces_routine_add(): number;@@ -6670,6 +6693,7 @@ interface NativeModuleInterface {uniffi_cua_sdk_checksum_method_spaces_space(): number;uniffi_cua_sdk_checksum_method_spaces_start(): number;uniffi_cua_sdk_checksum_method_spaces_stop(): number;+ uniffi_cua_sdk_checksum_method_spaces_suspend(): number;uniffi_cua_sdk_checksum_method_spaces_volume_approve(): number;uniffi_cua_sdk_checksum_method_spaces_volume_audit(): number;uniffi_cua_sdk_checksum_method_spaces_volume_cache_clear(): number;diff --git a/libs/cua/typescript/src/native/cua_sdk.ts b/libs/cua/typescript/src/native/cua_sdk.tsindex 4d96d6b435..fa6a690263 100644--- a/libs/cua/typescript/src/native/cua_sdk.ts+++ b/libs/cua/typescript/src/native/cua_sdk.ts@@ -18948,8 +18948,8 @@ export type SpacePowerReport = {*/state: string,/**- * How it turns off: `suspend` (its memory is kept) or `stop` (its- * disk is kept).+ * How it was turned off: `suspend` (its memory is kept, and still in+ * use) or `stop` (its disk is kept; its memory is freed).*/power: string,/**@@ -19075,6 +19075,79 @@ const FfiConverterTypeSpaceRelayRegistration = (() => {return new FFIConverter();})();+/**+ * What [`Spaces::resize`] did: the shape the Space has now.+ */+export type SpaceResizeReport = {+ /**+ * The Space.+ */+ space: string,+ /**+ * vCPUs (when changed).+ */+ cpus?: number,+ /**+ * Memory in MiB (when changed).+ */+ memoryMb?: bigint,+ /**+ * Disk in GiB (when grown).+ */+ diskGb?: number,+ /**+ * What happened, for people.+ */+ message: string+}++/**+ * Generated factory for {@link SpaceResizeReport} record objects.+ */+export const SpaceResizeReport = (() => {+ const defaults = () => ({+ });+ const create = (() => {+ return uniffiCreateRecord<SpaceResizeReport, ReturnType<typeof defaults>>(defaults);+ })();+ return Object.freeze({+ create,+ new: create,+ defaults: () => Object.freeze(defaults()) as Partial<SpaceResizeReport>,+ });+})();++const FfiConverterTypeSpaceResizeReport = (() => {+ type TypeName = SpaceResizeReport;+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {+ read(from: RustBuffer): TypeName {+ return {+ space: FfiConverterString.read(from),+ cpus: FfiConverterOptionalUInt32.read(from),+ memoryMb: FfiConverterOptionalUInt64.read(from),+ diskGb: FfiConverterOptionalUInt32.read(from),+ message: FfiConverterString.read(from)+ };+ }+ write(value: TypeName, into: RustBuffer): void {+ FfiConverterString.write(value.space, into);+ FfiConverterOptionalUInt32.write(value.cpus, into);+ FfiConverterOptionalUInt64.write(value.memoryMb, into);+ FfiConverterOptionalUInt32.write(value.diskGb, into);+ FfiConverterString.write(value.message, into);+ }+ allocationSize(value: TypeName): number {+ return FfiConverterString.allocationSize(value.space) ++ FfiConverterOptionalUInt32.allocationSize(value.cpus) ++ FfiConverterOptionalUInt64.allocationSize(value.memoryMb) ++ FfiConverterOptionalUInt32.allocationSize(value.diskGb) ++ FfiConverterString.allocationSize(value.message);++ }+ };+ return new FFIConverter();+})();+/*** Options for [`Space::send_file`].*/@@ -38909,6 +38982,14 @@ export interface SpacesLike {* Ends prewarm `id` (its ready Spaces go). `false`: no such prewarm.*/removePrewarm(id: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<boolean>;+/**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+ resize(space: string, cpus: number | undefined, memoryMb: bigint | undefined, diskGb: number | undefined, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpaceResizeReport>;/*** Resolves an id, legacy id, URL or display name.*/@@ -38966,12 +39047,20 @@ export interface SpacesLike {start(space: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpacePowerReport>;/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/stop(space: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpacePowerReport>;+/**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+ suspend(space: string, asyncOpts_?: { signal: AbortSignal }) /*throws*/: Promise<SpacePowerReport>;/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -41030,6 +41119,45 @@ private constructor(pointer: UniffiHandle) {}}+/**+ * Gives a local VM Space another shape: `cpus` vCPUs, `memory_mb` MiB+ * of memory, a disk grown to `disk_gb` GiB (each `None` keeps it). It+ * shuts down and boots again from its own disk (a stopped one boots),+ * so its files stay and its memory and processes do not. Returns once+ * it is ready again.+ */+ async resize(space: string, cpus: number | undefined, memoryMb: bigint | undefined, diskGb: number | undefined, asyncOpts_?: { signal: AbortSignal }): Promise<SpaceResizeReport> /*throws*/ {+ const __stack = uniffiIsDebug ? new Error().stack : undefined;+ try {+ return await uniffiRustCallAsync(+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().uniffi_cua_sdk_fn_method_spaces_resize(+ uniffiTypeSpacesObjectFactory.clonePointer(this),FfiConverterString.lower(space, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt32.lower(cpus, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt64.lower(memoryMb, nativeModule().rustbuffer_alloc),FfiConverterOptionalUInt32.lower(diskGb, nativeModule().rustbuffer_alloc)+ );+ },+ /*pollFunc:*/ nativeModule().ffi_cua_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule().ffi_cua_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeSpaceResizeReport.lift.bind(FfiConverterTypeSpaceResizeReport),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeCuaError.lift.bind(FfiConverterTypeCuaError)+ );+ } catch (__error: any) {+ if (uniffiIsDebug && __error instanceof Error) {+ __error.stack = __stack;+ }+ throw __error;+ }+ }+/*** Resolves an id, legacy id, URL or display name.*/@@ -41387,10 +41515,12 @@ private constructor(pointer: UniffiHandle) {/*** Turns a Space off the way its provider can (`SpaceInfo.power`):- * suspends it, keeping its memory (a local container or QEMU VM), or- * stops it, keeping its disk (a local Lume VM; a Space one of your- * machines provides, which that machine stops). A cloud Space, a Space- * added by address and your own computers cannot be turned off.+ * stops it, keeping its disk and freeing its memory (a local VM; a+ * Space one of your machines provides, which that machine stops), or+ * suspends it, keeping its memory (a local container that cannot+ * stop). [`Spaces::suspend`] suspends a local container or QEMU VM on+ * purpose. A Space added by address and your own computers cannot be+ * turned off.*/async stop(space: string, asyncOpts_?: { signal: AbortSignal }): Promise<SpacePowerReport> /*throws*/ {const __stack = uniffiIsDebug ? new Error().stack : undefined;@@ -41424,6 +41554,43 @@ private constructor(pointer: UniffiHandle) {}}+/**+ * Suspends a local Space (a container or a QEMU VM), keeping its+ * memory: it resumes where it was, and its memory stays in use until+ * then. [`Spaces::stop`] stops it instead and frees its memory.+ */+ async suspend(space: string, asyncOpts_?: { signal: AbortSignal }): Promise<SpacePowerReport> /*throws*/ {+ const __stack = uniffiIsDebug ? new Error().stack : undefined;+ try {+ return await uniffiRustCallAsync(+ /*rustCaller:*/ uniffiCaller,+ /*rustFutureFunc:*/ () => {+ return nativeModule().uniffi_cua_sdk_fn_method_spaces_suspend(+ uniffiTypeSpacesObjectFactory.clonePointer(this),FfiConverterString.lower(space, nativeModule().rustbuffer_alloc)+ );+ },+ /*pollFunc:*/ nativeModule().ffi_cua_sdk_rust_future_poll_rust_buffer,+ /*cancelFunc:*/ nativeModule().ffi_cua_sdk_rust_future_cancel_rust_buffer,+ /*completeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_complete_rust_buffer,+ /*freeFunc:*/ nativeModule().ffi_cua_sdk_rust_future_free_rust_buffer,+ // Async returns always go through the JS-side converter: the+ // FFI symbol returns the future handle (u64), and the user-level+ // RustBuffer comes back via the shared `rust_future_complete_*`+ // export. The bytes the runtime hands back must be deserialized+ // here using the per-callable return-type converter.+ /*liftFunc:*/ FfiConverterTypeSpacePowerReport.lift.bind(FfiConverterTypeSpacePowerReport),+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),+ /*asyncOpts:*/ asyncOpts_,+ /*errorHandler:*/ FfiConverterTypeCuaError.lift.bind(FfiConverterTypeCuaError)+ );+ } catch (__error: any) {+ if (uniffiIsDebug && __error instanceof Error) {+ __error.stack = __stack;+ }+ throw __error;+ }+ }+/*** `volume_approve`: the request becomes a grant (with presence).*/@@ -45523,6 +45690,9 @@ function uniffiEnsureInitialized() {if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_remove_prewarm() !== 56425) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_remove_prewarm");}+ if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_resize() !== 2886) {+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_resize");+ }if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_resolve() !== 9986) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_resolve");}@@ -45553,9 +45723,12 @@ function uniffiEnsureInitialized() {if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_start() !== 32898) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_start");}- if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_stop() !== 64586) {+ if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_stop() !== 59057) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_stop");}+ if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_suspend() !== 23817) {+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_suspend");+ }if (nativeModule().uniffi_cua_sdk_checksum_method_spaces_volume_approve() !== 8640) {throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_sdk_checksum_method_spaces_volume_approve");}@@ -46084,6 +46257,7 @@ export default Object.freeze({FfiConverterTypeSpacePowerReport,FfiConverterTypeSpacePresence,FfiConverterTypeSpaceRelayRegistration,+ FfiConverterTypeSpaceResizeReport,FfiConverterTypeSpaceResources,FfiConverterTypeSpaceSendFileOptions,FfiConverterTypeSpaceSendFileReport,diff --git a/libs/cua/typescript/test/spaces.test.mjs b/libs/cua/typescript/test/spaces.test.mjsindex 53eb6848d2..5e7ade61bb 100644--- a/libs/cua/typescript/test/spaces.test.mjs+++ b/libs/cua/typescript/test/spaces.test.mjs@@ -45,7 +45,7 @@ function findFile(dir, name, budget = { n: 0 }) {test("every contract tool maps to a generated method", () => {const rows = spacesApi.spacesToolMethods()- assert.equal(rows.length, 96)+ assert.equal(rows.length, 97)const classes = { Spaces: spacesApi.Spaces, Space: spacesApi.Space }for (const row of rows) {const [cls, method] = row.method.split(".")@@ -259,7 +259,7 @@ async function daemonExercise(cli, teleport) {const discovery = JSON.parse(readFileSync(join(home, "daemon.json"), "utf8"))const session = new McpSession(new McpHttpTransport({ url: discovery.loopback_url, token: discovery.token }))const tools = await session.listTools()- assert.equal(tools.length, 96)+ assert.equal(tools.length, 97)const rows = await session.callJson("list_spaces")assert.deepEqual(rows.map((r) => r.id), [info.id])assert.equal(await session.callText("space_bash", { space: info.id, command: "echo webview" }), "webview\n[exit 0]")diff --git a/scripts/docs-generators/cli-specs/cua.json b/scripts/docs-generators/cli-specs/cua.jsonindex 11f7512711..82e4496ee0 100644--- a/scripts/docs-generators/cli-specs/cua.json+++ b/scripts/docs-generators/cli-specs/cua.json@@ -13310,7 +13310,7 @@"usage": "cua spaces delete [OPTIONS] <SPACE>"},{- "abstract": "Turn a Space off: a local container or QEMU VM is suspended (its memory is kept), a Lume VM or a Space one of your computers provides is stopped (its disk is kept), and so is a Space in your own cloud (`--on aws`, `gcp`: compute billing stops; `hetzner`: still billed). Modal sandboxes and Spaces added by address cannot be turned off",+ "abstract": "Turn a Space off: a local VM (QEMU or Lume) or a Space one of your computers provides is stopped, keeping its disk and freeing its memory, and so is a Space in your own cloud (`--on aws`, `gcp`: compute billing stops; `hetzner`: still billed). A local container is stopped or suspended as its runtime can. `cua spaces suspend` keeps a local Space's memory instead. Modal sandboxes and Spaces added by address cannot be turned off","after_help": "Examples:\n cua spaces stop local:studio\n cua spaces stop relay:space-0123456789abcdef --json","aliases": [],"arguments": [@@ -13334,6 +13334,105 @@"subcommands": [],"usage": "cua spaces stop [OPTIONS] <SPACE>"},+ {+ "abstract": "Suspend a local Space (a container or QEMU VM): its memory is kept, and stays in use, so it resumes where it was with `cua spaces start`. `cua spaces stop` frees the memory instead",+ "after_help": "Examples:\n cua spaces suspend local:studio",+ "aliases": [],+ "arguments": [+ {+ "default_value": null,+ "help": "Space id or name",+ "hidden": false,+ "is_optional": false,+ "name": "SPACE",+ "possible_values": [],+ "repeatable": false,+ "type": "string"+ }+ ],+ "flags": [],+ "hidden": false,+ "hidden_aliases": [],+ "name": "suspend",+ "options": [],+ "subcommand_optional": false,+ "subcommands": [],+ "usage": "cua spaces suspend [OPTIONS] <SPACE>"+ },+ {+ "abstract": "Give a local VM Space more or fewer vCPUs, more or less memory, or a bigger disk. It shuts down and boots again from its own disk (a stopped one boots): its files stay, its running processes do not. A disk never shrinks",+ "after_help": "Examples:\n cua spaces resize local:builder --memory-mb 24576\n cua spaces resize builder --cpus 8 --disk-gb 200 --json",+ "aliases": [],+ "arguments": [+ {+ "default_value": null,+ "help": "Space id or name",+ "hidden": false,+ "is_optional": false,+ "name": "SPACE",+ "possible_values": [],+ "repeatable": false,+ "type": "string"+ }+ ],+ "flags": [],+ "hidden": false,+ "hidden_aliases": [],+ "name": "resize",+ "options": [+ {+ "aliases": [],+ "default_value": null,+ "env": null,+ "help": "vCPUs",+ "hidden": false,+ "is_optional": true,+ "multiple_values": false,+ "name": "cpus",+ "possible_values": [],+ "repeatable": false,+ "short_name": null,+ "takes_value": true,+ "type": "integer",+ "value_name": "CPUS"+ },+ {+ "aliases": [],+ "default_value": null,+ "env": null,+ "help": "Memory in MiB",+ "hidden": false,+ "is_optional": true,+ "multiple_values": false,+ "name": "memory-mb",+ "possible_values": [],+ "repeatable": false,+ "short_name": null,+ "takes_value": true,+ "type": "integer",+ "value_name": "MEMORY_MB"+ },+ {+ "aliases": [],+ "default_value": null,+ "env": null,+ "help": "Grow the disk to this many GiB",+ "hidden": false,+ "is_optional": true,+ "multiple_values": false,+ "name": "disk-gb",+ "possible_values": [],+ "repeatable": false,+ "short_name": null,+ "takes_value": true,+ "type": "integer",+ "value_name": "DISK_GB"+ }+ ],+ "subcommand_optional": false,+ "subcommands": [],+ "usage": "cua spaces resize [OPTIONS] <SPACE>"+ },{"abstract": "Turn a Space back on: resume a suspended one or boot a stopped one","after_help": "Examples:\n cua spaces start local:studio\n cua spaces start studio --json",diff --git a/scripts/docs-generators/cua-sdk.ts b/scripts/docs-generators/cua-sdk.tsindex 320709491c..3b051acf73 100644--- a/scripts/docs-generators/cua-sdk.ts+++ b/scripts/docs-generators/cua-sdk.ts@@ -487,9 +487,18 @@ export const PAGES: PageSpec[] = [title: 'Spaces',description: 'The Spaces registry: create, add, resolve, delete and remove Spaces, their create options, and agent runs in a Space.',intro:- '`cua.spaces()` returns the `Spaces` registry. Create a Space where `on` says (local or cloud), or add an existing machine by URL, then open a [`Space`](/cua-sdk/reference/spaces/space).',+ '`cua.spaces()` returns the `Spaces` registry. Create a Space where `on` says (local or cloud), or add an existing machine by URL, then open a [`Space`](/cua-sdk/reference/spaces/space). See [resize](/cua-sdk/reference/spaces/resize) to change a local VM\'s shape.',items: ['Spaces', 'SpaceInfo', 'SpaceList', 'SpacePowerReport', 'spaces_tool_methods', 'SpacesToolMethod'],},+ {+ slug: 'spaces/resize',+ title: 'Resize a Space',+ description: 'Change a local VM\'s CPU, memory or disk while keeping its files.',+ intro:+ '`Spaces.resize` boots a stopped local VM from its own disk after changing its shape. The disk can grow; its files stay in place.',+ items: ['SpaceResizeReport'],+ members: [{ object: 'Spaces', title: 'Resize', methods: ['resize'] }],+ },{slug: 'spaces/lifetime',title: 'Lifetime and egress',