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

Function serializeDecisionReason

src/cli/structuredIO.ts:64–91  ·  view source on GitHub ↗
(
  reason: PermissionDecisionReason | undefined,
)

Source from the content-addressed store, hash-verified

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

Callers 1

createCanUseToolMethod · 0.85

Calls 1

featureFunction · 0.85

Tested by

no test coverage detected