@workflow/core 5.0.0-beta.5 → 5.0.0-beta.51

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 (317) hide show
  1. package/README.md +5 -0
  2. package/dist/attribute-changes.d.ts +5 -0
  3. package/dist/attribute-changes.d.ts.map +1 -0
  4. package/dist/attribute-changes.js +25 -0
  5. package/dist/capabilities.d.ts +35 -2
  6. package/dist/capabilities.d.ts.map +1 -1
  7. package/dist/capabilities.js +74 -5
  8. package/dist/capture-stack.d.ts +1 -1
  9. package/dist/capture-stack.js +2 -2
  10. package/dist/class-serialization.d.ts +32 -0
  11. package/dist/class-serialization.d.ts.map +1 -1
  12. package/dist/class-serialization.js +37 -1
  13. package/dist/classify-error.d.ts +19 -3
  14. package/dist/classify-error.d.ts.map +1 -1
  15. package/dist/classify-error.js +98 -6
  16. package/dist/context-violation-error.d.ts +5 -5
  17. package/dist/context-violation-error.d.ts.map +1 -1
  18. package/dist/context-violation-error.js +8 -6
  19. package/dist/create-hook.d.ts +72 -7
  20. package/dist/create-hook.d.ts.map +1 -1
  21. package/dist/create-hook.js +1 -1
  22. package/dist/define-hook.js +2 -2
  23. package/dist/describe-error.d.ts +7 -7
  24. package/dist/describe-error.d.ts.map +1 -1
  25. package/dist/describe-error.js +97 -12
  26. package/dist/encryption.d.ts +38 -4
  27. package/dist/encryption.d.ts.map +1 -1
  28. package/dist/encryption.js +96 -14
  29. package/dist/events-consumer.d.ts +297 -0
  30. package/dist/events-consumer.d.ts.map +1 -1
  31. package/dist/events-consumer.js +673 -42
  32. package/dist/flushable-stream.d.ts +97 -1
  33. package/dist/flushable-stream.d.ts.map +1 -1
  34. package/dist/flushable-stream.js +291 -11
  35. package/dist/global.d.ts +36 -2
  36. package/dist/global.d.ts.map +1 -1
  37. package/dist/global.js +21 -6
  38. package/dist/index.d.ts +2 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +3 -2
  41. package/dist/log-format.d.ts +2 -2
  42. package/dist/log-format.js +19 -12
  43. package/dist/logger.d.ts +1 -0
  44. package/dist/logger.d.ts.map +1 -1
  45. package/dist/logger.js +10 -6
  46. package/dist/private.d.ts +226 -9
  47. package/dist/private.d.ts.map +1 -1
  48. package/dist/private.js +626 -7
  49. package/dist/replay-divergence.d.ts +25 -0
  50. package/dist/replay-divergence.d.ts.map +1 -0
  51. package/dist/replay-divergence.js +61 -0
  52. package/dist/replay-payload-cache.d.ts +64 -0
  53. package/dist/replay-payload-cache.d.ts.map +1 -0
  54. package/dist/replay-payload-cache.js +158 -0
  55. package/dist/runtime/compute-instance.d.ts +13 -0
  56. package/dist/runtime/compute-instance.d.ts.map +1 -0
  57. package/dist/runtime/compute-instance.js +14 -0
  58. package/dist/runtime/constants.d.ts +315 -0
  59. package/dist/runtime/constants.d.ts.map +1 -1
  60. package/dist/runtime/constants.js +502 -16
  61. package/dist/runtime/count-step-started-events.d.ts +52 -0
  62. package/dist/runtime/count-step-started-events.d.ts.map +1 -0
  63. package/dist/runtime/count-step-started-events.js +72 -0
  64. package/dist/runtime/deployment-guard.d.ts +99 -0
  65. package/dist/runtime/deployment-guard.d.ts.map +1 -0
  66. package/dist/runtime/deployment-guard.js +154 -0
  67. package/dist/runtime/get-port-lazy.d.ts +15 -0
  68. package/dist/runtime/get-port-lazy.d.ts.map +1 -1
  69. package/dist/runtime/get-port-lazy.js +75 -6
  70. package/dist/runtime/get-world-lazy.d.ts +5 -14
  71. package/dist/runtime/get-world-lazy.d.ts.map +1 -1
  72. package/dist/runtime/get-world-lazy.js +19 -29
  73. package/dist/runtime/helpers.d.ts +415 -29
  74. package/dist/runtime/helpers.d.ts.map +1 -1
  75. package/dist/runtime/helpers.js +686 -57
  76. package/dist/runtime/quickjs-assets.generated.d.ts +14 -0
  77. package/dist/runtime/quickjs-assets.generated.d.ts.map +1 -0
  78. package/dist/runtime/quickjs-assets.generated.js +30 -0
  79. package/dist/runtime/quickjs-entrypoint.d.ts +158 -0
  80. package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -0
  81. package/dist/runtime/quickjs-entrypoint.js +1863 -0
  82. package/dist/runtime/quickjs-log-view.d.ts +129 -0
  83. package/dist/runtime/quickjs-log-view.d.ts.map +1 -0
  84. package/dist/runtime/quickjs-log-view.js +229 -0
  85. package/dist/runtime/quickjs-runtime.d.ts +244 -0
  86. package/dist/runtime/quickjs-runtime.d.ts.map +1 -0
  87. package/dist/runtime/quickjs-runtime.js +2427 -0
  88. package/dist/runtime/quickjs-serde.d.ts +107 -0
  89. package/dist/runtime/quickjs-serde.d.ts.map +1 -0
  90. package/dist/runtime/quickjs-serde.js +2159 -0
  91. package/dist/runtime/replay-budget.d.ts +97 -0
  92. package/dist/runtime/replay-budget.d.ts.map +1 -0
  93. package/dist/runtime/replay-budget.js +139 -0
  94. package/dist/runtime/replay-recovery-reporter.d.ts +36 -0
  95. package/dist/runtime/replay-recovery-reporter.d.ts.map +1 -0
  96. package/dist/runtime/replay-recovery-reporter.js +64 -0
  97. package/dist/runtime/resume-hook.d.ts +91 -8
  98. package/dist/runtime/resume-hook.d.ts.map +1 -1
  99. package/dist/runtime/resume-hook.js +512 -89
  100. package/dist/runtime/resume-latency.d.ts +150 -0
  101. package/dist/runtime/resume-latency.d.ts.map +1 -0
  102. package/dist/runtime/resume-latency.js +155 -0
  103. package/dist/runtime/run-id-time.d.ts +19 -0
  104. package/dist/runtime/run-id-time.d.ts.map +1 -0
  105. package/dist/runtime/run-id-time.js +42 -0
  106. package/dist/runtime/run.d.ts +72 -7
  107. package/dist/runtime/run.d.ts.map +1 -1
  108. package/dist/runtime/run.js +280 -53
  109. package/dist/runtime/runs.d.ts +54 -3
  110. package/dist/runtime/runs.d.ts.map +1 -1
  111. package/dist/runtime/runs.js +126 -16
  112. package/dist/runtime/start.d.ts +101 -2
  113. package/dist/runtime/start.d.ts.map +1 -1
  114. package/dist/runtime/start.js +352 -61
  115. package/dist/runtime/step-executor.d.ts +186 -5
  116. package/dist/runtime/step-executor.d.ts.map +1 -1
  117. package/dist/runtime/step-executor.js +768 -130
  118. package/dist/runtime/step-latency.d.ts +220 -0
  119. package/dist/runtime/step-latency.d.ts.map +1 -0
  120. package/dist/runtime/step-latency.js +215 -0
  121. package/dist/runtime/step-ownership.d.ts +72 -0
  122. package/dist/runtime/step-ownership.d.ts.map +1 -0
  123. package/dist/runtime/step-ownership.js +114 -0
  124. package/dist/runtime/step-single-flight.d.ts +12 -0
  125. package/dist/runtime/step-single-flight.d.ts.map +1 -0
  126. package/dist/runtime/step-single-flight.js +75 -0
  127. package/dist/runtime/suspension-handler.d.ts +247 -7
  128. package/dist/runtime/suspension-handler.d.ts.map +1 -1
  129. package/dist/runtime/suspension-handler.js +1304 -125
  130. package/dist/runtime/unserializable-step.d.ts +34 -0
  131. package/dist/runtime/unserializable-step.d.ts.map +1 -0
  132. package/dist/runtime/unserializable-step.js +52 -0
  133. package/dist/runtime/vm-mode.d.ts +44 -0
  134. package/dist/runtime/vm-mode.d.ts.map +1 -0
  135. package/dist/runtime/vm-mode.js +62 -0
  136. package/dist/runtime/vm-serde-bundle.generated.d.ts +14 -0
  137. package/dist/runtime/vm-serde-bundle.generated.d.ts.map +1 -0
  138. package/dist/runtime/vm-serde-bundle.generated.js +16 -0
  139. package/dist/runtime/wait-continuation.d.ts +106 -0
  140. package/dist/runtime/wait-continuation.d.ts.map +1 -0
  141. package/dist/runtime/wait-continuation.js +136 -0
  142. package/dist/runtime/wait-until.d.ts +18 -0
  143. package/dist/runtime/wait-until.d.ts.map +1 -0
  144. package/dist/runtime/wait-until.js +42 -0
  145. package/dist/runtime/world-compatibility.d.ts +32 -0
  146. package/dist/runtime/world-compatibility.d.ts.map +1 -0
  147. package/dist/runtime/world-compatibility.js +44 -0
  148. package/dist/runtime/world-init.d.ts +17 -42
  149. package/dist/runtime/world-init.d.ts.map +1 -1
  150. package/dist/runtime/world-init.js +18 -43
  151. package/dist/runtime/world.d.ts +14 -2
  152. package/dist/runtime/world.d.ts.map +1 -1
  153. package/dist/runtime/world.js +75 -19
  154. package/dist/runtime.d.ts +10 -6
  155. package/dist/runtime.d.ts.map +1 -1
  156. package/dist/runtime.js +3911 -489
  157. package/dist/sealed-box.d.ts +167 -0
  158. package/dist/sealed-box.d.ts.map +1 -0
  159. package/dist/sealed-box.js +571 -0
  160. package/dist/serialization/client.d.ts +3 -3
  161. package/dist/serialization/client.d.ts.map +1 -1
  162. package/dist/serialization/client.js +8 -4
  163. package/dist/serialization/codec-devalue-vm.d.ts +16 -0
  164. package/dist/serialization/codec-devalue-vm.d.ts.map +1 -0
  165. package/dist/serialization/codec-devalue-vm.js +148 -0
  166. package/dist/serialization/codec-devalue.d.ts +1 -1
  167. package/dist/serialization/codec-devalue.d.ts.map +1 -1
  168. package/dist/serialization/codec-devalue.js +24 -6
  169. package/dist/serialization/codec.d.ts +37 -2
  170. package/dist/serialization/codec.d.ts.map +1 -1
  171. package/dist/serialization/codec.js +2 -2
  172. package/dist/serialization/compression.d.ts +105 -0
  173. package/dist/serialization/compression.d.ts.map +1 -0
  174. package/dist/serialization/compression.js +261 -0
  175. package/dist/serialization/encryption.d.ts +119 -17
  176. package/dist/serialization/encryption.d.ts.map +1 -1
  177. package/dist/serialization/encryption.js +152 -17
  178. package/dist/serialization/errors.d.ts +13 -0
  179. package/dist/serialization/errors.d.ts.map +1 -1
  180. package/dist/serialization/errors.js +20 -2
  181. package/dist/serialization/format.d.ts +6 -6
  182. package/dist/serialization/format.js +7 -7
  183. package/dist/serialization/hardened.d.ts +156 -0
  184. package/dist/serialization/hardened.d.ts.map +1 -0
  185. package/dist/serialization/hardened.js +538 -0
  186. package/dist/serialization/index.d.ts +10 -8
  187. package/dist/serialization/index.d.ts.map +1 -1
  188. package/dist/serialization/index.js +10 -8
  189. package/dist/serialization/reducers/class-vm.d.ts +20 -0
  190. package/dist/serialization/reducers/class-vm.d.ts.map +1 -0
  191. package/dist/serialization/reducers/class-vm.js +77 -0
  192. package/dist/serialization/reducers/class.d.ts.map +1 -1
  193. package/dist/serialization/reducers/class.js +11 -6
  194. package/dist/serialization/reducers/common-vm.d.ts +15 -0
  195. package/dist/serialization/reducers/common-vm.d.ts.map +1 -0
  196. package/dist/serialization/reducers/common-vm.js +616 -0
  197. package/dist/serialization/reducers/common.d.ts +1 -1
  198. package/dist/serialization/reducers/common.d.ts.map +1 -1
  199. package/dist/serialization/reducers/common.js +202 -62
  200. package/dist/serialization/reducers/step-function-vm.d.ts +44 -0
  201. package/dist/serialization/reducers/step-function-vm.d.ts.map +1 -0
  202. package/dist/serialization/reducers/step-function-vm.js +97 -0
  203. package/dist/serialization/reducers/step-function.d.ts.map +1 -1
  204. package/dist/serialization/reducers/step-function.js +25 -9
  205. package/dist/serialization/step.d.ts +4 -4
  206. package/dist/serialization/step.d.ts.map +1 -1
  207. package/dist/serialization/step.js +9 -5
  208. package/dist/serialization/types.d.ts +80 -1
  209. package/dist/serialization/types.d.ts.map +1 -1
  210. package/dist/serialization/types.js +15 -1
  211. package/dist/serialization/workflow-vm.d.ts +29 -0
  212. package/dist/serialization/workflow-vm.d.ts.map +1 -0
  213. package/dist/serialization/workflow-vm.js +74 -0
  214. package/dist/serialization-format.d.ts +64 -8
  215. package/dist/serialization-format.d.ts.map +1 -1
  216. package/dist/serialization-format.js +225 -73
  217. package/dist/serialization.d.ts +262 -34
  218. package/dist/serialization.d.ts.map +1 -1
  219. package/dist/serialization.js +1885 -277
  220. package/dist/set-attributes.d.ts +13 -0
  221. package/dist/set-attributes.d.ts.map +1 -0
  222. package/dist/set-attributes.js +60 -0
  223. package/dist/source-map.d.ts +25 -0
  224. package/dist/source-map.d.ts.map +1 -1
  225. package/dist/source-map.js +154 -10
  226. package/dist/step/context-storage.d.ts +63 -2
  227. package/dist/step/context-storage.d.ts.map +1 -1
  228. package/dist/step/context-storage.js +7 -5
  229. package/dist/step/writable-stream.d.ts +3 -3
  230. package/dist/step/writable-stream.d.ts.map +1 -1
  231. package/dist/step/writable-stream.js +80 -13
  232. package/dist/step.d.ts.map +1 -1
  233. package/dist/step.js +148 -27
  234. package/dist/symbols.d.ts +50 -0
  235. package/dist/symbols.d.ts.map +1 -1
  236. package/dist/symbols.js +51 -1
  237. package/dist/telemetry/semantic-conventions.d.ts +433 -2
  238. package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
  239. package/dist/telemetry/semantic-conventions.js +319 -3
  240. package/dist/telemetry.d.ts +91 -0
  241. package/dist/telemetry.d.ts.map +1 -1
  242. package/dist/telemetry.js +244 -17
  243. package/dist/test-support/orchestrator-context.d.ts +25 -0
  244. package/dist/test-support/orchestrator-context.d.ts.map +1 -0
  245. package/dist/test-support/orchestrator-context.js +107 -0
  246. package/dist/types.d.ts +6 -0
  247. package/dist/types.d.ts.map +1 -1
  248. package/dist/types.js +23 -1
  249. package/dist/util.d.ts +0 -5
  250. package/dist/util.d.ts.map +1 -1
  251. package/dist/util.js +1 -15
  252. package/dist/version.d.ts +1 -1
  253. package/dist/version.d.ts.map +1 -1
  254. package/dist/version.js +2 -2
  255. package/dist/vm/index.d.ts.map +1 -1
  256. package/dist/vm/index.js +84 -14
  257. package/dist/vm/script-cache.d.ts +26 -0
  258. package/dist/vm/script-cache.d.ts.map +1 -0
  259. package/dist/vm/script-cache.js +131 -0
  260. package/dist/vm/uint8array-base64.js +1 -1
  261. package/dist/workflow/abort-controller.d.ts +2 -2
  262. package/dist/workflow/abort-controller.d.ts.map +1 -1
  263. package/dist/workflow/abort-controller.js +88 -21
  264. package/dist/workflow/attribute-dispatcher.d.ts +6 -0
  265. package/dist/workflow/attribute-dispatcher.d.ts.map +1 -0
  266. package/dist/workflow/attribute-dispatcher.js +45 -0
  267. package/dist/workflow/create-hook.d.ts.map +1 -1
  268. package/dist/workflow/create-hook.js +24 -3
  269. package/dist/workflow/get-workflow-metadata.js +2 -2
  270. package/dist/workflow/hook.d.ts.map +1 -1
  271. package/dist/workflow/hook.js +304 -47
  272. package/dist/workflow/index.d.ts +1 -0
  273. package/dist/workflow/index.d.ts.map +1 -1
  274. package/dist/workflow/index.js +2 -1
  275. package/dist/workflow/set-attributes.d.ts +68 -0
  276. package/dist/workflow/set-attributes.d.ts.map +1 -0
  277. package/dist/workflow/set-attributes.js +60 -0
  278. package/dist/workflow/sleep.d.ts.map +1 -1
  279. package/dist/workflow/sleep.js +58 -12
  280. package/dist/workflow/world-init-stub.d.ts +3 -3
  281. package/dist/workflow/world-init-stub.js +4 -4
  282. package/dist/workflow.d.ts +95 -3
  283. package/dist/workflow.d.ts.map +1 -1
  284. package/dist/workflow.js +900 -561
  285. package/docs/api-reference/create-hook.mdx +89 -10
  286. package/docs/api-reference/create-webhook.mdx +16 -15
  287. package/docs/api-reference/define-hook.mdx +35 -33
  288. package/docs/api-reference/fatal-error.mdx +30 -8
  289. package/docs/api-reference/fetch.mdx +14 -10
  290. package/docs/api-reference/get-step-metadata.mdx +2 -2
  291. package/docs/api-reference/get-workflow-metadata.mdx +3 -3
  292. package/docs/api-reference/get-writable.mdx +7 -7
  293. package/docs/api-reference/index.mdx +4 -1
  294. package/docs/api-reference/retryable-error.mdx +1 -1
  295. package/docs/api-reference/set-attributes.mdx +61 -0
  296. package/docs/api-reference/sleep.mdx +4 -4
  297. package/docs/foundations/cancellation.mdx +31 -32
  298. package/docs/foundations/errors-and-retries.mdx +42 -11
  299. package/docs/foundations/hooks.mdx +64 -35
  300. package/docs/foundations/idempotency.mdx +244 -12
  301. package/docs/foundations/index.mdx +1 -23
  302. package/docs/foundations/meta.json +2 -1
  303. package/docs/foundations/serialization.mdx +21 -22
  304. package/docs/foundations/starting-workflows.mdx +106 -30
  305. package/docs/foundations/streaming.mdx +108 -60
  306. package/docs/foundations/versioning.mdx +263 -0
  307. package/docs/foundations/workflows-and-steps.mdx +9 -9
  308. package/docs/how-it-works/cancellation.mdx +63 -63
  309. package/docs/how-it-works/code-transform.mdx +83 -67
  310. package/docs/how-it-works/encryption.mdx +30 -26
  311. package/docs/how-it-works/event-sourcing.mdx +125 -34
  312. package/docs/how-it-works/framework-integrations.mdx +96 -337
  313. package/docs/how-it-works/understanding-directives.mdx +22 -22
  314. package/package.json +24 -15
  315. package/dist/runtime/step-handler.d.ts +0 -2
  316. package/dist/runtime/step-handler.d.ts.map +0 -1
  317. package/dist/runtime/step-handler.js +0 -776
