手機補上電腦有的(第一批,大腦已經有 API 的):搜尋聊天裡的訊息、設定 › 個人資料與用量、Bot 設定的思考模式和步驟模型、釘選和分區排序、匯出匯入、各 Bot 的草稿、程式碼複製、頁面存成檔案。

- 搜尋(act search):首頁放大鏡打字,Bot 在上,下面「聊天裡」列訊息和檔名(含過去的對話);點一筆打開那個聊天、捲到那則亮一下(jumpTo 也找得到 Bot 的回答),過去的對話先問要不要換回來。
- 設定 ›「個人資料與用量」(GET api/stats,擁有者):跟電腦同一套——四個大數字、一年熱度點、期間切換、大數字、每天長條、依模型比例條/依 Bot 頭像。
- Bot 設定:「執行步驟用的模型」(自動/不分開/同家的其他模型)、「思考模式」(自動、快速、平衡、深入)。
- 釘選照電腦的順序(state 的 pin_order),⋯ ›「更多…」往前、往後移(pin_at);分區 ⋯「往上移/往下移」(section_move)。
- 匯出 Bot 檔案、匯出文字記錄(iPhone 跳分享選單,否則下載)、首頁 +「匯入 Bot 檔案」。
- 每個 Bot 各自的草稿(存在這支手機,切換、關頁面都在);程式碼塊右上「複製」;頁面 ⋯「存成檔案(.md)」。
- 功能地圖:bots.md(搜尋、選單、一步手機驗證)、settings.md、profile.md、pages.md、phone.md;FEATURES.md。

已驗證: cargo test 877 個、relay 27 個全過;scratch 手機頁面實際操作:搜尋「台南」出兩筆、點了跳到那則亮起來;個人資料與用量畫出數字列、熱度點、期間切換;思考模式選「深入」後 state 的 thinking=high,步驟模型選「不分開」後 step_model=off;程式碼塊「複製」後剪貼簿是 ls -la ~/Downloads;草稿:Bot 1 打一半、切到 Bot 2 是空的、切回來還在;匯出文字記錄「已存成「驗證小幫手 對話.md」」;分區乙組往上移後 state 的 sections 變成 乙組、甲組。
未驗證: 匯入 Bot 檔案(scratch 的檔案選擇器是臨時建立的,ctl 選不到;大腦那邊的 import_bot 有 remote:: 的測試);iPhone 的分享選單(無頭 Chrome 沒有,走下載);釘選往前往後移沒在畫面上按(pin_at 有 remote:: 的測試)。手機經帳號連時要 make update-server 才是新的頁面。

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-22 08:58:40 +08:00
parent 33b3fb8cab
commit 12b734fdb6
7 changed files with 213 additions and 22 deletions

View File

@ -138,7 +138,7 @@ AnyBot 是一個桌面聊天 App,介面和運作方式照 Grok Bot 重做。
- 找的範圍:每個 Bot 目前的對話和「過去的對話」裡,你和 Bot 說的話,以及附加檔案的檔名(標「檔案:」)。工具的結果和摘要不找(讀過一次的網頁會把別的都蓋掉)。不分大小寫。 - 找的範圍:每個 Bot 目前的對話和「過去的對話」裡,你和 Bot 說的話,以及附加檔案的檔名(標「檔案:」)。工具的結果和摘要不找(讀過一次的網頁會把別的都蓋掉)。不分大小寫。
- 每一筆兩行:Bot 的名字(在過去的對話裡的加「· 過去的對話」)和時間(「剛剛」「昨天 09:33」「11/3」),下面是那句話裡相符處前後的一行,你說的前面加「你:」。最新的在最上面,最多列 40 筆,超過會提示多打幾個字。 - 每一筆兩行:Bot 的名字(在過去的對話裡的加「· 過去的對話」)和時間(「剛剛」「昨天 09:33」「11/3」),下面是那句話裡相符處前後的一行,你說的前面加「你:」。最新的在最上面,最多列 40 筆,超過會提示多打幾個字。
- 點一筆:打開那個 Bot,聊天捲到那則訊息,並用黃色亮一下(約 1.8 秒淡掉)。在過去的對話裡的,會先把那段對話換回來(目前的對話收進「過去的對話」最上面);那個 Bot 正在工作時不換,改提示「「(名字)」正在工作。等它做完,再打開過去的對話。」 - 點一筆:打開那個 Bot,聊天捲到那則訊息,並用黃色亮一下(約 1.8 秒淡掉)。在過去的對話裡的,會先把那段對話換回來(目前的對話收進「過去的對話」最上面);那個 Bot 正在工作時不換,改提示「「(名字)」正在工作。等它做完,再打開過去的對話。」
- 連到別台大腦的電腦上也能用(找的是大腦的聊天)。手機版還沒有。 - 連到別台大腦的電腦上也能用(找的是大腦的聊天)。手機一樣有(擁有者):首頁放大鏡打字,相符的 Bot 在上,下面「聊天裡」列訊息和檔名(含過去的對話);點一筆打開那個聊天,捲到那則訊息亮一下(太早、手機沒留的會說);過去的對話先問要不要換回來。
### 任務(2026-11-20) ### 任務(2026-11-20)
@ -1589,6 +1589,7 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
- **活動**:一年的熱度格子(53 週,一週一欄、週日在上),依最忙那天分四級深淺,沒有用量只有訊息的那天照訊息算;滑過看「2026年11月20日:3,610 token、12 則訊息」。圖例旁邊一行「最活躍:11月20日・3,610 token」。 - **活動**:一年的熱度格子(53 週,一週一欄、週日在上),依最忙那天分四級深淺,沒有用量只有訊息的那天照訊息算;滑過看「2026年11月20日:3,610 token、12 則訊息」。圖例旁邊一行「最活躍:11月20日・3,610 token」。
- **用量**:7 天/30 天/90 天/一年。一個大數字 token(滑過看新讀、寫、快取讀到),下面一行呼叫次數、花費——只算模型服務自己回報的(例如 OpenRouter),沒回報的寫「未定價」(部分有部分沒有:「US$0.97(另有 694 次呼叫未定價)」),不是 0 元;每天一條長條(滑過看數字,那條變深);再用「依模型/依 Bot」切換:依模型是一條彩色比例條,下面每個模型一列(服務的圖案、色點、名字、token・百分比),依 Bot 每列是頭像、名字、細長條、token・百分比(前 8 名,發布前檢查、目標檢查各自一列,刪掉的 Bot 寫「Bot 9(已刪除)」)。 - **用量**:7 天/30 天/90 天/一年。一個大數字 token(滑過看新讀、寫、快取讀到),下面一行呼叫次數、花費——只算模型服務自己回報的(例如 OpenRouter),沒回報的寫「未定價」(部分有部分沒有:「US$0.97(另有 694 次呼叫未定價)」),不是 0 元;每天一條長條(滑過看數字,那條變深);再用「依模型/依 Bot」切換:依模型是一條彩色比例條,下面每個模型一列(服務的圖案、色點、名字、token・百分比),依 Bot 每列是頭像、名字、細長條、token・百分比(前 8 名,發布前檢查、目標檢查各自一列,刪掉的 Bot 寫「Bot 9(已刪除)」)。
- 都從已經有的紀錄算(`usage/YYYY-MM.jsonl` 和每則訊息的時間),不另外存;用大腦的時區切日子;打開時在背景算,一分鐘內再看不重算。螢幕電腦向大腦要(`api/sync/stats`),手機用 `api/stats`(擁有者才有)。 - 都從已經有的紀錄算(`usage/YYYY-MM.jsonl` 和每則訊息的時間),不另外存;用大腦的時區切日子;打開時在背景算,一分鐘內再看不重算。螢幕電腦向大腦要(`api/sync/stats`),手機用 `api/stats`(擁有者才有)。
- 手機:設定 ›「個人資料與用量」(擁有者才有),同一套:四個大數字一條、一年的熱度點(點一下看那天)、用量的期間切換、大數字、每天的長條、依模型(彩色比例條)/依 Bot(頭像和長條)。
### 所有檔案(側邊欄的資料夾按鈕) ### 所有檔案(側邊欄的資料夾按鈕)
@ -2320,6 +2321,8 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
- 保險庫:只說明,不傳任何密碼到手機; - 保險庫:只說明,不傳任何密碼到手機;
- 手機與帳號:直接連線的手機清單,可以登出別支手機; - 手機與帳號:直接連線的手機清單,可以登出別支手機;
- 更新:版本和有沒有新版。 - 更新:版本和有沒有新版。
- 個人資料與用量:見「個人資料與用量」。
- 手機補上的(以前只有電腦有):搜尋聊天裡的訊息和檔名;Bot 設定的「執行步驟用的模型」「思考模式」;釘選的 Bot 在 ⋯ ›「更多…」往前、往後移,分區的 ⋯「往上移/往下移」;「匯出 Bot 檔案(.anybot)」「匯出文字記錄(.md)」「匯入 Bot 檔案」(iPhone 跳分享選單,可以存到「檔案」或 AirDrop);每個 Bot 各自的草稿(切換 Bot、關掉頁面都留著,存在這支手機);程式碼塊右上的「複製」;頁面 ⋯ 的「存成檔案(.md)」。
- 看電腦畫面: - 看電腦畫面:
- 「Bot 的電腦」每秒更新一次畫面;在休眠時按「叫醒」。 - 「Bot 的電腦」每秒更新一次畫面;在休眠時按「叫醒」。
- 「這台 Mac」要先在設定裡打開才會出現。 - 「這台 Mac」要先在設定裡打開才會出現。

View File

