@burdenoff/fluidgrids-fe-sdk 2026.1031.3 → 2026.1031.5

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 (41) hide show
  1. package/dist/ExecutionDetailPage-RZZJHBK3.js +22 -0
  2. package/dist/{ExecutionsListPage-AYDGFU6W.js → ExecutionsListPage-QXYQ5YEE.js} +8 -8
  3. package/dist/{WorkflowBuilder-N3ZUYFRK.js → WorkflowBuilder-KZKWWJZO.js} +11 -11
  4. package/dist/{WorkflowsList-BZXBTGNL.js → WorkflowsList-EHQTSSJY.js} +8 -8
  5. package/dist/{chunk-IGROOI7E.js → chunk-3B2VD4N4.js} +2 -2
  6. package/dist/{chunk-CIR7WF4W.js → chunk-4OOE56HK.js} +1 -1
  7. package/dist/{chunk-44KAAKFK.js → chunk-4VAPV7YT.js} +5 -5
  8. package/dist/{chunk-P3TGCUXP.js → chunk-6YGBRJNV.js} +5 -37
  9. package/dist/{chunk-R4Q37Q4X.js → chunk-7SUFXFQN.js} +3 -3
  10. package/dist/{chunk-OGYAC7QW.js → chunk-AHDYETEE.js} +1 -1
  11. package/dist/{chunk-475XP5J7.js → chunk-AWQCF6GS.js} +5 -5
  12. package/dist/{chunk-ADTEMSJI.js → chunk-BWQW6YSJ.js} +849 -4
  13. package/dist/{chunk-PKG6BCHB.js → chunk-E3KE67MX.js} +2 -2
  14. package/dist/{chunk-WHPQRYZD.js → chunk-H5HYJUUS.js} +5 -5
  15. package/dist/{chunk-Z3FYBDE3.js → chunk-HQX7JZLY.js} +33 -1
  16. package/dist/{chunk-BHD4CDLL.js → chunk-JQUFGF5P.js} +1 -1
  17. package/dist/{chunk-AW3UXMNI.js → chunk-KEYKB4E7.js} +12 -1
  18. package/dist/{chunk-DHR2YURL.js → chunk-KUSE5B2O.js} +163 -9
  19. package/dist/{chunk-XX6D7IND.js → chunk-NVAXIB4O.js} +2 -2
  20. package/dist/{chunk-6PGLJWIC.js → chunk-OXLYHOSQ.js} +30 -8
  21. package/dist/{chunk-Q3HKE627.js → chunk-QLE7GSOQ.js} +3 -3
  22. package/dist/{chunk-QKQOTEAB.js → chunk-S2I6ABXE.js} +1 -1
  23. package/dist/{chunk-INMYNHJL.js → chunk-TVOXRODW.js} +34 -2
  24. package/dist/{chunk-PTROESUB.js → chunk-UHG27FEH.js} +4 -4
  25. package/dist/{chunk-DJAGZUHW.js → chunk-VILOIOPD.js} +1238 -26
  26. package/dist/{chunk-GV5RJ6BU.js → chunk-X3WUWLRX.js} +4 -4
  27. package/dist/{chunk-JFQGODKK.js → chunk-XLAH4NWJ.js} +1 -1
  28. package/dist/{chunk-VJWJGSRS.js → chunk-YBJOZDR6.js} +1 -1
  29. package/dist/{chunk-P2VAHDGO.js → chunk-YQNL73BB.js} +2 -2
  30. package/dist/executions.js +12 -12
  31. package/dist/history.js +4 -4
  32. package/dist/index.d.ts +741 -4
  33. package/dist/index.js +38 -38
  34. package/dist/nodes.js +2 -2
  35. package/dist/observability.js +6 -6
  36. package/dist/settings.js +6 -6
  37. package/dist/templates.js +10 -10
  38. package/dist/workflow-builder.js +12 -12
  39. package/dist/workflows-list.js +8 -8
  40. package/package.json +3 -2
  41. package/dist/ExecutionDetailPage-WOOORXXU.js +0 -22
@@ -1,20 +1,21 @@
1
1
  import { deepClone, applyTemplateInputs } from './chunk-GEMNVFPK.js';
2
2
  import { templatePreview } from './chunk-B6CCE2RW.js';
3
3
  import { Input } from './chunk-IEVSFCFS.js';
4
- import { Dialog as Dialog$1, DialogContent as DialogContent$1, DialogHeader as DialogHeader$1, DialogTitle as DialogTitle$1, DialogDescription as DialogDescription$1, DialogFooter } from './chunk-YXMFRQYV.js';
4
+ import { Dialog as Dialog$1, DialogContent as DialogContent$1, DialogHeader as DialogHeader$1, DialogTitle as DialogTitle$1, DialogDescription as DialogDescription$1, DialogFooter as DialogFooter$1 } from './chunk-YXMFRQYV.js';
5
5
  import { Badge as Badge$1, Button } from './chunk-BQXVT32O.js';
6
- import { QuotaExhaustedDialog, useWorkflowCodeExport, orderedExportFiles, fileBaseName, downloadWorkflowCodeExport, isLosslessReport, sortFidelityItems, isLossyFidelityItem, lineOfNode } from './chunk-IGROOI7E.js';
7
- import { EntityTagPicker, useWorkflowProposal, WorkflowProposalCard, useRunHistory, RunHistoryView, SignalRunDialog } from './chunk-ADTEMSJI.js';
6
+ import { QuotaExhaustedDialog, useWorkflowCodeExport, orderedExportFiles, fileBaseName, downloadWorkflowCodeExport, isLosslessReport, sortFidelityItems, isLossyFidelityItem, lineOfNode } from './chunk-3B2VD4N4.js';
7
+ import { emptyTestCaseDraft, EntityTagPicker, useWorkflowProposal, WorkflowProposalCard, useRunHistory, RunHistoryView, SignalRunDialog, readAssertRulesSetting, rowsFromRules, normaliseAssertRules, ruleFromRow, describeAssertRuleProblem, operatorSpec, ASSERT_OPERATORS, emptyAssertRuleRow, useWorkflowTests, pinnedOutputsFromCanvas, enabledCaseIds, isTestRunOpen, MAX_TEST_CASES, draftFromTestCase, testRunSummaryText, testStatusLabel, TEST_STATUS_TONE_CLASS, testStatusTone, MAX_CASE_NAME, nextSortOrder, draftToInput } from './chunk-BWQW6YSJ.js';
8
+ import { buildNodeDisplayMap } from './chunk-TVOXRODW.js';
8
9
  import { AiCreditBalanceSlot } from './chunk-Y53CVZVV.js';
9
- import { useRestoreWorkflowVersion, useWorkflowVersions, useActivateWorkflow, useDeleteWorkflow, useLazyWorkflowDefinition, useDeactivateWorkflow } from './chunk-PKG6BCHB.js';
10
- import { isAgentNodeType, AgentDefinitionSelectField } from './chunk-JFQGODKK.js';
10
+ import { useRestoreWorkflowVersion, useWorkflowVersions, useActivateWorkflow, useDeleteWorkflow, useLazyWorkflowDefinition, useDeactivateWorkflow } from './chunk-E3KE67MX.js';
11
+ import { isAgentNodeType, AgentDefinitionSelectField } from './chunk-XLAH4NWJ.js';
11
12
  import { FluidGridsDocsLink } from './chunk-4VJ3MDOV.js';
