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
@@ -1,5 +1,5 @@
1
- import type { ExperimentalSetAttributesOptions, SetAttributesOptions } from './workflow/set-attributes.js';
2
- export type { ExperimentalSetAttributesOptions, SetAttributesOptions };
1
+ import type { SetAttributesOptions } from './workflow/set-attributes.js';
2
+ export type { SetAttributesOptions };
3
3
  /**
4
4
  * Host-side implementation for `setAttributes`. Workflow bodies resolve
5
5
  * to `./workflow/set-attributes.ts` via the `workflow` package-exports
@@ -10,9 +10,4 @@ export type { ExperimentalSetAttributesOptions, SetAttributesOptions };
10
10
  * a clear `FatalError`.
11
11
  */
12
12
  export declare function setAttributes(attrs: Record<string, string | undefined>, options?: SetAttributesOptions): Promise<void>;
13
- /**
14
- * @deprecated The feature is no longer experimental — use
15
- * {@link setAttributes} instead.
16
- */
17
- export declare const experimental_setAttributes: typeof setAttributes;
18
13
  //# sourceMappingURL=set-attributes.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
- import type { CryptoKey } from '../encryption.js';
2
+ import type { PayloadKey } from '../serialization/encryption.js';
3
3
  import type { FlushableStreamState } from '../flushable-stream.js';
4
4
  import type { WorkflowMetadata } from '../workflow/get-workflow-metadata.js';
5
5
  import type { StepMetadata } from './get-step-metadata.js';
