eve 0.38.0 → 0.38.2

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 (120) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/src/cli/commands/registry.js +1 -1
  3. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  4. package/dist/src/compiled/.vendor-stamp.json +5 -5
  5. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +97 -0
  6. package/dist/src/compiled/@workflow/core/index.js +2 -2
  7. package/dist/src/compiled/@workflow/core/private.js +1 -1
  8. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +35 -0
  9. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +127 -93
  10. package/dist/src/compiled/@workflow/core/runtime/quickjs-entrypoint.d.ts +8 -9
  11. package/dist/src/compiled/@workflow/core/runtime/replay-budget.d.ts +8 -0
  12. package/dist/src/compiled/@workflow/core/runtime/resume-latency.d.ts +143 -0
  13. package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +27 -12
  14. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +39 -8
  15. package/dist/src/compiled/@workflow/core/runtime/world-compatibility.d.ts +6 -5
  16. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  17. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +81 -0
  18. package/dist/src/compiled/@workflow/core/test-support/orchestrator-context.d.ts +25 -0
  19. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  20. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  21. package/dist/src/compiled/@workflow/errors/index.d.ts +18 -2
  22. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  23. package/dist/src/compiled/@workflow/world/analytics.d.ts +9 -0
  24. package/dist/src/compiled/@workflow/world/events.d.ts +76 -87
  25. package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
  26. package/dist/src/compiled/@workflow/world/interfaces.d.ts +45 -45
  27. package/dist/src/compiled/@workflow/world/queue.d.ts +86 -0
  28. package/dist/src/compiled/@workflow/world/slot-identity.d.ts +15 -0
  29. package/dist/src/compiled/@workflow/world/spec-version.d.ts +30 -18
  30. package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +41 -0
  31. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  32. package/dist/src/compiled/@workflow/world-vercel/index.js +12 -12
  33. package/dist/src/compiled/_chunks/workflow/{attribute-changes-DZtQkszH.js → attribute-changes-B8K0pwpH.js} +1 -1
  34. package/dist/src/compiled/_chunks/workflow/{dist-CPlyFOVo.js → dist-BRGbNjhD.js} +1 -1
  35. package/dist/src/compiled/_chunks/workflow/{dist-xQXN70ED.js → dist-CqvWKNQv.js} +1 -1
  36. package/dist/src/compiled/_chunks/workflow/frames-DoexhtxJ.js +3 -0
  37. package/dist/src/compiled/_chunks/workflow/private-z_2Kcwee.js +1 -0
  38. package/dist/src/compiled/_chunks/workflow/resume-hook-DO_MuJlY.js +1 -0
  39. package/dist/src/compiled/_chunks/workflow/run-lq7-eG0l.js +1 -0
  40. package/dist/src/compiled/_chunks/workflow/sleep-7TgF3i-e.js +1 -0
  41. package/dist/src/compiled/_chunks/workflow/wait-until-BPSgt1Wg.js +15 -0
  42. package/dist/src/compiled/_chunks/workflow/ws-transport-TYZ9zwoZ.js +1 -0
  43. package/dist/src/compiler/extension-compatibility.d.ts +5 -0
  44. package/dist/src/compiler/extension-compatibility.js +1 -1
  45. package/dist/src/compiler/model-catalog.js +1 -1
  46. package/dist/src/compiler/normalize-agent-config.js +1 -1
  47. package/dist/src/compiler/normalize-extension.d.ts +10 -1
  48. package/dist/src/compiler/normalize-extension.js +1 -1
  49. package/dist/src/compiler/normalize-manifest.js +1 -1
  50. package/dist/src/compiler/normalize-subagent.d.ts +1 -0
  51. package/dist/src/compiler/normalize-subagent.js +1 -1
  52. package/dist/src/discover/discover-agent.js +1 -1
  53. package/dist/src/discover/discover-subagent.js +1 -1
  54. package/dist/src/execution/create-session-step.d.ts +1 -0
  55. package/dist/src/execution/create-session-step.js +1 -1
  56. package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +1 -1
  57. package/dist/src/execution/node-step.js +1 -1
  58. package/dist/src/execution/session-callback-step.d.ts +8 -0
  59. package/dist/src/execution/session-callback-step.js +1 -1
  60. package/dist/src/execution/session.d.ts +2 -0
  61. package/dist/src/execution/session.js +1 -1
  62. package/dist/src/execution/task-event-callback.d.ts +5 -6
  63. package/dist/src/execution/task-event-callback.js +1 -1
  64. package/dist/src/execution/tasks/child/instructions.d.ts +3 -0
  65. package/dist/src/execution/tasks/child/instructions.js +1 -0
  66. package/dist/src/execution/tasks/child/steps.d.ts +7 -1
  67. package/dist/src/execution/tasks/child/steps.js +1 -1
  68. package/dist/src/execution/tasks/child/update.d.ts +10 -0
  69. package/dist/src/execution/tasks/child/update.js +1 -0
  70. package/dist/src/execution/tasks/child/workflow.d.ts +3 -3
  71. package/dist/src/execution/tasks/child/workflow.js +1 -1
  72. package/dist/src/execution/tasks/parent/agent-views.js +1 -1
  73. package/dist/src/execution/tasks/parent/control-shared.d.ts +1 -1
  74. package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +1 -1
  75. package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -1
  76. package/dist/src/execution/tasks/parent/dispatch.d.ts +5 -3
  77. package/dist/src/execution/tasks/parent/dispatch.js +1 -1
  78. package/dist/src/execution/workflow-entry.js +1 -1
  79. package/dist/src/execution/workflow-steps.js +1 -1
  80. package/dist/src/harness/advertised-tools.d.ts +3 -0
  81. package/dist/src/harness/advertised-tools.js +1 -1
  82. package/dist/src/harness/tool-loop.js +2 -2
  83. package/dist/src/internal/application/package.js +1 -1
  84. package/dist/src/internal/authored-module-map-loader.js +1 -1
  85. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  86. package/dist/src/internal/workflow/development-world-client.js +1 -1
  87. package/dist/src/public/channels/mcp.d.ts +2 -2
  88. package/dist/src/public/channels/mcp.js +1 -1
  89. package/dist/src/runtime/framework-tools/index.js +1 -1
  90. package/dist/src/runtime/framework-tools/tasks.d.ts +6 -7
  91. package/dist/src/runtime/framework-tools/tasks.js +1 -1
  92. package/dist/src/runtime/prompt/compose.js +1 -1
  93. package/dist/src/runtime/session-callback-route.js +1 -1
  94. package/dist/src/setup/scaffold/create/extension.js +1 -1
  95. package/dist/src/setup/scaffold/create/project.js +1 -1
  96. package/dist/src/tasks/task-id.d.ts +1 -2
  97. package/dist/src/tasks/task-id.js +1 -1
  98. package/dist/src/tasks/task-inbox-token.d.ts +2 -0
  99. package/dist/src/tasks/task-inbox-token.js +1 -0
  100. package/dist/src/tasks/types.d.ts +9 -1
  101. package/dist/src/tasks/wire.d.ts +2 -3
  102. package/docs/channels/custom.mdx +1 -0
  103. package/docs/channels/mcp.mdx +185 -0
  104. package/docs/channels/meta.json +1 -0
  105. package/docs/channels/overview.mdx +6 -1
  106. package/docs/extensions.md +14 -6
  107. package/docs/guides/auth-and-route-protection.md +1 -0
  108. package/docs/guides/dev-tui.md +1 -0
  109. package/docs/instructions.mdx +1 -0
  110. package/docs/subagents/index.mdx +3 -1
  111. package/package.json +6 -6
  112. package/dist/src/compiled/_chunks/workflow/frames-BBs-9k1d.js +0 -3
  113. package/dist/src/compiled/_chunks/workflow/private-UQtz8ZcW.js +0 -1
  114. package/dist/src/compiled/_chunks/workflow/resume-hook-CYtSorp6.js +0 -1
  115. package/dist/src/compiled/_chunks/workflow/run-Cjo0A3NO.js +0 -1
  116. package/dist/src/compiled/_chunks/workflow/sleep-C1P0OWBm.js +0 -1
  117. package/dist/src/compiled/_chunks/workflow/wait-until-CT1ve8qB.js +0 -15
  118. package/dist/src/compiled/_chunks/workflow/ws-transport-beXxD0s_.js +0 -1
  119. package/dist/src/execution/tasks/parent/send.d.ts +0 -25
  120. package/dist/src/execution/tasks/parent/send.js +0 -1
