Skip to content

Commit 0313cf6

Browse files
committed
fix: resolve final distribution audit findings
1 parent 10d95da commit 0313cf6

30 files changed

Lines changed: 382 additions & 210 deletions

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ jobs:
5757
tag="v$(cat VERSION)"
5858
tar -xzf "dist/AgentBoot-offline-${tag}-linux-x64.tar.gz" -C "$root/extract"
5959
app="$root/extract/AgentBoot"
60-
AGENTBOOT_HOME="$root/home/.agentboot" HOME="$root/home" python3 "$app/core/menu.py" offline codex --payload "$app/payloads"
60+
HOME="$root/home" sh "$app/install-offline.sh" codex
6161
AGENTBOOT_HOME="$root/home/.agentboot" HOME="$root/home" "$root/home/.agentboot/bin/codex" --version
62-
AGENTBOOT_HOME="$root/home/.agentboot" HOME="$root/home" python3 "$app/core/menu.py" uninstall codex
62+
AGENTBOOT_HOME="$root/home/.agentboot" HOME="$root/home" python3 "$root/home/.agentboot/app/core/menu.py" uninstall codex
6363
test ! -e "$root/home/.agentboot/agents/codex"
6464
mv "dist/AgentBoot-offline-${tag}-linux-x64.tar.gz" "dist/AgentBoot-offline-${tag}-linux-x64-codex.tar.gz"
6565
mv "dist/AgentBoot-offline-${tag}-linux-x64-sfx.sh" "dist/AgentBoot-offline-${tag}-linux-x64-codex-sfx.sh"
@@ -87,9 +87,10 @@ jobs:
8787
$app = Join-Path $extract 'AgentBoot'
8888
$env:AGENTBOOT_HOME = Join-Path $smokeHome '.agentboot'
8989
$env:USERPROFILE = $smokeHome
90-
python "$app\core\menu.py" offline codex --payload "$app\payloads"
90+
$env:LOCALAPPDATA = Join-Path $smokeHome 'LocalAppData'
91+
& "$app\install-offline.ps1" -Agents codex
9192
& "$smokeHome\.agentboot\bin\codex.cmd" --version
92-
python "$app\core\menu.py" uninstall codex
93+
python "$env:LOCALAPPDATA\AgentBoot\app\core\menu.py" uninstall codex
9394
if (Test-Path "$smokeHome\.agentboot\agents\codex") { throw 'Codex payload not removed' }
9495
Move-Item "dist\AgentBoot-offline-$tag-win-x64.zip" "dist\AgentBoot-offline-$tag-win-x64-codex.zip"
9596
- uses: actions/upload-artifact@v4

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
- 在线包新增 SHA-256 旁车校验和原子升级回滚;构建器以临时文件原子发布且结果可复现。
1313
- 自定义脚本仅允许 HTTPS,下载到临时文件后以固定参数执行,消除 URL shell 注入;脚本上限 4 MiB。
1414
- 修正 `ab bench` 首字延迟计时、全部 60 个 Linux 知识库段落索引、`ab` 子命令包装器和 CoCo 数据备份恢复。
15+
- 离线包新增目标机逐文件 SHA-256 校验,`--all` 仅安装包内 MANIFEST 实际列出的 Agent;构建缺载荷会硬失败。
16+
- 修复 Windows CMD shim 百分号格式、npm 真实入口解析和便携 Node 路径,Linux/Windows 均通过原生安装→启动→卸载矩阵。
17+
- Worker 支持 Range/If-Range 与真实资产健康探测;发布采用 prerelease→Pages/Worker live verify→Latest 的协调状态机。
18+
- 修正 Node engine 范围、离线资产名、相对链接、vLLM 文案、移动端表格溢出、触摸目标和旧性能固定数字。
1519

1620
## v1.0.0 (2026-08-29)
1721

