bosun 0.41.5 → 0.41.6
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/package.json +1 -1
- package/workflow/workflow-engine.mjs +21 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bosun",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.6",
|
|
4
4
|
"description": "Bosun Autonomous Engineering — manages AI agent executors with failover, extremely powerful workflow builder, and a massive amount of included default workflow templates for autonomous engineering, creates PRs via Vibe-Kanban API, and sends Telegram notifications. Supports N executors with weighted distribution, multi-repo projects, and auto-setup.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
ensureTestRuntimeSandbox,
|
|
42
42
|
resolvePathForTestRuntime,
|
|
43
43
|
} from "../infra/test-runtime.mjs";
|
|
44
|
+
import { getTemplate } from "./workflow-templates.mjs";
|
|
44
45
|
|
|
45
46
|
// Lazy-loaded workspace manager for workspace-aware scheduling
|
|
46
47
|
let _workspaceManagerMod = null;
|
|
@@ -744,13 +745,27 @@ export class WorkflowEngine extends EventEmitter {
|
|
|
744
745
|
return normalized || "";
|
|
745
746
|
}
|
|
746
747
|
|
|
748
|
+
_resolveTemplateDefaultVariable(def, key) {
|
|
749
|
+
if (!def || typeof def !== "object") return undefined;
|
|
750
|
+
if (def?.metadata?.templateState?.isCustomized === true) return undefined;
|
|
751
|
+
const templateId = String(def?.metadata?.installedFrom || "").trim();
|
|
752
|
+
if (!templateId) return undefined;
|
|
753
|
+
const template = getTemplate(templateId);
|
|
754
|
+
if (!template?.variables || typeof template.variables !== "object") return undefined;
|
|
755
|
+
return Object.prototype.hasOwnProperty.call(template.variables, key)
|
|
756
|
+
? template.variables[key]
|
|
757
|
+
: undefined;
|
|
758
|
+
}
|
|
759
|
+
|
|
747
760
|
_applyResumeInputMigrations(def, data = {}) {
|
|
748
761
|
if (!data || typeof data !== "object") return data;
|
|
749
762
|
const next = { ...data };
|
|
750
763
|
const templateId = String(def?.metadata?.installedFrom || "").trim();
|
|
751
764
|
if (templateId === "template-task-lifecycle") {
|
|
752
765
|
const currentValue = next.prePrValidationCommand;
|
|
753
|
-
const nextDefault =
|
|
766
|
+
const nextDefault =
|
|
767
|
+
this._resolveTemplateDefaultVariable(def, "prePrValidationCommand")
|
|
768
|
+
?? def?.variables?.prePrValidationCommand;
|
|
754
769
|
if (currentValue === "npm run prepush:check" && nextDefault === "auto") {
|
|
755
770
|
next.prePrValidationCommand = nextDefault;
|
|
756
771
|
}
|
|
@@ -1234,10 +1249,13 @@ export class WorkflowEngine extends EventEmitter {
|
|
|
1234
1249
|
* @private
|
|
1235
1250
|
*/
|
|
1236
1251
|
async _executeInner(def, workflowId, inputData, opts) {
|
|
1237
|
-
|
|
1238
|
-
const ctx = new WorkflowContext({
|
|
1252
|
+
const initialData = this._applyResumeInputMigrations(def, {
|
|
1239
1253
|
...def.variables,
|
|
1240
1254
|
...inputData,
|
|
1255
|
+
});
|
|
1256
|
+
|
|
1257
|
+
const ctx = new WorkflowContext({
|
|
1258
|
+
...initialData,
|
|
1241
1259
|
_workflowId: workflowId,
|
|
1242
1260
|
_workflowName: def.name,
|
|
1243
1261
|
});
|