Skip to content

index

@fungi.computer/shiitake


@fungi.computer/shiitake / index

Sanitized failure from a parsed Shiitake boundary.

  • Error

new ShiitakeError(boundary, cause, message, requestId?): ShiitakeError

Construct a sanitized boundary failure.

"contract" | "extensions" | "instructions" | "model" | "runtime" | "store" | "tools"

Boundary that rejected the operation.

"unavailable" | "invalid" | "conflict" | "closed" | "rejected"

Safe category describing why it was rejected.

string

Human-readable message safe for callers to display.

string

Request identity recoverable when a send may have reached the owner.

ShiitakeError

Error.constructor

readonly _tag: "ShiitakeError"

Stable runtime tag for typed Shiitake failures.

readonly boundary: "contract" | "extensions" | "instructions" | "model" | "runtime" | "store" | "tools"

Boundary that rejected the operation.

readonly cause: "unavailable" | "invalid" | "conflict" | "closed" | "rejected"

Safe category describing why it was rejected.

Error.cause

readonly optional requestId?: string

Request identity recoverable when a send may have reached the owner.

ShiitakeErrorBoundary = Schema.Schema.Type<typeof ShiitakeErrorBoundarySchema>>

Stable boundary that rejected a Shiitake operation.


ShiitakeErrorCause = Schema.Schema.Type<typeof ShiitakeErrorCauseSchema>>

Safe failure category exposed by both Shiitake facades.


ShiitakeApi = Readonly<{ make: (options) => Promise<ShiitakeAgent>>; }>

Public construction namespace for the Promise-facing durable harness.


ShiitakeHost = Readonly<{ agent: ShiitakeAgent; acceptMail: (mail) => Promise<Accepted>>; }>

Promise-facing host composition with addressed mail kept off Session.


PromptDelivery = "steer" | "followUp"

Delivery policy for input accepted while a Session run is active.


SessionCommand = Schema.Schema.Type<typeof SessionCommandSchema>>

Public Session command inferred from its one runtime parser.


PromptCommand = Schema.Schema.Type<typeof PromptCommandSchema>>

Public prompt command accepted as durable Session work.


AbortCommand = Schema.Schema.Type<typeof AbortCommandSchema>>

Public fast-path command that aborts the active Session run.


CancelCommand = Schema.Schema.Type<typeof CancelCommandSchema>>

Public command that cancels exactly one accepted request.


BranchCommand = Extract<SessionCommand, Readonly<{ type: "branch"; }>>

Public command that selects one complete entry as the active lineage leaf.


ForkCommand = Extract<SessionCommand, Readonly<{ type: "fork"; }>>

Public command that creates a new Session from one complete entry lineage.


SqliteValue = ArrayBuffer | string | number | null

Values accepted by the native SQLite owner binding.


SqliteCursor<Row> > = Readonly<{ toArray: () => readonly Row[]; one: () => Row; }>

Small structural projection of a native SQLite result cursor.

Row extends Record<string, SqliteValue> = Record<string, SqliteValue>


SqliteOwner = Readonly<{ sql: Readonly<{ exec: <Row>>(statement, …bindings) => SqliteCursor<Row>>; }>; transactionSync: <A>>(closure) => A; }>

Native owner capability adapted once by private Woodstock.

The callback is deliberately synchronous: Durable Object transactionSync is the only transaction authority for this package.


ModelAcquisition = Readonly<{ model: Model<Api>>; stream?: MuleStreamFunction; release: () => Promise<void>>; }>

Acquired Pi model and optional explicit Pi stream function.


ModelSource = Readonly<{ acquire: (input) => Promise<ModelAcquisition>>; }>

Deterministic host seam for model selection and ready egress.


InstructionSnapshot = Readonly<{ revision: string; text: string; modules?: readonly ModuleRegistration[]; release?: () => void; }>

Immutable instruction snapshot captured for one run.


InstructionSource = Readonly<{ load: (input) => Promise<InstructionSnapshot>>; }>

Host seam for one bounded instruction snapshot.


ToolSource = Readonly<{ fileTools?: readonly MuleTool[]; modules?: readonly ModuleRegistration[]; sources?: readonly CapabilitySource[]; sandbox: Sandbox; }>

Mycelium construction inputs captured by the Shiitake-owned run scope.


RuntimePendingWork = Readonly<{ pending: boolean; nextWakeAt: number | null; }>

Promise host for scheduling the opaque durable reconciler.


RuntimeHost = Readonly<{ bind: (input) => Promise<Readonly<{ commit: <A>>(mutation) => Promise<A>>; requestWake: () => Promise<void>>; close: () => Promise<void>>; }>>; }>

Promise host for scheduling the opaque durable reconciler.


ShiitakeOptions = Readonly<{ store: SqliteOwner; runtime: RuntimeHost; model: ModelSource; instructions: InstructionSource; tools?: ToolSource; extensions: ExtensionRosterV1; }>

Validated immutable construction bag for the durable harness.


ModelPreference = Schema.Schema.Type<typeof ModelPreferenceSchema>>

Null at the Session boundary means inherit the Agent default.

const Shiitake: ShiitakeApi

Construct the Promise facade over the canonical Effect program.

parseForkedSession(value): ForkedSession

Parse one serialized fork result using Shiitake’s public client grammar.

string

ForkedSession


parseSessionSnapshot(value): SessionSnapshot

Parse one serialized snapshot using Shiitake’s public client grammar.

string

SessionSnapshot


parseSessionFrame(value): SessionFrame

Parse one serialized frame using Shiitake’s public client grammar.

string

SessionFrame


makeHost(options, mailRoom): Promise<Readonly<{ agent: ShiitakeAgent; acceptMail: (mail) => Promise<Readonly<{ status: "accepted"; commandId: string; }>>; }>>

Construct the host-only Promise facade over the canonical Effect program.

ShiitakeOptions

BirdDogEffect

Promise<Readonly<{ agent: ShiitakeAgent; acceptMail: (mail) => Promise<Readonly<{ status: "accepted"; commandId: string; }>>; }>>

Re-exports AgentExtensionControls


Re-exports Accepted


Re-exports ForkedSession


Re-exports SendOptions


Re-exports ReadOptions


Re-exports SessionCommandHandler


Re-exports SessionExtensionControls


Re-exports SessionExtensionSlots


Re-exports SessionFrame


Re-exports SessionMessage


Re-exports SessionProgress


Re-exports SessionSnapshot


Re-exports SessionSummary


Re-exports SessionSummaryPage


Re-exports SessionSummaryRow


Re-exports SessionStatus


Re-exports SessionTerminal


Re-exports ShiitakeEventSourceConstructor


Re-exports SessionWatch


Re-exports ShiitakeAgent


Re-exports ShiitakeSession


Re-exports SubscribeOptions


Re-exports WatchOptions


Re-exports BorrowedCompactionViewV1


Re-exports CompactionHandoffErrorV1


Re-exports CompactionHandoffResultV1


Re-exports CompactionHandoffV1


Re-exports ExtensionCapabilityV1


Re-exports ExtensionGrantV1


Re-exports ExtensionRosterV1


Re-exports ExtensionSlotV1


Re-exports ExtensionStatusV1


Re-exports RosteredExtensionV1