README.en.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ Two commands after install:
4949
| | |
5050
|---|---|
5151
| 📦 **Choose what to install** | 14 mainstream agents, multi-select in the menu |
52-
| 🛟 **Built-in fallback agent** | `ab`: single file, stdlib only, Agnes by default, offline Linux knowledge base, session persistence |
52+
| 🛟 **Built-in fallback agent** | `ab`: zero third-party dependencies, Agnes by default, offline Linux knowledge base, session persistence |
5353
| 🧠 **Model provider manager** | Named custom providers, Ollama/LM Studio presets, failover order, connectivity test |
5454
| 🇨🇳 **China network adaptive** | npmmirror / Node mirrors / Tsinghua PyPI, four-source downloads, proxy support |
5555
| 📴 **Verified offline packages** | Releases provide Codex slim packs tested through install/run/uninstall; menu `[7]` builds other Agents on their target platform |
5656
|**Custom agents** | Add anything beyond the registry (npm / pip / script), stored in your home dir |
5757
| 🧹 **Safe uninstall** | Menu `[9]` or `agentboot uninstall <id>`; removes owned program files and preserves user data by default |
5858
| 🔐 **Verified install** | Enforced SHA-256, atomic app switching, rollback; custom scripts require HTTPS and avoid shell interpolation |
59-
|**Extreme performance** | TLS connection reuse (~440ms off per turn), pre-indexed KB (<1ms warm), `/bench` |
59+
|**Measured performance** | TLS connection reuse, pre-indexed KB, and an on-device `/bench` for current network/model conditions |
6060

6161
## Supported agents (14)
6262

@@ -81,7 +81,7 @@ Package names verified on the npm registry. `✓` = offline payload bundled.
8181

8282
## Built-in fallback agent (ab)
8383

84-
Works when everything else fails — the design baseline:
84+
Works when everything else fails — a Python standard-library core shipped with i18n and knowledge-base resources:
8585

8686
```bash
8787
ab # interactive (Agnes free model by default)
@@ -104,7 +104,7 @@ Download a platform-and-Agent-specific verified pack from [Releases](https://git
104104
python core/menu.py build-offline win-x64 claude-code,pi
105105
```
106106

107-
Details: [Installation Guide (EN)](docs/en/install-guide.md) · [安装指南 (中文)](../安装指南.md)
107+
Details: [Installation Guide (EN)](docs/en/install-guide.md) · [安装指南 (中文)](安装指南.md)
108108

109109
## Models
110110

@@ -126,15 +126,11 @@ AgentBoot records install ownership and will not remove an unrelated command mer
126126

127127
## Performance (measured via `ab bench`)
128128

129-
```
130-
KB query : cold 2.4 ms · warm 0.0 ms
131-
Model TTFB : first (TLS handshake) 1016 ms · reused 579 ms
132-
Reuse benefit : ~437 ms saved per turn
133-
```
129+
`ab bench` measures KB cold/warm queries and first-token latency for a fresh TLS connection versus a reused connection on the current machine and provider. Results vary by network, model, and region and are not a fixed product guarantee.
134130

135131
## Links
136132

137-
- [Installation Guide (EN)](docs/en/install-guide.md) · [安装指南 (中文)](../安装指南.md)
133+
- [Installation Guide (EN)](docs/en/install-guide.md) · [安装指南 (中文)](安装指南.md)
138134
- Primary entry: [boot.ide.pub](https://boot.ide.pub) · Mirror: [GitHub Pages](https://bit-cook.github.io/AgentBoot/)
139135

140136
## Security

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object Net.Web
4848
| | |
4949
|---|---|
5050
| 📦 **菜单自选安装** | 14 个主流 Agent 按需勾选(见下表),支持命令行指定 |
51-
| 🛟 **内置保底 Agent** | `ab` 单文件零依赖:Agnes 开箱即用、离线 Linux 知识库、工具调用、会话持久化 |
51+
| 🛟 **内置保底 Agent** | `ab` 零第三方依赖 Python 核心:Agnes 开箱即用、离线 Linux 知识库、工具调用、会话持久化 |
5252
| 🧠 **提供商管理器** | Agnes 预设 + 自定义提供商命名管理 + Ollama/LM Studio 本地模型 + 故障切换顺序 |
5353
| 🇨🇳 **中国网络自适应** | npmmirror / Node 镜像 / 清华 PyPI 自动切换;四源下载容错;代理一键配置 |
5454
| 📴 **可验证离线包** | Release 提供经安装/启动/卸载冒烟的 Codex 精简包;菜单 `[7]` 可按目标平台自建其他 Agent 包 |
@@ -83,7 +83,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object Net.Web
8383

8484
其他 Agent 都装不上时,`ab` 一定能用——这是 AgentBoot 的设计底线:
8585

86-
- **单文件、零第三方依赖**仅 Python 标准库),任何有 Python 的机器直接跑;
86+
- **零第三方依赖 Python 核心**仅标准库;随附 i18n 与知识库资源),任何有 Python 的机器直接跑;
8787
- **Agnes 免费模型**默认即用;`/model` 管理器可切换自定义接口与本地模型;
8888
- **工具**:执行命令(高危拦截)、读写/精确编辑文件、目录列表、`search_files` 内容搜索、抓网页;
8989
- **离线 Linux 知识库**(9 大主题 60+ 段落):查用法、操作 Linux、修常见问题(磁盘满/端口占用/服务起不来…);
@@ -128,7 +128,7 @@ AgentBoot 通过安装清单识别归属,不会因为系统中存在同名命
128128
```
129129
AgentBoot/
130130
├── install.sh / install.bat / scripts/install.ps1 在线一键安装
131-
├── core/agent.py 内置最小 Agent(单文件零依赖
131+
├── core/agent.py 内置最小 Agent(零第三方依赖 Python 核心
132132
├── core/menu.py 中文控制台菜单(安装/模型/镜像/离线/构建)
133133
├── agents/registry.json Agent 注册表(v2,含平台与依赖声明)
134134
├── tools/linux-kb/ 离线 Linux 知识库
@@ -141,11 +141,7 @@ AgentBoot/
141141

142142
## 性能(`ab bench` 实测)
143143

144-
```
145-
知识库查询 : 冷 2.4 ms(含首载索引) · 热 0.0 ms
146-
模型首字延迟 : 首次(含 TLS 握手)1016 ms · 复用连接 579 ms
147-
连接复用收益 : 每轮省约 437 ms
148-
```
144+
`ab bench` 会在当前机器和当前模型源现场测量知识库冷/热查询,以及首次 TLS 连接与复用连接的首字延迟;结果取决于网络、模型和地区,不写死为产品保证。
149145

150146
## 文档与链接
151147

agents/registry.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"bin": "pi",
7676
"method": "npm",
7777
"npm": "@earendil-works/pi-coding-agent",
78-
"node": ">=22",
78+
"node": ">=22.19.0",
7979
"offline": true,
8080
"notes": ["与 pi.dev 官方安装器同源的 npm 包", "文档:https://pi.dev", "模型:pi 需按官方方式配置 provider(pi.dev 文档)"]
8181
},
@@ -135,7 +135,7 @@
135135
"bin": "openclaw",
136136
"method": "npm",
137137
"npm": "openclaw",
138-
"node": ">=22.22.0",
138+
"node": ">=22.22.3 <23 || >=24.15.0 <25 || >=25.9.0",
139139
"offline": true,
140140
"notes": ["需要较新 Node(22.22+ 或 24+),旧版 Node 仅警告仍可尝试", "文档:https://docs.openclaw.ai"]
141141
},

cloudflare/DEPLOY.md

Lines changed: 29 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,52 @@
1-
# Cloudflare 部署说明(AgentBoot 分发 Worker
1+
# Cloudflare Worker 部署
22

3-
本目录的 `worker.js` 承担 `https://boot.ide.pub` 的安装脚本分发
3+
`cloudflare/worker.js` `https://boot.ide.pub` 提供
44

5-
```
6-
curl -fsSL https://boot.ide.pub/install.sh | sh
7-
```
8-
9-
Worker 名称固定为 **boot**(对应"域名前缀用 boot"的要求)。`*.workers.dev`
10-
在中国大陆通常被阻断,因此同时把自定义域 `boot.ide.pub` 绑定到该 Worker。
5+
- `/``/en`:中英文产品页;
6+
- `/install.sh``/install.ps1`:当前 Release 安装器;
7+
- `/rel/<asset>`:Release 资产代理,支持 `Range` / `If-Range`
8+
- `/health`:实际探测当前版本安装器、在线包与 SHA-256 旁车。
119

