Files
hose-use/src/domains
gitea 3a15b064fe refactor(core): 规范数据库表结构、版本迁移与多级缓存体系加固
- 数据库表规范化与原子事务版本迁移机制 (_schema_migrations)
- 增加 SQLite 复合主键、PRAGMA busy_timeout 与索引覆盖
- 构建统一两级协同缓存 (L1 Memory LRU + L2 SQLite 持久化)
- withCache 增加 In-flight Promise 去重并发防击穿 (单飞机制)
- 收敛 dimension、role、bill 与 token-store 缓存逻辑
- 100% 保持现有 API 契约与零功能删除
2026-09-08 15:49:27 +08:00
..
2026-09-05 13:51:33 +08:00

Domains 域层说明

本目录按业务域组织代码,每个域独立负责自己的传输层、业务层和模型层。

当前域

域 说明 详细文档
platform/ 自建应用(DataLink Platform)与工作流(EASO/Piper) README.platform.md
bill/ 费控单据、报销单、发票与 DataLink 实体字典 README.bill.md

分层规则

  • api.ts:只负责 HTTP 请求和响应校验
  • tools.ts:负责 MCP tool 注册和业务编排
  • types.ts:Zod schema 与类型定义

Server 入口 src/server.ts 只调用 domains/*/tools.ts,不直接调用 api.ts。