Commit Graph

23 Commits

Author SHA1 Message Date
王性驊 06352f0ffb Merge branch 'fix-connector-review': 連接器與瀏覽器照一律詢問和自動審核
衝突留在瀏覽器步驟:採用連接器分支已改寫的檢查(網址正規化、一律詢問、審核),
本機網址卡片仍寫開會在哪一台(沒有名字時寫「執行 AnyBot 的這台電腦」)。

審查補上:
- 審核員對每一步都只讀參數的前 3000 字和最後 1000 字;只讀了兩端又說允許,或直接操作下說都不符合,仍先問。
- 先按過規則卡或 hook 卡,另一台電腦的上傳卡還在。
- 測試用的 hook 失敗時也會清掉,本機網址卡片測試不再跟 bot 1 的 hook 撞在一起。
- 功能地圖「照你的一律詢問」改成手機先確認打不開自動審核,再在電腦上寫規則、用 --ask 看四張卡(反斜線在 JSON 裡寫兩次,假模型才吃得到)。

已驗證: cargo test --bin anybot(702 過、46 ignored);featuremap:: 11 過;verify-anybot 手機:公開網頁以外不讀、中繼資料擋下、本機網址卡片寫「在 執行 AnyBot 的這台電腦 上」後拒絕、直接連線開自動審核被擋(toast 只能收緊、不能放寬,auto_review 仍 false)、四次 --ask 的一律詢問卡都是拒絕(反斜線那次打開的是 http://127.0.0.1/@a.com/,192.168 那次審核員看過「要審核的動作:在瀏覽器開啟本機或內部網路網址」)、已送帳本與設定檔(新增工作、換回預設、「你的瀏覽器」被擋);verify-approval-routing 的 run.sh 跟基準一樣
未驗證: 真的開網頁、打字、送出(要 Docker,這台沒有);桌面設定檔區塊(要開視窗);--ignored 的無頭瀏覽器實機;真的手機直接連線按卡片
未簽: 審批路徑、瀏覽器、連接器——要人類跑 --ignored 並簽名,沒有推
2026-11-19 11:24:09 +08:00
王性驊 14727cd226 fix: 直接連線再補三個放寬的路:/always-approve、匯入帶團隊分享、關機的電腦被算進「每一台」
複審 36420f3 用測試證明的三個繞過,和幾個小的:

1. 在聊天打「/always-approve」(/yolo):直接連線的 api/bots/:id/send 從沒問過檢查,
   擁有者身分就開了直接操作和一律放行。現在 remote.rs 在門口先看這句話是不是會放寬的
   AnyBot 指令(commands.rs 的 AppCommand::loosens,每個指令都要列在其中一邊,新的指令
   一定得決定),是就 403、什麼都不送;status、off 照常。只有門口知道是不是直接連線
   (帳號那條路送進來的 Cmd 一模一樣),所以擋在那裡。順便:`--ask` 跑 AnyBot 自己的
   指令(沒開一輪)以前結束碼是 1,現在是 0——地圖改在這台電腦上打「/always-approve」。
2. api/act/import_bot 帶著檔案裡的 team:true 就分享給團隊:share 的匯出不寫、匯入不收
   team(也清 branch_of、branches),電腦版一樣;lan_guard 把每個 api/act 動作都列在
   一邊,沒列到的一律 400,不再默默放行。
3. 可以用的電腦:帳號裡關機的電腦不在清單上,全勾就存成 None(每一台),被排除的那台
   開機又能用。現在沒列出的電腦維持原狀,有清單的 Bot 從手機上不會變成「每一台」(帳號
   那條路也一樣)。能力沒有這個問題:11 類永遠都列出來,None 只多出以後新版加的類別。
P2:支線的瀏覽器步驟指名 profile 只用在那一步(不再 set_current);支線換掉技能庫已有
   技能的檢查跟寫資料夾一樣忽略大小寫;直接連線把 Bot 加進分享給團隊的群組算放寬
   (phone_detail 多帶 team);SECURITY.md、account.md、autonomy.md 寫明打開「從手機看
   這台電腦的螢幕並操作」時這個保證不成立;autonomy.md「手機用擁有者身分打也可以」改成
   帳號連線才行。
P3:phone_act 照原字讀名字的那一半有自己的測試了。

已驗證: env -u 金鑰… DOCKER_HOST=unix:///nonexistent cargo test(683 過、46 ignored)、
cargo clippy --bin anybot --all-targets -D warnings、sh deploy/ci/lint-sh.sh、
verify-approval-routing run.sh --replay(沒有漂移,10 個重走都過);新的測試在放回
36420f3 的程式時都失敗(/always-approve 403、沒分類的動作、匯入的 team、關機的電腦、
phone_act 去空白、技能大小寫、支線的瀏覽器步驟、分享群組加成員);verify-anybot:
autonomy 照新步驟跑(手機打 /always-approve 被擋、字放回輸入框,--ask 打開),另外
手機打 /yolo 被擋、status 照答、直接連線匯入帶 team:true 的檔案後新 Bot 沒分享、沒分類的
動作 400;branch、browser、profile、phone、market 照地圖跑。
未驗證: --ignored 的實機瀏覽器測試(botbrowser 的 reads_a_real_page、a_persons_firefox_profile、
a_finished_job_quits_its_firefox、a_finished_job_quits_its_chrome,browser 的
lines_go_in_whole_and_numbers_stay_put、a_send_is_seen_with_the_post_it_answers_and_its_own_address、
numbers_controls_inside_web_components、drives_a_dashboard,vault 的 fill_live——open 的
參數改了)要人在實機跑、簽名;帳號裡的電腦關機那條要帳號伺服器(只有單元測試);分享
群組要帳號(只有單元測試)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
2026-11-18 20:09:52 +08:00
王性驊 68971e8669 fix: 網址照瀏覽器的讀法比對(web(domain:…)、內部網址卡);審核員只讀兩端時照樣問;上傳的開關卡不給審核省掉
第三輪審查(6a6d905..4303646)的四個 P1,加上能收的 P2。

P1-1 `web(domain:…)` 比對的不是瀏覽器打開的那個網站:gate.rs 自己切網址,`me@example.com`、
`example.com.`、`example.com\cart`、`browser_tabs` 帶網址開新分頁都對不上(0 張卡)。
P1-2 同一個根:web.rs 的 normalize_url/host_port 用 rsplit('@')、不把 `\` 當 `/`,
`http://127.0.0.1\@a.com/`、`http://192.168.1.1\.example.com/` 被當成公開網址,內部網址卡不跳。
修法:web::parse_url 用 WHATWG 的 `url` crate(Cargo.lock 本來就有,改成直接依賴)——`\` 是 `/`、
帳號@ 不是主機、小寫、punycode、結尾的點、各種寫法的 IP;normalize_url、host_port、web::host_of 都用它,
gate 的 web(…) 用 host_of 比主機(規則的網域也同樣讀),比對清單加上 browser_tabs 帶網址。
InBotsBrowser 把解析過的網址交給瀏覽器(open、新分頁、web_fetch),檢查的就是打開的;web_fetch
轉址的每一站也照解析過的去要。地圖寫清楚:只比對用網址打開或讀的那一步,點連結、轉址、上一頁不算。

P1-3 審核員只讀長參數的兩端:模型可以把要擋的東西塞在中間,審核員說允許就不跳卡片。修法:參數被截過、
而且這一步真的給模型看了(model_reads,跟 review_action 一樣的判斷)時,審核員的允許、直接操作下的
「都不符合」都改成跳卡片:「參數很長,自動審核只讀了開頭和結尾,所以先問你」(沒有直接操作時照舊可以
一律允許,跟審核失敗一樣)。選這個而不是把上限拉高:上限拉多高,中間都還是可能藏東西。

P1-4 從這台上傳檔案、電腦工具或「在這台電腦上執行」沒開時,那張卡被送進 reviewed(),允許規則就省掉了。
修法:抽成 here_upload_decision——開關沒開的那張卡(工作資料夾內外都是)一律跳、不給審核,別的 yes
(樣式卡的允許)也省不掉它;開關開著才照檔案規則和 reviewed()。

P2:
- browser.md 的陷阱和自動審核說的對齊(本機網址:一律允許、直接操作、自動審核的允許都可以不問,
  「一律詢問」照樣問)。
- 「對不上任何東西」的提醒(gate::rule_warning)擴到 web(…)(沒寫 domain:、用 *、寫了 https:// 或路徑、
  不是網站)和 tool(…)(不是哪一步的名字,例如 tool(browser) 要寫 tool(browser_*));featuremap 的
  every_tool 搬出測試,提醒用同一份工具清單。
- hook 的「ask」跟瀏覽器的樣式卡放在同一張(run_call 的通用 hook 詢問不再管 InBotsBrowser)。

沒改,記著(略過樣式規則的路):伺服器大腦上的 open_for_person、/goal 評審自己呼叫的 web_fetch、
在使用者自己的瀏覽器 browser_open(OnComputer,不用問的不比對)、別人傳來的訊息那一輪的 web_fetch
(沒有自動審核)。vault.rs 的 host_of 也是自己切網址,沒動。沒碰 src/remote.rs、src/botbrowser.rs。

特性表 connector_decisions_are_characterized 多 20 列(38 → 58):審核員說允許、長參數 × 審核員允許/
都不符合/允許樣式/詢問樣式。tool_specs_are_locked、approval_decisions_are_characterized 沒有 diff。

已驗證: 全部 cargo test 686 通過(不帶金鑰、DOCKER_HOST 指到不存在、ANYBOT_VAULT_KEY_FILE 放暫存、
  PATH 前面放假的 security 記下每次呼叫:這次 0 次);把四個修法和 hook 合併各自改回去,
  addresses_are_read_as_a_browser_reads_them、pattern_rules_decide_before_the_model、an_ask_pattern_stops_the_bots_browser、
  connector_decisions_are_characterized、an_upload_with_the_switches_off_always_asks、
  a_hook_ask_and_a_rule_make_one_card_for_a_browser_step 都失敗,改回來都過;clippy -D warnings、lint-sh、
  verify-approval-routing run.sh --replay(跟基準一樣);verify-anybot:browser 每一步可跑的照 md 原文冷跑全過
  (target/verify-anybot/20261118-200336:「在瀏覽器打開 http://127.0.0.1/@a.com/(符合你的「一律詢問」規則:
  web(domain:127.0.0.1))」,192.168.1.5\.example.com 跳內部網址卡、先給審核員看;全部拒絕、沒有開瀏覽器)
未驗證: 真的瀏覽器打開解析過的網址(scratch 沒有 Docker,這台開會出現真的瀏覽器);直接操作那一半的實機;
  電腦設定頁提醒那一行的樣子;--ignored 的瀏覽器實機測試(清單見 4303646)
未簽: 審批路徑、瀏覽器——要人類跑 --ignored 並簽名才能合併,沒有合併、沒有推

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
2026-11-18 20:06:35 +08:00
王性驊 f3ff553551 fix: 十一個小錯——瀏覽器設定檔換得了、支線改不了設定、直接連線的拒絕照實說、手機的標籤和設定頁照實寫
1. 瀏覽器設定檔只能列出:browser 的 action 就是 profiles,裡面的 list/add/use 傳不到
   browser_profiles,帶 name 也只列出。現在帶 name 就換到那個設定檔、還沒有就先新增
   (profiles_tool 自己判斷,工具定義不變);步驟寫「切換到「…」」。
2. 支線改得了設定:支線的 update_bot 按允許後把主 Bot 改名。update_bot、update_settings、
   update_my_profile、teach_skill,和新增/修改/移除連接器或 hook,在支線一律馬上回
   「支線改不了設定:回到主線再請它改。」,不跳卡片;ChatGPT 登入登出照樣跳卡。
3. 直接連線的拒絕說「區網連線(沒有加密)」:直接連線是 https,擋的原因是只憑手機密碼。
   改成「這會放寬 Bot 能做的事:同一個網路直接連的裝置只能收緊、不能放寬…」;能力、可以
   用的電腦只有勾回才擋(勾掉以前也被擋)。
4. 本機網址的卡寫「(在  上)」:Bot 的電腦都開不了瀏覽器時,寫「(在 執行 AnyBot 的這台
   電腦 上)」。
5. 手機把監看叫醒的訊息標「例行任務」:照電腦版的標籤表(目標、例行任務、觸發、訊息管道、
   來自其他 Bot),加上「監看」;測試確認手機和電腦用同一張表。
6. 步驟名字:replay_skill 寫「重播技能 「記一筆」」(以前「工具 工作資料夾」);例行任務的
   送出證據寫「傳訊息給其他 Bot 給 同事:早安」(以前「message_bot 工作資料夾」);只有
   檔案步驟會寫資料夾。
7. 執行步驟用的模型的卡寫「自動 → 不分開」(以前「(空) → 「off」」)。
8. ChatGPT 的卡照要做的事寫標題:「…想要登出 ChatGPT 方案」「…想要換 ChatGPT 帳號」
   (以前「想要ChatGPT 方案登入」),手機和電腦都是。
9. 正常關掉 AnyBot 時,沒做完的支線寫「AnyBot 關掉了,這條支線停了」(以前「被停止了」,
   像使用者按了停止);還在等主線的也一起照實寫。
10. 手機的設定頁只讀一次:狀態版本一變就重讀開著的設定頁,其他頁下次打開重讀(/always-approve
    填了預設規則,權限頁不用重新整理)。
11. 沒有 Docker 時手機的電腦頁寫「已是 v14」「這台 Docker 主機沒有 gVisor」:問不到的事送
    null,頁面寫「沒有 Docker,現在沒有這台電腦」,不說有沒有 gVisor。

功能地圖:browser、branch、profile、autonomy、models、market、phone、files、replay、
routines、box 的子功能、Bot 那一行、步驟和看到的結果照新行為改;拿掉只在描述錯誤的陷阱
(autonomy 的設定頁不更新、box 的已是 v14)。FEATURES.md 同步。verify-approval-routing:
approval_json、approval_body 只改了標題的字,模型的假設不變,rehash coverage.tsv(這個
commit 是新的同步 commit)。

找到但沒修:browser 的 tabs 也一樣,裡面的 switch/new/close 傳不到 browser_tabs(工具
說明本身就叫模型用 action 帶),要改工具定義才修得好。

已驗證: env -u 金鑰… DOCKER_HOST=unix:///nonexistent cargo test(676 過、46 ignored)、
cargo clippy --bin anybot --all-targets -D warnings、sh deploy/ci/lint-sh.sh、
verify-approval-routing run.sh --replay(10 個重走都過);新測試先在拿掉修正的程式上跑過、
11 個都失敗;verify-anybot 照地圖跑 box、browser、models、files、replay、routines、branch、
autonomy、profile、phone、market 的步驟,全部通過(證據在 target/verify-anybot/)。
未驗證: --ignored 的實機瀏覽器測試(botbrowser 的 reads_a_real_page、a_persons_firefox_profile、
a_finished_job_quits_its_firefox、a_finished_job_quits_its_chrome,browser 的
lines_go_in_whole_and_numbers_stay_put、a_send_is_seen_with_the_post_it_answers_and_its_own_address)
會開真的瀏覽器,要人在實機跑、簽名;本機網址的卡按「允許」(會開真的瀏覽器);電腦版視窗
上的卡片標題和支線卡(要開視窗);帳號連線的手機(要帳號伺服器)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
2026-11-18 17:44:16 +08:00
王性驊 1ad81532cd feat: 所有 HTTP 用戶端信任同一份憑證;連接器連同它帶起來的程式一起關;按停止馬上結束連接器的呼叫
工程基礎計畫 E5,參考 grok-build 的 clippy.toml(HTTP 用戶端只能從一個地方建)和 ProcessScope。

- net.rs:net::config() 是所有 HTTP 用戶端的起點,憑證是公開的加上這台電腦自己信任的(tunnel::trusted_roots);net::agent(秒數) 是常用的那種(整個請求的逾時、錯誤狀態當成回答,一種逾時一個、重複用)。18 個自己建 ureq 的地方全部換成 net::config(),各自的逾時、轉址、User-Agent 不變。以前只有連帳號伺服器的那條看這台電腦信任的憑證:公司自己簽憑證的連接器、模型服務、Webhook 在別處會失敗。帳號伺服器的用戶端改用 net::agent,拿掉它自己的那份快取。
- clippy.toml:disallowed-methods 擋 ureq::Agent::config_builder(net.rs 以外)。
- 連接器:關掉、移除、重新連線、連不上時用 tools::kill_tree 連同子行程一起關(npx/uvx/sh 底下真正的伺服器以前留著)。
- mcp::call_until:本機連接器的呼叫每 0.2 秒看一次停止,按停止馬上回「已停止」;伺服器晚到的答案下一次會跳過。用網址連的還是等它回或 120 秒(ureq 的請求停不下來)。
- 測試用的假連接器多一個 slow 工具(FAKE_SLOW=1 才列出,不影響其他測試的工具數)。

已驗證:cargo test 560 全過;cargo clippy 沒有 disallowed 的違規。新測試:按停止 0.3 秒後呼叫在 2 秒內結束、之後同一個連接器照樣能用(sum=3);用 sh 帶起來的連接器關掉後,它帶起來的 sleep 也沒了;所有用戶端的憑證至少是公開那一份。
未驗證:公司自己簽憑證的真的連接器(這台沒有)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:13:59 +08:00
王性驊 1eb88a9a60 公測前第二輪:區網直連改 HTTPS、手腳只聽大腦簽過的指令、更新驗簽章、聊天各存各的檔、視窗沒在前面也照常運作(提示音不再等你切回來)
- 區網直連:同一個埠用這台電腦自己做的憑證說 HTTPS(lantls),區網的 http 轉到 https,本機和 Tailscale 仍可用 http
- 配對碼後面帶一段不經過帳號伺服器的密鑰,大腦給手腳的指令都簽章(綁電腦、時間、只能用一次)
- deploy/update.sh、install.sh、install.ps1:記住簽章公鑰後,新版不是它簽的就不裝;make sign-setup 啟用
- state.json 只剩設定,聊天存 chats/bot-<id>.json,有變才寫;金鑰密封存檔
- 帳號伺服器:閒置連線少醒、讀取緩衝變小、請求開頭 15 秒沒送完就斷;本機壓測沒有洩漏
- 視窗縮小/被蓋住時照樣處理 Bot 的事件;任務完成也響提示音;Mac 關掉 App Nap
- 團隊成員在 Bot 忙時的訊息排隊不丟、群組沒有 @ 時看擅長分派、手機可改個人檔案
- setup.sh 對 root Docker 提出警告;收到停止訊號先收尾

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3a7riWESpv471gDgC
2026-11-14 00:40:16 +08:00
王性驊 eb3157852a 安全、修正: harden sandboxes, approval gates, vault, relay roles, and fix protocol/UI bugs
- macOS 沙盒與工具 (tools.rs, policy.rs, docindex.rs): block AppleScript raw events and
  concatenation outside the sandbox; stop exposing ~/.ssh or localhost sockets in Sealed
  mode; deny writes to shell profiles, LaunchAgents and .git/hooks; expand secret-file
  ignores and enforce symlink/policy checks across SSH, device and document search.
- 電腦操作與遮罩 (computer.rs, agent.rs, marks.rs, desktop.rs, cloudbox.rs, portal.rs):
  forbid clicking or typing into AnyBot's own windows; extend the sensitive-action hard
  gate to raw coordinates, Return/Delete submits and remote devices; stop batch steps if
  the front app changes; black out secrets on zoom, show, >600-node trees, adjacent OTP
  labels, box screenshots and control text lists; preserve non-text Wayland clipboards.
- 保險庫與瀏覽器 (vault.rs, vault_store.rs, browser.rs, botbrowser.rs, web.rs, box/browser):
  verify tab host and HTTPS atomically at fill time; taint filled tabs against browser_eval
  and PDF export while masking card/CVC values and screenshots; remember sites only on
  always-allow; drop --remote-allow-origins=*; gate private URLs and block metadata/Docker
  ports, OrbStack 198.18/15 and IPv6 transition ranges.
- 帳號伺服器、同步與傳送 (relay/, remote.rs, mirror_ui.rs, share.rs, drops.rs): isolate
  paired hands hosts from brain sync, tickets, pairing and backup overwrites; redact
  routine trigger secrets and clear REDACTED when endpoints change; isolate channel and
  team-member turns from owner memories, appctl and grants; scrub shared bot exports and
  reset grants/routines on import; validate drop IDs and serialize chunk writes.
- 網路與協定穩定性 (httpd.rs, tunnel.rs, vnc.rs, Caddyfile*): fix chunked integer overflow
  and CRLF header injection; enforce Origin checks, connection/job caps, 200 MB backup
  reads, unique atomic temp files and ASCII hex guards; bound deflate unzip and VNC sniff
  buffers; move VNC stdin/text off the tunnel loop.
- 介面、排程、語言與其他修正 (app.rs, i18n.rs, providers.rs, skills.rs, routines.rs,
  setup.rs, store.rs, preview.rs, attach.rs, speech.rs, teams.rs, mcp.rs, voice.rs):
  wire up the delete-routine confirmation dialog and mirror run-now; preserve unsaved
  mirror edits across brief disconnects; give Chinese skills distinct folders and approval
  gates; convert parsed tool JSON fields without corrupting code fences, URLs or paths;
  fix Hourly DST offsets and time out unattended routine approvals; lock --install-skill,
  cap docx/xlsx unzip sizes, isolate test env keys, and tighten local file permissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-12 14:34:10 +08:00
王性驊 f9a261959c version_0_1_1-alpha 2026-11-11 16:19:06 +08:00
王性驊 a514b33fb3 Bug sweep: gates, relay 2FA, Windows input, snapshots, encodings
Permissions and reach
- a file leaving a computer passes the same questions as reading it;
  "looking" shell commands that do more than look ask first
- a symlink out of the work/sealed folder counts as outside it
  (real paths, not just lexical ones); the search walk skips links
- web_fetch and skill_install read the public web only: localhost, the
  LAN and cloud metadata are refused, at every redirect
- preview shows a file without running it; browser_upload may ask
- vault: logins no longer match across shared suffixes (pages.dev,
  com.tw, ...); registrable_domain knows public suffixes
- axwrite: found elements are retained (use-after-free)

Relay
- replacing or turning off 2FA needs the current code (rate-limited);
  new recovery codes only count once enrollment is verified
- a removed computer loses its socket and its `call` access
- a site name taken by another account answers 409
- RELAY_TRUST_PROXY: the login lock counts the caller's address, not
  the proxy's (compose files and README)
- httpd: half a body is not a request

Desktop
- sign-in, join and restore work with 2FA on (code field; --serve reads
  ANYBOT_ACCOUNT_CODE; the setup wizard points to a pairing code)
- Windows: text was typed twice; modifiers are held through click, drag
  and scroll; horizontal scroll; screen control is no longer refused
- a recording that hits the limit is transcribed, not thrown away
- bot's computer: a new home volume restores the snapshot; a snapshot
  is read through before the home is wiped; a failed volume removal
  stops reset/restore
- events of a stopped turn no longer land in the next one; each channel
  message gets a turn of its own
- saving a bot's settings keeps what it got meanwhile (three-way merge);
  a save file that cannot be read is kept
- pages in Big5/GBK/Shift_JIS are read in their own encoding
  (encoding_rs); osascript output past 64 KB no longer stalls
- pick_tab keeps a job's own non-http tab; pictures larger than the
  texture limit are fitted; the auto-update time field takes typing
- skills live in <data>/skills; memories are unnumbered in the prompt;
  the phone may skillify and skill_install

CI
- the test step fails when the tests fail (it piped into tail)

Tests: anybot 268 passed, 27 ignored; relay 16 passed; clippy unchanged.
Not run: Windows on a real machine (win.rs type-checked alone), the
Docker paths of the bot's computer, the live accessibility writes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-10 11:46:17 +08:00
AnyBot Dev 6f660dd15d One browser tool: 25 schemas → 2, actions like the CUA prior (H2)
- browser {action: open|read|elements|find|table|screenshot|click|hover|
  type|press|select|scroll|wait|tabs|back|upload|download|pdf|dialog|eval|
  profiles|fill} — the shape models are trained on (Anthropic CUA, OpenAI CUA)
- vault fills ride on it: fill {kind: login|card|contact, id}; vault_list
  stays its own tool; the fills' approvals (every use asks, the model never
  sees the secret) are untouched — expand happens at the model-output
  boundary, so oplog, approvals, replay, remote limbs keep internal names
- web keeps {web_fetch, browser}; the eighteen browser_* and the three
  fill_* schemas leave the model's view (−48% schema text, −58% counting
  the old web trio; 25 tools → 2)
- tests: every action maps to a real internal tool, every internal tool is
  reachable from the one schema
2026-11-09 18:11:36 +08:00
AnyBot Dev 1bc2fdcec9 Rewrite decompilation comments as behaviour specs; move reverse-engineering docs out of the repo; drop third-party marks from UI strings (i18n tables synced) 2026-11-09 16:37:33 +08:00
王性驊 645db96d9c AnyBot's browser drives Firefox too, the person's own Firefox profiles included
Firefox dropped Chrome's DevTools protocol, so bidi.rs speaks WebDriver BiDi and does each
DevTools command the browser tools use the BiDi way (real mouse and keys, typing, screenshots,
PDF, dialogs, uploads, downloads, tabs). The 18 tools themselves are unchanged and pass the same
dashboard test on Firefox as on Chrome.

- A computer with only Firefox runs AnyBot's own profiles in it (under the Snap/Flatpak corner
  of the home folder when Firefox is packaged that way).
- The person's own Firefox profiles are choices too, by the names Firefox shows (profiles.ini
  and the newer profile switcher's SQLite list): 「阿金(Firefox)」, or just 「阿金」. Firefox
  can't be taken over once open, so a profile open the everyday way is refused with "close it
  first"; AnyBot then opens it itself, logins intact.
- Settings lists them without a remove button; the messages name Firefox as an option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-08 00:55:17 +08:00
王性驊 4506cc149b Clippy is clean on macOS and Linux, for the app and the relay
Every warning `cargo clippy --all-targets` gave (50 on macOS, 8 more only on
Linux, 1 in the relay), fixed without changing what anything does:
- long types get a name (Peer, Members, Imported, Joining, Mention, Stream…);
- the two big enum variants are boxed (the vault's login plan, joining an
  account);
- a test now waits for the copy it relaunched (it left a zombie behind);
- a hint's format had a dead `if` whose two branches were both "";
- the rest is what clippy suggests: sort_by_key, as_chunks, is_none_or,
  is_multiple_of, while let, from_ref, next_back, struct init, no casts to
  the same type.

Checked: cargo test (177 macOS, 181 Linux), relay tests (11), remote_e2e
28/28, and the live Linux test (X11; Wayland clicks, keys, Chinese typing,
scroll and screenshots).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-07 10:10:28 +08:00
王性驊 81e87545cd Each job works on its own tabs; a Lima VM the box lives in is started when it's down
- Bots share a browser (the box's Chromium has one profile). Every step acted on the tab in
  front, so two jobs at once read and clicked on each other's pages and one finishing closed
  the other's. A job (named, and the name rides along to another computer's browser) owns the
  tabs it opens or lands on, popups it clicks open included; its steps use its latest one, and
  another job's tabs are never used, listed or closed. When it ends it closes only its own.
  Real run on the box: two jobs at once each read their own page with the other's in front,
  both tabs survived both endings; a popup was read by the job that opened it.
- A Docker host that is a Lima VM's socket and doesn't answer (the Mac restarted): AnyBot
  starts the VM (limactl start, at most once in 5 minutes), and a step that needs the box
  waits for it. No login item needed. Real run: the VM stopped, AnyBot had it back in 10 s;
  the box then woke on use, still gVisor with Chromium's sandbox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-07 00:50:29 +08:00
王性驊 76a76c7d7a Whole control flow checked against real chats: what the bot sees is what is there, every step lands, nothing done twice
Web
- web_fetch kept pages with a <header> only up to it (taken for <head>): articles came back as their menus.
- browser_open waits for the page to load and returns it like browser_read (one step fewer per page);
  actions wait for the page to hold still instead of fixed 1-2.5 s sleeps; one way to reach the tab.

The bot's computer (box v6)
- Numbers only on what can be seen: clipped to the window and the page's visible area, none under
  another app's window (a link scrolled under the toolbar was numbered on Back).
- press_key with a typed character no longer swallows the keys after it (xdotool type --args 1).
- The person's input through noVNC/TigerVNC is noticed again (fence, continuous updates, QEMU keys).
- "Nothing changed" only after clicks, scrolls and drags; long text is pasted; one screen step at a
  time; one docker inspect per step when the box is known ready; poppler-utils for long PDFs.
- One typing path and fewer round trips (stdin variant, unused picture path, extra batch execs gone).

The person's computers
- Linux: the window system's front app when it has one, and the reason when there is none (was 「」);
  hidden and off-screen controls get no number; wording no longer names a tool that doesn't exist.

The loop
- Without Docker, the bot's own computer runs no commands where there is no sandbox (Linux, Windows):
  it was a plain shell on the brain itself, keys in reach, asked nothing.
- The bot's own computer is re-checked each step; unreachable computers are failures, not safety
  blocks; no direct-mode note on every result; an empty reply is asked again; scrolling and keys
  aren't counted as going in circles; steps aren't moved to a computer that can't do them.
- One finish() for every step's result, keep_grant(), dead appctl list_computers/SERVING and the
  impossible server branches removed; duplicated prompt instructions merged.

Tests: 162 (Mac) / 166 (Linux) unit; real box drills 6/6 on box v6; a brain without Chrome browses
on its box; remote E2E 28/28.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-06 17:44:59 +08:00
王性驊 8e9736a7db Long tasks finish and the box's browser works from a cloud brain
- A turn may take up to 100 steps (was 25, which cut off real work; Grok Bot sets no limit).
  Every 25 steps the bot is asked whether it is still getting anywhere.
- The system prompt asks for independent tools in one step and combined commands.
- Browser steps for the box always go to the box's Chromium. They used to depend on whether
  the brain itself had a Chrome, so a cloud brain sent them to "the person's browser".
- The box's DevTools forward passes bytes with a plain read/write loop. std::io::copy splices
  on Linux and held back short requests, so the box browser never opened from a Linux brain.
- A gateway's HTML error page shows as plain words.
- Real test a_brain_without_chrome_browses_on_its_box (ignored): passes in a Linux container
  with no Chrome against a real box, and fails without the routing fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-06 16:51:25 +08:00
王性驊 5656d355af Bots click by number: every control on the screen is boxed and numbered, on every computer
A bot asked to open a Threads profile clicked an empty strip ten times: it guessed coordinates
from a picture, and the web tools' description told it they didn't work on its own computer.

- marks.rs: the picture a bot gets has every button, link, field and menu item boxed and
  numbered (a tiny built-in digit font, pure Rust), with the same numbers in a list. click /
  typing / scroll / mouse_move take the number (ref) and land on the control's centre.
- Where the controls come from: macOS AX and Linux AT-SPI through agent-desktop on a person's
  computer (desktop::elements); AT-SPI in the bots' own computer (box/a11y, after XBot's
  box-a11y), web pages included. On a Mac a control whose spot another app's window covers gets
  no number (topmost window at its centre must be the app's; the Dock's invisible full-screen
  window doesn't count). open_app waits until the app is really in front.
- No going round in circles: a step that changed nothing says so; the same step (clicks within
  16 px) a third time in a turn comes with a warning, from the fourth time it isn't run.
- The box (version 4): one TigerVNC server instead of Xvfb + x11vnc, the AT-SPI bus and registry
  at boot, one browser launcher (box/browser, after XBot's box-chrome: same profile and CDP,
  renderer accessibility, a launch lock, stale profile locks cleared). One docker exec per look
  (list + picture, ~0.4 s). A brain updates an older box by itself when it has been idle a
  minute (files and logins stay); a new box is never made from an older image.
- Gone: computer_use_read_app (the list is in every picture), computer_use_mouse_button, the
  per-call picture for the phone (it gets a plain one), the stale browser_read note; the prompt
  says web work goes through browser_* by number, and never to read browser cookie or history
  files.

Tests: marks (numbering, drawing, fingerprints), box_numbers_are_exact on a box from the new
image (a Threads-like page: the icon links get numbers, Profile clicked by number, Chinese typed
into the numbered field, a click on nothing called out), box_screen_is_exact, VNC e2e 11/11 on
TigerVNC, Calculator 7×8=56 by numbers through the signed app on this Mac, remote_e2e 28/28,
153 unit tests; Linux build + 157 tests + x11_live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 00:47:01 +08:00
王性驊 3132f8ce91 Every computer goes by its own name; a server brain works on the computer the person uses
- A bot's own computer is 「<bot> 的電腦」; this one and the account's others go by their names.
  The server brain picked 你的電腦 by sorted host id, so a desktop left on the server won.
- 「我的電腦」 is the computer the person typed on (the relay names it); unknown means ask.
- A step moved back to the chosen computer tells the bot so.
- Composer chip and bot settings choose the computer by name; a screen asks the brain.
- A screen's 電腦 card and viewer show the brain's computer, not this one's box.
- A screen's chat copy that falls short asks for everything again instead of appending;
  清除聊天記錄 on a screen clears the brain's chat.
- Model requests to a private address go through the person's computer first.
- Phone typing on the box sends the text the tool reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 16:47:28 +08:00
王性驊 96174c4776 Stream deltas keep tool-call slots; chunked bodies accepted; portal sessions race-safe 2026-11-05 15:48:20 +08:00
王性驊 4c0db53647 Replies in Traditional Chinese when that is the setting; a cloud brain's browser is the person's
- 語言 繁體中文: a reply's Simplified characters are turned into Traditional with Taiwan
  wording (zhconv), since some models (Qwen) slip despite the instruction.
- A brain on a server: browser steps go to the person's computer (its hands) unless the
  server's own browser is named; 你的電腦 is listed first.
- update_bot says the default computer it set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:46:42 +08:00
王性驊 94cadca1b8 A brain on a server knows which computer is the person's; the phone page opens the brain in use
- On a server brain whose hands are the person's computer, 你的電腦 is that computer;
  the server itself is 大腦伺服器 (its browser too), so 「我的 Mac」 means the Mac.
- A brain with its own hands no longer lists the account's other brains as computers.
- 查看電腦 lists the computers the bot really has, with their real names.
- Phone page: with several brains on, it opens the one the account's computers use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:40:01 +08:00
王性驊 5841d797be One brain, many screens: other AnyBots show and edit the brain's bots
- Brain answers /api/sync (per-screen deltas of settings and messages),
  /api/sync/edit (small edit operations) and /api/sync/act (chat actions).
- Relay forwards host-to-host sync requests within one account (role mirror).
- Desktop: choose a brain in 手機與帳號; its own bots are kept aside; offline
  shows the last copy read-only and reconnects by itself.
- Keys and tokens stay on the brain (redacted and restored on edits).
- Browser tools can run on another computer of the account (computer arg).
- anybot --serve: ANYBOT_DEVICE_LINK=1 and ANYBOT_BRAIN=名稱.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 17:46:43 +08:00
王性驊 d7ee3f5db9 AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 16:51:51 +08:00