evolclaw 2.5.8 → 2.5.10
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/data/evolclaw.sample.json +11 -19
- package/dist/channels/aun.js +17 -3
- package/dist/cli.js +5 -0
- package/dist/config.js +6 -2
- package/dist/utils/init-channel.js +7 -4
- package/dist/utils/init.js +7 -4
- package/evolclaw-install-aun.md +1 -1
- package/package.json +1 -1
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
"agentProgressSummaries": true
|
|
10
10
|
},
|
|
11
11
|
"openai": {
|
|
12
|
-
"apiKey": "
|
|
13
|
-
"baseUrl": "
|
|
12
|
+
"apiKey": "",
|
|
13
|
+
"baseUrl": "",
|
|
14
14
|
"model": "gpt-5.2-codex",
|
|
15
15
|
"effort": "medium"
|
|
16
16
|
},
|
|
17
17
|
"google": {
|
|
18
18
|
"apiKey": "",
|
|
19
|
+
"baseUrl": "",
|
|
19
20
|
"model": "gemini-2.5-flash",
|
|
20
21
|
"cliPath": "",
|
|
21
22
|
"mode": "cli"
|
|
@@ -23,29 +24,25 @@
|
|
|
23
24
|
"defaultAgent": "claude"
|
|
24
25
|
},
|
|
25
26
|
"channels": {
|
|
26
|
-
"defaultChannel": "
|
|
27
|
+
"defaultChannel": "aun",
|
|
27
28
|
"feishu": {
|
|
28
|
-
"enabled":
|
|
29
|
+
"enabled": false,
|
|
29
30
|
"appId": "",
|
|
30
31
|
"appSecret": "",
|
|
31
|
-
"owner": ""
|
|
32
|
-
"flushDelay": 10,
|
|
33
|
-
"debounce": 2,
|
|
34
|
-
"showActivities": "dm-only"
|
|
32
|
+
"owner": ""
|
|
35
33
|
},
|
|
36
34
|
"wechat": {
|
|
37
35
|
"enabled": false,
|
|
38
36
|
"baseUrl": "https://ilinkai.weixin.qq.com",
|
|
39
37
|
"token": "",
|
|
40
|
-
"owner": ""
|
|
41
|
-
"flushDelay": 3,
|
|
42
|
-
"debounce": 2,
|
|
43
|
-
"showActivities": "all"
|
|
38
|
+
"owner": ""
|
|
44
39
|
},
|
|
45
40
|
"aun": {
|
|
46
41
|
"enabled": false,
|
|
47
|
-
"aid": "
|
|
42
|
+
"aid": "",
|
|
48
43
|
"owner": "",
|
|
44
|
+
"flushDelay": 4,
|
|
45
|
+
"debounce": 2,
|
|
49
46
|
"showActivities": "owner-dm-only"
|
|
50
47
|
}
|
|
51
48
|
},
|
|
@@ -59,11 +56,6 @@
|
|
|
59
56
|
"showActivities": "all",
|
|
60
57
|
"idleMonitor": {
|
|
61
58
|
"enabled": true,
|
|
62
|
-
"timeout": 120
|
|
63
|
-
"safeModeThreshold": 0
|
|
64
|
-
},
|
|
65
|
-
"debug": {
|
|
66
|
-
"flusherDiag": false,
|
|
67
|
-
"aunTrace": false
|
|
59
|
+
"timeout": 120
|
|
68
60
|
}
|
|
69
61
|
}
|
package/dist/channels/aun.js
CHANGED
|
@@ -312,11 +312,25 @@ export class AUNChannel {
|
|
|
312
312
|
logger.info('[AUN] Agent already initialized, skipping welcome message');
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
+
// Fetch owner's agent.md to derive name and validate type
|
|
316
|
+
const ownerInfo = await this.fetchPeerInfo(owner);
|
|
317
|
+
if (ownerInfo.type !== null && ownerInfo.type !== 'human') {
|
|
318
|
+
logger.warn(`[AUN] Owner ${owner} type is "${ownerInfo.type}" (not human). Consider using a human AID as owner.`);
|
|
319
|
+
}
|
|
320
|
+
// Name: owner agent.md name (first 12 chars) → fallback to owner AID first label (first 12 chars)
|
|
321
|
+
const ownerAidClean = owner.startsWith('@') ? owner.slice(1) : owner;
|
|
322
|
+
let ownerDisplayName;
|
|
323
|
+
if (ownerInfo.name) {
|
|
324
|
+
ownerDisplayName = ownerInfo.name.slice(0, 12);
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
ownerDisplayName = ownerAidClean.split('.')[0].slice(0, 12);
|
|
328
|
+
}
|
|
329
|
+
const agentDisplayName = `${ownerDisplayName}的Evol助手`;
|
|
315
330
|
// Generate new agent.md with proper fields
|
|
316
|
-
const ownerShortId = owner.split('@')[0].slice(0, 8);
|
|
317
331
|
const newAgentMd = `---
|
|
318
332
|
aid: "${aid}"
|
|
319
|
-
name: "${
|
|
333
|
+
name: "${agentDisplayName}"
|
|
320
334
|
type: "codeagent"
|
|
321
335
|
version: "1.0.0"
|
|
322
336
|
description: "EvolClaw AI Agent Gateway - 连接 Claude/Codex 到消息通道"
|
|
@@ -327,7 +341,7 @@ tags:
|
|
|
327
341
|
initialized: true
|
|
328
342
|
---
|
|
329
343
|
|
|
330
|
-
# ${
|
|
344
|
+
# ${agentDisplayName}
|
|
331
345
|
|
|
332
346
|
EvolClaw AI Agent 网关,支持多项目会话管理和多 AI 后端切换。
|
|
333
347
|
`;
|
package/dist/cli.js
CHANGED
|
@@ -1287,6 +1287,11 @@ function getArgValue(args, flag) {
|
|
|
1287
1287
|
}
|
|
1288
1288
|
export async function main(args) {
|
|
1289
1289
|
const cmd = args[0] || 'start';
|
|
1290
|
+
if (cmd === '--version' || cmd === '-v' || cmd === '-V') {
|
|
1291
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(getPackageRoot(), 'package.json'), 'utf-8'));
|
|
1292
|
+
console.log(pkg.version);
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1290
1295
|
switch (cmd) {
|
|
1291
1296
|
case 'init':
|
|
1292
1297
|
if (args[1] === 'wechat') {
|
package/dist/config.js
CHANGED
|
@@ -379,11 +379,15 @@ function validateConfig(config) {
|
|
|
379
379
|
for (const inst of feishuInstances) {
|
|
380
380
|
if (inst.enabled === false)
|
|
381
381
|
continue;
|
|
382
|
+
const appId = inst.appId || '';
|
|
383
|
+
const appSecret = inst.appSecret || '';
|
|
384
|
+
if (!appId && !appSecret)
|
|
385
|
+
continue;
|
|
382
386
|
const label = feishuInstances.length > 1 ? ` [${inst.name}]` : '';
|
|
383
|
-
if (!
|
|
387
|
+
if (!appId || appId.startsWith('YOUR_')) {
|
|
384
388
|
logger.warn(`⚠ Feishu${label} appId not configured (Feishu channel will be disabled)`);
|
|
385
389
|
}
|
|
386
|
-
if (!
|
|
390
|
+
if (!appSecret || appSecret.startsWith('YOUR_')) {
|
|
387
391
|
logger.warn(`⚠ Feishu${label} appSecret not configured (Feishu channel will be disabled)`);
|
|
388
392
|
}
|
|
389
393
|
}
|
|
@@ -766,14 +766,17 @@ export async function setupAunAid(rl, _config) {
|
|
|
766
766
|
console.log(` ✓ AID ${result.aid} 创建成功`);
|
|
767
767
|
// 下载 CA 根证书(如果本地不存在),从 SDK 返回的实际网关 URL 派生
|
|
768
768
|
const caDownloaded = await downloadCaRoot(aunPath, result.gateway || '', ' ');
|
|
769
|
-
// 关键:
|
|
770
|
-
//
|
|
771
|
-
|
|
769
|
+
// 关键:SDK 默认 rootCaPath=null,只读取包内 bundled certs。
|
|
770
|
+
// 必须显式传 root_ca_path 指向刚下载的 root.crt,uploadAgentMd 才能验证 server cert。
|
|
771
|
+
// 同时传 aid,否则新 client 不知道该加载哪个身份,uploadAgentMd 会报
|
|
772
|
+
// "no local identity found, call auth.createAid() first"。
|
|
773
|
+
const caCertPath = path.join(aunPath, 'CA', 'root', 'root.crt');
|
|
774
|
+
if (caDownloaded && fs.existsSync(caCertPath)) {
|
|
772
775
|
try {
|
|
773
776
|
await client.close();
|
|
774
777
|
}
|
|
775
778
|
catch { /* ignore */ }
|
|
776
|
-
client = new AUNClient({ aun_path: aunPath });
|
|
779
|
+
client = new AUNClient({ aun_path: aunPath, root_ca_path: caCertPath, aid });
|
|
777
780
|
if (gatewayPort) {
|
|
778
781
|
const domain = aid.split('.').slice(1).join('.');
|
|
779
782
|
client._gatewayUrl = `wss://gateway.${domain}:${gatewayPort}/aun`;
|
package/dist/utils/init.js
CHANGED
|
@@ -421,14 +421,17 @@ export async function cmdInit(options) {
|
|
|
421
421
|
const result = await client.auth.createAid({ aid: options.aunAid });
|
|
422
422
|
// 下载 CA 根证书(如果本地不存在),从 SDK 返回的实际网关 URL 派生
|
|
423
423
|
const caDownloaded = await downloadCaRoot(aunPath, result.gateway || '');
|
|
424
|
-
// 关键:
|
|
425
|
-
//
|
|
426
|
-
|
|
424
|
+
// 关键:SDK 默认 rootCaPath=null,只读取包内 bundled certs。
|
|
425
|
+
// 必须显式传 root_ca_path 指向刚下载的 root.crt,uploadAgentMd 才能验证 server cert。
|
|
426
|
+
// 同时传 aid,否则新 client 不知道该加载哪个身份,uploadAgentMd 会报
|
|
427
|
+
// "no local identity found, call auth.createAid() first"。
|
|
428
|
+
const caCertPath = path.join(aunPath, 'CA', 'root', 'root.crt');
|
|
429
|
+
if (caDownloaded && fs.existsSync(caCertPath)) {
|
|
427
430
|
try {
|
|
428
431
|
await client.close();
|
|
429
432
|
}
|
|
430
433
|
catch { }
|
|
431
|
-
client = new AUNClient({ aun_path: aunPath });
|
|
434
|
+
client = new AUNClient({ aun_path: aunPath, root_ca_path: caCertPath, aid: options.aunAid });
|
|
432
435
|
}
|
|
433
436
|
// 写入初始 agent.md(initialized: false)
|
|
434
437
|
const agentName = options.aunAid.split('.')[0];
|
package/evolclaw-install-aun.md
CHANGED
|
@@ -70,7 +70,7 @@ evolclaw init --non-interactive \
|
|
|
70
70
|
|
|
71
71
|
此命令自动完成:
|
|
72
72
|
1. 创建配置文件 `~/.evolclaw/data/evolclaw.json`
|
|
73
|
-
2. 安装 `@
|
|
73
|
+
2. 安装 `@agentunion/aun-node`
|
|
74
74
|
3. 创建 AID 密钥对(如本地不存在)
|
|
75
75
|
4. 下载 CA 根证书到 `~/.aun/CA/root/root.crt`
|
|
76
76
|
5. 写入初始 `agent.md`(`initialized: false`)
|
package/package.json
CHANGED