@cyber-dash-tech/revela 0.1.13 → 0.1.15
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 +5 -5
- package/README.zh-CN.md +5 -5
- package/lib/commands/help.ts +2 -1
- package/lib/commands/pdf.ts +2 -2
- package/package.json +1 -1
- package/plugin.ts +4 -4
- package/skill/SKILL.md +10 -10
- package/tools/qa.ts +2 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
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 `
|
|
12
|
+
Enable it for a session, give the agent a presentation task, and it can research, structure, write, and QA a complete deck in `decks/*.html`.
|
|
13
13
|
|
|
14
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.
|
|
15
15
|
|
|
@@ -99,13 +99,13 @@ Enable Revela in the current session:
|
|
|
99
99
|
Then give the agent a slide task, for example:
|
|
100
100
|
|
|
101
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
|
|
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 decks/humanoid-robotics.html.
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Export the resulting HTML deck to PDF if needed:
|
|
106
106
|
|
|
107
107
|
```text
|
|
108
|
-
/revela pdf
|
|
108
|
+
/revela pdf decks/humanoid-robotics.html
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
Disable Revela and return the current agent to normal mode:
|
|
@@ -175,7 +175,7 @@ Revela transparently extracts text from these binary files before the main agent
|
|
|
175
175
|
|
|
176
176
|
## Layout QA And Compliance
|
|
177
177
|
|
|
178
|
-
Every time the agent writes `
|
|
178
|
+
Every time the agent writes `decks/*.html`, Revela automatically runs a Puppeteer-based QA pass at `1920x1080`.
|
|
179
179
|
The QA report is fed back immediately so the agent can fix layout or compliance problems before moving on.
|
|
180
180
|
|
|
181
181
|
Current QA dimensions:
|
|
@@ -313,7 +313,7 @@ A custom domain is a folder containing `INDUSTRY.md` with frontmatter metadata s
|
|
|
313
313
|
Export a generated HTML deck to PDF:
|
|
314
314
|
|
|
315
315
|
```text
|
|
316
|
-
/revela pdf
|
|
316
|
+
/revela pdf decks/my-deck.html
|
|
317
317
|
```
|
|
318
318
|
|
|
319
319
|
Revela renders each slide through Chrome/Chromium and assembles the final PDF in the same directory.
|
package/README.zh-CN.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
Revela 是一个 [OpenCode](https://opencode.ai) 插件,可以把你当前使用的 agent 变成 HTML 幻灯片生成器。
|
|
12
|
-
在当前会话中启用它之后,agent 可以完成调研、结构设计、HTML 写作和自动 QA,并把结果输出到 `
|
|
12
|
+
在当前会话中启用它之后,agent 可以完成调研、结构设计、HTML 写作和自动 QA,并把结果输出到 `decks/*.html`。
|
|
13
13
|
|
|
14
14
|
**[在线演示 — AI 权力转移](https://cyber-dash-tech.github.io/revela/assets/html/ai-power-shift.html)** · 一份使用 Revela 生成的 5 页投资简报。
|
|
15
15
|
|
|
@@ -99,13 +99,13 @@ opencode
|
|
|
99
99
|
然后直接给 agent 一个幻灯片任务,例如:
|
|
100
100
|
|
|
101
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
|
|
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 decks/humanoid-robotics.html.
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
如果需要,把生成好的 HTML 导出为 PDF:
|
|
106
106
|
|
|
107
107
|
```text
|
|
108
|
-
/revela pdf
|
|
108
|
+
/revela pdf decks/humanoid-robotics.html
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
关闭 Revela,让当前 agent 回到普通模式:
|
|
@@ -175,7 +175,7 @@ Revela 会在主 agent 处理这些文件前,先透明地完成文本提取。
|
|
|
175
175
|
|
|
176
176
|
## 布局 QA 与合规检查
|
|
177
177
|
|
|
178
|
-
每次 agent 写入 `
|
|
178
|
+
每次 agent 写入 `decks/*.html` 时,Revela 都会自动在 `1920x1080` 分辨率下运行一轮基于 Puppeteer 的 QA。
|
|
179
179
|
报告会立刻反馈给 agent,用于继续修正布局或 design compliance 问题。
|
|
180
180
|
|
|
181
181
|
当前 QA 维度如下:
|
|
@@ -313,7 +313,7 @@ Revela 会从 design 中提取允许使用的 CSS class vocabulary,并在 QA
|
|
|
313
313
|
把生成好的 HTML deck 导出为 PDF:
|
|
314
314
|
|
|
315
315
|
```text
|
|
316
|
-
/revela pdf
|
|
316
|
+
/revela pdf decks/my-deck.html
|
|
317
317
|
```
|
|
318
318
|
|
|
319
319
|
Revela 会通过 Chrome / Chromium 渲染每一页 slide,并在同目录生成最终 PDF。
|
package/lib/commands/help.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { activeDesign } from "../design/designs"
|
|
8
8
|
import { activeDomain } from "../domain/domains"
|
|
9
9
|
import { ctx } from "../ctx"
|
|
10
|
+
import pkg from "../../package.json"
|
|
10
11
|
|
|
11
12
|
export async function handleHelp(
|
|
12
13
|
send: (text: string) => Promise<void>,
|
|
@@ -16,7 +17,7 @@ export async function handleHelp(
|
|
|
16
17
|
const status = ctx.enabled ? "enabled ✓" : "disabled"
|
|
17
18
|
await send(
|
|
18
19
|
`\`\`\`\n` +
|
|
19
|
-
` R E V E L A\n` +
|
|
20
|
+
` R E V E L A v${pkg.version}\n` +
|
|
20
21
|
`\`\`\`\n` +
|
|
21
22
|
`**Status:** ${status}\n` +
|
|
22
23
|
`🟠 **Design:** \`${design}\`\n` +
|
package/lib/commands/pdf.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handler for `/revela pdf <file_path>` — exports an HTML slide deck to PDF.
|
|
5
5
|
*
|
|
6
6
|
* Output: same directory and base name as the input, with .pdf extension.
|
|
7
|
-
* Example:
|
|
7
|
+
* Example: decks/my-deck.html → decks/my-deck.pdf
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { resolve } from "path"
|
|
@@ -17,7 +17,7 @@ export async function handlePdf(
|
|
|
17
17
|
if (!filePath) {
|
|
18
18
|
await send(
|
|
19
19
|
"**Usage:** `/revela pdf <file_path>`\n\n" +
|
|
20
|
-
"Example: `/revela pdf
|
|
20
|
+
"Example: `/revela pdf decks/my-deck.html`"
|
|
21
21
|
)
|
|
22
22
|
return
|
|
23
23
|
}
|
package/package.json
CHANGED
package/plugin.ts
CHANGED
|
@@ -343,7 +343,7 @@ const server: Plugin = (async (pluginCtx) => {
|
|
|
343
343
|
// Handles PDF and images — read tool succeeds with base64 attachment.
|
|
344
344
|
// PDF: extract text, remove base64. Images: jimp compress.
|
|
345
345
|
//
|
|
346
|
-
// Also handles: auto layout QA after writing
|
|
346
|
+
// Also handles: auto layout QA after writing decks/*.html
|
|
347
347
|
"tool.execute.after": async (input, output) => {
|
|
348
348
|
if (!ctx.enabled) return
|
|
349
349
|
|
|
@@ -360,11 +360,11 @@ const server: Plugin = (async (pluginCtx) => {
|
|
|
360
360
|
return
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
// ── Auto layout QA after writing
|
|
363
|
+
// ── Auto layout QA after writing decks/*.html ─────────────────────
|
|
364
364
|
if (input.tool === "write") {
|
|
365
365
|
const filePath: string = input.args?.filePath ?? ""
|
|
366
|
-
// Only trigger for HTML files inside a
|
|
367
|
-
if (!filePath.match(/
|
|
366
|
+
// Only trigger for HTML files inside a decks/ directory
|
|
367
|
+
if (!filePath.match(/decks\/[^/]+\.html$/)) return
|
|
368
368
|
|
|
369
369
|
try {
|
|
370
370
|
// Extract design's allowed class vocabulary for compliance checking
|
package/skill/SKILL.md
CHANGED
|
@@ -38,7 +38,7 @@ to Phase 1.5.
|
|
|
38
38
|
|
|
39
39
|
Once you have the user's answers, **derive the deck slug** from the topic:
|
|
40
40
|
lowercase, hyphens, no spaces (e.g. "AI Investment Shift" → `ai-investment-shift`).
|
|
41
|
-
Tell the user: "I'll save this deck as `
|
|
41
|
+
Tell the user: "I'll save this deck as `decks/{slug}.html`." They can correct the
|
|
42
42
|
name at this point.
|
|
43
43
|
|
|
44
44
|
### Phase 1.5 — Deck Initialization & Resume Check
|
|
@@ -65,7 +65,7 @@ After confirming the deck slug, check whether this deck has been worked on befor
|
|
|
65
65
|
- **c** → proceed to Phase 2 normally (full research)
|
|
66
66
|
|
|
67
67
|
All subsequent file paths in this session use the confirmed slug:
|
|
68
|
-
- Slides file: `
|
|
68
|
+
- Slides file: `decks/{slug}.html`
|
|
69
69
|
- Research dir: `researches/{slug}/`
|
|
70
70
|
|
|
71
71
|
### Phase 2 — Select Design
|
|
@@ -345,19 +345,19 @@ Then ask:
|
|
|
345
345
|
Once the fetch is complete, generate the complete HTML file in one shot.
|
|
346
346
|
|
|
347
347
|
- Output **only** the raw HTML — no markdown fences, no explanation before or after
|
|
348
|
-
- Create a `
|
|
349
|
-
- Write the file to `
|
|
348
|
+
- Create a `decks/` directory in the current working directory if it doesn't already exist
|
|
349
|
+
- Write the file to `decks/{slug}.html` using the deck slug confirmed in Phase 1.5
|
|
350
350
|
- The file must be completely self-contained (all CSS and JS inline)
|
|
351
351
|
|
|
352
352
|
### Phase 6 — Iterate
|
|
353
353
|
|
|
354
354
|
After generating, briefly tell the user:
|
|
355
|
-
- The filename you wrote (e.g. `
|
|
355
|
+
- The filename you wrote (e.g. `decks/ai-future.html`)
|
|
356
356
|
- How to navigate (arrow keys / swipe)
|
|
357
357
|
- One line invitation to request changes
|
|
358
358
|
|
|
359
359
|
For change requests: re-generate the **entire** file (don't patch). Apply the
|
|
360
|
-
change and silently overwrite the same `
|
|
360
|
+
change and silently overwrite the same `decks/{slug}.html` filename.
|
|
361
361
|
|
|
362
362
|
---
|
|
363
363
|
|
|
@@ -474,11 +474,11 @@ decorative fill patterns.
|
|
|
474
474
|
|
|
475
475
|
| Topic | Filename |
|
|
476
476
|
|-------|----------|
|
|
477
|
-
| "AI in Healthcare" | `
|
|
478
|
-
| "Q3 Sales Review" | `
|
|
479
|
-
| "Intro to Python" | `
|
|
477
|
+
| "AI in Healthcare" | `decks/ai-in-healthcare.html` |
|
|
478
|
+
| "Q3 Sales Review" | `decks/q3-sales-review.html` |
|
|
479
|
+
| "Intro to Python" | `decks/intro-to-python.html` |
|
|
480
480
|
|
|
481
|
-
Lowercase, hyphens, no spaces, `.html` extension. Always place files inside the `
|
|
481
|
+
Lowercase, hyphens, no spaces, `.html` extension. Always place files inside the `decks/` subdirectory.
|
|
482
482
|
|
|
483
483
|
---
|
|
484
484
|
|
package/tools/qa.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Exposed to the LLM so it can run layout checks after writing a slides file.
|
|
7
7
|
* Also called automatically by the tool.execute.after hook in plugin.ts
|
|
8
|
-
* when the LLM writes a file matching
|
|
8
|
+
* when the LLM writes a file matching decks/*.html.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { tool } from "@opencode-ai/plugin"
|
|
@@ -21,7 +21,7 @@ export default tool({
|
|
|
21
21
|
"Checks for: canvas underfill (too much empty space), bottom whitespace, " +
|
|
22
22
|
"left-right column asymmetry, element overflow, and card height variance. " +
|
|
23
23
|
"Returns a structured report with specific issues and fix instructions. " +
|
|
24
|
-
"Call this after writing or editing any
|
|
24
|
+
"Call this after writing or editing any decks/*.html file to verify layout quality.",
|
|
25
25
|
args: {
|
|
26
26
|
file: tool.schema
|
|
27
27
|
.string()
|