Files
semif-agent/semif_agent/bridges/__init__.py
T
Denton Social ddc5cb66c8 bridges: standalone third-party API bridges; isolate the command gateway
Split messaging UX (invite links, read, send) out of the command gateway into a
new `semif_agent.bridges` layer. Each bridge is its own process (`cli bridge`)
against its own service daemon/profile; the SimpleX bridge owns a second
simplex-chat daemon and buffers every inbound DM, so a message sent to the
connect-link address shows up in `simplex.next_message`.

- new: bridges/{base,inbox,registry,simplex}.py + neutral semif_agent/simplex_ws.py
- gateway: delete bridge.py; drop address/observer/pull-mode from the command path
- codegen: inject the bridge catalog (describe_bridges) into body + elicitation prompts
- seeds: repoint simplex.next_message/connect_link to top-level `simplex_bridge_url`
- config/bootstrap: new top-level `bridges` block + `simplex_bridge_url`; render
  semif-simplex-forward + semif-bridge units; gateway config loses bridge/inbox
- docs: AGENTS.md gateway isolation is non-negotiable
2026-09-28 15:24:44 -05:00

39 lines
1.3 KiB
Python

"""Third-party API bridges: a secure local layer between skills and services.
A **bridge service** is a standalone process that exposes one third-party system
(SimpleX first, more later) to codegen-authored skill bodies over a local,
token-guarded HTTP API. It exists so a generated body never speaks a system's
native protocol (WebSocket, SMTP, CalDAV, a CLI's private flags) directly: it
calls a small, documented, uniform HTTP surface instead, and the bridge owns the
messy integration details and credentials.
Two boundaries matter:
- **Bridges are not the gateway.** The command gateway only takes commands and
replies; it must never grow read/send/invite endpoints. Bridges run as their
own processes (`python -m semif_agent.cli bridge`) against their own service
daemons/profiles. This isolation is non-negotiable (see AGENTS.md).
- **The catalog is visible to codegen.** `describe_bridges()` is injected into
the code-generation prompts so the model knows which real services it may
build against and how to reach them.
"""
from .base import BridgeInfo, BridgeService
from .inbox import MessagingInbox
from .registry import (
build_bridge,
describe_bridges,
known_infos,
run_bridges,
)
__all__ = [
"BridgeInfo",
"BridgeService",
"MessagingInbox",
"build_bridge",
"describe_bridges",
"known_infos",
"run_bridges",
]