cursorflow 2.0.4__py3-none-any.whl → 2.1.1__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.
@@ -0,0 +1,350 @@
1
+ Metadata-Version: 2.4
2
+ Name: cursorflow
3
+ Version: 2.1.1
4
+ Summary: 🔥 Complete page intelligence for AI-driven development with Hot Reload Intelligence - captures DOM, network, console, performance, HMR events, and comprehensive page analysis
5
+ Author-email: GeekWarrior Development <rbush@cooltheory.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/haley-marketing-group/cursorflow
8
+ Project-URL: Documentation, https://cursorflow.readthedocs.io
9
+ Project-URL: Repository, https://github.com/haley-marketing-group/cursorflow
10
+ Keywords: ui-testing,automation,cursor,ai,web-testing,css-iteration,hot-reload,hmr,element-intelligence,page-analysis,error-context
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Testing
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Classifier: Framework :: AsyncIO
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: playwright>=1.40.0
26
+ Requires-Dist: paramiko>=3.3.1
27
+ Requires-Dist: pyyaml>=6.0.1
28
+ Requires-Dist: asyncio-mqtt>=0.11.1
29
+ Requires-Dist: click>=8.1.7
30
+ Requires-Dist: rich>=13.6.0
31
+ Requires-Dist: jinja2>=3.1.2
32
+ Requires-Dist: python-dateutil>=2.8.2
33
+ Requires-Dist: watchdog>=3.0.0
34
+ Requires-Dist: docker>=6.1.3
35
+ Requires-Dist: pillow>=10.0.0
36
+ Requires-Dist: numpy>=1.24.0
37
+ Requires-Dist: websockets>=11.0.0
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
40
+ Requires-Dist: pytest-asyncio>=0.21.1; extra == "dev"
41
+ Requires-Dist: black>=23.9.1; extra == "dev"
42
+ Requires-Dist: flake8>=6.1.0; extra == "dev"
43
+ Requires-Dist: mypy>=1.6.1; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ # CursorFlow
47
+
48
+ **The measurement tool for web testing - we capture reality, not fiction**
49
+
50
+ CursorFlow is a pure data collection engine that captures comprehensive web application intelligence. Unlike simulation tools that let you control reality, CursorFlow measures actual reality - giving you complete trust in your test results.
51
+
52
+ ## 🎯 The CursorFlow Philosophy
53
+
54
+ ### **📊 We Collect Reality, Not Fiction**
55
+
56
+ **Other tools are simulation tools** - they let you control reality:
57
+ - Mock network responses
58
+ - Simulate user interactions
59
+ - Create test environments
60
+
61
+ **CursorFlow is a measurement tool** - we capture reality as-is:
62
+ - Real API response times
63
+ - Actual network failures
64
+ - Genuine browser behavior
65
+ - Complete page intelligence
66
+
67
+ ### **🔬 Pure Observation Principle**
68
+
69
+ **CursorFlow is like a scientific instrument:**
70
+ - **Microscopes** don't create the cells they observe
71
+ - **Telescopes** don't generate the stars they capture
72
+ - **CursorFlow** doesn't mock the web it measures
73
+
74
+ When CursorFlow reports `"average_response_time": 416.58ms`, you can tell stakeholders: **"This is what actually happened"** - not "this is what happened in our test simulation."
75
+
76
+ ### **🌟 The Trust Factor**
77
+
78
+ **Complete Reliability:** Every data point reflects real application behavior
79
+ - No mocked responses hiding slow APIs
80
+ - No simulated interactions missing real edge cases
81
+ - No test environments different from production
82
+
83
+ **Documentary vs Movie:** Both are valuable, but if you're trying to understand reality, you watch the documentary. CursorFlow is the documentary of web testing.
84
+
85
+ ## 🚀 Complete Page Intelligence
86
+
87
+ Every screenshot captures everything your AI needs to make intelligent decisions:
88
+
89
+ ### **📊 Comprehensive Data Collection**
90
+ - **DOM**: All elements with 7 selector strategies each
91
+ - **Network**: All requests, responses, and complete response bodies
92
+ - **Console**: All logs, errors, and smart error correlation
93
+ - **Performance**: Load times, memory usage, with reliability indicators
94
+ - **Visual**: Screenshots with pixel-perfect comparisons and enhanced options
95
+ - **Fonts**: Loading status, performance, and usage analysis
96
+ - **Animations**: Active animations and transitions tracking
97
+ - **Resources**: Complete resource loading analysis
98
+ - **Storage**: localStorage, sessionStorage, cookies, IndexedDB state
99
+
100
+ ### **🔄 Hot Reload Intelligence**
101
+ - **Framework auto-detection** (Vite, Webpack, Next.js, Parcel, Laravel Mix)
102
+ - **Perfect timing** for CSS change detection
103
+ - **HMR event correlation** for understanding change impact
104
+ - **Persistent sessions** that survive code changes
105
+
106
+ ### **🎯 Enhanced Screenshot Options**
107
+ ```python
108
+ # Clip to specific components
109
+ {"screenshot": {"name": "header", "options": {"clip": {"selector": "#header"}}}}
110
+
111
+ # Hide sensitive information
112
+ {"screenshot": {"name": "profile", "options": {"mask": [".user-email", ".api-key"]}}}
113
+
114
+ # Full page with quality control
115
+ {"screenshot": {"name": "page", "options": {"full_page": True, "quality": 90}}}
116
+ ```
117
+
118
+ ### **📱 Parallel Viewport Testing**
119
+ ```python
120
+ # Test across multiple viewports simultaneously
121
+ await flow.test_responsive([
122
+ {"width": 375, "height": 667, "name": "mobile"},
123
+ {"width": 768, "height": 1024, "name": "tablet"},
124
+ {"width": 1440, "height": 900, "name": "desktop"}
125
+ ], [
126
+ {"navigate": "/dashboard"},
127
+ {"screenshot": "responsive-test"}
128
+ ])
129
+ ```
130
+
131
+ ### **🤖 AI-First Design**
132
+ All data structured for AI consumption:
133
+ - Consistent JSON format across all features
134
+ - **Multi-selector element identification** for robust automation
135
+ - **Accessibility-aware** element analysis
136
+ - Error correlation with **smart screenshot deduplication**
137
+ - Performance insights with **reliability metadata**
138
+
139
+ ## 🚀 Quick Start
140
+
141
+ ```bash
142
+ # Install CursorFlow
143
+ pip install cursorflow
144
+
145
+ # Test real application behavior
146
+ cursorflow test --base-url http://localhost:3000 --path "/dashboard"
147
+
148
+ # Get complete intelligence with custom actions
149
+ cursorflow test --base-url http://localhost:3000 --actions '[
150
+ {"navigate": "/login"},
151
+ {"fill": {"selector": "#email", "value": "test@example.com"}},
152
+ {"click": "#login-btn"},
153
+ {"screenshot": {"name": "result", "options": {"mask": [".sensitive-data"]}}}
154
+ ]'
155
+ ```
156
+
157
+ ## 💻 Python API Examples
158
+
159
+ ### **Complete Page Intelligence**
160
+ ```python
161
+ from cursorflow import CursorFlow
162
+
163
+ async def capture_reality():
164
+ flow = CursorFlow("http://localhost:3000", {"source": "local", "paths": ["logs/app.log"]})
165
+
166
+ # Capture everything
167
+ results = await flow.execute_and_collect([
168
+ {"navigate": "/dashboard"},
169
+ {"screenshot": "complete-analysis"}
170
+ ])
171
+
172
+ # Access comprehensive data
173
+ screenshot = results['artifacts']['screenshots'][0]
174
+ print(f"Real load time: {screenshot['performance_data']['page_load_time']}ms")
175
+ print(f"Actual memory usage: {screenshot['performance_data']['memory_usage_mb']}MB")
176
+ print(f"Elements found: {len(screenshot['dom_analysis']['elements'])}")
177
+ ```
178
+
179
+ ### **Enhanced Screenshot Options**
180
+ ```python
181
+ # Component-focused testing
182
+ await flow.execute_and_collect([
183
+ {"navigate": "/components"},
184
+ {"screenshot": {
185
+ "name": "button-component",
186
+ "options": {"clip": {"selector": ".component-demo"}}
187
+ }}
188
+ ])
189
+
190
+ # Privacy-aware testing
191
+ await flow.execute_and_collect([
192
+ {"navigate": "/admin"},
193
+ {"screenshot": {
194
+ "name": "admin-safe",
195
+ "options": {
196
+ "full_page": True,
197
+ "mask": [".api-key", ".user-data", ".sensitive-info"]
198
+ }
199
+ }}
200
+ ])
201
+ ```
202
+
203
+ ### **Hot Reload Intelligence**
204
+ ```python
205
+ # Perfect CSS iteration timing
206
+ async def hmr_workflow():
207
+ flow = CursorFlow("http://localhost:5173", {"headless": False})
208
+
209
+ # Auto-detect and monitor HMR
210
+ await flow.browser.start_hmr_monitoring()
211
+
212
+ # Baseline capture
213
+ await flow.execute_and_collect([{"screenshot": "baseline"}])
214
+
215
+ # Wait for real CSS changes with perfect timing
216
+ hmr_event = await flow.browser.wait_for_css_update()
217
+ print(f"🔥 {hmr_event['framework']} detected real change!")
218
+
219
+ # Capture immediately after actual change
220
+ await flow.execute_and_collect([{"screenshot": "updated"}])
221
+ ```
222
+
223
+ ### **Parallel Viewport Testing**
224
+ ```python
225
+ # Test responsive design across multiple viewports
226
+ async def test_responsive_design():
227
+ flow = CursorFlow("http://localhost:3000", {"source": "local", "paths": ["logs/app.log"]})
228
+
229
+ # Define viewports
230
+ viewports = [
231
+ {"width": 375, "height": 667, "name": "mobile"},
232
+ {"width": 768, "height": 1024, "name": "tablet"},
233
+ {"width": 1440, "height": 900, "name": "desktop"}
234
+ ]
235
+
236
+ # Test same actions across all viewports
237
+ results = await flow.test_responsive(viewports, [
238
+ {"navigate": "/dashboard"},
239
+ {"click": "#menu-toggle"},
240
+ {"screenshot": {"name": "navigation", "options": {"clip": {"selector": "#nav"}}}}
241
+ ])
242
+
243
+ # Analyze responsive behavior
244
+ print(f"Tested {results['execution_summary']['successful_viewports']} viewports")
245
+ print(f"Fastest: {results['responsive_analysis']['performance_analysis']['fastest_viewport']}")
246
+ ```
247
+
248
+ ## 🔧 CLI Commands
249
+
250
+ ### **Universal Testing**
251
+ ```bash
252
+ # Simple page test with complete intelligence
253
+ cursorflow test --base-url http://localhost:3000 --path "/dashboard"
254
+
255
+ # Responsive testing across multiple viewports
256
+ cursorflow test --base-url http://localhost:3000 --path "/dashboard" --responsive
257
+
258
+ # Complex interaction testing
259
+ cursorflow test --base-url http://localhost:3000 --actions '[
260
+ {"navigate": "/form"},
261
+ {"fill": {"selector": "#name", "value": "Test User"}},
262
+ {"click": "#submit"},
263
+ {"screenshot": {"name": "result", "options": {"clip": {"selector": ".result-area"}}}}
264
+ ]'
265
+
266
+ # Responsive testing with custom actions
267
+ cursorflow test --base-url http://localhost:3000 --responsive --actions '[
268
+ {"navigate": "/products"},
269
+ {"fill": {"selector": "#search", "value": "laptop"}},
270
+ {"screenshot": "search-results"}
271
+ ]'
272
+
273
+ # Custom output location
274
+ cursorflow test --base-url http://localhost:3000 --path "/api" --output "api-test-results.json"
275
+ ```
276
+
277
+ ### **Design Comparison**
278
+ ```bash
279
+ # Compare mockup to implementation
280
+ cursorflow compare-mockup https://mockup.com/design \
281
+ --base-url http://localhost:3000 \
282
+ --mockup-actions '[{"navigate": "/"}]' \
283
+ --implementation-actions '[{"navigate": "/dashboard"}]'
284
+
285
+ # CSS iteration with HMR intelligence
286
+ cursorflow iterate-mockup https://mockup.com/design \
287
+ --base-url http://localhost:5173 \
288
+ --css-improvements '[
289
+ {"name": "fix-spacing", "css": ".container { gap: 2rem; }"}
290
+ ]'
291
+ ```
292
+
293
+ ### **AI Integration**
294
+ ```bash
295
+ # Install Cursor AI rules
296
+ cursorflow install-rules
297
+
298
+ # Update to latest version and rules
299
+ cursorflow update
300
+ ```
301
+
302
+ ## 🧠 Why This Matters
303
+
304
+ ### **For Job Board v4 Testing:**
305
+ ✅ **Real API response times** from `/ajax_rq.smpl?fn=gjapi_typeahead`
306
+ ✅ **Actual network failures** when they occur
307
+ ✅ **Real browser console errors** from production code
308
+ ✅ **Genuine performance metrics** under real load
309
+
310
+ ❌ **With mocking:** You'd never know the typeahead is slow in production!
311
+
312
+ ### **For Any Web Application:**
313
+ - **Trust your test results** - they reflect actual behavior
314
+ - **Find real performance bottlenecks** - no artificial speed boosts
315
+ - **Discover actual edge cases** - no simulation gaps
316
+ - **Debug genuine issues** - real errors, real timing, real context
317
+
318
+ ## 🌟 Framework Support
319
+
320
+ **Universal Compatibility:**
321
+ - Works with **any web application** regardless of technology
322
+ - **Framework-agnostic** core operations
323
+ - **Smart adaptation** to different environments
324
+
325
+ **HMR Auto-Detection:**
326
+ - ✅ **Vite** (port 5173)
327
+ - ✅ **Webpack Dev Server** (port 3000)
328
+ - ✅ **Next.js** (port 3000)
329
+ - ✅ **Parcel** (port 1234)
330
+ - ✅ **Laravel Mix** (port 3000)
331
+
332
+ ## 📖 Documentation
333
+
334
+ - **[Complete User Manual](docs/USER_MANUAL.md)** - Full feature guide
335
+ - **[Examples](examples/)** - Practical usage examples
336
+ - **[API Reference](docs/api/)** - Complete Python API documentation
337
+
338
+ ## 🎪 The CursorFlow Advantage
339
+
340
+ ### **Other Tools Say:**
341
+ *"We let you mock and simulate"*
342
+
343
+ ### **CursorFlow Says:**
344
+ *"We tell you the truth"*
345
+
346
+ **When you need to understand reality, choose the measurement tool - not the simulation tool.**
347
+
348
+ ---
349
+
350
+ **Complete page intelligence • Real behavior measurement • AI-first design • Pure observation**
@@ -1,15 +1,15 @@
1
- cursorflow/__init__.py,sha256=lP0RXTBbo-BTIT7w4GezlQzHasC46QXTOwDW1BUZqMg,2476
1
+ cursorflow/__init__.py,sha256=4i8WdpsTOfyiNOpUqVJEnUVtYBpfJ2xusnQahWAVnSc,2763
2
2
  cursorflow/auto_updater.py,sha256=oQ12TIMZ6Cm3HF-x9iRWFtvOLkRh-JWPqitS69-4roE,7851
3
- cursorflow/cli.py,sha256=KD2yzVQvfoKqGgAQYp3TtWjRCuxH1EOtD-uA8ameDZ0,25388
4
- cursorflow/install_cursorflow_rules.py,sha256=2HE7PQgSDPz2BLWBhdxRXTHtk8YHLITjq5GWbKD7EZs,11792
3
+ cursorflow/cli.py,sha256=ffsBKsQc95NfJOVuIn4-Arnx8LZU9fvzAHYy4_f_aSU,27250
4
+ cursorflow/install_cursorflow_rules.py,sha256=gBqWPgyMplyBlVPXKR5Tf-haDSDeIkZeGG0PHkxblMo,11792
5
5
  cursorflow/updater.py,sha256=rAST7STjw-SgKxn_jsQJWOoyEMia-MQVxpKMwzPRnOA,19573
6
6
  cursorflow/core/agent.py,sha256=f3lecgEzDRDdGTVccAtorpLGfNJJ49bbsQAmgr0vNGg,10136
7
7
  cursorflow/core/auth_handler.py,sha256=oRafO6ZdxoHryBIvHsrNV8TECed4GXpJsdEiH0KdPPk,17149
8
- cursorflow/core/browser_controller.py,sha256=OII52LBgN97-G-6mPCiqbFGbHnU9KtHaYB0qeylqo2U,125963
9
- cursorflow/core/browser_engine.py,sha256=Glq8U_bXRkO2Yal0nku7Z2wKwOftY4So2XN4oy56WLo,13732
8
+ cursorflow/core/browser_controller.py,sha256=8TfhkBavWbwhTEGUmLdvA4UvIdLI64qct1HpnSBjBFo,131364
9
+ cursorflow/core/browser_engine.py,sha256=RpGtMOjyE7WW2BiR1cKcNnXNuiUbKt5svFgn1k3zozo,14415
10
10
  cursorflow/core/css_iterator.py,sha256=whLCIwbHZEWaH1HCbmqhNX5zrh_fL-r3hsxKjYsukcE,16478
