hob-bot 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -5
- package/README.zh-CN.md +75 -5
- package/dist/web/assets/DesktopView-rVxacveF.js +5 -0
- package/dist/web/assets/index-B-8ISOr1.js +267 -0
- package/dist/web/assets/index-Cu1Pf8yX.css +1 -0
- package/dist/web/assets/{math-zZ4JA8eM.js → math-weKGDUmL.js} +2 -2
- package/dist/web/index.html +2 -2
- package/dist/web/mock/desktop.jpg +0 -0
- package/dist/web/mock/photo.jpg +0 -0
- package/dist/web/mock/photo2.jpg +0 -0
- package/dist/web/mock/sunset.html +90 -0
- package/dist/web/mock//347/201/253/346/230/237/346/227/245/350/220/275/347/244/272/346/204/217/345/233/276.md +34 -0
- package/package.json +10 -2
- package/server/src/actions.ts +24 -57
- package/server/src/assistant-skills.ts +201 -0
- package/server/src/boot.ts +1 -0
- package/server/src/claude-status.ts +47 -0
- package/server/src/config.ts +3 -1
- package/server/src/delegations.ts +40 -12
- package/server/src/desktop-control.ts +152 -0
- package/server/src/desktop-events.ts +63 -0
- package/server/src/desktop-public.ts +43 -0
- package/server/src/desktop-tools.ts +161 -0
- package/server/src/desktop.ts +76 -0
- package/server/src/embedding.ts +52 -0
- package/server/src/files.ts +63 -43
- package/server/src/http.ts +334 -15
- package/server/src/jobs.ts +330 -59
- package/server/src/knowledge-index.ts +123 -0
- package/server/src/knowledge-tools.ts +94 -0
- package/server/src/knowledge.ts +451 -0
- package/server/src/lore-entry.ts +10 -0
- package/server/src/main.ts +6 -0
- package/server/src/mcp.ts +745 -0
- package/server/src/memory.ts +11 -4
- package/server/src/now.ts +33 -0
- package/server/src/overview.ts +1 -1
- package/server/src/pages.ts +1 -1
- package/server/src/pi.ts +92 -16
- package/server/src/prompt.ts +46 -154
- package/server/src/providers.ts +3 -2
- package/server/src/push.ts +42 -7
- package/server/src/router-activity.ts +4 -0
- package/server/src/router-tools.ts +132 -38
- package/server/src/router.ts +159 -19
- package/server/src/routines.ts +14 -4
- package/server/src/runtime.ts +15 -0
- package/server/src/settings.ts +43 -1
- package/server/src/store.ts +4 -3
- package/server/src/thumbs.ts +49 -0
- package/server/src/transcript.ts +57 -4
- package/server/src/worker-tools.ts +14 -12
- package/shared/knowledge.ts +92 -0
- package/shared/mcp.ts +91 -0
- package/shared/media.ts +6 -0
- package/shared/plain-text.ts +31 -0
- package/shared/skills.ts +18 -0
- package/shared/sprites.ts +198 -0
- package/shared/types.ts +105 -20
- package/vendor/claude-bridge/HOB-PATCH.md +10 -0
- package/vendor/claude-bridge/LICENSE +21 -0
- package/vendor/claude-bridge/package.json +62 -0
- package/vendor/claude-bridge/src/agents-md.ts +14 -0
- package/vendor/claude-bridge/src/askclaude-schema.ts +92 -0
- package/vendor/claude-bridge/src/askclaude-ui.ts +90 -0
- package/vendor/claude-bridge/src/attachments.ts +135 -0
- package/vendor/claude-bridge/src/config.ts +105 -0
- package/vendor/claude-bridge/src/convert.ts +222 -0
- package/vendor/claude-bridge/src/extract-tool-results.ts +47 -0
- package/vendor/claude-bridge/src/index.ts +2503 -0
- package/vendor/claude-bridge/src/log-paths.ts +19 -0
- package/vendor/claude-bridge/src/mcp-server.ts +169 -0
- package/vendor/claude-bridge/src/models.ts +164 -0
- package/vendor/claude-bridge/src/prompt-capture.ts +420 -0
- package/vendor/claude-bridge/src/prompt-stream.ts +102 -0
- package/vendor/claude-bridge/src/query-state.ts +118 -0
- package/vendor/claude-bridge/src/rate-limit.ts +48 -0
- package/vendor/claude-bridge/src/session-cwd.ts +38 -0
- package/vendor/claude-bridge/src/session-verify.ts +38 -0
- package/vendor/claude-bridge/src/skills.ts +20 -0
- package/vendor/claude-bridge/src/transcript.ts +86 -0
- package/vendor/claude-bridge/src/usage.ts +53 -0
- package/vendor/lore-pi-extension/package.json +1 -1
- package/vendor/lore-pi-extension/tools.ts +8 -5
- package/dist/web/assets/index-C72gAwgN.css +0 -1
- package/dist/web/assets/index-Dyw5G8Pg.js +0 -230
package/README.md
CHANGED
|
@@ -14,20 +14,30 @@
|
|
|
14
14
|
|
|
15
15
|
**Assistants that grow out of your habits.** When the same kind of request repeats, Hob suggests a dedicated assistant ("写作", "服务器", "记账" …). Each one keeps its own conversation, duties, approval rules, schedules and work log, and you configure all of it in one panel.
|
|
16
16
|
|
|
17
|
-
**Delegation you can see.** Hob hands work to the right assistant and keeps a delegation card in its own chat: status, linked jobs, and any pending question, which you can answer right on the card.
|
|
17
|
+
**Delegation you can see.** Hob hands work to the right assistant and keeps a delegation card in its own chat: status, linked jobs, and any pending question, which you can answer right on the card. Your original words travel with the work; reply in the receiving assistant's chat to take over, or reply in chat to close a pending question.
|
|
18
|
+
|
|
19
|
+
**Work that can continue.** Assistants can read files and full job results, and resume a finished job with separate cards and reports for each round. Archive an assistant when no longer needed while keeping its conversations and job history.
|
|
18
20
|
|
|
19
21
|
**Asks first, then remembers.** Each assistant has "confirm before running" rules. Pick "always allow" once and it becomes a rule, so you won't be asked about that again.
|
|
20
22
|
|
|
21
|
-
**Schedules.** Daily briefs, weekly reports, month-end checks: routines run on cron-style schedules and post results into the assistant's conversation.
|
|
23
|
+
**Schedules.** Daily briefs, weekly reports, month-end checks: routines run on cron-style schedules and post job cards and results into the assistant's conversation. A routine can also use a saved assistant skill.
|
|
24
|
+
|
|
25
|
+
**Knowledge bases.** Organize, search and preview files, bind collections to assistants, and follow citations to source passages. An optional embedding model enables hybrid search; PDF text can also be indexed.
|
|
26
|
+
|
|
27
|
+
**Cloud desktop.** An optional separate container gives each assistant its own screen and browser, with a shared screen for selected assistants. Watch or take control, sync the clipboard, and type with your local input method.
|
|
28
|
+
|
|
29
|
+
**A clearer workspace.** The right panel brings assistant details, jobs, files and logs together, with docked file previews. Completed unread work is marked on the assistant's avatar.
|
|
22
30
|
|
|
23
31
|
**Pages instead of walls of text.** For processes, comparisons or research, an assistant can answer with a single-page visual document. It opens in the side panel and renders live while the model is still writing.
|
|
24
32
|
|
|
25
33
|
**Tools that come with it:**
|
|
26
34
|
|
|
27
35
|
- **Web search** across 10 providers (SearXNG, Exa, Tavily, Brave, Serper, Jina, Firecrawl, Perplexity, You.com, Ollama), used in order with automatic fallback.
|
|
28
|
-
- **Skills** from Hob's own skill folder, the shared `~/.agents/skills`, and Lore.
|
|
36
|
+
- **Skills** from Hob's own skill folder, the shared `~/.agents/skills`, and Lore. Import existing skills, or let assistants save reusable skills automatically or on request.
|
|
37
|
+
- **MCP servers** (stdio or streamable HTTP) that jobs can call, with per-server and per-tool switches; import what you already have from Claude Code, Cursor and pi.
|
|
29
38
|
- **Long-term memory**, kept locally or in [Lore](https://github.com/FFatTiger/lore).
|
|
30
|
-
- **Image generation** through
|
|
39
|
+
- **Image generation** in chat through an OpenAI-compatible image API, with a progress card while it runs.
|
|
40
|
+
- **Claude subscription** via an existing local Claude Code login on npm or source installs.
|
|
31
41
|
- **Push notifications** when an assistant needs your decision or a job finishes.
|
|
32
42
|
|
|
33
43
|
**Made for the phone too.** Hob is an installable web app with a mobile layout and Telegram-style gestures: swipe a message to reply, long-press for actions. Light and dark themes follow your system.
|
|
@@ -45,6 +55,14 @@ HOB_PASSWORD='choose-a-password' hob
|
|
|
45
55
|
|
|
46
56
|
Or run it once without installing: `HOB_PASSWORD='choose-a-password' npx hob-bot`.
|
|
47
57
|
|
|
58
|
+
With Docker instead (no Node.js needed; details in [Docker](#docker)):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
curl -O https://raw.githubusercontent.com/FFatTiger/hob/main/compose.yaml
|
|
62
|
+
echo "HOB_PASSWORD=choose-a-password" > .env
|
|
63
|
+
docker compose up -d
|
|
64
|
+
```
|
|
65
|
+
|
|
48
66
|
Open <http://127.0.0.1:30148> and sign in with that password. Then:
|
|
49
67
|
|
|
50
68
|
1. Go to **设置 → 服务商** (Settings → Providers) and add a provider. Built-in ones (Anthropic, OpenAI, Google, DeepSeek, OpenRouter, …) only need an API key; any OpenAI- or Anthropic-compatible endpoint works too.
|
|
@@ -63,8 +81,15 @@ Startup options are environment variables. Everything else, including providers,
|
|
|
63
81
|
| `HOB_PORT` | `30148` | HTTP port |
|
|
64
82
|
| `HOB_HOST` | `127.0.0.1` | Listen address |
|
|
65
83
|
| `HOB_PASSWORD` | — | Sign-in password; required on first start unless `password` is set in `config.json` |
|
|
84
|
+
| `HOB_DESKTOP_URL` | — | Cloud desktop service URL for deployment configuration |
|
|
85
|
+
| `HOB_DESKTOP_TOKEN` / `HOB_DESKTOP_TOKEN_FILE` | — | Cloud desktop bearer token or path to its token file; with a URL, a nonempty token overrides the UI setting |
|
|
86
|
+
| `HOB_LOCAL_PI_DIR` / `HOB_LOCAL_LORE_HOME` | `~/.pi/agent` / `~/.lore` | Optional source directories for explicit local imports; original `PI_CODING_AGENT_DIR` / `LORE_HOME` are used when these are unset |
|
|
66
87
|
|
|
67
|
-
|
|
88
|
+
`config.json` can also set `host`, `port` and the initial `password`; environment variables take precedence for host and port. Hob isolates its engine and memory directories under `HOB_HOME` and removes inherited model and Lore credentials from its runtime environment.
|
|
89
|
+
|
|
90
|
+
Conversations, jobs, memory, skills, keys and engine state live in `HOB_HOME`. To reuse providers or a Lore connection you already have on the machine, import them explicitly in settings. Back up `HOB_HOME` to preserve Hob's data.
|
|
91
|
+
|
|
92
|
+
**Claude subscription:** For npm or source installs, install Claude Code and sign in locally with `claude auth login`, then enable Claude subscription under **Settings → Providers**, choose Pro or Max and select the models under **Settings → Models**. Usage counts against the same Claude subscription quota as Claude Code. Docker images do not support this feature. Hob does not read, copy, store or forward Claude credentials; the official Claude Code program uses its existing login. Claude Code writes its own session records under `~/.claude/projects/`, outside `HOB_HOME`.
|
|
68
93
|
|
|
69
94
|
## Deploy
|
|
70
95
|
|
|
@@ -75,6 +100,47 @@ pm2 start hob --name hob # after npm install -g hob-bot
|
|
|
75
100
|
pm2 start deploy/pm2.config.cjs # or from a source checkout: process "hob", port 30148, data in ~/.hob
|
|
76
101
|
```
|
|
77
102
|
|
|
103
|
+
### Docker
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
curl -O https://raw.githubusercontent.com/FFatTiger/hob/main/compose.yaml
|
|
107
|
+
echo "HOB_PASSWORD=change-me" > .env # only needed on first start
|
|
108
|
+
docker compose up -d
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This pulls `ghcr.io/ffattiger/hob` (amd64 and arm64, built for every release). From a source checkout, `docker compose up -d --build` builds the image locally instead. Open `http://127.0.0.1:30148`. Data lives in the `hob-data` volume (`/data` in the container), and the password is stored there as a hash, so you can delete `.env` afterwards. The port is bound to localhost for a reverse proxy; change it to `"30148:30148"` in `compose.yaml` for direct LAN access.
|
|
112
|
+
|
|
113
|
+
Jobs run inside the container (git, curl, python3, ripgrep and fd are installed). Local-command MCP servers also run inside the container, so their command must exist in the image (node and npx are included; uvx and other language package managers are not). To let jobs work on projects on the host, create `workspace/` (the container runs as uid 1000), uncomment the `./workspace:/workspace` mount and give jobs that directory.
|
|
114
|
+
|
|
115
|
+
### Cloud desktop
|
|
116
|
+
|
|
117
|
+
The optional cloud desktop is a separate Linux container. Each assistant has its own screen and browser profile, started on first use. An additional public screen can be enabled for selected assistants in Settings → Cloud desktop; by default no assistant can use it. Only one job uses the public screen at a time, and others wait up to 10 minutes. Screens with no viewers, browser connections or activity are reclaimed after 30 minutes by default; browser login data persists. With the root `compose.yaml` and `HOB_PASSWORD` set in `.env`, start both services with:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
docker compose --profile desktop up -d
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The desktop is not published to the host network. Hob reads the generated token from a shared volume and shows **由部署配置** in Settings → Cloud desktop. Without the profile Hob runs alone and the desktop is unconfigured.
|
|
124
|
+
|
|
125
|
+
For an independent deployment, use [`desktop/compose.yaml`](desktop/compose.yaml) or the `docker run` command in [the desktop guide](desktop/README.md), then enter the service URL and token in Hob's settings. When the desktop profile is not running and its shared token file is absent or empty, Hob uses the desktop configured in settings; once the token file appears, the Compose deployment takes precedence. Anyone signed into Hob can view and take over an individual screen; log into websites yourself, not through the assistant. Google currently blocks Google account sign-in in a browser with remote debugging enabled. Browser cookies in the desktop data volume are sensitive. Bearer tokens travel in cleartext over HTTP: use a trusted private network or HTTPS for connections between machines, and do not expose VNC or CDP ports.
|
|
126
|
+
|
|
127
|
+
Measured for desktop v2 on an amd64 host: image disk usage was 2.03 GB; memory was 23.5 MiB without screens, 354.9 MiB with one Chrome screen on example.com, and 1017 MiB with three Chrome screens on new tabs. The page workloads differ, and actual usage depends on the host and pages.
|
|
128
|
+
|
|
129
|
+
Behind a reverse proxy, the desktop view needs WebSocket upgrades on `/api/desktop/vnc`. With nginx:
|
|
130
|
+
|
|
131
|
+
```nginx
|
|
132
|
+
location = /api/desktop/vnc {
|
|
133
|
+
proxy_pass http://127.0.0.1:30148;
|
|
134
|
+
proxy_http_version 1.1;
|
|
135
|
+
proxy_set_header Host $http_host;
|
|
136
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
137
|
+
proxy_set_header Connection "upgrade";
|
|
138
|
+
proxy_read_timeout 3600s;
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The bundled noVNC client is licensed under MPL-2.0; Playwright is Apache-2.0.
|
|
143
|
+
|
|
78
144
|
## Development
|
|
79
145
|
|
|
80
146
|
```bash
|
|
@@ -96,3 +162,7 @@ Stack: Node 22 + TypeScript, Hono with SSE, Vite + React with hand-written CSS.
|
|
|
96
162
|
## License
|
|
97
163
|
|
|
98
164
|
[MIT](LICENSE)
|
|
165
|
+
|
|
166
|
+
## Community
|
|
167
|
+
|
|
168
|
+
This open-source project is linked with and endorses the [LINUX DO community](https://linux.do).
|
package/README.zh-CN.md
CHANGED
|
@@ -14,20 +14,30 @@
|
|
|
14
14
|
|
|
15
15
|
**从习惯里长出来的助手。** 同类要求反复出现时,Hob 会提议创建专门的助手,比如「写作」「服务器」「记账」。每个助手有自己的对话、职责、执行前确认规则、定时任务和工作日志,都在同一个面板里设置。
|
|
16
16
|
|
|
17
|
-
**看得见的委派。** Hob
|
|
17
|
+
**看得见的委派。** Hob 把事交给合适的助手后,在自己的对话里留一张委派卡,上面有状态、关联任务和待确认的问题,问题可以直接在卡上回答。派活会带上你的原话;在接收助手的对话中说话可以接手转交,在对话中回复也能结束待答提问。
|
|
18
|
+
|
|
19
|
+
**可以接着做。** 助手可以读取文件和完整任务结果,并续做已结束的任务,每轮分别保留卡片和报告。不再需要的助手可以归档,对话和历史任务仍会保留。
|
|
18
20
|
|
|
19
21
|
**先问,再记住。** 每个助手都有执行前确认规则。选一次「一直允许」就会记成规则,以后同类操作不再问。
|
|
20
22
|
|
|
21
|
-
**定时任务。** 每日简报、周报、月底对账,按 cron
|
|
23
|
+
**定时任务。** 每日简报、周报、月底对账,按 cron 式的时间表运行,任务卡和结果发到对应助手的对话里。定时任务也可以绑定已保存的助手技能。
|
|
24
|
+
|
|
25
|
+
**知识库。** 整理、搜索和预览文件,将知识库绑定给助手,并从出处跳转到原文段落。配置向量模型后可混合检索,也支持为 PDF 文字建立索引。
|
|
26
|
+
|
|
27
|
+
**云桌面。** 可选的独立容器为每个助手提供屏幕和浏览器,也可允许指定助手使用公共屏幕。你可以观看或接管,使用剪贴板同步和本机输入法。
|
|
28
|
+
|
|
29
|
+
**更清晰的工作区。** 右栏集中展示助手信息、任务、文件和日志,文件预览可停靠在对话旁。助手头像会标出完成未读的工作。
|
|
22
30
|
|
|
23
31
|
**用页面代替大段文字。** 讲流程、做对比、写调研时,助手可以交一页图文页面。页面在侧栏打开,模型边写边显示。
|
|
24
32
|
|
|
25
33
|
**自带的能力:**
|
|
26
34
|
|
|
27
35
|
- **联网搜索**:支持 10 个服务商(SearXNG、Exa、Tavily、Brave、Serper、Jina、Firecrawl、Perplexity、You.com、Ollama),按顺序使用,失败时自动换下一个。
|
|
28
|
-
- **技能**:读取 Hob 自己的技能目录、通用的 `~/.agents/skills` 和 Lore
|
|
36
|
+
- **技能**:读取 Hob 自己的技能目录、通用的 `~/.agents/skills` 和 Lore;可以导入已有技能,也可以由助手自动或按要求沉淀可复用的技能。
|
|
37
|
+
- **MCP 服务**:任务可以调用本地命令(stdio)或远程地址(streamable HTTP)的 MCP 服务,可按服务、按工具单独开关;可以从 Claude Code、Cursor、pi 导入已有配置。
|
|
29
38
|
- **长期记忆**:保存在本地,或接入 [Lore](https://github.com/FFatTiger/lore)。
|
|
30
|
-
-
|
|
39
|
+
- **图像生成**:接 OpenAI 兼容的图像接口,在对话里生图,并通过生成中卡片查看进度。
|
|
40
|
+
- **Claude 订阅**:npm 或源码安装时,可使用本机已有的 Claude Code 登录。
|
|
31
41
|
- **推送通知**:助手需要你确认、任务结束时通知你。
|
|
32
42
|
|
|
33
43
|
**手机上也好用。** Hob 可以安装成网页应用,手机上是专门的布局,交互照 Telegram:向左滑动消息即可回复,长按弹出菜单。支持亮色和暗色主题。
|
|
@@ -45,6 +55,14 @@ HOB_PASSWORD='设一个密码' hob
|
|
|
45
55
|
|
|
46
56
|
不想全局安装,也可以直接运行一次:`HOB_PASSWORD='设一个密码' npx hob-bot`。
|
|
47
57
|
|
|
58
|
+
也可以用 Docker(不需要 Node.js,详见 [Docker](#docker)):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
curl -O https://raw.githubusercontent.com/FFatTiger/hob/main/compose.yaml
|
|
62
|
+
echo "HOB_PASSWORD=设一个密码" > .env
|
|
63
|
+
docker compose up -d
|
|
64
|
+
```
|
|
65
|
+
|
|
48
66
|
打开 <http://127.0.0.1:30148>,用这个密码登录,然后:
|
|
49
67
|
|
|
50
68
|
1. 到 **设置 → 服务商** 添加服务商。内置服务商(Anthropic、OpenAI、Google、DeepSeek、OpenRouter 等)只需填 API Key;OpenAI 或 Anthropic 兼容接口也可以用。
|
|
@@ -63,8 +81,15 @@ HOB_PASSWORD='设一个密码' hob
|
|
|
63
81
|
| `HOB_PORT` | `30148` | HTTP 端口 |
|
|
64
82
|
| `HOB_HOST` | `127.0.0.1` | 监听地址 |
|
|
65
83
|
| `HOB_PASSWORD` | — | 登录密码;首次启动必填,除非 `config.json` 里已写了 `password` |
|
|
84
|
+
| `HOB_DESKTOP_URL` | — | 部署配置中的云桌面服务地址 |
|
|
85
|
+
| `HOB_DESKTOP_TOKEN` / `HOB_DESKTOP_TOKEN_FILE` | — | 云桌面令牌或令牌文件路径;地址和非空令牌同时存在时覆盖界面设置 |
|
|
86
|
+
| `HOB_LOCAL_PI_DIR` / `HOB_LOCAL_LORE_HOME` | `~/.pi/agent` / `~/.lore` | 主动从本机导入时使用的来源目录;未设置时使用原来的 `PI_CODING_AGENT_DIR` / `LORE_HOME` |
|
|
66
87
|
|
|
67
|
-
|
|
88
|
+
`config.json` 也可设置 `host`、`port` 和初始 `password`;host 和 port 以环境变量优先。Hob 将引擎和记忆目录隔离到 `HOB_HOME`,并从运行环境移除继承的模型及 Lore 凭据。
|
|
89
|
+
|
|
90
|
+
对话、任务、记忆、技能、Key 和引擎数据都在 `HOB_HOME` 里。想沿用本机已有的服务商或 Lore 连接,可以在设置里主动导入。备份 `HOB_HOME` 即可保留 Hob 的数据。
|
|
91
|
+
|
|
92
|
+
**Claude 订阅:** npm 或源码安装时,先安装 Claude Code 并在本机执行 `claude auth login`,然后在 **设置 → 服务商** 启用 Claude 订阅、选择 Pro 或 Max,再到 **设置 → 模型** 选择模型。用量计入 Claude 订阅额度,与 Claude Code 共用。Docker 镜像不支持此功能。Hob 不读取、复制、保存或转发 Claude 凭证,由官方 Claude Code 程序使用已有登录。Claude Code 会在 `~/.claude/projects/` 保存自己的会话记录,此目录不属于 `HOB_HOME`。
|
|
68
93
|
|
|
69
94
|
## 部署
|
|
70
95
|
|
|
@@ -75,6 +100,47 @@ pm2 start hob --name hob # npm install -g hob-bot 之后
|
|
|
75
100
|
pm2 start deploy/pm2.config.cjs # 或者在源码目录里:进程名 hob,端口 30148,数据在 ~/.hob
|
|
76
101
|
```
|
|
77
102
|
|
|
103
|
+
### Docker
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
curl -O https://raw.githubusercontent.com/FFatTiger/hob/main/compose.yaml
|
|
107
|
+
echo "HOB_PASSWORD=change-me" > .env # 只有首次启动需要
|
|
108
|
+
docker compose up -d
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
这会拉取 `ghcr.io/ffattiger/hob`(amd64 和 arm64,每次发版自动构建)。在源码目录里用 `docker compose up -d --build` 则在本地构建镜像。打开 `http://127.0.0.1:30148`。数据在 `hob-data` 卷里(容器内 `/data`),密码以哈希存在这里,之后可以删掉 `.env`。端口默认只绑本机,方便接反向代理;要局域网直连,把 `compose.yaml` 里的端口改成 `"30148:30148"`。
|
|
112
|
+
|
|
113
|
+
任务在容器里运行(装好了 git、curl、python3、ripgrep 和 fd)。本地命令类的 MCP 服务也在容器里运行,命令要在镜像里存在(镜像里有 node 和 npx,没有 uvx 等其他语言的包管理器)。要让任务处理宿主机上的项目,先建好 `workspace/` 目录(容器以 uid 1000 运行),取消注释 `./workspace:/workspace` 挂载,把任务的工作目录设在这里。
|
|
114
|
+
|
|
115
|
+
### 云桌面
|
|
116
|
+
|
|
117
|
+
云桌面是可选的独立 Linux 容器。每个助手有独立屏幕和浏览器登录状态,首次使用时启动。设置 → 云桌面中可以允许指定助手使用公共屏幕,默认不允许任何助手使用;公共屏幕同一时间只供一个任务使用,其他任务最多等待 10 分钟。没有观看者、浏览器连接和操作的屏幕默认空闲 30 分钟后回收,浏览器登录状态会保留。在根目录 `compose.yaml` 同目录的 `.env` 设置 `HOB_PASSWORD` 后,一条命令启动两项服务:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
docker compose --profile desktop up -d
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
桌面端口不会映射到宿主机;Hob 从共享卷读取自动生成的令牌,设置 → 云桌面会显示「由部署配置」。不加 profile 时 Hob 单独运行,云桌面显示未配置。
|
|
124
|
+
|
|
125
|
+
也可用 [`desktop/compose.yaml`](desktop/compose.yaml) 或[桌面部署说明](desktop/README.md)中的 `docker run` 单独部署,再在 Hob 设置中填写地址和令牌。没有启动 desktop profile、共享令牌文件不存在或为空时,Hob 使用设置里填写的云桌面;令牌文件出现后,以 Compose 部署为准。登录 Hob 的人都可以观看和接管单块屏幕,网站登录由人自己完成,不让助手代登。受 Google 限制,开启远程调试的浏览器目前无法登录 Google 账号。桌面数据卷里的浏览器 Cookie 是敏感信息;令牌通过 HTTP 明文传输,跨机器连接请使用可信内网或 HTTPS,不要映射 VNC / CDP 端口。
|
|
126
|
+
|
|
127
|
+
云桌面 v2 在一台 amd64 机器上的实测:镜像占用 2.03 GB;不开屏幕时内存 23.5 MiB,一块 Chrome 屏幕打开 example.com 时 354.9 MiB,三块 Chrome 屏幕打开新标签页时 1017 MiB。页面负载不同,实际占用因机器和页面而异。
|
|
128
|
+
|
|
129
|
+
前面有反向代理时,桌面画面需要 `/api/desktop/vnc` 支持 WebSocket 升级。nginx 示例:
|
|
130
|
+
|
|
131
|
+
```nginx
|
|
132
|
+
location = /api/desktop/vnc {
|
|
133
|
+
proxy_pass http://127.0.0.1:30148;
|
|
134
|
+
proxy_http_version 1.1;
|
|
135
|
+
proxy_set_header Host $http_host;
|
|
136
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
137
|
+
proxy_set_header Connection "upgrade";
|
|
138
|
+
proxy_read_timeout 3600s;
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
内置 noVNC 客户端使用 MPL-2.0 许可证,Playwright 使用 Apache-2.0。
|
|
143
|
+
|
|
78
144
|
## 开发
|
|
79
145
|
|
|
80
146
|
```bash
|
|
@@ -96,3 +162,7 @@ npm run typecheck
|
|
|
96
162
|
## 许可证
|
|
97
163
|
|
|
98
164
|
[MIT](LICENSE)
|
|
165
|
+
|
|
166
|
+
## 社区
|
|
167
|
+
|
|
168
|
+
本开源项目已链接并认可 [LINUX DO 社区](https://linux.do)。
|