UNPKG

ubon

Version:

Security scanner for AI-generated apps (Cursor, Lovable, Windsurf, v0). Catches hardcoded secrets, prompt injection, hallucinated imports, Server Actions / Edge runtime mistakes, and the vibe-coded vulnerabilities traditional linters miss.

62 lines 1.79 kB
export type RuleSeverity = 'high' | 'medium' | 'low'; /** * Canonical rule category union used by every scanner, rule, and reporter. * * `'config'` covers infra / Dockerfile / .env-drift style rules where the * underlying issue is a misconfiguration rather than a code-level vulnerability. * * Keep this list small and stable — adding a category implies adding a * dedicated section in human reports and a new `rule.category` value clients * may already filter on. */ export type RuleCategory = 'security' | 'accessibility' | 'links' | 'performance' | 'seo' | 'development' | 'config'; export interface RuleMeta { id: string; category: RuleCategory; severity: RuleSeverity; message: string; fix?: string; helpUri?: string; impact?: string; } export interface PatternRule { ruleId: string; confidence: number; pattern: RegExp; message: string; severity: RuleSeverity; fix?: string; } export interface DetectionResult { line: number; match?: string; confidence?: number; confidenceReason?: string; fixEdits?: Array<{ file: string; startLine: number; startColumn: number; endLine: number; endColumn: number; replacement: string; }>; } export interface CustomDetection { (content: string, file: string, lines: string[]): DetectionResult[]; } export interface RuleImpl { patterns?: PatternRule[]; detect?: CustomDetection; fileDetect?: (content: string, file: string) => boolean; autofix?: (content: string, file: string) => string; fileTypes?: string[]; skipPatterns?: RegExp[]; } export interface Rule { meta: RuleMeta; impl: RuleImpl; } export interface RuleModule { default: Rule; } //# sourceMappingURL=types.d.ts.map