p2: old style deprecated support + wf_authoring to use new stuff

holy moly file changes
This commit is contained in:
lda
2026-05-20 17:47:37 +07:00 Verified
parent 3683c23937
commit 1a2349e017
28 changed files with 702 additions and 137 deletions
+5 -5
View File
@@ -3,15 +3,15 @@ from __future__ import annotations
from copy import deepcopy
from wf_core.models.workflow import Workflow
from wf_core.paths import set_nested_value
from wf_core.run_state import ExecutionFrame, FrameStatus, RunState, RunStatus
def create_run_state(workflow: Workflow, workflow_input: dict[str, object]) -> RunState:
state = {
name: deepcopy(field.default)
for name, field in workflow.state_schema.fields.items()
if field.default is not None
}
state: dict[str, object] = {}
for field in workflow.state_schema.fields:
if field.default is not None:
set_nested_value(state, list(field.path.parts), deepcopy(field.default))
state.update(dict(workflow_input))
run = RunState(
workflow_name=workflow.name,