The gateway now exposes a localhost stdlib HTTP API (bridge.py) that
buffers authorized inbound DMs and forwards outbound sends, so a skill
body never opens a WebSocket to the simplex-chat daemon. Endpoints:
GET /health, /contacts, /inbox (peek), /inbox/next (pop oldest unread),
POST /send (resolve id/display name onto the adapter's outbound queue).
GatewayService gains an observer hook and inbox.dispatch (pull-only mode).
Expose the capability to codegen (SKILL.md, BODY_DIRECTIVES, elicitation,
TESTGEN.md) and add the simplex.next_message seed (SemIf recipient
resolution) with its hermetic loopback test. Config: messaging_bridge_url
plus gateway.simplex.{inbox,bridge}; bootstrap keeps them in sync.
23 lines
681 B
Python
23 lines
681 B
Python
"""Messaging gateway: external messenger intake/reply for the SemIf agent.
|
|
|
|
A `GatewayAdapter` owns a transport (SimpleX first), and `GatewayService`
|
|
maps inbound text onto the scheduler's existing gate/score/queue/dispatch
|
|
pipeline and routes results, questions, and repairs back to the originating
|
|
chat. See `base.py` for the contract.
|
|
"""
|
|
|
|
from .base import GatewayAdapter, InboundMessage, OutboundMessage
|
|
from .bridge import MessagingBridge, MessagingInbox, start_bridge
|
|
from .service import GatewayService
|
|
|
|
__all__ = [
|
|
"GatewayAdapter",
|
|
"InboundMessage",
|
|
"OutboundMessage",
|
|
"GatewayService",
|
|
"MessagingBridge",
|
|
"MessagingInbox",
|
|
"start_bridge",
|
|
]
|
|
|