hob-bot 1.3.0 → 1.5.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 +42 -23
- package/README.zh-CN.md +43 -24
- package/bin/hob.mjs +8 -2
- package/dist/web/assets/{DesktopView-lixZfbYr.js → DesktopView-3QDYo0UU.js} +1 -1
- package/dist/web/assets/index-Dzxrt9T3.js +283 -0
- package/dist/web/assets/index-FUtuyxyO.css +1 -0
- package/dist/web/index.html +2 -2
- package/dist/web/mock/readme-cover.svg +13 -0
- package/dist/web/mock/readme-page.html +7 -0
- package/package.json +2 -1
- package/server/src/actions.ts +2 -1
- package/server/src/assistant-skills.ts +2 -2
- package/server/src/boot.ts +8 -0
- package/server/src/config.ts +52 -11
- package/server/src/cron-text.ts +14 -1
- package/server/src/delete-skill.ts +19 -0
- package/server/src/desktop-tools.ts +6 -6
- package/server/src/files.ts +27 -7
- package/server/src/http.ts +41 -9
- package/server/src/job-view.ts +2 -2
- package/server/src/jobs.ts +108 -62
- package/server/src/knowledge-tools.ts +1 -1
- package/server/src/knowledge.ts +9 -4
- package/server/src/layout-cli.ts +25 -0
- package/server/src/layout.ts +749 -0
- package/server/src/main.ts +5 -0
- package/server/src/mcp.ts +3 -2
- package/server/src/memory.ts +2 -2
- package/server/src/now.ts +1 -1
- package/server/src/overview.ts +1 -2
- package/server/src/pages.ts +9 -7
- package/server/src/prompt.ts +47 -110
- package/server/src/push.ts +3 -2
- package/server/src/router-tools.ts +96 -40
- package/server/src/router.ts +5 -4
- package/server/src/routines.ts +177 -22
- package/server/src/runtime.ts +12 -1
- package/server/src/search.ts +1 -1
- package/server/src/secrets.ts +3 -2
- package/server/src/settings.ts +44 -6
- package/server/src/store.ts +123 -40
- package/server/src/transcript.ts +25 -7
- package/server/src/usage-prices.ts +166 -0
- package/server/src/usage.ts +291 -0
- package/server/src/worker-tools.ts +6 -9
- package/shared/types.ts +110 -3
- package/dist/web/assets/index-BZhge0qe.js +0 -267
- package/dist/web/assets/index-DIo1ArRa.css +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hob
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hob is a self-hosted personal assistant that gets work done: talk to Hob, and it handles small requests itself and delegates larger jobs.
|
|
4
4
|
|
|
5
5
|
[中文说明](README.zh-CN.md) · [Architecture](docs/architecture.md) · MIT License
|
|
6
6
|
|
|
@@ -8,41 +8,47 @@
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
+
## How it works
|
|
12
|
+
|
|
13
|
+
You talk to assistants, not jobs. An assistant handles small requests directly and delegates larger work to a job. Jobs return Markdown results and files only to their assistant, and ask the assistant when they need an answer; the assistant decides what to show you and when to ask you. Global rules and each assistant's own rules determine what needs your confirmation.
|
|
14
|
+
|
|
11
15
|
## What you get
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
### Assistants, jobs and schedules
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
Each assistant has a conversation, duties, rules, skills, schedules and a work log. When similar requests recur, Hob can propose a dedicated assistant. When it delegates to another assistant, a delegation card tracks the work, carries your original request and lets you take over in the receiving assistant's conversation.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
Jobs can be inspected, stopped or resumed, with each round retained; the assistant receives reminders when a job exceeds its expected duration. Routines put their job cards and results in the conversation. A routine can run once at a set time, or carry a check script that runs first and wakes the assistant (or just leaves you a note) only when something changed, optionally stopping after the first hit. The conversation follows new output as the assistant writes; screenshots can be pasted and files dropped straight into the window.
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
On a phone, the assistant list, conversation and profile use a mobile layout; the app supports swipe-to-reply and long-press actions. Push notifications alert you when an assistant needs your decision or a job gets stuck or fails.
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+

