@cyber-dash-tech/revela 0.1.11 → 0.1.13

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 CHANGED
@@ -2,32 +2,44 @@
2
2
 
3
3
  **English** | [中文](README.zh-CN.md)
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-73%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
5
+ [![npm version](https://img.shields.io/npm/v/@cyber-dash-tech/revela)](https://www.npmjs.com/package/@cyber-dash-tech/revela) [![license](https://img.shields.io/npm/l/@cyber-dash-tech/revela)](LICENSE) [![tests](https://img.shields.io/badge/tests-110%20passing-brightgreen)](tests/) [![OpenCode plugin](https://img.shields.io/badge/OpenCode-plugin-blue)](https://opencode.ai) [![Bun](https://img.shields.io/badge/Bun-%E2%89%A51.0-orange)](https://bun.sh)
6
6
 
7
7
  <p align="center">
8
8
  <img src="assets/img/logo.png" alt="Revela" width="800" />
9
9
  </p>
10
10
 
11
- An [OpenCode](https://opencode.ai) plugin that turns your AI into a presentation assistant.
12
- Tell Revela what's on your mind it'll finish the research and analysis, and deliver a complete slide deck in a couple of minutes.
11
+ Revela is an [OpenCode](https://opencode.ai) plugin that turns your current agent into an HTML slide deck generator.
12
+ Enable it for a session, give the agent a presentation task, and it can research, structure, write, and QA a complete deck in `slides/*.html`.
13
13
 
14
+ **[Live Demo — The AI Power Shift](https://cyber-dash-tech.github.io/revela/assets/html/ai-power-shift.html)** · A 5-slide investment brief generated with Revela.
14
15
 
16
+ ---
17
+
18
+ ## What Revela Is
15
19
 
16
- **[Live Demo The AI Power Shift](https://cyber-dash-tech.github.io/revela/assets/html/ai-power-shift.html)** · A 5-slide investment brief generated entirely by Revela.
20
+ Revela is a mode, not a separate chat agent.
21
+
22
+ - `/revela enable` injects a presentation-specific system prompt into your current agent
23
+ - the prompt is built from 3 layers: core skill, active domain, active design
24
+ - the agent can scan workspace files, delegate web research, generate HTML slides, and run layout QA automatically
25
+ - design and domain switching happen locally and rebuild the active prompt immediately
17
26
 
18
27
  ---
19
28
 
20
29
  ## Requirements
21
30
 
22
- - [OpenCode](https://opencode.ai) — Bun runtime (`bun >= 1.0.0`)
23
- - [Google Chrome](https://www.google.com/chrome/) or Chromium — required for the automatic Layout QA feature
24
- - Git required for source install
31
+ - [OpenCode](https://opencode.ai)
32
+ - Bun runtime (`bun >= 1.0.0`)
33
+ - [Google Chrome](https://www.google.com/chrome/) or Chromium for layout QA and PDF export
34
+ - Git for source install
25
35
 
26
36
  ---
27
37
 
28
38
  ## Install
29
39
 
30
- Add `@cyber-dash-tech/revela` to the `plugin` array in your `opencode.json`:
40
+ ### Standard install
41
+
42
+ Add `@cyber-dash-tech/revela` to the `plugin` array in `opencode.json`:
31
43
 
32
44
  ```json
33
45
  {
@@ -36,15 +48,24 @@ Add `@cyber-dash-tech/revela` to the `plugin` array in your `opencode.json`:
36
48
  }
37
49
  ```
38
50
 
39
- Restart OpenCode the plugin is downloaded automatically via Bun.
51
+ Restart OpenCode. The plugin is installed automatically via Bun.
40
52
 
41
- To install globally (available in all projects), add the same `plugin` entry to `~/.config/opencode/opencode.json`.
53
+ To install globally, add the same `plugin` entry to `~/.config/opencode/opencode.json`.
42
54
 
43
- ### From source
55
+ ### Local wrapper install
56
+
57
+ Use this when:
58
+
59
+ - Bun plugin install is blocked or unreliable
60
+ - you are on a mainland China network
61
+ - you want to run Revela from a local checkout
62
+
63
+ From source:
44
64
 
45
65
  ```bash
46
66
  git clone https://github.com/cyber-dash-tech/revela
47
- cd revela && npm install
67
+ cd revela
68
+ npm install
48
69
  ```
49
70
 
50
71
  Create `~/.config/opencode/plugins/revela.js`:
@@ -53,24 +74,43 @@ Create `~/.config/opencode/plugins/revela.js`:
53
74
  export { default } from "/absolute/path/to/revela/index.ts";
54
75
  ```
55
76
 
56
- > **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#安装).
77
+ If you use the local wrapper route, make sure `~/.config/opencode/opencode.json` does not also contain a `plugin` entry for `@cyber-dash-tech/revela`, otherwise OpenCode will still try Bun-based installation.
78
+
79
+ ### China mainland note
80
+
81
+ OpenCode's npm plugin installer uses Bun and may ignore npm mirror configuration. If direct installation fails, use the local wrapper method above or install the package with npm under `~/.config/opencode/` and create a local wrapper file.
57
82
 
58
83
  ---
59
84
 
60
85
  ## Quick Start
61
86
 
62
- Enable OpenCode's web search (recommended):
87
+ Start OpenCode:
88
+
63
89
  ```bash
64
- OPENCODE_ENABLE_EXA=1 opencode
90
+ opencode
65
91
  ```
66
92
 
67
- Enable Revela in your OpenCode session — turns the primary agent into a slide design expert:
68
- ```
93
+ Enable Revela in the current session:
94
+
95
+ ```text
69
96
  /revela enable
70
97
  ```
71
98
 
72
- To turn it off and restore the primary agent to normal:
99
+ Then give the agent a slide task, for example:
100
+
101
+ ```text
102
+ Create a 6-slide HTML deck on humanoid robotics supply chains. Use the summit design, cite the main market drivers, and save the result to slides/humanoid-robotics.html.
103
+ ```
104
+
105
+ Export the resulting HTML deck to PDF if needed:
106
+
107
+ ```text
108
+ /revela pdf slides/humanoid-robotics.html
73
109
  ```
110
+
111
+ Disable Revela and return the current agent to normal mode:
112
+
113
+ ```text
74
114
  /revela disable
75
115
  ```
76
116
 
@@ -78,86 +118,113 @@ To turn it off and restore the primary agent to normal:
78
118
 
79
119
  ## Commands
80
120
 
81
- ```
82
- /revela show status (enabled/disabled, active design/domain) + help
83
- /revela enable activate slide generation mode for this session
84
- /revela disable deactivate
121
+ ```text
122
+ /revela show status and help
123
+ /revela enable enable presentation mode for this session
124
+ /revela disable disable presentation mode
85
125
 
86
126
  /revela designs list installed designs
87
- /revela designs <name> switch to a design (rebuilds system prompt immediately)
88
- /revela designs-add <source> install a design from a URL, local path, or github:user/repo
127
+ /revela designs <name> activate a design
128
+ /revela designs-add <source> install a design from URL, local path, or github:user/repo
129
+ /revela designs-rm <name> remove an installed design
89
130
 
90
131
  /revela domains list installed domains
91
- /revela domains <name> switch to a domain
92
- /revela domains-add <source> install a domain from a URL, local path, or github:user/repo
132
+ /revela domains <name> activate a domain
133
+ /revela domains-add <source> install a domain from URL, local path, or github:user/repo
134
+ /revela domains-rm <name> remove an installed domain
135
+
136
+ /revela pdf <file> export an HTML deck to PDF in the same directory
93
137
  ```
94
138
 
95
- All commands execute locally zero LLM cost, instant feedback.
139
+ All `/revela` commands execute locally with zero LLM cost.
96
140
 
97
141
  ---
98
142
 
99
- ## Built-in Designs
143
+ ## How It Works
100
144
 
101
- Two designs are bundled. Switch with `/revela designs <name>`.
145
+ When Revela is enabled, it appends a generated prompt to the current agent's system prompt.
102
146
 
103
- | Name | Description | Preview |
104
- |---|---|---|
105
- | `aurora` | Dark executive style deep navy/slate, sharp typography, ECharts data visualization | ![default](assets/img/slide-example-aurora.jpg) |
106
- | `summit` | Editorial outdoor annual-report theme | ![summit](assets/img/slide-example-summit.jpg) |
147
+ That prompt is built from 3 layers:
148
+
149
+ 1. `skill/SKILL.md` — the core slide-generation workflow
150
+ 2. active domain domain-specific report structure and terminology
151
+ 3. active design — visual language, layouts, components, and chart rules
152
+
153
+ The current design and domain are persisted in `~/.config/revela/config.json`. The session-level enabled/disabled state is not persisted.
107
154
 
108
155
  ---
109
156
 
110
- ## Built-in Domains
157
+ ## Research And File Ingestion
111
158
 
112
- Domains add field-specific report frameworks and terminology to the AI's context.
159
+ When Revela is enabled, the agent can use:
113
160
 
114
- | Name | Description |
115
- |---|---|
116
- | `general` | No domain specialization (default) |
117
- | `deeptech-investment` | VC/investment analysis — market sizing, technology readiness, investment thesis |
118
- | `consulting` | Strategic consulting Go/No-Go reports, strategy design, belief-change frameworks |
161
+ - `revela-workspace-scan` to discover PDFs, Office files, CSVs, Markdown, and text files in the workspace
162
+ - the `revela-research` subagent to fetch targeted web sources and save structured findings into `researches/<topic>/`
163
+ - `revela-research-save` to write one findings file per research axis
164
+
165
+ Supported file types for `@` reference and automatic text extraction:
166
+
167
+ - `.pdf`
168
+ - `.docx`
169
+ - `.pptx`
170
+ - `.xlsx`
119
171
 
120
- Switch with `/revela domains <name>`.
172
+ Revela transparently extracts text from these binary files before the main agent reasons over them.
121
173
 
122
174
  ---
123
175
 
124
- ## Workspace Scan & Research
176
+ ## Layout QA And Compliance
125
177
 
126
- When Revela is enabled, the AI can:
178
+ Every time the agent writes `slides/*.html`, Revela automatically runs a Puppeteer-based QA pass at `1920x1080`.
179
+ The QA report is fed back immediately so the agent can fix layout or compliance problems before moving on.
127
180
 
128
- - **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.
129
- - **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.
181
+ Current QA dimensions:
130
182
 
131
- Supported file types for `@`-reference and automatic text extraction: `.pdf`, `.docx`, `.pptx`, `.xlsx`.
183
+ | Dimension | What it checks |
184
+ |---|---|
185
+ | `overflow` | Elements extending outside the slide canvas |
186
+ | `balance` | Sparse slides, weak fill, centroid drift, and bottom-gap issues |
187
+ | `symmetry` | Side-by-side column imbalance in height or density |
188
+ | `rhythm` | Irregular vertical spacing between stacked siblings |
189
+ | `compliance` | Unknown design classes and novel CSS rules outside the active design vocabulary |
190
+
191
+ Slides must declare `slide-qa="true"` or `slide-qa="false"`.
192
+
193
+ - use `slide-qa="true"` for content-heavy slides that should undergo full layout QA
194
+ - use `slide-qa="false"` for structural slides such as cover, TOC, quote, summary, or closing pages
195
+
196
+ Compliance is part of the generation loop, not a soft suggestion. If the agent introduces classes or CSS rules that are not defined by the active design, QA flags them and the file should be corrected.
197
+
198
+ You can also run QA manually with the `revela-qa` tool.
132
199
 
133
200
  ---
134
201
 
135
- ## Layout QA
202
+ ## Built-in Designs
136
203
 
137
- 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.
204
+ Switch designs with `/revela designs <name>`.
138
205
 
139
- Checks performed on every slide:
206
+ | Name | Description | Preview |
207
+ |---|---|---|
208
+ | `aurora` | Dark executive style with structured information density and ECharts-ready data visualization patterns | ![aurora](assets/img/slide-example-aurora.jpg) |
209
+ | `summit` | Editorial annual-report style for image-rich narrative slides and restrained business storytelling | ![summit](assets/img/slide-example-summit.jpg) |
140
210
 
141
- | Check | Description |
142
- |---|---|
143
- | **Fill ratio** | Content must occupy enough of the canvas |
144
- | **Bottom whitespace** | Flags large empty gaps at the slide bottom |
145
- | **Overflow** | Elements that extend outside the canvas |
146
- | **Asymmetry** | Side-by-side columns with large height differences |
147
- | **Density imbalance** | Columns where CSS `align-items: stretch` hides content imbalance |
148
- | **Sparse** | Slides with too few visible elements |
211
+ ---
149
212
 
150
- Structural slides (cover, TOC, quote, summary, closing) set `slide-qa="false"` and are automatically exempted from fill/spacing checks. Content-heavy slides set `slide-qa="true"` to opt in.
213
+ ## Built-in Domains
151
214
 
152
- You can also invoke QA manually: ask the AI to "run QA on slides/my-deck.html" or use the `revela-qa` tool directly.
215
+ Switch domains with `/revela domains <name>`.
153
216
 
154
- Requires Google Chrome or Chromium to be installed on your system.
217
+ | Name | Description |
218
+ |---|---|
219
+ | `general` | No domain specialization |
220
+ | `deeptech-investment` | VC and investment analysis: market sizing, technical readiness, moat, and investment thesis |
221
+ | `consulting` | Strategic consulting: go/no-go decisions, strategy design, and belief-change reporting |
155
222
 
156
223
  ---
157
224
 
158
225
  ## Custom Designs
159
226
 
160
- A design is a folder with a `DESIGN.md` file. Frontmatter declares metadata:
227
+ A custom design is a folder containing `DESIGN.md` with frontmatter metadata:
161
228
 
162
229
  ```yaml
163
230
  ---
@@ -168,49 +235,60 @@ version: 1.0.0
168
235
  ---
169
236
  ```
170
237
 
171
- The body provides visual style instructions injected into the AI's system prompt.
238
+ The body defines the visual system used by the agent.
172
239
 
173
- ### On-demand marker system (recommended for larger designs)
240
+ ### Marker system
174
241
 
175
- 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.
242
+ For larger designs, use the current marker format:
176
243
 
177
244
  ```html
178
- <!-- @section:global:start -->
179
- Color palette, typography, base CSS variables, JavaScript SlidePresentation class, HTML document structure...
180
- <!-- @section:global:end -->
245
+ <!-- @design:foundation:start -->
246
+ Colors, typography, CSS variables, HTML shell, base JS...
247
+ <!-- @design:foundation:end -->
248
+
249
+ <!-- @design:rules:start -->
250
+ Composition rules, do/don't guidance, design-specific constraints...
251
+ <!-- @design:rules:end -->
252
+
253
+ <!-- @design:layouts:start -->
254
+ <!-- @layout:cover:start qa=false -->
255
+ Layout details...
256
+ <!-- @layout:cover:end -->
181
257
 
182
- <!-- @section:layouts:start -->
183
- Layout primitives used on every slide (two-column, card grid, etc.)...
184
- <!-- @section:layouts:end -->
258
+ <!-- @layout:two-col:start qa=true -->
259
+ Layout details...
260
+ <!-- @layout:two-col:end -->
261
+ <!-- @design:layouts:end -->
185
262
 
186
- <!-- @section:components:start -->
263
+ <!-- @design:components:start -->
187
264
  <!-- @component:card:start -->
188
- Card component HTML + CSS...
265
+ Component HTML + CSS...
189
266
  <!-- @component:card:end -->
190
267
 
191
268
  <!-- @component:stat-card:start -->
192
- Stat card HTML + CSS...
269
+ Component HTML + CSS...
193
270
  <!-- @component:stat-card:end -->
194
- <!-- @section:components:end -->
271
+ <!-- @design:components:end -->
195
272
 
196
- <!-- @section:charts:start -->
197
- ECharts / data visualization specifications...
198
- <!-- @section:charts:end -->
199
-
200
- <!-- @section:guide:start -->
201
- Composition rules, common recipes, do/don't examples...
202
- <!-- @section:guide:end -->
273
+ <!-- @design:chart-rules:start -->
274
+ Chart guidance...
275
+ <!-- @design:chart-rules:end -->
203
276
  ```
204
277
 
205
- **Injected every turn:** `global`, `layouts`, and a compact Component Index table.
278
+ Prompt injection behavior:
279
+
280
+ - always injected: `@design:foundation`, `@design:rules`, layout index, component index
281
+ - fetched on demand: individual `@layout:*`, individual `@component:*`, `@design:chart-rules`
206
282
 
207
- **Fetched on demand** by the AI: individual components, `charts`, `guide`.
283
+ If a design has no markers, Revela falls back to injecting the full `DESIGN.md` body.
208
284
 
209
- Without markers, the entire `DESIGN.md` body is injected every turn (backward-compatible).
285
+ ### Compliance note for design authors
286
+
287
+ Revela extracts the allowed CSS class vocabulary from your design and uses it during QA compliance checks. If the agent invents a class or defines a CSS rule outside that vocabulary, QA reports it.
210
288
 
211
289
  ### Install a custom design
212
290
 
213
- ```
291
+ ```text
214
292
  /revela designs-add github:your-org/your-design
215
293
  /revela designs-add https://example.com/my-design.zip
216
294
  /revela designs-add ./path/to/local/design-folder
@@ -220,20 +298,31 @@ Without markers, the entire `DESIGN.md` body is injected every turn (backward-co
220
298
 
221
299
  ## Custom Domains
222
300
 
223
- A domain adds domain-specific report frameworks, terminology, and structural guidance.
301
+ A custom domain is a folder containing `INDUSTRY.md` with frontmatter metadata similar to a design.
224
302
 
225
- Domain folder structure: `<name>/INDUSTRY.md` with the same frontmatter format as designs.
226
-
227
- ```
303
+ ```text
228
304
  /revela domains-add github:your-org/your-domain
229
305
  ```
230
306
 
307
+ `INDUSTRY.md` is a legacy filename kept for compatibility.
308
+
309
+ ---
310
+
311
+ ## PDF Export
312
+
313
+ Export a generated HTML deck to PDF:
314
+
315
+ ```text
316
+ /revela pdf slides/my-deck.html
317
+ ```
318
+
319
+ Revela renders each slide through Chrome/Chromium and assembles the final PDF in the same directory.
320
+
231
321
  ---
232
322
 
233
323
  ## Logging
234
324
 
235
- Revela uses structured JSON logging via [tslog](https://tslog.js.org/).
236
- Logs are written to `stderr`. To enable verbose debug output:
325
+ Revela uses structured logging via [tslog](https://tslog.js.org/). To enable verbose debug output:
237
326
 
238
327
  ```bash
239
328
  REVELA_DEBUG=1 opencode