@ -6,8 +6,8 @@
- `bots-sidebar` 側邊欄:最上面是主要 Bot(大頭像),接著是釘選的格子(把 Bot 拖進去就釘選,格子裡可以拖曳排序),再來是各分區和「未分區」(分區見 [team](team.md))。每一列第二行是「正在工作…」「需要你允許」「等你回答」「等你處理」,或最後一則訊息。選中的 Bot 整列淺底(比滑過深一階),左邊沒有色條。 - `bots-sidebar` 側邊欄:最上面是主要 Bot(大頭像),接著是釘選的格子(把 Bot 拖進去就釘選,格子裡可以拖曳排序),再來是各分區和「未分區」(分區見 [team](team.md))。每一列第二行是「正在工作…」「需要你允許」「等你回答」「等你處理」,或最後一則訊息。選中的 Bot 整列淺底(比滑過深一階),左邊沒有色條。
- `bots-moods` 頭像的表情:側邊欄、釘選格子、右側面板和任務卡上的 Bot 頭像跟輸入框上方那張臉一樣看狀態——等你允許或回答時往上看你;上網時眼睛左右掃,看畫面時往右上看,寫字時往下看,想事情或讀回來的結果時往左上看,其他步驟慢慢左右讀;做事時微微呼吸(2.6 秒一次);上一輪失敗是兩條平的眼睛,剛做完笑兩秒;閒著時眼睛跟著滑鼠。做事時一個樣子至少停 1.4 秒,步驟換得快也不會一直閃。設定 › 一般 › 更多外觀設定 ›「頭像動態」選「減少」(「自動」在畫面用 CPU 畫的電腦上也是)只換表情、不動([appearance](appearance.md))。 - `bots-moods` 頭像的表情:側邊欄、釘選格子、右側面板和任務卡上的 Bot 頭像跟輸入框上方那張臉一樣看狀態——等你允許或回答時往上看你;上網時眼睛左右掃,看畫面時往右上看,寫字時往下看,想事情或讀回來的結果時往左上看,其他步驟慢慢左右讀;做事時微微呼吸(2.6 秒一次);上一輪失敗是兩條平的眼睛,剛做完笑兩秒;閒著時眼睛跟著滑鼠。做事時一個樣子至少停 1.4 秒,步驟換得快也不會一直閃。設定 › 一般 › 更多外觀設定 ›「頭像動態」選「減少」(「自動」在畫面用 CPU 畫的電腦上也是)只換表情、不動([appearance](appearance.md))。
- `bots-search` 搜尋「搜尋 Bot 和訊息」:上面列名字或描述相符的 Bot,下面「訊息」列你和 Bot 說過的話和附件檔名(含過去的對話,最多 40 筆),點一筆就捲到那則訊息。按 🔍 或 ⌘F 打開時游標在搜尋框;之後點輸入框打字,字就留在輸入框(搜尋框開著也不會把游標搶回去)。 - `bots-search` 搜尋「搜尋 Bot 和訊息」:上面列名字或描述相符的 Bot,下面「訊息」列你和 Bot 說過的話和附件檔名(含過去的對話,最多 40 筆),點一筆就捲到那則訊息。手機一樣:Bot 在上,下面「聊天裡」列訊息和檔名(擁有者),點一筆打開那個聊天、捲到那則亮一下,過去的對話先問要不要換回來。按 🔍 或 ⌘F 打開時游標在搜尋框;之後點輸入框打字,字就留在輸入框(搜尋框開著也不會把游標搶回去)。
- `bots-menu` Bot 選單:「釘選」/「取消釘選」、「移至」、「標示為已讀」/「標示為未讀」、「設為主要 Bot」、「編輯 Bot…」、「記憶…」、「開始新對話」、「過去的對話」、「分享與匯出」(「匯出 Bot(分享給別人)…」「匯出文字記錄…」「匯入 Bot…」「複製對話 ID」)、「重新啟動這個 Bot」、「清除聊天記錄」、「刪除」。 - `bots-menu` Bot 選單:「釘選」/「取消釘選」、「移至」、「標示為已讀」/「標示為未讀」、「設為主要 Bot」、「編輯 Bot…」、「記憶…」、「開始新對話」、「過去的對話」、「分享與匯出」(「匯出 Bot(分享給別人)…」「匯出文字記錄…」「匯入 Bot…」「複製對話 ID」)、「重新啟動這個 Bot」、「清除聊天記錄」、「刪除」。手機:⋯ ›「更多…」有「釘選裡往前移/往後移」「匯出 Bot 檔案(.anybot)」,聊天的 ⋯ 有「匯出文字記錄(.md)」,首頁 + 有「匯入 Bot 檔案」,分區的 ⋯ 有「往上移/往下移」。
- `bots-create` 建立:「新增 Bot」,或「從範本建立」(研究助理、寫作夥伴、電腦助手、客服助理、開發助手)。新 Bot 沿用目前選中 Bot 的供應商和模型,電腦工具關著。 - `bots-create` 建立:「新增 Bot」,或「從範本建立」(研究助理、寫作夥伴、電腦助手、客服助理、開發助手)。新 Bot 沿用目前選中 Bot 的供應商和模型,電腦工具關著。
- `bots-chat` 在聊天裡請 Bot:列出所有 Bot(`list_bots`)、建 Bot(`create_bot`,不用問)、改名稱等(`update_bot`,先跳確認卡片)。 - `bots-chat` 在聊天裡請 Bot:列出所有 Bot(`list_bots`)、建 Bot(`create_bot`,不用問)、改名稱等(`update_bot`,先跳確認卡片)。
@ -29,6 +29,7 @@
- **建 Bot**(covers `bots-create`):+ ›「建立 Bot」打名字;再從範本建一個。指令:`$CTL phone click '[data-back]' && $CTL phone click '#b-newbot' && $CTL phone click '#sheet-in .opt' --text '建立 Bot' && $CTL phone type '#ask-in' '研究員' && $CTL phone click '#ask-ok' && $CTL phone wait-text 研究員 --in '#isl-name' && $CTL phone click '[data-back]' && $CTL phone click '#b-newbot' && $CTL phone click '#sheet-in .opt' --text 從範本建立 && $CTL phone wait-text 開發助手 --in '#sheet-in' && $CTL phone click '#sheet-in .opt' --text 寫作夥伴 && $CTL phone wait-text 寫作夥伴 --in '#isl-name' && $CTL state '[.bots[] | {id, name, provider, model, tools_enabled}]'`。看到:範本有研究助理、寫作夥伴、電腦助手、客服助理、開發助手;建好就打開它的聊天;兩個新 Bot 都是 Custom · fake-model,tools_enabled false。 - **建 Bot**(covers `bots-create`):+ ›「建立 Bot」打名字;再從範本建一個。指令:`$CTL phone click '[data-back]' && $CTL phone click '#b-newbot' && $CTL phone click '#sheet-in .opt' --text '建立 Bot' && $CTL phone type '#ask-in' '研究員' && $CTL phone click '#ask-ok' && $CTL phone wait-text 研究員 --in '#isl-name' && $CTL phone click '[data-back]' && $CTL phone click '#b-newbot' && $CTL phone click '#sheet-in .opt' --text 從範本建立 && $CTL phone wait-text 開發助手 --in '#sheet-in' && $CTL phone click '#sheet-in .opt' --text 寫作夥伴 && $CTL phone wait-text 寫作夥伴 --in '#isl-name' && $CTL state '[.bots[] | {id, name, provider, model, tools_enabled}]'`。看到:範本有研究助理、寫作夥伴、電腦助手、客服助理、開發助手;建好就打開它的聊天;兩個新 Bot 都是 Custom · fake-model,tools_enabled false。
- **Bot 自己建、列出**(covers `bots-chat`):指令:`$CTL phone click '[data-back]' && $CTL phone click '.row[data-bot="1"]' && $CTL phone send '建 [[call create_bot {"template":"研究助理"}]]' && $CTL wait-api '/api/state?since=0' '.bots | length == 4' && $CTL phone send '列出 [[call list_bots {}]]' && $CTL wait-api /api/bots/1 '[.messages[].tools[]? | select(.name == "list_bots" and .status == "done")] | length == 1' && $CTL api GET /api/bots/1 --jq '[.messages[].tools[]? | select(.name == "list_bots") | .result]'`。看到:沒跳卡片就建好研究助理;清單一行一個 Bot(供應商 · 模型,主要 Bot 標出來、「就是你」)。 - **Bot 自己建、列出**(covers `bots-chat`):指令:`$CTL phone click '[data-back]' && $CTL phone click '.row[data-bot="1"]' && $CTL phone send '建 [[call create_bot {"template":"研究助理"}]]' && $CTL wait-api '/api/state?since=0' '.bots | length == 4' && $CTL phone send '列出 [[call list_bots {}]]' && $CTL wait-api /api/bots/1 '[.messages[].tools[]? | select(.name == "list_bots" and .status == "done")] | length == 1' && $CTL api GET /api/bots/1 --jq '[.messages[].tools[]? | select(.name == "list_bots") | .result]'`。看到:沒跳卡片就建好研究助理;清單一行一個 Bot(供應商 · 模型,主要 Bot 標出來、「就是你」)。
- **搜尋**(covers `bots-search`):首頁放大鏡打「研究」。指令:`$CTL phone click '[data-back]' && $CTL phone click '#b-search' && $CTL phone type '#search' '研究' && $CTL phone wait-gone '.row[data-bot="1"]' && $CTL phone wait '.row[data-bot="2"]' && $CTL phone shot bots-search && $CTL phone click '#b-search-x' && $CTL phone wait '.row[data-bot="1"]'`。看到:只剩名字或描述含「研究」的(研究員、研究助理);✕ 清掉回到全部。 - **搜尋**(covers `bots-search`):首頁放大鏡打「研究」。指令:`$CTL phone click '[data-back]' && $CTL phone click '#b-search' && $CTL phone type '#search' '研究' && $CTL phone wait-gone '.row[data-bot="1"]' && $CTL phone wait '.row[data-bot="2"]' && $CTL phone shot bots-search && $CTL phone click '#b-search-x' && $CTL phone wait '.row[data-bot="1"]'`。看到:只剩名字或描述含「研究」的(研究員、研究助理);✕ 清掉回到全部。
- **手機搜尋聊天裡、排序、匯出**(covers `bots-search`、`bots-menu`):指令:`$CTL phone click '.row[data-bot="1"]' && $CTL phone send '週末想去台南玩' && $CTL phone wait-text '台南' --in '#msgs' && $CTL phone click '[data-back]' && $CTL phone click '#b-search' && $CTL phone type '#search' '台南' && $CTL phone wait '[data-hit="0"]' && $CTL phone click '[data-hit="0"]' && $CTL phone wait '#msgs .lit' && $CTL phone click '#b-chatmore' && $CTL phone click '#sheet-in .opt' --text '匯出文字記錄' && $CTL phone wait-text '已存成' --in '#toast'`。看到:「聊天裡」兩筆(你的話和回答),點了打開聊天、那則亮一下;「已存成「… 對話.md」」。
- **選單**(covers `bots-menu`、`bots-sidebar`):研究員那列「⋯」› 釘選、「更多…」› 標示為未讀;寫作夥伴 ›「刪除 Bot」。指令:`$CTL phone click '[data-botmenu="2"]' && $CTL phone click '#sheet-in .opt' --text 釘選 && $CTL phone wait-text '已釘選的 Bot' --in '#home' && $CTL phone click '[data-botmenu="2"]' && $CTL phone click '#sheet-in .opt' --text 更多 && $CTL phone click '#sheet-in .opt' --text 標示為未讀 && $CTL wait-api '/api/state?since=0' '.bots[] | select(.name == "研究員") | .pinned and .unread' && $CTL phone click '[data-botmenu="3"]' && $CTL phone click '#sheet-in .opt' --text '刪除 Bot' && $CTL phone wait-text '此操作無法復原' --in '#sheet-in' && $CTL phone click '#sheet-in .opt' --text 刪除 && $CTL wait-api '/api/state?since=0' '[.bots[].name] | index("寫作夥伴") == null' && $CTL phone shot bots-menu`。看到:研究員移到「已釘選的 Bot」、有未讀的點;刪除先問「這會刪除它和它的聊天記錄。此操作無法復原。」,刪掉後清單和大腦都沒有它。 - **選單**(covers `bots-menu`、`bots-sidebar`):研究員那列「⋯」› 釘選、「更多…」› 標示為未讀;寫作夥伴 ›「刪除 Bot」。指令:`$CTL phone click '[data-botmenu="2"]' && $CTL phone click '#sheet-in .opt' --text 釘選 && $CTL phone wait-text '已釘選的 Bot' --in '#home' && $CTL phone click '[data-botmenu="2"]' && $CTL phone click '#sheet-in .opt' --text 更多 && $CTL phone click '#sheet-in .opt' --text 標示為未讀 && $CTL wait-api '/api/state?since=0' '.bots[] | select(.name == "研究員") | .pinned and .unread' && $CTL phone click '[data-botmenu="3"]' && $CTL phone click '#sheet-in .opt' --text '刪除 Bot' && $CTL phone wait-text '此操作無法復原' --in '#sheet-in' && $CTL phone click '#sheet-in .opt' --text 刪除 && $CTL wait-api '/api/state?since=0' '[.bots[].name] | index("寫作夥伴") == null' && $CTL phone shot bots-menu`。看到:研究員移到「已釘選的 Bot」、有未讀的點;刪除先問「這會刪除它和它的聊天記錄。此操作無法復原。」,刪掉後清單和大腦都沒有它。
- **重開還在**(covers `bots-create`、`bots-sidebar`):指令:`$CTL restart && $CTL phone open --listed && $CTL phone wait-text '已釘選的 Bot' --in '#home' && $CTL state '[.bots[] | {name, pinned}]'`。看到:小幫手二號、研究員(還是釘選)、研究助理都還在。 - **重開還在**(covers `bots-create`、`bots-sidebar`):指令:`$CTL restart && $CTL phone open --listed && $CTL phone wait-text '已釘選的 Bot' --in '#home' && $CTL state '[.bots[] | {name, pinned}]'`。看到:小幫手二號、研究員(還是釘選)、研究助理都還在。
- **桌面**(covers `bots-sidebar`、`bots-search`、`bots-menu`、`bots-create`):指令:要開視窗——`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot bots-find ANYBOT_SHOT_VIEW=find ANYBOT_SHOT_FIND=台南`。看到:搜尋下面「訊息」列說過的話(含過去的對話);選中那列淺底、沒有色條;釘選格子的拖曳、桌面的選單項目(分享與匯出…)、「建立 Bot」視窗(填 Soul 與指示、擅長,名字或模型空白按不下去)靠自動測試。 - **桌面**(covers `bots-sidebar`、`bots-search`、`bots-menu`、`bots-create`):指令:要開視窗——`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot bots-find ANYBOT_SHOT_VIEW=find ANYBOT_SHOT_FIND=台南`。看到:搜尋下面「訊息」列說過的話(含過去的對話);選中那列淺底、沒有色條;釘選格子的拖曳、桌面的選單項目(分享與匯出…)、「建立 Bot」視窗(填 Soul 與指示、擅長,名字或模型空白按不下去)靠自動測試。

