clawd-code-sdk 0.6.1__tar.gz → 0.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/PKG-INFO +1 -1
  2. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/pyproject.toml +1 -1
  3. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/__init__.py +10 -2
  4. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/control.py +16 -0
  5. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/hooks.py +22 -0
  6. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/input_types.py +3 -7
  7. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/messages.py +1 -0
  8. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/options.py +20 -0
  9. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/output_types.py +1 -12
  10. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/prompts.py +28 -0
  11. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/server_info.py +3 -0
  12. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/settings.py +1 -1
  13. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/.gitignore +0 -0
  14. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/LICENSE +0 -0
  15. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/README.md +0 -0
  16. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/__init__.py +0 -0
  17. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_bundled/.gitignore +0 -0
  18. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_errors.py +0 -0
  19. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_internal/__init__.py +0 -0
  20. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_internal/message_parser.py +0 -0
  21. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_internal/query.py +0 -0
  22. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_internal/transport/__init__.py +0 -0
  23. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_internal/transport/subprocess_cli.py +0 -0
  24. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/_version.py +0 -0
  25. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/anthropic_types.py +0 -0
  26. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/client.py +0 -0
  27. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/list_sessions.py +0 -0
  28. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/mcp_utils.py +0 -0
  29. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/agents.py +0 -0
  30. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/base.py +0 -0
  31. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/content_blocks.py +0 -0
  32. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/mcp.py +0 -0
  33. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/permissions.py +0 -0
  34. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/prompt_requests.py +0 -0
  35. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/system_messages.py +0 -0
  36. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/models/thinking.py +0 -0
  37. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/py.typed +0 -0
  38. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/query.py +0 -0
  39. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/session.py +0 -0
  40. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/storage/ARCHITECTURE.md +0 -0
  41. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/storage/__init__.py +0 -0
  42. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/storage/helpers.py +0 -0
  43. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/storage/models.py +0 -0
  44. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/storage/replay.py +0 -0
  45. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/src/clawd_code_sdk/usage.py +0 -0
  46. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/__init__.py +0 -0
  47. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/conftest.py +0 -0
  48. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/__init__.py +0 -0
  49. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_agents_and_settings.py +0 -0
  50. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_dynamic_control.py +0 -0
  51. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_hook_events.py +0 -0
  52. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_hooks.py +0 -0
  53. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_include_partial_messages.py +0 -0
  54. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_mcp_tools.py +0 -0
  55. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_sdk_mcp_tools.py +0 -0
  56. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_slash_commands.py +0 -0
  57. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_stderr_callback.py +0 -0
  58. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_structured_output.py +0 -0
  59. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_subagent_invocation.py +0 -0
  60. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/e2e/test_tool_permissions.py +0 -0
  61. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/mcp_server.py +0 -0
  62. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/mock_claude_server.py +0 -0
  63. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_changelog.py +0 -0
  64. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_client.py +0 -0
  65. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_errors.py +0 -0
  66. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_image.png +0 -0
  67. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_integration.py +0 -0
  68. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_message_parser.py +0 -0
  69. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_sdk_mcp_integration.py +0 -0
  70. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_session.py +0 -0
  71. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_streaming_client.py +0 -0
  72. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_subprocess_buffering.py +0 -0
  73. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_tool_callbacks.py +0 -0
  74. {clawd_code_sdk-0.6.1 → clawd_code_sdk-0.6.2}/tests/test_transport.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clawd-code-sdk
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Python SDK for Claude Code
5
5
  Project-URL: Documentation, https://github.com/phil65/claude-agent-sdk-python
