gitea
|
c87dfa52a5
|
批量收口 commands/agent/* 边界:全部改用 _cmd 便捷函数
- rule_service.py 新增 list_rules_cmd / get_rule_cmd / create_rule_cmd
- services/__init__.py 导出以上三个 _cmd 函数
- commands/agent/ 下 8 个文件一律移除 `from ekb_cli.api import get_client`,
改为调用 services 层对应的 _cmd 函数(自管 client 生命周期)
- 同步清理各文件中残留的局部 try/except EkbError,统一冒泡至全局 handler
- 验证:commands/ 目录内已无任何 api 层直接引用
|
2026-04-15 18:17:13 +08:00 |
|
gitea
|
db378b9140
|
重构第3批:CLI 瘦化 + 新增 FastAPI Server
CLI 瘦化(commands/ 全部 10 个命令文件):
- 移除内联的参数校验和编排逻辑,改为调用对应 service 函数
- 统一错误处理:捕获 EkbError,rich 红字输出并 Exit(1)
- auth.py:调用 auth_service,不再直接操作 config 模块
新增 server/ 目录(FastAPI HTTP Server):
- __init__.py:create_app() 工厂,注册三个路由组,统一 EkbError 异常处理
- deps.py:ClientDep 类型别名,FastAPI 依赖注入 EkbClient
- auth_router.py:/auth/* 5 个端点,对应 ekb auth 命令组
- agent_router.py:/agents/* 7 个端点,含高阶 /dedup-rules 接口
- rule_router.py:/rules/* 4 个端点,对应 ekb agent rule-* 命令
|
2026-04-14 11:27:59 +08:00 |
|
gitea
|
4466af7726
|
重构:api层拆分 agent/rule,引入 Pydantic 校验,统一 re-export,补充 README.api.md
|
2026-04-08 00:30:00 +08:00 |
|
gitea
|
a863377da8
|
新增:ekb agent rule-get,规则详情含关联Agent;rules 支持 --level 筛选
- rule_detail.py:支持 ID 或编码(0001/#0001)查询,展示完整描述和关联Agent列表
- rule_list.py:新增 --level 筛选参数
- 注册 rule-get 命令,更新命令树
|
2026-04-06 01:16:52 +08:00 |
|
gitea
|
fd41415d83
|
新增:ekb agent rules 命令,列出企业所有审核规则
- api/agent.py 增加 list_rules / save_rule / update_rule 封装
- 新增 commands/agent/rule_list.py,支持 --full 展开截断字段
- 注册 rules 子命令,更新命令树和 CLAUDE.md API 路径
|
2026-04-06 01:12:15 +08:00 |
|