@invect/ui 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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/Invect-CWpIwZ5F.js +92738 -0
- package/dist/Invect.d.ts +25 -0
- package/dist/InvectShell.d.ts +14 -0
- package/dist/api/agent-tools.api.d.ts +1 -0
- package/dist/api/client.d.ts +207 -0
- package/dist/api/credentials.api.d.ts +47 -0
- package/dist/api/executions.api.d.ts +43 -0
- package/dist/api/flows.api.d.ts +100 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/node-data.api.d.ts +66 -0
- package/dist/api/query-keys.d.ts +22 -0
- package/dist/api/triggers.api.d.ts +44 -0
- package/dist/api/types.d.ts +147 -0
- package/dist/api/use-flow-run-stream.d.ts +12 -0
- package/dist/assets/invect-branding.d.ts +4 -0
- package/dist/assets/provider-icons/index.d.ts +8 -0
- package/dist/babel-C9OtljFZ.js +9721 -0
- package/dist/components/PageLayout.d.ts +17 -0
- package/dist/components/chat/ChatInput.d.ts +17 -0
- package/dist/components/chat/ChatMessageList.d.ts +14 -0
- package/dist/components/chat/ChatModelSelector.d.ts +11 -0
- package/dist/components/chat/ChatPanel.d.ts +19 -0
- package/dist/components/chat/ChatPromptOverlay.d.ts +13 -0
- package/dist/components/chat/ChatProviderSelector.d.ts +9 -0
- package/dist/components/chat/ChatSettingsPanel.d.ts +11 -0
- package/dist/components/chat/InlineCredentialSetup.d.ts +9 -0
- package/dist/components/chat/MarkdownRenderer.d.ts +7 -0
- package/dist/components/chat/chat-memory.d.ts +21 -0
- package/dist/components/chat/chat.store.d.ts +416 -0
- package/dist/components/chat/index.d.ts +5 -0
- package/dist/components/chat/use-chat.d.ts +28 -0
- package/dist/components/credentials/CreateCredentialModal.d.ts +13 -0
- package/dist/components/credentials/CredentialDetailDialog.d.ts +17 -0
- package/dist/components/credentials/EditCredentialModal.d.ts +11 -0
- package/dist/components/credentials/OAuth2ConnectButton.d.ts +38 -0
- package/dist/components/credentials/OAuth2ProviderSelector.d.ts +15 -0
- package/dist/components/credentials/credential-utils.d.ts +12 -0
- package/dist/components/credentials/index.d.ts +9 -0
- package/dist/components/dashboard/FailedRunsAlert.d.ts +3 -0
- package/dist/components/dashboard/FlowCard.d.ts +7 -0
- package/dist/components/dashboard/RecentActivityTable.d.ts +9 -0
- package/dist/components/dashboard/StatCard.d.ts +10 -0
- package/dist/components/dashboard/index.d.ts +5 -0
- package/dist/components/dashboard/status-helpers.d.ts +5 -0
- package/dist/components/flow-editor/ActionsSidebar.d.ts +2 -0
- package/dist/components/flow-editor/FlowEditor.d.ts +21 -0
- package/dist/components/flow-editor/FlowHeader.d.ts +9 -0
- package/dist/components/flow-editor/FlowLayout.d.ts +24 -0
- package/dist/components/flow-editor/ModeSwitcher.d.ts +7 -0
- package/dist/components/flow-editor/NodeSidebar.d.ts +24 -0
- package/dist/components/flow-editor/RunControls.d.ts +12 -0
- package/dist/components/flow-editor/ToolConfigPanel.d.ts +16 -0
- package/dist/components/flow-editor/ValidationPanel.d.ts +5 -0
- package/dist/components/flow-editor/flow-editor.store.d.ts +1 -0
- package/dist/components/flow-editor/index.d.ts +6 -0
- package/dist/components/flow-editor/inline-edit.d.ts +10 -0
- package/dist/components/flow-editor/node-config-panel/ConfigFieldWithTemplate.d.ts +26 -0
- package/dist/components/flow-editor/node-config-panel/CredentialCombobox.d.ts +21 -0
- package/dist/components/flow-editor/node-config-panel/CredentialsSection.d.ts +19 -0
- package/dist/components/flow-editor/node-config-panel/DroppableInput.d.ts +20 -0
- package/dist/components/flow-editor/node-config-panel/DynamicSelectField.d.ts +22 -0
- package/dist/components/flow-editor/node-config-panel/JsonPreviewPanel.d.ts +25 -0
- package/dist/components/flow-editor/node-config-panel/NodeConfigPanel.d.ts +14 -0
- package/dist/components/flow-editor/node-config-panel/NodeConfigPanelHeader.d.ts +15 -0
- package/dist/components/flow-editor/node-config-panel/ParametersSection.d.ts +16 -0
- package/dist/components/flow-editor/node-config-panel/SearchableSelectField.d.ts +17 -0
- package/dist/components/flow-editor/node-config-panel/SwitchCasesField.d.ts +18 -0
- package/dist/components/flow-editor/node-config-panel/hooks/index.d.ts +2 -0
- package/dist/components/flow-editor/node-config-panel/hooks/use-node-config-panel-state.d.ts +24 -0
- package/dist/components/flow-editor/node-config-panel/hooks/use-node-execution.d.ts +46 -0
- package/dist/components/flow-editor/node-config-panel/hooks/use-upstream-slots.d.ts +16 -0
- package/dist/components/flow-editor/node-config-panel/panels/AgentToolsPanel.d.ts +18 -0
- package/dist/components/flow-editor/node-config-panel/panels/ConfigurationPanel.d.ts +49 -0
- package/dist/components/flow-editor/node-config-panel/panels/DataMapperPane.d.ts +40 -0
- package/dist/components/flow-editor/node-config-panel/panels/InputPanel.d.ts +49 -0
- package/dist/components/flow-editor/node-config-panel/panels/OutputPanel.d.ts +7 -0
- package/dist/components/flow-editor/node-config-panel/panels/index.d.ts +4 -0
- package/dist/components/flow-editor/node-config-panel/types.d.ts +19 -0
- package/dist/components/flow-editor/node-config-panel/use-node-config-panel-store.d.ts +49 -0
- package/dist/components/flow-editor/node-config-panel/use-node-config-state.d.ts +26 -0
- package/dist/components/flow-editor/node-config-panel/use-run-node.d.ts +16 -0
- package/dist/components/flow-editor/node-config-panel/utils.d.ts +9 -0
- package/dist/components/flow-editor/serialize-to-sdk.d.ts +20 -0
- package/dist/components/flow-editor/toolbar-context.d.ts +2 -0
- package/dist/components/flow-editor/use-copy-paste.d.ts +7 -0
- package/dist/components/flow-editor/use-copy-paste.types.d.ts +38 -0
- package/dist/components/flow-editor/use-flow-editor.d.ts +44 -0
- package/dist/components/flow-runs-table/FlowRunsTable.d.ts +6 -0
- package/dist/components/flow-runs-table/index.d.ts +1 -0
- package/dist/components/flow-viewer/FlowRunsView.d.ts +7 -0
- package/dist/components/flow-viewer/FlowStatusView.d.ts +21 -0
- package/dist/components/flow-viewer/RunSelector.d.ts +13 -0
- package/dist/components/flow-viewer/RunsSidebar.d.ts +14 -0
- package/dist/components/flow-viewer/agent-tool-executions-list.d.ts +7 -0
- package/dist/components/flow-viewer/index.d.ts +1 -0
- package/dist/components/flow-viewer/logs-panel.d.ts +18 -0
- package/dist/components/flow-viewer/use-execution-log-data.d.ts +113 -0
- package/dist/components/graph/BatchFlowEdge.d.ts +33 -0
- package/dist/components/graph/LayoutSelector.d.ts +9 -0
- package/dist/components/graph/index.d.ts +47 -0
- package/dist/components/graph/styleUtils.d.ts +124 -0
- package/dist/components/nodes/AgentConfigPanel.d.ts +24 -0
- package/dist/components/nodes/AgentNode.d.ts +8 -0
- package/dist/components/nodes/AgentToolsBox.d.ts +41 -0
- package/dist/components/nodes/NodeAppendix.d.ts +19 -0
- package/dist/components/nodes/NodeStatusIndicator.d.ts +30 -0
- package/dist/components/nodes/NodeViewContext.d.ts +18 -0
- package/dist/components/nodes/ToolParamField.d.ts +28 -0
- package/dist/components/nodes/ToolSelectorModal.d.ts +80 -0
- package/dist/components/nodes/ToolSelectorParts.d.ts +30 -0
- package/dist/components/nodes/UniversalNode.d.ts +2 -0
- package/dist/components/nodes/createContextAwareNodes.d.ts +6 -0
- package/dist/components/nodes/index.d.ts +22 -0
- package/dist/components/nodes/nodeRegistry.d.ts +13 -0
- package/dist/components/nodes/withNodeContext.d.ts +7 -0
- package/dist/components/shared/InvectLoader.d.ts +8 -0
- package/dist/components/shared/InvectLogo.d.ts +9 -0
- package/dist/components/shared/ProviderIcon.d.ts +23 -0
- package/dist/components/side-menu/side-menu.d.ts +4 -0
- package/dist/components/sidebar/BaseSidebar.d.ts +17 -0
- package/dist/components/sidebar/index.d.ts +1 -0
- package/dist/components/triggers/CronPreview.d.ts +12 -0
- package/dist/components/triggers/index.d.ts +1 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/codemirror-js-editor.d.ts +25 -0
- package/dist/components/ui/codemirror-json-editor.d.ts +18 -0
- package/dist/components/ui/codemirror-nunjucks-editor.d.ts +13 -0
- package/dist/components/ui/codemirror-vscode-theme.d.ts +24 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/empty-state.d.ts +21 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +3 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tree-view.d.ts +107 -0
- package/dist/contexts/AgentToolCallbacksContext.d.ts +23 -0
- package/dist/contexts/ApiContext.d.ts +11 -0
- package/dist/contexts/FlowDataContext.d.ts +9 -0
- package/dist/contexts/NodeRegistryContext.d.ts +14 -0
- package/dist/contexts/PluginRegistryContext.d.ts +39 -0
- package/dist/contexts/ThemeProvider.d.ts +18 -0
- package/dist/contexts/ValidationContext.d.ts +22 -0
- package/dist/demo/DemoInvect.d.ts +11 -0
- package/dist/demo/FlowViewer.d.ts +31 -0
- package/dist/demo/demo-api-client.d.ts +33 -0
- package/dist/demo/index.d.ts +6 -0
- package/dist/demo/sample-data.d.ts +1538 -0
- package/dist/demo.d.ts +2 -0
- package/dist/demo.js +2774 -0
- package/dist/estree-ClbRfS-1.js +7076 -0
- package/dist/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/geist-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/iosevka-latin-400-normal.woff2 +0 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-document-title.d.ts +1 -0
- package/dist/hooks/use-flow-data.d.ts +22 -0
- package/dist/hooks/use-invect-portal-class.d.ts +21 -0
- package/dist/hooks/useFlowEditorStore.d.ts +1 -0
- package/dist/index.css +3 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +717 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/prettier.d.ts +13 -0
- package/dist/routes/all-flow-runs.d.ts +5 -0
- package/dist/routes/credentials.d.ts +5 -0
- package/dist/routes/flow-route-layout.d.ts +19 -0
- package/dist/routes/flow-runs.d.ts +5 -0
- package/dist/routes/flow.d.ts +5 -0
- package/dist/routes/home.d.ts +5 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/standalone-C3Df7W52.js +3463 -0
- package/dist/stores/executionViewStore.d.ts +64 -0
- package/dist/stores/flow-editor.store.d.ts +137 -0
- package/dist/stores/flowEditorStore.d.ts +1 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/uiStore.d.ts +45 -0
- package/dist/types/agent-tools.types.d.ts +53 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/node-definition.types.d.ts +85 -0
- package/dist/types/plugin.types.d.ts +100 -0
- package/dist/utils/credentialBranding.d.ts +8 -0
- package/dist/utils/credentialFiltering.d.ts +20 -0
- package/dist/utils/flowTransformations.d.ts +16 -0
- package/dist/utils/layoutUtils.d.ts +23 -0
- package/dist/utils/nodeReferenceUtils.d.ts +37 -0
- package/dist/vendor.d.ts +5 -0
- package/package.json +130 -0
- package/src/.DS_Store +0 -0
- package/src/Invect.tsx +229 -0
- package/src/InvectShell.tsx +55 -0
- package/src/api/agent-tools.api.ts +23 -0
- package/src/api/client.ts +899 -0
- package/src/api/credentials.api.ts +197 -0
- package/src/api/executions.api.ts +228 -0
- package/src/api/flows.api.ts +195 -0
- package/src/api/index.ts +17 -0
- package/src/api/node-data.api.ts +167 -0
- package/src/api/query-keys.ts +44 -0
- package/src/api/triggers.api.ts +120 -0
- package/src/api/types.ts +212 -0
- package/src/api/use-flow-run-stream.ts +206 -0
- package/src/app.css +560 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/favicon.ico +0 -0
- package/src/assets/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
- package/src/assets/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
- package/src/assets/fonts/geist-latin-wght-normal.woff2 +0 -0
- package/src/assets/fonts/iosevka-latin-400-normal.woff2 +0 -0
- package/src/assets/invect-branding.ts +51 -0
- package/src/assets/provider-icons/anthropic.svg +1 -0
- package/src/assets/provider-icons/anthropic_light.svg +1 -0
- package/src/assets/provider-icons/github.svg +1 -0
- package/src/assets/provider-icons/github_light.svg +1 -0
- package/src/assets/provider-icons/gmail.svg +1 -0
- package/src/assets/provider-icons/google_calendar.svg +1 -0
- package/src/assets/provider-icons/google_docs.svg +1 -0
- package/src/assets/provider-icons/google_drive.svg +1 -0
- package/src/assets/provider-icons/google_sheets.svg +1 -0
- package/src/assets/provider-icons/index.ts +55 -0
- package/src/assets/provider-icons/linear.svg +1 -0
- package/src/assets/provider-icons/openai.svg +1 -0
- package/src/assets/provider-icons/postgres.svg +1 -0
- package/src/assets/provider-icons/slack.svg +1 -0
- package/src/assets/small-loader-dark.svg +22 -0
- package/src/assets/small-loader-light.svg +22 -0
- package/src/assets/small.svg +7 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/PageLayout.tsx +55 -0
- package/src/components/chat/ChatInput.tsx +115 -0
- package/src/components/chat/ChatMessageList.tsx +788 -0
- package/src/components/chat/ChatModelSelector.tsx +208 -0
- package/src/components/chat/ChatPanel.tsx +243 -0
- package/src/components/chat/ChatPromptOverlay.tsx +150 -0
- package/src/components/chat/ChatProviderSelector.tsx +135 -0
- package/src/components/chat/ChatSettingsPanel.tsx +277 -0
- package/src/components/chat/InlineCredentialSetup.tsx +343 -0
- package/src/components/chat/MarkdownRenderer.tsx +140 -0
- package/src/components/chat/chat-memory.ts +88 -0
- package/src/components/chat/chat.store.ts +479 -0
- package/src/components/chat/index.ts +5 -0
- package/src/components/chat/use-chat.ts +473 -0
- package/src/components/credentials/CreateCredentialModal.tsx +609 -0
- package/src/components/credentials/CredentialDetailDialog.tsx +882 -0
- package/src/components/credentials/EditCredentialModal.tsx +399 -0
- package/src/components/credentials/OAuth2ConnectButton.tsx +288 -0
- package/src/components/credentials/OAuth2ProviderSelector.tsx +360 -0
- package/src/components/credentials/credential-utils.ts +99 -0
- package/src/components/credentials/index.ts +10 -0
- package/src/components/dashboard/FailedRunsAlert.tsx +67 -0
- package/src/components/dashboard/FlowCard.tsx +64 -0
- package/src/components/dashboard/RecentActivityTable.tsx +92 -0
- package/src/components/dashboard/StatCard.tsx +32 -0
- package/src/components/dashboard/index.ts +5 -0
- package/src/components/dashboard/status-helpers.tsx +102 -0
- package/src/components/flow-editor/ActionsSidebar.tsx +503 -0
- package/src/components/flow-editor/FlowEditor.tsx +1002 -0
- package/src/components/flow-editor/FlowHeader.tsx +87 -0
- package/src/components/flow-editor/FlowLayout.tsx +117 -0
- package/src/components/flow-editor/ModeSwitcher.tsx +49 -0
- package/src/components/flow-editor/NodeSidebar.tsx +343 -0
- package/src/components/flow-editor/RunControls.tsx +109 -0
- package/src/components/flow-editor/ToolConfigPanel.tsx +434 -0
- package/src/components/flow-editor/ValidationPanel.tsx +167 -0
- package/src/components/flow-editor/flow-editor.store.ts +2 -0
- package/src/components/flow-editor/index.ts +6 -0
- package/src/components/flow-editor/inline-edit.tsx +111 -0
- package/src/components/flow-editor/node-config-panel/ConfigFieldWithTemplate.tsx +334 -0
- package/src/components/flow-editor/node-config-panel/CredentialCombobox.tsx +217 -0
- package/src/components/flow-editor/node-config-panel/CredentialsSection.tsx +154 -0
- package/src/components/flow-editor/node-config-panel/DroppableInput.tsx +45 -0
- package/src/components/flow-editor/node-config-panel/DynamicSelectField.tsx +223 -0
- package/src/components/flow-editor/node-config-panel/JsonPreviewPanel.tsx +134 -0
- package/src/components/flow-editor/node-config-panel/NodeConfigPanel.tsx +650 -0
- package/src/components/flow-editor/node-config-panel/NodeConfigPanelHeader.tsx +91 -0
- package/src/components/flow-editor/node-config-panel/ParametersSection.tsx +144 -0
- package/src/components/flow-editor/node-config-panel/SearchableSelectField.tsx +126 -0
- package/src/components/flow-editor/node-config-panel/SwitchCasesField.tsx +212 -0
- package/src/components/flow-editor/node-config-panel/hooks/index.ts +2 -0
- package/src/components/flow-editor/node-config-panel/hooks/use-node-config-panel-state.ts +284 -0
- package/src/components/flow-editor/node-config-panel/hooks/use-node-execution.ts +287 -0
- package/src/components/flow-editor/node-config-panel/hooks/use-upstream-slots.ts +310 -0
- package/src/components/flow-editor/node-config-panel/panels/AgentToolsPanel.tsx +837 -0
- package/src/components/flow-editor/node-config-panel/panels/ConfigurationPanel.tsx +383 -0
- package/src/components/flow-editor/node-config-panel/panels/DataMapperPane.tsx +456 -0
- package/src/components/flow-editor/node-config-panel/panels/InputPanel.tsx +338 -0
- package/src/components/flow-editor/node-config-panel/panels/OutputPanel.tsx +109 -0
- package/src/components/flow-editor/node-config-panel/panels/index.ts +4 -0
- package/src/components/flow-editor/node-config-panel/types.ts +20 -0
- package/src/components/flow-editor/node-config-panel/use-node-config-panel-store.ts +283 -0
- package/src/components/flow-editor/node-config-panel/use-node-config-state.ts +172 -0
- package/src/components/flow-editor/node-config-panel/use-run-node.ts +147 -0
- package/src/components/flow-editor/node-config-panel/utils.ts +73 -0
- package/src/components/flow-editor/serialize-to-sdk.ts +204 -0
- package/src/components/flow-editor/toolbar-context.ts +9 -0
- package/src/components/flow-editor/use-copy-paste.ts +575 -0
- package/src/components/flow-editor/use-copy-paste.types.ts +35 -0
- package/src/components/flow-editor/use-flow-editor.ts +241 -0
- package/src/components/flow-runs-table/FlowRunsTable.tsx +631 -0
- package/src/components/flow-runs-table/index.ts +1 -0
- package/src/components/flow-viewer/FlowRunsView.tsx +268 -0
- package/src/components/flow-viewer/FlowStatusView.tsx +351 -0
- package/src/components/flow-viewer/RunSelector.tsx +422 -0
- package/src/components/flow-viewer/RunsSidebar.tsx +125 -0
- package/src/components/flow-viewer/agent-tool-executions-list.tsx +298 -0
- package/src/components/flow-viewer/index.ts +1 -0
- package/src/components/flow-viewer/logs-panel.tsx +567 -0
- package/src/components/flow-viewer/use-execution-log-data.ts +374 -0
- package/src/components/graph/BatchFlowEdge.tsx +229 -0
- package/src/components/graph/LayoutSelector.tsx +42 -0
- package/src/components/graph/index.ts +61 -0
- package/src/components/graph/styleUtils.ts +375 -0
- package/src/components/nodes/.DS_Store +0 -0
- package/src/components/nodes/AgentConfigPanel.tsx +1033 -0
- package/src/components/nodes/AgentNode.tsx +298 -0
- package/src/components/nodes/AgentToolsBox.tsx +193 -0
- package/src/components/nodes/NodeAppendix.tsx +98 -0
- package/src/components/nodes/NodeStatusIndicator.tsx +74 -0
- package/src/components/nodes/NodeViewContext.tsx +45 -0
- package/src/components/nodes/ToolParamField.tsx +282 -0
- package/src/components/nodes/ToolSelectorModal.tsx +648 -0
- package/src/components/nodes/ToolSelectorParts.tsx +505 -0
- package/src/components/nodes/UniversalNode.tsx +356 -0
- package/src/components/nodes/createContextAwareNodes.ts +19 -0
- package/src/components/nodes/index.ts +45 -0
- package/src/components/nodes/nodeRegistry.ts +50 -0
- package/src/components/nodes/withNodeContext.tsx +55 -0
- package/src/components/shared/InvectLoader.tsx +59 -0
- package/src/components/shared/InvectLogo.tsx +59 -0
- package/src/components/shared/ProviderIcon.tsx +115 -0
- package/src/components/side-menu/side-menu.tsx +267 -0
- package/src/components/sidebar/BaseSidebar.tsx +148 -0
- package/src/components/sidebar/index.ts +1 -0
- package/src/components/triggers/CronPreview.tsx +243 -0
- package/src/components/triggers/index.ts +1 -0
- package/src/components/ui/alert-dialog.tsx +152 -0
- package/src/components/ui/badge.tsx +39 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/card.tsx +75 -0
- package/src/components/ui/codemirror-js-editor.tsx +432 -0
- package/src/components/ui/codemirror-json-editor.tsx +816 -0
- package/src/components/ui/codemirror-nunjucks-editor.tsx +451 -0
- package/src/components/ui/codemirror-vscode-theme.ts +243 -0
- package/src/components/ui/collapsible.tsx +12 -0
- package/src/components/ui/command.tsx +162 -0
- package/src/components/ui/dialog.tsx +140 -0
- package/src/components/ui/dropdown-menu.tsx +232 -0
- package/src/components/ui/empty-state.tsx +93 -0
- package/src/components/ui/input.tsx +26 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/popover.tsx +53 -0
- package/src/components/ui/resizable.tsx +61 -0
- package/src/components/ui/scroll-area.tsx +56 -0
- package/src/components/ui/select.tsx +179 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/slider.tsx +58 -0
- package/src/components/ui/switch.tsx +22 -0
- package/src/components/ui/table.tsx +90 -0
- package/src/components/ui/textarea.tsx +23 -0
- package/src/components/ui/tooltip.tsx +54 -0
- package/src/components/ui/tree-view.tsx +574 -0
- package/src/contexts/AgentToolCallbacksContext.tsx +31 -0
- package/src/contexts/ApiContext.tsx +51 -0
- package/src/contexts/FlowDataContext.tsx +21 -0
- package/src/contexts/NodeRegistryContext.tsx +54 -0
- package/src/contexts/PluginRegistryContext.tsx +182 -0
- package/src/contexts/ThemeProvider.tsx +106 -0
- package/src/contexts/ValidationContext.tsx +122 -0
- package/src/demo/DemoInvect.tsx +42 -0
- package/src/demo/FlowViewer.tsx +294 -0
- package/src/demo/demo-api-client.ts +246 -0
- package/src/demo/index.ts +28 -0
- package/src/demo/sample-data.ts +1980 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-document-title.ts +8 -0
- package/src/hooks/use-flow-data.ts +144 -0
- package/src/hooks/use-invect-portal-class.ts +27 -0
- package/src/hooks/useFlowEditorStore.ts +2 -0
- package/src/index.ts +70 -0
- package/src/lib/utils.ts +6 -0
- package/src/prettier.d.ts +13 -0
- package/src/routes/all-flow-runs.tsx +27 -0
- package/src/routes/credentials.tsx +362 -0
- package/src/routes/flow-route-layout.tsx +113 -0
- package/src/routes/flow-runs.tsx +22 -0
- package/src/routes/flow.tsx +22 -0
- package/src/routes/home.tsx +282 -0
- package/src/services/index.ts +6 -0
- package/src/stores/executionViewStore.ts +211 -0
- package/src/stores/flow-editor.store.ts +738 -0
- package/src/stores/flowEditorStore.ts +2 -0
- package/src/stores/index.ts +10 -0
- package/src/stores/uiStore.ts +189 -0
- package/src/types/agent-tools.types.ts +64 -0
- package/src/types/index.ts +5 -0
- package/src/types/node-definition.types.ts +104 -0
- package/src/types/plugin.types.ts +123 -0
- package/src/utils/credentialBranding.ts +116 -0
- package/src/utils/credentialFiltering.ts +68 -0
- package/src/utils/flowTransformations.ts +137 -0
- package/src/utils/layoutUtils.ts +127 -0
- package/src/utils/nodeReferenceUtils.ts +135 -0
- package/src/vendor.d.ts +7 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React, { useMemo, useCallback, createContext, useContext } from 'react';
|
|
2
|
+
import { Outlet, useParams, useLocation } from 'react-router';
|
|
3
|
+
import { FlowHeader } from '../components/flow-editor/FlowHeader';
|
|
4
|
+
import { useFlowEditor } from '../components/flow-editor/use-flow-editor';
|
|
5
|
+
import { useUpdateFlow } from '../api/flows.api';
|
|
6
|
+
import { ReactFlowProvider } from '@xyflow/react';
|
|
7
|
+
import { useFlowEditorStore } from '../components/flow-editor/flow-editor.store';
|
|
8
|
+
|
|
9
|
+
interface FlowRouteLayoutProps {
|
|
10
|
+
basePath?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Options for save operation
|
|
14
|
+
interface SaveOptions {
|
|
15
|
+
skipSuccessToast?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Context for flow actions
|
|
19
|
+
interface FlowActionsContextType {
|
|
20
|
+
// Always available
|
|
21
|
+
onExecute: () => Promise<void>;
|
|
22
|
+
isExecuting: boolean;
|
|
23
|
+
isActive?: boolean;
|
|
24
|
+
isTogglingActive: boolean;
|
|
25
|
+
onToggleActive?: () => void;
|
|
26
|
+
// Edit-only
|
|
27
|
+
isDirty?: boolean;
|
|
28
|
+
onSave?: (options?: SaveOptions) => Promise<boolean>;
|
|
29
|
+
isSaving?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const FlowActionsContext = createContext<FlowActionsContextType | null>(null);
|
|
33
|
+
|
|
34
|
+
export function useFlowActions() {
|
|
35
|
+
return useContext(FlowActionsContext);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function FlowRouteLayout({ basePath = '' }: FlowRouteLayoutProps) {
|
|
39
|
+
const { flowId, version } = useParams();
|
|
40
|
+
const location = useLocation();
|
|
41
|
+
|
|
42
|
+
// Only provide context in edit view (when path ends with flow ID or version)
|
|
43
|
+
const isEditView = location.pathname.includes('/flow/') && !location.pathname.includes('/runs');
|
|
44
|
+
|
|
45
|
+
// Use the new Zustand-based hook
|
|
46
|
+
const { flowName, isDirty, isActive, save, execute, isSaving, isExecuting } = useFlowEditor({
|
|
47
|
+
flowId: flowId ?? '',
|
|
48
|
+
version,
|
|
49
|
+
basePath,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Toggle flow active state
|
|
53
|
+
const updateFlowMutation = useUpdateFlow();
|
|
54
|
+
const handleToggleActive = useCallback(() => {
|
|
55
|
+
if (!flowId || isActive === undefined) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
updateFlowMutation.mutate({ id: flowId, data: { isActive: !isActive } });
|
|
59
|
+
}, [flowId, isActive, updateFlowMutation]);
|
|
60
|
+
|
|
61
|
+
// Get setFlowName from store for header updates
|
|
62
|
+
const setFlowName = useFlowEditorStore((s) => s.setFlowName);
|
|
63
|
+
|
|
64
|
+
// Context value — always provided for Run + Active/Inactive; save fields only in edit view
|
|
65
|
+
const flowActionsValue = useMemo<FlowActionsContextType>(
|
|
66
|
+
() => ({
|
|
67
|
+
onExecute: execute,
|
|
68
|
+
isExecuting,
|
|
69
|
+
isActive,
|
|
70
|
+
isTogglingActive: updateFlowMutation.isPending,
|
|
71
|
+
onToggleActive: handleToggleActive,
|
|
72
|
+
...(isEditView
|
|
73
|
+
? {
|
|
74
|
+
isDirty,
|
|
75
|
+
onSave: save,
|
|
76
|
+
isSaving,
|
|
77
|
+
}
|
|
78
|
+
: {}),
|
|
79
|
+
}),
|
|
80
|
+
[
|
|
81
|
+
isEditView,
|
|
82
|
+
isDirty,
|
|
83
|
+
save,
|
|
84
|
+
execute,
|
|
85
|
+
isSaving,
|
|
86
|
+
isExecuting,
|
|
87
|
+
isActive,
|
|
88
|
+
updateFlowMutation.isPending,
|
|
89
|
+
handleToggleActive,
|
|
90
|
+
],
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<ReactFlowProvider>
|
|
95
|
+
<FlowActionsContext.Provider value={flowActionsValue}>
|
|
96
|
+
<div className="imp-page flex flex-col flex-1 min-h-0 bg-imp-background">
|
|
97
|
+
<FlowHeader
|
|
98
|
+
flowName={flowName}
|
|
99
|
+
onFlowNameChange={setFlowName}
|
|
100
|
+
isDirty={flowActionsValue?.isDirty}
|
|
101
|
+
onSave={flowActionsValue?.onSave}
|
|
102
|
+
isSaving={flowActionsValue?.isSaving}
|
|
103
|
+
/>
|
|
104
|
+
<div className="imp-page flex-1 min-h-0 bg-imp-background">
|
|
105
|
+
<Outlet />
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</FlowActionsContext.Provider>
|
|
109
|
+
</ReactFlowProvider>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export default FlowRouteLayout;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FlowRunsView } from '../components/flow-viewer/FlowRunsView';
|
|
2
|
+
import { useParams } from 'react-router';
|
|
3
|
+
import { useDocumentTitle } from '../hooks/use-document-title';
|
|
4
|
+
|
|
5
|
+
interface FlowRunsProps {
|
|
6
|
+
basePath?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const FlowRuns = ({ basePath = '' }: FlowRunsProps) => {
|
|
10
|
+
useDocumentTitle('runs');
|
|
11
|
+
const { flowId, version } = useParams();
|
|
12
|
+
|
|
13
|
+
if (!flowId) {
|
|
14
|
+
return (
|
|
15
|
+
<div className="flex items-center justify-center w-full h-full">
|
|
16
|
+
<div className="text-muted-foreground">No flow ID provided</div>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <FlowRunsView flowId={flowId} flowVersion={version} basePath={basePath} />;
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FlowEditor } from '../components/flow-editor/FlowEditor';
|
|
2
|
+
import { useParams } from 'react-router';
|
|
3
|
+
import { useDocumentTitle } from '../hooks/use-document-title';
|
|
4
|
+
|
|
5
|
+
interface FlowProps {
|
|
6
|
+
basePath?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Flow = ({ basePath = '' }: FlowProps) => {
|
|
10
|
+
useDocumentTitle('edit');
|
|
11
|
+
const { flowId, version } = useParams();
|
|
12
|
+
|
|
13
|
+
if (!flowId) {
|
|
14
|
+
return (
|
|
15
|
+
<div className="flex items-center justify-center w-full h-full">
|
|
16
|
+
<div className="text-muted-foreground">No flow ID provided</div>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <FlowEditor flowId={flowId} flowVersion={version} basePath={basePath} />;
|
|
22
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { Link, useNavigate } from 'react-router';
|
|
2
|
+
import {
|
|
3
|
+
Plus,
|
|
4
|
+
Loader2,
|
|
5
|
+
Activity,
|
|
6
|
+
TrendingUp,
|
|
7
|
+
Zap,
|
|
8
|
+
ArrowRight,
|
|
9
|
+
BarChart3,
|
|
10
|
+
Key,
|
|
11
|
+
History,
|
|
12
|
+
Search,
|
|
13
|
+
} from 'lucide-react';
|
|
14
|
+
import { useState, useMemo } from 'react';
|
|
15
|
+
import { PageLayout } from '../components/PageLayout';
|
|
16
|
+
import { useDocumentTitle } from '../hooks/use-document-title';
|
|
17
|
+
import { useFlows, useDashboardStats, useCreateFlow } from '../api/flows.api';
|
|
18
|
+
import { Button } from '../components/ui/button';
|
|
19
|
+
import { Card, CardContent } from '../components/ui/card';
|
|
20
|
+
import { StatCard } from '../components/dashboard/StatCard';
|
|
21
|
+
import { FlowCard } from '../components/dashboard/FlowCard';
|
|
22
|
+
import { RecentActivityTable } from '../components/dashboard/RecentActivityTable';
|
|
23
|
+
import { FailedRunsAlert } from '../components/dashboard/FailedRunsAlert';
|
|
24
|
+
|
|
25
|
+
// ─── Main Home Page ─────────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
interface HomeProps {
|
|
28
|
+
basePath?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Home = ({ basePath = '' }: HomeProps) => {
|
|
32
|
+
useDocumentTitle('dashboard');
|
|
33
|
+
const navigate = useNavigate();
|
|
34
|
+
const { data: statsData, isLoading: statsLoading } = useDashboardStats();
|
|
35
|
+
const { data: flowsResponse, isLoading: flowsLoading, error } = useFlows();
|
|
36
|
+
const flows = flowsResponse?.data ?? [];
|
|
37
|
+
const createFlowMutation = useCreateFlow();
|
|
38
|
+
const [flowSearch, setFlowSearch] = useState('');
|
|
39
|
+
const [flowPage, setFlowPage] = useState(1);
|
|
40
|
+
const FLOWS_PAGE_SIZE = 8;
|
|
41
|
+
|
|
42
|
+
const filteredFlows = useMemo(() => {
|
|
43
|
+
if (!flowSearch.trim()) {
|
|
44
|
+
return flows;
|
|
45
|
+
}
|
|
46
|
+
const q = flowSearch.toLowerCase();
|
|
47
|
+
return flows.filter((f) => f.name.toLowerCase().includes(q));
|
|
48
|
+
}, [flows, flowSearch]);
|
|
49
|
+
|
|
50
|
+
const totalFlowPages = Math.max(1, Math.ceil(filteredFlows.length / FLOWS_PAGE_SIZE));
|
|
51
|
+
const paginatedFlows = filteredFlows.slice(
|
|
52
|
+
(flowPage - 1) * FLOWS_PAGE_SIZE,
|
|
53
|
+
flowPage * FLOWS_PAGE_SIZE,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const recentRuns = statsData?.recentRuns ?? [];
|
|
57
|
+
|
|
58
|
+
const handleCreateFlow = () => {
|
|
59
|
+
createFlowMutation.mutate(
|
|
60
|
+
{ name: 'Untitled Flow', tags: [], isActive: true },
|
|
61
|
+
{ onSuccess: (data) => navigate(`${basePath}/flow/${data.id}`) },
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<PageLayout
|
|
67
|
+
title="Dashboard"
|
|
68
|
+
subtitle="Overview of your workflow activity"
|
|
69
|
+
actions={
|
|
70
|
+
<>
|
|
71
|
+
<Button variant="outline" size="sm" asChild>
|
|
72
|
+
<Link to={`${basePath}/credentials`}>
|
|
73
|
+
<Key className="h-3.5 w-3.5 mr-1.5" />
|
|
74
|
+
Credentials
|
|
75
|
+
</Link>
|
|
76
|
+
</Button>
|
|
77
|
+
<Button variant="outline" size="sm" asChild>
|
|
78
|
+
<Link to={`${basePath}/flow-runs`}>
|
|
79
|
+
<History className="h-3.5 w-3.5 mr-1.5" />
|
|
80
|
+
Flow Runs
|
|
81
|
+
</Link>
|
|
82
|
+
</Button>
|
|
83
|
+
<Button size="sm" onClick={handleCreateFlow} disabled={createFlowMutation.isPending}>
|
|
84
|
+
{createFlowMutation.isPending ? (
|
|
85
|
+
<Loader2 className="h-3.5 w-3.5 mr-1.5 animate-spin" />
|
|
86
|
+
) : (
|
|
87
|
+
<Plus className="h-3.5 w-3.5 mr-1.5" />
|
|
88
|
+
)}
|
|
89
|
+
New Flow
|
|
90
|
+
</Button>
|
|
91
|
+
</>
|
|
92
|
+
}
|
|
93
|
+
>
|
|
94
|
+
{/* ── Stats Row ───────────────────────────────────────── */}
|
|
95
|
+
<div className="grid grid-cols-2 gap-4 lg:grid-cols-4">
|
|
96
|
+
<StatCard
|
|
97
|
+
title="Total Flows"
|
|
98
|
+
value={statsLoading ? '—' : (statsData?.totalFlows ?? 0)}
|
|
99
|
+
subtitle={
|
|
100
|
+
!statsLoading && flows.length > 0
|
|
101
|
+
? `${flows.filter((f) => f.isActive).length} active`
|
|
102
|
+
: undefined
|
|
103
|
+
}
|
|
104
|
+
icon={BarChart3}
|
|
105
|
+
/>
|
|
106
|
+
<StatCard
|
|
107
|
+
title="Runs (24h)"
|
|
108
|
+
value={statsLoading ? '—' : (statsData?.runsLast24h ?? 0)}
|
|
109
|
+
subtitle={!statsLoading ? `${statsData?.totalRuns ?? 0} total all-time` : undefined}
|
|
110
|
+
icon={Activity}
|
|
111
|
+
/>
|
|
112
|
+
<StatCard
|
|
113
|
+
title="Success Rate"
|
|
114
|
+
value={statsLoading ? '—' : `${statsData?.successRate ?? 0}%`}
|
|
115
|
+
subtitle={
|
|
116
|
+
!statsLoading && statsData?.failedRunsLast24h
|
|
117
|
+
? `${statsData.failedRunsLast24h} failed (24h)`
|
|
118
|
+
: !statsLoading
|
|
119
|
+
? 'No failures (24h)'
|
|
120
|
+
: undefined
|
|
121
|
+
}
|
|
122
|
+
icon={TrendingUp}
|
|
123
|
+
/>
|
|
124
|
+
<StatCard
|
|
125
|
+
title="Active Runs"
|
|
126
|
+
value={statsLoading ? '—' : (statsData?.activeRuns ?? 0)}
|
|
127
|
+
subtitle={
|
|
128
|
+
!statsLoading && statsData && statsData.activeRuns > 0
|
|
129
|
+
? 'Currently executing'
|
|
130
|
+
: !statsLoading
|
|
131
|
+
? 'All quiet'
|
|
132
|
+
: undefined
|
|
133
|
+
}
|
|
134
|
+
icon={Zap}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
{/* ── Error State ─────────────────────────────────────── */}
|
|
139
|
+
{error && (
|
|
140
|
+
<Card className="border-destructive/30">
|
|
141
|
+
<CardContent className="py-4">
|
|
142
|
+
<div className="text-sm text-destructive">
|
|
143
|
+
<strong>Error loading data:</strong>{' '}
|
|
144
|
+
{error instanceof Error ? error.message : 'Failed to connect to server'}
|
|
145
|
+
</div>
|
|
146
|
+
</CardContent>
|
|
147
|
+
</Card>
|
|
148
|
+
)}
|
|
149
|
+
|
|
150
|
+
{/* ── Failed Runs Alert ───────────────────────────────── */}
|
|
151
|
+
<FailedRunsAlert basePath={basePath} />
|
|
152
|
+
|
|
153
|
+
{/* ── Main Grid: Flows + Recent Activity ──────────────── */}
|
|
154
|
+
<div className="grid gap-6 lg:grid-cols-5">
|
|
155
|
+
{/* ── Flows List (3/5) ────────────────────────────────── */}
|
|
156
|
+
<div className="space-y-4 lg:col-span-3">
|
|
157
|
+
<div className="flex items-center justify-between gap-2">
|
|
158
|
+
<h2 className="text-base font-semibold shrink-0">
|
|
159
|
+
Flows
|
|
160
|
+
{!flowsLoading && ` (${filteredFlows.length}${flowSearch ? `/${flows.length}` : ''})`}
|
|
161
|
+
</h2>
|
|
162
|
+
<div className="relative">
|
|
163
|
+
<Search className="absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 pointer-events-none text-muted-foreground" />
|
|
164
|
+
<input
|
|
165
|
+
type="text"
|
|
166
|
+
value={flowSearch}
|
|
167
|
+
onChange={(e) => {
|
|
168
|
+
setFlowSearch(e.target.value);
|
|
169
|
+
setFlowPage(1);
|
|
170
|
+
}}
|
|
171
|
+
placeholder="Search flows…"
|
|
172
|
+
className="py-2 pr-3 text-sm bg-transparent border rounded-lg outline-none w-72 border-border pl-9 placeholder:text-muted-foreground focus:border-primary/50"
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
{flowsLoading && (
|
|
178
|
+
<div className="flex items-center justify-center py-12 text-sm text-muted-foreground">
|
|
179
|
+
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
|
|
180
|
+
Loading flows…
|
|
181
|
+
</div>
|
|
182
|
+
)}
|
|
183
|
+
|
|
184
|
+
{!flowsLoading && flows.length === 0 && !error && (
|
|
185
|
+
<Card>
|
|
186
|
+
<CardContent className="flex flex-col items-center justify-center py-12">
|
|
187
|
+
<div className="p-4 mb-4 rounded-full bg-muted">
|
|
188
|
+
<Plus className="w-8 h-8 text-muted-foreground" />
|
|
189
|
+
</div>
|
|
190
|
+
<h3 className="mb-1 text-sm font-medium">No flows yet</h3>
|
|
191
|
+
<p className="max-w-xs mb-4 text-xs text-center text-muted-foreground">
|
|
192
|
+
Create your first workflow to get started with automation.
|
|
193
|
+
</p>
|
|
194
|
+
<Button
|
|
195
|
+
size="sm"
|
|
196
|
+
onClick={handleCreateFlow}
|
|
197
|
+
disabled={createFlowMutation.isPending}
|
|
198
|
+
>
|
|
199
|
+
{createFlowMutation.isPending ? (
|
|
200
|
+
<Loader2 className="h-3.5 w-3.5 mr-1.5 animate-spin" />
|
|
201
|
+
) : (
|
|
202
|
+
<Plus className="h-3.5 w-3.5 mr-1.5" />
|
|
203
|
+
)}
|
|
204
|
+
Create Flow
|
|
205
|
+
</Button>
|
|
206
|
+
</CardContent>
|
|
207
|
+
</Card>
|
|
208
|
+
)}
|
|
209
|
+
|
|
210
|
+
{!flowsLoading && flows.length > 0 && (
|
|
211
|
+
<div className="space-y-2">
|
|
212
|
+
{filteredFlows.length === 0 ? (
|
|
213
|
+
<p className="py-6 text-sm text-center text-muted-foreground">
|
|
214
|
+
No flows match “{flowSearch}”
|
|
215
|
+
</p>
|
|
216
|
+
) : (
|
|
217
|
+
paginatedFlows.map((flow) => (
|
|
218
|
+
<FlowCard key={flow.id} flow={flow} basePath={basePath} />
|
|
219
|
+
))
|
|
220
|
+
)}
|
|
221
|
+
</div>
|
|
222
|
+
)}
|
|
223
|
+
|
|
224
|
+
{/* Flows Pagination */}
|
|
225
|
+
{!flowsLoading && filteredFlows.length > 0 && (
|
|
226
|
+
<div className="flex items-center justify-between text-xs text-muted-foreground">
|
|
227
|
+
<span>
|
|
228
|
+
{filteredFlows.length} flow{filteredFlows.length !== 1 ? 's' : ''}
|
|
229
|
+
{flowSearch ? ` matching “${flowSearch}”` : ''}
|
|
230
|
+
</span>
|
|
231
|
+
<div className="flex items-center gap-2">
|
|
232
|
+
<button
|
|
233
|
+
type="button"
|
|
234
|
+
onClick={() => setFlowPage((p) => Math.max(1, p - 1))}
|
|
235
|
+
disabled={flowPage === 1}
|
|
236
|
+
className="rounded-md border border-border px-2.5 py-1 hover:bg-muted disabled:opacity-50"
|
|
237
|
+
>
|
|
238
|
+
Previous
|
|
239
|
+
</button>
|
|
240
|
+
<span>
|
|
241
|
+
{flowPage} / {totalFlowPages}
|
|
242
|
+
</span>
|
|
243
|
+
<button
|
|
244
|
+
type="button"
|
|
245
|
+
onClick={() => setFlowPage((p) => Math.min(totalFlowPages, p + 1))}
|
|
246
|
+
disabled={flowPage === totalFlowPages}
|
|
247
|
+
className="rounded-md border border-border px-2.5 py-1 hover:bg-muted disabled:opacity-50"
|
|
248
|
+
>
|
|
249
|
+
Next
|
|
250
|
+
</button>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
)}
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
{/* ── Recent Activity (2/5) ───────────────────────────── */}
|
|
257
|
+
<div className="space-y-4 lg:col-span-2">
|
|
258
|
+
<div className="flex items-center justify-between">
|
|
259
|
+
<h2 className="text-base font-semibold">Recent Activity</h2>
|
|
260
|
+
<Button variant="ghost" size="sm" className="text-xs" asChild>
|
|
261
|
+
<Link to={`${basePath}/flow-runs`}>
|
|
262
|
+
View all
|
|
263
|
+
<ArrowRight className="w-3 h-3 ml-1" />
|
|
264
|
+
</Link>
|
|
265
|
+
</Button>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<Card className="gap-0 py-0">
|
|
269
|
+
<CardContent className="p-0">
|
|
270
|
+
<RecentActivityTable
|
|
271
|
+
runs={recentRuns}
|
|
272
|
+
flows={flows}
|
|
273
|
+
basePath={basePath}
|
|
274
|
+
isLoading={statsLoading}
|
|
275
|
+
/>
|
|
276
|
+
</CardContent>
|
|
277
|
+
</Card>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</PageLayout>
|
|
281
|
+
);
|
|
282
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { create, type StoreApi, type UseBoundStore } from 'zustand';
|
|
2
|
+
import { devtools, subscribeWithSelector } from 'zustand/middleware';
|
|
3
|
+
import { immer } from 'zustand/middleware/immer';
|
|
4
|
+
import type { FlowRunStatus } from '@invect/core/types';
|
|
5
|
+
|
|
6
|
+
interface ExecutionViewState {
|
|
7
|
+
// Currently viewed execution
|
|
8
|
+
activeFlowRunId: string | null;
|
|
9
|
+
activeFlowId: string | null;
|
|
10
|
+
|
|
11
|
+
// Selected node in execution view (for viewing outputs)
|
|
12
|
+
selectedExecutionNodeId: string | null;
|
|
13
|
+
|
|
14
|
+
// Execution list filters
|
|
15
|
+
statusFilter: FlowRunStatus | 'all';
|
|
16
|
+
flowIdFilter: string | null;
|
|
17
|
+
|
|
18
|
+
// Pagination
|
|
19
|
+
page: number;
|
|
20
|
+
limit: number;
|
|
21
|
+
|
|
22
|
+
// Sorting
|
|
23
|
+
sortBy: 'startedAt' | 'endedAt' | 'status';
|
|
24
|
+
sortOrder: 'asc' | 'desc';
|
|
25
|
+
|
|
26
|
+
// Logs panel state
|
|
27
|
+
logsExpanded: boolean;
|
|
28
|
+
selectedLogNodeId: string | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface ExecutionViewActions {
|
|
32
|
+
// Active execution
|
|
33
|
+
setActiveExecution: (flowId: string, flowRunId: string) => void;
|
|
34
|
+
clearActiveExecution: () => void;
|
|
35
|
+
|
|
36
|
+
// Node selection in execution view
|
|
37
|
+
selectExecutionNode: (nodeId: string | null) => void;
|
|
38
|
+
|
|
39
|
+
// Filters
|
|
40
|
+
setStatusFilter: (status: FlowRunStatus | 'all') => void;
|
|
41
|
+
setFlowIdFilter: (flowId: string | null) => void;
|
|
42
|
+
clearFilters: () => void;
|
|
43
|
+
|
|
44
|
+
// Pagination
|
|
45
|
+
setPage: (page: number) => void;
|
|
46
|
+
setLimit: (limit: number) => void;
|
|
47
|
+
|
|
48
|
+
// Sorting
|
|
49
|
+
setSortBy: (sortBy: ExecutionViewState['sortBy']) => void;
|
|
50
|
+
setSortOrder: (sortOrder: ExecutionViewState['sortOrder']) => void;
|
|
51
|
+
|
|
52
|
+
// Logs
|
|
53
|
+
toggleLogsExpanded: () => void;
|
|
54
|
+
setLogsExpanded: (expanded: boolean) => void;
|
|
55
|
+
selectLogNode: (nodeId: string | null) => void;
|
|
56
|
+
|
|
57
|
+
// Reset
|
|
58
|
+
reset: () => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type ExecutionViewStore = ExecutionViewState & ExecutionViewActions;
|
|
62
|
+
|
|
63
|
+
const initialState: ExecutionViewState = {
|
|
64
|
+
activeFlowRunId: null,
|
|
65
|
+
activeFlowId: null,
|
|
66
|
+
selectedExecutionNodeId: null,
|
|
67
|
+
statusFilter: 'all',
|
|
68
|
+
flowIdFilter: null,
|
|
69
|
+
page: 1,
|
|
70
|
+
limit: 20,
|
|
71
|
+
sortBy: 'startedAt',
|
|
72
|
+
sortOrder: 'desc',
|
|
73
|
+
logsExpanded: false,
|
|
74
|
+
selectedLogNodeId: null,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const useExecutionViewStore: UseBoundStore<StoreApi<ExecutionViewStore>> =
|
|
78
|
+
create<ExecutionViewStore>()(
|
|
79
|
+
devtools(
|
|
80
|
+
subscribeWithSelector(
|
|
81
|
+
immer((set) => ({
|
|
82
|
+
...initialState,
|
|
83
|
+
|
|
84
|
+
// Active execution
|
|
85
|
+
setActiveExecution: (flowId, flowRunId) =>
|
|
86
|
+
set((state) => {
|
|
87
|
+
state.activeFlowId = flowId;
|
|
88
|
+
state.activeFlowRunId = flowRunId;
|
|
89
|
+
state.selectedExecutionNodeId = null;
|
|
90
|
+
state.selectedLogNodeId = null;
|
|
91
|
+
}),
|
|
92
|
+
|
|
93
|
+
clearActiveExecution: () =>
|
|
94
|
+
set((state) => {
|
|
95
|
+
state.activeFlowId = null;
|
|
96
|
+
state.activeFlowRunId = null;
|
|
97
|
+
state.selectedExecutionNodeId = null;
|
|
98
|
+
state.selectedLogNodeId = null;
|
|
99
|
+
}),
|
|
100
|
+
|
|
101
|
+
// Node selection
|
|
102
|
+
selectExecutionNode: (nodeId) =>
|
|
103
|
+
set((state) => {
|
|
104
|
+
state.selectedExecutionNodeId = nodeId;
|
|
105
|
+
}),
|
|
106
|
+
|
|
107
|
+
// Filters
|
|
108
|
+
setStatusFilter: (status) =>
|
|
109
|
+
set((state) => {
|
|
110
|
+
state.statusFilter = status;
|
|
111
|
+
state.page = 1; // Reset to first page when filter changes
|
|
112
|
+
}),
|
|
113
|
+
|
|
114
|
+
setFlowIdFilter: (flowId) =>
|
|
115
|
+
set((state) => {
|
|
116
|
+
state.flowIdFilter = flowId;
|
|
117
|
+
state.page = 1;
|
|
118
|
+
}),
|
|
119
|
+
|
|
120
|
+
clearFilters: () =>
|
|
121
|
+
set((state) => {
|
|
122
|
+
state.statusFilter = 'all';
|
|
123
|
+
state.flowIdFilter = null;
|
|
124
|
+
state.page = 1;
|
|
125
|
+
}),
|
|
126
|
+
|
|
127
|
+
// Pagination
|
|
128
|
+
setPage: (page) =>
|
|
129
|
+
set((state) => {
|
|
130
|
+
state.page = page;
|
|
131
|
+
}),
|
|
132
|
+
|
|
133
|
+
setLimit: (limit) =>
|
|
134
|
+
set((state) => {
|
|
135
|
+
state.limit = limit;
|
|
136
|
+
state.page = 1; // Reset to first page when limit changes
|
|
137
|
+
}),
|
|
138
|
+
|
|
139
|
+
// Sorting
|
|
140
|
+
setSortBy: (sortBy) =>
|
|
141
|
+
set((state) => {
|
|
142
|
+
state.sortBy = sortBy;
|
|
143
|
+
}),
|
|
144
|
+
|
|
145
|
+
setSortOrder: (sortOrder) =>
|
|
146
|
+
set((state) => {
|
|
147
|
+
state.sortOrder = sortOrder;
|
|
148
|
+
}),
|
|
149
|
+
|
|
150
|
+
// Logs
|
|
151
|
+
toggleLogsExpanded: () =>
|
|
152
|
+
set((state) => {
|
|
153
|
+
state.logsExpanded = !state.logsExpanded;
|
|
154
|
+
}),
|
|
155
|
+
|
|
156
|
+
setLogsExpanded: (expanded) =>
|
|
157
|
+
set((state) => {
|
|
158
|
+
state.logsExpanded = expanded;
|
|
159
|
+
}),
|
|
160
|
+
|
|
161
|
+
selectLogNode: (nodeId) =>
|
|
162
|
+
set((state) => {
|
|
163
|
+
state.selectedLogNodeId = nodeId;
|
|
164
|
+
}),
|
|
165
|
+
|
|
166
|
+
// Reset
|
|
167
|
+
reset: () => set(() => ({ ...initialState })),
|
|
168
|
+
})),
|
|
169
|
+
),
|
|
170
|
+
{ name: 'execution-view' },
|
|
171
|
+
),
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
// Selector hooks
|
|
175
|
+
export const useActiveFlowRunId = () => useExecutionViewStore((s) => s.activeFlowRunId);
|
|
176
|
+
export const useActiveFlowId = () => useExecutionViewStore((s) => s.activeFlowId);
|
|
177
|
+
export const useSelectedExecutionNodeId = () =>
|
|
178
|
+
useExecutionViewStore((s) => s.selectedExecutionNodeId);
|
|
179
|
+
export const useStatusFilter = () => useExecutionViewStore((s) => s.statusFilter);
|
|
180
|
+
export const useExecutionPagination = () =>
|
|
181
|
+
useExecutionViewStore((s) => ({
|
|
182
|
+
page: s.page,
|
|
183
|
+
limit: s.limit,
|
|
184
|
+
setPage: s.setPage,
|
|
185
|
+
setLimit: s.setLimit,
|
|
186
|
+
}));
|
|
187
|
+
export const useExecutionSorting = () =>
|
|
188
|
+
useExecutionViewStore((s) => ({
|
|
189
|
+
sortBy: s.sortBy,
|
|
190
|
+
sortOrder: s.sortOrder,
|
|
191
|
+
setSortBy: s.setSortBy,
|
|
192
|
+
setSortOrder: s.setSortOrder,
|
|
193
|
+
}));
|
|
194
|
+
export const useLogsState = () =>
|
|
195
|
+
useExecutionViewStore((s) => ({
|
|
196
|
+
logsExpanded: s.logsExpanded,
|
|
197
|
+
selectedLogNodeId: s.selectedLogNodeId,
|
|
198
|
+
toggleLogsExpanded: s.toggleLogsExpanded,
|
|
199
|
+
setLogsExpanded: s.setLogsExpanded,
|
|
200
|
+
selectLogNode: s.selectLogNode,
|
|
201
|
+
}));
|
|
202
|
+
|
|
203
|
+
// Combined selectors
|
|
204
|
+
export const useExecutionFilters = () =>
|
|
205
|
+
useExecutionViewStore((s) => ({
|
|
206
|
+
statusFilter: s.statusFilter,
|
|
207
|
+
flowIdFilter: s.flowIdFilter,
|
|
208
|
+
setStatusFilter: s.setStatusFilter,
|
|
209
|
+
setFlowIdFilter: s.setFlowIdFilter,
|
|
210
|
+
clearFilters: s.clearFilters,
|
|
211
|
+
}));
|