/** * Main-thread proxy client for the Worker-based toolchain. * * Thin shim over `WorkerOrchestrator` (emception). * This file contains only the browser-specific concerns: * - SharedArrayBuffer stdin pump (feedStdin, feedShellStdin) * - IOProvider wiring (xterm.js / TTYBridge) * - Cleanup of SAB channels on terminate() * * All correlated request/response logic and notification routing live in * WorkerOrchestrator. */ import type { IOProvider } from 'emception'; import type { RunOptions, ToolResult } from './tool-runner.js'; export interface WorkerBootOptions { manifestUrl: string; /** An IOProvider (typically TTYBridge) for routing shell I/O. */ io: IOProvider & { enterExclusiveStdin?(): void; exitExclusiveStdin?(): void; readByteExclusive?(): number | null | Promise; }; toolVersions?: { pythonMajorMinor?: string; pythonMajorMinorCompact?: string; }; } export declare class WorkerClient { private readonly orch; private readonly io; /** Shared-memory stdin channel used by shell-launched foreground WASI runs. */ private shellStdinChannel; /** * All currently-active SAB stdin channels (both per-run and shell), * tracked so terminate() can close them all. */ private readonly activeStdinChannels; constructor(worker: Worker, io: WorkerBootOptions['io']); boot(manifestUrl: string, toolVersions?: WorkerBootOptions['toolVersions']): Promise; run(tool: string, argv: string[], options?: RunOptions): Promise; getFile(path: string): Promise; writeFile(path: string, data: Uint8Array): Promise; deleteFile(path: string): Promise; listDir(path: string): Promise; /** Reset the Worker VFS writable layers (clear /tmp, /home/user). */ resetVfs(): Promise; terminate(): void; /** * Feed stdin bytes to the Worker for a specific run. * Called from the per-run onStdinRequest callback. */ private feedStdin; private feedShellStdin; private writeByteToSharedChannel; private closeSharedChannel; /** * Read a byte from the IO provider and send it to the Worker for the shell. * Called from the onShellReadByte notification. */ private readAndSendByte; } //# sourceMappingURL=worker-client.d.ts.map