myagent-ai 1.23.31 → 1.23.33

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.
@@ -182,7 +182,7 @@ class ToolDispatcher:
182
182
  )
183
183
  result = exec_result.to_dict()
184
184
 
185
- output = result.get("output", "")
185
+ output = result.get("stdout", "") or result.get("output", "")
186
186
  import re as _re
187
187
 
188
188
  # [v1.23.0] 检测 __SEND_FILE__ 标记 — CLI send-file 命令输出此标记
@@ -225,7 +225,8 @@ class ToolDispatcher:
225
225
  if not media_result.get("success"):
226
226
  result["output"] += f"\n[音频播放失败: {media_result.get('error', '')}]"
227
227
  if video_markers:
228
- clean_output = result.get("output", "")
228
+ # [v1.23.32] 修复: result 可能没有 output key(来自 to_dict 的 stdout)
229
+ clean_output = result.get("output", "") or clean_output
229
230
  clean_output = _re.sub(r'__EMBED_VIDEO__.+?__END__\n?', '', clean_output).strip()
230
231
  result["output"] = clean_output
231
232
  for media_url, media_title in video_markers:
@@ -261,6 +262,10 @@ class ToolDispatcher:
261
262
  except Exception:
262
263
  pass
263
264
 
265
+ # [v1.23.32] 确保 result 始终有 output 字段(to_dict 返回 stdout,V2 循环依赖 output)
266
+ if "output" not in result:
267
+ result["output"] = clean_output
268
+
264
269
  return result
265
270
 
266
271
  async def _exec_recall_memory(self, params: Dict, task_id: str) -> Dict:
@@ -484,22 +489,14 @@ class ToolDispatcher:
484
489
  fpath = _P(media_file).expanduser().resolve()
485
490
  if not fpath.exists():
486
491
  return {"success": False, "error": f"文件不存在: {media_file}"}
487
- from skills.file_send import FileSendSkill
488
- fskill = FileSendSkill()
492
+ # [v1.23.32] 使用统一入口 _exec_file_send(正确的 MIME + v2_file 推送 + sent_files 持久化)
489
493
  desc = f"{'音频' if media_type == 'audio' else '视频'}播放: {fpath.name}"
490
- fresult = await fskill.execute(str(fpath), desc, stream_callback=stream_callback)
494
+ fresult = await self._exec_file_send(
495
+ {"file_path": str(fpath), "description": desc},
496
+ task_id, stream_callback, sent_files,
497
+ )
491
498
  if fresult.get("success"):
492
- fresult["_media_type"] = media_type
493
- result = {"success": True, "output": f"已发送{media_type}文件: {fpath.name}", "data": fresult}
494
- if sent_files is not None and fresult.get("file_id"):
495
- sent_files.append({
496
- "id": fresult["file_id"],
497
- "name": fresult.get("name", ""),
498
- "type": fresult.get("type", ""),
499
- "size": fresult.get("size", 0),
500
- "_media_type": media_type,
501
- })
502
- return result
499
+ return {"success": True, "output": f"已发送{media_type}文件: {fpath.name}", "data": fresult.get("data", {})}
503
500
  else:
504
501
  return {"success": False, "error": fresult.get("error", "文件发送失败")}
505
502
  else:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.23.31",
3
+ "version": "1.23.33",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
@@ -105,6 +105,9 @@ class FileSendSkill:
105
105
  ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
106
106
  ".txt": "text/plain", ".csv": "text/csv", ".md": "text/markdown",
107
107
  ".json": "application/json", ".html": "text/html",
108
+ ".mp3": "audio/mpeg", ".mp4": "video/mp4", ".wav": "audio/wav",
109
+ ".webm": "video/webm", ".ogg": "audio/ogg", ".flac": "audio/flac",
110
+ ".zip": "application/zip", ".tar.gz": "application/gzip",
108
111
  }
109
112
  mime = mime_map.get(fpath.suffix.lower(), "application/octet-stream")
110
113
  size = stored_path.stat().st_size