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

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 (66) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +10 -1
  3. package/dist/arazzo-runner.browser.js +1789 -403
  4. package/dist/arazzo-runner.browser.min.js +1 -1
  5. package/package.json +18 -17
  6. package/src/ArazzoRunner.cjs +26 -3
  7. package/src/ArazzoRunner.mjs +26 -3
  8. package/src/action/ActionResolver.cjs +13 -12
  9. package/src/action/ActionResolver.mjs +13 -12
  10. package/src/client/OpenAPIOperationResponse.cjs +9 -0
  11. package/src/client/OpenAPIOperationResponse.mjs +9 -0
  12. package/src/criterion/CriterionEvaluator.cjs +13 -8
  13. package/src/criterion/CriterionEvaluator.mjs +13 -8
  14. package/src/criterion/SimpleCriterionEvaluator.cjs +5 -3
  15. package/src/criterion/SimpleCriterionEvaluator.mjs +6 -4
  16. package/src/document/APIDocument.cjs +53 -0
  17. package/src/document/APIDocument.mjs +53 -0
  18. package/src/executor/OpenAPIOperationExecutor.cjs +66 -6
  19. package/src/executor/OpenAPIOperationExecutor.mjs +66 -6
  20. package/src/executor/OpenAPIOperationLocatorNormalizer.cjs +1 -1
  21. package/src/executor/OpenAPIOperationLocatorNormalizer.mjs +1 -1
  22. package/src/executor/StepExecutor.cjs +34 -15
  23. package/src/executor/StepExecutor.mjs +34 -15
  24. package/src/executor/StepRetryRunner.cjs +5 -3
  25. package/src/executor/StepRetryRunner.mjs +5 -3
  26. package/src/executor/StepTransitionInterpreter.cjs +1 -1
  27. package/src/executor/StepTransitionInterpreter.mjs +1 -1
  28. package/src/executor/WorkflowCallStack.cjs +1 -1
  29. package/src/executor/WorkflowCallStack.mjs +1 -1
  30. package/src/executor/WorkflowExecutor.cjs +277 -61
  31. package/src/executor/WorkflowExecutor.mjs +277 -61
  32. package/src/expression/RuntimeExpressionEvaluator.cjs +52 -9
  33. package/src/expression/RuntimeExpressionEvaluator.mjs +52 -9
  34. package/src/index.cjs +7 -0
  35. package/src/index.mjs +2 -0
  36. package/src/observability/ArazzoRunnerEvent.cjs +5 -0
  37. package/src/observability/ArazzoRunnerEvent.mjs +1 -0
  38. package/src/observability/DocumentRegistryEvent.cjs +5 -0
  39. package/src/observability/DocumentRegistryEvent.mjs +1 -0
  40. package/src/observability/EventChannel.cjs +96 -0
  41. package/src/observability/EventChannel.mjs +91 -0
  42. package/src/observability/OpenAPIOperationEvent.cjs +5 -0
  43. package/src/observability/OpenAPIOperationEvent.mjs +1 -0
  44. package/src/observability/Redactor.cjs +213 -0
  45. package/src/observability/Redactor.mjs +208 -0
  46. package/src/observability/WorkflowExecutionEvent.cjs +5 -0
  47. package/src/observability/WorkflowExecutionEvent.mjs +1 -0
  48. package/src/registry/DocumentRegistry.cjs +57 -11
  49. package/src/registry/DocumentRegistry.mjs +57 -11
  50. package/src/registry/providers/ArazzoDocumentRegistryProvider.cjs +21 -0
  51. package/src/registry/providers/ArazzoDocumentRegistryProvider.mjs +22 -1
  52. package/src/registry/providers/DocumentRegistryProvider.cjs +33 -1
  53. package/src/registry/providers/DocumentRegistryProvider.mjs +33 -1
  54. package/src/registry/providers/OpenAPIDocumentRegistryProvider.cjs +28 -5
  55. package/src/registry/providers/OpenAPIDocumentRegistryProvider.mjs +28 -5
  56. package/src/resolver/ArazzoValueResolver.cjs +6 -3
  57. package/src/resolver/ArazzoValueResolver.mjs +6 -3
  58. package/src/resolver/OpenAPIOperationParameterResolver.cjs +2 -2
  59. package/src/resolver/OpenAPIOperationParameterResolver.mjs +2 -2
  60. package/src/resolver/OutputResolver.cjs +10 -3
  61. package/src/resolver/OutputResolver.mjs +10 -3
  62. package/src/resolver/RequestBodyResolver.cjs +37 -17
  63. package/src/resolver/RequestBodyResolver.mjs +37 -17
  64. package/src/resolver/WorkflowParameterResolver.cjs +2 -2
  65. package/src/resolver/WorkflowParameterResolver.mjs +2 -2
  66. package/types/runner.d.ts +788 -41
