|
| 1 | +```bash |
| 2 | +python3.12 -m venv .venv |
| 3 | +source .venv/bin/activate |
| 4 | +pip install -r requirements.txt |
| 5 | +python run_web_app.py |
| 6 | +``` |
| 7 | + |
| 8 | +Check networking for Mermaid validator |
| 9 | +```python |
| 10 | +import mermaid as md |
| 11 | + |
| 12 | +error_mermaid = """ |
| 13 | +graph TB |
| 14 | + subgraph "Core Agent System" |
| 15 | + A[DefaultAgent] --> B[Agent Execution] |
| 16 | + B --> C[Step Processing] |
| 17 | + C --> D[Action Execution] |
| 18 | + end |
| 19 | + |
| 20 | + subgraph "Hook System" |
| 21 | + E[CombinedAgentHook] --> F[Hook 1] |
| 22 | + E --> G[Hook 2] |
| 23 | + E --> H[Hook N] |
| 24 | + end |
| 25 | + |
| 26 | + subgraph "Event Flow" |
| 27 | + I[on_init] --> J[on_run_start] |
| 28 | + J --> K[on_step_start] |
| 29 | + K --> L[on_actions_generated] |
| 30 | + L --> M[on_action_started] |
| 31 | + M --> N[on_action_executed] |
| 32 | + N --> O[on_step_done] |
| 33 | + O --> P{More Steps?} |
| 34 | + P -->|Yes| K |
| 35 | + P -->|No| Q[on_run_done] |
| 36 | + end |
| 37 | + |
| 38 | + A -.-> E : uses hooks |
| 39 | + B -.-> I |
| 40 | + C -.-> K |
| 41 | + D -.-> M |
| 42 | + |
| 43 | + style E fill:#e1f5fe |
| 44 | + style A fill:#f3e5f5 |
| 45 | +""" |
| 46 | + |
| 47 | +true_mermaid = """ |
| 48 | +graph TB |
| 49 | + subgraph "CLI Configuration Module" |
| 50 | + A[Main CLI Entry Point<br/>sweagent.run.run.main] --> B[Command Router] |
| 51 | + C[BasicCLI Configuration System<br/>sweagent.run.common.BasicCLI] --> D[Config Validation] |
| 52 | + |
| 53 | + B --> E[Execution Commands] |
| 54 | + B --> F[Analysis Commands] |
| 55 | + B --> G[Inspector Commands] |
| 56 | + |
| 57 | + E --> H[Single Execution<br/>run] |
| 58 | + E --> I[Batch Execution<br/>run-batch] |
| 59 | + E --> J[Replay Execution<br/>run-replay] |
| 60 | + E --> K[Shell Execution<br/>shell] |
| 61 | + |
| 62 | + F --> L[Merge Predictions<br/>merge-preds] |
| 63 | + F --> M[Extract Predictions<br/>extract-pred] |
| 64 | + F --> N[Compare Runs<br/>compare-runs] |
| 65 | + F --> O[Quick Stats<br/>quick-stats] |
| 66 | + F --> P[Remove Unfinished<br/>remove-unfinished] |
| 67 | + |
| 68 | + G --> Q[Terminal Inspector<br/>inspect] |
| 69 | + G --> R[Web Inspector<br/>inspector] |
| 70 | + end |
| 71 | + |
| 72 | + subgraph "External Dependencies" |
| 73 | + S[execution_engines.md] |
| 74 | + T[inspector_tools.md] |
| 75 | + U[analysis_utilities.md] |
| 76 | + end |
| 77 | + |
| 78 | + H --> S |
| 79 | + I --> S |
| 80 | + J --> S |
| 81 | + K --> S |
| 82 | + Q --> T |
| 83 | + R --> T |
| 84 | + L --> U |
| 85 | + M --> U |
| 86 | + N --> U |
| 87 | + O --> U |
| 88 | + P --> U |
| 89 | + |
| 90 | + style A fill:#e1f5fe |
| 91 | + style C fill:#e8f5e8 |
| 92 | + style B fill:#fff3e0 |
| 93 | +""" |
| 94 | + |
| 95 | +render = md.Mermaid(error_mermaid) |
| 96 | +print(render.svg_response.text[:50]) |
| 97 | +# => Parse error on line 26:\n... end A -.-> E : use |
| 98 | + |
| 99 | +render = md.Mermaid(true_mermaid) |
| 100 | +print(render.svg_response.text[:50]) |
| 101 | +# => <svg id="mermaid-svg" width="100%" xmlns="http://w |
| 102 | +``` |
0 commit comments