npm / @typesafe-ai/sdk
@typesafe-ai/sdk
What changed in @typesafe-ai/sdk 0.5 to 0.7, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
4 breaking20 new APIs and options2 performance1 behavior and defaults4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@typesafe-ai/sdk 0.711 changes
Breaking changes 2
Invalid requests reject the returned promise instead of throwing.
Request payload types are no longer exported.
New APIs and options 4
Reference images by names you choose in assets.
Add box questions to locate what their instructions describe in an image; use them with the jev-preview model.
Create images with image() for use in state, question instructions, or criteria.
Write images into text with withAssets and withAssets.join.
Performance 1
Request bodies of 1 KiB or more are compressed with zstd on Node.js 22.15 or newer.
Fixes and other changes 4
Fix an unhandled rejection on Node.js 22 when a request times out or is aborted mid-body.
More request validation checks are performed.
Score criteria lists built at runtime are now accepted.
Usage now allows null token counts.
@typesafe-ai/sdk 0.61 changes
Breaking changes 1
Score.criteria now accepts an ordered sequence instead of a dictionary keyed by integers.
@typesafe-ai/sdk 0.519 changes
Breaking changes 1
Node.js 22 or newer is now required to use the SDK.
New APIs and options 16
Pass images keyed by chosen references to use them in plain strings; every asset name must appear in the request or the call rejects before sending.
Ask a box question to locate described content in an image; answers contain edge fractions and confidence may be null.
Use choice questions to define choices whose answer types are inferred from the question.
Pass compression: false to send request bodies uncompressed.
Create images from base64 data for use in state, question instructions, or criteria.
Create images from file bytes or a Blob; only PNG and JPEG are accepted, and other formats are rejected with BadRequestError.
Use this model for box questions.
Use noul questions to ask a yes-or-no-style question about the supplied content.
Use score questions to request a score from the supplied options.
The client provides systemOne for sending state and questions and receiving answers.
Initial public release of the JavaScript and TypeScript SDK, with ESM, CommonJS, and TypeScript declarations.
Set this environment variable to configure the SDK client’s API key.
Set this header to true to enable experimental image support.
The SDK introduces a client for making TypeSafe requests.
Write images into text with withAssets.join.
Tag template literals to reference images inside text; an image in an untagged template literal rejects the call before sending.
Performance 1
The client compresses request bodies of 1 KiB or more with zstd; smaller bodies are uncompressed, and other runtimes send all bodies uncompressed.
Behavior and default changes 1
Requests containing images are sent as multipart/form-data, with each image’s file bytes in its own part.