MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / serializeDecisionReason

Function serializeDecisionReason

source code/cli/structuredIO.ts:66–93  ·  view source on GitHub ↗
(
  reason: PermissionDecisionReason | undefined,
)

Source from the content-addressed store, hash-verified

64export const SANDBOX_NETWORK_ACCESS_TOOL_NAME = 'SandboxNetworkAccess'
65
66function serializeDecisionReason(
67 reason: PermissionDecisionReason | undefined,
68): string | undefined {
69 if (!reason) {
70 return undefined
71 }
72
73 if (
74 (feature('BASH_CLASSIFIER') || feature('TRANSCRIPT_CLASSIFIER')) &&
75 reason.type === 'classifier'
76 ) {
77 return reason.reason
78 }
79 switch (reason.type) {
80 case 'rule':
81 case 'mode':
82 case 'subcommandResults':
83 case 'permissionPromptTool':
84 return undefined
85 case 'hook':
86 case 'asyncAgent':
87 case 'sandboxOverride':
88 case 'workingDir':
89 case 'safetyCheck':
90 case 'other':
91 return reason.reason
92 }
93}
94
95function buildRequiresActionDetails(
96 tool: Tool,

Callers 1

createCanUseToolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected