feat(F): F-PROACTIVE consolidate proactive AI — trigger_dispatcher dispatches agents on context/UI events
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-08-17 18:40:41 +02:00
parent 131d761936
commit 06b281ba74
7 changed files with 893 additions and 41 deletions
+19 -2
View File
@@ -76,9 +76,18 @@ class TasksPlugin(BasePlugin):
return {"task": Task}
async def on_activate(self, db, service_container, event_bus) -> None:
"""Activate plugin: register restore config + history hooks."""
"""Activate plugin: register restore config + history hooks + AI tools."""
await super().on_activate(db, service_container, event_bus)
# Register task AI tools (F-TASK-AGENT)
try:
from app.plugins.builtins.ai_assistant.contracts import get_tool_registry
from app.plugins.builtins.tasks.ai_tools import register_task_tools
register_task_tools(get_tool_registry())
except Exception:
import logging
logging.getLogger(__name__).exception("Failed to register task AI tools")
# Register restore config for Task entities (P0-7 fix)
from app.core.restore_registry import RestoreConfig, get_restore_registry
from app.plugins.builtins.tasks.models import Task
@@ -101,7 +110,15 @@ class TasksPlugin(BasePlugin):
async def on_deactivate(
self, db, service_container, event_bus
) -> None:
"""Deactivate plugin: unregister contract, restore, history, events."""
"""Deactivate plugin: unregister contract, restore, history, events, AI tools."""
# Unregister task AI tools (F-TASK-AGENT)
try:
from app.plugins.builtins.ai_assistant.contracts import get_tool_registry
get_tool_registry().unregister_plugin("tasks")
except Exception:
import logging
logging.getLogger(__name__).exception("Failed to unregister task AI tools")
# Contract abmelden
from app.plugins.builtins.contracts import get_contract_registry
get_contract_registry().unregister(self.manifest.name)