Interface: ScratchWorkspace
Defined in: src/batteries/media/contracts.ts:109
Bytes ⇄ executor-visible paths. The seam that lets binary-backed engines exchange files with the process (or remote runner) that executes them.
Methods
dir()
dir(): string;Defined in: src/batteries/media/contracts.ts:127
The workspace root directory, for --outdir-style binary arguments.
Returns
string
dispose()
dispose(): Promise<void>;Defined in: src/batteries/media/contracts.ts:131
Remove the workspace and everything in it. Engines call this in finally.
Returns
Promise<void>
list()
list(): Promise<string[]>;Defined in: src/batteries/media/contracts.ts:129
List the files currently in the workspace root (basenames).
Returns
Promise<string[]>
materialize()
materialize(bytes: Uint8Array, filename: string): Promise<string>;Defined in: src/batteries/media/contracts.ts:118
Write bytes into the workspace under filename and return the absolute path the paired executor can open.
Parameters
| Parameter | Type | Description |
|---|---|---|
bytes | Uint8Array | The content to materialize. |
filename | string | The basename to use (extension matters to format-sniffing binaries). |
Returns
Promise<string>
The absolute path.
read()
read(path: string): Promise<Uint8Array<ArrayBufferLike>>;Defined in: src/batteries/media/contracts.ts:125
Read a file the executor produced inside the workspace.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | The absolute path to read. |
Returns
Promise<Uint8Array<ArrayBufferLike>>
The file bytes.