package/dist/symbols.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export declare const WORKFLOW_USE_STEP: unique symbol;
2
+ export declare const WORKFLOW_SET_ATTRIBUTES: unique symbol;
2
3
  export declare const WORKFLOW_CREATE_HOOK: unique symbol;
3
4
  export declare const WORKFLOW_SLEEP: unique symbol;
4
5
  export declare const WORKFLOW_CONTEXT: unique symbol;
@@ -6,6 +7,55 @@ export declare const WORKFLOW_GET_STREAM_ID: unique symbol;
6
7
  export declare const STABLE_ULID: unique symbol;
7
8
  export declare const STREAM_NAME_SYMBOL: unique symbol;
8
9
  export declare const STREAM_TYPE_SYMBOL: unique symbol;
10
+ export declare const STREAM_FRAMING_SYMBOL: unique symbol;
11
+ /**
12
+ * Stamped on a real `WritableStream` (the user-visible `serialize.writable`
13
+ * returned from a step-side reviver or step-context `getWritable()`) to
14
+ * record the `runId` of the workflow run that owns the underlying server
15
+ * stream. Used together with `STREAM_NAME_SYMBOL`.
16
+ *
17
+ * When `getExternalReducers.WritableStream` (the dehydration path used by
18
+ * `start()`) sees both symbols on a writable, it includes the `runId` in
19
+ * the descriptor it emits. The child run's step-side reviver then opens
20
+ * a server writable against the original `(runId, name)` and resolves
21
+ * that run's encryption key directly, so the child's writes land on
22
+ * the parent's stream as-is, with no client process in the loop. That
23
+ * keeps the forwarding alive for the full lifetime of the child run,
24
+ * not just for the parent step that initiated `start()`.
25
+ */
26
+ export declare const STREAM_SERVER_RUN_ID_SYMBOL: unique symbol;
27
+ /**
28
+ * Stamped alongside `STREAM_SERVER_RUN_ID_SYMBOL` when the deployment that
29
+ * owns a forwarded writable stream is known. Cross-deployment consumers use
30
+ * it to resolve the owning run's encryption key without loading the run first.
31
+ */
32
+ export declare const STREAM_SERVER_DEPLOYMENT_ID_SYMBOL: unique symbol;
33
+ /**
34
+ * Stamped alongside `STREAM_SERVER_RUN_ID_SYMBOL` with the owning run's
35
+ * X25519 public key (base64), when the run has one.
36
+ *
37
+ * This is what lets a forwarded writable be written to across a deployment
38
+ * boundary at zero cost. The owning run derives its own public key locally
39
+ * when it creates the stream, so the key travels inside the serialized
40
+ * descriptor; a child on another deployment can then seal frames immediately.
41
+ * Without it the child would have to either fetch the owning run or fetch its
42
+ * symmetric key from the API, the round trip this whole mechanism exists to
43
+ * avoid.
44
+ */
45
+ export declare const STREAM_SERVER_PUBLIC_KEY_SYMBOL: unique symbol;
46
+ /**
47
+ * Stamped on a `WorkflowServerWritableStream` instance to expose its
48
+ * durability barrier: `() => Promise<void>` that resolves once every accepted
49
+ * chunk has durably reached the server (nothing buffered, nothing in flight)
50
+ * and rejects if any dispatch failed.
51
+ *
52
+ * The sink acks `write()` on buffer entry (group-commit batching), so
53
+ * durability tracking lives here instead: `flushablePipe` feature-detects
54
+ * this and awaits it before resolving its lock-release completion, keeping
55
+ * the invariant that a step cannot complete while stream data is still
56
+ * client-side. Sinks without it are fully durable per `write()` already.
57
+ */
58
+ export declare const STREAM_DRAIN_SYMBOL: unique symbol;
9
59
  export declare const BODY_INIT_SYMBOL: unique symbol;
