Commit Graph

45 Commits

Author SHA1 Message Date
王性驊 e3b9163cb5 Merge branch 'worktree-agent-a30de739ff90a717a' into assistant
# Conflicts:
#	src/main.rs
2026-11-20 16:16:47 +08:00
王性驊 292d07a7af wip: 完成宣稱檢查(可信任)——claims.rs 回覆對步驟核對、未驗證標記、叫醒改正、sandbox 連結改道 2026-11-20 16:16:43 +08:00
王性驊 ca7f801e10 wip: 任務系統(可觀測)——tasks.rs 狀態機+證據分級、list_tasks、手機/電腦任務頁 2026-11-20 16:16:43 +08:00
王性驊 2d90e5decd feat: 交付確認——Bot 傳的檔案記下在哪台裝置顯示、點開沒,沒顯示出來叫醒 Bot 一次
起因:Bot 產了一張圖、send_file 回報成功、Bot 一直說「已完成」,但圖一直沒出現在使用者
的聊天裡,系統完全不知道。「完成」改成:你看得到、能用,而且系統知道你收到了。

- 附件有身分:attach::store/store_bytes 給每個附件一個編號(舊資料讀得進來,沒有回報的
  附件寫出來跟以前一字不差);螢幕電腦把路徑換成本機副本時編號不變,回報一律用編號。
- 三層狀態記在大腦那則附件上:已在聊天 → 已在某台裝置顯示 → 點開了,或「顯示失敗」加
  原因;每筆記哪台裝置和時間,同一台同一種只記第一次,最多 12 筆。記號和「已顯示/已
  點開」只看擁有者自己的裝置;團隊成員、管理員的裝置只記下(最多 4 筆)、不叫醒。
- 誰回報:
  - 手機:POST api/bots/<id>/seen(團隊成員也可以)。圖片真的載入、在畫面裡、頁面在前面
    才算顯示;預覽真的畫出來(文字、表格、圖、PDF 的頁、能播的錄音影片)或存到手機才算
    點開;大腦回 404/422/500 或圖片再抓一次還是解不開算失敗;斷線、408、429、502–504
    算網路問題、不算。不排隊,每次開頁面每個附件每種只報一次。
  - 大腦自己的視窗(「這台電腦」):卡片在畫面裡停留 0.8 秒、視窗在前面才算顯示(聊天剛
    打開時從頂端畫的那一格、「回到最新訊息」捲過去的不算);點開算點開;檔案不見了算失敗。
  - 螢幕電腦:api/sync/act 的 seen(大腦用它的名字記,另開執行緒送、不擋其他訊息);抓大腦
    檔案被回 404 算失敗(以前完全不報),網路斷了不算。
  - 裝置名稱、原因都由大腦從固定的字選,頁面送來的字不會原樣進到 Bot 那裡。
- 同步:remote_signature、msg_sig、聊天存檔的 chat_mark 都算進回報;message_json 對 Bot 傳
  的附件輸出 id、delivery、seen。
- 畫面:Bot 傳來的附件下面一個灰色小記號——✓ 已在聊天、✓✓ 已在某台裝置顯示、點開過的
  ✓✓ 是強調色;手機點記號跳出清單、電腦版滑過看清單(每台裝置、時間、顯示/點開/失敗和
  原因)。使用者自己附的檔案沒有記號。失敗不另外跳字;手機上解不開的圖也顯示原本的
  「這張圖讀不到」(以前是一塊空白)。
- Bot 知道:send_file 的結果改成「已放進聊天(…附件 <編號>)…不要說使用者已經看到」;之後
  的回合結果後面帶一行〔交付狀態:…〕(日期寫死,不會每天變);系統提示加一句以那個狀態
  為準、使用者問收到沒照它回答。
