@usearazzo/runner 1.0.1-alpha.34 → 1.0.1-alpha.36

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 (53) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +6 -1
  3. package/dist/arazzo-runner.browser.js +2212 -1116
  4. package/dist/arazzo-runner.browser.min.js +1 -1
  5. package/package.json +78 -25
  6. package/src/errors/ExecutionError.cjs +2 -0
  7. package/src/errors/ExecutionError.mjs +2 -0
  8. package/src/executor/OpenAPIOperationExecutor.cjs +58 -47
  9. package/src/executor/OpenAPIOperationExecutor.mjs +58 -47
  10. package/src/executor/WorkflowExecutor.cjs +302 -160
  11. package/src/executor/WorkflowExecutor.mjs +302 -160
  12. package/src/index.cjs +14 -0
  13. package/src/index.mjs +2 -0
  14. package/src/observability/EventChannel.cjs +30 -20
  15. package/src/observability/EventChannel.mjs +30 -23
  16. package/src/observability/Redactor.cjs +7 -5
  17. package/src/observability/Redactor.mjs +7 -5
  18. package/src/observability/combineObservers.cjs +18 -0
  19. package/src/observability/combineObservers.mjs +12 -0
  20. package/src/observability/instrument.cjs +159 -0
  21. package/src/observability/instrument.mjs +144 -0
  22. package/src/observability/logging/LoggingObserver.cjs +177 -0
  23. package/src/observability/logging/LoggingObserver.mjs +172 -0
  24. package/src/observability/logging/index.cjs +13 -0
  25. package/src/observability/logging/index.mjs +1 -0
  26. package/src/observability/opentelemetry/ArazzoRunnerInstrumentation.cjs +321 -0
  27. package/src/observability/opentelemetry/ArazzoRunnerInstrumentation.mjs +313 -0
  28. package/src/observability/opentelemetry/index.cjs +13 -0
  29. package/src/observability/opentelemetry/index.mjs +1 -0
  30. package/src/observability/stream/EventStream.cjs +112 -0
  31. package/src/observability/stream/EventStream.mjs +107 -0
  32. package/src/observability/stream/index.cjs +13 -0
  33. package/src/observability/stream/index.mjs +1 -0
  34. package/src/registry/DocumentRegistry.cjs +14 -9
  35. package/src/registry/DocumentRegistry.mjs +14 -9
  36. package/src/vendor/swagger-client.cjs +1 -1
  37. package/src/vendor/swagger-client.mjs +1 -1
  38. package/src/version.cjs +9 -0
  39. package/src/version.mjs +3 -0
  40. package/types/observability/logging/LoggingObserver.d.cts +82 -0
  41. package/types/observability/logging/LoggingObserver.d.ts +82 -0
  42. package/types/observability/logging/index.d.cts +2 -0
  43. package/types/observability/logging/index.d.ts +2 -0
  44. package/types/observability/opentelemetry/ArazzoRunnerInstrumentation.d.cts +84 -0
  45. package/types/observability/opentelemetry/ArazzoRunnerInstrumentation.d.ts +84 -0
  46. package/types/observability/opentelemetry/index.d.cts +2 -0
  47. package/types/observability/opentelemetry/index.d.ts +2 -0
  48. package/types/observability/stream/EventStream.d.cts +68 -0
  49. package/types/observability/stream/EventStream.d.ts +68 -0
  50. package/types/observability/stream/index.d.cts +2 -0
  51. package/types/observability/stream/index.d.ts +2 -0
  52. package/types/runner.d.cts +3891 -0
  53. package/types/runner.d.ts +137 -40
package/types/runner.d.ts CHANGED
@@ -10,7 +10,7 @@ import { OperationElement } from '@speclynx/apidom-ns-openapi-2';
10
10
  import { OperationElement as OperationElement_2 } from '@speclynx/apidom-ns-openapi-3-0';
11
11
  import { OperationElement as OperationElement_3 } from '@speclynx/apidom-ns-openapi-3-1';
