@cyber-dash-tech/revela 0.7.6 → 0.7.8

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
@@ -140,7 +140,7 @@ Disable presentation mode when done:
140
140
  /revela init initialize or refresh workspace DECKS.json
141
141
  /revela review [slug] review active deck readiness before writing HTML
142
142
  /revela remember <text> save an explicit user/workflow preference
143
- /revela edit <target> open visual comment editor for a deck slug or decks/*.html
143
+ /revela edit [target] open visual editor for active deck or a specific target
144
144
 
145
145
  /revela designs list installed designs
146
146
  /revela designs <name> activate a design
@@ -591,13 +591,16 @@ A custom domain is a folder containing `INDUSTRY.md`.
591
591
 
592
592
  ## Visual Editing
593
593
 
594
- Open the visual editor for an existing deck by slug or workspace-relative HTML path:
594
+ Open the visual editor for the active deck, or pass a slug / workspace-relative HTML path:
595
595
 
596
596
  ```text
597
+ /revela edit
597
598
  /revela edit my-deck
598
599
  /revela edit decks/my-deck.html
599
600
  ```
600
601
 
602
+ Without a target, `/revela edit` opens `DECKS.json.activeDeck`. If no active deck is set and there is exactly one deck in `DECKS.json`, it opens that deck.
603
+
601
604
  The editor opens in your browser. Use `Ctrl`/`Cmd` + click to reference deck elements, write a natural-language comment, then send it back to OpenCode. Revela sends a structured edit prompt that includes the deck file, slide context, selected element metadata, and your comment.
602
605
 
603
606
  LLM tool equivalent: `revela-edit` with `{ "target": "decks/my-deck.html" }`. This lets the agent open the same editor when you say things like “I want to edit @decks/my-deck.html”.
package/README.zh-CN.md CHANGED
@@ -139,7 +139,7 @@ Create a 6-slide HTML deck on humanoid robotics supply chains. Cite the main mar
139
139
  /revela init 初始化或刷新工作区 DECKS.json
140
140
  /revela review [slug] 写 HTML 前检查 active deck readiness
141
141
  /revela remember <text> 保存明确的用户/工作流偏好
142
- /revela edit <target> deck slug decks/*.html 打开可视化评论编辑器
142
+ /revela edit [target] 打开 active deck 或指定 target 的可视化编辑器
143
143
 
144
144
  /revela designs 列出已安装 design
145
145
  /revela designs <name> 激活某个 design
@@ -556,13 +556,16 @@ Prompt 注入规则:
556
556
 
557
557
  ## 可视化编辑
558
558
 
559
- 可以通过 deck slug 或工作区相对 HTML 路径打开可视化编辑器:
559
+ 可以直接打开 active deck,也可以传入 deck slug 或工作区相对 HTML 路径:
560
560
 
561
561
  ```text
562
+ /revela edit
562
563
  /revela edit my-deck
563
564
  /revela edit decks/my-deck.html
564
565
  ```
565
566
 
567
+ 不传 target 时,`/revela edit` 会打开 `DECKS.json.activeDeck`。如果没有 active deck,但 `DECKS.json` 里只有一个 deck,则打开这个唯一 deck。
568
+
566
569
  编辑器会在浏览器中打开。使用 `Ctrl`/`Cmd` + 点击 deck 元素来引用它们,写一段自然语言评论,然后发送回 OpenCode。Revela 会把 deck 文件、slide 上下文、选中元素 metadata 和你的评论整理成结构化 edit prompt。
567
570
 
568
571
  对应的 LLM tool:`revela-edit`,参数为 `{ "target": "decks/my-deck.html" }`。因此当你说“我要编辑 @decks/my-deck.html”时,agent 也可以主动打开同一个编辑器。
@@ -6,10 +6,6 @@ export async function handleEdit(
6
6
  send: (text: string) => Promise<void>,
7
7
  ): Promise<void> {
8
8
  const target = input.trim()
9
- if (!target) {
10
- await send("**Usage:** `/revela edit <deck-slug|decks/file.html>`\n\nExamples: `/revela edit investor-update`, `/revela edit decks/investor-update.html`")
11
- return
12
- }
13
9
 
14
10
  try {
15
11
  const result = openEditableDeck(target, {
@@ -28,7 +28,7 @@ export async function handleHelp(
28
28
  `\`/revela disable\` — disable slide generation mode\n` +
29
29
  `\`/revela init\` — initialize or refresh workspace DECKS.json\n` +
30
30
  `\`/revela review [slug]\` — review active deck readiness before writing HTML\n` +
31
- `\`/revela edit <target>\` — open visual comment editor for a deck slug or decks/*.html\n` +
31
+ `\`/revela edit [target]\` — open visual editor for active deck or a specific target\n` +
32
32
  `\`/revela remember <text>\` — save an explicit preference to DECKS.json\n` +
33
33
  `\`/revela designs\` — list installed designs\n` +
34
34
  `\`/revela designs <name>\` — activate a design\n` +
@@ -11,7 +11,7 @@ export interface EditableDeck {
11
11
 
12
12
  export function resolveEditableDeck(workspaceRoot: string, input: string): EditableDeck {
13
13
  const requested = input.trim()
14
- if (!requested) throw new Error("Usage: /revela edit <deck-slug|decks/file.html>")
14
+ if (!requested) return resolveDefaultDeck(workspaceRoot)
15
15
 
16
16
  const slug = normalizeSlug(requested)
17
17
 
@@ -32,6 +32,32 @@ export function resolveEditableDeck(workspaceRoot: string, input: string): Edita
32
32
  return resolveDeckFile(workspaceRoot, slug, `decks/${slug}.html`, "fallback")
33
33
  }
34
34
 
35
+ function resolveDefaultDeck(workspaceRoot: string): EditableDeck {
36
+ if (!hasDecksState(workspaceRoot)) {
37
+ throw new Error(`No ${DECKS_STATE_FILE} found. Use /revela edit <deck-slug|decks/file.html>.`)
38
+ }
39
+
40
+ const state = readDecksState(workspaceRoot)
41
+ const activeSlug = normalizeSlug(state.activeDeck || "")
42
+ if (activeSlug) {
43
+ const deck = state.decks[activeSlug]
44
+ if (!deck) throw new Error(`Active deck ${activeSlug} does not exist in ${DECKS_STATE_FILE}. Use /revela edit <target>.`)
45
+ return resolveDeckFile(workspaceRoot, deck.slug, deck.outputPath, "decks-state")
46
+ }
47
+
48
+ const decks = Object.values(state.decks)
49
+ if (decks.length === 1) {
50
+ const deck = decks[0]
51
+ return resolveDeckFile(workspaceRoot, deck.slug, deck.outputPath, "decks-state")
52
+ }
53
+
54
+ if (decks.length === 0) {
55
+ throw new Error(`${DECKS_STATE_FILE} has no decks. Use /revela edit <deck-slug|decks/file.html>.`)
56
+ }
57
+
58
+ throw new Error(`${DECKS_STATE_FILE} has multiple decks and no activeDeck. Use /revela edit <target>.`)
59
+ }
60
+
35
61
  function resolvePathTarget(workspaceRoot: string, requested: string): EditableDeck {
36
62
  if (isAbsoluteLike(requested)) {
37
63
  throw new Error("/revela edit only accepts workspace-relative decks/*.html paths.")
package/lib/qa/checks.ts CHANGED
@@ -618,7 +618,7 @@ function formatComplianceReport(report: QAReport): string {
618
618
  `## Static Design Compliance Report`,
619
619
  ``,
620
620
  `**File:** \`${report.file}\``,
621
- `**Result:** WARNINGS — ${report.summary}`,
621
+ `**Result:** FAILED — ${report.summary}`,
622
622
  ``,
623
623
  ]
624
624
 
@@ -634,7 +634,8 @@ function formatComplianceReport(report: QAReport): string {
634
634
  lines.push(
635
635
  `### Action Required`,
636
636
  ``,
637
- `Please fix the design vocabulary warnings above before continuing. These are static class-name checks, not layout QA failures.`,
637
+ `You must fix the design vocabulary errors above before continuing. These are static class-name checks, not layout QA failures.`,
638
+ `Do not leave unknown classes or custom class selectors in deck HTML.`,
638
639
  `- For **unknown HTML classes**, remove ad-hoc/test classes or replace them with classes from the active design's Layout Index or Component Index.`,
639
640
  `- For **novel CSS rules**, remove custom class selectors from \`<style>\`; use existing design components, or inline \`style=""\` for minor one-off positioning/sizing tweaks.`,
640
641
  `- If you need the correct class names, call \`revela-designs\` to read the relevant layout/component details.`,
@@ -652,7 +653,8 @@ function formatComplianceIssue(issue: LayoutIssue): string {
652
653
  const classAttr = typeof data.classAttr === "string" ? data.classAttr : ""
653
654
  const tag = typeof data.tag === "string" ? data.tag : ""
654
655
  const label = issue.sub ? `compliance/${issue.sub}` : "compliance"
655
- const lines = [`- 🟡 **${label}**: \`${cls}\``]
656
+ const icon = issue.severity === "error" ? "🔴" : "🟡"
657
+ const lines = [`- ${icon} **${label}**: \`${cls}\``]
656
658
 
657
659
  lines.push(` - Location: ${location}${line ? `, line ${line}` : ""}`)
658
660
  if (tag || classAttr) {
@@ -157,7 +157,7 @@ export function runComplianceQA(htmlFilePath: string, vocabulary?: DesignClassVo
157
157
  issues.push({
158
158
  type: "compliance",
159
159
  sub: "unknown_class",
160
- severity: "warning",
160
+ severity: "error",
161
161
  detail: `HTML uses CSS class \`${use.className}\` which is not defined in the active design. Replace it with a class from the Component Index or Layout Index.`,
162
162
  data: {
163
163
  class: use.className,
@@ -187,7 +187,7 @@ export function runComplianceQA(htmlFilePath: string, vocabulary?: DesignClassVo
187
187
  first.issues.push({
188
188
  type: "compliance",
189
189
  sub: "novel_css_rule",
190
- severity: "warning",
190
+ severity: "error",
191
191
  detail: `<style> defines CSS class \`.${use.className}\` which is not part of the active design. Remove this custom rule and use the design's existing component styles. For minor adjustments, use inline \`style=""\` instead.`,
192
192
  data: {
193
193
  class: use.className,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyber-dash-tech/revela",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "description": "OpenCode plugin that turns AI into an HTML slide deck generator",
5
5
  "type": "module",
6
6
  "main": "./index.ts",