{t('app.newApp.appCreateDSLErrorTitle')}
-
+
{t('app.newApp.appCreateDSLErrorPart1')}
{t('app.newApp.appCreateDSLErrorPart2')}
@@ -283,6 +289,7 @@ const UpdateDSLModal = ({
{t('app.newApp.appCreateDSLErrorPart4')}{versions?.systemVersion}
+
diff --git a/web/models/app.ts b/web/models/app.ts
index acb1c09622..81a8575dd8 100644
--- a/web/models/app.ts
+++ b/web/models/app.ts
@@ -1,5 +1,6 @@
import type { LangFuseConfig, LangSmithConfig, TracingProvider } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
import type { App, AppSSO, AppTemplate, SiteConfig } from '@/types/app'
+import type { Dependency } from '@/app/components/plugins/types'
/* export type App = {
id: string
@@ -87,6 +88,7 @@ export type DSLImportResponse = {
current_dsl_version?: string
imported_dsl_version?: string
error: string
+ leaked_dependencies: Dependency[]
}
export type AppSSOResponse = { enabled: AppSSO['enable_sso'] }
diff --git a/web/service/plugins.ts b/web/service/plugins.ts
index 28bf6c44f4..2857948860 100644
--- a/web/service/plugins.ts
+++ b/web/service/plugins.ts
@@ -1,6 +1,7 @@
import type { Fetcher } from 'swr'
import { get, getMarketplace, post, upload } from './base'
import type {
+ Dependency,
InstallPackageResponse,
Permissions,
PluginDeclaration,
@@ -63,7 +64,15 @@ export const fetchManifest = async (uniqueIdentifier: string) => {
}
export const fetchManifestFromMarketPlace = async (uniqueIdentifier: string) => {
- return getMarketplace<{ data: { plugin: PluginManifestInMarket } }>(`/plugins/identifier?unique_identifier=${uniqueIdentifier}`)
+ return getMarketplace<{ data: { plugin: PluginManifestInMarket, version: { version: string } } }>(`/plugins/identifier?unique_identifier=${uniqueIdentifier}`)
+}
+
+export const fetchBundleInfoFromMarketPlace = async ({
+ org,
+ name,
+ version,
+}: Record) => {
+ return getMarketplace<{ data: { version: { dependencies: Dependency[] } } }>(`/bundles/${org}/${name}/${version}`)
}
export const fetchMarketplaceCollections: Fetcher = ({ url }) => {
diff --git a/web/service/use-plugins.ts b/web/service/use-plugins.ts
index 08469023d6..9bdf63c5c5 100644
--- a/web/service/use-plugins.ts
+++ b/web/service/use-plugins.ts
@@ -24,16 +24,17 @@ import {
useQuery,
useQueryClient,
} from '@tanstack/react-query'
-import { useStore as usePluginDependencyStore } from '@/app/components/workflow/plugin-dependency/store'
import { useInvalidateAllBuiltInTools } from './use-tools'
const NAME_SPACE = 'plugins'
const useInstalledPluginListKey = [NAME_SPACE, 'installedPluginList']
-export const useInstalledPluginList = () => {
+export const useInstalledPluginList = (disable?: boolean) => {
return useQuery({
queryKey: useInstalledPluginListKey,
queryFn: () => get('/workspaces/current/plugin/list'),
+ enabled: !disable,
+ initialData: !disable ? undefined : { plugins: [] },
})
}
@@ -110,6 +111,7 @@ export const useUploadGitHub = (payload: {
queryFn: () => post('/workspaces/current/plugin/upload/github', {
body: payload,
}),
+ retry: 0,
})
}
@@ -225,6 +227,7 @@ export const useMutationPluginsFromMarketplace = () => {
sortOrder,
category,
tags,
+ exclude,
} = pluginsSearchParams
return postMarketplace<{ data: PluginsFromMarketplaceResponse }>('/plugins/search/basic', {
body: {
@@ -235,6 +238,7 @@ export const useMutationPluginsFromMarketplace = () => {
sort_order: sortOrder,
category: category !== 'all' ? category : '',
tags,
+ exclude,
},
})
},
@@ -323,36 +327,6 @@ export const useMutationClearAllTaskPlugin = () => {
})
}
-export const useMutationCheckDependenciesBeforeImportDSL = () => {
- const mutation = useMutation({
- mutationFn: ({ dslString, url }: { dslString?: string, url?: string }) => {
- if (url) {
- return post<{ leaked: Dependency[] }>(
- '/apps/import/url/dependencies/check',
- {
- body: {
- url,
- },
- },
- )
- }
- return post<{ leaked: Dependency[] }>(
- '/apps/import/dependencies/check',
- {
- body: {
- data: dslString,
- },
- })
- },
- onSuccess: (data) => {
- const { setDependencies } = usePluginDependencyStore.getState()
- setDependencies(data.leaked || [])
- },
- })
-
- return mutation
-}
-
export const useDownloadPlugin = (info: { organization: string; pluginName: string; version: string }, needDownload: boolean) => {
return useQuery({
queryKey: [NAME_SPACE, 'downloadPlugin', info],