clawd-code-sdk 0.6.2__tar.gz → 0.6.3__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.
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/PKG-INFO +1 -1
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/pyproject.toml +1 -1
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/__init__.py +4 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/client.py +4 -2
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/mcp_utils.py +4 -4
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/__init__.py +10 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/input_types.py +1 -1
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/mcp.py +31 -2
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/output_types.py +2 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/prompts.py +15 -32
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/settings.py +60 -7
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_transport.py +7 -1
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/.gitignore +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/LICENSE +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/README.md +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_bundled/.gitignore +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_errors.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_internal/__init__.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_internal/message_parser.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_internal/query.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_internal/transport/__init__.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_internal/transport/subprocess_cli.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_version.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/anthropic_types.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/list_sessions.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/agents.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/base.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/content_blocks.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/control.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/hooks.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/messages.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/options.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/permissions.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/prompt_requests.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/server_info.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/system_messages.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/models/thinking.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/py.typed +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/query.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/session.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/storage/ARCHITECTURE.md +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/storage/__init__.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/storage/helpers.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/storage/models.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/storage/replay.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/usage.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/__init__.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/conftest.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/__init__.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_agents_and_settings.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_dynamic_control.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_hook_events.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_hooks.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_include_partial_messages.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_mcp_tools.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_sdk_mcp_tools.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_slash_commands.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_stderr_callback.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_structured_output.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_subagent_invocation.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/e2e/test_tool_permissions.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/mcp_server.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/mock_claude_server.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_changelog.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_client.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_errors.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_image.png +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_integration.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_message_parser.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_sdk_mcp_integration.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_session.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_streaming_client.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_subprocess_buffering.py +0 -0
- {clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/tests/test_tool_callbacks.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clawd-code-sdk
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
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
|
|
@@ -47,7 +47,9 @@ from .models import (
|
|
|
47
47
|
PromptHookHandler,
|
|
48
48
|
ListSessionsOptions,
|
|
49
49
|
McpSdkServerConfig,
|
|
50
|
+
McpSdkServerConfigWithInstance,
|
|
50
51
|
McpServerConfig,
|
|
52
|
+
McpSetServersResult,
|
|
51
53
|
Message,
|
|
52
54
|
NotificationHookInput,
|
|
53
55
|
NotificationHookSpecificOutput,
|
|
@@ -171,7 +173,9 @@ __all__ = [
|
|
|
171
173
|
"InvalidRequestError",
|
|
172
174
|
"ListSessionsOptions",
|
|
173
175
|
"McpSdkServerConfig",
|
|
176
|
+
"McpSdkServerConfigWithInstance",
|
|
174
177
|
"McpServerConfig",
|
|
178
|
+
"McpSetServersResult",
|
|
175
179
|
"Message",
|
|
176
180
|
"Network",
|
|
177
181
|
"NewSession",
|
|
@@ -14,6 +14,7 @@ from clawd_code_sdk.models import (
|
|
|
14
14
|
AssistantMessage,
|
|
15
15
|
ClaudeAgentOptions,
|
|
16
16
|
ClaudeCodeAgentInfo, # noqa: TC001
|
|
17
|
+
McpSetServersResult,
|
|
17
18
|
McpStatusResponse,
|
|
18
19
|
ResultErrorMessage,
|
|
19
20
|
ResultMessage,
|
|
@@ -286,7 +287,7 @@ class ClaudeSDKClient:
|
|
|
286
287
|
result = await query.get_mcp_status()
|
|
287
288
|
return McpStatusResponse.model_validate(result)
|
|
288
289
|
|
|
289
|
-
async def set_mcp_servers(self, servers: dict[str, McpServerConfig]) ->
|
|
290
|
+
async def set_mcp_servers(self, servers: dict[str, McpServerConfig]) -> McpSetServersResult:
|
|
290
291
|
"""Add, replace, or remove MCP servers dynamically mid-session.
|
|
291
292
|
|
|
292
293
|
Allows dynamic registration of MCP servers without restarting the session.
|
|
@@ -312,7 +313,8 @@ class ClaudeSDKClient:
|
|
|
312
313
|
server_dict = dict(config)
|
|
313
314
|
server_dict["name"] = name
|
|
314
315
|
wire_servers[name] = server_dict
|
|
315
|
-
|
|
316
|
+
result = await query.set_mcp_servers(wire_servers)
|
|
317
|
+
return McpSetServersResult.model_validate(result)
|
|
316
318
|
|
|
317
319
|
async def mcp_reconnect(self, server_name: str) -> None:
|
|
318
320
|
"""Reconnect to an MCP server."""
|
|
@@ -7,7 +7,7 @@ from typing import TYPE_CHECKING, Any, assert_never
|
|
|
7
7
|
|
|
8
8
|
from pydantic import AnyUrl, TypeAdapter
|
|
9
9
|
|
|
10
|
-
from clawd_code_sdk.models import
|
|
10
|
+
from clawd_code_sdk.models import McpSdkServerConfigWithInstance
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
if TYPE_CHECKING:
|
|
@@ -86,7 +86,7 @@ def create_sdk_mcp_server(
|
|
|
86
86
|
name: str,
|
|
87
87
|
version: str = "1.0.0",
|
|
88
88
|
tools: list[SdkMcpTool[Any]] | None = None,
|
|
89
|
-
) ->
|
|
89
|
+
) -> McpSdkServerConfigWithInstance:
|
|
90
90
|
"""Create an in-process MCP server that runs within your Python application.
|
|
91
91
|
|
|
92
92
|
Server lifecycle is managed automatically by the SDK
|
|
@@ -107,7 +107,7 @@ def create_sdk_mcp_server(
|
|
|
107
107
|
If None or empty, the server will have no tools (rarely useful).
|
|
108
108
|
|
|
109
109
|
Returns:
|
|
110
|
-
|
|
110
|
+
McpSdkServerConfigWithInstance: A configuration object that can be passed to
|
|
111
111
|
ClaudeAgentOptions.mcp_servers. This config contains the server
|
|
112
112
|
instance and metadata needed for the SDK to route tool calls.
|
|
113
113
|
|
|
@@ -231,4 +231,4 @@ def create_sdk_mcp_server(
|
|
|
231
231
|
return content
|
|
232
232
|
|
|
233
233
|
# Return SDK server configuration
|
|
234
|
-
return
|
|
234
|
+
return McpSdkServerConfigWithInstance(type="sdk", name=name, instance=server)
|
|
@@ -126,10 +126,15 @@ from .mcp import (
|
|
|
126
126
|
JSONRPCResultResponse,
|
|
127
127
|
McpConnectionStatus,
|
|
128
128
|
McpHttpServerConfig,
|
|
129
|
+
McpClaudeAIProxyServerConfig,
|
|
129
130
|
McpSdkServerConfig,
|
|
131
|
+
McpSdkServerConfigWithInstance,
|
|
130
132
|
McpServerConfig,
|
|
133
|
+
McpServerConfigForProcessTransport,
|
|
134
|
+
McpServerStatusConfig,
|
|
131
135
|
McpServerStatusEntry,
|
|
132
136
|
McpServerVersionInfo,
|
|
137
|
+
McpSetServersResult,
|
|
133
138
|
McpSSEServerConfig,
|
|
134
139
|
McpStatusResponse,
|
|
135
140
|
McpStdioServerConfig,
|
|
@@ -410,16 +415,21 @@ __all__ = [
|
|
|
410
415
|
"ListMcpResourcesOutput",
|
|
411
416
|
"ListSessionsOptions",
|
|
412
417
|
"LocalCommandOutputMessage",
|
|
418
|
+
"McpClaudeAIProxyServerConfig",
|
|
413
419
|
"McpConnectionStatus",
|
|
414
420
|
"McpHttpServerConfig",
|
|
415
421
|
"McpOutput",
|
|
416
422
|
"McpResourceEntry",
|
|
417
423
|
"McpSSEServerConfig",
|
|
418
424
|
"McpSdkServerConfig",
|
|
425
|
+
"McpSdkServerConfigWithInstance",
|
|
419
426
|
"McpServerConfig",
|
|
427
|
+
"McpServerConfigForProcessTransport",
|
|
420
428
|
"McpServerStatus",
|
|
429
|
+
"McpServerStatusConfig",
|
|
421
430
|
"McpServerStatusEntry",
|
|
422
431
|
"McpServerVersionInfo",
|
|
432
|
+
"McpSetServersResult",
|
|
423
433
|
"McpStatusResponse",
|
|
424
434
|
"McpStdioServerConfig",
|
|
425
435
|
"McpToolStatus",
|
|
@@ -26,7 +26,7 @@ class AgentInput(TypedDict):
|
|
|
26
26
|
"""A short (3-5 word) description of the task."""
|
|
27
27
|
prompt: str
|
|
28
28
|
"""The task for the agent to perform."""
|
|
29
|
-
subagent_type: str
|
|
29
|
+
subagent_type: NotRequired[str]
|
|
30
30
|
"""The type of specialized agent to use for this task."""
|
|
31
31
|
resume: NotRequired[str]
|
|
32
32
|
"""Optional agent ID to resume from in order to continue from the previous exec transcript."""
|
|
@@ -94,19 +94,47 @@ class McpHttpServerConfig(TypedDict):
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
class McpSdkServerConfig(TypedDict):
|
|
97
|
-
"""SDK MCP server configuration."""
|
|
97
|
+
"""SDK MCP server configuration (serializable, no instance)."""
|
|
98
98
|
|
|
99
99
|
type: Literal["sdk"]
|
|
100
100
|
name: str
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class McpSdkServerConfigWithInstance(McpSdkServerConfig):
|
|
104
|
+
"""SDK MCP server config with a live McpServer instance. Not serializable."""
|
|
105
|
+
|
|
101
106
|
instance: McpServer
|
|
102
107
|
|
|
103
108
|
|
|
104
109
|
ExternalMcpServerConfig = McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig
|
|
105
110
|
|
|
106
111
|
McpServerConfig = (
|
|
112
|
+
McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig | McpSdkServerConfigWithInstance
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class McpClaudeAIProxyServerConfig(TypedDict):
|
|
117
|
+
"""MCP Claude AI proxy server configuration."""
|
|
118
|
+
|
|
119
|
+
type: Literal["claudeai-proxy"]
|
|
120
|
+
url: str
|
|
121
|
+
id: str
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
McpServerConfigForProcessTransport = (
|
|
107
125
|
McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig | McpSdkServerConfig
|
|
108
126
|
)
|
|
109
127
|
|
|
128
|
+
McpServerStatusConfig = McpServerConfigForProcessTransport | McpClaudeAIProxyServerConfig
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class McpSetServersResult(ClaudeCodeBaseModel):
|
|
132
|
+
"""Result of a setMcpServers operation."""
|
|
133
|
+
|
|
134
|
+
added: list[str] = Field(default_factory=list)
|
|
135
|
+
removed: list[str] = Field(default_factory=list)
|
|
136
|
+
errors: dict[str, str] = Field(default_factory=dict)
|
|
137
|
+
|
|
110
138
|
|
|
111
139
|
class SdkPluginConfig(ClaudeCodeBaseModel):
|
|
112
140
|
"""SDK plugin configuration.
|
|
@@ -161,7 +189,8 @@ class McpServerStatusEntry(ClaudeCodeBaseModel):
|
|
|
161
189
|
name: str
|
|
162
190
|
status: McpConnectionStatus
|
|
163
191
|
server_info: McpServerVersionInfo | None = None
|
|
164
|
-
|
|
192
|
+
error: str | None = None
|
|
193
|
+
config: McpServerStatusConfig | None = None
|
|
165
194
|
scope: Literal["project", "user", "local", "claudeai", "managed"] | str | None = None # noqa: PYI051
|
|
166
195
|
tools: list[McpToolStatus] = Field(default_factory=list)
|
|
167
196
|
|
|
@@ -145,6 +145,8 @@ class BashOutput(TypedDict):
|
|
|
145
145
|
"""Path to persisted full output (when output is too large for inline)."""
|
|
146
146
|
persistedOutputSize: NotRequired[int]
|
|
147
147
|
"""Total size of the output in bytes (when output is too large for inline)."""
|
|
148
|
+
tokenSaverOutput: NotRequired[str]
|
|
149
|
+
"""Compressed output sent to model when token-saver is active (UI still uses stdout)."""
|
|
148
150
|
|
|
149
151
|
|
|
150
152
|
# ---------------------------------------------------------------------------
|
|
@@ -57,10 +57,7 @@ class UserImageURLPrompt:
|
|
|
57
57
|
"""Return the Anthropic API content block dict."""
|
|
58
58
|
return {
|
|
59
59
|
"type": "image",
|
|
60
|
-
"source": {
|
|
61
|
-
"type": "url",
|
|
62
|
-
"url": self.url,
|
|
63
|
-
},
|
|
60
|
+
"source": {"type": "url", "url": self.url},
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
|
|
@@ -86,12 +83,10 @@ class UserDocumentPrompt:
|
|
|
86
83
|
"media_type": self.media_type,
|
|
87
84
|
"data": self.document_data,
|
|
88
85
|
},
|
|
86
|
+
"title": self.title,
|
|
87
|
+
"context": self.context,
|
|
89
88
|
}
|
|
90
|
-
|
|
91
|
-
block["title"] = self.title
|
|
92
|
-
if self.context is not None:
|
|
93
|
-
block["context"] = self.context
|
|
94
|
-
return block
|
|
89
|
+
return {k: v for k, v in block.items() if v is not None}
|
|
95
90
|
|
|
96
91
|
|
|
97
92
|
@dataclass
|
|
@@ -109,16 +104,11 @@ class UserDocumentURLPrompt:
|
|
|
109
104
|
"""Return the Anthropic API content block dict."""
|
|
110
105
|
block: dict[str, Any] = {
|
|
111
106
|
"type": "document",
|
|
112
|
-
"source": {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
107
|
+
"source": {"type": "url", "url": self.url},
|
|
108
|
+
"title": self.title,
|
|
109
|
+
"context": self.context,
|
|
116
110
|
}
|
|
117
|
-
|
|
118
|
-
block["title"] = self.title
|
|
119
|
-
if self.context is not None:
|
|
120
|
-
block["context"] = self.context
|
|
121
|
-
return block
|
|
111
|
+
return {k: v for k, v in block.items() if v is not None}
|
|
122
112
|
|
|
123
113
|
|
|
124
114
|
@dataclass
|
|
@@ -143,12 +133,10 @@ class UserPlainTextDocumentPrompt:
|
|
|
143
133
|
"media_type": self.media_type,
|
|
144
134
|
"data": self.data,
|
|
145
135
|
},
|
|
136
|
+
"title": self.title,
|
|
137
|
+
"context": self.context,
|
|
146
138
|
}
|
|
147
|
-
|
|
148
|
-
block["title"] = self.title
|
|
149
|
-
if self.context is not None:
|
|
150
|
-
block["context"] = self.context
|
|
151
|
-
return block
|
|
139
|
+
return {k: v for k, v in block.items() if v is not None}
|
|
152
140
|
|
|
153
141
|
|
|
154
142
|
@dataclass
|
|
@@ -166,16 +154,11 @@ class UserFilePrompt:
|
|
|
166
154
|
"""Return the Anthropic API content block dict."""
|
|
167
155
|
block: dict[str, Any] = {
|
|
168
156
|
"type": "document",
|
|
169
|
-
"source": {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
},
|
|
157
|
+
"source": {"type": "file", "file_id": self.file_id},
|
|
158
|
+
"title": self.title,
|
|
159
|
+
"context": self.context,
|
|
173
160
|
}
|
|
174
|
-
|
|
175
|
-
block["title"] = self.title
|
|
176
|
-
if self.context is not None:
|
|
177
|
-
block["context"] = self.context
|
|
178
|
-
return block
|
|
161
|
+
return {k: v for k, v in block.items() if v is not None}
|
|
179
162
|
|
|
180
163
|
|
|
181
164
|
UserPrompt = (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: claude-code-settings-titled.json
|
|
3
|
-
# timestamp: 2026-03-
|
|
3
|
+
# timestamp: 2026-03-06T02:05:16+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -391,6 +391,20 @@ class StrictMarketplaceDirectory(ClaudeCodeBaseModel):
|
|
|
391
391
|
"""
|
|
392
392
|
|
|
393
393
|
|
|
394
|
+
class StrictMarketplacePathPattern(ClaudeCodeBaseModel):
|
|
395
|
+
model_config = ConfigDict(
|
|
396
|
+
extra="forbid",
|
|
397
|
+
)
|
|
398
|
+
source: Literal["pathPattern"] = "pathPattern"
|
|
399
|
+
"""
|
|
400
|
+
Identifies the marketplace source type
|
|
401
|
+
"""
|
|
402
|
+
path_pattern: str = Field(..., alias="pathPattern")
|
|
403
|
+
"""
|
|
404
|
+
Regex pattern to match file or directory paths for marketplace sources
|
|
405
|
+
"""
|
|
406
|
+
|
|
407
|
+
|
|
394
408
|
class SkippedMarketplace(AdditionalDirectory):
|
|
395
409
|
pass
|
|
396
410
|
|
|
@@ -493,6 +507,12 @@ class Sandbox(ClaudeCodeBaseModel):
|
|
|
493
507
|
"""
|
|
494
508
|
Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed.
|
|
495
509
|
"""
|
|
510
|
+
enable_weaker_network_isolation: bool | None = Field(
|
|
511
|
+
False, alias="enableWeakerNetworkIsolation"
|
|
512
|
+
)
|
|
513
|
+
"""
|
|
514
|
+
macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/settings#sandbox-settings
|
|
515
|
+
"""
|
|
496
516
|
enable_weaker_nested_sandbox: bool | None = Field(None, alias="enableWeakerNestedSandbox")
|
|
497
517
|
"""
|
|
498
518
|
Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable.Default: false (secure).
|
|
@@ -536,7 +556,7 @@ class Tip(AdditionalDirectory):
|
|
|
536
556
|
|
|
537
557
|
|
|
538
558
|
class SpinnerTipsOverride(ClaudeCodeBaseModel):
|
|
539
|
-
"""Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings."""
|
|
559
|
+
"""Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings."""
|
|
540
560
|
|
|
541
561
|
model_config = ConfigDict(
|
|
542
562
|
extra="forbid",
|
|
@@ -685,6 +705,20 @@ class BlockedMarketplaceHostPattern(ClaudeCodeBaseModel):
|
|
|
685
705
|
"""
|
|
686
706
|
|
|
687
707
|
|
|
708
|
+
class BlockedMarketplacePathPattern(ClaudeCodeBaseModel):
|
|
709
|
+
model_config = ConfigDict(
|
|
710
|
+
extra="forbid",
|
|
711
|
+
)
|
|
712
|
+
source: Literal["pathPattern"] = "pathPattern"
|
|
713
|
+
"""
|
|
714
|
+
Block marketplace by file/directory path pattern matching
|
|
715
|
+
"""
|
|
716
|
+
path_pattern: str = Field(..., alias="pathPattern")
|
|
717
|
+
"""
|
|
718
|
+
Regex pattern to match file or directory paths for marketplace sources
|
|
719
|
+
"""
|
|
720
|
+
|
|
721
|
+
|
|
688
722
|
class PermissionRule(RootModel[str]):
|
|
689
723
|
model_config = ConfigDict(
|
|
690
724
|
regex_engine="python-re",
|
|
@@ -705,13 +739,14 @@ class PermissionRule(RootModel[str]):
|
|
|
705
739
|
"Read(./secrets/**)",
|
|
706
740
|
"Read(//Users/alice/secrets/**)",
|
|
707
741
|
"Read(~/Documents/*.pdf)",
|
|
742
|
+
"Agent(Explore)",
|
|
708
743
|
"Task(Explore)",
|
|
709
744
|
"WebFetch",
|
|
710
745
|
"WebFetch(domain:example.com)",
|
|
711
746
|
"mcp__puppeteer",
|
|
712
747
|
"mcp__github__search_repositories",
|
|
713
748
|
],
|
|
714
|
-
pattern="^((Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LS|LSP|MultiEdit|NotebookEdit|NotebookRead|Read|Skill|Task|TaskCreate|TaskGet|TaskList|TaskOutput|TaskStop|TaskUpdate|TodoWrite|ToolSearch|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",
|
|
749
|
+
pattern="^((Agent|Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LS|LSP|MultiEdit|NotebookEdit|NotebookRead|Read|Skill|Task|TaskCreate|TaskGet|TaskList|TaskOutput|TaskStop|TaskUpdate|TodoWrite|ToolSearch|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",
|
|
715
750
|
)
|
|
716
751
|
"""
|
|
717
752
|
Tool permission rule.
|
|
@@ -885,7 +920,7 @@ class Permissions(ClaudeCodeBaseModel):
|
|
|
885
920
|
"default": prompts on first use.
|
|
886
921
|
"acceptEdits": auto-accepts file edits.
|
|
887
922
|
"plan": read-only, no modifications.
|
|
888
|
-
"delegate": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).
|
|
923
|
+
UNDOCUMENTED. "delegate": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).
|
|
889
924
|
"dontAsk": auto-denies unless pre-approved via permissions.
|
|
890
925
|
"bypassPermissions": skips all prompts (use only in isolated environments).
|
|
891
926
|
See https://code.claude.com/docs/en/permissions
|
|
@@ -962,6 +997,10 @@ class Hooks(ClaudeCodeBaseModel):
|
|
|
962
997
|
"""
|
|
963
998
|
UNDOCUMENTED. Hooks that run during repository initialization (--init, --init-only) or maintenance (--maintenance)
|
|
964
999
|
"""
|
|
1000
|
+
instructions_loaded: list[HookMatcher] | None = Field(None, alias="InstructionsLoaded")
|
|
1001
|
+
"""
|
|
1002
|
+
Hooks that run when a CLAUDE.md or .claude/rules/*.md file is loaded into context. Fires at session start and when files are lazily loaded (e.g., nested traversal, path glob match). No decision control; used for audit logging and observability. Does not support matchers. See https://code.claude.com/docs/en/hooks#instructionsloaded
|
|
1003
|
+
"""
|
|
965
1004
|
config_change: list[HookMatcher] | None = Field(None, alias="ConfigChange")
|
|
966
1005
|
"""
|
|
967
1006
|
Hooks that run when settings, managed settings, or skill files change during a session. Supports matchers: user_settings, project_settings, local_settings, policy_settings, skills. Command handlers only. Exit code 2 blocks the change (except policy_settings which is audit-only). See https://code.claude.com/docs/en/hooks#configchange
|
|
@@ -1046,6 +1085,10 @@ class ClaudeCodeSettings(ClaudeCodeBaseModel):
|
|
|
1046
1085
|
"""
|
|
1047
1086
|
Customize attribution for git commits and pull requests. See https://code.claude.com/docs/en/settings#attribution-settings
|
|
1048
1087
|
"""
|
|
1088
|
+
include_git_instructions: bool | None = Field(True, alias="includeGitInstructions")
|
|
1089
|
+
"""
|
|
1090
|
+
Include built-in git commit and PR workflow instructions in Claude's system prompt. Also configurable via CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable (set to 1 to disable). See https://code.claude.com/docs/en/settings#available-settings
|
|
1091
|
+
"""
|
|
1049
1092
|
include_co_authored_by: bool | None = Field(True, alias="includeCoAuthoredBy")
|
|
1050
1093
|
"""
|
|
1051
1094
|
DEPRECATED. Use 'attribution' instead. Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true)
|
|
@@ -1092,12 +1135,16 @@ class ClaudeCodeSettings(ClaudeCodeBaseModel):
|
|
|
1092
1135
|
"""
|
|
1093
1136
|
effort_level: Literal["low", "medium", "high"] | None = Field("high", alias="effortLevel")
|
|
1094
1137
|
"""
|
|
1095
|
-
Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level
|
|
1138
|
+
Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. Opus 4.6 defaults to medium effort for Max and Team subscribers. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level
|
|
1096
1139
|
"""
|
|
1097
1140
|
fast_mode: bool | None = Field(False, alias="fastMode")
|
|
1098
1141
|
"""
|
|
1099
1142
|
Enable fast mode for Opus 4.6 (research preview). Fast mode uses the same model with 2.5x faster output at higher per-token cost. Requires extra usage enabled. Alternatively, toggle with /fast command. See https://code.claude.com/docs/en/fast-mode
|
|
1100
1143
|
"""
|
|
1144
|
+
fast_mode_per_session_opt_in: bool | None = Field(False, alias="fastModePerSessionOptIn")
|
|
1145
|
+
"""
|
|
1146
|
+
Require per-session opt-in for fast mode. When true, fast mode does not persist across sessions and users must enable it with /fast each session. Useful for controlling costs. See https://code.claude.com/docs/en/fast-mode
|
|
1147
|
+
"""
|
|
1101
1148
|
enable_all_project_mcp_servers: bool | None = Field(
|
|
1102
1149
|
None, alias="enableAllProjectMcpServers", examples=[True]
|
|
1103
1150
|
)
|
|
@@ -1166,7 +1213,7 @@ class ClaudeCodeSettings(ClaudeCodeBaseModel):
|
|
|
1166
1213
|
None, alias="allowManagedPermissionRulesOnly"
|
|
1167
1214
|
)
|
|
1168
1215
|
"""
|
|
1169
|
-
(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings
|
|
1216
|
+
(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings#permission-settings
|
|
1170
1217
|
"""
|
|
1171
1218
|
status_line: StatusLine | None = Field(
|
|
1172
1219
|
None,
|
|
@@ -1203,6 +1250,7 @@ class ClaudeCodeSettings(ClaudeCodeBaseModel):
|
|
|
1203
1250
|
| StrictMarketplaceNpm
|
|
1204
1251
|
| StrictMarketplaceFile
|
|
1205
1252
|
| StrictMarketplaceDirectory
|
|
1253
|
+
| StrictMarketplacePathPattern
|
|
1206
1254
|
]
|
|
1207
1255
|
| None
|
|
1208
1256
|
) = Field(
|
|
@@ -1269,7 +1317,7 @@ class ClaudeCodeSettings(ClaudeCodeBaseModel):
|
|
|
1269
1317
|
"""
|
|
1270
1318
|
spinner_tips_override: SpinnerTipsOverride | None = Field(None, alias="spinnerTipsOverride")
|
|
1271
1319
|
"""
|
|
1272
|
-
Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings
|
|
1320
|
+
Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings
|
|
1273
1321
|
"""
|
|
1274
1322
|
terminal_progress_bar_enabled: bool | None = Field(True, alias="terminalProgressBarEnabled")
|
|
1275
1323
|
"""
|
|
@@ -1299,6 +1347,10 @@ class ClaudeCodeSettings(ClaudeCodeBaseModel):
|
|
|
1299
1347
|
"""
|
|
1300
1348
|
How agent team teammates display: "auto" picks split panes in tmux or iTerm2, in-process otherwise. Agent teams are experimental and disabled by default. Enable them by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json or environment. See https://code.claude.com/docs/en/agent-teams
|
|
1301
1349
|
"""
|
|
1350
|
+
plugin_trust_message: str | None = Field(None, alias="pluginTrustMessage", min_length=1)
|
|
1351
|
+
"""
|
|
1352
|
+
(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings
|
|
1353
|
+
"""
|
|
1302
1354
|
plugin_configs: dict[str, PluginConfigs] | None = Field(None, alias="pluginConfigs")
|
|
1303
1355
|
"""
|
|
1304
1356
|
Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format). See https://code.claude.com/docs/en/plugins
|
|
@@ -1316,6 +1368,7 @@ class ClaudeCodeSettings(ClaudeCodeBaseModel):
|
|
|
1316
1368
|
| BlockedMarketplaceFile
|
|
1317
1369
|
| BlockedMarketplaceDirectory
|
|
1318
1370
|
| BlockedMarketplaceHostPattern
|
|
1371
|
+
| BlockedMarketplacePathPattern
|
|
1319
1372
|
]
|
|
1320
1373
|
| None
|
|
1321
1374
|
) = Field(None, alias="blockedMarketplaces")
|
|
@@ -656,7 +656,13 @@ class TestSubprocessCLITransport:
|
|
|
656
656
|
settings_idx = cmd.index("--settings")
|
|
657
657
|
settings_value = cmd[settings_idx + 1]
|
|
658
658
|
parsed = json.loads(settings_value)
|
|
659
|
-
assert parsed == {
|
|
659
|
+
assert parsed == {
|
|
660
|
+
"sandbox": {
|
|
661
|
+
"autoAllowBashIfSandboxed": True,
|
|
662
|
+
"enableWeakerNetworkIsolation": False,
|
|
663
|
+
"enabled": True,
|
|
664
|
+
}
|
|
665
|
+
}
|
|
660
666
|
|
|
661
667
|
def test_sandbox_network_config(self):
|
|
662
668
|
"""Test sandbox with full network configuration."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_internal/message_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
{clawd_code_sdk-0.6.2 → clawd_code_sdk-0.6.3}/src/clawd_code_sdk/_internal/transport/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|