@@ -82,6 +82,28 @@ function readMatrixPackageJson(): {
8282 } ;
8383}
8484
85+ function readAmazonBedrockPackageJson ( ) : {
86+ dependencies ?: Record < string , string > ;
87+ optionalDependencies ?: Record < string , string > ;
88+ openclaw ?: {
89+ releaseChecks ?: {
90+ rootDependencyMirrorAllowlist ?: unknown ;
91+ } ;
92+ } ;
93+ } {
94+ return JSON . parse (
95+ readFileSync ( resolve ( REPO_ROOT , "extensions/amazon-bedrock/package.json" ) , "utf8" ) ,
96+ ) as {
97+ dependencies ?: Record < string , string > ;
98+ optionalDependencies ?: Record < string , string > ;
99+ openclaw ?: {
100+ releaseChecks ?: {
101+ rootDependencyMirrorAllowlist ?: unknown ;
102+ } ;
103+ } ;
104+ } ;
105+ }
106+
85107function collectRuntimeDependencySpecs ( packageJson : {
86108 dependencies ?: Record < string , string > ;
87109 optionalDependencies ?: Record < string , string > ;
@@ -328,6 +350,21 @@ describe("plugin-sdk package contract guardrails", () => {
328350 }
329351 } ) ;
330352
353+ it ( "mirrors Bedrock runtime deps needed by the bundled host graph" , ( ) => {
354+ const rootRuntimeDeps = collectRuntimeDependencySpecs ( readRootPackageJson ( ) ) ;
355+ const bedrockPackageJson = readAmazonBedrockPackageJson ( ) ;
356+ const bedrockRuntimeDeps = collectRuntimeDependencySpecs ( bedrockPackageJson ) ;
357+ const allowlist = bedrockPackageJson . openclaw ?. releaseChecks ?. rootDependencyMirrorAllowlist ;
358+
359+ expect ( Array . isArray ( allowlist ) ) . toBe ( true ) ;
360+ const bedrockRootMirrorAllowlist = allowlist as string [ ] ;
361+ expect ( bedrockRootMirrorAllowlist ) . toEqual ( expect . arrayContaining ( [ "@aws-sdk/client-bedrock" ] ) ) ;
362+
363+ for ( const dep of bedrockRootMirrorAllowlist ) {
364+ expect ( rootRuntimeDeps . get ( dep ) ) . toBe ( bedrockRuntimeDeps . get ( dep ) ) ;
365+ }
366+ } ) ;
367+
331368 it ( "resolves matrix crypto WASM from the root runtime surface" , ( ) => {
332369 const rootRequire = createRootPackageRequire ( ) ;
333370 // Normalize filesystem separators so the package assertion stays portable.
@@ -347,12 +384,15 @@ describe("plugin-sdk package contract guardrails", () => {
347384 const archivePath = packOpenClawToTempDir ( packDir ) ;
348385 const packedPackageJson = await readPackedRootPackageJson ( archivePath ) ;
349386 const matrixPackageJson = readMatrixPackageJson ( ) ;
387+ const bedrockPackageJson = readAmazonBedrockPackageJson ( ) ;
350388
351389 expect ( packedPackageJson . dependencies ?. [ "@matrix-org/matrix-sdk-crypto-wasm" ] ) . toBe (
352390 matrixPackageJson . dependencies ?. [ "@matrix-org/matrix-sdk-crypto-wasm" ] ,
353391 ) ;
392+ expect ( packedPackageJson . dependencies ?. [ "@aws-sdk/client-bedrock" ] ) . toBe (
393+ bedrockPackageJson . dependencies ?. [ "@aws-sdk/client-bedrock" ] ,
394+ ) ;
354395 expect ( packedPackageJson . dependencies ?. [ "@openclaw/plugin-package-contract" ] ) . toBeUndefined ( ) ;
355- expect ( packedPackageJson . dependencies ?. [ "@aws-sdk/client-bedrock" ] ) . toBeUndefined ( ) ;
356396 } finally {
357397 rmSync ( tempRoot , { recursive : true , force : true } ) ;
358398 }
0 commit comments