eve 0.48.0 → 0.49.0
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 +15 -0
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/types.d.ts +10 -0
- 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/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/slackChannel.d.ts +7 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/setup/flows/registry.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/guides/instrumentation.md +1 -1
- package/docs/install-integrations.mdx +2 -0
- package/docs/instructions.mdx +1 -1
- package/docs/memory/custom-provider.md +214 -0
- package/docs/memory/file.md +129 -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/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
|
@@ -4,7 +4,9 @@ import type { StartedWorkflowRun, WorkflowRun } from './runs.js';
|
|
|
4
4
|
import type { PaginationOptions, ResolveData } from './shared.js';
|
|
5
5
|
import type { StartedStep, Step } from './steps.js';
|
|
6
6
|
import type { Wait } from './waits.js';
|
|
7
|
+
export * from './event-metadata.js';
|
|
7
8
|
export declare const EventTypeSchema: z.ZodEnum<{
|
|
9
|
+
noop: "noop";
|
|
8
10
|
run_created: "run_created";
|
|
9
11
|
run_started: "run_started";
|
|
10
12
|
run_completed: "run_completed";
|
|
@@ -59,49 +61,6 @@ declare const TerminalStepEventTypeSchema: z.ZodEnum<{
|
|
|
59
61
|
export type TerminalStepEventType = z.infer<typeof TerminalStepEventTypeSchema>;
|
|
60
62
|
export declare const TERMINAL_STEP_EVENT_TYPES: ("step_completed" | "step_failed")[];
|
|
61
63
|
export declare function isTerminalStepEventType(eventType: string): eventType is TerminalStepEventType;
|
|
62
|
-
/**
|
|
63
|
-
* Groups event types into the classes a replay tracks per entity: the entity
|
|
64
|
-
* named by the event's `correlationId`, or the run itself for run events,
|
|
65
|
-
* which carry none.
|
|
66
|
-
*
|
|
67
|
-
* Types that share a class are the mutually exclusive outcomes of one
|
|
68
|
-
* decision, so the log records the class once and the first event of it is the
|
|
69
|
-
* one that counts: a step either completes or fails.
|
|
70
|
-
*
|
|
71
|
-
* Classes are independent of each other. A step whose result is in the log has
|
|
72
|
-
* still recorded exactly one `step_created`, and can still record another
|
|
73
|
-
* `step_started` if an attempt is running somewhere. What a class bounds is
|
|
74
|
-
* which events can be *ignored*: a replay may pass over an event whose class
|
|
75
|
-
* it already recorded for that entity and which no consumer wants (see
|
|
76
|
-
* `EventsConsumer`), and only then.
|
|
77
|
-
*
|
|
78
|
-
* Note the omissions, all of them types a mapping would be dead weight for.
|
|
79
|
-
* `hook_received` and `hook_conflict` are deliveries whose consumer subscribes
|
|
80
|
-
* lazily, `attr_set` is written on every attribute write, and `run_created`
|
|
81
|
-
* precedes every replay. The terminal run types are absent for a different
|
|
82
|
-
* reason: recording a class requires a consumer to take an event of it, and no
|
|
83
|
-
* consumer takes `run_completed` / `run_failed` / `run_cancelled` — the runtime
|
|
84
|
-
* exits before replaying the body once the log holds one, so they never reach a
|
|
85
|
-
* consumer at all. An entry for them could never match.
|
|
86
|
-
*/
|
|
87
|
-
declare const ENTITY_EVENT_CLASS_BY_TYPE: {
|
|
88
|
-
readonly step_created: "step_created";
|
|
89
|
-
readonly step_started: "step_started";
|
|
90
|
-
readonly step_retrying: "step_retrying";
|
|
91
|
-
readonly step_completed: "step_terminal";
|
|
92
|
-
readonly step_failed: "step_terminal";
|
|
93
|
-
readonly wait_created: "wait_created";
|
|
94
|
-
readonly wait_completed: "wait_completed";
|
|
95
|
-
readonly hook_created: "hook_created";
|
|
96
|
-
readonly hook_disposed: "hook_disposed";
|
|
97
|
-
readonly run_started: "run_started";
|
|
98
|
-
};
|
|
99
|
-
export type EntityEventClass = (typeof ENTITY_EVENT_CLASS_BY_TYPE)[keyof typeof ENTITY_EVENT_CLASS_BY_TYPE];
|
|
100
|
-
/**
|
|
101
|
-
* The per-entity class `eventType` belongs to, or `undefined` when it belongs
|
|
102
|
-
* to none. See {@link ENTITY_EVENT_CLASS_BY_TYPE}.
|
|
103
|
-
*/
|
|
104
|
-
export declare function entityEventClass(eventType: string): EntityEventClass | undefined;
|
|
105
64
|
declare const HookLifecycleEventTypeSchema: z.ZodEnum<{
|
|
106
65
|
hook_created: "hook_created";
|
|
107
66
|
hook_received: "hook_received";
|
|
@@ -132,33 +91,6 @@ declare const ChildEntityCreationEventTypeSchema: z.ZodEnum<{
|
|
|
132
91
|
export type ChildEntityCreationEventType = z.infer<typeof ChildEntityCreationEventTypeSchema>;
|
|
133
92
|
export declare const CHILD_ENTITY_CREATION_EVENT_TYPES: ("step_created" | "hook_created" | "wait_created")[];
|
|
134
93
|
export declare function isChildEntityCreationEventType(eventType: string): eventType is ChildEntityCreationEventType;
|
|
135
|
-
/**
|
|
136
|
-
* Field within eventData that carries the opaque user payload for event types
|
|
137
|
-
* that have one. V4 worlds split this field into the wire body while keeping
|
|
138
|
-
* the remaining eventData fields in metadata.
|
|
139
|
-
*/
|
|
140
|
-
export declare const EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE: {
|
|
141
|
-
readonly run_created: "input";
|
|
142
|
-
readonly run_started: "input";
|
|
143
|
-
readonly run_completed: "output";
|
|
144
|
-
readonly run_failed: "error";
|
|
145
|
-
readonly step_created: "input";
|
|
146
|
-
readonly step_started: "input";
|
|
147
|
-
readonly step_completed: "result";
|
|
148
|
-
readonly step_failed: "error";
|
|
149
|
-
readonly step_retrying: "error";
|
|
150
|
-
readonly hook_created: "metadata";
|
|
151
|
-
readonly hook_received: "payload";
|
|
152
|
-
};
|
|
153
|
-
export type EventDataPayloadField = (typeof EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE)[keyof typeof EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE];
|
|
154
|
-
/**
|
|
155
|
-
* Fields within eventData that hold ref/payload data per event type.
|
|
156
|
-
* When resolveData is 'none', only these fields are stripped — all other
|
|
157
|
-
* metadata (stepName, workflowName, etc.) is preserved.
|
|
158
|
-
*/
|
|
159
|
-
export declare const EVENT_DATA_REF_FIELDS: Record<string, readonly EventDataPayloadField[]>;
|
|
160
|
-
export declare function getEventDataRefFields(eventType: string): readonly string[];
|
|
161
|
-
export declare function getEventDataPayloadField(eventType: string): EventDataPayloadField | undefined;
|
|
162
94
|
/**
|
|
163
95
|
* Strip ref/payload fields from eventData based on resolveData setting.
|
|
164
96
|
* When resolveData is 'none', removes only large data fields (refs) from
|
|
@@ -167,6 +99,7 @@ export declare function getEventDataPayloadField(eventType: string): EventDataPa
|
|
|
167
99
|
export declare function stripEventDataRefs(event: Event, resolveData: ResolveData): Event;
|
|
168
100
|
export declare const BaseEventSchema: z.ZodObject<{
|
|
169
101
|
eventType: z.ZodEnum<{
|
|
102
|
+
noop: "noop";
|
|
170
103
|
run_created: "run_created";
|
|
171
104
|
run_started: "run_started";
|
|
172
105
|
run_completed: "run_completed";
|
|
@@ -303,7 +236,7 @@ export declare const CreateEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
303
236
|
eventData: z.ZodObject<{
|
|
304
237
|
changes: z.ZodArray<z.ZodObject<{
|
|
305
238
|
key: z.ZodString;
|
|
306
|
-
value: z.
|
|
239
|
+
value: z.ZodNullable<z.ZodString>;
|
|
307
240
|
}, z.core.$strip>>;
|
|
308
241
|
writer: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
309
242
|
type: z.ZodLiteral<"workflow">;
|
|
@@ -470,7 +403,7 @@ export declare const EventSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.Z
|
|
|
470
403
|
eventData: z.ZodObject<{
|
|
471
404
|
changes: z.ZodArray<z.ZodObject<{
|
|
472
405
|
key: z.ZodString;
|
|
473
|
-
value: z.
|
|
406
|
+
value: z.ZodNullable<z.ZodString>;
|
|
474
407
|
}, z.core.$strip>>;
|
|
475
408
|
writer: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
476
409
|
type: z.ZodLiteral<"workflow">;
|
|
@@ -589,6 +522,13 @@ export declare const EventSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.Z
|
|
|
589
522
|
eventData: z.ZodOptional<z.ZodObject<{
|
|
590
523
|
resumeAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
591
524
|
}, z.core.$strip>>;
|
|
525
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
526
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
527
|
+
specVersion: z.ZodOptional<z.ZodNumber>;
|
|
528
|
+
eventType: z.ZodLiteral<"noop">;
|
|
529
|
+
eventData: z.ZodOptional<z.ZodObject<{
|
|
530
|
+
sealed: z.ZodOptional<z.ZodBoolean>;
|
|
531
|
+
}, z.core.$loose>>;
|
|
592
532
|
}, z.core.$strip>], "eventType">, z.ZodObject<{
|
|
593
533
|
runId: z.ZodString;
|
|
594
534
|
eventId: z.ZodString;
|
|
@@ -652,7 +592,7 @@ export interface CreateEventParams {
|
|
|
652
592
|
resumePayloadDigest?: string;
|
|
653
593
|
/**
|
|
654
594
|
* Marks a `step_created` create as the queue consumer's re-ensure of a
|
|
655
|
-
* resilient step dispatch (a step message carrying `stepInput
|
|
595
|
+
* resilient step dispatch (a step message carrying `stepInput`, see
|
|
656
596
|
* `WorkflowInvokePayload.stepInput`): the producer's direct write was
|
|
657
597
|
* parallelized with the queue publish and may have failed. Only meaningful
|
|
658
598
|
* for `step_created`.
|
|
@@ -664,9 +604,9 @@ export interface CreateEventParams {
|
|
|
664
604
|
* this flag to narrow it: refuse the re-ensure (world-vercel surfaces the
|
|
665
605
|
* backend's 410 as `RunExpiredError`, which the consumer treats as "nothing
|
|
666
606
|
* left to execute" and acks the message) when it has recorded a refusal for
|
|
667
|
-
* this correlation id and no step entity exists. Best-effort by nature
|
|
607
|
+
* this correlation id and no step entity exists. Best-effort by nature (a
|
|
668
608
|
* marker written at refusal time cannot be ordered before the redelivery it
|
|
669
|
-
* is meant to stop
|
|
609
|
+
* is meant to stop), so it hardens, and does not close, the window. Worlds
|
|
670
610
|
* may ignore this flag entirely.
|
|
671
611
|
*/
|
|
672
612
|
viaStepDispatch?: boolean;
|
|
@@ -681,16 +621,16 @@ export interface CreateEventParams {
|
|
|
681
621
|
computeInstanceId?: string;
|
|
682
622
|
/**
|
|
683
623
|
* How many events the writer held in its loaded log when it decided to write
|
|
684
|
-
* this one
|
|
624
|
+
* this one: equivalently, the slot it expects to land on minus one. Sent by
|
|
685
625
|
* every replay-context create; omitted by callers with no loaded log to be
|
|
686
626
|
* stale against.
|
|
687
627
|
*
|
|
688
628
|
* A World's slots are dense and 1-based (see `Storage.events`), so a count
|
|
689
629
|
* and a position are the same number. An id that is not a position does not
|
|
690
|
-
* produce a count here
|
|
630
|
+
* produce a count here: it throws, since the runtime cannot state a
|
|
691
631
|
* snapshot for a log it cannot place. Such a World attempts
|
|
692
632
|
* `eventCount + 1`, and on contention **bumps** to the next free slot and
|
|
693
|
-
* commits there anyway
|
|
633
|
+
* commits there anyway: a stale count never rejects a write. What it does
|
|
694
634
|
* instead is report: when the committed slot is higher than the one asked
|
|
695
635
|
* for, the events occupying the skipped slots come back on the success
|
|
696
636
|
* response in {@link EventResult.events} / `cursor` / `hasMore`, so the
|
|
@@ -728,7 +668,7 @@ export interface CreateEventParams {
|
|
|
728
668
|
/**
|
|
729
669
|
* Inline-delta optimization (opt-in). When set, the World MAY return,
|
|
730
670
|
* on the resulting {@link EventResult}, the first page of events written
|
|
731
|
-
* strictly after this cursor (via `events`/`cursor`/`hasMore`)
|
|
671
|
+
* strictly after this cursor (via `events`/`cursor`/`hasMore`): the
|
|
732
672
|
* same page an `events.list({ cursor: sinceCursor, sortOrder: 'asc' })`
|
|
733
673
|
* call would return immediately after this write. Outside turbo mode the
|
|
734
674
|
* runtime sets this on every write it makes from the orchestrator loop
|
|
@@ -736,7 +676,7 @@ export interface CreateEventParams {
|
|
|
736
676
|
* carries the log forward and the loop reads it back for free: instead of
|
|
737
677
|
* re-reading its own just-written events (and any events interleaved
|
|
738
678
|
* in-band, such as `hook_received`), it consumes the authoritative delta
|
|
739
|
-
* the write already had to compute. Turbo mode does not set it
|
|
679
|
+
* the write already had to compute. Turbo mode does not set it: the
|
|
740
680
|
* point there is to keep the first invocation's writes as cheap as
|
|
741
681
|
* possible, and it has no loaded log to extend.
|
|
742
682
|
*
|
|
@@ -747,7 +687,7 @@ export interface CreateEventParams {
|
|
|
747
687
|
* `hasMore: true` rather than paginating to exhaustion. The runtime
|
|
748
688
|
* consumes that page and continues from its cursor, so it never reads the
|
|
749
689
|
* returned prefix again.
|
|
750
|
-
* Returning these fields at all is OPTIONAL
|
|
690
|
+
* Returning these fields at all is OPTIONAL: a World that omits them is
|
|
751
691
|
* fully supported; the runtime falls back to `events.list`. This
|
|
752
692
|
* preserves the same divergence guarantees as the fetch path because the
|
|
753
693
|
* delta is computed atomically against the same log the fetch would read.
|
|
@@ -759,7 +699,7 @@ export interface CreateEventParams {
|
|
|
759
699
|
* (`events`/`cursor`/`hasMore`) so the runtime can skip its initial
|
|
760
700
|
* `events.list`. The turbo first invocation backgrounds `run_started`
|
|
761
701
|
* purely as a write barrier and never reads that preload, so it sets this
|
|
762
|
-
* to tell the World to skip the wasted list+resolve
|
|
702
|
+
* to tell the World to skip the wasted list+resolve, trimming the
|
|
763
703
|
* `run_started` round-trip that the chained first `step_started` waits on.
|
|
764
704
|
* A World that ignores it (or doesn't preload) remains fully correct: the
|
|
765
705
|
* runtime falls back to `events.list` whenever it actually needs the log.
|
|
@@ -771,7 +711,7 @@ export interface CreateEventParams {
|
|
|
771
711
|
*/
|
|
772
712
|
skipPreload?: true;
|
|
773
713
|
/**
|
|
774
|
-
* Replay-log preload opt-in (advisory)
|
|
714
|
+
* Replay-log preload opt-in (advisory): the `hook_received` dual of
|
|
775
715
|
* {@link skipPreload}. Set only by the queue consumer's idempotent
|
|
776
716
|
* `hook_received` re-ensure on a lazy hook resume (alongside
|
|
777
717
|
* {@link resumeId} + {@link resumePayloadDigest}). A World MAY return the
|
|
@@ -781,15 +721,15 @@ export interface CreateEventParams {
|
|
|
781
721
|
* `run_started` write and the initial `events.list`.
|
|
782
722
|
*
|
|
783
723
|
* The runtime trusts a returned preload as replay input ONLY when all of
|
|
784
|
-
* the following hold
|
|
785
|
-
* its normal {@link EventResult} instead:
|
|
724
|
+
* the following hold (a World that cannot guarantee them should return
|
|
725
|
+
* its normal {@link EventResult} instead):
|
|
786
726
|
*
|
|
787
727
|
* - `events` is the COMPLETE log with `hasMore: false` (the runtime has no
|
|
788
728
|
* cursor-continuation machinery on this path; a bounded page is
|
|
789
729
|
* rejected).
|
|
790
730
|
* - `cursor` is a valid non-null resume point matching `events.list`
|
|
791
731
|
* semantics (present even on the final page).
|
|
792
|
-
* - `run` (with `run.startedAt`) and `maxEvents` are present
|
|
732
|
+
* - `run` (with `run.startedAt`) and `maxEvents` are present: this
|
|
793
733
|
* response plays `run_started`'s role, including the event-ceiling
|
|
794
734
|
* handshake.
|
|
795
735
|
* - The log contains `run_created`, `run_started`, and the canonical
|
|
@@ -800,12 +740,19 @@ export interface CreateEventParams {
|
|
|
800
740
|
* omitted from the replay input.
|
|
801
741
|
*
|
|
802
742
|
* Anything less and the runtime observes that no usable replay preload
|
|
803
|
-
* came back and falls back to the existing `run_started` setup
|
|
743
|
+
* came back and falls back to the existing `run_started` setup. A World
|
|
804
744
|
* that ignores the param entirely remains fully correct. Only meaningful
|
|
805
745
|
* for `hook_received`; ignored for other event types. Producer-side
|
|
806
746
|
* `resumeHook()` must not set it.
|
|
807
747
|
*/
|
|
808
748
|
preloadEvents?: true;
|
|
749
|
+
/**
|
|
750
|
+
* Synchronously observes each validated event in a streamed replay-log
|
|
751
|
+
* response. A retried request may observe the same event again; observers
|
|
752
|
+
* must therefore be idempotent. Throwing aborts the operation and the World
|
|
753
|
+
* must surface the original error without retrying or reclassifying it.
|
|
754
|
+
*/
|
|
755
|
+
replayEventObserver?: (event: Event) => void;
|
|
809
756
|
}
|
|
810
757
|
/**
|
|
811
758
|
* Result of creating an event. Includes the created event and optionally
|
|
@@ -829,7 +776,7 @@ export type EventResult<T extends EventType = EventType> = {
|
|
|
829
776
|
* step-creation data atomically *created* the step on this call (the
|
|
830
777
|
* caller won the create-claim), as opposed to transitioning a step that
|
|
831
778
|
* already existed. The owned-inline runtime path uses this as the
|
|
832
|
-
* exactly-once ownership signal
|
|
779
|
+
* exactly-once ownership signal: it runs the step body inline only when
|
|
833
780
|
* it created the step, so a concurrent handler that lost the create race
|
|
834
781
|
* (and gets `EntityConflictError`/skipped) never double-executes. Absent
|
|
835
782
|
* (undefined) on the legacy path and from older servers/worlds, which is
|
|
@@ -856,7 +803,7 @@ export type EventResult<T extends EventType = EventType> = {
|
|
|
856
803
|
* - On any response whose committed slot came out higher than the one
|
|
857
804
|
* {@link CreateEventParams.eventCount} asked for:
|
|
858
805
|
* the events occupying the slots that were skipped over, in slot
|
|
859
|
-
* order. This is the "report" half of bump-and-report
|
|
806
|
+
* order. This is the "report" half of bump-and-report: the write
|
|
860
807
|
* succeeded, and these are the events the writer had not seen when it
|
|
861
808
|
* decided to make it.
|
|
862
809
|
*/
|
|
@@ -878,7 +825,7 @@ export type EventResult<T extends EventType = EventType> = {
|
|
|
878
825
|
} : unknown);
|
|
879
826
|
/**
|
|
880
827
|
* One event of a batch write ({@link Storage.events.createBatch}), in request
|
|
881
|
-
* order
|
|
828
|
+
* order, which is the order the events land in the run's log.
|
|
882
829
|
*/
|
|
883
830
|
export interface BatchEventRequest {
|
|
884
831
|
/** The event, same discriminated union the single `create` takes. */
|
|
@@ -886,7 +833,7 @@ export interface BatchEventRequest {
|
|
|
886
833
|
/**
|
|
887
834
|
* Client event time for this event. Under slot identity this is the source
|
|
888
835
|
* of the durable event's `createdAt` (a slot id carries no time), so the
|
|
889
|
-
* timestamp a replay observes is the one the writer chose
|
|
836
|
+
* timestamp a replay observes is the one the writer chose: set it to the
|
|
890
837
|
* instant the event logically occurred.
|
|
891
838
|
*/
|
|
892
839
|
occurredAt?: Date;
|
|
@@ -922,7 +869,7 @@ export interface CreateEventBatchParams {
|
|
|
922
869
|
* - rejection → the status code and error code the single create would have
|
|
923
870
|
* failed with, so callers reuse their single-path conflict handling per
|
|
924
871
|
* event. A `409`/`conflict` means the entity was not in the prior state
|
|
925
|
-
* the event requires
|
|
872
|
+
* the event requires, most commonly because an earlier delivery already
|
|
926
873
|
* applied the same event, but possibly because the entity reached a
|
|
927
874
|
* DIFFERENT state (e.g. `step_completed` conflicting because the step
|
|
928
875
|
* failed). A 409 alone does not prove the equivalent effect was applied;
|
|
@@ -934,10 +881,10 @@ export interface CreateEventBatchParams {
|
|
|
934
881
|
* can return a mix of 200s and 409s from one call.
|
|
935
882
|
*
|
|
936
883
|
* Retry semantics: a transport retry of a committed batch converges to
|
|
937
|
-
* per-event 409s ONLY for entity-conditioned events
|
|
884
|
+
* per-event 409s ONLY for entity-conditioned events: creates and terminal
|
|
938
885
|
* transitions. A standalone bare `step_started` or a `step_retrying`
|
|
939
886
|
* re-patches its step on every attempt and does NOT converge, and
|
|
940
|
-
* `hook_received` appends a new row per attempt
|
|
887
|
+
* `hook_received` appends a new row per attempt, so `world-vercel` rejects
|
|
941
888
|
* `hook_received` in a batch outright and only auto-retries batches whose
|
|
942
889
|
* every event is retry-convergent.
|
|
943
890
|
*
|
|
@@ -988,12 +935,11 @@ export interface ListEventsByCorrelationIdParams {
|
|
|
988
935
|
* run, not globally: a slot-numbered run counts its own steps and waits, so
|
|
989
936
|
* `step_…001` names the first step of *every* such run. Naming the run is
|
|
990
937
|
* what makes the answer that run's events, and it is what makes the
|
|
991
|
-
* pagination cursor unambiguous
|
|
938
|
+
* pagination cursor unambiguous: `(runId, eventId)` is a key where an
|
|
992
939
|
* event id alone is not.
|
|
993
940
|
*/
|
|
994
941
|
runId: string;
|
|
995
942
|
pagination?: PaginationOptions;
|
|
996
943
|
resolveData?: ResolveData;
|
|
997
944
|
}
|
|
998
|
-
export {};
|
|
999
945
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -2,14 +2,14 @@ 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
4
|
/**
|
|
5
|
-
* Minimal, immutable slice of a hook's owning run needed to resume it
|
|
5
|
+
* Minimal, immutable slice of a hook's owning run needed to resume it:
|
|
6
6
|
* enough for encryption-key resolution, serialization/compression capability
|
|
7
7
|
* selection, queue routing, and trace linking, without fetching the full run.
|
|
8
8
|
*
|
|
9
9
|
* Persisted on new hook records (workflow-server) and also returned inline by
|
|
10
10
|
* `getByToken`, so a resume can skip the separate `runs.get`. Deliberately
|
|
11
11
|
* excludes the run's mutable state (e.g. status), inputs/outputs, attributes,
|
|
12
|
-
* and any secret
|
|
12
|
+
* and any secret: only fields that are fixed at hook-creation time.
|
|
13
13
|
*/
|
|
14
14
|
export declare const HookResumeContextSchema: z.ZodObject<{
|
|
15
15
|
deploymentId: z.ZodString;
|
|
@@ -26,17 +26,18 @@ export type HookResumeContext = z.infer<typeof HookResumeContextSchema>;
|
|
|
26
26
|
* deployment stamps this into its execution context (and the server mirrors it
|
|
27
27
|
* onto `HookResumeContext.hookResumeInputVersion`) to attest that its
|
|
28
28
|
* `@workflow/core` re-ensures the `hook_received` event from a queue message's
|
|
29
|
-
* `hookInput`.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* `hookInput`. Current producers write the event durably BEFORE publishing the
|
|
30
|
+
* wake and do not read this marker; it exists for older producers whose lazy
|
|
31
|
+
* path requires the target run's marker to be at least this value. Bump only
|
|
32
|
+
* on a breaking change to the `hookInput` re-ensure contract.
|
|
32
33
|
*/
|
|
33
34
|
export declare const HOOK_RESUME_INPUT_VERSION = 1;
|
|
34
35
|
/**
|
|
35
36
|
* Current version of the backend lazy-hook-resume dedup contract: the live
|
|
36
|
-
* backend enforces a `(runId, resumeId)` constraint so
|
|
37
|
-
*
|
|
38
|
-
* `resumeHook()`'s
|
|
39
|
-
*
|
|
37
|
+
* backend enforces a `(runId, resumeId)` constraint so repeated deliveries of
|
|
38
|
+
* one resume's queue message converge on exactly one `hook_received`.
|
|
39
|
+
* `resumeHook()`'s lazy path requires the backend to attest at least this
|
|
40
|
+
* version. Bump only on a breaking change to the constraint semantics.
|
|
40
41
|
*/
|
|
41
42
|
export declare const HOOK_RESUME_DEDUP_VERSION = 1;
|
|
42
43
|
/**
|
|
@@ -45,8 +46,8 @@ export declare const HOOK_RESUME_DEDUP_VERSION = 1;
|
|
|
45
46
|
*
|
|
46
47
|
* Response-only and transient: NEVER persisted on the hook entity and NEVER
|
|
47
48
|
* part of {@link HookResumeContextSchema}. Recomputing it per response is what
|
|
48
|
-
* makes a server rollback or kill switch take effect immediately
|
|
49
|
-
* or kill-switched server
|
|
49
|
+
* makes a server rollback or kill switch take effect immediately: a rolled-back
|
|
50
|
+
* or kill-switched server stops emitting it, dropping new resumes to the
|
|
50
51
|
* sequential path with no stranded hooks. (Contrast with the per-run, persisted
|
|
51
52
|
* `hookResumeInputVersion`, which attests the *consumer* and is fixed at run
|
|
52
53
|
* creation.)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type * from './analytics.js';
|
|
2
2
|
export { ANALYTICS_EVENTS_GET_MANY_LIMIT, AnalyticsAttributeKeySchema, AnalyticsEventSchema, AnalyticsHookSchema, AnalyticsRunSchema, AnalyticsStepSchema, AnalyticsWaitSchema, } from './analytics.js';
|
|
3
3
|
export type * from './attributes.js';
|
|
4
|
-
export { ATTRIBUTE_KEY_MAX_LENGTH, ATTRIBUTE_MAX_PER_RUN, ATTRIBUTE_VALUE_MAX_BYTES, AttributeChangeSchema, AttributeChangesSchema, AttributeValidationError, applyAttributeChanges, PARENT_RUN_ID_ATTRIBUTE, RESERVED_ATTRIBUTE_KEY_PREFIX, ROOT_RUN_ID_ATTRIBUTE, validateAttributeChanges,
|
|
4
|
+
export { ATTRIBUTE_KEY_MAX_LENGTH, ATTRIBUTE_MAX_PER_RUN, ATTRIBUTE_VALUE_MAX_BYTES, AttributeChangeSchema, AttributeChangesSchema, AttributeKeySchema, AttributeValidationError, AttributeValueSchema, applyAttributeChanges, PARENT_RUN_ID_ATTRIBUTE, RESERVED_ATTRIBUTE_KEY_PREFIX, ROOT_RUN_ID_ATTRIBUTE, validateAttributeChanges, } from './attributes.js';
|
|
5
5
|
export { _resetEnvWarnCacheForTests, type EnvNumberOptions, envFlag, envNumber, getMaxEventsPerRun, } from './env-config.js';
|
|
6
6
|
export type * from './events.js';
|
|
7
|
-
export { BaseEventSchema, CHILD_ENTITY_CREATION_EVENT_TYPES, CreateEventSchema,
|
|
7
|
+
export { BaseEventSchema, CHILD_ENTITY_CREATION_EVENT_TYPES, CreateEventSchema, classifyEntityEvent, EventSchema, EventTypeSchema, entityEventClass, getEventDataPayloadField, getEventDataRefFields, HOOK_EVENTS_REQUIRING_EXISTENCE, HOOK_LIFECYCLE_EVENT_TYPES, HookCreatedEventSchema, isChildEntityCreationEvent, isChildEntityCreationEventType, isHookEventRequiringExistence, isHookLifecycleEventType, isRunEventType, isSealedNoopEvent, isStepEventType, isTerminalRunEventType, isTerminalStepEventType, isWaitEventType, RUN_ENTITY_KEY, RUN_EVENT_TYPES, STEP_EVENT_TYPES, stripEventDataRefs, TERMINAL_EVENT_CLASSES, TERMINAL_RUN_EVENT_TYPES, TERMINAL_STEP_EVENT_TYPES, TerminalRunEventTypeSchema, WAIT_EVENT_TYPES, } from './events.js';
|
|
8
8
|
export type * from './hooks.js';
|
|
9
9
|
export { HOOK_RESUME_DEDUP_VERSION, HOOK_RESUME_INPUT_VERSION, HookResumeCapabilitiesSchema, HookSchema, } from './hooks.js';
|
|
10
10
|
export type * from './interfaces.js';
|
|
@@ -21,7 +21,7 @@ export type { GetChunksOptions, StreamChunk, StreamChunksResponse, StreamInfoRes
|
|
|
21
21
|
export { PaginatedResponseSchema, StructuredErrorSchema, } from './shared.js';
|
|
22
22
|
export { EVENT_ID_BODY_LENGTH, EVENT_ID_PREFIX, eventIdToSlot, FIRST_EVENT_SLOT, isSlotBody, isSlotEventId, MAX_EVENT_SLOT, requireEventSlot, slotToEventId, } from './slot-identity.js';
|
|
23
23
|
export type { SpecVersion } from './spec-version.js';
|
|
24
|
-
export { isLegacySpecVersion, requiresNewerWorld, SPEC_VERSION_CURRENT, SPEC_VERSION_LEGACY, SPEC_VERSION_MAX_SUPPORTED, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_SUPPORTS_EVENT_SOURCING, SPEC_VERSION_SUPPORTS_SLOT_IDENTITY, } from './spec-version.js';
|
|
24
|
+
export { isLegacySpecVersion, mintedSpecVersion, requiresNewerWorld, SEALED_LOG_ENV_VAR, SPEC_VERSION_CURRENT, SPEC_VERSION_LEGACY, SPEC_VERSION_MAX_SUPPORTED, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_SUPPORTS_EVENT_SOURCING, SPEC_VERSION_SUPPORTS_SEALED_LOG, SPEC_VERSION_SUPPORTS_SLOT_IDENTITY, } from './spec-version.js';
|
|
25
25
|
export type * from './steps.js';
|
|
26
26
|
export { isTerminalStepStatus, StepSchema, StepStatusSchema, TERMINAL_STEP_STATUSES, TerminalStepStatusSchema, } from './steps.js';
|
|
27
27
|
export type { WorkflowRunId } from './ulid.js';
|