feat(trigger): plugin category type

This commit is contained in:
yessenia
2025-10-16 15:03:14 +08:00
parent 671aba6ab7
commit b04f92715c
18 changed files with 104 additions and 136 deletions

View File

@ -5,7 +5,7 @@ import { useInvalidateInstalledPluginList } from '@/service/use-plugins'
import { useInvalidateAllBuiltInTools, useInvalidateAllToolProviders } from '@/service/use-tools'
import { useInvalidateStrategyProviders } from '@/service/use-strategy'
import type { Plugin, PluginDeclaration, PluginManifestInMarket } from '../../types'
import { PluginType } from '../../types'
import { PluginCategoryEnum } from '../../types'
import { useInvalidDataSourceList } from '@/service/use-pipeline'
import { useInvalidDataSourceListAuth } from '@/service/use-datasource'
@ -29,19 +29,19 @@ const useRefreshPluginList = () => {
invalidateInstalledPluginList()
// tool page, tool select
if ((manifest && PluginType.tool.includes(manifest.category)) || refreshAllType) {
if ((manifest && PluginCategoryEnum.tool.includes(manifest.category)) || refreshAllType) {
invalidateAllToolProviders()
invalidateAllBuiltInTools()
// TODO: update suggested tools. It's a function in hook useMarketplacePlugins,handleUpdatePlugins
}
if ((manifest && PluginType.datasource.includes(manifest.category)) || refreshAllType) {
if ((manifest && PluginCategoryEnum.datasource.includes(manifest.category)) || refreshAllType) {
invalidateAllDataSources()
invalidateDataSourceListAuth()
}
// model select
if ((manifest && PluginType.model.includes(manifest.category)) || refreshAllType) {
if ((manifest && PluginCategoryEnum.model.includes(manifest.category)) || refreshAllType) {
refreshModelProviders()
refetchLLMModelList()
refetchEmbeddingModelList()
@ -49,7 +49,7 @@ const useRefreshPluginList = () => {
}
// agent select
if ((manifest && PluginType.agent.includes(manifest.category)) || refreshAllType)
if ((manifest && PluginCategoryEnum.agent.includes(manifest.category)) || refreshAllType)
invalidateStrategyProviders()
},
}