View File

@ -17,7 +17,7 @@ Bot 把要追蹤、整理、比較的事寫成一頁,之後一直更新同一
- 回覆裡的 [標題](page:ID) 連結,和回覆下面的頁面卡片(電腦版一張精簡卡:頁面圖示、標題一次、一行它說什麼——更新過的是「已更新:改了什麼」,否則是現況那句——和一行灰字「種類 · 頁面 · 時間 · 第 N 版」;手機是標題、幾行預覽和「頁面 · 時間 · 已更新」):點一下打開。一個回覆裡每一頁只出一張卡,在最後存那一頁的步驟下面(被退回再存、或存了又更新,都不會重複);沒存成的(別的 Bot 的頁面被擋、被退回那一次)不出卡。 - 回覆裡的 [標題](page:ID) 連結,和回覆下面的頁面卡片(電腦版一張精簡卡:頁面圖示、標題一次、一行它說什麼——更新過的是「已更新:改了什麼」,否則是現況那句——和一行灰字「種類 · 頁面 · 時間 · 第 N 版」;手機是標題、幾行預覽和「頁面 · 時間 · 已更新」):點一下打開。一個回覆裡每一頁只出一張卡,在最後存那一頁的步驟下面(被退回再存、或存了又更新,都不會重複);沒存成的(別的 Bot 的頁面被擋、被退回那一次)不出卡。
- 右側面板的「資料庫」分頁,最上面的「頁面」:這個 Bot 的頁面,最近改過的在前面。 - 右側面板的「資料庫」分頁,最上面的「頁面」:這個 Bot 的頁面,最近改過的在前面。
- 打開的頁面下方左邊「版本紀錄」(看舊版時有「回到最新版」)和「刪除」(按兩次),右邊「複製」(Markdown)、「存成檔案」(存成 .md 到「下載」)、「完成」。 - 打開的頁面下方左邊「版本紀錄」(看舊版時有「回到最新版」)和「刪除」(按兩次),右邊「複製」(Markdown)、「存成檔案」(存成 .md 到「下載」)、「完成」。
- 手機:首頁上面一排的「頁面」列出所有頁面;聊天裡的頁面卡片;打開的頁面的「⋯」有「複製 Markdown」「其他版本」,一條細線下面才是「刪除頁面」。 - 手機:首頁上面一排的「頁面」列出所有頁面;聊天裡的頁面卡片;打開的頁面的「⋯」有「複製 Markdown」「存成檔案(.md)」「其他版本」,一條細線下面才是「刪除頁面」。
## 怎麼操作(verify-anybot) ## 怎麼操作(verify-anybot)

View File

@ -4,13 +4,13 @@
## 子功能 ## 子功能
- `phone-pages` 頁面:Bot 清單(分區、工作中/等你)、聊天(附檔、拍照、語音輸入、插話、停止;叫醒 Bot 的訊息上方標是什麼叫醒的:目標、例行任務、觸發、訊息管道、來自其他 Bot、監看)、允許請求卡片(「一律允許」「允許一次」、「這輪都准」(智慧模式,一直開著;它是主按鈕)、「拒絕」、「全部允許,之後直接操作」;卡片太高時卡在內面自己捲,輸入框不會被頂出螢幕)、問題卡、「需要處理」與接管、Bot 設定、例行任務(詳細頁有最近幾次執行和送出證據)、頁面、記憶、檔案預覽、Bot 的電腦畫面、設定(一般、模型、權限、整合、電腦、保險庫、手機與帳號、更新,能改的比電腦少;開著的設定頁跟著電腦那邊的改變重讀,不用重新整理;直接連線只能收緊、不能放寬,見 [autonomy](autonomy.md))、傳送到其他裝置。智慧模式一直開著,輸入列沒有它的晶片。 - `phone-pages` 頁面:Bot 清單(分區、工作中/等你)、聊天(附檔、拍照、語音輸入、插話、停止;叫醒 Bot 的訊息上方標是什麼叫醒的;各 Bot 自己的草稿;程式碼塊的「複製」)、允許請求卡片(「一律允許」「允許一次」、「這輪都准」(智慧模式,一直開著;它是主按鈕)、「拒絕」、「全部允許,之後直接操作」;卡片太高時卡在內面自己捲,輸入框不會被頂出螢幕)、問題卡、「需要處理」與接管、Bot 設定、例行任務(詳細頁有最近幾次執行和送出證據)、頁面、記憶、檔案預覽、Bot 的電腦畫面、設定(一般、模型、權限、整合、電腦、保險庫、手機與帳號、更新,能改的比電腦少;開著的設定頁跟著電腦那邊的改變重讀,不用重新整理;直接連線只能收緊、不能放寬,見 [autonomy](autonomy.md))、傳送到其他裝置。智慧模式一直開著,輸入列沒有它的晶片。
- `phone-cards` 手機上的卡(允許、需要處理、問題卡)只答它畫出來的那一張:那張已經在電腦或另一支手機上回答、被停止、或換成下一張時,按了不算,聊天裡寫「手機上的回答沒有用上…」;開了很久沒重新整理的舊頁面也一樣。螢幕電腦上的卡也是;比大腦舊的螢幕電腦答不了任何卡,要在那台 設定 › 更新 換新版(重新整理沒用)。支線的卡沒用上時,寫在主線的聊天。 - `phone-cards` 手機上的卡(允許、需要處理、問題卡)只答它畫出來的那一張:那張已經在電腦或另一支手機上回答、被停止、或換成下一張時,按了不算,聊天裡寫「手機上的回答沒有用上…」;開了很久沒重新整理的舊頁面也一樣。螢幕電腦上的卡也是;比大腦舊的螢幕電腦答不了任何卡,要在那台 設定 › 更新 換新版(重新整理沒用)。支線的卡沒用上時,寫在主線的聊天。
- `phone-look` 長相(和電腦版同一份設計規格:字級、間距、圓角都是同一組數字):Bot 的回答不放在泡泡裡,像文件一樣直接排在畫面上,跟介面同一種字(iPhone 是 SF Pro 加蘋方)、16px、行距寬;裡面的表格只有橫向細線、數字欄靠右,提示框([!NOTE] 等)同一種淡底、只有圖示依種類上色,程式碼是淡底圓角塊。標題用半粗體。手機沒有字型選項。 - `phone-look` 長相(和電腦版同一份設計規格:字級、間距、圓角都是同一組數字):Bot 的回答不放在泡泡裡,像文件一樣直接排在畫面上,跟介面同一種字(iPhone 是 SF Pro 加蘋方)、16px、行距寬;裡面的表格只有橫向細線、數字欄靠右,提示框([!NOTE] 等)同一種淡底、只有圖示依種類上色,程式碼是淡底圓角塊。標題用半粗體。手機沒有字型選項。
- `phone-colors` 顏色跟電腦版一樣:電腦上 設定 › 一般 › 外觀 的主題(淺色/深色/跟隨系統)、底色、強調色、對比,手機照著穿;手機自己的「外觀」可以選「跟著電腦」(預設)、「跟著手機」、「淺色」、「深色」。狀態列的顏色跟著畫面。舊版的電腦沒送顏色時,手機用內建的「紙」。 - `phone-colors` 顏色跟電腦版一樣:電腦上 設定 › 一般 › 外觀 的主題(淺色/深色/跟隨系統)、底色、強調色、對比,手機照著穿;手機自己的「外觀」可以選「跟著電腦」(預設)、「跟著手機」、「淺色」、「深色」。狀態列的顏色跟著畫面。舊版的電腦沒送顏色時,手機用內建的「紙」。
- `phone-claude` 像 Claude 的手機 App:上面一條簡單的標題列(Bot 名稱,第二行是它在做什麼或用哪個模型),輸入框是底部一張圓角卡片,回答下面只有時間和複製/重新產生/⋯;按鈕和點的地方至少 44px;清單每列的說明只有一行(太長以 … 結尾);顏色少,強調色只用在連結、選取和新訊息的點。 - `phone-claude` 像 Claude 的手機 App:上面一條簡單的標題列(Bot 名稱,第二行是它在做什麼或用哪個模型),輸入框是底部一張圓角卡片,回答下面只有時間和複製/重新產生/⋯;按鈕和點的地方至少 44px;清單每列的說明只有一行(太長以 … 結尾);顏色少,強調色只用在連結、選取和新訊息的點。
- `phone-net` 網路慢或斷線都不擋操作:存過這台電腦的資料,打開 App 就用上次的內容進去,不等網路,連上後只補變了的;浮著提示「離線中:顯示的是上次的內容」,拿到就消失。只有第一次(還沒有這台的資料)停在連線畫面:打開 App 時的頭像留在正中間呼吸、外圈漾開,不顯示文字(讀螢幕軟體唸「正在連線」;減少動態時不動),第一份狀態到手才進去。用帳號連、那台不在線上時留在它上次的內容裡,不換到別台。進去之後斷線:浮「連線中斷,正在重新連線…」,自己重試,回到前景或網路恢復時立刻重連。設定、詳細、例行任務先畫手上有的,背景讀新的;要改的先讀到最新的。傳訊息不等網路:按下就出現在聊天裡;連不上標「等連線後送出(點一下拿回來)」,存手機排隊(關 App 也還在),連上後照順序自己送、不限時間,同一則只送一次;點一下連同附件拿回輸入框;連不上時選的附件也排隊。大腦拒收的才標「沒送出,點一下拿回來重送」。從通知打開時按的允許/拒絕等連上才送。只傳有變的部分、文字壓縮;Bot 回答中手機每秒最多更新一次聊天(見 [chat](chat.md) 的開聊天分頁)。頁面和圖示存在手機上:打開直接用,背景問一次換版沒;換了,還在連線畫面就重新載入,已進去就等退到背景、手上沒東西(沒打字、附件、排隊、錄音、選單)才換;重新整理一定先問伺服器。上次的狀態、看過的聊天(合計最多 12 個)、詳細資料、設定、排隊的訊息每台電腦各自存在這個網址的儲存空間,登出(或登入失效)全部清掉。 - `phone-net` 網路慢或斷線都不擋操作:存過這台電腦的資料,打開 App 就用上次的內容進去,不等網路,連上後只補變了的;浮著提示「離線中:顯示的是上次的內容」,拿到就消失。只有第一次(還沒有這台的資料)停在連線畫面:打開 App 時的頭像留在正中間呼吸、外圈漾開,不顯示文字(讀螢幕軟體唸「正在連線」;減少動態時不動),第一份狀態到手才進去。用帳號連、那台不在線上時留在它上次的內容裡,不換到別台。進去之後斷線:浮「連線中斷,正在重新連線…」,自己重試,回到前景或網路恢復時立刻重連。設定、詳細、例行任務先畫手上有的,背景讀新的;要改的先讀到最新的。傳訊息不等網路:按下就出現在聊天裡;連不上標「等連線後送出(點一下拿回來)」,存手機排隊(關 App 也還在),連上後照順序自己送、不限時間,同一則只送一次;點一下連同附件拿回輸入框;連不上時選的附件也排隊。大腦拒收的才標「沒送出,點一下拿回來重送」。從通知打開時按的允許/拒絕等連上才送。只傳有變的部分、文字壓縮;Bot 回答中手機每秒最多更新一次聊天(見 [chat](chat.md) 的開聊天分頁)。頁面和圖示存在手機上:打開直接用,背景問一次換版沒;換了,還在連線畫面就重新載入,已進去就等退到背景、手上沒東西(沒打字、附件、排隊、錄音、選單)才換;重新整理一定先問伺服器。上次的狀態、看過的聊天(合計最多 12 個)、詳細資料、設定、排隊的訊息每台電腦各自存在這個網址的儲存空間,登出(或登入失效)全部清掉。
- `phone-app` 像 App 一樣:加入主畫面後全螢幕、沒有網址列(瀏海、動態島、底部手勢條、橫放都避開);首頁會提示「把 AnyBot 裝成 App」(Android 直接安裝,iPhone 教你加入主畫面,可以關掉);換畫面會左右滑動;iPhone 主畫面 App 從左邊緣往右滑回上一頁。 - `phone-app` 像 App 一樣:加入主畫面後全螢幕、沒有網址列(避開瀏海和手勢條);首頁會提示「把 AnyBot 裝成 App」(Android 直接安裝,iPhone 教你加入主畫面,可以關掉);換畫面會左右滑動;iPhone 主畫面 App 從左邊緣往右滑回上一頁。
## 使用者怎麼到 ## 使用者怎麼到

