Skip to content

Commit 952412f

Browse files
c121914yunewfish-cmyksd0ric4
authored
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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> Co-authored-by: Theresa <[email protected]>
1 parent ab799e1 commit 952412f

File tree

166 files changed

+6318
-1263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+6318
-1263
lines changed

.github/workflows/fastgpt-preview-image.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,32 @@ jobs:
1313
pull-requests: write
1414

1515
runs-on: ubuntu-24.04
16+
strategy:
17+
matrix:
18+
image: [fastgpt, sandbox, mcp_server]
19+
fail-fast: false # 即使一个镜像构建失败,也继续构建其他镜像
20+
1621
steps:
1722
- name: Checkout
1823
uses: actions/checkout@v3
1924
with:
2025
ref: ${{ github.event.pull_request.head.ref }}
2126
repository: ${{ github.event.pull_request.head.repo.full_name }}
22-
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
27+
fetch-depth: 0
2328
token: ${{ secrets.GITHUB_TOKEN }}
2429

2530
- name: Set up Docker Buildx
2631
uses: docker/setup-buildx-action@v2
2732
with:
2833
driver-opts: network=host
34+
2935
- name: Cache Docker layers
3036
uses: actions/cache@v3
3137
with:
3238
path: /tmp/.buildx-cache
33-
key: ${{ runner.os }}-buildx-${{ github.sha }}
39+
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.image }}
3440
restore-keys: |
41+
${{ runner.os }}-buildx-${{ github.sha }}-
3542
${{ runner.os }}-buildx-
3643
3744
- name: Login to GitHub Container Registry
@@ -41,24 +48,35 @@ jobs:
4148
username: ${{ github.repository_owner }}
4249
password: ${{ secrets.GITHUB_TOKEN }}
4350

