vibesurf 0.1.4__py3-none-any.whl → 0.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.

Potentially problematic release.


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

vibe_surf/_version.py CHANGED
@@ -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.4'
32
- __version_tuple__ = version_tuple = (0, 1, 4)
31
+ __version__ = version = '0.1.5'
32
+ __version_tuple__ = version_tuple = (0, 1, 5)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -91,6 +91,14 @@ class ReportWriterAgent:
91
91
  )
92
92
 
93
93
  response = await self.llm.ainvoke([UserMessage(content=content_prompt)])
94
+ logger.debug(f"Content generation response type: {type(response)}")
95
+ logger.debug(f"Content generation completion: {response.completion}")
96
+ logger.debug(f"Content generation completion type: {type(response.completion)}")
97
+
98
+ if response.completion is None:
99
+ logger.error("❌ Content generation returned None completion")
100
+ raise ValueError("LLM response completion is None - unable to generate report content")
101
+
94
102
  return response.completion
95
103
 
96
104
  async def _format_as_html(self, content: str) -> str:
@@ -98,6 +106,14 @@ class ReportWriterAgent:
98
106
  format_prompt = REPORT_FORMAT_PROMPT.format(report_content=content)
99
107
 
100
108
  response = await self.llm.ainvoke([UserMessage(content=format_prompt)])
109
+ logger.debug(f"Format generation response type: {type(response)}")
110
+ logger.debug(f"Format generation completion: {response.completion}")
111
+ logger.debug(f"Format generation completion type: {type(response.completion)}")
112
+
113
+ if response.completion is None:
114
+ logger.error("❌ Format generation returned None completion")
115
+ raise ValueError("LLM response completion is None - unable to format report as HTML")
116
+
101
117
  html_content = response.completion
102
118
 
103
119
  # Clean up the HTML content if needed
@@ -1565,9 +1565,25 @@ class VibeSurfAgent:
1565
1565
 
1566
1566
  except asyncio.CancelledError:
1567
1567
  logger.info("🛑 VibeSurfAgent execution was cancelled")
1568
+ # Add cancellation activity log
1569
+ if agent_activity_logs:
1570
+ activity_entry = {
1571
+ "agent_name": "VibeSurfAgent",
1572
+ "agent_status": "cancelled",
1573
+ "agent_msg": "Task execution was cancelled by user request."
1574
+ }
1575
+ agent_activity_logs.append(activity_entry)
1568
1576
  return f"# Task Execution Cancelled\n\n**Task:** {task}\n\nExecution was stopped by user request."
1569
1577
  except Exception as e:
1570
1578
  logger.error(f"❌ VibeSurfAgent execution failed: {e}")
1579
+ # Add error activity log
1580
+ if agent_activity_logs:
1581
+ activity_entry = {
1582
+ "agent_name": "VibeSurfAgent",
1583
+ "agent_status": "error",
1584
+ "agent_msg": f"Task execution failed: {str(e)}"
1585
+ }
1586
+ agent_activity_logs.append(activity_entry)
1571
1587
  return f"# Task Execution Failed\n\n**Task:** {task}\n\n**Error:** {str(e)}\n\nPlease try again or contact support."
1572
1588
  finally:
1573
1589
  # Reset state
vibe_surf/cli.py CHANGED
@@ -7,6 +7,7 @@ A command-line interface for VibeSurf browser automation tool.
7
7
  import os
8
8
  import sys
9
9
  import glob
10
+ import json
10
11
  import socket
11
12
  import platform
12
13
  import importlib.util
