Commit Graph

26 Commits

Author SHA1 Message Date
王性驊 8ed7132e6b /btw 支線、送出先顯示;公測前的安全與資源修正(帳號盜用、灌爆、團隊權限、背景指令與連線的上限和清理)
支線與介面
- /btw:Bot 的分身帶著同一段對話和記憶平行做另一件事,做完回報到主聊天;主線在忙時先判斷會不會衝突,會就等主線做完
- 螢幕一次只給一輪工作操作(所有 Bot 適用)
- 「/」只列指令,打字才找這個 Bot 自己的技能
- Bot 工作中送出的訊息立刻以淡色顯示(電腦、手機)
- 支線修正:沒被讀到的回報照常進聊天、卡片顯示結果、可回答支線的問題、重新產生不吃掉卡片和回報

安全(中繼伺服器)
- 大腦回傳的內容只放行安全類型並加沙箱;團隊改成邀請制;手機不照大腦說的類型開檔案
- 沒登入的請求最多 256 KB、接收中的上傳有總量上限、單一 IP 連線上限、常駐連線另計
- 登入次數加上每帳號上限並先計數再驗證;密碼雜湊同時最多 4 個
- 新增電腦要 15 分鐘內剛登入;可改密碼;註冊限速,有邀請碼時第一個帳號也要
- 發布的網站不能送表單和對外連線;Caddy 加安全標頭

安全(大腦)
- 區網(明文)不能打開直接操作、加一律允許規則、加連接器;區網登入 30 天沒用失效
- 團隊成員只看得到勾選「團隊成員可以使用」的 Bot
- 沒有角色的請求一律拒絕;環境變數的金鑰只送官方位址

資源
- 中繼:小變動每分鐘寫一次、回應有總時限、每台電腦呼叫上限、網站/登入/電腦/配對碼上限、資料檔壞掉不啟動
- App:伺服器回錯誤和連線秒斷時逐次退避;區網看螢幕偵測斷線
- 背景指令:刪 Bot 和支線結束時停掉、最多 24 個、結束 10 分鐘後移除、可用 stop 停掉
- 截圖在收起和歸檔時釋放;刪 Bot 時刪附件和對照表;每晚清稽核資料和暫存;手機圖片快取上限

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3a7riWESpv471gDgC
2026-11-13 23:36:34 +08:00
王性驊 3b8c4c3d3b Bot 之間溝通:ask_bot 問同事並等回答、群組 @點名、共用頁面/「關於你」記憶/教技能;修正插話丟附件、Enter 核准失效等
問同事(ask_bot)
- A 問 B 並等它回答:問題放進 B 自己的聊天,B 用自己的模型、工具、記憶和電腦做,最後的回覆交回 A
- 最多轉 3 手、不能互等(避免卡死)、對方忙就排隊(10 分鐘逾時)、停止 A 時 B 也停
- message_bot 也加轉手上限;別的 Bot 叫的不算使用者的話(改不了自己的設定)

群組 @點名
- 「@名字」只叫被點到的成員回答;成員在回覆裡 @ 別人就接著說(一輪最多 8 則)
- 電腦和手機的輸入框打 @ 會列出成員
- 修正:每個成員帶自己的記憶;成員回覆的每一步都記得是誰說的

共用資源
- Bot 可以讀其他 Bot 的頁面(只能讀,改要請作者改)
- 共用的「關於你」記憶:每個 Bot 都帶著,記憶頁可切換查看、編輯;外人的訊息不帶
- teach_skill:把自己會的技能教給同事(先問你);同事名冊列出每個 Bot 會的技能

修正
- 插話(Bot 工作中傳訊息)會帶附件:聊天有檔案卡片,模型看得到圖片;當機復原也帶著
- 輸入框有焦點、框是空的時 Enter 允許待核准的步驟(原本被當成空白送出吃掉)
- 大腦的螢幕連不到大腦時,引用、附件、記憶不會先被用掉
- 「還原上一個答案」存在 Bot 上:重開還在,連大腦的畫面和手機都能還原;停止的回合也留著
- Bot 忙時被叫醒(例行任務、message_bot、觸發器)改成排隊開自己的一輪,不再壓成純文字插話
- 停止時結果已回來的步驟標成完成;輸入法剛選字的那一格不送出

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3a7riWESpv471gDgC
2026-11-13 21:34:03 +08:00
王性驊 bf3238d960 Bot 個人檔案:soul、擅長、技能、能力、可用電腦、同事名冊;例行任務每輪開新對話(省 token)
每個 Bot 是獨立的個體(src/profile.rs、src/app/profile_ui.rs)
- 新欄位:soul(只有自己讀,放在提示最前面)、擅長、不找它做的事、會的技能、能力、可以用的電腦
- 同事名冊:每個 Bot 的提示裡一行一個其他 Bot(簡介、擅長、不找它、在哪幾台電腦),不含別人的
  soul 和記憶;順序固定,吃得到快取
- 能力 11 類(上網、瀏覽器、螢幕、檔案與指令、Mac App、連接器、電話簡訊 X、例行任務、頁面、
  合作、管理 App):沒勾的工具不提供、規則不寫進提示;硬叫會被 agent 擋下並說該找誰
- 技能:說明只列自己會的,use_skill 只讀得到自己的;自己學會的自動算它的
- 可以用的電腦:自己的電腦一定可以;預設電腦不在名單時回到自己的電腦,不誤報「沒有連線」;
  其他畫面也拿得到完整電腦清單來勾;匯出 Bot 不帶電腦名單和草稿
- 舊 Bot 全部勾選(None = 全部),行為不變
- 例行任務:每輪只從那則訊息讀起(Message::fresh),提醒先讀頁面/查記憶;聊天畫面不變,
  使用者自己的下一則照樣看整段
- 順手修:角色說明結尾的「。」不再變成「。。」
- 實測(照建議勾能力):明日之星固定內容 ~21.7k → ~11.5k token、FSD ~25.5k → ~13.2k;
  例行任務每輪歷史最多 ~70k → 幾百

連接器(MCP)
- 實測三個連接器都能用(本機用 AnyBot 自己的 MCP client):time(get_current_time)、
  fetch(讀 example.com)、SccMCP(82 個工具,唯讀的 system_status 查詢成功;超過 20 個走
  find / use,搜尋得到)
- 測試:有「連接器」能力的 Bot 拿得到(大的走 find/use、提示有說明),沒有的拿不到,硬叫三種
  方式都被擋
- 測試用的假模型伺服器改成讀完整個請求再回,平行跑測試時不再偶發斷線

驗證:macOS cargo test 389 通過(連跑三次);Windows/Linux cargo check 通過

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:14:51 +08:00
王性驊 c834ab689f 修正卡死: ⌘ 一按視窗就鎖死、圖表縮小凍結、打字每鍵寫檔;複製中文亂碼;頭像不再擋住思考動畫
卡住當機
- ⌘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 14:19:59 +08:00
王性驊 66dce03cee 思考模式、連接器帳密、圖表: a bot's thinking mode, connectors that log in with a username and password, native charts
思考模式: each bot picks 自動/快速/平衡/深入. Claude gets output_config.effort,
OpenAI-compatible services get reasoning_effort; a model that refuses the
setting is retried without it and not sent it again.

連接器: a connector takes a 帳號 and 密碼. {username}/{password} written in the
command, env, address or header are filled in there; written nowhere, a local
server gets MCP_USERNAME/MCP_PASSWORD and a remote one Authorization: Basic.
The password is kept like a key: screens see only 已設定, and the brain clears
it when a screen changes the command or address. A test now covers a screen's
switch stopping and restarting the brain's connector.

