feat: Unified Messaging System — kommunikation plugin, AI/Proactive/System participants, MessageSidebar, Rich Content Renderer
Phase 1: Backend plugin kommunikation (13 files, 10 tables, REST API, WebSocket, RBAC, DMS Bridge, Participant Registry, Mini-App Registry, Search Provider) Phase 2: AI plugins as participants (ai_assistant + ai_proactive dock as participants, heartbeat job) Phase 3: system_notif plugin (system events → chat messages, pinned System room) Phase 4: Frontend MessageSidebar (replaces AISidebar, same design, comm API client, WebSocket hook, commStore) Phase 5: Rich Content Block Renderer (11 components: Markdown, HTML, Image, Audio, Video, File, ActionCard, ContactCard, MiniApp, BlockRenderer) BasePlugin: added services property + _container in on_activate
This commit is contained in:
@@ -45,8 +45,12 @@ class AIProactivePlugin(BasePlugin):
|
||||
is_core=False,
|
||||
)
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._proactive_handler = None
|
||||
|
||||
async def on_activate(self, db, service_container, event_bus) -> None:
|
||||
"""Register context tools and subscribe to events."""
|
||||
"""Register context tools, subscribe to events, and register as participant."""
|
||||
await super().on_activate(db, service_container, event_bus)
|
||||
try:
|
||||
from app.plugins.builtins.ai_proactive.context_tools import (
|
||||
@@ -61,8 +65,36 @@ class AIProactivePlugin(BasePlugin):
|
||||
except Exception:
|
||||
logger.exception("Failed to register AI Proactive context tools")
|
||||
|
||||
# Register as participant in the kommunikation system
|
||||
try:
|
||||
from app.plugins.builtins.ai_proactive.participant_handler import (
|
||||
AIProactiveParticipantHandler,
|
||||
)
|
||||
from app.plugins.builtins.kommunikation.participant_registry import (
|
||||
get_participant_registry,
|
||||
)
|
||||
|
||||
self._proactive_handler = AIProactiveParticipantHandler(service_container)
|
||||
get_participant_registry().register("ai_proactive", self._proactive_handler)
|
||||
logger.info("AI Proactive registered as participant 'ai_proactive'")
|
||||
except Exception:
|
||||
logger.exception("Failed to register AI Proactive as participant")
|
||||
|
||||
async def on_deactivate(self, db, service_container, event_bus) -> None:
|
||||
"""Unregister tools and event listeners."""
|
||||
"""Unregister tools, event listeners, and participant."""
|
||||
# Unregister from participant registry
|
||||
try:
|
||||
from app.plugins.builtins.kommunikation.participant_registry import (
|
||||
get_participant_registry,
|
||||
)
|
||||
|
||||
get_participant_registry().unregister("ai_proactive")
|
||||
logger.info("AI Proactive unregistered as participant 'ai_proactive'")
|
||||
except Exception:
|
||||
logger.exception("Failed to unregister AI Proactive as participant")
|
||||
|
||||
self._proactive_handler = None
|
||||
|
||||
try:
|
||||
from app.plugins.builtins.ai_assistant.tool_registry import (
|
||||
get_tool_registry,
|
||||
|
||||
Reference in New Issue
Block a user