### Define and structure ResultMap Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Defines the nested mapping of OS to platform version info and provides an example object structure. ```typescript interface ResultMap { [os: string]: { [platform: string]: VersionInfo; }; } ``` ```typescript { windows: { 'win32-x64-user': { url: '...', version: '3.10.20' }, 'win32-arm64-user': { url: '...', version: '3.10.20' } }, mac: { 'darwin-universal': { url: '...', version: '3.10.20' } }, linux: { 'linux-x64': { url: '...', version: '3.10.20' } } } ``` -------------------------------- ### GET https://www.cursor.com/api/download Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md Retrieves the download URL for a specific Cursor platform and release track. ```APIDOC ## GET https://www.cursor.com/api/download ### Description Fetches the production download URL for a specified platform and release track. ### Method GET ### Endpoint https://www.cursor.com/api/download ### Parameters #### Query Parameters - **platform** (string) - Required - Any platform identifier (e.g., darwin-universal, win32-x64-user) - **releaseTrack** (string) - Required - 'latest' for current version or a specific version string (e.g., 3.10.20) ### Request Headers - **User-Agent** (string) - Required - Must be 'Cursor-Version-Checker' - **Cache-Control** (string) - Required - Must be 'no-cache' ### Response #### Success Response (200) - **downloadUrl** (string) - The full URL to the production build #### Response Example { "downloadUrl": "https://downloads.cursor.com/production/{buildId}/..." } ``` -------------------------------- ### GET /api/download Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md The structure of the response received from the Cursor download API endpoint. ```APIDOC ## GET /api/download ### Description Returns the direct download URL for a requested platform. ### Method GET ### Endpoint /api/download ### Response #### Success Response (200) - **downloadUrl** (string) - Direct download URL for the requested platform ### Response Example { "downloadUrl": "https://downloads.cursor.com/production/abc123def456/darwin/universal/Cursor-darwin-universal.dmg" } ``` -------------------------------- ### main(): Promise Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md The main entry point for the update process. ```APIDOC ## main(): Promise ### Description Main entry point for the update process with comprehensive error handling and verification. It calls `updateReadme()`, verifies the integrity of `version-history.json`, and compares the latest version in the README with the history file. ``` -------------------------------- ### Build Commands Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md Commands to trigger the build process using either npm or bun. ```bash npm run build # or bun run build ``` -------------------------------- ### Execute Main Update Script Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/INDEX.md Run the primary update module using Bun or npm. ```bash bun src/update-cursor-links.ts # or npm run start ``` -------------------------------- ### Run the backfill script Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Execute the script as a standalone process to update the version history file. ```bash bun src/backfill-linux-arm64.ts ``` -------------------------------- ### Project File Structure Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/00-START-HERE.md Displays the directory layout of the project documentation. ```text /workspace/home/output/ ├── 00-START-HERE.md (this file) ├── README.md (project overview) ├── INDEX.md (complete index) ├── types.md (type definitions) ├── configuration.md (config reference) ├── SUMMARY.txt (generation summary) └── api-reference/ ├── update-cursor-links.md ├── backfill-linux-arm64.md ├── backfill-missing-linux-links.md └── update-readme-utilities.md ``` -------------------------------- ### backfillMissingLinuxLinks() Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-missing-linux-links.md Main function to process all versions and generate missing Linux download URLs. ```APIDOC ## backfillMissingLinuxLinks() ### Description Main async function that processes all versions and generates missing Linux download URLs. It reads the history, filters for versions missing Linux links, generates them, and saves the updated history. ### Return Type Promise ``` -------------------------------- ### generateLinuxLinks(version, date, platforms) Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-missing-linux-links.md Generates Linux-x64 and Linux-ARM64 download URLs for a specific version by extracting the build ID from existing platform URLs. ```APIDOC ## generateLinuxLinks(version: string, date: string, platforms: Record) ### Description Attempts to generate linux-x64 and linux-arm64 download URLs for a version based on existing platform URLs and date information. ### Parameters - **version** (string) - Required - Cursor version (e.g., 3.10.20) - **date** (string) - Required - Release date in YYYY-MM-DD format - **platforms** (Record) - Required - Map of existing platform URLs ### Return Type { x64: string | null, arm64: string | null } - Generated URLs or null for each architecture if generation failed. ``` -------------------------------- ### Execute Backfill Script Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-missing-linux-links.md Runs the backfill process as a standalone command to update missing Linux download links. ```bash bun src/backfill-missing-linux-links.ts ``` -------------------------------- ### generateArm64UrlFromX64(x64Url: string) Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Attempts to generate a linux-arm64 URL from an existing linux-x64 URL by applying known pattern transformations. ```APIDOC ## generateArm64UrlFromX64(x64Url: string) ### Description Attempts to generate a linux-arm64 URL from an existing linux-x64 URL by applying known pattern transformations for glibc and downloader patterns. ### Parameters - **x64Url** (string) - Required - Linux x64 download URL to transform ### Return Type string | null - Generated ARM64 URL if pattern matched, or null if no pattern applied. ``` -------------------------------- ### Build Output Directory Structure Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md The distribution directory contains the compiled JavaScript files for various update and backfill tasks. ```text dist/ ├── update-cursor-links.js ├── backfill-linux-arm64.js ├── backfill-missing-linux-links.js ├── update-readme-from-history.js └── update-readme-with-linux-links.js ``` -------------------------------- ### Generate Linux Download URLs Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-missing-linux-links.md Uses existing platform URLs to derive build IDs and generate corresponding Linux x64 and ARM64 AppImage download links. ```text https://anysphere-binaries.s3.us-east-1.amazonaws.com/production/client/linux/x64/appimage/Cursor-{version}-{buildId}.deb.glibc2.25-x86_64.AppImage ``` ```text https://anysphere-binaries.s3.us-east-1.amazonaws.com/production/client/linux/arm64/appimage/Cursor-{version}-{buildId}.deb.glibc2.28-aarch64.AppImage ``` ```typescript import { generateLinuxLinks } from './src/backfill-missing-linux-links.ts'; const platforms = { 'darwin-universal': 'https://downloads.cursor.com/production/abc123def456/darwin/universal/Cursor-darwin-universal.dmg', 'win32-x64-user': 'https://downloads.cursor.com/production/abc123def456/win32/x64/user-setup/CursorUserSetup-x64-3.10.20.exe' }; const { x64, arm64 } = generateLinuxLinks('3.10.20', '2026-07-08', platforms); if (x64 && arm64) { console.log('Generated x64:', x64); console.log('Generated ARM64:', arm64); } ``` -------------------------------- ### Define package configuration in package.json Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md Configures project metadata, dependencies, and execution scripts for the Bun/Node.js environment. ```json { "name": "cursor-downloads-tracker", "version": "1.0.0", "devDependencies": { "@types/node": "^18.18.0", "typescript": "^5.2.2", "bun-types": "latest" }, "description": "Automatically tracks and updates Cursor download links", "scripts": { "build": "tsc", "start": "bun src/update-cursor-links.ts", "update": "bun src/update-cursor-links.ts", "test": "echo \"No tests specified\" && exit 0" }, "type": "module" } ``` -------------------------------- ### Backfill Missing URLs Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/README.md CLI commands to populate missing Linux links and update the README. ```bash # Fill in missing Linux ARM64 URLs bun src/backfill-linux-arm64.ts # Generate Linux URLs from Windows/macOS info bun src/backfill-missing-linux-links.ts # Update README with all available links bun src/update-readme-with-linux-links.ts ``` -------------------------------- ### Execute Linux ARM64 Backfill Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Invokes the backfill process to update version-history.json with missing ARM64 download URLs. ```typescript import { backfillLinuxARM64 } from './src/backfill-linux-arm64.ts'; await backfillLinuxARM64(); // Processes all versions and updates version-history.json with ARM64 URLs ``` -------------------------------- ### fetchVersionDownloadUrl(platform: string, version: string) Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Fetches a specific version's download URL for a platform from the Cursor API using a version-specific release track. ```APIDOC ## fetchVersionDownloadUrl(platform: string, version: string) ### Description Fetches a specific version's download URL for a platform from the Cursor API using a version-specific release track. ### Parameters - **platform** (string) - Required - Platform identifier (e.g., linux-arm64, linux-x64) - **version** (string) - Required - Specific version to fetch (e.g., 3.10.20) ### Return Type Promise - The download URL if successful, or null if the fetch fails. ``` -------------------------------- ### Generate and Backfill Linux URLs Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/INDEX.md Execute the sequence of scripts to generate missing Linux URLs, backfill ARM64 variants, and update the README file. ```bash # Step 1: Generate from build IDs bun src/backfill-missing-linux-links.ts # Step 2: Backfill ARM64 variants bun src/backfill-linux-arm64.ts # Step 3: Update README bun src/update-readme-with-linux-links.ts ``` -------------------------------- ### Execute standalone update scripts Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md Commands to run individual update utilities using the Bun runtime. ```bash bun src/update-readme-from-history.ts ``` ```bash bun src/update-readme-with-linux-links.ts ``` -------------------------------- ### Generate ARM64 URL from x64 Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Transforms an existing linux-x64 download URL into a linux-arm64 variant using predefined pattern matching rules. ```typescript import { generateArm64UrlFromX64 } from './src/backfill-linux-arm64.ts'; const x64 = 'https://anysphere-binaries.s3.us-east-1.amazonaws.com/production/client/linux/x64/appimage/Cursor-3.10.20-abc123.deb.glibc2.25-x86_64.AppImage'; const arm64 = generateArm64UrlFromX64(x64); console.log(arm64); // 'https://anysphere-binaries.s3.us-east-1.amazonaws.com/production/client/linux/arm64/appimage/Cursor-3.10.20-abc123.deb.glibc2.28-aarch64.AppImage' ``` -------------------------------- ### Define VersionInfo interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Stores the download URL and version string for a specific platform. ```typescript interface VersionInfo { url: string; version: string; } ``` -------------------------------- ### Execute combined update workflow Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md Sequential execution of scripts to fetch, backfill, and update README links. ```bash # Step 1: Update cursor links (fetches from API) bun src/update-cursor-links.ts # Step 2: Generate missing Linux links bun src/backfill-missing-linux-links.ts # Step 3: Backfill ARM64 variants bun src/backfill-linux-arm64.ts # Step 4: Update README with generated links bun src/update-readme-with-linux-links.ts ``` -------------------------------- ### Define URL Patterns Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/README.md Standard URL structures for official Cursor downloads, S3 buckets, and the newer downloader service. ```text https://downloads.cursor.com/production/{buildId}/{os}/{arch}/... ``` ```text https://anysphere-binaries.s3.us-east-1.amazonaws.com/production/client/linux/{arch}/appimage/... ``` ```text https://downloader.cursor.sh/builds/{buildCode}/linux/appImage/{arch} ``` -------------------------------- ### updateReadmeFromHistory() Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md Updates the README.md file by appending linux-arm64 download links to versions that currently only display linux-x64 links. ```APIDOC ## updateReadmeFromHistory() ### Description Updates README.md with linux-arm64 URLs for versions that have only linux-x64 currently displayed. It searches for existing [linux-x64] links and appends
[linux-arm64] variants retrieved from version-history.json. ### Signature `updateReadmeFromHistory(): void` ### Parameters None ### Behavior - Creates a backup of the current README.md as README.md.backup before modification. - Uses regex patterns to identify version rows containing only linux-x64 links. - Appends the corresponding linux-arm64 link if it is not already present. - Logs a summary of the number of versions updated. ### Example ```typescript import { updateReadmeFromHistory } from './src/update-readme-from-history.ts'; updateReadmeFromHistory(); ``` ``` -------------------------------- ### Define PlatformMap interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md Mapping from OS key to platform information. ```typescript interface PlatformMap { [key: string]: PlatformInfo; } ``` ```typescript { 'windows': PlatformInfo, 'mac': PlatformInfo, 'linux': PlatformInfo } ``` -------------------------------- ### extractVersion(url: string): string Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Parses a download URL or filename to extract the semantic version string. ```APIDOC ## extractVersion(url: string): string ### Description Extracts the version number from a download URL or filename using pattern matching. ### Parameters - **url** (string) - Required - Download URL or filename to parse ### Returns - **string** - Semantic version string (e.g., 3.10.20) or 'Unknown' if no version found. ``` -------------------------------- ### Execute README Linux Link Update Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md Invoke the update utility to process the README.md file, remove duplicate entries, and populate missing Linux download links. ```typescript import { updateReadmeWithLinuxLinks } from './src/update-readme-with-linux-links.ts'; await updateReadmeWithLinuxLinks(); // Processes README.md, removes duplicates, and fills in Linux links ``` -------------------------------- ### Load and Inspect Version History Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/INDEX.md Import the version history utility to read and log version data from the project history. ```typescript import { readVersionHistory } from './src/update-cursor-links.ts'; const history = readVersionHistory(); console.log(`Total versions: ${history.versions.length}`); console.log(`Latest: ${history.versions[0].version}`); history.versions.slice(0, 5).forEach(v => { console.log(` ${v.version} - ${v.date} - ${Object.keys(v.platforms).length} platforms`); }); ``` -------------------------------- ### fetchLatestDownloadUrl(platform: string) Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Fetches the latest download URL for a specified platform from the Cursor API. ```APIDOC ## fetchLatestDownloadUrl(platform: string) ### Description Fetches the latest download URL for a specified platform from the Cursor API. It handles specific platform logic and includes necessary headers for the request. ### Parameters - **platform** (string) - Required - Platform identifier (e.g., `darwin-universal`, `win32-x64-user`, `linux-x64`) ### Return Type `Promise` - The download URL if successful, or `null` if the fetch fails. ### Example ```typescript import { fetchLatestDownloadUrl } from './src/update-cursor-links.ts'; const url = await fetchLatestDownloadUrl('darwin-universal'); if (url) { console.log('Download URL:', url); } else { console.log('Failed to fetch URL'); } ``` ``` -------------------------------- ### Define Platform Identifiers Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/README.md List of supported platform strings used across all functions. ```text macOS: "darwin-universal", "darwin-x64", "darwin-arm64" Windows: "win32-x64-user", "win32-x64-system", "win32-arm64-user", "win32-arm64-system" "win32-x64", "win32-arm64" (aliases) Linux: "linux-x64", "linux-arm64" ``` -------------------------------- ### Define PlatformBadgeConfig interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md Configuration schema for generating shields.io badges for download buttons. ```typescript interface PlatformBadgeConfig { color: string; logo: string; label: string; } ``` ```typescript const config: PlatformBadgeConfig = { color: '000000', logo: 'apple', label: 'macOS Universal' }; ``` -------------------------------- ### Define VersionInfo interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md Extracted download information for a single platform. ```typescript interface VersionInfo { url: string; version: string; } ``` ```typescript const info: VersionInfo = { url: 'https://downloads.cursor.com/production/abc123/darwin/universal/Cursor-darwin-universal.dmg', version: '3.10.20' }; ``` -------------------------------- ### Run Main Update Process in TypeScript Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Executes the primary update workflow, including README synchronization and verification. ```typescript import { main } from './src/update-cursor-links.ts'; await main(); ``` -------------------------------- ### Regex patterns for update-readme-with-linux-links Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md Patterns used for removing duplicates and replacing placeholder text in the README. ```regex \| 0\.46\.10 \| 2025-03-06 \|.*?\| .*?linux-x64.*?\) \|\n ``` ```regex \| ([\d\.]+) \| ([\d-]+) \| (.*?) \| (.*?) \| Not Ready \| ``` -------------------------------- ### Regex patterns for update-readme-from-history Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md Patterns used to identify existing Linux link entries in the README table. ```regex \| version | date | ... | ... | \[linux-x64\]\(url\) \| ``` ```regex \| version | date | ... | ... | .*?\[linux-arm64\]\(url\).*? \| ``` -------------------------------- ### Backfill Missing Linux Links Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-missing-linux-links.md Processes the version history to identify and fill missing Linux download URLs for eligible versions. ```text Backfill summary: Updated {count}, Skipped {count} ``` ```typescript import { backfillMissingLinuxLinks } from './src/backfill-missing-linux-links.ts'; await backfillMissingLinuxLinks(); // Processes all versions and updates version-history.json with generated Linux URLs ``` -------------------------------- ### Update README from History Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md Executes the update process to append linux-arm64 links to existing linux-x64 entries in the README.md file. ```typescript import { updateReadmeFromHistory } from './src/update-readme-from-history.ts'; updateReadmeFromHistory(); // Processes README.md and adds linux-arm64 links where only x64 existed ``` -------------------------------- ### updateReadmeWithLinuxLinks() Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-readme-utilities.md An asynchronous function that updates the README.md file by removing duplicate entries and replacing 'Not Ready' placeholders with actual Linux download links based on version-history.json data. ```APIDOC ## updateReadmeWithLinuxLinks() ### Description Updates the README.md file by removing duplicate version entries and replacing 'Not Ready' placeholders with Linux download links. It creates a backup of the original file at `README.md.linux-update-backup` before applying changes. ### Signature `updateReadmeWithLinuxLinks(): Promise` ### Parameters None ### Return Type `Promise` ### Usage Example ```typescript import { updateReadmeWithLinuxLinks } from './src/update-readme-with-linux-links.ts'; await updateReadmeWithLinuxLinks(); ``` ``` -------------------------------- ### Extract Version from URL in TypeScript Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Parses a semantic version string from a given download URL or filename. ```typescript import { extractVersion } from './src/update-cursor-links.ts'; const v1 = extractVersion('CursorSetup-x64-3.10.20.exe'); console.log(v1); // '3.10.20' const v2 = extractVersion('https://downloads.cursor.com/.../Cursor-3.10.20-x86_64.AppImage'); console.log(v2); // '3.10.20' ``` -------------------------------- ### Fetch Specific Platform URL Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/README.md Retrieve the latest download URL for a specific platform identifier. ```typescript import { fetchLatestDownloadUrl, extractVersion } from './src/update-cursor-links.ts'; const url = await fetchLatestDownloadUrl('darwin-universal'); const version = extractVersion(url); console.log(`macOS Universal: v${version}`); ``` -------------------------------- ### Define PLATFORMS constant Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Maps operating systems to their supported platform configurations and UI sections. ```typescript const PLATFORMS: PlatformMap = { windows: { platforms: ['win32-x64-user', 'win32-arm64-user', 'win32-x64-system', 'win32-arm64-system', 'win32-x64', 'win32-arm64'], readableNames: ['win32-x64-user', 'win32-arm64-user', 'win32-x64-system', 'win32-arm64-system', 'win32-x64', 'win32-arm64'], section: 'Windows Installer' }, mac: { platforms: ['darwin-universal', 'darwin-x64', 'darwin-arm64'], readableNames: ['darwin-universal', 'darwin-x64', 'darwin-arm64'], section: 'Mac Installer' }, linux: { platforms: ['linux-x64', 'linux-arm64'], readableNames: ['linux-x64', 'linux-arm64'], section: 'Linux Installer' } }; ``` -------------------------------- ### Fetch Version Download URL Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Retrieves a specific version's download URL from the Cursor API. Returns null if the request fails or times out. ```typescript import { fetchVersionDownloadUrl } from './src/backfill-linux-arm64.ts'; const url = await fetchVersionDownloadUrl('linux-arm64', '3.10.20'); if (url) { console.log('ARM64 URL:', url); } ``` -------------------------------- ### Fetch latest download URL with TypeScript Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Retrieves the download URL for a specific platform. Returns null if the request fails or the platform is invalid. ```typescript import { fetchLatestDownloadUrl } from './src/update-cursor-links.ts'; const url = await fetchLatestDownloadUrl('darwin-universal'); if (url) { console.log('Download URL:', url); } else { console.log('Failed to fetch URL'); } ``` -------------------------------- ### Cursor Download API Endpoint Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md The base URL for fetching the latest Cursor download link for a specific platform. ```text https://www.cursor.com/api/download?platform={platform}&releaseTrack=latest ``` -------------------------------- ### updateReadme() Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Updates the README.md file with the latest Cursor download links and complete version history. ```APIDOC ## updateReadme() ### Description Main function that updates README.md with the latest Cursor download links and complete version history. It fetches URLs for all platforms, detects new versions, updates `version-history.json`, and regenerates README tables and cards. ### Parameters None ### Return Type `Promise` - `true` if a new version was detected and README was updated, `false` otherwise. ### Example ```typescript import { updateReadme } from './src/update-cursor-links.ts'; const updated = await updateReadme(); if (updated) { console.log('README was updated with a new version'); } else { console.log('No new version detected'); } ``` ``` -------------------------------- ### Define Version History Structure Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/README.md JSON schema for the version history file, containing an array of version objects with platform-specific download URLs. ```json { "versions": [ { "version": "3.10.20", "date": "2026-07-08", "platforms": { "darwin-universal": "https://...", "win32-x64-user": "https://...", "linux-x64": "https://..." // ... up to 11 platform entries } } // ... up to 100 versions, newest first ] } ``` -------------------------------- ### VersionHistoryEntry Interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Defines the structure for a single version entry, including its release date and platform-specific download URLs. ```typescript interface VersionHistoryEntry { version: string; date: string; platforms: { [platform: string]: string; }; } ``` -------------------------------- ### Define PlatformInfo interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md Metadata describing a platform category such as Windows, macOS, or Linux. ```typescript interface PlatformInfo { platforms: string[]; readableNames: string[]; section: string; } ``` ```typescript const macInfo: PlatformInfo = { platforms: ['darwin-universal', 'darwin-x64', 'darwin-arm64'], readableNames: ['darwin-universal', 'darwin-x64', 'darwin-arm64'], section: 'Mac Installer' }; ``` -------------------------------- ### VersionHistory Interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Represents the complete collection of version history entries. ```typescript interface VersionHistory { versions: VersionHistoryEntry[]; } ``` -------------------------------- ### Cursor Download API Response Format Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md The expected JSON structure returned by the Cursor download API endpoint. ```typescript { "downloadUrl": "https://downloads.cursor.com/production/{buildId}/..." } ``` -------------------------------- ### Check Latest Version Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/README.md Automated check for new versions and README updates. ```typescript import { updateReadme } from './src/update-cursor-links.ts'; const updated = await updateReadme(); if (updated) { console.log('New version detected and README updated'); } ``` -------------------------------- ### readVersionHistory() Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Reads the version history from version-history.json in the current working directory. ```APIDOC ## readVersionHistory() ### Description Reads the version history from version-history.json in the current working directory. Returns an empty history if the file does not exist or fails to parse. ### Return Type VersionHistory - Object containing an array of version entries. ``` -------------------------------- ### Define version-history.json structure Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md The JSON schema for tracking Cursor AI versions and their corresponding platform-specific download URLs. ```json { "versions": [ { "version": "3.10.20", "date": "2026-07-08", "platforms": { "darwin-universal": "https://...", "darwin-x64": "https://...", "darwin-arm64": "https://...", "win32-x64-user": "https://...", "win32-arm64-user": "https://...", "win32-x64-system": "https://...", "win32-arm64-system": "https://...", "win32-x64": "https://...", "win32-arm64": "https://...", "linux-x64": "https://...", "linux-arm64": "https://..." } } ] } ``` -------------------------------- ### DownloadResponse Interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Represents the expected structure of the API response containing a download URL. ```typescript interface DownloadResponse { downloadUrl: string; } ``` -------------------------------- ### Save Version History Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Persists the version history object to disk, creating a backup file before overwriting the existing data. ```typescript import { saveVersionHistory, readVersionHistory } from './src/backfill-linux-arm64.ts'; const history = readVersionHistory(); // ... modify history ... saveVersionHistory(history); ``` -------------------------------- ### saveVersionHistory(history: VersionHistory) Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Saves the provided version history object to version-history.json with a backup. ```APIDOC ## saveVersionHistory(history: VersionHistory) ### Description Saves version history to version-history.json. Creates a .backup file before overwriting if the original file exists. ### Parameters - **history** (VersionHistory) - Required - Version history object to persist ### Return Type void ``` -------------------------------- ### Read Version History Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/backfill-linux-arm64.md Loads the version history from the local JSON file. Returns an empty history object if the file is missing or corrupted. ```typescript { versions: VersionHistoryEntry[] } ``` ```typescript import { readVersionHistory } from './src/backfill-linux-arm64.ts'; const history = readVersionHistory(); const versionsNeedingArm64 = history.versions.filter( v => !v.platforms['linux-arm64'] && v.platforms['linux-x64'] ); ``` -------------------------------- ### Define PlatformInfo interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Represents metadata for a platform category including supported platforms and their readable names. ```typescript interface PlatformInfo { platforms: string[]; readableNames: string[]; section: string; } ``` -------------------------------- ### Update README with TypeScript Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Triggers the full update process for the README.md file, including version history checks and table regeneration. ```typescript import { updateReadme } from './src/update-cursor-links.ts'; const updated = await updateReadme(); if (updated) { console.log('README was updated with a new version'); } else { console.log('No new version detected'); } ``` -------------------------------- ### Configure TypeScript compiler in tsconfig.json Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md Sets compiler options for TypeScript, targeting ES2022 and NodeNext module resolution. ```json { "compilerOptions": { "target": "es2022", "module": "NodeNext", "moduleResolution": "NodeNext", "esModuleInterop": true, "strict": true, "skipLibCheck": true, "isolatedModules": true, "outDir": "dist", "forceConsistentCasingInFileNames": true, "lib": ["esnext"], "types": ["node"] }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] } ``` -------------------------------- ### Define ResultMap interface Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md Represents a nested mapping of operating systems to platforms and their corresponding version information. ```typescript interface ResultMap { [os: string]: { [platform: string]: VersionInfo; }; } ``` ```typescript { 'windows': { 'win32-x64-user': { url: '...', version: '3.10.20' }, 'win32-arm64-user': { url: '...', version: '3.10.20' }, 'win32-x64-system': { url: '...', version: '3.10.20' }, 'win32-arm64-system': { url: '...', version: '3.10.20' } }, 'mac': { 'darwin-universal': { url: '...', version: '3.10.20' }, 'darwin-x64': { url: '...', version: '3.10.20' }, 'darwin-arm64': { url: '...', version: '3.10.20' } }, 'linux': { 'linux-x64': { url: '...', version: '3.10.20' }, 'linux-arm64': { url: '...', version: '3.10.20' } } } ``` -------------------------------- ### saveVersionHistory(history: VersionHistory): void Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Persists the version history object to a JSON file with atomic write operations and validation. ```APIDOC ## saveVersionHistory(history: VersionHistory): void ### Description Saves version history to `version-history.json` with validation and atomic writes. It creates a backup file before overwriting and verifies the file exists after the write operation. ### Parameters - **history** (VersionHistory) - Required - Version history object to persist ### Throws - Throws Error if JSON parse validation fails after stringification - Throws Error if file write fails after atomic write attempt ``` -------------------------------- ### Define Type Dependency Graph Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md Visual representation of the data structures and their relationships within the system. ```text VersionHistory └── VersionHistoryEntry[] └── platforms: Record ResultMap └── [osKey: string] └── [platform: PlatformType] └── VersionInfo ├── url: string └── version: string PLATFORMS: PlatformMap └── [osKey: string] └── PlatformInfo ├── platforms: PlatformType[] ├── readableNames: string[] └── section: string PlatformBadgeConfig └── Used by generateDownloadBadge() └── PlatformType ``` -------------------------------- ### GitHub Actions Workflow Permissions Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/configuration.md Required permissions for the CI/CD workflow to commit and push changes to the repository. ```yaml permissions: contents: write ``` -------------------------------- ### Save Version History in TypeScript Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Persists version history to a JSON file using atomic write operations and validation. ```typescript import { saveVersionHistory, readVersionHistory } from './src/update-cursor-links.ts'; const history = readVersionHistory(); history.versions.push({ version: '3.10.20', date: '2026-07-08', platforms: { 'darwin-universal': 'https://...' } }); saveVersionHistory(history); ``` -------------------------------- ### updateVersionHistory(version: string, date: string, results: ResultMap): void Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Updates the version history JSON with new version information. Note: This function is deprecated. ```APIDOC ## updateVersionHistory(version: string, date: string, results: ResultMap): void ### Description Updates version history JSON with new version information and saves to disk. This function is deprecated; use `updateReadme()` instead. ### Parameters - **version** (string) - Required - Version number (e.g., 3.10.20) - **date** (string) - Required - Release date in YYYY-MM-DD format - **results** (ResultMap) - Required - Platform results map from all fetch operations ``` -------------------------------- ### formatDate(date: Date): string Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Formats a JavaScript Date object into a YYYY-MM-DD string. ```APIDOC ## formatDate(date: Date): string ### Description Formats a Date object as a YYYY-MM-DD string. ### Parameters - **date** (Date) - Required - JavaScript Date object to format ### Returns - **string** - Date formatted as YYYY-MM-DD. ``` -------------------------------- ### Define PlatformType Union Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/types.md A type-safe union of all supported platform identifiers used for platform-specific logic and configuration. ```typescript type PlatformType = | 'darwin-universal' | 'darwin-x64' | 'darwin-arm64' | 'win32-x64-system' | 'win32-arm64-system' | 'win32-x64-user' | 'win32-arm64-user' | 'linux-x64' | 'linux-arm64' | 'win32-x64' | 'win32-arm64'; ``` -------------------------------- ### Update Version History (Deprecated) in TypeScript Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Updates the version history JSON file. This function is deprecated in favor of updateReadme(). ```typescript // This function is deprecated; use updateReadme() instead import { updateVersionHistory } from './src/update-cursor-links.ts'; updateVersionHistory('3.10.20', '2026-07-08', { windows: { 'win32-x64': { url: '...', version: '3.10.20' } }, mac: { 'darwin-universal': { url: '...', version: '3.10.20' } }, linux: { 'linux-x64': { url: '...', version: '3.10.20' } } }); ``` -------------------------------- ### Format Date in TypeScript Source: https://github.com/oslook/cursor-ai-downloads/blob/main/_autodocs/api-reference/update-cursor-links.md Converts a JavaScript Date object into a YYYY-MM-DD string. ```typescript import { formatDate } from './src/update-cursor-links.ts'; const date = new Date('2026-07-08T12:00:00Z'); const formatted = formatDate(date); console.log(formatted); // '2026-07-08' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.