MCPcopy Index your code
hub / github.com/codeaashu/claude-code / permissionResultToLog

Function permissionResultToLog

src/components/permissions/hooks.ts:31–59  ·  view source on GitHub ↗
(permissionResult: PermissionResult)

Source from the content-addressed store, hash-verified

29}
30
31function permissionResultToLog(permissionResult: PermissionResult): string {
32 switch (permissionResult.behavior) {
33 case 'allow':
34 return 'allow'
35 case 'ask': {
36 const rules = extractRules(permissionResult.suggestions)
37 const suggestions =
38 rules.length > 0
39 ? rules.map(r => permissionRuleValueToString(r)).join(', ')
40 : 'none'
41 return `ask: ${permissionResult.message},
42suggestions: ${suggestions}
43reason: ${decisionReasonToString(permissionResult.decisionReason)}`
44 }
45 case 'deny':
46 return `deny: ${permissionResult.message},
47reason: ${decisionReasonToString(permissionResult.decisionReason)}`
48 case 'passthrough': {
49 const rules = extractRules(permissionResult.suggestions)
50 const suggestions =
51 rules.length > 0
52 ? rules.map(r => permissionRuleValueToString(r)).join(', ')
53 : 'none'
54 return `passthrough: ${permissionResult.message},
55suggestions: ${suggestions}
56reason: ${decisionReasonToString(permissionResult.decisionReason)}`
57 }
58 }
59}
60
61function decisionReasonToString(
62 decisionReason: PermissionDecisionReason | undefined,

Callers 1

decisionReasonToStringFunction · 0.85

Calls 3

extractRulesFunction · 0.85
decisionReasonToStringFunction · 0.85

Tested by

no test coverage detected