index
@fungi.computer/mycelium / index
Classes
Section titled “Classes”MyceliumDefinitionError
Section titled “MyceliumDefinitionError”A capability declaration could not form one coherent installed surface.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MyceliumDefinitionError(
message):MyceliumDefinitionError
Parameters
Section titled “Parameters”message
Section titled “message”string
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:"invalid_definition"=invalidDefinitionCode
Stable machine-readable failure code.
MyceliumClosedError
Section titled “MyceliumClosedError”An operation attempted to use a closed Mycelium runtime.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MyceliumClosedError(
message?):MyceliumClosedError
Parameters
Section titled “Parameters”message?
Section titled “message?”string = "Mycelium runtime is closed"
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:"runtime_closed"=runtimeClosedCode
Stable machine-readable failure code.
MyceliumSandboxError
Section titled “MyceliumSandboxError”A sandbox execution request was rejected by Mycelium admission before host dispatch or by the host sandbox during dispatch.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MyceliumSandboxError(
message):MyceliumSandboxError
Parameters
Section titled “Parameters”message
Section titled “message”string
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:"sandbox_rejected"=sandboxRejectedCode
Stable machine-readable failure code.
MyceliumExecutionError
Section titled “MyceliumExecutionError”An execution exceeded its owned budget or did not acknowledge cancellation.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MyceliumExecutionError(
phase):MyceliumExecutionError
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:"execution_failure"=executionFailureCode
Stable machine-readable failure code.
readonlyphase:MyceliumExecutionPhase
MyceliumSourceError
Section titled “MyceliumSourceError”A capability source failed at its bounded host boundary.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MyceliumSourceError(
sourceId,phase):MyceliumSourceError
Parameters
Section titled “Parameters”sourceId
Section titled “sourceId”string | undefined
Stable identity of the source, absent for whole-candidate failures.
Lifecycle phase that could not settle.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:"source_failure"=sourceFailureCode
Stable machine-readable failure code.
sourceId
Section titled “sourceId”
readonlysourceId:string|undefined
Stable identity of the source, absent for whole-candidate failures.
readonlyphase:MyceliumSourcePhase
Lifecycle phase that could not settle.
Type Aliases
Section titled “Type Aliases”CapabilitySession
Section titled “CapabilitySession”CapabilitySession =
Readonly<{sessionId:string; }>
Session on whose behalf one runtime acquires its capability projections.
CapabilitySourceContext
Section titled “CapabilitySourceContext”CapabilitySourceContext =
Readonly<{session?:CapabilitySession;signal:AbortSignal;invalidate: () =>void; }>
Context supplied while acquiring one current capability projection.
CapabilitySourceSnapshot
Section titled “CapabilitySourceSnapshot”CapabilitySourceSnapshot =
Readonly<{version:string;modules: readonlyModuleRegistration[]; }>
Bounded current projection returned by one capability source.
CapabilitySourceAcquisition
Section titled “CapabilitySourceAcquisition”CapabilitySourceAcquisition =
Readonly<{snapshot:CapabilitySourceSnapshot;release: () =>Promise<void>>; }>
Acquired source projection and the cleanup that owns its live adapter.
CapabilitySource
Section titled “CapabilitySource”CapabilitySource =
Readonly<{id:string;acquire: (context) =>Promise<CapabilitySourceAcquisition>>; }>
Promise-shaped host boundary for one versioned capability projection.
MyceliumSourcePhase
Section titled “MyceliumSourcePhase”MyceliumSourcePhase =
"acquire"|"release"|"stale"
Lifecycle phase in which a capability source failed.
MyceliumExecutionPhase
Section titled “MyceliumExecutionPhase”MyceliumExecutionPhase =
"cancelled"|"deadline_exceeded"|"abort_unacknowledged"
Bounded execution phase reported by Mycelium’s cancellation owner.
MyceliumError
Section titled “MyceliumError”MyceliumError =
MyceliumClosedError|MyceliumDefinitionError|MyceliumExecutionError|MyceliumSandboxError|MyceliumSourceError
Closed failure vocabulary for the first Mycelium runtime slice.
ExecutionOptions
Section titled “ExecutionOptions”ExecutionOptions =
Readonly<{timeoutMs?:number;abortGraceMs?:number; }>
Host-selectable execution limits; neither budget can be disabled.
InvocationContext
Section titled “InvocationContext”InvocationContext =
Readonly<{executionId:string;signal:AbortSignal; }>
The only context an operation callback may observe.
MyceliumJsonValue
Section titled “MyceliumJsonValue”MyceliumJsonValue =
output<ZodJSONSchema>>
JSON value allowed to cross the sandbox and capability boundary.
SandboxValue
Section titled “SandboxValue”SandboxValue =
input<ZodUnknown>>
Untrusted value supplied by or returned from a host sandbox boundary.
SandboxBinding
Section titled “SandboxBinding”SandboxBinding = (
input) =>Promise<MyceliumJsonValue>>
One invocation binding visible to the host-provided sandbox.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<MyceliumJsonValue>
SandboxRequest
Section titled “SandboxRequest”SandboxRequest =
Readonly<{executionId:string;code:string;timeoutMs:number;bindings:Readonly<Record<string,Readonly<Record<string,SandboxBinding>>>>>>>>; }>
Request crossing the root Promise-shaped sandbox seam.
Sandbox
Section titled “Sandbox”Sandbox =
Readonly<{execute: (request,signal) =>Promise<SandboxValue>>; }>
Promise-shaped sandbox interface implemented by a host or stranger.
MyceliumOptions
Section titled “MyceliumOptions”MyceliumOptions =
Readonly<{modules?: readonlyModuleRegistration[];sources?: readonlyCapabilitySource[];session?:CapabilitySession;execution?:ExecutionOptions;sandbox:Sandbox; }>
Inputs used to construct the Promise-facing runtime.
AcquireOptions
Section titled “AcquireOptions”AcquireOptions =
Readonly<{signal?:AbortSignal; }>
Cancellation options for one Promise-facing lease acquisition.
Lease =
Readonly<{revision:string;catalog:ForageCatalog;executeTool:MuleTool;release: () =>Promise<void>>; }>
One immutable Promise-facing capability revision.
Runtime
Section titled “Runtime”Runtime =
Readonly<{acquire: (options?) =>Promise<Lease>>;close: () =>Promise<void>>; }>
Warm Promise-facing lifecycle for acquiring immutable run leases.
OperationDefinition
Section titled “OperationDefinition”OperationDefinition<
I,O> > =Readonly<{description?:string;input:ZodType<I>>;output?:ZodType<O>>;execute: (input,context) =>Promise<O>>; }>
Zod-first declaration for one operation behind the execute door.
Type Parameters
Section titled “Type Parameters”I extends MyceliumJsonValue
O extends MyceliumJsonValue
ModuleDefinition
Section titled “ModuleDefinition”ModuleDefinition =
Readonly<{id:string;name?:string;description?:string;operations:Readonly<Record<string,OperationRegistration>>>>; }>
Declaration for one stable module and its related operations.
MyceliumApi
Section titled “MyceliumApi”MyceliumApi =
Readonly<{module: (definition) =>ModuleRegistration;operation: <I,O>>(definition) =>OperationRegistration<I,O>>;make: (options) =>Promise<Runtime>>; }>
Public convenience namespace contract.
OperationRegistration
Section titled “OperationRegistration”OperationRegistration<
I,O> > =Readonly<{[operationBrand]:true;[operationTypes]?:Readonly<{input:I;output:O; }>; }>
Opaque handle for one Zod-authored operation.
Type Parameters
Section titled “Type Parameters”I = unknown
O = unknown
ModuleRegistration
Section titled “ModuleRegistration”ModuleRegistration =
Readonly<{[moduleBrand]:true; }>
Opaque handle for one namespaced capability module.
Variables
Section titled “Variables”Mycelium
Section titled “Mycelium”
constMycelium:MyceliumApi
Zod-first authoring and Promise-facing runtime construction.