@arbidocs/blocks 0.5.148 → 0.5.149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/dist/{ConnectedCallDock-6VGATAAQ.cjs → ConnectedCallDock-EASMNJXB.cjs} +20 -20
  2. package/dist/{ConnectedCallDock-6VGATAAQ.cjs.map → ConnectedCallDock-EASMNJXB.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-YBNERVTW.cjs → ConnectedCallRoom-BWZ2FHXN.cjs} +19 -19
  4. package/dist/{ConnectedCallRoom-YBNERVTW.cjs.map → ConnectedCallRoom-BWZ2FHXN.cjs.map} +1 -1
  5. package/dist/{ConnectedMailInviteCard-AJI7JZYJ.cjs → ConnectedMailInviteCard-ITMZRPIP.cjs} +5 -5
  6. package/dist/{ConnectedMailInviteCard-AJI7JZYJ.cjs.map → ConnectedMailInviteCard-ITMZRPIP.cjs.map} +1 -1
  7. package/dist/{ConnectedNativeDocxComparison-MG54YLSO.cjs → ConnectedNativeDocxComparison-4FAJDXPT.cjs} +22 -21
  8. package/dist/{ConnectedNativeDocxComparison-MG54YLSO.cjs.map → ConnectedNativeDocxComparison-4FAJDXPT.cjs.map} +1 -1
  9. package/dist/{ConnectedPresentation-JZQFTC5H.cjs → ConnectedPresentation-EIWVV7ON.cjs} +22 -22
  10. package/dist/{ConnectedPresentation-JZQFTC5H.cjs.map → ConnectedPresentation-EIWVV7ON.cjs.map} +1 -1
  11. package/dist/{ConnectedProductionSetDialog-EOWZQ6J3.cjs → ConnectedProductionSetDialog-SDHD5KTG.cjs} +9 -9
  12. package/dist/{ConnectedProductionSetDialog-EOWZQ6J3.cjs.map → ConnectedProductionSetDialog-SDHD5KTG.cjs.map} +1 -1
  13. package/dist/{ConnectedSlidesTab-BLR762KY.cjs → ConnectedSlidesTab-4FN5ZRRI.cjs} +21 -21
  14. package/dist/{ConnectedSlidesTab-BLR762KY.cjs.map → ConnectedSlidesTab-4FN5ZRRI.cjs.map} +1 -1
  15. package/dist/{ConnectedStreamedWordArtifact-7KZGQECL.cjs → ConnectedStreamedWordArtifact-D7EZFIJ7.cjs} +22 -21
  16. package/dist/{ConnectedStreamedWordArtifact-7KZGQECL.cjs.map → ConnectedStreamedWordArtifact-D7EZFIJ7.cjs.map} +1 -1
  17. package/dist/{DocumentReviewCard-UDC4PNIS.cjs → DocumentReviewCard-7MVNPVZC.cjs} +24 -24
  18. package/dist/{DocumentReviewCard-UDC4PNIS.cjs.map → DocumentReviewCard-7MVNPVZC.cjs.map} +1 -1
  19. package/dist/{FilesViewerDialog-D5GHWK4Y.cjs → FilesViewerDialog-6363IOTL.cjs} +47 -47
  20. package/dist/{FilesViewerDialog-D5GHWK4Y.cjs.map → FilesViewerDialog-6363IOTL.cjs.map} +1 -1
  21. package/dist/{WorkspaceTableView-2NRV4CWP.cjs → WorkspaceTableView-HHATEV2H.cjs} +10 -10
  22. package/dist/{WorkspaceTableView-2NRV4CWP.cjs.map → WorkspaceTableView-HHATEV2H.cjs.map} +1 -1
  23. package/dist/agents/index.cjs +398 -378
  24. package/dist/agents/tasks/WorkflowsTable.d.ts +5 -0
  25. package/dist/agents/tasks/WorkflowsTable.js +38 -7
  26. package/dist/agents/tasks/WorkflowsTable.js.map +2 -2
  27. package/dist/agents/tasks/workflowTableLabels.d.ts +2 -0
  28. package/dist/agents/tasks/workflowTableLabels.js +2 -1
  29. package/dist/agents/tasks/workflowTableLabels.js.map +2 -2
  30. package/dist/agents/workflows/StepParts.d.ts +4 -0
  31. package/dist/agents/workflows/StepParts.js +6 -1
  32. package/dist/agents/workflows/StepParts.js.map +2 -2
  33. package/dist/agents/workflows/index.d.ts +2 -2
  34. package/dist/agents/workflows/index.js +11 -1
  35. package/dist/agents/workflows/index.js.map +2 -2
  36. package/dist/agents/workflows/planSteps.d.ts +10 -1
  37. package/dist/agents/workflows/planSteps.js +34 -0
  38. package/dist/agents/workflows/planSteps.js.map +2 -2
  39. package/dist/agents/workflows/requiredLabels.d.ts +10 -0
  40. package/dist/agents/workflows/requiredLabels.js +14 -1
  41. package/dist/agents/workflows/requiredLabels.js.map +2 -2
  42. package/dist/agents/workflows/run.d.ts +1 -1
  43. package/dist/agents/workflows/run.js +2 -0
  44. package/dist/agents/workflows/run.js.map +2 -2
  45. package/dist/agents/workflows/stepKinds.d.ts +6 -2
  46. package/dist/agents/workflows/stepKinds.js +15 -3
  47. package/dist/agents/workflows/stepKinds.js.map +2 -2
  48. package/dist/agents/workflows/types.d.ts +26 -1
  49. package/dist/agents/workflows/types.js.map +1 -1
  50. package/dist/{ai-VLIPYNWP.cjs → ai-NC4ZE3UT.cjs} +30 -30
  51. package/dist/ai-NC4ZE3UT.cjs.map +1 -0
  52. package/dist/auth/index.cjs +1 -1
  53. package/dist/calls/index.cjs +50 -50
  54. package/dist/chat/index.cjs +80 -80
  55. package/dist/{chunk-AYWY4MX2.cjs → chunk-2E5AODIC.cjs} +28 -28
  56. package/dist/{chunk-AYWY4MX2.cjs.map → chunk-2E5AODIC.cjs.map} +1 -1
  57. package/dist/{chunk-XZMYSDU4.cjs → chunk-2XZJBPBV.cjs} +4 -4
  58. package/dist/{chunk-XZMYSDU4.cjs.map → chunk-2XZJBPBV.cjs.map} +1 -1
  59. package/dist/{chunk-ORGGDQKZ.cjs → chunk-2ZH4KVAZ.cjs} +40 -40
  60. package/dist/{chunk-ORGGDQKZ.cjs.map → chunk-2ZH4KVAZ.cjs.map} +1 -1
  61. package/dist/{chunk-EYXU32D7.cjs → chunk-3WXAGCUL.cjs} +6 -6
  62. package/dist/{chunk-EYXU32D7.cjs.map → chunk-3WXAGCUL.cjs.map} +1 -1
  63. package/dist/{chunk-57LUHZLV.cjs → chunk-43D2KKWT.cjs} +8 -8
  64. package/dist/{chunk-57LUHZLV.cjs.map → chunk-43D2KKWT.cjs.map} +1 -1
  65. package/dist/{chunk-L5Q5PDTA.cjs → chunk-43GIESOM.cjs} +4 -4
  66. package/dist/{chunk-L5Q5PDTA.cjs.map → chunk-43GIESOM.cjs.map} +1 -1
  67. package/dist/{chunk-ONRUHYW3.cjs → chunk-47NBCI3E.cjs} +4 -4
  68. package/dist/{chunk-ONRUHYW3.cjs.map → chunk-47NBCI3E.cjs.map} +1 -1
  69. package/dist/{chunk-MEWRE43W.cjs → chunk-54Y4LWTA.cjs} +107 -101
  70. package/dist/chunk-54Y4LWTA.cjs.map +1 -0
  71. package/dist/{chunk-LCIMYEGX.cjs → chunk-5QEPUONH.cjs} +9 -9
  72. package/dist/{chunk-LCIMYEGX.cjs.map → chunk-5QEPUONH.cjs.map} +1 -1
  73. package/dist/{chunk-K3ZZ6IH3.cjs → chunk-6IS6TZ7F.cjs} +4 -4
  74. package/dist/{chunk-K3ZZ6IH3.cjs.map → chunk-6IS6TZ7F.cjs.map} +1 -1
  75. package/dist/{chunk-C6RJQQLG.cjs → chunk-6KT6BEP4.cjs} +10 -10
  76. package/dist/{chunk-C6RJQQLG.cjs.map → chunk-6KT6BEP4.cjs.map} +1 -1
  77. package/dist/{chunk-OA3AN6WW.cjs → chunk-7KSOMWCS.cjs} +4 -4
  78. package/dist/{chunk-OA3AN6WW.cjs.map → chunk-7KSOMWCS.cjs.map} +1 -1
  79. package/dist/{chunk-KMOIE2XH.cjs → chunk-7XR6CPCU.cjs} +10 -8
  80. package/dist/chunk-7XR6CPCU.cjs.map +1 -0
  81. package/dist/{chunk-MC34TXSS.cjs → chunk-A5ZNAZ7Q.cjs} +17 -17
  82. package/dist/{chunk-MC34TXSS.cjs.map → chunk-A5ZNAZ7Q.cjs.map} +1 -1
  83. package/dist/{chunk-ZOU6K6DD.cjs → chunk-AN4YKCBD.cjs} +4 -4
  84. package/dist/{chunk-ZOU6K6DD.cjs.map → chunk-AN4YKCBD.cjs.map} +1 -1
  85. package/dist/{chunk-JZQ47OW5.cjs → chunk-C36NH6PR.cjs} +6 -6
  86. package/dist/{chunk-JZQ47OW5.cjs.map → chunk-C36NH6PR.cjs.map} +1 -1
  87. package/dist/{chunk-OXPIJYRU.cjs → chunk-C7EGCNLV.cjs} +86 -86
  88. package/dist/{chunk-OXPIJYRU.cjs.map → chunk-C7EGCNLV.cjs.map} +1 -1
  89. package/dist/{chunk-LZQ2XZOC.cjs → chunk-CFJAWCVX.cjs} +29 -29
  90. package/dist/{chunk-LZQ2XZOC.cjs.map → chunk-CFJAWCVX.cjs.map} +1 -1
  91. package/dist/{chunk-HWZT24TD.cjs → chunk-CRN64MYK.cjs} +165 -75
  92. package/dist/chunk-CRN64MYK.cjs.map +1 -0
  93. package/dist/{chunk-UNWDR6GG.cjs → chunk-DHQH4EYB.cjs} +4 -4
  94. package/dist/{chunk-UNWDR6GG.cjs.map → chunk-DHQH4EYB.cjs.map} +1 -1
  95. package/dist/{chunk-SD7GUB44.cjs → chunk-F4ULSAOA.cjs} +4 -4
  96. package/dist/{chunk-SD7GUB44.cjs.map → chunk-F4ULSAOA.cjs.map} +1 -1
  97. package/dist/{chunk-2VEQKLNN.cjs → chunk-FHNWK5RO.cjs} +8 -8
  98. package/dist/{chunk-2VEQKLNN.cjs.map → chunk-FHNWK5RO.cjs.map} +1 -1
  99. package/dist/{chunk-ZM6B5WJW.cjs → chunk-FPSHZW4W.cjs} +4 -4
  100. package/dist/{chunk-ZM6B5WJW.cjs.map → chunk-FPSHZW4W.cjs.map} +1 -1
  101. package/dist/{chunk-GAA222SK.cjs → chunk-FZASPI2Q.cjs} +5 -5
  102. package/dist/{chunk-GAA222SK.cjs.map → chunk-FZASPI2Q.cjs.map} +1 -1
  103. package/dist/{chunk-OUGRCQM7.cjs → chunk-GAVQFR6P.cjs} +4 -4
  104. package/dist/{chunk-OUGRCQM7.cjs.map → chunk-GAVQFR6P.cjs.map} +1 -1
  105. package/dist/{chunk-VCDD763Y.cjs → chunk-GPP7E3OQ.cjs} +4 -4
  106. package/dist/{chunk-VCDD763Y.cjs.map → chunk-GPP7E3OQ.cjs.map} +1 -1
  107. package/dist/{chunk-VLHBKF4P.cjs → chunk-H5ITWXUA.cjs} +5 -5
  108. package/dist/{chunk-VLHBKF4P.cjs.map → chunk-H5ITWXUA.cjs.map} +1 -1
  109. package/dist/{chunk-AGL7Z6Y2.cjs → chunk-H7SGZN33.cjs} +21 -21
  110. package/dist/{chunk-AGL7Z6Y2.cjs.map → chunk-H7SGZN33.cjs.map} +1 -1
  111. package/dist/{chunk-WNAZM2YS.cjs → chunk-HZF3YPEG.cjs} +4 -4
  112. package/dist/{chunk-WNAZM2YS.cjs.map → chunk-HZF3YPEG.cjs.map} +1 -1
  113. package/dist/{chunk-VF26CUE3.cjs → chunk-IIOFQKQV.cjs} +28 -28
  114. package/dist/{chunk-VF26CUE3.cjs.map → chunk-IIOFQKQV.cjs.map} +1 -1
  115. package/dist/{chunk-7AULM6LS.cjs → chunk-J5YEEWZT.cjs} +7 -7
  116. package/dist/{chunk-7AULM6LS.cjs.map → chunk-J5YEEWZT.cjs.map} +1 -1
  117. package/dist/{chunk-73ECBDG7.cjs → chunk-JARBYN6Z.cjs} +48 -14
  118. package/dist/chunk-JARBYN6Z.cjs.map +1 -0
  119. package/dist/{chunk-YZ25NAR3.cjs → chunk-JARRHAQW.cjs} +17 -17
  120. package/dist/{chunk-YZ25NAR3.cjs.map → chunk-JARRHAQW.cjs.map} +1 -1
  121. package/dist/{chunk-6THN5ZGA.cjs → chunk-JOYB727S.cjs} +4 -4
  122. package/dist/{chunk-6THN5ZGA.cjs.map → chunk-JOYB727S.cjs.map} +1 -1
  123. package/dist/{chunk-ECSOXKJQ.cjs → chunk-JZWLIOTP.cjs} +6 -6
  124. package/dist/{chunk-ECSOXKJQ.cjs.map → chunk-JZWLIOTP.cjs.map} +1 -1
  125. package/dist/{chunk-ZCVW63DF.cjs → chunk-LXQMTVAB.cjs} +15 -15
  126. package/dist/{chunk-ZCVW63DF.cjs.map → chunk-LXQMTVAB.cjs.map} +1 -1
  127. package/dist/{chunk-7D4WXUBS.cjs → chunk-M55XUF4L.cjs} +7 -7
  128. package/dist/{chunk-7D4WXUBS.cjs.map → chunk-M55XUF4L.cjs.map} +1 -1
  129. package/dist/{chunk-S5OGPQSB.cjs → chunk-MHGZZ6IJ.cjs} +6 -6
  130. package/dist/{chunk-S5OGPQSB.cjs.map → chunk-MHGZZ6IJ.cjs.map} +1 -1
  131. package/dist/{chunk-FK7MBD5H.cjs → chunk-MIYEIACV.cjs} +14 -14
  132. package/dist/{chunk-FK7MBD5H.cjs.map → chunk-MIYEIACV.cjs.map} +1 -1
  133. package/dist/{chunk-G5YLJ2YT.cjs → chunk-MKJBEL4W.cjs} +4 -4
  134. package/dist/{chunk-G5YLJ2YT.cjs.map → chunk-MKJBEL4W.cjs.map} +1 -1
  135. package/dist/{chunk-F6F375V7.cjs → chunk-NVECYF2N.cjs} +7 -7
  136. package/dist/{chunk-F6F375V7.cjs.map → chunk-NVECYF2N.cjs.map} +1 -1
  137. package/dist/{chunk-YKOPKLYP.cjs → chunk-P2K4XL4T.cjs} +4 -4
  138. package/dist/{chunk-YKOPKLYP.cjs.map → chunk-P2K4XL4T.cjs.map} +1 -1
  139. package/dist/{chunk-KWV4VC74.cjs → chunk-SDGE2F77.cjs} +6 -6
  140. package/dist/{chunk-KWV4VC74.cjs.map → chunk-SDGE2F77.cjs.map} +1 -1
  141. package/dist/{chunk-P5TQOSKA.cjs → chunk-SK6BONXE.cjs} +6 -6
  142. package/dist/{chunk-P5TQOSKA.cjs.map → chunk-SK6BONXE.cjs.map} +1 -1
  143. package/dist/{chunk-XPQR2PJX.cjs → chunk-SQCCQU3K.cjs} +2 -2
  144. package/dist/chunk-SQCCQU3K.cjs.map +1 -0
  145. package/dist/{chunk-AZQ4XIVY.cjs → chunk-SQHR7564.cjs} +134 -134
  146. package/dist/{chunk-AZQ4XIVY.cjs.map → chunk-SQHR7564.cjs.map} +1 -1
  147. package/dist/{chunk-JJDJLAC7.cjs → chunk-STFIBNND.cjs} +34 -34
  148. package/dist/{chunk-JJDJLAC7.cjs.map → chunk-STFIBNND.cjs.map} +1 -1
  149. package/dist/{chunk-DUNXLT63.cjs → chunk-TJDCTRB5.cjs} +3 -3
  150. package/dist/{chunk-DUNXLT63.cjs.map → chunk-TJDCTRB5.cjs.map} +1 -1
  151. package/dist/{chunk-CENMN32L.cjs → chunk-U2HDSS5R.cjs} +6 -6
  152. package/dist/{chunk-CENMN32L.cjs.map → chunk-U2HDSS5R.cjs.map} +1 -1
  153. package/dist/{chunk-EF2QQBDV.cjs → chunk-UGSN47YE.cjs} +5 -5
  154. package/dist/{chunk-EF2QQBDV.cjs.map → chunk-UGSN47YE.cjs.map} +1 -1
  155. package/dist/{chunk-6RC6GYIW.cjs → chunk-UHEOY35C.cjs} +4 -4
  156. package/dist/{chunk-6RC6GYIW.cjs.map → chunk-UHEOY35C.cjs.map} +1 -1
  157. package/dist/{chunk-2XZ3HBAA.cjs → chunk-UHT2Q6IF.cjs} +30 -30
  158. package/dist/{chunk-2XZ3HBAA.cjs.map → chunk-UHT2Q6IF.cjs.map} +1 -1
  159. package/dist/{chunk-5RMVFFVW.cjs → chunk-VHD5DZW4.cjs} +7 -7
  160. package/dist/{chunk-5RMVFFVW.cjs.map → chunk-VHD5DZW4.cjs.map} +1 -1
  161. package/dist/{chunk-LIKDQBNJ.cjs → chunk-VMXTOIXB.cjs} +8 -3
  162. package/dist/chunk-VMXTOIXB.cjs.map +1 -0
  163. package/dist/{chunk-SK6LFIU2.cjs → chunk-WREXDEOM.cjs} +11 -11
  164. package/dist/{chunk-SK6LFIU2.cjs.map → chunk-WREXDEOM.cjs.map} +1 -1
  165. package/dist/{chunk-FHKBR55Q.cjs → chunk-WSUHF676.cjs} +5 -5
  166. package/dist/{chunk-FHKBR55Q.cjs.map → chunk-WSUHF676.cjs.map} +1 -1
  167. package/dist/{chunk-JJZOL5MG.cjs → chunk-WXMD4AA4.cjs} +34 -10
  168. package/dist/chunk-WXMD4AA4.cjs.map +1 -0
  169. package/dist/{chunk-GF3I3SA4.cjs → chunk-X5H2STK4.cjs} +12 -12
  170. package/dist/{chunk-GF3I3SA4.cjs.map → chunk-X5H2STK4.cjs.map} +1 -1
  171. package/dist/{chunk-5TT6J67U.cjs → chunk-X6QGVLMV.cjs} +21 -21
  172. package/dist/{chunk-5TT6J67U.cjs.map → chunk-X6QGVLMV.cjs.map} +1 -1
  173. package/dist/{chunk-T6WA6S5T.cjs → chunk-XFZKPEUD.cjs} +4 -4
  174. package/dist/{chunk-T6WA6S5T.cjs.map → chunk-XFZKPEUD.cjs.map} +1 -1
  175. package/dist/{chunk-I2LJ7RZ2.cjs → chunk-Y3GJBLAI.cjs} +10 -8
  176. package/dist/chunk-Y3GJBLAI.cjs.map +1 -0
  177. package/dist/{chunk-IFJBE7M5.cjs → chunk-YV36BZE7.cjs} +10 -10
  178. package/dist/{chunk-IFJBE7M5.cjs.map → chunk-YV36BZE7.cjs.map} +1 -1
  179. package/dist/{chunk-3VPNL4EH.cjs → chunk-ZLJP6447.cjs} +135 -117
  180. package/dist/chunk-ZLJP6447.cjs.map +1 -0
  181. package/dist/{chunk-YST6GVN5.cjs → chunk-ZUYY3JRO.cjs} +18 -18
  182. package/dist/{chunk-YST6GVN5.cjs.map → chunk-ZUYY3JRO.cjs.map} +1 -1
  183. package/dist/citations/index.cjs +8 -8
  184. package/dist/collaboration/index.cjs +13 -13
  185. package/dist/connect/docx.cjs +25 -24
  186. package/dist/connect/docx.cjs.map +1 -1
  187. package/dist/connect/index.cjs +1454 -1454
  188. package/dist/connect/viewer.cjs +32 -32
  189. package/dist/connection/ConnectedWorkflowsTable.js +77 -52
  190. package/dist/connection/ConnectedWorkflowsTable.js.map +2 -2
  191. package/dist/connection/useWorkflowThread.d.ts +6 -0
  192. package/dist/connection/useWorkflowThread.js +10 -3
  193. package/dist/connection/useWorkflowThread.js.map +2 -2
  194. package/dist/connection/workflows/ConnectedSavedWorkflowRun.d.ts +29 -0
  195. package/dist/connection/workflows/ConnectedSavedWorkflowRun.js +48 -0
  196. package/dist/connection/workflows/ConnectedSavedWorkflowRun.js.map +7 -0
  197. package/dist/connection/workflows/ConnectedWorkflowsPage.js +29 -1
  198. package/dist/connection/workflows/ConnectedWorkflowsPage.js.map +2 -2
  199. package/dist/connection/workflows/StartWorkflowInDialog.d.ts +23 -0
  200. package/dist/connection/workflows/StartWorkflowInDialog.js +75 -0
  201. package/dist/connection/workflows/StartWorkflowInDialog.js.map +7 -0
  202. package/dist/connection/workflows/useWorkflowsPageState.d.ts +3 -0
  203. package/dist/dashboards/index.cjs +18 -18
  204. package/dist/embed/index.cjs +46 -46
  205. package/dist/facts/index.cjs +45 -45
  206. package/dist/files/index.cjs +229 -229
  207. package/dist/home/index.cjs +33 -33
  208. package/dist/index.cjs +712 -692
  209. package/dist/office/index.cjs +5 -5
  210. package/dist/pages/index.cjs +14 -14
  211. package/dist/provider/environment.d.ts +5 -0
  212. package/dist/provider/environment.js +6 -1
  213. package/dist/provider/environment.js.map +2 -2
  214. package/dist/provider/requests.d.ts +2 -0
  215. package/dist/provider/requests.js.map +2 -2
  216. package/dist/retrieval/index.cjs +4 -4
  217. package/dist/settings/index.cjs +148 -148
  218. package/dist/shell/index.cjs +56 -56
  219. package/dist/studio/index.cjs +39 -39
  220. package/dist/styles.css +1 -1
  221. package/dist/workflow-canvas/WorkflowBuilder.js +2 -1
  222. package/dist/workflow-canvas/WorkflowBuilder.js.map +2 -2
  223. package/dist/workflow-canvas/WorkflowCanvas.d.ts +1 -0
  224. package/dist/workflow-canvas/WorkflowCanvas.js +3 -1
  225. package/dist/workflow-canvas/WorkflowCanvas.js.map +2 -2
  226. package/dist/workflow-canvas/edit.js +17 -1
  227. package/dist/workflow-canvas/edit.js.map +2 -2
  228. package/dist/workflow-canvas/index.cjs +196 -112
  229. package/dist/workflow-canvas/index.cjs.map +1 -1
  230. package/dist/workflow-canvas/trigger.js +6 -2
  231. package/dist/workflow-canvas/trigger.js.map +2 -2
  232. package/dist/workspaces/index.cjs +18 -18
  233. package/node_modules/@arbidocs/coedit/package.json +1 -1
  234. package/package.json +5 -5
  235. package/src/blocks.css +1 -0
  236. package/dist/ai-VLIPYNWP.cjs.map +0 -1
  237. package/dist/chunk-3VPNL4EH.cjs.map +0 -1
  238. package/dist/chunk-73ECBDG7.cjs.map +0 -1
  239. package/dist/chunk-HWZT24TD.cjs.map +0 -1
  240. package/dist/chunk-I2LJ7RZ2.cjs.map +0 -1
  241. package/dist/chunk-JJZOL5MG.cjs.map +0 -1
  242. package/dist/chunk-KMOIE2XH.cjs.map +0 -1
  243. package/dist/chunk-LIKDQBNJ.cjs.map +0 -1
  244. package/dist/chunk-MEWRE43W.cjs.map +0 -1
  245. package/dist/chunk-XPQR2PJX.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/agents/workflows/run.ts"],
