effect
Import
Section titled “Import”import * as api from "@fungi.computer/mycelium/effect";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | Sandbox | Effect-native host seam for sandbox execution. |
| type alias | MyceliumOptions | Inputs used to construct the canonical Effect runtime. |
| type alias | Lease | One immutable Effect-facing capability revision. |
| type alias | Runtime | Warm Effect lifecycle for acquiring scope-owned run leases. |
| function | fromTypedSandbox() | 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. |
| function | make() | Construct the canonical scoped Effect runtime. |
Sandboxtype alias
Section titled “Sandbox”type Sandbox = Readonly<{ execute: (request, signal) => Effect.Effect<SandboxValue, SandboxFailure>; adapter?: string; buildSha?: string;}>;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
fromTypedSandbox; Effect.tryPromise alone completes
interruption without awaiting the Promise and so breaks that settlement law.
MyceliumOptionstype alias
Section titled “MyceliumOptions”type MyceliumOptions = Readonly<{ modules?: readonly ModuleRegistration[]; sources?: readonly CapabilitySource[]; session?: CapabilitySession; execution?: ExecutionOptions; sandbox: Sandbox; onSandboxFailure?: (event) => Effect.Effect<void>; tools?: readonly LabelledTool[]; access?: AccessOptions;}>;Inputs used to construct the canonical Effect runtime.
Leasetype alias
Section titled “Lease”type Lease = Readonly<{ revision: string; catalog: ForageCatalog; executeTool: MuleTool; tools: readonly MuleTool[]; release: () => Effect.Effect<void, MyceliumError>;}>;One immutable Effect-facing capability revision.
Runtimetype alias
Section titled “Runtime”type Runtime = Readonly<{ acquire: () => Effect.Effect<Lease, MyceliumError, Scope.Scope>; close: () => Effect.Effect<void, MyceliumError>;}>;Warm Effect lifecycle for acquiring scope-owned run leases.
fromTypedSandbox()function
Section titled “fromTypedSandbox()”function fromTypedSandbox(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”| Parameter | Type |
|---|---|
sandbox |
Sandbox |
Returns
Section titled “Returns”make()function
Section titled “make()”function make(options): Effect< Readonly<{ acquire: () => Effect< Readonly<{ revision: string; catalog: ForageCatalog; executeTool: MuleTool; tools: readonly MuleTool[]; release: () => Effect<void, MyceliumError>; }>, MyceliumError, Scope >; close: () => Effect<void, MyceliumError>; }>, MyceliumError, Scope>;Construct the canonical scoped Effect runtime.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
MyceliumOptions |
Returns
Section titled “Returns”Effect<Readonly<{ acquire: () => Effect<Readonly<{ revision:
string; catalog: ForageCatalog; executeTool: MuleTool; tools:
readonly 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
Access
Section titled “Access”Re-exports Access
AccessContext
Section titled “AccessContext”Re-exports AccessContext
AccessLabel
Section titled “AccessLabel”Re-exports AccessLabel
AccessOptions
Section titled “AccessOptions”Re-exports AccessOptions
AccessRefusal
Section titled “AccessRefusal”Re-exports AccessRefusal
AccessRefusalReason
Section titled “AccessRefusalReason”Re-exports AccessRefusalReason
ConfirmRequest
Section titled “ConfirmRequest”Re-exports ConfirmRequest
Re-exports Grant
Grants
Section titled “Grants”Re-exports Grants
LabelledTool
Section titled “LabelledTool”Re-exports LabelledTool
ToolPolicy
Section titled “ToolPolicy”Re-exports ToolPolicy