effect
@fungi.computer/mule / effect
effect
Section titled “effect”Type Aliases
Section titled “Type Aliases”MulePreparedTool
Section titled “MulePreparedTool”MulePreparedTool =
object
A decoded, authorized invocation ready to execute.
Properties
Section titled “Properties”execute
Section titled “execute”
readonlyexecute: () =>Stream.Stream<MuleToolExecutionPart,MuleError>>
Run the already-decoded and authorized tool call.
Returns
Section titled “Returns”Stream.Stream<MuleToolExecutionPart,
MuleError>
MuleTool
Section titled “MuleTool”MuleTool =
object
Pi tool declaration paired with its Effect-native preparation door.
Properties
Section titled “Properties”descriptor
Section titled “descriptor”
readonlydescriptor:Tool
executionMode?
Section titled “executionMode?”
readonlyoptionalexecutionMode?:"parallel"|"sequential"
prepare
Section titled “prepare”
readonlyprepare: (call) =>Effect.Effect<MulePreparedTool,MuleToolRejection>>
Decode and authorize one exact Pi tool call before it can execute.
Parameters
Section titled “Parameters”ToolCall
Returns
Section titled “Returns”Effect.Effect<MulePreparedTool,
MuleToolRejection>
MuleListener
Section titled “MuleListener”MuleListener = (
event) =>Effect.Effect<void,MuleError>>
Effect-native listener. Completion is part of run settlement.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Effect.Effect<void, MuleError>
MuleRunInput
Section titled “MuleRunInput”MuleRunInput =
MuleRunSettings&object
Inputs for one complete Pi model/tool loop. Cancel a run by interrupting its
fiber; the run then ends with a cancelled run_end.
Type Declaration
Section titled “Type Declaration”tools?
Section titled “tools?”
readonlyoptionaltools?: readonlyMuleTool[]
resolveApiKey?
Section titled “resolveApiKey?”
readonlyoptionalresolveApiKey?: (provider) =>Effect.Effect<string|undefined,MuleError>>
Resolve a fresh provider credential immediately before each Pi call.
Parameters
Section titled “Parameters”provider
Section titled “provider”string
Returns
Section titled “Returns”Effect.Effect<string | undefined, MuleError>
getSteeringMessages?
Section titled “getSteeringMessages?”
readonlyoptionalgetSteeringMessages?: () =>Effect.Effect<readonlyMessage[],MuleError>>
Pull messages that should steer the active run at Pi’s safe point.
Returns
Section titled “Returns”Effect.Effect<readonly Message[], MuleError>
getFollowUpMessages?
Section titled “getFollowUpMessages?”
readonlyoptionalgetFollowUpMessages?: () =>Effect.Effect<readonlyMessage[],MuleError>>
Pull messages queued until the run would otherwise finish.
Returns
Section titled “Returns”Effect.Effect<readonly Message[], MuleError>
shouldStopAfterTurn?
Section titled “shouldStopAfterTurn?”
readonlyoptionalshouldStopAfterTurn?: (turn) =>Effect.Effect<boolean,MuleError>>
Request a graceful stop after the current Pi turn has fully settled.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Effect.Effect<boolean, MuleError>
MuleEffect
Section titled “MuleEffect”MuleEffect =
object
Canonical Effect-native Mule interface.
Properties
Section titled “Properties”
readonlyrun: (input,listener?) =>Effect.Effect<MuleRunOutcome,MuleError>>
Run one complete Pi model/tool loop.
Parameters
Section titled “Parameters”listener?
Section titled “listener?”Returns
Section titled “Returns”Effect.Effect<MuleRunOutcome,
MuleError>
Variables
Section titled “Variables”muleEffect
Section titled “muleEffect”
constmuleEffect:MuleEffect
Canonical Effect-native Mule value.
Functions
Section titled “Functions”isContextOverflow()
Section titled “isContextOverflow()”isContextOverflow(
message,contextWindow?):boolean
Apply Pi’s maintained context-overflow semantics to an exact Pi message.
Parameters
Section titled “Parameters”message
Section titled “message”AssistantMessage
contextWindow?
Section titled “contextWindow?”number
Returns
Section titled “Returns”boolean
run(
input,listener?):Effect<MuleRunOutcome,MuleError>>
Run Pi’s model/tool loop inside Effect without changing Pi’s values.
Parameters
Section titled “Parameters”listener?
Section titled “listener?”MuleListener = noListener
Returns
Section titled “Returns”Effect<MuleRunOutcome,
MuleError>
References
Section titled “References”MuleCompletedTurn
Section titled “MuleCompletedTurn”Re-exports MuleCompletedTurn
MuleError
Section titled “MuleError”Re-exports MuleError
MuleEvent
Section titled “MuleEvent”Re-exports MuleEvent
MuleIdentity
Section titled “MuleIdentity”Re-exports MuleIdentity
MuleIdentityKind
Section titled “MuleIdentityKind”Re-exports MuleIdentityKind
MuleRunOutcome
Section titled “MuleRunOutcome”Re-exports MuleRunOutcome
MuleRunSettings
Section titled “MuleRunSettings”Re-exports MuleRunSettings
MuleStreamFunction
Section titled “MuleStreamFunction”Re-exports MuleStreamFunction
MuleToolExecutionPart
Section titled “MuleToolExecutionPart”Re-exports MuleToolExecutionPart
MuleToolRejection
Section titled “MuleToolRejection”Re-exports MuleToolRejection
MuleToolResult
Section titled “MuleToolResult”Re-exports MuleToolResult