MCPcopy Index your code
hub / github.com/codeaashu/claude-code / onAllow

Function onAllow

src/utils/swarm/inProcessRunner.ts:250–291  ·  view source on GitHub ↗
(
              updatedInput: Record<string, unknown>,
              permissionUpdates: PermissionUpdate[],
              feedback?: string,
              contentBlocks?: ContentBlockParam[],
            )

Source from the content-addressed store, hash-verified

248 resolve({ behavior: 'ask', message: SUBAGENT_REJECT_MESSAGE })
249 },
250 async onAllow(
251 updatedInput: Record<string, unknown>,
252 permissionUpdates: PermissionUpdate[],
253 feedback?: string,
254 contentBlocks?: ContentBlockParam[],
255 ) {
256 if (decisionMade) return
257 decisionMade = true
258 abortController.signal.removeEventListener(
259 'abort',
260 onAbortListener,
261 )
262 reportPermissionWait()
263 persistPermissionUpdates(permissionUpdates)
264 // Write back permission updates to the leader's shared context
265 if (permissionUpdates.length > 0) {
266 const setToolPermissionContext =
267 getLeaderSetToolPermissionContext()
268 if (setToolPermissionContext) {
269 const currentAppState = toolUseContext.getAppState()
270 const updatedContext = applyPermissionUpdates(
271 currentAppState.toolPermissionContext,
272 permissionUpdates,
273 )
274 // Preserve the leader's mode to prevent workers'
275 // transformed 'acceptEdits' context from leaking back
276 // to the coordinator
277 setToolPermissionContext(updatedContext, {
278 preserveMode: true,
279 })
280 }
281 }
282 const trimmedFeedback = feedback?.trim()
283 resolve({
284 behavior: 'allow',
285 updatedInput,
286 userModified: false,
287 acceptFeedback: trimmedFeedback || undefined,
288 ...(contentBlocks &&
289 contentBlocks.length > 0 && { contentBlocks }),
290 })
291 },
292 onReject(feedback?: string, contentBlocks?: ContentBlockParam[]) {
293 if (decisionMade) return
294 decisionMade = true

Callers

nothing calls this directly

Calls 8

reportPermissionWaitFunction · 0.85
persistPermissionUpdatesFunction · 0.85
applyPermissionUpdatesFunction · 0.85
setToolPermissionContextFunction · 0.85
keysMethod · 0.80
cleanupFunction · 0.70
resolveFunction · 0.50

Tested by

no test coverage detected