Commit Graph

25 Commits

Author SHA1 Message Date
王性驊 84f1797ec8 雲端大腦也能用 Claude Code:映像檔裝上 claude(固定 2.1.332),登入放在大腦的資料卷
- deploy/server/Dockerfile:npm 裝 @anthropic-ai/claude-code@2.1.332;CLAUDE_CONFIG_DIR=/data/claude,登入憑證跟著大腦的資料卷走,重建大腦不會掉
- src/claudecli.rs、src/providers.rs:沒登入時的說明改成 claude auth login(本機和雲端都對)
- 功能地圖 claudecode:雲端大腦怎麼登入(伺服器主人 docker exec),以及條款限制:只給伺服器主人自己用,其他帳號改用 API 金鑰的「Claude」供應商
- FEATURES 同步

已驗證: 用 debian:bookworm-slim 容器實測 npm 安裝 claude 2.1.332 成功(/usr/local/bin/claude);CLAUDE_CONFIG_DIR=/data/claude 時設定寫進 /data/claude,沒有寫到 /root/.claude;cargo test 全部 927 通過(含 claudecli::、featuremap::、tool_specs_are_locked、approval_decisions_are_characterized)
未驗證: 真正的伺服器映像檔(完整 make update-server)還沒建置;伺服器上的實際登入流程(要主人的 Claude 帳號);雲端大腦的 Claude Code 實際回覆(要帳號和額度);Anthropic 條款判斷還要主人自己核對

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-26 13:45:18 +08:00
王性驊 7eb2d79aa5 手機「載入更早的對話」補上來的不會再不見:大腦每次送的只是它發布的那一段(最新 120 則、不含步驟結果,從手機那份的開頭起),往回補超過那一段的開頭之後,下一次更新(例如來一則新訊息)就整份換成那一段,剛補的又不見、按鈕跑回來;有工具步驟的聊天那一段很短,按一次就會。現在補上來的留在那一段前面(S.winAt),新訊息把舊的推出那一段時也接到前面,存起來的那份一起記著,切到別的 Bot 再回來、頁面重開也接得對(舊版頁面存的那份第一次只留大腦送來的那段,裡面可能有舊錯誤留下的缺口);等「載入更早」回來時聊天開頭移了就不接、從現在的開頭再問一次;對補上來的訊息按表情,向大腦拿那則現在的表情。回到最底下最多留 300 則,捲在上面讀時超過 600 則(背景 300、怎樣都超過 1200)從頂上收,正在讀的那則留在畫面同一個地方(切到背景那一刻記下,回到前景畫好再放回去)。順手修:點進聊天、按表情之後要等 20–40 秒才更新——11/20 起 loadChat 在大腦回「沒變」時直接 return,loading 一直卡在 true,之後只能等輪詢順便帶過來。手機的編號清單照 Markdown 的讀法:空一行隔開的還是同一個清單(以前每一點都是「1.」),編號從第一點寫的數字起,縮排在一點底下的子項目、續行在那一點裡(以前被攤平成同一層一起編號)。大腦管理員:核對 Docker 網路改不成寫進紀錄、還不知道擁有者時先不動;更新時 Caddyfile 用 relay 容器的 IP 或 .env 裡的 {$變數}/{$變數:預設} 轉到 relay 的也認得出來。功能地圖 chat 和 FEATURES 跟著改。
已驗證: cargo test(906,含 featuremap::、layout_audit::;新的 node 測試:手機聊天視窗 30 項、Markdown 清單 12 項,換回舊程式各自會失敗);verify-anybot 全新 scratch 照功能地圖 chat「開聊天分頁」一步步走(40 輪各一步、按兩下到最開頭、再傳一則「填充1」還在),另外:每輪跟大腦整段聊天逐則比對一模一樣、離開聊天來兩則再回來 0–1 秒內更新、整頁重開接得對、對補上來的第 4 則按 👍 畫面和大腦一致、捲在上面讀時來新訊息讀的那則不動、模擬切到背景來兩則再回前景(5 輪)讀的那則不動、空行隔開的「1. 1. 1.」畫成 1、2、3 並有子項目;Debian 10 和 Ubuntu 24.04 上 Caddyfile 轉到 relay 的各種寫法(含變數、預設值、IP)判斷正確;測試機兩台更新成功、Docker 網路核對照舊。四輪獨立審查找到的 P1(載入更早的競態、存起來的那份沒記前段、清單無上限、背景時對著舊畫面調捲動)都修了。
未驗證: 最後一輪獨立審查(切到背景那一刻記下位置之前的版本)還沒回來;真的 iPhone(無頭 Chrome 模擬觸控、用改 document.hidden 模擬切到背景);超過 300、600、1200 則的收法只有自動測試,沒在實機堆到那麼多則。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-23 11:15:51 +08:00
王性驊 1605b38354 雲端大腦換新版失敗時不會一直停著:上次換到一半大腦管理員被停掉(舊的已經停了),之後新的又一直建不起來,以前只會一直排「換新版」、不會叫醒它,現在換不成就先把停著的舊大腦叫醒;新的已經換上原名、還沒啟動就被中斷的,下次刪掉它、放回舊的再換一次(以前直接刪掉舊的,新的起不來就沒有退路);讀不到原本的登入(Docker 一時沒回答)就先不換,不再改領新的登入(會把正在跑的那個登出)。管理員每一輪核對每個大腦接著的網路:現在設定給 Docker、而且建立時就有 Docker 的才接到 Docker,從 ANYBOT_BRAINS_DOCKER 拿掉再更新立刻拿掉(不等換成新版),掉了的接回來,放回或叫醒的舊大腦不會拿到建立時沒有的 Docker。更新時 Caddyfile 還有別的轉到 relay 的寫法(一行的、http://relay:8080、容器名、matcher、to、{ 後面接註解)就不用暗號、照舊,並在完成畫面寫出來、說怎麼自己補;同一台 Caddy 代理別的服務(NAS、別的網站)或網域名稱有 relay- 照樣補上;已經有暗號那行的 Caddyfile 還有沒帶暗號、轉到 relay 的路也寫出來。FEATURES 和功能地圖 server 跟著改。
三輪獨立審查:第一輪沒有 P0/P1(提的 P2:Caddyfile 判斷太寬、叫醒時可能把收回的 Docker 還回去,都修了);第二輪一個 P1(叫醒、放回時照現在的設定接 Docker,會接給建立時沒有 Docker 的舊大腦),改成每輪核對網路;第三輪沒有 P0/P1,這輪沒再改程式。留下的 P2:核對網路失敗時沒寫紀錄;擁有者檔案不見又剛好拿不到帳號清單時,擁有者的 Docker 會短暫被拔掉;用變數或 IP 轉到 relay 的 Caddyfile 偵測不到。

已驗證: cargo test(904,含 featuremap::、layout_audit::;brains:: 10)、bash -n;Debian 10(mawk 1.3.3)上 13 種 Caddyfile 寫法的判斷;三個範本和 nobledesktop 現在的 Caddyfile 不會被誤提醒,多一個沒帶暗號的區塊會提醒;隔離測試機 test3:舊大腦停著、新的建不起來(ANYBOT_BRAIN_MEMORY=1k)→ 叫醒原本那個(同一個容器 ID、在線),改回來後換成新版;新的換上原名還沒啟動就中斷(手動造出 -old 和沒啟動過的容器)→ 放回原本那個、在線;手動拔掉擁有者的 Docker 網路 → 下一輪接回,手動把 Docker 網路接給沒有 Docker 的大腦 → 下一輪拿掉;舊版伺服器測試機:Caddyfile 多一個 reverse_proxy http://relay:8080 → 更新印出警告、暗號拿掉、Caddyfile 沒被動、網址照常,還原後暗號回來。
未驗證: 讀不到原本登入就不換(要讓 Docker 一時不回答,造不出來,只讀過程式);換上後新的啟動失敗、放回舊的那條路(沒在實機重現);nobledesktop 還沒換上這一版(它沒有管理員開的大腦,這次改的只影響那些和更新時的 Caddyfile 檢查)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-23 09:10:12 +08:00
王性驊 ace27374e6 傻瓜安裝:伺服器 sh AnyBot/install.sh server 再 make update-server 就好(自動裝 Docker、自己選網址——Tailscale 用 http、區網用自己的憑證、有 Tailscale 憑證用它的名字——自己產生邀請碼和所有金鑰,中間不問問題,沒有終端機也跑得完);不用先開帳號:大腦管理員(compose 的 brains,anybot --brains)看到有人用邀請碼註冊,就替那個帳號開一個雲端大腦 anybot-brain-帳號(自己的資料卷、帳號伺服器發的登入,伺服器不存密碼),停了叫醒、重開機回來;第一個註冊的是擁有者,只有它的大腦有伺服器上的 Docker(Bot 的電腦),其他人的大腦拿掉 NET_RAW、限記憶體、CPU、程序數,最多 20 個;更新後換成新版時新的先在舊的旁邊建好,Docker 拒絕的話舊的照常在跑,舊的確定停了才換、換不成放回舊的,管理員中途被停掉下次接回來,一直失敗的帳號隔 1、2、4…分鐘最多半小時再試。電腦登入有雲端大腦的伺服器時,先等它上線(最多約一分半)再當它的螢幕和手腳,不把自己當大腦。帳號伺服器只相信 Caddy(帶暗號)說的請求來源,大腦自己寫 X-Forwarded-For 繞不過註冊、登入的次數限制;舊的 Caddyfile 更新時自動補上那一行(舊版 mawk 也行),Caddy 檢查過才換上。
順手修:Anthropic 回「錯誤 400:Invalid signature in thinking block」時這一輪不再停下來:舊的思考內容對不上就請它丟掉(thinking-binding-controls)或拿掉重送,聊天紀錄裡也一起丟掉,之後不再撞到;手機帳號登入的一個偶發失敗的測試。

功能地圖新增 server 區(models 和地圖的 README 跟著改),FEATURES、README.md、docs/multi-device.md 也改了;計畫在 docs/plan-2026-11-install.md(S8 App 信任伺服器的憑證、S9 伺服器上裝手腳還沒做)。

已驗證: cargo test(902)、relay cargo test(29)、bash -n;在 nobledesktop 上的隔離測試機(Ubuntu 24.04、全新安裝):一般使用者 install.sh server+make update-server 不給任何設定就跑完、兩個帳號註冊後各自有雲端大腦且在線、只有擁有者的大腦連得到 Docker、偽造 X-Forwarded-For 被擋、ANYBOT_BRAINS_SKIP 停掉指定帳號、重開機後全部回來、舊版伺服器(有自己的大腦)更新後保留原本的大腦並補上 Caddyfile、程式更新只換一次、只改 .env 不換、Docker 拒絕建立時舊的照常在跑、這次的更新(大腦管理員就緒、amy 換成新版在線、沒有殘留);Debian 10 的 mawk 1.3.3 補 Caddyfile;Anthropic 真的帳號:舊思考內容對不上時這一輪照常回答、丟掉的有回報;七輪獨立審查,最後兩輪沒有 P0/P1。
未驗證: 公開網址(有網域、DNS)那條路(要真的網域);Mac App 用帳號登入後等雲端大腦再當螢幕只跑了測試(ignored 的實機測試要真的伺服器);更新中途按 Ctrl-C 把管理員開回來只讀過程式沒實際按。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-23 08:09:02 +08:00
王性驊 073e0c5f83 伺服器的 docker-socket-proxy 多開 GRPC、SESSION:Docker 23 以上的大腦主機預設用 BuildKit 建置,大腦裡的 docker 要經 session 建 Bot 的電腦的映像檔,少了這兩項會被擋(403),「更新/重建」建不出來。照 nobledesktop 上手改、已經實際建成功的設定合回來(正式和 CI 兩份 compose,SECURITY.md 一起改)。
已驗證: nobledesktop(Docker 29.8.1)的 _ping 回 Builder-Version 2、大腦裡的 docker 是 20.10.24(跟著主機用 BuildKit);開了這兩項後 /session 經過代理(400 而不是 403),anybot-box:1 就是開了之後建成的;docker compose config 兩份都讀得過。
未驗證: 拿掉這兩項重現建置失敗(要在使用者的伺服器上重建映像檔,沒做)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
2026-11-22 13:05:17 +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
王性驊 f7ce2dae0c 連接器: the brain's connectors work — a screen shows the brain's state, 重新連線, many tools are found instead of sent
- 設定 › 連接器 on a screen showed the screen's own (empty) MCP state: every brain connector read
  「未連線」 and its error never reached the person. The brain now sends its connectors' state with
  each sync; errors from the brain say 「在大腦上:」.
- 重新連線 on each connector (computer, screen → brain, phone); one that is on but not connected is
  tried again each minute; a link that died (process ended, HTTP session expired) is dropped and
  connected again instead of failing every call.
- More than 20 connector tools: none ride along. The model gets find_connector_tool (the list of
  connectors, search by words) and use_connector_tool (runs the found tool, asked like the tool
  itself). A brain with scc (82) + the market's sent ~170 tools / ~120 KB a turn, over the
  128-tool limit of many services.
- A server that doesn't start says why: no Node.js / uv, a folder not on this computer, and the
  last lines it wrote to stderr; it is ended instead of left running.
- The brain image has nodejs/npm, python3 and uv (uvx), caches on /data.
- Moving to a brain leaves connectors that name this computer's folders here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5Mk1tvt3gyzfzhDgb
2026-11-12 15:53:17 +08:00
王性驊 f9a261959c version_0_1_1-alpha 2026-11-11 16:19:06 +08:00
王性驊 36bc2bedaa 伺服器: one way to start it and one place for its settings
make update-server now starts the server through setup.sh --start, the same
path as make server, instead of its own docker compose call. Both use the
Docker named in .env (DOCKER_SOCKET) rather than whatever plain docker
reaches, so a host with both rootless and root Docker no longer gets a
second, empty server on the other daemon. The Tailscale HTTPS port comes from
the port in ANYBOT_RELAY_PUBLIC_URL (e.g. :8443), 443 without one. Adds make
server-logs, and skips the 80/443 check on a Tailscale-only setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:26:35 +08:00
王性驊 28784232a5 記憶: a page to see it, a few lines picked while typing, a local model
The memory had grown into a list carried whole, a top-14 recalled by a
trigram index and pasted into the system prompt with the clock, and a
page that broke its own layout. Nobody could see what went to the
model, the prompt cache missed every message, and 「記住」 kept saying
the same thing twice. Rebuilt per the spec (docs/memory.md):

- Three kinds in memory.db: 記得的事 (fact), 做過的事 (event, a line per
  finished turn), 整理過的 (rollup). Each keeps pinned, uses,
  last_used, deleted, superseded_by, span. state.json keeps the facts
  as the copy that syncs; the page reads SQLite.
- Search: jieba words ∪ CJK bigrams in an FTS5 unicode61 table
  (Traditional text goes through Simplified first), weighted share of
  query terms hit; plus local vectors, vec = clamp((cos−0.35)/0.35).
  score = max + 0.15×min, events ×0.9. ≥0.15 suggested, ≥0.5 ticked,
  ≥0.55 carried when nobody chose (3 at most).
- What the model gets: the system prompt has the time zone and the
  pinned memories only, the same every turn. Each person message gets
  〔送出時間〕 and 〔相關記憶〕 from Message.memories, built in
  group_history into a transient Message.context, so the beginning of
  a chat reads the same next turn (cache hits) and the event log,
  skills and audit see only what was typed. A memory already carried
  in view isn't carried again; each carry counts a use.
- Picks travel with the message: Cmd::Send / POST send / sync act
  "memories" (empty = none; absent = the brain chooses, once, saved).
- remember finds the like one (cos ≥ 0.85 or the same words) and asks
  for `replaces`; the old one is superseded, never carried. A fact
  forgotten and remembered again comes back. New search_memory
  (query, kind), with dates; read-only.
- Nightly on the brain, no model: events past 30 days fold into a line
  per week (「11/3–11/9 做過的事(14 件):整理照片 ×3…」, ≤400 chars,
  like with like by words or vectors), weeks past 180 days into months;
  the folded go to 最近刪除 for 30 days. Facts are never removed. The
  page offers duplicates, facts unused for half a year, and what can
  fold now.
- Local model: minishlab/potion-multilingual-128M through m2v.rs (same
  token ids as model2vec-rs on 13/13 sentences, cos ≥ 0.9999, without
  tokenizers' 1.1 GB). Converted while downloading: vocab.bin,
  table.i8 (int8 + row scales), dims.json, 137 MB kept of 530 MB;
  ANYBOT_HF_BASE picks a mirror (now passed into the server's brain
  container too). Loaded when first needed (34 ms), let go after 10
  idle minutes. The brain loads it; a screen only with a document
  folder set; hands and phones never. 設定 › 一般 › 語意搜尋:
  本機模型/Ollama/關閉; a new engine clears every vector.
- Three files, three connections: memory.db (backed up nightly, 7
  kept), docs.db (a cache), oplog/audit.db (30 days). An old audit.db
  hands its memories and documents over once and shrinks (a real one:
  172 MB → 16 KB). docs_search scans every chunk now, vectors cached
  in RAM (it stopped at 8000); FTS optimize + VACUUM daily (260 MB of
  tombstones over 31 MB of text).
- API: POST /api/memory (owner) and /api/sync/memory (mirror). Reads
  answer on the HTTP thread; writes go through phone_act("memory").
- Screens: a memory dialog (Bot menu 記憶…, Bot settings 打開記憶) with
  counts, live search, filters, suggestions, per-item kind/date/uses
  and pin/edit/forget/restore; chips above the composer 300 ms after
  typing stops, with a token estimate; 「帶了 N 條記憶」 under person
  messages. The phone has the same as a 記憶 tab, chips and tag.

Checked: make test passes (app 297, relay 16), with new tests for the
scores and thresholds, Traditional Chinese segmentation, remember's
dedupe and replaces, two turns sending the same beginning, no double
carry, weekly/monthly folding and the trash, and the audit.db move.
Brain idle 37 MB as before, ~230 MB with the model loaded; search on
the brain 0.2–0.5 ms, 7–44 ms from the phone page. A deadlock found on
the way (stats re-taking the lock) is fixed and tested.

Docs: docs/memory.md has the whole design; FEATURES.md, protocol,
architecture (zh/en), multi-device and install say what changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 07:46:50 +08:00
王性驊 12c9944dee Server voice service: Whisper on the brain's own server, checked for real
`make server` now asks whether to run a voice service there (and the
kept-setup menu can add or remove it): speaches, Whisper
large-v3-turbo on the CPU, behind the brain only (no published port),
enabled with COMPOSE_PROFILES=voice so it composes with the Tailscale
and LAN files. The brain sees ANYBOT_VOICE_URL, fills 設定 › 語音 › 聽
with it once (what is changed later stays), and asks the service for
its model at each start: this build downloads only when asked (it has
no PRELOAD_MODELS, and the 0.8.2-cpu tag is older still, so the image
is pinned by the digest that was tested).

Tested end to end on 12 CPU cores with the compose file itself: first
start 404 s to download the model, later starts 1 s; 11 s of Mandarin
mixed with English (Chrome, Tesla FSD) in 3.4–3.6 s, every word right.
small is three times faster and slipped a character. Reading aloud
stays with another service: speaches can't say Chinese (its espeak has
no "zh"), English works.

From the same test: a service that answers 200 with no sound is now an
error said in words (it was played as silence), Whisper's ASCII
punctuation in Chinese becomes full-width (,?!), and speaches'
"not installed locally" says the model is still on its way.
2026-11-11 00:14:50 +08:00
王性驊 983a2c2f02 install.sh: stop dying on macOS at the compile step
"$RUST_HOST;" is one variable name to macOS /bin/sh (bash 3.2): it
swallows the first byte of the full-width punctuation, so with set -u a
plain \`sh install.sh app\` aborted at [3/4] with "RUST_HOST\*: unbound
variable". Four such lines in install.sh, one in the server setup.
Brace them, add make lint-sh (sh -n for every shipped script plus a
check for this pattern) so it stays fixed.
2026-11-10 14:32:56 +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 5f7efd7dba Plan: P6 complete (step 2: embeddings + document shelf) 2026-11-09 20:23:38 +08:00
AnyBot Dev bc779d68c5 Server: drive Docker through a filtered socket proxy, never mount the raw socket 2026-11-09 16:36:51 +08:00
王性驊 00f6723588 HTTPS on the local network's own IP, with a certificate the server signs itself
setup.sh offers 「區網 IP」 (alone, or next to Tailscale): Caddy serves https://<LAN IP> with its
own small certificate authority (tls internal, default_sni for clients that send no name) and
hands out the root at http://<LAN IP>/anybot-ca.crt for each device to trust once.
docker-compose.lan.yml binds Caddy to that address only, so it sits beside tailscale serve.

The app now accepts, for the account server, the certificates this computer trusts as well as
the built-in public ones (HTTP and the WebSocket alike), so it connects once the root is
trusted; before that it says what to install instead of "the certificate is wrong".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-07 21:27:07 +08:00
王性驊 4605b317d8 Bot 的電腦 can run under gVisor: its own kernel, Chromium's sandbox back on
容器隔離 in 設定 › 電腦: standard (runc, the container is the only wall, Chromium runs
--no-sandbox) or hardened (runsc: a virtualized kernel, all capabilities dropped but the few
the desktop needs, ANYBOT_BOX_SANDBOX=1 turns Chromium's own sandbox back on). Box image v7.
deploy/mac/gvisor-vm.sh makes a Lima VM with Docker + gVisor for a Mac (started at login),
gvisor-migrate.sh moves the box's files and logins there.

Checked and finished before committing:
- the hardened choice is offered only on a Docker host that has runsc; a box set to it on a
  host without it opens the standard way and says so (it used to not start at all)
- the settings row shows what the box really runs on, and when 更新 is needed
- no swap only under gVisor (a standard box keeps Docker's default)
- the migrate script sees the running Mac app ("AnyBot", not "anybot")
- the VM script starts an existing VM by name, checks runsc and the kernel from the Mac
- the version test says 7

Real run in the Lima VM: desktop, VNC, numbered controls, xdotool and screenshots work; no
Chromium process has --no-sandbox, renderers run with seccomp and their own namespaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-07 00:03:25 +08:00
王性驊 a202a96c02 Server image: keep dependencies fetched from GitHub between builds
agent-desktop comes from GitHub, and only the crates registry and target were cached, so every
server update fetched it again; a slow GitHub made nobledesktop's update fail (cargo exit 101, then
a fetch that hung for over ten minutes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-06 18:15:22 +08:00
王性驊 102746d9e8 A brain's box can go by its own name (ANYBOT_BOX_NAME); the server's brain takes over its old box under anybot-brain-box
A desktop AnyBot left on the server (older build) took "anybot-box" for its own and paused it
every ~20 s as idle while the brain woke it: the bots' computer kept showing as asleep. The
brain now renames its box once (files are in the volume, kept by name) and uses that name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 18:20:45 +08:00
王性驊 6d6461e4f3 Server setup: Tailscale address instead of a domain, and a no-questions mode
- setup.sh offers the computer's Tailscale address (HTTPS from tailscale serve, Caddy not
  started, nothing open to the internet) — docker-compose.tailscale.yml
- ANYBOT_SETUP_USER / ANYBOT_SETUP_PASSWORD [/ ANYBOT_SETUP_DOMAIN] answer the questions,
  for scripts and deployment tools; install.sh server passes them through

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-05 01:26:33 +08:00
王性驊 472a004f87 One-step install: install.sh, fixed Linux and server builds, clearer README
- install.sh (curl | sh): app, hands, server and deps modes; installs system packages
  (right names per release, e.g. libasound2t64 on Ubuntu 24.04), Rust via rustup (1.95+),
  Docker for the server; limits parallel compiles on small machines
- Server Docker image: add the ALSA build/runtime packages (the build failed), cache the
  cargo registry and target between rebuilds, JOBS build arg
- 加一台電腦 now gives a line that installs AnyBot on a blank computer before joining it
- Makefile: make deps installs Rust too, make doctor, clear message when Rust is missing/old
- README rewritten: one line per use, getting started, update/remove, troubleshooting,
  deployment options; docs/install.md and multi-device.md follow it
- Tested on fresh ubuntu:24.04 (app) and debian:12 (curl | sh hands) containers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-05 00:52:10 +08:00
王性驊 365dc87e54 Add a computer with one line: pairing codes, simpler setups
- 加一台電腦 (phone menu and the app's 大腦 card) gives a ten-minute,
  one-time code and the line to run: anybot setup <address> <code>. The
  new computer joins as hands for that brain with no password and nothing
  to answer, starts with the computer and checks the brain sees it.
- anybot setup without arguments is one screen: address and code (a pasted
  line fills both), or the account and password instead. No role, name or
  confirm questions; a brain is asked only when there are several.
- Hands computers are no longer offered as brains.
- The server setup asks only the domain, account and password.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 20:56:06 +08:00
王性驊 cb922da3fe anybot setup and the server setup: guided setup with a brain picker
- anybot setup: a full-screen terminal guide (role, name, account server,
  account, which brain) that saves the settings, installs a systemd user
  service (with a virtual screen when there is none), and checks that the
  account server and the brain see the computer. Flags for scripts.
- Hands can be limited to one brain; the account server says which AnyBot
  asks. Choosing a brain in the app does the same.
- deploy/server/setup.sh: domain, account, sign-ups and keys step by step;
  writes .env and Caddyfile, starts everything and checks HTTPS. The
  server's brain creates the account on first start.
- deploy/linux/hands.sh installs what's needed and opens anybot setup
  (no password kept in a file any more).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 20:38:45 +08:00
王性驊 b153051e58 Lasting connection to the account server, per-item sync, files and models via the brain
- Each AnyBot keeps one WebSocket to the account server (pinged, reopened
  within a second when cut). Requests come down it at once; calls to other
  AnyBots of the account (brain sync, hands) go up it. Frames carry raw
  bytes, compressed when that saves space. HTTP long-poll stays as fallback.
- The account server knows at once when an AnyBot goes away.
- Edits to lists and maps go item by item, so two computers editing one
  list keep both changes.
- Screens fetch chat files from the brain, get model lists through the
  brain's keys, and show the brain's computer as the brain's.
- Moving this computer's bots skips starter bots the brain has and bots
  already moved.
- The phone goes to the brain instead of a computer that shows it.
- deploy/linux/hands.sh: a Linux computer (with or without a screen) as
  hands, kept running by systemd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 19:30:32 +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