- 叫醒:擁有者的裝置回報顯示失敗、而且還沒有擁有者的裝置顯示過,叫醒那個 Bot 一次(新的
  「[交付]」標籤,視窗和手機的 WAKE_TAGS 一起改),只寫附件編號和副檔名、哪台、為什麼
  (不寫檔名:檔名可能來自外面,這則訊息帶著擁有者的信任開一輪),請它換方式交付。只在
  「傳出這個檔案的那一輪是擁有者開的」時叫醒:訊息管道的人、團隊成員、別的 Bot 要的檔案、
  群組聊天、給使用者看畫面的截圖、支線帶回的檔案都只記下。擁有者上次說話之後最多兩次;
  Bot 在忙、叫醒在排隊時別台顯示了就取消。
- docs/feature-map/deliver.md 新增子功能 deliver-confirm、使用者怎麼到、三條 verify-anybot
  步驟、陷阱;FEATURES.md 同步。verify-anybot 的假模型照規則回答時多記 tool_results(這個
  請求裡每個工具結果的結尾),用來證明 Bot 讀到〔交付狀態〕。

合進主線(接在手機、螢幕電腦「沒網路照樣能用」之後)
- 手機頁面:apiOnce 用主線那行(已經帶 e.status、e.unsure);離開聊天先存一份、回到聊天看
  畫面裡的附件,兩個都留。螢幕電腦:兩邊新增的測試都留,離線那輪的測試附件補上新欄位。
- 合併後跑 deliver.md 時發現(以前就有、離線那輪重畫變多後才明顯):手機聊天每次重畫,
  圖片都先退回檔名再載入、長高,「停在最新訊息」只在重畫那一刻判斷,幾張圖之後最新那則
  被推到畫面外、也就永遠不算「顯示」。改成:已經讀到的圖重畫時直接沿用;停在底部時,
  內容在畫完之後變高(圖片載入)也跟著停在底部,往上捲在讀的不動;比螢幕高的問題卡留在
  它的問題那裡,不被拉到底。FEATURES.md 同步。

已驗證: cargo test 全綠(主程式 767,含 featuremap::、layout_audit::、tool_specs_are_locked、
approval_decisions_are_characterized;新增 attach、deliver_ui 6 條、remote、mirror_ui、
remote_ui、app 的 group_history 與系統提示、layout_audit 的記號滑過清單);verify-anybot
deliver.md 全部步驟照貼從頭跑過(傳檔預覽、機密不傳、伺服器上打不開、沒登入沒有發佈、
交付確認顯示/點開/Bot 讀到狀態、顯示失敗叫醒一次且重開後仍是一次),另手動驗過刪掉大腦
副本後手機記「大腦上找不到這個檔案」、已點開的不叫醒;十輪乾淨脈絡獨立審查,最後一輪無
P0/P1。
合進主線後:cargo test 774 通過;verify-approval-routing --replay 跟合併前一樣(AllSurfaces 通過、
replay 10 個都過,「改過了」的 5 段在 HEAD 就是如此);verify-anybot 在新的 scratch 上把
deliver.md、phone.md、cards.md 全部步驟各從頭跑過都通過(含「沒網路也打得開」「斷線又回來」、
問題卡一題一題走);另外實跑:往上捲在讀時,新傳來的圖不會把畫面拉回底部。合併的部分另做
一輪乾淨脈絡獨立審查:沒有 P0/P1,兩條 P2(高的問題卡被拉到底、重畫先用原檔)已修,一條
P2(超過 40 張圖時錯誤處理掛得晚,不會誤報)留著。
未驗證: 真的 iPhone/Android(Safari 的 IntersectionObserver、主畫面 App)——要實機;螢幕電腦
連大腦的真實路徑——要另一台登入同帳號的 AnyBot;桌面視窗的記號與 0.8 秒停留——要開視窗
(ABV_ALLOW_WINDOW,要使用者同意),只有行程內繪圖測試;團隊成員、管理員經帳號伺服器
回報——要帳號伺服器與第二個帳號。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5JgTkqJjkgMtrEXrn
2026-11-20 14:00:47 +08:00
王性驊 00e79d66eb feat: 螢幕電腦沒網路照樣能用——直接開副本、訊息和設定排著連上再送、離線只剩一個小標示
螢幕電腦經 Tailscale 香港中繼連大腦(來回 0.6–1 秒、常斷):以前打開一定先停在「正在連到…」
等大腦第一次回答,斷線就「現在只能看」、一大塊紅色提示佔掉聊天高度,訊息 100 秒送不到就退回輸入框。

