Concepts
Operations and discovery
Section titled “Operations and discovery”Declare input and output with Zod. Stable module IDs identify authority. Names become model-facing aliases. Input ordering does not choose either identity. Forage prepares the bounded discovery catalog for the captured graph.
Mule receives this runtime’s one top-level execute tool. Inner operations,
including forage.search and forage.describe, stay behind that tool. The
operation callback receives only its declared input and execution context.
Authorization gates run before the operation. Product membership, resource
ownership and final external access checks remain host responsibilities.
Changing capabilities and lifetime
Section titled “Changing capabilities and lifetime”Use sources when a host must acquire a current Computer, Connection or other
capability projection. A source returns its bounded snapshot and an awaited
release function. Its invalidate() callback marks that snapshot stale. The
next lease builds a new coherent graph. An existing lease keeps its captured
snapshot.
Release each lease and close the runtime. Partial acquisition unwinds already acquired sources in reverse order. Mycelium owns the scoped resources it acquires, while the host owns durable relationships, credentials and current policy. A captured snapshot does not excuse a missing final authority check.
Cancellation and errors
Section titled “Cancellation and errors”Execution has a deadline, a cancellation acknowledgement grace and a bounded
JSON result. Cancellation aborts the invocation signal and waits for backing
sandbox settlement. If the sandbox ignores it, the result reports
acknowledged: false. Do not report that work as stopped.
The typed failure channel includes syntax errors, guest exceptions, lost
transport, bad responses, failed capabilities, deadline/cancellation and invalid
or oversized results. A foreign throw becomes Unknown. The model receives the
bounded sandboxFailureMessage projection with a reference. The host receives
operator evidence through onSandboxFailure and the existing reporting path.
Preserve that evidence without sending host diagnostics to the guest.
An Effect host with a Promise sandbox uses fromTypedSandbox, which waits for
that Promise to settle when interrupted. The concrete sandbox and broker decide
how backing work is stopped. Mycelium does not implement a Worker loader, MCP
server or credential vault.