-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: Deeplinks Support + Raycast Extension #1548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ad896bf
a8c5a6f
540922e
c50550f
c3f0cf7
5c793f9
0c7fa42
4036ae5
5380812
f79d56a
75d77e4
8e6beb1
e0c15f1
3ea5202
752bfa9
c1c6a46
d4760c3
4f1d6a8
3ad5663
7360964
d44c8c3
6f335ea
9a7d1f4
1371856
eeb2da1
8a6c82e
12903b9
31af095
d5c8eea
6b37436
896b791
1312514
02cd15c
4a1cc86
93dc03d
53c9025
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,13 +25,24 @@ pub enum DeepLinkAction { | |||||||||||||||||||||||||||||||||||||
| capture_system_audio: bool, | ||||||||||||||||||||||||||||||||||||||
| mode: RecordingMode, | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| StartDefaultRecording, | ||||||||||||||||||||||||||||||||||||||
| StopRecording, | ||||||||||||||||||||||||||||||||||||||
| OpenEditor { | ||||||||||||||||||||||||||||||||||||||
| project_path: PathBuf, | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| OpenSettings { | ||||||||||||||||||||||||||||||||||||||
| page: Option<String>, | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| PauseRecording, | ||||||||||||||||||||||||||||||||||||||
| ResumeRecording, | ||||||||||||||||||||||||||||||||||||||
| SetMicrophone { | ||||||||||||||||||||||||||||||||||||||
| label: Option<String>, | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| SetCamera { | ||||||||||||||||||||||||||||||||||||||
| id: Option<DeviceOrModelID>, | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| CycleMicrophone, | ||||||||||||||||||||||||||||||||||||||
| CycleCamera, | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| pub fn handle(app_handle: &AppHandle, urls: Vec<Url>) { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -143,6 +154,25 @@ impl DeepLinkAction { | |||||||||||||||||||||||||||||||||||||
| .await | ||||||||||||||||||||||||||||||||||||||
| .map(|_| ()) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::StartDefaultRecording => { | ||||||||||||||||||||||||||||||||||||||
| let displays = cap_recording::screen_capture::list_displays(); | ||||||||||||||||||||||||||||||||||||||
| if let Some((display, _)) = displays.first() { | ||||||||||||||||||||||||||||||||||||||
| let state = app.state::<ArcLock<App>>(); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| let inputs = StartRecordingInputs { | ||||||||||||||||||||||||||||||||||||||
| mode: RecordingMode::Instant, | ||||||||||||||||||||||||||||||||||||||
| capture_target: ScreenCaptureTarget::Display { id: display.id }, | ||||||||||||||||||||||||||||||||||||||
| capture_system_audio: false, | ||||||||||||||||||||||||||||||||||||||
| organization_id: None, | ||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| crate::recording::start_recording(app.clone(), state, inputs) | ||||||||||||||||||||||||||||||||||||||
| .await | ||||||||||||||||||||||||||||||||||||||
| .map(|_| ()) | ||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||
| Err("No displays found".to_string()) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::StopRecording => { | ||||||||||||||||||||||||||||||||||||||
| crate::recording::stop_recording(app.clone(), app.state()).await | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -152,6 +182,30 @@ impl DeepLinkAction { | |||||||||||||||||||||||||||||||||||||
| DeepLinkAction::OpenSettings { page } => { | ||||||||||||||||||||||||||||||||||||||
| crate::show_window(app.clone(), ShowCapWindow::Settings { page }).await | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::PauseRecording => { | ||||||||||||||||||||||||||||||||||||||
|
Excellencedev marked this conversation as resolved.
Excellencedev marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
| let state = app.state::<ArcLock<App>>(); | ||||||||||||||||||||||||||||||||||||||
| crate::pause_recording(state).await | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Excellencedev marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::ResumeRecording => { | ||||||||||||||||||||||||||||||||||||||
|
Excellencedev marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
| let state = app.state::<ArcLock<App>>(); | ||||||||||||||||||||||||||||||||||||||
| crate::resume_recording(state).await | ||||||||||||||||||||||||||||||||||||||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Excellencedev marked this conversation as resolved.
Comment on lines
+190
to
+200
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: duplicate match arms cause compilation error. Lines 196-200 repeat the
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 190:200
Comment:
**syntax:** duplicate match arms cause compilation error. Lines 196-200 repeat the `PauseRecording` and `ResumeRecording` cases.
```suggestion
DeepLinkAction::PauseRecording => {
crate::recording::pause_recording(app.clone(), app.state()).await
}
DeepLinkAction::ResumeRecording => {
crate::recording::resume_recording(app.clone(), app.state()).await
}
DeepLinkAction::SetMicrophone { label } => {
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::SetMicrophone { label } => { | ||||||||||||||||||||||||||||||||||||||
| let state = app.state::<ArcLock<App>>(); | ||||||||||||||||||||||||||||||||||||||
| crate::set_mic_input(state, label).await | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::SetCamera { id } => { | ||||||||||||||||||||||||||||||||||||||
| let state = app.state::<ArcLock<App>>(); | ||||||||||||||||||||||||||||||||||||||
| crate::set_camera_input(app.clone(), state, id).await | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Excellencedev marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::CycleMicrophone => { | ||||||||||||||||||||||||||||||||||||||
| let state = app.state::<ArcLock<App>>(); | ||||||||||||||||||||||||||||||||||||||
| crate::cycle_mic_input(state).await | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+219
to
+222
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing permissions check before cycling microphone. Other microphone operations (like Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 219:222
Comment:
**style:** missing permissions check before cycling microphone. Other microphone operations (like `SetMicrophone` on line 202) check permissions first.
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||||||||||||||||||||
| DeepLinkAction::CycleCamera => { | ||||||||||||||||||||||||||||||||||||||
| let state = app.state::<ArcLock<App>>(); | ||||||||||||||||||||||||||||||||||||||
| crate::cycle_camera_input(app.clone(), state).await | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+223
to
+226
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: missing permissions check before cycling camera. Other camera operations (like Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 223:226
Comment:
**style:** missing permissions check before cycling camera. Other camera operations (like `SetCamera` on line 211) check permissions first.
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -588,6 +588,99 @@ async fn set_camera_input( | |
| Ok(()) | ||
| } | ||
|
|
||
| #[tauri::command] | ||
| #[specta::specta] | ||
| #[instrument(skip(state))] | ||
| pub async fn pause_recording(state: MutableState<'_, App>) -> Result<(), String> { | ||
|
Excellencedev marked this conversation as resolved.
Outdated
Excellencedev marked this conversation as resolved.
Outdated
|
||
| let mut app = state.write().await; | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| if let Some(recording) = app.current_recording_mut() { | ||
| recording.pause().await.map_err(|e| e.to_string())?; | ||
| } | ||
| Ok(()) | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| #[tauri::command] | ||
| #[specta::specta] | ||
| #[instrument(skip(state))] | ||
| pub async fn resume_recording(state: MutableState<'_, App>) -> Result<(), String> { | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| let mut app = state.write().await; | ||
| if let Some(recording) = app.current_recording_mut() { | ||
| recording.resume().await.map_err(|e| e.to_string())?; | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| } | ||
| Ok(()) | ||
| } | ||
|
|
||
| #[tauri::command] | ||
| #[specta::specta] | ||
|
Excellencedev marked this conversation as resolved.
Outdated
Excellencedev marked this conversation as resolved.
|
||
| #[instrument(skip(state))] | ||
| pub async fn cycle_mic_input(state: MutableState<'_, App>) -> Result<(), String> { | ||
|
Excellencedev marked this conversation as resolved.
|
||
| let (current_label, mic_list) = { | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| let app = state.read().await; | ||
|
Excellencedev marked this conversation as resolved.
|
||
| let mic_list = MicrophoneFeed::list().keys().cloned().collect::<Vec<_>>(); | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| (app.selected_mic_label.clone(), mic_list) | ||
| }; | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
|
|
||
| if mic_list.is_empty() { | ||
| return Ok(()); | ||
| } | ||
|
|
||
| let next_label = match current_label { | ||
| Some(label) => { | ||
| let index = mic_list.iter().position(|l| l == &label); | ||
| match index { | ||
| Some(i) => mic_list.get((i + 1) % mic_list.len()).cloned(), | ||
| None => mic_list.first().cloned(), | ||
| } | ||
| } | ||
| None => mic_list.first().cloned(), | ||
| }; | ||
|
|
||
| set_mic_input(state, next_label).await | ||
| } | ||
|
|
||
| #[tauri::command] | ||
| #[specta::specta] | ||
| #[instrument(skip(app_handle, state))] | ||
| pub async fn cycle_camera_input( | ||
|
Comment on lines
+628
to
+631
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src-tauri/src/lib.rs
Line: 628:631
Comment:
**logic:** `cycle_camera_input` not registered in `tauri_specta::collect_commands!` around line 2673. Add it after `cycle_mic_input` so it's callable from deeplinks.
How can I resolve this? If you propose a fix, please make it concise. |
||
| app_handle: AppHandle, | ||
| state: MutableState<'_, App> | ||
| ) -> Result<(), String> { | ||
| let (current_id, camera_list) = { | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| let app = state.read().await; | ||
|
Excellencedev marked this conversation as resolved.
|
||
| let camera_list = cap_camera::list_cameras().collect::<Vec<_>>(); | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| (app.selected_camera_id.clone(), camera_list) | ||
| }; | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
|
|
||
| if camera_list.is_empty() { | ||
| return Ok(()); | ||
| } | ||
|
|
||
| let next_id = match current_id { | ||
| Some(id) => { | ||
| let current_dev_id = match id { | ||
| DeviceOrModelID::DeviceID(d) => Some(d), | ||
| DeviceOrModelID::ModelID(_) => None, | ||
| }; | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
|
|
||
| let index = if let Some(dev_id) = current_dev_id { | ||
| camera_list.iter().position(|c| c.device_id() == dev_id) | ||
| } else { | ||
| None | ||
| }; | ||
|
|
||
| match index { | ||
| Some(i) => camera_list.get((i + 1) % camera_list.len()), | ||
| None => camera_list.first(), | ||
| } | ||
| } | ||
| None => camera_list.first(), | ||
| }; | ||
|
|
||
| let next_id = next_id.map(|c| DeviceOrModelID::DeviceID(c.device_id().to_string())); | ||
|
|
||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| set_camera_input(app_handle, state, next_id).await | ||
| } | ||
|
|
||
| fn spawn_mic_error_handler(app_handle: AppHandle, error_rx: flume::Receiver<StreamError>) { | ||
| tokio::spawn(async move { | ||
| let state = app_handle.state::<ArcLock<App>>(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,19 @@ | ||||||||
| # Cap Control Raycast Extension | ||||||||
|
|
||||||||
| Control the Cap desktop app from Raycast. | ||||||||
|
|
||||||||
| ## Commands | ||||||||
|
|
||||||||
| - **Start Recording**: Starts a new recording (defaults to first display). | ||||||||
| - **Stop Recording**: Stops the current recording. | ||||||||
| - **Pause Recording**: Pauses the current recording. | ||||||||
| - **Resume Recording**: Resumes the current recording. | ||||||||
| - **Switch Camera**: Cycles through available cameras. | ||||||||
| - **Switch Microphone**: Cycles through available microphones. | ||||||||
|
|
||||||||
| ## Installation | ||||||||
|
|
||||||||
| 1. `cd apps/raycast-extension` | ||||||||
| 2. `npm install` | ||||||||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||||||||
| 3. `npm run build` | ||||||||
|
Comment on lines
+18
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: duplicate build step with conflicting commands. Line 18 says
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/raycast-extension/README.md
Line: 18:19
Comment:
**syntax:** duplicate build step with conflicting commands. Line 18 says `pnpm build` but line 19 says `npm run build`.
```suggestion
3. `npm run build`
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||
| 4. Import into Raycast via "Import Extension". | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||||||||||
| { | ||||||||||||||
| "$schema": "https://www.raycast.com/schemas/extension.json", | ||||||||||||||
| "name": "cap-control", | ||||||||||||||
|
Excellencedev marked this conversation as resolved.
|
||||||||||||||
| "title": "Cap Control", | ||||||||||||||
| "description": "Control Cap desktop app", | ||||||||||||||
| "icon": "command-icon.png", | ||||||||||||||
| "author": "CapSoftware", | ||||||||||||||
| "categories": [ | ||||||||||||||
| "Productivity", | ||||||||||||||
| "Media" | ||||||||||||||
| ], | ||||||||||||||
| "license": "MIT", | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This repo isn't MIT-licensed overall (see root
Suggested change
|
||||||||||||||
| "commands": [ | ||||||||||||||
| { | ||||||||||||||
| "name": "start-recording", | ||||||||||||||
| "title": "Start Recording", | ||||||||||||||
| "description": "Start a new recording", | ||||||||||||||
| "mode": "no-view" | ||||||||||||||
| }, | ||||||||||||||
| { | ||||||||||||||
| "name": "stop-recording", | ||||||||||||||
| "title": "Stop Recording", | ||||||||||||||
| "description": "Stop current recording", | ||||||||||||||
| "mode": "no-view" | ||||||||||||||
| }, | ||||||||||||||
| { | ||||||||||||||
| "name": "pause-recording", | ||||||||||||||
| "title": "Pause Recording", | ||||||||||||||
| "description": "Pause current recording", | ||||||||||||||
| "mode": "no-view" | ||||||||||||||
| }, | ||||||||||||||
| { | ||||||||||||||
| "name": "resume-recording", | ||||||||||||||
| "title": "Resume Recording", | ||||||||||||||
| "description": "Resume current recording", | ||||||||||||||
| "mode": "no-view" | ||||||||||||||
| }, | ||||||||||||||
| { | ||||||||||||||
| "name": "switch-camera", | ||||||||||||||
| "title": "Switch Camera", | ||||||||||||||
| "description": "Cycle through available cameras", | ||||||||||||||
| "mode": "no-view" | ||||||||||||||
| }, | ||||||||||||||
| { | ||||||||||||||
| "name": "switch-microphone", | ||||||||||||||
| "title": "Switch Microphone", | ||||||||||||||
| "description": "Cycle through available microphones", | ||||||||||||||
| "mode": "no-view" | ||||||||||||||
| } | ||||||||||||||
| ], | ||||||||||||||
| "dependencies": { | ||||||||||||||
| "@raycast/api": "^1.69.0", | ||||||||||||||
| "@raycast/utils": "^1.13.0" | ||||||||||||||
| }, | ||||||||||||||
| "devDependencies": { | ||||||||||||||
| "@raycast/eslint-config": "^1.0.6", | ||||||||||||||
| "@types/node": "20.8.10", | ||||||||||||||
| "@types/react": "18.2.27", | ||||||||||||||
| "eslint": "^8.51.0", | ||||||||||||||
| "prettier": "^3.0.3", | ||||||||||||||
| "typescript": "^5.2.2" | ||||||||||||||
| }, | ||||||||||||||
| "scripts": { | ||||||||||||||
| "build": "ray build -e dist", | ||||||||||||||
| "dev": "ray develop", | ||||||||||||||
| "fix-lint": "ray lint --fix", | ||||||||||||||
| "lint": "ray lint", | ||||||||||||||
| "prepublishOnly": "echo \"\\n\\nIt seems like you are trying to publish the Raycast extension to npm.\\n\\nIf you did intend to publish it to npm, remove the \\`prepublishOnly\\` script and rerun \\`npm publish\\` again.\\nIf you wanted to publish it to the Raycast Store instead, use \\`npm run publish\\` instead.\\n\\n\" && exit 1", | ||||||||||||||
| "publish": "npx @raycast/api@latest publish" | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { sendCapCommand } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendCapCommand("pause_recording", "Recording Paused"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { sendCapCommand } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendCapCommand("resume_recording", "Recording Resumed"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { sendCapCommand } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendCapCommand("start_default_recording", "Recording Started"); | ||
| } | ||
|
Excellencedev marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { sendCapCommand } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendCapCommand("stop_recording", "Recording Stopped"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { sendCapCommand } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendCapCommand("cycle_camera", "Switching Camera..."); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { sendCapCommand } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendCapCommand("cycle_microphone", "Switching Microphone..."); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { open, showHUD, closeMainWindow } from "@raycast/api"; | ||
|
|
||
| export async function sendCapCommand(action: string | object, hudMessage: string) { | ||
|
Excellencedev marked this conversation as resolved.
Outdated
|
||
| try { | ||
| await closeMainWindow(); | ||
| // If action is a string, it's a unit variant (e.g. "stop_recording") | ||
| // If it's an object, it's a struct variant (e.g. { "start_recording": ... }) | ||
| const jsonValue = JSON.stringify(action); | ||
| const url = `cap-desktop://action?value=${encodeURIComponent(jsonValue)}`; | ||
| await open(url); | ||
| await showHUD(hudMessage); | ||
| } catch (error) { | ||
| console.error(error); | ||
| await showHUD("Failed to connect to Cap"); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "lib": [ | ||
| "ES2023" | ||
| ], | ||
| "module": "commonjs", | ||
| "target": "ES2023", | ||
| "strict": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "sourceMap": true, | ||
| "jsx": "react", | ||
| "moduleResolution": "Node", | ||
| "resolveJsonModule": true | ||
| }, | ||
| "include": [ | ||
| "src/**/*" | ||
| ] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.