12-
## 手动部署(Cloudflare 控制台)
10+
Worker 名称固定为 `boot`,配置见 `wrangler.jsonc`。部署只使用 Wrangler OAuth 或最小权限 API Token,不使用 Cloudflare Global API Key。
1311

14-
1. Workers & Pages → Create Worker → 名称填 `boot` → 粘贴 `worker.js` → Deploy。
15-
2. Worker 详情 → Settings → Domains & Routes → Add → Custom domain → `boot.ide.pub`
16-
(Cloudflare 会自动创建 DNS 记录与路由)。
17-
18-
## 脚本部署(Cloudflare API,无需 wrangler)
19-
20-
先准备环境变量(全局 API Key 在 Cloudflare 控制台 My Profile → API Tokens 页获取):
12+
## 首次登录
2113

2214
```sh
23-
export CF_EMAIL="你的账号邮箱"
24-
export CF_KEY="你的 Global API Key"
25-
export CF_ACCOUNT_ID="账户 ID(域名为 ide.pub 的那个账户)"
26-
export CF_ZONE_ID="ide.pub 这个 zone 的 ID"
15+
npx wrangler login
16+
npx wrangler whoami
2717
```
2818

29-
然后:
19+
浏览器授权应至少允许 Workers Scripts 与 Routes 写入,以及 Zone 读取。
20+
21+
## 发布
22+
23+
先确保 GitHub Release 与 Pages 已发布当前 `VERSION`,再执行:
3024

3125
```sh
32-
# 1) 部署/更新 Worker(模块语法上传)
33-
curl -X PUT \
34-
"https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/workers/scripts/boot" \
35-
-H "X-Auth-Email: $CF_EMAIL" -H "X-Auth-Key: $CF_KEY" \
36-
-F 'metadata={"main_module":"worker.js","compatibility_date":"2024-09-23"};type=application/json' \
37-
-F 'worker.js=@worker.js;type=application/javascript+module'
38-
39-
# 2) 启用 workers.dev 预览地址(可选)
40-
curl -X POST \
41-
"https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/workers/scripts/boot/subdomain" \
42-
-H "X-Auth-Email: $CF_EMAIL" -H "X-Auth-Key: $CF_KEY" \
43-
-H "Content-Type: application/json" -d '{"enabled":true}'
44-
45-
# 3) DNS:创建 boot 子域(AAAA 100:: + 代理,把流量交给 Cloudflare)
46-
curl -X POST \
47-
"https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/dns_records" \
48-
-H "X-Auth-Email: $CF_EMAIL" -H "X-Auth-Key: $CF_KEY" \
49-
-H "Content-Type: application/json" \
50-
-d '{"type":"AAAA","name":"boot","content":"100::","proxied":true}'
51-
52-
# 4) 路由:boot.ide.pub/* 全部交给 Worker boot 处理
53-
curl -X POST \
54-
"https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/workers/routes" \
55-
-H "X-Auth-Email: $CF_EMAIL" -H "X-Auth-Key: $CF_KEY" \
56-
-H "Content-Type: application/json" \
57-
-d '{"pattern":"boot.ide.pub/*","script":"boot"}'
26+
cd cloudflare
27+
sh deploy.sh
5828
```
5929

60-
## 验证
30+
`deploy.sh` 会执行:
6131

6232
```sh
63-
curl -fsSL https://boot.ide.pub/health
64-
curl -fsSL https://boot.ide.pub/install.sh | head -n 5
33+
npx wrangler deploy --config wrangler.jsonc
34+
python3 ../scripts/verify-live-release.py
6535
```
6636

67-
## 版本升级
37+
只有以下条件全部满足才算发布成功:
6838

69-
`worker.js` 顶部的 `REPO` / `TAG` 与各安装脚本中的 `TAG` 保持一致;发新版本时同步修改。
39+
- `/health` 返回当前 tag 且 `ok=true`
40+
- Worker 与 Pages 的 `install.sh` / `install.ps1` 都指向当前 tag;
41+
- 两个来源的在线 tar/zip 与各自 `.sha256` 一致;
42+
- Worker `/rel/` 正确返回 `206 Partial Content`
7043

71-
当前推荐使用已登录的 Wrangler OAuth 会话部署,配置位于 `wrangler.jsonc`
44+
## 回滚
7245

7346
```sh
74-
cd cloudflare
75-
npx wrangler deploy --config wrangler.jsonc
47+
npx wrangler deployments list --name boot
48+
npx wrangler rollback --name boot
7649
python3 ../scripts/verify-live-release.py
7750
```
7851

79-
`verify-live-release.py` 会同时检查 `boot.ide.pub` GitHub Pages:版本、安装器、在线 tar/zip 及 SHA-256 必须一致
52+
回滚 Worker 后,验证器会按仓库当前 `VERSION` 检查。如果同时回滚 GitHub Release,需要先切换到对应源码/tag再运行验证

cloudflare/deploy.sh

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,11 @@
11
#!/bin/sh
2-
# AgentBoot Cloudflare Worker 一键部署脚本(API 方式)
3-
# 用法:
4-
# export CF_EMAIL=... CF_KEY=... CF_ACCOUNT_ID=... CF_ZONE_ID=...
5-
# sh deploy.sh
2+
# AgentBoot Cloudflare Worker 一键部署脚本(Wrangler OAuth)
63
set -eu
74

85
cd "$(dirname "$0")"
9-
: "${CF_EMAIL:?请设置 CF_EMAIL}"
10-
: "${CF_KEY:?请设置 CF_KEY(Global API Key)}"
11-
: "${CF_ACCOUNT_ID:?请设置 CF_ACCOUNT_ID}"
12-
: "${CF_ZONE_ID:?请设置 CF_ZONE_ID(ide.pub)}"
13-
14-
API="https://api.cloudflare.com/client/v4"
15-
H1="X-Auth-Email: $CF_EMAIL"
16-
H2="X-Auth-Key: $CF_KEY"
17-
18-
echo "==> 上传 Worker boot …"
19-
curl -sS -X PUT "$API/accounts/$CF_ACCOUNT_ID/workers/scripts/boot" \
20-
-H "$H1" -H "$H2" \
21-
-F 'metadata={"main_module":"worker.js","compatibility_date":"2024-09-23"};type=application/json' \
22-
-F 'worker.js=@worker.js;type=application/javascript+module' | head -c 400; echo
23-
24-
echo "==> 启用 workers.dev 预览 …"
25-
curl -sS -X POST "$API/accounts/$CF_ACCOUNT_ID/workers/scripts/boot/subdomain" \
26-
-H "$H1" -H "$H2" -H "Content-Type: application/json" \
27-
-d '{"enabled":true}' | head -c 300; echo
28-
29-
echo "==> 创建 DNS 记录 boot(若已存在会报 already exist,可忽略)…"
30-
curl -sS -X POST "$API/zones/$CF_ZONE_ID/dns_records" \
31-
-H "$H1" -H "$H2" -H "Content-Type: application/json" \
32-
-d '{"type":"AAAA","name":"boot","content":"100::","proxied":true}' | head -c 300; echo
33-
34-
echo "==> 创建路由 boot.ide.pub/* → boot …"
35-
curl -sS -X POST "$API/zones/$CF_ZONE_ID/workers/routes" \
36-
-H "$H1" -H "$H2" -H "Content-Type: application/json" \
37-
-d '{"pattern":"boot.ide.pub/*","script":"boot"}' | head -c 300; echo
38-
39-
echo "==> 验证 …"
40-
curl -fsSL https://boot.ide.pub/health || echo "(DNS 生效可能需要 1-2 分钟)"
41-
echo "部署脚本执行完毕。"
6+
command -v npx >/dev/null 2>&1 || { echo "需要 Node.js/npm 提供 npx" >&2; exit 1; }
7+
echo "==> 使用 Wrangler 部署 Worker boot …"
8+
npx --yes wrangler deploy --config wrangler.jsonc
9+
echo "==> 验证主入口与镜像 …"
10+
python3 ../scripts/verify-live-release.py
11+
echo "部署与线上验证完成。"

0 commit comments

Comments
 (0)