@@ -35,6 +36,17 @@ VIBESURF_LOGO = """
35
36
 
36
37
  console = Console()
37
38
 
39
+ # Add logger import for the workspace directory logging
40
+ try:
41
+ import logging
42
+ logger = logging.getLogger(__name__)
43
+ logging.basicConfig(level=logging.INFO)
44
+ except ImportError:
45
+ class SimpleLogger:
46
+ def info(self, msg):
47
+ console.print(f"[dim]{msg}[/dim]")
48
+ logger = SimpleLogger()
49
+
38
50
 
39
51
  def find_chrome_browser() -> Optional[str]:
40
52
  """Find Chrome browser executable."""
@@ -322,6 +334,55 @@ def start_backend(port: int) -> None:
322
334
  sys.exit(1)
323
335
 
324
336
 
337
+ def get_browser_execution_path() -> Optional[str]:
338
+ """Get browser execution path from envs.json or environment variables."""
339
+ # 1. Load environment variables
340
+ env_workspace_dir = os.getenv("VIBESURF_WORKSPACE", "")
341
+ if not env_workspace_dir or not env_workspace_dir.strip():
342
+ # Set default workspace directory based on OS
343
+ if platform.system() == "Windows":
344
+ default_workspace = os.path.join(os.environ.get("APPDATA", ""), "VibeSurf")
345
+ elif platform.system() == "Darwin": # macOS
346
+ default_workspace = os.path.join(os.path.expanduser("~"), "Library", "Application Support", "VibeSurf")
347
+ else: # Linux and others
348
+ default_workspace = os.path.join(os.path.expanduser("~"), ".vibesurf")
349
+ workspace_dir = default_workspace
350
+ else:
351
+ workspace_dir = env_workspace_dir
352
+ workspace_dir = os.path.abspath(workspace_dir)
353
+ os.makedirs(workspace_dir, exist_ok=True)
354
+ logger.info("WorkSpace directory: {}".format(workspace_dir))
355
+
356
+ # Load environment configuration from envs.json
357
+ envs_file_path = os.path.join(workspace_dir, "envs.json")
358
+ browser_path_from_envs = None
359
+ try:
360
+ if os.path.exists(envs_file_path):
361
+ with open(envs_file_path, 'r', encoding='utf-8') as f:
362
+ envs = json.load(f)
363
+ browser_path_from_envs = envs.get("BROWSER_EXECUTION_PATH", "")
364
+ if browser_path_from_envs:
365
+ browser_path_from_envs = browser_path_from_envs.strip()
366
+ except (json.JSONDecodeError, IOError) as e:
367
+ logger.info(f"Failed to load envs.json: {e}")
368
+ browser_path_from_envs = None
369
+
370
+ # 2. Get BROWSER_EXECUTION_PATH from environment variables
371
+ browser_path_from_env = os.getenv("BROWSER_EXECUTION_PATH", "")
372
+ if browser_path_from_env:
373
+ browser_path_from_env = browser_path_from_env.strip()
374
+
375
+ # Check paths in priority order: 1. envs.json -> 2. environment variables
376
+ for source, path in [("envs.json", browser_path_from_envs), ("environment variable", browser_path_from_env)]:
377
+ if path and os.path.exists(path) and os.path.isfile(path):
378
+ console.print(f"[green]✅ Using browser path from {source}: {path}[/green]")
379
+ return path
380
+ elif path:
381
+ console.print(f"[yellow]⚠️ Browser path from {source} exists but file not found: {path}[/yellow]")
382
+
383
+ return None
384
+
385
+
325
386
  def main():
326
387
  """Main CLI entry point."""
327
388
  try:
@@ -329,10 +390,14 @@ def main():
329
390
  console.print(Panel(VIBESURF_LOGO, title="[bold cyan]VibeSurf CLI[/bold cyan]", border_style="cyan"))
330
391
  console.print("[dim]A powerful browser automation tool for vibe surfing 🏄‍♂️[/dim]\n")
331
392
 
332
- # Browser selection
333
- browser_path = select_browser()
393
+ # Check for existing browser path from configuration
394
+ browser_path = get_browser_execution_path()
395
+
396
+ # If no valid browser path found, ask user to select
334
397
  if not browser_path:
335
- return
398
+ browser_path = select_browser()
399
+ if not browser_path:
400
+ return
336
401
 
337
402
  # Port configuration
338
403
  port = configure_port()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vibesurf
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: VibeSurf: A powerful browser assistant for vibe surfing
5
5
  Author: Shao Warm
6
6
  License: Apache-2.0
@@ -1,10 +1,10 @@
1
1
  vibe_surf/__init__.py,sha256=WtduuMFGauMD_9dpk4fnRnLTAP6ka9Lfu0feAFNzLfo,339
2
- vibe_surf/_version.py,sha256=rLCrf4heo25FJtBY-2Ap7ZuWW-5FS7sqTjsolIUuI5c,704
3
- vibe_surf/cli.py,sha256=bOWpkX-OeYjIgleY4QrGJZ4Ed083NpXpXw-9EGKhI7Y,13979
2
+ vibe_surf/_version.py,sha256=rdxBMYpwzYxiWk08QbPLHSAxHoDfeKWwyaJIAM0lSic,704
3
+ vibe_surf/cli.py,sha256=2VqPZMqgFMsB9siE-16adeeCaO6RUSc2KzoIH3ZiAjQ,16912
4
4
  vibe_surf/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  vibe_surf/agents/browser_use_agent.py,sha256=NSSdZ9lnjtv_RyfR5Ay2rMnzJRJ-67S8Q3ytGAguiB0,50266
6
- vibe_surf/agents/report_writer_agent.py,sha256=oJ0SfkCAIm5PJ0BiUxDqqjC3n1AHnEnp47jrh4JHGTg,12912
7
- vibe_surf/agents/vibe_surf_agent.py,sha256=L_8dU26CVs34ukxdtrXV3AceFBYo47OJ88Dp8kYLKjU,69894
6
+ vibe_surf/agents/report_writer_agent.py,sha256=E5mSirewzH4Oyv385-Nn2Mf1Ug3OCVBz99PoTbvKRfQ,13860
7
+ vibe_surf/agents/vibe_surf_agent.py,sha256=EiWa58QPfE8w9RnoT8ibYKQAecl9RbEbiaARFyPPBoo,70616
8
8
  vibe_surf/agents/prompts/__init__.py,sha256=l4ieA0D8kLJthyNN85FKLNe4ExBa3stY3l-aImLDRD0,36
9
9
  vibe_surf/agents/prompts/vibe_surf_prompt.py,sha256=u-6KgLSnBbQohS5kiLZDcZ3aoT90ScVONXi9gNvdMoo,11006
10
10
  vibe_surf/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -62,9 +62,9 @@ vibe_surf/controller/vibesurf_controller.py,sha256=UWz8SvOAHr9KG8tn4nTciZvt3JkxY
62
62
  vibe_surf/controller/views.py,sha256=BaPlvcHTy5h-Lfr0OSgR_t6ynitgzNQF4-VUJJt8Hi0,1072
63
63
  vibe_surf/llm/__init__.py,sha256=_vDVPo6STf343p1SgMQrF5023hicAx0g83pK2Gbk4Ek,601
64
64
  vibe_surf/llm/openai_compatible.py,sha256=oY32VZF4oDS6ZG0h1WGtqAlWzdlximlJVTw8e8p5Zrg,10175
65
- vibesurf-0.1.4.dist-info/licenses/LICENSE,sha256=czn6QYya0-jhLnStD9JqnMS-hwP5wRByipkrGTvoXLI,11355
66
- vibesurf-0.1.4.dist-info/METADATA,sha256=XTR4OsLanWvEzB_tt2ZnjZjkT8m2CVyktUFmVtHbA7k,3851
67
- vibesurf-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
- vibesurf-0.1.4.dist-info/entry_points.txt,sha256=UxqpvMocL-PR33S6vLF2OmXn-kVzM-DneMeZeHcPMM8,48
69
- vibesurf-0.1.4.dist-info/top_level.txt,sha256=VPZGHqSb6EEqcJ4ZX6bHIuWfon5f6HXl3c7BYpbRqnY,10
70
- vibesurf-0.1.4.dist-info/RECORD,,
65
+ vibesurf-0.1.5.dist-info/licenses/LICENSE,sha256=czn6QYya0-jhLnStD9JqnMS-hwP5wRByipkrGTvoXLI,11355
66
+ vibesurf-0.1.5.dist-info/METADATA,sha256=II0EPpYw63rX35ubQwFdn5yz9CfTqoXxr3KsoCC6K70,3851
67
+ vibesurf-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
+ vibesurf-0.1.5.dist-info/entry_points.txt,sha256=UxqpvMocL-PR33S6vLF2OmXn-kVzM-DneMeZeHcPMM8,48
69
+ vibesurf-0.1.5.dist-info/top_level.txt,sha256=VPZGHqSb6EEqcJ4ZX6bHIuWfon5f6HXl3c7BYpbRqnY,10
70
+ vibesurf-0.1.5.dist-info/RECORD,,