About this project
affe-agent is a TypeScript library that serves as an Effect-native agent execution kernel, sitting between Effect AI's LanguageModel, Prompt, Tool, and Toolkit primitives and the application layer. It provides the session, run, turn, steering, follow-up, interruption, and lifecycle event layer that agent applications typically reinvent.
The core model is sessions → submissions → runs → turns, with one append-only canonical history and typed lifecycle events. The kernel is small and extensible through a handful of seams: toolkit/tools, contextTransform, loop, permission, toolExecution, elicitation, InputChannel, eventSink/events, AgentSessionHost, LanguageModel, and Sandbox. Batteries plug into these seams to add capabilities without modifying the core.
Key capabilities include:
- Multiple transports: HTTP, RPC, AG-UI, A2A, MCP (v1 and v2), OpenAI-compatible completions, and connectors (Slack)
- Batteries for coding (file/shell tools over a sandbox), web (search, guarded fetch, rendered-page capture), subagents, memory, skills, compaction, budget (token and money ceilings), model metadata, observability, redaction, data, hooks, scheduling, tree (branchable sessions), sessions (paginated directory), export (snapshot and JSONL), blob storage, plugins, and presets
- Durable execution via Effect Workflow, with cluster support and Durable Streams
- Sandbox abstraction with portable and local (Node) implementations
- Testing utilities including a scripted TestLanguageModel, AgentProbe, web doubles, and conformance suites
- Runtime portability across Node, Bun, Deno, and edge runtimes (Cloudflare Workers)
The library is at version 0.0.1 (pre-release). The design is stable but the underlying Effect v4 substrate is still at release candidate, so API churn from Effect is expected until GA. The project recommends pinning exact versions of affe-agent, effect, and @effect/ai-* providers together.
The repository also includes reference applications: a full-screen local coding TUI, a conventional CLI client, and a Cloudflare Worker deployment with one Durable Object per session.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.