Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

docs: drop the removed rrweb pipeline and document video export

Luis Ortizc9721e4d4e74
diff --git a/AGENTS.md b/AGENTS.md
index 11f354b..264bf88 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -38,17 +38,16 @@ src/
β”‚ β”‚ β”‚ β”œβ”€β”€ highlight.ts # HighlightManager (dashed border overlay)
β”‚ β”‚ β”‚ └── input-session.ts # InputSession (typing lifecycle)
β”‚ β”‚ β”œβ”€β”€ machine.ts # xstate capture state machine
-β”‚ β”‚ β”œβ”€β”€ rrweb-recorder.ts # DOM recording for replay
β”‚ β”‚ β”œβ”€β”€ session.ts # CaptureSession (lifecycle manager)
β”‚ β”‚ β”œβ”€β”€ spa-nav.ts # SPA navigation tracking
β”‚ β”‚ β”œβ”€β”€ start-notification.ts # Recording notification overlay
β”‚ β”‚ └── step-description.ts # Fallback rule-based descriptions
β”‚ β”œβ”€β”€ blur/ # Smart blur: regex presets, DOM scanner, element picker, panel UI
-β”‚ β”œβ”€β”€ export/ # HTML, PDF, Markdown export generators + shared utils
+β”‚ β”œβ”€β”€ export/ # HTML, PDF, DOCX, Markdown, video generators + shared utils
β”‚ └── guides/ # Data layer: types, Dexie DB, CRUD service
β”œβ”€β”€ entrypoints/ # Chrome extension entry points (WXT)
β”‚ β”œβ”€β”€ background/ # Service worker: state machine, message handlers, tab management
-β”‚ β”œβ”€β”€ content.ts # Content script: CaptureSession, event listeners, rrweb
+β”‚ β”œβ”€β”€ content.ts # Content script: CaptureSession, event listeners
β”‚ β”œβ”€β”€ sidepanel/ # Side panel React mount
β”‚ β”œβ”€β”€ fullview/ # Full-page view React mount
β”‚ β”œβ”€β”€ onboarding/ # Onboarding wizard (opens on first install)
@@ -95,7 +94,7 @@ src/
|-------|------|---------|
| Capture lifecycle | xstate | State machine (IDLE ↔ RECORDING) in background service worker |
| Fullview UI | Zustand | Search modal, guide counts, active guide data |
-| Persistence | Dexie (IndexedDB) | Guides, steps, screenshots, rrweb chunks |
+| Persistence | Dexie (IndexedDB) | Guides, steps, screenshots, snapshots |
| Service worker recovery | sessionStorage | xstate machine snapshot persistence |
| Background β†’ Sidepanel | Port messaging | Real-time state broadcast |
| Cross-context sync | BroadcastChannel | Guide mutations (star, delete) across sidepanel/fullview |
@@ -105,7 +104,7 @@ src/
| Entry Point | File | Purpose |
|-------------|------|---------|
| Background | `entrypoints/background/` | Service worker: xstate actor, message handlers, tab management |
-| Content Script | `entrypoints/content.ts` | Injected into all tabs: CaptureSession, event listeners, rrweb |
+| Content Script | `entrypoints/content.ts` | Injected into all tabs: CaptureSession, event listeners |
| Side Panel | `entrypoints/sidepanel/` | Recording controls, library, guide editor, settings |
| Full View | `entrypoints/fullview/` | Dashboard: library browse, guide viewer, Ctrl+K search |
| Onboarding | `entrypoints/onboarding/` | First-install wizard: AI setup, smart blur, pin extension |
@@ -124,7 +123,6 @@ Content Script ←→ Background Service Worker ←→ Sidepanel / Fullview
- `captureStep({guideId, action, elementMeta, domContext})` β†’ screenshots + creates step
- `updateInputStep({stepId, description})` β†’ updates typing step description
- `finalizeInputStep({stepId, elementMeta, domContext})` β†’ final screenshot + AI description
-- `rrwebChunk({guideId, events, timestamp})` β†’ stores DOM recording chunk
**Tab messages** (content script ↔ background, `lib/tab-messages.ts`):
- `PING` / `START_CAPTURE` / `STOP_CAPTURE` β€” lifecycle
@@ -138,7 +136,7 @@ Content Script ←→ Background Service Worker ←→ Sidepanel / Fullview
1. User clicks "Start Capture" in sidepanel
2. Background transitions xstate machine IDLE β†’ RECORDING
3. Creates Guide in IndexedDB, broadcasts `START_CAPTURE` to all tabs
-4. Content scripts create CaptureSession β†’ CaptureController (event listeners) + rrweb
+4. Content scripts create CaptureSession β†’ CaptureController (event listeners)
5. Shows recording notification overlay on active tab
**Capture a click:**
@@ -158,7 +156,7 @@ Content Script ←→ Background Service Worker ←→ Sidepanel / Fullview
**Stop recording:**
1. Background transitions RECORDING β†’ IDLE
-2. Broadcasts `STOP_CAPTURE`, content scripts flush pending input sessions + rrweb events
+2. Broadcasts `STOP_CAPTURE`, content scripts flush pending input sessions
3. Background generates guide title from step descriptions + URLs via AI
4. Opens fullview dashboard with the guide
@@ -187,6 +185,14 @@ Extraction walks up from the target element to find:
| HTML | `core/export/html-export.ts` | Self-contained, base64 images, inline CSS |
| PDF | `core/export/pdf-export.ts` | jsPDF, A4 portrait, auto page breaks |
| Markdown | `core/export/markdown-export.ts` | Standard MD with base64 image data URLs |
+| DOCX | `core/export/docx-export.ts` | Lazy-imported, Word-compatible |
+| Video | `core/export/video-export.ts` | WebCodecs via mediabunny (lazy), mp4/H.264 with WebM/VP9 fallback |
+
+Video frames reuse `renderScreenshot`, so the auto-crop, click-target outline, annotations and
+redactions are already baked in. Each step holds 1.5s wide, eases into a crop around the target
+over 0.73s, holds 3s close, and consecutive steps cross-dissolve over 0.33s at 30fps. Capability
+probing lives in `video-support.ts`, which must stay free of mediabunny imports because both
+export UIs load it eagerly.
## Tech Stack
@@ -201,8 +207,7 @@ Extraction walks up from the target element to find:
| State (UI) | Zustand |
| Storage | Dexie.js (IndexedDB) |
| Messaging | webext-core |
-| Session recording | rrweb |
-| Export | jsPDF, client-side HTML/Markdown |
+| Export | jsPDF, docx, mediabunny (WebCodecs video), client-side HTML/Markdown |
| AI (optional) | Vercel AI SDK (`ai`, `@ai-sdk/openai`, `@ai-sdk/anthropic`) |
| Event queue | p-queue (concurrency: 1) |
| Icons | Lucide React |