@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
package/dist/demo.js ADDED
@@ -0,0 +1,2774 @@
1
+ "use client";
2
+ import { $t as e, B as t, I as n, Jt as r, Kt as i, L as a, Mt as o, Pt as s, R as c, V as l, a as u, qt as d, t as f, z as p } from "./Invect-CWpIwZ5F.js";
3
+ import { useCallback as m, useEffect as ee, useMemo as h, useRef as te, useState as g } from "react";
4
+ import { QueryClient as _, QueryClientProvider as v } from "@tanstack/react-query";
5
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
6
+ import { GraphNodeType as x } from "@invect/core/types";
7
+ import { Background as S, BackgroundVariant as ne, Controls as C, ReactFlow as w, ReactFlowProvider as T } from "@xyflow/react";
8
+ //#region src/demo/demo-api-client.ts
9
+ var E = (e = []) => ({
10
+ data: e,
11
+ pagination: {
12
+ page: 1,
13
+ limit: e.length || 20,
14
+ totalPages: 1
15
+ }
16
+ }), D = {
17
+ totalFlows: 0,
18
+ totalRuns: 0,
19
+ runsLast24h: 0,
20
+ activeRuns: 0,
21
+ successRate: 100,
22
+ failedRunsLast24h: 0,
23
+ runsByStatus: {},
24
+ recentRuns: []
25
+ }, O = () => {};
26
+ function k(e = {}) {
27
+ let { flows: t = [], flowReactFlowData: n = {}, nodeDefinitions: r = [], agentTools: i = [], dashboardStats: a = {}, flowRuns: o = [], nodeExecutions: s = {}, credentials: c = [], chatMessages: l = {} } = e, u = {
28
+ ...D,
29
+ totalFlows: t.length,
30
+ totalRuns: o.length,
31
+ runsLast24h: o.length,
32
+ successRate: o.length > 0 ? Math.round(o.filter((e) => e.status === "SUCCESS").length / o.length * 100) : 100,
33
+ runsByStatus: o.reduce((e, t) => (e[t.status] = (e[t.status] || 0) + 1, e), {}),
34
+ recentRuns: o.slice(0, 10),
35
+ ...a
36
+ }, d = {
37
+ getBaseURL: () => "demo://mock",
38
+ setBaseURL: O,
39
+ setUserId: O,
40
+ getDashboardStats: async () => u,
41
+ getFlows: async () => E(t),
42
+ getFlow: async (...e) => {
43
+ let n = e[0];
44
+ return t.find((e) => e.id === n) ?? t[0] ?? null;
45
+ },
46
+ getFlowReactFlowData: async (...e) => n[e[0]] ?? null,
47
+ getFlowVersions: async () => E([]),
48
+ getAvailableNodes: async () => r,
49
+ resolveNodeDefinition: async () => null,
50
+ loadFieldOptions: async () => [],
51
+ getAgentTools: async () => i,
52
+ listCredentials: async () => c,
53
+ getCredential: async (...e) => {
54
+ let t = e[0];
55
+ return c.find((e) => e.id === t) ?? null;
56
+ },
57
+ getCredentialUsage: async () => ({
58
+ flowsCount: 0,
59
+ nodesCount: 0,
60
+ lastUsedAt: null
61
+ }),
62
+ getOAuth2Providers: async () => [],
63
+ getOAuth2Provider: async () => null,
64
+ getFlowRun: async (...e) => {
65
+ let t = e[0];
66
+ return o.find((e) => e.id === t) ?? null;
67
+ },
68
+ getFlowRunsByFlowId: async (...e) => {
69
+ let t = e[0];
70
+ return E(o.filter((e) => e.flowId === t));
71
+ },
72
+ getAllFlowRuns: async () => E(o),
73
+ getNodeExecutionsByFlowRun: async (...e) => s[e[0]] ?? [],
74
+ getAllNodeExecutions: async () => E(Object.values(s).flat()),
75
+ getModels: async () => [],
76
+ getModelsForCredential: async () => [],
77
+ getAvailableDatabases: async () => [],
78
+ listTriggersForFlow: async () => [],
79
+ getTrigger: async () => null,
80
+ getChatStatus: async () => ({ enabled: !0 }),
81
+ getChatModels: async () => [{
82
+ id: "claude-sonnet-4-20250514",
83
+ name: "Claude Sonnet 4",
84
+ provider: "anthropic"
85
+ }, {
86
+ id: "gpt-4o",
87
+ name: "GPT-4o",
88
+ provider: "openai"
89
+ }],
90
+ getChatMessages: async (...e) => l[e[0]] ?? [],
91
+ createFlow: async () => t[0] ?? {},
92
+ createFlowWithVersion: async () => t[0] ?? {},
93
+ updateFlow: async () => t[0] ?? {},
94
+ deleteFlow: async () => void 0,
95
+ createFlowVersion: async () => ({}),
96
+ validateFlow: async () => ({
97
+ isValid: !0,
98
+ errors: [],
99
+ warnings: []
100
+ }),
101
+ executeFlow: async () => ({}),
102
+ executeFlowToNode: async () => ({}),
103
+ testNode: async () => ({}),
104
+ testModelPrompt: async () => ({}),
105
+ testJsExpression: async () => ({}),
106
+ testMapper: async () => ({}),
107
+ executeSqlQuery: async () => ({}),
108
+ createCredential: async () => ({}),
109
+ updateCredential: async () => ({}),
110
+ deleteCredential: async () => void 0,
111
+ testCredential: async () => ({ success: !0 }),
112
+ testCredentialRequest: async () => ({}),
113
+ startOAuth2Flow: async () => ({}),
114
+ handleOAuth2Callback: async () => ({}),
115
+ refreshOAuth2Credential: async () => ({}),
116
+ pauseFlowRun: async () => ({}),
117
+ resumeFlowRun: async () => ({}),
118
+ cancelFlowRun: async () => ({}),
119
+ createTrigger: async () => ({}),
120
+ updateTrigger: async () => ({}),
121
+ deleteTrigger: async () => void 0,
122
+ syncTriggersForFlow: async () => ({}),
123
+ sendChatMessage: async () => ({}),
124
+ saveChatMessages: async () => ({}),
125
+ deleteChatMessages: async () => ({})
126
+ };
127
+ return new Proxy(d, { get(e, t) {
128
+ return t in e ? e[t] : async () => null;
129
+ } });
130
+ }
131
+ //#endregion
132
+ //#region src/demo/DemoInvect.tsx
133
+ function A({ data: e, useMemoryRouter: t = !0, ...n }) {
134
+ return /* @__PURE__ */ y(f, {
135
+ apiClient: h(() => k(e), [e]),
136
+ useMemoryRouter: t,
137
+ ...n
138
+ });
139
+ }
140
+ //#endregion
141
+ //#region src/demo/FlowViewer.tsx
142
+ var j = { default: p }, M = {
143
+ duration: 0,
144
+ padding: .2
145
+ }, N = () => {};
146
+ function P({ nodes: e, edges: r, nodeDefinitions: i = [], agentTools: o = [], interactive: s = !0, showControls: f = !0 }) {
147
+ let { resolvedTheme: p } = d(), _ = te(null), [v, T] = g(!1), [E, D] = g(null), O = l((e) => e.syncFromServer), k = l((e) => e.setFlowId);
148
+ ee(() => {
149
+ k("demo-flow", void 0), O(e, r, "demo-flow:1", "Demo Flow");
150
+ }, [
151
+ e,
152
+ r,
153
+ O,
154
+ k
155
+ ]);
156
+ let A = h(() => {
157
+ let e = {
158
+ [x.AGENT]: n,
159
+ default: c
160
+ };
161
+ for (let t of i) t.type in e || (e[t.type] = c);
162
+ return e;
163
+ }, [i]), P = h(() => o.filter((e) => e.provider?.id !== "triggers" && !e.id.startsWith("trigger.")).map((e) => ({
164
+ id: e.id,
165
+ name: e.name,
166
+ description: e.description,
167
+ category: e.category,
168
+ tags: e.tags,
169
+ inputSchema: e.inputSchema,
170
+ nodeType: e.nodeType,
171
+ provider: e.provider
172
+ })), [o]), F = h(() => ({
173
+ onOpenToolSelector: N,
174
+ onShowMoreTools: N,
175
+ onRemoveTool: N,
176
+ onToolClick: N,
177
+ availableTools: P,
178
+ selectedToolNodeId: null,
179
+ selectedToolInstanceId: null
180
+ }), [P]), I = m((e, t) => {
181
+ s && (D(t.id), T(!0));
182
+ }, [s]), L = m((e) => {
183
+ e || (T(!1), D(null));
184
+ }, []);
185
+ return /* @__PURE__ */ b("div", {
186
+ ref: _,
187
+ style: {
188
+ width: "100%",
189
+ height: "100%",
190
+ background: "var(--canvas-background)"
191
+ },
192
+ children: [/* @__PURE__ */ y(a, {
193
+ value: F,
194
+ children: /* @__PURE__ */ b(w, {
195
+ nodes: e,
196
+ edges: r,
197
+ nodeTypes: A,
198
+ edgeTypes: j,
199
+ defaultEdgeOptions: t,
200
+ colorMode: p,
201
+ fitView: !0,
202
+ fitViewOptions: M,
203
+ onNodeDoubleClick: s ? I : void 0,
204
+ nodesDraggable: !1,
205
+ nodesConnectable: !1,
206
+ elementsSelectable: s,
207
+ panOnScroll: !0,
208
+ panOnDrag: !0,
209
+ zoomOnScroll: !0,
210
+ zoomOnPinch: !0,
211
+ zoomOnDoubleClick: !1,
212
+ children: [f && /* @__PURE__ */ y(C, {}), /* @__PURE__ */ y(S, {
213
+ variant: ne.Dots,
214
+ gap: 20,
215
+ size: 1.2
216
+ })]
217
+ })
218
+ }), s && /* @__PURE__ */ y(u, {
219
+ open: v,
220
+ nodeId: E,
221
+ flowId: "demo-flow",
222
+ onOpenChange: L,
223
+ portalContainer: _.current,
224
+ availableTools: P
225
+ })]
226
+ });
227
+ }
228
+ function F({ theme: t = "dark", className: n, style: a, containerClassName: c, nodeDefinitions: l = [], agentTools: u = [], ...d }) {
229
+ let f = h(() => new _({ defaultOptions: { queries: {
230
+ staleTime: Infinity,
231
+ retry: !1
232
+ } } }), []), p = h(() => k({
233
+ nodeDefinitions: l,
234
+ agentTools: u
235
+ }), [l, u]);
236
+ return /* @__PURE__ */ y("div", {
237
+ className: c,
238
+ style: {
239
+ position: "relative",
240
+ overflow: "hidden",
241
+ ...a
242
+ },
243
+ children: /* @__PURE__ */ y(i, {
244
+ defaultTheme: t,
245
+ storageKey: "invect-viewer-theme",
246
+ className: n,
247
+ children: /* @__PURE__ */ y(v, {
248
+ client: f,
249
+ children: /* @__PURE__ */ y(r, {
250
+ apiClient: p,
251
+ children: /* @__PURE__ */ y(o, {
252
+ plugins: [],
253
+ children: /* @__PURE__ */ y(e, { children: /* @__PURE__ */ y(s, { children: /* @__PURE__ */ y(T, { children: /* @__PURE__ */ y(P, {
254
+ nodeDefinitions: l,
255
+ agentTools: u,
256
+ ...d
257
+ }) }) }) })
258
+ })
259
+ })
260
+ })
261
+ })
262
+ });
263
+ }
264
+ //#endregion
265
+ //#region src/demo/sample-data.ts
266
+ var I = [
267
+ {
268
+ type: "core.input",
269
+ label: "Flow Input",
270
+ description: "Entry point for the flow. Defines input variables.",
271
+ icon: "ArrowRightToLine",
272
+ provider: {
273
+ id: "core",
274
+ name: "Core",
275
+ icon: "Blocks"
276
+ },
277
+ input: void 0,
278
+ outputs: [{
279
+ id: "output",
280
+ label: "Output",
281
+ type: "any"
282
+ }],
283
+ paramFields: [{
284
+ name: "inputSchema",
285
+ label: "Input Schema",
286
+ type: "json",
287
+ required: !1
288
+ }],
289
+ maxInstances: 1
290
+ },
291
+ {
292
+ type: "core.output",
293
+ label: "Flow Output",
294
+ description: "Exit point for the flow. Returns data to the caller.",
295
+ icon: "ArrowLeftFromLine",
296
+ provider: {
297
+ id: "core",
298
+ name: "Core",
299
+ icon: "Blocks"
300
+ },
301
+ input: {
302
+ id: "input",
303
+ label: "Input",
304
+ type: "any"
305
+ },
306
+ outputs: [],
307
+ paramFields: [],
308
+ maxInstances: 1
309
+ },
310
+ {
311
+ type: "core.model",
312
+ label: "AI Model",
313
+ description: "Send a prompt to an LLM (OpenAI, Anthropic, etc.)",
314
+ icon: "Brain",
315
+ provider: {
316
+ id: "core",
317
+ name: "Core",
318
+ icon: "Blocks"
319
+ },
320
+ input: {
321
+ id: "input",
322
+ label: "Input",
323
+ type: "any"
324
+ },
325
+ outputs: [{
326
+ id: "output",
327
+ label: "Output",
328
+ type: "string"
329
+ }],
330
+ paramFields: [
331
+ {
332
+ name: "credentialId",
333
+ label: "API Credential",
334
+ type: "credential",
335
+ required: !0,
336
+ credentialTypes: ["llm"]
337
+ },
338
+ {
339
+ name: "model",
340
+ label: "Model",
341
+ type: "select",
342
+ required: !0,
343
+ options: [
344
+ {
345
+ label: "GPT-4o",
346
+ value: "gpt-4o"
347
+ },
348
+ {
349
+ label: "GPT-4o Mini",
350
+ value: "gpt-4o-mini"
351
+ },
352
+ {
353
+ label: "Claude Sonnet 4",
354
+ value: "claude-sonnet-4-20250514"
355
+ }
356
+ ]
357
+ },
358
+ {
359
+ name: "prompt",
360
+ label: "Prompt",
361
+ type: "textarea",
362
+ required: !0
363
+ },
364
+ {
365
+ name: "systemPrompt",
366
+ label: "System Prompt",
367
+ type: "textarea",
368
+ required: !1
369
+ }
370
+ ]
371
+ },
372
+ {
373
+ type: "core.jq",
374
+ label: "JQ Transform",
375
+ description: "Transform JSON data using JQ expressions.",
376
+ icon: "Braces",
377
+ provider: {
378
+ id: "core",
379
+ name: "Core",
380
+ icon: "Blocks"
381
+ },
382
+ input: {
383
+ id: "input",
384
+ label: "Input",
385
+ type: "any"
386
+ },
387
+ outputs: [{
388
+ id: "output",
389
+ label: "Output",
390
+ type: "any"
391
+ }],
392
+ paramFields: [{
393
+ name: "query",
394
+ label: "JQ Query",
395
+ type: "code",
396
+ required: !0
397
+ }]
398
+ },
399
+ {
400
+ type: "core.if_else",
401
+ label: "If/Else",
402
+ description: "Conditional branching based on a JavaScript expression.",
403
+ icon: "GitBranch",
404
+ provider: {
405
+ id: "core",
406
+ name: "Core",
407
+ icon: "Blocks"
408
+ },
409
+ input: {
410
+ id: "input",
411
+ label: "Input",
412
+ type: "any"
413
+ },
414
+ outputs: [{
415
+ id: "true_output",
416
+ label: "True",
417
+ type: "any"
418
+ }, {
419
+ id: "false_output",
420
+ label: "False",
421
+ type: "any"
422
+ }],
423
+ paramFields: [{
424
+ name: "condition",
425
+ label: "Condition",
426
+ type: "code",
427
+ required: !0
428
+ }]
429
+ },
430
+ {
431
+ type: "http.request",
432
+ label: "HTTP Request",
433
+ description: "Make an HTTP request to any URL.",
434
+ icon: "Globe",
435
+ provider: {
436
+ id: "http",
437
+ name: "HTTP",
438
+ icon: "Globe"
439
+ },
440
+ input: {
441
+ id: "input",
442
+ label: "Input",
443
+ type: "any"
444
+ },
445
+ outputs: [{
446
+ id: "output",
447
+ label: "Response",
448
+ type: "object"
449
+ }],
450
+ paramFields: [
451
+ {
452
+ name: "method",
453
+ label: "Method",
454
+ type: "select",
455
+ required: !0,
456
+ options: [
457
+ {
458
+ label: "GET",
459
+ value: "GET"
460
+ },
461
+ {
462
+ label: "POST",
463
+ value: "POST"
464
+ },
465
+ {
466
+ label: "PUT",
467
+ value: "PUT"
468
+ },
469
+ {
470
+ label: "DELETE",
471
+ value: "DELETE"
472
+ }
473
+ ],
474
+ defaultValue: "GET"
475
+ },
476
+ {
477
+ name: "url",
478
+ label: "URL",
479
+ type: "text",
480
+ required: !0
481
+ },
482
+ {
483
+ name: "headers",
484
+ label: "Headers",
485
+ type: "json",
486
+ required: !1
487
+ },
488
+ {
489
+ name: "body",
490
+ label: "Body",
491
+ type: "json",
492
+ required: !1
493
+ }
494
+ ]
495
+ },
496
+ {
497
+ type: "gmail.send_message",
498
+ label: "Send Email",
499
+ description: "Send an email via Gmail.",
500
+ icon: "Mail",
501
+ provider: {
502
+ id: "gmail",
503
+ name: "Gmail",
504
+ icon: "Mail"
505
+ },
506
+ input: {
507
+ id: "input",
508
+ label: "Input",
509
+ type: "any"
510
+ },
511
+ outputs: [{
512
+ id: "output",
513
+ label: "Result",
514
+ type: "object"
515
+ }],
516
+ paramFields: [
517
+ {
518
+ name: "to",
519
+ label: "To",
520
+ type: "text",
521
+ required: !0
522
+ },
523
+ {
524
+ name: "subject",
525
+ label: "Subject",
526
+ type: "text",
527
+ required: !0
528
+ },
529
+ {
530
+ name: "body",
531
+ label: "Body",
532
+ type: "textarea",
533
+ required: !0
534
+ }
535
+ ]
536
+ },
537
+ {
538
+ type: "gmail.get_message",
539
+ label: "Get Email",
540
+ description: "Retrieve a Gmail message by ID.",
541
+ icon: "Mail",
542
+ provider: {
543
+ id: "gmail",
544
+ name: "Gmail",
545
+ icon: "Mail"
546
+ },
547
+ input: {
548
+ id: "input",
549
+ label: "Input",
550
+ type: "any"
551
+ },
552
+ outputs: [{
553
+ id: "output",
554
+ label: "Message",
555
+ type: "object"
556
+ }],
557
+ paramFields: [{
558
+ name: "messageId",
559
+ label: "Message ID",
560
+ type: "text",
561
+ required: !0
562
+ }]
563
+ },
564
+ {
565
+ type: "gmail.modify_labels",
566
+ label: "Modify Labels",
567
+ description: "Add or remove labels from a Gmail message.",
568
+ icon: "Mail",
569
+ provider: {
570
+ id: "gmail",
571
+ name: "Gmail",
572
+ icon: "Mail"
573
+ },
574
+ input: {
575
+ id: "input",
576
+ label: "Input",
577
+ type: "any"
578
+ },
579
+ outputs: [{
580
+ id: "output",
581
+ label: "Result",
582
+ type: "object"
583
+ }],
584
+ paramFields: [
585
+ {
586
+ name: "messageId",
587
+ label: "Message ID",
588
+ type: "text",
589
+ required: !0
590
+ },
591
+ {
592
+ name: "addLabels",
593
+ label: "Add Labels",
594
+ type: "text",
595
+ required: !1
596
+ },
597
+ {
598
+ name: "removeLabels",
599
+ label: "Remove Labels",
600
+ type: "text",
601
+ required: !1
602
+ }
603
+ ]
604
+ },
605
+ {
606
+ type: "slack.send_message",
607
+ label: "Send Message",
608
+ description: "Send a message to a Slack channel.",
609
+ icon: "MessageSquare",
610
+ provider: {
611
+ id: "slack",
612
+ name: "Slack",
613
+ icon: "MessageSquare"
614
+ },
615
+ input: {
616
+ id: "input",
617
+ label: "Input",
618
+ type: "any"
619
+ },
620
+ outputs: [{
621
+ id: "output",
622
+ label: "Result",
623
+ type: "object"
624
+ }],
625
+ paramFields: [{
626
+ name: "channel",
627
+ label: "Channel",
628
+ type: "text",
629
+ required: !0
630
+ }, {
631
+ name: "text",
632
+ label: "Message",
633
+ type: "textarea",
634
+ required: !0
635
+ }]
636
+ },
637
+ {
638
+ type: "linear.create_issue",
639
+ label: "Create Issue",
640
+ description: "Create a new issue in Linear.",
641
+ icon: "SquarePen",
642
+ provider: {
643
+ id: "linear",
644
+ name: "Linear",
645
+ icon: "SquarePen"
646
+ },
647
+ input: {
648
+ id: "input",
649
+ label: "Input",
650
+ type: "any"
651
+ },
652
+ outputs: [{
653
+ id: "output",
654
+ label: "Issue",
655
+ type: "object"
656
+ }],
657
+ paramFields: [
658
+ {
659
+ name: "title",
660
+ label: "Title",
661
+ type: "text",
662
+ required: !0
663
+ },
664
+ {
665
+ name: "description",
666
+ label: "Description",
667
+ type: "textarea",
668
+ required: !1
669
+ },
670
+ {
671
+ name: "teamId",
672
+ label: "Team ID",
673
+ type: "text",
674
+ required: !0
675
+ }
676
+ ]
677
+ },
678
+ {
679
+ type: "linear.update_issue",
680
+ label: "Update Issue",
681
+ description: "Update an existing issue in Linear.",
682
+ icon: "SquarePen",
683
+ provider: {
684
+ id: "linear",
685
+ name: "Linear",
686
+ icon: "SquarePen"
687
+ },
688
+ input: {
689
+ id: "input",
690
+ label: "Input",
691
+ type: "any"
692
+ },
693
+ outputs: [{
694
+ id: "output",
695
+ label: "Issue",
696
+ type: "object"
697
+ }],
698
+ paramFields: [
699
+ {
700
+ name: "issueId",
701
+ label: "Issue ID",
702
+ type: "text",
703
+ required: !0
704
+ },
705
+ {
706
+ name: "stateId",
707
+ label: "State",
708
+ type: "text",
709
+ required: !1
710
+ },
711
+ {
712
+ name: "comment",
713
+ label: "Comment",
714
+ type: "textarea",
715
+ required: !1
716
+ }
717
+ ]
718
+ },
719
+ {
720
+ type: "github.create_issue",
721
+ label: "Create Issue",
722
+ description: "Create a new GitHub issue.",
723
+ icon: "Github",
724
+ provider: {
725
+ id: "github",
726
+ name: "GitHub",
727
+ icon: "Github"
728
+ },
729
+ input: {
730
+ id: "input",
731
+ label: "Input",
732
+ type: "any"
733
+ },
734
+ outputs: [{
735
+ id: "output",
736
+ label: "Issue",
737
+ type: "object"
738
+ }],
739
+ paramFields: [
740
+ {
741
+ name: "owner",
742
+ label: "Owner",
743
+ type: "text",
744
+ required: !0
745
+ },
746
+ {
747
+ name: "repo",
748
+ label: "Repository",
749
+ type: "text",
750
+ required: !0
751
+ },
752
+ {
753
+ name: "title",
754
+ label: "Title",
755
+ type: "text",
756
+ required: !0
757
+ },
758
+ {
759
+ name: "body",
760
+ label: "Body",
761
+ type: "textarea",
762
+ required: !1
763
+ }
764
+ ]
765
+ },
766
+ {
767
+ type: "trigger.webhook",
768
+ label: "Webhook Trigger",
769
+ description: "Trigger a flow from an incoming webhook.",
770
+ icon: "Webhook",
771
+ provider: {
772
+ id: "triggers",
773
+ name: "Triggers",
774
+ icon: "Zap"
775
+ },
776
+ input: void 0,
777
+ outputs: [{
778
+ id: "output",
779
+ label: "Payload",
780
+ type: "any"
781
+ }],
782
+ paramFields: [],
783
+ maxInstances: 1
784
+ },
785
+ {
786
+ type: "AGENT",
787
+ label: "AI Agent",
788
+ description: "Autonomous AI agent with iterative tool-calling loop.",
789
+ icon: "Bot",
790
+ provider: {
791
+ id: "core",
792
+ name: "Core",
793
+ icon: "Blocks"
794
+ },
795
+ input: {
796
+ id: "input",
797
+ label: "Input",
798
+ type: "any"
799
+ },
800
+ outputs: [{
801
+ id: "output",
802
+ label: "Output",
803
+ type: "any"
804
+ }],
805
+ paramFields: [
806
+ {
807
+ name: "credentialId",
808
+ label: "API Credential",
809
+ type: "credential",
810
+ required: !0,
811
+ credentialTypes: ["llm"]
812
+ },
813
+ {
814
+ name: "model",
815
+ label: "Model",
816
+ type: "select",
817
+ required: !0,
818
+ options: [{
819
+ label: "GPT-4o",
820
+ value: "gpt-4o"
821
+ }, {
822
+ label: "Claude Sonnet 4",
823
+ value: "claude-sonnet-4-20250514"
824
+ }]
825
+ },
826
+ {
827
+ name: "taskPrompt",
828
+ label: "Task Prompt",
829
+ type: "textarea",
830
+ required: !0
831
+ },
832
+ {
833
+ name: "systemPrompt",
834
+ label: "System Prompt",
835
+ type: "textarea",
836
+ required: !1
837
+ }
838
+ ]
839
+ },
840
+ {
841
+ type: "core.switch",
842
+ label: "Switch",
843
+ description: "Multi-way conditional branching based on JS expressions.",
844
+ icon: "GitFork",
845
+ provider: {
846
+ id: "core",
847
+ name: "Core",
848
+ icon: "Blocks"
849
+ },
850
+ input: {
851
+ id: "input",
852
+ label: "Input",
853
+ type: "any"
854
+ },
855
+ dynamicOutputs: !0,
856
+ outputs: [{
857
+ id: "case_0",
858
+ label: "Case 0",
859
+ type: "any"
860
+ }, {
861
+ id: "default",
862
+ label: "Default",
863
+ type: "any"
864
+ }],
865
+ paramFields: [{
866
+ name: "matchMode",
867
+ label: "Match Mode",
868
+ type: "select",
869
+ required: !1,
870
+ options: [{
871
+ label: "First match",
872
+ value: "first"
873
+ }, {
874
+ label: "All matches",
875
+ value: "all"
876
+ }]
877
+ }, {
878
+ name: "cases",
879
+ label: "Cases",
880
+ type: "switch-cases",
881
+ required: !0
882
+ }]
883
+ },
884
+ {
885
+ type: "github.create_pull_request",
886
+ label: "Create Pull Request",
887
+ description: "Create a new pull request on GitHub.",
888
+ icon: "GitPullRequest",
889
+ provider: {
890
+ id: "github",
891
+ name: "GitHub",
892
+ icon: "Github"
893
+ },
894
+ input: {
895
+ id: "input",
896
+ label: "Input",
897
+ type: "any"
898
+ },
899
+ outputs: [{
900
+ id: "output",
901
+ label: "PR",
902
+ type: "object"
903
+ }],
904
+ paramFields: [
905
+ {
906
+ name: "owner",
907
+ label: "Owner",
908
+ type: "text",
909
+ required: !0
910
+ },
911
+ {
912
+ name: "repo",
913
+ label: "Repository",
914
+ type: "text",
915
+ required: !0
916
+ },
917
+ {
918
+ name: "title",
919
+ label: "Title",
920
+ type: "text",
921
+ required: !0
922
+ },
923
+ {
924
+ name: "body",
925
+ label: "Body",
926
+ type: "textarea",
927
+ required: !1
928
+ },
929
+ {
930
+ name: "head",
931
+ label: "Head Branch",
932
+ type: "text",
933
+ required: !0
934
+ },
935
+ {
936
+ name: "base",
937
+ label: "Base Branch",
938
+ type: "text",
939
+ required: !0
940
+ }
941
+ ]
942
+ }
943
+ ], L = [
944
+ {
945
+ id: "node-input",
946
+ type: "core.input",
947
+ position: {
948
+ x: 0,
949
+ y: 100
950
+ },
951
+ data: {
952
+ id: "node-input",
953
+ type: "core.input",
954
+ display_name: "User Query",
955
+ reference_id: "user_query",
956
+ status: "idle",
957
+ params: {}
958
+ }
959
+ },
960
+ {
961
+ id: "node-model",
962
+ type: "core.model",
963
+ position: {
964
+ x: 300,
965
+ y: 100
966
+ },
967
+ data: {
968
+ id: "node-model",
969
+ type: "core.model",
970
+ display_name: "Summarize",
971
+ reference_id: "summarize",
972
+ status: "idle",
973
+ params: {
974
+ model: "gpt-4o",
975
+ prompt: "Summarize the following text:\n\n{{ user_query }}",
976
+ systemPrompt: "You are a helpful assistant that summarizes text concisely."
977
+ }
978
+ }
979
+ },
980
+ {
981
+ id: "node-jq",
982
+ type: "core.jq",
983
+ position: {
984
+ x: 600,
985
+ y: 100
986
+ },
987
+ data: {
988
+ id: "node-jq",
989
+ type: "core.jq",
990
+ display_name: "Format Output",
991
+ reference_id: "format_output",
992
+ status: "idle",
993
+ params: { query: "{ summary: .summarize, timestamp: now | todate }" }
994
+ }
995
+ },
996
+ {
997
+ id: "node-output",
998
+ type: "core.output",
999
+ position: {
1000
+ x: 900,
1001
+ y: 100
1002
+ },
1003
+ data: {
1004
+ id: "node-output",
1005
+ type: "core.output",
1006
+ display_name: "Result",
1007
+ reference_id: "result",
1008
+ status: "idle",
1009
+ params: {}
1010
+ }
1011
+ }
1012
+ ], R = [
1013
+ {
1014
+ id: "e-input-model",
1015
+ source: "node-input",
1016
+ target: "node-model"
1017
+ },
1018
+ {
1019
+ id: "e-model-jq",
1020
+ source: "node-model",
1021
+ target: "node-jq"
1022
+ },
1023
+ {
1024
+ id: "e-jq-output",
1025
+ source: "node-jq",
1026
+ target: "node-output"
1027
+ }
1028
+ ], z = [
1029
+ {
1030
+ id: "b-input",
1031
+ type: "core.input",
1032
+ position: {
1033
+ x: 0,
1034
+ y: 150
1035
+ },
1036
+ data: {
1037
+ id: "b-input",
1038
+ type: "core.input",
1039
+ display_name: "Webhook Data",
1040
+ reference_id: "webhook_data",
1041
+ status: "idle",
1042
+ params: {}
1043
+ }
1044
+ },
1045
+ {
1046
+ id: "b-branch",
1047
+ type: "core.if_else",
1048
+ position: {
1049
+ x: 300,
1050
+ y: 150
1051
+ },
1052
+ data: {
1053
+ id: "b-branch",
1054
+ type: "core.if_else",
1055
+ display_name: "Is Priority?",
1056
+ reference_id: "is_priority",
1057
+ status: "idle",
1058
+ params: { condition: "{{ webhook_data.priority === \"high\" }}" }
1059
+ }
1060
+ },
1061
+ {
1062
+ id: "b-http",
1063
+ type: "http.request",
1064
+ position: {
1065
+ x: 600,
1066
+ y: 50
1067
+ },
1068
+ data: {
1069
+ id: "b-http",
1070
+ type: "http.request",
1071
+ display_name: "Create Ticket",
1072
+ reference_id: "create_ticket",
1073
+ status: "idle",
1074
+ params: {
1075
+ method: "POST",
1076
+ url: "https://api.example.com/tickets",
1077
+ body: "{{ { title: is_priority.subject, priority: \"urgent\" } }}"
1078
+ }
1079
+ }
1080
+ },
1081
+ {
1082
+ id: "b-email",
1083
+ type: "gmail.send_message",
1084
+ position: {
1085
+ x: 600,
1086
+ y: 280
1087
+ },
1088
+ data: {
1089
+ id: "b-email",
1090
+ type: "gmail.send_message",
1091
+ display_name: "Notify Team",
1092
+ reference_id: "notify_team",
1093
+ status: "idle",
1094
+ params: {
1095
+ to: "team@example.com",
1096
+ subject: "Low priority notification",
1097
+ body: "{{ is_priority.message }}"
1098
+ }
1099
+ }
1100
+ },
1101
+ {
1102
+ id: "b-output",
1103
+ type: "core.output",
1104
+ position: {
1105
+ x: 900,
1106
+ y: 150
1107
+ },
1108
+ data: {
1109
+ id: "b-output",
1110
+ type: "core.output",
1111
+ display_name: "Done",
1112
+ reference_id: "done",
1113
+ status: "idle",
1114
+ params: {}
1115
+ }
1116
+ }
1117
+ ], B = [
1118
+ {
1119
+ id: "be-input-branch",
1120
+ source: "b-input",
1121
+ target: "b-branch"
1122
+ },
1123
+ {
1124
+ id: "be-branch-http",
1125
+ source: "b-branch",
1126
+ target: "b-http",
1127
+ sourceHandle: "true_output"
1128
+ },
1129
+ {
1130
+ id: "be-branch-email",
1131
+ source: "b-branch",
1132
+ target: "b-email",
1133
+ sourceHandle: "false_output"
1134
+ },
1135
+ {
1136
+ id: "be-http-output",
1137
+ source: "b-http",
1138
+ target: "b-output"
1139
+ },
1140
+ {
1141
+ id: "be-email-output",
1142
+ source: "b-email",
1143
+ target: "b-output"
1144
+ }
1145
+ ], V = {
1146
+ action: "create",
1147
+ type: "Issue",
1148
+ data: {
1149
+ id: "LIN-4821",
1150
+ identifier: "ENG-4821",
1151
+ title: "Payment processing fails with 502 for Stripe webhook handler",
1152
+ description: "Multiple customers reporting failed payments since 14:30 UTC. Stripe webhook endpoint returns 502. Logs show connection pool exhaustion in payment-service.",
1153
+ priority: 1,
1154
+ state: { name: "Triage" },
1155
+ team: {
1156
+ key: "ENG",
1157
+ name: "Engineering"
1158
+ },
1159
+ creator: {
1160
+ name: "Sarah Chen",
1161
+ email: "sarah@acme.com"
1162
+ },
1163
+ labels: [
1164
+ { name: "bug" },
1165
+ { name: "payments" },
1166
+ { name: "urgent" }
1167
+ ],
1168
+ url: "https://linear.app/acme/issue/ENG-4821",
1169
+ createdAt: "2025-04-07T14:32:00Z"
1170
+ }
1171
+ }, H = {
1172
+ summary: "Payment processing failures caused by PostgreSQL connection pool exhaustion in payment-service. The Stripe webhook handler opens a new DB connection per request but the pool limit (20) was exceeded during a traffic spike at 14:30 UTC. 847 failed payments in the last 2 hours affecting ~320 customers.",
1173
+ root_cause: "Connection pool exhaustion in payment-service. The `handleStripeWebhook()` function in `src/services/payments/stripe-handler.ts` acquires a connection but does not release it on the error path (missing `finally` block). Under normal load this is masked by the pool recycler, but the 3x traffic spike from the flash sale exhausted all 20 connections.",
1174
+ severity: "critical",
1175
+ issue_type: "bug",
1176
+ recommended_action: "Hotfix: Add `finally { connection.release() }` in stripe-handler.ts. Increase pool size to 50 as interim measure. Consider switching to a connection-per-transaction pattern.",
1177
+ affected_customers: 320,
1178
+ failed_transactions: 847,
1179
+ estimated_revenue_impact: "$42,350"
1180
+ }, U = {
1181
+ id: 98712,
1182
+ number: 4293,
1183
+ html_url: "https://github.com/acme/platform/pull/4293",
1184
+ title: "fix: Payment processing fails with 502 for Stripe webhook handler",
1185
+ state: "open",
1186
+ head: { ref: "fix/ENG-4821" },
1187
+ base: { ref: "main" },
1188
+ created_at: "2025-04-07T16:32:45Z"
1189
+ }, W = [
1190
+ {
1191
+ id: "postgres.execute_query",
1192
+ name: "Query Database",
1193
+ description: "Execute a SQL query against a PostgreSQL database.",
1194
+ category: "data",
1195
+ provider: {
1196
+ id: "postgres",
1197
+ name: "PostgreSQL",
1198
+ icon: "Database"
1199
+ }
1200
+ },
1201
+ {
1202
+ id: "sentry.list_issues",
1203
+ name: "Sentry Issues",
1204
+ description: "Search Sentry for recent errors matching the ticket.",
1205
+ category: "web",
1206
+ provider: {
1207
+ id: "sentry",
1208
+ name: "Sentry",
1209
+ icon: "Bug"
1210
+ }
1211
+ },
1212
+ {
1213
+ id: "cloudwatch.start_query",
1214
+ name: "AWS Log Insights",
1215
+ description: "Query CloudWatch Logs Insights for anomalies.",
1216
+ category: "data",
1217
+ provider: {
1218
+ id: "cloudwatch",
1219
+ name: "CloudWatch",
1220
+ icon: "Cloud"
1221
+ }
1222
+ },
1223
+ {
1224
+ id: "notion.search",
1225
+ name: "Search Notion",
1226
+ description: "Search Notion workspace for relevant documentation.",
1227
+ category: "web",
1228
+ provider: {
1229
+ id: "notion",
1230
+ name: "Notion",
1231
+ icon: "FileText"
1232
+ }
1233
+ },
1234
+ {
1235
+ id: "github.get_file_content",
1236
+ name: "Read Source File",
1237
+ description: "Read a file from the GitHub repository.",
1238
+ category: "code",
1239
+ provider: {
1240
+ id: "github",
1241
+ name: "GitHub",
1242
+ icon: "Github"
1243
+ }
1244
+ }
1245
+ ], G = [
1246
+ {
1247
+ id: "s-webhook",
1248
+ type: "trigger.webhook",
1249
+ position: {
1250
+ x: 0,
1251
+ y: 240
1252
+ },
1253
+ data: {
1254
+ id: "s-webhook",
1255
+ type: "trigger.webhook",
1256
+ display_name: "Linear Webhook",
1257
+ reference_id: "linear_webhook",
1258
+ status: "idle",
1259
+ params: { credentialId: "linear-test" }
1260
+ }
1261
+ },
1262
+ {
1263
+ id: "s-agent",
1264
+ type: "AGENT",
1265
+ position: {
1266
+ x: 280,
1267
+ y: 240
1268
+ },
1269
+ data: {
1270
+ id: "s-agent",
1271
+ type: "AGENT",
1272
+ display_name: "Investigation Agent",
1273
+ reference_id: "investigation_agent",
1274
+ status: "idle",
1275
+ params: {
1276
+ credentialId: "openai-test",
1277
+ model: "gpt-4o",
1278
+ taskPrompt: "Investigate Linear ticket \"{{ linear_webhook.title }}\".\n\n1. Query the database for related records\n2. Search Sentry for recent errors\n3. Check AWS logs for anomalies\n4. Search Notion for relevant docs\n5. Read related source files on GitHub\n\nOutput a JSON object with: summary, root_cause, severity (critical/high/medium/low), issue_type (bug/feature_request/incident), and recommended_action.",
1279
+ systemPrompt: "You are a senior on-call engineer performing ticket triage. Be thorough but concise.",
1280
+ maxIterations: 10,
1281
+ stopCondition: "explicit_stop",
1282
+ temperature: .7,
1283
+ toolTimeoutMs: 3e4,
1284
+ maxConversationTokens: 1e5,
1285
+ enableParallelTools: !0,
1286
+ useBatchProcessing: !1,
1287
+ maxTokens: 2e3,
1288
+ addedTools: [
1289
+ {
1290
+ instanceId: "tool_qn4q8nv0",
1291
+ toolId: "postgres.execute_query",
1292
+ name: "Query Database",
1293
+ description: "Query PostgreSQL for related records",
1294
+ params: { _aiChosenModes: { query: !0 } }
1295
+ },
1296
+ {
1297
+ instanceId: "tool_qvs9k37e",
1298
+ toolId: "sentry.list_issues",
1299
+ name: "Sentry Issues",
1300
+ description: "Search Sentry for recent errors matching the ticket",
1301
+ params: { _aiChosenModes: { query: !0 } }
1302
+ },
1303
+ {
1304
+ instanceId: "tool_bwhiecqs",
1305
+ toolId: "cloudwatch.start_query",
1306
+ name: "AWS Log Insights",
1307
+ description: "Query CloudWatch Logs Insights for anomalies",
1308
+ params: { _aiChosenModes: {
1309
+ logGroupName: !0,
1310
+ queryString: !0
1311
+ } }
1312
+ },
1313
+ {
1314
+ instanceId: "tool_cxbfi7au",
1315
+ toolId: "notion.search",
1316
+ name: "Search Notion",
1317
+ description: "Search Notion workspace for relevant documentation",
1318
+ params: { _aiChosenModes: { query: !0 } }
1319
+ },
1320
+ {
1321
+ instanceId: "tool_dez9g3z0",
1322
+ toolId: "github.get_file_content",
1323
+ name: "Read Source File",
1324
+ description: "Read a file from the GitHub repository",
1325
+ params: { _aiChosenModes: {
1326
+ owner: !0,
1327
+ repo: !0,
1328
+ path: !0
1329
+ } }
1330
+ }
1331
+ ]
1332
+ }
1333
+ }
1334
+ },
1335
+ {
1336
+ id: "s-switch",
1337
+ type: "core.switch",
1338
+ position: {
1339
+ x: 580,
1340
+ y: 220
1341
+ },
1342
+ data: {
1343
+ id: "s-switch",
1344
+ type: "core.switch",
1345
+ display_name: "Route by Issue Type",
1346
+ reference_id: "route_by_issue_type",
1347
+ status: "idle",
1348
+ params: {
1349
+ matchMode: "first",
1350
+ cases: [
1351
+ {
1352
+ slug: "bug",
1353
+ label: "Bug",
1354
+ expression: "investigation.issue_type === \"bug\""
1355
+ },
1356
+ {
1357
+ slug: "feature",
1358
+ label: "Feature Request",
1359
+ expression: "investigation.issue_type === \"feature_request\""
1360
+ },
1361
+ {
1362
+ slug: "incident",
1363
+ label: "Incident",
1364
+ expression: "investigation.issue_type === \"incident\""
1365
+ }
1366
+ ]
1367
+ }
1368
+ }
1369
+ },
1370
+ {
1371
+ id: "s-gh-pr",
1372
+ type: "github.create_pull_request",
1373
+ position: {
1374
+ x: 900,
1375
+ y: 80
1376
+ },
1377
+ data: {
1378
+ id: "s-gh-pr",
1379
+ type: "github.create_pull_request",
1380
+ display_name: "Create Fix PR",
1381
+ reference_id: "create_fix_pr",
1382
+ status: "idle",
1383
+ params: {
1384
+ credentialId: "github-test",
1385
+ owner: "acme",
1386
+ repo: "platform",
1387
+ title: "fix: {{ linear_webhook.title }}",
1388
+ body: "{{ investigation.summary }}\n\nRoot cause: {{ investigation.root_cause }}",
1389
+ head: "fix/{{ linear_webhook.identifier }}",
1390
+ base: "main"
1391
+ }
1392
+ }
1393
+ },
1394
+ {
1395
+ id: "s-slack-feature",
1396
+ type: "slack.send_message",
1397
+ position: {
1398
+ x: 900,
1399
+ y: 190
1400
+ },
1401
+ data: {
1402
+ id: "s-slack-feature",
1403
+ type: "slack.send_message",
1404
+ display_name: "Notify #product",
1405
+ reference_id: "notify_product",
1406
+ status: "idle",
1407
+ params: {
1408
+ credentialId: "slack-test",
1409
+ channel: "#product-requests",
1410
+ text: "*New feature request:* {{ linear_webhook.title }}\n\n{{ investigation.summary }}"
1411
+ }
1412
+ }
1413
+ },
1414
+ {
1415
+ id: "s-pagerduty",
1416
+ type: "http.request",
1417
+ position: {
1418
+ x: 900,
1419
+ y: 290
1420
+ },
1421
+ data: {
1422
+ id: "s-pagerduty",
1423
+ type: "http.request",
1424
+ display_name: "PagerDuty Alert",
1425
+ reference_id: "pagerduty_alert",
1426
+ status: "idle",
1427
+ params: {
1428
+ method: "POST",
1429
+ url: "https://events.pagerduty.com/v2/enqueue",
1430
+ body: "{\"routing_key\": \"R0123456789abcdef\", \"event_action\": \"trigger\", \"payload\": {\"summary\": \"{{ investigation.summary }}\", \"severity\": \"{{ investigation.severity }}\", \"source\": \"invect-triage\"}}"
1431
+ }
1432
+ }
1433
+ },
1434
+ {
1435
+ id: "s-slack-default",
1436
+ type: "slack.send_message",
1437
+ position: {
1438
+ x: 900,
1439
+ y: 390
1440
+ },
1441
+ data: {
1442
+ id: "s-slack-default",
1443
+ type: "slack.send_message",
1444
+ display_name: "Notify #triage",
1445
+ reference_id: "notify_triage",
1446
+ status: "idle",
1447
+ params: {
1448
+ credentialId: "slack-test",
1449
+ channel: "#triage",
1450
+ text: "*Unclassified ticket:* {{ linear_webhook.title }}\nSeverity: {{ investigation.severity }}\n\n{{ investigation.summary }}"
1451
+ }
1452
+ }
1453
+ },
1454
+ {
1455
+ id: "s-linear-update",
1456
+ type: "linear.update_issue",
1457
+ position: {
1458
+ x: 1300,
1459
+ y: 240
1460
+ },
1461
+ data: {
1462
+ id: "s-linear-update",
1463
+ type: "linear.update_issue",
1464
+ display_name: "Update Linear Ticket",
1465
+ reference_id: "update_linear_ticket",
1466
+ status: "idle",
1467
+ params: {
1468
+ credentialId: "linear-test",
1469
+ issueId: "{{ linear_webhook.identifier }}",
1470
+ stateId: "in-progress",
1471
+ comment: "Automated triage complete.\n\n**Severity:** {{ investigation.severity }}\n**Root cause:** {{ investigation.root_cause }}\n\n{% if fix_pr.html_url %}Fix PR: {{ fix_pr.html_url }}{% else %}No PR created — see action above.{% endif %}"
1472
+ }
1473
+ }
1474
+ }
1475
+ ], K = [
1476
+ {
1477
+ id: "se-webhook-agent",
1478
+ source: "s-webhook",
1479
+ target: "s-agent"
1480
+ },
1481
+ {
1482
+ id: "se-agent-switch",
1483
+ source: "s-agent",
1484
+ target: "s-switch"
1485
+ },
1486
+ {
1487
+ id: "se-switch-pr",
1488
+ source: "s-switch",
1489
+ target: "s-gh-pr",
1490
+ sourceHandle: "bug"
1491
+ },
1492
+ {
1493
+ id: "se-switch-feature",
1494
+ source: "s-switch",
1495
+ target: "s-slack-feature",
1496
+ sourceHandle: "feature"
1497
+ },
1498
+ {
1499
+ id: "se-switch-incident",
1500
+ source: "s-switch",
1501
+ target: "s-pagerduty",
1502
+ sourceHandle: "incident"
1503
+ },
1504
+ {
1505
+ id: "se-switch-triage-output",
1506
+ source: "s-switch",
1507
+ target: "s-slack-default",
1508
+ sourceHandle: "output"
1509
+ },
1510
+ {
1511
+ id: "se-switch-triage-default",
1512
+ source: "s-switch",
1513
+ target: "s-slack-default",
1514
+ sourceHandle: "default"
1515
+ },
1516
+ {
1517
+ id: "se-pr-linear",
1518
+ source: "s-gh-pr",
1519
+ target: "s-linear-update"
1520
+ },
1521
+ {
1522
+ id: "se-feature-linear",
1523
+ source: "s-slack-feature",
1524
+ target: "s-linear-update"
1525
+ },
1526
+ {
1527
+ id: "se-incident-linear",
1528
+ source: "s-pagerduty",
1529
+ target: "s-linear-update"
1530
+ },
1531
+ {
1532
+ id: "se-default-linear",
1533
+ source: "s-slack-default",
1534
+ target: "s-linear-update"
1535
+ }
1536
+ ], q = [
1537
+ {
1538
+ toolId: "postgres.execute_query",
1539
+ toolName: "Query Database",
1540
+ input: { query: "SELECT COUNT(*) as failed_count, COUNT(DISTINCT customer_id) as affected_customers FROM payments WHERE status = 'failed' AND created_at > NOW() - INTERVAL '2 hours'" },
1541
+ output: {
1542
+ rows: [{
1543
+ failed_count: 847,
1544
+ affected_customers: 320
1545
+ }],
1546
+ rowCount: 1
1547
+ },
1548
+ error: void 0,
1549
+ success: !0,
1550
+ iteration: 1,
1551
+ executionTimeMs: 120
1552
+ },
1553
+ {
1554
+ toolId: "sentry.list_issues",
1555
+ toolName: "Sentry Issues",
1556
+ input: {
1557
+ query: "payment stripe webhook 502",
1558
+ project: "payment-service"
1559
+ },
1560
+ output: { issues: [{
1561
+ id: "SENTRY-89421",
1562
+ title: "ConnectionPool exhausted: cannot acquire connection",
1563
+ count: 847,
1564
+ firstSeen: "2025-04-07T14:31:00Z",
1565
+ lastSeen: "2025-04-07T16:28:00Z",
1566
+ level: "error",
1567
+ culprit: "stripe-handler.ts in handleStripeWebhook"
1568
+ }] },
1569
+ error: void 0,
1570
+ success: !0,
1571
+ iteration: 2,
1572
+ executionTimeMs: 340
1573
+ },
1574
+ {
1575
+ toolId: "cloudwatch.start_query",
1576
+ toolName: "AWS Log Insights",
1577
+ input: {
1578
+ logGroup: "/ecs/payment-service",
1579
+ query: "fields @timestamp, @message | filter @message like /connection pool|exhausted|502/ | sort @timestamp desc | limit 20",
1580
+ startTime: "2025-04-07T14:00:00Z",
1581
+ endTime: "2025-04-07T16:30:00Z"
1582
+ },
1583
+ output: {
1584
+ results: [
1585
+ {
1586
+ timestamp: "2025-04-07T14:31:12Z",
1587
+ message: "ERROR ConnectionPool: Cannot acquire connection — pool exhausted (20/20 active)"
1588
+ },
1589
+ {
1590
+ timestamp: "2025-04-07T14:31:13Z",
1591
+ message: "ERROR StripeWebhookHandler: Failed to process payment_intent.succeeded — 502"
1592
+ },
1593
+ {
1594
+ timestamp: "2025-04-07T14:30:58Z",
1595
+ message: "WARN ConnectionPool: Pool utilization at 95% (19/20) — approaching limit"
1596
+ }
1597
+ ],
1598
+ totalResults: 1247
1599
+ },
1600
+ error: void 0,
1601
+ success: !0,
1602
+ iteration: 3,
1603
+ executionTimeMs: 890
1604
+ },
1605
+ {
1606
+ toolId: "notion.search",
1607
+ toolName: "Search Notion",
1608
+ input: { query: "payment service connection pool architecture" },
1609
+ output: { results: [{
1610
+ id: "page-1",
1611
+ title: "Payment Service — Architecture & Runbook",
1612
+ url: "https://notion.so/acme/payment-service-arch",
1613
+ snippet: "...connection pool is configured to max 20 connections via PG_POOL_MAX env var. The pool recycler runs every 30s..."
1614
+ }, {
1615
+ id: "page-2",
1616
+ title: "Incident Response: Database Connection Issues",
1617
+ url: "https://notion.so/acme/incident-db-connections",
1618
+ snippet: "...if pool exhaustion occurs, increase PG_POOL_MAX and restart. Long-term: implement connection-per-transaction..."
1619
+ }] },
1620
+ error: void 0,
1621
+ success: !0,
1622
+ iteration: 4,
1623
+ executionTimeMs: 210
1624
+ },
1625
+ {
1626
+ toolId: "github.get_file_content",
1627
+ toolName: "Read Source File",
1628
+ input: {
1629
+ owner: "acme",
1630
+ repo: "platform",
1631
+ path: "src/services/payments/stripe-handler.ts"
1632
+ },
1633
+ output: {
1634
+ content: "export async function handleStripeWebhook(event: StripeEvent) {\n const connection = await pool.acquire();\n try {\n const payment = await connection.query(...);\n await processPayment(payment);\n } catch (err) {\n logger.error(\"Webhook failed\", err);\n throw err;\n // BUG: connection not released on error path!\n }\n}",
1635
+ sha: "abc123",
1636
+ size: 2847,
1637
+ path: "src/services/payments/stripe-handler.ts"
1638
+ },
1639
+ error: void 0,
1640
+ success: !0,
1641
+ iteration: 5,
1642
+ executionTimeMs: 155
1643
+ }
1644
+ ], J = {
1645
+ matchedCase: "bug",
1646
+ matchedLabel: "Bug",
1647
+ matchMode: "first",
1648
+ caseResults: [
1649
+ {
1650
+ slug: "bug",
1651
+ label: "Bug",
1652
+ matched: !0
1653
+ },
1654
+ {
1655
+ slug: "feature",
1656
+ label: "Feature Request",
1657
+ matched: !1
1658
+ },
1659
+ {
1660
+ slug: "incident",
1661
+ label: "Incident",
1662
+ matched: !1
1663
+ }
1664
+ ]
1665
+ }, Y = "2025-04-07T16:32:10.000Z", X = "2025-04-07T16:32:10.045Z", re = "2025-04-07T16:32:10.050Z", ie = "2025-04-07T16:32:26.120Z", Z = "2025-04-07T16:32:26.125Z", Q = "2025-04-07T16:32:26.180Z", ae = "2025-04-07T16:32:26.185Z", oe = "2025-04-07T16:32:28.340Z", se = "2025-04-07T16:32:28.345Z", ce = "2025-04-07T16:32:29.110Z", le = {
1666
+ id: "run-triage-1",
1667
+ flowId: "flow-triage",
1668
+ flowVersion: 1,
1669
+ status: "SUCCESS",
1670
+ inputs: V,
1671
+ outputs: {
1672
+ create_fix_pr: U,
1673
+ update_linear_ticket: {
1674
+ id: "LIN-4821",
1675
+ identifier: "ENG-4821",
1676
+ state: { name: "In Progress" }
1677
+ }
1678
+ },
1679
+ error: void 0,
1680
+ startedAt: Y,
1681
+ completedAt: "2025-04-07T16:32:29.115Z",
1682
+ duration: 19115,
1683
+ triggerType: "webhook",
1684
+ triggerNodeId: "s-webhook",
1685
+ triggerData: {
1686
+ source: "linear",
1687
+ event: "Issue.create"
1688
+ }
1689
+ }, ue = [
1690
+ {
1691
+ id: "nexec-webhook",
1692
+ flowRunId: "run-triage-1",
1693
+ nodeId: "s-webhook",
1694
+ nodeType: "trigger.webhook",
1695
+ status: "SUCCESS",
1696
+ inputs: {},
1697
+ outputs: {
1698
+ nodeType: "trigger.webhook",
1699
+ data: { variables: { output: {
1700
+ value: V.data,
1701
+ type: "object"
1702
+ } } }
1703
+ },
1704
+ startedAt: Y,
1705
+ completedAt: X,
1706
+ duration: 45,
1707
+ retryCount: 0
1708
+ },
1709
+ {
1710
+ id: "nexec-agent",
1711
+ flowRunId: "run-triage-1",
1712
+ nodeId: "s-agent",
1713
+ nodeType: "AGENT",
1714
+ status: "SUCCESS",
1715
+ inputs: { linear_webhook: V.data },
1716
+ outputs: {
1717
+ nodeType: "AGENT",
1718
+ data: {
1719
+ variables: { output: {
1720
+ value: {
1721
+ finalResponse: JSON.stringify(H, null, 2),
1722
+ toolResults: q,
1723
+ iterations: 6,
1724
+ finishReason: "completed"
1725
+ },
1726
+ type: "object"
1727
+ } },
1728
+ metadata: {
1729
+ model: "gpt-4o",
1730
+ provider: "openai",
1731
+ totalToolCalls: 5,
1732
+ iterations: 6
1733
+ }
1734
+ }
1735
+ },
1736
+ startedAt: re,
1737
+ completedAt: ie,
1738
+ duration: 16070,
1739
+ retryCount: 0
1740
+ },
1741
+ {
1742
+ id: "nexec-switch",
1743
+ flowRunId: "run-triage-1",
1744
+ nodeId: "s-switch",
1745
+ nodeType: "core.switch",
1746
+ status: "SUCCESS",
1747
+ inputs: { investigation_agent: H },
1748
+ outputs: {
1749
+ nodeType: "core.switch",
1750
+ data: {
1751
+ variables: { bug: {
1752
+ value: H,
1753
+ type: "object"
1754
+ } },
1755
+ metadata: J
1756
+ }
1757
+ },
1758
+ startedAt: Z,
1759
+ completedAt: Q,
1760
+ duration: 55,
1761
+ retryCount: 0
1762
+ },
1763
+ {
1764
+ id: "nexec-gh-pr",
1765
+ flowRunId: "run-triage-1",
1766
+ nodeId: "s-gh-pr",
1767
+ nodeType: "github.create_pull_request",
1768
+ status: "SUCCESS",
1769
+ inputs: { route_by_issue_type: H },
1770
+ outputs: {
1771
+ nodeType: "github.create_pull_request",
1772
+ data: { variables: { output: {
1773
+ value: U,
1774
+ type: "object"
1775
+ } } }
1776
+ },
1777
+ startedAt: ae,
1778
+ completedAt: oe,
1779
+ duration: 2155,
1780
+ retryCount: 0
1781
+ },
1782
+ {
1783
+ id: "nexec-slack-feature",
1784
+ flowRunId: "run-triage-1",
1785
+ nodeId: "s-slack-feature",
1786
+ nodeType: "slack.send_message",
1787
+ status: "SKIPPED",
1788
+ inputs: {},
1789
+ outputs: void 0,
1790
+ startedAt: Q,
1791
+ completedAt: Q,
1792
+ duration: 0,
1793
+ retryCount: 0
1794
+ },
1795
+ {
1796
+ id: "nexec-pagerduty",
1797
+ flowRunId: "run-triage-1",
1798
+ nodeId: "s-pagerduty",
1799
+ nodeType: "http.request",
1800
+ status: "SKIPPED",
1801
+ inputs: {},
1802
+ outputs: void 0,
1803
+ startedAt: Q,
1804
+ completedAt: Q,
1805
+ duration: 0,
1806
+ retryCount: 0
1807
+ },
1808
+ {
1809
+ id: "nexec-slack-default",
1810
+ flowRunId: "run-triage-1",
1811
+ nodeId: "s-slack-default",
1812
+ nodeType: "slack.send_message",
1813
+ status: "SKIPPED",
1814
+ inputs: {},
1815
+ outputs: void 0,
1816
+ startedAt: Q,
1817
+ completedAt: Q,
1818
+ duration: 0,
1819
+ retryCount: 0
1820
+ },
1821
+ {
1822
+ id: "nexec-linear-update",
1823
+ flowRunId: "run-triage-1",
1824
+ nodeId: "s-linear-update",
1825
+ nodeType: "linear.update_issue",
1826
+ status: "SUCCESS",
1827
+ inputs: { create_fix_pr: U },
1828
+ outputs: {
1829
+ nodeType: "linear.update_issue",
1830
+ data: { variables: { output: {
1831
+ value: {
1832
+ id: "LIN-4821",
1833
+ identifier: "ENG-4821",
1834
+ state: { name: "In Progress" },
1835
+ updatedAt: "2025-04-07T16:32:29.100Z"
1836
+ },
1837
+ type: "object"
1838
+ } } }
1839
+ },
1840
+ startedAt: se,
1841
+ completedAt: ce,
1842
+ duration: 765,
1843
+ retryCount: 0
1844
+ }
1845
+ ], de = [
1846
+ {
1847
+ id: "cred-anthropic",
1848
+ name: "Anthropic — Production",
1849
+ type: "llm",
1850
+ authType: "apiKey",
1851
+ description: "Claude API key for agent nodes",
1852
+ isActive: !0,
1853
+ userId: "demo-user",
1854
+ isShared: !0,
1855
+ config: { apiKey: "sk-ant-••••••••" },
1856
+ lastUsedAt: "2025-04-07T16:32:26Z",
1857
+ createdAt: "2025-01-10T09:00:00Z",
1858
+ updatedAt: "2025-03-15T11:20:00Z"
1859
+ },
1860
+ {
1861
+ id: "cred-openai",
1862
+ name: "OpenAI — Production",
1863
+ type: "llm",
1864
+ authType: "apiKey",
1865
+ description: "GPT-4o key for model nodes",
1866
+ isActive: !0,
1867
+ userId: "demo-user",
1868
+ isShared: !0,
1869
+ config: { apiKey: "sk-proj-••••••••" },
1870
+ lastUsedAt: "2025-04-06T22:10:00Z",
1871
+ createdAt: "2025-01-10T09:05:00Z",
1872
+ updatedAt: "2025-02-20T14:00:00Z"
1873
+ },
1874
+ {
1875
+ id: "cred-postgres",
1876
+ name: "PostgreSQL — payment-db",
1877
+ type: "database",
1878
+ authType: "connectionString",
1879
+ description: "Payment service database (read-only replica)",
1880
+ isActive: !0,
1881
+ userId: "demo-user",
1882
+ isShared: !1,
1883
+ config: { connectionString: "postgresql://readonly:••••@db.acme.internal:5432/payments" },
1884
+ lastUsedAt: "2025-04-07T16:32:11Z",
1885
+ createdAt: "2025-02-05T10:30:00Z",
1886
+ updatedAt: "2025-03-01T16:00:00Z"
1887
+ },
1888
+ {
1889
+ id: "cred-github",
1890
+ name: "GitHub — acme org",
1891
+ type: "http-api",
1892
+ authType: "oauth2",
1893
+ description: "GitHub OAuth2 for repo access and PR creation",
1894
+ isActive: !0,
1895
+ userId: "demo-user",
1896
+ isShared: !0,
1897
+ config: {
1898
+ oauth2Provider: "github",
1899
+ accessToken: "gho_••••••••",
1900
+ refreshToken: "ghr_••••••••",
1901
+ tokenType: "bearer",
1902
+ scope: "repo,read:org",
1903
+ expiresAt: "2025-05-07T16:00:00Z"
1904
+ },
1905
+ lastUsedAt: "2025-04-07T16:32:28Z",
1906
+ createdAt: "2025-01-20T13:00:00Z",
1907
+ updatedAt: "2025-04-07T16:32:28Z"
1908
+ },
1909
+ {
1910
+ id: "cred-slack",
1911
+ name: "Slack — Acme Workspace",
1912
+ type: "http-api",
1913
+ authType: "oauth2",
1914
+ description: "Slack bot for #triage and #product-requests channels",
1915
+ isActive: !0,
1916
+ userId: "demo-user",
1917
+ isShared: !0,
1918
+ config: {
1919
+ oauth2Provider: "slack",
1920
+ accessToken: "xoxb-••••••••",
1921
+ tokenType: "bearer",
1922
+ scope: "chat:write,channels:read"
1923
+ },
1924
+ lastUsedAt: "2025-04-06T09:45:00Z",
1925
+ createdAt: "2025-01-25T11:00:00Z",
1926
+ updatedAt: "2025-03-10T08:30:00Z"
1927
+ },
1928
+ {
1929
+ id: "cred-sentry",
1930
+ name: "Sentry — acme org",
1931
+ type: "http-api",
1932
+ authType: "bearer",
1933
+ description: "Sentry API token for issue search",
1934
+ isActive: !0,
1935
+ userId: "demo-user",
1936
+ isShared: !1,
1937
+ config: { token: "sntrys_••••••••" },
1938
+ lastUsedAt: "2025-04-07T16:32:14Z",
1939
+ createdAt: "2025-02-10T15:00:00Z",
1940
+ updatedAt: "2025-02-10T15:00:00Z"
1941
+ },
1942
+ {
1943
+ id: "cred-aws",
1944
+ name: "AWS — CloudWatch Logs",
1945
+ type: "http-api",
1946
+ authType: "awsSigV4",
1947
+ description: "AWS credentials for CloudWatch Logs Insights queries",
1948
+ isActive: !0,
1949
+ userId: "demo-user",
1950
+ isShared: !1,
1951
+ config: {
1952
+ accessKeyId: "AKIA••••••••",
1953
+ secretAccessKey: "••••••••",
1954
+ region: "us-east-1",
1955
+ service: "logs"
1956
+ },
1957
+ lastUsedAt: "2025-04-07T16:32:18Z",
1958
+ createdAt: "2025-02-15T09:00:00Z",
1959
+ updatedAt: "2025-03-20T10:00:00Z"
1960
+ },
1961
+ {
1962
+ id: "cred-notion",
1963
+ name: "Notion — Acme Workspace",
1964
+ type: "http-api",
1965
+ authType: "bearer",
1966
+ description: "Notion integration token for doc search",
1967
+ isActive: !0,
1968
+ userId: "demo-user",
1969
+ isShared: !0,
1970
+ config: { token: "ntn_••••••••" },
1971
+ lastUsedAt: "2025-04-07T16:32:20Z",
1972
+ createdAt: "2025-03-01T14:00:00Z",
1973
+ updatedAt: "2025-03-01T14:00:00Z"
1974
+ },
1975
+ {
1976
+ id: "cred-pagerduty",
1977
+ name: "PagerDuty — Events API",
1978
+ type: "http-api",
1979
+ authType: "apiKey",
1980
+ description: "PagerDuty Events API v2 routing key",
1981
+ isActive: !0,
1982
+ userId: "demo-user",
1983
+ isShared: !0,
1984
+ config: {
1985
+ apiKey: "R0••••••••",
1986
+ paramName: "routing_key"
1987
+ },
1988
+ lastUsedAt: "2025-03-28T03:15:00Z",
1989
+ createdAt: "2025-02-20T16:00:00Z",
1990
+ updatedAt: "2025-02-20T16:00:00Z"
1991
+ }
1992
+ ], $ = (e) => new Date(Date.parse("2025-04-07T15:00:00Z") + e * 1e3).toISOString(), fe = [
1993
+ {
1994
+ id: "chat-1",
1995
+ flowId: "flow-triage",
1996
+ role: "user",
1997
+ content: "I want to build a ticket triage flow. When a Linear webhook comes in, an AI agent should investigate the ticket using our Postgres DB, Sentry, AWS CloudWatch logs, Notion docs, and GitHub. Then route it based on issue type — bug, feature request, or incident — to different handlers.",
1998
+ toolMeta: null,
1999
+ createdAt: $(0)
2000
+ },
2001
+ {
2002
+ id: "chat-2",
2003
+ flowId: "flow-triage",
2004
+ role: "tool",
2005
+ content: "",
2006
+ toolMeta: {
2007
+ toolName: "set_plan",
2008
+ args: {
2009
+ summary: "Build a Linear ticket triage flow with AI investigation and multi-path routing",
2010
+ steps: [
2011
+ {
2012
+ index: 0,
2013
+ title: "Add webhook trigger for Linear events",
2014
+ status: "done"
2015
+ },
2016
+ {
2017
+ index: 1,
2018
+ title: "Add AI agent node with investigation tools",
2019
+ status: "done"
2020
+ },
2021
+ {
2022
+ index: 2,
2023
+ title: "Configure agent tools: Postgres, Sentry, CloudWatch, Notion, GitHub",
2024
+ status: "done"
2025
+ },
2026
+ {
2027
+ index: 3,
2028
+ title: "Add switch node to route by issue type",
2029
+ status: "done"
2030
+ },
2031
+ {
2032
+ index: 4,
2033
+ title: "Add handler nodes for each branch",
2034
+ status: "done"
2035
+ },
2036
+ {
2037
+ index: 5,
2038
+ title: "Connect all nodes and validate flow",
2039
+ status: "done"
2040
+ }
2041
+ ]
2042
+ },
2043
+ result: {
2044
+ success: !0,
2045
+ data: { planSet: !0 }
2046
+ },
2047
+ status: "done",
2048
+ startedAt: Date.parse($(2)),
2049
+ durationMs: 45
2050
+ },
2051
+ createdAt: $(2)
2052
+ },
2053
+ {
2054
+ id: "chat-3",
2055
+ flowId: "flow-triage",
2056
+ role: "tool",
2057
+ content: "",
2058
+ toolMeta: {
2059
+ toolName: "search_actions",
2060
+ args: { query: "webhook trigger" },
2061
+ result: {
2062
+ success: !0,
2063
+ data: { actions: [{
2064
+ id: "trigger.webhook",
2065
+ name: "Webhook Trigger",
2066
+ provider: "Triggers"
2067
+ }, {
2068
+ id: "trigger.cron",
2069
+ name: "Cron Trigger",
2070
+ provider: "Triggers"
2071
+ }] }
2072
+ },
2073
+ status: "done",
2074
+ startedAt: Date.parse($(3)),
2075
+ durationMs: 12
2076
+ },
2077
+ createdAt: $(3)
2078
+ },
2079
+ {
2080
+ id: "chat-4",
2081
+ flowId: "flow-triage",
2082
+ role: "tool",
2083
+ content: "",
2084
+ toolMeta: {
2085
+ toolName: "add_node",
2086
+ args: {
2087
+ type: "trigger.webhook",
2088
+ name: "Linear Webhook",
2089
+ referenceId: "linear_webhook"
2090
+ },
2091
+ result: {
2092
+ success: !0,
2093
+ data: {
2094
+ nodeId: "s-webhook",
2095
+ type: "trigger.webhook",
2096
+ name: "Linear Webhook"
2097
+ }
2098
+ },
2099
+ status: "done",
2100
+ startedAt: Date.parse($(4)),
2101
+ durationMs: 85
2102
+ },
2103
+ createdAt: $(4)
2104
+ },
2105
+ {
2106
+ id: "chat-5",
2107
+ flowId: "flow-triage",
2108
+ role: "tool",
2109
+ content: "",
2110
+ toolMeta: {
2111
+ toolName: "add_node",
2112
+ args: {
2113
+ type: "AGENT",
2114
+ name: "Investigation Agent",
2115
+ referenceId: "investigation_agent"
2116
+ },
2117
+ result: {
2118
+ success: !0,
2119
+ data: {
2120
+ nodeId: "s-agent",
2121
+ type: "AGENT",
2122
+ name: "Investigation Agent"
2123
+ }
2124
+ },
2125
+ status: "done",
2126
+ startedAt: Date.parse($(5)),
2127
+ durationMs: 92
2128
+ },
2129
+ createdAt: $(5)
2130
+ },
2131
+ {
2132
+ id: "chat-6",
2133
+ flowId: "flow-triage",
2134
+ role: "tool",
2135
+ content: "",
2136
+ toolMeta: {
2137
+ toolName: "find_credentials_for_action",
2138
+ args: { actionId: "AGENT" },
2139
+ result: {
2140
+ success: !0,
2141
+ data: { credentials: [{
2142
+ id: "cred-anthropic",
2143
+ name: "Anthropic — Production",
2144
+ type: "llm"
2145
+ }, {
2146
+ id: "cred-openai",
2147
+ name: "OpenAI — Production",
2148
+ type: "llm"
2149
+ }] }
2150
+ },
2151
+ status: "done",
2152
+ startedAt: Date.parse($(6)),
2153
+ durationMs: 18
2154
+ },
2155
+ createdAt: $(6)
2156
+ },
2157
+ {
2158
+ id: "chat-7",
2159
+ flowId: "flow-triage",
2160
+ role: "tool",
2161
+ content: "",
2162
+ toolMeta: {
2163
+ toolName: "configure_agent",
2164
+ args: {
2165
+ nodeId: "s-agent",
2166
+ credentialId: "cred-openai",
2167
+ model: "gpt-4o",
2168
+ taskPrompt: "Investigate Linear ticket \"{{ linear_webhook.title }}\"...",
2169
+ systemPrompt: "You are a senior on-call engineer performing ticket triage.",
2170
+ maxIterations: 10,
2171
+ stopCondition: "explicit_stop"
2172
+ },
2173
+ result: {
2174
+ success: !0,
2175
+ data: { configured: !0 }
2176
+ },
2177
+ status: "done",
2178
+ startedAt: Date.parse($(7)),
2179
+ durationMs: 110
2180
+ },
2181
+ createdAt: $(7)
2182
+ },
2183
+ {
2184
+ id: "chat-8",
2185
+ flowId: "flow-triage",
2186
+ role: "tool",
2187
+ content: "",
2188
+ toolMeta: {
2189
+ toolName: "add_tool_to_agent",
2190
+ args: {
2191
+ nodeId: "s-agent",
2192
+ toolId: "postgres.execute_query",
2193
+ name: "Query Database"
2194
+ },
2195
+ result: {
2196
+ success: !0,
2197
+ data: {
2198
+ instanceId: "tool-pg",
2199
+ toolId: "postgres.execute_query"
2200
+ }
2201
+ },
2202
+ status: "done",
2203
+ startedAt: Date.parse($(8)),
2204
+ durationMs: 65
2205
+ },
2206
+ createdAt: $(8)
2207
+ },
2208
+ {
2209
+ id: "chat-9",
2210
+ flowId: "flow-triage",
2211
+ role: "tool",
2212
+ content: "",
2213
+ toolMeta: {
2214
+ toolName: "add_tool_to_agent",
2215
+ args: {
2216
+ nodeId: "s-agent",
2217
+ toolId: "sentry.list_issues",
2218
+ name: "Sentry Issues"
2219
+ },
2220
+ result: {
2221
+ success: !0,
2222
+ data: {
2223
+ instanceId: "tool-sentry",
2224
+ toolId: "sentry.list_issues"
2225
+ }
2226
+ },
2227
+ status: "done",
2228
+ startedAt: Date.parse($(9)),
2229
+ durationMs: 58
2230
+ },
2231
+ createdAt: $(9)
2232
+ },
2233
+ {
2234
+ id: "chat-10",
2235
+ flowId: "flow-triage",
2236
+ role: "tool",
2237
+ content: "",
2238
+ toolMeta: {
2239
+ toolName: "add_tool_to_agent",
2240
+ args: {
2241
+ nodeId: "s-agent",
2242
+ toolId: "cloudwatch.start_query",
2243
+ name: "AWS Log Insights"
2244
+ },
2245
+ result: {
2246
+ success: !0,
2247
+ data: {
2248
+ instanceId: "tool-aws",
2249
+ toolId: "cloudwatch.start_query"
2250
+ }
2251
+ },
2252
+ status: "done",
2253
+ startedAt: Date.parse($(10)),
2254
+ durationMs: 62
2255
+ },
2256
+ createdAt: $(10)
2257
+ },
2258
+ {
2259
+ id: "chat-11",
2260
+ flowId: "flow-triage",
2261
+ role: "tool",
2262
+ content: "",
2263
+ toolMeta: {
2264
+ toolName: "add_tool_to_agent",
2265
+ args: {
2266
+ nodeId: "s-agent",
2267
+ toolId: "notion.search",
2268
+ name: "Search Notion"
2269
+ },
2270
+ result: {
2271
+ success: !0,
2272
+ data: {
2273
+ instanceId: "tool-notion",
2274
+ toolId: "notion.search"
2275
+ }
2276
+ },
2277
+ status: "done",
2278
+ startedAt: Date.parse($(11)),
2279
+ durationMs: 55
2280
+ },
2281
+ createdAt: $(11)
2282
+ },
2283
+ {
2284
+ id: "chat-12",
2285
+ flowId: "flow-triage",
2286
+ role: "tool",
2287
+ content: "",
2288
+ toolMeta: {
2289
+ toolName: "add_tool_to_agent",
2290
+ args: {
2291
+ nodeId: "s-agent",
2292
+ toolId: "github.get_file_content",
2293
+ name: "Read Source File"
2294
+ },
2295
+ result: {
2296
+ success: !0,
2297
+ data: {
2298
+ instanceId: "tool-gh",
2299
+ toolId: "github.get_file_content"
2300
+ }
2301
+ },
2302
+ status: "done",
2303
+ startedAt: Date.parse($(12)),
2304
+ durationMs: 60
2305
+ },
2306
+ createdAt: $(12)
2307
+ },
2308
+ {
2309
+ id: "chat-13",
2310
+ flowId: "flow-triage",
2311
+ role: "assistant",
2312
+ content: "I've set up the webhook trigger and the investigation agent with all 5 tools. Now I'll add the switch node to route based on the issue type the agent identifies.",
2313
+ toolMeta: null,
2314
+ createdAt: $(13)
2315
+ },
2316
+ {
2317
+ id: "chat-14",
2318
+ flowId: "flow-triage",
2319
+ role: "tool",
2320
+ content: "",
2321
+ toolMeta: {
2322
+ toolName: "add_node",
2323
+ args: {
2324
+ type: "core.switch",
2325
+ name: "Route by Issue Type",
2326
+ referenceId: "route_by_issue_type",
2327
+ params: {
2328
+ matchMode: "first",
2329
+ cases: [
2330
+ {
2331
+ slug: "bug",
2332
+ label: "Bug",
2333
+ expression: "investigation.issue_type === \"bug\""
2334
+ },
2335
+ {
2336
+ slug: "feature",
2337
+ label: "Feature Request",
2338
+ expression: "investigation.issue_type === \"feature_request\""
2339
+ },
2340
+ {
2341
+ slug: "incident",
2342
+ label: "Incident",
2343
+ expression: "investigation.issue_type === \"incident\""
2344
+ }
2345
+ ]
2346
+ }
2347
+ },
2348
+ result: {
2349
+ success: !0,
2350
+ data: {
2351
+ nodeId: "s-switch",
2352
+ type: "core.switch"
2353
+ }
2354
+ },
2355
+ status: "done",
2356
+ startedAt: Date.parse($(14)),
2357
+ durationMs: 95
2358
+ },
2359
+ createdAt: $(14)
2360
+ },
2361
+ {
2362
+ id: "chat-15",
2363
+ flowId: "flow-triage",
2364
+ role: "tool",
2365
+ content: "",
2366
+ toolMeta: {
2367
+ toolName: "add_node",
2368
+ args: {
2369
+ type: "github.create_pull_request",
2370
+ name: "Create Fix PR",
2371
+ referenceId: "create_fix_pr"
2372
+ },
2373
+ result: {
2374
+ success: !0,
2375
+ data: { nodeId: "s-gh-pr" }
2376
+ },
2377
+ status: "done",
2378
+ startedAt: Date.parse($(15)),
2379
+ durationMs: 78
2380
+ },
2381
+ createdAt: $(15)
2382
+ },
2383
+ {
2384
+ id: "chat-16",
2385
+ flowId: "flow-triage",
2386
+ role: "tool",
2387
+ content: "",
2388
+ toolMeta: {
2389
+ toolName: "add_node",
2390
+ args: {
2391
+ type: "slack.send_message",
2392
+ name: "Notify #product",
2393
+ referenceId: "notify_product"
2394
+ },
2395
+ result: {
2396
+ success: !0,
2397
+ data: { nodeId: "s-slack-feature" }
2398
+ },
2399
+ status: "done",
2400
+ startedAt: Date.parse($(16)),
2401
+ durationMs: 72
2402
+ },
2403
+ createdAt: $(16)
2404
+ },
2405
+ {
2406
+ id: "chat-17",
2407
+ flowId: "flow-triage",
2408
+ role: "tool",
2409
+ content: "",
2410
+ toolMeta: {
2411
+ toolName: "add_node",
2412
+ args: {
2413
+ type: "http.request",
2414
+ name: "PagerDuty Alert",
2415
+ referenceId: "pagerduty_alert"
2416
+ },
2417
+ result: {
2418
+ success: !0,
2419
+ data: { nodeId: "s-pagerduty" }
2420
+ },
2421
+ status: "done",
2422
+ startedAt: Date.parse($(17)),
2423
+ durationMs: 68
2424
+ },
2425
+ createdAt: $(17)
2426
+ },
2427
+ {
2428
+ id: "chat-18",
2429
+ flowId: "flow-triage",
2430
+ role: "tool",
2431
+ content: "",
2432
+ toolMeta: {
2433
+ toolName: "add_node",
2434
+ args: {
2435
+ type: "slack.send_message",
2436
+ name: "Notify #triage",
2437
+ referenceId: "notify_triage"
2438
+ },
2439
+ result: {
2440
+ success: !0,
2441
+ data: { nodeId: "s-slack-default" }
2442
+ },
2443
+ status: "done",
2444
+ startedAt: Date.parse($(18)),
2445
+ durationMs: 70
2446
+ },
2447
+ createdAt: $(18)
2448
+ },
2449
+ {
2450
+ id: "chat-19",
2451
+ flowId: "flow-triage",
2452
+ role: "tool",
2453
+ content: "",
2454
+ toolMeta: {
2455
+ toolName: "connect_nodes",
2456
+ args: {
2457
+ sourceId: "s-webhook",
2458
+ targetId: "s-agent"
2459
+ },
2460
+ result: {
2461
+ success: !0,
2462
+ data: { edgeId: "se-webhook-agent" }
2463
+ },
2464
+ status: "done",
2465
+ startedAt: Date.parse($(19)),
2466
+ durationMs: 30
2467
+ },
2468
+ createdAt: $(19)
2469
+ },
2470
+ {
2471
+ id: "chat-20",
2472
+ flowId: "flow-triage",
2473
+ role: "tool",
2474
+ content: "",
2475
+ toolMeta: {
2476
+ toolName: "connect_nodes",
2477
+ args: {
2478
+ sourceId: "s-agent",
2479
+ targetId: "s-switch"
2480
+ },
2481
+ result: {
2482
+ success: !0,
2483
+ data: { edgeId: "se-agent-switch" }
2484
+ },
2485
+ status: "done",
2486
+ startedAt: Date.parse($(20)),
2487
+ durationMs: 28
2488
+ },
2489
+ createdAt: $(20)
2490
+ },
2491
+ {
2492
+ id: "chat-21",
2493
+ flowId: "flow-triage",
2494
+ role: "tool",
2495
+ content: "",
2496
+ toolMeta: {
2497
+ toolName: "connect_nodes",
2498
+ args: {
2499
+ sourceId: "s-switch",
2500
+ targetId: "s-gh-pr",
2501
+ sourceHandle: "bug"
2502
+ },
2503
+ result: {
2504
+ success: !0,
2505
+ data: { edgeId: "se-switch-pr" }
2506
+ },
2507
+ status: "done",
2508
+ startedAt: Date.parse($(21)),
2509
+ durationMs: 25
2510
+ },
2511
+ createdAt: $(21)
2512
+ },
2513
+ {
2514
+ id: "chat-22",
2515
+ flowId: "flow-triage",
2516
+ role: "tool",
2517
+ content: "",
2518
+ toolMeta: {
2519
+ toolName: "connect_nodes",
2520
+ args: {
2521
+ sourceId: "s-switch",
2522
+ targetId: "s-slack-feature",
2523
+ sourceHandle: "feature"
2524
+ },
2525
+ result: {
2526
+ success: !0,
2527
+ data: { edgeId: "se-switch-feature" }
2528
+ },
2529
+ status: "done",
2530
+ startedAt: Date.parse($(22)),
2531
+ durationMs: 26
2532
+ },
2533
+ createdAt: $(22)
2534
+ },
2535
+ {
2536
+ id: "chat-23",
2537
+ flowId: "flow-triage",
2538
+ role: "tool",
2539
+ content: "",
2540
+ toolMeta: {
2541
+ toolName: "connect_nodes",
2542
+ args: {
2543
+ sourceId: "s-switch",
2544
+ targetId: "s-pagerduty",
2545
+ sourceHandle: "incident"
2546
+ },
2547
+ result: {
2548
+ success: !0,
2549
+ data: { edgeId: "se-switch-incident" }
2550
+ },
2551
+ status: "done",
2552
+ startedAt: Date.parse($(23)),
2553
+ durationMs: 24
2554
+ },
2555
+ createdAt: $(23)
2556
+ },
2557
+ {
2558
+ id: "chat-24",
2559
+ flowId: "flow-triage",
2560
+ role: "tool",
2561
+ content: "",
2562
+ toolMeta: {
2563
+ toolName: "connect_nodes",
2564
+ args: {
2565
+ sourceId: "s-switch",
2566
+ targetId: "s-slack-default",
2567
+ sourceHandle: "default"
2568
+ },
2569
+ result: {
2570
+ success: !0,
2571
+ data: { edgeId: "se-switch-default" }
2572
+ },
2573
+ status: "done",
2574
+ startedAt: Date.parse($(24)),
2575
+ durationMs: 27
2576
+ },
2577
+ createdAt: $(24)
2578
+ },
2579
+ {
2580
+ id: "chat-25",
2581
+ flowId: "flow-triage",
2582
+ role: "tool",
2583
+ content: "",
2584
+ toolMeta: {
2585
+ toolName: "validate_flow",
2586
+ args: {},
2587
+ result: {
2588
+ success: !0,
2589
+ data: {
2590
+ isValid: !0,
2591
+ errors: [],
2592
+ warnings: []
2593
+ }
2594
+ },
2595
+ status: "done",
2596
+ startedAt: Date.parse($(25)),
2597
+ durationMs: 140
2598
+ },
2599
+ createdAt: $(25)
2600
+ },
2601
+ {
2602
+ id: "chat-26",
2603
+ flowId: "flow-triage",
2604
+ role: "tool",
2605
+ content: "",
2606
+ toolMeta: {
2607
+ toolName: "update_plan",
2608
+ args: { steps: [
2609
+ {
2610
+ index: 0,
2611
+ status: "done"
2612
+ },
2613
+ {
2614
+ index: 1,
2615
+ status: "done"
2616
+ },
2617
+ {
2618
+ index: 2,
2619
+ status: "done"
2620
+ },
2621
+ {
2622
+ index: 3,
2623
+ status: "done"
2624
+ },
2625
+ {
2626
+ index: 4,
2627
+ status: "done"
2628
+ },
2629
+ {
2630
+ index: 5,
2631
+ status: "done"
2632
+ }
2633
+ ] },
2634
+ result: {
2635
+ success: !0,
2636
+ data: { updated: !0 }
2637
+ },
2638
+ status: "done",
2639
+ startedAt: Date.parse($(26)),
2640
+ durationMs: 15
2641
+ },
2642
+ createdAt: $(26)
2643
+ },
2644
+ {
2645
+ id: "chat-27",
2646
+ flowId: "flow-triage",
2647
+ role: "assistant",
2648
+ content: "Your Linear ticket triage flow is ready! Here's what I built:\n\n1. **Linear Webhook** — receives incoming ticket events\n2. **Investigation Agent** — an AI agent (GPT-4o) that queries your Postgres DB, searches Sentry for errors, checks AWS CloudWatch logs, searches Notion for runbooks, and reads source files on GitHub to produce a root cause analysis with severity rating\n3. **Route by Issue Type** — routes based on the agent's classification:\n - **Bug** → Creates a fix PR on GitHub\n - **Feature Request** → Notifies #product-requests on Slack\n - **Incident** → Triggers a PagerDuty incident for escalation\n - **Default** → Notifies #triage on Slack for manual review\n\nThe flow validated successfully. You can test it by sending a sample Linear webhook payload, or set up a real webhook in your Linear workspace settings pointing to this flow's trigger URL.",
2649
+ toolMeta: null,
2650
+ createdAt: $(28)
2651
+ },
2652
+ {
2653
+ id: "chat-28",
2654
+ flowId: "flow-triage",
2655
+ role: "user",
2656
+ content: "Can you run it with a test payload to make sure everything works?",
2657
+ toolMeta: null,
2658
+ createdAt: $(60)
2659
+ },
2660
+ {
2661
+ id: "chat-29",
2662
+ flowId: "flow-triage",
2663
+ role: "tool",
2664
+ content: "",
2665
+ toolMeta: {
2666
+ toolName: "run_flow",
2667
+ args: { inputs: {
2668
+ action: "create",
2669
+ type: "Issue",
2670
+ data: {
2671
+ id: "LIN-4821",
2672
+ identifier: "ENG-4821",
2673
+ title: "Payment processing fails with 502 for Stripe webhook handler",
2674
+ priority: 1,
2675
+ team: { key: "ENG" },
2676
+ labels: [{ name: "bug" }, { name: "payments" }]
2677
+ }
2678
+ } },
2679
+ result: {
2680
+ success: !0,
2681
+ data: {
2682
+ flowRunId: "run-triage-1",
2683
+ status: "SUCCESS",
2684
+ duration: 18345,
2685
+ outputs: { fix_pr: {
2686
+ number: 4293,
2687
+ html_url: "https://github.com/acme/platform/pull/4293"
2688
+ } }
2689
+ }
2690
+ },
2691
+ status: "done",
2692
+ startedAt: Date.parse($(62)),
2693
+ durationMs: 18400
2694
+ },
2695
+ createdAt: $(62)
2696
+ },
2697
+ {
2698
+ id: "chat-30",
2699
+ flowId: "flow-triage",
2700
+ role: "assistant",
2701
+ content: "The test run completed successfully in 18.3 seconds. Here's what happened:\n\n- The agent investigated the Stripe webhook 502 issue across all 5 data sources\n- It identified a **connection pool exhaustion bug** in `stripe-handler.ts` (missing `finally` block for connection release)\n- The switch node correctly classified it as a **bug**\n- A fix PR was created: [acme/platform#4293](https://github.com/acme/platform/pull/4293)\n\nThe skipped branches (feature request, incident, default) behaved correctly — only the bug path executed. You can view the full execution details in the Flow Runs tab.",
2702
+ toolMeta: null,
2703
+ createdAt: $(82)
2704
+ }
2705
+ ], pe = {
2706
+ flows: [
2707
+ {
2708
+ id: "flow-triage",
2709
+ name: "Linear Ticket Triage",
2710
+ description: "AI-powered ticket investigation with multi-path routing",
2711
+ isActive: !0,
2712
+ createdAt: "2025-03-10T12:00:00Z",
2713
+ updatedAt: "2025-04-01T16:45:00Z"
2714
+ },
2715
+ {
2716
+ id: "flow-simple",
2717
+ name: "Text Summarizer",
2718
+ description: "Summarizes user input text using GPT-4o",
2719
+ isActive: !0,
2720
+ createdAt: "2025-01-15T10:00:00Z",
2721
+ updatedAt: "2025-03-20T14:30:00Z"
2722
+ },
2723
+ {
2724
+ id: "flow-branching",
2725
+ name: "Priority Router",
2726
+ description: "Routes incoming webhooks based on priority level",
2727
+ isActive: !0,
2728
+ createdAt: "2025-02-01T08:00:00Z",
2729
+ updatedAt: "2025-03-25T09:15:00Z"
2730
+ }
2731
+ ],
2732
+ flowReactFlowData: {
2733
+ "flow-triage": {
2734
+ nodes: G,
2735
+ edges: K,
2736
+ version: {
2737
+ flowId: "flow-triage",
2738
+ version: 1
2739
+ },
2740
+ name: "Linear Ticket Triage",
2741
+ isActive: !0
2742
+ },
2743
+ "flow-simple": {
2744
+ nodes: L,
2745
+ edges: R,
2746
+ version: {
2747
+ flowId: "flow-simple",
2748
+ version: 1
2749
+ },
2750
+ name: "Text Summarizer",
2751
+ isActive: !0
2752
+ },
2753
+ "flow-branching": {
2754
+ nodes: z,
2755
+ edges: B,
2756
+ version: {
2757
+ flowId: "flow-branching",
2758
+ version: 1
2759
+ },
2760
+ name: "Priority Router",
2761
+ isActive: !0
2762
+ }
2763
+ },
2764
+ nodeDefinitions: I,
2765
+ agentTools: W,
2766
+ flowRuns: [le],
2767
+ nodeExecutions: { "run-triage-1": ue },
2768
+ credentials: de,
2769
+ chatMessages: { "flow-triage": fe }
2770
+ };
2771
+ //#endregion
2772
+ export { A as DemoInvect, F as FlowViewer, B as branchingFlowEdges, z as branchingFlowNodes, k as createDemoApiClient, pe as sampleDemoData, I as sampleNodeDefinitions, W as showcaseAgentTools, K as showcaseFlowEdges, G as showcaseFlowNodes, R as simpleFlowEdges, L as simpleFlowNodes };
2773
+
2774
+ //# sourceMappingURL=demo.js.map