手機補上「搜尋設定」、外觀的強調色/對比/語言、從設定打開 Bot 的電腦時先選看哪個 Bot 的螢幕;照功能地圖把手機頁面 13 步重跑一遍(全過)。
- 搜尋設定:settings_find::find_for_phone 用電腦同一份目錄,每一筆帶手機的那一頁(phone_act settings_find;直接連線算不放寬)。手機設定首頁最上面「搜尋設定…」,打字列出符合的,點了到那頁。 - 外觀:setting 多 shell_accent(選了回到自訂、清掉風格)、shell_contrast(0.75–1.35)、language(auto 或 i18n::LANGS 裡的);settings 帶 accents、languages。手機一般「電腦的外觀」:強調色、對比(柔和/標準/鮮明)、語言。 - Bot 的電腦:從 設定 › 電腦 按「開啟電腦/接管」先問看哪個 Bot 的螢幕或共用的桌面(openBox 多一個參數);聊天裡的照舊是那個 Bot 的。 - 文件:phone.md、pageview.md 拿掉「宋體」;settings.md(搜尋設定、外觀三列)、box.md;FEATURES.md。 已驗證: cargo test 883 個全過(remote::tests::the_phone_page_binds_where_told_and_keeps_trying 整套跑時偶爾失敗、單獨跑過,跟以前一樣是不穩的那個);scratch 手機:phone.md 13 步全部重跑通過(登入前停在登入、選單和釘選、聊天、全部允許之後直接操作被擋、舊頁面的回答不算、顏色跟著電腦、設定頁、裝成 App、斷線又回來只送一次、沒網路也打得開、只傳有變的、頁面存在手機上、回到看過的聊天);搜尋「通知」列出 3 筆;強調色選靛藍 → state shell_accent indigo、風格清掉;日程、檔案頁在改名後正常。 未驗證: 選螢幕的那張選單(scratch 只有一個 Bot,直接打開)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
This commit is contained in:
parent
1fcc251b0a
commit
261ea51ca2
|
|
@ -2324,7 +2324,7 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
|
||||||
- 手機與帳號:直接連線的手機清單,可以登出別支手機;
|
- 手機與帳號:直接連線的手機清單,可以登出別支手機;
|
||||||
- 更新:版本和有沒有新版。
|
- 更新:版本和有沒有新版。
|
||||||
- 個人資料與用量:見「個人資料與用量」。
|
- 個人資料與用量:見「個人資料與用量」。
|
||||||
- 手機補上的(以前只有電腦有):搜尋聊天裡的訊息和檔名;Bot 設定的「執行步驟用的模型」「思考模式」;釘選的 Bot 在 ⋯ ›「更多…」往前、往後移,分區的 ⋯「往上移/往下移」;「匯出 Bot 檔案(.anybot)」「匯出文字記錄(.md)」「匯入 Bot 檔案」(iPhone 跳分享選單,可以存到「檔案」或 AirDrop);每個 Bot 各自的草稿(切換 Bot、關掉頁面都留著,存在這支手機);程式碼塊右上的「複製」;頁面 ⋯ 的「存成檔案(.md)」。之後又補:設定 › 一般「電腦的外觀」(電腦的主題、聊天的顏色)和「其他時區…」自己打;Bot 設定技能「全選/全不選」、模型可讀長度 400K;稽核的「只看沒人看著時做的」;首頁上面一排「日程」「工作流」「檔案」(見各節)。聊天裡的流程圖(```mermaid)由大腦畫成圖(`api/diagram`,跟頁面的圖同一個畫法),畫不出來時顯示原始碼;圖表的 SVG 只放在 <img> 裡顯示(以前被當成下載檔,頁面和聊天的圖都破圖)。再補:權限頁「一律放行」開關(跟 /always-approve 同一件事)和「智慧模式:卡片沒人回答時」幾秒後自己回答;聊天上方「一律放行開著」一條,擁有者可以「關閉」;一般「記憶與文件」(用意思找記憶、Bot 可以翻的資料夾);更新頁「你不在時自動更新」「園丁報告」;模型的服務網址、測試連線並取得模型清單、本機模型的看圖小幫手;設定 ›「語音」整頁;Bot 設定的備用模型、起始資料夾、自訂頭像顏色(手機自己的選色器)、語音(朗讀每個回答、聲音、速度、語言)。同一個網路直接連的手機照樣只能收緊:打開一律放行、縮短智慧模式等待、加資料夾、換起始資料夾、打開看圖小幫手都被擋,說明「請在電腦上改,或用帳號連線」。
|
- 手機補上的(以前只有電腦有):搜尋聊天裡的訊息和檔名;Bot 設定的「執行步驟用的模型」「思考模式」;釘選的 Bot 在 ⋯ ›「更多…」往前、往後移,分區的 ⋯「往上移/往下移」;「匯出 Bot 檔案(.anybot)」「匯出文字記錄(.md)」「匯入 Bot 檔案」(iPhone 跳分享選單,可以存到「檔案」或 AirDrop);每個 Bot 各自的草稿(切換 Bot、關掉頁面都留著,存在這支手機);程式碼塊右上的「複製」;頁面 ⋯ 的「存成檔案(.md)」。之後又補:設定 › 一般「電腦的外觀」(電腦的主題、聊天的顏色)和「其他時區…」自己打;Bot 設定技能「全選/全不選」、模型可讀長度 400K;稽核的「只看沒人看著時做的」;首頁上面一排「日程」「工作流」「檔案」(見各節)。設定首頁最上面「搜尋設定…」(跟電腦同一份目錄,`api/act/settings_find`,點一筆到手機的那一頁);一般「電腦的外觀」多強調色(選了回到自訂)、對比(柔和/標準/鮮明)、語言;從 設定 › 電腦 打開 Bot 的電腦時先選看哪個 Bot 的螢幕或共用的桌面。聊天裡的流程圖(```mermaid)由大腦畫成圖(`api/diagram`,跟頁面的圖同一個畫法),畫不出來時顯示原始碼;圖表的 SVG 只放在 <img> 裡顯示(以前被當成下載檔,頁面和聊天的圖都破圖)。再補:權限頁「一律放行」開關(跟 /always-approve 同一件事)和「智慧模式:卡片沒人回答時」幾秒後自己回答;聊天上方「一律放行開著」一條,擁有者可以「關閉」;一般「記憶與文件」(用意思找記憶、Bot 可以翻的資料夾);更新頁「你不在時自動更新」「園丁報告」;模型的服務網址、測試連線並取得模型清單、本機模型的看圖小幫手;設定 ›「語音」整頁;Bot 設定的備用模型、起始資料夾、自訂頭像顏色(手機自己的選色器)、語音(朗讀每個回答、聲音、速度、語言)。同一個網路直接連的手機照樣只能收緊:打開一律放行、縮短智慧模式等待、加資料夾、換起始資料夾、打開看圖小幫手都被擋,說明「請在電腦上改,或用帳號連線」。
|
||||||
- 看電腦畫面:
|
- 看電腦畫面:
|
||||||
- 「Bot 的電腦」每秒更新一次畫面;在休眠時按「叫醒」。
|
- 「Bot 的電腦」每秒更新一次畫面;在休眠時按「叫醒」。
|
||||||
- 「這台 Mac」要先在設定裡打開才會出現。
|
- 「這台 Mac」要先在設定裡打開才會出現。
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
- `box-desktop` 畫面(「開啟電腦」):下方工作列由左到右是「應用程式」選單、「瀏覽器」、「檔案管理員」、「終端機」、開著的視窗、時鐘;桌面按右鍵也有應用程式選單(瀏覽器、檔案管理員、終端機、文字編輯器、影像檢視器,Bot 裝的程式在「其他」)。瀏覽器開機就開好(第一次是說明頁),跟 Bot 的瀏覽器工具是同一個、登入共用。檔案管理員側邊欄的「下載」是 Bot 下載的檔案;檔案按兩下用對的程式開。
|
- `box-desktop` 畫面(「開啟電腦」):下方工作列由左到右是「應用程式」選單、「瀏覽器」、「檔案管理員」、「終端機」、開著的視窗、時鐘;桌面按右鍵也有應用程式選單(瀏覽器、檔案管理員、終端機、文字編輯器、影像檢視器,Bot 裝的程式在「其他」)。瀏覽器開機就開好(第一次是說明頁),跟 Bot 的瀏覽器工具是同一個、登入共用。檔案管理員側邊欄的「下載」是 Bot 下載的檔案;檔案按兩下用對的程式開。
|
||||||
- `box-manage` 管理:狀態、更新、自動更新、快照、重設、磁碟;終端機與環境密鑰;在哪裡執行(Docker 主機、容器隔離)。
|
- `box-manage` 管理:狀態、更新、自動更新、快照、重設、磁碟;終端機與環境密鑰;在哪裡執行(Docker 主機、容器隔離)。
|
||||||
- `box-account-view` 從帳號看畫面:手機或另一台電腦經帳號伺服器看 Bot 電腦的畫面,只要開著就不會斷。
|
- `box-account-view` 從帳號看畫面:手機或另一台電腦經帳號伺服器看 Bot 電腦的畫面,只要開著就不會斷。
|
||||||
- `box-phone-drive` 手機接手(畫面右上「接管」):Bot 在那個螢幕的步驟等你(「交還給 Bot」、關掉畫面、手機鎖住或切走都放開)。預設是虛擬觸控板:一指移游標、點一下按、點兩下按住拖曳、兩指捲動、兩指點或長按右鍵(下方「觸控板」關掉改成點哪裡按哪裡)。下方按鍵列:Ctrl、Alt、Shift、❖ 點一下按住給下一個鍵或點擊,點兩下鎖住;Esc、Tab、方向鍵、⌫、Del、⏎、Home、End、PgUp、PgDn;「快捷鍵」一格格寫名字(切換視窗 Alt+Tab、下一個分頁 Ctrl+Tab、拷貝、貼上…);「⌨ 打字」可打中文,按住修飾鍵打一個字就是那組快捷鍵。手機看「這台 Mac」(要開「從手機看這台電腦的螢幕並操作」)是同一套,修飾鍵是 ⌘⌥⌃⇧。
|
- `box-phone-drive` 手機接手(畫面右上「接管」;從 設定 › 電腦 打開時先選看哪個 Bot 的螢幕或共用的桌面):Bot 在那個螢幕的步驟等你(「交還給 Bot」、關掉畫面、手機鎖住或切走都放開)。預設是虛擬觸控板:一指移游標、點一下按、點兩下按住拖曳、兩指捲動、兩指點或長按右鍵(下方「觸控板」關掉改成點哪裡按哪裡)。下方按鍵列:Ctrl、Alt、Shift、❖ 點一下按住給下一個鍵或點擊,點兩下鎖住;Esc、Tab、方向鍵、⌫、Del、⏎、Home、End、PgUp、PgDn;「快捷鍵」一格格寫名字(切換視窗 Alt+Tab、下一個分頁 Ctrl+Tab、拷貝、貼上…);「⌨ 打字」可打中文,按住修飾鍵打一個字就是那組快捷鍵。手機看「這台 Mac」(要開「從手機看這台電腦的螢幕並操作」)是同一套,修飾鍵是 ⌘⌥⌃⇧。
|
||||||
|
|
||||||
## 使用者怎麼到
|
## 使用者怎麼到
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
- `pageview-steps` ```steps 進度:[x] 完成、[>] 進行中、[ ] 還沒到。
|
- `pageview-steps` ```steps 進度:[x] 完成、[>] 進行中、[ ] 還沒到。
|
||||||
- `pageview-chart` ```chart 圖表(bar/line/pie,可以多系列):長條圖自動由大到小排序,月份/年份等自有順序的標籤不排;單系列把數字直接標在圖上不畫 y 軸;多條線在線尾標系列名;長條的 y 軸一定從 0 開始,折線離 0 很遠(最小值比資料的高低差還大,例如 1,649–1,796)時照資料範圍畫、不從 0 開始;圖下附數據表(名稱靠左、數字靠右、每欄只有內容那麼寬,太寬就左右捲動,不會把頁面撐寬;超過 6 列時收成「▸ 數據 · N 筆」,點了展開);第一行可以是「圖型 標題」、只寫圖型(bar/line/pie 或 長條/折線/圓餅)或只寫標題,`#` 開頭是註解,`|---|` 分隔列略過,少填的格子當 0;手機也畫原生圖,讀法和樣式相同:照手機寬度畫、字不縮小,折線和多系列長條有 y 軸數字,只有一項的圓餅是整圓,圖例再多項都畫得到。
|
- `pageview-chart` ```chart 圖表(bar/line/pie,可以多系列):長條圖自動由大到小排序,月份/年份等自有順序的標籤不排;單系列把數字直接標在圖上不畫 y 軸;多條線在線尾標系列名;長條的 y 軸一定從 0 開始,折線離 0 很遠(最小值比資料的高低差還大,例如 1,649–1,796)時照資料範圍畫、不從 0 開始;圖下附數據表(名稱靠左、數字靠右、每欄只有內容那麼寬,太寬就左右捲動,不會把頁面撐寬;超過 6 列時收成「▸ 數據 · N 筆」,點了展開);第一行可以是「圖型 標題」、只寫圖型(bar/line/pie 或 長條/折線/圓餅)或只寫標題,`#` 開頭是註解,`|---|` 分隔列略過,少填的格子當 0;手機也畫原生圖,讀法和樣式相同:照手機寬度畫、字不縮小,折線和多系列長條有 y 軸數字,只有一項的圓餅是整圓,圖例再多項都畫得到。
|
||||||
- `pageview-callout` 提示框:`> [!NOTE]`/`[!TIP]`/`[!WARNING]`/`[!IMPORTANT]`。
|
- `pageview-callout` 提示框:`> [!NOTE]`/`[!TIP]`/`[!WARNING]`/`[!IMPORTANT]`。
|
||||||
- `pageview-desktop` 打開的頁面像一份文件(電腦和手機同一套):標題半粗體 28,下面一行小字作者、「更新於」、第幾版和「這一版更新了:…」;一行現況(summary)是開頭段落、不加框;結論(verdict)是淡底的「結論」提示框;kpis 是只有細框的數字卡(每張三行疊著:標籤、數字、變化;四張並排每張太窄時一排兩張;字太長以 … 結尾,滑過看全文)。頁面視窗不會被內容撐寬:太寬的表格在閱讀欄裡左右捲動,其他太寬的東西在視窗邊緣切掉,標題列的 × 一直在右上角。有 3 個以上的標題時有一行「▸ 目錄 · N 節」,點開才是標題清單和小搜尋框(⌘F 直接展開)。內文宋體 16、行距 1.7,閱讀欄最寬 680。
|
- `pageview-desktop` 打開的頁面像一份文件(電腦和手機同一套):標題半粗體 28,下面一行小字作者、「更新於」、第幾版和「這一版更新了:…」;一行現況(summary)是開頭段落、不加框;結論(verdict)是淡底的「結論」提示框;kpis 是只有細框的數字卡(每張三行疊著:標籤、數字、變化;四張並排每張太窄時一排兩張;字太長以 … 結尾,滑過看全文)。頁面視窗不會被內容撐寬:太寬的表格在閱讀欄裡左右捲動,其他太寬的東西在視窗邊緣切掉,標題列的 × 一直在右上角。有 3 個以上的標題時有一行「▸ 目錄 · N 節」,點開才是標題清單和小搜尋框(⌘F 直接展開)。內文16(跟介面同一種字)、行距 1.7,閱讀欄最寬 680。
|
||||||
- `pageview-phone` 手機打開的頁面:標題半粗體大字,下面一行小字作者和「更新於」;現況、kpis、結論同上;有 3 個以上的標題時多一行「目錄 · N 節」,點開是標題清單,點一個捲到那裡(沒有搜尋框)。內文 16px(跟介面同一種黑體)、行距寬;表格沒有直線和斑馬紋、數字欄靠右;提示框同一種淡底,只有圖示依種類上色。
|
- `pageview-phone` 手機打開的頁面:標題半粗體大字,下面一行小字作者和「更新於」;現況、kpis、結論同上;有 3 個以上的標題時多一行「目錄 · N 節」,點開是標題清單,點一個捲到那裡(沒有搜尋框)。內文 16px(跟介面同一種黑體)、行距寬;表格沒有直線和斑馬紋、數字欄靠右;提示框同一種淡底,只有圖示依種類上色。
|
||||||
|
|
||||||
## 使用者怎麼到
|
## 使用者怎麼到
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,11 @@
|
||||||
|
|
||||||
- **還沒連上就在外面**(covers `phone-net`):打開頁面,等它自己連上。指令:`$CTL phone open --listed && $CTL phone wait-gone '#v-gate.on' 20 && $CTL phone wait '#v-login.on'`。看到:連上之後停在登入,不是 Bot 清單;登入後才進得去。
|
- **還沒連上就在外面**(covers `phone-net`):打開頁面,等它自己連上。指令:`$CTL phone open --listed && $CTL phone wait-gone '#v-gate.on' 20 && $CTL phone wait '#v-login.on'`。看到:連上之後停在登入,不是 Bot 清單;登入後才進得去。
|
||||||
- **清單和選單**(covers `phone-pages`、`phone-claude`):看首頁,打開 Bot 那列的「⋯」。指令:`$CTL phone wait '.row[data-bot="1"]' && $CTL phone click '[data-botmenu="1"]' && $CTL phone wait-text 對話詳細資訊 --in '#sheet-in' && $CTL phone shot phone-menu && $CTL phone click '#sheet-in .opt' --text 釘選 && $CTL wait-api '/api/state?since=0' '.bots[0].pinned == true'`。看到:一列一個 Bot(第二行一行說明);選單有「對話詳細資訊」「釘選」「移至分區」「更多…」;釘選後大腦那邊 pinned。
|
- **清單和選單**(covers `phone-pages`、`phone-claude`):看首頁,打開 Bot 那列的「⋯」。指令:`$CTL phone wait '.row[data-bot="1"]' && $CTL phone click '[data-botmenu="1"]' && $CTL phone wait-text 對話詳細資訊 --in '#sheet-in' && $CTL phone shot phone-menu && $CTL phone click '#sheet-in .opt' --text 釘選 && $CTL wait-api '/api/state?since=0' '.bots[0].pinned == true'`。看到:一列一個 Bot(第二行一行說明);選單有「對話詳細資訊」「釘選」「移至分區」「更多…」;釘選後大腦那邊 pinned。
|
||||||
- **聊天**(covers `phone-pages`、`phone-look`、`phone-claude`):打開 Bot、傳一句。指令:`$CTL phone click '.row[data-bot="1"]' && $CTL phone send '你好,從手機傳的' && $CTL phone wait-text 'FAKE-MODEL 回答:你好,從手機傳的' --in '#msgs' && $CTL phone shot phone-chat`。看到:標題列是名稱和 fake-model;你的話是泡泡,回答直接排在畫面上(宋體)、下面只有時間和圖示;輸入框是底部圓角卡片。
|
- **聊天**(covers `phone-pages`、`phone-look`、`phone-claude`):打開 Bot、傳一句。指令:`$CTL phone click '.row[data-bot="1"]' && $CTL phone send '你好,從手機傳的' && $CTL phone wait-text 'FAKE-MODEL 回答:你好,從手機傳的' --in '#msgs' && $CTL phone shot phone-chat`。看到:標題列是名稱和 fake-model;你的話是泡泡,回答直接排在畫面上、下面只有時間和圖示;輸入框是底部圓角卡片。
|
||||||
- **全部允許,之後直接操作**(covers `phone-pages`、`phone-cards`):請 Bot 改名,在卡片上按「全部允許,之後直接操作」›「打開」,再按「允許」。指令:`$CTL phone send '請改名 [[call update_bot {"name":"手機改的名字"}]]' && $CTL phone click '#ask [data-direct]' && $CTL phone click '#sheet-in .opt' --text 打開 && $CTL phone wait-text '只能收緊、不能放寬' && $CTL phone wait '#ask .ask' && $CTL phone click '#ask button[data-a="once"]' && $CTL phone wait-text 手機改的名字 --in '#isl-name'`。看到:直接連線打不開直接操作([autonomy](autonomy.md)),卡片留著;按「允許」才改名。
|
- **全部允許,之後直接操作**(covers `phone-pages`、`phone-cards`):請 Bot 改名,在卡片上按「全部允許,之後直接操作」›「打開」,再按「允許」。指令:`$CTL phone send '請改名 [[call update_bot {"name":"手機改的名字"}]]' && $CTL phone click '#ask [data-direct]' && $CTL phone click '#sheet-in .opt' --text 打開 && $CTL phone wait-text '只能收緊、不能放寬' && $CTL phone wait '#ask .ask' && $CTL phone click '#ask button[data-a="once"]' && $CTL phone wait-text 手機改的名字 --in '#isl-name'`。看到:直接連線打不開直接操作([autonomy](autonomy.md)),卡片留著;按「允許」才改名。
|
||||||
- **舊頁面的回答不算**(covers `phone-cards`):卡片在等時,一個說不出是哪張卡的回答進來。指令:`$CTL phone send '再改 [[call update_bot {"name":"不該出現的名字"}]]' && $CTL wait-api '/api/state?since=0' '.approvals | length == 1' && $CTL api POST /api/bots/1/answer '{"answer":"once"}' && $CTL phone wait-text '手機上的回答沒有用上' --in '#msgs' && $CTL phone click '#ask button[data-a="reject"]' && $CTL phone wait-gone '#ask .ask' && $CTL state '.bots[0].name'`。看到:「手機上的回答沒有用上:這個頁面太舊…」,卡片還在;拒絕後名字還是「手機改的名字」。
|
- **舊頁面的回答不算**(covers `phone-cards`):卡片在等時,一個說不出是哪張卡的回答進來。指令:`$CTL phone send '再改 [[call update_bot {"name":"不該出現的名字"}]]' && $CTL wait-api '/api/state?since=0' '.approvals | length == 1' && $CTL api POST /api/bots/1/answer '{"answer":"once"}' && $CTL phone wait-text '手機上的回答沒有用上' --in '#msgs' && $CTL phone click '#ask button[data-a="reject"]' && $CTL phone wait-gone '#ask .ask' && $CTL state '.bots[0].name'`。看到:「手機上的回答沒有用上:這個頁面太舊…」,卡片還在;拒絕後名字還是「手機改的名字」。
|
||||||
- **顏色跟著電腦**(covers `phone-colors`):請 Bot 把電腦換成深色,重新整理;再把這支手機選「淺色」。指令:`$CTL phone send '換深色 [[call update_settings {"theme":"dark"}]]' && $CTL phone wait-text '主題 → dark' --in '#msgs' && $CTL phone open --listed && $CTL phone wait 'html[data-theme="dark"]' && $CTL phone shot phone-dark && $CTL phone click '#b-me' && $CTL phone click '#sheet-in .opt' --text 這支手機的外觀 && $CTL phone click '#sheet-in .opt' --text 淺色 && $CTL phone wait 'html[data-theme="light"]'`。看到:外觀「跟著電腦」時變深色;選「淺色」就只有這支手機變回淺色。
|
- **顏色跟著電腦**(covers `phone-colors`):請 Bot 把電腦換成深色,重新整理;再把這支手機選「淺色」。指令:`$CTL phone send '換深色 [[call update_settings {"theme":"dark"}]]' && $CTL phone wait-text '主題 → dark' --in '#msgs' && $CTL phone open --listed && $CTL phone wait 'html[data-theme="dark"]' && $CTL phone shot phone-dark && $CTL phone click '#b-me' && $CTL phone click '#sheet-in .opt' --text 這支手機的外觀 && $CTL phone click '#sheet-in .opt' --text 淺色 && $CTL phone wait 'html[data-theme="light"]'`。看到:外觀「跟著電腦」時變深色;選「淺色」就只有這支手機變回淺色。
|
||||||
- **設定頁**(covers `phone-pages`):帳戶選單 › 設定,再點「保險庫」。指令:`$CTL phone click '#b-me' && $CTL phone click '#sheet-in .opt' --text 設定 && $CTL phone wait '[data-go="updates"]' && $CTL phone shot phone-settings && $CTL phone click '[data-go="vault"]' && $CTL phone wait-text '只在電腦上的 AnyBot 管理'`。看到:一般、模型、權限、整合、電腦、保險庫、手機與帳號、更新;保險庫只有一句說明(手機看不到密碼)。
|
- **設定頁**(covers `phone-pages`):帳戶選單 › 設定,再點「保險庫」。指令:`$CTL phone click '#b-me' && $CTL phone click '#sheet-in .opt' --text 設定 && $CTL phone wait '[data-go="updates"]' && $CTL phone shot phone-settings && $CTL phone click '[data-go="vault"]' && $CTL phone wait-text '只在電腦上的 AnyBot 管理'`。看到:一般、個人資料與用量、模型、權限、整合、電腦、保險庫、語音、手機與帳號、更新;保險庫只有一句說明(手機看不到密碼)。
|
||||||
- **裝成 App 的提示**(covers `phone-app`):回首頁,看「把 AnyBot 裝成 App」,按 ✕ 關掉。指令:`$CTL phone open --listed && $CTL phone wait-text '把 AnyBot 裝成 App' && $CTL phone shot phone-install && $CTL phone click '#install-no' && $CTL phone wait-gone '#install-go' && $CTL api --no-auth GET /manifest.webmanifest --jq '.display'`。看到:提示和「安裝」(Chrome 給了安裝提示;iPhone 是「怎麼做」);按 ✕ 就不見了;manifest 的 display 是 standalone。
|
- **裝成 App 的提示**(covers `phone-app`):回首頁,看「把 AnyBot 裝成 App」,按 ✕ 關掉。指令:`$CTL phone open --listed && $CTL phone wait-text '把 AnyBot 裝成 App' && $CTL phone shot phone-install && $CTL phone click '#install-no' && $CTL phone wait-gone '#install-go' && $CTL api --no-auth GET /manifest.webmanifest --jq '.display'`。看到:提示和「安裝」(Chrome 給了安裝提示;iPhone 是「怎麼做」);按 ✕ 就不見了;manifest 的 display 是 standalone。
|
||||||
- **斷線又回來**(covers `phone-net`):打開 Bot,把大腦關掉,看提示;斷線時傳一句,再把大腦開回來。指令:`$CTL phone click '.row[data-bot="1"]' && $CTL stop && $CTL phone wait '#net.on' 30 && $CTL phone send '斷線時傳的' && $CTL phone wait-text '等連線後送出' --in '#msgs' 30 && $CTL phone shot phone-offline && $CTL serve && $CTL phone wait-gone '#net.on' 40 && $CTL phone wait-text 'FAKE-MODEL 回答:斷線時傳的' --in '#msgs' 60 && $CTL phone shot phone-back && $CTL model 'select(.tools > 0 and ((.user // "") | startswith("斷線時傳的"))) | .t' | grep -c '^"20'`。看到:標題列下方「連線中斷,正在重新連線…」,沒有另外跳「連不上」的提示,標題沒被蓋住;那句馬上出現在聊天裡,下面寫「等連線後送出(點一下拿回來)」;大腦回來後提示自己消失(沒有重新整理),斷線時傳的那句自己送到、有回答;最後印 `1`:重送了幾次,Bot 都只收到一次。
|
- **斷線又回來**(covers `phone-net`):打開 Bot,把大腦關掉,看提示;斷線時傳一句,再把大腦開回來。指令:`$CTL phone click '.row[data-bot="1"]' && $CTL stop && $CTL phone wait '#net.on' 30 && $CTL phone send '斷線時傳的' && $CTL phone wait-text '等連線後送出' --in '#msgs' 30 && $CTL phone shot phone-offline && $CTL serve && $CTL phone wait-gone '#net.on' 40 && $CTL phone wait-text 'FAKE-MODEL 回答:斷線時傳的' --in '#msgs' 60 && $CTL phone shot phone-back && $CTL model 'select(.tools > 0 and ((.user // "") | startswith("斷線時傳的"))) | .t' | grep -c '^"20'`。看到:標題列下方「連線中斷,正在重新連線…」,沒有另外跳「連不上」的提示,標題沒被蓋住;那句馬上出現在聊天裡,下面寫「等連線後送出(點一下拿回來)」;大腦回來後提示自己消失(沒有重新整理),斷線時傳的那句自己送到、有回答;最後印 `1`:重送了幾次,Bot 都只收到一次。
|
||||||
- **沒網路也打得開**(covers `phone-net`):看過聊天、回首頁後把大腦關掉,重新打開頁面;打開聊天傳一句,再重新打開一次,最後把大腦開回來。指令:`$CTL phone click '[data-back]' && $CTL stop && $CTL phone open --listed && $CTL phone wait '.row[data-bot="1"]' 3 && $CTL phone wait-text '離線中' --in '#net' 15 && $CTL phone click '.row[data-bot="1"]' && $CTL phone wait-text 'FAKE-MODEL 回答:斷線時傳的' --in '#msgs' 2 && $CTL phone send '要拿回來的' && $CTL phone click '.m.sending.held' && $CTL phone wait-gone '.m.sending' 5 && $CTL phone js 'document.querySelector("#input").value=""' && $CTL phone send '離線時傳的' && $CTL phone wait-text '等連線後送出' --in '#msgs' 30 && $CTL phone open --listed && $CTL phone click '.row[data-bot="1"]' && $CTL phone wait-text '離線時傳的' --in '#msgs' 3 && $CTL phone shot phone-kept && $CTL serve && $CTL phone wait-text 'FAKE-MODEL 回答:離線時傳的' --in '#msgs' 90`。看到:大腦關著也在 3 秒內看到 Bot 清單(不是連線畫面),提示「離線中:顯示的是上次的內容」;聊天是上次的內容;點「要拿回來的」它就回到輸入框;離線傳的那句關掉重開還在,大腦回來後自己送到、有回答。
|
- **沒網路也打得開**(covers `phone-net`):看過聊天、回首頁後把大腦關掉,重新打開頁面;打開聊天傳一句,再重新打開一次,最後把大腦開回來。指令:`$CTL phone click '[data-back]' && $CTL stop && $CTL phone open --listed && $CTL phone wait '.row[data-bot="1"]' 3 && $CTL phone wait-text '離線中' --in '#net' 15 && $CTL phone click '.row[data-bot="1"]' && $CTL phone wait-text 'FAKE-MODEL 回答:斷線時傳的' --in '#msgs' 2 && $CTL phone send '要拿回來的' && $CTL phone click '.m.sending.held' && $CTL phone wait-gone '.m.sending' 5 && $CTL phone js 'document.querySelector("#input").value=""' && $CTL phone send '離線時傳的' && $CTL phone wait-text '等連線後送出' --in '#msgs' 30 && $CTL phone open --listed && $CTL phone click '.row[data-bot="1"]' && $CTL phone wait-text '離線時傳的' --in '#msgs' 3 && $CTL phone shot phone-kept && $CTL serve && $CTL phone wait-text 'FAKE-MODEL 回答:離線時傳的' --in '#msgs' 90`。看到:大腦關著也在 3 秒內看到 Bot 清單(不是連線畫面),提示「離線中:顯示的是上次的內容」;聊天是上次的內容;點「要拿回來的」它就回到輸入框;離線傳的那句關掉重開還在,大腦回來後自己送到、有回答。
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
- **搜尋設定**(covers `settings-search`):前提:要開視窗。指令:`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot set-search ANYBOT_SHOT_TAB=general ANYBOT_SHOT_SIZE=1100x760 ANYBOT_SHOT_FRAMES=60 'ANYBOT_SHOT_CLICK=245,159@20' 'ANYBOT_SHOT_TYPE=自動@30'`;再跑兩次,加 `'ANYBOT_SHOT_KEYS=Enter@40'`、`ANYBOT_SHOT_FRAMES=66`:打 `時區@30`,和從更新頁(`ANYBOT_SHOT_TAB=updates`)打 `對比@30`。看到:「自動更新/電腦 › Bot 的電腦」「自動審核/權限」「自動更新/更新」;時區那次換到一般、捲到「Bot」下的「時區」,那列有強調色外框;對比那次「更多外觀設定」變「收起」、「對比」有外框。
|
- **搜尋設定**(covers `settings-search`):前提:要開視窗。指令:`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot set-search ANYBOT_SHOT_TAB=general ANYBOT_SHOT_SIZE=1100x760 ANYBOT_SHOT_FRAMES=60 'ANYBOT_SHOT_CLICK=245,159@20' 'ANYBOT_SHOT_TYPE=自動@30'`;再跑兩次,加 `'ANYBOT_SHOT_KEYS=Enter@40'`、`ANYBOT_SHOT_FRAMES=66`:打 `時區@30`,和從更新頁(`ANYBOT_SHOT_TAB=updates`)打 `對比@30`。看到:「自動更新/電腦 › Bot 的電腦」「自動審核/權限」「自動更新/更新」;時區那次換到一般、捲到「Bot」下的「時區」,那列有強調色外框;對比那次「更多外觀設定」變「收起」、「對比」有外框。
|
||||||
- **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 收到的〔送出時間〕是紐約時間。
|
- **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-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`。看到:十列(多了個人資料與用量、語音);一般裡「電腦的外觀」主題「深色」、聊天的顏色「只用黑色」,時區(最後一項「其他時區…」自己打)、通知、這支手機的外觀。
|
- **手機的設定**(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`。看到:最上面「搜尋設定…」(打「通知」列出一般 › 通知的那幾項,點了到那頁),十列(多了個人資料與用量、語音);一般裡「電腦的外觀」強調色、對比、語言、主題「深色」、聊天的顏色「只用黑色」,時區(最後一項「其他時區…」自己打)、通知、這支手機的外觀。
|
||||||
- **桌面每個分頁、Bot 設定**(covers `settings-voice`、`settings-bot`、`settings-account`、`settings-computers`):每個分頁和 Bot 設定。指令:要開視窗——`$CTL stop && (for t in general remote providers channels computers review vault voice updates; do ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-$t ANYBOT_SHOT_TAB=$t || exit 1; done) && ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-bot ANYBOT_SHOT_VIEW=editor`。看到:各分頁的區塊照上面順序;Bot 設定最下面「儲存」。問候照時區(紐約晚上「晚上好」)也只在桌面。
|
- **桌面每個分頁、Bot 設定**(covers `settings-voice`、`settings-bot`、`settings-account`、`settings-computers`):每個分頁和 Bot 設定。指令:要開視窗——`$CTL stop && (for t in general remote providers channels computers review vault voice updates; do ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-$t ANYBOT_SHOT_TAB=$t || exit 1; done) && ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-bot ANYBOT_SHOT_VIEW=editor`。看到:各分頁的區塊照上面順序;Bot 設定最下面「儲存」。問候照時區(紐約晚上「晚上好」)也只在桌面。
|
||||||
- 自動測試:`cargo test app::settings_find::`(設定頁畫的每個區塊和列都要在搜尋的清單裡)、`cargo test stats::`、`cargo test featuremap::`(每個分頁和區塊標題、Bot 能改的設定都要在這份)、`cargo test appctl::`、`cargo test policy::`、`cargo test the_greeting_follows_the_timezone_setting`、`cargo test layout_audit::`(每個分頁、Bot 設定、例行任務、右側面板,用三種字型、最窄和一般的視窗、示範和很長的資料畫:字被切、疊在一起,或對話框被撐得比標題列寬就失敗)。
|
- 自動測試:`cargo test app::settings_find::`(設定頁畫的每個區塊和列都要在搜尋的清單裡)、`cargo test stats::`、`cargo test featuremap::`(每個分頁和區塊標題、Bot 能改的設定都要在這份)、`cargo test appctl::`、`cargo test policy::`、`cargo test the_greeting_follows_the_timezone_setting`、`cargo test layout_audit::`(每個分頁、Bot 設定、例行任務、右側面板,用三種字型、最窄和一般的視窗、示範和很長的資料畫:字被切、疊在一起,或對話框被撐得比標題列寬就失敗)。
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3710,6 +3710,11 @@ function drawSettings(kind, quiet) {
|
||||||
const sc = el.scrollTop;
|
const sc = el.scrollTop;
|
||||||
let h = "";
|
let h = "";
|
||||||
if (kind === "settings") {
|
if (kind === "settings") {
|
||||||
|
// 搜尋設定 (the computer's index): what matches stands where the pages were.
|
||||||
|
h += `<div style="padding:var(--sp-3) var(--sp-4) 0"><input class="field" id="set-q" placeholder="搜尋設定…" value="${esc(S.setQ || "")}" enterkeyhint="search"></div>`;
|
||||||
|
if (S.setQ && S.setHits) h += group("", S.setHits.map((x) => sitem({icon: setIcon(x.title), k: x.title, v: x.path, tap: 1, data: `data-go="${x.page}"`})).join("") || `<div class="note" style="padding:12px 16px">沒有符合的設定</div>`);
|
||||||
|
}
|
||||||
|
if (kind === "settings" && !(S.setQ && S.setHits)) {
|
||||||
h += group("", [
|
h += group("", [
|
||||||
["general", "settings", "一般", "外觀、時區、通知總開關"], ...(isOwner() ? [["me", "activity", "個人資料與用量", ""]] : []), ["models", "sparkles", "模型", "可以用的 AI 服務"], ["perms", "shield", "權限", st.direct_mode ? "直接操作:開" : "Bot 做事前的規則"],
|
["general", "settings", "一般", "外觀、時區、通知總開關"], ...(isOwner() ? [["me", "activity", "個人資料與用量", ""]] : []), ["models", "sparkles", "模型", "可以用的 AI 服務"], ["perms", "shield", "權限", st.direct_mode ? "直接操作:開" : "Bot 做事前的規則"],
|
||||||
["integrations", "plug", "整合", "訊息管道、連接器、技能"], ["computers", "monitor", "電腦", "Bot 的電腦和你帳號裡的電腦"], ["vault", "lock", "保險庫", "密碼和卡號"], ["voice", "audio-lines", "語音", "聽和說的服務"],
|
["integrations", "plug", "整合", "訊息管道、連接器、技能"], ["computers", "monitor", "電腦", "Bot 的電腦和你帳號裡的電腦"], ["vault", "lock", "保險庫", "密碼和卡號"], ["voice", "audio-lines", "語音", "聽和說的服務"],
|
||||||
|
|
@ -3729,7 +3734,9 @@ function drawSettings(kind, quiet) {
|
||||||
return `<button class="tpl ${on ? "on" : ""}" data-s="style" data-style="${t.id}" title="${esc(t.about)}"><span class="pic" style="background-color:${c.pane};border-color:${c.line};${bd}"><i class="sd" style="background:${c.side}"><b style="background:${c.active}"></b><b style="background:${c.hover}"></b></i><i class="ln" style="background:${c.text3}"></i><i class="ln s" style="background:${c.text3}"></i><i class="bb" style="background:${c.bubble}"></i><i class="dt" style="background:${c.accent}"></i></span><span class="nm">${esc(t.name)}</span></button>`;
|
return `<button class="tpl ${on ? "on" : ""}" data-s="style" data-style="${t.id}" title="${esc(t.about)}"><span class="pic" style="background-color:${c.pane};border-color:${c.line};${bd}"><i class="sd" style="background:${c.side}"><b style="background:${c.active}"></b><b style="background:${c.hover}"></b></i><i class="ln" style="background:${c.text3}"></i><i class="ln s" style="background:${c.text3}"></i><i class="bb" style="background:${c.bubble}"></i><i class="dt" style="background:${c.accent}"></i></span><span class="nm">${esc(t.name)}</span></button>`;
|
||||||
}).join("")}</div>${st.style ? "" : `<div class="note" style="padding-top:4px">現在是自訂的顏色(電腦上的強調色);點一個風格整套換,電腦和手機一起。</div>`}`;
|
}).join("")}</div>${st.style ? "" : `<div class="note" style="padding-top:4px">現在是自訂的顏色(電腦上的強調色);點一個風格整套換,電腦和手機一起。</div>`}`;
|
||||||
}
|
}
|
||||||
if (isOwner()) h += group("電腦的外觀", sitem({icon: "moon", k: "主題", r: ({system: "跟隨系統", light: "淺色", dark: "深色"})[st.theme] || "跟隨系統", tap: 1, data: 'data-s="theme"'}) + sitem({icon: "message", k: "聊天的顏色", r: ACC[st.accent || "quiet"] || "", tap: 1, data: 'data-s="accent"'}));
|
const accName = ((st.accents || []).find((a) => a.key === st.shell_accent) || {}).name || "";
|
||||||
|
const look = isOwner() ? sitem({icon: "palette", k: "強調色", r: st.style ? "跟著風格" : accName, tap: 1, data: 'data-s="accentcolor"'}) + sitem({icon: "palette", k: "對比", r: (st.shell_contrast || 1) < 0.95 ? "柔和" : (st.shell_contrast || 1) > 1.1 ? "鮮明" : "標準", tap: 1, data: 'data-s="contrast"'}) + sitem({icon: "globe", k: "語言", r: st.language === "auto" || !st.language ? "自動偵測" : ((st.languages || []).find((l) => l[0] === st.language) || [0, st.language])[1], tap: 1, data: 'data-s="lang"'}) : "";
|
||||||
|
if (isOwner()) h += group("電腦的外觀", look + sitem({icon: "moon", k: "主題", r: ({system: "跟隨系統", light: "淺色", dark: "深色"})[st.theme] || "跟隨系統", tap: 1, data: 'data-s="theme"'}) + sitem({icon: "message", k: "聊天的顏色", r: ACC[st.accent || "quiet"] || "", tap: 1, data: 'data-s="accent"'}));
|
||||||
h += group("", sitem({icon: "globe", k: "時區", r: st.timezone || "", tap: 1, data: 'data-s="tz"'}) + sitem({icon: "bell", k: "通知總開關", v: "Bot 做完或等你時通知,電腦和手機都算;關掉就都不通知", sw: !!st.notify, swdata: 'data-sset="notify"', disabled: !isOwner()}));
|
h += group("", sitem({icon: "globe", k: "時區", r: st.timezone || "", tap: 1, data: 'data-s="tz"'}) + sitem({icon: "bell", k: "通知總開關", v: "Bot 做完或等你時通知,電腦和手機都算;關掉就都不通知", sw: !!st.notify, swdata: 'data-sset="notify"', disabled: !isOwner()}));
|
||||||
if (isOwner()) h += group("記憶與文件", sitem({icon: "brain", k: "用意思找記憶", v: "在這台電腦上算,不會上傳", r: ({local: "本機模型", ollama: "Ollama", off: "關閉"})[st.embed] || "本機模型", tap: 1, data: 'data-s="embed"'})
|
if (isOwner()) h += group("記憶與文件", sitem({icon: "brain", k: "用意思找記憶", v: "在這台電腦上算,不會上傳", r: ({local: "本機模型", ollama: "Ollama", off: "關閉"})[st.embed] || "本機模型", tap: 1, data: 'data-s="embed"'})
|
||||||
+ (st.doc_folders || []).map((f) => `<div class="item">${ic("folder", 19)}<div class="mid"><div class="k" style="font-size:var(--fs-small);word-break:break-all">${esc(f)}</div></div><button class="btn sm no" data-docrm="${esc(f)}">移除</button></div>`).join("")
|
+ (st.doc_folders || []).map((f) => `<div class="item">${ic("folder", 19)}<div class="mid"><div class="k" style="font-size:var(--fs-small);word-break:break-all">${esc(f)}</div></div><button class="btn sm no" data-docrm="${esc(f)}">移除</button></div>`).join("")
|
||||||
|
|
@ -3802,6 +3809,17 @@ function drawSettings(kind, quiet) {
|
||||||
h += `<div class="note">畫面看起來被切到、上面糊糊的、下面空一塊時,按「畫面」打開量尺截圖給我們。</div>`;
|
h += `<div class="note">畫面看起來被切到、上面糊糊的、下面空一塊時,按「畫面」打開量尺截圖給我們。</div>`;
|
||||||
}
|
}
|
||||||
el.innerHTML = h + `<div style="height:calc(var(--safe-b) + 24px)"></div>`;
|
el.innerHTML = h + `<div style="height:calc(var(--safe-b) + 24px)"></div>`;
|
||||||
|
const sq = $("set-q");
|
||||||
|
if (sq) sq.oninput = () => {
|
||||||
|
S.setQ = sq.value.trim(); clearTimeout(S.setT);
|
||||||
|
S.setT = setTimeout(async () => {
|
||||||
|
const q = S.setQ;
|
||||||
|
const v = q ? await act("settings_find", {q}, false) : null;
|
||||||
|
if (q !== S.setQ) return;
|
||||||
|
S.setHits = v ? v.hits || [] : null;
|
||||||
|
const pos = sq.selectionStart; drawSettings("settings", true); const n = $("set-q"); if (n) { n.focus(); n.setSelectionRange(pos, pos); }
|
||||||
|
}, 200);
|
||||||
|
};
|
||||||
el.querySelectorAll("[data-ruler]").forEach((x) => x.onclick = ruler);
|
el.querySelectorAll("[data-ruler]").forEach((x) => x.onclick = ruler);
|
||||||
if (quiet) el.scrollTop = sc;
|
if (quiet) el.scrollTop = sc;
|
||||||
wireSettings(kind, st);
|
wireSettings(kind, st);
|
||||||
|
|
@ -4001,7 +4019,10 @@ function wireSettings(kind, st) {
|
||||||
});
|
});
|
||||||
on("[data-s]", "onclick", async (x) => {
|
on("[data-s]", "onclick", async (x) => {
|
||||||
const k = x.dataset.s;
|
const k = x.dataset.s;
|
||||||
if (k === "smartsecs") sheet("智慧模式:卡片沒人回答時", SMART_SECS.map(([v, n]) => ({label: n, check: (st.smart_timeout_secs || 0) === v, on: async () => { if (await act("setting", {key: "smart_timeout_secs", value: v})) again(); }})));
|
if (k === "accentcolor") sheet("強調色(會回到自訂的顏色)", (st.accents || []).map((a) => ({label: "● " + a.name, check: !st.style && st.shell_accent === a.key, on: async () => { if (await act("setting", {key: "shell_accent", value: a.key})) again(); }})));
|
||||||
|
else if (k === "contrast") sheet("對比", [[0.85, "柔和"], [1, "標準"], [1.2, "鮮明"]].map(([v, n]) => ({label: n, check: Math.abs((st.shell_contrast || 1) - v) < 0.06, on: async () => { if (await act("setting", {key: "shell_contrast", value: v})) again(); }})));
|
||||||
|
else if (k === "lang") sheet("語言(選單和 Bot 回答)", [["auto", "自動偵測"], ...(st.languages || [])].map(([v, n]) => ({label: n, check: (st.language || "auto") === v, on: async () => { if (await act("setting", {key: "language", value: v})) again(); }})));
|
||||||
|
else if (k === "smartsecs") sheet("智慧模式:卡片沒人回答時", SMART_SECS.map(([v, n]) => ({label: n, check: (st.smart_timeout_secs || 0) === v, on: async () => { if (await act("setting", {key: "smart_timeout_secs", value: v})) again(); }})));
|
||||||
else if (k === "embed") sheet("用意思找記憶", [["local", "本機模型(在這台電腦上算)"], ["ollama", "Ollama"], ["off", "關閉"]].map(([v, n]) => ({label: n, check: (st.embed || "local") === v, on: async () => { if (await act("setting", {key: "embed", value: v})) again(); }})));
|
else if (k === "embed") sheet("用意思找記憶", [["local", "本機模型(在這台電腦上算)"], ["ollama", "Ollama"], ["off", "關閉"]].map(([v, n]) => ({label: n, check: (st.embed || "local") === v, on: async () => { if (await act("setting", {key: "embed", value: v})) again(); }})));
|
||||||
else if (k === "docadd") { const f = await ask("資料夾路徑(那台電腦上的)", "", "例如:~/Documents/筆記"); if (f && await act("setting", {key: "doc_folder_add", value: f}, "已加入")) again(); }
|
else if (k === "docadd") { const f = await ask("資料夾路徑(那台電腦上的)", "", "例如:~/Documents/筆記"); if (f && await act("setting", {key: "doc_folder_add", value: f}, "已加入")) again(); }
|
||||||
else if (k === "style") { if (await app("update_settings", {style: x.dataset.style}, 0, false)) { toast("換好了"); again(); } }
|
else if (k === "style") { if (await app("update_settings", {style: x.dataset.style}, 0, false)) { toast("換好了"); again(); } }
|
||||||
|
|
@ -4023,8 +4044,8 @@ function wireSettings(kind, st) {
|
||||||
});
|
});
|
||||||
on("[data-bx]", "onclick", async (x) => {
|
on("[data-bx]", "onclick", async (x) => {
|
||||||
const k = x.dataset.bx, box = st.box || {};
|
const k = x.dataset.bx, box = st.box || {};
|
||||||
if (k === "open") openBox(false);
|
if (k === "open") pickBoxBot(false);
|
||||||
else if (k === "take") openBox(true);
|
else if (k === "take") pickBoxBot(true);
|
||||||
else if (k === "mac") go("screen");
|
else if (k === "mac") go("screen");
|
||||||
else if (k === "wake") { await act("box", {op: "wake"}, "正在喚醒…"); again(); }
|
else if (k === "wake") { await act("box", {op: "wake"}, "正在喚醒…"); again(); }
|
||||||
else if (k === "snapshot") { await act("box", {op: "snapshot"}, "正在儲存快照…"); again(); }
|
else if (k === "snapshot") { await act("box", {op: "snapshot"}, "正在儲存快照…"); again(); }
|
||||||
|
|
@ -4585,8 +4606,14 @@ function pageMd(text, id, rev) {
|
||||||
// The bots' computer: its live screen shown over the app (screen.html embedded), where you
|
// The bots' computer: its live screen shown over the app (screen.html embedded), where you
|
||||||
// can also take over. Its ✕ posts a close; a back gesture closes it too.
|
// can also take over. Its ✕ posts a close; a back gesture closes it too.
|
||||||
let boxOpen = false;
|
let boxOpen = false;
|
||||||
function openBox(control) {
|
// From 設定 › 電腦 (no chat open): whose screen — each bot has its own, plus the shared desktop.
|
||||||
const b = bot(S.open) || S.bots.find((x) => x.primary) || {};
|
function pickBoxBot(control) {
|
||||||
|
const bots = S.bots.filter((b) => !b.members);
|
||||||
|
if (bots.length <= 1) return openBox(control);
|
||||||
|
sheet(control ? "接管哪個 Bot 的螢幕?" : "看哪個 Bot 的螢幕?", [...bots.map((b) => ({icon: "monitor", label: b.name + " 的螢幕", on: () => openBox(control, b.id)})), {icon: "monitor", label: "共用的桌面", on: () => openBox(control, 0)}]);
|
||||||
|
}
|
||||||
|
function openBox(control, which) {
|
||||||
|
const b = which === undefined ? (bot(S.open) || S.bots.find((x) => x.primary) || {}) : which ? bot(which) || {} : {};
|
||||||
const own = (b.computers || []).find((c) => c.kind === "own");
|
const own = (b.computers || []).find((c) => c.kind === "own");
|
||||||
const at = S.relay ? "host=" + encodeURIComponent(S.host) : "lan=1";
|
const at = S.relay ? "host=" + encodeURIComponent(S.host) : "lan=1";
|
||||||
boxOpen = true;
|
boxOpen = true;
|
||||||
|
|
|
||||||
|
|
@ -1508,7 +1508,7 @@ impl App {
|
||||||
// model and computer, a new chat, regenerate) plus looking and small chat things; making,
|
// model and computer, a new chat, regenerate) plus looking and small chat things; making,
|
||||||
// changing or deleting bots, routines, memories, pages and settings stays the owner's.
|
// changing or deleting bots, routines, memories, pages and settings stays the owner's.
|
||||||
let admin_ok = match action {
|
let admin_ok = match action {
|
||||||
"detail" | "settings" | "pages" | "search" | "export_bot" | "export_transcript" | "restart_bot" | "react" | "reply" | "resume" | "older" | "workflows" | "schedule" | "library" => true,
|
"detail" | "settings" | "pages" | "search" | "export_bot" | "export_transcript" | "restart_bot" | "react" | "reply" | "resume" | "older" | "workflows" | "schedule" | "library" | "settings_find" => true,
|
||||||
"bot" => b["key"].as_str() == Some("unread"),
|
"bot" => b["key"].as_str() == Some("unread"),
|
||||||
"box" => matches!(b["op"].as_str(), Some("wake" | "disk")),
|
"box" => matches!(b["op"].as_str(), Some("wake" | "disk")),
|
||||||
_ => false,
|
_ => false,
|
||||||
|
|
@ -1533,6 +1533,8 @@ impl App {
|
||||||
// 工作流 on the phone: each one's steps in order, what starts it, how its runs went, and
|
// 工作流 on the phone: each one's steps in order, what starts it, how its runs went, and
|
||||||
// the question it waits on — read here; run, stop, 繼續 and 停止 below.
|
// the question it waits on — read here; run, stop, 繼續 and 停止 below.
|
||||||
"workflows" => json!({"ok": true, "workflows": self.state.workflows.iter().map(|w| self.workflow_json(w)).collect::<Vec<_>>()}),
|
"workflows" => json!({"ok": true, "workflows": self.state.workflows.iter().map(|w| self.workflow_json(w)).collect::<Vec<_>>()}),
|
||||||
|
// 搜尋設定 on the phone (the computer's index, with the phone page for each).
|
||||||
|
"settings_find" => super::settings_find::find_for_phone(&s("q")),
|
||||||
// 所有檔案 on the phone: every file the chats keep, across bots and conversations.
|
// 所有檔案 on the phone: every file the chats keep, across bots and conversations.
|
||||||
"library" => self.library_json(),
|
"library" => self.library_json(),
|
||||||
// 日程 on the phone: three days back to a week ahead — what ran on its own and how it
|
// 日程 on the phone: three days back to a week ahead — what ran on its own and how it
|
||||||
|
|
@ -1944,6 +1946,32 @@ impl App {
|
||||||
return done(if on { "一律放行:開" } else { "一律放行:關" });
|
return done(if on { "一律放行:開" } else { "一律放行:關" });
|
||||||
}
|
}
|
||||||
"smart_timeout_secs" => self.state.smart_timeout_secs = v.as_u64().unwrap_or(0).min(3600),
|
"smart_timeout_secs" => self.state.smart_timeout_secs = v.as_u64().unwrap_or(0).min(3600),
|
||||||
|
// 外觀 from the phone: the accent (back to 自訂 from a 風格), the contrast, the language.
|
||||||
|
"shell_accent" => {
|
||||||
|
let name = v.as_str().unwrap_or("");
|
||||||
|
if !crate::theme::ACCENTS.iter().any(|a| a.0 == name) {
|
||||||
|
return fail("不認得這個強調色");
|
||||||
|
}
|
||||||
|
self.state.shell_accent = name.to_string();
|
||||||
|
self.state.shell_template.clear();
|
||||||
|
if let Some(ctx) = self.ctx_handle.clone() {
|
||||||
|
self.apply_theme(&ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"shell_contrast" => {
|
||||||
|
self.state.shell_contrast = (v.as_f64().unwrap_or(1.0) as f32).clamp(0.75, 1.35);
|
||||||
|
if let Some(ctx) = self.ctx_handle.clone() {
|
||||||
|
self.apply_theme(&ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"language" => {
|
||||||
|
let tag = v.as_str().unwrap_or("auto");
|
||||||
|
if tag != "auto" && !crate::i18n::LANGS.iter().any(|l| l.0 == tag) {
|
||||||
|
return fail("不認得這個語言");
|
||||||
|
}
|
||||||
|
self.state.language = tag.to_string();
|
||||||
|
crate::i18n::set(tag);
|
||||||
|
}
|
||||||
"auto_update" => self.state.auto_update_when_away = v.as_bool().unwrap_or(true),
|
"auto_update" => self.state.auto_update_when_away = v.as_bool().unwrap_or(true),
|
||||||
"garden_reports" => self.state.garden_reports = v.as_bool().unwrap_or(true),
|
"garden_reports" => self.state.garden_reports = v.as_bool().unwrap_or(true),
|
||||||
"embed" => {
|
"embed" => {
|
||||||
|
|
@ -2309,6 +2337,9 @@ impl App {
|
||||||
"timezone": st.timezone, "notify": st.notify, "language": st.language,
|
"timezone": st.timezone, "notify": st.notify, "language": st.language,
|
||||||
// 風格: the one worn ("" = 自訂) and each one's colours for the phone's little pictures.
|
// 風格: the one worn ("" = 自訂) and each one's colours for the phone's little pictures.
|
||||||
"style": st.shell_template,
|
"style": st.shell_template,
|
||||||
|
"shell_accent": st.shell_accent, "shell_contrast": st.shell_contrast,
|
||||||
|
"accents": crate::theme::ACCENTS.iter().map(|(n, label, l, d)| json!({"key": n, "name": label, "light": format!("#{:02x}{:02x}{:02x}", l.r(), l.g(), l.b()), "dark": format!("#{:02x}{:02x}{:02x}", d.r(), d.g(), d.b())})).collect::<Vec<_>>(),
|
||||||
|
"languages": crate::i18n::LANGS.iter().map(|(tag, endo, _)| json!([tag, endo])).collect::<Vec<_>>(),
|
||||||
"styles": crate::theme::TEMPLATES.iter().map(|t| {
|
"styles": crate::theme::TEMPLATES.iter().map(|t| {
|
||||||
let look = |dark| { let p = crate::theme::palette_for(t.id, 1.0, "clay", st.shell_contrast, dark); let pj = remote::palette_json(&p); json!({"pane": pj["pane"], "side": pj["side"], "text3": pj["text3"], "hover": pj["hover"], "active": pj["active"], "bubble": pj["bubble-user"], "accent": pj["accent"], "line": pj["line"], "grid": pj["grid"]}) };
|
let look = |dark| { let p = crate::theme::palette_for(t.id, 1.0, "clay", st.shell_contrast, dark); let pj = remote::palette_json(&p); json!({"pane": pj["pane"], "side": pj["side"], "text3": pj["text3"], "hover": pj["hover"], "active": pj["active"], "bubble": pj["bubble-user"], "accent": pj["accent"], "line": pj["line"], "grid": pj["grid"]}) };
|
||||||
json!({"id": t.id, "name": t.name, "about": t.about, "backdrop": t.backdrop, "light": look(false), "dark": look(true)})
|
json!({"id": t.id, "name": t.name, "about": t.about, "backdrop": t.backdrop, "light": look(false), "dark": look(true)})
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,34 @@ pub(super) fn tab_name(tab: SettingsTab) -> &'static str {
|
||||||
|
|
||||||
const MAX_HITS: usize = 12;
|
const MAX_HITS: usize = 12;
|
||||||
|
|
||||||
|
/// 搜尋設定 for the phone: the same hits, each with the phone's page that has it (its 設定 pages
|
||||||
|
/// are named like the computer's tabs; a model service is under 模型).
|
||||||
|
pub(super) fn find_for_phone(q: &str) -> serde_json::Value {
|
||||||
|
let page = |tab: SettingsTab| match tab {
|
||||||
|
S::General => "general",
|
||||||
|
S::Remote => "account",
|
||||||
|
S::Me => "me",
|
||||||
|
S::Providers => "models",
|
||||||
|
S::Channels => "integrations",
|
||||||
|
S::Computers => "computers",
|
||||||
|
S::Review => "perms",
|
||||||
|
S::Vault => "vault",
|
||||||
|
S::Voice => "voice",
|
||||||
|
S::Updates => "updates",
|
||||||
|
};
|
||||||
|
let hits: Vec<serde_json::Value> = find(q)
|
||||||
|
.into_iter()
|
||||||
|
.map(|h| {
|
||||||
|
let go = match &h.target {
|
||||||
|
Target::Entry(i) => page(INDEX[*i].tab),
|
||||||
|
Target::Provider(_) => "models",
|
||||||
|
};
|
||||||
|
serde_json::json!({"title": h.title, "path": h.path, "page": go})
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
serde_json::json!({"ok": true, "hits": hits})
|
||||||
|
}
|
||||||
|
|
||||||
/// What matches: titles that start with it, then titles that contain it, then the heading or the
|
/// What matches: titles that start with it, then titles that contain it, then the heading or the
|
||||||
/// other words.
|
/// other words.
|
||||||
pub(super) fn find(q: &str) -> Vec<Hit> {
|
pub(super) fn find(q: &str) -> Vec<Hit> {
|
||||||
|
|
|
||||||
|
|
@ -1262,7 +1262,7 @@ pub(crate) fn lan_guard(action: &str, body: &Value, now: impl FnOnce() -> Value,
|
||||||
"setting" => match key {
|
"setting" => match key {
|
||||||
// (As phone_act reads them: a missing value is off.)
|
// (As phone_act reads them: a missing value is off.)
|
||||||
"direct_mode" | "auto_review" => looser(on(&body["value"])),
|
"direct_mode" | "auto_review" => looser(on(&body["value"])),
|
||||||
"notify" | "auto_update" | "garden_reports" | "embed" => Guard::Keeps,
|
"notify" | "auto_update" | "garden_reports" | "embed" | "shell_accent" | "shell_contrast" | "language" => Guard::Keeps,
|
||||||
// 一律放行 on, a 智慧模式 card answering itself, a folder bots may read: looser.
|
// 一律放行 on, a 智慧模式 card answering itself, a folder bots may read: looser.
|
||||||
"always_approve" => looser(on(&body["value"])),
|
"always_approve" => looser(on(&body["value"])),
|
||||||
"smart_timeout_secs" => looser(body["value"].as_u64().unwrap_or(0) > 0),
|
"smart_timeout_secs" => looser(body["value"].as_u64().unwrap_or(0) > 0),
|
||||||
|
|
@ -1312,7 +1312,7 @@ pub(crate) fn lan_guard(action: &str, body: &Value, now: impl FnOnce() -> Value,
|
||||||
// signing a phone out; a workflow looked at, run, stopped or answered (its steps run with
|
// signing a phone out; a workflow looked at, run, stopped or answered (its steps run with
|
||||||
// the bots' own settings, as when its schedule starts it); the 日程, 所有檔案 — none of
|
// the bots' own settings, as when its schedule starts it); the 日程, 所有檔案 — none of
|
||||||
// these moves a guard.
|
// these moves a guard.
|
||||||
"search" | "detail" | "settings" | "pages" | "export_bot" | "export_transcript" | "import_bot" | "section_move" | "memory" | "app" | "group_chat" | "delete_bot" | "restart_bot" | "react" | "reply" | "resume" | "clear" | "delete_page" | "device_remove" | "skill" | "chatgpt" | "workflows" | "workflow" | "schedule" | "library" | "voice" => Guard::Keeps,
|
"search" | "detail" | "settings" | "pages" | "export_bot" | "export_transcript" | "import_bot" | "section_move" | "memory" | "app" | "group_chat" | "delete_bot" | "restart_bot" | "react" | "reply" | "resume" | "clear" | "delete_page" | "device_remove" | "skill" | "chatgpt" | "workflows" | "workflow" | "schedule" | "library" | "voice" | "settings_find" => Guard::Keeps,
|
||||||
// An action this list doesn't name is refused, not let through (import_bot slipped by
|
// An action this list doesn't name is refused, not let through (import_bot slipped by
|
||||||
// that way with a file's 「team」). A new one has to be put on one side or the other.
|
// that way with a file's 「team」). A new one has to be put on one side or the other.
|
||||||
_ => Guard::Unknown,
|
_ => Guard::Unknown,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue