@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/src/main.cpp ADDED
@@ -0,0 +1,97 @@
1
+ #include <cstdlib>
2
+ #include <filesystem>
3
+ #include <iostream>
4
+ #include <string>
5
+
6
+ #ifndef _WIN32
7
+ #include <unistd.h>
8
+ #endif
9
+ #ifdef __APPLE__
10
+ #include <mach-o/dyld.h>
11
+ #endif
12
+
13
+ #include "agent.h"
14
+ #include "memory_manager.h"
15
+ #include "services/ai_service.h"
16
+ #include "utils/config.h"
17
+ #include "utils/ui.h"
18
+ #include "version.h"
19
+
20
+ std::string get_exe_path() {
21
+ try {
22
+ return std::filesystem::canonical("/proc/self/exc").string();
23
+ } catch (...) {
24
+ }
25
+ #ifdef __APPLE__
26
+ char buf[1024];
27
+ uint32_t size = sizeof(buf);
28
+ if (_NSGetExecutablePath(buf, &size) == 0) {
29
+ return std::filesystem::canonical(buf).string();
30
+ }
31
+ #endif
32
+ return {};
33
+ }
34
+
35
+ int main(int argc, char *argv[]) {
36
+ for (int i = 1; i < argc; ++i) {
37
+ std::string arg = argv[i];
38
+ if (arg == "--version" || arg == "-v") {
39
+ Version::print_version_info();
40
+ return 0;
41
+ }
42
+ if (arg == "--help" || arg == "-h") {
43
+ std::cout << "Usage: cursor [OPTIONS]\n\n"
44
+ << "Options:\n"
45
+ << " -v, --version Print version info and exit\n"
46
+ << " -h, --help Show this help and exit\n"
47
+ << " --update Update to latest release\n";
48
+ return 0;
49
+ }
50
+ if (arg == "--update") {
51
+ std::string latest = Version::check_update();
52
+ if (latest.empty()) {
53
+ std::cout << "Already up to date (v" << Version::get_version()
54
+ << ")\n";
55
+ return 0;
56
+ }
57
+ return Version::download_and_install(latest) ? 0 : 1;
58
+ }
59
+ }
60
+
61
+ try {
62
+ Utils::Config::load_environment();
63
+ Utils::UI::print_logo();
64
+
65
+ std::string latest = Version::check_update();
66
+ if (!latest.empty()) {
67
+ std::cout << Utils::Color::YELLOW
68
+ << "Update available: v" << Version::get_version() << " -> v"
69
+ << latest << "\n"
70
+ << Utils::Color::RESET;
71
+ std::cout << "[1] Update now\n[2] Later\n> ";
72
+ std::string choice;
73
+ std::getline(std::cin, choice);
74
+ if (choice == "1") {
75
+ if (Version::download_and_install(latest)) {
76
+ std::string exe = get_exe_path();
77
+ if (!exe.empty()) {
78
+ #ifndef _WIN32
79
+ execl(exe.c_str(), exe.c_str(), (char *)NULL);
80
+ #endif
81
+ }
82
+ }
83
+ return 0;
84
+ }
85
+ }
86
+
87
+ Core::Agent agent;
88
+ agent.run();
89
+ std::cout << "Agent run completed" << std::endl;
90
+ } catch (const std::exception &e) {
91
+ std::cerr << Utils::Color::RED << "Fatal error: " << e.what()
92
+ << Utils::Color::RESET << std::endl;
93
+ return 1;
94
+ }
95
+
96
+ return 0;
97
+ }