概要
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 '@flueFAQ (5)
トラブル対応Anthropic overloaded API errorsによるflue workflowのクラッシュを防ぐ方法
一時的なmodel-provider障害(Anthropicのoverloaded errorなど)は、指数バックオフで自動的に再試行されるようになりました。commit 666289f以降を含むバージョンにアップグレードしてください。
トラブル対応Bunを使用する際に、flue CLIが'upgrade Node.js'エラーを表示するのはなぜですか?
このエラーは、@flue/cli (v0.6.2以前)がBunで実行されている場合でも無条件にNode.jsのバージョンチェックを行うために発生します。BunはTypeScriptをネイティブに処理するため、Node.jsのバージョン要件は不要です。コミット48549d9以降、CLIはBunを検出し、Bunのバージョンが古すぎる場合には誤解を招くNode.jsエラーの代わりに、Bun固有のアップグレードメッセージを表示するようになりました。修正するには、最新の@flue/cliバージョンにアップグレードしてください。古いバージョンでは、環境変数FLUE_NO_NODE_VERSION_CHECK=1を使用してチェックをバイパスするか、一時的にNode.jsでCLIを実行する回避策があります。
トラブル対応FlueをCodex/OpenAIと一緒に使っている時に 'Invalid prompt_cache_key: string too long' エラーを修正する方法
Flueを最新バージョンにアップグレードしてください。エラーはセッションアフィニティキーが64文字の制限を超えたことが原因でした。修正(コミットa783a7c)では、長いキーを境界のある不透明なaff_<ULID>キーに置き換えています。すぐにアップグレードできない場合の一時的な回避策として、コンポーネント名とセッション名を短くして、長いアフィニティキーを避けてください。
トラブル対応flueの組み込みタスクツールがsession.prompt()中に'Session is already running prompt'で失敗するのはなぜですか?
これは、flue v0.8.0より前のバージョンにおける既知のバグです。task toolが、すでにpromptを実行している同じparent sessionを誤って要求しようとします。この問題を解決するには、flue v0.8.0以降にアップグレードしてください。
トラブル対応Cloudflare WorkersをFlue 0.7.0でデプロイする際に発生する「Cannot create binding for class FlueRegistry」エラー(コード10061)を修正する方法
Flue 0.7.0では、生成されたwrangler.jsoncにおいて、新しい内部Durable Object「FlueRegistry」のマイグレーションが既存のマイグレーションより前に配置されます。未適用のマイグレーションは既に適用済みのものの後に来なければならないため、Wranglerはこれを拒否します。回避策:手動でdist/wrangler.jsoncを編集し、'flue-class-FlueRegistry'タグをmigrations配列の末尾に移動してください。恒久的な修正としては、Flue 0.9.0以降にアップグレードしてください。このバージョンではマイグレーションが生成されず、正しい順序で独自のwrangler.jsonを管理できます。