10
60
  export declare const WEBHOOK_RESPONSE_WRITABLE: unique symbol;
11
61
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,eAAkC,CAAC;AACjE,eAAO,MAAM,oBAAoB,eAAqC,CAAC;AACvE,eAAO,MAAM,cAAc,eAA+B,CAAC;AAC3D,eAAO,MAAM,gBAAgB,eAAiC,CAAC;AAC/D,eAAO,MAAM,sBAAsB,eAAuC,CAAC;AAC3E,eAAO,MAAM,WAAW,eAAqC,CAAC;AAC9D,eAAO,MAAM,kBAAkB,eAAqC,CAAC;AACrE,eAAO,MAAM,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C,CAAC;AACxE,eAAO,MAAM,uBAAuB,eAEnC,CAAC;AACF,eAAO,MAAM,mBAAmB,eAA6C,CAAC"}
package/dist/symbols.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export const WORKFLOW_USE_STEP = Symbol.for('WORKFLOW_USE_STEP');
2
+ export const WORKFLOW_SET_ATTRIBUTES = Symbol.for('WORKFLOW_SET_ATTRIBUTES');
2
3
  export const WORKFLOW_CREATE_HOOK = Symbol.for('WORKFLOW_CREATE_HOOK');
3
4
  export const WORKFLOW_SLEEP = Symbol.for('WORKFLOW_SLEEP');