@@ -67,6 +67,29 @@ export type RunInput = z.infer<typeof RunInputSchema>;
67
67
  * `events.create`, so both server receipts hash to the same digest under the
68
68
  * `(runId, resumeId)` constraint.
69
69
  */
70
+ /**
71
+ * Resilient step dispatch data carried through the queue alongside a
72
+ * step-execution message ({@link WorkflowInvokePayload.stepId}). Present when
73
+ * the producer (the suspension handler dispatching a newly created step)
74
+ * parallelized the `step_created` event write with the queue publish — the
75
+ * same shape as resilient start (`runInput`) and the resilient hook resume
76
+ * (`hookInput`).
77
+ *
78
+ * When the producer's `step_created` write fails transiently (429 / 5xx /
79
+ * transport), the step entity may not exist when this message is consumed. A
80
+ * consumer that understands `stepInput` idempotently re-ensures the
81
+ * `step_created` event — keyed by the message's `stepId` (the step's
82
+ * correlation id, unique per `(runId, correlationId)`) — before executing, so
83
+ * the producer's write and the consumer's re-ensure converge on exactly one
84
+ * event.
85
+ *
86
+ * The `input` is the already-serialized (and possibly encrypted) step input —
87
+ * the identical bytes the producer also sent on the direct `events.create`.
88
+ */
89
+ export declare const StepDispatchInputSchema: z.ZodObject<{
90
+ input: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
91
+ }, z.core.$strip>;
92
+ export type StepDispatchInput = z.infer<typeof StepDispatchInputSchema>;
70
93
  export declare const HookResumeInputSchema: z.ZodObject<{
71
94
  resumeId: z.ZodString;
72
95
  hookId: z.ZodString;
@@ -76,6 +99,45 @@ export declare const HookResumeInputSchema: z.ZodObject<{
76
99
  deploymentId: z.ZodOptional<z.ZodString>;
77
100
  }, z.core.$strip>;
78
101
  export type HookResumeInput = z.infer<typeof HookResumeInputSchema>;
102
+ /**
103
+ * Wall-clock boundaries of a hook-triggered resume, carried on the queue
104
+ * message so the SDK can report end-to-end time-to-resume (TTR) — entry into
105
+ * `resumeHook()` through to the first line of the next durable step — and its
106
+ * non-overlapping phase breakdown, as span attributes on that step's
107
+ * `step.execute` span. See `runtime/resume-latency.ts` in `@workflow/core`.
108
+ *
109
+ * Two groups of fields:
110
+ *
111
+ * - Producer fields (`resumeRequestedAtMs`, `queuePublishRequestedAtMs`,
112
+ * `strategy`) are stamped by `resumeHook()` on the invocation message. They
113
+ * ride along on a deployment-affinity re-route unchanged, so a misrouted
114
+ * delivery's extra hop stays inside `queue_delivery`.
115
+ * - Consumer fields (`consumerStartedAtMs`, `replayStartedAtMs`,
116
+ * `nextStepEncounteredAtMs`, `setupSource`) are filled in by the invocation
117
+ * that replayed the resume, and ONLY when it dispatches the next durable
118
+ * step to a separate queue invocation instead of running it inline. They let
119
+ * that invocation report the same single TTR measurement.
120
+ *
121
+ * Every field is advisory and the whole object is optional, in all three
122
+ * directions that matter for a rolling deploy: a new producer's timing is
123
+ * ignored by an old consumer, a new consumer simply reports no TTR for an old
124
+ * message, and workflow-server never reads it at all.
125
+ *
126
+ * `strategy` and `setupSource` are deliberately typed as plain strings rather
127
+ * than enums: an unrecognized value from a newer producer must not fail the
128
+ * parse of the whole invocation payload (which would wedge the run) — it is
129
+ * only ever forwarded to a span attribute.
130
+ */
131
+ export declare const HookResumeTimingSchema: z.ZodObject<{
132
+ resumeRequestedAtMs: z.ZodNumber;
133
+ queuePublishRequestedAtMs: z.ZodNumber;
134
+ strategy: z.ZodOptional<z.ZodString>;
135
+ consumerStartedAtMs: z.ZodOptional<z.ZodNumber>;
136
+ replayStartedAtMs: z.ZodOptional<z.ZodNumber>;
137
+ nextStepEncounteredAtMs: z.ZodOptional<z.ZodNumber>;
138
+ setupSource: z.ZodOptional<z.ZodString>;
139
+ }, z.core.$strip>;
140
+ export type HookResumeTiming = z.infer<typeof HookResumeTimingSchema>;
79
141
  export declare const WorkflowInvokePayloadSchema: z.ZodObject<{
80
142
  runId: z.ZodString;
81
143
  traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -107,6 +169,18 @@ export declare const WorkflowInvokePayloadSchema: z.ZodObject<{
107
169
  payloadDigest: z.ZodString;
108
170
  deploymentId: z.ZodOptional<z.ZodString>;
109
171
  }, z.core.$strip>>;
172
+ stepInput: z.ZodOptional<z.ZodObject<{
173
+ input: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
174
+ }, z.core.$strip>>;
175
+ hookResumeTiming: z.ZodCatch<z.ZodOptional<z.ZodObject<{
176
+ resumeRequestedAtMs: z.ZodNumber;
177
+ queuePublishRequestedAtMs: z.ZodNumber;
178
+ strategy: z.ZodOptional<z.ZodString>;
179
+ consumerStartedAtMs: z.ZodOptional<z.ZodNumber>;
180
+ replayStartedAtMs: z.ZodOptional<z.ZodNumber>;
181
+ nextStepEncounteredAtMs: z.ZodOptional<z.ZodNumber>;
182
+ setupSource: z.ZodOptional<z.ZodString>;
183
+ }, z.core.$strip>>>;
110
184
  }, z.core.$strip>;
111
185
  export type WorkflowInvokePayload = z.infer<typeof WorkflowInvokePayloadSchema>;
112
186
  export type HealthCheckPayload = z.infer<typeof HealthCheckPayloadSchema>;
@@ -171,6 +245,18 @@ export declare const QueuePayloadSchema: z.ZodUnion<readonly [z.ZodObject<{
171
245
  payloadDigest: z.ZodString;
172
246
  deploymentId: z.ZodOptional<z.ZodString>;
173
247
  }, z.core.$strip>>;
248
+ stepInput: z.ZodOptional<z.ZodObject<{
249
+ input: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
250
+ }, z.core.$strip>>;
251
+ hookResumeTiming: z.ZodCatch<z.ZodOptional<z.ZodObject<{
252
+ resumeRequestedAtMs: z.ZodNumber;
253
+ queuePublishRequestedAtMs: z.ZodNumber;
254
+ strategy: z.ZodOptional<z.ZodString>;
255
+ consumerStartedAtMs: z.ZodOptional<z.ZodNumber>;
256
+ replayStartedAtMs: z.ZodOptional<z.ZodNumber>;
257
+ nextStepEncounteredAtMs: z.ZodOptional<z.ZodNumber>;
258
+ setupSource: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strip>>>;
174
260
  }, z.core.$strip>]>;
175
261
  export type QueuePayload = z.infer<typeof QueuePayloadSchema>;
176
262
  export interface QueueOptions {
@@ -50,4 +50,19 @@ export declare function slotToEventId(slot: number): string;
50
50
  * not slot-numbered.
51
51
  */
52
52
  export declare function eventIdToSlot(eventId: string): number | null;
53
+ /**
54
+ * Reads the slot out of an event id, for a caller that has no answer without
55
+ * one.
56
+ *
57
+ * Separate from {@link eventIdToSlot} because the two failures are different
58
+ * problems. A caller that can act on either scheme asks the question and takes
59
+ * `null` as an answer; a caller whose whole computation is positional (a
60
+ * precondition snapshot, a density audit) has no correct behaviour to fall back
61
+ * on, and silently skipping the id would make it report a position it never
62
+ * verified. Throwing names the id instead.
63
+ *
64
+ * @throws if the id is not slot-numbered, i.e. the World minting it does not
65
+ * allocate slots.
66
+ */
67
+ export declare function requireEventSlot(eventId: string): number;
53
68
  //# sourceMappingURL=slot-identity.d.ts.map
@@ -37,33 +37,45 @@ export declare const SPEC_VERSION_SUPPORTS_COMPRESSION: SpecVersion;
37
37
  * and the spec version stamped on `run_created` is what carries it. A run
38
38
  * created before the backend adopted slots stays on ULIDs for its whole life
39
39
  * because its stamped version is below this one.
40
+ *
41
+ * Slots are no longer optional for a World: the runtime reads a position out
42
+ * of every event id it loads (`requireEventSlot`) and fails the run if it
43
+ * cannot. That makes this version the lowest one this runtime can serve at
44
+ * all. See `SPEC_VERSION_CURRENT`.
40
45
  */
41
46
  export declare const SPEC_VERSION_SUPPORTS_SLOT_IDENTITY: SpecVersion;
42
47
  /**
43
- * Current spec version (event-sourced architecture with native attributes
44
- * and compressed payloads).
48
+ * Current spec version: event-sourced architecture with native attributes,
49
+ * compressed payloads and slot-numbered event ids.
50
+ *
51
+ * This is both the version a World stamps on the runs it creates and the
52
+ * *lowest* one this runtime accepts from a World (see
53
+ * `assertWorldSupportsRuntimeProtocol`). The two coincide because slot
54
+ * numbering is a requirement of the World contract rather than a capability to
55
+ * opt into: a World declaring anything below this allocates event ids the
56
+ * runtime cannot read positions out of, so admitting it would only move the
57
+ * failure from startup to the middle of a run.
58
+ *
59
+ * A World therefore declares this constant rather than a literal, so a bump
60
+ * moves the declaration and the floor together. Pinning a literal would leave
61
+ * the adapter one version behind the next bump and get it rejected by the
62
+ * runtime it ships alongside.
45
63
  *
46
- * Deliberately NOT bumped for slot-numbered event ids. Slot numbering is a
47
- * property of a run's whole log rather than of an individual event, and it is
48
- * already self-describing: a run's scheme is readable from the shape of its
49
- * own first event id (see `isSlotEventId`), so a World that owns its own id
50
- * allocation needs no version negotiation to pin one. Bumping this constant
51
- * would stamp the new version on every World
52
- * including ones that have not adopted slots yet, which is exactly the
53
- * cross-version breakage the pin exists to avoid. A World that does allocate
54
- * slots declares the higher version itself (see `world-vercel`), and
55
- * `SPEC_VERSION_MAX_SUPPORTED` is what keeps this reader from rejecting the
56
- * runs it produces.
64
+ * Bumping this does not touch runs already created: their stamped version is
65
+ * persisted, every version test in the runtime is `>=`, and a World resolves a
66
+ * run's identity scheme from what is stored rather than from this constant.
57
67
  */
58
68
  export declare const SPEC_VERSION_CURRENT: SpecVersion;
59
69
  /**
60
70
  * The highest spec version this SDK can read.
61
71
  *
62
- * Distinct from `SPEC_VERSION_CURRENT`, which is the *default* a World stamps
63
- * on runs it creates. A World may declare a higher version than the default,
64
- * so the "was this run made by a newer SDK?" test has to be against the
65
- * ceiling: comparing against the default would make the SDK reject runs its
66
- * own adapters just created.
72
+ * Kept distinct from `SPEC_VERSION_CURRENT` even though the two are equal
73
+ * today. They answer different questions, "what do we write?" versus "what can
74
+ * we still read?", and they come apart in the release order a spec bump
75
+ * follows: a reader that can already handle the next version raises this
76
+ * ceiling first, and `SPEC_VERSION_CURRENT` follows only once the version is
77
+ * safe to stamp. Collapsing them into one constant would make that staging
78
+ * impossible to express.
67
79
  */
68
80
  export declare const SPEC_VERSION_MAX_SUPPORTED: SpecVersion;
69
81
  /**
@@ -0,0 +1,41 @@
1
+ import type { EventType } from '../events.js';
2
+ /**
3
+ * Logs that mix events a replay reads past with events that only look like it.
4
+ *
5
+ * Two codebases answer the same question about a log and must answer it the
6
+ * same way. The runtime decides it while replaying: `EventsConsumer` passes
7
+ * over an event whose class it already consumed for that entity and which
8
+ * every registered callback declined. The observability UI decides it after
9
+ * the fact, from the log alone, with no consumers to ask. It stands in for
10
+ * them with the log's own record of when each entity finished, because that is
11
+ * the point past which the runtime has no consumer left for the entity.
12
+ *
13
+ * The two rules agree on every fixture here, and the interesting ones are the
14
+ * near misses: a retried step writes several `step_started` events that are
15
+ * all consumed, and a step that is still open absorbs a second `step_created`.
16
+ * Reading those as repeats would grey out attempts that ran.
17
+ *
18
+ * Each fixture is a whole run's log in log order, which is what both rules
19
+ * take as input. Entities are named, not correlation-id shaped, so each side
20
+ * can mint ids in whatever form it drives.
21
+ */
22
+ export interface DuplicateEventFixtureEvent {
23
+ eventType: EventType;
24
+ /** The entity the event belongs to. Run-level events belong to none. */
25
+ entity?: string;
26
+ }
27
+ export interface DuplicateEventFixture {
28
+ name: string;
29
+ /** What makes this log worth pinning down. */
30
+ why: string;
31
+ /** One run's whole log, in log order. */
32
+ events: DuplicateEventFixtureEvent[];
33
+ /**
34
+ * Indices into {@link events} of the events no consumer claims: the ones the
35
+ * runtime steps over and the UI greys out. Every other index is an event the
36
+ * run acted on.
37
+ */
38
+ ignoredIndices: number[];
39
+ }
40
+ export declare const DUPLICATE_EVENT_FIXTURES: readonly DuplicateEventFixture[];
41
+ //# sourceMappingURL=duplicate-event-fixtures.d.ts.map