Files
homeagent-sdk/tools/plugindev/templates
JianFeeeee 5175e7d6e0 refactor(plugindev): 模板适配 funccall 调用帧
工具调用/清洗由内核发起,内核标定一块内存帧交给插件(callee),
插件在帧内工作;只有结果超出内核预留预算时才向内核申请扩容块。

- 新增 frameInput/frameOutput/arenaPut:读写调用帧、按需扩容
- tool.invoke:从 frame[0,args_len) 读参数;结果优先写帧结果区,
  放不下才 arena.alloc 扩容并打 sharedRefFlagExpand
- cleaner.invoke:同一帧模型(frame + input_len)
- SharedRef.Flags 语义位与内核对齐(JSON / EXPAND)
- 防漂移测试更新为 frame/args_len/result_ref
2026-09-10 18:54:40 +08:00
..

# {{.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`.