@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
package/package.json
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@invect/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Complete React components and routes for Invect workflow management",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"components",
|
|
7
|
+
"frontend",
|
|
8
|
+
"invect",
|
|
9
|
+
"react",
|
|
10
|
+
"react-router",
|
|
11
|
+
"typescript",
|
|
12
|
+
"workflow"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://invect.dev",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/robase/invect/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "robase <team@invect.dev>",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/robase/invect.git",
|
|
23
|
+
"directory": "pkg/ui"
|
|
24
|
+
},
|
|
25
|
+
"style": "dist/index.css",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist/**/*",
|
|
28
|
+
"!dist/**/*.map",
|
|
29
|
+
"src/**/*"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"main": "dist/index.js",
|
|
33
|
+
"module": "dist/index.js",
|
|
34
|
+
"types": "dist/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js",
|
|
39
|
+
"require": "./dist/index.js",
|
|
40
|
+
"default": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./demo": {
|
|
43
|
+
"types": "./dist/demo/index.d.ts",
|
|
44
|
+
"import": "./dist/demo.js",
|
|
45
|
+
"default": "./dist/demo.js"
|
|
46
|
+
},
|
|
47
|
+
"./styles": "./dist/index.css",
|
|
48
|
+
"./package.json": "./package.json"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@codemirror/autocomplete": "^6.20.0",
|
|
55
|
+
"@codemirror/commands": "^6.10.0",
|
|
56
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
57
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
58
|
+
"@codemirror/language": "^6.11.3",
|
|
59
|
+
"@codemirror/lint": "^6.9.2",
|
|
60
|
+
"@codemirror/state": "^6.5.2",
|
|
61
|
+
"@codemirror/view": "^6.38.8",
|
|
62
|
+
"@fsegurai/codemirror-theme-vscode-dark": "^6.2.4",
|
|
63
|
+
"@fsegurai/codemirror-theme-vscode-light": "^6.2.4",
|
|
64
|
+
"@lezer/highlight": "^1.2.3",
|
|
65
|
+
"@radix-ui/react-accordion": "^1.2.12",
|
|
66
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
67
|
+
"@radix-ui/react-collapsible": "^1.1.3",
|
|
68
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
69
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
70
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
71
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
72
|
+
"@radix-ui/react-slider": "^1.3.6",
|
|
73
|
+
"cmdk": "^1.1.1",
|
|
74
|
+
"codemirror": "^6.0.2",
|
|
75
|
+
"nanoid": "^5.1.6",
|
|
76
|
+
"prettier": "^3.8.1",
|
|
77
|
+
"react-markdown": "^10.1.0",
|
|
78
|
+
"react-resizable-panels": "^3.0.6",
|
|
79
|
+
"remark-gfm": "^4.0.1",
|
|
80
|
+
"zustand": "^5.0.9",
|
|
81
|
+
"@invect/core": "0.0.1",
|
|
82
|
+
"@invect/layouts": "0.0.1"
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
86
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
87
|
+
"@radix-ui/react-separator": "^1.1.7",
|
|
88
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
89
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
90
|
+
"@tailwindcss/postcss": "^4.1.0",
|
|
91
|
+
"@tanstack/react-query": "^5.83.0",
|
|
92
|
+
"@types/node": "^24.0.13",
|
|
93
|
+
"@types/react": "18.3.7",
|
|
94
|
+
"@types/react-dom": "^18.3.7",
|
|
95
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
96
|
+
"@xyflow/react": "^12.9.2",
|
|
97
|
+
"autoprefixer": "^10.4.21",
|
|
98
|
+
"class-variance-authority": "^0.7.1",
|
|
99
|
+
"clsx": "^2.1.1",
|
|
100
|
+
"json-logic-js": "^2.0.5",
|
|
101
|
+
"lucide-react": "^0.525.0",
|
|
102
|
+
"postcss": "^8.5.6",
|
|
103
|
+
"postcss-nested": "^7.0.2",
|
|
104
|
+
"react-router": "^7.6.3",
|
|
105
|
+
"react-router-dom": "^7.6.3",
|
|
106
|
+
"tailwind-merge": "^3.3.1",
|
|
107
|
+
"tailwindcss": "^4.1.0",
|
|
108
|
+
"tw-animate-css": "^1.4.0",
|
|
109
|
+
"typescript": "^5.8.3",
|
|
110
|
+
"vite": "^8.0.0",
|
|
111
|
+
"vite-plugin-dts": "^4.5.4",
|
|
112
|
+
"vitest": "^3.2.4"
|
|
113
|
+
},
|
|
114
|
+
"peerDependencies": {
|
|
115
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
116
|
+
"react-dom": "^18.3.1 || ^19.0.0"
|
|
117
|
+
},
|
|
118
|
+
"scripts": {
|
|
119
|
+
"build": "vite build",
|
|
120
|
+
"build:dev": "vite build --watch --mode development --emptyOutDir false",
|
|
121
|
+
"dev": "vite build --watch --mode development --emptyOutDir false",
|
|
122
|
+
"typecheck": "tsc --noEmit",
|
|
123
|
+
"typecheck:watch": "tsc --noEmit --watch",
|
|
124
|
+
"lint": "oxlint --fix",
|
|
125
|
+
"clean": "rm -rf dist",
|
|
126
|
+
"format": "oxfmt",
|
|
127
|
+
"test": "vitest run",
|
|
128
|
+
"test:watch": "vitest"
|
|
129
|
+
}
|
|
130
|
+
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
package/src/Invect.tsx
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
+
import {
|
|
4
|
+
Route,
|
|
5
|
+
Routes,
|
|
6
|
+
Outlet,
|
|
7
|
+
BrowserRouter,
|
|
8
|
+
MemoryRouter,
|
|
9
|
+
useInRouterContext,
|
|
10
|
+
} from 'react-router';
|
|
11
|
+
import { ValidationProvider } from './contexts/ValidationContext';
|
|
12
|
+
import { ApiProvider } from './contexts/ApiContext';
|
|
13
|
+
import { ThemeProvider, useOptionalTheme } from './contexts/ThemeProvider';
|
|
14
|
+
import { NodeRegistryProvider } from './contexts/NodeRegistryContext';
|
|
15
|
+
import { PluginRegistryProvider } from './contexts/PluginRegistryContext';
|
|
16
|
+
import type { InvectFrontendPlugin } from './types/plugin.types';
|
|
17
|
+
import { Home } from './routes/home';
|
|
18
|
+
import { AllFlowRuns } from './routes/all-flow-runs';
|
|
19
|
+
import { Flow } from './routes/flow';
|
|
20
|
+
import { FlowRuns } from './routes/flow-runs';
|
|
21
|
+
import { Credentials } from './routes/credentials';
|
|
22
|
+
import { FlowRouteLayout } from './routes/flow-route-layout';
|
|
23
|
+
import type { ApiClient } from './api/client';
|
|
24
|
+
import './app.css';
|
|
25
|
+
import { AppSideMenu } from './components/side-menu/side-menu';
|
|
26
|
+
|
|
27
|
+
export interface InvectProps {
|
|
28
|
+
reactQueryClient?: QueryClient;
|
|
29
|
+
apiBaseUrl?: string;
|
|
30
|
+
basePath?: string;
|
|
31
|
+
useMemoryRouter?: boolean; // Use MemoryRouter instead of BrowserRouter (useful for testing)
|
|
32
|
+
/** Frontend plugins that contribute sidebar items, routes, panel tabs, header actions, etc. */
|
|
33
|
+
plugins?: InvectFrontendPlugin[];
|
|
34
|
+
/** Pre-configured API client instance (e.g. for demo mode). When provided, apiBaseUrl is ignored. */
|
|
35
|
+
apiClient?: ApiClient;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Create a default QueryClient if none is provided
|
|
39
|
+
const createDefaultQueryClient = () =>
|
|
40
|
+
new QueryClient({
|
|
41
|
+
defaultOptions: {
|
|
42
|
+
queries: {
|
|
43
|
+
staleTime: 5 * 60 * 1000, // 5 minutes
|
|
44
|
+
retry: 3,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Layout component that provides the QueryClient context to all child routes
|
|
51
|
+
*/
|
|
52
|
+
const InvectLayout = React.memo(
|
|
53
|
+
({
|
|
54
|
+
client,
|
|
55
|
+
apiBaseUrl,
|
|
56
|
+
apiClient,
|
|
57
|
+
basePath,
|
|
58
|
+
plugins,
|
|
59
|
+
}: {
|
|
60
|
+
client: QueryClient;
|
|
61
|
+
apiBaseUrl?: string;
|
|
62
|
+
apiClient?: ApiClient;
|
|
63
|
+
basePath?: string;
|
|
64
|
+
plugins?: InvectFrontendPlugin[];
|
|
65
|
+
}) => {
|
|
66
|
+
const themeContext = useOptionalTheme();
|
|
67
|
+
|
|
68
|
+
const content = (
|
|
69
|
+
<QueryClientProvider client={client}>
|
|
70
|
+
<ApiProvider baseURL={apiBaseUrl} apiClient={apiClient}>
|
|
71
|
+
<PluginRegistryProvider plugins={plugins ?? []}>
|
|
72
|
+
<ValidationProvider>
|
|
73
|
+
<NodeRegistryProvider>
|
|
74
|
+
<div className="imp-shell flex w-full h-screen font-sans antialiased bg-imp-background text-imp-foreground">
|
|
75
|
+
<AppSideMenu basePath={basePath} />
|
|
76
|
+
<div className="imp-page flex flex-1 h-full min-w-0 min-h-0 bg-imp-background">
|
|
77
|
+
<Outlet />
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</NodeRegistryProvider>
|
|
81
|
+
</ValidationProvider>
|
|
82
|
+
</PluginRegistryProvider>
|
|
83
|
+
</ApiProvider>
|
|
84
|
+
</QueryClientProvider>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
if (themeContext) {
|
|
88
|
+
return content;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<ThemeProvider defaultTheme="dark" storageKey="invect-ui-theme">
|
|
93
|
+
{content}
|
|
94
|
+
</ThemeProvider>
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
InvectLayout.displayName = 'InvectLayout';
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Detect whether we are already inside a React Router context.
|
|
103
|
+
* Returns false in non-Router environments (Next.js, plain React, etc.)
|
|
104
|
+
*/
|
|
105
|
+
function useHasRouterContext(): boolean {
|
|
106
|
+
try {
|
|
107
|
+
return useInRouterContext();
|
|
108
|
+
} catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Inner component that renders the Routes — must be inside a Router context
|
|
115
|
+
*/
|
|
116
|
+
const InvectRoutes = React.memo(
|
|
117
|
+
({
|
|
118
|
+
client,
|
|
119
|
+
apiBaseUrl,
|
|
120
|
+
apiClient,
|
|
121
|
+
basePath,
|
|
122
|
+
plugins,
|
|
123
|
+
}: {
|
|
124
|
+
client: QueryClient;
|
|
125
|
+
apiBaseUrl: string;
|
|
126
|
+
apiClient?: ApiClient;
|
|
127
|
+
basePath: string;
|
|
128
|
+
plugins?: InvectFrontendPlugin[];
|
|
129
|
+
}) => {
|
|
130
|
+
// Collect plugin routes
|
|
131
|
+
const pluginRoutes = (plugins ?? []).flatMap((p) => p.routes ?? []);
|
|
132
|
+
const topLevelPluginRoutes = pluginRoutes.filter((r) => !r.flowScoped);
|
|
133
|
+
const flowScopedPluginRoutes = pluginRoutes.filter((r) => r.flowScoped);
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div className="flex-1 w-full h-full min-h-0">
|
|
137
|
+
<Routes>
|
|
138
|
+
<Route
|
|
139
|
+
path={basePath}
|
|
140
|
+
element={
|
|
141
|
+
<InvectLayout
|
|
142
|
+
client={client}
|
|
143
|
+
apiBaseUrl={apiBaseUrl}
|
|
144
|
+
apiClient={apiClient}
|
|
145
|
+
basePath={basePath}
|
|
146
|
+
plugins={plugins}
|
|
147
|
+
/>
|
|
148
|
+
}
|
|
149
|
+
>
|
|
150
|
+
<Route index element={<Home basePath={basePath} />} />
|
|
151
|
+
<Route path="credentials" element={<Credentials basePath={basePath} />} />
|
|
152
|
+
<Route path="flow-runs" element={<AllFlowRuns basePath={basePath} />} />
|
|
153
|
+
{/* Flow-scoped layout with header */}
|
|
154
|
+
<Route path="flow/:flowId" element={<FlowRouteLayout basePath={basePath} />}>
|
|
155
|
+
<Route index element={<Flow basePath={basePath} />} />
|
|
156
|
+
<Route path="runs" element={<FlowRuns basePath={basePath} />} />
|
|
157
|
+
{/* Plugin flow-scoped routes */}
|
|
158
|
+
{flowScopedPluginRoutes.map((route) => (
|
|
159
|
+
<Route
|
|
160
|
+
key={route.path}
|
|
161
|
+
path={route.path.replace(/^\//, '')}
|
|
162
|
+
element={<route.component basePath={basePath} />}
|
|
163
|
+
/>
|
|
164
|
+
))}
|
|
165
|
+
</Route>
|
|
166
|
+
{/* Plugin top-level routes */}
|
|
167
|
+
{topLevelPluginRoutes.map((route) => (
|
|
168
|
+
<Route
|
|
169
|
+
key={route.path}
|
|
170
|
+
path={route.path.replace(/^\//, '')}
|
|
171
|
+
element={<route.component basePath={basePath} />}
|
|
172
|
+
/>
|
|
173
|
+
))}
|
|
174
|
+
</Route>
|
|
175
|
+
</Routes>
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
},
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
InvectRoutes.displayName = 'InvectRoutes';
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Complete Invect component with internal routing
|
|
185
|
+
* Use this for standalone applications or when mounting Invect at a specific route
|
|
186
|
+
*
|
|
187
|
+
* Automatically wraps in a BrowserRouter if no Router context is detected
|
|
188
|
+
* (e.g. when used inside Next.js or other non-React-Router frameworks).
|
|
189
|
+
* Pass useMemoryRouter=true to use MemoryRouter instead (useful for testing).
|
|
190
|
+
*
|
|
191
|
+
* For integration into existing React Router apps, use createInvectRoutes instead
|
|
192
|
+
*/
|
|
193
|
+
export const Invect = React.memo(
|
|
194
|
+
({
|
|
195
|
+
reactQueryClient,
|
|
196
|
+
apiBaseUrl = 'http://localhost:3000/invect',
|
|
197
|
+
basePath = '/invect',
|
|
198
|
+
useMemoryRouter = false,
|
|
199
|
+
plugins,
|
|
200
|
+
apiClient,
|
|
201
|
+
}: InvectProps) => {
|
|
202
|
+
const client = reactQueryClient || createDefaultQueryClient();
|
|
203
|
+
const hasRouter = useHasRouterContext();
|
|
204
|
+
|
|
205
|
+
const routes = (
|
|
206
|
+
<InvectRoutes
|
|
207
|
+
client={client}
|
|
208
|
+
apiBaseUrl={apiBaseUrl}
|
|
209
|
+
apiClient={apiClient}
|
|
210
|
+
basePath={basePath}
|
|
211
|
+
plugins={plugins}
|
|
212
|
+
/>
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
// If already inside a Router (e.g. Vite + React Router app), render routes directly.
|
|
216
|
+
// Otherwise, wrap in an appropriate Router for the environment.
|
|
217
|
+
if (hasRouter) {
|
|
218
|
+
return routes;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (useMemoryRouter) {
|
|
222
|
+
return <MemoryRouter initialEntries={[basePath]}>{routes}</MemoryRouter>;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return <BrowserRouter>{routes}</BrowserRouter>;
|
|
226
|
+
},
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
Invect.displayName = 'Invect';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InvectShell — Lightweight CSS scope + theme wrapper.
|
|
3
|
+
*
|
|
4
|
+
* Establishes the `.invect` CSS scope so that all `imp-*` theme
|
|
5
|
+
* tokens and Tailwind utilities work inside it. Use this when you
|
|
6
|
+
* need Invect theming around content that renders OUTSIDE the
|
|
7
|
+
* full `<Invect />` component — for example, auth gates, plugin
|
|
8
|
+
* UIs, or custom landing pages.
|
|
9
|
+
*
|
|
10
|
+
* Does NOT include routing, sidebar, API providers, or any of the
|
|
11
|
+
* full Invect app shell. For the full app, use `<Invect />`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { InvectShell } from '@invect/ui';
|
|
16
|
+
* import '@invect/ui/styles';
|
|
17
|
+
*
|
|
18
|
+
* function AuthPage() {
|
|
19
|
+
* return (
|
|
20
|
+
* <InvectShell>
|
|
21
|
+
* <MySignInForm />
|
|
22
|
+
* </InvectShell>
|
|
23
|
+
* );
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import React, { type ReactNode } from 'react';
|
|
29
|
+
import { ThemeProvider } from './contexts/ThemeProvider';
|
|
30
|
+
import './app.css';
|
|
31
|
+
|
|
32
|
+
export interface InvectShellProps {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Theme mode. 'system' follows OS preference.
|
|
36
|
+
* @default 'dark'
|
|
37
|
+
*/
|
|
38
|
+
theme?: 'light' | 'dark' | 'system';
|
|
39
|
+
/**
|
|
40
|
+
* Additional class names on the shell container.
|
|
41
|
+
*/
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const InvectShell = React.memo(
|
|
46
|
+
({ children, theme = 'dark', className }: InvectShellProps) => {
|
|
47
|
+
return (
|
|
48
|
+
<ThemeProvider defaultTheme={theme} storageKey="invect-ui-theme" className={className}>
|
|
49
|
+
{children}
|
|
50
|
+
</ThemeProvider>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
InvectShell.displayName = 'InvectShell';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Agent tools React Query hooks
|
|
2
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { useApiClient } from '../contexts/ApiContext';
|
|
4
|
+
import { queryKeys } from './query-keys';
|
|
5
|
+
|
|
6
|
+
export function useAgentTools() {
|
|
7
|
+
const apiClient = useApiClient();
|
|
8
|
+
|
|
9
|
+
return useQuery({
|
|
10
|
+
queryKey: queryKeys.agentTools,
|
|
11
|
+
queryFn: () => apiClient.getAgentTools(),
|
|
12
|
+
staleTime: 1000 * 60 * 30, // 30 minutes - tools don't change often
|
|
13
|
+
retry: (failureCount, error) => {
|
|
14
|
+
if (failureCount >= 2) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
if (error instanceof Error && error.message.includes('4')) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|