|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
### Skills
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
An assistant decides which of its skills each job gets; a schedule can be bound to one. When a job finishes something worth repeating, the assistant has that job write the skill up in its own session, running the commands and scripts again first. Skills covering the same kind of work are merged into one and the older copy archived; when a job finds a step outdated, the skill gets corrected.
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
### Rules
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
Global rules apply to every assistant and job; each assistant can also have its own. Rules distinguish actions that require confirmation from instructions to follow automatically; confirmation choices can save an exception for next time.
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
### Pages and knowledge
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
Assistants can present comparisons and research as pages in the side panel. Organize, search and preview files in knowledge bases, bind them to assistants and follow citations; optional embeddings enable hybrid search, including indexed PDF text.
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
- **Skills** from Hob's own skill folder, the shared `~/.agents/skills`, and Lore. Import existing skills or let assistants save reusable ones, edit their instructions with version history, and choose a skill for a job.
|
|
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.
|
|
38
|
-
- **Long-term memory**, kept locally or in [Lore](https://github.com/FFatTiger/lore).
|
|
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.
|
|
41
|
-
- **Push notifications** when an assistant needs your decision or a job gets stuck or fails.
|
|
39
|
+
### Cloud desktop and tools
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
An optional cloud desktop gives each assistant a browser and screen shared with its jobs; selected assistants can also use a public screen. Assistants can operate the browser and send screenshots in chat; you can watch or take control.
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
Assistants and jobs can use web search across SearXNG, Exa, Tavily, Brave, Serper, Jina, Firecrawl, Perplexity, You.com and Ollama. Jobs can call configured MCP services, including configurations imported from Claude Code, Cursor and pi. Memory can be local or use [Lore](https://github.com/FFatTiger/lore); image generation uses an OpenAI-compatible API. npm and source installations can also use an existing Claude Code subscription login.
|
|
44
|
+
|
|
45
|
+
### Usage and cost
|
|
46
|
+
|
|
47
|
+
Settings → Usage counts the conversations and jobs you already have and shows requests, tokens and estimated cost for the last day, 7 days, 30 days or all time, with a heatmap for the past year and breakdowns by model and by assistant. Prices come from models.dev by default and can be edited per model.
|
|
48
|
+
|
|
49
|
+
### Light and dark
|
|
50
|
+
|
|
51
|
+
Hob has light and dark themes and can follow the system setting.
|
|
46
52
|
|
|
47
53
|
## Quick start
|
|
48
54
|
|
|
@@ -69,7 +75,7 @@ Open <http://127.0.0.1:30148> and sign in with that password. Then:
|
|
|
69
75
|
2. Go to **设置 → 模型** (Settings → Models) and pick the models for chat and for jobs.
|
|
70
76
|
3. Send Hob a message. A reply, or a job card for real work, means you are set.
|
|
71
77
|
|
|
72
|
-
The password is hashed into `~/.hob/config.json` on first start, so later starts don't need `HOB_PASSWORD`. You can change it under **设置 → 通用**.
|
|
78
|
+
The password is hashed into `~/.hob/system/config.json` on first start, so later starts don't need `HOB_PASSWORD`. You can change it under **设置 → 通用**.
|
|
73
79
|
|
|
74
80
|
## Configuration
|
|
75
81
|
|
|
@@ -87,7 +93,18 @@ Startup options are environment variables. Everything else, including providers,
|
|
|
87
93
|
|
|
88
94
|
`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
95
|
|
|
90
|
-
Conversations, jobs, memory, skills, keys and engine state live in `HOB_HOME
|
|
96
|
+
Conversations, jobs, memory, skills, keys and engine state live in `HOB_HOME`, grouped by ownership: `system/` (config, keys, engine, Lore, memory), `cache/` (regenerable), `assistants/<id>/` (each assistant's profile, conversation, routines, jobs and files) and `archive/`. 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.
|
|
97
|
+
|
|
98
|
+
**Data layout migration.** Older versions kept everything flat in `HOB_HOME` (`jobs/`, `pages/`, `images/` … plus a few JSON files at the root). On start Hob migrates that layout automatically, before touching the engine: it checks free space, takes a full verified copy in `HOB_HOME/backup-v1-<time>/` (permissions and symlinks preserved), moves files, and only then writes `system/moves.json` (old path → new path) and `layout.json`. If the process dies mid-way, the next start restores from the backup and runs again. Backups are never deleted automatically — remove `backup-v1-*` yourself once you are happy with the new layout (it contains a copy of your keys). Two commands help:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
npm run layout -- --dry-run # print the migration plan, change nothing
|
|
102
|
+
npm run layout -- --restore # go back to the old layout from the backup
|
|
103
|
+
# installed from npm: hob layout --dry-run / hob layout --restore
|
|
104
|
+
# Docker (stop Hob first): docker compose run --rm hob node bin/hob.mjs layout --restore
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Downgrading means restoring the old layout first: older versions do not understand the new one and must not write the same data directory.
|
|
91
108
|
|
|
92
109
|
**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`.
|
|
93
110
|
|
|
@@ -124,6 +141,8 @@ The desktop is not published to the host network. Hob reads the generated token
|
|
|
124
141
|
|
|
125
142
|
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
143
|
|
|
144
|
+
`TZ` (IANA zone) and `DESKTOP_LANG` (BCP 47 tag, e.g. `en-US`) set the desktop container's timezone and language; both go in the `.env` file next to `compose.yaml` and default to `UTC` and `zh-CN`. They drive the UI language of every program on the desktop, the browser UI language, and the `Accept-Language` / `navigator.languages` the browser sends to websites; `DESKTOP_RESOLUTION` (default `1280x800`) sets the screen size. Sites compare the IP's location with timezone, language and screen, so change them together when the egress network is not in mainland China. Existing browser profiles follow the deployment setting, so a language chosen in browser settings is overridden.
|
|
145
|
+
|
|
127
146
|
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
147
|
|
|
129
148
|
Behind a reverse proxy, the desktop view needs WebSocket upgrades on `/api/desktop/vnc`. With nginx:
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hob
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hob 是一个自己部署、真正动手处理事务的私人助手。你只和 Hob 说话:小事它当场处理,大活交给后台任务。
|
|
4
4
|
|
|
5
5
|
[English](README.md) · [架构说明](docs/architecture.md) · MIT 许可证
|
|
6
6
|
|
|
@@ -8,41 +8,47 @@
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 怎么运作
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
你只和助手说话,不直接和任务交互。助手小事当场处理,大活交给任务;任务只向助手交 Markdown 结果和文件,有问题也只问助手。助手决定给你看什么、什么时候问你;全局规则和每个助手自己的规则决定哪些事情要先征求你的确认。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## 功能
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
### 助手、任务和定时
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
每个助手有自己的对话、职责、规则、技能、定时任务和工作日志。同类工作反复出现时,Hob 会提议创建专门的助手;向其他助手转交时,对话中的转交卡会跟踪状态、带上你的原话,你也可以在接收助手的对话中接手。
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
任务可查看过程、停止或续做,每轮记录分别保留;超出预计用时后,助手会收到督办提醒。定时任务把任务卡和结果发到对应的对话里。定时任务可以只在某个时间跑一次,也可以带一个检查脚本:到点先跑脚本,有变化才叫起助手或直接给你留一条提醒,还可以设成触发一次就停。助手输出时对话会跟着往下滚,截图可以直接粘贴,文件可以直接拖进窗口。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
手机上可查看助手列表、对话和档案,支持滑动回复和长按操作。助手需要你确认,或任务受阻、失败时,可以收到推送通知。
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+

|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
### 技能
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
技能归助手管:派活时由助手决定给任务哪几份,定时任务可以绑定一份。任务做完、结果值得留下时,助手让做这件事的原任务在自己的会话里把它写成技能,写之前把命令和脚本真跑一遍。管同一类事的技能会合成一份,旧的归档;任务照着技能做时发现哪一步过时,助手会让它改对。
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
### 规则
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
全局规则对所有助手和任务生效,每个助手也可以有自己的规则。规则分为执行前确认和一律照做;确认时可以选择以后允许同类操作,保存为规则。
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
- **技能**:读取 Hob 自己的技能目录、通用的 `~/.agents/skills` 和 Lore。可以导入已有技能;助手可以沉淀技能、修改正文并保留旧版,派任务时可指定技能。
|
|
37
|
-
- **MCP 服务**:任务可以调用本地命令(stdio)或远程地址(streamable HTTP)的 MCP 服务,可按服务、按工具单独开关;可以从 Claude Code、Cursor、pi 导入已有配置。
|
|
38
|
-
- **长期记忆**:保存在本地,或接入 [Lore](https://github.com/FFatTiger/lore)。
|
|
39
|
-
- **图像生成**:接 OpenAI 兼容的图像接口,在对话里生图,并通过生成中卡片查看进度。
|
|
40
|
-
- **Claude 订阅**:npm 或源码安装时,可使用本机已有的 Claude Code 登录。
|
|
41
|
-
- **推送通知**:助手需要你确认,或任务受阻、失败时通知你。
|
|
35
|
+
### 页面和知识库
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
助手可以把方案比较、调研等内容做成页面,在侧栏打开。知识库支持整理、搜索和预览文件,绑定到助手并从引用跳到原文;配置向量模型后可混合检索,也支持为 PDF 文字建立索引。
|
|
44
38
|
|
|
45
|
-
|
|
39
|
+
### 云桌面和工具
|
|
40
|
+
|
|
41
|
+
可选的云桌面为每个助手提供与任务共用的屏幕和浏览器,也可允许指定助手使用公共屏幕。助手可以自己操作浏览器并在对话中发送截图,你可以观看或接管。
|
|
42
|
+
|
|
43
|
+
助手和任务可以使用 SearXNG、Exa、Tavily、Brave、Serper、Jina、Firecrawl、Perplexity、You.com、Ollama 的联网搜索。任务可以调用配置好的 MCP 服务,也可以从 Claude Code、Cursor 和 pi 导入已有配置。记忆可保存在本地或接入 [Lore](https://github.com/FFatTiger/lore);图像生成使用 OpenAI 兼容接口。npm 或源码安装也可以使用本机已有的 Claude Code 订阅登录。
|
|
44
|
+
|
|
45
|
+
### 消耗
|
|
46
|
+
|
|
47
|
+
设置 → 消耗 把已有的对话和任务统计起来,显示今天、近 7 天、近 30 天和全部的请求数、token 和估算花费,附最近一年的热力图,以及按模型、按助手的明细。单价默认取自 models.dev,也可以按模型自己改。
|
|
48
|
+
|
|
49
|
+
### 浅色和深色
|
|
50
|
+
|
|
51
|
+
Hob 支持浅色、深色,以及跟随系统设置。
|
|
46
52
|
|
|
47
53
|
## 快速开始
|
|
48
54
|
|
|
@@ -69,7 +75,7 @@ docker compose up -d
|
|
|
69
75
|
2. 到 **设置 → 模型** 选好对话和任务使用的模型。
|
|
70
76
|
3. 给 Hob 发一条消息。收到回复,或者出现一张任务卡,就说明配置好了。
|
|
71
77
|
|
|
72
|
-
首次启动时密码会转成哈希写进 `~/.hob/config.json`,之后启动不用再带 `HOB_PASSWORD`。改密码在 **设置 → 通用**。
|
|
78
|
+
首次启动时密码会转成哈希写进 `~/.hob/system/config.json`,之后启动不用再带 `HOB_PASSWORD`。改密码在 **设置 → 通用**。
|
|
73
79
|
|
|
74
80
|
## 配置
|
|
75
81
|
|
|
@@ -87,7 +93,18 @@ docker compose up -d
|
|
|
87
93
|
|
|
88
94
|
`config.json` 也可设置 `host`、`port` 和初始 `password`;host 和 port 以环境变量优先。Hob 将引擎和记忆目录隔离到 `HOB_HOME`,并从运行环境移除继承的模型及 Lore 凭据。
|
|
89
95
|
|
|
90
|
-
对话、任务、记忆、技能、Key 和引擎数据都在 `HOB_HOME`
|
|
96
|
+
对话、任务、记忆、技能、Key 和引擎数据都在 `HOB_HOME` 里,按归属放:`system/`(配置、密钥、引擎、Lore、记忆)、`cache/`(删了能重建)、`assistants/<id>/`(每个助手的档案、对话、定时、任务和文件)、`archive/`。想沿用本机已有的服务商或 Lore 连接,可以在设置里主动导入。备份 `HOB_HOME` 即可保留 Hob 的数据。
|
|
97
|
+
|
|
98
|
+
**数据目录迁移。** 旧版本把东西平铺在 `HOB_HOME` 根上(`jobs/`、`pages/`、`images/` …… 再加几个 json)。新版本启动时会自动迁移,并且发生在动引擎之前:先看空间够不够,把整个目录完整复制到 `HOB_HOME/backup-v1-<时间>/` 并逐个文件核对(保留权限和符号链接),再搬文件,最后才写 `system/moves.json`(旧路径 → 新路径)和 `layout.json`。中途断掉的话,下次启动先从备份恢复再重跑。备份**不会自动删**:确认新布局没问题后自己删 `backup-v1-*`(里面有整份密钥)。两条命令备用:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
npm run layout -- --dry-run # 只打印迁移计划,什么都不动
|
|
102
|
+
npm run layout -- --restore # 从备份恢复成老布局
|
|
103
|
+
# npm 安装的:hob layout --dry-run / hob layout --restore
|
|
104
|
+
# Docker(先停掉 Hob):docker compose run --rm hob node bin/hob.mjs layout --restore
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
降级要先恢复成老布局:旧版本不认识新布局,不能让新旧版本同时写同一份数据。
|
|
91
108
|
|
|
92
109
|
**Claude 订阅:** npm 或源码安装时,先安装 Claude Code 并在本机执行 `claude auth login`,然后在 **设置 → 服务商** 启用 Claude 订阅、选择 Pro 或 Max,再到 **设置 → 模型** 选择模型。用量计入 Claude 订阅额度,与 Claude Code 共用。Docker 镜像不支持此功能。Hob 不读取、复制、保存或转发 Claude 凭证,由官方 Claude Code 程序使用已有登录。Claude Code 会在 `~/.claude/projects/` 保存自己的会话记录,此目录不属于 `HOB_HOME`。
|
|
93
110
|
|
|
@@ -124,6 +141,8 @@ docker compose --profile desktop up -d
|
|
|
124
141
|
|
|
125
142
|
也可用 [`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
143
|
|
|
144
|
+
桌面容器的时区和语言由 `TZ`(IANA 时区名)和 `DESKTOP_LANG`(BCP 47 语言标签,如 `en-US`)决定,写在同一目录的 `.env` 里,默认 `UTC` 和 `zh-CN`。它们管桌面里所有程序的界面语言、浏览器界面语言,以及浏览器发给网站的 `Accept-Language` 和 `navigator.languages`;分辨率用 `DESKTOP_RESOLUTION`(默认 `1280x800`)。网站会对照出口 IP 所在地、时区和语言,出口不在国内时把这几项一起改,不然更容易被风控拦。已有的浏览器 profile 也按部署配置,在浏览器设置里自己改过的语言会被盖掉。
|
|
145
|
+
|
|
127
146
|
云桌面 v2 在一台 amd64 机器上的实测:镜像占用 2.03 GB;不开屏幕时内存 23.5 MiB,一块 Chrome 屏幕打开 example.com 时 354.9 MiB,三块 Chrome 屏幕打开新标签页时 1017 MiB。页面负载不同,实际占用因机器和页面而异。
|
|
128
147
|
|
|
129
148
|
前面有反向代理时,桌面画面需要 `/api/desktop/vnc` 支持 WebSocket 升级。nginx 示例:
|
package/bin/hob.mjs
CHANGED
|
@@ -3,5 +3,11 @@
|
|
|
3
3
|
import { register } from "tsx/esm/api";
|
|
4
4
|
|
|
5
5
|
register();
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// `hob layout --dry-run | --restore`:数据目录布局的试跑和恢复,和 `npm run layout` 一样
|
|
7
|
+
if (process.argv[2] === "layout") {
|
|
8
|
+
process.argv.splice(2, 1);
|
|
9
|
+
await import("../server/src/layout-cli.ts");
|
|
10
|
+
} else {
|
|
11
|
+
const { boot } = await import("../server/src/boot.ts");
|
|
12
|
+
boot();
|
|
13
|
+
}
|