docs: 补充 Windows/.dll 支持和 Lua 插件说明,修正误导性描述

- README.md: 依赖从 Linux 改为 Linux/Windows

- OVERVIEW.md: .so 改为 .so/.dll,补充 Lua 插件示例列表

- ARCHITECTURE.md: 新增 Lua 插件加载方式,.so 改为 .so/.dll

- PLUGIN_DEV.md: 修正'Go 插件与内核绑定'的误导性描述
This commit is contained in:
JianFeeeee
2026-07-13 22:13:38 +08:00
parent 950090959f
commit de02468f2b
4 changed files with 7 additions and 5 deletions

View File

@ -180,4 +180,4 @@ make test # go test ./...
make install # 安装到系统
```
依赖Go 1.19+, CGo (go-sqlite3), Linux。
依赖Go 1.21+, CGo (go-sqlite3), Linux/Windows

View File

@ -223,11 +223,13 @@ VM 内置 `json.encode` / `json.decode` / `log` / `http_get` / `http_post`。
| 方式 | 注册机制 | 编译 | 用途 |
|------|----------|------|------|
| 内置插件 | `init()``RegisterFactory` | `internal/plugins/` 编译进内核 | webui/cli/timer/mcp 等 |
| 外部 `.so` | `plugin.Open` 动态加载 | `-buildmode=plugin` | qq/files/web/memo 等 |
| 外部 `.so`/`.dll` | `plugin.Open` 动态加载 | `-buildmode=plugin` | qq/files/web/memo 等 |
| Lua 脚本插件 | 解析 `main.lua` 注册工具 | 无需编译,热加载 | luaplugintest/testlua 等 |
| SKILL 插件 | 解析 `SKILL.md` | Markdown 定义 | OpenClaw 兼容 |
内置插件注册:`internal/plugins/all.go` 空白导入 → 各插件 `init()``Registry.Load()` 扫描目录匹配工厂。
外部插件加载:`internal/plugin/dynamic.go` → 复制到 SHA256 临时路径(绕过 `plugin.Open` 路径缓存)→ `Open` + `Lookup("NewPlugin")`
Lua 脚本插件加载:`internal/lua/` → 通过 Lua VM 解析 `main.lua`,调用 `start()` 注册工具。
### PluginSDK 三通道

View File

@ -47,7 +47,7 @@ HomeAgent 是一个持续运行的个人智能 Agent 框架。
**插件系统** (`internal/plugin/`)
- 内置插件Go `init()` 自注册,编译进内核
- 外部插件Go `-buildmode=plugin` 编译为 `.so`,通过 `plugin.Open` 动态加载
- 外部插件Go `-buildmode=plugin` 编译为 `.so`/`.dll`,通过 `plugin.Open` 动态加载;也支持 Lua 脚本插件
- PluginSDK (`internal/sdk/`) 定义三通道RegisterTool / RegisterStage / Subscribe
- 阶段钩子 7 个on_input → pre_action → post_action → before_toolcall → after_toolcall → before_output → after_output
@ -68,5 +68,5 @@ HomeAgent 是一个持续运行的个人智能 Agent 框架。
核心功能已可运行。插件系统和 SDK 已就绪,可独立开发外部插件。
- 内置插件webui / cli / timer / cmd / mcp / agentcli / healthcheck / pluginmgr / openclaw / files
- 外部插件示例([homeagent-sdk](https://gitcode.com/JianFeeeee/homeagent-sdk) 仓库 `example/`qq / files / web / memo / bili / editdoc / a2a / ocr
- 外部插件示例([homeagent-sdk](https://gitcode.com/JianFeeeee/homeagent-sdk) 仓库 `example/`,含 Go 和 Lua 两种类型qq / files / web / memo / bili / editdoc / a2a / ocr / sanitizer / luaplugintest / testlua
- 打包分发:`.hmap` 插件包格式,通过 WebUI 安装

View File

@ -439,7 +439,7 @@ import (
4. handler 返回 `error` 时 LLM 会收到并可能重试
5. 打断用 `InjectInterruptText`,普通投递用 `InjectText`
6. 配置用 `Settings().Get/Set`,不要硬编码
7. Go 插件与内核编译绑定,每次重新编译内核后需同步重新编译 Go 插件
7. 外部 Go 插件独立编译,不依赖内核版本;内置插件才需随内核重新编译
---