@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.7
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.
- package/README.md +564 -2
- package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
- package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
- package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
- package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
- package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
- package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
- package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
- package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
- package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
- package/dist/DateTimeField-B1qR4ruo.js +51 -0
- package/dist/Disclosure-BNKij7-v.js +45 -0
- package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
- package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
- package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
- package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
- package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
- package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
- package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
- package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
- package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
- package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
- package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
- package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
- package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
- package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
- package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
- package/dist/FluidGridsMark-CE2blT7K.js +74 -0
- package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
- package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
- package/dist/HistoryPage-BSBISXoj.js +2835 -0
- package/dist/Icon-BtQ0HXLh.js +160 -0
- package/dist/InsightsPage-D7ybj8N9.js +11245 -0
- package/dist/IsolationSetting-vy911E8b.js +1153 -0
- package/dist/LibraryParts-DOeNgR8A.js +413 -0
- package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
- package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
- package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
- package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
- package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
- package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
- package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
- package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
- package/dist/NodesPage-O7KeeKtd.js +653 -0
- package/dist/OfflineIcon-TwMKYWjA.js +207 -0
- package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
- package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
- package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
- package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
- package/dist/RunActionsMenu-DodOgIQm.js +59 -0
- package/dist/RunnerStatusPill-C1v967iq.js +24 -0
- package/dist/RunnersPage-dB0RSdY_.js +1929 -0
- package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
- package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
- package/dist/SearchBox-BGtYjvfs.js +49 -0
- package/dist/SequenceEditor-CFiHeHkR.js +497 -0
- package/dist/SettingsPage-0CQBNPZV.js +8695 -0
- package/dist/StewardPages-DAJhepen.js +47 -0
- package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
- package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
- package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
- package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
- package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
- package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
- package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
- package/dist/TemplatePreview-cx7-NOeG.js +868 -0
- package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
- package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
- package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
- package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
- package/dist/TranslationBridge-Da-TPgQm.js +68 -0
- package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
- package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
- package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
- package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
- package/dist/VariablesPage-ChfGuW22.js +2243 -0
- package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
- package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
- package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
- package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
- package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
- package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
- package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
- package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
- package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
- package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
- package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
- package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
- package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
- package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
- package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
- package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
- package/dist/WorkflowsList--hR2_8gf.js +4593 -0
- package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
- package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
- package/dist/addonCatalog-CbZS4deh.js +58 -0
- package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
- package/dist/addons.d.ts +3 -0
- package/dist/addons.js +4 -0
- package/dist/agent-form-Bfvm32j1.js +83 -0
- package/dist/agent-tools.d.ts +3 -0
- package/dist/agent-tools.js +5 -0
- package/dist/agentTools-CyL7DLOF.js +320 -0
- package/dist/ai-usage-BrxDgvdR.js +240 -0
- package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
- package/dist/api-BKq-nIOZ.js +2286 -0
- package/dist/api-Ol7I8NxE.js +8289 -0
- package/dist/apollo-type-policies.d.ts +11 -0
- package/dist/apollo-type-policies.js +64 -0
- package/dist/askAboutBridge-ByYsQams.js +106 -0
- package/dist/askQuestions-Cmx7VnMm.js +742 -0
- package/dist/assert-rules-lfYEMc99.js +318 -0
- package/dist/assistant.d.ts +94 -0
- package/dist/assistant.js +99 -0
- package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
- package/dist/badge-CXfPhoMH.js +26 -0
- package/dist/basil.generated-BK-EHbwN.js +10 -0
- package/dist/browser-steps-DMpS5TyB.js +533 -0
- package/dist/builderTimings-pvGnK1m-.js +510 -0
- package/dist/button-DG7y_FVJ.js +48 -0
- package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
- package/dist/card-Bomy_1UG.js +44 -0
- package/dist/catalogGrid-BOrfMgi-.js +41 -0
- package/dist/channel-CPyQ1NR1.js +212 -0
- package/dist/chips-CvNrYJZa.js +27 -0
- package/dist/client-holder-C0M5Cfwl.js +68 -0
- package/dist/cn-QqidFIgr.js +10 -0
- package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
- package/dist/code-editor-field-x_JrY8KR.js +113 -0
- package/dist/codec-client-DPuD6mw7.js +515 -0
- package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
- package/dist/config-DO68jw5k.js +322 -0
- package/dist/constants-DgbVc24O.d.ts +296 -0
- package/dist/constants-DlRnHBfQ.js +217 -0
- package/dist/convert-browser-action-pfecelF7.js +347 -0
- package/dist/convert-dialog-B_o22NiJ.js +382 -0
- package/dist/create-workflow-first-Azg3JUdX.js +120 -0
- package/dist/definition-canvas-Bsda-rDT.js +31 -0
- package/dist/dialog-BVd152GS.js +94 -0
- package/dist/durable-nodes-BXyYCLxT.js +91 -0
- package/dist/duration-CDb7-mT_.js +33 -0
- package/dist/edge-mapper-wEAdGVU2.js +4477 -0
- package/dist/element-library-DkSlg_VE.js +727 -0
- package/dist/entities-I_0kio3q.js +38 -0
- package/dist/error-advice-QLr5NCm7.js +65 -0
- package/dist/errors-ClKb5sEt.js +188 -0
- package/dist/executions.d.ts +3 -0
- package/dist/executions.js +5 -0
- package/dist/feature-flags-B2qetXKd.js +385 -0
- package/dist/field-label-DPZRmE_B.js +153 -0
- package/dist/firstWorkflow-C_h0KMB2.js +133 -0
- package/dist/flags.d.ts +3 -0
- package/dist/flags.js +4 -0
- package/dist/flow-builder-DIvLOhz0.js +28038 -0
- package/dist/flow-store-holder-CUN7Terz.js +52 -0
- package/dist/fluent.generated-CA_e6-4l.js +14 -0
- package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
- package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
- package/dist/global-client-BQPuFrFa.js +433 -0
- package/dist/global-operations-BG6YgxrM.js +136 -0
- package/dist/graphql-types-UTYtujY9.js +21358 -0
- package/dist/history.d.ts +3 -0
- package/dist/history.js +4 -0
- package/dist/index-AoJAa5vU.d.ts +164958 -0
- package/dist/index-DEMT3iAM.d.ts +120 -0
- package/dist/index-ROZzNGyY.d.ts +76 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +8123 -0
- package/dist/ion.generated-mbajjcAg.js +10 -0
- package/dist/label-Lzb8ZXf_.js +29 -0
- package/dist/labels-rXd9gYQz.js +1236 -0
- package/dist/liveCanvas-D5ytXDp8.js +103 -0
- package/dist/logos.generated-X6_0kjVR.js +21 -0
- package/dist/logs-panel-Cw0DkG0l.js +468 -0
- package/dist/lucide.generated-B6NVd3GT.js +29 -0
- package/dist/marksStore-a9oIMMot.js +175 -0
- package/dist/mcp-trigger-D0nRdvq5.js +307 -0
- package/dist/mdi.generated-D1BV74d6.js +292 -0
- package/dist/menus-CU3hDGYl.js +160 -0
- package/dist/mynaui.generated-DMWr5cXz.js +66 -0
- package/dist/navigation-v2.d.ts +3 -0
- package/dist/navigation-v2.js +5 -0
- package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
- package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
- package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
- package/dist/node-registry-refresh-s3okf83X.js +27 -0
- package/dist/node-role-TMbnkmeP.js +132 -0
- package/dist/node-type-icon-BZa8n4iG.js +33 -0
- package/dist/nodes.d.ts +3 -0
- package/dist/nodes.js +4 -0
- package/dist/notesKey-5EaREBGA.js +12 -0
- package/dist/observability.d.ts +3 -0
- package/dist/observability.js +5 -0
- package/dist/offset-pages-zghoClB3.js +55 -0
- package/dist/operations-BBmT9ToP.js +663 -0
- package/dist/operations-WxRJWeqO.js +3133 -0
- package/dist/output-files-Ba8bu5lv.js +196 -0
- package/dist/page-operation-DrWuhd6Y.js +129 -0
- package/dist/page-twins.d.ts +13 -0
- package/dist/page-twins.js +186 -0
- package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
- package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
- package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
- package/dist/panels-PfBBAToE.js +346 -0
- package/dist/parts-B7fBcw-B.js +346 -0
- package/dist/popover-Dms9Vz3j.js +3389 -0
- package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
- package/dist/proactive.d.ts +66 -0
- package/dist/proactive.js +237 -0
- package/dist/quick-config-panel-DFd77xho.js +451 -0
- package/dist/quota-DeA_CJ2e.js +175 -0
- package/dist/quota.d.ts +3 -0
- package/dist/quota.js +4 -0
- package/dist/read-only-context-Dt9N9SIG.js +18 -0
- package/dist/relative-time-Dxt8ZIIu.js +55 -0
- package/dist/results-CwK_yDxK.js +325 -0
- package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
- package/dist/route-data.d.ts +12 -0
- package/dist/route-data.js +69 -0
- package/dist/route-match-C-0_EnAt.d.ts +5 -0
- package/dist/route-match-DMkUICYV.js +41 -0
- package/dist/route-preload-C4DlGoCd.js +120 -0
- package/dist/run-display-UjLAoYqQ.js +81 -0
- package/dist/run-history-arGiHzGU.js +285 -0
- package/dist/run-list-links-DJn4Mf1T.js +98 -0
- package/dist/run-mode-USmM0-Uo.js +82 -0
- package/dist/run-parity-CWXqEJqM.js +144 -0
- package/dist/runsQuota-B6SyTbne.js +100 -0
- package/dist/runsQuota-DsniKiSg.d.ts +20 -0
- package/dist/safe-expression-Cw7-SCsm.js +1251 -0
- package/dist/save-status-store-C7nEYpfb.js +631 -0
- package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
- package/dist/schedule-rules-ggVKRkBH.js +358 -0
- package/dist/secrets-Re_wSiE3.js +153 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.js +6 -0
- package/dist/shared-DAWGGMSM.js +177 -0
- package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
- package/dist/solar.generated-CGYuUQAC.js +10 -0
- package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
- package/dist/start-url-CT6Yz96K.js +24 -0
- package/dist/status-CessxGpm.js +55 -0
- package/dist/store-icon-OctYp5zP.js +155 -0
- package/dist/styles-WGmTnZ2n.js +26 -0
- package/dist/styles.css +139 -0
- package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
- package/dist/template-code-CzN6JWNV.js +191 -0
- package/dist/template-graph-DLF9dygU.js +20 -0
- package/dist/template-preview-DcIIKOOL.js +32 -0
- package/dist/template-price-CdUHZRMF.js +40 -0
- package/dist/templates.d.ts +3 -0
- package/dist/templates.js +5 -0
- package/dist/theme-provider-CntfC4_i.js +23 -0
- package/dist/transient-DgZfhDfN.js +57 -0
- package/dist/typed-calls-C5tO03wq.js +26 -0
- package/dist/ui-script-By74Guk3.js +1094 -0
- package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
- package/dist/ui-step-fix-8uM2_Hft.js +67 -0
- package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
- package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
- package/dist/ui-target-editor-D2JhB_lD.js +673 -0
- package/dist/uiMarkTools-CSznnO1i.js +1054 -0
- package/dist/upgradePrompt-BAFBKKW5.js +72 -0
- package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
- package/dist/use-browser-available-hj8wc3Kb.js +241 -0
- package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
- package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
- package/dist/use-mobile-BTqCUjzS.js +27 -0
- package/dist/use-sdk-query-C697xZVv.js +116 -0
- package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
- package/dist/useActionParam-B2tU2BlY.js +85 -0
- package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
- package/dist/useBrowserClients-3v95-gSh.js +103 -0
- package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
- package/dist/useConnections-DsgEJs05.js +439 -0
- package/dist/useDebouncedValue-BFekcv6n.js +18 -0
- package/dist/useDurableParity-8fnMZmBc.js +1787 -0
- package/dist/useEntityTags-D0spL6Ut.js +460 -0
- package/dist/useExecutions-2u5nGJJk.js +681 -0
- package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
- package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
- package/dist/useHumanRequests-zlYDp3l1.js +221 -0
- package/dist/useNavigationV2-C2WeqN7d.js +29 -0
- package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
- package/dist/useObservability-BRlQ0tOA.js +285 -0
- package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
- package/dist/useRunHistory-CXCMUPyf.js +2759 -0
- package/dist/useRunLive-D0JvVZT2.js +1060 -0
- package/dist/useRunnerList-Dbi59i1K.js +446 -0
- package/dist/useRunners-URUc5quU.js +173 -0
- package/dist/useRunsPage-DG656UCK.js +2709 -0
- package/dist/useVariables-BIelxcWr.js +463 -0
- package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
- package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
- package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
- package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
- package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
- package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
- package/dist/utils-fvBb5qOD.js +89 -0
- package/dist/webhook-deliveries-AvQujaZy.js +99 -0
- package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
- package/dist/workflow-builder.d.ts +3 -0
- package/dist/workflow-builder.js +8 -0
- package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
- package/dist/workflow-embed.d.ts +3 -0
- package/dist/workflow-embed.js +4 -0
- package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
- package/dist/workflow-host.d.ts +6 -0
- package/dist/workflow-host.js +11 -0
- package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
- package/dist/workflow-pages.d.ts +3 -0
- package/dist/workflow-pages.js +115 -0
- package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
- package/dist/workflow-preview.d.ts +65 -0
- package/dist/workflow-preview.js +4 -0
- package/dist/workflow-route.d.ts +33 -0
- package/dist/workflow-route.js +4 -0
- package/dist/workflow-save-state-D0l-DkLf.js +767 -0
- package/dist/workflow-transfer-CQnQC-ke.js +104 -0
- package/dist/workflowRouteData-BkfVOc-O.js +169 -0
- package/dist/workflows-list.d.ts +10 -0
- package/dist/workflows-list.js +5 -0
- package/package.json +320 -4
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { n as getFluidGridsClient } from "./client-holder-C0M5Cfwl.js";
|
|
3
|
+
import { s as throwIfResultError } from "./errors-ClKb5sEt.js";
|
|
4
|
+
import { t as FileDownloadUrlDocument } from "./FileDownloadUrlDocument-CVOYKcL5.js";
|
|
5
|
+
|
|
6
|
+
// src/builder/lib/output-files.ts
|
|
7
|
+
/**
|
|
8
|
+
* Files in a node's output (BOFF-7652).
|
|
9
|
+
*
|
|
10
|
+
* The worker stores the bytes a node produces (Convert to File, an HTTP
|
|
11
|
+
* Request file response, a store node's attachment) in the run owner's Files
|
|
12
|
+
* library and leaves a file reference in the node's output:
|
|
13
|
+
* `{ kind: "burdenoff.file", fileId, name, mimeType, size, sha256Hash }`.
|
|
14
|
+
* The output panel lists those references with a download link and, for the
|
|
15
|
+
* types a browser can show safely, a preview.
|
|
16
|
+
*/
|
|
17
|
+
const FILE_REFERENCE_KIND = "burdenoff.file";
|
|
18
|
+
/** Most files listed for one output, and how deep the output is searched. */
|
|
19
|
+
const MAX_OUTPUT_FILES = 20;
|
|
20
|
+
const MAX_DEPTH = 8;
|
|
21
|
+
/** Largest text file previewed in the panel; anything bigger is downloaded. */
|
|
22
|
+
const TEXT_PREVIEW_MAX_BYTES = 524288;
|
|
23
|
+
/** Rows and columns a CSV preview shows. */
|
|
24
|
+
const CSV_PREVIEW_ROWS = 50;
|
|
25
|
+
const CSV_PREVIEW_COLUMNS = 20;
|
|
26
|
+
function isRecord(value) {
|
|
27
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
function isOutputFileReference(value) {
|
|
30
|
+
if (!isRecord(value)) return false;
|
|
31
|
+
const { kind, fileId, name, mimeType, size } = value;
|
|
32
|
+
return kind === "burdenoff.file" && typeof fileId === "string" && fileId.length > 0 && typeof name === "string" && typeof mimeType === "string" && typeof size === "number" && Number.isSafeInteger(size) && size >= 0;
|
|
33
|
+
}
|
|
34
|
+
function childPath(parent, key) {
|
|
35
|
+
if (typeof key === "number") return `${parent}[${key}]`;
|
|
36
|
+
return parent ? `${parent}.${key}` : key;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Every file reference in an output, in reading order, each file once (the
|
|
40
|
+
* first place it appears), up to {@link MAX_OUTPUT_FILES}.
|
|
41
|
+
*/
|
|
42
|
+
function collectOutputFiles(output) {
|
|
43
|
+
const files = [];
|
|
44
|
+
const seen = /* @__PURE__ */ new Set();
|
|
45
|
+
const visit = (value, path, depth) => {
|
|
46
|
+
if (files.length >= 20 || depth > MAX_DEPTH) return;
|
|
47
|
+
if (isOutputFileReference(value)) {
|
|
48
|
+
if (!seen.has(value.fileId)) {
|
|
49
|
+
seen.add(value.fileId);
|
|
50
|
+
files.push({
|
|
51
|
+
path,
|
|
52
|
+
file: value
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(value)) value.forEach((entry, index) => visit(entry, childPath(path, index), depth + 1));
|
|
58
|
+
else if (isRecord(value)) for (const [key, entry] of Object.entries(value)) visit(entry, childPath(path, key), depth + 1);
|
|
59
|
+
};
|
|
60
|
+
visit(output, "", 0);
|
|
61
|
+
return files;
|
|
62
|
+
}
|
|
63
|
+
/** Image types an `<img>` shows without running anything. SVG is left out: it can carry script. */
|
|
64
|
+
const IMAGE_TYPES = /* @__PURE__ */ new Set([
|
|
65
|
+
"image/png",
|
|
66
|
+
"image/jpeg",
|
|
67
|
+
"image/gif",
|
|
68
|
+
"image/webp",
|
|
69
|
+
"image/avif",
|
|
70
|
+
"image/bmp"
|
|
71
|
+
]);
|
|
72
|
+
const TEXT_TYPES = /* @__PURE__ */ new Set([
|
|
73
|
+
"application/json",
|
|
74
|
+
"application/xml",
|
|
75
|
+
"application/x-ndjson",
|
|
76
|
+
"application/yaml",
|
|
77
|
+
"application/x-yaml"
|
|
78
|
+
]);
|
|
79
|
+
/** How the panel can preview a file, or null when it can only be downloaded. */
|
|
80
|
+
function filePreviewKind(file) {
|
|
81
|
+
const mimeType = file.mimeType.split(";")[0]?.trim().toLowerCase() ?? "";
|
|
82
|
+
const name = file.name.toLowerCase();
|
|
83
|
+
if (IMAGE_TYPES.has(mimeType)) return "image";
|
|
84
|
+
if (mimeType === "application/pdf") return "pdf";
|
|
85
|
+
const csv = mimeType === "text/csv" || name.endsWith(".csv");
|
|
86
|
+
if (!(csv || mimeType.startsWith("text/") && mimeType !== "text/html" || TEXT_TYPES.has(mimeType) || /\.(txt|json|md|log|xml|ya?ml|tsv)$/.test(name))) return null;
|
|
87
|
+
if (file.size > 524288) return null;
|
|
88
|
+
return csv ? "csv" : "text";
|
|
89
|
+
}
|
|
90
|
+
/** `1.5 MB`, `320 KB`, `12 B`. */
|
|
91
|
+
function formatFileSize(size) {
|
|
92
|
+
if (size < 1024) return `${size} B`;
|
|
93
|
+
const units = [
|
|
94
|
+
"KB",
|
|
95
|
+
"MB",
|
|
96
|
+
"GB",
|
|
97
|
+
"TB"
|
|
98
|
+
];
|
|
99
|
+
let value = size / 1024;
|
|
100
|
+
let unit = 0;
|
|
101
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
102
|
+
value /= 1024;
|
|
103
|
+
unit += 1;
|
|
104
|
+
}
|
|
105
|
+
return `${value >= 10 ? Math.round(value) : Math.round(value * 10) / 10} ${units[unit]}`;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The first rows of a CSV, for the preview: quoted fields, doubled quotes and
|
|
109
|
+
* line breaks inside quotes, at most {@link CSV_PREVIEW_ROWS} rows of
|
|
110
|
+
* {@link CSV_PREVIEW_COLUMNS} cells.
|
|
111
|
+
*/
|
|
112
|
+
function csvPreviewRows(text) {
|
|
113
|
+
const rows = [];
|
|
114
|
+
let row = [];
|
|
115
|
+
let cell = "";
|
|
116
|
+
let quoted = false;
|
|
117
|
+
const endCell = () => {
|
|
118
|
+
if (row.length < 20) row.push(cell);
|
|
119
|
+
cell = "";
|
|
120
|
+
};
|
|
121
|
+
const endRow = () => {
|
|
122
|
+
endCell();
|
|
123
|
+
if (row.length > 1 || row[0] !== "") rows.push(row);
|
|
124
|
+
row = [];
|
|
125
|
+
};
|
|
126
|
+
const source = text.startsWith("") ? text.slice(1) : text;
|
|
127
|
+
for (let index = 0; index < source.length; index++) {
|
|
128
|
+
if (rows.length >= 50) return rows;
|
|
129
|
+
const char = source[index];
|
|
130
|
+
if (quoted) {
|
|
131
|
+
if (char === "\"" && source[index + 1] === "\"") {
|
|
132
|
+
cell += "\"";
|
|
133
|
+
index += 1;
|
|
134
|
+
} else if (char === "\"") quoted = false;
|
|
135
|
+
else cell += char;
|
|
136
|
+
} else if (char === "\"" && cell === "") quoted = true;
|
|
137
|
+
else if (char === ",") endCell();
|
|
138
|
+
else if (char === "\n" || char === "\r") {
|
|
139
|
+
if (char === "\r" && source[index + 1] === "\n") index += 1;
|
|
140
|
+
endRow();
|
|
141
|
+
} else cell += char;
|
|
142
|
+
}
|
|
143
|
+
if (cell !== "" || row.length > 0) endRow();
|
|
144
|
+
return rows.slice(0, 50);
|
|
145
|
+
}
|
|
146
|
+
/** How long a download URL the panel asks for stays valid. */
|
|
147
|
+
const DOWNLOAD_URL_LIFETIME_SECONDS = 3600;
|
|
148
|
+
/**
|
|
149
|
+
* A response's text, read up to `maxBytes`: null when the body is longer (or says it is),
|
|
150
|
+
* without buffering more than that.
|
|
151
|
+
*/
|
|
152
|
+
async function readTextUpTo(response, maxBytes) {
|
|
153
|
+
const declared = Number(response.headers.get("content-length"));
|
|
154
|
+
if (Number.isFinite(declared) && declared > maxBytes) {
|
|
155
|
+
await response.body?.cancel();
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
if (!response.body) return "";
|
|
159
|
+
const reader = response.body.getReader();
|
|
160
|
+
const chunks = [];
|
|
161
|
+
let total = 0;
|
|
162
|
+
for (;;) {
|
|
163
|
+
const { done, value } = await reader.read();
|
|
164
|
+
if (done) break;
|
|
165
|
+
total += value.byteLength;
|
|
166
|
+
if (total > maxBytes) {
|
|
167
|
+
await reader.cancel();
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
chunks.push(value);
|
|
171
|
+
}
|
|
172
|
+
const bytes = new Uint8Array(total);
|
|
173
|
+
let offset = 0;
|
|
174
|
+
for (const chunk of chunks) {
|
|
175
|
+
bytes.set(chunk, offset);
|
|
176
|
+
offset += chunk.byteLength;
|
|
177
|
+
}
|
|
178
|
+
return new TextDecoder().decode(bytes);
|
|
179
|
+
}
|
|
180
|
+
/** A short-lived download URL for a file in the workspace Files library. */
|
|
181
|
+
async function fetchFileDownloadUrl(fileId, expiresIn = DOWNLOAD_URL_LIFETIME_SECONDS) {
|
|
182
|
+
const result = await getFluidGridsClient().query({
|
|
183
|
+
query: FileDownloadUrlDocument,
|
|
184
|
+
variables: {
|
|
185
|
+
id: fileId,
|
|
186
|
+
expiresIn
|
|
187
|
+
},
|
|
188
|
+
fetchPolicy: "network-only"
|
|
189
|
+
});
|
|
190
|
+
throwIfResultError(result);
|
|
191
|
+
const url = result.data?.getFileDownloadUrl;
|
|
192
|
+
if (!url) throw new Error("No download link for this file.");
|
|
193
|
+
return url;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export { fetchFileDownloadUrl as a, readTextUpTo as c, csvPreviewRows as i, TEXT_PREVIEW_MAX_BYTES as n, filePreviewKind as o, collectOutputFiles as r, formatFileSize as s, DOWNLOAD_URL_LIFETIME_SECONDS as t };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
|
|
4
|
+
// src/graphql/page-operation.ts
|
|
5
|
+
/**
|
|
6
|
+
* Page operations (BOFF-16424, GQL-05).
|
|
7
|
+
*
|
|
8
|
+
* A page sends one operation for everything it draws on first paint, composed
|
|
9
|
+
* from the fragments its components own (for example WorkflowsListPage). The
|
|
10
|
+
* components keep their own watched reads (`useSdkQuery`) for the same data,
|
|
11
|
+
* because they also live on pages without a page operation and because
|
|
12
|
+
* mutations refetch them by name. Inside a page operation those reads:
|
|
13
|
+
*
|
|
14
|
+
* - wait until the page operation has answered, instead of sending their own
|
|
15
|
+
* request alongside it, and
|
|
16
|
+
* - then read `cache-first`, so the answer the page operation wrote to the
|
|
17
|
+
* cache serves them without a request.
|
|
18
|
+
*
|
|
19
|
+
* When the page operation fails (a field the person may not read, a network
|
|
20
|
+
* error), it still settles: each read then misses the cache and sends its own
|
|
21
|
+
* request, so a page is never worse off than without the page operation.
|
|
22
|
+
*/
|
|
23
|
+
const PageOperationContext = createContext(null);
|
|
24
|
+
/**
|
|
25
|
+
* How a component's watched read should behave on the current page:
|
|
26
|
+
* `fallback` outside a page operation, and deferred then `cache-first` inside one.
|
|
27
|
+
*/
|
|
28
|
+
function pageOperationReadPolicy(page, fallback) {
|
|
29
|
+
if (page === null) return {
|
|
30
|
+
deferred: false,
|
|
31
|
+
fetchPolicy: fallback
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
deferred: !page.settled,
|
|
35
|
+
fetchPolicy: "cache-first"
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** `pageOperationReadPolicy` for the page operation the component sits in. */
|
|
39
|
+
function usePageOperationReadPolicy(fallback) {
|
|
40
|
+
return pageOperationReadPolicy(useContext(PageOperationContext), fallback);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A page operation's answer from the cache, or null when the cache cannot
|
|
44
|
+
* answer it in full (first visit, evicted, or a field never written). A page
|
|
45
|
+
* draws this at once on a revisit and refreshes from the network behind it,
|
|
46
|
+
* which is what `cache-and-network` does for a watched query.
|
|
47
|
+
*/
|
|
48
|
+
function readCachedPageOperation(client, query, variables) {
|
|
49
|
+
try {
|
|
50
|
+
return client.readQuery({
|
|
51
|
+
query,
|
|
52
|
+
variables
|
|
53
|
+
}) ?? null;
|
|
54
|
+
} catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* How long an answer that a preload (pointer or focus on a link) just fetched
|
|
60
|
+
* counts as fresh: the page that opens within this time draws it and sends
|
|
61
|
+
* no request of its own.
|
|
62
|
+
*/
|
|
63
|
+
const PRELOAD_FRESH_MS = 1e4;
|
|
64
|
+
const freshPreloads = /* @__PURE__ */ new Map();
|
|
65
|
+
/**
|
|
66
|
+
* The window events the shell (fe-libs ActiveContextProvider) dispatches when
|
|
67
|
+
* the active workspace, organization or project changes. The page operation
|
|
68
|
+
* variables do not name the workspace (it travels in a header), so a preload
|
|
69
|
+
* made for the previous context must never count as the new one's answer.
|
|
70
|
+
*/
|
|
71
|
+
const PRELOAD_CONTEXT_EVENTS = [
|
|
72
|
+
"burdenoff:workspace-changed",
|
|
73
|
+
"burdenoff:organization-changed",
|
|
74
|
+
"burdenoff:project-changed"
|
|
75
|
+
];
|
|
76
|
+
let preloadContext = 0;
|
|
77
|
+
let contextListening = false;
|
|
78
|
+
function forgetPreloadsForContextChange() {
|
|
79
|
+
preloadContext += 1;
|
|
80
|
+
freshPreloads.clear();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The current preload context: it changes whenever the shell switches the
|
|
84
|
+
* active workspace, organization or project. A preload compares it before
|
|
85
|
+
* and after its request and only counts as fresh when it did not change.
|
|
86
|
+
* The first call starts listening for the shell's context events.
|
|
87
|
+
*/
|
|
88
|
+
function preloadContextId() {
|
|
89
|
+
if (!contextListening && typeof window !== "undefined" && typeof window.addEventListener === "function") {
|
|
90
|
+
contextListening = true;
|
|
91
|
+
for (const event of PRELOAD_CONTEXT_EVENTS) window.addEventListener(event, forgetPreloadsForContextChange);
|
|
92
|
+
}
|
|
93
|
+
return preloadContext;
|
|
94
|
+
}
|
|
95
|
+
function preloadKey(query, variables) {
|
|
96
|
+
const definition = query.definitions[0];
|
|
97
|
+
return `${definition && "name" in definition && definition.name ? definition.name.value : ""}:${stableStringify(variables)}`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* JSON with object keys sorted and undefined fields left out, so the same
|
|
101
|
+
* variables always give the same key (the preload's in-flight slot uses it
|
|
102
|
+
* too).
|
|
103
|
+
*/
|
|
104
|
+
function stableStringify(value) {
|
|
105
|
+
if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
|
|
106
|
+
if (value && typeof value === "object") {
|
|
107
|
+
if ("toJSON" in value && typeof value.toJSON === "function") return stableStringify(value.toJSON());
|
|
108
|
+
const record = value;
|
|
109
|
+
return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`).join(",")}}`;
|
|
110
|
+
}
|
|
111
|
+
return JSON.stringify(value) ?? "null";
|
|
112
|
+
}
|
|
113
|
+
/** Record that a preload answered this operation now. */
|
|
114
|
+
function notePreloadedPageOperation(query, variables, now = Date.now()) {
|
|
115
|
+
freshPreloads.set(preloadKey(query, variables), now);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* True, once, when a preload answered this operation within PRELOAD_FRESH_MS:
|
|
119
|
+
* the page then draws the cached answer and skips its own request. Every
|
|
120
|
+
* later call (a refresh, the next visit) is false again.
|
|
121
|
+
*/
|
|
122
|
+
function takeFreshPreload(query, variables, now = Date.now()) {
|
|
123
|
+
const key = preloadKey(query, variables);
|
|
124
|
+
const at = freshPreloads.get(key);
|
|
125
|
+
freshPreloads.delete(key);
|
|
126
|
+
return at !== void 0 && now - at >= 0 && now - at < 1e4;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { readCachedPageOperation as a, usePageOperationReadPolicy as c, preloadContextId as i, PageOperationContext as n, stableStringify as o, notePreloadedPageOperation as r, takeFreshPreload as s, PRELOAD_FRESH_MS as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
import { w as WorkflowPageName } from "./workflow-pages-D-7ByLTB.js";
|
|
3
|
+
export declare function WorkflowsPageTwin(): import("react").JSX.Element;
|
|
4
|
+
export declare function RunsPageTwin(): import("react").JSX.Element;
|
|
5
|
+
export declare function TemplatesPageTwin(): import("react").JSX.Element;
|
|
6
|
+
export declare function ApprovalsPageTwin(): import("react").JSX.Element;
|
|
7
|
+
export declare function WorkflowPageTwin({ page }: {
|
|
8
|
+
page: WorkflowPageName | null | undefined;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
10
|
+
export declare const TWINNED_WORKFLOW_PAGES: readonly ["WorkflowsList", "ExecutionsListPage", "TemplatesPage", "ApprovalInboxPage"];
|
|
11
|
+
type TwinnedWorkflowPage = (typeof TWINNED_WORKFLOW_PAGES)[number];
|
|
12
|
+
export declare function hasWorkflowPageTwin(page: WorkflowPageName | null | undefined): page is TwinnedWorkflowPage;
|
|
13
|
+
export type { TwinnedWorkflowPage };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as Icon } from "./Icon-BtQ0HXLh.js";
|
|
3
|
+
import { t as FluidGridsDocsLink } from "./FluidGridsDocsLink-bX0Hnhxr.js";
|
|
4
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
5
|
+
import { a as RunsFiltersSkeleton, d as WorkflowsIntro, f as WorkflowsTableSkeleton, i as PageIntro, n as FilterChip, o as RunsStatsSkeleton, p as useWorkflowStatusLabels, s as RunsTableSkeleton, t as ApprovalsListSkeleton, u as TemplatesGallerySkeleton } from "./parts-B7fBcw-B.js";
|
|
6
|
+
import { n as makeInert, t as WORKFLOW_STATUS_CHIPS } from "./chips-CvNrYJZa.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Button, Input, Skeleton } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
|
|
10
|
+
// src/pageTwins/twinPages.ts
|
|
11
|
+
/** The workflow pages that have a twin. */
|
|
12
|
+
const TWINNED_WORKFLOW_PAGES = [
|
|
13
|
+
"WorkflowsList",
|
|
14
|
+
"ExecutionsListPage",
|
|
15
|
+
"TemplatesPage",
|
|
16
|
+
"ApprovalInboxPage"
|
|
17
|
+
];
|
|
18
|
+
/** Whether a workflow page has a twin. */
|
|
19
|
+
function hasWorkflowPageTwin(page) {
|
|
20
|
+
return page != null && TWINNED_WORKFLOW_PAGES.includes(page);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/pageTwins/PageTwins.tsx
|
|
24
|
+
const noop = () => {};
|
|
25
|
+
/** A twin's back button: the page's own outline button, drawn but inert. */
|
|
26
|
+
function BackButton({ label, className }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
28
|
+
variant: "outline",
|
|
29
|
+
tabIndex: -1,
|
|
30
|
+
className,
|
|
31
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
32
|
+
icon: "mdi:arrow-left",
|
|
33
|
+
className: "mr-2",
|
|
34
|
+
width: 16
|
|
35
|
+
}), label]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** The Workflows list while it loads: header, search and chips, then the table's grey rows. */
|
|
39
|
+
function WorkflowsPageTwin() {
|
|
40
|
+
const tr = useTr();
|
|
41
|
+
const labels = useWorkflowStatusLabels();
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: "flex min-h-screen w-full flex-col gap-5 bg-surface-canvas p-4 sm:p-6",
|
|
44
|
+
"data-page-twin": "workflows",
|
|
45
|
+
ref: makeInert,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(WorkflowsIntro, {
|
|
48
|
+
docsLink: /* @__PURE__ */ jsx(FluidGridsDocsLink, {
|
|
49
|
+
topic: "workflows",
|
|
50
|
+
className: "mt-1"
|
|
51
|
+
}),
|
|
52
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-11 rounded-button" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-11 w-40 rounded-button" })] })
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: "flex flex-col gap-3",
|
|
56
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
57
|
+
className: "flex flex-wrap items-center gap-2",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "relative w-full min-w-0 sm:max-w-md sm:flex-1",
|
|
61
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
62
|
+
icon: "mynaui:search",
|
|
63
|
+
className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground",
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
66
|
+
type: "search",
|
|
67
|
+
readOnly: true,
|
|
68
|
+
tabIndex: -1,
|
|
69
|
+
placeholder: tr("fluidgrids.workflowsList.searchPlaceholder", "Search workflows…"),
|
|
70
|
+
className: "min-h-11 pl-9"
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ jsxs("div", {
|
|
74
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
75
|
+
children: [/* @__PURE__ */ jsx(FilterChip, {
|
|
76
|
+
pressed: true,
|
|
77
|
+
onClick: noop,
|
|
78
|
+
children: tr("fluidgrids.workflowsList.statusFilterAll", "All")
|
|
79
|
+
}), WORKFLOW_STATUS_CHIPS.map((status) => /* @__PURE__ */ jsx(FilterChip, {
|
|
80
|
+
pressed: false,
|
|
81
|
+
onClick: noop,
|
|
82
|
+
children: labels[status]
|
|
83
|
+
}, status))]
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
86
|
+
variant: "ghost",
|
|
87
|
+
className: "min-h-11",
|
|
88
|
+
tabIndex: -1,
|
|
89
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
90
|
+
icon: "mdi:tune-variant",
|
|
91
|
+
className: "size-4",
|
|
92
|
+
"aria-hidden": "true"
|
|
93
|
+
}), tr("fluidgrids.workflowsList.moreFilters", "More filters")]
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ jsx(WorkflowsTableSkeleton, {})
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/** Runs while it loads: header, the four numbers, the filters, then the table's grey rows. */
|
|
103
|
+
function RunsPageTwin() {
|
|
104
|
+
const tr = useTr();
|
|
105
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
106
|
+
className: "p-4 sm:p-6 bg-surface-canvas min-h-screen",
|
|
107
|
+
"data-page-twin": "runs",
|
|
108
|
+
ref: makeInert,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(PageIntro, {
|
|
111
|
+
title: tr("fluidgrids.executions.executionsList.title", "Executions"),
|
|
112
|
+
subtitle: tr("fluidgrids.executions.executionsList.subtitle", "Monitor and manage your workflow runs"),
|
|
113
|
+
docsLink: /* @__PURE__ */ jsx(FluidGridsDocsLink, {
|
|
114
|
+
topic: "runs",
|
|
115
|
+
className: "mt-1"
|
|
116
|
+
}),
|
|
117
|
+
actions: /* @__PURE__ */ jsxs("div", {
|
|
118
|
+
className: "flex flex-wrap items-center gap-3",
|
|
119
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9 rounded-button" }), /* @__PURE__ */ jsx(BackButton, { label: tr("fluidgrids.executions.executionsList.backToWorkflows", "Back to Workflows") })]
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsx("div", {
|
|
123
|
+
className: "mb-6",
|
|
124
|
+
children: /* @__PURE__ */ jsx(RunsStatsSkeleton, {})
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsx("div", {
|
|
127
|
+
className: "mb-6",
|
|
128
|
+
children: /* @__PURE__ */ jsx(RunsFiltersSkeleton, {})
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ jsx(RunsTableSkeleton, {})
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/** Templates while it loads: header, the gallery's tab, search and chips, then grey cards. */
|
|
135
|
+
function TemplatesPageTwin() {
|
|
136
|
+
const tr = useTr();
|
|
137
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
138
|
+
className: "p-4 sm:p-6 bg-surface-canvas min-h-screen",
|
|
139
|
+
"data-page-twin": "templates",
|
|
140
|
+
ref: makeInert,
|
|
141
|
+
children: [/* @__PURE__ */ jsx(PageIntro, {
|
|
142
|
+
title: tr("fluidgrids.templates.templatesPage.heading", "Templates"),
|
|
143
|
+
subtitle: tr("fluidgrids.templates.templatesPage.subheading", "Start quickly with pre-built workflow templates"),
|
|
144
|
+
docsLink: /* @__PURE__ */ jsx(FluidGridsDocsLink, {
|
|
145
|
+
topic: "templates",
|
|
146
|
+
className: "mt-1"
|
|
147
|
+
}),
|
|
148
|
+
actions: /* @__PURE__ */ jsx(BackButton, {
|
|
149
|
+
label: tr("fluidgrids.templates.templatesPage.backToWorkflows", "Back to Workflows"),
|
|
150
|
+
className: "max-sm:h-9 max-sm:w-auto max-sm:self-start max-sm:px-3 max-sm:text-[13px]"
|
|
151
|
+
})
|
|
152
|
+
}), /* @__PURE__ */ jsx(TemplatesGallerySkeleton, { withTabs: true })]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/** Approvals while it loads: header, then the requests' grey rows. */
|
|
156
|
+
function ApprovalsPageTwin() {
|
|
157
|
+
const tr = useTr();
|
|
158
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
159
|
+
className: "p-4 sm:p-6 bg-surface-canvas min-h-screen",
|
|
160
|
+
"data-page-twin": "approvals",
|
|
161
|
+
ref: makeInert,
|
|
162
|
+
children: [/* @__PURE__ */ jsx(PageIntro, {
|
|
163
|
+
title: tr("fluidgrids.approvals.pageTitle", "Approvals"),
|
|
164
|
+
subtitle: tr("fluidgrids.approvals.pageSubtitle", "Requests from your workflows waiting for a person, and actions your AI assistant wants to take"),
|
|
165
|
+
docsLink: /* @__PURE__ */ jsx(FluidGridsDocsLink, {
|
|
166
|
+
topic: "approvals",
|
|
167
|
+
className: "mt-1"
|
|
168
|
+
}),
|
|
169
|
+
actions: /* @__PURE__ */ jsx(BackButton, { label: tr("fluidgrids.toolApproval.backToRuns", "Back to Runs") })
|
|
170
|
+
}), /* @__PURE__ */ jsx(ApprovalsListSkeleton, {})]
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
const TWINS = {
|
|
174
|
+
WorkflowsList: WorkflowsPageTwin,
|
|
175
|
+
ExecutionsListPage: RunsPageTwin,
|
|
176
|
+
TemplatesPage: TemplatesPageTwin,
|
|
177
|
+
ApprovalInboxPage: ApprovalsPageTwin
|
|
178
|
+
};
|
|
179
|
+
/** The twin of a workflow page, or `null` for a page that has none (its loader is the mark). */
|
|
180
|
+
function WorkflowPageTwin({ page }) {
|
|
181
|
+
if (!hasWorkflowPageTwin(page)) return null;
|
|
182
|
+
const Twin = TWINS[page];
|
|
183
|
+
return /* @__PURE__ */ jsx(Twin, {});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { ApprovalsPageTwin, RunsPageTwin, TWINNED_WORKFLOW_PAGES, TemplatesPageTwin, WorkflowPageTwin, WorkflowsPageTwin, hasWorkflowPageTwin };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/assistant/pageControlSpecs.ts
|
|
3
|
+
/** The value that means "no filter" for a filter whose page state is nullable. */
|
|
4
|
+
const FILTER_ALL = "__all__";
|
|
5
|
+
/** A filter over page state that is `string | null` (chips that clear to null). */
|
|
6
|
+
function nullableFilter(input) {
|
|
7
|
+
return {
|
|
8
|
+
id: input.id,
|
|
9
|
+
label: input.label,
|
|
10
|
+
neutral: FILTER_ALL,
|
|
11
|
+
value: input.value ?? "__all__",
|
|
12
|
+
options: [{
|
|
13
|
+
value: FILTER_ALL,
|
|
14
|
+
label: input.allLabel
|
|
15
|
+
}, ...input.options],
|
|
16
|
+
set: (value) => input.set(value === "__all__" ? null : value)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Attach `filters` only when there is at least one; a page with none omits the key. */
|
|
20
|
+
function withFilters(filters) {
|
|
21
|
+
return filters.length > 0 ? { filters } : {};
|
|
22
|
+
}
|
|
23
|
+
function workflowsListControls(input) {
|
|
24
|
+
if (!input.toolbarShown) return null;
|
|
25
|
+
const filters = [];
|
|
26
|
+
if (input.status.options.length > 1) filters.push(nullableFilter({
|
|
27
|
+
id: "status",
|
|
28
|
+
...input.status
|
|
29
|
+
}));
|
|
30
|
+
if (input.tag.options.length > 0) filters.push(nullableFilter({
|
|
31
|
+
id: "tag",
|
|
32
|
+
...input.tag
|
|
33
|
+
}));
|
|
34
|
+
return {
|
|
35
|
+
page: input.page,
|
|
36
|
+
...withFilters(filters),
|
|
37
|
+
search: input.search
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function executionsControls(input) {
|
|
41
|
+
const { status, workflow } = input;
|
|
42
|
+
const filters = [{
|
|
43
|
+
id: "status",
|
|
44
|
+
label: status.label,
|
|
45
|
+
neutral: status.neutral,
|
|
46
|
+
value: status.value,
|
|
47
|
+
options: status.options,
|
|
48
|
+
set: (value) => {
|
|
49
|
+
const next = status.options.find((option) => option.value === value);
|
|
50
|
+
if (next) status.set(next.value);
|
|
51
|
+
}
|
|
52
|
+
}];
|
|
53
|
+
if (workflow.options.length > 0) filters.push({
|
|
54
|
+
id: "workflow",
|
|
55
|
+
label: workflow.label,
|
|
56
|
+
neutral: "",
|
|
57
|
+
value: workflow.value,
|
|
58
|
+
options: [{
|
|
59
|
+
value: "",
|
|
60
|
+
label: workflow.allLabel
|
|
61
|
+
}, ...workflow.options],
|
|
62
|
+
set: workflow.set
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
page: input.page,
|
|
66
|
+
filters,
|
|
67
|
+
search: input.search
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const TEMPLATE_SOURCES = [
|
|
71
|
+
"store",
|
|
72
|
+
"workspace",
|
|
73
|
+
"submissions"
|
|
74
|
+
];
|
|
75
|
+
function categoryFilter(filter) {
|
|
76
|
+
return {
|
|
77
|
+
id: "category",
|
|
78
|
+
label: filter.label,
|
|
79
|
+
neutral: filter.neutral,
|
|
80
|
+
value: filter.value,
|
|
81
|
+
options: filter.options,
|
|
82
|
+
set: filter.set
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function templatesControls(input) {
|
|
86
|
+
const { source, category, storeCategory } = input;
|
|
87
|
+
const filter = source.value === "workspace" ? category : source.value === "store" ? storeCategory : void 0;
|
|
88
|
+
return {
|
|
89
|
+
page: input.page,
|
|
90
|
+
tabs: {
|
|
91
|
+
items: [
|
|
92
|
+
{
|
|
93
|
+
id: "store",
|
|
94
|
+
label: source.storeLabel
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "workspace",
|
|
98
|
+
label: source.workspaceLabel
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "submissions",
|
|
102
|
+
label: source.submissionsLabel
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
value: source.value,
|
|
106
|
+
set: (id) => {
|
|
107
|
+
const match = TEMPLATE_SOURCES.find((candidate) => candidate === id);
|
|
108
|
+
if (match) source.set(match);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
...filter ? { filters: [categoryFilter(filter)] } : {},
|
|
112
|
+
search: input.search
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function historyControls(input) {
|
|
116
|
+
const { workflow } = input;
|
|
117
|
+
return {
|
|
118
|
+
page: input.page,
|
|
119
|
+
...withFilters(workflow.options.length > 0 ? [{
|
|
120
|
+
id: "workflow",
|
|
121
|
+
label: workflow.label,
|
|
122
|
+
neutral: workflow.neutral,
|
|
123
|
+
value: workflow.value,
|
|
124
|
+
options: [{
|
|
125
|
+
value: workflow.neutral,
|
|
126
|
+
label: workflow.allLabel
|
|
127
|
+
}, ...workflow.options],
|
|
128
|
+
set: workflow.set
|
|
129
|
+
}] : []),
|
|
130
|
+
search: input.search
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export { workflowsListControls as i, historyControls as n, templatesControls as r, executionsControls as t };
|