@synergenius/flowweaver-pack-weaver 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +46 -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 +16 -1
- package/dist/bot/cli-provider.d.ts.map +1 -1
- package/dist/bot/cli-provider.js +10 -0
- 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/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 +52 -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 +1 -1
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-check-threshold.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-check-threshold.ts"],"names":[],"mappings":"AASA;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAalE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const IMPACT_ORDER = {
|
|
2
|
+
COSMETIC: 0,
|
|
3
|
+
MINOR: 1,
|
|
4
|
+
BREAKING: 2,
|
|
5
|
+
CRITICAL: 3,
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Compares the proposal's impact level against the configured approval
|
|
9
|
+
* threshold to decide if human approval is required.
|
|
10
|
+
*
|
|
11
|
+
* @flowWeaver nodeType
|
|
12
|
+
* @expression
|
|
13
|
+
* @label Genesis Check Threshold
|
|
14
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
15
|
+
* @output ctx [order:0] - Genesis context with approvalRequired (JSON)
|
|
16
|
+
* @output onFailure [hidden]
|
|
17
|
+
*/
|
|
18
|
+
export function genesisCheckThreshold(ctx) {
|
|
19
|
+
const context = JSON.parse(ctx);
|
|
20
|
+
const config = JSON.parse(context.genesisConfigJson);
|
|
21
|
+
const proposal = JSON.parse(context.proposalJson);
|
|
22
|
+
const proposalLevel = IMPACT_ORDER[proposal.impactLevel] ?? 0;
|
|
23
|
+
const thresholdLevel = IMPACT_ORDER[config.approvalThreshold] ?? 0;
|
|
24
|
+
const approvalRequired = proposalLevel >= thresholdLevel;
|
|
25
|
+
console.log(`\x1b[36m→ Impact ${proposal.impactLevel} vs threshold ${config.approvalThreshold}: approval ${approvalRequired ? 'required' : 'not required'}\x1b[0m`);
|
|
26
|
+
context.approvalRequired = approvalRequired;
|
|
27
|
+
return { ctx: JSON.stringify(context) };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=genesis-check-threshold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-check-threshold.js","sourceRoot":"","sources":["../../src/node-types/genesis-check-threshold.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAuC;IACvD,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;CACZ,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAkB,CAAC;IACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAa,CAAoB,CAAC;IAEtE,MAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,gBAAgB,GAAG,aAAa,IAAI,cAAc,CAAC;IAEzD,OAAO,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,WAAW,iBAAiB,MAAM,CAAC,iBAAiB,cAAc,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,SAAS,CAAC,CAAC;IAEpK,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC5C,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commits the modified workflow to git if approved, or restores from
|
|
3
|
+
* the snapshot if rejected. Commit messages are prefixed with "genesis:".
|
|
4
|
+
*
|
|
5
|
+
* @flowWeaver nodeType
|
|
6
|
+
* @label Genesis Commit
|
|
7
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
8
|
+
* @output ctx [order:0] - Genesis context with commitResultJson (JSON)
|
|
9
|
+
* @output onSuccess [order:-2] - On Success
|
|
10
|
+
* @output onFailure [order:-1] [hidden] - On Failure
|
|
11
|
+
*/
|
|
12
|
+
export declare function genesisCommit(execute: boolean, ctx: string): Promise<{
|
|
13
|
+
onSuccess: boolean;
|
|
14
|
+
onFailure: boolean;
|
|
15
|
+
ctx: string;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=genesis-commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-commit.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-commit.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CA+CD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { GenesisStore } from '../bot/genesis-store.js';
|
|
5
|
+
/**
|
|
6
|
+
* Commits the modified workflow to git if approved, or restores from
|
|
7
|
+
* the snapshot if rejected. Commit messages are prefixed with "genesis:".
|
|
8
|
+
*
|
|
9
|
+
* @flowWeaver nodeType
|
|
10
|
+
* @label Genesis Commit
|
|
11
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
12
|
+
* @output ctx [order:0] - Genesis context with commitResultJson (JSON)
|
|
13
|
+
* @output onSuccess [order:-2] - On Success
|
|
14
|
+
* @output onFailure [order:-1] [hidden] - On Failure
|
|
15
|
+
*/
|
|
16
|
+
export async function genesisCommit(execute, ctx) {
|
|
17
|
+
const context = JSON.parse(ctx);
|
|
18
|
+
if (!execute) {
|
|
19
|
+
context.commitResultJson = JSON.stringify({ committed: false, reason: 'dry run' });
|
|
20
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
21
|
+
}
|
|
22
|
+
const { env } = context;
|
|
23
|
+
const config = JSON.parse(context.genesisConfigJson);
|
|
24
|
+
const targetPath = path.resolve(env.projectDir, config.targetWorkflow);
|
|
25
|
+
if (!context.approved) {
|
|
26
|
+
// Restore from snapshot
|
|
27
|
+
const store = new GenesisStore(env.projectDir);
|
|
28
|
+
const snapshot = store.loadSnapshot(context.snapshotPath);
|
|
29
|
+
if (snapshot) {
|
|
30
|
+
fs.writeFileSync(targetPath, snapshot, 'utf-8');
|
|
31
|
+
console.log('\x1b[33m→ Restored from snapshot (not approved)\x1b[0m');
|
|
32
|
+
}
|
|
33
|
+
context.commitResultJson = JSON.stringify({ committed: false, reason: 'not approved' });
|
|
34
|
+
return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
execFileSync('git', ['add', targetPath], {
|
|
38
|
+
cwd: env.projectDir,
|
|
39
|
+
encoding: 'utf-8',
|
|
40
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
41
|
+
});
|
|
42
|
+
const message = `genesis: evolve ${path.basename(config.targetWorkflow)}`;
|
|
43
|
+
execFileSync('git', ['commit', '-m', message], {
|
|
44
|
+
cwd: env.projectDir,
|
|
45
|
+
encoding: 'utf-8',
|
|
46
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
47
|
+
});
|
|
48
|
+
console.log(`\x1b[32m→ Committed: ${message}\x1b[0m`);
|
|
49
|
+
context.commitResultJson = JSON.stringify({ committed: true, message });
|
|
50
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
54
|
+
console.error(`\x1b[31m→ Commit failed: ${msg}\x1b[0m`);
|
|
55
|
+
context.commitResultJson = JSON.stringify({ committed: false, reason: msg });
|
|
56
|
+
return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=genesis-commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-commit.js","sourceRoot":"","sources":["../../src/node-types/genesis-commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAgB,EAChB,GAAW;IAKX,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;IAElD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QACnF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IACxB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAkB,CAAC;IACtE,MAAM,UAAU,GAAG,IA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M,CAAC;SAChC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,wBAAwB,OAAO,SAAS,CAAC,CAAC;QACtD,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACxE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7E,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,KAAK,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAC;QACxD,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { WeaverEnv } from '../bot/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Runs flow-weaver validate and compile on the target workflow after
|
|
4
|
+
* operations have been applied. On failure, restores from the snapshot
|
|
5
|
+
* and fires the failure path.
|
|
6
|
+
*
|
|
7
|
+
* @flowWeaver nodeType
|
|
8
|
+
* @label Genesis Compile & Validate
|
|
9
|
+
* @input env [order:0] - Weaver environment bundle
|
|
10
|
+
* @input genesisConfigJson [order:1] - Genesis configuration (JSON)
|
|
11
|
+
* @input snapshotPath [order:2] - Path to the pre-apply snapshot
|
|
12
|
+
* @input applyResultJson [order:3] - Apply result (JSON)
|
|
13
|
+
* @output env [order:0] - Weaver environment bundle (pass-through)
|
|
14
|
+
* @output genesisConfigJson [order:1] - Genesis configuration (pass-through)
|
|
15
|
+
* @output snapshotPath [order:2] - Path to the snapshot (pass-through)
|
|
16
|
+
* @output onSuccess [order:-2] - On Success
|
|
17
|
+
* @output onFailure [order:-1] - On Failure
|
|
18
|
+
*/
|
|
19
|
+
export declare function genesisCompileValidate(execute: boolean, env: WeaverEnv, genesisConfigJson: string, snapshotPath: string, applyResultJson: string): Promise<{
|
|
20
|
+
onSuccess: boolean;
|
|
21
|
+
onFailure: boolean;
|
|
22
|
+
env: WeaverEnv;
|
|
23
|
+
genesisConfigJson: string;
|
|
24
|
+
snapshotPath: string;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=genesis-compile-validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-compile-validate.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-compile-validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAGhE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,SAAS,EACd,iBAAiB,EAAE,MAAM,EACzB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,GAAG,EAAE,SAAS,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CA0CD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { GenesisStore } from '../bot/genesis-store.js';
|
|
5
|
+
/**
|
|
6
|
+
* Runs flow-weaver validate and compile on the target workflow after
|
|
7
|
+
* operations have been applied. On failure, restores from the snapshot
|
|
8
|
+
* and fires the failure path.
|
|
9
|
+
*
|
|
10
|
+
* @flowWeaver nodeType
|
|
11
|
+
* @label Genesis Compile & Validate
|
|
12
|
+
* @input env [order:0] - Weaver environment bundle
|
|
13
|
+
* @input genesisConfigJson [order:1] - Genesis configuration (JSON)
|
|
14
|
+
* @input snapshotPath [order:2] - Path to the pre-apply snapshot
|
|
15
|
+
* @input applyResultJson [order:3] - Apply result (JSON)
|
|
16
|
+
* @output env [order:0] - Weaver environment bundle (pass-through)
|
|
17
|
+
* @output genesisConfigJson [order:1] - Genesis configuration (pass-through)
|
|
18
|
+
* @output snapshotPath [order:2] - Path to the snapshot (pass-through)
|
|
19
|
+
* @output onSuccess [order:-2] - On Success
|
|
20
|
+
* @output onFailure [order:-1] - On Failure
|
|
21
|
+
*/
|
|
22
|
+
export async function genesisCompileValidate(execute, env, genesisConfigJson, snapshotPath, applyResultJson) {
|
|
23
|
+
if (!execute) {
|
|
24
|
+
return { onSuccess: true, onFailure: false, env, genesisConfigJson, snapshotPath };
|
|
25
|
+
}
|
|
26
|
+
const config = JSON.parse(genesisConfigJson);
|
|
27
|
+
const targetPath = path.resolve(env.projectDir, config.targetWorkflow);
|
|
28
|
+
try {
|
|
29
|
+
// Validate
|
|
30
|
+
execFileSync('flow-weaver', ['validate', targetPath], {
|
|
31
|
+
cwd: env.projectDir,
|
|
32
|
+
encoding: 'utf-8',
|
|
33
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
34
|
+
timeout: 30_000,
|
|
35
|
+
});
|
|
36
|
+
console.log('\x1b[32m→ Validation passed\x1b[0m');
|
|
37
|
+
// Compile
|
|
38
|
+
execFileSync('flow-weaver', ['compile', targetPath], {
|
|
39
|
+
cwd: env.projectDir,
|
|
40
|
+
encoding: 'utf-8',
|
|
41
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
42
|
+
timeout: 60_000,
|
|
43
|
+
});
|
|
44
|
+
console.log('\x1b[32m→ Compilation passed\x1b[0m');
|
|
45
|
+
return { onSuccess: true, onFailure: false, env, genesisConfigJson, snapshotPath };
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
49
|
+
console.error(`\x1b[31m→ Compile/validate failed: ${msg}\x1b[0m`);
|
|
50
|
+
// Restore from snapshot
|
|
51
|
+
const store = new GenesisStore(env.projectDir);
|
|
52
|
+
const snapshot = store.loadSnapshot(snapshotPath);
|
|
53
|
+
if (snapshot) {
|
|
54
|
+
fs.writeFileSync(targetPath, snapshot, 'utf-8');
|
|
55
|
+
console.log('\x1b[33m→ Restored from snapshot\x1b[0m');
|
|
56
|
+
}
|
|
57
|
+
return { onSuccess: false, onFailure: true, env, genesisConfigJson, snapshotPath };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=genesis-compile-validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-compile-validate.js","sourceRoot":"","sources":["../../src/node-types/genesis-compile-validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAgB,EAChB,GAAc,EACd,iBAAyB,EACzB,YAAoB,EACpB,eAAuB;IAOvB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;IACrF,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AG,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,QAAQ,EAAE,CAAC;YACb,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;IACrF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares the current project fingerprint against the last saved one,
|
|
3
|
+
* producing a diff summary of file and state changes.
|
|
4
|
+
*
|
|
5
|
+
* @flowWeaver nodeType
|
|
6
|
+
* @expression
|
|
7
|
+
* @label Genesis Diff Fingerprint
|
|
8
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
9
|
+
* @output ctx [order:0] - Genesis context with diffJson (JSON)
|
|
10
|
+
* @output onFailure [hidden]
|
|
11
|
+
*/
|
|
12
|
+
export declare function genesisDiffFingerprint(ctx: string): {
|
|
13
|
+
ctx: string;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=genesis-diff-fingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-diff-fingerprint.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-diff-fingerprint.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAoDnE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { GenesisStore } from '../bot/genesis-store.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compares the current project fingerprint against the last saved one,
|
|
4
|
+
* producing a diff summary of file and state changes.
|
|
5
|
+
*
|
|
6
|
+
* @flowWeaver nodeType
|
|
7
|
+
* @expression
|
|
8
|
+
* @label Genesis Diff Fingerprint
|
|
9
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
10
|
+
* @output ctx [order:0] - Genesis context with diffJson (JSON)
|
|
11
|
+
* @output onFailure [hidden]
|
|
12
|
+
*/
|
|
13
|
+
export function genesisDiffFingerprint(ctx) {
|
|
14
|
+
const context = JSON.parse(ctx);
|
|
15
|
+
const { env } = context;
|
|
16
|
+
const store = new GenesisStore(env.projectDir);
|
|
17
|
+
const current = JSON.parse(context.fingerprintJson);
|
|
18
|
+
const last = store.getLastFingerprint();
|
|
19
|
+
const addedFiles = [];
|
|
20
|
+
const removedFiles = [];
|
|
21
|
+
const modifiedFiles = [];
|
|
22
|
+
let gitChanged = false;
|
|
23
|
+
let workflowsChanged = false;
|
|
24
|
+
if (!last) {
|
|
25
|
+
const diff = {
|
|
26
|
+
addedFiles: Object.keys(current.files),
|
|
27
|
+
removedFiles: [],
|
|
28
|
+
modifiedFiles: [],
|
|
29
|
+
gitChanged: true,
|
|
30
|
+
workflowsChanged: true,
|
|
31
|
+
};
|
|
32
|
+
context.diffJson = JSON.stringify(diff);
|
|
33
|
+
return { ctx: JSON.stringify(context) };
|
|
34
|
+
}
|
|
35
|
+
for (const [file, hash] of Object.entries(current.files)) {
|
|
36
|
+
if (!(file in last.files)) {
|
|
37
|
+
addedFiles.push(file);
|
|
38
|
+
}
|
|
39
|
+
else if (last.files[file] !== hash) {
|
|
40
|
+
modifiedFiles.push(file);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const file of Object.keys(last.files)) {
|
|
44
|
+
if (!(file in current.files)) {
|
|
45
|
+
removedFiles.push(file);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
gitChanged = current.gitBranch !== last.gitBranch || current.gitCommit !== last.gitCommit;
|
|
49
|
+
const currentWfs = [...current.existingWorkflows].sort().join(',');
|
|
50
|
+
const lastWfs = [...last.existingWorkflows].sort().join(',');
|
|
51
|
+
workflowsChanged = currentWfs !== lastWfs || current.workflowHash !== last.workflowHash;
|
|
52
|
+
const diff = { addedFiles, removedFiles, modifiedFiles, gitChanged, workflowsChanged };
|
|
53
|
+
const hasChanges = addedFiles.length > 0 || removedFiles.length > 0 ||
|
|
54
|
+
modifiedFiles.length > 0 || gitChanged || workflowsChanged;
|
|
55
|
+
console.log(`\x1b[36m→ Diff: +${addedFiles.length} -${removedFiles.length} ~${modifiedFiles.length}, git=${gitChanged}, wf=${workflowsChanged}\x1b[0m`);
|
|
56
|
+
context.diffJson = JSON.stringify(diff);
|
|
57
|
+
return { ctx: JSON.stringify(context) };
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=genesis-diff-fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-diff-fingerprint.js","sourceRoot":"","sources":["../../src/node-types/genesis-diff-fingerprint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;IAClD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IACxB,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAgB,CAAuB,CAAC;IAC3E,MAAM,IAAI,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;IAExC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,IAAI,CAAC,IAAI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;IACnE,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7D,gBAAgB,GAAG,UAAU,KAAK,OAAO,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC,YAAY,CAAC;IAExF,MAAM,IAAI,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IACvF,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC;QACjE,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,IAAI,gBAAgB,CAAC;IAE7D,OAAO,CAAC,GAAG,CAAC,oBAAoB,UAAU,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM,KAAK,aAAa,CAAC,MAAM,SAAS,UAAU,QAAQ,gBAAgB,SAAS,CAAC,CAAC;IAExJ,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs flow-weaver diff between the snapshot and the current target
|
|
3
|
+
* workflow to produce a human-readable diff of workflow changes.
|
|
4
|
+
*
|
|
5
|
+
* @flowWeaver nodeType
|
|
6
|
+
* @expression
|
|
7
|
+
* @label Genesis Diff Workflow
|
|
8
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
9
|
+
* @output ctx [order:0] - Genesis context with workflowDiffJson (JSON)
|
|
10
|
+
* @output onFailure [hidden]
|
|
11
|
+
*/
|
|
12
|
+
export declare function genesisDiffWorkflow(ctx: string): {
|
|
13
|
+
ctx: string;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=genesis-diff-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-diff-workflow.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-diff-workflow.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CA0BhE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
/**
|
|
4
|
+
* Runs flow-weaver diff between the snapshot and the current target
|
|
5
|
+
* workflow to produce a human-readable diff of workflow changes.
|
|
6
|
+
*
|
|
7
|
+
* @flowWeaver nodeType
|
|
8
|
+
* @expression
|
|
9
|
+
* @label Genesis Diff Workflow
|
|
10
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
11
|
+
* @output ctx [order:0] - Genesis context with workflowDiffJson (JSON)
|
|
12
|
+
* @output onFailure [hidden]
|
|
13
|
+
*/
|
|
14
|
+
export function genesisDiffWorkflow(ctx) {
|
|
15
|
+
const context = JSON.parse(ctx);
|
|
16
|
+
const config = JSON.parse(context.genesisConfigJson);
|
|
17
|
+
const targetPath = path.resolve(context.env.projectDir, config.targetWorkflow);
|
|
18
|
+
let diffOutput = '';
|
|
19
|
+
try {
|
|
20
|
+
diffOutput = execFileSync('flow-weaver', ['diff', context.snapshotPath, targetPath], {
|
|
21
|
+
cwd: context.env.projectDir,
|
|
22
|
+
encoding: 'utf-8',
|
|
23
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
24
|
+
timeout: 30_000,
|
|
25
|
+
}).trim();
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
if (err && typeof err === 'object' && 'stdout' in err) {
|
|
29
|
+
diffOutput = String(err.stdout).trim();
|
|
30
|
+
}
|
|
31
|
+
if (!diffOutput) {
|
|
32
|
+
diffOutput = 'Unable to produce diff';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
console.log(`\x1b[36m→ Workflow diff: ${diffOutput.split('\n').length} lines\x1b[0m`);
|
|
36
|
+
context.workflowDiffJson = JSON.stringify({ diff: diffOutput });
|
|
37
|
+
return { ctx: JSON.stringify(context) };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=genesis-diff-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-diff-workflow.js","sourceRoot":"","sources":["../../src/node-types/genesis-diff-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAkB,CAAC;IACtE,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAE/E,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,UAAU,GAAG,YAAY,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAa,EAAE,UAAU,CAAC,EAAE;YACpF,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;YAC3B,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;YAC/B,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;YACtD,UAAU,GAAG,MAAM,CAAE,GAA0B,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACjE,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,UAAU,GAAG,wBAAwB,CAAC;QACxC,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,4BAA4B,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,eAAe,CAAC,CAAC;IAEtF,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAChE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { WeaverEnv } from '../bot/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Loads genesis configuration from the project .genesis directory,
|
|
4
|
+
* validates the target workflow exists, and generates a new cycle ID.
|
|
5
|
+
* Creates the initial GenesisContext that threads through the pipeline.
|
|
6
|
+
*
|
|
7
|
+
* @flowWeaver nodeType
|
|
8
|
+
* @expression
|
|
9
|
+
* @label Genesis Load Config
|
|
10
|
+
* @input env [order:0] - Weaver environment bundle
|
|
11
|
+
* @output ctx [order:0] - Genesis context (JSON)
|
|
12
|
+
* @output onFailure [hidden]
|
|
13
|
+
*/
|
|
14
|
+
export declare function genesisLoadConfig(env: WeaverEnv): {
|
|
15
|
+
ctx: string;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=genesis-load-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-load-config.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-load-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAiC,MAAM,iBAAiB,CAAC;AAGhF;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,SAAS,GAAG;IACjD,GAAG,EAAE,MAAM,CAAC;CACb,CAuBA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { GenesisStore } from '../bot/genesis-store.js';
|
|
4
|
+
/**
|
|
5
|
+
* Loads genesis configuration from the project .genesis directory,
|
|
6
|
+
* validates the target workflow exists, and generates a new cycle ID.
|
|
7
|
+
* Creates the initial GenesisContext that threads through the pipeline.
|
|
8
|
+
*
|
|
9
|
+
* @flowWeaver nodeType
|
|
10
|
+
* @expression
|
|
11
|
+
* @label Genesis Load Config
|
|
12
|
+
* @input env [order:0] - Weaver environment bundle
|
|
13
|
+
* @output ctx [order:0] - Genesis context (JSON)
|
|
14
|
+
* @output onFailure [hidden]
|
|
15
|
+
*/
|
|
16
|
+
export function genesisLoadConfig(env) {
|
|
17
|
+
const store = new GenesisStore(env.projectDir);
|
|
18
|
+
const config = store.loadConfig();
|
|
19
|
+
if (!config.targetWorkflow) {
|
|
20
|
+
throw new Error('Genesis config has no targetWorkflow set. Run "weaver genesis --init" and set it in .genesis/config.json');
|
|
21
|
+
}
|
|
22
|
+
const targetPath = path.resolve(env.projectDir, config.targetWorkflow);
|
|
23
|
+
if (!fs.existsSync(targetPath) || !fs.statSync(targetPath).isFile()) {
|
|
24
|
+
throw new Error(`Target workflow not found: ${targetPath}`);
|
|
25
|
+
}
|
|
26
|
+
const cycleId = GenesisStore.newCycleId();
|
|
27
|
+
console.log(`\x1b[36m→ Genesis config loaded, cycle ${cycleId}\x1b[0m`);
|
|
28
|
+
const ctx = {
|
|
29
|
+
env,
|
|
30
|
+
genesisConfigJson: JSON.stringify(config),
|
|
31
|
+
cycleId,
|
|
32
|
+
};
|
|
33
|
+
return { ctx: JSON.stringify(ctx) };
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=genesis-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
|
+
/**
|
|
2
|
+
* Fingerprints the project state: hashes .ts files, reads package.json,
|
|
3
|
+
* captures git branch/commit, scans for workflow files, and hashes the
|
|
4
|
+
* target workflow content.
|
|
5
|
+
*
|
|
6
|
+
* @flowWeaver nodeType
|
|
7
|
+
* @label Genesis Observe
|
|
8
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
9
|
+
* @output ctx [order:0] - Genesis context with fingerprintJson (JSON)
|
|
10
|
+
* @output onSuccess [order:-2] - On Success
|
|
11
|
+
* @output onFailure [order:-1] [hidden] - On Failure
|
|
12
|
+
*/
|
|
13
|
+
export declare function genesisObserve(execute: boolean, ctx: string): Promise<{
|
|
14
|
+
onSuccess: boolean;
|
|
15
|
+
onFailure: boolean;
|
|
16
|
+
ctx: string;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=genesis-observe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-observe.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-observe.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CA2FD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as crypto from 'node:crypto';
|
|
4
|
+
import { execFileSync } from 'node:child_process';
|
|
5
|
+
/**
|
|
6
|
+
* Fingerprints the project state: hashes .ts files, reads package.json,
|
|
7
|
+
* captures git branch/commit, scans for workflow files, and hashes the
|
|
8
|
+
* target workflow content.
|
|
9
|
+
*
|
|
10
|
+
* @flowWeaver nodeType
|
|
11
|
+
* @label Genesis Observe
|
|
12
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
13
|
+
* @output ctx [order:0] - Genesis context with fingerprintJson (JSON)
|
|
14
|
+
* @output onSuccess [order:-2] - On Success
|
|
15
|
+
* @output onFailure [order:-1] [hidden] - On Failure
|
|
16
|
+
*/
|
|
17
|
+
export async function genesisObserve(execute, ctx) {
|
|
18
|
+
const context = JSON.parse(ctx);
|
|
19
|
+
const { env } = context;
|
|
20
|
+
const config = JSON.parse(context.genesisConfigJson);
|
|
21
|
+
if (!execute) {
|
|
22
|
+
const empty = {
|
|
23
|
+
timestamp: new Date().toISOString(),
|
|
24
|
+
files: {},
|
|
25
|
+
packageJson: null,
|
|
26
|
+
gitBranch: null,
|
|
27
|
+
gitCommit: null,
|
|
28
|
+
workflowHash: '',
|
|
29
|
+
existingWorkflows: [],
|
|
30
|
+
};
|
|
31
|
+
context.fingerprintJson = JSON.stringify(empty);
|
|
32
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
33
|
+
}
|
|
34
|
+
const projectDir = env.projectDir;
|
|
35
|
+
try {
|
|
36
|
+
const files = {};
|
|
37
|
+
const dirsToScan = [projectDir];
|
|
38
|
+
const srcDir = path.join(projectDir, 'src');
|
|
39
|
+
if (fs.existsSync(srcDir) && fs.statSync(srcDir).isDirectory())
|
|
40
|
+
dirsToScan.push(srcDir);
|
|
41
|
+
for (const dir of dirsToScan) {
|
|
42
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
43
|
+
for (const entry of entries) {
|
|
44
|
+
if (entry.isFile() && entry.name.endsWith('.ts')) {
|
|
45
|
+
const filePath = path.join(dir, entry.name);
|
|
46
|
+
const relPath = path.relative(projectDir, filePath);
|
|
47
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
48
|
+
files[relPath] = crypto.createHash('sha256').update(content).digest('hex');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
let packageJson = null;
|
|
53
|
+
const pkgPath = path.join(projectDir, 'package.json');
|
|
54
|
+
if (fs.existsSync(pkgPath)) {
|
|
55
|
+
packageJson = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
56
|
+
}
|
|
57
|
+
let gitBranch = null;
|
|
58
|
+
let gitCommit = null;
|
|
59
|
+
try {
|
|
60
|
+
gitBranch = execFileSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], {
|
|
61
|
+
cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'],
|
|
62
|
+
}).trim();
|
|
63
|
+
gitCommit = execFileSync('git', ['rev-parse', 'HEAD'], {
|
|
64
|
+
cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'],
|
|
65
|
+
}).trim();
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Not a git repo or git unavailable
|
|
69
|
+
}
|
|
70
|
+
const existingWorkflows = [];
|
|
71
|
+
for (const [relPath, _hash] of Object.entries(files)) {
|
|
72
|
+
const filePath = path.join(projectDir, relPath);
|
|
73
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
74
|
+
if (content.includes('@flowWeaver workflow')) {
|
|
75
|
+
existingWorkflows.push(relPath);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const targetPath = path.resolve(projectDir, config.targetWorkflow);
|
|
79
|
+
const targetContent = fs.readFileSync(targetPath, 'utf-8');
|
|
80
|
+
const workflowHash = crypto.createHash('sha256').update(targetContent).digest('hex');
|
|
81
|
+
const fingerprint = {
|
|
82
|
+
timestamp: new Date().toISOString(),
|
|
83
|
+
files,
|
|
84
|
+
packageJson,
|
|
85
|
+
gitBranch,
|
|
86
|
+
gitCommit,
|
|
87
|
+
workflowHash,
|
|
88
|
+
existingWorkflows,
|
|
89
|
+
};
|
|
90
|
+
console.log(`\x1b[36m→ Fingerprint: ${Object.keys(files).length} files, ${existingWorkflows.length} workflows\x1b[0m`);
|
|
91
|
+
context.fingerprintJson = JSON.stringify(fingerprint);
|
|
92
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
96
|
+
console.error(`\x1b[31m→ Observe failed: ${msg}\x1b[0m`);
|
|
97
|
+
context.fingerprintJson = '{}';
|
|
98
|
+
return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=genesis-observe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-observe.js","sourceRoot":"","sources":["../../src/node-types/genesis-observe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAgB,EAChB,GAAW;IAKX,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;IAClD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IACxB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAErD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,KAAK,GAAuB;YAChC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,KAAK,EAAE,EAAE;YACT,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,EAAE;SACtB,CAAC;QACF,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChD,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K,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sends project context and diff information to the AI provider, which
|
|
3
|
+
* returns a structured proposal of workflow operations to apply.
|
|
4
|
+
*
|
|
5
|
+
* @flowWeaver nodeType
|
|
6
|
+
* @label Genesis Propose
|
|
7
|
+
* @input ctx [order:0] - Genesis context (JSON)
|
|
8
|
+
* @output ctx [order:0] - Genesis context with proposalJson (JSON)
|
|
9
|
+
* @output onSuccess [order:-2] - On Success
|
|
10
|
+
* @output onFailure [order:-1] [hidden] - On Failure
|
|
11
|
+
*/
|
|
12
|
+
export declare function genesisPropose(execute: boolean, ctx: string): Promise<{
|
|
13
|
+
onSuccess: boolean;
|
|
14
|
+
onFailure: boolean;
|
|
15
|
+
ctx: string;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=genesis-propose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-propose.d.ts","sourceRoot":"","sources":["../../src/node-types/genesis-propose.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CAiED"}
|