MCPcopy Create free account
hub / github.com/microsoft/Webwright / parse_steps_jsonl

Function parse_steps_jsonl

assets/task_showcase/app.py:85–103  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

83
84
85def parse_steps_jsonl(path: Path) -> list[dict]:
86 rows: list[dict] = []
87 if not path.exists():
88 return rows
89 for line in path.read_text(encoding="utf-8").splitlines():
90 line = line.strip()
91 if not line:
92 continue
93 try:
94 rows.append(json.loads(line))
95 except json.JSONDecodeError:
96 continue
97 for r in rows:
98 try:
99 r["step_num"] = int(r.get("step_num", 0))
100 except (TypeError, ValueError):
101 r["step_num"] = 0
102 rows.sort(key=lambda r: r["step_num"])
103 return rows
104
105
106def build_steps(task_dir: Path) -> tuple[list[dict], str]:

Callers 1

build_stepsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected