@synergenius/flow-weaver 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -67
- package/dist/cli/flow-weaver.mjs +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -4,36 +4,30 @@
|
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**Build AI agent workflows visually. Ship them as your own code.**
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Design agent workflows in the Studio, in TypeScript, or let AI build them for you. Everything compiles to standalone functions you deploy anywhere, no runtime dependency on Flow Weaver.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Three Ways to Build
|
|
12
12
|
|
|
13
|
-
**
|
|
13
|
+
**Studio.** Drag, drop, connect. The visual editor renders your workflow as an interactive graph with bidirectional sync: canvas changes write code, code changes update the canvas. 80+ plugins handle rendering, state, minimap, undo/redo, and more.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
**TypeScript.** Annotate plain functions with JSDoc tags. The compiler turns them into executable workflow graphs with full type safety, IDE autocomplete, and compile-time validation. No YAML, no JSON configs.
|
|
16
16
|
|
|
17
|
-
The development loop (steps 1-4 are fully autonomous):
|
|
17
|
+
**AI Agents.** Connect Claude Code, Cursor, or OpenClaw and they scaffold, validate, and ship workflows using 30+ MCP tools. The agent reads validation errors, fixes issues, and re-validates until the workflow compiles clean. The development loop (steps 1-4 are fully autonomous):
|
|
18
18
|
|
|
19
|
-
1. **Agent creates**: scaffolds from templates
|
|
19
|
+
1. **Agent creates**: scaffolds from templates, builds from a model, or writes from scratch
|
|
20
20
|
2. **Compiler validates**: 15+ validation passes catch missing connections, type mismatches, unreachable paths
|
|
21
|
-
3. **Agent iterates**: validation errors include fix suggestions, the agent corrects and re-validates
|
|
21
|
+
3. **Agent iterates**: validation errors include fix suggestions, the agent corrects and re-validates
|
|
22
22
|
4. **Agent tests**: deterministic mock providers for reproducible testing without real API calls
|
|
23
|
-
5. **Human reviews**: visual editor
|
|
24
|
-
|
|
25
|
-
The compiled code is yours. No runtime lock-in, no framework dependency.
|
|
23
|
+
5. **Human reviews**: visual editor or SVG diagram for final approval
|
|
26
24
|
|
|
27
25
|
## Quick Start
|
|
28
26
|
|
|
29
|
-
### Install
|
|
30
|
-
|
|
31
27
|
```bash
|
|
32
28
|
npm install @synergenius/flow-weaver
|
|
33
29
|
```
|
|
34
30
|
|
|
35
|
-
### Define a workflow
|
|
36
|
-
|
|
37
31
|
Workflows are plain TypeScript. Annotations declare the graph structure:
|
|
38
32
|
|
|
39
33
|
```typescript
|
|
@@ -66,8 +60,6 @@ export async function dataPipeline(
|
|
|
66
60
|
}
|
|
67
61
|
```
|
|
68
62
|
|
|
69
|
-
### Compile and run
|
|
70
|
-
|
|
71
63
|
```bash
|
|
72
64
|
npx flow-weaver compile data-pipeline.ts # generates executable code in-place
|
|
73
65
|
npx flow-weaver run data-pipeline.ts --params '{"rawData": "Hello World"}'
|
|
@@ -77,26 +69,36 @@ The compiler fills in the function body while preserving your code outside the g
|
|
|
77
69
|
|
|
78
70
|
## AI-Native Development with MCP
|
|
79
71
|
|
|
80
|
-
Flow Weaver includes an MCP server
|
|
72
|
+
Flow Weaver includes an MCP server for Claude Code, Cursor, OpenClaw, or any MCP-compatible agent:
|
|
81
73
|
|
|
82
74
|
```bash
|
|
83
75
|
npx flow-weaver mcp-server # auto-registers with Claude Code
|
|
84
76
|
```
|
|
85
77
|
|
|
86
|
-
What an AI agent can do:
|
|
87
|
-
|
|
88
78
|
| Capability | MCP Tools |
|
|
89
79
|
|-----------|-----------|
|
|
90
80
|
| **Build** | `fw_scaffold`, `fw_modify`, `fw_modify_batch`, `fw_add_node`, `fw_connect` |
|
|
81
|
+
| **Model** | `fw_create_model`, `fw_workflow_status`, `fw_implement_node` |
|
|
91
82
|
| **Validate** | `fw_validate` (with friendly error hints), `fw_doctor` |
|
|
92
83
|
| **Understand** | `fw_describe` (json/text/mermaid), `fw_query` (10 query types), `fw_diff` |
|
|
93
84
|
| **Test** | `fw_execute_workflow` (with trace), `fw_compile` |
|
|
94
|
-
| **Visualize** | `fw_diagram` (SVG), `fw_get_state`, `fw_focus_node` |
|
|
85
|
+
| **Visualize** | `fw_diagram` (SVG/HTML), `fw_get_state`, `fw_focus_node` |
|
|
95
86
|
| **Deploy** | `fw_export` (Lambda, Vercel, Cloudflare, Inngest), `fw_compile --target inngest` |
|
|
96
87
|
| **Reuse** | `fw_list_patterns`, `fw_apply_pattern`, `fw_extract_pattern` |
|
|
97
88
|
| **Extend** | `fw_market_search`, `fw_market_install` |
|
|
98
89
|
|
|
99
|
-
|
|
90
|
+
## Model-Driven Workflows
|
|
91
|
+
|
|
92
|
+
Design first, implement later. Describe the workflow shape (nodes, ports, execution path) and the compiler generates a valid skeleton with `declare function` stubs:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Via MCP: fw_create_model with nodes, inputs/outputs, and execution path
|
|
96
|
+
# Via CLI:
|
|
97
|
+
npx flow-weaver status my-workflow.ts # shows stub vs implemented progress
|
|
98
|
+
npx flow-weaver implement my-workflow.ts processData # scaffolds a node body
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The graph is valid before any node has a real implementation. Fill in node bodies incrementally, check `status` to track progress. Architecture and implementation stay separate: the architect defines the shape, developers fill in the logic.
|
|
100
102
|
|
|
101
103
|
## Agent Workflow Templates
|
|
102
104
|
|
|
@@ -140,14 +142,14 @@ npx flow-weaver create workflow ai-agent-durable durable-agent.ts
|
|
|
140
142
|
The validator understands AI agent patterns and enforces safety rules:
|
|
141
143
|
|
|
142
144
|
```
|
|
143
|
-
AGENT_LLM_MISSING_ERROR_HANDLER LLM node's onFailure is unconnected
|
|
144
|
-
AGENT_UNGUARDED_TOOL_EXECUTOR Tool executor has no human-approval upstream
|
|
145
|
-
AGENT_MISSING_MEMORY_IN_LOOP Agent loop has LLM but no memory
|
|
146
|
-
AGENT_LLM_NO_FALLBACK LLM failure goes directly to Exit
|
|
147
|
-
AGENT_TOOL_NO_OUTPUT_HANDLING Tool executor outputs are all unconnected
|
|
145
|
+
AGENT_LLM_MISSING_ERROR_HANDLER LLM node's onFailure is unconnected, add error handling
|
|
146
|
+
AGENT_UNGUARDED_TOOL_EXECUTOR Tool executor has no human-approval upstream, add a gate
|
|
147
|
+
AGENT_MISSING_MEMORY_IN_LOOP Agent loop has LLM but no memory, conversations will be stateless
|
|
148
|
+
AGENT_LLM_NO_FALLBACK LLM failure goes directly to Exit, add retry or fallback logic
|
|
149
|
+
AGENT_TOOL_NO_OUTPUT_HANDLING Tool executor outputs are all unconnected, results are discarded
|
|
148
150
|
```
|
|
149
151
|
|
|
150
|
-
|
|
152
|
+
These aren't generic lint rules. The validator identifies LLM, tool-executor, human-approval, and memory nodes by port signatures, annotations, and naming patterns, then applies agent-specific checks.
|
|
151
153
|
|
|
152
154
|
## Deterministic Agent Testing
|
|
153
155
|
|
|
@@ -190,13 +192,30 @@ Most workflow engines either ban loops (DAG-only) or allow arbitrary cycles (har
|
|
|
190
192
|
*/
|
|
191
193
|
```
|
|
192
194
|
|
|
193
|
-
The scope's output ports become callback parameters, and input ports become return values.
|
|
194
|
-
- Agent reasoning loops (LLM -> tools -> memory -> LLM)
|
|
195
|
-
- ForEach over collections
|
|
196
|
-
- Map/reduce patterns
|
|
197
|
-
- Nested sub-workflows
|
|
195
|
+
The scope's output ports become callback parameters, and input ports become return values. Agent reasoning loops, ForEach over collections, map/reduce patterns, nested sub-workflows: all work while keeping the graph acyclic and statically analyzable.
|
|
198
196
|
|
|
199
|
-
|
|
197
|
+
## Diagram Generation
|
|
198
|
+
|
|
199
|
+
Generate SVG or interactive HTML diagrams from any workflow:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
flow-weaver diagram workflow.ts -o workflow.svg --theme dark
|
|
203
|
+
flow-weaver diagram workflow.ts -o workflow.html --format html
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Customize node appearance with annotations:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
/**
|
|
210
|
+
* @flowWeaver nodeType
|
|
211
|
+
* @color blue
|
|
212
|
+
* @icon database
|
|
213
|
+
*/
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Named colors: `blue`, `purple`, `green`, `cyan`, `orange`, `pink`, `red`, `yellow`. Icons include `api`, `database`, `shield`, `brain`, `cloud`, `search`, `code`, and 60+ more from Material Design 3.
|
|
217
|
+
|
|
218
|
+
The interactive HTML viewer supports zoom/pan, click-to-inspect nodes, port-level hover with connection tracing, and works standalone or embedded in an iframe.
|
|
200
219
|
|
|
201
220
|
## Multi-Target Compilation
|
|
202
221
|
|
|
@@ -220,23 +239,6 @@ flow-weaver serve ./workflows --port 3000 --swagger
|
|
|
220
239
|
|
|
221
240
|
Both the default TypeScript target and Inngest target parallelize independent nodes with `Promise.all()`. Inngest additionally wraps each node in `step.run()` for individual durability and generates typed Zod event schemas.
|
|
222
241
|
|
|
223
|
-
## Visual Human-in-the-Loop
|
|
224
|
-
|
|
225
|
-
Workflows compile from code, but humans review them visually:
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
# Generate SVG diagram
|
|
229
|
-
flow-weaver diagram workflow.ts -o workflow.svg --theme dark
|
|
230
|
-
|
|
231
|
-
# Describe structure for quick review
|
|
232
|
-
flow-weaver describe workflow.ts --format text
|
|
233
|
-
|
|
234
|
-
# Semantic diff between versions
|
|
235
|
-
flow-weaver diff workflow-v1.ts workflow-v2.ts
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
Flow Weaver Studio is a visual editor with bidirectional sync: code changes update the canvas, canvas changes update the code. 80+ plugins handle rendering, state, minimap, undo/redo, and more.
|
|
239
|
-
|
|
240
242
|
## API
|
|
241
243
|
|
|
242
244
|
```typescript
|
|
@@ -263,8 +265,16 @@ const code = generateCode(ast);
|
|
|
263
265
|
|-------------|---------|
|
|
264
266
|
| `@synergenius/flow-weaver` | Parse, validate, compile, generate, AST types, builders, diff, patterns |
|
|
265
267
|
| `@synergenius/flow-weaver/runtime` | Execution context, errors, function registry for generated code |
|
|
266
|
-
| `@synergenius/flow-weaver/
|
|
267
|
-
| `@synergenius/flow-weaver/
|
|
268
|
+
| `@synergenius/flow-weaver/testing` | Mock LLM/approval providers, recording/replay, assertions, token tracking |
|
|
269
|
+
| `@synergenius/flow-weaver/built-in-nodes` | delay, waitForEvent, waitForAgent, invokeWorkflow |
|
|
270
|
+
| `@synergenius/flow-weaver/diagram` | SVG/HTML diagram layout and rendering |
|
|
271
|
+
| `@synergenius/flow-weaver/ast` | AST types and utilities |
|
|
272
|
+
| `@synergenius/flow-weaver/api` | Programmatic workflow manipulation API |
|
|
273
|
+
| `@synergenius/flow-weaver/diff` | Semantic workflow diffing |
|
|
274
|
+
| `@synergenius/flow-weaver/deployment` | Multi-target deployment generators |
|
|
275
|
+
| `@synergenius/flow-weaver/marketplace` | Marketplace package utilities |
|
|
276
|
+
| `@synergenius/flow-weaver/editor` | Editor completions and suggestions |
|
|
277
|
+
| `@synergenius/flow-weaver/browser` | JSDoc port sync for browser environments |
|
|
268
278
|
| `@synergenius/flow-weaver/describe` | Programmatic workflow description |
|
|
269
279
|
| `@synergenius/flow-weaver/doc-metadata` | Documentation metadata extractors |
|
|
270
280
|
|
|
@@ -276,11 +286,16 @@ flow-weaver compile <file> # Compile to TypeScript or Inngest
|
|
|
276
286
|
flow-weaver validate <file> # Validate without compiling
|
|
277
287
|
flow-weaver run <file> # Execute a workflow
|
|
278
288
|
flow-weaver dev <file> # Watch + compile + run
|
|
289
|
+
flow-weaver strip <file> # Remove generated code sections
|
|
279
290
|
flow-weaver describe <file> # Structure output (json/text/mermaid)
|
|
280
|
-
flow-weaver diagram <file> # Generate SVG diagram
|
|
291
|
+
flow-weaver diagram <file> # Generate SVG or interactive HTML diagram
|
|
281
292
|
flow-weaver diff <f1> <f2> # Semantic workflow comparison
|
|
282
293
|
|
|
283
|
-
#
|
|
294
|
+
# Model-driven
|
|
295
|
+
flow-weaver status <file> # Show stub vs implemented progress
|
|
296
|
+
flow-weaver implement <file> <node> # Scaffold a node body from its stub
|
|
297
|
+
|
|
298
|
+
# Scaffolding
|
|
284
299
|
flow-weaver init [directory] # Create new project
|
|
285
300
|
flow-weaver create workflow <t> <f> # Scaffold from template
|
|
286
301
|
flow-weaver create node <name> <f> # Scaffold node type
|
|
@@ -307,10 +322,16 @@ flow-weaver docs search <query> # Search documentation
|
|
|
307
322
|
flow-weaver market search [query] # Search npm for packages
|
|
308
323
|
flow-weaver market install <pkg> # Install a package
|
|
309
324
|
flow-weaver market list # List installed packages
|
|
325
|
+
flow-weaver market init <name> # Scaffold a marketplace package
|
|
326
|
+
flow-weaver market pack # Validate and generate manifest
|
|
327
|
+
flow-weaver market publish # Publish to npm
|
|
310
328
|
|
|
311
|
-
# IDE
|
|
329
|
+
# Editor / IDE
|
|
312
330
|
flow-weaver mcp-server # Start MCP server for Claude Code
|
|
313
331
|
flow-weaver listen # Stream editor events
|
|
332
|
+
flow-weaver changelog # Generate changelog from git history
|
|
333
|
+
flow-weaver migrate <glob> # Run migration transforms on workflow files
|
|
334
|
+
flow-weaver plugin init <name> # Scaffold an external plugin
|
|
314
335
|
```
|
|
315
336
|
|
|
316
337
|
## Built-in Nodes
|
|
@@ -339,17 +360,6 @@ function nodeName(
|
|
|
339
360
|
|
|
340
361
|
Expression nodes (`@expression`) skip the control flow boilerplate. Inputs and outputs map directly to the TypeScript signature.
|
|
341
362
|
|
|
342
|
-
## Marketplace
|
|
343
|
-
|
|
344
|
-
Distribute node types, workflows, and patterns as npm packages:
|
|
345
|
-
|
|
346
|
-
```bash
|
|
347
|
-
flow-weaver market init my-nodes # Scaffold a package
|
|
348
|
-
flow-weaver market pack # Validate and generate manifest
|
|
349
|
-
flow-weaver market publish # Publish to npm
|
|
350
|
-
flow-weaver market install flowweaver-pack-openai # Install
|
|
351
|
-
```
|
|
352
|
-
|
|
353
363
|
## Testing
|
|
354
364
|
|
|
355
365
|
```bash
|
package/dist/cli/flow-weaver.mjs
CHANGED
|
@@ -95748,7 +95748,7 @@ function displayInstalledPackage(pkg) {
|
|
|
95748
95748
|
}
|
|
95749
95749
|
|
|
95750
95750
|
// src/cli/index.ts
|
|
95751
|
-
var version2 = true ? "0.9.
|
|
95751
|
+
var version2 = true ? "0.9.2" : "0.0.0-dev";
|
|
95752
95752
|
var program2 = new Command();
|
|
95753
95753
|
program2.name("flow-weaver").description("Flow Weaver Annotations - Compile and validate workflow files").version(version2, "-v, --version", "Output the current version");
|
|
95754
95754
|
program2.configureOutput({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synergenius/flow-weaver",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
"./marketplace": {
|
|
67
67
|
"types": "./dist/marketplace/index.d.ts",
|
|
68
68
|
"default": "./dist/marketplace/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./testing": {
|
|
71
|
+
"types": "./dist/testing/index.d.ts",
|
|
72
|
+
"default": "./dist/testing/index.js"
|
|
69
73
|
}
|
|
70
74
|
},
|
|
71
75
|
"bin": {
|