import { type ToolOutputImage } from '@openai/agents-core'; import { type ExecCommandArgs, type ExposedPortEndpoint, Manifest, type MaterializeEntryArgs, type ReadFileArgs, type SandboxArchiveLimits, type SandboxConcurrencyLimits, type SandboxSession, type SandboxSessionState, type ViewImageArgs, type WorkspaceArchiveData, type WorkspaceArchiveOptions } from '@openai/agents-core/sandbox'; import { type RemoteWorkspaceTarIo } from './archive'; import { RemoteSandboxEditor } from './editor'; import { type ManifestMaterializationOptions } from './manifest'; import type { RemoteManifestWriter, RemoteSandboxPathOptions, RemoteSandboxPathResolver, SandboxManifestMetadataSupport } from './types'; export type RemoteSandboxCommandKind = 'archive' | 'exec' | 'manifest' | 'path' | 'running'; export type RemoteSandboxCommandOptions = { kind: RemoteSandboxCommandKind; workdir: string; environment?: Record; runAs?: string; execArgs?: ExecCommandArgs; timeoutMs?: number; }; export type RemoteSandboxCommandResult = { status: number; stdout?: string; stderr?: string; }; export type RemoteSandboxSessionBaseOptions = { providerName: string; providerId: string; concurrencyLimits?: SandboxConcurrencyLimits; archiveLimits?: SandboxArchiveLimits | null; }; export declare abstract class RemoteSandboxSessionBase; }> implements SandboxSession { readonly state: TState; protected readonly providerName: string; protected readonly providerId: string; private readonly concurrencyLimits?; private archiveLimits?; protected readonly remotePathResolver: RemoteSandboxPathResolver; protected constructor(args: { state: TState; options: RemoteSandboxSessionBaseOptions; }); setArchiveLimits(limits?: SandboxArchiveLimits | null): void; protected getArchiveLimits(): SandboxArchiveLimits | null | undefined; createEditor(runAs?: string): RemoteSandboxEditor; supportsPty(): boolean; execCommand(args: ExecCommandArgs): Promise; viewImage(args: ViewImageArgs): Promise; pathExists(path: string, runAs?: string): Promise; directoryExists(path: string, runAs?: string): Promise; readFile(args: ReadFileArgs): Promise; running(): Promise; resolveExposedPort(port: number): Promise; materializeEntry(args: MaterializeEntryArgs): Promise; private materializeEntryExclusive; applyManifest(manifest: Manifest, runAs?: string): Promise; private applyManifestExclusive; persistWorkspace(): Promise; hydrateWorkspace(data: WorkspaceArchiveData, options?: WorkspaceArchiveOptions): Promise; protected abstract runRemoteCommand(command: string, options: RemoteSandboxCommandOptions): Promise; protected abstract mkdirRemote(path: string): Promise; protected abstract readRemoteText(path: string): Promise; protected abstract readRemoteFile(path: string): Promise; protected abstract writeRemoteFile(path: string, content: string | Uint8Array): Promise; protected abstract deleteRemotePath(path: string): Promise; protected afterManifestMutationCommitted(_materializedManifest: Manifest): void; protected assertSessionUsable(): void; protected execPtyCommand(_args: ExecCommandArgs): Promise; private sessionUsable; protected invalidateAfterFailedPrivilegedManifestTransition(): Promise; protected assertExecRunAs(runAs?: string): void; protected assertFilesystemRunAs(runAs?: string): void; protected assertManifestRunAs(runAs?: string): void; protected beforeExecCommand(_args: ExecCommandArgs): Promise; protected beforeFilesystemMutation(): Promise; protected beforeMaterializeEntry(_args: MaterializeEntryArgs): Promise; protected beforeMaterializeEntryMayHaveSideEffects(): boolean; protected beforeApplyManifest(_manifest: Manifest): Promise; protected beforeApplyManifestMayHaveSideEffects(): boolean; protected forceTerminateAfterFailedPrivilegedManifestTransition(): Promise; protected resolveManifestForApply(manifest: Manifest): Manifest | Promise; protected manifestMetadataSupport(): SandboxManifestMetadataSupport | undefined; protected manifestMaterializationOptions(): ManifestMaterializationOptions; protected workspacePersistence(): unknown; protected configuredExposedPorts(): number[] | undefined; protected allowOnDemandExposedPorts(): boolean; protected useCachedExposedPortEndpoint(_port: number): boolean; protected exposedPortSource(): string; protected resolveRemoteExposedPort(port: number): Promise; protected runningWorkdir(): string; protected resolveWorkdir(path?: string): string; protected resolveAbsolutePath(path?: string): string; protected resolveRemotePath(path?: string, options?: RemoteSandboxPathOptions): Promise; protected resolveRemoteCredentialPath(path: string): Promise; protected ensureParentDir(path: string): Promise; protected persistWorkspaceTar(): Promise; protected hydrateWorkspaceTar(data: WorkspaceArchiveData, options?: WorkspaceArchiveOptions): Promise; protected manifestWriter(): RemoteManifestWriter; protected materializeManifestEntries(manifest: Manifest): Promise; protected archiveIo(): RemoteWorkspaceTarIo; private parentDir; private createRunAsEditor; private readRemoteFileAs; private writeRemoteTextAs; private manifestMaterializationOptionsWithMetadata; private provisionManifestAccounts; private applyManifestEntryMetadata; private runCheckedRemoteCommand; }