refactor: 规则中性化——剥离 PPT 业务,统一为订单示范域

把规则从原 ppt-gen 项目泛化为通用脚手架,覆盖 19 个文件:
- ddd/architecture/design-discipline/error-codes/communication-* 等:
  领域术语、错误码、消息示例、扩展点、状态流统一为「订单」示范域
- agent-dag/agent.md/agent-concurrency/agent-llm-*:DAG 节点、配置、并发、
  LLM 适配从「对话→预览→生成→截图→合成」改为「intake→process→validate→finalize」
- backend-db:Session 实体/状态机/ORM/仓储/checkpoint 对齐新流水线
- 移除幻灯片专属依赖与产物:agent 去 playwright/python-pptx,
  Dockerfile 去 Chromium 系统库,.gitignore 去 *.pptx
- 保留合法通用项:ANSI(PTY 处理)、Playwright(E2E 测试工具)、Gemini CLI(真实 provider)

验证:gemini-cli/openai-api 两变体生成退出 0,生成项目零 PPT 残留,
backend/agent 骨架均可 import 运行。
This commit is contained in:
baozaotumao
2026-06-01 23:15:05 -07:00
parent bb6503c3f8
commit df48c36422
23 changed files with 257 additions and 285 deletions
@@ -6,22 +6,23 @@ paths: ["backend/**", "agent/**", "frontend/**"]
> 查阅型:各消息 type 的 payload 形状,外层由信封包裹(见 `communication-protocol.md`)。字段一律 snake_case。
> 以下以「订单」为示范业务,仅占位;按项目实际定义自己的消息。
命令(Browser → Backend → Agent):
```json
{"type": "start_session", "language": "中文", "image_source": "unsplash", "image_api_key": "xxx"}
{"type": "user_input", "text": "深圳科技政策解读"}
{"type": "style_pick", "index": 2}
{"type": "start_session", "channel": "web"}
{"type": "create_order", "items": [{"sku": "A-1", "qty": 2}]}
{"type": "submit_order", "order_id": "..."}
```
事件(Agent → Backend → Browser):
```json
{"type": "gemini_message", "text": "请问你的 PPT 主旨是什么?"}
{"type": "style_preview", "index": 1, "preview_url": "/api/v1/preview/{sid}/preview_1.html"}
{"type": "log", "message": "📸 截图第 3/10 页"}
{"type": "html_ready", "session_id": "..."}
{"type": "pptx_ready", "session_id": "..."}
{"type": "order_created", "order_id": "...", "status": "pending"}
{"type": "item_priced", "sku": "A-1", "amount": {"currency": "CNY", "value": 1990}}
{"type": "log", "message": "正在校验库存 2/3"}
{"type": "order_confirmed", "order_id": "..."}
{"type": "done"}
{"type": "error", "code": "GEMINI_TIMEOUT", "message": "..."}
{"type": "error", "code": "EXTERNAL_SERVICE_TIMEOUT", "message": "..."}
```