claude-agent-sdk 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1b1a2ec74f15062544d42a0df92058e256bab2ed29754e19133bfc1340cddcf
4
- data.tar.gz: f01aea04b3f32e51b5d98e6994d52c8e2864259fa86d1c5bdc64104486b63687
3
+ metadata.gz: 4d8b669f4c3f02dea0763113551838bb0a3a5ec514125876f28dbc5d23ee44aa
4
+ data.tar.gz: 6ce126558a2d99e3b6aba03527d5b4ce8954ff3a99a13ee25f54dd6fa0141980
5
5
  SHA512:
6
- metadata.gz: ef15b15c77ceb22fc0b40884ecc1e79a884b9b7d043b21420ef0faa34d638206eec6284ab6afeb015097d721c75c0e00ce0f3db4c63e7f8e90305bda2e468b16
7
- data.tar.gz: 74ee1d9b848c2e84336fb3a12e8147b35243f64ad6c1d352fe451a39c16a92cdaa92303acb20cf053495c580171bfe36d60f5a53bee98d2781da0b1b261870d3
6
+ metadata.gz: 54e48e83a98845d56d6dc4c1843ebf8728fd74ffd3e7670e826c0fdbf3ef297359c18f5b27c2fac0757da0fab5e28d6c19ab084ac1842c5615d06cf52a0a94f8
7
+ data.tar.gz: 224aca0535d196fa3b348da69af9e4cbcc46276af8d36b7b58f6e35811704f93506ff31df7449e9aae9ebd252c8b5c035fa581dc4d500a5bade82d0d15f37ddc
data/README.md CHANGED
@@ -131,7 +131,11 @@ For a complete example, see [examples/streaming_input_example.rb](examples/strea
131
131
 
132
132
  ## Client
133
133
 
134
- `ClaudeAgentSDK::Client` supports bidirectional, interactive conversations with Claude Code. Unlike `query()`, `Client` enables **custom tools**, **hooks**, and **permission callbacks**, all of which can be defined as Ruby procs/lambdas. See [lib/claude_agent_sdk.rb](lib/claude_agent_sdk.rb).
134
+ `ClaudeAgentSDK::Client` supports bidirectional, interactive conversations with Claude Code. Unlike `query()`, `Client` enables **custom tools**, **hooks**, and **permission callbacks**, all of which can be defined as Ruby procs/lambdas.
135
+
136
+ **The Client class automatically uses streaming mode** for bidirectional communication, allowing you to send multiple queries dynamically during a single session without closing the connection. This matches the Python SDK's `ClaudeSDKClient` behavior.
137
+
138
+ See [lib/claude_agent_sdk.rb](lib/claude_agent_sdk.rb) for implementation details.
135
139
 
136
140
  ### Custom Tools (SDK MCP Servers)
137
141
 
@@ -292,6 +296,7 @@ Async do
292
296
  client = ClaudeAgentSDK::Client.new
293
297
 
294
298
  begin
299
+ # Connect automatically uses streaming mode for bidirectional communication
295
300
  client.connect
296
301
 
297
302
  # Send a query
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClaudeAgentSDK
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
@@ -86,11 +86,12 @@ module ClaudeAgentSDK
86
86
  #
87
87
  # This client provides full control over the conversation flow with support
88
88
  # for streaming, hooks, permission callbacks, and dynamic message sending.
89
+ # The Client class always uses streaming mode for bidirectional communication.
89
90
  #
90
91
  # @example Basic usage
91
92
  # Async do
92
93
  # client = ClaudeAgentSDK::Client.new
93
- # client.connect
94
+ # client.connect # No arguments needed - automatically uses streaming mode
94
95
  #
95
96
  # client.query("What is the capital of France?")
96
97
  # client.receive_response do |msg|
@@ -150,8 +151,10 @@ module ClaudeAgentSDK
150
151
  configured_options = @options.dup_with(permission_prompt_tool_name: 'stdio')
151
152
  end
152
153
 
153
- # Create transport
154
- actual_prompt = prompt || ''
154
+ # Auto-connect with empty enumerator if no prompt is provided
155
+ # This matches the Python SDK pattern where ClaudeSDKClient always uses streaming mode
156
+ # An empty enumerator keeps stdin open for bidirectional communication
157
+ actual_prompt = prompt || [].to_enum
155
158
  @transport = SubprocessCLITransport.new(actual_prompt, configured_options)
156
159
  @transport.connect
157
160
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claude-agent-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Community Contributors
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-15 00:00:00.000000000 Z
10
+ date: 2025-10-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: async