@plumbus/ai-bedrock 0.3.0-beta.0 → 0.3.0-beta.1
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 +23 -0
- package/README.md +3 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/bedrock-adapter.d.ts.map +1 -1
- package/dist/bedrock-adapter.js +188 -16
- package/dist/bedrock-adapter.js.map +1 -1
- package/instructions/framework.md +8 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
# @plumbus/ai-bedrock
|
|
2
2
|
|
|
3
|
+
## 0.3.0-beta.1 — 2026-10-12
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Carry Converse/ConverseStream prompt caching from stable 0.2.2 into the beta family, preserving native structured-output schemas and per-call deadlines. Use with core 0.8.0-beta.10.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **A request its timeout ends is reported as a timeout.** When `requestTimeout`, or the request's own `timeout` (a prompt's `model.timeoutMs` or a call's `timeoutMs` in core), ended a Converse call, it failed with the AWS SDK's bare `AbortError: Request aborted`, the same as a caller's cancellation. It now fails with core's `ProviderAPIError` shape (`name: 'ProviderAPIError'`, `providerName: 'bedrock'`, `retryable: false`, `timeoutMs`), message `Bedrock request timed out after <ms> ms`, which core's `isProviderAPIError` recognises; a stream ends with an `error` event carrying that message, also when the timeout cuts it off after some deltas — whether the SDK's event stream then breaks or just ends, which could otherwise be reported as some other error or as a finished answer. A caller's abort is still rethrown as raised.
|
|
12
|
+
- **Embeddings honour a per-call timeout.** `embed()` gave every InvokeModel call the adapter's `requestTimeout`, ignoring the request, and a call it ended failed with a bare `AbortError`. `EmbeddingRequest.timeout` (core's RAG `ingest`/`retrieve` and `ctx.ai.retrieve` `timeoutMs`) now sets it, per InvokeModel call, and a call the timeout ends fails with the same `ProviderAPIError` shape as Converse (`Bedrock request timed out after <ms> ms`, `timeoutMs`), which core's `isProviderTimeoutError` recognises.
|
|
13
|
+
- **An unusable timeout is refused before anything is sent.** A `requestTimeout` or request `timeout` that was not a whole number of milliseconds from 1 to 2 147 483 647 went straight to `AbortSignal.timeout`, which threw a bare `RangeError` for `-1`, `1.5` or `NaN` (an `AI_BEDROCK_REQUEST_TIMEOUT` that is not a number), ended the request at once for `0`, and fired after 1 ms above the maximum. `complete()`, `stream()` and `embed()` now fail with core's `AIInvalidRequestError` (`reason: 'timeout_invalid'`) before loading pricing or calling Bedrock, as core's OpenAI and Anthropic adapters do.
|
|
14
|
+
- **Embeddings stop when the caller cancels.** `embed()` ignored the request's signal (core had none on `EmbeddingRequest`), so a cancelled `ctx.ai.retrieve` or RAG `ingest` kept every InvokeModel call running and sent the remaining texts. `embed()` now honours `EmbeddingRequest.signal` (core's new field): the calls in flight are aborted and fail as `complete()` does on a caller abort (the AWS SDK's `AbortError`, the caller's reason as its `cause`), no further text is sent once it fires between texts (rejecting with the caller's reason as raised), and an already-aborted signal rejects with its reason before pricing is loaded or Bedrock is called. Needs the `@plumbus/core` release that adds `EmbeddingRequest.signal`.
|
|
15
|
+
|
|
3
16
|
## 0.3.0-beta.0 — 2026-09-11 — core 0.8 beta family
|
|
4
17
|
|
|
5
18
|
### Upgrade boundary
|
|
6
19
|
|
|
7
20
|
- Beta prerelease of the coordinated core 0.8 family (core 0.8.x, UI 0.9.x, MCP 0.7.x, voice 0.6.x, other add-ons 0.3.x), published under the branch-named npm dist-tag `plumbus-next` (`latest` stays on the 0.7 family). Previous caret ranges exclude it; install the whole family together and follow the [0.8 upgrade notes](../../docs/upgrading-core-0.8.md). Internal peers use prerelease-inclusive ranges (for example `>=0.8.0-beta.0 <0.9.0`) until the family goes stable.
|
|
8
21
|
|
|
22
|
+
## 0.2.2 — 2026-10-08
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Prompt caching on Converse / ConverseStream (#63). When a request sets `cache` (core 0.7.9+ passes it from `ctx.ai`, `runToolLoop`, and `AI_PROMPT_CACHE`), the adapter appends `cachePoint` after the system text, at the end of `toolConfig.tools`, and on the last message when requested. Only Claude model ids get marks, with or without an inference-profile prefix (`us.`, `jp.`, `us-gov.`, …); a model ARN gets none. Claude 3 Haiku, Claude 3 Sonnet, Claude 3 Opus, and Claude 3.5 Sonnet `20240620` get no marks because Bedrock rejects `cachePoint` for them with a ValidationException, and neither does Claude 3.5 Sonnet v2 (`20241022`), whose explicit caching AWS lists as Preview; other model families get none either, so those requests still succeed.
|
|
27
|
+
|
|
28
|
+
### Compatibility
|
|
29
|
+
|
|
30
|
+
- Loads and runs on any core 0.7.x. The `cache` option is resolved inside this package, which imports nothing from `@plumbus/core` that 0.7.0 lacks. On cores before 0.7.9, `ctx.ai` never sets `cache`, so requests are unchanged. The peer range stays `0.7.x`.
|
|
31
|
+
|
|
9
32
|
## 0.2.1 — 2026-09-10
|
|
10
33
|
|
|
11
34
|
### Fixed
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ An opt-in peer keeps core lean while giving AWS shops a first-class `provider: '
|
|
|
46
46
|
|
|
47
47
|
## Status
|
|
48
48
|
|
|
49
|
-
Optional peer of `@plumbus/core` (version
|
|
49
|
+
Optional peer of `@plumbus/core` (beta family version **`0.3.0-beta.1`**, npm dist-tag `plumbus-next`; required peer `@plumbus/core` **`>=0.8.0-beta.0 <0.9.0`**). The beta includes prompt caching through `ctx.ai`; on the stable 0.7 line caching needs core **≥ 0.7.9** and Bedrock **≥ 0.2.2**. Install alone is not enough until the adapter is registered (env discovery or `createBedrockAdapter`).
|
|
50
50
|
|
|
51
51
|
## Install
|
|
52
52
|
|
|
@@ -129,11 +129,12 @@ Full curl, normalize script, ConfigMap sketch: **[instructions/pricing.md](./ins
|
|
|
129
129
|
- **Model access** — Converse fails with `AccessDenied` until the account enables the model (and Anthropic use-case forms where required).
|
|
130
130
|
- **Embeddings** — Converse does not embed; use InvokeModel (Titan) via `createRAGPipeline({ provider })` + `ctx.ai.retrieve` / `ragPipeline.ingest`. There is no `ctx.ai.embed`. `plumbus rag ingest` does not auto-select Bedrock. Mantle typically has no embeddings.
|
|
131
131
|
- **Tools** — use `runToolLoop` / `generateWithUsage({ tools })`; do not call the Bedrock SDK. Stream accumulates partial tool JSON. Parallel tool results are coalesced into the single user turn Converse requires.
|
|
132
|
+
- **Prompt caching** — set `cache` on `ctx.ai.*` / `runToolLoop`, or `AI_PROMPT_CACHE=true` (core ≥ 0.7.9). Claude models get Converse `cachePoint` marks, except Claude 3 Haiku / Sonnet / Opus and Claude 3.5 Sonnet `20240620`, which reject them, and Claude 3.5 Sonnet v2 (Preview-only on Bedrock); other families get none.
|
|
132
133
|
- **`toolChoice: 'none'`** — Bedrock has no true none; Plumbus omits `toolConfig` entirely. `'auto'` omits just the `toolChoice` field (model-dependent support).
|
|
133
134
|
- **Missing pricing file** — file mode throws on first call; auto-download failure warns, leaves cost unknown, and backs off 5 minutes before retrying.
|
|
134
135
|
- **Unmapped / unkeyed models** — inference works; **no `cost` field** is set until the pricing file has an explicit family-key row (auto-download is best-effort, not a complete AWS catalog). Core then falls back to its own catalog rather than recording the call as free.
|
|
135
136
|
- **IAM** — Converse itself requires `bedrock:InvokeModel`; do not scope that action to embedding models only.
|
|
136
|
-
- **Wiring** — after install, `plumbus init --patch` (core
|
|
137
|
+
- **Wiring** — after install, `plumbus init --patch` (wiring v13+, any core 0.7.x) so agents see `instructions/`.
|
|
137
138
|
|
|
138
139
|
## Documentation / Agent recipes
|
|
139
140
|
|