4
- "sourcesContent": ["/**\n * The model of a stepped workflow (`run: { kind: 'steps' }`): the steps form a graph (each waits\n * for the steps in its `after`), and a run's progress is each step's `WorkflowStepState`, as the\n * run's thread records it (`stepStatesFromActivity`). Pure functions, shared by the thread runner\n * (`useWorkflowThread`), the builder's preview and the thread's top bar.\n */\n\nimport type {\n WorkflowActionStep,\n WorkflowActionType,\n WorkflowAgentStep,\n WorkflowAssignee,\n WorkflowDocumentRef,\n WorkflowField,\n WorkflowDefinition,\n WorkflowErrors,\n WorkflowInputs,\n WorkflowInputValue,\n WorkflowReviewStep,\n WorkflowStep,\n WorkflowStepState,\n WorkflowStepStatus,\n} from './types'\nimport { composeWorkflowPrompt, defaultInputs, validateInputs } from './workflow'\n\n/** A stepped workflow's steps; empty for a single-run one. */\nexport function workflowSteps(workflow: WorkflowDefinition): WorkflowStep[] {\n return workflow.run.kind === 'steps' ? workflow.run.steps : []\n}\n\nexport const isSteppedWorkflow = (workflow: WorkflowDefinition): boolean =>\n workflow.run.kind === 'steps'\n\n/* ------------------------------- graph ------------------------------- */\n\n/** What a step waits for: its `after`, else the step before it in the list (a sequence). */\nexport function stepDependencies(steps: WorkflowStep[], id: string): string[] {\n const i = steps.findIndex((s) => s.id === id)\n if (i < 0) return []\n return steps[i].after ?? (i > 0 ? [steps[i - 1].id] : [])\n}\n\n/** `a` waits for `b`, directly or through other steps. */\nexport function dependsOn(steps: WorkflowStep[], a: string, b: string): boolean {\n const seen = new Set<string>()\n const stack = [...stepDependencies(steps, a)]\n while (stack.length) {\n const id = stack.pop() as string\n if (id === b) return true\n if (seen.has(id)) continue\n seen.add(id)\n stack.push(...stepDependencies(steps, id))\n }\n return false\n}\n\n/**\n * The steps in dependency order, keeping the given order wherever the graph allows (a stable\n * topological sort). Every implicit dependency is written out as `after` first, so reordering\n * never changes what a step waits for. Steps in a cycle keep their place at the end; validation\n * reports them.\n */\nexport function orderSteps(steps: WorkflowStep[]): WorkflowStep[] {\n const explicit = steps.map((s) => ({ ...s, after: stepDependencies(steps, s.id) }))\n const known = new Set(explicit.map((s) => s.id))\n const placed = new Set<string>()\n const out: WorkflowStep[] = []\n let progress = true\n while (out.length < explicit.length && progress) {\n progress = false\n for (const s of explicit) {\n if (placed.has(s.id)) continue\n if (s.after.every((d) => placed.has(d) || !known.has(d))) {\n out.push(s)\n placed.add(s.id)\n progress = true\n break\n }\n }\n }\n return [...out, ...explicit.filter((s) => !placed.has(s.id))]\n}\n\nexport type WorkflowGraphProblem =\n | { code: 'duplicate'; step: string }\n | { code: 'unknown'; step: string; dependency: string }\n | { code: 'cycle'; step: string }\n | { code: 'order'; step: string; dependency: string }\n\n/** What makes a stepped workflow unrunnable. Empty = valid. */\nexport function validateWorkflowGraph(steps: WorkflowStep[]): WorkflowGraphProblem[] {\n const problems: WorkflowGraphProblem[] = []\n const ids = new Set<string>()\n for (const s of steps) {\n if (ids.has(s.id)) problems.push({ code: 'duplicate', step: s.id })\n ids.add(s.id)\n }\n steps.forEach((s, i) => {\n for (const d of stepDependencies(steps, s.id)) {\n if (!ids.has(d)) problems.push({ code: 'unknown', step: s.id, dependency: d })\n else if (d === s.id || dependsOn(steps, d, s.id)) problems.push({ code: 'cycle', step: s.id })\n else if (steps.findIndex((x) => x.id === d) > i)\n problems.push({ code: 'order', step: s.id, dependency: d })\n }\n })\n return problems\n}\n\n/**\n * The steps by depth (the longest chain before each): what the stepper shows side by side.\n * A sequence is one step per level.\n */\nexport function stepLevels(steps: WorkflowStep[]): WorkflowStep[][] {\n const depth = new Map<string, number>()\n for (const s of steps) {\n const deps = stepDependencies(steps, s.id).filter((d) => depth.has(d))\n depth.set(s.id, deps.length ? Math.max(...deps.map((d) => depth.get(d) as number)) + 1 : 0)\n }\n const levels: WorkflowStep[][] = []\n for (const s of steps) (levels[depth.get(s.id) as number] ??= []).push(s)\n return levels.filter(Boolean)\n}\n\n/* ----------------------------- progress ----------------------------- */\n\n/** One entry of a thread's activity log, as far as steps are concerned. */\nexport interface WorkflowActivityEvent {\n kind: string\n detail?: Record<string, unknown> | null\n actor_ext_id?: string | null\n created_at?: string\n}\n\nconst STEP_EVENTS: Record<string, WorkflowStepStatus> = {\n step_started: 'running',\n step_waiting: 'waiting',\n step_done: 'done',\n step_skipped: 'skipped',\n step_failed: 'failed',\n}\n\nconst str = (v: unknown): string | undefined => (typeof v === 'string' && v ? v : undefined)\nconst ACTION_TYPES: readonly WorkflowActionType[] = [\n 'sign',\n 'email_draft',\n 'tabular_review',\n 'approval',\n]\nconst asAction = (v: unknown): WorkflowActionType | undefined =>\n ACTION_TYPES.includes(v as WorkflowActionType) ? (v as WorkflowActionType) : undefined\nconst asRecord = (v: unknown): Record<string, unknown> | undefined =>\n v && typeof v === 'object' && !Array.isArray(v) ? (v as Record<string, unknown>) : undefined\nconst asStrings = (v: unknown): string[] | undefined =>\n Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : undefined\n\n/**\n * The documents (ids) a `waiting` step waits on to finish processing before its turn starts\n * (`waiting.documents`, from `step_waiting` and then `step_progress` as the set shrinks); none for\n * any other step. Action steps wait on people, not documents.\n */\nexport function waitingDocuments(state: WorkflowStepState | undefined): string[] {\n return state?.status === 'waiting' ? (asStrings(state.waiting?.documents) ?? []) : []\n}\n\n/** The documents a `step_waiting` / `step_progress` event names, if it names any. */\nexport function eventWaitingDocuments(detail: Record<string, unknown> | null | undefined) {\n return asStrings(asRecord(detail?.waiting)?.documents)\n}\n\n/** \"Waiting for 3 documents to finish processing\" (one: \"1 document\"). */\nexport function waitingForDocumentsText(count: number): string {\n return `Waiting for ${count} ${count === 1 ? 'document' : 'documents'} to finish processing`\n}\n\n/** The steps a `step_sent_back` reopens: its `reopened` list, else the one it went `to`. */\nfunction reopenedBy(detail: Record<string, unknown>): string[] {\n const to = str(detail.to)\n return asStrings(detail.reopened) ?? (to ? [to] : [])\n}\n\n/**\n * Each step's state from the thread's activity log (oldest first): its latest step event wins.\n * A send-back reopens the steps it lists as pending (only the one it went `to` is `sentBack`); a\n * `step_ready` records who was told and a `step_progress` what a waiting step now waits on, until\n * the step's next change. Mirrors the server (`workflow_steps.progress`).\n */\nexport function stepStatesFromActivity(\n events: WorkflowActivityEvent[]\n): Record<string, WorkflowStepState> {\n const states: Record<string, WorkflowStepState> = {}\n for (const e of events) {\n const detail = e.detail ?? {}\n const step = str(detail.step)\n if (!step) continue\n if (e.kind === 'step_sent_back') {\n const to = str(detail.to)\n for (const id of reopenedBy(detail))\n states[id] =\n id === to\n ? {\n status: 'pending',\n sentBack: true,\n hasNote: typeof detail.note_encrypted === 'string',\n }\n : { status: 'pending' }\n continue\n }\n if (e.kind === 'step_ready') {\n states[step] = { ...(states[step] ?? { status: 'pending' }), announcedTo: str(detail.to) }\n continue\n }\n if (e.kind === 'step_progress') {\n const before = states[step]\n const waiting = asRecord(detail.waiting)\n if (before?.status === 'waiting' && waiting) states[step] = { ...before, waiting }\n continue\n }\n const status = STEP_EVENTS[e.kind]\n if (!status) continue\n const before = states[step]\n const responseId = str(detail.response_id) ?? before?.responseId ?? null\n const startedAt = status === 'running' ? e.created_at : before?.startedAt\n const action = asAction(detail.action) ?? before?.action\n const documents = asStrings(detail.documents) ?? before?.documents\n const waiting = status === 'waiting' ? asRecord(detail.waiting) : undefined\n const output = status === 'done' ? asRecord(detail.output) : undefined\n const approved = Array.isArray(detail.approved)\n ? (detail.approved.filter(asRecord) as WorkflowStepState['approved'])\n : undefined\n const finished = status === 'done' || status === 'skipped' || status === 'failed'\n const declinedBy = str(detail.declined_by)\n // Skipped while it stood failed: what waits for it goes on without its result, and says so.\n const afterFailure =\n status === 'skipped' && (before?.status === 'failed' || !!before?.skippedAfterFailure)\n states[step] = {\n status,\n responseId,\n error: str(detail.error) ?? (afterFailure ? (before?.error ?? null) : null),\n ...(afterFailure ? { skippedAfterFailure: true } : {}),\n ...(startedAt ? { startedAt } : {}),\n ...(action ? { action } : {}),\n ...(documents?.length ? { documents } : {}),\n ...(waiting ? { waiting } : {}),\n ...(output ? { output } : {}),\n ...(approved ? { approved } : {}),\n ...(finished ? { by: e.actor_ext_id ?? null } : {}),\n ...(finished && e.created_at ? { at: e.created_at } : {}),\n ...(declinedBy ? { declinedBy } : {}),\n }\n }\n return states\n}\n\n/** The fields a person fills in on a step: a form's inputs, a review's fields. */\nexport function stepFields(step: WorkflowStep): WorkflowField[] {\n return step.kind === 'form' ? step.inputs : step.kind === 'review' ? (step.fields ?? []) : []\n}\n\n/** The fields the steps ask for (forms and reviews), in plan order. */\nexport const runFieldsOf = (steps: WorkflowStep[]): WorkflowField[] => steps.flatMap(stepFields)\n\n/** Every field the run asks for: the launch form's, then each form's and review's. */\nexport function runFields(workflow: WorkflowDefinition): WorkflowField[] {\n return [...workflow.inputs, ...workflowSteps(workflow).flatMap(stepFields)]\n}\n\n/** A fresh run's inputs: every field at its default, then the prefills. */\nexport function initialRunInputs(\n workflow: WorkflowDefinition,\n inputs: WorkflowInputs = {}\n): WorkflowInputs {\n return { ...defaultInputs({ ...workflow, inputs: runFields(workflow) }), ...inputs }\n}\n\nconst finished = (s: WorkflowStepState | undefined): boolean =>\n s?.status === 'done' || s?.status === 'skipped'\n\n/**\n * Where a step stands: `blocked` until everything it waits for has finished (done or skipped),\n * then `ready`, then its own status (`waiting`: an action step waiting on its people).\n */\nexport type WorkflowStepPhase =\n 'blocked' | 'ready' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed'\n\nexport function stepPhase(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n id: string\n): WorkflowStepPhase {\n const s = states[id]\n if (s && s.status !== 'pending') return s.status\n return stepDependencies(steps, id).every((d) => finished(states[d])) ? 'ready' : 'blocked'\n}\n\nexport const isRunFinished = (\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>\n): boolean => steps.length > 0 && steps.every((s) => finished(states[s.id]))\n\n/** A step a person does (form, upload, review); agent and action steps start by themselves. */\nexport const isPersonStep = (step: WorkflowStep): boolean =>\n step.kind !== 'agent' && step.kind !== 'action'\n\n/** An action step whose waiting phase is a person's: signing, sending the email. */\nexport const isPersonAction = (step: WorkflowStep): step is WorkflowActionStep =>\n step.kind === 'action' && (step.action.type === 'sign' || step.action.type === 'email_draft')\n\n/** A step that can have an assignee and a reminder: a person step, or a signature or email. */\nexport const canAssign = (step: WorkflowStep): boolean => isPersonStep(step) || isPersonAction(step)\n\n/**\n * What the primary button does on the step in view:\n * - `complete`: finish this form, upload or review (approve) and move on;\n * - `move`: view the next step: this one is finished, or the next does not wait for it;\n * - `start`: start this agent or action step: it is ready but no run is under way to start it\n * (the run has no thread yet, or the server could not start it);\n * - `retry`: run this failed step again (what waits for it needs its result; skipping it is the\n * person's explicit choice, never the primary button);\n * - `finish`: show the completion (every step has finished);\n * - `wait`: nothing yet (this step is under way and the next waits for it, or it is blocked).\n */\nexport type WorkflowNextAction = 'complete' | 'move' | 'start' | 'retry' | 'finish' | 'wait'\n\nexport interface NextActionOptions {\n /**\n * No run is under way to start a ready agent or action step: the run's thread does not exist\n * yet (a run whose first open step is an agent step), or the server is not running it.\n */\n needsStart?: boolean\n /** The host can run a failed step again. */\n canRetry?: boolean\n}\n\nexport function nextAction(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n current: string | null,\n { needsStart = false, canRetry = false }: NextActionOptions = {}\n): WorkflowNextAction {\n const i = steps.findIndex((s) => s.id === current)\n const step = steps[i]\n if (!step) return 'wait'\n const phase = stepPhase(steps, states, step.id)\n if (phase === 'blocked') return 'wait'\n const following = steps[i + 1]\n const independentNext = !!following && !dependsOn(steps, following.id, step.id)\n if (phase === 'done' || phase === 'skipped') {\n if (following) return 'move'\n return isRunFinished(steps, states) ? 'finish' : 'wait'\n }\n if (isPersonStep(step)) return 'complete'\n // An email draft is done when its person says it is sent; a signature, when its signers sign.\n if (phase === 'waiting' && step.kind === 'action' && step.action.type === 'email_draft')\n return 'complete'\n // Ready, but nothing will start it unless the person does (no thread yet, or no run under way).\n if (phase === 'ready' && needsStart) return 'start'\n // An agent step on its way (about to start, or running): look ahead if nothing there waits for it.\n if (phase !== 'failed') return independentNext ? 'move' : 'wait'\n // A failed step is never passed over by the primary button: what waits for it needs its result.\n // Retry it; skipping it anyway is a separate, explicit choice.\n const waitedFor = steps.slice(i + 1).some((s) => dependsOn(steps, s.id, step.id))\n if (!waitedFor && following) return 'move'\n return canRetry ? 'retry' : 'wait'\n}\n\n/**\n * The steps `id` waits for (directly or through others) that failed: still failed (so `id` is\n * blocked until they are retried), or skipped after failing (so `id` goes on without their\n * result). In plan order.\n */\nexport function failedUpstream(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n id: string\n): Array<{ step: WorkflowStep; state: WorkflowStepState }> {\n return upstreamSteps(steps, id).flatMap((s) => {\n const state = states[s.id]\n return state && (state.status === 'failed' || state.skippedAfterFailure)\n ? [{ step: s, state }]\n : []\n })\n}\n\n/** A form's or a fielded review's problems (empty = it can move on); other steps have none. */\nexport function validateStep(step: WorkflowStep, inputs: WorkflowInputs): WorkflowErrors {\n const fields = stepFields(step)\n if (!fields.length) return {}\n return validateInputs(\n {\n id: step.id,\n title: step.title,\n description: '',\n inputs: fields,\n run: { kind: 'operation' },\n landing: 'chat',\n },\n inputs\n )\n}\n\n/* --------------------------- people and documents --------------------------- */\n\n/** Every step `id` waits for, directly or through others, in plan order. */\nexport function upstreamSteps(steps: WorkflowStep[], id: string): WorkflowStep[] {\n return steps.filter((s) => s.id !== id && dependsOn(steps, id, s.id))\n}\n\n/**\n * Where a ready step can send the work back to: an earlier step it waits for that has something\n * to redo (done, skipped or failed), nearest first.\n */\nexport function sendBackTargets(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n id: string\n): WorkflowStep[] {\n return upstreamSteps(steps, id)\n .filter((s) => ['done', 'skipped', 'failed'].includes(states[s.id]?.status ?? 'pending'))\n .reverse()\n}\n\n/** Something a step still needs before it can run, for the builder to point out. */\nexport interface WorkflowStepProblem {\n step: string\n missing: 'document' | 'signers' | 'recipients' | 'tags' | 'documents' | 'database' | 'decision'\n}\n\nconst isBlankRef = (ref: WorkflowDocumentRef): boolean =>\n 'step' in ref ? !ref.step : 'input' in ref ? !ref.input : !ref.id.trim()\n\n/** What the steps still need before they can run: an action's document, signers, \u2026 */\nexport function stepConfigProblems(steps: WorkflowStep[]): WorkflowStepProblem[] {\n const out: WorkflowStepProblem[] = []\n for (const s of steps) {\n if (s.kind === 'action') {\n const a = s.action\n if (a.type === 'sign') {\n if (!a.document || isBlankRef(a.document)) out.push({ step: s.id, missing: 'document' })\n if (!a.signers.length) out.push({ step: s.id, missing: 'signers' })\n } else if (a.type === 'email_draft') {\n if (!a.to.some((t) => t.trim())) out.push({ step: s.id, missing: 'recipients' })\n } else if (a.type === 'approval') {\n if (!a.database.trim()) out.push({ step: s.id, missing: 'database' })\n if (!a.decision.trim()) out.push({ step: s.id, missing: 'decision' })\n } else {\n if (!a.tags.length) out.push({ step: s.id, missing: 'tags' })\n if (Array.isArray(a.documents) && !a.documents.length)\n out.push({ step: s.id, missing: 'documents' })\n }\n }\n if (s.kind === 'agent' && s.editDocument && isBlankRef(s.editDocument))\n out.push({ step: s.id, missing: 'document' })\n }\n return out\n}\n\n/** A document version id (`doc-\u2026@v3`) split into the document and its version. */\nexport function splitDocRef(ref: string): { id: string; version?: number } {\n const m = /^(doc-[A-Za-z0-9]+)(?:@v(\\d+))?$/.exec(ref)\n return m ? { id: m[1], ...(m[2] ? { version: Number(m[2]) } : {}) } : { id: ref }\n}\n\n/** How an assignee that names no one directly is described. */\nexport interface AssigneeWording {\n runOwner: string\n projectLead: string\n /** `{field}`: the person field's label. */\n input: string\n}\n\nexport const DEFAULT_ASSIGNEE_WORDING: AssigneeWording = {\n runOwner: 'whoever started the run',\n projectLead: 'the project lead',\n input: 'the person in \u201C{field}\u201D',\n}\n\n/**\n * Who a step is for, in words: the person it was announced to, the member it names, the person a\n * form field holds (each through `nameOf`), else its role. Undefined when it names no one.\n */\nexport function assigneeName(\n assignee: WorkflowAssignee | undefined,\n options: {\n nameOf?: (id: string) => string | undefined\n inputs?: WorkflowInputs\n fields?: WorkflowField[]\n /** Who the server told (the assignee resolved): wins over a role. */\n announcedTo?: string | null\n wording?: Partial<AssigneeWording>\n } = {}\n): string | undefined {\n const w = { ...DEFAULT_ASSIGNEE_WORDING, ...options.wording }\n const name = (id: string) => options.nameOf?.(id) ?? id\n const told = options.announcedTo ? options.nameOf?.(options.announcedTo) : undefined\n if (told) return told\n if (!assignee) return undefined\n if ('user' in assignee) return name(assignee.user)\n if ('input' in assignee) {\n const value = options.inputs?.[assignee.input]\n if (typeof value === 'string' && value) return name(value)\n const label = options.fields?.find((f) => f.name === assignee.input)?.label ?? assignee.input\n return w.input.replace('{field}', label)\n }\n if ('runOwner' in assignee) return w.runOwner\n return w.projectLead\n}\n\n/* ----------------------------- composing ----------------------------- */\n\nconst asText = (value: WorkflowInputValue | undefined): string =>\n typeof value === 'string' ? value.trim() : typeof value === 'number' ? String(value) : ''\n\n/**\n * Fill a step's `with` templates from the run's inputs: `{{a}}`, `{{a || b}}` (first non-blank).\n * A template that is exactly one bare reference passes the value through untouched.\n */\nexport function fillStepInputs(\n templates: Record<string, string> | undefined,\n inputs: WorkflowInputs\n): WorkflowInputs {\n const out: WorkflowInputs = {}\n for (const [name, template] of Object.entries(templates ?? {})) {\n const bare = /^\\{\\{\\s*([a-z][a-z0-9_]*)\\s*\\}\\}$/i.exec(template)\n if (bare) {\n out[name] = inputs[bare[1]] ?? ''\n continue\n }\n out[name] = fillRunText(template, inputs)\n }\n return out\n}\n\n/** A template over the run's inputs, as text (`{{a}}`, `{{a || b}}`). */\nexport function fillRunText(template: string, inputs: WorkflowInputs): string {\n return template\n .replace(/\\{\\{([^}]*)\\}\\}/g, (_, expr: string) => {\n for (const ref of expr.split('||')) {\n const text = asText(inputs[ref.trim()])\n if (text) return text\n }\n return ''\n })\n .trim()\n}\n\n/** The run thread's title: the workflow's `threadTitle` template, else its title. */\nexport function runThreadTitle(workflow: WorkflowDefinition, inputs: WorkflowInputs): string {\n const template = workflow.run.kind === 'steps' ? workflow.run.threadTitle : undefined\n return (template && fillRunText(template, inputs)) || workflow.title\n}\n\n/** What a review asks for: its instructions filled from the run, else its title. */\nexport function reviewInstructions(step: WorkflowReviewStep, inputs: WorkflowInputs): string {\n return (step.instructions && fillRunText(step.instructions, inputs)) || step.title\n}\n\nexport interface StepComposeOptions {\n /** Looks up the workflow a step names (`step.workflow`). */\n resolveWorkflow?: (id: string) => WorkflowDefinition | undefined\n /**\n * The host's wording for `operation` runs: the named workflow's id (or the step's own id when it\n * runs inline), its filled inputs, and the whole run's inputs (e.g. to ground it in the record).\n */\n compose?: (id: string, inputs: WorkflowInputs, runInputs: WorkflowInputs) => string | undefined\n}\n\n/** The prompt an agent step of `workflow` sends; '' when nothing could compose it (no binding). */\nexport function composeStepPrompt(\n workflow: WorkflowDefinition,\n step: WorkflowAgentStep,\n runInputs: WorkflowInputs,\n { resolveWorkflow, compose }: StepComposeOptions = {}\n): string {\n if (step.workflow) {\n const target = resolveWorkflow?.(step.workflow)\n if (!target) return ''\n const inputs = { ...defaultInputs(target), ...fillStepInputs(step.with, runInputs) }\n return target.run.kind === 'prompt'\n ? composeWorkflowPrompt(target, inputs)\n : (compose?.(target.id, inputs, runInputs) ?? '')\n }\n if (step.run?.kind === 'prompt') {\n return composeWorkflowPrompt(\n { ...workflow, inputs: runFields(workflow), run: step.run },\n runInputs\n )\n }\n return compose?.(step.id, runInputs, runInputs) ?? ''\n}\n"],
5
- "mappings": ";AAuBA,SAAS,uBAAuB,eAAe,sBAAsB;AAG9D,SAAS,cAAc,UAA8C;AAC1E,SAAO,SAAS,IAAI,SAAS,UAAU,SAAS,IAAI,QAAQ,CAAC;AAC/D;AAEO,MAAM,oBAAoB,CAAC,aAChC,SAAS,IAAI,SAAS;AAKjB,SAAS,iBAAiB,OAAuB,IAAsB;AAC5E,QAAM,IAAI,MAAM,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE;AAC5C,MAAI,IAAI,EAAG,QAAO,CAAC;AACnB,SAAO,MAAM,CAAC,EAAE,UAAU,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC;AACzD;AAGO,SAAS,UAAU,OAAuB,GAAW,GAAoB;AAC9E,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,QAAQ,CAAC,GAAG,iBAAiB,OAAO,CAAC,CAAC;AAC5C,SAAO,MAAM,QAAQ;AACnB,UAAM,KAAK,MAAM,IAAI;AACrB,QAAI,OAAO,EAAG,QAAO;AACrB,QAAI,KAAK,IAAI,EAAE,EAAG;AAClB,SAAK,IAAI,EAAE;AACX,UAAM,KAAK,GAAG,iBAAiB,OAAO,EAAE,CAAC;AAAA,EAC3C;AACA,SAAO;AACT;AAQO,SAAS,WAAW,OAAuC;AAChE,QAAM,WAAW,MAAM,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,iBAAiB,OAAO,EAAE,EAAE,EAAE,EAAE;AAClF,QAAM,QAAQ,IAAI,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AAC/C,QAAM,SAAS,oBAAI,IAAY;AAC/B,QAAM,MAAsB,CAAC;AAC7B,MAAI,WAAW;AACf,SAAO,IAAI,SAAS,SAAS,UAAU,UAAU;A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,EAAE,GAAG,UAAU,QAAQ,UAAU,QAAQ,GAAG,KAAK,KAAK,IAAI;AAAA,MAC1D;AAAA,IACF;AAAA,EACF;AACA,SAAO,UAAU,KAAK,IAAI,WAAW,SAAS,KAAK;AACrD;",
4
+ "sourcesContent": ["/**\n * The model of a stepped workflow (`run: { kind: 'steps' }`): the steps form a graph (each waits\n * for the steps in its `after`), and a run's progress is each step's `WorkflowStepState`, as the\n * run's thread records it (`stepStatesFromActivity`). Pure functions, shared by the thread runner\n * (`useWorkflowThread`), the builder's preview and the thread's top bar.\n */\n\nimport type {\n WorkflowActionStep,\n WorkflowActionType,\n WorkflowAgentStep,\n WorkflowAssignee,\n WorkflowDocumentRef,\n WorkflowField,\n WorkflowDefinition,\n WorkflowErrors,\n WorkflowInputs,\n WorkflowInputValue,\n WorkflowReviewStep,\n WorkflowStep,\n WorkflowStepState,\n WorkflowStepStatus,\n} from './types'\nimport { composeWorkflowPrompt, defaultInputs, validateInputs } from './workflow'\n\n/** A stepped workflow's steps; empty for a single-run one. */\nexport function workflowSteps(workflow: WorkflowDefinition): WorkflowStep[] {\n return workflow.run.kind === 'steps' ? workflow.run.steps : []\n}\n\nexport const isSteppedWorkflow = (workflow: WorkflowDefinition): boolean =>\n workflow.run.kind === 'steps'\n\n/* ------------------------------- graph ------------------------------- */\n\n/** What a step waits for: its `after`, else the step before it in the list (a sequence). */\nexport function stepDependencies(steps: WorkflowStep[], id: string): string[] {\n const i = steps.findIndex((s) => s.id === id)\n if (i < 0) return []\n return steps[i].after ?? (i > 0 ? [steps[i - 1].id] : [])\n}\n\n/** `a` waits for `b`, directly or through other steps. */\nexport function dependsOn(steps: WorkflowStep[], a: string, b: string): boolean {\n const seen = new Set<string>()\n const stack = [...stepDependencies(steps, a)]\n while (stack.length) {\n const id = stack.pop() as string\n if (id === b) return true\n if (seen.has(id)) continue\n seen.add(id)\n stack.push(...stepDependencies(steps, id))\n }\n return false\n}\n\n/**\n * The steps in dependency order, keeping the given order wherever the graph allows (a stable\n * topological sort). Every implicit dependency is written out as `after` first, so reordering\n * never changes what a step waits for. Steps in a cycle keep their place at the end; validation\n * reports them.\n */\nexport function orderSteps(steps: WorkflowStep[]): WorkflowStep[] {\n const explicit = steps.map((s) => ({ ...s, after: stepDependencies(steps, s.id) }))\n const known = new Set(explicit.map((s) => s.id))\n const placed = new Set<string>()\n const out: WorkflowStep[] = []\n let progress = true\n while (out.length < explicit.length && progress) {\n progress = false\n for (const s of explicit) {\n if (placed.has(s.id)) continue\n if (s.after.every((d) => placed.has(d) || !known.has(d))) {\n out.push(s)\n placed.add(s.id)\n progress = true\n break\n }\n }\n }\n return [...out, ...explicit.filter((s) => !placed.has(s.id))]\n}\n\nexport type WorkflowGraphProblem =\n | { code: 'duplicate'; step: string }\n | { code: 'unknown'; step: string; dependency: string }\n | { code: 'cycle'; step: string }\n | { code: 'order'; step: string; dependency: string }\n\n/** What makes a stepped workflow unrunnable. Empty = valid. */\nexport function validateWorkflowGraph(steps: WorkflowStep[]): WorkflowGraphProblem[] {\n const problems: WorkflowGraphProblem[] = []\n const ids = new Set<string>()\n for (const s of steps) {\n if (ids.has(s.id)) problems.push({ code: 'duplicate', step: s.id })\n ids.add(s.id)\n }\n steps.forEach((s, i) => {\n for (const d of stepDependencies(steps, s.id)) {\n if (!ids.has(d)) problems.push({ code: 'unknown', step: s.id, dependency: d })\n else if (d === s.id || dependsOn(steps, d, s.id)) problems.push({ code: 'cycle', step: s.id })\n else if (steps.findIndex((x) => x.id === d) > i)\n problems.push({ code: 'order', step: s.id, dependency: d })\n }\n })\n return problems\n}\n\n/**\n * The steps by depth (the longest chain before each): what the stepper shows side by side.\n * A sequence is one step per level.\n */\nexport function stepLevels(steps: WorkflowStep[]): WorkflowStep[][] {\n const depth = new Map<string, number>()\n for (const s of steps) {\n const deps = stepDependencies(steps, s.id).filter((d) => depth.has(d))\n depth.set(s.id, deps.length ? Math.max(...deps.map((d) => depth.get(d) as number)) + 1 : 0)\n }\n const levels: WorkflowStep[][] = []\n for (const s of steps) (levels[depth.get(s.id) as number] ??= []).push(s)\n return levels.filter(Boolean)\n}\n\n/* ----------------------------- progress ----------------------------- */\n\n/** One entry of a thread's activity log, as far as steps are concerned. */\nexport interface WorkflowActivityEvent {\n kind: string\n detail?: Record<string, unknown> | null\n actor_ext_id?: string | null\n created_at?: string\n}\n\nconst STEP_EVENTS: Record<string, WorkflowStepStatus> = {\n step_started: 'running',\n step_waiting: 'waiting',\n step_done: 'done',\n step_skipped: 'skipped',\n step_failed: 'failed',\n}\n\nconst str = (v: unknown): string | undefined => (typeof v === 'string' && v ? v : undefined)\nconst ACTION_TYPES: readonly WorkflowActionType[] = [\n 'sign',\n 'email_draft',\n 'tabular_review',\n 'approval',\n]\nconst asAction = (v: unknown): WorkflowActionType | undefined =>\n ACTION_TYPES.includes(v as WorkflowActionType) ? (v as WorkflowActionType) : undefined\nconst asRecord = (v: unknown): Record<string, unknown> | undefined =>\n v && typeof v === 'object' && !Array.isArray(v) ? (v as Record<string, unknown>) : undefined\nconst asStrings = (v: unknown): string[] | undefined =>\n Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : undefined\n\n/**\n * The documents (ids) a `waiting` step waits on to finish processing before its turn starts\n * (`waiting.documents`, from `step_waiting` and then `step_progress` as the set shrinks); none for\n * any other step. Action steps wait on people, not documents.\n */\nexport function waitingDocuments(state: WorkflowStepState | undefined): string[] {\n return state?.status === 'waiting' ? (asStrings(state.waiting?.documents) ?? []) : []\n}\n\n/** The documents a `step_waiting` / `step_progress` event names, if it names any. */\nexport function eventWaitingDocuments(detail: Record<string, unknown> | null | undefined) {\n return asStrings(asRecord(detail?.waiting)?.documents)\n}\n\n/** \"Waiting for 3 documents to finish processing\" (one: \"1 document\"). */\nexport function waitingForDocumentsText(count: number): string {\n return `Waiting for ${count} ${count === 1 ? 'document' : 'documents'} to finish processing`\n}\n\n/** The steps a `step_sent_back` reopens: its `reopened` list, else the one it went `to`. */\nfunction reopenedBy(detail: Record<string, unknown>): string[] {\n const to = str(detail.to)\n return asStrings(detail.reopened) ?? (to ? [to] : [])\n}\n\n/**\n * Each step's state from the thread's activity log (oldest first): its latest step event wins.\n * A send-back reopens the steps it lists as pending (only the one it went `to` is `sentBack`); a\n * `step_ready` records who was told and a `step_progress` what a waiting step now waits on, until\n * the step's next change. Mirrors the server (`workflow_steps.progress`).\n */\nexport function stepStatesFromActivity(\n events: WorkflowActivityEvent[]\n): Record<string, WorkflowStepState> {\n const states: Record<string, WorkflowStepState> = {}\n for (const e of events) {\n const detail = e.detail ?? {}\n const step = str(detail.step)\n if (!step) continue\n if (e.kind === 'step_sent_back') {\n const to = str(detail.to)\n for (const id of reopenedBy(detail))\n states[id] =\n id === to\n ? {\n status: 'pending',\n sentBack: true,\n hasNote: typeof detail.note_encrypted === 'string',\n }\n : { status: 'pending' }\n continue\n }\n if (e.kind === 'step_ready') {\n states[step] = { ...(states[step] ?? { status: 'pending' }), announcedTo: str(detail.to) }\n continue\n }\n if (e.kind === 'step_progress') {\n const before = states[step]\n const waiting = asRecord(detail.waiting)\n if (before?.status === 'waiting' && waiting) states[step] = { ...before, waiting }\n continue\n }\n const status = STEP_EVENTS[e.kind]\n if (!status) continue\n const before = states[step]\n const responseId = str(detail.response_id) ?? before?.responseId ?? null\n const startedAt = status === 'running' ? e.created_at : before?.startedAt\n const action = asAction(detail.action) ?? before?.action\n const documents = asStrings(detail.documents) ?? before?.documents\n const waiting = status === 'waiting' ? asRecord(detail.waiting) : undefined\n const output = status === 'done' ? asRecord(detail.output) : undefined\n const approved = Array.isArray(detail.approved)\n ? (detail.approved.filter(asRecord) as WorkflowStepState['approved'])\n : undefined\n const finished = status === 'done' || status === 'skipped' || status === 'failed'\n const declinedBy = str(detail.declined_by)\n // Skipped while it stood failed: what waits for it goes on without its result, and says so.\n const afterFailure =\n status === 'skipped' && (before?.status === 'failed' || !!before?.skippedAfterFailure)\n states[step] = {\n status,\n responseId,\n error: str(detail.error) ?? (afterFailure ? (before?.error ?? null) : null),\n ...(afterFailure ? { skippedAfterFailure: true } : {}),\n ...(startedAt ? { startedAt } : {}),\n ...(action ? { action } : {}),\n ...(documents?.length ? { documents } : {}),\n ...(waiting ? { waiting } : {}),\n ...(output ? { output } : {}),\n ...(approved ? { approved } : {}),\n ...(finished ? { by: e.actor_ext_id ?? null } : {}),\n ...(finished && e.created_at ? { at: e.created_at } : {}),\n ...(declinedBy ? { declinedBy } : {}),\n }\n }\n return states\n}\n\n/** The fields a person fills in on a step: a form's inputs, a review's fields. */\nexport function stepFields(step: WorkflowStep): WorkflowField[] {\n return step.kind === 'form' ? step.inputs : step.kind === 'review' ? (step.fields ?? []) : []\n}\n\n/** The fields the steps ask for (forms and reviews), in plan order. */\nexport const runFieldsOf = (steps: WorkflowStep[]): WorkflowField[] => steps.flatMap(stepFields)\n\n/** Every field the run asks for: the launch form's, then each form's and review's. */\nexport function runFields(workflow: WorkflowDefinition): WorkflowField[] {\n return [...workflow.inputs, ...workflowSteps(workflow).flatMap(stepFields)]\n}\n\n/** A fresh run's inputs: every field at its default, then the prefills. */\nexport function initialRunInputs(\n workflow: WorkflowDefinition,\n inputs: WorkflowInputs = {}\n): WorkflowInputs {\n return { ...defaultInputs({ ...workflow, inputs: runFields(workflow) }), ...inputs }\n}\n\nconst finished = (s: WorkflowStepState | undefined): boolean =>\n s?.status === 'done' || s?.status === 'skipped'\n\n/**\n * Where a step stands: `blocked` until everything it waits for has finished (done or skipped),\n * then `ready`, then its own status (`waiting`: an action step waiting on its people).\n */\nexport type WorkflowStepPhase =\n 'blocked' | 'ready' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed'\n\nexport function stepPhase(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n id: string\n): WorkflowStepPhase {\n const s = states[id]\n if (s && s.status !== 'pending') return s.status\n return stepDependencies(steps, id).every((d) => finished(states[d])) ? 'ready' : 'blocked'\n}\n\nexport const isRunFinished = (\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>\n): boolean => steps.length > 0 && steps.every((s) => finished(states[s.id]))\n\n/** A step a person does (form, upload, review); agent and action steps start by themselves. */\nexport const isPersonStep = (step: WorkflowStep): boolean =>\n step.kind !== 'agent' && step.kind !== 'action'\n\n/** An action step whose waiting phase is a person's: signing, sending the email. */\nexport const isPersonAction = (step: WorkflowStep): step is WorkflowActionStep =>\n step.kind === 'action' && (step.action.type === 'sign' || step.action.type === 'email_draft')\n\n/** A step that can have an assignee and a reminder: a person step, or a signature or email. */\nexport const canAssign = (step: WorkflowStep): boolean => isPersonStep(step) || isPersonAction(step)\n\n/**\n * What the primary button does on the step in view:\n * - `complete`: finish this form, upload or review (approve) and move on;\n * - `move`: view the next step: this one is finished, or the next does not wait for it;\n * - `start`: start this agent or action step: it is ready but no run is under way to start it\n * (the run has no thread yet, or the server could not start it);\n * - `retry`: run this failed step again (what waits for it needs its result; skipping it is the\n * person's explicit choice, never the primary button);\n * - `finish`: show the completion (every step has finished);\n * - `wait`: nothing yet (this step is under way and the next waits for it, or it is blocked).\n */\nexport type WorkflowNextAction = 'complete' | 'move' | 'start' | 'retry' | 'finish' | 'wait'\n\nexport interface NextActionOptions {\n /**\n * No run is under way to start a ready agent or action step: the run's thread does not exist\n * yet (a run whose first open step is an agent step), or the server is not running it.\n */\n needsStart?: boolean\n /** The host can run a failed step again. */\n canRetry?: boolean\n}\n\nexport function nextAction(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n current: string | null,\n { needsStart = false, canRetry = false }: NextActionOptions = {}\n): WorkflowNextAction {\n const i = steps.findIndex((s) => s.id === current)\n const step = steps[i]\n if (!step) return 'wait'\n const phase = stepPhase(steps, states, step.id)\n if (phase === 'blocked') return 'wait'\n const following = steps[i + 1]\n const independentNext = !!following && !dependsOn(steps, following.id, step.id)\n if (phase === 'done' || phase === 'skipped') {\n if (following) return 'move'\n return isRunFinished(steps, states) ? 'finish' : 'wait'\n }\n if (isPersonStep(step)) return 'complete'\n // An email draft is done when its person says it is sent; a signature, when its signers sign.\n if (phase === 'waiting' && step.kind === 'action' && step.action.type === 'email_draft')\n return 'complete'\n // Ready, but nothing will start it unless the person does (no thread yet, or no run under way).\n if (phase === 'ready' && needsStart) return 'start'\n // An agent step on its way (about to start, or running): look ahead if nothing there waits for it.\n if (phase !== 'failed') return independentNext ? 'move' : 'wait'\n // A failed step is never passed over by the primary button: what waits for it needs its result.\n // Retry it; skipping it anyway is a separate, explicit choice.\n const waitedFor = steps.slice(i + 1).some((s) => dependsOn(steps, s.id, step.id))\n if (!waitedFor && following) return 'move'\n return canRetry ? 'retry' : 'wait'\n}\n\n/**\n * The steps `id` waits for (directly or through others) that failed: still failed (so `id` is\n * blocked until they are retried), or skipped after failing (so `id` goes on without their\n * result). In plan order.\n */\nexport function failedUpstream(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n id: string\n): Array<{ step: WorkflowStep; state: WorkflowStepState }> {\n return upstreamSteps(steps, id).flatMap((s) => {\n const state = states[s.id]\n return state && (state.status === 'failed' || state.skippedAfterFailure)\n ? [{ step: s, state }]\n : []\n })\n}\n\n/** A form's or a fielded review's problems (empty = it can move on); other steps have none. */\nexport function validateStep(step: WorkflowStep, inputs: WorkflowInputs): WorkflowErrors {\n const fields = stepFields(step)\n if (!fields.length) return {}\n return validateInputs(\n {\n id: step.id,\n title: step.title,\n description: '',\n inputs: fields,\n run: { kind: 'operation' },\n landing: 'chat',\n },\n inputs\n )\n}\n\n/* --------------------------- people and documents --------------------------- */\n\n/** Every step `id` waits for, directly or through others, in plan order. */\nexport function upstreamSteps(steps: WorkflowStep[], id: string): WorkflowStep[] {\n return steps.filter((s) => s.id !== id && dependsOn(steps, id, s.id))\n}\n\n/**\n * Where a ready step can send the work back to: an earlier step it waits for that has something\n * to redo (done, skipped or failed), nearest first.\n */\nexport function sendBackTargets(\n steps: WorkflowStep[],\n states: Record<string, WorkflowStepState>,\n id: string\n): WorkflowStep[] {\n return upstreamSteps(steps, id)\n .filter((s) => ['done', 'skipped', 'failed'].includes(states[s.id]?.status ?? 'pending'))\n .reverse()\n}\n\n/** Something a step still needs before it can run, for the builder to point out. */\nexport interface WorkflowStepProblem {\n step: string\n missing:\n 'document' | 'signers' | 'recipients' | 'tags' | 'documents' | 'database' | 'decision' | 'name'\n}\n\nconst isBlankRef = (ref: WorkflowDocumentRef): boolean =>\n 'step' in ref ? !ref.step : 'input' in ref ? !ref.input : !ref.id.trim()\n\n/** What the steps still need before they can run: an action's document, signers, \u2026 */\nexport function stepConfigProblems(steps: WorkflowStep[]): WorkflowStepProblem[] {\n const out: WorkflowStepProblem[] = []\n for (const s of steps) {\n if (s.kind === 'action') {\n const a = s.action\n if (a.type === 'sign') {\n if (!a.document || isBlankRef(a.document)) out.push({ step: s.id, missing: 'document' })\n if (!a.signers.length) out.push({ step: s.id, missing: 'signers' })\n } else if (a.type === 'email_draft') {\n if (!a.to.some((t) => t.trim())) out.push({ step: s.id, missing: 'recipients' })\n } else if (a.type === 'approval') {\n if (!a.database.trim()) out.push({ step: s.id, missing: 'database' })\n if (!a.decision.trim()) out.push({ step: s.id, missing: 'decision' })\n } else if (a.type === 'create_project') {\n if (!a.name.trim()) out.push({ step: s.id, missing: 'name' })\n } else {\n if (!a.tags.length) out.push({ step: s.id, missing: 'tags' })\n if (Array.isArray(a.documents) && !a.documents.length)\n out.push({ step: s.id, missing: 'documents' })\n }\n }\n if (s.kind === 'agent' && s.editDocument && isBlankRef(s.editDocument))\n out.push({ step: s.id, missing: 'document' })\n }\n return out\n}\n\n/** A document version id (`doc-\u2026@v3`) split into the document and its version. */\nexport function splitDocRef(ref: string): { id: string; version?: number } {\n const m = /^(doc-[A-Za-z0-9]+)(?:@v(\\d+))?$/.exec(ref)\n return m ? { id: m[1], ...(m[2] ? { version: Number(m[2]) } : {}) } : { id: ref }\n}\n\n/** How an assignee that names no one directly is described. */\nexport interface AssigneeWording {\n runOwner: string\n projectLead: string\n /** `{field}`: the person field's label. */\n input: string\n}\n\nexport const DEFAULT_ASSIGNEE_WORDING: AssigneeWording = {\n runOwner: 'whoever started the run',\n projectLead: 'the project lead',\n input: 'the person in \u201C{field}\u201D',\n}\n\n/**\n * Who a step is for, in words: the person it was announced to, the member it names, the person a\n * form field holds (each through `nameOf`), else its role. Undefined when it names no one.\n */\nexport function assigneeName(\n assignee: WorkflowAssignee | undefined,\n options: {\n nameOf?: (id: string) => string | undefined\n inputs?: WorkflowInputs\n fields?: WorkflowField[]\n /** Who the server told (the assignee resolved): wins over a role. */\n announcedTo?: string | null\n wording?: Partial<AssigneeWording>\n } = {}\n): string | undefined {\n const w = { ...DEFAULT_ASSIGNEE_WORDING, ...options.wording }\n const name = (id: string) => options.nameOf?.(id) ?? id\n const told = options.announcedTo ? options.nameOf?.(options.announcedTo) : undefined\n if (told) return told\n if (!assignee) return undefined\n if ('user' in assignee) return name(assignee.user)\n if ('input' in assignee) {\n const value = options.inputs?.[assignee.input]\n if (typeof value === 'string' && value) return name(value)\n const label = options.fields?.find((f) => f.name === assignee.input)?.label ?? assignee.input\n return w.input.replace('{field}', label)\n }\n if ('runOwner' in assignee) return w.runOwner\n return w.projectLead\n}\n\n/* ----------------------------- composing ----------------------------- */\n\nconst asText = (value: WorkflowInputValue | undefined): string =>\n typeof value === 'string' ? value.trim() : typeof value === 'number' ? String(value) : ''\n\n/**\n * Fill a step's `with` templates from the run's inputs: `{{a}}`, `{{a || b}}` (first non-blank).\n * A template that is exactly one bare reference passes the value through untouched.\n */\nexport function fillStepInputs(\n templates: Record<string, string> | undefined,\n inputs: WorkflowInputs\n): WorkflowInputs {\n const out: WorkflowInputs = {}\n for (const [name, template] of Object.entries(templates ?? {})) {\n const bare = /^\\{\\{\\s*([a-z][a-z0-9_]*)\\s*\\}\\}$/i.exec(template)\n if (bare) {\n out[name] = inputs[bare[1]] ?? ''\n continue\n }\n out[name] = fillRunText(template, inputs)\n }\n return out\n}\n\n/** A template over the run's inputs, as text (`{{a}}`, `{{a || b}}`). */\nexport function fillRunText(template: string, inputs: WorkflowInputs): string {\n return template\n .replace(/\\{\\{([^}]*)\\}\\}/g, (_, expr: string) => {\n for (const ref of expr.split('||')) {\n const text = asText(inputs[ref.trim()])\n if (text) return text\n }\n return ''\n })\n .trim()\n}\n\n/** The run thread's title: the workflow's `threadTitle` template, else its title. */\nexport function runThreadTitle(workflow: WorkflowDefinition, inputs: WorkflowInputs): string {\n const template = workflow.run.kind === 'steps' ? workflow.run.threadTitle : undefined\n return (template && fillRunText(template, inputs)) || workflow.title\n}\n\n/** What a review asks for: its instructions filled from the run, else its title. */\nexport function reviewInstructions(step: WorkflowReviewStep, inputs: WorkflowInputs): string {\n return (step.instructions && fillRunText(step.instructions, inputs)) || step.title\n}\n\nexport interface StepComposeOptions {\n /** Looks up the workflow a step names (`step.workflow`). */\n resolveWorkflow?: (id: string) => WorkflowDefinition | undefined\n /**\n * The host's wording for `operation` runs: the named workflow's id (or the step's own id when it\n * runs inline), its filled inputs, and the whole run's inputs (e.g. to ground it in the record).\n */\n compose?: (id: string, inputs: WorkflowInputs, runInputs: WorkflowInputs) => string | undefined\n}\n\n/** The prompt an agent step of `workflow` sends; '' when nothing could compose it (no binding). */\nexport function composeStepPrompt(\n workflow: WorkflowDefinition,\n step: WorkflowAgentStep,\n runInputs: WorkflowInputs,\n { resolveWorkflow, compose }: StepComposeOptions = {}\n): string {\n if (step.workflow) {\n const target = resolveWorkflow?.(step.workflow)\n if (!target) return ''\n const inputs = { ...defaultInputs(target), ...fillStepInputs(step.with, runInputs) }\n return target.run.kind === 'prompt'\n ? composeWorkflowPrompt(target, inputs)\n : (compose?.(target.id, inputs, runInputs) ?? '')\n }\n if (step.run?.kind === 'prompt') {\n return composeWorkflowPrompt(\n { ...workflow, inputs: runFields(workflow), run: step.run },\n runInputs\n )\n }\n return compose?.(step.id, runInputs, runInputs) ?? ''\n}\n"],
5
+ "mappings": ";AAuBA,SAAS,uBAAuB,eAAe,sBAAsB;AAG9D,SAAS,cAAc,UAA8C;AAC1E,SAAO,SAAS,IAAI,SAAS,UAAU,SAA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,SAAO,UAAU,KAAK,IAAI,WAAW,SAAS,KAAK;AACrD;",
6
6
  "names": ["before", "waiting", "finished"]
