@fungi.computer/shiitake
Classes
Section titled “Classes”ShiitakeError
Section titled “ShiitakeError”Sanitized failure from a parsed Shiitake boundary.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ShiitakeError(
boundary,category,message,requestId?,cause?):ShiitakeError
Construct a sanitized boundary failure.
Parameters
Section titled “Parameters”boundary
Section titled “boundary”"contract" | "extensions" | "instructions" | "model" | "runtime"
| "store" | "tools"
Boundary that rejected the operation.
category
Section titled “category”"closed" | "conflict" | "incompatible" | "invalid" | "rejected" |
"unavailable"
Safe category describing why it was rejected.
message
Section titled “message”string
Human-readable message safe for callers to display.
requestId?
Section titled “requestId?”string
Request identity recoverable when a send may have reached the owner.
cause?
Section titled “cause?”unknown
The original thrown value, kept for server-side diagnosis only. It is never serialized: the wire encoder copies named fields only.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonly_tag:"ShiitakeError"
Stable runtime tag for typed Shiitake failures.
readonlycause:"closed"|"conflict"|"incompatible"|"invalid"|"rejected"|"unavailable"
Safe category describing why it was rejected.
Overrides
Section titled “Overrides”Error.cause
underlying?
Section titled “underlying?”
readonlyoptionalunderlying?:unknown
Original cause retained only for server-side diagnosis.
boundary
Section titled “boundary”
readonlyboundary:"contract"|"extensions"|"instructions"|"model"|"runtime"|"store"|"tools"
Boundary that rejected the operation.
requestId?
Section titled “requestId?”
readonlyoptionalrequestId?:string
Request identity recoverable when a send may have reached the owner.
Type Aliases
Section titled “Type Aliases”ShiitakeErrorBoundary
Section titled “ShiitakeErrorBoundary”ShiitakeErrorBoundary =
Schema.Schema.Type<typeofShiitakeErrorBoundarySchema>>
Stable boundary that rejected a Shiitake operation.
ShiitakeErrorCause
Section titled “ShiitakeErrorCause”ShiitakeErrorCause =
Schema.Schema.Type<typeofShiitakeErrorCauseSchema>>
Safe failure category exposed by both Shiitake facades.
ExtensionCapabilityV0
Section titled “ExtensionCapabilityV0”ExtensionCapabilityV0 =
"state"|"settled"|"send"|"timers"|"commands"|"projection"|"run_tools"|"prompt"|"compaction_handoff"
Closed, versioned, feature-free capability vocabulary.
ShiitakeApi
Section titled “ShiitakeApi”ShiitakeApi =
Readonly<{make: (options) =>Promise<ShiitakeAgent>>; }>
Public construction namespace for the Promise-facing durable harness.
ShiitakeHost
Section titled “ShiitakeHost”ShiitakeHost =
Readonly<{agent:ShiitakeAgent;acceptMail: (Promise<Accepted>>; }>
Promise-facing host composition with addressed mail kept off Session.
PromptDelivery
Section titled “PromptDelivery”PromptDelivery =
"steer"|"followUp"
Delivery policy for input accepted while a Session run is active.
SessionCommand
Section titled “SessionCommand”SessionCommand =
Schema.Schema.Type<typeofSessionCommandSchema>>
Public Session command inferred from its one runtime parser.
PromptCommand
Section titled “PromptCommand”PromptCommand =
Schema.Schema.Type<typeofPromptCommandSchema>>
Public prompt command accepted as durable Session work.
AbortCommand
Section titled “AbortCommand”AbortCommand =
Schema.Schema.Type<typeofAbortCommandSchema>>
Public fast-path command that aborts the active Session run.
CancelCommand
Section titled “CancelCommand”CancelCommand =
Schema.Schema.Type<typeofCancelCommandSchema>>
Public command that cancels exactly one accepted request.
BranchCommand
Section titled “BranchCommand”BranchCommand =
Extract<SessionCommand,Readonly<{type:"branch"; }>>
Public command that selects one complete entry as the active lineage leaf.
ForkCommand
Section titled “ForkCommand”ForkCommand =
Extract<SessionCommand,Readonly<{type:"fork"; }>>
Public command that creates a new Session from one complete entry lineage.
SqliteValue
Section titled “SqliteValue”SqliteValue =
WatchdogSqliteValue
Native SQLite scalar and row grammar shared with the work queue owner.
SqliteRow
Section titled “SqliteRow”SqliteRow =
WatchdogSqliteRow
Raw row grammar shared by Woodstock and Watchdog.
SqliteCursor
Section titled “SqliteCursor”SqliteCursor =
WatchdogSqliteCursor&Readonly<{one: () =>SqliteRow; }>
Native rows stay raw until the query’s maintained schema decodes them.
SqliteOwner
Section titled “SqliteOwner”SqliteOwner =
Omit<WatchdogSqliteOwner,"sql"> > &Readonly<{sql:Readonly<{exec: (statement, …bindings) =>SqliteCursor; }>; }>
Synchronous SQL and transactions held by the surrounding runtime.
ModelAcquisition
Section titled “ModelAcquisition”ModelAcquisition =
Readonly<{model:Model<Api>>;stream?:MuleStreamFunction;retryAfterMs?: (message) =>number|undefined;release: () =>Promise<void>>; }>
Acquired Pi model and optional explicit Pi stream function.
ModelSource
Section titled “ModelSource”ModelSource =
Readonly<{acquire: (input) =>Promise<ModelAcquisition>>; }>
Deterministic host seam for model selection and ready egress.
InstructionSnapshot
Section titled “InstructionSnapshot”InstructionSnapshot =
Readonly<{revision:string;text:string;modules?: readonlyModuleRegistration[];release?: () =>void; }>
Immutable instruction snapshot captured for one run.
InstructionSource
Section titled “InstructionSource”InstructionSource =
Readonly<{load: (input) =>Promise<InstructionSnapshot>>; }>
Host seam for one bounded instruction snapshot.
ToolSource
Section titled “ToolSource”ToolSource =
Readonly<{execution?:ExecutionOptions;modules?: readonlyModuleRegistration[];sources?: readonlyCapabilitySource[];sandbox:Sandbox; }>
Mycelium construction inputs captured by the Shiitake-owned run scope.
RuntimePendingWork
Section titled “RuntimePendingWork”RuntimePendingWork =
Readonly<{pending:boolean;nextWakeAt:number|null; }>
Promise host for scheduling the opaque durable reconciler.
RuntimeHost
Section titled “RuntimeHost”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
Section titled “ShiitakeOptions”ShiitakeOptions =
Readonly<{store:SqliteOwner;runtime:RuntimeHost;model:ModelSource;instructions:InstructionSource;tools?:ToolSource;files?:FilesSurface;gateTool?: (input) =>OperationGate;extensions:ExtensionRosterV0; }>
Validated immutable construction bag for the durable harness.
ModelPreference
Section titled “ModelPreference”ModelPreference =
Schema.Schema.Type<typeofModelPreferenceSchema>>
Null at the Session boundary means inherit the Agent default.
DocumentForkPolicyV0
Section titled “DocumentForkPolicyV0”DocumentForkPolicyV0 =
"inherit-at-fork-point"|"current"|"fresh"
Which source value a new Session starts with.
DocumentSpecV0
Section titled “DocumentSpecV0”DocumentSpecV0<
A,I> > =Readonly<{schema:Schema.Codec<A,I>>;initial:A;fork:DocumentForkPolicyV0;maxBytes:number; }>
A typed JSON document, bounded by its encoded UTF-8 size.
Type Parameters
Section titled “Type Parameters”A
I = A
DocumentsV0
Section titled “DocumentsV0”DocumentsV0 =
Readonly<Record<string,Readonly<{schema:Schema.Codec<unknown>>;initial:unknown;fork:DocumentForkPolicyV0;maxBytes:number; }>>>
Existential declarations; each initial value is decoded by its own schema.
DocumentHandleV0
Section titled “DocumentHandleV0”DocumentHandleV0<
A> > =Readonly<{read: (sessionId) =>A;update: (sessionId,change) =>void; }>
Both operations require the declaring extension’s active core transaction.
Type Parameters
Section titled “Type Parameters”A
DocumentHandlesV0
Section titled “DocumentHandlesV0”DocumentHandlesV0<
D> > ={ readonly [K in keyof D]: DocumentHandleV0<D[K]["schema"]["Type"]> }
Handles preserve the decoded type of each declared document.
Type Parameters
Section titled “Type Parameters”D extends DocumentsV0
Variables
Section titled “Variables”Shiitake
Section titled “Shiitake”
constShiitake:ShiitakeApi
Construct the Promise facade over the canonical Effect program.
sqliteRowSchema
Section titled “sqliteRowSchema”
constsqliteRowSchema:Schema.$Record<Schema.String,Schema.Union<readonly [Schema.instanceOf<ArrayBuffer,unknown>>,Schema.String,Schema.Number,Schema.Null]>>
A native row is a scalar record; each query owner decodes its own projection.
Functions
Section titled “Functions”parseForkedSession()
Section titled “parseForkedSession()”parseForkedSession(
value):ForkedSession
Parse one serialized fork result using Shiitake’s public client grammar.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”parseSessionSnapshot()
Section titled “parseSessionSnapshot()”parseSessionSnapshot(
value):SessionSnapshot
Parse one serialized snapshot using Shiitake’s public client grammar.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”parseSessionFrame()
Section titled “parseSessionFrame()”parseSessionFrame(
value):SessionFrame
Parse one serialized frame using Shiitake’s public client grammar.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”makeHost()
Section titled “makeHost()”makeHost(
options,mailRoom):Promise<Readonly<{agent:ShiitakeAgent;acceptMail: (Promise<Readonly<{status:"accepted";commandId:string; }>>; }>>
Construct the host-only Promise facade over the canonical Effect program.
Parameters
Section titled “Parameters”options
Section titled “options”mailRoom
Section titled “mailRoom”BirdDogEffect
Returns
Section titled “Returns”Promise<Readonly<{ agent: ShiitakeAgent;
acceptMail: (mail) => Promise<Readonly<{ status: "accepted";
commandId: string; }>>; }>>
References
Section titled “References”AgentExtensionControls
Section titled “AgentExtensionControls”Re-exports AgentExtensionControls
CancelResult
Section titled “CancelResult”Re-exports CancelResult
Accepted
Section titled “Accepted”Re-exports Accepted
ForkedSession
Section titled “ForkedSession”Re-exports ForkedSession
SendOptions
Section titled “SendOptions”Re-exports SendOptions
ReadOptions
Section titled “ReadOptions”Re-exports ReadOptions
SessionCommandHandler
Section titled “SessionCommandHandler”Re-exports SessionCommandHandler
SessionExtensionControls
Section titled “SessionExtensionControls”Re-exports SessionExtensionControls
SessionExtensionSlots
Section titled “SessionExtensionSlots”Re-exports SessionExtensionSlots
SessionFrame
Section titled “SessionFrame”Re-exports SessionFrame
SessionMessage
Section titled “SessionMessage”Re-exports SessionMessage
SessionProgress
Section titled “SessionProgress”Re-exports SessionProgress
SessionSnapshot
Section titled “SessionSnapshot”Re-exports SessionSnapshot
SessionInboxState
Section titled “SessionInboxState”Re-exports SessionInboxState
SessionSummary
Section titled “SessionSummary”Re-exports SessionSummary
SessionSummaryPage
Section titled “SessionSummaryPage”Re-exports SessionSummaryPage
SessionSummaryRow
Section titled “SessionSummaryRow”Re-exports SessionSummaryRow
SessionActivity
Section titled “SessionActivity”Re-exports SessionActivity
SessionTerminal
Section titled “SessionTerminal”Re-exports SessionTerminal
ShiitakeEventSourceConstructor
Section titled “ShiitakeEventSourceConstructor”Re-exports ShiitakeEventSourceConstructor
SessionWatch
Section titled “SessionWatch”Re-exports SessionWatch
ShiitakeAgent
Section titled “ShiitakeAgent”Re-exports ShiitakeAgent
ShiitakeSession
Section titled “ShiitakeSession”Re-exports ShiitakeSession
SubscribeOptions
Section titled “SubscribeOptions”Re-exports SubscribeOptions
TooLate
Section titled “TooLate”Re-exports TooLate
WatchOptions
Section titled “WatchOptions”Re-exports WatchOptions
BorrowedCompactionViewV0
Section titled “BorrowedCompactionViewV0”Re-exports BorrowedCompactionViewV0
CompactionHandoffErrorV0
Section titled “CompactionHandoffErrorV0”Re-exports CompactionHandoffErrorV0
CompactionHandoffResultV0
Section titled “CompactionHandoffResultV0”Re-exports CompactionHandoffResultV0
CompactionHandoffV0
Section titled “CompactionHandoffV0”Re-exports CompactionHandoffV0
ExtensionGrantV0
Section titled “ExtensionGrantV0”Re-exports ExtensionGrantV0
ExtensionRosterV0
Section titled “ExtensionRosterV0”Re-exports ExtensionRosterV0
ExtensionSlotV0
Section titled “ExtensionSlotV0”Re-exports ExtensionSlotV0
ExtensionStatusV0
Section titled “ExtensionStatusV0”Re-exports ExtensionStatusV0
RosteredExtensionV0
Section titled “RosteredExtensionV0”Re-exports RosteredExtensionV0