@stigmer/runner-slim 3.12.4 → 3.12.5
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/main.js +586 -697
- package/package.json +6 -6
- package/workflow-bundle.js +23 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/runner-slim",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.5",
|
|
4
4
|
"description": "Self-contained Stigmer runner build for embedding in desktop apps — the bundle-friendly @stigmer/runner",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"jq-wasm": "^1.1.0-jq-1.8.1"
|
|
17
17
|
},
|
|
18
18
|
"optionalDependencies": {
|
|
19
|
-
"@stigmer/runner-slim-darwin-arm64": "3.12.
|
|
20
|
-
"@stigmer/runner-slim-darwin-x64": "3.12.
|
|
21
|
-
"@stigmer/runner-slim-linux-x64": "3.12.
|
|
22
|
-
"@stigmer/runner-slim-linux-arm64": "3.12.
|
|
23
|
-
"@stigmer/runner-slim-win32-x64": "3.12.
|
|
19
|
+
"@stigmer/runner-slim-darwin-arm64": "3.12.5",
|
|
20
|
+
"@stigmer/runner-slim-darwin-x64": "3.12.5",
|
|
21
|
+
"@stigmer/runner-slim-linux-x64": "3.12.5",
|
|
22
|
+
"@stigmer/runner-slim-linux-arm64": "3.12.5",
|
|
23
|
+
"@stigmer/runner-slim-win32-x64": "3.12.5"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"stigmer",
|
package/workflow-bundle.js
CHANGED
|
@@ -26979,11 +26979,11 @@ async function executeHumanInputTask(taskDef, taskName, state, ctx) {
|
|
|
26979
26979
|
...review.artifactEvents,
|
|
26980
26980
|
]);
|
|
26981
26981
|
}
|
|
26982
|
-
const result = await ctx.awaitHumanInput({
|
|
26982
|
+
const result = applyTimeoutOutcomeContract(await ctx.awaitHumanInput({
|
|
26983
26983
|
signalName,
|
|
26984
26984
|
timeoutSeconds,
|
|
26985
26985
|
onTimeout,
|
|
26986
|
-
});
|
|
26986
|
+
}), config.outcomes);
|
|
26987
26987
|
if (ctx.emitEvents) {
|
|
26988
26988
|
await ctx.emitEvents([{
|
|
26989
26989
|
type: "approval_resolved",
|
|
@@ -27009,6 +27009,27 @@ function validateConfig(config, taskName) {
|
|
|
27009
27009
|
throw new Error(`human_input task '${taskName}': 'prompt' is required`);
|
|
27010
27010
|
}
|
|
27011
27011
|
}
|
|
27012
|
+
/**
|
|
27013
|
+
* Applies the proto contract for timeout auto-resolution with custom
|
|
27014
|
+
* outcomes (HumanInputTaskConfig.outcomes doc): auto-approve resolves to
|
|
27015
|
+
* the FIRST declared outcome and auto-deny to the LAST, so `then` routing
|
|
27016
|
+
* and downstream outcome switches see declared outcome names — never the
|
|
27017
|
+
* orchestrator's internal approve/deny words, which a reviewer of a
|
|
27018
|
+
* custom-outcome gate was never offered. Binary gates (no custom outcomes)
|
|
27019
|
+
* keep the plain approve/deny result.
|
|
27020
|
+
*/
|
|
27021
|
+
function applyTimeoutOutcomeContract(result, outcomes) {
|
|
27022
|
+
if (!result.auto_resolved || result.reason !== "timeout" || !outcomes?.length) {
|
|
27023
|
+
return result;
|
|
27024
|
+
}
|
|
27025
|
+
if (result.outcome === "approve") {
|
|
27026
|
+
return { ...result, outcome: outcomes[0].name };
|
|
27027
|
+
}
|
|
27028
|
+
if (result.outcome === "deny") {
|
|
27029
|
+
return { ...result, outcome: outcomes[outcomes.length - 1].name };
|
|
27030
|
+
}
|
|
27031
|
+
return result;
|
|
27032
|
+
}
|
|
27012
27033
|
const NO_REVIEW_PAYLOAD = { artifactEvents: [] };
|
|
27013
27034
|
/**
|
|
27014
27035
|
* Resolves the review payload's `${ ... }` expressions and decides how it
|