左下角看得出 Bot 在哪一台、點一下就換(計畫 B1 第一步):名字下面多一行——「這台電腦」或「大腦「雲端大腦」」(綠點連得到、灰點連不到),不用打開設定就知道現在看的是哪一台的 Bot。點一下開「Bot 在哪一台」選單(以前是直接開設定):「這台電腦(這台的名字)」、帳號裡每台可以當大腦的電腦(手腳不列;現在用的打勾,離線的灰、不能點),點一下就換——跟 設定 › 手機與帳號 大腦那一欄的「改用它當大腦」「改回用這台自己的 Bot」同一段(mir.want/mir.leave);沒登入多一行「登入帳號,才能換到別台大腦…」;最下面「設定…」(⌘, 照舊)。截圖用的示範畫面 ANYBOT_SHOT_VIEW=whose(已登入、是雲端大腦的螢幕、另一台離線;帳號伺服器位址立刻拒絕、螢幕副本在暫存資料夾)。功能地圖 settings.md(settings-whose、驗證步驟)、FEATURES.md、計畫 B1 狀態同步。

已驗證: cargo test 全綠(824),新測試 the_bottom_left_says_whose_bots_these_are;featuremap、layout_audit 過;clippy 錯誤數跟之前一樣(12);桌面截圖(ABV_ALLOW_WINDOW,按左下角打開選單):沒登入「✓ 這台電腦(王性驊的Mac mini)/登入帳號,才能換到別台大腦…/設定…」,螢幕模式「daniel/● 大腦「雲端大腦」」、選單「這台電腦(…)/✓ 雲端大腦/jenny-Host(離線)灰/設定…」。
未驗證: 真的從選單換到另一台大腦再換回來——要帳號裡有兩台大腦的實機(切換本身是原本設定頁那段)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
This commit is contained in:
王性驊 2026-11-21 11:30:29 +08:00
parent c1a9dcc7bd
commit cc47b3d29d
5 changed files with 119 additions and 6 deletions

View File

@ -1564,6 +1564,11 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
- 指令輸出、連接器的回答太長時,給模型的只留開頭和結尾各 6000 字,中間寫「…(中間省略 N 個字;完整內容用 read_result 讀:id=r…)…」;完整的存在資料夾的 `outputs/`(一份最多 20 MB、留 7 天,同樣的內容同一個 id)。較早的結果為了騰出空間被收起時也一樣寫 id。
- 每個 Bot 都有 `read_result`(id、從第幾個字、一次最多兩萬字),只是看,計畫模式也能用。以前叫 Bot「再做一次這一步」看完整的:會改東西的步驟重做很危險,答案也可能不一樣,長紀錄的中間就這樣不見了。
### Bot 在哪一台(左下角)
- 左下角你的名字下面多一行:Bot 在哪一台——「這台電腦」,或「大腦「雲端大腦」」(綠點連得到、灰點連不到)。不用打開設定就看得出現在看的是哪一台的 Bot。
- 點一下開「Bot 在哪一台」選單(以前是直接打開設定):「這台電腦(這台的名字)」、帳號裡每台可以當大腦的電腦(手腳不列),現在用的那台打勾,離線的灰、不能點;點一下就換過去——跟 設定 › 手機與帳號 大腦那一欄的「改用它當大腦」「改回用這台自己的 Bot」是同一件事。沒登入帳號時多一行「登入帳號,才能換到別台大腦…」;最下面「設定…」(⌘, 照舊)。帳號裡的電腦清單每 15 秒更新一次。截圖用 `ANYBOT_SHOT_VIEW=whose`(示範資料:已登入、是「雲端大腦」的螢幕、另一台離線)。
### 模型在哪裡跑(本機/區網/雲端)
- 每個模型服務依它的網址標在哪裡跑:「本機」(localhost、127.x、::1)、「區網」(10.x、172.16–31.x、192.168.x、169.254.x、100.64–127.x 的 tailnet、fc00::/7、fe80::、`.local`、`.lan`、`.home`、`.internal`、`.home.arpa`、`.ts.net`、沒有點的名字)、「雲端」(其他全部,ChatGPT 方案一律算雲端)。只看網址字串、不查 DNS(畫面每一格都會畫到);一個公開網域就算其實指回家裡,也說雲端——分不出來時寧可說「會送出去」。本機、區網是綠字,雲端是灰字。

View File

