@powerhousedao/workflow 6.2.3-dev.30 → 6.2.3-dev.31

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 (374) hide show
  1. package/README.md +8 -8
  2. package/dist/browser/BlockSelector-BHJQOhie.js +3051 -0
  3. package/dist/browser/BlockSelector-BHJQOhie.js.map +1 -0
  4. package/dist/browser/{connection-form-D-NETdDQ.js → connection-form-CaduwBiu.js} +349 -50
  5. package/dist/browser/connection-form-CaduwBiu.js.map +1 -0
  6. package/dist/browser/{data-tree-DA4sc7B7.js → data-tree-8219PVfh.js} +2 -2
  7. package/dist/browser/{data-tree-DA4sc7B7.js.map → data-tree-8219PVfh.js.map} +1 -1
  8. package/dist/browser/document-models/index.js +2 -2
  9. package/dist/browser/document-models/workflow/index.js +3 -3
  10. package/dist/browser/{document-models-BohsduV4.js → document-models-C1ZgIZyV.js} +7 -2
  11. package/dist/browser/{document-models-BohsduV4.js.map → document-models-C1ZgIZyV.js.map} +1 -1
  12. package/dist/browser/{editor-B6N0PCuZ.js → editor-BHV1MZS8.js} +2437 -6283
  13. package/dist/browser/editor-BHV1MZS8.js.map +1 -0
  14. package/dist/{node/editor-StBssjcQ.mjs → browser/editor-C0C1eB0R.js} +385 -119
  15. package/dist/browser/editor-C0C1eB0R.js.map +1 -0
  16. package/dist/browser/{editor-BkdwuOC-.js → editor-CFcXlZY2.js} +14 -24
  17. package/dist/browser/editor-CFcXlZY2.js.map +1 -0
  18. package/dist/browser/editors/connection-editor/module.js +1 -1
  19. package/dist/browser/editors/workflow-editor/module.js +1 -1
  20. package/dist/browser/editors/workflow-studio/module.js +1 -1
  21. package/dist/browser/index.js +97 -43
  22. package/dist/browser/index.js.map +1 -1
  23. package/dist/browser/{module-Bkms70LV.js → module-DU2vb3FH.js} +574 -94
  24. package/dist/browser/module-DU2vb3FH.js.map +1 -0
  25. package/dist/browser/{piece-auth-Z4mZEOtL.js → piece-auth-BS5CtQOG.js} +45 -12
  26. package/dist/browser/piece-auth-BS5CtQOG.js.map +1 -0
  27. package/dist/browser/reactor/index.js +2 -2
  28. package/dist/browser/runtime-queries-Ds2kk-Ow.js +2535 -0
  29. package/dist/browser/runtime-queries-Ds2kk-Ow.js.map +1 -0
  30. package/dist/browser/trigger-text-BkcklsMX.js +5569 -0
  31. package/dist/browser/trigger-text-BkcklsMX.js.map +1 -0
  32. package/dist/browser/{upgrade-manifests-BLrv3cf2.js → upgrade-manifests-BpakVE9l.js} +2 -2
  33. package/dist/browser/{upgrade-manifests-BLrv3cf2.js.map → upgrade-manifests-BpakVE9l.js.map} +1 -1
  34. package/dist/browser/{workflow-CGtVlhr8.js → workflow-BxShRhVy.js} +3 -2
  35. package/dist/browser/workflow-BxShRhVy.js.map +1 -0
  36. package/dist/node/BlockSelector-lOcIiaqt.mjs +3055 -0
  37. package/dist/node/BlockSelector-lOcIiaqt.mjs.map +1 -0
  38. package/dist/node/{connection-form-C9vbfSnA.mjs → connection-form-DWt29kft.mjs} +349 -50
  39. package/dist/node/connection-form-DWt29kft.mjs.map +1 -0
  40. package/dist/node/{data-tree-CbqpF3lC.mjs → data-tree-Cdx85Y19.mjs} +2 -2
  41. package/dist/node/{data-tree-CbqpF3lC.mjs.map → data-tree-Cdx85Y19.mjs.map} +1 -1
  42. package/dist/node/document-models/index.mjs +2 -2
  43. package/dist/node/document-models/workflow/index.mjs +3 -3
  44. package/dist/{browser/editor-CZ5NvCyv.js → node/editor-CR823u-y.mjs} +385 -119
  45. package/dist/node/editor-CR823u-y.mjs.map +1 -0
  46. package/dist/node/{editor-DP36YDk5.mjs → editor-CwX-G2Jv.mjs} +2437 -7479
  47. package/dist/node/editor-CwX-G2Jv.mjs.map +1 -0
  48. package/dist/node/{editor-By9BHI8e.mjs → editor-D_t8OtZn.mjs} +14 -24
  49. package/dist/node/editor-D_t8OtZn.mjs.map +1 -0
  50. package/dist/node/editors/connection-editor/module.mjs +1 -1
  51. package/dist/node/editors/workflow-editor/module.mjs +1 -1
  52. package/dist/node/editors/workflow-studio/module.mjs +1 -1
  53. package/dist/node/index.mjs +102 -43
  54. package/dist/node/index.mjs.map +1 -1
  55. package/dist/node/{module-DuxxhgKs.mjs → module-Dhe5E-VA.mjs} +574 -94
  56. package/dist/node/module-Dhe5E-VA.mjs.map +1 -0
  57. package/dist/node/{piece-auth-Z4mZEOtL.mjs → piece-auth-BS5CtQOG.mjs} +45 -12
  58. package/dist/node/piece-auth-BS5CtQOG.mjs.map +1 -0
  59. package/dist/node/pieces/index.mjs +0 -1
  60. package/dist/node/pieces/index.mjs.map +1 -1
  61. package/dist/node/pieces/reactor/descriptor.json +85 -3
  62. package/dist/node/pieces/reactor/index.mjs +14843 -163
  63. package/dist/node/pieces/reactor/index.mjs.map +1 -1
  64. package/dist/node/pieces/reactor/package.json +1 -1
  65. package/dist/node/runtime-queries-D5EGaCrH.mjs +2544 -0
  66. package/dist/node/runtime-queries-D5EGaCrH.mjs.map +1 -0
  67. package/dist/node/trigger-text-DJIAQBWg.mjs +6765 -0
  68. package/dist/node/trigger-text-DJIAQBWg.mjs.map +1 -0
  69. package/dist/node/{upgrade-manifests-C1sl_M-H.mjs → upgrade-manifests-CmNd742Y.mjs} +2 -2
  70. package/dist/node/{upgrade-manifests-C1sl_M-H.mjs.map → upgrade-manifests-CmNd742Y.mjs.map} +1 -1
  71. package/dist/node/{workflow-C-uuQPnf.mjs → workflow-CGzYGZnr.mjs} +3 -2
  72. package/dist/node/workflow-CGzYGZnr.mjs.map +1 -0
  73. package/dist/powerhouse.manifest.json +6 -1
  74. package/dist/style.css +151 -19
  75. package/dist/types/ai/tools.d.ts +3 -1
  76. package/dist/types/ai/tools.d.ts.map +1 -1
  77. package/dist/types/ai/workflow-tools.d.ts.map +1 -1
  78. package/dist/types/document-models/document-models.d.ts +3 -0
  79. package/dist/types/document-models/document-models.d.ts.map +1 -1
  80. package/dist/types/document-models/workflow/v1/actions.d.ts +3 -0
  81. package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -1
  82. package/dist/types/document-models/workflow/v1/gen/actions.d.ts +3 -1
  83. package/dist/types/document-models/workflow/v1/gen/actions.d.ts.map +1 -1
  84. package/dist/types/document-models/workflow/v1/gen/creators.d.ts +2 -0
  85. package/dist/types/document-models/workflow/v1/gen/creators.d.ts.map +1 -1
  86. package/dist/types/document-models/workflow/v1/gen/document-model.d.ts.map +1 -1
  87. package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts +3 -0
  88. package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts.map +1 -1
  89. package/dist/types/document-models/workflow/v1/gen/index.d.ts +1 -0
  90. package/dist/types/document-models/workflow/v1/gen/index.d.ts.map +1 -1
  91. package/dist/types/document-models/workflow/v1/gen/ph-factories.d.ts.map +1 -1
  92. package/dist/types/document-models/workflow/v1/gen/publishing/actions.d.ts +16 -0
  93. package/dist/types/document-models/workflow/v1/gen/publishing/actions.d.ts.map +1 -0
  94. package/dist/types/document-models/workflow/v1/gen/publishing/creators.d.ts +5 -0
  95. package/dist/types/document-models/workflow/v1/gen/publishing/creators.d.ts.map +1 -0
  96. package/dist/types/document-models/workflow/v1/gen/publishing/error.d.ts +14 -0
  97. package/dist/types/document-models/workflow/v1/gen/publishing/error.d.ts.map +1 -0
  98. package/dist/types/document-models/workflow/v1/gen/publishing/operations.d.ts +12 -0
  99. package/dist/types/document-models/workflow/v1/gen/publishing/operations.d.ts.map +1 -0
  100. package/dist/types/document-models/workflow/v1/gen/reducer.d.ts.map +1 -1
  101. package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts +6 -2
  102. package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts.map +1 -1
  103. package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts +3 -2
  104. package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts.map +1 -1
  105. package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts +13 -1
  106. package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts.map +1 -1
  107. package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts +2 -1
  108. package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts.map +1 -1
  109. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +102 -12
  110. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -1
  111. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts +21 -1
  112. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
  113. package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts +26 -1
  114. package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts.map +1 -1
  115. package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts +13 -1
  116. package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts.map +1 -1
  117. package/dist/types/document-models/workflow/v1/gen/utils.d.ts.map +1 -1
  118. package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts +13 -1
  119. package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts.map +1 -1
  120. package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts +13 -1
  121. package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts.map +1 -1
  122. package/dist/types/document-models/workflow/v1/module.d.ts +3 -0
  123. package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -1
  124. package/dist/types/document-models/workflow/v1/src/helpers.d.ts +15 -0
  125. package/dist/types/document-models/workflow/v1/src/helpers.d.ts.map +1 -0
  126. package/dist/types/document-models/workflow/v1/src/reducers/edges.d.ts.map +1 -1
  127. package/dist/types/document-models/workflow/v1/src/reducers/publishing.d.ts +3 -0
  128. package/dist/types/document-models/workflow/v1/src/reducers/publishing.d.ts.map +1 -0
  129. package/dist/types/document-models/workflow/v1/src/reducers/runtime.d.ts.map +1 -1
  130. package/dist/types/document-models/workflow/v1/src/reducers/steps.d.ts.map +1 -1
  131. package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts.map +1 -1
  132. package/dist/types/document-models/workflow/v1/src/reducers/variables.d.ts.map +1 -1
  133. package/dist/types/document-models/workflow/v1/src/reducers/workflow.d.ts.map +1 -1
  134. package/dist/types/document-models/workflow/v1/tests/block-validation-and-enable.test.d.ts +2 -0
  135. package/dist/types/document-models/workflow/v1/tests/block-validation-and-enable.test.d.ts.map +1 -0
  136. package/dist/types/document-models/workflow/v1/tests/config-and-variables.test.d.ts +2 -0
  137. package/dist/types/document-models/workflow/v1/tests/config-and-variables.test.d.ts.map +1 -0
  138. package/dist/types/document-models/workflow/v1/tests/draft-and-publish.test.d.ts +2 -0
  139. package/dist/types/document-models/workflow/v1/tests/draft-and-publish.test.d.ts.map +1 -0
  140. package/dist/types/document-models/workflow/v1/tests/updated-at.test.d.ts +2 -0
  141. package/dist/types/document-models/workflow/v1/tests/updated-at.test.d.ts.map +1 -0
  142. package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts.map +1 -1
  143. package/dist/types/editors/connection-editor/UsedBy.d.ts.map +1 -1
  144. package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -1
  145. package/dist/types/editors/connection-editor/connection-form.d.ts +2 -1
  146. package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -1
  147. package/dist/types/editors/connection-editor/connection-usage.d.ts +3 -2
  148. package/dist/types/editors/connection-editor/connection-usage.d.ts.map +1 -1
  149. package/dist/types/editors/connection-editor/editor.d.ts.map +1 -1
  150. package/dist/types/editors/connection-editor/piece-auth.d.ts +7 -1
  151. package/dist/types/editors/connection-editor/piece-auth.d.ts.map +1 -1
  152. package/dist/types/editors/connection-editor/status.d.ts +2 -1
  153. package/dist/types/editors/connection-editor/status.d.ts.map +1 -1
  154. package/dist/types/editors/shared/controls.d.ts +17 -1
  155. package/dist/types/editors/shared/controls.d.ts.map +1 -1
  156. package/dist/types/editors/shared/editor-chrome.d.ts +2 -0
  157. package/dist/types/editors/shared/editor-chrome.d.ts.map +1 -1
  158. package/dist/types/editors/shared/icons.d.ts +2 -0
  159. package/dist/types/editors/shared/icons.d.ts.map +1 -1
  160. package/dist/types/editors/shared/undo-plan.d.ts +20 -0
  161. package/dist/types/editors/shared/undo-plan.d.ts.map +1 -0
  162. package/dist/types/editors/shared/undo-plan.test.d.ts +2 -0
  163. package/dist/types/editors/shared/undo-plan.test.d.ts.map +1 -0
  164. package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -1
  165. package/dist/types/editors/workflow-editor/editor.d.ts +0 -1
  166. package/dist/types/editors/workflow-editor/editor.d.ts.map +1 -1
  167. package/dist/types/editors/workflow-editor/run-kinds.d.ts +5 -0
  168. package/dist/types/editors/workflow-editor/run-kinds.d.ts.map +1 -0
  169. package/dist/types/editors/workflow-editor/runtime-api.d.ts +12 -139
  170. package/dist/types/editors/workflow-editor/runtime-api.d.ts.map +1 -1
  171. package/dist/types/editors/workflow-editor/runtime-client.d.ts +260 -0
  172. package/dist/types/editors/workflow-editor/runtime-client.d.ts.map +1 -0
  173. package/dist/types/editors/workflow-editor/runtime-client.test.d.ts +2 -0
  174. package/dist/types/editors/workflow-editor/runtime-client.test.d.ts.map +1 -0
  175. package/dist/types/editors/workflow-editor/runtime-context.d.ts +45 -0
  176. package/dist/types/editors/workflow-editor/runtime-context.d.ts.map +1 -0
  177. package/dist/types/editors/workflow-editor/runtime-persist.d.ts +23 -0
  178. package/dist/types/editors/workflow-editor/runtime-persist.d.ts.map +1 -0
  179. package/dist/types/editors/workflow-editor/runtime-persist.test.d.ts +2 -0
  180. package/dist/types/editors/workflow-editor/runtime-persist.test.d.ts.map +1 -0
  181. package/dist/types/editors/workflow-editor/runtime-queries.d.ts +128 -0
  182. package/dist/types/editors/workflow-editor/runtime-queries.d.ts.map +1 -0
  183. package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts +3 -3
  184. package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts.map +1 -1
  185. package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts +4 -3
  186. package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts.map +1 -1
  187. package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts +2 -3
  188. package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts.map +1 -1
  189. package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts.map +1 -1
  190. package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts +6 -5
  191. package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts.map +1 -1
  192. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts +7 -1
  193. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
  194. package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts +34 -0
  195. package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts.map +1 -0
  196. package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts.map +1 -1
  197. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts +2 -3
  198. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
  199. package/dist/types/editors/workflow-editor/ui/StepTest.d.ts +11 -0
  200. package/dist/types/editors/workflow-editor/ui/StepTest.d.ts.map +1 -0
  201. package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts +0 -1
  202. package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts.map +1 -1
  203. package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts +1 -3
  204. package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts.map +1 -1
  205. package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts +1 -3
  206. package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts.map +1 -1
  207. package/dist/types/editors/workflow-editor/ui/add-follow-up.d.ts +31 -0
  208. package/dist/types/editors/workflow-editor/ui/add-follow-up.d.ts.map +1 -0
  209. package/dist/types/editors/workflow-editor/ui/add-follow-up.test.d.ts +2 -0
  210. package/dist/types/editors/workflow-editor/ui/add-follow-up.test.d.ts.map +1 -0
  211. package/dist/types/editors/workflow-editor/ui/ap-edge.d.ts.map +1 -1
  212. package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts +2 -1
  213. package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts.map +1 -1
  214. package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts +7 -9
  215. package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts.map +1 -1
  216. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts +10 -5
  217. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts.map +1 -1
  218. package/dist/types/editors/workflow-editor/ui/blocks.d.ts +43 -2
  219. package/dist/types/editors/workflow-editor/ui/blocks.d.ts.map +1 -1
  220. package/dist/types/editors/workflow-editor/ui/blocks.test.d.ts +2 -0
  221. package/dist/types/editors/workflow-editor/ui/blocks.test.d.ts.map +1 -0
  222. package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts +4 -2
  223. package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts.map +1 -1
  224. package/dist/types/editors/workflow-editor/ui/connection-create.d.ts +3 -3
  225. package/dist/types/editors/workflow-editor/ui/connection-create.d.ts.map +1 -1
  226. package/dist/types/editors/workflow-editor/ui/design-time.d.ts +92 -0
  227. package/dist/types/editors/workflow-editor/ui/design-time.d.ts.map +1 -0
  228. package/dist/types/editors/workflow-editor/ui/design-time.test.d.ts +2 -0
  229. package/dist/types/editors/workflow-editor/ui/design-time.test.d.ts.map +1 -0
  230. package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts +10 -2
  231. package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts.map +1 -1
  232. package/dist/types/editors/workflow-editor/ui/forms.d.ts +35 -6
  233. package/dist/types/editors/workflow-editor/ui/forms.d.ts.map +1 -1
  234. package/dist/types/editors/workflow-editor/ui/model.d.ts +58 -13
  235. package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -1
  236. package/dist/types/editors/workflow-editor/ui/piece-source.d.ts +11 -6
  237. package/dist/types/editors/workflow-editor/ui/piece-source.d.ts.map +1 -1
  238. package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts +5 -0
  239. package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts.map +1 -1
  240. package/dist/types/editors/workflow-editor/ui/prop-controls.test.d.ts +2 -0
  241. package/dist/types/editors/workflow-editor/ui/prop-controls.test.d.ts.map +1 -0
  242. package/dist/types/editors/workflow-editor/ui/prop-defaults.d.ts +4 -0
  243. package/dist/types/editors/workflow-editor/ui/prop-defaults.d.ts.map +1 -0
  244. package/dist/types/editors/workflow-editor/ui/prop-defaults.test.d.ts +2 -0
  245. package/dist/types/editors/workflow-editor/ui/prop-defaults.test.d.ts.map +1 -0
  246. package/dist/types/editors/workflow-editor/ui/query-keys.d.ts +54 -0
  247. package/dist/types/editors/workflow-editor/ui/query-keys.d.ts.map +1 -0
  248. package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts +3 -8
  249. package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts.map +1 -1
  250. package/dist/types/editors/workflow-editor/ui/secret-ref.d.ts +18 -0
  251. package/dist/types/editors/workflow-editor/ui/secret-ref.d.ts.map +1 -0
  252. package/dist/types/editors/workflow-editor/ui/step-test.d.ts +14 -0
  253. package/dist/types/editors/workflow-editor/ui/step-test.d.ts.map +1 -0
  254. package/dist/types/editors/workflow-editor/ui/step-test.test.d.ts +2 -0
  255. package/dist/types/editors/workflow-editor/ui/step-test.test.d.ts.map +1 -0
  256. package/dist/types/editors/workflow-editor/ui/test-state.d.ts +7 -0
  257. package/dist/types/editors/workflow-editor/ui/test-state.d.ts.map +1 -0
  258. package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts +2 -1
  259. package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts.map +1 -1
  260. package/dist/types/editors/workflow-editor/ui/use-validity.d.ts +28 -0
  261. package/dist/types/editors/workflow-editor/ui/use-validity.d.ts.map +1 -0
  262. package/dist/types/editors/workflow-editor/ui/validation.d.ts +33 -1
  263. package/dist/types/editors/workflow-editor/ui/validation.d.ts.map +1 -1
  264. package/dist/types/editors/workflow-editor/ui/variable-types.d.ts +14 -0
  265. package/dist/types/editors/workflow-editor/ui/variable-types.d.ts.map +1 -0
  266. package/dist/types/editors/workflow-editor/ui/variable-types.test.d.ts +2 -0
  267. package/dist/types/editors/workflow-editor/ui/variable-types.test.d.ts.map +1 -0
  268. package/dist/types/editors/workflow-editor/ui/version-badge.d.ts +33 -0
  269. package/dist/types/editors/workflow-editor/ui/version-badge.d.ts.map +1 -0
  270. package/dist/types/editors/workflow-editor/ui/version-badge.test.d.ts +2 -0
  271. package/dist/types/editors/workflow-editor/ui/version-badge.test.d.ts.map +1 -0
  272. package/dist/types/editors/workflow-editor/use-runtime-url.d.ts +0 -1
  273. package/dist/types/editors/workflow-editor/use-runtime-url.d.ts.map +1 -1
  274. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts +1 -1
  275. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts.map +1 -1
  276. package/dist/types/editors/workflow-studio/components/RunsView.d.ts +4 -1
  277. package/dist/types/editors/workflow-studio/components/RunsView.d.ts.map +1 -1
  278. package/dist/types/editors/workflow-studio/components/Sidebar.d.ts.map +1 -1
  279. package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts +1 -1
  280. package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts.map +1 -1
  281. package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts +2 -1
  282. package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts.map +1 -1
  283. package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts +13 -0
  284. package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts.map +1 -0
  285. package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts +1 -1
  286. package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts.map +1 -1
  287. package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts +0 -1
  288. package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts.map +1 -1
  289. package/dist/types/editors/workflow-studio/components/chain.d.ts +5 -3
  290. package/dist/types/editors/workflow-studio/components/chain.d.ts.map +1 -1
  291. package/dist/types/editors/workflow-studio/components/run-format.d.ts +11 -2
  292. package/dist/types/editors/workflow-studio/components/run-format.d.ts.map +1 -1
  293. package/dist/types/editors/workflow-studio/components/step-outline.d.ts +3 -1
  294. package/dist/types/editors/workflow-studio/components/step-outline.d.ts.map +1 -1
  295. package/dist/types/editors/workflow-studio/components/ui.d.ts +2 -0
  296. package/dist/types/editors/workflow-studio/components/ui.d.ts.map +1 -1
  297. package/dist/types/editors/workflow-studio/components/useRuns.d.ts +4 -1
  298. package/dist/types/editors/workflow-studio/components/useRuns.d.ts.map +1 -1
  299. package/dist/types/editors/workflow-studio/editor.d.ts.map +1 -1
  300. package/dist/types/pieces/index.d.ts.map +1 -1
  301. package/dist/types/pieces/reactor/lib/actions/action-list-prop.test.d.ts +2 -0
  302. package/dist/types/pieces/reactor/lib/actions/action-list-prop.test.d.ts.map +1 -0
  303. package/dist/types/pieces/reactor/lib/actions/document-create.d.ts +14 -1
  304. package/dist/types/pieces/reactor/lib/actions/document-create.d.ts.map +1 -1
  305. package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts +14 -1
  306. package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts.map +1 -1
  307. package/dist/types/pieces/reactor/lib/actions/document-get.d.ts +1 -0
  308. package/dist/types/pieces/reactor/lib/actions/document-get.d.ts.map +1 -1
  309. package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts +1 -0
  310. package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts.map +1 -1
  311. package/dist/types/pieces/reactor/lib/input-props.d.ts.map +1 -1
  312. package/dist/types/pieces/reactor/lib/input-schema.d.ts +11 -2
  313. package/dist/types/pieces/reactor/lib/input-schema.d.ts.map +1 -1
  314. package/dist/types/pieces/reactor/lib/parse.d.ts +22 -4
  315. package/dist/types/pieces/reactor/lib/parse.d.ts.map +1 -1
  316. package/dist/types/pieces/reactor/lib/reactor.d.ts +15 -1
  317. package/dist/types/pieces/reactor/lib/reactor.d.ts.map +1 -1
  318. package/dist/types/scripts/ui-stack.d.ts +53 -11
  319. package/dist/types/scripts/ui-stack.d.ts.map +1 -1
  320. package/dist/types/test/ui/block-picker.spec.d.ts +2 -0
  321. package/dist/types/test/ui/block-picker.spec.d.ts.map +1 -0
  322. package/dist/types/test/ui/branch.spec.d.ts +2 -0
  323. package/dist/types/test/ui/branch.spec.d.ts.map +1 -0
  324. package/dist/types/test/ui/canvas-logos.spec.d.ts +2 -0
  325. package/dist/types/test/ui/canvas-logos.spec.d.ts.map +1 -0
  326. package/dist/types/test/ui/fixtures.d.ts +1 -0
  327. package/dist/types/test/ui/fixtures.d.ts.map +1 -1
  328. package/dist/types/test/ui/global-setup.d.ts.map +1 -1
  329. package/dist/types/test/ui/harness/prop-controls.d.ts.map +1 -1
  330. package/dist/types/test/ui/piece-version.spec.d.ts +2 -0
  331. package/dist/types/test/ui/piece-version.spec.d.ts.map +1 -0
  332. package/dist/types/test/ui/ports.spec.d.ts +2 -0
  333. package/dist/types/test/ui/ports.spec.d.ts.map +1 -0
  334. package/dist/types/test/ui/publish.spec.d.ts +2 -0
  335. package/dist/types/test/ui/publish.spec.d.ts.map +1 -0
  336. package/dist/types/test/ui/step-test.spec.d.ts +2 -0
  337. package/dist/types/test/ui/step-test.spec.d.ts.map +1 -0
  338. package/dist/types/test/ui/variables.spec.d.ts +2 -0
  339. package/dist/types/test/ui/variables.spec.d.ts.map +1 -0
  340. package/dist/types/test/ui/webhook.spec.d.ts +2 -0
  341. package/dist/types/test/ui/webhook.spec.d.ts.map +1 -0
  342. package/dist/types/test/ui/workflow-menu.spec.d.ts +2 -0
  343. package/dist/types/test/ui/workflow-menu.spec.d.ts.map +1 -0
  344. package/package.json +11 -10
  345. package/dist/browser/BlockSelector-D24DIiSX.js +0 -1388
  346. package/dist/browser/BlockSelector-D24DIiSX.js.map +0 -1
  347. package/dist/browser/connection-form-D-NETdDQ.js.map +0 -1
  348. package/dist/browser/editor-B6N0PCuZ.js.map +0 -1
  349. package/dist/browser/editor-BkdwuOC-.js.map +0 -1
  350. package/dist/browser/editor-CZ5NvCyv.js.map +0 -1
  351. package/dist/browser/module-Bkms70LV.js.map +0 -1
  352. package/dist/browser/piece-auth-Z4mZEOtL.js.map +0 -1
  353. package/dist/browser/runtime-api-DDMQc4PB.js +0 -558
  354. package/dist/browser/runtime-api-DDMQc4PB.js.map +0 -1
  355. package/dist/browser/trigger-text-CUv5Z2Uk.js +0 -551
  356. package/dist/browser/trigger-text-CUv5Z2Uk.js.map +0 -1
  357. package/dist/browser/workflow-CGtVlhr8.js.map +0 -1
  358. package/dist/node/BlockSelector-CTmmpYxu.mjs +0 -1388
  359. package/dist/node/BlockSelector-CTmmpYxu.mjs.map +0 -1
  360. package/dist/node/connection-form-C9vbfSnA.mjs.map +0 -1
  361. package/dist/node/editor-By9BHI8e.mjs.map +0 -1
  362. package/dist/node/editor-DP36YDk5.mjs.map +0 -1
  363. package/dist/node/editor-StBssjcQ.mjs.map +0 -1
  364. package/dist/node/module-DuxxhgKs.mjs.map +0 -1
  365. package/dist/node/piece-auth-Z4mZEOtL.mjs.map +0 -1
  366. package/dist/node/runtime-api-DDMQc4PB.mjs +0 -558
  367. package/dist/node/runtime-api-DDMQc4PB.mjs.map +0 -1
  368. package/dist/node/trigger-text-Bzq6VfOQ.mjs +0 -551
  369. package/dist/node/trigger-text-Bzq6VfOQ.mjs.map +0 -1
  370. package/dist/node/workflow-C-uuQPnf.mjs.map +0 -1
  371. package/dist/types/editors/workflow-editor/runtime-api.test.d.ts +0 -2
  372. package/dist/types/editors/workflow-editor/runtime-api.test.d.ts.map +0 -1
  373. package/dist/types/editors/workflow-editor/runtime-piece-source.d.ts +0 -2
  374. package/dist/types/editors/workflow-editor/runtime-piece-source.d.ts.map +0 -1