12
- import { leaseCallQueue, NODE_CONFIGS, createConfiguredNode, resolveOutputHandles, resolveInputHandles, isNodeConfigsInitialized, useFlowStore, getNodeDetail, useSaveStatusStore, isNodeTypeHiddenFromPalette, liveInternalOperations, resolveNodeOperation, readDisplayOptions, parseParameterValue, canAutosave, STICKY_NOTE_TYPE, isNodeTrigger, resolveUiSpec, RUNS_QUOTA_NAME, throwIfResultError, BILLING_PLANS_PATH, emitUpgradeClicked, FluidGridsContext, emitWorkflowCreated, emitTemplateUsed, describeOperationError, ensureNodeConfigsLoaded, useEditLeaseStore, useEditLeaseLocked, registerWorkflowNodeTypes, emitNodeInstalled, useNodeExecution, usePaletteGates, onNodeTypesUpdate, NODE_TYPES, getNodeMetadata, useIsValidConnection, BuilderReadOnlyProvider, refetchStoreNodes, AVAILABLE_NODES, EDIT_SESSION_ID, useFluidGridsPermission, FLUIDGRIDS_PERMISSIONS, useInsertNode, NODE_TYPE_DRAG_DATA_FORMAT, NODE_OPERATION_DRAG_DATA_FORMAT, useDurableFunctionNodesEnabled, CODE_WORKFLOW_NODE_TYPE, SdkPermissionButton, bannerOf, useSaveWorkflow, useBuilderReadOnly, fieldsFromValue, filterPaletteNodes, useFluidGridsAnalytics, sessionBeforeReload, forgetSessionForReload, releasesOnClose, editStateOf, workflowFingerprint, isLocked, buildStickyNode, useNodeRegistryRevision, fieldsFromIO, readCodeWorkflowState, useCodeWorkflowInterface, clearCodeWorkflowDefinitionCache, isParamVisible, ConnectionSelector, structuredParameterType, nodeAccent, NodeTypeIcon, NODES_METADATA, shouldReleaseForIdle, tickAction, rememberSessionForReload, buildOperationSeed, useDurableParityEnabled, useConnections, ConnectionFormDialog, useFluidGridsFlag, FLUIDGRIDS_FLAGS, saveIndicatorOf, inAppLeaveTarget, declaredOutputFields, subscribeWorkflowSaved, pathToExpression, diagnosticsByPath, interfaceHandlers, declaredSignals, ExpressionEditor, toCodeMirrorDiagnostics, formatParameterValue, leaveNeedsConfirmation, phaseAfterAcquire, rememberOwnStatusChange, snapshotForSave, childRunIdOf, defaultSourcePath, projectLanguage, changedSourceFiles, isEditableSourcePath, sourceLanguageOf, interfaceFields, isImageIcon, NODES, synchronizeOperationUpdate, NodePropertyPanel, loadDefinitionJson, openRunQuotaUpgradePrompt, isTriggerOperation, canRenderOperationPanel, runPreparationOf, resolveOperationName, savesInPlace, AUTOSAVE_RETRY_DELAYS_MS, AUTOSAVE_DEBOUNCE_MS, rememberRevision, phaseAfterTakeOver } from './chunk-6PGLJWIC.js';
13
+ import { leaseCallQueue, NODE_CONFIGS, createConfiguredNode, resolveOutputHandles, resolveInputHandles, isNodeConfigsInitialized, useFlowStore, getNodeDetail, useSaveStatusStore, isNodeTypeHiddenFromPalette, liveInternalOperations, resolveNodeOperation, readDisplayOptions, parseParameterValue, canAutosave, STICKY_NOTE_TYPE, isNodeTrigger, resolveUiSpec, RUNS_QUOTA_NAME, throwIfResultError, BILLING_PLANS_PATH, emitUpgradeClicked, FluidGridsContext, emitWorkflowCreated, emitTemplateUsed, describeOperationError, ensureNodeConfigsLoaded, useEditLeaseStore, useEditLeaseLocked, registerWorkflowNodeTypes, emitNodeInstalled, useNodeExecution, usePaletteGates, onNodeTypesUpdate, NODE_TYPES, getNodeMetadata, useIsValidConnection, BuilderReadOnlyProvider, refetchStoreNodes, AVAILABLE_NODES, EDIT_SESSION_ID, useFluidGridsPermission, FLUIDGRIDS_PERMISSIONS, useInsertNode, NODE_TYPE_DRAG_DATA_FORMAT, NODE_OPERATION_DRAG_DATA_FORMAT, useDurableFunctionNodesEnabled, CODE_WORKFLOW_NODE_TYPE, SdkPermissionButton, bannerOf, useSaveWorkflow, useBuilderReadOnly, fieldsFromValue, filterPaletteNodes, useFluidGridsAnalytics, sessionBeforeReload, forgetSessionForReload, releasesOnClose, editStateOf, workflowFingerprint, isLocked, buildStickyNode, useNodeRegistryRevision, fieldsFromIO, readCodeWorkflowState, useCodeWorkflowInterface, clearCodeWorkflowDefinitionCache, isParamVisible, ConnectionSelector, structuredParameterType, nodeAccent, NodeTypeIcon, NODES_METADATA, shouldReleaseForIdle, tickAction, rememberSessionForReload, buildOperationSeed, useDurableParityEnabled, useConnections, ConnectionFormDialog, useWorkflowTestsEnabled, useFluidGridsFlag, FLUIDGRIDS_FLAGS, saveIndicatorOf, inAppLeaveTarget, declaredOutputFields, subscribeWorkflowSaved, pathToExpression, diagnosticsByPath, interfaceHandlers, declaredSignals, ExpressionEditor, toCodeMirrorDiagnostics, formatParameterValue, leaveNeedsConfirmation, phaseAfterAcquire, rememberOwnStatusChange, snapshotForSave, childRunIdOf, defaultSourcePath, projectLanguage, changedSourceFiles, isEditableSourcePath, sourceLanguageOf, interfaceFields, isImageIcon, NODES, synchronizeOperationUpdate, NodePropertyPanel, loadDefinitionJson, openRunQuotaUpgradePrompt, isTriggerOperation, canRenderOperationPanel, runPreparationOf, resolveOperationName, savesInPlace, AUTOSAVE_RETRY_DELAYS_MS, AUTOSAVE_DEBOUNCE_MS, rememberRevision, phaseAfterTakeOver } from './chunk-OXLYHOSQ.js';
13
14
  import { cn } from './chunk-JL7CASN5.js';
14
15
  import { getGlobalStoreClient } from './chunk-PXIFUMLA.js';
15
16
  import { getFluidGridsConfig } from './chunk-6AMNEX2Y.js';
16
17
  import { GetMyNodeInstallationsDocument, BrowseWorkflowTemplatesDocument, InstallWorkflowNodeDocument, SubmitWorkflowTemplateDocument, MyWorkflowTemplateSubmissionsDocument, WithdrawWorkflowTemplateSubmissionDocument, InstallPurchasedNodeDocument, BrowseWorkflowNodesDocument, UninstallWorkflowNodeDocument, CreateStoreOrderDocument, GetNodeInstallableVersionsDocument, OrganizationPrivateNodesDocument, InstallOrganizationPrivateNodeDocument, UninstallOrganizationPrivateNodeDocument } from './chunk-G77IGC3Y.js';
17
- import { WorkspaceRunsQuotaDocument, WorkflowGenerationTemplatesDocument, ReleaseWorkflowEditLeaseDocument, NodeSchemaIntrospectionDocument, useWorkflowPinnedDataQuery, usePinNodeDataMutation, useUnpinNodeDataMutation, useRunFromNodeEligibilityQuery, EventRegistrationsDocument, AcquireWorkflowEditLeaseDocument, WorkflowEnvironmentsDocument, WorkflowPromotionRequestsDocument, DeployWorkflowVersionToDevDocument, RequestWorkflowPromotionDocument, ApproveWorkflowPromotionDocument, RejectWorkflowPromotionDocument, CancelWorkflowPromotionDocument, UpdateWorkflowEnvironmentPolicyDocument, WorkflowGitRepositoryDocument, WorkflowGitPushesDocument, WorkflowGitCommitsDocument, LinkWorkflowGitRepositoryDocument, UnlinkWorkflowGitRepositoryDocument, PushWorkflowToGitDocument, WorkflowGitDiffDocument, RestoreWorkflowFromGitDocument, WorkflowAuthoringDocument, NodeStatesDocument, PreviewScheduleDocument, WorkflowEditLeaseDocument, WorkflowVersioningDocument, WorkflowVersionDrainageDocument, ActivateWorkflowVersionCheckedDocument, WorkflowDefinitionDocument, WorkflowCodeSourceDocument, WorkflowEditLeaseStatusDocument, BuildWorkflowCodeDocument, WebhookTestListenerDocument, StopWebhookTestListenerDocument, ListenForWebhookTestEventDocument, NodeUsageStatusDocument, RemoveNodeFromWorkflowsDocument, SetWorkflowRolloutDocument, DeleteWorkflowRolloutDocument, TakeOverWorkflowEditLeaseDocument } from './chunk-AW3UXMNI.js';
18
+ import { WorkspaceRunsQuotaDocument, WorkflowGenerationTemplatesDocument, ReleaseWorkflowEditLeaseDocument, NodeSchemaIntrospectionDocument, useWorkflowPinnedDataQuery, usePinNodeDataMutation, useUnpinNodeDataMutation, useRunFromNodeEligibilityQuery, EventRegistrationsDocument, AcquireWorkflowEditLeaseDocument, WorkflowEnvironmentsDocument, WorkflowPromotionRequestsDocument, DeployWorkflowVersionToDevDocument, RequestWorkflowPromotionDocument, ApproveWorkflowPromotionDocument, RejectWorkflowPromotionDocument, CancelWorkflowPromotionDocument, UpdateWorkflowEnvironmentPolicyDocument, WorkflowGitRepositoryDocument, WorkflowGitPushesDocument, WorkflowGitCommitsDocument, LinkWorkflowGitRepositoryDocument, UnlinkWorkflowGitRepositoryDocument, PushWorkflowToGitDocument, WorkflowGitDiffDocument, RestoreWorkflowFromGitDocument, WorkflowAuthoringDocument, NodeStatesDocument, PreviewScheduleDocument, WorkflowEditLeaseDocument, WorkflowVersioningDocument, WorkflowVersionDrainageDocument, ActivateWorkflowVersionCheckedDocument, WorkflowDefinitionDocument, WorkflowCodeSourceDocument, WorkflowEditLeaseStatusDocument, BuildWorkflowCodeDocument, WebhookTestListenerDocument, StopWebhookTestListenerDocument, ListenForWebhookTestEventDocument, NodeUsageStatusDocument, RemoveNodeFromWorkflowsDocument, SetWorkflowRolloutDocument, DeleteWorkflowRolloutDocument, TakeOverWorkflowEditLeaseDocument } from './chunk-KEYKB4E7.js';
18
19
  import { useTr } from './chunk-UULVIT25.js';
19
20
  import { getFluidGridsClient, waitForFluidGridsClient, getFluidGridsClientSafe } from './chunk-NTWG3CJX.js';
20
21
  import { __export } from './chunk-62GWEYJ5.js';
@@ -24,13 +25,13 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
24
25
  import * as PopoverPrimitive from '@radix-ui/react-popover';
25
26
  import { gql } from '@apollo/client';
26
27
  import { cn as cn$1 } from '@burdenoff/fe-libs/utils';
27
- import { Card as Card$1, Badge, CardContent as CardContent$1, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Button as Button$1, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Popover as Popover$1, PopoverTrigger as PopoverTrigger$1, PopoverContent as PopoverContent$1, AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, Toaster, Tabs, TabsList, TabsTrigger, TabsContent, CardHeader as CardHeader$1, CardTitle as CardTitle$1, CardDescription as CardDescription$1, ScrollArea, Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Label, Textarea, AlertDialogAction, TooltipProvider, Switch, Input as Input$1, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, Skeleton, Tooltip, TooltipTrigger, TooltipContent, DropdownMenuLabel, DropdownMenuSeparator } from '@burdenoff/fe-libs/ui';
28
+ import { Card as Card$1, Badge, CardContent as CardContent$1, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Button as Button$1, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Popover as Popover$1, PopoverTrigger as PopoverTrigger$1, PopoverContent as PopoverContent$1, AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, Toaster, Tabs, TabsList, TabsTrigger, TabsContent, CardHeader as CardHeader$1, CardTitle as CardTitle$1, CardDescription as CardDescription$1, ScrollArea, Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, Label, Textarea, AlertDialogAction, TooltipProvider, Switch, Input as Input$1, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, Skeleton, Tooltip, TooltipTrigger, TooltipContent, DialogFooter, DropdownMenuLabel, DropdownMenuSeparator } from '@burdenoff/fe-libs/ui';
28
29
  import { Link, useParams, useNavigate } from 'react-router';
29
30
  import { useEventBus } from '@burdenoff/fe-libs/shared/events';
30
31
  import { useQuery, useMutation } from '@apollo/client/react';
31
32
  import { gql as gql$1 } from '@apollo/client/core';
32
33
  import 'jszip';
