Commit Graph

37 Commits

Author SHA1 Message Date
王性驊 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
王性驊 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
王性驊 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
王性驊 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
王性驊 f78513a6ff design: 你的訊息泡泡預設改成「安靜」(淡灰、黑字,像 Claude),電腦和手機同一個設定
- 聊天的顏色多一個「安靜」並設為預設;原本的「跟著 Bot」「只用黑色」保留
- 存著舊預設(跟著 Bot)的設定檔第一次打開時換成安靜一次(bubble_quiet_offered),
  之後再選回跟著 Bot 就照選的;只用黑色本來就是選的,不動
- 手機:泡泡照同一個設定畫(Bot 清單多一個 bubble 欄位);手機設定的「強調色」改名「聊天的顏色」,
  多「安靜」選項;修好一個舊 bug——手機拿到的是 "BotColor"/"Black" 卻跟 "bot_color"/"black" 比,
  勾選永遠停在「Bot 顏色」
- update_settings 的 accent 多 "quiet"

已驗證: cargo test(新增:預設是安靜、舊預設換一次、之後選回保留、黑色不動)、node --check 手機四段腳本
未驗證: 手機實機
2026-11-16 22:18:32 +08:00
王性驊 eb70608160 feat: AnyBot 功能地圖——Bot 用 anybot_guide 認識 AnyBot 本身;修好地圖整理時找到的七個問題
功能地圖(照 Lauren Tan 的 feature map,poteto/verification-skill-example)
- docs/feature-map/:20 區加索引,每區四段(子功能/使用者怎麼到/怎麼操作(Bot:、驗證:)/陷阱),內容逐條對照程式;索引寫共同前提、證據與略過的回報、全面檢查順序
- Bot 的系統提示多一行區塊目錄;新工具 anybot_guide 一次讀一區(唯讀)
- cargo test featuremap:: 擋漏寫:Bot 能拿到的每個工具、browser/computer 的每個動作、設定視窗每個分頁和區塊、update_settings 的鍵;每區要有四段、不能太長
- 自動學技能:AnyBot 本身怎麼用不抄進技能,地圖錯漏記成待改進;園丁在重複的待改進旁提醒補地圖
- CLAUDE.md:改功能時同一個 commit 一起改地圖
- 側邊欄「分區」工具的說明寫清楚:不是群組聊天

修正
1. 別人傳來的訊息(訊息管道、團隊成員)那一輪不給 AnyBot 瀏覽器、保險庫和已送紀錄(瀏覽器帶著使用者的登入);硬叫也擋下,公開網頁仍可 web_fetch
2. 自動學會的技能加進那個 Bot 自己的技能清單(支線的算主 Bot 的)
3. 按停止一併停掉這個 Bot 的互動終端機(一般背景指令照舊)
4. 設定 › 整合 › 技能、頁面的「刪除」要再按一次確定
5. update_bot 先跳確認卡片,列出每一項要改成什麼
6. Bot 範本的頭像形狀改成存在的形狀,並加測試
7. 文字:直接操作的提示改「設定 → 權限」、金鑰錯誤改「設定 → 模型」、等核准逾時照實說是什麼在等

Mac 490 個測試通過。

Refs: cl3xk7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:15:09 +08:00
王性驊 c7f6da7fe8 feat: 發布關卡——已送帳本、發布前檢查、送出後讀頁面留證據、例行任務完成條件、重播可填空格
1. 已送帳本(publish.rs):Bot 用 AnyBot 瀏覽器送出前,系統先讀頁面,看是哪個帳號、回哪一篇(回覆對話框或文章裡的貼文網址、或頁面本身);同一帳號回過同一篇就擋下(記 60 天),頁面看不出回哪篇時只擋 24 小時內同頁同字。搜尋框按 Enter 不算送出。瀏覽器新增 sent 動作,直接從帳本列出帳號回過誰,不必每輪讀完網站的回覆頁
2. 發布前檢查:送出前請另一家供應商的快速模型照基本規則(簡體字、AI 腔、不該公開的內容)、這一輪讀過的技能與自訂規則檢查,沒過就不送並說原因;固定不變的放在系統提示最前面方便快取,同一段字一輪只問一次;設定可關、可加規則
3. 送出後的證據:系統重讀頁面,確認文字出現、輸入框清空,抓出留言自己的網址;寫進 Message.sent(頁面文字偽造不了),送出計數、例行任務紀錄、/goal 評審、手機頁面都以它為準;框裡還留著字就記為沒有送出
4. 完成條件:例行任務可設 target_sends,系統自己數:到數就不准再送,結束時不到算失敗,連續兩輪(50 步)沒有新的送出就停下;喚醒訊息與進展檢查都說明目前計數
5. 重播空格:自動學技能時把每次不同的內容(留言、貼文網址)存成 {{名稱}},replay_skill 用 values 填這次的內容,缺哪格就說哪格
6. 間隔從真正送出那一刻算起;送出後確認最多等 8 秒,框清空 4 秒仍沒看到就先記「還沒確認」

