@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,609 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Button } from '../ui/button';
|
|
3
|
+
import { Input } from '../ui/input';
|
|
4
|
+
import { Label } from '../ui/label';
|
|
5
|
+
import { Textarea } from '../ui/textarea';
|
|
6
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
DialogFooter,
|
|
12
|
+
DialogHeader,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
} from '../ui/dialog';
|
|
15
|
+
import { CheckCircle2, XCircle, Loader2 } from 'lucide-react';
|
|
16
|
+
import type { CreateCredentialInput, CredentialAuthType, CredentialType } from '../../api/types';
|
|
17
|
+
import { useTestCredentialRequest } from '../../api/credentials.api';
|
|
18
|
+
|
|
19
|
+
interface CreateCredentialModalProps {
|
|
20
|
+
open: boolean;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
onSubmit: (data: CreateCredentialInput) => void;
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
portalContainer?: HTMLElement | null;
|
|
25
|
+
/** Pre-select a credential type when the modal opens (e.g. 'llm') */
|
|
26
|
+
initialType?: CredentialType;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const ALL_AUTH_TYPES: { value: CredentialAuthType; label: string }[] = [
|
|
30
|
+
{ value: 'bearer', label: 'Bearer Token' },
|
|
31
|
+
{ value: 'apiKey', label: 'API Key' },
|
|
32
|
+
{ value: 'basic', label: 'Basic Auth' },
|
|
33
|
+
{ value: 'custom', label: 'Custom Headers' },
|
|
34
|
+
{ value: 'connectionString', label: 'Connection String' },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
function getAuthTypesForType(type: CredentialType) {
|
|
38
|
+
if (type === 'database') {
|
|
39
|
+
return ALL_AUTH_TYPES.filter((t) => ['basic', 'connectionString', 'oauth2'].includes(t.value));
|
|
40
|
+
}
|
|
41
|
+
if (type === 'llm') {
|
|
42
|
+
return ALL_AUTH_TYPES.filter((t) => ['apiKey', 'bearer'].includes(t.value));
|
|
43
|
+
}
|
|
44
|
+
return ALL_AUTH_TYPES.filter((t) => !['connectionString'].includes(t.value));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const CreateCredentialModal: React.FC<CreateCredentialModalProps> = ({
|
|
48
|
+
open,
|
|
49
|
+
onClose,
|
|
50
|
+
onSubmit,
|
|
51
|
+
isLoading,
|
|
52
|
+
portalContainer,
|
|
53
|
+
initialType,
|
|
54
|
+
}) => {
|
|
55
|
+
const testCredentialMutation = useTestCredentialRequest();
|
|
56
|
+
|
|
57
|
+
const getInitialFormData = (): CreateCredentialInput => {
|
|
58
|
+
const type: CredentialType = initialType ?? 'http-api';
|
|
59
|
+
return {
|
|
60
|
+
name: '',
|
|
61
|
+
type,
|
|
62
|
+
authType: (type === 'llm' ? 'apiKey' : 'bearer') as CredentialAuthType,
|
|
63
|
+
config: {},
|
|
64
|
+
description: '',
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const [formData, setFormData] = useState<CreateCredentialInput>(getInitialFormData);
|
|
69
|
+
const [testUrl, setTestUrl] = useState('');
|
|
70
|
+
const [testMethod, setTestMethod] = useState<'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'>('GET');
|
|
71
|
+
const [testBody, setTestBody] = useState('');
|
|
72
|
+
const [testStatus, setTestStatus] = useState<'idle' | 'testing' | 'success' | 'error'>('idle');
|
|
73
|
+
const [testMessage, setTestMessage] = useState('');
|
|
74
|
+
const firstFieldRef = useRef<HTMLInputElement | null>(null);
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (open) {
|
|
78
|
+
// Reset form to initial state when modal opens
|
|
79
|
+
setFormData(getInitialFormData());
|
|
80
|
+
const timeout = window.setTimeout(() => {
|
|
81
|
+
firstFieldRef.current?.focus();
|
|
82
|
+
}, 0);
|
|
83
|
+
return () => window.clearTimeout(timeout);
|
|
84
|
+
}
|
|
85
|
+
setTestUrl('');
|
|
86
|
+
setTestMethod('GET');
|
|
87
|
+
setTestBody('');
|
|
88
|
+
setTestStatus('idle');
|
|
89
|
+
setTestMessage('');
|
|
90
|
+
return undefined;
|
|
91
|
+
}, [open]);
|
|
92
|
+
|
|
93
|
+
const runCredentialTest = async () => {
|
|
94
|
+
if (!testUrl) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
setTestStatus('testing');
|
|
99
|
+
setTestMessage('');
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
const headers: Record<string, string> = {};
|
|
103
|
+
|
|
104
|
+
if (formData.authType === 'bearer' && formData.config.token) {
|
|
105
|
+
headers['Authorization'] = `Bearer ${formData.config.token}`;
|
|
106
|
+
} else if (formData.authType === 'apiKey' && formData.config.apiKey) {
|
|
107
|
+
const location = formData.config.location || 'header';
|
|
108
|
+
if (location === 'header') {
|
|
109
|
+
const paramName = (formData.config.paramName as string) || 'X-API-Key';
|
|
110
|
+
headers[paramName] = formData.config.apiKey as string;
|
|
111
|
+
}
|
|
112
|
+
} else if (
|
|
113
|
+
formData.authType === 'basic' &&
|
|
114
|
+
formData.config.username &&
|
|
115
|
+
formData.config.password
|
|
116
|
+
) {
|
|
117
|
+
const encoded = btoa(`${formData.config.username}:${formData.config.password}`);
|
|
118
|
+
headers['Authorization'] = `Basic ${encoded}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (testBody && ['POST', 'PUT', 'PATCH'].includes(testMethod)) {
|
|
122
|
+
headers['Content-Type'] = 'application/json';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const response = await testCredentialMutation.mutateAsync({
|
|
126
|
+
url: testUrl,
|
|
127
|
+
method: testMethod,
|
|
128
|
+
headers,
|
|
129
|
+
body: testBody && ['POST', 'PUT', 'PATCH'].includes(testMethod) ? testBody : undefined,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (response.ok) {
|
|
133
|
+
setTestStatus('success');
|
|
134
|
+
setTestMessage(`Connection successful (${response.status} ${response.statusText})`);
|
|
135
|
+
} else {
|
|
136
|
+
setTestStatus('error');
|
|
137
|
+
setTestMessage(`Request failed with status ${response.status} ${response.statusText}`);
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
setTestStatus('error');
|
|
141
|
+
setTestMessage(error instanceof Error ? error.message : 'Connection failed');
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
const finalFormData = testUrl
|
|
148
|
+
? { ...formData, config: { ...formData.config, apiUrl: testUrl } }
|
|
149
|
+
: formData;
|
|
150
|
+
onSubmit(finalFormData);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const updateConfig = (key: string, value: string) => {
|
|
154
|
+
setFormData((prev) => ({
|
|
155
|
+
...prev,
|
|
156
|
+
config: { ...prev.config, [key]: value },
|
|
157
|
+
}));
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<Dialog
|
|
162
|
+
open={open}
|
|
163
|
+
onOpenChange={(next) => {
|
|
164
|
+
if (!next) {
|
|
165
|
+
onClose();
|
|
166
|
+
}
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
<DialogContent
|
|
170
|
+
container={portalContainer}
|
|
171
|
+
className="max-h-[90vh] bg-card overflow-y-auto sm:max-w-lg"
|
|
172
|
+
>
|
|
173
|
+
<DialogHeader>
|
|
174
|
+
<DialogTitle className="text-base">Create Credential</DialogTitle>
|
|
175
|
+
<DialogDescription className="text-xs">
|
|
176
|
+
Store API or database credentials securely. These secrets are encrypted at rest.
|
|
177
|
+
</DialogDescription>
|
|
178
|
+
</DialogHeader>
|
|
179
|
+
|
|
180
|
+
<form
|
|
181
|
+
onSubmit={handleSubmit}
|
|
182
|
+
className="space-y-3 text-xs"
|
|
183
|
+
autoComplete="one-time-code"
|
|
184
|
+
data-lpignore="true"
|
|
185
|
+
>
|
|
186
|
+
{/* Name */}
|
|
187
|
+
<div className="space-y-1.5">
|
|
188
|
+
<Label htmlFor="name" className="text-xs">
|
|
189
|
+
Name*
|
|
190
|
+
</Label>
|
|
191
|
+
<Input
|
|
192
|
+
id="name"
|
|
193
|
+
ref={firstFieldRef}
|
|
194
|
+
value={formData.name}
|
|
195
|
+
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
|
|
196
|
+
placeholder="My Stripe Production"
|
|
197
|
+
required
|
|
198
|
+
autoComplete="one-time-code"
|
|
199
|
+
data-1p-ignore
|
|
200
|
+
data-lpignore="true"
|
|
201
|
+
className="h-8 text-xs"
|
|
202
|
+
/>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
{/* Description */}
|
|
206
|
+
<div className="space-y-1.5">
|
|
207
|
+
<Label htmlFor="description" className="text-xs">
|
|
208
|
+
Description
|
|
209
|
+
</Label>
|
|
210
|
+
<Textarea
|
|
211
|
+
id="description"
|
|
212
|
+
value={formData.description}
|
|
213
|
+
onChange={(e) => setFormData({ ...formData, description: e.target.value })}
|
|
214
|
+
placeholder="Optional description for this credential"
|
|
215
|
+
rows={2}
|
|
216
|
+
autoComplete="one-time-code"
|
|
217
|
+
className="text-xs"
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
{/* Credential Type */}
|
|
222
|
+
<div className="space-y-1.5">
|
|
223
|
+
<Label htmlFor="type" className="text-xs">
|
|
224
|
+
Credential Type*
|
|
225
|
+
</Label>
|
|
226
|
+
<Select
|
|
227
|
+
value={formData.type}
|
|
228
|
+
onValueChange={(value) => {
|
|
229
|
+
const newType = value as CredentialType;
|
|
230
|
+
if (newType === 'llm') {
|
|
231
|
+
setFormData({ ...formData, type: newType, authType: 'apiKey' });
|
|
232
|
+
} else {
|
|
233
|
+
const available = getAuthTypesForType(newType);
|
|
234
|
+
const nextAuthType = available.some((t) => t.value === formData.authType)
|
|
235
|
+
? formData.authType
|
|
236
|
+
: available[0]?.value || 'basic';
|
|
237
|
+
setFormData({ ...formData, type: newType, authType: nextAuthType });
|
|
238
|
+
}
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
241
|
+
<SelectTrigger size="sm" className="w-full text-xs">
|
|
242
|
+
<SelectValue />
|
|
243
|
+
</SelectTrigger>
|
|
244
|
+
<SelectContent>
|
|
245
|
+
<SelectItem value="http-api">HTTP API</SelectItem>
|
|
246
|
+
<SelectItem value="llm">LLM Provider</SelectItem>
|
|
247
|
+
<SelectItem value="database">Database</SelectItem>
|
|
248
|
+
</SelectContent>
|
|
249
|
+
</Select>
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
{/* Auth Type (hidden for LLM — always apiKey) */}
|
|
253
|
+
{formData.type !== 'llm' && (
|
|
254
|
+
<div className="space-y-1.5">
|
|
255
|
+
<Label htmlFor="authType" className="text-xs">
|
|
256
|
+
Authentication Type*
|
|
257
|
+
</Label>
|
|
258
|
+
<Select
|
|
259
|
+
value={formData.authType}
|
|
260
|
+
onValueChange={(value) =>
|
|
261
|
+
setFormData({ ...formData, authType: value as CredentialAuthType })
|
|
262
|
+
}
|
|
263
|
+
>
|
|
264
|
+
<SelectTrigger size="sm" className="w-full text-xs">
|
|
265
|
+
<SelectValue />
|
|
266
|
+
</SelectTrigger>
|
|
267
|
+
<SelectContent>
|
|
268
|
+
{getAuthTypesForType(formData.type).map((type) => (
|
|
269
|
+
<SelectItem key={type.value} value={type.value}>
|
|
270
|
+
{type.label}
|
|
271
|
+
</SelectItem>
|
|
272
|
+
))}
|
|
273
|
+
</SelectContent>
|
|
274
|
+
</Select>
|
|
275
|
+
</div>
|
|
276
|
+
)}
|
|
277
|
+
|
|
278
|
+
{/* LLM Provider selector (only shown for LLM type) */}
|
|
279
|
+
{formData.type === 'llm' && (
|
|
280
|
+
<div className="space-y-1.5">
|
|
281
|
+
<Label htmlFor="llmProvider" className="text-xs">
|
|
282
|
+
LLM Provider*
|
|
283
|
+
</Label>
|
|
284
|
+
<Select
|
|
285
|
+
value={(formData.metadata?.provider as string) || ''}
|
|
286
|
+
onValueChange={(value) =>
|
|
287
|
+
setFormData({
|
|
288
|
+
...formData,
|
|
289
|
+
metadata: { ...formData.metadata, provider: value },
|
|
290
|
+
})
|
|
291
|
+
}
|
|
292
|
+
>
|
|
293
|
+
<SelectTrigger size="sm" className="w-full text-xs">
|
|
294
|
+
<SelectValue placeholder="Select a provider…" />
|
|
295
|
+
</SelectTrigger>
|
|
296
|
+
<SelectContent>
|
|
297
|
+
<SelectItem value="openai">OpenAI</SelectItem>
|
|
298
|
+
<SelectItem value="anthropic">Anthropic</SelectItem>
|
|
299
|
+
<SelectItem value="openrouter">OpenRouter</SelectItem>
|
|
300
|
+
</SelectContent>
|
|
301
|
+
</Select>
|
|
302
|
+
</div>
|
|
303
|
+
)}
|
|
304
|
+
|
|
305
|
+
{/* Config fields based on auth type */}
|
|
306
|
+
<div className="p-3 space-y-3 border rounded-lg">
|
|
307
|
+
{/* LLM: plain API key only */}
|
|
308
|
+
{formData.type === 'llm' && (
|
|
309
|
+
<div className="space-y-1.5">
|
|
310
|
+
<Label htmlFor="apiKey" className="text-xs">
|
|
311
|
+
API Key*
|
|
312
|
+
</Label>
|
|
313
|
+
<Input
|
|
314
|
+
id="apiKey"
|
|
315
|
+
type="text"
|
|
316
|
+
style={{ WebkitTextSecurity: 'disc' }}
|
|
317
|
+
value={(formData.config.apiKey as string) || ''}
|
|
318
|
+
onChange={(e) => updateConfig('apiKey', e.target.value)}
|
|
319
|
+
placeholder="Enter your API key"
|
|
320
|
+
required
|
|
321
|
+
autoComplete="one-time-code"
|
|
322
|
+
data-1p-ignore
|
|
323
|
+
data-lpignore="true"
|
|
324
|
+
className="h-8 text-xs"
|
|
325
|
+
/>
|
|
326
|
+
</div>
|
|
327
|
+
)}
|
|
328
|
+
|
|
329
|
+
{formData.type !== 'llm' && formData.authType === 'bearer' && (
|
|
330
|
+
<div className="space-y-1.5">
|
|
331
|
+
<Label htmlFor="token" className="text-xs">
|
|
332
|
+
Token*
|
|
333
|
+
</Label>
|
|
334
|
+
<Input
|
|
335
|
+
id="token"
|
|
336
|
+
type="text"
|
|
337
|
+
style={{ WebkitTextSecurity: 'disc' }}
|
|
338
|
+
value={(formData.config.token as string) || ''}
|
|
339
|
+
onChange={(e) => updateConfig('token', e.target.value)}
|
|
340
|
+
placeholder="Enter bearer token"
|
|
341
|
+
required
|
|
342
|
+
autoComplete="one-time-code"
|
|
343
|
+
data-1p-ignore
|
|
344
|
+
data-lpignore="true"
|
|
345
|
+
className="h-8 text-xs"
|
|
346
|
+
/>
|
|
347
|
+
</div>
|
|
348
|
+
)}
|
|
349
|
+
|
|
350
|
+
{formData.type !== 'llm' && formData.authType === 'apiKey' && (
|
|
351
|
+
<>
|
|
352
|
+
<div className="space-y-1.5">
|
|
353
|
+
<Label htmlFor="apiKey" className="text-xs">
|
|
354
|
+
API Key*
|
|
355
|
+
</Label>
|
|
356
|
+
<Input
|
|
357
|
+
id="apiKey"
|
|
358
|
+
type="text"
|
|
359
|
+
style={{ WebkitTextSecurity: 'disc' }}
|
|
360
|
+
value={(formData.config.apiKey as string) || ''}
|
|
361
|
+
onChange={(e) => updateConfig('apiKey', e.target.value)}
|
|
362
|
+
placeholder="Enter API key"
|
|
363
|
+
required
|
|
364
|
+
autoComplete="one-time-code"
|
|
365
|
+
data-1p-ignore
|
|
366
|
+
data-lpignore="true"
|
|
367
|
+
className="h-8 text-xs"
|
|
368
|
+
/>
|
|
369
|
+
</div>
|
|
370
|
+
<div className="space-y-1.5">
|
|
371
|
+
<Label htmlFor="location" className="text-xs">
|
|
372
|
+
Location
|
|
373
|
+
</Label>
|
|
374
|
+
<select
|
|
375
|
+
id="location"
|
|
376
|
+
value={(formData.config.location as string) || 'header'}
|
|
377
|
+
onChange={(e) => updateConfig('location', e.target.value)}
|
|
378
|
+
className="flex w-full h-8 px-3 py-1 text-xs rounded-md border border-input bg-background dark:bg-input/30 shadow-xs outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"
|
|
379
|
+
>
|
|
380
|
+
<option value="header">Header</option>
|
|
381
|
+
<option value="query">Query Parameter</option>
|
|
382
|
+
</select>
|
|
383
|
+
</div>
|
|
384
|
+
<div className="space-y-1.5">
|
|
385
|
+
<Label htmlFor="paramName" className="text-xs">
|
|
386
|
+
Parameter Name
|
|
387
|
+
</Label>
|
|
388
|
+
<Input
|
|
389
|
+
id="paramName"
|
|
390
|
+
value={(formData.config.paramName as string) || ''}
|
|
391
|
+
onChange={(e) => updateConfig('paramName', e.target.value)}
|
|
392
|
+
placeholder="X-API-Key"
|
|
393
|
+
autoComplete="one-time-code"
|
|
394
|
+
data-1p-ignore
|
|
395
|
+
data-lpignore="true"
|
|
396
|
+
className="h-8 text-xs"
|
|
397
|
+
/>
|
|
398
|
+
</div>
|
|
399
|
+
</>
|
|
400
|
+
)}
|
|
401
|
+
|
|
402
|
+
{formData.authType === 'connectionString' && (
|
|
403
|
+
<div className="space-y-1.5">
|
|
404
|
+
<Label htmlFor="connectionString" className="text-xs">
|
|
405
|
+
Connection String*
|
|
406
|
+
</Label>
|
|
407
|
+
<Input
|
|
408
|
+
id="connectionString"
|
|
409
|
+
type="text"
|
|
410
|
+
style={{ WebkitTextSecurity: 'disc' }}
|
|
411
|
+
value={(formData.config.connectionString as string) || ''}
|
|
412
|
+
onChange={(e) => updateConfig('connectionString', e.target.value)}
|
|
413
|
+
placeholder="postgres://user:pass@host:5432/dbname?sslmode=require"
|
|
414
|
+
required
|
|
415
|
+
autoComplete="one-time-code"
|
|
416
|
+
data-1p-ignore
|
|
417
|
+
data-lpignore="true"
|
|
418
|
+
className="h-8 text-xs"
|
|
419
|
+
/>
|
|
420
|
+
</div>
|
|
421
|
+
)}
|
|
422
|
+
|
|
423
|
+
{formData.authType === 'basic' && (
|
|
424
|
+
<>
|
|
425
|
+
<div className="space-y-1.5">
|
|
426
|
+
<Label htmlFor="username" className="text-xs">
|
|
427
|
+
Username*
|
|
428
|
+
</Label>
|
|
429
|
+
<Input
|
|
430
|
+
id="username"
|
|
431
|
+
value={(formData.config.username as string) || ''}
|
|
432
|
+
onChange={(e) => updateConfig('username', e.target.value)}
|
|
433
|
+
placeholder="Enter username"
|
|
434
|
+
required
|
|
435
|
+
autoComplete="one-time-code"
|
|
436
|
+
data-1p-ignore
|
|
437
|
+
data-lpignore="true"
|
|
438
|
+
className="h-8 text-xs"
|
|
439
|
+
/>
|
|
440
|
+
</div>
|
|
441
|
+
<div className="space-y-1.5">
|
|
442
|
+
<Label htmlFor="password" className="text-xs">
|
|
443
|
+
Password*
|
|
444
|
+
</Label>
|
|
445
|
+
<Input
|
|
446
|
+
id="password"
|
|
447
|
+
type="text"
|
|
448
|
+
style={{ WebkitTextSecurity: 'disc' }}
|
|
449
|
+
value={(formData.config.password as string) || ''}
|
|
450
|
+
onChange={(e) => updateConfig('password', e.target.value)}
|
|
451
|
+
placeholder="Enter password"
|
|
452
|
+
required
|
|
453
|
+
autoComplete="one-time-code"
|
|
454
|
+
data-1p-ignore
|
|
455
|
+
data-lpignore="true"
|
|
456
|
+
className="h-8 text-xs"
|
|
457
|
+
/>
|
|
458
|
+
</div>
|
|
459
|
+
</>
|
|
460
|
+
)}
|
|
461
|
+
|
|
462
|
+
{formData.authType === 'oauth2' && (
|
|
463
|
+
<>
|
|
464
|
+
<div className="space-y-1.5">
|
|
465
|
+
<Label htmlFor="clientId" className="text-xs">
|
|
466
|
+
Client ID*
|
|
467
|
+
</Label>
|
|
468
|
+
<Input
|
|
469
|
+
id="clientId"
|
|
470
|
+
value={(formData.config.clientId as string) || ''}
|
|
471
|
+
onChange={(e) => updateConfig('clientId', e.target.value)}
|
|
472
|
+
placeholder="Enter client ID"
|
|
473
|
+
required
|
|
474
|
+
autoComplete="one-time-code"
|
|
475
|
+
data-1p-ignore
|
|
476
|
+
data-lpignore="true"
|
|
477
|
+
className="h-8 text-xs"
|
|
478
|
+
/>
|
|
479
|
+
</div>
|
|
480
|
+
<div className="space-y-1.5">
|
|
481
|
+
<Label htmlFor="clientSecret" className="text-xs">
|
|
482
|
+
Client Secret*
|
|
483
|
+
</Label>
|
|
484
|
+
<Input
|
|
485
|
+
id="clientSecret"
|
|
486
|
+
type="text"
|
|
487
|
+
style={{ WebkitTextSecurity: 'disc' }}
|
|
488
|
+
value={(formData.config.clientSecret as string) || ''}
|
|
489
|
+
onChange={(e) => updateConfig('clientSecret', e.target.value)}
|
|
490
|
+
placeholder="Enter client secret"
|
|
491
|
+
required
|
|
492
|
+
autoComplete="one-time-code"
|
|
493
|
+
data-1p-ignore
|
|
494
|
+
data-lpignore="true"
|
|
495
|
+
className="h-8 text-xs"
|
|
496
|
+
/>
|
|
497
|
+
</div>
|
|
498
|
+
</>
|
|
499
|
+
)}
|
|
500
|
+
</div>
|
|
501
|
+
|
|
502
|
+
{/* Test Section (Always visible for HTTP APIs and LLM providers) */}
|
|
503
|
+
{(formData.type === 'http-api' || formData.type === 'llm') && (
|
|
504
|
+
<div className="border rounded-lg">
|
|
505
|
+
<div className="p-2.5 space-y-2.5">
|
|
506
|
+
<div className="flex items-center justify-between">
|
|
507
|
+
<span className="text-xs font-medium">Test Credential</span>
|
|
508
|
+
<span className="text-xs text-muted-foreground">Optional</span>
|
|
509
|
+
</div>
|
|
510
|
+
<p className="text-xs text-muted-foreground">
|
|
511
|
+
Test your credential by making a request to an API endpoint.
|
|
512
|
+
</p>
|
|
513
|
+
|
|
514
|
+
<div className="flex gap-2">
|
|
515
|
+
<Select
|
|
516
|
+
value={testMethod}
|
|
517
|
+
onValueChange={(value) => {
|
|
518
|
+
setTestMethod(value as typeof testMethod);
|
|
519
|
+
setTestStatus('idle');
|
|
520
|
+
}}
|
|
521
|
+
>
|
|
522
|
+
<SelectTrigger size="sm" className="w-20 text-xs">
|
|
523
|
+
<SelectValue />
|
|
524
|
+
</SelectTrigger>
|
|
525
|
+
<SelectContent>
|
|
526
|
+
<SelectItem value="GET">GET</SelectItem>
|
|
527
|
+
<SelectItem value="POST">POST</SelectItem>
|
|
528
|
+
<SelectItem value="PUT">PUT</SelectItem>
|
|
529
|
+
<SelectItem value="PATCH">PATCH</SelectItem>
|
|
530
|
+
<SelectItem value="DELETE">DELETE</SelectItem>
|
|
531
|
+
</SelectContent>
|
|
532
|
+
</Select>
|
|
533
|
+
<Input
|
|
534
|
+
id="testUrl"
|
|
535
|
+
value={testUrl}
|
|
536
|
+
onChange={(e) => {
|
|
537
|
+
setTestUrl(e.target.value);
|
|
538
|
+
setTestStatus('idle');
|
|
539
|
+
}}
|
|
540
|
+
placeholder="https://api.example.com/health"
|
|
541
|
+
className="flex-1 h-8 text-xs"
|
|
542
|
+
autoComplete="one-time-code"
|
|
543
|
+
/>
|
|
544
|
+
<Button
|
|
545
|
+
type="button"
|
|
546
|
+
variant="outline"
|
|
547
|
+
size="sm"
|
|
548
|
+
onClick={runCredentialTest}
|
|
549
|
+
disabled={!testUrl || testStatus === 'testing'}
|
|
550
|
+
className="h-8 text-xs"
|
|
551
|
+
>
|
|
552
|
+
{testStatus === 'testing' ? (
|
|
553
|
+
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
|
554
|
+
) : (
|
|
555
|
+
'Test'
|
|
556
|
+
)}
|
|
557
|
+
</Button>
|
|
558
|
+
</div>
|
|
559
|
+
|
|
560
|
+
{['POST', 'PUT', 'PATCH'].includes(testMethod) && (
|
|
561
|
+
<div className="space-y-1">
|
|
562
|
+
<Label htmlFor="testBody" className="text-xs">
|
|
563
|
+
Request Body (JSON)
|
|
564
|
+
</Label>
|
|
565
|
+
<Textarea
|
|
566
|
+
id="testBody"
|
|
567
|
+
value={testBody}
|
|
568
|
+
onChange={(e) => {
|
|
569
|
+
setTestBody(e.target.value);
|
|
570
|
+
setTestStatus('idle');
|
|
571
|
+
}}
|
|
572
|
+
placeholder='{"key": "value"}'
|
|
573
|
+
rows={3}
|
|
574
|
+
className="font-mono text-xs"
|
|
575
|
+
autoComplete="one-time-code"
|
|
576
|
+
/>
|
|
577
|
+
</div>
|
|
578
|
+
)}
|
|
579
|
+
|
|
580
|
+
{testStatus === 'success' && (
|
|
581
|
+
<div className="flex items-center gap-1.5 text-xs text-success">
|
|
582
|
+
<CheckCircle2 className="w-3.5 h-3.5" />
|
|
583
|
+
<span>{testMessage}</span>
|
|
584
|
+
</div>
|
|
585
|
+
)}
|
|
586
|
+
|
|
587
|
+
{testStatus === 'error' && (
|
|
588
|
+
<div className="flex items-center gap-1.5 text-xs text-destructive">
|
|
589
|
+
<XCircle className="w-3.5 h-3.5" />
|
|
590
|
+
<span>{testMessage}</span>
|
|
591
|
+
</div>
|
|
592
|
+
)}
|
|
593
|
+
</div>
|
|
594
|
+
</div>
|
|
595
|
+
)}
|
|
596
|
+
|
|
597
|
+
<DialogFooter>
|
|
598
|
+
<Button type="button" variant="outline" onClick={onClose} className="h-8 text-xs">
|
|
599
|
+
Cancel
|
|
600
|
+
</Button>
|
|
601
|
+
<Button type="submit" disabled={isLoading} className="h-8 text-xs">
|
|
602
|
+
{isLoading ? 'Creating...' : 'Create Credential'}
|
|
603
|
+
</Button>
|
|
604
|
+
</DialogFooter>
|
|
605
|
+
</form>
|
|
606
|
+
</DialogContent>
|
|
607
|
+
</Dialog>
|
|
608
|
+
);
|
|
609
|
+
};
|