myagent-ai 1.23.9 → 1.23.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.23.9",
3
+ "version": "1.23.11",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
package/scripts/cli.py CHANGED
@@ -204,13 +204,13 @@ async def cmd_search(args):
204
204
  """网络搜索"""
205
205
  import argparse
206
206
  p = argparse.ArgumentParser(prog="myagent-ai search", description="网络搜索 — 搜索互联网信息")
207
- p.add_argument("query", help="搜索关键词")
207
+ p.add_argument("query", nargs="+", help="搜索关键词")
208
208
  p.add_argument("-n", "--num", type=int, default=10, help="返回结果数量 (默认10, 最大20)")
209
209
  a = p.parse_args(args)
210
210
 
211
211
  from skills.search_skill import WebSearchSkill
212
212
  skill = WebSearchSkill()
213
- result = await skill.execute(query=a.query, num=a.num)
213
+ result = await skill.execute(query=" ".join(a.query), num=a.num)
214
214
  _print_result({"success": result.success, "message": result.message,
215
215
  "data": result.data, "error": result.error})
216
216
 
@@ -110,8 +110,6 @@ class FileSendSkill:
110
110
  size = stored_path.stat().st_size
111
111
 
112
112
  base_url = get_public_base_url()
113
- from urllib.parse import quote as _url_quote
114
- safe_name = _url_quote(fpath.name)
115
113
  result = {
116
114
  "success": True,
117
115
  "file_id": file_id,
@@ -119,8 +117,8 @@ class FileSendSkill:
119
117
  "type": mime,
120
118
  "size": size,
121
119
  "description": description or f"文件: {fpath.name}",
122
- "url": f"{base_url}/api/file/{file_id}/{safe_name}",
123
- "download_url": f"{base_url}/api/file/{file_id}/download/{safe_name}",
120
+ "url": f"{base_url}/api/file/{file_id}?name={fpath.name}",
121
+ "download_url": f"{base_url}/api/file/{file_id}/download?name={fpath.name}",
124
122
  }
125
123
 
126
124
  # Send v2_file SSE event so frontend can display it
package/web/api_server.py CHANGED
@@ -494,12 +494,8 @@ class ApiServer:
494
494
  r.add_post("/api/chat/save-to-knowledge", self.handle_save_to_knowledge)
495
495
  r.add_get("/ui/", self.handle_ui_index)
496
496
  r.add_get("/", self.handle_index)
497
- # [v1.16.17] 文件服务 API (支持带文件名的路径: /api/file/{file_id}/{filename})
498
- # file_path 格式: "file_id" 或 "file_id/filename"
499
- r.add_get('/api/file/{file_path:.*}', self.handle_get_file)
500
- # download 路由必须在上面之后,或用专门前缀区分
501
- # 格式: /api/file/{file_id}/download 或 /api/file/{file_id}/download/{filename}
502
- r.add_get('/api/file/{file_id}/download/{filename:.*}', self.handle_download_file)
497
+ # [v1.16.17] 文件服务 API
498
+ r.add_get('/api/file/{file_id}', self.handle_get_file)
503
499
  r.add_get('/api/file/{file_id}/download', self.handle_download_file)
504
500
  # [v1.17.0] 远程桌面 (VNC) API
505
501
  r.add_get("/api/vnc/status", self.handle_vnc_status)
@@ -708,10 +704,8 @@ class ApiServer:
708
704
 
709
705
  # --- File Serving (v1.16.17) ---
710
706
  async def handle_get_file(self, request):
711
- """GET /api/file/{file_id}[/{filename}] - 在新窗口中打开/预览文件"""
712
- file_path = request.match_info.get('file_path', '')
713
- # 支持 "file_id" 和 "file_id/filename" 两种格式
714
- file_id = file_path.split('/')[0] if '/' in file_path else file_path
707
+ """GET /api/file/{file_id} - 在新窗口中打开/预览文件"""
708
+ file_id = request.match_info.get('file_id', '')
715
709
  if not file_id or len(file_id) < 8:
716
710
  return web.Response(status=404, text="File not found")
717
711
  fpath, mime = _find_upload_file(file_id)
@@ -740,7 +734,7 @@ class ApiServer:
740
734
  return resp
741
735
 
742
736
  async def handle_download_file(self, request):
743
- """GET /api/file/{file_id}/download[/{filename}] - 强制下载文件"""
737
+ """GET /api/file/{file_id}/download - 强制下载文件"""
744
738
  file_id = request.match_info.get('file_id', '')
745
739
  if not file_id or len(file_id) < 8:
746
740
  return web.Response(status=404, text="File not found")