MCPcopy Create free account
hub / github.com/codeaashu/claude-code / onAllow

Function onAllow

src/hooks/toolPermission/handlers/interactiveHandler.ts:154–182  ·  view source on GitHub ↗
(
      updatedInput,
      permissionUpdates: PermissionUpdate[],
      feedback?: string,
      contentBlocks?: ContentBlockParam[],
    )

Source from the content-addressed store, hash-verified

152 resolveOnce(ctx.cancelAndAbort(undefined, true))
153 },
154 async onAllow(
155 updatedInput,
156 permissionUpdates: PermissionUpdate[],
157 feedback?: string,
158 contentBlocks?: ContentBlockParam[],
159 ) {
160 if (!claim()) return // atomic check-and-mark before await
161
162 if (bridgeCallbacks && bridgeRequestId) {
163 bridgeCallbacks.sendResponse(bridgeRequestId, {
164 behavior: 'allow',
165 updatedInput,
166 updatedPermissions: permissionUpdates,
167 })
168 bridgeCallbacks.cancelRequest(bridgeRequestId)
169 }
170 channelUnsubscribe?.()
171
172 resolveOnce(
173 await ctx.handleUserAllow(
174 updatedInput,
175 permissionUpdates,
176 feedback,
177 permissionPromptStartTimeMs,
178 contentBlocks,
179 result.decisionReason,
180 ),
181 )
182 },
183 onReject(feedback?: string, contentBlocks?: ContentBlockParam[]) {
184 if (!claim()) return
185

Callers

nothing calls this directly

Calls 2

claimFunction · 0.85
resolveOnceFunction · 0.50

Tested by

no test coverage detected