Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

docs(readme): 补全英文 README,并把两份 README 的素材与安装一节更新到现在

lmlihengae653c2690d3
diff --git a/README.md b/README.md
index b8e901c4..84962165 100644
--- a/README.md
+++ b/README.md
@@ -26,5 +26,242 @@
> - The PenguinHarness and PrismShadow names and marks belong to upstream. Adelie does not use them
> as its own name, icon or domain.
-<p align="center">English | <a href="README.zh.md">简体中文</a></p>
+<p align="center"><a href="README.zh.md">简体中文</a> | English</p>
+## Why Adelie
+
+> Build agents by hand with LangChain at 1× speed; build agents with Adelie at 100× speed.
+
+Adelie runs on your own computer or server and strings together the creation, evaluation, optimisation
+and deployment of agent applications. Three reasons, in ascending order:
+
+### 1. 🏆 Excellent results at a fraction of the cost
+
+A deliberately small tool set over a clean interface: fewer tool calls, fewer tokens, and deep
+adaptation to open models such as DeepSeek. Same tasks, each on its usual model, head to head:
+
+<p align="center">
+ <picture>
+ <source media="(prefers-color-scheme: dark)" srcset="assets/readme/benchmark-dark.svg" />
+ <img src="assets/readme/benchmark-light.svg" alt="Benchmark: Adelie is the most accurate on the data-analysis set and level with OpenAI Codex on the coding set, at a fraction of either one's cost" width="920" />
+ </picture>
+</p>
+
+**The most accurate on the data-analysis set — at 1/70th of Claude Code's cost.**
+
+### 2. ⚡ One sentence in, a runnable agent app out
+
+Describe what you want in one sentence and Adelie builds the whole agent application — scaffold,
+code, run instructions, in one go:
+
+```text
+Collect the docs at https://github.com/ericbuess/claude-code-docs and build a RAG Q&A app that answers as a Claude Code configuration expert, with cited sources.
+```
+
+This is what came out — a docs expert: retrieval-augmented, citations that open the original file,
+sample questions built in:
+
+<p align="center">
+ <picture>
+ <source media="(prefers-color-scheme: dark)" srcset="assets/readme/rag-app-en-dark.webp" />
+ <img src="assets/readme/rag-app-en-light.webp" alt="The generated docs-expert app: an answer with numbered citations, a source list, and sample questions" width="920" />
+ </picture>
+</p>
+
+**And generating the whole RAG app cost ¥0.2 ($0.02) in tokens — on the DeepSeek V4 Pro model.**
+
+### 3. 🧬 A native agent self-evolution engine
+
+With Adelie's skill library an agent evaluates and optimises itself: run a Benchmark, find where the
+score went, ship version N+1 — with a snapshot before every round and every request replayable in the
+trace viewer.
+
+<p align="center">
+ <picture>
+ <source media="(prefers-color-scheme: dark)" srcset="assets/readme/evaluation-center-en-dark.webp" />
+ <img src="assets/readme/evaluation-center-en-light.webp" alt="The Evaluation Center: create a Benchmark, evaluate an agent against it, then optimise on the score" width="920" />
+ </picture>
+</p>
+
+*About the images in this README: the benchmark chart comes from the PenguinHarness authors'
+measurement of the very codebase this fork is built on — Adelie runs the same engine and interface, so
+what it shows is this fork's capability too. Every screenshot is Adelie's own interface, captured from
+a local instance.*
+
+## Built-in plugin library
+
+Four kinds of plugin ship in the box (documented under [`packages/docs`](packages/docs)) — Skills,
+plus the session hooks that drive goal mode and continual learning; an agent can also write and
+optimise its own Skills:
+
+| Category | Plugins |
+| --- | --- |
+| Office Productivity | `data-analysis`, `use-firecrawl`, `browser-automation`, `use-bento-slides`, `humanizer`, `goal`, `continual-learning`, `csu-mail`, `lesson-video`, `requirements-box` |
+| Software Development | `software-development`, `use-claude-code`, `wechat-miniprogram` |
+| AI App Development | `agent-development`, `model-development`, `skill-porting`, `agent-tuning` |
+| Agent Company | `agent-company` |
+
+The **plugin market** page lists every plugin that ships with the build, each with its own README,
+version, licence and keywords, and installs one in a click:
+
+<p align="center">
+ <picture>
+ <source media="(prefers-color-scheme: dark)" srcset="assets/readme/plugin-market-en-dark.webp" />
+ <img src="assets/readme/plugin-market-en-light.webp" alt="The plugin market: installed plugins, and the ones this build can install, with categories and filters" width="920" />
+ </picture>
+</p>
+
+The desktop app also carries a built-in browser in its side dock. An agent drives it through
+`penguin browser` and the `browser-automation` plugin: reading pages, clicking and typing, and
+extracting data such as Amazon orders — signed in with credentials imported from your own browser.
+
+## Supported models
+
+| Model | Providers |
+| --- | --- |
+| DeepSeek V4 | DeepSeek, OpenRouter, Fireworks AI, SiliconFlow, TokenDance, Qwen Token Plan, Qwen Pay-As-You-Go |
+| Kimi K3 | Moonshot AI, OpenRouter, Fireworks AI, TokenDance, Qwen Pay-As-You-Go |
+| GLM 5.3 | Z.AI, OpenRouter, TokenDance |
+| Hunyuan 3 | OpenRouter |
+| Qwen 3.8 Max | Qwen Token Plan, Qwen Pay-As-You-Go, OpenRouter, TokenDance |
+| GPT 5.6 | OpenAI, OpenRouter |
+| Gemini 3.7 Flash | Google Gemini, OpenRouter |
+| Claude 5 | Anthropic, OpenRouter |
+| Inkling | OpenRouter, Fireworks AI |
+
+The table lists only the newest generation of each family; the **Models** page carries the full
+built-in catalog. Anything speaking the OpenAI protocol works: pick a preset, or connect 1000+ hosted
+and local models with a custom endpoint.
+
+## System requirements
+
+| Requirement | Support |
+| --- | --- |
+| Operating system | Windows 10+ (x64), Linux (x64), macOS (arm64 / x64) |
+| Runtime | The installers bundle Node; npm and from-source installs need Node >= 24 |
+| Model | an API key for at least one model provider |
+
+## Install
+
+Adelie ships its own artifacts — desktop installers, CLI bundles and npm packages, every release on
+[GitHub Releases](https://github.com/lmliheng/Adelie/releases) with the same assets mirrored to an
+Alibaba Cloud OSS bucket (`https://adelie-releases.oss-cn-hangzhou.aliyuncs.com`) for readers in
+China. A release is always a whole version: the desktop app, the CLI, the server and the Web frontend
+are the same number.
+
+### Desktop app
+
+| Platform | Artifact |
+| --- | --- |
+| Windows 10+ (x64) | `adelie-desktop-win32-x64.exe` — NSIS installer, per-user, installs under `%LOCALAPPDATA%` |
+| Linux (x64) | `adelie-desktop-linux-x86_64.AppImage` or `adelie-desktop-linux-amd64.deb` |
+| macOS | not built yet — the dmg/zip targets wait for an Apple Developer ID |
+
+The Windows installer is **not code-signed yet**, so SmartScreen shows its warning once
+("More info → Run anyway"). The app checks for updates itself: it reads the OSS mirror's
+`latest.yml` first and falls back to GitHub Releases when the mirror is unreachable, so
+"Check for updates" inside the app is the normal way to upgrade.
+
+### Command line and Web App
+
+```bash
+# Linux / macOS, one line: installs penguin under ~/.adelie, with its own Node runtime
+curl -fsSL https://github.com/lmliheng/Adelie/releases/latest/download/install.sh | sh
+
+# or via npm (any platform, needs Node >= 24 on the machine)
+npm install -g @lmliheng/penguin-cli
+```
+
+Then:
+
+```bash
+penguin web # opens the same interface as the desktop app, in your browser
+penguin chat # or talk to an agent in the terminal
+```
+
+The data root is `~/.adelie/data` (`ADELIE_HOME` overrides it; the older `PENGUIN_HOME` is still
+honoured, so an install that predates the rename keeps reading its own data). Upgrading replaces
+`bin/`, `lib/`, `web/` and `node/` and never touches the data root:
+
+```bash
+penguin update --check
+penguin update --yes
+```
+
+On first start the server prints a first-login link; open it to claim the built-in `admin` account and
+set its password (there is no initial password to type). Configure a model on the **Models** page —
+a new instance needs one API key before it can run a Task.
+
+> [!WARNING]
+> The upstream project's own ways in — `curl https://penguin.ooo/install.sh | sh`,
+> `npm install -g @prismshadow/penguin-cli`, `docker run hiyouga/penguinharness`, and the desktop
+> downloads on <https://penguin.ooo/download> — install **PenguinHarness**, not Adelie. Adelie has
+> its own installers, its own npm scope and its own update feed; use the ones above.
+
+The command name is still `penguin` and the packages still carry the `penguin-` stem (Adelie's own
+scope, `@lmliheng/*`); the rename is being done in stages and what is left of it is tracked in
+[`FORK-PROGRESS.md`](FORK-PROGRESS.md).
+
+## Contributing
+
+```bash
+pnpm install && pnpm build # build first: core's exports point at dist/
+pnpm dev # server + Web frontend together (prefixed logs, dependencies built once)
+```
+
+The full workspace guide is [CONTRIBUTING.zh.md](.github/CONTRIBUTING.zh.md) (that file is upstream's
+and remains broadly accurate): development commands, quality gates, repository layout, changelog
+rules. The upstream marketing site, `packages/landing`, has been deleted from this fork.
+
+## Upstream roadmap
+
+This is the upstream project's roadmap, kept here to show where the base is heading. Adelie's own
+plans live in [`FORK-PROGRESS.md`](FORK-PROGRESS.md).
+
+- [ ] Benchmark suite released
+- [x] Desktop app
+- [x] Windows support
+- [ ] Agent company and templates
+- [ ] Company-level self-evolution
+- [ ] OpenShell integration (a shell with permission control)
+- More to come…
+
+## Upstream contributors
+
+Thanks to everyone who has contributed to PenguinHarness — this fork stands on their code.
+
+<p align="center">
+ <a href="https://github.com/Prism-Shadow/penguin-harness/graphs/contributors"><img src="https://contrib.rocks/image?repo=Prism-Shadow/penguin-harness" alt="PenguinHarness contributors" /></a>
+</p>
+
+## Citation
+
+If you use this code, please cite the upstream project (Adelie is its fork):
+
+```bibtex
+@software{penguinharness2026,
+ author = {{PrismShadow Team}},
+ title = {PenguinHarness: Efficient Self-Improving Harness for Everyone},
+ year = {2026},
+ url = {https://github.com/Prism-Shadow/penguin-harness},
+ license = {Apache-2.0}
+}
+```
+
+## Acknowledgements
+
+This project benefits from:
+
+- [MinGit](https://github.com/git-for-windows/git): the bundled POSIX shell and Git on Windows
+- [GenericAgent](https://github.com/lsdefine/genericagent): built-in browser automation
+
+See [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md) for the full list.
+
+## License
+
+[Apache-2.0](LICENSE) © 2026 Prism Shadow — that is upstream's copyright. Adelie is its fork and is
+released under the same licence; see [`FORK.md`](FORK.md).
+
+Upstream PenguinHarness is built with ❤️ by [Yaowei Zheng](https://github.com/hiyouga), the author of
+[LlamaFactory](https://github.com/hiyouga/LlamaFactory), [PrismShadow AI Team](https://github.com/Prism-Shadow)
+and [Fable 5](https://www.anthropic.com/news/claude-fable-5-mythos-5). Adelie is a fork of that work.
diff --git a/README.zh.md b/README.zh.md
index b0ee15a0..bc4b65c8 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -54,7 +54,12 @@ Adelie 运行在你的电脑或服务器上,自动串联 Agent 应用的创建
这是做出来的成品——一个文档专家:检索增强、引用可点击直达原文、内置示例问题:
-https://github.com/user-attachments/assets/604eb626-0a5d-4a62-87e3-14ebade1cd5f
+<p align="center">
+ <picture>
+ <source media="(prefers-color-scheme: dark)" srcset="assets/readme/rag-app-zh-dark.webp" />
+ <img src="assets/readme/rag-app-zh-light.webp" alt="生成出来的文档专家应用:带编号引用的回答、来源列表与示例问题" width="920" />
+ </picture>
+</p>
**而生成整个 RAG 应用,仅消耗了 0.2 元($0.02)的 token——使用 DeepSeek V4 Pro 模型。**
@@ -62,9 +67,14 @@ https://github.com/user-attachments/assets/604eb626-0a5d-4a62-87e3-14ebade1cd5f
借助 Adelie 技能库,Agent 自己评估、自己优化:跑 Benchmark、找失分点、发布 N+1 版——每轮之前自动快照,每个请求都可在轨迹观测中回放。
-https://github.com/user-attachments/assets/aec49ae9-b743-467b-b247-37bedfeaa36e
+<p align="center">
+ <picture>
+ <source media="(prefers-color-scheme: dark)" srcset="assets/readme/evaluation-center-zh-dark.webp" />
+ <img src="assets/readme/evaluation-center-zh-light.webp" alt="评估中心:出题、评估、优化三步,以及一个开箱即用的 Example Benchmark" width="920" />
+ </picture>
+</p>
-*上面这张对比图和两段录屏,都出自上游 PenguinHarness 作者对该代码库的实测与录屏 —— Adelie 用的就是同一套引擎与界面,所以它们说的就是这份 fork 的能力;录屏里露出的产品名是上游改名前的品牌。*
+*这份 README 里的图:基准对比图出自上游 PenguinHarness 作者对该代码库的实测——Adelie 用的就是同一套引擎与界面,所以它说的就是这份 fork 的能力;其余截图都是 Adelie 自己的界面,在本机实例上截的。*
## 内置插件库
@@ -77,6 +87,15 @@ https://github.com/user-attachments/assets/aec49ae9-b743-467b-b247-37bedfeaa36e
| AI 应用开发 | `agent-development`、`model-development`、`skill-porting`、`agent-tuning` |
| Agent 公司 | `agent-company` |
+**插件市场**页把这套插件全列出来:每条读的是插件包自己的 README、版本、许可证与关键词,一键安装。
+
+<p align="center">
+ <picture>
+ <source media="(prefers-color-scheme: dark)" srcset="assets/readme/plugin-market-zh-dark.webp" />
+ <img src="assets/readme/plugin-market-zh-light.webp" alt="插件市场:已安装的插件,以及这份构建可安装的插件,带分类与筛选" width="920" />
+ </picture>
+</p>
+
桌面应用的侧边停靠栏里还内置了一个浏览器。Agent 通过 `penguin browser` 和 `browser-automation` 插件驱动它:读取页面、点击和输入,并提取亚马逊订单这样的数据,登录用的是从你自己的浏览器导入的账号。
## 支持的模型
@@ -97,45 +116,66 @@ https://github.com/user-attachments/assets/aec49ae9-b743-467b-b247-37bedfeaa36e
## 系统需求
-| 需求项 | 支持情况 |
-| -------- | --------------------------------------------------- |
-| 操作系统 | Linux、macOS、Windows 10+ |
-| 架构 | x64、arm64 |
-| 运行时 | Node >= 24(Adelie 还没有安装包 —— 见「安装」一节) |
-| 模型 | 至少一个模型的 API key |
+| 需求项 | 支持情况 |
+| -------- | -------------------------------------------------------------- |
+| 操作系统 | Windows 10+(x64)、Linux(x64)、macOS(arm64 / x64) |
+| 运行时 | 安装包自带 Node;用 npm 装或从源码构建才需要 Node >= 24 |
+| 模型 | 至少一个模型供应商的 API Key |
-## 安装 —— 先读这一节
+## 安装
+
+Adelie 有自己的产物:桌面安装包、命令行包与 npm 包,每次发布都在
+[GitHub Releases](https://github.com/lmliheng/Adelie/releases) 上,同一份资产也镜像到阿里云 OSS
+(`https://adelie-releases.oss-cn-hangzhou.aliyuncs.com`,给国内的读者)。一次发布是一个整体版本:
+桌面端、命令行、服务端与 Web 前端同号。
+
+### 桌面应用
+
+| 平台 | 产物 |
+| -------------- | ---------------------------------------------------------------------- |
+| Windows 10+ x64 | `adelie-desktop-win32-x64.exe` —— NSIS 安装器,按用户安装 |
+| Linux x64 | `adelie-desktop-linux-x86_64.AppImage` 或 `adelie-desktop-linux-amd64.deb` |
+| macOS | 还没打 —— dmg / zip 目标在等一张 Apple 开发者证书 |
+
+Windows 安装包**还没有代码签名**,SmartScreen 会提示一次(「更多信息 → 仍要运行」)。应用自己会
+检查更新:先读 OSS 镜像上的 `latest.yml`,镜像不通时回退到 GitHub Releases —— 升级走应用里的
+「检查更新」就行。
+
+### 命令行与 Web App
+
+```bash
+# Linux / macOS 一行装好:装在 ~/.adelie,自带 Node 运行时
+curl -fsSL https://github.com/lmliheng/Adelie/releases/latest/download/install.sh | sh
+
+# 或者走 npm(任意平台,机器上要有 Node >= 24)
+npm install -g @lmliheng/penguin-cli
+```
+
+装好之后:
+
+```bash
+penguin web # 在浏览器里打开与桌面应用同一个界面
+penguin chat # 或者直接在终端里和 Agent 说话
+```
-**Adelie 还没有发布自己的产物。** 没有 Adelie 的 npm 包、安装包、Docker 镜像或下载页 —— 那是计划的
-最后一步([`FORK-PROGRESS.md`](FORK-PROGRESS.md) §4)。现在要跑 Adelie,只有从这棵源码树开始:
+数据根是 `~/.adelie/data`(`ADELIE_HOME` 可以改;旧的 `PENGUIN_HOME` 仍然认,所以改名之前装的实例
+照样读自己的数据)。升级只替换 `bin/`、`lib/`、`web/`、`node/`,不动数据根:
```bash
-# 装依赖(跳过 desktop / electron:它要下一个运行时,跑 Web 用不到)
-pnpm install --frozen-lockfile \
- --filter @lmliheng/penguin-core --filter @lmliheng/penguin-ui \
- --filter @lmliheng/penguin-server --filter @lmliheng/penguin-web \
- --filter @lmliheng/penguin-cli --filter @lmliheng/penguin-hmr
-
-# 构建(core 的导出指向 dist/,不先构建就跑不起来)
-pnpm -r --filter @lmliheng/penguin-core --filter @lmliheng/penguin-server \
- --filter @lmliheng/penguin-web run build
-
-# 起服务端 + 已构建的 Web 前端
-cd packages/server
-PENGUIN_HOME=<数据根> HOST=0.0.0.0 PORT=<端口> node dist/index.js
+penguin update --check
+penguin update --yes
```
-首次启动会在输出里打印一条「首次登录链接」,在设密码之前每次启动都会打印:打开它认领内置的
-`admin` 账号并设置密码(没有可输入的初始密码)。模型在应用内的**模型库**页配置 —— 新实例要先配一个
-API key 才能跑任务。
+首次启动会在输出里打印一条「首次登录链接」:打开它认领内置的 `admin` 账号并设置密码(没有可输入的
+初始密码)。模型在应用内的**模型库**页配置 —— 新实例要先配一个 API key 才能跑任务。
> [!WARNING]
-> 上游 README 里的那些方式 —— `curl https://penguin.ooo/install.sh | sh`、
-> `npm install -g @lmliheng/penguin-cli`、`docker run hiyouga/penguinharness`、
+> 上游自己的那些入口 —— `curl https://penguin.ooo/install.sh | sh`、
+> `npm install -g @prismshadow/penguin-cli`、`docker run hiyouga/penguinharness`、
> <https://penguin.ooo/download> 上的桌面安装包 —— 装出来的是 **PenguinHarness**,不是 Adelie。
-> 那些渠道在 Adelie 发布自己的产物之前,仍然属于上游。
+> Adelie 有自己的安装包、自己的 npm scope 和自己的更新链路,用上面这些。
-包名、数据根与命令名还留着上游的拼写(`@prismshadow/*`、`~/.penguin/data`、`penguin`)—— 改名是
+命令名还是 `penguin`,包的词干也还留着 `penguin-`(scope 是 Adelie 自己的 `@lmliheng/*`);改名是
分期做的,还没做完的部分记在 [`FORK-PROGRESS.md`](FORK-PROGRESS.md)。
## 参与开发
diff --git a/assets/readme/evaluation-center-en-dark.webp b/assets/readme/evaluation-center-en-dark.webp
new file mode 100644
index 00000000..e19edc08
Binary files /dev/null and b/assets/readme/evaluation-center-en-dark.webp differ
diff --git a/assets/readme/evaluation-center-en-light.webp b/assets/readme/evaluation-center-en-light.webp
new file mode 100644
index 00000000..6ed8e48b
Binary files /dev/null and b/assets/readme/evaluation-center-en-light.webp differ
diff --git a/assets/readme/evaluation-center-zh-dark.webp b/assets/readme/evaluation-center-zh-dark.webp
new file mode 100644
index 00000000..84fe01d8
Binary files /dev/null and b/assets/readme/evaluation-center-zh-dark.webp differ
diff --git a/assets/readme/evaluation-center-zh-light.webp b/assets/readme/evaluation-center-zh-light.webp
new file mode 100644
index 00000000..f25ad450
Binary files /dev/null and b/assets/readme/evaluation-center-zh-light.webp differ
diff --git a/assets/readme/plugin-market-en-dark.webp b/assets/readme/plugin-market-en-dark.webp
new file mode 100644
index 00000000..c91bc40b
Binary files /dev/null and b/assets/readme/plugin-market-en-dark.webp differ
diff --git a/assets/readme/plugin-market-en-light.webp b/assets/readme/plugin-market-en-light.webp
new file mode 100644
index 00000000..dd49b08d
Binary files /dev/null and b/assets/readme/plugin-market-en-light.webp differ
diff --git a/assets/readme/plugin-market-zh-dark.webp b/assets/readme/plugin-market-zh-dark.webp
new file mode 100644
index 00000000..6471b381
Binary files /dev/null and b/assets/readme/plugin-market-zh-dark.webp differ
diff --git a/assets/readme/plugin-market-zh-light.webp b/assets/readme/plugin-market-zh-light.webp
new file mode 100644
index 00000000..51a1f66a
Binary files /dev/null and b/assets/readme/plugin-market-zh-light.webp differ
diff --git a/scripts/capture-readme-shots.mjs b/scripts/capture-readme-shots.mjs
new file mode 100644
index 00000000..9e3bd3d1
--- /dev/null
+++ b/scripts/capture-readme-shots.mjs
@@ -0,0 +1,85 @@
+/**
+ * Capture the README screenshots — the committed `assets/readme/*.webp` are generated by this
+ * script, so they can be refreshed when the interface changes.
+ *
+ * It talks to a running Adelie server with a real Web build (the dev shadow instance is enough:
+ * `pnpm dev:server`, or any instance whose `packages/web/dist` is current) and shoots two pages
+ * per UI language per theme:
+ *
+ * assets/readme/evaluation-center-<lang>-<theme>.webp the Evaluation Center (reason 3)
+ * assets/readme/plugin-market-<lang>-<theme>.webp the plugin market (plugin library)
+ *
+ * Usage:
+ *
+ * node scripts/capture-readme-shots.mjs <base-url> <session-cookie> [out-dir]
+ *
+ * `<session-cookie>` is a signed-in `penguin_session` value. Getting one on a fresh data root:
+ * the server prints a first-login link on start; POST its token to `/api/auth/claim` and the
+ * cookie you need is the one that comes back (curl -c jar), or log in with
+ * `POST /api/auth/login` if the account already has a password.
+ *
+ * The UI language is a localStorage preference (`packages/web/src/state/locale.tsx`), not the
+ * browser's, so the script writes it before the app boots; the theme comes from the page's own
+ * `prefers-color-scheme`. Playwright is borrowed from the Web package's test dependency — this
+ * script adds no dependency of its own — and ffmpeg turns each PNG into the committed webp.
+ */
+import { execFileSync } from "node:child_process";
+import fs from "node:fs";
+import { createRequire } from "node:module";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+
+const REPO = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
+const requireHost = createRequire(path.join(REPO, "packages", "web", "package.json"));
+const { chromium } = requireHost("@playwright/test");
+
+const [baseUrl, token, outArg] = process.argv.slice(2);
+if (baseUrl === undefined || token === undefined) {
+ console.error(
+ "usage: node scripts/capture-readme-shots.mjs <base-url> <session-cookie> [out-dir]",
+ );
+ process.exit(2);
+}
+const outDir = path.resolve(outArg ?? path.join(REPO, "assets", "readme"));
+fs.mkdirSync(outDir, { recursive: true });
+
+/** Pages shot for the README, and the file name stem each one lands under. */
+const PAGES = [
+ { route: "/benchmark", name: "evaluation-center" },
+ { route: "/plugins", name: "plugin-market" },
+];
+
+const browser = await chromium.launch();
+try {
+ for (const lang of ["zh", "en"]) {
+ for (const theme of ["light", "dark"]) {
+ const context = await browser.newContext({
+ viewport: { width: 1440, height: 900 },
+ deviceScaleFactor: 2,
+ colorScheme: theme,
+ });
+ await context.addCookies([
+ { name: "penguin_session", value: token, domain: new URL(baseUrl).hostname, path: "/" },
+ ]);
+ await context.addInitScript(`localStorage.setItem("penguin.lang", ${JSON.stringify(lang)});`);
+ const page = await context.newPage();
+ for (const { route, name } of PAGES) {
+ await page.goto(`${baseUrl}${route}`, { waitUntil: "domcontentloaded" });
+ // The page is client-rendered over SSE; give its first paint of data time to land.
+ await page.waitForTimeout(3000);
+ const png = path.join(outDir, `${name}-${lang}-${theme}.png`);
+ const webp = path.join(outDir, `${name}-${lang}-${theme}.webp`);
+ await page.screenshot({ path: png });
+ execFileSync("ffmpeg", ["-y", "-loglevel", "error", "-i", png, "-quality", "82", webp]);
+ fs.unlinkSync(png);
+ console.log(
+ `${name}-${lang}-${theme}.webp`,
+ `${Math.round(fs.statSync(webp).size / 1024)} KB`,
+ );
+ }
+ await context.close();
+ }
+ }
+} finally {
+ await browser.close();
+}