- plugin/types.go: Pool, EmailSender, JobHandlerFunc, Dependency, AdminPage, AIAction, MasterPageDefinition, status/source constants, MediaAnalyzedEvent, ModerationDecisionEvent, MediaHooksProvider, DirectoryExtensions - plugin/deps.go: ServiceDeps with typed capability interfaces (Content, Settings, Gating, Crypto, ToolRegistry, JobRunner, EmbeddingService, RAGService) - plugin/registration.go: PluginRegistration, RegisterFunc - plugin/service.go: ConnectServiceBinding with generics, ServiceMount, ServiceRegistration - plugin/provisioner.go: Provisioner interface with all config types - plugin/css_manifest.go: CSSManifest, MergedCSSManifest, MergeCSSManifests - plugin/version.go: ParseModVersion, CompareVersions - plugin/topo_sort.go: TopologicalSort (Kahn's algorithm) - plugin/block_registry.go: PluginBlockRegistry (auto-prefixing wrapper) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.3 KiB
Go
45 lines
1.3 KiB
Go
package plugin
|
|
|
|
import (
|
|
"io/fs"
|
|
"net/http"
|
|
|
|
"git.dev.alexdunmow.com/ninja/core/blocks"
|
|
"git.dev.alexdunmow.com/ninja/core/templates"
|
|
)
|
|
|
|
// RegisterFunc is the function signature for plugin registration.
|
|
// Plugins register their templates and blocks through the provided registries.
|
|
type RegisterFunc func(tr templates.TemplateRegistry, br blocks.BlockRegistry) error
|
|
|
|
// PluginRegistration defines a compiled-in plugin's entry points.
|
|
type PluginRegistration struct {
|
|
Name string
|
|
|
|
Register RegisterFunc
|
|
RegisterWithProvisioner func(tr templates.TemplateRegistry, br blocks.BlockRegistry, p Provisioner) error
|
|
|
|
Assets func() http.Handler
|
|
Schemas func() fs.FS
|
|
SettingsSchema func() []byte
|
|
ThemePresets func() []byte
|
|
BundledFonts func() []byte
|
|
MasterPages func() []MasterPageDefinition
|
|
|
|
HTTPHandler func(deps ServiceDeps) http.Handler
|
|
SettingsPanel func() string
|
|
AdminPages func() []AdminPage
|
|
|
|
CSSManifest func() *CSSManifest
|
|
ServiceHandlers func(deps ServiceDeps) (*ServiceRegistration, error)
|
|
JobHandlers func(deps ServiceDeps) map[string]JobHandlerFunc
|
|
AIActions func() []AIAction
|
|
|
|
DirectoryExtensions func() *DirectoryExtensions
|
|
MediaHooks MediaHooksProvider
|
|
|
|
Dependencies []Dependency
|
|
Migrations func() fs.FS
|
|
Version string
|
|
}
|