docs: README 重寫——跟上這一週的功能,圖從現在這版重拍
- 中文、英文兩份:開頭加 ChatGPT 方案(不用金鑰)、一群 Bot;新增「第一次用」(照歡迎畫面)和「它會做什麼」(動手先問、/plan、/goal、例行任務、同事與群組、記憶、技能、頁面、連接器、訊息管道、Mac App、Hooks、手機、語音、傳送),聊天指令收在 <details> - 文件表加功能地圖、技能格式;英文版連到 docs/en 的摘要 - 圖改成三張:ask(最上面)、plan、group;拿掉 chat、routines、computer-phone、phone 和 composite.py;左下角的名字換成「你」 - docs/demo/README.md 寫上現在的拍法(隔離、1.5 倍、假 id) - 伺服器那行安裝指令超過 90 字,斷行 已驗證: docs/demo 的拍圖步驟照抄執行,產生這三張圖;兩份 README 照 readme-style 的規則靜態檢查(程式碼行寬、表格兩欄、格子裡沒有程式碼和網址、圖寬、連結的檔案都在) 未驗證: Gitea 上實際渲染(readme-style 的 headless Chrome 量測被權限擋下);只改文件和圖,沒跑 cargo test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha3KhvSzysuKUobKUTR
135
README.en.md
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<p align="center">
|
||||
<b>An AI assistant that runs on your own computers.</b><br>
|
||||
It chats, and it does things: files, commands, web pages, the screen in front of you, and jobs on a clock.
|
||||
It chats, and it gets things done: files, commands, forms in a browser, the screen in front of you, jobs on a clock. It asks before it acts.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
|
|
@ -17,14 +17,23 @@
|
|||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache-2.0"></a>
|
||||
<img src="https://img.shields.io/badge/macOS%20%C2%B7%20Linux%20%C2%B7%20Windows-1c1c1c" alt="macOS, Linux, Windows">
|
||||
<img src="https://img.shields.io/badge/Rust%201.95-orange" alt="Rust 1.95">
|
||||
<img src="https://img.shields.io/badge/version-0.1.0-lightgrey" alt="v0.1.0">
|
||||
<img src="https://img.shields.io/badge/self--hosted-green" alt="self-hosted">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="shots/readme/chat.png" alt="A list of bots on the left, a chat with one of them on the right" width="960">
|
||||
<img src="shots/readme/ask.png" alt="A bot about to sort the photos in Downloads stops to ask first: allow, always allow, or deny; a note you typed while it worked waits under the input" width="960">
|
||||
</p>
|
||||
|
||||
You bring the model key: xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama at home, or anything that speaks the OpenAI API. Chats, files, and passwords stay on your machines instead of landing in someone else's account server. Each row on the left is a bot — research, writing, “touch the computer” — and each can use a different model.
|
||||
**Your pick of model.** Bring your own API key: xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, or anything that speaks the OpenAI API. With ChatGPT Plus or Pro, sign in with your ChatGPT account and use the plan instead of a key. With nothing at all, use Ollama at home. Each bot can use a different model.
|
||||
|
||||
**Your data stays with you.** Chats, memory, files, and the passwords in the vault live on your computer or on a server you run. The account server is yours too and only connects your devices; backups are encrypted on your computer before they are uploaded, and the server cannot open them.
|
||||
|
||||
**A team of bots, not one.** Each row on the left is its own bot, with its own personality, model, memory, skills, and the computers it may use. They ask each other questions, hand off work, and can answer you together in a group chat.
|
||||
|
||||
<p align="center">
|
||||
<a href="FEATURES.md">Every feature</a> · <a href="docs/feature-map/README.md">Feature map</a> · <a href="docs/en/multi-device.md">Computers and phone</a> · <a href="docs/en/security.md">Security</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -44,12 +53,11 @@ irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 | iex
|
|||
|
||||
It installs what it needs, asks which piece you want, and walks through the first setup. The first build takes 5–15 minutes, later updates 1–2. It lives in your user folder and needs no administrator account.
|
||||
|
||||
Then open AnyBot (on a Mac, the first time: right-click the icon › Open), paste an API key under Settings › Models, make a bot, and talk to it. No key? Pick Ollama and it runs on your own machine.
|
||||
|
||||
**Account server + brain** (any Linux with Docker, 2 GB RAM or more; it asks for a domain, a user, a password, and handles HTTPS itself):
|
||||
|
||||
```sh
|
||||
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- server
|
||||
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \
|
||||
| sh -s -- server
|
||||
```
|
||||
|
||||
**Headless hands** (a computer for the bot to use; a screen is optional). The URL and the pairing code come from “Add a computer” in AnyBot:
|
||||
|
|
@ -69,31 +77,88 @@ irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 | iex
|
|||
|
||||
Running this from an agent, with no questions asked: `sh install.sh --print` reports what fits this machine, then use the environment variables — see [install/AGENT.md](install/AGENT.md).
|
||||
|
||||
## First run
|
||||
|
||||
1. Open AnyBot. On a Mac, the first time: right-click the icon › Open (it has no Apple developer signature).
|
||||
2. On the welcome screen, press “Set up a model” and pick one: paste an API key; or choose “ChatGPT plan” and press “Continue with ChatGPT” to sign in with your ChatGPT account; or choose Ollama to run on your own machine.
|
||||
3. Make your first bot and give it a job, such as “sort the photos in my Downloads folder by month”. It tells you what it wants to run, and nothing happens until you press “Allow”.
|
||||
4. Type “/” in the input for commands, “@” to bring in another bot.
|
||||
|
||||
Used AnyBot on another computer? Press “Sign in” on the welcome screen and your bots and chats come along.
|
||||
|
||||
---
|
||||
|
||||
## It asks before it acts
|
||||
## What it does
|
||||
|
||||
Say “do this on my computer” and it does not just run it. You see the exact step and choose allow once, always, or no. Sending, paying, and deleting are asked every time, even when you turned the other prompts off.
|
||||
### Hands-on, but it asks first
|
||||
|
||||
- **Files and commands** — read, edit, search, run; long jobs go to the background, interactive ones get a real terminal. On macOS and Linux (with Landlock in the kernel), commands run in a sandbox that cannot read or touch your private folders. Before a bot edits a file it keeps a copy; /rewind puts it back.
|
||||
- **Its own computer** — a Linux desktop (XFCE, Chromium) in Docker, where each bot has its own screen and browser, kept apart from yours. You can watch what it is doing at any time and take over when needed.
|
||||
- **A browser** — open pages, sign in, click, fill forms, upload and download. Passwords and card numbers sit in the vault and AnyBot types them into the page; the model never sees them. Before a post or comment is sent, repeats are blocked; after, the page is read again to confirm it is really there.
|
||||
- **The screen you are using** — it reads the numbered buttons in a screenshot, then clicks. When you need to sign in or type a code, it hands you the screen. Show it once, and it learns the steps.
|
||||
- **Asks first** — touching your computer, sending something out, or doing anything that cannot be undone shows a card first. Paying, sending, and deleting are asked every time. You can always-allow a kind of action, turn on direct mode, or type /always-approve to let everything through; what the safety rules block stays blocked whatever you set.
|
||||
|
||||
### Hand it something big
|
||||
|
||||
- **/plan** — it looks around first and hands you a plan card to approve; only then does it start, ticking off each step.
|
||||
- **/goal** — give it a condition (“all tests pass”). After each turn another model reads the evidence; if the goal is not met, the bot keeps going.
|
||||
- **Routines** — say “every weekday at 9, three AI news items” and it is scheduled; routines can also run when a PR merges, CI fails, or mail arrives. Every run is logged, and two failures in a row pause it.
|
||||
- **Steer and branch** — type while it works and it reads your note at the next step; /btw sends the same bot off to do a second thing.
|
||||
- **Watch** — a command can wake the bot on each new line it prints, for keeping an eye on a deploy or a log.
|
||||
|
||||
<p align="center">
|
||||
<img src="shots/readme/computer-phone.png" alt="Left: a card asking permission before a command runs on your computer. Right: the phone page, asking you to sign in" width="960">
|
||||
<img src="shots/readme/plan.png" alt="Typing /plan to move a blog to a new server: the bot hands in a plan card with a summary, six steps, how to check it worked, and caveats, waiting for your decision" width="960">
|
||||
</p>
|
||||
|
||||
- **Files and commands** — it asks first. Or it works only inside its own computer, a small desktop kept apart from yours.
|
||||
- **Web pages and forms** — its own browser. Passwords and card numbers are filled by the app, not read out to the model.
|
||||
- **The screen you are using** — it reads the buttons in the screenshot, then clicks. If it needs you to sign in, it hands you the screen.
|
||||
- **A clock** — “every weekday at 9, three news items” becomes a routine.
|
||||
- **A phone, from anywhere** — open your URL in a browser, sign in, and it is the same chat; watch it from outside.
|
||||
### A team of bots
|
||||
|
||||
- Each bot has its own soul and instructions, strengths, abilities, skills, memory, and computers it may use. Start from a template (research assistant, writing partner, computer helper…) or from scratch.
|
||||
- Ask a colleague and wait for the answer, hand off work without waiting, teach a colleague a skill you know; type “@” in any chat to bring one in.
|
||||
- Group chats: members answer in turn, each with its own model; questions go to whoever is good at them, and “@name” passes the turn.
|
||||
|
||||
<p align="center">
|
||||
<img src="shots/readme/routines.png" alt="A weekday 9:00 news routine created from the chat" width="960">
|
||||
<img src="shots/readme/group.png" alt="A travel group chat: the research assistant adds a weather card for Tainan, then the writing partner suggests an angle for the travel post" width="960">
|
||||
</p>
|
||||
|
||||
### Remembers, learns, writes it down
|
||||
|
||||
- **Memory** — each bot keeps its own; “About you” is shared by all of them. As you type, the memories it plans to bring along show above the input, and you can drop or add any of them.
|
||||
- **Skills** — the Agent Skills format (SKILL.md), with 8 built in (pdf, xlsx, docx, pptx and more) and more installable from GitHub. After a long job it saves the way that worked as a skill; skills with saved steps replay next time without asking the model.
|
||||
- **Pages** — things to track or compare become a page (tables, charts, number cards) that it keeps updating, with older versions kept.
|
||||
|
||||
### Connects to the outside
|
||||
|
||||
- **Connectors (MCP)** — a local command or a remote URL; ones that need an account sign in with OAuth. The market lists 8 common ones and searches the official MCP Registry.
|
||||
- **Channels** — Slack, Discord, Telegram, Teams, the Mac's Messages and Mail, SMS, X: each message that comes in is answered by the bot you chose. Outside messages are not trusted: no memory of yours, no computer tools, and your earlier approvals do not count.
|
||||
- **Mac apps and phone calls** — Mail, Notes, Messages, Reminders, Calendar, Contacts; calls and texts from your Twilio number; posts on X. Sending, messaging, and posting are asked one at a time.
|
||||
- **Hooks and scripts** — run your own programs at fixed points while a bot works (Claude Code's format); `anybot --ask "…" --json` lets a script ask a bot directly.
|
||||
|
||||
### Reach it from anywhere
|
||||
|
||||
- **Phone** — open your URL in a browser and sign in: the same chat, with approvals, questions, the bot's computer, and notifications. No server? On the same Wi-Fi or Tailscale, connect straight to your computer with a phone password.
|
||||
- **Voice** — talk instead of typing, have a voice chat, or have answers read aloud.
|
||||
- **Send** — drop a file or a few words from any device of your account onto another.
|
||||
|
||||
<details>
|
||||
<summary><b>Chat commands</b></summary>
|
||||
|
||||
- **/plan what to do** — plan first; it starts once you approve.
|
||||
- **/goal condition** — keeps going until the condition holds; /goal clear cancels.
|
||||
- **/btw what to do** — the same bot does this on the side without stopping its current job.
|
||||
- **/always-approve** (or /yolo) — let everything through; add off to stop.
|
||||
- **/rewind** — put the bot's file edits and the chat back to an earlier message.
|
||||
- **/fork** — keep a copy of this chat as a branch that goes its own way.
|
||||
- **/context**, **/compact** — how much of the model's room this chat uses; summarize now.
|
||||
- **/usage** — tokens over the last day and week, per bot and per model.
|
||||
- **/doctor** — check the connections, model services, the bot's computer, connectors, and disk.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## One machine thinks, others get used
|
||||
|
||||
One machine remembers and thinks (the **brain**). Others are there to be used (the **hands**). The phone is only a window. They all meet on an **account server you run**, so the computers at home do not open a port or need a public address.
|
||||
One machine remembers and thinks (the **brain**). Others are there to be used (the **hands**). The phone is only a window. They all meet on an **account server you run**, so the computers at home do not open a port or need a public address. The hands only follow commands signed by the brain.
|
||||
|
||||
```
|
||||
you on the phone you on a laptop a computer with no screen
|
||||
|
|
@ -112,9 +177,7 @@ One machine remembers and thinks (the **brain**). Others are there to be used (t
|
|||
| Hands | Press “Add a computer” and paste the line it shows |
|
||||
| Phone | Open your URL in a browser and add it to the Home screen |
|
||||
|
||||
No server yet? Use one always-on Mac as the brain — see option B in [docs/multi-device.md](docs/multi-device.md).
|
||||
|
||||
---
|
||||
No server yet? Use one always-on Mac as the brain — see method B in [docs/en/multi-device.md](docs/en/multi-device.md).
|
||||
|
||||
## What happens to a sentence
|
||||
|
||||
|
|
@ -136,13 +199,13 @@ flowchart TD
|
|||
```
|
||||
|
||||
1. You send a message on the desktop or the phone. The phone does not think for itself; it reads the same chat on the brain.
|
||||
2. The brain hands that sentence, the bot's instructions, and its tools to the model you picked.
|
||||
2. The brain hands that sentence, the bot's instructions, its memory, and its tools to the model you picked.
|
||||
3. If the model only answers, it writes back. If it wants to read a file, open a page, or click something, it proposes an action.
|
||||
4. That action goes through AnyBot's own rules first — the model does not decide whether it is allowed.
|
||||
5. Once you allow it, the action runs on **the computer you chose**: the isolated desktop, the one you are using, or a paired hand.
|
||||
5. Once you allow it, the action runs on **the computer you chose**: the bot's own computer, the one you are using, or a paired hand.
|
||||
6. The result goes back into the chat. Phone and laptop show the same thing because both read the brain.
|
||||
|
||||
Three programs are enough, and there is no database server: `anybot` (the desktop, the background service `anybot --serve`, and the terminal setup `anybot setup` are this one file), `anybot-relay` (the account server; computers connect out to it), and the phone page (one file, built into the app). Details in [docs/architecture.md](docs/architecture.md).
|
||||
Three programs are enough, and there is no database server: `anybot` (the desktop, the background service `anybot --serve`, and the terminal setup `anybot setup` are this one file), `anybot-relay` (the account server; computers connect out to it), and the phone page (one file, built into the app). Details in [docs/en/architecture.md](docs/en/architecture.md).
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -150,16 +213,18 @@ Three programs are enough, and there is no database server: `anybot` (the deskto
|
|||
|
||||
| You want… | Read |
|
||||
|---|---|
|
||||
| Phone, brain, hands, “it will not connect” | [docs/multi-device.md](docs/multi-device.md) |
|
||||
| A platform failed, build it yourself | [docs/install.md](docs/install.md) |
|
||||
| How the code is layered | [docs/architecture.md](docs/architecture.md) |
|
||||
| What a bot remembers, and how much reaches the model (Chinese) | [docs/memory.md](docs/memory.md) |
|
||||
| The account server's API | [docs/protocol.md](docs/protocol.md) |
|
||||
| Trust boundaries, where keys live | [SECURITY.md](SECURITY.md) |
|
||||
| Every feature, listed | [FEATURES.md](FEATURES.md) |
|
||||
| Packaging, CI | [docs/release.md](docs/release.md) |
|
||||
| How a feature works, where to set it | [Feature map](docs/feature-map/README.md) (Chinese) |
|
||||
| Every feature with its details and numbers | [FEATURES.md](FEATURES.md) (Chinese) |
|
||||
| Phone, brain, hands, “it will not connect” | [docs/en/multi-device.md](docs/en/multi-device.md) |
|
||||
| A platform failed, build it yourself | [docs/en/install.md](docs/en/install.md) |
|
||||
| How the code is layered | [docs/en/architecture.md](docs/en/architecture.md) |
|
||||
| What a bot remembers, how much reaches the model | [docs/memory.md](docs/memory.md) (Chinese) |
|
||||
| The skill format | [docs/skills.md](docs/skills.md) (Chinese) |
|
||||
| The account server's API | [docs/en/protocol.md](docs/en/protocol.md) |
|
||||
| Trust boundaries, where keys live | [docs/en/security.md](docs/en/security.md) |
|
||||
| Packaging, CI | [docs/release.md](docs/release.md) (Chinese) |
|
||||
|
||||
Chinese is the source of truth; `docs/en/` is a summary for people who do not read Chinese.
|
||||
Chinese is the source of truth; the `docs/en/` files are English summaries of it.
|
||||
|
||||
## Hack on it
|
||||
|
||||
|
|
@ -169,7 +234,13 @@ cd AnyBot
|
|||
make deps && make && make install
|
||||
```
|
||||
|
||||
`make run` opens it, `make test` runs the tests, `make help` lists everything.
|
||||
`make run` opens it, `make test` runs the tests, `make lint` runs the same clippy check as CI, `make help` lists everything.
|
||||
|
||||
Before changing a feature, read its part of the [feature map](docs/feature-map/README.md); when behaviour changes, update that file in the same commit — `cargo test featuremap::` catches what was left out. The full rules are in [CLAUDE.md](CLAUDE.md).
|
||||
|
||||
## Security
|
||||
|
||||
Found a vulnerability? Please do not post it publicly; report it privately as described in [SECURITY.md](SECURITY.md) ([English summary](docs/en/security.md)).
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
115
README.md
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<p align="center">
|
||||
<b>跑在你自己電腦上的 AI 助理。</b><br>
|
||||
會聊天,也會做事:整理檔案、跑指令、看網頁、操作螢幕、到點自己排。
|
||||
會聊天,也會動手:整理檔案、跑指令、開瀏覽器填表、操作螢幕、到點自己做。動手之前先問你。
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
|
|
@ -17,14 +17,23 @@
|
|||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache-2.0"></a>
|
||||
<img src="https://img.shields.io/badge/macOS%20%C2%B7%20Linux%20%C2%B7%20Windows-1c1c1c" alt="macOS, Linux, Windows">
|
||||
<img src="https://img.shields.io/badge/Rust%201.95-orange" alt="Rust 1.95">
|
||||
<img src="https://img.shields.io/badge/version-0.1.0-lightgrey" alt="v0.1.0">
|
||||
<img src="https://img.shields.io/badge/self--hosted-green" alt="self-hosted">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="shots/readme/chat.png" alt="左邊是不同的 Bot,右邊是跟其中一個聊天" width="960">
|
||||
<img src="shots/readme/ask.png" alt="電腦助手要整理下載資料夾的照片,執行指令前先跳出卡片問你:允許、一律允許、拒絕;你在它工作時補的一句話排在輸入框下面" width="960">
|
||||
</p>
|
||||
|
||||
模型用你自己的金鑰:xAI、OpenAI、Claude、Gemini、OpenRouter、OpenCode Go、家裡的 Ollama,或任何講 OpenAI 那套介面的服務。聊天記錄、檔案、密碼留在你的機器上,不會先存進別人的帳號伺服器。左邊每一行都是一個 Bot:研究、寫作、管電腦,可以各用各的模型。
|
||||
**模型你選。** 用自己的 API 金鑰:xAI、OpenAI、Claude、Gemini、OpenRouter、OpenCode Go,或任何講 OpenAI 那套介面的服務。有 ChatGPT Plus、Pro 的話,用 ChatGPT 帳號登入就能用方案的額度,不用金鑰。什麼都沒有就用家裡的 Ollama。每個 Bot 各用各的模型。
|
||||
|
||||
**資料留在你這邊。** 聊天、記憶、檔案、保險庫裡的密碼都在你的電腦,或你自己架的伺服器上。帳號伺服器也是你自己架的,只負責把裝置接起來;備份在你的電腦上加密後才上傳,伺服器打不開。
|
||||
|
||||
**一群 Bot,不是一個。** 左邊每一個都是獨立的 Bot,有自己的個性、模型、記憶、技能和可以用的電腦。它們會互相問問題、交辦工作,也能在群組裡一起回答你。
|
||||
|
||||
<p align="center">
|
||||
<a href="FEATURES.md">完整功能</a> · <a href="docs/feature-map/README.md">功能地圖</a> · <a href="docs/multi-device.md">多台電腦與手機</a> · <a href="SECURITY.md">安全</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -44,12 +53,11 @@ irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 | iex
|
|||
|
||||
它會自己裝好需要的東西、問你要裝哪一種,然後做第一次設定。第一次編譯 5–15 分鐘,之後更新 1–2 分鐘;裝在你的使用者資料夾,不需要系統管理員。
|
||||
|
||||
裝好打開 AnyBot(Mac 第一次要對圖示按右鍵 › 打開),「設定 › 模型」貼上 API 金鑰,建一個 Bot 就能開始聊。沒有金鑰可以選 Ollama,在你自己的電腦上跑。
|
||||
|
||||
**帳號伺服器 + 大腦**(任何有 Docker 的 Linux,2 GB 以上;只問網址、帳號、密碼,HTTPS 它自己處理):
|
||||
|
||||
```sh
|
||||
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh | sh -s -- server
|
||||
curl -fsSL https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.sh \
|
||||
| sh -s -- server
|
||||
```
|
||||
|
||||
**無頭手腳**(給 Bot 操控的電腦,沒螢幕也行)。網址和配對碼在 AnyBot 按「加一台電腦」就會看到:
|
||||
|
|
@ -69,31 +77,88 @@ irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 | iex
|
|||
|
||||
給代理程式跑、不要出現問句:`sh install.sh --print` 先問這台適合什麼,再用環境變數,見 [install/AGENT.md](install/AGENT.md)。
|
||||
|
||||
## 第一次用
|
||||
|
||||
1. 打開 AnyBot。Mac 第一次要對圖示按右鍵 › 打開(沒有 Apple 開發者簽章)。
|
||||
2. 歡迎畫面按「設定模型」,選一家:貼上 API 金鑰;或選「ChatGPT 方案」,按「使用 ChatGPT 繼續」用 ChatGPT 帳號登入;或選 Ollama,在你自己的電腦上跑。
|
||||
3. 建立你的第一個 Bot,跟它說一件事,例如「幫我把下載資料夾的照片照月份整理好」。它會先說要跑什麼,你按「允許」才動手。
|
||||
4. 在輸入框打「/」看指令,打「@」找其他 Bot 一起來。
|
||||
|
||||
在別台電腦用過 AnyBot?歡迎畫面按「登入帳號」,Bot 和聊天會跟過來。
|
||||
|
||||
---
|
||||
|
||||
## 它會先問你,再動手
|
||||
## 它會做什麼
|
||||
|
||||
你說「在我的電腦上做」,它不會默默執行。畫面上出現要做的事,你按允許才繼續。付款、寄出、刪除這類動作,每次都會再問一次,即使你關掉了別的詢問。
|
||||
### 在電腦上動手,先問你
|
||||
|
||||
- **檔案和指令** — 讀、改、搜尋、跑指令;跑很久的放背景,要互動的開真的終端機。在 macOS 和 Linux(核心有 Landlock 時)上,指令跑在沙盒裡,私密資料夾讀不到也改不了。Bot 改檔前先存一份,打 /rewind 就能退回。
|
||||
- **它自己的電腦** — 一台跑在 Docker 裡的 Linux 桌面(XFCE、Chromium),每個 Bot 有自己的螢幕和瀏覽器,跟你的電腦隔開。你隨時看得到它在做什麼,需要時接手。
|
||||
- **瀏覽器** — 開網頁、登入、點按、填表、上傳下載。密碼和卡號放在保險庫,由 AnyBot 直接填進網頁,模型看不到。發文、留言送出前先擋重複,送出後讀頁面確認真的出現了。
|
||||
- **你正在用的螢幕** — 看截圖上有編號的按鈕再點;要你登入或輸入驗證碼時,把畫面交給你。你示範一次,它照著學。
|
||||
- **先問你** — 要動你的電腦、對外送出、做收不回來的事,先跳卡片問。付款、寄出、刪除每次都問。可以對某一類「一律允許」、打開直接操作,或打 /always-approve 全部放行;安全規則擋下的,怎麼設都不放行。
|
||||
|
||||
### 交給它一件大事
|
||||
|
||||
- **/plan** — 先查清楚,交一張計畫卡給你核准;核准後才動手,做完一步打一個勾。
|
||||
- **/goal** — 給一個條件(例如「所有測試都通過」),每輪做完由另一個模型看證據判斷,沒達成就自己接著做。
|
||||
- **例行任務** — 說「每個工作日早上 9 點整理三則 AI 新聞」就排好;也可以在 PR 合併、CI 失敗、收到新信時跑。每次都留紀錄,連續失敗兩次自己暫停。
|
||||
- **插話和支線** — 它工作時照樣打字,它下一步就讀到;/btw 讓同一個 Bot 分身去做另一件事。
|
||||
- **監看** — 指令每印出新的一行就叫醒 Bot,適合盯部署和 log。
|
||||
|
||||
<p align="center">
|
||||
<img src="shots/readme/computer-phone.png" alt="左:Bot 要在你的電腦上執行指令前,先跳出允許一次、一律允許或拒絕。右:手機瀏覽器打開你的網址,先登入" width="960">
|
||||
<img src="shots/readme/plan.png" alt="打 /plan 請 Bot 把部落格搬到新主機,它交出一張計畫卡:摘要、六個步驟、怎麼確認做對了、注意事項,等你決定" width="960">
|
||||
</p>
|
||||
|
||||
- **整理檔案、跑指令** — 做之前先問。也可以只讓它用「它自己的電腦」,一個跟你隔開的小桌面。
|
||||
- **看網頁、填表** — 用它自己的瀏覽器。密碼和卡號由程式直接填,不會先念給模型聽。
|
||||
- **操作你正在用的畫面** — 看截圖上的按鈕再點。點不到,或是要你登入時,把畫面交給你。
|
||||
- **到點自己做** — 「每個工作日早上 9 點整理三則新聞」變成例行任務。
|
||||
- **手機隨時插手** — 瀏覽器打開你的網址、登入,就是同一個聊天,在外面也能看它做到哪。
|
||||
### 一群 Bot
|
||||
|
||||
- 每個 Bot 有自己的 Soul 與指示、擅長的事、能力、技能、記憶和可以用的電腦。從範本建(研究助理、寫作夥伴、電腦助手…),或自己建。
|
||||
- 問同事並等答案、交辦了就不等、把自己會的技能教給同事;任何聊天打「@」點名。
|
||||
- 群組聊天:成員依序回答,各用各的模型;看擅長分題,「@名字」交棒。
|
||||
|
||||
<p align="center">
|
||||
<img src="shots/readme/routines.png" alt="跟 Bot 說每個工作日早上九點整理新聞,它就排好例行任務" width="960">
|
||||
<img src="shots/readme/group.png" alt="旅遊小組的群組聊天:研究助理附上台南的天氣卡片,寫作夥伴接著補一個寫遊記的角度" width="960">
|
||||
</p>
|
||||
|
||||
### 記得、學會、寫下來
|
||||
|
||||
- **記憶** — 每個 Bot 記自己的;「關於你」所有 Bot 共用。打字時輸入框上方列出這次要帶的記憶,你可以點掉或加上。
|
||||
- **技能** — Agent Skills 的格式(SKILL.md),內建 pdf、xlsx、docx、pptx 等 8 個,也能從 GitHub 裝。做完一件長的事,它自己把成功的做法存成技能;存了步驟的,下次不經模型直接重播。
|
||||
- **頁面** — 要追蹤、比較的事寫成一頁(表格、圖表、數字卡),之後更新同一頁,舊版留著。
|
||||
|
||||
### 接到外面
|
||||
|
||||
- **連接器(MCP)** — 本機指令或遠端網址都可以,要登入的用帳號登入(OAuth)。市集有 8 個常用的,也能搜尋官方 MCP Registry。
|
||||
- **訊息管道** — Slack、Discord、Telegram、Teams、Mac 的「訊息」和「郵件」、簡訊、X:收到一則就讓指定的 Bot 回。外面來的訊息不受信任:不帶你的記憶、不給電腦工具、你給過的允許也不算。
|
||||
- **Mac App 與電話** — 郵件、備忘錄、訊息、提醒事項、行事曆、聯絡人;用你的 Twilio 號碼打電話、傳簡訊;在 X 發文。寄出、傳送、發文都一則問一次。
|
||||
- **Hooks 和腳本** — 在 Bot 做事的固定時間點跑你自己的程式(Claude Code 的格式);`anybot --ask "…" --json` 讓腳本直接問 Bot。
|
||||
|
||||
### 在外面也找得到它
|
||||
|
||||
- **手機** — 瀏覽器打開你的網址、登入,就是同一個聊天:核准、回答問題、看 Bot 的電腦、收通知。沒架伺服器的話,同一個 Wi-Fi 或 Tailscale 用手機密碼直接連。
|
||||
- **語音** — 說話輸入、語音聊天、把回答唸出來。
|
||||
- **傳送** — 從任一台裝置把檔案或幾句話丟到帳號裡的另一台。
|
||||
|
||||
<details>
|
||||
<summary><b>聊天裡的指令</b></summary>
|
||||
|
||||
- **/plan 要做的事** — 先規劃,你核准後才動手。
|
||||
- **/goal 條件** — 沒達成就繼續做;/goal clear 取消。
|
||||
- **/btw 要做的事** — 同一個 Bot 分身去做,不打斷手上這件。
|
||||
- **/always-approve**(或 /yolo)— 一律放行;加 off 關掉。
|
||||
- **/rewind** — 把 Bot 改的檔案和對話退回之前某一句。
|
||||
- **/fork** — 這段對話存一份分岔,之後各走各的。
|
||||
- **/context**、**/compact** — 看這段對話用了多少;現在就整理成摘要。
|
||||
- **/usage** — 最近一天和一週,各 Bot、各模型用了多少 token。
|
||||
- **/doctor** — 診斷連線、模型服務、Bot 的電腦、連接器、磁碟。
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## 一台想,幾台被用
|
||||
|
||||
一台負責想和記(**大腦**),其他電腦負責被操作(**手腳**),手機只是一個視窗。它們都連到你自己的**帳號伺服器**,所以家裡的電腦不用開連接埠、也不用固定 IP。
|
||||
一台負責想和記(**大腦**),其他電腦負責被操作(**手腳**),手機只是一個視窗。它們都連到你自己的**帳號伺服器**,所以家裡的電腦不用開連接埠、也不用固定 IP。手腳只聽大腦簽過名的指令。
|
||||
|
||||
```
|
||||
你在手機上說話 你在筆電上說話 沒螢幕的電腦也行
|
||||
|
|
@ -114,8 +179,6 @@ irm https://code.30cm.net/daniel.w/AnyBot/raw/branch/main/install.ps1 | iex
|
|||
|
||||
沒有伺服器也可以先拿一台 Mac 當大腦,見 [docs/multi-device.md](docs/multi-device.md) 的做法 B。
|
||||
|
||||
---
|
||||
|
||||
## 一句話進去之後
|
||||
|
||||
```mermaid
|
||||
|
|
@ -136,10 +199,10 @@ flowchart TD
|
|||
```
|
||||
|
||||
1. 你在桌面或手機送出訊息。手機不自己想,它看的是大腦上的同一份聊天。
|
||||
2. 大腦把這句話、這個 Bot 的指示、它能用的工具,交給你選的模型。
|
||||
2. 大腦把這句話、這個 Bot 的指示、記憶和它能用的工具,交給你選的模型。
|
||||
3. 模型只要回答就直接寫回來;要讀檔、開網頁、點畫面,就提出一個動作。
|
||||
4. 這個動作先過 AnyBot 自己的規則,不讓模型決定能不能做。
|
||||
5. 你允許之後,動作在**你指定的那台電腦**上做:隔離桌面、你正在用的這台,或一台配對過的手腳。
|
||||
5. 你允許之後,動作在**你指定的那台電腦**上做:Bot 自己的電腦、你正在用的這台,或一台配對過的手腳。
|
||||
6. 結果回到聊天。手機、筆電看到同一份,因為都在看大腦。
|
||||
|
||||
三支程式就夠了,沒有資料庫伺服器:`anybot`(桌面、背景 `anybot --serve`、終端機設定 `anybot setup` 都這一支)、`anybot-relay`(帳號伺服器,電腦主動連過去)、手機網頁(一個檔案,做在程式裡)。實作細節在 [docs/architecture.md](docs/architecture.md)。
|
||||
|
|
@ -150,13 +213,15 @@ flowchart TD
|
|||
|
||||
| 你想… | 看 |
|
||||
|---|---|
|
||||
| 某個功能怎麼用、去哪裡設 | [功能地圖](docs/feature-map/README.md) |
|
||||
| 每個功能的細節和數字 | [FEATURES.md](FEATURES.md) |
|
||||
| 手機、大腦、手腳、連不上 | [docs/multi-device.md](docs/multi-device.md) |
|
||||
| 某個平台裝失敗、要自己編譯 | [docs/install.md](docs/install.md) |
|
||||
| 程式怎麼分層 | [docs/architecture.md](docs/architecture.md) |
|
||||
| Bot 記得什麼、帶多少給模型 | [docs/memory.md](docs/memory.md) |
|
||||
| 技能的格式 | [docs/skills.md](docs/skills.md) |
|
||||
| 帳號伺服器的介面 | [docs/protocol.md](docs/protocol.md) |
|
||||
| 信任邊界、金鑰放哪 | [SECURITY.md](SECURITY.md) |
|
||||
| 功能一條條清單 | [FEATURES.md](FEATURES.md) |
|
||||
| 打包、自動建置 | [docs/release.md](docs/release.md) |
|
||||
|
||||
英文摘要在 `docs/en/`。
|
||||
|
|
@ -169,7 +234,13 @@ cd AnyBot
|
|||
make deps && make && make install
|
||||
```
|
||||
|
||||
`make run` 直接打開,`make test` 跑測試,`make help` 看全部。
|
||||
`make run` 直接打開,`make test` 跑測試,`make lint` 跑跟 CI 一樣的 clippy,`make help` 看全部。
|
||||
|
||||
改某個功能前,先讀[功能地圖](docs/feature-map/README.md)裡那一區;行為改了,同一個 commit 一起改那一份,`cargo test featuremap::` 會擋下漏寫的。完整規則在 [CLAUDE.md](CLAUDE.md)。
|
||||
|
||||
## 安全
|
||||
|
||||
發現漏洞請不要公開貼出來,照 [SECURITY.md](SECURITY.md) 私下通報。
|
||||
|
||||
## 授權
|
||||
|
||||
|
|
|
|||
|
|
@ -1,53 +1,49 @@
|
|||
# Demo media
|
||||
|
||||
README 用的圖(`shots/readme/`)一律從**目前這版程式**重拍,不要用 `shots/`(那是舊的對比圖)。
|
||||
README 用的圖(`shots/readme/`)一律從**目前這版程式**重拍,不要用 `shots/`(那是舊的對比圖)。現在三張:
|
||||
|
||||
統一用深色(`ANYBOT_SHOT_DARK=1`)、照 2x 拍、再壓到 960px 寬:README 的圖就是 960px,這樣在 Retina 上清楚,也不會撐破文件欄(約 980px)。
|
||||
| 圖 | 畫面 |
|
||||
|---|---|
|
||||
| ask.png | 最上面那張:電腦助手等你允許整理照片的指令 |
|
||||
| plan.png | 「交給它一件大事」:/plan 交出的計畫卡 |
|
||||
| group.png | 「一群 Bot」:旅遊小組的群組聊天 |
|
||||
|
||||
統一用深色(`ANYBOT_SHOT_DARK=1`)、放大 1.5 倍拍 1920×1050、再壓到 960px 寬:README 的圖就是 960px,字看得清楚,也不會撐破文件欄(約 980px)。視窗比螢幕大時會被縮到螢幕那麼大,所以 `ANYBOT_SHOT_SIZE` 別超過你的螢幕。
|
||||
|
||||
## 拍桌面
|
||||
|
||||
截圖模式用示範資料、不存檔,但照樣跟你真的 AnyBot 隔開:清掉金鑰、自己的 HOME 和資料夾、不碰 Docker。左下角的名字是 `id -F` 讀的(你的全名),拍之前用一支假的 `id` 換成「你」。
|
||||
|
||||
```sh
|
||||
cargo build --bin anybot
|
||||
export ANYBOT_DATA_DIR=/tmp/anybot-readme-shot ANYBOT_SHOT_FRAMES=48 \
|
||||
ANYBOT_SHOT_SIZE=1920x1200 ANYBOT_SHOT_DARK=1
|
||||
S=$(mktemp -d); mkdir -p "$S/bin" "$S/home"; printf '#!/bin/sh\nexit 1\n' > "$S/bin/id"; chmod +x "$S/bin/id"
|
||||
shot() { # shot <名字> [VAR=值 …]
|
||||
n=$1; shift
|
||||
env -u USER -u LOGNAME -u XAI_API_KEY -u OPENAI_API_KEY -u ANTHROPIC_API_KEY -u GEMINI_API_KEY \
|
||||
-u OPENROUTER_API_KEY -u OPENCODE_API_KEY -u REMOTE_API_KEY \
|
||||
PATH="$S/bin:$PATH" HOME="$S/home" ANYBOT_DATA_DIR="$S/data" \
|
||||
DOCKER_HOST=unix:///nonexistent ANYBOT_HF_BASE=http://127.0.0.1:9 \
|
||||
ANYBOT_SHOT_FRAMES=48 ANYBOT_SHOT_SIZE=1920x1050 ANYBOT_SHOT_ZOOM=1.5 ANYBOT_SHOT_DARK=1 "$@" \
|
||||
target/debug/anybot --screenshot "$S/$n.png"
|
||||
}
|
||||
shot ask # 預設示範資料:裡面就有允許卡片
|
||||
shot plan ANYBOT_SHOT_VIEW=plan ANYBOT_SHOT_NOPOPUP=1
|
||||
shot group ANYBOT_SHOT_VIEW=group ANYBOT_SHOT_NOPOPUP=1
|
||||
|
||||
ANYBOT_SHOT_VIEW=chat ANYBOT_SHOT_NOPOPUP=1 target/debug/anybot --screenshot /tmp/chat.png
|
||||
target/debug/anybot --screenshot /tmp/ask.png # 預設示範資料:裡面就有允許卡片
|
||||
ANYBOT_SHOT_VIEW=routines ANYBOT_SHOT_NOPOPUP=1 target/debug/anybot --screenshot /tmp/routines.png
|
||||
|
||||
python3 - <<'PY'
|
||||
python3 - "$S" <<'PY'
|
||||
import sys
|
||||
from PIL import Image
|
||||
for n in ('chat', 'ask', 'routines'):
|
||||
im = Image.open(f'/tmp/{n}.png')
|
||||
for n in ('ask', 'plan', 'group'):
|
||||
im = Image.open(f'{sys.argv[1]}/{n}.png').convert('RGB')
|
||||
im.resize((960, round(im.size[1] * 960 / im.size[0])), Image.LANCZOS).save(f'shots/readme/{n}.png', optimize=True)
|
||||
PY
|
||||
```
|
||||
|
||||
`ANYBOT_SHOT_NOPOPUP=1` 把允許卡片壓掉(拍乾淨的畫面)。要卡片就**不要**加 `ANYBOT_SHOT_VIEW`,預設的示範資料會選到正在等允許的那個 Bot。
|
||||
`ANYBOT_SHOT_NOPOPUP=1` 把允許卡片壓掉(拍乾淨的畫面)。要卡片就**不要**加 `ANYBOT_SHOT_VIEW`,預設的示範資料會選到正在等允許的那個 Bot。其他畫面(`chat`、`goal`、`routines`、`ask`、`btw`、`talk`…)見 `src/app.rs` 裡 `ANYBOT_SHOT_VIEW` 那一段。
|
||||
|
||||
## 拍手機
|
||||
## 手機(README 現在沒有放)
|
||||
|
||||
`shots/readme/phone.png` 是目前的 `mobile/index.html`,390×844 的瀏覽器截圖,壓到 300px 寬。不是舊的 `shots/phone.png` 那張拼圖。
|
||||
|
||||
```sh
|
||||
python3 -m http.server 8766 --directory mobile &
|
||||
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new --disable-gpu \
|
||||
--hide-scrollbars --window-size=390,844 --screenshot=/tmp/phone.png http://127.0.0.1:8766/index.html
|
||||
kill %1
|
||||
python3 -c "from PIL import Image; im=Image.open('/tmp/phone.png'); im.resize((300, round(im.size[1]*300/im.size[0])), Image.LANCZOS).save('shots/readme/phone.png', optimize=True)"
|
||||
```
|
||||
|
||||
手機頁面預設跟著系統深淺色;README 的圖是深色,拍之前在那支手機(或 Chrome 的模擬偏好)設成深色。
|
||||
|
||||
## 電腦 + 手機那張合成圖
|
||||
|
||||
README 中間用一張合成圖(左:桌面允許卡片,右:手機登入),手機才不會被单独摆在中间、被挤到一边。合成是程式做的,重拍後重跑一次:
|
||||
|
||||
```sh
|
||||
python3 docs/demo/composite.py # shots/readme/{ask,phone}.png → computer-phone.png
|
||||
```
|
||||
|
||||
改大小就編輯 `docs/demo/composite.py` 最上面的 `W / pad / gap / phone_w`。
|
||||
手機頁沒有示範資料,沒接上大腦時只拍得到登入頁,所以 README 先不放手機的圖。要拍的話:390×844 的瀏覽器、深色,從 `mobile/index.html` 起一個本機伺服器;headless Chrome 加 `--force-device-scale-factor=2` 時版面會被切掉,用一般的 Chrome 開發者工具(裝置模擬)拍比較穩。
|
||||
|
||||
## 動圖(還沒有)
|
||||
|
||||
|
|
@ -57,7 +53,7 @@ README 上最好有一段會動的。要录:
|
|||
2. 录 20–40 秒一件事從頭到尾,例如「整理下載資料夾」(聊天 → 計畫 → 工具步驟 → 檔案真的被搬動),加一段操作電腦(開瀏覽器、填表、在送出前停下——**允許卡片跳出來那一刻就是產品**)。
|
||||
3. 輸出 GIF:`ffmpeg -i clip.mov -vf "fps=12,scale=960:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" docs/demo/anybot.gif`
|
||||
(控制在 8 MB 內,太大就只留一件事)
|
||||
4. 檔名 `docs/demo/anybot.gif`,README 註解裡有要放的位置。
|
||||
4. 檔名 `docs/demo/anybot.gif`,放在 README 最上面那張圖的位置。
|
||||
|
||||
偏好:一支 GIF(桌面 + 電腦操作 + 允許卡片)加一支 30 秒 MP4(`demo.mp4`,手機配對新電腦)。
|
||||
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Build the README's computer-and-phone still from the two raw shots.
|
||||
|
||||
Run docs/demo/README.md's capture steps first (dark, 2x), then:
|
||||
|
||||
python3 docs/demo/composite.py
|
||||
"""
|
||||
from PIL import Image, ImageDraw
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(__file__).resolve().parents[2]
|
||||
shots = root / "shots" / "readme"
|
||||
BG = (22, 22, 22) # the app's dark pane, so the canvas reads as one screen
|
||||
|
||||
desk = Image.open(shots / "ask.png").convert("RGB") # the approval card
|
||||
phone = Image.open(shots / "phone.png").convert("RGB") # the sign-in page
|
||||
|
||||
W, pad, gap, phone_w = 960, 24, 24, 264
|
||||
phone_h = round(phone.size[1] * phone_w / phone.size[0])
|
||||
desk_w = W - 2 * pad - gap - phone_w
|
||||
desk_h = round(desk.size[1] * desk_w / desk.size[0])
|
||||
H = pad + max(phone_h, desk_h) + pad
|
||||
|
||||
def rounded(im, r):
|
||||
mask = Image.new("L", im.size, 0)
|
||||
ImageDraw.Draw(mask).rounded_rectangle([0, 0, *im.size], radius=r, fill=255)
|
||||
out = Image.new("RGB", im.size, BG)
|
||||
out.paste(im, (0, 0), mask)
|
||||
return out, mask
|
||||
|
||||
canvas = Image.new("RGB", (W, H), BG)
|
||||
im, mask = rounded(desk.resize((desk_w, desk_h), Image.LANCZOS), 12)
|
||||
canvas.paste(im, (pad, pad + (phone_h - desk_h) // 2), mask)
|
||||
im, mask = rounded(phone.resize((phone_w, phone_h), Image.LANCZOS), 18)
|
||||
canvas.paste(im, (W - pad - phone_w, pad), mask)
|
||||
|
||||
out = shots / "computer-phone.png"
|
||||
canvas.save(out, optimize=True)
|
||||
print(out.relative_to(root), canvas.size)
|
||||
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 70 KiB |