4
5
  export const WORKFLOW_CONTEXT = Symbol.for('WORKFLOW_CONTEXT');
@@ -6,6 +7,55 @@ export const WORKFLOW_GET_STREAM_ID = Symbol.for('WORKFLOW_GET_STREAM_ID');
6
7
  export const STABLE_ULID = Symbol.for('WORKFLOW_STABLE_ULID');
7
8
  export const STREAM_NAME_SYMBOL = Symbol.for('WORKFLOW_STREAM_NAME');
8
9
  export const STREAM_TYPE_SYMBOL = Symbol.for('WORKFLOW_STREAM_TYPE');
10
+ export const STREAM_FRAMING_SYMBOL = Symbol.for('WORKFLOW_STREAM_FRAMING');
11
+ /**
12
+ * Stamped on a real `WritableStream` (the user-visible `serialize.writable`
13
+ * returned from a step-side reviver or step-context `getWritable()`) to
14
+ * record the `runId` of the workflow run that owns the underlying server
15
+ * stream. Used together with `STREAM_NAME_SYMBOL`.
16
+ *
17
+ * When `getExternalReducers.WritableStream` (the dehydration path used by
18
+ * `start()`) sees both symbols on a writable, it includes the `runId` in
19
+ * the descriptor it emits. The child run's step-side reviver then opens
20
+ * a server writable against the original `(runId, name)` and resolves
21
+ * that run's encryption key directly, so the child's writes land on
22
+ * the parent's stream as-is, with no client process in the loop. That
23
+ * keeps the forwarding alive for the full lifetime of the child run,
24
+ * not just for the parent step that initiated `start()`.
25
+ */
26
+ export const STREAM_SERVER_RUN_ID_SYMBOL = Symbol.for('WORKFLOW_STREAM_SERVER_RUN_ID');
27
+ /**
28
+ * Stamped alongside `STREAM_SERVER_RUN_ID_SYMBOL` when the deployment that
29
+ * owns a forwarded writable stream is known. Cross-deployment consumers use
30
+ * it to resolve the owning run's encryption key without loading the run first.
31
+ */
32
+ export const STREAM_SERVER_DEPLOYMENT_ID_SYMBOL = Symbol.for('WORKFLOW_STREAM_SERVER_DEPLOYMENT_ID');
33
+ /**
34
+ * Stamped alongside `STREAM_SERVER_RUN_ID_SYMBOL` with the owning run's
35
+ * X25519 public key (base64), when the run has one.
36
+ *
37
+ * This is what lets a forwarded writable be written to across a deployment
38
+ * boundary at zero cost. The owning run derives its own public key locally
39
+ * when it creates the stream, so the key travels inside the serialized
40
+ * descriptor; a child on another deployment can then seal frames immediately.
41
+ * Without it the child would have to either fetch the owning run or fetch its
42
+ * symmetric key from the API, the round trip this whole mechanism exists to
43
+ * avoid.
44
+ */
45
+ export const STREAM_SERVER_PUBLIC_KEY_SYMBOL = Symbol.for('WORKFLOW_STREAM_SERVER_PUBLIC_KEY');
46
+ /**
47
+ * Stamped on a `WorkflowServerWritableStream` instance to expose its
48
+ * durability barrier: `() => Promise<void>` that resolves once every accepted
49
+ * chunk has durably reached the server (nothing buffered, nothing in flight)
50
+ * and rejects if any dispatch failed.
51
+ *
52
+ * The sink acks `write()` on buffer entry (group-commit batching), so
53
+ * durability tracking lives here instead: `flushablePipe` feature-detects
54
+ * this and awaits it before resolving its lock-release completion, keeping
55
+ * the invariant that a step cannot complete while stream data is still
56
+ * client-side. Sinks without it are fully durable per `write()` already.
57
+ */
58
+ export const STREAM_DRAIN_SYMBOL = Symbol.for('WORKFLOW_STREAM_DRAIN');
9
59
  export const BODY_INIT_SYMBOL = Symbol.for('BODY_INIT');
