V4.9.6 feature (#4565)
* Dashboard submenu (#4545) * add app submenu (#4452) * add app submenu * fix * width & i18n * optimize submenu code (#4515) * optimize submenu code * fix * fix * fix * fix ts * perf: dashboard sub menu * doc --------- Co-authored-by: heheer <heheer@sealos.io> * feat: value format test * doc * Mcp export (#4555) * feat: mcp server * feat: mcp server * feat: mcp server build * update doc * perf: path selector (#4556) * perf: path selector * fix: docker file path * perf: add image endpoint to dataset search (#4557) * perf: add image endpoint to dataset search * fix: mcp_server url * human in loop (#4558) * Support interactive nodes for loops, and enhance the function of merging nested and loop node history messages. (#4552) * feat: add LoopInteractive definition * feat: Support LoopInteractive type and update related logic * fix: Refactor loop handling logic and improve output value initialization * feat: Add mergeSignId to dispatchLoop and dispatchRunAppNode responses * feat: Enhance mergeChatResponseData to recursively merge plugin details and improve response handling * refactor: Remove redundant comments in mergeChatResponseData for clarity * perf: loop interactive * perf: human in loop --------- Co-authored-by: Theresa <63280168+sd0ric4@users.noreply.github.com> * mcp server ui * integrate mcp (#4549) * integrate mcp * delete unused code * fix ts * bug fix * fix * support whole mcp tools * add try catch * fix * fix * fix ts * fix test * fix ts * fix: interactive in v1 completions * doc * fix: router path * fix mcp integrate (#4563) * fix mcp integrate * fix ui * fix: mcp ux * feat: mcp call title * remove repeat loading * fix mcp tools avatar (#4564) * fix * fix avatar * fix update version * update doc * fix: value format * close server and remove cache * perf: avatar --------- Co-authored-by: heheer <heheer@sealos.io> Co-authored-by: Theresa <63280168+sd0ric4@users.noreply.github.com>
This commit is contained in:
@@ -77,7 +77,7 @@ export const useSystemStore = create<State>()(
|
||||
state.initd = true;
|
||||
});
|
||||
},
|
||||
lastRoute: '/app/list',
|
||||
lastRoute: '/dashboard/apps',
|
||||
setLastRoute(e) {
|
||||
set((state) => {
|
||||
state.lastRoute = e;
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { CreateAppBody } from '@/pages/api/core/app/create';
|
||||
import type { ListAppBody } from '@/pages/api/core/app/list';
|
||||
import type { AppLogsListItemType } from '@/types/app';
|
||||
import type { PaginationResponse } from '@fastgpt/web/common/fetch/type';
|
||||
import type { getBasicInfoResponse } from '@/pages/api/core/app/getBasicInfo';
|
||||
|
||||
/**
|
||||
* 获取应用列表
|
||||
@@ -37,6 +38,12 @@ export const getAppDetailById = (id: string) => GET<AppDetailType>(`/core/app/de
|
||||
export const putAppById = (id: string, data: AppUpdateParams) =>
|
||||
PUT(`/core/app/update?appId=${id}`, data);
|
||||
|
||||
/**
|
||||
* Get app basic info by ids
|
||||
*/
|
||||
export const getAppBasicInfoByIds = (ids: string[]) =>
|
||||
POST<getBasicInfoResponse>(`/core/app/getBasicInfo`, { ids });
|
||||
|
||||
// =================== chat logs
|
||||
export const getAppChatLogs = (data: GetAppChatLogsParams) =>
|
||||
POST<PaginationResponse<AppLogsListItemType>>(`/core/app/getChatLogs`, data, { maxQuantity: 1 });
|
||||
|
||||
@@ -13,13 +13,17 @@ import type { GetPreviewNodeQuery } from '@/pages/api/core/app/plugin/getPreview
|
||||
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
||||
import type {
|
||||
GetPathProps,
|
||||
ParentIdType,
|
||||
ParentTreePathItemType
|
||||
} from '@fastgpt/global/common/parentFolder/type';
|
||||
import type { GetSystemPluginTemplatesBody } from '@/pages/api/core/app/plugin/getSystemPluginTemplates';
|
||||
import type { PluginGroupSchemaType } from '@fastgpt/service/core/app/plugin/type';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { defaultGroup } from '@fastgpt/web/core/workflow/constants';
|
||||
import { createMCPToolsBody } from '@/pages/api/core/app/mcpTools/create';
|
||||
import { ToolType } from '@fastgpt/global/core/app/type';
|
||||
import { getMCPToolsBody } from '@/pages/api/core/app/mcpTools/getMCPTools';
|
||||
import { RunToolTestBody } from '@/pages/api/core/app/mcpTools/runTest';
|
||||
import { updateMCPToolsBody } from '@/pages/api/core/app/mcpTools/update';
|
||||
|
||||
/* ============ team plugin ============== */
|
||||
export const getTeamPlugTemplates = (data?: ListAppBody) =>
|
||||
@@ -28,12 +32,17 @@ export const getTeamPlugTemplates = (data?: ListAppBody) =>
|
||||
tmbId: app.tmbId,
|
||||
id: app._id,
|
||||
pluginId: app._id,
|
||||
isFolder: app.type === AppTypeEnum.folder || app.type === AppTypeEnum.httpPlugin,
|
||||
isFolder:
|
||||
app.type === AppTypeEnum.folder ||
|
||||
app.type === AppTypeEnum.httpPlugin ||
|
||||
app.type === AppTypeEnum.toolSet,
|
||||
templateType: FlowNodeTemplateTypeEnum.teamApp,
|
||||
flowNodeType:
|
||||
app.type === AppTypeEnum.workflow
|
||||
? FlowNodeTypeEnum.appModule
|
||||
: FlowNodeTypeEnum.pluginModule,
|
||||
: app.type === AppTypeEnum.toolSet
|
||||
? FlowNodeTypeEnum.toolSet
|
||||
: FlowNodeTypeEnum.pluginModule,
|
||||
avatar: app.avatar,
|
||||
name: app.name,
|
||||
intro: app.intro,
|
||||
@@ -62,6 +71,18 @@ export const getSystemPluginPaths = (data: GetPathProps) => {
|
||||
export const getPreviewPluginNode = (data: GetPreviewNodeQuery) =>
|
||||
GET<FlowNodeTemplateType>('/core/app/plugin/getPreviewNode', data);
|
||||
|
||||
/* ============ mcp tools ============== */
|
||||
export const getMCPTools = (data: getMCPToolsBody) =>
|
||||
POST<ToolType[]>('/core/app/mcpTools/getMCPTools', data);
|
||||
|
||||
export const postCreateMCPTools = (data: createMCPToolsBody) =>
|
||||
POST('/core/app/mcpTools/create', data);
|
||||
|
||||
export const postUpdateMCPTools = (data: updateMCPToolsBody) =>
|
||||
POST('/core/app/mcpTools/update', data);
|
||||
|
||||
export const postRunMCPTools = (data: RunToolTestBody) => POST('/core/app/mcpTools/runTest', data);
|
||||
|
||||
/* ============ http plugin ============== */
|
||||
export const postCreateHttpPlugin = (data: createHttpPluginBody) =>
|
||||
POST('/core/app/httpPlugin/create', data);
|
||||
|
||||
20
projects/app/src/web/support/mcp/api.ts
Normal file
20
projects/app/src/web/support/mcp/api.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { updateBody } from '@/pages/api/support/mcp/update';
|
||||
import { GET, POST, DELETE, PUT } from '../../common/api/request';
|
||||
import type { createBody } from '@/pages/api/support/mcp/create';
|
||||
import type { listResponse } from '@/pages/api/support/mcp/list';
|
||||
|
||||
export const getMcpServerList = () => {
|
||||
return GET<listResponse>('/support/mcp/list');
|
||||
};
|
||||
|
||||
export const postCreateMcpServer = (data: createBody) => {
|
||||
return POST('/support/mcp/create', data);
|
||||
};
|
||||
|
||||
export const putUpdateMcpServer = (data: updateBody) => {
|
||||
return PUT('/support/mcp/update', data);
|
||||
};
|
||||
|
||||
export const deleteMcpServer = (id: string) => {
|
||||
return DELETE(`/support/mcp/delete`, { id });
|
||||
};
|
||||
Reference in New Issue
Block a user