11
11
  cursorflow/core/cursor_integration.py,sha256=MAeHjXYeqzaXnhskqkTDB-n5ixIHqapGe93X0lLKhws,67501
12
- cursorflow/core/cursorflow.py,sha256=GohWXvCLTsIIxI2UBRkFPM3yptbPNw4wI1vxKRPPMd0,31816
12
+ cursorflow/core/cursorflow.py,sha256=sLML1rP-caLY-r_llkq6rb4TGL8ZGb4pBwN5pbPQICY,43919
13
13
  cursorflow/core/error_context_collector.py,sha256=so-aveqwb6_vRDbtKR2ln8_F84aaVIceNi1UHsaVPgc,26196
14
14
  cursorflow/core/error_correlator.py,sha256=g6YaIF2yFXUDrTuWHCyuES6K0696H8LDWmXH1qI8ddA,13367
15
15
  cursorflow/core/event_correlator.py,sha256=lCzXFnii17AQt3rOVOclez_AnjvBCF_2ZlnFG0mIN6c,7808
@@ -26,9 +26,9 @@ cursorflow/log_sources/ssh_remote.py,sha256=zSnX8mpa5G86UDWEm3_FqYwo1PjBW67C1LPk
26
26
  cursorflow/rules/__init__.py,sha256=gPcA-IkhXj03sl7cvZV0wwo7CtEkcyuKs4y0F5oQbqE,458
