39 lines
972 B
Python
39 lines
972 B
Python
|
|
"""Public contract for the system_notif plugin.
|
||
|
|
|
||
|
|
Exposes only the symbols that other builtins plugins need.
|
||
|
|
Importers should use::
|
||
|
|
|
||
|
|
from app.plugins.builtins.contracts import get_contract
|
||
|
|
sn = get_contract("system_notif")
|
||
|
|
if sn:
|
||
|
|
# use sn.SystemParticipantHandler
|
||
|
|
|
||
|
|
instead of importing from internal modules directly.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from app.plugins.builtins.contracts import get_contract_registry
|
||
|
|
from app.plugins.builtins.system_notif.participant_handler import SystemParticipantHandler
|
||
|
|
|
||
|
|
|
||
|
|
class SystemNotifContract:
|
||
|
|
"""Public API surface for the system_notif plugin."""
|
||
|
|
|
||
|
|
contract_name = "system_notif"
|
||
|
|
|
||
|
|
# ─── participant handler ───
|
||
|
|
SystemParticipantHandler = SystemParticipantHandler
|
||
|
|
|
||
|
|
|
||
|
|
# ─── self-registration ───
|
||
|
|
|
||
|
|
_contract = SystemNotifContract()
|
||
|
|
get_contract_registry().register("system_notif", _contract)
|
||
|
|
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
"SystemNotifContract",
|
||
|
|
"SystemParticipantHandler",
|
||
|
|
]
|