From f03631ff9eeb30f3df49ddff1b27bcd048972aa5 Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Tue, 7 Jan 2025 15:08:36 +0800 Subject: [PATCH] feat: init agent strategy install from marketplace --- .../market-place-plugin/list.tsx | 6 ++- .../components/agent-strategy-selector.tsx | 47 +++++++++++++------ 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/web/app/components/workflow/block-selector/market-place-plugin/list.tsx b/web/app/components/workflow/block-selector/market-place-plugin/list.tsx index 596b6f21c5..ace5443bd5 100644 --- a/web/app/components/workflow/block-selector/market-place-plugin/list.tsx +++ b/web/app/components/workflow/block-selector/market-place-plugin/list.tsx @@ -15,6 +15,7 @@ type Props = { list: Plugin[] searchText: string tags: string[] + disableMaxWidth?: boolean } const List = ({ @@ -22,6 +23,7 @@ const List = ({ searchText, tags, list, + disableMaxWidth = false, }: Props, ref: any) => { const { t } = useTranslation() const hasFilter = !searchText @@ -95,7 +97,7 @@ const List = ({ )} -
+
{list.map((item, index) => ( { }} /> ))} -
+
)?.icon as string | undefined const { t } = useTranslation() + const wrapElemRef = useRef(null) + + const { + queryPluginsWithDebounced: fetchPlugins, + plugins: notInstalledPlugins = [], + } = useMarketplacePlugins() + + useEffect(() => { + if (query) { + fetchPlugins({ + query, + category: PluginType.agent, + }) + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [query]) + + const pluginRef = useRef(null) + return
-
+
plugin_unique_identifier: tool!.provider_id, }) setOpen(false) - }} - hasSearchText={false} - showWorkflowEmpty={false} + } } className='max-w-none max-h-full h-full overflow-y-auto' - indexBarClassName='top-0 xl:top-36' + indexBarClassName='top-0 xl:top-36' showWorkflowEmpty={false} hasSearchText={false} /> + -
- - {t('plugin.findMoreInMarketplace')} - -