mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-25 03:18:06 +00:00
- doc.insert / doc.insertWithMedia:doc_ref / attachments_ref - knowledge.add:content_ref - procProtocolVersion 1 → 2 bump 的理由:这两处改了内核→插件的 payload 承载方式,两种错配都静默失效 (v1 插件遇 v2 内核拿到空参数;v2 插件发 blocks_ref 给 v1 内核被静默忽略)。 双方都是等值校验,bump 后 v1 插件遇上 v2 内核会在建链时显式报错并带出 “请用配套 plugindev 重编”。 配套内核侧 50ba4a6。
# {{.Plg.Name}}
{{.Plg.Description}}
## Build
```bash
plugindev build
```
## Install
Upload the `.hmap` file through the Plugin Manager API:
```bash
curl -X POST http://localhost:8080/api/v1/plugins \
-H "Content-Type: application/octet-stream" \
--data-binary @dist/<name_en_snake>_linux_amd64.hmap
```
## Lifecycle
- `RegisterStopHandler` — runs on every stop (including reload/disable), before `Stop()`.
- `RegisterOnRemoveHandler` — runs **only on uninstall (remove)**, after `Stop()`; clean up the plugin's own data files here. Reload/disable do NOT trigger it. See the onRemove demo in `main.go`.