7
7
  }
@@ -6,8 +6,11 @@
6
6
  */
7
7
  import type { WorkflowStep } from './types';
8
8
  /** Each kind of step, with each platform action (an `action` step) as a kind of its own. */
9
- export type WorkflowStepKind = 'form' | 'upload' | 'agent' | 'review' | 'sign' | 'email_draft' | 'tabular_review' | 'approval';
10
- /** Every kind, in the order the add menus list them. */
9
+ export type WorkflowStepKind = 'form' | 'upload' | 'agent' | 'review' | 'sign' | 'email_draft' | 'tabular_review' | 'approval' | 'create_project';
10
+ /**
11
+ * Every kind the builder's add menus offer, in their order. A host's own step kinds it writes in
12
+ * code (`create_project`: open the run's project on the server) are shown, not offered here.
13
+ */
11
14
  export declare const WORKFLOW_STEP_KINDS: readonly WorkflowStepKind[];
12
15
  /** A step's kind: an action step is its action's type. */
13
16
  export declare const stepKindOf: (step: WorkflowStep) => WorkflowStepKind;
@@ -20,6 +23,7 @@ export declare const STEP_KIND_ICONS: {
20
23
  readonly email_draft: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
21
24
  readonly tabular_review: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
22
25
  readonly approval: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
26
+ readonly create_project: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
23
27
  };
24
28
  /** Each kind's name, as the canvas cards and the thread bar label a step. */
25
29
  export declare const DEFAULT_STEP_KIND_LABELS: Record<WorkflowStepKind, string>;
@@ -1,5 +1,15 @@
1
1
  "use client";
2
- import { Bot, ClipboardCheck, FileInput, Mail, PenLine, Stamp, Table2, Upload } from "lucide-react";
2
+ import {
3
+ Bot,
4
+ ClipboardCheck,
5
+ FileInput,
6
+ FolderPlus,
7
+ Mail,
8
+ PenLine,
9
+ Stamp,
10
+ Table2,
11
+ Upload
12
+ } from "lucide-react";
3
13
  const WORKFLOW_STEP_KINDS = [
4
14
  "form",
5
15
  "upload",
@@ -19,7 +29,8 @@ const STEP_KIND_ICONS = {
19
29
  sign: PenLine,
20
30
  email_draft: Mail,
21
31
  tabular_review: Table2,
22
- approval: Stamp
32
+ approval: Stamp,
33
+ create_project: FolderPlus
23
34
  };
24
35
  const DEFAULT_STEP_KIND_LABELS = {
25
36
  form: "Form",
@@ -29,7 +40,8 @@ const DEFAULT_STEP_KIND_LABELS = {
29
40
  sign: "Sign",
30
41
  email_draft: "Email draft",
31
42
  tabular_review: "Tabular review",
32
- approval: "Request approval"
43
+ approval: "Request approval",
44
+ create_project: "Open a project"
33
45
  };
34
46
  export {
35
47
  DEFAULT_STEP_KIND_LABELS,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/agents/workflows/stepKinds.ts"],
4
- "sourcesContent": ["/**\n * The kinds of step, as every view of a workflow shows them: the builder's canvas, the runner's\n * stepper, a thread's top bar and the threads list. Each kind has one icon here and one colour in\n * `blocks.css` (`.wf-kind-<kind>`, on the `--wf-*` variables), so a step looks the same wherever\n * it appears.\n */\n\nimport { Bot, ClipboardCheck, FileInput, Mail, PenLine, Stamp, Table2, Upload } from 'lucide-react'\nimport type { WorkflowStep } from './types'\n\n/** Each kind of step, with each platform action (an `action` step) as a kind of its own. */\nexport type WorkflowStepKind =\n 'form' | 'upload' | 'agent' | 'review' | 'sign' | 'email_draft' | 'tabular_review' | 'approval'\n\n/** Every kind, in the order the add menus list them. */\nexport const WORKFLOW_STEP_KINDS: readonly WorkflowStepKind[] = [\n 'form',\n 'upload',\n 'agent',\n 'review',\n 'sign',\n 'email_draft',\n 'tabular_review',\n 'approval',\n]\n\n/** A step's kind: an action step is its action's type. */\nexport const stepKindOf = (step: WorkflowStep): WorkflowStepKind =>\n step.kind === 'action' ? step.action.type : step.kind\n\nexport const STEP_KIND_ICONS = {\n form: FileInput,\n upload: Upload,\n agent: Bot,\n review: ClipboardCheck,\n sign: PenLine,\n email_draft: Mail,\n tabular_review: Table2,\n approval: Stamp,\n} as const\n\n/** Each kind's name, as the canvas cards and the thread bar label a step. */\nexport const DEFAULT_STEP_KIND_LABELS: Record<WorkflowStepKind, string> = {\n form: 'Form',\n upload: 'Upload',\n agent: 'AI step',\n review: 'Approval',\n sign: 'Sign',\n email_draft: 'Email draft',\n tabular_review: 'Tabular review',\n approval: 'Request approval',\n}\n"],
5
- "mappings": ";AAOA,SAAS,KAAK,gBAAgB,WAAW,MAAM,SAAS,OAAO,QAAQ,cAAc;AAQ9E,MAAM,sBAAmD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,aAAa,CAAC,SACzB,KAAK,SAAS,WAAW,KAAK,OAAO,OAAO,KAAK;AAE5C,MAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,UAAU;AACZ;AAGO,MAAM,2BAA6D;AAAA,EACxE,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,UAAU;AACZ;",
4
+ "sourcesContent": ["/**\n * The kinds of step, as every view of a workflow shows them: the builder's canvas, the runner's\n * stepper, a thread's top bar and the threads list. Each kind has one icon here and one colour in\n * `blocks.css` (`.wf-kind-<kind>`, on the `--wf-*` variables), so a step looks the same wherever\n * it appears.\n */\n\nimport {\n Bot,\n ClipboardCheck,\n FileInput,\n FolderPlus,\n Mail,\n PenLine,\n Stamp,\n Table2,\n Upload,\n} from 'lucide-react'\nimport type { WorkflowStep } from './types'\n\n/** Each kind of step, with each platform action (an `action` step) as a kind of its own. */\nexport type WorkflowStepKind =\n | 'form'\n | 'upload'\n | 'agent'\n | 'review'\n | 'sign'\n | 'email_draft'\n | 'tabular_review'\n | 'approval'\n | 'create_project'\n\n/**\n * Every kind the builder's add menus offer, in their order. A host's own step kinds it writes in\n * code (`create_project`: open the run's project on the server) are shown, not offered here.\n */\nexport const WORKFLOW_STEP_KINDS: readonly WorkflowStepKind[] = [\n 'form',\n 'upload',\n 'agent',\n 'review',\n 'sign',\n 'email_draft',\n 'tabular_review',\n 'approval',\n]\n\n/** A step's kind: an action step is its action's type. */\nexport const stepKindOf = (step: WorkflowStep): WorkflowStepKind =>\n step.kind === 'action' ? step.action.type : step.kind\n\nexport const STEP_KIND_ICONS = {\n form: FileInput,\n upload: Upload,\n agent: Bot,\n review: ClipboardCheck,\n sign: PenLine,\n email_draft: Mail,\n tabular_review: Table2,\n approval: Stamp,\n create_project: FolderPlus,\n} as const\n\n/** Each kind's name, as the canvas cards and the thread bar label a step. */\nexport const DEFAULT_STEP_KIND_LABELS: Record<WorkflowStepKind, string> = {\n form: 'Form',\n upload: 'Upload',\n agent: 'AI step',\n review: 'Approval',\n sign: 'Sign',\n email_draft: 'Email draft',\n tabular_review: 'Tabular review',\n approval: 'Request approval',\n create_project: 'Open a project',\n}\n"],
5
+ "mappings": ";AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAmBA,MAAM,sBAAmD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,aAAa,CAAC,SACzB,KAAK,SAAS,WAAW,KAAK,OAAO,OAAO,KAAK;AAE5C,MAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,gBAAgB;AAClB;AAGO,MAAM,2BAA6D;AAAA,EACxE,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,gBAAgB;AAClB;",
6
6
  "names": []
7
7
  }
@@ -235,7 +235,32 @@ export interface WorkflowApprovalAction {
235
235
  /** Where Sent back returns the work: a step this one waits on (default: the step just before it). */
236
236
  sendBackTo?: string;
237
237
  }
238
- export type WorkflowAction = WorkflowSignAction | WorkflowEmailDraftAction | WorkflowTabularReviewAction | WorkflowApprovalAction;
238
+ /**
239
+ * Open a project (the host's word: a matter, a case…) on the server as soon as the step is ready,
240
+ * wherever the step before it was completed: its details are templates over the run
241
+ * (`{{client}}`), a detail that fills blank is left out, and with `workspace` (default) its first
242
+ * workspace is made too. The step is done with the project's id (`{{<step>.project_ext_id}}`) and
243
+ * its workspace's (`{{<step>.workspace_ext_id}}`).
244
+ */
245
+ export interface WorkflowCreateProjectAction {
246
+ type: 'create_project';
247
+ name: string;
248
+ client?: string;
249
+ clientRef?: string;
250
+ stage?: string;
251
+ /** A person (`usr-…`), e.g. `{{partner}}`. */
252
+ leadUser?: string;
253
+ /** Host-defined project fields: key → template. */
254
+ fields?: Record<string, string>;
255
+ /** `amount` is a template giving the amount in major units (pounds). */
256
+ budget?: {
257
+ amount: string;
258
+ currency?: string;
259
+ };
260
+ workspace?: boolean;
261
+ workspaceDescription?: string;
262
+ }
263
+ export type WorkflowAction = WorkflowSignAction | WorkflowEmailDraftAction | WorkflowTabularReviewAction | WorkflowApprovalAction | WorkflowCreateProjectAction;
239
264
  export type WorkflowActionType = WorkflowAction['type'];
240
265
  /** Ask for inputs. Every step's fields share the run's one input namespace (`{{name}}`). */
241
266
  export interface WorkflowFormStep extends WorkflowStepBase {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/agents/workflows/types.ts"],
4
- "sourcesContent": ["/**\n * The one workflow model: a skill with a declared input schema. Everything launchable (a quick\n * action, a slash skill, a task body, an agent's job) is a `WorkflowDefinition`.\n *\n * The shape maps 1:1 onto future SKILL.md frontmatter (`inputs:` etc., snake_case on disk; see\n * `workflowFromFrontmatter`), so the backend can adopt it without a UI change. Blocks hold no\n * domain wording: titles, labels and prompt text are data supplied by the host.\n */\n\nimport type { Tone } from '../../components/tones'\n\nexport type WorkflowFieldType =\n | 'text'\n | 'longtext'\n | 'boolean'\n | 'select'\n | 'number'\n | 'date'\n | 'scope'\n | 'documents'\n /** A workspace member (`usr-\u2026` / `agt-\u2026`): what a step's assignee or a signer can name. */\n | 'person'\n\n/**\n * What a launching surface can hand a workflow without asking the user: the files it is looking at\n * (`documents`), the text the user selected (`selection`), or the image on screen (`image`, a file\n * id). A field binds to one with `context`; a surface offers a workflow when it can supply one of\n * the kinds the workflow declares (`workflowAccepts`).\n */\nexport type WorkflowContextKind = 'documents' | 'selection' | 'image'\n\n/** Where the user ends up after launching. `current-chat` sends into the chat already on screen. */\nexport type WorkflowLanding = 'chat' | 'current-chat' | 'files'\n\n/** Which files a run is limited to. Empty folders and labels = every file. */\nexport interface WorkflowScope {\n /** Folder paths; `''` is the unfiled bucket. */\n folders: string[]\n /** Label (tag) ids. */\n labels: string[]\n /** Exactly these files (ids). When present it wins over folders and labels: a `documents` field or a context launch. */\n documents?: string[]\n}\n\nexport const EMPTY_WORKFLOW_SCOPE: WorkflowScope = { folders: [], labels: [] }\n\nexport type WorkflowInputValue = string | number | boolean | WorkflowScope\n\nexport interface WorkflowFieldOption {\n value: string\n label: string\n description?: string\n /** Prompt fragment substituted for `{{name}}` when chosen (falls back to the label). */\n text?: string\n /** Key into the host's icon map. */\n icon?: string\n /**\n * Colours the option's choice tile (e.g. a risk rating: low `success`, medium `warning`, high\n * `danger`), chosen or not. The label always shows, so the tone is never the only cue.\n */\n tone?: Tone\n}\n\nexport interface WorkflowField {\n /** Key in `inputs`; also the `{{placeholder}}` in the prompt template. */\n name: string\n type: WorkflowFieldType\n label: string\n description?: string\n placeholder?: string\n required?: boolean\n default?: WorkflowInputValue\n /** `select` only. */\n options?: WorkflowFieldOption[]\n /** `number` only. */\n min?: number\n max?: number\n /** `boolean`: prompt fragments substituted for `{{name}}`. */\n trueText?: string\n falseText?: string\n /** Fold behind a disclosure: advanced wording the common run does not need. */\n advanced?: boolean\n /** `scope` only: which dimensions are offered. Default both. */\n by?: Array<'folders' | 'labels'>\n /** `documents` only: what kind of file is offered; `max` is how many may be picked (default 1). */\n accept?: 'image'\n /** Prefilled by a launching surface that supplies this kind of context (see `WorkflowContextKind`). */\n context?: WorkflowContextKind\n}\n\nexport type WorkflowRun =\n /** Compose a message from `promptTemplate` and send it. */\n | { kind: 'prompt'; promptTemplate: string }\n /** The host performs it (bound by workflow id), e.g. create a label then generate. */\n | { kind: 'operation' }\n /**\n * A guided run of named steps that form a graph. A run is a work thread on the server: the\n * thread's plan carries the steps (`toPlanSteps`), its activity log records each step's progress,\n * and the work runner starts each agent step as a turn in the thread. A person does the form,\n * upload and review steps (`useWorkflowThread` / `WorkflowRunner`). Not schedulable from a single\n * form: a workflow (automation) carries the steps and its trigger (`WorkflowBuilder`).\n */\n | {\n kind: 'steps'\n /** The run thread's title, a template over the run's inputs; defaults to the workflow's. */\n threadTitle?: string\n /** In dependency order: a step only waits for steps listed before it (`orderSteps`). */\n steps: WorkflowStep[]\n completion?: WorkflowCompletion\n /** Where each step sits on the builder's canvas, by step id. */\n layout?: Record<string, { x: number; y: number }>\n }\n\n/* ------------------------------- steps ------------------------------- */\n\n/**\n * When a step's signal is raised, tested against the step's outcome once it is done (a skipped or\n * failed step never signals): a form field equals a value (case-insensitive text), the agent's\n * answer contains a phrase or matches a regex, or a review is approved. Absent = whenever it is done.\n */\nexport type WorkflowSignalWhen =\n | { field: string; equals: string | number | boolean }\n | { contains: string }\n | { matches: string }\n | { approved: true }\n\n/**\n * A named signal a step raises when it is done and its condition holds. Another workflow starts on\n * it (\"When a step signals\") as its own thread linked to this one, so the if/then between\n * workflows lives in the link and each workflow stays short.\n */\nexport interface WorkflowSignal {\n /** A slug (`[a-z0-9][a-z0-9_.-]*`), e.g. `risk-high`: what a linked workflow listens for. */\n name: string\n when?: WorkflowSignalWhen\n}\n\ninterface WorkflowStepBase {\n /** Unique within the workflow (`[a-z][a-z0-9_-]*`): the thread's progress is keyed by it. */\n id: string\n /** The step's name: the stepper and the thread's top bar show it. */\n title: string\n /** One line under the step's heading. */\n description?: string\n /** Key into the host's icon map. */\n icon?: string\n /**\n * The host commits this step before the run moves on (`commit[id]`), e.g. creates the record\n * later steps work in. Once committed the step's inputs are locked.\n */\n commit?: boolean\n /** Primary button text while on this step (until it is committed); defaults to \"Continue\". */\n nextLabel?: string\n /**\n * The steps this one waits for. Absent: the step before it in the list, so a plain list is a\n * sequence. `[]`: it starts with the run. A step waiting for several waits for them all.\n */\n after?: string[]\n /** Signals the step raises when it is done and their condition holds. */\n signals?: WorkflowSignal[]\n /**\n * Who the step is for (a person step, or a signature or email step): they are told when it is\n * ready, and only they (or the run's owner) can do it. Absent: whoever is on the run.\n */\n assignee?: WorkflowAssignee\n /** A person step left this many hours is announced again (once). */\n remindAfterHours?: number\n}\n\n/**\n * Who a step is for: a named member (`usr-\u2026` / `agt-\u2026`), whoever started the run, the person a\n * form's `person` field names (`input`: its name), or the project's lead.\n */\nexport type WorkflowAssignee =\n { user: string } | { runOwner: true } | { input: string } | { projectLead: true }\n\n/**\n * A document a step works on, named by where it comes from: what an earlier step produced or was\n * given (an upload's files, an agent's draft, a signed copy, an edited version), what a run input\n * names (a document pick), or one document by id (`doc-\u2026`, optionally `@v<n>`).\n */\nexport type WorkflowDocumentRef = { step: string } | { input: string } | { id: string }\n\n/** Ask people to e-sign a document. The step waits until every signer has signed. */\nexport interface WorkflowSignAction {\n type: 'sign'\n document?: WorkflowDocumentRef\n signers: WorkflowAssignee[]\n /** Shown to the signers. */\n message?: string\n /** Unsigned this long after it starts, the step fails. */\n expiresAfterHours?: number\n}\n\n/**\n * Prepare an email in native mail, never sent by itself: its person sends it, and the step is done\n * when they say so (or send it). Every text is a template over the run (`{{field}}`,\n * `{{step.answer}}`).\n */\nexport interface WorkflowEmailDraftAction {\n type: 'email_draft'\n to: string[]\n cc?: string[]\n subject: string\n body: string\n attachments?: WorkflowDocumentRef[]\n}\n\n/** Run review columns (labels with instructions) over documents, then open the grid. */\nexport interface WorkflowTabularReviewAction {\n type: 'tabular_review'\n /** Label (tag) ids: the columns. */\n tags: string[]\n /** Every file the run's uploads took, every document of the workspace, or these documents. */\n documents: 'run_uploads' | 'workspace' | WorkflowDocumentRef[]\n /** Fill cells that already have a value again. */\n overwrite?: boolean\n}\n\n/**\n * Submit a request for approval as a row of a database: the step writes the row (shared, linked to\n * the run) with `values` filled from the run, then waits until one of the people its `decision`\n * column lists (that column's edit rule) sets the decision on the row. `approve` finishes the step,\n * `sendBack` reopens the step it waits for (resubmitting updates the same row), `reject` fails it.\n */\nexport interface WorkflowApprovalAction {\n type: 'approval'\n /** The requests database (`dbs-\u2026`, this workspace). */\n database: string\n /** Its decision column (id or name): a column only the listed approvers may set. */\n decision: string\n /** Column (id or name) \u2192 template over the run (`{{client}}`). */\n values?: Record<string, string>\n /** The decision words (default Approved / Sent back / Rejected), matched case-insensitively. */\n approve?: string\n sendBack?: string\n reject?: string\n /** Where Sent back returns the work: a step this one waits on (default: the step just before it). */\n sendBackTo?: string\n}\n\nexport type WorkflowAction =\n | WorkflowSignAction\n | WorkflowEmailDraftAction\n | WorkflowTabularReviewAction\n | WorkflowApprovalAction\nexport type WorkflowActionType = WorkflowAction['type']\n\n/** Ask for inputs. Every step's fields share the run's one input namespace (`{{name}}`). */\nexport interface WorkflowFormStep extends WorkflowStepBase {\n kind: 'form'\n inputs: WorkflowField[]\n}\n\n/** Add files to the run's workspace. Skippable unless `required`. */\nexport interface WorkflowUploadStep extends WorkflowStepBase {\n kind: 'upload'\n required?: boolean\n /** `accept` of the file picker, e.g. `.pdf,.docx`. */\n accept?: string\n /** Small muted line under the drop target. */\n hint?: string\n}\n\n/**\n * A turn the assistant takes in the run's thread. It runs a skill or another workflow\n * (`workflow`, its inputs filled from `with`) or its own `run`. It continues the thread's main\n * line, so it sees everything before it; a `branch` step runs off the main line instead and\n * delivers only its result back to it.\n */\nexport interface WorkflowAgentStep extends WorkflowStepBase {\n kind: 'agent'\n /** Id of the skill or workflow this step runs; its inputs come from `with`. */\n workflow?: string\n /**\n * The named workflow's inputs, each a template over the run's inputs: `{{client}}`, with\n * `{{a || b}}` falling back to `b` when `a` is blank. A bare `{{name}}` passes the value as is.\n */\n with?: Record<string, string>\n /** Used when no `workflow` is named. `operation`: the host composes the prompt (`compose`). */\n run?: Extract<WorkflowRun, { kind: 'prompt' } | { kind: 'operation' }>\n /** What the step shows: the answer (default) or the drafted document. */\n output?: 'answer' | 'artifact'\n /** Runs off the thread's main line and delivers only its result to it. */\n branch?: boolean\n /**\n * Edit this Word document with tracked changes (the instruction says what to change); the\n * edited copy is its next version, to accept or reject change by change. Main line only.\n */\n editDocument?: WorkflowDocumentRef\n}\n\n/** A person's review or approval: whoever completes it on the thread approves it. */\nexport interface WorkflowReviewStep extends WorkflowStepBase {\n kind: 'review'\n /** What to review, a template over the run's inputs. */\n instructions?: string\n /** What the approver fills in when approving (e.g. a rating): they join the run's inputs. */\n fields?: WorkflowField[]\n}\n\n/**\n * A step that uses a platform feature rather than producing text: an e-signature, an email draft\n * or a tabular review. It starts by itself; a signature and an email then wait for their people.\n */\nexport interface WorkflowActionStep extends WorkflowStepBase {\n kind: 'action'\n action: WorkflowAction\n}\n\nexport type WorkflowStep =\n | WorkflowFormStep\n | WorkflowUploadStep\n | WorkflowAgentStep\n | WorkflowReviewStep\n | WorkflowActionStep\n\n/** The finish screen of a stepped run. */\nexport interface WorkflowCompletion {\n title: string\n description?: string\n icon?: string\n}\n\n/**\n * Where a step of a run is, as the thread records it: not reached yet (`pending`), `running`,\n * `waiting` (an action step waiting on its signers or on its email being sent), `done`,\n * `skipped`, or `failed` (it can be retried or skipped).\n */\nexport type WorkflowStepStatus = 'pending' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed'\n\n/** What a waiting step waits on (ids only), as its latest event says. */\nexport interface WorkflowActionWaiting {\n /** An agent step: the documents to finish processing before its turn starts. */\n documents?: string[]\n /** A signature: the document and version to sign, who signs, who has signed. */\n doc_ext_id?: string\n version?: number\n signers?: string[]\n signed?: string[]\n expires_at?: string\n /** An email: the draft in native mail and whose mailbox it is in. */\n draft_id?: string\n mailbox?: string\n [key: string]: unknown\n}\n\n/** What a review recorded it approved: each step it waited for, as it stood then. */\nexport interface WorkflowApprovalEvidence {\n step: string\n status: string\n /** That step's answer (a message in the thread). */\n response_id?: string\n /** The document versions it had (`doc-\u2026@v<n>`). */\n documents?: string[]\n output?: Record<string, unknown>\n}\n\nexport interface WorkflowStepState {\n status: WorkflowStepStatus\n /** The step's answer in the thread (an agent step), or the result a branch delivered. */\n responseId?: string | null\n /** The answer's text, once read. */\n text?: string\n error?: string | null\n /**\n * Skipped while it stood failed (`error` keeps why it failed): what waits for it goes on\n * without its result.\n */\n skippedAfterFailure?: boolean\n /** When it started running (ISO), for the elapsed time while it runs. */\n startedAt?: string\n /** An action step's type, once it has started. */\n action?: WorkflowActionType\n /** What a `waiting` step waits on (an action step's people, an agent step's documents). */\n waiting?: WorkflowActionWaiting\n /** What a done action step produced (ids: the signed version, the draft, the reviewed labels). */\n output?: Record<string, unknown>\n /** The document versions the step produced or was given (`doc-\u2026@v<n>`). */\n documents?: string[]\n /** Reopened by a send-back to this step and not touched since (`hasNote`: with a note). */\n sentBack?: boolean\n hasNote?: boolean\n /** Who was told the step is ready (`usr-\u2026` / `agt-\u2026`), since it last changed. */\n announcedTo?: string | null\n /** Who finished it (completed, approved, skipped, declined). */\n by?: string | null\n /** When it finished (ISO). */\n at?: string\n /** A review: what it approved. */\n approved?: WorkflowApprovalEvidence[]\n /** A declined signature: who declined. */\n declinedBy?: string\n}\n\n/** A label a workflow needs, by the key its steps name it with. */\nexport interface WorkflowRequiredLabel {\n /** What the steps name it by (`labelRef(key)`). */\n key: string\n /** Its name in the workspace: an existing label of this name (any case) is used. */\n name: string\n /** How an AI review fills it in. */\n instruction?: string\n /** Its format (default: a checkbox). */\n format?: {\n type: 'checkbox' | 'text' | 'number' | 'select' | 'date'\n options?: string[]\n }\n /** Shared with the workspace's members (default: true). */\n shared?: boolean\n}\n\nexport interface WorkflowDefinition {\n /** Execute a document operation directly, without creating a chat. */\n documentAction?: 'annotate_documents' | 'email_documents'\n\n /** The skill slug. */\n id: string\n title: string\n /** One line: the tile text and the task picker's hint. */\n description: string\n /** Longer explanation shown in the dialog header; defaults to `description`. */\n details?: string\n /** Key into the host's icon map. */\n icon?: string\n /** The host's grouping of it (a skill pack's category): menus sort by it, then by title. */\n category?: string\n /** Primary button text; defaults to the dialog's generic \"Start\". */\n startLabel?: string\n /** Shipped with the app/deployment (pinned, not deletable, forkable into the user's own skills). */\n builtin?: boolean\n /** Backed by a server skill (its slug): a task runs it as a skill rather than as a prompt. */\n skill?: string\n inputs: WorkflowField[]\n run: WorkflowRun\n /** Where the user ends up after launching by default; a launch may override it. */\n landing: WorkflowLanding\n /** A model this run asks for (a run option the host applies, e.g. a stronger one for summaries). */\n model?: string\n /** Only offered by this host (e.g. `'word'`); absent = offered everywhere. */\n host?: string\n /** Needs workspace files to make sense: the dialog offers the host's add-files slot when none. */\n requiresFiles?: boolean\n /** Default agent; absent = the user's own assistant. */\n defaultAgentId?: string\n /** A free-form entry (\"my own instruction\", \"remind me\"), not a named skill: it does not name the dialog. */\n generic?: boolean\n /** Can be the body of a task (unattended). `action` workflows are not. */\n schedulable?: boolean\n /** Run options the form offers (all shown by default). */\n options?: { agent?: boolean }\n /**\n * The labels its steps need in the workspace it runs in (a tabular review's columns): found by\n * name or created before the run starts, and named in the steps by `labelRef(key)`.\n */\n requiredLabels?: WorkflowRequiredLabel[]\n}\n\n/** What `onLaunch` receives. The host performs the launch (chat, scoping, send). */\nexport interface WorkflowLaunch {\n workflow: WorkflowDefinition\n inputs: Record<string, WorkflowInputValue>\n /** The first `scope` field's value, hoisted: the host scopes documents with it. */\n scope: WorkflowScope\n /** `undefined` = the user's own assistant, in this chat. */\n agentId?: string\n /** Overrides `workflow.landing` for this launch (the empty chat sends in place). */\n landing?: WorkflowLanding\n}\n\nexport type OnWorkflowLaunch = (launch: WorkflowLaunch) => void | Promise<void>\n\nexport type WorkflowInputs = Record<string, WorkflowInputValue>\n\n/** Validation problem of one field: the dialog maps the code to a label. */\nexport type WorkflowFieldError = 'required' | 'min' | 'max' | 'number'\nexport type WorkflowErrors = Record<string, WorkflowFieldError>\n"],
4
+ "sourcesContent": ["/**\n * The one workflow model: a skill with a declared input schema. Everything launchable (a quick\n * action, a slash skill, a task body, an agent's job) is a `WorkflowDefinition`.\n *\n * The shape maps 1:1 onto future SKILL.md frontmatter (`inputs:` etc., snake_case on disk; see\n * `workflowFromFrontmatter`), so the backend can adopt it without a UI change. Blocks hold no\n * domain wording: titles, labels and prompt text are data supplied by the host.\n */\n\nimport type { Tone } from '../../components/tones'\n\nexport type WorkflowFieldType =\n | 'text'\n | 'longtext'\n | 'boolean'\n | 'select'\n | 'number'\n | 'date'\n | 'scope'\n | 'documents'\n /** A workspace member (`usr-\u2026` / `agt-\u2026`): what a step's assignee or a signer can name. */\n | 'person'\n\n/**\n * What a launching surface can hand a workflow without asking the user: the files it is looking at\n * (`documents`), the text the user selected (`selection`), or the image on screen (`image`, a file\n * id). A field binds to one with `context`; a surface offers a workflow when it can supply one of\n * the kinds the workflow declares (`workflowAccepts`).\n */\nexport type WorkflowContextKind = 'documents' | 'selection' | 'image'\n\n/** Where the user ends up after launching. `current-chat` sends into the chat already on screen. */\nexport type WorkflowLanding = 'chat' | 'current-chat' | 'files'\n\n/** Which files a run is limited to. Empty folders and labels = every file. */\nexport interface WorkflowScope {\n /** Folder paths; `''` is the unfiled bucket. */\n folders: string[]\n /** Label (tag) ids. */\n labels: string[]\n /** Exactly these files (ids). When present it wins over folders and labels: a `documents` field or a context launch. */\n documents?: string[]\n}\n\nexport const EMPTY_WORKFLOW_SCOPE: WorkflowScope = { folders: [], labels: [] }\n\nexport type WorkflowInputValue = string | number | boolean | WorkflowScope\n\nexport interface WorkflowFieldOption {\n value: string\n label: string\n description?: string\n /** Prompt fragment substituted for `{{name}}` when chosen (falls back to the label). */\n text?: string\n /** Key into the host's icon map. */\n icon?: string\n /**\n * Colours the option's choice tile (e.g. a risk rating: low `success`, medium `warning`, high\n * `danger`), chosen or not. The label always shows, so the tone is never the only cue.\n */\n tone?: Tone\n}\n\nexport interface WorkflowField {\n /** Key in `inputs`; also the `{{placeholder}}` in the prompt template. */\n name: string\n type: WorkflowFieldType\n label: string\n description?: string\n placeholder?: string\n required?: boolean\n default?: WorkflowInputValue\n /** `select` only. */\n options?: WorkflowFieldOption[]\n /** `number` only. */\n min?: number\n max?: number\n /** `boolean`: prompt fragments substituted for `{{name}}`. */\n trueText?: string\n falseText?: string\n /** Fold behind a disclosure: advanced wording the common run does not need. */\n advanced?: boolean\n /** `scope` only: which dimensions are offered. Default both. */\n by?: Array<'folders' | 'labels'>\n /** `documents` only: what kind of file is offered; `max` is how many may be picked (default 1). */\n accept?: 'image'\n /** Prefilled by a launching surface that supplies this kind of context (see `WorkflowContextKind`). */\n context?: WorkflowContextKind\n}\n\nexport type WorkflowRun =\n /** Compose a message from `promptTemplate` and send it. */\n | { kind: 'prompt'; promptTemplate: string }\n /** The host performs it (bound by workflow id), e.g. create a label then generate. */\n | { kind: 'operation' }\n /**\n * A guided run of named steps that form a graph. A run is a work thread on the server: the\n * thread's plan carries the steps (`toPlanSteps`), its activity log records each step's progress,\n * and the work runner starts each agent step as a turn in the thread. A person does the form,\n * upload and review steps (`useWorkflowThread` / `WorkflowRunner`). Not schedulable from a single\n * form: a workflow (automation) carries the steps and its trigger (`WorkflowBuilder`).\n */\n | {\n kind: 'steps'\n /** The run thread's title, a template over the run's inputs; defaults to the workflow's. */\n threadTitle?: string\n /** In dependency order: a step only waits for steps listed before it (`orderSteps`). */\n steps: WorkflowStep[]\n completion?: WorkflowCompletion\n /** Where each step sits on the builder's canvas, by step id. */\n layout?: Record<string, { x: number; y: number }>\n }\n\n/* ------------------------------- steps ------------------------------- */\n\n/**\n * When a step's signal is raised, tested against the step's outcome once it is done (a skipped or\n * failed step never signals): a form field equals a value (case-insensitive text), the agent's\n * answer contains a phrase or matches a regex, or a review is approved. Absent = whenever it is done.\n */\nexport type WorkflowSignalWhen =\n | { field: string; equals: string | number | boolean }\n | { contains: string }\n | { matches: string }\n | { approved: true }\n\n/**\n * A named signal a step raises when it is done and its condition holds. Another workflow starts on\n * it (\"When a step signals\") as its own thread linked to this one, so the if/then between\n * workflows lives in the link and each workflow stays short.\n */\nexport interface WorkflowSignal {\n /** A slug (`[a-z0-9][a-z0-9_.-]*`), e.g. `risk-high`: what a linked workflow listens for. */\n name: string\n when?: WorkflowSignalWhen\n}\n\ninterface WorkflowStepBase {\n /** Unique within the workflow (`[a-z][a-z0-9_-]*`): the thread's progress is keyed by it. */\n id: string\n /** The step's name: the stepper and the thread's top bar show it. */\n title: string\n /** One line under the step's heading. */\n description?: string\n /** Key into the host's icon map. */\n icon?: string\n /**\n * The host commits this step before the run moves on (`commit[id]`), e.g. creates the record\n * later steps work in. Once committed the step's inputs are locked.\n */\n commit?: boolean\n /** Primary button text while on this step (until it is committed); defaults to \"Continue\". */\n nextLabel?: string\n /**\n * The steps this one waits for. Absent: the step before it in the list, so a plain list is a\n * sequence. `[]`: it starts with the run. A step waiting for several waits for them all.\n */\n after?: string[]\n /** Signals the step raises when it is done and their condition holds. */\n signals?: WorkflowSignal[]\n /**\n * Who the step is for (a person step, or a signature or email step): they are told when it is\n * ready, and only they (or the run's owner) can do it. Absent: whoever is on the run.\n */\n assignee?: WorkflowAssignee\n /** A person step left this many hours is announced again (once). */\n remindAfterHours?: number\n}\n\n/**\n * Who a step is for: a named member (`usr-\u2026` / `agt-\u2026`), whoever started the run, the person a\n * form's `person` field names (`input`: its name), or the project's lead.\n */\nexport type WorkflowAssignee =\n { user: string } | { runOwner: true } | { input: string } | { projectLead: true }\n\n/**\n * A document a step works on, named by where it comes from: what an earlier step produced or was\n * given (an upload's files, an agent's draft, a signed copy, an edited version), what a run input\n * names (a document pick), or one document by id (`doc-\u2026`, optionally `@v<n>`).\n */\nexport type WorkflowDocumentRef = { step: string } | { input: string } | { id: string }\n\n/** Ask people to e-sign a document. The step waits until every signer has signed. */\nexport interface WorkflowSignAction {\n type: 'sign'\n document?: WorkflowDocumentRef\n signers: WorkflowAssignee[]\n /** Shown to the signers. */\n message?: string\n /** Unsigned this long after it starts, the step fails. */\n expiresAfterHours?: number\n}\n\n/**\n * Prepare an email in native mail, never sent by itself: its person sends it, and the step is done\n * when they say so (or send it). Every text is a template over the run (`{{field}}`,\n * `{{step.answer}}`).\n */\nexport interface WorkflowEmailDraftAction {\n type: 'email_draft'\n to: string[]\n cc?: string[]\n subject: string\n body: string\n attachments?: WorkflowDocumentRef[]\n}\n\n/** Run review columns (labels with instructions) over documents, then open the grid. */\nexport interface WorkflowTabularReviewAction {\n type: 'tabular_review'\n /** Label (tag) ids: the columns. */\n tags: string[]\n /** Every file the run's uploads took, every document of the workspace, or these documents. */\n documents: 'run_uploads' | 'workspace' | WorkflowDocumentRef[]\n /** Fill cells that already have a value again. */\n overwrite?: boolean\n}\n\n/**\n * Submit a request for approval as a row of a database: the step writes the row (shared, linked to\n * the run) with `values` filled from the run, then waits until one of the people its `decision`\n * column lists (that column's edit rule) sets the decision on the row. `approve` finishes the step,\n * `sendBack` reopens the step it waits for (resubmitting updates the same row), `reject` fails it.\n */\nexport interface WorkflowApprovalAction {\n type: 'approval'\n /** The requests database (`dbs-\u2026`, this workspace). */\n database: string\n /** Its decision column (id or name): a column only the listed approvers may set. */\n decision: string\n /** Column (id or name) \u2192 template over the run (`{{client}}`). */\n values?: Record<string, string>\n /** The decision words (default Approved / Sent back / Rejected), matched case-insensitively. */\n approve?: string\n sendBack?: string\n reject?: string\n /** Where Sent back returns the work: a step this one waits on (default: the step just before it). */\n sendBackTo?: string\n}\n\n/**\n * Open a project (the host's word: a matter, a case\u2026) on the server as soon as the step is ready,\n * wherever the step before it was completed: its details are templates over the run\n * (`{{client}}`), a detail that fills blank is left out, and with `workspace` (default) its first\n * workspace is made too. The step is done with the project's id (`{{<step>.project_ext_id}}`) and\n * its workspace's (`{{<step>.workspace_ext_id}}`).\n */\nexport interface WorkflowCreateProjectAction {\n type: 'create_project'\n name: string\n client?: string\n clientRef?: string\n stage?: string\n /** A person (`usr-\u2026`), e.g. `{{partner}}`. */\n leadUser?: string\n /** Host-defined project fields: key \u2192 template. */\n fields?: Record<string, string>\n /** `amount` is a template giving the amount in major units (pounds). */\n budget?: { amount: string; currency?: string }\n workspace?: boolean\n workspaceDescription?: string\n}\n\nexport type WorkflowAction =\n | WorkflowSignAction\n | WorkflowEmailDraftAction\n | WorkflowTabularReviewAction\n | WorkflowApprovalAction\n | WorkflowCreateProjectAction\nexport type WorkflowActionType = WorkflowAction['type']\n\n/** Ask for inputs. Every step's fields share the run's one input namespace (`{{name}}`). */\nexport interface WorkflowFormStep extends WorkflowStepBase {\n kind: 'form'\n inputs: WorkflowField[]\n}\n\n/** Add files to the run's workspace. Skippable unless `required`. */\nexport interface WorkflowUploadStep extends WorkflowStepBase {\n kind: 'upload'\n required?: boolean\n /** `accept` of the file picker, e.g. `.pdf,.docx`. */\n accept?: string\n /** Small muted line under the drop target. */\n hint?: string\n}\n\n/**\n * A turn the assistant takes in the run's thread. It runs a skill or another workflow\n * (`workflow`, its inputs filled from `with`) or its own `run`. It continues the thread's main\n * line, so it sees everything before it; a `branch` step runs off the main line instead and\n * delivers only its result back to it.\n */\nexport interface WorkflowAgentStep extends WorkflowStepBase {\n kind: 'agent'\n /** Id of the skill or workflow this step runs; its inputs come from `with`. */\n workflow?: string\n /**\n * The named workflow's inputs, each a template over the run's inputs: `{{client}}`, with\n * `{{a || b}}` falling back to `b` when `a` is blank. A bare `{{name}}` passes the value as is.\n */\n with?: Record<string, string>\n /** Used when no `workflow` is named. `operation`: the host composes the prompt (`compose`). */\n run?: Extract<WorkflowRun, { kind: 'prompt' } | { kind: 'operation' }>\n /** What the step shows: the answer (default) or the drafted document. */\n output?: 'answer' | 'artifact'\n /** Runs off the thread's main line and delivers only its result to it. */\n branch?: boolean\n /**\n * Edit this Word document with tracked changes (the instruction says what to change); the\n * edited copy is its next version, to accept or reject change by change. Main line only.\n */\n editDocument?: WorkflowDocumentRef\n}\n\n/** A person's review or approval: whoever completes it on the thread approves it. */\nexport interface WorkflowReviewStep extends WorkflowStepBase {\n kind: 'review'\n /** What to review, a template over the run's inputs. */\n instructions?: string\n /** What the approver fills in when approving (e.g. a rating): they join the run's inputs. */\n fields?: WorkflowField[]\n}\n\n/**\n * A step that uses a platform feature rather than producing text: an e-signature, an email draft\n * or a tabular review. It starts by itself; a signature and an email then wait for their people.\n */\nexport interface WorkflowActionStep extends WorkflowStepBase {\n kind: 'action'\n action: WorkflowAction\n}\n\nexport type WorkflowStep =\n | WorkflowFormStep\n | WorkflowUploadStep\n | WorkflowAgentStep\n | WorkflowReviewStep\n | WorkflowActionStep\n\n/** The finish screen of a stepped run. */\nexport interface WorkflowCompletion {\n title: string\n description?: string\n icon?: string\n}\n\n/**\n * Where a step of a run is, as the thread records it: not reached yet (`pending`), `running`,\n * `waiting` (an action step waiting on its signers or on its email being sent), `done`,\n * `skipped`, or `failed` (it can be retried or skipped).\n */\nexport type WorkflowStepStatus = 'pending' | 'running' | 'waiting' | 'done' | 'skipped' | 'failed'\n\n/** What a waiting step waits on (ids only), as its latest event says. */\nexport interface WorkflowActionWaiting {\n /** An agent step: the documents to finish processing before its turn starts. */\n documents?: string[]\n /** A signature: the document and version to sign, who signs, who has signed. */\n doc_ext_id?: string\n version?: number\n signers?: string[]\n signed?: string[]\n expires_at?: string\n /** An email: the draft in native mail and whose mailbox it is in. */\n draft_id?: string\n mailbox?: string\n [key: string]: unknown\n}\n\n/** What a review recorded it approved: each step it waited for, as it stood then. */\nexport interface WorkflowApprovalEvidence {\n step: string\n status: string\n /** That step's answer (a message in the thread). */\n response_id?: string\n /** The document versions it had (`doc-\u2026@v<n>`). */\n documents?: string[]\n output?: Record<string, unknown>\n}\n\nexport interface WorkflowStepState {\n status: WorkflowStepStatus\n /** The step's answer in the thread (an agent step), or the result a branch delivered. */\n responseId?: string | null\n /** The answer's text, once read. */\n text?: string\n error?: string | null\n /**\n * Skipped while it stood failed (`error` keeps why it failed): what waits for it goes on\n * without its result.\n */\n skippedAfterFailure?: boolean\n /** When it started running (ISO), for the elapsed time while it runs. */\n startedAt?: string\n /** An action step's type, once it has started. */\n action?: WorkflowActionType\n /** What a `waiting` step waits on (an action step's people, an agent step's documents). */\n waiting?: WorkflowActionWaiting\n /** What a done action step produced (ids: the signed version, the draft, the reviewed labels). */\n output?: Record<string, unknown>\n /** The document versions the step produced or was given (`doc-\u2026@v<n>`). */\n documents?: string[]\n /** Reopened by a send-back to this step and not touched since (`hasNote`: with a note). */\n sentBack?: boolean\n hasNote?: boolean\n /** Who was told the step is ready (`usr-\u2026` / `agt-\u2026`), since it last changed. */\n announcedTo?: string | null\n /** Who finished it (completed, approved, skipped, declined). */\n by?: string | null\n /** When it finished (ISO). */\n at?: string\n /** A review: what it approved. */\n approved?: WorkflowApprovalEvidence[]\n /** A declined signature: who declined. */\n declinedBy?: string\n}\n\n/** A label a workflow needs, by the key its steps name it with. */\nexport interface WorkflowRequiredLabel {\n /** What the steps name it by (`labelRef(key)`). */\n key: string\n /** Its name in the workspace: an existing label of this name (any case) is used. */\n name: string\n /** How an AI review fills it in. */\n instruction?: string\n /** Its format (default: a checkbox). */\n format?: {\n type: 'checkbox' | 'text' | 'number' | 'select' | 'date'\n options?: string[]\n }\n /** Shared with the workspace's members (default: true). */\n shared?: boolean\n}\n\nexport interface WorkflowDefinition {\n /** Execute a document operation directly, without creating a chat. */\n documentAction?: 'annotate_documents' | 'email_documents'\n\n /** The skill slug. */\n id: string\n title: string\n /** One line: the tile text and the task picker's hint. */\n description: string\n /** Longer explanation shown in the dialog header; defaults to `description`. */\n details?: string\n /** Key into the host's icon map. */\n icon?: string\n /** The host's grouping of it (a skill pack's category): menus sort by it, then by title. */\n category?: string\n /** Primary button text; defaults to the dialog's generic \"Start\". */\n startLabel?: string\n /** Shipped with the app/deployment (pinned, not deletable, forkable into the user's own skills). */\n builtin?: boolean\n /** Backed by a server skill (its slug): a task runs it as a skill rather than as a prompt. */\n skill?: string\n inputs: WorkflowField[]\n run: WorkflowRun\n /** Where the user ends up after launching by default; a launch may override it. */\n landing: WorkflowLanding\n /** A model this run asks for (a run option the host applies, e.g. a stronger one for summaries). */\n model?: string\n /** Only offered by this host (e.g. `'word'`); absent = offered everywhere. */\n host?: string\n /** Needs workspace files to make sense: the dialog offers the host's add-files slot when none. */\n requiresFiles?: boolean\n /** Default agent; absent = the user's own assistant. */\n defaultAgentId?: string\n /** A free-form entry (\"my own instruction\", \"remind me\"), not a named skill: it does not name the dialog. */\n generic?: boolean\n /** Can be the body of a task (unattended). `action` workflows are not. */\n schedulable?: boolean\n /** Run options the form offers (all shown by default). */\n options?: { agent?: boolean }\n /**\n * The labels its steps need in the workspace it runs in (a tabular review's columns): found by\n * name or created before the run starts, and named in the steps by `labelRef(key)`.\n */\n requiredLabels?: WorkflowRequiredLabel[]\n}\n\n/** What `onLaunch` receives. The host performs the launch (chat, scoping, send). */\nexport interface WorkflowLaunch {\n workflow: WorkflowDefinition\n inputs: Record<string, WorkflowInputValue>\n /** The first `scope` field's value, hoisted: the host scopes documents with it. */\n scope: WorkflowScope\n /** `undefined` = the user's own assistant, in this chat. */\n agentId?: string\n /** Overrides `workflow.landing` for this launch (the empty chat sends in place). */\n landing?: WorkflowLanding\n}\n\nexport type OnWorkflowLaunch = (launch: WorkflowLaunch) => void | Promise<void>\n\nexport type WorkflowInputs = Record<string, WorkflowInputValue>\n\n/** Validation problem of one field: the dialog maps the code to a label. */\nexport type WorkflowFieldError = 'required' | 'min' | 'max' | 'number'\nexport type WorkflowErrors = Record<string, WorkflowFieldError>\n"],
5
5
  "mappings": ";AA4CO,MAAM,uBAAsC,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE;",
6
6
  "names": []
7
7
  }
@@ -1,24 +1,24 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkZCVW63DF_cjs = require('./chunk-ZCVW63DF.cjs');
5
- require('./chunk-MC34TXSS.cjs');
6
- require('./chunk-2XZ3HBAA.cjs');
7
- require('./chunk-YST6GVN5.cjs');
8
- require('./chunk-FK7MBD5H.cjs');
9
- require('./chunk-7D4WXUBS.cjs');
4
+ var chunkLXQMTVAB_cjs = require('./chunk-LXQMTVAB.cjs');
5
+ require('./chunk-A5ZNAZ7Q.cjs');
6
+ require('./chunk-UHT2Q6IF.cjs');
7
+ require('./chunk-ZUYY3JRO.cjs');
8
+ require('./chunk-MIYEIACV.cjs');
9
+ require('./chunk-U2HDSS5R.cjs');
10
+ require('./chunk-P2K4XL4T.cjs');
11
+ require('./chunk-3YZKDCWY.cjs');
12
+ require('./chunk-M55XUF4L.cjs');
10
13
  require('./chunk-EVZH6Z5O.cjs');
11
- require('./chunk-YZ25NAR3.cjs');
14
+ require('./chunk-JARRHAQW.cjs');
12
15
  require('./chunk-AHDJXIUB.cjs');
13
- require('./chunk-S5OGPQSB.cjs');
14
- require('./chunk-OUGRCQM7.cjs');
16
+ require('./chunk-MHGZZ6IJ.cjs');
17
+ require('./chunk-GAVQFR6P.cjs');
15
18
  require('./chunk-VZOOGA47.cjs');
16
- require('./chunk-CENMN32L.cjs');
17
- require('./chunk-YKOPKLYP.cjs');
18
- require('./chunk-3YZKDCWY.cjs');
19
- require('./chunk-P5TQOSKA.cjs');
20
- require('./chunk-5TT6J67U.cjs');
21
- require('./chunk-5RMVFFVW.cjs');
19
+ require('./chunk-SK6BONXE.cjs');
20
+ require('./chunk-X6QGVLMV.cjs');
21
+ require('./chunk-VHD5DZW4.cjs');
22
22
  require('./chunk-5F4DCIHS.cjs');
23
23
  require('./chunk-AFQTQC7A.cjs');
24
24
  require('./chunk-XJEXFEWG.cjs');
@@ -27,13 +27,13 @@ require('./chunk-MCXS6X37.cjs');
27
27
  require('./chunk-KQF7POTG.cjs');
28
28
  require('./chunk-75BNMCUX.cjs');
29
29
  require('./chunk-IN6ILI5A.cjs');
30
- require('./chunk-KMOIE2XH.cjs');
31
- require('./chunk-I2LJ7RZ2.cjs');
32
- require('./chunk-XPQR2PJX.cjs');
30
+ require('./chunk-7XR6CPCU.cjs');
31
+ require('./chunk-Y3GJBLAI.cjs');
32
+ require('./chunk-SQCCQU3K.cjs');
33
33
  require('./chunk-UDSHVNU3.cjs');
34
- require('./chunk-IPSHAMO2.cjs');
35
34
  require('./chunk-PPCATBOY.cjs');
36
- require('./chunk-LIKDQBNJ.cjs');
35
+ require('./chunk-IPSHAMO2.cjs');
36
+ require('./chunk-VMXTOIXB.cjs');
37
37
  require('./chunk-YZBDHBKI.cjs');
38
38
  require('./chunk-CVPV4I7Z.cjs');
39
39
  require('./chunk-PLIF5CUV.cjs');
@@ -42,35 +42,35 @@ require('./chunk-PLIF5CUV.cjs');
42
42
 
43
43
  Object.defineProperty(exports, "ConnectedAssistantDock", {
44
44
  enumerable: true,
45
- get: function () { return chunkZCVW63DF_cjs.ConnectedAssistantDock; }
45
+ get: function () { return chunkLXQMTVAB_cjs.ConnectedAssistantDock; }
46
46
  });
47
47
  Object.defineProperty(exports, "redlineStats", {
48
48
  enumerable: true,
49
- get: function () { return chunkZCVW63DF_cjs.redlineStats; }
49
+ get: function () { return chunkLXQMTVAB_cjs.redlineStats; }
50
50
  });
51
51
  Object.defineProperty(exports, "textToArtifact", {
52
52
  enumerable: true,
53
- get: function () { return chunkZCVW63DF_cjs.textToArtifact; }
53
+ get: function () { return chunkLXQMTVAB_cjs.textToArtifact; }
54
54
  });
55
55
  Object.defineProperty(exports, "toRedlineMarkdown", {
56
56
  enumerable: true,
57
- get: function () { return chunkZCVW63DF_cjs.toRedlineMarkdown; }
57
+ get: function () { return chunkLXQMTVAB_cjs.toRedlineMarkdown; }
58
58
  });
59
59
  Object.defineProperty(exports, "useConnectedAiTask", {
60
60
  enumerable: true,
61
- get: function () { return chunkZCVW63DF_cjs.useConnectedAiTask; }
61
+ get: function () { return chunkLXQMTVAB_cjs.useConnectedAiTask; }
62
62
  });
63
63
  Object.defineProperty(exports, "useConnectedChat", {
64
64
  enumerable: true,
65
- get: function () { return chunkZCVW63DF_cjs.useConnectedChat; }
65
+ get: function () { return chunkLXQMTVAB_cjs.useConnectedChat; }
66
66
  });
67
67
  Object.defineProperty(exports, "useSemanticSearch", {
68
68
  enumerable: true,
69
- get: function () { return chunkZCVW63DF_cjs.useSemanticSearch; }
69
+ get: function () { return chunkLXQMTVAB_cjs.useSemanticSearch; }
70
70
  });
71
71
  Object.defineProperty(exports, "useWorkspaceDocs", {
72
72
  enumerable: true,
73
- get: function () { return chunkZCVW63DF_cjs.useWorkspaceDocs; }
73
+ get: function () { return chunkLXQMTVAB_cjs.useWorkspaceDocs; }
74
74
  });
75
- //# sourceMappingURL=ai-VLIPYNWP.cjs.map
76
- //# sourceMappingURL=ai-VLIPYNWP.cjs.map
75
+ //# sourceMappingURL=ai-NC4ZE3UT.cjs.map
76
+ //# sourceMappingURL=ai-NC4ZE3UT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ai-NC4ZE3UT.cjs"}
@@ -4,9 +4,9 @@
4
4
  var chunkNWU2QMW4_cjs = require('../chunk-NWU2QMW4.cjs');
5
5
  require('../chunk-JOUMBLGL.cjs');
6
6
  var chunkV6C2MBFY_cjs = require('../chunk-V6C2MBFY.cjs');
7
+ require('../chunk-ZT5MIFLC.cjs');
7
8
  require('../chunk-KKYNTWDU.cjs');
8
9
  var chunkM74FWYNL_cjs = require('../chunk-M74FWYNL.cjs');
9
- require('../chunk-ZT5MIFLC.cjs');
10
10
  require('../chunk-LJJJ6CYH.cjs');
11
11
  require('../chunk-PLIF5CUV.cjs');
12
12