Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
docs: the cursor pipeline and its diagnostics
Etienne Lescote9d4278f9e25
diff --git a/technical-documentation/architecture/cursor.md b/technical-documentation/architecture/cursor.mdindex cf64ad705..7b9d96737 100644--- a/technical-documentation/architecture/cursor.md+++ b/technical-documentation/architecture/cursor.md@@ -1,124 +1,38 @@-# Cursor feature — exhaustive inventory+# Cursor pipeline-Port of the legacy (`main`) cursor pipeline into the AI-edition editor shell-(`port/cursor-from-main`). Reference: `docs/architecture/openscreen-inventory.md`-§ Cursor; rendered pipeline at `src/components/ai-edition/CursorPreviewLayer.tsx`.+The cursor feature records system-cursor position and, where the native provider is available, cursor assets separately from the screen video, then re-renders the cursor as a themed, smoothed overlay instead of baking it into the capture. Its shared rendering and asset code lives in `src/lib/cursor/`; native capture and IPC adapters live under `electron/native/` and `electron/native-bridge/cursor/`; the editor overlay is `src/components/ai-edition/CursorPreviewLayer.tsx`.-## 1. Capture (native side)+## Capture-| Surface | Platform | What it does |-| --- | --- | --- |-| `electron/native/screencapturekit/Sources/OpenScreenMacOSCursorHelper/main.swift` | macOS | ScreenCaptureKit cursor helper — streams cursor bitmaps + interaction events alongside the screen capture. |-| `electron/native/wgc-capture/src/cursor-sampler.cpp` | Windows | WGC cursor sampler — captures the system cursor bitmap, hotspot, and type from a desktop duplication session. |-| `electron/native-bridge/cursor/recording/macNativeCursorRecordingSession.ts` | macOS | Wraps the SCK helper for the main process. |-| `electron/native-bridge/cursor/recording/windowsNativeRecordingSession.ts` + `.types.ts` | Windows | Wraps the WGC sampler; types describe cursor samples + assets. |-| `electron/native-bridge/cursor/recording/telemetryRecordingSession.ts` | All | Fallback: cursor samples come from the recorder's telemetry stream (no bitmap). |-| `electron/native-bridge/cursor/recording/session.ts` | All | Common session interface (start / stop / on-sample). |-| `electron/native-bridge/cursor/recording/factory.ts` | All | Picks the right session for the OS / source. |-| `electron/native-bridge/cursor/adapter.ts` | All | Adapter from native session to the `CursorRecordingData` shape used by the renderer. |-| `electron/native-bridge/cursor/telemetryCursorAdapter.ts` | All | Telemetry-only adapter. |-| `electron/native-bridge/services/cursorService.ts` | All | IPC entry point; exposes `cursor.getRecordingData` and `cursor.getTelemetry` to the renderer. |+Native capture keeps cursor data separate from the video frame. On Windows, the WGC cursor sampler in `electron/native/wgc-capture/src/cursor-sampler.cpp` samples the system cursor during desktop duplication and records its position, hotspot, bitmap, and cursor type. On macOS, the ScreenCaptureKit cursor helper at `electron/native/screencapturekit/Sources/OpenScreenMacOSCursorHelper/main.swift` samples the current system cursor, emits unique bitmap assets, and records cursor samples plus left-button interaction events. The recording sessions under `electron/native-bridge/cursor/recording/` select and wrap the platform provider; `telemetryCursorAdapter.ts` provides the position-only fallback when native assets are unavailable. The resulting contracts are `CursorRecordingData` and `CursorRecordingSample` in `src/native/contracts.ts`.-Contracts (`src/native/contracts.ts`): `CursorRecordingData`, `CursorRecordingSample`, `NativeCursorAsset`, `NativeCursorType`.+## Telemetry-Supported native cursor types: `arrow`, `text`, `pointer`, `crosshair`, `open-hand`, `closed-hand`, `resize-ew`, `resize-ns`, `resize-nesw`, `resize-nwse`, `move`, `not-allowed`, `wait`, `app-starting`, `help`, `up-arrow`. The renderer also has a "telemetry-only" provider (`"none"`) for legacy recordings.+Position telemetry is represented by `CursorTelemetryPoint` in `src/lib/cursorTelemetryBuffer.ts`. Each point contains `timeMs`, the offset from recording start, and `cx`/`cy`, clamped ratios of the captured surface (`cursorTelemetryBuffer.ts:1-10`). The main-process `CursorTelemetryBuffer` starts a session with a recording id, appends samples, and finalizes them into FIFO batches keyed by that id (`cursorTelemetryBuffer.ts:25-34`). This key keeps asynchronous persistence and discard operations associated with the correct recording. Native cursor samples use the same recording-time convention, and `poc-d3d/src/cursor.rs:100-123` loads a selected window by subtracting its offset so the first sample is at time zero.-## 2. Renderer hooks+## Rendering-| File | Role |-| --- | --- |-| `src/native/hooks/useCursorRecordingData.ts` | Loads `CursorRecordingData` for a given video path via the native bridge. Returns `{ data, loading, error }`. |-| `src/native/hooks/useCursorTelemetry.ts` | Loads the `CursorTelemetryPoint[]` stream. |-| `src/lib/cursorTelemetryBuffer.ts` | Buffers telemetry during playback (rate-decoupled from rAF). |-| `scripts/inspect-native-cursor-click-bounce.mjs` | Diagnostic for the click-bounce animation (loads a recording and prints frame state). |-| `scripts/test-windows-native-cursor.mjs` | Smoke test for the WGC cursor sampler on a real Windows machine. |-| `docs/testing/macos-native-cursor.md` / `windows-native-cursor.md` | Manual test recipes. |+`CursorPreviewLayer` is mounted above the video and loads both native recording data and telemetry through `useCursorRecordingData` and `useCursorTelemetry` (`src/components/ai-edition/CursorPreviewLayer.tsx:42-50`). Its animation loop updates the Pixi telemetry overlay and the native-cursor DOM image from the current playback time (`CursorPreviewLayer.tsx:187-255`). The shared cursor library supplies path smoothing, native asset selection, click bounce, and directional motion blur. The native compositor in `poc-d3d/src/cursor.rs` interpolates raw samples, applies the same 240 Hz spring-style smoothing, and computes click-bounce timing (`cursor.rs:126-196`). Preview and export therefore consume the same telemetry and cursor rules rather than maintaining independent cursor tracks.-## 3. Cursor core library (`src/lib/cursor/`)+```mermaid+flowchart LR+ C["Native capture<br/>position, type, clicks, assets"] --> T["Telemetry and<br/>recording sidecars"]+ T --> P["Preview overlay<br/>Pixi + native image"]+ T --> E["Native compositor<br/>export"]+```-| File | Role |-| --- | --- |-| `cursorPathSmoothing.ts` + test | Offline spring-damper smoothing. Resamples the raw cursor path to a 240Hz grid, runs a spring over each visible run, and serves positions by lookup. Deterministic, so preview and export match. Memoized per (recordingData, strength) via a `WeakMap`. |-| `nativeCursor.ts` + test | Pretty-cursor mapping, native bitmaps, click-bounce progress, motion-blur px. Owns the `PRETTY_NATIVE_CURSOR_ASSETS` table that maps `NativeCursorType` → SVG / hotspot, the themed override resolver (`resolveNativeCursorRenderAsset`), and the `classifyCapturedCursorType` heuristic (macOS doesn't tag samples with a cursor type — we infer arrow / pointer from the hotspot). |-| `cursorThemes.ts` | Theme registry: 17 Sweezy-cursors packs (arrow + pointer PNGs) + the built-in "default" sentinel id. Helpers: `DEFAULT_CURSOR_THEME_ID`, `CURSOR_THEME_IDS`, `getCursorTheme`, `normalizeCursorThemeId`. |-| `uploadedCursorAssets.ts` | Bitmaps for the seven supported cursor types. Trim rects are pulled from the 1024px sample sheet. |-| `pixiCursorRenderer.ts` (renamed from `video-editor/videoPlayback/cursorRenderer.ts`) | The `PixiCursorOverlay` class: builds the Pixi stage for telemetry-driven cursor rendering, applies the SVG drop shadow, runs a 240Hz spring on the cursor position, animates a click ring, and adds a directional motion-blur filter. Owns `DEFAULT_CURSOR_CONFIG` (dotRadius 28, smoothing 0.18, motionBlur 0, clickBounce 1). |+## Settings-## 4. Preview layer (`src/components/ai-edition/`)+The cursor settings pane is `CursorPane` in `src/components/ai-edition/RightPanes.tsx`; the current v4 inspector exposes it through the cursor facet in `src/components/ai-edition/v4/FloatingInspector.tsx:57-63,1073`. It controls showing the cursor, clipping it to the canvas, theme, size, smoothing, motion blur, and click bounce. `RightPanes.tsx:1592-1692` binds those controls to editor settings and forwards the rendering parameters to the native compositor. The shared preview reads the same values from `useEditorSettings` (`CursorPreviewLayer.tsx:47,192-202`), so live changes affect both rendering paths.-| File | Role |-| --- | --- |-| `CursorPreviewLayer.tsx` + test | Shared overlay rendered above the `<video>` in the editor. Two render paths: Pixi (telemetry) and a DOM `<img>` (native bitmap). Reads `useCursorRecordingData` + `useCursorTelemetry`, and applies the editor settings (size, smoothing, motion blur, click bounce, theme, clip-to-bounds, show). |-| `CursorPreviewLayer.module.css` | Layer + native-cursor DOM styles. |-| `VirtualPreview.tsx` (line 292) | Mounts `<CursorPreviewLayer>` inside the live preview. |+## Auto-follow-## 5. Right-panel pane (UI)+Cursor telemetry also drives camera focus for auto-follow zooms. `src/components/video-editor/videoPlayback/cursorFollowUtils.ts` interpolates the cursor at content time and applies distance-adaptive, frame-rate-independent smoothing. The zoom-region utilities use that focus for preview, while the export frame renderer uses the corresponding focus during export. The native compositor keeps a raw track for cursor placement and derives a separately smoothed follow track (`poc-d3d/src/cursor.rs:16-24,126-136`), preventing camera motion from changing the cursor's actual recorded position.-`src/components/ai-edition/RightPanes.tsx` → `CursorPane`, mounted from `RightPanelStack.tsx:115`.+## Bundled assets-| Control | Setting key | Range / type | Default |-| --- | --- | --- | --- |-| Show cursor | `cursorShow` (top-level) | toggle | `true` |-| Clip to canvas | `cursor.clipToBounds` | toggle | `false` |-| Cursor style (grid) | `cursorTheme` | pick from 18 options (Default + 17 Sweezy packs) | `default` |-| Size | `cursor.size` | 0.5 – 10.0 (×10 on the slider) | `3.0` |-| Smoothing | `cursor.smoothing` | 0 – 100% | `0.67` |-| Motion blur | `cursor.motionBlur` | 0 – 100% | `0.35` |-| Click bounce | `cursor.clickBounce` | 0 – 5.0 (×10 on the slider) | `2.5` |+The themed cursor packs are stored under `public/cursors/<id>/` and contain arrow and pointer PNGs registered in `src/lib/cursor/cursorThemes.ts`. The built-in native replacement SVG set is under `src/assets/cursors/` and is selected by `src/lib/cursor/nativeCursor.ts`, which maps captured cursor types to render assets and hotspots.-Defaults live in `src/components/video-editor/types.ts` (`DEFAULT_CURSOR_SIZE`, `DEFAULT_CURSOR_SMOOTHING`, `DEFAULT_CURSOR_MOTION_BLUR`, `DEFAULT_CURSOR_CLICK_BOUNCE`, `DEFAULT_CURSOR_CLIP_TO_BOUNDS`) and are surfaced through `useEditorSettings` (`src/lib/ai-edition/store/editorSettings.ts`).+## Known gaps-## 6. Settings persistence--- v3 document has a passthrough `legacyEditor` blob; the cursor settings round-trip through it as `cursorShow`, `cursorSize`, `cursorSmoothing`, `cursorMotionBlur`, `cursorClickBounce`, `cursorClipToBounds`, `cursorTheme`.-- Reader: `getEditorSettings(doc)` in `src/lib/ai-edition/store/editorSettings.ts`. Exposes `settings.cursor` and `settings.cursorTheme`.-- Writer: `patchEditorSettings(doc, patch)` (and `useEditorSettings().set / setLive / commit`).-- Hook: `useEditorSettings` in `src/lib/ai-edition/store/useEditorSettings.ts`. `set` persists to disk; `setLive` updates the in-memory document for live preview; `commit` flushes the in-memory doc to disk (used on slider release).--## 7. Auto-follow (zoom / camera)--`src/components/video-editor/videoPlayback/cursorFollowUtils.ts` (kept in the legacy `video-editor` folder because it's shared by the zoom-region focus logic and the export frame renderer).--- `interpolateCursorAt(telemetry, timeMs)` — binary-search the sorted telemetry and lerp to the playback time.-- `smoothCursorFocus(raw, prev, factor)` — exponential smoothing.-- `advanceFollowFocus(prev, raw, dtMs, params)` — distance-adaptive factor re-framed in content time so preview (variable fps) and export (fixed fps) converge at the same speed.-- `timeCorrectedFollowFactor(baseFactor, dtMs, referenceMs)` — frame-rate-independent smoothing.-- `adaptiveSmoothFactor(raw, prev, min, max, rampDistance)` — natural deceleration as the camera nears the cursor.--Consumers: `src/components/video-editor/videoPlayback/zoomRegionUtils.ts` (camera target for auto-focus zooms) and `src/lib/exporter/frameRenderer.ts` (export).--## 8. Exporter--`src/lib/ai-edition/exporter/documentExporter.ts` reads cursor data from options and passes it down the render pipeline. Forwarded fields: `cursorRecordingData`, `cursorTelemetry`, `cursorClickTimestamps`, `cursorScale`, `cursorSmoothing`, `cursorMotionBlur`, `cursorClickBounce`, `cursorClipToBounds`, `cursorTheme`. The legacy v2 export chain (frame renderer + muxer) consumes the same fields, so the v3 document round-trips through v2 export without losing the cursor pipeline.--## 9. Bundled assets--- 17 Sweezy-cursors theme packs under `public/cursors/<id>/{arrow,pointer}.png`. Each pack has a 32-logical-pixel reference with normalized hotspots (divide 128px-pack hotspots by 4). Add a pack by dropping two PNGs + an entry in `src/lib/cursor/cursorThemes.ts`.-- 16 native cursor SVGs under `src/assets/cursors/Cursor=*.svg` (default, app-starting, beachball, cross, hand-*, help, menu, move, not-allowed, resize-*, text-cursor, up-arrow, wait, zoom-*).--## 10. i18n--- `src/i18n/locales/en/settings.json` → `cursor` block: `theme`, `themeDefault`, `show`, `size`, `smoothing`, `motionBlur`, `clickBounce`, `clipToBounds`, `clipToBoundsDescription`. The AI-edition shell currently renders the pane in English; the legacy `SettingsPanel` consumed these keys directly.--## 11. What's NOT ported / known gaps--- The right-rail cursor tab is always shown. The legacy `SettingsPanel` hid the tab when `hasCursorData` was false. The new shell treats it as a preference (visible even before recording), which is intentional.-- The ai-edition shell does not use `useScopedT` for these labels yet — i18n keys exist but are not wired up. This is a separate P2/P3 concern.-- No tests cover the new `CursorPane` directly (only the shared `CursorPreviewLayer`).--## 12. File map (port branch vs legacy main)--| Concern | Legacy (`main`) | Port branch (`port/cursor-from-main`) |-| --- | --- | --- |-| Editor | `src/components/video-editor/SettingsPanel.tsx`, `VideoEditor.tsx`, `videoPlayback/VideoPlayback.tsx` | `src/components/ai-edition/RightPanes.tsx` (`CursorPane`), `RightPanelStack.tsx`, `NewEditorShell.tsx`, `VirtualPreview.tsx` |-| Pixi overlay | `src/components/video-editor/videoPlayback/cursorRenderer.ts` | `src/lib/cursor/pixiCursorRenderer.ts` (renamed) |-| Uploaded-cursor bitmaps | `src/components/video-editor/videoPlayback/uploadedCursorAssets.ts` | `src/lib/cursor/uploadedCursorAssets.ts` (renamed) |-| Auto-follow | `src/components/video-editor/videoPlayback/cursorFollowUtils.ts` | unchanged |-| Spring config | `src/components/video-editor/videoPlayback/motionSmoothing.ts` | unchanged |-| Themes | `src/lib/cursor/cursorThemes.ts` | unchanged |-| Path smoothing | `src/lib/cursor/cursorPathSmoothing.ts` | unchanged |-| Pretty / native cursor | `src/lib/cursor/nativeCursor.ts` | unchanged |-| Telemetry buffer | `src/lib/cursorTelemetryBuffer.ts` | unchanged |-| Hooks | `src/native/hooks/useCursor*.ts` | unchanged |-| Native capture | `electron/native/{screencapturekit,wgc-capture}/...` + `electron/native-bridge/cursor/*` | unchanged |-| Export pipeline | `src/lib/exporter/frameRenderer.ts`, `muxer.ts` | adds `src/lib/ai-edition/exporter/documentExporter.ts` (v3 envelope) → forwards to v2 renderer |+macOS single-window capture can report a cursor offset relative to the captured surface. This remains an open platform-specific alignment issue; display capture does not exhibit the same verified gap.diff --git a/technical-documentation/architecture/native-bridge.md b/technical-documentation/architecture/native-bridge.mdindex 029d8dad1..5cd25c73f 100644--- a/technical-documentation/architecture/native-bridge.md+++ b/technical-documentation/architecture/native-bridge.md@@ -6,9 +6,9 @@ The native bridge gives renderer code one typed interface for platform capabilit```mermaidflowchart LR- A[Native adapters\nplatform-specific capture/assets] --> S[Main-process services\nelectron/native-bridge/services]- S --> I[Unified IPC transport\nelectron/ipc/nativeBridge.ts]- I --> R[Renderer client\nsrc/native/client.ts]+ A["Native adapters<br/>platform-specific capture/assets"] --> S["Main-process services<br/>electron/native-bridge/services"]+ S --> I["Unified IPC transport<br/>electron/ipc/nativeBridge.ts"]+ I --> R["Renderer client<br/>src/native/client.ts"]R --> B[React components]```diff --git a/technical-documentation/testing/native-cursor-diagnostics.md b/technical-documentation/testing/native-cursor-diagnostics.mdindex c8c5ac0b9..d055d7394 100644--- a/technical-documentation/testing/native-cursor-diagnostics.md+++ b/technical-documentation/testing/native-cursor-diagnostics.md@@ -1,37 +1,30 @@-# Windows native cursor test pipeline+# Native cursor diagnostics-This branch includes two Windows-focused diagnostics for fast iteration on native cursor capture and rendering. They are intentionally local developer tools: they create short videos and JSON reports so cursor changes can be inspected without doing a full manual record/edit/export cycle.+These diagnostics inspect native cursor capture without requiring a complete record, edit, and export cycle. They produce cursor sidecars, JSON reports, and preview artifacts for checking samples, assets, hotspots, interaction events, and platform fallback behavior. The [cursor pipeline](../architecture/cursor.md) describes how the recorded data is rendered; this document focuses on the tools.-## Native sampler diagnostic+## Windows sampler diagnostic++Build the Windows native helper when needed:```powershell-npm run test:cursor-native:win+npm run build:native:win```-This script does not launch OpenScreen. It:--- starts a Windows `GetCursorInfo` sampler-- moves the real OS pointer with `SetCursorPos`-- captures native cursor handles, hotspots, assets, and standard `IDC_*` cursor types-- writes normalized `CursorRecordingData`-- generates an abstract preview video-- generates a real-screen preview video using screenshots of the current desktop+Run the cursor sampler diagnostic on a Windows machine:-The output directory is printed in the command result, for example:--```text-C:\Users\<user>\AppData\Local\Temp\openscreen-cursor-native-...+```powershell+npm run test:cursor-native:win```-Useful files:+The script starts a `GetCursorInfo` sampler, moves the pointer with `SetCursorPos`, captures cursor handles, hotspots, assets, and standard `IDC_*` types, then writes normalized recording data and preview videos. It prints the output directory, which contains:-- `report.json`: sample counts, asset counts, cursor handles, and generated artifact paths+- `report.json`: sample and asset counts, cursor handles, and generated artifact paths- `cursor-recording-data.json`: sidecar-compatible cursor data-- `preview.webm`: abstract path/asset/hotspot preview-- `real-capture-preview.webm`: real desktop screenshot background with reconstructed cursor overlay-- `assets/*.png`: raw cursor bitmaps captured from Windows+- `preview.webm`: abstract path, asset, and hotspot preview+- `real-capture-preview.webm`: desktop screenshot background with the reconstructed cursor+- `assets/*.png`: raw Windows cursor bitmaps-Environment overrides:+Optional settings include:```powershell$env:CURSOR_TEST_DURATION_MS = "3000"@@ -41,90 +34,58 @@ $env:CURSOR_TEST_OUTPUT_DIR = "C:\temp\openscreen-cursor-test"npm run test:cursor-native:win```-## OpenScreen preview capture+To inspect the real editor preview using the generated sidecar, run:```powershellnpm run capture:openscreen-preview```-This script launches the real Electron app, injects a fixture video plus cursor sidecar data, opens the editor, captures frames from the actual OpenScreen preview UI, and encodes them into a WebM.+Set `CURSOR_RECORDING_DATA_PATH` to select a particular sidecar. `capture-openscreen-preview.mjs` also accepts `OPENSCREEN_PREVIEW_SKIP_BUILD`, `OPENSCREEN_PREVIEW_FRAME_COUNT`, `OPENSCREEN_PREVIEW_FPS`, and `OPENSCREEN_PREVIEW_OUTPUT_DIR`.-By default it uses the latest `cursor-recording-data.json` generated by `npm run test:cursor-native:win`. To force a specific sidecar:+## macOS cursor helper-```powershell-$env:CURSOR_RECORDING_DATA_PATH = "C:\path\to\cursor-recording-data.json"-npm run capture:openscreen-preview-```+Build the ScreenCaptureKit and cursor helpers:-Useful environment overrides:--```powershell-$env:OPENSCREEN_PREVIEW_SKIP_BUILD = "true"-$env:OPENSCREEN_PREVIEW_FRAME_COUNT = "120"-$env:OPENSCREEN_PREVIEW_FPS = "30"-$env:OPENSCREEN_PREVIEW_OUTPUT_DIR = "C:\temp\openscreen-preview"-npm run capture:openscreen-preview+```bash+npm run build:native:mac```-Useful files:--- `openscreen-preview.webm`: video of the real OpenScreen editor preview-- `frames/*.png`: captured preview frames-- `report.json`: fixture paths, source sidecar, frame count, and output path--## What these tests validate+The build copies development binaries to `electron/native/screencapturekit/build/` and packaged binaries to `electron/native/bin/darwin-arm64/` or `electron/native/bin/darwin-x64/`. It requires Xcode.-Together, the scripts make it quick to inspect:+Run the cursor helper directly after building it:-- whether Windows cursor samples are visible and continuous-- whether native hotspots stay anchored when scaling to `3x`-- whether standard Windows cursors are recognized via `IDC_*`-- whether high-quality SVG cursor replacements follow the native hotspot-- whether the real OpenScreen preview renders the same cursor behavior as the diagnostic pipeline--They are not a full substitute for an end-to-end manual recording pass. Before shipping cursor changes, also test a real capture session and export from the packaged app.--## Known Gap+```bash+BIN=electron/native/screencapturekit/build/openscreen-macos-cursor-helper+("$BIN" '{"sampleIntervalMs":100}' & PID=$!; sleep 2; kill $PID) | head -20+```-Windows native cursor `Click Bounce` is currently backlogged. `Size`, `Smoothing`, and `Motion Blur` can be validated through preview/export, but `Click Bounce` has not shown a visible effect in packaged-app manual testing. The current diagnostic can observe synthetic click metadata, but that is not enough to validate the real OpenScreen record -> preview -> export path.+The first JSON line should have `type: "ready"`, together with `mouseTapReady` and `accessibilityTrusted`. Subsequent `type: "sample"` lines contain an `assetId`, position and interaction fields; the first occurrence of an asset also contains its PNG data, dimensions, scale factor, and hotspot. `accessibilityTrusted: false` is a valid development fallback: bitmap capture continues, but text and pointer affordance detection is unavailable.-Track the open item in `docs/engineering/windows-native-recorder-roadmap.md` under `Native Cursor Click Bounce Is Not Visibly Applied`.+To run the app with a specific helper binary:-## Native Windows capture backend+```bash+export OPENSCREEN_MAC_CURSOR_HELPER_EXE=/path/to/openscreen-macos-cursor-helper+npm run dev+```-The app now routes Windows recordings through an external WGC helper instead of Electron `getDisplayMedia`. This is meant to remove the coordinate and clock split that made the reconstructed cursor drift in the preview/export path.+macOS recording requires Screen Recording permission. Accessibility permission is optional and enables text and pointer affordance detection. After changing either permission, fully quit and relaunch the development app so the process observes the new state.-Current native availability rules:+## Reading the JSON report-- Windows 10 build 19041 or newer-- a helper executable is available+The generated cursor sidecar is stored beside the video as `<videoPath>.cursor.json`. A healthy native sidecar has `version: 2`, `provider: "native"`, a non-empty `assets` array, and `samples` with increasing `timeMs` values and normalized `cx`/`cy` positions. Native samples may reference an asset by `assetId`; the full bitmap is emitted once per unique asset. Click samples carry the interaction marker used by click-bounce rendering.-The helper currently implements display/window video capture, system audio loopback, default microphone capture, Media Foundation webcam capture, and DirectShow fallback for selected virtual cameras such as NVIDIA Broadcast. Webcam frames are composed into the primary MP4 as a bottom-right picture-in-picture overlay, and black webcam warmup frames are ignored until the first visible frame is available.+A position-only recording can legitimately report `provider: "none"` with an empty `assets` array. That means the native helper is unavailable or did not reach its ready state; telemetry still supplies cursor position.-Build OpenScreen's helper locally:+## What a healthy recording looks like-```powershell-npm run build:native:win-```+A report should show non-zero sample and asset counts, and its artifact paths should point to files that exist in the printed output directory. In the preview videos, the cursor should remain attached to its hotspot while moving, switch assets when the system cursor changes, and remain within the captured surface when clipping is enabled. On macOS Retina displays, the reported scale factor should be reflected in the dimensions and hotspot used by the renderer.-Smoke-test the helper directly:+For a full-path check, record a short clip, open it in the editor, and export it. Compare the preview and export around rapid cursor movement and clicks: both should use the same telemetry timing and cursor position, with click interaction visible when native click samples are present.-```powershell-npm run test:wgc-helper:win-npm run test:wgc-helper:win -- --capture-cursor-npm run test:wgc-window:win-npm run test:wgc-audio:win-npm run test:wgc-mic:win-npm run test:wgc-mixed-audio:win-npm run test:wgc-webcam:win-```--For local diagnostics with another compatible helper, point OpenScreen at that executable:--```powershell-$env:OPENSCREEN_WGC_CAPTURE_EXE = "C:\path\to\wgc-capture.exe"-npm run build-vite-npm run dev-```+## Known limitations-The helper receives one JSON config argument, emits JSON lifecycle events, prints the legacy `Recording started` marker, accepts `stop` on stdin, and prints `Recording stopped. Output path: <path>`. See `electron/native/README.md` for the exact contract and build output paths.+- macOS single-window capture can report a cursor offset relative to the captured surface; this is a known alignment issue.+- macOS Accessibility permission may be reported unreliably by unsigned development builds. Treat the helper's `accessibilityTrusted` field in its `ready` message as authoritative.+- Some app-defined CoreGraphics/CGS cursors are not exposed through `NSCursor.currentSystem`.+- The Windows native cursor click-bounce path is not reliably visible in packaged-app manual testing; synthetic diagnostic metadata alone does not validate the complete record-to-export path.+- Intel Macs may need a local `npm run build:native:mac` build when a packaged helper is not available for `darwin-x64`.