feat(FN-000): extract workflow merge node capability

Fusion-Task-Id: FN-000
This commit is contained in:
gsxdsm
2026-06-09 17:17:18 -07:00
parent 25cf473553
commit 53d644714c
5 changed files with 184 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
type WorkflowPrimitiveContext,
type WorkflowRuntimePrimitives,
} from "./runtime-primitives.js";
import { runWorkflowMergeAttemptNode } from "./workflow-merge-nodes.js";
export type WorkflowSeamName =
| "planning"
@@ -938,8 +939,11 @@ export function createDefaultNodeHandlers(
const attempt = typeof ctx.context["workflow:work-item-attempt"] === "number"
? ctx.context["workflow:work-item-attempt"]
: undefined;
const result = await deps.primitives.requestMerge(primitiveContextForNode(_node, ctx.task, ctx.context, attempt), ctx.task);
return { outcome: result.outcome, value: result.value, contextPatch: result.contextPatch };
return runWorkflowMergeAttemptNode(
{ primitives: deps.primitives },
primitiveContextForNode(_node, ctx.task, ctx.context, attempt),
ctx.task,
);
},
"manual-merge-hold": async () => ({ outcome: "failure", value: "manual-required" }),
"retry-backoff": async () => ({ outcome: "success" }),