Commit Graph

149 Commits

Author SHA1 Message Date
王性驊 c3e615c83c fix: ChatGPT 方案第二輪審查的 P2
- 沒有正常結束的回答(response.incomplete)算失敗,那一步的工具不執行。
- 額度用完後,沒人在看的要求(例行任務、訊息管道、檢查)先不送,直到有一次成功。
- 提早更新 token 遇到網路問題時,手上還有幾分鐘的 token 照用(以前那幾分鐘每個要求都失敗)。
- 大腦的帳號狀態隨同步送到螢幕電腦(不含 token),模型選單、Bot 設定不再一律寫「未登入」。
- 螢幕電腦和手機只打開 https://auth.openai.com/ 的登入頁;手機擋彈出視窗時說明再按一次。
- 登出時憑證打不開、沒辦法撤銷,會告訴使用者去 ChatGPT 設定中斷;兩次撤銷之間隔一秒。
- 登入成功後自動抓一次模型清單。

已驗證: cargo test 全綠(chatgpt::、providers:: 新增用量上限暫停、incomplete、提早更新失敗、只開 OpenAI 登入頁)。
未驗證: 真的 ChatGPT 帳號登入與串流;螢幕電腦、手機實機(同上一個 commit)。審批路徑仍需人類簽名。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3KhvSzysuKUobKUTR
2026-11-17 17:46:09 +08:00
王性驊 fd4aa0d1a0 feat: 連接器、技能改成「清單+各自的頁」,不再一整頁攤開
照 Claude、ChatGPT 設定頁的做法:
- 連接器:最上面「連接器(MCP)」和「瀏覽市集」「新增連接器」兩個按鈕;「已加入」每列只有名稱、
  狀態、開關和 ›。點一列進到它自己的頁:狀態、登入、重新連線、開關,「工具(N)」只列它自己的
  工具(多時可搜尋),「設定」欄位,最下面「移除這個連接器」(再確認一次)。拿掉把所有工具攤在
  一起的「可以用的工具」。市集和新增表單各是一頁;從市集加需要金鑰的,直接打開填好的新增頁;
  新增後到新連接器的頁看它連線。
- 技能:「已加入(N)」每列名稱、一行說明、開關、›(超過 8 個可搜尋);點進去看完整說明、
  可重播步數、隨附檔案、內容和刪除;內建技能包、Anthropic 開源技能、從網址安裝收進「瀏覽市集」頁。
- 螢幕電腦收到的工具清單改成每個連接器最多 80 個(原本全部合計 60 個,大的連接器會把別的擠掉)。
- 截圖模式:ANYBOT_SHOT_MCP_PAGE、ANYBOT_SHOT_SKILL_PAGE、ANYBOT_SHOT_MCP_TOOLS。

已驗證: cargo test 全綠(含 featuremap::、layout_audit:: 新加的五個頁面);截圖看過清單、連接器頁
  (含 12 個工具)、市集、技能清單、技能頁、技能市集。
未驗證: 螢幕電腦連大腦時的連接器頁(工具清單從大腦來);手機的整合頁沒改。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3KhvSzysuKUobKUTR
2026-11-17 17:43:09 +08:00
王性驊 a03f7c7458 feat: ChatGPT 方案——用 ChatGPT 帳號登入,Bot 用你 ChatGPT 方案的額度,不用 API 金鑰
- 新供應商「ChatGPT 方案」(src/chatgpt.rs):照 OpenAI 給開源 App 的 Sign in with ChatGPT。
  第一次登入註冊 AnyBot(dynamic_agent_client → oaiapp_…)並重用;PKCE、state、nonce;
  ID token 驗 RS256 簽章、iss、aud、exp、nonce;沒同意使用方案算登入但不能用(再登入會要求同意)。
- 要求走 Responses API(api.openai.com/v1/responses,store:false、stream:true、instructions),
  token 只送 OpenAI 自己的網址;收到 response.completed 才算完成;額度用完停下來給管理用量連結,
  不重試、不改用 API 金鑰。token 快到期或 401 時更新(一次一個,refresh token 會輪替)。
- 設定 › 模型 › ChatGPT 方案:使用 ChatGPT 繼續、登出、換帳號、打開登入頁、管理用量;
  連到伺服器大腦的螢幕電腦和手機也能登入(登入頁開在自己這台,打不開的那頁網址貼回給大腦)。
- Bot 工具 chatgpt_login(status、login、logout、switch_account;登出和換帳號先問)。
- 修連接器登入:封存的 token 前綴寫錯("sealed:" 實際是 "enc:v1:"),重開 App 後 token
  沒解開就被當成憑證送出,登入等於每次重開都失效。

已驗證: cargo test 全綠(chatgpt::、providers::、appctl::、remote::、mcp_oauth::、featuremap::、layout_audit::);
  授權網址的參數送到 auth.openai.com 沒被拒(302 到登入頁)。
未驗證: 實際用 ChatGPT 帳號登入、同意、Responses 串流與工具呼叫(要真的 ChatGPT 付費帳號和瀏覽器);
  螢幕電腦貼回網址、手機登入(要實機);Windows 的「打開登入頁」。
  動到審批路徑(appctl::needs_approval 的 chatgpt_login):需要實機測試+人類簽名。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 17:23:10 +08:00
王性驊 d64766e953 feat: 問題卡搬進聊天裡,跟訊息一起上下捲,不再蓋住聊天
問題卡(ask_person、/plan 的「照這個計畫做嗎?」)原本固定在輸入框上方、高度封在視窗的 45%,
選項一多就蓋住大半聊天,按鈕還被切在卡片裡面要再捲。
- 電腦:卡片是聊天最下面的一則,照內容多高就多高;出現和換下一題時聊天捲到它一次
  (比視窗高時對齊卡片上緣,先看到題目),之後往上捲不會被拉回來。
