@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.8

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 (323) hide show
  1. package/README.md +564 -2
  2. package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
  3. package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
  4. package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
  5. package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
  6. package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
  7. package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
  8. package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
  9. package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
  10. package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
  11. package/dist/DateTimeField-B1qR4ruo.js +51 -0
  12. package/dist/Disclosure-BNKij7-v.js +45 -0
  13. package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
  14. package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
  15. package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
  16. package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
  17. package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
  18. package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
  19. package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
  20. package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
  21. package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
  22. package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
  23. package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
  24. package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
  25. package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
  26. package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
  27. package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
  28. package/dist/FluidGridsMark-CE2blT7K.js +74 -0
  29. package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
  30. package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
  31. package/dist/HistoryPage-BSBISXoj.js +2835 -0
  32. package/dist/Icon-BtQ0HXLh.js +160 -0
  33. package/dist/InsightsPage-D7ybj8N9.js +11245 -0
  34. package/dist/IsolationSetting-vy911E8b.js +1153 -0
  35. package/dist/LibraryParts-DOeNgR8A.js +413 -0
  36. package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
  37. package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
  38. package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
  39. package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
  40. package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
  41. package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
  42. package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
  43. package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
  44. package/dist/NodesPage-O7KeeKtd.js +653 -0
  45. package/dist/OfflineIcon-TwMKYWjA.js +207 -0
  46. package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
  47. package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
  48. package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
  49. package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
  50. package/dist/RunActionsMenu-DodOgIQm.js +59 -0
  51. package/dist/RunnerStatusPill-C1v967iq.js +24 -0
  52. package/dist/RunnersPage-dB0RSdY_.js +1929 -0
  53. package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
  54. package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
  55. package/dist/SearchBox-BGtYjvfs.js +49 -0
  56. package/dist/SequenceEditor-CFiHeHkR.js +497 -0
  57. package/dist/SettingsPage-0CQBNPZV.js +8695 -0
  58. package/dist/StewardPages-DAJhepen.js +47 -0
  59. package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
  60. package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
  61. package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
  62. package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
  63. package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
  64. package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
  65. package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
  66. package/dist/TemplatePreview-cx7-NOeG.js +868 -0
  67. package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
  68. package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
  69. package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
  70. package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
  71. package/dist/TranslationBridge-Da-TPgQm.js +68 -0
  72. package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
  73. package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
  74. package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
  75. package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
  76. package/dist/VariablesPage-ChfGuW22.js +2243 -0
  77. package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
  78. package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
  79. package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
  80. package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
  81. package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
  82. package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
  83. package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
  84. package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
  85. package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
  86. package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
  87. package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
  88. package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
  89. package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
  90. package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
  91. package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
  92. package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
  93. package/dist/WorkflowsList--hR2_8gf.js +4593 -0
  94. package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
  95. package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
  96. package/dist/addonCatalog-CbZS4deh.js +58 -0
  97. package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
  98. package/dist/addons.d.ts +3 -0
  99. package/dist/addons.js +4 -0
  100. package/dist/agent-form-Bfvm32j1.js +83 -0
  101. package/dist/agent-tools.d.ts +3 -0
  102. package/dist/agent-tools.js +5 -0
  103. package/dist/agentTools-CyL7DLOF.js +320 -0
  104. package/dist/ai-usage-BrxDgvdR.js +240 -0
  105. package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
  106. package/dist/api-BKq-nIOZ.js +2286 -0
  107. package/dist/api-Ol7I8NxE.js +8289 -0
  108. package/dist/apollo-type-policies.d.ts +11 -0
  109. package/dist/apollo-type-policies.js +64 -0
  110. package/dist/askAboutBridge-ByYsQams.js +106 -0
  111. package/dist/askQuestions-Cmx7VnMm.js +742 -0
  112. package/dist/assert-rules-lfYEMc99.js +318 -0
  113. package/dist/assistant.d.ts +94 -0
  114. package/dist/assistant.js +99 -0
  115. package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
  116. package/dist/badge-CXfPhoMH.js +26 -0
  117. package/dist/basil.generated-BK-EHbwN.js +10 -0
  118. package/dist/browser-steps-DMpS5TyB.js +533 -0
  119. package/dist/builderTimings-pvGnK1m-.js +510 -0
  120. package/dist/button-DG7y_FVJ.js +48 -0
  121. package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
  122. package/dist/card-Bomy_1UG.js +44 -0
  123. package/dist/catalogGrid-BOrfMgi-.js +41 -0
  124. package/dist/channel-CPyQ1NR1.js +212 -0
  125. package/dist/chips-CvNrYJZa.js +27 -0
  126. package/dist/client-holder-C0M5Cfwl.js +68 -0
  127. package/dist/cn-QqidFIgr.js +10 -0
  128. package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
  129. package/dist/code-editor-field-x_JrY8KR.js +113 -0
  130. package/dist/codec-client-DPuD6mw7.js +515 -0
  131. package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
  132. package/dist/config-DO68jw5k.js +322 -0
  133. package/dist/constants-DgbVc24O.d.ts +296 -0
  134. package/dist/constants-DlRnHBfQ.js +217 -0
  135. package/dist/convert-browser-action-pfecelF7.js +347 -0
  136. package/dist/convert-dialog-B_o22NiJ.js +382 -0
  137. package/dist/create-workflow-first-Azg3JUdX.js +120 -0
  138. package/dist/definition-canvas-Bsda-rDT.js +31 -0
  139. package/dist/dialog-BVd152GS.js +94 -0
  140. package/dist/durable-nodes-BXyYCLxT.js +91 -0
  141. package/dist/duration-CDb7-mT_.js +33 -0
  142. package/dist/edge-mapper-wEAdGVU2.js +4477 -0
  143. package/dist/element-library-DkSlg_VE.js +727 -0
  144. package/dist/entities-I_0kio3q.js +38 -0
  145. package/dist/error-advice-QLr5NCm7.js +65 -0
  146. package/dist/errors-ClKb5sEt.js +188 -0
  147. package/dist/executions.d.ts +3 -0
  148. package/dist/executions.js +5 -0
  149. package/dist/feature-flags-B2qetXKd.js +385 -0
  150. package/dist/field-label-DPZRmE_B.js +153 -0
  151. package/dist/firstWorkflow-C_h0KMB2.js +133 -0
  152. package/dist/flags.d.ts +3 -0
  153. package/dist/flags.js +4 -0
  154. package/dist/flow-builder-DIvLOhz0.js +28038 -0
  155. package/dist/flow-store-holder-CUN7Terz.js +52 -0
  156. package/dist/fluent.generated-CA_e6-4l.js +14 -0
  157. package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
  158. package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
  159. package/dist/global-client-BQPuFrFa.js +433 -0
  160. package/dist/global-operations-BG6YgxrM.js +136 -0
  161. package/dist/graphql-types-UTYtujY9.js +21358 -0
  162. package/dist/history.d.ts +3 -0
  163. package/dist/history.js +4 -0
  164. package/dist/index-AoJAa5vU.d.ts +164958 -0
  165. package/dist/index-DEMT3iAM.d.ts +120 -0
  166. package/dist/index-ROZzNGyY.d.ts +76 -0
  167. package/dist/index.d.ts +20 -0
  168. package/dist/index.js +8123 -0
  169. package/dist/ion.generated-mbajjcAg.js +10 -0
  170. package/dist/label-Lzb8ZXf_.js +29 -0
  171. package/dist/labels-rXd9gYQz.js +1236 -0
  172. package/dist/liveCanvas-D5ytXDp8.js +103 -0
  173. package/dist/logos.generated-X6_0kjVR.js +21 -0
  174. package/dist/logs-panel-Cw0DkG0l.js +468 -0
  175. package/dist/lucide.generated-B6NVd3GT.js +29 -0
  176. package/dist/marksStore-a9oIMMot.js +175 -0
  177. package/dist/mcp-trigger-D0nRdvq5.js +307 -0
  178. package/dist/mdi.generated-D1BV74d6.js +292 -0
  179. package/dist/menus-CU3hDGYl.js +160 -0
  180. package/dist/mynaui.generated-DMWr5cXz.js +66 -0
  181. package/dist/navigation-v2.d.ts +3 -0
  182. package/dist/navigation-v2.js +5 -0
  183. package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
  184. package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
  185. package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
  186. package/dist/node-registry-refresh-s3okf83X.js +27 -0
  187. package/dist/node-role-TMbnkmeP.js +132 -0
  188. package/dist/node-type-icon-BZa8n4iG.js +33 -0
  189. package/dist/nodes.d.ts +3 -0
  190. package/dist/nodes.js +4 -0
  191. package/dist/notesKey-5EaREBGA.js +12 -0
  192. package/dist/observability.d.ts +3 -0
  193. package/dist/observability.js +5 -0
  194. package/dist/offset-pages-zghoClB3.js +55 -0
  195. package/dist/operations-BBmT9ToP.js +663 -0
  196. package/dist/operations-WxRJWeqO.js +3133 -0
  197. package/dist/output-files-Ba8bu5lv.js +196 -0
  198. package/dist/page-operation-DrWuhd6Y.js +129 -0
  199. package/dist/page-twins.d.ts +13 -0
  200. package/dist/page-twins.js +186 -0
  201. package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
  202. package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
  203. package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
  204. package/dist/panels-PfBBAToE.js +346 -0
  205. package/dist/parts-B7fBcw-B.js +346 -0
  206. package/dist/popover-Dms9Vz3j.js +3389 -0
  207. package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
  208. package/dist/proactive.d.ts +66 -0
  209. package/dist/proactive.js +237 -0
  210. package/dist/quick-config-panel-DFd77xho.js +451 -0
  211. package/dist/quota-DeA_CJ2e.js +175 -0
  212. package/dist/quota.d.ts +3 -0
  213. package/dist/quota.js +4 -0
  214. package/dist/read-only-context-Dt9N9SIG.js +18 -0
  215. package/dist/relative-time-Dxt8ZIIu.js +55 -0
  216. package/dist/results-CwK_yDxK.js +325 -0
  217. package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
  218. package/dist/route-data.d.ts +12 -0
  219. package/dist/route-data.js +69 -0
  220. package/dist/route-match-C-0_EnAt.d.ts +5 -0
  221. package/dist/route-match-DMkUICYV.js +41 -0
  222. package/dist/route-preload-C4DlGoCd.js +120 -0
  223. package/dist/run-display-UjLAoYqQ.js +81 -0
  224. package/dist/run-history-arGiHzGU.js +285 -0
  225. package/dist/run-list-links-DJn4Mf1T.js +98 -0
  226. package/dist/run-mode-USmM0-Uo.js +82 -0
  227. package/dist/run-parity-CWXqEJqM.js +144 -0
  228. package/dist/runsQuota-B6SyTbne.js +100 -0
  229. package/dist/runsQuota-DsniKiSg.d.ts +20 -0
  230. package/dist/safe-expression-Cw7-SCsm.js +1251 -0
  231. package/dist/save-status-store-C7nEYpfb.js +631 -0
  232. package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
  233. package/dist/schedule-rules-ggVKRkBH.js +358 -0
  234. package/dist/secrets-Re_wSiE3.js +153 -0
  235. package/dist/settings.d.ts +4 -0
  236. package/dist/settings.js +6 -0
  237. package/dist/shared-DAWGGMSM.js +177 -0
  238. package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
  239. package/dist/solar.generated-CGYuUQAC.js +10 -0
  240. package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
  241. package/dist/start-url-CT6Yz96K.js +24 -0
  242. package/dist/status-CessxGpm.js +55 -0
  243. package/dist/store-icon-OctYp5zP.js +155 -0
  244. package/dist/styles-WGmTnZ2n.js +26 -0
  245. package/dist/styles.css +139 -0
  246. package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
  247. package/dist/template-code-CzN6JWNV.js +191 -0
  248. package/dist/template-graph-DLF9dygU.js +20 -0
  249. package/dist/template-preview-DcIIKOOL.js +32 -0
  250. package/dist/template-price-CdUHZRMF.js +40 -0
  251. package/dist/templates.d.ts +3 -0
  252. package/dist/templates.js +5 -0
  253. package/dist/theme-provider-CntfC4_i.js +23 -0
  254. package/dist/transient-DgZfhDfN.js +57 -0
  255. package/dist/typed-calls-C5tO03wq.js +26 -0
  256. package/dist/ui-script-By74Guk3.js +1094 -0
  257. package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
  258. package/dist/ui-step-fix-8uM2_Hft.js +67 -0
  259. package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
  260. package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
  261. package/dist/ui-target-editor-D2JhB_lD.js +673 -0
  262. package/dist/uiMarkTools-CSznnO1i.js +1054 -0
  263. package/dist/upgradePrompt-BAFBKKW5.js +72 -0
  264. package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
  265. package/dist/use-browser-available-hj8wc3Kb.js +241 -0
  266. package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
  267. package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
  268. package/dist/use-mobile-BTqCUjzS.js +27 -0
  269. package/dist/use-sdk-query-C697xZVv.js +116 -0
  270. package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
  271. package/dist/useActionParam-B2tU2BlY.js +85 -0
  272. package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
  273. package/dist/useBrowserClients-3v95-gSh.js +103 -0
  274. package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
  275. package/dist/useConnections-DsgEJs05.js +439 -0
  276. package/dist/useDebouncedValue-BFekcv6n.js +18 -0
  277. package/dist/useDurableParity-8fnMZmBc.js +1787 -0
  278. package/dist/useEntityTags-D0spL6Ut.js +460 -0
  279. package/dist/useExecutions-2u5nGJJk.js +681 -0
  280. package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
  281. package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
  282. package/dist/useHumanRequests-zlYDp3l1.js +221 -0
  283. package/dist/useNavigationV2-C2WeqN7d.js +29 -0
  284. package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
  285. package/dist/useObservability-BRlQ0tOA.js +285 -0
  286. package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
  287. package/dist/useRunHistory-CXCMUPyf.js +2759 -0
  288. package/dist/useRunLive-D0JvVZT2.js +1060 -0
  289. package/dist/useRunnerList-Dbi59i1K.js +446 -0
  290. package/dist/useRunners-URUc5quU.js +173 -0
  291. package/dist/useRunsPage-DG656UCK.js +2709 -0
  292. package/dist/useVariables-BIelxcWr.js +463 -0
  293. package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
  294. package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
  295. package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
  296. package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
  297. package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
  298. package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
  299. package/dist/utils-fvBb5qOD.js +89 -0
  300. package/dist/webhook-deliveries-AvQujaZy.js +99 -0
  301. package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
  302. package/dist/workflow-builder.d.ts +3 -0
  303. package/dist/workflow-builder.js +8 -0
  304. package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
  305. package/dist/workflow-embed.d.ts +3 -0
  306. package/dist/workflow-embed.js +4 -0
  307. package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
  308. package/dist/workflow-host.d.ts +6 -0
  309. package/dist/workflow-host.js +11 -0
  310. package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
  311. package/dist/workflow-pages.d.ts +3 -0
  312. package/dist/workflow-pages.js +115 -0
  313. package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
  314. package/dist/workflow-preview.d.ts +65 -0
  315. package/dist/workflow-preview.js +4 -0
  316. package/dist/workflow-route.d.ts +33 -0
  317. package/dist/workflow-route.js +4 -0
  318. package/dist/workflow-save-state-D0l-DkLf.js +767 -0
  319. package/dist/workflow-transfer-CQnQC-ke.js +104 -0
  320. package/dist/workflowRouteData-BkfVOc-O.js +169 -0
  321. package/dist/workflows-list.d.ts +10 -0
  322. package/dist/workflows-list.js +5 -0
  323. package/package.json +320 -4