@ -10,6 +10,7 @@
- 通知:Bot 做完或等你時通知、需要你時響一聲([account](account.md))。Mac 上的通知是 AnyBot.app 自己發的(貓的圖示),點一下打開那個 Bot;從建置資料夾直接跑(不是 .app)時改用系統的 display notification,圖示是「工序指令編寫程式」。
- Bot:時區,例行任務和提醒用([routines](routines.md))。
- 帳戶:「登入」或「管理帳戶」打開「手機與帳號」頁;資料放在哪。
- `settings-whose` 左下角(你的名字):名字下面一行寫 Bot 在哪一台——「這台電腦」,或「大腦「名字」」(綠點連得到、灰點連不到)。點一下開「Bot 在哪一台」選單:「這台電腦(這台的名字)」、帳號裡每台可以當大腦的電腦(現在用的打勾,離線的灰、不能點),點一下就換——跟「手機與帳號」頁大腦那一欄的「改用它當大腦」「改回用這台自己的 Bot」一樣([account](account.md));沒登入帳號多一行「登入帳號,才能換到別台大腦…」;最下面「設定…」(⌘, 也可以)。
- `settings-account` 「手機與帳號」頁(從 一般 › 帳戶 進去,[account](account.md)):「AnyBot 帳號」(登入、備份、還原)、大腦和「加一台電腦」([computers](computers.md))、「同一個網路直接連」、「手機可以做什麼」、「直接連線的裝置」、「分享給團隊」([team](team.md))、「帳號裡的電腦」。
- `settings-models` 「模型」:每家 AI 供應商的 API 金鑰、服務網址、新 Bot 預設模型、「測試連線並取得模型清單」([models](models.md));本機或區網的供應商多「看不到圖時,請雲端模型看截圖和附件」(預設關,[chat](chat.md))。「ChatGPT 方案」沒有金鑰和網址欄,改成「ChatGPT 帳號」:登入狀態、「使用 ChatGPT 繼續」「登出」「換帳號」「打開登入頁」「管理用量」;連到別台大腦時多一格貼回登入網址和「完成登入」。
- `settings-integrations` 「整合」,三個小分頁:
@ -44,6 +45,7 @@
- 基本前提和「手機已登入」(README),開著 Bot 1 的聊天:`$CTL phone click '.row[data-bot="1"]'`。
- **左下角:Bot 在哪一台**(covers `settings-whose`):前提:要開視窗。指令:`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot whose ANYBOT_SHOT_VIEW=whose ANYBOT_SHOT_SIZE=1000x620 'ANYBOT_SHOT_CLICK=90,595@6' ANYBOT_SHOT_FRAMES=14`(示範資料:已登入、是「雲端大腦」的螢幕、jenny-Host 離線),再不帶 `ANYBOT_SHOT_VIEW` 跑一次(沒登入)。看到:左下角「daniel/● 大腦「雲端大腦」」;選單「Bot 在哪一台」下「這台電腦(…)」「✓ 雲端大腦」「jenny-Host(離線)」(灰),分隔線下「設定…」;沒登入時是「✓ 這台電腦(…)」「登入帳號,才能換到別台大腦…」「設定…」。真的切換要帳號裡有另一台大腦:走不到,和「手機與帳號」頁的按鈕是同一段(`mir.want`、`mir.leave`)。
- **Bot 改三樣**(covers `settings-by-bot`、`settings-general`):請 Bot 換深色、只用黑色、時區紐約,再傳一句。指令:`$CTL phone send '改 [[call update_settings {"theme":"dark","accent":"black","timezone":"America/New_York"}]]' && $CTL phone wait-text '時區 → America/New_York' --in '#msgs' && $CTL phone send 幾點 && $CTL phone wait-text 'FAKE-MODEL 回答:幾點' --in '#msgs' && $CTL model 'select(.kind == "turn") | .user' && TZ=America/New_York date +%H:%M`。看到:不用卡片,「已更新:主題 → dark、聊天的顏色 → black、時區 → America/New_York」;Bot 收到的〔送出時間〕是紐約時間。
- **錯的時區**(covers `settings-by-bot`):指令:`$CTL phone send '錯 [[call update_settings {"timezone":"Mars/Base"}]]' && $CTL phone wait-text '不是有效的時區名稱' --in '#msgs' && $CTL state .timezone`。看到:「「Mars/Base」不是有效的時區名稱(例如 Asia/Taipei)」;還是 America/New_York。
- **手機的設定**(covers `settings-general`、`settings-account`、`settings-models`、`settings-integrations`、`settings-computers`、`settings-perms`、`settings-vault`、`settings-updates`):重新整理,帳戶選單 › 設定 › 一般。指令:`$CTL phone open --listed && $CTL phone click '#b-me' && $CTL phone click '#sheet-in .opt' --text 設定 && $CTL phone wait '[data-go="updates"]' && $CTL phone shot settings-tabs && $CTL phone click '[data-go="general"]' && $CTL phone wait-text America/New_York --in '#list' && $CTL phone wait-text 只用黑色 --in '#list' && $CTL phone shot settings-general`。看到:八列(沒有語音);一般裡主題「深色」、聊天的顏色「只用黑色」、時區、通知、這支手機的外觀。