- 有副本就直接進去:磁碟上有這個大腦的副本(brain-copy.at.json 是這個大腦、有 Bot)時,打開 App
  立刻顯示副本、不等網路,之後照舊只拿變了的;只有第一次(沒副本、或是另一個大腦的)才停在等待頁。
  副本的設定當「上次知道的大腦設定」(mir.base),離線時的改動照樣算成小改動。
- 沒網路照樣能送:訊息(連引用、附件、記憶)進排隊,馬上顯示在聊天最下面(等連上大腦後送出/
  傳送中…/排隊中…),還沒送出去過的可以「取消」放回輸入框。排隊存在 brain-queue-<大腦>.json
  (每個大腦一份、金鑰封存),關掉 App 再開還在;連上後依序送,斷線多久都等;附件傳上去的記下來,
  重試不再傳;大腦一直連得到、這則卻連續 20 次送不過去才放棄(說可能已經到了)。大腦拒收的才退回輸入框。
- 只做一次:每則照舊帶編號(大腦記 10 分鐘);離第一次送出超過 9 分鐘才再送的,先看大腦的聊天裡
  有沒有這句,有就不送。設定改動照舊用 (client, seq)。
- 沒網路照樣能改設定:改動同樣排著,連上後由現有的 pending/unsaved 機制疊在大腦的新設定上;
  秘密欄位、keep_run_times 的保證不變。離線時新增的 Bot、例行任務,編號從大腦上次的計數之後
  1000–9000(每台不同)起跳,不會跟大腦這段時間給出去的撞號;只讓出編號不算改動;計數器在
  apply_ops 也只往前。
- 停止、重新產生、還原、執行例行任務、新對話、清除、回答卡片、按鈕送的指令:照舊要連上才做
  (斷線不到約 100 秒照樣送),改走自己的一條路,不會卡在等連線的訊息後面(回答卡片不等;
  其他最多等剛排進去的改動 10 秒)。回答卡片的內容和 key 沒變。
- 不擋畫面:紅色大提示拿掉,聊天頂端「分享」旁邊一個小小的「離線」(有在等的寫「離線 · N 則
  等送出」,剛打開是「連線中…」),滑鼠移上去說原因、顯示的是幾點同步的、做的事連上後才送。
- 順便修好:大腦送出的設定裡,沒有觸發條件的例行任務被插了 "trigger": null,螢幕電腦每次存檔都
  把所有 Bot 的例行任務當改動送回去(the_brains_settings_read_back_the_same)。
- src/remote.rs 只加了 sync_try(一次嘗試、分得出網路還是大腦拒收),拿掉不再用的
  sync_upload_sure;first_delivery/DELIVERY_TTL 沒動。
- docs/feature-map/account.md 的 account-brain 和陷阱、FEATURES.md、docs/multi-device.md 同步。

