import type { EnvVar, HandoffInit, HostPermissions, ModificationPolicy, MountOptions, NetworkPolicy, OwnedVolumeStorage, SandboxLogLevel, SandboxPolicy, SecretSubstitution, SecurityProfile, StatVirtualization } from "./domain.js"; export type * from "./domain.js"; import type { SnapshotManifest } from "./snapshot.js"; export type * from "./snapshot.js"; export type CloudCreateSandboxRequest = { "source": "oci"; /** * OCI image reference. */ reference: string; /** * CPU, memory, and writable-disk resources. */ resources: CloudSandboxResources; /** * Rootfs patches applied before VM start. */ patches: Array; /** * OCI image pull policy. */ pull_policy: CloudPullPolicy; /** * Unique sandbox name. */ name: string; /** * Guest runtime options. */ runtime: CloudSandboxRuntimeOptions; /** * Environment variables visible to commands in the sandbox. */ env: Array; /** * User-defined labels attached to the sandbox. */ labels: { [key in string]: string; }; /** * Sandbox-wide resource limits inherited by guest processes. */ rlimits: Array; /** * Volume mounts. */ mounts: Array; /** * Network specification. */ network: CloudNetworkSpec; /** * Hand off PID 1 to a guest init binary after agentd setup. */ init: HandoffInit | null; /** * In-guest security profile. */ security_profile: SecurityProfile; /** * Sandbox lifecycle policy. */ lifecycle: SandboxPolicy; } | { "source": "bind"; /** * Host directory used as the root filesystem. */ path: string; /** * CPU and memory resources. */ resources: CloudSandboxComputeResources; /** * Rootfs patches applied before VM start. */ patches: Array; /** * Unique sandbox name. */ name: string; /** * Guest runtime options. */ runtime: CloudSandboxRuntimeOptions; /** * Environment variables visible to commands in the sandbox. */ env: Array; /** * User-defined labels attached to the sandbox. */ labels: { [key in string]: string; }; /** * Sandbox-wide resource limits inherited by guest processes. */ rlimits: Array; /** * Volume mounts. */ mounts: Array; /** * Network specification. */ network: CloudNetworkSpec; /** * Hand off PID 1 to a guest init binary after agentd setup. */ init: HandoffInit | null; /** * In-guest security profile. */ security_profile: SecurityProfile; /** * Sandbox lifecycle policy. */ lifecycle: SandboxPolicy; } | { "source": "disk_image"; /** * Host path to the disk image. */ path: string; /** * Disk image format. */ format: CloudDiskImageFormat; /** * Inner filesystem type, when it cannot be detected automatically. */ fstype: string | null; /** * CPU and memory resources. */ resources: CloudSandboxComputeResources; /** * Rootfs patches applied before VM start. */ patches: Array; /** * Unique sandbox name. */ name: string; /** * Guest runtime options. */ runtime: CloudSandboxRuntimeOptions; /** * Environment variables visible to commands in the sandbox. */ env: Array; /** * User-defined labels attached to the sandbox. */ labels: { [key in string]: string; }; /** * Sandbox-wide resource limits inherited by guest processes. */ rlimits: Array; /** * Volume mounts. */ mounts: Array; /** * Network specification. */ network: CloudNetworkSpec; /** * Hand off PID 1 to a guest init binary after agentd setup. */ init: HandoffInit | null; /** * In-guest security profile. */ security_profile: SecurityProfile; /** * Sandbox lifecycle policy. */ lifecycle: SandboxPolicy; } | { "source": "disk_snapshot"; /** * Disk snapshot to restore. */ disk_snapshot_ref: CloudSnapshotLocation; /** * CPU and memory resources. */ resources: CloudSandboxComputeResources; /** * Pull policy used if the snapshot's pinned base image must be fetched. */ pull_policy: CloudPullPolicy; /** * Unique sandbox name. */ name: string; /** * Guest runtime options. */ runtime: CloudSandboxRuntimeOptions; /** * Environment variables visible to commands in the sandbox. */ env: Array; /** * User-defined labels attached to the sandbox. */ labels: { [key in string]: string; }; /** * Sandbox-wide resource limits inherited by guest processes. */ rlimits: Array; /** * Volume mounts. */ mounts: Array; /** * Network specification. */ network: CloudNetworkSpec; /** * Hand off PID 1 to a guest init binary after agentd setup. */ init: HandoffInit | null; /** * In-guest security profile. */ security_profile: SecurityProfile; /** * Sandbox lifecycle policy. */ lifecycle: SandboxPolicy; }; export type CloudSandboxSpec = { /** * Unique sandbox name. */ name: string; /** * Guest runtime options. */ runtime: CloudSandboxRuntimeOptions; /** * Environment variables visible to commands in the sandbox. */ env: Array; /** * User-defined labels attached to the sandbox. */ labels: { [key in string]: string; }; /** * Sandbox-wide resource limits inherited by guest processes. */ rlimits: Array; /** * Volume mounts. */ mounts: Array; /** * Network specification. */ network: CloudNetworkSpec; /** * Hand off PID 1 to a guest init binary after agentd setup. */ init: HandoffInit | null; /** * In-guest security profile. */ security_profile: SecurityProfile; /** * Sandbox lifecycle policy. */ lifecycle: SandboxPolicy; }; export type CloudSandboxComputeResources = { /** * Number of virtual CPUs. */ vcpus: number; /** * Guest memory in MiB. */ memory_mib: number; }; export type CloudRootfsSource = { "type": "bind"; /** * Host path to bind mount. */ path: string; } | { "type": "oci"; /** * OCI image reference (e.g. `python`). */ reference: string; } | { "type": "disk_image"; /** * Path to the disk image file on the host. */ path: string; /** * Disk image format. */ format: CloudDiskImageFormat; /** * Inner filesystem type (optional; auto-detected if absent). */ fstype: string | null; }; export type CloudVolumeMount = { "type": "owned"; /** * Absolute guest mount path. */ guest: string; /** * Private directory or ext4 storage. */ storage: OwnedVolumeStorage; /** * Guest mount options. */ options: MountOptions; /** * Directory stat policy. */ stat_virtualization: StatVirtualization; /** * Directory host permission policy. */ host_permissions: HostPermissions; } | { "type": "bind"; /** * Host directory to bind into the guest. */ host: string; /** * Guest path to mount at. */ guest: string; /** * Mount options (read-only, no-exec, …). */ options: MountOptions; /** * How guest `stat()` results are virtualized. */ stat_virtualization: StatVirtualization; /** * Host permission policy applied to the mount. */ host_permissions: HostPermissions; /** * Optional guest-write quota in MiB. */ quota_mib: number | null; } | { "type": "named"; /** * Named volume to mount. */ name: string; /** * Guest path to mount at. */ guest: string; /** * Mount options (read-only, no-exec, …). */ options: MountOptions; /** * How guest `stat()` results are virtualized. */ stat_virtualization: StatVirtualization; /** * Host permission policy applied to the mount. */ host_permissions: HostPermissions; } | { "type": "tmpfs"; /** * Guest path to mount at. */ guest: string; /** * Optional size cap in MiB. */ size_mib: number | null; /** * Mount options (read-only, no-exec, …). */ options: MountOptions; } | { "type": "disk_image"; /** * Host path to the disk image file. */ host: string; /** * Guest path to mount at. */ guest: string; /** * Disk image format. */ format: CloudDiskImageFormat; /** * Inner filesystem type (auto-detected if absent). */ fstype: string | null; /** * Mount options (read-only, no-exec, …). */ options: MountOptions; }; export type CloudSandboxResources = { /** * Number of virtual CPUs. */ vcpus: number; /** * Guest memory in MiB. */ memory_mib: number; /** * Writable disk size in MiB. Applies only to OCI root filesystems. */ disk_size_mib?: number | null; }; export type CloudSandboxRuntimeOptions = { /** * Working directory for guest commands. */ workdir: string | null; /** * Default shell. */ shell: string | null; /** * Named in-guest scripts. */ scripts: { [key in string]: string; }; /** * Entrypoint override. */ entrypoint: Array | null; /** * Command override. */ cmd: Array | null; /** * Guest user. */ user: string | null; /** * Runtime log level. */ log_level: SandboxLogLevel | null; }; export type CloudPullPolicy = "if_missing" | "always" | "never"; export type CloudDiskImageFormat = "qcow2" | "raw" | "vmdk"; export type CloudRlimitResource = "cpu" | "fsize" | "data" | "stack" | "core" | "rss" | "nproc" | "nofile" | "memlock" | "as" | "locks" | "sigpending" | "msgqueue" | "nice" | "rtprio" | "rttime"; export type CloudRlimit = { /** * Resource type. */ resource: CloudRlimitResource; /** * Soft limit (can be raised up to the hard limit by the process). */ soft: number; /** * Hard limit (ceiling, requires privileges to raise). */ hard: number; }; export type CloudPatch = { "type": "text"; /** * Absolute guest path, such as `/etc/app.conf`. */ path: string; /** * Text content to write. */ content: string; /** * File permissions, such as `0o644`. `None` uses the default. */ mode: number | null; /** * Allow replacing a file that already exists in the rootfs. */ replace: boolean; } | { "type": "file"; /** * Absolute guest path. */ path: string; /** * Raw byte content to write. */ content: Array; /** * File permissions, such as `0o644`. `None` uses the default. */ mode: number | null; /** * Allow replacing a file that already exists in the rootfs. */ replace: boolean; } | { "type": "copy_file"; /** * Host path to copy from. */ src: string; /** * Absolute guest destination path. */ dst: string; /** * File permissions. `None` preserves source permissions. */ mode: number | null; /** * Allow replacing a file that already exists in the rootfs. */ replace: boolean; } | { "type": "copy_dir"; /** * Host directory to copy from. */ src: string; /** * Absolute guest destination path. */ dst: string; /** * Allow replacing files that already exist in the rootfs. */ replace: boolean; } | { "type": "symlink"; /** * Symlink target path. */ target: string; /** * Absolute guest path where the symlink is created. */ link: string; /** * Allow replacing a path that already exists in the rootfs. */ replace: boolean; } | { "type": "mkdir"; /** * Absolute guest path. */ path: string; /** * Directory permissions, such as `0o755`. `None` uses the default. */ mode: number | null; } | { "type": "remove"; /** * Absolute guest path to remove. */ path: string; } | { "type": "append"; /** * Absolute guest path of the file to append to. */ path: string; /** * Content to append. */ content: string; }; export type CloudNetworkSpec = { /** * Whether networking is enabled for this sandbox. */ enabled: boolean; /** * Egress/ingress policy. */ policy: NetworkPolicy | null; /** * Secret-substitution config. */ secrets: CloudSecretsConfig | null; /** * Require hostname-based policy allows to use inspectable application authority. */ strict: boolean; /** * Max concurrent TCP connections. */ max_connections?: number | null; /** * Max concurrent UDP relay sessions. Omitted is unlimited for single-tenant and 1024 for multi-tenant; zero means unlimited. */ max_udp_connections?: number | null; }; export type CloudSecretsConfig = { /** * Secrets to inject. */ entries: Array; /** * Default placeholder passthrough hosts, including for secrets added later. * A per-secret violation action overrides this default. */ passthrough_hosts?: Array | null; /** * Default action when a placeholder leaks to a disallowed host. */ violation_action: CloudViolationAction; }; export type CloudSecretEntry = { /** * Environment variable name exposed to the sandbox. */ env_var: string; /** * The secret value (empty when `source` carries a reference instead). */ value: string; /** * Host-side source resolved into `value` at spawn time. */ source?: CloudSecretSource | null; /** * Placeholder the sandbox sees instead of the real value. */ placeholder: string; /** * Hosts allowed to receive this secret. */ allowed_hosts: Array; /** * Where the secret may be injected. */ substitution: SecretSubstitution; /** * Hosts allowed to receive the placeholder unchanged. */ passthrough_hosts: Array; /** * Per-secret violation action overriding the config default. */ violation_action?: CloudViolationAction | null; /** * Require verified TLS identity before substituting (default: true). */ require_tls_identity: boolean; }; export type CloudSecretSource = { "type": "env"; /** * Host environment variable name. */ var: string; } | { "type": "store"; /** * Store-specific secret reference. */ reference: string; }; export type CloudHostPattern = { "type": "exact"; /** * Hostname to match exactly. */ value: string; } | { "type": "wildcard"; /** * Wildcard pattern. */ value: string; } | { "type": "any"; }; export type CloudViolationAction = { "type": "block"; } | { "type": "block_and_log"; } | { "type": "block_and_terminate"; }; export type CloudCreateSandboxResponse = { /** * Server-side UUID. */ id: string; /** * Owning org's UUID. */ org_id: string; /** * User-facing, per-org sandbox name. */ name: string; /** * Canonical, resolved SSH username token. */ slug: string; /** * Current lifecycle status. */ status: CloudSandboxStatus; /** * Why the sandbox is not running yet, when known. Only present while * `status` is `starting`. */ status_reason: CloudSandboxStatusReason | null; /** * Curated resolved-spec projection returned by the control plane, when * available. Lifecycle and agent operations intentionally do not depend * on reconstructing the create request from this server-owned view. */ spec?: unknown | null | undefined; /** * Whether the sandbox should be removed when its allocation terminates. */ ephemeral: boolean; /** * Creation timestamp. */ created_at: string; /** * Last start timestamp, when known. */ started_at: string | null; /** * Last stop timestamp, when known. */ stopped_at: string | null; /** * Human-readable message for the most recent failure, when any. */ last_failure_message: string | null; }; export type CloudSandboxStatus = "created" | "starting" | "running" | "stopping" | "stopped" | "failed"; export type CloudSandboxStatusReason = "scheduling" | "insufficient_capacity"; export type CloudCreateSnapshotRequest = { "kind": "disk"; /** * Immutable identifier of the sandbox to capture. */ sandbox_id: string; /** * Snapshot name. */ name: string; /** * Directory on a mounted host volume to write the artifact into. `None` * stores the snapshot in managed snapshot storage. */ dest_dir?: string | null; /** * User-defined labels stored on the snapshot. */ labels?: { [key in string]: string; }; /** * Replace an existing snapshot with the same name. */ force?: boolean; /** * Record payload integrity metadata during capture. */ record_integrity?: boolean; }; export type CloudSnapshotSpec = { /** * Immutable identifier of the sandbox to capture. */ sandbox_id: string; /** * Snapshot name. */ name: string; /** * Directory on a mounted host volume to write the artifact into. `None` * stores the snapshot in managed snapshot storage. */ dest_dir?: string | null; /** * User-defined labels stored on the snapshot. */ labels?: { [key in string]: string; }; /** * Replace an existing snapshot with the same name. */ force?: boolean; /** * Record payload integrity metadata during capture. */ record_integrity?: boolean; }; export type CloudSnapshot = { "kind": "disk"; /** * Snapshot name. */ name: string; /** * Where the snapshot artifact resides. */ location: CloudSnapshotLocation; /** * Identifier of the sandbox the snapshot was captured from, when known. */ sandbox_id: string | null; /** * Snapshot identity: the `sha256:` digest of the canonical descriptor. */ digest: string; /** * Stored payload size in bytes. */ size_bytes: number; /** * Canonical snapshot descriptor. */ manifest: SnapshotManifest; /** * User-defined labels stored on the snapshot. */ labels: { [key in string]: string; }; /** * Creation timestamp. */ created_at: string; }; export type CloudSnapshotDetails = { /** * Snapshot name. */ name: string; /** * Where the snapshot artifact resides. */ location: CloudSnapshotLocation; /** * Identifier of the sandbox the snapshot was captured from, when known. */ sandbox_id: string | null; /** * Snapshot identity: the `sha256:` digest of the canonical descriptor. */ digest: string; /** * Stored payload size in bytes. */ size_bytes: number; /** * Canonical snapshot descriptor. */ manifest: SnapshotManifest; /** * User-defined labels stored on the snapshot. */ labels: { [key in string]: string; }; /** * Creation timestamp. */ created_at: string; }; export type CloudSnapshotLocation = { "type": "managed"; /** * Identifier of the stored artifact. */ id: string; } | { "type": "host_volume"; /** * Artifact directory path on the host volume. */ path: string; }; export type CloudSnapshotOperation = { /** * Server-side operation identifier. */ id: string; /** * Kind of snapshot being captured. */ kind: CloudSnapshotKind; /** * Current operation status. */ status: CloudSnapshotOperationStatus; /** * The resulting snapshot, present once the operation succeeds. */ result: CloudSnapshot | null; /** * Error details for a failed operation. */ error: CloudErrorDetails | null; /** * Creation timestamp. */ created_at: string; /** * Timestamp of the most recent status change. */ updated_at: string; /** * Timestamp of the terminal status, when the operation has finished. */ completed_at: string | null; }; export type CloudSnapshotOperationStatus = "queued" | "in_progress" | "succeeded" | "failed"; export type CloudSnapshotKind = "disk"; export type CloudSandboxModificationPlanRequest = { /** * Policy the plan is classified under. */ policy: ModificationPolicy; /** * Secret changes, in patch order. */ secrets?: Array; /** * Names of secrets to remove. */ secrets_remove?: Array; }; export type CloudSecretPlanEntry = { /** * Name of the secret, the env var it is exposed as. */ name: string; /** * New secret material: provided when the secret is added or rotated, absent for a * metadata-only change. */ material: CloudSecretMaterial; /** * New guest-visible placeholder. */ placeholder?: string | null; /** * New hosts allowed to receive the secret. */ allowed_hosts?: Array | null; /** * New substitution locations. */ substitution?: SecretSubstitution | null; /** * New hosts allowed to receive the placeholder unchanged. */ passthrough_hosts?: Array | null; /** * New per-secret violation action. */ violation_action?: CloudViolationAction | null; /** * New verified-TLS-identity requirement. */ require_tls_identity?: boolean | null; }; export type CloudSecretMaterial = { "type": "provided"; } | { "type": "absent"; }; export type CloudSandboxModificationApplyRequest = { /** * Policy the change is applied under. */ policy: ModificationPolicy; /** * Secret changes, in patch order. */ secrets?: Array; /** * Names of secrets to remove. */ secrets_remove?: Array; }; export type CloudSecretApplyEntry = { /** * Name of the secret, the env var it is exposed as. */ name: string; /** * New secret value. Present when the secret is added or rotated. */ value?: CloudSecretValue | null; /** * New guest-visible placeholder. */ placeholder?: string | null; /** * New hosts allowed to receive the secret. */ allowed_hosts?: Array | null; /** * New substitution locations. */ substitution?: SecretSubstitution | null; /** * New hosts allowed to receive the placeholder unchanged. */ passthrough_hosts?: Array | null; /** * New per-secret violation action. */ violation_action?: CloudViolationAction | null; /** * New verified-TLS-identity requirement. */ require_tls_identity?: boolean | null; }; export type CloudSecretValue = string; export type CloudSandboxModificationPlan = { /** * Sandbox being modified. */ sandbox: string; /** * Sandbox status used for classification. */ status: string; /** * Whether the changes were applied. */ applied: boolean; /** * Modification policy used to produce the plan. */ policy: ModificationPolicy; /** * Planned changes. */ changes: Array; /** * Conflicts that must be resolved before the patch can apply. */ conflicts: Array; /** * Non-fatal warnings about the patch or current runtime capabilities. */ warnings: Array; /** * Live resource resize outcomes, populated by apply when a live change ran. */ resize_status?: Array; }; export type CloudPlannedChange = { "kind": "config"; } & CloudConfigPlannedChange | { "kind": "secret"; } & CloudSecretPlannedChange; export type CloudConfigPlannedChange = { /** * Config field being changed. */ field: string; /** * Natural change type for table rendering. */ change: CloudChangeKind; /** * Previous safe visible state. */ before?: string | null; /** * New safe visible state. */ after?: string | null; /** * When or whether the change can take effect. */ disposition: CloudModificationDisposition; /** * Human-readable reason for this classification, when useful. */ reason?: string | null; }; export type CloudSecretPlannedChange = { /** * Table field name. This is always `secret`. */ field: string; /** * Stable secret identity, usually the environment variable name. */ name: string; /** * Natural change type for table rendering. */ change: CloudSecretChangeKind; /** * Previous guest-visible reference or placeholder. */ before_ref?: string | null; /** * New guest-visible reference or placeholder. */ after_ref?: string | null; /** * When or whether the change can take effect. */ disposition: CloudModificationDisposition; /** * Allowed hosts after the requested change. */ allow_hosts?: Array; /** * Human-readable reason for this classification, when useful. */ reason?: string | null; }; export type CloudChangeKind = "added" | "updated" | "removed"; export type CloudSecretChangeKind = "added" | "rotated" | "removed" | "renamed" | "hosts_updated" | "placeholder_updated"; export type CloudModificationDisposition = "live" | "next_start" | "requires_restart" | "unsupported"; export type CloudModificationConflict = { /** * Field with the conflict. */ field: string; /** * Human-readable conflict description. */ message: string; }; export type CloudModificationWarning = { /** * Field associated with the warning. */ field: string; /** * Human-readable warning description. */ message: string; }; export type CloudResourceResizeStatus = { /** * Resource being resized. */ resource: CloudResourceKind; /** * Requested value. */ requested: string; /** * Actual value observed in the sandbox. */ actual: string; /** * Enforced value. */ enforced: string; /** * Convergence state. */ state: CloudResourceConvergenceState; }; export type CloudResourceKind = "cpus" | "memory"; export type CloudResourceConvergenceState = "accepted" | "converging" | "applied" | "guest_refused" | "failed"; export type CloudPaginated = { /** * Page of response items. */ data: Array; /** * Cursor for the next page, when one exists. */ next_cursor: string | null; }; export type CloudMessageResponse = { /** * Human-readable response message. */ message: string; }; export type CloudErrorBody = { /** * Flat machine-readable error code, when returned in this shape. */ code: string | null; /** * Flat human-readable error message, when returned in this shape. */ message: string | null; /** * Nested error object returned by the API error responder. */ error: CloudErrorDetails | null; }; export type CloudErrorDetails = { /** * Machine-readable error code. */ code: string | null; /** * Human-readable error message. */ message: string | null; }; //# sourceMappingURL=cloud.d.ts.map