@openclaw/amazon-bedrock-provider 2026.5.28-beta.4 → 2026.5.30-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/dist/discovery.js +20 -10
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -4
package/dist/discovery.js
CHANGED
|
@@ -4,6 +4,7 @@ import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } fro
|
|
|
4
4
|
import "@aws-sdk/client-bedrock";
|
|
5
5
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/core";
|
|
6
6
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
7
|
+
import { isFutureDateTimestampMs, resolveExpiresAtMsFromDurationSeconds } from "openclaw/plugin-sdk/number-runtime";
|
|
7
8
|
//#region extensions/amazon-bedrock/discovery.ts
|
|
8
9
|
const log = createSubsystemLogger("bedrock-discovery");
|
|
9
10
|
const DEFAULT_REFRESH_INTERVAL_SECONDS = 3600;
|
|
@@ -307,8 +308,11 @@ async function discoverBedrockModels(params) {
|
|
|
307
308
|
const now = params.now?.() ?? Date.now();
|
|
308
309
|
if (refreshIntervalSeconds > 0) {
|
|
309
310
|
const cached = discoveryCache.get(cacheKey);
|
|
310
|
-
if (cached
|
|
311
|
-
|
|
311
|
+
if (cached && isFutureDateTimestampMs(cached.expiresAt, { nowMs: now })) {
|
|
312
|
+
if (cached.value) return cached.value;
|
|
313
|
+
if (cached.inFlight) return cached.inFlight;
|
|
314
|
+
}
|
|
315
|
+
if (cached) discoveryCache.delete(cacheKey);
|
|
312
316
|
}
|
|
313
317
|
const sdk = params.clientFactory ? createInjectedClientDiscoverySdk() : await loadBedrockDiscoverySdk();
|
|
314
318
|
const clientFactory = params.clientFactory ?? ((region) => sdk.createClient(region));
|
|
@@ -349,16 +353,22 @@ async function discoverBedrockModels(params) {
|
|
|
349
353
|
return a.name.localeCompare(b.name);
|
|
350
354
|
});
|
|
351
355
|
})();
|
|
352
|
-
if (refreshIntervalSeconds > 0)
|
|
353
|
-
expiresAt
|
|
354
|
-
|
|
355
|
-
|
|
356
|
+
if (refreshIntervalSeconds > 0) {
|
|
357
|
+
const expiresAt = resolveExpiresAtMsFromDurationSeconds(refreshIntervalSeconds, { nowMs: now });
|
|
358
|
+
if (expiresAt !== void 0) discoveryCache.set(cacheKey, {
|
|
359
|
+
expiresAt,
|
|
360
|
+
inFlight: discoveryPromise
|
|
361
|
+
});
|
|
362
|
+
}
|
|
356
363
|
try {
|
|
357
364
|
const value = await discoveryPromise;
|
|
358
|
-
if (refreshIntervalSeconds > 0)
|
|
359
|
-
expiresAt
|
|
360
|
-
|
|
361
|
-
|
|
365
|
+
if (refreshIntervalSeconds > 0) {
|
|
366
|
+
const expiresAt = resolveExpiresAtMsFromDurationSeconds(refreshIntervalSeconds, { nowMs: now });
|
|
367
|
+
if (expiresAt !== void 0) discoveryCache.set(cacheKey, {
|
|
368
|
+
expiresAt,
|
|
369
|
+
value
|
|
370
|
+
});
|
|
371
|
+
}
|
|
362
372
|
return value;
|
|
363
373
|
} catch (error) {
|
|
364
374
|
if (refreshIntervalSeconds > 0) discoveryCache.delete(cacheKey);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/amazon-bedrock-provider",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.30-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/amazon-bedrock-provider",
|
|
9
|
-
"version": "2026.5.
|
|
9
|
+
"version": "2026.5.30-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@aws-sdk/client-bedrock": "3.1053.0",
|
|
12
12
|
"@aws-sdk/client-bedrock-runtime": "3.1053.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/amazon-bedrock-provider",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.30-beta.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.5.
|
|
28
|
+
"pluginApi": ">=2026.5.30-beta.1"
|
|
29
29
|
},
|
|
30
30
|
"build": {
|
|
31
|
-
"openclawVersion": "2026.5.
|
|
31
|
+
"openclawVersion": "2026.5.30-beta.1",
|
|
32
32
|
"bundledDist": false
|
|
33
33
|
},
|
|
34
34
|
"release": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"npm-shrinkwrap.json"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"openclaw": ">=2026.5.
|
|
48
|
+
"openclaw": ">=2026.5.30-beta.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|