已驗證: cargo test(主程式 763,含新測試:有副本就進去/沒副本才等、離線的訊息連上後只到一次、
重開後排隊還在、太久沒回答的先查聊天、試不過去會放棄、離線改的設定疊到大腦的新設定、離線新增
不撞號、送出的設定讀回來不多出改動、離線送出排隊與取消);featuremap::、layout_audit::、
approval_decisions_are_characterized、tool_specs_are_locked 綠;verify-anybot 帳號區走得到的步驟
(只聽一個位址、密碼錯/登入、重開不用重登、登出另一台、登出這支手機、錯 5 次要等)都過;
六輪乾淨脈絡審查,P0/P1 都修完,最後一輪沒有新的 P0/P1。
未驗證: 螢幕電腦連大腦的真實路徑(要帳號伺服器加第二台電腦,scratch 不准帶帳號);桌面視窗上
「離線」標示和排隊泡泡的樣子(ctl desktop-shot 要開視窗、須使用者同意,沒跑);大腦重開期間
回答掉了的訊息可能多收一次(大腦只在記憶體記編號)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5JgTkqJjkgMtrEXrn
2026-11-20 11:03:53 +08:00
王性驊 e644d88446 perf+fix: 舊電腦也輕、連上才進去、送出不重複、小模型說了就做、智慧模式常開、提早壓縮
畫面省資源(舊 Intel Mac)
- 聊天紀錄改成共用、寫入時才複製(src/shared.rs):側欄和聊天每一格不再複製整份聊天(約 13 MB/格)
- Markdown 解析、程式碼上色依內容快取,只有串流中的那則重算
- 用內建顯示晶片(wgpu LowPower),雙 GPU 的 Mac 不再喚醒獨顯;WGPU_POWER_PREF 照樣優先
- 所有轉圈圖示限每秒 20 次(egui 內建 Spinner 跑滿刷新率);淡入、彩帶、跳轉高亮也限速
- 頭像共用一個眨眼時鐘、捲出畫面的不畫;你不在(視窗不在前面或 90 秒沒動)不眨眼
- ioreg 移出畫面執行緒;Bot 工作中每 5 秒存一次(原 2 秒)
- 螢幕電腦的大腦副本每 5 秒在背景寫一次(原本每次同步都在畫面執行緒寫整份)
- 手機狀態裡的指令輸出先截短再遮罩金鑰

連線(螢幕電腦 ↔ 大腦)
- 連上、拿到最新資料才進去:之前整個視窗停在「正在連到「…」…」,連不上 10 秒以上可改回這台自己的 Bot
- 重開只補差異:副本旁記下版本與這台在大腦的名字;第一次拉取帶 config=1、不等新消息
- 漏收一次回應只補差異(大腦保留上一份 Seen),不再整份重抓
- 送出不重複:POST 只在根本沒送出去時才重試;訊息與動作帶編號、斷線自己重送約 100 秒,大腦同一個只做一次;改動依 (client, seq) 只做一次,seq 從時鐘起算
- 斷一下還能送(排隊),真的送不到文字放回輸入框;按過的允許卡片 30 秒內不再跳出
- 獨立審查修正:動作編號加上這次啟動的標記(沿用 client 時不再撞號被當重送);等待頁以「收到第一個回答」為準、設定讀不出來照樣進去並說原因、等滿 10 秒就有離開鈕;整份重抓失敗會再要;上一次拉取失敗時帶 retry,大腦從上一份算差異;去重表滿了淘汰最舊的
- 手機頁在背景時不重畫訊息,回到前景再畫

小模型持續做(src/agent/followthrough.rs)
- 回答說了要做什麼卻沒呼叫工具、或問「要我現在就開始嗎?」:告訴模型、下一步安靜地跑;動手才顯示,標記「〔到此為止〕」或又只說一次都不顯示;連兩次、一輪 12 次為限;最後一句提到刪除、付款、寄出、關機這類收不回來的事一律不提醒
- OpenCode Go 模型清單改讀新格式 api/recommended_api(舊的 endpoint 照讀)

智慧模式常開
- 預設開、/smart off 與手機都關不掉(只有管理員鎖時關);設定頁只剩逾時滑桿 30–1800 秒;輸入列不再有它的圖示

token 壓縮提早
- 門檻 70→60%(進行中 65%);估算改成英數 3.5 字元一 token;一個要求做很多步時主動把這一輪較早的步驟寫成摘要(至少 10 則),不等模型說太長

feature-map:chat.md 新增 chat-followthrough(含步驟)、chat-compact 6 成、chat-steps;autonomy.md 智慧模式一直開著(步驟改寫);account.md 連上才進去、重送與去重;settings/safety/phone 同步。FEATURES.md 同步。

