Files
HomeAgent/README.md
root 2d314b3e9c 重构: 插件自注册 + .so 动态加载 + 中断打断机制
- 所有内置插件 init() 自注册 (plugin.RegisterFactory), 移除 main.go 硬编码
- 新增 .so 动态加载器 (internal/plugin/dynamic.go), 插件可编译为 plugin.so
- 新增 plugin.json 元数据 (internal/plugin/manifest.go)
- 新增 interceptLoop 独立 goroutine:
  (a) cancelLLM() 取消进行中的 HTTP 请求
  (b) interceptCh → drainInterrupt() 注入 [打断消息] 到 LLM 上下文
  (c) InjectInput 空闲时触发新处理循环
- 新增 internal/plugins/all.go 空白导入触发所有内置插件 init()
- internal/sdk/ 作为 PluginSDK 正式 Go API
- internal/api/ → internal/plugins/webui/ 迁移
- 删除旧 cmd/cli/, 使用 cmd/waiter/ 替代
- 更新 PLAN.md / ARCHITECTURE.md / README.md 文档
2026-07-03 16:53:34 +08:00

38 lines
1.1 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.

# HomeAgent
24/7 智能管家。**核心零 IO**,一切外界交互来自插件。
## 架构概览
```
homed (内核) — 零 IO,纯管理
├── LLM 源管理 (Lua 适配器协议转换)
├── Agent 编排 (主 agent + interceptLoop + 子 agent)
├── 三层记忆 (Context → Document → Graph)
├── 知识库 (独立 TF-IDF)
├── IO 通道管理 (Queue / Interrupt / Output)
├── 阶段管道 (StageHost: 7 阶段并行)
└── 事件总线 (EventBus)
│
▼ PluginSDK (Go API: 工具/阶段/事件/记忆/知识/LLM/配置)
│
plugins (init() 自注册 + .so 动态加载)
├── WebUI (HTTP 服务)
├── CLI (Unix socket)
├── OpenClaw 兼容 (SKILL.md → SDK 工具)
├── Timer (timer_set 工具 + 中断反馈)
└── 第三方 .so 插件 (plugins/<name>/plugin.so)
```
核心文档: [PLAN.md](PLAN.md) · [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
## 构建
```bash
make build
./build/homed -data /tmp/homeagent
./build/waiter -say "你好"
```
依赖: Go 1.19+, CGo (go-sqlite3), Linux (Unix socket + overlayfs)