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