Commit Graph

526 Commits

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

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-12 14:34:10 +08:00
anybot bb46dea125 连接器: 服务器说「工具变了」就立刻重抓 — stdio 通知与 Streamable HTTP 的长驻 SSE 都会送到,无需重连 2026-11-12 11:31:31 +08:00
王性驊 6f71a2ff1f 語言: the language to answer in follows every message; the conversion is only a net, with no hand-written words
- reply_reminder: after each of the person's messages (the last line of its tail, next to
  where the model answers) the chosen language is said again — for all 37, not only
  Traditional Chinese. With 跟著系統 it is added when the message is in Traditional
  Chinese, and never when the message asks for Simplified. Made from the setting and the
  message alone, so a chat still reads the same every turn.
- The hand-written table of Taiwan words is gone: wording is the reminder's work.
- The character conversion stays as a net for Traditional Chinese, on the tables that
  leave correct text alone (OpenCC's turned 台 into 臺 and 了解 into 瞭解 in every reply).
- FEATURES.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-12 10:33:56 +08:00
王性驊 935cee9346 繁體中文、換電腦: what a model writes is put into Traditional Chinese whatever the setting's system; a work folder from another computer lands under this home
- 繁體中文: converted at the one place every model call comes back (providers::run_step),
  decided from the request itself: the setting is 繁體中文, or it follows the system and
  the person writes Traditional. It used to be on only for the explicit setting, so a
  brain on an English server with 跟著系統 never converted, whatever the instructions said.
  Not when another language is chosen, nor when the latest message asks for Simplified.
- Converted: the reply, the thinking, and steps whose words are for the person (question
  card, card, page, memory, routine). Left as written: code blocks and `inline code`, a
  line of Japanese, file names, commands, searches, recipients.
- Taiwan wording after the characters: about 55 one-meaning computer terms (網絡→網路,
  文件夾→資料夾, 默認→預設…), and zhconv's OpenCC tables on (设置里的 → 設定裡的).
- The reply instruction says it too: no Simplified characters, no mainland wording.
- 換電腦: a bot's work folder chosen on one computer (/Users/daniel on a Mac) no longer
  breaks every file and command step on another (Linux, another user). It is sent as ~/…
  with the folder as chosen alongside; the receiving computer uses the folder if it is
  there, else the same place under its own home, else its home.
- FEATURES.md.

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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-12 10:17:32 +08:00
王性驊 908433967a 長對話: old step results are set aside first; a summary only if that isn't enough, written by the quick model
- at 70% of the context, results of older steps longer than 600 characters keep their first 200 for the model
  (the newest 6 messages stay whole): no model call, no wait — 20 file reads went from about 128k to 22k
  tokens in 10 ms in the test
- the chat keeps every result whole for the person; the mark (Message::folded) is kept, so the model reads the
  same thing each turn
- the summary, when still needed, is written by the bot's step model when it has one

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-12 00:02:32 +08:00
王性驊 fcf4ef3638 外觀: the face above the input is smaller and stays in its own row
It was 64 px and reached 10 px up over the chat; now 40 px inside a 26 px row, so it never covers what
was said, and the yellow dot is sized with it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 23:59:28 +08:00
王性驊 22a2e99aa5 圖示: the cat — an ink engraving on yellow — is AnyBot's icon on the computer and the web
- icons/anybot.svg (the Mac and Linux app icon, the window icon), icons/anybot-full.svg and mobile/icon.svg (the
  browser tab) carry the picture; the Mac bundle and Linux packages draw their sizes from them as before
- the phone's home-screen and notification icons are drawn from it, with the same large rounded corners (the
  iPhone one is edge to edge: iOS rounds it itself); the sign-in page shows it
- the bots' own faces in the app are unchanged

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 23:24:05 +08:00
王性驊 d82c8bb2b9 外觀: the other settings pages and the phone follow
- 權限: 直接操作 and 自動審核 are switches in plain cards; 技能 and 連接器 lists use switches; 電腦's cards are
  white with the same edge
- phone: the chat takes the bot's colour, the bot's words have no bubble, 需要你允許 is the yellow card, the input
  has an ink edge; while it works the chat ends with the bot's face and the same 「正在…」 as on the computer
