tancat 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. cli/__init__.py +21 -0
  2. cli/evidence_cli.py +376 -0
  3. cli/main.py +8 -0
  4. src/__init__.py +1 -0
  5. src/accessibility_enricher.py +411 -0
  6. src/agents/__init__.py +75 -0
  7. src/agents/director.py +106 -0
  8. src/agents/generator.py +135 -0
  9. src/agents/graph.py +117 -0
  10. src/agents/ingestion.py +340 -0
  11. src/agents/pipeline_graph.py +525 -0
  12. src/agents/pipeline_state.py +170 -0
  13. src/agents/planner.py +104 -0
  14. src/agents/prompt_safety.py +33 -0
  15. src/agents/state.py +40 -0
  16. src/agents/synthesizer.py +181 -0
  17. src/agents/validator.py +75 -0
  18. src/analyzer.py +284 -0
  19. src/aria_parser.py +330 -0
  20. src/artifact_validation.py +500 -0
  21. src/assertion_alignment.py +184 -0
  22. src/browser_utils.py +533 -0
  23. src/cart_seeding_scraper.py +161 -0
  24. src/ci_ignore.py +140 -0
  25. src/citation_surfaces.py +212 -0
  26. src/citation_verifier.py +277 -0
  27. src/cli/__init__.py +21 -0
  28. src/cli/color.py +62 -0
  29. src/cli/config.py +25 -0
  30. src/cli/evidence_generator.py +538 -0
  31. src/cli/headless.py +577 -0
  32. src/cli/input_parser.py +586 -0
  33. src/cli/main.py +920 -0
  34. src/cli/menu_renderer.py +883 -0
  35. src/cli/pipeline_runner.py +1463 -0
  36. src/cli/report_generator.py +450 -0
  37. src/cli/retro_ui.py +380 -0
  38. src/cli/run_results_display.py +212 -0
  39. src/cli/session.py +202 -0
  40. src/cli/terminal_adapter.py +145 -0
  41. src/cli/test_case_orchestrator.py +516 -0
  42. src/cli/testing_terminal.py +36 -0
  43. src/code_normalizer.py +410 -0
  44. src/code_postprocessor.py +1991 -0
  45. src/code_validator.py +174 -0
  46. src/config.py +126 -0
  47. src/content_scoping.py +176 -0
  48. src/coverage_utils.py +248 -0
  49. src/credential_redaction.py +242 -0
  50. src/data/ocr/PP-OCRv6_det_small.pth +0 -0
  51. src/data/ocr/PP-OCRv6_rec_small.pth +0 -0
  52. src/data/ocr/README.md +42 -0
  53. src/data/ocr/ch_ppocr_mobile_v2.0_cls_mobile.pth +0 -0
  54. src/data/ocr/manifest.json +37 -0
  55. src/data/ocr/ppocrv6_dict.txt +18708 -0
  56. src/element_enricher.py +337 -0
  57. src/element_matcher.py +1768 -0
  58. src/evidence_export.py +409 -0
  59. src/evidence_image.py +152 -0
  60. src/evidence_index.py +530 -0
  61. src/evidence_loader.py +258 -0
  62. src/evidence_report.py +1174 -0
  63. src/evidence_serializer.py +84 -0
  64. src/evidence_tracker.py +2711 -0
  65. src/export_service.py +344 -0
  66. src/failure_classifier.py +225 -0
  67. src/failure_reporter.py +486 -0
  68. src/file_utils.py +107 -0
  69. src/flow_memory.py +658 -0
  70. src/form_detector.py +134 -0
  71. src/form_login_utils.py +104 -0
  72. src/gantt_utils.py +194 -0
  73. src/heatmap_alignment.py +415 -0
  74. src/heatmap_utils.py +838 -0
  75. src/hover_click_utils.py +208 -0
  76. src/intent_matcher.py +849 -0
  77. src/journey_auth_detector.py +69 -0
  78. src/journey_enrichment.py +198 -0
  79. src/journey_executor.py +446 -0
  80. src/journey_models.py +197 -0
  81. src/journey_scraper.py +1476 -0
  82. src/journey_subprocess.py +83 -0
  83. src/learning_impact.py +581 -0
  84. src/learning_metrics.py +396 -0
  85. src/licensing/__init__.py +58 -0
  86. src/licensing/activation.py +532 -0
  87. src/licensing/entitlement.py +188 -0
  88. src/licensing/license.py +119 -0
  89. src/licensing/merchant.py +27 -0
  90. src/licensing/pricing.py +51 -0
  91. src/licensing/tiers.py +194 -0
  92. src/licensing/window.py +63 -0
  93. src/link_scoping.py +221 -0
  94. src/llm_cache.py +265 -0
  95. src/llm_client.py +559 -0
  96. src/llm_errors.py +29 -0
  97. src/llm_health.py +433 -0
  98. src/llm_providers/__init__.py +795 -0
  99. src/llm_reasoning_filter.py +173 -0
  100. src/locator_builder.py +307 -0
  101. src/locator_fallback.py +206 -0
  102. src/locator_repair.py +875 -0
  103. src/locator_scorer.py +321 -0
  104. src/navigation_target.py +173 -0
  105. src/ocr_backends.py +921 -0
  106. src/orchestrator.py +1334 -0
  107. src/page_identity.py +303 -0
  108. src/page_object_builder.py +621 -0
  109. src/pdf_ingest.py +718 -0
  110. src/pipeline_artifact_manager.py +386 -0
  111. src/pipeline_models.py +263 -0
  112. src/pipeline_report_service.py +125 -0
  113. src/pipeline_run_service.py +244 -0
  114. src/pipeline_writer.py +320 -0
  115. src/placeholder_orchestrator.py +3225 -0
  116. src/placeholder_resolver.py +935 -0
  117. src/placeholder_scorers.py +1681 -0
  118. src/pom_helpers.py +254 -0
  119. src/prerequisite_injector.py +514 -0
  120. src/project.py +73 -0
  121. src/prompt_builder.py +383 -0
  122. src/prompt_utils.py +267 -0
  123. src/provider_config.py +179 -0
  124. src/pytest_output_parser.py +354 -0
  125. src/rag_bundled.py +671 -0
  126. src/rag_learn.py +770 -0
  127. src/rag_retriever.py +234 -0
  128. src/rag_store.py +996 -0
  129. src/rag_store_lock.py +256 -0
  130. src/rag_switches.py +147 -0
  131. src/report_builder.py +243 -0
  132. src/report_formats.py +52 -0
  133. src/report_formatters.py +729 -0
  134. src/report_utils.py +28 -0
  135. src/role_mapper.py +215 -0
  136. src/run_history_chart.py +494 -0
  137. src/run_history_cli.py +257 -0
  138. src/run_result_persistence.py +405 -0
  139. src/run_utils.py +79 -0
  140. src/scraper.py +1031 -0
  141. src/section_scoper.py +305 -0
  142. src/secure_config.py +260 -0
  143. src/self_healing.py +934 -0
  144. src/semantic_candidate_ranker.py +442 -0
  145. src/semantic_matcher.py +239 -0
  146. src/settings_store.py +165 -0
  147. src/skeleton_parser.py +459 -0
  148. src/skeleton_validator.py +109 -0
  149. src/skip_manager.py +226 -0
  150. src/source_refs.py +178 -0
  151. src/spec_analyzer.py +543 -0
  152. src/sqlite_persistence.py +615 -0
  153. src/stateful_scraper.py +280 -0
  154. src/storage.py +204 -0
  155. src/test_generator.py +142 -0
  156. src/test_plan.py +217 -0
  157. src/test_structure_assembler.py +152 -0
  158. src/test_table.py +491 -0
  159. src/ui/__init__.py +1 -0
  160. src/ui/shared.py +81 -0
  161. src/ui/ui_downloads.py +51 -0
  162. src/ui/ui_evidence.py +716 -0
  163. src/ui/ui_journey.py +339 -0
  164. src/ui/ui_requirements.py +32 -0
  165. src/ui/ui_results.py +188 -0
  166. src/ui/ui_run_comparison.py +117 -0
  167. src/ui/ui_run_results.py +1375 -0
  168. src/ui/ui_saved_packages.py +411 -0
  169. src/ui/ui_sidebar.py +485 -0
  170. src/ui_pipeline.py +515 -0
  171. src/url_guard.py +350 -0
  172. src/url_inference.py +49 -0
  173. src/url_resolver.py +307 -0
  174. src/url_utils.py +91 -0
  175. src/usage_meter.py +360 -0
  176. src/user_story_parser.py +311 -0
  177. src/verification_strength.py +228 -0
  178. src/verify_baseline.py +276 -0
  179. src/version_check.py +370 -0
  180. src/version_info.py +49 -0
  181. src/vision_enricher.py +307 -0
  182. tancat-0.1.0.dist-info/METADATA +260 -0
  183. tancat-0.1.0.dist-info/RECORD +186 -0
  184. tancat-0.1.0.dist-info/WHEEL +4 -0
  185. tancat-0.1.0.dist-info/entry_points.txt +2 -0
  186. tancat-0.1.0.dist-info/licenses/LICENSE +108 -0
