myagent-ai 1.23.71 → 1.23.73

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.23.69",
3
+ "version": "1.23.72",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
@@ -1089,29 +1089,19 @@ async def cmd_chat(args):
1089
1089
  print("错误: 必须指定 --message 或 --file", file=sys.stderr)
1090
1090
  sys.exit(1)
1091
1091
 
1092
- # [v1.23.71] Agent 查找:按 ID 匹配(每个 Agent 有唯一 12 位 hex ID)
1093
- agents_data_dir = Path(__file__).parent.parent / "data" / "agents"
1092
+ # [v1.23.73] Agent 查找:按 ID 匹配,递归搜索所有目录层级
1093
+ agents_data_dir = Path.home() / ".myagent" / "data" / "agents"
1094
1094
  resolved_path = None
1095
1095
 
1096
1096
  if agents_data_dir.exists():
1097
- for dept_dir in agents_data_dir.iterdir():
1098
- if not dept_dir.is_dir():
1099
- continue
1100
- for ag_dir in dept_dir.iterdir():
1101
- if not ag_dir.is_dir():
1102
- continue
1103
- cf = ag_dir / "config.json"
1104
- if cf.exists():
1105
- try:
1106
- ag_cfg = json.loads(cf.read_text(encoding="utf-8"))
1107
- # 按 ID 精确匹配
1108
- if ag_cfg.get("id", "") == a.agent:
1109
- resolved_path = ag_dir.relative_to(agents_data_dir).as_posix()
1110
- break
1111
- except Exception:
1112
- pass
1113
- if resolved_path:
1114
- break
1097
+ for cfg_path in agents_data_dir.rglob("config.json"):
1098
+ try:
1099
+ ag_cfg = json.loads(cfg_path.read_text(encoding="utf-8"))
1100
+ if ag_cfg.get("id", "") == a.agent:
1101
+ resolved_path = cfg_path.parent.relative_to(agents_data_dir).as_posix()
1102
+ break
1103
+ except Exception:
1104
+ pass
1115
1105
 
1116
1106
  if not resolved_path:
1117
1107
  print(f"错误: Agent 不存在: {a.agent}(请使用Agent的ID,从群成员列表中获取)", file=sys.stderr)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.23.71",
3
+ "version": "1.23.73",
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
@@ -1089,29 +1089,19 @@ async def cmd_chat(args):
1089
1089
  print("错误: 必须指定 --message 或 --file", file=sys.stderr)
1090
1090
  sys.exit(1)
1091
1091
 
1092
- # [v1.23.71] Agent 查找:按 ID 匹配(每个 Agent 有唯一 12 位 hex ID)
1093
- agents_data_dir = Path(__file__).parent.parent / "data" / "agents"
1092
+ # [v1.23.73] Agent 查找:按 ID 匹配,递归搜索所有目录层级
1093
+ agents_data_dir = Path.home() / ".myagent" / "data" / "agents"
1094
1094
  resolved_path = None
1095
1095
 
1096
1096
  if agents_data_dir.exists():
1097
- for dept_dir in agents_data_dir.iterdir():
1098
- if not dept_dir.is_dir():
1099
- continue
1100
- for ag_dir in dept_dir.iterdir():
1101
- if not ag_dir.is_dir():
1102
- continue
1103
- cf = ag_dir / "config.json"
1104
- if cf.exists():
1105
- try:
1106
- ag_cfg = json.loads(cf.read_text(encoding="utf-8"))
1107
- # 按 ID 精确匹配
1108
- if ag_cfg.get("id", "") == a.agent:
1109
- resolved_path = ag_dir.relative_to(agents_data_dir).as_posix()
1110
- break
1111
- except Exception:
1112
- pass
1113
- if resolved_path:
1114
- break
1097
+ for cfg_path in agents_data_dir.rglob("config.json"):
1098
+ try:
1099
+ ag_cfg = json.loads(cfg_path.read_text(encoding="utf-8"))
1100
+ if ag_cfg.get("id", "") == a.agent:
1101
+ resolved_path = cfg_path.parent.relative_to(agents_data_dir).as_posix()
1102
+ break
1103
+ except Exception:
1104
+ pass
1115
1105
 
1116
1106
  if not resolved_path:
1117
1107
  print(f"错误: Agent 不存在: {a.agent}(请使用Agent的ID,从群成员列表中获取)", file=sys.stderr)