Jarvis-Brain 0.1.9.5__py3-none-any.whl → 0.1.9.7__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.9.5
3
+ Version: 0.1.9.7
4
4
  Summary: Jarvis brain mcp
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: beautifulsoup4
@@ -0,0 +1,11 @@
1
+ mcp_tools/__init__.py,sha256=_ZzedxbxmVkdRH00ONOjQR31pZW-B8WPn5P2qE6T-Iw,3012
2
+ mcp_tools/dp_tools.py,sha256=AtUO8XMCBkXB0aS0QZDWLTYW9oUBr2ECjSL1YbjVY5w,17009
3
+ mcp_tools/main.py,sha256=84sv39oOw9vqr2MPxKy9pFVrevJ9nQJWFffpfg0s6iA,1098
4
+ tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ tools/browser_manager.py,sha256=zeYcWuzxoohMdnYUoZbRH7axFC_VtV8MsncfN8y0yw0,2023
6
+ tools/browser_proxy.py,sha256=9mK5-OZy-TuJjmpzdpnqQwwHJWSdY4d0hJwm-tk604E,7650
7
+ tools/tools.py,sha256=TaWs-CNXy-py9BFmCnJrQ09ke938xXpImf-N2Qo_Rvc,4708
8
+ jarvis_brain-0.1.9.7.dist-info/METADATA,sha256=Q1IFzzHtQGdkIrRVvEq9BaRbqfC66ke8_8bjSdc43rE,241
9
+ jarvis_brain-0.1.9.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
10
+ jarvis_brain-0.1.9.7.dist-info/entry_points.txt,sha256=YFQT4xpkUqt5dM5wlKPQQOqcjMuFrT9iuRAzIpAyH7U,51
11
+ jarvis_brain-0.1.9.7.dist-info/RECORD,,
mcp_tools/__init__.py CHANGED
@@ -0,0 +1,5 @@
1
+ test_str="""
2
+ \\"X-XSS-Protection\\": \\"1; mode=block\\", \\"Server\\": \\"-\\"}, \\"response_body_segment\\": \\"pename\\\\\\": \\\\\\"SpuItemAttribute\\\\\\"}, {\\\\\\"code\\\\\\": \\\\\\"imageVersion\\\\\\", \\\\\\"name\\\\\\": \\\\\\"imageVersion\\\\\\", \\\\\\"subAttrList\\\\\\": [{\\\\\\"attrName\\\\\\": \\\\\\"1\\\\\\", \\\\\\"attrValue\\\\\\": \\\\\\"1\\\\\\", \\\\\\"__typename\\\\\\": \\\\\\"SubAttribute\\\\\\"}], \\\\\\"__typename\\\\\\": \\\\\\"SpuItemAttribute\\\\\\"}, {\\\\\\"code\\\\\\": \\\\\\"PLPhover\\\\\\", \\\\\\"name\\\\\\": \\\\\\"PLPhover\\\\\\", \\\\\\"subAttrList\\\\\\": [{\\\\\\"attrName\\\\\\": \\\\\\"2\\\\\\", \\\\\\"attrValue\\\\\\": \\\\\\"2\\\\\\", \\\\\\"__typename\\\\\\": \\\\\\"SubAttribute\\\\\\"}], \\\\\\"__typename\\\\\\": \\\\\\"SpuItemAttribute\\\\\\"}, {\\\\\\"code\\\\\\": \\\\\\"官网\\\\\\", \\\\\\"name\\\\\\": \\\\\\"官网\\\\\\", \\\\\\"subAttrList\\\\\\": [{\\\\\\"attrName\\\\\\": \\\\\\"是\\\\\\", \\\\\\"attrValue\\\\\\": \\\\\\"true\\\\\\", \\\\\\"__typename\\\\\\": \\\\\\"SubAttribute\\\\\\"}], \\\\\\"__typename\\\\\\": \\\\\\"SpuItemAttribute\\\\\\"}, {\\\\\\"code\\\\\\": \\\\\\"小程序\\\\\\", \\\\\\"name\\\\\\": \\\\\\"小程序\\\\\\", \\\\\\"subAttrList\\\\\\": [{\\\\\\"attrName\\\\\\": \\\\\\"是\\\\\\", \\\\\\"attrValue\\\\\\": \\\\\\"true\\\\\\", \\\\\\"__typename\\\\\\": \\\\\\"SubAttribute\\\\\\"}], \\\\\\"__typename\\\\\\": \\\\\\"SpuItemAttribute\\\\\\"}], \\\\\\"__typename\\\\\\": \\\\\\"SpuAttribute\\\\\\"}, \\\\\\"labelList\\\\\\": [{\\\\\\"name\\\\\\": \\\\\\"new\\\\\\", \\\\\\"value\\\\\\": \\\\\\"新品\\\\\\", \\\\\\"excludeValue\\\\\\": null, \\\\\\"__typename\\\\\\": \\\\\\"BaseLabel\\\\\\"}], \\\\\\"__typename\\\\\\": \\\\\\"Product2\\\\\\"}, {\\\\\\"baseInfo\\\\\\": {\\\\\\"spuCode\\\\\\": \\\\\\"864428CVE0G1000\\\\\\", \\\\\\"title\\\\\\": \\\\\\"互扣式双G带扣窄版腰带\\\\\\", \\\\\\"salePrice\\\\\\": 4300.0, \\\\\\"style\\\\\\": \\\\\\"864428\\\\\\", \\\\\\"categorys\\\\\\": [{\\\\\\"navFrontName\\\\\\": \\\\\\"女士风尚-手工plp\\\\\\", \\\\\\"frontName\\\\\\": null, \\\\\\"code\\\\\\": \\\\\\"67d7d4c5eb9d2100016b4fe5\\\\\\", \\\\\\"parentCode\\\\\\": null, \\\\\\"businessCode\\\\\\": \\\\\\"women-fashion手工plp\\\\\\", \\\\\\"__typename\\\\\\": \\\\\\"Category\\\\\\"}, {\\\\\\"navFrontName\\\\\\": \\\\\\"女士-women>女士配饰-women-accessories>女士腰带-women-accessories-belts\\\\\\", \\\\\\"frontName\\\\\\": null, \\\\\\"code\\\\\\": \\\\\\"642670bf0ae2090001133cbe\\\\\\", \\\\\\"parentCode\\\\\\": null, \\\\\\"businessCode\\\\\\": \\\\\\"women-accessories-belts\\\\\\", \\\\\\"__typename\\\\\\": \\\\\\"Category\\\\\\"}, {\\\\\\"navFrontName\\\\\\": \\\\\\"女士-women>女士配饰-women-accessories\\\\\\", \\\\\\"frontName\\\\\\": null, \\\\\\"code\\\\\\": \\\\\\"642670bf0ae2090001133cbd\\\\\\", \\\\\\"parentCode\\\\\\": null, \\\\\\"businessCode\\\\\\": \\\\\\"women-accessories\\\\\\",
3
+ """
4
+ decoded = test_str.encode().decode('unicode_escape')
5
+ print(decoded)
mcp_tools/dp_tools.py CHANGED
@@ -74,8 +74,8 @@ def register_pop_first_packet(mcp: FastMCP, browser_manager, client_manager: DPP
74
74
  current_queue_size, packet_message = client.pop_first_packet()
75
75
  message = f"tab页:【{tab_id}】,暂时没有监听到XHR数据包"
76
76
  if packet_message:
77
- message = f"tab页:【{tab_id}】,监听到XHR数据包,当前数据包队列中还剩 {current_queue_size} 条数据"
78
- if current_queue_size:
77
+ message = f"tab页:【{tab_id}】,监听到XHR数据包,当前数据包队列中还剩 {current_queue_size} 条数据,如果还剩数据为0,可以暂时稍后再次调用该方法"
78
+ if (packet_message is None) and current_queue_size:
79
79
  message = f"tab页:【{tab_id}】,当前弹出的第一个数据包不符合过滤条件,当前数据包队列中还剩 {current_queue_size} 条数据,请不要改变条件,继续弹出下一个数据包"
80
80
  return dp_mcp_message_pack(
81
81
  message,
tools/browser_proxy.py CHANGED
@@ -44,7 +44,7 @@ class DPProxyClient:
44
44
  if self.packet_queue:
45
45
  result = self.packet_queue.popleft()
46
46
  current_queue_size = len(self.packet_queue)
47
- return current_queue_size, json.dumps(result, ensure_ascii=False)
47
+ return current_queue_size, json.dumps(result, ensure_ascii=False, separators=(',', ':')).replace("\\", "")
48
48
  else:
49
49
  return 0, None
50
50
 
@@ -140,7 +140,7 @@ def check_data_packet(packet: DataPacket, client: DPProxyClient):
140
140
  data = packet.request.postData
141
141
  domain = urlparse(url).netloc
142
142
  body = packet.response.body
143
- body_str = json.dumps(body, ensure_ascii=False)
143
+ body_str = json.dumps(body, ensure_ascii=False, separators=(',', ':'))
144
144
  body_str_list = [body_str[i:i + one_turn_max_token] for i in range(0, len(body_str), one_turn_max_token)]
145
145
  body_completed = True
146
146
  packet_filter = client.packet_filter
@@ -162,7 +162,7 @@ def check_data_packet(packet: DataPacket, client: DPProxyClient):
162
162
  "request_data": data,
163
163
  "request_headers": dict(packet.request.headers),
164
164
  "response_headers": dict(packet.response.headers),
165
- "response_body_segment": body_str,
165
+ "response_body_segment": body_str.replace("\\", ""),
166
166
  }
167
167
  client.packet_queue.append(temp_dict)
168
168
 
@@ -1,11 +0,0 @@
1
- mcp_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mcp_tools/dp_tools.py,sha256=DhDrdP_te3HNk7pWTzTq1KNVO8MKPH1MSCaUPukolDM,16913
3
- mcp_tools/main.py,sha256=84sv39oOw9vqr2MPxKy9pFVrevJ9nQJWFffpfg0s6iA,1098
4
- tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- tools/browser_manager.py,sha256=zeYcWuzxoohMdnYUoZbRH7axFC_VtV8MsncfN8y0yw0,2023
6
- tools/browser_proxy.py,sha256=xA8wMC4QHqBa7-YXfl2NCgQfsCG_onLuWG1tbGVF7Vg,7568
7
- tools/tools.py,sha256=TaWs-CNXy-py9BFmCnJrQ09ke938xXpImf-N2Qo_Rvc,4708
8
- jarvis_brain-0.1.9.5.dist-info/METADATA,sha256=sA1Zx7XnX8XOr-RpTGE2a51X8vpsttd-hJcG0-WMOuc,241
9
- jarvis_brain-0.1.9.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
10
- jarvis_brain-0.1.9.5.dist-info/entry_points.txt,sha256=YFQT4xpkUqt5dM5wlKPQQOqcjMuFrT9iuRAzIpAyH7U,51
11
- jarvis_brain-0.1.9.5.dist-info/RECORD,,