@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.
Files changed (419) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -0
  3. package/dist/Invect-CWpIwZ5F.js +92738 -0
  4. package/dist/Invect.d.ts +25 -0
  5. package/dist/InvectShell.d.ts +14 -0
  6. package/dist/api/agent-tools.api.d.ts +1 -0
  7. package/dist/api/client.d.ts +207 -0
  8. package/dist/api/credentials.api.d.ts +47 -0
  9. package/dist/api/executions.api.d.ts +43 -0
  10. package/dist/api/flows.api.d.ts +100 -0
  11. package/dist/api/index.d.ts +9 -0
  12. package/dist/api/node-data.api.d.ts +66 -0
  13. package/dist/api/query-keys.d.ts +22 -0
  14. package/dist/api/triggers.api.d.ts +44 -0
  15. package/dist/api/types.d.ts +147 -0
  16. package/dist/api/use-flow-run-stream.d.ts +12 -0
  17. package/dist/assets/invect-branding.d.ts +4 -0
  18. package/dist/assets/provider-icons/index.d.ts +8 -0
  19. package/dist/babel-C9OtljFZ.js +9721 -0
  20. package/dist/components/PageLayout.d.ts +17 -0
  21. package/dist/components/chat/ChatInput.d.ts +17 -0
  22. package/dist/components/chat/ChatMessageList.d.ts +14 -0
  23. package/dist/components/chat/ChatModelSelector.d.ts +11 -0
  24. package/dist/components/chat/ChatPanel.d.ts +19 -0
  25. package/dist/components/chat/ChatPromptOverlay.d.ts +13 -0
  26. package/dist/components/chat/ChatProviderSelector.d.ts +9 -0
  27. package/dist/components/chat/ChatSettingsPanel.d.ts +11 -0
  28. package/dist/components/chat/InlineCredentialSetup.d.ts +9 -0
  29. package/dist/components/chat/MarkdownRenderer.d.ts +7 -0
  30. package/dist/components/chat/chat-memory.d.ts +21 -0
  31. package/dist/components/chat/chat.store.d.ts +416 -0
  32. package/dist/components/chat/index.d.ts +5 -0
  33. package/dist/components/chat/use-chat.d.ts +28 -0
  34. package/dist/components/credentials/CreateCredentialModal.d.ts +13 -0
  35. package/dist/components/credentials/CredentialDetailDialog.d.ts +17 -0
  36. package/dist/components/credentials/EditCredentialModal.d.ts +11 -0
  37. package/dist/components/credentials/OAuth2ConnectButton.d.ts +38 -0
  38. package/dist/components/credentials/OAuth2ProviderSelector.d.ts +15 -0
  39. package/dist/components/credentials/credential-utils.d.ts +12 -0
  40. package/dist/components/credentials/index.d.ts +9 -0
  41. package/dist/components/dashboard/FailedRunsAlert.d.ts +3 -0
  42. package/dist/components/dashboard/FlowCard.d.ts +7 -0
  43. package/dist/components/dashboard/RecentActivityTable.d.ts +9 -0
  44. package/dist/components/dashboard/StatCard.d.ts +10 -0
  45. package/dist/components/dashboard/index.d.ts +5 -0
  46. package/dist/components/dashboard/status-helpers.d.ts +5 -0
  47. package/dist/components/flow-editor/ActionsSidebar.d.ts +2 -0
  48. package/dist/components/flow-editor/FlowEditor.d.ts +21 -0
  49. package/dist/components/flow-editor/FlowHeader.d.ts +9 -0
  50. package/dist/components/flow-editor/FlowLayout.d.ts +24 -0
  51. package/dist/components/flow-editor/ModeSwitcher.d.ts +7 -0
  52. package/dist/components/flow-editor/NodeSidebar.d.ts +24 -0
  53. package/dist/components/flow-editor/RunControls.d.ts +12 -0
  54. package/dist/components/flow-editor/ToolConfigPanel.d.ts +16 -0
  55. package/dist/components/flow-editor/ValidationPanel.d.ts +5 -0
  56. package/dist/components/flow-editor/flow-editor.store.d.ts +1 -0
  57. package/dist/components/flow-editor/index.d.ts +6 -0
  58. package/dist/components/flow-editor/inline-edit.d.ts +10 -0
  59. package/dist/components/flow-editor/node-config-panel/ConfigFieldWithTemplate.d.ts +26 -0
  60. package/dist/components/flow-editor/node-config-panel/CredentialCombobox.d.ts +21 -0
  61. package/dist/components/flow-editor/node-config-panel/CredentialsSection.d.ts +19 -0
  62. package/dist/components/flow-editor/node-config-panel/DroppableInput.d.ts +20 -0
  63. package/dist/components/flow-editor/node-config-panel/DynamicSelectField.d.ts +22 -0
  64. package/dist/components/flow-editor/node-config-panel/JsonPreviewPanel.d.ts +25 -0
  65. package/dist/components/flow-editor/node-config-panel/NodeConfigPanel.d.ts +14 -0
  66. package/dist/components/flow-editor/node-config-panel/NodeConfigPanelHeader.d.ts +15 -0
  67. package/dist/components/flow-editor/node-config-panel/ParametersSection.d.ts +16 -0
  68. package/dist/components/flow-editor/node-config-panel/SearchableSelectField.d.ts +17 -0
  69. package/dist/components/flow-editor/node-config-panel/SwitchCasesField.d.ts +18 -0
  70. package/dist/components/flow-editor/node-config-panel/hooks/index.d.ts +2 -0
  71. package/dist/components/flow-editor/node-config-panel/hooks/use-node-config-panel-state.d.ts +24 -0
  72. package/dist/components/flow-editor/node-config-panel/hooks/use-node-execution.d.ts +46 -0
  73. package/dist/components/flow-editor/node-config-panel/hooks/use-upstream-slots.d.ts +16 -0
  74. package/dist/components/flow-editor/node-config-panel/panels/AgentToolsPanel.d.ts +18 -0
  75. package/dist/components/flow-editor/node-config-panel/panels/ConfigurationPanel.d.ts +49 -0
  76. package/dist/components/flow-editor/node-config-panel/panels/DataMapperPane.d.ts +40 -0
  77. package/dist/components/flow-editor/node-config-panel/panels/InputPanel.d.ts +49 -0
  78. package/dist/components/flow-editor/node-config-panel/panels/OutputPanel.d.ts +7 -0
  79. package/dist/components/flow-editor/node-config-panel/panels/index.d.ts +4 -0
  80. package/dist/components/flow-editor/node-config-panel/types.d.ts +19 -0
  81. package/dist/components/flow-editor/node-config-panel/use-node-config-panel-store.d.ts +49 -0
  82. package/dist/components/flow-editor/node-config-panel/use-node-config-state.d.ts +26 -0
  83. package/dist/components/flow-editor/node-config-panel/use-run-node.d.ts +16 -0
  84. package/dist/components/flow-editor/node-config-panel/utils.d.ts +9 -0
  85. package/dist/components/flow-editor/serialize-to-sdk.d.ts +20 -0
  86. package/dist/components/flow-editor/toolbar-context.d.ts +2 -0
  87. package/dist/components/flow-editor/use-copy-paste.d.ts +7 -0
  88. package/dist/components/flow-editor/use-copy-paste.types.d.ts +38 -0
  89. package/dist/components/flow-editor/use-flow-editor.d.ts +44 -0
  90. package/dist/components/flow-runs-table/FlowRunsTable.d.ts +6 -0
  91. package/dist/components/flow-runs-table/index.d.ts +1 -0
  92. package/dist/components/flow-viewer/FlowRunsView.d.ts +7 -0
  93. package/dist/components/flow-viewer/FlowStatusView.d.ts +21 -0
  94. package/dist/components/flow-viewer/RunSelector.d.ts +13 -0
  95. package/dist/components/flow-viewer/RunsSidebar.d.ts +14 -0
  96. package/dist/components/flow-viewer/agent-tool-executions-list.d.ts +7 -0
  97. package/dist/components/flow-viewer/index.d.ts +1 -0
  98. package/dist/components/flow-viewer/logs-panel.d.ts +18 -0
  99. package/dist/components/flow-viewer/use-execution-log-data.d.ts +113 -0
  100. package/dist/components/graph/BatchFlowEdge.d.ts +33 -0
  101. package/dist/components/graph/LayoutSelector.d.ts +9 -0
  102. package/dist/components/graph/index.d.ts +47 -0
  103. package/dist/components/graph/styleUtils.d.ts +124 -0
  104. package/dist/components/nodes/AgentConfigPanel.d.ts +24 -0
  105. package/dist/components/nodes/AgentNode.d.ts +8 -0
  106. package/dist/components/nodes/AgentToolsBox.d.ts +41 -0
  107. package/dist/components/nodes/NodeAppendix.d.ts +19 -0
  108. package/dist/components/nodes/NodeStatusIndicator.d.ts +30 -0
  109. package/dist/components/nodes/NodeViewContext.d.ts +18 -0
  110. package/dist/components/nodes/ToolParamField.d.ts +28 -0
  111. package/dist/components/nodes/ToolSelectorModal.d.ts +80 -0
  112. package/dist/components/nodes/ToolSelectorParts.d.ts +30 -0
  113. package/dist/components/nodes/UniversalNode.d.ts +2 -0
  114. package/dist/components/nodes/createContextAwareNodes.d.ts +6 -0
  115. package/dist/components/nodes/index.d.ts +22 -0
  116. package/dist/components/nodes/nodeRegistry.d.ts +13 -0
  117. package/dist/components/nodes/withNodeContext.d.ts +7 -0
  118. package/dist/components/shared/InvectLoader.d.ts +8 -0
  119. package/dist/components/shared/InvectLogo.d.ts +9 -0
  120. package/dist/components/shared/ProviderIcon.d.ts +23 -0
  121. package/dist/components/side-menu/side-menu.d.ts +4 -0
  122. package/dist/components/sidebar/BaseSidebar.d.ts +17 -0
  123. package/dist/components/sidebar/index.d.ts +1 -0
  124. package/dist/components/triggers/CronPreview.d.ts +12 -0
  125. package/dist/components/triggers/index.d.ts +1 -0
  126. package/dist/components/ui/alert-dialog.d.ts +18 -0
  127. package/dist/components/ui/badge.d.ts +9 -0
  128. package/dist/components/ui/button.d.ts +13 -0
  129. package/dist/components/ui/card.d.ts +9 -0
  130. package/dist/components/ui/codemirror-js-editor.d.ts +25 -0
  131. package/dist/components/ui/codemirror-json-editor.d.ts +18 -0
  132. package/dist/components/ui/codemirror-nunjucks-editor.d.ts +13 -0
  133. package/dist/components/ui/codemirror-vscode-theme.d.ts +24 -0
  134. package/dist/components/ui/collapsible.d.ts +6 -0
  135. package/dist/components/ui/command.d.ts +18 -0
  136. package/dist/components/ui/dialog.d.ts +18 -0
  137. package/dist/components/ui/dropdown-menu.d.ts +25 -0
  138. package/dist/components/ui/empty-state.d.ts +21 -0
  139. package/dist/components/ui/input.d.ts +3 -0
  140. package/dist/components/ui/label.d.ts +4 -0
  141. package/dist/components/ui/popover.d.ts +10 -0
  142. package/dist/components/ui/resizable.d.ts +8 -0
  143. package/dist/components/ui/scroll-area.d.ts +5 -0
  144. package/dist/components/ui/select.d.ts +18 -0
  145. package/dist/components/ui/separator.d.ts +4 -0
  146. package/dist/components/ui/slider.d.ts +4 -0
  147. package/dist/components/ui/switch.d.ts +3 -0
  148. package/dist/components/ui/table.d.ts +10 -0
  149. package/dist/components/ui/textarea.d.ts +3 -0
  150. package/dist/components/ui/tooltip.d.ts +7 -0
  151. package/dist/components/ui/tree-view.d.ts +107 -0
  152. package/dist/contexts/AgentToolCallbacksContext.d.ts +23 -0
  153. package/dist/contexts/ApiContext.d.ts +11 -0
  154. package/dist/contexts/FlowDataContext.d.ts +9 -0
  155. package/dist/contexts/NodeRegistryContext.d.ts +14 -0
  156. package/dist/contexts/PluginRegistryContext.d.ts +39 -0
  157. package/dist/contexts/ThemeProvider.d.ts +18 -0
  158. package/dist/contexts/ValidationContext.d.ts +22 -0
  159. package/dist/demo/DemoInvect.d.ts +11 -0
  160. package/dist/demo/FlowViewer.d.ts +31 -0
  161. package/dist/demo/demo-api-client.d.ts +33 -0
  162. package/dist/demo/index.d.ts +6 -0
  163. package/dist/demo/sample-data.d.ts +1538 -0
  164. package/dist/demo.d.ts +2 -0
  165. package/dist/demo.js +2774 -0
  166. package/dist/estree-ClbRfS-1.js +7076 -0
  167. package/dist/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
  168. package/dist/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
  169. package/dist/fonts/geist-latin-wght-normal.woff2 +0 -0
  170. package/dist/fonts/iosevka-latin-400-normal.woff2 +0 -0
  171. package/dist/hooks/index.d.ts +1 -0
  172. package/dist/hooks/use-document-title.d.ts +1 -0
  173. package/dist/hooks/use-flow-data.d.ts +22 -0
  174. package/dist/hooks/use-invect-portal-class.d.ts +21 -0
  175. package/dist/hooks/useFlowEditorStore.d.ts +1 -0
  176. package/dist/index.css +3 -0
  177. package/dist/index.d.ts +22 -0
  178. package/dist/index.js +717 -0
  179. package/dist/lib/utils.d.ts +2 -0
  180. package/dist/prettier.d.ts +13 -0
  181. package/dist/routes/all-flow-runs.d.ts +5 -0
  182. package/dist/routes/credentials.d.ts +5 -0
  183. package/dist/routes/flow-route-layout.d.ts +19 -0
  184. package/dist/routes/flow-runs.d.ts +5 -0
  185. package/dist/routes/flow.d.ts +5 -0
  186. package/dist/routes/home.d.ts +5 -0
  187. package/dist/services/index.d.ts +1 -0
  188. package/dist/standalone-C3Df7W52.js +3463 -0
  189. package/dist/stores/executionViewStore.d.ts +64 -0
  190. package/dist/stores/flow-editor.store.d.ts +137 -0
  191. package/dist/stores/flowEditorStore.d.ts +1 -0
  192. package/dist/stores/index.d.ts +2 -0
  193. package/dist/stores/uiStore.d.ts +45 -0
  194. package/dist/types/agent-tools.types.d.ts +53 -0
  195. package/dist/types/index.d.ts +2 -0
  196. package/dist/types/node-definition.types.d.ts +85 -0
  197. package/dist/types/plugin.types.d.ts +100 -0
  198. package/dist/utils/credentialBranding.d.ts +8 -0
  199. package/dist/utils/credentialFiltering.d.ts +20 -0
  200. package/dist/utils/flowTransformations.d.ts +16 -0
  201. package/dist/utils/layoutUtils.d.ts +23 -0
  202. package/dist/utils/nodeReferenceUtils.d.ts +37 -0
  203. package/dist/vendor.d.ts +5 -0
  204. package/package.json +130 -0
  205. package/src/.DS_Store +0 -0
  206. package/src/Invect.tsx +229 -0
  207. package/src/InvectShell.tsx +55 -0
  208. package/src/api/agent-tools.api.ts +23 -0
  209. package/src/api/client.ts +899 -0
  210. package/src/api/credentials.api.ts +197 -0
  211. package/src/api/executions.api.ts +228 -0
  212. package/src/api/flows.api.ts +195 -0
  213. package/src/api/index.ts +17 -0
  214. package/src/api/node-data.api.ts +167 -0
  215. package/src/api/query-keys.ts +44 -0
  216. package/src/api/triggers.api.ts +120 -0
  217. package/src/api/types.ts +212 -0
  218. package/src/api/use-flow-run-stream.ts +206 -0
  219. package/src/app.css +560 -0
  220. package/src/assets/.DS_Store +0 -0
  221. package/src/assets/favicon.ico +0 -0
  222. package/src/assets/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
  223. package/src/assets/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
  224. package/src/assets/fonts/geist-latin-wght-normal.woff2 +0 -0
  225. package/src/assets/fonts/iosevka-latin-400-normal.woff2 +0 -0
  226. package/src/assets/invect-branding.ts +51 -0
  227. package/src/assets/provider-icons/anthropic.svg +1 -0
  228. package/src/assets/provider-icons/anthropic_light.svg +1 -0
  229. package/src/assets/provider-icons/github.svg +1 -0
  230. package/src/assets/provider-icons/github_light.svg +1 -0
  231. package/src/assets/provider-icons/gmail.svg +1 -0
  232. package/src/assets/provider-icons/google_calendar.svg +1 -0
  233. package/src/assets/provider-icons/google_docs.svg +1 -0
  234. package/src/assets/provider-icons/google_drive.svg +1 -0
  235. package/src/assets/provider-icons/google_sheets.svg +1 -0
  236. package/src/assets/provider-icons/index.ts +55 -0
  237. package/src/assets/provider-icons/linear.svg +1 -0
  238. package/src/assets/provider-icons/openai.svg +1 -0
  239. package/src/assets/provider-icons/postgres.svg +1 -0
  240. package/src/assets/provider-icons/slack.svg +1 -0
  241. package/src/assets/small-loader-dark.svg +22 -0
  242. package/src/assets/small-loader-light.svg +22 -0
  243. package/src/assets/small.svg +7 -0
  244. package/src/components/.DS_Store +0 -0
  245. package/src/components/PageLayout.tsx +55 -0
  246. package/src/components/chat/ChatInput.tsx +115 -0
  247. package/src/components/chat/ChatMessageList.tsx +788 -0
  248. package/src/components/chat/ChatModelSelector.tsx +208 -0
  249. package/src/components/chat/ChatPanel.tsx +243 -0
  250. package/src/components/chat/ChatPromptOverlay.tsx +150 -0
  251. package/src/components/chat/ChatProviderSelector.tsx +135 -0
  252. package/src/components/chat/ChatSettingsPanel.tsx +277 -0
  253. package/src/components/chat/InlineCredentialSetup.tsx +343 -0
  254. package/src/components/chat/MarkdownRenderer.tsx +140 -0
  255. package/src/components/chat/chat-memory.ts +88 -0
  256. package/src/components/chat/chat.store.ts +479 -0
  257. package/src/components/chat/index.ts +5 -0
  258. package/src/components/chat/use-chat.ts +473 -0
  259. package/src/components/credentials/CreateCredentialModal.tsx +609 -0
  260. package/src/components/credentials/CredentialDetailDialog.tsx +882 -0
  261. package/src/components/credentials/EditCredentialModal.tsx +399 -0
  262. package/src/components/credentials/OAuth2ConnectButton.tsx +288 -0
  263. package/src/components/credentials/OAuth2ProviderSelector.tsx +360 -0
  264. package/src/components/credentials/credential-utils.ts +99 -0
  265. package/src/components/credentials/index.ts +10 -0
  266. package/src/components/dashboard/FailedRunsAlert.tsx +67 -0
  267. package/src/components/dashboard/FlowCard.tsx +64 -0
  268. package/src/components/dashboard/RecentActivityTable.tsx +92 -0
  269. package/src/components/dashboard/StatCard.tsx +32 -0
  270. package/src/components/dashboard/index.ts +5 -0
  271. package/src/components/dashboard/status-helpers.tsx +102 -0
  272. package/src/components/flow-editor/ActionsSidebar.tsx +503 -0
  273. package/src/components/flow-editor/FlowEditor.tsx +1002 -0
  274. package/src/components/flow-editor/FlowHeader.tsx +87 -0
  275. package/src/components/flow-editor/FlowLayout.tsx +117 -0
  276. package/src/components/flow-editor/ModeSwitcher.tsx +49 -0
  277. package/src/components/flow-editor/NodeSidebar.tsx +343 -0
  278. package/src/components/flow-editor/RunControls.tsx +109 -0
  279. package/src/components/flow-editor/ToolConfigPanel.tsx +434 -0
  280. package/src/components/flow-editor/ValidationPanel.tsx +167 -0
  281. package/src/components/flow-editor/flow-editor.store.ts +2 -0
  282. package/src/components/flow-editor/index.ts +6 -0
  283. package/src/components/flow-editor/inline-edit.tsx +111 -0
  284. package/src/components/flow-editor/node-config-panel/ConfigFieldWithTemplate.tsx +334 -0
  285. package/src/components/flow-editor/node-config-panel/CredentialCombobox.tsx +217 -0
  286. package/src/components/flow-editor/node-config-panel/CredentialsSection.tsx +154 -0
  287. package/src/components/flow-editor/node-config-panel/DroppableInput.tsx +45 -0
  288. package/src/components/flow-editor/node-config-panel/DynamicSelectField.tsx +223 -0
  289. package/src/components/flow-editor/node-config-panel/JsonPreviewPanel.tsx +134 -0
  290. package/src/components/flow-editor/node-config-panel/NodeConfigPanel.tsx +650 -0
  291. package/src/components/flow-editor/node-config-panel/NodeConfigPanelHeader.tsx +91 -0
  292. package/src/components/flow-editor/node-config-panel/ParametersSection.tsx +144 -0
  293. package/src/components/flow-editor/node-config-panel/SearchableSelectField.tsx +126 -0
  294. package/src/components/flow-editor/node-config-panel/SwitchCasesField.tsx +212 -0
  295. package/src/components/flow-editor/node-config-panel/hooks/index.ts +2 -0
  296. package/src/components/flow-editor/node-config-panel/hooks/use-node-config-panel-state.ts +284 -0
  297. package/src/components/flow-editor/node-config-panel/hooks/use-node-execution.ts +287 -0
  298. package/src/components/flow-editor/node-config-panel/hooks/use-upstream-slots.ts +310 -0
  299. package/src/components/flow-editor/node-config-panel/panels/AgentToolsPanel.tsx +837 -0
  300. package/src/components/flow-editor/node-config-panel/panels/ConfigurationPanel.tsx +383 -0
  301. package/src/components/flow-editor/node-config-panel/panels/DataMapperPane.tsx +456 -0
  302. package/src/components/flow-editor/node-config-panel/panels/InputPanel.tsx +338 -0
  303. package/src/components/flow-editor/node-config-panel/panels/OutputPanel.tsx +109 -0
  304. package/src/components/flow-editor/node-config-panel/panels/index.ts +4 -0
  305. package/src/components/flow-editor/node-config-panel/types.ts +20 -0
  306. package/src/components/flow-editor/node-config-panel/use-node-config-panel-store.ts +283 -0
  307. package/src/components/flow-editor/node-config-panel/use-node-config-state.ts +172 -0
  308. package/src/components/flow-editor/node-config-panel/use-run-node.ts +147 -0
  309. package/src/components/flow-editor/node-config-panel/utils.ts +73 -0
  310. package/src/components/flow-editor/serialize-to-sdk.ts +204 -0
  311. package/src/components/flow-editor/toolbar-context.ts +9 -0
  312. package/src/components/flow-editor/use-copy-paste.ts +575 -0
  313. package/src/components/flow-editor/use-copy-paste.types.ts +35 -0
  314. package/src/components/flow-editor/use-flow-editor.ts +241 -0
  315. package/src/components/flow-runs-table/FlowRunsTable.tsx +631 -0
  316. package/src/components/flow-runs-table/index.ts +1 -0
  317. package/src/components/flow-viewer/FlowRunsView.tsx +268 -0
  318. package/src/components/flow-viewer/FlowStatusView.tsx +351 -0
  319. package/src/components/flow-viewer/RunSelector.tsx +422 -0
  320. package/src/components/flow-viewer/RunsSidebar.tsx +125 -0
  321. package/src/components/flow-viewer/agent-tool-executions-list.tsx +298 -0
  322. package/src/components/flow-viewer/index.ts +1 -0
  323. package/src/components/flow-viewer/logs-panel.tsx +567 -0
  324. package/src/components/flow-viewer/use-execution-log-data.ts +374 -0
  325. package/src/components/graph/BatchFlowEdge.tsx +229 -0
  326. package/src/components/graph/LayoutSelector.tsx +42 -0
  327. package/src/components/graph/index.ts +61 -0
  328. package/src/components/graph/styleUtils.ts +375 -0
  329. package/src/components/nodes/.DS_Store +0 -0
  330. package/src/components/nodes/AgentConfigPanel.tsx +1033 -0
  331. package/src/components/nodes/AgentNode.tsx +298 -0
  332. package/src/components/nodes/AgentToolsBox.tsx +193 -0
  333. package/src/components/nodes/NodeAppendix.tsx +98 -0
  334. package/src/components/nodes/NodeStatusIndicator.tsx +74 -0
  335. package/src/components/nodes/NodeViewContext.tsx +45 -0
  336. package/src/components/nodes/ToolParamField.tsx +282 -0
  337. package/src/components/nodes/ToolSelectorModal.tsx +648 -0
  338. package/src/components/nodes/ToolSelectorParts.tsx +505 -0
  339. package/src/components/nodes/UniversalNode.tsx +356 -0
  340. package/src/components/nodes/createContextAwareNodes.ts +19 -0
  341. package/src/components/nodes/index.ts +45 -0
  342. package/src/components/nodes/nodeRegistry.ts +50 -0
  343. package/src/components/nodes/withNodeContext.tsx +55 -0
  344. package/src/components/shared/InvectLoader.tsx +59 -0
  345. package/src/components/shared/InvectLogo.tsx +59 -0
  346. package/src/components/shared/ProviderIcon.tsx +115 -0
  347. package/src/components/side-menu/side-menu.tsx +267 -0
  348. package/src/components/sidebar/BaseSidebar.tsx +148 -0
  349. package/src/components/sidebar/index.ts +1 -0
  350. package/src/components/triggers/CronPreview.tsx +243 -0
  351. package/src/components/triggers/index.ts +1 -0
  352. package/src/components/ui/alert-dialog.tsx +152 -0
  353. package/src/components/ui/badge.tsx +39 -0
  354. package/src/components/ui/button.tsx +58 -0
  355. package/src/components/ui/card.tsx +75 -0
  356. package/src/components/ui/codemirror-js-editor.tsx +432 -0
  357. package/src/components/ui/codemirror-json-editor.tsx +816 -0
  358. package/src/components/ui/codemirror-nunjucks-editor.tsx +451 -0
  359. package/src/components/ui/codemirror-vscode-theme.ts +243 -0
  360. package/src/components/ui/collapsible.tsx +12 -0
  361. package/src/components/ui/command.tsx +162 -0
  362. package/src/components/ui/dialog.tsx +140 -0
  363. package/src/components/ui/dropdown-menu.tsx +232 -0
  364. package/src/components/ui/empty-state.tsx +93 -0
  365. package/src/components/ui/input.tsx +26 -0
  366. package/src/components/ui/label.tsx +19 -0
  367. package/src/components/ui/popover.tsx +53 -0
  368. package/src/components/ui/resizable.tsx +61 -0
  369. package/src/components/ui/scroll-area.tsx +56 -0
  370. package/src/components/ui/select.tsx +179 -0
  371. package/src/components/ui/separator.tsx +26 -0
  372. package/src/components/ui/slider.tsx +58 -0
  373. package/src/components/ui/switch.tsx +22 -0
  374. package/src/components/ui/table.tsx +90 -0
  375. package/src/components/ui/textarea.tsx +23 -0
  376. package/src/components/ui/tooltip.tsx +54 -0
  377. package/src/components/ui/tree-view.tsx +574 -0
  378. package/src/contexts/AgentToolCallbacksContext.tsx +31 -0
  379. package/src/contexts/ApiContext.tsx +51 -0
  380. package/src/contexts/FlowDataContext.tsx +21 -0
  381. package/src/contexts/NodeRegistryContext.tsx +54 -0
  382. package/src/contexts/PluginRegistryContext.tsx +182 -0
  383. package/src/contexts/ThemeProvider.tsx +106 -0
  384. package/src/contexts/ValidationContext.tsx +122 -0
  385. package/src/demo/DemoInvect.tsx +42 -0
  386. package/src/demo/FlowViewer.tsx +294 -0
  387. package/src/demo/demo-api-client.ts +246 -0
  388. package/src/demo/index.ts +28 -0
  389. package/src/demo/sample-data.ts +1980 -0
  390. package/src/hooks/index.ts +1 -0
  391. package/src/hooks/use-document-title.ts +8 -0
  392. package/src/hooks/use-flow-data.ts +144 -0
  393. package/src/hooks/use-invect-portal-class.ts +27 -0
  394. package/src/hooks/useFlowEditorStore.ts +2 -0
  395. package/src/index.ts +70 -0
  396. package/src/lib/utils.ts +6 -0
  397. package/src/prettier.d.ts +13 -0
  398. package/src/routes/all-flow-runs.tsx +27 -0
  399. package/src/routes/credentials.tsx +362 -0
  400. package/src/routes/flow-route-layout.tsx +113 -0
  401. package/src/routes/flow-runs.tsx +22 -0
  402. package/src/routes/flow.tsx +22 -0
  403. package/src/routes/home.tsx +282 -0
  404. package/src/services/index.ts +6 -0
  405. package/src/stores/executionViewStore.ts +211 -0
  406. package/src/stores/flow-editor.store.ts +738 -0
  407. package/src/stores/flowEditorStore.ts +2 -0
  408. package/src/stores/index.ts +10 -0
  409. package/src/stores/uiStore.ts +189 -0
  410. package/src/types/agent-tools.types.ts +64 -0
  411. package/src/types/index.ts +5 -0
  412. package/src/types/node-definition.types.ts +104 -0
  413. package/src/types/plugin.types.ts +123 -0
  414. package/src/utils/credentialBranding.ts +116 -0
  415. package/src/utils/credentialFiltering.ts +68 -0
  416. package/src/utils/flowTransformations.ts +137 -0
  417. package/src/utils/layoutUtils.ts +127 -0
  418. package/src/utils/nodeReferenceUtils.ts +135 -0
  419. package/src/vendor.d.ts +7 -0
