@openclaw/amazon-bedrock-provider 2026.8.2 → 2026.9.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.
@@ -167,9 +167,9 @@ function buildCohereBody(family, texts, inputType, dims) {
167
167
  }
168
168
  return JSON.stringify(body);
169
169
  }
170
- function parseBedrockEmbeddingResponseJson(raw) {
170
+ function parseEmbeddingResponseJson(raw) {
171
171
  try {
172
- const parsed = JSON.parse(raw);
172
+ const parsed = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(raw));
173
173
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("Amazon Bedrock embedding response returned malformed JSON");
174
174
  return parsed;
175
175
  } catch {
@@ -189,7 +189,7 @@ function asNumberArrayBatch(value) {
189
189
  return value.map((entry) => asNumberArray(entry));
190
190
  }
191
191
  function parseSingle(family, raw) {
192
- const data = parseBedrockEmbeddingResponseJson(raw);
192
+ const data = parseEmbeddingResponseJson(raw);
193
193
  switch (family) {
194
194
  case "nova": return asNumberArray(Array.isArray(data.embeddings) ? data.embeddings[0]?.embedding : null);
195
195
  case "twelvelabs": {
@@ -202,7 +202,7 @@ function parseSingle(family, raw) {
202
202
  }
203
203
  }
204
204
  function parseCohereBatch(family, raw) {
205
- const embeddings = parseBedrockEmbeddingResponseJson(raw).embeddings;
205
+ const embeddings = parseEmbeddingResponseJson(raw).embeddings;
206
206
  if (!embeddings) throw malformedBedrockEmbeddingResponse();
207
207
  if (family === "cohere-v4" && !Array.isArray(embeddings)) {
208
208
  const embeddingRecord = asOptionalRecord(embeddings);
@@ -231,13 +231,12 @@ async function createBedrockEmbeddingProvider(options) {
231
231
  useDualstackEndpoint: client.useDualstackEndpoint
232
232
  });
233
233
  try {
234
- const res = await sdk.send(new InvokeModelCommand({
234
+ return (await sdk.send(new InvokeModelCommand({
235
235
  modelId: client.model,
236
236
  body,
237
237
  contentType: "application/json",
238
238
  accept: "application/json"
239
- }), signal ? { abortSignal: signal } : void 0);
240
- return new TextDecoder().decode(res.body);
239
+ }), signal ? { abortSignal: signal } : void 0)).body;
241
240
  } finally {
242
241
  sdk.destroy();
243
242
  }
@@ -10,19 +10,15 @@ const BASE_CLAUDE_THINKING_LEVELS = [
10
10
  function isOpus5BedrockModelRef(modelRef) {
11
11
  return /(?:^|[/.:])(?:(?:us|eu|ap|apac|au|jp|global)\.)?(?:anthropic\.)?claude-opus-5(?:$|[-.:/])/i.test(modelRef);
12
12
  }
13
- function isOpus48BedrockModelRef(modelRef) {
14
- return /(?:^|[/.:])(?:(?:us|eu|ap|apac|au|jp|global)\.)?(?:anthropic\.)?claude-opus-4[.-]8(?:$|[-.:/])/i.test(modelRef);
13
+ function isOpus47Or48BedrockModelRef(modelRef) {
14
+ return /(?:^|[/.:])(?:(?:us|eu|ap|apac|au|jp|global)\.)?(?:anthropic\.)?claude-opus-4[.-][78](?:$|[-.:/])/i.test(modelRef);
15
15
  }
16
16
  function isOpus46BedrockModelRef(modelRef) {
17
17
  return /(?:^|[/.:])(?:(?:us|eu|ap|apac|au|jp|global)\.)?(?:anthropic\.)?claude-opus-4[.-]6(?:$|[-.:/])/i.test(modelRef);
18
18
  }
19
- /** Return whether a Bedrock model ref names Claude Opus 4.7. */
20
- function isOpus47BedrockModelRef(modelRef) {
21
- return /(?:^|[/.:])(?:(?:us|eu|ap|apac|au|jp|global)\.)?(?:anthropic\.)?claude-opus-4[.-]7(?:$|[-.:/])/i.test(modelRef);
22
- }
23
19
  /** Return whether a Bedrock model ref names Claude Opus 4.7 or newer. */
24
20
  function isOpus47OrNewerBedrockModelRef(modelRef) {
25
- return isOpus5BedrockModelRef(modelRef) || isOpus47BedrockModelRef(modelRef) || isOpus48BedrockModelRef(modelRef);
21
+ return isOpus5BedrockModelRef(modelRef) || isOpus47Or48BedrockModelRef(modelRef);
26
22
  }
27
23
  function isMythosPreviewBedrockModelRef(modelRef) {
28
24
  return /(?:^|[/.:])(?:(?:us|eu|ap|apac|au|jp|global)\.)?(?:anthropic\.)?claude-mythos-preview(?:$|[-.:/])/i.test(modelRef);
@@ -122,16 +118,7 @@ function resolveBedrockClaudeThinkingProfile(modelId, params) {
122
118
  ],
123
119
  defaultLevel: "high"
124
120
  };
125
- if (modelRefs.some(isOpus48BedrockModelRef)) return {
126
- levels: [
127
- ...BASE_CLAUDE_THINKING_LEVELS,
128
- { id: "xhigh" },
129
- { id: "adaptive" },
130
- { id: "max" }
131
- ],
132
- defaultLevel: "off"
133
- };
134
- if (modelRefs.some(isOpus47BedrockModelRef)) return {
121
+ if (modelRefs.some(isOpus47Or48BedrockModelRef)) return {
135
122
  levels: [
136
123
  ...BASE_CLAUDE_THINKING_LEVELS,
137
124
  { id: "xhigh" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/amazon-bedrock-provider",
3
- "version": "2026.8.2",
3
+ "version": "2026.9.1",
4
4
  "description": "OpenClaw Amazon Bedrock provider plugin with model discovery, embeddings, and guardrail support.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,10 +25,10 @@
25
25
  "minHostVersion": ">=2026.5.12-beta.1"
26
26
  },
27
27
  "compat": {
28
- "pluginApi": ">=2026.8.2"
28
+ "pluginApi": ">=2026.9.1"
29
29
  },
30
30
  "build": {
31
- "openclawVersion": "2026.8.2",
31
+ "openclawVersion": "2026.9.1",
32
32
  "bundledDist": false
33
33
  },
34
34
  "release": {
@@ -45,7 +45,7 @@
45
45
  "README.md"
46
46
  ],
47
47
  "peerDependencies": {
48
- "openclaw": ">=2026.8.2"
48
+ "openclaw": ">=2026.9.1"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "openclaw": {