cursorflow 2.1.4__py3-none-any.whl → 2.1.5__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.
cursorflow/__init__.py CHANGED
@@ -56,7 +56,7 @@ def _get_version():
56
56
  pass
57
57
 
58
58
  # Fallback version - should match pyproject.toml
59
- return "2.1.4"
59
+ return "2.1.5"
60
60
 
61
61
  __version__ = _get_version()
62
62
  __author__ = "GeekWarrior Development"
@@ -0,0 +1,147 @@
1
+ """
2
+ Auto-initialization for CursorFlow
3
+
4
+ Detects uninitialized projects and offers to set them up automatically.
5
+ Makes the setup process seamless for both humans and AI agents.
6
+ """
7
+
8
+ import os
9
+ import sys
10
+ from pathlib import Path
11
+ from typing import Optional
12
+
13
+
14
+ def is_project_initialized(project_dir: Optional[str] = None) -> bool:
15
+ """
16
+ Check if CursorFlow is initialized in the project
17
+
18
+ Returns True if:
19
+ - .cursor/rules/ contains CursorFlow rules
20
+ - cursorflow-config.json exists
21
+ - .cursorflow/ directory exists
22
+ """
23
+ if project_dir is None:
24
+ project_dir = os.getcwd()
25
+
26
+ project_path = Path(project_dir)
27
+
28
+ # Check for key indicators
29
+ has_rules = (project_path / ".cursor" / "rules" / "cursorflow-usage.mdc").exists()
30
+ has_config = (project_path / "cursorflow-config.json").exists()
31
+ has_artifacts_dir = (project_path / ".cursorflow").exists()
32
+
33
+ # Need at least rules and config
34
+ return has_rules and has_config
35
+
36
+
37
+ def auto_initialize_if_needed(project_dir: Optional[str] = None, interactive: bool = True) -> bool:
38
+ """
39
+ Auto-initialize CursorFlow in project if not already initialized
40
+
41
+ Args:
42
+ project_dir: Project directory (defaults to cwd)
43
+ interactive: If True, ask user for confirmation. If False, auto-initialize silently.
44
+
45
+ Returns:
46
+ True if initialized (or already was), False if user declined or error occurred
47
+ """
48
+ if is_project_initialized(project_dir):
49
+ return True
50
+
51
+ if project_dir is None:
52
+ project_dir = os.getcwd()
53
+
54
+ project_path = Path(project_dir)
55
+
56
+ # If non-interactive (e.g., running via Cursor), just do it
57
+ if not interactive:
58
+ try:
59
+ from .install_cursorflow_rules import install_cursorflow_rules
60
+ return install_cursorflow_rules(project_dir, force=False)
61
+ except Exception as e:
62
+ print(f"⚠️ Auto-initialization failed: {e}", file=sys.stderr)
63
+ print(f"💡 Run manually: cursorflow install-rules", file=sys.stderr)
64
+ return False
65
+
66
+ # Interactive mode: ask user
67
+ print("\n🎯 CursorFlow is not initialized in this project yet.")
68
+ print(f"📁 Project directory: {project_path}")
69
+ print("\nTo use CursorFlow, we need to set up:")
70
+ print(" • Cursor AI rules in .cursor/rules/")
71
+ print(" • Configuration file: cursorflow-config.json")
72
+ print(" • Artifacts directory: .cursorflow/")
73
+ print(" • .gitignore entries for CursorFlow artifacts")
74
+
75
+ response = input("\n🚀 Initialize CursorFlow now? [Y/n]: ").strip().lower()
76
+
77
+ if response in ('', 'y', 'yes'):
78
+ try:
79
+ from .install_cursorflow_rules import install_cursorflow_rules
80
+ success = install_cursorflow_rules(project_dir, force=False)
81
+
82
+ if success:
83
+ print("\n✅ CursorFlow is ready to use!")
84
+ print("💡 Start testing with: cursorflow test --help")
85
+
86
+ return success
87
+
88
+ except Exception as e:
89
+ print(f"\n❌ Initialization failed: {e}", file=sys.stderr)
90
+ print(f"💡 Try manually: cursorflow install-rules", file=sys.stderr)
91
+ return False
92
+ else:
93
+ print("\n⏭️ Skipped initialization.")
94
+ print("💡 Run later with: cursorflow install-rules")
95
+ return False
96
+
97
+
98
+ def get_initialization_warning() -> str:
99
+ """Get a friendly warning message for uninitialized projects"""
100
+
101
+ return """
102
+ ╔════════════════════════════════════════════════════════════════╗
103
+ ║ 🎯 CursorFlow Not Initialized ║
104
+ ╠════════════════════════════════════════════════════════════════╣
105
+ ║ ║
106
+ ║ CursorFlow requires project-specific setup to work properly. ║
107
+ ║ ║
108
+ ║ Quick fix: ║
109
+ ║ cursorflow install-rules ║
110
+ ║ ║
111
+ ║ This creates: ║
112
+ ║ • .cursor/rules/ (Cursor AI integration) ║
113
+ ║ • cursorflow-config.json (project configuration) ║
114
+ ║ • .cursorflow/ (artifacts and sessions) ║
115
+ ║ • .gitignore entries ║
116
+ ║ ║
117
+ ╚════════════════════════════════════════════════════════════════╝
118
+ """
119
+
120
+
121
+ def ensure_initialized(project_dir: Optional[str] = None, auto_init: bool = False) -> None:
122
+ """
123
+ Ensure project is initialized, or raise helpful error
124
+
125
+ Args:
126
+ project_dir: Project directory
127
+ auto_init: If True, automatically initialize without asking
128
+
129
+ Raises:
130
+ RuntimeError: If not initialized and user declines/can't initialize
131
+ """
132
+ if is_project_initialized(project_dir):
133
+ return
134
+
135
+ # Try auto-initialization
136
+ interactive = not auto_init and sys.stdin.isatty()
137
+
138
+ if auto_initialize_if_needed(project_dir, interactive=interactive):
139
+ return
140
+
141
+ # Failed to initialize
142
+ print(get_initialization_warning(), file=sys.stderr)
143
+ raise RuntimeError(
144
+ "CursorFlow not initialized in this project. "
145
+ "Run: cursorflow install-rules"
146
+ )
147
+
cursorflow/cli.py CHANGED
@@ -22,9 +22,31 @@ console = Console()
22
22
 
