UNPKG

ccguard

Version:

Automated enforcement of net-negative LOC, complexity constraints, and quality standards for Claude code

45 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnlockCommand = void 0; exports.UnlockCommand = { name: 'unlock', description: 'Unlock a file to allow modifications', execute: async (guardManager, args) => { if (args.length === 0) { return { decision: 'block', reason: 'Usage: ccguard unlock @<file-path>\n\nExample: ccguard unlock @src/index.ts', }; } const filePath = args[0]; // Check if file path has @ prefix if (!filePath.startsWith('@')) { return { decision: 'block', reason: 'File path must start with @ prefix.\n\nExample: ccguard unlock @src/index.ts', }; } // Remove @ prefix const cleanPath = filePath.substring(1); if (!cleanPath) { return { decision: 'block', reason: 'Invalid file path. Please provide a valid path after @.', }; } try { await guardManager.unlockFile(cleanPath); return { decision: 'block', reason: `File unlocked successfully: ${cleanPath}`, }; } catch (error) { return { decision: 'block', reason: error instanceof Error ? error.message : 'Failed to unlock file', }; } } }; //# sourceMappingURL=UnlockCommand.js.map