beswarm 0.2.49__py3-none-any.whl → 0.2.50__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 beswarm might be problematic. Click here for more details.

@@ -1,6 +1,7 @@
1
1
  import uuid
2
2
  import networkx as nx
3
3
  from pathlib import Path
4
+ from .aient.src.aient.utils.scripts import unescape_html
4
5
 
5
6
  class KnowledgeGraphManager:
6
7
  """
@@ -68,6 +69,7 @@ class KnowledgeGraphManager:
68
69
  if path is None or not path.strip() or path.strip() in ['.', '/']:
69
70
  return "root"
70
71
 
72
+ path = unescape_html(path)
71
73
  segments = [s for s in path.strip('/').split('/') if s and s != '.']
72
74
  current_node_id = "root"
73
75
 
@@ -104,6 +106,9 @@ class KnowledgeGraphManager:
104
106
 
105
107
  def add_node(self, parent_path: str, node_name: str, description: str = "", tags: list[str] = None) -> str:
106
108
  """在指定父节点下添加一个新节点。"""
109
+ parent_path = unescape_html(parent_path)
110
+ node_name = unescape_html(node_name)
111
+ description = unescape_html(description)
107
112
  if not node_name.strip():
108
113
  return "❌ 错误:节点名称不能为空。"
109
114
  if '/' in node_name:
@@ -138,6 +143,7 @@ class KnowledgeGraphManager:
138
143
 
139
144
  def add_tags_to_node(self, node_path: str, tags_to_add: list[str]) -> str:
140
145
  """向指定节点添加一个或多个标签。"""
146
+ node_path = unescape_html(node_path)
141
147
  node_id = self._get_node_id_by_path(node_path)
142
148
  if node_id is None:
143
149
  return f"❌ 错误:路径 '{node_path}' 不存在。"
@@ -150,6 +156,7 @@ class KnowledgeGraphManager:
150
156
 
151
157
  def remove_tags_from_node(self, node_path: str, tags_to_remove: list[str]) -> str:
152
158
  """从指定节点移除一个或多个标签。"""
159
+ node_path = unescape_html(node_path)
153
160
  node_id = self._get_node_id_by_path(node_path)
154
161
  if node_id is None:
155
162
  return f"❌ 错误:路径 '{node_path}' 不存在。"
@@ -169,6 +176,7 @@ class KnowledgeGraphManager:
169
176
 
170
177
  def delete_node(self, node_path: str) -> str:
171
178
  """删除一个节点及其所有子孙节点。"""
179
+ node_path = unescape_html(node_path)
172
180
  if node_path is None or node_path.strip() in ['.', '/']:
173
181
  return "❌ 错误:不能删除根节点。"
174
182
 
@@ -185,6 +193,8 @@ class KnowledgeGraphManager:
185
193
 
186
194
  def rename_node(self, node_path: str, new_name: str) -> str:
187
195
  """重命名一个节点。"""
196
+ node_path = unescape_html(node_path)
197
+ new_name = unescape_html(new_name)
188
198
  if not new_name.strip():
189
199
  return "❌ 错误:新名称不能为空。"
190
200
  if '/' in new_name:
@@ -207,6 +217,8 @@ class KnowledgeGraphManager:
207
217
 
208
218
  def move_node(self, source_path: str, target_parent_path: str) -> str:
209
219
  """将一个节点移动到另一个父节点下。"""
220
+ source_path = unescape_html(source_path)
221
+ target_parent_path = unescape_html(target_parent_path)
210
222
  source_id = self._get_node_id_by_path(source_path)
211
223
  if source_id is None:
212
224
  return f"❌ 错误:源路径 '{source_path}' 不存在。"
@@ -233,6 +245,7 @@ class KnowledgeGraphManager:
233
245
 
234
246
  def get_node_details(self, node_path: str) -> str:
235
247
  """获取指定路径节点的所有详细信息。"""
248
+ node_path = unescape_html(node_path)
236
249
  node_id = self._get_node_id_by_path(node_path)
237
250
  if node_id is None:
238
251
  return f"❌ 错误:路径 '{node_path}' 不存在。"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.2.49
3
+ Version: 0.2.50
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  beswarm/__init__.py,sha256=HZjUOJtZR5QhMuDbq-wukQQn1VrBusNWai_ysGo-VVI,20
2
2
  beswarm/broker.py,sha256=64Y-djrKYaZfBQ8obwHOmr921QgZeu9BtScZWaYLfDo,9887
3
3
  beswarm/core.py,sha256=htssaaeIBZ_yOqvX9VtANoVWaZHt_7oWcxyDI1z0paQ,310
4
- beswarm/knowledge_graph.py,sha256=uBZ31StYrfEtFTj5EtrBNGYE0cPqacegtIc_mmtFSrw,12469
4
+ beswarm/knowledge_graph.py,sha256=PY3gVHuIT7zEp9qhIw9uDYz6koRUPa0RYd2REOwWjRc,13084
5
5
  beswarm/prompt.py,sha256=n0a1a6NThIxAYSkisg1sEKjvz2w0tozpKL4BIplaAkI,32286
6
6
  beswarm/taskmanager.py,sha256=xczsnehCaOAI3SRE8wUxhzmt6i6G7ynndSWS_bAZn3k,12192
7
7
  beswarm/utils.py,sha256=S9jEtht0hTZbjZ2Hk24p4Ip41R69BogOkYS6fgPKY2Y,8219
@@ -145,7 +145,7 @@ beswarm/tools/search_web.py,sha256=LhgXOSHL9fwxg5T2AAOV4TTJkcJVLogsfRJW2faPvDE,1
145
145
  beswarm/tools/subtasks.py,sha256=zZmRCjDocbvrU8MvZvpDWpQCKNntDJ123ByBiS8pRko,9889
146
146
  beswarm/tools/worker.py,sha256=-tcLGrdLPZYxc1z66iQIB1VH7RWcR-5CgVWuDIQJBCQ,2013
147
147
  beswarm/tools/write_csv.py,sha256=-r5OghcvjCg00hY0YQbp6u31VIJLrgaqDIvczAFoqDE,1470
148
- beswarm-0.2.49.dist-info/METADATA,sha256=Pcb-9zbBrpVN7XbtvppUsAWIpd1jJlZ1NZgi9wu6tAQ,3878
149
- beswarm-0.2.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
150
- beswarm-0.2.49.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
151
- beswarm-0.2.49.dist-info/RECORD,,
148
+ beswarm-0.2.50.dist-info/METADATA,sha256=GjMlSOekWJWwnLPekTnpAoxjnPC9tmkAHou-EIUIG5k,3878
149
+ beswarm-0.2.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
150
+ beswarm-0.2.50.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
151
+ beswarm-0.2.50.dist-info/RECORD,,