_ _ _ _ _ _ _
__ _(_) ___| | _____ __| | (_)_ __ | |_ ___ _ __ __ _ ___| |_(_)_ _____
\ \ /\ / / |/ __| |/ / _ \/ _` |_____| | '_ \| __/ _ \ '__/ _` |/ __| __| \ \ / / _ \
\ V V /| | (__| < __/ (_| |_____| | | | | || __/ | | (_| | (__| |_| |\ V / __/
\_/\_/ |_|\___|_|\_\___|\__,_| |_|_| |_|\__\___|_| \__,_|\___|\__|_| \_/ \___|
The wicked family's document engine. One local service owns document storage with write-once version lineage and forking, renders and exports HTML / PDF / native PowerPoint / video, records captioned demo walkthroughs (on-screen captions and title cards, no voice-over), and learns themes from your existing brand pages. wicked-crew spawns it as a local bridge and reverse-proxies its API; wicked-studio is where you point, edit, rewind, fork, and export. You depend on it — you don't visit it.
What lives here
The builder UI moved to wicked-studio (see Moving? below). The engine did not move — this repo is its sole implementation:
- 📦 Documents & lineage — every change is a write-once saved version; rewind to any of them, or fork a version and chase two ideas at once without losing either.
- 📤 Exports — single-file HTML with the document's local assets embedded, PDF, native editable PowerPoint (
src/service/pptx.js, built in Node: one slide per slide with its title, text and speaker notes, in the version's theme), and video. The recipient needs no wicked install, but remote fonts, scripts, stylesheets and images stay links to the network unless you export in strict offline mode — every export tells you which ones (see Exports).
- 🎬 Demo recording — captioned walkthroughs of a live app (on-screen captions, no voice-over) with chapter thumbnails (
src/service/demo.js): mp4, poster, GIF.
- 🎨 Theme learning — an SSRF-hardened theme-grab over pages you already ship, plus the learned-theme readback (
GET /d/:docId/api/theme/learned, v0.8.1) that studio's brand tooling polls, and its write side (PUT/DELETE on the same path): every token is checked against a per-field grammar before it can reach the CSS. A re-theme (apply: true) is recorded only when it changes how the version renders (a sealed, sandboxed headless-Chromium pixel comparison): a document whose own CSS fixes every colour and font (drafted before the var(--wi-…) theme tokens) is refused with reason: "no_visible_change", never recorded as a restyle.
- 🔌 One HTTP API + one bus vocabulary — the
/api/* surface and the wicked.interactive.* event types (ADR-0019) that the studio UI and supervising agents both speak.
The loop in the demo — describe, point, fix, rewind — is powered by this engine; the surface you drive it from is wicked-studio.
How it runs
You normally never start this service yourself:
- Through crew — the supported path.
npx wicked-crew serve (studio's UI is bundled) spawns this package from npm as a local bridge (wicked-interactive@^0.15.0 — crew's INTERACTIVE_DEFAULT_RANGE, overridable with WICKED_INTERACTIVE_SPEC; one bridge per project docs root) and reverse-proxies its entire HTTP surface at /api/v1/projects/:projectId/interactive/* on crew's own origin — pure transport, SSE streamed unbuffered both ways. The studio client only ever talks to crew.
- Directly, as an API.
npx wicked-interactive serve --root ~/wicked-interactive/docs runs the API-only service on a dynamic port (ADR-0022/0025). GET / redirects to the recorded studio origin; there is no bundled UI on the supported path.
- The dev escape hatch.
wicked-interactive serve --standalone (or WI_STANDALONE=1) serves the retired SPA shell for local development of the engine itself — not the supported UI.
Recording demos needs a browser that npm install does not provide. The recorder drives Playwright's bundled headless Chromium (+ ffmpeg for video); on a fresh machine it is provisioned automatically on the first recording (a one-time ~100 MB download, progress on the document thread; opt out with WI_RECORDER_AUTO_INSTALL=0). To check or provision it yourself: npx wicked-interactive doctor (exit 1 while it cannot record) / npx wicked-interactive doctor --install. A recording that cannot run answers with a typed error (recorder_browser_missing, recording_step_failed, …) carrying the one-line remedy — it is never retried into a dead letter (ADR-0028).