12
12
  import { ParseResultElement } from '@usearazzo/parser';
13
- import type { PartialDeep } from 'type-fest';
13
+ import type { PartialOptions } from '@usearazzo/parser';
14
14
  import { PathItemElement } from '@speclynx/apidom-ns-openapi-2';
15
15
  import { PathItemElement as PathItemElement_2 } from '@speclynx/apidom-ns-openapi-3-0';
16
16
  import { PathItemElement as PathItemElement_3 } from '@speclynx/apidom-ns-openapi-3-1';
@@ -84,7 +84,7 @@ export declare class ActionResolver {
84
84
  * @public
85
85
  */
86
86
  export declare interface ActionSelectedEvent extends WorkflowExecutionStepEventBase {
87
- readonly type: 'action-selected';
87
+ readonly type: 'action:selected';
88
88
  /**
89
89
  * Where the selected action is written; absent when no action was
90
90
  * selected.
@@ -263,7 +263,7 @@ export declare class ArazzoRunnerError extends ApiDOMStructuredError {
263
263
  *
264
264
  * Events carry no level or severity, like Node's `diagnostics_channel`
265
265
  * messages: how to log an event is the logging consumer's decision. The
266
- * `document-*`, `workflow-normalize-*` and `openapi-operation-*` events describe the
266
+ * `document:*`, `workflow:normalize:*` and `openapi:operation:*` events describe the
267
267
  * machinery under a run, the detail a debug log would show.
268
268
  * @public
269
269
  */
@@ -578,7 +578,7 @@ export declare class ArazzoWorkflowNormalizer {
578
578
  * Options for normalizing an Arazzo workflow.
579
579
  * @public
580
580
  */
581
- export declare type ArazzoWorkflowNormalizerOptions = PartialDeep<ApiDOMReferenceOptions>;
581
+ export declare type ArazzoWorkflowNormalizerOptions = PartialOptions<ApiDOMReferenceOptions>;
582
582
 
583
583
  /** @public */
584
584
  export declare class AssemblerError extends ArazzoRunnerError {
@@ -593,6 +593,16 @@ export declare class ClientError extends ArazzoRunnerError {
593
593
  readonly uri?: string;
594
594
  }
595
595
 
596
+ /**
597
+ * One observer that hands each event to every observer given, in order, so
598
+ * several consumers (a log, a trace, a stream) can watch the same run.
599
+ *
600
+ * Delivery stays synchronous. An observer that throws aborts the run with its
601
+ * error, as any observer does, and the observers after it miss that event.
602
+ * @public
603
+ */
604
+ export declare const combineObservers: <E extends ArazzoRunnerEvent = ArazzoRunnerEvent>(...observers: readonly ArazzoRunnerObserver<E>[]) => ArazzoRunnerObserver<E>;
605
+
596
606
  /**
597
607
  * A read-only source of the runtime expression context for a step.
598
608
  *
@@ -687,7 +697,7 @@ export declare type CriterionErrorReason = (typeof CriterionError)[Exclude<keyof
687
697
  * @public
688
698
  */
689
699
  export declare interface CriterionEvaluatedEvent extends WorkflowExecutionStepEventBase {
690
- readonly type: 'criterion-evaluated';
700
+ readonly type: 'criterion:evaluated';
691
701
  /**
692
702
  * Where the criterion is written.
693
703
  */
@@ -739,7 +749,7 @@ export declare interface CriterionEvaluationRecord {
739
749
  *
740
750
  * A whole body (`$response.body`, `$request.body`) is recorded as the
741
751
  * placeholder `[body]`, so the trace never holds a body; the body and its
742
- * size are in the attempt's `openapi-operation-request-settled` event.
752
+ * size are in the attempt's `openapi:operation:request:settled` event.
743
753
  */
744
754
  readonly values: Readonly<Record<string, unknown>>;
745
755
  /**
@@ -878,7 +888,7 @@ export declare type CriterionPredicate = (criterion: CriterionElement, action: S
878
888
  * @public
879
889
  */
880
890
  export declare interface DependencySettledEvent extends WorkflowExecutionEventBase {
881
- readonly type: 'dependency-settled';
891
+ readonly type: 'dependency:settled';
882
892
  readonly dependency: WorkflowExecutionDependency;
883
893
  /**
884
894
  * Whether the prerequisite had already completed earlier in this run and was
@@ -895,7 +905,7 @@ export declare interface DependencySettledEvent extends WorkflowExecutionEventBa
895
905
  * @public
896
906
  */
897
907
  export declare interface DependencyStartEvent extends WorkflowExecutionEventBase {
898
- readonly type: 'dependency-start';
908
+ readonly type: 'dependency:start';
899
909
  /**
900
910
  * Where the `dependsOn` entry is written.
901
911
  */
@@ -915,7 +925,7 @@ export declare class DocumentLoadError extends ArazzoRunnerError {
915
925
  * @public
916
926
  */
917
927
  export declare interface DocumentLoadSettledEvent extends ArazzoRunnerEventBase {
918
- readonly type: 'document-load-settled';
928
+ readonly type: 'document:load:settled';
919
929
  readonly uri: string;
920
930
  }
921
931
 
@@ -928,7 +938,7 @@ export declare interface DocumentLoadSettledEvent extends ArazzoRunnerEventBase
928
938
  * @public
929
939
  */
930
940
  export declare interface DocumentLoadStartEvent extends ArazzoRunnerEventBase {
931
- readonly type: 'document-load-start';
941
+ readonly type: 'document:load:start';
932
942
  /**
933
943
  * The canonical URI of the document.
934
944
  */
@@ -1095,7 +1105,7 @@ export declare abstract class DocumentRegistryProvider {
1095
1105
  * Options for a document registry provider.
1096
1106
  * @public
1097
1107
  */
1098
- export declare type DocumentRegistryProviderOptions = PartialDeep<ApiDOMReferenceOptions>;
1108
+ export declare type DocumentRegistryProviderOptions = PartialOptions<ApiDOMReferenceOptions>;
1099
1109
 
1100
1110
  /**
1101
1111
  * Carries a `reason`, one of the class's static reason fields.
@@ -1118,6 +1128,8 @@ export declare class ExecutionError extends ArazzoRunnerError {
1118
1128
  static readonly GotoTargetMissing: "goto-target-missing";
1119
1129
  /** A `goto` action's `stepId` names no step in the workflow. */
1120
1130
  static readonly GotoTargetNotFound: "goto-target-not-found";
1131
+ /** A process-wide instrumentation wrap (see `instrument`) settled without running its workflow or step. */
1132
+ static readonly InstrumentationWrap: "instrumentation-wrap";
1121
1133
  /** An `operationId` or `operationPath` is not a valid operation reference. */
1122
1134
  static readonly InvalidOperationReference: "invalid-operation-reference";
1123
1135
  /** A `workflowId` is not a valid `$sourceDescriptions.{name}.{workflowId}` expression. */
@@ -1219,6 +1231,79 @@ export declare type HTTPClient = (request: OpenAPIOperationRequest) => Promise<R
1219
1231
  */
1220
1232
  export declare const httpClientFetch: HTTPClient;
1221
1233
 
1234
+ /**
1235
+ * Applies `hooks` to every runner in the process, until the returned
1236
+ * function removes them: the seam process-wide tooling, such as the
1237
+ * OpenTelemetry instrumentation, is built on. A run already in progress
1238
+ * picks hooks up at its next event or operation, and drops removed ones the
1239
+ * same way: a removed hook misses the settled events of what it saw start.
1240
+ * Hooks apply in the order they were added, the first wrap outermost.
1241
+ * @public
1242
+ */
1243
+ export declare const instrument: (hooks: InstrumentationHooks) => (() => void);
1244
+
1245
+ /**
1246
+ * Hooks that apply to every runner in the process, on top of the observer
1247
+ * each was given.
1248
+ * @public
1249
+ */
1250
+ export declare interface InstrumentationHooks {
1251
+ /**
1252
+ * Receives every event of every building block, after the block's own
1253
+ * observer, under the same rules: synchronously, never awaited, and a throw
1254
+ * aborts what emitted it. Events carry what the run saw, credentials
1255
+ * included.
1256
+ */
1257
+ readonly observer?: ArazzoRunnerObserver;
1258
+ /** Runs around each workflow invocation and each step. */
1259
+ readonly wrap?: InstrumentationWrap;
1260
+ }
1261
+
1262
+ /**
1263
+ * Runs around each workflow invocation and each step, so what `run` does
1264
+ * happens inside it: in the active context of a span it opened, for one. It
1265
+ * must call `run`, and should settle once `run` settles; a second call runs
1266
+ * nothing again. What it resolves or rejects with does not change the run:
1267
+ * the run's own outcome stands, once the run settled, and the operation's
1268
+ * settled event says what it was.
1269
+ * @public
1270
+ */
1271
+ export declare type InstrumentationWrap = (operation: InstrumentedOperation, run: () => Promise<void>) => Promise<void>;
1272
+
1273
+ /**
1274
+ * What an {@link InstrumentationWrap} runs around.
1275
+ * @public
1276
+ */
1277
+ export declare type InstrumentedOperation = InstrumentedWorkflow | InstrumentedStep;
1278
+
1279
+ /**
1280
+ * A step an {@link InstrumentationWrap} runs around: its `step:start`, its
1281
+ * attempts and requests, and its `step:settled`.
1282
+ * @public
1283
+ */
1284
+ export declare interface InstrumentedStep {
1285
+ readonly kind: 'step';
1286
+ readonly runId: string;
1287
+ readonly workflowId: string;
1288
+ readonly path: readonly string[];
1289
+ readonly stepId: string;
1290
+ readonly location: DocumentLocation;
1291
+ }
1292
+
1293
+ /**
1294
+ * A workflow invocation an {@link InstrumentationWrap} runs around: its
1295
+ * `workflow:start`, its steps and its `workflow:settled`.
1296
+ * @public
1297
+ */
1298
+ export declare interface InstrumentedWorkflow {
1299
+ readonly kind: 'workflow';
1300
+ readonly runId: string;
1301
+ readonly workflowId: string;
1302
+ readonly path: readonly string[];
1303
+ readonly via: WorkflowCallVia;
1304
+ readonly location: DocumentLocation;
1305
+ }
1306
+
1222
1307
  /** @public */
1223
1308
  export declare class InvalidEntryDocumentError extends ArazzoRunnerError {
1224
1309
  readonly uri?: string;
@@ -1292,7 +1377,7 @@ export declare class OpenAPI2OperationNormalizer {
1292
1377
  * Options for normalizing an OpenAPI 2.0 operation.
1293
1378
  * @public
1294
1379
  */
1295
- export declare type OpenAPI2OperationNormalizerOptions = PartialDeep<ApiDOMReferenceOptions>;
1380
+ export declare type OpenAPI2OperationNormalizerOptions = PartialOptions<ApiDOMReferenceOptions>;
1296
1381
 
1297
1382
  /**
1298
1383
  * Assembles a standalone OpenAPI 3.0 document from a
@@ -1328,7 +1413,7 @@ export declare class OpenAPI30OperationNormalizer {
1328
1413
  * Options for normalizing an OpenAPI 3.0 operation.
1329
1414
  * @public
1330
1415
  */
1331
- export declare type OpenAPI30OperationNormalizerOptions = PartialDeep<ApiDOMReferenceOptions>;
1416
+ export declare type OpenAPI30OperationNormalizerOptions = PartialOptions<ApiDOMReferenceOptions>;
1332
1417
 
1333
1418
  /**
1334
1419
  * Assembles a standalone OpenAPI 3.1 document from a
@@ -1366,7 +1451,7 @@ export declare class OpenAPI31OperationNormalizer {
1366
1451
  * Options for normalizing an OpenAPI 3.1 operation.
1367
1452
  * @public
1368
1453
  */
1369
- export declare type OpenAPI31OperationNormalizerOptions = PartialDeep<ApiDOMReferenceOptions>;
1454
+ export declare type OpenAPI31OperationNormalizerOptions = PartialOptions<ApiDOMReferenceOptions>;
1370
1455
 
1371
1456
  /**
1372
1457
  * An OpenAPI document held by the document registry.
@@ -1440,7 +1525,7 @@ export declare type OpenAPIDocumentRegistryProviderOptions = DocumentRegistryPro
1440
1525
  * @public
1441
1526
  */
1442
1527
  export declare interface OpenAPIOperationAssembledEvent extends OpenAPIOperationEventBase {
1443
- readonly type: 'openapi-operation-assembled';
1528
+ readonly type: 'openapi:operation:assembled';
1444
1529
  }
1445
1530
 
1446
1531
  /**
@@ -1671,7 +1756,7 @@ export declare interface OpenAPIOperationExecutorOptions {
1671
1756
  */
1672
1757
  readonly now?: () => number;
1673
1758
  /**
1674
- * Whether the `openapi-operation-request-*` events carry the request and
1759
+ * Whether the `openapi:operation:request:*` events carry the request and
1675
1760
  * response bodies. Off by default.
1676
1761
  */
1677
1762
  readonly captureBodies?: boolean;
@@ -1824,7 +1909,7 @@ export declare interface OpenAPIOperationNormalizerOptions {
1824
1909
  * @public
1825
1910
  */
1826
1911
  export declare interface OpenAPIOperationNormalizeSettledEvent extends OpenAPIOperationEventBase {
1827
- readonly type: 'openapi-operation-normalize-settled';
1912
+ readonly type: 'openapi:operation:normalize:settled';
1828
1913
  }
1829
1914
 
1830
1915
  /**
@@ -1833,7 +1918,7 @@ export declare interface OpenAPIOperationNormalizeSettledEvent extends OpenAPIOp
1833
1918
  * @public
1834
1919
  */
1835
1920
  export declare interface OpenAPIOperationNormalizeStartEvent extends OpenAPIOperationEventBase {
1836
- readonly type: 'openapi-operation-normalize-start';
1921
+ readonly type: 'openapi:operation:normalize:start';
1837
1922
  }
1838
1923
 
1839
1924
  /**
@@ -1937,7 +2022,7 @@ export declare interface OpenAPIOperationRequestInfo {
1937
2022
  * @public
1938
2023
  */
1939
2024
  export declare interface OpenAPIOperationRequestSettledEvent extends OpenAPIOperationEventBase {
1940
- readonly type: 'openapi-operation-request-settled';
2025
+ readonly type: 'openapi:operation:request:settled';
1941
2026
  readonly response: {
1942
2027
  readonly status: number;
1943
2028
  readonly headers: Readonly<Record<string, string>>;
@@ -1961,7 +2046,7 @@ export declare interface OpenAPIOperationRequestSettledEvent extends OpenAPIOper
1961
2046
  * @public
1962
2047
  */
1963
2048
  export declare interface OpenAPIOperationRequestStartEvent extends OpenAPIOperationEventBase {
1964
- readonly type: 'openapi-operation-request-start';
2049
+ readonly type: 'openapi:operation:request:start';
1965
2050
  readonly request: {
1966
2051
  readonly method: string;
1967
2052
  readonly url: string;
@@ -2150,7 +2235,8 @@ export declare class OutputResolver extends ArazzoValueResolver {
2150
2235
  * - a request or response body that is JSON or a URL-encoded form, field by
2151
2236
  * field, and any other body, or any object that is not plain data, whole.
2152
2237
  *
2153
- * A credential under a name no pattern matches is carried as it is. The
2238
+ * A settled event's `error` is carried as it is, the error `execute` rejects
2239
+ * with. A credential under a name no pattern matches is carried as it is. The
2154
2240
  * masked value is `REDACTED`.
2155
2241
  * @public
2156
2242
  */
@@ -2435,7 +2521,7 @@ export declare interface RetryReferenceRecord {
2435
2521
  * @public
2436
2522
  */
2437
2523
  export declare interface RetryReferenceSettledEvent extends WorkflowExecutionStepEventBase {
2438
- readonly type: 'retry-reference-settled';
2524
+ readonly type: 'retry:reference:settled';
2439
2525
  readonly attempt: number;
2440
2526
  readonly kind: RetryReferenceRecord['kind'];
2441
2527
  readonly id: RetryReferenceRecord['id'];
@@ -2447,7 +2533,7 @@ export declare interface RetryReferenceSettledEvent extends WorkflowExecutionSte
2447
2533
  * @public
2448
2534
  */
2449
2535
  export declare interface RetryReferenceStartEvent extends WorkflowExecutionStepEventBase {
2450
- readonly type: 'retry-reference-start';
2536
+ readonly type: 'retry:reference:start';
2451
2537
  /**
2452
2538
  * Where the `retry` action that names the reference is written.
2453
2539
  */
@@ -2463,7 +2549,7 @@ export declare interface RetryReferenceStartEvent extends WorkflowExecutionStepE
2463
2549
  * @public
2464
2550
  */
2465
2551
  export declare interface RetryWaitEvent extends WorkflowExecutionStepEventBase {
2466
- readonly type: 'retry-wait';
2552
+ readonly type: 'retry:wait';
2467
2553
  readonly attempt: number;
2468
2554
  readonly delayMs: number;
2469
2555
  }
@@ -2816,7 +2902,7 @@ export declare abstract class SourceDescriptionsLocatorNormalizer {
2816
2902
  * @public
2817
2903
  */
2818
2904
  export declare interface StepAttemptEvent extends WorkflowExecutionStepEventBase {
2819
- readonly type: 'step-attempt';
2905
+ readonly type: 'step:attempt';
2820
2906
  /**
2821
2907
  * The attempt number, starting at 1. Each `retry` increments it. The
2822
2908
  * attempt a `retry` reference makes at another step is that reference's
@@ -3133,21 +3219,25 @@ export declare interface StepScope {
3133
3219
  }
3134
3220
 
3135
3221
  /**
3136
- * A step settled: its retries are done and its terminal action is selected.
3222
+ * A step settled: its retries are done and its terminal action is selected,
3223
+ * or it threw. A step that threw is not `successful` and carries the `error`.
3137
3224
  * @public
3138
3225
  */
3139
3226
  export declare interface StepSettledEvent extends WorkflowExecutionStepEventBase {
3140
- readonly type: 'step-settled';
3227
+ readonly type: 'step:settled';
3141
3228
  readonly successful: boolean;
3229
+ /** The attempts made, the one that threw included. */
3142
3230
  readonly attempts: number;
3231
+ /** What the step threw, as for {@link WorkflowSettledEvent.error}. */
3232
+ readonly error?: unknown;
3143
3233
  }
3144
3234
 
3145
3235
  /**
3146
- * A step began. Its attempts follow it.
3236
+ * A step began. Its attempts follow it, and its `step:settled` always does.
3147
3237
  * @public
3148
3238
  */
3149
3239
  export declare interface StepStartEvent extends WorkflowExecutionStepEventBase {
3150
- readonly type: 'step-start';
3240
+ readonly type: 'step:start';
3151
3241
  /**
3152
3242
  * Where the step is written.
3153
3243
  */
@@ -3303,7 +3393,7 @@ export declare interface WorkflowExecuteOptions {
3303
3393
  }
3304
3394
 
3305
3395
  /**
3306
- * The workflow a `dependency-*` event is about.
3396
+ * The workflow a `dependency:*` event is about.
3307
3397
  * @public
3308
3398
  */
3309
3399
  export declare interface WorkflowExecutionDependency {
@@ -3325,7 +3415,7 @@ export declare interface WorkflowExecutionDependency {
3325
3415
  /**
3326
3416
  * An event the {@link WorkflowExecutor} emits, discriminated by `type`.
3327
3417
  *
3328
- * The events other than `workflow-normalize-*` mark the boundaries the
3418
+ * The events other than `workflow:normalize:*` mark the boundaries the
3329
3419
  * {@link WorkflowExecutionResult} trace records, plus the criterion and
3330
3420
  * action decisions behind each step, so folding a run's events rebuilds its
3331
3421
  * trace. A workflow's or step's start and settled events are stamped with the
@@ -3353,7 +3443,7 @@ export declare interface WorkflowExecutionEventBase extends ArazzoRunnerEventBas
3353
3443
  readonly runId: string;
3354
3444
  /**
3355
3445
  * The bare id of the workflow in progress when the event fired. For a
3356
- * `dependency-*` event, this is the dependent workflow, not the dependency.
3446
+ * `dependency:*` event, this is the dependent workflow, not the dependency.
3357
3447
  */
3358
3448
  readonly workflowId: string;
3359
3449
  /**
@@ -3664,7 +3754,7 @@ export declare type WorkflowId = string;
3664
3754
  * @public
3665
3755
  */
3666
3756
  export declare interface WorkflowNormalizeSettledEvent extends WorkflowExecutionEventBase {
3667
- readonly type: 'workflow-normalize-settled';
3757
+ readonly type: 'workflow:normalize:settled';
3668
3758
  /**
3669
3759
  * Where the workflow is written.
3670
3760
  */
@@ -3679,7 +3769,7 @@ export declare interface WorkflowNormalizeSettledEvent extends WorkflowExecution
3679
3769
  * @public
3680
3770
  */
3681
3771
  export declare interface WorkflowNormalizeStartEvent extends WorkflowExecutionEventBase {
3682
- readonly type: 'workflow-normalize-start';
3772
+ readonly type: 'workflow:normalize:start';
3683
3773
  /**
3684
3774
  * Where the workflow is written.
3685
3775
  */
@@ -3734,25 +3824,32 @@ export declare interface WorkflowReferenceContext {
3734
3824
  }
3735
3825
 
3736
3826
  /**
3737
- * A workflow invocation produced its result. The fields repeat the
3738
- * {@link WorkflowExecutionResult} fields of the same name.
3827
+ * A workflow invocation produced its result, or threw. The fields repeat
3828
+ * the {@link WorkflowExecutionResult} fields of the same name; an invocation
3829
+ * that threw settles as `failed`, with no outputs, and carries the `error`.
3739
3830
  * @public
3740
3831
  */
3741
3832
  export declare interface WorkflowSettledEvent extends WorkflowExecutionEventBase {
3742
- readonly type: 'workflow-settled';
3833
+ readonly type: 'workflow:settled';
3743
3834
  readonly status: WorkflowExecutionResult['status'];
3744
3835
  readonly settledStatus: WorkflowExecutionResult['settledStatus'];
3745
3836
  readonly outputs: WorkflowExecutionResult['outputs'];
3837
+ /**
3838
+ * What the invocation threw, as `execute` rejects with it: an
3839
+ * {@link ArazzoRunnerError} for an error in the document, an abort, or the
3840
+ * transport's own error. Only when it threw.
3841
+ */
3842
+ readonly error?: unknown;
3746
3843
  }
3747
3844
 
3748
3845
  /**
3749
3846
  * A workflow invocation began: it entered the call stack, before it is
3750
- * normalized and its definition checked. A definition that fails those checks
3751
- * throws, leaving the event without its `workflow-settled`.
3847
+ * normalized and its definition checked. Its `workflow:settled` always
3848
+ * follows, carrying the `error` when the invocation throws.
3752
3849
  * @public
3753
3850
  */
3754
3851
  export declare interface WorkflowStartEvent extends WorkflowExecutionEventBase {
3755
- readonly type: 'workflow-start';
3852
+ readonly type: 'workflow:start';
3756
3853
  /** Where the workflow is written. */
3757
3854
  readonly location: DocumentLocation;
3758
3855
  /**