feat: H-WIKI-SEARCH — WikiSearchProvider created and registered in wiki/plugin.py on_activate, FTS + vector search on wiki_articles
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
"""Wiki plugin — knowledge articles, categories, versioning (H-WIKI, H-VER)."""
|
||||
"""Wiki plugin — knowledge articles, categories, versioning (H-WIKI, H-VER).""
|
||||
from __future__ import annotations
|
||||
import logging
|
||||
from app.plugins.base import BasePlugin
|
||||
from app.plugins.manifest import FrontendMenuItem, FrontendPageRoute, PluginManifest, PluginRouteDef
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class WikiPlugin(BasePlugin):
|
||||
manifest = PluginManifest(
|
||||
name="wiki",
|
||||
@@ -17,3 +20,15 @@ class WikiPlugin(BasePlugin):
|
||||
menu_items=[FrontendMenuItem(label_key="wiki.menu.wiki", label="Wiki", path="/wiki", icon="BookOpen")],
|
||||
page_routes=[FrontendPageRoute(path="/wiki", component="@/pages/Wiki")],
|
||||
)
|
||||
|
||||
async def on_activate(self, db, service_container, event_bus) -> None:
|
||||
"""Register wiki search provider on activation."""
|
||||
await super().on_activate(db, service_container, event_bus)
|
||||
try:
|
||||
from app.plugins.builtins.unified_search.provider_registry import get_search_registry
|
||||
from app.plugins.builtins.unified_search.providers.wiki_provider import WikiSearchProvider
|
||||
registry = get_search_registry()
|
||||
registry.register(WikiSearchProvider())
|
||||
logger.info("Registered WikiSearchProvider")
|
||||
except Exception:
|
||||
logger.exception("Failed to register WikiSearchProvider")
|
||||
|
||||
Reference in New Issue
Block a user