Initial commit: Cyrene Plugins SDK + Plugin Manager

Extracted from Cyrene main repo (backend/pkg/plugins + backend/plugin-manager).
Contains SDK interfaces (Plugin/Tool/HostAPI), 13 built-in plugins,
ToolRegistry with call log ring buffer, and Plugin Manager REST API service.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 09:49:12 +08:00
commit 5c807d76a0
27 changed files with 3609 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
package main
import (
"context"
"fmt"
"log"
"net/http"
"git.yeij.top/AskaEth/Cyrene-Plugins/manager"
"git.yeij.top/AskaEth/Cyrene-Plugins/sdk"
)
type hostAPI struct {
registry *manager.ToolRegistry
}
func newHostAPI(registry *manager.ToolRegistry) *hostAPI {
return &hostAPI{registry: registry}
}
func (h *hostAPI) CallLLM(_ context.Context, _ []sdk.LLMMessage) (*sdk.LLMResponse, error) {
return nil, fmt.Errorf("LLM call not available in plugin host")
}
func (h *hostAPI) SearchMemory(_ context.Context, _, _ string, _ int) ([]sdk.MemoryEntry, error) {
return nil, fmt.Errorf("memory search not available in plugin host")
}
func (h *hostAPI) StoreMemory(_ context.Context, _ sdk.MemoryEntry) error {
return fmt.Errorf("memory store not available in plugin host")
}
func (h *hostAPI) Logger() sdk.Logger {
return log.Default()
}
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) PublishEvent(_ context.Context, _ map[string]interface{}) error { return nil }
func (h *hostAPI) HTTPClient() *http.Client {
return http.DefaultClient
}