myagent-ai 1.47.35 → 1.47.36

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.
@@ -120,7 +120,7 @@ class ToolDispatcher:
120
120
  """
121
121
  # ── 内置平台工具 (LLM 直接调用) ──
122
122
  if tool_name == "command":
123
- return await self._exec_command(params, timeout, task_id, stream_callback, sent_files)
123
+ return await self._exec_command(params, timeout, task_id, stream_callback, sent_files, agent_path)
124
124
  elif tool_name == "web_control":
125
125
  return await self._exec_web_control(params, task_id, stream_callback)
126
126
 
@@ -183,7 +183,8 @@ class ToolDispatcher:
183
183
 
184
184
  async def _exec_command(self, params: Dict, timeout: int, task_id: str,
185
185
  stream_callback: Optional[Callable] = None,
186
- sent_files: Optional[List[Dict[str, Any]]] = None) -> Dict:
186
+ sent_files: Optional[List[Dict[str, Any]]] = None,
187
+ agent_path: Optional[str] = None) -> Dict:
187
188
  """执行 shell 命令"""
188
189
  code_text = params.get("command", "")
189
190
  if not code_text:
@@ -227,9 +228,13 @@ class ToolDispatcher:
227
228
  _to_name = _match[1].strip()
228
229
  _content = _match[2].strip()
229
230
 
230
- # 获取当前 agent 的路径(从 task_id 或其他方式)
231
- _from_path = task_id.replace("task_", "") if task_id else "unknown"
232
- _from_name = "朱军" # 可以根据实际情况获取
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 "未知"
233
238
 
234
239
  _gm.add_agent_chat(
235
240
  group_id="",
@@ -285,9 +290,13 @@ class ToolDispatcher:
285
290
  _to_name = _match[1].strip()
286
291
  _content = _match[2].strip()
287
292
 
288
- # 获取当前 agent 的路径(从 task_id 或其他方式)
289
- _from_path = task_id.replace("task_", "") if task_id else "unknown"
290
- _from_name = "朱军" # 可以根据实际情况获取
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 "未知"
291
300
 
292
301
  _gm.add_agent_chat(
293
302
  group_id="",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.47.35",
3
+ "version": "1.47.36",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {