(
tool,
input,
toolUseContext,
assistantMessage,
toolUseID,
forceDecision,
)
| 261 | |
| 262 | // Wrap canUseTool to track permission denials |
| 263 | const wrappedCanUseTool: CanUseToolFn = async ( |
| 264 | tool, |
| 265 | input, |
| 266 | toolUseContext, |
| 267 | assistantMessage, |
| 268 | toolUseID, |
| 269 | forceDecision, |
| 270 | ) => { |
| 271 | const result = await canUseTool( |
| 272 | tool, |
| 273 | input, |
| 274 | toolUseContext, |
| 275 | assistantMessage, |
| 276 | toolUseID, |
| 277 | forceDecision, |
| 278 | ) |
| 279 | |
| 280 | // Track denials for SDK reporting |
| 281 | if (result.behavior !== 'allow') { |
| 282 | this.permissionDenials.push({ |
| 283 | tool_name: sdkCompatToolName(tool.name), |
| 284 | tool_use_id: toolUseID, |
| 285 | tool_input: input, |
| 286 | }) |
| 287 | } |
| 288 | |
| 289 | return result |
| 290 | } |
| 291 | |
| 292 | const initialAppState = getAppState() |
| 293 | const initialMainLoopModel = userSpecifiedModel |
nothing calls this directly
no test coverage detected