@@ -55,7 +55,7 @@ export type StepContext = {
55
55
  */
56
56
  preCompletionOps: Promise<void>[];
57
57
  closureVars?: Record<string, any>;
58
- encryptionKey?: CryptoKey;
58
+ encryptionKey?: PayloadKey;
59
59
  writables?: Map<string, CachedWritable>;
60
60
  /**
61
61
  * Turbo mode only: a promise that resolves once the backgrounded
@@ -31,18 +31,31 @@ export declare const STREAM_SERVER_RUN_ID_SYMBOL: unique symbol;
31
31
  */
32
32
  export declare const STREAM_SERVER_DEPLOYMENT_ID_SYMBOL: unique symbol;
33
33
  /**
34
- * Stamped on a `WorkflowServerWritableStream` instance to expose a batched,
35
- * durable write entry point: `(chunks) => Promise<void>` that flushes every
36
- * chunk in one `writeMulti` (falling back to sequential `write`s when the
37
- * world lacks `writeMulti`) and resolves only once the whole batch has
38
- * reached the server.
34
+ * Stamped alongside `STREAM_SERVER_RUN_ID_SYMBOL` with the owning run's
35
+ * X25519 public key (base64), when the run has one.
39
36
  *
40
- * `flushablePipe` feature-detects this to coalesce chunks that arrive while a
41
- * previous batch is still in flight into a single server write. Sinks without
42
- * it (plain `WritableStream`s, `TransformStream` writables on the read path)
43
- * fall back to the per-chunk write loop. See `flushablePipe`.
37
+ * This is what lets a forwarded writable be written to across a deployment
38
+ * boundary at zero cost. The owning run derives its own public key locally
39
+ * when it creates the stream, so the key travels inside the serialized
40
+ * descriptor; a child on another deployment can then seal frames immediately.
41
+ * Without it the child would have to either fetch the owning run or fetch its
42
+ * symmetric key from the API — the round trip this whole mechanism exists to
43
+ * avoid.
44
44
  */
45
- export declare const STREAM_WRITE_BATCH_SYMBOL: unique symbol;
45
+ export declare const STREAM_SERVER_PUBLIC_KEY_SYMBOL: unique symbol;
46
+ /**
47
+ * Stamped on a `WorkflowServerWritableStream` instance to expose its
48
+ * durability barrier: `() => Promise<void>` that resolves once every accepted
49
+ * chunk has durably reached the server (nothing buffered, nothing in flight)
50
+ * and rejects if any dispatch failed.
51
+ *
52
+ * The sink acks `write()` on buffer entry (group-commit batching), so
53
+ * durability tracking lives here instead: `flushablePipe` feature-detects
54
+ * this and awaits it before resolving its lock-release completion, keeping
55
+ * the invariant that a step cannot complete while stream data is still
56
+ * client-side. Sinks without it are fully durable per `write()` already.
57
+ */
58
+ export declare const STREAM_DRAIN_SYMBOL: unique symbol;
46
59
  export declare const BODY_INIT_SYMBOL: unique symbol;
47
60
  export declare const WEBHOOK_RESPONSE_WRITABLE: unique symbol;
48
61
  /**
@@ -121,8 +121,8 @@ export declare const WorkflowBackstopWakesArmed: (value: number) => {
121
121
  [k: string]: number;
122
122
  };
123
123
  /** The workflow runtime route being handled */
124
- export declare const WorkflowRouteType: (value: "step" | "flow") => {
125
- [k: string]: "step" | "flow";
124
+ export declare const WorkflowRouteType: (value: "flow") => {
125
+ [k: string]: "flow";
126
126
  };
127
127
  /** Whether this route invocation reused an already-created request handler */
128
128
  export declare const WorkflowRouteHandlerCached: (value: boolean) => {
@@ -362,8 +362,8 @@ export declare const SerializationCompressed: (value: boolean) => {
362
362
  [k: string]: boolean;
363
363
  };
364
364
  /** Which compression codec applied / was present (`zstd`, `gzip`, or `none`). */
365
- export declare const SerializationCodec: (value: "zstd" | "gzip" | "none") => {
366
- [k: string]: "zstd" | "gzip" | "none";
365
+ export declare const SerializationCodec: (value: "gzip" | "zstd" | "none") => {
366
+ [k: string]: "gzip" | "zstd" | "none";
367
367
  };
368
368
  /** Logical (uncompressed, devalue-prefixed) payload size in bytes. */
369
369
  export declare const SerializationUncompressedBytes: (value: number) => {
@@ -1,2 +1,2 @@
1
- export declare const version = "5.0.0-beta.36";
1
+ export declare const version = "5.0.0-beta.37";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { WorkflowOrchestratorContext } from '../private.js';
1
+ import { type WorkflowOrchestratorContext } from '../private.js';
2
2
  import { ABORT_HOOK_TOKEN, ABORT_STREAM_NAME } from '../symbols.js';
3
3
  /**
4
4
  * A lightweight AbortSignal implementation for the workflow VM context.
@@ -5,7 +5,7 @@ export { sleep } from '../sleep.js';
5
5
  export { createHook, createWebhook } from './create-hook.js';
6
6
  export { defineHook } from './define-hook.js';
7
7
  export { getWorkflowMetadata } from './get-workflow-metadata.js';
8
- export { experimental_setAttributes, type SetAttributesOptions, setAttributes, } from './set-attributes.js';
8
+ export { type SetAttributesOptions, setAttributes, } from './set-attributes.js';
9
9
  export { getWritable } from './writable-stream.js';
10
10
  export declare function getStepMetadata(): StepMetadata;
11
11
  export declare function resumeHook(): void;
@@ -20,10 +20,6 @@ export interface SetAttributesOptions {
20
20
  */
21
21
  allowReservedAttributes?: boolean;
22
22
  }
23
- /**
24
- * @deprecated Use {@link SetAttributesOptions} instead.
25
- */
26
- export type ExperimentalSetAttributesOptions = SetAttributesOptions;
27
23
  /**
28
24
  * Attach plaintext string key/value metadata to the current workflow run.
29
25
  *
@@ -69,9 +65,4 @@ export type ExperimentalSetAttributesOptions = SetAttributesOptions;
69
65
  * ```
70
66
  */
71
67
  export declare function setAttributes(attrs: Record<string, string | undefined>, options?: SetAttributesOptions): Promise<void>;
72
- /**
73
- * @deprecated The feature is no longer experimental — use
74
- * {@link setAttributes} instead.
75
- */
76
- export declare const experimental_setAttributes: typeof setAttributes;
77
68
  //# sourceMappingURL=set-attributes.d.ts.map
@@ -1 +1 @@
1
- import{An as e,On as t,fn as n,kn as r,pn as i,wn as a}from"../../_chunks/workflow/wait-until-B-1TiJji.js";import"../../_chunks/workflow/dist-B-vbuNqP.js";import{i as o}from"../../_chunks/workflow/workflow-routes-Pd-WKcx_.js";import{i as s,u as c}from"../../_chunks/workflow/dist-BeQ_csYA.js";import{c as l,i as u,o as d,r as f,t as p}from"../../_chunks/workflow/attribute-changes-B6ltn-ph.js";import{t as m}from"../../_chunks/workflow/sleep-CrgsokmG.js";import{t as h}from"../../_chunks/workflow/run-BMRZ6pA-.js";i(n,h);function g(e){let n=globalThis[t];return n||u(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,g),n(e)}function _(e){let{respondWith:t,token:n,...r}=e??{};if(n!==void 0)throw Error("`createWebhook()` does not accept a `token` option. Webhook tokens are always randomly generated. Use `createHook()` with `resumeHook()` for deterministic token patterns.");let i;t!==void 0&&(i={respondWith:t});let a=g({...r,metadata:i,isWebhook:!0}),{url:s}=l();return a.url=o(s,{type:`webhook`,token:a.token}),a}function v(){function e(t,n){d(`defineHook().resume()`,`https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook`,e)}return{create(e){return g(e)},resume:e}}async function y(t,n={}){let r=p(t,n);if(r.length===0)return;let i=n.allowReservedAttributes===!0,a=globalThis[e];if(!a)throw new s("setAttributes() called outside a workflow runtime context. It must be called from within a workflow body (`use workflow`).");await a(r,i?{allowReservedAttributes:!0}:{})}const b=y;function x(e={}){let{namespace:t}=e,n=globalThis[r](t);return Object.create(globalThis.WritableStream.prototype,{[a]:{value:n,writable:!1}})}function S(){f(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,S)}function C(){d(`resumeHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook`,C)}export{s as FatalError,c as RetryableError,g as createHook,_ as createWebhook,v as defineHook,b as experimental_setAttributes,S as getStepMetadata,l as getWorkflowMetadata,x as getWritable,C as resumeHook,y as setAttributes,m as sleep};
1
+ import{Fn as e,Nn as t,On as n,Pn as r,_n as i,gn as a}from"../../_chunks/workflow/wait-until-De9yESQN.js";import"../../_chunks/workflow/dist-B-vbuNqP.js";import{i as o}from"../../_chunks/workflow/workflow-routes-CwqB063q.js";import{i as s,u as c}from"../../_chunks/workflow/dist-BeQ_csYA.js";import{c as l,i as u,o as d,r as f,t as p}from"../../_chunks/workflow/attribute-changes-DeZc2RZz.js";import{t as m}from"../../_chunks/workflow/sleep-BjrUxUcs.js";import{t as h}from"../../_chunks/workflow/run-CWytxfIp.js";i(a,h);function g(e){let n=globalThis[t];return n||u(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,g),n(e)}function _(e){let{respondWith:t,token:n,...r}=e??{};if(n!==void 0)throw Error("`createWebhook()` does not accept a `token` option. Webhook tokens are always randomly generated. Use `createHook()` with `resumeHook()` for deterministic token patterns.");let i;t!==void 0&&(i={respondWith:t});let a=g({...r,metadata:i,isWebhook:!0}),{url:s}=l();return a.url=o(s,{type:`webhook`,token:a.token}),a}function v(){function e(t,n){d(`defineHook().resume()`,`https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook`,e)}return{create(e){return g(e)},resume:e}}async function y(t,n={}){let r=p(t,n);if(r.length===0)return;let i=n.allowReservedAttributes===!0,a=globalThis[e];if(!a)throw new s("setAttributes() called outside a workflow runtime context. It must be called from within a workflow body (`use workflow`).");await a(r,i?{allowReservedAttributes:!0}:{})}function b(e={}){let{namespace:t}=e,i=globalThis[r](t);return Object.create(globalThis.WritableStream.prototype,{[n]:{value:i,writable:!1}})}function x(){f(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,x)}function S(){d(`resumeHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook`,S)}export{s as FatalError,c as RetryableError,g as createHook,_ as createWebhook,v as defineHook,x as getStepMetadata,l as getWorkflowMetadata,b as getWritable,S as resumeHook,y as setAttributes,m as sleep};
@@ -532,7 +532,7 @@ export declare class RunNotSupportedError extends WorkflowError {
532
532
  * Any error can opt into the non-retry behavior by setting a `fatal: true`
533
533
  * own property. This is how structured error classes that aren't direct
534
534
  * `FatalError` subclasses (e.g. context-violation errors) signal to the
535
- * step handler that retrying will never help — the user's code is calling
535
+ * step executor that retrying will never help — the user's code is calling
536
536
  * a workflow-only API from the wrong context, or similar — and burning
537
537
  * retry attempts just produces a wall of duplicated log output.
538
538
  */
@@ -198,6 +198,7 @@ declare const RunCreatedEventSchema: z.ZodObject<{
198
198
  executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
199
199
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
200
200
  allowReservedAttributes: z.ZodOptional<z.ZodLiteral<true>>;
201
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
201
202
  }, z.core.$strip>;
202
203
  }, z.core.$strip>;
203
204
  export declare const CreateEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -211,6 +212,7 @@ export declare const CreateEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
211
212
  executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
212
213
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
213
214
  allowReservedAttributes: z.ZodOptional<z.ZodLiteral<true>>;
215
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
214
216
  }, z.core.$strip>;
215
217
  }, z.core.$strip>, z.ZodObject<{
216
218
  correlationId: z.ZodOptional<z.ZodString>;
@@ -223,6 +225,7 @@ export declare const CreateEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
223
225
  executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
224
226
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
225
227
  allowReservedAttributes: z.ZodOptional<z.ZodLiteral<true>>;
228
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
226
229
  }, z.core.$strip>>;
227
230
  }, z.core.$strip>, z.ZodObject<{
228
231
  correlationId: z.ZodOptional<z.ZodString>;
@@ -376,6 +379,7 @@ export declare const EventSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.Z
376
379
  executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
377
380
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
378
381
  allowReservedAttributes: z.ZodOptional<z.ZodLiteral<true>>;
382
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
379
383
  }, z.core.$strip>;
380
384
  }, z.core.$strip>, z.ZodObject<{
381
385
  correlationId: z.ZodOptional<z.ZodString>;
@@ -388,6 +392,7 @@ export declare const EventSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.Z
388
392
  executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
389
393
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
390
394
  allowReservedAttributes: z.ZodOptional<z.ZodLiteral<true>>;
395
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
391
396
  }, z.core.$strip>>;
