@crvouga/mockingbird-service-bedrock 3.7.0 → 3.9.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 +18 -1
- package/README.md +57 -5
- package/dist/{chunk-3H4ZVXWL.js → chunk-L7PA26YR.js} +2 -2
- package/dist/{chunk-LG5SXNQW.js → chunk-UBDTCNCX.js} +213 -31
- package/dist/chunk-UBDTCNCX.js.map +7 -0
- package/dist/cli.js +15 -6
- package/dist/cli.js.map +2 -2
- package/dist/index.d.ts +36 -3
- package/dist/index.js +5 -1
- package/dist/server.d.ts +28 -1
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-LG5SXNQW.js.map +0 -7
- /package/dist/{chunk-3H4ZVXWL.js.map → chunk-L7PA26YR.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-bedrock
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
3
|
+
## 3.9.0 (2026-10-21)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add manual response controls ([4599960](https://github.com/crvouga/mockingbird/commit/45999603e8b860c633181367afc7baa906ba486b))
|
|
8
|
+
|
|
9
|
+
## 3.8.0 (2026-10-20)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- raise the serve and fleet body limit to the S3 maximum ([86b9e2b](https://github.com/crvouga/mockingbird/commit/86b9e2b80bcaaaef57f52edbac50b27da0b42f33))
|
|
14
|
+
|
|
15
|
+
### Fixes and improvements
|
|
16
|
+
|
|
17
|
+
- finish junction, notion and bedrock docs and tests ([f1b4ccb](https://github.com/crvouga/mockingbird/commit/f1b4ccb4441144b5151b536aaacc8519b2e86075))
|
|
18
|
+
- reject unknown script match keys and add schema, document and cache validation ([af0c60d](https://github.com/crvouga/mockingbird/commit/af0c60d672ec6810fca1b9a69559f34181303499))
|
|
19
|
+
|
|
20
|
+
## 3.7.0 (2026-10-18)
|
|
4
21
|
|
|
5
22
|
### Features
|
|
6
23
|
|
package/README.md
CHANGED
|
@@ -106,7 +106,7 @@ HTTP/1.1 only — fine for the AI SDK, not for the SDK v3 Bedrock client.)
|
|
|
106
106
|
| --- | --- |
|
|
107
107
|
| `POST /model/{modelId}/converse` | Converse JSON: `output.message.content[]` (`text`, `toolUse`, `reasoningContent`), `stopReason`, `usage` (with `cacheRead/WriteInputTokens` when a `cachePoint` is present), `metrics`, `trace.guardrail` (with `guardrailConfig.trace: "enabled"`), `x-amzn-RequestId`. |
|
|
108
108
|
| `POST /model/{modelId}/converse-stream` | The same answer as event frames: `messageStart`, `contentBlockStart` (tool use), `contentBlockDelta` (`text`, `toolUse.input` partial JSON, `reasoningContent`), `contentBlockStop`, `messageStop`, `metadata`; exception frames mid-stream. |
|
|
109
|
-
| `POST /model/{modelId}/invoke` | `amazon.titan-embed-text-*`: `{embedding, inputTextTokenCount}` — a deterministic unit vector from SHA-256(`inputText`) (1024-d by default; `dimensions` 256/512/1024). Claude models: an Anthropic Messages body in, a Messages response out. |
|
|
109
|
+
| `POST /model/{modelId}/invoke` | `amazon.titan-embed-text-*`: `{embedding, inputTextTokenCount}` — a deterministic unit vector from SHA-256(`inputText`) (1024-d by default; `dimensions` 256/512/1024), or a lexical one with `embeddingMode: "lexical"` (see Settings). Claude models: an Anthropic Messages body in, a Messages response out. |
|
|
110
110
|
| `POST /model/{modelId}/invoke-with-bidirectional-stream` | Nova Sonic (`*sonic*`), HTTP/2 duplex: reads `chunk` events as they arrive (SigV4 envelopes unwrapped), answers each user turn with `textOutput` + 24 kHz PCM tone `audioOutput` + `toolUse`, then `usageEvent`; `completionEnd` after `sessionEnd`. |
|
|
111
111
|
| `POST /harnesses/invoke?harnessArn=` | AgentCore harness stream: `messageStart`, `contentBlockDelta` (`text` or `toolResult[]`), `contentBlockStop`, `messageStop`, `metadata`; `validationException` / `internalServerException` / `runtimeClientError` frames. |
|
|
112
112
|
|
|
@@ -114,7 +114,8 @@ HTTP/1.1 only — fine for the AI SDK, not for the SDK v3 Bedrock client.)
|
|
|
114
114
|
accepted without verification. Request checks Bedrock makes and our code branches on are
|
|
115
115
|
enforced: role alternation, first/last message is the user (assistant **prefill** is rejected
|
|
116
116
|
for Claude 4.5+), tool-use/tool-result pairing, `toolConfig` required with tool blocks, a
|
|
117
|
-
document needs a sibling text block, `temperature` + `top_p` together on Claude 4.5
|
|
117
|
+
document needs a sibling text block, `temperature` + `top_p` together on Claude 4.5+, plus the
|
|
118
|
+
best-guess checks listed under "Best guesses, not oracle-verified". Errors are
|
|
118
119
|
`x-amzn-ErrorType: <Name>:http://internal.amazon.com/coral/com.amazon.bedrock/` + `{"message"}`.
|
|
119
120
|
Output longer than `maxTokens` (≈4 chars/token) is cut with `stopReason: "max_tokens"`.
|
|
120
121
|
|
|
@@ -127,8 +128,16 @@ how many calls it answers.
|
|
|
127
128
|
- **Match keys:** `modelId` (glob), `operation` (`Converse`, `ConverseStream`, `InvokeModel`,
|
|
128
129
|
`InvokeModelWithBidirectionalStream`, `InvokeHarness`), `lastUserText` (string = contains, or
|
|
129
130
|
`{contains, regex, flags}`), `systemHash` (SHA-256 hex of the system text blocks joined with
|
|
130
|
-
`\n`), `
|
|
131
|
-
`
|
|
131
|
+
`\n`), `systemText` (the same joined system text, `cachePoint` blocks skipped; string =
|
|
132
|
+
case-insensitive contains, or `{contains, regex, flags}`; a call with no system prompt never
|
|
133
|
+
matches; for `InvokeModel` the Claude `system` string or text blocks, never stored),
|
|
134
|
+
`jsonSchemaName` (`outputConfig.textFormat.structure.jsonSchema.name`; string =
|
|
135
|
+
case-insensitive equality, or `{contains, regex, flags}`; a call without a named `outputConfig`
|
|
136
|
+
schema never matches), `toolsInclude`, `toolChoice` (`auto` / `any` / a tool name), `hasDocument`, `hasImage`,
|
|
137
|
+
`callIndex` (0-based index of the call in the namespace). `match` is a closed set: an unknown
|
|
138
|
+
or misspelled key (`lastUserTxt`) or a malformed criterion makes `PUT`/`POST /__admin/scripts`
|
|
139
|
+
answer 400 (`scripts[0].match.lastUserTxt: unknown match field (one of ...)`) instead of
|
|
140
|
+
silently matching every call; the same goes for an unknown key inside a text match.
|
|
132
141
|
- **Turn selection** reads the conversation, not server state: turn *n* answers the call that
|
|
133
142
|
comes after *n* assistant messages since the member last said something. So turn 0 is the
|
|
134
143
|
first call of a user turn, turn 1 is the call that resumes after a tool result, and every new
|
|
@@ -166,6 +175,7 @@ applies to every model and harness call in the calling namespace):
|
|
|
166
175
|
| `latency` (`latencyMs`) | the response starts after 2 s on the emulator clock |
|
|
167
176
|
| `truncated_frame` | the stream stops half-way through a frame (both decoders throw) |
|
|
168
177
|
| `model_timeout`, `service_unavailable`, `access_denied`, `internal_server` | 408 / 503 / 403 / 500 with the matching `x-amzn-ErrorType` |
|
|
178
|
+
| `resource_not_found` | 404 `ResourceNotFoundException` ("The specified resource ARN was not found. Check the ARN and try again.", per the Converse API reference), before any frame, on Converse, ConverseStream and InvokeModel |
|
|
169
179
|
|
|
170
180
|
Chunk pacing and latency wait on the **emulator clock**: freeze it (`POST /__admin/clock
|
|
171
181
|
{"freeze": true}`) and advance it to release each chunk, so time-to-first-token tests are exact.
|
|
@@ -179,12 +189,53 @@ Chunk pacing and latency wait on the **emulator clock**: freeze it (`POST /__adm
|
|
|
179
189
|
| `GET /__admin/scripts` | Scripts plus `stats` (`calls`, `scripted`, `unscripted`, `byScript`, `byFallback`, `byOperation`). |
|
|
180
190
|
| `DELETE /__admin/scripts[?id=]` | Remove one or all. |
|
|
181
191
|
| `GET /__admin/model-metrics` | Just the stats. |
|
|
182
|
-
| `GET/PUT /__admin/settings` | `defaultText`, `chunkSize` (16), `delayMsPerChunk` (0), `audioTurnChunks` (0: a Nova Sonic spoken turn ends at the audio `contentEnd`; n: after n audio frames). |
|
|
192
|
+
| `GET/PUT /__admin/settings` | `defaultText`, `chunkSize` (16), `delayMsPerChunk` (0), `audioTurnChunks` (0: a Nova Sonic spoken turn ends at the audio `contentEnd`; n: after n audio frames), `embeddingMode` (`sha256` default, or `lexical`), `validatePromptCaching` (`true` default; `false` disables the model check on `cachePoint`). |
|
|
193
|
+
|
|
194
|
+
`embeddingMode: "lexical"` (opt-in; the test-control request in #522, not a Bedrock behaviour)
|
|
195
|
+
keeps Titan vectors deterministic and unit length but makes them similarity-preserving: each
|
|
196
|
+
word (lowercased, accents and punctuation dropped) adds to a SHA-256-chosen signed dimension, so
|
|
197
|
+
texts differing only in case, punctuation or spacing have cosine similarity 1, texts sharing most
|
|
198
|
+
words score high, and texts with no word in common score near 0. It is bag-of-words, not a
|
|
199
|
+
language model: synonyms ("evening" / "night") stay apart. Scripted per-text vectors are not
|
|
200
|
+
implemented. `normalize: false` is ignored in both modes (vectors are always unit length).
|
|
183
201
|
|
|
184
202
|
The request journal (`GET /__admin/requests`) records per call only `modelId`, `script` (or
|
|
185
203
|
`unscripted:<default>`), tool names, flags (`cachePoint`, `guardrail`, `document`, `image`,
|
|
186
204
|
`structured:<form>`), `stopReason` and token counts — never prompt or message text.
|
|
187
205
|
|
|
206
|
+
### Best guesses, not oracle-verified
|
|
207
|
+
|
|
208
|
+
These request checks come from the AWS documentation and what consumers reported about live
|
|
209
|
+
Bedrock, not from observing the service; the exact message text of the ones marked "ours" is an
|
|
210
|
+
emulator choice. All answer `400 ValidationException`.
|
|
211
|
+
|
|
212
|
+
- **Structured-output schemas** (`outputConfig.textFormat.structure.jsonSchema.schema`, Converse
|
|
213
|
+
and ConverseStream, [docs](https://docs.aws.amazon.com/bedrock/latest/userguide/structured-output.html)):
|
|
214
|
+
`schema` that is not a JSON object (ours); `oneOf` (`Schema type 'oneOf' is not supported`);
|
|
215
|
+
`additionalProperties` set to anything other than `false` on any node, `true` or a sub-schema
|
|
216
|
+
(`For 'object' type, 'additionalProperties: <X>' is not supported. Please set
|
|
217
|
+
'additionalProperties' to false`); a string-only `enum` combined with a union `type` such as
|
|
218
|
+
`["string","null"]` (ours); `minimum`, `maximum`, `multipleOf`, `minLength`, `maxLength`,
|
|
219
|
+
`minItems` above 1, an external `$ref`, and a recursive `$ref` cycle (ours). An omitted
|
|
220
|
+
`additionalProperties` and `anyOf` / `allOf` / internal `$ref` / `$defs` pass. Only the
|
|
221
|
+
`outputConfig` form is checked, not `additionalModelRequestFields.output_config` nor
|
|
222
|
+
`InvokeModel` bodies.
|
|
223
|
+
- **Document names** (`document.name`, [API reference](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_DocumentBlock.html)):
|
|
224
|
+
1 to 200 characters of ASCII letters, digits, whitespace, hyphens, parentheses and square
|
|
225
|
+
brackets, with no run of two whitespace characters. The message is the one a consumer recorded
|
|
226
|
+
from live Bedrock.
|
|
227
|
+
- **`cachePoint`** ([docs](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html)):
|
|
228
|
+
a `cachePoint` content block directly after a `document` block (consumer report; message ours);
|
|
229
|
+
and, on Converse / ConverseStream, a `cachePoint` in `system`, `messages` or `toolConfig.tools`
|
|
230
|
+
for a model outside the documented list (Claude 3.5 Haiku, 3.5 Sonnet v2, 3.7 Sonnet, Claude
|
|
231
|
+
4 and later Opus / Sonnet / Haiku, Fable and Mythos; Nova Micro / Lite / Pro / 2 Lite), matched
|
|
232
|
+
on the family inside plain, `us.` / `global.` and ARN forms. The list grows: turn the model
|
|
233
|
+
check off with `PUT /__admin/settings {"validatePromptCaching": false}`. The `ttl` field is
|
|
234
|
+
not checked.
|
|
235
|
+
- **Unknown model ids** still answer normally (`modelId` is any id). A `knownModels` setting that
|
|
236
|
+
makes an unknown id fail was requested in #523 but not built: whether live Bedrock answers
|
|
237
|
+
`ResourceNotFoundException` or `ValidationException` for it has not been observed.
|
|
238
|
+
|
|
188
239
|
### Namespaces
|
|
189
240
|
|
|
190
241
|
`x-mockingbird-namespace`, a `/__admin/ns/<name>` prefix on the endpoint URL, or by credential: the SDKs
|
|
@@ -213,6 +264,7 @@ cannot add headers, so map each worker's access key id:
|
|
|
213
264
|
| `accessKeyCredential` | function | The SigV4 access key id of a request (how credentials map to namespaces). |
|
|
214
265
|
| `clockSleep` | function | A sleep that waits on a (possibly frozen) emulator clock. |
|
|
215
266
|
| `titanEmbedding` | function | The deterministic unit vector Titan answers with. |
|
|
267
|
+
| `lexicalEmbedding`, `EMBEDDING_MODES` | function, array | The opt-in similarity-preserving embedding and the `embeddingMode` values. |
|
|
216
268
|
| `sampleSchema` | function | The minimal instance of a JSON Schema (the unscripted structured output). |
|
|
217
269
|
| `parseScript` | function | Validate one script (what `PUT /__admin/scripts` runs). |
|
|
218
270
|
| `MODEL_OPERATIONS`, `STOP_REASONS`, `TURN_FAULTS` | arrays | The values `operation`, `stopReason` and `fault` accept. |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime,
|
|
3
3
|
parseScript
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UBDTCNCX.js";
|
|
5
5
|
|
|
6
6
|
// src/h2c.ts
|
|
7
7
|
import {
|
|
@@ -338,4 +338,4 @@ export {
|
|
|
338
338
|
createServer,
|
|
339
339
|
serveTarget
|
|
340
340
|
};
|
|
341
|
-
//# sourceMappingURL=chunk-
|
|
341
|
+
//# sourceMappingURL=chunk-L7PA26YR.js.map
|