vibesurf 0.1.9a6__py3-none-any.whl → 0.1.11__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.

Potentially problematic release.


This version of vibesurf might be problematic. Click here for more details.

Files changed (69) hide show
  1. vibe_surf/_version.py +2 -2
  2. vibe_surf/agents/browser_use_agent.py +68 -45
  3. vibe_surf/agents/prompts/report_writer_prompt.py +73 -0
  4. vibe_surf/agents/prompts/vibe_surf_prompt.py +85 -172
  5. vibe_surf/agents/report_writer_agent.py +380 -226
  6. vibe_surf/agents/vibe_surf_agent.py +878 -814
  7. vibe_surf/agents/views.py +130 -0
  8. vibe_surf/backend/api/activity.py +3 -1
  9. vibe_surf/backend/api/browser.py +70 -0
  10. vibe_surf/backend/api/config.py +8 -5
  11. vibe_surf/backend/api/files.py +59 -50
  12. vibe_surf/backend/api/models.py +2 -2
  13. vibe_surf/backend/api/task.py +47 -13
  14. vibe_surf/backend/database/manager.py +24 -18
  15. vibe_surf/backend/database/queries.py +199 -192
  16. vibe_surf/backend/database/schemas.py +1 -1
  17. vibe_surf/backend/main.py +80 -3
  18. vibe_surf/backend/shared_state.py +30 -35
  19. vibe_surf/backend/utils/encryption.py +3 -1
  20. vibe_surf/backend/utils/llm_factory.py +41 -36
  21. vibe_surf/browser/agent_browser_session.py +308 -62
  22. vibe_surf/browser/browser_manager.py +71 -100
  23. vibe_surf/browser/utils.py +5 -3
  24. vibe_surf/browser/watchdogs/dom_watchdog.py +0 -45
  25. vibe_surf/chrome_extension/background.js +88 -0
  26. vibe_surf/chrome_extension/manifest.json +3 -1
  27. vibe_surf/chrome_extension/scripts/api-client.js +13 -0
  28. vibe_surf/chrome_extension/scripts/file-manager.js +482 -0
  29. vibe_surf/chrome_extension/scripts/history-manager.js +658 -0
  30. vibe_surf/chrome_extension/scripts/modal-manager.js +487 -0
  31. vibe_surf/chrome_extension/scripts/session-manager.js +52 -11
  32. vibe_surf/chrome_extension/scripts/settings-manager.js +1214 -0
  33. vibe_surf/chrome_extension/scripts/ui-manager.js +1530 -3163
  34. vibe_surf/chrome_extension/sidepanel.html +47 -7
  35. vibe_surf/chrome_extension/styles/activity.css +934 -0
  36. vibe_surf/chrome_extension/styles/base.css +76 -0
  37. vibe_surf/chrome_extension/styles/history-modal.css +791 -0
  38. vibe_surf/chrome_extension/styles/input.css +568 -0
  39. vibe_surf/chrome_extension/styles/layout.css +186 -0
  40. vibe_surf/chrome_extension/styles/responsive.css +454 -0
  41. vibe_surf/chrome_extension/styles/settings-environment.css +165 -0
  42. vibe_surf/chrome_extension/styles/settings-forms.css +389 -0
  43. vibe_surf/chrome_extension/styles/settings-modal.css +141 -0
  44. vibe_surf/chrome_extension/styles/settings-profiles.css +244 -0
  45. vibe_surf/chrome_extension/styles/settings-responsive.css +144 -0
  46. vibe_surf/chrome_extension/styles/settings-utilities.css +25 -0
  47. vibe_surf/chrome_extension/styles/variables.css +54 -0
  48. vibe_surf/cli.py +5 -22
  49. vibe_surf/common.py +35 -0
  50. vibe_surf/llm/openai_compatible.py +148 -93
  51. vibe_surf/logger.py +99 -0
  52. vibe_surf/{controller/vibesurf_tools.py → tools/browser_use_tools.py} +233 -221
  53. vibe_surf/tools/file_system.py +415 -0
  54. vibe_surf/{controller → tools}/mcp_client.py +4 -3
  55. vibe_surf/tools/report_writer_tools.py +21 -0
  56. vibe_surf/tools/vibesurf_tools.py +657 -0
  57. vibe_surf/tools/views.py +120 -0
  58. {vibesurf-0.1.9a6.dist-info → vibesurf-0.1.11.dist-info}/METADATA +23 -3
  59. vibesurf-0.1.11.dist-info/RECORD +93 -0
  60. vibe_surf/chrome_extension/styles/main.css +0 -2338
  61. vibe_surf/chrome_extension/styles/settings.css +0 -1100
  62. vibe_surf/controller/file_system.py +0 -53
  63. vibe_surf/controller/views.py +0 -37
  64. vibesurf-0.1.9a6.dist-info/RECORD +0 -71
  65. /vibe_surf/{controller → tools}/__init__.py +0 -0
  66. {vibesurf-0.1.9a6.dist-info → vibesurf-0.1.11.dist-info}/WHEEL +0 -0
  67. {vibesurf-0.1.9a6.dist-info → vibesurf-0.1.11.dist-info}/entry_points.txt +0 -0
  68. {vibesurf-0.1.9a6.dist-info → vibesurf-0.1.11.dist-info}/licenses/LICENSE +0 -0
  69. {vibesurf-0.1.9a6.dist-info → vibesurf-0.1.11.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,244 @@
1
+ /* Profile Management Components */
2
+
3
+ /* Profile Cards */
4
+ .profiles-container {
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 16px;
8
+ margin-bottom: 24px;
9
+ }
10
+
11
+ .profile-card {
12
+ background: var(--bg-secondary);
13
+ border: 1px solid var(--border-color);
14
+ border-radius: 12px;
15
+ padding: 20px;
16
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
17
+ position: relative;
18
+ overflow: hidden;
19
+ }
20
+
21
+ .profile-card::before {
22
+ content: '';
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ right: 0;
27
+ height: 4px;
28
+ background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
29
+ transform: scaleX(0);
30
+ transition: transform 0.3s ease;
31
+ }
32
+
33
+ .profile-card:hover {
34
+ border-color: var(--primary-color);
35
+ background: var(--bg-hover);
36
+ transform: translateY(-2px);
37
+ box-shadow: 0 8px 24px rgba(0, 122, 204, 0.15);
38
+ }
39
+
40
+ .profile-card:hover::before {
41
+ transform: scaleX(1);
42
+ }
43
+
44
+ .profile-header {
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: space-between;
48
+ margin-bottom: 12px;
49
+ }
50
+
51
+ .profile-name {
52
+ font-size: 18px;
53
+ font-weight: 600;
54
+ color: var(--text-primary);
55
+ margin: 0;
56
+ }
57
+
58
+ .profile-badges {
59
+ display: flex;
60
+ align-items: center;
61
+ gap: 8px;
62
+ }
63
+
64
+ .profile-badge {
65
+ padding: 4px 10px;
66
+ border-radius: 8px;
67
+ font-size: 12px;
68
+ font-weight: 600;
69
+ text-transform: uppercase;
70
+ letter-spacing: 0.5px;
71
+ }
72
+
73
+ .profile-badge.default {
74
+ background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.2));
75
+ color: var(--accent-color);
76
+ border: 1px solid rgba(40, 167, 69, 0.3);
77
+ }
78
+
79
+ .profile-badge.active {
80
+ background: linear-gradient(135deg, rgba(0, 122, 204, 0.1), rgba(0, 122, 204, 0.2));
81
+ color: var(--primary-color);
82
+ border: 1px solid rgba(0, 122, 204, 0.3);
83
+ }
84
+
85
+ .profile-badge.inactive {
86
+ background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.2));
87
+ color: var(--text-muted);
88
+ border: 1px solid rgba(108, 117, 125, 0.3);
89
+ }
90
+
91
+ .profile-details {
92
+ font-size: 14px;
93
+ color: var(--text-secondary);
94
+ margin-bottom: 16px;
95
+ line-height: 1.5;
96
+ }
97
+
98
+ .profile-meta {
99
+ display: grid;
100
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
101
+ gap: 12px;
102
+ margin-bottom: 16px;
103
+ }
104
+
105
+ .profile-meta-item {
106
+ display: flex;
107
+ flex-direction: column;
108
+ }
109
+
110
+ .profile-meta-label {
111
+ font-size: 12px;
112
+ font-weight: 600;
113
+ color: var(--text-muted);
114
+ text-transform: uppercase;
115
+ letter-spacing: 0.5px;
116
+ margin-bottom: 4px;
117
+ }
118
+
119
+ .profile-meta-value {
120
+ font-size: 14px;
121
+ color: var(--text-primary);
122
+ font-weight: 500;
123
+ word-break: break-word;
124
+ }
125
+
126
+ .profile-actions {
127
+ display: flex;
128
+ gap: 8px;
129
+ justify-content: flex-end;
130
+ }
131
+
132
+ .profile-btn {
133
+ padding: 8px 16px;
134
+ border: 1px solid var(--border-color);
135
+ border-radius: 8px;
136
+ background: var(--bg-primary);
137
+ color: var(--text-primary);
138
+ font-size: 13px;
139
+ font-weight: 600;
140
+ cursor: pointer;
141
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
142
+ }
143
+
144
+ .profile-btn:hover {
145
+ transform: translateY(-1px);
146
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
147
+ }
148
+
149
+ .profile-btn.edit {
150
+ border-color: var(--primary-color);
151
+ color: var(--primary-color);
152
+ }
153
+
154
+ .profile-btn.edit:hover {
155
+ background: var(--primary-color);
156
+ color: white;
157
+ }
158
+
159
+ .profile-btn.delete {
160
+ border-color: var(--danger-color);
161
+ color: var(--danger-color);
162
+ }
163
+
164
+ .profile-btn.delete:hover {
165
+ background: var(--danger-color);
166
+ color: white;
167
+ }
168
+
169
+ .profile-btn.toggle {
170
+ border-color: var(--accent-color);
171
+ color: var(--accent-color);
172
+ }
173
+
174
+ .profile-btn.toggle:hover {
175
+ background: var(--accent-color);
176
+ color: white;
177
+ }
178
+
179
+ /* Add Profile Button */
180
+ .add-profile-btn {
181
+ display: flex;
182
+ align-items: center;
183
+ justify-content: center;
184
+ gap: 12px;
185
+ width: 100%;
186
+ padding: 20px;
187
+ border: 2px dashed var(--border-color);
188
+ border-radius: 12px;
189
+ background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
190
+ color: var(--text-secondary);
191
+ font-size: 16px;
192
+ font-weight: 600;
193
+ cursor: pointer;
194
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
195
+ margin-top: 16px;
196
+ }
197
+
198
+ .add-profile-btn:hover {
199
+ border-color: var(--primary-color);
200
+ background: linear-gradient(135deg, var(--bg-hover), var(--bg-secondary));
201
+ color: var(--primary-color);
202
+ transform: translateY(-2px);
203
+ box-shadow: 0 8px 24px rgba(0, 122, 204, 0.15);
204
+ }
205
+
206
+ .add-profile-btn svg {
207
+ width: 20px;
208
+ height: 20px;
209
+ }
210
+
211
+ /* Empty State */
212
+ .profiles-empty-state {
213
+ display: flex;
214
+ flex-direction: column;
215
+ align-items: center;
216
+ justify-content: center;
217
+ padding: 60px 40px;
218
+ text-align: center;
219
+ color: var(--text-muted);
220
+ background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
221
+ border-radius: 16px;
222
+ border: 2px dashed var(--border-color);
223
+ margin-bottom: 24px;
224
+ }
225
+
226
+ .profiles-empty-icon {
227
+ font-size: 64px;
228
+ margin-bottom: 20px;
229
+ opacity: 0.6;
230
+ }
231
+
232
+ .profiles-empty-title {
233
+ font-size: 20px;
234
+ font-weight: 600;
235
+ color: var(--text-secondary);
236
+ margin-bottom: 12px;
237
+ }
238
+
239
+ .profiles-empty-description {
240
+ font-size: 15px;
241
+ line-height: 1.6;
242
+ opacity: 0.8;
243
+ max-width: 320px;
244
+ }
@@ -0,0 +1,144 @@
1
+ /* Responsive Design for Settings */
2
+
3
+ /* Tablet and Small Desktop */
4
+ @media (max-width: 768px) {
5
+ .settings-modal-content {
6
+ width: 95vw;
7
+ max-height: 95vh;
8
+ border-radius: 12px;
9
+ }
10
+
11
+ .settings-header {
12
+ padding: 20px 24px;
13
+ }
14
+
15
+ .settings-header h3 {
16
+ font-size: 20px;
17
+ }
18
+
19
+ .settings-tab {
20
+ padding: 14px 20px;
21
+ font-size: 14px;
22
+ min-width: 120px;
23
+ }
24
+
25
+ .settings-tab-content {
26
+ padding: 24px;
27
+ }
28
+
29
+ .profile-card {
30
+ padding: 16px;
31
+ }
32
+
33
+ .profile-name {
34
+ font-size: 16px;
35
+ }
36
+
37
+ .profile-meta {
38
+ grid-template-columns: 1fr;
39
+ }
40
+
41
+ .profile-actions {
42
+ flex-direction: column;
43
+ }
44
+
45
+ .profile-btn {
46
+ width: 100%;
47
+ justify-content: center;
48
+ }
49
+
50
+ .profile-form-container {
51
+ width: 95vw;
52
+ }
53
+
54
+ .profile-form-header {
55
+ padding: 20px 24px;
56
+ }
57
+
58
+ .profile-form-content {
59
+ padding: 24px;
60
+ }
61
+
62
+ .profile-form-actions {
63
+ padding: 20px 24px;
64
+ flex-direction: column;
65
+ }
66
+
67
+ .form-btn {
68
+ width: 100%;
69
+ }
70
+ }
71
+
72
+ /* Mobile */
73
+ @media (max-width: 480px) {
74
+ .settings-header {
75
+ padding: 16px 20px;
76
+ }
77
+
78
+ .settings-header h3 {
79
+ font-size: 18px;
80
+ }
81
+
82
+ .settings-tab {
83
+ padding: 12px 16px;
84
+ font-size: 13px;
85
+ min-width: 100px;
86
+ }
87
+
88
+ .settings-tab-content {
89
+ padding: 20px;
90
+ }
91
+
92
+ .profile-card {
93
+ padding: 12px;
94
+ }
95
+
96
+ .profile-header {
97
+ flex-direction: column;
98
+ align-items: flex-start;
99
+ gap: 12px;
100
+ }
101
+
102
+ .profile-badges {
103
+ align-self: flex-end;
104
+ }
105
+
106
+ .env-var-item {
107
+ flex-direction: column;
108
+ gap: 8px;
109
+ }
110
+
111
+ .env-var-actions {
112
+ align-self: flex-end;
113
+ }
114
+ }
115
+
116
+ /* Accessibility */
117
+ @media (prefers-reduced-motion: reduce) {
118
+ * {
119
+ animation-duration: 0.01ms !important;
120
+ animation-iteration-count: 1 !important;
121
+ transition-duration: 0.01ms !important;
122
+ }
123
+ }
124
+
125
+ /* High contrast mode */
126
+ @media (prefers-contrast: high) {
127
+ .profile-card,
128
+ .form-input,
129
+ .form-select,
130
+ .form-textarea {
131
+ border-width: 2px;
132
+ }
133
+
134
+ .settings-tab::before {
135
+ height: 4px;
136
+ }
137
+ }
138
+
139
+ /* Dark mode support (for future enhancement) */
140
+ @media (prefers-color-scheme: dark) {
141
+ .profile-form-modal {
142
+ backdrop-filter: blur(12px);
143
+ }
144
+ }
@@ -0,0 +1,25 @@
1
+ /* Utilities and Loading States */
2
+
3
+ /* Loading States */
4
+ .profiles-loading {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ padding: 60px;
9
+ color: var(--text-muted);
10
+ }
11
+
12
+ .loading-spinner {
13
+ width: 32px;
14
+ height: 32px;
15
+ border: 3px solid var(--border-color);
16
+ border-top: 3px solid var(--primary-color);
17
+ border-radius: 50%;
18
+ animation: spin 1s linear infinite;
19
+ margin-right: 16px;
20
+ }
21
+
22
+ @keyframes spin {
23
+ 0% { transform: rotate(0deg); }
24
+ 100% { transform: rotate(360deg); }
25
+ }
@@ -0,0 +1,54 @@
1
+ /* CSS Variables - VibeSurf Extension */
2
+
3
+ :root {
4
+ /* Colors */
5
+ --primary-color: #007acc;
6
+ --primary-hover: #005a9b;
7
+ --secondary-color: #f0f2f5;
8
+ --accent-color: #28a745;
9
+ --danger-color: #dc3545;
10
+ --warning-color: #ffc107;
11
+ --text-primary: #1a1a1a;
12
+ --text-secondary: #6c757d;
13
+ --text-muted: #9ca3af;
14
+ --border-color: #e5e7eb;
15
+ --border-hover: #d1d5db;
16
+ --bg-primary: #ffffff;
17
+ --bg-secondary: #f8f9fa;
18
+ --bg-tertiary: #f1f3f4;
19
+ --bg-hover: #f5f5f5;
20
+ --bg-active: #e8f4fd;
21
+ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
22
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
23
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
24
+
25
+ /* Typography */
26
+ --font-size-xs: 0.75rem;
27
+ --font-size-sm: 0.875rem;
28
+ --font-size-base: 0.875rem;
29
+ --font-size-lg: 1rem;
30
+ --font-size-xl: 1.125rem;
31
+ --font-weight-normal: 400;
32
+ --font-weight-medium: 500;
33
+ --font-weight-semibold: 600;
34
+ --font-weight-bold: 700;
35
+
36
+ /* Spacing */
37
+ --spacing-xs: 0.25rem;
38
+ --spacing-sm: 0.5rem;
39
+ --spacing-md: 0.75rem;
40
+ --spacing-lg: 1rem;
41
+ --spacing-xl: 1.5rem;
42
+ --spacing-2xl: 2rem;
43
+
44
+ /* Border Radius */
45
+ --radius-sm: 0.25rem;
46
+ --radius-md: 0.375rem;
47
+ --radius-lg: 0.5rem;
48
+ --radius-xl: 0.75rem;
49
+
50
+ /* Transitions */
51
+ --transition-fast: 150ms ease-in-out;
52
+ --transition-normal: 200ms ease-in-out;
53
+ --transition-slow: 300ms ease-in-out;
54
+ }
vibe_surf/cli.py CHANGED
@@ -41,15 +41,8 @@ VIBESURF_LOGO = """
41
41
  console = Console()
42
42
 
43
43
  # Add logger import for the workspace directory logging
44
- try:
45
- import logging
46
- logger = logging.getLogger(__name__)
47
- logging.basicConfig(level=logging.INFO)
48
- except ImportError:
49
- class SimpleLogger:
50
- def info(self, msg):
51
- console.print(f"[dim]{msg}[/dim]")
52
- logger = SimpleLogger()
44
+ from vibe_surf.logger import get_logger
45
+ logger = get_logger(__name__)
53
46
 
54
47
 
55
48
  def find_chrome_browser() -> Optional[str]:
@@ -348,19 +341,8 @@ def start_backend(port: int) -> None:
348
341
  def get_browser_execution_path() -> Optional[str]:
349
342
  """Get browser execution path from envs.json or environment variables."""
350
343
  # 1. Load environment variables
351
- env_workspace_dir = os.getenv("VIBESURF_WORKSPACE", "")
352
- if not env_workspace_dir or not env_workspace_dir.strip():
353
- # Set default workspace directory based on OS
354
- if platform.system() == "Windows":
355
- default_workspace = os.path.join(os.environ.get("APPDATA", ""), "VibeSurf")
356
- elif platform.system() == "Darwin": # macOS
357
- default_workspace = os.path.join(os.path.expanduser("~"), "Library", "Application Support", "VibeSurf")
358
- else: # Linux and others
359
- default_workspace = os.path.join(os.path.expanduser("~"), ".vibesurf")
360
- workspace_dir = default_workspace
361
- else:
362
- workspace_dir = env_workspace_dir
363
- workspace_dir = os.path.abspath(workspace_dir)
344
+ from .common import get_workspace_dir
345
+ workspace_dir = get_workspace_dir()
364
346
  os.makedirs(workspace_dir, exist_ok=True)
365
347
  logger.info("WorkSpace directory: {}".format(workspace_dir))
366
348
 
@@ -402,6 +384,7 @@ def main():
402
384
  console.print("[dim]A powerful browser automation tool for vibe surfing 🏄‍♂️[/dim]")
403
385
  import vibe_surf
404
386
  console.print(f"[dim]Version: {vibe_surf.__version__}[/dim]\n")
387
+ console.print(f"[dim]Author: WarmShao and Community Contributors [/dim]\n")
405
388
 
406
389
  # Check for existing browser path from configuration
407
390
  browser_path = get_browser_execution_path()
vibe_surf/common.py ADDED
@@ -0,0 +1,35 @@
1
+ """
2
+ Common utilities and configurations for VibeSurf.
3
+ """
4
+ import os
5
+ import platform
6
+ from dotenv import load_dotenv
7
+
8
+ project_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
9
+
10
+ load_dotenv(os.path.join(project_dir, ".env"))
11
+
12
+
13
+ def get_workspace_dir():
14
+ """
15
+ Get the workspace directory for VibeSurf.
16
+
17
+ Returns:
18
+ str: The absolute path to the workspace directory.
19
+ """
20
+ env_workspace_dir = os.getenv("VIBESURF_WORKSPACE", "")
21
+ if not env_workspace_dir or not env_workspace_dir.strip():
22
+ # Set default workspace directory based on OS
23
+ if platform.system() == "Windows":
24
+ default_workspace = os.path.join(os.environ.get("APPDATA", ""), "VibeSurf")
25
+ elif platform.system() == "Darwin": # macOS
26
+ default_workspace = os.path.join(os.path.expanduser("~"), "Library", "Application Support", "VibeSurf")
27
+ else: # Linux and others
28
+ default_workspace = os.path.join(os.path.expanduser("~"), ".vibesurf")
29
+ workspace_dir = default_workspace
30
+ else:
31
+ workspace_dir = env_workspace_dir
32
+
33
+ workspace_dir = os.path.abspath(workspace_dir)
34
+ os.makedirs(workspace_dir, exist_ok=True)
35
+ return workspace_dir