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