orcheo-canvas 0.0.1
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/CHANGELOG.md +26 -0
- package/README.md +32 -0
- package/components.json +21 -0
- package/dist/assets/index-C8cjvUcR.js +772 -0
- package/dist/assets/index-D_Md8dhB.css +1 -0
- package/dist/favicon.drawio +83 -0
- package/dist/favicon.png +0 -0
- package/dist/favicon.svg +4 -0
- package/dist/index.html +19 -0
- package/eslint.config.js +28 -0
- package/index.html +18 -0
- package/package.json +165 -0
- package/postcss.config.js +6 -0
- package/public/favicon.drawio +83 -0
- package/public/favicon.png +0 -0
- package/public/favicon.svg +4 -0
- package/src/App.test.tsx +10 -0
- package/src/App.tsx +43 -0
- package/src/assets/react.svg +1 -0
- package/src/design-system/ui/accordion.tsx +57 -0
- package/src/design-system/ui/alert-dialog.tsx +141 -0
- package/src/design-system/ui/alert.tsx +59 -0
- package/src/design-system/ui/aspect-ratio.tsx +7 -0
- package/src/design-system/ui/avatar.tsx +50 -0
- package/src/design-system/ui/badge.tsx +37 -0
- package/src/design-system/ui/breadcrumb.tsx +115 -0
- package/src/design-system/ui/button.tsx +58 -0
- package/src/design-system/ui/calendar.tsx +76 -0
- package/src/design-system/ui/card.tsx +83 -0
- package/src/design-system/ui/carousel/carousel-context.ts +17 -0
- package/src/design-system/ui/carousel/carousel-navigation.tsx +65 -0
- package/src/design-system/ui/carousel/carousel-provider.tsx +18 -0
- package/src/design-system/ui/carousel/carousel-root.tsx +119 -0
- package/src/design-system/ui/carousel/carousel-slides.tsx +49 -0
- package/src/design-system/ui/carousel/types.ts +24 -0
- package/src/design-system/ui/carousel.tsx +6 -0
- package/src/design-system/ui/chart-context-shared.ts +27 -0
- package/src/design-system/ui/chart-context.tsx +81 -0
- package/src/design-system/ui/chart-legend.tsx +68 -0
- package/src/design-system/ui/chart-tooltip.tsx +164 -0
- package/src/design-system/ui/chart-utils.ts +39 -0
- package/src/design-system/ui/chart.tsx +3 -0
- package/src/design-system/ui/checkbox.tsx +30 -0
- package/src/design-system/ui/collapsible.tsx +11 -0
- package/src/design-system/ui/command.tsx +153 -0
- package/src/design-system/ui/context-menu.tsx +200 -0
- package/src/design-system/ui/dialog.tsx +122 -0
- package/src/design-system/ui/drawer.tsx +118 -0
- package/src/design-system/ui/dropdown-menu.tsx +201 -0
- package/src/design-system/ui/form.tsx +180 -0
- package/src/design-system/ui/hover-card.tsx +29 -0
- package/src/design-system/ui/input-otp.tsx +71 -0
- package/src/design-system/ui/input.tsx +22 -0
- package/src/design-system/ui/label.tsx +26 -0
- package/src/design-system/ui/menubar-content.tsx +85 -0
- package/src/design-system/ui/menubar-items.tsx +123 -0
- package/src/design-system/ui/menubar-root.tsx +60 -0
- package/src/design-system/ui/menubar.tsx +26 -0
- package/src/design-system/ui/navigation-menu.tsx +129 -0
- package/src/design-system/ui/pagination.tsx +117 -0
- package/src/design-system/ui/popover.tsx +33 -0
- package/src/design-system/ui/progress.tsx +28 -0
- package/src/design-system/ui/radio-group.tsx +44 -0
- package/src/design-system/ui/resizable.tsx +45 -0
- package/src/design-system/ui/scroll-area.tsx +48 -0
- package/src/design-system/ui/select.tsx +159 -0
- package/src/design-system/ui/separator.tsx +31 -0
- package/src/design-system/ui/sheet.tsx +140 -0
- package/src/design-system/ui/sidebar/constants.ts +6 -0
- package/src/design-system/ui/sidebar/sidebar-context.ts +15 -0
- package/src/design-system/ui/sidebar/sidebar-layout.tsx +216 -0
- package/src/design-system/ui/sidebar/sidebar-menu/index.ts +11 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-action.tsx +35 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-badge.tsx +28 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-button-variants.ts +25 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-button.tsx +73 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-skeleton.tsx +45 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu-sub.tsx +61 -0
- package/src/design-system/ui/sidebar/sidebar-menu/menu.tsx +33 -0
- package/src/design-system/ui/sidebar/sidebar-provider.tsx +132 -0
- package/src/design-system/ui/sidebar/sidebar-structure.tsx +152 -0
- package/src/design-system/ui/sidebar/use-sidebar.ts +14 -0
- package/src/design-system/ui/sidebar.ts +35 -0
- package/src/design-system/ui/skeleton.tsx +15 -0
- package/src/design-system/ui/slider.tsx +28 -0
- package/src/design-system/ui/sonner.tsx +31 -0
- package/src/design-system/ui/switch.tsx +29 -0
- package/src/design-system/ui/table.tsx +120 -0
- package/src/design-system/ui/tabs.tsx +55 -0
- package/src/design-system/ui/textarea.tsx +22 -0
- package/src/design-system/ui/toast.tsx +129 -0
- package/src/design-system/ui/toaster.tsx +35 -0
- package/src/design-system/ui/toggle-group.tsx +61 -0
- package/src/design-system/ui/toggle.tsx +46 -0
- package/src/design-system/ui/tooltip.tsx +32 -0
- package/src/features/account/components/settings/appearance-settings-tab.tsx +70 -0
- package/src/features/account/components/settings/application-settings-tab.tsx +146 -0
- package/src/features/account/components/settings/notification-settings-tab.tsx +157 -0
- package/src/features/account/components/settings/team-billing-settings-tab.tsx +164 -0
- package/src/features/account/components/theme-settings.tsx +228 -0
- package/src/features/account/components/use-theme-preferences.ts +111 -0
- package/src/features/account/pages/profile/components/profile-api-keys-tab.tsx +59 -0
- package/src/features/account/pages/profile/components/profile-general-tab.tsx +125 -0
- package/src/features/account/pages/profile/components/profile-security-tab.tsx +114 -0
- package/src/features/account/pages/profile/types.ts +8 -0
- package/src/features/account/pages/profile.tsx +64 -0
- package/src/features/account/pages/settings.tsx +58 -0
- package/src/features/auth/components/auth-logos.tsx +61 -0
- package/src/features/auth/components/auth-page.tsx +213 -0
- package/src/features/auth/pages/login.tsx +5 -0
- package/src/features/auth/pages/signup.tsx +5 -0
- package/src/features/chatkit/components/canvas-chat-bubble.tsx +324 -0
- package/src/features/chatkit/components/chatkit-surface.tsx +18 -0
- package/src/features/chatkit/components/public-chat-error-boundary.tsx +74 -0
- package/src/features/chatkit/components/public-chat-widget.tsx +138 -0
- package/src/features/chatkit/lib/chatkit-client.test.ts +98 -0
- package/src/features/chatkit/lib/chatkit-client.ts +175 -0
- package/src/features/chatkit/lib/chatkit-theme.ts +20 -0
- package/src/features/chatkit/lib/telemetry.ts +29 -0
- package/src/features/chatkit/lib/workflow-session.ts +69 -0
- package/src/features/chatkit/pages/public-chat.tsx +391 -0
- package/src/features/shared/components/chat-input/attachment-preview.tsx +78 -0
- package/src/features/shared/components/chat-input/chat-input-types.ts +13 -0
- package/src/features/shared/components/chat-input/emoji-picker.tsx +106 -0
- package/src/features/shared/components/chat-input.tsx +234 -0
- package/src/features/shared/components/chat-interface-options.ts +305 -0
- package/src/features/shared/components/chat-interface.tsx +162 -0
- package/src/features/shared/components/chat-interface.types.ts +36 -0
- package/src/features/shared/components/chat-message-attachments.tsx +122 -0
- package/src/features/shared/components/chat-message-markdown.ts +33 -0
- package/src/features/shared/components/chat-message.tsx +128 -0
- package/src/features/shared/components/top-navigation/account-menu.tsx +101 -0
- package/src/features/shared/components/top-navigation/command-palette-button.tsx +78 -0
- package/src/features/shared/components/top-navigation/project-switcher.tsx +64 -0
- package/src/features/shared/components/top-navigation/top-navigation-types.ts +16 -0
- package/src/features/shared/components/top-navigation/use-window-width.ts +24 -0
- package/src/features/shared/components/top-navigation/workflow-breadcrumbs.tsx +107 -0
- package/src/features/shared/components/top-navigation.tsx +52 -0
- package/src/features/support/components/support-chat-callout.tsx +40 -0
- package/src/features/support/components/support-header.tsx +53 -0
- package/src/features/support/components/support-help-tabs.tsx +172 -0
- package/src/features/support/components/support-resources.tsx +157 -0
- package/src/features/support/pages/help-support.tsx +72 -0
- package/src/features/workflow/components/canvas/annotations-layer/annotation-composer.tsx +109 -0
- package/src/features/workflow/components/canvas/annotations-layer/annotation-item.tsx +141 -0
- package/src/features/workflow/components/canvas/annotations-layer/annotation-list.tsx +30 -0
- package/src/features/workflow/components/canvas/annotations-layer/types.ts +10 -0
- package/src/features/workflow/components/canvas/annotations-layer.tsx +99 -0
- package/src/features/workflow/components/canvas/breakpoints-layer.tsx +148 -0
- package/src/features/workflow/components/canvas/connection-validator.tsx +230 -0
- package/src/features/workflow/components/canvas/custom-edge.tsx +154 -0
- package/src/features/workflow/components/canvas/edge-hover-context.tsx +11 -0
- package/src/features/workflow/components/canvas/mini-map.tsx +111 -0
- package/src/features/workflow/components/canvas/split-pane.tsx +165 -0
- package/src/features/workflow/components/canvas/time-travel-debugger.tsx +164 -0
- package/src/features/workflow/components/canvas/time-travel-header.tsx +45 -0
- package/src/features/workflow/components/canvas/time-travel-playback-controls.tsx +174 -0
- package/src/features/workflow/components/canvas/time-travel-state-details.tsx +63 -0
- package/src/features/workflow/components/canvas/time-travel-timeline.tsx +80 -0
- package/src/features/workflow/components/canvas/time-travel-types.ts +18 -0
- package/src/features/workflow/components/canvas/workflow-context-menu.tsx +179 -0
- package/src/features/workflow/components/canvas/workflow-controls/action-control-group.tsx +219 -0
- package/src/features/workflow/components/canvas/workflow-controls/history-control-group.tsx +84 -0
- package/src/features/workflow/components/canvas/workflow-controls/types.ts +18 -0
- package/src/features/workflow/components/canvas/workflow-controls.tsx +50 -0
- package/src/features/workflow/components/canvas/workflow-flow.tsx +214 -0
- package/src/features/workflow/components/canvas/workflow-search.tsx +152 -0
- package/src/features/workflow/components/dialogs/add-credential-dialog.tsx +233 -0
- package/src/features/workflow/components/dialogs/add-notification-channel-dialog.tsx +230 -0
- package/src/features/workflow/components/dialogs/command-palette-items.tsx +77 -0
- package/src/features/workflow/components/dialogs/command-palette-types.ts +13 -0
- package/src/features/workflow/components/dialogs/command-palette-utils.ts +44 -0
- package/src/features/workflow/components/dialogs/command-palette.tsx +195 -0
- package/src/features/workflow/components/dialogs/credential-access-badge.tsx +44 -0
- package/src/features/workflow/components/dialogs/credential-status-badge.tsx +45 -0
- package/src/features/workflow/components/dialogs/credentials-table.tsx +234 -0
- package/src/features/workflow/components/dialogs/credentials-vault.tsx +63 -0
- package/src/features/workflow/components/dialogs/notification-channel-card.tsx +106 -0
- package/src/features/workflow/components/dialogs/notification-event-toggles.tsx +95 -0
- package/src/features/workflow/components/dialogs/notification-settings.tsx +108 -0
- package/src/features/workflow/components/dialogs/notification-settings.types.ts +34 -0
- package/src/features/workflow/components/dialogs/use-command-palette-navigation.ts +60 -0
- package/src/features/workflow/components/dialogs/user-role-management/invite-user-dialog.tsx +152 -0
- package/src/features/workflow/components/dialogs/user-role-management/role-badges.tsx +83 -0
- package/src/features/workflow/components/dialogs/user-role-management/user-role-table.tsx +188 -0
- package/src/features/workflow/components/dialogs/user-role-management/user-role-types.ts +20 -0
- package/src/features/workflow/components/dialogs/user-role-management.tsx +61 -0
- package/src/features/workflow/components/dialogs/version-control-dialog.tsx +232 -0
- package/src/features/workflow/components/layouts/sidebar-layout.tsx +208 -0
- package/src/features/workflow/components/layouts/use-sidebar-resize.ts +83 -0
- package/src/features/workflow/components/layouts/workflow-page-layout.tsx +69 -0
- package/src/features/workflow/components/nodes/chat-trigger-node.tsx +106 -0
- package/src/features/workflow/components/nodes/group-node.tsx +195 -0
- package/src/features/workflow/components/nodes/node-label.tsx +105 -0
- package/src/features/workflow/components/nodes/start-end-node.tsx +68 -0
- package/src/features/workflow/components/nodes/sticky-note-node.tsx +246 -0
- package/src/features/workflow/components/nodes/workflow-node-controls.tsx +91 -0
- package/src/features/workflow/components/nodes/workflow-node-handle-config.ts +22 -0
- package/src/features/workflow/components/nodes/workflow-node-handles.tsx +79 -0
- package/src/features/workflow/components/nodes/workflow-node-style.tsx +50 -0
- package/src/features/workflow/components/nodes/workflow-node.tsx +147 -0
- package/src/features/workflow/components/nodes/workflow-node.types.ts +32 -0
- package/src/features/workflow/components/panels/node-inspector/config-panel.tsx +130 -0
- package/src/features/workflow/components/panels/node-inspector/index.tsx +225 -0
- package/src/features/workflow/components/panels/node-inspector/input-panel.tsx +199 -0
- package/src/features/workflow/components/panels/node-inspector/live-data-unavailable.tsx +26 -0
- package/src/features/workflow/components/panels/node-inspector/node-inspector-layout.tsx +251 -0
- package/src/features/workflow/components/panels/node-inspector/output-panel.tsx +165 -0
- package/src/features/workflow/components/panels/node-inspector/schema-fields.ts +39 -0
- package/src/features/workflow/components/panels/node-inspector/types.ts +31 -0
- package/src/features/workflow/components/panels/node-inspector/use-node-tester.ts +209 -0
- package/src/features/workflow/components/panels/node-inspector/utils.ts +82 -0
- package/src/features/workflow/components/panels/rjsf-basic-widgets.tsx +21 -0
- package/src/features/workflow/components/panels/rjsf-condition-widgets.tsx +241 -0
- package/src/features/workflow/components/panels/rjsf-input-widgets.tsx +105 -0
- package/src/features/workflow/components/panels/rjsf-templates.tsx +146 -0
- package/src/features/workflow/components/panels/rjsf-text-widgets.tsx +139 -0
- package/src/features/workflow/components/panels/rjsf-theme.tsx +16 -0
- package/src/features/workflow/components/panels/schema-dnd.ts +79 -0
- package/src/features/workflow/components/panels/sidebar-node-item.tsx +42 -0
- package/src/features/workflow/components/panels/sidebar-nodes/actions.tsx +34 -0
- package/src/features/workflow/components/panels/sidebar-nodes/ai.tsx +40 -0
- package/src/features/workflow/components/panels/sidebar-nodes/data.tsx +53 -0
- package/src/features/workflow/components/panels/sidebar-nodes/index.ts +2 -0
- package/src/features/workflow/components/panels/sidebar-nodes/logic.tsx +127 -0
- package/src/features/workflow/components/panels/sidebar-nodes/node-categories.tsx +19 -0
- package/src/features/workflow/components/panels/sidebar-nodes/node-lists.ts +71 -0
- package/src/features/workflow/components/panels/sidebar-nodes/special.tsx +44 -0
- package/src/features/workflow/components/panels/sidebar-nodes/triggers.tsx +44 -0
- package/src/features/workflow/components/panels/sidebar-nodes/visualization.tsx +33 -0
- package/src/features/workflow/components/panels/sidebar-panel.tsx +243 -0
- package/src/features/workflow/components/panels/sidebar-panel.types.ts +73 -0
- package/src/features/workflow/components/panels/variable-inspector-table.tsx +99 -0
- package/src/features/workflow/components/panels/variable-inspector-tree.tsx +193 -0
- package/src/features/workflow/components/panels/variable-inspector-types.ts +3 -0
- package/src/features/workflow/components/panels/variable-inspector.tsx +189 -0
- package/src/features/workflow/components/panels/workflow-diff-dialog.tsx +207 -0
- package/src/features/workflow/components/panels/workflow-execution-details.tsx +118 -0
- package/src/features/workflow/components/panels/workflow-execution-history.hooks.ts +116 -0
- package/src/features/workflow/components/panels/workflow-execution-history.tsx +150 -0
- package/src/features/workflow/components/panels/workflow-execution-history.types.ts +53 -0
- package/src/features/workflow/components/panels/workflow-execution-history.utils.ts +195 -0
- package/src/features/workflow/components/panels/workflow-execution-sidebar.tsx +221 -0
- package/src/features/workflow/components/panels/workflow-governance-panel/subworkflow-list-card.tsx +147 -0
- package/src/features/workflow/components/panels/workflow-governance-panel/types.ts +26 -0
- package/src/features/workflow/components/panels/workflow-governance-panel/validation-section.tsx +126 -0
- package/src/features/workflow/components/panels/workflow-governance-panel.tsx +43 -0
- package/src/features/workflow/components/panels/workflow-history-filters.tsx +62 -0
- package/src/features/workflow/components/panels/workflow-history-footer.tsx +28 -0
- package/src/features/workflow/components/panels/workflow-history-header.tsx +47 -0
- package/src/features/workflow/components/panels/workflow-history-table.tsx +148 -0
- package/src/features/workflow/components/panels/workflow-history.tsx +150 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/categories.ts +11 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/actions.tsx +39 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/ai.tsx +39 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/data.tsx +55 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/logic.tsx +39 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/special.tsx +50 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/items/triggers.tsx +71 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data/types.ts +9 -0
- package/src/features/workflow/components/panels/workflow-node-gallery-data.tsx +21 -0
- package/src/features/workflow/components/panels/workflow-node-gallery.tsx +86 -0
- package/src/features/workflow/components/panels/workflow-tabs.tsx +49 -0
- package/src/features/workflow/components/trace/agent-prism/Avatar.tsx +146 -0
- package/src/features/workflow/components/trace/agent-prism/Badge.tsx +95 -0
- package/src/features/workflow/components/trace/agent-prism/BrandLogo.tsx +102 -0
- package/src/features/workflow/components/trace/agent-prism/Button.tsx +124 -0
- package/src/features/workflow/components/trace/agent-prism/CollapseAndExpandControls.tsx +45 -0
- package/src/features/workflow/components/trace/agent-prism/CollapsibleSection.tsx +124 -0
- package/src/features/workflow/components/trace/agent-prism/CopyButton.tsx +63 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsView.tsx +143 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewAttributesTab.tsx +125 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewContentViewer.tsx +51 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewHeader.tsx +100 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewHeaderActions.tsx +21 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewInputOutputTab.tsx +126 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewJsonOutput.tsx +30 -0
- package/src/features/workflow/components/trace/agent-prism/DetailsView/DetailsViewRawDataTab.tsx +31 -0
- package/src/features/workflow/components/trace/agent-prism/IconButton.tsx +75 -0
- package/src/features/workflow/components/trace/agent-prism/PriceBadge.tsx +14 -0
- package/src/features/workflow/components/trace/agent-prism/SearchInput.tsx +17 -0
- package/src/features/workflow/components/trace/agent-prism/SpanBadge.tsx +52 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCard.tsx +480 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardBadges.tsx +23 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardConnector.tsx +36 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardTimeline.tsx +60 -0
- package/src/features/workflow/components/trace/agent-prism/SpanCard/SpanCardToggle.tsx +39 -0
- package/src/features/workflow/components/trace/agent-prism/SpanStatus.tsx +80 -0
- package/src/features/workflow/components/trace/agent-prism/TabSelector.tsx +35 -0
- package/src/features/workflow/components/trace/agent-prism/Tabs.tsx +140 -0
- package/src/features/workflow/components/trace/agent-prism/TextInput.tsx +143 -0
- package/src/features/workflow/components/trace/agent-prism/TimestampBadge.tsx +22 -0
- package/src/features/workflow/components/trace/agent-prism/TokensBadge.tsx +27 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceList.tsx +87 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceListItem.tsx +86 -0
- package/src/features/workflow/components/trace/agent-prism/TraceList/TraceListItemHeader.tsx +37 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewer.test.tsx +183 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewer.tsx +207 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerDesktopLayout.tsx +99 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerMobileLayout.tsx +103 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerPlaceholder.tsx +5 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerSearchAndControls.tsx +30 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/TraceViewerTreeViewContainer.tsx +76 -0
- package/src/features/workflow/components/trace/agent-prism/TraceViewer/useTraceSelection.ts +186 -0
- package/src/features/workflow/components/trace/agent-prism/TreeView.tsx +73 -0
- package/src/features/workflow/components/trace/agent-prism/index.ts +7 -0
- package/src/features/workflow/components/trace/agent-prism/shared.ts +170 -0
- package/src/features/workflow/components/trace/agent-prism/theme/index.js +97 -0
- package/src/features/workflow/components/trace/agent-prism/theme/index.ts +101 -0
- package/src/features/workflow/components/trace/agent-prism/theme/theme.css +247 -0
- package/src/features/workflow/data/node-types.ts +32 -0
- package/src/features/workflow/data/templates/feedly-digest.ts +120 -0
- package/src/features/workflow/data/templates/index.ts +30 -0
- package/src/features/workflow/data/templates/mongodb-session.ts +59 -0
- package/src/features/workflow/data/templates/python-task.ts +59 -0
- package/src/features/workflow/data/templates/quickstart-welcome.ts +65 -0
- package/src/features/workflow/data/templates/rss-monitor.ts +60 -0
- package/src/features/workflow/data/templates/slack-broadcast.ts +58 -0
- package/src/features/workflow/data/templates/telegram-broadcast.ts +76 -0
- package/src/features/workflow/data/templates/template-owner.ts +7 -0
- package/src/features/workflow/data/workflow-data.ts +13 -0
- package/src/features/workflow/data/workflow-types.ts +47 -0
- package/src/features/workflow/lib/graph-config/constants.ts +7 -0
- package/src/features/workflow/lib/graph-config/edge-processing.ts +147 -0
- package/src/features/workflow/lib/graph-config/name-mapping.ts +30 -0
- package/src/features/workflow/lib/graph-config/node-handlers/branching.ts +171 -0
- package/src/features/workflow/lib/graph-config/node-handlers/index.ts +16 -0
- package/src/features/workflow/lib/graph-config/node-handlers/integrations.ts +201 -0
- package/src/features/workflow/lib/graph-config/node-handlers/set-variable.ts +124 -0
- package/src/features/workflow/lib/graph-config/node-processing.ts +163 -0
- package/src/features/workflow/lib/graph-config/serialization.ts +31 -0
- package/src/features/workflow/lib/graph-config/terminal-connections.ts +37 -0
- package/src/features/workflow/lib/graph-config/types.ts +84 -0
- package/src/features/workflow/lib/graph-config/utils.ts +65 -0
- package/src/features/workflow/lib/graph-config/workload.ts +29 -0
- package/src/features/workflow/lib/graph-config.integration.logic.test.ts +168 -0
- package/src/features/workflow/lib/graph-config.integration.start-end.test.ts +68 -0
- package/src/features/workflow/lib/graph-config.integration.variables.test.ts +67 -0
- package/src/features/workflow/lib/graph-config.ts +80 -0
- package/src/features/workflow/lib/graph-utils.ts +193 -0
- package/src/features/workflow/lib/node-icons.tsx +183 -0
- package/src/features/workflow/lib/node-schemas/ai-nodes.ts +81 -0
- package/src/features/workflow/lib/node-schemas/base.ts +154 -0
- package/src/features/workflow/lib/node-schemas/condition-operators.ts +111 -0
- package/src/features/workflow/lib/node-schemas/index.ts +73 -0
- package/src/features/workflow/lib/node-schemas/integration-nodes.ts +153 -0
- package/src/features/workflow/lib/node-schemas/logic-nodes.ts +110 -0
- package/src/features/workflow/lib/node-schemas/state-nodes.ts +45 -0
- package/src/features/workflow/lib/node-schemas/trigger-nodes.ts +218 -0
- package/src/features/workflow/lib/node-schemas/ui.ts +88 -0
- package/src/features/workflow/lib/python-node.ts +23 -0
- package/src/features/workflow/lib/workflow-diff.ts +191 -0
- package/src/features/workflow/lib/workflow-execution-builders.ts +101 -0
- package/src/features/workflow/lib/workflow-execution-formatters.ts +145 -0
- package/src/features/workflow/lib/workflow-execution-storage.ts +60 -0
- package/src/features/workflow/lib/workflow-execution.types.ts +38 -0
- package/src/features/workflow/lib/workflow-storage-api.ts +122 -0
- package/src/features/workflow/lib/workflow-storage-helpers.ts +207 -0
- package/src/features/workflow/lib/workflow-storage-versioning.ts +71 -0
- package/src/features/workflow/lib/workflow-storage.constants.ts +21 -0
- package/src/features/workflow/lib/workflow-storage.list.integration.test.ts +70 -0
- package/src/features/workflow/lib/workflow-storage.sanitized-save.integration.test.ts +116 -0
- package/src/features/workflow/lib/workflow-storage.save.integration.test.ts +124 -0
- package/src/features/workflow/lib/workflow-storage.test-helpers.ts +29 -0
- package/src/features/workflow/lib/workflow-storage.ts +183 -0
- package/src/features/workflow/lib/workflow-storage.types.ts +76 -0
- package/src/features/workflow/pages/workflow-canvas/components/canvas-tab-content.tsx +157 -0
- package/src/features/workflow/pages/workflow-canvas/components/execution-tab-content.tsx +57 -0
- package/src/features/workflow/pages/workflow-canvas/components/readiness-tab-content.tsx +49 -0
- package/src/features/workflow/pages/workflow-canvas/components/settings-tab-content.tsx +160 -0
- package/src/features/workflow/pages/workflow-canvas/components/trace-tab-content.test.tsx +204 -0
- package/src/features/workflow/pages/workflow-canvas/components/trace-tab-content.tsx +202 -0
- package/src/features/workflow/pages/workflow-canvas/components/workflow-canvas-layout.tsx +179 -0
- package/src/features/workflow/pages/workflow-canvas/handlers/credentials.ts +158 -0
- package/src/features/workflow/pages/workflow-canvas/handlers/subworkflows.ts +227 -0
- package/src/features/workflow/pages/workflow-canvas/handlers/validation.ts +175 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/clipboard.ts +85 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/execution.ts +39 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/id.ts +15 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/node-identity.ts +157 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/runtime-cache.ts +70 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/sticky-notes.ts +52 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflow-library.ts +12 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/content-qa.ts +88 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/customer-onboarding.ts +67 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/incident-response.ts +88 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/subworkflows/types.ts +9 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/trace.ts +552 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/transformers.ts +140 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/types.ts +122 -0
- package/src/features/workflow/pages/workflow-canvas/helpers/validation.ts +57 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/build-layout-props.ts +229 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-controller.ts +26 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-core.ts +188 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-execution.ts +269 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-lifecycle.ts +44 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/controller/use-workflow-canvas-resources.ts +92 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-canvas-updater.ts +79 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-log-helpers.ts +75 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-node-status.ts +46 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-record-updater.ts +118 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-record.ts +69 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/execution-runtime-updates.ts +84 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/node-factory.ts +166 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-canvas-ui-state.ts +19 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-decorated-nodes.ts +115 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-execution-history-handlers.ts +187 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-execution-trace.ts +302 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-execution-updates.ts +143 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-initial-fit-view.ts +27 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-node-creation.ts +133 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-node-inspector-handlers.ts +194 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-pause-workflow.ts +95 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-run-workflow.ts +139 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-runtime-cache-sync.ts +52 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-subworkflow-state.ts +47 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-canvas-history.ts +233 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-chat.ts +284 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-clipboard.ts +218 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-credentials.ts +139 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-duplicate-nodes.ts +140 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-execution-state.ts +20 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-file-transfer.ts +203 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-keybindings.ts +126 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-loader.ts +174 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-metadata-state.ts +28 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-node-deletion.ts +167 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-node-state.ts +89 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-saver.ts +204 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-search.ts +167 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-sticky-notes.ts +89 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-storage-listener.ts +51 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/use-workflow-validation-state.ts +22 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/workflow-clipboard-copy.ts +96 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/workflow-clipboard-paste.ts +109 -0
- package/src/features/workflow/pages/workflow-canvas/hooks/workflow-runner-websocket.ts +146 -0
- package/src/features/workflow/pages/workflow-canvas.test.tsx +194 -0
- package/src/features/workflow/pages/workflow-canvas.tsx +23 -0
- package/src/features/workflow/pages/workflow-execution-details.tsx +194 -0
- package/src/features/workflow/pages/workflow-gallery/types.ts +21 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery-actions.ts +219 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery-state.ts +204 -0
- package/src/features/workflow/pages/workflow-gallery/use-workflow-gallery.ts +21 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-card.tsx +222 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-create-dialogs.tsx +114 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-filter-popover.tsx +190 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-gallery-header.tsx +134 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-gallery-tabs.tsx +93 -0
- package/src/features/workflow/pages/workflow-gallery/workflow-thumbnail.tsx +82 -0
- package/src/features/workflow/pages/workflow-gallery.tsx +100 -0
- package/src/features/workflow/types/credential-vault.ts +36 -0
- package/src/hooks/use-color-scheme.ts +77 -0
- package/src/hooks/use-credential-vault.ts +245 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-toast.ts +182 -0
- package/src/index.css +95 -0
- package/src/lib/api.test.ts +135 -0
- package/src/lib/api.ts +45 -0
- package/src/lib/config.ts +84 -0
- package/src/lib/theme.ts +71 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.tsx +24 -0
- package/src/setupTests.ts +5 -0
- package/src/test-utils/chatkit-stub.ts +15 -0
- package/src/testing/mocks/backend/credentials.ts +60 -0
- package/src/testing/mocks/backend/request-utils.ts +32 -0
- package/src/testing/mocks/backend/workflows.ts +235 -0
- package/src/testing/mocks/backend.ts +52 -0
- package/src/testing/mocks/chatkit.ts +14 -0
- package/src/vite-env.d.ts +10 -0
- package/tailwind.config.js +61 -0
- package/tsconfig.app.json +30 -0
- package/tsconfig.json +16 -0
- package/tsconfig.node.json +20 -0
- package/vite.config.ts +30 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Edge, Node } from "@xyflow/react";
|
|
2
|
+
|
|
3
|
+
export type NodeRuntimeCacheEntry = {
|
|
4
|
+
inputs?: unknown;
|
|
5
|
+
outputs?: unknown;
|
|
6
|
+
messages?: unknown;
|
|
7
|
+
raw?: unknown;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface NodeInspectorProps {
|
|
12
|
+
node?: {
|
|
13
|
+
id: string;
|
|
14
|
+
type: string;
|
|
15
|
+
data: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
nodes?: Node[];
|
|
18
|
+
edges?: Edge[];
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
onSave?: (nodeId: string, data: Record<string, unknown>) => void;
|
|
21
|
+
runtimeCache?: Record<string, NodeRuntimeCacheEntry>;
|
|
22
|
+
onCacheRuntime?: (nodeId: string, runtime: NodeRuntimeCacheEntry) => void;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SchemaField {
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
path: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { toast } from "sonner";
|
|
3
|
+
import { executeNode } from "@/lib/api";
|
|
4
|
+
import type { NodeInspectorProps, NodeRuntimeCacheEntry } from "./types";
|
|
5
|
+
import { isRecord } from "./utils";
|
|
6
|
+
|
|
7
|
+
interface UseNodeTesterParams {
|
|
8
|
+
node?: NodeInspectorProps["node"];
|
|
9
|
+
backendType: string | null;
|
|
10
|
+
draftData: Record<string, unknown>;
|
|
11
|
+
liveInputs: unknown;
|
|
12
|
+
upstreamOutputs: Record<string, unknown>;
|
|
13
|
+
useLiveData: boolean;
|
|
14
|
+
onCacheRuntime?: (nodeId: string, runtime: NodeRuntimeCacheEntry) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface UseNodeTesterReturn {
|
|
18
|
+
isTestingNode: boolean;
|
|
19
|
+
testResult: unknown;
|
|
20
|
+
testError: string | null;
|
|
21
|
+
handleTestNode: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const buildNodeConfig = (
|
|
25
|
+
node: NonNullable<NodeInspectorProps["node"]>,
|
|
26
|
+
draftData: Record<string, unknown>,
|
|
27
|
+
backendType: string,
|
|
28
|
+
): Record<string, unknown> => {
|
|
29
|
+
const nodeConfig: Record<string, unknown> = {
|
|
30
|
+
name: node.id,
|
|
31
|
+
...draftData,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
delete nodeConfig.runtime;
|
|
35
|
+
delete nodeConfig.label;
|
|
36
|
+
delete nodeConfig.description;
|
|
37
|
+
delete nodeConfig.iconKey;
|
|
38
|
+
delete nodeConfig.backendType;
|
|
39
|
+
delete nodeConfig.type;
|
|
40
|
+
|
|
41
|
+
nodeConfig.type = backendType;
|
|
42
|
+
|
|
43
|
+
if (
|
|
44
|
+
backendType === "SetVariableNode" &&
|
|
45
|
+
Array.isArray(nodeConfig.variables)
|
|
46
|
+
) {
|
|
47
|
+
const variablesArray = nodeConfig.variables as Array<
|
|
48
|
+
Record<string, unknown>
|
|
49
|
+
>;
|
|
50
|
+
const variablesDict: Record<string, unknown> = {};
|
|
51
|
+
|
|
52
|
+
for (const variable of variablesArray) {
|
|
53
|
+
if (!variable?.name) continue;
|
|
54
|
+
|
|
55
|
+
const variableName = String(variable.name);
|
|
56
|
+
const valueType =
|
|
57
|
+
typeof variable.valueType === "string" ? variable.valueType : "string";
|
|
58
|
+
let typedValue = variable.value ?? null;
|
|
59
|
+
|
|
60
|
+
if (typedValue !== null && typedValue !== undefined) {
|
|
61
|
+
switch (valueType) {
|
|
62
|
+
case "number":
|
|
63
|
+
typedValue = Number(typedValue);
|
|
64
|
+
break;
|
|
65
|
+
case "boolean":
|
|
66
|
+
typedValue =
|
|
67
|
+
typedValue === true || typedValue === "true" || typedValue === 1;
|
|
68
|
+
break;
|
|
69
|
+
case "object":
|
|
70
|
+
if (typeof typedValue === "string") {
|
|
71
|
+
try {
|
|
72
|
+
typedValue = JSON.parse(typedValue);
|
|
73
|
+
} catch {
|
|
74
|
+
console.warn(
|
|
75
|
+
`Failed to parse object value for ${variableName}, using empty object`,
|
|
76
|
+
);
|
|
77
|
+
typedValue = {};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
typedValue = String(typedValue);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
variablesDict[variableName] = typedValue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
nodeConfig.variables = variablesDict;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return nodeConfig;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export function useNodeTester({
|
|
96
|
+
node,
|
|
97
|
+
backendType,
|
|
98
|
+
draftData,
|
|
99
|
+
liveInputs,
|
|
100
|
+
upstreamOutputs,
|
|
101
|
+
useLiveData,
|
|
102
|
+
onCacheRuntime,
|
|
103
|
+
}: UseNodeTesterParams): UseNodeTesterReturn {
|
|
104
|
+
const [isTestingNode, setIsTestingNode] = useState(false);
|
|
105
|
+
const [testResult, setTestResult] = useState<unknown>(null);
|
|
106
|
+
const [testError, setTestError] = useState<string | null>(null);
|
|
107
|
+
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
setTestResult(null);
|
|
110
|
+
setTestError(null);
|
|
111
|
+
}, [node?.id]);
|
|
112
|
+
|
|
113
|
+
const handleTestNode = useCallback(async () => {
|
|
114
|
+
if (!node) {
|
|
115
|
+
toast.error("Cannot test node: node not found");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const resolvedBackendType =
|
|
120
|
+
typeof draftData?.backendType === "string"
|
|
121
|
+
? (draftData.backendType as string)
|
|
122
|
+
: backendType;
|
|
123
|
+
|
|
124
|
+
if (!resolvedBackendType) {
|
|
125
|
+
toast.error(
|
|
126
|
+
"Cannot test node: missing backend type information. This node may not support testing yet.",
|
|
127
|
+
);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
setIsTestingNode(true);
|
|
132
|
+
setTestError(null);
|
|
133
|
+
setTestResult(null);
|
|
134
|
+
|
|
135
|
+
try {
|
|
136
|
+
const nodeConfig = buildNodeConfig(node, draftData, resolvedBackendType);
|
|
137
|
+
|
|
138
|
+
let inputs: Record<string, unknown> = {};
|
|
139
|
+
|
|
140
|
+
if (useLiveData && isRecord(liveInputs)) {
|
|
141
|
+
inputs = { ...liveInputs };
|
|
142
|
+
} else if (Object.keys(upstreamOutputs).length > 0) {
|
|
143
|
+
inputs = { ...upstreamOutputs };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const response = await executeNode({
|
|
147
|
+
node_config: nodeConfig,
|
|
148
|
+
inputs,
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
if (response.status === "success") {
|
|
152
|
+
setTestResult(response.result);
|
|
153
|
+
const timestamp = new Date().toISOString();
|
|
154
|
+
const cachedInputs = { ...inputs };
|
|
155
|
+
const runtimeUpdate: NodeRuntimeCacheEntry = {
|
|
156
|
+
...(Object.keys(cachedInputs).length > 0
|
|
157
|
+
? { inputs: cachedInputs }
|
|
158
|
+
: {}),
|
|
159
|
+
raw: response.result,
|
|
160
|
+
updatedAt: timestamp,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
if (response.result !== undefined) {
|
|
164
|
+
if (isRecord(response.result)) {
|
|
165
|
+
const resultRecord = response.result as Record<string, unknown>;
|
|
166
|
+
if (resultRecord.outputs !== undefined) {
|
|
167
|
+
runtimeUpdate.outputs = resultRecord.outputs;
|
|
168
|
+
} else if (runtimeUpdate.outputs === undefined) {
|
|
169
|
+
runtimeUpdate.outputs = response.result;
|
|
170
|
+
}
|
|
171
|
+
if (resultRecord.messages !== undefined) {
|
|
172
|
+
runtimeUpdate.messages = resultRecord.messages;
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
runtimeUpdate.outputs = response.result;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
onCacheRuntime?.(node.id, runtimeUpdate);
|
|
180
|
+
toast.success("Node executed successfully");
|
|
181
|
+
} else {
|
|
182
|
+
setTestError(response.error || "Unknown error");
|
|
183
|
+
toast.error("Node execution failed");
|
|
184
|
+
}
|
|
185
|
+
} catch (error) {
|
|
186
|
+
const errorMessage =
|
|
187
|
+
error instanceof Error ? error.message : "Failed to execute node";
|
|
188
|
+
setTestError(errorMessage);
|
|
189
|
+
toast.error(errorMessage);
|
|
190
|
+
} finally {
|
|
191
|
+
setIsTestingNode(false);
|
|
192
|
+
}
|
|
193
|
+
}, [
|
|
194
|
+
backendType,
|
|
195
|
+
draftData,
|
|
196
|
+
liveInputs,
|
|
197
|
+
node,
|
|
198
|
+
onCacheRuntime,
|
|
199
|
+
upstreamOutputs,
|
|
200
|
+
useLiveData,
|
|
201
|
+
]);
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
isTestingNode,
|
|
205
|
+
testResult,
|
|
206
|
+
testError,
|
|
207
|
+
handleTestNode,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DEFAULT_PYTHON_CODE } from "@features/workflow/lib/python-node";
|
|
2
|
+
import type { NodeInspectorProps, NodeRuntimeCacheEntry } from "./types";
|
|
3
|
+
|
|
4
|
+
export const isRecord = (value: unknown): value is Record<string, unknown> => {
|
|
5
|
+
return typeof value === "object" && value !== null;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const extractPythonCode = (
|
|
9
|
+
node?: NodeInspectorProps["node"],
|
|
10
|
+
): string => {
|
|
11
|
+
if (!node) {
|
|
12
|
+
return DEFAULT_PYTHON_CODE;
|
|
13
|
+
}
|
|
14
|
+
const candidate = node.data?.code;
|
|
15
|
+
return typeof candidate === "string" && candidate.length > 0
|
|
16
|
+
? candidate
|
|
17
|
+
: DEFAULT_PYTHON_CODE;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const getSemanticType = (
|
|
21
|
+
node?: NodeInspectorProps["node"],
|
|
22
|
+
): string | null => {
|
|
23
|
+
if (!node) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const dataType = node.data?.type;
|
|
27
|
+
if (typeof dataType === "string" && dataType.length > 0) {
|
|
28
|
+
return dataType.toLowerCase();
|
|
29
|
+
}
|
|
30
|
+
return typeof node.type === "string" && node.type.length > 0
|
|
31
|
+
? node.type.toLowerCase()
|
|
32
|
+
: null;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const formatUpdatedAt = (timestamp?: string): string | null => {
|
|
36
|
+
if (!timestamp) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const parsed = new Date(timestamp);
|
|
40
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
41
|
+
return timestamp;
|
|
42
|
+
}
|
|
43
|
+
return parsed.toLocaleTimeString([], {
|
|
44
|
+
hour: "2-digit",
|
|
45
|
+
minute: "2-digit",
|
|
46
|
+
second: "2-digit",
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const getOutputDisplay = (
|
|
51
|
+
runtime: NodeRuntimeCacheEntry | null,
|
|
52
|
+
): {
|
|
53
|
+
outputDisplay: unknown;
|
|
54
|
+
hasLiveOutputs: boolean;
|
|
55
|
+
} => {
|
|
56
|
+
if (!runtime) {
|
|
57
|
+
return { outputDisplay: undefined, hasLiveOutputs: false };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { outputs, messages, raw } = runtime;
|
|
61
|
+
let display: unknown = raw;
|
|
62
|
+
|
|
63
|
+
if (outputs !== undefined || messages !== undefined) {
|
|
64
|
+
const merged: Record<string, unknown> = {};
|
|
65
|
+
if (outputs !== undefined) {
|
|
66
|
+
merged.outputs = outputs as unknown;
|
|
67
|
+
}
|
|
68
|
+
if (messages !== undefined) {
|
|
69
|
+
merged.messages = messages as unknown;
|
|
70
|
+
}
|
|
71
|
+
display =
|
|
72
|
+
outputs !== undefined && messages === undefined ? outputs : merged;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const hasOutputs =
|
|
76
|
+
outputs !== undefined || messages !== undefined || display !== undefined;
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
outputDisplay: display,
|
|
80
|
+
hasLiveOutputs: hasOutputs,
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregates the basic widget sets to keep the theme entry tidy.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { RegistryWidgetsType } from "@rjsf/utils";
|
|
6
|
+
import { primitiveWidgets } from "./rjsf-input-widgets";
|
|
7
|
+
import { textWidgets } from "./rjsf-text-widgets";
|
|
8
|
+
|
|
9
|
+
export const basicWidgets = {
|
|
10
|
+
...textWidgets,
|
|
11
|
+
...primitiveWidgets,
|
|
12
|
+
} satisfies Pick<
|
|
13
|
+
RegistryWidgetsType,
|
|
14
|
+
| "TextWidget"
|
|
15
|
+
| "TextareaWidget"
|
|
16
|
+
| "NumberWidget"
|
|
17
|
+
| "CheckboxWidget"
|
|
18
|
+
| "SelectWidget"
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export { primitiveWidgets, textWidgets };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
+
/**
|
|
3
|
+
* Condition-specific widgets that provide operator pickers and typed operands.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { RegistryWidgetsType, WidgetProps, getUiOptions } from "@rjsf/utils";
|
|
8
|
+
import { Input } from "@/design-system/ui/input";
|
|
9
|
+
import { Button } from "@/design-system/ui/button";
|
|
10
|
+
import { Check } from "lucide-react";
|
|
11
|
+
import {
|
|
12
|
+
DropdownMenu,
|
|
13
|
+
DropdownMenuContent,
|
|
14
|
+
DropdownMenuItem,
|
|
15
|
+
DropdownMenuSub,
|
|
16
|
+
DropdownMenuSubContent,
|
|
17
|
+
DropdownMenuSubTrigger,
|
|
18
|
+
DropdownMenuTrigger,
|
|
19
|
+
} from "@/design-system/ui/dropdown-menu";
|
|
20
|
+
import {
|
|
21
|
+
conditionOperatorGroups,
|
|
22
|
+
type ConditionOperatorGroup,
|
|
23
|
+
type ConditionOperatorOption,
|
|
24
|
+
} from "@features/workflow/lib/node-schemas";
|
|
25
|
+
import {
|
|
26
|
+
hasSchemaFieldData,
|
|
27
|
+
insertSchemaFieldReference,
|
|
28
|
+
readSchemaFieldDragData,
|
|
29
|
+
} from "./schema-dnd";
|
|
30
|
+
|
|
31
|
+
const formatOperandValue = (value: unknown): string => {
|
|
32
|
+
if (value === undefined) {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
if (value === null) {
|
|
36
|
+
return "null";
|
|
37
|
+
}
|
|
38
|
+
if (typeof value === "object") {
|
|
39
|
+
try {
|
|
40
|
+
return JSON.stringify(value);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error("Failed to stringify operand", error);
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return String(value);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const parseOperandValue = (rawValue: string): unknown => {
|
|
50
|
+
const trimmed = rawValue.trim();
|
|
51
|
+
if (trimmed.length === 0) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
if (trimmed === "null") {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (trimmed === "true") {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (trimmed === "false") {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const numberPattern = /^-?\d+(\.\d+)?$/;
|
|
64
|
+
if (numberPattern.test(trimmed)) {
|
|
65
|
+
return Number(trimmed);
|
|
66
|
+
}
|
|
67
|
+
return rawValue;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
function ConditionOperandWidget(props: WidgetProps) {
|
|
71
|
+
const {
|
|
72
|
+
id,
|
|
73
|
+
value,
|
|
74
|
+
onChange,
|
|
75
|
+
disabled,
|
|
76
|
+
readonly,
|
|
77
|
+
placeholder,
|
|
78
|
+
onBlur,
|
|
79
|
+
onFocus,
|
|
80
|
+
} = props;
|
|
81
|
+
const displayValue = formatOperandValue(value);
|
|
82
|
+
|
|
83
|
+
const handleDragOver = React.useCallback(
|
|
84
|
+
(event: React.DragEvent<HTMLInputElement>) => {
|
|
85
|
+
if (disabled || readonly) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (hasSchemaFieldData(event.dataTransfer)) {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
event.dataTransfer.dropEffect = "copy";
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
[disabled, readonly],
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const handleDrop = React.useCallback(
|
|
97
|
+
(event: React.DragEvent<HTMLInputElement>) => {
|
|
98
|
+
if (disabled || readonly) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const payload = readSchemaFieldDragData(event.dataTransfer);
|
|
103
|
+
if (!payload?.path) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
event.stopPropagation();
|
|
109
|
+
|
|
110
|
+
const target = event.target as HTMLInputElement;
|
|
111
|
+
const { value: nextValue, selectionStart } = insertSchemaFieldReference(
|
|
112
|
+
target,
|
|
113
|
+
payload.path,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
target.value = nextValue;
|
|
117
|
+
target.focus();
|
|
118
|
+
const restoreSelection = () =>
|
|
119
|
+
target.setSelectionRange(selectionStart, selectionStart);
|
|
120
|
+
if (typeof window !== "undefined" && window.requestAnimationFrame) {
|
|
121
|
+
window.requestAnimationFrame(restoreSelection);
|
|
122
|
+
} else {
|
|
123
|
+
restoreSelection();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const parsedValue = parseOperandValue(nextValue);
|
|
127
|
+
onChange(parsedValue);
|
|
128
|
+
},
|
|
129
|
+
[disabled, onChange, readonly],
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<Input
|
|
134
|
+
id={id}
|
|
135
|
+
value={displayValue}
|
|
136
|
+
onChange={(event) => onChange(parseOperandValue(event.target.value))}
|
|
137
|
+
onBlur={(event) => onBlur?.(id, parseOperandValue(event.target.value))}
|
|
138
|
+
onFocus={(event) => onFocus?.(id, parseOperandValue(event.target.value))}
|
|
139
|
+
disabled={disabled || readonly}
|
|
140
|
+
placeholder={placeholder}
|
|
141
|
+
onDragOver={handleDragOver}
|
|
142
|
+
onDrop={handleDrop}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
type OperatorSelection = {
|
|
148
|
+
group: ConditionOperatorGroup;
|
|
149
|
+
option: ConditionOperatorOption;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const findOperatorSelection = (value: unknown): OperatorSelection | null => {
|
|
153
|
+
if (typeof value !== "string") {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
for (const group of conditionOperatorGroups) {
|
|
157
|
+
const option = group.options.find((candidate) => candidate.value === value);
|
|
158
|
+
if (option) {
|
|
159
|
+
return { group, option };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
function ConditionOperatorWidget(props: WidgetProps) {
|
|
166
|
+
const { id, value, onChange, disabled, readonly, options, uiSchema } = props;
|
|
167
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
168
|
+
const groups =
|
|
169
|
+
(uiOptions.operatorGroups as ConditionOperatorGroup[]) ??
|
|
170
|
+
conditionOperatorGroups;
|
|
171
|
+
const selection = findOperatorSelection(value);
|
|
172
|
+
const buttonLabel = selection
|
|
173
|
+
? `${selection.group.label} · ${selection.option.label}`
|
|
174
|
+
: "Select operator";
|
|
175
|
+
const allowedValues = new Set(
|
|
176
|
+
((options.enumOptions as Array<{ value: string }> | undefined) ?? []).map(
|
|
177
|
+
(entry) => String(entry.value),
|
|
178
|
+
),
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
const handleSelect = (nextValue: string) => {
|
|
182
|
+
if (!allowedValues.size || allowedValues.has(nextValue)) {
|
|
183
|
+
onChange(nextValue);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<DropdownMenu>
|
|
189
|
+
<DropdownMenuTrigger asChild>
|
|
190
|
+
<Button
|
|
191
|
+
id={id}
|
|
192
|
+
variant="outline"
|
|
193
|
+
className="w-full justify-between"
|
|
194
|
+
disabled={disabled || readonly}
|
|
195
|
+
>
|
|
196
|
+
<span className="truncate text-left">{buttonLabel}</span>
|
|
197
|
+
</Button>
|
|
198
|
+
</DropdownMenuTrigger>
|
|
199
|
+
<DropdownMenuContent className="w-64">
|
|
200
|
+
{groups.map((group) => (
|
|
201
|
+
<DropdownMenuSub key={group.key}>
|
|
202
|
+
<DropdownMenuSubTrigger>{group.label}</DropdownMenuSubTrigger>
|
|
203
|
+
<DropdownMenuSubContent className="w-64">
|
|
204
|
+
{group.options.map((option) => (
|
|
205
|
+
<DropdownMenuItem
|
|
206
|
+
key={option.value}
|
|
207
|
+
onSelect={() => handleSelect(option.value)}
|
|
208
|
+
className="justify-between"
|
|
209
|
+
>
|
|
210
|
+
<div className="flex flex-col text-left">
|
|
211
|
+
<span>{option.label}</span>
|
|
212
|
+
{option.description && (
|
|
213
|
+
<span className="text-xs text-muted-foreground">
|
|
214
|
+
{option.description}
|
|
215
|
+
</span>
|
|
216
|
+
)}
|
|
217
|
+
</div>
|
|
218
|
+
{selection?.option.value === option.value && (
|
|
219
|
+
<Check className="h-4 w-4" />
|
|
220
|
+
)}
|
|
221
|
+
</DropdownMenuItem>
|
|
222
|
+
))}
|
|
223
|
+
</DropdownMenuSubContent>
|
|
224
|
+
</DropdownMenuSub>
|
|
225
|
+
))}
|
|
226
|
+
</DropdownMenuContent>
|
|
227
|
+
</DropdownMenu>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
type ConditionWidgetMap = Pick<
|
|
232
|
+
RegistryWidgetsType,
|
|
233
|
+
"conditionOperand" | "conditionOperator"
|
|
234
|
+
>;
|
|
235
|
+
|
|
236
|
+
export const conditionWidgets: ConditionWidgetMap = {
|
|
237
|
+
conditionOperand: ConditionOperandWidget,
|
|
238
|
+
conditionOperator: ConditionOperatorWidget,
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export { ConditionOperandWidget, ConditionOperatorWidget };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
+
/**
|
|
3
|
+
* Primitive input widgets (number, checkbox, select).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { RegistryWidgetsType, WidgetProps } from "@rjsf/utils";
|
|
8
|
+
import { Input } from "@/design-system/ui/input";
|
|
9
|
+
import { Label } from "@/design-system/ui/label";
|
|
10
|
+
import { Switch } from "@/design-system/ui/switch";
|
|
11
|
+
import {
|
|
12
|
+
Select,
|
|
13
|
+
SelectContent,
|
|
14
|
+
SelectItem,
|
|
15
|
+
SelectTrigger,
|
|
16
|
+
SelectValue,
|
|
17
|
+
} from "@/design-system/ui/select";
|
|
18
|
+
|
|
19
|
+
function NumberWidget(props: WidgetProps) {
|
|
20
|
+
const {
|
|
21
|
+
id,
|
|
22
|
+
value,
|
|
23
|
+
onChange,
|
|
24
|
+
required,
|
|
25
|
+
disabled,
|
|
26
|
+
readonly,
|
|
27
|
+
placeholder,
|
|
28
|
+
schema,
|
|
29
|
+
} = props;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Input
|
|
33
|
+
id={id}
|
|
34
|
+
type="number"
|
|
35
|
+
value={value ?? ""}
|
|
36
|
+
onChange={(e) => {
|
|
37
|
+
const val = e.target.value;
|
|
38
|
+
onChange(val === "" ? undefined : Number(val));
|
|
39
|
+
}}
|
|
40
|
+
required={required}
|
|
41
|
+
disabled={disabled}
|
|
42
|
+
readOnly={readonly}
|
|
43
|
+
placeholder={placeholder}
|
|
44
|
+
min={schema.minimum}
|
|
45
|
+
max={schema.maximum}
|
|
46
|
+
step={schema.multipleOf || (schema.type === "integer" ? 1 : "any")}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function CheckboxWidget(props: WidgetProps) {
|
|
52
|
+
const { id, value, onChange, label, disabled, readonly } = props;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className="flex items-center space-x-2">
|
|
56
|
+
<Switch
|
|
57
|
+
id={id}
|
|
58
|
+
checked={Boolean(value)}
|
|
59
|
+
onCheckedChange={onChange}
|
|
60
|
+
disabled={disabled || readonly}
|
|
61
|
+
/>
|
|
62
|
+
<Label htmlFor={id}>{label}</Label>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function SelectWidget(props: WidgetProps) {
|
|
68
|
+
const { id, value, onChange, options, disabled, readonly, placeholder } =
|
|
69
|
+
props;
|
|
70
|
+
const { enumOptions } = options;
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Select
|
|
74
|
+
value={value ? String(value) : undefined}
|
|
75
|
+
onValueChange={onChange}
|
|
76
|
+
disabled={disabled || readonly}
|
|
77
|
+
>
|
|
78
|
+
<SelectTrigger id={id}>
|
|
79
|
+
<SelectValue placeholder={placeholder || "Select an option"} />
|
|
80
|
+
</SelectTrigger>
|
|
81
|
+
<SelectContent>
|
|
82
|
+
{(enumOptions as Array<{ value: string; label: string }>)?.map(
|
|
83
|
+
(option) => (
|
|
84
|
+
<SelectItem key={option.value} value={String(option.value)}>
|
|
85
|
+
{option.label}
|
|
86
|
+
</SelectItem>
|
|
87
|
+
),
|
|
88
|
+
)}
|
|
89
|
+
</SelectContent>
|
|
90
|
+
</Select>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type PrimitiveWidgetMap = Pick<
|
|
95
|
+
RegistryWidgetsType,
|
|
96
|
+
"NumberWidget" | "CheckboxWidget" | "SelectWidget"
|
|
97
|
+
>;
|
|
98
|
+
|
|
99
|
+
export const primitiveWidgets: PrimitiveWidgetMap = {
|
|
100
|
+
NumberWidget,
|
|
101
|
+
CheckboxWidget,
|
|
102
|
+
SelectWidget,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export { NumberWidget, CheckboxWidget, SelectWidget };
|