@warlock.js/ai-bedrock 5.29.0 → 5.31.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.
- package/CHANGELOG.md +34 -0
- package/cjs/index.cjs +350 -57
- package/cjs/index.cjs.map +1 -1
- package/esm/config.type.d.mts +31 -6
- package/esm/config.type.d.mts.map +1 -1
- package/esm/embedder.mjs +1 -1
- package/esm/embedder.mjs.map +1 -1
- package/esm/index.d.mts +3 -1
- package/esm/index.mjs +2 -1
- package/esm/known-capabilities.mjs +42 -4
- package/esm/known-capabilities.mjs.map +1 -1
- package/esm/known-pricing.d.mts +48 -0
- package/esm/known-pricing.d.mts.map +1 -0
- package/esm/known-pricing.mjs +99 -0
- package/esm/known-pricing.mjs.map +1 -0
- package/esm/known-vision-models.mjs +1 -1
- package/esm/known-vision-models.mjs.map +1 -1
- package/esm/model.mjs +122 -46
- package/esm/model.mjs.map +1 -1
- package/esm/provider-options.d.mts +8 -0
- package/esm/provider-options.d.mts.map +1 -0
- package/esm/provider-options.mjs +36 -0
- package/esm/provider-options.mjs.map +1 -0
- package/esm/sdk.d.mts +5 -1
- package/esm/sdk.d.mts.map +1 -1
- package/esm/sdk.mjs +35 -4
- package/esm/sdk.mjs.map +1 -1
- package/esm/utils/map-stop-reason.mjs +1 -1
- package/esm/utils/map-stop-reason.mjs.map +1 -1
- package/esm/utils/reasoning-blocks.mjs +1 -1
- package/esm/utils/reasoning-blocks.mjs.map +1 -1
- package/esm/utils/to-bedrock-messages.mjs +15 -2
- package/esm/utils/to-bedrock-messages.mjs.map +1 -1
- package/esm/utils/to-bedrock-tools.mjs +1 -1
- package/esm/utils/to-bedrock-tools.mjs.map +1 -1
- package/esm/utils/wrap-bedrock-error.mjs +6 -2
- package/esm/utils/wrap-bedrock-error.mjs.map +1 -1
- package/llms-full.txt +152 -38
- package/llms.txt +1 -1
- package/package.json +5 -4
- package/skills/setup-bedrock/SKILL.md +152 -38
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,39 @@ All notable changes to `@warlock.js/ai-bedrock` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 5.31.0 - 2026-10-18
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Usage is marked `inputIncludesCache: false` (Converse `inputTokens` excludes cache reads and writes) and reports 1-hour cache writes from `cacheDetails` in `cacheWrite1hTokens`, so cost bills each cache token once at its own rate.
|
|
12
|
+
- A `toolUse` block with `type: "server_tool_use"` (a system tool run by Bedrock) is no longer returned as a tool call for the agent to dispatch.
|
|
13
|
+
- Converse conversion compiles with strict indexed-access checks while preserving empty and system-only histories.
|
|
14
|
+
- Provider body options merge plain-object fields one level deep, preserving neutral reasoning, generation and structured-output settings unless the caller overrides their keys.
|
|
15
|
+
- Converse conversion combines adjacent same-role turns in content order, preserving parallel tool results and automatic compaction summaries beside assistant tool calls.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- With a `cacheControl` breakpoint, a `cachePoint` is also placed after the system prompt and, for Claude, after the tool definitions — the prefix segments Bedrock caches in `tools` → `system` → `messages` order. `ttl: "1h"` (per call, or the new `promptCacheTtl` model option) is sent only to models that accept it.
|
|
20
|
+
- Built-in Claude prices for `global.` and `us.` inference profiles (`BEDROCK_GLOBAL_PRICING`, `BEDROCK_US_PRICING`, `bedrockPricingFor`), from AWS's Bedrock price list as of 2026-10-17; caller pricing for Claude models gets the 1.25x / 2x cache-write rates filled (`withClaudeCacheWriteRates`). `complete()` and the streaming `done` chunk attach `usage.cost` when priced.
|
|
21
|
+
- Claude 5 families and Nova 2 Lite are recognised as prompt-caching capable.
|
|
22
|
+
- `ServiceUnavailableException` throws `ProviderOverloadedError`; wrapped errors carry `status`, `billed` and `retryable`.
|
|
23
|
+
- `new BedrockSDK({ apiKey, region })` authenticates with an Amazon Bedrock API key: requests carry `Authorization: Bearer <apiKey>` instead of a SigV4 signature and the AWS credential chain is not consulted (the adapter sets the AWS SDK's `token` and `authSchemePreference: ["httpBearerAuth"]`). An empty key, or a key combined with `credentials` or `token`, throws `InvalidRequestError`.
|
|
24
|
+
- An adapter contract test verifies that aborting `signal` rejects `complete()` and `stream()` and cancels the HTTP/2 request.
|
|
25
|
+
- With `streamChunks`, `stream()` yields `reasoning` for `reasoningContent.text` deltas and `tool-args` for client `toolUse.input` deltas.
|
|
26
|
+
- `ai.providerTool({ provider: "bedrock", definition })` appends a Converse `Tool` member such as `{ systemTool: { name: "nova_grounding" } }` verbatim; other providers' tools are skipped with a warning.
|
|
27
|
+
- `providerOptions.bedrock.body` forwards native per-call request options for completions and streams while protecting the model, conversation and tool definitions.
|
|
28
|
+
- Models expose native `countTokens()` preflight using the generation request's Converse conversation, tools and additional model fields.
|
|
29
|
+
|
|
30
|
+
### Upgrading
|
|
31
|
+
|
|
32
|
+
- Calls that ask for `cacheControl` breakpoints now also write the system prompt and (Claude) tool definitions to the cache. Writes cost more than plain input on the first call; repeated prefixes then read at the cache rate.
|
|
33
|
+
|
|
34
|
+
## 5.30.0 - 2026-10-16
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Lockstep release; package APIs are unchanged.
|
|
39
|
+
|
|
7
40
|
## 5.29.0 - 2026-10-01
|
|
8
41
|
|
|
9
42
|
### Changed
|
|
@@ -79,6 +112,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
79
112
|
### Changed
|
|
80
113
|
|
|
81
114
|
- Lockstep release maintenance and dependency refresh.
|
|
115
|
+
|
|
82
116
|
## 5.20.0 - 2026-09-24
|
|
83
117
|
|
|
84
118
|
### Changed
|