handmux 0.26.0 → 0.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +20 -93
  2. package/README.zh-CN.md +20 -93
  3. package/dist/package.json +19 -19
  4. package/dist/public/assets/index-B4pKf3IW.js +356 -0
  5. package/dist/public/assets/index-Cdrh2CUp.css +32 -0
  6. package/dist/public/assets/pcm-worklet-NzlBQ6-t.js +1 -0
  7. package/dist/public/index.html +2 -2
  8. package/dist/src/agent-runtime/adapter.js +2 -0
  9. package/dist/src/agent-runtime/builtinRuntime.js +3 -1
  10. package/dist/src/agent-runtime/conversationActivation.js +136 -4
  11. package/dist/src/agent-runtime/run.js +23 -2
  12. package/dist/src/agent-runtime/runtime.js +174 -15
  13. package/dist/src/agent-runtime/tmuxRuntime.js +3 -7
  14. package/dist/src/agents/codex.js +78 -10
  15. package/dist/src/agents/codexActivationReceipt.js +149 -0
  16. package/dist/src/agents/codexConversation.js +59 -20
  17. package/dist/src/agents/codexConversationActivation.js +265 -65
  18. package/dist/src/agents/codexOpenSession.js +164 -0
  19. package/dist/src/agents/nativeInbox.js +24 -56
  20. package/dist/src/agents/scanUtils.js +7 -1
  21. package/dist/src/apiErrors.js +10 -1
  22. package/dist/src/asr/config.js +29 -0
  23. package/dist/src/asr/providerRegistry.js +19 -0
  24. package/dist/src/asr/providers/tencent.js +135 -0
  25. package/dist/src/asr/providers/xfyun.js +73 -0
  26. package/dist/src/asr/tencentSentence.js +111 -0
  27. package/dist/src/asr/tencentSign.js +20 -0
  28. package/dist/src/asr/verify.js +80 -0
  29. package/dist/src/cli/codexManaged.js +13 -2
  30. package/dist/src/cli/i18n/en.js +16 -1
  31. package/dist/src/cli/i18n/zh.js +16 -1
  32. package/dist/src/cli/options.js +29 -2
  33. package/dist/src/cli/setupModel.js +49 -5
  34. package/dist/src/cli/setupWizard.js +149 -29
  35. package/dist/src/cli/supervisor.js +24 -8
  36. package/dist/src/cli/supervisorLaunch.js +26 -0
  37. package/dist/src/codexAppServer.js +41 -4
  38. package/dist/src/routes/agents.js +51 -14
  39. package/dist/src/routes/system.js +109 -10
  40. package/dist/src/server.js +11 -2
  41. package/dist/src/terminalStream.js +8 -30
  42. package/dist/src/tmux/commands.js +14 -0
  43. package/dist/src/tmux/controlProtocol.js +26 -0
  44. package/dist/src/tmux/paneOutputCapture.js +180 -0
  45. package/package.json +5 -5
  46. package/dist/public/assets/index-BVFKs5dN.css +0 -32
  47. package/dist/public/assets/index-KDa5PCoi.js +0 -356
  48. package/dist/public/assets/pcm-worklet-CxcDy7PB.js +0 -1
package/README.md CHANGED
@@ -8,12 +8,12 @@
8
8
  <a href="https://www.npmjs.com/package/handmux"><img src="https://img.shields.io/npm/v/handmux?color=cb3837&logo=npm" alt="npm"></a>
9
9
  <a href="https://github.com/handmux/handmux/actions/workflows/test.yml"><img src="https://github.com/handmux/handmux/actions/workflows/test.yml/badge.svg" alt="CI"></a>
10
10
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-blue" alt="license: AGPL-3.0"></a>
11
- <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white" alt="node"></a>
11
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%E2%89%A522.16-339933?logo=node.js&logoColor=white" alt="node"></a>
12
12
  </p>
13
13
 
14
14
  > **One phone, a whole mobile vibe-coding cockpit.** Built on tmux — one command on your computer, scan a QR, and your live session, Claude Code, Codex, git, previews and docs are all in your hand, creativity ready wherever you are.
15
15
 
16
- handmux is more than a terminal on your phone. It puts the *same* live **tmux** session running on your computer into your phone's browser (real panes, not a read-only mirror), then builds a whole **mobile vibe-coding cockpit** around it: **Claude Code / Codex** push you the moment a pane needs a decision — approve with your thumb, or fire off a new instruction by voice; browse a full-screen colored **git** diff; **preview** a running site in one tap; hear a **doc** read aloud line by line; move files both ways. Nothing to install on the phone — open a link and you're in; "Add to Home Screen" and it runs full-screen as a **PWA**, basically a native app. Curl up on the couch or squeeze onto the train — the vibe coding never stops, your creativity stays in hand.
16
+ handmux puts the *same live tmux workspace* from your computer in any phone or desktop browser. Keep coding with Claude Code, Codex, Pi, or any terminal tool; review changes, answer prompts, preview apps, and move files without starting a separate remote session. It is self-hosted, open-source, and needs no phone app or handmux account.
17
17
 
18
18
  <p align="center">
19
19
  <img src="assets/handmux-run.gif" alt="handmux: say what you need, Claude Code writes it, then tap the filename to preview the result" width="280">
@@ -59,113 +59,40 @@ handmux start --tunnel cloudflare # instant public URL (cloudflared auto-insta
59
59
 
60
60
  ## Why handmux
61
61
 
62
- - **🧰 More than a terminal — a whole mobile vibe-coding cockpit in your pocket.** Full-screen colored git diffs, one-tap preview of a running site, docs read aloud line by line, files moved both ways — a whole dev kit in hand, no hopping between apps.
63
- - **🚀 One minute from zero to coding on your phone.** One `handmux start`, one scan, done no sign-up, no App Store, no app to sideload; just a link. "Add to Home Screen" and it's a full-screen **PWA**, as smooth as a native app.
64
- - **🧶 Walk away, keep working.** Your phone drives the *one* live tmux pane on your desk (not a new shell, not a screenshot). Close the laptop and keep watching from your thumb — exact same state.
65
- - **🔔 When it needs you, your phone rings.** Claude Code / Codex push the moment they need a decision; add it to your home screen and they come through as system notifications. An inbox tags each pane working / needs-you / done / error — many projects at a glance — while the host keeps terminal-result reads consistent across refreshes and devices. Open a completed item to start at the final completed AI answer in the authoritative latest tail. Claude Hook outcomes queue locally while the Server is offline and replay in session order after it returns. Approve permissions and plans with a tap, so you stop babysitting the screen.
66
- - **🔒 Your code goes through no middleman.** Free and fully open-source; we run no server in the middle — your data travels straight between your computer and your phone, so it stays secure.
62
+ - **🧶 One workspace, everywhere.** Your phone drives the real tmux panes already running on your computernot a screenshot or a separate cloud session.
63
+ - **🔔 Stop babysitting agents.** See which panes are working or waiting, get notified when you are needed, and approve from your phone.
64
+ - **🧰 A complete coding cockpit.** Terminal, Agent conversations, Git, previews, docs, files, usage, and idea capture stay together.
65
+ - **🔒 Self-hosted by design.** Your browser connects to your computer; handmux runs no account service or relay in between.
67
66
 
68
67
  ## Features
69
68
 
