开发

源码地图

目录 职责
sagents/v2/ 运行时契约、装配、provider 与执行
app/v2/desktop/ Flutter 界面与本机 FastAPI sidecar
app/v2/server/ 多用户服务端与 Vue Web 客户端
tests/sagents/v2/ 运行时测试和契约检查
tests/app/v2/desktop/、tests/app/v2/server/ 宿主集成测试
docs/en/、docs/zh/ 当前中英文 v2 文档

验证修改

使用快速开始中的 Python 3.12+ 环境,服务端测试需要安装对应 extras:

python -m pip install -e '.[server-v2]' pytest pytest-asyncio pytest-timeout
python -m pytest tests/sagents/v2 tests/app/v2/desktop tests/app/v2/server -q

开发时先运行相关测试。真实模型测试需显式配置,可能产生调用费用。注入测试存储的数据库测试不证明生产 MySQL 行为。

cd app/v2/desktop
flutter analyze
flutter test
cd app/v2/server/web
npm install
npm run build

文档检查

.venv/bin/python docs/scripts/check_docs.py
.venv/bin/python -m unittest discover -s docs/scripts -p 'test_*.py'
bash docs/scripts/build_jekyll.sh
python3 docs/scripts/check_language_nav.py

Jekyll 构建需要 Ruby 和 docs/Gemfile 中的依赖。正式页面应有正确的语言元数据、有效本地链接和 v2 源码依据。历史文件放入不参与发布的 docs/archive/。不能用旧审查的通过数作为当前可用性保证。

检查会对比中英文页面集合、导航元数据、标题层级、代码示例和链接目标,并将路由及环境变量清单与当前 Server v2 源码核对。构建后逐页检查侧栏是否完整一致,以及语言切换是否指向对应译文。


Sage documentation for the current repository layout. Source available under the MIT license.

This site uses Just the Docs, a documentation theme for Jekyll.