@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
@@ -0,0 +1,94 @@
1
+ name: security
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+ release:
9
+ types: ["published"]
10
+ schedule:
11
+ - cron: '0 0 * * 1'
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+ security-events: write
17
+ packages: write
18
+ id-token: write
19
+
20
+ jobs:
21
+ codeql:
22
+ runs-on: ubuntu-latest
23
+ if: github.repository_owner == 'bniladridas'
24
+ steps:
25
+ - uses: actions/checkout@v6
26
+ - uses: github/codeql-action/init@v4
27
+ with:
28
+ languages: cpp
29
+ config-file: ./.github/codeql/codeql-config.yml
30
+ - run: |
31
+ sudo apt update
32
+ sudo apt install -y nlohmann-json3-dev cmake build-essential \
33
+ libcurl4-openssl-dev libpqxx-dev
34
+ cmake -S . -B build
35
+ cmake --build build
36
+ - uses: github/codeql-action/analyze@v4
37
+
38
+ sast:
39
+ name: sast
40
+ runs-on: ubuntu-latest
41
+ if: github.repository_owner == 'bniladridas'
42
+ steps:
43
+ - uses: actions/checkout@v6
44
+ - uses: aquasecurity/trivy-action@v0.36.0
45
+ with:
46
+ scan-type: fs
47
+ format: sarif
48
+ output: trivy-results.sarif
49
+ - uses: github/codeql-action/upload-sarif@v4
50
+ if: always()
51
+ with:
52
+ sarif_file: trivy-results.sarif
53
+
54
+ release:
55
+ name: release
56
+ if: github.event_name == 'release' && github.repository_owner == 'bniladridas'
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - uses: actions/checkout@v6
60
+ - run: |
61
+ sudo apt update
62
+ sudo apt install -y nlohmann-json3-dev cmake build-essential \
63
+ libcurl4-openssl-dev libpqxx-dev
64
+ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
65
+ cmake --build build --config Release
66
+ make preflight
67
+ mkdir -p release
68
+ cp build/bin/cursor-agent README.md LICENSE CHANGELOG.md release/
69
+ tar -czf cursor-${{ github.event.release.tag_name }}.tar.gz -C release .
70
+ - uses: softprops/action-gh-release@v3
71
+ with:
72
+ files: cursor-${{ github.event.release.tag_name }}.tar.gz
73
+
74
+ agent:
75
+ name: agent
76
+ if: >
77
+ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
78
+ && github.repository_owner == 'bniladridas'
79
+ runs-on: ubuntu-latest
80
+ steps:
81
+ - uses: actions/checkout@v6
82
+ - run: |
83
+ sudo apt update
84
+ sudo apt install -y nlohmann-json3-dev cmake build-essential \
85
+ libcurl4-openssl-dev libpqxx-dev
86
+ cmake -S . -B build
87
+ cmake --build build
88
+ timeout 30s ./build/bin/cursor-agent << EOF
89
+ 2
90
+ exit
91
+ EOF
92
+ echo "Build size: $(stat -c%s build/bin/cursor-agent) bytes"
93
+ echo "Build date: $(date)"
94
+ echo "Commit: ${{ github.sha }}"
@@ -0,0 +1,38 @@
1
+ name: stale
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: "39 4 * * 1"
7
+
8
+ jobs:
9
+ mark:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: read
13
+ issues: write
14
+ pull-requests: write
15
+
16
+ steps:
17
+ - id: app-token
18
+ uses: actions/create-github-app-token@v3
19
+ with:
20
+ client-id: ${{ secrets.CURSOR_BOT_CLIENT_ID }}
21
+ private-key: ${{ secrets.CURSOR_BOT_PRIVATE_KEY }}
22
+ permission-issues: write
23
+ permission-pull-requests: write
24
+
25
+ - uses: actions/stale@v10
26
+ with:
27
+ repo-token: ${{ steps.app-token.outputs.token }}
28
+ days-before-stale: 45
29
+ days-before-close: 14
30
+ stale-issue-label: stale
31
+ stale-pr-label: stale
32
+ exempt-issue-labels: pinned,security
33
+ exempt-pr-labels: pinned,security
34
+ stale-issue-message: "This has been quiet for a while. Please add a note if it should stay open."
35
+ stale-pr-message: "This has been quiet for a while. Please add a note if it should stay open."
36
+ close-issue-message: "Closing for now."
37
+ close-pr-message: "Closing for now."
38
+ operations-per-run: 20
package/AGENTS.md ADDED
@@ -0,0 +1,49 @@
1
+ # Cursor
2
+
3
+ C++20 AI coding agent. 16 services, 8 AI providers, CI/CD across 3 platforms.
4
+
5
+ ## Build & Test
6
+
7
+ ```bash
8
+ cmake -S . -B build && cmake --build build
9
+ ./build/cursor-tests # unit tests
10
+ ```
11
+
12
+ ## Style
13
+
14
+ - C++20: `starts_with()`, `std::optional`, structured bindings
15
+ - `snake_case` for functions, `PascalCase` for classes
16
+ - Static service methods - no state (except `AIService`, `DatabaseService`)
17
+ - No exceptions in hot paths - return `std::optional` or error codes
18
+ - No raw pointers - RAII wrappers or `unique_ptr`
19
+ - `#pragma once` in headers, `#ifdef _WIN32` for platform code
20
+
21
+ ## Workflow
22
+
23
+ `plan → implement → build → test → fix → cleanup → continue`
24
+
25
+ Detect stale, duplicated, or dead code as you go. Fix warnings and failing tests immediately. Keep dependencies and config clean. Don't remove things that serve a purpose.
26
+
27
+ ## Technical Debt
28
+
29
+ - `agent.cpp` (76KB) - God class, main refactoring target
30
+ - 2 unit tests - far below where we need to be
31
+
32
+ ## Hard Rules
33
+
34
+ - No new files unless explicitly told
35
+ - No comments in code unless necessary
36
+ - No new dependencies
37
+ - No documentation files unless asked
38
+
39
+ ## GitHub Secrets Required
40
+
41
+ | Secret | Used By | Purpose |
42
+ |--------|---------|---------|
43
+ | `NPM_TOKEN` | release.yml | Publish @bniladridas/cursor |
44
+ | `DOCKER_USERNAME` | ci.yml | Push Docker images |
45
+ | `DOCKER_PASSWORD` | ci.yml | Push Docker images |
46
+ | `CLA_BOT_TOKEN` | cla.yml | CLA comment bot |
47
+ | `CLA_SIGNED_JSON` | cla.yml | Signed CLA storage path |
48
+ | `CURSOR_BOT_CLIENT_ID` | formula-sha.yml | GitHub App for PR creation |
49
+ | `CURSOR_BOT_PRIVATE_KEY` | formula-sha.yml | GitHub App for PR creation |
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ All notable changes are documented in [GitHub Releases](https://github.com/bniladridas/cursor/releases).