myagent-ai 1.47.35 → 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)
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
 
@@ -183,7 +184,8 @@ class ToolDispatcher:
183
184
 
184
185
  async def _exec_command(self, params: Dict, timeout: int, task_id: str,
185
186
  stream_callback: Optional[Callable] = None,
186
- sent_files: Optional[List[Dict[str, Any]]] = None) -> Dict:
187
+ sent_files: Optional[List[Dict[str, Any]]] = None,
188
+ agent_id: Optional[str] = None) -> Dict:
187
189
  """执行 shell 命令"""
188
190
  code_text = params.get("command", "")
189
191
  if not code_text:
@@ -227,13 +229,13 @@ class ToolDispatcher:
227
229
  _to_name = _match[1].strip()
228
230
  _content = _match[2].strip()
229
231
 
230
- # 获取当前 agent 的路径(从 task_id 或其他方式)
231
- _from_path = task_id.replace("task_", "") if task_id else "unknown"
232
- _from_name = "朱军" # 可以根据实际情况获取
232
+ # 获取当前 agent ID
233
+ _from_id = agent_id if agent_id else "unknown"
234
+ _from_name = _from_id if _from_id else "未知"
233
235
 
234
236
  _gm.add_agent_chat(
235
237
  group_id="",
236
- from_agent=_from_path,
238
+ from_agent=_from_id,
237
239
  from_name=_from_name,
238
240
  to_agent=_to_path,
239
241
  to_name=_to_name,
@@ -285,13 +287,13 @@ class ToolDispatcher:
285
287
  _to_name = _match[1].strip()
286
288
  _content = _match[2].strip()
287
289
 
288
- # 获取当前 agent 的路径(从 task_id 或其他方式)
289
- _from_path = task_id.replace("task_", "") if task_id else "unknown"
290
- _from_name = "朱军" # 可以根据实际情况获取
290
+ # 获取当前 agent ID
291
+ _from_id = agent_id if agent_id else "unknown"
292
+ _from_name = _from_id if _from_id else "未知"
291
293
 
292
294
  _gm.add_agent_chat(
293
295
  group_id="",
294
- from_agent=_from_path,
296
+ from_agent=_from_id,
295
297
  from_name=_from_name,
296
298
  to_agent=_to_path,
297
299
  to_name=_to_name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.47.35",
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": {