feat: add deeplink support and Raycast extension (#1540)#1728
feat: add deeplink support and Raycast extension (#1540)#1728bcornish1797 wants to merge 2 commits intoCapSoftware:mainfrom
Conversation
apps/raycast/src/deeplink.ts
Outdated
| if (!url.startsWith("cap-desktop://")) { | ||
| throw new Error("Cap deeplink must use cap-desktop://"); | ||
| } |
There was a problem hiding this comment.
buildCapUrl always constructs the URL with the cap-desktop:// prefix via the template literal, so url.startsWith("cap-desktop://") is unconditionally true and the branch can never be taken. The guard can be removed without changing behavior.
| if (!url.startsWith("cap-desktop://")) { | |
| throw new Error("Cap deeplink must use cap-desktop://"); | |
| } | |
| const url = buildCapUrl(path, params); | |
| try { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/raycast/src/deeplink.ts
Line: 41-43
Comment:
**Dead safety guard**
`buildCapUrl` always constructs the URL with the `cap-desktop://` prefix via the template literal, so `url.startsWith("cap-desktop://")` is unconditionally `true` and the branch can never be taken. The guard can be removed without changing behavior.
```suggestion
const url = buildCapUrl(path, params);
try {
```
How can I resolve this? If you propose a fix, please make it concise.| - `capture_type`: `screen` or `window` (required) | ||
| - `target`: screen/window name exactly as shown in Cap (required) | ||
| - `capture_system_audio`: `true` / `false` (optional) | ||
| - `mic_label`: microphone label exactly as shown in Cap (optional) | ||
| - omitting `mic_label`, `device_id`, `model_id`, and `off` keeps the current Cap inputs unchanged | ||
| - camera: | ||
| - `device_id=<id>` or `model_id=<VID:PID>` | ||
| - `off=true` to disable camera |
There was a problem hiding this comment.
mic_off parameter not documented
The Rust parser for record/start calls parse_microphone_from_query(&query, "mic_label", "mic_off"), meaning mic_off=true is a valid way to explicitly disable the microphone when starting a recording. This parameter is never mentioned in the docs — users relying on the docs will not know it exists.
Consider adding a bullet like:
- `mic_off=true` to disable microphone input (cannot be combined with `mic_label`)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/DEEPLINKS.md
Line: 15-22
Comment:
**`mic_off` parameter not documented**
The Rust parser for `record/start` calls `parse_microphone_from_query(&query, "mic_label", "mic_off")`, meaning `mic_off=true` is a valid way to explicitly disable the microphone when starting a recording. This parameter is never mentioned in the docs — users relying on the docs will not know it exists.
Consider adding a bullet like:
```
- `mic_off=true` to disable microphone input (cannot be combined with `mic_label`)
```
How can I resolve this? If you propose a fix, please make it concise.|
Hi, it looks like the CI workflow is waiting for approval to run (first-time contributor from a fork). Could you please approve the workflow run? Thanks! |
Summary
cap-desktop://deeplinks for start/stop/pause/resume/toggle/restart plus microphone, camera, and settings actionscap-desktop://action?value=...JSON deeplinksDeviceOrModelIDhandlingapps/raycast/demo/cap-raycast-demo.mp4/claim #1540
Validation
corepack pnpm --dir apps/raycast run typecheckNotes
apps/raycast/demo/cap-raycast-demo.mp4is included in this branch as a lightweight walkthrough videoray lintstill hits Raycast package validation / standalone lint wiring issues in this monorepo context, but the extension source typechecks cleanlyGreptile Summary
This PR adds path-based
cap-desktop://deeplinks (e.g.record/start,record/stop,device/microphone, etc.) to the Tauri desktop app alongside a new Raycast extension that invokes them. The Rust side adds newDeepLinkActionvariants with unit tests covering the key parse paths, and backward-compat with the existing JSON-payload format is preserved.Confidence Score: 5/5
Safe to merge; all remaining findings are minor style/doc suggestions with no correctness impact.
The Rust parsing logic is sound, backward compatibility with legacy JSON deeplinks is preserved, unit tests cover the main parse paths, and the Raycast extension correctly maps form inputs to URL params. The two open findings are a dead code guard and a missing documentation entry — neither affects runtime behavior.
apps/raycast/src/deeplink.ts (dead guard), apps/desktop/src-tauri/DEEPLINKS.md (undocumented mic_off param)
Important Files Changed
Sequence Diagram
sequenceDiagram participant R as Raycast Extension participant OS as macOS open(1) participant T as Tauri deeplink handler participant P as path_action() parser participant A as DeepLinkAction::execute() R->>OS: open cap-desktop://record/start?... OS->>T: cap-desktop:// URL registered T->>P: try_from(&url) P-->>T: DeepLinkAction::StartRecordingPath{...} T->>A: action.execute(&app_handle) A-->>T: Ok(()) R->>OS: open cap-desktop://device/microphone?label=... OS->>T: cap-desktop:// URL registered T->>P: try_from(&url) P-->>T: DeepLinkAction::SwitchMicrophone{...} T->>A: action.execute(&app_handle) A-->>T: Ok(()) R->>OS: open cap-desktop://action?value={...json...} OS->>T: legacy JSON deeplink T->>P: try_from(&url) serde_json path P-->>T: DeepLinkAction (legacy) T->>A: action.execute(&app_handle) A-->>T: Ok(())Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat: add Cap deeplinks and Raycast exte..." | Re-trigger Greptile
(2/5) Greptile learns from your feedback when you react with thumbs up/down!