@parcha/agentrun-dsl 0.1.0-beta.278 → 0.1.0-beta.279
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/dist/workflow.js +8 -4
- package/package.json +1 -1
package/dist/workflow.js
CHANGED
|
@@ -1971,13 +1971,17 @@ export function isItemFailure(error) {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
/** The failure a structure reports when several of its branches (a parallel's, a stopping map's items) fail at once: the
|
|
1973
1973
|
* first, unless that is an item failure and another is not, whichever came first. An item failure never hides a failure a
|
|
1974
|
-
* collecting map must stop on. A sibling that ended on the structure's own stop (its reason, an abort,
|
|
1975
|
-
* provider reports `aborted`, as Jev and OpenRouter report a request cancelled in flight
|
|
1976
|
-
*
|
|
1974
|
+
* collecting map must stop on. A sibling that ended on the structure's own stop (its reason, an abort, a decision its
|
|
1975
|
+
* provider reports `aborted`, as Jev and OpenRouter report a request cancelled in flight, an effect cut before it
|
|
1976
|
+
* settled, whose outcome is unknown, or a structure in it that failed so: withSiblingUncertainty counts their effects)
|
|
1977
|
+
* is not one: a run's own cancel still stops a collecting map, which checks its signal first. */
|
|
1977
1978
|
function reportedFailure(first, others) {
|
|
1978
1979
|
if (!isItemFailure(first))
|
|
1979
1980
|
return first;
|
|
1980
|
-
const stopped = (error) => error?.name === "AbortError" || (error instanceof DecisionProviderError && error.code === "aborted")
|
|
1981
|
+
const stopped = (error) => error?.name === "AbortError" || (error instanceof DecisionProviderError && error.code === "aborted")
|
|
1982
|
+
|| (error instanceof EffectOutcomeUnknownError && error.interruption === "cancelled")
|
|
1983
|
+
// A structure inside a sibling that the stop cut fails by what it cut, with its uncertain effects beside it.
|
|
1984
|
+
|| (error instanceof AggregateError && siblingFailures.has(error) && stopped(error.cause));
|
|
1981
1985
|
return others.find((error) => error !== first && !stopped(error) && !isItemFailure(error)) ?? first;
|
|
1982
1986
|
}
|
|
1983
1987
|
/** The label of the step an error failed in, set as the error leaves the innermost step and prefixed by every child
|