已驗證: cargo test 739 通過、clippy 無新警告(含 featuremap:: 11 項、layout_audit::、新增 followthrough/shared/mirror 去重與漏收補差異測試);verify-anybot:chat.md「/ 指令」(/context 寫「到 60% 會自動」)、「說了就做」(只說「我把它整理成一頁做法文件。」後同一輪接著執行 echo ft-done 並收尾,模型那層收到提醒)、autonomy.md「智慧模式一直開著」(/smart off 回不能關,重開後 smart_mode 仍 true);審查修正後三步重跑結果相同;ctl down 無殘留;乾淨脈絡獨立審查 1 次(P0×1、P1×1 已修)
未驗證: 手機頁面畫面那一層(這台沒有 Google Chrome,無頭手機頁面開不起來,改走同一個大腦的手機 API);螢幕電腦連大腦的實際路徑(要帳號伺服器與第二台電腦:等待頁、重開續傳、斷線重送只在單元測試);真 Intel Mac 的 CPU/風扇與 LowPower GPU 實測;真的小模型(muse-spark 等)是否照提醒動手;動到審批路徑(智慧模式常開)需實機測試+人類簽名,本輪不發佈

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:28:31 +08:00
王性驊 35ac683485 fix: 連上前停在外面;桌面閒置與等待時不滿幀重畫
手機頁面
- 還沒連上、第一份狀態還沒到手之前,停在「正在連線…」,不先顯示登入表單或 Bot 清單
- 連上、狀態到手才進去,清單與要開的聊天已經填好
- 進去之後斷線仍留在裡面,照舊顯示「連線中斷」並重連

桌面(Intel 上發熱、耗電)
- 工作中的臉、「正在…」閃光、串流文字的重畫最多每秒 20 次(以前每一個 token 都立刻重畫整個視窗)
- 等你決定的卡:黃點和輕彈約每秒 5 次,卡片本身不再逼整頁滿幀重畫
- 沒在動就不為了動畫重畫

feature-map:phone.md 新增 phone-net 的「還沒連上就在外面」步驟;chat.md、FEATURES.md 補上重畫頻率。

已驗證: cargo test 728 通過(含 featuremap::,11 項);verify-anybot phone.md 全部步驟(新增「還沒連上就在外面」,login 步驟改成先等 v-login)+account.md 直接連線步驟,EXIT=0
未驗證: 真 Intel Mac 的發熱和耗電(要實機量 CPU 與風扇);帳號伺服器路徑的進場;實機 iPhone 的連線切換;Bot 的電腦閒置休眠的決定尚未做

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-19 21:35:31 +08:00
王性驊 4a4ef03c46 桌面版面:聊天與卡片的呼吸(天地)
用離屏版面審計量出使用者說的「破版」實為節奏太擠:訊息堆則與則之間
只有 9px,卡片裡問題→選項、區塊→按鈕都挤在 6px。統一節奏——
- 訊息堆:則與則 14px(緊湊 11px),日期分隔上下 12px。
- 審批卡:程式碼框內 10px,按鈕前 10px,「之後都直接操作」前 8px。
- 問題卡:題目→選項 10px,選項間 6px,欄位→按鈕 12px。
- 計畫卡:卡前 8px,摘要→步驟 8px,確認/注意 8px。
- Header:右側按鈕貼頂 12px;Bot 名字文字與聊天內文左緣對齊(同格線)。
新增離屏診斷探针(report_breathing_room / report_design / report_who_*,
#[ignore] 手動跑):量每屏文字到窗邊距離、左緣起點分布、<3px 擠對。

已驗證: cargo test 721 全綠(含 layout_audit::text_stays 全螢幕全寬度);
report_design 重跑:聊天、審批卡、問題卡、計畫卡、Bot 設定、例行任務、
頁面「擠」全部歸零(剩餘為設定遮罩下聊天層的跨層相鄰,非破版)。
未驗證: 真機視窗外觀(使用者自觀)。
2026-11-19 15:38:13 +08:00
王性驊 660018c303 智慧模式 (/smart): 一问一决定,不是一步一卡
询问和一律放行中间的设定(CLAUDE.md 改善轮迴的第一块:聊天卡顿的主因是一步一卡)。
- 卡片多一个「这轮都准」: 同类操作这一轮只问一次(Job 就是一轮,按构造就是 per-turn;
  下一轮会再问)。grant 非空的 Action 卡与连接器卡有这按钮;must-ask(付款/传送/删除的
  点击、你的屏幕和 App、保险库、一律询问规则、hook)没有,也不被覆盖。
- 卡片逾时: 你几分钟没回,卡片自己回答——看档案/上网这类先做(步骤结果里写明),敏感操作
  自动拒绝并告诉 Bot 别重试。/smart 中途开关都即时(窗口一个 Arc,Job 共享)。
- 审核缓存: 自动审核的模型判决这一轮按(规则,动作)缓存,重复同一步不再每次付 10–20 秒;
  审查看不见档案全文时照旧自己问(没动)。
- 开关: /smart(/smart off、status)、设定›权限(滑块调时限,默认 300 秒)、输入列旁图标。
  手机/远端只能关不能开(words_loosen + remote setting 只收紧);untrusted 回合永不智慧。
- 锁: 管理员锁住直接操作/本地执行时,智慧模式一起锁。
- feature-map: chat.md / safety.md / autonomy.md / settings.md 同步(featuremap 测试绿)。

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

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

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5sXAsDLzxz6UZJgoC
2026-11-18 17:44:16 +08:00
王性驊 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
王性驊 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
王性驊 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
王性驊 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
王性驊 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
王性驊 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
王性驊 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
王性驊 ea8fccd9a4 design: 支線結果只說一次、錯誤訊息改成安靜樣式
- 支線卡只顯示狀態(正在做、✓ 做完了、沒有做完、已停止)+停止/看過程;結果和沒做完的原因只在
  結束時貼到主聊天的訊息裡說一次(以前卡上一次、訊息一次);做完的綠色改用色板的 up
- 沒有按鈕時不畫空的按鈕列(「沒有做完」卡下面一條空白)
- 錯誤訊息:淡底+小紅色驚嘆號+一般黑字(以前粉紅底紅字)

已驗證: cargo test 523 全過、支線畫面截圖目視
2026-11-16 23:04:31 +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
王性驊 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
王性驊 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
王性驊 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
daniel wang c58f14e274 介面組件庫(ui_kit: section/card/field/switch/seg/pill/disc/empty/ghost)+全域圓角、muted 輸入底、細卷軸;Bot 頭像可自訂顏色(色相/飽和/明度,存 #hex) 2026-11-13 01:08:52 +08:00
王性驊 f7ce2dae0c 連接器: the brain's connectors work — a screen shows the brain's state, 重新連線, many tools are found instead of sent
- 設定 › 連接器 on a screen showed the screen's own (empty) MCP state: every brain connector read
  「未連線」 and its error never reached the person. The brain now sends its connectors' state with
  each sync; errors from the brain say 「在大腦上:」.
- 重新連線 on each connector (computer, screen → brain, phone); one that is on but not connected is
  tried again each minute; a link that died (process ended, HTTP session expired) is dropped and
  connected again instead of failing every call.
- More than 20 connector tools: none ride along. The model gets find_connector_tool (the list of
  connectors, search by words) and use_connector_tool (runs the found tool, asked like the tool
  itself). A brain with scc (82) + the market's sent ~170 tools / ~120 KB a turn, over the
  128-tool limit of many services.
- A server that doesn't start says why: no Node.js / uv, a folder not on this computer, and the
  last lines it wrote to stderr; it is ended instead of left running.
- The brain image has nodejs/npm, python3 and uv (uvx), caches on /data.
- Moving to a brain leaves connectors that name this computer's folders here.

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

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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 21:54:24 +08:00
王性驊 6a84abcaeb 外觀: the bot is the lead — its face over the input says what it is doing, its colour runs through the chat, requests dock above the input
- 思源黑體 (Noto Sans TC Regular, OFL, bundled) is the default font; 粉圓體 and the system font stay as choices
- the chat takes the bot's colour by default: the person's bubble, the send button, the chosen tile (a little of it)
- the bot's words sit on the page without a bubble; the person's bubble has its small corner toward them
- above the input: the bot's face, looking at the input when idle, up while it thinks, across at 「正在…」 while a
  step runs, at the person (yellow dot) when it needs them, smiling for 2 s when done, flat-eyed after an error
- 需要你允許 is a yellow card docked above the input instead of a pop-up over the window; Enter allows and Esc
  refuses while the input is empty, after the card has been up 0.6 s; yellow is the one colour for 「需要你」
- header: the name at the left, plain buttons without rings; icons drawn a little heavier (2.25)
- an empty chat: the face large, a line on what the bot is for, three things to start with
- screenshot hook ANYBOT_SHOT_CALM

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:54:58 +08:00
王性驊 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
王性驊 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
王性驊 89dbb243dc Chat: a 回到底部 button once you've scrolled far up
The desktop transcript only followed new messages while it was already
at the bottom; scrolled up through a long chat, the way back was the
wheel. Past 400 points above the newest message (the phone's
threshold), a round ↓ fades in over the bottom middle of the chat, just
above the composer. A press scrolls smoothly to the end and keeps
pulling for up to a second, so words streaming in meanwhile don't leave
it short; then stick-to-bottom takes over again and the button fades
out.

ANYBOT_SHOT_VIEW=longchat fills the chat with 60 messages, to check it
with ANYBOT_SHOT_SCROLL / ANYBOT_SHOT_CLICK.
2026-11-10 22:00:34 +08:00
AnyBot Dev 1bc2fdcec9 Rewrite decompilation comments as behaviour specs; move reverse-engineering docs out of the repo; drop third-party marks from UI strings (i18n tables synced) 2026-11-09 16:37:33 +08:00
王性驊 2f603c2362 A turn cut off by a crash leaves a 「繼續」 card, and nothing it may have done runs twice
Each bot keeps a work log (oplog/bot-<id>.jsonl, after pi's durable-harness design, cut down):
before something happens a line says it is about to — the turn, each model call, each step once
its checks passed (with the arguments it runs with and whether it may run again), each message
typed mid-turn — synced to disk first. When the turn ends the file shrinks to the messages still
waiting, usually nothing.

On the next start after AnyBot was killed mid-turn, the log puts the chat right before anything
runs: the message the turn answered comes back if the chat lost it; a step that was running and
reaches outside (a text, a click, a file, a published site) shows as 「可能已經執行了」, both to the
person and in the result the bot reads — no longer as "not allowed"; a step that only looked shows
as cut off; messages typed mid-turn that never reached the bot go back into the chat. The chat is
saved, then the log closes the turn. A turn the person didn't stop ends with a 「繼續」 card (what
it was doing, what may have run, the messages put back); it goes on only when they press it — in
the window, on a screen of the brain, or on the phone — from where its steps stand, never running
a step that may have run again. Pressing stop is on disk at once, and a stopped turn stays
stopped.

Also in the turn loop:
- 自動審核 that doesn't answer (or answers something that isn't a verdict) asks the person; in
  直接操作 mode it used to let the step through unchecked.
- "Too long for this model" folds older messages into a summary and asks the same step again,
  once per thing the person said, instead of ending the turn.
- Folding keeps the person's chat whole: the summary goes in at the fold and the model reads from
  the newest summary on (it used to delete what it folded).
- A step moved to the chosen computer runs there, but the chat keeps the call as the model wrote
  it; the result says where it ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha5F5gJt93t3yEx3XcS
2026-11-09 00:49:12 +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
王性驊 b9fc134c99 Phone: a step's name stays on one line; every step says what it does
From looking at the real phone page after the fixes: a long command squeezed its step's name into
one character per line (執/行/指/令), and sending a file showed as 「工具」. The name keeps its width,
the detail is cut with an ellipsis, and send_file, react and view_demo_step have names; the window
says 「正在傳檔案給你」 instead of 「正在記下來」 while a file is sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2RVfSYmrhqNnqx9Z4
2026-11-06 19:55:40 +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
王性驊 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