Mac 480 個測試通過;送出前後讀頁面在 Brave、Firefox 實機測試通過。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:48:13 +08:00
王性驊 98fc63e65b feat: 借鏡 pstack/Grok Bot——例行任務執行紀錄、完成看證據、教訓分流、園丁報告、減少操作步驟、網站地圖
1. 例行任務執行紀錄:每次執行記開始/結束、完成/失敗/被停止/中斷、步數與失敗步數、原因,保留最近 20 次(Grok Bot 官方規格);上次失敗或中斷的原因帶進下一次;連續失敗 2 次自動暫停並說明原因;設定頁、手機詳細頁、list_routines 都看得到,沒有紀錄時說「查不到」不說「沒跑過」
2. 完成看證據:evidence.rs 從步驟算出實際成功送出幾次,寫進例行任務紀錄;/goal 評審的摘錄把 Bot 的話標成「不是證據」並附系統統計,對不上以系統為準;評審優先用另一家供應商的模型,失敗退回原本的
3. 教訓分流:自動學技能時,AnyBot 自己的工具問題寫進 tool_issues → 「待改進」清單(同一工具合併計次),不寫進技能;設定 › 更新可看可清除
4. 園丁報告(garden.rs):平日 8:44 掃過去一天的失敗、走冤枉路的執行、自動暫停與重複出現的待改進;週一 8:49 列出失敗多或太耗時的例行任務;沒事不報,可在設定關掉
5. 減少步驟:browser type 多行文字一次放進欄位(先試貼上事件、檢查沒進再用 insertText,Firefox 也行)並回報欄位內容;點進輸入框回「游標已在…」不再說「沒有變化」;元素編號在同一頁重讀時不變;wait 的 after_send 從上次送出算間隔
6. 網站地圖:學技能時同一網站的操作知識整理進「<網站> 網站地圖」(功能/怎麼到/怎麼操作/陷阱),做事的技能只寫特有規則

Mac 465、Linux 469 個測試通過;多行輸入與編號實機測試在 Brave、Firefox 通過。

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

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

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

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

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

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

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-10 11:46:17 +08:00
AnyBot Dev 7d61de83a8 Skills you can hold in your hand: skill files, install, 示範即教學 (P7+C8)
- a skill is now a .md file (front matter + instructions + an optional
  steps fence): <data>/skills/ is read at every start, files win;
  install from the CLI (anybot --install-skill <path|url>) or from the
  phone (設定 › 整合 › 技能 › 從網址安裝), delete takes the file with it
- skillify (C8): long-press your own message in the chat → 教我做 —
  the last turn that answered it becomes a replayable skill from the
  oplog: only steps that succeeded, looking steps and numbered clicks
  filtered (numbers die with their screenshot)
- a browser replay step that doesn't fit gets one fresh page read
  before the bot takes over, same courtesy the screen steps had (C8)
- three example skills in skills/, the format guide in docs/skills.md
- the prompt lines that merges had eaten: menu_click/fill_form/wait_for
  (C3), memory recall + search_documents (P6) — the tools were there,
  the model just wasn't told about them
2026-11-09 20:46:02 +08:00
AnyBot Dev bbd677b050 Memory, searched not carried: FTS index + event log (P6, step 1)
- store.rs grows a memories table + FTS5 (trigram) index: bot facts and
  the person's shared lines (bot 0), no cap — state.json's 200-item list
  stays the source that mirrors sync and the 設定 list; the index is its
  searchable superset, best-effort as always