Also in this tree (written by pi-bolt earlier): ```chart blocks drawn as
native charts, older images sent as summaries with a look_image tool, and
image tokens counted in the history size.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha4t4P58pvWECQYXBjo
2026-11-12 21:00:14 +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
王性驊 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
王性驊 3720ee501e 問題卡、搜尋: the bot asks with a card; every chat is searched; a refusal holds for the turn
- 問題卡 (ask_person, src/ask.rs): up to 6 questions on a card above the input, one at a
  time — a choice (one click moves on), several choices, or a field that arrives filled
  for the person to correct; 「自己回答」 on every question, 上一題 and 略過. The turn waits;
  a message typed instead leaves the card unanswered. Travels as an approval of kind
  Question (questions as JSON) with a new answer Answered, so the window, a screen of
  another brain and the phone draw the same card.
- 搜尋所有聊天 (src/find.rs): the sidebar's search also lists what the person and the bots
  said in every chat, past conversations included, and attachment names; newest first,
  40 at most. A click opens the bot (bringing a past conversation back first), scrolls to
  the message and lights it for a moment.
- 拒絕後停下: a step the person refused is refused for them when it comes back unchanged
  in the same turn — no second card, no second review — until they write again.
- The bot's instructions: stop after a refusal instead of trying another way; before
  sending, posting, buying or deleting, check the person's own messages asked for exactly
  that, and ask with the card when they didn't.
- 直接操作 no longer answers a hand-off (or a question) on the person's behalf.
- The repeated-step check leaves questions to the person alone.
- Screenshot views `ask` and `find`; FEATURES.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-12 10:17:32 +08:00
王性驊 f0b417f7cc 外觀: a real bold weight, and 設定 › 一般 as cards of rows
- 思源黑體 Bold is bundled next to Regular: titles, bold words and headings in replies, the chosen page and
  choice are set in it (粉圓體 and the system font keep their one weight; replies still fake bold there)
- 設定 › 一般 rearranged: 外觀, 記憶與文件, 通知, Bot, 帳戶 — each a card whose rows hold one thing, the name on the
  left and its control on the right, at most one small line under the name, the rest behind the ?
- choices are one segmented control everywhere on the page; switches instead of checkboxes; plain names
  (聊天的顏色, 用意思找記憶, Bot 可以翻的資料夾)
- the page list: the chosen page in ink, a yellow dot on 更新 when a newer build waits
- cards on the other pages take the same quiet fill and corners

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 21:54:24 +08:00
王性驊 31f41f62c6 目標: /goal keeps a bot working turn after turn until a second model, reading the chat, says the goal holds
- goal.rs: the command (/goal, /goal clear, /goal <condition>), the judge's brief and how its
  answer is read (met / not_met / waiting / impossible), and the brakes: 20 turns, 3 idle turns,
  a question for the person, a failed turn, a stop, a silent judge or a restart pause it; the
  person's next message takes it up again
- app/goal_ui.rs: on the brain, each finished turn of a goal is checked on a thread with the bot's
  quick model; not yet met wakes it with 「[目標]還沒達成:…」, the rest leave a note in the chat
  (never sent to the model) and tell the person when away; the line above the input with 清除目標
- typed on the computer, a screen or the phone, the brain acts on it; /goal leads the / list on
  both; the phone shows the bar, the notes and the 目標 tag
- anybot --ask "/goal …" runs to the end, like claude -p "/goal …"
- tests for the command, the verdicts, the brakes, the brief and the slash list; FEATURES.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 20:24:27 +08:00
王性驊 41b6b7f465 技能: / in the input picks one; on a brain's screen the brain adds, installs and deletes them; 設定 › 整合's lists keep their buttons clear
- Typing / at the start of the input (computer and phone) lists the skills that are on: names that
  start with what is typed first, then names containing it, then descriptions (「/簡報」 finds
  pptx). A click, or ↑↓ and Enter/Tab, puts 「/name 」 in the input; Esc closes the list. Sent, the
  brain recognises 「/name」 and adds a line after the message telling the model to read that skill
  with use_skill first, so a phone or a message channel gets it too; a / that names no skill (a
  path) gets nothing. The phone asks the brain for the list again at each new /, so a skill added
  since is there.
- On a screen, 加入 / 安裝 / 刪除 ran on the screen's own disk and only the list entry reached the
  brain: a GitHub skill's scripts stayed on the screen's computer, an install also pushed every
  skill in that computer's folder into the brain's list, and a deleted skill's folder stayed on the
  brain and came back at its next start. These now go to the brain (/api/sync/skill, the phone's
  own 「skill」 action): it fetches an address itself, a folder or .md file on the screen's
  computer goes up whole with its files, and a delete takes the folder too. 「把這台的 Bot 搬到大腦」
  hands over skills the same way. A refused package leaves no folder behind.
- 技能, 技能市集 and 連接器市集 rows: a long description took the whole row and 開啟 / 檢視 / 刪除
  / 已加入 / 安裝 were drawn over it. The buttons are laid out first and the description ends in …
  before them (the whole of it on hover).
- Screenshot mode: ANYBOT_SHOT_KEYS="ArrowDown@60;Enter@64" presses keys at given frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:54:58 +08:00
王性驊 9a70232a14 語音: a call and 朗讀 read the answer just given, also on a brain's screen; the bot panel keeps its width
- A call read the last answer in the chat as soon as the bot didn't look busy. On a screen of a
  brain the bot shows up as working only a moment after the question leaves, so it read the answer
  before and never the new one. It now reads only an answer that comes after what was said.
- 朗讀每個回答 did nothing on a brain's screen (only a turn run on this computer read aloud). The
  screen now reads a turn the brain just finished well; a brain without a window reads nothing.
- The voice row (聲音, a 200 px box, 載入聲音清單) was wider than the bot panel, and egui then moved
  the panel's left edge under the chat. The row takes two lines where it's narrow, and the panel's
  contents can no longer widen it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:47:20 +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
王性驊 40d1d9707a Voice: its own 設定 › 語音, run by the brain for every screen and the phone
Voice was three implementations that broke on their own: speech to text
borrowed the OpenAI key (so with only Grok set up the mic recorded,
then failed), OpenAI's models it hard-coded stop on 2027-02-26, read
aloud was macOS `say` or espeak-ng (silently nothing on Windows, where
espeak isn't installed), and the phone used the browser's own
recognition. Now:

- 設定 › 語音 has 聽 and 說, each a service: off, OpenAI-compatible
  (OpenAI, Groq, a Whisper server of your own: the address decides),
  xAI or ElevenLabs. An empty key borrows 設定 › 模型's for the same
  service. Each side says 可以用 or what it lacks; 聽 has 試試看
  (record a sentence, show what was heard), 說 has 試聽 and the voice
  list. speech.rs does the calls; xAI's both ways were checked for real
  (Mandarin read, then heard back, in Traditional characters).
- The brain does it all: the phone POSTs its recording (MediaRecorder)
  to /api/voice/transcribe, screens to /api/sync/voice/transcribe;
  answers come back as MP3 from …/voice/speech and are played on the
  device (rodio; an <audio> on the phone, 「唸出來」 in a message's
  menu). Keys stay on the brain (the voice keys are redacted for
  screens like the others).
- No service, no voice anywhere: the mic, 語音聊天, 會議錄音 and 朗讀
  only appear once 聽 (and 說) can be called; the phone's state says
  which. Without voice the send arrow just rests where 語音聊天 was.
- 會議錄音 is uploaded to the brain, which turns it into text in the
  background and hands it to the bot itself: a meeting is longer than
  the 35 s the account lets a request wait, and a brain on a server has
  no window (the jobs are polled in background()).
- Recognisers answer Mandarin in Simplified: in a Traditional Chinese
  window or phone the text becomes Traditional with Taiwan wording.
- Older saves: whoever had an OpenAI key keeps voice input (聽 =
  OpenAI); everyone else starts with it off. Bots' macOS voice names
  are cleared. 對話詳細資訊's 加入會議 started plain voice input; it
  starts a meeting now.
2026-11-10 22:58:18 +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
王性驊 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
王性驊 f3ccd129d6 The phone page does what the desktop does, laid out like it
A new mobile/index.html in the desktop's (and Grok Bot's) shape: the sidebar
with its sections and folders, the chat with steps, thinking, reactions, quotes
and the approval card, 對話詳細資訊, Bot 設定, routines, pages, computers and
設定. Each action goes to the desktop's own code on the app's thread
(api/act/<what> -> App::phone_act): appctl, set_pinned, restart_bot,
toggle_reaction, box_task, channels_restart and the rest. No new rules.

Keys, channel tokens and the vault never reach the phone; a model key can only
be written. Admins keep what the phone always let them do; making, changing or
deleting bots, routines, memories, pages, folders and settings stays the
owner's. The state the phone polls now carries the sidebar's section order.

Checked by using it on a preview brain: routines, memories, templates, folders,
keys, signing another phone out, approvals and a chat with a fake model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-07 03:05:12 +08:00
王性驊 46c0684cb4 需要處理: a bot hands a step to the person with its computer's live screen in the chat; the window fills to the top; the 電腦 card and viewer keep their text in place
- hand_over_computer (the original's box hand-off card): instruction, live screen with 接管,
  跳過 / 我完成了 / 接管; 我完成了 also in the viewer; a typed message answers it too. Header,
  sidebar and notifications say 等你處理 / 「{name}:需要你」; the phone shows it with 接管.
- Mac: the content reaches the top (no grey title bar); the top strip drags the window.
- Panel 電腦 card: each line stops before the picture; the brain's name on its own line.
- Viewer: buttons first, the title ends in … when narrow; the picture is centred.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 17:29:55 +08:00
王性驊 c3e2e28ec4 Only the brain keeps its box awake: a computer showing another brain leaves its own box alone
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 17:10:05 +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
王性驊 d78e75ebec First start: no bots, a guide instead; signing in syncs this computer and the account
- A new install (desktop or anybot --serve) starts with no bots; the main window shows
  「歡迎使用 AnyBot」: connect a model, make the first bot, or sign in.
- Old data whose five sample bots were never used starts empty too.
- Signing in syncs right away: an online brain of the account is used and this computer's
  bots are moved there; otherwise the backup's missing bots are taken in and backed up again.
- The five sample bots remain only for screenshots and tests (State::samples).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:25:01 +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
王性驊 a70d29fa51 Brain sync: edits in order and kept while typing, plain-language offline messages
- One worker sends edits, messages and actions to the brain in order.
- Edits carry a number; the brain says which it has, and a screen replays
  the rest on top of newer settings so typing isn't undone.
- A message or edit that didn't arrive makes the screen fetch everything again.
- An older copy of a routine can't reset when it last/next runs.
- Network and server failures read as words (no HTTP codes), naming what
  can't be reached; the account server notices a closed AnyBot in 8s.

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