- 手機:一樣放進聊天的捲動區(#askq)。
- 允許請求的黃色卡片不動,還是固定在輸入框上方。
- 功能地圖(chat、plan)和 FEATURES.md 一起改。
- 模式圖示的 id 從 Id::new 改成 Id::unique(上一個 commit 留下的過時用法警告)。
- 獨立審查沒有 P0/P1;修了它提的 4 個 P2(手機改成捲動區自己捲、同一個 call_id 的下一張卡
  也會捲到、太高的卡對齊上緣、搜尋跳到訊息時不搶捲動)。

已驗證: cargo test 全綠(613,含 featuremap::、layout_audit::);截圖模式(示範資料、深色、760x560)
  看過問題卡在聊天裡的樣子;mobile/index.html 的 script 解析得過。
未驗證: 「往上捲開再回來」沒有實際操作(截圖模式只有一張圖);手機網頁沒有在手機或瀏覽器上點過;
  功能地圖 chat「驗證:」那一行要真的模型用問題卡問三件事,這次沒跑;大腦的螢幕(mirror)沒試。

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 15:17:51 +08:00
王性驊 6a5fd2d53e feat: 目標/計畫/一律放行改成臉那一行右邊的圖示,不再各佔一行
輸入框上方原本每個模式一條列,最多三行,擋住對話高度。
- 電腦:三個圖示排在臉那一行右邊(新對話沒有臉時自己一小行);滑過去看
  原本那一行字和說明,點一下打開同樣的說明和「清除目標/取消計畫/關閉一律放行」;
  照計畫做時圖示旁邊寫「2/5」。
- 手機:目標和計畫是輸入框上方一排小圖示,點一下展開那一行和取消按鈕。
- 功能地圖(plan、goal、safety)和 FEATURES.md 一起改;排版檢查的場景補成三個圖示同時出現。
- 獨立審查沒有 P0/P1;修了它提的 6 個 P2(圖示用固定 id、手機換聊天時收起、
  兩個翻譯、目標的 30 秒重畫、過時註解、手機點擊範圍 44 px)。

已驗證: cargo test 全綠(613,含 featuremap::、layout_audit::);截圖模式(示範資料、深色、760x560)
  看過計畫模式、照計畫做、滑過去的說明、點一下的選單;mobile/index.html 的 script 解析得過。
未驗證: 手機網頁沒有在手機或瀏覽器上實際操作;目標和一律放行的圖示沒有截圖(只有排版檢查);
  功能地圖「驗證:」那幾行要真的模型跑 /plan、/goal,這次沒跑;大腦的螢幕(mirror)沒試。

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 15:04:09 +08:00
王性驊 09d782bc32 fix: 獨立審查找到的問題(二):技能的工具限制、連接器登入、檢查點、監看、目標
技能的 allowed-tools(三個會讓限制失效的):
- 用部分名字讀技能時沒有套上限制;靠左寫的清單(- Read)和帶冒號的項目讀成空的;Read(docs/**) 連改檔也放行,而且 docs/../.. 繞得出去。
- 後讀的技能會把限制換掉(現在第一個的限制留著);browser、computer 寫了卻永遠對不上;參數裡的 ' 把後面全吃掉。
連接器登入:
- token 只認名字不認網址:改了網址或同名重加,舊 token 會送到新的地方。現在綁登入時的網址;移除就登出;登出後連線也斷。
- 連接器給的登入位址沒有檢查:可以指到雲端中繼資料、Docker 管理端點,或非網頁的位址。現在都要是網頁位址、過安全規則;resource 不能是別的網站。
- 鑰匙圈一時打不開時,存別的連接器會把其他 token 清空。
檢查點:還原失敗還是把檢查點丟掉;同一個 Bot 另一段對話改的檔案也被退;監看、例行任務的訊息被當成可以退回的點;紀錄檔沒有鎖。
監看:輸出滿 4 MB 之後就再也不叫;印很多又馬上結束的指令被說成「太多行停掉」。
目標:數字在動的進度(還差 7 → 還差 6)被當成同一個理由而暫停;使用者說繼續後,下一輪又跟暫停前比;做不到也撒彩帶;沒有電腦時評審連網頁都不能看。
其他:fork 技能在群組裡被吃掉(群組沒有支線,改在聊天裡做)。

已驗證:cargo test 613 通過(技能、連接器、檢查點、目標各補了斷言)、clippy -D warnings 乾淨。
沒修:Box/SSH 上非 UTF-8 的檔案檢查點會存壞(edit_file 本來就只處理文字);引用訊息再打指令不算指令(原本就這樣);Windows 的管理員 hook 檔位置一般使用者可能寫得進去(沒辦法在這裡驗)。

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 14:24:12 +08:00
王性驊 35807099bb fix: 回頭檢查這兩天的改動,修 5 個問題(2 個是安全問題)
- 目標的評審讀檔沒有過安全檢查:讀得到 .env、金鑰、AnyBot 自己的資料和工作資料夾以外的檔案,還會送給另一家模型。現在只讀 Bot 不用問就能讀的。
- Linux 沙盒:工作資料夾就是家目錄(起始資料夾沒填)時整個放行,~/.ssh 和 AnyBot 的資料變成讀寫都可以。現在工作資料夾裡有私密資料夾就不整個放行。
- 技能參數:技能自己程式碼裡的 $1(awk '{print $1}')被當成參數換掉。現在 $N 只在技能有寫 arguments、argument-hint 或 $ARGUMENTS 時才換。
- 連接器登入:token 每條連線只會換新一次,之後再過期就說「金鑰不對」。現在每次過期都換。
- Hooks:hook 不讀輸入、事件又很大(長的工具結果)時,寫入會卡住,逾時也停不了。寫入改在另一條執行緒。

已驗證:cargo test 613 通過(每一項都加了測試,連接器再次換新除外)、clippy -D warnings 乾淨。
未驗證:Linux 沙盒那一項只測了規劃,真的核心上沒跑。

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 14:07:48 +08:00
王性驊 1f59795d3f 合併: 手機網頁的改良(web-pwa-polish):新訊息進場、iOS 鍵盤、觸感、主畫面捷徑、通知上直接允許/拒絕
收進來的:新訊息從下面滑進來、iPhone 鍵盤蓋住時輸入框抬高、送出和允許時輕震、主畫面圖示的「主要 Bot」「未讀」捷徑、通知上的允許/拒絕。
沒收的:換頁動畫(main 已經有 in-fwd/in-back)、分支裡寫死在程式裡的 manifest 和 service worker(main 已經搬成 mobile/ 的檔案,種類、圖示數字、震動都比較完整),所以捷徑和按鈕補在那兩個檔案裡。
改過的:通知上的按鈕只給「要你允許的事」(操作、用電腦工具、在這台執行),問題卡和需要處理沒有(原本「允許」會把需要處理當成「我完成了」);通知帶請求的編號,大腦確認還是正在等的那一個才答,舊通知不會答到新的請求。

已驗證:cargo test 608 通過(新的 a_banner_answers_only_its_own_request)、clippy -D warnings 乾淨;relay 的 cargo test 22 通過。
未驗證:真的手機上的按鈕和動畫;帳號伺服器那半邊(relay、sw.js、manifest 由它送出)要 make update-server 才生效。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:54:10 +08:00
王性驊 05085189fc feat: 連接器可以用帳號登入(MCP 的 OAuth:PKCE、自己註冊、resource),在大腦上、Token 加密存
- 照 MCP 2025-06-18:401 指的 resource metadata(RFC 9728)→ 登入伺服器的 metadata(RFC 8414/OpenID)→ 自己註冊(RFC 7591)→ PKCE S256 加 resource(RFC 8707)→ 換 token。
- 瀏覽器回到大腦的 127.0.0.1 臨時連接埠;瀏覽器在別台電腦時,把登入後那頁的網址貼回聊天(manage_connectors login 加 callback)。登入完連接器馬上重新連線。
- 設定 › 整合 › 連接器 的「登入/重新登入」(大腦本機);manage_connectors 多 login、logout(logout 先問)。
- Token 存 connectors/oauth.json,用設定金鑰同一把鑰匙加密、0600,不放連接器清單(會同步到螢幕和手機);快到期或 401 用 refresh token 換新再試一次。
- 登不進去照實說:不讓 App 註冊、不支援 PKCE、登入伺服器的錯誤、10 分鐘逾時、網址用過。

已驗證:cargo test 606 通過(假的 OAuth+MCP 伺服器:檢查 PKCE、resource、scope;瀏覽器回來、貼網址兩種都換到 token;快到期自動換新;網址只能用一次;登入前連接器說要登入、登入後連上拿到工具)、clippy -D warnings 乾淨。
未驗證:真的 Notion/GitHub 等 OAuth 連接器;設定畫面的「登入」鍵打開瀏覽器。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:08:45 +08:00
王性驊 f19b49f953 feat: Hooks:自己的程式插在 Bot 做事的固定時間點(Claude Code 的格式),Bot 也能在聊天裡幫你設
- hooks.json 跟 Claude Code 一樣(matcher、type command/http、timeout),AnyBot 和 Claude Code 的工具名字都認;使用者的在資料夾 hooks/,管理員的(先跑、改不了)在系統位置,MDM 可推。
- SessionStart(對話第一輪)、UserPromptSubmit(補資訊或擋下這一輪)、PreToolUse(擋、改參數、ask 一定問、allow 省一次問但擋不過安全規則和每次問的)、PostToolUse(換掉或補 Bot 讀到的結果)、Stop(叫它接著做,一輪最多 3 次)、Notification(跟著通知跑)。
- hook 自己出錯(結束碼、逾時、JSON、設定檔)就當它不在,紀錄檔寫原因;/doctor 寫有幾個、檔案看不看得懂。
- manage_hooks(list/add/remove):加和移除每次都先問,一律放行也問;管理 App 的能力,外面的訊息不能用。
- 測試裡每一輪只拿測試給那個 Bot 的 hook,不讀檔(同時跑的測試不會互相影響)。

已驗證:cargo test 602 通過(hook 本身:擋 rm、改參數、ask、壞掉的 hook、逾時、prompt 補資訊、Stop 用 stop_hook_active 放行、PostToolUse 換結果、manage_hooks 改檔;真的一輪:rm 沒有執行、跑的是 hook 改過的指令、Stop 讓模型多回一次)、clippy -D warnings 乾淨。
未驗證:HTTP hook 打到真的伺服器、管理員檔案的位置在真的 Mac/Linux 上、Windows 的 cmd。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:59:21 +08:00
王性驊 f4911b1b7e feat: 技能帶參數:argument-hint/arguments($ARGUMENTS、$0…、$名字)、allowed-tools(這一輪只准用這些)、context: fork(在支線做)
- SKILL.md 開頭多四個欄位,寫法跟 Claude Code 一樣(一行逗號、[a, b]、或一行一個 - 都讀得懂),存回去也寫得回去。
- 「/名稱 參數」:技能有參數時,替模型加的那一行帶上參數,use_skill 多一個 arguments,讀到的做法裡換好(都沒寫就附在最後);沒參數的技能照舊。/ 清單顯示 argument-hint。
- allowed-tools 是限制不是放行:讀了這個技能之後這一輪只准用那些(Claude Code 的名字對到 AnyBot 的工具,Bash(git log:*) 是 shell(git log *),走 gate.rs 的固定樣式),別的步驟不執行;use_skill、read_result、ask_person 一定能用。裝來的技能不能替自己開權限。
- context: fork:打「/名稱 …」改開支線(跟 /btw 一樣);走 commands.rs 的 command_for,電腦和手機/螢幕一樣。

已驗證:cargo test 597 通過(欄位讀寫來回、參數代換含引號和 $5、名稱對照和樣式、真的一輪裡 use_skill 之後 edit_file 被擋、fork 技能變支線、沒參數的技能提示不變)、clippy -D warnings 乾淨。
未驗證:真的模型拿到參數和限制時的做法。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:51:07 +08:00
王性驊 9bb9e698a6 feat: 監看:shell 加 monitor,指令每印出新的一行就叫醒 Bot 一次
- 指令馬上放背景;一秒內印出的併成一次,最多列 20 行,標明「這是指令的輸出,不是使用者說的話」;Bot 閒著就開一輪,在做事就等這輪做完(App::wake)。
- 10 秒超過 200 行、或叫滿 60 次自動停並說一次;指令自己結束說一次結束碼和最後幾行;write_terminal stop 或重新啟動 Bot 安靜結束。
- 就是 shell:核准、安全規則、沙盒、背景指令、停止都沿用;這台、Bot 自己的電腦、SSH 電腦都可以,帳號裡其他 AnyBot 電腦不行(說改用 read_terminal 的 until)。
- 跑指令的那段抽成 spawn_piped,一般指令和監看共用。
- 監看的字每個 App 只拿自己的 Bot 的(測試裡同時有好幾個 App)。

已驗證:cargo test 594 通過(三行間隔開來叫三次再說結束、一下子 5000 行停掉只說一次、stop 停掉不再說、切行)、clippy -D warnings 乾淨。
未驗證:真的模型被監看叫醒後怎麼做;Docker 和 SSH 電腦上的監看。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:43:52 +08:00
王性驊 c596322c3b feat: 檢查點與 /rewind:Bot 用 edit_file 改的檔案和對話可以退回之前說的某一句
- edit_file 改檔案前先存原本的樣子(沒有這個檔案也記),記在開始那一輪的那句話底下,同一輪同一個檔案只記一次;你的電腦、Bot 自己的電腦(Docker、封閉資料夾)、SSH 電腦都記;存在資料夾的 checkpoints/,同樣內容存一份,一週後清掉。
- /rewind 列出最近 10 句和之後改過幾個檔案;/rewind N 檔案和對話都退回(新的先退,新建的刪掉;那句話放回輸入框;退回前的整段對話收進過去的對話「退回前:…」);/rewind N 檔案、/rewind N 對話 只退一邊。檔案在背景還原,好了一行報告。
- 用指令改的、其他 AnyBot 電腦上的、超過 2 MB 的不在裡面,照實說。
- tools.rs:file_spot、file_now、file_put(box 的路徑檢查抽成 box_guard 共用);Place 可以存檔。
- 背景做完的一行字(later_notes)走同一個地方進聊天。

已驗證:cargo test 593 通過(兩輪改三個檔案:退到第二輪只還原那輪的、退到第一輪全部還原、新建的刪掉、太大的照實說;App 裡 /rewind 清單、編號不存在、退回後只剩 AnyBot 的字、草稿是那句話、退回前收進過去的對話、README 回到中文、INSTALL.md 刪掉)、clippy -D warnings 乾淨。
未驗證:Docker 和 SSH 電腦上的存與還原(走同一個 cat 的路)、真的 App 和手機上打 /rewind。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:35:31 +08:00
王性驊 25bf3f5bd4 feat: /fork 分岔:這段對話存一份到「過去的對話」,之後各走各的;AnyBot 的指令只在一個地方認、一個地方做
- /fork 或 /fork 名字:目前的對話照常繼續,一份「分岔:名字」放進過去的對話最上面;打開它時目前這段自動收進去,兩條路互不影響。Bot 在做事或對話是空的時說原因。
- 不複製整個 Bot(例行任務、訊息管道會重複)。
- 電腦的 send 和手機/螢幕的那條路本來各列一次 /btw、/goal、/plan、/always-approve、/usage、/context、/compact、/doctor,現在都走 app/commands.rs 的 app_command + run_app_command。
- / 清單、手機的指令清單加 /fork。

已驗證:cargo test 590 通過(指令認得出來、不把 /forkx 和路徑當指令;分岔留一份、之後說的不進分岔、打開分岔回到那一點、空的和正在做事時說原因)、clippy -D warnings 乾淨。
未驗證:在真的 App、手機上打 /fork 的樣子。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:28:46 +08:00
王性驊 13a0987e53 feat: Linux 的指令也在沙盒裡跑(Landlock):私密資料夾讀不到也寫不到、shell 啟動檔改不了;沒有沙盒的電腦 /doctor 照實說
- AnyBot 用自己當沙盒(/proc/self/exe __anybot_sandbox … -- /bin/sh -c 指令):套上 Landlock 再變成 shell,互動終端機也包得到。
- Landlock 只能允許:通往私密資料夾的每一層一個個允許、跳過私密的那個;讀到處可以(名字列得出來)、寫除了私密資料夾和啟動檔都可以,跟 macOS 一樣;工作資料夾整個可寫。
- 核心沒有 Landlock:照舊跑、紀錄檔寫一次、/doctor 一行 ✗;Windows 也寫沒有沙盒。
- Linux 被擋時(Permission denied)結果後面附一句說明哪些地方不行。

已驗證:cargo test 588 通過(規劃:私密資料夾、附件只讀、啟動檔只讀、工作資料夾整個可寫、舊核心只用它認得的權限;參數來回);landlock.rs 用 Linux target 做過 cargo check 和 clippy -D warnings(含 Linux 才編的系統呼叫和測試);clippy -D warnings 乾淨。
未驗證:真的 Linux 核心上套上 Landlock(landlock_keeps_a_command_out 在 CI 的 anybot-linux 或一台 Linux 才會跑)、互動終端機在 Linux 上經過沙盒。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:24:52 +08:00
王性驊 e6c1501090 feat: 目標的評審可以自己查證(只看),同一個理由連兩次就暫停,不每輪提高標準
- 評審證據不夠時可以用 read_file、list_dir(Bot 做事的那台電腦)、web_fetch 查,最多 3 次;要它做別的會被拒絕,不會真的做;次數用完要它只回 JSON。
- 連續兩輪「還沒達成」說的是同一件事(字稍有不同也算,字元配對重疊 70%)就暫停「同樣的問題連續兩次」。
- 評審的提示加上:每一輪同一個標準,不因為 Bot 做得比上一輪多就提高要求,不加目標沒寫的條件。

已驗證:cargo test 584 通過(新的 the_same_reason_twice_pauses、the_judge_looks_for_itself_read_only:用假模型讀檔、被拒絕的 shell 沒有建立檔案)、clippy -D warnings 乾淨。
未驗證:真的模型實際用工具查證的樣子。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:13:35 +08:00
王性驊 e23f19727e feat: 摘要照段落寫、太短再要一次、使用者原話和背景指令留在摘要下面;/context、/compact
計畫 R4(grok-build 的分段摘要提示、摘要太短重做、摘要後提醒還在跑的工作)。

- agent::summarize(對話太長時兩種整理都用它):提示照段落(使用者要的、已經決定的、做過的事和結果、還沒完成的、注意);一大段對話整理得不到 200 字就再要一次,取長的那份。with_what_must_stay:AnyBot 自己在摘要下面附上使用者最近 12 句原話(每句最多 400 字)和這個 Bot 還在跑的背景指令(tools::running_for)——這些不靠模型,不會被摘要弄丟。
- /context:這個對話(模型看得到的部分)約幾 token、模型可讀多少、幾 %。/compact:現在就整理(Bot 在做事時不行),在背景用快速模型做,好了留一行;聊天記錄照舊完整,模型從摘要開始讀。電腦、螢幕、手機都能打;/ 清單、手機的指令清單、功能地圖 chat.md、FEATURES.md。
- 兩個舊測試的假摘要改長一點(太短的會被要求再寫一次);一個斷言改成「被收起的回答不見了、使用者的原話留著」。

已驗證:cargo test 582 全過、clippy -D warnings 過。新測試:第一次摘要太短會再要一次並用長的那份、原話留最近 12 句、提示有段落;從聊天打 /context 有 token 和提示、/compact 用假模型整理好,模型看得到的部分變短、聊天沒有少。
未驗證:真的模型照段落寫的品質。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:08:20 +08:00
王性驊 2cb543cfe1 feat: 自動審核可以寫固定樣式的規則,在模型之前判斷、每次一樣
計畫 R2(grok-build 的 Bash(git *)、deny > ask > allow 在模型之前)。用一般的話寫的規則交給模型判斷,每次可能不一樣,網頁上的字也可能把模型說成「允許」。

- gate.rs:is_pattern、glob(* 任何字、? 一個字;檔案的 * 只在一層、** 跨資料夾)、patterns:shell(…)(允許要每一段都符合,詢問只要一段;藏起來的指令 $()/反引號樣式不允許)、file(…)(讀檔、改檔、列資料夾、搜尋的路徑,~ 換成家目錄)、connector(…)(mcp__server__tool,use_connector_tool 也算)、web(domain:…)(web_fetch、browser_open 的網址,子網域算、example.com.evil.net 不算)、tool(…)。詢問的樣式贏過允許的樣式。
- agent::review_action:先看樣式。符合詢問 → 問(不能一律允許);符合允許 → 允許,但有用話寫的「一律詢問」時先讓模型看那幾條;都不符合 → 只把用話寫的規則交給模型(review_by_model)。直接操作模式下詢問的樣式一樣擋。
- 設定 › 權限 › 自動審核的說明寫樣式怎麼寫;功能地圖 safety.md、FEATURES.md。

已驗證:cargo test 580 全過、clippy -D warnings 過。新測試:glob;樣式的表格(13 種:git status 允許、git status && rm -rf x 不允許、git push 被詢問蓋過、$() 不允許、路徑、連接器、子網域和假網域、工具名);一輪:直接操作 + 一律詢問的 shell(echo *),那一步停下來問、卡上寫是哪一條規則,模型只被問了兩次(沒有額外的審核呼叫),檔案沒建。
未驗證:無。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:01:34 +08:00
王性驊 168aae4222 feat: anybot --ask 給腳本用:--json、--bot、--data-dir、--approve、結束碼
工程基礎計畫 E10(grok-build 的 -p 加 JSON 輸出、結束碼)。

- AskOpts::parse:--json、--bot 名字、--data-dir 資料夾、--approve once|reject,選項可以夾在問題的字中間。寫錯時說哪裡錯、結束碼 2。--data-dir 在讀任何東西(紀錄檔、狀態)之前設成 ANYBOT_DATA_DIR。
- ask_cli:--json 時每則訊息一行 JSON(role、text、error、tools、tool_call_id),核准一行 approval、學到技能一行 learned,最後 done(ok、code、steps、secs、timed_out、answer),文字和參數裡的金鑰遮過。Ctrl-C 先停下 Bot、結束碼 130;時間到或這一輪沒有順利 1;順利 0;資料夾裡還沒有 Bot 2(以前什麼都不印就結束)。
- 核准改走 answer()(跟按鈕一樣):以前直接回覆核准卡的頻道,App 操作的核准(刪例行任務這類)在這裡會一直等到時間到。
- 用法說明(anybot -h)、FEATURES.md。

已驗證:cargo test 577 全過、clippy -D warnings 過。新測試:選項在任何位置都讀得到、缺東西時說清楚;結束碼對應。實際跑:隔離的資料夾裡沒有 Bot 時印出提醒、結束碼 2、立刻結束;--json 的 done 那一行格式對。
未驗證:完整一輪的 --json 輸出。手寫的測試狀態檔有 api_key 欄位,除錯版要從鑰匙圈拿保險庫的鑰匙,會在畫面上跳出允許視窗並卡住,所以停在這裡(已記下這個陷阱)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:58:04 +08:00
王性驊 6ab56c9ad3 feat: /doctor 診斷這台電腦:連線、Tailscale 直連還是中繼、大腦、模型服務、Bot 的電腦、連接器、磁碟、上次出錯
工程基礎計畫 E11(grok-build 的 /doctor)。早上「連不到大腦」花了半小時用指令查出是 Tailscale 走香港中繼,現在打一句就看得到。

- doctor.rs:報告的樣子(一項一行 ✓/✗,最後數有幾項要看);帳號伺服器網址是 *.ts.net 時跑 tailscale ping,讀出是直連還是走哪個中繼(走中繼寫延遲和「多半是中間擋了 UDP 41641」);df 看磁碟;找最新的當掉報告。
- app/doctor_ui.rs:當下就知道的(版本、資料夾、紀錄檔、這台 ↔ 帳號伺服器、帳號伺服器 ↔ 大腦、螢幕連不連得到大腦和原因、上次同步的大小和速度、Bot 的電腦、每個開著的連接器、磁碟少於 2 GB、上次出錯),要上網的在背景跑(Tailscale、每個 Bot 用到的模型服務列模型清單),好了在聊天留一行。
- 在連到大腦的螢幕電腦上:/doctor 在連不到大腦的檢查之前就處理,檢查的是這台本身,結果跳成提示(那個聊天是大腦的)。手機打的是大腦檢查自己。
- / 清單、手機的指令清單多一個 doctor;功能地圖 garden.md、chat.md,FEATURES.md。

已驗證:cargo test 全過、clippy -D warnings 過。新測試:報告的格式和計數;tailscale ping 的直連和中繼兩種輸出(用今天早上這台真的輸出「via DERP(hkg) in 63ms」);最新的當掉報告、磁碟;從聊天打 /doctor 先說「診斷中」、再一份報告(模型服務指向測試用的假模型)。
未驗證:螢幕電腦上真的跑一次(要更新這台 App)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:48:01 +08:00
王性驊 ed879c5005 feat: 太長的結果留完整的,Bot 用 read_result 讀,不再叫它重做一次
計畫 R3(grok-build 把大的 MCP 結果存成檔案)。

- outputs.rs:完整內容存在資料夾的 outputs/(用內容算的 id:同樣的內容同一個 id,收起舊結果時每一輪重算也不會多存;一份最多 20 MB;開機時清掉 7 天前的)。
- tools::head_tail(指令輸出、連接器的回答):中間的說明改成「…(中間省略 N 個字;完整內容用 read_result 讀:id=r…)…」。
- agent::folded_text(為了騰出空間收起的舊結果):以前說「需要完整內容就再做一次這一步」——改東西的步驟重做很危險,答案也可能不一樣;現在寫 id。
- 新工具 read_result(id、from、chars,一次最多兩萬字),每個 Bot 都有、算「只看」(計畫模式也能用)。存在 AnyBot 的資料夾而不是 Bot 的電腦:Bot 的沙盒本來就讀不到 AnyBot 的資料夾。
- 功能地圖 files.md、FEATURES.md。

已驗證:cargo test 全過、clippy -D warnings 過。新測試:三萬多字的結果分段讀回、同樣內容同一個 id、超出長度和亂給 id(含 ../)都說清楚、找不到的說可能被清掉了。
未驗證:真的模型拿到截短的結果會不會自己用 read_result(說明寫在工具描述和截短的那一行)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:44:36 +08:00
王性驊 d834411096 fix: 慢的線上長連線不再被切斷;斷線接回馬上重新同步;大腦那一欄看得出是哪一段
計畫 R7。2026-11-17 早上:Mac mini 經 Tailscale 香港中繼連 nobledesktop(約 100 KB/s),大腦整份資料約 5 MB 要 45–55 秒。這台 45 秒沒收到「一則完整訊息」就算斷線,傳到一半被切、螢幕又從頭要整份,一直循環(實測:連線 9:41:48 開、9:42:33 剛好 45 秒時被切;第二次 9:43:55 一樣)。帳號那欄寫已連線、大腦那欄寫「和帳號伺服器的連線斷了」,看不出是哪一段。

- tunnel.rs:Stream 讀到資料就記(bytes_in、receiving);keep() 有資料進來就算還活著(DEAD_SECS 照舊,但量的是真的沒聲音)。call() 過了自己的時間、但連線還在收資料就繼續等(最多 10 分鐘)。link_serial() 給螢幕知道長連線接回了。
- 帳號伺服器(relay)的長連線同樣:Counted 包住 TcpStream,資料進來就算活著(這台上傳大份資料時不會被那端的 60 秒切掉)。要 make update-server 才生效。relay/clippy.toml:主程式的「HTTP 用戶端只能在 net.rs 建」不套用到 relay。
- 螢幕(mirror_ui):等重試時每 0.2 秒看一次長連線,接回就馬上再要(以前最多等 20 秒,這段時間帳號那欄已經寫已連線);記下上次同步的時間、大小、秒數。
- 設定的大腦那一欄:狀態下面分段寫「這台 ↔ 帳號伺服器」「帳號伺服器 ↔ 大腦(在線上/不在線上,帳號伺服器說的)」「上次同步 …(大小、秒數、KB/s)」。

已驗證:cargo test 571 全過、clippy -D warnings 過;relay cargo test 22 全過。新測試:假的帳號伺服器把一則 64 KB 的訊息分 3 秒慢慢送(允許的沉默設成 1 秒),連線不斷;之後真的沒聲音就斷。把「有資料進來就算活著」拿掉,同一個測試失敗:「已連線」後馬上「連線中斷」——就是早上的情況。
未驗證:真的 Tailscale 中繼線路上走一次(要更新這台的 App 和伺服器)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:41:15 +08:00
王性驊 6b9d4e6cf2 feat: 沒人在看的一輪遇到模型忙碌時等比較久(共 8 次、最多 30 秒、加減兩成)
計畫 R1(grok-build 試 15 次、2 秒起加倍到 30 秒、±20% 抖動)。早上的 503「第 3 次,共 3 次」就是這個上限。

- providers.rs:每條執行緒一個「沒人在看」的旗子(set_patient)。開著時一次模型呼叫共試 8 次、等待加倍到 30 秒;沒開照舊共 3 次、最多 4 秒。自己算的等待加減兩成(jitter);供應商給的 Retry-After 照它的。已經開始輸出就不重試(不變)。
- agent::Job 多一個 unattended;start_reply 對例行任務/事件觸發的喚醒和別人傳來的訊息設成 true,這一輪的執行緒一開始就 set_patient。
- 拿掉只剩測試在用的 backoff_delay_ms,改用 backoff_up_to。
- 功能地圖 routines.md 陷阱、FEATURES.md。

已驗證:cargo test 570 全過、clippy -D warnings 過。新測試(用共用的假模型):前 4 次都回 503 的模型,有人在看的那一輪 3 次就失敗,沒人在看的第 5 次拿到答案;加倍的上限、抖動在 ±20% 內。
未驗證:真的供應商長時間忙碌時的例行任務。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:35:28 +08:00
王性驊 3ef5f8b752 feat: 每一次模型呼叫都記用量;/usage 看最近一天和一週
工程基礎計畫 E8,參考 grok-build 的 `grok usage`。

- providers.rs:StepOutput 多一個 usage(輸入、輸出、快取讀、快取寫、花費)。OpenAI 系的串流最後一段的 usage(OpenAI、xAI、OpenRouter 的請求加 stream_options.include_usage;其他有給也讀);Anthropic 從 message_start 和 message_delta 讀。OpenAI 的 prompt_tokens 包含快取讀的,拆開,兩家的「輸入」同一個意思。OpenRouter 回的 cost 記成百萬分之一美元。拿掉沒人讀的 CACHE_STATS。
- usage.rs:run_step_as_written(每一次模型呼叫都經過)之後寫一行到資料夾的 usage/YYYY-MM.jsonl:時間、供應商、模型、session(看得出哪個 Bot、做什麼:回合、發布前檢查、目標檢查、支線)、token、花費。沒回報用量的呼叫不寫。
- 「/usage」(電腦、螢幕、手機):最近 24 小時和 7 天的呼叫次數、輸入、輸出、快取讀了幾成、花費(有回報才寫),依 Bot、依模型各列前 8 名。不猜價錢。
- / 清單、手機的指令清單多一個 usage;功能地圖 chat.md、FEATURES.md。

已驗證:cargo test 全過、cargo clippy -D warnings 過。新測試:兩種串流的用量讀得對(OpenAI 的快取拆出來、OpenRouter 的花費、Anthropic 的四種),只對認得的服務送 stream_options;session 看得出是誰的;一天和一週的加總、依 Bot 和依模型、七天前的不算;寫一行再讀回來,沒用量的不寫。
未驗證:真的 OpenAI/xAI/OpenRouter 回的 usage(照它們的文件寫,假模型測過格式)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:27:34 +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
王性驊 e039368d6b feat: 紀錄檔、當掉報告、秘密遮罩
參考 xai-org/grok-build(每個 session 的 debug log、xai-crash-handler、xai-grok-secrets 的 sanitizer)。工程基礎計畫的 E2–E4。

- 紀錄檔(logfile.rs):AnyBot 自己說的話寫到資料夾的 logs/anybot-YYYY-MM-DD.log(時間、等級、來源;一天一個、留 7 天、一天上限 20 MB),終端機照舊印,伺服器的 docker logs 不變。ANYBOT_LOG 設等級(預設 info),其他套件只收 warn 以上。36 個執行中的 eprintln! 改成 log::info!/warn!/error!;終端機給人看的(用法、setup 的 ✗、更新進度、截圖、測試)照舊。cargo test 不開紀錄檔。
- 當掉報告:panic hook 寫 logs/crash-時間.txt(版本、執行緒、位置、訊息、backtrace);下次打開在主要 Bot 的聊天留一行並記進待改進,每份只說一次(改名 .seen.txt);螢幕電腦跳提示。
- 秘密遮罩(secrets.rs):glpat-、ghp_/github_pat_、sk-、xai-、AKIA/ASIA、xox、AIza、私鑰區塊、Bearer/Basic、JWT,名字像 TOKEN/SECRET/PASSWORD/API_KEY 的變數值 → ••••(留前綴)。用在紀錄檔、當掉報告、手機上的步驟細節和結果。工作紀錄(oplog)不遮:當掉後要照原本的參數重做;Bot 看到的不遮。
- regex、log 改成直接相依(本來就在建置裡,沒有新的下載)。

已驗證:cargo test 557 全過;新測試 secrets:: 3 個(每種格式、變數名留著、一般文字不動)、logfile:: 4 個(等級和來源、一行的格式和遮罩、每天換檔/上限只說一次/七天前的刪掉、當掉報告遮過且只說一次)。隔離的 --serve(沒有金鑰、DOCKER_HOST 指向不存在、自己的 HOME 和資料夾)跑 10 秒:logs/anybot-2026-11-17.log 有啟動版本、手機密碼提醒、記憶整理、收到停止訊號四行,終端機一樣。
未驗證:真的 panic 寫出報告後重開看到那一行(測試直接呼叫寫報告和讀報告的函式,沒有讓程式真的當掉)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:09:13 +08:00
王性驊 9390b70fe7 feat: /plan 先規劃再動手、聊天裡請 Bot 管理連接器、/always-approve 一律放行;輸入框上方的狀態不再破版
/plan(照 Claude Code 的 plan mode、Cursor 的 Plan Mode、Codex 的 update_plan)
- 「/plan 要做的事」:這一輪只給會看的工具(讀檔、搜尋、web_fetch、瀏覽器的打開/讀取/捲動、截圖、anybot_guide、問題卡),在執行那一層擋下其他步驟(回「計畫還沒核准」),不是只靠提示詞。
- Bot 用 submit_plan 交計畫:聊天裡一張「計畫」卡(摘要、步驟、怎麼確認做對了、注意),下面的問題卡「照這個計畫做嗎?」:開始照計畫做/先不要/打字寫要改哪裡。
- 核准後同一輪接著做:工具全開、系統指示換成照計畫做,第 1 步自動進行中;update_plan 每做完一步更新一次(整份清單、只有一步進行中),卡上打勾、輸入框上方「照計畫做 · 2/6 · 這一步」;全部做完留「計畫完成」那一行。
- 「/plan」看狀態、「/plan clear」取消;例行任務、訊息管道、團隊成員的訊息不受影響;群組不能用;支線不帶計畫;清除聊天或新對話一起清;分享 Bot 檔不含。手機:計畫卡、計畫列、取消計畫。
- 新功能地圖 plan.md;研究(Claude Code、Codex、Cursor、Gemini CLI…)的結論寫進提示:只寫建議的做法、通常 3 到 7 步、問題最多 3 題、打勾不要太勤。

聊天裡管理連接器(設定能做的聊天也要能做)
- 新工具 manage_connectors(管理 App 能力):list、add、update(含開關)、reconnect、remove。改的就是大腦上 設定 › 整合 › 連接器 那一份,不會寫到手腳電腦的檔案(進化之神之前叫使用者去 nobledesktop 的 ~/.local/share/AnyBot 設)。
- 新增、修改、移除先跳卡片:指令(在大腦上執行)或網址、環境變數、標頭;TOKEN、KEY、SECRET、PASS、AUTH… 和密碼顯示「••••(已填)」。名稱重複、command 和 url 都給、網址不對、還有「{…}」、沒東西可改,在問之前就回給 Bot。
- 加好後等它連上(最多 90 秒)再回報幾個工具或原因;一輪裡連接器的工具變了,下一步起就換新(加完同一輪就能用)。

/always-approve(也可以 /yolo)
- 使用者自己打(電腦、大腦的螢幕、手機的擁有者)或 設定 › 權限 ›「一律放行」:打開直接操作,之後所有要等「允許」的都自動允許(含一律詢問規則、付款/傳送/刪除的點擊、寄信、傳訊息、打電話、發文、保險庫卡片),自動審核略過;打開時在等的卡片一起放行。
- 照樣擋:安全規則一律拒絕的;別人傳來的訊息那一輪;問題卡、需要處理、計畫卡。Bot、例行任務、訊息管道打不開;管理員和成員打的變成「【名字】/always-approve」。管理員鎖了直接操作就打不開。
- 開著時每個聊天輸入框上方一條「一律放行」和「關閉」;「/always-approve off」關掉,直接操作是它打開的就一起關。

輸入框上方的狀態
- 好幾行的狀態(模型忙碌重試:錯誤、說明、幾秒後重試)以前疊出那一列、壓到輸入框;現在一行:「模型供應商目前負載過高,15 秒後重試(第 3 次,共 3 次)…」。

已驗證:cargo test 548 通過、1 個失敗(layout_audit 的 設定 › 電腦 被這台 Mac 的 Docker 位址 unix:///Users/daniel/.lima/anybot-gvisor 撐寬;把這次的改動 stash 掉一樣失敗,跟這次無關)。新測試:plan:: 7 個;agent 的計畫模式三個(只看到卡片說開始、先不要什麼都不做、修改後重交);app 的 /plan 從打字到計畫完成、Bot 從聊天加連接器(卡片不露 Token、同一輪就用它的工具算出 sum=5)、/always-approve(之前會問、之後不問直接在這台跑、陌生人的訊息照樣問、off 回原樣);mcp::manage_tests 4 個;狀態一行。截圖看過:計畫卡等你決定/照著做打勾、503 重試那一行。手機頁面 JS 語法檢查和計畫卡四種狀態的 HTML。
未驗證:真的模型走一次 /plan 和加 GitLab 連接器;手機實機;伺服器上的大腦(要 make update-server)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:55:37 +08:00
王性驊 dbc3197f6a fix: 頁面的數字卡不再把視窗撐出標題列(× 跑到中間);所有對話框都不會被內容撐寬
使用者那一頁(機箱健康報告:四張數字卡、結論、九張表、兩張圖)打開時視窗比標題列寬,× 在中間。原因是數字卡:每張卡的標籤、數字、變化該疊成三行,卻繼承了外面那一排「左到右」的排法而並排,卡片遠比算好的寬,整排超出閱讀欄、撐寬視窗;第一張的字還疊在一起。

- 數字卡(page_kpis):每張直排三行、同一排一樣寬;四張並排每張不到 150 時一排兩張(三張 → 三張,否則一張);字太長以 … 結尾,滑過看全文。
- dialog_body:內容在自己的一塊裡畫,太寬的在視窗邊緣切掉,不再撐寬整個視窗(標題列和 × 不會再錯位);超出時照樣記進 WIDER_DIALOGS,版面檢查看得到。
- 版面檢查的頁面場景加上四張長字數字卡、結論和十欄寬表格;寬表格真的左右捲動時回報那一條(scrolls_sideways),捲到邊被切的字不算錯。換回原本的數字卡程式,檢查報 36 個問題(含「視窗被內容撐寬 281px」)。
- 截圖用的 ANYBOT_SHOT_PAGE_JSON:整頁(標題、kpis、結論)換成檔案裡的。
- LOOK_KEYS 只給測試用,標成 cfg(test)(消掉警告)。

已驗證:cargo test --bin anybot 529 通過(含 text_stays_inside_its_place_on_every_screen 新場景);用使用者那一頁截圖 1180/1500 寬:× 在右上角、數字卡兩排各兩張,往下捲九張表和兩張圖都在閱讀欄內。
未驗證:使用者自己的螢幕尺寸。
2026-11-17 00:40:50 +08:00
王性驊 5efc2ac9ae fix: 當螢幕的電腦更新重開後,強調色不再變回橘色
這台 Mac 是雲端大腦的螢幕。螢幕上屬於這台自己的設定列在 LOCAL_KEYS,外觀(底色、強調色、對比、密度、慶祝動畫)是後來才加的,沒有列進去:在螢幕上改強調色只送去大腦、這台自己的 state.json 一直是 clay;更新重開時從大腦設定的副本開始,大腦若是不認得外觀的舊版,回來的就是預設的紙和 clay。

- 新增 LOOK_KEYS:外觀存在這台,連到大腦、大腦的設定傳來、存檔時都用這台的;改了照樣送給大腦(手機的顏色跟著大腦)。
- copy_own:原本四份手寫的「這台自己的欄位」清單(keep_local_fields、mirror_save、mirror_leave 只有主題和聊天的顏色)合成一份。

已驗證:cargo test --bin anybot 529 通過(新增 a_screen_keeps_its_own_look_and_settings:兩份清單上每個欄位設成非預設值都要被 copy_own 帶過去,清單加了欄位卻沒複製會失敗)。
未驗證:真的連雲端大腦更新重開一次(要先在新版選一次強調色,之後才會留住)。
2026-11-17 00:19:30 +08:00
王性驊 525a7fe56b fix: 選了做事的電腦之後,瀏覽器和螢幕步驟不再跑到使用者自己的 Mac
使用者把「工程」「FSD 追蹤專員」的做事的電腦設成 nobledesktop(雲端大腦所在的伺服器)。那台還沒裝瀏覽器時,Bot 沒指名電腦的 browser_open/browser_read 一路退到「使用者的電腦」,在使用者的 MacBook 上開 Brave(紀錄裡的結果是「[王性驊的MacBook Pro (2)] 已在 AnyBot 瀏覽器…打開」)。

- browser_place:Bot 沒指名時,使用者選的電腦開不了瀏覽器就失敗並說為什麼(沒裝瀏覽器/要 Docker/SSH 沒有視窗),要 Bot 先問使用者、公開網頁用 web_fetch,不再換到別台。
- screen_target:選的電腦沒有螢幕(SSH)時同樣失敗,不換到別台的螢幕。
- keep_to_chosen:Bot 自己指名使用者沒提的電腦,就算選的那台做不了這種步驟也拉回去(在那裡說清楚做不了),不再留在使用者的 Mac 上跑。
- 只管「使用者選了別台」(chosen_by_person:做事的電腦不是 Bot 自己的);沒選過、用 Bot 自己的電腦而這裡沒有 Docker 時,照舊可以借使用者的瀏覽器和螢幕。

已驗證:cargo test --bin anybot 528 通過(新增 a_chosen_computer_keeps_its_steps_off_the_persons_mac:選 SSH 的 nobledesktop → 瀏覽器、螢幕都失敗並說明;Bot 指名 Mac → 拉回;使用者說「用我的電腦」→ 去 Mac;沒選過 → 照舊借 Mac);原本的 a_step_moved_back_to_the_chosen_computer_says_so 等都過。
未驗證:真的雲端大腦(要更新 nobledesktop 上的大腦才生效)。
2026-11-17 00:10:09 +08:00
王性驊 a60b101eb4 fix: 回覆下面的頁面卡片一頁只出一張,沒存成的寫入不出卡
一個回覆寫了同一頁好幾次(被寫法檢查退回、再存、又更新),每一步都是一則訊息、各畫一張卡,而卡片顯示的是頁面現在的樣子——同一張「第 3 版」出現三次;想改別的 Bot 的頁面被擋下,卡片也照樣出現(畫的是那個 Bot 的頁面)。

- pages::ids_in 只算存成功(Done)的 write_page。
- pages::cards_by_message:每個回覆(你的一則訊息到下一則之間)每一頁一張卡,放在最後存它的那一步下面。電腦的聊天和手機的 api 都用它;手機上沒輪到出卡的 write_page 顯示成一般步驟。

已驗證:cargo test --bin anybot 527 通過(新增 a_reply_shows_each_saved_page_once_under_its_last_save:被擋、被退回、存兩次 → 一張;下一個回覆再寫 → 再一張)。
未驗證:使用者那段對話本身(沒有那份資料);手機畫面沒有實點。
2026-11-17 00:05:21 +08:00
王性驊 c8aa522d8b fix: 頁面圖表的數據表不再把頁面視窗撐出畫面;折線離 0 很遠時看得出起伏;長數據表收起
- 數據表原本是 egui Grid,數字欄用「靠右」排版,會拿走那一列剩下的所有寬度:條紋只蓋到第一欄、名稱置中、數字被推到卡片最右邊;有兩欄以上數字(圓餅的「佔比」、多系列)時下一欄從邊外開始,頁面視窗越撐越寬、跑出畫面。改成自己畫的一塊:灰字表頭、每列一條細線、名稱靠左、數字靠右、每欄只有內容那麼寬(和頁面的表格同樣子),太窄先把名稱切成 …,再不夠就在卡片裡左右捲動。
- 超過 6 列的數據表收成「▸ 數據 · N 筆」,點了展開(電腦和手機一樣)。
- 折線的 y 軸不再一律從 0 開始:最小值比資料的高低差還大時照資料範圍畫(1,649–1,796 W 原本是一條貼在頂端的平線);長條一定從 0。規則在 pages::chart_from_zero,手機 chartFromZero 同一條。
- 截圖用的 ANYBOT_SHOT_PAGE_BODY:頁面範例換成檔案裡的 Markdown。

已驗證:cargo test --bin anybot 526 通過(新增 a_line_far_from_zero_fits_its_data_and_bars_start_at_zero);深色截圖 24 小時用電折線(1600–1800 看得出起伏、數據收起、展開後視窗不變寬)、多系列與長條數據表;手機圖表測試 65/65(改成直接讀 index.html)+新規則 8/8;Brave 390 寬深色截圖:折線範圍、收起/展開、沒有橫向溢出。
未驗證:使用者原本那一頁(沒有那份資料)。
2026-11-17 00:02:22 +08:00
王性驊 bab3b6f8ea fix: 選聲音改成一個選單;搜尋框不再搶走輸入框的游標;側欄選中的 Bot 拿掉左邊色條
- 聲音(對話詳細資訊 › 語音聊天、設定 › 語音 › 說):原本是「聲音」字+「載入聲音清單」鈕+要自己打代號的框,載入後又多一個不顯示目前選擇的「選一個…」。現在和速度、語言一樣是一列一個選單:第一項「預設(eve)」,下面是服務的聲音(ElevenLabs 顯示名字),選了試唸一句;清單在那一列出現時就拿(每種「說」設定一次)。拿不到時選單裡寫一行原因,可以直接輸入名稱或「再試一次」。
- egui 的選單停在打開時的高度,清單或錯誤後來才到時下面被切掉:內容到了就在選單畫出前清掉它記住的大小,重新量一次。
- 語音服務的錯誤不再貼原始 JSON:金鑰被拒(含 xAI 用 400 回的)只說「不接受這把金鑰」,其他取服務回的 message。各服務不選時用的聲音集中在 speech::usual_voice。
- 側欄搜尋:搜尋框開著而且是空的時候,每一格都把游標拿回去,點輸入框打字的字會跑進搜尋框。改成只在按 🔍(下一格)或 ⌘F 時給一次。
- 側欄選中的 Bot 不再有強調色細條,只有淺底(比滑過深一階)。

已驗證:cargo test --bin anybot 525 通過(新增 a_refusal_reads_as_words_not_json、each_service_says_which_voice_it_uses_unasked);截圖:面板與設定的聲音選單(載入中打開、載入後打開都看得到輸入框和「再試一次」)、打開搜尋後點輸入框打「你好」留在輸入框、按 🔍 直接打「台南」進搜尋框、選中列沒有色條。
未驗證:用真的 xAI/ElevenLabs 金鑰載入清單和試唸。
2026-11-16 23:37:38 +08:00
王性驊 9de00e244e 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 23:16:38 +08:00
王性驊 fbc37f7fa1 docs: 允許卡片的說明文字和按鈕照新的精簡版本寫 2026-11-16 23:08:18 +08:00
王性驊 ea8fccd9a4 design: 支線結果只說一次、錯誤訊息改成安靜樣式
- 支線卡只顯示狀態(正在做、✓ 做完了、沒有做完、已停止)+停止/看過程;結果和沒做完的原因只在
  結束時貼到主聊天的訊息裡說一次(以前卡上一次、訊息一次);做完的綠色改用色板的 up
- 沒有按鈕時不畫空的按鈕列(「沒有做完」卡下面一條空白)
- 錯誤訊息:淡底+小紅色驚嘆號+一般黑字(以前粉紅底紅字)

已驗證: cargo test 523 全過、支線畫面截圖目視
2026-11-16 23:04:31 +08:00
王性驊 22c070fe72 design: 全畫面審查第一輪——修傳送按鈕破版、提示改灰、等你的卡片統一、允許卡片精簡、頁面卡片一張、Bot 設定進階收起
依 Anthropic 的設計原則逐一看過 39 個畫面,這一輪改:
- 傳送到其他裝置:「移除/複製/再試一次」寫死寬度,字一大就斷成兩行——改成照字量寬
- 輸入框下的提示(已排入…、已複製…)用強調色像錯誤——改成灰字
- 等你的卡片統一成 kit::needs_you_card(允許、問題、交給你處理):同一種黃;「需要處理」以前是強調色框看起來像紅色
- 允許卡片:一句「它想在你的電腦上執行:」+指令,三個短按鈕「允許/一律允許/拒絕」(一律允許會打開什麼放在滑過說明),
  「直接操作」改成灰字一行;標題字級回到規格(藏著的 17/14)
- 聊天裡的頁面卡片:一張精簡卡(圖示、標題一次、一行重點、一行灰字),以前標題出現兩次加四行預覽
- Bot 設定:電腦操作/能力/技能/記憶 預設收起,一行顯示目前怎麼設(kit::fold_title);
  「執行步驟用的模型」「思考模式」改成名稱在上、說明在「?」(kit::form_row_help),不再兩段灰字
- 權限:「新增規則」那列不再撐滿剩下的高度(大片空白)
- 看守:自己畫的卡片上限 17 → 13

已驗證: cargo test 523 全過(排版檢查、規格看守)、改過的畫面截圖目視
2026-11-16 22:57:13 +08:00
王性驊 94bbbd0493 design: 設定減字+頁面照 Anthropic 的報告寫法(寫法規則、存檔前檢查、可收起的細節)
設定頁(字太多):
- 設定列的「?」平常不顯示,滑鼠移到那一列才出現(位置保留,名稱不跳動)
- 設定下面的說明只顯示一行,長的結尾「…」,滑過看全文
- 外觀只留主題、強調色、聊天的顏色、語言;底色、對比、密度、慶祝動畫、重設收進「更多外觀設定」
- 聊天的顏色只有點(選中的有外圈),不再加一段文字;「你的電腦已是最新版本」改成灰字一行,不再是橘框

頁面(內容太亂、字太多):
- 給 Bot 的寫法規則改成 Anthropic 的寫法:標題就是結論、第一句補理由、最多三點;數字放 stats/表格;
  一節最多一處粗體;不用「→」、分隔線、標題編號;待辦用 steps、指令放程式碼;細節放 details
- 存檔前檢查(pages::review):段落太長、粗體太多、括號裡一串數字、標題編號、分隔線、「→」、表格裡的指令、
  很長卻沒有 details——退回一次並列出每一處;同一頁第二次照存,不會卡住
- 新頁面區塊 ```details 標題:預設收起的一行「▸ 標題」,點了展開(電腦和手機)

已驗證: cargo test 523 全過(新增:寫法檢查抓得到那頁的毛病、乾淨的頁面不報;退回一次第二次照存;
details 標題與收起)、clippy 21=基線、手機四段腳本 node --check、深色設定頁截圖目視
未驗證: 真的模型照新規則寫出來的頁面長怎樣(要等 Bot 下次寫頁面)
2026-11-16 22:28:37 +08:00
王性驊 f1c445efca fix: 表格的數字欄靠右時不再把整欄撐寬;第一欄(「#」或名稱)不自動靠右
靠右的格子在 egui 第一幀會拿走能給的全部寬度,欄就一直那麼寬(使用者的頁面「#」欄佔了半張表)。
改成先量每欄最寬那格,靠右/置中用補空白做。FEATURES.md 一併更新這幾次的說明
(聊天的顏色、Bot 的電腦字型、表格)。

已驗證: cargo test 520 全過(新增表格欄寬測試)、clippy 21=基線
2026-11-16 22:18:32 +08:00
王性驊 58413d8580 design: 共用元件(kit.rs)+套用到設定與對話框——一種區段、群組、設定列、卡片,不再卡中卡
- 新增 src/app/kit.rs:區段、群組、設定列、卡片、欄位、說明、按鈕、分段選擇、對話框底部,
  檔頭寫明用法和規則(卡片裡不放卡片、一個畫面一顆實心按鈕);從 app.rs 搬出 14 個元件
- 電腦頁自己的那套(sec_title/sec_card/sec_row/sec_note)改成共用元件的別名:小標、列高、
  列間細線和其他設定頁一樣;拿掉 setting_row(瀏覽器設定檔的兩個選項不再是卡中卡,
  「更新」頁改成一組群組+「疑難排解」區段;版本號直接顯示在列上)
- 設定左邊的分頁:選中改成淡底加粗字(不再是黑色膠囊)
- 說明字 12 → 13 px(灰一階的 32 處、會換行的 8 處);hint、欄位小標也是 13
- 20 個寫死的語意色(四種綠、紅、橘)換成色板的 up/danger/attention;連結用強調色
- Bot 設定底部「團隊成員可以使用這個 Bot」一行,說明放進「?」(以前換行、勾選框錯位)
- 看守測試:寫死顏色上限 88 → 66;kit.rs 以外自己畫的「底色+外框」卡片只准變少(17)

已驗證: cargo test 518 全過(排版檢查、規格比對、看守)、clippy 21=基線;設定 › 一般/電腦/
整合、Bot 設定、例行任務、右側面板截圖目視
未驗證: 使用者機器上的實際視窗
2026-11-16 22:07:07 +08:00
王性驊 7b1ec67754 design: 一套設計規格(電腦和手機同值)+讀的文字改成 Claude/Notion 的文件樣式
依 Claude 的設計原則:定一套字級並守住、卡片樣式按角色用、重複的元素一致。

- 字型:只留思源黑體(介面)+新加思源宋體(回答、頁面內文和標題,SIL OFL);
  拿掉粉圓體和「系統字型」選項、粉圓單一粗細的「粗體畫兩次」補丁;Mermaid 圖改用思源黑體;
  fonts/OFL.txt 補上思源黑體/宋體的版權
- 規格(theme.rs fs/sp/radius、手機 :root --fs-* --sp-* --r-*):字級 12/13/14/16/18/22/28、
  閱讀行高 1.7、間距 4–32、圓角 6/10/14;桌面 253 個寫死字級、166 個寫死圓角換成規格名稱,
  手機 167 個字級、79 個圓角、19 個色碼換成變數
- 看守測試:桌面和手機數字要一樣;畫面程式裡不准再寫死字級和圓角,寫死的顏色只准減少(88)
- 讀的文字:聊天 16 px 宋體行高 27、頁面同;標題 # 22 / ## 18 / ### 16;表格只有橫細線、
  表頭灰色粗體、數字欄靠右;提示框淡底無邊條只有小標上色;程式碼淡底無框;數字卡只留細框
- 頁面視窗:宋體大標題、一行小字資訊、現況當開頭段落、結論是安靜的提示框;目錄收成一行
  「▸ 目錄 · N 節」(⌘F 展開);刪除移到左邊,不再貼著「完成」;閱讀欄 680
- 圓餅圖拿掉黑色外圈、字照規格

已驗證: cargo test 518 全過(含排版檢查、規格比對、看守測試;看守測試故意放一個寫死字級確認會擋)、
clippy 21=基線;桌面頁面、聊天、表格原解析度截圖目視;手機 390 px 深淺截圖、node 圖表 65/通知 9
未驗證: 使用者機器上的實際視窗;iOS/Android 實機的宋體備援(手機用系統宋體,沒有就退回 serif)
2026-11-16 21:51:30 +08:00
王性驊 9c1c6d9c6b fix: 桌面——外殼設定即時生效、Bot 設定不破版(自訂顏色改點選色盤)、對話框不被撐寬
- 底色/對比/強調色/密度:每幀比對已套用的值,改了下一幀就換(以前淺色、深色主題要重開)
- Bot 設定:自訂顏色改成 12 色相 × 4 深淺 + 灰階的色盤加「色碼」欄(不用拖滑桿);
  形狀平均分列;預設色和「自訂」同一列;拿掉多的空隙
- 排版檢查多一條:對話框被內容撐得比標題列寬就失敗;修好它抓到的設定 › 電腦(瀏覽器設定檔改兩行)、
  例行任務(長標題換行、對話框標題截斷)、頁面(數字卡外框算進寬度)
- stats 漲跌規則(pages::stat_trend,認一般的 -,單獨 - 不算);長值一律縮字
- 圖表解析:列尾多的 | 不多出一欄;只有一行的圓餅用那一行的名字
- 問候看設定裡的時區;「你的瀏覽器」說明斷行不超寬;ANYBOT_SHOT_EVERY 不再卡住;簡體註解改繁體

已驗證: cargo test 514 全過、排版檢查 3 字型 × 2 資料 × 3 寬度、clippy 無新警告;
Bot 設定、設定 › 電腦深淺截圖目視
未驗證: 使用者機器上的實際視窗
2026-11-16 21:34:03 +08:00
王性驊 63e1f5383f fix: 手機網頁——圖表讀法同桌面、看得到數字、不破版;通知開關;加入主畫面說明
- ```chart 讀法照 pages.rs chart()(只寫圖型、中文圖型名、只有標題、# 註解、|---|、缺格補 0)
- 只有一片的圓餅畫成整圈;頭尾標籤不被切;折線與多系列長條有 y 軸、每張圖附數據表;
  圖照手機寬度畫(字 12–13px);負數長條不壓標籤;圓餅圖例再多項都畫得到
- stats 漲跌與桌面同一條規則(trend = pages.rs stat_trend)
- 通知開關顯示和動作都看帳號伺服器上的訂閱;連不上時照手機上的訂閱並說明
- 「加入主畫面」說明是一條編號清單;manifest 改紙色

已驗證: node 從 index.html 抽出的程式跑 65 個圖表案例、9 個通知開關情境;無頭瀏覽器 390px 深淺截圖
未驗證: iOS/Android 實機
2026-11-16 21:33:35 +08:00
王性驊 d1207d788b fix: 看畫面的票——連結裡的票一開頁就換掉,斷線重連每次換新票
- 帳號伺服器:票只在發出後 10 分鐘內能開新連線;已連上的畫面在要票的手機還登入時一直開著;
  新增 /relay/screen-ticket/renew,換票時舊票當場作廢(最後一次使用後 10 分鐘內才換得到)
- screen.html:開頁先換掉連結裡的票;每次重連前換新票(區網用新的一次性票);
  換不到時手機用自己的登入重新要,電腦開的頁面顯示「連結已過期」並停止重試(不再無限 401)

已驗證: relay 22 測試全過(新增票證輪換測試,含 WebSocket 升級的實際狀態碼)、
node 模擬 13 種重連情境
未驗證: 部署後實機(需 make update-server)
2026-11-16 21:33:35 +08:00
王性驊 6695787989 fix: Bot 的電腦——瀏覽器埠、更新重試、螢幕對錯、看畫面不被收掉、make update-box、鎖檔
- browser_open_port 回傳並探測轉接後的本機埠(原本拿盒子裡的埠探本機:收工不收分頁,
  本機開著 9222 時還會關到自己 Chrome 的分頁)
- 自動更新重試:等待從失敗那一刻算(30/60/90…,上限 150 秒),連續失敗 5 次就停;
  自動重試不再另存快照;按「更新」重新計次
- 看畫面記下實際連上的螢幕;打字用該連線自己的螢幕,螢幕沒開就不打(不再開出看不到的新螢幕)
- box/screen:有人連著 VNC 埠的螢幕不算閒置;鎖檔改唯讀開啟,open_screens 以 bot 身分執行
  (root 建的鎖讓 Bot 開螢幕一直 ERROR=busy);box 第 13 版
- make update-box 改請 AnyBot 自己更新(anybot --update-box),用它內建的版本和設定的 Docker 主機

已驗證: cargo test 全過(新增瀏覽器埠、退避上限、螢幕對錯、被看著不收掉等測試)、clippy 無新警告、
lint-sh、bash -n
未驗證: 需要 Docker 的實機重建、盒子裡實際 reap、anybot --update-box 實跑
2026-11-16 21:33:35 +08:00
daniel wang dcd9bee7d5 主題產生器進設定(底色/對比/強調色/密度/慶祝)+側欄細條+時段問候+目標撒花
Quiet Shell 收尾四件(A3/B2/B3/C/D),一次落地:

- C 產生器:theme::shell(tone, accent, contrast, dark)——三個旋紐生成整個殼
  (表面=紙朝墨等距階梯、文字=墨回紙、圖表六色=強調色轉色相);設定 › 一般
  外觀新增 底色(冷→暖)、對比(0.75→1.35,拉整個殼的階層一起調)、強調色
  (黏土/靛藍/苔綠/藍綠/玫紅/琥珀/石板/墨黑)、重設。預設=紙,舊設定檔 serde
  補預設。ANYBOT_SHOT_SHELL=tone,accent,contrast 出概念圖
- B3 密度:寬鬆(9/7)/緊湊(8/5) 全域間距開關
- B2 側欄:選中 Bot 不再整條深底——強調色 3px 細條+淺底(Linear 式)
- D1 撒花:只在 /goal 目標達成時,該聊天上撒 1.4 秒彩帶(chart_cat 六色,
  淡出收尾);設定 › 一般「慶祝動畫」可關;純裝飾,不擋任何操作
- D3 問候:新對話依時段先問「早安/午安/晚上好/夜深了」
- 淺深判定改成亮度函數 theme::is_dark(原先拿 pane 和 LIGHT 常數比對——
  底色旋紐一調就破);markdown 連結色、灰字、遮罩四處跟著改
- 手機 theme-color meta 換紙色;元件庫調查:egui_dock/notify/shadcn-egui
  都不引入(自有設計系統+鎖 egui 版本),缺的取色器用八點自家版

已驗證: cargo test 505 全綠(新增 theme 產生器 5 測:預設=紙、對比單調、
冷暖心跳、is_dark 跟旋紐不跟常數;含 layout_audit 三寬度新設定區塊不破版);
clippy 31=基線;截圖取樣:冷灰 pane(246,245,247)、紙 pane(248,247,245)、
側欄黏土細條 52px、墨黑殼 0px(強調色確實跟隨)、深色苔綠 152px
未驗證: 撒花只在真 /goal 達成出現,截圖模式不渲染(未目視彩帶飛的樣子,
落點/速度未調校);i18n 新字串(早安/靛藍等)靠自動翻譯,英日語未逐條核;
手機端不吃旋紐(只有 meta 色),自訂色手機同步是下一輪
2026-11-16 17:32:42 +08:00
daniel wang 723074f50b 手機端跟上「紙」配色;側欄新訊息點改用強調色;FEATURES.md 寫進配色規則
- mobile :root/深色代幣全換紙系:米白 #faf9f6、暖墨 #25221f、黏土橘
  accent、暖黑深色三階、圖表六色同桌面(同序同家族)
- 側欄「新訊息」小點從寫死的藍 #1680f3 改成強調色(跟主題走)
- FEATURES.md:第 32 節開頭寫進配色規則(殼全灰階、黃=需要你、
  紅=危險、顏色只出現在圖表),新訊息點/顏色選中圈兩處「藍色」文字更新

已驗證: cargo test 501 全綠;手機端 headless Chrome 渲染新代幣正常
(淺色平均 229,228,225 暖白/深色 50,49,47 暖黑),圖表卡、stats 卡照樣畫出
未驗證: 手機實機(Safari iOS 的 color-mix 於引導動畫點點——支援度 Safari 15+,
使用者環境未測);Bot 顏色 10 色(頭像系統)沒動,和強調色的搭配未逐一目視
2026-11-16 17:17:41 +08:00
daniel wang 6a09d1af51 stats 備註的漲跌也上色(桌面+手機);截圖模式可指定深色
- 桌面 md_stats:備註開頭 ↑/+ 綠、↓/− 紅(和值同規則)
- 手機:.stat .s 套 up/dn 色;dir() 同時看值和備註
- ANYBOT_SHOT_THEME=dark:截圖模式出深色圖(驗證配色用)

已驗證: cargo test 501 全綠、clippy 31(基線同);headless Chrome DOM 檢查
stats 備註渲染出 class="s up"/"s dn";xvfb 截圖深淺兩張,平均亮度
28(dark)/244(light)確認主題生效
未驗證: 深色圖表卡的實際對比度未逐項目視(僅平均亮度)
2026-11-16 16:48:03 +08:00
daniel wang e03ec4a90c 圖表與數字卡改成閱讀向排版(Notion 風):色板、直接標數、排序、手機原生圖
研究依據(2026-10 Supernova 11 設計系統調查、IBM Carbon 資料視覺化規範、
Atlassian chart tokens、shadcn/ui chart、Tufte data-ink、EEA/Sheffield 準則):
預設單色、分類色≤6固定序、只留淡水平參考線、直接標數取代圖例與座標軸、
長條按大小排序(自有順序的標籤不排)、顏色只給意義(漲綠跌紅附箭頭)。

- theme.rs:新增 chart_cat 六色(明暗各一組,低飽和藍紫青橙粉灰)、grid、up
- 桌面圖表卡:網格只剩淡水平線;單系列長條把數字標在條上、不畫 y 軸;
  長條自動由大到小排序(月/季/年/W1/Q1/數字等自然序標籤不排);
  多條線在線尾標系列名(取代圖例);stats 數字卡大字、↑/+綠 ↓/−紅
- Mermaid:白底卡節點、細灰連線、同套六色圓餅(house_theme)
- 手機:```chart 原本掉成純文字——現在畫原生 SVG,規則與色板和桌面同款;
  stats 卡改白卡描邊、大字、漲綠跌紅;代幣進 :root/dark
- write_page 說明:排版由渲染器接手,Bot 專心把圖標題寫成結論
- 功能地圖 pages.md/FEATURES.md 同步;layout_audit 新增「頁面(圖表)」場景

已驗證: cargo test 501 全綠;layout_audit 全綠(新場景含長條排序/多線/圓餅/stats,
664/1000/1440 三寬度無出界無疊字);手機 chartMd 用 node 跑 8 個案例(排序、
自然序不排、線尾標名、圓餅佔比、tooltip、千分位、壞輸入回空)全過;
ANYBOT_SHOT=page 截圖肉眼確認
未驗證: 手機端只在 node 驗證圖表產生器,未實機開網頁看 SVG 渲染;
Mermaid 新主題未逐圖型(gantt/gitGraph)目視;深色模式截圖未拍
2026-11-16 16:43:55 +08:00
daniel wang b917480af1 更新 Bot 的電腦: 忙碌時按更新會排隊,閒下來自動執行;失敗自動重試(越錯越慢) 2026-11-16 11:47:11 +08:00
王性驊 5144259c8e feat: Bot 的電腦換成 LazyBoy2 的 XFCE 桌面,加上檔案管理員、文字編輯器、影像檢視器
Bot 的電腦(第 12 版):原本的 fluxbox 只有右鍵選單和一條細工作列,不好用;現在照 LazyBoy2 的
box 換成精簡的 XFCE(xfwm4、xfdesktop、xfce4-panel,沒有工作階段管理員)。下方工作列有「應用
程式」、瀏覽器、檔案管理員、終端機、開著的視窗和時鐘;Arc-Dark 深色主題、Papirus 圖示、jf open
粉圓字型(建映像檔時下載並核對 sha256);選單、Chromium 和網頁語言是繁體中文(加了
chromium-l10n:LazyBoy2 的 Chromium 介面其實是英文),時區台北。開機就開好瀏覽器,第一次是
說明頁。每個 Bot 自己的螢幕也是同一套桌面。Bot 說「終端機」開的是工作列那個 xfce4-terminal,
說「檔案總管」「Files」開 Thunar、從家目錄開始,回覆用 Bot 說的名字。

LazyBoy2 沒有、這裡加的:檔案管理員 Thunar(有縮圖)、文字編輯器 Mousepad、影像檢視器
Ristretto,檔案按兩下用對的程式開,PDF 和網頁開瀏覽器;檔案管理員和網頁上傳檔案的視窗側邊欄
都有「下載」(Bot 下載的檔案);瀏覽器下載的「在資料夾中顯示」開檔案管理員。應用程式選單只剩
一層,拿掉 XFCE 的設定(每次開機照映像檔重放,而且大多要設定服務才生效)。

實際操作找到的問題:網頁上傳檔案的視窗 1342×1029、比螢幕大,「開啟」掉到螢幕外(GTK 要同時
記著位置才照記住的大小開,沒有就照字型算,粉圓 12 號算出來太大),現在開機時大小和位置一起設;
工作列的「面板 › 登出 › 結束」會把工作列關掉到下次開機,現在一秒後自己回來;工作列按右鍵能
移除、移動項目,現在鎖住(xfconf 的鎖要寫使用者名稱,寫「*」不算數);新視窗擠在左上角蓋住
瀏覽器分頁,現在開在中間。關機時先讓瀏覽器正常關掉,剛登入的 cookie 才會寫進磁碟。

box_update_keeps_files 改讀說明頁(fluxbox 的選單檔沒了);box_screen_is_exact 多測打開檔案
管理員。映像檔約 1.67 GB。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha54sGCEGh2rRbTsSeh
2026-11-16 10:55:05 +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
王性驊 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
王性驊 7ac7c24012 手腳指令修好:輸入預設關閉(pi-bolt -p 不再卡住)、補齊 PATH、互動終端機、Windows 用 Git Bash/PowerShell;任何聊天都能 @ 其他 Bot,結果回報到發問的視窗
指令(手腳電腦和每台電腦)
- 一般指令的輸入一開始就關掉:會讀輸入到底的程式(pi-bolt -p、cat)不再永遠等下去
- PATH 先讀登入 shell 的設定,再補 ~/.local/bin、Homebrew、cargo、bun、nvm…(開機自動啟動的 AnyBot 原本找不到 pi-bolt)
- 互動終端機(shell 加 interactive):pty/ConPTY,Bot 讀整理好的畫面、打字和按鍵、等某段字出現;開互動 shell 每次都問
- Windows:有 Git Bash 用它,沒有用 PowerShell(原本一律 /bin/sh,跑不起來);PATH 用 Windows 的分隔符號
- 實測 pi-bolt:-p 模式回答、互動畫面裡問答都能用

Bot 之間
- 任何聊天按 @ 都跳出可以選的 Bot(群組是成員);點名後由這個 Bot 用 ask_bot 去問,結果在這裡整理,不叫使用者自己去看
- 問同事/交辦畫成對話卡:誰問誰、問題、進行中狀態、回答,還有對方的紀錄連結;電腦和手機都有
- message_bot 交辦的事做完會自動回報到發問的聊天(標著對方的名字)
- 被問的 Bot 在側欄顯示「正在回答「A」的問題…」

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3a7riWESpv471gDgC
2026-11-13 22:03:26 +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
王性驊 8fbcc25e54 步驟上限改成 50000 步(等於不設限);每 25 步的自我檢查改問「最近這 25 步有沒有進展」
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3a7riWESpv471gDgC
2026-11-13 20:45:13 +08:00
王性驊 3f3d049ae8 個人檔案:指示和 soul 合成一欄;Bot 知道自己有個人檔案,聊天裡可以看和改自己的設定(先給你確認)
- 「Soul 與指示」一欄(instructions):Bot 設定拿掉另外的「指示」卡片(群組保留);舊存檔裡的
  soul 讀進來時併到指示最前面(Bot::fold_soul),之後不再寫出
- 說明裡加上:它有個人檔案、怎麼看和改、它沒有哪些能力(profile::self_knowledge)
- 新工具 my_profile(看:描述、soul 與指示、擅長、不做的事、能力有/沒有、技能與技能庫、
  可用電腦與預設、模型、思考模式、步驟模型、頭像)、update_my_profile(改上述欄位)
- 改設定一律先跳確認卡片,逐項列出改了什麼,按允許才生效、拒絕不動;按下允許時依當下的
  Bot 重算再套用,只動設定欄位;錯誤要求(沒有的能力、技能、電腦、顏色、重名、拿掉自己的
  電腦、沒變化)直接說原因;群組裡改的是正在說話的成員
- 例行任務和訊息管道的對話拿不到這兩個工具;網頁、檔案、別的 Bot 叫它改的不算
- 測試:聊天 → 確認卡 → 改好(拒絕則不改)、看設定與錯誤要求、舊 soul 併入指示
- 順手修:src/agent.rs 一個重複的 #[test]

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:24:58 +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
王性驊 29b4a6b24f 輸入框上方的頭像:每種情境一套動作和小道具(思考、看結果、搜尋網頁、操作螢幕、寫回覆、等你決定、完成、失敗)
- 新模組 src/app/mood_ui.rs:mood_of 一個地方判斷情境(工具分類和旁邊那行字共用
  chat_ui::step_kind / step_name),每種情境一個小繪圖函式
- 思考:頭縮小、三顆小球繞頭轉,越想越快;推理模式每收到一段推理小球亮一下
- 看結果:右下小紙,橫線一條條亮;搜尋網頁:放大鏡左右掃,眼睛跟著
- 操作螢幕:游標移動按下、冒出漣漪;寫回覆:低頭點頭、筆畫出波浪墨水,字停筆停
- 等你決定:黃點外擴散光圈、每隔幾秒彈一下;完成:笑臉、跳一下、金色小星星
- 失敗:一字眼、搖一次頭、一滴汗滑下後停住(不再持續重畫)
- 道具都在臉的方框內;前後分層(後面的畫在臉後、前面的描底色);淡入淡出;
  工作中的情境至少停 0.6 秒不閃;顏色太接近頁面時往文字色調整(深色模式黑臉)
- 截圖模式:ANYBOT_SHOT_VIEW=mood ANYBOT_SHOT_MOOD=…、ANYBOT_SHOT_ZOOM=2
- 測試:情境判斷、思考加速連續、道具不出框、道具配色;FEATURES.md 補說明

驗證:macOS cargo test 378 通過;Windows/Linux cargo check 通過

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:35:17 +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
王性驊 6f71a2ff1f 語言: the language to answer in follows every message; the conversion is only a net, with no hand-written words
- reply_reminder: after each of the person's messages (the last line of its tail, next to
  where the model answers) the chosen language is said again — for all 37, not only
  Traditional Chinese. With 跟著系統 it is added when the message is in Traditional
  Chinese, and never when the message asks for Simplified. Made from the setting and the
  message alone, so a chat still reads the same every turn.
- The hand-written table of Taiwan words is gone: wording is the reminder's work.
- The character conversion stays as a net for Traditional Chinese, on the tables that
  leave correct text alone (OpenCC's turned 台 into 臺 and 了解 into 瞭解 in every reply).
- FEATURES.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-12 10:33:56 +08:00
王性驊 935cee9346 繁體中文、換電腦: what a model writes is put into Traditional Chinese whatever the setting's system; a work folder from another computer lands under this home
- 繁體中文: converted at the one place every model call comes back (providers::run_step),
  decided from the request itself: the setting is 繁體中文, or it follows the system and
  the person writes Traditional. It used to be on only for the explicit setting, so a
  brain on an English server with 跟著系統 never converted, whatever the instructions said.
  Not when another language is chosen, nor when the latest message asks for Simplified.
- Converted: the reply, the thinking, and steps whose words are for the person (question
  card, card, page, memory, routine). Left as written: code blocks and `inline code`, a
  line of Japanese, file names, commands, searches, recipients.
- Taiwan wording after the characters: about 55 one-meaning computer terms (網絡→網路,
  文件夾→資料夾, 默認→預設…), and zhconv's OpenCC tables on (设置里的 → 設定裡的).
- The reply instruction says it too: no Simplified characters, no mainland wording.
- 換電腦: a bot's work folder chosen on one computer (/Users/daniel on a Mac) no longer
  breaks every file and command step on another (Linux, another user). It is sent as ~/…
  with the folder as chosen alongside; the receiving computer uses the folder if it is
  there, else the same place under its own home, else its home.
- FEATURES.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-12 10:29:02 +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
王性驊 908433967a 長對話: old step results are set aside first; a summary only if that isn't enough, written by the quick model
- at 70% of the context, results of older steps longer than 600 characters keep their first 200 for the model
  (the newest 6 messages stay whole): no model call, no wait — 20 file reads went from about 128k to 22k
  tokens in 10 ms in the test
- the chat keeps every result whole for the person; the mark (Message::folded) is kept, so the model reads the
  same thing each turn
- the summary, when still needed, is written by the bot's step model when it has one

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-12 00:02:32 +08:00
王性驊 d82c8bb2b9 外觀: the other settings pages and the phone follow
- 權限: 直接操作 and 自動審核 are switches in plain cards; 技能 and 連接器 lists use switches; 電腦's cards are
  white with the same edge
- phone: the chat takes the bot's colour, the bot's words have no bubble, 需要你允許 is the yellow card, the input
  has an ink edge; while it works the chat ends with the bot's face and the same 「正在…」 as on the computer
- screenshot hooks: ANYBOT_SHOT_VIEW=empty, ANYBOT_SHOT_SUB
- FEATURES.md: 外觀

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 23:03:24 +08:00
王性驊 deec40fd02 輸入框: Shift+Enter is a new line and goes on with a list, the box grows with its words; the working row says what the bot is doing
- Shift+Enter made a new line in name only: egui's shortcut matching ignores Shift unless asked,
  so it sent the message too; Enter and Shift+Enter are now read by hand (the / list takes plain
  Enter only)
- Shift+Enter on 「1. 買菜」 starts 「2. 」 (also 「9) 」→「10) 」, 「1、」, 「- 」「* 」「• 」, 「- [ ] 」, with the
  indent); on an empty item it ends the list
- the words box sat in a 28 px slot, so its scroll area stopped at 64 px and cut lines off; it now
  grows with the words (15 px on 22 px lines, wrapped) up to two fifths of the window, then
  scrolls; + and the buttons stay at the bottom
- the working row names the running step and what it is on (「正在搜尋網頁:台北 天氣」, 「正在打開網頁:
  github.com」, 「正在執行指令:cargo test」, every tool), and with none running a phrase that changes
  every 3 s (thinking / looking at results / writing)
- screenshot hooks: Shift+ in ANYBOT_SHOT_KEYS, ANYBOT_SHOT_TYPE, ANYBOT_SHOT_VIEW=working

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 20:53:27 +08:00
王性驊 5ae7cda6bb 目標: the goal goes with its chat, stays out of shared bot files, and 停止 between turns pauses it
- 清除聊天記錄 and 開始新對話 clear the goal first (it used to stay, and stopping the turn left a
  「目標暫停」 line in the emptied chat)
- a shared bot file no longer carries the goal; importing drops one that is there
- 停止 while the check is reading the chat pauses the goal instead of doing nothing
- 「繼續」 on a cut-off turn takes up a goal the restart paused
- AnyBot's own line never lands between a step and its result, and stays above a 「繼續」 card
- FEATURES.md: channels and team members can't set a goal (it said they could)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 20:35:53 +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
王性驊 cb0e4f3465 側邊欄: 重新啟動以更新 stays inside the sidebar
- The button sized itself to its words, 「重新啟動以更新(2026-11-11 17:23)」, which ran past the
  sidebar's right edge (more so at its narrowest, 240 pt). It is now one row across the sidebar,
  never wider, words in the middle: the time short (「17:23」 today, 「11/11 17:23」 another day),
  dropped when it doesn't fit, and the words cut with … if even they don't. The whole time is in
  its tooltip.
- Screenshot mode: ANYBOT_SHOT_NEWER=<hours ago> shows the button; ANYBOT_SHOT_SIDEBAR=<points>
  sets the sidebar's width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:25:59 +08:00
王性驊 215a5667cc 側邊欄: the bots at the top two to a row, a lone one in the middle
- The grid of the main and pinned bots held as many to a row as the sidebar's width allowed (three
  or more when widened), and a bot alone in a row sat on the left. Now at most two to a row (one
  when the sidebar is very narrow); a row that isn't full — a single bot, or the last of an odd
  number — is centred. Dropping a bot into the grid lands where the centred layout shows it.
- Screenshot mode: ANYBOT_SHOT_PINS=n shows n bots in the grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:21:51 +08:00
王性驊 915fdcf589 連接器: a 公用市集 of remote servers from the official MCP Registry, on the computer and the phone
- 連接器市集 gets a search box over registry.modelcontextprotocol.io (public, with an API):
  servers reached by address only (a package would have to run on the brain, which may have no
  Node or uv); old SSE ones are marked as not yet supported, taken-down ones left out. A name
  that only says "mcp" (com.notion/mcp) reads as whose it is (notion).
- 加入 on the computer fills 新增連接器 and scrolls to it: a free name, the address, and the
  header with the registry's placeholder ("Authorization: Bearer {smithery_api_key}"), shown
  unmasked with what to put there (the key's description, an address variable's choices). 新增
  stays off while a 「{…}」 is left.
- The phone: 設定 › 整合 › 從公用市集加入. The brain searches (the phone's page may only talk to
  its own server; GET /api/mcp/registry, owner only, on the HTTP thread); a pick asks for the key
  or the address part and the brain adds it (the 「mcp」 action's new `add`).
- A server that answers 401 (or a 403 asking for a login) with no key given now says it signs
  people in with OAuth, which AnyBot can't do yet; with a key, that the key is wrong or old.
- mcpservers.org and the like are pages for people behind a browser check, with no list a program
  may read, so the market uses the registry.
- Checked live: 「notion」 finds 6; AWS Knowledge (no key) connects with 5 tools; Notion's own
  server (OAuth) gives the OAuth sentence. `cargo test -- --ignored registry_search_live`.
- Screenshot mode: ANYBOT_SHOT_MCP=<search> shows the 公用市集 after that search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:12:12 +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
王性驊 c6c9a1674a 傳送: a file or a few words from any device of the account to any other
Outside the chats and without a bot: computer → phone, phone → computer,
computer → computer.

- The brain is the post office (src/drops.rs). The sender hands the file
  over in 2 MB pieces; the brain keeps it in drops/ and pushes it piece by
  piece to the destination computer (device/run tool `drop_put`), going on
  from where a broken link stopped and waiting up to 7 days for a computer
  that is off. What is for the phone waits at the brain to be downloaded.
- Files land in Downloads/AnyBot with a notification; words go on the
  clipboard. A computer takes parcels only from its own brain.
- Window: an ↑ button at the bottom of the sidebar opens 傳送到其他裝置
  (pick a device, drop files or paste text, the last 7 days below).
- Phone: 傳送到其他裝置 in the account menu (send, download, copy).
- Bots: a `send_to_device` tool, gated like send_file.
- Owner only; the account server is unchanged. Without an account, this
  computer and a phone connected to it directly can exchange.
- Docs: FEATURES §36, protocol, architecture, multi-device (zh and en).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 10:04:13 +08:00
王性驊 b4ba710eb4 記憶: each bot keeps its own, remembers like a person, and decides for itself
- Each bot only sees its own memories (the shared "bot 0" layer is gone).
- A 做過的事 line is written only for a turn that really did something
  (or looked things up in 5+ steps); small talk and simple answers aren't kept.
- The bot judges on its own what is worth remembering and whether a new fact
  is the same as, replaces, or stands beside an old one (`separate`); it
  doesn't ask the person first.
- remember no longer refuses a different fact that shares a subject with an
  old one (likeness is counted both ways).
- Filler messages (謝謝, 繼續, ok…) carry no memories; `_` and `%` are no
  longer wildcards in the search.
- Team members no longer receive `memories` with messages, and picks are
  taken only from the owner and only when they are this bot's real memories.
- forget only retires 記得的事, never a 做過的事 line.
- Memory chips are hidden while the bot is working (desktop and phone).
- A reply made long after the message gets a 〔現在時間〕 line.
- The nightly tidy runs only on the brain; edits are capped at 500 chars.
- Model download: no total body time limit, only a 60 s stall limit.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 09:35:59 +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
王性驊 1af25d7da4 提示音: a chime whenever a bot needs the person
A request to allow something, or a step only the person can do, only
bounced the Dock icon; a banner (with macOS's Glass sound) came only
when they were away, and on Linux notify-send made no sound at all. So
someone looking at another window on the same screen, or at AnyBot
itself without watching it, missed that a bot was waiting.

Now on_new_approval rings a chime every time, focused or not: two soft
bell notes going up (E6, then A6), 0.8 s, quiet, synthesized
(voice::chime_samples) so it is the same on macOS, Windows and Linux.
Several requests at once ring once; the banner that comes with it when
away stays silent so it doesn't ring twice (the 「完成了」 banner keeps
its sound). A screen of another brain rings for the brain's requests
too (they come through the same on_new_approval); a brain on a server
doesn't. 設定 › 一般 › 通知 › 「需要你時發出提示音」 turns it off (on
by default; turning it on plays it once).
2026-11-11 01:01:05 +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
王性驊 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
王性驊 c5bb16750f A screen never runs its own box or VM, from the start
The person wants the local box and Lima VM off whenever this AnyBot is set
to show another brain, not stopped after two idle minutes.

- sleep_on_a_screen has no idle wait and also runs right at start, before
  the loop's first 20-second pause; a resume of an interrupted rebuild is
  done on brains only (it would start the box on a screen).
- gvisor-vm.sh no longer registers the VM to start with the Mac: AnyBot
  starts it itself when it is the brain and wants its computer.

Verified on this Mac: VM started by hand while AnyBot was closed; the new
AnyBot (a screen of the cloud brain) stopped it 4 seconds after launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5F5gJt93t3yEx3XcS
2026-11-09 15:32:36 +08:00
王性驊 ec3fddf3ab A computer showing another brain lets its own box and Lima VM sleep
The Mac mini shows the cloud brain, whose bots work on the brain's own
computer and borrow only this Mac's screen, browser and apps. Its local
box still ran, and the Lima VM under it had grown to its whole 6 GB: the
Mac never gets back memory a VM once used.

- On a screen the box stops after 2 idle minutes, and the Lima VM too when
  nothing else runs in it. probe() no longer starts the VM there, and the
  volume holder and scheduled updates run on brains only. Becoming a brain
  again starts both (probe/ensure_running already wake the VM).
- Screen mode is decided from the settings before the box loop's first
  look, which used to start the VM at launch.
- gvisor-vm.sh: 4 GB instead of 6 (box capped at 2 GB), and the VM's
  ModemManager, udisks2 and multipathd are turned off.

Verified on this Mac: box and VM stopped by themselves 2 minutes after the
app started; the VM process (4.4 GB plus compressed pages) is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5F5gJt93t3yEx3XcS
2026-11-09 15:24:28 +08:00
王性驊 22eaf031b0 The quick model runs again, the Mac's own menus get numbers, and an unread window is said
- quick_tools indexed serde_json Values mutably, which inserted
  actions.items.properties = null into click/typing/scroll; xAI refused
  the whole tool list, so since ba1fce5 every step fell back to the main
  model. It now uses get_mut and the test checks nothing but ref changes.
- The front app's menu bar titles and any open menu (submenus, right-click
  menus) are listed with numbers and their shortcuts; an option-key
  alternate in the same place is noted on the visible item.
- Disclosure triangles, colour wells and date fields get numbers; an
  icon-only control without a name goes by its description.
- When the front window can't be read the list says so (with the reason)
  instead of 「」 above the menu bar alone.
- Computer facts add each system's conventions (Mac: cmd+shift+G, save
  panel, default format, /bin/sh echo -n; Linux: GTK ctrl+L).
- `anybot --help` and unknown -- flags print the usage and exit instead of
  opening the window on the real data folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5F5gJt93t3yEx3XcS
2026-11-09 14:58:40 +08:00
王性驊 3d10499d55 GTK 2 apps in the box get numbers, a quick model's answer always goes past the bot's own model, and a bot finishes what it was asked
- Box v9: GTK_MODULES=gail:atk-bridge. lxappearance and PCManFM (GTK 2) offered AT-SPI no
  controls at all (0 numbers); with gail they offer 37 and 17.
- The quick model ending a turn without acting goes to the bot's own model every time, not only
  after changes: one stopped after a single look to ask 「要我繼續嗎?」.
- Instructions: finish what was asked; put an unexpected screen right (close what's in the way,
  open the app) instead of stopping to ask, except for what the person must do or confirm.
- Benchmark: three more held-out tasks (lxappearance theme, PCManFM folder, Mousepad
  find-and-replace), checked by their results; every task starts with those apps closed too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5F5gJt93t3yEx3XcS
2026-11-09 12:53:06 +08:00
王性驊 1202de93ad Bots work like someone who knows the computer: they know each machine, reach what they see, plan, and hand the planned steps to a quick model
Measured on the bot's own box (8 tasks x 2, grok-4.7): 14/16 done, 120 steps, 1114 s before;
16/16, 102 steps, 574 s after (model time 1015 -> 471 s). A replayed skill: 49 s -> 15 s.

Knowing the machine
- facts.rs: 電腦現況 per computer (system, desktop, systemd, sudo, network, package manager,
  tools, apps, a fixed TZ), read once by a small read-only probe, kept 30 min, in the
  instructions at the start of a turn.
- The box's sudo is the bot's: only what follows sudo is checked against the always-denied
  list (it was refused outright, while the instructions said it could sudo), and commands with
  sudo run as the box's root (setuid does nothing under gVisor).
- Box image v8 drops ENV TZ=UTC (it overrode /etc/localtime). ANYBOT_BOX_IMAGE /
  ANYBOT_BOX_VOLUME give a throwaway box its own image and volume, never adopting the real one.
- Mac shell sandbox: App Store app CLIs (they carry their own app sandbox) and ps/top run
  outside it; plain `osascript -e` too, asked the first time even in direct mode, refusing do
  shell script, terminals, keystrokes, file reads, ObjC and the secret folders. A command the
  sandbox broke says so, instead of looking like a broken program.

Reaching what it sees
- The Mac menu bar's status icons are numbered (each app's AXExtrasMenuBar, named from inside
  for the system's own), computer_use_zoom looks closer at full sharpness.
- Numbers stay with their controls from look to look (they were reassigned every look, so a
  step's second click landed elsewhere); the box's front window is listed first; a control can
  be named instead of numbered (name "4").
- Web page numbering walks open shadow DOM (Chromium settings, web components).
- A box on a Docker host elsewhere retries the next port when the usual one is taken (a retry
  without it came up with no network).

Working like a person
- Instructions: pick the route, know what done looks like, one route, check once, say what's
  stuck instead of faking it with a substitute, ask before cutting the connection.
- StepPlan: the bot's model takes the first step, the step after trouble (failed, refused,
  repeated, nothing changed on screen, the quick model switching routes), one in four, and the
  final check; a quick model (Bot.step_model, auto: grok-4.20-0309-non-reasoning on xAI) does
  the planned steps in between, falling back to the bot's model if it can't be used.
- Skills keep the steps that worked (with what each acted on, not numbers); replay_skill does
  them again with no model in between, finding each control again, handing back on a mismatch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5F5gJt93t3yEx3XcS
2026-11-09 09:01:03 +08:00
王性驊 ebaedecbae FEATURES: Firefox in AnyBot's browser, and Linux front-app naming and accessibility switch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-08 00:59:17 +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
王性驊 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
王性驊 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
王性驊 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
王性驊 cbada6bdb1 Bots learn from what they did; the box's browser works with the box's own disk
- A job of five or more real steps is looked back on after the answer: the short way that
  worked becomes a skill (or improves the one it followed); the reply says so. The prompt has
  the bot check its skills before starting.
- Upload, download and PDF on Bot 的電腦's browser look for and save files in the box, not on
  the brain (a picture in a Threads post took 24 steps).
- The bot's browser keeps the six tabs used last (19 Threads tabs had filled the box's 2 GB).
- Words name the control, not the box around it: a form's 「Customer name:」, 「Large」 and
  「Submit order」 used to land on the <p> holding them and do nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-06 23:12:53 +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
王性驊 2867c8e822 Remove what nothing uses and keep one copy of what was written several times
Unused (found by taking away the dead-code allowances; nothing else used them, tests aside):
computer::specs, quiet_button, the never-made Poke::Spin, ten icons and their SVGs, the
theme's chrome/bubble_agent colours, ImportRow.line, voice's multipart/transcribe/speak
wrappers, and the old keychain writers vault::save/remove/index_add with their live test
(the vault store replaced them; reading old keychain entries for the import stays).

One copy each: percent-encoding (httpd::url_encode, was four), tool arguments (tools::args_of,
was three), the WebSocket handshake (httpd::accept_websocket, was three), the read pacing
(wire::Pace, was two: relay and app), docker with input and a time limit (dk_with_input, was
two). Docs: FEATURES §看畫面 (VNC), protocol (v* frames, /screen, tickets), architecture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 23:21:47 +08:00
王性驊 aa9b010276 One way to act on a screen: a real click or keystroke, wherever the bot looked
- Acting by an app's number (read_app's e7) is now a real click at that control's spot, the
  same path as screenshot coordinates. agent-desktop only reads; its own actions (a second set
  with its own key names and failures: no typing in terminals, "/" and "`" failing off the main
  thread) are gone, with computer_use_select, background clicks and press_key's app.
- Every action comes back with the screen after it (or, with no picture allowed, the front
  app's numbered controls), so the bot no longer spends a step on a screenshot to check.
- Coordinates map without remembering a screenshot: the picture's size depends only on the
  screen. The phone's taps go straight to the screen as the person's, in the pixels of the
  picture it was sent; they used to borrow the bot's last screenshot scale and landed 1.25x off
  on the bots' computer, or failed with "screenshot first".
- Mac typing pastes (⌘V, clipboard put back): with 注音 on, text sent as key events vanished
  while return arrived, so commands typed into a terminal ran empty. Bare printing keys
  ("slash", "r") are typed the same way; keys like "slash" and "grave" have names.
- The bots' Docker computer: one docker exec per step (action, settle, picture), never
  `mousemove --sync` (it waits forever when the pointer is already there: a second click on
  the same spot hung two minutes), open_app (chromium = the browser browser_* drive, xterm).

Tests: box_screen_is_exact (real Docker: bot and phone coordinates exact, same spot twice in
under 2 s, ASCII + Chinese + named key typed), Calculator by numbers and Terminal typing under
注音 through the signed app, remote_e2e 28/28, Linux build + 151 tests + x11_live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:51:19 +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
王性驊 c0dfef0995 Docs: 頁面, Tailscale servers, no-questions install, hands' virtual screen and updates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-05 08:35:47 +08:00
王性驊 867732bd73 make, README and docs: build and install from source
- Makefile: make / run / install / uninstall / deps / test / serve / setup /
  hands / relay-run / server / dist / clean (macOS and Linux).
- README.md and docs/: install (all platforms, data locations, troubleshooting),
  multi-device (brain, hands, screens, pairing, what the offline messages mean),
  architecture (layers, data, security, sync, keys, hands, picture helper),
  protocol (relay and AnyBot endpoints, WebSocket frames, sync ops), release
  (packaging, Gitea Actions, Linux and Mac runners).
- install.sh --deps-only, bundle.sh KEEP_APP=1 (used by make deps / install).
- FEATURES.md: the multi-device part is done.

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