handmux 0.20.2 → 0.21.0
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.
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/package.json +6 -5
- package/public/assets/index-DgkdA9oQ.js +335 -0
- package/public/assets/index-WH6Olfjg.css +32 -0
- package/public/index.html +2 -2
- package/src/browser/bootstrap.js +68 -0
- package/src/browser/cookieProfiles.js +403 -0
- package/src/browser/coordinator.js +47 -0
- package/src/browser/hammerheadCompat.js +86 -0
- package/src/browser/hammerheadRedirectCompat.js +38 -0
- package/src/browser/manager.js +530 -0
- package/src/browser/originLabel.js +17 -0
- package/src/browser/profilePersistence.js +241 -0
- package/src/browser/protocol.js +1 -0
- package/src/browser/publicProxy.js +153 -0
- package/src/browser/routes.js +145 -0
- package/src/browser/sessionStore.js +78 -0
- package/src/browser/targetPolicy.js +137 -0
- package/src/browser/worker.js +32 -0
- package/src/browser/workerClient.js +253 -0
- package/src/browser/workerServer.js +98 -0
- package/src/cli/i18n/en.js +6 -11
- package/src/cli/i18n/zh.js +6 -11
- package/src/cli/options.js +3 -4
- package/src/cli/setupModel.js +3 -3
- package/src/cli/setupWizard.js +5 -9
- package/src/cli/supervisor.js +8 -3
- package/src/httpApi.js +10 -2
- package/src/previewServer.js +123 -151
- package/src/previews.js +54 -56
- package/src/routes/previews.js +9 -16
- package/src/routes/system.js +7 -2
- package/src/server.js +24 -14
- package/src/terminalStream.js +3 -0
- package/src/workspace/checkpointer.js +6 -2
- package/public/assets/index-C8Bg8Ecf.css +0 -32
- package/public/assets/index-jfjMNwMB.js +0 -335
- package/src/internalPreviewGateway.js +0 -487
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
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%
|
|
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>
|
|
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.
|
|
@@ -27,7 +27,7 @@ handmux is more than a terminal on your phone. It puts the *same* live **tmux**
|
|
|
27
27
|
|
|
28
28
|
## Quick start · about a minute
|
|
29
29
|
|
|
30
|
-
Your computer needs tmux and Node ≥
|
|
30
|
+
Your computer needs tmux and Node ≥ 20; the phone just needs a browser. Pick one:
|
|
31
31
|
|
|
32
32
|
**Homebrew — macOS (recommended)** · installs Node + tmux for you:
|
|
33
33
|
|
|
@@ -75,7 +75,7 @@ handmux start --tunnel cloudflare # instant public URL (cloudflared auto-insta
|
|
|
75
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
76
|
- **Workspace recovery** — handmux silently keeps the metadata needed to rebuild your latest tmux workspace. After a computer or tmux-server restart, restore it beside any new sessions from the phone or with `handmux restore`; existing sessions are never replaced.
|
|
77
77
|
- **Git viewer** — changes / commit history / any branch / full-screen colored diff, multi-repo tabs, read-only, never touches your tree.
|
|
78
|
-
- **
|
|
78
|
+
- **Web Preview for URLs and static folders** — Web Preview embeds pages inside Handmux; it is not a full browser. It is intended for development servers, localhost, intranet pages, and sites that allow embedding. New tabs default to the phone’s direct connection, while an optional computer proxy can reach the computer’s localhost and intranet without publishing them; run `handmux setup`, choose **Web preview**, and configure a proxy domain with wildcard routing and TLS to enable it. The **…** menu can open the original URL in the system browser, switch connection and phone/desktop view, set a per-tab background-close timer, and zoom through 75 / 80 / 90 / 100 / 110 / 125 / 150 / 175 / 200%. Zoom keeps the original page layout, exposes scrollbars for overflow, and leaves the page interactive while Handmux’s tab and address bars stay fixed. Direct pages remain subject to cross-origin iframe limits such as `X-Frame-Options`, CSP, third-party-cookie policy, unreadable titles/navigation, and failures that Handmux cannot always identify. Proxy mode forwards and rewrites pages, so despite WebSocket support it is usually slower and cannot guarantee compatibility with every site. Handmux never silently changes modes. Tabs, order, recent visits, and timers stay on the current device; only the selected tab shows Close, inactive tabs reserve no close-button space, and each new URL tab appends after every existing URL or static tab. Proxy tabs share only standards-matched Cookies on that device for SSO, not localStorage, IndexedDB, Service Workers, tabs, or direct-mode state. On Home, the address row’s folder button opens a static directory under the computer user’s home as a green tab with the same phone/desktop view and layout-preserving zoom. Successful static directories also appear in Recently Visited and reopen by directory with a fresh preview-only token; preview URLs and old tokens are not stored. Static content runs in an isolated iframe and cannot read the Handmux app token. Static tabs have no system-browser, connection, Cookie, timer, Stop, or Restart controls. Their server lease renews from actual page traffic, closing the tab releases it immediately, and an abandoned lease expires after two hours; reopening a saved tab recreates it automatically.
|
|
79
79
|
- **Docs** — tap a path in the terminal to open it; Markdown rendered, font zoom, sentence-by-sentence read-aloud.
|
|
80
80
|
- **Mobile select & copy** — long-press to select in the terminal, drag iOS-style handles to fine-tune, copy the selection / a whole line / a whole paragraph.
|
|
81
81
|
- **Files both ways** — multi-select upload from the chat box, download, share in, copy any absolute path.
|
|
@@ -140,13 +140,13 @@ No tunnel by default — the phone connects **straight to your own computer**, n
|
|
|
140
140
|
- **Yes** (cloud box / public IP / forwarded port) — no tunnel needed, connect directly; fastest and most private.
|
|
141
141
|
- **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).
|
|
142
142
|
|
|
143
|
-
> Tunnel config,
|
|
143
|
+
> Tunnel config, Web Preview, autostart, and voice/push credentials → see the **[docs](https://handmux.com/docs)**.
|
|
144
144
|
|
|
145
145
|
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.
|
|
146
146
|
|
|
147
147
|
## Requirements
|
|
148
148
|
|
|
149
|
-
Your computer needs **Node ≥
|
|
149
|
+
Your computer needs **Node ≥ 20** and **tmux ≥ 3.0**; the phone just needs a browser. On **Windows**, run it inside **WSL2** (a real Linux kernel + real tmux) — see the [docs](https://handmux.com/docs#windows).
|
|
150
150
|
|
|
151
151
|
## Feedback & community
|
|
152
152
|
|
package/README.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
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%
|
|
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>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
> **一部手机,一整套移动 Vibe Coding 驾驶舱。** 基于 tmux——电脑上一行命令、手机扫码,你正跑着的会话、Claude Code、Codex、git、预览、文档全到手里,创造力随时随地都在你手上。
|
|
@@ -27,7 +27,7 @@ handmux 不只是把终端搬上手机。它把你电脑上**正跑着的 tmux
|
|
|
27
27
|
|
|
28
28
|
## 快速上手 · 约一分钟
|
|
29
29
|
|
|
30
|
-
**电脑上**需要 tmux 和 Node ≥
|
|
30
|
+
**电脑上**需要 tmux 和 Node ≥ 20(手机只要个浏览器)。二选一:
|
|
31
31
|
|
|
32
32
|
**Homebrew —— macOS 首选** · 顺带帮你装好 Node + tmux:
|
|
33
33
|
|
|
@@ -75,7 +75,7 @@ handmux start --tunnel cloudflare # 即时公网地址(自动装 cloudflared)
|
|
|
75
75
|
- **脚本推送**——用 `handmux push` 从脚本或 CI 步骤推消息到手机,可指定全部设备、某个会话或某台设备。
|
|
76
76
|
- **工作区恢复**——handmux 静默保存重建最新 tmux 工作区所需的元数据。电脑或 tmux server 重启后,可从手机或 `handmux restore` 把旧工作区恢复到新会话旁边,绝不替换现有会话。
|
|
77
77
|
- **Git 查看器**——改动 / 提交历史 / 任意分支 / 全屏彩色 diff,多仓库分页,只读不动工作区。
|
|
78
|
-
-
|
|
78
|
+
- **网页预览器统一预览网址与静态目录**——网页预览器把页面嵌入 Handmux,它不是真正的浏览器,适合预览开发服务、localhost、内网和允许嵌入的网站。新页签默认手机直连;可在电脑运行 `handmux setup`、选择“网页预览器”,配置代理域名及通配路由 / TLS 后,经电脑访问其 localhost 和内网,无需对外发布。“…”菜单可用系统浏览器打开原网址、切换连接方式与手机 / 电脑视图、设置页签后台关闭时间,并按 75 / 80 / 90 / 100 / 110 / 125 / 150 / 175 / 200% 缩放。缩放保持网页原有布局,通过滚动条查看溢出内容;网页始终可交互,Handmux 的标签栏和地址栏保持固定。手机直连仍受跨域 iframe 限制,例如 `X-Frame-Options`、CSP、第三方 Cookie、标题与页面内跳转不可读,Handmux 也不一定能判断失败原因。电脑代理会转发并改写网页,即使支持 WebSocket,通常也更慢,且不保证兼容所有网站;系统不会静默切换模式。标签页、顺序、最近访问和计时只存在当前设备;只有当前标签显示关闭按钮,未选中标签不预留关闭按钮空间,新打开的网页标签始终追加到现有网址与静态标签之后。同一设备的代理页签仅按真实目标 Cookie 规则共享 Cookie 以复用 SSO,不共享 localStorage、IndexedDB、Service Worker、标签或直连状态。Home 地址栏右侧的目录按钮可选择电脑用户目录下的静态目录,在同一个预览器里打开为绿色静态标签,并复用手机 / 电脑视图及保持布局的缩放。成功打开的静态目录也会进入“最近访问”,再次点击会按目录获取新的预览专用 token,不保存预览地址或旧 token;静态内容运行在隔离 iframe 中,无法读取 Handmux 主应用 token。静态标签不提供系统浏览器、连接方式、Cookie、后台计时、停止或重启入口;真实页面访问会自动续租,关闭标签立即释放,异常遗留的租约会在两小时后过期,重新打开已保存标签时会自动恢复。
|
|
79
79
|
- **文档**——终端里点路径即开;Markdown 排版、字号缩放、逐句高亮朗读。
|
|
80
80
|
- **选中 · 拷贝**——终端里长按选中,拖 iOS 式手柄精调,一键拷贝选区 / 整行 / 整段。
|
|
81
81
|
- **文件双向传**——聊天框多选上传、下载、系统分享进来、复制绝对路径。
|
|
@@ -140,13 +140,13 @@ handmux push <title> <body> [选项]
|
|
|
140
140
|
- **有**(云主机 / 公网 IP / 已端口转发)—— 不用隧道,直接连,最快也最私密。
|
|
141
141
|
- **没有** —— 开一条隧道。每条都跑在**你自己的免费第三方账号**上,handmux 只负责接通、自身不设中转:`cloudflare`(零配置秒通,但公共边缘在国内常不稳)· `cloudflare-named`(你的域名,更稳)· `natapp` / `cpolar`(国内厂商,大陆境内可达)· `ssh` 自建(接你自己的服务器)。
|
|
142
142
|
|
|
143
|
-
>
|
|
143
|
+
> 隧道配置、网页预览器、开机自启、语音 / 推送凭证等细节 → 见 **[文档](https://handmux.com/docs)**。
|
|
144
144
|
|
|
145
145
|
安装开机自启后,`handmux start` / `stop` / `restart` 会始终与同一个 launchd/systemd 服务协同(升级后也一样)。生命周期锁会阻止并发启动;`status` 显示实际运行版本,并列出未登记/重复 supervisor 的 PID;`stop` 会回收全部副本。
|
|
146
146
|
|
|
147
147
|
## 环境要求
|
|
148
148
|
|
|
149
|
-
电脑需 **Node ≥
|
|
149
|
+
电脑需 **Node ≥ 20** 与 **tmux ≥ 3.0**;手机只要浏览器。**Windows** 请装进 **WSL2**(真 Linux 内核 + 真 tmux)——见 [文档](https://handmux.com/docs#windows)。
|
|
150
150
|
|
|
151
151
|
## 反馈与交流
|
|
152
152
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "handmux",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
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",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"pwa"
|
|
23
23
|
],
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
25
|
+
"node": ">=20"
|
|
26
26
|
},
|
|
27
27
|
"bin": {
|
|
28
28
|
"handmux": "bin/handmux.js"
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"busboy": "^1.6.0",
|
|
49
49
|
"compression": "^1.8.1",
|
|
50
50
|
"express": "^4.19.2",
|
|
51
|
+
"testcafe-hammerhead": "31.7.8",
|
|
51
52
|
"tunlite": "^0.10.0",
|
|
52
53
|
"web-push": "^3.6.7",
|
|
53
54
|
"ws": "^8.21.0"
|
|
@@ -60,13 +61,13 @@
|
|
|
60
61
|
"vitest": "^2.0.0"
|
|
61
62
|
},
|
|
62
63
|
"whatsNew": [
|
|
64
|
+
{"version":"0.21.0","date":"2026-08-03","zh":"网页预览:手机直连、电脑代理与静态目录","en":"Web preview: direct, computer proxy, and static folders"},
|
|
65
|
+
{"version":"0.20.3","date":"2026-08-01","zh":"实时终端显示更稳定流畅","en":"More stable, smoother live terminals"},
|
|
63
66
|
{"version":"0.20.2","date":"2026-07-27","zh":"实时终端长时间运行更流畅","en":"Smoother long-running live terminals"},
|
|
64
67
|
{"version":"0.20.1","date":"2026-07-26","zh":"聊天发送修复 · 电脑键盘不中断","en":"Reliable chat sending · uninterrupted desktop input"},
|
|
65
68
|
{"version":"0.20.0","date":"2026-07-26","zh":"终端实时推送 · 弱网自动回退","en":"Live terminal pushing · automatic network fallback"},
|
|
66
69
|
{"version":"0.19.0","date":"2026-07-25","zh":"电脑物理键盘直输 · Window 切换更流畅","en":"Desktop keyboard input · faster window switching"},
|
|
67
70
|
{"version":"0.18.0","date":"2026-07-22","zh":"Tmux 工作区恢复 · 快捷栏自由定制","en":"Tmux workspace recovery · customizable shortcuts"},
|
|
68
|
-
{"version":"0.17.8","date":"2026-07-20","zh":"分屏地图显示尺寸 · iPhone 交互修复","en":"Pane dimensions in the map · iPhone interaction fixes"}
|
|
69
|
-
{"version":"0.17.7","date":"2026-07-20","zh":"单实例启动兜底 · WSL 状态命令修复","en":"Single-instance startup guard · WSL status fix"},
|
|
70
|
-
{"version":"0.17.6","date":"2026-07-20","zh":"推送结果可追踪 · 对话与权限操作更可靠","en":"Traceable push results · safer chats and permissions"}
|
|
71
|
+
{"version":"0.17.8","date":"2026-07-20","zh":"分屏地图显示尺寸 · iPhone 交互修复","en":"Pane dimensions in the map · iPhone interaction fixes"}
|
|
71
72
|
]
|
|
72
73
|
}
|