@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,515 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { s as throwIfResultError } from "./errors-ClKb5sEt.js";
|
|
3
|
+
import { n as getFluidGridsClient } from "./client-holder-C0M5Cfwl.js";
|
|
4
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { cn } from "@burdenoff/fe-libs/utils";
|
|
8
|
+
import { Badge } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { gql } from "@apollo/client";
|
|
10
|
+
|
|
11
|
+
// src/modules/action-policies/hooks/useActionPolicies.ts
|
|
12
|
+
/**
|
|
13
|
+
* Action policies (BOFF-9963): the workspace's per-action rules, the "what would this block"
|
|
14
|
+
* dry-run, the actions waiting for an admin's approval, and the decisions recorded on a run.
|
|
15
|
+
* Every rule is enforced by wspace-workflow-svc and the worker; this is only the admin surface.
|
|
16
|
+
*/
|
|
17
|
+
const POLICY_FIELDS = `
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
description
|
|
21
|
+
enabled
|
|
22
|
+
priority
|
|
23
|
+
effect
|
|
24
|
+
matcher { nodeTypes operations connectionProviders workflowTags }
|
|
25
|
+
condition
|
|
26
|
+
environments
|
|
27
|
+
updatedAt
|
|
28
|
+
`;
|
|
29
|
+
const APPROVAL_FIELDS = `
|
|
30
|
+
id
|
|
31
|
+
runId
|
|
32
|
+
nodeId
|
|
33
|
+
workflowKey
|
|
34
|
+
policyName
|
|
35
|
+
nodeType
|
|
36
|
+
operation
|
|
37
|
+
environment
|
|
38
|
+
reason
|
|
39
|
+
payloadHash
|
|
40
|
+
status
|
|
41
|
+
decision
|
|
42
|
+
expiresAt
|
|
43
|
+
createdAt
|
|
44
|
+
`;
|
|
45
|
+
const ACTION_POLICIES = gql`
|
|
46
|
+
query ActionPolicies {
|
|
47
|
+
actionPolicies {
|
|
48
|
+
${POLICY_FIELDS}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
const UPSERT_ACTION_POLICY = gql`
|
|
53
|
+
mutation UpsertActionPolicy($input: ActionPolicyInput!) {
|
|
54
|
+
upsertActionPolicy(input: $input) {
|
|
55
|
+
${POLICY_FIELDS}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
const DELETE_ACTION_POLICY = gql`
|
|
60
|
+
mutation DeleteActionPolicy($id: ID!) {
|
|
61
|
+
deleteActionPolicy(id: $id)
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
const DRY_RUN_ACTION_POLICY = gql`
|
|
65
|
+
query DryRunActionPolicy($input: ActionPolicyDryRunInput!) {
|
|
66
|
+
dryRunActionPolicy(input: $input) {
|
|
67
|
+
runsScanned
|
|
68
|
+
actionsEvaluated
|
|
69
|
+
wouldAllow
|
|
70
|
+
wouldLog
|
|
71
|
+
wouldRequireApproval
|
|
72
|
+
wouldDeny
|
|
73
|
+
changed
|
|
74
|
+
runsAffected
|
|
75
|
+
rows {
|
|
76
|
+
runId
|
|
77
|
+
workflowKey
|
|
78
|
+
runCreatedAt
|
|
79
|
+
nodeId
|
|
80
|
+
nodeType
|
|
81
|
+
operation
|
|
82
|
+
environment
|
|
83
|
+
currentEffect
|
|
84
|
+
effect
|
|
85
|
+
reason
|
|
86
|
+
policyName
|
|
87
|
+
changed
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
const PENDING_APPROVALS = gql`
|
|
93
|
+
query PendingActionPolicyApprovals($limit: Int) {
|
|
94
|
+
pendingActionPolicyApprovals(limit: $limit) {
|
|
95
|
+
${APPROVAL_FIELDS}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
const DECIDE_APPROVAL = gql`
|
|
100
|
+
mutation DecideActionPolicyApproval($id: ID!, $approve: Boolean!) {
|
|
101
|
+
decideActionPolicyApproval(id: $id, approve: $approve) {
|
|
102
|
+
${APPROVAL_FIELDS}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
const RUN_DECISIONS = gql`
|
|
107
|
+
query ActionPolicyDecisions($runId: ID!) {
|
|
108
|
+
actionPolicyDecisions(runId: $runId) {
|
|
109
|
+
id
|
|
110
|
+
nodeId
|
|
111
|
+
nodeType
|
|
112
|
+
operation
|
|
113
|
+
environment
|
|
114
|
+
effect
|
|
115
|
+
policyName
|
|
116
|
+
reason
|
|
117
|
+
payloadHash
|
|
118
|
+
approvalRequestId
|
|
119
|
+
consumedAt
|
|
120
|
+
createdAt
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
function asError(err) {
|
|
125
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
126
|
+
}
|
|
127
|
+
function useActionPolicies() {
|
|
128
|
+
const [policies, setPolicies] = useState([]);
|
|
129
|
+
const [approvals, setApprovals] = useState([]);
|
|
130
|
+
const [loading, setLoading] = useState(true);
|
|
131
|
+
const [error, setError] = useState(null);
|
|
132
|
+
const reload = useCallback(async () => {
|
|
133
|
+
try {
|
|
134
|
+
const client = getFluidGridsClient();
|
|
135
|
+
const [policyResult, approvalResult] = await Promise.all([client.query({
|
|
136
|
+
query: ACTION_POLICIES,
|
|
137
|
+
fetchPolicy: "network-only"
|
|
138
|
+
}), client.query({
|
|
139
|
+
query: PENDING_APPROVALS,
|
|
140
|
+
variables: { limit: 50 },
|
|
141
|
+
fetchPolicy: "network-only"
|
|
142
|
+
})]);
|
|
143
|
+
throwIfResultError(policyResult);
|
|
144
|
+
throwIfResultError(approvalResult);
|
|
145
|
+
setPolicies(policyResult.data?.actionPolicies ?? []);
|
|
146
|
+
setApprovals(approvalResult.data?.pendingActionPolicyApprovals ?? []);
|
|
147
|
+
setError(null);
|
|
148
|
+
} catch (err) {
|
|
149
|
+
setError(asError(err));
|
|
150
|
+
} finally {
|
|
151
|
+
setLoading(false);
|
|
152
|
+
}
|
|
153
|
+
}, []);
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
reload();
|
|
156
|
+
}, [reload]);
|
|
157
|
+
return {
|
|
158
|
+
policies,
|
|
159
|
+
approvals,
|
|
160
|
+
loading,
|
|
161
|
+
error,
|
|
162
|
+
reload,
|
|
163
|
+
save: useCallback(async (input) => {
|
|
164
|
+
const result = await getFluidGridsClient().mutate({
|
|
165
|
+
mutation: UPSERT_ACTION_POLICY,
|
|
166
|
+
variables: { input }
|
|
167
|
+
});
|
|
168
|
+
throwIfResultError(result);
|
|
169
|
+
await reload();
|
|
170
|
+
return result.data?.upsertActionPolicy ?? null;
|
|
171
|
+
}, [reload]),
|
|
172
|
+
remove: useCallback(async (id) => {
|
|
173
|
+
const result = await getFluidGridsClient().mutate({
|
|
174
|
+
mutation: DELETE_ACTION_POLICY,
|
|
175
|
+
variables: { id }
|
|
176
|
+
});
|
|
177
|
+
throwIfResultError(result);
|
|
178
|
+
await reload();
|
|
179
|
+
}, [reload]),
|
|
180
|
+
dryRun: useCallback(async (input) => {
|
|
181
|
+
const result = await getFluidGridsClient().query({
|
|
182
|
+
query: DRY_RUN_ACTION_POLICY,
|
|
183
|
+
variables: { input: {
|
|
184
|
+
...input,
|
|
185
|
+
runLimit: 100
|
|
186
|
+
} },
|
|
187
|
+
fetchPolicy: "network-only"
|
|
188
|
+
});
|
|
189
|
+
throwIfResultError(result);
|
|
190
|
+
const data = result.data?.dryRunActionPolicy;
|
|
191
|
+
if (!data) throw new Error("No dry-run result returned");
|
|
192
|
+
return data;
|
|
193
|
+
}, []),
|
|
194
|
+
decide: useCallback(async (id, approve) => {
|
|
195
|
+
const result = await getFluidGridsClient().mutate({
|
|
196
|
+
mutation: DECIDE_APPROVAL,
|
|
197
|
+
variables: {
|
|
198
|
+
id,
|
|
199
|
+
approve
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
throwIfResultError(result);
|
|
203
|
+
await reload();
|
|
204
|
+
}, [reload])
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** The decisions the gate recorded for one run, refreshed while the run can still change. */
|
|
208
|
+
function useRunPolicyDecisions(runId, options) {
|
|
209
|
+
const [decisions, setDecisions] = useState([]);
|
|
210
|
+
const pollIntervalMs = options?.pollIntervalMs ?? 0;
|
|
211
|
+
const generation = useRef(0);
|
|
212
|
+
const load = useCallback(async () => {
|
|
213
|
+
if (!runId) return true;
|
|
214
|
+
const ticket = ++generation.current;
|
|
215
|
+
try {
|
|
216
|
+
const result = await getFluidGridsClient().query({
|
|
217
|
+
query: RUN_DECISIONS,
|
|
218
|
+
variables: { runId },
|
|
219
|
+
fetchPolicy: "network-only",
|
|
220
|
+
context: { queryDeduplication: false }
|
|
221
|
+
});
|
|
222
|
+
throwIfResultError(result);
|
|
223
|
+
if (ticket !== generation.current) return true;
|
|
224
|
+
setDecisions(result.data?.actionPolicyDecisions ?? []);
|
|
225
|
+
return true;
|
|
226
|
+
} catch {
|
|
227
|
+
if (ticket !== generation.current) return true;
|
|
228
|
+
setDecisions([]);
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
}, [runId]);
|
|
232
|
+
useEffect(() => {
|
|
233
|
+
load();
|
|
234
|
+
if (!pollIntervalMs) return;
|
|
235
|
+
const timer = setInterval(() => void load(), pollIntervalMs);
|
|
236
|
+
return () => clearInterval(timer);
|
|
237
|
+
}, [load, pollIntervalMs]);
|
|
238
|
+
return {
|
|
239
|
+
decisions,
|
|
240
|
+
reload: load,
|
|
241
|
+
decide: useCallback(async (id, approve) => {
|
|
242
|
+
const result = await getFluidGridsClient().mutate({
|
|
243
|
+
mutation: DECIDE_APPROVAL,
|
|
244
|
+
variables: {
|
|
245
|
+
id,
|
|
246
|
+
approve
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
throwIfResultError(result);
|
|
250
|
+
await load();
|
|
251
|
+
}, [load])
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/modules/action-policies/components/EffectBadge.tsx
|
|
256
|
+
/**
|
|
257
|
+
* The colour-coded label of an action-policy effect (BOFF-9963). Semantic status tokens only.
|
|
258
|
+
*/
|
|
259
|
+
const EFFECT_CLASSES = {
|
|
260
|
+
ALLOW: "bg-status-success-bg-subtle text-status-success-text border-status-success-border",
|
|
261
|
+
LOG: "bg-status-info-bg-subtle text-status-info-text border-status-info-border",
|
|
262
|
+
REQUIRE_APPROVAL: "bg-status-warning-bg-subtle text-status-warning-text border-status-warning-border",
|
|
263
|
+
DENY: "bg-status-error-bg-subtle text-status-error-text border-status-error-border"
|
|
264
|
+
};
|
|
265
|
+
function effectLabel(effect, tr) {
|
|
266
|
+
switch (effect) {
|
|
267
|
+
case "ALLOW": return tr("fluidgrids.actionPolicies.effect.allow", "Allow");
|
|
268
|
+
case "LOG": return tr("fluidgrids.actionPolicies.effect.log", "Log");
|
|
269
|
+
case "REQUIRE_APPROVAL": return tr("fluidgrids.actionPolicies.effect.requireApproval", "Require approval");
|
|
270
|
+
default: return tr("fluidgrids.actionPolicies.effect.deny", "Deny");
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function EffectBadge({ effect, className }) {
|
|
274
|
+
const tr = useTr();
|
|
275
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
276
|
+
variant: "outline",
|
|
277
|
+
className: cn("text-xs", EFFECT_CLASSES[effect], className),
|
|
278
|
+
children: effectLabel(effect, tr)
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// src/modules/settings/utils/run-budget.ts
|
|
283
|
+
/** The four limits of a run budget, in the order the Settings page lists them (BOFF-9943). */
|
|
284
|
+
const BUDGET_DIMENSIONS = [
|
|
285
|
+
"maxSteps",
|
|
286
|
+
"maxTokens",
|
|
287
|
+
"maxCostMicroUsd",
|
|
288
|
+
"maxWallTimeSec"
|
|
289
|
+
];
|
|
290
|
+
const MICRO_USD_PER_USD = 1e6;
|
|
291
|
+
/**
|
|
292
|
+
* The budget with one limit set or cleared. `value` is what the form edits: a count for steps and
|
|
293
|
+
* tokens, seconds for wall time, and USD for cost (stored as micro-USD). An empty or unusable
|
|
294
|
+
* value clears the limit. Returns undefined when no limit is left, so the setting is removed.
|
|
295
|
+
*/
|
|
296
|
+
function withBudgetLimit(budget, dimension, value, mode) {
|
|
297
|
+
const limit = parseBudgetValue(dimension, value);
|
|
298
|
+
const next = { ...budget };
|
|
299
|
+
if (limit === void 0) delete next[dimension];
|
|
300
|
+
else next[dimension] = {
|
|
301
|
+
limit,
|
|
302
|
+
mode
|
|
303
|
+
};
|
|
304
|
+
return BUDGET_DIMENSIONS.some((d) => next[d]) ? next : void 0;
|
|
305
|
+
}
|
|
306
|
+
/** The budget with one limit's mode changed; a mode alone sets no limit. */
|
|
307
|
+
function withBudgetMode(budget, dimension, mode) {
|
|
308
|
+
const current = budget?.[dimension];
|
|
309
|
+
if (!current) return budget;
|
|
310
|
+
return {
|
|
311
|
+
...budget,
|
|
312
|
+
[dimension]: {
|
|
313
|
+
...current,
|
|
314
|
+
mode
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/** A form value as the stored limit: a whole number above zero (cost: USD to micro-USD). */
|
|
319
|
+
function parseBudgetValue(dimension, value) {
|
|
320
|
+
if (value.trim() === "") return void 0;
|
|
321
|
+
const parsed = Number(value);
|
|
322
|
+
if (!Number.isFinite(parsed) || parsed <= 0) return void 0;
|
|
323
|
+
const scaled = dimension === "maxCostMicroUsd" ? parsed * MICRO_USD_PER_USD : parsed;
|
|
324
|
+
const whole = Math.round(scaled);
|
|
325
|
+
return whole >= 1 && Number.isSafeInteger(whole) ? whole : void 0;
|
|
326
|
+
}
|
|
327
|
+
/** A stored limit as the form shows it (cost: micro-USD to USD). */
|
|
328
|
+
function budgetInputValue(dimension, limit) {
|
|
329
|
+
if (!limit) return "";
|
|
330
|
+
return dimension === "maxCostMicroUsd" ? String(limit.limit / MICRO_USD_PER_USD) : String(limit.limit);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Micro-USD as dollars with cents, and finer digits only when they matter (1.50, 0.0025), the
|
|
334
|
+
* same wording the run log uses.
|
|
335
|
+
*/
|
|
336
|
+
function formatBudgetUsd(microUsd) {
|
|
337
|
+
const [whole = "0", digits = ""] = (microUsd / MICRO_USD_PER_USD).toFixed(6).split(".");
|
|
338
|
+
let end = digits.length;
|
|
339
|
+
while (end > 2 && digits[end - 1] === "0") end--;
|
|
340
|
+
return `${whole}.${digits.slice(0, end)}`;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// src/modules/run-control/utils/codec-client.ts
|
|
344
|
+
const ENCODED_KEYS = /* @__PURE__ */ new Set([
|
|
345
|
+
"$fgp",
|
|
346
|
+
"encoding",
|
|
347
|
+
"metadata",
|
|
348
|
+
"data"
|
|
349
|
+
]);
|
|
350
|
+
const BASE64 = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
351
|
+
/**
|
|
352
|
+
* True when `value` is an encoded payload: exactly its keys, each well
|
|
353
|
+
* formed (the SDK's `isEncodedPayload`, @fluidgrids/workflows
|
|
354
|
+
* history/payload-fields).
|
|
355
|
+
*/
|
|
356
|
+
function isEncodedPayload(value) {
|
|
357
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
358
|
+
const entries = Object.entries(value);
|
|
359
|
+
if (!entries.every(([key]) => ENCODED_KEYS.has(key))) return false;
|
|
360
|
+
const record = Object.fromEntries(entries);
|
|
361
|
+
if (record["$fgp"] !== 1) return false;
|
|
362
|
+
const encoding = record["encoding"];
|
|
363
|
+
if (typeof encoding !== "string" || !encoding || encoding === "json/plain") return false;
|
|
364
|
+
const data = record["data"];
|
|
365
|
+
if (typeof data !== "string" || data.length % 4 !== 0 || !BASE64.test(data)) return false;
|
|
366
|
+
const metadata = record["metadata"];
|
|
367
|
+
if (metadata === void 0) return true;
|
|
368
|
+
if (typeof metadata !== "object" || metadata === null || Array.isArray(metadata)) return false;
|
|
369
|
+
return Object.values(metadata).every((entry) => typeof entry === "string");
|
|
370
|
+
}
|
|
371
|
+
/** Whether a JSON value holds an encoded payload anywhere in it. */
|
|
372
|
+
function containsEncodedPayload(value, depth = 0) {
|
|
373
|
+
if (depth > 32) return false;
|
|
374
|
+
if (isEncodedPayload(value)) return true;
|
|
375
|
+
if (Array.isArray(value)) return value.some((item) => containsEncodedPayload(item, depth + 1));
|
|
376
|
+
if (typeof value === "object" && value !== null) return Object.values(value).some((item) => containsEncodedPayload(item, depth + 1));
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
/** Bytes of an encoded payload's data (its base64 length, decoded). */
|
|
380
|
+
function encodedPayloadBytes(payload) {
|
|
381
|
+
const padding = payload.data.endsWith("==") ? 2 : payload.data.endsWith("=") ? 1 : 0;
|
|
382
|
+
return Math.max(0, payload.data.length / 4 * 3 - padding);
|
|
383
|
+
}
|
|
384
|
+
function toBase64(text) {
|
|
385
|
+
const bytes = new TextEncoder().encode(text);
|
|
386
|
+
let binary = "";
|
|
387
|
+
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
388
|
+
return btoa(binary);
|
|
389
|
+
}
|
|
390
|
+
function fromBase64(value) {
|
|
391
|
+
const binary = atob(value);
|
|
392
|
+
const bytes = new Uint8Array(binary.length);
|
|
393
|
+
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
394
|
+
return new TextDecoder().decode(bytes);
|
|
395
|
+
}
|
|
396
|
+
/** https, or http to localhost only (CWD13). */
|
|
397
|
+
function checkCodecServerUrl(value) {
|
|
398
|
+
let url;
|
|
399
|
+
try {
|
|
400
|
+
url = new URL(value.trim());
|
|
401
|
+
} catch {
|
|
402
|
+
return {
|
|
403
|
+
ok: false,
|
|
404
|
+
reason: "invalid"
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
if (url.username || url.password) return {
|
|
408
|
+
ok: false,
|
|
409
|
+
reason: "invalid"
|
|
410
|
+
};
|
|
411
|
+
if (url.protocol === "https:") return {
|
|
412
|
+
ok: true,
|
|
413
|
+
url
|
|
414
|
+
};
|
|
415
|
+
if (url.protocol === "http:" && [
|
|
416
|
+
"localhost",
|
|
417
|
+
"127.0.0.1",
|
|
418
|
+
"[::1]"
|
|
419
|
+
].includes(url.hostname)) return {
|
|
420
|
+
ok: true,
|
|
421
|
+
url
|
|
422
|
+
};
|
|
423
|
+
return {
|
|
424
|
+
ok: false,
|
|
425
|
+
reason: url.protocol === "http:" ? "insecure" : "invalid"
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
/** The English of each code, the fallback the view translates from. */
|
|
429
|
+
function codecServerErrorMessage(code, params) {
|
|
430
|
+
switch (code) {
|
|
431
|
+
case "invalidUrl": return "The codec server URL must be https (or http to localhost).";
|
|
432
|
+
case "unreachable": return `The codec server could not be reached: ${params.detail ?? ""}`;
|
|
433
|
+
case "http": return `The codec server answered HTTP ${params.status ?? 0}.`;
|
|
434
|
+
case "notPayloadList": return "The codec server's answer is not a list of payloads.";
|
|
435
|
+
case "notJson": return "The codec server returned a payload that is not JSON.";
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
var CodecServerError = class extends Error {
|
|
439
|
+
code;
|
|
440
|
+
params;
|
|
441
|
+
constructor(code, params = {}) {
|
|
442
|
+
super(codecServerErrorMessage(code, params));
|
|
443
|
+
this.name = "CodecServerError";
|
|
444
|
+
this.code = code;
|
|
445
|
+
this.params = params;
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
function toTemporal(payload) {
|
|
449
|
+
const metadata = { encoding: toBase64(payload.encoding) };
|
|
450
|
+
for (const [key, value] of Object.entries(payload.metadata ?? {})) if (key !== "encoding") metadata[key] = toBase64(value);
|
|
451
|
+
return {
|
|
452
|
+
metadata,
|
|
453
|
+
data: payload.data
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function fromTemporal(payload) {
|
|
457
|
+
const metadata = payload.metadata ?? {};
|
|
458
|
+
const encoding = metadata["encoding"] ? fromBase64(metadata["encoding"]) : "json/plain";
|
|
459
|
+
const data = payload.data ?? "";
|
|
460
|
+
if (encoding === "json/plain") {
|
|
461
|
+
const text = data ? fromBase64(data) : "";
|
|
462
|
+
return text ? JSON.parse(text) : null;
|
|
463
|
+
}
|
|
464
|
+
const rest = {};
|
|
465
|
+
for (const [key, value] of Object.entries(metadata)) if (key !== "encoding") rest[key] = fromBase64(value);
|
|
466
|
+
const still = {
|
|
467
|
+
$fgp: 1,
|
|
468
|
+
encoding,
|
|
469
|
+
data
|
|
470
|
+
};
|
|
471
|
+
if (Object.keys(rest).length > 0) still.metadata = rest;
|
|
472
|
+
return still;
|
|
473
|
+
}
|
|
474
|
+
function isTemporalPayloadList(value) {
|
|
475
|
+
if (typeof value !== "object" || value === null) return false;
|
|
476
|
+
const payloads = Reflect.get(value, "payloads");
|
|
477
|
+
return Array.isArray(payloads) && payloads.every((item) => typeof item === "object" && item !== null && !Array.isArray(item));
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Decodes encoded payloads through the codec server, in order. A payload the
|
|
481
|
+
* server leaves encoded comes back as an encoded payload.
|
|
482
|
+
*/
|
|
483
|
+
async function decodePayloads(server, payloads, fetchImpl = fetch) {
|
|
484
|
+
const checked = checkCodecServerUrl(server.url);
|
|
485
|
+
if (!checked.ok) throw new CodecServerError("invalidUrl");
|
|
486
|
+
const endpoint = new URL(`${checked.url.pathname.replace(/\/+$/, "")}/decode`, checked.url);
|
|
487
|
+
let response;
|
|
488
|
+
try {
|
|
489
|
+
response = await fetchImpl(endpoint.toString(), {
|
|
490
|
+
method: "POST",
|
|
491
|
+
mode: "cors",
|
|
492
|
+
credentials: server.includeCredentials ? "include" : "omit",
|
|
493
|
+
referrerPolicy: "no-referrer",
|
|
494
|
+
headers: { "content-type": "application/json" },
|
|
495
|
+
body: JSON.stringify({ payloads: payloads.map(toTemporal) })
|
|
496
|
+
});
|
|
497
|
+
} catch (error) {
|
|
498
|
+
throw new CodecServerError("unreachable", { detail: error instanceof Error ? error.message : String(error) });
|
|
499
|
+
}
|
|
500
|
+
if (!response.ok) throw new CodecServerError("http", { status: response.status });
|
|
501
|
+
let body;
|
|
502
|
+
try {
|
|
503
|
+
body = await response.json();
|
|
504
|
+
} catch {
|
|
505
|
+
throw new CodecServerError("notPayloadList");
|
|
506
|
+
}
|
|
507
|
+
if (!isTemporalPayloadList(body) || body.payloads.length !== payloads.length) throw new CodecServerError("notPayloadList");
|
|
508
|
+
try {
|
|
509
|
+
return body.payloads.map(fromTemporal);
|
|
510
|
+
} catch {
|
|
511
|
+
throw new CodecServerError("notJson");
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export { encodedPayloadBytes as a, budgetInputValue as c, withBudgetMode as d, EffectBadge as f, useRunPolicyDecisions as h, decodePayloads as i, formatBudgetUsd as l, useActionPolicies as m, checkCodecServerUrl as n, isEncodedPayload as o, effectLabel as p, containsEncodedPayload as r, BUDGET_DIMENSIONS as s, CodecServerError as t, withBudgetLimit as u };
|