moonbitstack/moonkoog/middleware does not have a README file
impl Middleware for ContextEditingasync fn after_agent(_self : ContextEditing, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(self : ContextEditing, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : ContextEditing, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ContextEditing::after_agent(_self : ContextEditing, _context : RunContext, _state : AgentState) -> Array[Update]async fn ContextEditing::before_agent(_self : ContextEditing, _context : RunContext) -> Array[Update]async fn ContextEditing::wrap_model(self : ContextEditing, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ContextEditing::wrap_tool(_self : ContextEditing, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub(all) enum EditingStrategy {
ClearToolResults(keep~ : Int)
KeepLast(keep~ : Int)
}pub struct FileSearch {
root : String
limit : Int
read_limit : Int
}impl Middleware for FileSearchasync fn after_agent(_self : FileSearch, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(_self : FileSearch, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : FileSearch, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn FileSearch::after_agent(_self : FileSearch, _context : RunContext, _state : AgentState) -> Array[Update]async fn FileSearch::wrap_model(_self : FileSearch, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn FileSearch::wrap_tool(_self : FileSearch, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeimpl Middleware for HumanInTheLoopasync fn after_agent(_self : HumanInTheLoop, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(_self : HumanInTheLoop, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(self : HumanInTheLoop, context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn HumanInTheLoop::after_agent(_self : HumanInTheLoop, _context : RunContext, _state : AgentState) -> Array[Update]async fn HumanInTheLoop::before_agent(_self : HumanInTheLoop, _context : RunContext) -> Array[Update]async fn HumanInTheLoop::wrap_model(_self : HumanInTheLoop, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn HumanInTheLoop::wrap_tool(self : HumanInTheLoop, context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub struct ModelCallLimit {
limit : Int
}impl Middleware for ModelCallLimitasync fn after_agent(_self : ModelCallLimit, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(self : ModelCallLimit, context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : ModelCallLimit, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ModelCallLimit::after_agent(_self : ModelCallLimit, _context : RunContext, _state : AgentState) -> Array[Update]async fn ModelCallLimit::before_agent(_self : ModelCallLimit, _context : RunContext) -> Array[Update]async fn ModelCallLimit::wrap_model(self : ModelCallLimit, context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ModelCallLimit::wrap_tool(_self : ModelCallLimit, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeimpl Middleware for ModelFallbackasync fn after_agent(_self : ModelFallback, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(self : ModelFallback, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : ModelFallback, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ModelFallback::after_agent(_self : ModelFallback, _context : RunContext, _state : AgentState) -> Array[Update]async fn ModelFallback::wrap_model(self : ModelFallback, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ModelFallback::wrap_tool(_self : ModelFallback, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub struct ModelRetry {
attempts : Int
base_ms : Int
factor : Double
cap_ms : Int
}impl Middleware for ModelRetryasync fn after_agent(_self : ModelRetry, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(self : ModelRetry, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : ModelRetry, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ModelRetry::after_agent(_self : ModelRetry, _context : RunContext, _state : AgentState) -> Array[Update]async fn ModelRetry::wrap_model(self : ModelRetry, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ModelRetry::wrap_tool(_self : ModelRetry, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeimpl Middleware for Piiasync fn wrap_model(self : Pii, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : Pii, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn Pii::wrap_model(self : Pii, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn Pii::wrap_tool(_self : Pii, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub(all) enum PiiAction {
Redact
Mask
}pub(all) struct PiiRule {
pattern : String
label : String
}impl Middleware for ShellToolasync fn after_agent(_self : ShellTool, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(_self : ShellTool, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : ShellTool, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ShellTool::after_agent(_self : ShellTool, _context : RunContext, _state : AgentState) -> Array[Update]async fn ShellTool::wrap_model(_self : ShellTool, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ShellTool::wrap_tool(_self : ShellTool, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub struct Summarization {
max_messages : Int
keep : Int
}impl Middleware for Summarizationasync fn after_agent(_self : Summarization, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(self : Summarization, context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : Summarization, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn Summarization::after_agent(_self : Summarization, _context : RunContext, _state : AgentState) -> Array[Update]async fn Summarization::wrap_model(self : Summarization, context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn Summarization::wrap_tool(_self : Summarization, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub struct TodoList {
}impl Middleware for TodoListasync fn wrap_model(_self : TodoList, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : TodoList, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn TodoList::after_agent(_self : TodoList, _context : RunContext, _state : AgentState) -> Array[Update]async fn TodoList::wrap_model(_self : TodoList, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn TodoList::wrap_tool(_self : TodoList, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub struct ToolCallLimit {
limit : Int
tool : String?
}impl Middleware for ToolCallLimitasync fn after_agent(_self : ToolCallLimit, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(_self : ToolCallLimit, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(self : ToolCallLimit, context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ToolCallLimit::after_agent(_self : ToolCallLimit, _context : RunContext, _state : AgentState) -> Array[Update]async fn ToolCallLimit::wrap_model(_self : ToolCallLimit, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ToolCallLimit::wrap_tool(self : ToolCallLimit, context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomepub struct ToolRetry {
attempts : Int
base_ms : Int
factor : Double
cap_ms : Int
}impl Middleware for ToolRetryasync fn after_agent(_self : ToolRetry, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(_self : ToolRetry, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(self : ToolRetry, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ToolRetry::after_agent(_self : ToolRetry, _context : RunContext, _state : AgentState) -> Array[Update]async fn ToolRetry::wrap_model(_self : ToolRetry, _context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ToolRetry::wrap_tool(self : ToolRetry, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeimpl Middleware for ToolSelectionasync fn after_agent(_self : ToolSelection, _context : RunContext, _state : AgentState) -> Array[Update]async fn wrap_model(self : ToolSelection, context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn wrap_tool(_self : ToolSelection, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomeasync fn ToolSelection::after_agent(_self : ToolSelection, _context : RunContext, _state : AgentState) -> Array[Update]async fn ToolSelection::wrap_model(self : ToolSelection, context : RunContext, call : ModelCall, next : async (ModelCall) -> ModelOutcome) -> ModelOutcomeasync fn ToolSelection::wrap_tool(_self : ToolSelection, _context : RunContext, call : ToolCall, next : async (ToolCall) -> ToolOutcome) -> ToolOutcomelet todo_note : StringInstall
Download zipmoonkoog — an agent framework for MoonBit: prebuilt agents and strategies over the moonstate graph engine, a middleware pipeline, planning, multi-agent composition, and the protocol adapters that put an agent behind MCP, A2A, ACP and the Agent Protocol.