feat(server): Implement Cursor CLI permissions management

Added new routes and handlers for managing Cursor CLI permissions, including:
- GET /api/setup/cursor-permissions: Retrieve current permissions configuration and available profiles.
- POST /api/setup/cursor-permissions/profile: Apply a predefined permission profile (global or project).
- POST /api/setup/cursor-permissions/custom: Set custom permissions for a project.
- DELETE /api/setup/cursor-permissions: Delete project-level permissions, reverting to global settings.
- GET /api/setup/cursor-permissions/example: Provide an example config file for a specified profile.

Also introduced a new service for handling Cursor CLI configuration files and updated the UI to support permissions management.

Affected files:
- Added new routes in index.ts and cursor-config.ts
- Created cursor-config-service.ts for permissions management logic
- Updated UI components to display and manage permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
Kacper
2025-12-30 17:08:18 +01:00
parent 078ab943a8
commit dac916496c
6 changed files with 1121 additions and 5 deletions

View File

@@ -17,6 +17,11 @@ import {
createGetCursorConfigHandler,
createSetCursorDefaultModelHandler,
createSetCursorModelsHandler,
createGetCursorPermissionsHandler,
createApplyPermissionProfileHandler,
createSetCustomPermissionsHandler,
createDeleteProjectPermissionsHandler,
createGetExampleConfigHandler,
} from './routes/cursor-config.js';
export function createSetupRoutes(): Router {
@@ -38,5 +43,12 @@ export function createSetupRoutes(): Router {
router.post('/cursor-config/default-model', createSetCursorDefaultModelHandler());
router.post('/cursor-config/models', createSetCursorModelsHandler());
// Cursor CLI Permissions routes
router.get('/cursor-permissions', createGetCursorPermissionsHandler());
router.post('/cursor-permissions/profile', createApplyPermissionProfileHandler());
router.post('/cursor-permissions/custom', createSetCustomPermissionsHandler());
router.delete('/cursor-permissions', createDeleteProjectPermissionsHandler());
router.get('/cursor-permissions/example', createGetExampleConfigHandler());
return router;
}