refactor: centralize ABI metadata into internal/meta/meta.go

- internal/meta/meta.go: add ABIVersion, ABIVersionMin, 45 dispatch
  method IDs, SDKCompatibleVersion (single source of truth)
- internal/plugin/cabi/types.go: re-export from meta.go
- internal/plugin/cabi/loader.go: reject plugin when version > ABIVersion;
  pass ABIVersion in Start instead of hardcoded 1
- loader.{go,c}: comments reference meta.go as canonical
This commit is contained in:
JianFeeeee
2026-07-25 14:42:35 +08:00
parent e992e1ff84
commit 87ad88b174
4 changed files with 123 additions and 50 deletions

View File

@ -4,6 +4,8 @@
#include <stdlib.h>
#include <string.h>
// HOMEAGENT_ABI_VERSION 与 internal/meta/meta.go ABIVersion 同步。
// C ABI 通过 version/version_min 协商,旧插件不受影响。
#define HOMEAGENT_ABI_VERSION 1
// PluginAPI — provided by the plugin