@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,385 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ import { useOptionalFeatureFlags } from "@burdenoff/fe-libs/shared/feature-flags";
4
+
5
+ // src/feature-flags/index.ts
6
+ /**
7
+ * FluidGrids feature flags evaluated in the builder.
8
+ *
9
+ * Keys are registered in global-tenant-svc (`DEFAULT_PLATFORM_FLAGS`, category
10
+ * `fluidgrids`, so tenant-svc scopes them to FluidGrids) and toggled per
11
+ * workspace from admin.burdenoff.com. wspace-workflow-svc enforces the same
12
+ * keys with `requireFeatureEnabled`, so hiding a control here only mirrors a
13
+ * server-side gate; it is never the gate itself.
14
+ *
15
+ * The SDK runs inside many app shells and only some of them mount
16
+ * `FeatureFlagProvider`, so it reads the optional flag context rather than
17
+ * `useFeatureFlag`, which throws without one. Each flag falls back to its own
18
+ * default (see `FLUIDGRIDS_FLAG_DEFAULTS`).
19
+ */
20
+ const FLUIDGRIDS_FLAGS = {
21
+ /**
22
+ * Operational kill switch for log stream destinations (webhook, syslog,
23
+ * Sentry). Defaults on; an admin turning it off hides the Log streaming
24
+ * settings and the backend rejects destination writes with FEATURE_DISABLED.
25
+ */
26
+ logStreams: "fluidgrids.log-streams",
27
+ /**
28
+ * Code-first workflows (BOFF-9902): the builder's Code view, Export as
29
+ * TypeScript / Python and TypeScript import. A rollout gate, not a kill
30
+ * switch, so it defaults OFF: the controls stay hidden until tenant-svc
31
+ * evaluates the flag on for the workspace, including when the shell mounts
32
+ * no FeatureFlagProvider or the evaluation is still loading.
33
+ */
34
+ codeFirst: "fluidgrids.code-first",
35
+ /**
36
+ * Durable functions (BOFF-9905): the Code Workflow and Wait for Signal
37
+ * nodes, run history, signals and the source editor. A rollout gate like
38
+ * `codeFirst`, so it defaults OFF and fails closed. The durable nodes are
39
+ * shown in the palette only while both this flag and `codeFirst` are on.
40
+ */
41
+ durableFunctions: "fluidgrids.durable-functions",
42
+ /**
43
+ * Durable-function parity (BOFF-9905, spec code-first 11): workflow ids and
44
+ * run chains, run metadata, what a run is waiting on, run counts,
45
+ * completion callbacks, versioning (rollouts, drainage, per-run overrides)
46
+ * and the history caps. A rollout gate like `durableFunctions`, so it
47
+ * defaults OFF and fails closed; the parity surfaces show only while this
48
+ * flag, `durableFunctions` and `codeFirst` are all on.
49
+ */
50
+ durableParity: "fluidgrids.durable-parity",
51
+ /**
52
+ * Phase C (BOFF-9906, PLAN-C §2.1): self-hosted task queues, worker tokens,
53
+ * the task-queue pages and the codec settings. A rollout gate that also
54
+ * needs `codeFirst` and `durableFunctions`, so it defaults OFF and fails
55
+ * closed (see {@link resolvePhaseCFlags}).
56
+ */
57
+ selfHostedWorkers: "fluidgrids.self-hosted-workers",
58
+ /**
59
+ * Phase C run control: updates and queries, reset, activity pause and
60
+ * options, pause rules, signal tokens, batch operations and the Signal Run
61
+ * node. Needs `codeFirst`, plus `durableFunctions` for anything acting on a
62
+ * durable-function run. Defaults OFF, fails closed.
63
+ */
64
+ runControl: "fluidgrids.run-control",
65
+ /**
66
+ * Phase C search attributes: definitions, the runs-list filter, the Set
67
+ * Search Attributes node. Needs `codeFirst`. Defaults OFF, fails closed.
68
+ */
69
+ searchAttributes: "fluidgrids.search-attributes",
70
+ /** Phase C run archival: the archive destination settings. Needs `codeFirst`. */
71
+ runArchival: "fluidgrids.run-archival",
72
+ /**
73
+ * Phase C schedule policies: the schedule panel of a Schedule Trigger
74
+ * (overlap policy, trigger now, backfill, pause with a note). Needs
75
+ * `codeFirst`. Defaults OFF, fails closed.
76
+ */
77
+ schedulePolicies: "fluidgrids.schedule-policies",
78
+ /**
79
+ * Phase C Python durable functions: editing Python sources in the browser
80
+ * editor. Needs `codeFirst` and `durableFunctions`. Defaults OFF.
81
+ */
82
+ pythonDurableFunctions: "fluidgrids.python-durable-functions",
83
+ /**
84
+ * Workflow test suites (BOFF-9960): the builder's Tests panel, saving a run
85
+ * as a test case and the Assert node in the palette. A rollout gate, so it
86
+ * defaults OFF and fails closed; wspace-workflow-svc answers every test-suite
87
+ * field with FEATURE_DISABLED while it is off for the workspace.
88
+ */
89
+ workflowTests: "fluidgrids.workflow-tests",
90
+ /**
91
+ * Continuous optimisation (BOFF-9969): the Suggestions panel on Insights
92
+ * (the per-workspace opt-in, the nightly suggestions, Apply, Dismiss and
93
+ * Snooze). A rollout gate, so it defaults OFF and fails closed;
94
+ * wspace-workflow-svc answers every suggestion field with FEATURE_DISABLED
95
+ * while it is off for the workspace.
96
+ */
97
+ continuousOptimisation: "fluidgrids.continuous-optimisation",
98
+ /**
99
+ * Phase D (BOFF-9907, PLAN-D §2.1) Generate with AI emits code: the
100
+ * Canvas | TypeScript | Python tabs of the AI panel. Needs `codeFirst`.
101
+ * A rollout gate, so it defaults OFF and fails closed (see
102
+ * {@link resolvePhaseDFlags}).
103
+ */
104
+ aiCode: "fluidgrids.ai-code",
105
+ /**
106
+ * Phase D templates as code: *Open as code* on a template, and installing
107
+ * a tier-2 template from its sources. Needs
108
+ * `codeFirst`, plus `durableFunctions` for a tier-2 template. Defaults OFF.
109
+ */
110
+ codeTemplates: "fluidgrids.code-templates",
111
+ /**
112
+ * Phase D n8n import (F-D3). A canvas feature, so it needs no other flag.
113
+ * Mirrored so every Phase D gate resolves the same way; the builder does
114
+ * not read it yet. Defaults OFF.
115
+ */
116
+ n8nImport: "fluidgrids.n8n-import",
117
+ /**
118
+ * Phase D standalone activities (`startActivity`). Needs `codeFirst` and
119
+ * `durableFunctions`. The builder has no surface for it yet; the key is
120
+ * mirrored so every Phase D gate resolves the same way. Defaults OFF.
121
+ */
122
+ standaloneActivities: "fluidgrids.standalone-activities",
123
+ /**
124
+ * FluidGrids RPA on the web (RPA plan P0-06, P1-11): the Use Browser node
125
+ * in the palette, and later the Element library and Record a task. A kill
126
+ * switch, so it defaults ON: an admin turns it off for a workspace with a
127
+ * hard-kill override. wspace-workflow-svc evaluates the same key: it lists
128
+ * the node only to a builder that opts in and only while the flag is on,
129
+ * and refuses Use Browser parks and Element library changes while it is
130
+ * off. Hiding the node here only mirrors that gate.
131
+ */
132
+ rpaWeb: "fluidgrids.rpa.web",
133
+ /**
134
+ * BotManor Stewards (BOFF-16146): AI Studio's "Steward" and "From a Steward
135
+ * run" modes. The key is BotManor's, not FluidGrids': wspace-botmanor-svc
136
+ * answers every Steward field with FEATURE_DISABLED while it is off for the
137
+ * workspace, and this only hides the modes to match. A rollout gate, so it
138
+ * defaults OFF and fails closed.
139
+ */
140
+ botmanorStewards: "botmanor.stewards"
141
+ };
142
+ /**
143
+ * The value each flag takes when it cannot be evaluated (no provider, still
144
+ * loading, or not returned). Kill switches default on so an outage of the
145
+ * flag service never removes a shipped feature; rollout gates default off so
146
+ * it never exposes an unreleased one.
147
+ */
148
+ const FLUIDGRIDS_FLAG_DEFAULTS = {
149
+ [FLUIDGRIDS_FLAGS.logStreams]: true,
150
+ [FLUIDGRIDS_FLAGS.codeFirst]: false,
151
+ [FLUIDGRIDS_FLAGS.durableFunctions]: false,
152
+ [FLUIDGRIDS_FLAGS.durableParity]: false,
153
+ [FLUIDGRIDS_FLAGS.selfHostedWorkers]: false,
154
+ [FLUIDGRIDS_FLAGS.runControl]: false,
155
+ [FLUIDGRIDS_FLAGS.searchAttributes]: false,
156
+ [FLUIDGRIDS_FLAGS.runArchival]: false,
157
+ [FLUIDGRIDS_FLAGS.schedulePolicies]: false,
158
+ [FLUIDGRIDS_FLAGS.pythonDurableFunctions]: false,
159
+ [FLUIDGRIDS_FLAGS.workflowTests]: false,
160
+ [FLUIDGRIDS_FLAGS.continuousOptimisation]: false,
161
+ [FLUIDGRIDS_FLAGS.aiCode]: false,
162
+ [FLUIDGRIDS_FLAGS.codeTemplates]: false,
163
+ [FLUIDGRIDS_FLAGS.n8nImport]: false,
164
+ [FLUIDGRIDS_FLAGS.standaloneActivities]: false,
165
+ [FLUIDGRIDS_FLAGS.rpaWeb]: true,
166
+ [FLUIDGRIDS_FLAGS.botmanorStewards]: false
167
+ };
168
+ /**
169
+ * Each evaluations map the provider has published as settled (loaded, not
170
+ * fetching), with the workspace it was settled for. The provider replaces the
171
+ * map on every successful fetch and keeps it while a refetch is in flight, so
172
+ * the map itself identifies one completed evaluation.
173
+ */
174
+ const settledEvaluations = /* @__PURE__ */ new WeakMap();
175
+ /**
176
+ * Whether the context's evaluations can be read for the active workspace.
177
+ *
178
+ * Settled: yes, unless the map was settled for another workspace (the
179
+ * provider keeps the old map for the first render after a workspace switch).
180
+ * Fetching: only when this map was already seen settled for this same
181
+ * workspace, i.e. a background refetch (`refreshInterval`, every 5 minutes by
182
+ * default) rather than a first load or a workspace switch. The last known
183
+ * evaluation then stays in force until the refetch settles, instead of the
184
+ * rollout gates blinking off for its duration.
185
+ */
186
+ function evaluationsUsable(context) {
187
+ const { evaluations } = context;
188
+ if (!evaluations) return !context.isLoading;
189
+ const workspace = context.workspaceId ?? null;
190
+ const settledFor = settledEvaluations.get(evaluations);
191
+ if (context.isLoading) return settledFor !== void 0 && settledFor === workspace;
192
+ if (settledFor === void 0) {
193
+ settledEvaluations.set(evaluations, workspace);
194
+ return true;
195
+ }
196
+ return settledFor === workspace;
197
+ }
198
+ /**
199
+ * Resolves one FluidGrids flag from the optional flag context (exported for
200
+ * tests).
201
+ *
202
+ * A kill switch (default on) keeps the resolution it has always had: the
203
+ * evaluated value, else on, and on while the flags are loading.
204
+ * A rollout gate (default off) fails closed, the way wspace-workflow-svc
205
+ * resolves it: it is on only when the flags have loaded without a fetch error
206
+ * and tenant-svc returned an evaluation for it that carries no `errorCode` and
207
+ * the boolean value `true`. No provider, a first load or workspace switch
208
+ * still in flight, a failed fetch, a missing evaluation or an evaluation error
209
+ * all leave it off. A background refetch of the same workspace keeps the last
210
+ * settled evaluation (see `evaluationsUsable`).
211
+ */
212
+ function resolveFluidGridsFlag(context, flag) {
213
+ const fallback = FLUIDGRIDS_FLAG_DEFAULTS[flag];
214
+ if (!context) return fallback;
215
+ if (fallback) {
216
+ if (context.isLoading) return fallback;
217
+ const evaluation = context.getEvaluation(flag);
218
+ return evaluation ? Boolean(evaluation.value) : fallback;
219
+ }
220
+ if (context.error || !evaluationsUsable(context)) return false;
221
+ const evaluation = context.getEvaluation(flag);
222
+ return !!evaluation && !evaluation.errorCode && evaluation.value === true;
223
+ }
224
+ /** Whether a FluidGrids flag is on for the active workspace. */
225
+ function useFluidGridsFlag(flag) {
226
+ const context = useOptionalFeatureFlags();
227
+ return useMemo(() => resolveFluidGridsFlag(context, flag), [context, flag]);
228
+ }
229
+ /** Whether BotManor Stewards are on for the active workspace (fails closed). */
230
+ function useBotmanorStewardsEnabled() {
231
+ return useFluidGridsFlag(FLUIDGRIDS_FLAGS.botmanorStewards);
232
+ }
233
+ /**
234
+ * Whether the durable-function nodes (`internal:code-workflow`,
235
+ * `internal:wait-for-signal`) may appear in the builder palette: only while
236
+ * both the code-first and the durable-functions rollout gates are on. Either
237
+ * gate off, unevaluated or failing hides them.
238
+ */
239
+ function useDurableFunctionNodesEnabled() {
240
+ const context = useOptionalFeatureFlags();
241
+ return useMemo(() => resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.codeFirst) && resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.durableFunctions), [context]);
242
+ }
243
+ /**
244
+ * Whether the durable-function parity surfaces (BOFF-9905) are shown: only
245
+ * while the code-first, durable-functions and durable-parity rollout gates
246
+ * are all on, the same three flags wspace-workflow-svc checks before it
247
+ * answers a parity field. Any of them off, unevaluated or failing hides them,
248
+ * and the pages then send exactly the requests they sent before.
249
+ */
250
+ function resolveDurableParity(context) {
251
+ return resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.codeFirst) && resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.durableFunctions) && resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.durableParity);
252
+ }
253
+ /** {@link resolveDurableParity} for the active workspace. */
254
+ function useDurableParityEnabled() {
255
+ const context = useOptionalFeatureFlags();
256
+ return useMemo(() => resolveDurableParity(context), [context]);
257
+ }
258
+ /** Every Phase C gate off: what a shell without the flags sees. */
259
+ const PHASE_C_FLAGS_OFF = Object.freeze({
260
+ runControl: false,
261
+ runControlDurable: false,
262
+ selfHostedWorkers: false,
263
+ searchAttributes: false,
264
+ runArchival: false,
265
+ schedulePolicies: false,
266
+ pythonDurableFunctions: false
267
+ });
268
+ /** Resolves the Phase C gates from the optional flag context (exported for tests). */
269
+ function resolvePhaseCFlags(context) {
270
+ const flag = (key) => resolveFluidGridsFlag(context, key);
271
+ if (!flag(FLUIDGRIDS_FLAGS.codeFirst)) return { ...PHASE_C_FLAGS_OFF };
272
+ const durable = flag(FLUIDGRIDS_FLAGS.durableFunctions);
273
+ const runControl = flag(FLUIDGRIDS_FLAGS.runControl);
274
+ return {
275
+ runControl,
276
+ runControlDurable: runControl && durable,
277
+ selfHostedWorkers: durable && flag(FLUIDGRIDS_FLAGS.selfHostedWorkers),
278
+ searchAttributes: flag(FLUIDGRIDS_FLAGS.searchAttributes),
279
+ runArchival: flag(FLUIDGRIDS_FLAGS.runArchival),
280
+ schedulePolicies: flag(FLUIDGRIDS_FLAGS.schedulePolicies),
281
+ pythonDurableFunctions: durable && flag(FLUIDGRIDS_FLAGS.pythonDurableFunctions)
282
+ };
283
+ }
284
+ /** {@link resolvePhaseCFlags} for the active workspace. */
285
+ function usePhaseCFlags() {
286
+ const context = useOptionalFeatureFlags();
287
+ return useMemo(() => resolvePhaseCFlags(context), [context]);
288
+ }
289
+ /** Every Phase D gate off: what a shell without the flags sees. */
290
+ const PHASE_D_FLAGS_OFF = Object.freeze({
291
+ aiCode: false,
292
+ codeTemplates: false,
293
+ codeTemplatesDurable: false,
294
+ n8nImport: false,
295
+ standaloneActivities: false
296
+ });
297
+ /** Resolves the Phase D gates from the optional flag context (exported for tests). */
298
+ function resolvePhaseDFlags(context) {
299
+ const flag = (key) => resolveFluidGridsFlag(context, key);
300
+ const n8nImport = flag(FLUIDGRIDS_FLAGS.n8nImport);
301
+ if (!flag(FLUIDGRIDS_FLAGS.codeFirst)) return {
302
+ ...PHASE_D_FLAGS_OFF,
303
+ n8nImport
304
+ };
305
+ const durable = flag(FLUIDGRIDS_FLAGS.durableFunctions);
306
+ const codeTemplates = flag(FLUIDGRIDS_FLAGS.codeTemplates);
307
+ return {
308
+ aiCode: flag(FLUIDGRIDS_FLAGS.aiCode),
309
+ codeTemplates,
310
+ codeTemplatesDurable: codeTemplates && durable,
311
+ n8nImport,
312
+ standaloneActivities: durable && flag(FLUIDGRIDS_FLAGS.standaloneActivities)
313
+ };
314
+ }
315
+ /** {@link resolvePhaseDFlags} for the active workspace. */
316
+ function usePhaseDFlags() {
317
+ const context = useOptionalFeatureFlags();
318
+ return useMemo(() => resolvePhaseDFlags(context), [context]);
319
+ }
320
+ /**
321
+ * Whether the rollout gates have settled for the active workspace, so that an
322
+ * off gate means "off" rather than "not evaluated yet" (exported for tests).
323
+ *
324
+ * Settled: no provider (the gates stay off for good), a failed fetch (they
325
+ * fail closed), or evaluations that can be read for this workspace (see
326
+ * `evaluationsUsable`, so a background refetch stays settled). Not settled:
327
+ * the provider's first load, or the first render after a workspace switch.
328
+ * A route that redirects away when its gate is off waits for this, so a deep
329
+ * link to a gated page is not bounced during the first load.
330
+ */
331
+ function resolveFluidGridsFlagsSettled(context) {
332
+ if (!context) return true;
333
+ if (context.error) return true;
334
+ return evaluationsUsable(context);
335
+ }
336
+ /** {@link resolveFluidGridsFlagsSettled} for the active workspace. */
337
+ function useFluidGridsFlagsSettled() {
338
+ const context = useOptionalFeatureFlags();
339
+ return useMemo(() => resolveFluidGridsFlagsSettled(context), [context]);
340
+ }
341
+ /** Whether the self-hosted workers surfaces (task queues, worker tokens) show. */
342
+ function useSelfHostedWorkersEnabled() {
343
+ return usePhaseCFlags().selfHostedWorkers;
344
+ }
345
+ /**
346
+ * Whether the workflow test suites (BOFF-9960) are shown: the Tests panel,
347
+ * "Save as test case" on a run and the Assert node. Fails closed.
348
+ */
349
+ function useWorkflowTestsEnabled() {
350
+ return useFluidGridsFlag(FLUIDGRIDS_FLAGS.workflowTests);
351
+ }
352
+ /**
353
+ * Whether the continuous-optimisation Suggestions panel (BOFF-9969) is shown
354
+ * on Insights. Fails closed: with the flag off the page sends none of the
355
+ * optimisation operations.
356
+ */
357
+ function useContinuousOptimisationEnabled() {
358
+ return useFluidGridsFlag(FLUIDGRIDS_FLAGS.continuousOptimisation);
359
+ }
360
+ /**
361
+ * The gates the builder palettes apply (durable-function nodes, the two
362
+ * run-control nodes of Phase C, the Assert node of the workflow test suites
363
+ * and the Use Browser node of RPA).
364
+ */
365
+ function resolvePaletteGates(context) {
366
+ const phaseC = resolvePhaseCFlags(context);
367
+ return {
368
+ durableFunctions: resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.codeFirst) && resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.durableFunctions),
369
+ runControl: phaseC.runControl,
370
+ searchAttributes: phaseC.searchAttributes,
371
+ workflowTests: resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.workflowTests),
372
+ rpaWeb: resolveFluidGridsFlag(context, FLUIDGRIDS_FLAGS.rpaWeb)
373
+ };
374
+ }
375
+ /** Whether FluidGrids RPA on the web (`fluidgrids.rpa.web`) is on: a kill switch, on by default. */
376
+ function useRpaWebEnabled() {
377
+ return useFluidGridsFlag(FLUIDGRIDS_FLAGS.rpaWeb);
378
+ }
379
+ /** {@link resolvePaletteGates} for the active workspace. */
380
+ function usePaletteGates() {
381
+ const context = useOptionalFeatureFlags();
382
+ return useMemo(() => resolvePaletteGates(context), [context]);
383
+ }
384
+
385
+ export { usePhaseDFlags as _, resolveDurableParity as a, useWorkflowTestsEnabled as b, resolvePhaseDFlags as c, useDurableFunctionNodesEnabled as d, useDurableParityEnabled as f, usePhaseCFlags as g, usePaletteGates as h, PHASE_D_FLAGS_OFF as i, useBotmanorStewardsEnabled as l, useFluidGridsFlagsSettled as m, FLUIDGRIDS_FLAG_DEFAULTS as n, resolveFluidGridsFlagsSettled as o, useFluidGridsFlag as p, PHASE_C_FLAGS_OFF as r, resolvePhaseCFlags as s, FLUIDGRIDS_FLAGS as t, useContinuousOptimisationEnabled as u, useRpaWebEnabled as v, useSelfHostedWorkersEnabled as y };
@@ -0,0 +1,153 @@
1
+ "use client";
2
+ // src/builder/contants/symbols.ts
3
+ const NODE_TYPE_DRAG_DATA_FORMAT = "application/flow-builder.node-type";
4
+ /**
5
+ * Optional companion to NODE_TYPE_DRAG_DATA_FORMAT: carries the operation name
6
+ * a node instance should be pinned to when dropped. Set by the Node Store
7
+ * operation rows so a dragged operation lands on the canvas already configured
8
+ * (no on-card operation dropdown). Absent for built-in / control-flow drags.
9
+ */
10
+ const NODE_OPERATION_DRAG_DATA_FORMAT = "application/flow-builder.node-operation";
11
+ /**
12
+ * Node type of the canvas sticky note (n8n-style annotation). Stickies are
13
+ * pure canvas decorations persisted in the workflow definition: they have no
14
+ * handles, are skipped by flow validation, and are never reached by execution
15
+ * (the run planner is trigger-rooted and edge-driven).
16
+ */
17
+ const STICKY_NOTE_TYPE = "sticky-note";
18
+
19
+ // src/builder/lib/sticky-notes.ts
20
+ /**
21
+ * Sticky notes are persisted OUTSIDE `definitionJson.data.nodes`, under a
22
+ * sibling `stickyNotes` key, so nothing execution-adjacent (backend
23
+ * validators, run planning, trigger sync, analytics over nodes) ever sees
24
+ * them. On the canvas they still live as React Flow nodes; these helpers
25
+ * convert between the two shapes at the save/load boundary.
26
+ */
27
+ /**
28
+ * n8n-parity sticky-note palette. The keys are persisted in workflow JSON
29
+ * (`data.color`); each value is built from semantic categorical tokens
30
+ * (fe-libs chart-* series), so the tints follow light/dark mode and the brand
31
+ * themes. The default theme has no orange series, so orange is mixed from
32
+ * the yellow and red series rather than borrowed from a status token: the
33
+ * warning token resolves to the same hue as chart-4, which made orange and
34
+ * yellow notes look identical.
35
+ */
36
+ const STICKY_COLORS = {
37
+ yellow: "var(--color-chart-4)",
38
+ orange: "color-mix(in srgb, var(--color-chart-4) 50%, var(--color-chart-5))",
39
+ blue: "var(--color-chart-1)",
40
+ green: "var(--color-chart-2)",
41
+ red: "var(--color-chart-5)",
42
+ purple: "var(--color-chart-3)",
43
+ gray: "var(--color-chart-axis)"
44
+ };
45
+ const DEFAULT_STICKY_COLOR = "yellow";
46
+ /** Palette key for a stored note colour; unknown or missing keys fall back to the default. */
47
+ function resolveStickyColor(color) {
48
+ return typeof color === "string" && Object.hasOwn(STICKY_COLORS, color) ? color : DEFAULT_STICKY_COLOR;
49
+ }
50
+ /**
51
+ * Opacity of a sticky note's body fill and border, in percent. These match
52
+ * the hex alpha suffixes the notes used before the palette moved to semantic
53
+ * tokens (`1F` ≈ 12 %, `59` ≈ 35 %), so existing notes look the same.
54
+ */
55
+ const STICKY_FILL_PERCENT = 12;
56
+ const STICKY_BORDER_PERCENT = 35;
57
+ /**
58
+ * Translucent tint of a palette colour. The palette holds CSS variables
59
+ * (`var(--color-chart-4)`), so a hex alpha suffix cannot be appended: the
60
+ * result (`var(--color-chart-4)1F`) is invalid CSS and the browser drops the
61
+ * whole declaration. `color-mix` works with any colour value, including
62
+ * variables, and keeps the note following the active theme.
63
+ */
64
+ function stickyTint(color, percent) {
65
+ return `color-mix(in srgb, ${color} ${Math.min(100, Math.max(0, percent))}%, transparent)`;
66
+ }
67
+ /** Inline fill and border colours for a sticky note body. */
68
+ function stickySurfaceStyle(color) {
69
+ return {
70
+ backgroundColor: stickyTint(color, 12),
71
+ borderColor: stickyTint(color, 35)
72
+ };
73
+ }
74
+ function isStickyNode(node) {
75
+ return node?.type === STICKY_NOTE_TYPE;
76
+ }
77
+ /** Split canvas nodes into executable nodes and sticky notes (for save). */
78
+ function partitionStickyNotes(nodes) {
79
+ return {
80
+ nodes: nodes.filter((n) => !isStickyNode(n)),
81
+ stickyNotes: nodes.filter((n) => isStickyNode(n))
82
+ };
83
+ }
84
+ /**
85
+ * Combine a loaded definition's nodes + stickyNotes into one canvas node list
86
+ * (for load). Tolerates legacy definitions that still carry sticky nodes
87
+ * inside `nodes` (de-duplicated by id).
88
+ */
89
+ function mergeStickyNotes(def) {
90
+ const nodes = Array.isArray(def.nodes) ? def.nodes : [];
91
+ const stickies = Array.isArray(def.stickyNotes) ? def.stickyNotes : [];
92
+ const seen = new Set(nodes.map((n) => n.id));
93
+ return [...nodes, ...stickies.filter((s) => s?.id && !seen.has(s.id))];
94
+ }
95
+
96
+ // src/builder/components/ndv/field-label.ts
97
+ /**
98
+ * Titles for node parameters in the parameter panel (BOFF-9775). A field shows the label its
99
+ * manifest gives it; without one, its name is turned into words ("maxResults" → "Max Results"),
100
+ * so the panel never shows a raw parameter id.
101
+ */
102
+ /** Words that read as all capitals in a title. */
103
+ const UPPERCASE_WORDS = /* @__PURE__ */ new Set([
104
+ "api",
105
+ "csv",
106
+ "html",
107
+ "http",
108
+ "https",
109
+ "id",
110
+ "ip",
111
+ "json",
112
+ "jwt",
113
+ "sql",
114
+ "ssl",
115
+ "url",
116
+ "uri",
117
+ "utc",
118
+ "xml"
119
+ ]);
120
+ /** Plural acronyms, written with a lower-case s ("IDs", "URLs"). */
121
+ const PLURAL_ACRONYMS = /* @__PURE__ */ new Map([
122
+ ["apis", "APIs"],
123
+ ["ids", "IDs"],
124
+ ["ips", "IPs"],
125
+ ["uris", "URIs"],
126
+ ["urls", "URLs"]
127
+ ]);
128
+ function titleWord(word) {
129
+ const lower = word.toLowerCase();
130
+ const plural = PLURAL_ACRONYMS.get(lower);
131
+ if (plural) return plural;
132
+ if (UPPERCASE_WORDS.has(lower)) return lower.toUpperCase();
133
+ return lower.charAt(0).toUpperCase() + lower.slice(1);
134
+ }
135
+ /** "maxResults", "max_results" and "max-results" → "Max Results"; "messageId" → "Message ID". */
136
+ function humanizeFieldName(name) {
137
+ const words = name.split(".").pop().replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).filter(Boolean);
138
+ return words.length > 0 ? words.map(titleWord).join(" ") : name;
139
+ }
140
+ /** The first non-empty string among a field spec's label keys, else the humanised name. */
141
+ function fieldLabel(name, spec) {
142
+ for (const key of [
143
+ "label",
144
+ "displayName",
145
+ "title"
146
+ ]) {
147
+ const value = spec?.[key];
148
+ if (typeof value === "string" && value.trim() !== "") return value.trim();
149
+ }
150
+ return humanizeFieldName(name);
151
+ }
152
+
153
+ export { isStickyNode as a, resolveStickyColor as c, NODE_TYPE_DRAG_DATA_FORMAT as d, STICKY_NOTE_TYPE as f, STICKY_COLORS as i, stickySurfaceStyle as l, humanizeFieldName as n, mergeStickyNotes as o, DEFAULT_STICKY_COLOR as r, partitionStickyNotes as s, fieldLabel as t, NODE_OPERATION_DRAG_DATA_FORMAT as u };
@@ -0,0 +1,133 @@
1
+ "use client";
2
+ // src/utils/workflow-open.ts
3
+ /**
4
+ * Opening a workflow by key is READ-ONLY (BOFF-8060 F2).
5
+ *
6
+ * Before this, the builder page created a workflow definition whenever the key
7
+ * in the URL had no versions, so ANY link to an unknown key (a stale bookmark,
8
+ * a mistyped URL, a link an assistant composed) wrote a real row.
9
+ *
10
+ * The one legitimate create-on-open is the person pressing "Create Workflow",
11
+ * and THAT navigation says so with router state (`NEW_WORKFLOW_STATE`). A bare
12
+ * URL never carries it, so a bare URL can only ever read.
13
+ *
14
+ * Pure on purpose: this repo's tests run under `bun test` with no DOM, and the
15
+ * decision is the part that must not regress.
16
+ */
17
+ /** Router state carried by the explicit "create a new workflow" navigation. */
18
+ const NEW_WORKFLOW_STATE = { createWorkflow: true };
19
+ /** True only for router state set by an explicit "create a new workflow" navigation. */
20
+ function isCreateIntent(state) {
21
+ return typeof state === "object" && state !== null && state.createWorkflow === true;
22
+ }
23
+ /**
24
+ * What the builder does when `getWorkflow(key, version)` found nothing.
25
+ * `create` is reachable ONLY with an explicit create intent.
26
+ */
27
+ function decideMissingWorkflow(input) {
28
+ if (input.otherVersionExists) return "open-newest";
29
+ return input.createIntent ? "create" : "not-found";
30
+ }
31
+
32
+ // src/onboarding/firstWorkflow.ts
33
+ /**
34
+ * First-workflow onboarding (parity G21).
35
+ *
36
+ * The Workflows list shows a short checklist until the person has built, run
37
+ * and activated a workflow: create one, run it, activate it. "Create" opens a
38
+ * fresh draft in the builder AND asks the builder to start its product tour, so
39
+ * the first workflow is built with the guided walkthrough rather than a blank
40
+ * canvas.
41
+ *
42
+ * Everything here is pure so it can be tested without a DOM: this repo's tests
43
+ * run under `bun test`, and the decisions (what is done, which tour to start,
44
+ * whether a navigation asked for the tour) are the parts that must not regress.
45
+ */
46
+ /**
47
+ * Router state for "create my first workflow, with the guided tour". It keeps
48
+ * `createWorkflow` (the builder only mints a definition when asked to, see
49
+ * `workflow-open.ts`) and adds `guidedTour`.
50
+ */
51
+ const GUIDED_FIRST_WORKFLOW_STATE = {
52
+ ...NEW_WORKFLOW_STATE,
53
+ guidedTour: true
54
+ };
55
+ /** `NavigateOptions` for the guided first-workflow navigation. */
56
+ const GUIDED_FIRST_WORKFLOW_NAV = { state: GUIDED_FIRST_WORKFLOW_STATE };
57
+ /**
58
+ * Router state for opening a workflow that "create my first workflow" has
59
+ * ALREADY created (create-first, see `utils/create-workflow-first.ts`): the
60
+ * tour request alone. It must not carry `createWorkflow`, which would make the
61
+ * builder try to mint the same key a second time.
62
+ */
63
+ const GUIDED_TOUR_STATE = { guidedTour: true };
64
+ /** True only for router state that asked the builder to start its tour. */
65
+ function isGuidedTourIntent(state) {
66
+ return typeof state === "object" && state !== null && state.guidedTour === true;
67
+ }
68
+ /**
69
+ * The same router state without the tour request, so a reload or a Back/
70
+ * Forward visit to the builder does not start the tour a second time. Other
71
+ * keys (notably `createWorkflow`) are kept as they were.
72
+ */
73
+ function withoutGuidedTourIntent(state) {
74
+ if (typeof state !== "object" || state === null) return state;
75
+ if (!("guidedTour" in state)) return state;
76
+ const rest = {};
77
+ for (const [key, value] of Object.entries(state)) if (key !== "guidedTour") rest[key] = value;
78
+ return Object.keys(rest).length > 0 ? rest : null;
79
+ }
80
+ function byMostRecent(a, b) {
81
+ const at = a.updatedAt ? Date.parse(a.updatedAt) : 0;
82
+ const bt = b.updatedAt ? Date.parse(b.updatedAt) : 0;
83
+ return (Number.isNaN(bt) ? 0 : bt) - (Number.isNaN(at) ? 0 : at);
84
+ }
85
+ /**
86
+ * Where the person is in the first-workflow journey.
87
+ *
88
+ * @param workflows the listed workflows (latest version of each)
89
+ * @param runsTotal how many runs the workspace has, or null while unknown —
90
+ * an unknown count is never treated as "ran", so the step stays open until
91
+ * the runs query answers.
92
+ */
93
+ function firstWorkflowProgress(workflows, runsTotal) {
94
+ const created = workflows.length > 0;
95
+ const ran = runsTotal !== null && runsTotal > 0;
96
+ const activated = workflows.some((w) => w.status === "ACTIVE");
97
+ const ordered = [...workflows].sort(byMostRecent);
98
+ const runTarget = ordered[0] ?? null;
99
+ const activateTarget = ordered.find((w) => (w.status ?? "DRAFT") === "DRAFT") ?? runTarget;
100
+ const remaining = [
101
+ created,
102
+ ran,
103
+ activated
104
+ ].filter((done) => !done).length;
105
+ return {
106
+ created,
107
+ ran,
108
+ activated,
109
+ complete: remaining === 0,
110
+ remaining,
111
+ runTarget,
112
+ activateTarget
113
+ };
114
+ }
115
+ /** The builder URL (relative to the Workflows module root) for a workflow. */
116
+ function builderPathFor(workflow) {
117
+ return `../workflow/${encodeURIComponent(workflow.workflowKey)}/${encodeURIComponent(workflow.version)}`;
118
+ }
119
+ /**
120
+ * The tour the guided first workflow starts: among the tours the shell offers
121
+ * on this page (already filtered to this product/module/page), the
122
+ * highest-priority one written for exactly this page. Module-wide tours (no
123
+ * pageId) are not started: they describe other screens. Tours without steps
124
+ * are skipped. Null when there is none, in which case the builder simply opens
125
+ * without a tour.
126
+ */
127
+ function pickGuidedTour(pageTours, pageId) {
128
+ const playable = pageTours.filter((tour) => (tour.steps?.length ?? 0) > 0).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
129
+ if (!pageId) return null;
130
+ return playable.find((tour) => tour.pageId === pageId) ?? null;
131
+ }
132
+
133
+ export { firstWorkflowProgress as a, withoutGuidedTourIntent as c, builderPathFor as i, decideMissingWorkflow as l, GUIDED_FIRST_WORKFLOW_STATE as n, isGuidedTourIntent as o, GUIDED_TOUR_STATE as r, pickGuidedTour as s, GUIDED_FIRST_WORKFLOW_NAV as t, isCreateIntent as u };
@@ -0,0 +1,3 @@
1
+
2
+ import { C as useWorkflowTestsEnabled, S as useSelfHostedWorkersEnabled, _ as useFluidGridsFlagsSettled, f as useBotmanorStewardsEnabled, g as useFluidGridsFlag, i as FluidGridsFlagKey, m as useDurableFunctionNodesEnabled, n as FLUIDGRIDS_FLAG_DEFAULTS, p as useContinuousOptimisationEnabled, s as PhaseCFlags, t as FLUIDGRIDS_FLAGS, x as useRpaWebEnabled, y as usePhaseCFlags } from "./index-ROZzNGyY.js";
3
+ export { FLUIDGRIDS_FLAGS, FLUIDGRIDS_FLAG_DEFAULTS, type FluidGridsFlagKey, type PhaseCFlags, useBotmanorStewardsEnabled, useContinuousOptimisationEnabled, useDurableFunctionNodesEnabled, useFluidGridsFlag, useFluidGridsFlagsSettled, usePhaseCFlags, useRpaWebEnabled, useSelfHostedWorkersEnabled, useWorkflowTestsEnabled };
package/dist/flags.js ADDED
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ import { b as useWorkflowTestsEnabled, d as useDurableFunctionNodesEnabled, g as usePhaseCFlags, l as useBotmanorStewardsEnabled, m as useFluidGridsFlagsSettled, n as FLUIDGRIDS_FLAG_DEFAULTS, p as useFluidGridsFlag, t as FLUIDGRIDS_FLAGS, u as useContinuousOptimisationEnabled, v as useRpaWebEnabled, y as useSelfHostedWorkersEnabled } from "./feature-flags-B2qetXKd.js";
3
+
4
+ export { FLUIDGRIDS_FLAGS, FLUIDGRIDS_FLAG_DEFAULTS, useBotmanorStewardsEnabled, useContinuousOptimisationEnabled, useDurableFunctionNodesEnabled, useFluidGridsFlag, useFluidGridsFlagsSettled, usePhaseCFlags, useRpaWebEnabled, useSelfHostedWorkersEnabled, useWorkflowTestsEnabled };