package plugin import ( "context" "connectrpc.com/connect" "git.dev.alexdunmow.com/ninja/core/ai" "git.dev.alexdunmow.com/ninja/core/content" "git.dev.alexdunmow.com/ninja/core/crypto" "git.dev.alexdunmow.com/ninja/core/gating" "git.dev.alexdunmow.com/ninja/core/settings" ) // ServiceDeps provides dependencies that plugins need for RPC service handlers. type ServiceDeps struct { // Capability interfaces — typed access to CMS functionality Content content.Content Settings settings.Settings Gating gating.Gating Crypto crypto.Crypto // Database — for plugin's own sqlc queries Pool Pool // RPC interceptors — core-provided Connect handler options Interceptors connect.Option // Site configuration MediaPath string AppURL string // AI ToolRegistry ai.ToolRegistry AITextCall func(ctx context.Context, taskKey, systemPrompt, userMessage string) (string, error) // Email EmailSender EmailSender // Extension points — typed as narrow interfaces where possible JobRunner JobRunner EmbeddingService EmbeddingService RAGService RAGService } // JobRunner submits background jobs for async processing. type JobRunner interface { Submit(ctx context.Context, jobType string, config []byte) error } // EmbeddingService generates and manages text embeddings. type EmbeddingService interface { GenerateEmbedding(ctx context.Context, text string) ([]float32, error) } // RAGService provides retrieval-augmented generation for AI agents. type RAGService interface { Query(ctx context.Context, query string, limit int) ([]RAGResult, error) } // RAGResult is a single result from a RAG query. type RAGResult struct { Content string Score float64 Metadata map[string]string }