@cyber-dash-tech/revela 0.17.4 → 0.17.5

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.
@@ -481,6 +481,8 @@ These rules are mandatory for Monet.
481
481
  - **No glass cards, neon KPI styling, or startup-product chrome.** Monet is editorial and print-adjacent.
482
482
  - **Visual hierarchy is strict:** eyebrow -> heading -> body -> caption.
483
483
  - **Icon system is Lucide.** For ordinary UI, semantic, status, category, process, and navigation icons, use Lucide (`data-lucide`). Do not hand-write inline SVG for icons. SVG is allowed only for intentional decorative motifs, illustrations, or design-specific artwork. If any `data-lucide` icon is present, load Lucide via CDN and call `lucide.createIcons()` after `SlidePresentation`.
484
+ - **Chart system is ECharts.** Data charts default to ECharts inside `echart-panel`. Do not use hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts as data-chart substitutes. SVG remains acceptable for decorative motifs, diagrams, or illustrations, not data charts. Before creating or changing a chart, fetch the `echart-panel` component and `section: "chart-rules"`; if chart rules or runtime are unavailable, report the gap instead of inventing a fake chart fallback.
485
+ - **Start from foundation.** New deck HTML starts from `@design:foundation`. Do not recreate foundation CSS, JavaScript, or the HTML skeleton from memory. Prefer a foundation helper when available; otherwise fetch `section: "foundation"` before writing a new deck shell. Existing deck edits preserve the current foundation unless the user asks for foundation repair or QA reports a foundation contract problem.
484
486
 
485
487
  ### Common Mistakes
486
488
 
@@ -2805,3 +2807,30 @@ Rules:
2805
2807
  <!-- @component:roadmap-vertical:end -->
2806
2808
 
2807
2809
  <!-- @design:components:end -->
2810
+
2811
+ <!-- @design:chart-rules:start -->
2812
+
2813
+ ### Data Visualization (ECharts)
2814
+
2815
+ - Chart system is ECharts. Data charts should use `echarts.init()` with an `echart-panel` container, not hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts.
2816
+ - Monet charts should feel calm and art-book-like: soft contrast, restrained labels, limited series count, and no dashboard chrome, glow, or excessive gridlines.
2817
+ - Use `--accent-earth`, `--accent-olive`, `--accent-stone`, and `--accent-sage` for primary/supporting series. Use `--accent-danger` only for negative indicators. Derive colors from CSS variables with `getComputedStyle(document.documentElement)` instead of hard-coding unrelated palettes.
2818
+ - Keep chart containers inside `echart-panel` so QA can measure stable geometry. `.echart-container` must have stable sizing through explicit width/height or flex sizing with `min-height: 0`.
2819
+ - Give every chart a unique id. Initialise with `echarts.init()` after `SlidePresentation` is instantiated, and call `chart.resize()` on window resize.
2820
+ - Set `backgroundColor: "transparent"` in chart options. Set text, axis, legend, grid, and tooltip colors explicitly; ECharts canvas text does not inherit CSS reliably.
2821
+ - Always include a short chart caption or source note when data is shown.
2822
+ - Do not use fake chart fallback when ECharts runtime or chart rules are missing. Report the missing runtime/rules or use an approved local/runtime dependency.
2823
+
2824
+ Recommended ECharts defaults:
2825
+
2826
+ ```javascript
2827
+ const styles = getComputedStyle(document.documentElement);
2828
+ const chartText = styles.getPropertyValue('--text-secondary').trim();
2829
+ const chartMuted = styles.getPropertyValue('--text-muted').trim();
2830
+ const chartLine = styles.getPropertyValue('--line').trim();
2831
+ const primary = styles.getPropertyValue('--accent-earth').trim();
2832
+ const secondary = styles.getPropertyValue('--accent-olive').trim();
2833
+ const soft = styles.getPropertyValue('--accent-sage').trim();
2834
+ ```
2835
+
2836
+ <!-- @design:chart-rules:end -->
@@ -234,6 +234,8 @@ new SlidePresentation();
234
234
  - **Reusable class vocabulary.** New classes must be documented in this DESIGN.md. Avoid many one-off selectors in generated decks.
235
235
  - **SVG is exceptional.** Use decorative SVG only when the user explicitly asks for an illustration/icon-like visual or when design authoring requires a motif.
236
236
  - **Icon system is Lucide.** For ordinary UI, semantic, status, category, process, and navigation icons, use Lucide (`data-lucide`). Do not hand-write inline SVG for icons. SVG is allowed only for intentional decorative motifs, illustrations, or design-specific artwork. If any `data-lucide` icon is present, load Lucide via CDN and call `lucide.createIcons()` after `SlidePresentation`.
237
+ - **Chart system is ECharts.** Data charts default to ECharts inside `echart-panel`. Do not use hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts as data-chart substitutes. SVG remains acceptable for decorative motifs, diagrams, or illustrations, not data charts. Before creating or changing a chart, fetch the `echart-panel` component and `section: "chart-rules"`; if chart rules or runtime are unavailable, report the gap instead of inventing a fake chart fallback.
238
+ - **Start from foundation.** New deck HTML starts from `@design:foundation`. Do not recreate foundation CSS, JavaScript, or the HTML skeleton from memory. Prefer a foundation helper when available; otherwise fetch `section: "foundation"` before writing a new deck shell. Existing deck edits preserve the current foundation unless the user asks for foundation repair or QA reports a foundation contract problem.
237
239
  - **Images for photographic references.** Use image treatment rules rather than fake SVG when the reference is photographic, UI, webpage, or product imagery.
238
240
  - **Content pages need a stable title block.** Except cover, TOC, closing, section divider, and full-bleed hero slides, every normal content slide should include a visible title block from the upper-left safe area. It should contain a compact chapter/section label plus a slide title written as the page's claim or takeaway.
239
241
  - **Do not hide the page title inside a card.** Body components may have their own headings, but the slide-level title block should remain separate and easy to scan unless the chosen layout explicitly defines a compact side-title variant.
@@ -881,11 +883,14 @@ Rules:
881
883
 
882
884
  ### Data Visualization (ECharts)
883
885
 
884
- - Use neutral chart styling by default: clean axes, limited series count, and restrained labels.
885
- - Use `--accent-primary` for the main series and `--accent-secondary` for supporting series.
886
- - Avoid dashboard chrome, glowing charts, and excessive gridlines.
886
+ - Chart system is ECharts. Data charts should use `echarts.init()` with an `echart-panel` container, not hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts.
887
+ - Use neutral chart styling by default: clean axes, limited series count, restrained labels, and transparent backgrounds.
888
+ - Use `--accent-primary` for the main series and `--accent-secondary` for supporting series. Derive colors from CSS variables with `getComputedStyle(document.documentElement)` instead of hard-coding unrelated palettes.
889
+ - Keep chart containers inside `echart-panel` so QA can measure stable geometry. `.echart-container` must have stable sizing through explicit width/height or flex sizing with `min-height: 0`.
890
+ - Give every chart a unique id. Initialise with `echarts.init()` after `SlidePresentation` is instantiated, and call `chart.resize()` on window resize.
891
+ - Set `backgroundColor: "transparent"` in chart options. Set text, axis, legend, grid, and tooltip colors explicitly; ECharts canvas text does not inherit CSS reliably.
887
892
  - Always include a short chart caption or source note when data is shown.
888
- - Keep chart containers inside `echart-panel` so QA can measure stable geometry.
893
+ - Do not use fake chart fallback when ECharts runtime or chart rules are missing. Report the missing runtime/rules or use an approved local/runtime dependency.
889
894
 
890
895
  Recommended ECharts defaults:
891
896
 
@@ -444,6 +444,8 @@ These rules are mandatory for Summit.
444
444
  - **Titles are Title Case.** Do not set `text-transform:uppercase` on `h1`, `h2`, `h3`, or `h4` titles. Uppercase is reserved for eyebrows, captions, metadata labels, short codes, and date/code-like markers.
445
445
  - **Components are transparent by default.** Component primitives should not bring their own paper/background fill. Let `.page`, layout containers, or explicit modifier variants provide background color when needed.
446
446
  - **Icon system is Lucide.** For ordinary UI, semantic, status, category, process, and navigation icons, use Lucide (`data-lucide`). Do not hand-write inline SVG for icons. SVG is allowed only for intentional decorative motifs, illustrations, or design-specific artwork. If any `data-lucide` icon is present, load Lucide via CDN and call `lucide.createIcons()` after `SlidePresentation`.
447
+ - **Chart system is ECharts.** Data charts default to ECharts inside `echart-panel`. Do not use hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts as data-chart substitutes. SVG remains acceptable for decorative motifs, diagrams, or illustrations, not data charts. Before creating or changing a chart, fetch the `echart-panel` component and `section: "chart-rules"`; if chart rules or runtime are unavailable, report the gap instead of inventing a fake chart fallback.
448
+ - **Start from foundation.** New deck HTML starts from `@design:foundation`. Do not recreate foundation CSS, JavaScript, or the HTML skeleton from memory. Prefer a foundation helper when available; otherwise fetch `section: "foundation"` before writing a new deck shell. Existing deck edits preserve the current foundation unless the user asks for foundation repair or QA reports a foundation contract problem.
447
449
 
448
450
  ### Common Mistakes
449
451
 
@@ -2608,3 +2610,30 @@ Rules:
2608
2610
  <!-- @component:roadmap-vertical:end -->
2609
2611
 
2610
2612
  <!-- @design:components:end -->
2613
+
2614
+ <!-- @design:chart-rules:start -->
2615
+
2616
+ ### Data Visualization (ECharts)
2617
+
2618
+ - Chart system is ECharts. Data charts should use `echarts.init()` with an `echart-panel` container, not hand-written SVG, div/CSS shapes, canvas mocks, or static faux charts.
2619
+ - Summit charts should feel editorial and report-like: calm typography, limited series count, restrained labels, and no dashboard chrome, glow, or excessive gridlines.
2620
+ - Use `--accent-earth`, `--accent-olive`, and `--accent-gold` for primary/supporting series. Use `--accent-danger` only for negative indicators. Derive colors from CSS variables with `getComputedStyle(document.documentElement)` instead of hard-coding unrelated palettes.
2621
+ - Keep chart containers inside `echart-panel` so QA can measure stable geometry. `.echart-container` must have stable sizing through explicit width/height or flex sizing with `min-height: 0`.
2622
+ - Give every chart a unique id. Initialise with `echarts.init()` after `SlidePresentation` is instantiated, and call `chart.resize()` on window resize.
2623
+ - Set `backgroundColor: "transparent"` in chart options. Set text, axis, legend, grid, and tooltip colors explicitly; ECharts canvas text does not inherit CSS reliably.
2624
+ - Always include a short chart caption or source note when data is shown.
2625
+ - Do not use fake chart fallback when ECharts runtime or chart rules are missing. Report the missing runtime/rules or use an approved local/runtime dependency.
2626
+
2627
+ Recommended ECharts defaults:
2628
+
2629
+ ```javascript
2630
+ const styles = getComputedStyle(document.documentElement);
2631
+ const chartText = styles.getPropertyValue('--text-secondary').trim();
2632
+ const chartMuted = styles.getPropertyValue('--text-muted').trim();
2633
+ const chartLine = styles.getPropertyValue('--line').trim();
2634
+ const primary = styles.getPropertyValue('--accent-earth').trim();
2635
+ const secondary = styles.getPropertyValue('--accent-olive').trim();
2636
+ const highlight = styles.getPropertyValue('--accent-gold').trim();
2637
+ ```
2638
+
2639
+ <!-- @design:chart-rules:end -->
@@ -79,6 +79,9 @@ Instructions:
79
79
  - Pure artifact polish such as layout, spacing, typography, alignment, color, image crop, animation, export fidelity, runtime JavaScript fixes, or deck HTML contract fixes may remain an artifact-level edit.
