@synergenius/flow-weaver 0.15.2 → 0.16.0
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/cli/commands/compile.js +158 -149
- package/dist/cli/commands/dev.js +14 -11
- package/dist/cli/commands/diff.js +6 -1
- package/dist/cli/commands/doctor.js +16 -25
- package/dist/cli/commands/export.js +2 -0
- package/dist/cli/commands/grammar.js +3 -1
- package/dist/cli/commands/init.js +18 -28
- package/dist/cli/commands/market.js +14 -6
- package/dist/cli/commands/migrate.js +3 -2
- package/dist/cli/commands/openapi.js +4 -1
- package/dist/cli/commands/run.js +44 -16
- package/dist/cli/commands/status.js +5 -3
- package/dist/cli/commands/strip.js +3 -1
- package/dist/cli/commands/templates.js +1 -1
- package/dist/cli/commands/validate.js +27 -24
- package/dist/cli/env-setup.d.ts +5 -0
- package/dist/cli/env-setup.js +12 -0
- package/dist/cli/flow-weaver.mjs +762 -794
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +254 -508
- package/dist/cli/utils/logger.d.ts +14 -0
- package/dist/cli/utils/logger.js +96 -16
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +1 -1
- package/dist/mcp/workflow-executor.js +7 -1
- package/package.json +2 -1
|
@@ -11,5 +11,19 @@ export declare const logger: {
|
|
|
11
11
|
newline(): void;
|
|
12
12
|
section(title: string): void;
|
|
13
13
|
progress(current: number, total: number, item: string): void;
|
|
14
|
+
dim(message: string): string;
|
|
15
|
+
bold(message: string): string;
|
|
16
|
+
highlight(value: string): string;
|
|
17
|
+
banner(version: string): void;
|
|
18
|
+
table(rows: [string, string, string?][]): void;
|
|
19
|
+
spinner(message: string): {
|
|
20
|
+
stop: (msg?: string) => void;
|
|
21
|
+
fail: (msg?: string) => void;
|
|
22
|
+
update: (msg: string) => void;
|
|
23
|
+
};
|
|
24
|
+
timer(): {
|
|
25
|
+
elapsed: () => string;
|
|
26
|
+
ms: () => number;
|
|
27
|
+
};
|
|
14
28
|
};
|
|
15
29
|
//# sourceMappingURL=logger.d.ts.map
|
package/dist/cli/utils/logger.js
CHANGED
|
@@ -2,31 +2,26 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* CLI logging utility with colors and formatting
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const RED = USE_COLOR ? '\x1b[31m' : '';
|
|
10
|
-
const YELLOW = USE_COLOR ? '\x1b[33m' : '';
|
|
11
|
-
const BLUE = USE_COLOR ? '\x1b[34m' : '';
|
|
12
|
-
const BOLD = USE_COLOR ? '\x1b[1m' : '';
|
|
13
|
-
const DIM = USE_COLOR ? '\x1b[2m' : '';
|
|
5
|
+
import pc from 'picocolors';
|
|
6
|
+
const isTTY = process.stdout.isTTY === true;
|
|
7
|
+
// Spinner frames
|
|
8
|
+
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
14
9
|
export const logger = {
|
|
15
10
|
info(message) {
|
|
16
|
-
console.log(`${
|
|
11
|
+
console.log(`${pc.blue('ℹ')} ${message}`);
|
|
17
12
|
},
|
|
18
13
|
success(message) {
|
|
19
|
-
console.log(`${
|
|
14
|
+
console.log(`${pc.green('✓')} ${message}`);
|
|
20
15
|
},
|
|
21
16
|
error(message) {
|
|
22
|
-
console.error(`${
|
|
17
|
+
console.error(`${pc.red('✗')} ${message}`);
|
|
23
18
|
},
|
|
24
19
|
warn(message) {
|
|
25
|
-
console.warn(`${
|
|
20
|
+
console.warn(`${pc.yellow('⚠')} ${message}`);
|
|
26
21
|
},
|
|
27
22
|
debug(message) {
|
|
28
23
|
if (process.env.DEBUG) {
|
|
29
|
-
console.log(`${
|
|
24
|
+
console.log(`${pc.dim('🔍')} ${pc.dim(message)}`);
|
|
30
25
|
}
|
|
31
26
|
},
|
|
32
27
|
log(message) {
|
|
@@ -37,10 +32,95 @@ export const logger = {
|
|
|
37
32
|
},
|
|
38
33
|
section(title) {
|
|
39
34
|
console.log();
|
|
40
|
-
console.log(
|
|
35
|
+
console.log(` ${pc.bold(title)}`);
|
|
36
|
+
console.log();
|
|
41
37
|
},
|
|
42
38
|
progress(current, total, item) {
|
|
43
|
-
console.log(`[${current}/${total}] ${item}`);
|
|
39
|
+
console.log(`${pc.dim(`[${current}/${total}]`)} ${item}`);
|
|
40
|
+
},
|
|
41
|
+
// --- Formatting helpers ---
|
|
42
|
+
dim(message) {
|
|
43
|
+
return pc.dim(message);
|
|
44
|
+
},
|
|
45
|
+
bold(message) {
|
|
46
|
+
return pc.bold(message);
|
|
47
|
+
},
|
|
48
|
+
highlight(value) {
|
|
49
|
+
return pc.cyan(value);
|
|
50
|
+
},
|
|
51
|
+
// --- Branded output ---
|
|
52
|
+
banner(version) {
|
|
53
|
+
console.log(` ${pc.bold(pc.cyan('flow-weaver'))} ${pc.dim(`v${version}`)}`);
|
|
54
|
+
},
|
|
55
|
+
// --- Table output ---
|
|
56
|
+
table(rows) {
|
|
57
|
+
if (rows.length === 0)
|
|
58
|
+
return;
|
|
59
|
+
const col0 = Math.max(...rows.map((r) => r[0].length)) + 2;
|
|
60
|
+
const col1 = Math.max(...rows.map((r) => r[1].length)) + 2;
|
|
61
|
+
for (const [label, value, status] of rows) {
|
|
62
|
+
const line = ` ${label.padEnd(col0)}${value.padEnd(col1)}${status ?? ''}`;
|
|
63
|
+
console.log(line);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
// --- Spinner ---
|
|
67
|
+
spinner(message) {
|
|
68
|
+
if (!isTTY) {
|
|
69
|
+
// Non-TTY: print a static line
|
|
70
|
+
process.stderr.write(` ${message}\n`);
|
|
71
|
+
return {
|
|
72
|
+
stop(msg) { if (msg)
|
|
73
|
+
process.stderr.write(` ${pc.green('✓')} ${msg}\n`); },
|
|
74
|
+
fail(msg) { if (msg)
|
|
75
|
+
process.stderr.write(` ${pc.red('✗')} ${msg}\n`); },
|
|
76
|
+
update() { },
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
let frame = 0;
|
|
80
|
+
let text = message;
|
|
81
|
+
const interval = setInterval(() => {
|
|
82
|
+
const spinner = pc.cyan(SPINNER_FRAMES[frame % SPINNER_FRAMES.length]);
|
|
83
|
+
process.stderr.write(`\r\x1b[K ${spinner} ${text}`);
|
|
84
|
+
frame++;
|
|
85
|
+
}, 80);
|
|
86
|
+
const clear = () => {
|
|
87
|
+
clearInterval(interval);
|
|
88
|
+
process.stderr.write('\r\x1b[K');
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
stop(msg) {
|
|
92
|
+
clear();
|
|
93
|
+
if (msg)
|
|
94
|
+
process.stderr.write(` ${pc.green('✓')} ${msg}\n`);
|
|
95
|
+
},
|
|
96
|
+
fail(msg) {
|
|
97
|
+
clear();
|
|
98
|
+
if (msg)
|
|
99
|
+
process.stderr.write(` ${pc.red('✗')} ${msg}\n`);
|
|
100
|
+
},
|
|
101
|
+
update(msg) {
|
|
102
|
+
text = msg;
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
// --- Timer ---
|
|
107
|
+
timer() {
|
|
108
|
+
const start = performance.now();
|
|
109
|
+
return {
|
|
110
|
+
elapsed() {
|
|
111
|
+
const ms = performance.now() - start;
|
|
112
|
+
if (ms < 1000)
|
|
113
|
+
return `${Math.round(ms)}ms`;
|
|
114
|
+
if (ms < 60_000)
|
|
115
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
116
|
+
const mins = Math.floor(ms / 60_000);
|
|
117
|
+
const secs = Math.round((ms % 60_000) / 1000);
|
|
118
|
+
return `${mins}m ${secs}s`;
|
|
119
|
+
},
|
|
120
|
+
ms() {
|
|
121
|
+
return Math.round(performance.now() - start);
|
|
122
|
+
},
|
|
123
|
+
};
|
|
44
124
|
},
|
|
45
125
|
};
|
|
46
126
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.16.0";
|
|
2
2
|
//# sourceMappingURL=generated-version.d.ts.map
|
|
@@ -116,7 +116,13 @@ export async function executeWorkflowFromFile(filePath, params, options) {
|
|
|
116
116
|
// Find the target exported function
|
|
117
117
|
const exportedFn = findExportedFunction(mod, options?.workflowName);
|
|
118
118
|
if (!exportedFn) {
|
|
119
|
-
|
|
119
|
+
const available = Object.entries(mod)
|
|
120
|
+
.filter(([k, v]) => k !== '__esModule' && typeof v === 'function')
|
|
121
|
+
.map(([k]) => k);
|
|
122
|
+
const availStr = available.length > 0 ? `. Available: ${available.join(', ')}` : '';
|
|
123
|
+
throw new Error(options?.workflowName
|
|
124
|
+
? `Workflow "${options.workflowName}" not found in file${availStr}`
|
|
125
|
+
: `No exported workflow function found in file${availStr}`);
|
|
120
126
|
}
|
|
121
127
|
const startTime = Date.now();
|
|
122
128
|
// Execute the workflow function: (execute, params, abortSignal?)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synergenius/flow-weaver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -138,6 +138,7 @@
|
|
|
138
138
|
"glob": "^10.3.10",
|
|
139
139
|
"immer": "^10.2.0",
|
|
140
140
|
"js-yaml": "^4.1.0",
|
|
141
|
+
"picocolors": "^1.1.1",
|
|
141
142
|
"socket.io-client": "^4.8.0",
|
|
142
143
|
"source-map": "^0.7.6",
|
|
143
144
|
"ts-morph": "^21.0.1",
|