Jarvis-Brain 0.1.7.11__py3-none-any.whl → 0.1.7.12__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Jarvis_Brain
3
- Version: 0.1.7.11
3
+ Version: 0.1.7.12
4
4
  Summary: Jarvis brain mcp
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: beautifulsoup4
@@ -1,11 +1,11 @@
1
1
  mcp_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mcp_tools/dp_tools.py,sha256=MJhswvKh5W2aIDYjlZU7VYCQSBdO0yYHnhSVw6kZFsI,11479
2
+ mcp_tools/dp_tools.py,sha256=P6ju3IJSxTVFKSmS_lmVvDg5taCZfRsyTmF8xma3eXk,11488
3
3
  mcp_tools/main.py,sha256=Fdt2N3oKGwvruuno_ywnuWSlm1BexE9ZY669H2LTo9w,1056
4
4
  tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  tools/browser_manager.py,sha256=EXM7n-sDOtdQGpWkVTAZHWhepVU-7PAoUTDNgGF9_fQ,1938
6
6
  tools/browser_proxy.py,sha256=cdMRxcUYyaOqGU17lldltHOvt9rxXD5Dwh7hBXEBby4,6780
7
7
  tools/tools.py,sha256=TaWs-CNXy-py9BFmCnJrQ09ke938xXpImf-N2Qo_Rvc,4708
8
- jarvis_brain-0.1.7.11.dist-info/METADATA,sha256=hAvWEBqBu2lJ2ETAA3zHrF3bYqvdOhRLRJWUt1serR4,242
9
- jarvis_brain-0.1.7.11.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
10
- jarvis_brain-0.1.7.11.dist-info/entry_points.txt,sha256=YFQT4xpkUqt5dM5wlKPQQOqcjMuFrT9iuRAzIpAyH7U,51
11
- jarvis_brain-0.1.7.11.dist-info/RECORD,,
8
+ jarvis_brain-0.1.7.12.dist-info/METADATA,sha256=wSkBgdajsjvZXX26Z5cH4_Za-xchtXAfXuHLk03q9OE,242
9
+ jarvis_brain-0.1.7.12.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
10
+ jarvis_brain-0.1.7.12.dist-info/entry_points.txt,sha256=YFQT4xpkUqt5dM5wlKPQQOqcjMuFrT9iuRAzIpAyH7U,51
11
+ jarvis_brain-0.1.7.12.dist-info/RECORD,,
mcp_tools/dp_tools.py CHANGED
@@ -104,16 +104,16 @@ def register_check_selector(mcp: FastMCP, browser_manager, client_manager: DPPro
104
104
  exist_flag = False
105
105
  if len(target_eles) != 0:
106
106
  exist_flag = True
107
+ if len(target_eles) > page_size:
108
+ target_eles = target_eles[offset:offset + page_size]
107
109
  if attr_name == "text":
108
110
  ele_text_list = [i.text.replace("\n", "") for i in target_eles]
109
111
  attr_output = "\n".join(ele_text_list)
110
112
  else:
111
113
  attr_output = json.dumps([i.attr(attr_name) for i in target_eles])
112
- if len(attr_output) > page_size:
113
- attr_output = attr_output[offset:offset + page_size]
114
114
  # 对attr_output逐个截断,截断的长度为:一轮最大token除以元素个数+3个点+两个引号和逗号
115
- slice_=max(300, one_turn_max_token // (page_size + 6))
116
- attr_output = [attr_str[:slice_] + "..."for attr_str in attr_output]
115
+ slice_seg = max(300, one_turn_max_token // (page_size + 6))
116
+ attr_output = [attr_str[:slice_seg] + "..." for attr_str in attr_output]
117
117
  return dp_mcp_message_pack(
118
118
  f"已完成tab页:【{tab_id}】对:【{css_selector}】的检查",
119
119
  tab_id=tab_id,