@bniladridas/cursor 0.1.17 → 0.1.19
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.
- package/.github/workflows/release.yml +2 -0
- package/AGENTS.md +66 -36
- package/CMakeLists.txt +54 -10
- package/DESIGN.md +775 -0
- package/README.md +10 -5
- package/cli.js +26 -3
- package/include/agent.h +55 -6
- package/include/services/ai_service.h +3 -0
- package/include/services/git_service.h +4 -0
- package/include/utils/platform.h +2 -2
- package/include/utils/ui.h +19 -0
- package/install.js +1 -0
- package/install.sh +2 -1
- package/package.json +3 -2
- package/release/checksums.txt +4 -4
- package/release/cursor-linux/cursor_v0.1.19_linux_amd64.tar.gz +0 -0
- package/release/cursor-macos/cursor-0.1.19.arm64_sequoia.bottle.tar.gz +0 -0
- package/release/cursor-macos/cursor_v0.1.19_darwin_arm64.tar.gz +0 -0
- package/release/cursor-windows/cursor__windows_amd64.zip +0 -0
- package/src/agent.cpp +1129 -157
- package/src/main.cpp +4 -1
- package/src/services/ai_service.cpp +7 -23
- package/src/services/git_service.cpp +45 -1
- package/src/services/web_service.cpp +7 -3
- package/src/utils/ui.cpp +94 -8
- package/src/utils/version.cpp +48 -15
- package/tests/e2e/run_local_batch.sh +131 -0
- package/tests/main_test.cpp +163 -0
- package/release/cursor-linux/cursor_v0.1.17_linux_amd64.tar.gz +0 -0
- package/release/cursor-macos/cursor-0.1.17.arm64_sequoia.bottle.tar.gz +0 -0
- package/release/cursor-macos/cursor_v0.1.17_darwin_arm64.tar.gz +0 -0
|
@@ -71,6 +71,8 @@ jobs:
|
|
|
71
71
|
# build bottle
|
|
72
72
|
mkdir -p bottle/cursor/${version}/bin
|
|
73
73
|
cp ../build/bin/cursor-agent bottle/cursor/${version}/bin/cursor-agent
|
|
74
|
+
ln -s cursor-agent bottle/cursor/${version}/bin/cursor
|
|
75
|
+
cp ../.env.example bottle/cursor/${version}/.env.example
|
|
74
76
|
tar -C bottle -czf cursor-${version}.arm64_sequoia.bottle.tar.gz cursor
|
|
75
77
|
|
|
76
78
|
- uses: actions/upload-artifact@v6
|
package/AGENTS.md
CHANGED
|
@@ -1,49 +1,79 @@
|
|
|
1
|
-
# Cursor
|
|
1
|
+
# Cursor Runtime Help
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This file is the live runtime help source for the Cursor agent.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Use `/help` or `/docs` to display this content at runtime. If this file cannot be loaded,
|
|
6
|
+
the agent falls back to built-in help output.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
cmake -S . -B build && cmake --build build
|
|
9
|
-
./build/cursor-tests # unit tests
|
|
10
|
-
```
|
|
8
|
+
## Available Meta Commands
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
- `/help` or `/?` - Show runtime help
|
|
11
|
+
- `/docs` - Show runtime help
|
|
12
|
+
- `/debug` - Toggle verbose/debug mode (shows all agent reasoning)
|
|
13
|
+
- `/tools` - Show available tools
|
|
14
|
+
- `/clear` - Clear screen
|
|
15
|
+
- `/chat save <tag>` - Save conversation state
|
|
16
|
+
- `/chat resume <tag>` - Resume conversation state
|
|
17
|
+
- `/chat list` - List saved conversations
|
|
18
|
+
- `/memory show` - Show memory context
|
|
19
|
+
- `/memory add <text>` - Add a fact to memory
|
|
20
|
+
- `/compress` - Compress conversation context
|
|
21
|
+
- `/stats` - Show session statistics
|
|
22
|
+
- `/context show` - Show hierarchical context
|
|
23
|
+
- `/context refresh` - Refresh context cache
|
|
24
|
+
- `/context create` - Create `CURSOR.md`
|
|
25
|
+
- `/files <patterns>` - Read multiple files via glob or path patterns
|
|
26
|
+
- `/fetch <url> [format]` - Fetch web content (text/json/raw)
|
|
27
|
+
- `/checkpoint <cmd>` - Manage checkpoints (create/list/delete)
|
|
28
|
+
- `/restore [id]` - List or restore checkpoints
|
|
29
|
+
- `/mcp <cmd>` - MCP server management
|
|
30
|
+
- `/theme <cmd>` - Theme management
|
|
31
|
+
- `/auth <cmd>` - Authentication management
|
|
32
|
+
- `/sandbox <cmd>` - Sandboxed execution management
|
|
33
|
+
- `/error <cmd>` - Error management and reporting
|
|
34
|
+
- `/goal show` - Show the current goal and task status
|
|
35
|
+
- `/goal clear` - Clear current goal, tasks, and params
|
|
36
|
+
- `/task add <description>` - Add a task for the current goal
|
|
37
|
+
- `/task list` - List active tasks
|
|
38
|
+
- `/task complete <id>` - Mark a task complete
|
|
39
|
+
- `/task remove <id>` - Remove a task
|
|
40
|
+
- `/params set key=value` - Set goal/task parameters
|
|
41
|
+
- `/params show` - Show current parameters
|
|
42
|
+
- `/params clear` - Clear current parameters- `/github repo:owner/repo` - Repository info
|
|
43
|
+
- `/github issues:owner/repo` - List repository issues
|
|
44
|
+
- `/github health:owner/repo` - Run repository health check
|
|
45
|
+
- `/quit` or `/exit` - Exit the program
|
|
13
46
|
|
|
14
|
-
|
|
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
|
|
47
|
+
## File Injection
|
|
20
48
|
|
|
21
|
-
|
|
49
|
+
- `@<path>` - Include file or directory content in the prompt
|
|
50
|
+
- Example: `@src/main.cpp What does this code do?`
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
## Shell Commands
|
|
24
53
|
|
|
25
|
-
|
|
54
|
+
- `!<command>` - Execute shell command
|
|
55
|
+
- `!` - Toggle shell mode
|
|
56
|
+
- `build:command` - Execute build or shell commands
|
|
26
57
|
|
|
27
|
-
##
|
|
58
|
+
## Direct Commands
|
|
28
59
|
|
|
29
|
-
- `
|
|
30
|
-
-
|
|
60
|
+
- `cmd:<command>` - Execute shell command safely
|
|
61
|
+
- `read:<file>[:start:count]` - Read file contents
|
|
62
|
+
- `write:<file> <content>` - Write content to a file
|
|
63
|
+
- `replace:<file>:<old>:<new>[:expected_count]` - Replace text in a file
|
|
64
|
+
- `grep:<pattern>[:directory[:file_filter]]` - Search text in files
|
|
65
|
+
- `search:<query>` - Search the web
|
|
66
|
+
- `remember:<fact>` - Save a fact to memory
|
|
67
|
+
- `analyze:<path>` - Analyze project structure
|
|
68
|
+
- `components:<path>` - Find main components
|
|
69
|
+
- `todos:<path>` - Find task comments
|
|
70
|
+
- `tree:<path>` - Show directory tree
|
|
71
|
+
- `git:log` - Show git history
|
|
72
|
+
- `git:status` - Show git status
|
|
73
|
+
- `git:analyze` - Analyze git repository
|
|
31
74
|
|
|
32
|
-
##
|
|
75
|
+
## Runtime Help Integration
|
|
33
76
|
|
|
34
|
-
|
|
35
|
-
- No comments in code unless necessary
|
|
36
|
-
- No new dependencies
|
|
37
|
-
- No documentation files unless asked
|
|
77
|
+
This file is the single live runtime help document for cursor.
|
|
38
78
|
|
|
39
|
-
|
|
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 |
|
|
79
|
+
Do not add an additional runtime help file.
|
package/CMakeLists.txt
CHANGED
|
@@ -72,6 +72,7 @@ endif()
|
|
|
72
72
|
|
|
73
73
|
# Find dependencies
|
|
74
74
|
find_package(Threads REQUIRED)
|
|
75
|
+
find_library(EDIT_LIBRARY edit)
|
|
75
76
|
|
|
76
77
|
# Find zlib with platform-specific logic, fallback to FetchContent
|
|
77
78
|
set(zlib_is_found FALSE)
|
|
@@ -137,13 +138,21 @@ find_package(CURL REQUIRED)
|
|
|
137
138
|
set(openssl_is_found FALSE)
|
|
138
139
|
if(APPLE)
|
|
139
140
|
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Build architectures for macOS" FORCE)
|
|
140
|
-
# Set deployment target based on environment
|
|
141
141
|
if(DEFINED ENV{CI} OR DEFINED ENV{GITHUB_ACTIONS})
|
|
142
|
-
# Use compatible version for CI environments
|
|
143
142
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0" CACHE STRING "Minimum macOS version" FORCE)
|
|
144
143
|
else()
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
execute_process(
|
|
145
|
+
COMMAND sw_vers -productVersion
|
|
146
|
+
OUTPUT_VARIABLE MACOS_PRODUCT_VERSION
|
|
147
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
148
|
+
ERROR_QUIET
|
|
149
|
+
)
|
|
150
|
+
string(REGEX MATCH "^[0-9]+\\.[0-9]+" MACOS_DEPLOYMENT_VERSION "${MACOS_PRODUCT_VERSION}")
|
|
151
|
+
if(MACOS_DEPLOYMENT_VERSION)
|
|
152
|
+
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_DEPLOYMENT_VERSION}" CACHE STRING "Minimum macOS version" FORCE)
|
|
153
|
+
else()
|
|
154
|
+
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0" CACHE STRING "Minimum macOS version" FORCE)
|
|
155
|
+
endif()
|
|
147
156
|
endif()
|
|
148
157
|
|
|
149
158
|
# Use Homebrew's OpenSSL on macOS/arm64
|
|
@@ -246,7 +255,7 @@ if(PQXX_LIBRARY AND PQXX_INCLUDE_DIR)
|
|
|
246
255
|
message(STATUS "Found libpqxx: ${PQXX_LIBRARY}")
|
|
247
256
|
else()
|
|
248
257
|
set(HAVE_PQXX FALSE)
|
|
249
|
-
message(
|
|
258
|
+
message(STATUS "libpqxx not found. Database support will be disabled.")
|
|
250
259
|
endif()
|
|
251
260
|
|
|
252
261
|
# Find CPR - try to find the package first
|
|
@@ -347,6 +356,14 @@ if(CURSOR_BUILD_TESTS)
|
|
|
347
356
|
|
|
348
357
|
FetchContent_MakeAvailable(googletest)
|
|
349
358
|
|
|
359
|
+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
360
|
+
foreach(GTEST_TARGET gtest gtest_main gmock gmock_main)
|
|
361
|
+
if(TARGET ${GTEST_TARGET})
|
|
362
|
+
target_compile_options(${GTEST_TARGET} PRIVATE -Wno-character-conversion)
|
|
363
|
+
endif()
|
|
364
|
+
endforeach()
|
|
365
|
+
endif()
|
|
366
|
+
|
|
350
367
|
if(NOT TARGET gtest_all_tests)
|
|
351
368
|
add_library(gtest_all_tests INTERFACE)
|
|
352
369
|
target_link_libraries(gtest_all_tests
|
|
@@ -502,6 +519,11 @@ target_link_libraries(cursor_lib PRIVATE
|
|
|
502
519
|
$<$<BOOL:${HAVE_PQXX}>:${PQXX_LIBRARY}>
|
|
503
520
|
)
|
|
504
521
|
|
|
522
|
+
if(EDIT_LIBRARY)
|
|
523
|
+
target_compile_definitions(cursor_lib PRIVATE CURSOR_USE_LIBEDIT)
|
|
524
|
+
target_link_libraries(cursor_lib PRIVATE ${EDIT_LIBRARY})
|
|
525
|
+
endif()
|
|
526
|
+
|
|
505
527
|
# Set additional linker flags for macOS
|
|
506
528
|
if(APPLE)
|
|
507
529
|
target_link_options(cursor_lib PRIVATE -stdlib=libc++)
|
|
@@ -530,6 +552,10 @@ if(CURSOR_BUILD_TESTS)
|
|
|
530
552
|
gtest
|
|
531
553
|
)
|
|
532
554
|
add_test(NAME basic_tests COMMAND cursor-tests)
|
|
555
|
+
add_test(
|
|
556
|
+
NAME local_batch_e2e
|
|
557
|
+
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/e2e/run_local_batch.sh $<TARGET_FILE:cursor-agent>
|
|
558
|
+
)
|
|
533
559
|
|
|
534
560
|
set_target_properties(cursor-tests PROPERTIES
|
|
535
561
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
|
@@ -594,27 +620,45 @@ include(CPack)
|
|
|
594
620
|
|
|
595
621
|
|
|
596
622
|
|
|
623
|
+
set(CURSOR_CHECK_TEST_COMMANDS "")
|
|
624
|
+
set(CURSOR_CHECK_DEPENDS cursor-agent)
|
|
625
|
+
if(CURSOR_BUILD_TESTS)
|
|
626
|
+
list(APPEND CURSOR_CHECK_TEST_COMMANDS COMMAND ${CMAKE_BINARY_DIR}/cursor-tests)
|
|
627
|
+
list(APPEND CURSOR_CHECK_TEST_COMMANDS COMMAND bash ${CMAKE_SOURCE_DIR}/tests/e2e/run_local_batch.sh $<TARGET_FILE:cursor-agent>)
|
|
628
|
+
list(APPEND CURSOR_CHECK_DEPENDS cursor-tests)
|
|
629
|
+
endif()
|
|
630
|
+
|
|
597
631
|
# Add custom check target for testing and validation
|
|
598
632
|
add_custom_target(check
|
|
599
633
|
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target cursor-agent
|
|
600
634
|
COMMAND echo "Running automated tests..."
|
|
601
|
-
COMMAND
|
|
635
|
+
COMMAND $<TARGET_FILE:cursor-agent> --version
|
|
636
|
+
COMMAND $<TARGET_FILE:cursor-agent> --help
|
|
637
|
+
${CURSOR_CHECK_TEST_COMMANDS}
|
|
602
638
|
COMMAND echo "Checking binary exists..."
|
|
603
|
-
COMMAND test -f
|
|
639
|
+
COMMAND test -f $<TARGET_FILE:cursor-agent>
|
|
604
640
|
COMMAND echo "Validating executable permissions..."
|
|
605
|
-
COMMAND test -x
|
|
641
|
+
COMMAND test -x $<TARGET_FILE:cursor-agent>
|
|
606
642
|
COMMAND echo "All checks passed!"
|
|
607
|
-
DEPENDS
|
|
643
|
+
DEPENDS ${CURSOR_CHECK_DEPENDS}
|
|
608
644
|
COMMENT "Running comprehensive project validation"
|
|
609
645
|
)
|
|
610
646
|
|
|
611
647
|
# Add quick test target
|
|
612
648
|
add_custom_target(test-quick
|
|
613
|
-
COMMAND printf "2\\nexit\\n" |
|
|
649
|
+
COMMAND printf "2\\nexit\\n" | $<TARGET_FILE:cursor-agent>
|
|
614
650
|
DEPENDS cursor-agent
|
|
615
651
|
COMMENT "Quick functionality test"
|
|
616
652
|
)
|
|
617
653
|
|
|
654
|
+
if(CURSOR_BUILD_TESTS)
|
|
655
|
+
add_custom_target(e2e-local
|
|
656
|
+
COMMAND bash ${CMAKE_SOURCE_DIR}/tests/e2e/run_local_batch.sh $<TARGET_FILE:cursor-agent>
|
|
657
|
+
DEPENDS cursor-agent
|
|
658
|
+
COMMENT "Running local batch E2E checks"
|
|
659
|
+
)
|
|
660
|
+
endif()
|
|
661
|
+
|
|
618
662
|
# Clang-Tidy target (disabled)
|
|
619
663
|
# if(CLANG_TIDY_EXE)
|
|
620
664
|
# add_custom_target(clang-tidy
|