eve 0.54.2 → 0.54.4

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 (146) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/src/cli/commands/init-agent-workspace.js +1 -1
  3. package/dist/src/cli/commands/init-project.d.ts +46 -0
  4. package/dist/src/cli/commands/init-project.js +1 -0
  5. package/dist/src/cli/commands/init-self-modification.d.ts +7 -0
  6. package/dist/src/cli/commands/init-self-modification.js +1 -0
  7. package/dist/src/cli/commands/init-target.js +2 -2
  8. package/dist/src/cli/commands/init-telemetry.d.ts +6 -0
  9. package/dist/src/cli/commands/init-telemetry.js +1 -0
  10. package/dist/src/cli/commands/init.d.ts +3 -0
  11. package/dist/src/cli/commands/init.js +1 -1
  12. package/dist/src/cli/dev/tui/setup-commands.js +1 -1
  13. package/dist/src/cli/telemetry/index.d.ts +1 -1
  14. package/dist/src/compiled/.vendor-stamp.json +8 -6
  15. package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
  16. package/dist/src/compiled/@ai-sdk/google/index.js +7 -7
  17. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  18. package/dist/src/compiled/@ai-sdk/openai/index.js +4 -4
  19. package/dist/src/compiled/@opentelemetry/api/index.d.ts +2 -0
  20. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +26 -0
  21. package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +41 -0
  22. package/dist/src/compiled/@workflow/core/index.js +2 -2
  23. package/dist/src/compiled/@workflow/core/replay-divergence.d.ts +25 -0
  24. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +75 -1
  25. package/dist/src/compiled/@workflow/core/runtime/quickjs-entrypoint.d.ts +30 -8
  26. package/dist/src/compiled/@workflow/core/runtime/quickjs-log-view.d.ts +129 -0
  27. package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +2 -21
  28. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +0 -22
  29. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  30. package/dist/src/compiled/@workflow/core/serialization.d.ts +2 -2
  31. package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +2 -0
  32. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +36 -0
  33. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  34. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  35. package/dist/src/compiled/@workflow/world/analytics.d.ts +23 -23
  36. package/dist/src/compiled/@workflow/world/events.d.ts +4 -2
  37. package/dist/src/compiled/@workflow/world/queue.d.ts +84 -0
  38. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  39. package/dist/src/compiled/@workflow/world-vercel/index.js +18 -13
  40. package/dist/src/compiled/_chunks/workflow/attribute-changes-BAcgmlXp.js +20 -0
  41. package/dist/src/compiled/_chunks/workflow/coerce-ro2dOxbr.js +1 -0
  42. package/dist/src/compiled/_chunks/workflow/dist-KPieTJHT.js +25 -0
  43. package/dist/src/compiled/_chunks/workflow/dist-PLkAQ-U7.js +2 -0
  44. package/dist/src/compiled/_chunks/workflow/frames-BvATzM2t.js +3 -0
  45. package/dist/src/compiled/_chunks/workflow/{functions-C02-JHBK.js → functions-wMCGZAVk.js} +1 -1
  46. package/dist/src/compiled/_chunks/workflow/resume-hook-BEHe0Uut.js +1 -0
  47. package/dist/src/compiled/_chunks/workflow/run-ChHLjaCt.js +1 -0
  48. package/dist/src/compiled/_chunks/workflow/schemas-DR7NTzNe.js +50 -0
  49. package/dist/src/compiled/_chunks/workflow/sleep-BB2HuVie.js +1 -0
  50. package/dist/src/compiled/_chunks/workflow/{wrapper-BxECO5nh.js → wrapper-CKui_eTd.js} +2 -2
  51. package/dist/src/compiled/_chunks/workflow/ws-transport-CVezyWwZ.js +1 -0
  52. package/dist/src/compiled/just-secrets/LICENSE +21 -0
  53. package/dist/src/compiled/just-secrets/index.d.ts +20 -0
  54. package/dist/src/compiled/just-secrets/index.js +2 -0
  55. package/dist/src/compiled/just-secrets/windows.ps1 +138 -0
  56. package/dist/src/compiler/extension-compatibility.d.ts +12 -12
  57. package/dist/src/compiler/extension-compatibility.js +1 -1
  58. package/dist/src/compiler/normalize-manifest-helpers.d.ts +2 -1
  59. package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
  60. package/dist/src/compiler/normalize-manifest.js +1 -1
  61. package/dist/src/compiler/resolve-workspace-subagent.d.ts +13 -0
  62. package/dist/src/compiler/resolve-workspace-subagent.js +1 -0
  63. package/dist/src/context/dynamic-model-lifecycle.d.ts +0 -6
  64. package/dist/src/context/dynamic-model-lifecycle.js +1 -1
  65. package/dist/src/context/dynamic-resolve-context.js +1 -1
  66. package/dist/src/context/effective-model.d.ts +5 -0
  67. package/dist/src/context/effective-model.js +1 -0
  68. package/dist/src/context/keys.d.ts +2 -0
  69. package/dist/src/context/keys.js +1 -1
  70. package/dist/src/dynamic/definition.d.ts +4 -0
  71. package/dist/src/eve-channel/index.js +1 -1
  72. package/dist/src/eve-channel/types.d.ts +9 -7
  73. package/dist/src/execution/durable-session-migrations/snapshot.d.ts +0 -16
  74. package/dist/src/execution/durable-session-migrations/snapshot.js +1 -1
  75. package/dist/src/execution/eve-workflow-attributes.d.ts +1 -1
  76. package/dist/src/execution/run-session-limits.js +1 -1
  77. package/dist/src/execution/session.js +1 -1
  78. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  79. package/dist/src/execution/workflow-steps.js +1 -1
  80. package/dist/src/harness/compaction.js +1 -1
  81. package/dist/src/harness/messages.d.ts +1 -1
  82. package/dist/src/harness/messages.js +1 -1
  83. package/dist/src/harness/step-hooks.d.ts +16 -10
  84. package/dist/src/harness/step-hooks.js +1 -1
  85. package/dist/src/harness/tool-loop.js +2 -2
  86. package/dist/src/instrumentation/parent-lineage.js +1 -1
  87. package/dist/src/internal/application/package.js +1 -1
  88. package/dist/src/internal/nitro/routes/index.d.ts +6 -0
  89. package/dist/src/internal/nitro/routes/index.js +7 -7
  90. package/dist/src/internal/vercel/assemble-eve-services.js +1 -1
  91. package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
  92. package/dist/src/internal/vercel/build-multi-agent-landing-page.d.ts +3 -0
  93. package/dist/src/internal/vercel/build-multi-agent-landing-page.js +1 -0
  94. package/dist/src/internal/vercel/eve-service-contribution.d.ts +4 -0
  95. package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
  96. package/dist/src/internal/vercel/vercel-services-config.js +1 -1
  97. package/dist/src/protocol/baggage.d.ts +6 -0
  98. package/dist/src/protocol/baggage.js +1 -1
  99. package/dist/src/protocol/traceparent.d.ts +13 -0
  100. package/dist/src/protocol/traceparent.js +1 -1
  101. package/dist/src/public/definitions/workspace-agent.d.ts +25 -0
  102. package/dist/src/public/definitions/workspace-agent.js +1 -0
  103. package/dist/src/public/index.d.ts +1 -0
  104. package/dist/src/public/index.js +1 -1
  105. package/dist/src/public/models/openai/chatgpt/codex-app-server.d.ts +41 -0
  106. package/dist/src/public/models/openai/chatgpt/codex-app-server.js +1 -0
  107. package/dist/src/public/models/openai/chatgpt/credential-store.d.ts +26 -4
  108. package/dist/src/public/models/openai/chatgpt/credential-store.js +1 -1
  109. package/dist/src/public/models/openai/chatgpt/oauth.d.ts +6 -4
  110. package/dist/src/public/models/openai/chatgpt/token-broker.d.ts +7 -7
  111. package/dist/src/public/models/openai/chatgpt/token-broker.js +1 -1
  112. package/dist/src/public/models/openai/chatgpt/token.d.ts +13 -0
  113. package/dist/src/public/models/openai/chatgpt/token.js +1 -0
  114. package/dist/src/public/models/openai/chatgpt/transport.d.ts +2 -1
  115. package/dist/src/public/models/openai/index.d.ts +3 -2
  116. package/dist/src/public/vercel/index.d.ts +50 -0
  117. package/dist/src/public/vercel/index.js +1 -0
  118. package/dist/src/self-modification/setup.js +7 -2
  119. package/dist/src/setup/flows/chatgpt-auth.d.ts +2 -1
  120. package/dist/src/setup/flows/chatgpt-auth.js +1 -1
  121. package/dist/src/setup/flows/model.d.ts +0 -2
  122. package/dist/src/setup/flows/model.js +1 -1
  123. package/dist/src/setup/scaffold/create/project.js +1 -1
  124. package/dist/src/subagents/remote-dispatch.d.ts +3 -1
  125. package/dist/src/subagents/remote-dispatch.js +1 -1
  126. package/dist/src/tracing/agent-otel-attributes.js +1 -1
  127. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  128. package/docs/agent-config.md +3 -3
  129. package/docs/guides/deployment/vercel.mdx +52 -1
  130. package/docs/guides/dynamic-capabilities.md +19 -7
  131. package/docs/guides/instrumentation-providers.md +1 -1
  132. package/docs/guides/instrumentation.md +25 -6
  133. package/docs/guides/remote-agents.md +5 -5
  134. package/docs/reference/cli.md +2 -2
  135. package/docs/reference/telemetry.md +1 -1
  136. package/docs/reference/typescript-api.md +14 -7
  137. package/docs/subagents/index.mdx +31 -0
  138. package/package.json +13 -6
  139. package/dist/src/compiled/_chunks/workflow/attribute-changes-C6H-fRVP.js +0 -20
  140. package/dist/src/compiled/_chunks/workflow/dist-DDeH-1ER.js +0 -40
  141. package/dist/src/compiled/_chunks/workflow/dist-DhncQSl7.js +0 -74
  142. package/dist/src/compiled/_chunks/workflow/frames-DsEqSDes.js +0 -3
  143. package/dist/src/compiled/_chunks/workflow/resume-hook-BRDLAb67.js +0 -1
  144. package/dist/src/compiled/_chunks/workflow/run-BM2OFphk.js +0 -1
  145. package/dist/src/compiled/_chunks/workflow/sleep-6cG0F99-.js +0 -1
  146. package/dist/src/compiled/_chunks/workflow/ws-transport-DuK82LLz.js +0 -1
