2.9 KiB
2.9 KiB
Repository Guidelines
Project Structure & Module Organization
main.pyruns the CLI agent;web_server.pyserves the Flask/SocketIO UI fromstatic/.core/contains terminal orchestration (main_terminal.py,web_terminal.py) and should stay I/O-light.modules/collects reusable capabilities (file/search/memory/terminal); extend here before touching entrypoints.utils/provides API clients, context helpers, and logging; import from here instead of adding globals.prompts/,data/, andproject/bundle prompt templates, fixtures, and demos used primarily for reference.test/stores integration helpers (api_interceptor_server.py,test_deepseek_output.py); add new suites alongside them.- 前端:
static/src/components/chat/monitor是虚拟显示器动画层;涉及新场景请在MonitorDirector/monitor store内对齐数据与动画的状态同步。
Build, Test, and Development Commands
pip install -r requirements.txtinstalls Python dependencies.python main.pylaunches the CLI agent loop.python web_server.pyserves the web UI athttp://localhost:8091.python test/api_interceptor_server.pystarts the mock proxy that logs traffic toapi_logs/.python test_deepseek_output.pyexercises streaming tool-calls; populateconfig.pywith valid API credentials first.npm installthennpm run buildbuilds the Vue frontend tostatic/dist;npm run devwatches;npm run lintfor TS/Vue linting.
Coding Style & Naming Conventions
- Target Python 3.11+, 4-space indentation,
snake_casefunctions, andPascalCaseclasses. - TypeScript 5 / Vue 3 单文件组件,保持
<script setup lang="ts">风格;新增资源放入static/src对应子目录。 - Add type hints和简短双语 docstring;日志统一用
utils.logger.setup_logger,仅在需要时使用print。 - 模块聚焦:新增能力优先放
modules/(或static/src/components/chat/monitor对应区域)而非入口脚本。
Testing Guidelines
- Prefer
pytestfor automation and name filestest/test_<feature>.py, reusing assets indata/when relevant. - For network flows, run
python test/api_interceptor_server.pyand point the app to the proxy to avoid external calls. - Capture manual verification steps in PRs and add replay scripts under
test/for repeated workflows.
Commit & Pull Request Guidelines
- With no history yet, adopt Conventional Commits (
feat:,fix:,refactor:) and keep summaries under 72 characters. - Squash iterative commits; PRs should outline changes, touched modules, and validation.
- Link issues and attach UI captures or log snippets when behavior shifts.
Security & Configuration Tips
- Keep real API keys out of git; override defaults via environment variables.
- Clean sensitive data from
api_logs/,logs/, andexperiment_outputs/before sharing. - Extend
.gitignorewhen new tooling produces temporary artifacts.