@workflow/web-shared 5.0.0-beta.36 → 5.0.0-beta.38

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.
@@ -487,7 +487,7 @@ export async function hydrateResourceIOAsync<T>(
487
487
  resource: T,
488
488
  key?: Uint8Array
489
489
  ): Promise<T> {
490
- const { hydrateDataWithKey } = await import(
490
+ const { hydrateDataWithKey, deriveRunPayloadKeys } = await import(
491
491
  '@workflow/core/serialization-format'
492
492
  );
493
493
  // Payloads may be zstd-compressed (the Web DecompressionStream has no zstd);
@@ -497,11 +497,17 @@ export async function hydrateResourceIOAsync<T>(
497
497
  './zstd-browser-decoder.js'
498
498
  );
499
499
  ensureZstdDecoderRegistered();
500
- const cryptoKey = key
501
- ? await import('@workflow/core/encryption').then(({ importKey }) =>
502
- importKey(key)
503
- )
504
- : undefined;
500
+ // Resolve the *full* key capability, not just the symmetric key: a run's
501
+ // event log can contain sealed ('encp') payloads that another run wrote to
502
+ // it (a cross-deployment hook resumption, say), and opening those needs the
503
+ // run's X25519 scalar in addition to its AES key. Both are derived from the
504
+ // same 32 bytes the key-retrieval endpoint returns.
505
+ // Resolve the *full* key capability, not just the symmetric key: a run's
506
+ // event log can contain sealed ('encp') payloads that another run wrote to
507
+ // it (a cross-deployment hook resumption, say), and opening those needs the
508
+ // run's X25519 scalar in addition to its AES key. Both derive from the same
509
+ // 32 bytes the key-retrieval endpoint returns.
510
+ const cryptoKey = key ? await deriveRunPayloadKeys(key) : undefined;
505
511
  const revivers = getRevivers();
506
512
 
507
513
  async function hydrateField(value: unknown): Promise<unknown> {