Download src/mitm/detection/cursor.ts from rais133/omniroute: direct link, hf CLI and curl.
- Browser
- Download file 810 Bytes
-
https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/mitm/detection/cursor.ts
- Command line
-
hf download hf://spaces/rais133/omniroute/src/mitm/detection/cursor.ts
-
curl -L -o cursor.ts https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/mitm/detection/cursor.ts
810 Bytes
| /** | |
| * Cursor IDE installation detection. | |
| * Purely filesystem-based — no shell interpolation (Hard Rule #13). | |
| */ | |
| import fs from "node:fs"; | |
| import os from "node:os"; | |
| import path from "node:path"; | |
| import type { DetectionResult } from "../types"; | |
| const HOME = os.homedir(); | |
| const PATHS = [ | |
| "/Applications/Cursor.app", | |
| path.join(HOME, "Applications", "Cursor.app"), | |
| "/usr/bin/cursor", | |
| "/usr/local/bin/cursor", | |
| path.join(HOME, ".local", "bin", "cursor"), | |
| path.join(HOME, ".cursor"), | |
| path.join( | |
| process.env.LOCALAPPDATA ?? path.join(HOME, "AppData", "Local"), | |
| "Programs", | |
| "cursor", | |
| "Cursor.exe" | |
| ), | |
| ]; | |
| export function detectCursor(): DetectionResult { | |
| for (const p of PATHS) { | |
| if (fs.existsSync(p)) return { installed: true, path: p }; | |
| } | |
| return { installed: false }; | |
| } | |