diff --git a/plugin/deps.go b/plugin/deps.go index 0380848..2ccefb6 100644 --- a/plugin/deps.go +++ b/plugin/deps.go @@ -12,6 +12,7 @@ import ( "git.dev.alexdunmow.com/block/core/menus" "git.dev.alexdunmow.com/block/core/settings" "git.dev.alexdunmow.com/block/core/subscriptions" + "github.com/google/uuid" ) // ServiceDeps provides dependencies that plugins need for RPC service handlers. @@ -59,11 +60,19 @@ type JobRunner interface { // EmbeddingService generates and manages text embeddings. type EmbeddingService interface { GenerateEmbedding(ctx context.Context, text string) ([]float32, error) + EmbedContent(ctx context.Context, sourceType string, sourceID uuid.UUID, text string) (bool, error) + IsAvailable() bool } +// ContentFetcher retrieves the title and full text for a content item so the +// RAG service can re-index it after changes. Plugins register one per content type. +type ContentFetcher func(ctx context.Context, contentID uuid.UUID) (title string, text string, err error) + // RAGService provides retrieval-augmented generation for AI agents. type RAGService interface { Query(ctx context.Context, query string, limit int) ([]RAGResult, error) + RegisterContentFetcher(contentType string, fetcher ContentFetcher) + OnContentChanged(ctx context.Context, contentType string, contentID uuid.UUID) } // RAGResult is a single result from a RAG query.