@synergenius/flow-weaver-pack-weaver 0.8.1
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/LICENSE +204 -0
- package/README.md +167 -0
- package/dist/bot/agent-provider.d.ts +34 -0
- package/dist/bot/agent-provider.d.ts.map +1 -0
- package/dist/bot/agent-provider.js +218 -0
- package/dist/bot/agent-provider.js.map +1 -0
- package/dist/bot/ai-client.d.ts +15 -0
- package/dist/bot/ai-client.d.ts.map +1 -0
- package/dist/bot/ai-client.js +128 -0
- package/dist/bot/ai-client.js.map +1 -0
- package/dist/bot/approvals.d.ts +22 -0
- package/dist/bot/approvals.d.ts.map +1 -0
- package/dist/bot/approvals.js +187 -0
- package/dist/bot/approvals.js.map +1 -0
- package/dist/bot/audit-logger.d.ts +5 -0
- package/dist/bot/audit-logger.d.ts.map +1 -0
- package/dist/bot/audit-logger.js +42 -0
- package/dist/bot/audit-logger.js.map +1 -0
- package/dist/bot/audit-store.d.ts +13 -0
- package/dist/bot/audit-store.d.ts.map +1 -0
- package/dist/bot/audit-store.js +59 -0
- package/dist/bot/audit-store.js.map +1 -0
- package/dist/bot/bot-agent-channel.d.ts +46 -0
- package/dist/bot/bot-agent-channel.d.ts.map +1 -0
- package/dist/bot/bot-agent-channel.js +58 -0
- package/dist/bot/bot-agent-channel.js.map +1 -0
- package/dist/bot/cli-provider.d.ts +29 -0
- package/dist/bot/cli-provider.d.ts.map +1 -0
- package/dist/bot/cli-provider.js +132 -0
- package/dist/bot/cli-provider.js.map +1 -0
- package/dist/bot/cli-stream-parser.d.ts +11 -0
- package/dist/bot/cli-stream-parser.d.ts.map +1 -0
- package/dist/bot/cli-stream-parser.js +53 -0
- package/dist/bot/cli-stream-parser.js.map +1 -0
- package/dist/bot/cost-store.d.ts +18 -0
- package/dist/bot/cost-store.d.ts.map +1 -0
- package/dist/bot/cost-store.js +81 -0
- package/dist/bot/cost-store.js.map +1 -0
- package/dist/bot/cost-tracker.d.ts +18 -0
- package/dist/bot/cost-tracker.d.ts.map +1 -0
- package/dist/bot/cost-tracker.js +60 -0
- package/dist/bot/cost-tracker.js.map +1 -0
- package/dist/bot/cron-parser.d.ts +5 -0
- package/dist/bot/cron-parser.d.ts.map +1 -0
- package/dist/bot/cron-parser.js +141 -0
- package/dist/bot/cron-parser.js.map +1 -0
- package/dist/bot/cron-scheduler.d.ts +12 -0
- package/dist/bot/cron-scheduler.d.ts.map +1 -0
- package/dist/bot/cron-scheduler.js +43 -0
- package/dist/bot/cron-scheduler.js.map +1 -0
- package/dist/bot/dashboard.d.ts +34 -0
- package/dist/bot/dashboard.d.ts.map +1 -0
- package/dist/bot/dashboard.js +602 -0
- package/dist/bot/dashboard.js.map +1 -0
- package/dist/bot/design-checker.d.ts +24 -0
- package/dist/bot/design-checker.d.ts.map +1 -0
- package/dist/bot/design-checker.js +269 -0
- package/dist/bot/design-checker.js.map +1 -0
- 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 +10 -0
- package/dist/bot/file-validator.d.ts.map +1 -0
- package/dist/bot/file-validator.js +27 -0
- package/dist/bot/file-validator.js.map +1 -0
- package/dist/bot/file-watcher.d.ts +24 -0
- package/dist/bot/file-watcher.d.ts.map +1 -0
- package/dist/bot/file-watcher.js +98 -0
- package/dist/bot/file-watcher.js.map +1 -0
- package/dist/bot/fw-api.d.ts +8 -0
- package/dist/bot/fw-api.d.ts.map +1 -0
- package/dist/bot/fw-api.js +12 -0
- package/dist/bot/fw-api.js.map +1 -0
- package/dist/bot/genesis-prompt-context.d.ts +31 -0
- package/dist/bot/genesis-prompt-context.d.ts.map +1 -0
- package/dist/bot/genesis-prompt-context.js +121 -0
- package/dist/bot/genesis-prompt-context.js.map +1 -0
- package/dist/bot/genesis-store.d.ts +28 -0
- package/dist/bot/genesis-store.d.ts.map +1 -0
- package/dist/bot/genesis-store.js +154 -0
- package/dist/bot/genesis-store.js.map +1 -0
- package/dist/bot/index.d.ts +38 -0
- package/dist/bot/index.d.ts.map +1 -0
- package/dist/bot/index.js +37 -0
- package/dist/bot/index.js.map +1 -0
- package/dist/bot/notifications.d.ts +20 -0
- package/dist/bot/notifications.d.ts.map +1 -0
- package/dist/bot/notifications.js +215 -0
- package/dist/bot/notifications.js.map +1 -0
- package/dist/bot/pipeline-runner.d.ts +22 -0
- package/dist/bot/pipeline-runner.d.ts.map +1 -0
- package/dist/bot/pipeline-runner.js +263 -0
- package/dist/bot/pipeline-runner.js.map +1 -0
- package/dist/bot/provider-registry.d.ts +26 -0
- package/dist/bot/provider-registry.d.ts.map +1 -0
- package/dist/bot/provider-registry.js +175 -0
- package/dist/bot/provider-registry.js.map +1 -0
- package/dist/bot/run-store.d.ts +25 -0
- package/dist/bot/run-store.d.ts.map +1 -0
- package/dist/bot/run-store.js +156 -0
- package/dist/bot/run-store.js.map +1 -0
- package/dist/bot/runner.d.ts +13 -0
- package/dist/bot/runner.d.ts.map +1 -0
- package/dist/bot/runner.js +244 -0
- package/dist/bot/runner.js.map +1 -0
- package/dist/bot/session-state.d.ts +19 -0
- package/dist/bot/session-state.d.ts.map +1 -0
- package/dist/bot/session-state.js +65 -0
- package/dist/bot/session-state.js.map +1 -0
- package/dist/bot/steering.d.ts +13 -0
- package/dist/bot/steering.d.ts.map +1 -0
- package/dist/bot/steering.js +40 -0
- package/dist/bot/steering.js.map +1 -0
- package/dist/bot/step-executor.d.ts +10 -0
- package/dist/bot/step-executor.d.ts.map +1 -0
- package/dist/bot/step-executor.js +30 -0
- package/dist/bot/step-executor.js.map +1 -0
- package/dist/bot/system-prompt.d.ts +19 -0
- package/dist/bot/system-prompt.d.ts.map +1 -0
- package/dist/bot/system-prompt.js +222 -0
- package/dist/bot/system-prompt.js.map +1 -0
- package/dist/bot/task-queue.d.ts +26 -0
- package/dist/bot/task-queue.d.ts.map +1 -0
- package/dist/bot/task-queue.js +98 -0
- package/dist/bot/task-queue.js.map +1 -0
- package/dist/bot/types.d.ts +478 -0
- package/dist/bot/types.d.ts.map +1 -0
- package/dist/bot/types.js +2 -0
- package/dist/bot/types.js.map +1 -0
- package/dist/bot/utils.d.ts +2 -0
- package/dist/bot/utils.d.ts.map +1 -0
- package/dist/bot/utils.js +20 -0
- package/dist/bot/utils.js.map +1 -0
- package/dist/bot/watch-daemon.d.ts +19 -0
- package/dist/bot/watch-daemon.d.ts.map +1 -0
- package/dist/bot/watch-daemon.js +178 -0
- package/dist/bot/watch-daemon.js.map +1 -0
- package/dist/bot/web-approval.d.ts +19 -0
- package/dist/bot/web-approval.d.ts.map +1 -0
- package/dist/bot/web-approval.js +207 -0
- package/dist/bot/web-approval.js.map +1 -0
- package/dist/cli-bridge.d.ts +2 -0
- package/dist/cli-bridge.d.ts.map +1 -0
- package/dist/cli-bridge.js +30 -0
- package/dist/cli-bridge.js.map +1 -0
- package/dist/cli-handlers.d.ts +79 -0
- package/dist/cli-handlers.d.ts.map +1 -0
- package/dist/cli-handlers.js +1335 -0
- package/dist/cli-handlers.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +749 -0
- package/dist/cli.js.map +1 -0
- package/dist/docs/docs/weaver-config.md +135 -0
- package/dist/docs/weaver-config.md +141 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-tools.d.ts +13 -0
- package/dist/mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools.js +197 -0
- package/dist/mcp-tools.js.map +1 -0
- package/dist/node-types/abort-task.d.ts +15 -0
- package/dist/node-types/abort-task.d.ts.map +1 -0
- package/dist/node-types/abort-task.js +28 -0
- package/dist/node-types/abort-task.js.map +1 -0
- package/dist/node-types/approval-gate.d.ts +18 -0
- package/dist/node-types/approval-gate.d.ts.map +1 -0
- package/dist/node-types/approval-gate.js +80 -0
- package/dist/node-types/approval-gate.js.map +1 -0
- package/dist/node-types/bot-report.d.ts +20 -0
- package/dist/node-types/bot-report.d.ts.map +1 -0
- package/dist/node-types/bot-report.js +67 -0
- package/dist/node-types/bot-report.js.map +1 -0
- package/dist/node-types/build-context.d.ts +16 -0
- package/dist/node-types/build-context.d.ts.map +1 -0
- package/dist/node-types/build-context.js +64 -0
- package/dist/node-types/build-context.js.map +1 -0
- package/dist/node-types/detect-provider.d.ts +17 -0
- package/dist/node-types/detect-provider.d.ts.map +1 -0
- package/dist/node-types/detect-provider.js +71 -0
- package/dist/node-types/detect-provider.js.map +1 -0
- package/dist/node-types/exec-validate-retry.d.ts +17 -0
- package/dist/node-types/exec-validate-retry.d.ts.map +1 -0
- package/dist/node-types/exec-validate-retry.js +147 -0
- package/dist/node-types/exec-validate-retry.js.map +1 -0
- package/dist/node-types/execute-plan.d.ts +26 -0
- package/dist/node-types/execute-plan.d.ts.map +1 -0
- package/dist/node-types/execute-plan.js +120 -0
- package/dist/node-types/execute-plan.js.map +1 -0
- package/dist/node-types/execute-target.d.ts +16 -0
- package/dist/node-types/execute-target.d.ts.map +1 -0
- package/dist/node-types/execute-target.js +238 -0
- package/dist/node-types/execute-target.js.map +1 -0
- package/dist/node-types/fix-errors.d.ts +24 -0
- package/dist/node-types/fix-errors.d.ts.map +1 -0
- package/dist/node-types/fix-errors.js +49 -0
- package/dist/node-types/fix-errors.js.map +1 -0
- package/dist/node-types/genesis-apply-retry.d.ts +27 -0
- package/dist/node-types/genesis-apply-retry.d.ts.map +1 -0
- package/dist/node-types/genesis-apply-retry.js +97 -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 +59 -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 +67 -0
- package/dist/node-types/genesis-diff-workflow.js.map +1 -0
- package/dist/node-types/genesis-escrow-grace.d.ts +15 -0
- package/dist/node-types/genesis-escrow-grace.d.ts.map +1 -0
- package/dist/node-types/genesis-escrow-grace.js +52 -0
- package/dist/node-types/genesis-escrow-grace.js.map +1 -0
- package/dist/node-types/genesis-escrow-migrate.d.ts +21 -0
- package/dist/node-types/genesis-escrow-migrate.d.ts.map +1 -0
- package/dist/node-types/genesis-escrow-migrate.js +116 -0
- package/dist/node-types/genesis-escrow-migrate.js.map +1 -0
- package/dist/node-types/genesis-escrow-recover.d.ts +15 -0
- package/dist/node-types/genesis-escrow-recover.d.ts.map +1 -0
- package/dist/node-types/genesis-escrow-recover.js +90 -0
- package/dist/node-types/genesis-escrow-recover.js.map +1 -0
- package/dist/node-types/genesis-escrow-stage.d.ts +17 -0
- package/dist/node-types/genesis-escrow-stage.d.ts.map +1 -0
- package/dist/node-types/genesis-escrow-stage.js +86 -0
- package/dist/node-types/genesis-escrow-stage.js.map +1 -0
- package/dist/node-types/genesis-escrow-validate.d.ts +17 -0
- package/dist/node-types/genesis-escrow-validate.d.ts.map +1 -0
- package/dist/node-types/genesis-escrow-validate.js +110 -0
- package/dist/node-types/genesis-escrow-validate.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 +36 -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 +103 -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 +69 -0
- package/dist/node-types/genesis-propose.js.map +1 -0
- package/dist/node-types/genesis-report.d.ts +20 -0
- package/dist/node-types/genesis-report.d.ts.map +1 -0
- package/dist/node-types/genesis-report.js +87 -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 +142 -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 +70 -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 +109 -0
- package/dist/node-types/genesis-validate-proposal.js.map +1 -0
- package/dist/node-types/git-ops.d.ts +15 -0
- package/dist/node-types/git-ops.d.ts.map +1 -0
- package/dist/node-types/git-ops.js +69 -0
- package/dist/node-types/git-ops.js.map +1 -0
- package/dist/node-types/index.d.ts +37 -0
- package/dist/node-types/index.d.ts.map +1 -0
- package/dist/node-types/index.js +37 -0
- package/dist/node-types/index.js.map +1 -0
- package/dist/node-types/load-config.d.ts +17 -0
- package/dist/node-types/load-config.d.ts.map +1 -0
- package/dist/node-types/load-config.js +27 -0
- package/dist/node-types/load-config.js.map +1 -0
- package/dist/node-types/plan-task.d.ts +17 -0
- package/dist/node-types/plan-task.d.ts.map +1 -0
- package/dist/node-types/plan-task.js +55 -0
- package/dist/node-types/plan-task.js.map +1 -0
- package/dist/node-types/read-workflow.d.ts +15 -0
- package/dist/node-types/read-workflow.d.ts.map +1 -0
- package/dist/node-types/read-workflow.js +60 -0
- package/dist/node-types/read-workflow.js.map +1 -0
- package/dist/node-types/receive-task.d.ts +20 -0
- package/dist/node-types/receive-task.d.ts.map +1 -0
- package/dist/node-types/receive-task.js +69 -0
- package/dist/node-types/receive-task.js.map +1 -0
- package/dist/node-types/report.d.ts +14 -0
- package/dist/node-types/report.d.ts.map +1 -0
- package/dist/node-types/report.js +25 -0
- package/dist/node-types/report.js.map +1 -0
- package/dist/node-types/resolve-target.d.ts +16 -0
- package/dist/node-types/resolve-target.d.ts.map +1 -0
- package/dist/node-types/resolve-target.js +67 -0
- package/dist/node-types/resolve-target.js.map +1 -0
- package/dist/node-types/route-task.d.ts +14 -0
- package/dist/node-types/route-task.d.ts.map +1 -0
- package/dist/node-types/route-task.js +22 -0
- package/dist/node-types/route-task.js.map +1 -0
- package/dist/node-types/send-notify.d.ts +14 -0
- package/dist/node-types/send-notify.d.ts.map +1 -0
- package/dist/node-types/send-notify.js +71 -0
- package/dist/node-types/send-notify.js.map +1 -0
- package/dist/node-types/validate-result.d.ts +24 -0
- package/dist/node-types/validate-result.d.ts.map +1 -0
- package/dist/node-types/validate-result.js +38 -0
- package/dist/node-types/validate-result.js.map +1 -0
- package/dist/templates/index.d.ts +5 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +4 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/weaver-bot-template.d.ts +11 -0
- package/dist/templates/weaver-bot-template.d.ts.map +1 -0
- package/dist/templates/weaver-bot-template.js +99 -0
- package/dist/templates/weaver-bot-template.js.map +1 -0
- package/dist/templates/weaver-template.d.ts +11 -0
- package/dist/templates/weaver-template.d.ts.map +1 -0
- package/dist/templates/weaver-template.js +53 -0
- package/dist/templates/weaver-template.js.map +1 -0
- package/dist/workflows/genesis-task.d.ts +62 -0
- package/dist/workflows/genesis-task.d.ts.map +1 -0
- package/dist/workflows/genesis-task.js +64 -0
- package/dist/workflows/genesis-task.js.map +1 -0
- package/dist/workflows/index.d.ts +4 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +4 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/weaver-bot-batch.d.ts +49 -0
- package/dist/workflows/weaver-bot-batch.d.ts.map +1 -0
- package/dist/workflows/weaver-bot-batch.js +49 -0
- package/dist/workflows/weaver-bot-batch.js.map +1 -0
- package/dist/workflows/weaver-bot-session.d.ts +65 -0
- package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
- package/dist/workflows/weaver-bot-session.js +68 -0
- package/dist/workflows/weaver-bot-session.js.map +1 -0
- package/dist/workflows/weaver-bot.d.ts +61 -0
- package/dist/workflows/weaver-bot.d.ts.map +1 -0
- package/dist/workflows/weaver-bot.js +61 -0
- package/dist/workflows/weaver-bot.js.map +1 -0
- package/dist/workflows/weaver.d.ts +24 -0
- package/dist/workflows/weaver.d.ts.map +1 -0
- package/dist/workflows/weaver.js +28 -0
- package/dist/workflows/weaver.js.map +1 -0
- package/flowweaver.manifest.json +1001 -0
- package/package.json +78 -0
- package/src/bot/agent-provider.ts +273 -0
- package/src/bot/ai-client.ts +153 -0
- package/src/bot/approvals.ts +273 -0
- package/src/bot/audit-logger.ts +45 -0
- package/src/bot/audit-store.ts +69 -0
- package/src/bot/bot-agent-channel.ts +99 -0
- package/src/bot/cli-provider.ts +169 -0
- package/src/bot/cli-stream-parser.ts +59 -0
- package/src/bot/cost-store.ts +92 -0
- package/src/bot/cost-tracker.ts +72 -0
- package/src/bot/cron-parser.ts +153 -0
- package/src/bot/cron-scheduler.ts +48 -0
- package/src/bot/dashboard.ts +658 -0
- package/src/bot/design-checker.ts +327 -0
- package/src/bot/file-lock.ts +73 -0
- package/src/bot/file-validator.ts +41 -0
- package/src/bot/file-watcher.ts +103 -0
- package/src/bot/fw-api.ts +18 -0
- package/src/bot/genesis-prompt-context.ts +135 -0
- package/src/bot/genesis-store.ts +180 -0
- package/src/bot/index.ts +127 -0
- package/src/bot/notifications.ts +263 -0
- package/src/bot/pipeline-runner.ts +324 -0
- package/src/bot/provider-registry.ts +236 -0
- package/src/bot/run-store.ts +169 -0
- package/src/bot/runner.ts +311 -0
- package/src/bot/session-state.ts +73 -0
- package/src/bot/steering.ts +44 -0
- package/src/bot/step-executor.ts +34 -0
- package/src/bot/system-prompt.ts +280 -0
- package/src/bot/task-queue.ts +111 -0
- package/src/bot/types.ts +571 -0
- package/src/bot/utils.ts +17 -0
- package/src/bot/watch-daemon.ts +203 -0
- package/src/bot/web-approval.ts +240 -0
- package/src/cli-bridge.ts +41 -0
- package/src/cli-handlers.ts +1445 -0
- package/src/docs/weaver-config.md +135 -0
- package/src/index.ts +177 -0
- package/src/mcp-tools.ts +274 -0
- package/src/node-types/abort-task.ts +31 -0
- package/src/node-types/approval-gate.ts +95 -0
- package/src/node-types/bot-report.ts +82 -0
- package/src/node-types/build-context.ts +65 -0
- package/src/node-types/detect-provider.ts +77 -0
- package/src/node-types/exec-validate-retry.ts +170 -0
- package/src/node-types/execute-plan.ts +130 -0
- package/src/node-types/execute-target.ts +256 -0
- package/src/node-types/fix-errors.ts +63 -0
- package/src/node-types/genesis-apply-retry.ts +133 -0
- package/src/node-types/genesis-apply.ts +96 -0
- package/src/node-types/genesis-approve.ts +73 -0
- package/src/node-types/genesis-check-stabilize.ts +37 -0
- package/src/node-types/genesis-check-threshold.ts +34 -0
- package/src/node-types/genesis-commit.ts +71 -0
- package/src/node-types/genesis-compile-validate.ts +77 -0
- package/src/node-types/genesis-diff-fingerprint.ts +67 -0
- package/src/node-types/genesis-diff-workflow.ts +71 -0
- package/src/node-types/genesis-escrow-grace.ts +62 -0
- package/src/node-types/genesis-escrow-migrate.ts +138 -0
- package/src/node-types/genesis-escrow-recover.ts +99 -0
- package/src/node-types/genesis-escrow-stage.ts +104 -0
- package/src/node-types/genesis-escrow-validate.ts +120 -0
- package/src/node-types/genesis-load-config.ts +44 -0
- package/src/node-types/genesis-observe.ts +119 -0
- package/src/node-types/genesis-propose.ts +86 -0
- package/src/node-types/genesis-report.ts +95 -0
- package/src/node-types/genesis-snapshot.ts +30 -0
- package/src/node-types/genesis-try-apply.ts +165 -0
- package/src/node-types/genesis-update-history.ts +72 -0
- package/src/node-types/genesis-validate-proposal.ts +124 -0
- package/src/node-types/git-ops.ts +72 -0
- package/src/node-types/index.ts +36 -0
- package/src/node-types/load-config.ts +27 -0
- package/src/node-types/plan-task.ts +66 -0
- package/src/node-types/read-workflow.ts +68 -0
- package/src/node-types/receive-task.ts +92 -0
- package/src/node-types/report.ts +25 -0
- package/src/node-types/resolve-target.ts +64 -0
- package/src/node-types/route-task.ts +25 -0
- package/src/node-types/send-notify.ts +75 -0
- package/src/node-types/validate-result.ts +49 -0
- package/src/templates/index.ts +5 -0
- package/src/templates/weaver-bot-template.ts +106 -0
- package/src/workflows/genesis-task.ts +91 -0
- package/src/workflows/index.ts +3 -0
- package/src/workflows/weaver-bot-batch.ts +65 -0
- package/src/workflows/weaver-bot.ts +79 -0
- package/templates.js +1 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as os from 'node:os';
|
|
4
|
+
import type { WeaverEnv, WeaverContext } from '../bot/types.js';
|
|
5
|
+
|
|
6
|
+
interface QueuedTask {
|
|
7
|
+
id: string;
|
|
8
|
+
instruction: string;
|
|
9
|
+
mode?: 'create' | 'modify' | 'read' | 'batch';
|
|
10
|
+
targets?: string[];
|
|
11
|
+
options?: Record<string, unknown>;
|
|
12
|
+
priority: number;
|
|
13
|
+
addedAt: number;
|
|
14
|
+
status: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Receives a task from CLI args, MCP tool call, or the task queue.
|
|
19
|
+
* Parses the instruction into a structured BotTask. Creates the
|
|
20
|
+
* WeaverContext that threads through the bot pipeline.
|
|
21
|
+
*
|
|
22
|
+
* @flowWeaver nodeType
|
|
23
|
+
* @label Receive Task
|
|
24
|
+
* @input env [order:0] - Weaver environment bundle
|
|
25
|
+
* @input [taskJson] [order:1] - Pre-supplied task (JSON, optional)
|
|
26
|
+
* @output ctx [order:0] - Weaver context (JSON)
|
|
27
|
+
* @output onSuccess [order:-2] - On Success
|
|
28
|
+
* @output onFailure [order:-1] [hidden] - On Failure
|
|
29
|
+
*/
|
|
30
|
+
export async function weaverReceiveTask(
|
|
31
|
+
execute: boolean,
|
|
32
|
+
env: WeaverEnv,
|
|
33
|
+
taskJson?: string,
|
|
34
|
+
): Promise<{
|
|
35
|
+
onSuccess: boolean; onFailure: boolean;
|
|
36
|
+
ctx: string;
|
|
37
|
+
}> {
|
|
38
|
+
const context: WeaverContext = { env, taskJson: '{}', hasTask: false };
|
|
39
|
+
|
|
40
|
+
if (!execute) {
|
|
41
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// If taskJson is pre-supplied, use it directly
|
|
45
|
+
if (taskJson) {
|
|
46
|
+
try {
|
|
47
|
+
const parsed = JSON.parse(taskJson);
|
|
48
|
+
if (parsed.instruction) {
|
|
49
|
+
console.log(`\x1b[36m→ Task received: ${parsed.instruction.slice(0, 80)}\x1b[0m`);
|
|
50
|
+
context.taskJson = taskJson;
|
|
51
|
+
context.hasTask = true;
|
|
52
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
53
|
+
}
|
|
54
|
+
} catch { /* fall through to queue check */ }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Check task queue
|
|
58
|
+
const queuePath = path.join(os.homedir(), '.weaver', 'task-queue.ndjson');
|
|
59
|
+
try {
|
|
60
|
+
if (fs.existsSync(queuePath)) {
|
|
61
|
+
const content = fs.readFileSync(queuePath, 'utf-8').trim();
|
|
62
|
+
if (content) {
|
|
63
|
+
const tasks: QueuedTask[] = content.split('\n').map(l => JSON.parse(l));
|
|
64
|
+
const pending = tasks
|
|
65
|
+
.filter(t => t.status === 'pending')
|
|
66
|
+
.sort((a, b) => b.priority - a.priority || a.addedAt - b.addedAt);
|
|
67
|
+
|
|
68
|
+
if (pending.length > 0) {
|
|
69
|
+
const task = pending[0]!;
|
|
70
|
+
// Mark as running
|
|
71
|
+
const updated = tasks.map(t => t.id === task.id ? { ...t, status: 'running' } : t);
|
|
72
|
+
fs.writeFileSync(queuePath, updated.map(t => JSON.stringify(t)).join('\n') + '\n', 'utf-8');
|
|
73
|
+
|
|
74
|
+
const botTask = {
|
|
75
|
+
instruction: task.instruction,
|
|
76
|
+
mode: task.mode ?? 'create',
|
|
77
|
+
targets: task.targets,
|
|
78
|
+
options: task.options,
|
|
79
|
+
queueId: task.id,
|
|
80
|
+
};
|
|
81
|
+
console.log(`\x1b[36m→ Task from queue [${task.id}]: ${task.instruction.slice(0, 80)}\x1b[0m`);
|
|
82
|
+
context.taskJson = JSON.stringify(botTask);
|
|
83
|
+
context.hasTask = true;
|
|
84
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} catch { /* ignore queue errors */ }
|
|
89
|
+
|
|
90
|
+
console.log('\x1b[33m→ No task found\x1b[0m');
|
|
91
|
+
return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
|
|
92
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import type { WeaverContext } from '../bot/types.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Format the result summary, suitable for display or further processing.
|
|
6
|
+
*
|
|
7
|
+
* @flowWeaver nodeType
|
|
8
|
+
* @expression
|
|
9
|
+
* @label Report
|
|
10
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
11
|
+
* @output summary [order:0] - Summary string
|
|
12
|
+
* @output onFailure [hidden]
|
|
13
|
+
*/
|
|
14
|
+
export function weaverReport(ctx: string): { summary: string } {
|
|
15
|
+
const context = JSON.parse(ctx) as WeaverContext;
|
|
16
|
+
const result = JSON.parse(context.resultJson!);
|
|
17
|
+
const relPath = path.relative(context.env.projectDir, context.targetPath!);
|
|
18
|
+
const lines = [
|
|
19
|
+
`Weaver: ${result.outcome} (${relPath})`,
|
|
20
|
+
result.summary,
|
|
21
|
+
];
|
|
22
|
+
if (result.executionTime) lines.push(`Time: ${result.executionTime}s`);
|
|
23
|
+
console.log(`\x1b[32m✓ ${lines[0]}\x1b[0m`);
|
|
24
|
+
return { summary: lines.join('\n') };
|
|
25
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import type { WeaverEnv, WeaverContext } from '../bot/types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Find the target workflow file from config or by scanning the project directory.
|
|
7
|
+
* Creates the WeaverContext that threads through the pipeline.
|
|
8
|
+
*
|
|
9
|
+
* @flowWeaver nodeType
|
|
10
|
+
* @expression
|
|
11
|
+
* @label Resolve Target
|
|
12
|
+
* @input env [order:0] - Weaver environment bundle
|
|
13
|
+
* @output ctx [order:0] - Weaver context (JSON)
|
|
14
|
+
* @output onFailure [hidden]
|
|
15
|
+
*/
|
|
16
|
+
export function weaverResolveTarget(
|
|
17
|
+
env: WeaverEnv,
|
|
18
|
+
): { ctx: string } {
|
|
19
|
+
const { projectDir, config } = env;
|
|
20
|
+
|
|
21
|
+
let targetPath: string;
|
|
22
|
+
|
|
23
|
+
if (config.target) {
|
|
24
|
+
const abs = path.resolve(projectDir, config.target);
|
|
25
|
+
if (!fs.existsSync(abs)) throw new Error(`Target workflow not found: ${abs}`);
|
|
26
|
+
console.log(`\x1b[36m→ Target: ${abs}\x1b[0m`);
|
|
27
|
+
targetPath = abs;
|
|
28
|
+
} else {
|
|
29
|
+
const found: string[] = [];
|
|
30
|
+
const scan = (dir: string, depth: number): void => {
|
|
31
|
+
if (depth > 2) return;
|
|
32
|
+
let entries: fs.Dirent[];
|
|
33
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
34
|
+
for (const entry of entries) {
|
|
35
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules') continue;
|
|
36
|
+
const full = path.join(dir, entry.name);
|
|
37
|
+
if (entry.isDirectory()) { scan(full, depth + 1); }
|
|
38
|
+
else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) {
|
|
39
|
+
try {
|
|
40
|
+
const content = fs.readFileSync(full, 'utf-8').slice(0, 2000);
|
|
41
|
+
if (content.includes('@flowWeaver workflow')) found.push(full);
|
|
42
|
+
} catch { /* skip */ }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
scan(projectDir, 0);
|
|
47
|
+
|
|
48
|
+
if (found.length === 0) {
|
|
49
|
+
throw new Error(`No workflow files found in ${projectDir}. Set "target" in .weaver.json or pass a file path.`);
|
|
50
|
+
}
|
|
51
|
+
if (found.length > 1) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`Multiple workflows found. Set "target" in .weaver.json to pick one:\n` +
|
|
54
|
+
found.map(f => ` - ${path.relative(projectDir, f)}`).join('\n'),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
console.log(`\x1b[36m→ Target: ${found[0]}\x1b[0m`);
|
|
59
|
+
targetPath = found[0]!;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const context: WeaverContext = { env, targetPath };
|
|
63
|
+
return { ctx: JSON.stringify(context) };
|
|
64
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { WeaverContext } from '../bot/types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Routes based on task mode. onSuccess fires for actionable tasks
|
|
5
|
+
* (create/modify/batch). onFailure fires for read-only tasks.
|
|
6
|
+
*
|
|
7
|
+
* @flowWeaver nodeType
|
|
8
|
+
* @expression
|
|
9
|
+
* @label Route Task
|
|
10
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
11
|
+
* @output ctx [order:0] - Weaver context (pass-through, JSON)
|
|
12
|
+
*/
|
|
13
|
+
export function weaverRouteTask(ctx: string): { ctx: string } {
|
|
14
|
+
const context = JSON.parse(ctx) as WeaverContext;
|
|
15
|
+
const task = JSON.parse(context.taskJson!) as { mode?: string };
|
|
16
|
+
const mode = task.mode ?? 'create';
|
|
17
|
+
|
|
18
|
+
if (mode === 'read') {
|
|
19
|
+
console.log('\x1b[36m→ Routing to read-only path\x1b[0m');
|
|
20
|
+
throw new Error('read-only-route');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.log(`\x1b[36m→ Routing to ${mode} path\x1b[0m`);
|
|
24
|
+
return { ctx };
|
|
25
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { WeaverContext } from '../bot/types.js';
|
|
2
|
+
import { auditEmit } from '../bot/audit-logger.js';
|
|
3
|
+
|
|
4
|
+
function sendWebhook(
|
|
5
|
+
config: { channel: string; url: string; headers?: Record<string, string> },
|
|
6
|
+
event: Record<string, unknown>,
|
|
7
|
+
): void {
|
|
8
|
+
const headers: Record<string, string> = {
|
|
9
|
+
'content-type': 'application/json',
|
|
10
|
+
...config.headers,
|
|
11
|
+
};
|
|
12
|
+
let body: string;
|
|
13
|
+
if (config.channel === 'discord') {
|
|
14
|
+
const color = event.success ? 0x22c55e : 0xef4444;
|
|
15
|
+
body = JSON.stringify({
|
|
16
|
+
embeds: [{
|
|
17
|
+
title: `Weaver: ${event.outcome ?? 'update'}`,
|
|
18
|
+
description: String(event.summary ?? '').slice(0, 2000),
|
|
19
|
+
color,
|
|
20
|
+
fields: [
|
|
21
|
+
{ name: 'Workflow', value: String(event.targetPath ?? 'unknown'), inline: true },
|
|
22
|
+
{ name: 'Provider', value: String(event.providerType ?? 'unknown'), inline: true },
|
|
23
|
+
],
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
}],
|
|
26
|
+
});
|
|
27
|
+
} else if (config.channel === 'slack') {
|
|
28
|
+
const emoji = event.success ? ':white_check_mark:' : ':x:';
|
|
29
|
+
body = JSON.stringify({
|
|
30
|
+
blocks: [
|
|
31
|
+
{ type: 'header', text: { type: 'plain_text', text: `${emoji} Weaver: ${event.outcome ?? 'update'}` } },
|
|
32
|
+
{ type: 'section', text: { type: 'mrkdwn', text: String(event.summary ?? '').slice(0, 2000) } },
|
|
33
|
+
],
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
body = JSON.stringify(event);
|
|
37
|
+
}
|
|
38
|
+
fetch(config.url, {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
headers,
|
|
41
|
+
body,
|
|
42
|
+
signal: AbortSignal.timeout(10_000),
|
|
43
|
+
}).catch(() => {});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Send webhook/Discord/Slack notifications based on config.
|
|
48
|
+
*
|
|
49
|
+
* @flowWeaver nodeType
|
|
50
|
+
* @expression
|
|
51
|
+
* @label Notify Result
|
|
52
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
53
|
+
* @output ctx [order:0] - Weaver context (pass-through, JSON)
|
|
54
|
+
* @output onFailure [hidden]
|
|
55
|
+
*/
|
|
56
|
+
export function weaverSendNotify(ctx: string): { ctx: string } {
|
|
57
|
+
const context = JSON.parse(ctx) as WeaverContext;
|
|
58
|
+
const { env } = context;
|
|
59
|
+
const { config, projectDir } = env;
|
|
60
|
+
const result = context.resultJson ? JSON.parse(context.resultJson) : {};
|
|
61
|
+
const channels = (Array.isArray(config.notify) ? config.notify : config.notify ? [config.notify] : []);
|
|
62
|
+
|
|
63
|
+
for (const ch of channels) {
|
|
64
|
+
const events = ch.events ?? ['workflow-complete', 'error'];
|
|
65
|
+
const eventType = result.success ? 'workflow-complete' : 'error';
|
|
66
|
+
if (!events.includes(eventType)) continue;
|
|
67
|
+
sendWebhook(ch, { ...result, targetPath: projectDir, providerType: config.provider, projectDir });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (channels.length > 0) {
|
|
71
|
+
auditEmit('notification-sent', { channelCount: channels.length });
|
|
72
|
+
console.log(`\x1b[36m→ Sent ${channels.length} notification(s)\x1b[0m`);
|
|
73
|
+
}
|
|
74
|
+
return { ctx };
|
|
75
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { WeaverEnv } from '../bot/types.js';
|
|
2
|
+
import { validateFiles } from '../bot/file-validator.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validates all modified/created files using flow-weaver validate
|
|
6
|
+
* and compile. Branches on validation success/failure.
|
|
7
|
+
*
|
|
8
|
+
* @flowWeaver nodeType
|
|
9
|
+
* @expression
|
|
10
|
+
* @label Validate Result
|
|
11
|
+
* @input env [order:0] - Weaver environment bundle
|
|
12
|
+
* @input executionResultJson [order:1] - Execution result (JSON)
|
|
13
|
+
* @input taskJson [order:2] - Task (JSON, pass-through)
|
|
14
|
+
* @input filesModified [order:3] - Files modified (JSON array)
|
|
15
|
+
* @output env [order:0] - Weaver environment bundle (pass-through)
|
|
16
|
+
* @output validationResultJson [order:1] - Validation results (JSON)
|
|
17
|
+
* @output taskJson [order:2] - Task (pass-through)
|
|
18
|
+
* @output allValid [order:3] - Whether all files passed validation
|
|
19
|
+
*/
|
|
20
|
+
export async function weaverValidateResult(
|
|
21
|
+
env: WeaverEnv,
|
|
22
|
+
executionResultJson: string,
|
|
23
|
+
taskJson: string,
|
|
24
|
+
filesModified: string,
|
|
25
|
+
): Promise<{
|
|
26
|
+
env: WeaverEnv;
|
|
27
|
+
validationResultJson: string; taskJson: string; allValid: boolean;
|
|
28
|
+
}> {
|
|
29
|
+
const { projectDir } = env;
|
|
30
|
+
const files: string[] = JSON.parse(filesModified);
|
|
31
|
+
const results = await validateFiles(files, projectDir);
|
|
32
|
+
|
|
33
|
+
for (const r of results) {
|
|
34
|
+
if (r.valid) console.log(`\x1b[32m ✓ ${r.file}\x1b[0m`);
|
|
35
|
+
else console.log(`\x1b[31m x ${r.file}: ${r.errors[0]?.slice(0, 100)}\x1b[0m`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const allValid = results.length === 0 || results.every(r => r.valid);
|
|
39
|
+
|
|
40
|
+
if (!allValid) {
|
|
41
|
+
throw new Error('Validation failed: ' + results.filter(r => !r.valid).map(r => r.file).join(', '));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
env,
|
|
46
|
+
validationResultJson: JSON.stringify(results),
|
|
47
|
+
taskJson, allValid,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export interface WorkflowTemplate {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
category: string;
|
|
6
|
+
generate: (opts: { projectDir?: string }) => string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const weaverBotTemplate: WorkflowTemplate = {
|
|
10
|
+
id: 'weaver-bot',
|
|
11
|
+
name: 'Weaver Bot: Autonomous workflow creator',
|
|
12
|
+
description: 'AI-powered bot that creates, modifies, and manages Flow Weaver workflows autonomously from natural language instructions',
|
|
13
|
+
category: 'bot',
|
|
14
|
+
generate: (_opts) => {
|
|
15
|
+
return `// Generated by flow-weaver-pack-weaver. Compile before running:
|
|
16
|
+
// flow-weaver compile weaver-bot.ts
|
|
17
|
+
// flow-weaver weaver bot "Create a hello world workflow"
|
|
18
|
+
|
|
19
|
+
import { weaverLoadConfig } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
20
|
+
import { weaverDetectProvider } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
21
|
+
import { weaverReceiveTask } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
22
|
+
import { weaverRouteTask } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
23
|
+
import { weaverReadWorkflow } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
24
|
+
import { weaverBuildContext } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
25
|
+
import { weaverPlanTask } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
26
|
+
import { weaverApprovalGate } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
27
|
+
import { weaverAbortTask } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
28
|
+
import { weaverExecValidateRetry } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
29
|
+
import { weaverGitOps } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
30
|
+
import { weaverSendNotify } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
31
|
+
import { weaverBotReport } from '@synergenius/flow-weaver-pack-weaver/node-types';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Autonomous workflow bot.
|
|
35
|
+
*
|
|
36
|
+
* @flowWeaver workflow
|
|
37
|
+
*
|
|
38
|
+
* @node cfg weaverLoadConfig [color: "slate"] [icon: "settings"] [position: 80 200]
|
|
39
|
+
* @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 230 200]
|
|
40
|
+
* @node receive weaverReceiveTask [color: "indigo"] [icon: "inbox"] [position: 400 200]
|
|
41
|
+
* @node route weaverRouteTask [color: "violet"] [icon: "alt_route"] [position: 570 200]
|
|
42
|
+
* @node readWf weaverReadWorkflow [color: "sky"] [icon: "visibility"] [position: 740 450]
|
|
43
|
+
* @node context weaverBuildContext [color: "teal"] [icon: "auto_stories"] [position: 740 200]
|
|
44
|
+
* @node plan weaverPlanTask [color: "blue"] [icon: "psychology"] [position: 910 200]
|
|
45
|
+
* @node approve weaverApprovalGate [color: "amber"] [icon: "gavel"] [position: 1080 200]
|
|
46
|
+
* @node abort weaverAbortTask [color: "red"] [icon: "cancel"] [position: 1250 450]
|
|
47
|
+
* @node execRetry weaverExecValidateRetry [color: "purple"] [icon: "replay"] [position: 1250 200]
|
|
48
|
+
* @node gitOps weaverGitOps [color: "stone"] [icon: "commit"] [position: 1420 100]
|
|
49
|
+
* @node notify weaverSendNotify [color: "yellow"] [icon: "notifications"] [position: 1420 300]
|
|
50
|
+
* @node report weaverBotReport [color: "green"] [icon: "summarize"] [position: 1600 200]
|
|
51
|
+
*
|
|
52
|
+
* @path Start -> cfg -> detect -> receive -> route -> context -> plan -> approve -> execRetry -> gitOps -> report -> Exit
|
|
53
|
+
* @path Start -> execRetry -> notify -> report -> Exit
|
|
54
|
+
* @path Start -> route:fail -> readWf -> report -> Exit
|
|
55
|
+
* @path Start -> approve:fail -> abort -> report -> Exit
|
|
56
|
+
*
|
|
57
|
+
* @connect route.taskJson -> readWf.taskJson
|
|
58
|
+
* @connect route.projectDir -> readWf.projectDir
|
|
59
|
+
* @connect readWf.resultJson -> report.readResult
|
|
60
|
+
* @connect readWf.taskJson -> report.taskJson
|
|
61
|
+
* @connect route.taskJson -> context.taskJson
|
|
62
|
+
* @connect context.contextBundle -> plan.contextBundle
|
|
63
|
+
* @connect plan.planJson -> approve.planJson
|
|
64
|
+
* @connect approve.rejectionReason -> abort.rejectionReason
|
|
65
|
+
* @connect approve.taskJson -> abort.taskJson
|
|
66
|
+
* @connect approve.projectDir -> abort.projectDir
|
|
67
|
+
* @connect abort.resultJson -> report.abortResult
|
|
68
|
+
* @connect abort.taskJson -> report.taskJson
|
|
69
|
+
* @connect approve.planJson -> execRetry.planJson
|
|
70
|
+
* @connect approve.taskJson -> execRetry.taskJson
|
|
71
|
+
* @connect execRetry.filesModified -> gitOps.filesModified
|
|
72
|
+
* @connect execRetry.projectDir -> gitOps.projectDir
|
|
73
|
+
* @connect cfg.config -> gitOps.config
|
|
74
|
+
* @connect execRetry.resultJson -> notify.resultJson
|
|
75
|
+
* @connect execRetry.projectDir -> notify.projectDir
|
|
76
|
+
* @connect cfg.config -> notify.config
|
|
77
|
+
* @connect execRetry.resultJson -> report.mainResult
|
|
78
|
+
* @connect execRetry.filesModified -> report.filesModified
|
|
79
|
+
* @connect receive.taskJson -> report.taskJson
|
|
80
|
+
* @connect gitOps.gitResultJson -> report.gitResultJson
|
|
81
|
+
* @connect report.summary -> Exit.summary
|
|
82
|
+
*
|
|
83
|
+
* @position Start 0 200
|
|
84
|
+
* @position Exit 1750 200
|
|
85
|
+
*
|
|
86
|
+
* @param execute [order:-1] - Execute
|
|
87
|
+
* @param taskJson [order:0] [optional] - Task instruction (JSON)
|
|
88
|
+
* @param projectDir [order:1] [optional] - Project directory
|
|
89
|
+
* @returns onSuccess [order:-2] - On Success
|
|
90
|
+
* @returns onFailure [order:-1] - On Failure
|
|
91
|
+
* @returns summary [order:0] - Summary text
|
|
92
|
+
*/
|
|
93
|
+
export async function weaverBot(
|
|
94
|
+
execute: boolean,
|
|
95
|
+
taskJson?: string,
|
|
96
|
+
projectDir?: string,
|
|
97
|
+
__abortSignal__?: AbortSignal,
|
|
98
|
+
): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string | null }> {
|
|
99
|
+
// @flow-weaver-body-start
|
|
100
|
+
// (auto-generated by compiler)
|
|
101
|
+
// @flow-weaver-body-end
|
|
102
|
+
return { onSuccess: false, onFailure: true, summary: null };
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
},
|
|
106
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
import { weaverLoadConfig } from '../node-types/load-config.js';
|
|
6
|
+
import { weaverDetectProvider } from '../node-types/detect-provider.js';
|
|
7
|
+
import { genesisLoadConfig } from '../node-types/genesis-load-config.js';
|
|
8
|
+
import { genesisObserve } from '../node-types/genesis-observe.js';
|
|
9
|
+
import { genesisDiffFingerprint } from '../node-types/genesis-diff-fingerprint.js';
|
|
10
|
+
import { genesisCheckStabilize } from '../node-types/genesis-check-stabilize.js';
|
|
11
|
+
import { genesisPropose } from '../node-types/genesis-propose.js';
|
|
12
|
+
import { genesisValidateProposal } from '../node-types/genesis-validate-proposal.js';
|
|
13
|
+
import { genesisSnapshot } from '../node-types/genesis-snapshot.js';
|
|
14
|
+
import { genesisApplyRetry } from '../node-types/genesis-apply-retry.js';
|
|
15
|
+
import { genesisTryApply } from '../node-types/genesis-try-apply.js';
|
|
16
|
+
import { genesisDiffWorkflow } from '../node-types/genesis-diff-workflow.js';
|
|
17
|
+
import { genesisCheckThreshold } from '../node-types/genesis-check-threshold.js';
|
|
18
|
+
import { genesisApprove } from '../node-types/genesis-approve.js';
|
|
19
|
+
import { genesisCommit } from '../node-types/genesis-commit.js';
|
|
20
|
+
import { genesisUpdateHistory } from '../node-types/genesis-update-history.js';
|
|
21
|
+
import { genesisReport } from '../node-types/genesis-report.js';
|
|
22
|
+
import { genesisEscrowRecover } from '../node-types/genesis-escrow-recover.js';
|
|
23
|
+
import { genesisEscrowStage } from '../node-types/genesis-escrow-stage.js';
|
|
24
|
+
import { genesisEscrowValidate } from '../node-types/genesis-escrow-validate.js';
|
|
25
|
+
import { genesisEscrowMigrate } from '../node-types/genesis-escrow-migrate.js';
|
|
26
|
+
import { genesisEscrowGrace } from '../node-types/genesis-escrow-grace.js';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Genesis self-evolution cycle. Observes the project state, proposes workflow
|
|
30
|
+
* changes within a budget, validates and compiles with retry, then commits or
|
|
31
|
+
* rolls back based on approval.
|
|
32
|
+
*
|
|
33
|
+
* @flowWeaver workflow
|
|
34
|
+
*
|
|
35
|
+
* @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 200 200]
|
|
36
|
+
* @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 400 200]
|
|
37
|
+
* @node gCfg genesisLoadConfig [color: "purple"] [icon: "settings"] [position: 600 200]
|
|
38
|
+
* @node escRecover genesisEscrowRecover [color: "yellow"] [icon: "healing"] [position: 750 200]
|
|
39
|
+
* @node observe genesisObserve [color: "blue"] [icon: "visibility"] [position: 900 200]
|
|
40
|
+
* @node diffFp genesisDiffFingerprint [color: "cyan"] [icon: "compare"] [position: 1100 200]
|
|
41
|
+
* @node stabilize genesisCheckStabilize [color: "orange"] [icon: "lock"] [position: 1300 200]
|
|
42
|
+
* @node propose genesisPropose [color: "blue"] [icon: "psychology"] [position: 1500 200]
|
|
43
|
+
* @node validate genesisValidateProposal [color: "teal"] [icon: "check"] [position: 1700 200]
|
|
44
|
+
* @node snapshot genesisSnapshot [color: "cyan"] [icon: "backup"] [position: 1900 200]
|
|
45
|
+
* @node applyRetry genesisApplyRetry [color: "purple"] [icon: "replay"] [position: 2100 200] [size: 300 200]
|
|
46
|
+
* @node tryApply genesisTryApply applyRetry.attempt [position: 2150 230]
|
|
47
|
+
* @node diffWf genesisDiffWorkflow [color: "cyan"] [icon: "compare"] [position: 2440 200]
|
|
48
|
+
* @node threshold genesisCheckThreshold [color: "orange"] [icon: "tune"] [position: 2640 200]
|
|
49
|
+
* @node approve genesisApprove [color: "orange"] [icon: "send"] [position: 2840 200]
|
|
50
|
+
* @node commit genesisCommit [color: "green"] [icon: "save"] [position: 3040 200]
|
|
51
|
+
* @node escStage genesisEscrowStage [color: "yellow"] [icon: "archive"] [position: 3240 400]
|
|
52
|
+
* @node escVal genesisEscrowValidate [color: "yellow"] [icon: "verified"] [position: 3440 400]
|
|
53
|
+
* @node escMig genesisEscrowMigrate [color: "yellow"] [icon: "swap_horiz"] [position: 3640 400]
|
|
54
|
+
* @node history genesisUpdateHistory [color: "teal"] [icon: "history"] [position: 3840 200]
|
|
55
|
+
* @node escGrace genesisEscrowGrace [color: "yellow"] [icon: "timer"] [position: 4040 200]
|
|
56
|
+
* @node report genesisReport [color: "green"] [icon: "description"] [position: 4240 200]
|
|
57
|
+
*
|
|
58
|
+
* @path Start -> cfg -> detect -> gCfg -> escRecover -> observe -> diffFp -> stabilize -> propose -> validate -> snapshot -> applyRetry -> diffWf -> threshold -> approve -> commit -> escStage -> escVal -> escMig -> history -> escGrace -> report -> Exit
|
|
59
|
+
*
|
|
60
|
+
* @path applyRetry:fail -> report
|
|
61
|
+
* @path escStage:fail -> report
|
|
62
|
+
* @path escVal:fail -> report
|
|
63
|
+
* @path escMig:fail -> report
|
|
64
|
+
*
|
|
65
|
+
* @connect applyRetry.attemptCtx:attempt -> tryApply.ctx
|
|
66
|
+
* @connect tryApply.ctx -> applyRetry.attemptCtx:attempt
|
|
67
|
+
*
|
|
68
|
+
* @connect history.ctx -> report.successCtx
|
|
69
|
+
* @connect applyRetry.ctx -> report.failCtx
|
|
70
|
+
*
|
|
71
|
+
* @connect report.summary -> Exit.summary
|
|
72
|
+
*
|
|
73
|
+
* @position Start 0 200
|
|
74
|
+
* @position Exit 4440 200
|
|
75
|
+
*
|
|
76
|
+
* @param execute [order:-1] - Execute
|
|
77
|
+
* @param projectDir [order:0] [optional] - Project directory
|
|
78
|
+
* @returns onSuccess [order:-2] - On Success
|
|
79
|
+
* @returns onFailure [order:-1] [hidden] - On Failure
|
|
80
|
+
* @returns summary [order:0] - Summary text
|
|
81
|
+
*/
|
|
82
|
+
export async function genesisTask(
|
|
83
|
+
execute: boolean,
|
|
84
|
+
params: { projectDir?: string } = {},
|
|
85
|
+
__abortSignal__?: AbortSignal,
|
|
86
|
+
): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string | null }> {
|
|
87
|
+
// @flow-weaver-body-start
|
|
88
|
+
// (auto-generated by compiler)
|
|
89
|
+
// @flow-weaver-body-end
|
|
90
|
+
return { onSuccess: false, onFailure: true, summary: null };
|
|
91
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Managed weaver bot batch workflow - processes multiple tasks via forEach scope.
|
|
2
|
+
// Run `weaver eject` to customize.
|
|
3
|
+
|
|
4
|
+
import { weaverLoadConfig } from '../node-types/load-config.js';
|
|
5
|
+
import { weaverDetectProvider } from '../node-types/detect-provider.js';
|
|
6
|
+
import { weaverReceiveTask } from '../node-types/receive-task.js';
|
|
7
|
+
import { weaverBuildContext } from '../node-types/build-context.js';
|
|
8
|
+
import { weaverPlanTask } from '../node-types/plan-task.js';
|
|
9
|
+
import { weaverApprovalGate } from '../node-types/approval-gate.js';
|
|
10
|
+
import { weaverAbortTask } from '../node-types/abort-task.js';
|
|
11
|
+
import { weaverExecValidateRetry } from '../node-types/exec-validate-retry.js';
|
|
12
|
+
import { weaverGitOps } from '../node-types/git-ops.js';
|
|
13
|
+
import { weaverSendNotify } from '../node-types/send-notify.js';
|
|
14
|
+
import { weaverBotReport } from '../node-types/bot-report.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Batch workflow bot. Processes multiple sub-tasks sequentially,
|
|
18
|
+
* running the full plan-approve-execute cycle for each.
|
|
19
|
+
*
|
|
20
|
+
* @flowWeaver workflow
|
|
21
|
+
*
|
|
22
|
+
* @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 200 200]
|
|
23
|
+
* @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 400 200]
|
|
24
|
+
* @node receive weaverReceiveTask [color: "blue"] [icon: "send"] [position: 600 200]
|
|
25
|
+
* @node context weaverBuildContext [color: "teal"] [icon: "code"] [position: 800 200]
|
|
26
|
+
* @node plan weaverPlanTask [color: "blue"] [icon: "psychology"] [position: 1000 200]
|
|
27
|
+
* @node approve weaverApprovalGate [color: "orange"] [icon: "send"] [position: 1200 200]
|
|
28
|
+
* @node abort weaverAbortTask [color: "red"] [icon: "code"] [position: 1400 400]
|
|
29
|
+
* @node execRetry weaverExecValidateRetry [color: "purple"] [icon: "code"] [position: 1400 200]
|
|
30
|
+
* @node gitOps weaverGitOps [color: "green"] [icon: "code"] [position: 1600 100]
|
|
31
|
+
* @node notify weaverSendNotify [color: "yellow"] [icon: "send"] [position: 1600 300]
|
|
32
|
+
* @node report weaverBotReport [color: "green"] [icon: "description"] [position: 1800 200]
|
|
33
|
+
*
|
|
34
|
+
* @path Start -> cfg -> detect -> receive -> context -> plan -> approve -> execRetry -> gitOps -> report -> Exit
|
|
35
|
+
* @path execRetry -> notify
|
|
36
|
+
* @path approve:fail -> abort
|
|
37
|
+
*
|
|
38
|
+
* @connect notify.onSuccess -> report.execute
|
|
39
|
+
* @connect abort.onSuccess -> report.execute
|
|
40
|
+
*
|
|
41
|
+
* @connect gitOps.ctx -> report.mainCtx
|
|
42
|
+
* @connect abort.ctx -> report.abortCtx
|
|
43
|
+
*
|
|
44
|
+
* @connect report.summary -> Exit.summary
|
|
45
|
+
*
|
|
46
|
+
* @position Start 0 200
|
|
47
|
+
* @position Exit 2000 200
|
|
48
|
+
*
|
|
49
|
+
* @param execute [order:-1] - Execute
|
|
50
|
+
* @param taskJson [order:0] [optional] - Batch task instruction (JSON)
|
|
51
|
+
* @param projectDir [order:1] [optional] - Project directory
|
|
52
|
+
* @returns onSuccess [order:-2] - On Success
|
|
53
|
+
* @returns onFailure [order:-1] [hidden] - On Failure
|
|
54
|
+
* @returns summary [order:0] - Summary text
|
|
55
|
+
*/
|
|
56
|
+
export async function weaverBotBatch(
|
|
57
|
+
execute: boolean,
|
|
58
|
+
params: { taskJson?: string; projectDir?: string },
|
|
59
|
+
__abortSignal__?: AbortSignal,
|
|
60
|
+
): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string | null }> {
|
|
61
|
+
// @flow-weaver-body-start
|
|
62
|
+
// (auto-generated by compiler)
|
|
63
|
+
// @flow-weaver-body-end
|
|
64
|
+
return { onSuccess: false, onFailure: true, summary: null };
|
|
65
|
+
}
|