import { APIResource } from "../../../core/resource.js"; import * as FilesAPI from "./files.js"; import { FileListParams, FileListResponse, FileMkdirParams, FileReadParams, FileReadResponse, FileRemoveParams, FileWriteParams, Files } from "./files.js"; import { APIPromise } from "../../../core/api-promise.js"; import { RequestOptions } from "../../../internal/request-options.js"; /** * Run heavy work in Village-managed compute sandboxes. */ export declare class Sandboxes extends APIResource { files: FilesAPI.Files; /** * Create a Village-managed Modal Sandbox. Village owns image selection, * credentials, workspace attribution, limits, billing, and cleanup. */ create(body: SandboxCreateParams, options?: RequestOptions): APIPromise; /** * Execute a command in a compute sandbox */ exec(sandboxID: string, body: SandboxExecParams, options?: RequestOptions): APIPromise; /** * Get a compute sandbox */ get(sandboxID: string, options?: RequestOptions): APIPromise; /** * Terminate a compute sandbox */ terminate(sandboxID: string, body: SandboxTerminateParams, options?: RequestOptions): APIPromise; /** * Wait for a compute sandbox */ wait(sandboxID: string, options?: RequestOptions): APIPromise; } export interface Sandbox { /** * Village-managed sandbox ID. */ id: string; /** * Creation timestamp, if available. */ created_at?: string | null; /** * Sandbox name, if one was provided. */ name?: string | null; /** * Sandbox purpose tag. */ purpose?: string | null; /** * Current sandbox status. */ status?: 'running' | 'exited' | 'terminated' | null; } export interface SandboxExecResult { /** * Process exit code. */ exit_code: number; /** * Decoded stderr text. */ stderr_text: string; /** * Decoded stdout text. */ stdout_text: string; } export interface SandboxFileEntry { /** * Entry basename. */ name: string; /** * Absolute path inside the sandbox. */ path: string; /** * Last modified timestamp, if known. */ modified_at?: string | null; /** * Entry size in bytes, if known. */ size?: number | null; /** * Entry type, if known. */ type?: string | null; } export interface SandboxCreateParams { /** * Optional APT packages to install into the server-managed sandbox image. */ apt_packages?: Array | null; /** * Whether outbound network access should be blocked. */ block_network?: boolean | null; /** * Command used to start the sandbox. Image selection is managed by Village. */ command?: Array | null; /** * CPU request or request/limit pair. */ cpu?: number | Array | null; /** * Maximum idle time in seconds before the sandbox may be cleaned up. */ idle_timeout?: number | null; /** * Optional shell scripts to run while building the sandbox image, after requested * package installs. */ init_scripts?: Array | null; /** * Memory request in MiB, or request/limit pair. */ memory?: number | Array | null; /** * Optional server-scoped sandbox name. */ name?: string | null; /** * Whether the sandbox should start with a PTY. */ pty?: boolean | null; /** * Optional purpose tag for attribution, cleanup, limits, and billing. */ purpose?: string | null; /** * Optional Python packages to install into the server-managed sandbox image. */ python_packages?: Array | null; /** * Maximum sandbox lifetime in seconds. */ timeout?: number | null; /** * Whether Modal sandbox startup should be verbose. */ verbose?: boolean | null; /** * Initial working directory. */ workdir?: string | null; } export interface SandboxExecParams { /** * Command and arguments to execute. */ command: Array; /** * Run the process with a PTY. */ pty?: boolean; /** * Maximum process runtime in seconds. */ timeout?: number | null; /** * Process working directory. */ workdir?: string | null; } export interface SandboxTerminateParams { /** * Wait until termination completes before returning. */ wait?: boolean; } export declare namespace Sandboxes { export { type Sandbox as Sandbox, type SandboxExecResult as SandboxExecResult, type SandboxFileEntry as SandboxFileEntry, type SandboxCreateParams as SandboxCreateParams, type SandboxExecParams as SandboxExecParams, type SandboxTerminateParams as SandboxTerminateParams, }; export { Files as Files, type FileListResponse as FileListResponse, type FileReadResponse as FileReadResponse, type FileListParams as FileListParams, type FileMkdirParams as FileMkdirParams, type FileReadParams as FileReadParams, type FileRemoveParams as FileRemoveParams, type FileWriteParams as FileWriteParams, }; } //# sourceMappingURL=sandboxes.d.ts.map