Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/desktop/src-tauri/src/deeplink_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ pub enum DeepLinkAction {
mode: RecordingMode,
},
StopRecording,
PauseRecording,
ResumeRecording,
TogglePauseRecording,
OpenEditor {
project_path: PathBuf,
},
Expand Down Expand Up @@ -147,6 +150,15 @@ 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::OpenEditor { project_path } => {
crate::open_project_from_path(Path::new(&project_path), app.clone())
}
Expand Down
1 change: 1 addition & 0 deletions extensions/raycast/assets/command-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions extensions/raycast/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "cap",
"title": "Cap",
"description": "Control Cap screen recording from Raycast",
"icon": "command-icon.png",
"author": "TateLyman",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 command-icon.png is referenced but not included in the PR

package.json declares "icon": "command-icon.png", but no such file appears in extensions/raycast/. Raycast validates the icon at build and submission time — the extension will fail to build or be rejected from the store without it. The icon must be a 512×512 PNG placed at the root of the extension directory.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/raycast/package.json
Line: 7

Comment:
**`command-icon.png` is referenced but not included in the PR**

`package.json` declares `"icon": "command-icon.png"`, but no such file appears in `extensions/raycast/`. Raycast validates the icon at build and submission time — the extension will fail to build or be rejected from the store without it. The icon must be a `512×512` PNG placed at the root of the extension directory.

How can I resolve this? If you propose a fix, please make it concise.

"categories": ["Productivity"],
"license": "MIT",
"commands": [
{ "name": "start-recording", "title": "Start Recording", "description": "Start a new screen recording", "mode": "no-view" },
{ "name": "stop-recording", "title": "Stop Recording", "description": "Stop the current recording", "mode": "no-view" },
{ "name": "toggle-pause", "title": "Toggle Pause", "description": "Pause or resume the current recording", "mode": "no-view" },
{ "name": "open-settings", "title": "Open Settings", "description": "Open Cap settings", "mode": "no-view" }
],
"dependencies": {
"@raycast/api": "^1.50.0"
},
"devDependencies": {
"@raycast/eslint-config": "^1.0.6",
"typescript": "^5.0.0"
}
}
Comment on lines +1 to +23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing tsconfig.json and lock file

A standard Raycast TypeScript extension requires both a tsconfig.json (Raycast's scaffolder ships one that sets "moduleResolution": "bundler" and "jsx": "react-jsx") and a lock file (package-lock.json or yarn.lock) so that CI and reviewers can reproduce the exact dependency tree. Neither is present in this PR.

Without tsconfig.json the TypeScript compiler will use loose defaults, which can mask type errors. Without a lock file, @raycast/api will float to whatever ^1.50.0 resolves to at install time, potentially breaking the build later.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/raycast/package.json
Line: 1-23

Comment:
**Missing `tsconfig.json` and lock file**

A standard Raycast TypeScript extension requires both a `tsconfig.json` (Raycast's scaffolder ships one that sets `"moduleResolution": "bundler"` and `"jsx": "react-jsx"`) and a lock file (`package-lock.json` or `yarn.lock`) so that CI and reviewers can reproduce the exact dependency tree. Neither is present in this PR.

Without `tsconfig.json` the TypeScript compiler will use loose defaults, which can mask type errors. Without a lock file, `@raycast/api` will float to whatever `^1.50.0` resolves to at install time, potentially breaking the build later.

How can I resolve this? If you propose a fix, please make it concise.

7 changes: 7 additions & 0 deletions extensions/raycast/src/open-settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { showHUD } from "@raycast/api";
import { sendDeepLink } from "./utils";

export default async function Command() {
await sendDeepLink({ open_settings: { page: null } });
await showHUD("Opening Cap settings");
}
15 changes: 15 additions & 0 deletions extensions/raycast/src/start-recording.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { showHUD, getPreferenceValues } from "@raycast/api";
import { sendDeepLink } from "./utils";

export default async function Command() {
await sendDeepLink({
start_recording: {
capture_mode: { screen: "" },
camera: null,
mic_label: null,
capture_system_audio: false,
mode: "studio",
},
});
await showHUD("Recording started");
}
7 changes: 7 additions & 0 deletions extensions/raycast/src/stop-recording.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { showHUD } from "@raycast/api";
import { sendDeepLink } from "./utils";

export default async function Command() {
await sendDeepLink({ stop_recording: {} });
await showHUD("Recording stopped");
}
7 changes: 7 additions & 0 deletions extensions/raycast/src/toggle-pause.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { showHUD } from "@raycast/api";
import { sendDeepLink } from "./utils";

export default async function Command() {
await sendDeepLink({ toggle_pause_recording: {} });
await showHUD("Recording pause toggled");
}
15 changes: 15 additions & 0 deletions extensions/raycast/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { open, showToast, Toast } from "@raycast/api";

export async function sendDeepLink(action: Record<string, unknown>) {
const value = encodeURIComponent(JSON.stringify(action));
const url = `cap://action?value=${value}`;
try {
await open(url);
} catch {
await showToast({
style: Toast.Style.Failure,
title: "Cap Not Running",
message: "Please open Cap and try again",
});
}
}
15 changes: 15 additions & 0 deletions extensions/raycast/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "dist",
"rootDir": "src",
"jsx": "react-jsx",
"lib": ["ES2020"]
},
"include": ["src/**/*"]
}