View File

@ -13,7 +13,7 @@
- Bot 選單(右鍵側邊欄的 Bot,或聊天右上角「更多」)›「編輯 Bot…」;或在右側面板點 Bot 的大頭像。視窗第一張卡是「Bot 資料」(頭像、名稱、描述),和下面的卡片同一種排版。 - Bot 選單(右鍵側邊欄的 Bot,或聊天右上角「更多」)›「編輯 Bot…」;或在右側面板點 Bot 的大頭像。視窗第一張卡是「Bot 資料」(頭像、名稱、描述),和下面的卡片同一種排版。
- 在聊天裡請 Bot 改自己(「把你的檔案與指令能力關掉」)。 - 在聊天裡請 Bot 改自己(「把你的檔案與指令能力關掉」)。
- 手機:聊天標題 › 對話詳細資訊 › 右上角「Bot 設定」,沒有自訂色盤([phone](phone.md))。 - 手機:聊天標題 › 對話詳細資訊 › 右上角「Bot 設定」,沒有自訂色盤([phone](phone.md));「AI 與電腦」有「執行步驟用的模型」(自動/不分開/同一家的其他模型)和「思考模式」(自動、快速、平衡、深入),跟電腦一樣。
## 怎麼操作(verify-anybot) ## 怎麼操作(verify-anybot)

View File

@ -11,7 +11,7 @@
- Bot:時區,例行任務和提醒用([routines](routines.md))。 - Bot:時區,例行任務和提醒用([routines](routines.md))。
- 帳戶:「登入」或「管理帳戶」打開「手機與帳號」頁;資料放在哪。 - 帳戶:「登入」或「管理帳戶」打開「手機與帳號」頁;資料放在哪。
- `settings-whose` 左下角(你的名字):名字下面一行寫 Bot 在哪一台——「這台電腦」,或「大腦「名字」」(綠點連得到、灰點連不到)。點一下開「Bot 在哪一台」選單:「這台電腦(這台的名字)」、帳號裡每台可以當大腦的電腦(現在用的打勾,離線的灰、不能點),點一下就換——跟「手機與帳號」頁大腦那一欄的「改用它當大腦」「改回用這台自己的 Bot」一樣([account](account.md));沒登入帳號多一行「登入帳號,才能換到別台大腦…」;分隔線下「所有檔案…」([library](library.md))、「個人資料與用量…」、「設定…」(⌘, 也可以)。 - `settings-whose` 左下角(你的名字):名字下面一行寫 Bot 在哪一台——「這台電腦」,或「大腦「名字」」(綠點連得到、灰點連不到)。點一下開「Bot 在哪一台」選單:「這台電腦(這台的名字)」、帳號裡每台可以當大腦的電腦(現在用的打勾,離線的灰、不能點),點一下就換——跟「手機與帳號」頁大腦那一欄的「改用它當大腦」「改回用這台自己的 Bot」一樣([account](account.md));沒登入帳號多一行「登入帳號,才能換到別台大腦…」;分隔線下「所有檔案…」([library](library.md))、「個人資料與用量…」、「設定…」(⌘, 也可以)。
- `settings-me` 「個人資料」:名字、過去一年有幾個活躍日;一條沒有框的數字列——Token・一年(不算快取命中)、訊息・一年、連續使用(今天還沒用不算斷)、最長連續,細節在滑過;「活動」一年的熱度格子(一週一欄、越忙顏色越深,滑過看日期、token、訊息數),旁邊一行「最活躍:日期・token」;「用量」選 7 天/30 天/90 天/一年:一個大數字 token(滑過看新讀、寫、快取讀到)、呼叫次數和花費(模型服務回報的,沒回報寫「未定價」,不是 0 元)、每天一條長條,再切「依模型」(一條彩色比例條,每個模型有服務的圖案)或「依 Bot」(頭像和長條),各寫 token 和百分比。左下角選單也有「個人資料與用量…」。螢幕電腦上算的是大腦的(向大腦要);手機和螢幕的路是 `api/stats`、`api/sync/stats`(擁有者才有)。 - `settings-me` 「個人資料」:名字、過去一年有幾個活躍日;一條沒有框的數字列——Token・一年(不算快取命中)、訊息・一年、連續使用(今天還沒用不算斷)、最長連續,細節在滑過;「活動」一年的熱度格子(一週一欄、越忙顏色越深,滑過看日期、token、訊息數),旁邊一行「最活躍:日期・token」;「用量」選 7 天/30 天/90 天/一年:一個大數字 token(滑過看新讀、寫、快取讀到)、呼叫次數和花費(模型服務回報的,沒回報寫「未定價」,不是 0 元)、每天一條長條,再切「依模型」(一條彩色比例條,每個模型有服務的圖案)或「依 Bot」(頭像和長條),各寫 token 和百分比。左下角選單也有「個人資料與用量…」。手機 設定 ›「個人資料與用量」同一套(擁有者才有)。螢幕電腦上算的是大腦的(向大腦要);手機和螢幕的路是 `api/stats`、`api/sync/stats`(擁有者才有)。
- `settings-search` 「搜尋設定…」(左欄最上面):打字時頁面清單換成符合的設定(最多 12 個),標題開頭相符的在前,再來標題包含的,再來所在區塊或別的說法(「深色」找到「主題」、「billing」找到「用量」;模型供應商用名字找);每個下面寫在哪(「一般 › Bot」)。點一個或按 Enter 拿第一個:換到那一頁(整合的小分頁、市集、收起來的「更多外觀設定」會跟著打開)、捲到那一列,外框用強調色亮一下(約 2 秒淡掉);Esc 清空。 - `settings-search` 「搜尋設定…」(左欄最上面):打字時頁面清單換成符合的設定(最多 12 個),標題開頭相符的在前,再來標題包含的,再來所在區塊或別的說法(「深色」找到「主題」、「billing」找到「用量」;模型供應商用名字找);每個下面寫在哪(「一般 › Bot」)。點一個或按 Enter 拿第一個:換到那一頁(整合的小分頁、市集、收起來的「更多外觀設定」會跟著打開)、捲到那一列,外框用強調色亮一下(約 2 秒淡掉);Esc 清空。
- `settings-account` 「手機與帳號」頁(從 一般 › 帳戶 進去,[account](account.md)):「AnyBot 帳號」(登入、備份、還原)、大腦和「加一台電腦」([computers](computers.md))、「同一個網路直接連」、「手機可以做什麼」、「直接連線的裝置」、「分享給團隊」([team](team.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-models` 「模型」:先是每家 AI 供應商一塊圖塊(自己的圖案、名字、「可以用」或「還沒設定」、雲端/本機),點一塊進去、上面「‹ 模型」回來;裡面是 API 金鑰、服務網址、新 Bot 預設模型、「測試連線並取得模型清單」([models](models.md));本機或區網的供應商多「看不到圖時,請雲端模型看截圖和附件」(預設關,[chat](chat.md))。「ChatGPT 方案」沒有金鑰和網址欄,改成「ChatGPT 帳號」:登入狀態、「使用 ChatGPT 繼續」「登出」「換帳號」「打開登入頁」「管理用量」;連到別台大腦時多一格貼回登入網址和「完成登入」。

View File

@ -165,6 +165,9 @@ details.dt>.dt-in{padding-left:var(--sp-4);margin-top:var(--sp-2)}
.tk-a :is(h2,h3,h4){font-size:var(--fs-ui);margin:.8em 0 .3em} .tk-a :is(h2,h3,h4){font-size:var(--fs-ui);margin:.8em 0 .3em}
:is(.bub,.page,.tk-a) code{font-family:var(--mono);font-size:var(--fs-small);background:var(--hover);padding:1px 5px;border-radius:var(--r-s)} :is(.bub,.page,.tk-a) code{font-family:var(--mono);font-size:var(--fs-small);background:var(--hover);padding:1px 5px;border-radius:var(--r-s)}
:is(.bub,.page,.tk-a) pre{margin:0 0 .75em;padding:var(--sp-3) var(--sp-4);border-radius:var(--r-m);background:var(--hover);overflow-x:auto;font:var(--fs-small)/1.55 var(--mono)} :is(.bub,.page,.tk-a) pre{margin:0 0 .75em;padding:var(--sp-3) var(--sp-4);border-radius:var(--r-m);background:var(--hover);overflow-x:auto;font:var(--fs-small)/1.55 var(--mono)}
/* 複製程式碼: a small button on each code block (the whole message's 複製 is in its menu). */
pre.cb{position:relative}
pre.cb .cpy{position:absolute;top:4px;right:4px;width:30px;height:30px;border-radius:var(--r-s);display:grid;place-items:center;color:var(--text3);background:var(--elev);opacity:.85}
:is(.bub,.page,.tk-a) pre code{background:none;padding:0;border-radius:0;font:inherit} :is(.bub,.page,.tk-a) pre code{background:none;padding:0;border-radius:0;font:inherit}
:is(.bub,.page,.tk-a) blockquote{margin:0 0 .75em;padding-left:var(--sp-3);border-left:2px solid var(--line);color:var(--text2)} :is(.bub,.page,.tk-a) blockquote{margin:0 0 .75em;padding-left:var(--sp-3);border-left:2px solid var(--line);color:var(--text2)}
:is(.bub,.page,.tk-a) hr{border:0;border-top:1px solid var(--line);margin:var(--sp-5) 0} :is(.bub,.page,.tk-a) hr{border:0;border-top:1px solid var(--line);margin:var(--sp-5) 0}
@ -577,6 +580,28 @@ textarea.field{min-height:96px;line-height:1.5}
.tools .btn.once{background:color-mix(in srgb,var(--accent) 18%,transparent);color:var(--accent-ink)} .tools .btn.once{background:color-mix(in srgb,var(--accent) 18%,transparent);color:var(--accent-ink)}
.tools .btn.lock{background:var(--accent);color:var(--on-color)} .tools .btn.lock{background:var(--accent);color:var(--on-color)}
.tools .btn.on{background:var(--primary);color:var(--on-primary)} .tools .btn.on{background:var(--primary);color:var(--on-primary)}
/* 個人資料與用量: one strip of big numbers, the year's dots, a big number and bars. */
.me-figs{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:var(--sp-3) var(--sp-4) 0;padding:var(--sp-3) var(--sp-2);background:var(--elev);border-radius:var(--r-l)}
.me-figs div{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
.me-figs b{font-size:var(--fs-h3);font-weight:600;white-space:nowrap}
.me-figs span{font-size:var(--fs-caption);color:var(--text3);white-space:nowrap}
.me-card{margin:0 var(--sp-4);padding:var(--sp-3) var(--sp-4);background:var(--elev);border-radius:var(--r-l)}
.me-heat{width:100%;height:auto;display:block}
.me-note{font-size:var(--fs-caption);color:var(--text3);margin-top:var(--sp-2);line-height:1.5}
.me-seg{display:flex;gap:2px;padding:3px;background:var(--active);border-radius:999px;margin:var(--sp-1) 0 var(--sp-3)}
.me-seg button{flex:1;height:30px;border-radius:999px;font-size:var(--fs-small);color:var(--text2)}
.me-seg button.on{background:var(--elev);color:var(--text);font-weight:600}
.me-hero{font-size:var(--fs-small);color:var(--text3)}
.me-hero b{font-size:var(--fs-h1);font-weight:600;color:var(--text);margin-right:4px}
.me-bars{width:100%;height:84px;display:block;margin:var(--sp-3) 0 var(--sp-4);border-bottom:1px solid var(--grid)}
.me-split{display:flex;height:10px;border-radius:999px;overflow:hidden;background:var(--hover);margin-bottom:var(--sp-2)}
.me-split i{display:block;height:100%}
.me-row{display:flex;align-items:center;gap:10px;min-height:36px}
.me-dot{width:8px;height:8px;border-radius:50%;flex:none}
.me-av{width:22px;height:22px;flex:none;display:grid}.me-av svg{width:22px;height:22px}
.me-name{flex:1;min-width:0;font-size:var(--fs-small);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me-bar{width:70px;height:6px;border-radius:999px;background:var(--hover);overflow:hidden;flex:none}.me-bar i{display:block;height:100%;background:var(--accent)}
.me-n{font-size:var(--fs-small);color:var(--text2);white-space:nowrap}
/* 虛擬觸控板 over this Mac's screen: a layer that takes the fingers, and the pointer drawn on it. */ /* 虛擬觸控板 over this Mac's screen: a layer that takes the fingers, and the pointer drawn on it. */
.stagewrap{flex:1;min-height:0;position:relative;display:flex} .stagewrap{flex:1;min-height:0;position:relative;display:flex}
.pad{position:absolute;inset:0;display:none;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none} .pad{position:absolute;inset:0;display:none;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
@ -1419,7 +1444,7 @@ function mergeState(prev, v) {
} }
function apply(v) { function apply(v) {
S.bots = v.bots || []; S.approvals = v.approvals || []; S.hostName = v.host || ""; S.mac = !!v.mac; S.bots = v.bots || []; S.approvals = v.approvals || []; S.hostName = v.host || ""; S.mac = !!v.mac;
S.box = v.box || ""; S.boxOn = !!v.box_available; S.pages = v.pages || []; S.tasks = v.tasks || []; S.models = v.models || []; S.sections = v.sections || null; S.role = v.role || "owner"; S.box = v.box || ""; S.boxOn = !!v.box_available; S.pages = v.pages || []; S.tasks = v.tasks || []; S.models = v.models || []; S.sections = v.sections || null; S.pinOrder = v.pin_order || null; S.role = v.role || "owner";
S.voice = v.voice || {}; micShown(); appBadge(); S.voice = v.voice || {}; micShown(); appBadge();
// The computer's 外觀 (an older brain sends neither: the built-in look stays). // The computer's 外觀 (an older brain sends neither: the built-in look stays).
if (v.palettes) applyPalette(v.palettes); if (v.palettes) applyPalette(v.palettes);
@ -1467,8 +1492,43 @@ function apply(v) {
// ---------- home: the sidebar ---------- // ---------- home: the sidebar ----------
$("b-search").innerHTML = ic("search", 20); $("b-newbot").innerHTML = ic("plus", 22); $("search-ic").innerHTML = ic("search", 16); $("b-search-x").innerHTML = ic("x", 16); $("b-search").innerHTML = ic("search", 20); $("b-newbot").innerHTML = ic("plus", 22); $("search-ic").innerHTML = ic("search", 16); $("b-search-x").innerHTML = ic("x", 16);
$("b-search").onclick = () => { $("searchbox").classList.add("on"); $("search").focus(); }; $("b-search").onclick = () => { $("searchbox").classList.add("on"); $("search").focus(); };
$("b-search-x").onclick = () => { $("search").value = ""; S.search = ""; $("searchbox").classList.remove("on"); renderHome(); }; $("b-search-x").onclick = () => { $("search").value = ""; S.search = ""; S.hits = null; $("searchbox").classList.remove("on"); renderHome(); };
$("search").oninput = () => { S.search = $("search").value.trim().toLowerCase(); renderHome(); }; // 搜尋 finds bots by name, and (the owner's) words in every chat — past conversations and file
// names too — as on the computer: a tap opens that chat at that message.
let searchTimer = 0, searchSeq = 0;
$("search").oninput = () => {
S.search = $("search").value.trim().toLowerCase();
S.hits = null; clearTimeout(searchTimer);
if (S.search && owner()) searchTimer = setTimeout(searchChats, 300);
renderHome();
};
async function searchChats() {
const q = S.search, seq = ++searchSeq;
const v = await act("search", {q: $("search").value.trim()}, false);
if (seq !== searchSeq || q !== S.search) return;
S.hits = v || {hits: [], more: false};
renderHome();
}
function hitsHtml() {
if (!S.search || !S.hits) return "";
const hits = S.hits.hits || [];
if (!hits.length) return `<div class="empty" style="padding-top:12px">聊天裡也沒有找到</div>`;
return `<div class="sec">${ic("message", 13)}聊天裡 <span class="n">${hits.length}${S.hits.more ? "+" : ""}</span></div><div class="rows">${hits.map((h, i) => {
const b = bot(h.bot) || {};
const where = h.thread != null ? `<span class="pill">過去的對話</span>` : "";
const what = (h.file ? "📎 " + h.file + " " : "") + (h.snippet || "");
return `<div class="row" data-hit="${i}"><div class="av">${avatarSvg(b.shape, b.color)}</div><div class="mid"><div class="nm"><span class="t">${esc(h.bot_name || b.name || "")}</span>${where}</div><div class="pv">${esc(what)}</div></div><div class="tm">${ago(h.at)}</div></div>`;
}).join("")}</div>`;
}
async function openHit(i) {
const h = ((S.hits || {}).hits || [])[i];
if (!h) return;
if (h.thread != null) {
if (!await confirmSheet("回到這段對話?", `「${h.thread_title || "對話"}」會換回來,現在的對話留在「過去的對話」裡。`, "回到這段對話", false)) return;
try { await api(base() + `api/bots/${h.bot}/restore`, {json: {index: h.thread}}); } catch (e) { toast(e.message); return; }
}
go("chat", {bot: h.bot, at: h.at});
}
function botState(b) { function botState(b) {
const waiting = S.approvals.find((a) => a.bot === b.id); const waiting = S.approvals.find((a) => a.bot === b.id);
if (waiting) return {cls: "wait", dot: "wait", text: waiting.kind === "question" ? "等你回答:" + waiting.reason : "等你處理:" + (waiting.kind === "handoff" ? waiting.reason : waiting.title)}; if (waiting) return {cls: "wait", dot: "wait", text: waiting.kind === "question" ? "等你回答:" + waiting.reason : "等你處理:" + (waiting.kind === "handoff" ? waiting.reason : waiting.title)};
@ -1502,10 +1562,16 @@ function renderHome() {
$("b-newbot").style.display = isOwner() ? "" : "none"; $("b-newbot").style.display = isOwner() ? "" : "none";
$("quick").querySelectorAll("[data-q]").forEach((b) => b.onclick = () => go("list", {kind: b.dataset.q})); $("quick").querySelectorAll("[data-q]").forEach((b) => b.onclick = () => go("list", {kind: b.dataset.q}));
if (!S.bots.length) { $("home").innerHTML = `<div class="empty">還沒有 Bot。按右上角的 + 建立第一個。</div>`; return; } if (!S.bots.length) { $("home").innerHTML = `<div class="empty">還沒有 Bot。按右上角的 + 建立第一個。</div>`; return; }
if (!bots.length) { $("home").innerHTML = `<div class="empty">沒有相符的 Bot</div>`; return; } if (!bots.length) {
$("home").innerHTML = (q && S.hits && (S.hits.hits || []).length ? "" : `<div class="empty">${q && owner() && !S.hits ? "找找看聊天裡…" : "沒有相符的 Bot"}</div>`) + hitsHtml();
$("home").querySelectorAll("[data-hit]").forEach((r) => r.onclick = () => openHit(+r.dataset.hit));
return;
}
// The sidebar's sections: 主要 Bot, 已釘選的 Bot, the person's own sections, then Bot. // The sidebar's sections: 主要 Bot, 已釘選的 Bot, the person's own sections, then Bot.
const primary = bots.filter((b) => b.primary); const primary = bots.filter((b) => b.primary);
const pinned = bots.filter((b) => !b.primary && b.pinned); // (In the desktop's order, which the owner can change from a bot's ⋯ › 更多.)
const pinAt = (b) => { const i = (S.pinOrder || []).indexOf(b.id); return i < 0 ? 1e9 : i; };
const pinned = bots.filter((b) => !b.primary && b.pinned).sort((a, b) => pinAt(a) - pinAt(b));
const rest = bots.filter((b) => !b.primary && !b.pinned); const rest = bots.filter((b) => !b.primary && !b.pinned);
// The desktop's 分區 in its order (null = 未分區), empty ones too. // The desktop's 分區 in its order (null = 未分區), empty ones too.
const order = S.sections || [...new Set(rest.map((b) => b.folder).filter(Boolean)), null]; const order = S.sections || [...new Set(rest.map((b) => b.folder).filter(Boolean)), null];
@ -1517,7 +1583,8 @@ function renderHome() {
if (f == null) h += sec(folders.length ? "未分區" : "Bot", "", rest.filter((b) => !folders.includes(b.folder)), folders.length ? "loose" : ""); if (f == null) h += sec(folders.length ? "未分區" : "Bot", "", rest.filter((b) => !folders.includes(b.folder)), folders.length ? "loose" : "");
else h += sec(f, "folder", rest.filter((b) => b.folder === f), "f:" + f, isOwner() ? `<button data-fmenu="${esc(f)}" style="margin-left:auto">${ic("ellipsis", 15)}</button>` : "", !q); else h += sec(f, "folder", rest.filter((b) => b.folder === f), "f:" + f, isOwner() ? `<button data-fmenu="${esc(f)}" style="margin-left:auto">${ic("ellipsis", 15)}</button>` : "", !q);
} }
$("home").innerHTML = h + `<div style="height:calc(var(--safe-b) + 24px)"></div>`; $("home").innerHTML = h + hitsHtml() + `<div style="height:calc(var(--safe-b) + 24px)"></div>`;
$("home").querySelectorAll("[data-hit]").forEach((r) => r.onclick = () => openHit(+r.dataset.hit));
$("home").querySelectorAll(".row[data-bot]").forEach((r) => { $("home").querySelectorAll(".row[data-bot]").forEach((r) => {
r.onclick = (e) => { if (e.target.closest("[data-botmenu]")) return; go("chat", {bot: +r.dataset.bot}); }; r.onclick = (e) => { if (e.target.closest("[data-botmenu]")) return; go("chat", {bot: +r.dataset.bot}); };
let t = null; r.addEventListener("touchstart", () => { t = setTimeout(() => { t = "long"; botMenu(+r.dataset.bot); }, 520); }, {passive: true}); let t = null; r.addEventListener("touchstart", () => { t = setTimeout(() => { t = "long"; botMenu(+r.dataset.bot); }, 520); }, {passive: true});
@ -1529,6 +1596,8 @@ function renderHome() {
e.stopPropagation(); e.stopPropagation();
const f = b.dataset.fmenu; const f = b.dataset.fmenu;
sheet(f, [ sheet(f, [
{icon: "arrow-up", label: "往上移", on: () => act("section_move", {folder: f, by: -1}, false)},
{icon: "arrow-down", label: "往下移", on: () => act("section_move", {folder: f, by: 1}, false)},
{icon: "pen", label: "重新命名分區", on: async () => { const n = await ask("分區名稱", f); if (n && n !== f) app("rename_group", {group: f, new_name: n}); }}, {icon: "pen", label: "重新命名分區", on: async () => { const n = await ask("分區名稱", f); if (n && n !== f) app("rename_group", {group: f, new_name: n}); }},
{icon: "trash", label: "刪除分區", danger: true, on: async () => { if (await confirmSheet(`刪除分區「${f}」?`, "裡面的 Bot 會移到未分區,不會刪除任何 Bot。", "刪除分區")) app("delete_group", {group: f}); }}, {icon: "trash", label: "刪除分區", danger: true, on: async () => { if (await confirmSheet(`刪除分區「${f}」?`, "裡面的 Bot 會移到未分區,不會刪除任何 Bot。", "刪除分區")) app("delete_group", {group: f}); }},
]); ]);
@ -1546,6 +1615,13 @@ function botMenu(id) {
// 團隊: whether teammates may use this bot (they see its chat, pages and files). // 團隊: whether teammates may use this bot (they see its chat, pages and files).
if (isOwner() && !b.members) more.push({icon: "users", label: b.team ? "不再分享給團隊成員" : "分享給團隊成員", on: () => act("bot", {bot: id, key: "team", value: !b.team}, b.team ? "團隊成員看不到這個 Bot 了" : "團隊成員現在可以使用這個 Bot")}); if (isOwner() && !b.members) more.push({icon: "users", label: b.team ? "不再分享給團隊成員" : "分享給團隊成員", on: () => act("bot", {bot: id, key: "team", value: !b.team}, b.team ? "團隊成員看不到這個 Bot 了" : "團隊成員現在可以使用這個 Bot")});
if (!b.primary && isOwner()) more.push({icon: "star", label: "設為主要 Bot", on: () => act("bot", {bot: id, key: "primary", value: true}, "已設為主要 Bot")}); if (!b.primary && isOwner()) more.push({icon: "star", label: "設為主要 Bot", on: () => act("bot", {bot: id, key: "primary", value: true}, "已設為主要 Bot")});
// 已釘選的 Bot in another order (the desktop drags them; here one step at a time).
const pins = (S.pinOrder || []).filter((x) => { const y = bot(x); return y && y.pinned && !y.primary; });
const at = pins.indexOf(id);
if (isOwner() && b.pinned && at > 0) more.push({icon: "arrow-up", label: "釘選裡往前移", on: () => act("bot", {bot: id, key: "pin_at", value: at - 1}, false)});
if (isOwner() && b.pinned && at >= 0 && at < pins.length - 1) more.push({icon: "arrow-down", label: "釘選裡往後移", on: () => act("bot", {bot: id, key: "pin_at", value: at + 1}, false)});
// 分享: the bot as a file (another AnyBot imports it), or this chat as Markdown.
if (isOwner()) more.push({icon: "share", label: "匯出 Bot 檔案(.anybot)", on: () => exportAs("export_bot", id)});
more.push({icon: "refresh", label: "重新啟動這個 Bot", on: () => act("restart_bot", {bot: id})}); more.push({icon: "refresh", label: "重新啟動這個 Bot", on: () => act("restart_bot", {bot: id})});
items.push({icon: "ellipsis", label: "更多…", on: () => sheet(b.name, more)}); items.push({icon: "ellipsis", label: "更多…", on: () => sheet(b.name, more)});
if (isOwner()) items.push({sep: true}, {icon: "trash", label: "刪除 Bot", danger: true, on: () => deleteBot(b)}); if (isOwner()) items.push({sep: true}, {icon: "trash", label: "刪除 Bot", danger: true, on: () => deleteBot(b)});
@ -1573,8 +1649,36 @@ $("b-newbot").onclick = async () => {
{icon: "sparkles", label: "從範本建立", on: templates}, {icon: "sparkles", label: "從範本建立", on: templates},
{icon: "users", label: "建立群組聊天", on: groupChat}, {icon: "users", label: "建立群組聊天", on: groupChat},
{icon: "folder", label: "新增分區", on: async () => { const n = await ask("新增分區", "", "例如:文宣組"); if (n) app("create_group", {name: n}); }}, {icon: "folder", label: "新增分區", on: async () => { const n = await ask("新增分區", "", "例如:文宣組"); if (n) app("create_group", {name: n}); }},
{icon: "download", label: "匯入 Bot 檔案(.anybot)", on: importBot},
]); ]);
}; };
// A file the brain made (a bot, a transcript): saved on the phone — the share sheet where there
// is one (iPhone: 儲存到檔案, AirDrop…), else a download.
async function exportAs(what, id) {
const v = await act(what, {bot: id}, false);
if (!v || !v.content) return;
const file = new File([v.content], v.filename || "AnyBot.txt", {type: what === "export_bot" ? "application/json" : "text/markdown"});
try { if (navigator.canShare && navigator.canShare({files: [file]})) { await navigator.share({files: [file]}); return; } } catch (e) { if (e.name === "AbortError") return; }
const a = document.createElement("a"); a.href = URL.createObjectURL(file); a.download = file.name; document.body.appendChild(a); a.click(); a.remove();
setTimeout(() => URL.revokeObjectURL(a.href), 4000);
toast("已存成「" + file.name + "」");
}
async function saveText(text, name) {
const file = new File([text], name, {type: "text/markdown"});
try { if (navigator.canShare && navigator.canShare({files: [file]})) { await navigator.share({files: [file]}); return; } } catch (e) { if (e.name === "AbortError") return; }
const a = document.createElement("a"); a.href = URL.createObjectURL(file); a.download = name; document.body.appendChild(a); a.click(); a.remove();
setTimeout(() => URL.revokeObjectURL(a.href), 4000);
toast("已存成「" + name + "」");
}
function importBot() {
const pick = document.createElement("input"); pick.type = "file"; pick.accept = ".anybot,application/json";
pick.onchange = async () => {
const f = pick.files && pick.files[0]; if (!f) return;
const v = await act("import_bot", {content: await f.text()}, false);
if (v && v.ok !== false) { toast(v.text || "已匯入"); newBotDone(v); }
};
pick.click();
}
function newBotDone(v) { if (v && v.bot) setTimeout(() => go("chat", {bot: v.bot}), 400); } function newBotDone(v) { if (v && v.bot) setTimeout(() => go("chat", {bot: v.bot}), 400); }
async function templates() { async function templates() {
if (!S.settings) await loadSettings(); if (!S.settings) await loadSettings();
@ -1707,9 +1811,23 @@ function keepChat(id, msgs, sig) {
CHATS.delete(k); CHATS.set(k, was && was.sig === sig && Date.now() - (was.t || 0) <= 3600000 ? was : c); CHATS.delete(k); CHATS.set(k, was && was.sig === sig && Date.now() - (was.t || 0) <= 3600000 ? was : c);
while (CHATS.size > 12) { const old = CHATS.keys().next().value; CHATS.delete(old); KEEP.del("chat:" + old); } while (CHATS.size > 12) { const old = CHATS.keys().next().value; CHATS.delete(old); KEEP.del("chat:" + old); }
} }
// What was typed and not sent stays with its bot, as on the computer: switching bots, or closing
// the page, does not lose it (kept on this phone, per AnyBot).
const draftKey = () => "anybot.drafts:" + (S.host || "lan");
function drafts() { try { return JSON.parse(localStorage.getItem(draftKey()) || "{}"); } catch (_) { return {}; } }
function keepDraft(id, text) {
if (!id) return;
const d = drafts();
if (text && text.trim()) d[id] = text; else delete d[id];
try { localStorage.setItem(draftKey(), JSON.stringify(d)); } catch (_) {}
}
function openChat(id, at) { function openChat(id, at) {
S.jumpAt = at || 0; S.jumpAt = at || 0;
if (S.open !== id) { if (S.open !== id) {
// (The box by id: this can run before the script below has named it.)
const box = $("input");
keepDraft(S.open, box.value);
box.value = drafts()[id] || ""; box.style.height = "auto"; setTimeout(() => box.dispatchEvent(new Event("input")), 0);
keepChat(S.open, S.msgs, S.chatSig); keepChat(S.open, S.msgs, S.chatSig);
S.msgs = []; S.pending = []; S.quote = null; S.unfold = {}; S.openSteps = {}; S.chatSig = ""; S.prevShown = 0; S.prevFirst = ""; MODE_OPEN = ""; $("msgs").innerHTML = ""; S.msgs = []; S.pending = []; S.quote = null; S.unfold = {}; S.openSteps = {}; S.chatSig = ""; S.prevShown = 0; S.prevFirst = ""; MODE_OPEN = ""; $("msgs").innerHTML = "";
const kept = CHATS.get(chatKey(id)); const kept = CHATS.get(chatKey(id));
@ -1758,7 +1876,7 @@ async function loadChat(jump) {
loading = false; loading = false;
if (again) { again = false; loadChat(); } if (again) { again = false; loadChat(); }
// 任務 → a message older than what the phone keeps of the chat: the chat stays at its end. // 任務 → a message older than what the phone keeps of the chat: the chat stays at its end.
else if (S.jumpAt && S.chatLoaded && S.open === id && !jumpTo()) { S.jumpAt = 0; toast("那件事開頭的訊息太早了,手機上只留最近的訊息"); } else if (S.jumpAt && S.chatLoaded && S.open === id && !jumpTo()) { S.jumpAt = 0; toast("那則訊息太早了,手機上只留最近的訊息"); }
} }
// 載入更早:開頁只拿最新 30 條,這裡一次往回補 60 條(序號去重,接在上方)——從大腦上整段聊天拿, // 載入更早:開頁只拿最新 30 條,這裡一次往回補 60 條(序號去重,接在上方)——從大腦上整段聊天拿,
// 不只手機那份最新的。按了一定有回應:載入中、補上了、或「已是對話最開頭」(按鈕收起來)。 // 不只手機那份最新的。按了一定有回應:載入中、補上了、或「已是對話最開頭」(按鈕收起來)。
@ -2194,6 +2312,7 @@ function selectSheet(i, m) {
el.scrollTop = 0; el.scrollTop = 0;
} }
async function copyText(t) { try { await navigator.clipboard.writeText(t || ""); toast("已複製"); } catch (_) { toast("這支手機不讓網頁複製"); } } async function copyText(t) { try { await navigator.clipboard.writeText(t || ""); toast("已複製"); } catch (_) { toast("這支手機不讓網頁複製"); } }
document.addEventListener("click", (e) => { const b = e.target.closest("[data-copycode]"); if (!b) return; e.stopPropagation(); copyText((b.parentElement.querySelector("code") || {}).textContent || ""); }, true);
const QUICK = ["👍", "❤️", "😂", "🎉", "👀", "🙏", "👌", "🔥"]; const QUICK = ["👍", "❤️", "😂", "🎉", "👀", "🙏", "👌", "🔥"];
function msgMenu(i) { function msgMenu(i) {
const m = S.msgs[i]; if (!m) return; const m = S.msgs[i]; if (!m) return;
@ -2349,6 +2468,7 @@ function renderQuote() {
if (q) $("q-x").onclick = () => { S.quote = null; renderQuote(); }; if (q) $("q-x").onclick = () => { S.quote = null; renderQuote(); };
} }
const input = $("input"); const input = $("input");
input.addEventListener("input", () => { clearTimeout(S.draftTimer); S.draftTimer = setTimeout(() => keepDraft(S.open, input.value), 400); });
input.addEventListener("input", () => { input.addEventListener("input", () => {
input.style.height = "auto"; input.style.height = Math.min(input.scrollHeight, 140) + "px"; input.style.height = "auto"; input.style.height = Math.min(input.scrollHeight, 140) + "px";
$("composer").classList.toggle("tall", input.scrollHeight > 40); renderSendBtn(); $("composer").classList.toggle("tall", input.scrollHeight > 40); renderSendBtn();
@ -2493,7 +2613,7 @@ async function send() {
memReset(); memReset();
// (A command takes no file that isn't up yet: those stay above the input for the next message.) // (A command takes no file that isn't up yet: those stay above the input for the next message.)
const had = S.pending; S.pending = quiet ? S.pending.filter((p) => p.blob) : []; const had = S.pending; S.pending = quiet ? S.pending.filter((p) => p.blob) : [];
input.value = ""; input.style.height = "auto"; $("composer").classList.remove("tall"); renderChips(); renderSlash(); input.value = ""; keepDraft(S.open, ""); input.style.height = "auto"; $("composer").classList.remove("tall"); renderChips(); renderSlash();
// A command (not words for the chat): sent now, or said that it couldn't be (its words and files back). // A command (not words for the chat): sent now, or said that it couldn't be (its words and files back).
if (quiet) { try { await deliver(base() + `api/bots/${S.open}/send`, {text, attachments}); loadChat(); } catch (e) { toast(e.message); if (!input.value) { input.value = text; input.dispatchEvent(new Event("input")); } S.pending = [...had.filter((p) => !S.pending.includes(p)), ...S.pending]; renderChips(); } return; } if (quiet) { try { await deliver(base() + `api/bots/${S.open}/send`, {text, attachments}); loadChat(); } catch (e) { toast(e.message); if (!input.value) { input.value = text; input.dispatchEvent(new Event("input")); } S.pending = [...had.filter((p) => !S.pending.includes(p)), ...S.pending]; renderChips(); } return; }
// 先顯示: in the chat at once, network or not; it goes when the line is there (kept on this // 先顯示: in the chat at once, network or not; it goes when the line is there (kept on this
@ -2660,6 +2780,7 @@ $("b-chatmore").onclick = () => {
{icon: "info", label: "對話詳細資訊", on: () => go("details", {bot: b.id})}, {icon: "info", label: "對話詳細資訊", on: () => go("details", {bot: b.id})},
{icon: "history", label: "過去的對話", x: String((b.threads || []).length || ""), on: () => threads(b)}, {icon: "history", label: "過去的對話", x: String((b.threads || []).length || ""), on: () => threads(b)},
{icon: "copy", label: "複製整段對話", on: () => copyText(S.msgs.filter((m) => m.text && !m.summary).map((m) => (m.role === "user" ? "我:" : b.name + ":") + m.text).join("\n\n"))}, {icon: "copy", label: "複製整段對話", on: () => copyText(S.msgs.filter((m) => m.text && !m.summary).map((m) => (m.role === "user" ? "我:" : b.name + ":") + m.text).join("\n\n"))},
{icon: "download", label: "匯出文字記錄(.md)", on: () => exportAs("export_transcript", b.id)},
]; ];
if (owner()) items.splice(1, 0, {icon: "refresh", label: "重新產生上一個回答", on: regen}); if (owner()) items.splice(1, 0, {icon: "refresh", label: "重新產生上一個回答", on: regen});
if (isOwner()) items.push({icon: "settings", label: "Bot 設定", on: () => go("botset", {bot: b.id})}); if (isOwner()) items.push({icon: "settings", label: "Bot 設定", on: () => go("botset", {bot: b.id})});
@ -3063,7 +3184,11 @@ async function renderBotset(id) {
h += ticks("可以用的電腦", "may_use", (d.may_use || []).length > 1 ? d.may_use : [], "它自己的電腦一定可以用。"); h += ticks("可以用的電腦", "may_use", (d.may_use || []).length > 1 ? d.may_use : [], "它自己的電腦一定可以用。");
} }
h += `<div class="gt">頭像</div><div class="group"><div class="shapes">${(st.shapes || []).map((s) => `<button data-shape="${s}" class="${s === d.shape ? "on" : ""}">${avatarSvg(s, b.color)}</button>`).join("")}</div><div class="colors">${(st.colors || []).map((c) => `<button data-color="${c.key}" title="${esc(c.name)}" class="${c.key === d.color ? "on" : ""}" style="background:${c.hex}"></button>`).join("")}</div></div>`; h += `<div class="gt">頭像</div><div class="group"><div class="shapes">${(st.shapes || []).map((s) => `<button data-shape="${s}" class="${s === d.shape ? "on" : ""}">${avatarSvg(s, b.color)}</button>`).join("")}</div><div class="colors">${(st.colors || []).map((c) => `<button data-color="${c.key}" title="${esc(c.name)}" class="${c.key === d.color ? "on" : ""}" style="background:${c.hex}"></button>`).join("")}</div></div>`;
h += group("AI 與電腦", item({icon: "sparkles", k: "模型", v: b.via || b.model, r: b.runs || "", tap: 1, data: 'data-e="model"'}) + item({icon: "monitor", k: "做事的電腦", r: b.computer || "", tap: 1, data: 'data-e="comp"'}) + item({icon: "terminal", k: "電腦操作", v: S.settings && S.settings.direct_mode ? "直接操作開著:照樣可以用電腦(關掉直接操作才照這裡)" : "關掉時,用電腦前會先問你", sw: d.tools_enabled !== false, swdata: 'data-sw="tools"', disabled: !isOwner()}) + item({icon: "brain", k: "模型可讀長度", r: (CTX.find((c) => c[0] === d.context_tokens) || [0, Math.round((d.context_tokens || 0) / 1000) + "K"])[1], tap: 1, data: 'data-e="ctx"'})); // (As on the computer's Bot 設定: who carries out the planned steps, and how long it thinks.)
const EFFORTS = [["", "自動(模型自己決定)"], ["low", "快速(想得少,回得快)"], ["medium", "平衡"], ["high", "深入(想得久,較慢)"]];
const stepShown = !d.step_model ? "自動" : d.step_model === "off" ? "不分開" : d.step_model;
const extra = isOwner() ? item({icon: "zap", k: "執行步驟用的模型", v: "想計畫和確認用上面的模型;照計畫做的步驟交給這個比較快的", r: stepShown, tap: 1, data: 'data-e="step"'}) + item({icon: "lightbulb", k: "思考模式", r: (EFFORTS.find((e) => e[0] === (d.thinking || "")) || EFFORTS[0])[1].replace(/(.*)/, ""), tap: 1, data: 'data-e="think"'}) : "";
h += group("AI 與電腦", item({icon: "sparkles", k: "模型", v: b.via || b.model, r: b.runs || "", tap: 1, data: 'data-e="model"'}) + extra + item({icon: "monitor", k: "做事的電腦", r: b.computer || "", tap: 1, data: 'data-e="comp"'}) + item({icon: "terminal", k: "電腦操作", v: S.settings && S.settings.direct_mode ? "直接操作開著:照樣可以用電腦(關掉直接操作才照這裡)" : "關掉時,用電腦前會先問你", sw: d.tools_enabled !== false, swdata: 'data-sw="tools"', disabled: !isOwner()}) + item({icon: "brain", k: "模型可讀長度", r: (CTX.find((c) => c[0] === d.context_tokens) || [0, Math.round((d.context_tokens || 0) / 1000) + "K"])[1], tap: 1, data: 'data-e="ctx"'}));
if (isOwner()) h += group("已設定「一律允許」", (d.allow_rules || []).map((r) => `<div class="item">${ic("shield", 17)}<div class="mid"><div class="v" style="color:var(--text);font-size:var(--fs-ui)">${esc(r)}</div></div><button class="btn sm no" data-rule="${esc(r)}">移除</button></div>`).join("") || `<div class="note" style="padding:12px 16px">還沒有。在核准時選「一律允許」就會記在這裡。</div>`); if (isOwner()) h += group("已設定「一律允許」", (d.allow_rules || []).map((r) => `<div class="item">${ic("shield", 17)}<div class="mid"><div class="v" style="color:var(--text);font-size:var(--fs-ui)">${esc(r)}</div></div><button class="btn sm no" data-rule="${esc(r)}">移除</button></div>`).join("") || `<div class="note" style="padding:12px 16px">還沒有。在核准時選「一律允許」就會記在這裡。</div>`);
h += group("整理", item({icon: "pin", k: "釘選", sw: !!d.pinned, swdata: 'data-sw="pinned"'}) + item({icon: "star", k: "主要 Bot", v: d.primary ? "這是主要 Bot" : "", sw: !!d.primary, swdata: 'data-sw="primary"', disabled: !!d.primary}) + item({icon: "folder", k: "分區", r: d.folder || "未分區", tap: 1, data: 'data-e="folder"'})); h += group("整理", item({icon: "pin", k: "釘選", sw: !!d.pinned, swdata: 'data-sw="pinned"'}) + item({icon: "star", k: "主要 Bot", v: d.primary ? "這是主要 Bot" : "", sw: !!d.primary, swdata: 'data-sw="primary"', disabled: !!d.primary}) + item({icon: "folder", k: "分區", r: d.folder || "未分區", tap: 1, data: 'data-e="folder"'}));
if ((d.demos || []).length) h += group("示範教學", d.demos.map((x) => item({icon: "eye", k: x.name, v: `${x.steps} 個步驟 · ${x.created}`})).join("") + `<div class="note" style="padding:8px 16px">示範要在那台電腦上錄;Bot 在對話裡會照著做。</div>`); if ((d.demos || []).length) h += group("示範教學", d.demos.map((x) => item({icon: "eye", k: x.name, v: `${x.steps} 個步驟 · ${x.created}`})).join("") + `<div class="note" style="padding:8px 16px">示範要在那台電腦上錄;Bot 在對話裡會照著做。</div>`);
@ -3103,6 +3228,13 @@ async function renderBotset(id) {
else if (k === "not_for") { const n = await ask("不找它做的事", d.not_for || "", "例如:不寫程式、不碰帳務", true); if (n != null && n !== (d.not_for || "") && await act("bot", {bot: id, key: "not_for", value: n}, "已更新")) refresh(); } else if (k === "not_for") { const n = await ask("不找它做的事", d.not_for || "", "例如:不寫程式、不碰帳務", true); if (n != null && n !== (d.not_for || "") && await act("bot", {bot: id, key: "not_for", value: n}, "已更新")) refresh(); }
else if (k === "model") modelSheet(b); else if (k === "model") modelSheet(b);
else if (k === "comp") pickComputer(b, d); else if (k === "comp") pickComputer(b, d);
else if (k === "think") sheet("思考模式", [{group: "想得越久越仔細,也越慢、越花額度"}].concat(EFFORTS.map(([v, l]) => ({label: l, check: v === (d.thinking || ""), on: async () => { if (await act("bot", {bot: id, key: "thinking", value: v}, "已更新")) refresh(); }}))));
else if (k === "step") {
const models = ((S.models || []).find((p) => p.provider === b.provider) || {}).models || [];
const pick = (v, ok) => async () => { if (await act("bot", {bot: id, key: "step_model", value: v}, ok)) refresh(); };
sheet("執行步驟用的模型", [{label: "自動", check: !d.step_model, on: pick("", "已改成自動")}, {label: "不分開(每一步都用上面的模型)", check: d.step_model === "off", on: pick("off", "已改成不分開")}]
.concat(models.filter((m) => m !== b.model).map((m) => ({label: m, check: d.step_model === m, on: pick(m, "步驟改用 " + m)}))));
}
else if (k === "ctx") sheet("模型可讀長度", CTX.map(([n, l]) => ({label: l + " 個 token", check: n === d.context_tokens, on: async () => { if (await act("bot", {bot: id, key: "context", value: n}, "已更新")) refresh(); }}))); else if (k === "ctx") sheet("模型可讀長度", CTX.map(([n, l]) => ({label: l + " 個 token", check: n === d.context_tokens, on: async () => { if (await act("bot", {bot: id, key: "context", value: n}, "已更新")) refresh(); }})));
else if (k === "folder") moveToFolder(b); else if (k === "folder") moveToFolder(b);
else if (k === "restart") act("restart_bot", {bot: id}); else if (k === "restart") act("restart_bot", {bot: id});
@ -3139,7 +3271,7 @@ async function settingsChanged() {
} }
let listTimer = null; let listTimer = null;
function stopListTimer() { clearInterval(listTimer); listTimer = null; } function stopListTimer() { clearInterval(listTimer); listTimer = null; }
const TITLES = {tasks: "任務", routines: "例行任務", pages: "頁面", computers: "電腦", settings: "設定", general: "一般", models: "模型", perms: "權限", integrations: "整合", vault: "保險庫", account: "手機與帳號", updates: "更新"}; const TITLES = {tasks: "任務", routines: "例行任務", pages: "頁面", computers: "電腦", settings: "設定", general: "一般", me: "個人資料與用量", models: "模型", perms: "權限", integrations: "整合", vault: "保險庫", account: "手機與帳號", updates: "更新"};
async function renderList(arg) { async function renderList(arg) {
const kind = arg.kind; const kind = arg.kind;
$("list-title").textContent = TITLES[kind] || ""; $("list-title").textContent = TITLES[kind] || "";
@ -3149,6 +3281,7 @@ async function renderList(arg) {
if (kind === "tasks") return listTasks(el); if (kind === "tasks") return listTasks(el);
if (kind === "routines") return listRoutines(el); if (kind === "routines") return listRoutines(el);
if (kind === "pages") return listPages(el); if (kind === "pages") return listPages(el);
if (kind === "me") return listMe(el);
if (SETTINGS_PAGES.includes(kind)) { if (SETTINGS_PAGES.includes(kind)) {
// (Drawn from what this phone has at once; read again behind it when it may be old.) // (Drawn from what this phone has at once; read again behind it when it may be old.)
if (!S.settings) { el.innerHTML = `<div class="empty">載入中…</div>`; await loadSettings(); } if (!S.settings) { el.innerHTML = `<div class="empty">載入中…</div>`; await loadSettings(); }
@ -3159,6 +3292,58 @@ async function renderList(arg) {
if (["computers", "integrations"].includes(kind)) listTimer = setInterval(async () => { await loadSettings(); if (cur().v === "list" && cur().arg.kind === kind) drawSettings(kind, true); }, 4000); if (["computers", "integrations"].includes(kind)) listTimer = setInterval(async () => { await loadSettings(); if (cur().v === "list" && cur().arg.kind === kind) drawSettings(kind, true); }, 4000);
} }
} }
// ---------- 個人資料與用量(設定)----------
// The year in figures, a heat map of its days, and 用量 by period — as on the computer
// (設定 › 個人資料): big numbers and bars instead of lines of words; the fine print in a tap.
const ME = {span: "30", by: "model", data: null, at: 0};
const wan = (n) => { n = n || 0; return n < 1e4 ? n.toLocaleString("en-US") : n < 1e7 ? (n / 1e4).toFixed(1).replace(/\.0$/, "") + "萬" : n < 1e8 ? Math.round(n / 1e4).toLocaleString("en-US") + "萬" : (n / 1e8).toFixed(2).replace(/\.00$/, "") + "億"; };
const costWords = (micros, unpriced, calls) => !micros ? "未定價" : "US$" + (micros / 1e6).toFixed(2) + (unpriced > 0 && unpriced < calls ? `(另有 ${unpriced} 次呼叫未定價)` : "");
const shortDate = (d) => { const [, m, dd] = (d || "").split("-"); return m ? `${+m}月${+dd}日` : d || ""; };
async function listMe(el) {
if (ME.data) drawMe(el); else el.innerHTML = `<div class="empty">正在算過去一年的用量…</div>`;
if (ME.data && Date.now() - ME.at < 60000) return;
try { ME.data = await api(base() + "api/stats"); ME.at = Date.now(); }
catch (e) { if (!ME.data) { el.innerHTML = `<div class="empty">讀不到用量:${esc(e.message)}</div>`; return; } }
if (cur().v === "list" && cur().arg.kind === "me") drawMe(el);
}
function drawMe(el) {
const d = ME.data || {};
const figs = [[wan(d.tokens_year), "Token・一年"], [wan(d.messages_year), "訊息・一年"], [(d.streak_now || 0) + " 天", "連續使用"], [(d.streak_best || 0) + " 天", "最長連續"]];
let h = `<div class="me-figs">${figs.map(([v, l]) => `<div><b>${esc(v)}</b><span>${esc(l)}</span></div>`).join("")}</div>`;
// The year: a dot a day, a column a week (Sunday on top), deeper the busier.
const days = d.days || [], off = d.weekday_first || 0, weeks = Math.ceil((days.length + off) / 7) || 1;
const cell = 7, W = weeks * cell, H = 7 * cell;
const lv = ["var(--hover)", "color-mix(in srgb,var(--accent) 30%,transparent)", "color-mix(in srgb,var(--accent) 50%,transparent)", "color-mix(in srgb,var(--accent) 75%,transparent)", "var(--accent)"];
const dots = days.map((x, i) => { const k = i + off; return `<circle cx="${Math.floor(k / 7) * cell + cell / 2}" cy="${(k % 7) * cell + cell / 2}" r="${cell * 0.38}" fill="${lv[Math.min(4, x[3] || 0)]}"><title>${esc(shortDate(x[0]))}:${wan(x[1])} token、${x[2]} 則訊息</title></circle>`; }).join("");
const busy = d.busiest && d.busiest.date ? `最活躍:${shortDate(d.busiest.date)}・${wan(d.busiest.tokens)} token` : "";
h += `<div class="gt">活動</div><div class="me-card"><svg class="me-heat" viewBox="0 0 ${W} ${H}" preserveAspectRatio="xMinYMid meet">${dots}</svg><div class="me-note">過去一年有 ${d.active_days || 0} 個活躍日${busy ? "・" + esc(busy) : ""}</div></div>`;
// 用量: the period's big number, a bar a day, then by model or by bot.
const u = (d.periods || {})[ME.span] || {};
const seg = (list, cur, key) => `<div class="me-seg">${list.map(([v, l]) => `<button data-${key}="${v}" class="${v === cur ? "on" : ""}">${l}</button>`).join("")}</div>`;
h += `<div class="gt">用量</div><div class="me-card">${seg([["7", "7 天"], ["30", "30 天"], ["90", "90 天"], ["365", "一年"]], ME.span, "mespan")}`;
h += `<div class="me-hero"><b>${wan(u.tokens)}</b> token</div><div class="me-note" title="花費是模型服務自己回報的;沒回報的寫「未定價」,不是 0 元。">${wan(u.calls)} 次呼叫・花費 ${esc(costWords(u.cost_micros, u.unpriced, u.calls))}・新讀 ${wan((u.input || 0) + (u.cache_write || 0))}、寫 ${wan(u.output)}、快取 ${wan(u.cache_read)}</div>`;
const daily = u.daily || [], max = Math.max(1, ...daily.map((x) => x[1] || 0)), bw = 100 / Math.max(1, daily.length);
h += `<svg class="me-bars" viewBox="0 0 100 40" preserveAspectRatio="none">${daily.map((x, i) => x[1] ? `<rect x="${i * bw + bw * 0.18}" y="${40 - Math.max(1.2, x[1] / max * 38)}" width="${bw * 0.64}" height="${Math.max(1.2, x[1] / max * 38)}" rx="0.6" fill="var(--accent)"><title>${esc(shortDate(x[0]))}:${wan(x[1])} token</title></rect>` : "").join("")}</svg>`;
const rows = (u[ME.by === "bot" ? "by_bot" : "by_model"] || []).slice(0, 8);
const total = Math.max(1, rows.reduce((n, r) => n + (r.tokens || 0), 0));
const cat = (i) => `var(--cat${(i % 6) + 1})`;
h += seg([["model", "依模型"], ["bot", "依 Bot"]], ME.by, "meby");
if (!rows.length) h += `<div class="me-note">這段時間沒有用量紀錄</div>`;
else {
if (ME.by === "model") h += `<div class="me-split">${rows.map((r, i) => `<i style="width:${(r.tokens || 0) / total * 100}%;background:${cat(i)}"></i>`).join("")}</div>`;
const top = Math.max(1, rows[0].tokens || 0);
h += rows.map((r, i) => {
const b = ME.by === "bot" ? S.bots.find((x) => x.name === r.name) : null;
const mark = ME.by === "bot" ? `<span class="me-av">${b ? avatarSvg(b.shape, b.color) : ""}</span>` : `<span class="me-dot" style="background:${cat(i)}"></span>`;
const bar = ME.by === "bot" ? `<span class="me-bar"><i style="width:${(r.tokens || 0) / top * 100}%"></i></span>` : "";
return `<div class="me-row">${mark}<span class="me-name">${esc(r.name)}</span>${bar}<span class="me-n">${wan(r.tokens)}・${Math.round((r.tokens || 0) / total * 100)}%</span></div>`;
}).join("");
}
h += `</div><div style="height:calc(var(--safe-b) + 24px)"></div>`;
el.innerHTML = h;
el.querySelectorAll("[data-mespan]").forEach((b) => b.onclick = () => { ME.span = b.dataset.mespan; drawMe(el); });
el.querySelectorAll("[data-meby]").forEach((b) => b.onclick = () => { ME.by = b.dataset.meby; drawMe(el); });
}
// ---------- 任務 ---------- // ---------- 任務 ----------
// Every bot's tasks as the brain works them out — from the steps, the turn's end, the follow-ups, // Every bot's tasks as the brain works them out — from the steps, the turn's end, the follow-ups,
// the goal checks and whether a device showed the files, never from what a bot says. They come // the goal checks and whether a device showed the files, never from what a bot says. They come
@ -3197,7 +3382,9 @@ function listTasks(el) {
// 任務 → 那則訊息: the chat at where the task began, lit a moment (once that message is here). // 任務 → 那則訊息: the chat at where the task began, lit a moment (once that message is here).
function jumpTo() { function jumpTo() {
if (!S.jumpAt || S.view !== "chat") return false; if (!S.jumpAt || S.view !== "chat") return false;
const i = S.msgs.findIndex((m) => m.at === S.jumpAt && m.role === "user"); // (A task opens at the person's opening message; a search hit may be any message.)
let i = S.msgs.findIndex((m) => m.at === S.jumpAt && m.role === "user");
if (i < 0) i = S.msgs.findIndex((m) => m.at === S.jumpAt);
const el = i < 0 ? null : document.querySelector(`#msgs [data-msg="${i}"]`); const el = i < 0 ? null : document.querySelector(`#msgs [data-msg="${i}"]`);
if (!el) return false; if (!el) return false;
S.jumpAt = 0; S.jumpAt = 0;
@ -3246,7 +3433,7 @@ function drawSettings(kind, quiet) {
let h = ""; let h = "";
if (kind === "settings") { if (kind === "settings") {
h += group("", [ h += group("", [
["general", "settings", "一般", "外觀、時區、通知總開關"], ["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", "保險庫", "密碼和卡號"], ["integrations", "plug", "整合", "訊息管道、連接器、技能"], ["computers", "monitor", "電腦", "Bot 的電腦和你帳號裡的電腦"], ["vault", "lock", "保險庫", "密碼和卡號"],
["account", "smartphone", "手機與帳號", "登入的手機、這支手機的通知"], ["updates", "download", "更新", st.version || ""], ["account", "smartphone", "手機與帳號", "登入的手機、這支手機的通知"], ["updates", "download", "更新", st.version || ""],
].map(([k, i, n, v]) => item({icon: i, k: n, r: k === "updates" ? v : "", tap: 1, data: `data-go="${k}"`})).join("")); ].map(([k, i, n, v]) => item({icon: i, k: n, r: k === "updates" ? v : "", tap: 1, data: `data-go="${k}"`})).join(""));
@ -3566,7 +3753,7 @@ function pageToc(root) {
} }
$("b-pagemore").onclick = () => { $("b-pagemore").onclick = () => {
const v = S.pageData; if (!v) return; const v = S.pageData; if (!v) return;
const items = [{icon: "copy", label: "複製 Markdown", on: () => copyText(v.body)}]; const items = [{icon: "copy", label: "複製 Markdown", on: () => copyText(v.body)}, {icon: "download", label: "存成檔案(.md)", on: () => saveText(v.body, (v.title || "頁面").replace(/[\\/:*?"<>|]/g, "_") + ".md")}];
if ((v.versions || []).length) items.push({icon: "history", label: "其他版本", on: () => sheet("版本", [{label: `第 ${v.latest} 版(最新)`, check: v.revision === v.latest, on: () => openPage(v.id)}, ...v.versions.map((x) => ({label: `第 ${x.revision} 版`, x: x.at, check: v.revision === x.revision, on: () => openPage(v.id, x.revision)}))])}); if ((v.versions || []).length) items.push({icon: "history", label: "其他版本", on: () => sheet("版本", [{label: `第 ${v.latest} 版(最新)`, check: v.revision === v.latest, on: () => openPage(v.id)}, ...v.versions.map((x) => ({label: `第 ${x.revision} 版`, x: x.at, check: v.revision === x.revision, on: () => openPage(v.id, x.revision)}))])});
if (isOwner()) items.push({sep: true}, {icon: "trash", label: "刪除頁面", danger: true, on: async () => { if (await confirmSheet(`刪除「${v.title}」?`, "", "刪除") && await act("delete_page", {id: v.id}, "已刪除頁面")) back(); }}); if (isOwner()) items.push({sep: true}, {icon: "trash", label: "刪除頁面", danger: true, on: async () => { if (await confirmSheet(`刪除「${v.title}」?`, "", "刪除") && await act("delete_page", {id: v.id}, "已刪除頁面")) back(); }});
sheet(v.title, items); sheet(v.title, items);
@ -4008,7 +4195,7 @@ function pageMd(text, id, rev) {
}); });
if (items.length) { out.push(`<ul class="steps">${items.join("")}</ul>`); continue; } if (items.length) { out.push(`<ul class="steps">${items.join("")}</ul>`); continue; }
} }
out.push(`<pre><code>${esc(body.join("\n"))}</code></pre>`); continue; out.push(`<pre class="cb"><button class="cpy" data-copycode>${ic("copy", 14)}</button><code>${esc(body.join("\n"))}</code></pre>`); continue;
} }
const h = t.match(/^(#{1,6})\s+(.*)$/); const h = t.match(/^(#{1,6})\s+(.*)$/);
if (h) { const n = Math.min(h[1].length + 1, 4); out.push(`<h${n}>${inl(h[2])}</h${n}>`); i++; continue; } if (h) { const n = Math.min(h[1].length + 1, 4); out.push(`<h${n}>${inl(h[2])}</h${n}>`); i++; continue; }