80
80
  - If the request mixes content meaning and visual polish, treat it as narrative-impacting unless the user clarifies otherwise.
81
81
  - Preserve the existing deck structure, active design language, typography, spacing system, animations, and slide count unless the comment explicitly asks otherwise.
82
+ - Before patching ${"`decks/*.html`"}, call ${"`revela-designs`"} with ${"`action: \"read\"`"} and ${"`section: \"rules\"`"} to fetch the active design rules for this edit pass.
83
+ - If the edit changes layout, component structure, typography scale, visual hierarchy, chart usage, icon usage, media treatment, or design-system classes, fetch the relevant ${"`revela-designs`"} layout/component details before editing. Fetch ${"`section: \"chart-rules\"`"} before changing or adding ECharts.
84
+ - Follow the fetched design rules and vocabulary exactly. Do not invent layout classes, component names, CSS variables, icon systems, or visual effects from model memory or the existing deck alone.
82
85
  - If an asset/drop payload is present, this is an asset placement request. Use only the saved local asset path from the asset payload in deck HTML. Prefer asset.deckPath when present because it is relative to the target HTML file; otherwise use asset.path.
83
86
  - Do not write remote imageUrl, thumbnailUrl, source page URLs, or ${"`/__revela_asset`"} proxy URLs into deck HTML.
84
87
  - Logo assets should remain small, clear, and brand-like; do not use logos as decorative backgrounds.
@@ -2,6 +2,8 @@ import { randomBytes } from "crypto"
2
2
  import { existsSync, readFileSync, statSync } from "fs"
3
3
  import { fileURLToPath } from "url"
4
4
  import { dirname, extname, isAbsolute, resolve, sep } from "path"
5
+ import { ctx } from "../ctx"
6
+ import { buildPrompt } from "../prompt-builder"
5
7
  import type { EditableDeck } from "./resolve-deck"
6
8
  import { buildEditPrompt, type EditCommentPayload } from "./prompt"
7
9
 
@@ -405,6 +407,9 @@ async function handleComment(req: Request, session: EditSession): Promise<Respon
405
407
  const elements = Array.isArray(body.elements) ? body.elements : []
406
408
  if (!comment && comments.length === 0) return jsonResponse({ ok: false, error: "Comment is required" }, 400)
407
409
 
410
+ ctx.enabled = true
411
+ buildPrompt({ mode: "deck-render" })
412
+
408
413
  const prompt = buildEditPrompt({
409
414
  ...body,
410
415
  deck: session.deck,
@@ -2,8 +2,10 @@ import { randomBytes } from "crypto"
2
2
  import { existsSync, readFileSync, statSync } from "fs"
3
3
  import { fileURLToPath } from "url"
4
4
  import { dirname, extname, isAbsolute, relative, resolve, sep } from "path"
5
+ import { ctx } from "../ctx"
5
6
  import type { EditableDeck } from "../edit/resolve-deck"
6
7
  import { buildEditPrompt, type EditCommentPayload } from "../edit/prompt"
8
+ import { buildPrompt } from "../prompt-builder"
7
9
  import type { InspectionElementSnapshot } from "../inspection-context/match"
8
10
  import { buildInspectionPrompt } from "../inspect/prompt"
9
11
  import { projectWorkspaceElement } from "../inspect/request"
@@ -715,6 +717,9 @@ async function handleComment(req: Request, session: EditSession): Promise<Respon
715
717
  const elements = Array.isArray(body.elements) ? body.elements : []
716
718
  if (!comment && comments.length === 0) return jsonResponse({ ok: false, error: "Comment is required" }, 400)
717
719
 
720
+ ctx.enabled = true
721
+ buildPrompt({ mode: "deck-render" })
722
+
718
723
  const prompt = buildEditPrompt({
719
724
  ...body,
720
725
  deck: session.deck,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyber-dash-tech/revela",
3
- "version": "0.17.4",
3
+ "version": "0.17.5",
4
4
  "description": "OpenCode plugin for trusted narrative artifacts from local sources, research, and evidence",
5
5
  "type": "module",
6
6
  "main": "./index.ts",