sandbox-guest
Import
Section titled “Import”import * as api from "@fungi.computer/mycelium/sandbox-guest";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| constant | sandboxGuestResultSchema | Closed guest envelope: guest exceptions cannot masquerade as host failures. |
| constant | sandboxNamespaceSegmentSchema | Parsed guest namespace segments; callbacks never cross this wire. |
| constant | sandboxTransportAliasSchema | A transport alias is interpolated as a strict JavaScript binding identifier. |
| constant | sandboxNamespacePathsSchema | Transport aliases mapped to their logical namespace paths. |
| constant | sandboxBindingNamesSchema | Serializable flat transport table; operation keys may have any namespace depth. |
| function | submittedSourceLocation() | Locate syntax in the submitted code, accounting for Codemode’s normalization. |
| function | sandboxBindingNames() | Serializable operation names; callbacks stay in the host’s existing binding table. |
| function | sandboxProviderOperationName() | Injective provider identifier: Codemode sanitizes dotted function names. |
| function | sandboxGuestProgram() | Capture name and text inside the guest, before Codemode erases Error.name. |
sandboxGuestResultSchemaconstant
Section titled “sandboxGuestResultSchema”const sandboxGuestResultSchema: ZodLazy< ZodDiscriminatedUnion< [ ZodObject< { ok: ZodLiteral<true>; value: ZodUnknown; }, $strict >, ZodObject< { ok: ZodLiteral<false>; error: ZodObject< { kind: ZodLiteral<"guest_threw">; name: ZodString; message: ZodString; transportMessage: ZodOptional<ZodString>; }, $strict >; }, $strict >, ], "ok" >>;Closed guest envelope: guest exceptions cannot masquerade as host failures.
sandboxNamespaceSegmentSchemaconstant
Section titled “sandboxNamespaceSegmentSchema”const sandboxNamespaceSegmentSchema: ZodLazy<ZodString>;Parsed guest namespace segments; callbacks never cross this wire.
sandboxTransportAliasSchemaconstant
Section titled “sandboxTransportAliasSchema”const sandboxTransportAliasSchema: ZodLazy<ZodString>;A transport alias is interpolated as a strict JavaScript binding identifier.
sandboxNamespacePathsSchemaconstant
Section titled “sandboxNamespacePathsSchema”const sandboxNamespacePathsSchema: ZodLazy< ZodRecord<ZodLazy<ZodString>, ZodArray<ZodLazy<ZodString>>>>;Transport aliases mapped to their logical namespace paths.
sandboxBindingNamesSchemaconstant
Section titled “sandboxBindingNamesSchema”const sandboxBindingNamesSchema: ZodLazy< ZodRecord<ZodLazy<ZodString>, ZodArray<ZodString>>>;Serializable flat transport table; operation keys may have any namespace depth.
submittedSourceLocation()function
Section titled “submittedSourceLocation()”function submittedSourceLocation( normalized, submitted,): Readonly<{ line: number; column: number; excerpt: string;}> | null;Locate syntax in the submitted code, accounting for Codemode’s normalization.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
normalized |
string |
submitted |
string |
Returns
Section titled “Returns”| Readonly<{ line: number; column: number; excerpt: string;
}> | null
sandboxBindingNames()function
Section titled “sandboxBindingNames()”function sandboxBindingNames<A>( bindings,): Readonly<Record<string, readonly string[]>>;Serializable operation names; callbacks stay in the host’s existing binding table.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
A |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bindings |
Readonly<Record<string, Readonly<Record<string, A>>>> |
Returns
Section titled “Returns”Readonly<Record<string, readonly string[]>>
sandboxProviderOperationName()function
Section titled “sandboxProviderOperationName()”function sandboxProviderOperationName(operation): string;Injective provider identifier: Codemode sanitizes dotted function names.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
operation |
string |
Returns
Section titled “Returns”string
sandboxGuestProgram()function
Section titled “sandboxGuestProgram()”function sandboxGuestProgram( normalized, bindings?, namespacePaths?, transportName?,): string;Capture name and text inside the guest, before Codemode erases Error.name.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
normalized |
string |
bindings |
Readonly<Record<string, readonly string[]>> |
namespacePaths |
Readonly<Record<string, readonly string[]>> |
transportName? |
(operation) => string |
Returns
Section titled “Returns”string