- screenshot hooks: ANYBOT_SHOT_VIEW=empty, ANYBOT_SHOT_SUB
- FEATURES.md: 外觀

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 23:03:24 +08:00
王性驊 675aad9d2a 設定: 一般 and 整合 as drawn — white cards of rows, word-only pages, 整合 in three pages with the form behind a tile
- cards are white with a hairline edge; group titles small and grey; the page list is words only, the chosen
  page in ink
- 聊天的顏色 is two dots (the bots' colours, black); switches are ink with a white knob
- 整合 is three pages (訊息管道, 連接器, 技能) instead of one long scroll
- 訊息管道: 已連接 lists each channel on a line (its mark, name · kind, who answers, how it stands, the switch,
  ⋯ to remove); 新增管道 is a grid of kinds, and a press opens that kind's form below (取消 closes it)

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

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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 21:44:59 +08:00
王性驊 deec40fd02 輸入框: Shift+Enter is a new line and goes on with a list, the box grows with its words; the working row says what the bot is doing
- Shift+Enter made a new line in name only: egui's shortcut matching ignores Shift unless asked,
  so it sent the message too; Enter and Shift+Enter are now read by hand (the / list takes plain
  Enter only)
- Shift+Enter on 「1. 買菜」 starts 「2. 」 (also 「9) 」→「10) 」, 「1、」, 「- 」「* 」「• 」, 「- [ ] 」, with the
  indent); on an empty item it ends the list
- the words box sat in a 28 px slot, so its scroll area stopped at 64 px and cut lines off; it now
  grows with the words (15 px on 22 px lines, wrapped) up to two fifths of the window, then
  scrolls; + and the buttons stay at the bottom
- the working row names the running step and what it is on (「正在搜尋網頁:台北 天氣」, 「正在打開網頁:
  github.com」, 「正在執行指令:cargo test」, every tool), and with none running a phrase that changes
  every 3 s (thinking / looking at results / writing)
- screenshot hooks: Shift+ in ANYBOT_SHOT_KEYS, ANYBOT_SHOT_TYPE, ANYBOT_SHOT_VIEW=working

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 20:53:27 +08:00
王性驊 5ae7cda6bb 目標: the goal goes with its chat, stays out of shared bot files, and 停止 between turns pauses it
- 清除聊天記錄 and 開始新對話 clear the goal first (it used to stay, and stopping the turn left a
  「目標暫停」 line in the emptied chat)
- a shared bot file no longer carries the goal; importing drops one that is there
- 停止 while the check is reading the chat pauses the goal instead of doing nothing
- 「繼續」 on a cut-off turn takes up a goal the restart paused
- AnyBot's own line never lands between a step and its result, and stays above a 「繼續」 card
- FEATURES.md: channels and team members can't set a goal (it said they could)

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3QxSfoydRPM9mjj6d
2026-11-11 20:24:27 +08:00
王性驊 cb0e4f3465 側邊欄: 重新啟動以更新 stays inside the sidebar
- The button sized itself to its words, 「重新啟動以更新(2026-11-11 17:23)」, which ran past the
  sidebar's right edge (more so at its narrowest, 240 pt). It is now one row across the sidebar,
  never wider, words in the middle: the time short (「17:23」 today, 「11/11 17:23」 another day),
  dropped when it doesn't fit, and the words cut with … if even they don't. The whole time is in
  its tooltip.
- Screenshot mode: ANYBOT_SHOT_NEWER=<hours ago> shows the button; ANYBOT_SHOT_SIDEBAR=<points>
  sets the sidebar's width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:25:59 +08:00
王性驊 215a5667cc 側邊欄: the bots at the top two to a row, a lone one in the middle
- The grid of the main and pinned bots held as many to a row as the sidebar's width allowed (three
  or more when widened), and a bot alone in a row sat on the left. Now at most two to a row (one
  when the sidebar is very narrow); a row that isn't full — a single bot, or the last of an odd
  number — is centred. Dropping a bot into the grid lands where the centred layout shows it.
