effect
@fungi.computer/mycelium / effect
effect
Section titled “effect”Type Aliases
Section titled “Type Aliases”Sandbox
Section titled “Sandbox”Sandbox =
Readonly<{execute: (request,signal) =>Effect.Effect<SandboxValue,unknown>>; }>
Effect-native host seam for sandbox execution.
Interrupting execute must not complete until the backing work has actually
settled. Mycelium bounds that wait by the acknowledgement grace and reports
abort_unacknowledged when it expires, keeping the work’s source revision alive
until it exits. A host with Promise-shaped work adapts it with
fromPromiseSandbox; Effect.tryPromise alone completes
interruption without awaiting the Promise and so breaks that settlement law.
MyceliumOptions
Section titled “MyceliumOptions”MyceliumOptions =
Readonly<{modules?: readonlyModuleRegistration[];sources?: readonlyCapabilitySource[];session?:CapabilitySession;execution?:ExecutionOptions;sandbox:Sandbox; }>
Inputs used to construct the canonical Effect runtime.
Lease =
Readonly<{revision:string;catalog:ForageCatalog;executeTool:MuleTool;release: () =>Effect.Effect<void,MyceliumError>>; }>
One immutable Effect-facing capability revision.
Runtime
Section titled “Runtime”Runtime =
Readonly<{acquire: () =>Effect.Effect<Lease,MyceliumError,Scope.Scope>>;close: () =>Effect.Effect<void,MyceliumError>>; }>
Warm Effect lifecycle for acquiring scope-owned run leases.
Functions
Section titled “Functions”fromPromiseSandbox()
Section titled “fromPromiseSandbox()”fromPromiseSandbox(
sandbox):Sandbox
Adapt a Promise-shaped sandbox to the Effect seam. This is Mycelium’s one Promise sandbox conversion: interruption waits for the host Promise to settle, while cancellation reaches the host through the abort signal.
Parameters
Section titled “Parameters”sandbox
Section titled “sandbox”Returns
Section titled “Returns”make()
Section titled “make()”make(
options):Effect<Readonly<{acquire: () =>Effect<Readonly<{revision:string;catalog:ForageCatalog;executeTool:MuleTool;release: () =>Effect<void,MyceliumError>>; }>,MyceliumError,Scope>>;close: () =>Effect<void,MyceliumError>>; }>,MyceliumError,Scope>>
Construct the canonical scoped Effect runtime.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Effect<Readonly<{ acquire: () => Effect<Readonly<{ revision:
string; catalog: ForageCatalog; executeTool: MuleTool; release: ()
=> Effect<void, MyceliumError>; }>,
MyceliumError, Scope>; close: () =>
Effect<void, MyceliumError>; }>,
MyceliumError, Scope>
References
Section titled “References”CapabilitySession
Section titled “CapabilitySession”Re-exports CapabilitySession
CapabilitySource
Section titled “CapabilitySource”Re-exports CapabilitySource
ModuleRegistration
Section titled “ModuleRegistration”Re-exports ModuleRegistration
SandboxBinding
Section titled “SandboxBinding”Re-exports SandboxBinding
SandboxRequest
Section titled “SandboxRequest”Re-exports SandboxRequest
ExecutionOptions
Section titled “ExecutionOptions”Re-exports ExecutionOptions