项目简介
Flue 是一个 TypeScript 框架,专为构建代理而设计,内置代理 harness,支持多种沙箱,可部署到任何环境,强调运行时无关性和可编程性。
README 预览
> **Experimental** — Flue is under active development. APIs may change.\n>\n> Looking for `v0.0.x`? [See here.](https://github.com/withastro/flue/tree/v0.0.x)\n\n# Flue\n\nFlue is **The Agent Harness Framework.** If you know how to use Claude Code (or Codex, OpenCode, Pi, etc)... then you already know the basics of how to build agents with Flue.\n\nFlue is a TypeScript framework for building the next generation of agents, designed around a built-in **agent harness**. It's like Claude Code, but 100% headless and programmable. There's no baked-in assumption like requiring a human operator to function. No TUI. No GUI. Just TypeScript.\n\nBut using Flue feels like using Claude Code. The agents you build act autonomously to solve problems and complete tasks. They require very little code to run — most of the "logic" lives in Markdown: skills, context, and `AGENTS.md`.\n\nFlue isn't another AI SDK. It's a proper runtime-agnostic framework — think Astro or Next.js, but for agents. Write once, build, and deploy your agents anywhere (Node.js, Cloudflare, GitHub Actions, GitLab CI/CD, etc).\n\n## Packages\n\n| Package | Description |\n| ----------------------------- | --------------------------------------- |\n| [`@flue/sdk`](packages/sdk) | Core SDK: build system, sessions, tools |\n| [`@flue/cli`](packages/cli) | CLI for building and running agents |\n\n## Examples\n\n### Quickstart\n\nThe simplest agent — no container, no tools, just a prompt and a typed result.\n\nUnless you opt-in to initializing a full container sandbox, Flue will default to a virtual sandbox for every agent, powered by [just-bash](https://github.com/vercel-labs/just-bash). A virtual sandbox is going to be dramatically faster, cheaper, and more scalable than running a full container for every agent, which makes it perfect for building high-traffic/high-scale agents.\n\n```ts\n// .flue/agents/hello-world.ts\nimport type { FlueContext } from '@flue常见问题 (5)
故障排除如何防止由人类过载API错误引起的流量工作流程故障?
暂时的模型提供商故障,如Anthropic的过载错误,现在会被自动重置,并将其升级到包含 commit 666289f 或更高版本。
故障排除为什么使用 Bun 时 flue CLI 会显示“升级 Node.js”错误?
此错误发生是因为 @flue/cli (v0.6.2 和更早) 即使在 Bun 中运行时也无条件地检查 Node.js 版本. 由于 Bun 自然处理 TypeScript,Node.js 版本要求是不必要的。 从 commit 48549d9 开始,CLI 会检测 Bun 并提供一个特定于 Bun 的升级消息,如果 Bun 版本过于旧,而不是误导性的 Node.js 错误。 要修复,升级到最新 @flue/cli 版本。 对于较旧的版本,一个解决方案是绕过环境变量 FLUE_NO_NODE_VERSION_CHECK=1 或暂时运行 Node.js 的 CLI。
故障排除如何在使用 Codex/OpenAI 的 Flue 时修复“无效 prompt_cache_key: string too long”错误?
升级 Flue 到最新版本. 此错误是由于会话亲密密钥超过了 64 个字符的限制。 修复程序 (commit a783a7c) 将长密钥替换成边界不透明的 aff_<ULID> 密钥。
故障排除为什么 flue 的内置任务工具在 session.prompt( ) 期间在“Session is already running prompt” 时失败?
这是在 v0.8.0 之前的 flue 版本中已知的错误。任务工具试图错误地声称已经运行提示的相同的家长会话。
故障排除如何在使用 Flue 0.7.0 部署 Cloudflare 工作者时修复“无法为类 FlueRegistry 创建约束”错误(代码 10061)?
在 Flue 0.7.0 中,新内部可持续对象“FlueRegistry”的迁移出现在生成的 wrangler.jsonc 中的现有迁移之前。Wrangler 拒绝此,因为未应用的迁移必须在已经应用的迁移之后出现。Workaround:手动编辑 dist/wrangler.jsonc 并将“flue-class-FlueRegistry”标签移动到迁移阵列的尽头。