feat(matrix): Matrix chat integration surface — bridge, wormhole, shell commands - #52
Merged
Conversation
…ll commands
turtle-matrix-bridge binary:
- Daemon tails memory-mesh JSONL and forwards shell events to a Matrix room
(cloudshell-connect, k3s-tunnel-start, split-view, error-triage, note-saved,
runbook-run forwarded by default — configurable via MATRIX_BRIDGE_EVENTS)
- `send <text>` — post plain text to default room
- `send-file <path>` — post file as a syntax-highlighted code block
- `wormhole-send <path>` — start magic-wormhole send, post the wormhole code
to the room so any recipient can receive it
- `wormhole-recv <code>` — receive a wormhole transfer, post result to room
- `status` — homeserver connectivity + wormhole binary check
Config: ~/.config/sourceos/matrix.yaml or MATRIX_* env vars
Shell surface (turtle-shell-init.zsh):
- `mx <msg>` post message to Matrix room
- `mxf <file>` post file as code block
- `mxw <file>` wormhole-send + post code to room (CMD+SHIFT+ALT+W)
- `mxr <code>` wormhole-recv + post result to room
- `mxstatus` show bridge config + connectivity
- Daemon auto-started at shell init if matrix.yaml or MATRIX_ACCESS_TOKEN present
- CMD+SHIFT+ALT+M → `mx ` (compose message prefix)
Palette (turtleterm.lua):
- Matrix: send message, send file, wormhole send, bridge status
- CMD+SHIFT+ALT+M / CMD+SHIFT+ALT+W keybindings
Dashboard (turtle-mesh-serve):
- Matrix badge in status bar: green=bridge daemon alive, red=off
- matrix_bridge_up in gather_state() via PID file liveness check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TurtleTerm as a first-class integration surface for Matrix chat — mesh events flow into rooms, shell output can be shared directly, and magic-wormhole enables one-shot encrypted file transfer without pre-shared secrets.
New:
turtle-matrix-bridgeturtle-matrix-bridge daemon <room>mx <message>mxf <file>mxw <file>mxr <code>mxstatusMagic Wormhole
mxw/mxruse the systemwormholeorwormhole-williambinary (MIT). No pre-shared secrets — PAKE-based one-time code (7-coconut-harbor-storm). The receive code is posted back to the Matrix thread so any room member can runwormhole receive <code>or!qes wormhole recv <code>from their own session.Forwarded mesh events (default)
cloudshell-connect·k3s-tunnel-start·split-view·error-triage·note-saved·runbook-runConfigurable via
MATRIX_BRIDGE_EVENTSenv var or~/.config/sourceos/matrix.yaml.Keybindings
CMD+SHIFT+ALT+Mmx(compose message prefix in terminal)CMD+SHIFT+ALT+Wmxw(wormhole-send prefix)Dashboard
New Matrix badge in the status bar — green when the bridge daemon PID is alive, red otherwise.
Config
~/.config/sourceos/matrix.yaml:Companion PRs
matrix-qes-operatorshell dispatch verbs (!qes cloudshell,!qes k3s,!qes runbook,!qes noe,!qes wormhole)matrix-shell-integrationappservice receiver + homeserver clientTest plan
mxstatus— shows config; reports wormhole binary found/missingmx "hello from TurtleTerm"— message appears in Matrix roommxf ~/.zshrc— zshrc posted as code block with syntax highlightmxw /tmp/testfile.txt— wormhole code printed + posted to roommxr <code>— file received, result posted to roomcsh→ Matrix room gets🔗 Cloudshell connectedeventktunnel start→ Matrix room gets🚇 k3s tunnel openevent