clawd-code-sdk 0.3.5__tar.gz → 0.3.6__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.3.5 → clawd_code_sdk-0.3.6}/PKG-INFO +1 -1
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/pyproject.toml +1 -1
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/client.py +8 -7
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/options.py +11 -5
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/.gitignore +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/LICENSE +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/README.md +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/__init__.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_bundled/.gitignore +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_errors.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_internal/__init__.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_internal/message_parser.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_internal/query.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_internal/transport/__init__.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_internal/transport/subprocess_cli.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_version.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/anthropic_types.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/list_sessions.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/mcp_utils.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/__init__.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/agents.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/base.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/content_blocks.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/control.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/hooks.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/input_types.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/mcp.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/messages.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/output_types.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/permissions.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/sandbox.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/models/server_info.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/py.typed +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/query.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/session.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/storage/ARCHITECTURE.md +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/storage/__init__.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/storage/helpers.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/storage/models.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/storage/replay.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/usage.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/conftest.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/__init__.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_agents_and_settings.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_dynamic_control.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_hook_events.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_hooks.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_include_partial_messages.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_mcp_tools.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_sdk_mcp_tools.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_slash_commands.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_stderr_callback.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_structured_output.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_subagent_invocation.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/e2e/test_tool_permissions.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/mcp_server.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/mock_claude_server.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_changelog.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_client.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_errors.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_image.png +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_integration.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_message_parser.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_sdk_mcp_integration.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_session.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_streaming_client.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_subprocess_buffering.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/tests/test_tool_callbacks.py +0 -0
- {clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/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.3.
|
|
3
|
+
Version: 0.3.6
|
|
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
|
|
@@ -118,13 +118,14 @@ class ClaudeSDKClient:
|
|
|
118
118
|
# Extract system prompt for initialize request
|
|
119
119
|
system_prompt: str | None = None
|
|
120
120
|
append_system_prompt: str | None = None
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
system_prompt = "" #
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
if self.options.system_prompt is None:
|
|
122
|
+
if not self.options.include_builtin_system_prompt:
|
|
123
|
+
system_prompt = "" # Clear the builtin prompt
|
|
124
|
+
# else: send nothing, CLI uses its default builtin prompt
|
|
125
|
+
elif self.options.include_builtin_system_prompt:
|
|
126
|
+
append_system_prompt = self.options.system_prompt
|
|
127
|
+
else:
|
|
128
|
+
system_prompt = self.options.system_prompt
|
|
128
129
|
|
|
129
130
|
# JSON schema for structured output
|
|
130
131
|
json_schema: dict[str, Any] | None
|
|
@@ -10,12 +10,12 @@ from typing import TYPE_CHECKING, Any, Literal, TypedDict
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
|
-
from collections.abc import Callable
|
|
13
|
+
from collections.abc import Callable, Sequence
|
|
14
14
|
|
|
15
15
|
from clawd_code_sdk.models.base import ModelName
|
|
16
16
|
from clawd_code_sdk.models.permissions import OnUserQuestion
|
|
17
17
|
|
|
18
|
-
from .agents import AgentDefinition,
|
|
18
|
+
from .agents import AgentDefinition, ToolsPreset
|
|
19
19
|
from .base import PermissionMode, ReasoningEffort, SettingSource, ThinkingConfig
|
|
20
20
|
from .hooks import HookEvent, HookMatcher
|
|
21
21
|
from .mcp import McpServerConfig, SdkPluginConfig
|
|
@@ -192,7 +192,7 @@ class ClaudeAgentOptions:
|
|
|
192
192
|
"""CLI path override (auto-detects by default)."""
|
|
193
193
|
extra_args: dict[str, str | None] = field(default_factory=dict)
|
|
194
194
|
"""Arbitrary extra CLI flags."""
|
|
195
|
-
max_buffer_size: int
|
|
195
|
+
max_buffer_size: int = 10 * 1024 * 1024
|
|
196
196
|
"""Max bytes when buffering CLI stdout."""
|
|
197
197
|
stderr: Callable[[str], None] | None = None
|
|
198
198
|
"""Callback for stderr output from CLI."""
|
|
@@ -201,7 +201,7 @@ class ClaudeAgentOptions:
|
|
|
201
201
|
user: str | None = None
|
|
202
202
|
"""User for the AnyIO process."""
|
|
203
203
|
# CWD
|
|
204
|
-
add_dirs:
|
|
204
|
+
add_dirs: Sequence[str | Path] = field(default_factory=list)
|
|
205
205
|
"""Add additional working directories."""
|
|
206
206
|
cwd: str | Path | None = None
|
|
207
207
|
"""The working directory for the agent."""
|
|
@@ -219,8 +219,14 @@ class ClaudeAgentOptions:
|
|
|
219
219
|
debug_file: str | None = None
|
|
220
220
|
"""Write debug logs to a specific file path. Implicitly enables debug mode."""
|
|
221
221
|
# Agent config
|
|
222
|
-
system_prompt: str |
|
|
222
|
+
system_prompt: str | None = None
|
|
223
223
|
"""System prompt for the agent."""
|
|
224
|
+
include_builtin_system_prompt: bool = True
|
|
225
|
+
"""Whether to include Claude Code's builtin system prompt.
|
|
226
|
+
|
|
227
|
+
When True (default) and system_prompt is set, it is appended to the
|
|
228
|
+
builtin system prompt. When False, the system_prompt replaces it entirely.
|
|
229
|
+
"""
|
|
224
230
|
hooks: dict[HookEvent, list[HookMatcher]] | None = None
|
|
225
231
|
"""Hook configurations."""
|
|
226
232
|
agents: dict[str, AgentDefinition] | None = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/src/clawd_code_sdk/_internal/message_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
{clawd_code_sdk-0.3.5 → clawd_code_sdk-0.3.6}/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
|
|
File without changes
|
|
File without changes
|