Repository navigation
Conversation
Lets an agent on this machine drive web pages in the Multiplex app on the user's device. - `mpx bridge` (hidden): started by the app over its own SSH connection; serves `~/.mpx/run/browser-<device>-<install id>.sock` (0700 dir, owner/sticky ancestry checked, peer uid checked on both ends), JSON lines both ways, request `t`/`ttl` stamps and `cancel` for the app's stale-request guard, socket removed on EOF or signal. - `mpx browser …`: open, snapshot (outline with [ref=eN]), click, fill, type, press, select, scroll, wait, eval, console, screenshot (0600 in ~/.mpx/shots), show, close, tabs, status, forward [--open]. `--device` picks among several connected devices; an ambiguous match is an error. - `mpx skill install|print` and a Claude Code plugin (`.claude-plugin/marketplace.json` → `plugin/`), one SKILL.md for both; a test pins the plugin version to the crate's.
CI's newer clippy flags unnecessary_sort_by (live_bridges) and chunks_exact_to_as_chunks (hex_decode, pre-existing on main).
`main` restores SIGPIPE's default so `mpx browser status | head -1` ends quietly. The bridge inherited that. Its stdout is the app's SSH channel, so a pong or an answer written after the channel stopped reading killed the process on the spot: the waiting client saw the socket close without an answer, and the socket file stayed behind. The bridge now ignores SIGPIPE. The write fails, the client is told `disconnected`, and the socket is removed when stdin reaches EOF. A new integration test closes the read end of the bridge's stdout and checks all three; it fails without the change. Confirmed on Linux as well (rust:1-slim-bookworm). README: the example prints `http://localhost:5173/` (the app keeps `localhost` as this machine's), and agent tabs are described as seeing this machine's network rather than "the internet and this machine only", which was the earlier device route.
- `fill e1 -42`, `type -foo`, `eval "-x * 2"`, `select e3 -1`, and `wait --text -5` were refused as unknown flags. Those arguments now allow a leading hyphen; flags around them still parse as flags (new parsing tests). `bridge --device` does too, for a device whose name starts with one. - `--timeout` is clamped to the bridge's own ceiling (600 s). Unclamped, an absurd value overflowed the socket timeout built from it and panicked. - With several devices connected, the stderr note names each with its slug. Two iPads are both "iPad", and the slug is what `--device` can tell apart.
`mpx skill install` is now the one way the skill reaches an agent, and it writes both places agents look: - `~/.agents/skills/multiplex` — the directory Codex and other agents share. - `~/.claude/skills/multiplex` — Claude Code, which reads only its own (under `CLAUDE_CONFIG_DIR` when that is set). `--agent claude|codex` is gone. `--dir <skills dir>` still names another place and now repeats, so `--dir .agents/skills --dir .claude/skills` installs for one project. `--json` prints the outcome as one line (`skill`, `installed`, `failed`) for the Multiplex app, which runs the command over SSH from Host Settings ▸ Agent browser ▸ INSTALL SKILL. The Claude Code plugin and its marketplace manifest are removed. They were a second copy of the same text with its own version to bump, for one agent only. The skill moves from `plugin/skills/` to `skills/`. A skill directory that is a symlink to one written in the same run counts as installed: skill managers link `~/.claude/skills/<name>` to `~/.agents/skills/<name>`, and refusing that would fail every default install on such a machine. A symlink that leads anywhere else is still refused, the other directories are still written, and the command exits 1 naming the one it could not fill.
`--dir` takes a skills directory, so `--dir ~/.claude` wrote `~/.claude/multiplex/SKILL.md` — a file no agent reads, with a success line. An agent's own directory (`.agents`, `.claude`) now stands for the `skills` inside it, which makes a project install `mpx skill install --dir .agents --dir .claude`. Any other path is still used as given.
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
Lets an agent on this machine open and operate web pages in the Multiplex app on the user's device (Vision Pro / iPad / iPhone). Pairs with the app-side PR in multiplex-term/Multiplex (branch
agent-browser).mpx bridge(hidden) — the app starts it over its own SSH connection (a PTY-less login shell, so the host's PATH applies). It serves a unix socket~/.mpx/run/browser-<device>-<install id>.sock; no TCP port, no sshd forwarding.t/ttland acancelis sent on timeout, so an app that was suspended never replays stale clicks.mpx browser …—open,snapshot(outline with[ref=eN]),click,fill,type,press,select,scroll,wait,eval,console,screenshot,show,close,tabs,status,forward <port> [--open].~/.mpx/shots.--device/MPX_BROWSER_DEVICEpicks among connected devices; an ambiguous match is an error. Without it, the newest device wins and stderr says so.mpx skill installwrites themultiplexskill, embedded in the binary fromskills/multiplex/SKILL.md, into both places agents look:~/.agents/skills(Codex and the agents that share it) and~/.claude/skills(Claude Code; underCLAUDE_CONFIG_DIRwhen set).mpx skill printshows it.--dir <skills dir>names another place instead and repeats. An agent's own directory (.agents,.claude) stands for theskillsinside it, so--dir .agents --dir .claudeinstalls for the project you are in.--jsonprints the outcome as one line. The app's Host Settings ▸ Agent browser ▸ INSTALL SKILL runsmpx skill install --jsonover SSH and reads it.~/.claude/skills/<name>to~/.agents/skills/<name>); a symlink to anywhere else is refused.Release note: the app copy says "mpx 0.2 or later", but
Cargo.tomlis still 0.1.2. Bump it at release.Testing
cargo test: 55 unit tests and 12 integration tests, on macOS and on Linux (rust:1-slim-bookworm).tests/browser_bridge.rs: a request round-trip through a real bridge process, the actionable no-device error, same-named devices on separate sockets with SIGTERM socket cleanup, and a bridge whose app stopped reading.tests/skill_install.rs: both default directories under a throwawayHOME,CLAUDE_CONFIG_DIR, repeated--dir,--dir .agents --dir .claude, the JSON line, a directory that cannot be written (exit 1, the other still installed), and noHOME.cargo clippy --all-targetsis clean.