@@ -1,4 +1,4 @@
1
- import { createFlushableState } from './flushable-stream.js';
1
+ import { createFlushableState, type FlushableStreamState } from './flushable-stream.js';
2
2
  import { compress, decompress } from './serialization/compression.js';
3
3
  import { aesKeyOf, decrypt, deriveRunPayloadKeys, type EncryptionKeyParam, encrypt, isRunPayloadKeys, isSealTarget, type PayloadKey, type RunPayloadKeys, runPayloadKeys, type SealTarget, sealTo } from './serialization/encryption.js';
4
4
  import { decodeFormatPrefix, encodeWithFormatPrefix, isEncrypted, peekFormatPrefix } from './serialization/format.js';
@@ -465,7 +465,7 @@ guestCodeStatsOut?: GuestCodeStats): Promise<Uint8Array | unknown>;
465
465
  * Called from the step executor to hydrate the arguments of a step
466
466
  * from the database at the start of the step execution.
467
467
  */
468
- 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>;
468
+ 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, streamStates?: FlushableStreamState[]): Promise<any>;
469
469
  /**
470
470
  * Called from the step executor when a step has completed.
471
471
  * Dehydrates values from within the step execution environment
@@ -57,6 +57,8 @@ export type StepContext = {
57
57
  closureVars?: Record<string, any>;
58
58
  encryptionKey?: PayloadKey;
59
59
  writables?: Map<string, CachedWritable>;
60
+ /** Server-bound stream pipes whose current frames must drain at step end. */
61
+ streamStates?: FlushableStreamState[];
60
62
  /**
61
63
  * Turbo mode only: a promise that resolves once the backgrounded
62
64
  * `run_started` has landed (the run exists). Set when the step body runs
@@ -192,6 +192,15 @@ export declare const WorkflowOwnedRecoverySteps: (value: number) => {
192
192
  export declare const WorkflowBackstopWakesArmed: (value: number) => {
193
193
  [k: string]: number;
194
194
  };
195
+ /**
196
+ * Number of pending steps whose immediate step-execution enqueue this replay
197
+ * pass skipped because THIS invocation already published that step's message
198
+ * on an earlier pass (a fan-out that ran inline steps and replayed again).
199
+ * Invocation-local knowledge only: a fresh delivery never skips.
200
+ */
201
+ export declare const WorkflowDispatchRepublishSkipped: (value: number) => {
202
+ [k: string]: number;
203
+ };
195
204
  /** The workflow runtime route being handled */
