feat: converge dynamic plugins onto canonical homeagent-sdk

- Separate built-in plugin interface from external plugin interface
- Route dynamic plugin loading through homeagent-sdk/sdk using reflection
- Turn internal/sdk into an enhanced wrapper over canonical SDK types
- Vendor SDK repo snapshot under third_party/homeagent-sdk for stable builds
- Keep internal constructors/adapters for memory, knowledge, llm, settings
- Align dynamic QQ loading with canonical SDK chain
This commit is contained in:
JianFeeeee
2026-07-06 19:27:51 +08:00
parent 5080e3c749
commit d82ccf7e95
37 changed files with 4505 additions and 420 deletions

View File

@ -1,42 +1,29 @@
package sdk
import agentAPI "gitcode.com/JianFeeeee/HomeAgent/internal/agent/api"
import (
sdkext "gitcode.com/JianFeeeee/homeagent-sdk/sdk"
agentAPI "gitcode.com/JianFeeeee/HomeAgent/internal/agent/api"
)
type LLMAPI interface {
ListSources() []string
SetSource(name string) error
CurrentSource() string
}
type LLMAPI = sdkext.LLMAPI
type llmImpl struct {
mgr *agentAPI.ProviderManager
}
type llmImpl struct{ mgr *agentAPI.ProviderManager }
func NewLLM(mgr *agentAPI.ProviderManager) LLMAPI {
return &llmImpl{mgr: mgr}
}
func NewLLM(mgr *agentAPI.ProviderManager) LLMAPI { return &llmImpl{mgr: mgr} }
func (l *llmImpl) ListSources() []string {
if l.mgr == nil {
return nil
}
if l.mgr == nil { return nil }
return l.mgr.List()
}
func (l *llmImpl) SetSource(name string) error {
if l.mgr == nil {
return nil
}
if l.mgr == nil { return nil }
return l.mgr.SetDefault(name)
}
func (l *llmImpl) CurrentSource() string {
if l.mgr == nil {
return ""
}
if l.mgr == nil { return "" }
p := l.mgr.Default()
if p == nil {
return ""
}
if p == nil { return "" }
return p.Name()
}