@aiyiran/myclaw 1.0.133 → 1.0.135
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/build-manifest.js +2 -2
- package/package.json +1 -1
- package/patch-agent.js +15 -0
- package/patch-manifest.json +4 -3
package/build-manifest.js
CHANGED
|
@@ -27,7 +27,7 @@ const DEFAULT_CONFIG = {
|
|
|
27
27
|
'session.reset.idleMinutes': 90720,
|
|
28
28
|
'tools.exec.ask': 'off',
|
|
29
29
|
'tools.exec.security': 'full',
|
|
30
|
-
'gateway.auth.token': 'aiyiran'
|
|
30
|
+
// 'gateway.auth.token': 'aiyiran',// 为了志新docker关闭掉
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ function buildManifest() {
|
|
|
37
37
|
if (fs.existsSync(MANIFEST_PATH)) {
|
|
38
38
|
try {
|
|
39
39
|
existing = JSON.parse(fs.readFileSync(MANIFEST_PATH, 'utf8'));
|
|
40
|
-
} catch {}
|
|
40
|
+
} catch { }
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// 建立已有策略映射(保留手动覆盖)
|
package/package.json
CHANGED
package/patch-agent.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
const fs = require('fs');
|
|
21
21
|
const path = require('path');
|
|
22
22
|
const os = require('os');
|
|
23
|
+
const { execSync } = require('child_process');
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* 递归复制目录(幂等覆盖)
|
|
@@ -193,6 +194,20 @@ function patchAgents() {
|
|
|
193
194
|
configChanged = true;
|
|
194
195
|
uploaded++;
|
|
195
196
|
console.log('[myclaw-agent] ✅ 已上传并注册: ' + agentId + ' (' + desc + ') [' + strategy + ']');
|
|
197
|
+
|
|
198
|
+
// 自动发送出生消息,创建首个 session
|
|
199
|
+
try {
|
|
200
|
+
const nowUtc = new Date();
|
|
201
|
+
const nowBj = new Date(nowUtc.getTime() + 8 * 60 * 60 * 1000);
|
|
202
|
+
const ts = nowBj.getUTCFullYear() + '年' + (nowBj.getUTCMonth() + 1) + '月' + nowBj.getUTCDate() + '日' + String(nowBj.getUTCHours()).padStart(2, '0') + ':' + String(nowBj.getUTCMinutes()).padStart(2, '0');
|
|
203
|
+
const birthMsg = '你好,现在是北京时间' + ts;
|
|
204
|
+
const birthCmd = 'openclaw agent --agent ' + agentId + ' --message ' + JSON.stringify(birthMsg) + ' --json';
|
|
205
|
+
console.log('[myclaw-agent] 💬 发送出生消息: ' + agentId + ' ...');
|
|
206
|
+
execSync(birthCmd + ' 2>&1', { encoding: 'utf8', timeout: 45000 });
|
|
207
|
+
console.log('[myclaw-agent] 💬 出生消息已发送: ' + agentId);
|
|
208
|
+
} catch (birthErr) {
|
|
209
|
+
console.log('[myclaw-agent] ⚠️ 出生消息发送失败(非致命): ' + (birthErr.message || birthErr));
|
|
210
|
+
}
|
|
196
211
|
} else if (alreadyExists) {
|
|
197
212
|
updated++;
|
|
198
213
|
console.log('[myclaw-agent] 🔄 已覆盖更新: ' + agentId + ' (' + desc + ') [' + strategy + ']');
|
package/patch-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_doc": "MyClaw 注入清单 (auto-generated)。strategy: auto | on | off | delete",
|
|
3
|
-
"_generated": "2026-04-
|
|
3
|
+
"_generated": "2026-04-07T07:39:14.538Z",
|
|
4
4
|
"agents": [
|
|
5
5
|
{
|
|
6
6
|
"id": "danci",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{
|
|
12
12
|
"id": "kakaxi",
|
|
13
13
|
"workspace": "workspace-kakaxi",
|
|
14
|
-
"strategy": "
|
|
14
|
+
"strategy": "auto",
|
|
15
15
|
"description": "kakaxi"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"session.reset.idleMinutes": 90720,
|
|
30
30
|
"tools.exec.ask": "off",
|
|
31
31
|
"tools.exec.security": "full",
|
|
32
|
-
"gateway.auth.token": "
|
|
32
|
+
"gateway.auth.token": "123",
|
|
33
|
+
"update.checkOnStart": false
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}
|