@atom8n/n8n-editor-ui 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.stylelintcache +1 -0
- package/README.md +59 -0
- package/biome.jsonc +8 -0
- package/build.log +55 -0
- package/data/node-popularity.json +3998 -0
- package/dist/assets/AddDataTableModal-UINkk54_.js +1555 -0
- package/dist/assets/AgentEditorModal-CVww87TJ.js +358 -0
- package/dist/assets/Alert-Dy86dyOr.js +102 -0
- package/dist/assets/AnimatedSpinner-DmPN4poP.js +15 -0
- package/dist/assets/AnnotationTagsDropdown.ee-BJ7N9lek.js +71 -0
- package/dist/assets/AuthView-D2LWHrMp.js +106 -0
- package/dist/assets/BottomMenu-CIQiK_dJ.js +532 -0
- package/dist/assets/CalendarDate-DgQUMbNo.js +875 -0
- package/dist/assets/ChangePasswordView-Z6tUkw0u.js +133 -0
- package/dist/assets/ChatAgentAvatar-50YBnv3N.js +67 -0
- package/dist/assets/ChatFile-xZxmc2nV.js +146 -0
- package/dist/assets/ChatLayout-CTE_5SiM.js +96 -0
- package/dist/assets/ChatPersonalAgentsView-BGpHk03K.js +149 -0
- package/dist/assets/ChatSidebar-BkVwIypC.js +528 -0
- package/dist/assets/ChatView-BbbdeU9x.js +1559 -0
- package/dist/assets/ChatWorkflowAgentsView-BtunOxlC.js +116 -0
- package/dist/assets/CollectionParameter-BdcPG1lu.js +52 -0
- package/dist/assets/CommitMonoVariable-ytizKI8U.woff2 +0 -0
- package/dist/assets/CommunityNodeUpdateInfo-C37kca4W.js +273 -0
- package/dist/assets/CopyInput-DDZVu2iU.js +74 -0
- package/dist/assets/CredentialIcon-8YdTTFZ1.js +80 -0
- package/dist/assets/CredentialPicker-DWtj314o.js +293 -0
- package/dist/assets/CredentialSelectorModal-DTW2fKh0.js +138 -0
- package/dist/assets/CredentialsView-BjUchcCu.js +480 -0
- package/dist/assets/DataTableActions-DpAkoxg_.js +95 -0
- package/dist/assets/DataTableDetailsView-Coq7zdW5.js +41922 -0
- package/dist/assets/DataTableView-Cs-BIkzw.js +293 -0
- package/dist/assets/DemoFooter-Cga3jvi-.js +65 -0
- package/dist/assets/Draggable-vfvXl9Sp.js +105 -0
- package/dist/assets/EmptySharedSectionActionBox-DOXZtTCv.js +36 -0
- package/dist/assets/EnterpriseEdition.ee-D_rCFexM.js +15 -0
- package/dist/assets/EntityNotFound-3dhTRWsE.js +85 -0
- package/dist/assets/EntityUnAuthorised-ChJYZakE.js +66 -0
- package/dist/assets/ErrorView-zT9cX76a.js +61 -0
- package/dist/assets/EvaluationsRootView-C-OVWYnY.js +523 -0
- package/dist/assets/EvaluationsView-CJwJTruc.js +469 -0
- package/dist/assets/ExecutionsTime-DEQiyozR.js +573 -0
- package/dist/assets/ExecutionsView-Bd5Oh8TH.js +791 -0
- package/dist/assets/ExternalSecretsProviderConnectionSwitch.ee-C7Ih-uRo.js +191 -0
- package/dist/assets/FixedCollectionParameter-CYuTDW9t.js +496 -0
- package/dist/assets/ForgotMyPasswordView-Bs_L9P27.js +102 -0
- package/dist/assets/InsightsChartAverageRuntime-Bp3VA8_7.js +62 -0
- package/dist/assets/InsightsChartFailed-KPaNWoEr.js +52 -0
- package/dist/assets/InsightsChartFailureRate-DE6kE3FM.js +54 -0
- package/dist/assets/InsightsChartTimeSaved-auABNZlc.js +68 -0
- package/dist/assets/InsightsChartTotal-BKzYRKE7.js +56 -0
- package/dist/assets/InsightsDashboard-JWx4W6Db.js +473 -0
- package/dist/assets/InsightsPaywall-C8zLLKe8.js +63 -0
- package/dist/assets/InsightsSummary-cmN1lHDm.js +210 -0
- package/dist/assets/InsightsTableWorkflows-CqcC3IbQ.js +203 -0
- package/dist/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
- package/dist/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
- package/dist/assets/ItemsRenderer-DC8WVyMv.js +922 -0
- package/dist/assets/KeyboardShortcutTooltip-D8PAK5JP.js +31 -0
- package/dist/assets/LogsPanel-BR06u9RK.js +52 -0
- package/dist/assets/LogsPanel-C-_acMHp.js +2325 -0
- package/dist/assets/MCPConnectWorkflowsModal-3g8_iUa4.js +303 -0
- package/dist/assets/MainHeader-DiQc1edn.js +2153 -0
- package/dist/assets/MainSidebar-CoPGG5Ea.js +804 -0
- package/dist/assets/MigrationRuleDetail-BAxk1Pvl.js +295 -0
- package/dist/assets/MigrationRules-IW9lZMpE.js +285 -0
- package/dist/assets/Modal-CIzXlZdZ.js +204 -0
- package/dist/assets/ModelByIdSelectorModal-DLvBjzJO.js +115 -0
- package/dist/assets/NDVEmptyState-33UoX00I.js +19743 -0
- package/dist/assets/NodeCreation-BNzbSWSB.js +240 -0
- package/dist/assets/NodeCreator-BftgCKx7.js +1288 -0
- package/dist/assets/NodeDetailsView-CsoQCpcF.js +1075 -0
- package/dist/assets/NodeDetailsViewV2-C_wNQR_3.js +981 -0
- package/dist/assets/NodeIcon-B9VW6tX6.js +87 -0
- package/dist/assets/NodeSettings-ZwVip6VR.js +1872 -0
- package/dist/assets/NodeView-D4WUEvLB.js +2452 -0
- package/dist/assets/OAuthConsentView-DlrUqZbT.js +230 -0
- package/dist/assets/PageViewLayout-NT1KPFgy.js +12 -0
- package/dist/assets/ParameterInputList-sG2nz-Jo.js +38091 -0
- package/dist/assets/PrebuiltAgentTemplatesView-Csi5U8dc.js +154 -0
- package/dist/assets/ProjectBreadcrumb-C_XiY7sc.js +98 -0
- package/dist/assets/ProjectCardBadge-t_hs7vzx.js +209 -0
- package/dist/assets/ProjectHeader-Dq5Ihb26.js +549 -0
- package/dist/assets/ProjectIcon-DY8gGuHX.js +64 -0
- package/dist/assets/ProjectRoleView-Du-KTrAC.js +435 -0
- package/dist/assets/ProjectRolesView-DjxM_y4u.js +239 -0
- package/dist/assets/ProjectSettings-C6kWuV21.js +966 -0
- package/dist/assets/ProjectSharing-CVUgNWAY.js +262 -0
- package/dist/assets/ProjectVariables-CJlAo3dv.js +467 -0
- package/dist/assets/ProviderSettingsModal-BUFC2ZLv.js +307 -0
- package/dist/assets/PushConnectionTracker-DPBnGV0v.js +27 -0
- package/dist/assets/ResolversView-3BdkvvYA.js +209 -0
- package/dist/assets/ResourceFiltersDropdown-dgyXpcEX.js +159 -0
- package/dist/assets/ResourcesListLayout-qBLtomK6.js +631 -0
- package/dist/assets/RunDataHtml-BrW0OQra.js +7 -0
- package/dist/assets/RunDataHtml-Cleia4Cj.js +40 -0
- package/dist/assets/RunDataJson-uxkrhYRK.js +227 -0
- package/dist/assets/RunDataJsonActions-DkPk7E8d.js +5007 -0
- package/dist/assets/RunDataParsedAiContent-CtPRjig-.js +26 -0
- package/dist/assets/RunDataParsedAiContent-WAuqLQ5M.js +192 -0
- package/dist/assets/RunDataSearch-YBWUr93C.js +141 -0
- package/dist/assets/RunDataTable-DcXaBynW.js +631 -0
- package/dist/assets/SamlOnboarding-BTdQ_hr3.js +78 -0
- package/dist/assets/SaveButton-D5sQSxIk.js +89 -0
- package/dist/assets/SelectedItemsInfo-BHZ-NvF5.js +58 -0
- package/dist/assets/SettingsApiView-IfZTMXx1.js +313 -0
- package/dist/assets/SettingsChatHubView-gWh2X6vX.js +285 -0
- package/dist/assets/SettingsCommunityNodesView-D8VQtpGY.js +349 -0
- package/dist/assets/SettingsExternalSecrets-CpMc7mkW.js +233 -0
- package/dist/assets/SettingsLdapView-CU5a2MAy.js +2553 -0
- package/dist/assets/SettingsLogStreamingView-uojTe-oX.js +375 -0
- package/dist/assets/SettingsMCPView-B5Swp1C_.js +1214 -0
- package/dist/assets/SettingsPersonalView-Cr3aGood.js +402 -0
- package/dist/assets/SettingsSourceControl-DXOvFDEY.js +547 -0
- package/dist/assets/SettingsSso-27MfU1HV.js +1032 -0
- package/dist/assets/SettingsUsageAndPlan-DqIO-G46.js +419 -0
- package/dist/assets/SettingsUsersView-DfHB4_Kh.js +833 -0
- package/dist/assets/SettingsView-C4sA7Uny.js +90 -0
- package/dist/assets/SetupTemplateFormStep-BmiSzZin.js +258 -0
- package/dist/assets/SetupView-VORZ-L_u.js +112 -0
- package/dist/assets/SetupWorkflowCredentialsButton-DTmkOAW5.js +73 -0
- package/dist/assets/SetupWorkflowFromTemplateView-B9NupdJE.js +286 -0
- package/dist/assets/SeverityTag-CX1qTTNA.js +45 -0
- package/dist/assets/SigninView-D9_Pm16j.js +358 -0
- package/dist/assets/SignoutView-BFsjEAGz.js +19 -0
- package/dist/assets/SignupView-Am4ot0QZ.js +137 -0
- package/dist/assets/SkeletonAgentCard-C5TL-h8F.js +191 -0
- package/dist/assets/TagsDropdown-Bvx_Hd6Q.js +230 -0
- package/dist/assets/TemplateCard-CyQ1GuVz.js +105 -0
- package/dist/assets/TemplateDetails-CZRusTxE.js +124 -0
- package/dist/assets/TemplateList-DKvbwuiY.js +333 -0
- package/dist/assets/TemplatesCollectionView-D8dxU8By.js +184 -0
- package/dist/assets/TemplatesSearchView-CebC_GLs.js +1230 -0
- package/dist/assets/TemplatesView-025CcmIY.js +57 -0
- package/dist/assets/TemplatesWorkflowView-C2JfwJAn.js +170 -0
- package/dist/assets/TestRunDetailView-Ck78TTWO.js +395 -0
- package/dist/assets/TextWithHighlights-BxumwGnv.js +57 -0
- package/dist/assets/TimeAgo-C6EN4lCs.js +123 -0
- package/dist/assets/ToolsSelectorModal-8QJoUvRL.js +368 -0
- package/dist/assets/TriggerPanel-B6pacLkk.js +1225 -0
- package/dist/assets/VirtualSchema-B3zGe_8b.js +2402 -0
- package/dist/assets/VirtualSchema-Dkh0Cu5z.js +37 -0
- package/dist/assets/VueMarkdown-CQqJL9vK.js +28 -0
- package/dist/assets/WorkerView-Caznsljo.js +563 -0
- package/dist/assets/WorkflowActivationErrorMessage-CGrfPi9O.js +17 -0
- package/dist/assets/WorkflowActivator-BINnz0f7.js +362 -0
- package/dist/assets/WorkflowExecutionsInfoAccordion-Dg37yEfT.js +166 -0
- package/dist/assets/WorkflowExecutionsLandingPage-V2wdubhK.js +93 -0
- package/dist/assets/WorkflowExecutionsPreview-DdJaqYV6.js +616 -0
- package/dist/assets/WorkflowExecutionsView-DV8ySTfn.js +808 -0
- package/dist/assets/WorkflowHistory-GtaBMzIM.js +973 -0
- package/dist/assets/WorkflowLocation-CQ9Sq-2y.js +164 -0
- package/dist/assets/WorkflowOnboardingView-C49gt0Jr.js +61 -0
- package/dist/assets/WorkflowPreview-CXdvv4Nq.js +186 -0
- package/dist/assets/WorkflowTagsDropdown-QwbICWjN.js +71 -0
- package/dist/assets/WorkflowsView-B-MWIECO.js +3253 -0
- package/dist/assets/_MapCache-CcdIl4Ae.js +363 -0
- package/dist/assets/_baseOrderBy-N8Be_6z6.js +2989 -0
- package/dist/assets/_initCloneObject-viQQyT6o.js +80 -0
- package/dist/assets/_plugin-vue_export-helper-BwBpWJRZ.js +6 -0
- package/dist/assets/aiTemplatesStarterCollection.store-nL9nePkK.js +656 -0
- package/dist/assets/apiKeys.store-BhOFmP2j.js +51 -0
- package/dist/assets/assistant.store-CNywgN4S.js +518 -0
- package/dist/assets/auth.eventBus-CWXS0Qp7.js +5 -0
- package/dist/assets/banners.store-CGEcBTDn.js +195 -0
- package/dist/assets/builder.store-Czk2ipDE.js +31417 -0
- package/dist/assets/buttons.esm-yintpW2E.js +364 -0
- package/dist/assets/chart-CNvyywtJ.js +10958 -0
- package/dist/assets/chartjs.utils-BAE52Cv9.js +155 -0
- package/dist/assets/chat.store-290YeyrQ.js +865 -0
- package/dist/assets/chatPanel.store-NDaawEZL.js +118 -0
- package/dist/assets/chunk-6z4oVpB-.js +36 -0
- package/dist/assets/col-Cmt4cmuS.js +158 -0
- package/dist/assets/constants-C8OH4tTq.js +106256 -0
- package/dist/assets/constants-DMrsrpD7.js +32 -0
- package/dist/assets/core-B9gt_4yk.js +4 -0
- package/dist/assets/core-CP5FY4aX.js +1202 -0
- package/dist/assets/core-CRbPymLT.js +9741 -0
- package/dist/assets/dataTable.store-DmipQsol.js +207 -0
- package/dist/assets/date-picker-2IDsBs2n.js +4115 -0
- package/dist/assets/dateFormatter-ik4-9_9r.js +33 -0
- package/dist/assets/dateformat-hG8NERse.js +181 -0
- package/dist/assets/dialog-lMho1TD8.js +425 -0
- package/dist/assets/dist-Cw46Is-h.js +151 -0
- package/dist/assets/doppler-B__k0MeW.webp +0 -0
- package/dist/assets/element-icons-B-tDfklg.woff +0 -0
- package/dist/assets/element-icons-_lZGOqcG.ttf +0 -0
- package/dist/assets/empty-BuGRxzl4.js +2210 -0
- package/dist/assets/en-CF30SCh2.js +95 -0
- package/dist/assets/en-DyO2pPiC.js +2 -0
- package/dist/assets/es-BkUFJVtD.js +43338 -0
- package/dist/assets/evaluation.constants-GYAwmJnh.js +284 -0
- package/dist/assets/executions.store-B9uRYwgv.js +205 -0
- package/dist/assets/exports-Crx_gvt_.js +1799 -0
- package/dist/assets/externalSecrets.ee.store-BJh4a_6G.js +118 -0
- package/dist/assets/fileUtils-CRWqOQje.js +20 -0
- package/dist/assets/folders.store-yAFj-5Vl.js +235 -0
- package/dist/assets/get-BcEmeOxn.js +2781 -0
- package/dist/assets/index-SL8542zQ.js +28372 -0
- package/dist/assets/insights.constants-BkJCYJTL.js +55 -0
- package/dist/assets/insights.store-BFc3kDUo.js +61 -0
- package/dist/assets/insights.utils-CcLXdrrz.js +77 -0
- package/dist/assets/isEmpty-C3XXoHqJ.js +35216 -0
- package/dist/assets/languageModules-9LyndCqU.js +13862 -0
- package/dist/assets/logStreaming.store-IZhWe_VK.js +190 -0
- package/dist/assets/mcp.constants-_Jcn7fPq.js +10 -0
- package/dist/assets/mcp.store-B9yfcAN9.js +116 -0
- package/dist/assets/merge-DhuTk1HM.js +564 -0
- package/dist/assets/nodeCreator.store-Bpnrwp2l.js +5444 -0
- package/dist/assets/nodeIcon-D6X-ENYt.js +102 -0
- package/dist/assets/nodeTransforms-RzcOM0v2.js +42 -0
- package/dist/assets/orderBy-Cu9F9DU_.js +15 -0
- package/dist/assets/path-browserify-RUt2u7iT.js +328 -0
- package/dist/assets/personalizedTemplatesV3.store-BGYp0YBN.js +334 -0
- package/dist/assets/pickBy-UI0Jt4wC.js +18 -0
- package/dist/assets/preload-helper-dyVz7ck7.js +59 -0
- package/dist/assets/radio-CSce3UT0.js +262 -0
- package/dist/assets/readyToRun.store-YEMvPUqo.js +626 -0
- package/dist/assets/readyToRunWorkflows.store-G3srgIze.js +1319 -0
- package/dist/assets/retry-BgHaYzbB.js +23 -0
- package/dist/assets/roles.store-CRf_zJTb.js +51 -0
- package/dist/assets/router-DNpzz3GH.js +2631 -0
- package/dist/assets/sanitize-html-CbW56HUN.js +10758 -0
- package/dist/assets/schemaPreview.store-DUgN1yVE.js +113 -0
- package/dist/assets/semver-Bk6DGseV.js +1306 -0
- package/dist/assets/smartDecimal-DAZl4HKA.js +6 -0
- package/dist/assets/sortByProperty-Cn7iGKYu.js +8 -0
- package/dist/assets/sourceControl.eventBus-D47xXSc_.js +3 -0
- package/dist/assets/sqlite3-DBpDb1lf.wasm +0 -0
- package/dist/assets/sqlite3-opfs-async-proxy-vVtmDGHX.js +461 -0
- package/dist/assets/sqlite3-worker1-bundler-friendly-DLarOZDL.js +9405 -0
- package/dist/assets/src-jviYSG25.js +55454 -0
- package/dist/assets/sso.store-DyApJwhx.js +139 -0
- package/dist/assets/style-E3CrYFV8.css +111829 -0
- package/dist/assets/table-we1DjFMV.js +3944 -0
- package/dist/assets/templateActions-bEDSARw2.js +65 -0
- package/dist/assets/templateTransforms-BHWiRbtR.js +43 -0
- package/dist/assets/truncate-C0KYt7i3.js +4176 -0
- package/dist/assets/typescript.worker-CYqLvLHh.js +152048 -0
- package/dist/assets/uniqBy-xDyuCRP0.js +10 -0
- package/dist/assets/usage.store-CU5J_nGm.js +100 -0
- package/dist/assets/useActions-B1JckIRj.js +255 -0
- package/dist/assets/useBeforeUnload-DiDkvI8p.js +40 -0
- package/dist/assets/useCanvasMapping-BXT7rGhC.js +12570 -0
- package/dist/assets/useCanvasOperations-8ULLtMkY.js +1765 -0
- package/dist/assets/useClipboard-DvjhVHqJ.js +39 -0
- package/dist/assets/useCommandBar-C4tLJbKt.js +2425 -0
- package/dist/assets/useCredentialResolvers-BKeFGJnY.js +78 -0
- package/dist/assets/useCustomAgent-DpILEt5e.js +471 -0
- package/dist/assets/useDebounce-Br5_1ug-.js +147 -0
- package/dist/assets/useExecutionData-M5iKsX6z.js +23 -0
- package/dist/assets/useExecutionDebugging-8azMzbnd.js +191 -0
- package/dist/assets/useExecutionHelpers-BgRRhpBM.js +91 -0
- package/dist/assets/useImportCurlCommand-CKiEmX5P.js +8891 -0
- package/dist/assets/useIntersectionObserver-BWMwOueh.js +33 -0
- package/dist/assets/useKeybindings-B2jfN6rd.js +62 -0
- package/dist/assets/useLogsTreeExpand-sZViUfdM.js +843 -0
- package/dist/assets/useMcp-DoMOIfqT.js +27 -0
- package/dist/assets/usePageRedirectionHelper-DjkznpX6.js +51 -0
- package/dist/assets/usePinnedData-BhZkqttf.js +203 -0
- package/dist/assets/usePushConnection-DMS-F_IW.js +513 -0
- package/dist/assets/useRecentResources-BVORr7eM.js +118 -0
- package/dist/assets/useRunWorkflow-LO7ffLp9.js +950 -0
- package/dist/assets/useSettingsItems-BhZXwMZn.js +144 -0
- package/dist/assets/useTelemetryContext-V6bv4YRq.js +34 -0
- package/dist/assets/useWorkflowActivate-DeSmDXjI.js +152 -0
- package/dist/assets/useWorkflowsCache-DtcEEAIR.js +179 -0
- package/dist/assets/userRoleProvisioning.store-kkSIdeTo.js +33 -0
- package/dist/assets/utils-DI7dLldp.js +54 -0
- package/dist/assets/versions.store-B1z2OrLE.js +191 -0
- package/dist/assets/vue-CydWIhxN.js +4378 -0
- package/dist/assets/vue-json-pretty-CsGX66mG.js +1130 -0
- package/dist/assets/vue.runtime.esm-bundler-tP5dCd7J.js +7325 -0
- package/dist/assets/xml-B_oj6Mle.js +2060 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +157 -0
- package/dist/static/base-path.js +1 -0
- package/dist/static/community_package_tooltip_img.png +0 -0
- package/dist/static/data-mapping-gif.gif +0 -0
- package/dist/static/form-grey.svg +1 -0
- package/dist/static/google-auth/disabled.dark.png +0 -0
- package/dist/static/google-auth/disabled.png +0 -0
- package/dist/static/google-auth/focus.dark.png +0 -0
- package/dist/static/google-auth/focus.png +0 -0
- package/dist/static/google-auth/normal.dark.png +0 -0
- package/dist/static/google-auth/normal.png +0 -0
- package/dist/static/google-auth/pressed.dark.png +0 -0
- package/dist/static/google-auth/pressed.png +0 -0
- package/dist/static/n8n-logo.png +0 -0
- package/dist/static/og_image.png +0 -0
- package/dist/static/open-ai.svg +1 -0
- package/dist/static/openChat.png +0 -0
- package/dist/static/posthog.init.js +41 -0
- package/dist/static/prefers-color-scheme.css +5 -0
- package/dist/static/webhook-icon.svg +1 -0
- package/dist/tree-sitter-bash.wasm +0 -0
- package/dist/tree-sitter.wasm +0 -0
- package/eslint.config.mjs +59 -0
- package/index.html +45 -0
- package/index.js +0 -0
- package/package.json +147 -0
- package/postcss.config.cjs +6 -0
- package/scripts/fetch-node-popularity.mjs +102 -0
- package/stylelint.config.mjs +9 -0
- package/tailwind.config.js +8 -0
- package/tsconfig.json +36 -0
- package/vite/i18n-locales-hmr-helpers.ts +19 -0
- package/vite/source-map-js-shim.ts +1 -0
- package/vite/vite-plugin-node-popularity.mts +32 -0
- package/vite.config.mts +304 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
import { C as computed, Cn as toDisplayString, D as createElementBlock, Gt as unref, It as ref, L as h, P as defineComponent, _t as watch, et as openBlock, j as createTextVNode, w as createBaseVNode } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
|
|
2
|
+
import { rt as useI18n } from "./core-CRbPymLT.js";
|
|
3
|
+
import { s as createEventBus } from "./truncate-C0KYt7i3.js";
|
|
4
|
+
import { Er as useUsersStore, N as useNDVStore, P as useWorkflowsStore, Zo as CREDENTIAL_EDIT_MODAL_KEY, _n as useCredentialsStore, aa as useUIStore, bn as replaceCode, k as useTelemetry, ms as useSettingsStore, ra as codeNodeEditorEventBus, us as v4_default, vn as chatWithAssistant, wc as STORES, xn as useAIAssistantHelpers, y as useToast } from "./builder.store-Czk2ipDE.js";
|
|
5
|
+
import { _ as useRoute } from "./get-BcEmeOxn.js";
|
|
6
|
+
import { Io as EDITABLE_CANVAS_VIEWS, wa as deepCopy } from "./constants-C8OH4tTq.js";
|
|
7
|
+
import { g as assert, k as defineStore, r as useRootStore } from "./_baseOrderBy-N8Be_6z6.js";
|
|
8
|
+
const useChatPanelStateStore = defineStore(STORES.CHAT_PANEL_STATE, () => {
|
|
9
|
+
return {
|
|
10
|
+
isOpen: ref(false),
|
|
11
|
+
width: ref(400),
|
|
12
|
+
activeMode: ref("builder")
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
const ndvEventBus = createEventBus();
|
|
16
|
+
var _hoisted_1 = ["data-action-parameter-node"];
|
|
17
|
+
var AiUpdatedCodeMessage_default = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "AiUpdatedCodeMessage",
|
|
19
|
+
props: { nodeName: {} },
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const i18n = useI18n();
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createElementBlock("div", null, [
|
|
24
|
+
createTextVNode(toDisplayString(unref(i18n).baseText("aiAssistant.codeUpdated.message.body1")) + " ", 1),
|
|
25
|
+
createBaseVNode("a", {
|
|
26
|
+
"data-action": "openNodeDetail",
|
|
27
|
+
"data-action-parameter-node": _ctx.nodeName
|
|
28
|
+
}, toDisplayString(_ctx.nodeName), 9, _hoisted_1),
|
|
29
|
+
createTextVNode(" " + toDisplayString(unref(i18n).baseText("aiAssistant.codeUpdated.message.body2")), 1)
|
|
30
|
+
]);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var READABLE_TYPES = [
|
|
35
|
+
"code-diff",
|
|
36
|
+
"text",
|
|
37
|
+
"block"
|
|
38
|
+
];
|
|
39
|
+
const useAssistantStore = defineStore(STORES.ASSISTANT, () => {
|
|
40
|
+
const settings = useSettingsStore();
|
|
41
|
+
const rootStore = useRootStore();
|
|
42
|
+
const chatPanelStateStore = useChatPanelStateStore();
|
|
43
|
+
const chatMessages = ref([]);
|
|
44
|
+
const usersStore = useUsersStore();
|
|
45
|
+
const uiStore = useUIStore();
|
|
46
|
+
const workflowsStore = useWorkflowsStore();
|
|
47
|
+
const route = useRoute();
|
|
48
|
+
const streaming = ref();
|
|
49
|
+
const ndvStore = useNDVStore();
|
|
50
|
+
const locale = useI18n();
|
|
51
|
+
const telemetry = useTelemetry();
|
|
52
|
+
const assistantHelpers = useAIAssistantHelpers();
|
|
53
|
+
const suggestions = ref({});
|
|
54
|
+
const chatSessionCredType = ref();
|
|
55
|
+
const chatSessionError = ref();
|
|
56
|
+
const currentSessionId = ref();
|
|
57
|
+
const currentSessionActiveExecutionId = ref(void 0);
|
|
58
|
+
const currentSessionWorkflowId = ref();
|
|
59
|
+
const lastUnread = ref();
|
|
60
|
+
const nodeExecutionStatus = ref("not_executed");
|
|
61
|
+
const assistantThinkingMessage = ref();
|
|
62
|
+
const chatSessionTask = ref();
|
|
63
|
+
const workflowDataStale = ref(true);
|
|
64
|
+
const workflowExecutionDataStale = ref(true);
|
|
65
|
+
const assistantMessages = computed(() => chatMessages.value.filter((msg) => msg.role === "assistant"));
|
|
66
|
+
const usersMessages = computed(() => chatMessages.value.filter((msg) => msg.role === "user"));
|
|
67
|
+
const isSessionEnded = computed(() => {
|
|
68
|
+
const lastAssistantMessage = assistantMessages.value[assistantMessages.value.length - 1];
|
|
69
|
+
const sessionExplicitlyEnded = lastAssistantMessage?.type === "event" && lastAssistantMessage?.eventName === "end-session";
|
|
70
|
+
return !(currentSessionId.value !== void 0) || sessionExplicitlyEnded;
|
|
71
|
+
});
|
|
72
|
+
const isAssistantEnabled = computed(() => settings.isAiAssistantEnabled);
|
|
73
|
+
const hideAssistantFloatingButton = computed(() => EDITABLE_CANVAS_VIEWS.includes(route.name) && !workflowsStore.activeNode());
|
|
74
|
+
const unreadCount = computed(() => chatMessages.value.filter((msg) => READABLE_TYPES.includes(msg.type) && msg.role === "assistant" && !msg.read).length);
|
|
75
|
+
const isFloatingButtonShown = computed(() => !chatPanelStateStore.isOpen && !hideAssistantFloatingButton.value && isAssistantEnabled.value && EDITABLE_CANVAS_VIEWS.includes(route.name));
|
|
76
|
+
function resetAssistantChat() {
|
|
77
|
+
clearMessages();
|
|
78
|
+
currentSessionId.value = void 0;
|
|
79
|
+
chatSessionError.value = void 0;
|
|
80
|
+
lastUnread.value = void 0;
|
|
81
|
+
currentSessionActiveExecutionId.value = void 0;
|
|
82
|
+
suggestions.value = {};
|
|
83
|
+
nodeExecutionStatus.value = "not_executed";
|
|
84
|
+
chatSessionCredType.value = void 0;
|
|
85
|
+
chatSessionTask.value = void 0;
|
|
86
|
+
currentSessionWorkflowId.value = workflowsStore.workflowId;
|
|
87
|
+
}
|
|
88
|
+
function addAssistantMessages(newMessages, id) {
|
|
89
|
+
const read = chatPanelStateStore.isOpen && chatPanelStateStore.activeMode === "assistant";
|
|
90
|
+
const messages = [...chatMessages.value].filter((msg) => !(msg.id === id && msg.role === "assistant"));
|
|
91
|
+
assistantThinkingMessage.value = void 0;
|
|
92
|
+
(newMessages ?? []).forEach((msg) => {
|
|
93
|
+
if (msg.type === "message") messages.push({
|
|
94
|
+
id,
|
|
95
|
+
type: "text",
|
|
96
|
+
role: "assistant",
|
|
97
|
+
content: msg.text,
|
|
98
|
+
quickReplies: msg.quickReplies,
|
|
99
|
+
codeSnippet: msg.codeSnippet,
|
|
100
|
+
read
|
|
101
|
+
});
|
|
102
|
+
else if (msg.type === "code-diff") messages.push({
|
|
103
|
+
id,
|
|
104
|
+
role: "assistant",
|
|
105
|
+
type: "code-diff",
|
|
106
|
+
description: msg.description,
|
|
107
|
+
codeDiff: msg.codeDiff,
|
|
108
|
+
suggestionId: msg.suggestionId,
|
|
109
|
+
quickReplies: msg.quickReplies,
|
|
110
|
+
read
|
|
111
|
+
});
|
|
112
|
+
else if (msg.type === "summary") messages.push({
|
|
113
|
+
id,
|
|
114
|
+
type: "block",
|
|
115
|
+
role: "assistant",
|
|
116
|
+
title: msg.title,
|
|
117
|
+
content: msg.content,
|
|
118
|
+
quickReplies: msg.quickReplies,
|
|
119
|
+
read
|
|
120
|
+
});
|
|
121
|
+
else if (msg.type === "event") messages.push({
|
|
122
|
+
id,
|
|
123
|
+
type: "event",
|
|
124
|
+
role: "assistant",
|
|
125
|
+
eventName: msg.eventName,
|
|
126
|
+
read: true
|
|
127
|
+
});
|
|
128
|
+
else if (msg.type === "agent-suggestion") messages.push({
|
|
129
|
+
id,
|
|
130
|
+
type: "block",
|
|
131
|
+
role: "assistant",
|
|
132
|
+
title: msg.title,
|
|
133
|
+
content: msg.text,
|
|
134
|
+
quickReplies: msg.quickReplies,
|
|
135
|
+
read
|
|
136
|
+
});
|
|
137
|
+
else if (msg.type === "intermediate-step") assistantThinkingMessage.value = msg.text;
|
|
138
|
+
});
|
|
139
|
+
chatMessages.value = messages;
|
|
140
|
+
}
|
|
141
|
+
function isNodeErrorActive(context) {
|
|
142
|
+
const targetNode = context.node.name;
|
|
143
|
+
return chatSessionTask.value === "error" && workflowsStore.activeExecutionId === currentSessionActiveExecutionId.value && targetNode === chatSessionError.value?.node.name;
|
|
144
|
+
}
|
|
145
|
+
function isCredTypeActive(credType) {
|
|
146
|
+
return chatSessionTask.value === "credentials" && credType.name === chatSessionCredType.value?.name;
|
|
147
|
+
}
|
|
148
|
+
function clearMessages() {
|
|
149
|
+
chatMessages.value = [];
|
|
150
|
+
}
|
|
151
|
+
function stopStreaming() {
|
|
152
|
+
streaming.value = false;
|
|
153
|
+
}
|
|
154
|
+
function addAssistantError(content, id, retry) {
|
|
155
|
+
chatMessages.value.push({
|
|
156
|
+
id,
|
|
157
|
+
role: "assistant",
|
|
158
|
+
type: "error",
|
|
159
|
+
content,
|
|
160
|
+
read: true,
|
|
161
|
+
retry
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function addLoadingAssistantMessage(message) {
|
|
165
|
+
assistantThinkingMessage.value = message;
|
|
166
|
+
}
|
|
167
|
+
function addUserMessage(content, id) {
|
|
168
|
+
chatMessages.value.push({
|
|
169
|
+
id,
|
|
170
|
+
role: "user",
|
|
171
|
+
type: "text",
|
|
172
|
+
content,
|
|
173
|
+
read: true
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function handleServiceError(e, id, retry) {
|
|
177
|
+
assert(e instanceof Error);
|
|
178
|
+
stopStreaming();
|
|
179
|
+
assistantThinkingMessage.value = void 0;
|
|
180
|
+
addAssistantError(locale.baseText("aiAssistant.serviceError.message", { interpolate: { message: e.message } }), id, retry);
|
|
181
|
+
}
|
|
182
|
+
function onEachStreamingMessage(response, id) {
|
|
183
|
+
if (response.sessionId && !currentSessionId.value) {
|
|
184
|
+
currentSessionId.value = response.sessionId;
|
|
185
|
+
telemetry.track("Assistant session started", {
|
|
186
|
+
chat_session_id: currentSessionId.value,
|
|
187
|
+
task: chatSessionTask.value,
|
|
188
|
+
node_type: chatSessionError.value?.node.type,
|
|
189
|
+
credential_type: chatSessionCredType.value?.name
|
|
190
|
+
});
|
|
191
|
+
if (usersMessages.value.length === 1 && chatSessionTask.value === "support") {
|
|
192
|
+
const firstUserMessage = usersMessages.value[0];
|
|
193
|
+
trackUserMessage(firstUserMessage.content, false);
|
|
194
|
+
}
|
|
195
|
+
} else if (currentSessionId.value !== response.sessionId) return;
|
|
196
|
+
addAssistantMessages(response.messages, id);
|
|
197
|
+
}
|
|
198
|
+
function getRandomId() {
|
|
199
|
+
return `${Math.floor(Math.random() * 1e8)}`;
|
|
200
|
+
}
|
|
201
|
+
function onDoneStreaming(id) {
|
|
202
|
+
stopStreaming();
|
|
203
|
+
workflowDataStale.value = false;
|
|
204
|
+
workflowExecutionDataStale.value = false;
|
|
205
|
+
lastUnread.value = chatMessages.value.find((msg) => msg.id === id && !msg.read && msg.role === "assistant" && READABLE_TYPES.includes(msg.type));
|
|
206
|
+
setTimeout(() => {
|
|
207
|
+
if (lastUnread.value?.id === id) lastUnread.value = void 0;
|
|
208
|
+
}, 4e3);
|
|
209
|
+
}
|
|
210
|
+
async function initCredHelp(credType) {
|
|
211
|
+
const hasExistingSession = !!currentSessionId.value;
|
|
212
|
+
await initSupportChat(`How do I set up the credentials for ${credType.displayName}?`, credType);
|
|
213
|
+
trackUserOpenedAssistant({
|
|
214
|
+
source: "credential",
|
|
215
|
+
task: "credentials",
|
|
216
|
+
has_existing_session: hasExistingSession
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function getVisualContext(nodeInfo) {
|
|
220
|
+
if (chatSessionTask.value === "error") return;
|
|
221
|
+
const currentView = route.name;
|
|
222
|
+
const activeNode = workflowsStore.activeNode();
|
|
223
|
+
const activeNodeForLLM = activeNode ? assistantHelpers.processNodeForAssistant(activeNode, ["position", "parameters.notice"]) : null;
|
|
224
|
+
const activeCredential = uiStore.activeModals.includes("editCredential") ? useCredentialsStore().getCredentialTypeByName(uiStore.activeCredentialType ?? "") : void 0;
|
|
225
|
+
const executionResult = workflowsStore.workflowExecutionData?.data?.resultData;
|
|
226
|
+
const isCurrentNodeExecuted = Boolean(executionResult?.runData?.hasOwnProperty(activeNode?.name ?? ""));
|
|
227
|
+
const nodeError = executionResult?.error && "node" in executionResult.error && executionResult.error.node?.name === activeNode?.name ? executionResult.error : void 0;
|
|
228
|
+
const executionStatus = isCurrentNodeExecuted ? {
|
|
229
|
+
status: nodeError ? "error" : "success",
|
|
230
|
+
error: nodeError ? assistantHelpers.simplifyErrorForAssistant(nodeError) : void 0
|
|
231
|
+
} : void 0;
|
|
232
|
+
return {
|
|
233
|
+
currentView: {
|
|
234
|
+
name: currentView,
|
|
235
|
+
description: assistantHelpers.getCurrentViewDescription(currentView)
|
|
236
|
+
},
|
|
237
|
+
activeNodeInfo: {
|
|
238
|
+
node: activeNodeForLLM ?? void 0,
|
|
239
|
+
nodeIssues: !isCurrentNodeExecuted ? activeNode?.issues : void 0,
|
|
240
|
+
executionStatus,
|
|
241
|
+
nodeInputData: nodeInfo?.nodeInputData,
|
|
242
|
+
referencedNodes: nodeInfo?.schemas
|
|
243
|
+
},
|
|
244
|
+
activeCredentials: activeCredential ? {
|
|
245
|
+
name: activeCredential?.name,
|
|
246
|
+
displayName: activeCredential?.displayName,
|
|
247
|
+
authType: nodeInfo?.authType?.name
|
|
248
|
+
} : void 0,
|
|
249
|
+
currentWorkflow: workflowDataStale.value ? assistantHelpers.simplifyWorkflowForAssistant(workflowsStore.workflow) : void 0,
|
|
250
|
+
executionData: workflowExecutionDataStale.value && executionResult ? assistantHelpers.simplifyResultData(executionResult) : void 0
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
async function initSupportChat(userMessage, credentialType) {
|
|
254
|
+
resetAssistantChat();
|
|
255
|
+
chatSessionTask.value = credentialType ? "credentials" : "support";
|
|
256
|
+
const activeNode = workflowsStore.activeNode();
|
|
257
|
+
const nodeInfo = assistantHelpers.getNodeInfoForAssistant(activeNode);
|
|
258
|
+
const visualContext = chatSessionTask.value === "support" ? getVisualContext(nodeInfo) : void 0;
|
|
259
|
+
if (nodeInfo.authType && chatSessionTask.value === "credentials") userMessage += ` I am using ${nodeInfo.authType.name}.`;
|
|
260
|
+
const id = getRandomId();
|
|
261
|
+
chatSessionCredType.value = credentialType;
|
|
262
|
+
addUserMessage(userMessage, id);
|
|
263
|
+
addLoadingAssistantMessage(locale.baseText("aiAssistant.thinkingSteps.thinking"));
|
|
264
|
+
streaming.value = true;
|
|
265
|
+
let payload = {
|
|
266
|
+
role: "user",
|
|
267
|
+
type: "init-support-chat",
|
|
268
|
+
user: { firstName: usersStore.currentUser?.firstName ?? "" },
|
|
269
|
+
context: visualContext,
|
|
270
|
+
question: userMessage
|
|
271
|
+
};
|
|
272
|
+
if (credentialType) payload = {
|
|
273
|
+
...payload,
|
|
274
|
+
type: "init-cred-help",
|
|
275
|
+
credentialType: {
|
|
276
|
+
name: credentialType.name,
|
|
277
|
+
displayName: credentialType.displayName
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
chatWithAssistant(rootStore.restApiContext, { payload }, (msg) => onEachStreamingMessage(msg, id), () => onDoneStreaming(id), (e) => handleServiceError(e, id, async () => await initSupportChat(userMessage, credentialType)));
|
|
281
|
+
}
|
|
282
|
+
async function initErrorHelper(context) {
|
|
283
|
+
const id = getRandomId();
|
|
284
|
+
if (chatSessionError.value) {
|
|
285
|
+
if (isNodeErrorActive(context)) return;
|
|
286
|
+
}
|
|
287
|
+
resetAssistantChat();
|
|
288
|
+
chatSessionTask.value = "error";
|
|
289
|
+
chatSessionError.value = context;
|
|
290
|
+
currentSessionWorkflowId.value = workflowsStore.workflowId;
|
|
291
|
+
if (workflowsStore.activeExecutionId) currentSessionActiveExecutionId.value = workflowsStore.activeExecutionId;
|
|
292
|
+
const { authType, nodeInputData, schemas } = assistantHelpers.getNodeInfoForAssistant(context.node);
|
|
293
|
+
addLoadingAssistantMessage(locale.baseText("aiAssistant.thinkingSteps.analyzingError"));
|
|
294
|
+
streaming.value = true;
|
|
295
|
+
const payload = {
|
|
296
|
+
role: "user",
|
|
297
|
+
type: "init-error-helper",
|
|
298
|
+
user: { firstName: usersStore.currentUser?.firstName ?? "" },
|
|
299
|
+
error: context.error,
|
|
300
|
+
node: assistantHelpers.processNodeForAssistant(context.node, ["position", "parameters.notice"]),
|
|
301
|
+
nodeInputData,
|
|
302
|
+
executionSchema: schemas,
|
|
303
|
+
authType
|
|
304
|
+
};
|
|
305
|
+
chatWithAssistant(rootStore.restApiContext, { payload }, (msg) => onEachStreamingMessage(msg, id), () => onDoneStreaming(id), (e) => handleServiceError(e, id, async () => await initErrorHelper(context)));
|
|
306
|
+
}
|
|
307
|
+
async function sendEvent(eventName, error) {
|
|
308
|
+
if (isSessionEnded.value || streaming.value) return;
|
|
309
|
+
assert(currentSessionId.value);
|
|
310
|
+
const id = getRandomId();
|
|
311
|
+
addLoadingAssistantMessage(locale.baseText("aiAssistant.thinkingSteps.thinking"));
|
|
312
|
+
streaming.value = true;
|
|
313
|
+
chatWithAssistant(rootStore.restApiContext, {
|
|
314
|
+
payload: {
|
|
315
|
+
role: "user",
|
|
316
|
+
type: "event",
|
|
317
|
+
eventName,
|
|
318
|
+
error
|
|
319
|
+
},
|
|
320
|
+
sessionId: currentSessionId.value
|
|
321
|
+
}, (msg) => onEachStreamingMessage(msg, id), () => onDoneStreaming(id), (e) => handleServiceError(e, id, async () => await sendEvent(eventName, error)));
|
|
322
|
+
}
|
|
323
|
+
async function onNodeExecution(pushEvent) {
|
|
324
|
+
if (!chatSessionError.value || pushEvent.nodeName !== chatSessionError.value.node.name) return;
|
|
325
|
+
if (nodeExecutionStatus.value === "success") return;
|
|
326
|
+
if (pushEvent.data.error && nodeExecutionStatus.value !== "error") {
|
|
327
|
+
await sendEvent("node-execution-errored", pushEvent.data.error);
|
|
328
|
+
nodeExecutionStatus.value = "error";
|
|
329
|
+
telemetry.track("User executed node after assistant suggestion", {
|
|
330
|
+
task: chatSessionTask.value,
|
|
331
|
+
chat_session_id: currentSessionId.value,
|
|
332
|
+
success: false
|
|
333
|
+
});
|
|
334
|
+
} else if (pushEvent.data.executionStatus === "success" && ["error", "not_executed"].includes(nodeExecutionStatus.value)) {
|
|
335
|
+
await sendEvent("node-execution-succeeded");
|
|
336
|
+
nodeExecutionStatus.value = "success";
|
|
337
|
+
telemetry.track("User executed node after assistant suggestion", {
|
|
338
|
+
task: chatSessionTask.value,
|
|
339
|
+
chat_session_id: currentSessionId.value,
|
|
340
|
+
success: true
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
async function sendMessage(chatMessage) {
|
|
345
|
+
if (isSessionEnded.value || streaming.value) return;
|
|
346
|
+
const id = getRandomId();
|
|
347
|
+
const retry = async () => {
|
|
348
|
+
chatMessages.value = chatMessages.value.filter((msg) => msg.id !== id);
|
|
349
|
+
await sendMessage(chatMessage);
|
|
350
|
+
};
|
|
351
|
+
try {
|
|
352
|
+
addUserMessage(chatMessage.text, id);
|
|
353
|
+
addLoadingAssistantMessage(locale.baseText("aiAssistant.thinkingSteps.thinking"));
|
|
354
|
+
streaming.value = true;
|
|
355
|
+
assert(currentSessionId.value);
|
|
356
|
+
if (chatMessage.quickReplyType === "new-suggestion" && nodeExecutionStatus.value !== "not_executed") nodeExecutionStatus.value = "not_executed";
|
|
357
|
+
const activeNode = workflowsStore.activeNode();
|
|
358
|
+
const userContext = getVisualContext(assistantHelpers.getNodeInfoForAssistant(activeNode));
|
|
359
|
+
chatWithAssistant(rootStore.restApiContext, {
|
|
360
|
+
payload: {
|
|
361
|
+
id: v4_default(),
|
|
362
|
+
role: "user",
|
|
363
|
+
type: "message",
|
|
364
|
+
text: chatMessage.text,
|
|
365
|
+
quickReplyType: chatMessage.quickReplyType,
|
|
366
|
+
context: userContext
|
|
367
|
+
},
|
|
368
|
+
sessionId: currentSessionId.value
|
|
369
|
+
}, (msg) => onEachStreamingMessage(msg, id), () => onDoneStreaming(id), (e) => handleServiceError(e, id, retry));
|
|
370
|
+
trackUserMessage(chatMessage.text, !!chatMessage.quickReplyType);
|
|
371
|
+
} catch (e) {
|
|
372
|
+
handleServiceError(e, id, retry);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function trackUserMessage(message, isQuickReply) {
|
|
376
|
+
if (!currentSessionId.value) return;
|
|
377
|
+
telemetry.track("User sent message in Assistant", {
|
|
378
|
+
message,
|
|
379
|
+
is_quick_reply: isQuickReply,
|
|
380
|
+
chat_session_id: currentSessionId.value,
|
|
381
|
+
message_number: usersMessages.value.length,
|
|
382
|
+
task: chatSessionTask.value
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
function trackUserOpenedAssistant({ source, task, has_existing_session }) {
|
|
386
|
+
telemetry.track("User opened assistant", {
|
|
387
|
+
source,
|
|
388
|
+
task,
|
|
389
|
+
has_existing_session,
|
|
390
|
+
workflow_id: workflowsStore.workflowId,
|
|
391
|
+
node_type: chatSessionError.value?.node?.type,
|
|
392
|
+
error: chatSessionError.value?.error,
|
|
393
|
+
chat_session_id: currentSessionId.value
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
function updateParameters(workflowState, nodeName, parameters) {
|
|
397
|
+
if (ndvStore.activeNodeName === nodeName) Object.keys(parameters).forEach((key) => {
|
|
398
|
+
const update = {
|
|
399
|
+
node: nodeName,
|
|
400
|
+
name: `parameters.${key}`,
|
|
401
|
+
value: parameters[key]
|
|
402
|
+
};
|
|
403
|
+
ndvEventBus.emit("updateParameterValue", update);
|
|
404
|
+
});
|
|
405
|
+
else workflowState.setNodeParameters({
|
|
406
|
+
name: nodeName,
|
|
407
|
+
value: parameters
|
|
408
|
+
}, true);
|
|
409
|
+
}
|
|
410
|
+
function getRelevantParameters(parameters, keysToKeep) {
|
|
411
|
+
return keysToKeep.reduce((accu, key) => {
|
|
412
|
+
accu[key] = deepCopy(parameters[key]);
|
|
413
|
+
return accu;
|
|
414
|
+
}, {});
|
|
415
|
+
}
|
|
416
|
+
async function applyCodeDiff(workflowState, index) {
|
|
417
|
+
const codeDiffMessage = chatMessages.value[index];
|
|
418
|
+
if (!codeDiffMessage || codeDiffMessage.type !== "code-diff") throw new Error("No code diff to apply");
|
|
419
|
+
try {
|
|
420
|
+
assert(chatSessionError.value);
|
|
421
|
+
assert(currentSessionId.value);
|
|
422
|
+
codeDiffMessage.replacing = true;
|
|
423
|
+
const suggestionId = codeDiffMessage.suggestionId;
|
|
424
|
+
const activeNode = workflowsStore.workflowObject.getNode(chatSessionError.value.node.name);
|
|
425
|
+
assert(activeNode);
|
|
426
|
+
const cached = suggestions.value[suggestionId];
|
|
427
|
+
if (cached) updateParameters(workflowState, activeNode.name, cached.suggested);
|
|
428
|
+
else {
|
|
429
|
+
const { parameters: suggested } = await replaceCode(rootStore.restApiContext, {
|
|
430
|
+
suggestionId: codeDiffMessage.suggestionId,
|
|
431
|
+
sessionId: currentSessionId.value
|
|
432
|
+
});
|
|
433
|
+
suggestions.value[suggestionId] = {
|
|
434
|
+
previous: getRelevantParameters(activeNode.parameters, Object.keys(suggested)),
|
|
435
|
+
suggested
|
|
436
|
+
};
|
|
437
|
+
updateParameters(workflowState, activeNode.name, suggested);
|
|
438
|
+
}
|
|
439
|
+
codeDiffMessage.replaced = true;
|
|
440
|
+
codeNodeEditorEventBus.emit("codeDiffApplied");
|
|
441
|
+
showCodeUpdateToastIfNeeded(activeNode.name);
|
|
442
|
+
} catch (e) {
|
|
443
|
+
console.error(e);
|
|
444
|
+
codeDiffMessage.error = true;
|
|
445
|
+
}
|
|
446
|
+
codeDiffMessage.replacing = false;
|
|
447
|
+
}
|
|
448
|
+
async function undoCodeDiff(workflowState, index) {
|
|
449
|
+
const codeDiffMessage = chatMessages.value[index];
|
|
450
|
+
if (!codeDiffMessage || codeDiffMessage.type !== "code-diff") throw new Error("No code diff to apply");
|
|
451
|
+
try {
|
|
452
|
+
assert(chatSessionError.value);
|
|
453
|
+
assert(currentSessionId.value);
|
|
454
|
+
codeDiffMessage.replacing = true;
|
|
455
|
+
const suggestionId = codeDiffMessage.suggestionId;
|
|
456
|
+
const suggestion = suggestions.value[suggestionId];
|
|
457
|
+
assert(suggestion);
|
|
458
|
+
const activeNode = workflowsStore.workflowObject.getNode(chatSessionError.value.node.name);
|
|
459
|
+
assert(activeNode);
|
|
460
|
+
const suggested = suggestion.previous;
|
|
461
|
+
updateParameters(workflowState, activeNode.name, suggested);
|
|
462
|
+
codeDiffMessage.replaced = false;
|
|
463
|
+
codeNodeEditorEventBus.emit("codeDiffApplied");
|
|
464
|
+
showCodeUpdateToastIfNeeded(activeNode.name);
|
|
465
|
+
} catch (e) {
|
|
466
|
+
console.error(e);
|
|
467
|
+
codeDiffMessage.error = true;
|
|
468
|
+
}
|
|
469
|
+
codeDiffMessage.replacing = false;
|
|
470
|
+
}
|
|
471
|
+
function showCodeUpdateToastIfNeeded(errorNodeName) {
|
|
472
|
+
if (errorNodeName !== ndvStore.activeNodeName) useToast().showMessage({
|
|
473
|
+
type: "success",
|
|
474
|
+
title: locale.baseText("aiAssistant.codeUpdated.message.title"),
|
|
475
|
+
message: h(AiUpdatedCodeMessage_default, { nodeName: errorNodeName }),
|
|
476
|
+
duration: 4e3
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
watch(route, () => {
|
|
480
|
+
const activeWorkflowId = workflowsStore.workflowId;
|
|
481
|
+
if (!currentSessionId.value || !currentSessionWorkflowId.value || currentSessionWorkflowId.value === activeWorkflowId) return;
|
|
482
|
+
resetAssistantChat();
|
|
483
|
+
});
|
|
484
|
+
watch(() => uiStore.stateIsDirty, () => {
|
|
485
|
+
workflowDataStale.value = true;
|
|
486
|
+
});
|
|
487
|
+
watch(() => workflowsStore.workflowExecutionResultDataLastUpdate, () => {
|
|
488
|
+
workflowExecutionDataStale.value = true;
|
|
489
|
+
}, { immediate: true });
|
|
490
|
+
return {
|
|
491
|
+
isAssistantEnabled,
|
|
492
|
+
hideAssistantFloatingButton,
|
|
493
|
+
chatMessages,
|
|
494
|
+
unreadCount,
|
|
495
|
+
streaming,
|
|
496
|
+
currentSessionId,
|
|
497
|
+
lastUnread,
|
|
498
|
+
isSessionEnded,
|
|
499
|
+
isFloatingButtonShown,
|
|
500
|
+
onNodeExecution,
|
|
501
|
+
trackUserOpenedAssistant,
|
|
502
|
+
isNodeErrorActive,
|
|
503
|
+
initErrorHelper,
|
|
504
|
+
initSupportChat,
|
|
505
|
+
sendMessage,
|
|
506
|
+
applyCodeDiff,
|
|
507
|
+
undoCodeDiff,
|
|
508
|
+
resetAssistantChat,
|
|
509
|
+
addAssistantMessages,
|
|
510
|
+
assistantThinkingMessage,
|
|
511
|
+
chatSessionError,
|
|
512
|
+
chatSessionTask,
|
|
513
|
+
initCredHelp,
|
|
514
|
+
isCredTypeActive,
|
|
515
|
+
handleServiceError
|
|
516
|
+
};
|
|
517
|
+
});
|
|
518
|
+
export { ndvEventBus as n, useChatPanelStateStore as r, useAssistantStore as t };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { s as createEventBus } from "./truncate-C0KYt7i3.js";
|
|
2
|
+
const confirmPasswordEventBus = createEventBus();
|
|
3
|
+
const mfaEventBus = createEventBus();
|
|
4
|
+
const promptMfaCodeBus = createEventBus();
|
|
5
|
+
export { mfaEventBus as n, promptMfaCodeBus as r, confirmPasswordEventBus as t };
|