- Screenshot mode: ANYBOT_SHOT_PINS=n shows n bots in the grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:21:51 +08:00
王性驊 915fdcf589 連接器: a 公用市集 of remote servers from the official MCP Registry, on the computer and the phone
- 連接器市集 gets a search box over registry.modelcontextprotocol.io (public, with an API):
  servers reached by address only (a package would have to run on the brain, which may have no
  Node or uv); old SSE ones are marked as not yet supported, taken-down ones left out. A name
  that only says "mcp" (com.notion/mcp) reads as whose it is (notion).
- 加入 on the computer fills 新增連接器 and scrolls to it: a free name, the address, and the
  header with the registry's placeholder ("Authorization: Bearer {smithery_api_key}"), shown
  unmasked with what to put there (the key's description, an address variable's choices). 新增
  stays off while a 「{…}」 is left.
- The phone: 設定 › 整合 › 從公用市集加入. The brain searches (the phone's page may only talk to
  its own server; GET /api/mcp/registry, owner only, on the HTTP thread); a pick asks for the key
  or the address part and the brain adds it (the 「mcp」 action's new `add`).
- A server that answers 401 (or a 403 asking for a login) with no key given now says it signs
  people in with OAuth, which AnyBot can't do yet; with a key, that the key is wrong or old.
- mcpservers.org and the like are pages for people behind a browser check, with no list a program
  may read, so the market uses the registry.
- Checked live: 「notion」 finds 6; AWS Knowledge (no key) connects with 5 tools; Notion's own
  server (OAuth) gives the OAuth sentence. `cargo test -- --ignored registry_search_live`.
- Screenshot mode: ANYBOT_SHOT_MCP=<search> shows the 公用市集 after that search.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:54:58 +08:00
王性驊 f9a261959c version_0_1_1-alpha 2026-11-11 16:19:06 +08:00
王性驊 9a70232a14 語音: a call and 朗讀 read the answer just given, also on a brain's screen; the bot panel keeps its width
- A call read the last answer in the chat as soon as the bot didn't look busy. On a screen of a
  brain the bot shows up as working only a moment after the question leaves, so it read the answer
  before and never the new one. It now reads only an answer that comes after what was said.
- 朗讀每個回答 did nothing on a brain's screen (only a turn run on this computer read aloud). The
  screen now reads a turn the brain just finished well; a brain without a window reads nothing.
- The voice row (聲音, a 200 px box, 載入聲音清單) was wider than the bot panel, and egui then moved
  the panel's left edge under the chat. The row takes two lines where it's narrow, and the panel's
  contents can no longer widen it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:47:20 +08:00
王性驊 ff7ef52c20 版本: the phone shows the build time in its own time zone, not the server's UTC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:54:59 +08:00
王性驊 9d6b346462 版本: v<number>-<commit> with the build time, the same in the app, the phone, --version and the server log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:51:52 +08:00
王性驊 36bc2bedaa 伺服器: one way to start it and one place for its settings
make update-server now starts the server through setup.sh --start, the same
path as make server, instead of its own docker compose call. Both use the
Docker named in .env (DOCKER_SOCKET) rather than whatever plain docker
reaches, so a host with both rootless and root Docker no longer gets a
second, empty server on the other daemon. The Tailscale HTTPS port comes from
the port in ANYBOT_RELAY_PUBLIC_URL (e.g. :8443), 443 without one. Adds make
server-logs, and skips the 80/443 check on a Tailscale-only setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:26:35 +08:00
王性驊 7bf5526f27 version_0_1_1-alpha 2026-11-11 11:07:55 +08:00
王性驊 c6c9a1674a 傳送: a file or a few words from any device of the account to any other
Outside the chats and without a bot: computer → phone, phone → computer,
computer → computer.

- The brain is the post office (src/drops.rs). The sender hands the file
  over in 2 MB pieces; the brain keeps it in drops/ and pushes it piece by
  piece to the destination computer (device/run tool `drop_put`), going on
  from where a broken link stopped and waiting up to 7 days for a computer
  that is off. What is for the phone waits at the brain to be downloaded.
- Files land in Downloads/AnyBot with a notification; words go on the
  clipboard. A computer takes parcels only from its own brain.
- Window: an ↑ button at the bottom of the sidebar opens 傳送到其他裝置
  (pick a device, drop files or paste text, the last 7 days below).
- Phone: 傳送到其他裝置 in the account menu (send, download, copy).
- Bots: a `send_to_device` tool, gated like send_file.
- Owner only; the account server is unchanged. Without an account, this
  computer and a phone connected to it directly can exchange.
- Docs: FEATURES §36, protocol, architecture, multi-device (zh and en).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 10:04:13 +08:00
王性驊 b4ba710eb4 記憶: each bot keeps its own, remembers like a person, and decides for itself
- Each bot only sees its own memories (the shared "bot 0" layer is gone).
- A 做過的事 line is written only for a turn that really did something
  (or looked things up in 5+ steps); small talk and simple answers aren't kept.
- The bot judges on its own what is worth remembering and whether a new fact
  is the same as, replaces, or stands beside an old one (`separate`); it
  doesn't ask the person first.
- remember no longer refuses a different fact that shares a subject with an
  old one (likeness is counted both ways).
- Filler messages (謝謝, 繼續, ok…) carry no memories; `_` and `%` are no
  longer wildcards in the search.
- Team members no longer receive `memories` with messages, and picks are
  taken only from the owner and only when they are this bot's real memories.
- forget only retires 記得的事, never a 做過的事 line.
- Memory chips are hidden while the bot is working (desktop and phone).
- A reply made long after the message gets a 〔現在時間〕 line.
- The nightly tidy runs only on the brain; edits are capped at 500 chars.
- Model download: no total body time limit, only a 60 s stall limit.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 09:35:59 +08:00
王性驊 28784232a5 記憶: a page to see it, a few lines picked while typing, a local model
The memory had grown into a list carried whole, a top-14 recalled by a
trigram index and pasted into the system prompt with the clock, and a
page that broke its own layout. Nobody could see what went to the
model, the prompt cache missed every message, and 「記住」 kept saying
the same thing twice. Rebuilt per the spec (docs/memory.md):

- Three kinds in memory.db: 記得的事 (fact), 做過的事 (event, a line per
  finished turn), 整理過的 (rollup). Each keeps pinned, uses,
  last_used, deleted, superseded_by, span. state.json keeps the facts
  as the copy that syncs; the page reads SQLite.
- Search: jieba words ∪ CJK bigrams in an FTS5 unicode61 table
  (Traditional text goes through Simplified first), weighted share of
  query terms hit; plus local vectors, vec = clamp((cos−0.35)/0.35).
  score = max + 0.15×min, events ×0.9. ≥0.15 suggested, ≥0.5 ticked,
  ≥0.55 carried when nobody chose (3 at most).
- What the model gets: the system prompt has the time zone and the
  pinned memories only, the same every turn. Each person message gets
  〔送出時間〕 and 〔相關記憶〕 from Message.memories, built in
  group_history into a transient Message.context, so the beginning of
  a chat reads the same next turn (cache hits) and the event log,
  skills and audit see only what was typed. A memory already carried
  in view isn't carried again; each carry counts a use.
- Picks travel with the message: Cmd::Send / POST send / sync act
  "memories" (empty = none; absent = the brain chooses, once, saved).
- remember finds the like one (cos ≥ 0.85 or the same words) and asks
  for `replaces`; the old one is superseded, never carried. A fact
  forgotten and remembered again comes back. New search_memory
  (query, kind), with dates; read-only.
- Nightly on the brain, no model: events past 30 days fold into a line
  per week (「11/3–11/9 做過的事(14 件):整理照片 ×3…」, ≤400 chars,
  like with like by words or vectors), weeks past 180 days into months;
  the folded go to 最近刪除 for 30 days. Facts are never removed. The
  page offers duplicates, facts unused for half a year, and what can
  fold now.
- Local model: minishlab/potion-multilingual-128M through m2v.rs (same
  token ids as model2vec-rs on 13/13 sentences, cos ≥ 0.9999, without
  tokenizers' 1.1 GB). Converted while downloading: vocab.bin,
  table.i8 (int8 + row scales), dims.json, 137 MB kept of 530 MB;
  ANYBOT_HF_BASE picks a mirror (now passed into the server's brain
  container too). Loaded when first needed (34 ms), let go after 10
  idle minutes. The brain loads it; a screen only with a document
  folder set; hands and phones never. 設定 › 一般 › 語意搜尋:
  本機模型/Ollama/關閉; a new engine clears every vector.
- Three files, three connections: memory.db (backed up nightly, 7
  kept), docs.db (a cache), oplog/audit.db (30 days). An old audit.db
  hands its memories and documents over once and shrinks (a real one:
  172 MB → 16 KB). docs_search scans every chunk now, vectors cached
  in RAM (it stopped at 8000); FTS optimize + VACUUM daily (260 MB of
  tombstones over 31 MB of text).
- API: POST /api/memory (owner) and /api/sync/memory (mirror). Reads
  answer on the HTTP thread; writes go through phone_act("memory").
- Screens: a memory dialog (Bot menu 記憶…, Bot settings 打開記憶) with
  counts, live search, filters, suggestions, per-item kind/date/uses
  and pin/edit/forget/restore; chips above the composer 300 ms after
  typing stops, with a token estimate; 「帶了 N 條記憶」 under person
  messages. The phone has the same as a 記憶 tab, chips and tag.

Checked: make test passes (app 297, relay 16), with new tests for the
scores and thresholds, Traditional Chinese segmentation, remember's
dedupe and replaces, two turns sending the same beginning, no double
carry, weekly/monthly folding and the trash, and the audit.db move.
Brain idle 37 MB as before, ~230 MB with the model loaded; search on
the brain 0.2–0.5 ms, 7–44 ms from the phone page. A deadlock found on
the way (stats re-taking the lock) is fixed and tested.

Docs: docs/memory.md has the whole design; FEATURES.md, protocol,
architecture (zh/en), multi-device and install say what changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3SYw9JJ9dXwaNvYh4
2026-11-11 07:46:50 +08:00
王性驊 1af25d7da4 提示音: a chime whenever a bot needs the person
A request to allow something, or a step only the person can do, only
bounced the Dock icon; a banner (with macOS's Glass sound) came only
when they were away, and on Linux notify-send made no sound at all. So
someone looking at another window on the same screen, or at AnyBot
itself without watching it, missed that a bot was waiting.

Now on_new_approval rings a chime every time, focused or not: two soft
bell notes going up (E6, then A6), 0.8 s, quiet, synthesized
(voice::chime_samples) so it is the same on macOS, Windows and Linux.
Several requests at once ring once; the banner that comes with it when
away stays silent so it doesn't ring twice (the 「完成了」 banner keeps
its sound). A screen of another brain rings for the brain's requests
too (they come through the same on_new_approval); a brain on a server
doesn't. 設定 › 一般 › 通知 › 「需要你時發出提示音」 turns it off (on
by default; turning it on plays it once).
2026-11-11 01:01:05 +08:00
王性驊 12c9944dee Server voice service: Whisper on the brain's own server, checked for real
`make server` now asks whether to run a voice service there (and the
kept-setup menu can add or remove it): speaches, Whisper
large-v3-turbo on the CPU, behind the brain only (no published port),
enabled with COMPOSE_PROFILES=voice so it composes with the Tailscale
and LAN files. The brain sees ANYBOT_VOICE_URL, fills 設定 › 語音 › 聽
with it once (what is changed later stays), and asks the service for
its model at each start: this build downloads only when asked (it has
no PRELOAD_MODELS, and the 0.8.2-cpu tag is older still, so the image
is pinned by the digest that was tested).

Tested end to end on 12 CPU cores with the compose file itself: first
start 404 s to download the model, later starts 1 s; 11 s of Mandarin
mixed with English (Chrome, Tesla FSD) in 3.4–3.6 s, every word right.
small is three times faster and slipped a character. Reading aloud
stays with another service: speaches can't say Chinese (its espeak has
no "zh"), English works.

