@synergenius/flow-weaver 0.21.7 → 0.21.11
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 +59 -57
- package/dist/cli/commands/context.js +2 -2
- package/dist/cli/commands/create.js +2 -2
- package/dist/cli/commands/docs.js +5 -5
- package/dist/cli/commands/export.d.ts +4 -4
- package/dist/cli/commands/export.js +4 -4
- package/dist/cli/commands/init-personas.js +11 -11
- package/dist/cli/commands/init.js +5 -5
- package/dist/cli/commands/market.js +6 -6
- package/dist/cli/commands/openapi.d.ts +3 -3
- package/dist/cli/commands/openapi.js +3 -3
- package/dist/cli/commands/run.d.ts +5 -5
- package/dist/cli/commands/run.js +5 -5
- package/dist/cli/commands/serve.d.ts +5 -5
- package/dist/cli/commands/serve.js +5 -5
- package/dist/cli/commands/templates.js +2 -2
- package/dist/cli/flow-weaver.mjs +61 -61
- package/dist/cli/index.js +10 -10
- package/dist/cli/templates/workflows/aggregator.js +1 -1
- package/dist/cli/templates/workflows/ai-agent.js +1 -1
- package/dist/cli/templates/workflows/ai-chat.js +1 -1
- package/dist/cli/templates/workflows/ai-rag.js +1 -1
- package/dist/cli/templates/workflows/ai-react.js +1 -1
- package/dist/cli/templates/workflows/conditional.js +1 -1
- package/dist/cli/templates/workflows/error-handler.js +1 -1
- package/dist/cli/templates/workflows/foreach.js +1 -1
- package/dist/cli/templates/workflows/sequential.js +2 -2
- package/dist/cli/templates/workflows/webhook.js +1 -1
- package/dist/doc-metadata/extractors/cli-commands.js +24 -24
- package/dist/doc-metadata/types.d.ts +1 -1
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +1 -1
- package/dist/marketplace/registry.d.ts +1 -1
- package/dist/marketplace/registry.js +2 -2
- package/dist/marketplace/validator.js +2 -2
- package/dist/mcp/server.js +1 -1
- package/docs/reference/advanced-annotations.md +4 -4
- package/docs/reference/built-in-nodes.md +2 -2
- package/docs/reference/cli-reference.md +142 -140
- package/docs/reference/compilation.md +12 -12
- package/docs/reference/concepts.md +29 -29
- package/docs/reference/debugging.md +34 -34
- package/docs/reference/deployment.md +27 -27
- package/docs/reference/export-interface.md +1 -1
- package/docs/reference/iterative-development.md +6 -6
- package/docs/reference/marketplace.md +20 -20
- package/docs/reference/node-conversion.md +1 -1
- package/docs/reference/patterns.md +7 -7
- package/docs/reference/scaffold.md +22 -22
- package/docs/reference/tutorial.md +29 -29
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -63,11 +63,13 @@ The converter extracts the steps and decision points from your markdown and prod
|
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
npm install @synergenius/flow-weaver
|
|
66
|
-
npx
|
|
66
|
+
npx fw init my-project
|
|
67
67
|
cd my-project
|
|
68
|
-
npx
|
|
68
|
+
npx fw run workflows/example.ts --params '{"input": "value"}'
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
`fw` is the CLI command. `flow-weaver` also works as an alias.
|
|
72
|
+
|
|
71
73
|
## How It Works
|
|
72
74
|
|
|
73
75
|
**Generate.** Let AI build it for you, design visually in the Studio, or write annotated TypeScript by hand. All three stay in sync.
|
|
@@ -119,8 +121,8 @@ export async function dataPipeline(
|
|
|
119
121
|
```
|
|
120
122
|
|
|
121
123
|
```bash
|
|
122
|
-
npx
|
|
123
|
-
npx
|
|
124
|
+
npx fw compile data-pipeline.ts # generates executable code in-place
|
|
125
|
+
npx fw run data-pipeline.ts --params '{"rawData": "Hello World"}'
|
|
124
126
|
```
|
|
125
127
|
|
|
126
128
|
The compiler fills in the function body while preserving your code outside the generated markers.
|
|
@@ -130,7 +132,7 @@ The compiler fills in the function body while preserving your code outside the g
|
|
|
130
132
|
Flow Weaver includes an MCP server with 48 tools for Claude Code, Cursor, OpenClaw, or any MCP-compatible agent:
|
|
131
133
|
|
|
132
134
|
```bash
|
|
133
|
-
npx
|
|
135
|
+
npx fw mcp-server # auto-registers with Claude Code
|
|
134
136
|
```
|
|
135
137
|
|
|
136
138
|
| Capability | MCP Tools |
|
|
@@ -152,8 +154,8 @@ Design first, implement later. Describe the workflow shape (nodes, ports, execut
|
|
|
152
154
|
```bash
|
|
153
155
|
# Via MCP: fw_create_model with nodes, inputs/outputs, and execution path
|
|
154
156
|
# Via CLI:
|
|
155
|
-
npx
|
|
156
|
-
npx
|
|
157
|
+
npx fw status my-workflow.ts # shows stub vs implemented progress
|
|
158
|
+
npx fw implement my-workflow.ts processData # scaffolds a node body
|
|
157
159
|
```
|
|
158
160
|
|
|
159
161
|
The graph is valid before any node has a real implementation. Fill in node bodies incrementally, check `status` to track progress. The architect defines the shape, developers fill in the logic.
|
|
@@ -163,10 +165,10 @@ The graph is valid before any node has a real implementation. Fill in node bodie
|
|
|
163
165
|
Built-in templates for AI agent workflows:
|
|
164
166
|
|
|
165
167
|
```bash
|
|
166
|
-
npx
|
|
167
|
-
npx
|
|
168
|
-
npx
|
|
169
|
-
npx
|
|
168
|
+
npx fw create workflow ai-agent my-agent.ts --provider openai --model gpt-4o
|
|
169
|
+
npx fw create workflow ai-react react-agent.ts
|
|
170
|
+
npx fw create workflow ai-rag rag-pipeline.ts
|
|
171
|
+
npx fw create workflow ai-agent-durable durable-agent.ts
|
|
170
172
|
```
|
|
171
173
|
|
|
172
174
|
**12 workflow templates:**
|
|
@@ -257,22 +259,22 @@ npm install @synergenius/flow-weaver-pack-lambda @synergenius/flow-weaver-pack-v
|
|
|
257
259
|
|
|
258
260
|
```bash
|
|
259
261
|
# Plain TypeScript (default)
|
|
260
|
-
|
|
262
|
+
fw compile workflow.ts
|
|
261
263
|
|
|
262
264
|
# Inngest durable functions (per-node step.run, retries, cron)
|
|
263
|
-
|
|
265
|
+
fw compile workflow.ts --target inngest --retries 3 --cron "0 9 * * *"
|
|
264
266
|
|
|
265
267
|
# Serverless exports
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
268
|
+
fw export workflow.ts --target lambda --output deploy/
|
|
269
|
+
fw export workflow.ts --target vercel --output deploy/
|
|
270
|
+
fw export workflow.ts --target cloudflare --output deploy/
|
|
269
271
|
|
|
270
272
|
# CI/CD pipelines
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
fw export workflow.ts --target github-actions --output .github/workflows/
|
|
274
|
+
fw export workflow.ts --target gitlab-ci --output .
|
|
273
275
|
|
|
274
276
|
# HTTP server with OpenAPI docs
|
|
275
|
-
|
|
277
|
+
fw serve ./workflows --port 3000 --swagger
|
|
276
278
|
```
|
|
277
279
|
|
|
278
280
|
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.
|
|
@@ -282,8 +284,8 @@ Both the default TypeScript target and Inngest target parallelize independent no
|
|
|
282
284
|
Generate SVG or interactive HTML diagrams from any workflow:
|
|
283
285
|
|
|
284
286
|
```bash
|
|
285
|
-
|
|
286
|
-
|
|
287
|
+
fw diagram workflow.ts -o workflow.svg --theme dark
|
|
288
|
+
fw diagram workflow.ts -o workflow.html --format html
|
|
287
289
|
```
|
|
288
290
|
|
|
289
291
|
Customize node appearance with annotations:
|
|
@@ -341,56 +343,56 @@ const code = generateCode(ast);
|
|
|
341
343
|
|
|
342
344
|
```bash
|
|
343
345
|
# Core
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
346
|
+
fw compile <file> # Compile to TypeScript or Inngest
|
|
347
|
+
fw validate <file> # Validate without compiling
|
|
348
|
+
fw run <file> # Execute a workflow
|
|
349
|
+
fw dev <file> # Watch + compile + run
|
|
350
|
+
fw strip <file> # Remove generated code sections
|
|
351
|
+
fw describe <file> # Structure output (json/text/mermaid)
|
|
352
|
+
fw diagram <file> # Generate SVG or interactive HTML diagram
|
|
353
|
+
fw diff <f1> <f2> # Semantic workflow comparison
|
|
352
354
|
|
|
353
355
|
# Model-driven
|
|
354
|
-
|
|
355
|
-
|
|
356
|
+
fw status <file> # Show stub vs implemented progress
|
|
357
|
+
fw implement <file> <node> # Scaffold a node body from its stub
|
|
356
358
|
|
|
357
359
|
# Scaffolding
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
360
|
+
fw init [directory] # Create new project
|
|
361
|
+
fw create workflow <t> <f> # Scaffold from template
|
|
362
|
+
fw create node <name> <f> # Scaffold node type
|
|
363
|
+
fw templates # List available templates
|
|
364
|
+
fw doctor # Check project compatibility
|
|
365
|
+
fw grammar # Output annotation grammar (EBNF/railroad)
|
|
364
366
|
|
|
365
367
|
# Deploy
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
368
|
+
fw serve [directory] # HTTP server with Swagger UI
|
|
369
|
+
fw export <file> # Export to Lambda/Vercel/Cloudflare/Inngest/GitHub Actions/GitLab CI (via packs)
|
|
370
|
+
fw openapi <directory> # Generate OpenAPI spec
|
|
369
371
|
|
|
370
372
|
# Patterns
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
373
|
+
fw pattern list <path> # List reusable patterns
|
|
374
|
+
fw pattern apply <p> <t> # Apply pattern to workflow
|
|
375
|
+
fw pattern extract <src> # Extract pattern from nodes
|
|
374
376
|
|
|
375
377
|
# Docs
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
378
|
+
fw docs # List documentation topics
|
|
379
|
+
fw docs read <topic> # Read a topic
|
|
380
|
+
fw docs search <query> # Search documentation
|
|
379
381
|
|
|
380
382
|
# Marketplace
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
383
|
+
fw market search [query] # Search npm for packages
|
|
384
|
+
fw market install <pkg> # Install a package
|
|
385
|
+
fw market list # List installed packages
|
|
386
|
+
fw market init <name> # Scaffold a marketplace package
|
|
387
|
+
fw market pack # Validate and generate manifest
|
|
388
|
+
fw market publish # Publish to npm
|
|
387
389
|
|
|
388
390
|
# Editor / IDE
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
391
|
+
fw mcp-server # Start MCP server for Claude Code
|
|
392
|
+
fw listen # Stream editor events
|
|
393
|
+
fw changelog # Generate changelog from git history
|
|
394
|
+
fw migrate <glob> # Run migration transforms on workflow files
|
|
395
|
+
fw plugin init <name> # Scaffold an external plugin
|
|
394
396
|
```
|
|
395
397
|
|
|
396
398
|
## Built-in Nodes
|
|
@@ -15,7 +15,7 @@ export async function contextCommand(preset, options) {
|
|
|
15
15
|
logger.log(` ${name.padEnd(maxName + 2)} ${topics.join(', ')}`);
|
|
16
16
|
}
|
|
17
17
|
logger.newline();
|
|
18
|
-
logger.log(' Usage:
|
|
18
|
+
logger.log(' Usage: fw context [preset] [options]');
|
|
19
19
|
logger.newline();
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
@@ -48,6 +48,6 @@ export async function contextCommand(preset, options) {
|
|
|
48
48
|
}
|
|
49
49
|
// Stats to stderr (doesn't pollute piped stdout)
|
|
50
50
|
const stats = `${result.topicCount} topics, ${result.lineCount} lines (${result.profile} profile)`;
|
|
51
|
-
process.stderr.write(`
|
|
51
|
+
process.stderr.write(`fw context: ${stats}\n`);
|
|
52
52
|
}
|
|
53
53
|
//# sourceMappingURL=context.js.map
|
|
@@ -42,7 +42,7 @@ export async function createWorkflowCommand(template, file, options = {}) {
|
|
|
42
42
|
const templateDef = getWorkflowTemplate(template);
|
|
43
43
|
if (!templateDef) {
|
|
44
44
|
logger.error(`Unknown workflow template: ${template}`);
|
|
45
|
-
logger.info("Run '
|
|
45
|
+
logger.info("Run 'fw templates' to see available templates");
|
|
46
46
|
process.exit(1);
|
|
47
47
|
}
|
|
48
48
|
// Resolve to absolute path
|
|
@@ -104,7 +104,7 @@ export async function createNodeCommand(name, file, options = {}) {
|
|
|
104
104
|
const templateDef = getNodeTemplate(template);
|
|
105
105
|
if (!templateDef) {
|
|
106
106
|
logger.error(`Unknown node template: ${template}`);
|
|
107
|
-
logger.info("Run '
|
|
107
|
+
logger.info("Run 'fw templates' to see available templates");
|
|
108
108
|
process.exit(1);
|
|
109
109
|
}
|
|
110
110
|
// Resolve to absolute path
|
|
@@ -17,15 +17,15 @@ export async function docsListCommand(options) {
|
|
|
17
17
|
logger.log(` ${topic.slug.padEnd(maxSlug + 2)} ${topic.description}`);
|
|
18
18
|
}
|
|
19
19
|
logger.newline();
|
|
20
|
-
logger.log(' Usage:
|
|
21
|
-
logger.log(' Search:
|
|
20
|
+
logger.log(' Usage: fw docs <topic>');
|
|
21
|
+
logger.log(' Search: fw docs search <query>');
|
|
22
22
|
logger.newline();
|
|
23
23
|
}
|
|
24
24
|
export async function docsReadCommand(topic, options) {
|
|
25
25
|
if (options.json) {
|
|
26
26
|
const structured = readTopicStructured(topic);
|
|
27
27
|
if (!structured) {
|
|
28
|
-
logger.error(`Unknown topic: "${topic}". Run "
|
|
28
|
+
logger.error(`Unknown topic: "${topic}". Run "fw docs" to see available topics.`);
|
|
29
29
|
process.exit(1);
|
|
30
30
|
}
|
|
31
31
|
process.stdout.write(JSON.stringify(structured, null, 2) + '\n');
|
|
@@ -33,7 +33,7 @@ export async function docsReadCommand(topic, options) {
|
|
|
33
33
|
}
|
|
34
34
|
const doc = readTopic(topic, options.compact);
|
|
35
35
|
if (!doc) {
|
|
36
|
-
logger.error(`Unknown topic: "${topic}". Run "
|
|
36
|
+
logger.error(`Unknown topic: "${topic}". Run "fw docs" to see available topics.`);
|
|
37
37
|
process.exit(1);
|
|
38
38
|
}
|
|
39
39
|
process.stdout.write(doc.content + '\n');
|
|
@@ -71,7 +71,7 @@ export async function docsSearchCommand(query, options) {
|
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
logger.log(` ${results.length} matching section(s) across ${new Set(results.map((r) => r.slug)).size} topic(s).`);
|
|
74
|
-
logger.log(' Read a topic:
|
|
74
|
+
logger.log(' Read a topic: fw docs <topic>');
|
|
75
75
|
logger.newline();
|
|
76
76
|
}
|
|
77
77
|
//# sourceMappingURL=docs.js.map
|
|
@@ -32,16 +32,16 @@ export interface ExportOptions {
|
|
|
32
32
|
* @example
|
|
33
33
|
* ```bash
|
|
34
34
|
* # Export for a target (install the corresponding pack first)
|
|
35
|
-
*
|
|
35
|
+
* fw export workflow.ts --target <target> --output dist/
|
|
36
36
|
*
|
|
37
37
|
* # Export specific workflow from multi-workflow file
|
|
38
|
-
*
|
|
38
|
+
* fw export multi-workflow.ts --target <target> --output api/ --workflow calculate
|
|
39
39
|
*
|
|
40
40
|
* # Export all workflows as a single service
|
|
41
|
-
*
|
|
41
|
+
* fw export workflows.ts --target <target> --output dist/ --multi
|
|
42
42
|
*
|
|
43
43
|
* # Export with API documentation routes
|
|
44
|
-
*
|
|
44
|
+
* fw export workflow.ts --target <target> --output dist/ --docs
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
export declare function exportCommand(input: string, options: ExportOptions): Promise<void>;
|
|
@@ -12,16 +12,16 @@ import { logger } from '../utils/logger.js';
|
|
|
12
12
|
* @example
|
|
13
13
|
* ```bash
|
|
14
14
|
* # Export for a target (install the corresponding pack first)
|
|
15
|
-
*
|
|
15
|
+
* fw export workflow.ts --target <target> --output dist/
|
|
16
16
|
*
|
|
17
17
|
* # Export specific workflow from multi-workflow file
|
|
18
|
-
*
|
|
18
|
+
* fw export multi-workflow.ts --target <target> --output api/ --workflow calculate
|
|
19
19
|
*
|
|
20
20
|
* # Export all workflows as a single service
|
|
21
|
-
*
|
|
21
|
+
* fw export workflows.ts --target <target> --output dist/ --multi
|
|
22
22
|
*
|
|
23
23
|
* # Export with API documentation routes
|
|
24
|
-
*
|
|
24
|
+
* fw export workflow.ts --target <target> --output dist/ --docs
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export async function exportCommand(input, options) {
|
|
@@ -174,13 +174,13 @@ export function generateReadme(projectName, persona, _template) {
|
|
|
174
174
|
lines.push('A Flow Weaver workflow project.', '', '## Development', '', '```sh', 'npm run dev # Compile and run', 'npm run compile # Compile only', 'npm run validate # Check for errors', '```', '', '## AI-Assisted Editing', '', 'With your AI editor connected, you can describe changes in plain language:', '', '- "Add error handling to the pipeline"', '- "Replace the mock LLM with OpenAI"', '- "Add a validation step before processing"', '');
|
|
175
175
|
}
|
|
176
176
|
else if (persona === 'lowcode') {
|
|
177
|
-
lines.push('A Flow Weaver workflow project.', '', '## Development', '', '```sh', 'npm run dev # Compile and run', 'npm run compile # Compile only', 'npm run validate # Check for errors', '```', '', '## Templates', '', 'Browse and add more workflows:', '', '```sh', '
|
|
177
|
+
lines.push('A Flow Weaver workflow project.', '', '## Development', '', '```sh', 'npm run dev # Compile and run', 'npm run compile # Compile only', 'npm run validate # Check for errors', '```', '', '## Templates', '', 'Browse and add more workflows:', '', '```sh', 'fw templates # List all templates', 'fw create workflow <template> <file> # Add a workflow', 'fw describe src/*.ts --format ascii # See workflow structure', '```', '');
|
|
178
178
|
}
|
|
179
179
|
else {
|
|
180
180
|
// expert: minimal
|
|
181
181
|
lines.push('A Flow Weaver workflow project.', '', '## Commands', '', '```sh', 'npm run dev # Compile and run', 'npm run compile # Compile only', 'npm run validate # Check for errors', '```', '');
|
|
182
182
|
}
|
|
183
|
-
lines.push('## Learn more', '', '- `
|
|
183
|
+
lines.push('## Learn more', '', '- `fw docs` to browse reference documentation', '- `fw mcp-setup` to connect AI editors', '');
|
|
184
184
|
return lines.join('\n');
|
|
185
185
|
}
|
|
186
186
|
// ── Example workflow for lowcode persona ──────────────────────────────────────
|
|
@@ -234,7 +234,7 @@ export function ${fnName}(
|
|
|
234
234
|
execute: boolean,
|
|
235
235
|
params: { name: string }
|
|
236
236
|
): { onSuccess: boolean; onFailure: boolean; result: string } {
|
|
237
|
-
throw new Error("Compile with:
|
|
237
|
+
throw new Error("Compile with: fw compile <file>");
|
|
238
238
|
}
|
|
239
239
|
`;
|
|
240
240
|
}
|
|
@@ -306,9 +306,9 @@ function printNocodeGuidance(_projectName) {
|
|
|
306
306
|
logger.newline();
|
|
307
307
|
logger.log(` ${logger.bold('Useful commands')}`);
|
|
308
308
|
logger.newline();
|
|
309
|
-
logger.log(`
|
|
310
|
-
logger.log(`
|
|
311
|
-
logger.log(`
|
|
309
|
+
logger.log(` fw run src/*.ts ${logger.dim('Run your workflow')}`);
|
|
310
|
+
logger.log(` fw diagram src/*.ts ${logger.dim('See a visual diagram')}`);
|
|
311
|
+
logger.log(` fw mcp-setup ${logger.dim('Connect more AI editors')}`);
|
|
312
312
|
}
|
|
313
313
|
function printVibecoderGuidance() {
|
|
314
314
|
logger.newline();
|
|
@@ -326,17 +326,17 @@ function printLowcodeGuidance() {
|
|
|
326
326
|
logger.newline();
|
|
327
327
|
logger.log(` ${logger.bold('Explore and customize')}`);
|
|
328
328
|
logger.newline();
|
|
329
|
-
logger.log(`
|
|
330
|
-
logger.log(`
|
|
331
|
-
logger.log(`
|
|
329
|
+
logger.log(` fw templates ${logger.dim('List all 16 workflow templates')}`);
|
|
330
|
+
logger.log(` fw describe src/*.ts ${logger.dim('See the workflow structure')}`);
|
|
331
|
+
logger.log(` fw docs annotations ${logger.dim('Annotation reference')}`);
|
|
332
332
|
logger.newline();
|
|
333
333
|
logger.log(` Your project includes an example in ${logger.highlight('examples/')} to study.`);
|
|
334
334
|
logger.log(` With MCP connected, AI can help modify nodes and connections.`);
|
|
335
335
|
}
|
|
336
336
|
function printExpertGuidance() {
|
|
337
337
|
logger.newline();
|
|
338
|
-
logger.log(`
|
|
339
|
-
logger.log(`
|
|
338
|
+
logger.log(` fw mcp-setup ${logger.dim('Connect AI editors (Claude, Cursor, VS Code)')}`);
|
|
339
|
+
logger.log(` fw docs ${logger.dim('Browse reference docs')}`);
|
|
340
340
|
}
|
|
341
341
|
/** Pad a filename to align descriptions */
|
|
342
342
|
function pad(displayName, width) {
|
|
@@ -268,15 +268,15 @@ export function generateProjectFiles(projectName, template, format = 'esm', pers
|
|
|
268
268
|
const workflowCode = tmpl.generate({ workflowName });
|
|
269
269
|
// Package.json
|
|
270
270
|
const scripts = {
|
|
271
|
-
dev: `npx
|
|
271
|
+
dev: `npx fw compile src/${workflowFile} -o src && npx tsx src/main.ts`,
|
|
272
272
|
start: 'npx tsx src/main.ts',
|
|
273
|
-
compile: `npx
|
|
274
|
-
validate: `npx
|
|
275
|
-
doctor: 'npx
|
|
273
|
+
compile: `npx fw compile src/${workflowFile} -o src`,
|
|
274
|
+
validate: `npx fw validate src/${workflowFile}`,
|
|
275
|
+
doctor: 'npx fw doctor',
|
|
276
276
|
};
|
|
277
277
|
// Add diagram script for non-expert personas
|
|
278
278
|
if (persona !== 'expert') {
|
|
279
|
-
scripts.diagram = `npx
|
|
279
|
+
scripts.diagram = `npx fw diagram src/${workflowFile} --format ascii-compact`;
|
|
280
280
|
}
|
|
281
281
|
const packageJsonContent = {
|
|
282
282
|
name: projectName,
|
|
@@ -56,14 +56,14 @@ export async function marketInitCommand(name, options = {}) {
|
|
|
56
56
|
type: 'module',
|
|
57
57
|
main: './dist/index.js',
|
|
58
58
|
types: './dist/index.d.ts',
|
|
59
|
-
keywords: ['
|
|
59
|
+
keywords: ['flow-weaver-marketplace-pack', 'flow-weaver', shortName],
|
|
60
60
|
flowWeaver: {
|
|
61
61
|
type: 'marketplace-pack',
|
|
62
62
|
engineVersion: '>=0.1.0',
|
|
63
63
|
},
|
|
64
64
|
scripts: {
|
|
65
65
|
build: 'tsc',
|
|
66
|
-
pack: '
|
|
66
|
+
pack: 'fw market pack',
|
|
67
67
|
prepublishOnly: 'npm run build && npm run pack',
|
|
68
68
|
},
|
|
69
69
|
...(options.author && { author: options.author }),
|
|
@@ -130,7 +130,7 @@ A [Flow Weaver](https://github.com/synergenius-fw/flow-weaver) marketplace pack.
|
|
|
130
130
|
## Installation
|
|
131
131
|
|
|
132
132
|
\`\`\`bash
|
|
133
|
-
|
|
133
|
+
fw market install ${name}
|
|
134
134
|
\`\`\`
|
|
135
135
|
|
|
136
136
|
## Contents
|
|
@@ -163,7 +163,7 @@ npm publish # Publish to npm
|
|
|
163
163
|
logger.log(' npm install');
|
|
164
164
|
logger.log(' # Add your node types, workflows, and patterns to src/');
|
|
165
165
|
logger.log(' npm run build');
|
|
166
|
-
logger.log('
|
|
166
|
+
logger.log(' fw market pack');
|
|
167
167
|
logger.log(' npm publish');
|
|
168
168
|
logger.newline();
|
|
169
169
|
}
|
|
@@ -301,7 +301,7 @@ export async function marketInstallCommand(packageSpec, options = {}) {
|
|
|
301
301
|
}
|
|
302
302
|
else {
|
|
303
303
|
logger.warn('No flowweaver.manifest.json found in package');
|
|
304
|
-
logger.info('The package may need to run "
|
|
304
|
+
logger.info('The package may need to run "fw market pack" before publishing');
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
/**
|
|
@@ -375,7 +375,7 @@ export async function marketListCommand(options = {}) {
|
|
|
375
375
|
}
|
|
376
376
|
if (packages.length === 0) {
|
|
377
377
|
logger.info('No marketplace packages installed');
|
|
378
|
-
logger.info('Use "
|
|
378
|
+
logger.info('Use "fw market search" to find packages');
|
|
379
379
|
return;
|
|
380
380
|
}
|
|
381
381
|
for (const pkg of packages) {
|
|
@@ -24,13 +24,13 @@ export interface OpenAPIOptions {
|
|
|
24
24
|
* @example
|
|
25
25
|
* ```bash
|
|
26
26
|
* # Generate JSON spec to stdout
|
|
27
|
-
*
|
|
27
|
+
* fw openapi ./workflows
|
|
28
28
|
*
|
|
29
29
|
* # Generate YAML spec to file
|
|
30
|
-
*
|
|
30
|
+
* fw openapi ./workflows --format yaml --output api-spec.yaml
|
|
31
31
|
*
|
|
32
32
|
* # With custom title and version
|
|
33
|
-
*
|
|
33
|
+
* fw openapi ./workflows --title "My API" --version "2.0.0"
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
export declare function openapiCommand(dir: string, options: OpenAPIOptions): Promise<void>;
|
|
@@ -15,13 +15,13 @@ import { logger } from '../utils/logger.js';
|
|
|
15
15
|
* @example
|
|
16
16
|
* ```bash
|
|
17
17
|
* # Generate JSON spec to stdout
|
|
18
|
-
*
|
|
18
|
+
* fw openapi ./workflows
|
|
19
19
|
*
|
|
20
20
|
* # Generate YAML spec to file
|
|
21
|
-
*
|
|
21
|
+
* fw openapi ./workflows --format yaml --output api-spec.yaml
|
|
22
22
|
*
|
|
23
23
|
* # With custom title and version
|
|
24
|
-
*
|
|
24
|
+
* fw openapi ./workflows --title "My API" --version "2.0.0"
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export async function openapiCommand(dir, options) {
|
|
@@ -41,19 +41,19 @@ export interface RunOptions {
|
|
|
41
41
|
* @example
|
|
42
42
|
* ```bash
|
|
43
43
|
* # Basic execution
|
|
44
|
-
*
|
|
44
|
+
* fw run workflow.ts
|
|
45
45
|
*
|
|
46
46
|
* # With parameters
|
|
47
|
-
*
|
|
47
|
+
* fw run workflow.ts --params '{"a": 5, "b": 3}'
|
|
48
48
|
*
|
|
49
49
|
* # From params file
|
|
50
|
-
*
|
|
50
|
+
* fw run workflow.ts --params-file params.json
|
|
51
51
|
*
|
|
52
52
|
* # Specific workflow in multi-workflow file
|
|
53
|
-
*
|
|
53
|
+
* fw run workflow.ts --workflow calculate
|
|
54
54
|
*
|
|
55
55
|
* # JSON output for scripting
|
|
56
|
-
*
|
|
56
|
+
* fw run workflow.ts --json | jq '.result'
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
59
|
export declare function runCommand(input: string, options: RunOptions): Promise<void>;
|
package/dist/cli/commands/run.js
CHANGED
|
@@ -30,19 +30,19 @@ function displayPath(filePath) {
|
|
|
30
30
|
* @example
|
|
31
31
|
* ```bash
|
|
32
32
|
* # Basic execution
|
|
33
|
-
*
|
|
33
|
+
* fw run workflow.ts
|
|
34
34
|
*
|
|
35
35
|
* # With parameters
|
|
36
|
-
*
|
|
36
|
+
* fw run workflow.ts --params '{"a": 5, "b": 3}'
|
|
37
37
|
*
|
|
38
38
|
* # From params file
|
|
39
|
-
*
|
|
39
|
+
* fw run workflow.ts --params-file params.json
|
|
40
40
|
*
|
|
41
41
|
* # Specific workflow in multi-workflow file
|
|
42
|
-
*
|
|
42
|
+
* fw run workflow.ts --workflow calculate
|
|
43
43
|
*
|
|
44
44
|
* # JSON output for scripting
|
|
45
|
-
*
|
|
45
|
+
* fw run workflow.ts --json | jq '.result'
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
48
|
export async function runCommand(input, options) {
|
|
@@ -26,19 +26,19 @@ export interface ServeOptions {
|
|
|
26
26
|
* @example
|
|
27
27
|
* ```bash
|
|
28
28
|
* # Start server with current directory
|
|
29
|
-
*
|
|
29
|
+
* fw serve
|
|
30
30
|
*
|
|
31
31
|
* # Specify workflow directory
|
|
32
|
-
*
|
|
32
|
+
* fw serve ./workflows
|
|
33
33
|
*
|
|
34
34
|
* # Custom port
|
|
35
|
-
*
|
|
35
|
+
* fw serve --port 8080
|
|
36
36
|
*
|
|
37
37
|
* # Production mode
|
|
38
|
-
*
|
|
38
|
+
* fw serve --production --precompile
|
|
39
39
|
*
|
|
40
40
|
* # Disable hot reload
|
|
41
|
-
*
|
|
41
|
+
* fw serve --no-watch
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
44
|
export declare function serveCommand(dir: string | undefined, options: ServeOptions): Promise<void>;
|
|
@@ -14,19 +14,19 @@ import { logger } from '../utils/logger.js';
|
|
|
14
14
|
* @example
|
|
15
15
|
* ```bash
|
|
16
16
|
* # Start server with current directory
|
|
17
|
-
*
|
|
17
|
+
* fw serve
|
|
18
18
|
*
|
|
19
19
|
* # Specify workflow directory
|
|
20
|
-
*
|
|
20
|
+
* fw serve ./workflows
|
|
21
21
|
*
|
|
22
22
|
* # Custom port
|
|
23
|
-
*
|
|
23
|
+
* fw serve --port 8080
|
|
24
24
|
*
|
|
25
25
|
* # Production mode
|
|
26
|
-
*
|
|
26
|
+
* fw serve --production --precompile
|
|
27
27
|
*
|
|
28
28
|
* # Disable hot reload
|
|
29
|
-
*
|
|
29
|
+
* fw serve --no-watch
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
export async function serveCommand(dir, options) {
|
|
@@ -47,8 +47,8 @@ export async function templatesCommand(options = {}) {
|
|
|
47
47
|
}
|
|
48
48
|
logger.newline();
|
|
49
49
|
logger.section("Usage");
|
|
50
|
-
logger.log(" $
|
|
51
|
-
logger.log(" $
|
|
50
|
+
logger.log(" $ fw create workflow <template> <file> [--async] [--line N]");
|
|
51
|
+
logger.log(" $ fw create node <name> <file> [-t <template>] [--line N]");
|
|
52
52
|
logger.newline();
|
|
53
53
|
}
|
|
54
54
|
//# sourceMappingURL=templates.js.map
|