Repository: cft0808/edict Branch: main Commit: 72eafc8f3393 Files: 133 Total size: 1.2 MB Directory structure: gitextract_d680erd4/ ├── .dockerignore ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── pull_request_template.md │ └── workflows/ │ └── ci.yml ├── .gitignore ├── .vite/ │ └── deps/ │ ├── _metadata.json │ └── package.json ├── .vscode/ │ └── settings.json ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── README_EN.md ├── ROADMAP.md ├── agents/ │ ├── bingbu/ │ │ └── SOUL.md │ ├── gongbu/ │ │ └── SOUL.md │ ├── hubu/ │ │ └── SOUL.md │ ├── libu/ │ │ └── SOUL.md │ ├── libu_hr/ │ │ └── SOUL.md │ ├── menxia/ │ │ └── SOUL.md │ ├── shangshu/ │ │ └── SOUL.md │ ├── taizi/ │ │ └── SOUL.md │ ├── xingbu/ │ │ └── SOUL.md │ ├── zaochao/ │ │ └── SOUL.md │ └── zhongshu/ │ └── SOUL.md ├── dashboard/ │ ├── court_discuss.py │ ├── dashboard.html │ ├── dist/ │ │ ├── assets/ │ │ │ ├── index-DQ-p_wPk.js │ │ │ └── index-NQIHw-yB.css │ │ └── index.html │ └── server.py ├── docker/ │ └── demo_data/ │ ├── agent_config.json │ ├── last_model_change_result.json │ ├── live_status.json │ ├── model_change_log.json │ ├── morning_brief.json │ ├── officials_stats.json │ ├── openclaw.json │ ├── pending_model_changes.json │ └── tasks_source.json ├── docker-compose.yml ├── docs/ │ ├── getting-started.md │ ├── remote-skills-guide.md │ ├── remote-skills-quickstart.md │ ├── screenshots/ │ │ └── README.md │ ├── task-dispatch-architecture.md │ ├── wechat-article.md │ └── wechat.md ├── edict/ │ ├── Dockerfile │ ├── alembic.ini │ ├── backend/ │ │ ├── app/ │ │ │ ├── __init__.py │ │ │ ├── api/ │ │ │ │ ├── __init__.py │ │ │ │ ├── admin.py │ │ │ │ ├── agents.py │ │ │ │ ├── events.py │ │ │ │ ├── legacy.py │ │ │ │ ├── tasks.py │ │ │ │ └── websocket.py │ │ │ ├── config.py │ │ │ ├── db.py │ │ │ ├── main.py │ │ │ ├── models/ │ │ │ │ ├── __init__.py │ │ │ │ ├── event.py │ │ │ │ ├── task.py │ │ │ │ ├── thought.py │ │ │ │ └── todo.py │ │ │ ├── services/ │ │ │ │ ├── __init__.py │ │ │ │ ├── event_bus.py │ │ │ │ └── task_service.py │ │ │ └── workers/ │ │ │ ├── __init__.py │ │ │ ├── dispatch_worker.py │ │ │ └── orchestrator_worker.py │ │ └── requirements.txt │ ├── docker-compose.yml │ ├── frontend/ │ │ ├── Dockerfile │ │ ├── index.html │ │ ├── nginx.conf │ │ ├── package.json │ │ ├── postcss.config.js │ │ ├── src/ │ │ │ ├── App.tsx │ │ │ ├── api.ts │ │ │ ├── components/ │ │ │ │ ├── ConfirmDialog.tsx │ │ │ │ ├── CourtCeremony.tsx │ │ │ │ ├── CourtDiscussion.tsx │ │ │ │ ├── EdictBoard.tsx │ │ │ │ ├── MemorialPanel.tsx │ │ │ │ ├── ModelConfig.tsx │ │ │ │ ├── MonitorPanel.tsx │ │ │ │ ├── MorningPanel.tsx │ │ │ │ ├── OfficialPanel.tsx │ │ │ │ ├── SessionsPanel.tsx │ │ │ │ ├── SkillsConfig.tsx │ │ │ │ ├── TaskModal.tsx │ │ │ │ ├── TemplatePanel.tsx │ │ │ │ └── Toaster.tsx │ │ │ ├── index.css │ │ │ ├── main.tsx │ │ │ ├── store.ts │ │ │ └── vite-env.d.ts │ │ ├── tailwind.config.js │ │ ├── tsconfig.json │ │ ├── tsconfig.tsbuildinfo │ │ └── vite.config.ts │ ├── migration/ │ │ ├── env.py │ │ ├── migrate_json_to_pg.py │ │ ├── script.py.mako │ │ └── versions/ │ │ └── 001_initial.py │ └── scripts/ │ └── kanban_update_edict.py ├── edict_agent_architecture.md ├── examples/ │ ├── README.md │ ├── code-review.md │ ├── competitive-analysis.md │ └── weekly-report.md ├── install.ps1 ├── install.sh ├── scripts/ │ ├── apply_model_changes.py │ ├── fetch_morning_news.py │ ├── file_lock.py │ ├── kanban_update.py │ ├── record_demo.py │ ├── refresh_live_data.py │ ├── run_loop.sh │ ├── skill_manager.py │ ├── sync_agent_config.py │ ├── sync_from_openclaw_runtime.py │ ├── sync_officials_stats.py │ ├── take_screenshots.py │ └── utils.py └── tests/ ├── test_e2e_kanban.py ├── test_file_lock.py ├── test_kanban.py └── test_server.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ # Git .git .gitignore # IDE / Editor .vscode .idea *.swp *.swo *~ # Python __pycache__ *.pyc *.pyo .mypy_cache .pytest_cache .venv venv # OS .DS_Store Thumbs.db # Docs (not needed in image) docs/ *.md !README.md LICENSE ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug Report about: 报告一个 Bug labels: bug --- ## 环境 - OpenClaw 版本: - 操作系统: - Python 版本: ## 问题描述 ## 复现步骤 1. 2. 3. ## 期望行为 ## 实际行为 ## 错误日志 ``` 粘贴日志 ``` ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature Request about: 提交功能建议 labels: enhancement --- ## 功能描述 ## 使用场景 ## 期望效果 ## 其他信息 ================================================ FILE: .github/pull_request_template.md ================================================ ## 变更描述 ## 变更类型 - [ ] Bug 修复 - [ ] 新功能 - [ ] 重构 / 代码优化 - [ ] 文档更新 - [ ] CI / 工程配置 ## 检查清单 - [ ] 代码已通过 `python3 -m py_compile` 检查 - [ ] 已在本地测试运行 `run_loop.sh` - [ ] 涉及看板的变更已在浏览器中验证 - [ ] 更新了相关文档(如适用) ## 关联 Issue ================================================ FILE: .github/workflows/ci.yml ================================================ name: CI on: push: branches: [main] pull_request: branches: [main] jobs: lint-and-test: runs-on: ubuntu-latest strategy: matrix: python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Syntax check (py_compile) run: | find scripts dashboard -name '*.py' | while read f; do echo " checking $f" python3 -m py_compile "$f" done - name: Install test dependencies run: pip install pytest - name: Run tests run: pytest tests/ -v - name: Shell lint (bash -n) run: bash -n scripts/run_loop.sh ================================================ FILE: .gitignore ================================================ # Runtime data (machine-specific) data/live_status.json data/agent_config.json data/model_change_log.json data/pending_model_changes.json data/last_model_change_result.json data/sync_status.json data/tasks_source.json data/tasks.json data/bitable_source.json data/mission_control_tasks.json # Logs *.log /tmp/ # Python __pycache__/ *.py[cod] .venv/ venv/ # macOS .DS_Store *.swp # Node.js node_modules/ edict/frontend/node_modules/ # Backups *.bak* data ================================================ FILE: .vite/deps/_metadata.json ================================================ { "hash": "2321d508", "configHash": "3e6eab4b", "lockfileHash": "e3b0c442", "browserHash": "5408e294", "optimized": {}, "chunks": {} } ================================================ FILE: .vite/deps/package.json ================================================ { "type": "module" } ================================================ FILE: .vscode/settings.json ================================================ { // 使用 frontend 项目自带的 TypeScript,确保 moduleResolution:"bundler" 生效 "typescript.tsdk": "edict/frontend/node_modules/typescript/lib", // 让 VS Code 优先使用工作区 TypeScript 而非内置版本 "typescript.enablePromptUseWorkspaceTsdk": true } ================================================ FILE: CONTRIBUTING.md ================================================ ∏# 🤝 参与贡献
三省六部欢迎各路英雄好汉 ⚔️
无论是修一个 typo 还是设计一个新的 Agent 角色,我们都万分感谢
感谢每一位贡献者,你们是三省六部的基石 ⚔️
================================================ FILE: Dockerfile ================================================ # ⚔️ 三省六部 · Demo Dashboard # docker run -p 7891:7891 cft0808/sansheng-demo # Then open: http://localhost:7891 # Stage 1: 构建 React 前端 FROM --platform=${BUILDPLATFORM:-linux/amd64} node:20-alpine AS frontend-build WORKDIR /build COPY edict/frontend/package.json edict/frontend/package-lock.json ./ RUN npm ci --silent COPY edict/frontend/ ./ # Build 输出到 /build/dist(vite.config 中 outDir 是相对路径,这里重写) RUN npx vite build --outDir /build/dist # Stage 2: 运行时 FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3.11-slim WORKDIR /app # 复制看板核心文件 COPY dashboard/ ./dashboard/ COPY scripts/ ./scripts/ # 复制 React 构建产物 COPY --from=frontend-build /build/dist ./dashboard/dist/ # 注入演示数据(data目录由demo_data提供) COPY docker/demo_data/ ./data/ # 创建 .openclaw 目录并注入骨架配置(Fix #155: sync_agent_config 依赖此文件) RUN mkdir -p /app/.openclaw COPY docker/demo_data/openclaw.json /app/.openclaw/openclaw.json ENV HOME=/app # 非 root 用户运行 RUN groupadd -r appuser && useradd -r -g appuser -d /app appuser \ && chown -R appuser:appuser /app USER appuser EXPOSE 7891 HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ CMD python3 -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:7891/healthz')" || exit 1 CMD ["python3", "dashboard/server.py", "--host", "0.0.0.0", "--port", "7891"] ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2026 openclaw-sansheng-liubu contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================
我用 1300 年前的帝国制度,重新设计了 AI 多 Agent 协作架构。
结果发现,古人比现代 AI 框架更懂分权制衡。
12 个 AI Agent(11 个业务角色 + 1 个兼容角色)组成三省六部:太子分拣、中书省规划、门下省审核封驳、尚书省派发、六部+吏部并行执行。
比 CrewAI 多一层制度性审核,比 AutoGen 多一个实时看板。
🎬 看 Demo · 🚀 30 秒体验 · 🏛️ 架构 · 📋 看板功能 · 📚 架构文档 · English · 参与贡献
🎥 三省六部 AI 多 Agent 协作全流程演示
飞书下旨 → 太子分拣 → 中书省规划 → 门下省审议 → 六部并行执行 → 奏折回报(30 秒)
| **📋 旨意看板 · Kanban** - 按状态列展示全部任务 - 省部过滤 + 全文搜索 - 心跳徽章(🟢活跃 🟡停滞 🔴告警) - 任务详情 + 完整流转链 - 叫停 / 取消 / 恢复操作 | **🔭 省部调度 · Monitor** - 可视化各状态任务数量 - 部门分布横向条形图 - Agent 健康状态实时卡片 |
| **📜 奏折阁 · Memorials** - 已完成旨意自动归档为奏折 - 五阶段时间线:圣旨→中书→门下→六部→回奏 - 一键复制为 Markdown - 按状态筛选 | **📜 旨库 · Template Library** - 9 个预设圣旨模板 - 分类筛选 · 参数表单 · 预估时间和费用 - 预览旨意 → 一键下旨 |
| **👥 官员总览 · Officials** - Token 消耗排行榜 - 活跃度 · 完成数 · 会话统计 | **📰 天下要闻 · News** - 每日自动采集科技/财经资讯 - 分类订阅管理 + 飞书推送 |
| **⚙️ 模型配置 · Models** - 每个 Agent 独立切换 LLM - 应用后自动重启 Gateway(~5秒生效) | **🛠️ 技能配置 · Skills** - 各省部已安装 Skills 一览 - 查看详情 + 添加新技能 |
| **💬 小任务 · Sessions** - OC-* 会话实时监控 - 来源渠道 · 心跳 · 消息预览 | **🎬 上朝仪式 · Ceremony** - 每日首次打开播放开场动画 - 今日统计 · 3.5秒自动消失 |
| **🏛️ 朝堂议政 · Court Discussion** - 多官员围绕议题展开部门视角讨论 - LLM 驱动的多角色辩论(各部依职责发表专业意见) - 支持多轮推进 · 总结结论 · 保留讨论记录 |
exec format error?(点击展开)
👆 扫码关注「cft0808」—— 朕的技术邸报
⚔️ 以古制御新技,以智慧驾驭 AI
Governing AI with the wisdom of ancient empires
I modeled an AI multi-agent system after China's 1,300-year-old imperial governance.
Turns out, ancient bureaucracy understood separation of powers better than modern AI frameworks.
12 AI agents (11 business roles + 1 compatibility role) form the Three Departments & Six Ministries: Crown Prince triages, Planning proposes, Review vetoes, Dispatch assigns, Ministries execute.
Built-in institutional review gates that CrewAI doesn't have. A real-time dashboard that AutoGen doesn't have.
🎬 Demo · 🚀 Quick Start · 🏛️ Architecture · 📋 Features · 中文 · Contributing
🎥 Full demo: AI Multi-Agent collaboration with Three Departments & Six Ministries
Issue edict → Crown Prince triage → Planning → Review → Ministries execute → Report back (30s)
Scan to follow · cft0808
⚔️ Governing AI with the wisdom of ancient empires
以古制御新技,以智慧驾驭 AI