MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / wrappedCanUseTool

Method wrappedCanUseTool

source code/QueryEngine.ts:246–273  ·  view source on GitHub ↗
(
      tool,
      input,
      toolUseContext,
      assistantMessage,
      toolUseID,
      forceDecision,
    )

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

sdkCompatToolNameFunction · 0.85
canUseToolFunction · 0.50

Tested by

no test coverage detected