mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
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:
@@ -562,6 +562,73 @@ export class HttpApiClient implements ElectronAPI {
|
||||
error?: string;
|
||||
}> => this.post('/api/setup/cursor-config/models', { projectPath, models }),
|
||||
|
||||
// Cursor CLI Permissions
|
||||
getCursorPermissions: (
|
||||
projectPath?: string
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
globalPermissions?: { allow: string[]; deny: string[] } | null;
|
||||
projectPermissions?: { allow: string[]; deny: string[] } | null;
|
||||
effectivePermissions?: { allow: string[]; deny: string[] } | null;
|
||||
activeProfile?: 'strict' | 'development' | 'custom' | null;
|
||||
hasProjectConfig?: boolean;
|
||||
availableProfiles?: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
permissions: { allow: string[]; deny: string[] };
|
||||
}>;
|
||||
error?: string;
|
||||
}> =>
|
||||
this.get(
|
||||
`/api/setup/cursor-permissions${projectPath ? `?projectPath=${encodeURIComponent(projectPath)}` : ''}`
|
||||
),
|
||||
|
||||
applyCursorPermissionProfile: (
|
||||
profileId: 'strict' | 'development',
|
||||
scope: 'global' | 'project',
|
||||
projectPath?: string
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
message?: string;
|
||||
scope?: string;
|
||||
profileId?: string;
|
||||
error?: string;
|
||||
}> => this.post('/api/setup/cursor-permissions/profile', { profileId, scope, projectPath }),
|
||||
|
||||
setCursorCustomPermissions: (
|
||||
projectPath: string,
|
||||
permissions: { allow: string[]; deny: string[] }
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
message?: string;
|
||||
permissions?: { allow: string[]; deny: string[] };
|
||||
error?: string;
|
||||
}> => this.post('/api/setup/cursor-permissions/custom', { projectPath, permissions }),
|
||||
|
||||
deleteCursorProjectPermissions: (
|
||||
projectPath: string
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
message?: string;
|
||||
error?: string;
|
||||
}> =>
|
||||
this.httpDelete(
|
||||
`/api/setup/cursor-permissions?projectPath=${encodeURIComponent(projectPath)}`
|
||||
),
|
||||
|
||||
getCursorExampleConfig: (
|
||||
profileId?: 'strict' | 'development'
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
profileId?: string;
|
||||
config?: string;
|
||||
error?: string;
|
||||
}> =>
|
||||
this.get(
|
||||
`/api/setup/cursor-permissions/example${profileId ? `?profileId=${profileId}` : ''}`
|
||||
),
|
||||
|
||||
onInstallProgress: (callback: (progress: unknown) => void) => {
|
||||
return this.subscribeToEvent('agent:stream', callback);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user