export interface WriteFilesResult { success: { path: string; }[]; failed: { path: string; error: string; }[]; } export type WatchEventType = 'add' | 'change' | 'unlink'; export interface WatchEvent { type: WatchEventType; path: string; content?: string; } export interface SandboxPrimitive { getId: () => string; getBasePaths: () => { /** * The directory where the sandbox application files (executing sdk queries / file watcher scripts) are located */ APP_DIR: string; /** * The directory where the workspace files are located. Will contain the workspace files and the agent profile (.claude/ or .gemini/) */ WORKSPACE_DIR: string; /** * The root home dir where the agent app will store it's app data. (the .claude/ or .gemini/ dirs that have the session transcripts) */ HOME_DIR: string; /** * The directory where the bundled MCPs are located. */ BUNDLED_MCP_DIR: string; }; exec: (command: string[], options?: { cwd?: string; }) => Promise<{ stdout: ReadableStream; stderr: ReadableStream; wait: () => Promise; }>; readFile: (path: string) => Promise; writeFile: (path: string, content: string) => Promise; /** * Write multiple files in a single operation (bulk write for efficiency). * Creates directories as needed. Returns partial success - writes what it can. */ writeFiles: (files: { path: string; content: string | undefined; }[]) => Promise; createDirectory: (path: string) => Promise; listFiles: (path: string, pattern?: string) => Promise; isRunning: () => Promise; /** * Poll the sandbox to check if it's still running * @returns null if running, exit code (number) if exited */ poll: () => Promise; terminate: () => Promise; /** * Watch a directory for file changes. * Callback is invoked for each file change event. * Promise resolves when watcher is ready. * Cleanup is automatic on terminate(). * * @param path - Directory path to watch * @param callback - Function called for each file change event */ watch: (path: string, callback: (event: WatchEvent) => void, opts?: { ignorePatterns?: string[]; }) => Promise; } //# sourceMappingURL=base.d.ts.map