33
- import { Sparkles, Star, Download, Eye, Maximize2, Undo2, Redo2, LayoutGrid, Keyboard, Plus, Trash2, GitBranch, Loader2, AlertCircle, Search, RefreshCw, History, GitCompareArrows, Play, RotateCcw, Layers, Upload, Rocket, ArrowRight, Check, X, Link2, Unlink, GitCompare, ExternalLink, GitCommitHorizontal, CircleHelp, CheckCircle2, Package, SlidersHorizontal, Info, Copy, BadgeCheck, DollarSign, Type, Code, Hash, List, Braces, Workflow, PlusCircle, ChevronDown, ChevronRight, AlertTriangle } from 'lucide-react';
34
+ import { Sparkles, Star, Download, Eye, Maximize2, Undo2, Redo2, LayoutGrid, Keyboard, Plus, Trash2, GitBranch, Loader2, AlertCircle, Search, RefreshCw, History, GitCompareArrows, Play, RotateCcw, Layers, Upload, Rocket, ArrowRight, Check, X, Link2, Unlink, GitCompare, ExternalLink, GitCommitHorizontal, CircleHelp, CheckCircle2, Package, SlidersHorizontal, FlaskConical, Pencil, Info, Copy, BadgeCheck, DollarSign, Type, Code, Hash, List, Braces, Workflow, PlusCircle, ChevronDown, ChevronRight, AlertTriangle } from 'lucide-react';
34
35
  import { Icon } from '@iconify/react';
35
36
  import { create } from 'zustand';
36
37
  import { toast } from 'sonner';