196
205
  export declare const WorkflowRouteType: (value: "flow") => {
197
206
  [k: string]: "flow";
@@ -294,6 +303,15 @@ export declare const StepFinalSchedulingReplayMs: (value: number) => {
294
303
  export declare const StepLatencyOptimizations: (value: string[]) => {
295
304
  [k: string]: string[];
296
305
  };
306
+ /**
307
+ * How the step's initial `step_started` claim was made. Only present for
308
+ * inline create claims; ordinary background starts and owned recovery remain
309
+ * unlabeled.
310
+ */
311
+ export type StepStartStrategy = 'awaited' | 'optimistic' | 'batch_preclaimed';
312
+ export declare const StepStartStrategy: (value: StepStartStrategy) => {
313
+ [k: string]: StepStartStrategy;
314
+ };
297
315
  /** Whether the step was skipped during execution */
298
316
  export declare const StepSkipped: (value: boolean) => {
299
317
  [k: string]: boolean;
@@ -350,6 +368,14 @@ export declare const MessagingMessageId: (value: string & import("zod").$brand<"
350
368
  export declare const MessagingOperationType: (value: "publish" | "receive" | "process") => {
351
369
  [k: string]: "publish" | "receive" | "process";
352
370
  };
371
+ /**
372
+ * Messages carried by one batched publish (standard OTEL:
373
+ * messaging.batch.message_count). Set only on the batch send, so a span
374
+ * without it is a single-message publish.
375
+ */
376
+ export declare const MessagingBatchMessageCount: (value: number) => {
377
+ [k: string]: number;
378
+ };
353
379
  /** Time taken to enqueue the message in milliseconds (workflow-specific) */
354
380
  export declare const QueueOverheadMs: (value: number) => {
355
381
  [k: string]: number;
@@ -482,6 +508,16 @@ export declare const StepResilientDispatchRecovered: (value: number) => {
482
508
  export declare const StepResilientDispatchMaterialized: (value: boolean) => {
483
509
  [k: string]: boolean;
484
510
  };
511
+ /**
512
+ * How the queued-step consumer resolved the run identity for this execution:
513
+ * `run_context` — carried on the dispatch message, no `runs.get` before the
514
+ * step (the fetch-free prologue); `runs_get` — the legacy blocking fetch
515
+ * (message from an older producer). Distinguishes the two paths during
516
+ * version-skew windows and makes the saved round trip directly measurable.
517
+ */
518
+ export declare const StepDispatchPrologue: (value: "run_context" | "runs_get") => {
519
+ [k: string]: "run_context" | "runs_get";
520
+ };
485
521
  /** Total TTR: entry into `resumeHook()` → immediately before `stepFn.apply()`. */
486
522
  export declare const ResumeTotalMs: (value: number) => {
487
523
  [k: string]: number;
@@ -1,2 +1,2 @@
1
- export declare const version = "5.0.0-beta.50";
1
+ export declare const version = "5.0.0-beta.51";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- import{Dr as e,Er as t,Ir as n,Nr as r,Or as i,Pr as a,Rr as o,ar as s,or as c,t as l,xr as u}from"../../_chunks/workflow/attribute-changes-C6H-fRVP.js";import{i as d,u as f}from"../../_chunks/workflow/dist-xTushGCp.js";import{i as p}from"../../_chunks/workflow/workflow-routes-CwqB063q.js";import{t as m}from"../../_chunks/workflow/sleep-6cG0F99-.js";import{t as h}from"../../_chunks/workflow/run-BM2OFphk.js";c(s,h);function g(e){let n=globalThis[t];return n||a(`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 generated for you. 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}=o();return a.url=p(s,{type:`webhook`,token:a.token}),a}function v(){function e(t,r){n(`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(e,t={}){let n=l(e,t);if(n.length===0)return;let r=t.allowReservedAttributes===!0,a=globalThis[i];if(!a)throw new d("setAttributes() called outside a workflow runtime context. It must be called from within a workflow body (`use workflow`).");await a(n,r?{allowReservedAttributes:!0}:{})}function b(t={}){let{namespace:n}=t,r=globalThis[e](n);return Object.create(globalThis.WritableStream.prototype,{[u]:{value:r,writable:!1}})}function x(){r(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,x)}function S(){n(`resumeHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook`,S)}export{d as FatalError,f as RetryableError,g as createHook,_ as createWebhook,v as defineHook,x as getStepMetadata,o as getWorkflowMetadata,b as getWritable,S as resumeHook,y as setAttributes,m as sleep};
1
+ import{Br as e,Fr as t,Gr as n,Nr as r,Or as i,Pr as a,Ur as o,Vr as s,dr as c,fr as l,t as u}from"../../_chunks/workflow/attribute-changes-BAcgmlXp.js";import{i as d,u as f}from"../../_chunks/workflow/dist-xTushGCp.js";import{i as p}from"../../_chunks/workflow/workflow-routes-CwqB063q.js";import{t as m}from"../../_chunks/workflow/sleep-BB2HuVie.js";import{t as h}from"../../_chunks/workflow/run-ChHLjaCt.js";l(c,h);function g(e){let t=globalThis[r];return t||s(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,g),t(e)}function _(e){let{respondWith:t,token:r,...i}=e??{};if(r!==void 0)throw Error("`createWebhook()` does not accept a `token` option. Webhook tokens are always generated for you. Use `createHook()` with `resumeHook()` for deterministic token patterns.");let a;t!==void 0&&(a={respondWith:t});let o=g({...i,metadata:a,isWebhook:!0}),{url:s}=n();return o.url=p(s,{type:`webhook`,token:o.token}),o}function v(){function e(t,n){o(`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(e,n={}){let r=u(e,n);if(r.length===0)return;let i=n.allowReservedAttributes===!0,a=globalThis[t];if(!a)throw new d("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,n=globalThis[a](t);return Object.create(globalThis.WritableStream.prototype,{[i]:{value:n,writable:!1}})}function x(){e(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,x)}function S(){o(`resumeHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow-api/resume-hook`,S)}export{d as FatalError,f as RetryableError,g as createHook,_ as createWebhook,v as defineHook,x as getStepMetadata,n as getWorkflowMetadata,b as getWritable,S as resumeHook,y as setAttributes,m as sleep};
@@ -13,10 +13,10 @@ export declare const AnalyticsRunSchema: z.ZodObject<{
13
13
  workflowName: z.ZodString;
14
14
  specVersion: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
15
15
  attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
16
- createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
17
- updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
18
- startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
19
- completedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
16
+ createdAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
17
+ updatedAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
18
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
19
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
20
20
  errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
21
  workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
22
  workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -33,11 +33,11 @@ export declare const AnalyticsStepSchema: z.ZodObject<{
33
33
  cancelled: "cancelled";
34
34
  }>;
35
35
  attempt: z.ZodOptional<z.ZodNumber>;
36
- createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
37
- updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
38
- startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
39
- completedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
40
- retryAfter: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
36
+ createdAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
37
+ updatedAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
38
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
39
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
40
+ retryAfter: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
41
41
  errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
42
  workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
43
  workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -72,14 +72,14 @@ export declare const AnalyticsEventSchema: z.ZodObject<{
72
72
  workflowName: z.ZodString;
73
73
  deploymentId: z.ZodString;
74
74
  specVersion: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
75
- runCreatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
76
- createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
75
+ runCreatedAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
76
+ createdAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
77
77
  region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
78
  vercelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
79
  requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
80
  computeInstanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
- resumeAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
82
- retryAfter: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
81
+ resumeAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
82
+ retryAfter: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
83
83
  errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
84
  workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
85
  isWebhook: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -95,10 +95,10 @@ export declare const AnalyticsHookSchema: z.ZodObject<{
95
95
  disposed: "disposed";
96
96
  conflict: "conflict";
97
97
  }>;
98
- createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
99
- updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
100
- receivedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
101
- disposedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
98
+ createdAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
99
+ updatedAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
100
+ receivedAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
101
+ disposedAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
102
102
  isWebhook: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
103
103
  isSystem: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
104
104
  workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -111,18 +111,18 @@ export declare const AnalyticsWaitSchema: z.ZodObject<{
111
111
  completed: "completed";
112
112
  waiting: "waiting";
113
113
  }>;
114
- resumeAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
115
- createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
116
- updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
117
- completedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
114
+ resumeAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
115
+ createdAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
116
+ updatedAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
117
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>>>;
118
118
  workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
119
  workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
120
120
  }, z.core.$strip>;
121
121
  export declare const AnalyticsAttributeKeySchema: z.ZodObject<{
122
122
  key: z.ZodString;
123
123
  runCount: z.ZodCoercedNumber<unknown>;
124
- firstSeenAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
125
- lastSeenAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
124
+ firstSeenAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
125
+ lastSeenAt: z.ZodPreprocess<z.ZodCoercedDate<unknown>, unknown>;
126
126
  }, z.core.$strip>;
127
127
  export type AnalyticsRun = z.infer<typeof AnalyticsRunSchema>;
128
128
  export type AnalyticsStep = z.infer<typeof AnalyticsStepSchema>;
@@ -622,8 +622,10 @@ export interface CreateEventParams {
622
622
  /**
623
623
  * How many events the writer held in its loaded log when it decided to write
624
624
  * this one: equivalently, the slot it expects to land on minus one. Sent by
625
- * every replay-context create; omitted by callers with no loaded log to be
626
- * stale against.
625
+ * the replay loop and the suspension handler, which merge the report below
626
+ * back into their loaded log. Omitted by callers with no loaded log to be
627
+ * stale against, the step executor included: for those the report would be
628
+ * a read the World does for no one.
627
629
  *
628
630
  * A World's slots are dense and 1-based (see `Storage.events`), so a count
629
631
  * and a position are the same number. An id that is not a position does not
@@ -89,6 +89,25 @@ export declare const StepDispatchInputSchema: z.ZodObject<{
89
89
  input: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
90
90
  }, z.core.$strip>;
91
91
  export type StepDispatchInput = z.infer<typeof StepDispatchInputSchema>;
92
+ /**
93
+ * Immutable run identity carried on a step-execution message so the consumer
94
+ * can start the step without a blocking `runs.get` round trip. Every field is
95
+ * fixed for the life of a run (runs are pinned to their deployment), and the
96
+ * producer holds the run row at dispatch time, so the copy can never go
97
+ * stale. Run *status* is deliberately NOT carried: liveness is enforced by
98
+ * the `step_started` claim itself, which the World rejects on a terminal run.
99
+ *
100
+ * Consumers that need the full run row for inline replay
101
+ * still fetch it lazily; messages without this field (older producers) take
102
+ * the legacy `runs.get` prologue.
103
+ */
104
+ export declare const RunDispatchContextSchema: z.ZodObject<{
105
+ deploymentId: z.ZodString;
106
+ specVersion: z.ZodNumber;
107
+ startedAt: z.ZodOptional<z.ZodNumber>;
108
+ rootRunId: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strip>;
110
+ export type RunDispatchContext = z.infer<typeof RunDispatchContextSchema>;
92
111
  export declare const HookResumeInputSchema: z.ZodObject<{
93
112
  resumeId: z.ZodString;
94
113
  hookId: z.ZodString;
@@ -144,6 +163,7 @@ export declare const WorkflowInvokePayloadSchema: z.ZodObject<{
144
163
  replayDivergence: z.ZodOptional<z.ZodObject<{
145
164
  eventId: z.ZodString;
146
165
  count: z.ZodNumber;
166
+ eventIds: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
147
167
  }, z.core.$strip>>;
148
168
  preconditionReinvocations: z.ZodOptional<z.ZodNumber>;
149
169
  serverErrorRetryCount: z.ZodOptional<z.ZodNumber>;
@@ -175,6 +195,12 @@ export declare const WorkflowInvokePayloadSchema: z.ZodObject<{
175
195
  stepInput: z.ZodOptional<z.ZodObject<{
176
196
  input: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
177
197
  }, z.core.$strip>>;
198
+ runContext: z.ZodOptional<z.ZodObject<{
199
+ deploymentId: z.ZodString;
200
+ specVersion: z.ZodNumber;
201
+ startedAt: z.ZodOptional<z.ZodNumber>;
202
+ rootRunId: z.ZodOptional<z.ZodString>;
203
+ }, z.core.$strip>>;
178
204
  hookResumeTiming: z.ZodCatch<z.ZodOptional<z.ZodObject<{
179
205
  resumeRequestedAtMs: z.ZodNumber;
180
206
  queuePublishRequestedAtMs: z.ZodNumber;
@@ -224,6 +250,7 @@ export declare const QueuePayloadSchema: z.ZodUnion<readonly [z.ZodObject<{
224
250
  replayDivergence: z.ZodOptional<z.ZodObject<{
225
251
  eventId: z.ZodString;
226
252
  count: z.ZodNumber;
253
+ eventIds: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
227
254
  }, z.core.$strip>>;
228
255
  preconditionReinvocations: z.ZodOptional<z.ZodNumber>;
229
256
  serverErrorRetryCount: z.ZodOptional<z.ZodNumber>;
@@ -255,6 +282,12 @@ export declare const QueuePayloadSchema: z.ZodUnion<readonly [z.ZodObject<{
255
282
  stepInput: z.ZodOptional<z.ZodObject<{
256
283
  input: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
257
284
  }, z.core.$strip>>;
285
+ runContext: z.ZodOptional<z.ZodObject<{
286
+ deploymentId: z.ZodString;
287
+ specVersion: z.ZodNumber;
288
+ startedAt: z.ZodOptional<z.ZodNumber>;
289
+ rootRunId: z.ZodOptional<z.ZodString>;
290
+ }, z.core.$strip>>;
258
291
  hookResumeTiming: z.ZodCatch<z.ZodOptional<z.ZodObject<{
259
292
  resumeRequestedAtMs: z.ZodNumber;
260
293
  queuePublishRequestedAtMs: z.ZodNumber;
@@ -287,6 +320,23 @@ export interface QueueOptions {
287
320
  */
288
321
  region?: string;
289
322
  }
323
+ /**
324
+ * Outcome of one message in a {@link Queue.queueBatch} call, in input order.
325
+ *
326
+ * `messageId: null` with no `error` means accepted for deferred processing
327
+ * (the same "accepted, no ID yet" case {@link Queue.queue} reports), so
328
+ * `error === undefined` is the success test, not a non-null `messageId`.
329
+ */
330
+ export type QueueBatchResult = {
331
+ messageId: MessageId | null;
332
+ error?: undefined;
333
+ } | {
334
+ messageId: null;
335
+ /** Human-readable failure description for this message. */
336
+ error: string;
337
+ /** Republishing the batch may succeed. */
338
+ retryable: boolean;
339
+ };
290
340
  export interface Queue {
291
341
  getDeploymentId(): Promise<string>;
292
342
  /**
@@ -305,6 +355,40 @@ export interface Queue {
305
355
  queue(queueName: ValidQueueName, message: QueuePayload, opts?: QueueOptions): Promise<{
306
356
  messageId: MessageId | null;
307
357
  }>;
358
+ /**
359
+ * Enqueues several messages to the SAME logical queue in as few round trips
360
+ * as the backing transport allows. Optional: callers MUST fall back to
361
+ * per-message {@link Queue.queue} when a World does not implement it.
362
+ *
363
+ * Exists for wide fan-outs. Publishing an N-branch `Promise.all` one message
364
+ * at a time costs N round trips through a bounded connection pool, and that
365
+ * cost is paid before the fan-out's first step body runs, so it lands
366
+ * directly on time-to-first-step.
367
+ *
368
+ * Contract:
369
+ *
370
+ * - Results are returned in input order, one per input message. Returning
371
+ * a different number of results than there were messages is a contract
372
+ * violation the runtime rejects the whole batch on: an omitted result is
373
+ * indistinguishable from a message that was never published, and reading
374
+ * it as success would strand that step with no error anywhere.
375
+ * - Partial failure is normal. A rejected entry reports `error`; a
376
+ * `retryable` entry may succeed if the whole batch is published again.
377
+ * Implementations MUST NOT throw for a per-entry failure — reserve
378
+ * rejection for request-level failures where no entry outcome is known.
379
+ * - Callers are expected to pass `opts.idempotencyKey` per message, because
380
+ * the recovery for both a request-level failure and a retryable entry is
381
+ * to republish the batch: without keys that redelivers the entries that
382
+ * already succeeded.
383
+ * - Every message must target one logical `queueName`. Implementations are
384
+ * free to split the batch (by transport cap, or by any per-message routing
385
+ * dimension they derive from the payload, such as region or physical
386
+ * topic); the split must not be observable in the returned order.
387
+ */
388
+ queueBatch?(queueName: ValidQueueName, messages: readonly {
389
+ message: QueuePayload;
390
+ opts?: QueueOptions;
391
+ }[]): Promise<QueueBatchResult[]>;
308
392
  /**
309
393
  * Creates an HTTP queue handler for processing messages from a specific queue.
310
394
  * A rejected handler must retry the same message with an incremented attempt.