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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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.38](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.37...v1.0.1-alpha.38) (2026-11-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **runner:** reject a workflow without steps ([#391](https://github.com/usearazzo/arazzo-toolkit/issues/391)) ([ac3927f](https://github.com/usearazzo/arazzo-toolkit/commit/ac3927f1d3a894f348ae95f627e4558078304773)), closes [#338](https://github.com/usearazzo/arazzo-toolkit/issues/338)
11
+
12
+ ## [1.0.1-alpha.37](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.36...v1.0.1-alpha.37) (2026-11-27)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **runner:** wrap a response body read failure as ClientError ([#390](https://github.com/usearazzo/arazzo-toolkit/issues/390)) ([a203801](https://github.com/usearazzo/arazzo-toolkit/commit/a203801bcbeed381b85e19c39c0d6d3ab62e8e1a)), closes [#389](https://github.com/usearazzo/arazzo-toolkit/issues/389)
17
+
6
18
  ## [1.0.1-alpha.36](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.35...v1.0.1-alpha.36) (2026-11-26)
7
19
 
8
20
  ### Bug Fixes
@@ -11299,7 +11299,7 @@ class ExecutionError extends _ArazzoRunnerError_ts__WEBPACK_IMPORTED_MODULE_0__[
11299
11299
  static InvalidWorkflowReference = 'invalid-workflow-reference';
11300
11300
  /** A workflow's `dependsOn` is not a list or holds a non-string entry. */
11301
11301
  static MalformedDependsOn = 'malformed-dependsOn';
11302
- /** A workflow's `steps` is not a list or holds an entry that is not a Step Object. */
11302
+ /** A workflow's `steps` is absent, empty, not a list, or holds an entry that is not a Step Object. */
11303
11303
  static MalformedSteps = 'malformed-steps';
11304
11304
  /** A step run as an operation declares neither an `operationId` nor an `operationPath`. */
11305
11305
  static MissingOperation = 'missing-operation';
@@ -11891,7 +11891,8 @@ const IGNORED_HEADERS = new Set(['accept', 'authorization', 'content-type']);
11891
11891
  * sends it through the pluggable {@link HTTPClient}, and normalizes the raw
11892
11892
  * `Response` into the runner's response model. A non-2xx status is a valid
11893
11893
  * outcome (judged by a step's `successCriteria`) and is returned, never
11894
- * thrown; a transport failure is wrapped as a {@link ClientError}.
11894
+ * thrown; a transport failure, a response body that cannot be read in full
11895
+ * included, is wrapped as a {@link ClientError}.
11895
11896
  *
11896
11897
  * The executor is Arazzo-agnostic: it neither locates the operation (that is
11897
11898
  * the operation locator normalizer's concern) nor resolves parameters or
@@ -12071,10 +12072,26 @@ class OpenAPIOperationExecutor {
12071
12072
  } catch (error) {
12072
12073
  throw new _errors_ClientError_ts__WEBPACK_IMPORTED_MODULE_15__["default"]('OpenAPI operation request failed', {
12073
12074
  operationPath: locator.jsonPointer,
12075
+ uri: locator.document.uri,
12076
+ cause: error
12077
+ });
12078
+ }
12079
+
12080
+ // the transport resolves once the headers are in, so a connection lost
12081
+ // while the body streams fails here, inside the normalizer that reads it,
12082
+ // and is as much a transport failure as a request that never got a
12083
+ // response. Anything else the normalizer throws is reported the same way:
12084
+ // either way there is no response to hand to the step.
12085
+ let response;
12086
+ try {
12087
+ response = await this.#responseNormalizer.normalize(rawResponse, requestInfo);
12088
+ } catch (error) {
12089
+ throw new _errors_ClientError_ts__WEBPACK_IMPORTED_MODULE_15__["default"]('OpenAPI operation response could not be read', {
12090
+ operationPath: locator.jsonPointer,
12091
+ uri: locator.document.uri,
12074
12092
  cause: error
12075
12093
  });
12076
12094
  }
12077
- const response = await this.#responseNormalizer.normalize(rawResponse, requestInfo);
12078
12095
  if (this.#events.hasObservers) {
12079
12096
  this.#events.emit({
12080
12097
  type: 'openapi:operation:request:settled',
@@ -14788,8 +14805,8 @@ class WorkflowExecutor {
14788
14805
  * it is named a call cycle, not a dependency one, and charged one unit
14789
14806
  * for entering the reference itself, matching the "1 for the step itself
14790
14807
  * plus whatever its sub-run spends" convention a sub-workflow step
14791
- * already follows (without it, a reference to a workflow with few or no
14792
- * steps of its own would cost nothing to fire). Its inputs are the
14808
+ * already follows (without it, a reference to a one-step workflow would
14809
+ * cost no more than that step to fire). Its inputs are the
14793
14810
  * action's `parameters` (`#115`), resolved again on every firing
14794
14811
  * against the attempt that fired it — `{}` without them. Its outputs are
14795
14812
  * recorded via `state.setWorkflow`, which *is* "context transfers back",
@@ -15411,13 +15428,24 @@ class WorkflowExecutor {
15411
15428
  }
15412
15429
 
15413
15430
  /**
15414
- * The workflow's steps as an array in list order. An absent `steps` is a
15415
- * workflow with no steps — an empty list, a completed no-op run. A present but
15416
- * malformed `steps` (not a list, or holding a non-step entry) is an authoring
15417
- * error and throws rather than being silently treated as empty or partial.
15431
+ * The workflow's steps as an array in list order. `steps` is a REQUIRED field
15432
+ * holding at least one step, and the validator reports an absent or empty one
15433
+ * as an Error, so neither runs as a completed no-op. Those, like a `steps`
15434
+ * that is not a list or holds a non-step entry, are authoring errors and
15435
+ * throw rather than being silently treated as empty or partial.
15436
+ *
15437
+ * Checked when the workflow is entered, before any of its own prerequisites
15438
+ * or steps. A workflow another one only references (a `goto` target, a retry
15439
+ * reference) is therefore rejected when the run reaches it, after the
15440
+ * requests sent on the way there.
15418
15441
  */
15419
15442
  #orderedSteps(workflow, workflowId) {
15420
- if (!workflow.hasKey('steps')) return [];
15443
+ if (!workflow.hasKey('steps')) {
15444
+ throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has no "steps"`, {
15445
+ workflowId,
15446
+ reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedSteps
15447
+ });
15448
+ }
15421
15449
  const steps = workflow.steps;
15422
15450
  if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isArrayElement)(steps)) {
15423
15451
  throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has a non-list "steps"`, {
@@ -15425,6 +15453,12 @@ class WorkflowExecutor {
15425
15453
  reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedSteps
15426
15454
  });
15427
15455
  }
15456
+ if (steps.isEmpty) {
15457
+ throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has an empty "steps"`, {
15458
+ workflowId,
15459
+ reason: _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"].MalformedSteps
15460
+ });
15461
+ }
15428
15462
  return [...steps].map((step, index) => {
15429
15463
  if (!(0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_4__.isStepElement)(step)) {
15430
15464
  throw new _errors_ExecutionError_ts__WEBPACK_IMPORTED_MODULE_17__["default"](`workflow "${workflowId}" has a non-step entry at steps[${index}]`, {