withastro / flue
Flue — The Agent Harness Framework
Flue — 智能体编排框架
Not another SDK. Build autonomous agents and powerful AI workflows with Flue’s programmable TypeScript harness.
这不是又一个 SDK。利用 Flue 可编程的 TypeScript 编排框架,构建自主智能体和强大的 AI 工作流。
// agents/triage.ts
import { createAgent, type AgentRouteHandler } from '@flue/runtime';
import { local } from '@flue/runtime/node';
import triage from '../skills/triage/SKILL.md' with { type: 'skill' };
import verify from '../skills/verify/SKILL.md' with { type: 'skill' };
import * as githubTools from '../tools/github.ts';
// Give agents the context and autonomy to solve complex tasks:
const instructions = `
Triage a bug report end-to-end: reproduce the bug, diagnose the root cause, verify whether the behavior is intentional, and attempt a fix.
...`;
// Expose (and protect) your agents over HTTP:
export const route: AgentRouteHandler = async (_c, next) => next();
// Compose the complete harness your agent needs to do real work,
// complete with virtual, local, or remote container sandbox.
export default createAgent(() => ({
model: 'anthropic/claude-sonnet-4-6',
tools: [...githubTools],
skills: [triage, verify],
sandbox: local(),
instructions,
}));
The framework for building the next generation of agents. The first agents were built with raw LLM API calls. This worked for simple chatbots and scripted tasks, but not much else. Agents like Claude Code and Codex broke the mold. These were real agents. Autonomous. You give them a task — not a pre-defined series of steps — and trust them to complete it using the context and tools that you provide.
这是构建下一代智能体的框架。早期的智能体是基于原始 LLM API 调用构建的,这对于简单的聊天机器人和脚本化任务尚可,但除此之外便无能为力。Claude Code 和 Codex 等智能体打破了这一模式。它们是真正的智能体——自主的。你只需给它们一个任务,而不是预定义的一系列步骤,并信任它们利用你提供的上下文和工具来完成任务。
Flue unlocks this new architecture for agents. Its built-in TypeScript harness gives any model the context and environment it needs for truly autonomous work: sessions, tools, skills, instructions, filesystem access, and a secure sandbox to run in. Run your agents locally via CLI or deploy them to your hosted runtime of choice.
Flue 为智能体解锁了这种全新的架构。其内置的 TypeScript 编排框架为任何模型提供了实现真正自主工作所需的上下文和环境:会话、工具、技能、指令、文件系统访问权限以及运行的安全沙箱。你可以通过 CLI 在本地运行智能体,或将其部署到你选择的托管运行时中。
Features / 功能特性
Build agents that can safely take action, maintain continuity, and connect to the systems where work already happens.
构建能够安全执行操作、保持连续性并连接到现有工作系统的智能体。
- Agents — Build agents that can keep context across conversations and events as they autonomously work toward a goal. 智能体 — 构建能够在对话和事件中保持上下文,并朝着目标自主工作的智能体。
- Workflows — Run structured automations where your code guides agent reasoning from a clear input to a finished result. 工作流 — 运行结构化的自动化流程,通过代码引导智能体的推理过程,从明确的输入得出最终结果。
- Sandboxes — Give agents a secure environment where they can use tools, modify files, and autonomously complete real work. 沙箱 — 为智能体提供一个安全的环境,使其能够使用工具、修改文件并自主完成实际工作。
- Durable Execution — Learn how agents preserve progress through failures and restarts with durable recovery for accepted work. 持久化执行 — 了解智能体如何通过已接受工作的持久化恢复机制,在故障和重启后保持进度。
- Subagents — Define specialized roles for different tasks, then let your agent delegate work to the right expert. 子智能体 — 为不同任务定义专业角色,让你的智能体将工作委派给合适的专家。
- Tools — Give agents typed actions for calling APIs, querying data, and making controlled changes through your application. 工具 — 为智能体提供类型化的操作,用于调用 API、查询数据并通过你的应用程序进行受控更改。
- Skills — Package reusable expertise and workflows that agents can load whenever a task needs specialized guidance. 技能 — 封装可重用的专业知识和工作流,智能体可在任务需要专业指导时随时加载。
- MCP Servers — Connect agents to authenticated tools and services through the open Model Context Protocol ecosystem. MCP 服务器 — 通过开放的 Model Context Protocol (MCP) 生态系统,将智能体连接到经过身份验证的工具和服务。
- Observability — Monitor your agents and export telemetry with OpenTelemetry, Braintrust, Sentry, or your own observer. 可观测性 — 使用 OpenTelemetry、Braintrust、Sentry 或你自己的观察器来监控智能体并导出遥测数据。
- Channels — Receive verified events from Slack, Teams, Discord, GitHub, and more. 渠道 — 从 Slack、Teams、Discord、GitHub 等平台接收经过验证的事件。
Deploy Anywhere / 随处部署
- Node.js
- Cloudflare Workers
- GitHub Actions
- GitLab CI/CD
- Daytona
- Render
Packages / 软件包
| Package | Description |
|---|---|
@flue/runtime | Runtime: harness, sessions, tools, sandbox |
@flue/cli | CLI and build/dev tooling (flue binary) |
@flue/sdk | Client SDK for consuming deployed agents and workflows |
@flue/opentelemetry | OpenTelemetry tracing adapter |
@flue/postgres | Postgres persistence adapter |
| 软件包 | 描述 |
|---|---|
@flue/runtime | 运行时:编排、会话、工具、沙箱 |
@flue/cli | CLI 及构建/开发工具 (flue 二进制文件) |
@flue/sdk | 用于调用已部署智能体和工作流的客户端 SDK |
@flue/opentelemetry | OpenTelemetry 追踪适配器 |
@flue/postgres | Postgres 持久化适配器 |