eve 0.27.11 → 0.27.13

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/src/chunks/{use-eve-agent-CTJrwXM2.js → use-eve-agent-CWYe-vqE.js} +29 -18
  3. package/dist/src/chunks/{use-eve-agent-DaWxEtnE.js → use-eve-agent-CsSQOKnp.js} +29 -18
  4. package/dist/src/cli/commands/channels.js +1 -1
  5. package/dist/src/cli/commands/integration-setup.js +1 -1
  6. package/dist/src/cli/commands/register-registry-commands.js +1 -1
  7. package/dist/src/cli/commands/registry-setup-command.d.ts +5 -3
  8. package/dist/src/cli/commands/registry-setup-command.js +1 -1
  9. package/dist/src/cli/commands/registry.d.ts +9 -3
  10. package/dist/src/cli/commands/registry.js +1 -1
  11. package/dist/src/cli/dev/tui/remote-connection-probe.js +1 -1
  12. package/dist/src/cli/dev/tui/runner.js +1 -1
  13. package/dist/src/cli/dev/tui/target.d.ts +3 -15
  14. package/dist/src/cli/dev/tui/tui.js +1 -1
  15. package/dist/src/cli/invoke/command.d.ts +32 -0
  16. package/dist/src/cli/invoke/command.js +1 -0
  17. package/dist/src/cli/invoke/invoke.d.ts +27 -0
  18. package/dist/src/cli/invoke/invoke.js +1 -0
  19. package/dist/src/cli/invoke/result.d.ts +313 -0
  20. package/dist/src/cli/invoke/result.js +1 -0
  21. package/dist/src/cli/run.d.ts +2 -0
  22. package/dist/src/cli/run.js +3 -3
  23. package/dist/src/client/client.js +1 -1
  24. package/dist/src/client/message-response.js +1 -1
  25. package/dist/src/client/session-utils.d.ts +21 -15
  26. package/dist/src/client/session-utils.js +1 -1
  27. package/dist/src/client/session.js +1 -1
  28. package/dist/src/compiled/.vendor-stamp.json +5 -5
  29. package/dist/src/compiled/@workflow/core/capabilities.d.ts +6 -0
  30. package/dist/src/compiled/@workflow/core/encryption.d.ts +15 -2
  31. package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +26 -0
  32. package/dist/src/compiled/@workflow/core/index.d.ts +1 -1
  33. package/dist/src/compiled/@workflow/core/index.js +2 -2
  34. package/dist/src/compiled/@workflow/core/private.d.ts +76 -33
  35. package/dist/src/compiled/@workflow/core/private.js +1 -1
  36. package/dist/src/compiled/@workflow/core/replay-payload-cache.d.ts +3 -2
  37. package/dist/src/compiled/@workflow/core/runtime/count-step-started-events.d.ts +52 -0
  38. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +41 -12
  39. package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +2 -2
  40. package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +9 -8
  41. package/dist/src/compiled/@workflow/core/runtime/world.d.ts +2 -7
  42. package/dist/src/compiled/@workflow/core/runtime.d.ts +1 -1
  43. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  44. package/dist/src/compiled/@workflow/core/sealed-box.d.ts +167 -0
  45. package/dist/src/compiled/@workflow/core/serialization/client.d.ts +3 -3
  46. package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +6 -4
  47. package/dist/src/compiled/@workflow/core/serialization/encryption.d.ts +118 -17
  48. package/dist/src/compiled/@workflow/core/serialization/step.d.ts +4 -4
  49. package/dist/src/compiled/@workflow/core/serialization/types.d.ts +20 -0
  50. package/dist/src/compiled/@workflow/core/serialization-format.d.ts +44 -4
  51. package/dist/src/compiled/@workflow/core/serialization.d.ts +21 -21
  52. package/dist/src/compiled/@workflow/core/set-attributes.d.ts +2 -7
  53. package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +2 -2
  54. package/dist/src/compiled/@workflow/core/symbols.d.ts +23 -10
  55. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +4 -4
  56. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  57. package/dist/src/compiled/@workflow/core/workflow/abort-controller.d.ts +1 -1
  58. package/dist/src/compiled/@workflow/core/workflow/index.d.ts +1 -1
  59. package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +0 -9
  60. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  61. package/dist/src/compiled/@workflow/errors/index.d.ts +1 -1
  62. package/dist/src/compiled/@workflow/world/events.d.ts +5 -0
  63. package/dist/src/compiled/@workflow/world/hooks.d.ts +27 -0
  64. package/dist/src/compiled/@workflow/world/index.d.ts +2 -2
  65. package/dist/src/compiled/@workflow/world/interfaces.d.ts +8 -6
  66. package/dist/src/compiled/@workflow/world/queue.d.ts +30 -26
  67. package/dist/src/compiled/@workflow/world/runs.d.ts +5 -0
  68. package/dist/src/compiled/@workflow/world/spec-version.d.ts +3 -4
  69. package/dist/src/compiled/@workflow/world-local/index.js +4 -4
  70. package/dist/src/compiled/@workflow/world-vercel/index.js +5 -5
  71. package/dist/src/compiled/_chunks/workflow/{attribute-changes-B6ltn-ph.js → attribute-changes-DeZc2RZz.js} +2 -2
  72. package/dist/src/compiled/_chunks/workflow/{dist-D7ANgxe0.js → dist-WjtNsOyf.js} +1 -1
  73. package/dist/src/compiled/_chunks/workflow/private-Cre8uYkA.js +1 -0
  74. package/dist/src/compiled/_chunks/workflow/resume-hook-ip1hbn1b.js +1 -0
  75. package/dist/src/compiled/_chunks/workflow/run-CWytxfIp.js +1 -0
  76. package/dist/src/compiled/_chunks/workflow/sleep-BjrUxUcs.js +1 -0
  77. package/dist/src/compiled/_chunks/workflow/wait-until-De9yESQN.js +15 -0
  78. package/dist/src/compiled/_chunks/workflow/{workflow-routes-Pd-WKcx_.js → workflow-routes-CwqB063q.js} +1 -1
  79. package/dist/src/evals/cli/eval-client.js +1 -1
  80. package/dist/src/evals/session.js +1 -1
  81. package/dist/src/execution/web-fetch/request.js +1 -1
  82. package/dist/src/internal/application/compiled-artifacts.js +1 -1
  83. package/dist/src/internal/application/package.js +1 -1
  84. package/dist/src/internal/node-esm-compat-banner.js +1 -1
  85. package/dist/src/internal/workflow/builtins.d.ts +2 -2
  86. package/dist/src/internal/workflow/development-world-protocol.js +1 -1
  87. package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +5 -5
  88. package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
  89. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/world-target.js +1 -0
  90. package/dist/src/public/channels/linear/defaults.js +4 -2
  91. package/dist/src/runtime/attributes/emit.js +1 -1
  92. package/dist/src/services/dev-client/client-options.d.ts +2 -0
  93. package/dist/src/services/dev-client/client-options.js +1 -1
  94. package/dist/src/services/dev-client/target.d.ts +17 -0
  95. package/dist/src/services/dev-client/target.js +1 -0
  96. package/dist/src/setup/scaffold/create/project.js +1 -1
  97. package/dist/src/setup/verified-remote-client.d.ts +5 -1
  98. package/dist/src/setup/verified-remote-client.js +1 -1
  99. package/dist/src/svelte/index.js +1 -1
  100. package/dist/src/svelte/use-eve-agent.js +1 -1
  101. package/dist/src/vue/index.js +1 -1
  102. package/dist/src/vue/use-eve-agent.js +1 -1
  103. package/docs/channels/linear.mdx +4 -0
  104. package/docs/extensions.md +3 -1
  105. package/docs/install-integrations.mdx +76 -1
  106. package/docs/reference/cli.md +28 -1
  107. package/package.json +8 -8
  108. package/dist/src/compiled/@workflow/core/runtime/step-handler.d.ts +0 -2
  109. package/dist/src/compiled/_chunks/workflow/private-DolBHKOQ.js +0 -1
  110. package/dist/src/compiled/_chunks/workflow/resume-hook-D2AqAGjq.js +0 -1
  111. package/dist/src/compiled/_chunks/workflow/run-BMRZ6pA-.js +0 -1
  112. package/dist/src/compiled/_chunks/workflow/sleep-CrgsokmG.js +0 -1
  113. package/dist/src/compiled/_chunks/workflow/wait-until-B-1TiJji.js +0 -15
  114. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/world-target.js +0 -1
  115. /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/index.js +0 -0
  116. /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/parse-name.js +0 -0
  117. /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/pluralize.js +0 -0
  118. /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/promise.js +0 -0
  119. /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/time.js +0 -0
  120. /package/dist/src/node_modules/.pnpm/{@workflow_utils@5.0.0-beta.6 → @workflow_utils@5.0.0-beta.7}/node_modules/@workflow/utils/dist/workflow-routes.js +0 -0
  121. /package/dist/src/{cli/dev/tui → services/dev-client}/agent-info-probe.d.ts +0 -0
  122. /package/dist/src/{cli/dev/tui → services/dev-client}/agent-info-probe.js +0 -0
@@ -0,0 +1,167 @@
1
+ import { type CryptoKey } from './encryption.js';
2
+ /**
3
+ * A per-run X25519 keypair, derived from the run's key material.
4
+ *
5
+ * Callers should derive this once per run and memoize it alongside the
6
+ * symmetric key — derivation costs several Web Crypto round trips.
7
+ */
8
+ export interface RunKeyPair {
9
+ /** Raw 32-byte X25519 private scalar. Secret. */
10
+ readonly scalar: Uint8Array;
11
+ /** Raw 32-byte X25519 public key. Safe to publish. */
12
+ readonly publicKey: Uint8Array;
13
+ }
14
+ /**
15
+ * Derive the per-run X25519 keypair from the run's 32-byte key material.
16
+ *
17
+ * Deterministic: the same key material always yields the same keypair, which
18
+ * is what lets the owning deployment re-derive its private scalar on demand
19
+ * (from `VERCEL_DEPLOYMENT_KEY`) instead of storing it anywhere.
20
+ *
21
+ * @param runKeyMaterial - The 32 bytes returned by `World.getEncryptionKeyForRun()`
22
+ * @returns The run's X25519 scalar and public key
23
+ */
24
+ export declare function deriveRunKeyPair(runKeyMaterial: Uint8Array): Promise<RunKeyPair>;
25
+ /**
26
+ * Encode bytes as standard (padded) base64.
27
+ *
28
+ * Hand-rolled for the same reason as {@link base64UrlToBytes}: this module
29
+ * runs in the browser (o11y decryption) and inside the workflow VM, so neither
30
+ * `Buffer` nor `btoa` can be assumed. Used for the wire encoding of run public
31
+ * keys, matching the base64 convention already used for `VERCEL_DEPLOYMENT_KEY`
32
+ * and the `run-key` API response.
33
+ */
34
+ export declare function bytesToBase64(bytes: Uint8Array): string;
35
+ /**
36
+ * Decode standard base64 (padding optional) to bytes.
37
+ *
38
+ * Returns `undefined` for malformed input rather than throwing: callers decode
39
+ * public keys that arrive from storage or over the wire, where a corrupt value
40
+ * should degrade to "this run has no usable public key" (and fall back to the
41
+ * symmetric path) rather than crash a resumption.
42
+ *
43
+ * Validation is strict, because a lenient decoder is worse than a throwing one
44
+ * here — silently returning a short or truncated key makes a corrupt value look
45
+ * *present*, so the caller seals to garbage instead of taking the fallback.
46
+ * Rejected: characters outside the alphabet, a length that cannot describe a
47
+ * whole number of bytes (`length % 4 === 1`), padding anywhere but the end, and
48
+ * a final quantum whose unused low bits are not zero.
49
+ */
50
+ export declare function base64ToBytes(value: string): Uint8Array | undefined;
51
+ /**
52
+ * The writer half of the KEM: generate an ephemeral keypair and derive a
53
+ * content key for a recipient's public key.
54
+ *
55
+ * Use this when many payloads share one KEM operation — i.e. stream frames.
56
+ * The returned `contentKey` can only encrypt, so a stream writer provably
57
+ * cannot read the recipient run's data even by mistake.
58
+ *
59
+ * **Callers own nonce discipline.** Encrypt each frame with a fresh random
60
+ * nonce, and call this function again for every new connection attempt or
61
+ * replay so that a restarted writer never reuses a content key. For one-shot
62
+ * payloads prefer {@link seal}, which handles this automatically.
63
+ *
64
+ * @param recipientPublicKey - The recipient run's raw 32-byte X25519 public key
65
+ * @returns The ephemeral public key to publish alongside the ciphertext, and
66
+ * the encrypt-only content key
67
+ */
68
+ export declare function encapsulate(recipientPublicKey: Uint8Array): Promise<{
69
+ ephemeralPublicKey: Uint8Array;
70
+ contentKey: CryptoKey;
71
+ }>;
72
+ /**
73
+ * The recipient half of the KEM: recover the content key for a sealed
74
+ * payload from the run's own keypair and the sender's ephemeral public key.
75
+ *
76
+ * @param keyPair - The recipient run's keypair, from {@link deriveRunKeyPair}
77
+ * @param ephemeralPublicKey - The sender's raw 32-byte X25519 public key,
78
+ * read from the head of the sealed envelope
79
+ * @returns A decrypt-only content key
80
+ */
81
+ export declare function decapsulate(keyPair: RunKeyPair, ephemeralPublicKey: Uint8Array): Promise<CryptoKey>;
82
+ /**
83
+ * Seal a payload to a run's public key.
84
+ *
85
+ * Each call performs its own KEM operation, so every sealed payload gets an
86
+ * independent content key — nonce reuse across calls is impossible by
87
+ * construction.
88
+ *
89
+ * @param recipientPublicKey - The recipient run's raw 32-byte X25519 public key
90
+ * @param data - Plaintext to seal
91
+ * @param aad - Optional additional authenticated data, covered by the GCM tag
92
+ * but not encrypted. Callers pass the recipient's `projectId|runId` so a
93
+ * sealed payload cannot be replayed against a different run.
94
+ * @returns `[ephemeral public key (32)][nonce (12)][ciphertext + tag]`
95
+ */
96
+ export declare function seal(recipientPublicKey: Uint8Array, data: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
97
+ /**
98
+ * Open a payload sealed to this run's public key.
99
+ *
100
+ * @param keyPair - The recipient run's keypair, from {@link deriveRunKeyPair}
101
+ * @param sealed - `[ephemeral public key (32)][nonce (12)][ciphertext + tag]`
102
+ * @param aad - The exact additional authenticated data passed to {@link seal}
103
+ * @returns The decrypted plaintext
104
+ */
105
+ export declare function open(keyPair: RunKeyPair, sealed: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
106
+ /**
107
+ * A writer-side session that amortizes one KEM operation across many sealed
108
+ * payloads — use it for streams, where one-shot {@link seal} would perform a
109
+ * fresh keygen + ECDH + HKDF for every frame.
110
+ *
111
+ * Safety rests on two properties:
112
+ *
113
+ * - Every payload still gets a **fresh random nonce** from `aesGcmEncrypt`, so
114
+ * sharing the content key does not risk `(key, nonce)` reuse. (A counter
115
+ * would: it restarts at zero whenever a writer restarts.)
116
+ * - The session is bound to one writer instance. A reconnect or a durable
117
+ * replay constructs a new session, so a restarted writer never inherits a
118
+ * previous incarnation's content key.
119
+ *
120
+ * The envelope layout is byte-identical to {@link seal}, so a reader cannot
121
+ * tell which was used and needs no matching session.
122
+ */
123
+ export declare function createSealSession(recipientPublicKey: Uint8Array, aad?: Uint8Array): {
124
+ seal(data: Uint8Array): Promise<Uint8Array>;
125
+ };
126
+ /**
127
+ * A reader-side session that caches decapsulation per sender.
128
+ *
129
+ * The mirror of {@link createSealSession}: because every frame from one writer
130
+ * carries the same ephemeral public key, this turns an ECDH per frame into an
131
+ * ECDH per writer. Correctness does not depend on the writer having used a
132
+ * session — a stream of independently sealed payloads simply misses the cache
133
+ * on each new ephemeral key.
134
+ *
135
+ * The cache is keyed by the ephemeral public key and holds one entry, which is
136
+ * the common case (one writer per stream). A second writer evicts the first
137
+ * rather than growing without bound.
138
+ */
139
+ export declare function createOpenSession(keyPair: RunKeyPair, aad?: Uint8Array): {
140
+ open(sealed: Uint8Array): Promise<Uint8Array>;
141
+ };
142
+ /**
143
+ * Build the additional authenticated data that binds a sealed payload to a
144
+ * specific run.
145
+ *
146
+ * Mirrors the `info` used for symmetric per-run key derivation so the two
147
+ * schemes agree on what "this run" means.
148
+ *
149
+ * Note that the sealed-box construction already binds a payload to its
150
+ * recipient without any AAD: the content key is derived over
151
+ * `ephemeralPublicKey ‖ recipientPublicKey`, and a recipient public key is
152
+ * unique per (deployment key × project × run). Replaying a sealed payload at
153
+ * a different run therefore fails at key agreement regardless. AAD is
154
+ * available for callers that want an additional, KDF-independent binding —
155
+ * both sides must supply byte-identical values or the payload will not open.
156
+ */
157
+ export declare function runAad(projectId: string, runId: string): Uint8Array;
158
+ /**
159
+ * Decode a run's published public key, validating both encoding and length.
160
+ *
161
+ * Returns `undefined` when the value is absent, not valid base64, or not
162
+ * exactly 32 bytes. Callers treat that as "this run has no usable public key"
163
+ * and fall back to the symmetric path, so a corrupt or truncated stored value
164
+ * degrades to the pre-existing behavior instead of failing a resumption.
165
+ */
166
+ export declare function decodeRunPublicKey(value: string | undefined): Uint8Array | undefined;
167
+ //# sourceMappingURL=sealed-box.d.ts.map
@@ -5,13 +5,13 @@
5
5
  * arguments) and when receiving workflow return values. Supports encryption.
6
6
  */
7
7
  import type { CodecOptions } from './codec.js';
8
- import { type CryptoKey } from './encryption.js';
8
+ import { type PayloadKey } from './encryption.js';
9
9
  /**
10
10
  * Serialize a value from the client environment (e.g. workflow arguments).
11
11
  */
12
- export declare function serialize(value: unknown, encryptionKey?: CryptoKey, options?: CodecOptions): Promise<Uint8Array | unknown>;
12
+ export declare function serialize(value: unknown, encryptionKey?: PayloadKey, options?: CodecOptions): Promise<Uint8Array | unknown>;
13
13
  /**
14
14
  * Deserialize a value for the client environment (e.g. workflow return value).
15
15
  */
16
- export declare function deserialize(data: Uint8Array | unknown, encryptionKey?: CryptoKey, options?: CodecOptions): Promise<unknown>;
16
+ export declare function deserialize(data: Uint8Array | unknown, encryptionKey?: PayloadKey, options?: CodecOptions): Promise<unknown>;
17
17
  //# sourceMappingURL=client.d.ts.map
@@ -21,7 +21,7 @@ import type { FormatPrefix } from './types.js';
21
21
  *
22
22
  * - `workflow`: Runs inside the workflow VM. Includes class serialization,
23
23
  * step function serialization. No stream handling.
24
- * - `step`: Runs in the step handler (Node.js). Includes class serialization.
24
+ * - `step`: Runs in the step executor (Node.js). Includes class serialization.
25
25
  * No step function serialization. Stream handling at call sites.
26
26
  * - `client`: Runs on the client side. Includes class serialization.
27
27
  * No step function serialization. Stream handling at call sites.
@@ -51,9 +51,11 @@ export interface CodecOptions {
51
51
  */
52
52
  extraRevivers?: Record<string, (value: any) => any>;
53
53
  /**
54
- * Whether to gzip-compress the serialized payload (write side only;
55
- * reads always handle both compressed and uncompressed data). Must
56
- * only be enabled when the target run supports compressed payloads:
54
+ * Whether to compress the serialized payload (write side only; zstd is
55
+ * preferred and gzip is the portable fallback). Reads dispatch compressed
56
+ * payloads by format prefix; zstd decoding still requires runtime or
57
+ * registered decoder support. Must only be enabled when the target run
58
+ * supports compressed payloads:
57
59
  * run specVersion >= SPEC_VERSION_SUPPORTS_COMPRESSION, and for
58
60
  * cross-deployment writes the target deployment's capabilities (see
59
61
  * `getRunCapabilities` in capabilities.ts). Defaults to `false`.
@@ -1,33 +1,134 @@
1
1
  /**
2
2
  * Composable encryption layer for serialized data.
3
3
  *
4
- * Wraps/unwraps serialized payloads with AES-256-GCM encryption,
5
- * using the format prefix system to mark encrypted data.
4
+ * Wraps/unwraps serialized payloads with either symmetric AES-256-GCM
5
+ * encryption (`encr`) or an asymmetric sealed box (`encp`), using the format
6
+ * prefix system to mark which. See {@link PayloadKey} for how a caller
7
+ * declares which capabilities it holds.
6
8
  */
7
9
  import { type CryptoKey } from '../encryption.js';
8
- export type { CryptoKey };
10
+ import { type RunKeyPair } from '../sealed-box.js';
11
+ export type { CryptoKey, RunKeyPair };
12
+ /**
13
+ * Brands distinguishing the structured key variants from a bare `CryptoKey`.
14
+ *
15
+ * `Symbol.for` rather than `Symbol()` because these values cross realm
16
+ * boundaries (host ↔ workflow VM), and the global symbol registry is shared
17
+ * across realms while unique symbols are not.
18
+ */
19
+ declare const SEAL_TARGET_BRAND: unique symbol;
20
+ declare const RUN_KEYS_BRAND: unique symbol;
21
+ /**
22
+ * A write-only capability: seal payloads to a run's X25519 public key.
23
+ *
24
+ * This is what a *cross-run* writer holds — a hook resumption targeting
25
+ * another run, or a child workflow writing into a parent's forwarded stream.
26
+ * It carries no ability to decrypt anything, and because it is a distinct
27
+ * nominal type it cannot be mistaken for symmetric key material.
28
+ *
29
+ * That last property matters more than it looks: a raw 32-byte X25519 public
30
+ * key is a *structurally valid* AES-256 key, so handing one to
31
+ * `importKey(..., 'AES-GCM')` succeeds and silently produces ciphertext that
32
+ * nobody can ever open. Routing public keys exclusively through
33
+ * {@link sealTo} makes that mistake unrepresentable rather than merely
34
+ * discouraged.
35
+ */
36
+ export interface SealTarget {
37
+ readonly [SEAL_TARGET_BRAND]: true;
38
+ /** The recipient run's raw 32-byte X25519 public key. */
39
+ readonly recipientPublicKey: Uint8Array;
40
+ /** Additional authenticated data binding the payload to the recipient run. */
41
+ readonly aad?: Uint8Array;
42
+ }
43
+ /**
44
+ * The full key capability of a run's *own* runtime (and of o11y tooling
45
+ * acting on its behalf): the symmetric key for its own payloads, plus the
46
+ * keypair needed to open sealed payloads that other runs wrote to it.
47
+ */
48
+ export interface RunPayloadKeys {
49
+ readonly [RUN_KEYS_BRAND]: true;
50
+ /** Symmetric AES-256-GCM key — the run's own `encr` payloads. */
51
+ readonly aes: CryptoKey;
52
+ /** X25519 keypair — opens `encp` payloads sealed to this run. */
53
+ readonly keyPair: RunKeyPair;
54
+ /** Additional authenticated data expected on sealed payloads. */
55
+ readonly aad?: Uint8Array;
56
+ }
57
+ /**
58
+ * A resolved key for reading or writing a serialized payload.
59
+ *
60
+ * The bare `CryptoKey` variant is the historical shape and remains valid: it
61
+ * means "symmetric only", which is exactly right for a run that predates
62
+ * sealed boxes or for any same-run payload. The structured variants are
63
+ * additive:
64
+ *
65
+ * | Variant | Writes | Reads | Held by |
66
+ * | ------------------ | ------- | -------------- | ------------------------ |
67
+ * | `CryptoKey` | `encr` | `encr` | same-run (legacy shape) |
68
+ * | {@link RunPayloadKeys} | `encr` | `encr`, `encp` | the owning run, o11y |
69
+ * | {@link SealTarget} | `encp` | — | cross-run writers |
70
+ *
71
+ * A run's own payloads deliberately stay symmetric even when the writer could
72
+ * seal: sealing costs a fresh ECDH per envelope and 32 extra bytes, and buys
73
+ * nothing when the writer already holds the decryption key.
74
+ */
75
+ export type PayloadKey = CryptoKey | SealTarget | RunPayloadKeys;
76
+ /**
77
+ * The subset of {@link PayloadKey} that can actually *read* a payload.
78
+ *
79
+ * Excludes {@link SealTarget}, which is write-only by construction: it holds a
80
+ * public key, so it can open neither `encp` (needs the private scalar) nor
81
+ * `encr` (needs the symmetric key). Decrypt-side signatures should take this
82
+ * rather than `PayloadKey`, so passing a seal target is a compile error instead
83
+ * of a guaranteed runtime failure.
84
+ */
85
+ export type DecryptionKey = CryptoKey | RunPayloadKeys;
86
+ /**
87
+ * Build a write-only seal capability for a recipient run's public key.
88
+ *
89
+ * @param recipientPublicKey - The recipient run's raw 32-byte X25519 public key
90
+ * @param aad - Additional authenticated data, conventionally `runAad(projectId, runId)`
91
+ */
92
+ export declare function sealTo(recipientPublicKey: Uint8Array, aad?: Uint8Array): SealTarget;
93
+ /**
94
+ * Bundle a run's symmetric key with the keypair that opens payloads sealed
95
+ * to it.
96
+ */
97
+ export declare function runPayloadKeys(aes: CryptoKey, keyPair: RunKeyPair, aad?: Uint8Array): RunPayloadKeys;
98
+ /**
99
+ * Build the full key capability for a run from its raw 32-byte key material —
100
+ * the value `World.getEncryptionKeyForRun()` returns.
101
+ *
102
+ * Use this anywhere a run reads its own event log: it yields a key that opens
103
+ * both its own symmetric (`encr`) payloads and sealed (`encp`) payloads other
104
+ * runs wrote to it. Resolving only `importKey(material)` would leave the
105
+ * reader unable to open sealed writes.
106
+ */
107
+ export declare function deriveRunPayloadKeys(runKeyMaterial: Uint8Array): Promise<RunPayloadKeys>;
108
+ export declare function isSealTarget(value: unknown): value is SealTarget;
109
+ export declare function isRunPayloadKeys(value: unknown): value is RunPayloadKeys;
110
+ /**
111
+ * The symmetric key to use for `encr` operations, or undefined when this key
112
+ * has no symmetric capability (i.e. it is a seal-only target).
113
+ */
114
+ export declare function aesKeyOf(key: PayloadKey | undefined): CryptoKey | undefined;
9
115
  /**
10
116
  * Encryption key parameter type. Accepts a resolved key, undefined (no encryption),
11
117
  * a promise, or a resolver that can defer fetching the key until data needs it.
12
118
  */
13
- export type EncryptionKeyParam = CryptoKey | undefined | Promise<CryptoKey | undefined> | (() => Promise<CryptoKey | undefined>);
14
- export declare function resolveEncryptionKey(key: EncryptionKeyParam): Promise<CryptoKey | undefined>;
119
+ export type EncryptionKeyParam = PayloadKey | undefined | Promise<PayloadKey | undefined> | (() => Promise<PayloadKey | undefined>);
120
+ export declare function resolveEncryptionKey(key: EncryptionKeyParam): Promise<PayloadKey | undefined>;
15
121
  /**
16
122
  * Encrypt a format-prefixed payload if a key is provided.
17
- * Wraps the data with the 'encr' format prefix.
123
+ *
124
+ * Wraps the data with the `encr` prefix for symmetric keys, or the `encp`
125
+ * prefix when handed a {@link SealTarget} — a cross-run writer that holds only
126
+ * the recipient's public key.
18
127
  *
19
128
  * @param data - The format-prefixed serialized data
20
129
  * @param key - Encryption key (undefined to skip encryption)
21
- * @returns The encrypted data with 'encr' prefix, or the original data if no key
22
- */
23
- export declare function encrypt(data: Uint8Array | unknown, key: CryptoKey | undefined): Promise<Uint8Array | unknown>;
24
- /**
25
- * Decrypt a format-prefixed payload if it's encrypted.
26
- * Strips the 'encr' format prefix and decrypts the inner payload.
27
- *
28
- * @param data - The potentially encrypted data
29
- * @param key - Encryption key (undefined to skip decryption)
30
- * @returns The decrypted inner payload, or the original data if not encrypted
130
+ * @returns The encrypted data with its format prefix, or the original data if no key
31
131
  */
32
- export declare function decrypt(data: Uint8Array | unknown, key: CryptoKey | undefined): Promise<Uint8Array | unknown>;
132
+ export declare function encrypt(data: Uint8Array | unknown, key: PayloadKey | undefined): Promise<Uint8Array | unknown>;
133
+ export declare function decrypt(data: Uint8Array | unknown, key: PayloadKey | undefined): Promise<Uint8Array | unknown>;
33
134
  //# sourceMappingURL=encryption.d.ts.map
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * Step mode serialization.
3
3
  *
4
- * Used by the step handler for serializing step return values and
4
+ * Used by the step executor for serializing step return values and
5
5
  * deserializing step arguments. Supports encryption as a composable layer.
6
6
  */
7
7
  import type { CodecOptions } from './codec.js';
8
- import { type CryptoKey } from './encryption.js';
8
+ import { type PayloadKey } from './encryption.js';
9
9
  /**
10
10
  * Serialize a value from the step execution environment.
11
11
  */
12
- export declare function serialize(value: unknown, encryptionKey?: CryptoKey, options?: CodecOptions): Promise<Uint8Array | unknown>;
12
+ export declare function serialize(value: unknown, encryptionKey?: PayloadKey, options?: CodecOptions): Promise<Uint8Array | unknown>;
13
13
  /**
14
14
  * Deserialize a value for the step execution environment.
15
15
  */
16
- export declare function deserialize(data: Uint8Array | unknown, encryptionKey?: CryptoKey, options?: CodecOptions): Promise<unknown>;
16
+ export declare function deserialize(data: Uint8Array | unknown, encryptionKey?: PayloadKey, options?: CodecOptions): Promise<unknown>;
17
17
  //# sourceMappingURL=step.d.ts.map
@@ -26,6 +26,16 @@ export declare const SerializationFormat: {
26
26
  readonly DEVALUE_V1: FormatPrefix;
27
27
  /** Encrypted payload (inner payload has its own format prefix) */
28
28
  readonly ENCRYPTED: FormatPrefix;
29
+ /**
30
+ * Sealed payload — asymmetrically encrypted to a run's X25519 public key
31
+ * (inner payload has its own format prefix).
32
+ *
33
+ * Used for *cross-run* writes (hook payloads, forwarded stream frames),
34
+ * where the writer holds only the recipient run's public key and therefore
35
+ * cannot decrypt. A run's own payloads continue to use {@link ENCRYPTED}.
36
+ * See `sealed-box.ts` for the construction.
37
+ */
38
+ readonly SEALED: FormatPrefix;
29
39
  /** Gzip-compressed payload (inner payload has its own format prefix) */
30
40
  readonly GZIP: FormatPrefix;
31
41
  /** Zstandard-compressed payload (inner payload has its own format prefix) */
@@ -230,6 +240,16 @@ export interface SerializableSpecial {
230
240
  * the parent's key without fetching the parent run first.
231
241
  */
232
242
  deploymentId?: string;
243
+ /**
244
+ * The owning run's X25519 public key (base64), when it has one.
245
+ *
246
+ * Lets the receiving run seal frames to the stream's owner with no
247
+ * lookup at all — neither a run fetch nor a key-API round trip. The
248
+ * owner derives this locally when it creates the stream, so including
249
+ * it here is free. Absent for runs created by older SDKs, in which
250
+ * case the receiver falls back to resolving the owner's symmetric key.
251
+ */
252
+ encryptionPublicKey?: string;
233
253
  };
234
254
  AbortController: {
235
255
  streamName: string;
@@ -5,11 +5,32 @@
5
5
  * dispatch, and shared types/classes used by all environments (runtime, web
6
6
  * o11y, CLI o11y). It has NO Node.js dependencies.
7
7
  */
8
+ /**
9
+ * Re-exported from the envelope layer so browser consumers (web dashboard,
10
+ * web-shared) can resolve key material without importing
11
+ * `@workflow/core/serialization`, whose module graph reaches Node built-ins
12
+ * (`node:util`, `node:async_hooks`) and cannot be bundled for the browser.
13
+ *
14
+ * Everything below is Web Crypto only: `serialization/encryption.ts`,
15
+ * `encryption.ts` and `sealed-box.ts` are all free of Node dependencies.
16
+ */
17
+ export { type DecryptionKey, decrypt as decryptEnvelope, deriveRunPayloadKeys, encrypt as encryptEnvelope, isRunPayloadKeys, isSealTarget, type PayloadKey, type RunPayloadKeys, runPayloadKeys, type SealTarget, sealTo, } from './serialization/encryption.js';
8
18
  export declare const SerializationFormat: {
9
19
  /** devalue stringify/parse with TextEncoder/TextDecoder */
10
20
  readonly DEVALUE_V1: "devl";
11
21
  /** Encrypted payload (inner payload has its own format prefix after decryption) */
12
22
  readonly ENCRYPTED: "encr";
23
+ /**
24
+ * Sealed payload — asymmetrically encrypted to a run's X25519 public key
25
+ * (inner payload has its own format prefix after opening).
26
+ *
27
+ * Written by cross-run writers that hold only the recipient run's public
28
+ * key. Opening it requires the run's private scalar rather than the
29
+ * symmetric per-run key, so o11y display treats it as ciphertext via
30
+ * {@link isEncryptedData} but {@link hydrateDataWithKey} does not attempt
31
+ * an AES-GCM decrypt on it.
32
+ */
33
+ readonly SEALED: "encp";
13
34
  /** Gzip-compressed payload (inner payload has its own format prefix after decompression) */
14
35
  readonly GZIP: "gzip";
15
36
  /** Zstandard-compressed payload (inner payload has its own format prefix after decompression) */
@@ -42,10 +63,25 @@ export declare const ENCRYPTED_PLACEHOLDER = "\uD83D\uDD12 Encrypted";
42
63
  */
43
64
  export declare function isExpiredStub(data: unknown): boolean;
44
65
  /**
45
- * Check if a binary value has the 'encr' format prefix indicating encryption.
66
+ * Check if a binary value is ciphertext — either a symmetrically encrypted
67
+ * payload ('encr') or a sealed cross-run payload ('encp').
68
+ *
69
+ * This is the predicate display layers want: both schemes are opaque bytes
70
+ * that must not be fed to the devalue parser, and both render as the same
71
+ * "Encrypted" affordance in the CLI and web UI. Use {@link isSealedData} when
72
+ * the *scheme* matters — notably when choosing a decryption path, since a
73
+ * sealed payload needs the run's private scalar rather than its symmetric key.
74
+ *
46
75
  * Browser-safe — does not depend on the full serialization module.
47
76
  */
48
77
  export declare function isEncryptedData(data: unknown): boolean;
78
+ /**
79
+ * Check if a binary value has the 'encp' format prefix, indicating a sealed
80
+ * (asymmetrically encrypted) cross-run payload.
81
+ *
82
+ * Browser-safe — does not depend on the full serialization module.
83
+ */
84
+ export declare function isSealedData(data: unknown): boolean;
49
85
  /**
50
86
  * Check if a binary value has a compression format prefix ('gzip' or 'zstd').
51
87
  * Browser-safe — does not depend on the full serialization module.
@@ -85,11 +121,15 @@ export declare function hydrateData(value: unknown, revivers: Revivers): unknown
85
121
  * decryption. Used by o11y tooling (web UI, CLI) when the user requests
86
122
  * decryption.
87
123
  *
88
- * @param value - The value to hydrate (may be encrypted)
124
+ * @param value - The value to hydrate (may be encrypted or sealed)
89
125
  * @param revivers - Devalue revivers for deserialization
90
- * @param key - AES-256 encryption key (if provided, encrypted data will be decrypted)
126
+ * @param key - The run's key material. Pass `RunPayloadKeys` (from
127
+ * `deriveRunPayloadKeys`) to open both symmetric (`encr`) and sealed
128
+ * (`encp`) payloads; a bare `CryptoKey` opens only the symmetric ones.
129
+ * Typed as a read capability so a write-only seal target — which could open
130
+ * neither scheme — is rejected at compile time rather than failing here.
91
131
  */
92
- export declare function hydrateDataWithKey(value: unknown, revivers: Revivers, key: import('./encryption.js').CryptoKey | undefined): Promise<unknown>;
132
+ export declare function hydrateDataWithKey(value: unknown, revivers: Revivers, key: import('./serialization/encryption.js').DecryptionKey | undefined): Promise<unknown>;
93
133
  /** Marker for stream reference objects rendered as links in the UI */
94
134
  export declare const STREAM_REF_TYPE = "__workflow_stream_ref__";
95
135
  /** A stream reference for UI display */
@@ -1,9 +1,8 @@
1
- import { type CryptoKey } from './encryption.js';
2
1
  import { compress, decompress } from './serialization/compression.js';
3
- import { decrypt, type EncryptionKeyParam, encrypt } from './serialization/encryption.js';
2
+ import { aesKeyOf, decrypt, deriveRunPayloadKeys, type EncryptionKeyParam, encrypt, isRunPayloadKeys, isSealTarget, type PayloadKey, type RunPayloadKeys, runPayloadKeys, type SealTarget, sealTo } from './serialization/encryption.js';
4
3
  import { decodeFormatPrefix, encodeWithFormatPrefix, isEncrypted, peekFormatPrefix } from './serialization/format.js';
5
4
  import { type FormatPrefix, isFormatPrefix, SerializationFormat } from './serialization/types.js';
6
- export { SerializationFormat, type FormatPrefix, isFormatPrefix, encodeWithFormatPrefix, decodeFormatPrefix, peekFormatPrefix, isEncrypted, encrypt, decrypt, compress, decompress, type EncryptionKeyParam, };
5
+ export { SerializationFormat, type FormatPrefix, isFormatPrefix, encodeWithFormatPrefix, decodeFormatPrefix, peekFormatPrefix, isEncrypted, encrypt, decrypt, compress, decompress, type EncryptionKeyParam, type PayloadKey, type RunPayloadKeys, type SealTarget, sealTo, runPayloadKeys, deriveRunPayloadKeys, isSealTarget, isRunPayloadKeys, aesKeyOf, };
7
6
  export type SerializationFormatType = (typeof SerializationFormat)[keyof typeof SerializationFormat];
8
7
  /**
9
8
  * Detect if a readable stream is a byte stream.
@@ -285,6 +284,7 @@ export declare function getCommonRevivers(global?: Record<string, any>): {
285
284
  name: string;
286
285
  runId?: string;
287
286
  deploymentId?: string;
287
+ encryptionPublicKey?: string;
288
288
  }) => any) | undefined;
289
289
  AbortController?: ((value: {
290
290
  streamName: string;
@@ -323,13 +323,13 @@ export declare function getWorkflowRevivers(global?: Record<string, any>): Parti
323
323
  *
324
324
  * @deprecated Use `encrypt` from `./serialization/encryption.js` instead.
325
325
  */
326
- export declare function maybeEncrypt(data: Uint8Array, key: CryptoKey | undefined): Promise<Uint8Array>;
326
+ export declare function maybeEncrypt(data: Uint8Array, key: PayloadKey | undefined): Promise<Uint8Array>;
327
327
  /**
328
328
  * Decrypt data if it has the 'encr' prefix.
329
329
  *
330
330
  * @deprecated Use `decrypt` from `./serialization/encryption.js` instead.
331
331
  */
332
- export declare function maybeDecrypt(data: Uint8Array | unknown, key: CryptoKey | undefined): Promise<Uint8Array | unknown>;
332
+ export declare function maybeDecrypt(data: Uint8Array | unknown, key: PayloadKey | undefined): Promise<Uint8Array | unknown>;
333
333
  /**
334
334
  * Replay hydration has two stages:
335
335
  *
@@ -350,7 +350,7 @@ export interface PreparedReplayPayload {
350
350
  * both direct and promised results lets a future synchronous Node decryptor use
351
351
  * the same cache contract as today's asynchronous Web Crypto implementation.
352
352
  */
353
- export type ReplayPayloadPreparer = (value: unknown, key: CryptoKey | undefined) => PreparedReplayPayload | Promise<PreparedReplayPayload>;
353
+ export type ReplayPayloadPreparer = (value: unknown, key: PayloadKey | undefined) => PreparedReplayPayload | Promise<PreparedReplayPayload>;
354
354
  /**
355
355
  * Decrypt and decompress persisted data without parsing it into JavaScript.
356
356
  * Legacy non-binary values pass through unchanged for their consumer to revive.
@@ -384,34 +384,34 @@ export declare function deserializePreparedStepError(prepared: PreparedReplayPay
384
384
  * backwards compatibility with older runs.
385
385
  * @returns The dehydrated value as binary data (Uint8Array) with format prefix
386
386
  */
387
- export declare function dehydrateWorkflowArguments(value: unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, v1Compat?: boolean, framedByteStreams?: boolean, compression?: boolean): Promise<Uint8Array | unknown>;
387
+ export declare function dehydrateWorkflowArguments(value: unknown, runId: string, key: PayloadKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, v1Compat?: boolean, framedByteStreams?: boolean, compression?: boolean): Promise<Uint8Array | unknown>;
388
388
  /**
389
389
  * Called from workflow execution environment to hydrate the workflow
390
390
  * arguments from the database at the start of workflow execution. A prepared
391
391
  * payload skips host-side decrypt/decompress but always performs VM revival.
392
392
  */
393
- export declare function hydrateWorkflowArguments(value: Uint8Array | unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, prepared?: PreparedReplayPayload): Promise<any>;
393
+ export declare function hydrateWorkflowArguments(value: Uint8Array | unknown, _runId: string, key: PayloadKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, prepared?: PreparedReplayPayload): Promise<any>;
394
394
  /**
395
395
  * Dehydrate workflow return value for storage.
396
396
  */
397
- export declare function dehydrateWorkflowReturnValue(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, v1Compat?: boolean, compression?: boolean): Promise<Uint8Array | unknown>;
397
+ export declare function dehydrateWorkflowReturnValue(value: unknown, _runId: string, key: PayloadKey | undefined, global?: Record<string, any>, v1Compat?: boolean, compression?: boolean): Promise<Uint8Array | unknown>;
398
398
  /**
399
399
  * Called from the client side to hydrate the workflow return value
400
400
  * of a completed workflow run.
401
401
  */
402
- export declare function hydrateWorkflowReturnValue(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
402
+ export declare function hydrateWorkflowReturnValue(value: Uint8Array | unknown, runId: string, key: PayloadKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
403
403
  /**
404
404
  * Called from the workflow handler when a step is being created.
405
405
  * Dehydrates values from within the workflow execution environment.
406
406
  */
407
- export declare function dehydrateStepArguments(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, v1Compat?: boolean, compression?: boolean): Promise<Uint8Array | unknown>;
407
+ export declare function dehydrateStepArguments(value: unknown, _runId: string, key: PayloadKey | undefined, global?: Record<string, any>, v1Compat?: boolean, compression?: boolean): Promise<Uint8Array | unknown>;
408
408
  /**
409
- * Called from the step handler to hydrate the arguments of a step
409
+ * Called from the step executor to hydrate the arguments of a step
410
410
  * from the database at the start of the step execution.
411
411
  */
412
- export declare function hydrateStepArguments(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, deploymentId?: string): Promise<any>;
412
+ export declare function hydrateStepArguments(value: Uint8Array | unknown, runId: string, key: PayloadKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, deploymentId?: string): Promise<any>;
413
413
  /**
414
- * Called from the step handler when a step has completed.
414
+ * Called from the step executor when a step has completed.
415
415
  * Dehydrates values from within the step execution environment
416
416
  * into a format that can be saved to the database.
417
417
  *
@@ -427,9 +427,9 @@ export declare function hydrateStepArguments(value: Uint8Array | unknown, runId:
427
427
  * backwards compatibility with older runs.
428
428
  * @returns The dehydrated value as binary data (Uint8Array) with format prefix
429
429
  */
430
- export declare function dehydrateStepReturnValue(value: unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, v1Compat?: boolean, framedByteStreams?: boolean, compression?: boolean, runReadyBarrier?: Promise<unknown>): Promise<Uint8Array | unknown>;
430
+ export declare function dehydrateStepReturnValue(value: unknown, runId: string, key: PayloadKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, v1Compat?: boolean, framedByteStreams?: boolean, compression?: boolean, runReadyBarrier?: Promise<unknown>): Promise<Uint8Array | unknown>;
431
431
  /**
432
- * Called from the step handler when a step throws. Dehydrates the thrown
432
+ * Called from the step executor when a step throws. Dehydrates the thrown
433
433
  * value from within the step execution environment into a format that can
434
434
  * be saved to the database in a `step_failed` or `step_retrying` event.
435
435
  *
@@ -444,7 +444,7 @@ export declare function dehydrateStepReturnValue(value: unknown, runId: string,
444
444
  * @param global - Global object for serialization context
445
445
  * @returns The dehydrated value as binary data (Uint8Array) with format prefix
446
446
  */
447
- export declare function dehydrateStepError(value: unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, compression?: boolean): Promise<Uint8Array>;
447
+ export declare function dehydrateStepError(value: unknown, runId: string, key: PayloadKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, compression?: boolean): Promise<Uint8Array>;
448
448
  /**
449
449
  * Called from the workflow handler when replaying the event log of a
450
450
  * `step_failed` or `step_retrying` event. Hydrates the thrown value from
@@ -458,7 +458,7 @@ export declare function dehydrateStepError(value: unknown, runId: string, key: C
458
458
  * @param prepared - Optional cached decrypt/decompress result
459
459
  * @returns The hydrated thrown value, ready to reject the step promise
460
460
  */
461
- export declare function hydrateStepError(value: Uint8Array | unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, prepared?: PreparedReplayPayload): Promise<unknown>;
461
+ export declare function hydrateStepError(value: Uint8Array | unknown, _runId: string, key: PayloadKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, prepared?: PreparedReplayPayload): Promise<unknown>;
462
462
  /**
463
463
  * Called from the workflow handler when the workflow itself throws.
464
464
  * Dehydrates the thrown value from within the workflow execution environment
@@ -470,7 +470,7 @@ export declare function hydrateStepError(value: Uint8Array | unknown, _runId: st
470
470
  * @param global - Global object for serialization context
471
471
  * @returns The dehydrated value as binary data (Uint8Array) with format prefix
472
472
  */
473
- export declare function dehydrateRunError(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, compression?: boolean): Promise<Uint8Array>;
473
+ export declare function dehydrateRunError(value: unknown, _runId: string, key: PayloadKey | undefined, global?: Record<string, any>, compression?: boolean): Promise<Uint8Array>;
474
474
  /**
475
475
  * Called from the client side (or observability tools) to hydrate the run
476
476
  * error value of a failed workflow run.
@@ -483,7 +483,7 @@ export declare function dehydrateRunError(value: unknown, _runId: string, key: C
483
483
  * @param extraRevivers - Additional revivers for custom types
484
484
  * @returns The hydrated thrown value, ready to be consumed by the client
485
485
  */
486
- export declare function hydrateRunError(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<unknown>;
486
+ export declare function hydrateRunError(value: Uint8Array | unknown, runId: string, key: PayloadKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<unknown>;
487
487
  /**
488
488
  * Called from the workflow handler when replaying the event log of a `step_completed` event.
489
489
  * Hydrates the return value of a step from the database.
@@ -497,5 +497,5 @@ export declare function hydrateRunError(value: Uint8Array | unknown, runId: stri
497
497
  * Called from the workflow handler when replaying the event log
498
498
  * of a `step_completed` event.
499
499
  */
500
- export declare function hydrateStepReturnValue(value: Uint8Array | unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, prepared?: PreparedReplayPayload): Promise<any>;
500
+ export declare function hydrateStepReturnValue(value: Uint8Array | unknown, _runId: string, key: PayloadKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>, prepared?: PreparedReplayPayload): Promise<any>;
501
501
  //# sourceMappingURL=serialization.d.ts.map