44-
- name: Set DOCKER_REPO_TAGGED based on branch or tag
51+
- name: Set image config
52+
id: config
4553
run: |
46-
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
54+
if [[ "${{ matrix.image }}" == "fastgpt" ]]; then
55+
echo "DOCKERFILE=projects/app/Dockerfile" >> $GITHUB_OUTPUT
56+
echo "DESCRIPTION=fastgpt-pr image" >> $GITHUB_OUTPUT
57+
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:fatsgpt_${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
58+
elif [[ "${{ matrix.image }}" == "sandbox" ]]; then
59+
echo "DOCKERFILE=projects/sandbox/Dockerfile" >> $GITHUB_OUTPUT
60+
echo "DESCRIPTION=fastgpt-sandbox-pr image" >> $GITHUB_OUTPUT
61+
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:fatsgpt_sandbox_${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
62+
elif [[ "${{ matrix.image }}" == "mcp_server" ]]; then
63+
echo "DOCKERFILE=projects/mcp_server/Dockerfile" >> $GITHUB_OUTPUT
64+
echo "DESCRIPTION=fastgpt-mcp_server-pr image" >> $GITHUB_OUTPUT
65+
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:fatsgpt_mcp_server_${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
66+
fi
4767
48-
- name: Build image for PR
49-
env:
50-
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
68+
- name: Build ${{ matrix.image }} image for PR
5169
run: |
5270
docker buildx build \
53-
-f projects/app/Dockerfile \
71+
-f ${{ steps.config.outputs.DOCKERFILE }} \
5472
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
55-
--label "org.opencontainers.image.description=fastgpt-pr image" \
56-
--label "org.opencontainers.image.licenses=Apache" \
73+
--label "org.opencontainers.image.description=${{ steps.config.outputs.DESCRIPTION }}" \
5774
--push \
5875
--cache-from=type=local,src=/tmp/.buildx-cache \
5976
--cache-to=type=local,dest=/tmp/.buildx-cache \
60-
-t ${DOCKER_REPO_TAGGED} \
77+
-t ${{ steps.config.outputs.DOCKER_REPO_TAGGED }} \
6178
.
79+
6280
- uses: actions/github-script@v7
6381
with:
6482
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -67,5 +85,5 @@ jobs:
6785
issue_number: context.issue.number,
6886
owner: context.repo.owner,
6987
repo: context.repo.repo,
70-
body: 'Preview Image: `${{ env.DOCKER_REPO_TAGGED }}`'
88+
body: 'Preview ${{ matrix.image }} Image: `${{ steps.config.outputs.DOCKER_REPO_TAGGED }}`'
7189
})
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Build fastgpt-mcp-server images
2+
on:
3+
workflow_dispatch:
4+
push:
5+
paths:
6+
- 'projects/sandbox/**'
7+
tags:
8+
- 'v*'
9+
jobs:
10+
build-fastgpt-mcp_server-images:
11+
permissions:
12+
packages: write
13+
contents: read
14+
attestations: write
15+
id-token: write
16+
strategy:
17+
matrix:
18+
include:
19+
- arch: amd64
20+
- arch: arm64
21+
runs-on: ubuntu-24.04-arm
22+
runs-on: ${{ matrix.runs-on || 'ubuntu-24.04' }}
23+
steps:
24+
# install env
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
with:
32+
driver-opts: network=host
33+
- name: Cache Docker layers
34+
uses: actions/cache@v4
35+
with:
36+
path: /tmp/.buildx-cache
37+
key: ${{ runner.os }}-mcp-server-buildx-${{ github.sha }}
38+
restore-keys: |
39+
${{ runner.os }}-mcp_server-buildx-
40+
41+
# login docker
42+
- name: Login to GitHub Container Registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.repository_owner }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
- name: Login to Ali Hub
49+
uses: docker/login-action@v3
50+
with:
51+
registry: registry.cn-hangzhou.aliyuncs.com
52+
username: ${{ secrets.ALI_HUB_USERNAME }}
53+
password: ${{ secrets.ALI_HUB_PASSWORD }}
54+
- name: Login to Docker Hub
55+
uses: docker/login-action@v3
56+
with:
57+
username: ${{ secrets.DOCKER_HUB_NAME }}
58+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
59+
60+
- name: Build for ${{ matrix.arch }}
61+
id: build
62+
uses: docker/build-push-action@v6
63+
with:
64+
context: .
65+
file: projects/mcp_server/Dockerfile
66+
platforms: linux/${{ matrix.arch }}
67+
labels: |
68+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
69+
org.opencontainers.image.description=fastgpt-mcp_server image
70+
outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/fastgpt-mcp_server,${{ secrets.ALI_IMAGE_NAME }}/fastgpt-mcp_server,${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-mcp_server",push-by-digest=true,push=true
71+
cache-from: type=local,src=/tmp/.buildx-cache
72+
cache-to: type=local,dest=/tmp/.buildx-cache
73+
74+
- name: Export digest
75+
run: |
76+
mkdir -p ${{ runner.temp }}/digests
77+
digest="${{ steps.build.outputs.digest }}"
78+
touch "${{ runner.temp }}/digests/${digest#sha256:}"
79+
80+
- name: Upload digest
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: digests-fastgpt-mcp_server-${{ github.sha }}-${{ matrix.arch }}
84+
path: ${{ runner.temp }}/digests/*
85+
if-no-files-found: error
86+
retention-days: 1
87+
88+
release-fastgpt-mcp_server-images:
89+
permissions:
90+
packages: write
91+
contents: read
92+
attestations: write
93+
id-token: write
94+
needs: build-fastgpt-mcp_server-images
95+
runs-on: ubuntu-24.04
96+
steps:
97+
- name: Login to GitHub Container Registry
98+
uses: docker/login-action@v3
99+
with:
100+
registry: ghcr.io
101+
username: ${{ github.repository_owner }}
102+
password: ${{ secrets.GITHUB_TOKEN }}
103+
- name: Login to Ali Hub
104+
uses: docker/login-action@v3
105+
with:
106+
registry: registry.cn-hangzhou.aliyuncs.com
107+
username: ${{ secrets.ALI_HUB_USERNAME }}
108+
password: ${{ secrets.ALI_HUB_PASSWORD }}
109+
- name: Login to Docker Hub
110+
uses: docker/login-action@v3
111+
with:
112+
username: ${{ secrets.DOCKER_HUB_NAME }}
113+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
114+
115+
- name: Download digests
116+
uses: actions/download-artifact@v4
117+
with:
118+
path: ${{ runner.temp }}/digests
119+
pattern: digests-fastgpt-mcp_server-${{ github.sha }}-*
120+
merge-multiple: true
121+
122+
- name: Set up Docker Buildx
123+
uses: docker/setup-buildx-action@v3
124+
125+
- name: Set image name and tag
126+
run: |
127+
if [[ "${{ github.ref_name }}" == "main" ]]; then
128+
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
129+
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
130+
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
131+
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
132+
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
133+
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
134+
else
135+
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-mcp_server:${{ github.ref_name }}" >> $GITHUB_ENV
136+
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
137+
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-mcp_server:${{ github.ref_name }}" >> $GITHUB_ENV
138+
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
139+
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-mcp_server:${{ github.ref_name }}" >> $GITHUB_ENV
140+
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-mcp_server:latest" >> $GITHUB_ENV
141+
fi
142+
143+
- name: Create manifest list and push
144+
working-directory: ${{ runner.temp }}/digests
145+
run: |
146+
TAGS="$(echo -e "${Git_Tag}\n${Git_Latest}\n${Ali_Tag}\n${Ali_Latest}\n${Docker_Hub_Tag}\n${Docker_Hub_Latest}")"
147+
for TAG in $TAGS; do
148+
docker buildx imagetools create -t $TAG \
149+
$(printf 'ghcr.io/${{ github.repository_owner }}/fastgpt-mcp_server@sha256:%s ' *)
150+
sleep 5
151+
done

.vscode/nextapi.code-snippets

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -52,71 +52,17 @@
5252
"description": "FastGPT usecontext template"
5353
},
5454

55-
"Jest test template": {
56-
"scope": "typescriptreact",
57-
"prefix": "jesttest",
55+
"Vitest test case template": {
56+
"scope": "typescript",
57+
"prefix": "template_test",
5858
"body": [
59-
"import '@/pages/api/__mocks__/base';",
60-
"import { root } from '@/pages/api/__mocks__/db/init';",
61-
"import { getTestRequest } from '@fastgpt/service/test/utils'; ;",
62-
"import { AppErrEnum } from '@fastgpt/global/common/error/code/app';",
63-
"import handler from './demo';",
64-
"",
65-
"// Import the schema",
66-
"import { MongoOutLink } from '@fastgpt/service/support/outLink/schema';",
67-
"",
68-
"beforeAll(async () => {",
69-
" // await MongoOutLink.create({",
70-
" // shareId: 'aaa',",
71-
" // appId: root.appId,",
72-
" // tmbId: root.tmbId,",
73-
" // teamId: root.teamId,",
74-
" // type: 'share',",
75-
" // name: 'aaa'",
76-
" // })",
77-
"});",
78-
"",
79-
"test('Should return a list of outLink', async () => {",
80-
" // Mock request",
81-
" const res = (await handler(",
82-
" ...getTestRequest({",
83-
" query: {",
84-
" appId: root.appId,",
85-
" type: 'share'",
86-
" },",
87-
" user: root",
88-
" })",
89-
" )) as any;",
90-
"",
91-
" expect(res.code).toBe(200);",
92-
" expect(res.data.length).toBe(2);",
93-
"});",
94-
"",
95-
"test('appId is required', async () => {",
96-
" const res = (await handler(",
97-
" ...getTestRequest({",
98-
" query: {",
99-
" type: 'share'",
100-
" },",
101-
" user: root",
102-
" })",
103-
" )) as any;",
104-
" expect(res.code).toBe(500);",
105-
" expect(res.error).toBe(AppErrEnum.unExist);",
106-
"});",
59+
"import { describe, it, expect } from 'vitest';",
10760
"",
108-
"test('if type is not provided, return nothing', async () => {",
109-
" const res = (await handler(",
110-
" ...getTestRequest({",
111-
" query: {",
112-
" appId: root.appId",
113-
" },",
114-
" user: root",
115-
" })",
116-
" )) as any;",
117-
" expect(res.code).toBe(200);",
118-
" expect(res.data.length).toBe(0);",
61+
"describe('authType2UsageSource', () => {",
62+
" it('Test description', () => {",
63+
" expect().toBe();",
64+
" });",
11965
"});"
120-
]
66+
]
12167
}
12268
}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dev:
1717

1818
build:
1919
ifeq ($(proxy), taobao)
20-
docker build -f $(filePath) -t $(image) . --build-arg proxy=taobao
20+
docker build -f $(filePath) -t $(image) . --build-arg proxy=taobao
2121
else ifeq ($(proxy), clash)
2222
docker build -f $(filePath) -t $(image) . --network host --build-arg HTTP_PROXY=http://127.0.0.1:7890 --build-arg HTTPS_PROXY=http://127.0.0.1:7890
2323
else

docSite/content/zh-cn/docs/development/sealos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
138138
SYSTEM_NAME=FastGPT
139139
SYSTEM_DESCRIPTION=
140140
SYSTEM_FAVICON=/favicon.ico
141-
HOME_URL=/app/list
141+
HOME_URL=/dashboard/apps
142142
```
143143

144144
SYSTEM_FAVICON 可以是一个网络地址
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: 'V4.9.6(进行中)'
3+
description: 'FastGPT V4.9.6 更新说明'
4+
icon: 'upgrade'
5+
draft: false
6+
toc: true
7+
weight: 794
8+
---
9+
10+
11+
12+
13+
## 🚀 新增内容
14+
15+
1. 以 MCP 方式对外提供应用调用。
16+
2. 支持以 MCP SSE 协议创建工具。
17+
3. 批量执行节点支持交互节点,可实现每一轮循环都人工参与。
18+
4. 增加工作台二级菜单,合并工具箱。
19+
5. 增加 grok3、GPT4.1、Gemini2.5 模型系统配置。
20+
21+
## ⚙️ 优化
22+
23+
1. 工作流数据类型转化鲁棒性和兼容性增强。
24+
2. Python sandbox 代码,支持大数据输入。
25+
3. 路径组件支持配置最后一步是否可点击。
26+
4. 知识库工具调用结果,自动补充图片域名。
27+
5. Github action runner 升级成 unbuntu24
28+
29+
## 🐛 修复
30+
31+
1. 修复子工作流包含交互节点时,未成功恢复子工作流所有数据。
32+
2. completion v1 接口,未接受 interactive 参数,导致 API 调用失败。

packages/global/common/error/code/common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ErrType } from '../errorCode';
55
const startCode = 507000;
66
export enum CommonErrEnum {
77
invalidParams = 'invalidParams',
8+
invalidResource = 'invalidResource',
89
fileNotFound = 'fileNotFound',
910
unAuthFile = 'unAuthFile',
1011
missingParams = 'missingParams',
@@ -15,6 +16,10 @@ const datasetErr = [
1516
statusText: CommonErrEnum.fileNotFound,
1617
message: i18nT('common:error.invalid_params')
1718
},
19+
{
20+
statusText: CommonErrEnum.invalidResource,
21+
message: i18nT('common:error_invalid_resource')
22+
},
1823
{
1924
statusText: CommonErrEnum.fileNotFound,
2025
message: 'error.fileNotFound'

0 commit comments

Comments
 (0)