仓库布局
wesgine 的源码组织与目录结构说明。
顶层结构
wesgine.git/
├── wesgine.go SDK 入口:NewHypervisor()
├── hypervisor.go Hypervisor struct
├── cell.go Cell struct
├── cellspec.go CellSpec 定义
├── design/ 设计文档
├── skills/ Tier E 引擎技能
├── internal/ 内部实现
├── adapter/ per-cell 外设
├── client/ HTTP Client SDK
├── cmd/wesgine/ CLI
├── scripts/ 闸门集
└── tests/ 实时 API 测试
公共契约包
消费方 import 的包:
| 包 | 职责 |
|---|
message | 消息类型 |
engine | Event / Plan / BudgetStatus |
tool | Tool 接口 / ToolContext |
config | HypervisorConfig / CellSpec |
agent | AgentConfig / Store |
task | TaskMemory |
channel | IM 渠道 |
cron | 定时 Run |
skill | Skill 子系统 |
observe | Observability 契约 |
governance | 治理类型与预设 |
interact | HITL 类型 |
license | Ed25519 离线 license |
xdg | XDG Base Directory |
internal/ 子包
| 子包 | 职责 |
|---|
hypervisor/ | Hypervisor 实现 |
gateway/ | HTTP 路由 + handler |
cell/ | Cell 实现 |
cognitive/ | Resolver 链 + Health |
context/ | Assembler + Overlays |
execution/ | Registry + Executor |
memory/ | Store(Agent NS + Cell NS) |
knowledge/ | Corpus + SearchBackend |
loop/ | Coordination for{} |
orchestration/ | Run 编排 / delegation |
govern/ | Governance 实现 |
observe/ | EventEmitter / Tracer |
session/ | 会话与消息持久化 |
interact/ | HITL 实现 |
skills/ | Skill 装载与状态机 |
infra/ | db / crashlog / lineio / proc |
adapter/ 外设
| 目录 | 功能 |
|---|
channel/ | IM 渠道适配 |
email/ | 邮件收发 |
mcp/ | MCP Server 管理 |
cron/ | 定时任务 |
browser/ | 浏览器安全阀 |
headless-browser/ | 服务端 chromedp |
playwright/ | 用户浏览器自动化 |
desktop/ | 桌面自动化 Device Agent |
plugin/ | JSON-RPC 子进程 Plugin |
stt/ | 语音转写 Whisper |
knowledge/ | 知识库适配 |
设计文档
design/
├── 01-identity/ 定位 / 公理 / 心智模型
├── 02-architecture/ 架构总览 + kernel/ 子系统
├── 03-specification/ Handle API / HTTP / CellSpec
├── 04-guide/ 快速上手 / Boot 模式
├── 05-invariants/ 反模式 / 不变量 / 闸门
└── decisions/ ADR