@generacy-ai/workflow-engine 0.0.0-preview-20260304013206

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 (347) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +265 -0
  3. package/dist/actions/base-action.d.ts +63 -0
  4. package/dist/actions/base-action.d.ts.map +1 -0
  5. package/dist/actions/base-action.js +130 -0
  6. package/dist/actions/base-action.js.map +1 -0
  7. package/dist/actions/builtin/agent-invoke.d.ts +16 -0
  8. package/dist/actions/builtin/agent-invoke.d.ts.map +1 -0
  9. package/dist/actions/builtin/agent-invoke.js +108 -0
  10. package/dist/actions/builtin/agent-invoke.js.map +1 -0
  11. package/dist/actions/builtin/humancy-api-handler.d.ts +191 -0
  12. package/dist/actions/builtin/humancy-api-handler.d.ts.map +1 -0
  13. package/dist/actions/builtin/humancy-api-handler.js +521 -0
  14. package/dist/actions/builtin/humancy-api-handler.js.map +1 -0
  15. package/dist/actions/builtin/humancy-review.d.ts +83 -0
  16. package/dist/actions/builtin/humancy-review.d.ts.map +1 -0
  17. package/dist/actions/builtin/humancy-review.js +250 -0
  18. package/dist/actions/builtin/humancy-review.js.map +1 -0
  19. package/dist/actions/builtin/pr-create.d.ts +16 -0
  20. package/dist/actions/builtin/pr-create.d.ts.map +1 -0
  21. package/dist/actions/builtin/pr-create.js +110 -0
  22. package/dist/actions/builtin/pr-create.js.map +1 -0
  23. package/dist/actions/builtin/shell.d.ts +16 -0
  24. package/dist/actions/builtin/shell.d.ts.map +1 -0
  25. package/dist/actions/builtin/shell.js +80 -0
  26. package/dist/actions/builtin/shell.js.map +1 -0
  27. package/dist/actions/builtin/speckit/index.d.ts +47 -0
  28. package/dist/actions/builtin/speckit/index.d.ts.map +1 -0
  29. package/dist/actions/builtin/speckit/index.js +347 -0
  30. package/dist/actions/builtin/speckit/index.js.map +1 -0
  31. package/dist/actions/builtin/speckit/lib/feature.d.ts +17 -0
  32. package/dist/actions/builtin/speckit/lib/feature.d.ts.map +1 -0
  33. package/dist/actions/builtin/speckit/lib/feature.js +430 -0
  34. package/dist/actions/builtin/speckit/lib/feature.js.map +1 -0
  35. package/dist/actions/builtin/speckit/lib/fs.d.ts +62 -0
  36. package/dist/actions/builtin/speckit/lib/fs.d.ts.map +1 -0
  37. package/dist/actions/builtin/speckit/lib/fs.js +181 -0
  38. package/dist/actions/builtin/speckit/lib/fs.js.map +1 -0
  39. package/dist/actions/builtin/speckit/lib/paths.d.ts +7 -0
  40. package/dist/actions/builtin/speckit/lib/paths.d.ts.map +1 -0
  41. package/dist/actions/builtin/speckit/lib/paths.js +161 -0
  42. package/dist/actions/builtin/speckit/lib/paths.js.map +1 -0
  43. package/dist/actions/builtin/speckit/lib/prereqs.d.ts +8 -0
  44. package/dist/actions/builtin/speckit/lib/prereqs.d.ts.map +1 -0
  45. package/dist/actions/builtin/speckit/lib/prereqs.js +194 -0
  46. package/dist/actions/builtin/speckit/lib/prereqs.js.map +1 -0
  47. package/dist/actions/builtin/speckit/lib/stream-batcher.d.ts +14 -0
  48. package/dist/actions/builtin/speckit/lib/stream-batcher.d.ts.map +1 -0
  49. package/dist/actions/builtin/speckit/lib/stream-batcher.js +31 -0
  50. package/dist/actions/builtin/speckit/lib/stream-batcher.js.map +1 -0
  51. package/dist/actions/builtin/speckit/lib/templates.d.ts +15 -0
  52. package/dist/actions/builtin/speckit/lib/templates.d.ts.map +1 -0
  53. package/dist/actions/builtin/speckit/lib/templates.js +176 -0
  54. package/dist/actions/builtin/speckit/lib/templates.js.map +1 -0
  55. package/dist/actions/builtin/speckit/operations/check-prereqs.d.ts +11 -0
  56. package/dist/actions/builtin/speckit/operations/check-prereqs.d.ts.map +1 -0
  57. package/dist/actions/builtin/speckit/operations/check-prereqs.js +22 -0
  58. package/dist/actions/builtin/speckit/operations/check-prereqs.js.map +1 -0
  59. package/dist/actions/builtin/speckit/operations/clarify.d.ts +7 -0
  60. package/dist/actions/builtin/speckit/operations/clarify.d.ts.map +1 -0
  61. package/dist/actions/builtin/speckit/operations/clarify.js +302 -0
  62. package/dist/actions/builtin/speckit/operations/clarify.js.map +1 -0
  63. package/dist/actions/builtin/speckit/operations/copy-template.d.ts +11 -0
  64. package/dist/actions/builtin/speckit/operations/copy-template.d.ts.map +1 -0
  65. package/dist/actions/builtin/speckit/operations/copy-template.js +23 -0
  66. package/dist/actions/builtin/speckit/operations/copy-template.js.map +1 -0
  67. package/dist/actions/builtin/speckit/operations/create-feature.d.ts +11 -0
  68. package/dist/actions/builtin/speckit/operations/create-feature.d.ts.map +1 -0
  69. package/dist/actions/builtin/speckit/operations/create-feature.js +25 -0
  70. package/dist/actions/builtin/speckit/operations/create-feature.js.map +1 -0
  71. package/dist/actions/builtin/speckit/operations/get-paths.d.ts +11 -0
  72. package/dist/actions/builtin/speckit/operations/get-paths.d.ts.map +1 -0
  73. package/dist/actions/builtin/speckit/operations/get-paths.js +17 -0
  74. package/dist/actions/builtin/speckit/operations/get-paths.js.map +1 -0
  75. package/dist/actions/builtin/speckit/operations/implement.d.ts +7 -0
  76. package/dist/actions/builtin/speckit/operations/implement.d.ts.map +1 -0
  77. package/dist/actions/builtin/speckit/operations/implement.js +246 -0
  78. package/dist/actions/builtin/speckit/operations/implement.js.map +1 -0
  79. package/dist/actions/builtin/speckit/operations/plan.d.ts +7 -0
  80. package/dist/actions/builtin/speckit/operations/plan.d.ts.map +1 -0
  81. package/dist/actions/builtin/speckit/operations/plan.js +253 -0
  82. package/dist/actions/builtin/speckit/operations/plan.js.map +1 -0
  83. package/dist/actions/builtin/speckit/operations/specify.d.ts +7 -0
  84. package/dist/actions/builtin/speckit/operations/specify.d.ts.map +1 -0
  85. package/dist/actions/builtin/speckit/operations/specify.js +178 -0
  86. package/dist/actions/builtin/speckit/operations/specify.js.map +1 -0
  87. package/dist/actions/builtin/speckit/operations/tasks-to-issues.d.ts +42 -0
  88. package/dist/actions/builtin/speckit/operations/tasks-to-issues.d.ts.map +1 -0
  89. package/dist/actions/builtin/speckit/operations/tasks-to-issues.js +386 -0
  90. package/dist/actions/builtin/speckit/operations/tasks-to-issues.js.map +1 -0
  91. package/dist/actions/builtin/speckit/operations/tasks.d.ts +7 -0
  92. package/dist/actions/builtin/speckit/operations/tasks.d.ts.map +1 -0
  93. package/dist/actions/builtin/speckit/operations/tasks.js +234 -0
  94. package/dist/actions/builtin/speckit/operations/tasks.js.map +1 -0
  95. package/dist/actions/builtin/speckit/types.d.ts +268 -0
  96. package/dist/actions/builtin/speckit/types.d.ts.map +1 -0
  97. package/dist/actions/builtin/speckit/types.js +11 -0
  98. package/dist/actions/builtin/speckit/types.js.map +1 -0
  99. package/dist/actions/builtin/verification-check.d.ts +16 -0
  100. package/dist/actions/builtin/verification-check.d.ts.map +1 -0
  101. package/dist/actions/builtin/verification-check.js +99 -0
  102. package/dist/actions/builtin/verification-check.js.map +1 -0
  103. package/dist/actions/builtin/workspace-prepare.d.ts +16 -0
  104. package/dist/actions/builtin/workspace-prepare.d.ts.map +1 -0
  105. package/dist/actions/builtin/workspace-prepare.js +108 -0
  106. package/dist/actions/builtin/workspace-prepare.js.map +1 -0
  107. package/dist/actions/cli-utils.d.ts +76 -0
  108. package/dist/actions/cli-utils.d.ts.map +1 -0
  109. package/dist/actions/cli-utils.js +278 -0
  110. package/dist/actions/cli-utils.js.map +1 -0
  111. package/dist/actions/epic/check-completion.d.ts +14 -0
  112. package/dist/actions/epic/check-completion.d.ts.map +1 -0
  113. package/dist/actions/epic/check-completion.js +57 -0
  114. package/dist/actions/epic/check-completion.js.map +1 -0
  115. package/dist/actions/epic/close.d.ts +18 -0
  116. package/dist/actions/epic/close.d.ts.map +1 -0
  117. package/dist/actions/epic/close.js +76 -0
  118. package/dist/actions/epic/close.js.map +1 -0
  119. package/dist/actions/epic/create-pr.d.ts +22 -0
  120. package/dist/actions/epic/create-pr.d.ts.map +1 -0
  121. package/dist/actions/epic/create-pr.js +140 -0
  122. package/dist/actions/epic/create-pr.js.map +1 -0
  123. package/dist/actions/epic/dispatch-children.d.ts +16 -0
  124. package/dist/actions/epic/dispatch-children.d.ts.map +1 -0
  125. package/dist/actions/epic/dispatch-children.js +95 -0
  126. package/dist/actions/epic/dispatch-children.js.map +1 -0
  127. package/dist/actions/epic/find-children.d.ts +16 -0
  128. package/dist/actions/epic/find-children.d.ts.map +1 -0
  129. package/dist/actions/epic/find-children.js +92 -0
  130. package/dist/actions/epic/find-children.js.map +1 -0
  131. package/dist/actions/epic/index.d.ts +20 -0
  132. package/dist/actions/epic/index.d.ts.map +1 -0
  133. package/dist/actions/epic/index.js +35 -0
  134. package/dist/actions/epic/index.js.map +1 -0
  135. package/dist/actions/epic/post-tasks-summary.d.ts +18 -0
  136. package/dist/actions/epic/post-tasks-summary.d.ts.map +1 -0
  137. package/dist/actions/epic/post-tasks-summary.js +123 -0
  138. package/dist/actions/epic/post-tasks-summary.js.map +1 -0
  139. package/dist/actions/epic/update-status.d.ts +22 -0
  140. package/dist/actions/epic/update-status.d.ts.map +1 -0
  141. package/dist/actions/epic/update-status.js +105 -0
  142. package/dist/actions/epic/update-status.js.map +1 -0
  143. package/dist/actions/github/add-comment.d.ts +14 -0
  144. package/dist/actions/github/add-comment.d.ts.map +1 -0
  145. package/dist/actions/github/add-comment.js +44 -0
  146. package/dist/actions/github/add-comment.js.map +1 -0
  147. package/dist/actions/github/client/gh-cli.d.ts +68 -0
  148. package/dist/actions/github/client/gh-cli.d.ts.map +1 -0
  149. package/dist/actions/github/client/gh-cli.js +781 -0
  150. package/dist/actions/github/client/gh-cli.js.map +1 -0
  151. package/dist/actions/github/client/index.d.ts +12 -0
  152. package/dist/actions/github/client/index.d.ts.map +1 -0
  153. package/dist/actions/github/client/index.js +10 -0
  154. package/dist/actions/github/client/index.js.map +1 -0
  155. package/dist/actions/github/client/interface.d.ts +270 -0
  156. package/dist/actions/github/client/interface.d.ts.map +1 -0
  157. package/dist/actions/github/client/interface.js +2 -0
  158. package/dist/actions/github/client/interface.js.map +1 -0
  159. package/dist/actions/github/commit-and-push.d.ts +19 -0
  160. package/dist/actions/github/commit-and-push.d.ts.map +1 -0
  161. package/dist/actions/github/commit-and-push.js +86 -0
  162. package/dist/actions/github/commit-and-push.js.map +1 -0
  163. package/dist/actions/github/create-draft-pr.d.ts +18 -0
  164. package/dist/actions/github/create-draft-pr.d.ts.map +1 -0
  165. package/dist/actions/github/create-draft-pr.js +76 -0
  166. package/dist/actions/github/create-draft-pr.js.map +1 -0
  167. package/dist/actions/github/get-context.d.ts +23 -0
  168. package/dist/actions/github/get-context.d.ts.map +1 -0
  169. package/dist/actions/github/get-context.js +109 -0
  170. package/dist/actions/github/get-context.js.map +1 -0
  171. package/dist/actions/github/index.d.ts +32 -0
  172. package/dist/actions/github/index.d.ts.map +1 -0
  173. package/dist/actions/github/index.js +67 -0
  174. package/dist/actions/github/index.js.map +1 -0
  175. package/dist/actions/github/label-definitions.d.ts +19 -0
  176. package/dist/actions/github/label-definitions.d.ts.map +1 -0
  177. package/dist/actions/github/label-definitions.js +71 -0
  178. package/dist/actions/github/label-definitions.js.map +1 -0
  179. package/dist/actions/github/mark-pr-ready.d.ts +14 -0
  180. package/dist/actions/github/mark-pr-ready.d.ts.map +1 -0
  181. package/dist/actions/github/mark-pr-ready.js +43 -0
  182. package/dist/actions/github/mark-pr-ready.js.map +1 -0
  183. package/dist/actions/github/merge-from-base.d.ts +15 -0
  184. package/dist/actions/github/merge-from-base.d.ts.map +1 -0
  185. package/dist/actions/github/merge-from-base.js +120 -0
  186. package/dist/actions/github/merge-from-base.js.map +1 -0
  187. package/dist/actions/github/preflight.d.ts +36 -0
  188. package/dist/actions/github/preflight.d.ts.map +1 -0
  189. package/dist/actions/github/preflight.js +292 -0
  190. package/dist/actions/github/preflight.js.map +1 -0
  191. package/dist/actions/github/read-pr-feedback.d.ts +14 -0
  192. package/dist/actions/github/read-pr-feedback.d.ts.map +1 -0
  193. package/dist/actions/github/read-pr-feedback.js +53 -0
  194. package/dist/actions/github/read-pr-feedback.js.map +1 -0
  195. package/dist/actions/github/respond-pr-feedback.d.ts +14 -0
  196. package/dist/actions/github/respond-pr-feedback.d.ts.map +1 -0
  197. package/dist/actions/github/respond-pr-feedback.js +58 -0
  198. package/dist/actions/github/respond-pr-feedback.js.map +1 -0
  199. package/dist/actions/github/review-changes.d.ts +19 -0
  200. package/dist/actions/github/review-changes.d.ts.map +1 -0
  201. package/dist/actions/github/review-changes.js +95 -0
  202. package/dist/actions/github/review-changes.js.map +1 -0
  203. package/dist/actions/github/sync-labels.d.ts +14 -0
  204. package/dist/actions/github/sync-labels.d.ts.map +1 -0
  205. package/dist/actions/github/sync-labels.js +81 -0
  206. package/dist/actions/github/sync-labels.js.map +1 -0
  207. package/dist/actions/github/update-pr.d.ts +14 -0
  208. package/dist/actions/github/update-pr.d.ts.map +1 -0
  209. package/dist/actions/github/update-pr.js +63 -0
  210. package/dist/actions/github/update-pr.js.map +1 -0
  211. package/dist/actions/index.d.ts +109 -0
  212. package/dist/actions/index.d.ts.map +1 -0
  213. package/dist/actions/index.js +233 -0
  214. package/dist/actions/index.js.map +1 -0
  215. package/dist/actions/workflow/check-gate.d.ts +15 -0
  216. package/dist/actions/workflow/check-gate.d.ts.map +1 -0
  217. package/dist/actions/workflow/check-gate.js +75 -0
  218. package/dist/actions/workflow/check-gate.js.map +1 -0
  219. package/dist/actions/workflow/index.d.ts +21 -0
  220. package/dist/actions/workflow/index.d.ts.map +1 -0
  221. package/dist/actions/workflow/index.js +31 -0
  222. package/dist/actions/workflow/index.js.map +1 -0
  223. package/dist/actions/workflow/update-phase.d.ts +15 -0
  224. package/dist/actions/workflow/update-phase.d.ts.map +1 -0
  225. package/dist/actions/workflow/update-phase.js +143 -0
  226. package/dist/actions/workflow/update-phase.js.map +1 -0
  227. package/dist/actions/workflow/update-stage.d.ts +19 -0
  228. package/dist/actions/workflow/update-stage.d.ts.map +1 -0
  229. package/dist/actions/workflow/update-stage.js +137 -0
  230. package/dist/actions/workflow/update-stage.js.map +1 -0
  231. package/dist/errors/base-workflow-not-found.d.ts +10 -0
  232. package/dist/errors/base-workflow-not-found.d.ts.map +1 -0
  233. package/dist/errors/base-workflow-not-found.js +18 -0
  234. package/dist/errors/base-workflow-not-found.js.map +1 -0
  235. package/dist/errors/circular-extends.d.ts +9 -0
  236. package/dist/errors/circular-extends.d.ts.map +1 -0
  237. package/dist/errors/circular-extends.js +13 -0
  238. package/dist/errors/circular-extends.js.map +1 -0
  239. package/dist/errors/correlation-timeout.d.ts +9 -0
  240. package/dist/errors/correlation-timeout.d.ts.map +1 -0
  241. package/dist/errors/correlation-timeout.js +13 -0
  242. package/dist/errors/correlation-timeout.js.map +1 -0
  243. package/dist/errors/workflow-override.d.ts +9 -0
  244. package/dist/errors/workflow-override.d.ts.map +1 -0
  245. package/dist/errors/workflow-override.js +12 -0
  246. package/dist/errors/workflow-override.js.map +1 -0
  247. package/dist/executor/events.d.ts +55 -0
  248. package/dist/executor/events.d.ts.map +1 -0
  249. package/dist/executor/events.js +72 -0
  250. package/dist/executor/events.js.map +1 -0
  251. package/dist/executor/gate-handler.d.ts +55 -0
  252. package/dist/executor/gate-handler.d.ts.map +1 -0
  253. package/dist/executor/gate-handler.js +139 -0
  254. package/dist/executor/gate-handler.js.map +1 -0
  255. package/dist/executor/index.d.ts +140 -0
  256. package/dist/executor/index.d.ts.map +1 -0
  257. package/dist/executor/index.js +681 -0
  258. package/dist/executor/index.js.map +1 -0
  259. package/dist/index.d.ts +24 -0
  260. package/dist/index.d.ts.map +1 -0
  261. package/dist/index.js +34 -0
  262. package/dist/index.js.map +1 -0
  263. package/dist/interpolation/context.d.ts +117 -0
  264. package/dist/interpolation/context.d.ts.map +1 -0
  265. package/dist/interpolation/context.js +256 -0
  266. package/dist/interpolation/context.js.map +1 -0
  267. package/dist/interpolation/index.d.ts +76 -0
  268. package/dist/interpolation/index.d.ts.map +1 -0
  269. package/dist/interpolation/index.js +264 -0
  270. package/dist/interpolation/index.js.map +1 -0
  271. package/dist/loader/extends.d.ts +48 -0
  272. package/dist/loader/extends.d.ts.map +1 -0
  273. package/dist/loader/extends.js +140 -0
  274. package/dist/loader/extends.js.map +1 -0
  275. package/dist/loader/index.d.ts +50 -0
  276. package/dist/loader/index.d.ts.map +1 -0
  277. package/dist/loader/index.js +190 -0
  278. package/dist/loader/index.js.map +1 -0
  279. package/dist/loader/schema.d.ts +506 -0
  280. package/dist/loader/schema.d.ts.map +1 -0
  281. package/dist/loader/schema.js +63 -0
  282. package/dist/loader/schema.js.map +1 -0
  283. package/dist/loader/validator.d.ts +33 -0
  284. package/dist/loader/validator.d.ts.map +1 -0
  285. package/dist/loader/validator.js +135 -0
  286. package/dist/loader/validator.js.map +1 -0
  287. package/dist/registry/index.d.ts +42 -0
  288. package/dist/registry/index.d.ts.map +1 -0
  289. package/dist/registry/index.js +77 -0
  290. package/dist/registry/index.js.map +1 -0
  291. package/dist/retry/index.d.ts +37 -0
  292. package/dist/retry/index.d.ts.map +1 -0
  293. package/dist/retry/index.js +225 -0
  294. package/dist/retry/index.js.map +1 -0
  295. package/dist/retry/strategies.d.ts +74 -0
  296. package/dist/retry/strategies.d.ts.map +1 -0
  297. package/dist/retry/strategies.js +136 -0
  298. package/dist/retry/strategies.js.map +1 -0
  299. package/dist/store/filesystem-store.d.ts +52 -0
  300. package/dist/store/filesystem-store.d.ts.map +1 -0
  301. package/dist/store/filesystem-store.js +230 -0
  302. package/dist/store/filesystem-store.js.map +1 -0
  303. package/dist/store/index.d.ts +7 -0
  304. package/dist/store/index.d.ts.map +1 -0
  305. package/dist/store/index.js +6 -0
  306. package/dist/store/index.js.map +1 -0
  307. package/dist/types/action.d.ts +358 -0
  308. package/dist/types/action.d.ts.map +1 -0
  309. package/dist/types/action.js +96 -0
  310. package/dist/types/action.js.map +1 -0
  311. package/dist/types/events.d.ts +25 -0
  312. package/dist/types/events.d.ts.map +1 -0
  313. package/dist/types/events.js +6 -0
  314. package/dist/types/events.js.map +1 -0
  315. package/dist/types/execution.d.ts +145 -0
  316. package/dist/types/execution.d.ts.map +1 -0
  317. package/dist/types/execution.js +2 -0
  318. package/dist/types/execution.js.map +1 -0
  319. package/dist/types/gate.d.ts +98 -0
  320. package/dist/types/gate.d.ts.map +1 -0
  321. package/dist/types/gate.js +41 -0
  322. package/dist/types/gate.js.map +1 -0
  323. package/dist/types/github.d.ts +706 -0
  324. package/dist/types/github.d.ts.map +1 -0
  325. package/dist/types/github.js +6 -0
  326. package/dist/types/github.js.map +1 -0
  327. package/dist/types/index.d.ts +17 -0
  328. package/dist/types/index.d.ts.map +1 -0
  329. package/dist/types/index.js +8 -0
  330. package/dist/types/index.js.map +1 -0
  331. package/dist/types/logger.d.ts +60 -0
  332. package/dist/types/logger.d.ts.map +1 -0
  333. package/dist/types/logger.js +66 -0
  334. package/dist/types/logger.js.map +1 -0
  335. package/dist/types/retry.d.ts +36 -0
  336. package/dist/types/retry.d.ts.map +1 -0
  337. package/dist/types/retry.js +6 -0
  338. package/dist/types/retry.js.map +1 -0
  339. package/dist/types/store.d.ts +88 -0
  340. package/dist/types/store.d.ts.map +1 -0
  341. package/dist/types/store.js +6 -0
  342. package/dist/types/store.js.map +1 -0
  343. package/dist/types/workflow.d.ts +105 -0
  344. package/dist/types/workflow.d.ts.map +1 -0
  345. package/dist/types/workflow.js +6 -0
  346. package/dist/types/workflow.js.map +1 -0
  347. package/package.json +69 -0
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 The Generacy AI Authors
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,265 @@
1
+ # @generacy-ai/workflow-engine
2
+
3
+ Core workflow execution engine for Generacy. Provides workflow loading, validation, and execution with extensible action handlers.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @generacy-ai/workflow-engine
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - **YAML Workflow Definitions**: Define workflows in easy-to-read YAML format
14
+ - **Validation**: Zod-based schema validation with detailed error messages
15
+ - **Interpolation**: Variable substitution with `${inputs.*}`, `${steps.*}`, `${env.*}`
16
+ - **Retry System**: Configurable retry with constant, linear, and exponential backoff
17
+ - **Action Handlers**: Extensible action system for custom integrations
18
+ - **Event System**: Subscribe to execution events for monitoring
19
+ - **Cancellation**: AbortController support for graceful cancellation
20
+
21
+ ## Usage
22
+
23
+ ### Loading and Executing a Workflow
24
+
25
+ ```typescript
26
+ import {
27
+ loadWorkflow,
28
+ prepareWorkflow,
29
+ WorkflowExecutor,
30
+ registerBuiltinActions,
31
+ ConsoleLogger,
32
+ } from '@generacy-ai/workflow-engine';
33
+
34
+ // Register built-in action handlers
35
+ registerBuiltinActions();
36
+
37
+ // Load workflow from file
38
+ const definition = await loadWorkflow('./workflow.yaml');
39
+
40
+ // Prepare for execution
41
+ const workflow = prepareWorkflow(definition);
42
+
43
+ // Create executor
44
+ const executor = new WorkflowExecutor({
45
+ logger: new ConsoleLogger(),
46
+ });
47
+
48
+ // Execute with inputs
49
+ const result = await executor.execute(
50
+ workflow,
51
+ {
52
+ workdir: process.cwd(),
53
+ env: process.env,
54
+ },
55
+ {
56
+ projectName: 'my-project',
57
+ }
58
+ );
59
+
60
+ console.log('Status:', result.status);
61
+ ```
62
+
63
+ ### Workflow Definition Format
64
+
65
+ ```yaml
66
+ name: build-and-test
67
+ description: Build and test a Node.js project
68
+
69
+ inputs:
70
+ nodeVersion:
71
+ type: string
72
+ default: "20"
73
+ description: Node.js version to use
74
+
75
+ phases:
76
+ - name: setup
77
+ steps:
78
+ - name: install-deps
79
+ action: shell
80
+ command: npm ci
81
+ env:
82
+ NODE_VERSION: ${inputs.nodeVersion}
83
+
84
+ - name: test
85
+ steps:
86
+ - name: run-tests
87
+ action: verification.check
88
+ command: npm test
89
+ retry:
90
+ maxAttempts: 3
91
+ backoff: exponential
92
+ delay: 1s
93
+ ```
94
+
95
+ ### Custom Action Handlers
96
+
97
+ ```typescript
98
+ import {
99
+ BaseAction,
100
+ registerActionHandler,
101
+ type ActionContext,
102
+ type ActionResult,
103
+ type StepDefinition,
104
+ } from '@generacy-ai/workflow-engine';
105
+
106
+ class MyCustomAction extends BaseAction {
107
+ readonly type = 'my.custom';
108
+
109
+ canHandle(step: StepDefinition): boolean {
110
+ return step.action === 'my.custom';
111
+ }
112
+
113
+ protected async executeInternal(
114
+ step: StepDefinition,
115
+ context: ActionContext
116
+ ): Promise<Omit<ActionResult, 'duration'>> {
117
+ const input = this.getInput<string>(step, context, 'message');
118
+
119
+ // Do something custom
120
+ context.logger.info(`Custom action: ${input}`);
121
+
122
+ return this.successResult({ processed: true });
123
+ }
124
+ }
125
+
126
+ // Register the handler
127
+ registerActionHandler(new MyCustomAction());
128
+ ```
129
+
130
+ ### Event Subscription
131
+
132
+ ```typescript
133
+ const executor = new WorkflowExecutor({ logger });
134
+
135
+ executor.addEventListener((event) => {
136
+ switch (event.type) {
137
+ case 'workflow:start':
138
+ console.log(`Starting workflow: ${event.workflowName}`);
139
+ break;
140
+ case 'step:complete':
141
+ console.log(`Step completed: ${event.stepName}`);
142
+ break;
143
+ case 'workflow:error':
144
+ console.error(`Workflow failed: ${event.message}`);
145
+ break;
146
+ }
147
+ });
148
+ ```
149
+
150
+ ### Interpolation
151
+
152
+ The engine supports variable interpolation in step configurations:
153
+
154
+ - `${inputs.name}` - Access workflow inputs
155
+ - `${steps.stepName.output.field}` - Access output from previous steps
156
+ - `${env.VAR_NAME}` - Access environment variables
157
+
158
+ ### Retry Configuration
159
+
160
+ Steps can be configured with retry settings:
161
+
162
+ ```yaml
163
+ retry:
164
+ maxAttempts: 5
165
+ backoff: exponential # constant, linear, or exponential
166
+ delay: 1s # Initial delay
167
+ maxDelay: 30s # Maximum delay (for exponential)
168
+ jitter: true # Add randomness to delays
169
+ ```
170
+
171
+ ## Built-in Actions
172
+
173
+ - **shell**: Execute shell commands
174
+ - **workspace.prepare**: Git checkout/branch operations
175
+ - **agent.invoke**: Invoke Claude CLI for AI tasks
176
+ - **verification.check**: Run tests and linting
177
+ - **github.pr-create**: Create GitHub pull requests
178
+ - **speckit.\***: Spec-driven development methodology operations
179
+
180
+ ### Speckit Actions
181
+
182
+ The speckit action handler implements a spec-driven development methodology with the following operations:
183
+
184
+ **Deterministic Operations** (direct library calls):
185
+ - `speckit.create_feature` - Create feature branch and initialize spec directory
186
+ - `speckit.get_paths` - Get feature directory paths from branch name
187
+ - `speckit.check_prereqs` - Validate required spec files exist
188
+ - `speckit.copy_template` - Copy template files to feature directory
189
+
190
+ **AI-Dependent Operations** (agent delegation via Claude CLI):
191
+ - `speckit.specify` - Generate spec.md from feature description
192
+ - `speckit.clarify` - Generate clarification questions and post to issue
193
+ - `speckit.plan` - Generate implementation plan from spec
194
+ - `speckit.tasks` - Generate task list from plan
195
+ - `speckit.implement` - Execute tasks with progress tracking
196
+
197
+ **Example usage:**
198
+
199
+ ```yaml
200
+ phases:
201
+ - name: setup
202
+ steps:
203
+ - name: create-feature
204
+ uses: speckit.create_feature
205
+ with:
206
+ description: "Add user authentication"
207
+
208
+ - name: specification
209
+ steps:
210
+ - name: specify
211
+ uses: speckit.specify
212
+ with:
213
+ feature_dir: ${{ steps.create-feature.output.feature_dir }}
214
+ gate: spec-review # Optional review checkpoint
215
+
216
+ - name: planning
217
+ steps:
218
+ - name: plan
219
+ uses: speckit.plan
220
+ with:
221
+ feature_dir: ${{ steps.create-feature.output.feature_dir }}
222
+ gate: plan-review
223
+ ```
224
+
225
+ **Gate Configuration:**
226
+
227
+ Steps can include a `gate` field to pause workflow for human review:
228
+ - `spec-review` - Review specification before proceeding
229
+ - `plan-review` - Review implementation plan
230
+ - `tasks-review` - Review task breakdown
231
+
232
+ See `workflows/speckit-feature.yaml` for a complete example workflow.
233
+
234
+ ## API Reference
235
+
236
+ ### Main Exports
237
+
238
+ ```typescript
239
+ // Executor
240
+ export { WorkflowExecutor, ExecutionEventEmitter };
241
+
242
+ // Loader
243
+ export { loadWorkflow, loadWorkflowFromString, prepareWorkflow, validateWorkflow };
244
+
245
+ // Actions
246
+ export { registerActionHandler, getActionHandler, BaseAction };
247
+
248
+ // Interpolation
249
+ export { interpolate, ExecutionContext };
250
+
251
+ // Retry
252
+ export { RetryManager, withTimeout };
253
+
254
+ // Types
255
+ export type {
256
+ WorkflowDefinition,
257
+ ExecutionResult,
258
+ ActionHandler,
259
+ // ... and more
260
+ };
261
+ ```
262
+
263
+ ## License
264
+
265
+ MIT
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Abstract base action class implementing common functionality.
3
+ * Provides logging, timing, error wrapping, and shared utilities.
4
+ */
5
+ import type { ActionHandler, ActionContext, ActionResult, ActionIdentifier, ValidationResult, StepDefinition } from '../types/index.js';
6
+ /**
7
+ * Abstract base class for action handlers.
8
+ * Provides common functionality like timing, logging, and error handling.
9
+ */
10
+ export declare abstract class BaseAction implements ActionHandler {
11
+ abstract readonly type: ActionIdentifier;
12
+ /**
13
+ * Check if this handler can process the given step
14
+ */
15
+ abstract canHandle(step: StepDefinition): boolean;
16
+ /**
17
+ * Internal execution implementation to be overridden by subclasses
18
+ */
19
+ protected abstract executeInternal(step: StepDefinition, context: ActionContext): Promise<Omit<ActionResult, 'duration'>>;
20
+ /**
21
+ * Execute the action with timing and error handling
22
+ */
23
+ execute(step: StepDefinition, context: ActionContext): Promise<ActionResult>;
24
+ /**
25
+ * Default validation implementation - can be overridden
26
+ */
27
+ validate(_step: StepDefinition): ValidationResult;
28
+ /**
29
+ * Helper to get step input with optional default
30
+ */
31
+ protected getInput<T>(step: StepDefinition, context: ActionContext, key: string, defaultValue?: T): T | undefined;
32
+ /**
33
+ * Helper to get required input, throwing if not present
34
+ */
35
+ protected getRequiredInput<T>(step: StepDefinition, context: ActionContext, key: string): T;
36
+ /**
37
+ * Helper to create a successful result
38
+ */
39
+ protected successResult(output: unknown, options?: {
40
+ stdout?: string;
41
+ stderr?: string;
42
+ exitCode?: number;
43
+ filesModified?: string[];
44
+ }): Omit<ActionResult, 'duration'>;
45
+ /**
46
+ * Helper to create a failure result
47
+ */
48
+ protected failureResult(error: string, options?: {
49
+ output?: unknown;
50
+ stdout?: string;
51
+ stderr?: string;
52
+ exitCode?: number;
53
+ }): Omit<ActionResult, 'duration'>;
54
+ /**
55
+ * Helper to check if signal is aborted (for long-running operations)
56
+ */
57
+ protected checkCancellation(context: ActionContext): void;
58
+ /**
59
+ * Helper to merge environment variables
60
+ */
61
+ protected mergeEnv(context: ActionContext, stepEnv?: Record<string, string>): Record<string, string>;
62
+ }
63
+ //# sourceMappingURL=base-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-action.d.ts","sourceRoot":"","sources":["../../src/actions/base-action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,8BAAsB,UAAW,YAAW,aAAa;IACvD,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO;IAEjD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,CAChC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAE1C;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAgDlF;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,gBAAgB;IAQjD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,CAAC,EAClB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,MAAM,EACX,YAAY,CAAC,EAAE,CAAC,GACf,CAAC,GAAG,SAAS;IAehB;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAC1B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,MAAM,GACV,CAAC;IAQJ;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B,GACA,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IAWjC;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GACA,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IAWjC;;OAEG;IACH,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAMzD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAChB,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAO1B"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Abstract base class for action handlers.
3
+ * Provides common functionality like timing, logging, and error handling.
4
+ */
5
+ export class BaseAction {
6
+ /**
7
+ * Execute the action with timing and error handling
8
+ */
9
+ async execute(step, context) {
10
+ const startTime = Date.now();
11
+ // Log action start
12
+ context.logger.info(`Starting action [${this.type}]: ${step.name}`);
13
+ try {
14
+ // Check for cancellation before execution
15
+ if (context.signal.aborted) {
16
+ return {
17
+ success: false,
18
+ output: null,
19
+ error: 'Action cancelled before execution',
20
+ duration: Date.now() - startTime,
21
+ };
22
+ }
23
+ // Execute the action
24
+ const result = await this.executeInternal(step, context);
25
+ const duration = Date.now() - startTime;
26
+ // Log completion
27
+ if (result.success) {
28
+ context.logger.info(`Action [${this.type}] completed successfully in ${duration}ms`);
29
+ }
30
+ else {
31
+ context.logger.error(`Action [${this.type}] failed: ${result.error ?? 'Unknown error'}`);
32
+ }
33
+ return {
34
+ ...result,
35
+ duration,
36
+ };
37
+ }
38
+ catch (error) {
39
+ const duration = Date.now() - startTime;
40
+ const errorMessage = error instanceof Error ? error.message : String(error);
41
+ context.logger.error(`Action [${this.type}] threw error: ${errorMessage}`);
42
+ return {
43
+ success: false,
44
+ output: null,
45
+ error: errorMessage,
46
+ duration,
47
+ };
48
+ }
49
+ }
50
+ /**
51
+ * Default validation implementation - can be overridden
52
+ */
53
+ validate(_step) {
54
+ return {
55
+ valid: true,
56
+ errors: [],
57
+ warnings: [],
58
+ };
59
+ }
60
+ /**
61
+ * Helper to get step input with optional default
62
+ */
63
+ getInput(step, context, key, defaultValue) {
64
+ // Check step-level inputs first (from 'with' field in YAML)
65
+ const stepInputs = step.with;
66
+ if (stepInputs && key in stepInputs) {
67
+ return stepInputs[key];
68
+ }
69
+ // Check workflow-level inputs
70
+ if (key in context.inputs) {
71
+ return context.inputs[key];
72
+ }
73
+ return defaultValue;
74
+ }
75
+ /**
76
+ * Helper to get required input, throwing if not present
77
+ */
78
+ getRequiredInput(step, context, key) {
79
+ const value = this.getInput(step, context, key);
80
+ if (value === undefined) {
81
+ throw new Error(`Required input '${key}' not provided for step '${step.name}'`);
82
+ }
83
+ return value;
84
+ }
85
+ /**
86
+ * Helper to create a successful result
87
+ */
88
+ successResult(output, options) {
89
+ return {
90
+ success: true,
91
+ output,
92
+ exitCode: options?.exitCode ?? 0,
93
+ stdout: options?.stdout,
94
+ stderr: options?.stderr,
95
+ filesModified: options?.filesModified,
96
+ };
97
+ }
98
+ /**
99
+ * Helper to create a failure result
100
+ */
101
+ failureResult(error, options) {
102
+ return {
103
+ success: false,
104
+ output: options?.output ?? null,
105
+ error,
106
+ exitCode: options?.exitCode ?? 1,
107
+ stdout: options?.stdout,
108
+ stderr: options?.stderr,
109
+ };
110
+ }
111
+ /**
112
+ * Helper to check if signal is aborted (for long-running operations)
113
+ */
114
+ checkCancellation(context) {
115
+ if (context.signal.aborted) {
116
+ throw new Error('Action cancelled');
117
+ }
118
+ }
119
+ /**
120
+ * Helper to merge environment variables
121
+ */
122
+ mergeEnv(context, stepEnv) {
123
+ return {
124
+ ...process.env,
125
+ ...context.env,
126
+ ...stepEnv,
127
+ };
128
+ }
129
+ }
130
+ //# sourceMappingURL=base-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-action.js","sourceRoot":"","sources":["../../src/actions/base-action.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Agent invoke action handler.
3
+ * Handles Claude CLI invocation for AI agent tasks.
4
+ */
5
+ import { BaseAction } from '../base-action.js';
6
+ import type { ActionContext, ActionResult, ActionType, ValidationResult, StepDefinition } from '../../types/index.js';
7
+ /**
8
+ * Action handler for agent (Claude CLI) invocation
9
+ */
10
+ export declare class AgentInvokeAction extends BaseAction {
11
+ readonly type: ActionType;
12
+ canHandle(step: StepDefinition): boolean;
13
+ validate(step: StepDefinition): ValidationResult;
14
+ protected executeInternal(step: StepDefinition, context: ActionContext): Promise<Omit<ActionResult, 'duration'>>;
15
+ }
16
+ //# sourceMappingURL=agent-invoke.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-invoke.d.ts","sourceRoot":"","sources":["../../../src/actions/builtin/agent-invoke.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,gBAAgB,EAGhB,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAI9B;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAC/C,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAkB;IAE3C,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO;IAIxC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB;cAsBhC,eAAe,CAC7B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CAwF3C"}