import { type ToolOutputImage } from '@openai/agents-core'; import { Manifest, type SandboxClient, type SandboxClientCreateArgs, type SandboxClientOptions, type SandboxPreservedSessionReuseOptions, type SandboxArchiveLimits, type SandboxConcurrencyLimits, type ExposedPortEndpoint, type ExecCommandArgs, type MaterializeEntryArgs, type ReadFileArgs, type SandboxSession, type SandboxSessionState, type ViewImageArgs, type WriteStdinArgs, type WorkspaceArchiveData, type WorkspaceArchiveOptions } from '@openai/agents-core/sandbox'; import { RemoteSandboxEditor } from '../shared/editor'; import { type CloudflareBucketMountRequestOptions } from './mounts'; export interface CloudflareSandboxClientOptions extends SandboxClientOptions { workerUrl: string; apiKey?: string; exposedPorts?: number[]; timeoutMs?: number; createTimeoutMs?: number; requestTimeoutMs?: number; timeouts?: CloudflareSandboxTimeouts; mounts?: Array>; archiveLimits?: SandboxArchiveLimits | null; } export interface CloudflareSandboxTimeouts { execTimeoutMs?: number; createTimeoutMs?: number; requestTimeoutMs?: number; } export interface CloudflareSandboxSessionState extends SandboxSessionState { workerUrl: string; sandboxId: string; configuredExposedPorts?: number[]; timeoutMs?: number; createTimeoutMs?: number; requestTimeoutMs?: number; timeouts?: CloudflareSandboxTimeouts; mounts?: Array>; environment: Record; } export declare class CloudflareSandboxSession implements SandboxSession { readonly state: CloudflareSandboxSessionState; private readonly apiKey?; private readonly ptyProcesses; private readonly concurrencyLimits?; private archiveLimits?; private readonly remotePathResolver; constructor(args: { state: CloudflareSandboxSessionState; apiKey?: string; concurrencyLimits?: SandboxConcurrencyLimits; archiveLimits?: SandboxArchiveLimits | null; }); setArchiveLimits(limits?: SandboxArchiveLimits | null): void; createEditor(runAs?: string): RemoteSandboxEditor; supportsPty(): boolean; execCommand(args: ExecCommandArgs): Promise; writeStdin(args: WriteStdinArgs): Promise; private execPtyCommand; viewImage(args: ViewImageArgs): Promise; readFile(args: ReadFileArgs): Promise; pathExists(path: string, runAs?: string): Promise; directoryExists(path: string, runAs?: string): Promise; running(): Promise; resolveExposedPort(port: number): Promise; materializeEntry(args: MaterializeEntryArgs): Promise; private materializeEntryExclusive; applyManifest(manifest: Manifest, runAs?: string): Promise; private applyManifestExclusive; mountBucket(args: { bucket: string; mountPath: string; options: CloudflareBucketMountRequestOptions; }): Promise; private mountBucketAtResolvedPath; unmountBucket(mountPath: string): Promise; persistWorkspace(): Promise; hydrateWorkspace(data: WorkspaceArchiveData, options?: WorkspaceArchiveOptions): Promise; close(): Promise; shutdown(): Promise; delete(): Promise; private writer; private manifestMaterializationOptions; private materializeMountEntry; private execShell; private runAsCommandRunner; private readFileBytes; private writeFile; private ensureParentDir; private mkdirPath; private fetch; private resolveRemotePath; } /** * @see {@link https://developers.cloudflare.com/sandbox/ | Sandbox SDK overview}. * @see {@link https://developers.cloudflare.com/sandbox/get-started/ | Getting started}. * @see {@link https://developers.cloudflare.com/sandbox/concepts/architecture/ | Sandbox architecture}. */ export declare class CloudflareSandboxClient implements SandboxClient { readonly backendId = "cloudflare"; readonly serializedSessionStateRequiresFreshCreation = true; private readonly options; private readonly deserializedSessionStates; constructor(options?: Partial); canReusePreservedOwnedSession(state: CloudflareSandboxSessionState, options?: SandboxPreservedSessionReuseOptions): boolean; create(args?: SandboxClientCreateArgs | Manifest, manifestOptions?: SandboxClientOptions): Promise; serializeSessionState(state: CloudflareSandboxSessionState): Promise>; canPersistOwnedSessionState(): boolean; deserializeSessionState(state: Record): Promise; resume(state: CloudflareSandboxSessionState): Promise; }