vibesurf 0.1.41__py3-none-any.whl → 0.1.43__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.
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.41'
32
- __version_tuple__ = version_tuple = (0, 1, 41)
31
+ __version__ = version = '0.1.43'
32
+ __version_tuple__ = version_tuple = (0, 1, 43)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -153,7 +153,7 @@ class ReportWriterAgent:
153
153
  create_result = await self.file_system.create_file(report_filename)
154
154
  logger.info(f"Created report file: {create_result}")
155
155
 
156
- max_iterations = 10 # Prevent infinite loops
156
+ max_iterations = 20 # Prevent infinite loops
157
157
 
158
158
  # Add system message with unified prompt only if message history is empty
159
159
  if not self.message_history:
@@ -29,6 +29,7 @@ from browser_use.tokens.service import TokenCost
29
29
  from vibe_surf.agents.browser_use_agent import BrowserUseAgent
30
30
  from vibe_surf.agents.report_writer_agent import ReportWriterAgent, ReportTaskResult
31
31
  from vibe_surf.agents.views import CustomAgentOutput
32
+ from vibe_surf.utils import check_latest_vibesurf_version, get_vibesurf_version
32
33
 
33
34
  from vibe_surf.agents.prompts.vibe_surf_prompt import (
34
35
  VIBESURF_SYSTEM_PROMPT,
@@ -448,7 +449,8 @@ async def _vibesurf_agent_node_impl(state: VibeSurfState) -> VibeSurfState:
448
449
  for browser_task in state.browser_tasks:
449
450
  bu_task = browser_task.get('task', "")
450
451
  if bu_task:
451
- browser_tasks_md.append(f"- [ ] {bu_task}")
452
+ bu_task_tabid = browser_task.get('tab_id', "")
453
+ browser_tasks_md.append(f"- [ ] Tab id: {bu_task_tabid} working {bu_task}")
452
454
  browser_tasks_md = '\n'.join(browser_tasks_md)
453
455
  agent_msg = f"Routing to browser task execution with {len(state.browser_tasks)} browser tasks:\n\n{browser_tasks_md}"
454
456
  await log_agent_activity(state, agent_name, "working", agent_msg)
@@ -624,7 +626,7 @@ async def execute_parallel_browser_tasks(state: VibeSurfState) -> List[BrowserTa
624
626
  task_description = task_info.get('task', '')
625
627
  if not task_description:
626
628
  continue
627
- target_id = task_info.get('target_id', None)
629
+ target_id = task_info.get('tab_id', None)
628
630
  register_sessions.append(
629
631
  state.vibesurf_agent.browser_manager.register_agent(agent_id, target_id=target_id)
630
632
  )
@@ -756,7 +758,7 @@ async def execute_parallel_browser_tasks(state: VibeSurfState) -> List[BrowserTa
756
758
  finally:
757
759
  # Remove agents from control tracking and cleanup browser sessions
758
760
  for i, agent_id in enumerate(bu_agent_ids):
759
- if not isinstance(pending_tasks[i], list):
761
+ if pending_tasks[i].get('tab_id', None) is None:
760
762
  await state.vibesurf_agent.browser_manager.unregister_agent(agent_id, close_tabs=True)
761
763
  if state.vibesurf_agent and hasattr(state.vibesurf_agent, '_running_agents'):
762
764
  state.vibesurf_agent._running_agents.pop(agent_id, None)
@@ -1680,6 +1682,18 @@ Action list should NEVER be empty and Each step can only output one action. If m
1680
1682
  }
1681
1683
  self.activity_logs.append(activity_entry)
1682
1684
 
1685
+ latest_version = await check_latest_vibesurf_version()
1686
+ current_version = get_vibesurf_version()
1687
+ if latest_version and latest_version != current_version:
1688
+ update_msg = f'📦 Newer version of vibesurf available: {latest_version} (current: {current_version}). \nUpgrade with: \n`uv pip install vibesurf -U`\nor\nDownload [Windows Installer](https://github.com/vibesurf-ai/VibeSurf/releases/latest/download/vibesurf-windows-x64.exe).'
1689
+ logger.info(update_msg)
1690
+ activity_update_tip = {
1691
+ "agent_name": 'System',
1692
+ "agent_status": 'tip', # working, result, error
1693
+ "agent_msg": update_msg
1694
+ }
1695
+ self.activity_logs.append(activity_update_tip)
1696
+
1683
1697
  # Initialize state first (needed for file processing)
1684
1698
  initial_state = VibeSurfState(
1685
1699
  original_task=task,
@@ -120,7 +120,8 @@ class CustomDOMWatchdog(DOMWatchdog):
120
120
  try:
121
121
  self.logger.debug(
122
122
  '🔍 DOMWatchdog.on_BrowserStateRequestEvent: 🎨 Applying Python-based highlighting...')
123
- from browser_use.browser.python_highlights import create_highlighted_screenshot_async
123
+ # from browser_use.browser.python_highlights import create_highlighted_screenshot_async
124
+ from vibe_surf.browser.utils import create_highlighted_screenshot_async
124
125
 
125
126
  # Get CDP session for viewport info
126
127
  cdp_session = await self.browser_session.get_or_create_cdp_session()
@@ -129,8 +130,16 @@ class CustomDOMWatchdog(DOMWatchdog):
129
130
  screenshot_b64,
130
131
  content.selector_map,
131
132
  cdp_session,
132
- self.browser_session.browser_profile.filter_highlight_ids,
133
133
  )
134
+ #
135
+ # import base64
136
+ # import os
137
+ # image_data = base64.b64decode(screenshot_b64)
138
+ # output_path = os.path.join("/Users/warmshao/AIBrowsers/VibeSurf/vibe_surf/tmp/vibesurf_workspace/", "screenshots", f"{time.time()}.png")
139
+ # os.makedirs(os.path.dirname(output_path), exist_ok=True)
140
+ # with open(output_path, 'wb') as f:
141
+ # f.write(image_data)
142
+ # pdb.set_trace()
134
143
 
135
144
  self.logger.debug(
136
145
  f'🔍 DOMWatchdog.on_BrowserStateRequestEvent: ✅ Applied highlights to {len(content.selector_map)} elements'
@@ -463,8 +463,16 @@ Format: [index1, index2, index3, ...]
463
463
 
464
464
  page_html_content = await browser_session.get_html_content()
465
465
  web_page_html = clean_html_basic(page_html_content)
466
- if len(web_page_html) > 30000:
467
- web_page_html = web_page_html[:24000] + "..." + web_page_html[-6000:]
466
+
467
+ max_html_len = 60000
468
+ if len(web_page_html) > max_html_len:
469
+ gap_len = (len(web_page_html) - max_html_len) // 2
470
+ clip_len = max_html_len // 3
471
+ web_page_html = (web_page_html[:clip_len] + "\n\n...\n\n" +
472
+ web_page_html[
473
+ clip_len + gap_len: clip_len + gap_len + clip_len + 10000] + "\n\n...\n\n" +
474
+ web_page_html[
475
+ clip_len + gap_len * 2 + clip_len: clip_len + gap_len * 2 + 2 * clip_len - 10000])
468
476
 
469
477
  # Get current page URL for context
470
478
  current_url = await browser_session.get_current_page_url()
@@ -1589,7 +1597,7 @@ You will be given a query and the markdown of a webpage that has been filtered t
1589
1597
 
1590
1598
  def _register_browser_use_agent(self):
1591
1599
  @self.registry.action(
1592
- 'Execute browser_use agent tasks.',
1600
+ 'Execute browser_use agent tasks. Please specify a tab id to an agent, if you want to let agent work on this tab.',
1593
1601
  param_model=BrowserUseAgentExecution,
1594
1602
  )
1595
1603
  async def execute_browser_use_agent(
vibe_surf/utils.py CHANGED
@@ -1,3 +1,7 @@
1
+ import pdb
2
+
3
+ import httpx
4
+
1
5
  def singleton(cls):
2
6
  instance = [None]
3
7
 
@@ -10,4 +14,21 @@ def singleton(cls):
10
14
 
11
15
  def get_vibesurf_version() -> str:
12
16
  import vibe_surf
13
- return str(vibe_surf.__version__)
17
+ return str(vibe_surf.__version__)
18
+
19
+ async def check_latest_vibesurf_version() -> str | None:
20
+ """Check the latest version of browser-use from PyPI asynchronously.
21
+
22
+ Returns:
23
+ The latest version string if successful, None if failed
24
+ """
25
+ try:
26
+ async with httpx.AsyncClient(timeout=3.0) as client:
27
+ response = await client.get('https://pypi.org/pypi/vibesurf/json')
28
+ if response.status_code == 200:
29
+ data = response.json()
30
+ return data['info']['version']
31
+ except Exception:
32
+ # Silently fail - we don't want to break agent startup due to network issues
33
+ pass
34
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vibesurf
3
- Version: 0.1.41
3
+ Version: 0.1.43
4
4
  Summary: VibeSurf: A powerful browser assistant for vibe surfing
5
5
  Author: WarmShao
6
6
  License: Apache-2.0
@@ -1,13 +1,13 @@
1
1
  vibe_surf/__init__.py,sha256=WtduuMFGauMD_9dpk4fnRnLTAP6ka9Lfu0feAFNzLfo,339
2
- vibe_surf/_version.py,sha256=R-KPGpfpXU0mV8THtGmMmaSD_OLN_0-DypNkYhnTx5c,706
2
+ vibe_surf/_version.py,sha256=YPum5FQalsbt59zh9Uf_QO-wbAWl6bLq1oAvIJTN3Kg,706
3
3
  vibe_surf/cli.py,sha256=pzJs--bjV6ZU7njJnxK_lh76l3pQ3opg_5V9Hw17PQw,21924
4
4
  vibe_surf/common.py,sha256=_WWMxen5wFwzUjEShn3yDVC1OBFUiJ6Vccadi6tuG6w,1215
5
5
  vibe_surf/logger.py,sha256=k53MFA96QX6t9OfcOf1Zws8PP0OOqjVJfhUD3Do9lKw,3043
6
- vibe_surf/utils.py,sha256=3j6uRkgjOAIDYmbpW8C-DpYhdf1Kvahz715KSriVIk0,261
6
+ vibe_surf/utils.py,sha256=8To60-uBkfcHowEDwAxN7taKl7kDlFg-vRkErMapYis,835
7
7
  vibe_surf/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  vibe_surf/agents/browser_use_agent.py,sha256=Uj9tbCR5_dbrSSnKuajbL4zP_E9CwLMrdvw0EmDwnC0,34473
9
- vibe_surf/agents/report_writer_agent.py,sha256=EiG0ITPGctCGJ8BCc6eVT92Pvb0J39nPArZuXmDUkzg,24097
10
- vibe_surf/agents/vibe_surf_agent.py,sha256=seSQGS429pu5tp6T_Fc1N2Cl4mO2tXb1uABeqMmv3XA,78594
9
+ vibe_surf/agents/report_writer_agent.py,sha256=07MobTz7PiypEj_-LnfxLxHhE6woUmLTUELPf3c0fBY,24097
10
+ vibe_surf/agents/vibe_surf_agent.py,sha256=pu_rx6KulOPtcC82j_uZwa3_QtvNzlMvpMsDin31eiw,79582
11
11
  vibe_surf/agents/views.py,sha256=yHjNJloa-aofVTGyuRy08tBYP_Y3XLqt1DUWOUmHRng,4825
12
12
  vibe_surf/agents/prompts/__init__.py,sha256=l4ieA0D8kLJthyNN85FKLNe4ExBa3stY3l-aImLDRD0,36
13
13
  vibe_surf/agents/prompts/report_writer_prompt.py,sha256=sZE8MUT1CDLmRzbnbEQzAvTwJjpITgh2Q8g1_eXmkzE,4454
@@ -49,7 +49,7 @@ vibe_surf/browser/browser_manager.py,sha256=PFJ9flmqR2uokuRZ3PDh_Dy6_6qcQ6kH_eRc
49
49
  vibe_surf/browser/utils.py,sha256=bBtpMiyz2ixWOr31GbJwZ8pVYcnxztKjTJJO92z1BDY,35742
50
50
  vibe_surf/browser/watchdogs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  vibe_surf/browser/watchdogs/action_watchdog.py,sha256=6J7ox8hlA3EeRI6YiBxpKCdaybe7n_zp9UpdBWSTc4s,609
52
- vibe_surf/browser/watchdogs/dom_watchdog.py,sha256=9fNB-FjqJbeKpKp_UezPeymI-0yTUu_0LB3SEHXfdr8,11023
52
+ vibe_surf/browser/watchdogs/dom_watchdog.py,sha256=AYGyjzGMfgvsk2vcvjgA3CmRv_r_zAu9D0Gkk7L705I,11571
53
53
  vibe_surf/chrome_extension/background.js,sha256=9YLbLmBl__PPUwN6Edf0EQfE53Br1VfjlUiIkznf4n4,30181
54
54
  vibe_surf/chrome_extension/config.js,sha256=nHjjyWcmr1UgiLRJZa5qN-Jgz1CqK3EUzLe-VPA0Z3Q,1387
55
55
  vibe_surf/chrome_extension/content.js,sha256=cB67jK3vIE5zrpXAfi3p50H3EyTqK5xockOph0Q4kQg,13708
@@ -104,7 +104,7 @@ vibe_surf/tools/mcp_client.py,sha256=ZrwzboDBf7-rtzO8JYpBhvKGg88CMfbrXlhtIs8pXSQ
104
104
  vibe_surf/tools/report_writer_tools.py,sha256=2CyTTXOahTKZo7XwyWDDhJ--1mRA0uTtUWxu_DACAY0,776
105
105
  vibe_surf/tools/utils.py,sha256=-Hu60Qu0M_gJpU7Ow8WpgBbZzMv_76DsYYj7eFk6M08,4219
106
106
  vibe_surf/tools/vibesurf_registry.py,sha256=Z-8d9BrJl3RFMEK0Tw1Q5xNHX2kZGsnIGCTBZ3RM-pw,2159
107
- vibe_surf/tools/vibesurf_tools.py,sha256=f3R-dtKkNdNus7nvILy5p84VR9zpVedkrotTNfZfTmc,113278
107
+ vibe_surf/tools/vibesurf_tools.py,sha256=UZ-X1XwJE_M5zYQHUZG10PQOwPaInipx2vEs1Ncdvw4,113851
108
108
  vibe_surf/tools/views.py,sha256=r_xHyBHR-d8cSgvZ-GJVnB4k7pQq9g5gsp882zM70mM,12897
109
109
  vibe_surf/tools/voice_asr.py,sha256=AJG0yq_Jq-j8ulDlbPhVFfK1jch9_ASesis73iki9II,4702
110
110
  vibe_surf/tools/website_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -120,9 +120,9 @@ vibe_surf/tools/website_api/xhs/helpers.py,sha256=Dq2RyYKClBQ2ha2yEfpS1mtZswx0z9
120
120
  vibe_surf/tools/website_api/youtube/__init__.py,sha256=QWmZWSqo1O6XtaWP-SuL3HrBLYINjEWEyOy-KCytGDw,1145
121
121
  vibe_surf/tools/website_api/youtube/client.py,sha256=0kKy7fkBNc63hRvDgXaKnguDpDJ92rG8T2nT_Y1F5MQ,51989
122
122
  vibe_surf/tools/website_api/youtube/helpers.py,sha256=GPgqfNirLYjIpk1OObvoXd2Ktq-ahKOOKHO2WwQVXCw,12931
123
- vibesurf-0.1.41.dist-info/licenses/LICENSE,sha256=vRmTjOYvD8RLiSGYYmFHnveYNswtO1uvSk1sd-Eu7sg,2037
124
- vibesurf-0.1.41.dist-info/METADATA,sha256=zrIxuWbiGLDs7Wac1jxP1z5DliAsS6tC80f44sebKsg,6787
125
- vibesurf-0.1.41.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
126
- vibesurf-0.1.41.dist-info/entry_points.txt,sha256=UxqpvMocL-PR33S6vLF2OmXn-kVzM-DneMeZeHcPMM8,48
127
- vibesurf-0.1.41.dist-info/top_level.txt,sha256=VPZGHqSb6EEqcJ4ZX6bHIuWfon5f6HXl3c7BYpbRqnY,10
128
- vibesurf-0.1.41.dist-info/RECORD,,
123
+ vibesurf-0.1.43.dist-info/licenses/LICENSE,sha256=vRmTjOYvD8RLiSGYYmFHnveYNswtO1uvSk1sd-Eu7sg,2037
124
+ vibesurf-0.1.43.dist-info/METADATA,sha256=1mQgM2v5nia4METnVkXCUaI1SFHyugPFGmumxnkB0YM,6787
125
+ vibesurf-0.1.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
126
+ vibesurf-0.1.43.dist-info/entry_points.txt,sha256=UxqpvMocL-PR33S6vLF2OmXn-kVzM-DneMeZeHcPMM8,48
127
+ vibesurf-0.1.43.dist-info/top_level.txt,sha256=VPZGHqSb6EEqcJ4ZX6bHIuWfon5f6HXl3c7BYpbRqnY,10
128
+ vibesurf-0.1.43.dist-info/RECORD,,