package/CHANGELOG.md CHANGED
@@ -3,6 +3,35 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.1-alpha.34](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.33...v1.0.1-alpha.34) (2026-11-19)
7
+
8
+ ### Features
9
+
10
+ - **runner:** emit HTTP request events, redact at export ([#356](https://github.com/usearazzo/arazzo-toolkit/issues/356)) ([e872d25](https://github.com/usearazzo/arazzo-toolkit/commit/e872d25bc6af721c25b0cf0aec515ebf4ab785f3)), closes [#85](https://github.com/usearazzo/arazzo-toolkit/issues/85)
11
+ - **runner:** emit structured execution events to an observer ([#355](https://github.com/usearazzo/arazzo-toolkit/issues/355)) ([3eacded](https://github.com/usearazzo/arazzo-toolkit/commit/3eacdedf2dd777a404433f69e3747006f48ce877)), closes [#85](https://github.com/usearazzo/arazzo-toolkit/issues/85)
12
+ - **runner:** locate events and trace records in their documents ([#362](https://github.com/usearazzo/arazzo-toolkit/issues/362)) ([013c4cb](https://github.com/usearazzo/arazzo-toolkit/commit/013c4cb9d2abb7da3452e44ecf2496007fd9a6b8)), closes [#85](https://github.com/usearazzo/arazzo-toolkit/issues/85)
13
+
14
+ ## [1.0.1-alpha.33](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.32...v1.0.1-alpha.33) (2026-11-16)
15
+
16
+ ### Bug Fixes
17
+
18
+ - **runner:** resolve $sourceDescriptions targets through acquire ([#354](https://github.com/usearazzo/arazzo-toolkit/issues/354)), closes [#74](https://github.com/usearazzo/arazzo-toolkit/issues/74)
19
+
20
+ ### BREAKING CHANGES
21
+
22
+ - **runner:** DocumentRegistry.get is removed; use acquire.
23
+ RuntimeExpressionEvaluator.evaluate, interpolate and resolve return
24
+ Promises. So do CriterionEvaluator.evaluate,
25
+ SimpleCriterionEvaluator.evaluate, ActionResolver.resolveOnSuccess and
26
+ resolveOnFailure, the abstract StepParameterResolver.resolve and the
27
+ protected ArazzoValueResolver.resolveValue, the resolve method of
28
+ OpenAPIOperationParameterResolver, WorkflowParameterResolver,
29
+ OutputResolver and RequestBodyResolver, and StepExecutor.evaluateCriteria
30
+ and selectActions. Resolver callbacks and CriterionPredicate may return
31
+ a Promise. A $sourceDescriptions reference whose document cannot be
32
+ loaded rejects with the load error unless it names a Source Description
33
+ field.
34
+
6
35
  ## [1.0.1-alpha.32](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.31...v1.0.1-alpha.32) (2026-11-13)
7
36
 
8
37
  ### Bug Fixes
package/README.md CHANGED
@@ -41,6 +41,7 @@ Use it to test an API flow end to end in CI, to drive a workflow from your own s
41
41
  - **Steps.** Parameters and request bodies resolved from runtime expressions, `successCriteria` evaluated (`simple`, `regex`, `jsonpath`, `xpath`), `outputs` resolved from the response.
42
42
  - **Control flow.** `goto`, `retry` (with `retryLimit`, `retryAfter`, and references), and `end`, as the specification defines them, with workflow-level default actions and parameters, and action `parameters` as the inputs of a `goto` or `retry` workflow target.
43
43
  - **Composition.** Sub-workflow steps, `dependsOn` prerequisites, one-way transfer to another workflow, and workflows in other Arazzo documents.
44
+ - **Observability.** A typed event stream while the run happens: workflows, dependencies, steps, attempts, criterion outcomes and selected actions, plus document loads, normalization, request assembly and every request sent with its response (bodies on request) underneath. Events carry what the run saw, credentials included; a `Redactor` masks them by name before they leave the process. Folding a run's workflow events gives back its trace.
44
45
  - **Your HTTP stack.** Global `fetch` by default, or any client you plug in. Arazzo is auth-agnostic, so credentials come from you: static ones per API, or a request interceptor.
45
46
 
46
47
  ## At a glance
@@ -58,7 +59,11 @@ A runner is four building blocks, composed bottom-up; `ArazzoRunner` composes th
58
59
  <img alt="Runner architecture: WorkflowExecutor runs steps through StepExecutor, which runs OpenAPI operations through OpenAPIOperationExecutor and the HTTPClient; DocumentRegistry supplies documents to all three executors" src="https://raw.githubusercontent.com/usearazzo/arazzo-toolkit/main/packages/runner/assets/architecture.svg">
59
60
  </p>
60
61
 
61
- A step whose criteria go unmet is a result, not an error: the run resolves with `status: 'failed'`. A criterion whose condition cannot be evaluated (an invalid regex, JSONPath, XPath or simple condition, or non-XML data under an `xpath` query) counts as unmet, as Arazzo 1.1.0 requires, rather than throwing. So does a criterion of a step that calls a workflow when it reads `$statusCode`, `$url`, `$method`, `$request` or `$response`: that step made no HTTP call. Each step record's `successCriteria` and `actionCriteria` list every criterion its last attempt evaluated, as a `CriterionEvaluationRecord` with the condition, whether it was met, the action's name for an action criterion and, when it could not be evaluated, a `diagnostic` with a `code` and `message`, never request or response data. The type-specific criterion evaluators raise an unevaluable condition as `CriterionEvaluationError`, a `CriterionError` subclass, and every `CriterionError` carries a `reason`. `CriterionError`, `ExecutionError`, `ResolverError` and `RuntimeExpressionError` each list the reasons they can carry as static fields (`CriterionError.InvalidRegex`, `ExecutionError.OperationNotFound`), typed by `CriterionErrorReason`, `ExecutionErrorReason`, `ResolverErrorReason` and `RuntimeExpressionErrorReason`. Only a document that cannot be loaded or run as written, a request that cannot be built or sent, or a cancelled run throws, and every such error extends `ArazzoRunnerError`; a document that cannot be read or loaded (a missing file, an HTTP error, an unresolvable reference) throws `DocumentLoadError` with the underlying failure as its `cause`.
62
+ ### Failed runs and errors
63
+
64
+ A failed run is a result, not an exception. When a step's criteria go unmet, the run resolves with `status: 'failed'`. A criterion that can't be evaluated, such as an invalid regex, counts as unmet. Each step in `result.steps` lists its criteria and whether each was met ([The result](https://usearazzo.com/docs/runner/#result)).
65
+
66
+ Only three things throw: a document that can't be loaded or run as written, a request that can't be built or sent, and a cancelled run. Every such error extends `ArazzoRunnerError`, and most carry a `reason` to compare against static fields such as `ExecutionError.WorkflowNotFound` ([Errors](https://usearazzo.com/docs/runner/#errors)).
62
67
 
63
68
  ## Installation
64
69
 
@@ -135,6 +140,10 @@ const result = await runner.execute('authenticateAndOrderPet', {
135
140
  | Use another HTTP stack, a proxy or a client certificate for API calls | `httpClient` | [The HTTP client](https://usearazzo.com/docs/runner/#http-client) |
136
141
  | Load documents behind credentials or mutual TLS | `reference` on `load` | [Document retrieval](https://usearazzo.com/docs/runner/#document-retrieval) |
137
142
  | Cancel a run | `signal` | [Cancellation](https://usearazzo.com/docs/runner/#cancellation) |
143
+ | Watch a run as it happens (progress, logs, debugging) | `observer` | [Observing a run](https://usearazzo.com/docs/runner/#observability) |
144
+ | Include request and response bodies in those events | `captureBodies` | [Observing a run](https://usearazzo.com/docs/runner/#observability) |
145
+ | Give each `location` (on events, and on the result's steps and criteria) its range in the document, not only its JSON Pointer | `sourceMap` on `load` | [Observing a run](https://usearazzo.com/docs/runner/#observability) |
146
+ | Mask credentials before logging or exporting events | `new Redactor().event(event)` | [Observing a run](https://usearazzo.com/docs/runner/#observability) |
138
147
  | Compose the building blocks yourself | `DocumentRegistry`, the executors | [Runner API Reference](https://usearazzo.com/docs/runner/) |
139
148
 
140
149
  Retrieving documents and calling APIs are separate: credentials for one never reach the other.