@@ -27241,8 +27242,8 @@ var reducer = (state, action) => {
27241
27242
  if (toastId) {
27242
27243
  addToRemoveQueue(toastId);
27243
27244
  } else {
27244
- state.toasts.forEach((toast18) => {
27245
- addToRemoveQueue(toast18.id);
27245
+ state.toasts.forEach((toast19) => {
27246
+ addToRemoveQueue(toast19.id);
27246
27247
  });
27247
27248
  }
27248
27249
  return {
@@ -28618,7 +28619,7 @@ function VisualMapperContent({
28618
28619
  mapping,
28619
28620
  onMappingChange
28620
28621
  }) {
28621
- const { toast: toast18 } = useToast();
28622
+ const { toast: toast19 } = useToast();
28622
28623
  const tr = useTr();
28623
28624
  const reactFlowWrapper = useRef(null);
28624
28625
  const [selectedSourceNode, setSelectedSourceNode] = useState(null);
@@ -28638,7 +28639,7 @@ function VisualMapperContent({
28638
28639
  targetOperation
28639
28640
  );
28640
28641
  if (generatedNodes.length === 0) {
28641
- toast18({
28642
+ toast19({
28642
28643
  title: tr(
28643
28644
  "fluidgrids.builder.visualMapper.noFieldsFoundTitle",
28644
28645
  "No fields found"
@@ -28664,7 +28665,7 @@ function VisualMapperContent({
28664
28665
  targetNode,
28665
28666
  targetOperation,
28666
28667
  setNodes,
28667
- toast18,
28668
+ toast19,
28668
28669
  tr
28669
28670
  ]);
28670
28671
  useEffect(() => {
@@ -28771,7 +28772,7 @@ function VisualMapperContent({
28771
28772
  }
28772
28773
  onMappingChange(updatedMapping);
28773
28774
  if (isCompatible) {
28774
- toast18({
28775
+ toast19({
28775
28776
  title: tr(
28776
28777
  "fluidgrids.builder.visualMapper.mappingCreatedTitle",
28777
28778
  "Mapping created"
@@ -28779,7 +28780,7 @@ function VisualMapperContent({
28779
28780
  description: `Mapped ${sourcePath} (${sourceType}) to ${targetPath} (${targetType})`
28780
28781
  });
28781
28782
  } else {
28782
- toast18({
28783
+ toast19({
28783
28784
  title: tr(
28784
28785
  "fluidgrids.builder.visualMapper.typeMismatchTitle",
28785
28786
  "Type mismatch warning"
@@ -28789,7 +28790,7 @@ function VisualMapperContent({
28789
28790
  });
28790
28791
  }
28791
28792
  } else {
28792
- toast18({
28793
+ toast19({
28793
28794
  title: tr(
28794
28795
  "fluidgrids.builder.visualMapper.invalidMappingTitle",
28795
28796
  "Invalid mapping"
@@ -28802,7 +28803,7 @@ function VisualMapperContent({
28802
28803
  });
28803
28804
  }
28804
28805
  },
28805
- [nodes, mapping, onMappingChange, toast18, tr, setEdges]
28806
+ [nodes, mapping, onMappingChange, toast19, tr, setEdges]
28806
28807
  );
28807
28808
  const onEdgeDelete = useCallback(
28808
28809
  (edge) => {
@@ -28859,7 +28860,7 @@ function VisualMapperContent({
28859
28860
  const handleSaveMappingDialog = (expression, targetFieldName) => {
28860
28861
  const targetPath = targetFieldName || selectedTargetNode?.data?.path;
28861
28862
  if (!targetPath) {
28862
- toast18({
28863
+ toast19({
28863
28864
  title: tr(
28864
28865
  "fluidgrids.builder.visualMapper.noTargetFieldTitle",
28865
28866
  "No target field specified"
@@ -28891,7 +28892,7 @@ function VisualMapperContent({
28891
28892
  }
28892
28893
  onMappingChange(updatedMapping);
28893
28894
  const mappingType = detectMappingType(expression);
28894
- toast18({
28895
+ toast19({
28895
28896
  title: `${mappingType.charAt(0).toUpperCase() + mappingType.slice(1)} mapping created`,
28896
28897
  description: `${tr("fluidgrids.builder.visualMapper.appliedMappingTo", "Applied mapping to")} ${targetPath}`
28897
28898
  });
@@ -29190,7 +29191,7 @@ function MappingEditor({
29190
29191
  setEdges,
29191
29192
  edgeId
29192
29193
  }) {
29193
- const { toast: toast18 } = useToast();
29194
+ const { toast: toast19 } = useToast();
29194
29195
  const tr = useTr();
29195
29196
  const [mappingJson, setMappingJson] = useState({});
29196
29197
  const [jsonDataString, setJsonDataString] = useState(
@@ -29314,7 +29315,7 @@ function MappingEditor({
29314
29315
  const handleSaveMapping = () => {
29315
29316
  try {
29316
29317
  checkJsonValidity();
29317
- toast18({
29318
+ toast19({
29318
29319
  title: tr(
29319
29320
  "fluidgrids.builder.mappingEditor.mappingSavedTitle",
29320
29321
  "Mapping saved"
@@ -29325,7 +29326,7 @@ function MappingEditor({
29325
29326
  )
29326
29327
  });
29327
29328
  } catch (error62) {
29328
- toast18({
29329
+ toast19({
29329
29330
  title: tr(
29330
29331
  "fluidgrids.builder.mappingEditor.errorSavingTitle",
29331
29332
  "Error saving mapping"
@@ -29344,7 +29345,7 @@ function MappingEditor({
29344
29345
  const parsedData = checkJsonValidity();
29345
29346
  const result = await applyMapping(parsedData, sampleInput);
29346
29347
  setPreviewOutput(result);
29347
- toast18({
29348
+ toast19({
29348
29349
  title: tr(
29349
29350
  "fluidgrids.builder.mappingEditor.mappingTestedTitle",
29350
29351
  "Mapping tested"
@@ -29356,7 +29357,7 @@ function MappingEditor({
29356
29357
  });
29357
29358
  } catch (error62) {
29358
29359
  console.error("Test mapping error:", error62);
29359
- toast18({
29360
+ toast19({
29360
29361
  title: tr(
29361
29362
  "fluidgrids.builder.mappingEditor.mappingTestFailedTitle",
29362
29363
  "Mapping test failed"
@@ -38540,6 +38541,284 @@ function ScheduleRulesEditor({
38540
38541
  }
38541
38542
  );
38542
38543
  }
38544
+ var rowInput3 = "rounded-md border border-input bg-background px-2 py-1 text-xs text-foreground outline-none focus:border-primary";
38545
+ function serialiseRows(rows, previous) {
38546
+ const rules = rows.map(ruleFromRow);
38547
+ return Array.isArray(previous) ? rules : JSON.stringify(rules, null, 2);
38548
+ }
38549
+ function textOf(value) {
38550
+ if (typeof value === "string") return value;
38551
+ if (value === void 0 || value === null) return "";
38552
+ return JSON.stringify(value, null, 2);
38553
+ }
38554
+ function AssertRulesEditor({
38555
+ value,
38556
+ onChange,
38557
+ testIdPrefix = "ndv"
38558
+ }) {
38559
+ const tr = useTr();
38560
+ const initial = readAssertRulesSetting(value);
38561
+ const [rows, setRows] = useState(
38562
+ () => rowsFromRules(initial ?? [])
38563
+ );
38564
+ const [jsonView, setJsonView] = useState(initial === null);
38565
+ const [jsonText, setJsonText] = useState(() => textOf(value));
38566
+ const written = useRef(value);
38567
+ useEffect(() => {
38568
+ if (value === written.current) return;
38569
+ written.current = value;
38570
+ const parsed = readAssertRulesSetting(value);
38571
+ setJsonText(textOf(value));
38572
+ if (parsed === null) {
38573
+ setJsonView(true);
38574
+ } else {
38575
+ setRows(rowsFromRules(parsed));
38576
+ }
38577
+ }, [value]);
38578
+ const write = (next) => {
38579
+ written.current = next;
38580
+ onChange(next);
38581
+ };
38582
+ const setRowList = (next) => {
38583
+ setRows(next);
38584
+ const serialised = serialiseRows(next, value);
38585
+ setJsonText(textOf(serialised));
38586
+ write(serialised);
38587
+ };
38588
+ const setRow = (index, patch) => {
38589
+ const next = rows.slice();
38590
+ const current = next[index];
38591
+ if (!current) return;
38592
+ next[index] = { ...current, ...patch };
38593
+ setRowList(next);
38594
+ };
38595
+ const parsedJson = jsonView ? readAssertRulesSetting(jsonText) : null;
38596
+ const check2 = normaliseAssertRules(
38597
+ jsonView ? parsedJson ?? [] : rows.map(ruleFromRow)
38598
+ );
38599
+ const problem = jsonView && parsedJson === null ? {
38600
+ key: "fluidgrids.builder.assertRules.invalidJson",
38601
+ fallback: "The rules must be a JSON array."
38602
+ } : "problem" in check2 ? describeAssertRuleProblem(check2.problem) : null;
38603
+ const toggleView = () => {
38604
+ if (jsonView) {
38605
+ const parsed = readAssertRulesSetting(jsonText);
38606
+ if (parsed === null) return;
38607
+ setRows(rowsFromRules(parsed));
38608
+ setJsonView(false);
38609
+ } else {
38610
+ setJsonText(textOf(serialiseRows(rows, value)));
38611
+ setJsonView(true);
38612
+ }
38613
+ };
38614
+ return /* @__PURE__ */ jsxs(
38615
+ "div",
38616
+ {
38617
+ className: "flex flex-col gap-2",
38618
+ "data-testid": `${testIdPrefix}-assert-rules`,
38619
+ children: [
38620
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx(
38621
+ "button",
38622
+ {
38623
+ type: "button",
38624
+ onClick: toggleView,
38625
+ disabled: jsonView && parsedJson === null,
38626
+ className: "text-[11px] text-primary hover:underline disabled:opacity-50",
38627
+ "data-testid": `${testIdPrefix}-assert-rules-view`,
38628
+ children: jsonView ? tr("fluidgrids.builder.assertRules.showRows", "Edit as rows") : tr("fluidgrids.builder.assertRules.showJson", "Edit as JSON")
38629
+ }
38630
+ ) }),
38631
+ jsonView ? /* @__PURE__ */ jsx(
38632
+ "textarea",
38633
+ {
38634
+ value: jsonText,
38635
+ rows: 8,
38636
+ spellCheck: false,
38637
+ "aria-label": tr(
38638
+ "fluidgrids.builder.assertRules.jsonLabel",
38639
+ "Rules (JSON array)"
38640
+ ),
38641
+ onChange: (event) => {
38642
+ setJsonText(event.target.value);
38643
+ write(
38644
+ Array.isArray(value) ? readAssertRulesSetting(event.target.value) ?? value : event.target.value
38645
+ );
38646
+ },
38647
+ className: cn$1(rowInput3, "w-full font-mono"),
38648
+ "data-testid": `${testIdPrefix}-assert-rules-json`
38649
+ }
38650
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
38651
+ rows.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: tr(
38652
+ "fluidgrids.builder.assertRules.empty",
38653
+ "Add at least one rule."
38654
+ ) }),
38655
+ rows.map((row, index) => {
38656
+ const operand = operatorSpec(row.operator)?.operand ?? "expected";
38657
+ return /* @__PURE__ */ jsxs(
38658
+ "div",
38659
+ {
38660
+ className: "rounded-md border border-border p-2",
38661
+ "data-testid": `${testIdPrefix}-assert-rule-${index}`,
38662
+ children: [
38663
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
38664
+ /* @__PURE__ */ jsxs("span", { className: "text-[10px] font-semibold text-muted-foreground", children: [
38665
+ index + 1,
38666
+ "."
38667
+ ] }),
38668
+ /* @__PURE__ */ jsx(
38669
+ "input",
38670
+ {
38671
+ type: "text",
38672
+ value: row.path,
38673
+ placeholder: tr(
38674
+ "fluidgrids.builder.assertRules.pathPlaceholder",
38675
+ "path, e.g. body.items.0.id (empty = whole input)"
38676
+ ),
38677
+ "aria-label": tr(
38678
+ "fluidgrids.builder.assertRules.path",
38679
+ "Path"
38680
+ ),
38681
+ onChange: (event) => setRow(index, { path: event.target.value }),
38682
+ className: cn$1(rowInput3, "min-w-0 flex-1 font-mono")
38683
+ }
38684
+ ),
38685
+ /* @__PURE__ */ jsx(
38686
+ "select",
38687
+ {
38688
+ value: row.operator,
38689
+ "aria-label": tr(
38690
+ "fluidgrids.builder.assertRules.operator",
38691
+ "Operator"
38692
+ ),
38693
+ onChange: (event) => setRow(index, { operator: event.target.value }),
38694
+ className: rowInput3,
38695
+ children: ASSERT_OPERATORS.map((spec) => /* @__PURE__ */ jsx("option", { value: spec.wire, children: tr(
38696
+ `fluidgrids.builder.assertRules.op.${spec.wire}`,
38697
+ spec.label
38698
+ ) }, spec.wire))
38699
+ }
38700
+ ),
38701
+ /* @__PURE__ */ jsx(
38702
+ "button",
38703
+ {
38704
+ type: "button",
38705
+ onClick: () => setRowList(rows.filter((_, i) => i !== index)),
38706
+ title: tr(
38707
+ "fluidgrids.builder.assertRules.remove",
38708
+ "Remove rule"
38709
+ ),
38710
+ className: "rounded p-0.5 text-muted-foreground hover:text-[var(--color-status-error-text)]",
38711
+ children: /* @__PURE__ */ jsx(X, { className: "size-4" })
38712
+ }
38713
+ )
38714
+ ] }),
38715
+ operand === "expected" && /* @__PURE__ */ jsx(
38716
+ "input",
38717
+ {
38718
+ type: "text",
38719
+ value: row.expected,
38720
+ placeholder: row.operator === "matches" ? tr(
38721
+ "fluidgrids.builder.assertRules.regexPlaceholder",
38722
+ "regular expression, e.g. ^ord_"
38723
+ ) : tr(
38724
+ "fluidgrids.builder.assertRules.expectedPlaceholder",
38725
+ 'expected value as JSON, e.g. 42, "ok" or {"a": 1}'
38726
+ ),
38727
+ "aria-label": tr(
38728
+ "fluidgrids.builder.assertRules.expected",
38729
+ "Expected"
38730
+ ),
38731
+ onChange: (event) => setRow(index, { expected: event.target.value }),
38732
+ className: cn$1(rowInput3, "mt-1.5 w-full font-mono")
38733
+ }
38734
+ ),
38735
+ operand === "range" && /* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex gap-1.5", children: [
38736
+ /* @__PURE__ */ jsx(
38737
+ "input",
38738
+ {
38739
+ type: "text",
38740
+ inputMode: "decimal",
38741
+ value: row.min,
38742
+ placeholder: tr(
38743
+ "fluidgrids.builder.assertRules.min",
38744
+ "min"
38745
+ ),
38746
+ "aria-label": tr(
38747
+ "fluidgrids.builder.assertRules.min",
38748
+ "min"
38749
+ ),
38750
+ onChange: (event) => setRow(index, { min: event.target.value }),
38751
+ className: cn$1(rowInput3, "w-full")
38752
+ }
38753
+ ),
38754
+ /* @__PURE__ */ jsx(
38755
+ "input",
38756
+ {
38757
+ type: "text",
38758
+ inputMode: "decimal",
38759
+ value: row.max,
38760
+ placeholder: tr(
38761
+ "fluidgrids.builder.assertRules.max",
38762
+ "max"
38763
+ ),
38764
+ "aria-label": tr(
38765
+ "fluidgrids.builder.assertRules.max",
38766
+ "max"
38767
+ ),
38768
+ onChange: (event) => setRow(index, { max: event.target.value }),
38769
+ className: cn$1(rowInput3, "w-full")
38770
+ }
38771
+ )
38772
+ ] }),
38773
+ /* @__PURE__ */ jsx(
38774
+ "input",
38775
+ {
38776
+ type: "text",
38777
+ value: row.message,
38778
+ placeholder: tr(
38779
+ "fluidgrids.builder.assertRules.messagePlaceholder",
38780
+ "message when it does not hold (optional)"
38781
+ ),
38782
+ "aria-label": tr(
38783
+ "fluidgrids.builder.assertRules.message",
38784
+ "Message"
38785
+ ),
38786
+ onChange: (event) => setRow(index, { message: event.target.value }),
38787
+ className: cn$1(rowInput3, "mt-1.5 w-full")
38788
+ }
38789
+ )
38790
+ ]
38791
+ },
38792
+ index
38793
+ );
38794
+ }),
38795
+ /* @__PURE__ */ jsxs(
38796
+ "button",
38797
+ {
38798
+ type: "button",
38799
+ onClick: () => setRowList([...rows, emptyAssertRuleRow()]),
38800
+ className: "flex items-center gap-1 self-start text-xs text-primary hover:underline",
38801
+ "data-testid": `${testIdPrefix}-assert-rule-add`,
38802
+ children: [
38803
+ /* @__PURE__ */ jsx(Plus, { className: "size-3.5" }),
38804
+ tr("fluidgrids.builder.assertRules.add", "Add rule")
38805
+ ]
38806
+ }
38807
+ )
38808
+ ] }),
38809
+ problem && /* @__PURE__ */ jsx(
38810
+ "p",
38811
+ {
38812
+ className: "text-[11px] text-[var(--color-status-error-text)]",
38813
+ role: "alert",
38814
+ "data-testid": `${testIdPrefix}-assert-rules-problem`,
38815
+ children: tr(problem.key, problem.fallback)
38816
+ }
38817
+ )
38818
+ ]
38819
+ }
38820
+ );
38821
+ }
38543
38822
  function formatRunInZone(date5, timezone) {
38544
38823
  try {
38545
38824
  return new Intl.DateTimeFormat(void 0, {
@@ -39446,6 +39725,25 @@ function NodeParamsForm({
39446
39725
  )
39447
39726
  ] }, p.name);
39448
39727
  }
39728
+ if (nodeType === "internal:assert" && p.name === "rules") {
39729
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
39730
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
39731
+ /* @__PURE__ */ jsx("label", { className: "text-xs font-medium text-foreground", children: tr(
39732
+ "fluidgrids.builder.nodeParamsForm.assertRulesLabel",
39733
+ "Rules"
39734
+ ) }),
39735
+ p.required && /* @__PURE__ */ jsx("span", { className: "text-destructive", children: "*" })
39736
+ ] }),
39737
+ /* @__PURE__ */ jsx(
39738
+ AssertRulesEditor,
39739
+ {
39740
+ value: argsState[p.name],
39741
+ onChange: (next) => writeFixed(p.name, next),
39742
+ testIdPrefix
39743
+ }
39744
+ )
39745
+ ] }, p.name);
39746
+ }
39449
39747
  if (p.type === "workflow" || nodeType === "internal:subworkflow" && p.name === "workflowKey") {
39450
39748
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
39451
39749
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
@@ -43437,7 +43735,7 @@ function TriggerDataDialog({
43437
43735
  "."
43438
43736
  ] })
43439
43737
  ] }),
43440
- /* @__PURE__ */ jsxs(DialogFooter, { className: "gap-2 sm:gap-0", children: [
43738
+ /* @__PURE__ */ jsxs(DialogFooter$1, { className: "gap-2 sm:gap-0", children: [
43441
43739
  /* @__PURE__ */ jsx(
43442
43740
  Button$1,
43443
43741
  {
@@ -47282,6 +47580,918 @@ function GitSyncPanel({
47282
47580
  }
47283
47581
  );
47284
47582
  }
47583
+ var JSON_FIELDS = [
47584
+ {
47585
+ field: "triggerData",
47586
+ key: "triggerData",
47587
+ label: "Trigger input",
47588
+ hint: "The JSON object the run starts with.",
47589
+ rows: 4
47590
+ },
47591
+ {
47592
+ field: "connectionMocks",
47593
+ key: "connectionMocks",
47594
+ label: "Connection mocks",
47595
+ hint: '[{ "nodeId": "...", "operation"?: "...", "response": { ... } }] or an "error": { "message": "..." } instead of "response". A mocked node never calls its connection.',
47596
+ rows: 6
47597
+ },
47598
+ {
47599
+ field: "pinnedOutputs",
47600
+ key: "pinnedOutputs",
47601
+ label: "Pinned outputs",
47602
+ hint: '{ "nodeId": { "data": { ... } } }: the node is skipped and returns this output.',
47603
+ rows: 5
47604
+ },
47605
+ {
47606
+ field: "expectations",
47607
+ key: "expectations",
47608
+ label: "Expectations",
47609
+ hint: '{ "nodeId": [{ "path": "total", "operator": "equals", "expected": 42 }] }. Operators: equals, notEquals, contains, notContains, matches, jsonSchema, between, itemCount, exists, notExists.',
47610
+ rows: 6
47611
+ }
47612
+ ];
47613
+ var fieldClass = (invalid) => cn$1(
47614
+ "font-mono text-xs",
47615
+ invalid && "border-[var(--color-status-error-border)]"
47616
+ );
47617
+ function WorkflowTestCaseDialog({
47618
+ open: open2,
47619
+ mode,
47620
+ initialDraft,
47621
+ nodes,
47622
+ canvasPinnedOutputs,
47623
+ onSave,
47624
+ onOpenChange
47625
+ }) {
47626
+ const tr = useTr();
47627
+ const [draft, setDraft] = useState(initialDraft);
47628
+ const [problem, setProblem] = useState(null);
47629
+ const [saving, setSaving] = useState(false);
47630
+ useEffect(() => {
47631
+ if (open2) {
47632
+ setDraft(initialDraft);
47633
+ setProblem(null);
47634
+ }
47635
+ }, [open2, initialDraft]);
47636
+ const update = (key, value) => {
47637
+ setDraft((current) => ({ ...current, [key]: value }));
47638
+ setProblem(
47639
+ (current) => current && current.field === key ? null : current
47640
+ );
47641
+ };
47642
+ const hasCanvasPins = Object.keys(canvasPinnedOutputs).length > 0;
47643
+ const handleSave = async () => {
47644
+ setSaving(true);
47645
+ try {
47646
+ const result = await onSave(draft);
47647
+ setProblem(result);
47648
+ } finally {
47649
+ setSaving(false);
47650
+ }
47651
+ };
47652
+ const problemFor = (field) => problem && problem.field === field ? /* @__PURE__ */ jsx(
47653
+ "p",
47654
+ {
47655
+ className: "text-xs text-[var(--color-status-error-text)]",
47656
+ role: "alert",
47657
+ "data-testid": `fluidgrids-test-case-error-${field}`,
47658
+ children: problem.raw ? problem.fallback : tr(problem.key, problem.fallback)
47659
+ }
47660
+ ) : null;
47661
+ return /* @__PURE__ */ jsx(Dialog, { open: open2, onOpenChange: (next) => !saving && onOpenChange(next), children: /* @__PURE__ */ jsxs(
47662
+ DialogContent,
47663
+ {
47664
+ className: "z-[120] max-h-[90vh] overflow-y-auto sm:max-w-2xl",
47665
+ "data-testid": "fluidgrids-test-case-dialog",
47666
+ children: [
47667
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
47668
+ /* @__PURE__ */ jsx(DialogTitle, { children: mode === "create" ? tr("fluidgrids.builder.workflowTests.newTitle", "New test case") : tr(
47669
+ "fluidgrids.builder.workflowTests.editTitle",
47670
+ "Edit test case"
47671
+ ) }),
47672
+ /* @__PURE__ */ jsx(DialogDescription, { children: tr(
47673
+ "fluidgrids.builder.workflowTests.editorDescription",
47674
+ "A test case runs the workflow in test mode with this input. Mocked and pinned nodes never reach a real connection, and the expectations are checked as each node completes."
47675
+ ) })
47676
+ ] }),
47677
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
47678
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
47679
+ /* @__PURE__ */ jsx(Label, { htmlFor: "fg-test-case-name", className: "text-xs", children: tr("fluidgrids.builder.workflowTests.nameLabel", "Name") }),
47680
+ /* @__PURE__ */ jsx(
47681
+ Input$1,
47682
+ {
47683
+ id: "fg-test-case-name",
47684
+ value: draft.name,
47685
+ maxLength: MAX_CASE_NAME,
47686
+ onChange: (event) => update("name", event.target.value),
47687
+ "data-testid": "fluidgrids-test-case-name"
47688
+ }
47689
+ ),
47690
+ problemFor("name")
47691
+ ] }),
47692
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
47693
+ /* @__PURE__ */ jsx(Label, { htmlFor: "fg-test-case-description", className: "text-xs", children: tr(
47694
+ "fluidgrids.builder.workflowTests.descriptionLabel",
47695
+ "Description (optional)"
47696
+ ) }),
47697
+ /* @__PURE__ */ jsx(
47698
+ Textarea,
47699
+ {
47700
+ id: "fg-test-case-description",
47701
+ value: draft.description,
47702
+ rows: 2,
47703
+ onChange: (event) => update("description", event.target.value)
47704
+ }
47705
+ )
47706
+ ] }),
47707
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [
47708
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
47709
+ /* @__PURE__ */ jsx(Label, { htmlFor: "fg-test-case-start", className: "text-xs", children: tr(
47710
+ "fluidgrids.builder.workflowTests.startNodeLabel",
47711
+ "Start on"
47712
+ ) }),
47713
+ /* @__PURE__ */ jsxs(
47714
+ "select",
47715
+ {
47716
+ id: "fg-test-case-start",
47717
+ value: draft.triggerNodeId,
47718
+ onChange: (event) => update("triggerNodeId", event.target.value),
47719
+ className: "w-full rounded-md border border-input bg-background px-2 py-1.5 text-sm text-foreground",
47720
+ children: [
47721
+ /* @__PURE__ */ jsx("option", { value: "", children: tr(
47722
+ "fluidgrids.builder.workflowTests.startNodeDefault",
47723
+ "The workflow's entry node"
47724
+ ) }),
47725
+ nodes.map((node2) => /* @__PURE__ */ jsx("option", { value: node2.id, children: node2.label }, node2.id))
47726
+ ]
47727
+ }
47728
+ )
47729
+ ] }),
47730
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
47731
+ /* @__PURE__ */ jsx(Label, { htmlFor: "fg-test-case-expected", className: "text-xs", children: tr(
47732
+ "fluidgrids.builder.workflowTests.expectedStatusLabel",
47733
+ "The run should"
47734
+ ) }),
47735
+ /* @__PURE__ */ jsxs(
47736
+ "select",
47737
+ {
47738
+ id: "fg-test-case-expected",
47739
+ value: draft.expectedStatus,
47740
+ onChange: (event) => update(
47741
+ "expectedStatus",
47742
+ event.target.value === "FAILED" /* Failed */ ? "FAILED" /* Failed */ : "COMPLETED" /* Completed */
47743
+ ),
47744
+ className: "w-full rounded-md border border-input bg-background px-2 py-1.5 text-sm text-foreground",
47745
+ children: [
47746
+ /* @__PURE__ */ jsx("option", { value: "COMPLETED" /* Completed */, children: tr(
47747
+ "fluidgrids.builder.workflowTests.expectCompleted",
47748
+ "Complete"
47749
+ ) }),
47750
+ /* @__PURE__ */ jsx("option", { value: "FAILED" /* Failed */, children: tr("fluidgrids.builder.workflowTests.expectFailed", "Fail") })
47751
+ ]
47752
+ }
47753
+ )
47754
+ ] })
47755
+ ] }),
47756
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 rounded-md border border-border p-2.5", children: [
47757
+ /* @__PURE__ */ jsx(Label, { htmlFor: "fg-test-case-enabled", className: "text-xs", children: tr(
47758
+ "fluidgrids.builder.workflowTests.enabledLabel",
47759
+ "Run this case with Run all"
47760
+ ) }),
47761
+ /* @__PURE__ */ jsx(
47762
+ Switch,
47763
+ {
47764
+ id: "fg-test-case-enabled",
47765
+ checked: draft.enabled,
47766
+ onCheckedChange: (checked) => update("enabled", checked)
47767
+ }
47768
+ )
47769
+ ] }),
47770
+ JSON_FIELDS.map((item) => /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
47771
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
47772
+ /* @__PURE__ */ jsx(
47773
+ Label,
47774
+ {
47775
+ htmlFor: `fg-test-case-${item.field}`,
47776
+ className: "text-xs",
47777
+ children: tr(
47778
+ `fluidgrids.builder.workflowTests.${item.key}Label`,
47779
+ item.label
47780
+ )
47781
+ }
47782
+ ),
47783
+ item.field === "pinnedOutputs" && hasCanvasPins && /* @__PURE__ */ jsx(
47784
+ Button$1,
47785
+ {
47786
+ type: "button",
47787
+ variant: "ghost",
47788
+ size: "sm",
47789
+ className: "h-6 px-2 text-xs",
47790
+ onClick: () => update(
47791
+ "pinnedOutputs",
47792
+ JSON.stringify(canvasPinnedOutputs, null, 2)
47793
+ ),
47794
+ "data-testid": "fluidgrids-test-case-use-pins",
47795
+ children: tr(
47796
+ "fluidgrids.builder.workflowTests.useCanvasPins",
47797
+ "Use the canvas's pinned data"
47798
+ )
47799
+ }
47800
+ )
47801
+ ] }),
47802
+ /* @__PURE__ */ jsx(
47803
+ Textarea,
47804
+ {
47805
+ id: `fg-test-case-${item.field}`,
47806
+ value: draft[item.field],
47807
+ rows: item.rows,
47808
+ spellCheck: false,
47809
+ className: fieldClass(problem?.field === item.field),
47810
+ onChange: (event) => update(item.field, event.target.value),
47811
+ "data-testid": `fluidgrids-test-case-${item.field}`
47812
+ }
47813
+ ),
47814
+ /* @__PURE__ */ jsx("p", { className: "text-[11px] leading-snug text-muted-foreground", children: tr(
47815
+ `fluidgrids.builder.workflowTests.${item.key}Hint`,
47816
+ item.hint
47817
+ ) }),
47818
+ problemFor(item.field)
47819
+ ] }, item.field)),
47820
+ problemFor("size")
47821
+ ] }),
47822
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
47823
+ /* @__PURE__ */ jsx(
47824
+ Button$1,
47825
+ {
47826
+ variant: "outline",
47827
+ disabled: saving,
47828
+ onClick: () => onOpenChange(false),
47829
+ children: tr("fluidgrids.builder.workflowTests.cancel", "Cancel")
47830
+ }
47831
+ ),
47832
+ /* @__PURE__ */ jsxs(
47833
+ Button$1,
47834
+ {
47835
+ disabled: saving,
47836
+ onClick: () => void handleSave(),
47837
+ "data-testid": "fluidgrids-test-case-save",
47838
+ children: [
47839
+ saving && /* @__PURE__ */ jsx(Loader2, { className: "mr-1 size-4 animate-spin" }),
47840
+ mode === "create" ? tr("fluidgrids.builder.workflowTests.create", "Save test case") : tr("fluidgrids.builder.workflowTests.save", "Save changes")
47841
+ ]
47842
+ }
47843
+ )
47844
+ ] })
47845
+ ]
47846
+ }
47847
+ ) });
47848
+ }
47849
+ function WorkflowTestStatusBadge({
47850
+ status,
47851
+ className
47852
+ }) {
47853
+ const tr = useTr();
47854
+ const label = testStatusLabel(status);
47855
+ return /* @__PURE__ */ jsx(
47856
+ Badge,
47857
+ {
47858
+ variant: "outline",
47859
+ className: cn$1(
47860
+ "h-5 shrink-0 px-1.5 py-0 text-[10px]",
47861
+ TEST_STATUS_TONE_CLASS[testStatusTone(status)],
47862
+ className
47863
+ ),
47864
+ "data-status": status,
47865
+ "data-testid": "fluidgrids-test-status",
47866
+ children: tr(label.key, label.fallback)
47867
+ }
47868
+ );
47869
+ }
47870
+ function WorkflowTestCaseResultItem({
47871
+ result,
47872
+ onOpenRun
47873
+ }) {
47874
+ const tr = useTr();
47875
+ return /* @__PURE__ */ jsxs(
47876
+ "li",
47877
+ {
47878
+ className: "rounded-md border border-border p-2",
47879
+ "data-testid": "fluidgrids-test-result",
47880
+ children: [
47881
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
47882
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-sm text-foreground", children: result.caseName }),
47883
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [
47884
+ /* @__PURE__ */ jsx(WorkflowTestStatusBadge, { status: result.status }),
47885
+ result.runId && /* @__PURE__ */ jsxs(
47886
+ "button",
47887
+ {
47888
+ type: "button",
47889
+ className: "inline-flex items-center gap-0.5 text-xs text-primary hover:underline",
47890
+ onClick: () => result.runId && onOpenRun(result.runId),
47891
+ "data-testid": "fluidgrids-test-result-run",
47892
+ children: [
47893
+ tr("fluidgrids.builder.workflowTests.openRun", "Run"),
47894
+ /* @__PURE__ */ jsx(ExternalLink, { className: "size-3" })
47895
+ ]
47896
+ }
47897
+ )
47898
+ ] })
47899
+ ] }),
47900
+ result.failures.length > 0 && /* @__PURE__ */ jsx("ul", { className: "mt-1.5 space-y-1", children: result.failures.map((failure2, index) => /* @__PURE__ */ jsxs(
47901
+ "li",
47902
+ {
47903
+ className: "text-xs text-muted-foreground",
47904
+ "data-testid": "fluidgrids-test-failure",
47905
+ children: [
47906
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-[var(--color-status-error-text)]", children: failure2.code }),
47907
+ failure2.nodeId && /* @__PURE__ */ jsxs("span", { className: "font-mono", children: [
47908
+ " \xB7 ",
47909
+ failure2.nodeId
47910
+ ] }),
47911
+ /* @__PURE__ */ jsx("span", { className: "block whitespace-pre-wrap break-words text-foreground", children: failure2.message })
47912
+ ]
47913
+ },
47914
+ `${failure2.code}-${failure2.nodeId ?? ""}-${index}`
47915
+ )) })
47916
+ ]
47917
+ }
47918
+ );
47919
+ }
47920
+ function WorkflowTestRunCard({
47921
+ run,
47922
+ onOpenRun
47923
+ }) {
47924
+ const tr = useTr();
47925
+ return /* @__PURE__ */ jsxs(
47926
+ "div",
47927
+ {
47928
+ className: "rounded-lg border border-border p-3",
47929
+ "data-testid": "fluidgrids-test-run",
47930
+ "data-status": run.status,
47931
+ children: [
47932
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
47933
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
47934
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-medium text-foreground", children: [
47935
+ tr("fluidgrids.builder.workflowTests.suiteRun", "Test run"),
47936
+ " ",
47937
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-xs text-muted-foreground", children: run.version })
47938
+ ] }),
47939
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
47940
+ testRunSummaryText(run.summary),
47941
+ " \xB7 ",
47942
+ relativeTime(run.startedAt)
47943
+ ] })
47944
+ ] }),
47945
+ /* @__PURE__ */ jsx(WorkflowTestStatusBadge, { status: run.status })
47946
+ ] }),
47947
+ run.results.length > 0 && /* @__PURE__ */ jsx("ul", { className: "mt-2 space-y-1.5", children: run.results.map((result) => /* @__PURE__ */ jsx(
47948
+ WorkflowTestCaseResultItem,
47949
+ {
47950
+ result,
47951
+ onOpenRun
47952
+ },
47953
+ result.caseId
47954
+ )) })
47955
+ ]
47956
+ }
47957
+ );
47958
+ }
47959
+ function WorkflowTestCaseRow({
47960
+ testCase,
47961
+ actions
47962
+ }) {
47963
+ const tr = useTr();
47964
+ return /* @__PURE__ */ jsxs(
47965
+ "li",
47966
+ {
47967
+ className: "rounded-lg border border-border p-3",
47968
+ "data-testid": "fluidgrids-test-case",
47969
+ children: [
47970
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
47971
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
47972
+ /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-medium text-foreground", children: testCase.name }),
47973
+ testCase.description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 line-clamp-2 text-xs text-muted-foreground", children: testCase.description }),
47974
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-muted-foreground", children: [
47975
+ testCase.connectionMocks.length > 0 ? `${testCase.connectionMocks.length} ${tr("fluidgrids.builder.workflowTests.mocks", "mocked")}` : null,
47976
+ testCase.expectations.length > 0 ? `${testCase.expectations.length} ${tr("fluidgrids.builder.workflowTests.checked", "checked")}` : null,
47977
+ testCase.lastResult?.completedAt ? `${tr("fluidgrids.builder.workflowTests.lastRun", "last run")} ${relativeTime(testCase.lastResult.completedAt)}` : null
47978
+ ].filter(Boolean).join(" \xB7 ") })
47979
+ ] }),
47980
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [
47981
+ !testCase.enabled && /* @__PURE__ */ jsx(
47982
+ Badge,
47983
+ {
47984
+ variant: "outline",
47985
+ className: "h-5 px-1.5 py-0 text-[10px] text-muted-foreground",
47986
+ children: tr("fluidgrids.builder.workflowTests.disabled", "Off")
47987
+ }
47988
+ ),
47989
+ testCase.lastResult ? /* @__PURE__ */ jsx(WorkflowTestStatusBadge, { status: testCase.lastResult.status }) : /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: tr("fluidgrids.builder.workflowTests.neverRun", "Not run yet") })
47990
+ ] })
47991
+ ] }),
47992
+ /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-1.5", children: actions })
47993
+ ]
47994
+ }
47995
+ );
47996
+ }
47997
+ var SHEET_TOOLTIP = "z-[130]";
47998
+ function WorkflowTestsPanel({
47999
+ className,
48000
+ compact = false
48001
+ }) {
48002
+ const enabled = useWorkflowTestsEnabled();
48003
+ if (!enabled) return null;
48004
+ return /* @__PURE__ */ jsx(WorkflowTestsSheet, { className, compact });
48005
+ }
48006
+ function WorkflowTestsSheet({
48007
+ className,
48008
+ compact = false
48009
+ }) {
48010
+ const tr = useTr();
48011
+ const params = useParams();
48012
+ const workflowKey = params?.id ?? "";
48013
+ const loadedVersion = useFlowStore((s) => s.workflow.version);
48014
+ const currentVersion = params?.version || loadedVersion || "";
48015
+ const guardedNavigate = useGuardedNavigate();
48016
+ const canvasNodes = useFlowStore((s) => s.workflow.nodes);
48017
+ const canvasPins = useFlowStore((s) => s.workflow.pinnedNodeData);
48018
+ const [open2, setOpen] = useState(false);
48019
+ const {
48020
+ cases,
48021
+ runs,
48022
+ activeRun,
48023
+ loading,
48024
+ error: error62,
48025
+ forbidden,
48026
+ refetch,
48027
+ createCase,
48028
+ updateCase,
48029
+ deleteCase,
48030
+ runTests
48031
+ } = useWorkflowTests(workflowKey, open2);
48032
+ useEffect(() => {
48033
+ if (open2) void refetch();
48034
+ }, [open2, refetch]);
48035
+ const { allowed: canEdit } = useFluidGridsPermission(
48036
+ FLUIDGRIDS_PERMISSIONS.WORKFLOW_UPDATE
48037
+ );
48038
+ const { allowed: canRun } = useFluidGridsPermission(
48039
+ FLUIDGRIDS_PERMISSIONS.WORKFLOW_RUN_EXECUTE
48040
+ );
48041
+ const [editor, setEditor] = useState(null);
48042
+ const [deleting, setDeleting] = useState(null);
48043
+ const [busy, setBusy] = useState(null);
48044
+ const nodeOptions = useMemo(() => {
48045
+ const labels = buildNodeDisplayMap({ data: { nodes: canvasNodes } });
48046
+ return canvasNodes.filter((node2) => typeof node2.id === "string" && node2.id !== "").map((node2) => ({
48047
+ id: node2.id,
48048
+ label: labels[node2.id]?.label ? `${labels[node2.id]?.label} (${node2.id})` : node2.id
48049
+ }));
48050
+ }, [canvasNodes]);
48051
+ const canvasPinnedOutputs = useMemo(
48052
+ () => pinnedOutputsFromCanvas(canvasPins),
48053
+ [canvasPins]
48054
+ );
48055
+ const runIds = enabledCaseIds(cases);
48056
+ const suiteOpen = !!activeRun && isTestRunOpen(activeRun.status);
48057
+ const atCap = cases.length >= MAX_TEST_CASES;
48058
+ const deniedEdit = tr(
48059
+ "fluidgrids.builder.workflowTests.deniedEdit",
48060
+ "You need edit access to this workflow to change its test cases"
48061
+ );
48062
+ const deniedRun = tr(
48063
+ "fluidgrids.builder.workflowTests.deniedRun",
48064
+ "You need permission to run this workflow to run its tests"
48065
+ );
48066
+ const openRun = (runId) => guardedNavigate(`../runs/${encodeURIComponent(runId)}`);
48067
+ const start = async (key, caseIds) => {
48068
+ setBusy(key);
48069
+ try {
48070
+ await runTests({
48071
+ version: currentVersion || void 0,
48072
+ ...caseIds ? { caseIds } : {}
48073
+ });
48074
+ } catch (err) {
48075
+ toast.error(
48076
+ tr(
48077
+ "fluidgrids.builder.workflowTests.runError",
48078
+ "The tests did not start"
48079
+ ),
48080
+ { description: err instanceof Error ? err.message : String(err) }
48081
+ );
48082
+ } finally {
48083
+ setBusy(null);
48084
+ }
48085
+ };
48086
+ const save = async (draft) => {
48087
+ if (!editor) return null;
48088
+ const sortOrder = editor.mode === "edit" ? editor.sortOrder : nextSortOrder(cases);
48089
+ const parsed = draftToInput(draft, sortOrder);
48090
+ if ("error" in parsed) return parsed.error;
48091
+ try {
48092
+ if (editor.mode === "edit") await updateCase(editor.id, parsed.input);
48093
+ else await createCase(parsed.input);
48094
+ toast.success(
48095
+ tr("fluidgrids.builder.workflowTests.saved", "Test case saved"),
48096
+ { dismissible: true }
48097
+ );
48098
+ setEditor(null);
48099
+ return null;
48100
+ } catch (err) {
48101
+ return {
48102
+ field: "size",
48103
+ key: "fluidgrids.builder.workflowTests.saveError",
48104
+ fallback: err instanceof Error ? err.message : String(err),
48105
+ raw: true
48106
+ };
48107
+ }
48108
+ };
48109
+ const confirmDelete = async () => {
48110
+ const target = deleting;
48111
+ setDeleting(null);
48112
+ if (!target) return;
48113
+ setBusy(`delete:${target.id}`);
48114
+ try {
48115
+ await deleteCase(target.id);
48116
+ toast.success(
48117
+ tr("fluidgrids.builder.workflowTests.deleted", "Test case deleted"),
48118
+ { dismissible: true }
48119
+ );
48120
+ } catch (err) {
48121
+ toast.error(
48122
+ tr(
48123
+ "fluidgrids.builder.workflowTests.deleteError",
48124
+ "Could not delete the test case"
48125
+ ),
48126
+ { description: err instanceof Error ? err.message : String(err) }
48127
+ );
48128
+ } finally {
48129
+ setBusy(null);
48130
+ }
48131
+ };
48132
+ const triggerLabel = tr("fluidgrids.builder.workflowTests.trigger", "Tests");
48133
+ return /* @__PURE__ */ jsxs(Sheet, { open: open2, onOpenChange: setOpen, children: [
48134
+ /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
48135
+ Button$1,
48136
+ {
48137
+ "data-tour": "fluidgrids-builder-tests",
48138
+ variant: "outline",
48139
+ size: compact ? "icon" : "sm",
48140
+ className: cn$1(!compact && "flex gap-1", className),
48141
+ "aria-label": triggerLabel,
48142
+ title: compact ? triggerLabel : void 0,
48143
+ disabled: !workflowKey,
48144
+ "data-testid": "fluidgrids-tests-trigger",
48145
+ children: [
48146
+ /* @__PURE__ */ jsx(FlaskConical, { className: "size-4" }),
48147
+ !compact && triggerLabel
48148
+ ]
48149
+ }
48150
+ ) }),
48151
+ /* @__PURE__ */ jsxs(
48152
+ SheetContent,
48153
+ {
48154
+ side: "right",
48155
+ className: "w-[380px] overflow-y-auto sm:w-[480px]",
48156
+ "data-testid": "fluidgrids-tests-panel",
48157
+ children: [
48158
+ /* @__PURE__ */ jsxs(SheetHeader, { children: [
48159
+ /* @__PURE__ */ jsxs(SheetTitle, { className: "flex items-center gap-2", children: [
48160
+ /* @__PURE__ */ jsx(FlaskConical, { className: "size-5" }),
48161
+ tr("fluidgrids.builder.workflowTests.title", "Test cases")
48162
+ ] }),
48163
+ /* @__PURE__ */ jsx(SheetDescription, { children: tr(
48164
+ "fluidgrids.builder.workflowTests.description",
48165
+ "Saved inputs, mocked connections and expected outputs for this workflow. Each case runs in test mode, so no real connection is called for a mocked node."
48166
+ ) })
48167
+ ] }),
48168
+ forbidden ? /* @__PURE__ */ jsx(
48169
+ "p",
48170
+ {
48171
+ className: "py-6 text-sm text-muted-foreground",
48172
+ "data-testid": "fluidgrids-tests-no-access",
48173
+ children: tr(
48174
+ "fluidgrids.builder.workflowTests.noAccess",
48175
+ "You don't have access to this workflow's test cases."
48176
+ )
48177
+ }
48178
+ ) : loading && cases.length === 0 && runs.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center py-8 text-sm text-muted-foreground", children: [
48179
+ /* @__PURE__ */ jsx(Loader2, { className: "mr-2 size-4 animate-spin" }),
48180
+ tr("fluidgrids.builder.workflowTests.loading", "Loading...")
48181
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-5 pb-6", children: [
48182
+ error62 && /* @__PURE__ */ jsxs("div", { className: "rounded-md border border-[var(--color-status-error-border)] p-2 text-xs text-[var(--color-status-error-text)]", children: [
48183
+ error62,
48184
+ " ",
48185
+ /* @__PURE__ */ jsx(
48186
+ "button",
48187
+ {
48188
+ type: "button",
48189
+ className: "underline",
48190
+ onClick: () => void refetch(),
48191
+ children: tr("fluidgrids.builder.workflowTests.retry", "Retry")
48192
+ }
48193
+ )
48194
+ ] }),
48195
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
48196
+ /* @__PURE__ */ jsx(
48197
+ SdkPermissionButton,
48198
+ {
48199
+ permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_RUN_EXECUTE,
48200
+ deniedTooltip: deniedRun,
48201
+ deniedTooltipClassName: SHEET_TOOLTIP,
48202
+ children: /* @__PURE__ */ jsxs(
48203
+ Button$1,
48204
+ {
48205
+ size: "sm",
48206
+ className: "gap-1",
48207
+ disabled: busy !== null || suiteOpen || runIds.length === 0,
48208
+ onClick: () => void start("all"),
48209
+ "data-testid": "fluidgrids-tests-run-all",
48210
+ children: [
48211
+ busy === "all" || suiteOpen ? /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "size-4" }),
48212
+ tr("fluidgrids.builder.workflowTests.runAll", "Run all")
48213
+ ]
48214
+ }
48215
+ )
48216
+ }
48217
+ ),
48218
+ /* @__PURE__ */ jsx(
48219
+ SdkPermissionButton,
48220
+ {
48221
+ permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_UPDATE,
48222
+ deniedTooltip: deniedEdit,
48223
+ deniedTooltipClassName: SHEET_TOOLTIP,
48224
+ children: /* @__PURE__ */ jsxs(
48225
+ Button$1,
48226
+ {
48227
+ size: "sm",
48228
+ variant: "outline",
48229
+ className: "gap-1",
48230
+ disabled: busy !== null || atCap,
48231
+ title: atCap ? tr(
48232
+ "fluidgrids.builder.workflowTests.atCap",
48233
+ "A workflow can have at most 50 test cases"
48234
+ ) : void 0,
48235
+ onClick: () => setEditor({ mode: "create", draft: emptyTestCaseDraft() }),
48236
+ "data-testid": "fluidgrids-tests-new",
48237
+ children: [
48238
+ /* @__PURE__ */ jsx(Plus, { className: "size-4" }),
48239
+ tr(
48240
+ "fluidgrids.builder.workflowTests.newCase",
48241
+ "New test case"
48242
+ )
48243
+ ]
48244
+ }
48245
+ )
48246
+ }
48247
+ ),
48248
+ /* @__PURE__ */ jsx(
48249
+ Button$1,
48250
+ {
48251
+ size: "icon",
48252
+ variant: "ghost",
48253
+ className: "ml-auto size-8",
48254
+ disabled: loading,
48255
+ "aria-label": tr(
48256
+ "fluidgrids.builder.workflowTests.refresh",
48257
+ "Refresh"
48258
+ ),
48259
+ onClick: () => void refetch(),
48260
+ children: /* @__PURE__ */ jsx(
48261
+ RefreshCw,
48262
+ {
48263
+ className: cn$1("size-4", loading && "animate-spin")
48264
+ }
48265
+ )
48266
+ }
48267
+ )
48268
+ ] }),
48269
+ (!canEdit || !canRun) && /* @__PURE__ */ jsx(
48270
+ "p",
48271
+ {
48272
+ className: "text-[11px] text-muted-foreground",
48273
+ "data-testid": "fluidgrids-tests-read-only",
48274
+ children: !canEdit && !canRun ? tr(
48275
+ "fluidgrids.builder.workflowTests.readOnly",
48276
+ "You can view the test cases and their results, but not change or run them."
48277
+ ) : !canEdit ? tr(
48278
+ "fluidgrids.builder.workflowTests.runOnly",
48279
+ "You can run the test cases, but not change them."
48280
+ ) : tr(
48281
+ "fluidgrids.builder.workflowTests.editOnly",
48282
+ "You can change the test cases, but not run them."
48283
+ )
48284
+ }
48285
+ ),
48286
+ activeRun && /* @__PURE__ */ jsxs("section", { "aria-labelledby": "fg-tests-active", children: [
48287
+ /* @__PURE__ */ jsx(
48288
+ "h3",
48289
+ {
48290
+ id: "fg-tests-active",
48291
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
48292
+ children: suiteOpen ? tr(
48293
+ "fluidgrids.builder.workflowTests.runningTitle",
48294
+ "Running"
48295
+ ) : tr(
48296
+ "fluidgrids.builder.workflowTests.latestTitle",
48297
+ "Latest run"
48298
+ )
48299
+ }
48300
+ ),
48301
+ /* @__PURE__ */ jsx(WorkflowTestRunCard, { run: activeRun, onOpenRun: openRun })
48302
+ ] }),
48303
+ /* @__PURE__ */ jsxs("section", { "aria-labelledby": "fg-tests-cases", children: [
48304
+ /* @__PURE__ */ jsxs(
48305
+ "h3",
48306
+ {
48307
+ id: "fg-tests-cases",
48308
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
48309
+ children: [
48310
+ tr("fluidgrids.builder.workflowTests.casesTitle", "Cases"),
48311
+ " (",
48312
+ cases.length,
48313
+ ")"
48314
+ ]
48315
+ }
48316
+ ),
48317
+ cases.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: tr(
48318
+ "fluidgrids.builder.workflowTests.empty",
48319
+ "No test cases yet. Create one here, or open a finished run and choose Save as test case."
48320
+ ) }) : /* @__PURE__ */ jsx("ul", { className: "space-y-2", children: cases.map((testCase) => /* @__PURE__ */ jsx(
48321
+ WorkflowTestCaseRow,
48322
+ {
48323
+ testCase,
48324
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [
48325
+ /* @__PURE__ */ jsx(
48326
+ SdkPermissionButton,
48327
+ {
48328
+ permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_RUN_EXECUTE,
48329
+ deniedTooltip: deniedRun,
48330
+ deniedTooltipClassName: SHEET_TOOLTIP,
48331
+ children: /* @__PURE__ */ jsxs(
48332
+ Button$1,
48333
+ {
48334
+ size: "sm",
48335
+ variant: "secondary",
48336
+ className: "h-7 gap-1 text-xs",
48337
+ disabled: busy !== null || suiteOpen,
48338
+ onClick: () => void start(`run:${testCase.id}`, [testCase.id]),
48339
+ "data-testid": "fluidgrids-test-case-run",
48340
+ children: [
48341
+ busy === `run:${testCase.id}` ? /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "size-3.5" }),
48342
+ tr(
48343
+ "fluidgrids.builder.workflowTests.runOne",
48344
+ "Run"
48345
+ )
48346
+ ]
48347
+ }
48348
+ )
48349
+ }
48350
+ ),
48351
+ /* @__PURE__ */ jsx(
48352
+ SdkPermissionButton,
48353
+ {
48354
+ permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_UPDATE,
48355
+ deniedTooltip: deniedEdit,
48356
+ deniedTooltipClassName: SHEET_TOOLTIP,
48357
+ children: /* @__PURE__ */ jsxs(
48358
+ Button$1,
48359
+ {
48360
+ size: "sm",
48361
+ variant: "outline",
48362
+ className: "h-7 gap-1 text-xs",
48363
+ disabled: busy !== null,
48364
+ onClick: () => setEditor({
48365
+ mode: "edit",
48366
+ id: testCase.id,
48367
+ sortOrder: testCase.sortOrder,
48368
+ draft: draftFromTestCase(testCase)
48369
+ }),
48370
+ "data-testid": "fluidgrids-test-case-edit",
48371
+ children: [
48372
+ /* @__PURE__ */ jsx(Pencil, { className: "size-3.5" }),
48373
+ tr(
48374
+ "fluidgrids.builder.workflowTests.edit",
48375
+ "Edit"
48376
+ )
48377
+ ]
48378
+ }
48379
+ )
48380
+ }
48381
+ ),
48382
+ /* @__PURE__ */ jsx(
48383
+ SdkPermissionButton,
48384
+ {
48385
+ permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_UPDATE,
48386
+ deniedTooltip: deniedEdit,
48387
+ deniedTooltipClassName: SHEET_TOOLTIP,
48388
+ children: /* @__PURE__ */ jsxs(
48389
+ Button$1,
48390
+ {
48391
+ size: "sm",
48392
+ variant: "ghost",
48393
+ className: "h-7 gap-1 text-xs",
48394
+ disabled: busy !== null,
48395
+ onClick: () => setDeleting(testCase),
48396
+ "data-testid": "fluidgrids-test-case-delete",
48397
+ children: [
48398
+ busy === `delete:${testCase.id}` ? /* @__PURE__ */ jsx(Loader2, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Trash2, { className: "size-3.5" }),
48399
+ tr(
48400
+ "fluidgrids.builder.workflowTests.delete",
48401
+ "Delete"
48402
+ )
48403
+ ]
48404
+ }
48405
+ )
48406
+ }
48407
+ )
48408
+ ] })
48409
+ },
48410
+ testCase.id
48411
+ )) })
48412
+ ] }),
48413
+ runs.length > 1 && /* @__PURE__ */ jsxs("section", { "aria-labelledby": "fg-tests-history", children: [
48414
+ /* @__PURE__ */ jsx(
48415
+ "h3",
48416
+ {
48417
+ id: "fg-tests-history",
48418
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
48419
+ children: tr(
48420
+ "fluidgrids.builder.workflowTests.historyTitle",
48421
+ "Earlier runs"
48422
+ )
48423
+ }
48424
+ ),
48425
+ /* @__PURE__ */ jsx("ul", { className: "space-y-1.5", children: runs.filter((run) => run.id !== activeRun?.id).map((run) => /* @__PURE__ */ jsxs(
48426
+ "li",
48427
+ {
48428
+ className: "flex items-center justify-between gap-2 text-xs",
48429
+ "data-testid": "fluidgrids-test-run-history",
48430
+ children: [
48431
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0 truncate text-muted-foreground", children: [
48432
+ /* @__PURE__ */ jsx("span", { className: "font-mono", children: run.version }),
48433
+ " \xB7",
48434
+ " ",
48435
+ run.summary.passed,
48436
+ "/",
48437
+ run.summary.total,
48438
+ " \xB7",
48439
+ " ",
48440
+ relativeTime(run.startedAt)
48441
+ ] }),
48442
+ /* @__PURE__ */ jsx(WorkflowTestStatusBadge, { status: run.status })
48443
+ ]
48444
+ },
48445
+ run.id
48446
+ )) })
48447
+ ] })
48448
+ ] })
48449
+ ]
48450
+ }
48451
+ ),
48452
+ /* @__PURE__ */ jsx(
48453
+ WorkflowTestCaseDialog,
48454
+ {
48455
+ open: editor !== null,
48456
+ mode: editor?.mode ?? "create",
48457
+ initialDraft: editor?.draft ?? EMPTY_DRAFT,
48458
+ nodes: nodeOptions,
48459
+ canvasPinnedOutputs,
48460
+ onSave: save,
48461
+ onOpenChange: (next) => !next && setEditor(null)
48462
+ }
48463
+ ),
48464
+ /* @__PURE__ */ jsx(
48465
+ AlertDialog,
48466
+ {
48467
+ open: deleting !== null,
48468
+ onOpenChange: (next) => !next && setDeleting(null),
48469
+ children: /* @__PURE__ */ jsxs(AlertDialogContent, { className: "z-[120]", children: [
48470
+ /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
48471
+ /* @__PURE__ */ jsx(AlertDialogTitle, { children: tr(
48472
+ "fluidgrids.builder.workflowTests.deleteTitle",
48473
+ "Delete this test case?"
48474
+ ) }),
48475
+ /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
48476
+ deleting?.name,
48477
+ ".",
48478
+ " ",
48479
+ tr(
48480
+ "fluidgrids.builder.workflowTests.deleteBody",
48481
+ "Earlier test runs keep their results."
48482
+ )
48483
+ ] })
48484
+ ] }),
48485
+ /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
48486
+ /* @__PURE__ */ jsx(AlertDialogCancel, { children: tr("fluidgrids.builder.workflowTests.cancel", "Cancel") }),
48487
+ /* @__PURE__ */ jsx(AlertDialogAction, { onClick: () => void confirmDelete(), children: tr("fluidgrids.builder.workflowTests.delete", "Delete") })
48488
+ ] })
48489
+ ] })
48490
+ }
48491
+ )
48492
+ ] });
48493
+ }
48494
+ var EMPTY_DRAFT = emptyTestCaseDraft();
47285
48495
  var NO_TEMPLATE = "__none__";