From the same test: a service that answers 200 with no sound is now an
error said in words (it was played as silence), Whisper's ASCII
punctuation in Chinese becomes full-width (,?!), and speaches'
"not installed locally" says the model is still on its way.
2026-11-11 00:14:50 +08:00
王性驊 40d1d9707a Voice: its own 設定 › 語音, run by the brain for every screen and the phone
Voice was three implementations that broke on their own: speech to text
borrowed the OpenAI key (so with only Grok set up the mic recorded,
then failed), OpenAI's models it hard-coded stop on 2027-02-26, read
aloud was macOS `say` or espeak-ng (silently nothing on Windows, where
espeak isn't installed), and the phone used the browser's own
recognition. Now:

- 設定 › 語音 has 聽 and 說, each a service: off, OpenAI-compatible
  (OpenAI, Groq, a Whisper server of your own: the address decides),
  xAI or ElevenLabs. An empty key borrows 設定 › 模型's for the same
  service. Each side says 可以用 or what it lacks; 聽 has 試試看
  (record a sentence, show what was heard), 說 has 試聽 and the voice
  list. speech.rs does the calls; xAI's both ways were checked for real
  (Mandarin read, then heard back, in Traditional characters).
- The brain does it all: the phone POSTs its recording (MediaRecorder)
  to /api/voice/transcribe, screens to /api/sync/voice/transcribe;
  answers come back as MP3 from …/voice/speech and are played on the
  device (rodio; an <audio> on the phone, 「唸出來」 in a message's
  menu). Keys stay on the brain (the voice keys are redacted for
  screens like the others).
- No service, no voice anywhere: the mic, 語音聊天, 會議錄音 and 朗讀
  only appear once 聽 (and 說) can be called; the phone's state says
  which. Without voice the send arrow just rests where 語音聊天 was.
- 會議錄音 is uploaded to the brain, which turns it into text in the
  background and hands it to the bot itself: a meeting is longer than
  the 35 s the account lets a request wait, and a brain on a server has
  no window (the jobs are polled in background()).
- Recognisers answer Mandarin in Simplified: in a Traditional Chinese
  window or phone the text becomes Traditional with Taiwan wording.
- Older saves: whoever had an OpenAI key keeps voice input (聽 =
  OpenAI); everyone else starts with it off. Bots' macOS voice names
  are cleared. 對話詳細資訊's 加入會議 started plain voice input; it
  starts a meeting now.
2026-11-10 22:58:18 +08:00
王性驊 70b208e1bd Voice input: xAI when there's no OpenAI key, and in Traditional Chinese
Speech to text only knew OpenAI's key, borrowed from the AI providers,
so with Grok alone set up the mic recorded and then failed for a key
nobody had. Now OpenAI's key is used when there is one, else xAI's
POST /v1/stt (options before the file, the file last; checked with a
real Mandarin clip). Without either, the mic and 語音聊天 say so before
recording instead of after.

xAI answers Mandarin in Simplified characters ("zh-cn") and OpenAI
often does too: in a Traditional Chinese window the text becomes
Traditional with Taiwan wording (zhconv, like the bots' replies).
Japanese, which has kana, keeps its own kanji.

A stopgap: voice moves to the server next (one engine for every
screen, set up in its own 語音 settings).
2026-11-10 22:38:41 +08:00
王性驊 04e744aa14 make update: pull, rebuild and restart what this computer runs
Updating meant knowing which of three ways applied: run install.sh
again (app, hands), anybot setup --refresh-service (the background
service), or git pull plus docker compose up --build in deploy/server.
deploy/update.sh does it per part, and make has a target for each:

  make update          whatever is installed here (server, app, hands)
  make update-app      swap the app; restart its background service
  make update-hands    Linux: swap, restart the systemd unit, check it
                       is still up 3 s later (a crash loop looks active
                       for a moment)
  make update-server   docker compose up -d --build, as .env sets it up

Each pulls first (--ff-only; a conflict stops it rather than installing
the old version), and carries on with the new deploy/update.sh when the
pull changed it. PULL=0 installs this checkout as it is. Small Linux
machines compile one crate per 2 GB, like install.sh. An open app
window is told to reopen; it keeps the old copy until then.
2026-11-10 22:00:48 +08:00
王性驊 81ba110ca5 指示: last in the prompt, under its own heading
A bot's 指示 went into the system prompt bare, in the middle, with
several paragraphs of the app's own rules after it, so the model gave
it little weight. It now comes last, after the language line, as
「使用者給你的指示(優先遵守):」 followed by the text.

The field's help said 「Bot 應該記得的事、說話風格…」, the same as
記得的事 below it, and its example was 「用繁體中文回答」, which the
language setting already does better (it also converts the replies).
It now says what it is for — the bot's role, rules and way of talking
— and points to 記得的事 and 設定 › 一般 › 語言; the example is about
style instead.
2026-11-10 22:00:40 +08:00
王性驊 89dbb243dc Chat: a 回到底部 button once you've scrolled far up
The desktop transcript only followed new messages while it was already
at the bottom; scrolled up through a long chat, the way back was the
wheel. Past 400 points above the newest message (the phone's
threshold), a round ↓ fades in over the bottom middle of the chat, just
above the composer. A press scrolls smoothly to the end and keeps
pulling for up to a second, so words streaming in meanwhile don't leave
it short; then stick-to-bottom takes over again and the button fades
out.

ANYBOT_SHOT_VIEW=longchat fills the chat with 60 messages, to check it
with ANYBOT_SHOT_SCROLL / ANYBOT_SHOT_CLICK.
2026-11-10 22:00:34 +08:00
王性驊 7edc05ba9b setup --refresh-service: keep the launcher executable
systemd starts ~/.local/bin/anybot-run directly. install_systemd set 0755,
the refresh path rewrote the file without it, and the unit then died with
status=203/EXEC in a restart loop (seen on a Ubuntu hands box: service
enabled, binary fresh, nothing running). One make_executable for both.
2026-11-10 14:46:30 +08:00
王性驊 983a2c2f02 install.sh: stop dying on macOS at the compile step
"$RUST_HOST;" is one variable name to macOS /bin/sh (bash 3.2): it
swallows the first byte of the full-width punctuation, so with set -u a
plain \`sh install.sh app\` aborted at [3/4] with "RUST_HOST\*: unbound
variable". Four such lines in install.sh, one in the server setup.
Brace them, add make lint-sh (sh -n for every shipped script plus a
check for this pattern) so it stays fixed.
2026-11-10 14:32:56 +08:00
王性驊 818e551e6b One computer-and-phone still, and the README stops advertising its style guide
The phone shot stood alone as a 300px column, so it read as cut off at
one side. The desktop approval card and the phone sign-in are now one
composite (docs/demo/composite.py), and every README still is dark and
2x-captured, so the page reads as one product.

The document table lists user-facing documents; the README style notes
stay in docs/ for whoever edits the README.
2026-11-10 14:21:06 +08:00
王性驊 81449be33d Readmes: the shape top-starred projects use, and no more overflow
Studied OpenClaw, ollama, Dify, AnythingLLM, Meetily, LobeHub, n8n:
logo, one-line pitch, language bar, badges, hero shot, install in the
first third as fenced blocks, quick start, architecture, a two-column
document table, short closing sections.

Both READMEs now follow that. What was breaking the page: a three-column
install table holding a 90-character URL (URLs cannot wrap, so the table
pushed the page sideways) and a 1414px PowerShell line inside a code
block. Install moved to code fences, the long line is wrapped, the
Windows hands snippet is one statement per line, and screenshots are
re-taken at 2x and downscaled to 960 px so they fit the ~980 px document
column and stay sharp on Retina. docs/readme-style.md records the rules
and how to check the render locally (marked + headless Chrome, measure
scrollWidth and pre.scrollWidth).
2026-11-10 14:14:27 +08:00
王性驊 5cdf54cdc4 Quick install: app, server, and headless hands, one line each
The top block now gives the three roles their own paste line (Windows
included), matching what install.sh --print reports. Hands takes the URL
and the one-time code from "Add a computer".
2026-11-10 14:10:52 +08:00
王性驊 9443a55d90 Lead with one line you can paste
Both READMEs now open with a quick install: curl… | sh on Mac and Linux,
irm… | iex on Windows, then where the key goes. The role table moved
below it for the server, hands, and agent paths.
2026-11-10 14:10:38 +08:00
王性驊 dba6df198e Readmes: lead with the picture, and take the pictures fresh
Both languages now open with what AnyBot does, in plain words, before
the install table and the flow diagram. The four stills are re-taken
from this build (shots/readme/) and tracked, since the READMEs point at
them; the old shots/ stayed ignored.
2026-11-10 14:07:02 +08:00
王性驊 f006aeee35 One installer for every platform, first run included
install.sh now covers every common Linux distro (apt, dnf, yum, pacman,
zypper, apk, xbps), macOS on arm64/x86_64, and hands off to install.ps1
under Git Bash. install.ps1 + install.cmd give Windows a double-click.
Autostart: systemd user unit on Linux, launchd on macOS, Task Scheduler
on Windows. A terminal guides the role choice and the first key or bot;
agents get --print JSON and ANYBOT_NONINTERACTIVE=1 with env seeding.
`加一台電腦` shows the Windows and the Mac/Linux line together.
2026-11-10 14:07:01 +08:00
王性驊 a514b33fb3 Bug sweep: gates, relay 2FA, Windows input, snapshots, encodings
Permissions and reach
- a file leaving a computer passes the same questions as reading it;
  "looking" shell commands that do more than look ask first
- a symlink out of the work/sealed folder counts as outside it
  (real paths, not just lexical ones); the search walk skips links
- web_fetch and skill_install read the public web only: localhost, the
  LAN and cloud metadata are refused, at every redirect
- preview shows a file without running it; browser_upload may ask
- vault: logins no longer match across shared suffixes (pages.dev,
  com.tw, ...); registrable_domain knows public suffixes
- axwrite: found elements are retained (use-after-free)

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

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

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

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

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-10 11:46:17 +08:00
AnyBot Dev cf1d4d618c No job gets stranded on a blank tab
- pick_tab: a page that went somewhere (http) beats about:blank at every
  rank — own live tab > free live tab > own blank > free blank. Headless
  Chrome boots on about:blank and a job that claims it was pinned there;
  desktop behaviour unchanged (the front tab is a live page anyway)
- the tabs list shows a page's url when its title is empty, so the model
  never reads a faceless '1. (current)' line

Live proof (headless Chrome + qwen brain, same scenario that failed
before): reads the number through the browser path, 172s -> 92s, and the
model now flags the page's own link as untrusted (S3 working)
2026-11-09 21:17:12 +08:00
AnyBot Dev 61c38dca66 Live e2e wiring: real-brain shell + browser turns (env-gated test, ANYBOT_BROWSER_FLAGS dev flags)
- agent live test drives real OpenAI-compatible endpoints (ANYBOT_LIVE_BASE/KEY/MODEL/PROMPT)
- specs assembled like the app (web::specs_for) so the model truly sees the browser tool
- botbrowser honors ANYBOT_BROWSER_FLAGS (containers: --no-sandbox --headless=new)
2026-11-09 21:11:11 +08:00
AnyBot Dev 6f8568d16b A live-model e2e: any OpenAI-compatible brain must drive a shell turn (gated by env) 2026-11-09 20:57:32 +08:00
AnyBot Dev ef44db4645 Plan: M5 complete (C6, P5, C5, P7+C8, C9 engine) 2026-11-09 20:51:33 +08:00
daniel wang 861bc59c54 Merge c9/windows: Win32 input + screenshot engine (C9, engine) 2026-11-09 20:50:44 +08:00
AnyBot Dev f829957b75 Windows has hands now (C9, engine)
- src/win.rs: the same mac:: API the harness drives, on Win32 —
  SendInput mouse (absolute, multi-click, drag, wheel), keyboard
  (macOS key codes mapped to VK, unicode text, modifiers), GDI BitBlt
  screenshot, WindowFromPoint/GetForegroundWindow for window_at and
  front_app; compiles clean against the windows crate for
  x86_64-pc-windows-msvc (API-checked, no hardware here)
- the control tree was already speaking agent-desktop-windows
- intents answer honestly on Windows ("捷徑目前是 macOS/Linux 的")
  and don't advertise themselves from the facts line
- CI: a report-only Windows compile job for wherever a Windows runner lives
- needs a real machine: multi-monitor coordinates, high-DPI, UIA-number
  clicks, Chinese input
2026-11-09 20:50:44 +08:00