diff --git a/apps/desktop/docs/DEEPLINKS.md b/apps/desktop/docs/DEEPLINKS.md new file mode 100644 index 0000000000..8c3190cefa --- /dev/null +++ b/apps/desktop/docs/DEEPLINKS.md @@ -0,0 +1,196 @@ +# Cap Deeplinks API Documentation + +This document describes the deeplinks API available in the Cap desktop application for integration with external tools like Raycast. + +## URL Scheme + +All deeplinks use the `cap-desktop://` URL scheme. + +## Format + +Deeplinks follow this format: +``` +cap-desktop://action?value= +``` + +Where `` is a JSON object containing: +- `action`: The action type (snake_case) +- Additional parameters specific to each action + +## Available Actions + +### 1. Start Recording + +Starts a new screen recording. + +**Action:** `start_recording` + +**Parameters:** +- `capture_mode` (object): Screen or Window selection + - `Screen`: `{ "Screen": "Screen Name" }` + - `Window`: `{ "Window": "Window Name" }` +- `camera` (optional): Camera device ID or model ID + - `{ "DeviceID": "device-id" }` or `{ "ModelID": "model-id" }` +- `mic_label` (optional, string): Microphone device name +- `capture_system_audio` (boolean): Whether to capture system audio +- `mode` (string): Recording mode - `"studio"`, `"instant"`, or `"screenshot"` + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22start_recording%22%2C%22capture_mode%22%3A%7B%22Screen%22%3A%22Primary%22%7D%2C%22camera%22%3Anull%2C%22mic_label%22%3Anull%2C%22capture_system_audio%22%3Afalse%2C%22mode%22%3A%22studio%22%7D +``` + +### 2. Stop Recording + +Stops the current recording. + +**Action:** `stop_recording` + +**Parameters:** None + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22stop_recording%22%7D +``` + +### 3. Pause Recording + +Pauses the current recording without stopping it. + +**Action:** `pause_recording` + +**Parameters:** None + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22pause_recording%22%7D +``` + +### 4. Resume Recording + +Resumes a paused recording. + +**Action:** `resume_recording` + +**Parameters:** None + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22resume_recording%22%7D +``` + +### 5. Toggle Pause + +Toggles between pause and resume states. + +**Action:** `toggle_pause_recording` + +**Parameters:** None + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22toggle_pause_recording%22%7D +``` + +### 6. Switch Microphone + +Changes the active microphone input. + +**Action:** `switch_microphone` + +**Parameters:** +- `mic_label` (string or null): Microphone device name, or `null` to disable microphone + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22switch_microphone%22%2C%22mic_label%22%3A%22Built-in%20Microphone%22%7D +``` + +### 7. Switch Camera + +Changes the active camera input. + +**Action:** `switch_camera` + +**Parameters:** +- `camera` (object or null): Camera identifier or `null` to disable camera + - `{ "DeviceID": "device-id" }` or `{ "ModelID": "model-id" }` + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22switch_camera%22%2C%22camera%22%3A%7B%22DeviceID%22%3A%22camera-id%22%7D%7D +``` + +### 8. Open Editor + +Opens a project in the Cap editor. + +**Action:** `open_editor` + +**Parameters:** +- `project_path` (string): Full path to the .cap project file + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22open_editor%22%2C%22project_path%22%3A%22%2Fpath%2Fto%2Fproject.cap%22%7D +``` + +**Note:** On macOS, you can also use `file://` URLs to open .cap files directly. + +### 9. Open Settings + +Opens the Cap settings window. + +**Action:** `open_settings` + +**Parameters:** +- `page` (optional, string): Settings page to open + +**Example:** +``` +cap-desktop://action?value=%7B%22action%22%3A%22open_settings%22%2C%22page%22%3A%22general%22%7D +``` + +## Error Handling + +If a deeplink action fails: +1. The error is logged to the console +2. The user may see a notification from the Cap app +3. The action is silently ignored if the app is not running + +## Requirements + +- Cap desktop app must be installed +- Cap desktop app should be running (some actions will launch it if not) +- On macOS, the `cap-desktop` URL scheme is registered automatically during installation +- On Windows, the URL scheme is registered automatically during installation + +## Testing Deeplinks + +You can test deeplinks from the terminal: + +### macOS +```bash +open "cap-desktop://action?value=%7B%22action%22%3A%22start_recording%22%2C%22capture_mode%22%3A%7B%22Screen%22%3A%22Primary%22%7D%2C%22camera%22%3Anull%2C%22mic_label%22%3Anull%2C%22capture_system_audio%22%3Afalse%2C%22mode%22%3A%22studio%22%7D" +``` + +### Windows +```powershell +start "cap-desktop://action?value=%7B%22action%22%3A%22start_recording%22%2C%22capture_mode%22%3A%7B%22Screen%22%3A%22Primary%22%7D%2C%22camera%22%3Anull%2C%22mic_label%22%3Anull%2C%22capture_system_audio%22%3Afalse%2C%22mode%22%3A%22studio%22%7D" +``` + +### Linux +```bash +xdg-open "cap-desktop://action?value=%7B%22action%22%3A%22start_recording%22%2C%22capture_mode%22%3A%7B%22Screen%22%3A%22Primary%22%7D%2C%22camera%22%3Anull%2C%22mic_label%22%3Anull%2C%22capture_system_audio%22%3Afalse%2C%22mode%22%3A%22studio%22%7D" +``` + +## Integration Examples + +### Raycast Extension +See the `extensions/raycast/cap` directory for a complete Raycast extension implementation. + +### Alfred Workflow +You can create Alfred workflows using the deeplink URLs with the `open` command on macOS. + +### Keyboard Shortcuts (Custom) +Use tools like BetterTouchTool (macOS) or AutoHotkey (Windows) to trigger deeplinks with custom keyboard shortcuts. diff --git a/apps/desktop/src-tauri/src/deeplink_actions.rs b/apps/desktop/src-tauri/src/deeplink_actions.rs index fce75b4a84..a938276f62 100644 --- a/apps/desktop/src-tauri/src/deeplink_actions.rs +++ b/apps/desktop/src-tauri/src/deeplink_actions.rs @@ -26,6 +26,15 @@ pub enum DeepLinkAction { mode: RecordingMode, }, StopRecording, + PauseRecording, + ResumeRecording, + TogglePauseRecording, + SwitchMicrophone { + mic_label: Option, + }, + SwitchCamera { + camera: Option, + }, OpenEditor { project_path: PathBuf, }, @@ -146,6 +155,23 @@ impl DeepLinkAction { DeepLinkAction::StopRecording => { crate::recording::stop_recording(app.clone(), app.state()).await } + DeepLinkAction::PauseRecording => { + crate::recording::pause_recording(app.clone(), app.state()).await + } + DeepLinkAction::ResumeRecording => { + crate::recording::resume_recording(app.clone(), app.state()).await + } + DeepLinkAction::TogglePauseRecording => { + crate::recording::toggle_pause_recording(app.clone(), app.state()).await + } + DeepLinkAction::SwitchMicrophone { mic_label } => { + let state = app.state::>(); + crate::set_mic_input(state, mic_label).await + } + DeepLinkAction::SwitchCamera { camera } => { + let state = app.state::>(); + crate::set_camera_input(app.clone(), state, camera, None).await + } DeepLinkAction::OpenEditor { project_path } => { crate::open_project_from_path(Path::new(&project_path), app.clone()) } diff --git a/extensions/raycast/cap/.gitignore b/extensions/raycast/cap/.gitignore new file mode 100644 index 0000000000..c0a9e46226 --- /dev/null +++ b/extensions/raycast/cap/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +*.log +.DS_Store +*.tgz diff --git a/extensions/raycast/cap/CHANGELOG.md b/extensions/raycast/cap/CHANGELOG.md new file mode 100644 index 0000000000..5c619e895c --- /dev/null +++ b/extensions/raycast/cap/CHANGELOG.md @@ -0,0 +1,16 @@ +CHANGELOG + +## [1.0.0] - 2025-02-06 + +### Added +- Initial release of Cap Raycast Extension +- Start Recording command +- Stop Recording command +- Pause Recording command +- Resume Recording command +- Toggle Pause command +- Switch Microphone command +- Switch Camera command +- Open Settings command +- Support for Studio and Instant recording modes +- Preference for system audio capture diff --git a/extensions/raycast/cap/LICENSE b/extensions/raycast/cap/LICENSE new file mode 100644 index 0000000000..29a02894c1 --- /dev/null +++ b/extensions/raycast/cap/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Cap Software, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/extensions/raycast/cap/README.md b/extensions/raycast/cap/README.md new file mode 100644 index 0000000000..467a8dea6d --- /dev/null +++ b/extensions/raycast/cap/README.md @@ -0,0 +1,62 @@ +# Cap Raycast Extension + +Control [Cap](https://cap.so) screen recorder directly from Raycast using deeplinks. + +## Features + +- **Start Recording** - Begin a new screen recording +- **Stop Recording** - Stop the current recording +- **Pause Recording** - Pause the active recording +- **Resume Recording** - Resume a paused recording +- **Toggle Pause** - Toggle between pause/resume states +- **Switch Microphone** - Change the active microphone input +- **Switch Camera** - Change the active camera input +- **Open Settings** - Open Cap settings window + +## Requirements + +- [Cap](https://cap.so) desktop app must be installed +- Cap desktop app must be running + +## Setup + +1. Install the Cap desktop app from [cap.so](https://cap.so) +2. Install this Raycast extension +3. Start using the commands! + +## Usage + +All commands work through deeplinks to the Cap desktop app. The extension supports the following preferences: + +- **Default Recording Mode**: Choose between "Studio" or "Instant" recording mode +- **Capture System Audio**: Enable/disable system audio capture by default + +## Commands Reference + +| Command | Description | +|---------|-------------| +| Start Recording | Starts a new recording with configured settings | +| Stop Recording | Stops the current active recording | +| Pause Recording | Pauses the recording without stopping it | +| Resume Recording | Resumes a paused recording | +| Toggle Pause | Toggles between pause and resume states | +| Switch Microphone | Opens a list to select a different microphone | +| Switch Camera | Opens a list to select a different camera | +| Open Settings | Opens the Cap settings window | + +## Development + +```bash +# Install dependencies +npm install + +# Build the extension +npm run build + +# Watch for changes during development +npm run dev +``` + +## License + +MIT diff --git a/extensions/raycast/cap/assets/cap-icon.png b/extensions/raycast/cap/assets/cap-icon.png new file mode 100644 index 0000000000..b1ac1ef7d8 Binary files /dev/null and b/extensions/raycast/cap/assets/cap-icon.png differ diff --git a/extensions/raycast/cap/package.json b/extensions/raycast/cap/package.json new file mode 100644 index 0000000000..af846309f1 --- /dev/null +++ b/extensions/raycast/cap/package.json @@ -0,0 +1,124 @@ +{ + "$schema": "https://www.raycast.com/schemas/extension.json", + "name": "cap", + "title": "Cap", + "description": "Control Cap screen recorder via deeplinks", + "icon": "cap-icon.png", + "author": "CapSoftware", + "categories": [ + "Productivity", + "Media" + ], + "license": "MIT", + "commands": [ + { + "name": "start-recording", + "title": "Start Recording", + "subtitle": "Cap", + "description": "Start a new screen recording with Cap", + "mode": "no-view", + "icon": "record-icon.png" + }, + { + "name": "stop-recording", + "title": "Stop Recording", + "subtitle": "Cap", + "description": "Stop the current recording", + "mode": "no-view", + "icon": "stop-icon.png" + }, + { + "name": "pause-recording", + "title": "Pause Recording", + "subtitle": "Cap", + "description": "Pause the current recording", + "mode": "no-view", + "icon": "pause-icon.png" + }, + { + "name": "resume-recording", + "title": "Resume Recording", + "subtitle": "Cap", + "description": "Resume the paused recording", + "mode": "no-view", + "icon": "resume-icon.png" + }, + { + "name": "toggle-pause", + "title": "Toggle Pause", + "subtitle": "Cap", + "description": "Toggle pause/resume for the current recording", + "mode": "no-view", + "icon": "toggle-icon.png" + }, + { + "name": "switch-microphone", + "title": "Switch Microphone", + "subtitle": "Cap", + "description": "Switch to a different microphone", + "mode": "view", + "icon": "mic-icon.png" + }, + { + "name": "switch-camera", + "title": "Switch Camera", + "subtitle": "Cap", + "description": "Switch to a different camera", + "mode": "view", + "icon": "camera-icon.png" + }, + { + "name": "open-settings", + "title": "Open Settings", + "subtitle": "Cap", + "description": "Open Cap settings", + "mode": "no-view", + "icon": "settings-icon.png" + } + ], + "preferences": [ + { + "name": "recordingMode", + "title": "Default Recording Mode", + "description": "Default mode for new recordings", + "type": "dropdown", + "required": false, + "default": "studio", + "data": [ + { + "title": "Studio", + "value": "studio" + }, + { + "title": "Instant", + "value": "instant" + } + ] + }, + { + "name": "captureSystemAudio", + "title": "Capture System Audio", + "description": "Capture system audio by default", + "type": "checkbox", + "required": false, + "default": false, + "label": "Enable system audio capture" + } + ], + "dependencies": { + "@raycast/api": "^1.64.0", + "@raycast/utils": "^1.10.0" + }, + "devDependencies": { + "@types/node": "20.8.10", + "@types/react": "18.2.27", + "typescript": "^5.2.2" + }, + "scripts": { + "build": "ray build -e dist", + "dev": "ray develop", + "fix-lint": "ray fix-lint", + "lint": "ray lint", + "publish": "ray publish" + } +} diff --git a/extensions/raycast/cap/src/open-settings.tsx b/extensions/raycast/cap/src/open-settings.tsx new file mode 100644 index 0000000000..2d878fbe2e --- /dev/null +++ b/extensions/raycast/cap/src/open-settings.tsx @@ -0,0 +1,21 @@ +import { showToast, Toast } from "@raycast/api"; +import { sendDeepLink } from "./utils"; + +export default async function Command() { + try { + await sendDeepLink("open_settings", { + page: null, + }); + + await showToast({ + style: Toast.Style.Success, + title: "Opening Cap settings...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to open settings", + message: String(error), + }); + } +} diff --git a/extensions/raycast/cap/src/pause-recording.tsx b/extensions/raycast/cap/src/pause-recording.tsx new file mode 100644 index 0000000000..ff7b9a67a9 --- /dev/null +++ b/extensions/raycast/cap/src/pause-recording.tsx @@ -0,0 +1,19 @@ +import { showToast, Toast } from "@raycast/api"; +import { sendDeepLink } from "./utils"; + +export default async function Command() { + try { + await sendDeepLink("pause_recording"); + + await showToast({ + style: Toast.Style.Success, + title: "Pausing recording...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to pause recording", + message: String(error), + }); + } +} diff --git a/extensions/raycast/cap/src/resume-recording.tsx b/extensions/raycast/cap/src/resume-recording.tsx new file mode 100644 index 0000000000..cdbe77ff11 --- /dev/null +++ b/extensions/raycast/cap/src/resume-recording.tsx @@ -0,0 +1,19 @@ +import { showToast, Toast } from "@raycast/api"; +import { sendDeepLink } from "./utils"; + +export default async function Command() { + try { + await sendDeepLink("resume_recording"); + + await showToast({ + style: Toast.Style.Success, + title: "Resuming recording...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to resume recording", + message: String(error), + }); + } +} diff --git a/extensions/raycast/cap/src/start-recording.tsx b/extensions/raycast/cap/src/start-recording.tsx new file mode 100644 index 0000000000..1ea1d9f5a5 --- /dev/null +++ b/extensions/raycast/cap/src/start-recording.tsx @@ -0,0 +1,32 @@ +import { showToast, Toast, getPreferenceValues } from "@raycast/api"; +import { sendDeepLink } from "./utils"; + +interface Preferences { + recordingMode: "studio" | "instant"; + captureSystemAudio: boolean; +} + +export default async function Command() { + try { + const preferences = getPreferenceValues(); + + await sendDeepLink("start_recording", { + capture_mode: { Screen: "Primary" }, + camera: null, + mic_label: null, + capture_system_audio: preferences.captureSystemAudio ?? false, + mode: preferences.recordingMode ?? "studio", + }); + + await showToast({ + style: Toast.Style.Success, + title: "Starting recording...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to start recording", + message: String(error), + }); + } +} diff --git a/extensions/raycast/cap/src/stop-recording.tsx b/extensions/raycast/cap/src/stop-recording.tsx new file mode 100644 index 0000000000..47d057e3f8 --- /dev/null +++ b/extensions/raycast/cap/src/stop-recording.tsx @@ -0,0 +1,19 @@ +import { showToast, Toast } from "@raycast/api"; +import { sendDeepLink } from "./utils"; + +export default async function Command() { + try { + await sendDeepLink("stop_recording"); + + await showToast({ + style: Toast.Style.Success, + title: "Stopping recording...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to stop recording", + message: String(error), + }); + } +} diff --git a/extensions/raycast/cap/src/switch-camera.tsx b/extensions/raycast/cap/src/switch-camera.tsx new file mode 100644 index 0000000000..97655d1fea --- /dev/null +++ b/extensions/raycast/cap/src/switch-camera.tsx @@ -0,0 +1,60 @@ +import { List, ActionPanel, Action, showToast, Toast } from "@raycast/api"; +import { useState, useEffect } from "react"; +import { sendDeepLink } from "./utils"; + +interface Camera { + id: string; + name: string; +} + +export default function Command() { + const [cameras, setCameras] = useState([ + { id: "default", name: "System Default" }, + { id: "none", name: "No Camera" }, + ]); + const [isLoading, setIsLoading] = useState(true); + + useEffect(() => { + // In a future iteration, this could fetch available cameras from Cap + // For now, we provide the basic options + setIsLoading(false); + }, []); + + async function handleSwitchCamera(cameraId: string) { + try { + const camera = cameraId === "none" ? null : cameraId === "default" ? null : { DeviceID: cameraId }; + + await sendDeepLink("switch_camera", { + camera, + }); + + await showToast({ + style: Toast.Style.Success, + title: "Switching camera...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to switch camera", + message: String(error), + }); + } + } + + return ( + + {cameras.map((camera) => ( + + handleSwitchCamera(camera.id)} /> + + } + /> + ))} + + ); +} diff --git a/extensions/raycast/cap/src/switch-microphone.tsx b/extensions/raycast/cap/src/switch-microphone.tsx new file mode 100644 index 0000000000..fd073c2ec8 --- /dev/null +++ b/extensions/raycast/cap/src/switch-microphone.tsx @@ -0,0 +1,60 @@ +import { List, ActionPanel, Action, showToast, Toast } from "@raycast/api"; +import { useState, useEffect } from "react"; +import { sendDeepLink } from "./utils"; + +interface Microphone { + id: string; + name: string; +} + +export default function Command() { + const [microphones, setMicrophones] = useState([ + { id: "default", name: "System Default" }, + { id: "none", name: "No Microphone" }, + ]); + const [isLoading, setIsLoading] = useState(true); + + useEffect(() => { + // In a future iteration, this could fetch available microphones from Cap + // For now, we provide the basic options + setIsLoading(false); + }, []); + + async function handleSwitchMicrophone(micId: string) { + try { + const micLabel = micId === "none" ? null : micId === "default" ? null : micId; + + await sendDeepLink("switch_microphone", { + mic_label: micLabel, + }); + + await showToast({ + style: Toast.Style.Success, + title: "Switching microphone...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to switch microphone", + message: String(error), + }); + } + } + + return ( + + {microphones.map((mic) => ( + + handleSwitchMicrophone(mic.id)} /> + + } + /> + ))} + + ); +} diff --git a/extensions/raycast/cap/src/toggle-pause.tsx b/extensions/raycast/cap/src/toggle-pause.tsx new file mode 100644 index 0000000000..be87defb90 --- /dev/null +++ b/extensions/raycast/cap/src/toggle-pause.tsx @@ -0,0 +1,19 @@ +import { showToast, Toast } from "@raycast/api"; +import { sendDeepLink } from "./utils"; + +export default async function Command() { + try { + await sendDeepLink("toggle_pause_recording"); + + await showToast({ + style: Toast.Style.Success, + title: "Toggling pause...", + }); + } catch (error) { + await showToast({ + style: Toast.Style.Failure, + title: "Failed to toggle pause", + message: String(error), + }); + } +} diff --git a/extensions/raycast/cap/src/types.ts b/extensions/raycast/cap/src/types.ts new file mode 100644 index 0000000000..c6204d1972 --- /dev/null +++ b/extensions/raycast/cap/src/types.ts @@ -0,0 +1,22 @@ +export type RecordingMode = "studio" | "instant" | "screenshot"; +export type CaptureMode = "screen" | "window" | "area" | "camera"; + +export interface StartRecordingOptions { + capture_mode: CaptureMode; + camera?: { DeviceID: string } | { ModelID: string } | null; + mic_label?: string | null; + capture_system_audio?: boolean; + mode?: RecordingMode; +} + +export interface SwitchMicrophoneOptions { + mic_label: string | null; +} + +export interface SwitchCameraOptions { + camera: { DeviceID: string } | { ModelID: string } | null; +} + +export interface OpenSettingsOptions { + page?: string | null; +} diff --git a/extensions/raycast/cap/src/utils.ts b/extensions/raycast/cap/src/utils.ts new file mode 100644 index 0000000000..fb75039349 --- /dev/null +++ b/extensions/raycast/cap/src/utils.ts @@ -0,0 +1,42 @@ +import { open } from "@raycast/api"; +import { RecordingMode, CaptureMode } from "./types"; + +const DEEP_LINK_SCHEME = "cap-desktop"; + +export function buildDeepLink(action: string, params?: Record): string { + const value = JSON.stringify({ + action, + ...params, + }); + return `${DEEP_LINK_SCHEME}://action?value=${encodeURIComponent(value)}`; +} + +export async function sendDeepLink(action: string, params?: Record): Promise { + const url = buildDeepLink(action, params); + await open(url); +} + +export function buildStartRecordingDeeplink(options: { + mode: RecordingMode; + captureMode: CaptureMode; + screenName?: string; + windowName?: string; + cameraId?: string; + micLabel?: string; + captureSystemAudio?: boolean; +}): string { + const capture_mode = + options.captureMode === "screen" && options.screenName + ? { Screen: options.screenName } + : options.captureMode === "window" && options.windowName + ? { Window: options.windowName } + : { Screen: "Primary" }; + + return buildDeepLink("start_recording", { + capture_mode, + camera: options.cameraId ? { DeviceID: options.cameraId } : null, + mic_label: options.micLabel || null, + capture_system_audio: options.captureSystemAudio ?? false, + mode: options.mode, + }); +} diff --git a/extensions/raycast/cap/tsconfig.json b/extensions/raycast/cap/tsconfig.json new file mode 100644 index 0000000000..79a93ad9fb --- /dev/null +++ b/extensions/raycast/cap/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["ES2022"], + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "outDir": "dist", + "declaration": true + }, + "include": ["src/**/*"] +}