47286
48496
  function AiDraftPanel({
47287
48497
  className,
@@ -48320,6 +49530,7 @@ function PanelIcons() {
48320
49530
  /* @__PURE__ */ jsx(AiDraftPanel, { compact: true }),
48321
49531
  /* @__PURE__ */ jsx(EnvironmentsPanel, { compact: true }),
48322
49532
  /* @__PURE__ */ jsx(GitSyncPanel, { compact: true }),
49533
+ /* @__PURE__ */ jsx(WorkflowTestsPanel, { compact: true }),
48323
49534
  /* @__PURE__ */ jsx(CodeViewPanel, { compact: true })
48324
49535
  ] });
48325
49536
  }
@@ -48338,6 +49549,7 @@ function HeaderActions({ tier }) {
48338
49549
  /* @__PURE__ */ jsx(VersionHistoryPanel, { compact: true }),
48339
49550
  /* @__PURE__ */ jsx(EnvironmentsPanel, { compact: true }),
48340
49551
  /* @__PURE__ */ jsx(GitSyncPanel, { compact: true }),
49552
+ /* @__PURE__ */ jsx(WorkflowTestsPanel, { compact: true }),
48341
49553
  /* @__PURE__ */ jsx(CodeViewPanel, { compact: true }),
48342
49554
  /* @__PURE__ */ jsx(GuideIcon, {}),
48343
49555
  /* @__PURE__ */ jsx(Divider, {}),