From c63bce8304160963719695636aecefdfacaa9a68 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Oct 2026 07:00:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(examples):=20cmd/localuse/mcp=20=E5=AF=B9?= =?UTF-8?q?=E9=BD=90=E4=BB=93=E5=86=85=E7=A4=BA=E4=BE=8B=E8=A7=84=E7=BA=A6?= =?UTF-8?q?=20=E2=80=94=E2=80=94=20=E7=9B=B8=E5=AF=B9=20replace=E3=80=81?= =?UTF-8?q?=E4=B8=8D=E5=A3=B0=E6=98=8E=20sdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI 红(run 39265187807)根因:这三个工程用了 `hmapdev init` 的本机 脚手架格式(replace => /root/.homeagent/...,plg.json 带 "sdk":"1.4.0"), 而仓内 22 个存量示例的规约(example_gomod_test.go 的两条判据 + hmapdev 构建逻辑)是: - go.mod:require v0.0.0 + replace => ../../(相对仓库根) - plg.json:不声明 sdk 字段 —— 声明了会让 hmapdev 去本地 SDK store 找该版本,干净 CI 上必然失败("存储里还没有任何 SDK") 外部开发者拿 init 模板在本机构建没问题(init 面向本机 store), 但**仓内示例**面向的是 checkout 即可构建的 CI/发版路径,两者规约不同。 修后本地复验:example_gomod_test 3 条判据全绿; build-examples.sh linux/amd64 与 darwin/arm64 均 25/25 成功。 --- example/cmd/go.mod | 6 ++---- example/cmd/plg.json | 1 - example/localuse/go.mod | 6 ++---- example/localuse/plg.json | 1 - example/mcp/go.mod | 9 ++------- example/mcp/plg.json | 1 - 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/example/cmd/go.mod b/example/cmd/go.mod index 1a4fb94..b3da893 100644 --- a/example/cmd/go.mod +++ b/example/cmd/go.mod @@ -2,8 +2,6 @@ module homeagent-cmd go 1.25.0 -require github.com/JianFeeeee/homeagentsdk v1.4.0 +require github.com/JianFeeeee/homeagentsdk v0.0.0 - - -replace github.com/JianFeeeee/homeagentsdk => /root/.homeagent/hmapdev/sdk/v1.4.0 +replace github.com/JianFeeeee/homeagentsdk => ../../ diff --git a/example/cmd/plg.json b/example/cmd/plg.json index 506d346..1743c8f 100644 --- a/example/cmd/plg.json +++ b/example/cmd/plg.json @@ -6,7 +6,6 @@ "description": "沙箱内执行", "author": "HomeAgent", "entry": "plugin.so", - "sdk": "1.4.0", "tags": [ "cmd" ], diff --git a/example/localuse/go.mod b/example/localuse/go.mod index b81bdea..020ffb5 100644 --- a/example/localuse/go.mod +++ b/example/localuse/go.mod @@ -2,8 +2,6 @@ module localuse go 1.25.0 -require github.com/JianFeeeee/homeagentsdk v1.4.0 +require github.com/JianFeeeee/homeagentsdk v0.0.0 - - -replace github.com/JianFeeeee/homeagentsdk => /root/.homeagent/hmapdev/sdk/v1.4.0 +replace github.com/JianFeeeee/homeagentsdk => ../../ diff --git a/example/localuse/plg.json b/example/localuse/plg.json index c144728..20e68da 100644 --- a/example/localuse/plg.json +++ b/example/localuse/plg.json @@ -6,7 +6,6 @@ "description": "Device", "author": "HomeAgent", "entry": "plugin.so", - "sdk": "1.4.0", "tags": [ "localuse" ], diff --git a/example/mcp/go.mod b/example/mcp/go.mod index b686b66..a89b8e2 100644 --- a/example/mcp/go.mod +++ b/example/mcp/go.mod @@ -2,11 +2,6 @@ module mcp go 1.25.0 -require github.com/JianFeeeee/homeagentsdk v1.4.0 +require github.com/JianFeeeee/homeagentsdk v0.0.0 - - - - - -replace github.com/JianFeeeee/homeagentsdk => /root/.homeagent/hmapdev/sdk/v1.4.0 +replace github.com/JianFeeeee/homeagentsdk => ../../ diff --git a/example/mcp/plg.json b/example/mcp/plg.json index ed4b0c8..056511d 100644 --- a/example/mcp/plg.json +++ b/example/mcp/plg.json @@ -6,7 +6,6 @@ "description": "MCP (Model Context Protocol) 客户端:接入外部 MCP 服务器,透传其工具", "author": "HomeAgent", "entry": "plugin.so", - "sdk": "1.4.0", "tags": [ "mcp", "protocol"