@@ -1,558 +0,0 @@
1
- import { ambientRenownTokenProvider } from "@powerhousedao/reactor-browser/graphql-client";
2
- //#region editors/workflow-editor/ui/forms.ts
3
- const POLL_INTERVAL_PROP = {
4
- name: "pollEverySeconds",
5
- displayName: "Poll every (seconds)",
6
- type: "NUMBER",
7
- required: false,
8
- description: "How often the reactor checks this trigger; 60 at the least. Omit to follow the piece's own cadence."
9
- };
10
- const text = (name, displayName, required = false, description) => ({
11
- name,
12
- displayName,
13
- type: "SHORT_TEXT",
14
- required,
15
- description
16
- });
17
- const secretRef = (name, displayName, required = false, description) => ({
18
- name,
19
- displayName,
20
- type: "PH_SECRET_REF",
21
- required,
22
- description
23
- });
24
- const number = (name, displayName, required = false, description) => ({
25
- name,
26
- displayName,
27
- type: "NUMBER",
28
- required,
29
- description
30
- });
31
- const advanced = (prop) => ({
32
- ...prop,
33
- advanced: true
34
- });
35
- const shownWhen = (prop, sibling, oneOf) => ({
36
- ...prop,
37
- showWhen: {
38
- prop: sibling,
39
- oneOf
40
- }
41
- });
42
- const dropdown = (name, displayName, options, required = false, description) => ({
43
- name,
44
- displayName,
45
- type: "STATIC_DROPDOWN",
46
- required,
47
- description,
48
- staticOptions: options
49
- });
50
- const SIGNED_SCHEMES = [
51
- "token",
52
- "hmac",
53
- "hmac-prefixed",
54
- "hmac-timestamped"
55
- ];
56
- const HMAC_SCHEMES = [
57
- "hmac",
58
- "hmac-prefixed",
59
- "hmac-timestamped"
60
- ];
61
- const CORE_FORMS = {
62
- "core#manual": {
63
- title: "Manual trigger",
64
- requireAuth: false,
65
- auth: "none",
66
- props: []
67
- },
68
- "core#schedule": {
69
- title: "Schedule",
70
- requireAuth: false,
71
- auth: "none",
72
- props: [
73
- {
74
- ...dropdown("mode", "Runs", [{
75
- label: "On a cron schedule",
76
- value: "cron"
77
- }, {
78
- label: "At a fixed interval",
79
- value: "interval"
80
- }]),
81
- defaultValue: "cron"
82
- },
83
- {
84
- ...text("cron", "Cron expression", true, "Five fields, e.g. 0 9 * * 1-5 runs at 09:00 on weekdays."),
85
- showWhen: {
86
- prop: "mode",
87
- oneOf: ["cron", void 0],
88
- unlessSet: "every"
89
- }
90
- },
91
- shownWhen(number("every", "Every", true, "At least one minute."), "mode", ["interval"]),
92
- shownWhen({
93
- ...dropdown("unit", "Unit", [
94
- {
95
- label: "Minutes",
96
- value: "minutes"
97
- },
98
- {
99
- label: "Hours",
100
- value: "hours"
101
- },
102
- {
103
- label: "Days",
104
- value: "days"
105
- }
106
- ]),
107
- defaultValue: "minutes"
108
- }, "mode", ["interval"]),
109
- text("timezone", "Timezone", false, "An IANA name such as Europe/Lisbon. Defaults to UTC.")
110
- ]
111
- },
112
- "core#webhook": {
113
- title: "Webhook",
114
- requireAuth: false,
115
- auth: "none",
116
- props: [
117
- dropdown("methods", "Method", [
118
- {
119
- label: "POST",
120
- value: "POST"
121
- },
122
- {
123
- label: "Any",
124
- value: "ANY"
125
- },
126
- {
127
- label: "GET",
128
- value: "GET"
129
- },
130
- {
131
- label: "PUT",
132
- value: "PUT"
133
- },
134
- {
135
- label: "PATCH",
136
- value: "PATCH"
137
- },
138
- {
139
- label: "DELETE",
140
- value: "DELETE"
141
- }
142
- ], true),
143
- dropdown("scheme", "Verification", [
144
- {
145
- label: "None — the URL's token only",
146
- value: "none"
147
- },
148
- {
149
- label: "Shared token in a header",
150
- value: "token"
151
- },
152
- {
153
- label: "HMAC digest",
154
- value: "hmac"
155
- },
156
- {
157
- label: "HMAC digest with a label (sha256=…)",
158
- value: "hmac-prefixed"
159
- },
160
- {
161
- label: "HMAC digest, timestamped (t=…,v1=…)",
162
- value: "hmac-timestamped"
163
- }
164
- ], true),
165
- shownWhen(secretRef("secretRef", "Secret", true, "The shared secret: the value the header must equal, or the key the sender signs with"), "scheme", SIGNED_SCHEMES),
166
- advanced(shownWhen(text("header", "Header", false, "Where the token or signature is read from. Defaults to the header the chosen scheme conventionally uses; set it only if the sender differs"), "scheme", SIGNED_SCHEMES)),
167
- advanced(shownWhen(number("toleranceSeconds", "Replay window (seconds)", false, "Rejects a delivery signed longer ago than this, so a captured request expires. Default 300"), "scheme", ["hmac-timestamped"])),
168
- advanced(shownWhen(dropdown("algorithm", "Hash", [
169
- {
170
- label: "SHA-256 (default)",
171
- value: "sha256"
172
- },
173
- {
174
- label: "SHA-1",
175
- value: "sha1"
176
- },
177
- {
178
- label: "SHA-512",
179
- value: "sha512"
180
- }
181
- ]), "scheme", HMAC_SCHEMES)),
182
- advanced(shownWhen(dropdown("encoding", "Digest encoding", [{
183
- label: "Hexadecimal (default)",
184
- value: "hex"
185
- }, {
186
- label: "Base64",
187
- value: "base64"
188
- }]), "scheme", HMAC_SCHEMES)),
189
- advanced(shownWhen(text("prefix", "Signature label", false, "The literal before the digest. Defaults to the hash and an equals sign, e.g. sha256=. Leave blank for a sender that sends the digest with no label"), "scheme", ["hmac-prefixed"])),
190
- advanced(text("dedupeField", "Event id field", false, "Where the sender puts its own event id, so a redelivery is accepted without a second run. A bare name reads a query param or a top-level body field; prefix with header: or body: to read a header or a nested path (header:x-delivery-id, body:data.object.id)")),
191
- advanced(number("dedupeTtlSeconds", "Dedupe window (seconds)", false, "How long an event id is remembered. Default 300")),
192
- advanced(text("challengeField", "Challenge field", false, "Echo this field back instead of running, for senders that verify the endpoint before registering it. Same header:/body: prefixes as the event id field")),
193
- advanced(dropdown("responseMode", "Response", [{
194
- label: "Answer immediately (202)",
195
- value: "async"
196
- }, {
197
- label: "Wait for the run (200)",
198
- value: "sync"
199
- }], false, "Waiting holds the sender's socket open for the whole run")),
200
- advanced(number("responseStatus", "Success status", false, "Status returned on acceptance. Default 202 async, 200 sync"))
201
- ]
202
- },
203
- "core#branch": {
204
- title: "Branch",
205
- requireAuth: false,
206
- auth: "none",
207
- props: [text("condition", "Condition", true, "e.g. {{steps.fetch.output.body.ok}}"), text("equals", "Equals", false, "Take the true port only when the condition matches this; omit for truthiness")]
208
- },
209
- "core#assert": {
210
- title: "Assert",
211
- requireAuth: false,
212
- auth: "none",
213
- props: [
214
- text("value", "Value", true, "e.g. {{steps.describe.output}} - the run fails when it is blank"),
215
- {
216
- name: "rejectValues",
217
- displayName: "Rejected values",
218
- type: "ARRAY",
219
- required: false,
220
- description: "One per line; the run fails when the value matches any of them"
221
- },
222
- {
223
- name: "allowValues",
224
- displayName: "Allowed values",
225
- type: "ARRAY",
226
- required: false,
227
- description: "One per line; when set, anything else fails. Safer than a reject list for model output"
228
- },
229
- {
230
- name: "allowEmpty",
231
- displayName: "Allow empty",
232
- type: "CHECKBOX",
233
- required: false,
234
- description: "Accept a blank value instead of failing"
235
- },
236
- text("message", "Failure message", false, "Replaces the default error")
237
- ]
238
- }
239
- };
240
- //#endregion
241
- //#region editors/workflow-editor/ui/blocks.ts
242
- const REACTOR_PIECE = "@powerhousedao/piece-reactor";
243
- function isReactorPieceBlock(blockType) {
244
- return blockType.startsWith(`@powerhousedao/piece-reactor#`) || blockType.startsWith(`@powerhousedao/piece-reactor@`);
245
- }
246
- const TRIGGER_PRESETS = [
247
- {
248
- label: "Manual",
249
- blockType: "core#manual",
250
- group: "core",
251
- description: "Fired on demand with a payload.",
252
- defaultConfig: {}
253
- },
254
- {
255
- label: "Schedule",
256
- blockType: "core#schedule",
257
- group: "core",
258
- description: "Fires on a cron expression or fixed interval.",
259
- defaultConfig: {
260
- mode: "cron",
261
- cron: "0 9 * * 1-5",
262
- timezone: "UTC"
263
- }
264
- },
265
- {
266
- label: "Webhook",
267
- blockType: "core#webhook",
268
- group: "core",
269
- description: "Fires when a provider POSTs to this workflow's URL.",
270
- defaultConfig: {
271
- methods: "POST",
272
- scheme: "none",
273
- responseMode: "async"
274
- }
275
- },
276
- {
277
- label: "Document event",
278
- blockType: `${REACTOR_PIECE}#trigger:document-event`,
279
- group: "powerhouse",
280
- description: "Fires when a matching document operation lands.",
281
- defaultConfig: {}
282
- },
283
- {
284
- label: "Document created",
285
- blockType: `${REACTOR_PIECE}#trigger:document-created`,
286
- group: "powerhouse",
287
- description: "Fires when a document is added to a drive.",
288
- defaultConfig: {}
289
- },
290
- {
291
- label: "Document deleted",
292
- blockType: `${REACTOR_PIECE}#trigger:document-deleted`,
293
- group: "powerhouse",
294
- description: "Fires when a document is removed from a drive.",
295
- defaultConfig: {}
296
- }
297
- ];
298
- const STEP_PRESETS = [
299
- {
300
- label: "Branch",
301
- blockType: "core#branch",
302
- group: "core",
303
- description: "Routes true/false on a condition.",
304
- defaultConfig: { condition: "{{trigger.payload.ok}}" }
305
- },
306
- {
307
- label: "Assert",
308
- blockType: "core#assert",
309
- group: "core",
310
- description: "Fails the run when a value is blank, rejected or not allowed.",
311
- defaultConfig: {
312
- value: "",
313
- allowValues: []
314
- }
315
- },
316
- {
317
- label: "Create document",
318
- blockType: `${REACTOR_PIECE}#document-create`,
319
- group: "powerhouse",
320
- description: "Creates a Powerhouse document.",
321
- defaultConfig: {
322
- documentType: "",
323
- name: ""
324
- }
325
- },
326
- {
327
- label: "Dispatch actions",
328
- blockType: `${REACTOR_PIECE}#document-dispatch`,
329
- group: "powerhouse",
330
- description: "Sends actions to a document.",
331
- defaultConfig: { documentId: "" }
332
- },
333
- {
334
- label: "Get document",
335
- blockType: `${REACTOR_PIECE}#document-get`,
336
- group: "powerhouse",
337
- description: "Reads a document's current state.",
338
- defaultConfig: { documentId: "" }
339
- },
340
- {
341
- label: "Find documents",
342
- blockType: `${REACTOR_PIECE}#document-find`,
343
- group: "powerhouse",
344
- description: "Lists documents by type and name.",
345
- defaultConfig: { documentType: "" }
346
- },
347
- {
348
- label: "List document types",
349
- blockType: `${REACTOR_PIECE}#document-types`,
350
- group: "powerhouse",
351
- description: "Document models installed on this reactor.",
352
- defaultConfig: {}
353
- },
354
- {
355
- label: "Get document schema",
356
- blockType: `${REACTOR_PIECE}#document-schema`,
357
- group: "powerhouse",
358
- description: "Action and state schemas of a document type.",
359
- defaultConfig: { documentType: "" }
360
- }
361
- ];
362
- //#endregion
363
- //#region editors/workflow-editor/runtime-api.ts
364
- const DEFAULT_RUNTIME_URL = "http://localhost:4001/graphql/workflow-runtime";
365
- let currentRuntimeUrl;
366
- function setRuntimeUrl(url) {
367
- if (url === currentRuntimeUrl) return;
368
- currentRuntimeUrl = url;
369
- formCache.clear();
370
- outputTreeCache.clear();
371
- catalogCache = void 0;
372
- }
373
- function runtimeUrl() {
374
- return currentRuntimeUrl ?? "http://localhost:4001/graphql/workflow-runtime";
375
- }
376
- async function gql(query, variables) {
377
- const token = await ambientRenownTokenProvider();
378
- const body = await (await fetch(runtimeUrl(), {
379
- method: "POST",
380
- headers: {
381
- "content-type": "application/json",
382
- ...token ? { authorization: `Bearer ${token}` } : {}
383
- },
384
- body: JSON.stringify({
385
- query,
386
- variables
387
- })
388
- })).json();
389
- if (body.errors?.length) throw new Error(body.errors[0].message);
390
- if (!body.data) throw new Error("Empty GraphQL response");
391
- return body.data;
392
- }
393
- const formCache = /* @__PURE__ */ new Map();
394
- function getBlockForm(blockType) {
395
- const core = CORE_FORMS[blockType];
396
- if (core) return Promise.resolve(core);
397
- let cached = formCache.get(blockType);
398
- if (!cached) {
399
- cached = gql(`query Descriptor($blockType: String!) {
400
- workflowRuntime { blockDescriptor(blockType: $blockType) }
401
- }`, { blockType }).then((data) => {
402
- const descriptor = data.workflowRuntime.blockDescriptor;
403
- const entry = descriptor?.action ?? descriptor?.trigger;
404
- if (!descriptor || !entry) return null;
405
- const isTrigger = !descriptor.action && Boolean(descriptor.trigger);
406
- const polled = isTrigger && entry.strategy !== "WEBHOOK" && !isReactorPieceBlock(blockType);
407
- const props = entry.props;
408
- return {
409
- title: `${descriptor.displayName} · ${entry.displayName}`,
410
- requireAuth: entry.requireAuth,
411
- auth: !descriptor.auth ? "none" : entry.requireAuth ? "required" : "optional",
412
- props: polled ? [...props, POLL_INTERVAL_PROP] : props,
413
- triggerStrategy: isTrigger ? entry.strategy : void 0,
414
- ...entry.description ? { description: entry.description } : {},
415
- ...entry.propertyGroups ? { propertyGroups: entry.propertyGroups } : {},
416
- ...entry.classification ? { classification: entry.classification } : {},
417
- ...entry.errorHandlingOptions ? { errorHandling: entry.errorHandlingOptions } : {}
418
- };
419
- });
420
- formCache.set(blockType, cached);
421
- cached.catch(() => formCache.delete(blockType));
422
- }
423
- return cached;
424
- }
425
- let catalogCache;
426
- function fetchPieceCatalog() {
427
- catalogCache ??= gql(`query Catalog { workflowRuntime { pieceCatalog } }`, {}).then((data) => data.workflowRuntime.pieceCatalog);
428
- catalogCache.catch(() => catalogCache = void 0);
429
- return catalogCache;
430
- }
431
- async function fetchPieceActions(packageName) {
432
- return (await gql(`query Actions($packageName: String!) {
433
- workflowRuntime { pieceActions(packageName: $packageName) }
434
- }`, { packageName })).workflowRuntime.pieceActions.actions;
435
- }
436
- async function fetchPieceTriggers(packageName) {
437
- return (await gql(`query Triggers($packageName: String!) {
438
- workflowRuntime { pieceTriggers(packageName: $packageName) }
439
- }`, { packageName })).workflowRuntime.pieceTriggers.triggers;
440
- }
441
- async function searchBlocks(query, limit = 30) {
442
- return (await gql(`query SearchBlocks($query: String!, $limit: Int) {
443
- workflowRuntime { searchBlocks(query: $query, limit: $limit) {
444
- status indexedPieces error
445
- hits { blockType pieceName pieceDisplayName logoUrl displayName description kind strategy unsupported }
446
- } }
447
- }`, {
448
- query,
449
- limit
450
- })).workflowRuntime.searchBlocks;
451
- }
452
- const outputTreeCache = /* @__PURE__ */ new Map();
453
- function fetchBlockOutputTree(blockType, config) {
454
- const key = `${blockType}:${JSON.stringify(config ?? {})}`;
455
- let cached = outputTreeCache.get(key);
456
- if (!cached) {
457
- cached = gql(`query OutputTree($blockType: String!, $config: Unknown) {
458
- workflowRuntime { blockOutputTree(blockType: $blockType, config: $config) }
459
- }`, {
460
- blockType,
461
- config: config ?? {}
462
- }).then((data) => data.workflowRuntime.blockOutputTree);
463
- outputTreeCache.set(key, cached);
464
- cached.catch(() => outputTreeCache.delete(key));
465
- }
466
- return cached;
467
- }
468
- function fetchConnections() {
469
- return gql(`query Connections { workflowRuntime { connections { id name connectorId authType status accountLabel } } }`, {}).then((data) => data.workflowRuntime.connections);
470
- }
471
- function invalidateConnections() {}
472
- function checkConnection(connectionId) {
473
- return gql(`mutation CheckConnection($connectionId: String!) {
474
- workflowRuntime {
475
- checkConnection(connectionId: $connectionId) {
476
- ok
477
- detail
478
- accountLabel
479
- }
480
- }
481
- }`, { connectionId }).then((data) => data.workflowRuntime.checkConnection);
482
- }
483
- const SECRET_FIELDS = "ref label version status createdAt updatedAt";
484
- async function createSecret(value, label) {
485
- return (await gql(`mutation CreateSecret($value: String!, $label: String) {
486
- workflowRuntime { createSecret(value: $value, label: $label) { ${SECRET_FIELDS} } }
487
- }`, {
488
- value,
489
- label: label ?? null
490
- })).workflowRuntime.createSecret;
491
- }
492
- async function rotateSecret(ref, value) {
493
- return (await gql(`mutation RotateSecret($ref: String!, $value: String!) {
494
- workflowRuntime { rotateSecret(ref: $ref, value: $value) { ${SECRET_FIELDS} } }
495
- }`, {
496
- ref,
497
- value
498
- })).workflowRuntime.rotateSecret;
499
- }
500
- async function fetchSecretStat(ref) {
501
- return (await gql(`query Secret($ref: String!) {
502
- workflowRuntime { secret(ref: $ref) { ${SECRET_FIELDS} } }
503
- }`, { ref })).workflowRuntime.secret;
504
- }
505
- async function fetchWebhookEndpoint(workflowId) {
506
- return (await gql(`query WebhookEndpoint($workflowId: String!) {
507
- workflowRuntime {
508
- webhookEndpoint(workflowId: $workflowId) {
509
- workflowId url absoluteUrl armed createdAt
510
- }
511
- }
512
- }`, { workflowId })).workflowRuntime.webhookEndpoint;
513
- }
514
- async function testTrigger(workflowId) {
515
- return (await gql(`mutation TestTrigger($workflowId: String!) {
516
- workflowRuntime { testTrigger(workflowId: $workflowId) }
517
- }`, { workflowId })).workflowRuntime.testTrigger;
518
- }
519
- const RUN_FIELDS = `id workflowId workflowName workflowVersion triggerKind
520
- triggerPayload status error startedAt endedAt rerunOf
521
- steps { stepId stepKey blockType status input output port error startedAt endedAt }`;
522
- async function fetchRuns(scope = {}) {
523
- return (await gql(`query Runs($workflowId: String, $driveId: String, $limit: Int) {
524
- workflowRuntime { runs(workflowId: $workflowId, driveId: $driveId, limit: $limit) { ${RUN_FIELDS} } }
525
- }`, {
526
- workflowId: scope.workflowId ?? null,
527
- driveId: scope.driveId ?? null,
528
- limit: scope.limit ?? 30
529
- })).workflowRuntime.runs;
530
- }
531
- async function fireWorkflow(workflowId, payload) {
532
- return (await gql(`mutation Fire($workflowId: String!, $payload: Unknown) {
533
- workflowRuntime { fire(workflowId: $workflowId, payload: $payload) { runId status error } }
534
- }`, {
535
- workflowId,
536
- payload: payload ?? {}
537
- })).workflowRuntime.fire;
538
- }
539
- async function rerunRun(runId) {
540
- return (await gql(`mutation Rerun($runId: String!) {
541
- workflowRuntime { rerun(runId: $runId) { runId status error } }
542
- }`, { runId })).workflowRuntime.rerun;
543
- }
544
- async function loadBlockOptions(blockType, propName, input, connectionId, searchValue) {
545
- return (await gql(`query Options($blockType: String!, $propName: String!, $input: Unknown, $connectionId: String, $searchValue: String) {
546
- workflowRuntime { blockOptions(blockType: $blockType, propName: $propName, input: $input, connectionId: $connectionId, searchValue: $searchValue) }
547
- }`, {
548
- blockType,
549
- propName,
550
- input,
551
- connectionId: connectionId ?? null,
552
- searchValue: searchValue ?? null
553
- })).workflowRuntime.blockOptions;
554
- }
555
- //#endregion
556
- export { CORE_FORMS as C, TRIGGER_PRESETS as S, rotateSecret as _, fetchConnections as a, testTrigger as b, fetchPieceTriggers as c, fetchWebhookEndpoint as d, fireWorkflow as f, rerunRun as g, loadBlockOptions as h, fetchBlockOutputTree as i, fetchRuns as l, invalidateConnections as m, checkConnection as n, fetchPieceActions as o, getBlockForm as p, createSecret as r, fetchPieceCatalog as s, DEFAULT_RUNTIME_URL as t, fetchSecretStat as u, searchBlocks as v, STEP_PRESETS as x, setRuntimeUrl as y };
557
-
558
- //# sourceMappingURL=runtime-api-DDMQc4PB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-api-DDMQc4PB.js","names":[],"sources":["../../editors/workflow-editor/ui/forms.ts","../../editors/workflow-editor/ui/blocks.ts","../../editors/workflow-editor/runtime-api.ts"],"sourcesContent":["// Form descriptors driving property panels; pure data, mirrors the\n// ConnectorPropDescriptor shape from the workflow runtime.\n\nexport interface BlockFormProp {\n name: string;\n displayName: string;\n type: string;\n required: boolean;\n defaultValue?: unknown;\n staticOptions?: FormOption[];\n // A STATIC_DROPDOWN's own state, beside its options.\n staticDisabled?: boolean;\n staticPlaceholder?: string;\n hasDynamicResolver?: boolean;\n description?: string;\n placeholder?: string;\n // Sibling prop names whose values feed the resolver; a change re-runs it.\n refreshers?: string[];\n // Nested shape: ARRAY item fields, or what a DYNAMIC resolver produced.\n properties?: BlockFormProp[];\n // Folded behind \"Advanced\": fields with a working default, so the common\n // case is short. Opens expanded when set, else live config would be hidden.\n advanced?: boolean;\n // Shown only while a sibling prop holds one of these values; data, not a\n // predicate, so a piece form arriving as JSON can express it too.\n // Hidden also when `unlessSet` has a value (a mode the runtime infers).\n showWhen?: { prop: string; oneOf: unknown[]; unlessSet?: string };\n // Activepieces layout and control hints, as the piece declared them.\n width?: \"half\" | \"full\";\n icon?: string;\n // CHECKBOX: sibling props shown only while it is checked.\n reveals?: string[];\n // MARKDOWN: BORDERLESS | INFO | WARNING | TIP.\n variant?: string;\n // STATIC_DROPDOWN \"cards\", NUMBER \"stepper\", DATE_RANGE \"dropdown\".\n display?: string;\n min?: number;\n max?: number;\n step?: number;\n // DROPDOWN: options() is re-run with what the author types.\n refreshOnSearch?: boolean;\n // RICH_TEXT: the sibling whose value picks plain, markdown or html.\n formatProperty?: string;\n}\n\nexport interface FormOption {\n label: string;\n value: unknown;\n description?: string;\n icon?: string;\n}\n\nexport interface PropertyGroup {\n key: string;\n // tabs | section | summary | builder | footer\n display: string;\n label?: string;\n description?: string;\n icon?: string;\n props: string[];\n}\n\nexport interface ErrorHandlingDefaults {\n retryOnFailure?: { defaultValue?: boolean; hide?: boolean };\n continueOnFailure?: { defaultValue?: boolean; hide?: boolean };\n}\n\nexport interface BlockForm {\n title: string;\n requireAuth: boolean;\n // Whether the block takes a connection: none hides the field entirely.\n auth?: \"none\" | \"optional\" | \"required\";\n props: BlockFormProp[];\n // Piece triggers only: POLLING | WEBHOOK | APP_WEBHOOK. WEBHOOK triggers\n // are fed by a request, so the panel shows their endpoint URL.\n triggerStrategy?: string;\n // What the step does, as the piece describes it.\n description?: string;\n propertyGroups?: PropertyGroup[];\n // READ | SEARCH | WRITE | DESTRUCTIVE\n classification?: string;\n errorHandling?: ErrorHandlingDefaults;\n}\n\nexport interface ConnectionSummary {\n id: string;\n name: string;\n connectorId: string;\n authType: string;\n status: string;\n accountLabel: string | null;\n}\n\nexport interface SecretStat {\n ref: string;\n label: string | null;\n version: number;\n status: string;\n createdAt: string;\n updatedAt: string;\n}\n\n// Minting seam for PH_SECRET_REF props: the field takes a value and the\n// document only ever receives the ref that comes back.\nexport interface SecretFormService {\n save: (input: {\n ref?: string;\n value: string;\n label: string;\n }) => Promise<SecretStat>;\n stat: (ref: string) => Promise<SecretStat | null>;\n}\n\nexport interface WebhookEndpoint {\n workflowId: string;\n url: string;\n // False when `url` is a bare path because the reactor has no public origin.\n absoluteUrl: boolean;\n armed: boolean;\n createdAt: string;\n}\n\nexport interface DesignTimeService {\n getBlockForm: (blockType: string) => Promise<BlockForm | null>;\n loadOptions: (\n blockType: string,\n propName: string,\n input: Record<string, unknown>,\n connectionId?: string,\n searchValue?: string,\n ) => Promise<unknown>;\n // Runs the current workflow's piece trigger test hook; sample items back.\n testTrigger?: () => Promise<unknown>;\n // The current workflow's webhook endpoint, for core#webhook triggers.\n webhookEndpoint?: () => Promise<WebhookEndpoint | null>;\n // Backs PH_SECRET_REF props; absent when the runtime refuses secret writes.\n secrets?: SecretFormService;\n // powerhouse/connection documents for the connection picker.\n listConnections?: () => Promise<ConnectionSummary[]>;\n // Drops the cached listing after the picker creates a connection.\n refreshConnections?: () => void;\n // The current workflow's most recent run, for a step's \"Last run\" preview.\n latestRun?: () => Promise<LatestRun | null>;\n}\n\nexport interface LatestRun {\n status: string;\n startedAt: string;\n triggerPayload: unknown;\n steps: {\n stepKey: string;\n status: string;\n input: unknown;\n output: unknown;\n error: string | null;\n }[];\n}\n\n// Ours, not the piece's: the reactor's poll cadence for a piece trigger.\n// Appended to every piece trigger's form; see splitPollInterval in the runtime.\nexport const POLL_INTERVAL_PROP: BlockFormProp = {\n name: \"pollEverySeconds\",\n displayName: \"Poll every (seconds)\",\n type: \"NUMBER\",\n required: false,\n description:\n \"How often the reactor checks this trigger; 60 at the least. Omit to follow the piece's own cadence.\",\n};\n\nconst text = (\n name: string,\n displayName: string,\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"SHORT_TEXT\",\n required,\n description,\n});\n\n// Takes a secret VALUE and commits only the minted ref, the way the\n// connection editor's SecretField does; the document never holds the value.\nconst secretRef = (\n name: string,\n displayName: string,\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"PH_SECRET_REF\",\n required,\n description,\n});\n\nconst number = (\n name: string,\n displayName: string,\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"NUMBER\",\n required,\n description,\n});\n\n// Marks a prop for the \"Advanced\" section without repeating the builders.\nconst advanced = (prop: BlockFormProp): BlockFormProp => ({\n ...prop,\n advanced: true,\n});\n\n// Hides a prop until a sibling holds one of `oneOf`.\nconst shownWhen = (\n prop: BlockFormProp,\n sibling: string,\n oneOf: unknown[],\n): BlockFormProp => ({ ...prop, showWhen: { prop: sibling, oneOf } });\n\nconst dropdown = (\n name: string,\n displayName: string,\n options: { label: string; value: unknown }[],\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"STATIC_DROPDOWN\",\n required,\n description,\n staticOptions: options,\n});\n\n// Every scheme that verifies a signature, and so needs a secret.\nconst SIGNED_SCHEMES = [\"token\", \"hmac\", \"hmac-prefixed\", \"hmac-timestamped\"];\n\n// Schemes that compute a digest, and so take a hash and an encoding. `token`\n// presents the secret verbatim, so none of that applies to it.\nconst HMAC_SCHEMES = [\"hmac\", \"hmac-prefixed\", \"hmac-timestamped\"];\n\n// Hand-written forms for core blocks and triggers.\nexport const CORE_FORMS: Record<string, BlockForm> = {\n \"core#manual\": {\n title: \"Manual trigger\",\n requireAuth: false,\n auth: \"none\",\n props: [],\n },\n \"core#schedule\": {\n title: \"Schedule\",\n requireAuth: false,\n auth: \"none\",\n props: [\n // Optional at run time: an omitted mode follows whichever of cron or\n // every is set, so the form defaults to cron rather than demanding one.\n {\n ...dropdown(\"mode\", \"Runs\", [\n { label: \"On a cron schedule\", value: \"cron\" },\n { label: \"At a fixed interval\", value: \"interval\" },\n ]),\n defaultValue: \"cron\",\n },\n // No mode but an `every` is interval mode to the runtime, so no cron.\n {\n ...text(\n \"cron\",\n \"Cron expression\",\n true,\n \"Five fields, e.g. 0 9 * * 1-5 runs at 09:00 on weekdays.\",\n ),\n showWhen: {\n prop: \"mode\",\n oneOf: [\"cron\", undefined],\n unlessSet: \"every\",\n },\n },\n shownWhen(\n number(\"every\", \"Every\", true, \"At least one minute.\"),\n \"mode\",\n [\"interval\"],\n ),\n shownWhen(\n {\n ...dropdown(\"unit\", \"Unit\", [\n { label: \"Minutes\", value: \"minutes\" },\n { label: \"Hours\", value: \"hours\" },\n { label: \"Days\", value: \"days\" },\n ]),\n defaultValue: \"minutes\",\n },\n \"mode\",\n [\"interval\"],\n ),\n text(\n \"timezone\",\n \"Timezone\",\n false,\n \"An IANA name such as Europe/Lisbon. Defaults to UTC.\",\n ),\n ],\n },\n \"core#webhook\": {\n title: \"Webhook\",\n requireAuth: false,\n auth: \"none\",\n props: [\n dropdown(\n \"methods\",\n \"Method\",\n [\n { label: \"POST\", value: \"POST\" },\n { label: \"Any\", value: \"ANY\" },\n { label: \"GET\", value: \"GET\" },\n { label: \"PUT\", value: \"PUT\" },\n { label: \"PATCH\", value: \"PATCH\" },\n { label: \"DELETE\", value: \"DELETE\" },\n ],\n true,\n ),\n // Named by wire format, not by sender: authors match these against their\n // sender's docs, and one brand name would mislead about every other.\n dropdown(\n \"scheme\",\n \"Verification\",\n [\n { label: \"None — the URL's token only\", value: \"none\" },\n { label: \"Shared token in a header\", value: \"token\" },\n { label: \"HMAC digest\", value: \"hmac\" },\n {\n label: \"HMAC digest with a label (sha256=…)\",\n value: \"hmac-prefixed\",\n },\n {\n label: \"HMAC digest, timestamped (t=…,v1=…)\",\n value: \"hmac-timestamped\",\n },\n ],\n true,\n ),\n // Hidden while the scheme is None: a visible secret field on an\n // unverified endpoint invites a secret that is never checked.\n shownWhen(\n secretRef(\n \"secretRef\",\n \"Secret\",\n true,\n \"The shared secret: the value the header must equal, or the key the sender signs with\",\n ),\n \"scheme\",\n SIGNED_SCHEMES,\n ),\n advanced(\n shownWhen(\n text(\n \"header\",\n \"Header\",\n false,\n \"Where the token or signature is read from. Defaults to the header the chosen scheme conventionally uses; set it only if the sender differs\",\n ),\n \"scheme\",\n SIGNED_SCHEMES,\n ),\n ),\n advanced(\n shownWhen(\n number(\n \"toleranceSeconds\",\n \"Replay window (seconds)\",\n false,\n \"Rejects a delivery signed longer ago than this, so a captured request expires. Default 300\",\n ),\n \"scheme\",\n [\"hmac-timestamped\"],\n ),\n ),\n // The layout frames the signature; these say how its digest was computed.\n // Senders pick them independently, so they are fields, not scheme names.\n advanced(\n shownWhen(\n dropdown(\"algorithm\", \"Hash\", [\n { label: \"SHA-256 (default)\", value: \"sha256\" },\n { label: \"SHA-1\", value: \"sha1\" },\n { label: \"SHA-512\", value: \"sha512\" },\n ]),\n \"scheme\",\n HMAC_SCHEMES,\n ),\n ),\n advanced(\n shownWhen(\n dropdown(\"encoding\", \"Digest encoding\", [\n { label: \"Hexadecimal (default)\", value: \"hex\" },\n { label: \"Base64\", value: \"base64\" },\n ]),\n \"scheme\",\n HMAC_SCHEMES,\n ),\n ),\n advanced(\n shownWhen(\n text(\n \"prefix\",\n \"Signature label\",\n false,\n \"The literal before the digest. Defaults to the hash and an equals sign, e.g. sha256=. Leave blank for a sender that sends the digest with no label\",\n ),\n \"scheme\",\n [\"hmac-prefixed\"],\n ),\n ),\n advanced(\n text(\n \"dedupeField\",\n \"Event id field\",\n false,\n \"Where the sender puts its own event id, so a redelivery is accepted without a second run. A bare name reads a query param or a top-level body field; prefix with header: or body: to read a header or a nested path (header:x-delivery-id, body:data.object.id)\",\n ),\n ),\n advanced(\n number(\n \"dedupeTtlSeconds\",\n \"Dedupe window (seconds)\",\n false,\n \"How long an event id is remembered. Default 300\",\n ),\n ),\n advanced(\n text(\n \"challengeField\",\n \"Challenge field\",\n false,\n \"Echo this field back instead of running, for senders that verify the endpoint before registering it. Same header:/body: prefixes as the event id field\",\n ),\n ),\n advanced(\n dropdown(\n \"responseMode\",\n \"Response\",\n [\n { label: \"Answer immediately (202)\", value: \"async\" },\n { label: \"Wait for the run (200)\", value: \"sync\" },\n ],\n false,\n \"Waiting holds the sender's socket open for the whole run\",\n ),\n ),\n advanced(\n number(\n \"responseStatus\",\n \"Success status\",\n false,\n \"Status returned on acceptance. Default 202 async, 200 sync\",\n ),\n ),\n ],\n },\n \"core#branch\": {\n title: \"Branch\",\n requireAuth: false,\n auth: \"none\",\n props: [\n text(\n \"condition\",\n \"Condition\",\n true,\n \"e.g. {{steps.fetch.output.body.ok}}\",\n ),\n text(\n \"equals\",\n \"Equals\",\n false,\n \"Take the true port only when the condition matches this; omit for truthiness\",\n ),\n ],\n },\n \"core#assert\": {\n title: \"Assert\",\n requireAuth: false,\n auth: \"none\",\n props: [\n text(\n \"value\",\n \"Value\",\n true,\n \"e.g. {{steps.describe.output}} - the run fails when it is blank\",\n ),\n {\n name: \"rejectValues\",\n displayName: \"Rejected values\",\n type: \"ARRAY\",\n required: false,\n description:\n \"One per line; the run fails when the value matches any of them\",\n },\n {\n name: \"allowValues\",\n displayName: \"Allowed values\",\n type: \"ARRAY\",\n required: false,\n description:\n \"One per line; when set, anything else fails. Safer than a reject list for model output\",\n },\n {\n name: \"allowEmpty\",\n displayName: \"Allow empty\",\n type: \"CHECKBOX\",\n required: false,\n description: \"Accept a blank value instead of failing\",\n },\n text(\"message\", \"Failure message\", false, \"Replaces the default error\"),\n ],\n },\n};\n","// Palette presets; pure data used by the UI to seed new triggers and steps.\n\n// The document blocks live in the reactor piece, and are offered here too:\n// they are what most workflows on a reactor are built from, and a picker that\n// made an author search for them would be a worse picker.\n\n// The reactor piece this package ships, named as pieces/index.ts declares it.\nexport const REACTOR_PIECE = \"@powerhousedao/piece-reactor\";\n\nexport function isReactorPieceBlock(blockType: string): boolean {\n return (\n blockType.startsWith(`${REACTOR_PIECE}#`) ||\n blockType.startsWith(`${REACTOR_PIECE}@`)\n );\n}\n\nexport interface BlockPreset {\n label: string;\n blockType: string;\n description: string;\n defaultConfig: unknown;\n // Which section of the picker it belongs to: \"core\" is the engine's own,\n // \"powerhouse\" the reactor piece, listed right after it.\n\n // Optional because a pick built from a search hit or an existing step is\n // the same shape but belongs to no section.\n group?: \"core\" | \"powerhouse\";\n}\n\nexport const TRIGGER_PRESETS: BlockPreset[] = [\n {\n label: \"Manual\",\n blockType: \"core#manual\",\n group: \"core\",\n description: \"Fired on demand with a payload.\",\n defaultConfig: {},\n },\n {\n label: \"Schedule\",\n blockType: \"core#schedule\",\n group: \"core\",\n description: \"Fires on a cron expression or fixed interval.\",\n defaultConfig: { mode: \"cron\", cron: \"0 9 * * 1-5\", timezone: \"UTC\" },\n },\n {\n label: \"Webhook\",\n blockType: \"core#webhook\",\n group: \"core\",\n description: \"Fires when a provider POSTs to this workflow's URL.\",\n defaultConfig: { methods: \"POST\", scheme: \"none\", responseMode: \"async\" },\n },\n {\n label: \"Document event\",\n blockType: `${REACTOR_PIECE}#trigger:document-event`,\n group: \"powerhouse\",\n description: \"Fires when a matching document operation lands.\",\n defaultConfig: {},\n },\n {\n label: \"Document created\",\n blockType: `${REACTOR_PIECE}#trigger:document-created`,\n group: \"powerhouse\",\n description: \"Fires when a document is added to a drive.\",\n defaultConfig: {},\n },\n {\n label: \"Document deleted\",\n blockType: `${REACTOR_PIECE}#trigger:document-deleted`,\n group: \"powerhouse\",\n description: \"Fires when a document is removed from a drive.\",\n defaultConfig: {},\n },\n];\n\nexport const STEP_PRESETS: BlockPreset[] = [\n {\n label: \"Branch\",\n blockType: \"core#branch\",\n group: \"core\",\n description: \"Routes true/false on a condition.\",\n defaultConfig: { condition: \"{{trigger.payload.ok}}\" },\n },\n {\n label: \"Assert\",\n blockType: \"core#assert\",\n group: \"core\",\n description:\n \"Fails the run when a value is blank, rejected or not allowed.\",\n defaultConfig: { value: \"\", allowValues: [] },\n },\n {\n label: \"Create document\",\n blockType: `${REACTOR_PIECE}#document-create`,\n group: \"powerhouse\",\n description: \"Creates a Powerhouse document.\",\n defaultConfig: { documentType: \"\", name: \"\" },\n },\n {\n label: \"Dispatch actions\",\n blockType: `${REACTOR_PIECE}#document-dispatch`,\n group: \"powerhouse\",\n description: \"Sends actions to a document.\",\n defaultConfig: { documentId: \"\" },\n },\n {\n label: \"Get document\",\n blockType: `${REACTOR_PIECE}#document-get`,\n group: \"powerhouse\",\n description: \"Reads a document's current state.\",\n defaultConfig: { documentId: \"\" },\n },\n {\n label: \"Find documents\",\n blockType: `${REACTOR_PIECE}#document-find`,\n group: \"powerhouse\",\n description: \"Lists documents by type and name.\",\n defaultConfig: { documentType: \"\" },\n },\n {\n label: \"List document types\",\n blockType: `${REACTOR_PIECE}#document-types`,\n group: \"powerhouse\",\n description: \"Document models installed on this reactor.\",\n defaultConfig: {},\n },\n {\n label: \"Get document schema\",\n blockType: `${REACTOR_PIECE}#document-schema`,\n group: \"powerhouse\",\n description: \"Action and state schemas of a document type.\",\n defaultConfig: { documentType: \"\" },\n },\n];\n","// Design-time channel to the workflow-runtime subgraph: piece descriptors\n// and dynamic option resolution. Not document-model coupled.\nimport { ambientRenownTokenProvider } from \"@powerhousedao/reactor-browser/graphql-client\";\nimport {\n CORE_FORMS,\n POLL_INTERVAL_PROP,\n type BlockForm,\n type BlockFormProp,\n type ErrorHandlingDefaults,\n type PropertyGroup,\n} from \"./ui/forms.js\";\nimport { isReactorPieceBlock } from \"./ui/blocks.js\";\n\nexport const DEFAULT_RUNTIME_URL =\n \"http://localhost:4001/graphql/workflow-runtime\";\n\nlet currentRuntimeUrl: string | undefined;\n\n// Set by useSyncWorkflowRuntimeUrl from the drive's resolved switchboard URL.\nexport function setRuntimeUrl(url: string): void {\n if (url === currentRuntimeUrl) return;\n currentRuntimeUrl = url;\n // Cached design-time results belong to the previous switchboard.\n formCache.clear();\n outputTreeCache.clear();\n catalogCache = undefined;\n}\n\nfunction runtimeUrl(): string {\n return currentRuntimeUrl ?? DEFAULT_RUNTIME_URL;\n}\n\nasync function gql<T>(\n query: string,\n variables: Record<string, unknown>,\n): Promise<T> {\n // Mirrors the reactor-browser switchboard AI tool's auth: attach the\n // Renown bearer token when one is available, else go out anonymously.\n const token = await ambientRenownTokenProvider();\n const response = await fetch(runtimeUrl(), {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n ...(token ? { authorization: `Bearer ${token}` } : {}),\n },\n body: JSON.stringify({ query, variables }),\n });\n const body = (await response.json()) as {\n data?: T;\n errors?: { message: string }[];\n };\n if (body.errors?.length) throw new Error(body.errors[0].message);\n if (!body.data) throw new Error(\"Empty GraphQL response\");\n return body.data;\n}\n\ninterface BlockEntryDescriptor {\n displayName: string;\n description?: string;\n requireAuth: boolean;\n props: BlockFormProp[];\n // Triggers only: POLLING | WEBHOOK | APP_WEBHOOK.\n strategy?: string;\n propertyGroups?: PropertyGroup[];\n classification?: string;\n errorHandlingOptions?: ErrorHandlingDefaults;\n}\n\ninterface BlockDescriptorResult {\n workflowRuntime: {\n blockDescriptor: {\n displayName: string;\n auth?: unknown;\n action?: BlockEntryDescriptor;\n trigger?: BlockEntryDescriptor;\n } | null;\n };\n}\n\nconst formCache = new Map<string, Promise<BlockForm | null>>();\n\nexport function getBlockForm(blockType: string): Promise<BlockForm | null> {\n const core = CORE_FORMS[blockType] as BlockForm | undefined;\n if (core) return Promise.resolve(core);\n let cached = formCache.get(blockType);\n if (!cached) {\n cached = gql<BlockDescriptorResult>(\n `query Descriptor($blockType: String!) {\n workflowRuntime { blockDescriptor(blockType: $blockType) }\n }`,\n { blockType },\n ).then((data) => {\n const descriptor = data.workflowRuntime.blockDescriptor;\n const entry = descriptor?.action ?? descriptor?.trigger;\n if (!descriptor || !entry) return null;\n const isTrigger = !descriptor.action && Boolean(descriptor.trigger);\n // A poll cadence is meaningless for a trigger the provider pushes to,\n // or for one this reactor fires itself, so the prop is only offered\n // where it actually applies.\n const polled =\n isTrigger &&\n entry.strategy !== \"WEBHOOK\" &&\n !isReactorPieceBlock(blockType);\n const props = entry.props;\n return {\n title: `${descriptor.displayName} · ${entry.displayName}`,\n requireAuth: entry.requireAuth,\n auth: !descriptor.auth\n ? (\"none\" as const)\n : entry.requireAuth\n ? (\"required\" as const)\n : (\"optional\" as const),\n props: polled ? [...props, POLL_INTERVAL_PROP] : props,\n triggerStrategy: isTrigger ? entry.strategy : undefined,\n ...(entry.description ? { description: entry.description } : {}),\n ...(entry.propertyGroups\n ? { propertyGroups: entry.propertyGroups }\n : {}),\n ...(entry.classification\n ? { classification: entry.classification }\n : {}),\n ...(entry.errorHandlingOptions\n ? { errorHandling: entry.errorHandlingOptions }\n : {}),\n };\n });\n formCache.set(blockType, cached);\n cached.catch(() => formCache.delete(blockType));\n }\n return cached;\n}\n\nexport interface PieceSummary {\n name: string;\n displayName: string;\n description: string;\n logoUrl: string;\n version: string;\n actionCount: number;\n triggerCount: number;\n // Activepieces category ids, e.g. ARTIFICIAL_INTELLIGENCE, SALES_AND_CRM.\n categories: string[];\n // PieceAuth descriptor, verbatim from the piece; null when authless.\n auth?: unknown;\n // Why none of the piece's blocks can run on this reactor.\n unsupported?: string | null;\n deprecated?: boolean;\n}\n\nexport interface PieceActionEntry {\n name: string;\n displayName: string;\n description: string;\n blockType: string;\n unsupported?: string | null;\n}\n\nlet catalogCache: Promise<PieceSummary[]> | undefined;\n\nexport function fetchPieceCatalog(): Promise<PieceSummary[]> {\n catalogCache ??= gql<{ workflowRuntime: { pieceCatalog: PieceSummary[] } }>(\n `query Catalog { workflowRuntime { pieceCatalog } }`,\n {},\n ).then((data) => data.workflowRuntime.pieceCatalog);\n catalogCache.catch(() => (catalogCache = undefined));\n return catalogCache;\n}\n\nexport async function fetchPieceActions(\n packageName: string,\n): Promise<PieceActionEntry[]> {\n const data = await gql<{\n workflowRuntime: { pieceActions: { actions: PieceActionEntry[] } };\n }>(\n `query Actions($packageName: String!) {\n workflowRuntime { pieceActions(packageName: $packageName) }\n }`,\n { packageName },\n );\n return data.workflowRuntime.pieceActions.actions;\n}\n\nexport interface PieceTriggerEntry {\n name: string;\n displayName: string;\n description: string;\n strategy: string;\n blockType: string;\n unsupported?: string | null;\n}\n\nexport async function fetchPieceTriggers(\n packageName: string,\n): Promise<PieceTriggerEntry[]> {\n const data = await gql<{\n workflowRuntime: { pieceTriggers: { triggers: PieceTriggerEntry[] } };\n }>(\n `query Triggers($packageName: String!) {\n workflowRuntime { pieceTriggers(packageName: $packageName) }\n }`,\n { packageName },\n );\n return data.workflowRuntime.pieceTriggers.triggers;\n}\n\nexport interface BlockSearchHit {\n blockType: string;\n pieceName: string;\n pieceDisplayName: string;\n logoUrl: string;\n displayName: string;\n description: string;\n kind: \"action\" | \"trigger\";\n strategy: string | null;\n unsupported: string | null;\n}\n\nexport interface BlockSearchResult {\n status: \"ready\" | \"indexing\" | \"error\";\n hits: BlockSearchHit[];\n indexedPieces: number;\n error: string | null;\n}\n\n// Catalog-wide action/trigger search; \"indexing\" on the very first calls.\nexport async function searchBlocks(\n query: string,\n limit = 30,\n): Promise<BlockSearchResult> {\n const data = await gql<{\n workflowRuntime: { searchBlocks: BlockSearchResult };\n }>(\n `query SearchBlocks($query: String!, $limit: Int) {\n workflowRuntime { searchBlocks(query: $query, limit: $limit) {\n status indexedPieces error\n hits { blockType pieceName pieceDisplayName logoUrl displayName description kind strategy unsupported }\n } }\n }`,\n { query, limit },\n );\n return data.workflowRuntime.searchBlocks;\n}\n\nexport interface OutputTreeNode {\n name: string;\n type: string;\n description?: string;\n children?: OutputTreeNode[];\n}\n\nexport interface OutputTree {\n source: \"schema\" | \"sample\" | \"static\" | \"none\";\n nodes: OutputTreeNode[];\n}\n\nconst outputTreeCache = new Map<string, Promise<OutputTree>>();\n\nexport function fetchBlockOutputTree(\n blockType: string,\n config: unknown,\n): Promise<OutputTree> {\n const key = `${blockType}:${JSON.stringify(config ?? {})}`;\n let cached = outputTreeCache.get(key);\n if (!cached) {\n cached = gql<{ workflowRuntime: { blockOutputTree: OutputTree } }>(\n `query OutputTree($blockType: String!, $config: Unknown) {\n workflowRuntime { blockOutputTree(blockType: $blockType, config: $config) }\n }`,\n { blockType, config: config ?? {} },\n ).then((data) => data.workflowRuntime.blockOutputTree);\n outputTreeCache.set(key, cached);\n cached.catch(() => outputTreeCache.delete(key));\n }\n return cached;\n}\n\nexport interface ConnectionSummary {\n id: string;\n name: string;\n connectorId: string;\n authType: string;\n status: string;\n accountLabel: string | null;\n}\n\n// Deliberately uncached. The server scopes this list to the caller's read\n// access, and nothing here identifies the caller to key a cache on.\nexport function fetchConnections(): Promise<ConnectionSummary[]> {\n return gql<{\n workflowRuntime: { connections: ConnectionSummary[] };\n }>(\n `query Connections { workflowRuntime { connections { id name connectorId authType status accountLabel } } }`,\n {},\n ).then((data) => data.workflowRuntime.connections);\n}\n\n// Kept for the picker, which creates connections and then refreshes; there is\n// no longer a cache for it to drop.\nexport function invalidateConnections(): void {}\n\nexport interface ConnectionCheckResult {\n ok: boolean;\n detail: string;\n accountLabel: string | null;\n}\n\n// Runs the piece's own connection check against a document's stored credentials.\n// No secrets cross this boundary: the subgraph resolves refs server-side.\nexport function checkConnection(\n connectionId: string,\n): Promise<ConnectionCheckResult> {\n return gql<{\n workflowRuntime: { checkConnection: ConnectionCheckResult };\n }>(\n `mutation CheckConnection($connectionId: String!) {\n workflowRuntime {\n checkConnection(connectionId: $connectionId) {\n ok\n detail\n accountLabel\n }\n }\n }`,\n { connectionId },\n ).then((data) => data.workflowRuntime.checkConnection);\n}\n\nexport interface SecretStat {\n ref: string;\n label: string | null;\n version: number;\n status: \"ACTIVE\" | \"DELETED\";\n createdAt: string;\n updatedAt: string;\n}\n\nconst SECRET_FIELDS = \"ref label version status createdAt updatedAt\";\n\n// Mints a managed secret; only the returned ref ever enters a document.\nexport async function createSecret(\n value: string,\n label?: string,\n): Promise<SecretStat> {\n const data = await gql<{ workflowRuntime: { createSecret: SecretStat } }>(\n `mutation CreateSecret($value: String!, $label: String) {\n workflowRuntime { createSecret(value: $value, label: $label) { ${SECRET_FIELDS} } }\n }`,\n { value, label: label ?? null },\n );\n return data.workflowRuntime.createSecret;\n}\n\n// Same ref, version+1; referencing documents stay untouched.\nexport async function rotateSecret(\n ref: string,\n value: string,\n): Promise<SecretStat> {\n const data = await gql<{ workflowRuntime: { rotateSecret: SecretStat } }>(\n `mutation RotateSecret($ref: String!, $value: String!) {\n workflowRuntime { rotateSecret(ref: $ref, value: $value) { ${SECRET_FIELDS} } }\n }`,\n { ref, value },\n );\n return data.workflowRuntime.rotateSecret;\n}\n\n// Metadata only; null for unknown or legacy refs.\nexport async function fetchSecretStat(ref: string): Promise<SecretStat | null> {\n const data = await gql<{ workflowRuntime: { secret: SecretStat | null } }>(\n `query Secret($ref: String!) {\n workflowRuntime { secret(ref: $ref) { ${SECRET_FIELDS} } }\n }`,\n { ref },\n );\n return data.workflowRuntime.secret;\n}\n\nexport interface WebhookEndpointRecord {\n workflowId: string;\n url: string;\n // False when `url` is a bare path because the reactor has no public origin.\n absoluteUrl: boolean;\n armed: boolean;\n createdAt: string;\n}\n\n// Never cached: the runtime mints the endpoint on the first call and `armed`\n// tracks the workflow's status.\nexport async function fetchWebhookEndpoint(\n workflowId: string,\n): Promise<WebhookEndpointRecord | null> {\n const data = await gql<{\n workflowRuntime: { webhookEndpoint: WebhookEndpointRecord | null };\n }>(\n `query WebhookEndpoint($workflowId: String!) {\n workflowRuntime {\n webhookEndpoint(workflowId: $workflowId) {\n workflowId url absoluteUrl armed createdAt\n }\n }\n }`,\n { workflowId },\n );\n return data.workflowRuntime.webhookEndpoint;\n}\n\nexport async function testTrigger(workflowId: string): Promise<unknown> {\n const data = await gql<{ workflowRuntime: { testTrigger: unknown } }>(\n `mutation TestTrigger($workflowId: String!) {\n workflowRuntime { testTrigger(workflowId: $workflowId) }\n }`,\n { workflowId },\n );\n return data.workflowRuntime.testTrigger;\n}\n\nexport interface RunStepRecord {\n stepId: string;\n stepKey: string;\n blockType: string;\n status: string;\n input: unknown;\n output: unknown;\n port: string | null;\n error: string | null;\n // Null for skipped and replayed steps, and for runs journaled before timings.\n startedAt: string | null;\n endedAt: string | null;\n}\n\nexport interface RunRecord {\n id: string;\n workflowId: string;\n workflowName: string;\n workflowVersion: number;\n triggerKind: string;\n triggerPayload: unknown;\n status: string;\n error: string | null;\n startedAt: string;\n endedAt: string | null;\n rerunOf: string | null;\n steps: RunStepRecord[];\n}\n\nconst RUN_FIELDS = `id workflowId workflowName workflowVersion triggerKind\n triggerPayload status error startedAt endedAt rerunOf\n steps { stepId stepKey blockType status input output port error startedAt endedAt }`;\n\nexport interface RunsScope {\n workflowId?: string;\n // Scopes runs to the workflows the drive holds; ignored alongside workflowId.\n driveId?: string;\n limit?: number;\n}\n\nexport async function fetchRuns(scope: RunsScope = {}): Promise<RunRecord[]> {\n const data = await gql<{ workflowRuntime: { runs: RunRecord[] } }>(\n `query Runs($workflowId: String, $driveId: String, $limit: Int) {\n workflowRuntime { runs(workflowId: $workflowId, driveId: $driveId, limit: $limit) { ${RUN_FIELDS} } }\n }`,\n {\n workflowId: scope.workflowId ?? null,\n driveId: scope.driveId ?? null,\n limit: scope.limit ?? 30,\n },\n );\n return data.workflowRuntime.runs;\n}\n\nexport interface FireResult {\n runId: string | null;\n status: string;\n error: string | null;\n}\n\nexport async function fireWorkflow(\n workflowId: string,\n payload?: unknown,\n): Promise<FireResult> {\n const data = await gql<{ workflowRuntime: { fire: FireResult } }>(\n `mutation Fire($workflowId: String!, $payload: Unknown) {\n workflowRuntime { fire(workflowId: $workflowId, payload: $payload) { runId status error } }\n }`,\n { workflowId, payload: payload ?? {} },\n );\n return data.workflowRuntime.fire;\n}\n\n// Resume a FAILED run: succeeded steps replay, execution restarts at the\n// failure. Returns the new run.\nexport async function rerunRun(runId: string): Promise<FireResult> {\n const data = await gql<{ workflowRuntime: { rerun: FireResult } }>(\n `mutation Rerun($runId: String!) {\n workflowRuntime { rerun(runId: $runId) { runId status error } }\n }`,\n { runId },\n );\n return data.workflowRuntime.rerun;\n}\n\ninterface BlockOptionsResult {\n workflowRuntime: { blockOptions: unknown };\n}\n\nexport async function loadBlockOptions(\n blockType: string,\n propName: string,\n input: Record<string, unknown>,\n connectionId?: string,\n searchValue?: string,\n): Promise<unknown> {\n const data = await gql<BlockOptionsResult>(\n `query Options($blockType: String!, $propName: String!, $input: Unknown, $connectionId: String, $searchValue: String) {\n workflowRuntime { blockOptions(blockType: $blockType, propName: $propName, input: $input, connectionId: $connectionId, searchValue: $searchValue) }\n }`,\n {\n blockType,\n propName,\n input,\n connectionId: connectionId ?? null,\n searchValue: searchValue ?? null,\n },\n );\n return data.workflowRuntime.blockOptions;\n}\n"],"mappings":";;AAgKA,MAAa,qBAAoC;CAC/C,MAAM;CACN,aAAa;CACb,MAAM;CACN,UAAU;CACV,aACE;AACJ;AAEA,MAAM,QACJ,MACA,aACA,WAAW,OACX,iBACmB;CACnB;CACA;CACA,MAAM;CACN;CACA;AACF;AAIA,MAAM,aACJ,MACA,aACA,WAAW,OACX,iBACmB;CACnB;CACA;CACA,MAAM;CACN;CACA;AACF;AAEA,MAAM,UACJ,MACA,aACA,WAAW,OACX,iBACmB;CACnB;CACA;CACA,MAAM;CACN;CACA;AACF;AAGA,MAAM,YAAY,UAAwC;CACxD,GAAG;CACH,UAAU;AACZ;AAGA,MAAM,aACJ,MACA,SACA,WACmB;CAAE,GAAG;CAAM,UAAU;EAAE,MAAM;EAAS;CAAM;A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ACrC,GACA,IACF;GAGA,SACE,UACA,gBACA;IACE;KAAE,OAAO;KAA+B,OAAO;IAAO;IACtD;KAAE,OAAO;KAA4B,OAAO;IAAQ;IACpD;KAAE,OAAO;KAAe,OAAO;IAAO;IACtC;KACE,OAAO;KACP,OAAO;IACT;IACA;KACE,OAAO;KACP,OAAO;IACT;GACF,GACA,IACF;GAGA,UACE,UACE,aACA,UACA,MACA,sFACF,GACA,UACA,cACF;GACA,SACE,UACE,KACE,UACA,UACA,OACA,4IACF,GACA,UACA,cACF,CACF;GACA,SACE,UACE,OACE,oBACA,2BACA,OACA,4FACF,GACA,UACA,CAAC,kBAAkB,CACrB,CACF;GAGA,SACE,UACE,SAAS,aAAa,QAAQ;IAC5B;KAAE,OAAO;KAAqB,OAAO;IAAS;IAC9C;KAAE,OAAO;KAAS,OAAO;IAAO;IAChC;KAAE,OAAO;KAAW,OAAO;IAAS;GACtC,CAAC,GACD,UACA,YACF,CACF;GACA,SACE,UACE,SAAS,YAAY,mBAAmB,CACtC;IAAE,OAAO;IAAyB,OAAO;GAAM,GAC/C;IAAE,OAAO;IAAU,OAAO;GAAS,CACrC,CAAC,GACD,UACA,YACF,CACF;GACA,SACE,UACE,KACE,UACA,mBACA,OACA,oJACF,GACA,UACA,CAAC,eAAe,CAClB,CACF;GACA,SACE,KACE,eACA,kBACA,OACA,iQACF,CACF;GACA,SACE,OACE,oBACA,2BACA,OACA,iDACF,CACF;GACA,SACE,KACE,kBACA,mBACA,OACA,wJACF,CACF;GACA,SACE,SACE,gBACA,YACA,CACE;IAAE,OAAO;IAA4B,OAAO;GAAQ,GACpD;IAAE,OAAO;IAA0B,OAAO;GAAO,CACnD,GACA,OACA,0DACF,CACF;GACA,SACE,OACE,kBACA,kBACA,OACA,4DACF,CACF;EACF;CACF;CACA,eAAe;EACb,OAAO;EACP,aAAa;EACb,MAAM;EACN,OAAO,CACL,KACE,aACA,aACA,MACA,qCACF,GACA,KACE,UACA,UACA,OACA,8EACF,CACF;CACF;C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