@synergenius/flow-weaver 0.17.0 → 0.17.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/dist/api/index.d.ts +4 -1
- package/dist/api/index.js +4 -1
- package/dist/api/templates.js +2 -2
- package/dist/api/validate.d.ts +2 -2
- package/dist/api/validate.js +6 -6
- package/dist/api/validation-registry.d.ts +10 -0
- package/dist/api/validation-registry.js +10 -0
- package/dist/ast/types.d.ts +91 -4
- package/dist/built-in-nodes/invoke-workflow.d.ts +1 -1
- package/dist/built-in-nodes/invoke-workflow.js +1 -1
- package/dist/chevrotain-parser/connect-parser.js +25 -7
- package/dist/cli/commands/compile.d.ts +5 -9
- package/dist/cli/commands/compile.js +21 -14
- package/dist/cli/commands/dev.d.ts +2 -13
- package/dist/cli/commands/dev.js +10 -204
- package/dist/cli/commands/doctor.js +6 -3
- package/dist/cli/commands/export.d.ts +8 -17
- package/dist/cli/commands/export.js +8 -17
- package/dist/cli/commands/init-personas.d.ts +17 -6
- package/dist/cli/commands/init-personas.js +73 -24
- package/dist/cli/commands/init.d.ts +5 -2
- package/dist/cli/commands/init.js +73 -42
- package/dist/cli/commands/mcp-setup.d.ts +7 -0
- package/dist/cli/commands/mcp-setup.js +16 -1
- package/dist/cli/flow-weaver.mjs +71002 -70385
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +9 -7
- package/dist/cli/templates/index.d.ts +20 -1
- package/dist/cli/templates/index.js +66 -15
- package/dist/cli/templates/nodes/human-approval.js +2 -3
- package/dist/cli/templates/nodes/rag-retriever.js +1 -1
- package/dist/constants.d.ts +7 -0
- package/dist/constants.js +13 -3
- package/dist/context/index.js +13 -3
- package/dist/deployment/config/loader.js +2 -1
- package/dist/deployment/core/adapters.d.ts +1 -25
- package/dist/deployment/core/adapters.js +0 -95
- package/dist/deployment/core/formatters.d.ts +0 -15
- package/dist/deployment/core/formatters.js +0 -24
- package/dist/deployment/index.d.ts +7 -5
- package/dist/deployment/index.js +8 -5
- package/dist/deployment/types.d.ts +2 -45
- package/dist/diagram/html-viewer.js +65 -32
- package/dist/diagram/renderer.js +9 -6
- package/dist/diagram/theme.js +4 -0
- package/dist/diagram/types.d.ts +2 -0
- package/dist/doc-metadata/extractors/annotations.js +5 -5
- package/dist/doc-metadata/extractors/cli-commands.js +1 -1
- package/dist/doc-metadata/extractors/mcp-tools.js +1 -2
- package/dist/docs/index.d.ts +28 -1
- package/dist/docs/index.js +95 -28
- package/dist/export/index.d.ts +2 -3
- package/dist/{deployment/targets/cicd-base.d.ts → extensions/cicd/base-target.d.ts} +35 -36
- package/dist/{deployment/targets/cicd-base.js → extensions/cicd/base-target.js} +97 -57
- package/dist/{validation/cicd-detection.d.ts → extensions/cicd/detection.d.ts} +2 -2
- package/dist/{validation/cicd-detection.js → extensions/cicd/detection.js} +13 -1
- package/dist/extensions/cicd/docs/cicd.md +395 -0
- package/dist/extensions/cicd/index.d.ts +10 -0
- package/dist/extensions/cicd/index.js +10 -0
- package/dist/extensions/cicd/register.d.ts +11 -0
- package/dist/extensions/cicd/register.js +62 -0
- package/dist/extensions/cicd/rules.d.ts +30 -0
- package/dist/{validation/cicd-rules.js → extensions/cicd/rules.js} +60 -56
- package/dist/extensions/cicd/tag-handler.d.ts +14 -0
- package/dist/extensions/cicd/tag-handler.js +488 -0
- package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-docker.d.ts +1 -1
- package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-matrix.d.ts +1 -1
- package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-multi-env.d.ts +1 -1
- package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-test-deploy.d.ts +1 -1
- package/dist/extensions/index.d.ts +12 -0
- package/dist/extensions/index.js +12 -0
- package/dist/extensions/inngest/dev-mode.d.ts +9 -0
- package/dist/extensions/inngest/dev-mode.js +213 -0
- package/dist/{generator/inngest.d.ts → extensions/inngest/generator.d.ts} +2 -2
- package/dist/{generator/inngest.js → extensions/inngest/generator.js} +4 -4
- package/dist/extensions/inngest/index.d.ts +2 -0
- package/dist/extensions/inngest/index.js +2 -0
- package/dist/extensions/inngest/register.d.ts +6 -0
- package/dist/extensions/inngest/register.js +23 -0
- package/dist/extensions/inngest/templates/ai-agent-durable.d.ts +8 -0
- package/dist/{cli/templates/workflows → extensions/inngest/templates}/ai-agent-durable.js +8 -8
- package/dist/{cli/templates/workflows → extensions/inngest/templates}/ai-pipeline-durable.d.ts +2 -2
- package/dist/{cli/templates/workflows → extensions/inngest/templates}/ai-pipeline-durable.js +7 -7
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +1 -1
- package/dist/generator/compile-target-registry.d.ts +20 -0
- package/dist/generator/compile-target-registry.js +20 -0
- package/dist/generator/dev-mode-registry.d.ts +27 -0
- package/dist/generator/dev-mode-registry.js +20 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/jsdoc-parser.d.ts +12 -114
- package/dist/jsdoc-parser.js +57 -362
- package/dist/marketplace/index.d.ts +2 -2
- package/dist/marketplace/index.js +1 -1
- package/dist/marketplace/registry.d.ts +39 -1
- package/dist/marketplace/registry.js +77 -0
- package/dist/marketplace/types.d.ts +76 -3
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +2 -0
- package/dist/mcp/tools-export.js +3 -3
- package/dist/mcp/tools-query.js +17 -11
- package/dist/mcp/tools-template.js +1 -1
- package/dist/parser/tag-registry.d.ts +47 -0
- package/dist/parser/tag-registry.js +57 -0
- package/dist/parser.d.ts +3 -0
- package/dist/parser.js +10 -23
- package/dist/validation/rule-registry.d.ts +36 -0
- package/dist/validation/rule-registry.js +37 -0
- package/dist/validator.js +3 -3
- package/docs/reference/concepts.md +2 -1
- package/docs/reference/deployment.md +21 -0
- package/docs/reference/jsdoc-grammar.md +242 -1
- package/docs/reference/scaffold.md +0 -6
- package/package.json +9 -1
- package/dist/cli/templates/workflows/ai-agent-durable.d.ts +0 -8
- package/dist/export/templates.d.ts +0 -24
- package/dist/export/templates.js +0 -186
- package/dist/validation/cicd-rules.d.ts +0 -62
- /package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-docker.js +0 -0
- /package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-matrix.js +0 -0
- /package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-multi-env.js +0 -0
- /package/dist/{cli/templates/workflows → extensions/cicd/templates}/cicd-test-deploy.js +0 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inngest dev mode provider.
|
|
3
|
+
*
|
|
4
|
+
* Compiles a workflow to an Inngest function, generates a local dev server
|
|
5
|
+
* entry (express or hono), and watches for file changes.
|
|
6
|
+
*/
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import * as os from 'os';
|
|
10
|
+
import { glob } from 'glob';
|
|
11
|
+
import { spawn } from 'child_process';
|
|
12
|
+
import { compileCustomTarget } from '../../cli/commands/compile.js';
|
|
13
|
+
import { logger } from '../../cli/utils/logger.js';
|
|
14
|
+
import { getErrorMessage } from '../../utils/error-utils.js';
|
|
15
|
+
function timestamp() {
|
|
16
|
+
const now = new Date();
|
|
17
|
+
const h = String(now.getHours()).padStart(2, '0');
|
|
18
|
+
const m = String(now.getMinutes()).padStart(2, '0');
|
|
19
|
+
const s = String(now.getSeconds()).padStart(2, '0');
|
|
20
|
+
return `${h}:${m}:${s}`;
|
|
21
|
+
}
|
|
22
|
+
function cycleSeparator(file) {
|
|
23
|
+
const ts = timestamp();
|
|
24
|
+
const pad = '─'.repeat(40);
|
|
25
|
+
logger.log(`\n ${logger.dim(`─── ${ts} ${pad}`)}`);
|
|
26
|
+
if (file) {
|
|
27
|
+
logger.log(` ${logger.dim('File changed:')} ${path.basename(file)}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function checkDependency(pkg, cwd) {
|
|
31
|
+
try {
|
|
32
|
+
require.resolve(pkg, { paths: [cwd] });
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function generateDevServerEntry(inngestOutputPath, framework, port) {
|
|
40
|
+
const relImport = `./${path.basename(inngestOutputPath).replace(/\.ts$/, '.js')}`;
|
|
41
|
+
if (framework === 'express') {
|
|
42
|
+
return `import express from 'express';
|
|
43
|
+
import { handler } from '${relImport}';
|
|
44
|
+
|
|
45
|
+
const app = express();
|
|
46
|
+
app.use(express.json());
|
|
47
|
+
app.use('/api/inngest', handler);
|
|
48
|
+
app.listen(${port}, () => {
|
|
49
|
+
console.log('Inngest dev server running on http://localhost:${port}');
|
|
50
|
+
console.log('Inngest endpoint: http://localhost:${port}/api/inngest');
|
|
51
|
+
console.log('');
|
|
52
|
+
console.log('Connect Inngest Dev Server:');
|
|
53
|
+
console.log(' npx inngest-cli@latest dev -u http://localhost:${port}/api/inngest');
|
|
54
|
+
});
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
if (framework === 'hono') {
|
|
58
|
+
return `import { Hono } from 'hono';
|
|
59
|
+
import { serve } from '@hono/node-server';
|
|
60
|
+
import { handler } from '${relImport}';
|
|
61
|
+
|
|
62
|
+
const app = new Hono();
|
|
63
|
+
app.route('/api/inngest', handler);
|
|
64
|
+
|
|
65
|
+
serve({ fetch: app.fetch, port: ${port} }, () => {
|
|
66
|
+
console.log('Inngest dev server running on http://localhost:${port}');
|
|
67
|
+
console.log('Inngest endpoint: http://localhost:${port}/api/inngest');
|
|
68
|
+
console.log('');
|
|
69
|
+
console.log('Connect Inngest Dev Server:');
|
|
70
|
+
console.log(' npx inngest-cli@latest dev -u http://localhost:${port}/api/inngest');
|
|
71
|
+
});
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
// Default: express
|
|
75
|
+
return generateDevServerEntry(inngestOutputPath, 'express', port);
|
|
76
|
+
}
|
|
77
|
+
export async function runInngestDevMode(filePath, options) {
|
|
78
|
+
const framework = options.framework ?? 'express';
|
|
79
|
+
const port = options.port ?? 3000;
|
|
80
|
+
const cwd = path.dirname(filePath);
|
|
81
|
+
// Check dependencies
|
|
82
|
+
const missingDeps = [];
|
|
83
|
+
if (!checkDependency('inngest', cwd))
|
|
84
|
+
missingDeps.push('inngest');
|
|
85
|
+
if (framework === 'express' && !checkDependency('express', cwd))
|
|
86
|
+
missingDeps.push('express');
|
|
87
|
+
if (framework === 'hono') {
|
|
88
|
+
if (!checkDependency('hono', cwd))
|
|
89
|
+
missingDeps.push('hono');
|
|
90
|
+
if (!checkDependency('@hono/node-server', cwd))
|
|
91
|
+
missingDeps.push('@hono/node-server');
|
|
92
|
+
}
|
|
93
|
+
if (missingDeps.length > 0) {
|
|
94
|
+
throw new Error(`Missing dependencies: ${missingDeps.join(', ')}. Install them with: npm install ${missingDeps.join(' ')}`);
|
|
95
|
+
}
|
|
96
|
+
// Set up temp directory for generated files
|
|
97
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'fw-inngest-dev-'));
|
|
98
|
+
const inngestOutputPath = path.join(tmpDir, path.basename(filePath).replace(/\.ts$/, '.inngest.ts'));
|
|
99
|
+
let serverProcess = null;
|
|
100
|
+
const compileInngest = async () => {
|
|
101
|
+
try {
|
|
102
|
+
await compileCustomTarget('inngest', filePath, {
|
|
103
|
+
production: false,
|
|
104
|
+
workflowName: options.workflow,
|
|
105
|
+
serve: true,
|
|
106
|
+
framework: framework,
|
|
107
|
+
typedEvents: true,
|
|
108
|
+
});
|
|
109
|
+
// compileCustomTarget writes to filePath.replace(.ts, .inngest.ts)
|
|
110
|
+
// Copy it to our temp dir, then remove the source-adjacent file
|
|
111
|
+
const sourceOutput = filePath.replace(/\.ts$/, '.inngest.ts');
|
|
112
|
+
if (fs.existsSync(sourceOutput)) {
|
|
113
|
+
fs.copyFileSync(sourceOutput, inngestOutputPath);
|
|
114
|
+
try {
|
|
115
|
+
fs.unlinkSync(sourceOutput);
|
|
116
|
+
}
|
|
117
|
+
catch { /* ignore */ }
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
logger.error(`Compilation failed: ${getErrorMessage(error)}`);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const startServer = () => {
|
|
127
|
+
const entryPath = path.join(tmpDir, 'dev-server.ts');
|
|
128
|
+
const entryCode = generateDevServerEntry(inngestOutputPath, framework, port);
|
|
129
|
+
fs.writeFileSync(entryPath, entryCode, 'utf8');
|
|
130
|
+
serverProcess = spawn('npx', ['tsx', entryPath], {
|
|
131
|
+
cwd: path.dirname(filePath),
|
|
132
|
+
stdio: 'inherit',
|
|
133
|
+
shell: true,
|
|
134
|
+
});
|
|
135
|
+
serverProcess.on('error', (err) => {
|
|
136
|
+
logger.error(`Server process error: ${err.message}`);
|
|
137
|
+
});
|
|
138
|
+
serverProcess.on('exit', (code) => {
|
|
139
|
+
if (code !== null && code !== 0) {
|
|
140
|
+
logger.error(`Server exited with code ${code}`);
|
|
141
|
+
}
|
|
142
|
+
serverProcess = null;
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
const stopServer = () => {
|
|
146
|
+
if (serverProcess && !serverProcess.killed) {
|
|
147
|
+
serverProcess.kill();
|
|
148
|
+
serverProcess = null;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const restartServer = async () => {
|
|
152
|
+
stopServer();
|
|
153
|
+
const ok = await compileInngest();
|
|
154
|
+
if (ok) {
|
|
155
|
+
startServer();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
// Header
|
|
159
|
+
logger.section('Inngest Dev Mode');
|
|
160
|
+
logger.info(`File: ${path.basename(filePath)}`);
|
|
161
|
+
logger.info(`Framework: ${framework}`);
|
|
162
|
+
logger.info(`Port: ${port}`);
|
|
163
|
+
logger.newline();
|
|
164
|
+
// Initial compile + start
|
|
165
|
+
const ok = await compileInngest();
|
|
166
|
+
if (!ok) {
|
|
167
|
+
if (options.once)
|
|
168
|
+
return;
|
|
169
|
+
logger.info('Fix the errors above, then save the file to retry.');
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
if (options.once)
|
|
173
|
+
return;
|
|
174
|
+
startServer();
|
|
175
|
+
}
|
|
176
|
+
// Watch for changes
|
|
177
|
+
logger.newline();
|
|
178
|
+
logger.success('Watching for file changes... (Ctrl+C to stop)');
|
|
179
|
+
const files = await glob(path.resolve(filePath), { absolute: true });
|
|
180
|
+
const chokidar = await import('chokidar');
|
|
181
|
+
const watcher = chokidar.watch(files, {
|
|
182
|
+
persistent: true,
|
|
183
|
+
ignoreInitial: true,
|
|
184
|
+
});
|
|
185
|
+
watcher.on('change', async (file) => {
|
|
186
|
+
cycleSeparator(file);
|
|
187
|
+
logger.info('Recompiling and restarting server...');
|
|
188
|
+
await restartServer();
|
|
189
|
+
});
|
|
190
|
+
// Cleanup
|
|
191
|
+
const sourceOutput = filePath.replace(/\.ts$/, '.inngest.ts');
|
|
192
|
+
const cleanup = () => {
|
|
193
|
+
logger.newline();
|
|
194
|
+
logger.info('Stopping dev mode...');
|
|
195
|
+
stopServer();
|
|
196
|
+
watcher.close();
|
|
197
|
+
try {
|
|
198
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
199
|
+
}
|
|
200
|
+
catch { /* ignore */ }
|
|
201
|
+
try {
|
|
202
|
+
fs.unlinkSync(sourceOutput);
|
|
203
|
+
}
|
|
204
|
+
catch { /* ignore */ }
|
|
205
|
+
process.exit(0);
|
|
206
|
+
};
|
|
207
|
+
process.on('SIGINT', cleanup);
|
|
208
|
+
if (process.platform !== 'win32')
|
|
209
|
+
process.on('SIGTERM', cleanup);
|
|
210
|
+
// Keep process alive
|
|
211
|
+
await new Promise(() => { });
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=dev-mode.js.map
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @module generator/inngest
|
|
16
16
|
*/
|
|
17
|
-
import type { TNodeTypeAST, TWorkflowAST } from '
|
|
17
|
+
import type { TNodeTypeAST, TWorkflowAST } from '../../ast/types.js';
|
|
18
18
|
export interface InngestGenerationOptions {
|
|
19
19
|
/** Omit debug instrumentation for smaller output */
|
|
20
20
|
production?: boolean;
|
|
@@ -50,4 +50,4 @@ export interface InngestGenerationOptions {
|
|
|
50
50
|
* @returns Complete TypeScript source code string
|
|
51
51
|
*/
|
|
52
52
|
export declare function generateInngestFunction(workflow: TWorkflowAST, nodeTypes: TNodeTypeAST[], options?: InngestGenerationOptions): string;
|
|
53
|
-
//# sourceMappingURL=
|
|
53
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @module generator/inngest
|
|
16
16
|
*/
|
|
17
|
-
import { toValidIdentifier } from '
|
|
18
|
-
import { buildControlFlowGraph, detectBranchingChains, findAllBranchingNodes, findNodesInBranch, performKahnsTopologicalSort, isPerPortScopedChild, } from '
|
|
19
|
-
import { RESERVED_PORT_NAMES, isStartNode, isExitNode, isExecutePort, isSuccessPort, isFailurePort, } from '
|
|
17
|
+
import { toValidIdentifier } from '../../generator/code-utils.js';
|
|
18
|
+
import { buildControlFlowGraph, detectBranchingChains, findAllBranchingNodes, findNodesInBranch, performKahnsTopologicalSort, isPerPortScopedChild, } from '../../generator/control-flow.js';
|
|
19
|
+
import { RESERVED_PORT_NAMES, isStartNode, isExitNode, isExecutePort, isSuccessPort, isFailurePort, } from '../../constants.js';
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
// Built-in Node Detection
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
@@ -1173,4 +1173,4 @@ export function generateInngestFunction(workflow, nodeTypes, options) {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
return lines.join('\n');
|
|
1175
1175
|
}
|
|
1176
|
-
//# sourceMappingURL=
|
|
1176
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inngest extension self-registration module.
|
|
3
|
+
* Loaded as a side-effect import from src/extensions/index.ts.
|
|
4
|
+
*/
|
|
5
|
+
import { compileTargetRegistry } from '../../generator/compile-target-registry.js';
|
|
6
|
+
import { devModeRegistry } from '../../generator/dev-mode-registry.js';
|
|
7
|
+
import { registerWorkflowTemplates } from '../../cli/templates/index.js';
|
|
8
|
+
import { generateInngestFunction } from './generator.js';
|
|
9
|
+
import { runInngestDevMode } from './dev-mode.js';
|
|
10
|
+
import { aiAgentDurableTemplate } from './templates/ai-agent-durable.js';
|
|
11
|
+
import { aiPipelineDurableTemplate } from './templates/ai-pipeline-durable.js';
|
|
12
|
+
compileTargetRegistry.register({
|
|
13
|
+
name: 'inngest',
|
|
14
|
+
compile(workflow, nodeTypes, options) {
|
|
15
|
+
return generateInngestFunction(workflow, nodeTypes, options);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
devModeRegistry.register({
|
|
19
|
+
name: 'inngest',
|
|
20
|
+
run: runInngestDevMode,
|
|
21
|
+
});
|
|
22
|
+
registerWorkflowTemplates([aiAgentDurableTemplate, aiPipelineDurableTemplate]);
|
|
23
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable AI Agent Template
|
|
3
|
+
* Linear agent pipeline with durability annotations.
|
|
4
|
+
* Each node maps to a checkpointed step when compiled to a durable target.
|
|
5
|
+
*/
|
|
6
|
+
import type { WorkflowTemplate } from '../../../cli/templates/index.js';
|
|
7
|
+
export declare const aiAgentDurableTemplate: WorkflowTemplate;
|
|
8
|
+
//# sourceMappingURL=ai-agent-durable.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getProviderCode } from '
|
|
2
|
-
import { aiConfigSchema } from '
|
|
3
|
-
import { LLM_CORE_TYPES, LLM_MOCK_PROVIDER_WITH_TOOLS } from '
|
|
1
|
+
import { getProviderCode } from '../../../cli/templates/providers/index.js';
|
|
2
|
+
import { aiConfigSchema } from '../../../cli/templates/workflows/ai-agent.js';
|
|
3
|
+
import { LLM_CORE_TYPES, LLM_MOCK_PROVIDER_WITH_TOOLS } from '../../../cli/templates/shared/llm-types.js';
|
|
4
4
|
export const aiAgentDurableTemplate = {
|
|
5
5
|
id: 'ai-agent-durable',
|
|
6
6
|
name: 'Durable AI Agent',
|
|
@@ -24,11 +24,11 @@ ${LLM_MOCK_PROVIDER_WITH_TOOLS}
|
|
|
24
24
|
// Durable AI Agent
|
|
25
25
|
// ============================================================
|
|
26
26
|
//
|
|
27
|
-
// Each node becomes a checkpointed step when compiled to
|
|
28
|
-
// If a step fails, it retries from that step
|
|
27
|
+
// Each node becomes a checkpointed step when compiled to a durable target.
|
|
28
|
+
// If a step fails, it retries from that step, not from scratch.
|
|
29
29
|
//
|
|
30
30
|
// Compile: flow-weaver compile <file>
|
|
31
|
-
// Export: fw export --target
|
|
31
|
+
// Export: fw export --target <target>
|
|
32
32
|
//
|
|
33
33
|
// Flow: classify → executeTool → requestApproval → respond
|
|
34
34
|
|
|
@@ -75,7 +75,7 @@ const TOOL_IMPLEMENTATIONS: Record<string, ToolFn> = {
|
|
|
75
75
|
* APPROVAL BACKEND (mock — replace with real backend)
|
|
76
76
|
* ============================================================
|
|
77
77
|
*
|
|
78
|
-
* On
|
|
78
|
+
* On durable targets, this node compiles to a platform-native wait primitive.
|
|
79
79
|
* The function pauses (zero compute cost) until an approval event arrives.
|
|
80
80
|
*/
|
|
81
81
|
|
|
@@ -289,7 +289,7 @@ async function respond(
|
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
291
|
* Durable AI Agent — linear pipeline with tool calling and human approval.
|
|
292
|
-
* Each node becomes a checkpointed step when compiled to
|
|
292
|
+
* Each node becomes a checkpointed step when compiled to a durable target.
|
|
293
293
|
*
|
|
294
294
|
* @flowWeaver workflow
|
|
295
295
|
* @trigger event="agent/request"
|
package/dist/{cli/templates/workflows → extensions/inngest/templates}/ai-pipeline-durable.d.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Durable AI Pipeline Template
|
|
3
|
-
* Sequential data processing pipeline with durability annotations
|
|
3
|
+
* Sequential data processing pipeline with durability annotations.
|
|
4
4
|
* Each node maps to a checkpointed step — if step 3 fails, it retries from step 3, not from scratch.
|
|
5
5
|
*/
|
|
6
|
-
import type { WorkflowTemplate } from '
|
|
6
|
+
import type { WorkflowTemplate } from '../../../cli/templates/index.js';
|
|
7
7
|
export declare const aiPipelineDurableTemplate: WorkflowTemplate;
|
|
8
8
|
//# sourceMappingURL=ai-pipeline-durable.d.ts.map
|
package/dist/{cli/templates/workflows → extensions/inngest/templates}/ai-pipeline-durable.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getProviderCode } from '
|
|
2
|
-
import { aiConfigSchema } from '
|
|
3
|
-
import { LLM_CORE_TYPES, LLM_MOCK_PROVIDER } from '
|
|
1
|
+
import { getProviderCode } from '../../../cli/templates/providers/index.js';
|
|
2
|
+
import { aiConfigSchema } from '../../../cli/templates/workflows/ai-agent.js';
|
|
3
|
+
import { LLM_CORE_TYPES, LLM_MOCK_PROVIDER } from '../../../cli/templates/shared/llm-types.js';
|
|
4
4
|
export const aiPipelineDurableTemplate = {
|
|
5
5
|
id: 'ai-pipeline-durable',
|
|
6
6
|
name: 'Durable AI Pipeline',
|
|
@@ -24,11 +24,11 @@ ${LLM_MOCK_PROVIDER}
|
|
|
24
24
|
// Durable Data Pipeline
|
|
25
25
|
// ============================================================
|
|
26
26
|
//
|
|
27
|
-
// Each node becomes a checkpointed step when compiled to
|
|
28
|
-
// If step 3 fails, it retries from step 3
|
|
27
|
+
// Each node becomes a checkpointed step when compiled to a durable target.
|
|
28
|
+
// If step 3 fails, it retries from step 3, not from scratch.
|
|
29
29
|
//
|
|
30
30
|
// Compile: flow-weaver compile <file>
|
|
31
|
-
// Export: fw export --target
|
|
31
|
+
// Export: fw export --target <target>
|
|
32
32
|
//
|
|
33
33
|
// Flow: fetchData → extract (LLM) → validate → save
|
|
34
34
|
// ↓ onFailure
|
|
@@ -277,7 +277,7 @@ async function saveResult(
|
|
|
277
277
|
|
|
278
278
|
/**
|
|
279
279
|
* Durable Data Pipeline — sequential fetch, extract, validate, save.
|
|
280
|
-
* Each node becomes a checkpointed step when compiled to
|
|
280
|
+
* Each node becomes a checkpointed step when compiled to a durable target.
|
|
281
281
|
*
|
|
282
282
|
* @flowWeaver workflow
|
|
283
283
|
* @trigger event="pipeline/start"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.17.
|
|
1
|
+
export declare const VERSION = "0.17.2";
|
|
2
2
|
//# sourceMappingURL=generated-version.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension point for custom compile targets.
|
|
3
|
+
*
|
|
4
|
+
* Extensions and packs register their compile targets here.
|
|
5
|
+
* The compile command and MCP tool look up targets from this registry.
|
|
6
|
+
*/
|
|
7
|
+
import type { TNodeTypeAST, TWorkflowAST } from '../ast/types.js';
|
|
8
|
+
export interface CompileTarget {
|
|
9
|
+
name: string;
|
|
10
|
+
compile(workflow: TWorkflowAST, nodeTypes: TNodeTypeAST[], options: Record<string, unknown>): string;
|
|
11
|
+
}
|
|
12
|
+
declare class CompileTargetRegistry {
|
|
13
|
+
private targets;
|
|
14
|
+
register(target: CompileTarget): void;
|
|
15
|
+
get(name: string): CompileTarget | undefined;
|
|
16
|
+
getNames(): string[];
|
|
17
|
+
}
|
|
18
|
+
export declare const compileTargetRegistry: CompileTargetRegistry;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=compile-target-registry.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension point for custom compile targets.
|
|
3
|
+
*
|
|
4
|
+
* Extensions and packs register their compile targets here.
|
|
5
|
+
* The compile command and MCP tool look up targets from this registry.
|
|
6
|
+
*/
|
|
7
|
+
class CompileTargetRegistry {
|
|
8
|
+
targets = new Map();
|
|
9
|
+
register(target) {
|
|
10
|
+
this.targets.set(target.name, target);
|
|
11
|
+
}
|
|
12
|
+
get(name) {
|
|
13
|
+
return this.targets.get(name);
|
|
14
|
+
}
|
|
15
|
+
getNames() {
|
|
16
|
+
return [...this.targets.keys()];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const compileTargetRegistry = new CompileTargetRegistry();
|
|
20
|
+
//# sourceMappingURL=compile-target-registry.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension point for custom dev mode providers.
|
|
3
|
+
*
|
|
4
|
+
* Extensions register dev mode handlers here so the dev command can
|
|
5
|
+
* start target-specific dev servers without hardcoding any pack logic.
|
|
6
|
+
*/
|
|
7
|
+
export interface DevModeOptions {
|
|
8
|
+
workflow?: string;
|
|
9
|
+
framework?: string;
|
|
10
|
+
port?: number;
|
|
11
|
+
production?: boolean;
|
|
12
|
+
once?: boolean;
|
|
13
|
+
json?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface DevModeProvider {
|
|
16
|
+
name: string;
|
|
17
|
+
run(filePath: string, options: DevModeOptions): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
declare class DevModeRegistry {
|
|
20
|
+
private providers;
|
|
21
|
+
register(provider: DevModeProvider): void;
|
|
22
|
+
get(name: string): DevModeProvider | undefined;
|
|
23
|
+
getNames(): string[];
|
|
24
|
+
}
|
|
25
|
+
export declare const devModeRegistry: DevModeRegistry;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=dev-mode-registry.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension point for custom dev mode providers.
|
|
3
|
+
*
|
|
4
|
+
* Extensions register dev mode handlers here so the dev command can
|
|
5
|
+
* start target-specific dev servers without hardcoding any pack logic.
|
|
6
|
+
*/
|
|
7
|
+
class DevModeRegistry {
|
|
8
|
+
providers = new Map();
|
|
9
|
+
register(provider) {
|
|
10
|
+
this.providers.set(provider.name, provider);
|
|
11
|
+
}
|
|
12
|
+
get(name) {
|
|
13
|
+
return this.providers.get(name);
|
|
14
|
+
}
|
|
15
|
+
getNames() {
|
|
16
|
+
return [...this.providers.keys()];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const devModeRegistry = new DevModeRegistry();
|
|
20
|
+
//# sourceMappingURL=dev-mode-registry.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -58,6 +58,10 @@
|
|
|
58
58
|
export * from './api/index.js';
|
|
59
59
|
export { parser, resolveNpmNodeTypes } from './parser.js';
|
|
60
60
|
export type { TExternalNodeType } from './parser.js';
|
|
61
|
+
export { TagHandlerRegistry } from './parser/tag-registry.js';
|
|
62
|
+
export type { TTagHandlerFn, TTagHandlerContext } from './parser/tag-registry.js';
|
|
63
|
+
export { ValidationRuleRegistry } from './validation/rule-registry.js';
|
|
64
|
+
export type { TValidationRuleSet } from './validation/rule-registry.js';
|
|
61
65
|
export type { TConnectionAST, TNodeTypeAST, TNodeInstanceAST, TNodeInstanceConfig, TPortConfig, TWorkflowAST, TPortReference, TPortDefinition, TDataType, TExecuteWhen, TBranchingStrategy, TSerializableValue, TSerializableObject, TSerializableArray, TImportDeclaration, TImportSpecifier, TSourceLocation, TValidationError, TAnalysisResult, TControlFlowGraph, TControlFlowEdge, TBranchingNodeInfo, TBranchRegion, TMergeNodeInfo, TWorkflowMetadata, TNodeMetadata, TConnectionMetadata, TASTTransformer, TASTVisitor, TParseOptions, TValidationRule, TGenerateOptions, TCompileResult, TCompilationMetadata, TNodeTypeDefaultConfig, TNodeTypePort, TPortDirection, TNodeParent, TPullExecutionConfig, TWorkflowFileExtension, TPortPlacement, TPortUI, TNodeTypeUI, TNodeUI, TWorkFlowFunctionUI, TPortType, } from './ast/types.js';
|
|
62
66
|
export { WorkflowBuilder, NodeTypeBuilder, NodeInstanceBuilder, ConnectionBuilder, } from './ast/builder.js';
|
|
63
67
|
export { portRef, port, workflow, nodeType, nodeInstance } from './ast/builder.js';
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,9 @@
|
|
|
59
59
|
export * from './api/index.js';
|
|
60
60
|
// Parser (for advanced use - clearing import cache)
|
|
61
61
|
export { parser, resolveNpmNodeTypes } from './parser.js';
|
|
62
|
+
// Extension registries
|
|
63
|
+
export { TagHandlerRegistry } from './parser/tag-registry.js';
|
|
64
|
+
export { ValidationRuleRegistry } from './validation/rule-registry.js';
|
|
62
65
|
// AST Builders (for programmatic AST construction)
|
|
63
66
|
export { WorkflowBuilder, NodeTypeBuilder, NodeInstanceBuilder, ConnectionBuilder, } from './ast/builder.js';
|
|
64
67
|
export { portRef, port, workflow, nodeType, nodeInstance } from './ast/builder.js';
|