23
23
  @click.group()
24
24
  @click.version_option(version=__version__)
25
- def main():
25
+ @click.pass_context
26
+ def main(ctx):
26
27
  """Universal UI testing framework for any web technology"""
27
- pass
28
+
29
+ # Skip initialization check for commands that don't need it
30
+ skip_init_check = ['install-rules', 'init', 'update', 'check-updates', 'install-deps']
31
+
32
+ if ctx.invoked_subcommand in skip_init_check:
33
+ return
34
+
35
+ # Check if project is initialized, offer to auto-initialize
36
+ from .auto_init import is_project_initialized, auto_initialize_if_needed
37
+
38
+ if not is_project_initialized():
39
+ console.print("\n[yellow]⚠️ CursorFlow not initialized in this project[/yellow]")
40
+ console.print("This is a one-time setup that creates:")
41
+ console.print(" • .cursor/rules/ (Cursor AI integration)")
42
+ console.print(" • cursorflow-config.json (project configuration)")
43
+ console.print(" • .cursorflow/ (artifacts directory)")
44
+
45
+ # Auto-initialize with confirmation
46
+ if not auto_initialize_if_needed(interactive=True):
47
+ console.print("\n[red]Cannot proceed without initialization.[/red]")
48
+ console.print("Run: [cyan]cursorflow install-rules[/cyan]")
49
+ ctx.exit(1)
28
50
 
29
51
  @main.command()