10
60
  export const WEBHOOK_RESPONSE_WRITABLE = Symbol.for('WEBHOOK_RESPONSE_WRITABLE');
11
61
  /**
@@ -17,4 +67,4 @@ export const ABORT_STREAM_NAME = Symbol.for('WORKFLOW_ABORT_STREAM_NAME');
17
67
  export const ABORT_HOOK_TOKEN = Symbol.for('WORKFLOW_ABORT_HOOK_TOKEN');
18
68
  export const ABORT_LISTENER_ATTACHED = Symbol.for('WORKFLOW_ABORT_LISTENER_ATTACHED');
19
69
  export const ABORT_READER_CANCEL = Symbol.for('WORKFLOW_ABORT_READER_CANCEL');
20
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ltYm9scy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9zeW1ib2xzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLE1BQU0sQ0FBQyxHQUFHLENBQUMsbUJBQW1CLENBQUMsQ0FBQztBQUNqRSxNQUFNLENBQUMsTUFBTSxvQkFBb0IsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDLHNCQUFzQixDQUFDLENBQUM7QUFDdkUsTUFBTSxDQUFDLE1BQU0sY0FBYyxHQUFHLE1BQU0sQ0FBQyxHQUFHLENBQUMsZ0JBQWdCLENBQUMsQ0FBQztBQUMzRCxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDLGtCQUFrQixDQUFDLENBQUM7QUFDL0QsTUFBTSxDQUFDLE1BQU0sc0JBQXNCLEdBQUcsTUFBTSxDQUFDLEdBQUcsQ0FBQyx3QkFBd0IsQ0FBQyxDQUFDO0FBQzNFLE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDLHNCQUFzQixDQUFDLENBQUM7QUFDOUQsTUFBTSxDQUFDLE1BQU0sa0JBQWtCLEdBQUcsTUFBTSxDQUFDLEdBQUcsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ3JFLE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHLE1BQU0sQ0FBQyxHQUFHLENBQUMsc0JBQXNCLENBQ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9OU0VfV1JJVEFCTEUnXG4pO1xuXG4vKipcbiAqIFN5bWJvbCB1c2VkIHRvIHN0b3JlIHRoZSBjbGFzcyByZWdpc3RyeSBvbiBnbG9iYWxUaGlzIGluIHdvcmtmbG93IG1vZGUuXG4gKiBUaGlzIGFsbG93cyB0aGUgZGVzZXJpYWxpemVyIHRvIGZpbmQgY2xhc3NlcyBieSBjbGFzc0lkIGluIHRoZSBWTSBjb250ZXh0LlxuICovXG5leHBvcnQgY29uc3QgV09SS0ZMT1dfQ0xBU1NfUkVHSVNUUlkgPSBTeW1ib2wuZm9yKCd3b3JrZmxvdy1jbGFzcy1yZWdpc3RyeScpO1xuXG5leHBvcnQgY29uc3QgQUJPUlRfU1RSRUFNX05BTUUgPSBTeW1ib2wuZm9yKCdXT1JLRkxPV19BQk9SVF9TVFJFQU1fTkFNRScpO1xuZXhwb3J0IGNvbnN0IEFCT1JUX0hPT0tfVE9LRU4gPSBTeW1ib2wuZm9yKCdXT1JLRkxPV19BQk9SVF9IT09LX1RPS0VOJyk7XG5leHBvcnQgY29uc3QgQUJPUlRfTElTVEVORVJfQVRUQUNIRUQgPSBTeW1ib2wuZm9yKFxuICAnV09SS0ZMT1dfQUJPUlRfTElTVEVORVJfQVRUQUNIRUQnXG4pO1xuZXhwb3J0IGNvbnN0IEFCT1JUX1JFQURFUl9DQU5DRUwgPSBTeW1ib2wuZm9yKCdXT1JLRkxPV19BQk9SVF9SRUFERVJfQ0FOQ0VMJyk7XG4iXX0=
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * This module provides standardized telemetry attributes following OpenTelemetry semantic conventions
5
5
  * for instrumenting workflow execution, step processing, and related operations. Each exported function
6
- * creates a properly formatted attribute object that can be used with OpenTelemetry spans.
6
+ * creates a properly formatted attribute object for use with OpenTelemetry spans.
7
7
  *
8
8
  * The semantic conventions are organized into several categories:
9
9
  * - **Workflow attributes**: Track workflow lifecycle, status, and metadata
@@ -11,7 +11,7 @@
11
11
  * - **Queue attributes**: Instrument message queue operations
12
12
  * - **Deployment attributes**: Capture deployment environment information
13
13
  *
14
- * All attribute functions are type-safe and leverage existing backend types to ensure
14
+ * All attribute functions are type-safe and use existing backend types to ensure
15
15
  * consistency between telemetry data and actual system state.
16
16
  *
17
17
  * @example
@@ -60,6 +60,42 @@ export declare const WorkflowStartedAt: (value: number) => {
60
60
  export declare const WorkflowEventsCount: (value: number) => {
61
61
  [k: string]: number;
62
62
  };
63
+ /** Whether workflow execution starts with replay or resumes a retained VM */
64
+ export declare const WorkflowExecutionMode: (value: "replay" | "retained") => {
65
+ [k: string]: "replay" | "retained";
66
+ };
67
+ /** Whether the compiled application workflow bundle was cached. */
68
+ export declare const WorkflowBundleCompileCacheHit: (value: boolean) => {
69
+ [k: string]: boolean;
70
+ };
71
+ /** Operation that supplied events to the current replay. */
72
+ export type WorkflowReplayLoadSource = 'run_started' | 'hook_preload' | 'events_list' | 'events_list_incremental';
73
+ export declare const WorkflowReplayLoadSource: (value: WorkflowReplayLoadSource) => {
74
+ [k: string]: WorkflowReplayLoadSource;
75
+ };
76
+ /**
77
+ * Events the replay walked past that no consumer claimed, still held when the
78
+ * replay stopped.
79
+ *
80
+ * A non-zero count on a suspension is ordinary: an out-of-band delivery that
81
+ * landed ahead of the code that reads it waits for the replay that gets there.
82
+ * From inside one replay that is indistinguishable from an event no replay will
83
+ * ever claim, because the two differ only in what the next replay does. So the
84
+ * count goes on the span instead of failing the run, and the case worth acting
85
+ * on is a query across a run's spans: the same
86
+ * {@link WorkflowParkedEventId} held on suspension after suspension.
87
+ */
88
+ export declare const WorkflowParkedEventsCount: (value: number) => {
89
+ [k: string]: number;
90
+ };
91
+ /** Oldest event still held unclaimed when the replay stopped. */
92
+ export declare const WorkflowParkedEventId: (value: string) => {
93
+ [k: string]: string;
94
+ };
95
+ /** Type of the oldest event still held unclaimed when the replay stopped. */
96
+ export declare const WorkflowParkedEventType: (value: string) => {
97
+ [k: string]: string;
98
+ };
63
99
  /** Number of arguments passed to the workflow */
64
100
  export declare const WorkflowArgumentsCount: (value: number) => {
65
101
  [k: string]: number;
@@ -72,6 +108,42 @@ export declare const WorkflowResultType: (value: string) => {
72
108
  export declare const WorkflowTracePropagated: (value: boolean) => {
73
109
  [k: string]: boolean;
74
110
  };
111
+ /** The VM engine executing the workflow function for this invocation */
112
+ export declare const WorkflowVm: (value: "node" | "quickjs") => {
113
+ [k: string]: "node" | "quickjs";
114
+ };
115
+ /** Outcome of a QuickJS VM workflow invocation */
116
+ export declare const QuickJSOutcome: (value: "completed" | "failed" | "suspended") => {
117
+ [k: string]: "completed" | "failed" | "suspended";
118
+ };
119
+ /** Whether preloaded events from `events.create('run_started')` were used */
120
+ export declare const QuickJSEventsPreloaded: (value: boolean) => {
121
+ [k: string]: boolean;
122
+ };
123
+ /** Total number of events fetched from the world for this invocation */
124
+ export declare const QuickJSEventsFetchedCount: (value: number) => {
125
+ [k: string]: number;
126
+ };
127
+ /** Number of pages required to fetch all events */
128
+ export declare const QuickJSEventsFetchedPages: (value: number) => {
129
+ [k: string]: number;
130
+ };
131
+ /** Number of pending VM operations captured at suspension */
132
+ export declare const QuickJSPendingOpsCount: (value: number) => {
133
+ [k: string]: number;
134
+ };
135
+ /** Number of steps executed inline (live-VM continuation) this invocation */
136
+ export declare const QuickJSInlineSteps: (value: number) => {
137
+ [k: string]: number;
138
+ };
139
+ /** Active trace-correlation mode for this invocation (linked or continuous) */
140
+ export declare const WorkflowTraceMode: (value: "linked" | "continuous") => {
141
+ [k: string]: "linked" | "continuous";
142
+ };
143
+ /** Whether this workflow invocation is using the turbo first-delivery path */
144
+ export declare const WorkflowTurbo: (value: boolean) => {
145
+ [k: string]: boolean;
146
+ };
75
147
  /** Name of the error that caused workflow failure */
76
148
  export declare const WorkflowErrorName: (value: string) => {
77
149
  [k: string]: string;
@@ -96,6 +168,68 @@ export declare const WorkflowHooksCreated: (value: number) => {
96
168
  export declare const WorkflowWaitsCreated: (value: number) => {
97
169
  [k: string]: number;
98
170
  };
171
+ /**
172
+ * Number of steps this suspension finalized as failed because their
173
+ * arguments refused to serialize (step_created placeholder + step_failed
174
+ * carrying the SerializationError; see finalizeUnserializableStep).
175
+ */
176
+ export declare const WorkflowStepsFailedSerialization: (value: number) => {
177
+ [k: string]: number;
178
+ };
179
+ /**
180
+ * Number of inline-owned steps this invocation re-executed because it is a
181
+ * redelivery of their owning queue message (crash recovery for inline
182
+ * steps; see the inline step ownership changelog, workflow#2780).
183
+ */
184
+ export declare const WorkflowOwnedRecoverySteps: (value: number) => {
185
+ [k: string]: number;
186
+ };
187
+ /**
188
+ * Number of pending steps for which this replay suppressed the immediate
189
+ * requeue (another invocation inline-owns them under a live lease) and
190
+ * ensured a delayed backstop wake instead.
191
+ */
192
+ export declare const WorkflowBackstopWakesArmed: (value: number) => {
193
+ [k: string]: number;
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
+ };
204
+ /** The workflow runtime route being handled */
205
+ export declare const WorkflowRouteType: (value: "flow") => {
206
+ [k: string]: "flow";
207
+ };
208
+ /** Whether this route invocation reused an already-created request handler */
209
+ export declare const WorkflowRouteHandlerCached: (value: boolean) => {
210
+ [k: string]: boolean;
211
+ };
212
+ /** Number of times this in-memory route handler has been invoked */
213
+ export declare const WorkflowRouteInvocationCount: (value: number) => {
214
+ [k: string]: number;
215
+ };
216
+ /** Time since this route entrypoint was constructed, in milliseconds */
217
+ export declare const WorkflowRouteEntrypointAgeMs: (value: number) => {
218
+ [k: string]: number;
219
+ };
220
+ /** Time spent evaluating the generated route module body before creating the entrypoint */
221
+ export declare const WorkflowRouteModuleBodyInitMs: (value: number) => {
222
+ [k: string]: number;
223
+ };
224
+ /**
225
+ * Compute instance handling this route: the synthesized `COMPUTE_INSTANCE_ID`.
226
+ * Uses OTEL `faas.instance` (execution-environment id, reused across
227
+ * invocations to the same function):
228
+ * https://opentelemetry.io/docs/specs/semconv/attributes-registry/faas/
229
+ */
230
+ export declare const FaasInstance: (value: string) => {
231
+ [k: string]: string;
232
+ };
99
233
  /** Name of the step function being executed */
100
234
  export declare const StepName: (value: string) => {
101
235
  [k: string]: string;
@@ -120,6 +254,64 @@ export declare const StepMaxRetries: (value: number) => {
120
254
  export declare const StepTracePropagated: (value: boolean) => {
121
255
  [k: string]: boolean;
122
256
  };
257
+ /**
258
+ * Client-measured time-to-first-step latency in milliseconds: run creation →
259
+ * this step's body beginning to execute, minus pre-step hook-creation time.
260
+ * Only present on the run's first step execution when it qualified for
261
+ * measurement (see runtime/step-latency.ts).
262
+ */
263
+ export declare const StepTtfsMs: (value: number) => {
264
+ [k: string]: number;
265
+ };
266
+ /**
267
+ * Client-measured step-to-step overhead in milliseconds: the previous step's
268
+ * terminal event → this step's body beginning to execute. Only present when
269
+ * the two steps ran back-to-back.
270
+ */
271
+ export declare const StepStsoMs: (value: number) => {
272
+ [k: string]: number;
273
+ };
274
+ /**
275
+ * Client-measured run_started-to-first-step latency in milliseconds: the
276
+ * `run_started` response landing (or, under turbo, the local run synthesis
277
+ * instant) → this step's start POST being issued. A sub-window of ttfs that
278
+ * isolates replay overhead from the run-creation queue hop. Only present on
279
+ * the run's first step execution when it qualified for measurement (see
280
+ * runtime/step-latency.ts).
281
+ */
282
+ export declare const StepRsfsMs: (value: number) => {
283
+ [k: string]: number;
284
+ };
285
+ /**
286
+ * Client-measured synchronous workflow-function replay duration in
287
+ * milliseconds, excluding awaited network I/O, of only the FINAL replay pass
288
+ * within the rsfs window: the pass that reached and scheduled the first
289
+ * step. Not accumulated across earlier pre-first-step passes (e.g. a
290
+ * workflow-body `setAttributes()` detour replays more than once, and a
291
+ * redelivery omits earlier invocations' work entirely), so this must not be
292
+ * read as "the replay portion of rsfs"; step.rsfs_ms covers the whole
293
+ * window. Only present alongside step.rsfs_ms and only for the run's first
294
+ * step (see runtime/step-latency.ts).
295
+ */
296
+ export declare const StepFinalSchedulingReplayMs: (value: number) => {
297
+ [k: string]: number;
298
+ };
299
+ /**
300
+ * Runtime startup-latency optimizations active for the ttfs/stso measurement
301
+ * (e.g. 'turbo', 'lazyStepStart', 'optimisticStart').
302
+ */
303
+ export declare const StepLatencyOptimizations: (value: string[]) => {
304
+ [k: string]: string[];
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
+ };
123
315
  /** Whether the step was skipped during execution */
124
316
  export declare const StepSkipped: (value: boolean) => {
125
317
  [k: string]: boolean;
@@ -176,6 +368,14 @@ export declare const MessagingMessageId: (value: string & import("zod").$brand<"
176
368
  export declare const MessagingOperationType: (value: "publish" | "receive" | "process") => {
177
369
  [k: string]: "publish" | "receive" | "process";
178
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
+ };
179
379
  /** Time taken to enqueue the message in milliseconds (workflow-specific) */
180
380
  export declare const QueueOverheadMs: (value: number) => {
181
381
  [k: string]: number;
@@ -184,6 +384,18 @@ export declare const QueueOverheadMs: (value: number) => {
184
384
  export declare const DeploymentId: (value: string) => {
185
385
  [k: string]: string;
186
386
  };
387
+ /** The deployment a run is pinned to, set only on a misrouted delivery. */
388
+ export declare const WorkflowRunPinnedDeploymentId: (value: string) => {
389
+ [k: string]: string;
390
+ };
391
+ /** Re-route attempts for this misrouted delivery, including this one. */
392
+ export declare const WorkflowDeploymentMismatchRetryCount: (value: number) => {
393
+ [k: string]: number;
394
+ };
395
+ /** Whether the misrouted delivery was re-routed instead of failing the run. */
396
+ export declare const WorkflowDeploymentMismatchRecovered: (value: boolean) => {
397
+ [k: string]: boolean;
398
+ };
187
399
  /** Token identifying a specific hook */
188
400
  export declare const HookToken: (value: string) => {
189
401
  [k: string]: string;
@@ -196,6 +408,183 @@ export declare const HookId: (value: string) => {
196
408
  export declare const HookFound: (value: boolean) => {
197
409
  [k: string]: boolean;
198
410
  };
411
+ /**
412
+ * Producer-side signal (on the `hook.resume` span) that the direct
413
+ * `hook_received` write failed transiently but the queue dispatch succeeded, so
414
+ * the resume is recovered via the consumer's re-ensure. Corresponds to
415
+ * `ResumedHook.resilientResume === true`.
416
+ *
417
+ * No longer emitted: current producers require the durable event write to
418
+ * succeed. Retained so dashboards and queries built on the attribute keep
419
+ * resolving while older producers are still deployed.
420
+ */
421
+ export declare const HookResilientResume: (value: boolean) => {
422
+ [k: string]: boolean;
423
+ };
424
+ /**
425
+ * Producer-side signal (on the `hook.resume` span) that the durable
426
+ * `hook_received` write COMMITTED. Stamped after the write resolves, so it
427
+ * distinguishes a committed resume from an attempted one — an entry-time
428
+ * attribute cannot, because a span that later records an exception may have
429
+ * failed either before or after the commit.
430
+ */
431
+ export declare const HookResumeCommitted: (value: boolean) => {
432
+ [k: string]: boolean;
433
+ };
434
+ /**
435
+ * Producer-side signal (on the `hook.resume` span) that the workflow wake was
436
+ * ACCEPTED by the queue, stamped after the publish resolves.
437
+ *
438
+ * Together with {@link HookResumeCommitted} this makes stranded resumes
439
+ * queryable: `resume_committed=true` with `wake_published` absent is a resume
440
+ * whose durable event exists but whose wake publish failed (the caller was
441
+ * told, but nothing re-drives it), and `resume_committed=true` +
442
+ * `wake_published=true` with no subsequent workflow execution for the run is
443
+ * a wake the queue accepted but never delivered. Both are detection-only
444
+ * signals — nothing recovers such a run automatically today beyond a later
445
+ * wake from any other source.
446
+ */
447
+ export declare const HookWakePublished: (value: boolean) => {
448
+ [k: string]: boolean;
449
+ };
450
+ /**
451
+ * Consumer-side signal (on the workflow execution span) that this replay
452
+ * materialized the `hook_received` event from the queue message's `hookInput`
453
+ * because no committed event was found, which completes the recovery path
454
+ * {@link HookResilientResume} began.
455
+ *
456
+ * Legacy / non-atomic re-ensure signal only. Legacy atomic lazy resumes
457
+ * (resumeId + digest) go through the hoisted preload write instead, whose
458
+ * response cannot tell whether the producer or the consumer won the
459
+ * `(runId, resumeId)` claim, so this attribute is deliberately NOT emitted
460
+ * for them (emitting `true` unconditionally would count every producer-won
461
+ * resume as a recovery). The producer-begin ({@link HookResilientResume}) /
462
+ * consumer-materialized pairing is therefore no longer complete for atomic
463
+ * lazy resumptions; use {@link HookResumeSetupSource} to observe that path.
464
+ */
465
+ export declare const HookResilientResumeMaterialized: (value: boolean) => {
466
+ [k: string]: boolean;
467
+ };
468
+ /**
469
+ * Consumer-side signal (on the workflow execution span) of how a lazy hook
470
+ * resume initialized its replay state:
471
+ *
472
+ * - `hook_received_stream`: the hoisted `hook_received` write returned a
473
+ * usable replay preload (run + complete event log), so the invocation
474
+ * skipped both the `run_started` write and the initial `events.list`.
475
+ * - `hook_received_fallback`: the hoisted write succeeded but returned no
476
+ * usable preload (a CBOR response from an older server, a World that
477
+ * ignored the opt-in, a bounded `hasMore` page, or a preload that failed
478
+ * validation); the invocation fell back to the `run_started` setup without
479
+ * re-posting the hook.
480
+ *
481
+ * Absent on legacy hook deliveries (no resumeId/digest) and on every other
482
+ * delivery kind, which take the `run_started` setup unconditionally.
483
+ *
484
+ * This is a latency/setup-path signal: it says which requests initialized
485
+ * the invocation, NOT that this consumer created the `hook_received` event
486
+ * (the hoisted write may equally have converged on the producer's, since
487
+ * claim ownership is not observable client-side; cf.
488
+ * {@link HookResilientResumeMaterialized}).
489
+ */
490
+ export declare const HookResumeSetupSource: (value: string) => {
491
+ [k: string]: string;
492
+ };
493
+ /**
494
+ * Producer-side signal (on the suspension span) counting steps whose direct
495
+ * `step_created` write failed transiently while their `stepInput`-carrying
496
+ * queue publish succeeded, so step creation is recovered via the consumer's
497
+ * re-ensure. Mirrors {@link HookResilientResume}.
498
+ */
499
+ export declare const StepResilientDispatchRecovered: (value: number) => {
500
+ [k: string]: number;
501
+ };
502
+ /**
503
+ * Consumer-side signal (on the workflow execution span) that this delivery
504
+ * materialized the `step_created` event from the queue message's `stepInput`
505
+ * because the producer's direct write had not landed, which completes the
506
+ * recovery path {@link StepResilientDispatchRecovered} began.
507
+ */
508
+ export declare const StepResilientDispatchMaterialized: (value: boolean) => {
509
+ [k: string]: boolean;
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
+ };
521
+ /** Total TTR: entry into `resumeHook()` → immediately before `stepFn.apply()`. */
522
+ export declare const ResumeTotalMs: (value: number) => {
523
+ [k: string]: number;
524
+ };
525
+ /** Phase: `resumeHook()` entry → the queue publish being requested. */
526
+ export declare const ResumeProducerPrepMs: (value: number) => {
527
+ [k: string]: number;
528
+ };
529
+ /** Phase: queue publish requested → the final consumer's handler being entered. */
530
+ export declare const ResumeQueueDeliveryMs: (value: number) => {
531
+ [k: string]: number;
532
+ };
533
+ /** Phase: consumer entry → replay beginning. */
534
+ export declare const ResumeSetupMs: (value: number) => {
535
+ [k: string]: number;
536
+ };
537
+ /** Phase: replay beginning → the next durable step being encountered. */
538
+ export declare const ResumeReplayMs: (value: number) => {
539
+ [k: string]: number;
540
+ };
541
+ /** Phase: step encountered → the `step_started` request beginning. */
542
+ export declare const ResumeStepDispatchMs: (value: number) => {
543
+ [k: string]: number;
544
+ };
545
+ /**
546
+ * Phase: `step_started` request beginning → its response returning. Omitted
547
+ * under optimistic inline start, where the claim is not awaited before the
548
+ * body runs and therefore has no completion instant at that point; the time
549
+ * is then reported entirely as {@link ResumeStepPrepareMs}.
550
+ */
551
+ export declare const ResumeStepClaimMs: (value: number) => {
552
+ [k: string]: number;
553
+ };
554
+ /**
555
+ * Phase: claim returning → immediately before `stepFn.apply()`. Deliberately
556
+ * includes encryption-key resolution, argument hydration, and step-context
557
+ * setup; `workflow.queue.deserialize_time_ms` still isolates hydration.
558
+ */
559
+ export declare const ResumeStepPrepareMs: (value: number) => {
560
+ [k: string]: number;
561
+ };
562
+ /** What triggered the measured resumption. */
563
+ export declare const ResumeTrigger: (value: "hook") => {
564
+ [k: string]: "hook";
565
+ };
566
+ /**
567
+ * Which `resumeHook()` dispatch path produced this resume. `parallel` only
568
+ * appears for messages published by an older producer, which wrote
569
+ * `hook_received` itself in parallel with the publish.
570
+ */
571
+ export declare const ResumeStrategy: (value: "lazy" | "parallel" | "sequential") => {
572
+ [k: string]: "lazy" | "parallel" | "sequential";
573
+ };
574
+ /**
575
+ * How the consuming invocation initialized replay state. Distinct from the
576
+ * pre-existing {@link HookResumeSetupSource} (`workflow.resume_setup_source`,
577
+ * on the workflow execution span), which reports the finer-grained
578
+ * hoisted-write outcome; this one is the TTR dimension and shares the metric's
579
+ * three-value vocabulary.
580
+ */
581
+ export declare const ResumeSetupSource: (value: "run_started" | "hook_preload" | "event_load") => {
582
+ [k: string]: "run_started" | "hook_preload" | "event_load";
583
+ };
584
+ /** Whether the measured step ran in the resuming invocation or a queued one. */
585
+ export declare const ResumeStepExecution: (value: "inline" | "dispatched") => {
586
+ [k: string]: "inline" | "dispatched";
587
+ };
199
588
  /** Number of webhook handlers triggered */
200
589
  export declare const WebhookHandlersTriggered: (value: number) => {
201
590
  [k: string]: number;
@@ -216,6 +605,10 @@ export declare const WorkflowSuspensionWaitCount: (value: number) => {
216
605
  export declare const HttpRequestMethod: (value: string) => {
217
606
  [k: string]: string;
218
607
  };
608
+ /** Route pattern for the request (standard OTEL: http.route) */
609
+ export declare const HttpRoute: (value: string) => {
610
+ [k: string]: string;
611
+ };
219
612
  /** Full URL of the request (standard OTEL: url.full) */
220
613
  export declare const UrlFull: (value: string) => {
221
614
  [k: string]: string;
@@ -256,6 +649,44 @@ export declare const QueueExecutionTimeMs: (value: number) => {
256
649
  export declare const QueueSerializeTimeMs: (value: number) => {
257
650
  [k: string]: number;
258
651
  };
652
+ /** Whether this serialize/deserialize was a write or read. */
653
+ export declare const SerializationOperation: (value: "serialize" | "deserialize") => {
654
+ [k: string]: "serialize" | "deserialize";
655
+ };
656
+ /** Whether a compression codec was applied (write) / present (read). */
657
+ export declare const SerializationCompressed: (value: boolean) => {
658
+ [k: string]: boolean;
659
+ };
660
+ /** Which compression codec applied / was present (`zstd`, `gzip`, or `none`). */
661
+ export declare const SerializationCodec: (value: "zstd" | "gzip" | "none") => {
662
+ [k: string]: "zstd" | "gzip" | "none";
663
+ };
664
+ /** Logical (uncompressed, devalue-prefixed) payload size in bytes. */
665
+ export declare const SerializationUncompressedBytes: (value: number) => {
666
+ [k: string]: number;
667
+ };
668
+ /** Stored (post-compression, pre-encryption) payload size in bytes. */
669
+ export declare const SerializationStoredBytes: (value: number) => {
670
+ [k: string]: number;
671
+ };
672
+ /** Fraction of bytes saved by compression (0..1); set only when compressed. */
673
+ export declare const SerializationCompressionRatio: (value: number) => {
674
+ [k: string]: number;
675
+ };
676
+ /**
677
+ * Number of workflow (guest) code executions serialization could not avoid
678
+ * (getters, proxies, custom serializers); set only when non-zero.
679
+ */
680
+ export declare const SerializationGuestCodeExecutions: (value: number) => {
681
+ [k: string]: number;
682
+ };
683
+ /**
684
+ * Deduplicated `kind (detail)` descriptions of the guest-code executions;
685
+ * set only when non-zero.
686
+ */
687
+ export declare const SerializationGuestCodeDetails: (value: string[]) => {
688
+ [k: string]: string[];
689
+ };
259
690
  /** The remote service name for Datadog service maps (Datadog-specific: peer.service) */
260
691
  export declare const PeerService: (value: string) => {
261
692
  [k: string]: string;