feat: add workflow output draft command

This commit is contained in:
lda
2026-06-29 02:06:47 +07:00 Verified
parent 001c802a21
commit fe63eb08d4
25 changed files with 499 additions and 51 deletions
+15
View File
@@ -243,6 +243,21 @@ class SetStepOutputMapRequest(BaseModel):
)
class SetWorkflowOutputMapRequest(BaseModel):
"""Typed MCP request for replacing or merging workflow output projection."""
workspace_id: WorkspaceId
revision: int = Field(ge=1, description="Expected current workspace revision.")
output_map: DraftPathMap
merge: bool = Field(
default=False,
description=(
"When false, replace the full workflow output map. When true, "
"preserve existing bindings and add/update only output_map entries."
),
)
class BindDraftRequest(BaseModel):
"""Typed MCP request for binding one draft step path with schema projection."""
+22
View File
@@ -37,6 +37,7 @@ from .models import (
SetDraftRouteRequest,
SetStepInputMapRequest,
SetStepOutputMapRequest,
SetWorkflowOutputMapRequest,
TraceRange,
ValidateDeploymentResult,
ValidateDraftWorkspaceRequest,
@@ -463,6 +464,27 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
)
)
@server.tool(
name="wf.workflow.set_workflow_output_map",
title="Set Workflow Output Map",
description=(
"Replace or merge the top-level workflow output projection. "
"Map graph source paths such as state.markdown to public output "
"fields such as markdown."
),
)
async def set_workflow_output_map(
request: SetWorkflowOutputMapRequest,
) -> DraftWorkspaceResult:
return DraftWorkspaceResult.model_validate(
await handlers.set_workflow_output_map(
workspace_id=request.workspace_id,
revision=request.revision,
output_map=request.output_map,
merge=request.merge,
)
)
@server.tool(
name="wf.workflow.bind",
title="Bind Draft",