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.
- package/myagent/package.json +1 -1
- package/myagent/scripts/cli.py +10 -20
- package/package.json +1 -1
- package/scripts/cli.py +10 -20
package/myagent/package.json
CHANGED
package/myagent/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.
|
|
1093
|
-
agents_data_dir = Path(
|
|
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
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
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
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.
|
|
1093
|
-
agents_data_dir = Path(
|
|
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
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
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)
|