eve 0.48.0 → 0.49.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/CHANGELOG.md +26 -0
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/types.d.ts +10 -0
- package/dist/src/cli/commands/integration-setup.d.ts +1 -0
- package/dist/src/cli/commands/integration-setup.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/registry-declared-setups.d.ts +1 -0
- package/dist/src/cli/commands/registry-declared-setups.js +1 -1
- package/dist/src/cli/commands/registry-metadata.d.ts +30 -0
- package/dist/src/cli/commands/registry-metadata.js +1 -1
- package/dist/src/cli/commands/registry-package.d.ts +6 -0
- package/dist/src/cli/commands/registry-package.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +30 -0
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -0
- package/dist/src/cli/commands/registry-pnpm-build-policy.d.ts +12 -0
- package/dist/src/cli/commands/registry-pnpm-build-policy.js +6 -0
- package/dist/src/cli/commands/registry-recovery.d.ts +4 -0
- package/dist/src/cli/commands/registry-recovery.js +1 -1
- package/dist/src/cli/commands/registry.d.ts +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/compiled/.vendor-stamp.json +7 -7
- package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +2 -4
- package/dist/src/compiled/@workflow/core/capabilities.d.ts +10 -9
- package/dist/src/compiled/@workflow/core/capture-stack.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/class-serialization.d.ts +8 -8
- package/dist/src/compiled/@workflow/core/context-violation-error.d.ts +5 -5
- package/dist/src/compiled/@workflow/core/create-hook.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/describe-error.d.ts +7 -7
- package/dist/src/compiled/@workflow/core/encryption.d.ts +5 -5
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +49 -14
- package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +4 -4
- package/dist/src/compiled/@workflow/core/global.d.ts +4 -2
- package/dist/src/compiled/@workflow/core/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/log-format.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +40 -78
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/replay-payload-cache.d.ts +13 -17
- package/dist/src/compiled/@workflow/core/runtime/compute-instance.d.ts +4 -3
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +27 -27
- package/dist/src/compiled/@workflow/core/runtime/count-step-started-events.d.ts +7 -7
- package/dist/src/compiled/@workflow/core/runtime/deployment-guard.d.ts +7 -7
- package/dist/src/compiled/@workflow/core/runtime/get-port-lazy.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/runtime/get-world-lazy.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +30 -49
- package/dist/src/compiled/@workflow/core/runtime/quickjs-entrypoint.d.ts +21 -10
- package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +31 -15
- package/dist/src/compiled/@workflow/core/runtime/quickjs-serde.d.ts +10 -10
- package/dist/src/compiled/@workflow/core/runtime/replay-budget.d.ts +4 -4
- package/dist/src/compiled/@workflow/core/runtime/replay-recovery-reporter.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +20 -12
- package/dist/src/compiled/@workflow/core/runtime/resume-latency.d.ts +37 -30
- package/dist/src/compiled/@workflow/core/runtime/run-id-time.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/runtime/run.d.ts +22 -5
- package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +4 -4
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +3 -3
- package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +14 -14
- package/dist/src/compiled/@workflow/core/runtime/step-latency.d.ts +42 -25
- package/dist/src/compiled/@workflow/core/runtime/step-ownership.d.ts +6 -6
- package/dist/src/compiled/@workflow/core/runtime/step-single-flight.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +38 -24
- package/dist/src/compiled/@workflow/core/runtime/unserializable-step.d.ts +34 -0
- package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/runtime/wait-continuation.d.ts +31 -9
- package/dist/src/compiled/@workflow/core/runtime/wait-until.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime/world-compatibility.d.ts +20 -9
- package/dist/src/compiled/@workflow/core/runtime/world-init.d.ts +5 -5
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/sealed-box.d.ts +7 -7
- package/dist/src/compiled/@workflow/core/serialization/codec-devalue-vm.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization/codec-devalue.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +4 -4
- package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +12 -11
- package/dist/src/compiled/@workflow/core/serialization/encryption.d.ts +7 -7
- package/dist/src/compiled/@workflow/core/serialization/format.d.ts +6 -6
- package/dist/src/compiled/@workflow/core/serialization/hardened.d.ts +23 -22
- package/dist/src/compiled/@workflow/core/serialization/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization/reducers/class-vm.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization/reducers/step-function-vm.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +5 -5
- package/dist/src/compiled/@workflow/core/serialization/workflow-vm.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization-format.d.ts +11 -11
- package/dist/src/compiled/@workflow/core/serialization.d.ts +18 -19
- package/dist/src/compiled/@workflow/core/source-map.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +5 -5
- package/dist/src/compiled/@workflow/core/step/writable-stream.d.ts +3 -3
- package/dist/src/compiled/@workflow/core/symbols.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +71 -20
- package/dist/src/compiled/@workflow/core/telemetry.d.ts +15 -3
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/vm/script-cache.d.ts +9 -11
- package/dist/src/compiled/@workflow/core/workflow/abort-controller.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/world-init-stub.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +18 -18
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +3 -2
- package/dist/src/compiled/@workflow/world/attributes-validation.d.ts +28 -0
- package/dist/src/compiled/@workflow/world/attributes.d.ts +8 -107
- package/dist/src/compiled/@workflow/world/env-config.d.ts +5 -5
- package/dist/src/compiled/@workflow/world/event-metadata.d.ts +132 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +42 -96
- package/dist/src/compiled/@workflow/world/hooks.d.ts +12 -11
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +94 -39
- package/dist/src/compiled/@workflow/world/queue.d.ts +29 -22
- package/dist/src/compiled/@workflow/world/runs.d.ts +20 -0
- package/dist/src/compiled/@workflow/world/slot-identity.d.ts +3 -3
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +82 -15
- package/dist/src/compiled/@workflow/world/ulid.d.ts +2 -2
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +12 -12
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DXbpwBdw.js → attribute-changes-BwAadFfB.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/debug-log-CVPstO1D.js +1 -0
- package/dist/src/compiled/_chunks/workflow/dist-CgbVZs5l.js +40 -0
- package/dist/src/compiled/_chunks/workflow/dist-DjojkP5e.js +3 -0
- package/dist/src/compiled/_chunks/workflow/frames-CZ9eHShe.js +3 -0
- package/dist/src/compiled/_chunks/workflow/global-singleton-BNinwFrL.js +1 -0
- package/dist/src/compiled/_chunks/workflow/private-CZFMABEf.js +1 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-BToMtPbH.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-DzyAoGh4.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-3_A5uOp-.js +1 -0
- package/dist/src/compiled/_chunks/workflow/undici-DfxNX5og.js +95 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-BtySPYD0.js +15 -0
- package/dist/src/compiled/_chunks/workflow/ws-transport-PnVVxT0R.js +1 -0
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/execution/agent-handle-dispatch.js +1 -1
- package/dist/src/execution/continuation-conflict-step.d.ts +10 -0
- package/dist/src/execution/continuation-conflict-step.js +1 -0
- package/dist/src/execution/delegated-parent-notification.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +7 -29
- package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-start.d.ts +33 -0
- package/dist/src/execution/dispatch-runtime-actions-start.js +1 -0
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/dispatch-turn-step.js +1 -1
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/next-driver-action.d.ts +5 -4
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/runtime-errors.d.ts +0 -12
- package/dist/src/execution/runtime-errors.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/docker-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/eve-image.d.ts +4 -0
- package/dist/src/execution/sandbox/bindings/eve-image.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-create-sdk.js +1 -1
- package/dist/src/execution/session-timeout-steps.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +2 -2
- package/dist/src/execution/subagent-start-local.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -1
- package/dist/src/execution/tasks/parent/run-parent.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tool-run/start.js +1 -1
- package/dist/src/execution/tools/subagent/local.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-entry.d.ts +5 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +12 -12
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/public/channels/slack/activity.d.ts +18 -0
- package/dist/src/public/channels/slack/activity.js +1 -0
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -0
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/interaction-cards.js +1 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +12 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/memory/file/backends/default.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +5 -4
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +3 -1
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/integrations/file-memory/setup.d.ts +15 -0
- package/dist/src/setup/integrations/file-memory/setup.js +2 -0
- package/dist/src/setup/integrations/file-memory/vercel.d.ts +103 -0
- package/dist/src/setup/integrations/file-memory/vercel.js +1 -0
- package/dist/src/setup/integrations/registry.js +1 -1
- package/dist/src/setup/integrations/shared/vercel-project.js +1 -1
- package/dist/src/setup/scaffold/connections/catalog.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/docs/channels/custom.mdx +4 -0
- package/docs/channels/eve.mdx +12 -8
- package/docs/channels/mcp.mdx +4 -1
- package/docs/channels/slack.mdx +1 -1
- package/docs/guides/instrumentation.md +1 -1
- package/docs/install-integrations.mdx +5 -0
- package/docs/instructions.mdx +1 -1
- package/docs/memory/custom-provider.md +214 -0
- package/docs/memory/file.md +168 -0
- package/docs/memory/meta.json +5 -0
- package/docs/memory/overview.mdx +282 -0
- package/docs/patterns/multi-tenant-memory.md +12 -20
- package/docs/reference/cli.md +28 -23
- package/docs/sandbox.mdx +5 -3
- package/package.json +8 -8
- package/dist/src/compiled/_chunks/workflow/dist-CqvWKNQv.js +0 -3
- package/dist/src/compiled/_chunks/workflow/dist-Dk0aQqFO.js +0 -40
- package/dist/src/compiled/_chunks/workflow/dist-DpYyXbJv.js +0 -1
- package/dist/src/compiled/_chunks/workflow/env-config-L94XftKz.js +0 -1
- package/dist/src/compiled/_chunks/workflow/frames-Dl2Hcma4.js +0 -3
- package/dist/src/compiled/_chunks/workflow/private-CuQ4HTFC.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-E-Nkx8q_.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-cIeex2KF.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-CxFsdxB_.js +0 -1
- package/dist/src/compiled/_chunks/workflow/spec-version-DBUVfF_R.js +0 -1
- package/dist/src/compiled/_chunks/workflow/undici-DznrXKcM.js +0 -95
- package/dist/src/compiled/_chunks/workflow/wait-until-BZHmJCAW.js +0 -15
- package/dist/src/compiled/_chunks/workflow/ws-transport-Ct6yyRWZ.js +0 -1
- package/docs/memory.md +0 -408
|
@@ -3,7 +3,7 @@ import { type CryptoKey } from './encryption.js';
|
|
|
3
3
|
* A per-run X25519 keypair, derived from the run's key material.
|
|
4
4
|
*
|
|
5
5
|
* Callers should derive this once per run and memoize it alongside the
|
|
6
|
-
* symmetric key
|
|
6
|
+
* symmetric key, since derivation costs several Web Crypto round trips.
|
|
7
7
|
*/
|
|
8
8
|
export interface RunKeyPair {
|
|
9
9
|
/** Raw 32-byte X25519 private scalar. Secret. */
|
|
@@ -41,7 +41,7 @@ export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
|
41
41
|
* symmetric path) rather than crash a resumption.
|
|
42
42
|
*
|
|
43
43
|
* Validation is strict, because a lenient decoder is worse than a throwing one
|
|
44
|
-
* here
|
|
44
|
+
* here: silently returning a short or truncated key makes a corrupt value look
|
|
45
45
|
* *present*, so the caller seals to garbage instead of taking the fallback.
|
|
46
46
|
* Rejected: characters outside the alphabet, a length that cannot describe a
|
|
47
47
|
* whole number of bytes (`length % 4 === 1`), padding anywhere but the end, and
|
|
@@ -52,7 +52,7 @@ export declare function base64ToBytes(value: string): Uint8Array | undefined;
|
|
|
52
52
|
* The writer half of the KEM: generate an ephemeral keypair and derive a
|
|
53
53
|
* content key for a recipient's public key.
|
|
54
54
|
*
|
|
55
|
-
* Use this when many payloads share one KEM operation
|
|
55
|
+
* Use this when many payloads share one KEM operation, i.e. stream frames.
|
|
56
56
|
* The returned `contentKey` can only encrypt, so a stream writer provably
|
|
57
57
|
* cannot read the recipient run's data even by mistake.
|
|
58
58
|
*
|
|
@@ -83,7 +83,7 @@ export declare function decapsulate(keyPair: RunKeyPair, ephemeralPublicKey: Uin
|
|
|
83
83
|
* Seal a payload to a run's public key.
|
|
84
84
|
*
|
|
85
85
|
* Each call performs its own KEM operation, so every sealed payload gets an
|
|
86
|
-
* independent content key
|
|
86
|
+
* independent content key: nonce reuse across calls is impossible by
|
|
87
87
|
* construction.
|
|
88
88
|
*
|
|
89
89
|
* @param recipientPublicKey - The recipient run's raw 32-byte X25519 public key
|
|
@@ -105,7 +105,7 @@ export declare function seal(recipientPublicKey: Uint8Array, data: Uint8Array, a
|
|
|
105
105
|
export declare function open(keyPair: RunKeyPair, sealed: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
106
106
|
/**
|
|
107
107
|
* A writer-side session that amortizes one KEM operation across many sealed
|
|
108
|
-
* payloads
|
|
108
|
+
* payloads. Use it for streams, where one-shot {@link seal} would perform a
|
|
109
109
|
* fresh keygen + ECDH + HKDF for every frame.
|
|
110
110
|
*
|
|
111
111
|
* Safety rests on two properties:
|
|
@@ -129,7 +129,7 @@ export declare function createSealSession(recipientPublicKey: Uint8Array, aad?:
|
|
|
129
129
|
* The mirror of {@link createSealSession}: because every frame from one writer
|
|
130
130
|
* carries the same ephemeral public key, this turns an ECDH per frame into an
|
|
131
131
|
* ECDH per writer. Correctness does not depend on the writer having used a
|
|
132
|
-
* session
|
|
132
|
+
* session: a stream of independently sealed payloads misses the cache
|
|
133
133
|
* on each new ephemeral key.
|
|
134
134
|
*
|
|
135
135
|
* The cache is keyed by the ephemeral public key and holds one entry, which is
|
|
@@ -151,7 +151,7 @@ export declare function createOpenSession(keyPair: RunKeyPair, aad?: Uint8Array)
|
|
|
151
151
|
* `ephemeralPublicKey ‖ recipientPublicKey`, and a recipient public key is
|
|
152
152
|
* unique per (deployment key × project × run). Replaying a sealed payload at
|
|
153
153
|
* a different run therefore fails at key agreement regardless. AAD is
|
|
154
|
-
* available for callers that want an additional, KDF-independent binding
|
|
154
|
+
* available for callers that want an additional, KDF-independent binding:
|
|
155
155
|
* both sides must supply byte-identical values or the payload will not open.
|
|
156
156
|
*/
|
|
157
157
|
export declare function runAad(projectId: string, runId: string): Uint8Array;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Codec } from './codec.js';
|
|
8
8
|
/**
|
|
9
|
-
* The workflow-mode reducer/reviver key sets
|
|
9
|
+
* The workflow-mode reducer/reviver key sets, exported for the QuickJS
|
|
10
10
|
* host serde's exhaustiveness test (quickjs-serde.test.ts), which pins
|
|
11
11
|
* that the handle-space codec implements exactly these.
|
|
12
12
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* reducers (serialize) and revivers (deserialize) which are composed
|
|
6
6
|
* internally based on the serialization mode.
|
|
7
7
|
*
|
|
8
|
-
* The reducer/reviver pattern is specific to devalue
|
|
8
|
+
* The reducer/reviver pattern is specific to devalue: other codecs
|
|
9
9
|
* (CBOR, JSON) would handle types differently (e.g. CBOR supports Date,
|
|
10
10
|
* typed arrays, Map, Set natively).
|
|
11
11
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A codec handles the core serialize/deserialize logic for a specific
|
|
5
5
|
* wire format (devalue, CBOR, JSON, etc.). Each codec is responsible
|
|
6
|
-
* for handling all supported data types internally
|
|
6
|
+
* for handling all supported data types internally; the caller only
|
|
7
7
|
* specifies which serialization mode to use.
|
|
8
8
|
*
|
|
9
9
|
* - **devalue**: Uses custom reducers/revivers for Date, Error, Map, Set,
|
|
@@ -70,15 +70,15 @@ export interface CodecOptions {
|
|
|
70
70
|
compressionStats?: CompressionStats;
|
|
71
71
|
/**
|
|
72
72
|
* Optional sink populated by the hardened serializer with every
|
|
73
|
-
* workflow (guest) code execution that serialization could not avoid
|
|
73
|
+
* workflow (guest) code execution that serialization could not avoid:
|
|
74
74
|
* getters, proxies, and custom `[WORKFLOW_SERIALIZE]` methods. A non-empty
|
|
75
75
|
* `executions` array means serialization may have perturbed VM state
|
|
76
76
|
* (it runs exactly once per payload and is never replayed, so any side
|
|
77
77
|
* effect it triggers diverges from replay).
|
|
78
78
|
*
|
|
79
79
|
* Every dehydrate path already reports this as span attributes. Passing a
|
|
80
|
-
* sink is for callers that need the executions *programmatically
|
|
81
|
-
* retained-VM gate deciding whether the VM is still reusable. No caller
|
|
80
|
+
* sink is for callers that need the executions *programmatically*, such
|
|
81
|
+
* as a retained-VM gate deciding whether the VM is still reusable. No caller
|
|
82
82
|
* does that yet, so nothing in the runtime currently passes one.
|
|
83
83
|
*
|
|
84
84
|
* Serialize side only.
|
|
@@ -5,22 +5,23 @@
|
|
|
5
5
|
* format prefix system to mark compressed data (e.g. 'zstd' or 'gzip'
|
|
6
6
|
* wrapping the inner format: 'zstd' + zstd('devl' + payload)).
|
|
7
7
|
*
|
|
8
|
-
* Codec selection (write side): zstd is preferred
|
|
9
|
-
* than gzip at a comparable-or-better ratio (see scripts/README.md),
|
|
10
|
-
* compression runs at every step boundary so the write CPU is a
|
|
11
|
-
* tax. zstd requires `node:zlib` >= 22.15 (Web
|
|
12
|
-
* zstd), so on a runtime without it we fall back
|
|
8
|
+
* Codec selection (write side): zstd is preferred because it is markedly
|
|
9
|
+
* faster than gzip at a comparable-or-better ratio (see scripts/README.md),
|
|
10
|
+
* and compression runs at every step boundary so the write CPU is a
|
|
11
|
+
* per-step tax. zstd requires `node:zlib` >= 22.15 (Web
|
|
12
|
+
* `CompressionStream` has no zstd), so on a runtime without it we fall back
|
|
13
|
+
* to gzip via the portable
|
|
13
14
|
* `CompressionStream`. `WORKFLOW_COMPRESSION_CODEC=gzip` forces the
|
|
14
15
|
* portable codec.
|
|
15
16
|
*
|
|
16
17
|
* Read side: dispatch on the format prefix, so both 'zstd' and 'gzip'
|
|
17
18
|
* payloads are always decodable regardless of which codec wrote them.
|
|
18
|
-
* (The browser o11y read path decodes zstd via a registered WASM decoder
|
|
19
|
+
* (The browser o11y read path decodes zstd via a registered WASM decoder,
|
|
19
20
|
* see `serialization-format.ts`; this module's `decompress` is the Node
|
|
20
21
|
* runtime/replay path and uses `node:zlib`.)
|
|
21
22
|
*
|
|
22
23
|
* Layering order with encryption: compression is applied BEFORE
|
|
23
|
-
* encryption (encr(zstd(devl)))
|
|
24
|
+
* encryption (encr(zstd(devl))): encrypted bytes are high-entropy and
|
|
24
25
|
* do not compress, so the reverse order would be a no-op.
|
|
25
26
|
*
|
|
26
27
|
* Compression is conditional:
|
|
@@ -50,8 +51,8 @@ export type CompressionCodec = 'zstd' | 'gzip' | 'none';
|
|
|
50
51
|
* Telemetry sink describing what the compression layer did to a payload.
|
|
51
52
|
* Populated by {@link compress} (write) and {@link decompress} (read) when
|
|
52
53
|
* a `stats` object is passed. Sizes are measured at the compression
|
|
53
|
-
* boundary
|
|
54
|
-
* decryption on the read side
|
|
54
|
+
* boundary (i.e. before encryption is layered on the write side and after
|
|
55
|
+
* decryption on the read side), so they reflect compression's effect, not
|
|
55
56
|
* the at-rest size (which also includes the `encr` envelope and, on some
|
|
56
57
|
* backends, base64 expansion).
|
|
57
58
|
*
|
|
@@ -80,8 +81,8 @@ export interface CompressionStats {
|
|
|
80
81
|
* @param data - The format-prefixed serialized data (e.g. 'devl' + bytes)
|
|
81
82
|
* @param enabled - Whether the target run supports compressed payloads
|
|
82
83
|
* (run specVersion >= SPEC_VERSION_SUPPORTS_COMPRESSION, and for
|
|
83
|
-
* cross-deployment writes, the target deployment's capabilities
|
|
84
|
-
*
|
|
84
|
+
* cross-deployment writes, the target deployment's capabilities; see
|
|
85
|
+
* `getRunCapabilities` in capabilities.ts). zstd and gzip read
|
|
85
86
|
* support co-ship, so a single boolean is sufficient.
|
|
86
87
|
* @param stats - Optional telemetry sink; populated when `data` is binary.
|
|
87
88
|
* @returns The compressed data with a codec prefix, or the original data
|
|
@@ -21,7 +21,7 @@ declare const RUN_KEYS_BRAND: unique symbol;
|
|
|
21
21
|
/**
|
|
22
22
|
* A write-only capability: seal payloads to a run's X25519 public key.
|
|
23
23
|
*
|
|
24
|
-
* This is what a *cross-run* writer holds
|
|
24
|
+
* This is what a *cross-run* writer holds: a hook resumption targeting
|
|
25
25
|
* another run, or a child workflow writing into a parent's forwarded stream.
|
|
26
26
|
* It carries no ability to decrypt anything, and because it is a distinct
|
|
27
27
|
* nominal type it cannot be mistaken for symmetric key material.
|
|
@@ -47,9 +47,9 @@ export interface SealTarget {
|
|
|
47
47
|
*/
|
|
48
48
|
export interface RunPayloadKeys {
|
|
49
49
|
readonly [RUN_KEYS_BRAND]: true;
|
|
50
|
-
/** Symmetric AES-256-GCM key
|
|
50
|
+
/** Symmetric AES-256-GCM key: the run's own `encr` payloads. */
|
|
51
51
|
readonly aes: CryptoKey;
|
|
52
|
-
/** X25519 keypair
|
|
52
|
+
/** X25519 keypair: opens `encp` payloads sealed to this run. */
|
|
53
53
|
readonly keyPair: RunKeyPair;
|
|
54
54
|
/** Additional authenticated data expected on sealed payloads. */
|
|
55
55
|
readonly aad?: Uint8Array;
|
|
@@ -66,7 +66,7 @@ export interface RunPayloadKeys {
|
|
|
66
66
|
* | ------------------ | ------- | -------------- | ------------------------ |
|
|
67
67
|
* | `CryptoKey` | `encr` | `encr` | same-run (legacy shape) |
|
|
68
68
|
* | {@link RunPayloadKeys} | `encr` | `encr`, `encp` | the owning run, o11y |
|
|
69
|
-
* | {@link SealTarget} | `encp` |
|
|
69
|
+
* | {@link SealTarget} | `encp` | (none) | cross-run writers |
|
|
70
70
|
*
|
|
71
71
|
* A run's own payloads deliberately stay symmetric even when the writer could
|
|
72
72
|
* seal: sealing costs a fresh ECDH per envelope and 32 extra bytes, and buys
|
|
@@ -96,7 +96,7 @@ export declare function sealTo(recipientPublicKey: Uint8Array, aad?: Uint8Array)
|
|
|
96
96
|
*/
|
|
97
97
|
export declare function runPayloadKeys(aes: CryptoKey, keyPair: RunKeyPair, aad?: Uint8Array): RunPayloadKeys;
|
|
98
98
|
/**
|
|
99
|
-
* Build the full key capability for a run from its raw 32-byte key material
|
|
99
|
+
* Build the full key capability for a run from its raw 32-byte key material,
|
|
100
100
|
* the value `World.getEncryptionKeyForRun()` returns.
|
|
101
101
|
*
|
|
102
102
|
* Use this anywhere a run reads its own event log: it yields a key that opens
|
|
@@ -122,8 +122,8 @@ export declare function resolveEncryptionKey(key: EncryptionKeyParam): Promise<P
|
|
|
122
122
|
* Encrypt a format-prefixed payload if a key is provided.
|
|
123
123
|
*
|
|
124
124
|
* Wraps the data with the `encr` prefix for symmetric keys, or the `encp`
|
|
125
|
-
* prefix when handed a {@link SealTarget}
|
|
126
|
-
* the recipient's public key.
|
|
125
|
+
* prefix when handed a {@link SealTarget}, a cross-run writer that holds
|
|
126
|
+
* only the recipient's public key.
|
|
127
127
|
*
|
|
128
128
|
* @param data - The format-prefixed serialized data
|
|
129
129
|
* @param key - Encryption key (undefined to skip encryption)
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* All serialized payloads are prefixed with a 4-byte format identifier that
|
|
5
5
|
* allows the deserializer to determine how to decode the payload. This enables:
|
|
6
6
|
*
|
|
7
|
-
* 1. Self-describing payloads
|
|
8
|
-
* 2. Gradual migration
|
|
9
|
-
* 3. Composability
|
|
10
|
-
* 4. Debugging
|
|
7
|
+
* 1. Self-describing payloads: the World layer is agnostic to serialization format
|
|
8
|
+
* 2. Gradual migration: old runs keep working, new runs can use new formats
|
|
9
|
+
* 3. Composability: encryption can wrap any format ("encr" wrapping "devl")
|
|
10
|
+
* 4. Debugging: raw data inspection immediately reveals the format
|
|
11
11
|
*
|
|
12
12
|
* Format: [4 bytes: format identifier][payload]
|
|
13
13
|
*
|
|
14
|
-
* The format prefix is open-ended
|
|
14
|
+
* The format prefix is open-ended: any 4-character [a-z0-9] string is valid.
|
|
15
15
|
* This allows new codecs to be added without modifying this module.
|
|
16
16
|
*/
|
|
17
17
|
import { type FormatPrefix } from './types.js';
|
|
@@ -43,7 +43,7 @@ export declare function isEncrypted(data: Uint8Array | unknown): boolean;
|
|
|
43
43
|
*
|
|
44
44
|
* Unlike the legacy implementation which only accepted known formats
|
|
45
45
|
* (`devl`, `encr`), this function accepts any valid format prefix
|
|
46
|
-
* (`[a-z0-9]{4}`). This is intentional for forward compatibility
|
|
46
|
+
* (`[a-z0-9]{4}`). This is intentional for forward compatibility, so
|
|
47
47
|
* new codecs (e.g. `cbor`) can be added without modifying this module.
|
|
48
48
|
* Callers are responsible for checking whether they support the returned
|
|
49
49
|
* format and throwing an appropriate error if not (e.g. "Unsupported
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* workflow VM (`node:vm`) sandbox realm.
|
|
4
4
|
*
|
|
5
5
|
* Serialization runs on the host, but the values it inspects were
|
|
6
|
-
* constructed by workflow code
|
|
6
|
+
* constructed by workflow code, so a naive dynamic operation like
|
|
7
7
|
* `value.toISOString()`, `Array.from(map)`, or `Object.prototype.toString`
|
|
8
8
|
* dispatches into the sandbox realm and executes workflow code (patched
|
|
9
9
|
* prototype methods, getters, proxy traps, `Symbol.toStringTag` accessors).
|
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
* it, and *observable* where it does not:
|
|
16
16
|
*
|
|
17
17
|
* - **Classification** uses engine-level brand checks (`node:util` `types`,
|
|
18
|
-
* internal-slot probes) instead of `instanceof` / `Object.prototype.toString
|
|
19
|
-
*
|
|
20
|
-
* globals.
|
|
18
|
+
* internal-slot probes) instead of `instanceof` / `Object.prototype.toString`,
|
|
19
|
+
* which makes it immune to `Symbol.hasInstance`, `Symbol.toStringTag`, and
|
|
20
|
+
* reassigned globals.
|
|
21
21
|
* - **Extraction** goes through intrinsics captured at module load (host
|
|
22
22
|
* boot, before any workflow code runs). Internal slots are realm-agnostic,
|
|
23
23
|
* so host intrinsics read VM-realm objects without touching the sandbox's
|
|
24
24
|
* (patchable) prototypes.
|
|
25
25
|
* - **Property access** reads through descriptors, so plain data never
|
|
26
26
|
* invokes anything. Where workflow code *must* run because the data itself
|
|
27
|
-
* lives behind it
|
|
28
|
-
* methods, `toString()` on toStringTag-branded objects
|
|
29
|
-
* polyfills)
|
|
27
|
+
* lives behind it (getters, proxies, custom `[WORKFLOW_SERIALIZE]`
|
|
28
|
+
* methods, `toString()` on toStringTag-branded objects such as Temporal
|
|
29
|
+
* polyfills), the execution is preserved for compatibility and recorded
|
|
30
30
|
* in the active {@link GuestCodeStats} sink, so callers (e.g. a retained-VM
|
|
31
31
|
* gate) can react.
|
|
32
32
|
*
|
|
33
33
|
* **Recording is not prevention.** For the recorded cases the determinism
|
|
34
34
|
* hazard is still live: a getter that calls `Math.random()` advances the
|
|
35
35
|
* run's seeded PRNG during serialization, and because serialization happens
|
|
36
|
-
* exactly once and is never replayed, every subsequent draw
|
|
37
|
-
* correlation ids derived from that stream
|
|
36
|
+
* exactly once and is never replayed, every subsequent draw (including the
|
|
37
|
+
* correlation ids derived from that stream) shifts relative to replay. The
|
|
38
38
|
* report is the only trace of that; acting on it (warning, demoting a
|
|
39
39
|
* retained VM to replay) is left to the caller.
|
|
40
40
|
*
|
|
@@ -54,8 +54,8 @@ export interface GuestCodeExecution {
|
|
|
54
54
|
* implies a **shape change**: brand checks answer "not that type" for a
|
|
55
55
|
* proxy, so a proxied `Map` serializes as a plain object rather than as a
|
|
56
56
|
* `Map`, and this report is the only evidence of it. (Such values were
|
|
57
|
-
* never serializable before
|
|
58
|
-
* implementation threw on them
|
|
57
|
+
* never serializable before, since the internal-slot reads in the previous
|
|
58
|
+
* implementation threw on them, so the shape change replaces a crash,
|
|
59
59
|
* but it is silent.)
|
|
60
60
|
* - `method`: a workflow-defined function was invoked (e.g. a custom
|
|
61
61
|
* `[WORKFLOW_SERIALIZE]` serializer, `toString()` on a
|
|
@@ -67,14 +67,15 @@ export interface GuestCodeExecution {
|
|
|
67
67
|
detail?: string;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Mutable sink recording
|
|
71
|
-
*
|
|
72
|
-
* the
|
|
73
|
-
* that the VM state may have been perturbed by serialization.
|
|
70
|
+
* Mutable sink recording workflow-code execution serialization could not
|
|
71
|
+
* avoid. `executions` contains the first five samples and `totalExecutions`
|
|
72
|
+
* is the exact count.
|
|
74
73
|
*/
|
|
75
74
|
export interface GuestCodeStats {
|
|
76
75
|
executions: GuestCodeExecution[];
|
|
76
|
+
totalExecutions?: number;
|
|
77
77
|
}
|
|
78
|
+
export declare const GUEST_CODE_EXECUTION_SAMPLE_LIMIT = 5;
|
|
78
79
|
/**
|
|
79
80
|
* Runs `fn` (synchronously) with `stats` as the active guest-code sink.
|
|
80
81
|
* Nested calls stack correctly; a `null`/`undefined` sink disables
|
|
@@ -114,35 +115,35 @@ export declare function hasProperty(value: unknown, key: PropertyKey): boolean;
|
|
|
114
115
|
* `value instanceof C` semantics for a known `C.prototype`, without
|
|
115
116
|
* consulting `Symbol.hasInstance` (which workflow code can define). Used
|
|
116
117
|
* for host classes that are injected into the sandbox (Headers, URL,
|
|
117
|
-
* URLSearchParams, DOMException), where the instances
|
|
118
|
-
* host handed the class to
|
|
118
|
+
* URLSearchParams, DOMException), where the instances (from any realm the
|
|
119
|
+
* host handed the class to) carry the host prototype in their chain.
|
|
119
120
|
*
|
|
120
121
|
* Proxies are walked rather than rejected: `Reflect.getPrototypeOf` fires
|
|
121
122
|
* the proxy's `getPrototypeOf` trap, matching `instanceof` semantics, and
|
|
122
|
-
* real values depend on that
|
|
123
|
+
* real values depend on that: Next.js hands the runtime a proxied
|
|
123
124
|
* `NextRequest`, and answering "not a Request" for it would silently break
|
|
124
125
|
* webhooks. The traps are guest-observable, so the proxy is recorded.
|
|
125
126
|
*/
|
|
126
127
|
export declare function isInstanceOfPrototype(value: unknown, prototype: object | undefined): boolean;
|
|
127
128
|
/** `URL.prototype.href` getter. */
|
|
128
129
|
export declare function urlHref(value: URL): string;
|
|
129
|
-
/** `URLSearchParams.prototype.toString
|
|
130
|
+
/** `URLSearchParams.prototype.toString`: returns `''` iff empty. */
|
|
130
131
|
export declare function urlSearchParamsToString(value: URLSearchParams): string;
|
|
131
132
|
/**
|
|
132
133
|
* Iterates a Headers instance through the captured host iterator, so the
|
|
133
|
-
* iterator object
|
|
134
|
+
* iterator object, and its `next`, are host-realm.
|
|
134
135
|
*/
|
|
135
136
|
export declare function headersToEntries(value: Headers): [string, string][];
|
|
136
137
|
/**
|
|
137
138
|
* Iterates a genuine Map's entries entirely through host intrinsics: the
|
|
138
139
|
* iterator object is created by the host `Map.prototype.entries`, so its
|
|
139
|
-
* realm
|
|
140
|
+
* realm, and therefore its `next`, is the host's, not the sandbox's.
|
|
140
141
|
*/
|
|
141
142
|
export declare function mapToEntries(value: Map<unknown, unknown>): [unknown, unknown][];
|
|
142
143
|
/** See {@link mapToEntries}. */
|
|
143
144
|
export declare function setToValues(value: Set<unknown>): unknown[];
|
|
144
145
|
/**
|
|
145
|
-
* The bytes of an `ArrayBufferView`, read via internal-slot getters
|
|
146
|
+
* The bytes of an `ArrayBufferView`, read via internal-slot getters, so
|
|
146
147
|
* own-property shadowing and prototype patches cannot change which bytes
|
|
147
148
|
* are serialized.
|
|
148
149
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* VM-compatible copy: identical semantics to class.ts before the host-side
|
|
3
3
|
* hardening (#3257) made that module depend on `serialization/hardened.ts`
|
|
4
|
-
* (which imports `node:util` and captures host intrinsics
|
|
4
|
+
* (which imports `node:util` and captures host intrinsics, meaningless
|
|
5
5
|
* and unbundleable inside the QuickJS VM, where the codec already runs in
|
|
6
6
|
* the guest realm). The host/guest boundary hardening for the QuickJS
|
|
7
7
|
* engine lands with the host-side serde (#3263), which retires this
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* VM-compatible copy: identical semantics to step-function.ts before the host-side
|
|
3
3
|
* hardening (#3257) made that module depend on `serialization/hardened.ts`
|
|
4
|
-
* (which imports `node:util` and captures host intrinsics
|
|
4
|
+
* (which imports `node:util` and captures host intrinsics, meaningless
|
|
5
5
|
* and unbundleable inside the QuickJS VM, where the codec already runs in
|
|
6
6
|
* the guest realm). The host/guest boundary hardening for the QuickJS
|
|
7
7
|
* engine lands with the host-side serde (#3263), which retires this
|
|
@@ -5,7 +5,7 @@ import type { RuntimeDecryptionErrorContext } from '#compiled/@workflow/errors/i
|
|
|
5
5
|
/**
|
|
6
6
|
* A format prefix is exactly 4 lowercase alphanumeric characters [a-z0-9].
|
|
7
7
|
*
|
|
8
|
-
* This is a branded string type
|
|
8
|
+
* This is a branded string type: use `isFormatPrefix()` to validate
|
|
9
9
|
* at runtime. The `SerializationFormat` object provides well-known
|
|
10
10
|
* constants, but codecs may define additional prefixes.
|
|
11
11
|
*/
|
|
@@ -27,7 +27,7 @@ export declare const SerializationFormat: {
|
|
|
27
27
|
/** Encrypted payload (inner payload has its own format prefix) */
|
|
28
28
|
readonly ENCRYPTED: FormatPrefix;
|
|
29
29
|
/**
|
|
30
|
-
* Sealed payload
|
|
30
|
+
* Sealed payload: asymmetrically encrypted to a run's X25519 public key
|
|
31
31
|
* (inner payload has its own format prefix).
|
|
32
32
|
*
|
|
33
33
|
* Used for *cross-run* writes (hook payloads, forwarded stream frames),
|
|
@@ -46,7 +46,7 @@ export declare const SerializationFormat: {
|
|
|
46
46
|
* `ReadableStream` ref's `framing` field.
|
|
47
47
|
*
|
|
48
48
|
* - absent / `'raw'`: chunks are written to the transport verbatim
|
|
49
|
-
* (legacy format
|
|
49
|
+
* (legacy format, no auto-reconnect support).
|
|
50
50
|
* - `'framed-v1'`: each chunk is wrapped in a 4-byte big-endian length
|
|
51
51
|
* prefix, allowing the reader to identify chunk boundaries and
|
|
52
52
|
* transparently reconnect on transient stream errors.
|
|
@@ -114,7 +114,7 @@ export interface SerializableSpecial {
|
|
|
114
114
|
*
|
|
115
115
|
* Only meaningful when `type === 'bytes'`. Absent on object streams
|
|
116
116
|
* (which always use length-prefixed devalue framing) and on legacy
|
|
117
|
-
* byte streams written by SDKs that predate framing support
|
|
117
|
+
* byte streams written by SDKs that predate framing support; those
|
|
118
118
|
* are interpreted as `'raw'` by the consumer.
|
|
119
119
|
*/
|
|
120
120
|
framing?: ByteStreamFraming;
|
|
@@ -244,7 +244,7 @@ export interface SerializableSpecial {
|
|
|
244
244
|
* The owning run's X25519 public key (base64), when it has one.
|
|
245
245
|
*
|
|
246
246
|
* Lets the receiving run seal frames to the stream's owner with no
|
|
247
|
-
* lookup at all
|
|
247
|
+
* lookup at all: neither a run fetch nor a key-API round trip. The
|
|
248
248
|
* owner derives this locally when it creates the stream, so including
|
|
249
249
|
* it here is free. Absent for runs created by older SDKs, in which
|
|
250
250
|
* case the receiver falls back to resolving the owner's symmetric key.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* node:util), which is also what made it bundleable into the VM before the
|
|
10
10
|
* serde moved host-side.
|
|
11
11
|
*
|
|
12
|
-
* Produces and consumes the same wire format as the Node.js workflow.ts
|
|
12
|
+
* Produces and consumes the same wire format as the Node.js workflow.ts:
|
|
13
13
|
* format-prefixed devalue data ("devl" + devalue.stringify output).
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
@@ -21,7 +21,7 @@ export declare const SerializationFormat: {
|
|
|
21
21
|
/** Encrypted payload (inner payload has its own format prefix after decryption) */
|
|
22
22
|
readonly ENCRYPTED: "encr";
|
|
23
23
|
/**
|
|
24
|
-
* Sealed payload
|
|
24
|
+
* Sealed payload: asymmetrically encrypted to a run's X25519 public key
|
|
25
25
|
* (inner payload has its own format prefix after opening).
|
|
26
26
|
*
|
|
27
27
|
* Written by cross-run writers that hold only the recipient run's public
|
|
@@ -63,28 +63,28 @@ export declare const ENCRYPTED_PLACEHOLDER = "\uD83D\uDD12 Encrypted";
|
|
|
63
63
|
*/
|
|
64
64
|
export declare function isExpiredStub(data: unknown): boolean;
|
|
65
65
|
/**
|
|
66
|
-
* Check if a binary value is ciphertext
|
|
66
|
+
* Check if a binary value is ciphertext: either a symmetrically encrypted
|
|
67
67
|
* payload ('encr') or a sealed cross-run payload ('encp').
|
|
68
68
|
*
|
|
69
69
|
* This is the predicate display layers want: both schemes are opaque bytes
|
|
70
70
|
* that must not be fed to the devalue parser, and both render as the same
|
|
71
71
|
* "Encrypted" affordance in the CLI and web UI. Use {@link isSealedData} when
|
|
72
|
-
* the *scheme* matters
|
|
72
|
+
* the *scheme* matters, notably when choosing a decryption path, since a
|
|
73
73
|
* sealed payload needs the run's private scalar rather than its symmetric key.
|
|
74
74
|
*
|
|
75
|
-
* Browser-safe
|
|
75
|
+
* Browser-safe: does not depend on the full serialization module.
|
|
76
76
|
*/
|
|
77
77
|
export declare function isEncryptedData(data: unknown): boolean;
|
|
78
78
|
/**
|
|
79
79
|
* Check if a binary value has the 'encp' format prefix, indicating a sealed
|
|
80
80
|
* (asymmetrically encrypted) cross-run payload.
|
|
81
81
|
*
|
|
82
|
-
* Browser-safe
|
|
82
|
+
* Browser-safe: does not depend on the full serialization module.
|
|
83
83
|
*/
|
|
84
84
|
export declare function isSealedData(data: unknown): boolean;
|
|
85
85
|
/**
|
|
86
86
|
* Check if a binary value has a compression format prefix ('gzip' or 'zstd').
|
|
87
|
-
* Browser-safe
|
|
87
|
+
* Browser-safe: does not depend on the full serialization module.
|
|
88
88
|
*/
|
|
89
89
|
export declare function isCompressedData(data: unknown): boolean;
|
|
90
90
|
/**
|
|
@@ -109,7 +109,7 @@ export type Revivers = Record<string, (value: any) => any>;
|
|
|
109
109
|
*
|
|
110
110
|
* Encrypted data is intentionally left as a `Uint8Array` so that consumers
|
|
111
111
|
* (CLI, web UI) can detect it with `isEncryptedData()` and decide how to
|
|
112
|
-
* handle it
|
|
112
|
+
* handle it: the CLI replaces it with a styled placeholder, the web UI
|
|
113
113
|
* renders an "Encrypted" card with a Decrypt button that triggers
|
|
114
114
|
* client-side decryption on demand.
|
|
115
115
|
*/
|
|
@@ -126,8 +126,8 @@ export declare function hydrateData(value: unknown, revivers: Revivers): unknown
|
|
|
126
126
|
* @param key - The run's key material. Pass `RunPayloadKeys` (from
|
|
127
127
|
* `deriveRunPayloadKeys`) to open both symmetric (`encr`) and sealed
|
|
128
128
|
* (`encp`) payloads; a bare `CryptoKey` opens only the symmetric ones.
|
|
129
|
-
* Typed as a read capability so a write-only seal target
|
|
130
|
-
* neither scheme
|
|
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.
|
|
131
131
|
*/
|
|
132
132
|
export declare function hydrateDataWithKey(value: unknown, revivers: Revivers, key: import('./serialization/encryption.js').DecryptionKey | undefined): Promise<unknown>;
|
|
133
133
|
/** Marker for stream reference objects rendered as links in the UI */
|
|
@@ -155,7 +155,7 @@ export declare const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__"
|
|
|
155
155
|
/**
|
|
156
156
|
* A class instance reference for o11y display.
|
|
157
157
|
*
|
|
158
|
-
* Browser-safe base class
|
|
158
|
+
* Browser-safe base class: no `util.inspect.custom`. Environment-specific
|
|
159
159
|
* rendering (CLI inspect, web component) is handled by each consumer.
|
|
160
160
|
*/
|
|
161
161
|
export declare class ClassInstanceRef {
|
|
@@ -206,7 +206,7 @@ export declare const observabilityRevivers: Revivers;
|
|
|
206
206
|
* Dispatches by resource type (step, hook, event, workflow) and calls
|
|
207
207
|
* `hydrateData` with the provided revivers for each data field.
|
|
208
208
|
*
|
|
209
|
-
* Each environment (web, CLI) provides its own revivers
|
|
209
|
+
* Each environment (web, CLI) provides its own revivers; this function
|
|
210
210
|
* only handles the dispatch logic and field mapping.
|
|
211
211
|
*/
|
|
212
212
|
export declare function hydrateResourceIO<T extends {
|