@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,78 @@
|
|
|
1
|
+
import { It as ref } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
|
|
2
|
+
import { rt as useI18n } from "./core-CRbPymLT.js";
|
|
3
|
+
import { aa as useUIStore, h as useMessage, lc as getCredentialResolverTypes, sc as deleteCredentialResolver, uc as getCredentialResolvers, y as useToast } from "./builder.store-Czk2ipDE.js";
|
|
4
|
+
import { Wo as CREDENTIAL_RESOLVER_EDIT_MODAL_KEY, rs as MODAL_CONFIRM } from "./constants-C8OH4tTq.js";
|
|
5
|
+
import { r as useRootStore } from "./_baseOrderBy-N8Be_6z6.js";
|
|
6
|
+
function useCredentialResolvers() {
|
|
7
|
+
const rootStore = useRootStore();
|
|
8
|
+
const uiStore = useUIStore();
|
|
9
|
+
const message = useMessage();
|
|
10
|
+
const toast = useToast();
|
|
11
|
+
const i18n = useI18n();
|
|
12
|
+
const resolvers = ref([]);
|
|
13
|
+
const resolverTypes = ref([]);
|
|
14
|
+
const isLoading = ref(false);
|
|
15
|
+
const isDeleting = ref(false);
|
|
16
|
+
const fetchResolvers = async () => {
|
|
17
|
+
try {
|
|
18
|
+
isLoading.value = true;
|
|
19
|
+
resolvers.value = await getCredentialResolvers(rootStore.restApiContext);
|
|
20
|
+
} catch (error) {
|
|
21
|
+
toast.showError(error, i18n.baseText("workflowSettings.showError.fetchSettings.title"));
|
|
22
|
+
} finally {
|
|
23
|
+
isLoading.value = false;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const fetchResolverTypes = async () => {
|
|
27
|
+
try {
|
|
28
|
+
resolverTypes.value = await getCredentialResolverTypes(rootStore.restApiContext);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
toast.showError(error, i18n.baseText("credentialResolverEdit.error.loadTypes"));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const confirmAndDeleteResolver = async (resolver) => {
|
|
34
|
+
if (await message.confirm(i18n.baseText("credentialResolverEdit.confirmMessage.deleteResolver.message", { interpolate: { savedResolverName: resolver.name } }), i18n.baseText("credentialResolverEdit.confirmMessage.deleteResolver.headline"), { confirmButtonText: i18n.baseText("credentialResolverEdit.confirmMessage.deleteResolver.confirmButtonText") }) !== "confirm") return false;
|
|
35
|
+
try {
|
|
36
|
+
isDeleting.value = true;
|
|
37
|
+
await deleteCredentialResolver(rootStore.restApiContext, resolver.id);
|
|
38
|
+
toast.showMessage({
|
|
39
|
+
title: i18n.baseText("credentialResolverEdit.deleteSuccess.title"),
|
|
40
|
+
type: "success"
|
|
41
|
+
});
|
|
42
|
+
return true;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
toast.showError(error, i18n.baseText("credentialResolverEdit.error.delete"));
|
|
45
|
+
return false;
|
|
46
|
+
} finally {
|
|
47
|
+
isDeleting.value = false;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const openCreateModal = (callbacks) => {
|
|
51
|
+
uiStore.openModalWithData({
|
|
52
|
+
name: CREDENTIAL_RESOLVER_EDIT_MODAL_KEY,
|
|
53
|
+
data: { onSave: callbacks?.onSave ?? fetchResolvers }
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const openEditModal = (resolverId, callbacks) => {
|
|
57
|
+
uiStore.openModalWithData({
|
|
58
|
+
name: CREDENTIAL_RESOLVER_EDIT_MODAL_KEY,
|
|
59
|
+
data: {
|
|
60
|
+
resolverId,
|
|
61
|
+
onSave: callbacks?.onSave ?? fetchResolvers,
|
|
62
|
+
onDelete: callbacks?.onDelete ?? fetchResolvers
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
resolvers,
|
|
68
|
+
resolverTypes,
|
|
69
|
+
isLoading,
|
|
70
|
+
isDeleting,
|
|
71
|
+
fetchResolvers,
|
|
72
|
+
fetchResolverTypes,
|
|
73
|
+
deleteResolver: confirmAndDeleteResolver,
|
|
74
|
+
openCreateModal,
|
|
75
|
+
openEditModal
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export { useCredentialResolvers as t };
|
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { C as computed, Cn as toDisplayString, D as createElementBlock, E as createCommentVNode, Gt as unref, It as ref, M as createVNode, P as defineComponent, T as createBlock, Ut as toValue, Z as onMounted, _ as Fragment, _t as watch, bn as normalizeStyle, bt as withCtx, c as useCssModule, et as openBlock, it as renderList, j as createTextVNode, mt as useTemplateRef, vn as normalizeClass, w as createBaseVNode } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
|
|
2
|
+
import { n as onClickOutside, rt as useI18n } from "./core-CRbPymLT.js";
|
|
3
|
+
import { Cn as N8nIcon_default, M as N8nNavigationDropdown_default, bn as N8nText_default, ht as N8nTooltip_default, xn as N8nButton_default } from "./src-jviYSG25.js";
|
|
4
|
+
import { t as __plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BwBpWJRZ.js";
|
|
5
|
+
import { Pt as useNodeTypesStore, Zn as useProjectsStore, _n as useCredentialsStore, aa as useUIStore, k as useTelemetry, ms as useSettingsStore } from "./builder.store-Czk2ipDE.js";
|
|
6
|
+
import { Oo as getResourcePermissions, Qr as chatHubLLMProviderSchema, Yr as PROVIDER_CREDENTIAL_TYPE_MAP } from "./constants-C8OH4tTq.js";
|
|
7
|
+
import { t as NodeIcon_default } from "./NodeIcon-B9VW6tX6.js";
|
|
8
|
+
import { t as CredentialIcon_default } from "./CredentialIcon-8YdTTFZ1.js";
|
|
9
|
+
import { i as CHAT_MODEL_BY_ID_SELECTOR_MODAL_KEY, m as providerDisplayNames, r as CHAT_CREDENTIAL_SELECTOR_MODAL_KEY } from "./constants-DMrsrpD7.js";
|
|
10
|
+
import { a as flattenModel, d as personalAgentDefaultIcon, f as stringifyModel, m as workflowAgentDefaultIcon, o as fromStringToModel, t as useChatStore, u as isLlmProviderModel } from "./chat.store-290YeyrQ.js";
|
|
11
|
+
import { t as ChatAgentAvatar_default } from "./ChatAgentAvatar-50YBnv3N.js";
|
|
12
|
+
function truncateBeforeLast(text, maxLength, lastCharsLength = 5) {
|
|
13
|
+
const chars = [];
|
|
14
|
+
const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
15
|
+
for (const { segment } of segmenter.segment(text)) chars.push(segment);
|
|
16
|
+
if (chars.length <= maxLength) return text;
|
|
17
|
+
const lastWordIndex = chars.findLastIndex((ch) => ch.match(/^\s+$/)) + 1;
|
|
18
|
+
const lastWord = chars.slice(lastWordIndex);
|
|
19
|
+
const ellipsis = "…";
|
|
20
|
+
const ellipsisLength = 1;
|
|
21
|
+
if (lastWord.length < 15) {
|
|
22
|
+
const charsToRemove = chars.length - maxLength + ellipsisLength;
|
|
23
|
+
const indexBeforeLastWord = lastWordIndex;
|
|
24
|
+
const keepLength = indexBeforeLastWord - charsToRemove;
|
|
25
|
+
if (keepLength > 0) return chars.slice(0, keepLength).join("") + ellipsis + chars.slice(indexBeforeLastWord).join("");
|
|
26
|
+
}
|
|
27
|
+
if (lastCharsLength < 1) return chars.slice(0, maxLength).join("") + ellipsis;
|
|
28
|
+
return chars.slice(0, maxLength - lastCharsLength - ellipsisLength).join("") + ellipsis + chars.slice(-lastCharsLength).join("");
|
|
29
|
+
}
|
|
30
|
+
var NEW_AGENT_MENU_ID = "agent::new";
|
|
31
|
+
var MAX_AGENT_NAME_CHARS = 30;
|
|
32
|
+
var MAX_AGENT_NAME_CHARS_MENU = 45;
|
|
33
|
+
var ModelSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
34
|
+
__name: "ModelSelector",
|
|
35
|
+
props: {
|
|
36
|
+
selectedAgent: {},
|
|
37
|
+
includeCustomAgents: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
credentials: {},
|
|
42
|
+
text: { type: Boolean },
|
|
43
|
+
warnMissingCredentials: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
agents: {},
|
|
48
|
+
isLoading: { type: Boolean }
|
|
49
|
+
},
|
|
50
|
+
emits: [
|
|
51
|
+
"change",
|
|
52
|
+
"createCustomAgent",
|
|
53
|
+
"selectCredential"
|
|
54
|
+
],
|
|
55
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
56
|
+
const emit = __emit;
|
|
57
|
+
function handleSelectCredentials(provider, id) {
|
|
58
|
+
emit("selectCredential", provider, id);
|
|
59
|
+
}
|
|
60
|
+
function handleSelectModelById(provider, modelId) {
|
|
61
|
+
emit("change", {
|
|
62
|
+
provider,
|
|
63
|
+
model: modelId
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const i18n = useI18n();
|
|
67
|
+
const dropdownRef = useTemplateRef("dropdownRef");
|
|
68
|
+
const uiStore = useUIStore();
|
|
69
|
+
const settingStore = useSettingsStore();
|
|
70
|
+
const credentialsStore = useCredentialsStore();
|
|
71
|
+
const projectStore = useProjectsStore();
|
|
72
|
+
const telemetry = useTelemetry();
|
|
73
|
+
const styles = useCssModule();
|
|
74
|
+
const credentialsName = computed(() => __props.selectedAgent ? credentialsStore.getCredentialById(__props.credentials?.[__props.selectedAgent.model.provider] ?? "")?.name : void 0);
|
|
75
|
+
const isCredentialsRequired = computed(() => isLlmProviderModel(__props.selectedAgent?.model));
|
|
76
|
+
const isCredentialsMissing = computed(() => __props.warnMissingCredentials && isCredentialsRequired.value && __props.selectedAgent?.model.provider && !__props.credentials?.[__props.selectedAgent?.model.provider]);
|
|
77
|
+
const menu = computed(() => {
|
|
78
|
+
const menuItems = [];
|
|
79
|
+
const fullNamesMap = {};
|
|
80
|
+
if (__props.includeCustomAgents) {
|
|
81
|
+
const n8nAgentsSubmenu = [];
|
|
82
|
+
if (__props.isLoading) n8nAgentsSubmenu.push({
|
|
83
|
+
id: "loading",
|
|
84
|
+
title: i18n.baseText("generic.loadingEllipsis"),
|
|
85
|
+
disabled: true
|
|
86
|
+
});
|
|
87
|
+
else if (__props.agents.n8n.models.length === 0) n8nAgentsSubmenu.push({
|
|
88
|
+
id: "no-agents",
|
|
89
|
+
title: i18n.baseText("chatHub.workflowAgents.empty.noAgents"),
|
|
90
|
+
disabled: true
|
|
91
|
+
});
|
|
92
|
+
else n8nAgentsSubmenu.push(...__props.agents.n8n.models.map((agent) => {
|
|
93
|
+
const id = stringifyModel(agent.model);
|
|
94
|
+
fullNamesMap[id] = agent.name;
|
|
95
|
+
return {
|
|
96
|
+
id,
|
|
97
|
+
icon: agent.icon ?? workflowAgentDefaultIcon,
|
|
98
|
+
iconSize: "large",
|
|
99
|
+
title: truncateBeforeLast(agent.name, MAX_AGENT_NAME_CHARS_MENU),
|
|
100
|
+
disabled: false,
|
|
101
|
+
description: agent.description ? truncateBeforeLast(agent.description, 200, 0) : void 0
|
|
102
|
+
};
|
|
103
|
+
}));
|
|
104
|
+
const customAgents = __props.isLoading ? [] : __props.agents["custom-agent"].models.map((agent) => {
|
|
105
|
+
const id = stringifyModel(agent.model);
|
|
106
|
+
fullNamesMap[id] = agent.name;
|
|
107
|
+
return {
|
|
108
|
+
id,
|
|
109
|
+
icon: agent.icon ?? personalAgentDefaultIcon,
|
|
110
|
+
iconSize: "large",
|
|
111
|
+
title: truncateBeforeLast(agent.name, MAX_AGENT_NAME_CHARS_MENU),
|
|
112
|
+
disabled: false,
|
|
113
|
+
description: agent.description ? truncateBeforeLast(agent.description, 200, 0) : void 0
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
menuItems.push({
|
|
117
|
+
id: "custom-agents",
|
|
118
|
+
title: i18n.baseText("chatHub.agent.personalAgents"),
|
|
119
|
+
icon: "message-square",
|
|
120
|
+
iconSize: "large",
|
|
121
|
+
iconMargin: false,
|
|
122
|
+
submenu: [...__props.isLoading ? [{
|
|
123
|
+
id: "loading",
|
|
124
|
+
title: i18n.baseText("generic.loadingEllipsis"),
|
|
125
|
+
disabled: true
|
|
126
|
+
}, {
|
|
127
|
+
isDivider: true,
|
|
128
|
+
id: "divider"
|
|
129
|
+
}] : customAgents.length > 0 ? [...customAgents, {
|
|
130
|
+
isDivider: true,
|
|
131
|
+
id: "divider"
|
|
132
|
+
}] : [], {
|
|
133
|
+
id: NEW_AGENT_MENU_ID,
|
|
134
|
+
icon: "plus",
|
|
135
|
+
iconSize: "large",
|
|
136
|
+
title: i18n.baseText("chatHub.agent.newAgent"),
|
|
137
|
+
disabled: false
|
|
138
|
+
}]
|
|
139
|
+
});
|
|
140
|
+
menuItems.push({
|
|
141
|
+
id: "n8n-agents",
|
|
142
|
+
title: i18n.baseText("chatHub.agent.workflowAgents"),
|
|
143
|
+
icon: "robot",
|
|
144
|
+
iconSize: "large",
|
|
145
|
+
iconMargin: false,
|
|
146
|
+
submenu: n8nAgentsSubmenu
|
|
147
|
+
});
|
|
148
|
+
menuItems.push({
|
|
149
|
+
isDivider: true,
|
|
150
|
+
id: "agents-divider"
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
for (const provider of chatHubLLMProviderSchema.options) {
|
|
154
|
+
const settings = settingStore.moduleSettings?.["chat-hub"]?.providers[provider];
|
|
155
|
+
if (settings && !settings.enabled) continue;
|
|
156
|
+
const configureMenu = {
|
|
157
|
+
id: `${provider}::configure`,
|
|
158
|
+
icon: "settings",
|
|
159
|
+
iconSize: "large",
|
|
160
|
+
title: i18n.baseText("chatHub.agent.configureCredentials"),
|
|
161
|
+
disabled: false
|
|
162
|
+
};
|
|
163
|
+
if (__props.isLoading) {
|
|
164
|
+
menuItems.push({
|
|
165
|
+
id: provider,
|
|
166
|
+
title: providerDisplayNames[provider],
|
|
167
|
+
submenu: [
|
|
168
|
+
configureMenu,
|
|
169
|
+
{
|
|
170
|
+
isDivider: true,
|
|
171
|
+
id: "divider"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: `${provider}::loading`,
|
|
175
|
+
title: i18n.baseText("generic.loadingEllipsis"),
|
|
176
|
+
disabled: true
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
});
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const theAgents = [...__props.agents[provider].models];
|
|
183
|
+
for (const model of settings?.allowedModels ?? []) if (model.isManual) theAgents.push({
|
|
184
|
+
name: model.displayName,
|
|
185
|
+
description: "",
|
|
186
|
+
icon: null,
|
|
187
|
+
model: {
|
|
188
|
+
provider,
|
|
189
|
+
model: model.model
|
|
190
|
+
},
|
|
191
|
+
createdAt: "",
|
|
192
|
+
updatedAt: null,
|
|
193
|
+
metadata: {
|
|
194
|
+
inputModalities: [
|
|
195
|
+
"text",
|
|
196
|
+
"image",
|
|
197
|
+
"audio",
|
|
198
|
+
"video",
|
|
199
|
+
"file"
|
|
200
|
+
],
|
|
201
|
+
capabilities: { functionCalling: true },
|
|
202
|
+
available: true
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
const error = __props.agents[provider].error;
|
|
206
|
+
const agentOptions = theAgents.length > 0 ? theAgents.filter((agent) => agent.model.provider === "n8n" || !settings || settings.allowedModels.length === 0 || settings.allowedModels.some((m) => "model" in agent.model && m.model === agent.model.model)).map((agent) => {
|
|
207
|
+
const id = stringifyModel(agent.model);
|
|
208
|
+
fullNamesMap[id] = agent.name;
|
|
209
|
+
return {
|
|
210
|
+
id,
|
|
211
|
+
title: truncateBeforeLast(agent.name, MAX_AGENT_NAME_CHARS_MENU),
|
|
212
|
+
disabled: false
|
|
213
|
+
};
|
|
214
|
+
}).filter((item, index, self) => self.findIndex((i) => i.id === item.id) === index) : error ? [{
|
|
215
|
+
id: `${provider}::error`,
|
|
216
|
+
value: null,
|
|
217
|
+
disabled: true,
|
|
218
|
+
title: error
|
|
219
|
+
}] : [];
|
|
220
|
+
const submenu = agentOptions.concat([...agentOptions.length > 0 ? [{
|
|
221
|
+
isDivider: true,
|
|
222
|
+
id: "divider"
|
|
223
|
+
}] : [], ...settings?.allowedModels.length === 0 ? [{
|
|
224
|
+
id: `${provider}::add-model`,
|
|
225
|
+
icon: "plus",
|
|
226
|
+
iconSize: "large",
|
|
227
|
+
title: i18n.baseText("chatHub.agent.addModel"),
|
|
228
|
+
disabled: false
|
|
229
|
+
}] : []]);
|
|
230
|
+
submenu.unshift(configureMenu, ...submenu.length > 1 ? [{
|
|
231
|
+
isDivider: true,
|
|
232
|
+
id: "divider"
|
|
233
|
+
}] : []);
|
|
234
|
+
menuItems.push({
|
|
235
|
+
id: provider,
|
|
236
|
+
title: providerDisplayNames[provider],
|
|
237
|
+
submenu
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
items: menuItems,
|
|
242
|
+
fullNames: fullNamesMap
|
|
243
|
+
};
|
|
244
|
+
});
|
|
245
|
+
const selectedLabel = computed(() => __props.selectedAgent?.name ?? i18n.baseText("chatHub.models.selector.defaultLabel"));
|
|
246
|
+
const canCreateCredentials = computed(() => {
|
|
247
|
+
return getResourcePermissions(projectStore.personalProject?.scopes).credential.create;
|
|
248
|
+
});
|
|
249
|
+
function openCredentialsSelectorOrCreate(provider) {
|
|
250
|
+
const credentialType = PROVIDER_CREDENTIAL_TYPE_MAP[provider];
|
|
251
|
+
if (credentialsStore.getCredentialsByType(credentialType).length === 0 && canCreateCredentials.value) {
|
|
252
|
+
uiStore.openNewCredential(credentialType);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
uiStore.openModalWithData({
|
|
256
|
+
name: CHAT_CREDENTIAL_SELECTOR_MODAL_KEY,
|
|
257
|
+
data: {
|
|
258
|
+
provider,
|
|
259
|
+
initialValue: __props.credentials?.[provider] ?? null,
|
|
260
|
+
onSelect: handleSelectCredentials
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function openModelByIdSelector(provider) {
|
|
265
|
+
uiStore.openModalWithData({
|
|
266
|
+
name: CHAT_MODEL_BY_ID_SELECTOR_MODAL_KEY,
|
|
267
|
+
data: {
|
|
268
|
+
provider,
|
|
269
|
+
initialValue: null,
|
|
270
|
+
onSelect: handleSelectModelById
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
function onSelect(id) {
|
|
275
|
+
if (id === NEW_AGENT_MENU_ID) {
|
|
276
|
+
emit("createCustomAgent");
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const [, identifier] = id.split("::");
|
|
280
|
+
const parsedModel = fromStringToModel(id);
|
|
281
|
+
if (!parsedModel) return;
|
|
282
|
+
if (identifier === "configure" && isLlmProviderModel(parsedModel)) {
|
|
283
|
+
openCredentialsSelectorOrCreate(parsedModel.provider);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (identifier === "add-model" && isLlmProviderModel(parsedModel)) {
|
|
287
|
+
openModelByIdSelector(parsedModel.provider);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
telemetry.track("User selected model or agent", {
|
|
291
|
+
...flattenModel(parsedModel),
|
|
292
|
+
is_custom: parsedModel.provider === "custom-agent"
|
|
293
|
+
});
|
|
294
|
+
emit("change", parsedModel);
|
|
295
|
+
}
|
|
296
|
+
onClickOutside(computed(() => dropdownRef.value?.$el), () => dropdownRef.value?.close(), { ignore: [`.${styles.component} [role=menuitem]`] });
|
|
297
|
+
__expose({
|
|
298
|
+
open: () => dropdownRef.value?.open(),
|
|
299
|
+
openCredentialSelector: (provider) => openCredentialsSelectorOrCreate(provider)
|
|
300
|
+
});
|
|
301
|
+
return (_ctx, _cache) => {
|
|
302
|
+
return openBlock(), createBlock(unref(N8nNavigationDropdown_default), {
|
|
303
|
+
ref_key: "dropdownRef",
|
|
304
|
+
ref: dropdownRef,
|
|
305
|
+
"submenu-class": _ctx.$style.component,
|
|
306
|
+
menu: menu.value.items,
|
|
307
|
+
teleport: "",
|
|
308
|
+
onSelect
|
|
309
|
+
}, {
|
|
310
|
+
"item-icon": withCtx(({ item }) => [item.id in unref(PROVIDER_CREDENTIAL_TYPE_MAP) ? (openBlock(), createBlock(CredentialIcon_default, {
|
|
311
|
+
key: 0,
|
|
312
|
+
"credential-type-name": unref(PROVIDER_CREDENTIAL_TYPE_MAP)[item.id],
|
|
313
|
+
size: 16,
|
|
314
|
+
class: normalizeClass(_ctx.$style.menuIcon)
|
|
315
|
+
}, null, 8, ["credential-type-name", "class"])) : createCommentVNode("", true)]),
|
|
316
|
+
default: withCtx(() => [createVNode(unref(N8nButton_default), {
|
|
317
|
+
class: normalizeClass(_ctx.$style.dropdownButton),
|
|
318
|
+
type: "secondary",
|
|
319
|
+
text: _ctx.text,
|
|
320
|
+
"data-test-id": "chat-model-selector"
|
|
321
|
+
}, {
|
|
322
|
+
default: withCtx(() => [
|
|
323
|
+
createVNode(ChatAgentAvatar_default, {
|
|
324
|
+
agent: _ctx.selectedAgent,
|
|
325
|
+
size: credentialsName.value || !isCredentialsRequired.value ? "md" : "sm",
|
|
326
|
+
class: normalizeClass(_ctx.$style.icon)
|
|
327
|
+
}, null, 8, [
|
|
328
|
+
"agent",
|
|
329
|
+
"size",
|
|
330
|
+
"class"
|
|
331
|
+
]),
|
|
332
|
+
createBaseVNode("div", { class: normalizeClass(_ctx.$style.selected) }, [createBaseVNode("div", null, toDisplayString(unref(truncateBeforeLast)(selectedLabel.value, MAX_AGENT_NAME_CHARS)), 1), credentialsName.value ? (openBlock(), createBlock(unref(N8nText_default), {
|
|
333
|
+
key: 0,
|
|
334
|
+
size: "xsmall",
|
|
335
|
+
color: "text-light"
|
|
336
|
+
}, {
|
|
337
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(truncateBeforeLast)(credentialsName.value, MAX_AGENT_NAME_CHARS)), 1)]),
|
|
338
|
+
_: 1
|
|
339
|
+
})) : isCredentialsMissing.value ? (openBlock(), createBlock(unref(N8nText_default), {
|
|
340
|
+
key: 1,
|
|
341
|
+
size: "xsmall",
|
|
342
|
+
color: "danger"
|
|
343
|
+
}, {
|
|
344
|
+
default: withCtx(() => [createVNode(unref(N8nIcon_default), {
|
|
345
|
+
icon: "node-validation-error",
|
|
346
|
+
size: "xsmall",
|
|
347
|
+
class: normalizeClass(_ctx.$style.credentialsMissingIcon)
|
|
348
|
+
}, null, 8, ["class"]), createTextVNode(" " + toDisplayString(unref(i18n).baseText("chatHub.agent.credentialsMissing")), 1)]),
|
|
349
|
+
_: 1
|
|
350
|
+
})) : createCommentVNode("", true)], 2),
|
|
351
|
+
createVNode(unref(N8nIcon_default), {
|
|
352
|
+
icon: "chevron-down",
|
|
353
|
+
size: "medium"
|
|
354
|
+
})
|
|
355
|
+
]),
|
|
356
|
+
_: 1
|
|
357
|
+
}, 8, ["class", "text"])]),
|
|
358
|
+
_: 1
|
|
359
|
+
}, 8, ["submenu-class", "menu"]);
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
var ModelSelector_vue_vue_type_style_index_0_lang_module_default = {
|
|
364
|
+
component: "_component_1rkhd_123",
|
|
365
|
+
dropdownButton: "_dropdownButton_1rkhd_128",
|
|
366
|
+
credentialsMissingIcon: "_credentialsMissingIcon_1rkhd_136",
|
|
367
|
+
selected: "_selected_1rkhd_141",
|
|
368
|
+
icon: "_icon_1rkhd_148",
|
|
369
|
+
menuIcon: "_menuIcon_1rkhd_153",
|
|
370
|
+
avatarIcon: "_avatarIcon_1rkhd_157"
|
|
371
|
+
};
|
|
372
|
+
var ModelSelector_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ModelSelector_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ModelSelector_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
373
|
+
var ToolsSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
374
|
+
__name: "ToolsSelector",
|
|
375
|
+
props: {
|
|
376
|
+
disabled: { type: Boolean },
|
|
377
|
+
selected: {},
|
|
378
|
+
transparentBg: {
|
|
379
|
+
type: Boolean,
|
|
380
|
+
default: false
|
|
381
|
+
},
|
|
382
|
+
disabledTooltip: {}
|
|
383
|
+
},
|
|
384
|
+
emits: ["click"],
|
|
385
|
+
setup(__props, { emit: __emit }) {
|
|
386
|
+
const emit = __emit;
|
|
387
|
+
const nodeTypesStore = useNodeTypesStore();
|
|
388
|
+
const i18n = useI18n();
|
|
389
|
+
const toolCount = computed(() => __props.selected.length ?? 0);
|
|
390
|
+
const displayToolNodeTypes = computed(() => {
|
|
391
|
+
return __props.selected.slice(0, 3).map((t) => nodeTypesStore.getNodeType(t.type)).filter(Boolean);
|
|
392
|
+
});
|
|
393
|
+
const toolsLabel = computed(() => {
|
|
394
|
+
if (toolCount.value > 0) return i18n.baseText("chatHub.tools.selector.label.count", { adjustToNumber: toolCount.value });
|
|
395
|
+
return i18n.baseText("chatHub.tools.selector.label.default");
|
|
396
|
+
});
|
|
397
|
+
onMounted(async () => {
|
|
398
|
+
await nodeTypesStore.loadNodeTypesIfNotLoaded();
|
|
399
|
+
});
|
|
400
|
+
return (_ctx, _cache) => {
|
|
401
|
+
return openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
402
|
+
content: _ctx.disabledTooltip,
|
|
403
|
+
disabled: !_ctx.disabledTooltip,
|
|
404
|
+
placement: "top"
|
|
405
|
+
}, {
|
|
406
|
+
default: withCtx(() => [createVNode(unref(N8nButton_default), {
|
|
407
|
+
type: "secondary",
|
|
408
|
+
"native-type": "button",
|
|
409
|
+
class: normalizeClass([_ctx.$style.toolsButton, { [_ctx.$style.transparentBg]: _ctx.transparentBg }]),
|
|
410
|
+
disabled: _ctx.disabled,
|
|
411
|
+
icon: toolCount.value > 0 ? void 0 : "plus",
|
|
412
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event))
|
|
413
|
+
}, {
|
|
414
|
+
default: withCtx(() => [toolCount.value ? (openBlock(), createElementBlock("span", {
|
|
415
|
+
key: 0,
|
|
416
|
+
class: normalizeClass(_ctx.$style.iconStack)
|
|
417
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(displayToolNodeTypes.value, (nodeType, i) => {
|
|
418
|
+
return openBlock(), createBlock(NodeIcon_default, {
|
|
419
|
+
key: `${nodeType?.name}-${i}`,
|
|
420
|
+
style: normalizeStyle({ zIndex: displayToolNodeTypes.value.length - i }),
|
|
421
|
+
"node-type": nodeType,
|
|
422
|
+
class: normalizeClass([_ctx.$style.icon, { [_ctx.$style.iconOverlap]: i !== 0 }]),
|
|
423
|
+
circle: true,
|
|
424
|
+
size: 12
|
|
425
|
+
}, null, 8, [
|
|
426
|
+
"style",
|
|
427
|
+
"node-type",
|
|
428
|
+
"class"
|
|
429
|
+
]);
|
|
430
|
+
}), 128))], 2)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(toolsLabel.value), 1)]),
|
|
431
|
+
_: 1
|
|
432
|
+
}, 8, [
|
|
433
|
+
"class",
|
|
434
|
+
"disabled",
|
|
435
|
+
"icon"
|
|
436
|
+
])]),
|
|
437
|
+
_: 1
|
|
438
|
+
}, 8, ["content", "disabled"]);
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
var ToolsSelector_vue_vue_type_style_index_0_lang_module_default = {
|
|
443
|
+
toolsButton: "_toolsButton_1u99p_123",
|
|
444
|
+
transparentBg: "_transparentBg_1u99p_128",
|
|
445
|
+
iconStack: "_iconStack_1u99p_132",
|
|
446
|
+
icon: "_icon_1u99p_132",
|
|
447
|
+
iconOverlap: "_iconOverlap_1u99p_145"
|
|
448
|
+
};
|
|
449
|
+
var ToolsSelector_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ToolsSelector_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ToolsSelector_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
450
|
+
function useCustomAgent(agentId) {
|
|
451
|
+
const store = useChatStore();
|
|
452
|
+
const isLoading = ref(false);
|
|
453
|
+
const id = computed(() => toValue(agentId));
|
|
454
|
+
const customAgent = computed(() => {
|
|
455
|
+
if (!id.value) return;
|
|
456
|
+
return store.customAgents[id.value];
|
|
457
|
+
});
|
|
458
|
+
watch(id, async (theId) => {
|
|
459
|
+
if (theId) try {
|
|
460
|
+
isLoading.value = true;
|
|
461
|
+
await store.fetchCustomAgent(theId);
|
|
462
|
+
} finally {
|
|
463
|
+
isLoading.value = false;
|
|
464
|
+
}
|
|
465
|
+
}, { immediate: true });
|
|
466
|
+
return {
|
|
467
|
+
isLoading,
|
|
468
|
+
customAgent
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
export { ToolsSelector_default as n, ModelSelector_default as r, useCustomAgent as t };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { o as __toESM, t as __commonJSMin } from "./chunk-6z4oVpB-.js";
|
|
2
|
+
import { It as ref } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
|
|
3
|
+
import { l as require_isSymbol } from "./get-BcEmeOxn.js";
|
|
4
|
+
import { c as require_isObject, f as require__root } from "./_MapCache-CcdIl4Ae.js";
|
|
5
|
+
var require__trimmedEndIndex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
|
+
var reWhitespace = /\s/;
|
|
7
|
+
function trimmedEndIndex$1(string) {
|
|
8
|
+
var index = string.length;
|
|
9
|
+
while (index-- && reWhitespace.test(string.charAt(index)));
|
|
10
|
+
return index;
|
|
11
|
+
}
|
|
12
|
+
module.exports = trimmedEndIndex$1;
|
|
13
|
+
}));
|
|
14
|
+
var require__baseTrim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
15
|
+
var trimmedEndIndex = require__trimmedEndIndex();
|
|
16
|
+
var reTrimStart = /^\s+/;
|
|
17
|
+
function baseTrim$1(string) {
|
|
18
|
+
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
19
|
+
}
|
|
20
|
+
module.exports = baseTrim$1;
|
|
21
|
+
}));
|
|
22
|
+
var require_toNumber = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
23
|
+
var baseTrim = require__baseTrim(), isObject$1 = require_isObject(), isSymbol = require_isSymbol();
|
|
24
|
+
var NAN = NaN;
|
|
25
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
26
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
27
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
28
|
+
var freeParseInt = parseInt;
|
|
29
|
+
function toNumber$1(value) {
|
|
30
|
+
if (typeof value == "number") return value;
|
|
31
|
+
if (isSymbol(value)) return NAN;
|
|
32
|
+
if (isObject$1(value)) {
|
|
33
|
+
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
34
|
+
value = isObject$1(other) ? other + "" : other;
|
|
35
|
+
}
|
|
36
|
+
if (typeof value != "string") return value === 0 ? value : +value;
|
|
37
|
+
value = baseTrim(value);
|
|
38
|
+
var isBinary = reIsBinary.test(value);
|
|
39
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
40
|
+
}
|
|
41
|
+
module.exports = toNumber$1;
|
|
42
|
+
}));
|
|
43
|
+
var require_now = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
44
|
+
var root = require__root();
|
|
45
|
+
var now$1 = function() {
|
|
46
|
+
return root.Date.now();
|
|
47
|
+
};
|
|
48
|
+
module.exports = now$1;
|
|
49
|
+
}));
|
|
50
|
+
var require_debounce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
51
|
+
var isObject = require_isObject(), now = require_now(), toNumber = require_toNumber();
|
|
52
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
53
|
+
var nativeMax = Math.max, nativeMin = Math.min;
|
|
54
|
+
function debounce(func, wait, options) {
|
|
55
|
+
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
56
|
+
if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
|
|
57
|
+
wait = toNumber(wait) || 0;
|
|
58
|
+
if (isObject(options)) {
|
|
59
|
+
leading = !!options.leading;
|
|
60
|
+
maxing = "maxWait" in options;
|
|
61
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
62
|
+
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
63
|
+
}
|
|
64
|
+
function invokeFunc(time) {
|
|
65
|
+
var args = lastArgs, thisArg = lastThis;
|
|
66
|
+
lastArgs = lastThis = void 0;
|
|
67
|
+
lastInvokeTime = time;
|
|
68
|
+
result = func.apply(thisArg, args);
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
function leadingEdge(time) {
|
|
72
|
+
lastInvokeTime = time;
|
|
73
|
+
timerId = setTimeout(timerExpired, wait);
|
|
74
|
+
return leading ? invokeFunc(time) : result;
|
|
75
|
+
}
|
|
76
|
+
function remainingWait(time) {
|
|
77
|
+
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
78
|
+
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
79
|
+
}
|
|
80
|
+
function shouldInvoke(time) {
|
|
81
|
+
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
82
|
+
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
83
|
+
}
|
|
84
|
+
function timerExpired() {
|
|
85
|
+
var time = now();
|
|
86
|
+
if (shouldInvoke(time)) return trailingEdge(time);
|
|
87
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
88
|
+
}
|
|
89
|
+
function trailingEdge(time) {
|
|
90
|
+
timerId = void 0;
|
|
91
|
+
if (trailing && lastArgs) return invokeFunc(time);
|
|
92
|
+
lastArgs = lastThis = void 0;
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
function cancel() {
|
|
96
|
+
if (timerId !== void 0) clearTimeout(timerId);
|
|
97
|
+
lastInvokeTime = 0;
|
|
98
|
+
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
99
|
+
}
|
|
100
|
+
function flush() {
|
|
101
|
+
return timerId === void 0 ? result : trailingEdge(now());
|
|
102
|
+
}
|
|
103
|
+
function debounced() {
|
|
104
|
+
var time = now(), isInvoking = shouldInvoke(time);
|
|
105
|
+
lastArgs = arguments;
|
|
106
|
+
lastThis = this;
|
|
107
|
+
lastCallTime = time;
|
|
108
|
+
if (isInvoking) {
|
|
109
|
+
if (timerId === void 0) return leadingEdge(lastCallTime);
|
|
110
|
+
if (maxing) {
|
|
111
|
+
clearTimeout(timerId);
|
|
112
|
+
timerId = setTimeout(timerExpired, wait);
|
|
113
|
+
return invokeFunc(lastCallTime);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
debounced.cancel = cancel;
|
|
120
|
+
debounced.flush = flush;
|
|
121
|
+
return debounced;
|
|
122
|
+
}
|
|
123
|
+
module.exports = debounce;
|
|
124
|
+
}));
|
|
125
|
+
var import_debounce = /* @__PURE__ */ __toESM(require_debounce());
|
|
126
|
+
function useDebounce() {
|
|
127
|
+
const debounceCache = ref(/* @__PURE__ */ new WeakMap());
|
|
128
|
+
const debounce$1 = (fn, options) => {
|
|
129
|
+
const { trailing, debounceTime } = options;
|
|
130
|
+
let debouncedFn = debounceCache.value.get(fn);
|
|
131
|
+
if (debouncedFn === void 0) {
|
|
132
|
+
debouncedFn = (0, import_debounce.default)(async (...args) => {
|
|
133
|
+
return fn(...args);
|
|
134
|
+
}, debounceTime, trailing ? { trailing } : { leading: true });
|
|
135
|
+
debounceCache.value.set(fn, debouncedFn);
|
|
136
|
+
}
|
|
137
|
+
return debouncedFn;
|
|
138
|
+
};
|
|
139
|
+
const callDebounced = (fn, options, ...inputParameters) => {
|
|
140
|
+
return debounce$1(fn, options)(...inputParameters);
|
|
141
|
+
};
|
|
142
|
+
return {
|
|
143
|
+
debounce: debounce$1,
|
|
144
|
+
callDebounced
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export { require_debounce as n, require_toNumber as r, useDebounce as t };
|