27
27
  cursorflow/rules/cursorflow-installation.mdc,sha256=PZN4hHpy2_g3EzD8BxZYhXF9A6YCvtMGaD3uOA7UVSs,9511
28
28
  cursorflow/rules/cursorflow-usage.mdc,sha256=SAsJRmml8W1zE_jArZnRtygO9RmggjEzxGA6hxBJ-H4,18924
29
- cursorflow-2.0.4.dist-info/licenses/LICENSE,sha256=e4QbjAsj3bW-xgQOvQelr8sGLYDoqc48k6cKgCr_pBU,1080
30
- cursorflow-2.0.4.dist-info/METADATA,sha256=PcY-kjD3pWWiGFR1HweY3RHs9_pHr9J63JMlzVdmJwA,10656
31
- cursorflow-2.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
- cursorflow-2.0.4.dist-info/entry_points.txt,sha256=-Ed_n4Uff7wClEtWS-Py6xmQabecB9f0QAOjX0w7ljA,51
33
- cursorflow-2.0.4.dist-info/top_level.txt,sha256=t1UZwRyZP4u-ng2CEcNHmk_ZT4ibQxoihB2IjTF7ovc,11
34
- cursorflow-2.0.4.dist-info/RECORD,,
29
+ cursorflow-2.1.1.dist-info/licenses/LICENSE,sha256=e4QbjAsj3bW-xgQOvQelr8sGLYDoqc48k6cKgCr_pBU,1080
30
+ cursorflow-2.1.1.dist-info/METADATA,sha256=qu-cojQCxwFOlLR5g8QhlFevKeOmxWlteLbZGGCSWns,12300
31
+ cursorflow-2.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
+ cursorflow-2.1.1.dist-info/entry_points.txt,sha256=-Ed_n4Uff7wClEtWS-Py6xmQabecB9f0QAOjX0w7ljA,51
33
+ cursorflow-2.1.1.dist-info/top_level.txt,sha256=t1UZwRyZP4u-ng2CEcNHmk_ZT4ibQxoihB2IjTF7ovc,11
34
+ cursorflow-2.1.1.dist-info/RECORD,,
@@ -1,293 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: cursorflow
3
- Version: 2.0.4
4
- Summary: 🔥 Complete page intelligence for AI-driven development with Hot Reload Intelligence - captures DOM, network, console, performance, HMR events, and comprehensive page analysis
5
- Author-email: GeekWarrior Development <rbush@cooltheory.com>
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/haley-marketing-group/cursorflow
8
- Project-URL: Documentation, https://cursorflow.readthedocs.io
9
- Project-URL: Repository, https://github.com/haley-marketing-group/cursorflow
10
- Keywords: ui-testing,automation,cursor,ai,web-testing,css-iteration,hot-reload,hmr,element-intelligence,page-analysis,error-context
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Topic :: Software Development :: Testing
20
- Classifier: Topic :: Software Development :: Quality Assurance
21
- Classifier: Framework :: AsyncIO
22
- Requires-Python: >=3.8
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE
25
- Requires-Dist: playwright>=1.40.0
26
- Requires-Dist: paramiko>=3.3.1
27
- Requires-Dist: pyyaml>=6.0.1
28
- Requires-Dist: asyncio-mqtt>=0.11.1
29
- Requires-Dist: click>=8.1.7
30
- Requires-Dist: rich>=13.6.0
31
- Requires-Dist: jinja2>=3.1.2
32
- Requires-Dist: python-dateutil>=2.8.2
33
- Requires-Dist: watchdog>=3.0.0
34
- Requires-Dist: docker>=6.1.3
35
- Requires-Dist: pillow>=10.0.0
36
- Requires-Dist: numpy>=1.24.0
37
- Requires-Dist: websockets>=11.0.0
38
- Provides-Extra: dev
39
- Requires-Dist: pytest>=7.4.0; extra == "dev"
40
- Requires-Dist: pytest-asyncio>=0.21.1; extra == "dev"
41
- Requires-Dist: black>=23.9.1; extra == "dev"
42
- Requires-Dist: flake8>=6.1.0; extra == "dev"
43
- Requires-Dist: mypy>=1.6.1; extra == "dev"
44
- Dynamic: license-file
45
-
46
- # CursorFlow
47
-
48
- **Complete page intelligence for AI-driven development**
49
-
50
- CursorFlow captures comprehensive data from web applications - DOM structure, CSS properties, network activity, console logs, and performance metrics - enabling AI agents like Cursor to make intelligent decisions about UI improvements and debugging.
51
-
52
- ## 🎯 What CursorFlow Does
53
-
54
- **Data Collection, Not Analysis** - We gather structured data, AI makes the decisions.
55
-
56
- ### **📊 Complete Page Intelligence**
57
- Every screenshot captures everything:
58
- - **DOM**: All elements with 7 selector strategies each
59
- - **Network**: All requests, responses, and complete response bodies
60
- - **Console**: All logs, errors, and smart error correlation
61
- - **Performance**: Load times, memory usage, with reliability indicators
62
- - **Visual**: Screenshots with pixel-perfect comparisons
63
- - **Fonts**: Loading status, performance, and usage analysis
64
- - **Animations**: Active animations and transitions tracking
65
- - **Resources**: Complete resource loading analysis
66
- - **Storage**: localStorage, sessionStorage, cookies, IndexedDB state
67
-
68
- ### **🔄 Rapid Iteration Support**
69
- - **Hot Reload Intelligence** with framework auto-detection (Vite, Webpack, Next.js, Parcel, Laravel Mix)
70
- - **Mockup comparison** with enhanced DOM and CSS analysis
71
- - **Hot reload integration** for instant, perfectly-timed CSS testing
72
- - **Persistent sessions** that survive code changes
73
- - **Universal framework support** (React, Vue, PHP, Perl, anything)
74
-
75
- ### **🤖 AI-First Design**
76
- All data structured for AI consumption:
77
- - Consistent JSON format across all features
78
- - **Multi-selector element identification** for robust automation
79
- - **Accessibility-aware** element analysis
80
- - Error correlation with **smart screenshot deduplication**
81
- - Performance insights with **reliability metadata**
82
- - **HMR event correlation** for CSS change tracking
83
-
84
- ## 🚀 Quick Start
85
-
86
- ```bash
87
- # Install CursorFlow
88
- pip install cursorflow
89
-
90
- # Test with complete intelligence
91
- cursorflow test --base-url http://localhost:3000 --actions '[
92
- {"navigate": "/dashboard"},
93
- {"wait_for": "#main-content"},
94
- {"screenshot": "dashboard-loaded"}
95
- ]'
96
-
97
- # HMR-powered CSS iteration
98
- cursorflow iterate-mockup https://mockup.com/design \
99
- --base-url http://localhost:5173 \
100
- --css-improvements '[
101
- {"name": "fix-spacing", "css": ".container { gap: 2rem; }"}
102
- ]'
103
- ```
104
-
105
- ## 💻 Usage Examples
106
-
107
- ### **Hot Reload Intelligence**
108
- ```python
109
- from cursorflow import CursorFlow
110
-
111
- async def hmr_workflow():
112
- flow = CursorFlow("http://localhost:5173", {"headless": False})
113
-
114
- # Start HMR monitoring (auto-detects Vite/Webpack/Next.js)
115
- await flow.browser.start_hmr_monitoring()
116
-
117
- # Take baseline
118
- await flow.execute_and_collect([
119
- {"navigate": "/app"},
120
- {"screenshot": "baseline"}
121
- ])
122
-
123
- # Wait for CSS changes with perfect timing
124
- hmr_event = await flow.browser.wait_for_css_update()
125
- print(f"🔥 {hmr_event['framework']} CSS update detected!")
126
-
127
- # Capture immediately after change
128
- await flow.execute_and_collect([
129
- {"screenshot": "updated"}
130
- ])
131
- ```
132
-
133
- ### **Advanced Element Analysis**
134
- ```python
135
- # Get comprehensive element data
136
- results = await flow.execute_and_collect([
137
- {"navigate": "/form"},
138
- {"screenshot": "form-analysis"}
139
- ])
140
-
141
- # Access enhanced element data
142
- for element in results['artifacts']['screenshots'][0]['dom_analysis']['elements']:
143
- print(f"Element: {element['selector']}")
144
- print(f" 7 Selectors: {list(element['selectors'].keys())}")
145
- print(f" Accessible: {element['accessibility']['role']}")
146
- print(f" Interactive: {element['accessibility']['interactive']}")
147
- print(f" Visible: {element['visual_context']['visibility']['is_visible']}")
148
- ```
149
-
150
- ### **Comprehensive Page Intelligence**
151
- ```python
152
- # Get complete page analysis
153
- screenshot = results['artifacts']['screenshots'][0]
154
-
155
- # Complete Intelligence
156
- print(f"Fonts loaded: {screenshot['font_status']['loadedFonts']}")
157
- print(f"Animations running: {screenshot['animation_status']['runningAnimations']}")
158
- print(f"Resources: {screenshot['resource_status']['totalResources']}")
159
- print(f"Storage items: {screenshot['storage_status']['localStorage']['itemCount']}")
160
- ```
161
-
162
- ### **Smart Error Diagnostics**
163
- ```python
164
- # Enhanced error context with deduplication
165
- error_context = await flow.browser.capture_interaction_error_context(
166
- action_description="Submit form",
167
- error_details={"type": "validation_error"}
168
- )
169
-
170
- print(f"Screenshot: {error_context['screenshot_info']['path']}")
171
- print(f"Reused: {error_context['screenshot_info']['is_reused']}") # Smart deduplication
172
- print(f"Context: {len(error_context['recent_actions'])} recent actions")
173
- ```
174
-
175
- ## 🔧 CLI Commands
176
-
177
- ### **Universal Testing with Complete Intelligence**
178
- ```bash
179
- # Simple page test with full intelligence
180
- cursorflow test --base-url http://localhost:3000 --path "/dashboard"
181
-
182
- # Complex interaction test
183
- cursorflow test --base-url http://localhost:3000 --actions '[
184
- {"navigate": "/login"},
185
- {"fill": {"selector": "#email", "value": "test@example.com"}},
186
- {"click": "#login-btn"},
187
- {"wait_for": ".dashboard"},
188
- {"screenshot": "logged-in"}
189
- ]'
190
- ```
191
-
192
- ### **HMR-Powered CSS Iteration**
193
- ```bash
194
- # Perfect CSS iteration with HMR intelligence
195
- cursorflow iterate-mockup https://mockup.com/design \
196
- --base-url http://localhost:5173 \
197
- --css-improvements '[
198
- {"name": "improve-spacing", "css": ".container { gap: 2rem; }"},
199
- {"name": "enhance-colors", "css": ".button { background: #007bff; }"}
200
- ]'
201
- ```
202
-
203
- ### **Enhanced Design Comparison**
204
- ```bash
205
- # Compare with comprehensive intelligence
206
- cursorflow compare-mockup https://mockup.com/design \
207
- --base-url http://localhost:3000 \
208
- --mockup-actions '[{"navigate": "/"}]' \
209
- --implementation-actions '[{"navigate": "/dashboard"}]'
210
- ```
211
-
212
- ## 🧠 AI Integration
213
-
214
- ### **Cursor Rules (Auto-Install)**
215
- ```bash
216
- # Install AI assistance rules
217
- cursorflow install-rules
218
- ```
219
-
220
- CursorFlow includes comprehensive rules that teach Cursor:
221
- - **When to use HMR intelligence** for CSS iteration
222
- - **How to analyze multi-selector element data**
223
- - **Best practices for comprehensive page analysis**
224
- - **Error debugging with smart context collection**
225
-
226
- ### **Structured Data for AI**
227
- Every CursorFlow operation returns **perfectly structured JSON** optimized for AI analysis:
228
-
229
- ```json
230
- {
231
- "artifacts": {
232
- "screenshots": [{
233
- "path": ".cursorflow/artifacts/screenshots/dashboard_123.png",
234
- "dom_analysis": {
235
- "elements": [...], // 7 selectors + accessibility per element
236
- "pageStructure": {...}, // Enhanced page analysis
237
- "analysisVersion": "2.0" // Version tracking
238
- },
239
- "font_status": {...}, // Font loading intelligence
240
- "animation_status": {...}, // Animation tracking
241
- "resource_status": {...}, // Resource analysis
242
- "storage_status": {...}, // Storage state
243
- "hmr_status": {...} // HMR event data
244
- }]
245
- }
246
- }
247
- ```
248
-
249
- ## 🌟 Framework Support
250
-
251
- **HMR Auto-Detection:**
252
- - ✅ **Vite** (port 5173, WebSocket `/__vite_hmr`)
253
- - ✅ **Webpack Dev Server** (port 3000, WebSocket `/sockjs-node`)
254
- - ✅ **Next.js** (port 3000, WebSocket `/_next/webpack-hmr`)
255
- - ✅ **Parcel** (port 1234, WebSocket `/hmr`)
256
- - ✅ **Laravel Mix** (port 3000, WebSocket `/browser-sync/socket.io`)
257
-
258
- **Universal Compatibility:**
259
- - Works with **any web application** regardless of framework
260
- - **Framework-agnostic** core operations
261
- - **Smart adaptation** to different development environments
262
-
263
- ## 📖 Documentation
264
-
265
- - **[Complete User Manual](docs/USER_MANUAL.md)** - Full feature guide
266
- - **[Examples](examples/)** - Practical usage examples
267
- - **[API Reference](docs/api/)** - Complete Python API documentation
268
-
269
- ## 🚀 Why CursorFlow?
270
-
271
- ### **For Developers:**
272
- - **Faster CSS iteration** with HMR precision timing
273
- - **Complete element intelligence** with multi-selector strategies
274
- - **Full page visibility** with comprehensive analysis
275
- - **Smart error debugging** with rich context collection
276
-
277
- ### **For AI Agents:**
278
- - **Perfect structured data** for intelligent decision making
279
- - **Multi-selector reliability** for robust automation
280
- - **Accessibility awareness** for inclusive development
281
- - **HMR correlation** for understanding change impact
282
-
283
- ### **For Teams:**
284
- - **Framework agnostic** - works with any web technology
285
- - **Production ready** - handles real-world complexity
286
- - **Comprehensive testing** - covers all aspects of web apps
287
- - **AI-first design** - built for autonomous development
288
-
289
- ---
290
-
291
- **Complete page intelligence for AI-driven development with CursorFlow**
292
-
293
- *Hot reload precision • Advanced element analysis • Smart error diagnostics • Comprehensive page intelligence*