evolclaw 3.1.4 → 3.1.6
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/CHANGELOG.md +60 -0
- package/dist/agents/claude-runner.js +398 -161
- package/dist/agents/kit-renderer.js +191 -25
- package/dist/aun/aid/agentmd.js +75 -103
- package/dist/aun/aid/client.js +1 -29
- package/dist/aun/aid/identity.js +105 -64
- package/dist/aun/aid/index.js +2 -1
- package/dist/aun/aid/store.js +74 -0
- package/dist/aun/msg/group.js +2 -2
- package/dist/aun/msg/p2p.js +26 -2
- package/dist/aun/rpc/connection.js +23 -30
- package/dist/channels/aun.js +174 -99
- package/dist/channels/dingtalk.js +2 -1
- package/dist/channels/feishu.js +301 -199
- package/dist/channels/qqbot.js +2 -1
- package/dist/channels/wechat.js +2 -1
- package/dist/channels/wecom.js +2 -1
- package/dist/cli/agent.js +21 -16
- package/dist/cli/bench.js +41 -28
- package/dist/cli/help.js +8 -0
- package/dist/cli/index.js +176 -87
- package/dist/cli/init-channel.js +5 -1
- package/dist/cli/init.js +37 -21
- package/dist/cli/link-rules.js +1 -7
- package/dist/cli/model.js +549 -0
- package/dist/cli/net-check.js +133 -50
- package/dist/cli/watch-msg.js +7 -7
- package/dist/cli/watch-web/debug-log.js +18 -0
- package/dist/cli/watch-web/server.js +306 -0
- package/dist/cli/watch-web/sources/aid.js +63 -0
- package/dist/cli/watch-web/sources/msg.js +70 -0
- package/dist/cli/watch-web/sources/session.js +638 -0
- package/dist/cli/watch-web/sources/types.js +10 -0
- package/dist/cli/watch-web/static/app.js +546 -0
- package/dist/cli/watch-web/static/index.html +54 -0
- package/dist/cli/watch-web/static/style.css +247 -0
- package/dist/config-store.js +1 -22
- package/dist/core/channel-loader.js +7 -4
- package/dist/core/command-handler.js +261 -133
- package/dist/core/evolagent-registry.js +1 -1
- package/dist/core/evolagent.js +4 -22
- package/dist/core/interaction-router.js +59 -0
- package/dist/core/message/im-renderer.js +9 -20
- package/dist/core/message/message-bridge.js +13 -9
- package/dist/core/message/message-log.js +2 -2
- package/dist/core/message/message-processor.js +211 -123
- package/dist/core/message/stream-idle-monitor.js +21 -0
- package/dist/core/model/model-catalog.js +215 -0
- package/dist/core/model/model-scope.js +250 -0
- package/dist/core/relation/peer-identity.js +58 -55
- package/dist/core/relation/peer-key.js +16 -0
- package/dist/core/session/session-fs-store.js +34 -55
- package/dist/core/session/session-key.js +24 -0
- package/dist/core/session/session-manager.js +308 -251
- package/dist/core/session/session-mapper.js +9 -4
- package/dist/core/trigger/manager.js +3 -3
- package/dist/core/trigger/parser.js +4 -4
- package/dist/core/trigger/scheduler.js +22 -7
- package/dist/index.js +61 -7
- package/dist/ipc.js +23 -1
- package/dist/utils/error-utils.js +6 -0
- package/dist/utils/process-introspect.js +7 -5
- package/kits/docs/GUIDE.md +2 -2
- package/kits/docs/INDEX.md +8 -8
- package/kits/docs/channels/aun.md +56 -17
- package/kits/docs/channels/feishu.md +41 -12
- package/kits/docs/context-assembly.md +182 -0
- package/kits/docs/evolclaw/INDEX.md +43 -0
- package/kits/docs/evolclaw/agent.md +49 -0
- package/kits/docs/evolclaw/aid.md +49 -0
- package/kits/docs/evolclaw/ctl.md +46 -0
- package/kits/docs/evolclaw/group.md +89 -0
- package/kits/docs/evolclaw/model.md +51 -0
- package/kits/docs/evolclaw/msg.md +91 -0
- package/kits/docs/evolclaw/rpc.md +35 -0
- package/kits/docs/evolclaw/storage.md +49 -0
- package/kits/docs/venues/aun-group.md +10 -0
- package/kits/docs/venues/aun-private.md +10 -0
- package/kits/docs/venues/client-desktop.md +10 -0
- package/kits/docs/venues/client-mobile.md +10 -0
- package/kits/docs/venues/feishu-group.md +13 -0
- package/kits/docs/venues/feishu-private.md +9 -0
- package/kits/docs/venues/group.md +23 -0
- package/kits/docs/venues/private.md +10 -0
- package/kits/eck_manifest.json +81 -36
- package/kits/rules/01-overview.md +20 -10
- package/kits/rules/06-channel.md +34 -27
- package/kits/templates/system-fragments/baseagent.md +7 -1
- package/kits/templates/system-fragments/channel.md +7 -5
- package/kits/templates/system-fragments/commands.md +19 -0
- package/kits/templates/system-fragments/session.md +19 -3
- package/kits/templates/system-fragments/venue.md +24 -0
- package/package.json +10 -5
- package/dist/aun/aid/lifecycle-log.js +0 -33
- package/dist/utils/aid-lifecycle-log.js +0 -33
- package/kits/docs/evolclaw/AGENT_CMD.md +0 -31
- package/kits/docs/evolclaw/MSG_GROUP.md +0 -30
- package/kits/docs/evolclaw/MSG_PRIVATE.md +0 -72
- package/kits/docs/evolclaw/tools.md +0 -25
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { resolvePaths } from '../../paths.js';
|
|
4
|
-
function ensureDir(dir) {
|
|
5
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
6
|
-
}
|
|
7
|
-
function logPath(aid) {
|
|
8
|
-
const aidName = aid.startsWith('@') ? aid.slice(1) : aid;
|
|
9
|
-
return path.join(resolvePaths().aidLogsDir, `${aidName}.jsonl`);
|
|
10
|
-
}
|
|
11
|
-
export function appendAidLifecycle(event) {
|
|
12
|
-
const filePath = logPath(event.aid);
|
|
13
|
-
ensureDir(path.dirname(filePath));
|
|
14
|
-
fs.appendFileSync(filePath, JSON.stringify(event) + '\n');
|
|
15
|
-
}
|
|
16
|
-
export function readAidLifecycle(aid, lastN = 50) {
|
|
17
|
-
const filePath = logPath(aid);
|
|
18
|
-
try {
|
|
19
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
20
|
-
const lines = content.trim().split('\n').filter(Boolean);
|
|
21
|
-
const events = [];
|
|
22
|
-
for (const line of lines.slice(-lastN)) {
|
|
23
|
-
try {
|
|
24
|
-
events.push(JSON.parse(line));
|
|
25
|
-
}
|
|
26
|
-
catch { }
|
|
27
|
-
}
|
|
28
|
-
return events;
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { resolvePaths } from '../paths.js';
|
|
4
|
-
function ensureDir(dir) {
|
|
5
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
6
|
-
}
|
|
7
|
-
function logPath(aid) {
|
|
8
|
-
const aidName = aid.startsWith('@') ? aid.slice(1) : aid;
|
|
9
|
-
return path.join(resolvePaths().aidLogsDir, `${aidName}.jsonl`);
|
|
10
|
-
}
|
|
11
|
-
export function appendAidLifecycle(event) {
|
|
12
|
-
const filePath = logPath(event.aid);
|
|
13
|
-
ensureDir(path.dirname(filePath));
|
|
14
|
-
fs.appendFileSync(filePath, JSON.stringify(event) + '\n');
|
|
15
|
-
}
|
|
16
|
-
export function readAidLifecycle(aid, lastN = 50) {
|
|
17
|
-
const filePath = logPath(aid);
|
|
18
|
-
try {
|
|
19
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
20
|
-
const lines = content.trim().split('\n').filter(Boolean);
|
|
21
|
-
const events = [];
|
|
22
|
-
for (const line of lines.slice(-lastN)) {
|
|
23
|
-
try {
|
|
24
|
-
events.push(JSON.parse(line));
|
|
25
|
-
}
|
|
26
|
-
catch { }
|
|
27
|
-
}
|
|
28
|
-
return events;
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# EvolClaw 可用命令
|
|
2
|
-
|
|
3
|
-
通过 `evolclaw ctl <command> [args]` 管理运行时配置。仅在 evolclaw 托管环境中可用。
|
|
4
|
-
|
|
5
|
-
## 查询类(所有用户)
|
|
6
|
-
- `evolclaw ctl help` — 显示帮助
|
|
7
|
-
- `evolclaw ctl status` — 显示会话状态
|
|
8
|
-
- `evolclaw ctl check` — 检查渠道健康状态
|
|
9
|
-
|
|
10
|
-
## 配置类(管理员)
|
|
11
|
-
- `evolclaw ctl model` — 查看当前模型和可选列表
|
|
12
|
-
- `evolclaw ctl model <model-id>` — 切换模型(如 `opus`, `sonnet`, `haiku`)
|
|
13
|
-
- `evolclaw ctl effort` — 查看当前推理强度
|
|
14
|
-
- `evolclaw ctl effort <low|medium|high|max>` — 切换推理强度
|
|
15
|
-
- `evolclaw ctl compact` — 压缩当前会话上下文
|
|
16
|
-
|
|
17
|
-
## 权限类
|
|
18
|
-
- `evolclaw ctl perm` — 查看当前权限模式(管理员)
|
|
19
|
-
- `evolclaw ctl perm <mode>` — 切换权限模式(仅 owner)
|
|
20
|
-
|
|
21
|
-
## 运维类(仅 owner)
|
|
22
|
-
- `evolclaw ctl activity <all|dm|owner|none>` — 查看/控制中间输出显示模式
|
|
23
|
-
- `evolclaw ctl send [channel] <message>` — 发送消息
|
|
24
|
-
- `evolclaw ctl file <path>` — 发送文件
|
|
25
|
-
- `evolclaw ctl restart` — 重启服务
|
|
26
|
-
- `evolclaw ctl restart <channel>` — 重连指定渠道
|
|
27
|
-
- `evolclaw ctl agentmd` — 查看当前 agent.md
|
|
28
|
-
- `evolclaw ctl agentmd put` — 发布本地 agent.md
|
|
29
|
-
- `evolclaw ctl agentmd set <内容>` — 直接设置 agent.md 内容
|
|
30
|
-
- `evolclaw ctl aid` — 列出所有 AUN 实例及连接状态
|
|
31
|
-
- `evolclaw ctl aid new <aid>` — 创建新 AID 并热加载
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# 群聊消息命令
|
|
2
|
-
|
|
3
|
-
<!-- TODO: 填充群聊消息命令详细参考 -->
|
|
4
|
-
|
|
5
|
-
## 发送群消息
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
evolclaw group send <from-aid> <group-id> "<message>"
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 拉取群消息
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
evolclaw group pull <self-aid> <group-id> --app <app-name>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## 群管理
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
evolclaw group create <owner-aid> --name "<group-name>"
|
|
21
|
-
evolclaw group list <self-aid>
|
|
22
|
-
evolclaw group info <self-aid> <group-id>
|
|
23
|
-
evolclaw group invite <self-aid> <group-id> <target-aid>
|
|
24
|
-
evolclaw group kick <self-aid> <group-id> <target-aid>
|
|
25
|
-
evolclaw group members <self-aid> <group-id>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## 自主回复策略
|
|
29
|
-
|
|
30
|
-
群聊中被 @ 才默认响应,可通过 venue policy 配置其他触发条件。
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# 私聊消息命令
|
|
2
|
-
|
|
3
|
-
## 发送消息
|
|
4
|
-
|
|
5
|
-
### 以指定 AID 发送(首选)
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# 明文
|
|
9
|
-
ec msg send <from-aid> <to-aid> "<message>"
|
|
10
|
-
|
|
11
|
-
# 密文(E2EE)
|
|
12
|
-
ec msg send <from-aid> <to-aid> "<message>" --encrypt
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### 发送文件
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
ec msg send <from-aid> <to-aid> --file <path>
|
|
19
|
-
ec msg send <from-aid> <to-aid> --file <path> --as image
|
|
20
|
-
ec msg send <from-aid> <to-aid> --file <path> --encrypt
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
`--as` 可选值:`image` | `video` | `voice` | `file`(默认按扩展名推断)
|
|
24
|
-
|
|
25
|
-
## 拉取消息
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
ec msg pull <self-aid> --app <app-name>
|
|
29
|
-
ec msg pull <self-aid> --app <app-name> --after-seq <N> --limit <N>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## 确认消息已读
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
ec msg ack <self-aid> <seq> --app <app-name>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
`--app` 必须传,否则会污染 daemon 游标。
|
|
39
|
-
|
|
40
|
-
## 撤回消息
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
ec msg recall <self-aid> <message-id>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## 查询在线状态
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
ec msg online <self-aid> <target-aid>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## 自主回复策略
|
|
53
|
-
|
|
54
|
-
收到消息 ≠ 必须回复。是否回复、怎么回复、何时回复由 agent 自主决定。
|
|
55
|
-
|
|
56
|
-
加密策略:
|
|
57
|
-
- 对端发来密文消息时,回复也应使用 `--encrypt`(保持对话加密一致性)
|
|
58
|
-
- 对端发来明文消息时,默认明文回复
|
|
59
|
-
|
|
60
|
-
## 在当前会话中快速回复(备选)
|
|
61
|
-
|
|
62
|
-
仅当无法使用 `ec msg send` 时(如不知道自己的 AID),可用 `ec ctl send`:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
# 明文
|
|
66
|
-
ec ctl send "<text>"
|
|
67
|
-
|
|
68
|
-
# 密文
|
|
69
|
-
ec ctl send --encrypt "<text>"
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
`ec ctl send` 自动继承当前会话的 AID 和对端,无需指定。
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# EvolClaw 可用工具
|
|
2
|
-
|
|
3
|
-
evolclaw 托管环境下,baseagent 可通过 Bash 工具调用以下命令:
|
|
4
|
-
|
|
5
|
-
## 消息发送
|
|
6
|
-
- `evolclaw ctl send "<消息>"` — 发送文本消息给当前对话方
|
|
7
|
-
- `evolclaw ctl file <路径>` — 发送项目内文件
|
|
8
|
-
|
|
9
|
-
## 运行时查询
|
|
10
|
-
- `evolclaw ctl status` — 当前会话状态
|
|
11
|
-
- `evolclaw ctl model` — 当前模型信息
|
|
12
|
-
- `evolclaw ctl effort` — 当前推理强度
|
|
13
|
-
- `evolclaw ctl check` — 渠道健康检查
|
|
14
|
-
- `evolclaw ctl aid` — AUN 连接状态
|
|
15
|
-
|
|
16
|
-
## 运行时配置
|
|
17
|
-
- `evolclaw ctl model <id>` — 切换模型
|
|
18
|
-
- `evolclaw ctl effort <level>` — 切换推理强度
|
|
19
|
-
- `evolclaw ctl compact` — 压缩上下文
|
|
20
|
-
- `evolclaw ctl perm <mode>` — 切换权限模式
|
|
21
|
-
|
|
22
|
-
## agent.md 管理
|
|
23
|
-
- `evolclaw ctl agentmd` — 查看当前 agent.md
|
|
24
|
-
- `evolclaw ctl agentmd put` — 发布到 AUN 网络
|
|
25
|
-
- `evolclaw ctl agentmd set <内容>` — 直接设置内容
|