claude-agent-sdk 1.4.1 → 1.4.2

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: 5207d9e2d85cd3a5b1c8a7f7267d74077dd8ed7c856361f7e8689401a5da0b4b
4
- data.tar.gz: 644c33952692d891e3c46c8ad4d448e52ef06461b79bec66950b3fb24ab6d926
3
+ metadata.gz: e818247c70aeb869293f08c2ae18750d4fdc03ac3caa77c3f40be464df2ed8d6
4
+ data.tar.gz: 3e29b5ea072ad2514ec3949efd1fa5dd339085d5859ac597fd2b4e1c44548ac2
5
5
  SHA512:
6
- metadata.gz: 03ad7fab32ba205b5598c2237dd65a8a1b25786349da7f1c5815eb83ccc516206d89c1bbfaa9e7c2d0ccc2e5cf3256c8fda2cc92a7d3a48eb6a56c24d28678d8
7
- data.tar.gz: 4b97b7f3cedb844e78a4d04c4d376f776f76c74e2822c6c6253a6aff8bececbfcce04a5c6a54b52d7348e5900987ea9f5179fe773aa763a06dc126a13b2942a6
6
+ metadata.gz: 166b250491fc219607048dfe81a349002c2c206bb2f3838b566b6b7431215ffd2ad83f634baa94ea757c0b719559dd8c0d3f488b5152479f6c1ebec5013f6f0e
7
+ data.tar.gz: 69abc6fbb88df26a6d74a7f348a07f83fa7010df39f0f031d7d3ba39d5fdf083706b305f5561a072d84fbfe9e09eec6f2eb6e7e80b4f20b3600a6357707c8d1b
data/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.4.2] - 2026-10-27
11
+
12
+ ### Fixed
13
+ - **`bin/rails claude_agent_sdk:install_cli` (and `CLIInstaller.install` whenever `Encoding.default_internal` is set) no longer fails with `Encoding::UndefinedConversionError`** (issue #177). The download was opened with `File::BINARY`, which is 0 outside Windows, so the file was in text mode; Rails sets `default_internal` to UTF-8, and each write then transcoded the binary chunks and raised on the first byte that is not valid UTF-8. The file is now opened with `binmode: true`.
14
+
10
15
  ## [1.4.1] - 2026-10-25
11
16
 
12
17
  ### Changed
@@ -178,10 +178,15 @@ module ClaudeAgentSDK
178
178
  # place, and a rename only orders metadata. Without the sync, a power
179
179
  # loss shortly after an install could leave the published name
180
180
  # pointing at an empty or partial file.
181
+ #
182
+ # binmode, not File::BINARY: that flag is 0 outside Windows, so the
183
+ # file would be in text mode, and with Encoding.default_internal set
184
+ # (Rails sets it to UTF-8) every write would transcode the binary
185
+ # chunks and raise on the first byte that is not valid UTF-8 (#177).
181
186
  def download_to(url, path, max_bytes: nil)
182
187
  with_response(url) do |response|
183
188
  written = 0
184
- File.open(path, File::WRONLY | File::CREAT | File::EXCL | File::BINARY, 0o600) do |file|
189
+ File.open(path, File::WRONLY | File::CREAT | File::EXCL, 0o600, binmode: true) do |file|
185
190
  response.read_body do |chunk|
186
191
  written += chunk.bytesize
187
192
  if over?(written, max_bytes)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClaudeAgentSDK
4
- VERSION = '1.4.1'
4
+ VERSION = '1.4.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claude-agent-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ya-luotao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-25 00:00:00.000000000 Z
11
+ date: 2026-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async