cli/__init__.py ADDED
@@ -0,0 +1,21 @@
1
+ """CLI module for Playwright test generator.
2
+
3
+ IMPORTANT: This file is imported FIRST when `python -m cli.main` runs.
4
+ It forces UTF-8 output on Windows Git Bash (MINGW64)
5
+ where the default stdout encoding is cp1252, which cannot encode box-drawing
6
+ characters (┌, ─, ┐, etc.) used in the retro UI.
7
+ """
8
+
9
+ import io
10
+ import sys
11
+
12
+ # Force UTF-8 encoding BEFORE any other CLI module is imported.
13
+ # This must happen before retro_ui or menu_renderer are loaded.
14
+ if sys.stdout.encoding and sys.stdout.encoding.upper() not in ("UTF-8", "UTF8", "CP65001"):
15
+ # Re-wire stdout/stderr to UTF-8 writers. This works in Git Bash on Windows
16
+ # where the console may default to cp1252.
17
+ try:
18
+ sys.stdout = io.TextIOWrapper(open(sys.stdout.fileno(), "wb"), encoding="utf-8", write_through=True)
19
+ sys.stderr = io.TextIOWrapper(open(sys.stderr.fileno(), "wb"), encoding="utf-8", write_through=True)
20
+ except OSError, io.UnsupportedOperation:
21
+ pass # stdout already a TTY or pipe — can't re-wrap
cli/evidence_cli.py ADDED
@@ -0,0 +1,376 @@
1
+ """CLI for evidence search, inspection, rerun, and export (AI-028).
2
+
3
+ Usage::
4
+
5
+ # Search with timestamps
6
+ python -m cli.evidence_cli search --query "cart" --status failed --verbose
7
+
8
+ # Inspect a specific result
9
+ python -m cli.evidence_cli search --query "cart" --status failed
10
+ python -m cli.evidence_cli detail 3 # drill into result #3 from last search
11
+
12
+ # Rerun matching tests
13
+ python -m cli.evidence_cli search --query "cart" --status failed --rerun
14
+
15
+ # Export
16
+ python -m cli.evidence_cli export --format csv --status failed -o evidence.csv
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ import argparse
22
+ import json
23
+ import subprocess
24
+ import sys
25
+ from datetime import datetime
26
+ from pathlib import Path
27
+
28
+ from src.evidence_export import export_csv, export_junit_xml, export_ndjson
29
+ from src.evidence_index import EvidenceIndex
30
+
31
+ # ---------------------------------------------------------------------------
32
+ # Shared helpers
33
+ # ---------------------------------------------------------------------------
34
+
35
+
36
+ def _build_index() -> EvidenceIndex:
37
+ """Build or refresh the evidence index."""
38
+ index = EvidenceIndex()
39
+ count = index.build_or_refresh()
40
+ if count:
41
+ print(f"Indexed {count} new/updated sidecar(s).")
42
+ return index
43
+
44
+
45
+ def _filter_kwargs(args: argparse.Namespace) -> dict:
46
+ """Extract filter kwargs from parsed args."""
47
+ return {
48
+ "query": getattr(args, "query", "") or "",
49
+ "status": getattr(args, "status", None),
50
+ "url_domain": getattr(args, "domain", None),
51
+ "condition_prefix": getattr(args, "condition_prefix", None),
52
+ "story_ref": getattr(args, "story_ref", None),
53
+ "step_type": getattr(args, "step_type", None),
54
+ }
55
+
56
+
57
+ def _format_timestamp(iso_str: str) -> str:
58
+ """Convert ISO-8601 to a human-readable local timestamp."""
59
+ if not iso_str:
60
+ return "—"
61
+ try:
62
+ dt = datetime.fromisoformat(iso_str.replace("Z", "+00:00"))
63
+ local = dt.astimezone()
64
+ return local.strftime("%Y-%m-%d %H:%M")
65
+ except ValueError, TypeError:
66
+ return iso_str[:16] if len(iso_str) >= 16 else iso_str
67
+
68
+
69
+ def _print_search_table(
70
+ results: list,
71
+ verbose: bool = False,
72
+ ) -> None:
73
+ """Print search results as a numbered table."""
74
+ if verbose:
75
+ header = f"{'#':<4} {'St':<3} {'Condition':<12} {'Test Name':<50} {'Story':<8} {'Recorded':<17} URL"
76
+ else:
77
+ header = f"{'#':<4} {'St':<3} {'Condition':<12} {'Test Name':<55} {'Story':<8} URL"
78
+ print(header)
79
+ print("-" * len(header))
80
+
81
+ status_icon = {
82
+ "failed": "\u274c",
83
+ "passed": "\u2705",
84
+ "skipped": "\u23ed\ufe0f",
85
+ "error": "\u274c",
86
+ }
87
+
88
+ for i, r in enumerate(results, 1):
89
+ icon = status_icon.get(r.status, "?")
90
+ name = r.test_name.replace("[chromium]", "")
91
+ if not verbose:
92
+ max_name = 52
93
+ else:
94
+ max_name = 47
95
+ if len(name) > max_name:
96
+ name = name[: max_name - 3] + "..."
97
+ url = r.page_url or ""
98
+ max_url = 60 if not verbose else 50
99
+ if len(url) > max_url:
100
+ url = url[: max_url - 3] + "..."
101
+
102
+ ts = _format_timestamp(r.indexed_at)
103
+
104
+ if verbose:
105
+ print(f"{i:<4} {icon:<3} {r.condition_ref:<12} {name:<50} {r.story_ref:<8} {ts:<17} {url}")
106
+ else:
107
+ print(f"{i:<4} {icon:<3} {r.condition_ref:<12} {name:<55} {r.story_ref:<8} {url}")
108
+
109
+
110
+ # ---------------------------------------------------------------------------
111
+ # search
112
+ # ---------------------------------------------------------------------------
113
+
114
+
115
+ def _cmd_search(args: argparse.Namespace) -> None:
116
+ """Search evidence sidecars and print results as a table."""
117
+ index = _build_index()
118
+ results = index.search(**_filter_kwargs(args))
119
+
120
+ if not results:
121
+ print("No evidence matches your search.")
122
+ return
123
+
124
+ _print_search_table(results, verbose=args.verbose)
125
+ print(f"\n{len(results)} result(s).")
126
+
127
+ # Save results to a temp file so 'detail' can reference them
128
+ _save_last_results(results)
129
+
130
+ if args.rerun:
131
+ _rerun_tests(results)
132
+
133
+
134
+ def _save_last_results(results: list) -> None:
135
+ """Save search results to a temp file for cross-command reference."""
136
+ import tempfile
137
+
138
+ data = [
139
+ {
140
+ "sidecar_path": r.sidecar_path,
141
+ "test_name": r.test_name,
142
+ "test_package": r.test_package,
143
+ }
144
+ for r in results
145
+ ]
146
+ path = Path(tempfile.gettempdir()) / "evidence_cli_last_results.json"
147
+ path.write_text(json.dumps(data))
148
+
149
+
150
+ def _load_last_results() -> list[dict]:
151
+ """Load the last search results from the temp file."""
152
+ import tempfile
153
+
154
+ path = Path(tempfile.gettempdir()) / "evidence_cli_last_results.json"
155
+ if not path.exists():
156
+ return []
157
+ try:
158
+ return json.loads(path.read_text()) # type: ignore[no-any-return]
159
+ except json.JSONDecodeError, OSError:
160
+ return []
161
+
162
+
163
+ def _rerun_tests(results: list) -> None:
164
+ """Rerun pytest on the test packages that produced the search results."""
165
+ packages = sorted({r.test_package for r in results if r.test_package})
166
+ if not packages:
167
+ print("No test packages to rerun.")
168
+ return
169
+
170
+ from src.storage import get_storage
171
+
172
+ gen_dir = get_storage().generated_tests_dir()
173
+ test_files: list[str] = []
174
+ for pkg_name in packages:
175
+ pkg_dir = gen_dir / pkg_name
176
+ if pkg_dir.exists():
177
+ test_files.extend(str(f) for f in pkg_dir.glob("test_*.py") if f.name != "conftest.py")
178
+
179
+ if not test_files:
180
+ print(f"No test files found in packages: {', '.join(packages)}")
181
+ return
182
+
183
+ print(f"\nRerunning {len(test_files)} test file(s) from {len(packages)} package(s)...")
184
+ cmd = [sys.executable, "-m", "pytest", *test_files, "-v", "--tb=short"]
185
+ subprocess.run(cmd)
186
+
187
+
188
+ # ---------------------------------------------------------------------------
189
+ # detail
190
+ # ---------------------------------------------------------------------------
191
+
192
+
193
+ def _cmd_detail(args: argparse.Namespace) -> None:
194
+ """Show detailed evidence for a result from the last search."""
195
+ last = _load_last_results()
196
+ if not last:
197
+ print("No previous search results. Run 'search' first.")
198
+ return
199
+
200
+ idx = args.number - 1
201
+ if idx < 0 or idx >= len(last):
202
+ print(f"Result #{args.number} not found. Last search had {len(last)} results.")
203
+ return
204
+
205
+ entry = last[idx]
206
+ index = _build_index()
207
+ sidecar = index.get_sidecar_detail(entry["sidecar_path"])
208
+
209
+ if sidecar is None:
210
+ print(f"Could not load sidecar: {entry['sidecar_path']}")
211
+ return
212
+
213
+ test = sidecar.get("test", {})
214
+ page = sidecar.get("page", {})
215
+ steps = sidecar.get("steps", [])
216
+
217
+ print(f"\n{'=' * 70}")
218
+ print(f" Test: {test.get('name', '?')}")
219
+ print(f" Condition: {test.get('condition_ref', '?')}")
220
+ print(f" Story: {test.get('story_ref', '?')}")
221
+ print(f" Status: {test.get('status', '?')}")
222
+ print(f" Page URL: {page.get('url', '?')}")
223
+ print(f" Package: {entry['test_package']}")
224
+ print(f"{'=' * 70}")
225
+
226
+ if steps:
227
+ print(f"\nSteps ({len(steps)}):")
228
+ for s in steps:
229
+ step_num = s.get("step", "?")
230
+ step_type = s.get("type", "?")
231
+ label = s.get("label", "")
232
+ result = s.get("result", {})
233
+ step_status = result.get("status", "?")
234
+ elapsed = result.get("elapsed_ms", 0)
235
+ error = result.get("error") or result.get("failure_note")
236
+
237
+ icon = "\u2705" if step_status == "passed" else "\u274c"
238
+ print(f" {icon} Step {step_num} [{step_type}]: {label}")
239
+ if elapsed:
240
+ print(f" ({elapsed}ms)")
241
+ if error:
242
+ print(f" \u26a0\ufe0f {error}")
243
+ else:
244
+ print("\n (no steps recorded)")
245
+
246
+ # Also show locator info if available
247
+ for s in steps:
248
+ locator = s.get("locator")
249
+ if locator:
250
+ print(f"\n Locator used: {locator}")
251
+ break
252
+
253
+
254
+ # ---------------------------------------------------------------------------
255
+ # export
256
+ # ---------------------------------------------------------------------------
257
+
258
+
259
+ def _cmd_export(args: argparse.Namespace) -> None:
260
+ """Export evidence to CSV, NDJSON, or JUnit XML."""
261
+ fmt = args.format
262
+ output = Path(args.output).resolve()
263
+ index = _build_index()
264
+ kwargs = _filter_kwargs(args)
265
+
266
+ # Count matching results before export
267
+ results = index.search(**{**kwargs, "limit": 100_000})
268
+ result_count = len(results)
269
+
270
+ if result_count == 0:
271
+ print("No evidence matches your filters. Nothing exported.")
272
+ return
273
+
274
+ if fmt == "csv":
275
+ export_csv(index, output=output, **kwargs)
276
+ elif fmt == "ndjson":
277
+ export_ndjson(index, output=output, **kwargs)
278
+ elif fmt == "junit":
279
+ export_junit_xml(index, output=output, **kwargs)
280
+ else:
281
+ print(f"Unknown format: {fmt}", file=sys.stderr)
282
+ sys.exit(1)
283
+
284
+ size_kb = output.stat().st_size / 1024 if output.exists() else 0
285
+
286
+ # Build a human-readable filter summary
287
+ filters: list[str] = []
288
+ if kwargs.get("query"):
289
+ filters.append(f'query="{kwargs["query"]}"')
290
+ if kwargs.get("status"):
291
+ filters.append(f"status={kwargs['status']}")
292
+ if kwargs.get("url_domain"):
293
+ filters.append(f"domain={kwargs['url_domain']}")
294
+ if kwargs.get("condition_prefix"):
295
+ filters.append(f"prefix={kwargs['condition_prefix']}")
296
+ if kwargs.get("story_ref"):
297
+ filters.append(f"story={kwargs['story_ref']}")
298
+ filter_str = ", ".join(filters) if filters else "all evidence"
299
+
300
+ print(f"Exported {result_count} sidecar(s) [{filter_str}] to {output} ({size_kb:.1f} KB)")
301
+
302
+
303
+ # ---------------------------------------------------------------------------
304
+ # CLI entry point
305
+ # ---------------------------------------------------------------------------
306
+
307
+
308
+ def main(argv: list[str] | None = None) -> None:
309
+ parser = argparse.ArgumentParser(
310
+ description="Search, inspect, rerun, and export Playwright test evidence.",
311
+ prog="evidence-cli",
312
+ )
313
+ sub = parser.add_subparsers(dest="command", required=True)
314
+
315
+ # ── search ────────────────────────────────────────────────────────────
316
+ p_search = sub.add_parser("search", help="Search evidence sidecars")
317
+ p_search.add_argument("--query", "-q", default="", help="Free-text search query")
318
+ p_search.add_argument("--status", choices=["passed", "failed", "skipped", "error"])
319
+ p_search.add_argument("--domain", help="URL domain filter (e.g. automationexercise.com)")
320
+ p_search.add_argument("--condition-prefix", help="Condition ref prefix (e.g. TC01)")
321
+ p_search.add_argument("--story-ref", help="Story reference (e.g. S06)")
322
+ p_search.add_argument("--step-type", choices=["navigate", "click", "fill", "assertion", "select"])
323
+ p_search.add_argument(
324
+ "--verbose",
325
+ "-v",
326
+ action="store_true",
327
+ help="Show recorded timestamps and full details",
328
+ )
329
+ p_search.add_argument(
330
+ "--rerun",
331
+ action="store_true",
332
+ help="Rerun pytest on the test packages matching search results",
333
+ )
334
+ p_search.set_defaults(func=_cmd_search)
335
+
336
+ # ── detail ────────────────────────────────────────────────────────────
337
+ p_detail = sub.add_parser(
338
+ "detail",
339
+ help="Show step-by-step evidence for a result from the last search",
340
+ )
341
+ p_detail.add_argument(
342
+ "number",
343
+ type=int,
344
+ help="Result number from the last search (e.g. 3)",
345
+ )
346
+ p_detail.set_defaults(func=_cmd_detail)
347
+
348
+ # ── export ────────────────────────────────────────────────────────────
349
+ p_export = sub.add_parser("export", help="Export evidence to file")
350
+ p_export.add_argument(
351
+ "--format",
352
+ "-f",
353
+ required=True,
354
+ choices=["csv", "ndjson", "junit"],
355
+ help="Export format",
356
+ )
357
+ p_export.add_argument(
358
+ "--output",
359
+ "-o",
360
+ required=True,
361
+ help="Output file path",
362
+ )
363
+ p_export.add_argument("--query", "-q", default="", help="Free-text search query")
364
+ p_export.add_argument("--status", choices=["passed", "failed", "skipped", "error"])
365
+ p_export.add_argument("--domain", help="URL domain filter")
366
+ p_export.add_argument("--condition-prefix", help="Condition ref prefix")
367
+ p_export.add_argument("--story-ref", help="Story reference")
368
+ p_export.add_argument("--step-type", choices=["navigate", "click", "fill", "assertion", "select"])
369
+ p_export.set_defaults(func=_cmd_export)
370
+
371
+ args = parser.parse_args(argv)
372
+ args.func(args)
373
+
374
+
375
+ if __name__ == "__main__":
376
+ main()
cli/main.py ADDED
@@ -0,0 +1,8 @@
1
+ """Backwards-compatible shim — CLI entry point moved to src.cli.main."""
2
+
3
+ import sys
4
+
5
+ from src.cli.main import main
6
+
7
+ if __name__ == "__main__":
8
+ sys.exit(main())
src/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Source module for Playwright test generator."""