Something went wrong. Try again.
source dump of claude code forked from oppi.li/claude-code
Something went wrong. Try again.
1.2 kB · 40 lines
TypeScript
at main
1234567891011121314151617181920212223242526272829303132333435363738394041import z from 'zod/v4'// Types extracted to src/types/permissions.ts to break import cyclesimport type { PermissionBehavior, PermissionRule, PermissionRuleSource, PermissionRuleValue,} from '../../types/permissions.js'import { lazySchema } from '../lazySchema.js'
// Re-export for backwards compatibilityexport type { PermissionBehavior, PermissionRule, PermissionRuleSource, PermissionRuleValue,}
/** * ToolPermissionBehavior is the behavior associated with a permission rule. * 'allow' means the rule allows the tool to run. * 'deny' means the rule denies the tool from running. * 'ask' means the rule forces a prompt to be shown to the user. */export const permissionBehaviorSchema = lazySchema(() => z.enum(['allow', 'deny', 'ask']),)
/** * PermissionRuleValue is the content of a permission rule. * @param toolName - The name of the tool this rule applies to * @param ruleContent - The optional content of the rule. * Each tool may implement custom handling in `checkPermissions()` */export const permissionRuleValueSchema = lazySchema(() => z.object({ toolName: z.string(), ruleContent: z.string().optional(), }),)