colmugx/posoco/port does not have a README file
pub(open) trait CommandPort {
fn commands(Self) -> Array[CommandDef]
async fn invoke(Self, id : String, args : Json) -> CommandOutcome raise CommandError
}pub(open) trait Compressor {
fn compress(Self, messages : Array[Message], ctx : CompressContext) -> CompressAction
}pub(open) trait Lifecycle {
async fn on_shutdown(Self) -> Unit
}pub(open) trait MemoryPort {
fn store(Self, entry : MemoryEntry) -> String raise MemoryError
fn search(Self, query : MemoryQuery) -> Array[MemoryEntry] raise MemoryError
fn delete(Self, id : String) -> Unit raise MemoryError
}pub(open) trait ModelPort {
async fn chat(Self, messages : Array[Message], tools : Array[ToolDef], options : ChatOptions) -> ModelResponse raise ModelError
async fn chat_streaming(Self, messages : Array[Message], tools : Array[ToolDef], options : ChatOptions, on_chunk : (StreamChunk) -> Unit) -> ModelResponse raise ModelError = _
}pub(open) trait SessionStore {
fn load(Self, id : String) -> Result[Session, SessionError]
fn save(Self, id : String, session : Session) -> Result[Unit, SessionError]
}pub(open) trait ToolProvider {
fn list_tools(Self) -> Array[ToolDef]
async fn execute(Self, name : String, call : ToolCall) -> ToolResult raise RuntimeError
}pub(all) struct CommandDef {
id : String
label : String
description : String
category : String
ctype : CommandType
params : Array[CommandParam]
aliases : Array[String]
shortcut : String?
icon : String?
visible : Bool
metadata : Json?
} derive(Eq, Debug)pub(all) enum Stage {
BeforeTurn
BeforeModel(Array[Message])
AfterModel(ModelResponse)
ModelError(String)
BeforeTool(ToolCall)
AfterTool(ToolCall, ToolResult)
ToolError(ToolCall, RuntimeError)
AfterTurn(TurnResult)
TurnError(AgentError)
} derive(Debug)Install
Download zipLLM Agent framework with hexagonal (ports-and-adapters) architecture. Defines 9 traits + Agent loop. Depends on moonbitlang/async.