flutter_agent_harness
A cross-platform AI agent harness for Dart and Flutter with streaming provider adapters, native tool calling, session persistence and context compaction, running on Flutter apps, the Dart VM and the web.
flutter_agent_harness is a pure-Dart agent core, with no dependency on dart:io or Flutter in its library code, so the same agent loop compiles and runs on the Dart VM, Flutter desktop and mobile apps, and the web, with platform-specific capabilities kept behind an execution-environment abstraction. Provider failures never throw; every error, including network failures, rate limits and malformed streaming data, arrives as a typed error event so the agent loop keeps running instead of dying on a dropped connection.
It supports each provider's native tool-calling format, including OpenAI's tools, Anthropic's tool use and Google's function calling, with prompt-based tool calling available only as an opt-in adapter for chat-only runtimes, plus token-based context accounting, model-role fallback chains, API-key rotation and cancellation support throughout. Sessions are stored as append-only JSONL trees supporting branching and labeled navigation, and the project ships a terminal coding agent built on the same core, with a web demo, an iOS beta and a macOS app.