typesafe-sdk-ruby 0.6.0 → 0.7.0

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: c2f7c356ecf7107179e8d01aeec562af105267ef4fc640b9a95a8d0c0904413f
4
- data.tar.gz: 5a7657f8bc722b9c7ecae8f126b7792b2911b08bbc006a54114f16fb0bf73bb3
3
+ metadata.gz: d9c873fb65592342cbe6b344decd33db540327f8dac873d1ad2c42e1edea58f1
4
+ data.tar.gz: 6d1a977041d8d12fb31b0654e7ffae904170d2d3432951a67751dc30b9aa6d20
5
5
  SHA512:
6
- metadata.gz: 62fd70fb931ccaae55504bb8ed8db5b674e347978704d938a178003e339c0061ed8f4f5de62574298471dd29b21369e6a82cf8d549985cf9e0e8c22781299a1d
7
- data.tar.gz: ac8620432b7afd9cb36ec5e1a64b16fe3709590c3597234401cc71ab797558676441034af33b4b17ff4f650082a7f7627579dba5248db0a98c1ca5b734a48e04
6
+ metadata.gz: 3e51268bb25700c0c833013b3a6ba850379d86522a72d7438efe2c4b29fd9c868599486408459349f4a3281a6bb7768f20189fc16bc0c6220872f22ec3dd940c
7
+ data.tar.gz: e4971f23dde4a6c7672c4c922ef3fe72460c520919b868e4ec08730ba4f32136659dca3c48e1e18728a8c3e920c4c6405cdf6acc9e0fa5245003983f7d6477b9
data/CHANGELOG.md CHANGED
@@ -3,7 +3,87 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+ Versions follow the official JavaScript SDK, with a fourth numeric component for Ruby-only
7
+ corrections. See [RELEASING.md](docs/RELEASING.md).
8
+
9
+ ## [0.7.0] - 2026-10-16
10
+
11
+ Compatibility target: official JavaScript SDK 0.7.0, commit `b844cd1`.
12
+
13
+ ### Added
14
+
15
+ - Images, an experimental API feature enabled with the `TypeSafe-Danger-Zone-Images: true`
16
+ header: create them with `Typesafe::SDK.image` from file bytes, a `Pathname`, or an IO, or
17
+ with `Typesafe::SDK::Image.from_base64`. Place them in `state`, question instructions, or
18
+ criteria; join them into text with `Typesafe::SDK.with_assets` and `Typesafe::SDK.join_assets`;
19
+ or reference them by names you choose in `assets:`. Requests with images are sent as
20
+ `multipart/form-data`, with each image's bytes in its own part.
21
+ - `box` questions and `BoxResponse` answers, which locate what their instructions describe in an
22
+ image; use them with the `jev-preview` model.
23
+ - zstd compression for request bodies of 1 KiB or more when the optional `zstd-ruby` gem is
24
+ available; pass `compression: false` to send bodies uncompressed.
25
+ - `#to_h` on every answer, returning all fields the API sent, including unmodeled ones.
26
+
27
+ ### Changed
28
+
29
+ - Non-finite floats (`NaN`, `Infinity`, `-Infinity`) in a request are sent as strings, as
30
+ JS 0.7.0 does, instead of raising `JSON::GeneratorError` (upstream #17).
31
+ - Noul questions whose `criteria` is not a Hash raise `TypeSafeError` before sending.
32
+ - Usage token counts are documented as possibly `nil` when the API doesn't report them.
33
+ - A request containing a circular reference raises `TypeSafeError` instead of a JSON error.
34
+ - Custom `http:` adapters can receive binary bodies: `multipart/form-data` for requests with
35
+ images, and zstd-compressed bodies of 1 KiB or more when `zstd-ruby` is loaded. Send the body
36
+ unchanged with the given headers, or pass `compression: false` to keep JSON bodies uncompressed.
37
+
38
+ ### Fixed
39
+
40
+ - Debug logs no longer show an `x-api-key` value or a spaceless credential as an
41
+ authorization scheme; only an alphabetic scheme followed by a credential is kept
42
+ (upstream #18).
43
+ - HTML error pages from Cloudflare raise errors whose message names the edge block and its
44
+ `cf-ray` ID instead of quoting the HTML (upstream #15). The error classes are unchanged.
45
+
46
+ ## [0.6.0.1] - 2026-09-21
47
+
48
+ Compatibility target: official JavaScript SDK 0.6.0, commit `66880cc`.
49
+
50
+ ### Fixed
51
+
52
+ - Reject malformed/blank API keys at construction without including credentials in errors
53
+ (upstream #14); trim surrounding spaces and line endings.
54
+ - Validate state types, meaningful noul questions, score/choice bounds, and empty question
55
+ names before HTTP requests (upstream #6).
56
+ - Reject nil score levels without dropping or renumbering positions; document an explicit
57
+ empty string for an undescribed position (upstream #12).
58
+ - Fall back to configured backoff for blank retry headers while preserving explicit zero
59
+ and valid alternate headers (upstream #9).
60
+
61
+ - Match upstream fallback error messages when API error fields are empty strings.
62
+ - Treat nil retry flags as inherited settings, while keeping explicit false overrides.
63
+ - Enforce the timeout across the entire HTTP attempt, including slow response bodies.
64
+ - Interrupt active requests on cancellation and close/join the request worker before returning.
65
+ - Disable Net::HTTP's implicit retries; detect truncated response bodies as connection errors.
66
+ - Support Ruby/Rails loggers when debug or error details are present.
67
+ - Validate JSON-loaded score questions and reject infinite/NaN/complex timeout and backoff values.
68
+ - Preserve fractional server retry delays; capture HTTP-date rate-limit delays once.
69
+ - Freeze copied retry status overrides to prevent accidental policy mutation.
70
+ - Preserve upstream license attribution and remove the misleading official-company contact.
71
+
72
+ ### Added
73
+
74
+ - `PaymentRequiredError` (402), `ConflictError` (409), and `PayloadTooLargeError` (413),
75
+ retaining `APIError` inheritance and existing retry defaults (upstream #13).
76
+ - An audit of all 11 upstream issues, numeric-label coverage, subprocess cancellation checks,
77
+ and real-socket timeout tests around Node's timer limit (upstream #2, #4, #8).
78
+
79
+ - Complete answer and nullable retry flag comparisons against the published JS package.
80
+ - README onboarding, primitive/confidence examples, JS-to-Ruby mapping, and support routes.
81
+ - `with_response: true` on inference and model listing for data, HTTP metadata, and request ID.
82
+ - `extra_body:` for additional inference fields, including explicit null values.
83
+ - Fixtures generated by executing the published JS SDK, real socket regression tests, and an
84
+ opt-in live API smoke test.
85
+ - A single gem version source, explicit `UPSTREAM_VERSION`, release validation, packaged-gem
86
+ CI checks, Ruby 4.0 coverage, and compatibility/release documentation.
7
87
 
8
88
  ## [0.6.0] - 2026-09-20
9
89
 
data/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2026 TypeSafe Ruby SDK Contributors
4
+ Copyright (c) 2026 TypeSafe (upstream JavaScript SDK)
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal