myagent-ai 1.24.3 → 1.24.5

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/README.md CHANGED
@@ -130,7 +130,7 @@ curl -fsSL https://raw.githubusercontent.com/ctz168/myagent/main/install/install
130
130
  myagent-ai update
131
131
  ```
132
132
 
133
- 该命令会自动完成:npm 升级全局包 → 重建虚拟环境重装所有依赖。
133
+ 该命令会自动完成:npm 升级全局包 → 检查新增依赖自动启动。
134
134
 
135
135
  ---
136
136
 
@@ -207,8 +207,11 @@ myagent-ai install
207
207
  # 重装依赖(删除 venv 重建)
208
208
  myagent-ai reinstall
209
209
 
210
- # 卸载
210
+ # 卸载(清除所有数据)
211
211
  myagent-ai uninstall
212
+
213
+ # 卸载但保留数据(配置、记忆等)
214
+ myagent-ai uninstall --keep-data
212
215
  ```
213
216
 
214
217
  > 首次运行会自动安装所有依赖,后续启动秒开。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.24.3",
3
+ "version": "1.24.5",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
@@ -444,10 +444,23 @@ function renderGroupSidebar(groupData) {
444
444
  list.innerHTML = html;
445
445
  }
446
446
 
447
- // [v1.23.79] 从群聊成员列表点击,直接发起私聊
447
+ // [v1.23.79] 从群聊成员列表/消息头像点击,直接发起私聊
448
448
  function startPrivateChatFromGroup(agentPath) {
449
449
  if (typeof selectAgent === 'function') {
450
- exitGroupChat();
450
+ // 仅做群聊清理(停轮询、清 URL/localStorage),不加载旧 agent 的 sessions
451
+ _stopGroupPolling(currentGroupId);
452
+ currentView = 'chat';
453
+ currentGroupId = null;
454
+ groupMessages = [];
455
+ StatePersistence.remove('currentView');
456
+ StatePersistence.remove('currentGroupId');
457
+ // 清除群聊 URL 中的 ?g= 参数
458
+ var cleanUrl = '/ui/chat/chat_container.html';
459
+ if (typeof state !== 'undefined' && agentPath && agentPath !== 'default') {
460
+ cleanUrl += '?a=' + encodeURIComponent(agentPath);
461
+ }
462
+ window.history.replaceState({}, '', cleanUrl);
463
+ // 让 selectAgent 处理完整的私聊切换
451
464
  selectAgent(agentPath);
452
465
  }
453
466
  }
@@ -500,7 +513,7 @@ function _renderGroupMessagesInner() {
500
513
  var agentColor = msg.agent_color || msg.color || 'var(--accent)';
501
514
  var agentRole = msg.agent_role || msg.role_detail || '';
502
515
  var agentPath = msg.agent || '';
503
- var _clickAvatar = agentPath ? ' onclick="showAgentProfile(\'' + escapeHtml(agentPath) + '\')" style="background:' + agentColor + ';color:#fff;cursor:pointer" title="点击查看简介"' : ' style="background:' + agentColor + ';color:#fff"';
516
+ var _clickAvatar = agentPath ? ' onclick="startPrivateChatFromGroup(\'' + escapeHtml(agentPath) + '\')" style="background:' + agentColor + ';color:#fff;cursor:pointer" title="点击私聊 ' + escapeHtml(agentName) + '"' : ' style="background:' + agentColor + ';color:#fff"';
504
517
  // [v1.23.82] 流式输出时显示闪烁光标
505
518
  var _streamingCursor = msg._streaming ? '<span class="streaming-cursor" style="display:inline-block;width:2px;height:1em;background:var(--accent);margin-left:2px;animation:blink 1s step-end infinite;vertical-align:text-bottom"></span>' : '';
506
519
  html += '<div class="group-msg-row">'
@@ -520,7 +533,7 @@ function _renderGroupMessagesInner() {
520
533
  var rEmoji = r.agent_emoji || r.sender_avatar || r.avatar || '🤖';
521
534
  var rColor = r.agent_color || r.color || 'var(--accent)';
522
535
  var rPath = r.agent_path || '';
523
- var _rClickAvatar = rPath ? ' onclick="showAgentProfile(\'' + escapeHtml(rPath) + '\')" style="background:' + rColor + ';color:#fff;cursor:pointer" title="点击查看简介"' : ' style="background:' + rColor + ';color:#fff"';
536
+ var _rClickAvatar = rPath ? ' onclick="startPrivateChatFromGroup(\'' + escapeHtml(rPath) + '\')" style="background:' + rColor + ';color:#fff;cursor:pointer" title="点击私聊 ' + escapeHtml(rName) + '"' : ' style="background:' + rColor + ';color:#fff"';
524
537
  html += '<div class="group-msg-row">'
525
538
  + '<div class="group-msg-avatar"' + _rClickAvatar + '>' + rEmoji + '</div>'
526
539
  + '<div>'