@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,109 @@
|
|
|
1
|
+
import { cn } from '../../lib/utils';
|
|
2
|
+
import { Play, Loader2, Power, PowerOff } from 'lucide-react';
|
|
3
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from '../ui/tooltip';
|
|
4
|
+
import { useToolbarCollapsed } from './toolbar-context';
|
|
5
|
+
|
|
6
|
+
interface RunControlsProps {
|
|
7
|
+
onExecute?: () => Promise<void>;
|
|
8
|
+
isExecuting?: boolean;
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
isTogglingActive?: boolean;
|
|
11
|
+
onToggleActive?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Run button + Active/Inactive toggle, rendered inside the bottom canvas toolbar.
|
|
16
|
+
*/
|
|
17
|
+
export function RunControls({
|
|
18
|
+
onExecute,
|
|
19
|
+
isExecuting = false,
|
|
20
|
+
isActive,
|
|
21
|
+
isTogglingActive = false,
|
|
22
|
+
onToggleActive,
|
|
23
|
+
}: RunControlsProps) {
|
|
24
|
+
const collapsed = useToolbarCollapsed();
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<Tooltip>
|
|
29
|
+
<TooltipTrigger asChild>
|
|
30
|
+
<button
|
|
31
|
+
onClick={onExecute}
|
|
32
|
+
disabled={isExecuting || !onExecute}
|
|
33
|
+
className={cn(
|
|
34
|
+
'flex items-center gap-1.5 py-1.5 text-xs font-medium rounded-md bg-foreground text-background hover:bg-foreground/85 transition-colors disabled:opacity-50 disabled:pointer-events-none',
|
|
35
|
+
collapsed ? 'px-4' : 'px-3',
|
|
36
|
+
)}
|
|
37
|
+
title={collapsed ? undefined : 'Run flow'}
|
|
38
|
+
>
|
|
39
|
+
{isExecuting ? (
|
|
40
|
+
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
|
41
|
+
) : (
|
|
42
|
+
<Play className="w-3.5 h-3.5" />
|
|
43
|
+
)}
|
|
44
|
+
{!collapsed && 'Run'}
|
|
45
|
+
</button>
|
|
46
|
+
</TooltipTrigger>
|
|
47
|
+
{collapsed && <TooltipContent side="top">Run flow</TooltipContent>}
|
|
48
|
+
</Tooltip>
|
|
49
|
+
|
|
50
|
+
{/* Active / Inactive segmented toggle */}
|
|
51
|
+
{isActive !== undefined && onToggleActive && (
|
|
52
|
+
<div className="inline-flex items-center rounded-md border border-border bg-muted/40 p-0.5">
|
|
53
|
+
<Tooltip>
|
|
54
|
+
<TooltipTrigger asChild>
|
|
55
|
+
<button
|
|
56
|
+
onClick={() => {
|
|
57
|
+
if (!isActive) {
|
|
58
|
+
onToggleActive();
|
|
59
|
+
}
|
|
60
|
+
}}
|
|
61
|
+
disabled={isTogglingActive}
|
|
62
|
+
className={cn(
|
|
63
|
+
'flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-sm transition-colors disabled:opacity-50',
|
|
64
|
+
isActive
|
|
65
|
+
? 'bg-card text-foreground shadow-sm'
|
|
66
|
+
: 'text-muted-foreground hover:text-foreground',
|
|
67
|
+
)}
|
|
68
|
+
>
|
|
69
|
+
{isTogglingActive && !isActive ? (
|
|
70
|
+
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
|
71
|
+
) : (
|
|
72
|
+
<Power className="w-3 h-3" />
|
|
73
|
+
)}
|
|
74
|
+
{!collapsed && 'Active'}
|
|
75
|
+
</button>
|
|
76
|
+
</TooltipTrigger>
|
|
77
|
+
{collapsed && <TooltipContent side="top">Active</TooltipContent>}
|
|
78
|
+
</Tooltip>
|
|
79
|
+
<Tooltip>
|
|
80
|
+
<TooltipTrigger asChild>
|
|
81
|
+
<button
|
|
82
|
+
onClick={() => {
|
|
83
|
+
if (isActive) {
|
|
84
|
+
onToggleActive();
|
|
85
|
+
}
|
|
86
|
+
}}
|
|
87
|
+
disabled={isTogglingActive}
|
|
88
|
+
className={cn(
|
|
89
|
+
'flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-sm transition-colors disabled:opacity-50',
|
|
90
|
+
!isActive
|
|
91
|
+
? 'bg-card text-foreground shadow-sm'
|
|
92
|
+
: 'text-muted-foreground hover:text-foreground',
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
95
|
+
{isTogglingActive && isActive ? (
|
|
96
|
+
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
|
97
|
+
) : (
|
|
98
|
+
<PowerOff className="w-3 h-3" />
|
|
99
|
+
)}
|
|
100
|
+
{!collapsed && 'Inactive'}
|
|
101
|
+
</button>
|
|
102
|
+
</TooltipTrigger>
|
|
103
|
+
{collapsed && <TooltipContent side="top">Inactive</TooltipContent>}
|
|
104
|
+
</Tooltip>
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
107
|
+
</>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo, useState, useMemo, useEffect, useCallback } from 'react';
|
|
4
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
5
|
+
import { Button } from '../ui/button';
|
|
6
|
+
import { ScrollArea } from '../ui/scroll-area';
|
|
7
|
+
import {
|
|
8
|
+
X,
|
|
9
|
+
Check,
|
|
10
|
+
ChevronDown,
|
|
11
|
+
ChevronUp,
|
|
12
|
+
ExternalLink,
|
|
13
|
+
Trash2,
|
|
14
|
+
PanelRightClose,
|
|
15
|
+
Wrench,
|
|
16
|
+
} from 'lucide-react';
|
|
17
|
+
import { InlineEdit } from './inline-edit';
|
|
18
|
+
import { cn } from '../../lib/utils';
|
|
19
|
+
import { ProviderIcon } from '../shared/ProviderIcon';
|
|
20
|
+
import { useNodeRegistry } from '../../contexts/NodeRegistryContext';
|
|
21
|
+
import { ToolParamField, type AddCredentialRequest } from '../nodes/ToolParamField';
|
|
22
|
+
import { CreateCredentialModal } from '../credentials/CreateCredentialModal';
|
|
23
|
+
import { OAuth2ProviderSelector } from '../credentials/OAuth2ProviderSelector';
|
|
24
|
+
import { useCreateCredential } from '../../api/credentials.api';
|
|
25
|
+
import type { NodeParamField } from '../../types/node-definition.types';
|
|
26
|
+
import type { CreateCredentialInput, Credential } from '../../api/types';
|
|
27
|
+
import type { ToolDefinition, AddedToolInstance, ToolCategory } from '../nodes/ToolSelectorModal';
|
|
28
|
+
|
|
29
|
+
// ─── Category Config ───────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
const DIAMOND_CONTAINER_CLASS =
|
|
32
|
+
'flex shrink-0 items-center justify-center border bg-card rotate-45 rounded-[0.45rem]';
|
|
33
|
+
const DIAMOND_GLYPH_CLASS = '-rotate-45';
|
|
34
|
+
|
|
35
|
+
const categoryColors: Record<ToolCategory, string> = {
|
|
36
|
+
data: 'border-blue-500/30',
|
|
37
|
+
web: 'border-green-500/30',
|
|
38
|
+
code: 'border-purple-500/30',
|
|
39
|
+
utility: 'border-orange-500/30',
|
|
40
|
+
custom: 'border-pink-500/30',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// ─── Main Panel ────────────────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
// ─── Delete Confirm Button ─────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
function DeleteConfirmButton({
|
|
48
|
+
onConfirm,
|
|
49
|
+
onClose,
|
|
50
|
+
}: {
|
|
51
|
+
onConfirm: () => void;
|
|
52
|
+
onClose: () => void;
|
|
53
|
+
}) {
|
|
54
|
+
const [confirming, setConfirming] = useState(false);
|
|
55
|
+
|
|
56
|
+
if (confirming) {
|
|
57
|
+
return (
|
|
58
|
+
<div className="flex items-center gap-1 shrink-0">
|
|
59
|
+
<span className="text-[10px] text-destructive font-medium">Remove?</span>
|
|
60
|
+
<Button
|
|
61
|
+
variant="ghost"
|
|
62
|
+
size="sm"
|
|
63
|
+
className="w-6 h-6 p-0 bg-destructive/10 text-destructive hover:text-destructive hover:bg-destructive/20"
|
|
64
|
+
onClick={onConfirm}
|
|
65
|
+
title="Confirm remove"
|
|
66
|
+
>
|
|
67
|
+
<Check className="w-3 h-3" />
|
|
68
|
+
</Button>
|
|
69
|
+
<Button
|
|
70
|
+
variant="ghost"
|
|
71
|
+
size="sm"
|
|
72
|
+
className="w-6 h-6 p-0 text-muted-foreground"
|
|
73
|
+
onClick={() => setConfirming(false)}
|
|
74
|
+
title="Cancel"
|
|
75
|
+
>
|
|
76
|
+
<X className="w-3 h-3" />
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div className="flex gap-1 shrink-0">
|
|
84
|
+
<Button
|
|
85
|
+
variant="ghost"
|
|
86
|
+
size="sm"
|
|
87
|
+
className="p-0 w-7 h-7 text-destructive hover:text-destructive hover:bg-destructive/10"
|
|
88
|
+
onClick={() => setConfirming(true)}
|
|
89
|
+
title="Remove tool"
|
|
90
|
+
>
|
|
91
|
+
<Trash2 className="w-3.5 h-3.5" />
|
|
92
|
+
</Button>
|
|
93
|
+
<Button variant="ghost" size="sm" className="p-0 w-7 h-7" onClick={onClose}>
|
|
94
|
+
<PanelRightClose className="w-4 h-4" />
|
|
95
|
+
</Button>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ─── Main Panel ────────────────────────────────────────────────────
|
|
101
|
+
|
|
102
|
+
export interface ToolConfigPanelProps {
|
|
103
|
+
open: boolean;
|
|
104
|
+
onClose: () => void;
|
|
105
|
+
/** The base tool definition */
|
|
106
|
+
tool: ToolDefinition | null;
|
|
107
|
+
/** The tool instance being configured */
|
|
108
|
+
instance: AddedToolInstance | null;
|
|
109
|
+
/** Called when the tool instance is updated */
|
|
110
|
+
onUpdate: (
|
|
111
|
+
instanceId: string,
|
|
112
|
+
updates: Partial<Omit<AddedToolInstance, 'instanceId' | 'toolId'>>,
|
|
113
|
+
) => void;
|
|
114
|
+
/** Called when the tool instance is removed */
|
|
115
|
+
onRemove: (instanceId: string) => void;
|
|
116
|
+
/** Portal container for sub-modals (credential creation) */
|
|
117
|
+
portalContainer?: HTMLElement | null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const ToolConfigPanel = memo(function ToolConfigPanel({
|
|
121
|
+
open,
|
|
122
|
+
onClose,
|
|
123
|
+
tool,
|
|
124
|
+
instance,
|
|
125
|
+
onUpdate,
|
|
126
|
+
onRemove,
|
|
127
|
+
portalContainer,
|
|
128
|
+
}: ToolConfigPanelProps) {
|
|
129
|
+
const queryClient = useQueryClient();
|
|
130
|
+
const [showSchema, setShowSchema] = useState(false);
|
|
131
|
+
|
|
132
|
+
// Credential modal state
|
|
133
|
+
const [isCreateCredentialOpen, setIsCreateCredentialOpen] = useState(false);
|
|
134
|
+
const [isOAuth2SelectorOpen, setIsOAuth2SelectorOpen] = useState(false);
|
|
135
|
+
const [activeCredentialField, setActiveCredentialField] = useState<string | null>(null);
|
|
136
|
+
const [activeOAuth2Providers, setActiveOAuth2Providers] = useState<string[] | null>(null);
|
|
137
|
+
const createCredentialMutation = useCreateCredential();
|
|
138
|
+
|
|
139
|
+
// Get node definition if tool is backed by a node
|
|
140
|
+
const { getNodeDefinition } = useNodeRegistry();
|
|
141
|
+
const nodeDefinition = tool?.nodeType ? getNodeDefinition(tool.nodeType) : undefined;
|
|
142
|
+
|
|
143
|
+
// Filter out hidden fields, sort credential fields to top
|
|
144
|
+
const paramFields = useMemo(() => {
|
|
145
|
+
const allFields = nodeDefinition?.paramFields ?? [];
|
|
146
|
+
const visibleFields = allFields.filter((field: NodeParamField) => !field.hidden);
|
|
147
|
+
return visibleFields.sort((a: NodeParamField, b: NodeParamField) => {
|
|
148
|
+
if (a.type === 'credential' && b.type !== 'credential') {
|
|
149
|
+
return -1;
|
|
150
|
+
}
|
|
151
|
+
if (a.type !== 'credential' && b.type === 'credential') {
|
|
152
|
+
return 1;
|
|
153
|
+
}
|
|
154
|
+
return 0;
|
|
155
|
+
});
|
|
156
|
+
}, [nodeDefinition]);
|
|
157
|
+
|
|
158
|
+
// Compute effective input schema
|
|
159
|
+
const effectiveInputSchema = useMemo(() => {
|
|
160
|
+
if (!tool?.inputSchema || !instance) {
|
|
161
|
+
return tool?.inputSchema;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const aiChosenModes = (instance.params._aiChosenModes as Record<string, boolean>) ?? {};
|
|
165
|
+
const schema = tool.inputSchema as {
|
|
166
|
+
properties?: Record<string, unknown>;
|
|
167
|
+
required?: string[];
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
if (!schema.properties) {
|
|
171
|
+
return schema;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const filteredProperties: Record<string, unknown> = {};
|
|
175
|
+
const staticParams: string[] = [];
|
|
176
|
+
|
|
177
|
+
for (const [key, value] of Object.entries(schema.properties)) {
|
|
178
|
+
const isAiChosen = aiChosenModes[key] ?? true;
|
|
179
|
+
if (isAiChosen) {
|
|
180
|
+
filteredProperties[key] = value;
|
|
181
|
+
} else {
|
|
182
|
+
staticParams.push(key);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const filteredRequired = schema.required?.filter((key) => aiChosenModes[key] ?? true);
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
...schema,
|
|
190
|
+
properties: filteredProperties,
|
|
191
|
+
required: filteredRequired,
|
|
192
|
+
_staticParams: staticParams.length > 0 ? staticParams : undefined,
|
|
193
|
+
};
|
|
194
|
+
}, [tool?.inputSchema, instance]);
|
|
195
|
+
|
|
196
|
+
// Reset schema visibility when tool changes
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
setShowSchema(false);
|
|
199
|
+
}, [instance?.instanceId]);
|
|
200
|
+
|
|
201
|
+
// ─── Credential Handlers ────────────────────────────────────────
|
|
202
|
+
|
|
203
|
+
const handleAddCredential = useCallback((request: AddCredentialRequest) => {
|
|
204
|
+
setActiveCredentialField(request.fieldName);
|
|
205
|
+
if (request.oauth2Providers && request.oauth2Providers.length > 0) {
|
|
206
|
+
setActiveOAuth2Providers(request.oauth2Providers);
|
|
207
|
+
setIsOAuth2SelectorOpen(true);
|
|
208
|
+
} else {
|
|
209
|
+
setIsCreateCredentialOpen(true);
|
|
210
|
+
}
|
|
211
|
+
}, []);
|
|
212
|
+
|
|
213
|
+
const handleCloseCredentialModal = useCallback(() => {
|
|
214
|
+
setIsCreateCredentialOpen(false);
|
|
215
|
+
setActiveCredentialField(null);
|
|
216
|
+
}, []);
|
|
217
|
+
|
|
218
|
+
const handleCloseOAuth2Selector = useCallback(() => {
|
|
219
|
+
setIsOAuth2SelectorOpen(false);
|
|
220
|
+
setActiveCredentialField(null);
|
|
221
|
+
setActiveOAuth2Providers(null);
|
|
222
|
+
}, []);
|
|
223
|
+
|
|
224
|
+
const handleCredentialCreated = useCallback(
|
|
225
|
+
async (createdCredential: Credential) => {
|
|
226
|
+
await queryClient.refetchQueries({ queryKey: ['credentials'] });
|
|
227
|
+
|
|
228
|
+
const fieldToUpdate = activeCredentialField;
|
|
229
|
+
const instanceToUpdate = instance?.instanceId;
|
|
230
|
+
|
|
231
|
+
if (instanceToUpdate && fieldToUpdate && instance) {
|
|
232
|
+
onUpdate(instanceToUpdate, {
|
|
233
|
+
params: { ...instance.params, [fieldToUpdate]: createdCredential.id },
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
setIsCreateCredentialOpen(false);
|
|
238
|
+
setIsOAuth2SelectorOpen(false);
|
|
239
|
+
setActiveCredentialField(null);
|
|
240
|
+
setActiveOAuth2Providers(null);
|
|
241
|
+
},
|
|
242
|
+
[queryClient, instance, activeCredentialField, onUpdate],
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
const handleCreateCredential = useCallback(
|
|
246
|
+
(input: CreateCredentialInput) => {
|
|
247
|
+
createCredentialMutation.mutate(input, {
|
|
248
|
+
onSuccess: (createdCredential) => {
|
|
249
|
+
handleCredentialCreated(createdCredential);
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
[createCredentialMutation, handleCredentialCreated],
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
const handleNameChange = useCallback(
|
|
257
|
+
(newName: string) => {
|
|
258
|
+
if (instance) {
|
|
259
|
+
onUpdate(instance.instanceId, { name: newName });
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
[instance, onUpdate],
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
if (!open || !tool || !instance) {
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const borderColor = categoryColors[tool.category];
|
|
270
|
+
|
|
271
|
+
return (
|
|
272
|
+
<>
|
|
273
|
+
<div className="flex flex-col duration-200 border-l w-96 border-border bg-card text-card-foreground animate-in slide-in-from-right fade-in">
|
|
274
|
+
{/* Header */}
|
|
275
|
+
<div className="flex items-center justify-between gap-2 px-4 py-3 border-b border-border">
|
|
276
|
+
<div className="flex items-center min-w-0 gap-2">
|
|
277
|
+
<div className={cn('h-9 w-9', DIAMOND_CONTAINER_CLASS, borderColor)}>
|
|
278
|
+
{tool.provider?.id ? (
|
|
279
|
+
<ProviderIcon
|
|
280
|
+
providerId={tool.provider.id}
|
|
281
|
+
svgIcon={tool.provider.svgIcon}
|
|
282
|
+
icon={tool.provider.icon}
|
|
283
|
+
className={cn('w-5 h-5', DIAMOND_GLYPH_CLASS)}
|
|
284
|
+
/>
|
|
285
|
+
) : (
|
|
286
|
+
<Wrench className={cn('w-4 h-4', DIAMOND_GLYPH_CLASS)} />
|
|
287
|
+
)}
|
|
288
|
+
</div>
|
|
289
|
+
<div className="flex-1 min-w-0">
|
|
290
|
+
<InlineEdit
|
|
291
|
+
value={instance.name}
|
|
292
|
+
onChange={handleNameChange}
|
|
293
|
+
placeholder="Untitled Tool"
|
|
294
|
+
displayClassName="text-[15px] font-semibold truncate text-card-foreground"
|
|
295
|
+
inputClassName="text-[15px] font-semibold h-auto py-0.5 px-1.5"
|
|
296
|
+
/>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
<DeleteConfirmButton
|
|
300
|
+
onConfirm={() => {
|
|
301
|
+
onRemove(instance.instanceId);
|
|
302
|
+
onClose();
|
|
303
|
+
}}
|
|
304
|
+
onClose={onClose}
|
|
305
|
+
/>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
{/* Content */}
|
|
309
|
+
<ScrollArea className="flex-1 min-h-0">
|
|
310
|
+
<div className="p-4 space-y-4">
|
|
311
|
+
{/* Node params from definition */}
|
|
312
|
+
{tool.nodeType && paramFields.length > 0 && (
|
|
313
|
+
<div className="space-y-3">
|
|
314
|
+
<h4 className="text-[11px] font-semibold tracking-wider uppercase text-muted-foreground">
|
|
315
|
+
Parameters
|
|
316
|
+
</h4>
|
|
317
|
+
{paramFields.map((field: NodeParamField) => {
|
|
318
|
+
const aiChosenModes =
|
|
319
|
+
(instance.params._aiChosenModes as Record<string, boolean>) ?? {};
|
|
320
|
+
const isAiChosen = aiChosenModes[field.name] ?? true;
|
|
321
|
+
return (
|
|
322
|
+
<ToolParamField
|
|
323
|
+
key={field.name}
|
|
324
|
+
field={field}
|
|
325
|
+
value={instance.params[field.name]}
|
|
326
|
+
onChange={(value) => {
|
|
327
|
+
onUpdate(instance.instanceId, {
|
|
328
|
+
params: { ...instance.params, [field.name]: value },
|
|
329
|
+
});
|
|
330
|
+
}}
|
|
331
|
+
aiChosen={isAiChosen}
|
|
332
|
+
onAiChosenChange={(enabled) => {
|
|
333
|
+
const updatedModes = { ...aiChosenModes, [field.name]: enabled };
|
|
334
|
+
onUpdate(instance.instanceId, {
|
|
335
|
+
params: { ...instance.params, _aiChosenModes: updatedModes },
|
|
336
|
+
});
|
|
337
|
+
}}
|
|
338
|
+
onAddCredential={handleAddCredential}
|
|
339
|
+
/>
|
|
340
|
+
);
|
|
341
|
+
})}
|
|
342
|
+
</div>
|
|
343
|
+
)}
|
|
344
|
+
|
|
345
|
+
{tool.nodeType && paramFields.length === 0 && (
|
|
346
|
+
<p className="text-sm italic text-muted-foreground">
|
|
347
|
+
This tool has no configurable parameters.
|
|
348
|
+
</p>
|
|
349
|
+
)}
|
|
350
|
+
|
|
351
|
+
{/* Documentation link */}
|
|
352
|
+
{tool.docsUrl && (
|
|
353
|
+
<a
|
|
354
|
+
href={tool.docsUrl}
|
|
355
|
+
target="_blank"
|
|
356
|
+
rel="noopener noreferrer"
|
|
357
|
+
className="inline-flex items-center gap-1.5 text-sm text-primary hover:underline"
|
|
358
|
+
>
|
|
359
|
+
<ExternalLink className="w-3 h-3" />
|
|
360
|
+
View Documentation
|
|
361
|
+
</a>
|
|
362
|
+
)}
|
|
363
|
+
|
|
364
|
+
{/* Input Schema */}
|
|
365
|
+
{tool.inputSchema && (
|
|
366
|
+
<div>
|
|
367
|
+
<button
|
|
368
|
+
onClick={() => setShowSchema(!showSchema)}
|
|
369
|
+
className="flex items-center gap-2 text-xs font-medium transition-colors hover:text-primary"
|
|
370
|
+
>
|
|
371
|
+
{showSchema ? (
|
|
372
|
+
<ChevronUp className="w-3 h-3" />
|
|
373
|
+
) : (
|
|
374
|
+
<ChevronDown className="w-3 h-3" />
|
|
375
|
+
)}
|
|
376
|
+
Effective Input Schema
|
|
377
|
+
</button>
|
|
378
|
+
{showSchema && (
|
|
379
|
+
<div className="p-2 mt-2 overflow-auto rounded-lg bg-muted/50">
|
|
380
|
+
{effectiveInputSchema &&
|
|
381
|
+
'_staticParams' in effectiveInputSchema &&
|
|
382
|
+
(effectiveInputSchema as { _staticParams?: string[] })._staticParams && (
|
|
383
|
+
<div className="pb-2 mb-2 text-[10px] border-b text-muted-foreground">
|
|
384
|
+
<span className="font-medium">Static params (not sent to AI): </span>
|
|
385
|
+
{(
|
|
386
|
+
(effectiveInputSchema as { _staticParams?: string[] })._staticParams ??
|
|
387
|
+
[]
|
|
388
|
+
).join(', ')}
|
|
389
|
+
</div>
|
|
390
|
+
)}
|
|
391
|
+
<pre className="text-[10px] whitespace-pre-wrap text-muted-foreground">
|
|
392
|
+
{JSON.stringify(effectiveInputSchema, null, 2)}
|
|
393
|
+
</pre>
|
|
394
|
+
</div>
|
|
395
|
+
)}
|
|
396
|
+
</div>
|
|
397
|
+
)}
|
|
398
|
+
|
|
399
|
+
{/* Tool ID */}
|
|
400
|
+
<div className="pt-2 border-t">
|
|
401
|
+
<div className="text-[10px] text-muted-foreground">
|
|
402
|
+
Tool ID: <code className="bg-muted px-1 py-0.5 rounded">{tool.id}</code>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
</div>
|
|
406
|
+
</ScrollArea>
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
{/* Regular credential creation modal */}
|
|
410
|
+
<CreateCredentialModal
|
|
411
|
+
open={isCreateCredentialOpen}
|
|
412
|
+
onClose={handleCloseCredentialModal}
|
|
413
|
+
onSubmit={handleCreateCredential}
|
|
414
|
+
isLoading={createCredentialMutation.isPending}
|
|
415
|
+
portalContainer={portalContainer}
|
|
416
|
+
/>
|
|
417
|
+
|
|
418
|
+
{/* OAuth2 provider selector modal */}
|
|
419
|
+
<OAuth2ProviderSelector
|
|
420
|
+
open={isOAuth2SelectorOpen}
|
|
421
|
+
onOpenChange={(open) => {
|
|
422
|
+
if (!open) {
|
|
423
|
+
handleCloseOAuth2Selector();
|
|
424
|
+
}
|
|
425
|
+
}}
|
|
426
|
+
onCredentialCreated={handleCredentialCreated}
|
|
427
|
+
portalContainer={portalContainer}
|
|
428
|
+
filterProviders={activeOAuth2Providers ?? undefined}
|
|
429
|
+
/>
|
|
430
|
+
</>
|
|
431
|
+
);
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
ToolConfigPanel.displayName = 'ToolConfigPanel';
|