30
52
  @click.option('--base-url', '-u', required=True,
@@ -125,9 +125,9 @@ def create_config_template(project_path: Path, force: bool = False):
125
125
  # Get current version
126
126
  try:
127
127
  import cursorflow
128
- current_version = getattr(cursorflow, '__version__', '2.1.4')
128
+ current_version = getattr(cursorflow, '__version__', '2.1.5')
129
129
  except ImportError:
130
- current_version = '2.1.4'
130
+ current_version = '2.1.5'
131
131
 
132
132
  if config_path.exists():
133
133
  if not force:
@@ -302,9 +302,9 @@ def setup_update_checking(project_path: Path):
302
302
  # Create initial version tracking
303
303
  try:
304
304
  import cursorflow
305
- current_version = getattr(cursorflow, '__version__', '2.1.4')
305
+ current_version = getattr(cursorflow, '__version__', '2.1.5')
306
306
  except ImportError:
307
- current_version = '2.1.4'
307
+ current_version = '2.1.5'
308
308
 
309
309
  version_info = {
310
310
  "installed_version": current_version,
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Post-install message for CursorFlow
4
+
5
+ Shows important setup instructions after pip install.
6
+ """
7
+
8
+ def show_post_install_message():
9
+ """Display post-install instructions"""
10
+
11
+ message = """
12
+ ╔══════════════════════════════════════════════════════════════════════╗
13
+ ║ ║
14
+ ║ ✅ CursorFlow installed successfully! ║
15
+ ║ ║
16
+ ║ 📋 IMPORTANT: One more step to enable CursorFlow in your project ║
17
+ ║ ║
18
+ ║ Run this in your project directory: ║
19
+ ║ ║
20
+ ║ cd /path/to/your/project ║
21
+ ║ cursorflow install-rules ║
22
+ ║ ║
23
+ ║ This creates: ║
24
+ ║ • Cursor AI integration rules ║
25
+ ║ • Project-specific configuration ║
26
+ ║ • Artifacts directory structure ║
27
+ ║ ║
28
+ ║ 💡 Then install browser dependencies: ║
29
+ ║ ║
30
+ ║ playwright install chromium ║
31
+ ║ ║
32
+ ║ 🚀 After that, you can start testing: ║
33
+ ║ ║
34
+ ║ cursorflow test --base-url http://localhost:3000 --path / ║
35
+ ║ ║
36
+ ║ 📚 Documentation: https://github.com/haley-marketing-group/cursorflow ║
37
+ ║ ║
38
+ ╚══════════════════════════════════════════════════════════════════════╝
39
+ """
40
+
41
+ print(message)
42
+
43
+
44
+ if __name__ == "__main__":
45
+ show_post_install_message()
46
+
@@ -1,11 +1,32 @@
1
1
  ---
2
- title: CursorFlow 2.0.0 Installation & Setup Guide for Cursor
3
- description: How to install and configure CursorFlow 2.0.0 for complete page intelligence in AI-driven development
2
+ title: CursorFlow Installation & Setup Guide for Cursor
3
+ description: How to install and configure CursorFlow for complete page intelligence in AI-driven development
4
4
  ---
5
5
 
6
- # CursorFlow 2.1.4 Installation & Setup Guide for Cursor
6
+ # CursorFlow Installation & Setup Guide for Cursor
7
7
 
8
- ## 🚀 **When to Install CursorFlow 2.1.4**
8
+ ## ⚠️ **CRITICAL: Two-Step Installation Process**
9
+
10
+ **If you are reading this file, Step 2 is already complete for this project.**
11
+
12
+ CursorFlow requires **TWO installations**:
13
+
14
+ 1. **Step 1 - Package Installation** (once per Python environment):
15
+ ```bash
16
+ pip install cursorflow
17
+ playwright install chromium
18
+ ```
19
+
20
+ 2. **Step 2 - Project Initialization** (once per project):
21
+ ```bash
22
+ cursorflow install-rules
23
+ ```
24
+ This step created THIS FILE you're reading right now.
25
+
26
+ **If Cursor reports "command not found: cursorflow"**, the user needs Step 1.
27
+ **If you can run cursorflow but tests fail**, check `cursorflow-config.json` in project root.
28
+
29
+ ## 🚀 **When to Install CursorFlow**
9
30
 
10
31
  ### **Automatically Install When:**
11
32
  - User mentions UI testing, visual debugging, or layout issues
@@ -24,10 +45,13 @@ description: How to install and configure CursorFlow 2.0.0 for complete page int
24
45
 
25
46
  ## 📦 **Installation Steps**
26
47
 
27
- ### **1. Install CursorFlow 2.0.0:**
48
+ ### **1. Verify Package Installation:**
28
49
  ```bash
29
- # Install CursorFlow 2.0.0 with complete page intelligence
30
- pip install cursorflow
50
+ # Check if CursorFlow is installed
51
+ cursorflow --version
52
+
53
+ # If not installed or outdated:
54
+ pip install --upgrade cursorflow
31
55
 
32
56
  # Install browser automation dependencies
33
57
  playwright install chromium
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cursorflow
3
- Version: 2.1.4
3
+ Version: 2.1.5
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
5
  Author-email: GeekWarrior Development <rbush@cooltheory.com>
6
6
  License-Expression: MIT
@@ -138,10 +138,26 @@ All data structured for AI consumption:
138
138
 
139
139
  ## 🚀 Quick Start
140
140
 
141
+ ### Step 1: Install CursorFlow Package
141
142
  ```bash
142
- # Install CursorFlow
143
143
  pip install cursorflow
144
+ playwright install chromium
145
+ ```
144
146
 
147
+ ### Step 2: Initialize Your Project (One-Time Setup)
148
+ ```bash
149
+ cd /path/to/your/project
150
+ cursorflow install-rules
151
+ ```
152
+
153
+ This creates:
154
+ - `.cursor/rules/` - Cursor AI integration rules
155
+ - `cursorflow-config.json` - Project-specific configuration
156
+ - `.cursorflow/` - Artifacts and session storage
157
+ - `.gitignore` entries for CursorFlow artifacts
158
+
159
+ ### Step 3: Start Testing
160
+ ```bash
145
161
  # Test real application behavior
146
162
  cursorflow test --base-url http://localhost:3000 --path "/dashboard"
147
163
 
@@ -1,7 +1,9 @@
1
- cursorflow/__init__.py,sha256=3zdOAvMaLDe_OLKUbh-G9q0jXnprS-9CHxpRxKJPWy8,2763
1
+ cursorflow/__init__.py,sha256=PrqWlldzSIzubH8DN_iw08QPTmWUsMlkeWaEVp1mpdw,2763
2
+ cursorflow/auto_init.py,sha256=NqS3zPC-ILyCAvjlhQ9cDhuxOgu2SbqQvI4rzrgbv2k,5916
2
3
  cursorflow/auto_updater.py,sha256=oQ12TIMZ6Cm3HF-x9iRWFtvOLkRh-JWPqitS69-4roE,7851
3
- cursorflow/cli.py,sha256=ca36aTHFLYpiaeQYoj3TB4o39CEfj3WWaePze8yNvdg,27280
4
- cursorflow/install_cursorflow_rules.py,sha256=xIVw1DhqHL9YDT_JM7sXfVcMXIB0OuYZjC18jac-v8o,11792
4
+ cursorflow/cli.py,sha256=mk8mr1pN4cHCDIPhzSIxk-Jho6aSU6ZwCPJA9PqcKv4,28375
5
+ cursorflow/install_cursorflow_rules.py,sha256=hpe3otnJN4h51h5xxGEJ25PWmCkj3IBfSpieYcbLFPU,11792
6
+ cursorflow/post_install.py,sha256=WieBiKWG0qBAQpF8iMVWUyb9Fr2Xky9qECTMPrlAbpE,2678
5
7
  cursorflow/updater.py,sha256=rAST7STjw-SgKxn_jsQJWOoyEMia-MQVxpKMwzPRnOA,19573
6
8
  cursorflow/core/agent.py,sha256=f3lecgEzDRDdGTVccAtorpLGfNJJ49bbsQAmgr0vNGg,10136
7
9
  cursorflow/core/auth_handler.py,sha256=oRafO6ZdxoHryBIvHsrNV8TECed4GXpJsdEiH0KdPPk,17149
@@ -24,11 +26,11 @@ cursorflow/core/trace_manager.py,sha256=Jj9ultZrL1atiZXfcRVI6ynCnnfqZM-X0_taxt-l
24
26
  cursorflow/log_sources/local_file.py,sha256=YAzF6oZRusNT_EOJduoeMTgP6dc1Av9wK96yNxmhSGA,7558
25
27
  cursorflow/log_sources/ssh_remote.py,sha256=xLLxm5B95kUcLqMC7-oZUA66e1rU5LLeeBiR6Mw5syc,7642
26
28
  cursorflow/rules/__init__.py,sha256=gPcA-IkhXj03sl7cvZV0wwo7CtEkcyuKs4y0F5oQbqE,458
27
- cursorflow/rules/cursorflow-installation.mdc,sha256=dLyQmKvER5J54EV5GAb-g4xNPMZP8pqecZpOlxf-tKA,9511
29
+ cursorflow/rules/cursorflow-installation.mdc,sha256=WmllIgx8MLEaxZFCwn3FBD51PPOt0JOn1GoNLQGEQJI,10191
28
30
  cursorflow/rules/cursorflow-usage.mdc,sha256=jD5IrIP2eKIeQN2TS-ehnwD1u_J6lWSXQZZ9KSUcOUU,21449
29
- cursorflow-2.1.4.dist-info/licenses/LICENSE,sha256=e4QbjAsj3bW-xgQOvQelr8sGLYDoqc48k6cKgCr_pBU,1080
30
- cursorflow-2.1.4.dist-info/METADATA,sha256=97woSQvbkl5nqSs2kOKwriTlwz1S41gp2u4dHOusFNU,12300
31
- cursorflow-2.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
- cursorflow-2.1.4.dist-info/entry_points.txt,sha256=-Ed_n4Uff7wClEtWS-Py6xmQabecB9f0QAOjX0w7ljA,51
33
- cursorflow-2.1.4.dist-info/top_level.txt,sha256=t1UZwRyZP4u-ng2CEcNHmk_ZT4ibQxoihB2IjTF7ovc,11
34
- cursorflow-2.1.4.dist-info/RECORD,,
31
+ cursorflow-2.1.5.dist-info/licenses/LICENSE,sha256=e4QbjAsj3bW-xgQOvQelr8sGLYDoqc48k6cKgCr_pBU,1080
32
+ cursorflow-2.1.5.dist-info/METADATA,sha256=H-7VwQ6Ay9YKkXfvMFHLJLm8t5fgdz9Ef3FmI652ApE,12721
33
+ cursorflow-2.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
+ cursorflow-2.1.5.dist-info/entry_points.txt,sha256=-Ed_n4Uff7wClEtWS-Py6xmQabecB9f0QAOjX0w7ljA,51
35
+ cursorflow-2.1.5.dist-info/top_level.txt,sha256=t1UZwRyZP4u-ng2CEcNHmk_ZT4ibQxoihB2IjTF7ovc,11
36
+ cursorflow-2.1.5.dist-info/RECORD,,