vibesurf 0.1.10__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.
- vibe_surf/_version.py +2 -2
- vibe_surf/agents/browser_use_agent.py +68 -45
- vibe_surf/agents/prompts/report_writer_prompt.py +73 -0
- vibe_surf/agents/prompts/vibe_surf_prompt.py +85 -172
- vibe_surf/agents/report_writer_agent.py +380 -226
- vibe_surf/agents/vibe_surf_agent.py +879 -825
- vibe_surf/agents/views.py +130 -0
- vibe_surf/backend/api/activity.py +3 -1
- vibe_surf/backend/api/browser.py +9 -5
- vibe_surf/backend/api/config.py +8 -5
- vibe_surf/backend/api/files.py +59 -50
- vibe_surf/backend/api/models.py +2 -2
- vibe_surf/backend/api/task.py +45 -12
- vibe_surf/backend/database/manager.py +24 -18
- vibe_surf/backend/database/queries.py +199 -192
- vibe_surf/backend/database/schemas.py +1 -1
- vibe_surf/backend/main.py +4 -2
- vibe_surf/backend/shared_state.py +28 -35
- vibe_surf/backend/utils/encryption.py +3 -1
- vibe_surf/backend/utils/llm_factory.py +41 -36
- vibe_surf/browser/agent_browser_session.py +0 -4
- vibe_surf/browser/browser_manager.py +14 -8
- vibe_surf/browser/utils.py +5 -3
- vibe_surf/browser/watchdogs/dom_watchdog.py +0 -45
- vibe_surf/chrome_extension/background.js +4 -0
- vibe_surf/chrome_extension/scripts/api-client.js +13 -0
- vibe_surf/chrome_extension/scripts/file-manager.js +27 -71
- vibe_surf/chrome_extension/scripts/session-manager.js +21 -3
- vibe_surf/chrome_extension/scripts/ui-manager.js +831 -48
- vibe_surf/chrome_extension/sidepanel.html +21 -4
- vibe_surf/chrome_extension/styles/activity.css +365 -5
- vibe_surf/chrome_extension/styles/input.css +139 -0
- vibe_surf/cli.py +4 -22
- vibe_surf/common.py +35 -0
- vibe_surf/llm/openai_compatible.py +148 -93
- vibe_surf/logger.py +99 -0
- vibe_surf/{controller/vibesurf_tools.py → tools/browser_use_tools.py} +233 -219
- vibe_surf/tools/file_system.py +415 -0
- vibe_surf/{controller → tools}/mcp_client.py +4 -3
- vibe_surf/tools/report_writer_tools.py +21 -0
- vibe_surf/tools/vibesurf_tools.py +657 -0
- vibe_surf/tools/views.py +120 -0
- {vibesurf-0.1.10.dist-info → vibesurf-0.1.11.dist-info}/METADATA +6 -2
- {vibesurf-0.1.10.dist-info → vibesurf-0.1.11.dist-info}/RECORD +49 -43
- vibe_surf/controller/file_system.py +0 -53
- vibe_surf/controller/views.py +0 -37
- /vibe_surf/{controller → tools}/__init__.py +0 -0
- {vibesurf-0.1.10.dist-info → vibesurf-0.1.11.dist-info}/WHEEL +0 -0
- {vibesurf-0.1.10.dist-info → vibesurf-0.1.11.dist-info}/entry_points.txt +0 -0
- {vibesurf-0.1.10.dist-info → vibesurf-0.1.11.dist-info}/licenses/LICENSE +0 -0
- {vibesurf-0.1.10.dist-info → vibesurf-0.1.11.dist-info}/top_level.txt +0 -0
|
@@ -13,11 +13,14 @@ from .models import Base
|
|
|
13
13
|
from typing import AsyncGenerator
|
|
14
14
|
import logging
|
|
15
15
|
|
|
16
|
-
logger
|
|
16
|
+
from vibe_surf.logger import get_logger
|
|
17
|
+
|
|
18
|
+
logger = get_logger(__name__)
|
|
19
|
+
|
|
17
20
|
|
|
18
21
|
class DatabaseManager:
|
|
19
22
|
"""Database connection and session management"""
|
|
20
|
-
|
|
23
|
+
|
|
21
24
|
def __init__(self, database_url: str = None):
|
|
22
25
|
"""Initialize database manager
|
|
23
26
|
|
|
@@ -29,7 +32,7 @@ class DatabaseManager:
|
|
|
29
32
|
'VIBESURF_DATABASE_URL',
|
|
30
33
|
f'sqlite+aiosqlite:///{os.path.join(shared_state.workspace_dir, "vibe_surf.db")}'
|
|
31
34
|
)
|
|
32
|
-
|
|
35
|
+
|
|
33
36
|
# Configure engine based on database type
|
|
34
37
|
if self.database_url.startswith('sqlite'):
|
|
35
38
|
# SQLite configuration for development
|
|
@@ -52,23 +55,23 @@ class DatabaseManager:
|
|
|
52
55
|
pool_recycle=3600,
|
|
53
56
|
echo=False
|
|
54
57
|
)
|
|
55
|
-
|
|
58
|
+
|
|
56
59
|
self.async_session_factory = sessionmaker(
|
|
57
|
-
self.engine,
|
|
58
|
-
class_=AsyncSession,
|
|
60
|
+
self.engine,
|
|
61
|
+
class_=AsyncSession,
|
|
59
62
|
expire_on_commit=False
|
|
60
63
|
)
|
|
61
|
-
|
|
64
|
+
|
|
62
65
|
async def create_tables(self):
|
|
63
66
|
"""Create all database tables"""
|
|
64
67
|
async with self.engine.begin() as conn:
|
|
65
68
|
await conn.run_sync(Base.metadata.create_all)
|
|
66
|
-
|
|
69
|
+
|
|
67
70
|
async def drop_tables(self):
|
|
68
71
|
"""Drop all database tables"""
|
|
69
72
|
async with self.engine.begin() as conn:
|
|
70
73
|
await conn.run_sync(Base.metadata.drop_all)
|
|
71
|
-
|
|
74
|
+
|
|
72
75
|
async def get_session(self) -> AsyncGenerator[AsyncSession, None]:
|
|
73
76
|
"""Get async database session"""
|
|
74
77
|
async with self.async_session_factory() as session:
|
|
@@ -80,50 +83,53 @@ class DatabaseManager:
|
|
|
80
83
|
raise
|
|
81
84
|
finally:
|
|
82
85
|
await session.close()
|
|
83
|
-
|
|
86
|
+
|
|
84
87
|
async def close(self):
|
|
85
88
|
"""Close database connections"""
|
|
86
89
|
await self.engine.dispose()
|
|
87
90
|
|
|
91
|
+
|
|
88
92
|
# Dependency for FastAPI
|
|
89
93
|
async def get_db_session() -> AsyncGenerator[AsyncSession, None]:
|
|
90
94
|
"""FastAPI dependency for database sessions"""
|
|
91
95
|
from .. import shared_state
|
|
92
|
-
|
|
96
|
+
|
|
93
97
|
if not shared_state.db_manager:
|
|
94
98
|
raise RuntimeError("Database manager not initialized. Call initialize_vibesurf_components() first.")
|
|
95
|
-
|
|
99
|
+
|
|
96
100
|
async for session in shared_state.db_manager.get_session():
|
|
97
101
|
yield session
|
|
98
102
|
|
|
103
|
+
|
|
99
104
|
# Database initialization script
|
|
100
105
|
async def init_database():
|
|
101
106
|
"""Initialize database with tables"""
|
|
102
107
|
from .. import shared_state
|
|
103
|
-
|
|
108
|
+
|
|
104
109
|
logger.info("🗄️ Initializing VibeSurf database...")
|
|
105
|
-
|
|
110
|
+
|
|
106
111
|
try:
|
|
107
112
|
if not shared_state.db_manager:
|
|
108
113
|
raise RuntimeError("Database manager not initialized. Call initialize_vibesurf_components() first.")
|
|
109
|
-
|
|
114
|
+
|
|
110
115
|
await shared_state.db_manager.create_tables()
|
|
111
116
|
logger.info("✅ Database tables created successfully")
|
|
112
117
|
logger.info("✅ VibeSurf database ready for single-task execution")
|
|
113
|
-
|
|
118
|
+
|
|
114
119
|
except Exception as e:
|
|
115
120
|
logger.error(f"❌ Database initialization failed: {e}")
|
|
116
121
|
raise
|
|
117
122
|
|
|
123
|
+
|
|
118
124
|
if __name__ == "__main__":
|
|
119
125
|
# For standalone execution, initialize a temporary db_manager
|
|
120
126
|
import os
|
|
121
127
|
from .. import shared_state
|
|
122
|
-
|
|
128
|
+
|
|
123
129
|
workspace_dir = os.getenv("VIBESURF_WORKSPACE", os.path.join(os.path.dirname(__file__), "../vibesurf_workspace"))
|
|
124
130
|
database_url = os.getenv(
|
|
125
131
|
'VIBESURF_DATABASE_URL',
|
|
126
132
|
f'sqlite+aiosqlite:///{os.path.join(workspace_dir, "vibe_surf.db")}'
|
|
127
133
|
)
|
|
128
134
|
shared_state.db_manager = DatabaseManager(database_url)
|
|
129
|
-
asyncio.run(init_database())
|
|
135
|
+
asyncio.run(init_database())
|