/** * Safeguards System * * Safety policies to prevent dangerous operations during AI execution. * All operations must go through these safeguards. */ import type { FileChange } from "./executor"; /** * Ensure branch name is safe * * Validates that branch name: * - Contains ticket key * - Uses approved prefix * - Doesn't target protected branches * * @param branch Branch name * @param ticketKey Expected ticket key * @param protectedBranches Protected branch names (default: main, master, develop) * @throws Error if branch name is unsafe */ export declare function ensureSafeBranchName(branch: string, ticketKey: string, protectedBranches?: string[]): void; /** * Ensure command is in allowlist * * @param allowList List of allowed commands * @param requested Command being requested * @throws Error if command is not allowed */ export declare function ensureSafeCommands(allowList: string[], requested: string): void; /** * Ensure file changes are within limits * * @param changes File changes * @param maxFiles Maximum number of files (default: 50) * @param maxBytes Maximum total bytes (default: 1MB) * @throws Error if limits are exceeded */ export declare function ensureChangeLimits(changes: FileChange[], maxFiles?: number, maxBytes?: number): void; /** * Prevent pushing to main branch * * @param branch Branch name * @throws Error if attempting to push to main branch */ export declare function preventMainBranchPush(branch: string): void; /** * Validate file changes * * Ensures: * - No changes to critical system files * - No deletion of important files * - Paths are valid * * @param changes File changes * @param protectedPaths Protected file paths (default: package.json, tsconfig.json, etc.) * @throws Error if validation fails */ export declare function validateFileChanges(changes: FileChange[], protectedPaths?: string[]): void; //# sourceMappingURL=safeguards.d.ts.map