@synergenius/flowweaver-pack-weaver 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/README.md +167 -0
  2. package/dist/bot/agent-provider.d.ts +15 -1
  3. package/dist/bot/agent-provider.d.ts.map +1 -1
  4. package/dist/bot/agent-provider.js +78 -2
  5. package/dist/bot/agent-provider.js.map +1 -1
  6. package/dist/bot/ai-client.d.ts +4 -0
  7. package/dist/bot/ai-client.d.ts.map +1 -0
  8. package/dist/bot/ai-client.js +50 -0
  9. package/dist/bot/ai-client.js.map +1 -0
  10. package/dist/bot/bot-agent-channel.d.ts +14 -1
  11. package/dist/bot/bot-agent-channel.d.ts.map +1 -1
  12. package/dist/bot/bot-agent-channel.js +16 -0
  13. package/dist/bot/bot-agent-channel.js.map +1 -1
  14. package/dist/bot/cli-provider.d.ts +18 -2
  15. package/dist/bot/cli-provider.d.ts.map +1 -1
  16. package/dist/bot/cli-provider.js +20 -2
  17. package/dist/bot/cli-provider.js.map +1 -1
  18. package/dist/bot/dashboard.d.ts.map +1 -1
  19. package/dist/bot/dashboard.js +2 -2
  20. package/dist/bot/dashboard.js.map +1 -1
  21. package/dist/bot/file-lock.d.ts +7 -0
  22. package/dist/bot/file-lock.d.ts.map +1 -0
  23. package/dist/bot/file-lock.js +64 -0
  24. package/dist/bot/file-lock.js.map +1 -0
  25. package/dist/bot/file-validator.d.ts +7 -0
  26. package/dist/bot/file-validator.d.ts.map +1 -0
  27. package/dist/bot/file-validator.js +20 -0
  28. package/dist/bot/file-validator.js.map +1 -0
  29. package/dist/bot/genesis-store.d.ts +18 -0
  30. package/dist/bot/genesis-store.d.ts.map +1 -0
  31. package/dist/bot/genesis-store.js +89 -0
  32. package/dist/bot/genesis-store.js.map +1 -0
  33. package/dist/bot/index.d.ts +7 -1
  34. package/dist/bot/index.d.ts.map +1 -1
  35. package/dist/bot/index.js +8 -0
  36. package/dist/bot/index.js.map +1 -1
  37. package/dist/bot/provider-registry.js +2 -2
  38. package/dist/bot/provider-registry.js.map +1 -1
  39. package/dist/bot/runner.d.ts.map +1 -1
  40. package/dist/bot/runner.js +2 -4
  41. package/dist/bot/runner.js.map +1 -1
  42. package/dist/bot/session-state.d.ts +3 -3
  43. package/dist/bot/session-state.d.ts.map +1 -1
  44. package/dist/bot/session-state.js +24 -15
  45. package/dist/bot/session-state.js.map +1 -1
  46. package/dist/bot/steering.d.ts +2 -2
  47. package/dist/bot/steering.d.ts.map +1 -1
  48. package/dist/bot/steering.js +20 -15
  49. package/dist/bot/steering.js.map +1 -1
  50. package/dist/bot/step-executor.d.ts +9 -0
  51. package/dist/bot/step-executor.d.ts.map +1 -0
  52. package/dist/bot/step-executor.js +51 -0
  53. package/dist/bot/step-executor.js.map +1 -0
  54. package/dist/bot/task-queue.d.ts +8 -8
  55. package/dist/bot/task-queue.d.ts.map +1 -1
  56. package/dist/bot/task-queue.js +58 -47
  57. package/dist/bot/task-queue.js.map +1 -1
  58. package/dist/bot/types.d.ts +131 -0
  59. package/dist/bot/types.d.ts.map +1 -1
  60. package/dist/cli-bridge.d.ts.map +1 -1
  61. package/dist/cli-bridge.js +2 -1
  62. package/dist/cli-bridge.js.map +1 -1
  63. package/dist/cli-handlers.d.ts +4 -1
  64. package/dist/cli-handlers.d.ts.map +1 -1
  65. package/dist/cli-handlers.js +84 -8
  66. package/dist/cli-handlers.js.map +1 -1
  67. package/dist/index.d.ts +4 -3
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +3 -1
  70. package/dist/index.js.map +1 -1
  71. package/dist/mcp-tools.d.ts.map +1 -1
  72. package/dist/mcp-tools.js +27 -5
  73. package/dist/mcp-tools.js.map +1 -1
  74. package/dist/node-types/abort-task.d.ts +5 -12
  75. package/dist/node-types/abort-task.d.ts.map +1 -1
  76. package/dist/node-types/abort-task.js +11 -16
  77. package/dist/node-types/abort-task.js.map +1 -1
  78. package/dist/node-types/approval-gate.d.ts +4 -21
  79. package/dist/node-types/approval-gate.d.ts.map +1 -1
  80. package/dist/node-types/approval-gate.js +17 -23
  81. package/dist/node-types/approval-gate.js.map +1 -1
  82. package/dist/node-types/bot-report.d.ts +8 -10
  83. package/dist/node-types/bot-report.d.ts.map +1 -1
  84. package/dist/node-types/bot-report.js +28 -24
  85. package/dist/node-types/bot-report.js.map +1 -1
  86. package/dist/node-types/build-context.d.ts +5 -18
  87. package/dist/node-types/build-context.d.ts.map +1 -1
  88. package/dist/node-types/build-context.js +14 -23
  89. package/dist/node-types/build-context.js.map +1 -1
  90. package/dist/node-types/detect-provider.d.ts +7 -10
  91. package/dist/node-types/detect-provider.d.ts.map +1 -1
  92. package/dist/node-types/detect-provider.js +8 -12
  93. package/dist/node-types/detect-provider.js.map +1 -1
  94. package/dist/node-types/exec-validate-retry.d.ts +5 -26
  95. package/dist/node-types/exec-validate-retry.d.ts.map +1 -1
  96. package/dist/node-types/exec-validate-retry.js +21 -144
  97. package/dist/node-types/exec-validate-retry.js.map +1 -1
  98. package/dist/node-types/execute-plan.d.ts +10 -18
  99. package/dist/node-types/execute-plan.d.ts.map +1 -1
  100. package/dist/node-types/execute-plan.js +13 -68
  101. package/dist/node-types/execute-plan.js.map +1 -1
  102. package/dist/node-types/execute-target.d.ts +5 -15
  103. package/dist/node-types/execute-target.d.ts.map +1 -1
  104. package/dist/node-types/execute-target.js +17 -85
  105. package/dist/node-types/execute-target.js.map +1 -1
  106. package/dist/node-types/fix-errors.d.ts +9 -17
  107. package/dist/node-types/fix-errors.d.ts.map +1 -1
  108. package/dist/node-types/fix-errors.js +13 -64
  109. package/dist/node-types/fix-errors.js.map +1 -1
  110. package/dist/node-types/genesis-apply-retry.d.ts +24 -0
  111. package/dist/node-types/genesis-apply-retry.d.ts.map +1 -0
  112. package/dist/node-types/genesis-apply-retry.js +95 -0
  113. package/dist/node-types/genesis-apply-retry.js.map +1 -0
  114. package/dist/node-types/genesis-apply.d.ts +29 -0
  115. package/dist/node-types/genesis-apply.d.ts.map +1 -0
  116. package/dist/node-types/genesis-apply.js +76 -0
  117. package/dist/node-types/genesis-apply.js.map +1 -0
  118. package/dist/node-types/genesis-approve.d.ts +19 -0
  119. package/dist/node-types/genesis-approve.d.ts.map +1 -0
  120. package/dist/node-types/genesis-approve.js +54 -0
  121. package/dist/node-types/genesis-approve.js.map +1 -0
  122. package/dist/node-types/genesis-check-stabilize.d.ts +16 -0
  123. package/dist/node-types/genesis-check-stabilize.d.ts.map +1 -0
  124. package/dist/node-types/genesis-check-stabilize.js +32 -0
  125. package/dist/node-types/genesis-check-stabilize.js.map +1 -0
  126. package/dist/node-types/genesis-check-threshold.d.ts +15 -0
  127. package/dist/node-types/genesis-check-threshold.d.ts.map +1 -0
  128. package/dist/node-types/genesis-check-threshold.js +29 -0
  129. package/dist/node-types/genesis-check-threshold.js.map +1 -0
  130. package/dist/node-types/genesis-commit.d.ts +17 -0
  131. package/dist/node-types/genesis-commit.d.ts.map +1 -0
  132. package/dist/node-types/genesis-commit.js +59 -0
  133. package/dist/node-types/genesis-commit.js.map +1 -0
  134. package/dist/node-types/genesis-compile-validate.d.ts +26 -0
  135. package/dist/node-types/genesis-compile-validate.d.ts.map +1 -0
  136. package/dist/node-types/genesis-compile-validate.js +60 -0
  137. package/dist/node-types/genesis-compile-validate.js.map +1 -0
  138. package/dist/node-types/genesis-diff-fingerprint.d.ts +15 -0
  139. package/dist/node-types/genesis-diff-fingerprint.d.ts.map +1 -0
  140. package/dist/node-types/genesis-diff-fingerprint.js +59 -0
  141. package/dist/node-types/genesis-diff-fingerprint.js.map +1 -0
  142. package/dist/node-types/genesis-diff-workflow.d.ts +15 -0
  143. package/dist/node-types/genesis-diff-workflow.d.ts.map +1 -0
  144. package/dist/node-types/genesis-diff-workflow.js +39 -0
  145. package/dist/node-types/genesis-diff-workflow.js.map +1 -0
  146. package/dist/node-types/genesis-load-config.d.ts +17 -0
  147. package/dist/node-types/genesis-load-config.d.ts.map +1 -0
  148. package/dist/node-types/genesis-load-config.js +35 -0
  149. package/dist/node-types/genesis-load-config.js.map +1 -0
  150. package/dist/node-types/genesis-observe.d.ts +18 -0
  151. package/dist/node-types/genesis-observe.d.ts.map +1 -0
  152. package/dist/node-types/genesis-observe.js +101 -0
  153. package/dist/node-types/genesis-observe.js.map +1 -0
  154. package/dist/node-types/genesis-propose.d.ts +17 -0
  155. package/dist/node-types/genesis-propose.d.ts.map +1 -0
  156. package/dist/node-types/genesis-propose.js +67 -0
  157. package/dist/node-types/genesis-propose.js.map +1 -0
  158. package/dist/node-types/genesis-report.d.ts +18 -0
  159. package/dist/node-types/genesis-report.d.ts.map +1 -0
  160. package/dist/node-types/genesis-report.js +61 -0
  161. package/dist/node-types/genesis-report.js.map +1 -0
  162. package/dist/node-types/genesis-snapshot.d.ts +15 -0
  163. package/dist/node-types/genesis-snapshot.d.ts.map +1 -0
  164. package/dist/node-types/genesis-snapshot.js +26 -0
  165. package/dist/node-types/genesis-snapshot.js.map +1 -0
  166. package/dist/node-types/genesis-try-apply.d.ts +18 -0
  167. package/dist/node-types/genesis-try-apply.d.ts.map +1 -0
  168. package/dist/node-types/genesis-try-apply.js +109 -0
  169. package/dist/node-types/genesis-try-apply.js.map +1 -0
  170. package/dist/node-types/genesis-update-history.d.ts +15 -0
  171. package/dist/node-types/genesis-update-history.d.ts.map +1 -0
  172. package/dist/node-types/genesis-update-history.js +57 -0
  173. package/dist/node-types/genesis-update-history.js.map +1 -0
  174. package/dist/node-types/genesis-validate-proposal.d.ts +16 -0
  175. package/dist/node-types/genesis-validate-proposal.d.ts.map +1 -0
  176. package/dist/node-types/genesis-validate-proposal.js +52 -0
  177. package/dist/node-types/genesis-validate-proposal.js.map +1 -0
  178. package/dist/node-types/git-ops.d.ts +5 -8
  179. package/dist/node-types/git-ops.d.ts.map +1 -1
  180. package/dist/node-types/git-ops.js +16 -14
  181. package/dist/node-types/git-ops.js.map +1 -1
  182. package/dist/node-types/index.d.ts +17 -0
  183. package/dist/node-types/index.d.ts.map +1 -1
  184. package/dist/node-types/index.js +17 -0
  185. package/dist/node-types/index.js.map +1 -1
  186. package/dist/node-types/load-config.d.ts +4 -2
  187. package/dist/node-types/load-config.d.ts.map +1 -1
  188. package/dist/node-types/load-config.js +3 -2
  189. package/dist/node-types/load-config.js.map +1 -1
  190. package/dist/node-types/plan-task.d.ts +5 -20
  191. package/dist/node-types/plan-task.d.ts.map +1 -1
  192. package/dist/node-types/plan-task.js +16 -85
  193. package/dist/node-types/plan-task.js.map +1 -1
  194. package/dist/node-types/read-workflow.d.ts +5 -20
  195. package/dist/node-types/read-workflow.d.ts.map +1 -1
  196. package/dist/node-types/read-workflow.js +16 -28
  197. package/dist/node-types/read-workflow.js.map +1 -1
  198. package/dist/node-types/receive-task.d.ts +9 -20
  199. package/dist/node-types/receive-task.d.ts.map +1 -1
  200. package/dist/node-types/receive-task.js +16 -19
  201. package/dist/node-types/receive-task.js.map +1 -1
  202. package/dist/node-types/report.d.ts +3 -4
  203. package/dist/node-types/report.d.ts.map +1 -1
  204. package/dist/node-types/report.js +6 -6
  205. package/dist/node-types/report.js.map +1 -1
  206. package/dist/node-types/resolve-target.d.ts +7 -15
  207. package/dist/node-types/resolve-target.d.ts.map +1 -1
  208. package/dist/node-types/resolve-target.js +47 -47
  209. package/dist/node-types/resolve-target.js.map +1 -1
  210. package/dist/node-types/route-task.d.ts +4 -16
  211. package/dist/node-types/route-task.d.ts.map +1 -1
  212. package/dist/node-types/route-task.js +6 -13
  213. package/dist/node-types/route-task.js.map +1 -1
  214. package/dist/node-types/send-notify.d.ts +5 -11
  215. package/dist/node-types/send-notify.d.ts.map +1 -1
  216. package/dist/node-types/send-notify.js +17 -24
  217. package/dist/node-types/send-notify.js.map +1 -1
  218. package/dist/node-types/validate-result.d.ts +11 -19
  219. package/dist/node-types/validate-result.d.ts.map +1 -1
  220. package/dist/node-types/validate-result.js +18 -33
  221. package/dist/node-types/validate-result.js.map +1 -1
  222. package/dist/workflows/genesis-task.d.ts +54 -0
  223. package/dist/workflows/genesis-task.d.ts.map +1 -0
  224. package/dist/workflows/genesis-task.js +56 -0
  225. package/dist/workflows/genesis-task.js.map +1 -0
  226. package/dist/workflows/index.d.ts +1 -1
  227. package/dist/workflows/index.d.ts.map +1 -1
  228. package/dist/workflows/index.js +1 -1
  229. package/dist/workflows/index.js.map +1 -1
  230. package/dist/workflows/weaver-bot-batch.d.ts +15 -26
  231. package/dist/workflows/weaver-bot-batch.d.ts.map +1 -1
  232. package/dist/workflows/weaver-bot-batch.js +15 -26
  233. package/dist/workflows/weaver-bot-batch.js.map +1 -1
  234. package/dist/workflows/weaver-bot.d.ts +18 -32
  235. package/dist/workflows/weaver-bot.d.ts.map +1 -1
  236. package/dist/workflows/weaver-bot.js +18 -32
  237. package/dist/workflows/weaver-bot.js.map +1 -1
  238. package/dist/workflows/weaver.d.ts +9 -9
  239. package/dist/workflows/weaver.js +9 -9
  240. package/flowweaver.manifest.json +493 -557
  241. package/package.json +3 -3
  242. package/dist/workflows/weaver-bot-session.d.ts +0 -65
  243. package/dist/workflows/weaver-bot-session.d.ts.map +0 -1
  244. package/dist/workflows/weaver-bot-session.js +0 -68
  245. package/dist/workflows/weaver-bot-session.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/node-types/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,UAAkB,EAAE,UAAkB,EAAE,UAAkB;IACrF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG;QACZ,WAAW,MAAM,CAAC,OAAO,KAAK,OAAO,GAAG;QACxC,MAAM,CAAC,OAAO;KACf,CAAC;IACF,IAAI,MAAM,CAAC,aAAa;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/node-types/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAW,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,UAAW,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG;QACZ,WAAW,MAAM,CAAC,OAAO,KAAK,OAAO,GAAG;QACxC,MAAM,CAAC,OAAO;KACf,CAAC;IACF,IAAI,MAAM,CAAC,aAAa;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACvC,CAAC"}