6
6
  Project-URL: Homepage, https://github.com/phil65/claude-agent-sdk-python
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "clawd-code-sdk"
3
- version = "0.6.1"
3
+ version = "0.6.2"
4
4
  description = "Python SDK for Claude Code"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -36,6 +36,8 @@ from .control import (
36
36
  SDKControlResponse,
37
37
  SDKControlRewindFilesRequest,
38
38
  SDKControlSetPermissionModeRequest,
39
+ SDKControlSetProactiveRequest,
40
+ SDKControlGetSettingsRequest,
39
41
  SDKControlStopTaskRequest,
40
42
  SDKHookCallbackRequest,
41
43
  control_request_adapter,
@@ -86,6 +88,7 @@ from .hooks import (
86
88
  UserPromptSubmitHookSpecificOutput,
87
89
  WorktreeCreateHookInput,
88
90
  WorktreeRemoveHookInput,
91
+ InstructionsLoadedHookInput,
89
92
  )
90
93
  from .input_types import (
91
94
  TOOL_INPUT_TYPES,
@@ -144,7 +147,6 @@ from .output_types import (
144
147
  AgentOutputTextContent,
145
148
  AgentOutputUsage,
146
149
  AgentServerToolUse,
147
- AgentSubAgentEnteredOutput,
148
150
  AskUserQuestionItem,
149
151
  AskUserQuestionOutput,
150
152
  BashOutput,
@@ -235,6 +237,7 @@ from .prompts import (
235
237
  UserDocumentPrompt,
236
238
  PlainTextMediaType,
237
239
  UserDocumentURLPrompt,
240
+ UserFilePrompt,
238
241
  UserImagePrompt,
239
242
  UserImageURLPrompt,
240
243
  UserPlainTextDocumentPrompt,
@@ -251,6 +254,7 @@ from .options import (
251
254
  NewSession,
252
255
  ResumeSession,
253
256
  SessionConfig,
257
+ ToolConfig,
254
258
  resolve_session_config,
255
259
  )
256
260
  from .permissions import (
@@ -314,7 +318,6 @@ __all__ = [
314
318
  "AgentOutputTextContent",
315
319
  "AgentOutputUsage",
316
320
  "AgentServerToolUse",
317
- "AgentSubAgentEnteredOutput",
318
321
  "ApiKeySource",
319
322
  "AskUserQuestion",
320
323
  "AskUserQuestionInput",
@@ -393,6 +396,7 @@ __all__ = [
393
396
  "Hooks",
394
397
  "ImageMediaType",
395
398
  "InitSystemMessage",
399
+ "InstructionsLoadedHookInput",
396
400
  "JSONRPCError",
397
401
  "JSONRPCErrorResponse",
398
402
  "JSONRPCMessage",
@@ -479,6 +483,7 @@ __all__ = [
479
483
  "ResultSuccessMessage",
480
484
  "ResumeSession",
481
485
  "SDKControlElicitationRequest",
486
+ "SDKControlGetSettingsRequest",
482
487
  "SDKControlInitializeRequest",
483
488
  "SDKControlInterruptRequest",
484
489
  "SDKControlMcpMessageRequest",
@@ -489,6 +494,7 @@ __all__ = [
489
494
  "SDKControlResponse",
490
495
  "SDKControlRewindFilesRequest",
491
496
  "SDKControlSetPermissionModeRequest",
497
+ "SDKControlSetProactiveRequest",
492
498
  "SDKControlStopTaskRequest",
493
499
  "SDKHookCallbackRequest",
494
500
  "SDKPermissionDenial",
@@ -536,6 +542,7 @@ __all__ = [
536
542
  "TodoWriteInput",
537
543
  "TodoWriteOutput",
538
544
  "TodoWriteToolUseResult",
545
+ "ToolConfig",
539
546
  "ToolInput",
540
547
  "ToolPermissionContext",
541
548
  "ToolProgressMessage",
@@ -550,6 +557,7 @@ __all__ = [
550
557
  "Usage",
551
558
  "UserDocumentPrompt",
552
559
  "UserDocumentURLPrompt",
560
+ "UserFilePrompt",
553
561
  "UserImagePrompt",
554
562
  "UserImageURLPrompt",
555
563
  "UserMessage",
@@ -206,6 +206,20 @@ class SDKControlElicitationRequest:
206
206
  requested_schema: dict[str, Any] | None = None
207
207
 
208
208
 
209
+ @dataclass(frozen=True, slots=True, kw_only=True)
210
+ class SDKControlGetSettingsRequest:
211
+ """Returns the effective merged settings and the raw per-source settings."""
212
+
213
+ subtype: Literal["get_settings"] = "get_settings"
214
+
215
+
216
+ @dataclass(frozen=True, slots=True, kw_only=True)
217
+ class SDKControlSetProactiveRequest:
218
+ """Sets proactive mode configuration."""
219
+
220
+ subtype: Literal["set_proactive"] = "set_proactive"
221
+
222
+
209
223
  ControlRequestUnion = Annotated[
210
224
  SDKControlInterruptRequest
211
225
  | SDKControlPermissionRequest
@@ -224,8 +238,10 @@ ControlRequestUnion = Annotated[
224
238
  | SDKControlMcpClearAuthRequest
225
239
  | SDKControlMcpOAuthCallbackUrlRequest
226
240
  | SDKControlRemoteControlRequest
241
+ | SDKControlSetProactiveRequest
227
242
  | SDKControlStopTaskRequest
228
243
  | SDKControlApplyFlagSettingsRequest
244
+ | SDKControlGetSettingsRequest
229
245
  | SDKControlElicitationRequest,
230
246
  Discriminator("subtype"),
231
247
  ]
@@ -38,6 +38,7 @@ HookEvent = Literal[
38
38
  "ConfigChange",
39
39
  "WorktreeCreate",
40
40
  "WorktreeRemove",
41
+ "InstructionsLoaded",
41
42
  ]
42
43
 
43
44
 
@@ -143,6 +144,8 @@ class PreToolUseHookInput(BaseHookInput):
143
144
  tool_name: str
144
145
  tool_input: dict[str, Any]
145
146
  tool_use_id: str
147
+ agent_id: NotRequired[str]
148
+ agent_type: NotRequired[str]
146
149
 
147
150
 
148
151
  class PostToolUseHookInput(BaseHookInput):
@@ -153,6 +156,8 @@ class PostToolUseHookInput(BaseHookInput):
153
156
  tool_input: dict[str, Any]
154
157
  tool_response: Any
155
158
  tool_use_id: str
159
+ agent_id: NotRequired[str]
160
+ agent_type: NotRequired[str]
156
161
 
157
162
 
158
163
  class PostToolUseFailureHookInput(BaseHookInput):
@@ -164,6 +169,8 @@ class PostToolUseFailureHookInput(BaseHookInput):
164
169
  tool_use_id: str
165
170
  error: str
166
171
  is_interrupt: NotRequired[bool]
172
+ agent_id: NotRequired[str]
173
+ agent_type: NotRequired[str]
167
174
 
168
175
 
169
176
  class UserPromptSubmitHookInput(BaseHookInput):
@@ -222,6 +229,8 @@ class PermissionRequestHookInput(BaseHookInput):
222
229
  tool_name: str
223
230
  tool_input: dict[str, Any]
224
231
  permission_suggestions: NotRequired[list[Any]]
232
+ agent_id: NotRequired[str]
233
+ agent_type: NotRequired[str]
225
234
 
226
235
 
227
236
  class SessionStartHookInput(BaseHookInput):
@@ -313,6 +322,18 @@ class ElicitationResultHookInput(BaseHookInput):
313
322
  content: NotRequired[dict[str, Any]]
314
323
 
315
324
 
325
+ class InstructionsLoadedHookInput(BaseHookInput):
326
+ """Input data for InstructionsLoaded hook events."""
327
+
328
+ hook_event_name: Literal["InstructionsLoaded"]
329
+ file_path: str
330
+ memory_type: Literal["User", "Project", "Local", "Managed"]
331
+ load_reason: Literal["session_start", "nested_traversal", "path_glob_match", "include"]
332
+ globs: NotRequired[list[str]]
333
+ trigger_file_path: NotRequired[str]
334
+ parent_file_path: NotRequired[str]
335
+
336
+
316
337
  # Union type for all hook inputs
317
338
  HookInput = (
318
339
  PreToolUseHookInput
@@ -333,6 +354,7 @@ HookInput = (
333
354
  | ElicitationHookInput
334
355
  | ElicitationResultHookInput
335
356
  | ConfigChangeHookInput
357
+ | InstructionsLoadedHookInput
336
358
  | WorktreeCreateHookInput
337
359
  | WorktreeRemoveHookInput
338
360
  )
@@ -10,7 +10,7 @@ from typing import Literal, NotRequired, TypedDict
10
10
 
11
11
  from pydantic import ConfigDict, with_config
12
12
 
13
- from clawd_code_sdk.models.base import ModelName, PermissionMode # noqa: TC001
13
+ from clawd_code_sdk.models.base import PermissionMode # noqa: TC001
14
14
 
15
15
 
16
16
  _extra_allow = with_config(ConfigDict(extra="allow"))
@@ -28,16 +28,10 @@ class AgentInput(TypedDict):
28
28
  """The task for the agent to perform."""
29
29
  subagent_type: str
30
30
  """The type of specialized agent to use for this task."""
31
- model: NotRequired[ModelName]
32
- """Optional model to use for the agent."""
33
31
  resume: NotRequired[str]
34
32
  """Optional agent ID to resume from in order to continue from the previous exec transcript."""
35
33
  run_in_background: NotRequired[bool]
36
34
  """Whether to run the agent in the background."""
37
- max_turns: NotRequired[int]
38
- """Maximum number of agentic turns (API round-trips) before stopping.
39
-
40
- Used internally for warmup."""
41
35
  name: NotRequired[str]
42
36
  """Name for the spawned agent."""
43
37
  team_name: NotRequired[str]
@@ -54,6 +48,8 @@ class AskUserQuestionOption(TypedDict):
54
48
  """Display text for this option (1-5 words)."""
55
49
  description: str
56
50
  """Explanation of what this option means."""
51
+ preview: NotRequired[str]
52
+ """Optional preview content rendered when this option is focused."""
57
53
 
58
54
 
59
55
  @_extra_allow
@@ -181,6 +181,7 @@ class UserMessage(BaseMessage):
181
181
  ) = None
182
182
  isReplay: bool | None = None # noqa: N815
183
183
  isSynthetic: bool | None = None # noqa: N815
184
+ priority: Literal["now", "next", "later"] | None = None
184
185
 
185
186
  def parse_command_output(self) -> str | None:
186
187
  """Extract output from legacy XML-tagged command output in user messages."""
@@ -24,6 +24,21 @@ if TYPE_CHECKING:
24
24
  logger = logging.getLogger(__name__)
25
25
 
26
26
 
27
+ @dataclass(kw_only=True)
28
+ class AskUserQuestionToolConfig:
29
+ """Configuration for the AskUserQuestion tool."""
30
+
31
+ preview_format: Literal["markdown", "html"] | None = None
32
+ """Content format for the preview field on question options."""
33
+
34
+
35
+ @dataclass(kw_only=True)
36
+ class ToolConfig:
37
+ """Per-tool configuration for built-in tools."""
38
+
39
+ ask_user_question: AskUserQuestionToolConfig | None = None
40
+
41
+
27
42
  # ============================================================================
28
43
  # Session configuration
29
44
  # ============================================================================
@@ -275,6 +290,11 @@ class ClaudeAgentOptions:
275
290
  When enabled, files can be rewound to their state at any user message
276
291
  using `ClaudeSDKClient.rewind_files()`.
277
292
  """
293
+ # TODO: tool_config is defined in upstream sdk.d.ts Options but not yet
294
+ # present in the CC settings JSON schema. Uncomment once settings.py is
295
+ # regenerated with the toolConfig field so it flows through --settings.
296
+ # tool_config: ToolConfig | None = None
297
+ # """Per-tool configuration for built-in tools."""
278
298
  agent: str | None = None
279
299
  """Agent name for the main thread. The agent must be defined in `agents` or settings."""
280
300
  context_1m: bool = False
@@ -108,18 +108,7 @@ class AgentAsyncLaunchedOutput(TypedDict):
108
108
  """Whether the calling agent has Read/Bash tools to check progress."""
109
109
 
110
110
 
111
- class AgentSubAgentEnteredOutput(TypedDict):
112
- """Output from the Task tool when entering a sub-agent context."""
113
-
114
- status: Literal["sub_agent_entered"]
115
- """Indicates a sub-agent context was entered."""
116
- description: str
117
- """Description of the sub-agent task."""
118
- message: str
119
- """Status message."""
120
-
121
-
122
- AgentOutput = AgentCompletedOutput | AgentAsyncLaunchedOutput | AgentSubAgentEnteredOutput
111
+ AgentOutput = AgentCompletedOutput | AgentAsyncLaunchedOutput
123
112
 
124
113
 
125
114
  # ---------------------------------------------------------------------------
@@ -151,6 +151,33 @@ class UserPlainTextDocumentPrompt:
151
151
  return block
152
152
 
153
153
 
154
+ @dataclass
155
+ class UserFilePrompt:
156
+ """A user prompt referencing a file uploaded via the Anthropic Files API."""
157
+
158
+ file_id: str
159
+ """Anthropic file identifier (e.g. 'file_abc123')."""
160
+ title: str | None = None
161
+ """Optional document title."""
162
+ context: str | None = None
163
+ """Optional context about the document."""
164
+
165
+ def to_content_block(self) -> dict[str, Any]:
166
+ """Return the Anthropic API content block dict."""
167
+ block: dict[str, Any] = {
168
+ "type": "document",
169
+ "source": {
170
+ "type": "file",
171
+ "file_id": self.file_id,
172
+ },
173
+ }
174
+ if self.title is not None:
175
+ block["title"] = self.title
176
+ if self.context is not None:
177
+ block["context"] = self.context
178
+ return block
179
+
180
+
154
181
  UserPrompt = (
155
182
  UserTextPrompt
156
183
  | UserImagePrompt
@@ -158,5 +185,6 @@ UserPrompt = (
158
185
  | UserDocumentPrompt
159
186
  | UserDocumentURLPrompt
160
187
  | UserPlainTextDocumentPrompt
188
+ | UserFilePrompt
161
189
  )
162
190
  """Union type for all user prompt dataclasses."""
@@ -34,6 +34,9 @@ class ClaudeCodeModelInfo(ClaudeCodeBaseModel):
34
34
  supports_adaptive_thinking: bool | None = None
35
35
  """Whether the model supports adaptive thinking."""
36
36
 
37
+ supports_fast_mode: bool | None = None
38
+ """Whether the model supports fast mode."""
39
+
37
40
 
38
41
  class ClaudeCodeCommandInfo(ClaudeCodeBaseModel):
39
42
  """Information about an available slash command from Claude Code."""
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: claude-code-settings-titled.json
3
- # timestamp: 2026-03-04T18:35:14+00:00
3
+ # timestamp: 2026-03-05T01:14:35+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
File without changes
File without changes