Skip to content

feat: add camera.clip, location.get, and canvas local file serving#210

Open
shanselman wants to merge 1 commit intomasterfrom
feat/capability-parity
Open

feat: add camera.clip, location.get, and canvas local file serving#210
shanselman wants to merge 1 commit intomasterfrom
feat/capability-parity

Conversation

@shanselman
Copy link
Copy Markdown
Collaborator

Three new node capabilities to close the parity gap with macOS:

camera.clip — Video recording (MP4)

  • Configurable duration (clamped to 60s max), optional audio
  • Uses MediaCapture with HD720p encoding
  • 4 new tests

location.get — GPS/WiFi location

  • Windows.Devices.Geolocation with accuracy/timeout params
  • Returns lat/lon/accuracy/timestamp
  • Permission denial mapped to LOCATION_PERMISSION_REQUIRED
  • 9 new tests

Canvas local file serving + auto-reload

  • WebView2 virtual host mapping (openclaw-canvas.local)
  • Auto-reload via FileSystemWatcher with thread-safe debounce
  • Path traversal protection (canonicalization + containment check)

Security hardening from dual-model review:

  • Path traversal guard on canvas local file resolution
  • CancellationTokenSource properly disposed in location handler
  • Thread-safe debounce using Interlocked.Exchange

All 808 tests pass (686 shared + 122 tray).

Camera:
- Add camera.clip video recording (MP4, configurable duration/audio)
- Duration clamped to 60s max, uses MediaCapture with HD720p encoding
- 4 new tests for args defaults, clamping, routing, error handling

Location:
- New LocationCapability with location.get command
- Uses Windows.Devices.Geolocation with accuracy/timeout params
- Returns lat/lon/accuracy/timestamp
- Permission denial mapped to LOCATION_PERMISSION_REQUIRED
- 9 new tests

Canvas:
- Local file serving via WebView2 SetVirtualHostNameToFolderMapping
- Maps openclaw-canvas.local to %LOCALAPPDATA%/OpenClawTray/canvas/
- Auto-reload with FileSystemWatcher (500ms debounce)
- Whitelisted in IsUrlSafe security check

All 808 tests pass (686 shared + 122 tray).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant