@synergenius/flowweaver-pack-weaver 0.5.1 → 0.5.3
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 +167 -0
- package/dist/bot/agent-provider.d.ts +15 -1
- package/dist/bot/agent-provider.d.ts.map +1 -1
- package/dist/bot/agent-provider.js +78 -2
- package/dist/bot/agent-provider.js.map +1 -1
- package/dist/bot/ai-client.d.ts +4 -0
- package/dist/bot/ai-client.d.ts.map +1 -0
- package/dist/bot/ai-client.js +50 -0
- package/dist/bot/ai-client.js.map +1 -0
- package/dist/bot/bot-agent-channel.d.ts +14 -1
- package/dist/bot/bot-agent-channel.d.ts.map +1 -1
- package/dist/bot/bot-agent-channel.js +16 -0
- package/dist/bot/bot-agent-channel.js.map +1 -1
- package/dist/bot/cli-provider.d.ts +18 -2
- package/dist/bot/cli-provider.d.ts.map +1 -1
- package/dist/bot/cli-provider.js +20 -2
- package/dist/bot/cli-provider.js.map +1 -1
- package/dist/bot/dashboard.d.ts.map +1 -1
- package/dist/bot/dashboard.js +2 -2
- package/dist/bot/dashboard.js.map +1 -1
- package/dist/bot/file-lock.d.ts +7 -0
- package/dist/bot/file-lock.d.ts.map +1 -0
- package/dist/bot/file-lock.js +64 -0
- package/dist/bot/file-lock.js.map +1 -0
- package/dist/bot/file-validator.d.ts +7 -0
- package/dist/bot/file-validator.d.ts.map +1 -0
- package/dist/bot/file-validator.js +20 -0
- package/dist/bot/file-validator.js.map +1 -0
- package/dist/bot/genesis-store.d.ts +18 -0
- package/dist/bot/genesis-store.d.ts.map +1 -0
- package/dist/bot/genesis-store.js +89 -0
- package/dist/bot/genesis-store.js.map +1 -0
- package/dist/bot/index.d.ts +7 -1
- package/dist/bot/index.d.ts.map +1 -1
- package/dist/bot/index.js +8 -0
- package/dist/bot/index.js.map +1 -1
- package/dist/bot/provider-registry.js +2 -2
- package/dist/bot/provider-registry.js.map +1 -1
- package/dist/bot/runner.d.ts.map +1 -1
- package/dist/bot/runner.js +2 -4
- package/dist/bot/runner.js.map +1 -1
- package/dist/bot/session-state.d.ts +3 -3
- package/dist/bot/session-state.d.ts.map +1 -1
- package/dist/bot/session-state.js +24 -15
- package/dist/bot/session-state.js.map +1 -1
- package/dist/bot/steering.d.ts +2 -2
- package/dist/bot/steering.d.ts.map +1 -1
- package/dist/bot/steering.js +20 -15
- package/dist/bot/steering.js.map +1 -1
- package/dist/bot/step-executor.d.ts +9 -0
- package/dist/bot/step-executor.d.ts.map +1 -0
- package/dist/bot/step-executor.js +51 -0
- package/dist/bot/step-executor.js.map +1 -0
- package/dist/bot/task-queue.d.ts +8 -8
- package/dist/bot/task-queue.d.ts.map +1 -1
- package/dist/bot/task-queue.js +58 -47
- package/dist/bot/task-queue.js.map +1 -1
- package/dist/bot/types.d.ts +131 -0
- package/dist/bot/types.d.ts.map +1 -1
- package/dist/cli-bridge.d.ts.map +1 -1
- package/dist/cli-bridge.js +2 -1
- package/dist/cli-bridge.js.map +1 -1
- package/dist/cli-handlers.d.ts +4 -1
- package/dist/cli-handlers.d.ts.map +1 -1
- package/dist/cli-handlers.js +84 -8
- package/dist/cli-handlers.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-tools.d.ts.map +1 -1
- package/dist/mcp-tools.js +27 -5
- package/dist/mcp-tools.js.map +1 -1
- package/dist/node-types/abort-task.d.ts +5 -12
- package/dist/node-types/abort-task.d.ts.map +1 -1
- package/dist/node-types/abort-task.js +11 -16
- package/dist/node-types/abort-task.js.map +1 -1
- package/dist/node-types/approval-gate.d.ts +4 -21
- package/dist/node-types/approval-gate.d.ts.map +1 -1
- package/dist/node-types/approval-gate.js +17 -23
- package/dist/node-types/approval-gate.js.map +1 -1
- package/dist/node-types/bot-report.d.ts +8 -10
- package/dist/node-types/bot-report.d.ts.map +1 -1
- package/dist/node-types/bot-report.js +28 -24
- package/dist/node-types/bot-report.js.map +1 -1
- package/dist/node-types/build-context.d.ts +5 -18
- package/dist/node-types/build-context.d.ts.map +1 -1
- package/dist/node-types/build-context.js +14 -23
- package/dist/node-types/build-context.js.map +1 -1
- package/dist/node-types/detect-provider.d.ts +7 -10
- package/dist/node-types/detect-provider.d.ts.map +1 -1
- package/dist/node-types/detect-provider.js +8 -12
- package/dist/node-types/detect-provider.js.map +1 -1
- package/dist/node-types/exec-validate-retry.d.ts +5 -26
- package/dist/node-types/exec-validate-retry.d.ts.map +1 -1
- package/dist/node-types/exec-validate-retry.js +21 -144
- package/dist/node-types/exec-validate-retry.js.map +1 -1
- package/dist/node-types/execute-plan.d.ts +10 -18
- package/dist/node-types/execute-plan.d.ts.map +1 -1
- package/dist/node-types/execute-plan.js +13 -68
- package/dist/node-types/execute-plan.js.map +1 -1
- package/dist/node-types/execute-target.d.ts +5 -15
- package/dist/node-types/execute-target.d.ts.map +1 -1
- package/dist/node-types/execute-target.js +17 -85
- package/dist/node-types/execute-target.js.map +1 -1
- package/dist/node-types/fix-errors.d.ts +9 -17
- package/dist/node-types/fix-errors.d.ts.map +1 -1
- package/dist/node-types/fix-errors.js +13 -64
- package/dist/node-types/fix-errors.js.map +1 -1
- package/dist/node-types/genesis-apply-retry.d.ts +24 -0
- package/dist/node-types/genesis-apply-retry.d.ts.map +1 -0
- package/dist/node-types/genesis-apply-retry.js +95 -0
- package/dist/node-types/genesis-apply-retry.js.map +1 -0
- package/dist/node-types/genesis-apply.d.ts +29 -0
- package/dist/node-types/genesis-apply.d.ts.map +1 -0
- package/dist/node-types/genesis-apply.js +76 -0
- package/dist/node-types/genesis-apply.js.map +1 -0
- package/dist/node-types/genesis-approve.d.ts +19 -0
- package/dist/node-types/genesis-approve.d.ts.map +1 -0
- package/dist/node-types/genesis-approve.js +54 -0
- package/dist/node-types/genesis-approve.js.map +1 -0
- package/dist/node-types/genesis-check-stabilize.d.ts +16 -0
- package/dist/node-types/genesis-check-stabilize.d.ts.map +1 -0
- package/dist/node-types/genesis-check-stabilize.js +32 -0
- package/dist/node-types/genesis-check-stabilize.js.map +1 -0
- package/dist/node-types/genesis-check-threshold.d.ts +15 -0
- package/dist/node-types/genesis-check-threshold.d.ts.map +1 -0
- package/dist/node-types/genesis-check-threshold.js +29 -0
- package/dist/node-types/genesis-check-threshold.js.map +1 -0
- package/dist/node-types/genesis-commit.d.ts +17 -0
- package/dist/node-types/genesis-commit.d.ts.map +1 -0
- package/dist/node-types/genesis-commit.js +59 -0
- package/dist/node-types/genesis-commit.js.map +1 -0
- package/dist/node-types/genesis-compile-validate.d.ts +26 -0
- package/dist/node-types/genesis-compile-validate.d.ts.map +1 -0
- package/dist/node-types/genesis-compile-validate.js +60 -0
- package/dist/node-types/genesis-compile-validate.js.map +1 -0
- package/dist/node-types/genesis-diff-fingerprint.d.ts +15 -0
- package/dist/node-types/genesis-diff-fingerprint.d.ts.map +1 -0
- package/dist/node-types/genesis-diff-fingerprint.js +59 -0
- package/dist/node-types/genesis-diff-fingerprint.js.map +1 -0
- package/dist/node-types/genesis-diff-workflow.d.ts +15 -0
- package/dist/node-types/genesis-diff-workflow.d.ts.map +1 -0
- package/dist/node-types/genesis-diff-workflow.js +39 -0
- package/dist/node-types/genesis-diff-workflow.js.map +1 -0
- package/dist/node-types/genesis-load-config.d.ts +17 -0
- package/dist/node-types/genesis-load-config.d.ts.map +1 -0
- package/dist/node-types/genesis-load-config.js +35 -0
- package/dist/node-types/genesis-load-config.js.map +1 -0
- package/dist/node-types/genesis-observe.d.ts +18 -0
- package/dist/node-types/genesis-observe.d.ts.map +1 -0
- package/dist/node-types/genesis-observe.js +101 -0
- package/dist/node-types/genesis-observe.js.map +1 -0
- package/dist/node-types/genesis-propose.d.ts +17 -0
- package/dist/node-types/genesis-propose.d.ts.map +1 -0
- package/dist/node-types/genesis-propose.js +67 -0
- package/dist/node-types/genesis-propose.js.map +1 -0
- package/dist/node-types/genesis-report.d.ts +18 -0
- package/dist/node-types/genesis-report.d.ts.map +1 -0
- package/dist/node-types/genesis-report.js +61 -0
- package/dist/node-types/genesis-report.js.map +1 -0
- package/dist/node-types/genesis-snapshot.d.ts +15 -0
- package/dist/node-types/genesis-snapshot.d.ts.map +1 -0
- package/dist/node-types/genesis-snapshot.js +26 -0
- package/dist/node-types/genesis-snapshot.js.map +1 -0
- package/dist/node-types/genesis-try-apply.d.ts +18 -0
- package/dist/node-types/genesis-try-apply.d.ts.map +1 -0
- package/dist/node-types/genesis-try-apply.js +109 -0
- package/dist/node-types/genesis-try-apply.js.map +1 -0
- package/dist/node-types/genesis-update-history.d.ts +15 -0
- package/dist/node-types/genesis-update-history.d.ts.map +1 -0
- package/dist/node-types/genesis-update-history.js +57 -0
- package/dist/node-types/genesis-update-history.js.map +1 -0
- package/dist/node-types/genesis-validate-proposal.d.ts +16 -0
- package/dist/node-types/genesis-validate-proposal.d.ts.map +1 -0
- package/dist/node-types/genesis-validate-proposal.js +52 -0
- package/dist/node-types/genesis-validate-proposal.js.map +1 -0
- package/dist/node-types/git-ops.d.ts +5 -8
- package/dist/node-types/git-ops.d.ts.map +1 -1
- package/dist/node-types/git-ops.js +16 -14
- package/dist/node-types/git-ops.js.map +1 -1
- package/dist/node-types/index.d.ts +17 -0
- package/dist/node-types/index.d.ts.map +1 -1
- package/dist/node-types/index.js +17 -0
- package/dist/node-types/index.js.map +1 -1
- package/dist/node-types/load-config.d.ts +4 -2
- package/dist/node-types/load-config.d.ts.map +1 -1
- package/dist/node-types/load-config.js +3 -2
- package/dist/node-types/load-config.js.map +1 -1
- package/dist/node-types/plan-task.d.ts +5 -20
- package/dist/node-types/plan-task.d.ts.map +1 -1
- package/dist/node-types/plan-task.js +16 -85
- package/dist/node-types/plan-task.js.map +1 -1
- package/dist/node-types/read-workflow.d.ts +5 -20
- package/dist/node-types/read-workflow.d.ts.map +1 -1
- package/dist/node-types/read-workflow.js +16 -28
- package/dist/node-types/read-workflow.js.map +1 -1
- package/dist/node-types/receive-task.d.ts +9 -20
- package/dist/node-types/receive-task.d.ts.map +1 -1
- package/dist/node-types/receive-task.js +16 -19
- package/dist/node-types/receive-task.js.map +1 -1
- package/dist/node-types/report.d.ts +3 -4
- package/dist/node-types/report.d.ts.map +1 -1
- package/dist/node-types/report.js +6 -6
- package/dist/node-types/report.js.map +1 -1
- package/dist/node-types/resolve-target.d.ts +7 -15
- package/dist/node-types/resolve-target.d.ts.map +1 -1
- package/dist/node-types/resolve-target.js +47 -47
- package/dist/node-types/resolve-target.js.map +1 -1
- package/dist/node-types/route-task.d.ts +4 -16
- package/dist/node-types/route-task.d.ts.map +1 -1
- package/dist/node-types/route-task.js +6 -13
- package/dist/node-types/route-task.js.map +1 -1
- package/dist/node-types/send-notify.d.ts +5 -11
- package/dist/node-types/send-notify.d.ts.map +1 -1
- package/dist/node-types/send-notify.js +17 -24
- package/dist/node-types/send-notify.js.map +1 -1
- package/dist/node-types/validate-result.d.ts +11 -19
- package/dist/node-types/validate-result.d.ts.map +1 -1
- package/dist/node-types/validate-result.js +18 -33
- package/dist/node-types/validate-result.js.map +1 -1
- package/dist/workflows/genesis-task.d.ts +54 -0
- package/dist/workflows/genesis-task.d.ts.map +1 -0
- package/dist/workflows/genesis-task.js +56 -0
- package/dist/workflows/genesis-task.js.map +1 -0
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.d.ts.map +1 -1
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/weaver-bot-batch.d.ts +15 -26
- package/dist/workflows/weaver-bot-batch.d.ts.map +1 -1
- package/dist/workflows/weaver-bot-batch.js +15 -26
- package/dist/workflows/weaver-bot-batch.js.map +1 -1
- package/dist/workflows/weaver-bot.d.ts +18 -32
- package/dist/workflows/weaver-bot.d.ts.map +1 -1
- package/dist/workflows/weaver-bot.js +18 -32
- package/dist/workflows/weaver-bot.js.map +1 -1
- package/dist/workflows/weaver.d.ts +9 -9
- package/dist/workflows/weaver.js +9 -9
- package/flowweaver.manifest.json +493 -557
- package/package.json +3 -3
- package/dist/workflows/weaver-bot-session.d.ts +0 -65
- package/dist/workflows/weaver-bot-session.d.ts.map +0 -1
- package/dist/workflows/weaver-bot-session.js +0 -68
- package/dist/workflows/weaver-bot-session.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/node-types/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/node-types/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAW,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,UAAW,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG;QACZ,WAAW,MAAM,CAAC,OAAO,KAAK,OAAO,GAAG;QACxC,MAAM,CAAC,OAAO;KACf,CAAC;IACF,IAAI,MAAM,CAAC,aAAa;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
+
import type { WeaverEnv } from '../bot/types.js';
|
|
1
2
|
/**
|
|
2
3
|
* Find the target workflow file from config or by scanning the project directory.
|
|
4
|
+
* Creates the WeaverContext that threads through the pipeline.
|
|
3
5
|
*
|
|
4
6
|
* @flowWeaver nodeType
|
|
5
7
|
* @expression
|
|
6
8
|
* @label Resolve Target
|
|
7
|
-
* @input
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @input providerInfo [order:3] - Provider info (pass-through)
|
|
11
|
-
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
12
|
-
* @output config [order:1] - Config (pass-through)
|
|
13
|
-
* @output providerType [order:2] - Provider type (pass-through)
|
|
14
|
-
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
15
|
-
* @output targetPath [order:4] - Absolute path to target workflow
|
|
9
|
+
* @input env [order:0] - Weaver environment bundle
|
|
10
|
+
* @output ctx [order:0] - Weaver context (JSON)
|
|
11
|
+
* @output onFailure [hidden]
|
|
16
12
|
*/
|
|
17
|
-
export declare function weaverResolveTarget(
|
|
18
|
-
|
|
19
|
-
config: string;
|
|
20
|
-
providerType: string;
|
|
21
|
-
providerInfo: string;
|
|
22
|
-
targetPath: string;
|
|
13
|
+
export declare function weaverResolveTarget(env: WeaverEnv): {
|
|
14
|
+
ctx: string;
|
|
23
15
|
};
|
|
24
16
|
//# sourceMappingURL=resolve-target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-target.d.ts","sourceRoot":"","sources":["../../src/node-types/resolve-target.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-target.d.ts","sourceRoot":"","sources":["../../src/node-types/resolve-target.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,SAAS,GACb;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CA8CjB"}
|
|
@@ -2,66 +2,66 @@ import * as fs from 'node:fs';
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
/**
|
|
4
4
|
* Find the target workflow file from config or by scanning the project directory.
|
|
5
|
+
* Creates the WeaverContext that threads through the pipeline.
|
|
5
6
|
*
|
|
6
7
|
* @flowWeaver nodeType
|
|
7
8
|
* @expression
|
|
8
9
|
* @label Resolve Target
|
|
9
|
-
* @input
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
12
|
-
* @input providerInfo [order:3] - Provider info (pass-through)
|
|
13
|
-
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
14
|
-
* @output config [order:1] - Config (pass-through)
|
|
15
|
-
* @output providerType [order:2] - Provider type (pass-through)
|
|
16
|
-
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
17
|
-
* @output targetPath [order:4] - Absolute path to target workflow
|
|
10
|
+
* @input env [order:0] - Weaver environment bundle
|
|
11
|
+
* @output ctx [order:0] - Weaver context (JSON)
|
|
12
|
+
* @output onFailure [hidden]
|
|
18
13
|
*/
|
|
19
|
-
export function weaverResolveTarget(
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
export function weaverResolveTarget(env) {
|
|
15
|
+
const { projectDir, config } = env;
|
|
16
|
+
let targetPath;
|
|
17
|
+
if (config.target) {
|
|
18
|
+
const abs = path.resolve(projectDir, config.target);
|
|
23
19
|
if (!fs.existsSync(abs))
|
|
24
20
|
throw new Error(`Target workflow not found: ${abs}`);
|
|
25
21
|
console.log(`\x1b[36m→ Target: ${abs}\x1b[0m`);
|
|
26
|
-
|
|
22
|
+
targetPath = abs;
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
for (const entry of entries) {
|
|
40
|
-
if (entry.name.startsWith('.') || entry.name === 'node_modules')
|
|
41
|
-
continue;
|
|
42
|
-
const full = path.join(dir, entry.name);
|
|
43
|
-
if (entry.isDirectory()) {
|
|
44
|
-
scan(full, depth + 1);
|
|
24
|
+
else {
|
|
25
|
+
const found = [];
|
|
26
|
+
const scan = (dir, depth) => {
|
|
27
|
+
if (depth > 2)
|
|
28
|
+
return;
|
|
29
|
+
let entries;
|
|
30
|
+
try {
|
|
31
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return;
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules')
|
|
38
|
+
continue;
|
|
39
|
+
const full = path.join(dir, entry.name);
|
|
40
|
+
if (entry.isDirectory()) {
|
|
41
|
+
scan(full, depth + 1);
|
|
42
|
+
}
|
|
43
|
+
else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) {
|
|
44
|
+
try {
|
|
45
|
+
const content = fs.readFileSync(full, 'utf-8').slice(0, 2000);
|
|
46
|
+
if (content.includes('@flowWeaver workflow'))
|
|
47
|
+
found.push(full);
|
|
48
|
+
}
|
|
49
|
+
catch { /* skip */ }
|
|
51
50
|
}
|
|
52
|
-
catch { /* skip */ }
|
|
53
51
|
}
|
|
52
|
+
};
|
|
53
|
+
scan(projectDir, 0);
|
|
54
|
+
if (found.length === 0) {
|
|
55
|
+
throw new Error(`No workflow files found in ${projectDir}. Set "target" in .weaver.json or pass a file path.`);
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
throw new Error(`Multiple workflows found. Set "target" in .weaver.json to pick one:\n` +
|
|
62
|
-
found.map(f => ` - ${path.relative(projectDir, f)}`).join('\n'));
|
|
57
|
+
if (found.length > 1) {
|
|
58
|
+
throw new Error(`Multiple workflows found. Set "target" in .weaver.json to pick one:\n` +
|
|
59
|
+
found.map(f => ` - ${path.relative(projectDir, f)}`).join('\n'));
|
|
60
|
+
}
|
|
61
|
+
console.log(`\x1b[36m→ Target: ${found[0]}\x1b[0m`);
|
|
62
|
+
targetPath = found[0];
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
64
|
+
const context = { env, targetPath };
|
|
65
|
+
return { ctx: JSON.stringify(context) };
|
|
66
66
|
}
|
|
67
67
|
//# sourceMappingURL=resolve-target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-target.js","sourceRoot":"","sources":["../../src/node-types/resolve-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC
|
|
1
|
+
{"version":3,"file":"resolve-target.js","sourceRoot":"","sources":["../../src/node-types/resolve-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAc;IAEd,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAEnC,IAAI,UAAkB,CAAC;IAEvB,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,EAAE,CAAC,CAAC;QAC9E,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;QAC/C,UAAU,GAAG,GAAG,CAAC;IACnB,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,KAAa,EAAQ,EAAE;YACh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AAU,qDAAqD,CAAC,CAAC;QACjH,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,uEAAuE;gBACvE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACjE,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACpD,UAAU,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;IACzB,CAAC;IAED,MAAM,OAAO,GAAkB,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;IACnD,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -5,22 +5,10 @@
|
|
|
5
5
|
* @flowWeaver nodeType
|
|
6
6
|
* @expression
|
|
7
7
|
* @label Route Task
|
|
8
|
-
* @input
|
|
9
|
-
* @
|
|
10
|
-
* @input providerType [order:2] - Provider type
|
|
11
|
-
* @input providerInfo [order:3] - Provider info (JSON)
|
|
12
|
-
* @input taskJson [order:4] - Task (JSON)
|
|
13
|
-
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
14
|
-
* @output config [order:1] - Config (pass-through)
|
|
15
|
-
* @output providerType [order:2] - Provider type (pass-through)
|
|
16
|
-
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
17
|
-
* @output taskJson [order:4] - Task (pass-through)
|
|
8
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
9
|
+
* @output ctx [order:0] - Weaver context (pass-through, JSON)
|
|
18
10
|
*/
|
|
19
|
-
export declare function weaverRouteTask(
|
|
20
|
-
|
|
21
|
-
config: string;
|
|
22
|
-
providerType: string;
|
|
23
|
-
providerInfo: string;
|
|
24
|
-
taskJson: string;
|
|
11
|
+
export declare function weaverRouteTask(ctx: string): {
|
|
12
|
+
ctx: string;
|
|
25
13
|
};
|
|
26
14
|
//# sourceMappingURL=route-task.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-task.d.ts","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route-task.d.ts","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAY5D"}
|
|
@@ -5,25 +5,18 @@
|
|
|
5
5
|
* @flowWeaver nodeType
|
|
6
6
|
* @expression
|
|
7
7
|
* @label Route Task
|
|
8
|
-
* @input
|
|
9
|
-
* @
|
|
10
|
-
* @input providerType [order:2] - Provider type
|
|
11
|
-
* @input providerInfo [order:3] - Provider info (JSON)
|
|
12
|
-
* @input taskJson [order:4] - Task (JSON)
|
|
13
|
-
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
14
|
-
* @output config [order:1] - Config (pass-through)
|
|
15
|
-
* @output providerType [order:2] - Provider type (pass-through)
|
|
16
|
-
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
17
|
-
* @output taskJson [order:4] - Task (pass-through)
|
|
8
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
9
|
+
* @output ctx [order:0] - Weaver context (pass-through, JSON)
|
|
18
10
|
*/
|
|
19
|
-
export function weaverRouteTask(
|
|
20
|
-
const
|
|
11
|
+
export function weaverRouteTask(ctx) {
|
|
12
|
+
const context = JSON.parse(ctx);
|
|
13
|
+
const task = JSON.parse(context.taskJson);
|
|
21
14
|
const mode = task.mode ?? 'create';
|
|
22
15
|
if (mode === 'read') {
|
|
23
16
|
console.log('\x1b[36m→ Routing to read-only path\x1b[0m');
|
|
24
17
|
throw new Error('read-only-route');
|
|
25
18
|
}
|
|
26
19
|
console.log(`\x1b[36m→ Routing to ${mode} path\x1b[0m`);
|
|
27
|
-
return {
|
|
20
|
+
return { ctx };
|
|
28
21
|
}
|
|
29
22
|
//# sourceMappingURL=route-task.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-task.js","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route-task.js","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;IACjD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAS,CAAsB,CAAC;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;IAEnC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,cAAc,CAAC,CAAC;IACxD,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -4,17 +4,11 @@
|
|
|
4
4
|
* @flowWeaver nodeType
|
|
5
5
|
* @expression
|
|
6
6
|
* @label Notify Result
|
|
7
|
-
* @input
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @input resultJson [order:3] - Result (JSON)
|
|
11
|
-
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
12
|
-
* @output targetPath [order:1] - Target path (pass-through)
|
|
13
|
-
* @output resultJson [order:2] - Result (pass-through)
|
|
7
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
8
|
+
* @output ctx [order:0] - Weaver context (pass-through, JSON)
|
|
9
|
+
* @output onFailure [hidden]
|
|
14
10
|
*/
|
|
15
|
-
export declare function weaverSendNotify(
|
|
16
|
-
|
|
17
|
-
targetPath: string;
|
|
18
|
-
resultJson: string;
|
|
11
|
+
export declare function weaverSendNotify(ctx: string): {
|
|
12
|
+
ctx: string;
|
|
19
13
|
};
|
|
20
14
|
//# sourceMappingURL=send-notify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-notify.d.ts","sourceRoot":"","sources":["../../src/node-types/send-notify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"send-notify.d.ts","sourceRoot":"","sources":["../../src/node-types/send-notify.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAgB7D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { execSync } from 'node:child_process';
|
|
2
1
|
function sendWebhook(config, event) {
|
|
3
2
|
const headers = {
|
|
4
3
|
'content-type': 'application/json',
|
|
@@ -32,16 +31,12 @@ function sendWebhook(config, event) {
|
|
|
32
31
|
else {
|
|
33
32
|
body = JSON.stringify(event);
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
timeout: 10_000,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
catch { /* notification failure is non-fatal */ }
|
|
34
|
+
fetch(config.url, {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
headers,
|
|
37
|
+
body,
|
|
38
|
+
signal: AbortSignal.timeout(10_000),
|
|
39
|
+
}).catch(() => { });
|
|
45
40
|
}
|
|
46
41
|
/**
|
|
47
42
|
* Send webhook/Discord/Slack notifications based on config.
|
|
@@ -49,27 +44,25 @@ function sendWebhook(config, event) {
|
|
|
49
44
|
* @flowWeaver nodeType
|
|
50
45
|
* @expression
|
|
51
46
|
* @label Notify Result
|
|
52
|
-
* @input
|
|
53
|
-
* @
|
|
54
|
-
* @
|
|
55
|
-
* @input resultJson [order:3] - Result (JSON)
|
|
56
|
-
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
57
|
-
* @output targetPath [order:1] - Target path (pass-through)
|
|
58
|
-
* @output resultJson [order:2] - Result (pass-through)
|
|
47
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
48
|
+
* @output ctx [order:0] - Weaver context (pass-through, JSON)
|
|
49
|
+
* @output onFailure [hidden]
|
|
59
50
|
*/
|
|
60
|
-
export function weaverSendNotify(
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
51
|
+
export function weaverSendNotify(ctx) {
|
|
52
|
+
const context = JSON.parse(ctx);
|
|
53
|
+
const { env } = context;
|
|
54
|
+
const { config, projectDir } = env;
|
|
55
|
+
const result = context.resultJson ? JSON.parse(context.resultJson) : {};
|
|
56
|
+
const channels = (Array.isArray(config.notify) ? config.notify : config.notify ? [config.notify] : []);
|
|
64
57
|
for (const ch of channels) {
|
|
65
58
|
const events = ch.events ?? ['workflow-complete', 'error'];
|
|
66
59
|
const eventType = result.success ? 'workflow-complete' : 'error';
|
|
67
60
|
if (!events.includes(eventType))
|
|
68
61
|
continue;
|
|
69
|
-
sendWebhook(ch, { ...result, targetPath, providerType:
|
|
62
|
+
sendWebhook(ch, { ...result, targetPath: projectDir, providerType: config.provider, projectDir });
|
|
70
63
|
}
|
|
71
64
|
if (channels.length > 0)
|
|
72
65
|
console.log(`\x1b[36m→ Sent ${channels.length} notification(s)\x1b[0m`);
|
|
73
|
-
return {
|
|
66
|
+
return { ctx };
|
|
74
67
|
}
|
|
75
68
|
//# sourceMappingURL=send-notify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-notify.js","sourceRoot":"","sources":["../../src/node-types/send-notify.ts"],"names":[],"mapp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AAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEvG,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YAAE,SAAS;QAC1C,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,QAAQ,CAAC,MAAM,yBAAyB,CAAC,CAAC;IACjG,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WeaverEnv } from '../bot/types.js';
|
|
1
2
|
/**
|
|
2
3
|
* Validates all modified/created files using flow-weaver validate
|
|
3
4
|
* and compile. Branches on validation success/failure.
|
|
@@ -5,26 +6,17 @@
|
|
|
5
6
|
* @flowWeaver nodeType
|
|
6
7
|
* @expression
|
|
7
8
|
* @label Validate Result
|
|
8
|
-
* @input
|
|
9
|
-
* @input
|
|
10
|
-
* @input
|
|
11
|
-
* @input
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @output
|
|
16
|
-
* @output config [order:1] - Config (pass-through)
|
|
17
|
-
* @output providerType [order:2] - Provider type (pass-through)
|
|
18
|
-
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
19
|
-
* @output validationResultJson [order:4] - Validation results (JSON)
|
|
20
|
-
* @output taskJson [order:5] - Task (pass-through)
|
|
21
|
-
* @output allValid [order:6] - Whether all files passed validation
|
|
9
|
+
* @input env [order:0] - Weaver environment bundle
|
|
10
|
+
* @input executionResultJson [order:1] - Execution result (JSON)
|
|
11
|
+
* @input taskJson [order:2] - Task (JSON, pass-through)
|
|
12
|
+
* @input filesModified [order:3] - Files modified (JSON array)
|
|
13
|
+
* @output env [order:0] - Weaver environment bundle (pass-through)
|
|
14
|
+
* @output validationResultJson [order:1] - Validation results (JSON)
|
|
15
|
+
* @output taskJson [order:2] - Task (pass-through)
|
|
16
|
+
* @output allValid [order:3] - Whether all files passed validation
|
|
22
17
|
*/
|
|
23
|
-
export declare function weaverValidateResult(
|
|
24
|
-
|
|
25
|
-
config: string;
|
|
26
|
-
providerType: string;
|
|
27
|
-
providerInfo: string;
|
|
18
|
+
export declare function weaverValidateResult(env: WeaverEnv, executionResultJson: string, taskJson: string, filesModified: string): {
|
|
19
|
+
env: WeaverEnv;
|
|
28
20
|
validationResultJson: string;
|
|
29
21
|
taskJson: string;
|
|
30
22
|
allValid: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-result.d.ts","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-result.d.ts","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,SAAS,EACd,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB;IACD,GAAG,EAAE,SAAS,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;CACnE,CAqBA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { validateFiles } from '../bot/file-validator.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validates all modified/created files using flow-weaver validate
|
|
4
4
|
* and compile. Branches on validation success/failure.
|
|
@@ -6,46 +6,31 @@ import { execSync } from 'node:child_process';
|
|
|
6
6
|
* @flowWeaver nodeType
|
|
7
7
|
* @expression
|
|
8
8
|
* @label Validate Result
|
|
9
|
-
* @input
|
|
10
|
-
* @input
|
|
11
|
-
* @input
|
|
12
|
-
* @input
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
16
|
-
* @output
|
|
17
|
-
* @output config [order:1] - Config (pass-through)
|
|
18
|
-
* @output providerType [order:2] - Provider type (pass-through)
|
|
19
|
-
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
20
|
-
* @output validationResultJson [order:4] - Validation results (JSON)
|
|
21
|
-
* @output taskJson [order:5] - Task (pass-through)
|
|
22
|
-
* @output allValid [order:6] - Whether all files passed validation
|
|
9
|
+
* @input env [order:0] - Weaver environment bundle
|
|
10
|
+
* @input executionResultJson [order:1] - Execution result (JSON)
|
|
11
|
+
* @input taskJson [order:2] - Task (JSON, pass-through)
|
|
12
|
+
* @input filesModified [order:3] - Files modified (JSON array)
|
|
13
|
+
* @output env [order:0] - Weaver environment bundle (pass-through)
|
|
14
|
+
* @output validationResultJson [order:1] - Validation results (JSON)
|
|
15
|
+
* @output taskJson [order:2] - Task (pass-through)
|
|
16
|
+
* @output allValid [order:3] - Whether all files passed validation
|
|
23
17
|
*/
|
|
24
|
-
export function weaverValidateResult(
|
|
18
|
+
export function weaverValidateResult(env, executionResultJson, taskJson, filesModified) {
|
|
19
|
+
const { projectDir } = env;
|
|
25
20
|
const files = JSON.parse(filesModified);
|
|
26
|
-
const results =
|
|
27
|
-
for (const
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000,
|
|
33
|
-
});
|
|
34
|
-
results.push({ file, valid: true, errors: [], warnings: [] });
|
|
35
|
-
console.log(`\x1b[32m ✓ ${file}\x1b[0m`);
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
const stderr = err.stderr ?? (err instanceof Error ? err.message : String(err));
|
|
39
|
-
results.push({ file, valid: false, errors: [stderr], warnings: [] });
|
|
40
|
-
console.log(`\x1b[31m x ${file}: ${stderr.slice(0, 100)}\x1b[0m`);
|
|
41
|
-
}
|
|
21
|
+
const results = validateFiles(files, projectDir);
|
|
22
|
+
for (const r of results) {
|
|
23
|
+
if (r.valid)
|
|
24
|
+
console.log(`\x1b[32m ✓ ${r.file}\x1b[0m`);
|
|
25
|
+
else
|
|
26
|
+
console.log(`\x1b[31m x ${r.file}: ${r.errors[0]?.slice(0, 100)}\x1b[0m`);
|
|
42
27
|
}
|
|
43
28
|
const allValid = results.length === 0 || results.every(r => r.valid);
|
|
44
29
|
if (!allValid) {
|
|
45
30
|
throw new Error('Validation failed: ' + results.filter(r => !r.valid).map(r => r.file).join(', '));
|
|
46
31
|
}
|
|
47
32
|
return {
|
|
48
|
-
|
|
33
|
+
env,
|
|
49
34
|
validationResultJson: JSON.stringify(results),
|
|
50
35
|
taskJson, allValid,
|
|
51
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-result.js","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-result.js","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAc,EACd,mBAA2B,EAC3B,QAAgB,EAChB,aAAqB;IAKrB,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IAC3B,MAAM,KAAK,GAAa,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAEjD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC;;YACpD,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAErE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,OAAO;QACL,GAAG;QACH,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;QAC7C,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Genesis self-evolution cycle. Observes the project state, proposes workflow
|
|
3
|
+
* changes within a budget, validates and compiles with retry, then commits or
|
|
4
|
+
* rolls back based on approval.
|
|
5
|
+
*
|
|
6
|
+
* @flowWeaver workflow
|
|
7
|
+
*
|
|
8
|
+
* @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 200 200]
|
|
9
|
+
* @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 400 200]
|
|
10
|
+
* @node gCfg genesisLoadConfig [color: "purple"] [icon: "settings"] [position: 600 200]
|
|
11
|
+
* @node observe genesisObserve [color: "blue"] [icon: "visibility"] [position: 800 200]
|
|
12
|
+
* @node diffFp genesisDiffFingerprint [color: "cyan"] [icon: "compare"] [position: 1000 200]
|
|
13
|
+
* @node stabilize genesisCheckStabilize [color: "orange"] [icon: "lock"] [position: 1200 200]
|
|
14
|
+
* @node propose genesisPropose [color: "blue"] [icon: "psychology"] [position: 1400 200]
|
|
15
|
+
* @node validate genesisValidateProposal [color: "teal"] [icon: "check"] [position: 1600 200]
|
|
16
|
+
* @node snapshot genesisSnapshot [color: "cyan"] [icon: "backup"] [position: 1800 200]
|
|
17
|
+
* @node applyRetry genesisApplyRetry [color: "purple"] [icon: "replay"] [position: 2000 200] [size: 300 200]
|
|
18
|
+
* @node tryApply genesisTryApply applyRetry.attempt [position: 2050 230]
|
|
19
|
+
* @node diffWf genesisDiffWorkflow [color: "cyan"] [icon: "compare"] [position: 2340 200]
|
|
20
|
+
* @node threshold genesisCheckThreshold [color: "orange"] [icon: "tune"] [position: 2540 200]
|
|
21
|
+
* @node approve genesisApprove [color: "orange"] [icon: "send"] [position: 2740 200]
|
|
22
|
+
* @node commit genesisCommit [color: "green"] [icon: "save"] [position: 2940 200]
|
|
23
|
+
* @node history genesisUpdateHistory [color: "teal"] [icon: "history"] [position: 3140 200]
|
|
24
|
+
* @node report genesisReport [color: "green"] [icon: "description"] [position: 3340 200]
|
|
25
|
+
*
|
|
26
|
+
* @path Start -> cfg -> detect -> gCfg -> observe -> diffFp -> stabilize -> propose -> validate -> snapshot -> applyRetry -> diffWf -> threshold -> approve -> commit -> history -> report -> Exit
|
|
27
|
+
*
|
|
28
|
+
* @path applyRetry:fail -> report
|
|
29
|
+
*
|
|
30
|
+
* @connect applyRetry.attemptCtx:attempt -> tryApply.ctx
|
|
31
|
+
* @connect tryApply.ctx -> applyRetry.attemptCtx:attempt
|
|
32
|
+
*
|
|
33
|
+
* @connect history.ctx -> report.successCtx
|
|
34
|
+
* @connect applyRetry.ctx -> report.failCtx
|
|
35
|
+
*
|
|
36
|
+
* @connect report.summary -> Exit.summary
|
|
37
|
+
*
|
|
38
|
+
* @position Start 0 200
|
|
39
|
+
* @position Exit 3540 200
|
|
40
|
+
*
|
|
41
|
+
* @param execute [order:-1] - Execute
|
|
42
|
+
* @param projectDir [order:0] [optional] - Project directory
|
|
43
|
+
* @returns onSuccess [order:-2] - On Success
|
|
44
|
+
* @returns onFailure [order:-1] [hidden] - On Failure
|
|
45
|
+
* @returns summary [order:0] - Summary text
|
|
46
|
+
*/
|
|
47
|
+
export declare function genesisTask(execute: boolean, params?: {
|
|
48
|
+
projectDir?: string;
|
|
49
|
+
}, __abortSignal__?: AbortSignal): Promise<{
|
|
50
|
+
onSuccess: boolean;
|
|
51
|
+
onFailure: boolean;
|
|
52
|
+
summary: string | null;
|
|
53
|
+
}>;
|
|
54
|
+
//# sourceMappingURL=genesis-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-task.d.ts","sourceRoot":"","sources":["../../src/workflows/genesis-task.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,MAAM,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,EACpC,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAK7E"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Genesis self-evolution workflow. Observes the project, proposes changes
|
|
2
|
+
// to a target workflow, validates + compiles with retry, and commits or
|
|
3
|
+
// rolls back.
|
|
4
|
+
/**
|
|
5
|
+
* Genesis self-evolution cycle. Observes the project state, proposes workflow
|
|
6
|
+
* changes within a budget, validates and compiles with retry, then commits or
|
|
7
|
+
* rolls back based on approval.
|
|
8
|
+
*
|
|
9
|
+
* @flowWeaver workflow
|
|
10
|
+
*
|
|
11
|
+
* @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 200 200]
|
|
12
|
+
* @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 400 200]
|
|
13
|
+
* @node gCfg genesisLoadConfig [color: "purple"] [icon: "settings"] [position: 600 200]
|
|
14
|
+
* @node observe genesisObserve [color: "blue"] [icon: "visibility"] [position: 800 200]
|
|
15
|
+
* @node diffFp genesisDiffFingerprint [color: "cyan"] [icon: "compare"] [position: 1000 200]
|
|
16
|
+
* @node stabilize genesisCheckStabilize [color: "orange"] [icon: "lock"] [position: 1200 200]
|
|
17
|
+
* @node propose genesisPropose [color: "blue"] [icon: "psychology"] [position: 1400 200]
|
|
18
|
+
* @node validate genesisValidateProposal [color: "teal"] [icon: "check"] [position: 1600 200]
|
|
19
|
+
* @node snapshot genesisSnapshot [color: "cyan"] [icon: "backup"] [position: 1800 200]
|
|
20
|
+
* @node applyRetry genesisApplyRetry [color: "purple"] [icon: "replay"] [position: 2000 200] [size: 300 200]
|
|
21
|
+
* @node tryApply genesisTryApply applyRetry.attempt [position: 2050 230]
|
|
22
|
+
* @node diffWf genesisDiffWorkflow [color: "cyan"] [icon: "compare"] [position: 2340 200]
|
|
23
|
+
* @node threshold genesisCheckThreshold [color: "orange"] [icon: "tune"] [position: 2540 200]
|
|
24
|
+
* @node approve genesisApprove [color: "orange"] [icon: "send"] [position: 2740 200]
|
|
25
|
+
* @node commit genesisCommit [color: "green"] [icon: "save"] [position: 2940 200]
|
|
26
|
+
* @node history genesisUpdateHistory [color: "teal"] [icon: "history"] [position: 3140 200]
|
|
27
|
+
* @node report genesisReport [color: "green"] [icon: "description"] [position: 3340 200]
|
|
28
|
+
*
|
|
29
|
+
* @path Start -> cfg -> detect -> gCfg -> observe -> diffFp -> stabilize -> propose -> validate -> snapshot -> applyRetry -> diffWf -> threshold -> approve -> commit -> history -> report -> Exit
|
|
30
|
+
*
|
|
31
|
+
* @path applyRetry:fail -> report
|
|
32
|
+
*
|
|
33
|
+
* @connect applyRetry.attemptCtx:attempt -> tryApply.ctx
|
|
34
|
+
* @connect tryApply.ctx -> applyRetry.attemptCtx:attempt
|
|
35
|
+
*
|
|
36
|
+
* @connect history.ctx -> report.successCtx
|
|
37
|
+
* @connect applyRetry.ctx -> report.failCtx
|
|
38
|
+
*
|
|
39
|
+
* @connect report.summary -> Exit.summary
|
|
40
|
+
*
|
|
41
|
+
* @position Start 0 200
|
|
42
|
+
* @position Exit 3540 200
|
|
43
|
+
*
|
|
44
|
+
* @param execute [order:-1] - Execute
|
|
45
|
+
* @param projectDir [order:0] [optional] - Project directory
|
|
46
|
+
* @returns onSuccess [order:-2] - On Success
|
|
47
|
+
* @returns onFailure [order:-1] [hidden] - On Failure
|
|
48
|
+
* @returns summary [order:0] - Summary text
|
|
49
|
+
*/
|
|
50
|
+
export async function genesisTask(execute, params = {}, __abortSignal__) {
|
|
51
|
+
// @flow-weaver-body-start
|
|
52
|
+
// (auto-generated by compiler)
|
|
53
|
+
// @flow-weaver-body-end
|
|
54
|
+
return { onSuccess: false, onFailure: true, summary: null };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=genesis-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-task.js","sourceRoot":"","sources":["../../src/workflows/genesis-task.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,cAAc;AAoBd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAgB,EAChB,SAAkC,EAAE,EACpC,eAA6B;IAE7B,0BAA0B;IAC1B,+BAA+B;IAC/B,wBAAwB;IACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9D,CAAC"}
|