- Align PermissionResult structure with TypeScript SDK
- Add PermissionResultAllow with updatedInput and updatedPermissions
- Add PermissionResultDeny with message and interrupt flag
- Remove misleading ToolPermissionResponse alias (no actual backward compat)
- Add PermissionUpdate types matching TypeScript
- PermissionUpdate with all update types
- PermissionRuleValue for rule definitions
- PermissionUpdateDestination and PermissionBehavior literals
- Update all tests and examples to use new types
- Update Query handler to properly handle Allow/Deny variants
Breaking change: Callbacks must now return PermissionResultAllow or
PermissionResultDeny instead of the old ToolPermissionResponse format.
This ensures full compatibility with TypeScript SDK's permission system.
- Rename tool_permission_callback to can_use_tool in ClaudeCodeOptions
- Rename ToolPermissionCallback type to CanUseTool
- Update all references in examples and tests
- Remove dict backward compatibility (already done by user)
Addresses PR review comments for better SDK consistency
- Added ToolPermissionCallback type for controlling tool execution
- Added HookCallback type for intercepting tool events
- Added callbacks to ClaudeCodeOptions
- Thread callbacks through InternalClient and ClaudeSDKClient to Query
- Updated Query to handle tool permission requests with new types
- Support both ToolPermissionResponse and dict returns for compatibility
- Added example demonstrating permission control and input modification
- Added comprehensive tests for callbacks functionality
- Fixed NotRequired import for Python 3.11+ compatibility