feat: merge draft step maps

This commit is contained in:
lda
2026-06-25 18:42:40 +07:00 Verified
parent 2d2477fb12
commit bcbdb81228
20 changed files with 359 additions and 14 deletions
+16 -2
View File
@@ -206,21 +206,35 @@ class SetDraftRouteRequest(BaseModel):
class SetStepInputMapRequest(BaseModel):
"""Typed MCP request for replacing one step input map."""
"""Typed MCP request for replacing or merging one step input map."""
workspace_id: WorkspaceId
revision: int = Field(ge=1, description="Expected current workspace revision.")
step_id: str = Field(description="Draft step id whose input map should change.")
input_map: DraftPathMap
merge: bool = Field(
default=False,
description=(
"When false, replace the full input map. When true, preserve existing "
"bindings and add/update only input_map entries."
),
)
class SetStepOutputMapRequest(BaseModel):
"""Typed MCP request for replacing one step output map."""
"""Typed MCP request for replacing or merging one step output map."""
workspace_id: WorkspaceId
revision: int = Field(ge=1, description="Expected current workspace revision.")
step_id: str = Field(description="Draft step id whose output map should change.")
output_map: DraftPathMap
merge: bool = Field(
default=False,
description=(
"When false, replace the full output map. When true, preserve existing "
"bindings and add/update only output_map entries."
),
)
class DeleteDraftWorkspaceRequest(BaseModel):
+6 -2
View File
@@ -399,7 +399,8 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
name="wf.workflow.set_step_input_map",
title="Set Step Input Map",
description=(
"Replace one compatibility step input map in a draft workspace. "
"Replace or merge one compatibility step input map in a draft workspace. "
"Set merge=true to preserve existing bindings while adding/updating entries. "
"New one-capability bootstraps should prefer canonical input bindings."
),
)
@@ -412,6 +413,7 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
revision=request.revision,
step_id=request.step_id,
input_map=request.input_map,
merge=request.merge,
)
)
@@ -419,7 +421,8 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
name="wf.workflow.set_step_output_map",
title="Set Step Output Map",
description=(
"Replace one compatibility step output map in a draft workspace. "
"Replace or merge one compatibility step output map in a draft workspace. "
"Set merge=true to preserve existing bindings while adding/updating entries. "
"New one-capability bootstraps should prefer canonical output bindings."
),
)
@@ -432,6 +435,7 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
revision=request.revision,
step_id=request.step_id,
output_map=request.output_map,
merge=request.merge,
)
)