source dump of claude code
at main 61 lines 1.4 kB view raw
1// Stub for external builds - classifier permissions feature is ANT-ONLY 2 3export const PROMPT_PREFIX = 'prompt:' 4 5export type ClassifierResult = { 6 matches: boolean 7 matchedDescription?: string 8 confidence: 'high' | 'medium' | 'low' 9 reason: string 10} 11 12export type ClassifierBehavior = 'deny' | 'ask' | 'allow' 13 14export function extractPromptDescription( 15 _ruleContent: string | undefined, 16): string | null { 17 return null 18} 19 20export function createPromptRuleContent(description: string): string { 21 return `${PROMPT_PREFIX} ${description.trim()}` 22} 23 24export function isClassifierPermissionsEnabled(): boolean { 25 return false 26} 27 28export function getBashPromptDenyDescriptions(_context: unknown): string[] { 29 return [] 30} 31 32export function getBashPromptAskDescriptions(_context: unknown): string[] { 33 return [] 34} 35 36export function getBashPromptAllowDescriptions(_context: unknown): string[] { 37 return [] 38} 39 40export async function classifyBashCommand( 41 _command: string, 42 _cwd: string, 43 _descriptions: string[], 44 _behavior: ClassifierBehavior, 45 _signal: AbortSignal, 46 _isNonInteractiveSession: boolean, 47): Promise<ClassifierResult> { 48 return { 49 matches: false, 50 confidence: 'high', 51 reason: 'This feature is disabled', 52 } 53} 54 55export async function generateGenericDescription( 56 _command: string, 57 specificDescription: string | undefined, 58 _signal: AbortSignal, 59): Promise<string | null> { 60 return specificDescription || null 61}