vibesurf 0.1.21__tar.gz → 0.1.22__tar.gz
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.
- {vibesurf-0.1.21 → vibesurf-0.1.22}/PKG-INFO +2 -2
- {vibesurf-0.1.21 → vibesurf-0.1.22}/pyproject.toml +1 -1
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/_version.py +3 -3
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/browser_use_agent.py +1 -1
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/prompts/vibe_surf_prompt.py +1 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/agent_browser_session.py +2 -1
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/background.js +82 -51
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/manifest.json +2 -11
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/file-manager.js +53 -12
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/main.js +45 -10
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/session-manager.js +30 -4
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/ui-manager.js +235 -32
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibesurf.egg-info/PKG-INFO +2 -2
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibesurf.egg-info/requires.txt +1 -1
- {vibesurf-0.1.21 → vibesurf-0.1.22}/.env.example +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/.github/workflows/publish.yml +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/.gitignore +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/.python-version +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/LICENSE +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/MANIFEST.in +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/README.md +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/docs/EXECUTABLE_BUILD.md +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/docs/PYPI_SETUP.md +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/scripts/build-local.bat +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/scripts/build-local.sh +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/setup.cfg +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/tests/test_agents.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/tests/test_backend_api.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/tests/test_browser.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/tests/test_tools.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/tests/test_voice_api.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/prompts/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/prompts/report_writer_prompt.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/report_writer_agent.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/vibe_surf_agent.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/agents/views.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/activity.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/browser.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/config.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/files.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/models.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/task.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/api/voices.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/manager.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/migrations/v001_initial_schema.sql +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/migrations/v002_add_agent_mode.sql +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/migrations/v003_fix_task_status_case.sql +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/migrations/v004_add_voice_profiles.sql +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/models.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/queries.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/database/schemas.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/llm_config.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/main.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/shared_state.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/utils/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/utils/encryption.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/utils/llm_factory.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/backend/voice_model_config.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/agen_browser_profile.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/browser_manager.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/utils.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/watchdogs/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/watchdogs/action_watchdog.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/browser/watchdogs/dom_watchdog.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/config.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/content.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/dev-reload.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/icons/logo.icns +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/icons/logo.png +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/permission-iframe.html +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/permission-request.html +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/popup.html +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/api-client.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/history-manager.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/markdown-it.min.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/modal-manager.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/permission-iframe-request.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/permission-request.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/settings-manager.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/user-settings-storage.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/scripts/voice-recorder.js +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/sidepanel.html +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/activity.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/animations.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/base.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/components.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/history-modal.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/input.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/layout.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/responsive.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/settings-environment.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/settings-forms.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/settings-modal.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/settings-profiles.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/settings-responsive.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/settings-utilities.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/chrome_extension/styles/variables.css +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/cli.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/common.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/llm/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/llm/openai_compatible.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/logger.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/__init__.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/browser_use_tools.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/file_system.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/mcp_client.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/report_writer_tools.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/vibesurf_tools.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/views.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibe_surf/tools/voice_asr.py +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibesurf.egg-info/SOURCES.txt +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibesurf.egg-info/dependency_links.txt +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibesurf.egg-info/entry_points.txt +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibesurf.egg-info/top_level.txt +0 -0
- {vibesurf-0.1.21 → vibesurf-0.1.22}/vibesurf.spec +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vibesurf
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.22
|
|
4
4
|
Summary: VibeSurf: A powerful browser assistant for vibe surfing
|
|
5
5
|
Author: Shao Warm
|
|
6
6
|
License: Apache-2.0
|
|
@@ -37,7 +37,7 @@ Requires-Dist: aiosqlite>=0.21.0
|
|
|
37
37
|
Requires-Dist: rich>=13.0.0
|
|
38
38
|
Requires-Dist: greenlet>=3.2.4
|
|
39
39
|
Requires-Dist: getmac>=0.9.5
|
|
40
|
-
Requires-Dist: browser-use==0.7.
|
|
40
|
+
Requires-Dist: browser-use==0.7.9
|
|
41
41
|
Requires-Dist: markdown-pdf>=1.9
|
|
42
42
|
Requires-Dist: nanoid>=2.0.0
|
|
43
43
|
Requires-Dist: markdownify>=1.2.0
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.1.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
31
|
+
__version__ = version = '0.1.22'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 22)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g95ec3c7e7'
|
|
@@ -525,7 +525,7 @@ class BrowserUseAgent(Agent):
|
|
|
525
525
|
signal_handler.register()
|
|
526
526
|
|
|
527
527
|
try:
|
|
528
|
-
self._log_agent_run()
|
|
528
|
+
await self._log_agent_run()
|
|
529
529
|
|
|
530
530
|
self.logger.debug(
|
|
531
531
|
f'🔧 Agent setup: Task ID {self.task_id[-4:]}, Session ID {self.session_id[-4:]}, Browser Session ID {self.browser_session.id[-4:] if self.browser_session else "None"}'
|
|
@@ -86,4 +86,5 @@ EXTEND_BU_SYSTEM_PROMPT = """
|
|
|
86
86
|
* Regarding file operations, please note that you need the full relative path (including subfolders), not just the file name.
|
|
87
87
|
* Especially when a file operation reports an error, please reflect whether the file path is not written correctly, such as the subfolder is not written.
|
|
88
88
|
* If you are operating on files in the filesystem, be sure to use relative paths (relative to the workspace dir) instead of absolute paths.
|
|
89
|
+
* If you are typing in the search box, please use Enter key to search instead of clicking.
|
|
89
90
|
"""
|
|
@@ -43,6 +43,7 @@ from browser_use.browser.events import (
|
|
|
43
43
|
TabClosedEvent,
|
|
44
44
|
TabCreatedEvent,
|
|
45
45
|
)
|
|
46
|
+
from browser_use.browser.profile import BrowserProfile, ProxySettings
|
|
46
47
|
|
|
47
48
|
DEFAULT_BROWSER_PROFILE = AgentBrowserProfile()
|
|
48
49
|
|
|
@@ -94,7 +95,7 @@ class AgentBrowserSession(BrowserSession):
|
|
|
94
95
|
deterministic_rendering: bool | None = None,
|
|
95
96
|
allowed_domains: list[str] | None = None,
|
|
96
97
|
keep_alive: bool | None = None,
|
|
97
|
-
proxy:
|
|
98
|
+
proxy: ProxySettings | None = None,
|
|
98
99
|
enable_default_extensions: bool | None = None,
|
|
99
100
|
window_size: dict | None = None,
|
|
100
101
|
window_position: dict | None = None,
|
|
@@ -135,12 +135,17 @@ class VibeSurfBackground {
|
|
|
135
135
|
console.error('[VibeSurf] Failed to open side panel:', error);
|
|
136
136
|
|
|
137
137
|
// Show notification with helpful message
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
try {
|
|
139
|
+
await chrome.notifications.create({
|
|
140
|
+
type: 'basic',
|
|
141
|
+
iconUrl: '', // Use empty string to avoid icon issues
|
|
142
|
+
title: 'VibeSurf',
|
|
143
|
+
message: 'Side panel failed. Please update Chrome to the latest version or try right-clicking the extension icon.'
|
|
144
|
+
});
|
|
145
|
+
} catch (notifError) {
|
|
146
|
+
console.warn('[VibeSurf] Notification failed:', notifError);
|
|
147
|
+
// Don't throw, just log the warning
|
|
148
|
+
}
|
|
144
149
|
|
|
145
150
|
// Fallback: try to open in new tab
|
|
146
151
|
try {
|
|
@@ -365,56 +370,35 @@ class VibeSurfBackground {
|
|
|
365
370
|
}
|
|
366
371
|
|
|
367
372
|
async showNotification(data) {
|
|
368
|
-
const { title, message, type = 'info', iconUrl
|
|
373
|
+
const { title, message, type = 'info', iconUrl } = data;
|
|
369
374
|
|
|
370
375
|
// Map custom types to valid Chrome notification types
|
|
371
376
|
const validType = ['basic', 'image', 'list', 'progress'].includes(type) ? type : 'basic';
|
|
372
377
|
|
|
373
|
-
//
|
|
374
|
-
let
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const defaultIconUrl = chrome.runtime.getURL('icons/icon48.png');
|
|
386
|
-
const response = await fetch(defaultIconUrl, { method: 'HEAD' });
|
|
387
|
-
if (response.ok) {
|
|
388
|
-
validatedIconUrl = defaultIconUrl;
|
|
389
|
-
} else {
|
|
390
|
-
// Fallback to logo.png if icon48.png doesn't exist
|
|
391
|
-
const logoUrl = chrome.runtime.getURL('icons/logo.png');
|
|
392
|
-
const logoResponse = await fetch(logoUrl, { method: 'HEAD' });
|
|
393
|
-
if (logoResponse.ok) {
|
|
394
|
-
validatedIconUrl = logoUrl;
|
|
395
|
-
} else {
|
|
396
|
-
// If no icons work, use empty string (browser will use default)
|
|
397
|
-
validatedIconUrl = '';
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
} catch (error) {
|
|
402
|
-
console.warn('[VibeSurf] Icon validation failed, using fallback:', error);
|
|
403
|
-
// Use empty string as fallback (browser will use default icon)
|
|
404
|
-
validatedIconUrl = '';
|
|
405
|
-
}
|
|
378
|
+
// Simplified icon handling - try available icons without validation
|
|
379
|
+
let finalIconUrl = '';
|
|
380
|
+
|
|
381
|
+
// Try to use extension icons in order of preference, but don't validate with fetch
|
|
382
|
+
const iconCandidates = [
|
|
383
|
+
iconUrl ? chrome.runtime.getURL(iconUrl) : null,
|
|
384
|
+
chrome.runtime.getURL('icons/icon48.png'),
|
|
385
|
+
chrome.runtime.getURL('icons/logo.png')
|
|
386
|
+
].filter(Boolean);
|
|
387
|
+
|
|
388
|
+
// Use the first candidate, or empty string as fallback
|
|
389
|
+
finalIconUrl = iconCandidates[0] || '';
|
|
406
390
|
|
|
407
391
|
try {
|
|
408
392
|
const notificationId = await chrome.notifications.create({
|
|
409
393
|
type: validType,
|
|
410
|
-
iconUrl:
|
|
394
|
+
iconUrl: finalIconUrl,
|
|
411
395
|
title: title || 'VibeSurf',
|
|
412
396
|
message
|
|
413
397
|
});
|
|
414
398
|
|
|
415
399
|
return { notificationId };
|
|
416
400
|
} catch (error) {
|
|
417
|
-
console.
|
|
401
|
+
console.warn('[VibeSurf] Notification with icon failed, trying without icon:', error);
|
|
418
402
|
// Try once more with empty icon URL
|
|
419
403
|
try {
|
|
420
404
|
const notificationId = await chrome.notifications.create({
|
|
@@ -432,12 +416,17 @@ class VibeSurfBackground {
|
|
|
432
416
|
}
|
|
433
417
|
|
|
434
418
|
async showWelcomeNotification() {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
419
|
+
try {
|
|
420
|
+
await chrome.notifications.create({
|
|
421
|
+
type: 'basic',
|
|
422
|
+
iconUrl: '', // Use empty string to avoid icon issues
|
|
423
|
+
title: 'Welcome to VibeSurf!',
|
|
424
|
+
message: 'Click the VibeSurf icon in the toolbar to start automating your browsing tasks.'
|
|
425
|
+
});
|
|
426
|
+
} catch (error) {
|
|
427
|
+
console.warn('[VibeSurf] Welcome notification failed:', error);
|
|
428
|
+
// Don't throw, just log the warning
|
|
429
|
+
}
|
|
441
430
|
}
|
|
442
431
|
|
|
443
432
|
async checkBackendStatus(backendUrl = null) {
|
|
@@ -558,7 +547,40 @@ class VibeSurfBackground {
|
|
|
558
547
|
return { success: false, error: 'No file URL provided' };
|
|
559
548
|
}
|
|
560
549
|
|
|
550
|
+
// Add a unique request ID to track duplicate calls
|
|
551
|
+
const requestId = Date.now() + Math.random();
|
|
552
|
+
console.log(`[VibeSurf] openFileUrl called with ID: ${requestId}, URL: ${fileUrl}`);
|
|
553
|
+
|
|
561
554
|
try {
|
|
555
|
+
// Validate URL format before attempting to open
|
|
556
|
+
try {
|
|
557
|
+
new URL(fileUrl);
|
|
558
|
+
} catch (urlError) {
|
|
559
|
+
console.warn('[VibeSurf] Invalid URL format:', fileUrl, urlError);
|
|
560
|
+
return { success: false, error: 'Invalid file URL format' };
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// Check if this is an HTTP/HTTPS URL and handle it appropriately
|
|
564
|
+
if (fileUrl.startsWith('http://') || fileUrl.startsWith('https://')) {
|
|
565
|
+
console.log(`[VibeSurf] Detected HTTP(S) URL, creating tab for: ${fileUrl}`);
|
|
566
|
+
|
|
567
|
+
// Try to create a new tab with the URL
|
|
568
|
+
const tab = await chrome.tabs.create({
|
|
569
|
+
url: fileUrl,
|
|
570
|
+
active: true
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
if (tab && tab.id) {
|
|
574
|
+
console.log(`[VibeSurf] Successfully opened HTTP(S) URL in tab: ${tab.id} (request: ${requestId})`);
|
|
575
|
+
return { success: true, tabId: tab.id };
|
|
576
|
+
} else {
|
|
577
|
+
console.warn(`[VibeSurf] Tab creation returned but no tab ID for request: ${requestId}`);
|
|
578
|
+
return { success: false, error: 'Failed to create tab - no tab ID returned' };
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// For file:// URLs, try the original approach
|
|
583
|
+
console.log(`[VibeSurf] Attempting to open file URL: ${fileUrl} (request: ${requestId})`);
|
|
562
584
|
|
|
563
585
|
// Try to create a new tab with the file URL
|
|
564
586
|
const tab = await chrome.tabs.create({
|
|
@@ -567,16 +589,25 @@ class VibeSurfBackground {
|
|
|
567
589
|
});
|
|
568
590
|
|
|
569
591
|
if (tab && tab.id) {
|
|
592
|
+
console.log(`[VibeSurf] Successfully opened file in tab: ${tab.id} (request: ${requestId})`);
|
|
570
593
|
return { success: true, tabId: tab.id };
|
|
571
594
|
} else {
|
|
572
|
-
|
|
595
|
+
console.warn(`[VibeSurf] Tab creation returned but no tab ID for request: ${requestId}`);
|
|
596
|
+
return { success: false, error: 'Failed to create tab - no tab ID returned' };
|
|
573
597
|
}
|
|
574
598
|
|
|
575
599
|
} catch (error) {
|
|
576
|
-
console.error(
|
|
600
|
+
console.error(`[VibeSurf] Error opening file URL (request: ${requestId}):`, error);
|
|
601
|
+
|
|
602
|
+
// Provide more specific error messages
|
|
603
|
+
let errorMessage = error.message || 'Unknown error opening file';
|
|
604
|
+
if (error.message && error.message.includes('file://')) {
|
|
605
|
+
errorMessage = 'Browser security restricts opening local files. Try copying the file path and opening manually.';
|
|
606
|
+
}
|
|
607
|
+
|
|
577
608
|
return {
|
|
578
609
|
success: false,
|
|
579
|
-
error:
|
|
610
|
+
error: errorMessage
|
|
580
611
|
};
|
|
581
612
|
}
|
|
582
613
|
}
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"contextMenus",
|
|
17
17
|
"tabs",
|
|
18
18
|
"clipboardWrite",
|
|
19
|
-
"scripting"
|
|
20
|
-
"microphone"
|
|
19
|
+
"scripting"
|
|
21
20
|
],
|
|
22
21
|
"host_permissions": [
|
|
23
22
|
"http://localhost:*/*",
|
|
@@ -49,15 +48,7 @@
|
|
|
49
48
|
|
|
50
49
|
"web_accessible_resources": [
|
|
51
50
|
{
|
|
52
|
-
"resources": [
|
|
53
|
-
"sidepanel.html",
|
|
54
|
-
"permission-request.html",
|
|
55
|
-
"permission-iframe.html",
|
|
56
|
-
"styles/*",
|
|
57
|
-
"scripts/*",
|
|
58
|
-
"config.js",
|
|
59
|
-
"icons/*"
|
|
60
|
-
],
|
|
51
|
+
"resources": ["sidepanel.html", "styles/*", "scripts/*", "config.js", "icons/*"],
|
|
61
52
|
"matches": ["<all_urls>"]
|
|
62
53
|
}
|
|
63
54
|
]
|
|
@@ -275,14 +275,28 @@ class VibeSurfFileManager {
|
|
|
275
275
|
async handleFileLink(filePath) {
|
|
276
276
|
// Prevent multiple simultaneous calls
|
|
277
277
|
if (this.state.isHandlingFileLink) {
|
|
278
|
+
console.log('[FileManager] File link handling already in progress, skipping...');
|
|
278
279
|
return;
|
|
279
280
|
}
|
|
280
281
|
|
|
281
282
|
this.state.isHandlingFileLink = true;
|
|
282
283
|
|
|
283
284
|
try {
|
|
284
|
-
|
|
285
|
-
|
|
285
|
+
console.log('[FileManager] Handling file link:', filePath);
|
|
286
|
+
|
|
287
|
+
// Validate input
|
|
288
|
+
if (!filePath || typeof filePath !== 'string') {
|
|
289
|
+
throw new Error('Invalid file path provided');
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// First decode the URL-encoded path safely
|
|
293
|
+
let decodedPath;
|
|
294
|
+
try {
|
|
295
|
+
decodedPath = decodeURIComponent(filePath);
|
|
296
|
+
} catch (decodeError) {
|
|
297
|
+
console.warn('[FileManager] Failed to decode URL, using original path:', decodeError);
|
|
298
|
+
decodedPath = filePath;
|
|
299
|
+
}
|
|
286
300
|
|
|
287
301
|
// Remove file:// protocol prefix and normalize
|
|
288
302
|
let cleanPath = decodedPath.replace(/^file:\/\/\//, '').replace(/^file:\/\//, '');
|
|
@@ -300,21 +314,28 @@ class VibeSurfFileManager {
|
|
|
300
314
|
`file:///${cleanPath}` :
|
|
301
315
|
`file:///${cleanPath.replace(/^\//, '')}`; // Remove leading slash and add triple slash
|
|
302
316
|
|
|
317
|
+
console.log('[FileManager] Processed file URL:', fileUrl);
|
|
318
|
+
|
|
303
319
|
// Show user notification about the action
|
|
304
320
|
this.emit('notification', {
|
|
305
321
|
message: `Opening file: ${cleanPath}`,
|
|
306
322
|
type: 'info'
|
|
307
323
|
});
|
|
308
324
|
|
|
309
|
-
// Use setTimeout to prevent UI blocking
|
|
325
|
+
// Use setTimeout to prevent UI blocking and ensure proper cleanup
|
|
310
326
|
setTimeout(async () => {
|
|
311
327
|
try {
|
|
312
328
|
// For user-clicked file links, use OPEN_FILE_URL to keep tab open
|
|
313
329
|
// This prevents the auto-close behavior in OPEN_FILE_SYSTEM
|
|
314
|
-
const fileOpenResponse = await
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
330
|
+
const fileOpenResponse = await Promise.race([
|
|
331
|
+
chrome.runtime.sendMessage({
|
|
332
|
+
type: 'OPEN_FILE_URL',
|
|
333
|
+
data: { fileUrl: fileUrl }
|
|
334
|
+
}),
|
|
335
|
+
new Promise((_, reject) =>
|
|
336
|
+
setTimeout(() => reject(new Error('File open timeout')), 5000)
|
|
337
|
+
)
|
|
338
|
+
]);
|
|
318
339
|
|
|
319
340
|
if (fileOpenResponse && fileOpenResponse.success) {
|
|
320
341
|
this.emit('notification', {
|
|
@@ -322,12 +343,14 @@ class VibeSurfFileManager {
|
|
|
322
343
|
type: 'success'
|
|
323
344
|
});
|
|
324
345
|
return;
|
|
346
|
+
} else if (fileOpenResponse && fileOpenResponse.error) {
|
|
347
|
+
console.warn('[FileManager] Background script file open failed:', fileOpenResponse.error);
|
|
325
348
|
}
|
|
326
349
|
|
|
327
|
-
// If OPEN_FILE_URL fails, try direct browser open
|
|
350
|
+
// If OPEN_FILE_URL fails, try direct browser open with additional safety
|
|
328
351
|
try {
|
|
329
352
|
const opened = window.open(fileUrl, '_blank', 'noopener,noreferrer');
|
|
330
|
-
if (opened) {
|
|
353
|
+
if (opened && !opened.closed) {
|
|
331
354
|
this.emit('notification', {
|
|
332
355
|
message: 'File opened in browser',
|
|
333
356
|
type: 'success'
|
|
@@ -339,14 +362,32 @@ class VibeSurfFileManager {
|
|
|
339
362
|
}
|
|
340
363
|
|
|
341
364
|
// Last resort: Copy path to clipboard
|
|
342
|
-
this.copyToClipboardFallback(fileUrl);
|
|
365
|
+
await this.copyToClipboardFallback(fileUrl);
|
|
343
366
|
|
|
344
367
|
} catch (error) {
|
|
345
368
|
console.error('[FileManager] Error in async file handling:', error);
|
|
369
|
+
|
|
370
|
+
// Provide more helpful error messages
|
|
371
|
+
let userMessage = 'Unable to open file';
|
|
372
|
+
if (error.message.includes('timeout')) {
|
|
373
|
+
userMessage = 'File open operation timed out. Try copying the path manually.';
|
|
374
|
+
} else if (error.message.includes('protocol')) {
|
|
375
|
+
userMessage = 'Browser security restricts opening local files. File path copied to clipboard.';
|
|
376
|
+
} else {
|
|
377
|
+
userMessage = `Unable to open file: ${error.message}`;
|
|
378
|
+
}
|
|
379
|
+
|
|
346
380
|
this.emit('notification', {
|
|
347
|
-
message:
|
|
381
|
+
message: userMessage,
|
|
348
382
|
type: 'error'
|
|
349
383
|
});
|
|
384
|
+
|
|
385
|
+
// Fallback to clipboard
|
|
386
|
+
try {
|
|
387
|
+
await this.copyToClipboardFallback(fileUrl);
|
|
388
|
+
} catch (clipboardError) {
|
|
389
|
+
console.error('[FileManager] Clipboard fallback also failed:', clipboardError);
|
|
390
|
+
}
|
|
350
391
|
} finally {
|
|
351
392
|
this.state.isHandlingFileLink = false;
|
|
352
393
|
}
|
|
@@ -355,7 +396,7 @@ class VibeSurfFileManager {
|
|
|
355
396
|
} catch (error) {
|
|
356
397
|
console.error('[FileManager] Error handling file link:', error);
|
|
357
398
|
this.emit('notification', {
|
|
358
|
-
message: `
|
|
399
|
+
message: `File link processing failed: ${error.message}`,
|
|
359
400
|
type: 'error'
|
|
360
401
|
});
|
|
361
402
|
this.state.isHandlingFileLink = false;
|
|
@@ -189,6 +189,12 @@ class VibeSurfApp {
|
|
|
189
189
|
// Periodic backend health check
|
|
190
190
|
setInterval(async () => {
|
|
191
191
|
try {
|
|
192
|
+
// Check if apiClient exists and is initialized
|
|
193
|
+
if (!this.apiClient || typeof this.apiClient.healthCheck !== 'function') {
|
|
194
|
+
console.warn('[VibeSurf] Health check skipped - API client not available');
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
192
198
|
const healthCheck = await this.apiClient.healthCheck();
|
|
193
199
|
|
|
194
200
|
if (healthCheck.status === 'healthy') {
|
|
@@ -413,18 +419,37 @@ class VibeSurfApp {
|
|
|
413
419
|
|
|
414
420
|
// Cleanup method
|
|
415
421
|
destroy() {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
422
|
+
// Prevent multiple cleanup calls
|
|
423
|
+
if (this.isDestroying || !this.isInitialized) {
|
|
424
|
+
console.log('[VibeSurf] Cleanup already in progress or app not initialized, skipping...');
|
|
425
|
+
return;
|
|
420
426
|
}
|
|
421
427
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
428
|
+
this.isDestroying = true;
|
|
429
|
+
console.log('[VibeSurf] Cleaning up application...');
|
|
425
430
|
|
|
426
|
-
|
|
427
|
-
|
|
431
|
+
try {
|
|
432
|
+
if (this.uiManager) {
|
|
433
|
+
this.uiManager.destroy();
|
|
434
|
+
this.uiManager = null;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (this.sessionManager) {
|
|
438
|
+
this.sessionManager.destroy();
|
|
439
|
+
this.sessionManager = null;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
if (this.apiClient) {
|
|
443
|
+
this.apiClient = null;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
this.isInitialized = false;
|
|
447
|
+
console.log('[VibeSurf] Application cleanup complete');
|
|
448
|
+
} catch (error) {
|
|
449
|
+
console.error('[VibeSurf] Error during cleanup:', error);
|
|
450
|
+
} finally {
|
|
451
|
+
this.isDestroying = false;
|
|
452
|
+
}
|
|
428
453
|
}
|
|
429
454
|
|
|
430
455
|
// Get application status
|
|
@@ -456,11 +481,21 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|
|
456
481
|
|
|
457
482
|
// Handle page unload
|
|
458
483
|
window.addEventListener('beforeunload', () => {
|
|
459
|
-
if (window.vibeSurfApp) {
|
|
484
|
+
if (window.vibeSurfApp && window.vibeSurfApp.isInitialized && !window.vibeSurfApp.isDestroying) {
|
|
485
|
+
console.log('[VibeSurf] Page unloading, cleaning up...');
|
|
460
486
|
window.vibeSurfApp.destroy();
|
|
461
487
|
}
|
|
462
488
|
});
|
|
463
489
|
|
|
490
|
+
// Handle visibility change to prevent unnecessary cleanup
|
|
491
|
+
document.addEventListener('visibilitychange', () => {
|
|
492
|
+
if (document.visibilityState === 'hidden') {
|
|
493
|
+
console.log('[VibeSurf] Page hidden, but not cleaning up (might be tab switch)');
|
|
494
|
+
} else if (document.visibilityState === 'visible') {
|
|
495
|
+
console.log('[VibeSurf] Page visible again');
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
|
|
464
499
|
// Make app accessible for debugging
|
|
465
500
|
if (typeof window !== 'undefined') {
|
|
466
501
|
window.VibeSurfApp = VibeSurfApp;
|
|
@@ -653,11 +653,37 @@ class VibeSurfSessionManager {
|
|
|
653
653
|
|
|
654
654
|
// Cleanup
|
|
655
655
|
destroy() {
|
|
656
|
-
|
|
657
|
-
this.
|
|
658
|
-
|
|
659
|
-
|
|
656
|
+
// Prevent multiple cleanup calls
|
|
657
|
+
if (this.isDestroying) {
|
|
658
|
+
console.log('[SessionManager] Cleanup already in progress, skipping...');
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
660
661
|
|
|
662
|
+
this.isDestroying = true;
|
|
663
|
+
console.log('[SessionManager] Destroying session manager...');
|
|
664
|
+
|
|
665
|
+
try {
|
|
666
|
+
this.stopActivityPolling();
|
|
667
|
+
this.eventListeners.clear();
|
|
668
|
+
|
|
669
|
+
// Clear any ongoing requests
|
|
670
|
+
if (this.pollingTimer) {
|
|
671
|
+
clearTimeout(this.pollingTimer);
|
|
672
|
+
this.pollingTimer = null;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// Reset state
|
|
676
|
+
this.currentSession = null;
|
|
677
|
+
this.currentTaskId = null;
|
|
678
|
+
this.activityLogs = [];
|
|
679
|
+
this.isPolling = false;
|
|
680
|
+
|
|
681
|
+
console.log('[SessionManager] Session manager cleanup complete');
|
|
682
|
+
} catch (error) {
|
|
683
|
+
console.error('[SessionManager] Error during destroy:', error);
|
|
684
|
+
} finally {
|
|
685
|
+
this.isDestroying = false;
|
|
686
|
+
}
|
|
661
687
|
}
|
|
662
688
|
|
|
663
689
|
// Status helpers
|