(
tool,
input,
toolUseContext,
assistantMessage,
toolUseID,
forceDecision,
)
| 251 | |
| 252 | // Wrap canUseTool to track permission denials |
| 253 | const wrappedCanUseTool: CanUseToolFn = async ( |
| 254 | tool, |
| 255 | input, |
| 256 | toolUseContext, |
| 257 | assistantMessage, |
| 258 | toolUseID, |
| 259 | forceDecision, |
| 260 | ) => { |
| 261 | const result = await canUseTool( |
| 262 | tool, |
| 263 | input, |
| 264 | toolUseContext, |
| 265 | assistantMessage, |
| 266 | toolUseID, |
| 267 | forceDecision, |
| 268 | ) |
| 269 | |
| 270 | // Track denials for SDK reporting |
| 271 | if (result.behavior !== 'allow') { |
| 272 | this.permissionDenials.push({ |
| 273 | type: 'permission_denial', |
| 274 | tool_name: sdkCompatToolName(tool.name), |
| 275 | tool_use_id: toolUseID, |
| 276 | tool_input: input, |
| 277 | }) |
| 278 | } |
| 279 | |
| 280 | return result |
| 281 | } |
| 282 | |
| 283 | const initialAppState = getAppState() |
| 284 | const initialMainLoopModel = userSpecifiedModel |
nothing calls this directly
no test coverage detected