@aiyiran/myclaw 1.0.252 → 1.0.254
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,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"WebSearch"
|
|
4
|
+
"WebSearch",
|
|
5
|
+
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); agents=d.get\\('agents',{}\\).get\\('list',[]\\); [print\\(a.get\\('id'\\), '|', a.get\\('workspace',''\\)\\) for a in agents if a]\")"
|
|
5
6
|
]
|
|
6
7
|
}
|
|
7
8
|
}
|
package/package.json
CHANGED
package/patches/patch-agent.js
CHANGED
|
@@ -211,6 +211,25 @@ function patchAgents() {
|
|
|
211
211
|
} else if (alreadyExists) {
|
|
212
212
|
updated++;
|
|
213
213
|
console.log('[myclaw-agent] ✅ 已覆盖更新: ' + agentId + ' (' + desc + ') [' + strategy + ']');
|
|
214
|
+
|
|
215
|
+
// strategy=on 且 sessions 为空 → 补发出生消息(agent 存在但从未激活)
|
|
216
|
+
if (strategy === 'on') {
|
|
217
|
+
const sessionFiles = fs.readdirSync(sessionsDir).filter(f => !f.startsWith('.'));
|
|
218
|
+
if (sessionFiles.length === 0) {
|
|
219
|
+
try {
|
|
220
|
+
const nowUtc = new Date();
|
|
221
|
+
const nowBj = new Date(nowUtc.getTime() + 8 * 60 * 60 * 1000);
|
|
222
|
+
const ts = nowBj.getUTCFullYear() + '年' + (nowBj.getUTCMonth() + 1) + '月' + nowBj.getUTCDate() + '日' + String(nowBj.getUTCHours()).padStart(2, '0') + ':' + String(nowBj.getUTCMinutes()).padStart(2, '0');
|
|
223
|
+
const birthMsg = '你好,现在是北京时间' + ts;
|
|
224
|
+
const birthCmd = 'openclaw agent --agent ' + agentId + ' --message ' + JSON.stringify(birthMsg) + ' --json';
|
|
225
|
+
console.log('[myclaw-agent] → sessions 为空,补发出生消息: ' + agentId + ' ...');
|
|
226
|
+
execSync(birthCmd + ' 2>&1', { encoding: 'utf8', timeout: 45000 });
|
|
227
|
+
console.log('[myclaw-agent] ✅ 出生消息已发送: ' + agentId);
|
|
228
|
+
} catch (birthErr) {
|
|
229
|
+
console.log('[myclaw-agent] ⚠ 出生消息发送失败(非致命): ' + (birthErr.message || birthErr));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
214
233
|
} else {
|
|
215
234
|
updated++;
|
|
216
235
|
console.log('[myclaw-agent] ✅ 已更新: ' + agentId + ' (' + desc + ')');
|
|
@@ -59,11 +59,13 @@ function patchPythonDeps() {
|
|
|
59
59
|
|
|
60
60
|
for (const pkg of missing) {
|
|
61
61
|
try {
|
|
62
|
-
execSync(`pip3 install -q ${pkg}`, { stdio: 'pipe' });
|
|
62
|
+
execSync(`pip3 install -q --break-system-packages ${pkg}`, { stdio: 'pipe' });
|
|
63
63
|
console.log('[myclaw-python-deps] ✅ 已安装: ' + pkg);
|
|
64
64
|
installed.push(pkg);
|
|
65
65
|
} catch (err) {
|
|
66
|
-
|
|
66
|
+
const detail = (err.stderr && err.stderr.toString().trim()) || err.message;
|
|
67
|
+
console.log('[myclaw-python-deps] ❌ 安装失败: ' + pkg);
|
|
68
|
+
console.log(' ' + detail);
|
|
67
69
|
failed.push(pkg);
|
|
68
70
|
}
|
|
69
71
|
}
|