vibesurf 0.1.0__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/__init__.py +12 -0
- vibe_surf/_version.py +34 -0
- vibe_surf/agents/__init__.py +0 -0
- vibe_surf/agents/browser_use_agent.py +1106 -0
- vibe_surf/agents/prompts/__init__.py +1 -0
- vibe_surf/agents/prompts/vibe_surf_prompt.py +176 -0
- vibe_surf/agents/report_writer_agent.py +360 -0
- vibe_surf/agents/vibe_surf_agent.py +1632 -0
- vibe_surf/backend/__init__.py +0 -0
- vibe_surf/backend/api/__init__.py +3 -0
- vibe_surf/backend/api/activity.py +243 -0
- vibe_surf/backend/api/config.py +740 -0
- vibe_surf/backend/api/files.py +322 -0
- vibe_surf/backend/api/models.py +257 -0
- vibe_surf/backend/api/task.py +300 -0
- vibe_surf/backend/database/__init__.py +13 -0
- vibe_surf/backend/database/manager.py +129 -0
- vibe_surf/backend/database/models.py +164 -0
- vibe_surf/backend/database/queries.py +922 -0
- vibe_surf/backend/database/schemas.py +100 -0
- vibe_surf/backend/llm_config.py +182 -0
- vibe_surf/backend/main.py +137 -0
- vibe_surf/backend/migrations/__init__.py +16 -0
- vibe_surf/backend/migrations/init_db.py +303 -0
- vibe_surf/backend/migrations/seed_data.py +236 -0
- vibe_surf/backend/shared_state.py +601 -0
- vibe_surf/backend/utils/__init__.py +7 -0
- vibe_surf/backend/utils/encryption.py +164 -0
- vibe_surf/backend/utils/llm_factory.py +225 -0
- vibe_surf/browser/__init__.py +8 -0
- vibe_surf/browser/agen_browser_profile.py +130 -0
- vibe_surf/browser/agent_browser_session.py +416 -0
- vibe_surf/browser/browser_manager.py +296 -0
- vibe_surf/browser/utils.py +790 -0
- vibe_surf/browser/watchdogs/__init__.py +0 -0
- vibe_surf/browser/watchdogs/action_watchdog.py +291 -0
- vibe_surf/browser/watchdogs/dom_watchdog.py +954 -0
- vibe_surf/chrome_extension/background.js +558 -0
- vibe_surf/chrome_extension/config.js +48 -0
- vibe_surf/chrome_extension/content.js +284 -0
- vibe_surf/chrome_extension/dev-reload.js +47 -0
- vibe_surf/chrome_extension/icons/convert-svg.js +33 -0
- vibe_surf/chrome_extension/icons/logo-preview.html +187 -0
- vibe_surf/chrome_extension/icons/logo.png +0 -0
- vibe_surf/chrome_extension/manifest.json +53 -0
- vibe_surf/chrome_extension/popup.html +134 -0
- vibe_surf/chrome_extension/scripts/api-client.js +473 -0
- vibe_surf/chrome_extension/scripts/main.js +491 -0
- vibe_surf/chrome_extension/scripts/markdown-it.min.js +3 -0
- vibe_surf/chrome_extension/scripts/session-manager.js +599 -0
- vibe_surf/chrome_extension/scripts/ui-manager.js +3687 -0
- vibe_surf/chrome_extension/sidepanel.html +347 -0
- vibe_surf/chrome_extension/styles/animations.css +471 -0
- vibe_surf/chrome_extension/styles/components.css +670 -0
- vibe_surf/chrome_extension/styles/main.css +2307 -0
- vibe_surf/chrome_extension/styles/settings.css +1100 -0
- vibe_surf/cli.py +357 -0
- vibe_surf/controller/__init__.py +0 -0
- vibe_surf/controller/file_system.py +53 -0
- vibe_surf/controller/mcp_client.py +68 -0
- vibe_surf/controller/vibesurf_controller.py +616 -0
- vibe_surf/controller/views.py +37 -0
- vibe_surf/llm/__init__.py +21 -0
- vibe_surf/llm/openai_compatible.py +237 -0
- vibesurf-0.1.0.dist-info/METADATA +97 -0
- vibesurf-0.1.0.dist-info/RECORD +70 -0
- vibesurf-0.1.0.dist-info/WHEEL +5 -0
- vibesurf-0.1.0.dist-info/entry_points.txt +2 -0
- vibesurf-0.1.0.dist-info/licenses/LICENSE +201 -0
- vibesurf-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""
|
|
2
|
+
JSON Schema Definitions for VibeSurf Database - Simplified Single Task Model
|
|
3
|
+
|
|
4
|
+
Pydantic models for validating JSON fields in the simplified Task table.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Dict, Any, List, Optional
|
|
8
|
+
from pydantic import BaseModel, Field
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
|
|
11
|
+
class TaskMetadata(BaseModel):
|
|
12
|
+
"""Schema for Task.task_metadata JSON field"""
|
|
13
|
+
|
|
14
|
+
# Execution summary
|
|
15
|
+
execution_duration_seconds: Optional[float] = None
|
|
16
|
+
total_actions: Optional[int] = None
|
|
17
|
+
|
|
18
|
+
# Results summary
|
|
19
|
+
generated_report_path: Optional[str] = None
|
|
20
|
+
final_summary: Optional[str] = None
|
|
21
|
+
|
|
22
|
+
# Control state history
|
|
23
|
+
control_history: List[Dict[str, Any]] = Field(default_factory=list)
|
|
24
|
+
|
|
25
|
+
# Error context
|
|
26
|
+
last_error: Optional[str] = None
|
|
27
|
+
error_recovery_attempts: int = 0
|
|
28
|
+
|
|
29
|
+
# User context
|
|
30
|
+
created_via: str = "api"
|
|
31
|
+
|
|
32
|
+
class LLMConfiguration(BaseModel):
|
|
33
|
+
"""Schema for Task.llm_config JSON field"""
|
|
34
|
+
|
|
35
|
+
model: str
|
|
36
|
+
base_url: Optional[str] = None
|
|
37
|
+
# Note: API key is intentionally excluded from stored config
|
|
38
|
+
temperature: Optional[float] = None
|
|
39
|
+
max_tokens: Optional[int] = None
|
|
40
|
+
top_p: Optional[float] = None
|
|
41
|
+
frequency_penalty: Optional[float] = None
|
|
42
|
+
seed: Optional[int] = None
|
|
43
|
+
|
|
44
|
+
# Provider-specific settings
|
|
45
|
+
provider: str = "openai" # 'openai', 'azure', 'anthropic', etc.
|
|
46
|
+
provider_config: Dict[str, Any] = Field(default_factory=dict)
|
|
47
|
+
|
|
48
|
+
class McpServerParams(BaseModel):
|
|
49
|
+
"""Schema for MCP server parameters configuration"""
|
|
50
|
+
command: str # e.g., "npx", "docker"
|
|
51
|
+
args: List[str] # command arguments
|
|
52
|
+
env: Optional[Dict[str, str]] = None # environment variables
|
|
53
|
+
cwd: Optional[str] = None # working directory
|
|
54
|
+
timeout: Optional[int] = None # timeout in seconds
|
|
55
|
+
|
|
56
|
+
class McpServerConfig(BaseModel):
|
|
57
|
+
"""Schema for MCP server configuration in Task.mcp_server_config"""
|
|
58
|
+
mcpServers: Dict[str, McpServerParams] = Field(default_factory=dict)
|
|
59
|
+
|
|
60
|
+
class ControllerConfiguration(BaseModel):
|
|
61
|
+
"""Schema for Task.mcp_server_config JSON field (legacy controller config)"""
|
|
62
|
+
|
|
63
|
+
# Action control
|
|
64
|
+
exclude_actions: List[str] = Field(default_factory=list)
|
|
65
|
+
max_actions_per_task: Optional[int] = 100
|
|
66
|
+
|
|
67
|
+
# Output configuration
|
|
68
|
+
display_files_in_done_text: bool = True
|
|
69
|
+
save_screenshots: bool = True
|
|
70
|
+
|
|
71
|
+
# Error handling
|
|
72
|
+
continue_on_action_error: bool = False
|
|
73
|
+
max_retries_per_action: int = 3
|
|
74
|
+
|
|
75
|
+
# Schema validation utilities
|
|
76
|
+
JSON_SCHEMAS = {
|
|
77
|
+
'task_metadata': TaskMetadata,
|
|
78
|
+
'llm_configuration': LLMConfiguration,
|
|
79
|
+
'controller_configuration': ControllerConfiguration,
|
|
80
|
+
'mcp_server_config': McpServerConfig,
|
|
81
|
+
'mcp_server_params': McpServerParams,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
def validate_json_field(schema_name: str, data: Dict[str, Any]) -> Dict[str, Any]:
|
|
85
|
+
"""Validate and normalize JSON field data using appropriate schema"""
|
|
86
|
+
if schema_name not in JSON_SCHEMAS:
|
|
87
|
+
return data
|
|
88
|
+
|
|
89
|
+
schema_class = JSON_SCHEMAS[schema_name]
|
|
90
|
+
validated = schema_class(**data)
|
|
91
|
+
return validated.model_dump(exclude_none=True)
|
|
92
|
+
|
|
93
|
+
def get_schema_for_config_type(config_type: str) -> Optional[BaseModel]:
|
|
94
|
+
"""Get appropriate schema based on configuration type"""
|
|
95
|
+
schema_mapping = {
|
|
96
|
+
'llm_config': LLMConfiguration,
|
|
97
|
+
'controller_config': ControllerConfiguration, # Legacy support
|
|
98
|
+
'mcp_server_config': McpServerConfig,
|
|
99
|
+
}
|
|
100
|
+
return schema_mapping.get(config_type)
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"""
|
|
2
|
+
LLM Provider Configuration
|
|
3
|
+
|
|
4
|
+
Centralized configuration for all supported LLM providers and their models.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# LLM Providers and their supported models
|
|
8
|
+
LLM_PROVIDERS = {
|
|
9
|
+
"openai": [
|
|
10
|
+
"gpt-4o",
|
|
11
|
+
"gpt-4o-mini",
|
|
12
|
+
"gpt-4.1"
|
|
13
|
+
"gpt-4.1-mini",
|
|
14
|
+
"gpt-5",
|
|
15
|
+
"gpt-5-mini",
|
|
16
|
+
],
|
|
17
|
+
"anthropic": [
|
|
18
|
+
"claude-opus-4-1-20250805",
|
|
19
|
+
"claude-sonnet-4-20250514",
|
|
20
|
+
"claude-3-7-sonnet-20250219",
|
|
21
|
+
"claude-3-5-haiku-20241022"
|
|
22
|
+
],
|
|
23
|
+
"google": [
|
|
24
|
+
"gemini-2.5-pro",
|
|
25
|
+
"gemini-2.5-flash",
|
|
26
|
+
],
|
|
27
|
+
"azure_openai": [
|
|
28
|
+
"gpt-4o",
|
|
29
|
+
"gpt-4o-mini",
|
|
30
|
+
],
|
|
31
|
+
"groq": [
|
|
32
|
+
"moonshotai/kimi-k2-instruct",
|
|
33
|
+
"deepseek-r1-distill-llama-70b",
|
|
34
|
+
"qwen/qwen3-32b",
|
|
35
|
+
],
|
|
36
|
+
"ollama": [
|
|
37
|
+
"deepseek-r1:14b",
|
|
38
|
+
"gpt-oss:20b",
|
|
39
|
+
"qwen3:latest",
|
|
40
|
+
],
|
|
41
|
+
"openrouter": [
|
|
42
|
+
"deepseek/deepseek-chat-v3.1",
|
|
43
|
+
"qwen/qwen3-235b-a22b-thinking-2507",
|
|
44
|
+
"moonshotai/kimi-k2",
|
|
45
|
+
"z-ai/glm-4.5"
|
|
46
|
+
],
|
|
47
|
+
"deepseek": [
|
|
48
|
+
"deepseek-chat",
|
|
49
|
+
"deepseek-reasoner"
|
|
50
|
+
],
|
|
51
|
+
"aws_bedrock": [
|
|
52
|
+
"anthropic.claude-opus-4-1-20250805-v1:0",
|
|
53
|
+
"anthropic.claude-opus-4-20250514-v1:0",
|
|
54
|
+
"anthropic.claude-sonnet-4-20250514-v1:0",
|
|
55
|
+
"anthropic.claude-3-7-sonnet-20250219-v1:0",
|
|
56
|
+
"anthropic.claude-3-5-haiku-20241022-v1:0",
|
|
57
|
+
],
|
|
58
|
+
"anthropic_bedrock": [
|
|
59
|
+
],
|
|
60
|
+
"openai_compatible": [
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
# Provider metadata
|
|
65
|
+
PROVIDER_METADATA = {
|
|
66
|
+
"openai": {
|
|
67
|
+
"display_name": "OpenAI",
|
|
68
|
+
"requires_api_key": True,
|
|
69
|
+
"supports_base_url": False,
|
|
70
|
+
"supports_tools": True,
|
|
71
|
+
"supports_vision": True,
|
|
72
|
+
"default_model": "gpt-4.1-mini"
|
|
73
|
+
},
|
|
74
|
+
"anthropic": {
|
|
75
|
+
"display_name": "Anthropic",
|
|
76
|
+
"requires_api_key": True,
|
|
77
|
+
"supports_base_url": False,
|
|
78
|
+
"supports_tools": True,
|
|
79
|
+
"supports_vision": True,
|
|
80
|
+
"default_model": "claude-3-7-sonnet-20250219"
|
|
81
|
+
},
|
|
82
|
+
"google": {
|
|
83
|
+
"display_name": "Google Gemini",
|
|
84
|
+
"requires_api_key": True,
|
|
85
|
+
"supports_base_url": False,
|
|
86
|
+
"supports_tools": True,
|
|
87
|
+
"supports_vision": True,
|
|
88
|
+
"default_model": "gemini-2.5-flash"
|
|
89
|
+
},
|
|
90
|
+
"azure_openai": {
|
|
91
|
+
"display_name": "Azure OpenAI",
|
|
92
|
+
"requires_api_key": True,
|
|
93
|
+
"requires_base_url": True,
|
|
94
|
+
"supports_tools": True,
|
|
95
|
+
"supports_vision": True,
|
|
96
|
+
"default_model": "gpt-4o-mini"
|
|
97
|
+
},
|
|
98
|
+
"groq": {
|
|
99
|
+
"display_name": "Groq",
|
|
100
|
+
"requires_api_key": True,
|
|
101
|
+
"supports_base_url": False,
|
|
102
|
+
"supports_tools": True,
|
|
103
|
+
"supports_vision": True,
|
|
104
|
+
"default_model": "moonshotai/kimi-k2-instruct"
|
|
105
|
+
},
|
|
106
|
+
"ollama": {
|
|
107
|
+
"display_name": "Ollama",
|
|
108
|
+
"requires_api_key": False,
|
|
109
|
+
"requires_base_url": True,
|
|
110
|
+
"supports_tools": True,
|
|
111
|
+
"supports_vision": True,
|
|
112
|
+
"default_model": "qwen/qwen3-32b",
|
|
113
|
+
"default_base_url": "http://localhost:11434"
|
|
114
|
+
},
|
|
115
|
+
"openrouter": {
|
|
116
|
+
"display_name": "OpenRouter",
|
|
117
|
+
"requires_api_key": True,
|
|
118
|
+
"supports_base_url": False,
|
|
119
|
+
"supports_tools": True,
|
|
120
|
+
"supports_vision": True,
|
|
121
|
+
"default_model": "moonshotai/kimi-k2",
|
|
122
|
+
"base_url": "https://openrouter.ai/api/v1"
|
|
123
|
+
},
|
|
124
|
+
"deepseek": {
|
|
125
|
+
"display_name": "DeepSeek",
|
|
126
|
+
"requires_api_key": True,
|
|
127
|
+
"supports_base_url": False,
|
|
128
|
+
"supports_tools": True,
|
|
129
|
+
"supports_vision": True,
|
|
130
|
+
"default_model": "deepseek-chat"
|
|
131
|
+
},
|
|
132
|
+
"aws_bedrock": {
|
|
133
|
+
"display_name": "AWS Bedrock",
|
|
134
|
+
"requires_api_key": True,
|
|
135
|
+
"supports_base_url": False,
|
|
136
|
+
"supports_tools": True,
|
|
137
|
+
"supports_vision": True,
|
|
138
|
+
"default_model": "anthropic.claude-3-7-sonnet-20250219-v1:0"
|
|
139
|
+
},
|
|
140
|
+
"anthropic_bedrock": {
|
|
141
|
+
"display_name": "Anthropic via AWS Bedrock",
|
|
142
|
+
"requires_api_key": True,
|
|
143
|
+
"supports_base_url": False,
|
|
144
|
+
"supports_tools": True,
|
|
145
|
+
"supports_vision": True,
|
|
146
|
+
"default_model": ""
|
|
147
|
+
},
|
|
148
|
+
"openai_compatible": {
|
|
149
|
+
"display_name": "OpenAI Compatible",
|
|
150
|
+
"requires_api_key": True,
|
|
151
|
+
"requires_base_url": True,
|
|
152
|
+
"supports_tools": True,
|
|
153
|
+
"supports_vision": True,
|
|
154
|
+
"default_model": ""
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def get_supported_providers():
|
|
160
|
+
"""Get list of all supported provider names"""
|
|
161
|
+
return list(LLM_PROVIDERS.keys())
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def get_provider_models(provider_name: str):
|
|
165
|
+
"""Get list of models for a specific provider"""
|
|
166
|
+
return LLM_PROVIDERS.get(provider_name, [])
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def get_provider_metadata(provider_name: str):
|
|
170
|
+
"""Get metadata for a specific provider"""
|
|
171
|
+
return PROVIDER_METADATA.get(provider_name, {})
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def is_provider_supported(provider_name: str):
|
|
175
|
+
"""Check if a provider is supported"""
|
|
176
|
+
return provider_name in LLM_PROVIDERS
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def get_default_model(provider_name: str):
|
|
180
|
+
"""Get default model for a provider"""
|
|
181
|
+
metadata = get_provider_metadata(provider_name)
|
|
182
|
+
return metadata.get("default_model", "")
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""
|
|
2
|
+
VibeSurf Backend API
|
|
3
|
+
|
|
4
|
+
uvicorn backend.main:app --host 127.0.0.1 --port 9335
|
|
5
|
+
|
|
6
|
+
FastAPI application for simplified single-task execution model.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from fastapi import FastAPI
|
|
10
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
11
|
+
import logging
|
|
12
|
+
import argparse
|
|
13
|
+
import os
|
|
14
|
+
from datetime import datetime
|
|
15
|
+
|
|
16
|
+
# Import routers
|
|
17
|
+
from .api.task import router as agents_router
|
|
18
|
+
from .api.files import router as files_router
|
|
19
|
+
from .api.activity import router as activity_router
|
|
20
|
+
from .api.config import router as config_router
|
|
21
|
+
|
|
22
|
+
# Import shared state
|
|
23
|
+
from . import shared_state
|
|
24
|
+
|
|
25
|
+
# Configure logging
|
|
26
|
+
logging.basicConfig(level=logging.INFO)
|
|
27
|
+
logger = logging.getLogger(__name__)
|
|
28
|
+
|
|
29
|
+
app = FastAPI(
|
|
30
|
+
title="VibeSurf Backend API",
|
|
31
|
+
description="Simplified single-task execution model for VibeSurf",
|
|
32
|
+
version="2.0.0"
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# CORS middleware
|
|
36
|
+
app.add_middleware(
|
|
37
|
+
CORSMiddleware,
|
|
38
|
+
allow_origins=["*"], # Configure for production
|
|
39
|
+
allow_credentials=True,
|
|
40
|
+
allow_methods=["*"],
|
|
41
|
+
allow_headers=["*"],
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Include routers
|
|
45
|
+
app.include_router(agents_router, prefix="/api", tags=["tasks"])
|
|
46
|
+
app.include_router(files_router, prefix="/api", tags=["files"])
|
|
47
|
+
app.include_router(activity_router, prefix="/api", tags=["activity"])
|
|
48
|
+
app.include_router(config_router, prefix="/api", tags=["config"])
|
|
49
|
+
|
|
50
|
+
@app.on_event("startup")
|
|
51
|
+
async def startup_event():
|
|
52
|
+
"""Initialize database and VibeSurf components on startup"""
|
|
53
|
+
# Initialize VibeSurf components and update shared state
|
|
54
|
+
await shared_state.initialize_vibesurf_components()
|
|
55
|
+
|
|
56
|
+
logger.info("🚀 VibeSurf Backend API started with single-task execution model")
|
|
57
|
+
|
|
58
|
+
@app.on_event("shutdown")
|
|
59
|
+
async def shutdown_event():
|
|
60
|
+
"""Cleanup on shutdown"""
|
|
61
|
+
|
|
62
|
+
# Cleanup VibeSurf components
|
|
63
|
+
if shared_state.browser_manager:
|
|
64
|
+
try:
|
|
65
|
+
await shared_state.browser_manager.close()
|
|
66
|
+
await shared_state.browser_manager.main_browser_session.kill()
|
|
67
|
+
logger.info("✅ Browser manager closed")
|
|
68
|
+
except Exception as e:
|
|
69
|
+
logger.error(f"❌ Error closing browser manager: {e}")
|
|
70
|
+
|
|
71
|
+
# Close database
|
|
72
|
+
if shared_state.db_manager:
|
|
73
|
+
await shared_state.db_manager.close()
|
|
74
|
+
logger.info("🛑 VibeSurf Backend API stopped")
|
|
75
|
+
|
|
76
|
+
# Health check endpoint
|
|
77
|
+
@app.get("/health")
|
|
78
|
+
async def health_check():
|
|
79
|
+
"""API health check"""
|
|
80
|
+
return {
|
|
81
|
+
"status": "healthy",
|
|
82
|
+
"timestamp": datetime.now().isoformat(),
|
|
83
|
+
"service": "VibeSurf Backend API",
|
|
84
|
+
"model": "single-task-execution",
|
|
85
|
+
"version": "2.0.0"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
# Session ID generation endpoint
|
|
89
|
+
@app.get("/generate-session-id")
|
|
90
|
+
async def generate_session_id(prefix: str = ""):
|
|
91
|
+
"""Generate a new session ID using uuid7str"""
|
|
92
|
+
from uuid_extensions import uuid7str
|
|
93
|
+
session_id = f"{uuid7str()}"
|
|
94
|
+
return {
|
|
95
|
+
"session_id": session_id,
|
|
96
|
+
"timestamp": datetime.now().isoformat()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
# Simple status endpoint for the active task
|
|
100
|
+
@app.get("/api/status")
|
|
101
|
+
async def get_system_status():
|
|
102
|
+
"""Get current system status"""
|
|
103
|
+
task_info = shared_state.get_active_task_info()
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
"system_status": "operational",
|
|
107
|
+
"active_task": task_info,
|
|
108
|
+
"timestamp": datetime.now().isoformat()
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
def parse_args():
|
|
112
|
+
"""Parse command line arguments"""
|
|
113
|
+
parser = argparse.ArgumentParser(description="VibeSurf Backend API")
|
|
114
|
+
parser.add_argument(
|
|
115
|
+
"--vibesurf_port",
|
|
116
|
+
type=int,
|
|
117
|
+
default=9335,
|
|
118
|
+
help="Port for VibeSurf backend (default: 9335)"
|
|
119
|
+
)
|
|
120
|
+
parser.add_argument(
|
|
121
|
+
"--vibesurf_extension",
|
|
122
|
+
type=str,
|
|
123
|
+
help="VibeSurf chrome extension path (optional)"
|
|
124
|
+
)
|
|
125
|
+
return parser.parse_args()
|
|
126
|
+
|
|
127
|
+
if __name__ == "__main__":
|
|
128
|
+
# Parse command line arguments
|
|
129
|
+
args = parse_args()
|
|
130
|
+
|
|
131
|
+
# Set environment variables based on arguments
|
|
132
|
+
os.environ["VIBESURF_BACKEND_PORT"] = str(args.vibesurf_port)
|
|
133
|
+
if args.vibesurf_extension:
|
|
134
|
+
os.environ["VIBESURF_EXTENSION"] = args.vibesurf_extension
|
|
135
|
+
|
|
136
|
+
import uvicorn
|
|
137
|
+
uvicorn.run(app, host="127.0.0.1", port=args.vibesurf_port)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Database Migration Scripts for VibeSurf Backend
|
|
3
|
+
|
|
4
|
+
Contains migration scripts for database schema initialization and updates.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .init_db import init_database, create_tables, drop_tables
|
|
8
|
+
from .seed_data import seed_initial_data, create_sample_data
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"init_database",
|
|
12
|
+
"create_tables",
|
|
13
|
+
"drop_tables",
|
|
14
|
+
"seed_initial_data",
|
|
15
|
+
"create_sample_data"
|
|
16
|
+
]
|