@@ -0,0 +1,64 @@
1
+ import { StoreApi, UseBoundStore } from 'zustand';
2
+ import { FlowRunStatus } from '@invect/core/types';
3
+ interface ExecutionViewState {
4
+ activeFlowRunId: string | null;
5
+ activeFlowId: string | null;
6
+ selectedExecutionNodeId: string | null;
7
+ statusFilter: FlowRunStatus | 'all';
8
+ flowIdFilter: string | null;
9
+ page: number;
10
+ limit: number;
11
+ sortBy: 'startedAt' | 'endedAt' | 'status';
12
+ sortOrder: 'asc' | 'desc';
13
+ logsExpanded: boolean;
14
+ selectedLogNodeId: string | null;
15
+ }
16
+ interface ExecutionViewActions {
17
+ setActiveExecution: (flowId: string, flowRunId: string) => void;
18
+ clearActiveExecution: () => void;
19
+ selectExecutionNode: (nodeId: string | null) => void;
20
+ setStatusFilter: (status: FlowRunStatus | 'all') => void;
21
+ setFlowIdFilter: (flowId: string | null) => void;
22
+ clearFilters: () => void;
23
+ setPage: (page: number) => void;
24
+ setLimit: (limit: number) => void;
25
+ setSortBy: (sortBy: ExecutionViewState['sortBy']) => void;
26
+ setSortOrder: (sortOrder: ExecutionViewState['sortOrder']) => void;
27
+ toggleLogsExpanded: () => void;
28
+ setLogsExpanded: (expanded: boolean) => void;
29
+ selectLogNode: (nodeId: string | null) => void;
30
+ reset: () => void;
31
+ }
32
+ export type ExecutionViewStore = ExecutionViewState & ExecutionViewActions;
33
+ export declare const useExecutionViewStore: UseBoundStore<StoreApi<ExecutionViewStore>>;
34
+ export declare const useActiveFlowRunId: () => string | null;
35
+ export declare const useActiveFlowId: () => string | null;
36
+ export declare const useSelectedExecutionNodeId: () => string | null;
37
+ export declare const useStatusFilter: () => "all" | FlowRunStatus;
38
+ export declare const useExecutionPagination: () => {
39
+ page: number;
40
+ limit: number;
41
+ setPage: (page: number) => void;
42
+ setLimit: (limit: number) => void;
43
+ };
44
+ export declare const useExecutionSorting: () => {
45
+ sortBy: "status" | "startedAt" | "endedAt";
46
+ sortOrder: "asc" | "desc";
47
+ setSortBy: (sortBy: ExecutionViewState["sortBy"]) => void;
48
+ setSortOrder: (sortOrder: ExecutionViewState["sortOrder"]) => void;
49
+ };
50
+ export declare const useLogsState: () => {
51
+ logsExpanded: boolean;
52
+ selectedLogNodeId: string | null;
53
+ toggleLogsExpanded: () => void;
54
+ setLogsExpanded: (expanded: boolean) => void;
55
+ selectLogNode: (nodeId: string | null) => void;
56
+ };
57
+ export declare const useExecutionFilters: () => {
58
+ statusFilter: "all" | FlowRunStatus;
59
+ flowIdFilter: string | null;
60
+ setStatusFilter: (status: FlowRunStatus | "all") => void;
61
+ setFlowIdFilter: (flowId: string | null) => void;
62
+ clearFilters: () => void;
63
+ };
64
+ export {};
@@ -0,0 +1,137 @@
1
+ import { StoreApi, UseBoundStore } from 'zustand';
2
+ import { Node, Edge, NodeChange, EdgeChange, Connection } from '@xyflow/react';
3
+ import { LayoutAlgorithm } from '../utils/layoutUtils';
4
+ import { ReactFlowNodeData } from '@invect/core/types';
5
+ export type LayoutDirection = 'TB' | 'LR' | 'BT' | 'RL';
6
+ export type { LayoutAlgorithm } from '../utils/layoutUtils';
7
+ export type FlowNode = Node<ReactFlowNodeData>;
8
+ export declare function isFlowNode(node: Node): node is FlowNode;
9
+ export declare function getNodeData(node: Node): ReactFlowNodeData | null;
10
+ export interface FlowEditorState {
11
+ flowId: string | null;
12
+ flowVersion: string | null;
13
+ flowName: string;
14
+ nodes: Node[];
15
+ edges: Edge[];
16
+ edgesReady: boolean;
17
+ registryLoading: boolean;
18
+ nodesInitialized: boolean;
19
+ allNodesHaveDefinitions: boolean;
20
+ nodesReinitializedAfterRegistry: boolean;
21
+ definitionsLoadedTime: number | null;
22
+ currentSnapshot: string | null;
23
+ lastSavedSnapshot: string | null;
24
+ lastSavedVersionId: string | null;
25
+ initialDataLoaded: boolean;
26
+ selectedNodeId: string | null;
27
+ configPanelOpen: boolean;
28
+ toolSelectorOpen: boolean;
29
+ toolConfigOpen: boolean;
30
+ toolPanelNodeId: string | null;
31
+ selectedToolInstanceId: string | null;
32
+ configPanelToolInstanceId: string | null;
33
+ currentLayout: LayoutAlgorithm;
34
+ layoutDirection: LayoutDirection;
35
+ initialLayoutApplied: boolean;
36
+ isLoading: boolean;
37
+ error: string | null;
38
+ activeFlowRunId: string | null;
39
+ }
40
+ export interface FlowEditorActions {
41
+ setFlowId: (flowId: string | null, version?: string | null) => void;
42
+ setFlowName: (name: string) => void;
43
+ setNodes: (nodes: Node[]) => void;
44
+ applyNodeChanges: (changes: NodeChange[]) => void;
45
+ updateNodeData: (nodeId: string, data: Partial<ReactFlowNodeData>) => void;
46
+ addNode: (node: Node) => void;
47
+ removeNode: (nodeId: string) => void;
48
+ removeNodes: (nodeIds: string[]) => void;
49
+ pasteNodesAndEdges: (newNodes: Node[], newEdges: Edge[]) => void;
50
+ setEdges: (edges: Edge[]) => void;
51
+ applyEdgeChanges: (changes: EdgeChange[]) => void;
52
+ addEdge: (edge: Edge) => void;
53
+ onConnect: (connection: Connection) => void;
54
+ removeEdge: (edgeId: string) => void;
55
+ removeEdgesBySourceHandle: (nodeId: string, handleId: string) => void;
56
+ setEdgesReady: (ready: boolean) => void;
57
+ setRegistryLoading: (loading: boolean) => void;
58
+ setNodesInitialized: (initialized: boolean) => void;
59
+ setAllNodesHaveDefinitions: (hasDefinitions: boolean) => void;
60
+ checkAndUpdateEdgesReady: () => void;
61
+ selectNode: (nodeId: string | null) => void;
62
+ openConfigPanel: (nodeId: string) => void;
63
+ closeConfigPanel: () => void;
64
+ openToolSelector: (nodeId: string) => void;
65
+ closeToolSelector: () => void;
66
+ openToolConfig: (nodeId: string, instanceId: string) => void;
67
+ closeToolConfig: () => void;
68
+ setConfigPanelToolInstanceId: (id: string | null) => void;
69
+ syncFromServer: (nodes: Node[], edges: Edge[], versionId: string, flowName?: string) => void;
70
+ markSaved: (versionId: string) => void;
71
+ markDirty: () => void;
72
+ resetDirty: (savedVersionId?: string) => void;
73
+ setLayout: (layout: LayoutAlgorithm, direction?: LayoutDirection) => void;
74
+ setLayoutedNodes: (nodes: Node[]) => void;
75
+ markInitialLayoutApplied: () => void;
76
+ needsInitialLayout: () => boolean;
77
+ setLoading: (loading: boolean) => void;
78
+ setError: (error: string | null) => void;
79
+ setActiveFlowRunId: (flowRunId: string | null) => void;
80
+ updateNodeExecutionStatus: (nodeId: string, status: string, output?: unknown, error?: string) => void;
81
+ clearAllExecutionStatus: () => void;
82
+ populateFromRunData: (nodeExecutionMap: Record<string, {
83
+ inputs?: unknown;
84
+ outputs?: unknown;
85
+ }>) => void;
86
+ reset: () => void;
87
+ }
88
+ export type FlowEditorStore = FlowEditorState & FlowEditorActions;
89
+ export declare const useFlowEditorStore: UseBoundStore<StoreApi<FlowEditorStore>>;
90
+ export declare const useNodes: () => Node[];
91
+ export declare const useEdges: () => Edge[];
92
+ export declare const useEdgesReady: () => boolean;
93
+ export declare const useIsDirty: () => boolean;
94
+ export declare const useSelectedNodeId: () => string | null;
95
+ export declare const useConfigPanelOpen: () => boolean;
96
+ export declare const useToolSelectorOpen: () => boolean;
97
+ export declare const useToolConfigOpen: () => boolean;
98
+ export declare const useToolPanelNodeId: () => string | null;
99
+ export declare const useSelectedToolInstanceId: () => string | null;
100
+ export declare const useConfigPanelToolInstanceId: () => string | null;
101
+ export declare const useFlowName: () => string;
102
+ export declare const useCurrentLayout: () => LayoutAlgorithm;
103
+ export declare const useLayoutDirection: () => LayoutDirection;
104
+ export declare const useInitialLayoutApplied: () => boolean;
105
+ export declare const useIsLoading: () => boolean;
106
+ export declare const useFlowError: () => string | null;
107
+ export declare const useFlowEditorSelection: () => {
108
+ selectedNodeId: string | null;
109
+ configPanelOpen: boolean;
110
+ selectNode: (nodeId: string | null) => void;
111
+ openConfigPanel: (nodeId: string) => void;
112
+ closeConfigPanel: () => void;
113
+ };
114
+ export declare const useFlowEditorLayout: () => {
115
+ currentLayout: LayoutAlgorithm;
116
+ layoutDirection: LayoutDirection;
117
+ initialLayoutApplied: boolean;
118
+ setLayout: (layout: LayoutAlgorithm, direction?: LayoutDirection) => void;
119
+ setLayoutedNodes: (nodes: Node[]) => void;
120
+ markInitialLayoutApplied: () => void;
121
+ needsInitialLayout: () => boolean;
122
+ };
123
+ export declare const useNode: (nodeId: string | null) => Node | null;
124
+ export declare const useNodeMetadata: () => Record<string, {
125
+ name: string;
126
+ type?: string;
127
+ }>;
128
+ export declare const useIncomingEdges: (nodeId: string | null) => Edge[];
129
+ export declare const useOutgoingEdges: (nodeId: string | null) => Edge[];
130
+ export declare const useUpstreamNodes: (nodeId: string | null) => Node[];
131
+ export declare const useDownstreamNodes: (nodeId: string | null) => Node[];
132
+ export declare const useFlowStats: () => {
133
+ nodeCount: number;
134
+ edgeCount: number;
135
+ isDirty: boolean;
136
+ isLoading: boolean;
137
+ };
@@ -0,0 +1 @@
1
+ export * from '../components/flow-editor/flow-editor.store';
@@ -0,0 +1,2 @@
1
+ export * from './uiStore';
2
+ export * from './executionViewStore';
@@ -0,0 +1,45 @@
1
+ import { StoreApi, UseBoundStore } from 'zustand';
2
+ export type ModalType = 'createFlow' | 'createCredential' | 'editCredential' | 'confirm' | 'executeFlow' | 'deleteConfirm' | null;
3
+ export type SidebarTab = 'nodes' | 'settings' | 'history';
4
+ interface UIState {
5
+ sidebarCollapsed: boolean;
6
+ activeSidebarTab: SidebarTab;
7
+ activeModal: ModalType;
8
+ modalData: Record<string, unknown>;
9
+ validationPanelOpen: boolean;
10
+ logsPanelOpen: boolean;
11
+ nodeSidebarOpen: boolean;
12
+ toolbarCollapsed: boolean;
13
+ }
14
+ interface UIActions {
15
+ toggleSidebar: () => void;
16
+ setSidebarCollapsed: (collapsed: boolean) => void;
17
+ setSidebarTab: (tab: SidebarTab) => void;
18
+ openModal: (modal: NonNullable<ModalType>, data?: Record<string, unknown>) => void;
19
+ closeModal: () => void;
20
+ setModalData: (data: Record<string, unknown>) => void;
21
+ toggleValidationPanel: () => void;
22
+ setValidationPanelOpen: (open: boolean) => void;
23
+ toggleLogsPanel: () => void;
24
+ setLogsPanelOpen: (open: boolean) => void;
25
+ toggleNodeSidebar: () => void;
26
+ setNodeSidebarOpen: (open: boolean) => void;
27
+ toggleToolbarCollapsed: () => void;
28
+ reset: () => void;
29
+ }
30
+ export type UIStore = UIState & UIActions;
31
+ export declare const useUIStore: UseBoundStore<StoreApi<UIStore>>;
32
+ export declare const useSidebarCollapsed: () => boolean;
33
+ export declare const useActiveSidebarTab: () => SidebarTab;
34
+ export declare const useActiveModal: () => ModalType;
35
+ export declare const useModalData: () => Record<string, unknown>;
36
+ export declare const useValidationPanelOpen: () => boolean;
37
+ export declare const useLogsPanelOpen: () => boolean;
38
+ export declare const useNodeSidebarOpen: () => boolean;
39
+ export declare const useModals: () => {
40
+ activeModal: ModalType;
41
+ modalData: Record<string, unknown>;
42
+ openModal: (modal: NonNullable<ModalType>, data?: Record<string, unknown>) => void;
43
+ closeModal: () => void;
44
+ };
45
+ export {};
@@ -0,0 +1,53 @@
1
+ import { AppendixPosition } from '../components/nodes/NodeAppendix';
2
+ /**
3
+ * Tool category for organization in UI
4
+ * Matches AgentToolCategory from @invect/core
5
+ */
6
+ export type ToolCategory = 'data' | 'web' | 'code' | 'utility' | 'custom';
7
+ /**
8
+ * Simplified tool definition for display in the UI
9
+ * Matches the essential fields from AgentToolDefinition in core
10
+ */
11
+ export interface AgentToolDisplay {
12
+ /** Unique tool identifier (snake_case) */
13
+ id: string;
14
+ /** Human-readable name */
15
+ name: string;
16
+ /** Tool category for organization and styling */
17
+ category: ToolCategory;
18
+ /** Description (optional for display, shown in tooltips) */
19
+ description?: string;
20
+ }
21
+ /**
22
+ * Convert from backend AgentToolDefinition to frontend display format
23
+ * This is a utility type - the actual conversion is done in components
24
+ */
25
+ export type AgentToolDefinitionToDisplay<T extends {
26
+ id: string;
27
+ name: string;
28
+ category: ToolCategory;
29
+ description?: string;
30
+ }> = Pick<T, 'id' | 'name' | 'category' | 'description'>;
31
+ /**
32
+ * Agent node data extensions for tools
33
+ */
34
+ export interface AgentNodeToolsData {
35
+ /** Resolved tools for display (populated by frontend from API) */
36
+ tools?: AgentToolDisplay[];
37
+ /** Position of the tools appendix */
38
+ toolsPosition?: AppendixPosition;
39
+ }
40
+ /**
41
+ * Event handlers for agent tool interactions
42
+ */
43
+ export interface AgentToolHandlers {
44
+ /** Called when user clicks "Add Tool" button */
45
+ onAddTool?: () => void;
46
+ /** Called when user clicks on a tool (to configure it) */
47
+ onToolClick?: (tool: AgentToolDisplay) => void;
48
+ /** Called when user clicks remove button on a tool */
49
+ onRemoveTool?: (toolId: string) => void;
50
+ /** Called when user changes the tools appendix position */
51
+ onToolsPositionChange?: (position: AppendixPosition) => void;
52
+ }
53
+ export type { AppendixPosition };
@@ -0,0 +1,2 @@
1
+ export * from './node-definition.types';
2
+ export * from './agent-tools.types';
@@ -0,0 +1,85 @@
1
+ export interface NodeHandleDefinition {
2
+ id: string;
3
+ label: string;
4
+ type: string;
5
+ required?: boolean;
6
+ description?: string;
7
+ }
8
+ export interface NodeParamField {
9
+ name: string;
10
+ label: string;
11
+ type: 'text' | 'textarea' | 'select' | 'number' | 'boolean' | 'json' | 'code' | 'credential' | 'switch-cases';
12
+ description?: string;
13
+ placeholder?: string;
14
+ defaultValue?: unknown;
15
+ options?: {
16
+ label: string;
17
+ value: string | number;
18
+ description?: string;
19
+ }[];
20
+ required?: boolean;
21
+ hidden?: boolean;
22
+ disabled?: boolean;
23
+ extended?: boolean;
24
+ credentialTypes?: ('oauth2' | 'api_key' | 'basic_auth' | 'database' | 'llm')[];
25
+ oauth2Providers?: string[];
26
+ requiredScopes?: string[];
27
+ /** When present, this field's options should be loaded from the server. */
28
+ loadOptions?: {
29
+ /** Sibling field names that trigger a reload when they change. */
30
+ dependsOn: string[];
31
+ };
32
+ }
33
+ export interface NodeDefinition {
34
+ /**
35
+ * Node type identifier. Can be a GraphNodeType enum value (e.g. "MODEL")
36
+ * or a provider action ID (e.g. "gmail.list_messages").
37
+ */
38
+ type: string;
39
+ label: string;
40
+ description: string;
41
+ icon?: string;
42
+ /**
43
+ * Provider info for grouping in the node palette.
44
+ * Actions populate this from their ProviderDef; legacy nodes may leave it undefined.
45
+ */
46
+ provider?: {
47
+ id: string;
48
+ name: string;
49
+ icon?: string;
50
+ /** Raw SVG markup for custom provider branding. Takes precedence over `icon`. */
51
+ svgIcon?: string;
52
+ };
53
+ /**
54
+ * Single unified input handle definition. Undefined when the node does not accept inbound edges (e.g. Flow Input node).
55
+ */
56
+ input?: NodeHandleDefinition;
57
+ /**
58
+ * Fixed output handles.
59
+ * For nodes with `dynamicOutputs`, these are placeholders —
60
+ * the frontend derives actual handles from the node's params.
61
+ */
62
+ outputs: NodeHandleDefinition[];
63
+ /**
64
+ * When true, output handles are derived from the node's params at render
65
+ * time (e.g. switch node cases) instead of using the static `outputs` array.
66
+ */
67
+ dynamicOutputs?: boolean;
68
+ /**
69
+ * Configuration fields for the node (displayed in the sidebar/form).
70
+ */
71
+ paramFields: NodeParamField[];
72
+ /**
73
+ * Default values for parameters.
74
+ */
75
+ defaultParams?: Record<string, unknown>;
76
+ /**
77
+ * Maximum number of instances of this node type allowed per flow.
78
+ * Undefined = unlimited.
79
+ */
80
+ maxInstances?: number;
81
+ /**
82
+ * When true, hide this node from the palette (deprecated but still executable).
83
+ */
84
+ hidden?: boolean;
85
+ }
@@ -0,0 +1,100 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ /**
3
+ * A frontend plugin that contributes UI to the Invect application.
4
+ * Plugins are registered via `<Invect plugins={[myPlugin]} />`.
5
+ */
6
+ export interface InvectFrontendPlugin {
7
+ /** Unique plugin ID — should match backend plugin ID for manifest resolution */
8
+ id: string;
9
+ /** Display name */
10
+ name?: string;
11
+ /** Add items to the sidebar navigation */
12
+ sidebar?: PluginSidebarContribution[];
13
+ /**
14
+ * Component rendered at the very bottom of the sidebar.
15
+ * Receives `collapsed` and `basePath` props to adapt layout and build links.
16
+ * Typically used for user avatar / profile link.
17
+ * Only the first plugin that provides this wins.
18
+ */
19
+ sidebarFooter?: ComponentType<{
20
+ collapsed: boolean;
21
+ basePath: string;
22
+ }>;
23
+ /** Add top-level routes (pages) */
24
+ routes?: PluginRouteContribution[];
25
+ /** Add tabs to contextual panels (flow editor right panel, etc.) */
26
+ panelTabs?: PluginPanelTabContribution[];
27
+ /** Add action buttons/components to contextual headers */
28
+ headerActions?: PluginHeaderActionContribution[];
29
+ /**
30
+ * Named component implementations — resolved from backend componentIds.
31
+ * Key = componentId (e.g. 'rbac.FlowAccessPanel'), value = React component.
32
+ */
33
+ components?: Record<string, ComponentType<Record<string, unknown>>>;
34
+ /** Wrap the React tree with additional providers (auth context, etc.) */
35
+ providers?: ComponentType<{
36
+ children: ReactNode;
37
+ }>[];
38
+ /**
39
+ * Inject headers into every API request.
40
+ * Called before each request. Return headers to merge.
41
+ */
42
+ apiHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
43
+ /**
44
+ * Check if the current user has a specific permission.
45
+ * Returns true/false to override, or undefined to defer to default.
46
+ */
47
+ checkPermission?: (permission: string, context?: PermissionContext) => boolean | undefined;
48
+ }
49
+ export interface PluginSidebarContribution {
50
+ label: string;
51
+ icon: ComponentType<{
52
+ className?: string;
53
+ }>;
54
+ path: string;
55
+ /** Badge text or function returning badge text */
56
+ badge?: string | (() => string | undefined);
57
+ /** Position hint: 'top' (after defaults), 'bottom' (before theme toggle) */
58
+ position?: 'top' | 'bottom';
59
+ /** Required permission — item hidden if check fails */
60
+ permission?: string;
61
+ }
62
+ export interface PluginRouteContribution {
63
+ path: string;
64
+ component: ComponentType<{
65
+ basePath: string;
66
+ }>;
67
+ /** If true, route is nested under the flow layout */
68
+ flowScoped?: boolean;
69
+ }
70
+ export interface PluginPanelTabContribution {
71
+ /** Where the tab appears */
72
+ context: 'flowEditor' | 'nodeConfig';
73
+ label: string;
74
+ icon?: ComponentType<{
75
+ className?: string;
76
+ }>;
77
+ component: ComponentType<PanelTabProps>;
78
+ /** Required permission — tab hidden if check fails */
79
+ permission?: string;
80
+ }
81
+ export interface PluginHeaderActionContribution {
82
+ /** Where the action appears */
83
+ context: 'flowHeader' | 'flowList';
84
+ component: ComponentType<HeaderActionProps>;
85
+ /** Required permission — action hidden if check fails */
86
+ permission?: string;
87
+ }
88
+ export interface PanelTabProps {
89
+ flowId: string;
90
+ basePath: string;
91
+ }
92
+ export interface HeaderActionProps {
93
+ flowId?: string;
94
+ basePath: string;
95
+ }
96
+ export interface PermissionContext {
97
+ resourceType?: string;
98
+ resourceId?: string;
99
+ flowId?: string;
100
+ }
@@ -0,0 +1,8 @@
1
+ import { Credential } from '../api/types';
2
+ export interface CredentialBranding {
3
+ providerId?: string;
4
+ icon: string;
5
+ providerLabel: string | null;
6
+ }
7
+ export declare function getCredentialBranding(credential: Credential): CredentialBranding;
8
+ export declare function getCredentialProviderLabel(credential: Credential): string | null;
@@ -0,0 +1,20 @@
1
+ import { Credential } from '../api/types';
2
+ interface CredentialFieldHints {
3
+ /** OAuth2 provider IDs to match (e.g., ["google"]) */
4
+ oauth2Providers?: string[];
5
+ /** Credential types to match (e.g., ["oauth2", "api_key"]) */
6
+ credentialTypes?: string[];
7
+ }
8
+ /**
9
+ * Filter a list of credentials to those relevant for a specific credential field.
10
+ *
11
+ * Matching rules:
12
+ * 1. If the field specifies `oauth2Providers`, show credentials whose
13
+ * `metadata.oauth2Provider` matches **plus** any non-OAuth2 credentials
14
+ * (apiKey, bearer, etc.) that could serve as manual API key fallbacks.
15
+ * 2. If the field specifies `credentialTypes` (without oauth2Providers),
16
+ * filter by `authType`.
17
+ * 3. If neither is specified, return all credentials (no filtering).
18
+ */
19
+ export declare function filterCredentialsForField(credentials: Credential[], field: CredentialFieldHints): Credential[];
20
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Node, Edge } from '@xyflow/react';
2
+ import { InvectDefinition } from '@invect/core/types';
3
+ /**
4
+ * Transform ReactFlow nodes and edges back to InvectDefinition format for saving
5
+ */
6
+ export declare function transformToInvectDefinition(nodes: Node[], edges: Edge[]): InvectDefinition;
7
+ /**
8
+ * Compute a serialized snapshot of the flow definition for dirty-checking.
9
+ * Uses `transformToInvectDefinition` to strip ReactFlow-internal state
10
+ * (selected, measured, executionStatus, etc.), then JSON.stringify for
11
+ * cheap string equality comparison.
12
+ *
13
+ * This is only called inside Zustand store actions (on structural mutations
14
+ * and saves), NOT inside selectors — so it doesn't run on every render.
15
+ */
16
+ export declare function computeSnapshot(nodes: Node[], edges: Edge[]): string;
@@ -0,0 +1,23 @@
1
+ import { Node, Edge } from '@xyflow/react';
2
+ export interface Position {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ export type LayoutAlgorithm = 'dagre' | 'elkjs';
7
+ export interface LayoutOptions {
8
+ algorithm: LayoutAlgorithm;
9
+ direction?: 'TB' | 'BT' | 'LR' | 'RL';
10
+ nodeSpacing?: number;
11
+ rankSpacing?: number;
12
+ /** Maximum width before wrapping to a new row (only applies to LR/RL layouts, 0 = no wrapping) */
13
+ maxWidth?: number;
14
+ /** Vertical spacing between wrapped rows */
15
+ rowSpacing?: number;
16
+ }
17
+ /**
18
+ * Main layout function that applies the selected algorithm
19
+ */
20
+ export declare const applyLayout: (nodes: Node[], edges: Edge[], algorithm: LayoutAlgorithm, direction?: "TB" | "BT" | "LR" | "RL", options?: LayoutOptions) => Promise<{
21
+ nodes: Node[];
22
+ edges: Edge[];
23
+ }>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Utilities for generating and managing node reference IDs
3
+ */
4
+ /**
5
+ * Convert a display name to a snake_case reference ID
6
+ * Only allows alphanumeric characters and underscores
7
+ * Truncates to MAX_REFERENCE_ID_LENGTH chars
8
+ */
9
+ export declare function toReferenceId(displayName: string): string;
10
+ /**
11
+ * Generate a unique display name for a new node, avoiding conflicts
12
+ * Returns names like "AI Model", "AI Model 2", "AI Model 3", etc.
13
+ */
14
+ export declare function generateUniqueDisplayName(baseDisplayName: string, existingNodes: {
15
+ data?: {
16
+ display_name?: string;
17
+ };
18
+ }[]): string;
19
+ /**
20
+ * Generate a unique reference ID for a new node, avoiding conflicts
21
+ * Truncates to MAX_REFERENCE_ID_LENGTH while preserving the increment suffix
22
+ */
23
+ export declare function generateUniqueReferenceId(displayName: string, existingNodes: {
24
+ data?: {
25
+ reference_id?: string;
26
+ };
27
+ }[]): string;
28
+ /**
29
+ * Update reference ID when display name changes
30
+ * Ensures uniqueness among existing nodes
31
+ */
32
+ export declare function updateReferenceIdForDisplayName(newDisplayName: string, currentNodeId: string, existingNodes: {
33
+ id: string;
34
+ data?: {
35
+ reference_id?: string;
36
+ };
37
+ }[]): string;
@@ -0,0 +1,5 @@
1
+ declare module 'react' {
2
+ interface CSSProperties {
3
+ WebkitTextSecurity?: 'none' | 'circle' | 'disc' | 'square';
4
+ }
5
+ }