70
- - **Claude Code / Codex, deeply** — an inbox status ledger, thumb-approve permissions & plans, and stable host-wide subscription usage shared by every connected device; each visible provider can refresh its latest limits from the card action menu, while keeping the previous values visible if that provider cannot be reached. Codex also shows the current account and plan, separate account/model limits, remaining rate-limit resets, and each provided expiry. The same Usage screen can save multiple DeepSeek and Moonshot (Kimi) API accounts encrypted at rest within the Handmux computer's local trust boundary; full API Keys never return to browsers.
71
- - **Chat view** — drive Codex CLI through App Server with streaming Markdown bubbles, tool cards, native Goal lifecycle cards, and session status; the context-ring details show the absolute Git worktree root path and branch that contain the thread `cwd`. Setting or restarting a Goal creates a fresh active native Goal, immediately shows its user-side card on the right, and starts Codex's built-in continuation. An active or paused Goal stays beneath the live read-only turn task list, Codex terminal feedback stays with its originating turn on the left, and every entry opens the same Bottom Sheet. The current Goal uses one equal-width iOS-style action row; clearing it removes the resident Goal and closes the sheet, while its historical chat card remains. The current terminal Goal can be edited before restarting. Long replies hold at their beginning for reading, with an explicit jump back to the latest output. Existing panes can switch in place. Every sendable Agent uses the same persistent server queue: queued messages can be viewed, edited or deleted and are delivered automatically; Guide now appears only when that Agent supports steering. Failed sends stay visible and retry under the same request ID. If delivery remains unknown after reconciliation, the message returns to the conversation and you choose whether to send it again as new, with a clear duplicate-delivery warning. On desktop, <kbd>Shift</kbd>+<kbd>Enter</kbd> focuses the composer or inserts a newline when already focused, <kbd>Enter</kbd> sends, and <kbd>Esc</kbd> releases focus without stopping the Agent. Codex chat is stable; Claude Code and Pi chat are independently enabled experimental options.
72
- - **Real-time terminal + desktop keyboard** — stream the same tmux pane on phone and desktop with scrollback, weak-network fallback, direct physical-keyboard input, and native copy/paste.
73
- - **Command & chat modes** — switch between direct terminal input and natural-language agent chat, with direct Alt and Space keys on the mobile command keyboard and a customizable quick bar that stays in sync across devices.
74
- - **Client reload after updates** — once the server update has finished, use Settings → Reload app to load the new client without quitting and reopening the home-screen app.
75
- - **Script push** — notify your phone from any script or CI step with `handmux push`; target all devices, a named session, or a specific device.
76
- - **Workspace recovery** — handmux keeps the metadata needed to restore your latest tmux workspace after a computer or tmux-server restart, without replacing existing sessions.
77
- - **Git viewer** — changes / commit history / any branch / full-screen colored diff, multi-repo tabs, read-only, never touches your tree.
78
- - **Web Preview for URLs and static folders** preview URLs by phone or computer proxy, or open an isolated static folder, with narrow/wide page widths and zoom; computer proxy can also request a mobile or desktop site version. It embeds pages rather than replacing a full browser.
79
- - **Docs** — tap recognized text-file paths in the terminal or Agent tool input/output to open them, regardless of extension; user-home paths appear as `~/…`, while ordinary slash-separated prose stays plain. Markdown rendered, font zoom, sentence-by-sentence read-aloud. Binary files stay download-only.
80
- - **Mobile select & copy** — long-press text in either the terminal or an Agent conversation, drag iOS-style handles to fine-tune, then copy the exact selection, its rendered line, or its semantic paragraph.
81
- - **Files both ways** — multi-select upload from the chat box (including ZIP archives), download, share in, copy any absolute path.
82
- - **Ideas — catch every one** — a thought the moment it strikes: a per-window idea/to-do list, jot one by voice and drop it straight into the prompt.
83
- - **Built for flaky networks** — backoff reconnect, connection-lost banner, offline page, polling that pauses in the background; a reflow-safe cursor.
84
- - **Zero-install PWA** — runs full-screen from your home screen, with English, 简体 / 繁體中文, 日本語, and 한국어.
69
+ - **Live terminal** — use the same tmux pane from phone and desktop, with history, physical-keyboard input, and native copy/paste.
70
+ - **Agent conversations** — work with Codex in a streaming chat view; optional Claude Code and Pi integrations bring the same workspace into their supported conversation flows.
71
+ - **Inbox and approvals** — follow multiple panes, receive push notifications, and answer permission or plan prompts remotely.
72
+ - **Git and previews** — review repositories and open running sites, intranet pages, or static folders from the browser.
73
+ - **Docs and files** — open readable files, listen to documents, and upload, download, or share files in either direction.
74
+ - **Ideas and voice** — keep notes per window and dictate text through supported iFlytek or Tencent recognition modes.
75
+ - **Usage at a glance** — view supported Agent subscription limits and configured API-provider balances without exposing full keys to the browser.
76
+ - **Resilient sessions** — reconnect across weak networks and restore saved tmux workspace structure after a restart.
77
+ - **Script push** send a notification to your phone from local scripts or CI with `handmux push`.
78
+ - **Zero-install PWA** — add it to your home screen for a full-screen experience in English, Chinese, Japanese, or Korean.
85
79
 
86
80
  ## Agent integration
87
81
 
88
- Use `handmux <agent> [args...]` to start a supported Agent; every argument after the Agent name is passed through unchanged. Use the separate `handmux agent` namespace to enable or inspect Handmux integration. Codex support is built in, while Pi and Claude Code are explicitly enabled:
82
+ Codex integration is built in. Pi and Claude Code integration are optional:
89
83
 
90
84
  ```bash
91
85
  handmux codex [args...]
92
86
  handmux pi [args...]
93
-
94
- handmux agent # list Agent integration status
95
87
  handmux agent enable pi
96
- handmux agent status pi
97
- handmux agent disable pi
98
-
99
88
  handmux agent enable claude
100
- handmux agent status claude
101
- handmux agent disable claude
102
- handmux agent status codex # ready (built-in) when Codex is installed
103
89
  ```
104
90
 
