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
This commit is contained in:
Denton Social committed 2026-09-28 15:24:44 -05:00
1 parent d46fbdca19
commit ddc5cb66c8
31 files changed
+1702 -1088

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
[Unit]
Description=SemIf agent third-party API bridges (SimpleX forwarding)
After=network-online.target semif-simplex-forward.service
Wants=network-online.target semif-simplex-forward.service
[Service]
Type=simple
WorkingDirectory=@REPO@
Environment=HF_HOME=@REPO@/.runtime/hf
Environment=PYTHONUNBUFFERED=1
ExecStart=@REPO@/.runtime/venv/bin/python -m semif_agent.cli bridge
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=semif-bridge
[Install]
WantedBy=default.target
@@ -0,0 +1,21 @@
[Unit]
Description=SemIf agent SimpleX forwarding bridge daemon
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
# The forwarding bridge owns its OWN simplex-chat profile (separate from the
# command gateway's bot), so messaging UX never shares the command identity.
# Bot mode + a PTY are required for the same reason as semif-simplex.service:
# --headless means "chat relay" in v7, and the CLI only pumps WebSocket events
# with a controlling terminal.
ExecStart=/usr/bin/script -q -e -c "@REPO@/.runtime/bin/simplex-chat -p @FORWARD_PORT@ -d @REPO@/.runtime/simplex-forward/simplex_v1 -k '' --create-bot-display-name '@FORWARD_DISPLAY@'" /dev/null
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=semif-simplex-forward
[Install]
WantedBy=default.target