@bniladridas/cursor 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/.clang-tidy +28 -0
  2. package/.dockerignore +56 -0
  3. package/.env.example +29 -0
  4. package/.github/CODEOWNERS +2 -0
  5. package/.github/ISSUE_TEMPLATE/blank.md +27 -0
  6. package/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  7. package/.github/ISSUE_TEMPLATE/feature_request.md +24 -0
  8. package/.github/SECURITY.md +24 -0
  9. package/.github/codeql/codeql-config.yml +8 -0
  10. package/.github/dependabot.yml +14 -0
  11. package/.github/labeler.yml +50 -0
  12. package/.github/packaging/brand-cursor.png +0 -0
  13. package/.github/packaging/database/init.sql +48 -0
  14. package/.github/packaging/docker/Dockerfile +111 -0
  15. package/.github/packaging/docker/docker-compose.yml +56 -0
  16. package/.github/packaging/scripts/preflight.sh +413 -0
  17. package/.github/packaging/scripts/prepare-release.sh +141 -0
  18. package/.github/packaging/scripts/release.sh +22 -0
  19. package/.github/packaging/scripts/setup-git-hooks.sh +73 -0
  20. package/.github/pull_request_template.md +31 -0
  21. package/.github/signed.json +9 -0
  22. package/.github/workflows/README.md +23 -0
  23. package/.github/workflows/ci.yml +181 -0
  24. package/.github/workflows/cla.yml +33 -0
  25. package/.github/workflows/formula-sha.yml +63 -0
  26. package/.github/workflows/issue-response.yml +44 -0
  27. package/.github/workflows/labeler.yml +42 -0
  28. package/.github/workflows/pr-body.yml +49 -0
  29. package/.github/workflows/release.yml +176 -0
  30. package/.github/workflows/security.yml +94 -0
  31. package/.github/workflows/stale.yml +38 -0
  32. package/AGENTS.md +49 -0
  33. package/CHANGELOG.md +3 -0
  34. package/CMakeLists.txt +646 -0
  35. package/Formula/cursor.rb +46 -0
  36. package/LICENSE +201 -0
  37. package/Makefile +28 -0
  38. package/README.md +46 -0
  39. package/cli.js +16 -0
  40. package/include/agent.h +86 -0
  41. package/include/agent_mode.h +17 -0
  42. package/include/memory_manager.h +102 -0
  43. package/include/services/ai_service.h +31 -0
  44. package/include/services/auth_service.h +87 -0
  45. package/include/services/checkpoint_service.h +69 -0
  46. package/include/services/codebase_service.h +38 -0
  47. package/include/services/command_service.h +23 -0
  48. package/include/services/context_service.h +74 -0
  49. package/include/services/database_service.h +56 -0
  50. package/include/services/error_service.h +106 -0
  51. package/include/services/file_service.h +51 -0
  52. package/include/services/git_service.h +29 -0
  53. package/include/services/github_service.h +85 -0
  54. package/include/services/mcp_service.h +85 -0
  55. package/include/services/multi_file_service.h +93 -0
  56. package/include/services/sandbox_service.h +96 -0
  57. package/include/services/theme_service.h +67 -0
  58. package/include/services/web_service.h +52 -0
  59. package/include/utils/config.h +68 -0
  60. package/include/utils/memory_utils.h +79 -0
  61. package/include/utils/platform.h +56 -0
  62. package/include/utils/ui.h +43 -0
  63. package/include/utils/validation.h +63 -0
  64. package/include/utils/version.h.in +17 -0
  65. package/install.js +49 -0
  66. package/package.json +16 -0
  67. package/release/checksums.txt +3 -0
  68. package/release/cursor-linux/cursor_v0.1.7_linux_amd64.tar.gz +0 -0
  69. package/release/cursor-macos/cursor_v0.1.7_darwin_arm64.tar.gz +0 -0
  70. package/release/cursor-windows/cursor__windows_amd64.zip +0 -0
  71. package/src/agent.cpp +2026 -0
  72. package/src/main.cpp +97 -0
  73. package/src/memory_manager.cpp +814 -0
  74. package/src/services/ai_service.cpp +366 -0
  75. package/src/services/auth_service.cpp +779 -0
  76. package/src/services/checkpoint_service.cpp +465 -0
  77. package/src/services/codebase_service.cpp +233 -0
  78. package/src/services/command_service.cpp +82 -0
  79. package/src/services/context_service.cpp +348 -0
  80. package/src/services/database_service.cpp +148 -0
  81. package/src/services/error_service.cpp +438 -0
  82. package/src/services/file_service.cpp +349 -0
  83. package/src/services/git_service.cpp +148 -0
  84. package/src/services/github_service.cpp +435 -0
  85. package/src/services/mcp_service.cpp +481 -0
  86. package/src/services/multi_file_service.cpp +591 -0
  87. package/src/services/sandbox_service.cpp +678 -0
  88. package/src/services/theme_service.cpp +429 -0
  89. package/src/services/web_service.cpp +532 -0
  90. package/src/utils/config.cpp +77 -0
  91. package/src/utils/memory_utils.cpp +93 -0
  92. package/src/utils/ui.cpp +307 -0
  93. package/src/utils/validation.cpp +306 -0
  94. package/src/utils/version.cpp +175 -0
  95. package/tests/e2e/docker-compose.yml +195 -0
  96. package/tests/e2e/run_e2e_tests.sh +70 -0
  97. package/tests/e2e/run_tests_in_docker.sh +115 -0
  98. package/tests/main_test.cpp +16 -0
  99. package/tests/mocks/mock_ollama.py +98 -0
  100. package/tests/mocks/start_nginx.sh +64 -0
package/.clang-tidy ADDED
@@ -0,0 +1,28 @@
1
+ ---
2
+ Checks: >
3
+ -*,
4
+ bugprone-*,
5
+ clang-analyzer-*,
6
+ cppcoreguidelines-*,
7
+ modernize-*,
8
+ performance-*,
9
+ readability-*,
10
+ -modernize-use-trailing-return-type,
11
+ -cppcoreguidelines-avoid-magic-numbers,
12
+ -readability-magic-numbers,
13
+ -cppcoreguidelines-pro-bounds-pointer-arithmetic,
14
+ -cppcoreguidelines-pro-type-vararg,
15
+ -readability-identifier-length
16
+
17
+ WarningsAsErrors: ''
18
+ HeaderFilterRegex: '^(src|include)/.*'
19
+ FormatStyle: file
20
+ CheckOptions:
21
+ - key: readability-identifier-naming.VariableCase
22
+ value: lower_case
23
+ - key: readability-identifier-naming.ConstantCase
24
+ value: UPPER_CASE
25
+ - key: readability-identifier-naming.FunctionCase
26
+ value: lower_case
27
+ - key: readability-identifier-naming.ClassCase
28
+ value: CamelCase
package/.dockerignore ADDED
@@ -0,0 +1,56 @@
1
+ # Build artifacts
2
+ build/
3
+ *.o
4
+ *.so
5
+ *.a
6
+
7
+ # Git
8
+ .git/
9
+ .gitignore
10
+
11
+ # Documentation
12
+ *.md
13
+
14
+ # CI/CD
15
+ .github/
16
+
17
+ # Development files
18
+ .vscode/
19
+ .idea/
20
+ *.swp
21
+ *.swo
22
+
23
+ # OS files
24
+ .DS_Store
25
+ Thumbs.db
26
+
27
+ # Logs
28
+ *.log
29
+
30
+ # Temporary files
31
+ tmp/
32
+ temp/
33
+
34
+ # Node modules (if any)
35
+ node_modules/
36
+
37
+ # Package artifacts
38
+ package/dist/
39
+ package/binary/
40
+ package/managers/
41
+ package/docs/
42
+
43
+ # Test files (keep for E2E builds)
44
+ # test/
45
+ # tests/
46
+ # *_test.cpp
47
+ # *_test.h
48
+
49
+ # Cache files
50
+ .cache/
51
+ __pycache__/
52
+
53
+ # Environment files (will be mounted as volume)
54
+ .env
55
+ .env.*
56
+ !.env.example
package/.env.example ADDED
@@ -0,0 +1,29 @@
1
+ # Cursor API Keys Configuration
2
+
3
+ # Together AI
4
+ TOGETHER_API_KEY=your_together_api_key_here
5
+
6
+ # Cerebras
7
+ CEREBRAS_API_KEY=your_cerebras_api_key_here
8
+
9
+ # Fireworks
10
+ FIREWORKS_API_KEY=your_fireworks_api_key_here
11
+
12
+ # Groq
13
+ GROQ_API_KEY=your_groq_api_key_here
14
+
15
+ # DeepSeek
16
+ DEEPSEEK_API_KEY=your_deepseek_api_key_here
17
+
18
+ # OpenAI
19
+ OPENAI_API_KEY=your_openai_api_key_here
20
+
21
+ # SerpAPI (for web search)
22
+ SERPAPI_KEY=your_serpapi_key_here
23
+
24
+ # PostgreSQL Database
25
+ DB_HOST=localhost
26
+ DB_PORT=5432
27
+ DB_NAME=cursor
28
+ DB_USER=cursor
29
+ DB_PASSWORD=your_db_password_here
@@ -0,0 +1,2 @@
1
+ # Global code owners
2
+ * @bniladridas
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: Blank Issue
3
+ about: Create a general issue
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Description:**
11
+
12
+
13
+ **Steps to reproduce:**
14
+
15
+
16
+ **Expected behavior:**
17
+
18
+
19
+ **Actual behavior:**
20
+
21
+
22
+ **Environment:**
23
+ - OS:
24
+ - Version:
25
+
26
+
27
+ **Additional context:**
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: '[BUG] '
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ **Describe the bug**
10
+ Clear and concise description of what the bug is.
11
+
12
+ **To Reproduce**
13
+ Steps to reproduce the behavior:
14
+ 1. Run command '...'
15
+ 2. Enter input '...'
16
+ 3. See error
17
+
18
+ **Expected behavior**
19
+ Clear and concise description of what you expected to happen.
20
+
21
+ **Environment:**
22
+ - OS: [e.g., macOS 14.0, Ubuntu 22.04]
23
+ - Compiler: [e.g., clang 15.0, gcc 11.0]
24
+ - CMake version: [e.g., 3.25.0]
25
+ - Mode: [Online/Offline]
26
+
27
+ **Error output**
28
+ ```
29
+ Paste any error messages here
30
+ ```
31
+
32
+ **Additional context**
33
+ Add any other context about the problem here.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: '[FEATURE] '
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ **Is your feature request related to a problem? Please describe.**
10
+ Clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11
+
12
+ **Describe the solution you'd like**
13
+ Clear and concise description of what you want to happen.
14
+
15
+ **Describe alternatives you've considered**
16
+ Clear and concise description of any alternative solutions or features you've considered.
17
+
18
+ **Implementation considerations**
19
+ - Would this require new dependencies?
20
+ - Should this be a new service module?
21
+ - Any security considerations?
22
+
23
+ **Additional context**
24
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,24 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ | ------- | --------- |
7
+ | 1.x.x | Yes |
8
+ | < 1.0 | No |
9
+
10
+ ## Reporting a Vulnerability
11
+
12
+ Do not create public issues. Email bniladridas@icloud.com with:
13
+ - Steps to reproduce
14
+ - Potential impact
15
+ - Suggested fixes
16
+
17
+ We acknowledge within 48 hours and respond within 7 days.
18
+
19
+ ## Security Updates
20
+
21
+ Released ASAP after fixes. Communicated via:
22
+ - GitHub Security Advisories
23
+ - Release notes
24
+ - Email notifications
@@ -0,0 +1,8 @@
1
+ name: "CodeQL Configuration"
2
+ paths-ignore:
3
+ - build/**
4
+ - '**/openssl/**'
5
+ - '**/zlib/**'
6
+ - '**/nlohmann_json/**'
7
+ - '**/cpr/**'
8
+ - '**/googletest/**'
@@ -0,0 +1,14 @@
1
+ version: 2
2
+ updates:
3
+ # GitHub Actions dependencies
4
+ - package-ecosystem: github-actions
5
+ directory: "/"
6
+ schedule:
7
+ interval: weekly
8
+ open-pull-requests-limit: 5
9
+
10
+ - package-ecosystem: docker
11
+ directory: "/package/docker"
12
+ schedule:
13
+ interval: weekly
14
+ open-pull-requests-limit: 5
@@ -0,0 +1,50 @@
1
+ ci:
2
+ - changed-files:
3
+ - any-glob-to-any-file:
4
+ - '.github/workflows/**'
5
+ - '.github/packaging/**'
6
+ - 'Dockerfile'
7
+ - 'docker-compose*.yml'
8
+
9
+ docs:
10
+ - changed-files:
11
+ - any-glob-to-any-file:
12
+ - 'README.md'
13
+ - 'CHANGELOG.md'
14
+ - 'AGENTS.md'
15
+ - 'LICENSE'
16
+ - '.env.example'
17
+
18
+ security:
19
+ - changed-files:
20
+ - any-glob-to-any-file:
21
+ - '.github/SECURITY.md'
22
+ - 'src/services/auth_service.cpp'
23
+
24
+ config:
25
+ - changed-files:
26
+ - any-glob-to-any-file:
27
+ - 'CMakeLists.txt'
28
+ - '.github/dependabot.yml'
29
+ - 'package.json'
30
+
31
+ tests:
32
+ - changed-files:
33
+ - any-glob-to-any-file:
34
+ - 'tests/**'
35
+
36
+ refactor:
37
+ - changed-files:
38
+ - any-glob-to-any-file:
39
+ - 'src/**'
40
+
41
+ feature:
42
+ - changed-files:
43
+ - any-glob-to-any-file:
44
+ - 'src/services/**'
45
+
46
+ bug:
47
+ - changed-files:
48
+ - any-glob-to-any-file:
49
+ - 'src/agent.cpp'
50
+ - 'src/memory_manager.cpp'
@@ -0,0 +1,48 @@
1
+ -- Cursor Database Schema
2
+
3
+ -- Create database (run manually if needed)
4
+ -- CREATE DATABASE cursor;
5
+
6
+ -- Connect to cursor database
7
+ -- \c cursor;
8
+
9
+ -- Example table for storing agent data
10
+ CREATE TABLE IF NOT EXISTS agent_data (
11
+ id SERIAL PRIMARY KEY,
12
+ key VARCHAR(255) UNIQUE NOT NULL,
13
+ value TEXT,
14
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
15
+ updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
16
+ );
17
+
18
+ -- Example table for conversation history
19
+ CREATE TABLE IF NOT EXISTS conversations (
20
+ id SERIAL PRIMARY KEY,
21
+ session_id VARCHAR(255) NOT NULL,
22
+ message TEXT NOT NULL,
23
+ role VARCHAR(50) NOT NULL, -- 'user' or 'assistant'
24
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
25
+ );
26
+
27
+ -- Index for performance
28
+ CREATE INDEX IF NOT EXISTS idx_agent_data_key ON agent_data(key);
29
+ CREATE INDEX IF NOT EXISTS idx_conversations_session ON conversations(session_id);
30
+
31
+ -- Trigger to automatically update updated_at timestamp
32
+ CREATE OR REPLACE FUNCTION update_updated_at_column()
33
+ RETURNS TRIGGER AS $$
34
+ BEGIN
35
+ NEW.updated_at = now();
36
+ RETURN NEW;
37
+ END;
38
+ $$ language 'plpgsql';
39
+
40
+ CREATE TRIGGER update_agent_data_updated_at
41
+ BEFORE UPDATE ON agent_data
42
+ FOR EACH ROW
43
+ EXECUTE PROCEDURE update_updated_at_column();
44
+
45
+ CREATE TRIGGER update_conversations_updated_at
46
+ BEFORE UPDATE ON conversations
47
+ FOR EACH ROW
48
+ EXECUTE PROCEDURE update_updated_at_column();
@@ -0,0 +1,111 @@
1
+ # Build stage
2
+ FROM ubuntu:22.04 as builder
3
+
4
+ LABEL maintainer="bniladridas"
5
+ LABEL description="Cursor Agent - Build Stage"
6
+ LABEL version="0.1"
7
+
8
+ # Set environment variables to avoid interactive prompts
9
+ ENV DEBIAN_FRONTEND=noninteractive \
10
+ TZ=Etc/UTC \
11
+ DEBCONF_NONINTERACTIVE_SEEN=true \
12
+ BUILD_DEPS="build-essential cmake git" \
13
+ RUNTIME_DEPS="libcurl4-openssl-dev libssl-dev zlib1g-dev"
14
+
15
+ # Install build dependencies
16
+ RUN apt-get update && \
17
+ ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
18
+ apt-get install -y --no-install-recommends tzdata $BUILD_DEPS $RUNTIME_DEPS \
19
+ nlohmann-json3-dev \
20
+ libgtest-dev \
21
+ libgmock-dev \
22
+ libssl-dev \
23
+ libcurl4-openssl-dev \
24
+ zlib1g-dev \
25
+ libpqxx-dev \
26
+ python3 \
27
+ python3-pip \
28
+ expect && \
29
+ python3 -m pip install pytest && \
30
+ dpkg-reconfigure --frontend noninteractive tzdata && \
31
+ rm -rf /var/lib/apt/lists/*
32
+
33
+ # Configure git to skip SSL verification (temporary for build)
34
+ RUN git config --global http.sslVerify false
35
+
36
+ # Install additional build tools
37
+ RUN apt-get update && \
38
+ apt-get install -y wget && \
39
+ rm -rf /var/lib/apt/lists/*
40
+
41
+ # Download and install CPR from release tarball
42
+ WORKDIR /tmp
43
+ RUN wget https://github.com/libcpr/cpr/archive/refs/tags/1.10.5.tar.gz -O cpr-1.10.5.tar.gz && \
44
+ tar -xzf cpr-1.10.5.tar.gz && \
45
+ mkdir -p cpr-1.10.5/build && \
46
+ cd cpr-1.10.5/build && \
47
+ cmake .. \
48
+ -DCPR_USE_SYSTEM_CURL=ON \
49
+ -DCPR_ENABLE_SSL=ON \
50
+ -DCPR_BUILD_TESTS=OFF \
51
+ -DCPR_FORCE_USE_OPENSSL_FOR_SSL=ON \
52
+ -DCMAKE_BUILD_TYPE=Release \
53
+ -DCMAKE_INSTALL_PREFIX=/usr/local && \
54
+ cmake --build . --parallel $(nproc) && \
55
+ cmake --install . && \
56
+ cd / && rm -rf /tmp/cpr-1.10.5 /tmp/cpr-1.10.5.tar.gz && \
57
+ ldconfig
58
+
59
+ # Build the application
60
+ WORKDIR /app
61
+ COPY . .
62
+ RUN mkdir -p build && cd build && \
63
+ cmake .. \
64
+ -DCMAKE_BUILD_TYPE=Release \
65
+ -DCMAKE_PREFIX_PATH=/usr/local \
66
+ -DCMAKE_MODULE_PATH=/usr/local/lib/cmake/cpr && \
67
+ cmake --build . --parallel $(nproc) && \
68
+ make install
69
+
70
+ # Runtime stage
71
+ FROM ubuntu:22.04
72
+
73
+ LABEL maintainer="bniladridas"
74
+ LABEL description="Cursor Agent - Runtime"
75
+ LABEL version="0.1"
76
+
77
+ # Install runtime dependencies
78
+ RUN apt-get update && \
79
+ apt-get install -y --no-install-recommends \
80
+ libcurl4 \
81
+ libssl3 \
82
+ zlib1g \
83
+ libpqxx-6.4 \
84
+ python3 \
85
+ python3-pip && \
86
+ rm -rf /var/lib/apt/lists/*
87
+
88
+ # Install Python test dependencies
89
+ RUN pip3 install --no-cache-dir pytest requests
90
+
91
+ # Copy built binary from builder
92
+ COPY --from=builder /usr/local/bin/cursor-agent /usr/local/bin/
93
+ COPY --from=builder /usr/local/lib/libcpr* /usr/local/lib/
94
+
95
+ # Create non-root user and set up environment
96
+ RUN useradd -m -s /bin/bash cursor && \
97
+ mkdir -p /app/data && \
98
+ chown -R cursor:cursor /app/data
99
+
100
+ USER cursor
101
+ WORKDIR /home/cursor
102
+
103
+ # Copy configuration template
104
+ COPY --chown=cursor:cursor .env.example .env
105
+
106
+ # Health check
107
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
108
+ CMD cursor-agent --version || exit 1
109
+
110
+ # Default command
111
+ CMD ["cursor-agent"]
@@ -0,0 +1,56 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ cursor-agent:
5
+ build:
6
+ context: ../..
7
+ dockerfile: .github/packaging/docker/Dockerfile
8
+ container_name: cursor-agent
9
+ depends_on:
10
+ - postgres
11
+ environment:
12
+ - TOGETHER_API_KEY=${TOGETHER_API_KEY}
13
+ - SERPAPI_KEY=${SERPAPI_KEY}
14
+ - DB_HOST=postgres
15
+ - DB_PORT=5432
16
+ - DB_NAME=cursor
17
+ - DB_USER=cursor
18
+ - DB_PASSWORD=password
19
+ volumes:
20
+ - cursor_data:/home/cursor/data
21
+ - ../../.env:/home/cursor/.env:ro
22
+ stdin_open: true
23
+ tty: true
24
+ restart: unless-stopped
25
+
26
+ # Optional: Ollama service for offline mode
27
+ ollama:
28
+ image: ollama/ollama:latest
29
+ container_name: ollama
30
+ ports:
31
+ - "11434:11434"
32
+ volumes:
33
+ - ollama_data:/root/.ollama
34
+ restart: unless-stopped
35
+
36
+ # PostgreSQL database
37
+ postgres:
38
+ image: postgres:15
39
+ container_name: cursor-postgres
40
+ environment:
41
+ POSTGRES_DB: ${DB_NAME}
42
+ POSTGRES_USER: ${DB_USER}
43
+ POSTGRES_PASSWORD: ${DB_PASSWORD}
44
+ volumes:
45
+ - postgres_data:/var/lib/postgresql/data
46
+ ports:
47
+ - "5432:5432"
48
+ restart: unless-stopped
49
+
50
+ volumes:
51
+ cursor_data:
52
+ driver: local
53
+ ollama_data:
54
+ driver: local
55
+ postgres_data:
56
+ driver: local