Skip to content
Open

1 #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1748 commits
Select commit Hold shift + click to select a range
f000fbb
compatible with old enums (#5219)
newfish-cmyk Jul 16, 2025
d102adc
Add unit tests for user API functions in api.test.ts (#5214)
gru-agent[bot] Jul 16, 2025
4275de9
Revert "compatible with old enums (#5219)" (#5222)
c121914yu Jul 16, 2025
4816d23
compatible with old enums\ (#5221)
newfish-cmyk Jul 16, 2025
b50c437
Update doc (#5223)
c121914yu Jul 16, 2025
44a474d
feat: support signoz (#5218)
FinleyGe Jul 16, 2025
983137b
doc: Add recommended configuration for Oceanbase deployment (#5225)
Amaranterre Jul 16, 2025
986daad
add 'search' field ; update setFastGPTSem to validate input before st…
ctrlz526 Jul 17, 2025
06e7087
docs: update design plugin doc (#5241)
FinleyGe Jul 17, 2025
9860a7a
fix default model select (#5243)
c121914yu Jul 17, 2025
0d0bf06
fix: variablesinit (#5247)
c121914yu Jul 17, 2025
530f30e
Var render (#5248)
c121914yu Jul 17, 2025
6f75c1b
fix node variable update render (#5251)
newfish-cmyk Jul 18, 2025
593c816
perf: value type checker (#5255)
c121914yu Jul 18, 2025
ef70475
doc (#5256)
c121914yu Jul 18, 2025
5f26aa7
update doc (#5259)
c121914yu Jul 18, 2025
ab69b31
update doc (#5261)
c121914yu Jul 19, 2025
cfefe69
Add unit tests for request utility functions in the API module. (#5254)
gru-agent[bot] Jul 21, 2025
59e2b2f
chore(deps): bump multer from 2.0.1 to 2.0.2 (#5249)
dependabot[bot] Jul 21, 2025
de208d6
fix: error (#5269)
FinleyGe Jul 21, 2025
13b7e0a
V4.11.0 features (#5270)
c121914yu Jul 22, 2025
d0730e6
doc (#5271)
c121914yu Jul 22, 2025
da34e85
update version doc (#5272)
c121914yu Jul 22, 2025
f0bfe2c
Update 4100.md (#5273)
Deepturn Jul 22, 2025
208d8cf
version doc (#5275)
c121914yu Jul 22, 2025
a2f8356
action (#5277)
c121914yu Jul 22, 2025
366bccb
update secret (#5278)
c121914yu Jul 22, 2025
a300741
Fix API method for retrieving WX login result from GET to POST (#5281)
ctrlz526 Jul 22, 2025
8e94fdb
chore(deps): bump form-data from 4.0.2 to 4.0.4 (#5279)
dependabot[bot] Jul 22, 2025
5c95fa2
Refactor login initialization logic to remove unused configuration c…
ctrlz526 Jul 22, 2025
bebe213
perf: read file internal (#5282)
c121914yu Jul 22, 2025
0fa0838
feat: coupoun support bank pay way (#5285)
c121914yu Jul 23, 2025
e008b21
feat: deleted user (#5289)
c121914yu Jul 23, 2025
662c790
feat: enhance wallet billing features (#5293)
xqvvu Jul 23, 2025
5131ab2
extra point (#5296)
c121914yu Jul 23, 2025
ce9ec1b
fix: i18n (#5297)
c121914yu Jul 23, 2025
fe7abf2
New document (#5299)
c121914yu Jul 23, 2025
e9db592
Doc action test (#5302)
c121914yu Jul 23, 2025
55ad908
feat:add 4111.mdx and remove unuse doc (#5303)
dreamer6680 Jul 23, 2025
393b7ab
Document action (#5304)
c121914yu Jul 23, 2025
2b99be1
chore(deps): bump form-data in /plugins/webcrawler/SPIDER (#5301)
dependabot[bot] Jul 24, 2025
455cee6
chore(deps): bump starlette in /plugins/model/llm-ChatGLM2 (#5300)
dependabot[bot] Jul 24, 2025
4838a2c
remove old doc (#5305)
c121914yu Jul 24, 2025
8e61029
fix: doc (#5306)
c121914yu Jul 24, 2025
fa60f54
fix:change docs url (#5307)
dreamer6680 Jul 24, 2025
68136fe
doc: evaluation (#5276)
newfish-cmyk Jul 24, 2025
c390eb1
Fix document action and content (#5308)
c121914yu Jul 24, 2025
51268f1
fix:add not-found path map (#5309)
dreamer6680 Jul 24, 2025
4bc6814
fix:useeffect cannot returm jsx (#5311)
dreamer6680 Jul 24, 2025
45010cf
add tool params return (#5312)
newfish-cmyk Jul 25, 2025
47ef1a5
feat:get lastmodified time by git log (#5314)
dreamer6680 Jul 25, 2025
8460ee5
Update 4100.mdx (#5325)
c121914yu Jul 27, 2025
6ed9198
fix: page /404 translator not working bug (#5320)
Kuro-P Jul 28, 2025
a45d933
fix: fix the login container; fix the incorrect input of captcha ente…
xqvvu Jul 29, 2025
061547a
feat: add robots.txt (#5339)
dreamer6680 Jul 30, 2025
6c37776
fix: resole crawl cannot get docs (#5344)
dreamer6680 Jul 30, 2025
e0c21a9
docs: update plugin guide (#5345)
FinleyGe Jul 30, 2025
e25d7ef
feature: V4.11.1 (#5350)
c121914yu Aug 1, 2025
00f00f6
Update doc (#5358)
c121914yu Aug 1, 2025
6ac03db
fix: plugin not get system input config (#5363)
c121914yu Aug 1, 2025
845f4d4
fix: tool not clone (#5364)
c121914yu Aug 1, 2025
fb85875
fix: simple mode toolset not refresh tool config (#5365)
c121914yu Aug 1, 2025
1014f34
fix: missing build mcp image args (#5366)
503612012 Aug 2, 2025
109bdbe
4.11.2 dev (#5368)
c121914yu Aug 2, 2025
baf18b1
Fix: action (#5369)
c121914yu Aug 2, 2025
7bcee82
perf: memory leak (#5370)
c121914yu Aug 3, 2025
517b0af
feat: move robots.txt to toc.mdx (#5372)
dreamer6680 Aug 4, 2025
67cdc8f
Update dataset.mdx (#5381)
Deepturn Aug 4, 2025
05bbba2
fix dataset list item tag margin (#5380)
newfish-cmyk Aug 4, 2025
61899d9
fix: build mcp image proxy (#5379)
503612012 Aug 4, 2025
16a74c9
fix: doc preview action;update doc (#5383)
c121914yu Aug 4, 2025
545d815
fix docker file (#5385)
c121914yu Aug 4, 2025
6a0b0b1
update doc search engine (#5386)
c121914yu Aug 4, 2025
f870a2d
更新 4112.mdx (#5387)
c121914yu Aug 4, 2025
37648d5
fix: mcp not response output (#5388)
c121914yu Aug 5, 2025
254680b
Update dataset.mdx (#5391)
Deepturn Aug 5, 2025
e5c91b7
fix: doc path (#5393)
c121914yu Aug 5, 2025
318d21e
chore(deps): bump transformers in /plugins/model/llm-Baichuan2 (#5397)
dependabot[bot] Aug 7, 2025
17599d9
fix: old mcp tool compatible (#5399)
FinleyGe Aug 7, 2025
0526411
doc (#5401)
c121914yu Aug 7, 2025
1fc1e3f
fix: max tokens config (#5409)
c121914yu Aug 8, 2025
29edf1e
Perf: llm parse paragraph (#5420)
c121914yu Aug 9, 2025
57e1ef1
refactor: permission role & app read chat log permission (#5416)
FinleyGe Aug 11, 2025
5019c6e
Add unit tests for MCP utility functions in utils.test.ts (#5423)
gru-agent[bot] Aug 11, 2025
c6e5829
fix: permission can not edit admin permission (#5433)
FinleyGe Aug 11, 2025
c51395b
V4.12.0 features (#5435)
c121914yu Aug 12, 2025
3cbcb1e
Fix doc (#5439)
c121914yu Aug 12, 2025
83aa3a8
redirect (#5440)
c121914yu Aug 12, 2025
ad550f4
perf: workflow response field (#5443)
c121914yu Aug 13, 2025
dfef662
Add unit tests for useChatStore and createCustomStorage functions in …
gru-agent[bot] Aug 13, 2025
f29229e
chore(deps): bump transformers in /plugins/model/llm-ChatGLM2 (#5442)
dependabot[bot] Aug 13, 2025
cc86ace
Update dataset.mdx (#5448)
Deepturn Aug 13, 2025
ef56912
fix: update runningUserInfo retrieval in chat completions API (#5446)
ctrlz526 Aug 13, 2025
77bf4ea
fix log chart display (#5449)
newfish-cmyk Aug 13, 2025
6a02d2a
fix: concatenate answerText in dispatchRunTool function (#5451)
ctrlz526 Aug 13, 2025
9fbfaba
perf: variabel replace;Feat: prompt optimizer code (#5453)
c121914yu Aug 14, 2025
d72929d
fix dataset auth filter (#5457)
newfish-cmyk Aug 14, 2025
8f3424c
feat: enhance SystemPluginTemplateItemType to include user instruct…
ctrlz526 Aug 14, 2025
c5cabd0
export chat detail (#5454)
newfish-cmyk Aug 14, 2025
9a9f094
prompt optimze loading (#5461)
newfish-cmyk Aug 14, 2025
eadf2fd
fix: index (#5458)
c121914yu Aug 14, 2025
5cd1c2a
perf: chat pane (#5462)
c121914yu Aug 15, 2025
d78a0e9
feat: add toolDescription field across various schemas and update r…
ctrlz526 Aug 15, 2025
76dc23c
perF: getInitData api cache;perf: tool description field;signoz store…
c121914yu Aug 15, 2025
ce36230
perf: page ui (#5469)
c121914yu Aug 15, 2025
d21d1e2
version package (#5470)
c121914yu Aug 15, 2025
2c91137
fix: fe (#5471)
c121914yu Aug 15, 2025
c166a57
doc (#5472)
c121914yu Aug 15, 2025
1f65bfb
deploy doc (#5473)
c121914yu Aug 15, 2025
e945e84
doc (#5474)
c121914yu Aug 15, 2025
a4991ec
Update 4121.mdx (#5475)
c121914yu Aug 15, 2025
f59d70b
fix: fix the chat/share page pane (#5485)
xqvvu Aug 18, 2025
f41e3ff
fix: multiple select value type when empty string does not have map f…
FinleyGe Aug 19, 2025
37eec3d
perf: customizable embedding chunk size via env var (#5494)
FinleyGe Aug 20, 2025
14b4c08
Add unit tests for utility functions in the app workflow module. (#5466)
gru-agent[bot] Aug 20, 2025
1e7a1a7
Add unit tests for WorkflowComponents utility functions in utils.test…
gru-agent[bot] Aug 20, 2025
6da65ea
docs: update dev system tool (#5486)
FinleyGe Aug 20, 2025
ff9c6c9
chore: extract chat history and drawer; fix model selector (#5492)
xqvvu Aug 20, 2025
c7fd930
fix: ui & hide history list (#5510)
xqvvu Aug 20, 2025
e19eddf
fix: model selector overlay (#5511)
c121914yu Aug 20, 2025
a92917c
fix team app template search (#5514)
newfish-cmyk Aug 21, 2025
9532534
perf: vector format (#5516)
c121914yu Aug 22, 2025
b6318aa
fix: version schema ref error (#5518)
c121914yu Aug 22, 2025
1da44a1
chore(deps): bump sha.js in /plugins/webcrawler/SPIDER (#5519)
dependabot[bot] Aug 23, 2025
84127a3
chore(deps): bump mermaid from 10.9.3 to 10.9.4 (#5522)
dependabot[bot] Aug 23, 2025
d9e28a5
Fix: document preview action (#5524)
c121914yu Aug 23, 2025
b516943
feat: new code block style in document (#5468)
fishwww-ww Aug 23, 2025
d6af930
fix: increase MCP auth config value field maxLength (#5523)
sumingcheng Aug 24, 2025
830eb19
feature: V4.12.2 (#5525)
c121914yu Aug 25, 2025
3b25bf5
perf: search key refresh parentId (#5530)
c121914yu Aug 26, 2025
3c2bf20
feat: add switch to control if enable `home` (#5531)
xqvvu Aug 26, 2025
7cd4a8b
feat: Store pdfparse in local (#5534)
c121914yu Aug 26, 2025
9704769
update package (#5535)
c121914yu Aug 26, 2025
2e2e919
fix: chat navbar (#5537)
c121914yu Aug 26, 2025
4939271
fix: fix redirect timing while `enableHome` is false; tweak UI (#5538)
xqvvu Aug 26, 2025
93e9cb6
fix: oceanbase insert (#5539)
c121914yu Aug 26, 2025
3fb1ff2
fix: read permission; incorrect name; redirect (#5541)
xqvvu Aug 26, 2025
4d7e0ed
fix: team avatar select (#5542)
c121914yu Aug 26, 2025
d2d4c76
update doc (#5543)
c121914yu Aug 26, 2025
324aaae
fix: ai response test (#5544)
c121914yu Aug 26, 2025
4e194d6
Update doc (#5545)
c121914yu Aug 26, 2025
610634e
fix: mcp tool node hide the version selection (#5547)
FinleyGe Aug 27, 2025
c4799df
perf: workflow code (#5548)
c121914yu Aug 27, 2025
8e77060
Update teamMode.mdx (#5550)
Deepturn Aug 27, 2025
486d791
fix: extract node can not extract when using tool-calling-able model.…
FinleyGe Aug 28, 2025
e4756c7
rrf_weight (#5551)
YYH211 Aug 28, 2025
a952539
perf: rrf code (#5558)
c121914yu Aug 28, 2025
42e249f
perf: rrf code (#5559)
c121914yu Aug 28, 2025
6e8bf8c
fix: favorite apps ui and permission; fix favorite settings' table ro…
xqvvu Sep 1, 2025
76a03a8
fix: incorrect popover position (#5568)
xqvvu Sep 1, 2025
f41775f
fix: leave team (#5554)
FinleyGe Sep 1, 2025
c67e645
perf: login page (#5571)
c121914yu Sep 1, 2025
9be1e59
fix: delete "Content-Length" while redirect request to pro api (#5589)
xqvvu Sep 4, 2025
85ea117
Fix workflow (#5592)
c121914yu Sep 4, 2025
0ede427
fix: var selector (#5593)
c121914yu Sep 4, 2025
c747fc0
Update docs-deploy.yml (#5594)
c121914yu Sep 4, 2025
3f9b0fa
V4.12.3 features (#5595)
c121914yu Sep 7, 2025
c4632a2
V4.12.3 document (#5600)
c121914yu Sep 7, 2025
4e17fcf
fix: node card copy toolConfig (#5605)
FinleyGe Sep 8, 2025
deced4c
Update sso.mdx (#5603)
Deepturn Sep 8, 2025
3fc163c
Update 4101.mdx (#5602)
Deepturn Sep 8, 2025
25207c5
perf: search result (#5608)
c121914yu Sep 9, 2025
bdb89a3
fix: table size (#5598)
xqvvu Sep 9, 2025
635e606
fix http plugin chatconfig undefined (#5621)
newfish-cmyk Sep 11, 2025
768fb63
feat: scan QRCode auto redeem coupon (#5616)
fishwww-ww Sep 12, 2025
1f0b62e
chore(deps): bump axios in /plugins/webcrawler/SPIDER (#5637)
dependabot[bot] Sep 14, 2025
c8934e3
chore(deps): bump jsondiffpatch from 0.6.0 to 0.7.2 (#5634)
dependabot[bot] Sep 14, 2025
2ed1545
V4.12.4 features (#5626)
c121914yu Sep 15, 2025
cb7d1a3
perf: init shell (#5651)
c121914yu Sep 15, 2025
e68a801
Update 4124.mdx (#5654)
c121914yu Sep 16, 2025
4333eb9
doc: update wecom doc (#5656)
fishwww-ww Sep 16, 2025
235b50c
tool author (#5665)
c121914yu Sep 17, 2025
fb536d1
Update lark_dataset.mdx (#5667)
c121914yu Sep 17, 2025
ae3fbaf
fix: permission for favourite apps chatting (#5668)
xqvvu Sep 17, 2025
1581a08
doc_mineru (#5662)
YYH211 Sep 17, 2025
ab29710
fix: node copy, debug variables, auto-execution (#5664)
newfish-cmyk Sep 17, 2025
3099b33
fix: front end render wecom publish without update manually (#5670)
fishwww-ww Sep 18, 2025
206fd7e
fix: question guide prompt save & sub route image (#5672)
newfish-cmyk Sep 18, 2025
91269c9
fix: 修复最后一个流为[xxxx]格式时会重复输出1次 (#5673)
shikaiwei1 Sep 19, 2025
984fbc8
Update commercial.mdx (#5685)
c121914yu Sep 21, 2025
9f8f8dd
Update README.md (#5686)
c121914yu Sep 22, 2025
0514552
V4.13.0 features (#5693)
c121914yu Sep 24, 2025
88633a2
fix: child usage remove (#5698)
c121914yu Sep 24, 2025
70e0798
update package (#5700)
c121914yu Sep 25, 2025
d4c1e25
chore(deps): bump tar-fs in /plugins/webcrawler/SPIDER (#5699)
dependabot[bot] Sep 25, 2025
7cdb16c
perf: permission index & model table collaborator context lazy mount …
FinleyGe Sep 25, 2025
34e5191
fix: collection ui (#5704)
c121914yu Sep 25, 2025
1e8e24a
Update 4130.mdx (#5705)
c121914yu Sep 25, 2025
93e260e
Update 4130.mdx (#5709)
c121914yu Sep 25, 2025
3b31804
app doc (#5712)
c121914yu Sep 26, 2025
c66c2ad
feat: auth login in getSchemaApi (#5713)
c121914yu Sep 26, 2025
53907af
fix: loop interactive (#5714)
c121914yu Sep 26, 2025
a6ba974
fix: simple prompt editor list render (#5717)
newfish-cmyk Sep 27, 2025
ce3556c
fix: react-hook-form Controller crash with special characters in fiel…
newfish-cmyk Sep 27, 2025
5a2ba5a
fix: add missing MongoAppChatLog updates for interactive chat session…
newfish-cmyk Sep 27, 2025
32a3b92
perf: deploy docs; docker-compose (#5722)
FinleyGe Sep 29, 2025
5749f66
update deploy doc (#5723)
c121914yu Sep 29, 2025
d6fc27a
Test doc (#5724)
c121914yu Sep 29, 2025
bea5fc0
fix: static file /deploy/* (#5725)
FinleyGe Sep 29, 2025
e4127b5
chore: deploy update cn registry (#5726)
FinleyGe Sep 29, 2025
a83ae8e
4.13.1 features (#5728)
c121914yu Sep 30, 2025
1d2fe01
deploy doc (#5729)
c121914yu Sep 30, 2025
6955981
doc (#5730)
c121914yu Sep 30, 2025
b8c2c7a
fix: docker-compose pg_url removal; depends on pg -> vectorDB (#5733)
FinleyGe Oct 6, 2025
7942805
fix: usage repeat (#5735)
c121914yu Oct 9, 2025
aba0b4c
hide audit (#5740)
c121914yu Oct 9, 2025
7dcff44
update dockerfile (#105) (#5749)
c121914yu Oct 10, 2025
2beb217
Prompt: Fixing Display Image Error Issues (#5745)
lizhq Oct 10, 2025
c6dfaae
dockerfile (#5750)
c121914yu Oct 10, 2025
9ea1cbf
add user active tracks (#5754)
newfish-cmyk Oct 11, 2025
12096f6
fix: set vision default false (#5758)
c121914yu Oct 13, 2025
1984690
Update 4132.mdx (#5766)
c121914yu Oct 15, 2025
1ab2e92
feat: add health check to MongoDB service in Docker Compose templates…
FinleyGe Oct 17, 2025
2d0a956
chore(deps): bump mammoth from 1.9.0 to 1.11.0 (#5781)
dependabot[bot] Oct 19, 2025
703ef2c
add 10-minute auto-refresh for token login (#5788)
newfish-cmyk Oct 20, 2025
ca3053f
fix: resolve MCP service modal checkbox double-click event issue (#5790)
FinleyGe Oct 20, 2025
44e9299
V4.13.2 features (#5792)
c121914yu Oct 20, 2025
5054ccd
fix: start node check (#5794)
c121914yu Oct 21, 2025
ca274fe
perf: init s3 (#5795)
c121914yu Oct 21, 2025
b59f2cc
fix: loginout (#5796)
c121914yu Oct 21, 2025
038fee2
fix path (#5797)
c121914yu Oct 21, 2025
68271c0
fix: 修复Plugin代理服务在处理通过nginx转发部署的Plugin服务时,req.headers中的host会导致返回404. …
shikaiwei1 Oct 22, 2025
d87771a
fix: toolcall index not start zero (#5811)
c121914yu Oct 24, 2025
3bd9b61
remove invalid log (#5812)
c121914yu Oct 24, 2025
f7448fb
chore(deps): bump starlette in /plugins/model/llm-ChatGLM2 (#5825)
dependabot[bot] Oct 30, 2025
e1b616a
Update README.md (#5844)
c121914yu Nov 3, 2025
f79dbf8
fix: 修复Markdown渲染加粗链接时显示[object Object]的问题 (#5839)
mmagi Nov 3, 2025
fac1703
Update 4130.mdx (#5855)
c121914yu Nov 4, 2025
a499d05
V4.14.0 features (#5850)
c121914yu Nov 4, 2025
44e87e3
fix: var render (#5857)
c121914yu Nov 4, 2025
5163e70
fix: editor (#5859)
c121914yu Nov 5, 2025
c9edba3
fix scrollbar (#5862)
newfish-cmyk Nov 5, 2025
3a030e8
Fix: Tag filter scroll (#5863)
c121914yu Nov 5, 2025
adf9981
fix: http inputs (#5864)
c121914yu Nov 5, 2025
45869fa
Upgrade document (#5865)
c121914yu Nov 5, 2025
bf33f7a
add templateId to apps (#5866)
c121914yu Nov 5, 2025
89ca81d
fix: document deploy (#5867)
c121914yu Nov 5, 2025
7aaa28e
fix: document deploy (#5868)
c121914yu Nov 6, 2025
57e37c9
chore: edit upgrading doc (#5870)
FinleyGe Nov 6, 2025
edf06a0
fix: trim check (#5873)
c121914yu Nov 6, 2025
1f9c8d3
fix: child app run error (#5876)
c121914yu Nov 7, 2025
7225ebe
perf: model reload (#5879)
c121914yu Nov 7, 2025
8ca5ebe
perf: read file node return splited raw texts (#5881)
FinleyGe Nov 7, 2025
74e1620
fix: plugin file selector (#5871)
xqvvu Nov 7, 2025
d571c76
V4.14.1 feature (#5880)
c121914yu Nov 11, 2025
8eb6f37
fix: sso doc (#5901)
FinleyGe Nov 12, 2025
3a5318c
fix: action (#5903)
c121914yu Nov 12, 2025
245d6e0
fix: action (#5904)
c121914yu Nov 12, 2025
21b9f61
fix: action (#5905)
c121914yu Nov 12, 2025
fa163a5
doc (#5908)
c121914yu Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
126 changes: 126 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# CLAUDE.md

本文件为 Claude Code (claude.ai/code) 在本仓库中工作时提供指导说明。

## 输出要求

1. 输出语言:中文
2. 输出的设计文档位置:.claude/design,以 Markdown 文件为主。
3. 输出 Plan 时,均需写入 .claude/plan 目录下,以 Markdown 文件为主。

## 项目概述

FastGPT 是一个 AI Agent 构建平台,通过 Flow 提供开箱即用的数据处理、模型调用能力和可视化工作流编排。这是一个基于 NextJS 构建的全栈 TypeScript 应用,后端使用 MongoDB/PostgreSQL。

**技术栈**: NextJS + TypeScript + ChakraUI + MongoDB + PostgreSQL (PG Vector)/Milvus

## 架构

这是一个使用 pnpm workspaces 的 monorepo,主要结构如下:

### Packages (库代码)
- `packages/global/` - 所有项目共享的类型、常量、工具函数
- `packages/service/` - 后端服务、数据库模型、API 控制器、工作流引擎
- `packages/web/` - 共享的前端组件、hooks、样式、国际化
- `packages/templates/` - 模板市场的应用模板

### Projects (应用程序)
- `projects/app/` - 主 NextJS Web 应用(前端 + API 路由)
- `projects/sandbox/` - NestJS 代码执行沙箱服务
- `projects/mcp_server/` - Model Context Protocol 服务器实现

### 关键目录
- `document/` - 文档站点(NextJS 应用及内容)
- `plugins/` - 外部插件(模型、爬虫等)
- `deploy/` - Docker 和 Helm 部署配置
- `test/` - 集中的测试文件和工具

## 开发命令

### 主要命令(从项目根目录运行)
- `pnpm dev` - 启动所有项目的开发环境(使用 package.json 的 workspace 脚本)
- `pnpm build` - 构建所有项目
- `pnpm test` - 使用 Vitest 运行测试
- `pnpm test:workflow` - 运行工作流相关测试
- `pnpm lint` - 对所有 TypeScript 文件运行 ESLint 并自动修复
- `pnpm format-code` - 使用 Prettier 格式化代码

### 项目专用命令
**主应用 (projects/app/)**:
- `cd projects/app && pnpm dev` - 启动 NextJS 开发服务器
- `cd projects/app && pnpm build` - 构建 NextJS 应用
- `cd projects/app && pnpm start` - 启动生产服务器

**沙箱 (projects/sandbox/)**:
- `cd projects/sandbox && pnpm dev` - 以监视模式启动 NestJS 开发服务器
- `cd projects/sandbox && pnpm build` - 构建 NestJS 应用
- `cd projects/sandbox && pnpm test` - 运行 Jest 测试

**MCP 服务器 (projects/mcp_server/)**:
- `cd projects/mcp_server && bun dev` - 使用 Bun 以监视模式启动
- `cd projects/mcp_server && bun build` - 构建 MCP 服务器
- `cd projects/mcp_server && bun start` - 启动 MCP 服务器

### 工具命令
- `pnpm create:i18n` - 生成国际化翻译文件
- `pnpm api:gen` - 生成 OpenAPI 文档
- `pnpm initIcon` - 初始化图标资源
- `pnpm gen:theme-typings` - 生成 Chakra UI 主题类型定义

## 测试

项目使用 Vitest 进行测试并生成覆盖率报告。主要测试命令:
- `pnpm test` - 运行所有测试
- `pnpm test:workflow` - 专门运行工作流测试
- 测试文件位于 `test/` 目录和 `projects/app/test/`
- 覆盖率报告生成在 `coverage/` 目录

## 代码组织模式

### Monorepo 结构
- 共享代码存放在 `packages/` 中,通过 workspace 引用导入
- `projects/` 中的每个项目都是独立的应用程序
- 使用 `@fastgpt/global`、`@fastgpt/service`、`@fastgpt/web` 导入共享包

### API 结构
- NextJS API 路由在 `projects/app/src/pages/api/`
- API 路由合约定义在`packages/global/openapi/`, 对应的
- 通用服务端业务逻辑在 `packages/service/`和`projects/app/src/service`
- 数据库模型在 `packages/service/` 中,使用 MongoDB/Mongoose

### 前端架构
- React 组件在 `projects/app/src/components/` 和 `packages/web/components/`
- 使用 Chakra UI 进行样式设计,自定义主题在 `packages/web/styles/theme.ts`
- 国际化支持文件在 `packages/web/i18n/`
- 使用 React Context 和 Zustand 进行状态管理

## 开发注意事项

- **包管理器**: 使用 pnpm 及 workspace 配置
- **Node 版本**: 需要 Node.js >=18.16.0, pnpm >=9.0.0
- **数据库**: 支持 MongoDB、带 pgvector 的 PostgreSQL 或 Milvus 向量存储
- **AI 集成**: 通过统一接口支持多个 AI 提供商
- **国际化**: 完整支持中文、英文和日文

## 关键文件模式

- `.ts` 和 `.tsx` 文件全部使用 TypeScript
- 数据库模型使用 Mongoose 配合 TypeScript
- API 路由遵循 NextJS 约定
- 组件文件使用 React 函数式组件和 hooks
- 共享类型定义在 `packages/global/` 的 `.d.ts` 文件中

## 环境配置

- 配置文件在 `projects/app/data/config.json`
- 支持特定环境配置
- 模型配置在 `packages/service/core/ai/config/`

## 代码规范

- 尽可能使用 type 进行类型声明,而不是 interface。

## Agent 设计规范

1. 对于功能的实习和复杂问题修复,优先进行文档设计,并于让用户确认后,再进行执行修复。
2. 采用"设计文档-测试示例-代码编写-测试运行-修正代码/文档"的工作模式,以测试为核心来确保设计的正确性。
Loading