oclaw/docs/ARCHITECTURE_OVERVIEW.md
oliver 4a23b715a2 重构仓库目录为统一的 runtime 分层并清理历史 openclaw 残留。
本次迁移将网关/通道/工具/技能/脚本与协议资源集中到新结构,统一路径常量与脚本转发机制,减少顶层噪音并保证运行与测试行为一致。

Made-with: Cursor
2026-04-25 01:24:23 +08:00

32 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 架构总览(当前真相)
本文件用于描述当前仓库分层与目录职责,避免迁移后“认知滞后”。
## 顶层目录职责
- `runtime/`:运行时主域(agent、gateway 执行流、skills/hooks/extensions、operations)。
- `interfaces/`:对外接口层(HTTP、WS、Admin、Gateway method bridge)。
- `platform/`:通用平台能力(配置、存储、LLM transport、文件层)。
- `prompts/`:统一提示词体系(含 runtime 相关提示模板)。
- `tests/`:测试代码(按你的要求保持顶层)。
- `docs/`:设计文档、运维说明、迁移记录。
## runtime 内部建议边界
- `runtime/core/`:可复用执行内核(如 agent 执行管线聚合入口)。
- `runtime/app/`:应用侧入口组织(面向外部流程的 runtime 编排)。
- `runtime/agents|chat|orchestration|workers`:领域能力模块。
- `runtime/skills|hooks|extensions`:可扩展能力载体。
- `runtime/operations/scripts`:运维脚本与生成器。
## 路径规范
- 运行时资源路径统一通过 `platform/config/runtime_paths.py` 获取。
- 禁止新增硬编码目录字符串(如直接拼 `oclaw/runtime/...`)。
## 依赖方向(原则)
- `interfaces -> runtime -> platform`(尽量单向)。
- `runtime` 不反向依赖 `interfaces`(必要时通过协议/回调解耦)。
- `docs/tests` 可依赖任意层,但不应反向影响运行时代码设计。