feat: 插件-工具合并 — 创建 pkg/plugins 共享模块并移除 tool-engine
- 新增 backend/pkg/plugins/ 共享模块:SDK 接口、PluginManager、ToolRegistry(含环形缓冲区调用日志) - 13 个通用插件从 plugin-manager 迁移至共享模块(import 路径统一) - ai-core 切换至共享 ToolRegistry,进程内执行(零网络开销),包装 6 个专属工具 - plugin-manager 迁移至共享模块,保留管理 REST API - 新增 DevTools 插件管理面板(侧边栏 → 🔌 插件管理) - 移除 tool-engine 服务(从 go.work、DevTools 配置、编译系统) - 工具调用记录 API 从 Tool-Engine 迁至 AI-Core(/api/v1/tools/calls) - ai-core ContextStore 启动时从 PostgreSQL 恢复会话历史 - 清理所有过时引用和备份文件 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/internal/manager"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/internal/sdk"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/manager"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
)
|
||||
|
||||
type hostAPI struct {
|
||||
@@ -38,13 +38,9 @@ func (h *hostAPI) GetConfig(key string) (string, error) {
|
||||
return "", fmt.Errorf("config key not found: %s", key)
|
||||
}
|
||||
|
||||
func (h *hostAPI) SetConfig(_, _ string) error {
|
||||
return nil
|
||||
}
|
||||
func (h *hostAPI) SetConfig(_, _ string) error { return nil }
|
||||
|
||||
func (h *hostAPI) PublishEvent(_ context.Context, _ map[string]interface{}) error {
|
||||
return nil
|
||||
}
|
||||
func (h *hostAPI) PublishEvent(_ context.Context, _ map[string]interface{}) error { return nil }
|
||||
|
||||
func (h *hostAPI) HTTPClient() *http.Client {
|
||||
return http.DefaultClient
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/internal/sdk"
|
||||
iotquery "github.com/yourname/cyrene-ai/plugin-manager/plugins/iot_query"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
iotquery "github.com/yourname/cyrene-ai/pkg/plugins/iot_query"
|
||||
)
|
||||
|
||||
type iotClient struct {
|
||||
|
||||
@@ -8,23 +8,24 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/calculator"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/crypto"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/datetime"
|
||||
fileplugin "github.com/yourname/cyrene-ai/pkg/plugins/file"
|
||||
httpplugin "github.com/yourname/cyrene-ai/pkg/plugins/http"
|
||||
iotcontrol "github.com/yourname/cyrene-ai/pkg/plugins/iot_control"
|
||||
iotquery "github.com/yourname/cyrene-ai/pkg/plugins/iot_query"
|
||||
jsonplugin "github.com/yourname/cyrene-ai/pkg/plugins/json"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/manager"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/markdown"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/random"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/sdk"
|
||||
"github.com/yourname/cyrene-ai/pkg/plugins/text"
|
||||
webfetch "github.com/yourname/cyrene-ai/pkg/plugins/web_fetch"
|
||||
websearch "github.com/yourname/cyrene-ai/pkg/plugins/web_search"
|
||||
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/internal/config"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/internal/handler"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/internal/manager"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/internal/sdk"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/plugins/calculator"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/plugins/crypto"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/plugins/datetime"
|
||||
fileplugin "github.com/yourname/cyrene-ai/plugin-manager/plugins/file"
|
||||
httpplugin "github.com/yourname/cyrene-ai/plugin-manager/plugins/http"
|
||||
iotcontrol "github.com/yourname/cyrene-ai/plugin-manager/plugins/iot_control"
|
||||
iotquery "github.com/yourname/cyrene-ai/plugin-manager/plugins/iot_query"
|
||||
jsonplugin "github.com/yourname/cyrene-ai/plugin-manager/plugins/json"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/plugins/markdown"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/plugins/random"
|
||||
"github.com/yourname/cyrene-ai/plugin-manager/plugins/text"
|
||||
webfetch "github.com/yourname/cyrene-ai/plugin-manager/plugins/web_fetch"
|
||||
websearch "github.com/yourname/cyrene-ai/plugin-manager/plugins/web_search"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user