@cyber-dash-tech/revela 0.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/LICENSE +21 -0
- package/README.md +239 -0
- package/README.zh-CN.md +270 -0
- package/designs/default/DESIGN.md +1100 -0
- package/designs/editorial-ribbon/DESIGN.md +1092 -0
- package/designs/minimal/DESIGN.md +1079 -0
- package/domains/consulting/INDUSTRY.md +230 -0
- package/domains/deeptech-investment/INDUSTRY.md +160 -0
- package/domains/general/INDUSTRY.md +6 -0
- package/index.ts +1 -0
- package/lib/agents/research-prompt.ts +129 -0
- package/lib/commands/designs.ts +59 -0
- package/lib/commands/disable.ts +14 -0
- package/lib/commands/domains.ts +59 -0
- package/lib/commands/enable.ts +48 -0
- package/lib/commands/help.ts +35 -0
- package/lib/config.ts +65 -0
- package/lib/ctx.ts +27 -0
- package/lib/design/designs.ts +389 -0
- package/lib/domain/domains.ts +258 -0
- package/lib/frontmatter.ts +63 -0
- package/lib/log.ts +35 -0
- package/lib/prompt-builder.ts +194 -0
- package/lib/qa/checks.ts +594 -0
- package/lib/qa/index.ts +38 -0
- package/lib/qa/measure.ts +287 -0
- package/lib/read-hooks/extractors/docx.ts +16 -0
- package/lib/read-hooks/extractors/pdf.ts +19 -0
- package/lib/read-hooks/extractors/pptx.ts +53 -0
- package/lib/read-hooks/extractors/xlsx.ts +81 -0
- package/lib/read-hooks/image/compress.ts +36 -0
- package/lib/read-hooks/index.ts +12 -0
- package/lib/read-hooks/post-read.ts +74 -0
- package/lib/read-hooks/pre-read.ts +51 -0
- package/package.json +65 -0
- package/plugin.ts +365 -0
- package/skill/SKILL.md +676 -0
- package/tools/designs.ts +126 -0
- package/tools/domains.ts +73 -0
- package/tools/qa.ts +61 -0
- package/tools/research-save.ts +96 -0
- package/tools/workspace-scan.ts +154 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 cyber-dash-tech
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Revela
|
|
2
|
+
|
|
3
|
+
**English** | [中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
An [OpenCode](https://opencode.ai) plugin that turns your AI into a presentation designer.
|
|
6
|
+
Describe your slides in conversation — Revela handles the rest and outputs a self-contained HTML file you can open in any browser.
|
|
7
|
+
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](tests/)
|
|
10
|
+
[](https://opencode.ai)
|
|
11
|
+
[](https://bun.sh)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- [OpenCode](https://opencode.ai) — Bun runtime (`bun >= 1.0.0`)
|
|
18
|
+
- [Google Chrome](https://www.google.com/chrome/) or Chromium — required for the automatic Layout QA feature
|
|
19
|
+
- Git — required for source install
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
Add `@cyber-dash-tech/revela` to the `plugin` array in your `opencode.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"$schema": "https://opencode.ai/config.json",
|
|
30
|
+
"plugin": ["@cyber-dash-tech/revela"]
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Restart OpenCode — the plugin is downloaded automatically via Bun.
|
|
35
|
+
|
|
36
|
+
To install globally (available in all projects), add the same `plugin` entry to `~/.config/opencode/opencode.json`.
|
|
37
|
+
|
|
38
|
+
### From source
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/cyber-dash-tech/revela
|
|
42
|
+
cd revela && npm install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Create `~/.config/opencode/plugins/revela.js`:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
export { default } from "/absolute/path/to/revela/index.ts";
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> **Note (China mainland):** OpenCode's plugin installer uses Bun's package manager, which does not respect npm registry mirror configuration. Use the source install method above, or manually install the package with npm and create a local wrapper — see [中文说明](README.zh-CN.md#安装).
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
/revela enable
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then start describing your presentation to the AI. Revela will ask about your topic, audience, and slide count, then generate a self-contained HTML deck. Open the output file in any browser — no build step, no framework.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
/revela disable
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Turns off Revela's system prompt for the current session.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Commands
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
/revela show status (enabled/disabled, active design/domain) + help
|
|
75
|
+
/revela enable activate slide generation mode for this session
|
|
76
|
+
/revela disable deactivate
|
|
77
|
+
|
|
78
|
+
/revela designs list installed designs
|
|
79
|
+
/revela designs <name> switch to a design (rebuilds system prompt immediately)
|
|
80
|
+
/revela designs-add <source> install a design from a URL, local path, or github:user/repo
|
|
81
|
+
|
|
82
|
+
/revela domains list installed domains
|
|
83
|
+
/revela domains <name> switch to a domain
|
|
84
|
+
/revela domains-add <source> install a domain from a URL, local path, or github:user/repo
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
All commands execute locally — zero LLM cost, instant feedback.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Built-in Designs
|
|
92
|
+
|
|
93
|
+
Three designs are bundled. Switch with `/revela designs <name>`.
|
|
94
|
+
|
|
95
|
+
| Name | Description |
|
|
96
|
+
|---|---|
|
|
97
|
+
| `default` | Dark executive style — deep navy/slate, sharp typography, ECharts data visualization |
|
|
98
|
+
| `minimal` | Clean light theme — high contrast, generous whitespace, professional look |
|
|
99
|
+
| `editorial-ribbon` | Bold editorial layout — accent ribbons, strong headlines, high visual impact |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Built-in Domains
|
|
104
|
+
|
|
105
|
+
Domains add field-specific report frameworks and terminology to the AI's context.
|
|
106
|
+
|
|
107
|
+
| Name | Description |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `general` | No domain specialization (default) |
|
|
110
|
+
| `deeptech-investment` | VC/investment analysis — market sizing, technology readiness, investment thesis |
|
|
111
|
+
| `consulting` | Strategic consulting — Go/No-Go reports, strategy design, belief-change frameworks |
|
|
112
|
+
|
|
113
|
+
Switch with `/revela domains <name>`.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Workspace Scan & Research
|
|
118
|
+
|
|
119
|
+
When Revela is enabled, the AI can:
|
|
120
|
+
|
|
121
|
+
- **Scan your workspace** (`revela-workspace-scan` tool) — automatically discovers PDF, Word, Excel, PowerPoint, CSV, and Markdown files in your project directory. Reference them with `@filename` to include their content in your slides.
|
|
122
|
+
- **Run parallel research** via the `revela-research` subagent — fetches targeted URLs and saves structured findings to `researches/<topic>/`. The primary agent then synthesises these findings into slides.
|
|
123
|
+
|
|
124
|
+
Supported file types for `@`-reference and automatic text extraction: `.pdf`, `.docx`, `.pptx`, `.xlsx`.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Layout QA
|
|
129
|
+
|
|
130
|
+
Every time the AI writes a slide file, Revela automatically runs a Puppeteer-based layout check at 1920×1080. If issues are detected, the report is fed back to the AI immediately so it self-corrects — no manual intervention needed.
|
|
131
|
+
|
|
132
|
+
Checks performed on every slide:
|
|
133
|
+
|
|
134
|
+
| Check | Description |
|
|
135
|
+
|---|---|
|
|
136
|
+
| **Fill ratio** | Content must occupy enough of the canvas |
|
|
137
|
+
| **Bottom whitespace** | Flags large empty gaps at the slide bottom |
|
|
138
|
+
| **Overflow** | Elements that extend outside the canvas |
|
|
139
|
+
| **Asymmetry** | Side-by-side columns with large height differences |
|
|
140
|
+
| **Density imbalance** | Columns where CSS `align-items: stretch` hides content imbalance |
|
|
141
|
+
| **Sparse** | Slides with too few visible elements |
|
|
142
|
+
|
|
143
|
+
Cover, TOC, divider, summary, and closing slides are automatically exempted from fill/spacing checks via the `data-slide-type` attribute.
|
|
144
|
+
|
|
145
|
+
You can also invoke QA manually: ask the AI to "run QA on slides/my-deck.html" or use the `revela-qa` tool directly.
|
|
146
|
+
|
|
147
|
+
Requires Google Chrome or Chromium to be installed on your system.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Custom Designs
|
|
152
|
+
|
|
153
|
+
A design is a folder with a `DESIGN.md` file. Frontmatter declares metadata:
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
---
|
|
157
|
+
name: my-design
|
|
158
|
+
description: Short description shown in /revela designs
|
|
159
|
+
author: you
|
|
160
|
+
version: 1.0.0
|
|
161
|
+
---
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The body provides visual style instructions injected into the AI's system prompt.
|
|
165
|
+
|
|
166
|
+
### On-demand marker system (recommended for larger designs)
|
|
167
|
+
|
|
168
|
+
Use HTML comment markers to split the design into sections. Only `global` and `layouts` are injected every turn; everything else is fetched on demand by the AI — keeping per-turn token cost low.
|
|
169
|
+
|
|
170
|
+
```html
|
|
171
|
+
<!-- @section:global:start -->
|
|
172
|
+
Color palette, typography, base CSS variables, JavaScript SlidePresentation class, HTML document structure...
|
|
173
|
+
<!-- @section:global:end -->
|
|
174
|
+
|
|
175
|
+
<!-- @section:layouts:start -->
|
|
176
|
+
Layout primitives used on every slide (two-column, card grid, etc.)...
|
|
177
|
+
<!-- @section:layouts:end -->
|
|
178
|
+
|
|
179
|
+
<!-- @section:components:start -->
|
|
180
|
+
<!-- @component:card:start -->
|
|
181
|
+
Card component HTML + CSS...
|
|
182
|
+
<!-- @component:card:end -->
|
|
183
|
+
|
|
184
|
+
<!-- @component:stat-card:start -->
|
|
185
|
+
Stat card HTML + CSS...
|
|
186
|
+
<!-- @component:stat-card:end -->
|
|
187
|
+
<!-- @section:components:end -->
|
|
188
|
+
|
|
189
|
+
<!-- @section:charts:start -->
|
|
190
|
+
ECharts / data visualization specifications...
|
|
191
|
+
<!-- @section:charts:end -->
|
|
192
|
+
|
|
193
|
+
<!-- @section:guide:start -->
|
|
194
|
+
Composition rules, common recipes, do/don't examples...
|
|
195
|
+
<!-- @section:guide:end -->
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Injected every turn:** `global`, `layouts`, and a compact Component Index table.
|
|
199
|
+
|
|
200
|
+
**Fetched on demand** by the AI: individual components, `charts`, `guide`.
|
|
201
|
+
|
|
202
|
+
Without markers, the entire `DESIGN.md` body is injected every turn (backward-compatible).
|
|
203
|
+
|
|
204
|
+
### Install a custom design
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
/revela designs-add github:your-org/your-design
|
|
208
|
+
/revela designs-add https://example.com/my-design.zip
|
|
209
|
+
/revela designs-add ./path/to/local/design-folder
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Custom Domains
|
|
215
|
+
|
|
216
|
+
A domain adds domain-specific report frameworks, terminology, and structural guidance.
|
|
217
|
+
|
|
218
|
+
Domain folder structure: `<name>/INDUSTRY.md` with the same frontmatter format as designs.
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
/revela domains-add github:your-org/your-domain
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Logging
|
|
227
|
+
|
|
228
|
+
Revela uses structured JSON logging via [tslog](https://tslog.js.org/).
|
|
229
|
+
Logs are written to `stderr`. To enable verbose debug output:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
REVELA_DEBUG=1 opencode
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT — see [LICENSE](LICENSE).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Revela
|
|
2
|
+
|
|
3
|
+
[English](README.md) | **中文**
|
|
4
|
+
|
|
5
|
+
[OpenCode](https://opencode.ai) 插件,让 AI 成为你的演示文稿设计师。
|
|
6
|
+
用对话描述你的幻灯片内容,Revela 自动生成一个可在任意浏览器直接打开的自包含 HTML 文件。
|
|
7
|
+
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](tests/)
|
|
10
|
+
[](https://opencode.ai)
|
|
11
|
+
[](https://bun.sh)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 环境要求
|
|
16
|
+
|
|
17
|
+
- [OpenCode](https://opencode.ai)(Bun 运行时,`bun >= 1.0.0`)
|
|
18
|
+
- [Google Chrome](https://www.google.com/chrome/) 或 Chromium —— 自动布局 QA 功能必须
|
|
19
|
+
- Git —— 源码安装时需要
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 安装
|
|
24
|
+
|
|
25
|
+
### 方式一:通过 opencode.json(推荐)
|
|
26
|
+
|
|
27
|
+
在项目目录的 `opencode.json` 中添加 `plugin` 字段:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"$schema": "https://opencode.ai/config.json",
|
|
32
|
+
"plugin": ["@cyber-dash-tech/revela"]
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
重启 OpenCode,插件会通过 Bun 自动下载安装。
|
|
37
|
+
|
|
38
|
+
如需全局安装(所有项目可用),在 `~/.config/opencode/opencode.json` 中添加同样的 `plugin` 配置。
|
|
39
|
+
|
|
40
|
+
### 方式二:国内网络安装
|
|
41
|
+
|
|
42
|
+
OpenCode 的插件安装器使用 Bun 的包管理器,**不支持 npm 镜像配置**(已知问题)。
|
|
43
|
+
如果直接安装失败,推荐以下方式:
|
|
44
|
+
|
|
45
|
+
**步骤 1**:用 npm 安装(支持国内镜像)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# 确认 npm 镜像已配置
|
|
49
|
+
npm config get registry # 应为 https://registry.npmmirror.com/
|
|
50
|
+
|
|
51
|
+
# 全局安装到 opencode 配置目录
|
|
52
|
+
cd ~/.config/opencode
|
|
53
|
+
npm install @cyber-dash-tech/revela
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**步骤 2**:创建本地插件入口文件
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cat > ~/.config/opencode/plugins/revela.js << 'EOF'
|
|
60
|
+
export { default } from "/Users/<你的用户名>/.config/opencode/node_modules/@cyber-dash-tech/revela/index.ts";
|
|
61
|
+
EOF
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**步骤 3**:确保 `~/.config/opencode/opencode.json` 中**没有** `plugin` 字段
|
|
65
|
+
|
|
66
|
+
(有 `plugin` 字段时,OpenCode 启动仍会尝试用 Bun 安装,绕过本地文件)
|
|
67
|
+
|
|
68
|
+
重启 OpenCode,`ctrl+p` 中看到 `/revela` 即安装成功。
|
|
69
|
+
|
|
70
|
+
### 方式三:源码安装
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/cyber-dash-tech/revela
|
|
74
|
+
cd revela && npm install
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
创建 `~/.config/opencode/plugins/revela.js`:
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
export { default } from "/path/to/revela/index.ts";
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 快速开始
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
/revela enable
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
然后向 AI 描述你的演示文稿。Revela 会询问主题、受众和页数,随后生成一个完整的 HTML 幻灯片文件。用浏览器直接打开,无需构建,无需框架。
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
/revela disable
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
关闭当前会话中 Revela 的系统提示注入。
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 命令
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
/revela 显示当前状态(启用/禁用、当前设计/领域)+ 帮助
|
|
105
|
+
/revela enable 为当前会话启用幻灯片生成模式
|
|
106
|
+
/revela disable 禁用
|
|
107
|
+
|
|
108
|
+
/revela designs 列出已安装的设计
|
|
109
|
+
/revela designs <name> 切换设计(立即重建系统提示)
|
|
110
|
+
/revela designs-add <source> 从 URL、本地路径或 github:user/repo 安装设计
|
|
111
|
+
|
|
112
|
+
/revela domains 列出已安装的领域
|
|
113
|
+
/revela domains <name> 切换领域
|
|
114
|
+
/revela domains-add <source> 从 URL、本地路径或 github:user/repo 安装领域
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
所有命令本地执行,零 LLM 消耗,即时响应。
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 内置设计
|
|
122
|
+
|
|
123
|
+
插件内置三套设计,用 `/revela designs <name>` 切换。
|
|
124
|
+
|
|
125
|
+
| 名称 | 说明 |
|
|
126
|
+
|---|---|
|
|
127
|
+
| `default` | 深色商务风格 —— 深海军蓝/石板色,锐利字体,ECharts 数据可视化 |
|
|
128
|
+
| `minimal` | 简洁浅色主题 —— 高对比度,充足留白,专业外观 |
|
|
129
|
+
| `editorial-ribbon` | 大胆的编辑版式 —— 强调色横幅,醒目标题,高视觉冲击力 |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 内置领域
|
|
134
|
+
|
|
135
|
+
领域为 AI 的上下文提供特定行业的报告框架和术语。
|
|
136
|
+
|
|
137
|
+
| 名称 | 说明 |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `general` | 无领域专化(默认) |
|
|
140
|
+
| `deeptech-investment` | VC/投资分析 —— 市场规模、技术成熟度、投资逻辑 |
|
|
141
|
+
| `consulting` | 战略咨询 —— Go/No-Go 报告、战略设计、信念转变框架 |
|
|
142
|
+
|
|
143
|
+
用 `/revela domains <name>` 切换。
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 工作区扫描与研究
|
|
148
|
+
|
|
149
|
+
启用 Revela 后,AI 可以:
|
|
150
|
+
|
|
151
|
+
- **扫描工作区**(`revela-workspace-scan` 工具)—— 自动发现项目目录中的 PDF、Word、Excel、PowerPoint、CSV 和 Markdown 文件。用 `@文件名` 引用,其内容会直接纳入幻灯片制作上下文。
|
|
152
|
+
- **并行研究**(通过 `revela-research` 子代理)—— 抓取目标 URL,将结构化研究结果保存到 `researches/<topic>/`,主代理随后将这些结果整合到幻灯片中。
|
|
153
|
+
|
|
154
|
+
支持 `@` 引用和自动文本提取的文件格式:`.pdf`、`.docx`、`.pptx`、`.xlsx`。
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 布局 QA
|
|
159
|
+
|
|
160
|
+
每次 AI 写入幻灯片文件时,Revela 会自动在 1920×1080 分辨率下运行基于 Puppeteer 的布局检测。发现问题后立即将报告反馈给 AI,AI 自行修正,无需人工干预。
|
|
161
|
+
|
|
162
|
+
每张幻灯片的检查项:
|
|
163
|
+
|
|
164
|
+
| 检查项 | 说明 |
|
|
165
|
+
|---|---|
|
|
166
|
+
| **填充率** | 内容必须占据足够的画布面积 |
|
|
167
|
+
| **底部留白** | 标记幻灯片底部的大片空白 |
|
|
168
|
+
| **溢出** | 超出画布边界的元素 |
|
|
169
|
+
| **不对称** | 并排列高度差异过大 |
|
|
170
|
+
| **密度失衡** | CSS `align-items: stretch` 列布局中隐藏的内容不平衡 |
|
|
171
|
+
| **稀疏** | 可见元素过少的幻灯片 |
|
|
172
|
+
|
|
173
|
+
封面、目录、分隔、总结、结语幻灯片通过 `data-slide-type` 属性自动豁免填充/间距检查。
|
|
174
|
+
|
|
175
|
+
也可以手动触发:让 AI "对 slides/my-deck.html 运行 QA",或直接使用 `revela-qa` 工具。
|
|
176
|
+
|
|
177
|
+
需要系统中已安装 Google Chrome 或 Chromium。
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 自定义设计
|
|
182
|
+
|
|
183
|
+
设计是包含 `DESIGN.md` 文件的文件夹,frontmatter 声明元数据:
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
---
|
|
187
|
+
name: my-design
|
|
188
|
+
description: 在 /revela designs 中显示的简短说明
|
|
189
|
+
author: 你的名字
|
|
190
|
+
version: 1.0.0
|
|
191
|
+
---
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
文件体提供视觉风格指令,会被注入 AI 的系统提示。
|
|
195
|
+
|
|
196
|
+
### 按需加载标记系统(大型设计推荐)
|
|
197
|
+
|
|
198
|
+
用 HTML 注释标记将设计分为多个区块。每轮只注入 `global` 和 `layouts`,其余内容由 AI 按需拉取,大幅降低每轮 token 消耗。
|
|
199
|
+
|
|
200
|
+
```html
|
|
201
|
+
<!-- @section:global:start -->
|
|
202
|
+
色彩、字体、基础 CSS 变量、SlidePresentation JS 类、HTML 文档结构...
|
|
203
|
+
<!-- @section:global:end -->
|
|
204
|
+
|
|
205
|
+
<!-- @section:layouts:start -->
|
|
206
|
+
每张幻灯片通用的布局原语(双列、卡片网格等)...
|
|
207
|
+
<!-- @section:layouts:end -->
|
|
208
|
+
|
|
209
|
+
<!-- @section:components:start -->
|
|
210
|
+
<!-- @component:card:start -->
|
|
211
|
+
卡片组件的 HTML + CSS...
|
|
212
|
+
<!-- @component:card:end -->
|
|
213
|
+
|
|
214
|
+
<!-- @component:stat-card:start -->
|
|
215
|
+
数据卡片的 HTML + CSS...
|
|
216
|
+
<!-- @component:stat-card:end -->
|
|
217
|
+
<!-- @section:components:end -->
|
|
218
|
+
|
|
219
|
+
<!-- @section:charts:start -->
|
|
220
|
+
ECharts / 数据可视化规范...
|
|
221
|
+
<!-- @section:charts:end -->
|
|
222
|
+
|
|
223
|
+
<!-- @section:guide:start -->
|
|
224
|
+
排版规则、常用模式、正反案例...
|
|
225
|
+
<!-- @section:guide:end -->
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**每轮注入**:`global`、`layouts` 和一份紧凑的组件索引表。
|
|
229
|
+
|
|
230
|
+
**按需获取**:单个组件详情、`charts`、`guide`。
|
|
231
|
+
|
|
232
|
+
没有标记时,整个 `DESIGN.md` 内容每轮全量注入(向后兼容)。
|
|
233
|
+
|
|
234
|
+
### 安装自定义设计
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
/revela designs-add github:your-org/your-design
|
|
238
|
+
/revela designs-add https://example.com/my-design.zip
|
|
239
|
+
/revela designs-add ./path/to/local/design-folder
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 自定义领域
|
|
245
|
+
|
|
246
|
+
领域为 AI 增加特定行业的报告框架、术语和结构化指导。
|
|
247
|
+
|
|
248
|
+
文件夹结构:`<name>/INDUSTRY.md`,frontmatter 格式与设计相同。
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
/revela domains-add github:your-org/your-domain
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 日志
|
|
257
|
+
|
|
258
|
+
Revela 通过 [tslog](https://tslog.js.org/) 输出结构化 JSON 日志,写入 `stderr`。
|
|
259
|
+
|
|
260
|
+
开启详细调试输出:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
REVELA_DEBUG=1 opencode
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 许可证
|
|
269
|
+
|
|
270
|
+
MIT —— 详见 [LICENSE](LICENSE)。
|