AnyBot/mobile/screen.html

402 lines
20 KiB
HTML
Raw Normal View History

People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
<!doctype html>
<html lang="zh-Hant">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, user-scalable=no">
design: 手機網頁顏色跟著電腦版、改成 Claude 手機 App 的感覺,實點修好 12 個問題 - 顏色:api/state 帶出電腦的主題和淺色/深色兩組顏色(theme::shell 換成手機的 CSS 變數);手機「這支手機的外觀」預設「跟著電腦」,也可選跟著手機、淺色、深色;先驗證是 hex 才套用,存一份避免打開時閃預設色;狀態列跟著畫面。舊版電腦沒送顏色時維持「紙」。電腦畫面頁改成暖色深色。 - 感覺:標題列沒有底線、第二行只寫在做什麼或模型;輸入框是底部圓角卡片;回答下只留時間和三個操作;群組、晶片、建議、記憶卡拿掉框線;開關的「開」用墨色;允許卡細框;點擊範圍加大(44/40/36px)。 - 字更少:設定首頁拿掉重複說明;每列說明一行;「模型」頁右邊只寫可以用/未設定;Bot 那列選單少用的收進「更多…」。 - 修好:長 Bot 名字超出 @// 選單;引用顯示原始 Markdown 且沒有長度上限;第 8 個表情換行;.note 在清單裡變灰條;圖片點了跳出 App;上傳吐司蓋住輸入框;「聊天的顏色」永遠沒有 ✓(電腦送 "Quiet",改送 quiet/black/bot_color);「:」後的網址不成連結;深色模式黑頭像看不見;稽核分頁出現 ** 和多行 JSON;頁面卡標題重複;記憶搜尋框 14px 讓 iPhone 放大。 - 問題卡的「略過」、交辦的「跳過」、允許卡的「拒絕」不再是紅字,跟電腦版一樣是一般按鈕。 已驗證:cargo test --bin anybot 523 通過(含 phone_login_and_api 檢查主題和兩組顏色)、relay 22 通過;手機圖表 65/65、通知 9/9、電腦畫面 13/13;playwright 390×844 淺色深色點過登入、首頁、聊天、詳細資訊、Bot 設定、頁面、例行任務、電腦、設定每一頁,沒有 console 錯誤、失敗請求或橫向溢出;電腦換靛藍深色,手機跟著變。 未驗證:真的 iPhone/Android 實機。
2026-11-16 15:16:38 +00:00
<meta name="theme-color" content="#1e1d1b">
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
<title>Bot 的電腦</title>
<link rel="icon" href="icon.svg">
<style>
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
:root {
design: 手機網頁顏色跟著電腦版、改成 Claude 手機 App 的感覺,實點修好 12 個問題 - 顏色:api/state 帶出電腦的主題和淺色/深色兩組顏色(theme::shell 換成手機的 CSS 變數);手機「這支手機的外觀」預設「跟著電腦」,也可選跟著手機、淺色、深色;先驗證是 hex 才套用,存一份避免打開時閃預設色;狀態列跟著畫面。舊版電腦沒送顏色時維持「紙」。電腦畫面頁改成暖色深色。 - 感覺:標題列沒有底線、第二行只寫在做什麼或模型;輸入框是底部圓角卡片;回答下只留時間和三個操作;群組、晶片、建議、記憶卡拿掉框線;開關的「開」用墨色;允許卡細框;點擊範圍加大(44/40/36px)。 - 字更少:設定首頁拿掉重複說明;每列說明一行;「模型」頁右邊只寫可以用/未設定;Bot 那列選單少用的收進「更多…」。 - 修好:長 Bot 名字超出 @// 選單;引用顯示原始 Markdown 且沒有長度上限;第 8 個表情換行;.note 在清單裡變灰條;圖片點了跳出 App;上傳吐司蓋住輸入框;「聊天的顏色」永遠沒有 ✓(電腦送 "Quiet",改送 quiet/black/bot_color);「:」後的網址不成連結;深色模式黑頭像看不見;稽核分頁出現 ** 和多行 JSON;頁面卡標題重複;記憶搜尋框 14px 讓 iPhone 放大。 - 問題卡的「略過」、交辦的「跳過」、允許卡的「拒絕」不再是紅字,跟電腦版一樣是一般按鈕。 已驗證:cargo test --bin anybot 523 通過(含 phone_login_and_api 檢查主題和兩組顏色)、relay 22 通過;手機圖表 65/65、通知 9/9、電腦畫面 13/13;playwright 390×844 淺色深色點過登入、首頁、聊天、詳細資訊、Bot 設定、頁面、例行任務、電腦、設定每一頁,沒有 console 錯誤、失敗請求或橫向溢出;電腦換靛藍深色,手機跟著變。 未驗證:真的 iPhone/Android 實機。
2026-11-16 15:16:38 +00:00
/* The app's dark 「紙」 (src/theme.rs shell, dark): the screen sits on the same warm night. */
--bg: #151412;
--bar: #1e1d1b;
--elev: #262422;
--hover: rgba(242, 240, 235, 0.08);
--line: rgba(242, 240, 235, 0.12);
--text: #f2f0eb;
--dim: rgba(242, 240, 235, 0.58);
--accent: #d88366;
--warn: #d9a441;
--ok: #6fb97d;
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Segoe UI", system-ui, sans-serif;
}
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
* { box-sizing: border-box; }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13.5px/1.4 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
body { display: flex; flex-direction: column; height: 100dvh; }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
header {
display: flex; align-items: center; gap: 8px;
padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
min-height: 48px; background: var(--bar); border-bottom: 1px solid var(--line); flex: none;
}
body.embed header { min-height: 44px; padding: 6px 10px; }
header .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .state { color: var(--dim); font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px rgba(16, 171, 97, 0.18); }
design: 手機網頁顏色跟著電腦版、改成 Claude 手機 App 的感覺,實點修好 12 個問題 - 顏色:api/state 帶出電腦的主題和淺色/深色兩組顏色(theme::shell 換成手機的 CSS 變數);手機「這支手機的外觀」預設「跟著電腦」,也可選跟著手機、淺色、深色;先驗證是 hex 才套用,存一份避免打開時閃預設色;狀態列跟著畫面。舊版電腦沒送顏色時維持「紙」。電腦畫面頁改成暖色深色。 - 感覺:標題列沒有底線、第二行只寫在做什麼或模型;輸入框是底部圓角卡片;回答下只留時間和三個操作;群組、晶片、建議、記憶卡拿掉框線;開關的「開」用墨色;允許卡細框;點擊範圍加大(44/40/36px)。 - 字更少:設定首頁拿掉重複說明;每列說明一行;「模型」頁右邊只寫可以用/未設定;Bot 那列選單少用的收進「更多…」。 - 修好:長 Bot 名字超出 @// 選單;引用顯示原始 Markdown 且沒有長度上限;第 8 個表情換行;.note 在清單裡變灰條;圖片點了跳出 App;上傳吐司蓋住輸入框;「聊天的顏色」永遠沒有 ✓(電腦送 "Quiet",改送 quiet/black/bot_color);「:」後的網址不成連結;深色模式黑頭像看不見;稽核分頁出現 ** 和多行 JSON;頁面卡標題重複;記憶搜尋框 14px 讓 iPhone 放大。 - 問題卡的「略過」、交辦的「跳過」、允許卡的「拒絕」不再是紅字,跟電腦版一樣是一般按鈕。 已驗證:cargo test --bin anybot 523 通過(含 phone_login_and_api 檢查主題和兩組顏色)、relay 22 通過;手機圖表 65/65、通知 9/9、電腦畫面 13/13;playwright 390×844 淺色深色點過登入、首頁、聊天、詳細資訊、Bot 設定、頁面、例行任務、電腦、設定每一頁,沒有 console 錯誤、失敗請求或橫向溢出;電腦換靛藍深色,手機跟著變。 未驗證:真的 iPhone/Android 實機。
2026-11-16 15:16:38 +00:00
.dot.hold { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.2); }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
button {
font: inherit; font-size: 13px; font-weight: 500; color: var(--text);
background: var(--elev); border: 1px solid var(--line); border-radius: 999px;
height: 30px; padding: 0 12px; cursor: pointer; white-space: nowrap;
display: inline-flex; align-items: center; justify-content: center; gap: 5px;
transition: background 0.12s, border-color 0.12s;
}
button:hover { background: var(--hover); }
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
button.main { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
button.main:hover { filter: brightness(1.08); }
design: 手機網頁顏色跟著電腦版、改成 Claude 手機 App 的感覺,實點修好 12 個問題 - 顏色:api/state 帶出電腦的主題和淺色/深色兩組顏色(theme::shell 換成手機的 CSS 變數);手機「這支手機的外觀」預設「跟著電腦」,也可選跟著手機、淺色、深色;先驗證是 hex 才套用,存一份避免打開時閃預設色;狀態列跟著畫面。舊版電腦沒送顏色時維持「紙」。電腦畫面頁改成暖色深色。 - 感覺:標題列沒有底線、第二行只寫在做什麼或模型;輸入框是底部圓角卡片;回答下只留時間和三個操作;群組、晶片、建議、記憶卡拿掉框線;開關的「開」用墨色;允許卡細框;點擊範圍加大(44/40/36px)。 - 字更少:設定首頁拿掉重複說明;每列說明一行;「模型」頁右邊只寫可以用/未設定;Bot 那列選單少用的收進「更多…」。 - 修好:長 Bot 名字超出 @// 選單;引用顯示原始 Markdown 且沒有長度上限;第 8 個表情換行;.note 在清單裡變灰條;圖片點了跳出 App;上傳吐司蓋住輸入框;「聊天的顏色」永遠沒有 ✓(電腦送 "Quiet",改送 quiet/black/bot_color);「:」後的網址不成連結;深色模式黑頭像看不見;稽核分頁出現 ** 和多行 JSON;頁面卡標題重複;記憶搜尋框 14px 讓 iPhone 放大。 - 問題卡的「略過」、交辦的「跳過」、允許卡的「拒絕」不再是紅字,跟電腦版一樣是一般按鈕。 已驗證:cargo test --bin anybot 523 通過(含 phone_login_and_api 檢查主題和兩組顏色)、relay 22 通過;手機圖表 65/65、通知 9/9、電腦畫面 13/13;playwright 390×844 淺色深色點過登入、首頁、聊天、詳細資訊、Bot 設定、頁面、例行任務、電腦、設定每一頁,沒有 console 錯誤、失敗請求或橫向溢出;電腦換靛藍深色,手機跟著變。 未驗證:真的 iPhone/Android 實機。
2026-11-16 15:16:38 +00:00
button.hold-on { background: rgba(217, 164, 65, 0.18); border-color: var(--warn); color: var(--warn); font-weight: 600; }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
button.icon { width: 30px; padding: 0; border-radius: 9px; background: transparent; border-color: transparent; color: var(--dim); }
button.icon:hover { background: var(--hover); color: var(--text); }
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
#screen { flex: 1; min-height: 0; position: relative; background: #000; }
#screen > div { background: #000 !important; }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
#msg {
position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
text-align: center; padding: 24px; color: var(--dim); font-size: 13.5px; line-height: 1.6; pointer-events: none;
}
#type {
display: none; gap: 6px; padding: 8px 10px;
padding-bottom: max(8px, env(safe-area-inset-bottom));
background: var(--bar); border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center;
}
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
#type.on { display: flex; }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
#type input {
flex: 1 1 180px; min-width: 0; height: 32px; font: inherit; font-size: 14px; color: var(--text);
background: #0e0e0e; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; outline: none;
}
#type input:focus { border-color: var(--accent); }
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
/* 虛擬觸控板: a layer over the picture that takes the fingers; the pointer drawn on it. */
#pad { position: absolute; inset: 0; z-index: 5; display: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#pad.on { display: block; }
#ptr { position: absolute; z-index: 6; width: 20px; height: 20px; margin: -2px 0 0 -3px; pointer-events: none; display: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
#ptr.on { display: block; }
#tip {
position: absolute; z-index: 7; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: calc(100% - 24px);
background: rgba(30, 29, 27, 0.92); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px;
font-size: 12.5px; line-height: 1.6; color: var(--text); pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
#tip.on { opacity: 1; }
#tip b { font-weight: 600; color: var(--accent); }
/* The key bar: modifiers you tap (once: the next key; twice: locked), and the keys a phone lacks. */
#bar {
display: none; gap: 6px; padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom));
background: var(--bar); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none;
}
#bar::-webkit-scrollbar { display: none; }
#bar.on { display: flex; }
#bar button { height: 36px; min-width: 40px; padding: 0 10px; border-radius: 10px; flex: none; font-size: 13px; }
#bar .sep { width: 1px; background: var(--line); margin: 4px 2px; flex: none; }
#bar button.once { background: rgba(216, 131, 102, 0.22); border-color: var(--accent); color: var(--accent); }
#bar button.lock { background: var(--accent); border-color: var(--accent); color: #fff; }
#bar button.on { background: var(--text); border-color: var(--text); color: var(--bar); }
#combos {
display: none; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; background: var(--bar);
border-top: 1px solid var(--line); max-height: 40vh; overflow-y: auto; flex: none;
}
#combos.on { display: grid; }
#combos button { height: auto; min-height: 48px; flex-direction: column; gap: 2px; border-radius: 12px; padding: 6px 4px; }
#combos button small { color: var(--dim); font-size: 11px; font-weight: 400; letter-spacing: 0.5px; }
body.has-bar #type { padding-bottom: 8px; }
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
</style>
</head>
<body>
<header>
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
<button class="icon" id="back" title="關閉">✕</button>
<div class="grow">
<div class="name" id="name">Bot 的電腦</div>
<div class="state"><span class="dot" id="dot"></span><span id="state">連線中…</span></div>
</div>
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
<button class="main" id="take">接管</button>
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
<button class="icon" id="popout" title="在新分頁打開" style="display:none">↗</button>
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
</header>
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
<div id="screen"><div id="msg">正在連接畫面…</div><div id="pad"></div><svg id="ptr" viewBox="0 0 20 20"><path d="M3 2 L3 16 L7 12.5 L9.6 18 L12 17 L9.5 11.6 L14.5 11.6 Z" fill="#fff" stroke="#111" stroke-width="1.2" stroke-linejoin="round"/></svg><div id="tip"></div></div>
<div id="combos"></div>
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
<div id="type">
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
<input id="text" placeholder="輸入文字(支援中文輸入法),按 Enter 送出到電腦" autocomplete="off" enterkeyhint="send">
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
<button class="main" id="send">送出</button>
</div>
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
<div id="bar"></div>
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
<script type="module">
import RFB from "./novnc.js";
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
import { trackpad, MODS, KEYS, COMBOS, comboLabel, modState } from "./trackpad.js";
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
const q = new URLSearchParams(location.hash.slice(1));
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
const sq = new URLSearchParams(location.search);
const embed = q.get("embed") === "1" || sq.get("embed") === "1" || window.parent !== window;
if (embed) document.body.classList.add("embed");
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
const name = q.get("name") || "Bot 的電腦";
const token = localStorage.getItem("anybot.token") || "";
const wsBase = (location.protocol === "https:" ? "wss://" : "ws://") + location.host;
// The lasting login never rides in the connection's address (addresses end up in logs): a
// ticket good for this one screen, for a few minutes, is asked for first. (An older server
// that has none still gets the login, as before.)
async function ticketFor(path, body) {
try {
const r = await fetch(path, {method: "POST", headers: {"Authorization": "Bearer " + token, "Content-Type": "application/json"}, body: JSON.stringify(body)});
return r.ok ? ((await r.json()).ticket || "") : "";
} catch (_) { return ""; }
}
const lan = q.get("lan") === "1";
const host = q.get("host") || "";
feat: 每個 Bot 一個螢幕——Bot 的電腦上各有自己的螢幕和瀏覽器,支線另開暫時的螢幕,右側面板和「全部螢幕」看得到每一個 照 Grok Bot 的分法:一台電腦、每個 Bot 一個螢幕,大家同時做互不干擾。使用者自己的電腦只有一個實體螢幕,還是一次一個 Bot。 - box:anybot-screen(up/down/list/reap)開關每個 Bot 的螢幕,同時最多 6 個,閒置 10 分鐘關掉;browser 每個螢幕自己的設定檔(第一次從共用的複製登入;支線 <key>-t<n> 從主線那份複製,關掉時刪掉);start.sh 給每個螢幕 VNC token;Bot 電腦升到版本 10 - cloudbox:每個螢幕有自己的狀態(編號、尺寸、貼上檔、瀏覽器埠),指令開的視窗出現在它的 Bot 的螢幕上;branch_screen、close_screen、open_screens、thumbnail_of - agent:在 Bot 的電腦上,一輪用它自己的螢幕(支線用暫時的),佔用照螢幕算 - 支線結束時關掉它的暫時螢幕 - 畫面:右側「電腦」顯示目前 Bot 的螢幕;群組跟著正在回答的成員,「成員」卡片點小畫面就固定顯示那個成員;「全部螢幕(N)」一格一個螢幕;接管時只停那個 Bot;手機和中繼帶上要看哪個 Bot 的螢幕 - 群組和支線的系統指示:看不到彼此開著的網頁,交棒時寫網址或檔案路徑 - 功能地圖:screen、team、computers、browser Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha4mzWbjJAWAsDVuBun
2026-11-15 08:12:09 +00:00
// 每個 Bot 一個螢幕: the bot whose screen this is (the AnyBot shows its own screen, or the shared one).
const botq = /^\d+$/.test(q.get("bot") || "") ? "&bot=" + q.get("bot") : "";
// The ticket this page holds. Every connection — the first and each reconnect — gets a fresh
// one: on 區網 a new one-use ticket with this phone's login; through the account, the held one
// swapped for a new one (the account server drops the old at once, so the ticket in this page's
// link — and the browser's history — is dead as soon as the page is up). A ticket can be swapped
// up to ten minutes after its last use; after that it is the login that asks again, or — a page
// the app opened, with no login here — the person opens the screen again from AnyBot.
let ticket = q.get("ticket") || "";
let firstTry = true;
async function swap(old) {
try {
const r = await fetch("relay/screen-ticket/renew", {method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify({ticket: old})});
if (r.ok) return { ticket: (await r.json()).ticket || "" };
if (r.status === 410) return { gone: true };
if (r.status === 404) return { old: true }; // an older server: it has no swapping
return {}; // try again in a moment
} catch (_) { return {}; }
}
// → the connection's address; "" to wait and try again (the server wasn't reached); null when
// there is nothing left to sign in with (the link's ticket is used up, and no login here).
async function address() {
const first = firstTry;
firstTry = false;
let auth;
if (lan) {
const t = token ? await ticketFor("api/vnc/ticket", {}) : (first ? ticket : "");
if (!t && !token) return null;
auth = t ? "ticket=" + encodeURIComponent(t) : "t=" + encodeURIComponent(token);
} else {
if (ticket) {
const r = await swap(ticket);
if (r.ticket) ticket = r.ticket;
else if (r.gone) ticket = "";
else if (!r.old) return "";
}
if (!ticket && token) ticket = await ticketFor("relay/screen-ticket", {host});
if (!ticket && !token) return null;
// (An older server with no tickets at all still gets the login, as before.)
auth = ticket ? "ticket=" + encodeURIComponent(ticket) : "t=" + encodeURIComponent(token);
}
return lan ? `${wsBase}/api/vnc?${auth}${botq}` : `${wsBase}/relay/vnc/${encodeURIComponent(host)}?${auth}${botq}`;
}
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
const $ = (id) => document.getElementById(id);
document.title = name;
$("name").textContent = name;
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
if (!embed) $("back").textContent = "←";
if (embed) {
$("popout").style.display = "";
$("popout").onclick = () => {
const clean = new URLSearchParams(q);
clean.delete("embed");
window.open("screen#" + clean.toString(), "_blank", "noopener");
};
}
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
let rfb = null, ws = null, control = q.get("control") === "1", tries = 0, connected = false, closed = false;
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
// X11 keysyms (the bots' computer is Linux) and the browser key codes noVNC sends beside them.
const SYM = { Return: 0xff0d, Escape: 0xff1b, Tab: 0xff09, BackSpace: 0xff08, Delete: 0xffff, Up: 0xff52, Down: 0xff54, Left: 0xff51, Right: 0xff53, Home: 0xff50, End: 0xff57, PageUp: 0xff55, PageDown: 0xff56, F11: 0xffc8, space: 0x20, ctrl: 0xffe3, alt: 0xffe9, shift: 0xffe1, super: 0xffeb };
const CODE = { Return: "Enter", Escape: "Escape", Tab: "Tab", BackSpace: "Backspace", Delete: "Delete", Up: "ArrowUp", Down: "ArrowDown", Left: "ArrowLeft", Right: "ArrowRight", Home: "Home", End: "End", PageUp: "PageUp", PageDown: "PageDown", F11: "F11", space: "Space", ctrl: "ControlLeft", alt: "AltLeft", shift: "ShiftLeft", super: "MetaLeft" };
const symOf = (k) => SYM[k] !== undefined ? SYM[k] : k.length === 1 ? k.toLowerCase().charCodeAt(0) : 0;
const codeOf = (k) => CODE[k] || (/^[a-z]$/i.test(k) ? "Key" + k.toUpperCase() : /^[0-9]$/.test(k) ? "Digit" + k : "");
const mods = modState(() => renderBar());
// Hold the modifiers down around `fn` (a key or a click), then let the once-held ones go.
function withMods(list, fn) {
if (!rfb) return;
for (const m of list) rfb.sendKey(SYM[m], CODE[m], true);
fn();
for (const m of [...list].reverse()) rfb.sendKey(SYM[m], CODE[m], false);
}
function press(key, extra = []) {
const list = [...new Set([...mods.list(), ...extra])];
withMods(list, () => rfb.sendKey(symOf(key), codeOf(key)));
mods.used();
}
// 虛擬觸控板 over noVNC: the pointer lives in the canvas's own (shown) pixels; noVNC turns them
// into the remote screen's. (Its _handleMouse* are the same calls its own mouse handling makes.)
let mask = 0, padOn = localStorage.getItem("anybot.pad") !== "0";
const BIT = { left: 1, right: 4 };
const canvas = () => rfb && rfb._canvas;
function placePtr(x, y) {
const c = canvas();
if (!c) return;
const cr = c.getBoundingClientRect(), sr = $("screen").getBoundingClientRect();
$("ptr").style.left = (cr.left - sr.left + x) + "px";
$("ptr").style.top = (cr.top - sr.top + y) + "px";
}
const pad = trackpad($("pad"), {
bounds() { const c = canvas(); return c ? { w: c.clientWidth || 1, h: c.clientHeight || 1 } : { w: 1, h: 1 }; },
move(x, y) { rfb?._handleMouseMove(x, y); },
down(x, y, b) { if (!rfb) return; mask |= BIT[b]; rfb._handleMouseButton(x, y, mask); },
up(x, y, b) { if (!rfb) return; mask &= ~BIT[b]; rfb._handleMouseButton(x, y, mask); },
click(x, y, b, n) {
if (!rfb) return;
withMods(mods.list(), () => { for (let i = 0; i < n; i++) { rfb._handleMouseButton(x, y, mask | BIT[b]); rfb._handleMouseButton(x, y, mask); } });
mods.used();
},
scroll(x, y, dx, dy) {
if (!rfb) return;
const notch = (bit, n) => { for (let i = 0; i < Math.abs(n); i++) { rfb._handleMouseButton(x, y, mask | bit); rfb._handleMouseButton(x, y, mask); } };
if (dy) notch(dy > 0 ? 16 : 8, dy);
if (dx) notch(dx > 0 ? 64 : 32, dx);
},
show: placePtr,
});
function tip() {
const n = Number(localStorage.getItem("anybot.padTip") || 0);
if (n >= 3) return;
localStorage.setItem("anybot.padTip", String(n + 1));
$("tip").innerHTML = "<b>一指</b>移動游標・<b>點一下</b>按・<b>點兩下按住</b>拖曳・<b>兩指</b>捲動・<b>兩指點</b>右鍵";
$("tip").classList.add("on");
setTimeout(() => $("tip").classList.remove("on"), 5000);
}
function showPad() {
const on = control && padOn && connected;
$("pad").classList.toggle("on", on);
$("ptr").classList.toggle("on", on);
pad.enabled = on;
if (on) { pad.center(); tip(); }
}
// The bar: 觸控板 | Ctrl Alt Shift ❖ | Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn | 快捷鍵 ⌨
function renderBar() {
const b = $("bar");
const btn = (attrs, label, cls = "") => `<button ${attrs} class="${cls}">${label}</button>`;
b.innerHTML = btn('data-pad="1" title="觸控板:手指移動游標;關掉改成點哪裡按哪裡"', "觸控板", padOn ? "on" : "")
+ '<span class="sep"></span>'
+ MODS.linux.map(([m, l]) => btn(`data-mod="${m}"`, l, mods.get(m))).join("")
+ '<span class="sep"></span>'
+ KEYS.map(([k, l]) => btn(`data-key="${k}"`, l)).join("")
+ '<span class="sep"></span>'
+ btn('data-combos="1"', "快捷鍵", $("combos").classList.contains("on") ? "on" : "")
+ btn('data-kb="1" title="輸入文字(支援中文與貼上)"', "⌨ 打字", $("type").classList.contains("on") ? "on" : "");
}
$("combos").innerHTML = COMBOS.linux.map(([name, ms, k], i) => `<button data-combo="${i}">${name}<small>${comboLabel(ms, k, "linux")}</small></button>`).join("");
$("combos").onclick = (e) => {
const c = e.target.closest("[data-combo]");
if (!c) return;
const [, ms, k] = COMBOS.linux[Number(c.dataset.combo)];
press(k, ms);
navigator.vibrate?.(8);
};
$("bar").onclick = (e) => {
const t = e.target.closest("button");
if (!t) return;
if (t.dataset.pad) { padOn = !padOn; localStorage.setItem("anybot.pad", padOn ? "1" : "0"); showPad(); }
else if (t.dataset.mod) mods.tap(t.dataset.mod);
else if (t.dataset.key) press(t.dataset.key);
else if (t.dataset.combos) $("combos").classList.toggle("on");
else if (t.dataset.kb) { $("type").classList.toggle("on"); if ($("type").classList.contains("on")) $("text").focus(); }
renderBar();
};
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
function state(text, kind) { $("state").textContent = text; $("dot").className = "dot" + (kind ? " " + kind : ""); }
function message(text) { $("msg").textContent = text; $("msg").style.display = text ? "" : "none"; }
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
// 接管 holds the bot's screen: its steps there wait while you drive (交還給 Bot lets them go on).
const apiBase = lan ? "" : "h/" + encodeURIComponent(host) + "/";
let holding = false;
function hold(on) {
if (on === holding || !token) return;
holding = on;
const bot = /^\d+$/.test(q.get("bot") || "") ? Number(q.get("bot")) : null;
fetch(apiBase + "api/box/hold", { method: "POST", keepalive: true, headers: { Authorization: "Bearer " + token, "Content-Type": "application/json" }, body: JSON.stringify({ bot, on }) }).catch(() => {});
}
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
function showControl() {
$("take").textContent = control ? "交還給 Bot" : "接管";
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
$("take").className = control ? "hold-on" : "main";
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
$("bar").classList.toggle("on", control);
document.body.classList.toggle("has-bar", control);
if (!control) { $("type").classList.remove("on"); $("combos").classList.remove("on"); }
renderBar();
hold(control && connected);
showPad();
if (rfb) { rfb.viewOnly = !control; if (control && !padOn) rfb.focus(); }
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
if (connected) state(control ? "你在操作(Bot 會等你完成)" : "即時觀看", control ? "hold" : "live");
if (embed && window.parent !== window) {
try { window.parent.postMessage({ anybotScreen: "control", control }, location.origin); } catch (_) {}
}
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
}
function retry() {
tries += 1;
state("連線中斷,重新連線中…");
message(tries > 3 ? "暫時連不上這台電腦(可能正在休眠或尚未啟動)。你可以在旁邊請它喚醒,或稍後自動重試。" : "連線中斷,正在重新連線…");
setTimeout(connect, Math.min(1000 * tries, 6000));
}
async function connect() {
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
if (closed) return;
message("正在連接畫面…"); state("連線中…");
const url = await address();
if (closed) return;
if (url === null) {
// Nothing would ever let it in again: say so instead of knocking every few seconds.
state("連結已過期");
message("這個畫面連結已過期(斷線超過十分鐘)。請回到 AnyBot 再開一次 Bot 的電腦。");
return;
}
if (!url) { retry(); return; }
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
ws = new WebSocket(url);
rfb = new RFB($("screen"), ws, { shared: true });
rfb.scaleViewport = true;
rfb.resizeSession = false;
rfb.qualityLevel = 6;
rfb.compressionLevel = 2;
rfb.showDotCursor = true;
rfb.viewOnly = !control;
rfb.addEventListener("connect", () => { tries = 0; connected = true; message(""); showControl(); });
rfb.addEventListener("disconnect", () => {
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
rfb = null; connected = false; showPad();
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
if (closed) return;
retry();
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
});
}
$("take").onclick = () => { control = !control; showControl(); };
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
function send() {
const t = $("text").value;
if (!t || !ws || ws.readyState !== 1) return;
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
// A modifier held and one letter typed: that shortcut (Ctrl, then c → Ctrl+C), not the letter.
if (mods.list().length && [...t].length === 1) press(t);
else ws.send(t);
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
$("text").value = "";
}
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
$("send").onclick = send;
$("text").addEventListener("keydown", (e) => { if (e.key === "Enter" && !e.isComposing) { e.preventDefault(); send(); } });
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
$("back").onclick = () => {
closed = true;
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
hold(false);
修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫 卡住當機 - ⌘1–⌘9(Win/Linux 為 Ctrl)在 ctx.input 裡又呼叫 ctx.input,egui 的 Context 被鎖兩次, 按住 ⌘(⌘C、⌘V、⌘Tab)視窗就永遠不動;改為只讀一次(bot_jump_key),加回歸測試 - 圖表 x 軸格線固定每 1 一條,縮小後一幀要畫上百萬條(凍結、記憶體爆);改為最多約 40 條, 滾輪不再被圖表吃掉(⌘/Ctrl+滾輪或雙指縮放) - 草稿每打一個字就同步重寫整個 state.json(含 fsync);改為停手 1.5 秒後才存,結尾空白也 不再造成每幀存檔 複製(三個系統) - Mac:pbcopy 從 Finder/Dock 開時沒有 UTF-8 語系,中文變亂碼;指定 UTF-8 - ⌘C 攔截只拿 CopyText,不再丟掉開連結、複製圖片、Linux 中鍵選取等指令(且只在 Mac 攔) - Windows:改用 Win32 剪貼簿(arboard,獨立執行緒),不再走 clip.exe(缺 BOM、多一個 NUL) - Linux:依 WAYLAND_DISPLAY/DISPLAY 選 wl-copy 或 xclip/xsel,都沒有時退回視窗剪貼簿 其他 - 頁面目錄點了不跳(標題位置從未記錄);目錄搜尋框按 Esc 會關掉整頁 - 圖表:單一系列欄名被 String::max 換成「數值」;同尺寸無標題的圖共用縮放;inf/NaN 不入圖 - KPI 卡片寬度未扣內距而超出欄寬 - 「還原上一個答案」在送出新訊息後會插錯位置;重試錯誤回覆不再存可還原的版本 - 手機:長輪詢回來時已切到別的聊天,不再把上一個聊天的訊息畫進來 - 輸入框上方頭像:思考時頭稍微縮小,三顆小球繞著頭轉(後面的從頭後經過、前面的壓在頭上並描邊), 不再被頭像蓋住 - 刪除未使用的 src/app/ui_kit.rs 驗證:macOS cargo test 374 通過(relay 18 通過);Windows/Linux cargo check 通過 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:19:59 +00:00
if (rfb) { try { rfb.disconnect(); } catch (_) {} }
if (embed && window.parent !== window) {
window.parent.postMessage({ anybotScreen: "close" }, location.origin);
} else if (history.length > 1) {
history.back();
} else {
location.href = "./";
}
};
window.addEventListener("message", (e) => {
if (e.origin !== location.origin || !e.data) return;
if (e.data.anybotSetControl !== undefined) {
control = !!e.data.anybotSetControl;
showControl();
}
});
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
手機操作電腦補上虛擬觸控板和按鍵列:一指移游標、點一下按、點兩下按住拖曳、兩指捲動或右鍵;Ctrl/Alt/Shift/❖(Mac 是 ⌘⌥⌃⇧)點一下按住、點兩下鎖住;「快捷鍵」面板一格一個名字(下一個分頁、切換視窗、拷貝…);手機「接管」真的讓 Bot 停手。 - mobile/trackpad.js(新):觸控板手勢和按鍵列的狀態,Bot 的電腦(mobile/screen.html,noVNC)和「這台 Mac」(mobile/index.html #v-screen)共用一份;大腦(src/remote.rs)和帳號伺服器(relay/)都在 /trackpad.js 給它。手勢參考 OpenBot 手機 App 的觸控板模式(只借做法,不抄程式碼)。 - Bot 的電腦:接管後下方一排「觸控板|Ctrl Alt Shift ❖|Esc Tab ← ↑ ↓ → ⌫ Del ⏎ Home End PgUp PgDn|快捷鍵 ⌨ 打字」;觸控板經 noVNC 自己的 _handleMouse*(游標自己畫);關掉觸控板回到 noVNC 原本的點哪裡按哪裡。修飾鍵按著時打一個字=那組快捷鍵。 - 接管會鎖住螢幕(新 POST api/box/hold,跟螢幕電腦的 api/sync/screen hold 同一件事):交還、關畫面、手機鎖住或切走就放開,回來再鎖上。以前手機的接管只有點擊或按鍵後 8 秒 Bot 才停。 - 小畫面(GET api/box/thumb?bot=)是那個 Bot 自己的螢幕,對話詳細資訊和需要處理卡帶上 bot(以前一律是共用的)。 - 這台 Mac:大腦的 api/screen/mac 多了 move(移游標)、drag(整條路徑)和點擊的 modifiers(只收 cmd/shift/option/ctrl/alt),組合鍵照用 press_key 的「cmd+tab」;手機頁面換成同一套觸控板、⌘⌥⌃⇧、Mac 版快捷鍵;拿掉「右鍵:開」(兩指點就是右鍵),修好快點兩下會多送一兩下點擊。 - 測試:mobile/trackpad.test.mjs(點一下、滑動、兩指點、兩指捲動、點兩下拖曳、連點、長按、修飾鍵一次/鎖住、快捷鍵的字),cargo test 有 node 時跑它(remote::tests::the_touchpad_turns_fingers_into_mouse_and_keys)。 - 功能地圖 box.md 加 box-phone-drive 和一步驗證;FEATURES.md 加「手機接手:觸控板和按鍵列」。 已驗證: cargo test 877 個全過;relay 的 cargo test 27 個全過;clippy 沒有新警告;node mobile/trackpad.test.mjs 13 項 OK;scratch 手機頁面打開 screen#…&control=1:按鍵列、快捷鍵面板(Alt+Tab 等 18 格)、Ctrl 點一下變亮;「這台 Mac」頁面:⌘ 點兩下鎖住、Mac 版快捷鍵面板。 未驗證: 觸控板動到真的畫面——Bot 的電腦要 Docker(scratch 沒有、不准碰使用者的),這台 Mac 會動到使用者正在用的螢幕,所以兩邊的實際點擊、拖曳、捲動、鎖住都沒有實機跑;這碰到 computer 的路徑(新的 move/drag/修飾鍵),照規定要實機測試加你簽名才能發佈。帳號伺服器要 make update-server 才有 /trackpad.js(沒更新前經帳號開的畫面頁會載不到觸控板)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 00:48:31 +00:00
// Away from the page (the phone locked, another app): let the bot go on; back again, hold again.
document.addEventListener("visibilitychange", () => hold(control && connected && !document.hidden));
window.addEventListener("pagehide", () => hold(false));
window.addEventListener("resize", () => { if ($("pad").classList.contains("on")) { const p = pad.pos; placePtr(p.x, p.y); } });
People watch and help on the bots' computer through VNC (noVNC), carried by the account server The core: the bot works the computer; a person watches it like a colleague, and takes over when it needs them. VNC is made for that (only what changed, every mouse move and key, touch on phones), so the pictures sent one by one go, and with them their own input path. - vnc.rs: a VNC proxy to the box's x11vnc through one docker exec (a Python bridge that ends with either side). It signs in to the box with the box's own password (its VNC_PASSWORD) and offers the viewer no password, so the password never leaves the brain. The person's clicks and keys make the bot's steps wait until 8 s after they stop; text typed in the viewer's box (any language) is pasted in the box. - Account server: /screen (the viewer page) and /novnc.js (noVNC 1.6.0, MPL-2.0, bundled); /relay/vnc/<host> takes the browser's WebSocket (account session, or a 10-minute ticket the app asks for with POST /relay/screen-ticket; owners and admins) and carries it over that AnyBot's lasting connection (vopen / vdata / vtext / vclose). Both ends of that connection wait 2 ms instead of 40 ms to read while things move: a request and its answer took up to 160 ms more than needed. - Phone page: 看 Bot 的電腦 and 接管 open the viewer page (also on the local network: /api/vnc on the AnyBot's own phone server). This Mac's own screen moved to the ⋯ menu. - Mac app: 看畫面 opens the viewer in the browser (a screen of a brain: the brain's computer by ticket; else this computer's box, noVNC straight from it). The in-app picture viewer, the live JPEG stream, the person's click/move/scroll/key endpoints and the input shell are gone. - Opening a Mac app uses LaunchServices (`open -a`): agent-desktop's launch waited on the window through accessibility and failed without 輔助使用 now and then. Measured on this Mac (made-up account, local relay + headless brain + the real box): viewer signed in in 0.4–0.7 s, a request and its answer through relay + brain + box 25–58 ms median; headless Chrome shows the desktop live in /screen. remote_e2e 28/28 ×2, 149 unit tests, relay 11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:05:44 +00:00
showControl();
connect();
</script>
</body>
</html>