myagent-ai 1.47.36 → 1.47.37

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.
@@ -1362,6 +1362,7 @@ class MainAgent(BaseAgent):
1362
1362
  stream_callback=stream_callback,
1363
1363
  sent_files=sent_files,
1364
1364
  agent_path=agent_path,
1365
+ agent_id=agent_path, # agent_path 就是 agent_id
1365
1366
  )
1366
1367
 
1367
1368
  # 兼容回退: dispatcher 未初始化时使用基础 fallback
@@ -102,6 +102,7 @@ class ToolDispatcher:
102
102
  stream_callback: Optional[Callable] = None,
103
103
  sent_files: Optional[List[Dict[str, Any]]] = None,
104
104
  agent_path: Optional[str] = None,
105
+ agent_id: Optional[str] = None,
105
106
  ) -> Dict[str, Any]:
106
107
  """
107
108
  统一工具分发入口。
@@ -120,7 +121,7 @@ class ToolDispatcher:
120
121
  """
121
122
  # ── 内置平台工具 (LLM 直接调用) ──
122
123
  if tool_name == "command":
123
- return await self._exec_command(params, timeout, task_id, stream_callback, sent_files, agent_path)
124
+ return await self._exec_command(params, timeout, task_id, stream_callback, sent_files, agent_id)
124
125
  elif tool_name == "web_control":
125
126
  return await self._exec_web_control(params, task_id, stream_callback)
126
127
 
@@ -184,7 +185,7 @@ class ToolDispatcher:
184
185
  async def _exec_command(self, params: Dict, timeout: int, task_id: str,
185
186
  stream_callback: Optional[Callable] = None,
186
187
  sent_files: Optional[List[Dict[str, Any]]] = None,
187
- agent_path: Optional[str] = None) -> Dict:
188
+ agent_id: Optional[str] = None) -> Dict:
188
189
  """执行 shell 命令"""
189
190
  code_text = params.get("command", "")
190
191
  if not code_text:
@@ -228,17 +229,13 @@ class ToolDispatcher:
228
229
  _to_name = _match[1].strip()
229
230
  _content = _match[2].strip()
230
231
 
231
- # 获取当前 agent 的路径和名称
232
- _from_path = agent_path if agent_path else "unknown"
233
- # agent_path 解析 agent 名称
234
- if _from_path and _from_path.startswith("agents/"):
235
- _from_name = _from_path.replace("agents/", "").split("/")[-1]
236
- else:
237
- _from_name = _from_path if _from_path else "未知"
232
+ # 获取当前 agent 的 ID
233
+ _from_id = agent_id if agent_id else "unknown"
234
+ _from_name = _from_id if _from_id else "未知"
238
235
 
239
236
  _gm.add_agent_chat(
240
237
  group_id="",
241
- from_agent=_from_path,
238
+ from_agent=_from_id,
242
239
  from_name=_from_name,
243
240
  to_agent=_to_path,
244
241
  to_name=_to_name,
@@ -290,17 +287,13 @@ class ToolDispatcher:
290
287
  _to_name = _match[1].strip()
291
288
  _content = _match[2].strip()
292
289
 
293
- # 获取当前 agent 的路径和名称
294
- _from_path = agent_path if agent_path else "unknown"
295
- # agent_path 解析 agent 名称
296
- if _from_path and _from_path.startswith("agents/"):
297
- _from_name = _from_path.replace("agents/", "").split("/")[-1]
298
- else:
299
- _from_name = _from_path if _from_path else "未知"
290
+ # 获取当前 agent 的 ID
291
+ _from_id = agent_id if agent_id else "unknown"
292
+ _from_name = _from_id if _from_id else "未知"
300
293
 
301
294
  _gm.add_agent_chat(
302
295
  group_id="",
303
- from_agent=_from_path,
296
+ from_agent=_from_id,
304
297
  from_name=_from_name,
305
298
  to_agent=_to_path,
306
299
  to_name=_to_name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.47.36",
3
+ "version": "1.47.37",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {