feat: read codex agent definitions

This commit is contained in:
Yoilun
2026-05-25 16:39:35 +08:00
parent c67d5a33ad
commit fee920a895
9 changed files with 383 additions and 9 deletions

View File

@@ -6,7 +6,7 @@
## Target Architecture
计划架构为Go 后端提供 localhost HTTP APIVue 3 + Vite 前端提供中文工作台界面。目标后端将只读访问 Codex SQLite 状态库安全读取 `.codex` 配置,并仅在用户确认后写回 `.codex/agents/*.toml`
计划架构为Go 后端提供 localhost HTTP APIVue 3 + Vite 前端提供中文工作台界面。当前后端已提供健康检查和 `.codex/agents/*.toml` 只读读取;目标后端将继续增加只读 SQLite 状态库安全读取项目配置,并仅在用户确认后写回 `.codex/agents/*.toml`
## Configuration
@@ -28,12 +28,18 @@ go run ./cmd/codex-agent-manager
curl http://127.0.0.1:18083/api/health
```
读取智能体定义:
```bash
curl http://127.0.0.1:18083/api/agents
```
## Security Boundaries
- 不读取 `.codex/auth.json`
- 不写入 Codex SQLite。
- `.codex/agents/*.toml` 写回必须先备份。
- 当前后端骨架只实现健康检查和 Codex home 路径边界函数,尚未读取真实 `.codex` 数据文件
- 当前 `/api/agents` 只读列出 `.codex/agents` 直属 `.toml` 文件,读取前通过 Codex home 边界和 agent TOML 专用 resolver坏 TOML 以单条 `invalid` 状态返回,不导致服务崩溃
## Known Risks