Repository navigation
Release 0.7.0: port JS SDK 0.7.0 (images, box, zstd) and fix new upstream issues - #6
Merged
Merged
Conversation
Mirror the official @typesafe-ai/sdk 0.7.0 release (commit b844cd1): - Image assets via Typesafe::SDK.image / Image.from_base64, placed in content, joined into text with with_assets / join_assets, or named in assets:, sent as multipart/form-data - box questions and BoxResponse answers - zstd request compression for bodies of 1 KiB or more when the optional zstd-ruby gem is available; compression: false opts out - Non-finite floats sent as strings, nullable usage, noul criteria type check, and Answer#to_h with unmodeled fields Fix Ruby equivalents of new upstream issues: full masking of x-api-key and spaceless credentials in debug logs (#18), and clear messages for Cloudflare HTML error pages (#15). Regenerate parity fixtures from the published 0.7.0 package and bump the gem to 0.7.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LuEfX6DVxXvvJPJ7rRfAe8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the official JavaScript SDK 0.7.0 (released 2026-10-14, commit
b844cd1) to Ruby and bumps the gem to 0.7.0.New in JS 0.7.0, now in Ruby
Images (experimental; opt in with the
TypeSafe-Danger-Zone-Images: trueheader). Create one withTypesafe::SDK.imagefrom a binary String, aPathname(read when the request is sent), or an IO, or withImage.from_base64. You can use it in three ways:state, question instructions, or criteria.Typesafe::SDK.with_assets("Compare ", a, " with ", b)orjoin_assets(list, ", "). These stand in for JS's tagged template andwithAssets.join.assets:.Requests with images are sent as
multipart/form-data, with one part per image. The same reference checks as JS run before sending: unreferenced names, and references that no image is attached to.boxquestions andBoxResponse(box.top/bottom/left/right, nullableconfidence). Use them withjev-preview.zstd request compression for bodies of 1 KiB or more (measured in UTF-8 bytes). It needs the optional
zstd-rubygem; Node.js zstd support plays that role in JS.compression: falseopts out. The SDK ownsContent-Encoding, and retries resend the same bytes.Non-finite floats are sent as
"NaN","Infinity", and"-Infinity". Usage token counts can benil. Noulcriteriamust be a Hash.Answer#to_hreturns every field, including unmodeled ones.JS-only changes, recorded as not applicable: the Node 22 requirement, rejected promises instead of throws (Ruby is synchronous), and score lists built at runtime (a TypeScript typing fix).
New upstream issues (#15–#20)
x-api-keyis now always fully masked, and authorization headers keep only an alphabetic scheme followed by a credential.cf-rayID. The class andbodyare unchanged.JSON::GeneratorError.docs/UPSTREAM_ISSUES.md.Validation
bundle exec rake: 298 examples, 0 failures; RuboCop reports no offenses. Ran on Ruby 3.3.6, 3.2.6, and 3.1.6. CI covers 3.4 and 4.0.spec/fixtures/js-0.7.0.jsonwas regenerated by running the published@typesafe-ai/[email protected]package on Node 22.22. It covers multipart requests and parts,withAssets.jointext, asset error messages, base64 decoding, compression thresholds, box answers, NaN serialization, errors, and retry headers.ruby script/check_release.rbpasses withRELEASE_TAG=v0.7.0against the upstream v0.7.0package.json.gem build --strictsucceeds, and the gem installs and loads from the package.script/smoke_test.rbgains an opt-inTYPESAFE_LIVE_IMAGES=1image and box check.Compatibility and release impact
docs/COMPATIBILITY.md. The main ones:with_assetstakes its parts as arguments, andnilbecomes"".TypeSafeError.Retry-Afterheaders.http:adapters: they may now receive multipart bodies, and zstd-compressed bodies whenzstd-rubyis loaded. This is noted in the changelog.v0.7.0onmain, followingdocs/RELEASING.md.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01LuEfX6DVxXvvJPJ7rRfAe8
Generated by Claude Code