392
397
  }, z.core.$strip>, z.ZodObject<{
393
398
  correlationId: z.ZodOptional<z.ZodString>;
@@ -1,6 +1,25 @@
1
1
  import { z } from '#compiled/zod/index.js';
2
2
  import type { SerializedData } from './serialization.js';
3
3
  import type { PaginationOptions, ResolveData } from './shared.js';
4
+ /**
5
+ * Minimal, immutable slice of a hook's owning run needed to resume it —
6
+ * enough for encryption-key resolution, serialization/compression capability
7
+ * selection, queue routing, and trace linking, without fetching the full run.
8
+ *
9
+ * Persisted on new hook records (workflow-server) and also returned inline by
10
+ * `getByToken`, so a resume can skip the separate `runs.get`. Deliberately
11
+ * excludes the run's mutable state (e.g. status), inputs/outputs, attributes,
12
+ * and any secret — only fields that are fixed at hook-creation time.
13
+ */
14
+ export declare const HookResumeContextSchema: z.ZodObject<{
15
+ deploymentId: z.ZodString;
16
+ workflowName: z.ZodString;
17
+ runSpecVersion: z.ZodOptional<z.ZodNumber>;
18
+ workflowCoreVersion: z.ZodOptional<z.ZodString>;
19
+ traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
20
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ export type HookResumeContext = z.infer<typeof HookResumeContextSchema>;
4
23
  /**
5
24
  * Schema for workflow hooks.
6
25
  *
@@ -20,6 +39,14 @@ export declare const HookSchema: z.ZodObject<{
20
39
  specVersion: z.ZodOptional<z.ZodNumber>;
21
40
  isWebhook: z.ZodOptional<z.ZodBoolean>;
22
41
  isSystem: z.ZodOptional<z.ZodBoolean>;
42
+ resumeContext: z.ZodOptional<z.ZodObject<{
43
+ deploymentId: z.ZodString;
44
+ workflowName: z.ZodString;
45
+ runSpecVersion: z.ZodOptional<z.ZodNumber>;
46
+ workflowCoreVersion: z.ZodOptional<z.ZodString>;
47
+ traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
48
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>>;
23
50
  }, z.core.$strip>;
24
51
  /**
25
52
  * Represents a Hook. Hooks kept by minimum retention remain readable after
@@ -9,7 +9,7 @@ export type * from './hooks.js';
9
9
  export { HookSchema } from './hooks.js';
10
10
  export type * from './interfaces.js';
11
11
  export type * from './queue.js';
12
- export { getQueuePrefixKind, getQueueTopicPrefix, HealthCheckPayloadSchema, MessageId, parseQueueName, QueuePayloadSchema, QueuePrefix, RunInputSchema, resolveQueueNamespace, StepInvokePayloadSchema, ValidQueueName, WorkflowInvokePayloadSchema, } from './queue.js';
12
+ export { getQueueTopicPrefix, HealthCheckPayloadSchema, MessageId, parseQueueName, QueuePayloadSchema, QueuePrefix, RunInputSchema, resolveQueueNamespace, ValidQueueName, WorkflowInvokePayloadSchema, } from './queue.js';
13
13
  export { reenqueueActiveRuns } from './recovery.js';
14
14
  export type * from './runs.js';
15
15
  export { isTerminalWorkflowRunStatus, TERMINAL_WORKFLOW_RUN_STATUSES, TerminalWorkflowRunStatusSchema, WorkflowRunBaseSchema, WorkflowRunSchema, WorkflowRunStatusSchema, } from './runs.js';
@@ -22,8 +22,8 @@ export type { SpecVersion } from './spec-version.js';
22
22
  export { isLegacySpecVersion, requiresNewerWorld, SPEC_VERSION_CURRENT, SPEC_VERSION_LEGACY, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_SUPPORTS_EVENT_SOURCING, } from './spec-version.js';
23
23
  export type * from './steps.js';
24
24
  export { isTerminalStepStatus, StepSchema, StepStatusSchema, TERMINAL_STEP_STATUSES, TerminalStepStatusSchema, } from './steps.js';
25
- export { DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS, DEFAULT_TIMESTAMP_THRESHOLD_MS, DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS, ulidToDate, validateUlidTimestamp, workflowRunIdSchema, } from './ulid.js';
26
25
  export type { WorkflowRunId } from './ulid.js';
26
+ export { DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS, DEFAULT_TIMESTAMP_THRESHOLD_MS, DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS, ulidToDate, validateUlidTimestamp, workflowRunIdSchema, } from './ulid.js';
27
27
  export type * from './waits.js';
28
28
  export { WaitSchema, WaitStatusSchema } from './waits.js';
29
29
  //# sourceMappingURL=index.d.ts.map
@@ -8,13 +8,15 @@ import type { GetChunksOptions, PaginatedResponse, StreamChunksResponse, StreamI
8
8
  import type { GetStepParams, ListWorkflowRunStepsParams, Step, StepWithoutData } from './steps.js';
9
9
  export interface Streamer {
10
10
  /**
11
- * Override the default flush interval (in milliseconds) for buffered stream writes.
12
- * Chunks are accumulated in a buffer and flushed together on this interval.
11
+ * Number of milliseconds a stream waits for additional chunks to arrive
12
+ * before flushing to the underlying transport.
13
13
  *
14
- * The default is 10ms, which is appropriate for HTTP-based backends where
15
- * each flush is a network round-trip. For backends with sub-millisecond writes
16
- * (e.g., Redis, local filesystem), a lower value (or 0 for immediate flushing) reduces
17
- * end-to-end stream latency.
14
+ * Default `0`: the first chunk dispatches immediately, and chunks
15
+ * arriving while a request is in flight coalesce into the next group.
16
+ * Setting this to > 0 trades first-chunk latency for fewer requests.
17
+ *
18
+ * The `WORKFLOW_STREAM_FLUSH_INTERVAL_MS` environment variable, when
19
+ * set, overrides this option.
18
20
  *
19
21
  * Not supported by all worlds.
20
22
  */
@@ -1,9 +1,9 @@
1
1
  import { z } from '#compiled/zod/index.js';
2
- export type QueueKind = 'workflow' | 'step';
2
+ export type QueueKind = 'workflow';
3
3
  /**
4
4
  * Pattern matching valid queue prefixes:
5
- * - `__wkf_workflow_` / `__wkf_step_` (default, no namespace)
6
- * - `__{namespace}_wkf_workflow_` / `__{namespace}_wkf_step_` (namespaced)
5
+ * - `__wkf_workflow_` (default, no namespace)
6
+ * - `__{namespace}_wkf_workflow_` (namespaced)
7
7
  *
8
8
  * Namespace must be lowercase alphanumeric starting with a letter.
9
9
  */
@@ -17,16 +17,17 @@ export type ValidQueueName = z.infer<typeof ValidQueueName>;
17
17
  */
18
18
  export declare function resolveQueueNamespace(namespace?: string): string | undefined;
19
19
  /**
20
- * Builds a queue topic prefix for the given kind and optional namespace.
20
+ * Builds the workflow queue topic prefix for an optional namespace.
21
+ *
22
+ * The literal kind argument is retained so existing workflow-only callers keep
23
+ * their meaning after removal of the former `'step'` variant.
21
24
  *
22
25
  * - `getQueueTopicPrefix('workflow')` → `'__wkf_workflow_'`
23
26
  * - `getQueueTopicPrefix('workflow', 'custom')` → `'__custom_wkf_workflow_'`
24
27
  */
25
28
  export declare function getQueueTopicPrefix(kind: QueueKind, namespace?: string): QueuePrefix;
26
- export declare function getQueuePrefixKind(prefix: QueuePrefix): QueueKind;
27
29
  export declare function parseQueueName(name: ValidQueueName): {
28
30
  prefix: QueuePrefix;
29
- kind: QueueKind;
30
31
  id: string;
31
32
  };
32
33
  export declare const MessageId: z.core.$ZodBranded<z.ZodString, "MessageId", "out">;
@@ -73,26 +74,39 @@ export declare const WorkflowInvokePayloadSchema: z.ZodObject<{
73
74
  allowReservedAttributes: z.ZodOptional<z.ZodLiteral<true>>;
74
75
  }, z.core.$strip>>;
75
76
  }, z.core.$strip>;
76
- export declare const StepInvokePayloadSchema: z.ZodObject<{
77
- workflowName: z.ZodString;
78
- workflowRunId: z.ZodString;
79
- workflowStartedAt: z.ZodNumber;
80
- stepId: z.ZodString;
81
- traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
82
- requestedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
83
- }, z.core.$strip>;
84
77
  export type WorkflowInvokePayload = z.infer<typeof WorkflowInvokePayloadSchema>;
85
- export type StepInvokePayload = z.infer<typeof StepInvokePayloadSchema>;
86
78
  export type HealthCheckPayload = z.infer<typeof HealthCheckPayloadSchema>;
87
79
  /**
88
80
  * Health check payload - used to verify that the queue pipeline
89
- * can deliver messages to workflow/step endpoints.
81
+ * can deliver messages to the combined workflow endpoint.
90
82
  */
91
83
  export declare const HealthCheckPayloadSchema: z.ZodObject<{
92
84
  __healthCheck: z.ZodLiteral<true>;
93
85
  correlationId: z.ZodString;
86
+ runId: z.ZodOptional<z.ZodString>;
94
87
  }, z.core.$strip>;
88
+ /**
89
+ * Health check MUST come first.
90
+ *
91
+ * Zod unions return the first matching member's output, and `z.object` strips
92
+ * keys the matching member doesn't declare. `HealthCheckPayloadSchema` carries
93
+ * an optional `runId`, so a probe payload also satisfies
94
+ * `WorkflowInvokePayloadSchema` (whose only required field is `runId`). With
95
+ * the invoke member first, parsing a runId-bearing probe silently dropped
96
+ * `__healthCheck` and `correlationId`, and the runtime — which dispatches on
97
+ * `__healthCheck` before falling through to the invoke schema — reinterpreted
98
+ * the probe as "replay this run". That made the queue handler POST
99
+ * `run_started` for a run that doesn't exist yet (404), fail, and retry
100
+ * forever, so the probe never answered and `start()` timed out.
101
+ *
102
+ * Ordering health check first is safe in the other direction: it requires
103
+ * `__healthCheck: true`, which an invoke payload never carries.
104
+ */
95
105
  export declare const QueuePayloadSchema: z.ZodUnion<readonly [z.ZodObject<{
106
+ __healthCheck: z.ZodLiteral<true>;
107
+ correlationId: z.ZodString;
108
+ runId: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strip>, z.ZodObject<{
96
110
  runId: z.ZodString;
97
111
  traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
98
112
  requestedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -112,16 +126,6 @@ export declare const QueuePayloadSchema: z.ZodUnion<readonly [z.ZodObject<{
112
126
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
113
127
  allowReservedAttributes: z.ZodOptional<z.ZodLiteral<true>>;
114
128
  }, z.core.$strip>>;
115
- }, z.core.$strip>, z.ZodObject<{
116
- workflowName: z.ZodString;
117
- workflowRunId: z.ZodString;
118
- workflowStartedAt: z.ZodNumber;
119
- stepId: z.ZodString;
120
- traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
121
- requestedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
122
- }, z.core.$strip>, z.ZodObject<{
123
- __healthCheck: z.ZodLiteral<true>;
124
- correlationId: z.ZodString;
125
129
  }, z.core.$strip>]>;
126
130
  export type QueuePayload = z.infer<typeof QueuePayloadSchema>;
127
131
  export interface QueueOptions {
@@ -43,6 +43,7 @@ export declare const WorkflowRunBaseSchema: z.ZodObject<{
43
43
  error: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
44
44
  errorCode: z.ZodOptional<z.ZodString>;
45
45
  attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
46
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
46
47
  expiredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
47
48
  startedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
49
  completedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -58,6 +59,7 @@ export declare const WorkflowRunSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
58
59
  input: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
59
60
  errorCode: z.ZodOptional<z.ZodString>;
60
61
  attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
62
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
61
63
  expiredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
62
64
  startedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
63
65
  createdAt: z.ZodCoercedDate<unknown>;
@@ -78,6 +80,7 @@ export declare const WorkflowRunSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
78
80
  input: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
79
81
  errorCode: z.ZodOptional<z.ZodString>;
80
82
  attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
83
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
81
84
  expiredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
82
85
  startedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
83
86
  createdAt: z.ZodCoercedDate<unknown>;
@@ -95,6 +98,7 @@ export declare const WorkflowRunSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
95
98
  input: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
96
99
  errorCode: z.ZodOptional<z.ZodString>;
97
100
  attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
101
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
98
102
  expiredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
99
103
  startedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
100
104
  createdAt: z.ZodCoercedDate<unknown>;
@@ -112,6 +116,7 @@ export declare const WorkflowRunSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
112
116
  input: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
113
117
  errorCode: z.ZodOptional<z.ZodString>;
114
118
  attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
119
+ encryptionPublicKey: z.ZodOptional<z.ZodString>;
115
120
  expiredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
116
121
  startedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
117
122
  createdAt: z.ZodCoercedDate<unknown>;
@@ -21,10 +21,9 @@ export declare const SPEC_VERSION_SUPPORTS_EVENT_SOURCING: SpecVersion;
21
21
  export declare const SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT: SpecVersion;
22
22
  export declare const SPEC_VERSION_SUPPORTS_ATTRIBUTES: SpecVersion;
23
23
  /**
24
- * Runs at this spec version or later may contain gzip-compressed payloads
25
- * ('gzip' format prefix). Readers older than this version cannot decode
26
- * such payloads and reject the run via `requiresNewerWorld()` instead of
27
- * failing on individual payloads.
24
+ * Runs at this spec version or later may contain zstd- or gzip-compressed
25
+ * payloads. Readers older than this version reject the run via
26
+ * `requiresNewerWorld()` instead of failing on individual payloads.
28
27
  */
29
28
  export declare const SPEC_VERSION_SUPPORTS_COMPRESSION: SpecVersion;
30
29
  /**