claude-agent-sdk 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
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.
Potentially problematic release.
This version of claude-agent-sdk might be problematic. Click here for more details.
- claude_agent_sdk/__init__.py +10 -2
- claude_agent_sdk/_internal/client.py +2 -1
- claude_agent_sdk/_internal/transport/subprocess_cli.py +7 -5
- claude_agent_sdk/_version.py +1 -1
- claude_agent_sdk/types.py +1 -0
- {claude_agent_sdk-0.1.3.dist-info → claude_agent_sdk-0.1.4.dist-info}/METADATA +11 -1
- {claude_agent_sdk-0.1.3.dist-info → claude_agent_sdk-0.1.4.dist-info}/RECORD +9 -9
- {claude_agent_sdk-0.1.3.dist-info → claude_agent_sdk-0.1.4.dist-info}/WHEEL +0 -0
- {claude_agent_sdk-0.1.3.dist-info → claude_agent_sdk-0.1.4.dist-info}/licenses/LICENSE +0 -0
claude_agent_sdk/__init__.py
CHANGED
|
@@ -203,7 +203,7 @@ def create_sdk_mcp_server(
|
|
|
203
203
|
- ClaudeAgentOptions: Configuration for using servers with query()
|
|
204
204
|
"""
|
|
205
205
|
from mcp.server import Server
|
|
206
|
-
from mcp.types import TextContent, Tool
|
|
206
|
+
from mcp.types import ImageContent, TextContent, Tool
|
|
207
207
|
|
|
208
208
|
# Create MCP server instance
|
|
209
209
|
server = Server(name, version=version)
|
|
@@ -273,11 +273,19 @@ def create_sdk_mcp_server(
|
|
|
273
273
|
# Convert result to MCP format
|
|
274
274
|
# The decorator expects us to return the content, not a CallToolResult
|
|
275
275
|
# It will wrap our return value in CallToolResult
|
|
276
|
-
content = []
|
|
276
|
+
content: list[TextContent | ImageContent] = []
|
|
277
277
|
if "content" in result:
|
|
278
278
|
for item in result["content"]:
|
|
279
279
|
if item.get("type") == "text":
|
|
280
280
|
content.append(TextContent(type="text", text=item["text"]))
|
|
281
|
+
if item.get("type") == "image":
|
|
282
|
+
content.append(
|
|
283
|
+
ImageContent(
|
|
284
|
+
type="image",
|
|
285
|
+
data=item["data"],
|
|
286
|
+
mimeType=item["mimeType"],
|
|
287
|
+
)
|
|
288
|
+
)
|
|
281
289
|
|
|
282
290
|
# Return just the content list - the decorator wraps it
|
|
283
291
|
return content
|
|
@@ -37,12 +37,13 @@ class SubprocessCLITransport(Transport):
|
|
|
37
37
|
self,
|
|
38
38
|
prompt: str | AsyncIterable[dict[str, Any]],
|
|
39
39
|
options: ClaudeAgentOptions,
|
|
40
|
-
cli_path: str | Path | None = None,
|
|
41
40
|
):
|
|
42
41
|
self._prompt = prompt
|
|
43
42
|
self._is_streaming = not isinstance(prompt, str)
|
|
44
43
|
self._options = options
|
|
45
|
-
self._cli_path =
|
|
44
|
+
self._cli_path = (
|
|
45
|
+
str(options.cli_path) if options.cli_path is not None else self._find_cli()
|
|
46
|
+
)
|
|
46
47
|
self._cwd = str(options.cwd) if options.cwd else None
|
|
47
48
|
self._process: Process | None = None
|
|
48
49
|
self._stdout_stream: TextReceiveStream | None = None
|
|
@@ -79,8 +80,8 @@ class SubprocessCLITransport(Transport):
|
|
|
79
80
|
" npm install -g @anthropic-ai/claude-code\n"
|
|
80
81
|
"\nIf already installed locally, try:\n"
|
|
81
82
|
' export PATH="$HOME/node_modules/.bin:$PATH"\n'
|
|
82
|
-
"\nOr
|
|
83
|
-
"
|
|
83
|
+
"\nOr provide the path via ClaudeAgentOptions:\n"
|
|
84
|
+
" ClaudeAgentOptions(cli_path='/path/to/claude')"
|
|
84
85
|
)
|
|
85
86
|
|
|
86
87
|
def _build_command(self) -> list[str]:
|
|
@@ -205,7 +206,8 @@ class SubprocessCLITransport(Transport):
|
|
|
205
206
|
if self._process:
|
|
206
207
|
return
|
|
207
208
|
|
|
208
|
-
|
|
209
|
+
if not os.environ.get("CLAUDE_AGENT_SDK_SKIP_VERSION_CHECK"):
|
|
210
|
+
await self._check_claude_version()
|
|
209
211
|
|
|
210
212
|
cmd = self._build_command()
|
|
211
213
|
try:
|
claude_agent_sdk/_version.py
CHANGED
claude_agent_sdk/types.py
CHANGED
|
@@ -512,6 +512,7 @@ class ClaudeAgentOptions:
|
|
|
512
512
|
model: str | None = None
|
|
513
513
|
permission_prompt_tool_name: str | None = None
|
|
514
514
|
cwd: str | Path | None = None
|
|
515
|
+
cli_path: str | Path | None = None
|
|
515
516
|
settings: str | None = None
|
|
516
517
|
add_dirs: list[str | Path] = field(default_factory=list)
|
|
517
518
|
env: dict[str, str] = field(default_factory=dict)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claude-agent-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Python SDK for Claude Code
|
|
5
5
|
Project-URL: Homepage, https://github.com/anthropics/claude-agent-sdk-python
|
|
6
6
|
Project-URL: Documentation, https://docs.anthropic.com/en/docs/claude-code/sdk
|
|
@@ -313,6 +313,16 @@ If you're upgrading from the Claude Code SDK (versions < 0.1.0), please see the
|
|
|
313
313
|
- Settings isolation and explicit control
|
|
314
314
|
- New programmatic subagents and session forking features
|
|
315
315
|
|
|
316
|
+
## Development
|
|
317
|
+
|
|
318
|
+
If you're contributing to this project, run the initial setup script to install git hooks:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
./scripts/initial-setup.sh
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
This installs a pre-push hook that runs lint checks before pushing, matching the CI workflow. To skip the hook temporarily, use `git push --no-verify`.
|
|
325
|
+
|
|
316
326
|
## License
|
|
317
327
|
|
|
318
328
|
MIT
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
claude_agent_sdk/__init__.py,sha256=
|
|
1
|
+
claude_agent_sdk/__init__.py,sha256=6yJ1bjfcLc0oMo-EesY19-uSi-B5dBIZDrCYkwyegXs,12429
|
|
2
2
|
claude_agent_sdk/_errors.py,sha256=nSdJNNeszvXG1PfnXd2sQpVNORqMct-MfPaiM3XeJL4,1579
|
|
3
|
-
claude_agent_sdk/_version.py,sha256=
|
|
3
|
+
claude_agent_sdk/_version.py,sha256=8-5mrhPr_CAF6E5TLSV6Klk6VLu4QNMtphl-yDq8qCg,71
|
|
4
4
|
claude_agent_sdk/client.py,sha256=Bye3QKb-iTg6Yq34ZPGHzaMg1isT9RvyHs5TkC2jWDI,13926
|
|
5
5
|
claude_agent_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
claude_agent_sdk/query.py,sha256=WebhztsMZPdaxyy1LBEZv4_j23vjp_ceX9DtrBsZqCA,4530
|
|
7
|
-
claude_agent_sdk/types.py,sha256=
|
|
7
|
+
claude_agent_sdk/types.py,sha256=7rrnHBG7279wWPtor8b7vpIekSzZcUriSbvNBHXoAcE,16685
|
|
8
8
|
claude_agent_sdk/_internal/__init__.py,sha256=zDdgjqp8SI9mTnwZbP2Be-w4LWlv4a3kA-TS2i75jsM,39
|
|
9
|
-
claude_agent_sdk/_internal/client.py,sha256=
|
|
9
|
+
claude_agent_sdk/_internal/client.py,sha256=ySaWYtZUrYMwN93r7qANaD-RGiFlkB49j0njQNVPHRM,4620
|
|
10
10
|
claude_agent_sdk/_internal/message_parser.py,sha256=xxpOU3E8X21FCoy2OtLWKfEQr3AFYM454qJt6Xa0tmc,6475
|
|
11
11
|
claude_agent_sdk/_internal/query.py,sha256=mfSiIfs58U1LYMnbj5GeLATvdI_cRVIxStV1He-cMTE,22015
|
|
12
12
|
claude_agent_sdk/_internal/transport/__init__.py,sha256=sv8Iy1b9YmPlXu4XsdN98gJIlyrLtwq8PKQyF4qnQLk,1978
|
|
13
|
-
claude_agent_sdk/_internal/transport/subprocess_cli.py,sha256=
|
|
14
|
-
claude_agent_sdk-0.1.
|
|
15
|
-
claude_agent_sdk-0.1.
|
|
16
|
-
claude_agent_sdk-0.1.
|
|
17
|
-
claude_agent_sdk-0.1.
|
|
13
|
+
claude_agent_sdk/_internal/transport/subprocess_cli.py,sha256=FaVKvXJ9hAbBG-aCnPwUkXxa096DEw_zjI38aiiDiaU,19169
|
|
14
|
+
claude_agent_sdk-0.1.4.dist-info/METADATA,sha256=YRlqbPASEmldUn9VotzoaiOc8fMyR4eOGvc7deGal-M,9949
|
|
15
|
+
claude_agent_sdk-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
16
|
+
claude_agent_sdk-0.1.4.dist-info/licenses/LICENSE,sha256=zr3eio-57lnl6q7RlXi_gIWqcEdWIlnDHzjyJcJvaBI,1070
|
|
17
|
+
claude_agent_sdk-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|