API reference
sandbox
Import
Section titled “Import”import * as api from "@fungi.computer/mycelium/sandbox";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | MyceliumJsonValue | JSON value allowed to cross the sandbox and capability boundary. |
| type alias | SandboxValue | Untrusted value supplied by or returned from a host sandbox boundary. |
| type alias | SandboxBinding | One invocation binding visible to the host-provided sandbox. |
| type alias | SandboxRequest | Request crossing the root Promise-shaped sandbox seam. |
| type alias | Sandbox | Promise-shaped sandbox interface implemented by a host or stranger. |
MyceliumJsonValuetype alias
Section titled “MyceliumJsonValue”type MyceliumJsonValue = output<ZodJSONSchema>;JSON value allowed to cross the sandbox and capability boundary.
SandboxValuetype alias
Section titled “SandboxValue”type SandboxValue = input<ZodUnknown>;Untrusted value supplied by or returned from a host sandbox boundary.
SandboxBindingtype alias
Section titled “SandboxBinding”type SandboxBinding = (input) => Promise<MyceliumJsonValue>;One invocation binding visible to the host-provided sandbox.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
SandboxValue |
Returns
Section titled “Returns”Promise<MyceliumJsonValue>
SandboxRequesttype alias
Section titled “SandboxRequest”type SandboxRequest = Readonly<{ executionId: string; code: string; timeoutMs: number; bindings: Readonly<Record<string, Readonly<Record<string, SandboxBinding>>>>; namespacePaths?: Readonly<Record<string, readonly string[]>>; modules?: Readonly<Record<string, string>>; sessionId?: string | null;}>;Request crossing the root Promise-shaped sandbox seam.
Sandboxtype alias
Section titled “Sandbox”type Sandbox = Readonly<{ adapter?: string; buildSha?: string; execute: (request, signal) => Promise<SandboxValue>;}>;Promise-shaped sandbox interface implemented by a host or stranger.