sandbox-wire
Type Aliases
Section titled “Type Aliases”SandboxWire
Section titled “SandboxWire”SandboxWire =
z.output<typeofsandboxWireSchema>>
Typed, decoded host wire value.
Variables
Section titled “Variables”sandboxWireSchema
Section titled “sandboxWireSchema”
constsandboxWireSchema:ZodDiscriminatedUnion<[ZodObject<{ok:ZodLiteral<true>>;value:ZodJSONSchema; },$strict>>,ZodObject<{ok:ZodLiteral<false>>;error:ZodDiscriminatedUnion<[ZodObject<{kind:ZodLiteral<"invalid_source">>;line:ZodNumber;column:ZodNumber;excerpt:ZodString; },$strict>>,ZodObject<{kind:ZodLiteral<"guest_threw">>;name:ZodString;message:ZodString;transportMessage:ZodOptional<ZodString>>; },$strict>>,ZodObject<{kind:ZodLiteral<"deadline_exceeded">>;limitMs:ZodNumber;elapsedMs:ZodNumber; },$strict>>],"kind">>; },$strict>>],"ok">>
The host-to-host result contract; raw diagnostic fields never go to guest code.
Functions
Section titled “Functions”sandboxWireFailure()
Section titled “sandboxWireFailure()”sandboxWireFailure(
error):SandboxFailure
Convert one validated wire failure into the shared error channel.
Parameters
Section titled “Parameters”{ kind: "invalid_source"; line: number; column: number; excerpt:
string; } | { kind: "guest_threw"; name: string; message:
string; transportMessage?: string; } | { kind: "deadline_exceeded";
limitMs: number; elapsedMs: number; } | { kind:
"result_not_json"; valueKind: string; rawCause: JSONType; } | {
kind: "sandbox_crashed"; rawCause: JSONType; } | { kind:
"bad_response"; reason: string; rawCause: JSONType; } | { kind:
"dispatch_lost"; elapsedMs: number; transport: string; errno?:
string; rawCause: JSONType; } | { kind: "cancelled"; by:
"caller" | "operator"; } | { kind: "result_too_large"; size:
number; } | { kind: "capability_failed"; namespace: string;
operation: string; cause: { kind: "Files" | "Forage" |
"InvalidInput" | "Unavailable" | "OperationFailed"; message: string;
}; rawCause: JSONType; } | { kind: "unknown"; rawCause:
JSONType; }
Returns
Section titled “Returns”sandboxFailureWire()
Section titled “sandboxFailureWire()”sandboxFailureWire(
failure):JSONType
Host-only encoding; the guest receives only the admitted diagnostic text.
Parameters
Section titled “Parameters”failure
Section titled “failure”Returns
Section titled “Returns”JSONType