* fix(phone-host): Teams & swarm view, live terminal kept on a late cancel, chat fixes in the phone screens (1.2.0) - ruflo.teamSnapshot.read: the phone's Teams & swarm screen now works on a ruflo host. Read-only; swarms, hive-mind, agents, tasks and claims from each shared workspace's .claude-flow, plus Claude Code agent teams whose lead works in one. Allowlisted fields: names, statuses, counts, message summaries (280 chars) and task subjects; never tokens, agent prompts or claim notes. - terminal.unsubscribe with a requestId ends only that request's stream, so a late cancel of an older stream no longer stops the phone's live one. - A Claude tab reports its session to the phone only once Claude trusts the folder (its .claude.json) or has written its transcript, so a chat view never covers Claude's first-run trust prompt. - Phone screens rebuilt from ruflo-ui fix/mobile-chat-ux-5211 (98448b90c): agent tabs open in chat once the agent has a session, and the @ file menu narrows as you type. Refs #5211 Co-Authored-By: RuFlo <ruv@ruv.net> * docs(readme): phone connector section with header picture Co-Authored-By: RuFlo <ruv@ruv.net> --------- Co-authored-by: r <r@x>
@claude-flow/phone-host
Opt-in add-on that pairs the RuFlo or Orca phone app with this computer over your LAN or Tailscale, end-to-end encrypted. It needs no desktop app, relay or account. It is not a dependency of ruflo; install it only if you want it:
ruflo phone setup # installs this package into ~/.ruflo/phone-host
ruflo phone daemon start --full # background host; --full allows terminals and agent tabs
ruflo phone pair --full # QR code for one phone
Without ruflo, run it directly: npx @claude-flow/phone-host daemon start, then npx @claude-flow/phone-host pair.
Set up a phone
RuFlo app (ruPro Mobile)
- Install the RuFlo app on the iPhone and sign in to the same Tailscale tailnet as this computer, or join the same Wi-Fi.
- On the computer:
ruflo phone daemon start --full(leave out--fullfor a read-only phone). ruflo phone pair --full --name "My iPhone"prints two QR codes. In the RuFlo app, open its pairing screen and scan the one labelled RuFlo app.- The app opens the host. Open a workspace, tap + for a new tab, and choose a terminal or an agent (Claude, Codex, Copilot, and others installed here).
Orca app
Orca's scanner accepts only Orca links, so scan the QR code labelled Orca app (ruflo phone pair --app orca prints only that one). Everything else is the same as above. The host serves the RuFlo build of the phone screens, which the Orca app accepts because both speak the same runtime protocol (3). If a newer Orca app refuses it, pass --bundle with the mobile-web folder of an Orca desktop install of the matching version.
Either app: paste instead of scanning
Under the QR codes is a pasteable code. Both apps accept it on their pairing screen.
A pairing code is a password for your computer. It expires 10 minutes after it is shown if nobody uses it. Do not paste it into chats, issues or screenshots.
Commands
| Command | What it does |
|---|---|
daemon start [options] |
Starts the host in the background. Its log is daemon.log in the state directory. |
daemon status [--json] |
Shows whether the host is running, its address, whether full access is allowed, and what is shared. |
daemon stop |
Stops the host and closes every terminal a phone opened. |
pair [--full] [--app ruflo|orca|both] [--name <phone>] [--show terminal|window|file] |
Pairs one phone with the running host. In a terminal the QR code prints there. Otherwise it opens as a local page in your browser (window) or is only written (file), and nothing is printed. |
devices [--json] |
Lists paired phones, their access, and when they were last seen. |
revoke <deviceId> |
Unpairs a phone. Within 2 seconds it is disconnected and the terminals it started are closed. |
start [options] |
Foreground host with a prompt (pair, devices, revoke, quit). |
interfaces |
Lists the private addresses you can bind. |
Options:
--full: allow full-access phones.--project <dir>: share a whole repository, every worktree included.--workspace <dir>: share one checkout.--bind <ip>: the address to listen on. The default is your Tailscale address, else the LAN address your computer routes through (not an alias on the same interface).--port <n>: the port. The default is 8792.--bundle <dir>: the phone screens to serve.--state <dir>: the state directory. The default is~/.local/state/ruflo/phone-host.
--project and --workspace can be repeated and mixed. With neither, the current directory's repository is shared.
From an agent (MCP)
ruflo exposes these MCP tools:
phone_statusphone_setupphone_daemon, with actionstart,stoporstatusphone_pairphone_devicesphone_revoke
An agent can start the host and pair a phone, including a full-access phone when the host was started with --full.
phone_pair never returns the pairing code, link or QR text. It opens the QR code as a page on this computer's screen, or writes it to a file there (mode 0600). It returns only the device id, access level, expiry and where the code was shown. The page is deleted when the pairing expires, when the device is revoked, or when the host stops.
What a phone can do
A read-only phone changes nothing on your computer. It can call:
status.get;repo.list,worktree.psandworktree.show, which list only what you chose to share;github.repoSlug, which reads theoriginremote;ruflo.teamSnapshot.read, for the Teams & swarm screen. It reads the ruflo swarms, hive-mind, agents, tasks and claims in each shared workspace's.claude-flow, plus the Claude Code agent teams whose lead works in one. It sends names, statuses and counts, plus short text: the first 280 characters of each recent team message, and each task's subject or description (ruflo task descriptions are cut at 200). It never sends tokens, agent prompts or claim notes;worktree.activate,ui.get,mobileRelay.projectSections,runtime.clientCapabilities.updateandruntime.clientEvents.*. These are the reads the workspace screen makes when it opens.- the
mobileWeb.bundle.*reads that load the app's screens.
Every other method answers method_not_found.
Full access (--full)
A full-access phone can open terminal tabs and agent tabs in a shared workspace. Agent tabs run Claude, Codex, Copilot, Gemini and other installed agent command-line tools. Each tab is a real terminal on this computer, started in that workspace, running as you.
- Access is per phone and needs both sides. The phone must be paired with
--full, and the host must be running with--full. A host without--fullnever serves these methods. - A workspace is a starting directory, not a sandbox. Once a shell is open, the phone can run anything you can.
- Agents come from a fixed table. The phone sends an agent id, and the command line is looked up here, never taken from the phone. The new-tab menu lists only agents found on
PATH. One exception: a quick command can start Claude or Codex with a prompt. The prompt is never typed into the shell: it is passed in the terminal's environment and expanded as one argument after the fixed command, so the shell never runs it and the agent never reads it as an option. - Every terminal is logged when it starts and ends: at the prompt for
start, or indaemon.log. Revoking a phone closes its terminals. - Chat view for Claude Code and Codex tabs. The phone can show an agent tab as a chat as well as a terminal. The host starts Claude with a session id it chooses. For Codex, it finds the session log that Codex creates at the first prompt in that workspace. The phone then reads the conversation through
nativeChat.readSession,nativeChat.subscribeandnativeChat.unsubscribe. It can only read sessions this host started, and only from Claude'sprojectsfolder and Codex'ssessionsfolder. A file path sent by the phone is ignored. Long tool output is shortened, and inline images are left out. - Working state and Stop. The host reads each Claude or Codex transcript as it grows. A tab shows as working from the prompt until the turn ends, and the chat view then offers Stop. Stop sends Escape twice, which interrupts both agents; the tab then shows as done and interrupted. When the agent is no longer running in the tab, the tab shows as done. A permission or question prompt still shows as working, because the transcript does not record it.
- @-file picker and Files tab.
files.searchPathsandfiles.listlist the workspace's files fromgit ls-files, so ignored folders such asnode_modulesstay out.files.readDirlists one folder, refuses.., absolute paths and.git, and never follows a link out of the workspace. They return names only, never file contents. - Quick commands.
settings.getTerminalQuickCommandsandsettings.updateTerminalQuickCommandskeep the quick commands sheet inquick-commands.json(mode 0600) in the host's state folder, with Orca's limits: 40 commands, a 4,000-character command, a 6,000-character prompt. - Tab rename and display mode.
terminal.renamerenames a tab for every phone.terminal.setDisplayModewithdesktopkeeps the terminal's size when the phone resizes;autolets the phone size it again. - Terminals need
@lydell/node-pty, an optional dependency (prebuilt, about 100 KB). Without it,--fullstops with a clear error, and the read-only host still works.
Host screens
The app draws its host screens from a web bundle that the host serves. This package ships the RuFlo build in bundle/: about 15 MB unpacked, built from cognitum-one/ruflo-ui fix/mobile-chat-ux-5211 (98448b90c, Orca 98e7dbec). That is phone/mobile-lanes-merged-20261130 (ef1e43563) plus two chat fixes. A tab set to chat waits in the terminal until its agent has a session, so a first-run prompt stays visible; with no stored choice, chat is the default. And the @ file menu narrows as you type. It is used by default.
Every asset is checked against the manifest's SHA-256 before it is sent.
Security
- Network: the host listens on one private IPv4 address assigned to this computer: 10/8, 172.16/12, 192.168/16, 100.64/10 (Tailscale) or 127/8. It never listens on a wildcard or a public address. It accepts only a WebSocket upgrade to
GET /mobile. - Encryption: it uses Orca's mobile E2EE v2 (X25519, HKDF-SHA256, XSalsa20-Poly1305 with per-direction counters).
- The phone pins the host key from the pairing code.
- The host refuses a legacy or relay hello.
- It closes a connection that hasn't authenticated after 10 s, and after 5 frames that fail to decrypt.
- Credentials:
- Each phone gets its own random token. Only its SHA-256 is stored, compared in constant time.
- An unused pairing expires after 10 minutes.
- The code is printed only to an interactive terminal. Otherwise it goes to a 0600 page on this computer, never to a program's output.
- Agents: any agent with
ruflo's MCP tools can pair a phone. That includes a full-access phone when the host runs with--full. Run the host with--fullonly while you want that. Checkruflo phone devicesand revoke phones you don't recognise. - State: the host key, device list, daemon record and log are kept in the state directory (0700, files 0600).
Test
npm test
The tests drive the host with Orca's own phone-side E2EE v2 client (test/fixtures/orca-e2ee-v2.mjs), with real terminals and a real background daemon. They prove the protocol, not the phone's screens.
Ported code: see NOTICE (Orca, MIT).