项目介绍
Agent 开发框架 · 2026-11-09 更新 · 本站尚未实测
Flow Weaver 是一个确定性的 TypeScript 工作流编译器:你在普通 .ts 文件里用 JSDoc 注解描述节点与连线,编译器把执行图填入函数体。README 强调编译结果不 import 本包任何内容,是可读、可审阅、可保留的纯 TypeScript,调用方只需传入一个 runtime 对象。
工作流即源码文件,因此可沿用 Git、代码评审、测试、lint 与 CI。它同时提供 MCP 服务器,README 称可在 Claude Code、Cursor、VS Code、Windsurf 等 MCP 兼容编辑器里通过对话完成脚手架、加节点、连线、校验、编译、运行与差异比较。
核心能力
点击能力名称查看输入、输出和原文依据。
- 注解式定义:
@flowWeaver nodeType标注普通函数,参数为输入端口、返回对象字段为输出端口;@flowWeaver workflow配合@param、@returns、@node、@path定义工作流与路由。 - 编译与剥离:
fw compile在标记之间生成函数体,fw strip移除生成代码。 - 校验与试运行:
fw validate校验,fw run可直接运行不带 gate 的工作流。 - 本地控制台:
fw console打开本地 Web 应用,把每个工作流视为一个进程,查看问题、代码与分步运行值;README 说明其绑定127.0.0.1:4311。 - 持久化 gate:运行可在 gate(人工审批、等待外部事件、等待 AI Agent)处暂停并返回 continuation,之后由任意进程从该节点续跑;暂停的运行存放在项目
.fw/runs目录(以最近的含package.json的目录为项目),也可实现自定义存储。 - 工作流即 HTTP 端点:
fw serve挂载声明的路由,参数可从路径、查询或 JSON 体绑定;含暂停时返回 202 与 Location 轮询地址。 - 库方式调用:编译文件导出运行时构建助手,
@synergenius/flow-weaver/api、/coordinator、/server等子入口提供编程接口。 - 扩展包:节点类型、部署目标、CLI 命令与 MCP 工具可由 npm 包贡献,通过
fw market发现、安装与发布。
实际应用场景
适用场景
适合希望把业务流程以可评审源码形式维护、需要人工审批节点、需要把工作流暴露为 HTTP 接口或由 AI 编辑器协作编写的 TypeScript 团队。README 提到一个在浏览器中运行的退款审批示例。若只是需要图形化低代码平台,本项目的代码驱动方式与目标不同。
安装与接入
需要 Node.js 22+。README 给出的安装命令:
npm install @synergenius/flow-weaver
该包同时包含 fw CLI、MCP 服务器、本地控制台与库。快速开始(原文命令):
npx fw init my-project # a project: a workflow, a runner that calls it, the config
cd my-project && npm install
npm start # run the compiled workflow
npx fw console --open # see it as a process; run it, and answer its gates, from the browser
MCP 接入(原文命令):
fw mcp-setup # register the server with Claude, Cursor, VS Code, Windsurf, Codex, or OpenClaw
fw mcp-server # or start it manually
Agent gate 的模型配置写在 .flowweaver/agents.yaml,可指定 Anthropic、任意 OpenAI 兼容服务器(含本地服务)或 Claude Code CLI,并指定存放密钥的环境变量;fw agents --init 生成起始文件。具体客户端配置细节、MCP 配置字段与传输方式在本次资料中缺失,待核验。
使用条件与限制
- 是否需要部署
- 需自行准备运行环境,具体要求见正文
- 是否需要注册
- 账号和认证要求见正文;未明确说明的项目仍待核验
- 是否需要 API Key
- 待核验
- 费用与额度
- 费用边界见正文,项目许可不代表模型或托管服务免费
- 所需权限
- 待核验
- 许可证与服务条款
- 待核验
权限费用与限制
- 项目处于 beta:README 称编译器、校验器、CLI、控制台与 MCP 工具稳定且测试充分,但小版本之间仍可能有不兼容变更,建议固定版本。
- 包本身的使用条件以 Apache-2.0 与 NOTICE 为准;编译产物按 README 声明归使用者所有。但所用模型服务(Anthropic、OpenAI 兼容服务、Claude Code CLI)的费用与条款由各服务方决定,项目未说明任何免费额度,费用待向各服务方核验。
- 本地控制台默认绑定 127.0.0.1,
fw serve的鉴权令牌在示例中来自环境变量FW_SERVE_TOKEN,完整安全边界与默认值待核验。 fw run仅适用于不含 gate 的工作流,暂停运行需使用控制台、fw serve、MCP 工具或自写 coordinator。- 中国市场与国内模型兼容性:README 仅称支持“任意 OpenAI 兼容服务器”,未点名具体国内模型,实际可用性待核验。
国内使用情况
网友核验 用户经验分享
与站长实测独立,不代表官方认证或本站已实测。
最近核验:暂无有效核验。参与人数按当前项目有效身份去重;不同核验项分别统计,不合并成用户总结果。仅统计审核通过且未过期的记录。
分项统计、有效期与样本量
| 核验项目 | 有效人数 | 成功 / 部分 / 失败 / 无法判断 | 成功率 | 最近核验 / 有效期 |
|---|---|---|---|---|
| 官方网站访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| GitHub 仓库访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 安装与运行 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 官方服务国内连接 / MCP 连接 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 国内网络情况 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 国内模型兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 自定义 API | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外服务依赖 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外账号要求 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 中文界面 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 客户端兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 账号及费用信息 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
成功率 = 成功 ÷(成功 + 部分成功 + 失败);无法判断不计入分母。至少 5 份可判断结果才显示成功率。账号、费用、海外依赖与语言等事实项,成功表示核查结论与资料吻合,具体观察另行统计;不表示免费或没有海外依赖。不同网络、客户端和版本的结果不能直接等同。
最近有效核验
暂无审核通过且未过期的网友核验。欢迎提交真实使用记录。
查看全部有效核验 →国内实测状态:国内可用性待核验。协议兼容和官方资料说明不等于国内网络可用。
- 官方网站访问
- 尚未实测 待核验
- GitHub 仓库访问
- 尚未实测 待核验
- 官方服务国内连接
- 尚未实测 待核验
- 国内网络情况
- 尚未实测 待核验
- 国内模型兼容性
- 尚未实测 待核验
- 自定义 API
- 尚未实测 待核验
- 海外服务依赖
- 尚未实测 待核验
- 海外账号要求
- 尚未实测 待核验
- 中文界面
- 尚未实测 待核验
- 国内最后核验时间
- 尚未实测
许可与国内使用
仓库根目录包含 Apache License 2.0 全文,README 明确声明采用 Apache-2.0,并说明编译产物、生成代码与图示可任意使用、修改与分发且无需署名(详见 NOTICE)。商业支持与企业协议可联系 README 所列邮箱。npm 包、在线演示页与模型供应商服务属不同层面,是否免费、部署地域与数据流向须分别向官方核验。国内网络访问 npm、MCP 编辑器集成及模型 API 的可用性待核实。
项目资料与来源
字段依据与待核验事项
access:来源确认 · npm install @synergenius/flow-weaver
project_type:来源确认 · A deterministic TypeScript workflow compiler.
原始 README(折叠技术参考)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/brand/flow-weaver-cream.svg">
<img src="docs/brand/flow-weaver.svg" alt="" height="96">
</picture>
# Flow Weaver
[](https://www.npmjs.com/package/@synergenius/flow-weaver)
[](https://github.com/synergenius-fw/flow-weaver/actions/workflows/ci.yml)
[](https://nodejs.org)
[](./LICENSE)
**A deterministic TypeScript workflow compiler. You describe a workflow with JSDoc annotations. It compiles to a standalone TypeScript function you own.**
Flow Weaver turns annotated functions into an execution graph and generates the workflow body in place. The compiled file imports nothing from Flow Weaver: it is plain TypeScript you can read, review and keep, and it is yours under any licence you like. The code that calls it hands it one small object, the runtime, and the compiled file exports the helper that builds it. Running what the compiler produced needs nothing from the package, gates included.
Workflows are plain `.ts` files, so everything you already do with code applies: Git, code review, tests, linting, CI. Build them by hand the way you write JSDoc, or drive the whole compiler through MCP tools from Claude Code, Cursor, VS Code, Windsurf, or any MCP-compatible editor.
**Try one in your browser:** at [synergenius-fw.github.io/flow-weaver](https://synergenius-fw.github.io/flow-weaver/) a compiled refund workflow runs in the page and stops for a manager's approval. You are the manager.
## Install
Requires Node.js **22+**.
```bash
npm install @synergenius/flow-weaver
```
This installs the `fw` CLI, the MCP server, the local console, and the library, all in one package.
## Quick start
```bash
npx fw init my-project # a project: a workflow, a runner that calls it, the config
cd my-project && npm install
npm start # run the compiled workflow
npx fw console --open # see it as a process; run it, and answer its gates, from the browser
```
On any workflow file:
```bash
npx fw validate src/my-project-workflow.ts
npx fw run src/my-project-workflow.ts --params '{"data":{"message":"hi"}}' # no compile needed to try it
npx fw compile src/my-project-workflow.ts # generate the standalone body in place
```
Run `fw --help` or `fw <command> --help` for full options.
## How workflows are defined
A **node type** is a plain function annotated `@flowWeaver nodeType`. Its ports are inferred from the signature: each parameter is an input, each field of the returned object an output. Most node types are pure `@expression` functions.
A **workflow** is an exported function annotated `@flowWeaver workflow`. `@param` declares its inputs (`Start`), `@returns` its outputs (`Exit`), `@node` creates instances, and `@path` wires the route, connecting each data port to the nearest earlier step with a matching output. The body is a stub. The compiler fills it in between markers and leaves everything else untouched.
```typescript
/**
* @flowWeaver nodeType
* @expression
* @input name - Name to greet
* @output message - Greeting message
*/
function greet(name: string): string {
return `Hello, ${name}!`;
}
/**
* @flowWeaver nodeType
* @expression
* @input message - Text to transform
* @output result - Uppercased text
*/
function shout(message: string): string {
return message.toUpperCase();
}
/**
* @flowWeaver workflow
* @param name - Name to greet
* @returns result - Uppercased greeting
* @node greeter greet
* @node transform shout
* @path Start -> greeter -> transform -> Exit
*/
export function greeting(
execute: boolean,
params: { name: string },
): { onSuccess: boolean; onFailure: boolean; result: string } {
throw new Error('generated body was not installed');
}
```
That is a complete workflow. `fw compile` reads the annotations, builds the graph, and installs the real body.
## The local console
`fw console` opens a local web app over a project's workflows. Every workflow appears as a process, with its issues and code, live runs with each step's values, gates answered from a form built from the port's type, a step-through debugger, and a semantic diff between versions. Runs you start there use the same coordinator the MCP tools and `fw serve` use, so a run paused for approval can be answered from the browser, from an assistant, or over HTTP, interchangeably.
```bash
fw console --open
```
Its Project page is the front door: the project's HTTP server with Start, Stop and its logs, the declared endpoints, the agent profiles, the editors that have the MCP server, the environment checks, and every run waiting for a person. It binds to `127.0.0.1:4311` and re-reads files as you save them.
## AI-native editing
The MCP server exposes the full compiler, validator, debugger, and diagram surface to any MCP-compatible editor. Scaffold, add nodes, wire connections, validate, compile, run, and diff, all through conversation.
```bash
fw mcp-setup # register the server with Claude, Cursor, VS Code, Windsurf, Codex, or OpenClaw
fw mcp-server # or start it manually
```
## Durable workflows
A **gate** is a node where the run stops and hands control to something outside it: a person approving (`@durableGate approval`), an external system answering (`waitForEvent`), or an AI agent doing a task (`waitForAgent`). The run returns a continuation and the process is free to exit. Later, any process resumes from exactly that node with the answer. `fw create workflow approval <file>` writes one to start from.
Paused runs live in a store: the project's `.fw/runs` directory (the project being the nearest folder with a `package.json`), or a store of your own behind a nine-method interface. `fw console`, `fw serve`, the MCP tools and your own code through `createLocalCoordinator` can all drive the same runs, so a gate reached anywhere is answered anywhere. (`fw run` is for workflows without gates. It has nowhere to keep a run between one gate and the next.) A host with no package at all works too: the compiled file throws a `DurableGateYield` carrying the continuation, and exports `acceptContinuation` to take it back later. See `fw docs library`.
An agent gate can be answered without anyone watching: a **profile** in `.flowweaver/agents.yaml` names a model (Anthropic, any OpenAI-compatible server including a local one, or the Claude Code CLI) and the environment variable that holds its key. The model gets the gate's inputs and one tool shaped from the gate's output type, and the run resumes with what it returns. `fw agents --init` writes the starter file. The console's Agents page edits it with a form.
## Workflows as endpoints
A workflow declares its route, and `fw serve` mounts it:
```typescript
/**
* @flowWeaver workflow
* @http POST /reviews
* @http GET /reviews/:path
* @param path - The file
* @param text - Its contents
* @returns report - The review
*/
export async function reviewFile(
execute: boolean,
params: { path: string; text: string },
): Promise<{ onSuccess: boolean; onFailure: boolean; report: string }> {
throw new Error('generated body was not installed');
}
```
Parameters bind from the path, the query or the JSON body. The answer is the workflow's return ports: `200` on success, `422` on the failure path, `202` with a `Location` to poll when a gate pauses the run. An `Idempotency-Key` makes a retry the same run. A `callback` route posts the final response to the caller. `/openapi.json` describes all of it.
The same handler mounts in your own server (Node, Express, Fastify, or a fetch host) from `@synergenius/flow-weaver/server`:
```typescript
import { createServer } from 'node:http';
import { createWorkflowApi } from '@synergenius/flow-weaver/server';
const api = createWorkflowApi({ dir: './workflows', token: process.env.FW_SERVE_TOKEN });
createServer(api.node()).listen(3000); // or, in Express: app.use('/api', api.express())
```
## Using it as a library
The compiled file imports nothing from the package. The code that *calls* it needs one object, the runtime, and the compiled file exports the helper that builds it:
```typescript
import { greeting, createWorkflowRuntime } from './my-workflow';
const runtime = createWorkflowRuntime({ runId: 'run-1', workflowId: 'greeting' });
const result = await greeting(true, { name: 'Alice' }, runtime);
// result.result === 'HELLO, ALICE!'
```
The package exports the same `createWorkflowRuntime`, built from the same source, for code that already depends on it. Parse, validate, compile, query, and diff are all available programmatically from `@synergenius/flow-weaver/api`. `@synergenius/flow-weaver/coordinator` starts and resumes gated runs from code and takes a run store of your own. `@synergenius/flow-weaver/server` is the HTTP handler behind `fw serve`. See `fw docs library` for the full surface and entry points.
## CLI reference
| Command | Description |
|---------|-------------|
| `fw init` | Scaffold a new project |
| `fw validate` | Validate workflows without compiling |
| `fw compile` / `fw strip` | Compile workflows to standalone TypeScript, or remove the generated code |
| `fw run` | Execute a workflow without gates directly |
| `fw watch` / `fw dev` | Recompile (and run) on file changes |
| `fw console` | Open the local operator console |
| `fw agents` | The agent profiles that answer agent gates, and a starter file |
| `fw describe` | Output workflow structure (JSON, text, Mermaid, ASCII) |
| `fw diagram` | Draw a workflow as an SVG or terminal diagram |
| `fw artifact` | Export a workflow as a shareable page, PDF, or SVG |
| `fw diff` | Semantic diff between two workflow versions |
| `fw modify` | Programmatic graph mutations |
| `fw create` / `fw templates` | Create workflows or nodes from templates |
| `fw status` / `fw implement` | Report which stub nodes are still unimplemented, and replace a stub with a real function |
| `fw migrate` | Rewrite workflow files in the current syntax |
| `fw serve` | Serve the workflows' declared routes and run resources over HTTP, where gated runs pause and resume |
| `fw export` / `fw openapi` | Export to a deploy target, or generate an OpenAPI spec |
| `fw market` | Discover, install, and publish marketplace packs |
| `fw doctor` | Check the project environment |
| `fw mcp-server` / `fw mcp-setup` | Start or configure the MCP server |
| `fw docs` / `fw grammar` | Browse the bundled reference documentation, or print the annotation grammar |
| `fw context` | Build a context bundle of the docs for an LLM |
## Extending with packs
Node types, deploy targets, CLI commands, and MCP tools are contributed by npm packages ("packs"). Discover, install, and publish them with `fw market`, or build your own. See `fw docs marketplace`.
## Documentation
Reference documentation ships with the CLI:
```bash
fw docs list # list all topics
fw docs tutorial # first-workflow walkthrough
fw docs concepts # the core model
fw docs jsdoc-grammar # annotation syntax
fw docs search <query> # search across all docs
```
Upgrading between versions: [MIGRATION.md](./MIGRATION.md) explains how `fw migrate` rewrites workflow files in the current syntax.
## Project status
Flow Weaver is in **beta**. The compiler, validator, CLI, console, and MCP tools are stable and thoroughly tested. CI runs the full test suite on Linux for every push and pull request, and a smoke test installs the packed CLI on Linux, macOS, and Windows on every push to `main`. Breaking changes may still occur between minor versions during beta, so pin your version if stability matters.
## Community
Built and maintained by [Ricardo Morais](https://github.com/moraispgsi). Found a bug or have a question? [Open an issue](https://github.com/synergenius-fw/flow-weaver/issues) or start a [Discussion](https://github.com/synergenius-fw/flow-weaver/discussions).
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).
## License
Flow Weaver is licensed under the [Apache License 2.0](./LICENSE).
What the compiler produces is yours. Compiled workflows, generated code and diagrams, including the execution engine the compiler copies into each compiled file, may be used, modified and distributed under any terms you choose, without attribution. See [NOTICE](./NOTICE).
Support and enterprise agreements: support@synergenius.pt.
历史前置条件说明(补充参考)
Node.js 22+;通过 npm 安装 @synergenius/flow-weaver;使用 MCP 需兼容 MCP 的编辑器并由 fw mcp-setup 注册;Agent gate 需在 .flowweaver/agents.yaml 配置模型与环境变量密钥(Anthropic、OpenAI 兼容服务或 Claude Code CLI);模型费用与条款待核验;MCP 配置字段、传输方式与鉴权细节待核验;国内网络与国内模型兼容性待核验。
项目来源与清单版权许可
https://github.com/synergenius-fw/flow-weaver
整理来源:https://github.com/slavakurilyak/awesome-ai-agents
清单版权与许可:
MIT License
Copyright (c) 2024 Slava Kurilyak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.