@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,533 @@
1
+ "use client";
2
+ import { f as USE_BROWSER_NODE_TYPE, p as USE_BROWSER_SCRIPT_PARAMETER } from "./askQuestions-Cmx7VnMm.js";
3
+ import { v4 } from "uuid";
4
+
5
+ // src/builder/components/ndv/layering.ts
6
+ /**
7
+ * Stacking order for the node detail view. The dialog sits above the app
8
+ * shell's navbar so its header is never occluded; anything the dialog opens in
9
+ * a portal (the timezone picker's popover, for example) must sit above the
10
+ * dialog itself or it renders invisibly behind it.
11
+ */
12
+ const NDV_Z_INDEX = 1e3;
13
+ /** Portaled overlays opened from inside the node detail view. */
14
+ const NDV_OVERLAY_Z_INDEX = 1001;
15
+
16
+ // src/builder/lib/browser-steps.ts
17
+ /**
18
+ * The step list of the "Run in Browser" node (`internal:browser-action`) and the
19
+ * captured fields of the Browser Extension trigger (`internal:browser-extension`),
20
+ * as the builder's structured editors read and write them (BOFF-14550).
21
+ *
22
+ * Shapes, as fluidgrids-workers validates them (`validateBrowserSteps` in
23
+ * `src/internalnodes/services/browser-action.ts`) and the browser extension runs
24
+ * them (`src/core/browser-runner/page-steps.ts`):
25
+ *
26
+ * step = { action, name?, ...parameters of the action }
27
+ * field = { name, selector, attribute?: string | null, multiple?: boolean }
28
+ *
29
+ * Both settings are saved either as JSON text (what the manifests' text inputs
30
+ * hold) or as an array. The editors keep the representation they were given
31
+ * (text stays text, an array stays an array) and every key they do not edit
32
+ * (for example the recorder's `note` on a password step), so saved workflows
33
+ * load unchanged.
34
+ *
35
+ * The checks mirror the worker so a person sees a mistake while editing; the
36
+ * worker checks the resolved steps again when the node runs. A value holding an
37
+ * expression (`${...}` or `{{...}}`) is only known at run time, so it passes the
38
+ * URL check here.
39
+ */
40
+ const BROWSER_ACTION_NODE_TYPE = "internal:browser-action";
41
+ const BROWSER_STEPS_PARAMETER = "steps";
42
+ const BROWSER_EXTENSION_TRIGGER_NODE_TYPE = "internal:browser-extension";
43
+ const BROWSER_TRIGGER_FIELDS_PARAMETER = "fields";
44
+ const BROWSER_TRIGGER_INPUT_FORM_PARAMETER = "inputForm";
45
+ /**
46
+ * Which structured editor a node parameter gets, if any. `uiScript` is the
47
+ * Use Browser node's step editor (RPA plan P1-11).
48
+ */
49
+ function browserParameterEditor(nodeType, parameter) {
50
+ if (nodeType === "internal:use-browser" && parameter === "script") return "uiScript";
51
+ if (nodeType === "internal:browser-action" && parameter === "steps") return "steps";
52
+ if (nodeType !== "internal:browser-extension") return null;
53
+ if (parameter === "fields") return "fields";
54
+ if (parameter === "inputForm") return "inputForm";
55
+ return null;
56
+ }
57
+ /** Most steps one node may send (the worker and the service refuse more). */
58
+ const MAX_BROWSER_STEPS = 100;
59
+ const SELECTOR = {
60
+ key: "selector",
61
+ kind: "text",
62
+ label: "CSS selector",
63
+ placeholder: "#search, .price, button[type=submit]",
64
+ expression: true
65
+ };
66
+ const TEXT_MATCH = {
67
+ key: "text",
68
+ kind: "text",
69
+ label: "or visible text",
70
+ placeholder: "Sign in",
71
+ expression: true
72
+ };
73
+ /** Every action, in the order the editor offers them (the design's order). */
74
+ const BROWSER_STEP_ACTIONS = [
75
+ {
76
+ action: "navigate",
77
+ label: "Go to a page",
78
+ params: [{
79
+ key: "url",
80
+ kind: "text",
81
+ label: "URL",
82
+ placeholder: "https://example.com",
83
+ expression: true
84
+ }]
85
+ },
86
+ {
87
+ action: "waitFor",
88
+ label: "Wait for an element",
89
+ params: [
90
+ SELECTOR,
91
+ TEXT_MATCH,
92
+ {
93
+ key: "timeoutMs",
94
+ kind: "number",
95
+ label: "Timeout (ms)",
96
+ placeholder: "10000"
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ action: "click",
102
+ label: "Click",
103
+ params: [SELECTOR, TEXT_MATCH]
104
+ },
105
+ {
106
+ action: "type",
107
+ label: "Type text",
108
+ params: [
109
+ SELECTOR,
110
+ {
111
+ key: "value",
112
+ kind: "text",
113
+ label: "Text",
114
+ placeholder: "Text or ${output.field}",
115
+ expression: true
116
+ },
117
+ {
118
+ key: "clear",
119
+ kind: "boolean",
120
+ label: "Clear the field first",
121
+ defaultChecked: true
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ action: "select",
127
+ label: "Choose an option",
128
+ params: [SELECTOR, {
129
+ key: "value",
130
+ kind: "text",
131
+ label: "Option value",
132
+ expression: true
133
+ }]
134
+ },
135
+ {
136
+ action: "check",
137
+ label: "Tick a checkbox",
138
+ params: [SELECTOR, {
139
+ key: "checked",
140
+ kind: "boolean",
141
+ label: "Ticked",
142
+ defaultChecked: true
143
+ }]
144
+ },
145
+ {
146
+ action: "pressKey",
147
+ label: "Press a key",
148
+ params: [{
149
+ key: "key",
150
+ kind: "text",
151
+ label: "Key",
152
+ placeholder: "Enter, Escape, Tab"
153
+ }]
154
+ },
155
+ {
156
+ action: "scroll",
157
+ label: "Scroll",
158
+ params: [{
159
+ key: "to",
160
+ kind: "choice",
161
+ label: "To",
162
+ options: ["bottom", "top"]
163
+ }, {
164
+ ...SELECTOR,
165
+ label: "or to an element"
166
+ }]
167
+ },
168
+ {
169
+ action: "extract",
170
+ label: "Read fields",
171
+ params: [],
172
+ fields: true
173
+ },
174
+ {
175
+ action: "extractList",
176
+ label: "Read a list",
177
+ fields: true,
178
+ params: [
179
+ {
180
+ key: "itemSelector",
181
+ kind: "text",
182
+ label: "Item selector",
183
+ placeholder: ".result, table tr"
184
+ },
185
+ {
186
+ key: "maxItems",
187
+ kind: "number",
188
+ label: "Most items",
189
+ placeholder: "100"
190
+ },
191
+ {
192
+ key: "paginateSelector",
193
+ kind: "text",
194
+ label: "Next page button (optional)",
195
+ placeholder: "a.next"
196
+ },
197
+ {
198
+ key: "maxPages",
199
+ kind: "number",
200
+ label: "Most pages",
201
+ placeholder: "1"
202
+ }
203
+ ]
204
+ },
205
+ {
206
+ action: "getPageText",
207
+ label: "Read the page text",
208
+ params: []
209
+ },
210
+ {
211
+ action: "getPageHtml",
212
+ label: "Read the page HTML",
213
+ params: []
214
+ },
215
+ {
216
+ action: "screenshot",
217
+ label: "Take a screenshot",
218
+ params: [{
219
+ key: "fullPage",
220
+ kind: "boolean",
221
+ label: "Whole page",
222
+ defaultChecked: false
223
+ }]
224
+ },
225
+ {
226
+ action: "closeTab",
227
+ label: "Close the tab",
228
+ params: []
229
+ }
230
+ ];
231
+ function browserStepActionSpec(action) {
232
+ return BROWSER_STEP_ACTIONS.find((spec) => spec.action === action);
233
+ }
234
+ function isRecord(value) {
235
+ return typeof value === "object" && value !== null && !Array.isArray(value);
236
+ }
237
+ /** The setting as an array: JSON text is parsed, an empty text is no items. */
238
+ function arraySetting(value) {
239
+ if (Array.isArray(value)) return value;
240
+ if (value === void 0 || value === null) return [];
241
+ if (typeof value !== "string") return null;
242
+ const text = value.trim();
243
+ if (!text) return [];
244
+ try {
245
+ const parsed = JSON.parse(text);
246
+ return Array.isArray(parsed) ? parsed : null;
247
+ } catch {
248
+ return null;
249
+ }
250
+ }
251
+ /**
252
+ * The saved steps, or null when they cannot be shown as rows (not a JSON array,
253
+ * or an item that is not an object with a text `action`).
254
+ */
255
+ function readBrowserStepsSetting(value) {
256
+ const list = arraySetting(value);
257
+ if (!list) return null;
258
+ if (!list.every((step) => isRecord(step) && typeof step.action === "string")) return null;
259
+ return list;
260
+ }
261
+ function toBrowserStepRows(steps) {
262
+ return steps.map((step) => ({
263
+ key: v4(),
264
+ step
265
+ }));
266
+ }
267
+ /** A new step of `action`, with the defaults the browser assumes written out. */
268
+ function newBrowserStep(action = "navigate") {
269
+ const spec = browserStepActionSpec(action);
270
+ const step = { action };
271
+ if (spec?.fields) step.fields = [];
272
+ return step;
273
+ }
274
+ /**
275
+ * Change a step's action. The name and the parameters the new action also takes
276
+ * are kept; the old action's other parameters are dropped.
277
+ */
278
+ function changeBrowserStepAction(step, action) {
279
+ const spec = browserStepActionSpec(action);
280
+ const next = { action };
281
+ if (typeof step.name === "string") next.name = step.name;
282
+ for (const param of spec?.params ?? []) if (step[param.key] !== void 0) next[param.key] = step[param.key];
283
+ if (spec?.fields) next.fields = Array.isArray(step.fields) ? step.fields : [];
284
+ return next;
285
+ }
286
+ /**
287
+ * Set one parameter. An empty text removes the key (the browser then uses its
288
+ * default); a number field keeps a number, or the text when it is an expression.
289
+ */
290
+ function setBrowserStepParam(step, param, value) {
291
+ const next = { ...step };
292
+ if (param.kind === "boolean") {
293
+ next[param.key] = value === true;
294
+ return next;
295
+ }
296
+ const text = typeof value === "string" ? value : "";
297
+ if (text === "" && param.key !== "value") {
298
+ delete next[param.key];
299
+ return next;
300
+ }
301
+ if (param.kind === "number") {
302
+ const number = Number(text);
303
+ next[param.key] = text.trim() !== "" && Number.isFinite(number) ? number : text;
304
+ return next;
305
+ }
306
+ next[param.key] = text;
307
+ return next;
308
+ }
309
+ /** A parameter's value as the text an input shows. */
310
+ function browserStepParamText(step, key) {
311
+ const value = step[key];
312
+ if (typeof value === "string") return value;
313
+ if (typeof value === "number" && Number.isFinite(value)) return String(value);
314
+ return "";
315
+ }
316
+ function browserStepParamChecked(step, param) {
317
+ const value = step[param.key];
318
+ return typeof value === "boolean" ? value : param.defaultChecked === true;
319
+ }
320
+ /** Move the row at `from` by `delta` places; out-of-range moves change nothing. */
321
+ function moveRow(rows, from, delta) {
322
+ const to = from + delta;
323
+ if (from < 0 || from >= rows.length || to < 0 || to >= rows.length) return rows.slice();
324
+ const next = rows.slice();
325
+ const [row] = next.splice(from, 1);
326
+ next.splice(to, 0, row);
327
+ return next;
328
+ }
329
+ /** The setting to save for `steps`, in the representation `previous` used. */
330
+ function serialiseBrowserSteps(steps, previous) {
331
+ return Array.isArray(previous) ? steps.slice() : JSON.stringify(steps, null, 2);
332
+ }
333
+ /** A setting as the text the JSON view shows. */
334
+ function settingText(value) {
335
+ if (typeof value === "string") return value;
336
+ if (value === void 0 || value === null) return "";
337
+ return JSON.stringify(value, null, 2);
338
+ }
339
+ /** The fields of a step or of the trigger, as rows (unusable items are dropped). */
340
+ function readBrowserFields(value) {
341
+ const list = arraySetting(value);
342
+ if (!list) return null;
343
+ if (!list.every(isRecord)) return null;
344
+ return list.map((item) => ({
345
+ name: typeof item.name === "string" ? item.name : "",
346
+ selector: typeof item.selector === "string" ? item.selector : "",
347
+ attribute: typeof item.attribute === "string" && item.attribute.trim() ? item.attribute : null,
348
+ multiple: item.multiple === true
349
+ }));
350
+ }
351
+ /** A field as saved: `attribute` and `multiple` only when they say something. */
352
+ function browserFieldValue(field) {
353
+ const out = {
354
+ name: field.name,
355
+ selector: field.selector
356
+ };
357
+ if (field.attribute) out.attribute = field.attribute;
358
+ if (field.multiple) out.multiple = true;
359
+ return out;
360
+ }
361
+ function serialiseBrowserFields(fields, previous) {
362
+ const list = fields.map(browserFieldValue);
363
+ return Array.isArray(previous) ? list : JSON.stringify(list, null, 2);
364
+ }
365
+ function emptyBrowserField() {
366
+ return {
367
+ name: "",
368
+ selector: "",
369
+ attribute: null,
370
+ multiple: false
371
+ };
372
+ }
373
+ /** The attribute a picked field of this kind reads (images their source, links their address). */
374
+ function attributeForKind(kind) {
375
+ if (kind === "image") return "src";
376
+ if (kind === "link") return "href";
377
+ return null;
378
+ }
379
+ /**
380
+ * Fields handed over from the browser extension's visual picker (BOFF-14550):
381
+ * the JSON its "Copy for the builder" button puts on the clipboard, which is the
382
+ * saved field shape, or the picker's own captured fields (`{ name, selector,
383
+ * kind, ... }`), or an object with either under `fields`. Returns the fields
384
+ * with a name and a selector, or null when the text holds none.
385
+ */
386
+ function parsePickedFields(text) {
387
+ let parsed;
388
+ try {
389
+ parsed = JSON.parse(text.trim());
390
+ } catch {
391
+ return null;
392
+ }
393
+ const list = Array.isArray(parsed) ? parsed : isRecord(parsed) && Array.isArray(parsed.fields) ? parsed.fields : null;
394
+ if (!list) return null;
395
+ const fields = [];
396
+ for (const item of list) {
397
+ if (!isRecord(item)) continue;
398
+ const name = typeof item.name === "string" ? item.name.trim() : "";
399
+ const selector = typeof item.selector === "string" ? item.selector.trim() : "";
400
+ if (!name || !selector) continue;
401
+ const attribute = typeof item.attribute === "string" && item.attribute.trim() ? item.attribute.trim() : attributeForKind(item.kind);
402
+ fields.push({
403
+ name,
404
+ selector,
405
+ attribute,
406
+ multiple: item.multiple === true
407
+ });
408
+ }
409
+ return fields.length > 0 ? fields : null;
410
+ }
411
+ /**
412
+ * Add picked fields to a list: a picked field replaces the field of the same
413
+ * name, the others are appended in the picker's order.
414
+ */
415
+ function mergePickedFields(current, picked) {
416
+ const byName = new Map(picked.map((field) => [field.name, field]));
417
+ return [...current.map((field) => {
418
+ const replacement = byName.get(field.name);
419
+ if (!replacement) return field;
420
+ byName.delete(field.name);
421
+ return replacement;
422
+ }), ...byName.values()];
423
+ }
424
+ /**
425
+ * Steps handed over from the extension's recorder ("Copy steps"), which copies
426
+ * the node's step shape: a JSON array of steps, or an object with `steps`.
427
+ * Items without a known action are dropped; null when none is left.
428
+ */
429
+ function parsePastedSteps(text) {
430
+ let parsed;
431
+ try {
432
+ parsed = JSON.parse(text.trim());
433
+ } catch {
434
+ return null;
435
+ }
436
+ const list = Array.isArray(parsed) ? parsed : isRecord(parsed) && Array.isArray(parsed.steps) ? parsed.steps : null;
437
+ if (!list) return null;
438
+ const steps = list.filter((item) => isRecord(item) && typeof item.action === "string" && browserStepActionSpec(item.action) !== void 0);
439
+ return steps.length > 0 ? steps : null;
440
+ }
441
+ function filled(value) {
442
+ return typeof value === "string" && value.trim().length > 0;
443
+ }
444
+ const EXPRESSION = /\$\{[^}]*\}|\{\{[^}]*\}\}/;
445
+ function urlOk(value) {
446
+ if (!filled(value)) return false;
447
+ const text = value.trim();
448
+ if (EXPRESSION.test(text)) return true;
449
+ try {
450
+ const url = new URL(text);
451
+ return url.protocol === "http:" || url.protocol === "https:";
452
+ } catch {
453
+ return false;
454
+ }
455
+ }
456
+ /** Expression roots a step may never read: step values reach the browser in the clear. */
457
+ const SECRET_REFERENCE = /\$(credentials|secrets)\b/;
458
+ /**
459
+ * Whether a step value holds an expression (`${...}` or `{{...}}`), which the
460
+ * worker resolves before the browser sees the step.
461
+ */
462
+ function holdsExpression(value) {
463
+ return typeof value === "string" && EXPRESSION.test(value);
464
+ }
465
+ /** Whether a step reads `$credentials` or `$secrets`, which the worker refuses. */
466
+ function readsSecretRoot(value) {
467
+ return SECRET_REFERENCE.test(JSON.stringify(value) ?? "");
468
+ }
469
+ function fieldsProblem(fields) {
470
+ const list = readBrowserFields(fields);
471
+ if (!list || list.length === 0) return "fieldsMissing";
472
+ return list.every((field) => filled(field.name) && filled(field.selector)) ? null : "fieldIncomplete";
473
+ }
474
+ const PROBLEM_TEXT = {
475
+ empty: "Add at least one step.",
476
+ tooMany: `A Run in Browser node runs at most ${100} steps.`,
477
+ unknownAction: "Pick what this step does.",
478
+ url: "Enter an http(s) address or an expression.",
479
+ selectorOrText: "Enter a selector or the visible text.",
480
+ selector: "Enter a selector.",
481
+ value: "Enter the text to use (it may be empty only for Type).",
482
+ key: "Enter a key, e.g. Enter.",
483
+ itemSelector: "Enter the selector of one list item.",
484
+ fieldsMissing: "Add at least one field.",
485
+ fieldIncomplete: "Every field needs a name and a selector.",
486
+ secret: "Steps may not read $credentials or $secrets: step values reach the browser in the clear.",
487
+ duplicateName: "Another step already has this name."
488
+ };
489
+ function problem(index, key) {
490
+ return {
491
+ index,
492
+ key: `fluidgrids.builder.browserSteps.problem.${key}`,
493
+ fallback: PROBLEM_TEXT[key] ?? key
494
+ };
495
+ }
496
+ function stepProblem(step) {
497
+ switch (step.action) {
498
+ case "navigate": return urlOk(step.url) ? null : "url";
499
+ case "waitFor":
500
+ case "click": return filled(step.selector) || filled(step.text) ? null : "selectorOrText";
501
+ case "type":
502
+ if (!filled(step.selector)) return "selector";
503
+ return typeof step.value === "string" ? null : "value";
504
+ case "select":
505
+ if (!filled(step.selector)) return "selector";
506
+ return typeof step.value === "string" ? null : "value";
507
+ case "check": return filled(step.selector) ? null : "selector";
508
+ case "pressKey": return filled(step.key) ? null : "key";
509
+ case "extract": return fieldsProblem(step.fields);
510
+ case "extractList": return filled(step.itemSelector) ? fieldsProblem(step.fields) : "itemSelector";
511
+ default: return browserStepActionSpec(step.action) ? null : "unknownAction";
512
+ }
513
+ }
514
+ /** Every problem of a step list, in step order. */
515
+ function browserStepProblems(steps) {
516
+ if (steps.length === 0) return [problem(-1, "empty")];
517
+ const problems = [];
518
+ if (steps.length > 100) problems.push(problem(-1, "tooMany"));
519
+ const names = /* @__PURE__ */ new Set();
520
+ steps.forEach((step, index) => {
521
+ const found = stepProblem(step);
522
+ if (found) problems.push(problem(index, found));
523
+ if (SECRET_REFERENCE.test(JSON.stringify(step))) problems.push(problem(index, "secret"));
524
+ if (filled(step.name)) {
525
+ const name = step.name.trim();
526
+ if (names.has(name)) problems.push(problem(index, "duplicateName"));
527
+ names.add(name);
528
+ }
529
+ });
530
+ return problems;
531
+ }
532
+
533
+ export { settingText as C, NDV_Z_INDEX as E, setBrowserStepParam as S, NDV_OVERLAY_Z_INDEX as T, readBrowserFields as _, browserStepActionSpec as a, serialiseBrowserFields as b, browserStepProblems as c, holdsExpression as d, mergePickedFields as f, parsePickedFields as g, parsePastedSteps as h, browserParameterEditor as i, changeBrowserStepAction as l, newBrowserStep as m, BROWSER_STEPS_PARAMETER as n, browserStepParamChecked as o, moveRow as p, BROWSER_STEP_ACTIONS as r, browserStepParamText as s, BROWSER_ACTION_NODE_TYPE as t, emptyBrowserField as u, readBrowserStepsSetting as v, toBrowserStepRows as w, serialiseBrowserSteps as x, readsSecretRoot as y };