2272
return { kind: 'reject' };
2273
}
2275
>
// For write permission requests, build a FileEdit preview so the
2276
>
// client can show a diff before the user approves or denies. This
2277
>
// awaits async filesystem operations; the SDK already calls
2278
>
// `handlePermissionRequest` from an arbitrary async context, so the
2279
>
// extra await here is fine.
2280
>
const edits = await this._buildEditsForPermission(request, toolCallId);
2281
>
2282
>
// If the session was aborted/disposed while we were building the
2283
>
// preview, the deferred has already been resolved and the
2284
>
// `pending-edit-content:` entry has been cleaned up. Bail without
2285
>
// firing tool_ready.
2286
>
if (!this._pendingPermissions.has(toolCallId)) {
2287
return { kind: 'reject' };
2288
}