View File

@ -96,7 +96,7 @@
通用、外觀、通知、語音、帳號、手機連接、應用行為、Computer Use、更新)和「伺服器設定」(模型、助手、記憶、
保險庫、例行任務、成員、稽核、儲存…)。手機連線用「誰幫你傳資料」來說明:通過 OpenBot(推薦)或專用網路(偵測到 Tailscale)。
**B1. 「現在在哪一台」的切換器**
**B1. 「現在在哪一台」的切換器**——11/21 做了第一步:左下角名字下面寫 Bot 在哪一台,點開「Bot 在哪一台」選單切換(這台電腦、帳號裡每台大腦、設定…)。每列的「重新連線」「換網址」「移除」還沒放進來。
- 做什麼:側邊欄最下面的帳號頭像改成伺服器選單:「這台電腦」、帳號裡每個大腦(狀態點:在線/連線中/離線/版本不合),
目前那台打勾;每列:「設定」「重新連線」「換網址」「改用它」「移除」。取代藏在 設定 › 一般 › 帳戶 › 手機與帳號 ›
大腦 的「改用它當大腦」和「改回用這台自己的 Bot」。

View File

@ -715,6 +715,23 @@ impl App {
// Optional view for checking the dialogs in a picture.
match std::env::var("ANYBOT_SHOT_VIEW").as_deref() {
Ok("chat") => app.state.selected = 1,
// 在哪一台 (bottom left): signed in, a screen of 雲端大腦, another brain off. (An
// account server that refuses at once; the screen's copy in a temp folder.)
Ok("whose") => {
app.state.selected = 1;
let r = &mut app.state.remote;
r.relay_url = "https://127.0.0.1:9/demo".into();
r.relay_user = "daniel".into();
r.host_token = "demo".into();
r.host_id = "this-mac".into();
r.host_name = "王性驊的Mac mini".into();
r.brain_id = "brain-1".into();
r.brain_name = "雲端大腦".into();
app.mir.dir = std::env::temp_dir().join("anybot-shot-whose");
app.mir.on = true;
app.mir.online = true;
*app.rm.peers.lock().unwrap() = vec![("brain-1".into(), "雲端大腦".into(), true), ("brain-2".into(), "jenny-Host".into(), false), ("this-mac".into(), "王性驊的Mac mini".into(), true)];
}
// A chat with nothing in it yet.
Ok("empty") => {
app.state.selected = 3;
@ -8225,6 +8242,28 @@ fn dialog_body<R>(ui: &mut egui::Ui, id: impl std::hash::Hash + std::fmt::Debug,
#[cfg(test)]
mod tests {
/// The bottom left says whose bots these are: this computer's, or the brain's this one shows
/// (its dot green while the brain is in reach).
#[test]
fn the_bottom_left_says_whose_bots_these_are() {
use super::*;
let ctx = egui::Context::default();
let mut app = App::new(&ctx, Some(std::env::temp_dir().join("anybot-whose-test.png")));
let p = app.pal;
assert_eq!(app.whose_bots(), (t("這台電腦"), p.up));
app.state.remote.brain_name = "雲端大腦".into();
app.mir.on = true;
app.mir.online = true;
assert_eq!(app.whose_bots(), ("大腦「雲端大腦」".to_string(), p.up));
app.mir.online = false;
assert_eq!(app.whose_bots().1, p.text3, "out of reach: grey");
app.state.remote.brain_name.clear();
assert_eq!(app.whose_bots().0, "大腦「大腦」");
assert_eq!(app.brain_for_words().as_deref(), Some("大腦"));
app.mir.on = false;
assert_eq!(app.brain_for_words(), None);
}
/// On a window the processor draws, the animations go at 4 frames a second; with a graphics
/// card they keep their own pace (a slower one stays as it is).
#[test]

View File

@ -227,12 +227,16 @@ impl App {
ui.painter().circle_filled(c, 16.0, p.active);
ui.painter().circle_stroke(c, 15.5, Stroke::new(1.0, p.border));
ui.painter().text(c, egui::Align2::CENTER_CENTER, initials, egui::FontId::proportional(FONT_XS), p.text2);
// Under the name, whose bots these are: this computer's, or the brain's it shows
// (with the brain's line: green when in reach). A press opens 在哪一台.
let (here, dot) = self.whose_bots();
let label = shorten_width(ui, &name, w - 52.0, 14.0);
ui.painter().text(rect.left_center() + vec2(44.0, 0.0), egui::Align2::LEFT_CENTER, label, egui::FontId::proportional(FONT_BASE), p.text);
if r.on_hover_text(t("設定(⌘,)")).on_hover_cursor(egui::CursorIcon::PointingHand).clicked() {
self.show_settings = true;
self.settings_tab = SettingsTab::General;
}
ui.painter().text(rect.left_center() + vec2(44.0, -8.0), egui::Align2::LEFT_CENTER, label, egui::FontId::proportional(FONT_BASE), p.text);
ui.painter().circle_filled(rect.left_center() + vec2(47.0, 9.0), 3.0, dot);
let sub = shorten_width(ui, &here, w - 64.0, FONT_XS);
ui.painter().text(rect.left_center() + vec2(54.0, 9.0), egui::Align2::LEFT_CENTER, sub, egui::FontId::proportional(FONT_XS), p.text3);
let r = r.on_hover_text(t("Bot 在哪一台:這台電腦或帳號裡的大腦(點一下切換);設定(⌘,)")).on_hover_cursor(egui::CursorIcon::PointingHand);
egui::Popup::menu(&r).show(|ui| self.whose_menu(ui));
if pill_icon(ui, crate::icons::Icon::Upload, p).on_hover_text(t("傳送檔案或文字到其他裝置")).clicked() {
self.open_drops();
}
@ -935,6 +939,69 @@ impl App {
self.mark();
}
/// Whose bots the window shows, in a few words, and the colour of its dot: this computer's,
/// or the brain's this one is a screen of (green when in reach, grey when not).
pub(super) fn whose_bots(&self) -> (String, Color32) {
let p = self.pal;
if self.mir.on {
let name = self.state.remote.brain_name.trim();
let name = if name.is_empty() { t("大腦") } else { name.to_string() };
(format!("{}「{name}」", t("大腦")), if self.mir.online { p.up } else { p.text3 })
} else {
(t("這台電腦"), p.up)
}
}
/// 在哪一台 (the bottom-left menu): this computer and every brain of the account, the one in
/// use ticked, each with whether it is in reach; a press moves the window there — the same as
/// 改用它當大腦 / 改回用這台自己的 Bot in 設定 › 手機與帳號. Then 設定.
pub(super) fn whose_menu(&mut self, ui: &mut egui::Ui) {
let p = self.pal;
ui.set_min_width(menu_ui::MENU_W.max(250.0));
ui.spacing_mut().item_spacing.y = 0.0;
menu_ui::caption(ui, p, "Bot 在哪一台");
let host = self.state.remote.host_name.trim().to_string();
let here = if host.is_empty() { t("這台電腦") } else { format!("{}({host})", t("這台電腦")) };
let r = menu_ui::item_text(ui, p, Some(if self.mir.on { crate::icons::Icon::Monitor } else { crate::icons::Icon::Check }), &here).on_hover_text(t("用這台電腦自己的 Bot、聊天和設定"));
if r.clicked() {
if self.mir.on {
self.mir.leave = true;
}
ui.close();
}
let signed_in = !self.state.remote.host_token.is_empty();
let me = self.state.remote.host_id.clone();
let current = self.state.remote.brain_id.clone();
let brains: Vec<(String, String, bool)> = self.rm.peers.lock().unwrap().iter().filter(|(id, _, _)| !id.is_empty() && *id != me && !crate::remote::is_hands(id)).cloned().collect();
for (id, name, online) in brains {
let on = self.mir.on && id == current;
let reach = if on { self.mir.online } else { online };
let label = if reach { name.clone() } else { format!("{name}({})", t("離線")) };
let r = ui.add_enabled_ui(on || online, |ui| menu_ui::item_text(ui, p, Some(if on { crate::icons::Icon::Check } else { crate::icons::Icon::Brain }), &label)).inner;
let r = r.on_hover_text(t(if on { "現在看的是這台大腦的 Bot" } else { "改用它當大腦:看它的 Bot、聊天和設定(這台當它的螢幕和手腳)" }));
if r.clicked() {
if !on {
self.mir.want = Some((id.clone(), name.clone()));
// The brain's bots may use this computer (each action still asks).
self.state.remote.device_link = true;
self.mark();
}
ui.close();
}
}
if !signed_in && menu_ui::item(ui, p, crate::icons::Icon::Person, "登入帳號,才能換到別台大腦…").clicked() {
self.show_settings = true;
self.settings_tab = SettingsTab::General;
ui.close();
}
menu_ui::sep(ui, p);
if menu_ui::item(ui, p, crate::icons::Icon::Gear, "設定…").on_hover_text(t("⌘,")).clicked() {
self.show_settings = true;
self.settings_tab = SettingsTab::General;
ui.close();
}
}
/// The name shown at the bottom left: the account, else the Mac's user.
pub(super) fn person_name(&self) -> String {
if !self.state.remote.relay_user.is_empty() {