diff --git a/examples/hooks.py b/examples/hooks.py index 18bd8815..06b8f8d5 100644 --- a/examples/hooks.py +++ b/examples/hooks.py @@ -15,9 +15,10 @@ import sys from typing import Any -from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient -from claude_agent_sdk.types import ( +from claude_agent_sdk import ( AssistantMessage, + ClaudeAgentOptions, + ClaudeSDKClient, HookContext, HookJSONOutput, HookMatcher, @@ -84,7 +85,9 @@ async def add_custom_instructions( async def example_pretooluse() -> None: """Basic example demonstrating hook protection.""" print("=== PreToolUse Example ===") - print("This example demonstrates how PreToolUse can block some bash commands but not others.\n") + print( + "This example demonstrates how PreToolUse can block some bash commands but not others.\n" + ) # Configure hooks using ClaudeAgentOptions options = ClaudeAgentOptions( @@ -93,7 +96,7 @@ async def example_pretooluse() -> None: "PreToolUse": [ HookMatcher(matcher="Bash", hooks=[check_bash_command]), ], - } + }, ) async with ClaudeSDKClient(options=options) as client: diff --git a/src/claude_agent_sdk/__init__.py b/src/claude_agent_sdk/__init__.py index 01f5a576..45eccec4 100644 --- a/src/claude_agent_sdk/__init__.py +++ b/src/claude_agent_sdk/__init__.py @@ -23,6 +23,7 @@ ContentBlock, HookCallback, HookContext, + HookJSONOutput, HookMatcher, McpSdkServerConfig, McpServerConfig, @@ -308,6 +309,7 @@ async def call_tool(name: str, arguments: dict[str, Any]) -> Any: "PermissionUpdate", "HookCallback", "HookContext", + "HookJSONOutput", "HookMatcher", # Agent support "AgentDefinition",