@@ -1,24 +1,16 @@
1
+ import type { WeaverEnv } from '../bot/types.js';
1
2
  /**
2
3
  * Find the target workflow file from config or by scanning the project directory.
4
+ * Creates the WeaverContext that threads through the pipeline.
3
5
  *
4
6
  * @flowWeaver nodeType
5
7
  * @expression
6
8
  * @label Resolve Target
7
- * @input projectDir [order:0] - Project root directory
8
- * @input config [order:1] - Config (JSON)
9
- * @input providerType [order:2] - Provider type (pass-through)
10
- * @input providerInfo [order:3] - Provider info (pass-through)
11
- * @output projectDir [order:0] - Project root directory (pass-through)
12
- * @output config [order:1] - Config (pass-through)
13
- * @output providerType [order:2] - Provider type (pass-through)
14
- * @output providerInfo [order:3] - Provider info (pass-through)
15
- * @output targetPath [order:4] - Absolute path to target workflow
9
+ * @input env [order:0] - Weaver environment bundle
10
+ * @output ctx [order:0] - Weaver context (JSON)
11
+ * @output onFailure [hidden]
16
12
  */
17
- export declare function weaverResolveTarget(projectDir: string, config: string, providerType: string, providerInfo: string): {
18
- projectDir: string;
19
- config: string;
20
- providerType: string;
21
- providerInfo: string;
22
- targetPath: string;
13
+ export declare function weaverResolveTarget(env: WeaverEnv): {
14
+ ctx: string;
23
15
  };
24
16
  //# sourceMappingURL=resolve-target.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-target.d.ts","sourceRoot":"","sources":["../../src/node-types/resolve-target.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAC7E;IACD,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAC/E,UAAU,EAAE,MAAM,CAAC;CACpB,CAyCA"}
1
+ {"version":3,"file":"resolve-target.d.ts","sourceRoot":"","sources":["../../src/node-types/resolve-target.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,SAAS,GACb;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CA8CjB"}
@@ -2,66 +2,66 @@ import * as fs from 'node:fs';
2
2
  import * as path from 'node:path';
3
3
  /**
4
4
  * Find the target workflow file from config or by scanning the project directory.
5
+ * Creates the WeaverContext that threads through the pipeline.
5
6
  *
6
7
  * @flowWeaver nodeType
7
8
  * @expression
8
9
  * @label Resolve Target
9
- * @input projectDir [order:0] - Project root directory
10
- * @input config [order:1] - Config (JSON)
11
- * @input providerType [order:2] - Provider type (pass-through)
12
- * @input providerInfo [order:3] - Provider info (pass-through)
13
- * @output projectDir [order:0] - Project root directory (pass-through)
14
- * @output config [order:1] - Config (pass-through)
15
- * @output providerType [order:2] - Provider type (pass-through)
16
- * @output providerInfo [order:3] - Provider info (pass-through)
17
- * @output targetPath [order:4] - Absolute path to target workflow
10
+ * @input env [order:0] - Weaver environment bundle
11
+ * @output ctx [order:0] - Weaver context (JSON)
12
+ * @output onFailure [hidden]
18
13
  */
19
- export function weaverResolveTarget(projectDir, config, providerType, providerInfo) {
20
- const cfg = JSON.parse(config);
21
- if (cfg.target) {
22
- const abs = path.resolve(projectDir, cfg.target);
14
+ export function weaverResolveTarget(env) {
15
+ const { projectDir, config } = env;
16
+ let targetPath;
17
+ if (config.target) {
18
+ const abs = path.resolve(projectDir, config.target);
23
19
  if (!fs.existsSync(abs))
24
20
  throw new Error(`Target workflow not found: ${abs}`);
25
21
  console.log(`\x1b[36m→ Target: ${abs}\x1b[0m`);
26
- return { projectDir, config, providerType, providerInfo, targetPath: abs };
22
+ targetPath = abs;
27
23
  }
28
- const found = [];
29
- const scan = (dir, depth) => {
30
- if (depth > 2)
31
- return;
32
- let entries;
33
- try {
34
- entries = fs.readdirSync(dir, { withFileTypes: true });
35
- }
36
- catch {
37
- return;
38
- }
39
- for (const entry of entries) {
40
- if (entry.name.startsWith('.') || entry.name === 'node_modules')
41
- continue;
42
- const full = path.join(dir, entry.name);
43
- if (entry.isDirectory()) {
44
- scan(full, depth + 1);
24
+ else {
25
+ const found = [];
26
+ const scan = (dir, depth) => {
27
+ if (depth > 2)
28
+ return;
29
+ let entries;
30
+ try {
31
+ entries = fs.readdirSync(dir, { withFileTypes: true });
32
+ }
33
+ catch {
34
+ return;
45
35
  }
46
- else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) {
47
- try {
48
- const content = fs.readFileSync(full, 'utf-8').slice(0, 2000);
49
- if (content.includes('@flowWeaver workflow'))
50
- found.push(full);
36
+ for (const entry of entries) {
37
+ if (entry.name.startsWith('.') || entry.name === 'node_modules')
38
+ continue;
39
+ const full = path.join(dir, entry.name);
40
+ if (entry.isDirectory()) {
41
+ scan(full, depth + 1);
42
+ }
43
+ else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) {
44
+ try {
45
+ const content = fs.readFileSync(full, 'utf-8').slice(0, 2000);
46
+ if (content.includes('@flowWeaver workflow'))
47
+ found.push(full);
48
+ }
49
+ catch { /* skip */ }
51
50
  }
52
- catch { /* skip */ }
53
51
  }
52
+ };
53
+ scan(projectDir, 0);
54
+ if (found.length === 0) {
55
+ throw new Error(`No workflow files found in ${projectDir}. Set "target" in .weaver.json or pass a file path.`);
54
56
  }
55
- };
56
- scan(projectDir, 0);
57
- if (found.length === 0) {
58
- throw new Error(`No workflow files found in ${projectDir}. Set "target" in .weaver.json or pass a file path.`);
59
- }
60
- if (found.length > 1) {
61
- throw new Error(`Multiple workflows found. Set "target" in .weaver.json to pick one:\n` +
62
- found.map(f => ` - ${path.relative(projectDir, f)}`).join('\n'));
57
+ if (found.length > 1) {
58
+ throw new Error(`Multiple workflows found. Set "target" in .weaver.json to pick one:\n` +
59
+ found.map(f => ` - ${path.relative(projectDir, f)}`).join('\n'));
60
+ }
61
+ console.log(`\x1b[36m→ Target: ${found[0]}\x1b[0m`);
62
+ targetPath = found[0];
63
63
  }
64
- console.log(`\x1b[36m→ Target: ${found[0]}\x1b[0m`);
65
- return { projectDir, config, providerType, providerInfo, targetPath: found[0] };
64
+ const context = { env, targetPath };
65
+ return { ctx: JSON.stringify(context) };
66
66
  }
67
67
  //# sourceMappingURL=resolve-target.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-target.js","sourceRoot":"","sources":["../../src/node-types/resolve-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAkB,EAAE,MAAc,EAAE,YAAoB,EAAE,YAAoB;IAK9E,MAAM,GAAG,GAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7C,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,EAAE,CAAC,CAAC;QAC9E,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;QAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;IAC7E,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,KAAa,EAAQ,EAAE;QAChD,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO;QACtB,IAAI,OAAoB,CAAC;QACzB,IAAI,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO;QAAC,CAAC;QACjF,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,KAA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AC,CAAC,IAAI,CAAC,IAAI,CAAC,CACjE,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACpD,UAAU,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;IACzB,CAAC;IAED,MAAM,OAAO,GAAkB,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;IACnD,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1C,CAAC"}
@@ -5,22 +5,10 @@
5
5
  * @flowWeaver nodeType
6
6
  * @expression
7
7
  * @label Route Task
8
- * @input projectDir [order:0] - Project root directory
9
- * @input config [order:1] - Config (JSON)
10
- * @input providerType [order:2] - Provider type
11
- * @input providerInfo [order:3] - Provider info (JSON)
12
- * @input taskJson [order:4] - Task (JSON)
13
- * @output projectDir [order:0] - Project root directory (pass-through)
14
- * @output config [order:1] - Config (pass-through)
15
- * @output providerType [order:2] - Provider type (pass-through)
16
- * @output providerInfo [order:3] - Provider info (pass-through)
17
- * @output taskJson [order:4] - Task (pass-through)
8
+ * @input ctx [order:0] - Weaver context (JSON)
9
+ * @output ctx [order:0] - Weaver context (pass-through, JSON)
18
10
  */
19
- export declare function weaverRouteTask(projectDir: string, config: string, providerType: string, providerInfo: string, taskJson: string): {
20
- projectDir: string;
21
- config: string;
22
- providerType: string;
23
- providerInfo: string;
24
- taskJson: string;
11
+ export declare function weaverRouteTask(ctx: string): {
12
+ ctx: string;
25
13
  };
26
14
  //# sourceMappingURL=route-task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-task.d.ts","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAWtG"}
1
+ {"version":3,"file":"route-task.d.ts","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAY5D"}
@@ -5,25 +5,18 @@
5
5
  * @flowWeaver nodeType
6
6
  * @expression
7
7
  * @label Route Task
8
- * @input projectDir [order:0] - Project root directory
9
- * @input config [order:1] - Config (JSON)
10
- * @input providerType [order:2] - Provider type
11
- * @input providerInfo [order:3] - Provider info (JSON)
12
- * @input taskJson [order:4] - Task (JSON)
13
- * @output projectDir [order:0] - Project root directory (pass-through)
14
- * @output config [order:1] - Config (pass-through)
15
- * @output providerType [order:2] - Provider type (pass-through)
16
- * @output providerInfo [order:3] - Provider info (pass-through)
17
- * @output taskJson [order:4] - Task (pass-through)
8
+ * @input ctx [order:0] - Weaver context (JSON)
9
+ * @output ctx [order:0] - Weaver context (pass-through, JSON)
18
10
  */
19
- export function weaverRouteTask(projectDir, config, providerType, providerInfo, taskJson) {
20
- const task = JSON.parse(taskJson);
11
+ export function weaverRouteTask(ctx) {
12
+ const context = JSON.parse(ctx);
13
+ const task = JSON.parse(context.taskJson);
21
14
  const mode = task.mode ?? 'create';
22
15
  if (mode === 'read') {
23
16
  console.log('\x1b[36m→ Routing to read-only path\x1b[0m');
24
17
  throw new Error('read-only-route');
25
18
  }
26
19
  console.log(`\x1b[36m→ Routing to ${mode} path\x1b[0m`);
27
- return { projectDir, config, providerType, providerInfo, taskJson };
20
+ return { ctx };
28
21
  }
29
22
  //# sourceMappingURL=route-task.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-task.js","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,eAAe,CAC7B,UAAkB,EAClB,MAAc,EACd,YAAoB,EACpB,YAAoB,EACpB,QAAgB;IAEhB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAsB,CAAC;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;IAEnC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,cAAc,CAAC,CAAC;IACxD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AACtE,CAAC"}
1
+ {"version":3,"file":"route-task.js","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;IACjD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAS,CAAsB,CAAC;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;IAEnC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,cAAc,CAAC,CAAC;IACxD,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC"}
@@ -4,17 +4,11 @@
4
4
  * @flowWeaver nodeType
5
5
  * @expression
6
6
  * @label Notify Result
7
- * @input projectDir [order:0] - Project root directory
8
- * @input config [order:1] - Config (JSON)
9
- * @input targetPath [order:2] - Target path
10
- * @input resultJson [order:3] - Result (JSON)
11
- * @output projectDir [order:0] - Project root directory (pass-through)
12
- * @output targetPath [order:1] - Target path (pass-through)
13
- * @output resultJson [order:2] - Result (pass-through)
7
+ * @input ctx [order:0] - Weaver context (JSON)
8
+ * @output ctx [order:0] - Weaver context (pass-through, JSON)
9
+ * @output onFailure [hidden]
14
10
  */
15
- export declare function weaverSendNotify(projectDir: string, config: string, targetPath: string, resultJson: string): {
16
- projectDir: string;
17
- targetPath: string;
18
- resultJson: string;
11
+ export declare function weaverSendNotify(ctx: string): {
12
+ ctx: string;
19
13
  };
20
14
  //# sourceMappingURL=send-notify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-notify.d.ts","sourceRoot":"","sources":["../../src/node-types/send-notify.ts"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GACzE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAchE"}
1
+ {"version":3,"file":"send-notify.d.ts","sourceRoot":"","sources":["../../src/node-types/send-notify.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAgB7D"}
@@ -1,4 +1,3 @@
1
- import { execSync } from 'node:child_process';
2
1
  function sendWebhook(config, event) {
3
2
  const headers = {
4
3
  'content-type': 'application/json',
@@ -32,16 +31,12 @@ function sendWebhook(config, event) {
32
31
  else {
33
32
  body = JSON.stringify(event);
34
33
  }
35
- const headerFlags = Object.entries(headers).map(([k, v]) => `-H "${k}: ${v}"`).join(' ');
36
- try {
37
- execSync(`curl -sS -X POST ${headerFlags} -d @- "${config.url}"`, {
38
- input: body,
39
- encoding: 'utf-8',
40
- stdio: ['pipe', 'pipe', 'pipe'],
41
- timeout: 10_000,
42
- });
43
- }
44
- catch { /* notification failure is non-fatal */ }
34
+ fetch(config.url, {
35
+ method: 'POST',
36
+ headers,
37
+ body,
38
+ signal: AbortSignal.timeout(10_000),
39
+ }).catch(() => { });
45
40
  }
46
41
  /**
47
42
  * Send webhook/Discord/Slack notifications based on config.
@@ -49,27 +44,25 @@ function sendWebhook(config, event) {
49
44
  * @flowWeaver nodeType
50
45
  * @expression
51
46
  * @label Notify Result
52
- * @input projectDir [order:0] - Project root directory
53
- * @input config [order:1] - Config (JSON)
54
- * @input targetPath [order:2] - Target path
55
- * @input resultJson [order:3] - Result (JSON)
56
- * @output projectDir [order:0] - Project root directory (pass-through)
57
- * @output targetPath [order:1] - Target path (pass-through)
58
- * @output resultJson [order:2] - Result (pass-through)
47
+ * @input ctx [order:0] - Weaver context (JSON)
48
+ * @output ctx [order:0] - Weaver context (pass-through, JSON)
49
+ * @output onFailure [hidden]
59
50
  */
60
- export function weaverSendNotify(projectDir, config, targetPath, resultJson) {
61
- const cfg = JSON.parse(config);
62
- const result = JSON.parse(resultJson);
63
- const channels = (Array.isArray(cfg.notify) ? cfg.notify : cfg.notify ? [cfg.notify] : []);
51
+ export function weaverSendNotify(ctx) {
52
+ const context = JSON.parse(ctx);
53
+ const { env } = context;
54
+ const { config, projectDir } = env;
55
+ const result = context.resultJson ? JSON.parse(context.resultJson) : {};
56
+ const channels = (Array.isArray(config.notify) ? config.notify : config.notify ? [config.notify] : []);
64
57
  for (const ch of channels) {
65
58
  const events = ch.events ?? ['workflow-complete', 'error'];
66
59
  const eventType = result.success ? 'workflow-complete' : 'error';
67
60
  if (!events.includes(eventType))
68
61
  continue;
69
- sendWebhook(ch, { ...result, targetPath, providerType: cfg.provider, projectDir });
62
+ sendWebhook(ch, { ...result, targetPath: projectDir, providerType: config.provider, projectDir });
70
63
  }
71
64
  if (channels.length > 0)
72
65
  console.log(`\x1b[36m→ Sent ${channels.length} notification(s)\x1b[0m`);
73
- return { projectDir, targetPath, resultJson };
66
+ return { ctx };
74
67
  }
75
68
  //# sourceMappingURL=send-notify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-notify.js","sourceRoot":"","sources":["../../src/node-types/send-notify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,SAAS,WAAW,CAClB,MAA0E,EAC1E,KAA8B;IAE9B,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;QAClC,GAAG,MAAM,CAAC,OAAO;KAClB,CAAC;IACF,IAAI,IAAY,CAAC;IACjB,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;QAClD,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;YACpB,MAAM,EAAE,CAAC;oBACP,KAAK,EAAE,WAAW,KAAK,CAAC,OAAO,IAAI,QAAQ,EAAE;oBAC7C,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;oBACvD,KAAK;oBACL,MAAM,EAAE;wBACN,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;wBAChF,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,SAAS,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C,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEvG,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YAAE,SAAS;QAC1C,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,QAAQ,CAAC,MAAM,yBAAyB,CAAC,CAAC;IACjG,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { WeaverEnv } from '../bot/types.js';
1
2
  /**
2
3
  * Validates all modified/created files using flow-weaver validate
3
4
  * and compile. Branches on validation success/failure.
@@ -5,26 +6,17 @@
5
6
  * @flowWeaver nodeType
6
7
  * @expression
7
8
  * @label Validate Result
8
- * @input projectDir [order:0] - Project root directory
9
- * @input config [order:1] - Config (JSON, pass-through)
10
- * @input providerType [order:2] - Provider type (pass-through)
11
- * @input providerInfo [order:3] - Provider info (pass-through)
12
- * @input executionResultJson [order:4] - Execution result (JSON)
13
- * @input taskJson [order:5] - Task (JSON, pass-through)
14
- * @input filesModified [order:6] - Files modified (JSON array)
15
- * @output projectDir [order:0] - Project root directory (pass-through)
16
- * @output config [order:1] - Config (pass-through)
17
- * @output providerType [order:2] - Provider type (pass-through)
18
- * @output providerInfo [order:3] - Provider info (pass-through)
19
- * @output validationResultJson [order:4] - Validation results (JSON)
20
- * @output taskJson [order:5] - Task (pass-through)
21
- * @output allValid [order:6] - Whether all files passed validation
9
+ * @input env [order:0] - Weaver environment bundle
10
+ * @input executionResultJson [order:1] - Execution result (JSON)
11
+ * @input taskJson [order:2] - Task (JSON, pass-through)
12
+ * @input filesModified [order:3] - Files modified (JSON array)
13
+ * @output env [order:0] - Weaver environment bundle (pass-through)
14
+ * @output validationResultJson [order:1] - Validation results (JSON)
15
+ * @output taskJson [order:2] - Task (pass-through)
16
+ * @output allValid [order:3] - Whether all files passed validation
22
17
  */
23
- export declare function weaverValidateResult(projectDir: string, config: string, providerType: string, providerInfo: string, executionResultJson: string, taskJson: string, filesModified: string): {
24
- projectDir: string;
25
- config: string;
26
- providerType: string;
27
- providerInfo: string;
18
+ export declare function weaverValidateResult(env: WeaverEnv, executionResultJson: string, taskJson: string, filesModified: string): {
19
+ env: WeaverEnv;
28
20
  validationResultJson: string;
29
21
  taskJson: string;
30
22
  allValid: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"validate-result.d.ts","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB;IACD,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAC/E,oBAAoB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;CACnE,CA+BA"}
1
+ {"version":3,"file":"validate-result.d.ts","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,SAAS,EACd,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB;IACD,GAAG,EAAE,SAAS,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;CACnE,CAqBA"}
@@ -1,4 +1,4 @@
1
- import { execSync } from 'node:child_process';
1
+ import { validateFiles } from '../bot/file-validator.js';
2
2
  /**
3
3
  * Validates all modified/created files using flow-weaver validate
4
4
  * and compile. Branches on validation success/failure.
@@ -6,46 +6,31 @@ import { execSync } from 'node:child_process';
6
6
  * @flowWeaver nodeType
7
7
  * @expression
8
8
  * @label Validate Result
9
- * @input projectDir [order:0] - Project root directory
10
- * @input config [order:1] - Config (JSON, pass-through)
11
- * @input providerType [order:2] - Provider type (pass-through)
12
- * @input providerInfo [order:3] - Provider info (pass-through)
13
- * @input executionResultJson [order:4] - Execution result (JSON)
14
- * @input taskJson [order:5] - Task (JSON, pass-through)
15
- * @input filesModified [order:6] - Files modified (JSON array)
16
- * @output projectDir [order:0] - Project root directory (pass-through)
17
- * @output config [order:1] - Config (pass-through)
18
- * @output providerType [order:2] - Provider type (pass-through)
19
- * @output providerInfo [order:3] - Provider info (pass-through)
20
- * @output validationResultJson [order:4] - Validation results (JSON)
21
- * @output taskJson [order:5] - Task (pass-through)
22
- * @output allValid [order:6] - Whether all files passed validation
9
+ * @input env [order:0] - Weaver environment bundle
10
+ * @input executionResultJson [order:1] - Execution result (JSON)
11
+ * @input taskJson [order:2] - Task (JSON, pass-through)
12
+ * @input filesModified [order:3] - Files modified (JSON array)
13
+ * @output env [order:0] - Weaver environment bundle (pass-through)
14
+ * @output validationResultJson [order:1] - Validation results (JSON)
15
+ * @output taskJson [order:2] - Task (pass-through)
16
+ * @output allValid [order:3] - Whether all files passed validation
23
17
  */
24
- export function weaverValidateResult(projectDir, config, providerType, providerInfo, executionResultJson, taskJson, filesModified) {
18
+ export function weaverValidateResult(env, executionResultJson, taskJson, filesModified) {
19
+ const { projectDir } = env;
25
20
  const files = JSON.parse(filesModified);
26
- const results = [];
27
- for (const file of files) {
28
- if (!file.endsWith('.ts'))
29
- continue;
30
- try {
31
- execSync(`flow-weaver validate "${file}"`, {
32
- cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000,
33
- });
34
- results.push({ file, valid: true, errors: [], warnings: [] });
35
- console.log(`\x1b[32m ✓ ${file}\x1b[0m`);
36
- }
37
- catch (err) {
38
- const stderr = err.stderr ?? (err instanceof Error ? err.message : String(err));
39
- results.push({ file, valid: false, errors: [stderr], warnings: [] });
40
- console.log(`\x1b[31m x ${file}: ${stderr.slice(0, 100)}\x1b[0m`);
41
- }
21
+ const results = validateFiles(files, projectDir);
22
+ for (const r of results) {
23
+ if (r.valid)
24
+ console.log(`\x1b[32m ✓ ${r.file}\x1b[0m`);
25
+ else
26
+ console.log(`\x1b[31m x ${r.file}: ${r.errors[0]?.slice(0, 100)}\x1b[0m`);
42
27
  }
43
28
  const allValid = results.length === 0 || results.every(r => r.valid);
44
29
  if (!allValid) {
45
30
  throw new Error('Validation failed: ' + results.filter(r => !r.valid).map(r => r.file).join(', '));
46
31
  }
47
32
  return {
48
- projectDir, config, providerType, providerInfo,
33
+ env,
49
34
  validationResultJson: JSON.stringify(results),
50
35
  taskJson, allValid,
51
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"validate-result.js","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,oBAAoB,CA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AE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAErE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,OAAO;QACL,GAAG;QACH,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;QAC7C,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Genesis self-evolution cycle. Observes the project state, proposes workflow
3
+ * changes within a budget, validates and compiles with retry, then commits or
4
+ * rolls back based on approval.
5
+ *
6
+ * @flowWeaver workflow
7
+ *
8
+ * @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 200 200]
9
+ * @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 400 200]
10
+ * @node gCfg genesisLoadConfig [color: "purple"] [icon: "settings"] [position: 600 200]
11
+ * @node observe genesisObserve [color: "blue"] [icon: "visibility"] [position: 800 200]
12
+ * @node diffFp genesisDiffFingerprint [color: "cyan"] [icon: "compare"] [position: 1000 200]
13
+ * @node stabilize genesisCheckStabilize [color: "orange"] [icon: "lock"] [position: 1200 200]
14
+ * @node propose genesisPropose [color: "blue"] [icon: "psychology"] [position: 1400 200]
15
+ * @node validate genesisValidateProposal [color: "teal"] [icon: "check"] [position: 1600 200]
16
+ * @node snapshot genesisSnapshot [color: "cyan"] [icon: "backup"] [position: 1800 200]
17
+ * @node applyRetry genesisApplyRetry [color: "purple"] [icon: "replay"] [position: 2000 200] [size: 300 200]
18
+ * @node tryApply genesisTryApply applyRetry.attempt [position: 2050 230]
19
+ * @node diffWf genesisDiffWorkflow [color: "cyan"] [icon: "compare"] [position: 2340 200]
20
+ * @node threshold genesisCheckThreshold [color: "orange"] [icon: "tune"] [position: 2540 200]
21
+ * @node approve genesisApprove [color: "orange"] [icon: "send"] [position: 2740 200]
22
+ * @node commit genesisCommit [color: "green"] [icon: "save"] [position: 2940 200]
23
+ * @node history genesisUpdateHistory [color: "teal"] [icon: "history"] [position: 3140 200]
24
+ * @node report genesisReport [color: "green"] [icon: "description"] [position: 3340 200]
25
+ *
26
+ * @path Start -> cfg -> detect -> gCfg -> observe -> diffFp -> stabilize -> propose -> validate -> snapshot -> applyRetry -> diffWf -> threshold -> approve -> commit -> history -> report -> Exit
27
+ *
28
+ * @path applyRetry:fail -> report
29
+ *
30
+ * @connect applyRetry.attemptCtx:attempt -> tryApply.ctx
31
+ * @connect tryApply.ctx -> applyRetry.attemptCtx:attempt
32
+ *
33
+ * @connect history.ctx -> report.successCtx
34
+ * @connect applyRetry.ctx -> report.failCtx
35
+ *
36
+ * @connect report.summary -> Exit.summary
37
+ *
38
+ * @position Start 0 200
39
+ * @position Exit 3540 200
40
+ *
41
+ * @param execute [order:-1] - Execute
42
+ * @param projectDir [order:0] [optional] - Project directory
43
+ * @returns onSuccess [order:-2] - On Success
44
+ * @returns onFailure [order:-1] [hidden] - On Failure
45
+ * @returns summary [order:0] - Summary text
46
+ */
47
+ export declare function genesisTask(execute: boolean, params?: {
48
+ projectDir?: string;
49
+ }, __abortSignal__?: AbortSignal): Promise<{
50
+ onSuccess: boolean;
51
+ onFailure: boolean;
52
+ summary: string | null;
53
+ }>;
54
+ //# sourceMappingURL=genesis-task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genesis-task.d.ts","sourceRoot":"","sources":["../../src/workflows/genesis-task.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,MAAM,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,EACpC,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAK7E"}
@@ -0,0 +1,56 @@
1
+ // Genesis self-evolution workflow. Observes the project, proposes changes
2
+ // to a target workflow, validates + compiles with retry, and commits or
3
+ // rolls back.
4
+ /**
5
+ * Genesis self-evolution cycle. Observes the project state, proposes workflow
6
+ * changes within a budget, validates and compiles with retry, then commits or
7
+ * rolls back based on approval.
8
+ *
9
+ * @flowWeaver workflow
10
+ *
11
+ * @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 200 200]
12
+ * @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 400 200]
13
+ * @node gCfg genesisLoadConfig [color: "purple"] [icon: "settings"] [position: 600 200]
14
+ * @node observe genesisObserve [color: "blue"] [icon: "visibility"] [position: 800 200]
15
+ * @node diffFp genesisDiffFingerprint [color: "cyan"] [icon: "compare"] [position: 1000 200]
16
+ * @node stabilize genesisCheckStabilize [color: "orange"] [icon: "lock"] [position: 1200 200]
17
+ * @node propose genesisPropose [color: "blue"] [icon: "psychology"] [position: 1400 200]
18
+ * @node validate genesisValidateProposal [color: "teal"] [icon: "check"] [position: 1600 200]
19
+ * @node snapshot genesisSnapshot [color: "cyan"] [icon: "backup"] [position: 1800 200]
20
+ * @node applyRetry genesisApplyRetry [color: "purple"] [icon: "replay"] [position: 2000 200] [size: 300 200]
21
+ * @node tryApply genesisTryApply applyRetry.attempt [position: 2050 230]
22
+ * @node diffWf genesisDiffWorkflow [color: "cyan"] [icon: "compare"] [position: 2340 200]
23
+ * @node threshold genesisCheckThreshold [color: "orange"] [icon: "tune"] [position: 2540 200]
24
+ * @node approve genesisApprove [color: "orange"] [icon: "send"] [position: 2740 200]
25
+ * @node commit genesisCommit [color: "green"] [icon: "save"] [position: 2940 200]
26
+ * @node history genesisUpdateHistory [color: "teal"] [icon: "history"] [position: 3140 200]
27
+ * @node report genesisReport [color: "green"] [icon: "description"] [position: 3340 200]
28
+ *
29
+ * @path Start -> cfg -> detect -> gCfg -> observe -> diffFp -> stabilize -> propose -> validate -> snapshot -> applyRetry -> diffWf -> threshold -> approve -> commit -> history -> report -> Exit
30
+ *
31
+ * @path applyRetry:fail -> report
32
+ *
33
+ * @connect applyRetry.attemptCtx:attempt -> tryApply.ctx
34
+ * @connect tryApply.ctx -> applyRetry.attemptCtx:attempt
35
+ *
36
+ * @connect history.ctx -> report.successCtx
37
+ * @connect applyRetry.ctx -> report.failCtx
38
+ *
39
+ * @connect report.summary -> Exit.summary
40
+ *
41
+ * @position Start 0 200
42
+ * @position Exit 3540 200
43
+ *
44
+ * @param execute [order:-1] - Execute
45
+ * @param projectDir [order:0] [optional] - Project directory
46
+ * @returns onSuccess [order:-2] - On Success
47
+ * @returns onFailure [order:-1] [hidden] - On Failure
48
+ * @returns summary [order:0] - Summary text
49
+ */
50
+ export async function genesisTask(execute, params = {}, __abortSignal__) {
51
+ // @flow-weaver-body-start
52
+ // (auto-generated by compiler)
53
+ // @flow-weaver-body-end
54
+ return { onSuccess: false, onFailure: true, summary: null };
55
+ }
56
+ //# sourceMappingURL=genesis-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genesis-task.js","sourceRoot":"","sources":["../../src/workflows/genesis-task.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wEAAwE;AACxE,cAAc;AAoBd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAgB,EAChB,SAAkC,EAAE,EACpC,eAA6B;IAE7B,0BAA0B;IAC1B,+BAA+B;IAC/B,wBAAwB;IACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9D,CAAC"}