Cap icon indicating copy to clipboard operation
Cap copied to clipboard

Bounty: Deeplinks support + Raycast Extension

Open richiemcilroy opened this issue 10 months ago • 124 comments

Cap needs a Raycast extension. To enable this, deeplinks need to be added to the app for recording, stop recording, pausing (+ resuming), switching microphone, switching camera etc.

Then once deeplinks have been tested, the Raycast extension can be built.

We already support deeplinks for some stuff, e.g. auth etc. This just needs to be extended.

Added a $200 bounty for deeplinks support + Raycast extension built.

richiemcilroy avatar Jan 21 '26 14:01 richiemcilroy

CAP-619

linear[bot] avatar Jan 21 '26 14:01 linear[bot]

/bounty $200

richiemcilroy avatar Jan 21 '26 14:01 richiemcilroy

There's already a solid foundation for deeplinks in the codebase. The existing implementation is in apps/desktop/src-tauri/src/deeplink_actions.rs with the URL scheme cap-desktop:// registered in tauri.conf.json:31-35.

Current deeplink actions supported:

  • StartRecording - with capture_mode (screen/window by name), optional camera, mic_label, capture_system_audio, and mode (Studio/Instant)
  • StopRecording
  • OpenEditor - with project_path
  • OpenSettings - with optional page parameter

Missing actions for Raycast that would need to be added to the DeepLinkAction enum:

  • PauseRecording / ResumeRecording / TogglePauseRecording - the functions exist in apps/desktop/src-tauri/src/recording.rs:966-1008
  • TakeScreenshot - function exists at recording.rs:1180
  • ListCameras / SetCamera - for switching cameras
  • ListMicrophones / SetMicrophone - for switching mics
  • ListDisplays / ListWindows - to get available capture targets

The auth flow already uses cap-desktop://signin (see apps/web/app/api/desktop/[...route]/session.ts:72) for passing session tokens back to the desktop app.

Related issue: #28 has been tracking a Raycast extension since April 2024, with @ItsEeleeya working on it. The architecture changed significantly with Cap v0.3.0 (Tauri v2 + SolidJS), so the deeplink actions in deeplink_actions.rs are the right place to extend.

URL format example:

cap-desktop://action?value={"startRecording":{"captureMode":{"screen":"Built-in Retina Display"},"camera":null,"micLabel":"MacBook Pro Microphone","captureSystemAudio":true,"mode":"Studio"}}

For the Raycast extension, the existing structure at raycast/extensions would be the target repository once the extension is built.

tembo[bot] avatar Jan 21 '26 14:01 tembo[bot]

Hi @richiemcilroy, how are you going? How does the process work for working on this issue? Has it already been assigned to someone?

developerfred avatar Jan 21 '26 14:01 developerfred

/attempt #1540

onyedikachi-david avatar Jan 21 '26 15:01 onyedikachi-david

/attempt #1540

rishi-jat avatar Jan 21 '26 15:01 rishi-jat

/attempt #1540

Excellencedev avatar Jan 21 '26 16:01 Excellencedev

/attempt #1540

Pranjal6955 avatar Jan 21 '26 18:01 Pranjal6955

/attempt #1540

kumargope avatar Jan 21 '26 20:01 kumargope

"I've reviewed the current PR #1541. While the refactoring improves cyclomatic complexity, it seems to miss the specific hardware switching deeplinks (mic/camera) mentioned in the requirement. Also, the error handling for the build process could be more robust by providing specific exit codes. I am working on a version that includes full support for all requested deeplinks including hardware toggles."

kumargope avatar Jan 21 '26 20:01 kumargope

/attempt #1540

I've analyzed the requirements and the existing PR #1541. The current PR seems to focus on basic actions but lacks the specific hardware switching (mic/camera) and pause/resume logic mentioned in the issue.

kumargope avatar Jan 21 '26 20:01 kumargope

/attempt #1541

veeradyani222 avatar Jan 23 '26 08:01 veeradyani222

/attempt #1540

vankhaygpsc5400cc-bot avatar Jan 23 '26 11:01 vankhaygpsc5400cc-bot

/attempt #1540

preettrank53 avatar Jan 23 '26 13:01 preettrank53

/attempt #1541

Ayuussshhh avatar Jan 24 '26 11:01 Ayuussshhh

Attempt #1540 — Proposed Implementation Plan

  1. Modify deeplink_actions.rs

Extend DeepLinkAction enum with the following actions:

PauseRecording ResumeRecording SwitchMicrophone SwitchCamera

Implement the execute method to handle these new actions by integrating with: recording.rs lib.rs This will allow deep links to trigger the corresponding recording or device-switching actions in the application.

  1. Integration

Leverage existing functions: InProgressRecording::pause() InProgressRecording::resume() set_mic() set_camera_input()

Behavior: PauseRecording → pauses the active recording ResumeRecording → resumes the paused recording SwitchMicrophone → changes the active microphone SwitchCamera → changes the active camera

This plan ensures a seamless deep link integration with the recording workflow while reusing existing functions for stability and consistency.

Sadik111 avatar Jan 24 '26 15:01 Sadik111

/attempt #1540

Implementation Plan

1. Extend Desktop Deeplinks (Tauri)

  • Add new actions to DeepLinkAction enum in
    apps/desktop/src-tauri/src/deeplink_actions.rs:

    • PauseRecording
    • ResumeRecording
    • TogglePauseRecording
    • TakeScreenshot
    • ListCameras, SetCamera
    • ListMicrophones, SetMicrophone
    • ListDisplays, ListWindows
  • Reuse existing logic from:

    • recording.rs (pause/resume, screenshot)
    • device helpers for camera/mic switching
  • Follow existing deeplink format:

2. Deeplink Validation & Safety

  • Ensure actions gracefully no-op when no active recording exists
  • Validate input values (camera/mic names, display/window identifiers)
  • Return structured errors for invalid deeplink payloads

3. Raycast Extension

  • Create a Raycast extension (TypeScript) that:
  • Triggers the new deeplinks
  • Provides commands for:
    • Start / Stop / Pause / Resume recording
    • Take screenshot
    • Switch microphone / camera
    • Select display or window
  • Dynamically populate device lists using List* deeplinks

4. Testing & Demo

  • Manually test deeplinks via browser / terminal
  • Test full Raycast → Cap Desktop flow
  • Record a short demo video showing:
  • Recording controls
  • Device switching
  • Screenshot action

If there are preferred naming conventions for deeplink actions or payload schemas, happy to align before implementation.

singhharsh1708 avatar Jan 28 '26 15:01 singhharsh1708

/attempt #1540

kingerharshit avatar Jan 28 '26 18:01 kingerharshit

/attempt https://github.com/CapSoftware/Cap/issues/1540

gelluisaac avatar Jan 29 '26 16:01 gelluisaac

/attempt #1540

d3vv3r avatar Jan 30 '26 18:01 d3vv3r