@@ -0,0 +1,1094 @@
1
+ "use client";
2
+ import { t as __exportAll } from "./rolldown-runtime-hDbaFkMy.js";
3
+ import { describeStep, safeParseUiScript } from "@burdenoff/ui-engine/script";
4
+ import { analyzeUiScript, stepNumber } from "@burdenoff/ui-engine/analyze";
5
+
6
+ // src/builder/lib/ui-script-messages.ts
7
+ const UI_SCRIPT_STEP_TEXTS = [
8
+ {
9
+ key: "fluidgrids.uiScript.step.navigate",
10
+ fallback: "Go to {{url}}"
11
+ },
12
+ {
13
+ key: "fluidgrids.uiScript.step.goBack",
14
+ fallback: "Go back"
15
+ },
16
+ {
17
+ key: "fluidgrids.uiScript.step.reload",
18
+ fallback: "Reload the page"
19
+ },
20
+ {
21
+ key: "fluidgrids.uiScript.step.closeTab",
22
+ fallback: "Close the tab"
23
+ },
24
+ {
25
+ key: "fluidgrids.uiScript.step.click",
26
+ fallback: "Click {{target}}"
27
+ },
28
+ {
29
+ key: "fluidgrids.uiScript.step.rightClick",
30
+ fallback: "Right-click {{target}}"
31
+ },
32
+ {
33
+ key: "fluidgrids.uiScript.step.doubleClick",
34
+ fallback: "Double-click {{target}}"
35
+ },
36
+ {
37
+ key: "fluidgrids.uiScript.step.rightDoubleClick",
38
+ fallback: "Right double-click {{target}}"
39
+ },
40
+ {
41
+ key: "fluidgrids.uiScript.step.hover",
42
+ fallback: "Point at {{target}}"
43
+ },
44
+ {
45
+ key: "fluidgrids.uiScript.step.type",
46
+ fallback: "Type {{value}} into {{target}}"
47
+ },
48
+ {
49
+ key: "fluidgrids.uiScript.step.typeFocused",
50
+ fallback: "Type {{value}}"
51
+ },
52
+ {
53
+ key: "fluidgrids.uiScript.step.typeMasked",
54
+ fallback: "Type a hidden value into {{target}}"
55
+ },
56
+ {
57
+ key: "fluidgrids.uiScript.step.typeMaskedFocused",
58
+ fallback: "Type a hidden value"
59
+ },
60
+ {
61
+ key: "fluidgrids.uiScript.step.typeSecret",
62
+ fallback: "Type a secret into {{target}}"
63
+ },
64
+ {
65
+ key: "fluidgrids.uiScript.step.clear",
66
+ fallback: "Clear {{target}}"
67
+ },
68
+ {
69
+ key: "fluidgrids.uiScript.step.select",
70
+ fallback: "Choose {{value}} in {{target}}"
71
+ },
72
+ {
73
+ key: "fluidgrids.uiScript.step.check",
74
+ fallback: "Tick {{target}}"
75
+ },
76
+ {
77
+ key: "fluidgrids.uiScript.step.uncheck",
78
+ fallback: "Untick {{target}}"
79
+ },
80
+ {
81
+ key: "fluidgrids.uiScript.step.pressKey",
82
+ fallback: "Press {{keys}}"
83
+ },
84
+ {
85
+ key: "fluidgrids.uiScript.step.scrollTop",
86
+ fallback: "Scroll to the top"
87
+ },
88
+ {
89
+ key: "fluidgrids.uiScript.step.scrollBottom",
90
+ fallback: "Scroll to the bottom"
91
+ },
92
+ {
93
+ key: "fluidgrids.uiScript.step.scrollTo",
94
+ fallback: "Scroll to {{target}}"
95
+ },
96
+ {
97
+ key: "fluidgrids.uiScript.step.scrollBy",
98
+ fallback: "Scroll by {{dx}}, {{dy}}"
99
+ },
100
+ {
101
+ key: "fluidgrids.uiScript.step.scrollInside",
102
+ fallback: "Scroll {{target}} by {{dx}}, {{dy}}"
103
+ },
104
+ {
105
+ key: "fluidgrids.uiScript.step.waitFor",
106
+ fallback: "Wait for {{target}}"
107
+ },
108
+ {
109
+ key: "fluidgrids.uiScript.step.waitForGone",
110
+ fallback: "Wait for {{target}} to go away"
111
+ },
112
+ {
113
+ key: "fluidgrids.uiScript.step.waitForText",
114
+ fallback: "Wait for the text {{value}}"
115
+ },
116
+ {
117
+ key: "fluidgrids.uiScript.step.waitForUrl",
118
+ fallback: "Wait for the address to contain {{value}}"
119
+ },
120
+ {
121
+ key: "fluidgrids.uiScript.step.waitForTime",
122
+ fallback: "Wait {{milliseconds}} ms"
123
+ },
124
+ {
125
+ key: "fluidgrids.uiScript.step.extract",
126
+ fallback: "Read {{fields}}"
127
+ },
128
+ {
129
+ key: "fluidgrids.uiScript.step.extractList",
130
+ fallback: "Read each {{target}}"
131
+ },
132
+ {
133
+ key: "fluidgrids.uiScript.step.getText",
134
+ fallback: "Read the text of {{target}}"
135
+ },
136
+ {
137
+ key: "fluidgrids.uiScript.step.getValue",
138
+ fallback: "Read the value of {{target}}"
139
+ },
140
+ {
141
+ key: "fluidgrids.uiScript.step.getAttribute",
142
+ fallback: "Read {{attribute}} of {{target}}"
143
+ },
144
+ {
145
+ key: "fluidgrids.uiScript.step.elementExists",
146
+ fallback: "Check whether {{target}} is there"
147
+ },
148
+ {
149
+ key: "fluidgrids.uiScript.step.getPageText",
150
+ fallback: "Read the page text"
151
+ },
152
+ {
153
+ key: "fluidgrids.uiScript.step.getPageHtml",
154
+ fallback: "Read the page HTML"
155
+ },
156
+ {
157
+ key: "fluidgrids.uiScript.step.screenshot",
158
+ fallback: "Take a screenshot"
159
+ },
160
+ {
161
+ key: "fluidgrids.uiScript.step.screenshotOf",
162
+ fallback: "Take a screenshot of {{target}}"
163
+ },
164
+ {
165
+ key: "fluidgrids.uiScript.step.login",
166
+ fallback: "Sign in"
167
+ },
168
+ {
169
+ key: "fluidgrids.uiScript.step.focusWindow",
170
+ fallback: "Switch to {{app}}"
171
+ },
172
+ {
173
+ key: "fluidgrids.uiScript.step.if",
174
+ fallback: "If {{condition}}"
175
+ },
176
+ {
177
+ key: "fluidgrids.uiScript.step.ifElement",
178
+ fallback: "If {{target}} is there"
179
+ },
180
+ {
181
+ key: "fluidgrids.uiScript.step.forEach",
182
+ fallback: "For each item in {{value}}"
183
+ },
184
+ {
185
+ key: "fluidgrids.uiScript.step.forEachElement",
186
+ fallback: "For each {{target}}"
187
+ },
188
+ {
189
+ key: "fluidgrids.uiScript.step.while",
190
+ fallback: "While {{condition}}, at most {{max}} times"
191
+ },
192
+ {
193
+ key: "fluidgrids.uiScript.step.whileElement",
194
+ fallback: "While {{target}} is there, at most {{max}} times"
195
+ },
196
+ {
197
+ key: "fluidgrids.uiScript.step.retryScope",
198
+ fallback: "Try up to {{attempts}} times"
199
+ },
200
+ {
201
+ key: "fluidgrids.uiScript.step.set",
202
+ fallback: "Set {{name}} to {{value}}"
203
+ },
204
+ {
205
+ key: "fluidgrids.uiScript.step.log",
206
+ fallback: "Log {{value}}"
207
+ },
208
+ {
209
+ key: "fluidgrids.uiScript.step.call",
210
+ fallback: "Run the shared sequence {{sequence}}"
211
+ }
212
+ ];
213
+ const UI_SCRIPT_PROBLEM_TEXTS = [
214
+ {
215
+ key: "fluidgrids.builder.uiScript.problem.fixedWait",
216
+ fallback: "Step {{step}} waits a fixed {{milliseconds}} ms. Wait for an element, a text or an address instead, so the step neither fails on a slow page nor wastes time on a fast one."
217
+ },
218
+ {
219
+ key: "fluidgrids.builder.uiScript.problem.singleMethodTarget",
220
+ fallback: "Step {{step}} finds {{target}} by one method only. Add another method so a page change does not break the step."
221
+ },
222
+ {
223
+ key: "fluidgrids.builder.uiScript.problem.noEnabledMethod",
224
+ fallback: "Step {{step}} has every method of {{target}} switched off, so it can never find the element. Switch a method on."
225
+ },
226
+ {
227
+ key: "fluidgrids.builder.uiScript.problem.hardwareInput",
228
+ fallback: "Step {{step}} uses hardware input, which needs the browser window in front and the screen unlocked. Use automatic input unless the page refuses it."
229
+ },
230
+ {
231
+ key: "fluidgrids.builder.uiScript.problem.hardwareInputSettings",
232
+ fallback: "The script uses hardware input for every step, which needs the browser window in front and the screen unlocked. Use automatic input unless a page refuses it."
233
+ },
234
+ {
235
+ key: "fluidgrids.builder.uiScript.problem.unknownVariable",
236
+ fallback: "Step {{step}} reads {{name}}, but no step sets it and the script does not declare it, so it is empty when the step runs."
237
+ },
238
+ {
239
+ key: "fluidgrids.builder.uiScript.problem.unknownVariableOutput",
240
+ fallback: "The output {{output}} reads {{name}}, but no step sets it and the script does not declare it, so the output is always empty."
241
+ },
242
+ {
243
+ key: "fluidgrids.builder.uiScript.problem.unknownVariableInitial",
244
+ fallback: "The initial value of the variable {{variable}} reads {{name}}, but no step sets it and the script does not declare it, so it reads as empty."
245
+ },
246
+ {
247
+ key: "fluidgrids.builder.uiScript.problem.unknownVariableDefault",
248
+ fallback: "The default of the input {{input}} reads {{name}}, but no step sets it and the script does not declare it, so it reads as empty."
249
+ },
250
+ {
251
+ key: "fluidgrids.builder.uiScript.problem.maskedValue",
252
+ fallback: "Step {{step}} types a value that was hidden during recording. Give it a value, such as a workflow input, or the run stops at this step."
253
+ },
254
+ {
255
+ key: "fluidgrids.builder.uiScript.problem.typeWithoutValue",
256
+ fallback: "Step {{step}} has no value to type, so it types nothing. Give it a value or remove the step."
257
+ },
258
+ {
259
+ key: "fluidgrids.builder.uiScript.problem.noCleanup",
260
+ fallback: "The script signs in at step {{step}} but has no clean-up steps. Add clean-up steps that sign out or close the tab, so a failed run does not leave the session open."
261
+ },
262
+ {
263
+ key: "fluidgrids.builder.uiScript.problem.plainTextSecret",
264
+ fallback: "Step {{step}} types into {{target}}, which looks like a password or code field, with a plain Type step. Use Type secret with a connection so the value is never stored or shown."
265
+ },
266
+ {
267
+ key: "fluidgrids.builder.uiScript.problem.secretOrigin",
268
+ fallback: "Step {{step}} types a secret without an expected site. Set the site the secret may be typed into, so it is never typed into another page."
269
+ },
270
+ {
271
+ key: "fluidgrids.builder.uiScript.problem.sensitiveScreenshot",
272
+ fallback: "Step {{step}} signs in or types a secret and takes a screenshot every time it runs. Take screenshots of this step on failure only."
273
+ },
274
+ {
275
+ key: "fluidgrids.builder.uiScript.problem.sensitiveScreenshotSettings",
276
+ fallback: "The script takes a screenshot of every step, including step {{step}}, which signs in or types a secret. Take screenshots on failure only, or turn them off for that step."
277
+ },
278
+ {
279
+ key: "fluidgrids.builder.uiScript.problem.inlineTarget",
280
+ fallback: "Step {{step}} uses an inline target. Add it to the Element library so other workflows can reuse it."
281
+ },
282
+ {
283
+ key: "fluidgrids.builder.uiScript.problem.unusedValue",
284
+ fallback: "Step {{step}} stores {{name}}, but no step, output or later node reads it."
285
+ },
286
+ {
287
+ key: "fluidgrids.builder.uiScript.problem.unusedVariable",
288
+ fallback: "The variable {{name}} is declared, but no step reads it."
289
+ },
290
+ {
291
+ key: "fluidgrids.builder.uiScript.problem.healConsequential",
292
+ fallback: "Step {{step}} acts on {{target}}, which looks like a {{consequence}} control. If healing finds a new target for it, a person must approve the change before the step runs."
293
+ },
294
+ {
295
+ key: "fluidgrids.builder.uiScript.problem.healAlwaysAskKeyword",
296
+ fallback: "Step {{step}} acts on {{target}}, which matches the always-ask phrase {{keyword}}. If healing finds a new target for it, a person must approve the change before the step runs."
297
+ },
298
+ {
299
+ key: "fluidgrids.builder.uiScript.problem.popupHandlerFlow",
300
+ fallback: "Pop-up handler step {{step}} is a {{action}} block. A handler is a short, straight list of steps, so it can never loop."
301
+ },
302
+ {
303
+ key: "fluidgrids.builder.uiScript.problem.popupHandlerAction",
304
+ fallback: "Pop-up handler step {{step}} uses {{action}}. A handler may only click, check, press keys, hover, scroll or wait."
305
+ },
306
+ {
307
+ key: "fluidgrids.builder.uiScript.problem.popupHandlerConsequential",
308
+ fallback: "Pop-up handler step {{step}} acts on {{target}}, which looks like a {{consequence}} control. A handler never acts on such a control."
309
+ },
310
+ {
311
+ key: "fluidgrids.builder.uiScript.problem.popupHandlerWait",
312
+ fallback: "Pop-up handler step {{step}} waits {{milliseconds}} ms. A handler step waits at most 5,000 ms, so a pop-up never holds up a run."
313
+ },
314
+ {
315
+ key: "fluidgrids.builder.uiScript.problem.popupHandlerNoAction",
316
+ fallback: "The pop-up handler has no step that clicks, checks or presses a key, so it cannot clear the pop-up."
317
+ }
318
+ ];
319
+ /** Why a script cannot run, by `UiScriptError` code (the engine's `parseUiScript`). */
320
+ const UI_SCRIPT_PARSE_ERROR_TEXTS = [
321
+ {
322
+ key: "fluidgrids.builder.uiScript.invalid.noSteps",
323
+ fallback: "Add a step: a Use Browser node runs at least one step."
324
+ },
325
+ {
326
+ key: "fluidgrids.builder.uiScript.invalid.INVALID_SCRIPT",
327
+ fallback: "This script cannot run yet: {{detail}}"
328
+ },
329
+ {
330
+ key: "fluidgrids.builder.uiScript.invalid.SCRIPT_TOO_LARGE",
331
+ fallback: "The script is larger than 1 MiB. Split it or move steps into a shared sequence."
332
+ },
333
+ {
334
+ key: "fluidgrids.builder.uiScript.invalid.TOO_MANY_STEPS",
335
+ fallback: "The script has more than 500 steps, counting steps inside blocks and clean-up steps."
336
+ },
337
+ {
338
+ key: "fluidgrids.builder.uiScript.invalid.DUPLICATE_STEP_ID",
339
+ fallback: "Two steps share the id at {{where}}. Each step needs its own id."
340
+ },
341
+ {
342
+ key: "fluidgrids.builder.uiScript.invalid.UNKNOWN_ELEMENT",
343
+ fallback: "A step at {{where}} uses a library element the script does not pin."
344
+ },
345
+ {
346
+ key: "fluidgrids.builder.uiScript.invalid.UNKNOWN_INPUT",
347
+ fallback: "A value at {{where}} reads an input the script does not declare."
348
+ },
349
+ {
350
+ key: "fluidgrids.builder.uiScript.invalid.FINGERPRINT_MISMATCH",
351
+ fallback: "The recorded target of the step at {{where}} was changed outside the editor. Record or pick it again."
352
+ },
353
+ {
354
+ key: "fluidgrids.builder.uiScript.invalid.CREDENTIAL_IN_SCRIPT",
355
+ fallback: "The script holds what looks like a password or key at {{where}}. Use a Type secret step with a connection instead."
356
+ },
357
+ {
358
+ key: "fluidgrids.builder.uiScript.invalid.UNRESOLVED",
359
+ fallback: "The script at {{where}} is not complete yet."
360
+ }
361
+ ];
362
+ /** The actions the step editor offers, by action, in the order of its menu. */
363
+ const UI_STEP_ACTION_TEXTS = [
364
+ {
365
+ action: "navigate",
366
+ key: "fluidgrids.builder.uiScript.action.navigate",
367
+ fallback: "Go to a page"
368
+ },
369
+ {
370
+ action: "click",
371
+ key: "fluidgrids.builder.uiScript.action.click",
372
+ fallback: "Click"
373
+ },
374
+ {
375
+ action: "type",
376
+ key: "fluidgrids.builder.uiScript.action.type",
377
+ fallback: "Type text"
378
+ },
379
+ {
380
+ action: "typeSecret",
381
+ key: "fluidgrids.builder.uiScript.action.typeSecret",
382
+ fallback: "Type a secret"
383
+ },
384
+ {
385
+ action: "select",
386
+ key: "fluidgrids.builder.uiScript.action.select",
387
+ fallback: "Choose an option"
388
+ },
389
+ {
390
+ action: "check",
391
+ key: "fluidgrids.builder.uiScript.action.check",
392
+ fallback: "Tick a box"
393
+ },
394
+ {
395
+ action: "pressKey",
396
+ key: "fluidgrids.builder.uiScript.action.pressKey",
397
+ fallback: "Press keys"
398
+ },
399
+ {
400
+ action: "waitFor",
401
+ key: "fluidgrids.builder.uiScript.action.waitFor",
402
+ fallback: "Wait for"
403
+ },
404
+ {
405
+ action: "getText",
406
+ key: "fluidgrids.builder.uiScript.action.getText",
407
+ fallback: "Read text"
408
+ },
409
+ {
410
+ action: "getValue",
411
+ key: "fluidgrids.builder.uiScript.action.getValue",
412
+ fallback: "Read a field's value"
413
+ },
414
+ {
415
+ action: "getAttribute",
416
+ key: "fluidgrids.builder.uiScript.action.getAttribute",
417
+ fallback: "Read an attribute"
418
+ },
419
+ {
420
+ action: "extract",
421
+ key: "fluidgrids.builder.uiScript.action.extract",
422
+ fallback: "Read several fields"
423
+ },
424
+ {
425
+ action: "extractList",
426
+ key: "fluidgrids.builder.uiScript.action.extractList",
427
+ fallback: "Read a list"
428
+ },
429
+ {
430
+ action: "elementExists",
431
+ key: "fluidgrids.builder.uiScript.action.elementExists",
432
+ fallback: "Check an element is there"
433
+ },
434
+ {
435
+ action: "doubleClick",
436
+ key: "fluidgrids.builder.uiScript.action.doubleClick",
437
+ fallback: "Double-click"
438
+ },
439
+ {
440
+ action: "hover",
441
+ key: "fluidgrids.builder.uiScript.action.hover",
442
+ fallback: "Point at"
443
+ },
444
+ {
445
+ action: "clear",
446
+ key: "fluidgrids.builder.uiScript.action.clear",
447
+ fallback: "Clear a field"
448
+ },
449
+ {
450
+ action: "scroll",
451
+ key: "fluidgrids.builder.uiScript.action.scroll",
452
+ fallback: "Scroll"
453
+ },
454
+ {
455
+ action: "screenshot",
456
+ key: "fluidgrids.builder.uiScript.action.screenshot",
457
+ fallback: "Take a screenshot"
458
+ },
459
+ {
460
+ action: "getPageText",
461
+ key: "fluidgrids.builder.uiScript.action.getPageText",
462
+ fallback: "Read the page text"
463
+ },
464
+ {
465
+ action: "getPageHtml",
466
+ key: "fluidgrids.builder.uiScript.action.getPageHtml",
467
+ fallback: "Read the page HTML"
468
+ },
469
+ {
470
+ action: "goBack",
471
+ key: "fluidgrids.builder.uiScript.action.goBack",
472
+ fallback: "Go back"
473
+ },
474
+ {
475
+ action: "reload",
476
+ key: "fluidgrids.builder.uiScript.action.reload",
477
+ fallback: "Reload the page"
478
+ },
479
+ {
480
+ action: "closeTab",
481
+ key: "fluidgrids.builder.uiScript.action.closeTab",
482
+ fallback: "Close the tab"
483
+ },
484
+ {
485
+ action: "login",
486
+ key: "fluidgrids.builder.uiScript.action.login",
487
+ fallback: "Sign in"
488
+ },
489
+ {
490
+ action: "if",
491
+ key: "fluidgrids.builder.uiScript.action.if",
492
+ fallback: "If (condition)"
493
+ },
494
+ {
495
+ action: "forEach",
496
+ key: "fluidgrids.builder.uiScript.action.forEach",
497
+ fallback: "For each (loop)"
498
+ },
499
+ {
500
+ action: "while",
501
+ key: "fluidgrids.builder.uiScript.action.while",
502
+ fallback: "While (loop)"
503
+ },
504
+ {
505
+ action: "retryScope",
506
+ key: "fluidgrids.builder.uiScript.action.retryScope",
507
+ fallback: "Try again (retry block)"
508
+ },
509
+ {
510
+ action: "set",
511
+ key: "fluidgrids.builder.uiScript.action.set",
512
+ fallback: "Set a variable"
513
+ },
514
+ {
515
+ action: "log",
516
+ key: "fluidgrids.builder.uiScript.action.log",
517
+ fallback: "Write to the log"
518
+ },
519
+ {
520
+ action: "call",
521
+ key: "fluidgrids.builder.uiScript.action.call",
522
+ fallback: "Run a shared sequence"
523
+ }
524
+ ];
525
+ /** The table entry of a key, or undefined. */
526
+ function uiMessageOf(table, key) {
527
+ return table.find((message) => message.key === key);
528
+ }
529
+
530
+ // src/builder/lib/ui-script.ts
531
+ /**
532
+ * The UI script of a Use Browser node as the step editor reads and writes it
533
+ * (RPA plan P1-11): parsing and serialising the setting, the step tree
534
+ * operations (add, move, remove, duplicate, replace), the problems shown
535
+ * under the editor and the step sentences.
536
+ *
537
+ * The editor works on a **draft**: the stored JSON as it is, which may not be
538
+ * a valid UI script while someone is still filling in a step. The engine's
539
+ * `parseUiScript` says what still keeps the script from running, and its
540
+ * analyzer adds advice once it parses. The analyzer's warnings never block a
541
+ * save (spec 19, M1). The workflow service refuses a script that does not
542
+ * parse, so a node's editor writes a draft back only once it parses
543
+ * (`isSavableUiScript`, BOFF-17971) and holds it until then; the flow store
544
+ * keeps the undo history of what was written.
545
+ *
546
+ * Step paths are the engine's (`walkSteps`): `"2"` is the third top-level
547
+ * step, `"2.then.0"` the first step of its `then` block and `"cleanup.0"` the
548
+ * first clean-up step. Run step and the step events use the same paths.
549
+ *
550
+ * This module loads `@burdenoff/ui-engine` at run time, so only the lazily
551
+ * loaded step editor may import it (`src/tooling/check-builder-chunks.ts`).
552
+ */
553
+ var ui_script_exports = /* @__PURE__ */ __exportAll({
554
+ CLEANUP_BLOCK: () => CLEANUP_BLOCK,
555
+ MAIN_BLOCK: () => "",
556
+ STEP_BLOCKS: () => STEP_BLOCKS,
557
+ actionText: () => actionText,
558
+ blockSteps: () => blockSteps,
559
+ changeStepAction: () => changeStepAction,
560
+ draftElements: () => draftElements,
561
+ duplicateStep: () => duplicateStep,
562
+ emptyUiScript: () => emptyUiScript,
563
+ insertStep: () => insertStep,
564
+ isBlockAction: () => isBlockAction,
565
+ isDraftStep: () => isDraftStep,
566
+ isEmptyUiScript: () => isEmptyUiScript,
567
+ isSavableUiScript: () => isSavableUiScript,
568
+ moveStep: () => moveStep,
569
+ newStep: () => newStep,
570
+ newStepFields: () => newStepFields,
571
+ newStepId: () => newStepId,
572
+ parsedUiScript: () => parsedUiScript,
573
+ readUiScriptSetting: () => readUiScriptSetting,
574
+ readableStepNumber: () => readableStepNumber,
575
+ removeStep: () => removeStep,
576
+ renameScriptInput: () => renameScriptInput,
577
+ replaceStep: () => replaceStep,
578
+ serialiseUiScript: () => serialiseUiScript,
579
+ setStepField: () => setStepField,
580
+ splitStepPath: () => splitStepPath,
581
+ stepAtPath: () => stepAtPath,
582
+ stepIds: () => stepIds,
583
+ stepPathIn: () => stepPathIn,
584
+ stepSentence: () => stepSentence,
585
+ uiScriptProblems: () => uiScriptProblems,
586
+ uiScriptText: () => uiScriptText,
587
+ updateBlock: () => updateBlock,
588
+ updateStep: () => updateStep,
589
+ walkDraft: () => walkDraft
590
+ });
591
+ /** The blocks a flow step holds, by action (the engine's `childBlocks`). */
592
+ const STEP_BLOCKS = {
593
+ if: ["then", "else"],
594
+ forEach: ["steps"],
595
+ while: ["steps"],
596
+ retryScope: ["steps"]
597
+ };
598
+ /** Flow actions whose steps sit in blocks. */
599
+ function isBlockAction(action) {
600
+ return action in STEP_BLOCKS;
601
+ }
602
+ function isRecord(value) {
603
+ return typeof value === "object" && value !== null && !Array.isArray(value);
604
+ }
605
+ /** Whether a value is a step of a draft: an object with an action. */
606
+ function isDraftStep(value) {
607
+ return isRecord(value) && typeof value.action === "string";
608
+ }
609
+ function isStepList(value) {
610
+ return Array.isArray(value) && value.every(isDraftStep);
611
+ }
612
+ /** An empty script: what a new Use Browser node starts with. */
613
+ function emptyUiScript() {
614
+ return {
615
+ scriptVersion: 1,
616
+ steps: []
617
+ };
618
+ }
619
+ /**
620
+ * The stored setting as a draft: an object, or its JSON text; nothing stored
621
+ * yet is an empty script. Null when the value is not script-shaped (not an
622
+ * object with a `steps` list of steps), so the editor opens it as JSON and
623
+ * nothing a person typed is lost.
624
+ */
625
+ function readUiScriptSetting(value) {
626
+ let parsed = value;
627
+ if (value === void 0 || value === null) return emptyUiScript();
628
+ if (typeof value === "string") {
629
+ if (!value.trim()) return emptyUiScript();
630
+ try {
631
+ parsed = JSON.parse(value);
632
+ } catch {
633
+ return null;
634
+ }
635
+ }
636
+ if (!isRecord(parsed) || !isStepList(parsed.steps)) return null;
637
+ if (parsed.scriptVersion !== void 0 && parsed.scriptVersion !== 1) return null;
638
+ if (parsed.cleanup !== void 0 && !isStepList(parsed.cleanup)) return null;
639
+ return {
640
+ ...parsed,
641
+ scriptVersion: 1
642
+ };
643
+ }
644
+ /**
645
+ * The draft in the representation the setting already uses: JSON text stays
646
+ * text (indented, as the editor shows it), anything else is written as an
647
+ * object, which is what the manifest declares.
648
+ */
649
+ function serialiseUiScript(draft, previous) {
650
+ return typeof previous === "string" ? JSON.stringify(draft, null, 2) : draft;
651
+ }
652
+ /** The setting as JSON text, for the JSON view. */
653
+ function uiScriptText(value) {
654
+ if (value === void 0 || value === null) return "";
655
+ if (typeof value === "string") return value;
656
+ return JSON.stringify(value, null, 2);
657
+ }
658
+ const MAIN_BLOCK = "";
659
+ const CLEANUP_BLOCK = "cleanup";
660
+ /** The path of the step at `index` in a block. */
661
+ function stepPathIn(block, index) {
662
+ return block === "" ? String(index) : `${block}.${index}`;
663
+ }
664
+ /** The block a step path sits in and its index there, or null for a malformed path. */
665
+ function splitStepPath(path) {
666
+ const cut = path.lastIndexOf(".");
667
+ const block = cut < 0 ? "" : path.slice(0, cut);
668
+ const last = cut < 0 ? path : path.slice(cut + 1);
669
+ if (!/^\d+$/.test(last)) return null;
670
+ return {
671
+ block,
672
+ index: Number(last)
673
+ };
674
+ }
675
+ function splitBlockRef(block) {
676
+ const cut = block.lastIndexOf(".");
677
+ if (cut < 0) return null;
678
+ return {
679
+ stepPath: block.slice(0, cut),
680
+ name: block.slice(cut + 1)
681
+ };
682
+ }
683
+ /** The steps of a block, or undefined when the block does not exist. */
684
+ function blockSteps(draft, block) {
685
+ if (block === "") return draft.steps;
686
+ if (block === "cleanup") return isStepList(draft.cleanup) ? draft.cleanup : [];
687
+ const ref = splitBlockRef(block);
688
+ if (!ref) return void 0;
689
+ const owner = stepAtPath(draft, ref.stepPath);
690
+ if (!owner || !(STEP_BLOCKS[owner.action] ?? []).includes(ref.name)) return void 0;
691
+ const steps = owner[ref.name];
692
+ return isStepList(steps) ? steps : [];
693
+ }
694
+ /** The step at a path, or undefined. */
695
+ function stepAtPath(draft, path) {
696
+ const at = splitStepPath(path);
697
+ if (!at) return void 0;
698
+ return blockSteps(draft, at.block)?.[at.index];
699
+ }
700
+ /** Optional blocks that are dropped when they become empty. */
701
+ function dropsWhenEmpty(block) {
702
+ return block === "cleanup" || block.endsWith(".else");
703
+ }
704
+ /** The draft with one block's steps replaced; an unknown block leaves it unchanged. */
705
+ function updateBlock(draft, block, update) {
706
+ const current = blockSteps(draft, block);
707
+ if (!current) return draft;
708
+ const next = update(current);
709
+ if (block === "") return {
710
+ ...draft,
711
+ steps: next
712
+ };
713
+ if (block === "cleanup") {
714
+ const copy = { ...draft };
715
+ if (next.length === 0) delete copy.cleanup;
716
+ else copy.cleanup = next;
717
+ return copy;
718
+ }
719
+ const ref = splitBlockRef(block);
720
+ if (!ref) return draft;
721
+ return updateStep(draft, ref.stepPath, (owner) => {
722
+ const copy = { ...owner };
723
+ if (next.length === 0 && dropsWhenEmpty(block)) delete copy[ref.name];
724
+ else copy[ref.name] = next;
725
+ return copy;
726
+ });
727
+ }
728
+ /** The draft with one step replaced through `update`. */
729
+ function updateStep(draft, path, update) {
730
+ const at = splitStepPath(path);
731
+ if (!at) return draft;
732
+ return updateBlock(draft, at.block, (steps) => at.index < steps.length ? steps.map((step, index) => index === at.index ? update(step) : step) : steps);
733
+ }
734
+ /** Every step of the draft with its path and depth, in the engine's walk order. */
735
+ function walkDraft(draft) {
736
+ const out = [];
737
+ const visit = (steps, block, depth) => {
738
+ steps.forEach((step, index) => {
739
+ const path = stepPathIn(block, index);
740
+ out.push({
741
+ step,
742
+ path,
743
+ depth
744
+ });
745
+ for (const name of STEP_BLOCKS[step.action] ?? []) {
746
+ const nested = step[name];
747
+ if (isStepList(nested)) visit(nested, `${path}.${name}`, depth + 1);
748
+ }
749
+ });
750
+ };
751
+ visit(draft.steps, "", 0);
752
+ if (isStepList(draft.cleanup)) visit(draft.cleanup, CLEANUP_BLOCK, 0);
753
+ return out;
754
+ }
755
+ /** The ids every step of the draft uses. */
756
+ function stepIds(draft) {
757
+ const ids = /* @__PURE__ */ new Set();
758
+ for (const { step } of walkDraft(draft)) if (typeof step.id === "string") ids.add(step.id);
759
+ return ids;
760
+ }
761
+ /** A step id the draft does not use yet: `s1`, `s2`, … */
762
+ function newStepId(used) {
763
+ for (let n = used.size + 1;; n++) {
764
+ const id = `s${n}`;
765
+ if (!used.has(id)) return id;
766
+ }
767
+ }
768
+ /** The fields a new step of an action starts with (the editor's defaults). */
769
+ function newStepFields(action) {
770
+ const target = { methods: [] };
771
+ switch (action) {
772
+ case "navigate": return { url: "" };
773
+ case "click":
774
+ case "doubleClick":
775
+ case "hover":
776
+ case "clear":
777
+ case "getText":
778
+ case "getValue":
779
+ case "elementExists":
780
+ case "waitFor": return { target };
781
+ case "type": return {
782
+ target,
783
+ text: ""
784
+ };
785
+ case "typeSecret": return {
786
+ target,
787
+ secretRef: ""
788
+ };
789
+ case "select": return {
790
+ target,
791
+ values: [""]
792
+ };
793
+ case "check": return {
794
+ target,
795
+ checked: true
796
+ };
797
+ case "getAttribute": return {
798
+ target,
799
+ attribute: "href"
800
+ };
801
+ case "pressKey": return { keys: ["Enter"] };
802
+ case "scroll": return { to: "bottom" };
803
+ case "extract": return { fields: [{
804
+ name: "value",
805
+ target
806
+ }] };
807
+ case "extractList": return {
808
+ item: target,
809
+ fields: [{
810
+ name: "value",
811
+ target
812
+ }]
813
+ };
814
+ case "if": return {
815
+ condition: true,
816
+ then: []
817
+ };
818
+ case "forEach": return {
819
+ in: { list: [] },
820
+ as: "item",
821
+ steps: []
822
+ };
823
+ case "while": return {
824
+ condition: false,
825
+ maxIterations: 10,
826
+ steps: []
827
+ };
828
+ case "retryScope": return {
829
+ attempts: 2,
830
+ steps: []
831
+ };
832
+ case "set": return {
833
+ name: "value",
834
+ value: ""
835
+ };
836
+ case "log": return { message: "" };
837
+ case "call": return {
838
+ sequenceId: "",
839
+ version: 1
840
+ };
841
+ default: return {};
842
+ }
843
+ }
844
+ /** A new step of an action with an id the draft does not use. */
845
+ function newStep(action, draft) {
846
+ return {
847
+ id: newStepId(stepIds(draft)),
848
+ action,
849
+ ...newStepFields(action)
850
+ };
851
+ }
852
+ /** The draft with `step` inserted at `index` of a block. */
853
+ function insertStep(draft, block, index, step) {
854
+ return updateBlock(draft, block, (steps) => {
855
+ const next = steps.slice();
856
+ next.splice(Math.max(0, Math.min(index, next.length)), 0, step);
857
+ return next;
858
+ });
859
+ }
860
+ /** The draft without the step at `path` (and the steps inside it). */
861
+ function removeStep(draft, path) {
862
+ const at = splitStepPath(path);
863
+ if (!at) return draft;
864
+ return updateBlock(draft, at.block, (steps) => steps.filter((_, index) => index !== at.index));
865
+ }
866
+ /**
867
+ * The draft with the step at `path` moved `delta` places within its block.
868
+ * Returns the same draft when it cannot move that far.
869
+ */
870
+ function moveStep(draft, path, delta) {
871
+ const at = splitStepPath(path);
872
+ const steps = at ? blockSteps(draft, at.block) : void 0;
873
+ if (!at || !steps) return draft;
874
+ const to = at.index + delta;
875
+ if (to < 0 || to >= steps.length || at.index >= steps.length) return draft;
876
+ return updateBlock(draft, at.block, (current) => {
877
+ const next = current.slice();
878
+ const [moved] = next.splice(at.index, 1);
879
+ if (moved) next.splice(to, 0, moved);
880
+ return next;
881
+ });
882
+ }
883
+ /** A copy of a step and every step inside it, with ids the draft does not use. */
884
+ function withFreshIds(step, used) {
885
+ const copy = { ...step };
886
+ const id = newStepId(used);
887
+ used.add(id);
888
+ copy.id = id;
889
+ delete copy.fingerprint;
890
+ for (const name of STEP_BLOCKS[step.action] ?? []) {
891
+ const nested = step[name];
892
+ if (isStepList(nested)) copy[name] = nested.map((inner) => withFreshIds(inner, used));
893
+ }
894
+ return copy;
895
+ }
896
+ /** The draft with a copy of the step at `path` right after it. */
897
+ function duplicateStep(draft, path) {
898
+ const at = splitStepPath(path);
899
+ const step = stepAtPath(draft, path);
900
+ if (!at || !step) return draft;
901
+ const copy = withFreshIds(step, stepIds(draft));
902
+ return insertStep(draft, at.block, at.index + 1, copy);
903
+ }
904
+ /** The draft with the step at `path` replaced. */
905
+ function replaceStep(draft, path, step) {
906
+ return updateStep(draft, path, () => step);
907
+ }
908
+ /**
909
+ * The step with one field set, or removed when `value` is undefined. A
910
+ * changed target or value invalidates the recorded fingerprint, which the
911
+ * engine would otherwise refuse (`FINGERPRINT_MISMATCH`).
912
+ */
913
+ function setStepField(step, field, value) {
914
+ const copy = { ...step };
915
+ if (value === void 0) delete copy[field];
916
+ else copy[field] = value;
917
+ if (field !== "fingerprint" && copy.fingerprint !== void 0) delete copy.fingerprint;
918
+ return copy;
919
+ }
920
+ /** The step turned into another action, keeping the common options and the target. */
921
+ function changeStepAction(step, action) {
922
+ if (step.action === action) return step;
923
+ const kept = {};
924
+ for (const key of [
925
+ "id",
926
+ "intent",
927
+ "note",
928
+ "saveAs",
929
+ "disabled",
930
+ "breakpoint",
931
+ "timeoutMs",
932
+ "retry",
933
+ "onError",
934
+ "screenshot",
935
+ "inputMethod"
936
+ ]) if (step[key] !== void 0) kept[key] = step[key];
937
+ const fields = newStepFields(action);
938
+ if ("target" in fields && step.target !== void 0) fields.target = step.target;
939
+ return {
940
+ ...kept,
941
+ action,
942
+ ...fields
943
+ };
944
+ }
945
+ /** A copy of a value with every `{ input: from }` reference (with or without a path) renamed. */
946
+ function withInputRenamed(value, from, to) {
947
+ if (Array.isArray(value)) return value.map((item) => withInputRenamed(item, from, to));
948
+ if (!isRecord(value)) return value;
949
+ const keys = Object.keys(value);
950
+ if (value.input === from && keys.every((key) => key === "input" || key === "path")) return {
951
+ ...value,
952
+ input: to
953
+ };
954
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, withInputRenamed(item, from, to)]));
955
+ }
956
+ /**
957
+ * The draft with a script input renamed, and every expression that reads it
958
+ * (steps, clean-up steps, outputs, variables and input defaults) pointed at
959
+ * the new name.
960
+ */
961
+ function renameScriptInput(draft, from, to) {
962
+ if (from === to) return draft;
963
+ const next = { ...draft };
964
+ for (const [key, value] of Object.entries(draft)) if (key === "inputs" && Array.isArray(value)) next.inputs = value.map((input) => isRecord(input) ? {
965
+ ...input,
966
+ ...input.name === from ? { name: to } : {},
967
+ ...input.default !== void 0 ? { default: withInputRenamed(input.default, from, to) } : {}
968
+ } : input);
969
+ else if (key !== "scriptVersion") next[key] = withInputRenamed(value, from, to);
970
+ return next;
971
+ }
972
+ /** The number of a step as an author reads it (`"5.then.1"` reads `6.2`). */
973
+ function readableStepNumber(path) {
974
+ return stepNumber(path);
975
+ }
976
+ /** The pinned library elements of a draft, for step sentences. */
977
+ function draftElements(draft) {
978
+ const elements = draft.elements;
979
+ return isRecord(elements) ? elements : {};
980
+ }
981
+ /** The name of an action in the editor's menu, or the action itself. */
982
+ function actionText(action) {
983
+ const message = UI_STEP_ACTION_TEXTS.find((item) => item.action === action);
984
+ return message ? {
985
+ key: message.key,
986
+ fallback: message.fallback
987
+ } : {
988
+ key: "fluidgrids.builder.uiScript.action.unknown",
989
+ fallback: action
990
+ };
991
+ }
992
+ /**
993
+ * The step as a sentence ("Click "Search""), through the engine's
994
+ * `describeStep`. A step the engine cannot describe yet (an incomplete one)
995
+ * reads as its action's name.
996
+ */
997
+ function stepSentence(step, elements = {}) {
998
+ try {
999
+ const description = describeStep(step, elements);
1000
+ const template = uiMessageOf(UI_SCRIPT_STEP_TEXTS, description.key);
1001
+ return {
1002
+ key: description.key,
1003
+ fallback: template?.fallback ?? description.fallback,
1004
+ vars: description.vars
1005
+ };
1006
+ } catch {
1007
+ return actionText(step.action);
1008
+ }
1009
+ }
1010
+ /** Where a parse error points, as an author reads it. */
1011
+ function errorWhere(path) {
1012
+ if (!path) return "the script";
1013
+ const step = /^(?:steps\.)?((?:cleanup\.)?\d+(?:\.(?:then|else|steps)\.\d+)*)/.exec(path);
1014
+ if (step?.[1]) try {
1015
+ return `step ${stepNumber(step[1])}`;
1016
+ } catch {
1017
+ return path;
1018
+ }
1019
+ return path;
1020
+ }
1021
+ function stepPathOfError(path) {
1022
+ if (!path) return void 0;
1023
+ return /^(?:steps\.)?((?:cleanup\.)?\d+(?:\.(?:then|else|steps)\.\d+)*)/.exec(path)?.[1];
1024
+ }
1025
+ /**
1026
+ * Why the draft cannot run (at most one error: the first the engine finds),
1027
+ * then the analyzer's warnings and advice once it parses. Warnings never block
1028
+ * a save.
1029
+ */
1030
+ function uiScriptProblems(draft) {
1031
+ if (draft.steps.length === 0) return [{
1032
+ severity: "error",
1033
+ key: "fluidgrids.builder.uiScript.invalid.noSteps",
1034
+ fallback: uiMessageOf(UI_SCRIPT_PARSE_ERROR_TEXTS, "fluidgrids.builder.uiScript.invalid.noSteps")?.fallback ?? "Add a step."
1035
+ }];
1036
+ const parsed = safeParseUiScript(draft);
1037
+ if (!parsed.success) {
1038
+ const { code, message, path } = parsed.error;
1039
+ const template = uiMessageOf(UI_SCRIPT_PARSE_ERROR_TEXTS, `fluidgrids.builder.uiScript.invalid.${code}`);
1040
+ return [{
1041
+ severity: "error",
1042
+ key: template?.key ?? "fluidgrids.builder.uiScript.invalid.INVALID_SCRIPT",
1043
+ fallback: template?.fallback ?? "This script cannot run yet: {{detail}}",
1044
+ vars: {
1045
+ detail: message,
1046
+ where: errorWhere(path)
1047
+ },
1048
+ path: stepPathOfError(path)
1049
+ }];
1050
+ }
1051
+ return analyzeUiScript(parsed.script).map((problem) => {
1052
+ const template = uiMessageOf(UI_SCRIPT_PROBLEM_TEXTS, problem.messageKey);
1053
+ return {
1054
+ severity: problem.severity,
1055
+ key: problem.messageKey,
1056
+ fallback: template?.fallback ?? problem.message,
1057
+ vars: problem.vars,
1058
+ path: problem.path
1059
+ };
1060
+ });
1061
+ }
1062
+ /**
1063
+ * Whether the workflow service accepts this `script` setting when a workflow
1064
+ * holding it is saved (BOFF-17971): no script yet (nothing, or blank text),
1065
+ * or a script the engine's `parseUiScript` reads, as an object or as its JSON
1066
+ * text. The service refuses every other value and the builder then undoes
1067
+ * the whole change, so a node editor writes only values this accepts.
1068
+ */
1069
+ function isSavableUiScript(value) {
1070
+ if (value === void 0 || value === null) return true;
1071
+ if (typeof value === "string" && !value.trim()) return true;
1072
+ return safeParseUiScript(value).success;
1073
+ }
1074
+ /**
1075
+ * Whether a draft holds nothing: no steps, and no clean-up steps, inputs,
1076
+ * outputs, elements or other fields with content. A node stores such a draft
1077
+ * as no script at all, which the workflow service accepts (BOFF-17971).
1078
+ */
1079
+ function isEmptyUiScript(draft) {
1080
+ return Object.entries(draft).every(([key, item]) => {
1081
+ if (key === "scriptVersion") return true;
1082
+ if (item === void 0 || item === null) return true;
1083
+ if (Array.isArray(item)) return item.length === 0;
1084
+ if (isRecord(item)) return Object.keys(item).length === 0;
1085
+ return false;
1086
+ });
1087
+ }
1088
+ /** The draft as a UI script when it parses, else null. */
1089
+ function parsedUiScript(draft) {
1090
+ const parsed = safeParseUiScript(draft);
1091
+ return parsed.success ? parsed.script : null;
1092
+ }
1093
+
1094
+ export { walkDraft as A, stepAtPath as C, uiScriptProblems as D, stepSentence as E, uiScriptText as O, setStepField as S, stepPathIn as T, readableStepNumber as _, changeStepAction as a, replaceStep as b, emptyUiScript as c, isEmptyUiScript as d, isSavableUiScript as f, readUiScriptSetting as g, newStepId as h, blockSteps as i, UI_STEP_ACTION_TEXTS as j, ui_script_exports as k, insertStep as l, newStep as m, MAIN_BLOCK as n, draftElements as o, moveStep as p, STEP_BLOCKS as r, duplicateStep as s, CLEANUP_BLOCK as t, isDraftStep as u, removeStep as v, stepIds as w, serialiseUiScript as x, renameScriptInput as y };