105
- The legacy `handmux hooks install|uninstall` commands remain compatibility aliases for Claude Code. Pi integration uses a trusted Handmux-owned Extension wrapper for the same native Pi TUI process; enabling it writes only that wrapper under Pi's documented global extension directory and never scans projects or loads third-party extensions. Open a new Pi session, or run `/reload` in Pi, after enabling or disabling it. The wrapper is refreshed automatically across Handmux upgrades and gives each Connector build a content-fingerprinted import URL, so `/reload` cannot reuse the previous build from the module cache; a file not marked as Handmux-owned is never overwritten or deleted. Pi keeps working normally when the Handmux server is offline; terminal outcomes are queued locally and delivered after it returns. In Pi chat, the shared context ring reads Pi's live context-window usage, activity and working directory; reload an already-running Pi session after upgrading Handmux to expose newly added Connector capabilities.
106
-
107
- The capability-driven Agent chat downloads attachments only after a tap. Providers register an opaque, session-bound resource ID; the app never receives a local path, and potentially active content such as HTML or SVG is always downloaded rather than rendered inline.
108
-
109
- ## Workspace recovery
110
-
111
- handmux continuously maintains two redundant copies of the latest workspace metadata. They are not browsing history: ordinary changes and deletions handmux can confirm simply update the current state. A selectable checkpoint is archived only when the computer or tmux environment changes. If the final tmux session disappears outside handmux, tmux cannot distinguish an intentional deletion from a crash, so handmux retains the last state and can offer recovery immediately, without waiting for a new tmux server or session. Every checkpoint from the latest 24 hours is kept; older history is then trimmed to the newest 10, while the latest valid checkpoint never expires just because of age.
112
-
113
- After such a restart, the phone shows **Restore last workspace** for one hour when a checkpoint has work left to restore; if tmux has no sessions it opens the confirmation directly. Choosing **Ignore this backup** suppresses that checkpoint only on that phone; an ordinary close does not. When recovery finishes, the phone reports the actual sessions, windows, and panes restored, but does not automatically open or bind them; choose **Bind restored sessions** if you want them on that phone. The CLI remains available after the phone prompt expires:
114
-
115
- ```bash
116
- handmux restore --dry-run # preview the latest plan
117
- handmux restore # restore; TTY picker, otherwise latest
118
- handmux restore --list # list retained checkpoints
119
- handmux restore --checkpoint <id> --session api # select history / restore one session
120
- ```
121
-
122
- Restore is additive and idempotent. It never stops, renames, replaces, or changes the topology of a current session; a name collision becomes `name-restored`, then `name-restored-2`. Windows, panes, working directories and layouts are rebuilt where safe. Only verified Claude Code/Codex sessions are resumed from their persisted session IDs; ordinary panes reopen as shells in their saved directories, without replaying commands or scrollback. Metadata lives under `~/.handmux/workspaces/`; it can include paths, tmux names/layout and agent session IDs, but not pane output.
123
-
124
- ## Script push
125
-
126
- Send a push notification to your phone from any script, CI step, or build hook:
127
-
128
- ```bash
129
- handmux push "Build done" "Took 3m12s"
130
- ```
131
-
132
- Runs **on your computer** against the already-running `handmux` server (loopback + local server token — no config, no remote endpoint). Web Push must be enabled first (`handmux setup`).
133
-
134
- **Syntax**
135
-
136
- ```
137
- handmux push <title> <body> [options]
138
- ```
139
-
140
- | Flag | Description |
141
- |---|---|
142
- | `--session <name>` | Target all devices subscribed to this tmux session (repeatable; comma-separated values OK) |
143
- | `--device <key>` | Target a specific device by its key (repeatable; comma-separated values OK) |
144
- | `--tag <T>` | Notification tag (collapses duplicates) |
145
- | `--url <U>` | HTTP(S) URL or same-origin relative path to open when the notification is tapped |
146
-
147
- **Scopes — pick at most one:**
148
-
149
- - _(default)_ — all subscribed devices
150
- - `--session` — only devices subscribed to the named session(s)
151
- - `--device` — only the specified device(s) by key
152
-
153
- `--session` and `--device` are mutually exclusive.
154
-
155
- The **device key** is shown in the phone app under Settings → Script push. It is an addressing identifier, not a secret — the security boundary is the local server token.
156
-
157
- > **Reliability:** Web Push is best-effort. For delivery-critical alerts use a dedicated messaging app (WeChat, Slack, etc.).
158
-
159
- ## Networking: one decision
160
-
161
- No tunnel by default — the phone connects **straight to your own computer**, nothing exposed and no middleman. To reach it from outside, just ask: **does your machine already have a public address?**
162
-
163
- - **Yes** (cloud box / public IP / forwarded port) — no tunnel needed, connect directly; fastest and most private.
164
- - **No** — open a tunnel. Each runs on **your own free third-party account** — handmux just wires it up and operates no relay of its own: `cloudflare` (zero-config, up in seconds, but its public edge can be slow or unreliable in some regions) · `cloudflare-named` (your own domain, steadier) · `natapp` / `cpolar` (domestic providers that stay reachable inside mainland China) · `ssh` self-hosted (through your own server).
91
+ See the **[Agent integration guide](https://handmux.com/docs#cmd-agent)** for status, disable, compatibility, and reload behavior.
165
92
 
166
- > Tunnel config, Web Preview, autostart, and voice/push credentials → see the **[docs](https://handmux.com/docs)**.
93
+ ## Connectivity
167
94
 
168
- Once autostart is installed, `handmux start` / `stop` / `restart` coordinate with that same launchd/systemd service (including after an upgrade). A lifecycle lock prevents concurrent launches; `status` shows the running version and warns with PIDs if stale/duplicate supervisors exist, while `stop` reaps every copy.
95
+ The default is a direct connection to your own computer. For access away from home or work, use a public address or a tunnel on your own Cloudflare, natapp, cpolar, or SSH setup. See the **[connectivity guide](https://handmux.com/docs#tunnels)**.
169
96
 
170
97
  ## Requirements
171
98
 
package/README.zh-CN.md CHANGED
@@ -8,12 +8,12 @@
8
8
  <a href="https://www.npmjs.com/package/handmux"><img src="https://img.shields.io/npm/v/handmux?color=cb3837&logo=npm" alt="npm"></a>
9
9
  <a href="https://github.com/handmux/handmux/actions/workflows/test.yml"><img src="https://github.com/handmux/handmux/actions/workflows/test.yml/badge.svg" alt="CI"></a>
10
10
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-blue" alt="license: AGPL-3.0"></a>
11
- <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white" alt="node"></a>
11
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%E2%89%A522.16-339933?logo=node.js&logoColor=white" alt="node"></a>
12
12
  </p>
13
13
 
14
14
  > **一部手机,一整套移动 Vibe Coding 驾驶舱。** 基于 tmux——电脑上一行命令、手机扫码,你正跑着的会话、Claude Code、Codex、git、预览、文档全到手里,创造力随时随地都在你手上。
15
15
 
16
- handmux 不只是把终端搬上手机。它把你电脑上**正跑着的 tmux 会话**原样搬进手机浏览器(同一个真实 pane,不是只读镜像),再围着它搭起一整套**移动 Vibe Coding 驾驶舱**:**Claude Code / Codex** 要你拍板时推到手机、拇指一点就批,动动嘴就发新指令;**git** 全屏看彩色 diff;一键**预览**正跑着的网站;**文档**逐句朗读;文件随手双向传。手机端**零安装**——点开链接就进去,"添加到主屏"即成全屏 **PWA**,和原生 App 基本无异。窝在沙发、挤在地铁,Vibe Coding 不停,创造力随时在你手里。
16
+ handmux 把电脑上的**同一个实时 tmux 工作区**带到手机或桌面浏览器。你可以继续使用 Claude CodeCodex、Pi 或任何终端工具,查看改动、处理确认、预览应用和传输文件,而不用另开一套远程会话。它完全开源、自托管,手机无需安装 App,也无需注册 handmux 账号。
17
17
 
18
18
  <p align="center">
19
19
  <img src="assets/handmux-run.gif" alt="handmux:说出需求,Claude Code 写好,点文件名即可预览结果" width="280">
@@ -59,113 +59,40 @@ handmux start --tunnel cloudflare # 即时公网地址(自动装 cloudflared)
59
59
 
60
60
  ## 为什么是 handmux
61
61
 
62
- - **🧰 不只是终端——一整套装进口袋的移动 Vibe Coding 驾驶舱。** git 全屏看彩色 diff、一键预览正跑着的网站、文档逐句朗读、文件随手双向传——一整套开发能力,此刻全套在手,不用在几个 App 间来回切。
63
- - **🚀 一分钟从零到手机上敲代码。** 一条 `handmux start`、扫个码,完事——不注册、不上应用商店、不装 App,一个链接就进去。"添加到主屏"后即为全屏 **PWA**,和原生 App 一样顺手。
64
- - **🧶 人走,活不停。** 手机连的是你工位上**那一个**正跑着的 tmux pane(不是新 shell、不是截图)。合上电脑,拇指接着盯,状态一点不差。
65
- - **🔔 需要你时,手机会响。** Claude Code / Codex 一到要你拍板就推送;添加到主屏后直接走系统通知。收件箱标「进行中 / 需要你 / 已完成 / 出错」,多项目并行状态一览无余;终态结果的已读状态由电脑端统一记录,刷新或换设备也不会重复提醒。打开“已完成”会刷新权威最新尾部,并直接从最后一条已完成 AI 回复开头开始阅读。Server 离线时 Claude Hook 结果先在本机排队,恢复后按会话顺序补交。拇指一点批授权批计划,别再守着屏幕等它。
66
- - **🔒 你的代码,不经过任何中转。** 免费、完全开源;我们没有中转服务器,数据只在你的电脑和手机之间直接走,确保安全。
62
+ - **🧶 同一个工作区,到处继续。** 手机操控的是电脑上正在运行的真实 tmux pane,不是截图,也不是另一套云端会话。
63
+ - **🔔 不必守着 Agent。** 随时查看哪些 pane 正在工作或等你处理,需要时收到通知并在手机上确认。
64
+ - **🧰 完整的移动开发驾驶舱。** 终端、Agent 对话、Git、预览、文档、文件、用量和想法收集集中在一起。
65
+ - **🔒 天生自托管。** 浏览器连接你自己的电脑,中间没有 handmux 账号服务或中转服务器。
67
66
 
68
67
  ## 功能一览
69
68
 
70
- - **Claude Code / Codex 深度**——收件箱状态台账、拇指批授权批计划,以及所有设备共享的本机最新订阅用量;每个已开启显示的 Provider 都可从卡片操作菜单单独刷新最新额度,厂家暂时不可达时仍保留上一份数值。Codex 还会显示当前账号与套餐、主账号和特定模型的独立额度,以及剩余重置次数与官方提供的各次到期时间。同一个用量页还能在 Handmux 电脑的本机信任边界内静态加密保存多个 DeepSeek 和 Moonshot (Kimi) API 账户,完整 API Key 不会返回浏览器。
71
- - **对话视图**——通过 App Server 用流式 Markdown 气泡、工具卡、原生 Goal 生命周期卡片和实时状态操作 Codex CLI;上下文圆环详情直接显示 thread `cwd` 所属 Git worktree 的绝对根路径与分支。设置或重新开始会创建全新的 active 原生 Goal,立即在右侧显示用户侧卡片并启动 Codex 自带的自动续跑。进行中或暂停的 Goal 常驻在实时任务列表下方,Codex 终态反馈留在对应回合并靠左,所有入口统一打开同一个 Bottom Sheet;当前 Goal 使用 iOS 风格单行等分操作,清除后会移除常驻目标并关闭详情,已经发生的历史卡片仍保留;当前终态 Goal 可修改内容后重新开始。长回答会稳定在开头供阅读,用户可随时回到最新内容;现有 pane 可原位接入。所有可发送 Agent 共用同一套持久服务端队列:待发消息可查看、编辑、删除并自动发送,只有 Agent 支持 steer 时才显示“立刻引导”。发送失败的消息会保留,并沿用同一个请求 ID 重试;若对账后仍无法确认是否送达,消息会回到对话中,由你决定是否作为新消息再次发送,同时明确提示可能重复送达。电脑端可用 <kbd>Shift</kbd>+<kbd>Enter</kbd> 聚焦输入框,聚焦后该组合键换行,<kbd>Enter</kbd> 发送,<kbd>Esc</kbd> 只取消聚焦而不会停止 Agent。Codex 对话为稳定功能;Claude Code 与 Pi 对话均需独立开启,且仍为实验性功能。
72
- - **实时终端 + 电脑键盘**——在手机和电脑上实时操控同一个 tmux pane,支持历史滚动、弱网回退、物理键盘直输和原生复制粘贴。
73
- - **命令 / 聊天双模式**——在终端直输与自然语言对话间切换;手机命令键盘提供直接可用的 Alt 与空格键,并可用跨设备同步的快捷栏快速操作。
74
- - **更新后重新加载客户端**——服务端更新完成后,在设置里点「重新加载应用」即可载入新版客户端,无需退出主屏应用再重新打开。
75
- - **脚本推送**——用 `handmux push` 从脚本或 CI 步骤推消息到手机,可指定全部设备、某个会话或某台设备。
76
- - **工作区恢复**——handmux 静默保存必要元数据,在电脑或 tmux server 重启后恢复最新工作区,绝不替换现有会话。
77
- - **Git 查看器**——改动 / 提交历史 / 任意分支 / 全屏彩色 diff,多仓库分页,只读不动工作区。
78
- - **网页预览器**——用手机直连或电脑代理预览网址,也可隔离打开静态目录,支持窄屏 / 宽屏和缩放;电脑代理还可向网站请求手机版或电脑版。它只嵌入网页,不替代完整浏览器。
79
- - **文档**——终端里明确识别出的文本文件路径不分扩展名均可点开,普通斜杠文字保持纯文本;支持 Markdown 排版、字号缩放、逐句高亮朗读,二进制文件仍只下载。
80
- - **选中 · 拷贝**——终端和 Agent 对话都可长按文字、拖动 iOS 式首尾手柄精调,再拷贝指定内容、屏幕整行或语义整段。
81
- - **文件双向传**——聊天框多选上传(含 ZIP 压缩包)、下载、系统分享进来、复制绝对路径。
82
- - **想法 · 随想随记**——不错过任何点子:每窗口一份想法清单,灵感一冒就记(能语音速记),一点填进输入框。
83
- - **专治弱网**——退避重连、掉线横幅、离线兜底页、后台暂停轮询;光标不乱跳。
84
- - **零安装 PWA**——添加到主屏即可全屏运行,支持 English、简体 / 繁體中文、日本語和 한국어。
69
+ - **实时终端**——手机和电脑操控同一个 tmux pane,支持历史记录、物理键盘输入和原生复制粘贴。
70
+ - **Agent 对话**——以流式对话操作 Codex;可选的 Claude Code 与 Pi 接入也能在支持的对话流程里使用同一个工作区。
71
+ - **收件箱与确认**——集中查看多个 pane、接收推送,并远程处理权限或计划确认。
72
+ - **Git 与预览**——查看仓库,并从浏览器打开运行中的网站、内网页面或静态目录。
73
+ - **文档与文件**——打开可读文件、听文档朗读,并双向上传、下载或分享文件。
74
+ - **想法与语音**——按窗口保存想法,并通过支持的讯飞或腾讯识别模式输入文字。
75
+ - **用量概览**——查看支持的 Agent 订阅额度和已配置 API 服务商余额,完整密钥不会返回浏览器。
76
+ - **会话韧性**——弱网下自动恢复连接,电脑重启后可恢复已保存的 tmux 工作区结构。
77
+ - **脚本推送**——通过 `handmux push` 从本地脚本或 CI 向手机发送通知。
78
+ - **零安装 PWA**——添加到主屏即可全屏使用,支持中文、English、日本語和 한국어。
85
79
 
86
80
  ## Agent 接入
87
81
 
88
- 用 `handmux <Agent> [args...]` 启动受支持的 Agent,Agent 名后的参数会原样透传;用独立的 `handmux agent` 命名空间启用或检查 Handmux 接入。Codex 接入已内置,Pi 和 Claude Code 需要显式启用:
82
+ Codex 接入已内置;Pi 和 Claude Code 接入可按需开启:
89
83
 
90
84
  ```bash
91
85
  handmux codex [args...]
92
86
  handmux pi [args...]
93
-
94
- handmux agent # 列出 Agent 接入状态
95
87
  handmux agent enable pi
96
- handmux agent status pi
97
- handmux agent disable pi
98
-
99
88
  handmux agent enable claude
100
- handmux agent status claude
101
- handmux agent disable claude
102
- handmux agent status codex # 已安装 Codex 时就绪(接入已内置)
103
89
  ```
104
90
 
105
- 旧的 `handmux hooks install|uninstall` 暂作 Claude Code 兼容别名。Pi 接入使用受信任的 Handmux 自有 Extension wrapper,连接的仍是电脑上同一个原生 Pi TUI 进程;启用时只在 Pi 官方全局 Extension 目录写入这一个 wrapper,不扫描项目,也不加载第三方扩展。启用或禁用后,新开 Pi 会话,或在 Pi 中运行 `/reload`。Handmux 升级后会自动刷新已启用的自有 wrapper,并为每份 Connector 内容生成带指纹的 import URL,避免 `/reload` 复用模块缓存里的旧版本;没有 Handmux 所有权标记的文件绝不会被覆盖或删除。Handmux Server 离线时 Pi 仍可正常使用,终态结果会先在本机排队,Server 恢复后再补交。Pi 对话使用通用上下文圆环显示 Pi 的实时上下文用量、运行状态和工作目录;Handmux 升级后,已在运行的 Pi 会话需执行 `/reload` 才能获得新增的 Connector 能力。
106
-
107
- 通用 Agent 对话中的附件只在用户点按后下载。Provider 只注册与会话绑定的 opaque resource ID,手机不会收到本机路径;HTML、SVG 等潜在主动内容始终作为附件下载,不在页面内直接渲染。
108
-
109
- ## 工作区恢复
110
-
111
- handmux 会持续维护最新工作区元数据的两份容灾副本。它们不是操作历史:日常变动和 handmux 能确认的主动删除只会更新当前状态。只有电脑或 tmux 环境换代时才归档可选择的 checkpoint。若最后一个 tmux 会话在 handmux 外消失,tmux 无法区分主动删除与崩溃;为保留崩溃恢复能力,handmux 会保留最后状态,并立即提供恢复,无需等待新 tmux server 或 session 出现。最近 24 小时内的全部保留;更早历史再裁到最新 10 份,最新有效 checkpoint 不会只因过期而消失。
112
-
113
- 重启后若 checkpoint 里还有内容待恢复,手机会在一小时内显示「恢复上次工作区」;若 tmux 当前没有任何会话,则直接打开确认弹窗。在手机上忽略后,该 checkpoint 只在这台手机上不再提示。恢复完成后会汇总实际恢复的会话、窗口和窗格,但不会自动打开或绑定;需要时可点「重新绑定会话」选择要显示在这台手机上的会话。手机提示过期后,CLI 仍一直可用:
114
-
115
- ```bash
116
- handmux restore --dry-run # 预览最新恢复计划
117
- handmux restore # 恢复;TTY 交互选择,非 TTY 用最新
118
- handmux restore --list # 列出保留的 checkpoint
119
- handmux restore --checkpoint <id> --session api # 选历史 / 只恢复一个会话
120
- ```
121
-
122
- 恢复是只新增、可重复执行的:不会停止、改名、替换或改变当前会话的拓扑;同名时依次改为 `name-restored`、`name-restored-2`。在安全可表达的范围内重建窗口、窗格、工作目录和布局。只有经过验证的 Claude Code / Codex 会话会用已持久化的 session ID 续接;普通 pane 只在原目录打开 shell,不会重放命令或保存的终端输出。元数据位于 `~/.handmux/workspaces/`,可能包含路径、tmux 名称/布局和 agent session ID,但不包含 pane 输出。
123
-
124
- ## 脚本推送
125
-
126
- 在电脑上运行任意脚本、CI 步骤或构建钩子时,推送通知到手机:
127
-
128
- ```bash
129
- handmux push "构建完成" "耗时 3m12s"
130
- ```
131
-
132
- 在**你的电脑上**直接对正在运行的 `handmux` 服务器执行(回环 + 本地服务器 token——无需配置,无远端端点)。需先通过 `handmux setup` 启用 Web Push。
133
-
134
- **语法**
135
-
136
- ```
137
- handmux push <title> <body> [选项]
138
- ```
139
-
140
- | 参数 | 说明 |
141
- |---|---|
142
- | `--session <name>` | 仅推送到订阅了该 tmux 会话的设备(可重复使用,支持逗号分隔) |
143
- | `--device <key>` | 仅推送到指定 key 的设备(可重复使用,支持逗号分隔) |
144
- | `--tag <T>` | 通知标签(合并同类通知) |
145
- | `--url <U>` | 点通知后打开的 HTTP(S) URL 或站内相对路径 |
146
-
147
- **推送范围——三选一:**
148
-
149
- - _(默认)_ — 全部已订阅设备
150
- - `--session` — 仅订阅了指定会话的设备
151
- - `--device` — 仅指定 key 的设备
152
-
153
- `--session` 与 `--device` 互斥。
154
-
155
- **设备 key** 在手机 App 的设置 → 脚本推送中查看。它是寻址标识符,不是密钥——安全边界是本地服务器 token。
156
-
157
- > **可靠性说明:** Web Push 属于尽力投递,不保证实时送达。有投递强要求的告警请使用专用 IM(微信、钉钉等)。
158
-
159
- ## 联网:一句话决策
160
-
161
- 默认不开隧道——手机**直连你自己的电脑**,什么都不暴露、也没有中间人。想从外面连,只问一句:**电脑有没有公网地址?**
162
-
163
- - **有**(云主机 / 公网 IP / 已端口转发)—— 不用隧道,直接连,最快也最私密。
164
- - **没有** —— 开一条隧道。每条都跑在**你自己的免费第三方账号**上,handmux 只负责接通、自身不设中转:`cloudflare`(零配置秒通,但公共边缘在国内常不稳)· `cloudflare-named`(你的域名,更稳)· `natapp` / `cpolar`(国内厂商,大陆境内可达)· `ssh` 自建(接你自己的服务器)。
91
+ 状态、关闭、兼容和 reload 行为见 **[Agent 接入文档](https://handmux.com/docs#cmd-agent)**。
165
92
 
166
- > 隧道配置、网页预览器、开机自启、语音 / 推送凭证等细节 → 见 **[文档](https://handmux.com/docs)**。
93
+ ## 连接方式
167
94
 
168
- 安装开机自启后,`handmux start` / `stop` / `restart` 会始终与同一个 launchd/systemd 服务协同(升级后也一样)。生命周期锁会阻止并发启动;`status` 显示实际运行版本,并列出未登记/重复 supervisor 的 PID;`stop` 会回收全部副本。
95
+ 默认由浏览器直连你自己的电脑。离开家庭或办公网络时,可使用公网地址,或通过自己的 Cloudflare、natapp、cpolar、SSH 配置建立隧道。详见 **[连接文档](https://handmux.com/docs#tunnels)**。
169
96
 
170
97
  ## 环境要求
171
98
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handmux",
3
- "version": "0.26.0",
3
+ "version": "0.27.2",
4
4
  "description": "A mobile vibe-coding cockpit — built on tmux: drive your live session, Claude Code / Codex — anything a terminal can run — from your phone.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",
@@ -75,6 +75,24 @@
75
75
  "vitest": "^2.0.0"
76
76
  },
77
77
  "whatsNew": [
78
+ {
79
+ "version": "0.27.2",
80
+ "date": "2026-09-08",
81
+ "zh": "修复多标签页偶发鉴权弹窗",
82
+ "en": "Fix intermittent authentication prompts across tabs"
83
+ },
84
+ {
85
+ "version": "0.27.1",
86
+ "date": "2026-09-08",
87
+ "zh": "腾讯语音 · 终端光标修复 · Codex 对话恢复",
88
+ "en": "Tencent voice · terminal cursor fixes · Codex chat recovery"
89
+ },
90
+ {
91
+ "version": "0.27.0",
92
+ "date": "2026-09-05",
93
+ "zh": "腾讯语音输入 · 终端输入更准确",
94
+ "en": "Tencent voice input · more accurate terminal typing"
95
+ },
78
96
  {
79
97
  "version": "0.26.0",
80
98
  "date": "2026-09-04",
@@ -104,24 +122,6 @@
104
122
  "date": "2026-08-11",
105
123
  "zh": "Codex 任务进度与 Goal 原生上线",
106
124
  "en": "Native Codex task progress and Goals"
107
- },
108
- {
109
- "version": "0.23.0",
110
- "date": "2026-08-09",
111
- "zh": "Codex 托管对话正式上线",
112
- "en": "Managed Codex chat is here"
113
- },
114
- {
115
- "version": "0.22.1",
116
- "date": "2026-08-04",
117
- "zh": "网页宽度与网站版本分开控制",
118
- "en": "Separate page width and site-version controls"
119
- },
120
- {
121
- "version": "0.22.0",
122
- "date": "2026-08-03",
123
- "zh": "全屏设置 · 窗口与分屏管理更清晰",
124
- "en": "Full-screen Settings · clearer window and pane management"
125
125
  }
126
126
  ]
127
127
  }