- queries answer in Chinese: phrase hits (FTS), then words inside lines —
  CJK queries cut into two-character windows, lines scored by how many
  they contain (「有没有靠窗」 finds 「我喜歡靠窗的座位」)
- every finished turn writes one event line (ask → answer) nobody's
  asked to write: 「我上個月說的那個報表」 answers from months back
- the turn's prompt carries the 14 memories that answer *this* request
  (no index yet: the list itself, the old behavior); remember/forget and
  the UI's 忘記 keep the index in step with the list
- embedding (Ollama) and document indexing land on this same table next
2026-11-09 18:15:24 +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
王性驊 e0a1545e0e A step on a skill or a memory says which one
The phone showed a bare 「刪除技能」 when 新 Bot deleted the test skill; save/use/delete skill,
remember and forget now carry the name or the fact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-07 00:36:24 +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
王性驊 39cd7e85d7 Phone: a home with the computers, pages and routines; each bot's settings a tap away; long jobs fold up
The phone page was bare: one row per bot, a chat listing every step, a menu with four lines.
- Home: the main bot large at the top with its model and last words, the other bots with times,
  then its computers (own box and the account's, online or not, 看畫面), the newest pages and the
  routines with their next run.
- Chat: the bot's name opens its settings — model (chat models only), computer, past conversations
  (restore), regenerate, new chat. A turn's steps fold into 「已完成 N 個步驟」 when done (the newest
  three stay while it works); copy and regenerate under replies; four ready starts in a new chat;
  a jump back to the newest message.
- Menu: 外觀 (follow the phone, light, dark).
- API: api/state carries pages and models; each bot its model, computers, routines, past
  conversations; POST api/bots/{id}/set | regenerate | restore. The home's last line skips errors.

Checked on a local copy of the brain's data (cut off from the account and Docker) at iPhone size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-06 20:28:08 +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
王性驊 ab564f706f The bots' computer never sleeps; a server brain doesn't work on the server; the computer choice lives in the side panel; bots default to their own computer
- No idle pause: an asleep box is woken; its files are saved once a day instead of before sleep.
- A headless brain offers no Local computer; attachments it receives go into the bot's own one.
- 「你的電腦」 kept by older versions means the bot's own computer; only an explicit choice moves it.
- The composer chip moved to the panel's 電腦 card (做事的電腦).

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 16:47:28 +08:00
王性驊 591626408f A server brain without hands calls its server the brain server, and tells the model which computers really exist 2026-11-05 16:03:34 +08:00
王性驊 4fa5fab870 Remote: per-IP login lock, egress peers and timeouts narrowed; brain-mirror link covered by tests 2026-11-05 15:48:20 +08:00
王性驊 4c0db53647 Replies in Traditional Chinese when that is the setting; a cloud brain's browser is the person's
- 語言 繁體中文: a reply's Simplified characters are turned into Traditional with Taiwan
  wording (zhconv), since some models (Qwen) slip despite the instruction.
- A brain on a server: browser steps go to the person's computer (its hands) unless the
  server's own browser is named; 你的電腦 is listed first.
- update_bot says the default computer it set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:46:42 +08:00
王性驊 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
王性驊 2bc573f095 頁面: pages a bot makes and keeps up to date (like the original's tracking pages)
- write_page / read_page / list_pages: Markdown pages with versions (last 10 kept), per bot;
  the reply gets a card (title, fading preview, page icon, 頁面 · 更新時間, 最近更新), and
  [標題](page:ID) links open the page
- The page opens large: summary, what changed, the version picker, 複製 / 存成檔案 / 刪除;
  listed under 資料庫 in the right panel
- Page blocks for richer pages, in the chat's Markdown too: ```stats tiles, ```steps progress,
  > [!NOTE]/[!TIP]/[!WARNING]/[!IMPORTANT] call-outs (with tables and Mermaid charts)
- Phone: the card in chats, page links, a page view with the same blocks; charts drawn by the
  AnyBot as SVG (GET /api/pages/<id>[/chart/<n>]); members may read pages
- Bots are told to make a page for things to track and to update it from a routine only when
  there is real news
- Screenshot views: ANYBOT_SHOT_VIEW=pagecard / page

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