feat: asked-field envelope, standalone form components, branched forms

This commit is contained in:
Jonas Miederer 2026-09-28 14:07:09 +02:00
parent 0d43b0e8fb
commit f27be044b4
26 changed files with 3651 additions and 104 deletions

View file

@ -2,6 +2,7 @@
from __future__ import annotations
import logging
from pathlib import Path
from sqlmodel import Session
@ -13,6 +14,8 @@ from . import export, sync
from .langflow_client import LangflowClient, LangflowError
from .lfx_client import LfxClient
logger = logging.getLogger(__name__)
def normalize_exported_flow(exported: dict, langflow_flow_id: str, name: str | None = None) -> dict:
"""Reduce a Langflow FlowRead to the canonical fields we persist."""
@ -40,6 +43,7 @@ async def pull_all_from_langflow(
"""
flows_dir = Path(flows_dir)
headers = await langflow.list_flows()
ignored = export.ignored_stems(flows_dir)
pulled: list[str] = []
errors: dict[str, str] = {}
for header in headers:
@ -49,6 +53,9 @@ async def pull_all_from_langflow(
try:
exported = await langflow.export_flow(flow_id)
doc = normalize_exported_flow(exported, flow_id)
if export.filename_stem(doc["name"]) in ignored:
logger.warning("pull skips ignored flow %r", doc["name"])
continue
reuse, identical = export.find_reuse_path(flows_dir, doc)
if identical and reuse is not None:
pulled.append(reuse.stem)