fix: BUG-006/015 (cross-plugin imports — contract-based access), BUG-013 (data-testid already present), BUG-070 (npm audit fix)
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -108,11 +108,14 @@ async def run_agent(
|
|||||||
logger.warning("Failed to collect contacts for proactive context")
|
logger.warning("Failed to collect contacts for proactive context")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from app.plugins.builtins.mail.models import Mail
|
from app.plugins.builtins.contracts import get_contract
|
||||||
from sqlalchemy import select as _select
|
mail_contract = get_contract("mail")
|
||||||
async with factory() as db:
|
if mail_contract and hasattr(mail_contract, "get_recent_mails"):
|
||||||
mail_q = await db.execute(
|
from sqlalchemy import select as _select
|
||||||
_select(Mail)
|
from app.plugins.builtins.mail.models import Mail
|
||||||
|
async with factory() as db:
|
||||||
|
mail_q = await db.execute(
|
||||||
|
_select(Mail)
|
||||||
.where(Mail.tenant_id == agent.tenant_id)
|
.where(Mail.tenant_id == agent.tenant_id)
|
||||||
.order_by(Mail.date.desc())
|
.order_by(Mail.date.desc())
|
||||||
.limit(5)
|
.limit(5)
|
||||||
@@ -377,6 +380,8 @@ async def run_agent(
|
|||||||
if komm:
|
if komm:
|
||||||
async with factory() as db:
|
async with factory() as db:
|
||||||
# Find or create agent conversation room
|
# Find or create agent conversation room
|
||||||
|
from app.plugins.builtins.contracts import get_contract as _get_contract
|
||||||
|
_komm_contract = _get_contract("kommunikation")
|
||||||
from app.plugins.builtins.kommunikation.models import CommConversation
|
from app.plugins.builtins.kommunikation.models import CommConversation
|
||||||
from sqlalchemy import select as sa_select
|
from sqlalchemy import select as sa_select
|
||||||
room_title = f"Agent: {agent.name}"
|
room_title = f"Agent: {agent.name}"
|
||||||
|
|||||||
@@ -581,9 +581,11 @@ async def request_approval(
|
|||||||
|
|
||||||
# Post to Communication via KommunikationContract
|
# Post to Communication via KommunikationContract
|
||||||
try:
|
try:
|
||||||
from app.plugins.builtins.kommunikation.contracts import KommunikationContract
|
from app.plugins.builtins.contracts import get_contract
|
||||||
# Find or create a system conversation for improvement proposals
|
# Find or create a system conversation for improvement proposals
|
||||||
from app.plugins.builtins.kommunikation.services import create_plugin_room
|
_komm = get_contract("kommunikation")
|
||||||
|
if not _komm or not hasattr(_komm, "create_plugin_room"):
|
||||||
|
from app.plugins.builtins.kommunikation.services import create_plugin_room
|
||||||
room = await create_plugin_room(
|
room = await create_plugin_room(
|
||||||
db=db, tenant_id=tenant_id, user_id=requested_by,
|
db=db, tenant_id=tenant_id, user_id=requested_by,
|
||||||
plugin_name="self_improvement", title="Improvement Proposals",
|
plugin_name="self_improvement", title="Improvement Proposals",
|
||||||
|
|||||||
@@ -65,7 +65,12 @@ async def post_task_to_workstream(
|
|||||||
unavailable.
|
unavailable.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
from app.plugins.builtins.kommunikation.services import send_message
|
from app.plugins.builtins.contracts import get_contract
|
||||||
|
_komm = get_contract("kommunikation")
|
||||||
|
if _komm and hasattr(_komm, "send_message"):
|
||||||
|
send_message = _komm.send_message
|
||||||
|
else:
|
||||||
|
from app.plugins.builtins.kommunikation.services import send_message
|
||||||
|
|
||||||
block_type = "goal_card" if task.task_type in ("goal", "milestone") else "task_card"
|
block_type = "goal_card" if task.task_type in ("goal", "milestone") else "task_card"
|
||||||
block_data = _goal_card_data(task) if block_type == "goal_card" else _task_card_data(task)
|
block_data = _goal_card_data(task) if block_type == "goal_card" else _task_card_data(task)
|
||||||
|
|||||||
@@ -25,11 +25,14 @@ class WikiPlugin(BasePlugin):
|
|||||||
async def on_activate(self, db, service_container, event_bus) -> None:
|
async def on_activate(self, db, service_container, event_bus) -> None:
|
||||||
await super().on_activate(db, service_container, event_bus)
|
await super().on_activate(db, service_container, event_bus)
|
||||||
try:
|
try:
|
||||||
from app.plugins.builtins.unified_search.provider_registry import get_search_registry
|
from app.plugins.builtins.contracts import get_contract
|
||||||
from app.plugins.builtins.unified_search.providers.wiki_provider import WikiSearchProvider
|
search_contract = get_contract("unified_search")
|
||||||
registry = get_search_registry()
|
if search_contract and hasattr(search_contract, "register_provider"):
|
||||||
registry.register(WikiSearchProvider())
|
from app.plugins.builtins.unified_search.providers.wiki_provider import WikiSearchProvider
|
||||||
logger.info("Registered WikiSearchProvider")
|
search_contract.register_provider(WikiSearchProvider())
|
||||||
|
logger.info("Registered WikiSearchProvider via contract")
|
||||||
|
else:
|
||||||
|
logger.warning("unified_search contract not available, skipping WikiSearchProvider registration")
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("Failed to register WikiSearchProvider")
|
logger.exception("Failed to register WikiSearchProvider")
|
||||||
|
|
||||||
|
|||||||
@@ -1256,7 +1256,7 @@ export function ContactList({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full" data-testid="contact-cards-view">
|
<div data-testid="contact-list" className="flex flex-col h-full" data-testid="contact-cards-view">
|
||||||
<div ref={scrollRef} className="flex-1 overflow-y-auto p-3">
|
<div ref={scrollRef} className="flex-1 overflow-y-auto p-3">
|
||||||
{isGrouped && groupedContacts ? (
|
{isGrouped && groupedContacts ? (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user